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 |
|---|---|---|---|---|
programs/oeis/108/A108674.asm | neoneye/loda | 22 | 176834 | <filename>programs/oeis/108/A108674.asm
; A108674: a(n) = (n+1)^2 * (n+2)^2 * (2*n+3) / 12.
; 1,15,84,300,825,1911,3920,7344,12825,21175,33396,50700,74529,106575,148800,203456,273105,360639,469300,602700,764841,960135,1193424,1470000,1795625,2176551,2619540,3131884,3721425,4396575,5166336,6040320,7028769,8142575,9393300,10793196,12355225,14093079,16021200,18154800,20509881,23103255,25952564,29076300,32493825,36225391,40292160,44716224,49520625,54729375,60367476,66460940,73036809,80123175,87749200,95945136,104742345,114173319,124271700,135072300,146611121,158925375,172053504,186035200,200911425,216724431,233517780,251336364,270226425,290235575,311412816,333808560,357474649,382464375,408832500,436635276,465930465,496777359,529236800,563371200,599244561,636922495,676472244,717962700,761464425,807049671,854792400,904768304,957054825,1011731175,1068878356,1128579180,1190918289,1255982175,1323859200,1394639616,1468415585,1545281199,1625332500,1708667500
add $0,1
lpb $0
add $2,$0
sub $0,1
add $1,$2
lpe
mul $1,$2
mov $0,$1
|
library/fmGUI_ManageSecurity/fmGUI_ManageSecurity_GoToTab_Accounts.applescript | NYHTC/applescript-fm-helper | 1 | 2318 | <filename>library/fmGUI_ManageSecurity/fmGUI_ManageSecurity_GoToTab_Accounts.applescript
-- fmGUI_ManageSecurity_GoToTab_Accounts({})
-- <NAME>, NYHTC
-- Go to the "Accounts" tab of manage security
(*
HISTORY:
1.1 - 2017-06-28 ( eshagdar ): pass in prefs
1.0 - created
REQUIRES:
fmGUI_ManageSecurity_GotoTab
*)
on run
fmGUI_ManageSecurity_GoToTab_Accounts({fullAccessAccountName:"admin", fullAccessPassword:""})
end run
--------------------
-- START OF CODE
--------------------
on fmGUI_ManageSecurity_GoToTab_Accounts(prefs)
-- version 1.1
try
fmGUI_ManageSecurity_GotoTab({tabName:"Accounts"} & prefs)
on error errMsg number errNum
error "Couldn't go to Accounts tab - " & errMsg number errNum
end try
end fmGUI_ManageSecurity_GoToTab_Accounts
--------------------
-- END OF CODE
--------------------
on fmGUI_ManageSecurity_GotoTab(prefs)
tell application "htcLib" to fmGUI_ManageSecurity_GotoTab(prefs)
end fmGUI_ManageSecurity_GotoTab
|
libsrc/_DEVELOPMENT/math/float/am9511/c/sdcc/cam32_sdcc_tanh.asm | ahjelm/z88dk | 640 | 27030 | <filename>libsrc/_DEVELOPMENT/math/float/am9511/c/sdcc/cam32_sdcc_tanh.asm<gh_stars>100-1000
SECTION code_fp_am9511
PUBLIC cam32_sdcc_tanh
EXTERN cam32_sdcc_read1, _am9511_tanh
.cam32_sdcc_tanh
call cam32_sdcc_read1
jp _am9511_tanh
|
oeis/113/A113448.asm | neoneye/loda-programs | 11 | 164268 | ; A113448: Expansion of (eta(q^2)^2 * eta(q^9) * eta(q^18)) / (eta(q) * eta(q^6)) in powers of q.
; Submitted by <NAME>(s4)
; 1,1,0,1,0,0,2,1,0,0,0,0,2,2,0,1,0,0,2,0,0,0,0,0,1,2,0,2,0,0,2,1,0,0,0,0,2,2,0,0,0,0,2,0,0,0,0,0,3,1,0,2,0,0,0,2,0,0,0,0,2,2,0,1,0,0,2,0,0,0,0,0,2,2,0,2,0,0,2,0,0,0,0,0,0,2,0,0,0,0,4,0,0,0,0,0,2,3,0,1
seq $0,265 ; Remove all factors of 2 from n; or largest odd divisor of n; or odd part of n.
seq $0,45833 ; Expansion of eta(q^9)^3 / eta(q^3) in powers of q.
|
C5515_Support_Files/C5515_Lib/dsplib_2.40.00/55x_src/rand16.asm | HeroSizy/Sizy | 0 | 17908 | ;***********************************************************
; Version 2.40.00
;***********************************************************
; Filename: rand16.asm
; Processor: C55xx
; Description: Generates 16 bit random numbers
;
; Useage: ushort oflag= rand16(DATA *r, ushort nr)
;
; Copyright Texas instruments Inc, 2000
;****************************************************************
;
; Use memory mapped register mnemonics
;-----------------------------------------------------------------------------
.mmregs
;-----------------------------------------------------------------------------
; Define constants used in the random number generation algorithm
;-----------------------------------------------------------------------------
RNDMULT .set 31821 ; Multiplier value
RNDINC .set 13849 ; Increment value
;-----------------------------------------------------------------------------
; Initialize Random Number Generator - Load the SEED value
;-----------------------------------------------------------------------------
.ref rndseed ; Global variable initialized in
; randinit()
.def _rand16
.text
_rand16:
PSH mmap(ST0_55)
PSH mmap(ST1_55)
PSH mmap(ST2_55)
PSH mmap(ST3_55)
AND #0F9DFh,mmap(@ST1_55) ; Clear M40, SATD and C54CM
BCLR ACOV0,ST0_55 ; Clear AC0 overflow flag
BCLR SMUL,ST3_55 ; Clear SMUL bit
BSET SXMD,ST1_55 ; Set SXMD
BCLR AR0LC,ST2_55 ; Set AR0 in linear mode
SUB #1,T0 ; Set up count to 'nr-1'
MOV T0,BRC0 ; Store number of vector
; elements in repeat cntr
|| MOV #RNDMULT,T1 ; Initialize register with
; constant
MOV #RNDINC,AC1 ; Initialize register with
; constant
MACM *abs16(#rndseed),T1,AC1,AC0
MOV #0,T0 ; Clear flag for returning overflow
; status
RPTBLOCAL loop_end
MOV AC0, *AR0 ; Store random number in array
loop_end:
MACM T3=*AR0+,T1,AC1,AC0 ; Generate new random number
MOV T3,*abs16(#rndseed) ; Store final result as random seed
XCC set_flag, overflow(AC0) ; Test AC0 overflow flag
set_flag: MOV #1,T0 ; If overflow, set return flag
POP mmap(ST3_55)
POP mmap(ST2_55)
POP mmap(ST1_55)
POP mmap(ST0_55)
RET
;end of file. please do not remove. it is left here to ensure that no lines of code are removed by any editor
|
programs/oeis/143/A143200.asm | karttu/loda | 1 | 3926 | <filename>programs/oeis/143/A143200.asm
; A143200: Triangle read by rows: t(n,m) is -1 if binomial(n, m) is greater than 1 and odd, otherwise t(n,m) = binomial(n, m) mod 2.
; 1,1,1,1,0,1,1,-1,-1,1,1,0,0,0,1,1,-1,0,0,-1,1,1,0,-1,0,-1,0,1,1,-1,-1,-1,-1,-1,-1,1,1,0,0,0,0,0,0,0,1,1,-1,0,0,0,0,0,0,-1,1,1,0,-1,0,0,0,0,0,-1,0,1
cal $0,177228 ; A combinatorial differential triangle sequence:q=3;t=1/q;f(t,n)=d^n/dt^n*(t/(1+t); c(t.n,m)=(1/(1+t)*f(n,t)/(f(t,m)*f(t,(n-m))
mov $1,$0
mod $1,2
|
oeis/010/A010003.asm | neoneye/loda-programs | 11 | 8065 | <reponame>neoneye/loda-programs
; A010003: a(0) = 1, a(n) = 11*n^2 + 2 for n>0.
; Submitted by <NAME>
; 1,13,46,101,178,277,398,541,706,893,1102,1333,1586,1861,2158,2477,2818,3181,3566,3973,4402,4853,5326,5821,6338,6877,7438,8021,8626,9253,9902,10573,11266,11981,12718,13477,14258,15061,15886,16733,17602,18493,19406,20341,21298,22277,23278,24301,25346,26413,27502,28613,29746,30901,32078,33277,34498,35741,37006,38293,39602,40933,42286,43661,45058,46477,47918,49381,50866,52373,53902,55453,57026,58621,60238,61877,63538,65221,66926,68653,70402,72173,73966,75781,77618,79477,81358,83261,85186,87133
mov $1,$0
cmp $1,0
pow $0,2
mul $0,11
add $0,2
sub $0,$1
|
test/Succeed/Issue2613.agda | cruhland/agda | 1,989 | 7464 | <gh_stars>1000+
-- Andreas, 2017-06-20, issue #2613, reported by <NAME>.
-- Regression introduced by fix of #2458 (which is obsolete since #2403)
module _ where
open import Agda.Builtin.Nat
module Prop' (n : Nat) where
data Prop' : Set where
_∧_ _∨_ : Prop' → Prop' → Prop'
open Prop' zero
data DView : Prop' → Set where
case₁ : (a b c : Prop') → DView ((a ∨ b) ∧ c)
case₂ : (a : Prop') → DView a
dView : (p : Prop') → DView p
dView ((a ∨ b) ∧ c) = case₁ _ _ _
dView a = case₂ _
dist-∧ : Prop' → Prop'
dist-∧ p with dView p
dist-∧ .((a ∨ b) ∧ c) | case₁ a b c = dist-∧ (a ∧ c)
dist-∧ a | case₂ .a = a
-- WAS:
-- Termination checking failed for the following functions:
-- dist-∧
-- Problematic calls:
-- dist-∧ (a ∧ c)
-- Should succeed.
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1004.asm | ljhsiun2/medusa | 9 | 85083 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r15
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x1971e, %r12
nop
nop
add $61119, %r15
mov (%r12), %edx
nop
nop
nop
dec %rcx
lea addresses_WT_ht+0xc2de, %r10
add $2632, %rsi
movl $0x61626364, (%r10)
nop
nop
nop
nop
nop
xor $37709, %r15
lea addresses_D_ht+0x7b2e, %r11
nop
nop
nop
nop
nop
add $46721, %r15
movw $0x6162, (%r11)
nop
nop
nop
xor $6821, %rsi
lea addresses_UC_ht+0xd1e, %rsi
lea addresses_normal_ht+0xbcca, %rdi
nop
nop
nop
nop
add %r15, %r15
mov $7, %rcx
rep movsw
nop
add $858, %rdx
lea addresses_WT_ht+0x31ae, %rsi
clflush (%rsi)
xor %r15, %r15
movb (%rsi), %r11b
nop
nop
nop
dec %rcx
lea addresses_D_ht+0xb530, %r10
nop
nop
add $7506, %rcx
movb (%r10), %r12b
nop
nop
dec %r11
lea addresses_UC_ht+0x371e, %rsi
lea addresses_WC_ht+0xbae2, %rdi
nop
nop
nop
nop
inc %rdx
mov $64, %rcx
rep movsl
nop
nop
nop
sub %r12, %r12
lea addresses_D_ht+0x17b9e, %rsi
lea addresses_D_ht+0xce5a, %rdi
nop
nop
nop
sub $4031, %r15
mov $105, %rcx
rep movsq
nop
nop
nop
nop
add %rsi, %rsi
lea addresses_UC_ht+0x18964, %rsi
nop
nop
nop
nop
xor $28827, %r10
mov (%rsi), %di
nop
xor $23528, %rdi
lea addresses_normal_ht+0x1db9e, %rsi
lea addresses_normal_ht+0x17a1e, %rdi
clflush (%rdi)
and $37903, %r15
mov $63, %rcx
rep movsl
cmp $33349, %r11
lea addresses_A_ht+0x1d0da, %rsi
nop
xor $21796, %rcx
movl $0x61626364, (%rsi)
nop
nop
nop
nop
inc %r10
lea addresses_WC_ht+0xf11e, %r11
nop
cmp %rsi, %rsi
movl $0x61626364, (%r11)
nop
nop
xor $51791, %rsi
lea addresses_WC_ht+0x1cd9e, %r11
nop
add %r12, %r12
mov $0x6162636465666768, %rsi
movq %rsi, %xmm1
vmovups %ymm1, (%r11)
nop
nop
nop
nop
nop
sub %r15, %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r15
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %r9
push %rbp
push %rbx
push %rsi
// Store
lea addresses_WT+0xb01e, %rbx
clflush (%rbx)
nop
nop
nop
nop
dec %r15
movb $0x51, (%rbx)
nop
nop
nop
add $7143, %rsi
// Faulty Load
lea addresses_WT+0x771e, %rbx
cmp %r9, %r9
movb (%rbx), %r11b
lea oracles, %r9
and $0xff, %r11
shlq $12, %r11
mov (%r9,%r11,1), %r11
pop %rsi
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_normal_ht'}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': True, 'congruent': 11, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_WC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4}}
{'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
*/
|
Categories/Monad/Kleisli.agda | copumpkin/categories | 98 | 12515 | {-# OPTIONS --universe-polymorphism #-}
module Categories.Monad.Kleisli where
open import Categories.Category
open import Categories.Functor using (Functor; module Functor)
open import Categories.NaturalTransformation hiding (_≡_; equiv; id)
open import Categories.Monad
Kleisli : ∀ {o ℓ e} {C : Category o ℓ e} → Monad C → Category o ℓ e
Kleisli {C = C} M = record
{ Obj = Obj
; _⇒_ = λ A B → (A ⇒ F₀ B)
; _≡_ = _≡_
; _∘_ = λ f g → (μ.η _ ∘ F₁ f) ∘ g
; id = η.η _
; assoc = assoc′
; identityˡ = identityˡ′
; identityʳ = identityʳ′
; equiv = equiv
; ∘-resp-≡ = λ f≡h g≡i → ∘-resp-≡ (∘-resp-≡ refl (F-resp-≡ f≡h)) g≡i
}
where
module M = Monad M
open M using (μ; η; F)
module μ = NaturalTransformation μ
module η = NaturalTransformation η
open Functor F
open Category C
open Equiv
.assoc′ : ∀ {A B C D} {f : A ⇒ F₀ B} {g : B ⇒ F₀ C} {h : C ⇒ F₀ D}
→ (μ.η D ∘ (F₁ ((μ.η D ∘ F₁ h) ∘ g))) ∘ f ≡ (μ.η D ∘ F₁ h) ∘ ((μ.η C ∘ F₁ g) ∘ f)
assoc′ {A} {B} {C} {D} {f} {g} {h} =
begin
(μ.η D ∘ F₁ ((μ.η D ∘ F₁ h) ∘ g)) ∘ f
↓⟨ assoc ⟩
μ.η D ∘ (F₁ ((μ.η D ∘ F₁ h) ∘ g) ∘ f)
↓⟨ ∘-resp-≡ʳ (∘-resp-≡ˡ (F-resp-≡ assoc)) ⟩
μ.η D ∘ (F₁ (μ.η D ∘ (F₁ h ∘ g)) ∘ f)
↓⟨ ∘-resp-≡ʳ (∘-resp-≡ˡ homomorphism) ⟩
μ.η D ∘ ((F₁ (μ.η D) ∘ F₁ (F₁ h ∘ g)) ∘ f)
↓⟨ ∘-resp-≡ʳ assoc ⟩
μ.η D ∘ (F₁ (μ.η D) ∘ (F₁ (F₁ h ∘ g) ∘ f))
↑⟨ assoc ⟩
(μ.η D ∘ F₁ (μ.η D)) ∘ (F₁ (F₁ h ∘ g) ∘ f)
↓⟨ ∘-resp-≡ˡ M.assoc ⟩
(μ.η D ∘ μ.η (F₀ D)) ∘ (F₁ (F₁ h ∘ g) ∘ f)
↓⟨ assoc ⟩
μ.η D ∘ (μ.η (F₀ D) ∘ (F₁ (F₁ h ∘ g) ∘ f))
↑⟨ ∘-resp-≡ʳ assoc ⟩
μ.η D ∘ ((μ.η (F₀ D) ∘ F₁ (F₁ h ∘ g)) ∘ f)
↓⟨ ∘-resp-≡ʳ (∘-resp-≡ˡ (∘-resp-≡ʳ homomorphism)) ⟩
μ.η D ∘ ((μ.η (F₀ D) ∘ (F₁ (F₁ h) ∘ F₁ g)) ∘ f)
↑⟨ ∘-resp-≡ʳ (∘-resp-≡ˡ assoc) ⟩
μ.η D ∘ (((μ.η (F₀ D) ∘ F₁ (F₁ h)) ∘ F₁ g) ∘ f)
↓⟨ ∘-resp-≡ʳ (∘-resp-≡ˡ (∘-resp-≡ˡ (μ.commute h))) ⟩
μ.η D ∘ (((F₁ h ∘ μ.η C) ∘ F₁ g) ∘ f)
↓⟨ ∘-resp-≡ʳ (∘-resp-≡ˡ assoc) ⟩
μ.η D ∘ ((F₁ h ∘ (μ.η C ∘ F₁ g)) ∘ f)
↓⟨ ∘-resp-≡ʳ assoc ⟩
μ.η D ∘ (F₁ h ∘ ((μ.η C ∘ F₁ g) ∘ f))
↑⟨ assoc ⟩
(μ.η D ∘ F₁ h) ∘ ((μ.η C ∘ F₁ g) ∘ f)
∎
where
open HomReasoning
.identityˡ′ : ∀ {A B} {f : A ⇒ F₀ B} → (μ.η B ∘ F₁ (η.η B)) ∘ f ≡ f
identityˡ′ {A} {B} {f} =
begin
(μ.η B ∘ F₁ (η.η B)) ∘ f
↓⟨ ∘-resp-≡ˡ M.identityˡ ⟩
id ∘ f
↓⟨ identityˡ ⟩
f
∎
where
open HomReasoning
.identityʳ′ : ∀ {A B} {f : A ⇒ F₀ B} → (μ.η B ∘ F₁ f) ∘ η.η A ≡ f
identityʳ′ {A} {B} {f} =
begin
(μ.η B ∘ F₁ f) ∘ η.η A
↓⟨ assoc ⟩
μ.η B ∘ (F₁ f ∘ η.η A)
↑⟨ ∘-resp-≡ʳ (η.commute f) ⟩
μ.η B ∘ (η.η (F₀ B) ∘ f)
↑⟨ assoc ⟩
(μ.η B ∘ η.η (F₀ B)) ∘ f
↓⟨ ∘-resp-≡ˡ M.identityʳ ⟩
id ∘ f
↓⟨ identityˡ ⟩
f
∎
where
open HomReasoning
|
oeis/154/A154244.asm | neoneye/loda-programs | 11 | 243197 | <reponame>neoneye/loda-programs
; A154244: a(n) = 6*a(n-1) - 2*a(n-2) for n>1; a(1)=1, a(2)=6.
; 1,6,34,192,1084,6120,34552,195072,1101328,6217824,35104288,198190080,1118931904,6317211264,35665403776,201358000128,1136817193216,6418187159040,36235488567808,204576557088768,1154988365396992,6520777078204416,36814685738432512,207846560274186240,1173449990168252416,6625006820461142016,37403140942430347264,211168832013659799552,1192206710197098102784,6730902597155269017600,38001002162537417900032,214544207780913969364992,1211263242360408980389888,6838491038600625943609344
mov $1,1
mov $2,1
lpb $0
sub $0,1
add $2,$1
add $1,$2
add $2,$1
mul $1,2
lpe
mov $0,$1
|
compiler/src/main/antlr4/api/Fun.g4 | DavidR95/FunCompiler | 1 | 3299 | <filename>compiler/src/main/antlr4/api/Fun.g4
//////////////////////////////////////////////////////////////
//
// Specification of the Fun syntactic analyser.
//
// Developed June 2012 by <NAME> (University of Glasgow).
//
// Converted to ANTLRv4 by <NAME>, August 2015.
//
// Extended September 2017 - March 2018 by <NAME>.
//
//////////////////////////////////////////////////////////////
grammar Fun;
// This specifies the Fun grammar, defining the syntax of Fun.
@header {
package api;
}
//////// Programs
program
: var_decl* proc_decl+ EOF # prog
;
//////// Declarations
proc_decl
: PROC ID
LPAR formal_decl RPAR COLON
var_decl* seq_com DOT # proc
| FUNC type ID
LPAR formal_decl RPAR COLON
var_decl* seq_com
RETURN expr DOT # func
;
formal_decl
: (type ID)? # formal
;
var_decl
: type ID ASSN expr # var
;
type
: BOOL # bool
| INT # int
;
//////// Commands
com
: ID ASSN expr # assn
| ID LPAR actual RPAR # proccall
| IF expr COLON c1=seq_com
( DOT
| ELSE COLON c2=seq_com DOT
) # if
| WHILE expr COLON
seq_com DOT # while
;
seq_com
: com* # seq
;
//////// Expressions
expr
: e1=sec_expr
( op=(EQ | LT | GT) e2=sec_expr )?
;
sec_expr
: e1=prim_expr
( op=(PLUS | MINUS | TIMES | DIV) e2=sec_expr )?
;
prim_expr
: FALSE # false
| TRUE # true
| NUM # num
| ID # id
| ID LPAR actual RPAR # funccall
| NOT prim_expr # not
| LPAR expr RPAR # parens
;
actual
: expr?
;
//////// Lexicon
BOOL : 'bool' ;
ELSE : 'else' ;
FALSE : 'false' ;
FUNC : 'func' ;
IF : 'if' ;
INT : 'int' ;
PROC : 'proc' ;
RETURN : 'return' ;
TRUE : 'true' ;
WHILE : 'while' ;
EQ : '==' ;
LT : '<' ;
GT : '>' ;
PLUS : '+' ;
MINUS : '-' ;
TIMES : '*' ;
DIV : '/' ;
NOT : 'not' ;
ASSN : '=' ;
LPAR : '(' ;
RPAR : ')' ;
COLON : ':' ;
DOT : '.' ;
NUM : DIGIT+ ;
ID : LETTER (LETTER | DIGIT)* ;
SPACE : (' ' | '\t')+ -> skip ;
EOL : '\r'? '\n' -> skip ;
COMMENT : '#' ~('\r' | '\n')* '\r'? '\n' -> skip ;
fragment LETTER : 'a'..'z' | 'A'..'Z' ;
fragment DIGIT : '0'..'9' ;
|
Groups/Subgroups/Normal/Definition.agda | Smaug123/agdaproofs | 4 | 10382 | {-# OPTIONS --safe --warning=error --without-K #-}
open import Groups.Definition
open import Setoids.Setoids
open import Groups.Subgroups.Definition
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
module Groups.Subgroups.Normal.Definition {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_+_ : A → A → A} (G : Group S _+_) where
normalSubgroup : {c : _} {pred : A → Set c} (sub : Subgroup G pred) → Set (a ⊔ c)
normalSubgroup {pred = pred} sub = {g k : A} → pred k → pred (g + (k + Group.inverse G g))
|
libsrc/stdio_new/file/stream-in/stdio_atou_any_stream.asm | andydansby/z88dk-mk2 | 1 | 99516 | <reponame>andydansby/z88dk-mk2<gh_stars>1-10
; stdio_atou_any_stream
; 05.2008 aralbrec
XLIB stdio_atou_any_stream
LIB stdio_getchar, stdio_ungetchar, l_mult, asm_toupper
; read unsigned number from stream, whitespace not skipped
;
; enter : e = radix
; ix = FILE *
; exit : hl = unsigned int result
; uses : af, bc, d, hl
.stdio_atou_any_stream
ld hl,0 ; hl = result = 0
ld d,h ; de = radix
.loop
call stdio_getchar
ret c
; is it a (any-base) digit
ld c,a
sub '0'
jr c, exit
cp 10
jr c, digit
add a,'0'
call asm_toupper
sub 'A'
jr c, exit
add a,10
.digit
cp e ; no good if digit exceeds radix
jr nc, exit
push af
call l_mult ; hl *= de, num *= radix
pop af
add a,l
ld l,a
jp nc, loop
inc h
jp loop
.exit
ld a,c
jp stdio_ungetchar
|
disorderly/disorderly-basic_rand-deviates.ads | jscparker/math_packages | 30 | 24209 | <filename>disorderly/disorderly-basic_rand-deviates.ads
-------------------------------------------------------------------------------
-- package Disorderly.Basic_Rand.Deviates, Floating point random deviates.
-- Copyright (C) 1995-2018 <NAME>
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-------------------------------------------------------------------------------
-- PACKAGE Disorderly.Basic_Rand.Deviates
--
-- Generates floating point streams of Random deviates (variates) from
-- the following distributions:
--
-- Uniform, Normal (Gaussian), Exponential, Lorentzian (Cauchy),
-- Poissonian, Binomial, Negative Binomial, Weibull, Rayleigh,
-- Student_t, Beta, Gamma, Chi_Squared, Log_Normal, Multivariate_Normal
--
-- The more complicated deviates are accompanied by routines that
-- calculate their respective probability densities. The test routine,
-- (basic_deviates_demo_1), verifies that the random variables are
-- drawn from these probability distributions, as advertized.
--
-- So basic_deviates_demo_1.adb is a useful demonstration of the
-- random variable generators in this package, as well as the exact
-- distributions they are drawn from.
--
-- The package is pure.
--
-- Most routines would grind to a halt if they had to recalculate
-- certain quantities each call. So these quantities are calculated
-- on the first call, and then placed into a record that's passed
-- as in/out parameter to keep the package pure.
--
-- Uses 53 bits of the 61-bit generator Disorderly.Basic_Rand.
--
-- For most of the routines, the time_per_call is not constant. Most
-- routines call the random number generator an unpredictable number
-- of times each time the routine is called.
--
-- Wikipedia gives extended descriptions of each distribution. The
-- probability density functions generated by the functions declared
-- below are taken directly from the Wikipedia articles on the same,
-- to ensure that the Wikipedia discussions are exactly relevant.
--
-- Uses the integer valued Disorderly.Basic_Rand in the parent package to
-- create a floating point generator (Uniform).
-- Is generic in the floating point type (as long as its 15 digits!).
--
-- Like the other routines in this collection, Deviates is designed
-- to exploit the newer 64-bit CPU's. All of the routines use
-- 15 digit floats, which means 53 bit mantissas in practice.
-- Poisson should be thought of as single precision though.
--
-- References:
--
-- <NAME> Sheppard,
-- Journal of Pascal, Ada, and Modula2, Vol 5, Num 4, (1986).
--
-- <NAME>. (1986). 'A modal method for generating binomial
-- variables', Commun. Statist. - Theor. Meth. 15(3), 805-813.
--
-- see also Fortran 77 code from the book:
-- <NAME>. 'Principles of random variate generation'
-- Clarendon Press, Oxford, 1988. ISBN 0-19-852202-9
--
-- Many thanks are due to <NAME> - most routines are based on
-- his Fortran 90 versions of the Dagpunar code.
--
-- Notes on the Distributions:
--
-- The functions approximate in a statistical manner certain continuous
-- probability distributions or densities (except Poisson and the Binomials,
-- which are integer valued here, not continuous). More precisely, if
-- you ran the program a long time, added up the number of points output
-- in each interval (X,X+dX), and plotted the resulting histogram,
-- you would get a function f(X), where f(X) is given as follows.
-- The functions are given in Normalized form.
--
-- The easy ones:
--
-- Random_Real (X, State_Val) samples from a uniform distribution:
-- = 1 for 0.0 <= X < 1.0
-- = 0 otherwise.
--
-- Exponential (Mean) = Exp (-X / Mean) / Mean for X > 0; 0 otherwise.
--
-- Normal (Mean, Sigma) =
-- = Exp (-(X - Mean)**2 / (2*Sigma**2)) / (Sigma*Sqrt(2*Pi))
--
-- Sometimes Normal is called Gaussian if Mean /=0 and Std Dev /= 1.
-- Sometimes Normal is called Std Normal if Mean =0 and Std Dev = 1.
--
-- Poisson (Mean) = Mean**k * Exp (-Mean) / k!
--
-- Output of Poisson is integer valued; Output includes 0.
--
-- The Cauchy probability density has a Lorentzian shape: (a/pi) / (a^2 + X^2).
--
-- The more complicated distribution are described well in their
-- respective Wikipedia articles.
generic
type Real is digits <>;
-- 15 digits required. This is checked.
package Disorderly.Basic_Rand.Deviates is
pragma Pure (Deviates);
procedure Get_Random_Real
(Random_Real : out Real;
Stream : in out State);
--
-- Uniform on [0.0, 1.0).
-- (X starts out on 0..2**53-1; then squeezed onto [0,1) by
-- multiplying X by 2.0**(-53).)
type Normal_Initializer is private;
procedure Get_Normal
(Mean : in Real;
Sigma : in Real;
N_Init : in out Normal_Initializer;
Stream : in out State;
Result : out Real);
--
-- 1. Must declare variable of type Normal_Initializer and pass it in.
-- The procedure Get_Normal does everything else for you.
--
-- The Gaussian distribution probability density:
--
-- f(X) = A * Exp (-(X-Mean)**2 / (2*Sigma**2))
--
-- Sigma = Standard_Deviation
-- A = 1.0 / (Sigma*Sqrt(2*Pi)) (normalization constant)
--
-- If Sigma=1, and Mean=0 then its usually called the
-- Standard Normal distribution.
function Normal_Probability
(Mean : in Real; -- Mean of random variable X
Sigma : in Real; -- Std Dev of random variable X
X : in Real)
return Real;
subtype Log_Normal_Initializer is Normal_Initializer;
procedure Get_Log_Normal -- outputs random variable X
(Mean_Z : in Real; -- Mean of random variable Z = Log (X)
Sigma_Z : in Real; -- Std Dev of random variable Z = Log (X)
LN_Init : in out Log_Normal_Initializer;
Stream : in out State;
Result : out Real); -- X
--
-- 1. Must declare variable of type Log_Normal_Initializer and pass it in.
-- The procedure Get_Log_Normal does everything else for you.
--
-- The Log_Normal distribution probability density for X:
--
-- f(X) = A * Exp (-(Log(X) - Mean_Z)**2 / (2*Sigma_Z**2)) / X
--
-- f(X) = 0 (for X <= 0)
--
-- Sigma_Z = Standard_Deviation of Z = Log (X)
-- A = 1.0 / (Sigma_Z * Sqrt (2*Pi))
--
-- If Z is a normally distributed Random Variable with (Mean_Z, Sigma_Z)
-- then X = Exp (Z) is Log_Normal distributed with the distribution given
-- above. In terms of Z's Average and Std Deviation, (Mean_Z, Sigma_Z):
-- Mean_X = Exp (Mean_Z + Sigma_Z**2 / 2)
-- Sigma_X**2 = Mean_X**2 * (Exp (Sigma_Z**2) - 1))
--
-- Suppose you have (Mean_X, Sigma_X) and you want (Mean_Z, Sigma_Z) of
-- Z = Log(X), (the latter is the pair you plug into Get_Log_Normal above).
-- The formula is
-- Sigma_Z**2 = Log (1 + Sigma_X**2 / Mean_X**2))
-- Mean_Z = Log (Mean_X) - 0.5 * Sigma_Z**2
--
function Log_Normal_Probability
(Mean_Z : in Real; -- Mean of random variable Z = Log (X)
Sigma_Z : in Real; -- Std Dev of random variable Z = Log (X)
X : in Real)
return Real;
--
-- NOT a random deviate. (Used for testing mostly.)
--
-- The Log_Normal probability density:
--
-- f(X) = A * Exp (-(Log(X) - Mean_Z)**2 / (2*Sigma_Z**2)) / X
--
-- f(X) = 0 (for X <= 0)
--
-- Sigma_Z = Standard_Deviation of Z, (where Z = Log (X)).
-- A = 1.0 / (Sigma_Z * Sqrt (2*Pi))
procedure Get_Cauchy
(A : in Real;
Stream : in out State;
Result : out Real);
--
-- The Cauchy (Lorentzian) distribution probability density:
--
-- f(X) = A / [(A*A + X*X) * Pi] -- normalized and scaled
--
-- Generates random deviates X in range (-inf, inf).
procedure Get_Exponential
(Mean : in Real;
Stream : in out State;
Result : out Real);
--
-- 1. Must have Mean > 0.0.
-- Raises contraint_Error if Mean is <= 0.0.
--
-- The Exponential distribution probability density:
--
-- f(X) = Exp (-X / Mean) / Mean for X > 0; 0 otherwise.
--
-- Generates a random deviate X in [0,inf).
procedure Get_Weibull
(a : in Real;
Stream : in out State;
Result : out Real);
--
-- The Weibull distribution probability density function:
--
-- f(X) = a * X**(a-1) * Exp (-X**a) if X > 0; f(X) = 0 otherwise.
--
-- If a=1 its Get_Exponential with Mean=1. Use Get_Exponential; much faster.
-- If a=2 its Rayleigh distribution. Use Get_Rayleigh; its faster.
-- If a=0, raises contraint_Error.
-- If a is too near 0, (or far from 1 in general) get Nan's or nonsense.
procedure Get_Rayleigh
(Stream : in out State;
Result : out Real);
--
-- The Rayleigh distribution probability density:
--
-- f(X) = 2 * X * Exp (-X**2) if X > 0; f(X) = 0 otherwise.
--
type Binomial_Initializer is private;
procedure Get_Binomial
(n : in Positive;
p : in Real;
B_Init : in out Binomial_Initializer;
Stream : in out State;
Result : out Real);
--
-- 1. Must declare variable of type Binomial_Initializer and pass it in.
-- The procedure Get_Binomial does everything else for you.
--
-- 2. Must have: 0 < p < 1. (p = Bernoulli success probability.)
--
-- The Binomial distribution probability density:
--
-- f(X) = (n!/([X]!(n-[X])!)) * p^[X] * (1-p)^(n-[X])
-- if 0 <= X <= n; f(X) = 0 otherwise.
--
-- Result is output as a float, but is always Integer valued.
function Binomial_Probability
(n : in Positive;
k : in Integer;
p : in Real)
return Real;
--
-- NOT a random deviate. (Used for testing mostly.)
--
-- Uses Log_Gamma to get:
--
-- [n!/(k!(n-k)!)] * p^k * (1-p)^(n-k)
-- if 0 <= k <= n;
-- returns 0 otherwise.
--
-- k < 0 returns 0
-- k > n returns 0
--
-- p <= 0.0 raises Constraint_Error
-- p >= 1.0 raises Constraint_Error
type Neg_Binomial_Initializer is private;
procedure Get_Neg_Binomial
(r : in Real;
p : in Real;
NB_Init : in out Neg_Binomial_Initializer;
Stream : in out State;
Result : out Real);
--
-- Result is a random deviate from distribution f_r(k) where f_r(k) is
-- the probability of r successes and k failures in n = k+r Bernoulli trials.
-- Assumes that the final trial is a success, and p = success probability.
-- (r is not retricted to integer values; output Result is. Result is k-like.)
--
-- Slow for large r, (r >> 10).
-- Slow for small p, (p < 0.1).
--
-- Must have: r > 0.0
-- r = the number of successes when r integer.
-- The random deviate output (Result) is sampled
-- from a distribution f_r(k) where f_r(k) is the
-- probability that k failures and r successes
-- are observed in a series of uncorrelated Bernoulli trials
-- (with the final trial being a success).
-- Must have: 0 < p < 1
-- p = Bernoulli success probability
--
-- Result is output as a float, but is always Integer valued.
function Neg_Binomial_Probability
(r : in Real;
k : in Integer;
p : in Real)
return Real;
--
-- NOT a random deviate. (Used for testing mostly.)
--
-- Uses Log_Gamma to get:
--
-- [Gamma(r + k)/[(Gamma(r)*k!] * p^r * (1-p)^k
--
-- Must have: r > 0.0
-- Must have: 0 < p < 1
-- p = Bernoulli success probability
--
-- Probability of r successes and k failures in n = k+r Bernoulli trials.
-- Assumes that the final trial is a success, and p = success probability.
--
-- If r = 1, the distribution is the probability of success on the (k+1)th
-- trial with k previous failures: geometric distribution, p*(1-p)^k.
-- As r -> inf, keeping the Mean = r*(1-p)/p constant, you get the
-- Poissonian distribution. So its a large p limit, opposite of Binomial.
subtype Poisson_Initializer is Binomial_Initializer;
p_Shift : constant := -20;
-- binomial is used to get Poisson, by setting p~2**(-20) and p*Mean = n.
-- p is the binomial (Bernoulli) success probability: p = 2.0**p_Shift.
-- p = -20 is stnd. If p=-20, then Max allowed Mean is < 2048, and you can
-- sample for 2 days at least without detecting difference between Poisson
-- and binomial. If you set p=-23, then you can sample for 2 wks without
-- problem, but then the maximum allowed Mean is < 256.
procedure Get_Poisson
(Mean : in Real;
P_Init : in out Poisson_Initializer;
Stream : in out State;
Result : out Real);
--
-- The Poisson distribution probability mass function:
--
-- f(k) = Mean^k * Exp (-Mean) / k!
--
-- Output of Poisson is integer valued, but floating point type.
-- Output includes 0.
--
-- Must have Mean > 0
-- Must have Mean < 2047.0 (if p_Shift = -20; ie p = 2**(-20))
-- Must have Mean < 256.0 (if p_Shift = -23; ie p = 2**(-23))
--
-- If mean > 8 then routine uses Binomial with p = 2**(-20) (with large
-- n so that Mean=n*p). The binomial distribution agrees with Poisson
-- with err ~ 5.0e-7 here. This discrepency is hard to
-- measure, but the routine should be thought of as single-precision.
-- This discrepency can be reduced by a factor of 8 by reducing p
-- by a factor of 8, (but max allowed Mean falls by a factor of 8).
function Poisson_Probability
(Mean : in Real;
k : in Integer)
return Real;
--
-- NOT a random deviate. (Used for testing mostly.)
--
-- The Poisson distribution (probability mass function):
--
-- f(k) = Mean^k * Exp (-Mean) / k!
--
-- Negative k input is allowed (for convenience).
-- Output is 0 for k < 0.
type Student_t_Initializer is private;
procedure Get_Student_t
(m : in Positive;
Student_t_Init : in out Student_t_Initializer;
Stream : in out State;
Result : out Real);
--
-- 1. Must declare variable of type Student_t_Initializer and pass it in.
-- The procedure Get_Student_t does everything else for you.
--
-- 2. Must have m >= 1. (m = degrees of freedom of distribution.)
--
-- The Student_t distribution probability density:
--
-- f(X) = (1 + X*X/m)^(-(m+1)/2) *
-- Gamma((m+1)/2) / [Sqrt (m*Pi) * Gamma(m/2)]
--
-- generates a random deviate from a t distribution
-- using Kinderman and Monahan's ratio method.
function Student_t_Probability
(m : in Positive;
x : in Real)
return Real;
--
-- A Probability density function.
--
-- NOT a random deviate. (Used for testing mostly.)
--
-- Uses Log_Gamma to get:
--
-- f(X) = Gamma((m+1)/2) * (1 + X*X/m)^(-(m+1)/2) / [Sqrt (m*Pi) * Gamma(m/2)]
type Beta_Initializer is private;
procedure Get_Beta
(aa : in Real;
bb : in Real;
Beta_Init : in out Beta_Initializer;
Stream : in out State;
Result : out Real);
--
-- 1. Must declare variable of type Beta_Initializer and pass it in.
-- The procedure Get_Beta does everything else for you.
--
-- 2. Must have aa > 0, bb > 0.
--
-- Get_Beta generates a random deviate in [0,1] from a beta distribution.
-- Uses Cheng's log logistic method.
--
-- The Beta distribution probability density:
--
-- f(X) = X**(aa-1) * (1-X)**(bb-1) *
-- Gamma (aa + bb) / (Gamma (bb)*Gamma (aa))
--
function Beta_Probability
(aa, bb : in Real;
x : in Real)
return Real;
--
-- NOT a random deviate. (Used for testing mostly.)
--
-- f(x) = x**(aa-1) * (1-x)**(bb-1) *
-- Gamma (aa + bb) / (Gamma (bb)*Gamma (aa))
--
-- x must be in range (0, 1)
type Gamma_Initializer is private;
procedure Get_Gamma
(s : in Real;
Gamma_Init : in out Gamma_Initializer;
Stream : in out State;
Result : out Real);
--
-- 1. Must declare variable of type Gamma_Initializer and pass it in.
-- The procedure Get_Gamma does everything else for you.
--
-- 2. Must have s > 0.
-- s = Shape parameter of Gamma distribution.
--
-- Generates a random deviate in [0,infinity) from a gamma distribution.
function Gamma_Probability
(s : in Real;
x : in Real)
return Real;
--
-- f(x) = x**(s-1) * Exp (-x) / Gamma (s)
-- = 0 if x < 0.
--
-- (where s = Gamma shape parameter).
-- Must have s > 0.
-- NOT a random deviate. (Used for testing mostly.)
subtype Chi_Initializer is Gamma_Initializer;
procedure Get_Chi_Squared
(Degrees_of_Freedom : in Real;
Chi_Init : in out Chi_Initializer;
Stream : in out State;
Result : out Real);
--
-- 1. Must declare variable of type Chi_Initializer and pass it in.
-- The procedure Get_Chi_Squared does everything else for you.
--
-- 2. Must have Degrees_of_Freedom > 0.
--
-- Generates a random deviate in [0,infinity) from a Chi-Sq distribution.
function Chi_Squared_Probability
(Degrees_of_Freedom : in Real;
x : in Real)
return Real;
--
-- f(x) = (1 / 2) * (x / 2)**(s-1) * Exp (-x / 2) / Gamma (s)
-- = 0 if x < 0.
--
-- (where s = 0.5 * Degrees_of_Freedom).
-- NOT a random deviate. (Used for testing mostly.)
-- USING Get_Multivariate_Normal:
--
-- procedure Get_Multivariate_Normal is harder to use than the 1-dimensional
-- routines. You have to remember the following:
-- 1. You need a positive definite Covariance matrix.
-- 2. Declare it type Matrix (a..b, a..b) where a and b are type Positive.
-- 3. Declare Means : Vector(a..b), same range as Matrix, and initialize Means.
-- 4. Use procedure Choleski_Decompose to get the LU decomp. of Covariance.
subtype MV_Normal_Initializer is Normal_Initializer;
type Vector is array (Positive range <>) of Real;
type Matrix is array (Positive range <>, Positive range <>) of Real;
procedure Choleski_Decompose
(Covariance : in Matrix;
LU_of_Covariance : out Matrix); -- Choleski Decomp of Covariance matrix.
procedure Get_Multivariate_Normal
(Mean : in Vector;
LU_of_Covariance : in Matrix;
MV_Init : in out MV_Normal_Initializer;
Stream : in out State;
Result : out Vector);
--
-- To use Get_Multivariate_Normal:
-- put a Positive Definite Covariance matrix into
-- Choleski_Decompose to get Sqrt_Covariance.
--
-- Must have
-- Mean'First = Covariance'First(1) = Covariance'First(2)
-- Mean'Last = Covariance'Last(1) = Covariance'Last(2)
-- Mean'Length > 1
-- So use:
-- Mean : Vector (1..n);
-- Covariance : Matrix (1..n, 1..n);
--
-- Must initialize: Mean.
function Multivariate_Normal_Probability
(Mean : in Vector; -- Mean of random variables X
LU_of_Covariance : in Matrix; -- L of LU decomp of Covariance matrix
X : in Vector)
return Real;
procedure Test_Choleski;
private
Half : constant Real := +0.5;
Zero : constant Real := +0.0;
One : constant Real := +1.0;
Two : constant Real := +2.0;
Three : constant Real := +3.0;
Four : constant Real := +4.0;
Five : constant Real := +5.0;
Eight : constant Real := +8.0;
Sixteen : constant Real := +16.0;
Quarter : constant Real := +0.25;
Two_to_the_Ninth : constant Real := +512.0;
type Binomial_Initializer is
record
n : Positive := Positive'First;
r0 : Integer := 0;
p : Real := Half;
p_r : Real := Zero;
odds_ratio : Real := Zero;
Uninitialized : Boolean := True;
end record;
type Student_t_Initializer is
record
m : Positive := Positive'First;
a, f, g : Real := Zero;
Uninitialized : Boolean := True;
end record;
type Beta_Initializer is
record
Alpha, Beta : Real := Zero;
d, f, h, t, c : Real := Zero;
Swap : Boolean := False;
Uninitialized : Boolean := True;
end record;
type Gamma_Initializer is
record
s, p, c, uf, vr, d : Real := Zero;
Uninitialized : Boolean := True;
end record;
type Neg_Binomial_Initializer is
record
Reciprocal_Log_p1 : Real := Zero;
Reciprocal_Log_q1 : Real := Zero;
p : Real := Half;
Uninitialized : Boolean := True;
end record;
type Normal_Initializer is
record
Mean : Real := Zero;
Sigma : Real := Zero;
X2 : Real := Zero;
Uninitialized : Boolean := True;
end record;
Max_Allowed_Real : constant Real := Two**(Real'Machine_Emax-32);
Min_Allowed_Real : constant Real := Two**(Real'Machine_Emin+32);
end Disorderly.Basic_Rand.Deviates;
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_602.asm | ljhsiun2/medusa | 9 | 96453 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x1df1b, %r15
nop
nop
nop
nop
nop
sub %rax, %rax
mov (%r15), %esi
nop
nop
nop
nop
nop
and %rsi, %rsi
lea addresses_WC_ht+0x163fb, %rsi
lea addresses_normal_ht+0x150df, %rdi
clflush (%rdi)
nop
cmp %r9, %r9
mov $12, %rcx
rep movsl
nop
and $64170, %r9
lea addresses_UC_ht+0x7552, %rsi
and %r14, %r14
vmovups (%rsi), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %rax
nop
xor %rsi, %rsi
lea addresses_A_ht+0x5b3b, %r9
add %rax, %rax
movl $0x61626364, (%r9)
nop
nop
nop
and $32611, %rcx
lea addresses_A_ht+0xfdbb, %rsi
lea addresses_UC_ht+0xe4b, %rdi
sub %rax, %rax
mov $2, %rcx
rep movsw
nop
and %r9, %r9
lea addresses_normal_ht+0x16e01, %rsi
lea addresses_A_ht+0x14e5b, %rdi
and $3996, %r9
mov $5, %rcx
rep movsq
nop
nop
nop
nop
nop
cmp %r15, %r15
lea addresses_normal_ht+0xa3bb, %rdi
nop
nop
nop
cmp $46051, %rax
movw $0x6162, (%rdi)
sub %r15, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %rbx
push %rcx
push %rdi
// Faulty Load
lea addresses_RW+0x11dbb, %rcx
nop
nop
sub %r15, %r15
vmovups (%rcx), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %r13
lea oracles, %rdi
and $0xff, %r13
shlq $12, %r13
mov (%rdi,%r13,1), %r13
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_RW', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_RW', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4}}
{'src': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}}
{'src': {'same': False, 'congruent': 0, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 2}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
tools-src/gnu/gcc/gcc/ada/dec-io.ads | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 20822 | <reponame>enfoTek/tomato.linksys.e2000.nvram-mod
------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- D E C . I O --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1996-2001 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is an AlphaVMS package that contains the declarations and
-- function specifications needed by the DECLib IO packages.
with System.Task_Primitives;
package DEC.IO is
private
type Exception_Number is (
GNAT_EN_LOCK_ERROR,
GNAT_EN_EXISTENCE_ERROR,
GNAT_EN_KEY_ERROR,
GNAT_EN_KEYSIZERR,
GNAT_EN_STAOVF,
GNAT_EN_CONSTRAINT_ERRO,
GNAT_EN_IOSYSFAILED,
GNAT_EN_LAYOUT_ERROR,
GNAT_EN_STORAGE_ERROR,
GNAT_EN_DATA_ERROR,
GNAT_EN_DEVICE_ERROR,
GNAT_EN_END_ERROR,
GNAT_EN_MODE_ERROR,
GNAT_EN_NAME_ERROR,
GNAT_EN_STATUS_ERROR,
GNAT_EN_NOT_OPEN,
GNAT_EN_ALREADY_OPEN,
GNAT_EN_USE_ERROR,
GNAT_EN_UNSUPPORTED,
GNAT_EN_FAC_MODE_MISMAT,
GNAT_EN_ORG_MISMATCH,
GNAT_EN_RFM_MISMATCH,
GNAT_EN_RAT_MISMATCH,
GNAT_EN_MRS_MISMATCH,
GNAT_EN_MRN_MISMATCH,
GNAT_EN_KEY_MISMATCH,
GNAT_EN_MAXLINEXC,
GNAT_EN_LINEXCMRS);
for Exception_Number'Size use 32;
for Exception_Number use (
GNAT_EN_LOCK_ERROR => 1,
GNAT_EN_EXISTENCE_ERROR => 2,
GNAT_EN_KEY_ERROR => 3,
GNAT_EN_KEYSIZERR => 4,
GNAT_EN_STAOVF => 5,
GNAT_EN_CONSTRAINT_ERRO => 6,
GNAT_EN_IOSYSFAILED => 7,
GNAT_EN_LAYOUT_ERROR => 8,
GNAT_EN_STORAGE_ERROR => 9,
GNAT_EN_DATA_ERROR => 10,
GNAT_EN_DEVICE_ERROR => 11,
GNAT_EN_END_ERROR => 12,
GNAT_EN_MODE_ERROR => 13,
GNAT_EN_NAME_ERROR => 14,
GNAT_EN_STATUS_ERROR => 15,
GNAT_EN_NOT_OPEN => 16,
GNAT_EN_ALREADY_OPEN => 17,
GNAT_EN_USE_ERROR => 18,
GNAT_EN_UNSUPPORTED => 19,
GNAT_EN_FAC_MODE_MISMAT => 20,
GNAT_EN_ORG_MISMATCH => 21,
GNAT_EN_RFM_MISMATCH => 22,
GNAT_EN_RAT_MISMATCH => 23,
GNAT_EN_MRS_MISMATCH => 24,
GNAT_EN_MRN_MISMATCH => 25,
GNAT_EN_KEY_MISMATCH => 26,
GNAT_EN_MAXLINEXC => 27,
GNAT_EN_LINEXCMRS => 28);
procedure Raise_IO_Exception (EN : Exception_Number);
pragma Export_Procedure (Raise_IO_Exception, "GNAT$RAISE_IO_EXCEPTION",
Mechanism => Value);
package IO_Locking is
type Access_Mutex is private;
function Create_Mutex return Access_Mutex;
procedure Acquire (M : Access_Mutex);
procedure Release (M : Access_Mutex);
private
type Access_Mutex is access System.Task_Primitives.RTS_Lock;
pragma Export_Function (Create_Mutex, "GNAT$CREATE_MUTEX",
Mechanism => Value);
pragma Export_Procedure (Acquire, "GNAT$ACQUIRE_MUTEX",
Mechanism => Value);
pragma Export_Procedure (Release, "GNAT$RELEASE_MUTEX",
Mechanism => Value);
end IO_Locking;
end DEC.IO;
|
src/main/antlr4/com/github/bigdata/sql/antlr4/stream/StreamSqlParser.g4 | duhanmin/bigdata-sql-parser | 1 | 3451 | parser grammar StreamSqlParser;
options { tokenVocab=StreamSqlLexer; }
root
: sqlStatements? MINUSMINUS? EOF
;
sqlStatements
: (sqlStatement MINUSMINUS? SEMI | emptyStatement)*
(sqlStatement (MINUSMINUS? SEMI)? | emptyStatement)
;
sqlStatement
: createSoureTable | createSinkTable | createView | createFunction | insertStatement
| setStatement
;
createSoureTable
: CREATE SOURCE TABLE tableName
'(' columns=colTypeList ')'
WITH tableProps=tablePropertyList
timeMode=timeModeExpr
;
createSinkTable
: CREATE SINK TABLE tableName
'(' columns=colTypeList ')'
WITH tableProps=tablePropertyList
;
createView
: CREATE VIEW tableName AS
select = selectExpr
;
createFunction
: CREATE FUNCTION functionName AS className=STRING_LITERAL
USING jarFile=STRING_LITERAL
;
insertStatement
: INSERT INTO tableName
select = selectExpr
;
setStatement
: SET setKeyExpr EQUAL_SYMBOL valueKeyExpr
;
emptyStatement
: SEMI
;
setKeyExpr
: ID (DOT_ID)*
;
valueKeyExpr
: word (word)*
;
selectExpr
: word (word)*
;
word
: ID
| DOT_ID
| STRING_LITERAL | DECIMAL_LITERAL | REAL_LITERAL | booleanValue
| AS | BY | PROCTIME | SET
| STAR | DIVIDE | MODULE | PLUS | MINUS
| EQUAL_SYMBOL | GREATER_SYMBOL | LESS_SYMBOL | EXCLAMATION_SYMBOL
| BIT_NOT_OP | BIT_OR_OP | BIT_AND_OP | BIT_XOR_OP
| LR_BRACKET | RR_BRACKET | COMMA
;
colTypeList
: colType (',' colType)*
;
colType
: ID (jsonPath=STRING_LITERAL)? dataType (COMMENT comment=STRING_LITERAL)?
;
dataType
: VARCHAR | BOOLEAN | TINYINT | SMALLINT | INT | BIGINT
| FLOAT | DECIMAL | DOUBLE
| DATE | TIME | TIMESTAMP
;
tablePropertyList
: '(' tableProperty (',' tableProperty)* ')'
;
tableProperty
: key=tablePropertyKey EQUAL_SYMBOL value=tablePropertyValue
;
tablePropertyKey
: ID (DOT_ID)*
| STRING_LITERAL
;
tablePropertyValue
: DECIMAL_LITERAL
| booleanValue
| STRING_LITERAL
;
booleanValue
: TRUE | FALSE
;
timeModeExpr
: TIMESTAMP BY timeMode=PROCTIME attrName=attrNameExpr
| TIMESTAMP BY timeMode=ROWTIME attrName=attrNameExpr
SET WATERMARK DELAY time=DECIMAL_LITERAL
;
attrNameExpr
: PROCTIME
| ROWTIME
| ID
;
tableName
: ID
;
functionName
: ID
; |
data/pokemon/base_stats/onix.asm | AtmaBuster/pokeplat-gen2 | 6 | 84835 | db 0 ; species ID placeholder
db 35, 45, 160, 70, 30, 45
; hp atk def spd sat sdf
db ROCK, GROUND ; type
db 45 ; catch rate
db 108 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F50 ; gender ratio
db 25 ; step cycles to hatch
INCBIN "gfx/pokemon/onix/front.dimensions"
db GROWTH_MEDIUM_FAST ; growth rate
dn EGG_MINERAL, EGG_MINERAL ; egg groups
db 70 ; happiness
; tm/hm learnset
tmhm ROAR, TOXIC, HIDDEN_POWER, SUNNY_DAY, TAUNT, PROTECT, FRUSTRATION, IRON_TAIL, EARTHQUAKE, RETURN, DIG, DOUBLE_TEAM, SANDSTORM, ROCK_TOMB, TORMENT, FACADE, SECRET_POWER, REST, ATTRACT, ENDURE, DRAGON_PULSE, EXPLOSION, PAYBACK, ROCK_POLISH, STONE_EDGE, GYRO_BALL, STEALTH_ROCK, PSYCH_UP, CAPTIVATE, ROCK_SLIDE, SLEEP_TALK, NATURAL_GIFT, SWAGGER, SUBSTITUTE, FLASH_CANNON, STRENGTH, ROCK_SMASH, ROCK_CLIMB, ANCIENTPOWER, EARTH_POWER, IRON_HEAD, MUD_SLAP, ROLLOUT, SNORE, TWISTER
; end
|
webtack/webidl-parser/src/main/antlr/WebIDLLexer.g4 | akasha/akasha | 16 | 6851 | // See the WebIDLParser file for a description of the grammar and how it differs from the spec.
lexer grammar WebIDLLexer;
ASYNC : 'async';
ATTRIBUTE : 'attribute';
EVENT : 'event';
CALLBACK : 'callback';
CONST : 'const';
CONSTRUCTOR : 'constructor';
DELETER : 'deleter';
DICTIONARY : 'dictionary';
ENUM : 'enum';
GETTER : 'getter';
INCLUDES : 'includes';
INHERIT : 'inherit';
INTERFACE : 'interface';
ITERABLE : 'iterable';
MAPLIKE : 'maplike';
MIXIN : 'mixin';
NAMESPACE : 'namespace';
PARTIAL : 'partial';
READONLY : 'readonly';
REQUIRED : 'required';
SETLIKE : 'setlike';
SETTER : 'setter';
STATIC : 'static';
STRINGIFIER : 'stringifier';
TYPEDEF : 'typedef';
UNRESTRICTED : 'unrestricted';
OPTIONAL : 'optional';
VOID : 'void';
UNDEFINED : 'undefined';
ANY : 'any';
SEQUENCE : 'sequence';
OBJECT : 'object';
FROZEN_ARRAY : 'FrozenArray';
BOOLEAN : 'boolean';
BYTE : 'byte';
OCTET : 'octet';
FLOAT : 'float';
DOUBLE : 'double';
UNSIGNED : 'unsigned';
OPEN_ANGLE_BRACKET : '<';
CLOSE_ANGLE_BRACKET : '>';
OR : 'or';
SHORT : 'short';
LONG : 'long';
BYTE_STRING : 'ByteString';
DOM_STRING : 'DOMString';
USV_STRING : 'USVString';
PROMISE : 'Promise';
RECORD : 'record';
QUESTION_MARK : '?';
OPEN_BRACE : '{';
CLOSE_BRACE : '}';
OPEN_BRACKET : '(';
CLOSE_BRACKET : ')';
OPEN_SQUARE_BRACKET : '[';
CLOSE_SQUARE_BRACKET : ']';
SEMI_COLON : ';';
COLON : ':';
EQUALS : '=';
DOT : '.';
COMMA : ',';
ELLIPSIS : '...';
NULL : 'null';
TRUE : 'true';
FALSE : 'false';
NEGATIVE_INFINITY : '-Infinity';
POSITIVE_INFINITY : 'Infinity';
NAN : 'NaN';
INTEGER
: '-'?([1-9][0-9]*|'0'([Xx][0-9A-Fa-f]+|[0-7]*))
;
DECIMAL
: '-'?(([0-9]+'.'[0-9]*|[0-9]*'.'[0-9]+)([Ee][+\-]?[0-9]+)?|[0-9]+[Ee][+\-]?[0-9]+)
;
IDENTIFIER
: [_-]?[A-Za-z][0-9A-Z_a-z\-]*
;
STRING
: '"' ~["]* '"'
;
WHITESPACE
: [\t\n\r ]+ -> channel(HIDDEN)
;
JAVADOC_START
: '/**' STAR* -> mode(JAVADOC)
;
COMMENT
: ('//'~[\n\r]*|'/*'~[*]+(.|'\n')*?'*/')+ -> channel(HIDDEN)
; // Note: '/''/'~[\n\r]* instead of '/''/'.* (non-greedy because of wildcard).
mode JAVADOC;
NAME
: [a-zA-Z]+
;
NEWLINE
: '\n' (SPACE? (STAR {_input.LA(1) != '/'}?)+)?
| '\r\n' (SPACE? (STAR {_input.LA(1) != '/'}?)+)?
| '\r' (SPACE? (STAR {_input.LA(1) != '/'}?)+)?
;
SPACE
: (' '|'\t')+
;
TEXT_CONTENT
: ~[\n\r\t @*{}/a-zA-Z]+
;
AT
: '@'
;
STAR
: '*'
;
SLASH
: '/'
;
JAVADOC_END
: SPACE? STAR* '*/' -> mode(DEFAULT_MODE)
;
INLINE_TAG_START
: '{@'
;
BRACE_OPEN
: '{'
;
BRACE_CLOSE
: '}'
;
|
StateDefine.asm | absindx/ResumeCartridge | 0 | 179528 | <filename>StateDefine.asm
;--------------------------------------------------
; State define
;--------------------------------------------------
; Load state data
Align 256
State_Ram:
.incbin "State/SMBOrigMap/Ram.bin"
Align 256
State_Oam:
.incbin "State/SMBOrigMap/Oam.bin"
State_Nametable:
Align 256
.incbin "State/SMBOrigMap/Nametable.bin"
State_Palette:
.incbin "State/SMBOrigMap/Palette.bin"
; Mirroring setting (0=Horizontal , 1=Vertical)
State_Mirroring = 1
; Stack pointer initialize value
State_StackPointer = $FF
; Execution start address
State_ResumeAddress = $8054
; RAM address to insert wait code
InsertCodeAddress = $0120 ; Use 25 bytes + ResumeCode length
; Key to return from standby state
ResumeKey = $20 ; Select key
; Code to execute before jumping to the resume address
ResumeCode .macro
; $8054 : JSR $8EED
; $8EED : STA $2000
; $8EF0 : STA $0778
; $8EF3 : RTS
; $8057 : JMP $8057 ; infinity loop
; -> Just load #$90 into A and jump to $8054
LDA #$90
JMP State_ResumeAddress
. .endm
|
generated/natools-static_maps-web-tag_pages.ads | faelys/natools-web | 1 | 28286 | <reponame>faelys/natools-web<filename>generated/natools-static_maps-web-tag_pages.ads
-- Generated at 2015-03-03 23:00:05 +0000 by Natools.Static_Hash_Maps
-- from src/natools-web-tag_pages-maps.sx
package Natools.Static_Maps.Web.Tag_Pages is
pragma Pure;
type Command is
(Unknown_Command,
Current_Tag,
If_Index,
If_Slash_Index,
If_Slashless_Index,
If_Tag,
Root_Tag);
type Component is
(Unknown_Component,
Elements,
Index_Elements,
No_Slash_Index,
No_Slash_Redirect,
No_Slashless_Index,
No_Slashless_Redirect,
Root,
Slash_Index_Elements,
Slash_Redirect,
Slashless_Index_Elements,
Slashless_Redirect,
Tag_Elements);
function To_Command (Key : String) return Command;
function To_Component (Key : String) return Component;
private
Map_1_Key_0 : aliased constant String := "current-tag";
Map_1_Key_1 : aliased constant String := "current";
Map_1_Key_2 : aliased constant String := "if-index";
Map_1_Key_3 : aliased constant String := "if-slash-index";
Map_1_Key_4 : aliased constant String := "if-slashless-index";
Map_1_Key_5 : aliased constant String := "if-tag";
Map_1_Key_6 : aliased constant String := "if-child";
Map_1_Key_7 : aliased constant String := "root-tag";
Map_1_Key_8 : aliased constant String := "root";
Map_1_Keys : constant array (0 .. 8) of access constant String
:= (Map_1_Key_0'Access,
Map_1_Key_1'Access,
Map_1_Key_2'Access,
Map_1_Key_3'Access,
Map_1_Key_4'Access,
Map_1_Key_5'Access,
Map_1_Key_6'Access,
Map_1_Key_7'Access,
Map_1_Key_8'Access);
Map_1_Elements : constant array (0 .. 8) of Command
:= (Current_Tag,
Current_Tag,
If_Index,
If_Slash_Index,
If_Slashless_Index,
If_Tag,
If_Tag,
Root_Tag,
Root_Tag);
Map_2_Key_0 : aliased constant String := "elements";
Map_2_Key_1 : aliased constant String := "index-elements";
Map_2_Key_2 : aliased constant String := "no-slash";
Map_2_Key_3 : aliased constant String := "no-slash-index";
Map_2_Key_4 : aliased constant String := "no-slash-redirect";
Map_2_Key_5 : aliased constant String := "no-slashless";
Map_2_Key_6 : aliased constant String := "no-slashless-index";
Map_2_Key_7 : aliased constant String := "no-slashless-redirect";
Map_2_Key_8 : aliased constant String := "root";
Map_2_Key_9 : aliased constant String := "root-tag";
Map_2_Key_10 : aliased constant String := "slash-elements";
Map_2_Key_11 : aliased constant String := "slash-index-elements";
Map_2_Key_12 : aliased constant String := "slash-redirect";
Map_2_Key_13 : aliased constant String := "redirect-slash-index";
Map_2_Key_14 : aliased constant String := "redirect-index-to-slashless";
Map_2_Key_15 : aliased constant String := "redirect-to-slashless";
Map_2_Key_16 : aliased constant String := "slashless-elements";
Map_2_Key_17 : aliased constant String := "slashless-index-elements";
Map_2_Key_18 : aliased constant String := "slashless-redirect";
Map_2_Key_19 : aliased constant String := "redirect-slashless-index";
Map_2_Key_20 : aliased constant String := "redirect-index-to-slash";
Map_2_Key_21 : aliased constant String := "redirect-to-slash";
Map_2_Key_22 : aliased constant String := "tag-elements";
Map_2_Keys : constant array (0 .. 22) of access constant String
:= (Map_2_Key_0'Access,
Map_2_Key_1'Access,
Map_2_Key_2'Access,
Map_2_Key_3'Access,
Map_2_Key_4'Access,
Map_2_Key_5'Access,
Map_2_Key_6'Access,
Map_2_Key_7'Access,
Map_2_Key_8'Access,
Map_2_Key_9'Access,
Map_2_Key_10'Access,
Map_2_Key_11'Access,
Map_2_Key_12'Access,
Map_2_Key_13'Access,
Map_2_Key_14'Access,
Map_2_Key_15'Access,
Map_2_Key_16'Access,
Map_2_Key_17'Access,
Map_2_Key_18'Access,
Map_2_Key_19'Access,
Map_2_Key_20'Access,
Map_2_Key_21'Access,
Map_2_Key_22'Access);
Map_2_Elements : constant array (0 .. 22) of Component
:= (Elements,
Index_Elements,
No_Slash_Index,
No_Slash_Index,
No_Slash_Redirect,
No_Slashless_Index,
No_Slashless_Index,
No_Slashless_Redirect,
Root,
Root,
Slash_Index_Elements,
Slash_Index_Elements,
Slash_Redirect,
Slash_Redirect,
Slash_Redirect,
Slash_Redirect,
Slashless_Index_Elements,
Slashless_Index_Elements,
Slashless_Redirect,
Slashless_Redirect,
Slashless_Redirect,
Slashless_Redirect,
Tag_Elements);
end Natools.Static_Maps.Web.Tag_Pages;
|
oeis/040/A040954.asm | neoneye/loda-programs | 11 | 89794 | ; A040954: Continued fraction for sqrt(986).
; Submitted by <NAME>
; 31,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2,62,2,2
mov $1,$0
cmp $0,0
sub $1,$0
gcd $1,3
add $1,13
add $0,$1
pow $0,2
sub $0,194
|
clients/ada/generated/src/model/-models.adb | shinesolutions/swagger-aem | 39 | 1043 | -- Adobe Experience Manager (AEM) API
-- Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API
--
-- The version of the OpenAPI document: 3.5.0_pre.0
-- Contact: <EMAIL>
--
-- NOTE: This package is auto generated by OpenAPI-Generator 5.2.1.
-- https://openapi-generator.tech
-- Do not edit the class manually.
package body .Models is
pragma Style_Checks ("-mr");
pragma Warnings (Off, "*use clause for package*");
use Swagger.Streams;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatusStatus_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("finished", Value.Finished);
Into.Write_Entity ("itemCount", Value.Item_Count);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatusStatus_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatusStatus_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "finished", Value.Finished);
Swagger.Streams.Deserialize (Object, "itemCount", Value.Item_Count);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatusStatus_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : InstallStatusStatus_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatus_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "status", Value.Status);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in InstallStatus_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatus_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "status", Value.Status);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out InstallStatus_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : InstallStatus_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsString_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Into.Write_Entity ("value", Value.Value);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsString_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsString_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsString_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsString_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsBoolean_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Into.Write_Entity ("value", Value.Value);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsBoolean_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsBoolean_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsBoolean_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsBoolean_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreItems_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("alias", Value.Alias);
Into.Write_Entity ("entryType", Value.Entry_Type);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("issuer", Value.Issuer);
Into.Write_Entity ("notBefore", Value.Not_Before);
Into.Write_Entity ("notAfter", Value.Not_After);
Into.Write_Entity ("serialNumber", Value.Serial_Number);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreItems_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreItems_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "alias", Value.Alias);
Swagger.Streams.Deserialize (Object, "entryType", Value.Entry_Type);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "issuer", Value.Issuer);
Swagger.Streams.Deserialize (Object, "notBefore", Value.Not_Before);
Swagger.Streams.Deserialize (Object, "notAfter", Value.Not_After);
Swagger.Streams.Deserialize (Object, "serialNumber", Value.Serial_Number);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreItems_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : TruststoreItems_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreInfo_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "aliases", Value.Aliases);
Into.Write_Entity ("exists", Value.Exists);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TruststoreInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "aliases", Value.Aliases);
Swagger.Streams.Deserialize (Object, "exists", Value.Exists);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TruststoreInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : TruststoreInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreChainItems_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("subject", Value.Subject);
Into.Write_Entity ("issuer", Value.Issuer);
Into.Write_Entity ("notBefore", Value.Not_Before);
Into.Write_Entity ("notAfter", Value.Not_After);
Into.Write_Entity ("serialNumber", Value.Serial_Number);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreChainItems_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreChainItems_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "subject", Value.Subject);
Swagger.Streams.Deserialize (Object, "issuer", Value.Issuer);
Swagger.Streams.Deserialize (Object, "notBefore", Value.Not_Before);
Swagger.Streams.Deserialize (Object, "notAfter", Value.Not_After);
Swagger.Streams.Deserialize (Object, "serialNumber", Value.Serial_Number);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreChainItems_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : KeystoreChainItems_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreItems_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("alias", Value.Alias);
Into.Write_Entity ("entryType", Value.Entry_Type);
Into.Write_Entity ("algorithm", Value.Algorithm);
Into.Write_Entity ("format", Value.Format);
Serialize (Into, "chain", Value.Chain);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreItems_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreItems_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "alias", Value.Alias);
Swagger.Streams.Deserialize (Object, "entryType", Value.Entry_Type);
Swagger.Streams.Deserialize (Object, "algorithm", Value.Algorithm);
Swagger.Streams.Deserialize (Object, "format", Value.Format);
Deserialize (Object, "chain", Value.Chain);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreItems_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : KeystoreItems_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreInfo_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "aliases", Value.Aliases);
Into.Write_Entity ("exists", Value.Exists);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in KeystoreInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "aliases", Value.Aliases);
Swagger.Streams.Deserialize (Object, "exists", Value.Exists);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out KeystoreInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : KeystoreInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsArray_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Serialize (Into, "values", Value.Values);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsArray_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsArray_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "values", Value.Values);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsArray_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsArray_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsLong_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("optional", Value.Optional);
Into.Write_Entity ("is_set", Value.Is_Set);
Into.Write_Entity ("type", Value.P_Type);
Into.Write_Entity ("value", Value.Value);
Into.Write_Entity ("description", Value.Description);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationPropertyItemsLong_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsLong_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "optional", Value.Optional);
Swagger.Streams.Deserialize (Object, "is_set", Value.Is_Set);
Swagger.Streams.Deserialize (Object, "type", Value.P_Type);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationPropertyItemsLong_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationPropertyItemsLong_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationProperties_Type) is
begin
Into.Start_Entity (Name);
Serialize (Into, "path", Value.Path);
Serialize (Into, "service.ranking", Value.Service_Ranking);
Serialize (Into, "idpUrl", Value.Idp_Url);
Serialize (Into, "idpCertAlias", Value.Idp_Cert_Alias);
Serialize (Into, "idpHttpRedirect", Value.Idp_Http_Redirect);
Serialize (Into, "serviceProviderEntityId", Value.Service_Provider_Entity_Id);
Serialize (Into, "assertionConsumerServiceURL", Value.Assertion_Consumer_Service_URL);
Serialize (Into, "spPrivateKeyAlias", Value.Sp_Private_Key_Alias);
Serialize (Into, "keyStorePassword", Value.Key_Store_Password);
Serialize (Into, "defaultRedirectUrl", Value.Default_Redirect_Url);
Serialize (Into, "userIDAttribute", Value.User_IDAttribute);
Serialize (Into, "useEncryption", Value.Use_Encryption);
Serialize (Into, "createUser", Value.Create_User);
Serialize (Into, "addGroupMemberships", Value.Add_Group_Memberships);
Serialize (Into, "groupMembershipAttribute", Value.Group_Membership_Attribute);
Serialize (Into, "defaultGroups", Value.Default_Groups);
Serialize (Into, "nameIdFormat", Value.Name_Id_Format);
Serialize (Into, "synchronizeAttributes", Value.Synchronize_Attributes);
Serialize (Into, "handleLogout", Value.Handle_Logout);
Serialize (Into, "logoutUrl", Value.Logout_Url);
Serialize (Into, "clockTolerance", Value.Clock_Tolerance);
Serialize (Into, "digestMethod", Value.Digest_Method);
Serialize (Into, "signatureMethod", Value.Signature_Method);
Serialize (Into, "userIntermediatePath", Value.User_Intermediate_Path);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationProperties_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationProperties_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Deserialize (Object, "path", Value.Path);
Deserialize (Object, "service.ranking", Value.Service_Ranking);
Deserialize (Object, "idpUrl", Value.Idp_Url);
Deserialize (Object, "idpCertAlias", Value.Idp_Cert_Alias);
Deserialize (Object, "idpHttpRedirect", Value.Idp_Http_Redirect);
Deserialize (Object, "serviceProviderEntityId", Value.Service_Provider_Entity_Id);
Deserialize (Object, "assertionConsumerServiceURL", Value.Assertion_Consumer_Service_URL);
Deserialize (Object, "spPrivateKeyAlias", Value.Sp_Private_Key_Alias);
Deserialize (Object, "keyStorePassword", Value.Key_Store_Password);
Deserialize (Object, "defaultRedirectUrl", Value.Default_Redirect_Url);
Deserialize (Object, "userIDAttribute", Value.User_IDAttribute);
Deserialize (Object, "useEncryption", Value.Use_Encryption);
Deserialize (Object, "createUser", Value.Create_User);
Deserialize (Object, "addGroupMemberships", Value.Add_Group_Memberships);
Deserialize (Object, "groupMembershipAttribute", Value.Group_Membership_Attribute);
Deserialize (Object, "defaultGroups", Value.Default_Groups);
Deserialize (Object, "nameIdFormat", Value.Name_Id_Format);
Deserialize (Object, "synchronizeAttributes", Value.Synchronize_Attributes);
Deserialize (Object, "handleLogout", Value.Handle_Logout);
Deserialize (Object, "logoutUrl", Value.Logout_Url);
Deserialize (Object, "clockTolerance", Value.Clock_Tolerance);
Deserialize (Object, "digestMethod", Value.Digest_Method);
Deserialize (Object, "signatureMethod", Value.Signature_Method);
Deserialize (Object, "userIntermediatePath", Value.User_Intermediate_Path);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationProperties_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationProperties_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationInfo_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("pid", Value.Pid);
Into.Write_Entity ("title", Value.Title);
Into.Write_Entity ("description", Value.Description);
Into.Write_Entity ("bundle_location", Value.Bundle_Location);
Into.Write_Entity ("service_location", Value.Service_Location);
Serialize (Into, "properties", Value.Properties);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in SamlConfigurationInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "pid", Value.Pid);
Swagger.Streams.Deserialize (Object, "title", Value.Title);
Swagger.Streams.Deserialize (Object, "description", Value.Description);
Swagger.Streams.Deserialize (Object, "bundle_location", Value.Bundle_Location);
Swagger.Streams.Deserialize (Object, "service_location", Value.Service_Location);
Deserialize (Object, "properties", Value.Properties);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out SamlConfigurationInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : SamlConfigurationInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleDataProp_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("key", Value.Key);
Into.Write_Entity ("value", Value.Value);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleDataProp_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleDataProp_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "key", Value.Key);
Swagger.Streams.Deserialize (Object, "value", Value.Value);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleDataProp_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : BundleDataProp_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleData_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("id", Value.Id);
Into.Write_Entity ("name", Value.Name);
Into.Write_Entity ("fragment", Value.Fragment);
Into.Write_Entity ("stateRaw", Value.State_Raw);
Into.Write_Entity ("state", Value.State);
Into.Write_Entity ("version", Value.Version);
Into.Write_Entity ("symbolicName", Value.Symbolic_Name);
Into.Write_Entity ("category", Value.Category);
Serialize (Into, "props", Value.Props);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleData_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleData_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "id", Value.Id);
Swagger.Streams.Deserialize (Object, "name", Value.Name);
Swagger.Streams.Deserialize (Object, "fragment", Value.Fragment);
Swagger.Streams.Deserialize (Object, "stateRaw", Value.State_Raw);
Swagger.Streams.Deserialize (Object, "state", Value.State);
Swagger.Streams.Deserialize (Object, "version", Value.Version);
Swagger.Streams.Deserialize (Object, "symbolicName", Value.Symbolic_Name);
Swagger.Streams.Deserialize (Object, "category", Value.Category);
Deserialize (Object, "props", Value.Props);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleData_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : BundleData_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleInfo_Type) is
begin
Into.Start_Entity (Name);
Into.Write_Entity ("status", Value.Status);
Serialize (Into, "s", Value.S);
Serialize (Into, "data", Value.Data);
Into.End_Entity (Name);
end Serialize;
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BundleInfo_Type_Vectors.Vector) is
begin
Into.Start_Array (Name);
for Item of Value loop
Serialize (Into, "", Item);
end loop;
Into.End_Array (Name);
end Serialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleInfo_Type) is
Object : Swagger.Value_Type;
begin
Swagger.Streams.Deserialize (From, Name, Object);
Swagger.Streams.Deserialize (Object, "status", Value.Status);
Swagger.Streams.Deserialize (Object, "s", Value.S);
Deserialize (Object, "data", Value.Data);
end Deserialize;
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BundleInfo_Type_Vectors.Vector) is
List : Swagger.Value_Array_Type;
Item : BundleInfo_Type;
begin
Value.Clear;
Swagger.Streams.Deserialize (From, Name, List);
for Data of List loop
Deserialize (Data, "", Item);
Value.Append (Item);
end loop;
end Deserialize;
end .Models;
|
programs/oeis/046/A046037.asm | jmorken/loda | 1 | 91860 | ; A046037: Numbers n for which floor((3/2)^n) is composite.
; 8,9,10,11,12,13,14,15,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78
mov $1,$0
lpb $0
mod $0,13
add $1,2
lpe
add $1,8
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_21829_1153.asm | ljhsiun2/medusa | 9 | 91669 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r8
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x3fb7, %r10
nop
nop
xor $30965, %r8
mov $0x6162636465666768, %rdx
movq %rdx, %xmm4
vmovups %ymm4, (%r10)
nop
nop
nop
nop
nop
sub %r10, %r10
lea addresses_A_ht+0x16ac7, %r9
clflush (%r9)
nop
nop
nop
add $26611, %r14
mov $0x6162636465666768, %rbp
movq %rbp, %xmm3
movups %xmm3, (%r9)
nop
nop
nop
cmp $11305, %rbp
lea addresses_WC_ht+0x4419, %r8
cmp $63749, %rax
movups (%r8), %xmm7
vpextrq $0, %xmm7, %r10
nop
nop
nop
nop
nop
add $55758, %r9
lea addresses_WC_ht+0xe07d, %r8
nop
nop
nop
nop
nop
and %rdx, %rdx
movw $0x6162, (%r8)
nop
nop
nop
nop
inc %r10
lea addresses_D_ht+0x476b, %r10
nop
nop
cmp $40301, %r9
vmovups (%r10), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %rdx
nop
nop
nop
sub %r9, %r9
lea addresses_A_ht+0x1a557, %rsi
lea addresses_WT_ht+0x19097, %rdi
nop
xor %r8, %r8
mov $112, %rcx
rep movsw
nop
nop
nop
nop
add $245, %r14
lea addresses_A_ht+0x13d97, %rsi
lea addresses_A_ht+0x123b7, %rdi
nop
nop
and %r14, %r14
mov $2, %rcx
rep movsb
nop
nop
add %r8, %r8
lea addresses_normal_ht+0xf1b7, %rsi
lea addresses_WT_ht+0x93a7, %rdi
clflush (%rdi)
nop
nop
add $59378, %r8
mov $99, %rcx
rep movsb
nop
nop
xor %r8, %r8
lea addresses_D_ht+0x1b337, %rsi
nop
nop
nop
dec %r9
mov $0x6162636465666768, %rdi
movq %rdi, (%rsi)
nop
nop
nop
nop
nop
sub %r14, %r14
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r15
push %rax
push %rcx
push %rdi
// Faulty Load
lea addresses_WT+0x9bb7, %r15
nop
nop
nop
nop
xor $40151, %rax
mov (%r15), %r11d
lea oracles, %rdi
and $0xff, %r11
shlq $12, %r11
mov (%rdi,%r11,1), %r11
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16}}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 2}}
{'src': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}}
{'src': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}}
{'src': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}}
{'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
*/
|
AMPS/code/Data.asm | StardustGear/AMPS | 0 | 178288 | ; ===========================================================================
; ---------------------------------------------------------------------------
; Flags section. None of this is required, but I added it here to
; make it easier to debug built ROMs! If you would like easier
; assistance from Aurora, please keep this section intact!
; ---------------------------------------------------------------------------
dc.b "AMPS-v1.1" ; ident str
if safe
dc.b "s" ; safe mode enabled
else
dc.b " " ; safe mode disabled
endif
if FEATURE_FM6
dc.b "F6" ; FM6 enabled
endif
if FEATURE_SFX_MASTERVOL
dc.b "SM" ; sfx ignore master volume
endif
if FEATURE_UNDERWATER
dc.b "UW" ; underwater mode enabled
endif
if FEATURE_MODULATION
dc.b "MO" ; modulation enabled
endif
if FEATURE_DACFMVOLENV
dc.b "VE" ; FM & DAC volume envelope enabled
endif
if FEATURE_MODENV
dc.b "ME" ; modulation envelope enabled
endif
if FEATURE_PORTAMENTO
dc.b "PM" ; portamento enabled
endif
if FEATURE_BACKUP
dc.b "BA" ; backup enabled
endif
; ===========================================================================
; ---------------------------------------------------------------------------
; Define music and SFX
; ---------------------------------------------------------------------------
opt oz- ; disable zero-offset optimization
if safe=0
nolist ; if in safe mode, list data section.
endif
__mus = MusOff
MusicIndex:
ptrMusic Test, $00
ptrMusic Pelimusa, $1A, MysticCave, $34, DIS, $1E, ZaxxRemix, $00
ptrMusic ColumnDive, $3C, Pray, $0B, HydroCity, $1E, GameNo, $74
ptrMusic TowerPuppet, $00, ChoosePath, $0E, Shop, $74, Beach, $32
ptrMusic SmoothCriminal, $2A, S82, $00
MusCount = __mus-MusOff ; number of installed music tracks
SFXoff = __mus ; first SFX ID
__sfx = SFXoff
SoundIndex:
ptrSFX 0, RingRight, RingLeft
SFXcount = __sfx-SFXoff ; number of intalled sound effects
SFXlast = __sfx
; ===========================================================================
; ---------------------------------------------------------------------------
; Define samples
; ---------------------------------------------------------------------------
__samp = $80
SampleList:
sample $0000, Stop, Stop ; 80 - Stop sample (DO NOT EDIT)
sample $0100, Kick, Stop ; 81 - Kick
sample $0100, LowKick, Stop ; 82 - Low Kick
sample $0100, Snare, Stop ; 83 - Snare
sample $00E0, Snare, Stop, LowSnare ; 84 - Low Snare
sample $0100, Clap, Stop ; 85 - Clap
sample $0180, Tom, Stop, HiTom ; 86 - High Tom
sample $0100, Tom, Stop ; 87 - Mid Tom
sample $00C0, Tom, Stop, LowTom ; 88 - Low Tom
sample $0080, Tom, Stop, FloorTom ; 89 - Floor Tom
sample $0100, OrchHit, Stop ; 8A - Orchestra hit (Dynamite Headdy)
sample $0100, ZaxxOOH, Stop ; 8B - OOH 0-4 (Zaxxon Motherbase 2000)
sample $0080, ZaxxOOH, Stop, ZaxxLoOOH ; 8C - OOH Low 0-6 (Zaxxon Motherbase 2000)
sample $0100, ZaxxGO, Stop ; 8D - GO 0-5 (Zaxxon Motherbase 2000)
sample $0100, ZaxxDIS, Stop ; 8E - DIS 2-3 (Zaxxon Motherbase 2000)
sample $0100, ZaxxIT, Stop ; 8F - IT 2-9 (Zaxxon Motherbase 2000)
sample $0100, ZaxxEYO, Stop ; 90 - EYO 2-A (Zaxxon Motherbase 2000)
sample $0100, KcTom, Stop ; 91 - Tom (Knuckles Chaotix)
sample $00C0, KcTom, Stop, KcLowTom ; 92 - Low Tom (Knuckles Chaotix)
sample $0080, KcTom, Stop, KcFloorTom ; 93 - Floor Tom (Knuckles Chaotix)
sample $0100, KcCymbal, Stop ; 94 - Cymbal? (Knuckles Chaotix)
sample $0100, KcSnare, Stop ; 95 - Snare (Knuckles Chaotix)
sample $0100, KcTamb, Stop ; 96 - Tambourine? (Knuckles Chaotix)
sample $0100, Kc87, Stop ; 97 - Not really sure? (Knuckles Chaotix)
sample $0100, KcCrash, Stop ; 98 - Crash Cymbal (Knuckles Chaotix)
sample $0100, Meow, Stop ; 99 - Meow (Meow Mix - Cyriak)
sample $0100, Wooh, WoohLoop ; 9A - Wooh (The Amazing Atheist)
sample $0100, Lazer, Stop ; 9B - Lazer (R2D2 bird)
sample $0100, Kaiku1, Stop ; 9C - Kaiku (Wings - Pelimusa)
sample $0100, Kaiku2, Stop ; 9D - Kaiku (Wings - Pelimusa)
sample $0100, Kaiku3, Stop ; 9E - Kaiku (Wings - Pelimusa)
sample $0100, Kaiku4, Stop ; 9F - Kaiku (Wings - Pelimusa)
sample $0100, Kaiku5, Stop ; A0 - Kaiku (Wings - Pelimusa)
sample $0100, KaikuL1, KaikuL2, KaikuL2 ; A1 - Kaiku (Wings - Pelimusa)
sample $0100, KaikuL1, KaikuL3, KaikuL3 ; A2 - Kaiku (Wings - Pelimusa)
sample $0100, Sarobasso, Stop ; A3 - Sarobasso (Wings - Pelimusa)
; ===========================================================================
; ---------------------------------------------------------------------------
; Define volume envelopes and their data
; ---------------------------------------------------------------------------
vNone = $00
__venv = $01
VolEnvs:
volenv Ristar02, Ristar07, Ristar10, Ristar18, Ristar1D, GameNo01
volenv S3K_02, S3K_01, S3K_08, S3K_0A, Phan3_05, Phan3_0A, Zaxx04
volenv DyHe03, DyHe05, DyHe0A, Col3_02, Col3_03, Col3_05
volenv WOI_0C, WOI_0D, Kc02, Kc05, Kc08, MoonWalker04
volenv S2_02, S2_01, S2_0B
VolEnvs_End:
; ---------------------------------------------------------------------------
; Sonic 2 01
vdS2_01: dc.b $00, $00, $00, $08, $08, $08, $10, $10
dc.b $10, $18, $18, $18, $20, $20, $20, $28
dc.b $28, $28, $30, $30, $30, $38, eHold
; Sonic 2 0B
vdS2_0B: dc.b $20, $20, $20, $18, $18, $18, $10, $10
dc.b $10, $08, $08, $08, $08, $08, $08, $08
dc.b $10, $10, $10, $10, $10, $18, $18, $18
dc.b $18, $18, $20, eHold
; <NAME> Moonwalker 04
vdMoonWalker04: dc.b $00, $00, $10, $18, $20, $20, $28, $28
dc.b $28, $30, eHold
; <NAME> 08
vdKc08: dc.b $10, $08, $00, $00, $08, $08, $10, eHold
; Zaxxon Motherbase 04
vdZaxx04: dc.b $10, $08, $00, $00, $08, $10, $10, $10
dc.b $10, $10, $10, $10, $10, $10, $10, $10
dc.b $10, $18, $18, $18, $20, $20, $20, $28, eHold
; World of Illusion 0C
vdWOI_0C: dc.b $30, $28, $20, $18, $08, $08, $00, $00
dc.b $00, $00, $00, $00, $00, $00, $08, $08
dc.b $10, $10, $18, $18, $20, $20, eHold
; World of Illusion 0D
vdWOI_0D: dc.b $20, $18, $10, $08, $00, $08, $08, $10
dc.b $10, $18, $18, $20, $20, $28, $28, $30
dc.b $30, $38, $38, eHold
; Phantasy Star III & Knuckles Chaotix 05
vdKc05:
vdPhan3_05: dc.b $18, $00, $08, $08, $08, $10, $18, $20
dc.b $20, $28, eHold
; Phantasy Star III 0A
vdPhan3_0A: dc.b $08, $00, $00, $00, $00, $08, $08, $08
dc.b $10, $10, $10, $18, $18, $18, $18, $20
dc.b $20, $20, $28, $28, eHold
; Game no Kanzume Otokuyou 01
vdGameNo01: dc.b $00, $08, $08, $08, $08, $08, $08, $08
dc.b $08, $10, $10, $10, $10, $10, $10, $10
dc.b $10, $18, $18, $18, $18, $18, $18, $18
dc.b $18, $20, $20, $20, $20, $20, $20, $20
dc.b $20, $28, $28, $28, $28, $28, $28, $28
dc.b $28, $30, eHold
; Ristar 07
vdRistar07: dc.b $18, $10, $08, $00, $00, $08, $08, $10, eHold
; Knuckles Chaotix 02
vdKc02: dc.b $00, $00 ; continue to volenv below
; Ristar & S2 & S3K & Columns III 02
vdS2_02:
vdCol3_02:
vdS3K_02:
vdRistar02: dc.b $00, $10, $20, $30, $40, $7F, eStop
; Ristar 1D
vdRistar1D: dc.b $00, $00, $00, $00, $08, $08, $08, $08
dc.b $08, $10, $10, $18, $18, $20, $20, $20
dc.b $20, $18, $18, $10, $10, $08, eHold
; Ristar 10 & S3K 08
vdS3K_08:
vdRistar10: dc.b $00, $00, $00, $10, $18, $18, $20, $28
dc.b $30, $38, $40, $48, $50, $48, $60, $68, eStop
; Ristar 18
vdRistar18: dc.b $00, $18, $30, $48, eStop
; S3K 01
vdS3K_01: dc.b $10, eStop
; S3K 0A
vdS3K_0A: dc.b $08, $00, $00, $00, $00, $08, $08, $08
dc.b $10, $10, $10, $18, $18, $18, $18, $20
dc.b $20, $20, $28, $28, eHold
; Dynamite Headdy 03
vdDyHe03: dc.b $00, $00, $08, $08, $18, $18, $20, $28, eStop
; Dynamite Headdy 05
vdDyHe05: dc.b $20, $20, $20, $20, $18, $18, $18, $18
dc.b $10, $10, $10, $10, $08, $08, $08, $08
dc.b $00, $00, $00, $00, $00, $00, $00, $00
dc.b $00, $00, $08, $08, $08, $08, $08, $08
dc.b $08, $08, $08, $08, $08, $08, $08, $08
dc.b $10, $10, $10, $10, $10, $10, $10, $10
dc.b $18, $18, $18, $18, $18, $18, $18, $18
dc.b $20, eStop
; Dynamite Headdy 0A
vdDyHe0A: dc.b $38, $30, $30, $30, $28, $28, $28, $20
dc.b $20, $18, $18, $18, $18, $18, $10, $10
dc.b $10, $08, $08, $08, $00, $00, $00, $00
dc.b $00, $00, $00, $00, $00, $00, $00, $00
dc.b $00, $00, $00, $00, $00, $00, $00, $00
dc.b $00, $00, $00, $00, $00, $00, $00, $00
dc.b $00, $00, $08, $08, $08, $08, $08, $08
dc.b $08, $08, $08, $08, $08, $08, $08, $08
dc.b $08, $08, $08, $08, $08, $08, $10, $10
dc.b $10, $10, $10, $10, $18, $18, $18, $18
dc.b $20, $20, $20, $20, $20, $28, $28, $28
dc.b $28, $28, $30, $30, $30, $30, $30, $38
dc.b $38, $38, $38, $38, $40, $40, $40, $40
dc.b $40, $48, $48, $48, $48, $48, eHold
; Columns III 03
vdCol3_03: dc.b $10, $08, $00, $00, $08, $10, $10, $10
dc.b $10, $10, $10, $10, $10, $10, $10, $10
dc.b $10, $18, $18, $18, $20, $20, $20, $28, eHold
; Columns III 05
vdCol3_05: dc.b $10, $08, $00, $00, $08, $10, $10, $10
dc.b $10, $10, $10, $10, $10, $10, $10, $10
dc.b $10, $18, $18, $18, $20, $20, $20, $28, eStop
even
; ===========================================================================
; ---------------------------------------------------------------------------
; Define volume envelopes and their data
; ---------------------------------------------------------------------------
mNone = $00
__menv = $01
ModEnvs:
modenv Test
ModEnvs_End:
; ---------------------------------------------------------------------------
if FEATURE_MODENV
; just testin'
mdTest: dc.b $08, eaSens, $01, eLoop, $00
even
endif
; ===========================================================================
; ---------------------------------------------------------------------------
; Include music, sound effects and voice table
; ---------------------------------------------------------------------------
include "AMPS/Voices.s2a" ; include universal Voice bank
opt ae- ; disable automatic evens
sfxaddr incSFX ; include all sfx
musaddr incMus ; include all music
musend
; ===========================================================================
; ---------------------------------------------------------------------------
; Include samples and filters
; ---------------------------------------------------------------------------
align $8000 ; must be aligned to bank... By the way, these are also set in Z80.asm. Be sure to check it out also.
fLog: incbin "AMPS/filters/Logarithmic.dat" ; logarithmic filter (no filter)
;fLinear: incbin "AMPS/filters/Linear.dat" ; linear filter (no filter)
dacaddr dcb.b Z80E_Read*(MaxPitch/$100),$00
SWF_Stop: dcb.b $8000-(2*Z80E_Read*(MaxPitch/$100)),$80
SWFR_Stop: dcb.b Z80E_Read*(MaxPitch/$100),$00
incSWF Kick, LowKick, Snare, Clap, Tom, Wooh, WoohLoop
incSWF OrchHit, ZaxxOOH, ZaxxDIS, ZaxxEYO, ZaxxIT, ZaxxGO
incSWF KcTom, KcSnare, KcTamb, Kc87, KcCrash, KcCymbal
incSWF KaikuL1, KaikuL2, KaikuL3, Kaiku1, Kaiku2, Kaiku3, Kaiku4, Kaiku5
incSWF Meow, Lazer, Sarobasso
even
opt ae+ ; enable automatic evens
list ; continue source listing
; ===========================================================================
|
src/drivers/dmac_u2503/sam_svd-dmac.ads | Fabien-Chouteau/samd51-hal | 1 | 21285 | -- ============================================================================
-- Atmel Microcontroller Software Support
-- ============================================================================
-- Copyright (c) 2017 Atmel Corporation,
-- a wholly owned subsidiary of Microchip Technology Inc.
--
-- 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 Licence 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.
-- ============================================================================
-- This spec has been automatically generated from ATSAMD51J19A.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package SAM_SVD.DMAC is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- DMAC_CTRL_LVLEN array
type DMAC_CTRL_LVLEN_Field_Array is array (0 .. 3) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for DMAC_CTRL_LVLEN
type DMAC_CTRL_LVLEN_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- LVLEN as a value
Val : HAL.UInt4;
when True =>
-- LVLEN as an array
Arr : DMAC_CTRL_LVLEN_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for DMAC_CTRL_LVLEN_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
-- Control
type DMAC_CTRL_Register is record
-- Software Reset
SWRST : Boolean := False;
-- DMA Enable
DMAENABLE : Boolean := False;
-- unspecified
Reserved_2_7 : HAL.UInt6 := 16#0#;
-- Priority Level 0 Enable
LVLEN : DMAC_CTRL_LVLEN_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 16,
Bit_Order => System.Low_Order_First;
for DMAC_CTRL_Register use record
SWRST at 0 range 0 .. 0;
DMAENABLE at 0 range 1 .. 1;
Reserved_2_7 at 0 range 2 .. 7;
LVLEN at 0 range 8 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
end record;
-- CRC Beat Size
type CRCCTRL_CRCBEATSIZESelect is
(-- 8-bit bus transfer
Byte,
-- 16-bit bus transfer
Hword,
-- 32-bit bus transfer
Word)
with Size => 2;
for CRCCTRL_CRCBEATSIZESelect use
(Byte => 0,
Hword => 1,
Word => 2);
-- CRC Polynomial Type
type CRCCTRL_CRCPOLYSelect is
(-- CRC-16 (CRC-CCITT)
Crc16,
-- CRC32 (IEEE 802.3)
Crc32)
with Size => 2;
for CRCCTRL_CRCPOLYSelect use
(Crc16 => 0,
Crc32 => 1);
-- CRC Input Source
type CRCCTRL_CRCSRCSelect is
(-- CRC Disabled
Disable,
-- I/O interface
Io)
with Size => 6;
for CRCCTRL_CRCSRCSelect use
(Disable => 0,
Io => 1);
-- CRC Operating Mode
type CRCCTRL_CRCMODESelect is
(-- Default operating mode
Default,
-- Memory CRC monitor operating mode
Crcmon,
-- Memory CRC generation operating mode
Crcgen)
with Size => 2;
for CRCCTRL_CRCMODESelect use
(Default => 0,
Crcmon => 2,
Crcgen => 3);
-- CRC Control
type DMAC_CRCCTRL_Register is record
-- CRC Beat Size
CRCBEATSIZE : CRCCTRL_CRCBEATSIZESelect := SAM_SVD.DMAC.Byte;
-- CRC Polynomial Type
CRCPOLY : CRCCTRL_CRCPOLYSelect := SAM_SVD.DMAC.Crc16;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- CRC Input Source
CRCSRC : CRCCTRL_CRCSRCSelect := SAM_SVD.DMAC.Disable;
-- CRC Operating Mode
CRCMODE : CRCCTRL_CRCMODESelect := SAM_SVD.DMAC.Default;
end record
with Volatile_Full_Access, Size => 16,
Bit_Order => System.Low_Order_First;
for DMAC_CRCCTRL_Register use record
CRCBEATSIZE at 0 range 0 .. 1;
CRCPOLY at 0 range 2 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
CRCSRC at 0 range 8 .. 13;
CRCMODE at 0 range 14 .. 15;
end record;
-- CRC Status
type DMAC_CRCSTATUS_Register is record
-- CRC Module Busy
CRCBUSY : Boolean := False;
-- Read-only. CRC Zero
CRCZERO : Boolean := False;
-- Read-only. CRC Error
CRCERR : Boolean := False;
-- unspecified
Reserved_3_7 : HAL.UInt5 := 16#0#;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for DMAC_CRCSTATUS_Register use record
CRCBUSY at 0 range 0 .. 0;
CRCZERO at 0 range 1 .. 1;
CRCERR at 0 range 2 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
end record;
-- Debug Control
type DMAC_DBGCTRL_Register is record
-- Debug Run
DBGRUN : Boolean := False;
-- unspecified
Reserved_1_7 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for DMAC_DBGCTRL_Register use record
DBGRUN at 0 range 0 .. 0;
Reserved_1_7 at 0 range 1 .. 7;
end record;
-- DMAC_SWTRIGCTRL_SWTRIG array
type DMAC_SWTRIGCTRL_SWTRIG_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Software Trigger Control
type DMAC_SWTRIGCTRL_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SWTRIG as a value
Val : HAL.UInt32;
when True =>
-- SWTRIG as an array
Arr : DMAC_SWTRIGCTRL_SWTRIG_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for DMAC_SWTRIGCTRL_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype DMAC_PRICTRL0_LVLPRI0_Field is HAL.UInt5;
-- Level 0 Quality of Service
type PRICTRL0_QOS0Select is
(-- Regular delivery
Regular,
-- Bandwidth shortage
Shortage,
-- Latency sensitive
Sensitive,
-- Latency critical
Critical)
with Size => 2;
for PRICTRL0_QOS0Select use
(Regular => 0,
Shortage => 1,
Sensitive => 2,
Critical => 3);
subtype DMAC_PRICTRL0_LVLPRI1_Field is HAL.UInt5;
-- Level 1 Quality of Service
type PRICTRL0_QOS1Select is
(-- Regular delivery
Regular,
-- Bandwidth shortage
Shortage,
-- Latency sensitive
Sensitive,
-- Latency critical
Critical)
with Size => 2;
for PRICTRL0_QOS1Select use
(Regular => 0,
Shortage => 1,
Sensitive => 2,
Critical => 3);
subtype DMAC_PRICTRL0_LVLPRI2_Field is HAL.UInt5;
-- Level 2 Quality of Service
type PRICTRL0_QOS2Select is
(-- Regular delivery
Regular,
-- Bandwidth shortage
Shortage,
-- Latency sensitive
Sensitive,
-- Latency critical
Critical)
with Size => 2;
for PRICTRL0_QOS2Select use
(Regular => 0,
Shortage => 1,
Sensitive => 2,
Critical => 3);
subtype DMAC_PRICTRL0_LVLPRI3_Field is HAL.UInt5;
-- Level 3 Quality of Service
type PRICTRL0_QOS3Select is
(-- Regular delivery
Regular,
-- Bandwidth shortage
Shortage,
-- Latency sensitive
Sensitive,
-- Latency critical
Critical)
with Size => 2;
for PRICTRL0_QOS3Select use
(Regular => 0,
Shortage => 1,
Sensitive => 2,
Critical => 3);
-- Priority Control 0
type DMAC_PRICTRL0_Register is record
-- Level 0 Channel Priority Number
LVLPRI0 : DMAC_PRICTRL0_LVLPRI0_Field := 16#0#;
-- Level 0 Quality of Service
QOS0 : PRICTRL0_QOS0Select := SAM_SVD.DMAC.Sensitive;
-- Level 0 Round-Robin Scheduling Enable
RRLVLEN0 : Boolean := False;
-- Level 1 Channel Priority Number
LVLPRI1 : DMAC_PRICTRL0_LVLPRI1_Field := 16#0#;
-- Level 1 Quality of Service
QOS1 : PRICTRL0_QOS1Select := SAM_SVD.DMAC.Sensitive;
-- Level 1 Round-Robin Scheduling Enable
RRLVLEN1 : Boolean := False;
-- Level 2 Channel Priority Number
LVLPRI2 : DMAC_PRICTRL0_LVLPRI2_Field := 16#0#;
-- Level 2 Quality of Service
QOS2 : PRICTRL0_QOS2Select := SAM_SVD.DMAC.Sensitive;
-- Level 2 Round-Robin Scheduling Enable
RRLVLEN2 : Boolean := False;
-- Level 3 Channel Priority Number
LVLPRI3 : DMAC_PRICTRL0_LVLPRI3_Field := 16#0#;
-- Level 3 Quality of Service
QOS3 : PRICTRL0_QOS3Select := SAM_SVD.DMAC.Sensitive;
-- Level 3 Round-Robin Scheduling Enable
RRLVLEN3 : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DMAC_PRICTRL0_Register use record
LVLPRI0 at 0 range 0 .. 4;
QOS0 at 0 range 5 .. 6;
RRLVLEN0 at 0 range 7 .. 7;
LVLPRI1 at 0 range 8 .. 12;
QOS1 at 0 range 13 .. 14;
RRLVLEN1 at 0 range 15 .. 15;
LVLPRI2 at 0 range 16 .. 20;
QOS2 at 0 range 21 .. 22;
RRLVLEN2 at 0 range 23 .. 23;
LVLPRI3 at 0 range 24 .. 28;
QOS3 at 0 range 29 .. 30;
RRLVLEN3 at 0 range 31 .. 31;
end record;
subtype DMAC_INTPEND_ID_Field is HAL.UInt5;
-- Interrupt Pending
type DMAC_INTPEND_Register is record
-- Channel ID
ID : DMAC_INTPEND_ID_Field := 16#0#;
-- unspecified
Reserved_5_7 : HAL.UInt3 := 16#0#;
-- Transfer Error
TERR : Boolean := False;
-- Transfer Complete
TCMPL : Boolean := False;
-- Channel Suspend
SUSP : Boolean := False;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- CRC Error
CRCERR : Boolean := False;
-- Read-only. Fetch Error
FERR : Boolean := False;
-- Read-only. Busy
BUSY : Boolean := False;
-- Read-only. Pending
PEND : Boolean := False;
end record
with Volatile_Full_Access, Size => 16,
Bit_Order => System.Low_Order_First;
for DMAC_INTPEND_Register use record
ID at 0 range 0 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
TERR at 0 range 8 .. 8;
TCMPL at 0 range 9 .. 9;
SUSP at 0 range 10 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
CRCERR at 0 range 12 .. 12;
FERR at 0 range 13 .. 13;
BUSY at 0 range 14 .. 14;
PEND at 0 range 15 .. 15;
end record;
-- DMAC_INTSTATUS_CHINT array
type DMAC_INTSTATUS_CHINT_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Interrupt Status
type DMAC_INTSTATUS_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CHINT as a value
Val : HAL.UInt32;
when True =>
-- CHINT as an array
Arr : DMAC_INTSTATUS_CHINT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for DMAC_INTSTATUS_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- DMAC_BUSYCH_BUSYCH array
type DMAC_BUSYCH_BUSYCH_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Busy Channels
type DMAC_BUSYCH_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BUSYCH as a value
Val : HAL.UInt32;
when True =>
-- BUSYCH as an array
Arr : DMAC_BUSYCH_BUSYCH_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for DMAC_BUSYCH_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- DMAC_PENDCH_PENDCH array
type DMAC_PENDCH_PENDCH_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Pending Channels
type DMAC_PENDCH_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PENDCH as a value
Val : HAL.UInt32;
when True =>
-- PENDCH as an array
Arr : DMAC_PENDCH_PENDCH_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for DMAC_PENDCH_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- DMAC_ACTIVE_LVLEX array
type DMAC_ACTIVE_LVLEX_Field_Array is array (0 .. 3) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for DMAC_ACTIVE_LVLEX
type DMAC_ACTIVE_LVLEX_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- LVLEX as a value
Val : HAL.UInt4;
when True =>
-- LVLEX as an array
Arr : DMAC_ACTIVE_LVLEX_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for DMAC_ACTIVE_LVLEX_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
subtype DMAC_ACTIVE_ID_Field is HAL.UInt5;
subtype DMAC_ACTIVE_BTCNT_Field is HAL.UInt16;
-- Active Channel and Levels
type DMAC_ACTIVE_Register is record
-- Read-only. Level 0 Channel Trigger Request Executing
LVLEX : DMAC_ACTIVE_LVLEX_Field;
-- unspecified
Reserved_4_7 : HAL.UInt4;
-- Read-only. Active Channel ID
ID : DMAC_ACTIVE_ID_Field;
-- unspecified
Reserved_13_14 : HAL.UInt2;
-- Read-only. Active Channel Busy
ABUSY : Boolean;
-- Read-only. Active Channel Block Transfer Count
BTCNT : DMAC_ACTIVE_BTCNT_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DMAC_ACTIVE_Register use record
LVLEX at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
ID at 0 range 8 .. 12;
Reserved_13_14 at 0 range 13 .. 14;
ABUSY at 0 range 15 .. 15;
BTCNT at 0 range 16 .. 31;
end record;
-- Trigger Source
subtype CHCTRLA0_TRIGSRCSelect is HAL.UInt7;
-- Trigger Action
type CHCTRLA0_TRIGACTSelect is
(-- One trigger required for each block transfer
Block,
-- One trigger required for each burst transfer
Burst,
-- One trigger required for each transaction
Transaction)
with Size => 2;
for CHCTRLA0_TRIGACTSelect use
(Block => 0,
Burst => 2,
Transaction => 3);
-- Burst Length
type CHCTRLA0_BURSTLENSelect is
(-- Single-beat burst length
Single,
-- 2-beats burst length
Val_2Beat,
-- 3-beats burst length
Val_3Beat,
-- 4-beats burst length
Val_4Beat,
-- 5-beats burst length
Val_5Beat,
-- 6-beats burst length
Val_6Beat,
-- 7-beats burst length
Val_7Beat,
-- 8-beats burst length
Val_8Beat,
-- 9-beats burst length
Val_9Beat,
-- 10-beats burst length
Val_10Beat,
-- 11-beats burst length
Val_11Beat,
-- 12-beats burst length
Val_12Beat,
-- 13-beats burst length
Val_13Beat,
-- 14-beats burst length
Val_14Beat,
-- 15-beats burst length
Val_15Beat,
-- 16-beats burst length
Val_16Beat)
with Size => 4;
for CHCTRLA0_BURSTLENSelect use
(Single => 0,
Val_2Beat => 1,
Val_3Beat => 2,
Val_4Beat => 3,
Val_5Beat => 4,
Val_6Beat => 5,
Val_7Beat => 6,
Val_8Beat => 7,
Val_9Beat => 8,
Val_10Beat => 9,
Val_11Beat => 10,
Val_12Beat => 11,
Val_13Beat => 12,
Val_14Beat => 13,
Val_15Beat => 14,
Val_16Beat => 15);
-- FIFO Threshold
type CHCTRLA0_THRESHOLDSelect is
(-- Destination write starts after each beat source address read
Val_1Beat,
-- Destination write starts after 2-beats source address read
Val_2Beats,
-- Destination write starts after 4-beats source address read
Val_4Beats,
-- Destination write starts after 8-beats source address read
Val_8Beats)
with Size => 2;
for CHCTRLA0_THRESHOLDSelect use
(Val_1Beat => 0,
Val_2Beats => 1,
Val_4Beats => 2,
Val_8Beats => 3);
-- Channel n Control A
type CHCTRLA_Register is record
-- Channel Software Reset
SWRST : Boolean := False;
-- Channel Enable
ENABLE : Boolean := False;
-- unspecified
Reserved_2_5 : HAL.UInt4 := 16#0#;
-- Channel Run in Standby
RUNSTDBY : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Trigger Source
TRIGSRC : CHCTRLA0_TRIGSRCSelect := 0;
-- unspecified
Reserved_15_19 : HAL.UInt5 := 16#0#;
-- Trigger Action
TRIGACT : CHCTRLA0_TRIGACTSelect := SAM_SVD.DMAC.Block;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Burst Length
BURSTLEN : CHCTRLA0_BURSTLENSelect := SAM_SVD.DMAC.Single;
-- FIFO Threshold
THRESHOLD : CHCTRLA0_THRESHOLDSelect := SAM_SVD.DMAC.Val_1Beat;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCTRLA_Register use record
SWRST at 0 range 0 .. 0;
ENABLE at 0 range 1 .. 1;
Reserved_2_5 at 0 range 2 .. 5;
RUNSTDBY at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
TRIGSRC at 0 range 8 .. 14;
Reserved_15_19 at 0 range 15 .. 19;
TRIGACT at 0 range 20 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
BURSTLEN at 0 range 24 .. 27;
THRESHOLD at 0 range 28 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
-- Software Command
type CHCTRLB0_CMDSelect is
(-- No action
Noact,
-- Channel suspend operation
Suspend,
-- Channel resume operation
Resume)
with Size => 2;
for CHCTRLB0_CMDSelect use
(Noact => 0,
Suspend => 1,
Resume => 2);
-- Channel n Control B
type CHCTRLB_Register is record
-- Software Command
CMD : CHCTRLB0_CMDSelect := SAM_SVD.DMAC.Noact;
-- unspecified
Reserved_2_7 : HAL.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for CHCTRLB_Register use record
CMD at 0 range 0 .. 1;
Reserved_2_7 at 0 range 2 .. 7;
end record;
-- Channel Priority Level
type CHPRILVL0_PRILVLSelect is
(-- Channel Priority Level 0 (Lowest Level)
Lvl0,
-- Channel Priority Level 1
Lvl1,
-- Channel Priority Level 2
Lvl2,
-- Channel Priority Level 3 (Highest Level)
Lvl3)
with Size => 2;
for CHPRILVL0_PRILVLSelect use
(Lvl0 => 0,
Lvl1 => 1,
Lvl2 => 2,
Lvl3 => 3);
-- Channel n Priority Level
type CHPRILVL_Register is record
-- Channel Priority Level
PRILVL : CHPRILVL0_PRILVLSelect := SAM_SVD.DMAC.Lvl0;
-- unspecified
Reserved_2_7 : HAL.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for CHPRILVL_Register use record
PRILVL at 0 range 0 .. 1;
Reserved_2_7 at 0 range 2 .. 7;
end record;
-- Channel Event Input Action
type CHEVCTRL0_EVACTSelect is
(-- No action
Noact,
-- Transfer and periodic transfer trigger
Trig,
-- Conditional transfer trigger
Ctrig,
-- Conditional block transfer
Cblock,
-- Channel suspend operation
Suspend,
-- Channel resume operation
Resume,
-- Skip next block suspend action
Sskip,
-- Increase priority
Incpri)
with Size => 3;
for CHEVCTRL0_EVACTSelect use
(Noact => 0,
Trig => 1,
Ctrig => 2,
Cblock => 3,
Suspend => 4,
Resume => 5,
Sskip => 6,
Incpri => 7);
-- Channel Event Output Mode
type CHEVCTRL0_EVOMODESelect is
(-- Block event output selection. Refer to BTCTRL.EVOSEL for available
-- selections.
Default,
-- Ongoing trigger action
Trigact)
with Size => 2;
for CHEVCTRL0_EVOMODESelect use
(Default => 0,
Trigact => 1);
-- Channel n Event Control
type CHEVCTRL_Register is record
-- Channel Event Input Action
EVACT : CHEVCTRL0_EVACTSelect := SAM_SVD.DMAC.Noact;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
-- Channel Event Output Mode
EVOMODE : CHEVCTRL0_EVOMODESelect := SAM_SVD.DMAC.Default;
-- Channel Event Input Enable
EVIE : Boolean := False;
-- Channel Event Output Enable
EVOE : Boolean := False;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for CHEVCTRL_Register use record
EVACT at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
EVOMODE at 0 range 4 .. 5;
EVIE at 0 range 6 .. 6;
EVOE at 0 range 7 .. 7;
end record;
-- Channel n Interrupt Enable Clear
type CHINTENCLR_Register is record
-- Channel Transfer Error Interrupt Enable
TERR : Boolean := False;
-- Channel Transfer Complete Interrupt Enable
TCMPL : Boolean := False;
-- Channel Suspend Interrupt Enable
SUSP : Boolean := False;
-- unspecified
Reserved_3_7 : HAL.UInt5 := 16#0#;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for CHINTENCLR_Register use record
TERR at 0 range 0 .. 0;
TCMPL at 0 range 1 .. 1;
SUSP at 0 range 2 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
end record;
-- Channel n Interrupt Enable Set
type CHINTENSET_Register is record
-- Channel Transfer Error Interrupt Enable
TERR : Boolean := False;
-- Channel Transfer Complete Interrupt Enable
TCMPL : Boolean := False;
-- Channel Suspend Interrupt Enable
SUSP : Boolean := False;
-- unspecified
Reserved_3_7 : HAL.UInt5 := 16#0#;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for CHINTENSET_Register use record
TERR at 0 range 0 .. 0;
TCMPL at 0 range 1 .. 1;
SUSP at 0 range 2 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
end record;
-- Channel n Interrupt Flag Status and Clear
type CHINTFLAG_Register is record
-- Channel Transfer Error
TERR : Boolean := False;
-- Channel Transfer Complete
TCMPL : Boolean := False;
-- Channel Suspend
SUSP : Boolean := False;
-- unspecified
Reserved_3_7 : HAL.UInt5 := 16#0#;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for CHINTFLAG_Register use record
TERR at 0 range 0 .. 0;
TCMPL at 0 range 1 .. 1;
SUSP at 0 range 2 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
end record;
-- Channel n Status
type CHSTATUS_Register is record
-- Read-only. Channel Pending
PEND : Boolean := False;
-- Read-only. Channel Busy
BUSY : Boolean := False;
-- Read-only. Channel Fetch Error
FERR : Boolean := False;
-- Channel CRC Error
CRCERR : Boolean := False;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First;
for CHSTATUS_Register use record
PEND at 0 range 0 .. 0;
BUSY at 0 range 1 .. 1;
FERR at 0 range 2 .. 2;
CRCERR at 0 range 3 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
end record;
type Channel_Record is record
-- Channel n Control A
CHCTRLA : aliased CHCTRLA_Register;
-- Channel n Control B
CHCTRLB : aliased CHCTRLB_Register;
-- Channel n Priority Level
CHPRILVL : aliased CHPRILVL_Register;
-- Channel n Event Control
CHEVCTRL : aliased CHEVCTRL_Register;
-- Channel n Interrupt Enable Clear
CHINTENCLR : aliased CHINTENCLR_Register;
-- Channel n Interrupt Enable Set
CHINTENSET : aliased CHINTENSET_Register;
-- Channel n Interrupt Flag Status and Clear
CHINTFLAG : aliased CHINTFLAG_Register;
-- Channel n Status
CHSTATUS : aliased CHSTATUS_Register;
end record;
for Channel_Record use record
CHCTRLA at 16#00# range 0 .. 31;
CHCTRLB at 16#04# range 0 .. 7;
CHPRILVL at 16#05# range 0 .. 7;
CHEVCTRL at 16#06# range 0 .. 7;
CHINTENCLR at 16#0C# range 0 .. 7;
CHINTENSET at 16#0D# range 0 .. 7;
CHINTFLAG at 16#0E# range 0 .. 7;
CHSTATUS at 16#0F# range 0 .. 7;
end record;
type Channel_Array is array (0 .. 31) of Channel_Record;
-----------------
-- Peripherals --
-----------------
-- Direct Memory Access Controller
type DMAC_Peripheral is record
-- Control
CTRL : aliased DMAC_CTRL_Register;
-- CRC Control
CRCCTRL : aliased DMAC_CRCCTRL_Register;
-- CRC Data Input
CRCDATAIN : aliased HAL.UInt32;
-- CRC Checksum
CRCCHKSUM : aliased HAL.UInt32;
-- CRC Status
CRCSTATUS : aliased DMAC_CRCSTATUS_Register;
-- Debug Control
DBGCTRL : aliased DMAC_DBGCTRL_Register;
-- Software Trigger Control
SWTRIGCTRL : aliased DMAC_SWTRIGCTRL_Register;
-- Priority Control 0
PRICTRL0 : aliased DMAC_PRICTRL0_Register;
-- Interrupt Pending
INTPEND : aliased DMAC_INTPEND_Register;
-- Interrupt Status
INTSTATUS : aliased DMAC_INTSTATUS_Register;
-- Busy Channels
BUSYCH : aliased DMAC_BUSYCH_Register;
-- Pending Channels
PENDCH : aliased DMAC_PENDCH_Register;
-- Active Channel and Levels
ACTIVE : aliased DMAC_ACTIVE_Register;
-- Descriptor Memory Section Base Address
BASEADDR : aliased System.Address;
-- Write-Back Memory Section Base Address
WRBADDR : aliased System.Address;
Channels : aliased Channel_Array;
end record
with Volatile;
for DMAC_Peripheral use record
CTRL at 16#0# range 0 .. 15;
CRCCTRL at 16#2# range 0 .. 15;
CRCDATAIN at 16#4# range 0 .. 31;
CRCCHKSUM at 16#8# range 0 .. 31;
CRCSTATUS at 16#C# range 0 .. 7;
DBGCTRL at 16#D# range 0 .. 7;
SWTRIGCTRL at 16#10# range 0 .. 31;
PRICTRL0 at 16#14# range 0 .. 31;
INTPEND at 16#20# range 0 .. 15;
INTSTATUS at 16#24# range 0 .. 31;
BUSYCH at 16#28# range 0 .. 31;
PENDCH at 16#2C# range 0 .. 31;
ACTIVE at 16#30# range 0 .. 31;
BASEADDR at 16#34# range 0 .. 31;
WRBADDR at 16#38# range 0 .. 31;
Channels at 16#40# range 0 .. 4095;
end record;
-- Direct Memory Access Controller
DMAC_Periph : aliased DMAC_Peripheral
with Import, Address => DMAC_Base;
end SAM_SVD.DMAC;
|
P6/data_P6_2/MDTest161.asm | alxzzhou/BUAA_CO_2020 | 1 | 6313 | <filename>P6/data_P6_2/MDTest161.asm<gh_stars>1-10
ori $ra,$ra,0xf
lb $4,7($0)
srav $5,$1,$5
mfhi $4
addu $3,$4,$3
mtlo $4
mfhi $2
mult $3,$5
sb $1,3($0)
lb $1,2($0)
addu $5,$2,$4
mthi $1
ori $6,$3,34044
div $1,$ra
div $1,$ra
addu $6,$5,$1
lb $1,14($0)
multu $1,$2
divu $4,$ra
srav $4,$2,$1
mflo $3
sb $0,6($0)
lb $4,1($0)
sb $5,12($0)
addiu $6,$6,-10587
mult $1,$2
lb $0,1($0)
mtlo $1
lui $1,11770
lui $1,2021
div $6,$ra
mthi $4
lb $2,8($0)
addiu $1,$1,-21488
sll $4,$4,17
div $0,$ra
lb $1,8($0)
sll $0,$6,19
mult $4,$6
div $4,$ra
lb $1,13($0)
sll $0,$0,13
div $3,$ra
srav $4,$4,$4
mtlo $2
multu $1,$1
lb $4,10($0)
addiu $3,$1,2601
divu $1,$ra
srav $0,$0,$0
sll $5,$5,0
sb $3,1($0)
multu $5,$4
srav $5,$2,$2
sll $4,$0,15
mfhi $4
lui $4,37215
mult $3,$6
lui $2,50578
mtlo $4
srav $0,$0,$0
sll $2,$2,10
ori $5,$5,41220
addiu $0,$3,19912
mtlo $5
ori $4,$4,18876
mtlo $2
divu $2,$ra
lb $5,2($0)
srav $3,$3,$3
mtlo $0
lui $4,42887
addu $4,$4,$5
mfhi $1
lui $0,42605
srav $6,$4,$5
lb $3,2($0)
ori $4,$1,13793
lb $1,11($0)
addu $5,$5,$5
addu $4,$4,$4
mflo $4
multu $3,$2
lb $2,13($0)
addiu $1,$0,-8275
divu $1,$ra
divu $5,$ra
addiu $4,$2,-26459
divu $1,$ra
multu $5,$6
sll $6,$4,14
ori $5,$1,43064
addu $4,$4,$4
srav $5,$1,$4
ori $6,$0,3882
mthi $6
mthi $4
mthi $6
mflo $6
lui $4,23517
mflo $4
divu $2,$ra
ori $1,$1,14936
srav $5,$2,$5
addu $0,$4,$4
lb $4,13($0)
addiu $5,$5,-9772
lb $3,9($0)
multu $4,$4
mtlo $5
multu $6,$4
lui $4,36813
srav $4,$1,$2
mult $4,$4
multu $1,$5
mthi $1
div $5,$ra
lui $5,50918
mult $1,$4
srav $4,$4,$5
mtlo $5
sb $4,5($0)
mtlo $4
sll $4,$5,9
multu $3,$5
addiu $0,$0,8888
lb $6,1($0)
multu $1,$1
lb $3,16($0)
div $0,$ra
lb $5,9($0)
mthi $1
divu $1,$ra
sb $5,3($0)
mflo $6
mflo $1
ori $1,$1,44384
multu $4,$4
srav $1,$2,$5
mfhi $5
mflo $1
divu $5,$ra
mthi $4
div $5,$ra
mtlo $6
sll $4,$4,27
sll $5,$4,0
mflo $0
mfhi $0
mfhi $4
multu $5,$5
sll $4,$6,22
ori $4,$0,42544
div $5,$ra
div $0,$ra
mult $6,$6
div $0,$ra
addiu $5,$1,-26185
multu $4,$4
mthi $1
addu $4,$4,$0
sll $2,$2,13
ori $3,$4,14604
addu $3,$0,$3
div $5,$ra
multu $5,$6
sll $4,$6,30
multu $1,$5
sll $4,$4,27
sb $4,11($0)
ori $0,$5,46581
ori $4,$5,41729
srav $5,$1,$5
mtlo $4
lb $5,10($0)
multu $2,$2
mfhi $3
multu $5,$2
sb $2,3($0)
mfhi $4
ori $1,$4,33790
addiu $0,$1,-20183
multu $5,$2
addu $6,$2,$2
srav $2,$2,$1
mflo $4
multu $4,$2
lui $4,49399
ori $4,$0,14307
addiu $1,$2,-5246
mult $0,$6
mult $4,$4
addu $4,$4,$5
div $5,$ra
addu $2,$2,$4
addiu $2,$6,-20351
mult $4,$4
addu $4,$1,$4
addu $0,$2,$2
addiu $0,$2,30576
div $4,$ra
sll $0,$6,27
lb $2,8($0)
addiu $0,$1,-28339
lb $3,15($0)
ori $4,$1,31384
multu $1,$4
mthi $0
mtlo $1
mfhi $4
mfhi $1
addu $5,$2,$3
multu $4,$0
addu $1,$5,$2
srav $0,$4,$0
mtlo $3
addiu $5,$5,17187
addiu $6,$6,-5938
ori $2,$2,53941
addu $2,$2,$2
div $1,$ra
addu $1,$4,$3
mfhi $6
mtlo $3
ori $5,$5,26300
ori $1,$4,59990
ori $1,$2,39704
mfhi $1
multu $5,$2
sb $1,9($0)
mfhi $2
lui $1,29232
mflo $4
lui $4,13261
mthi $4
multu $5,$5
mthi $5
ori $0,$3,17104
div $0,$ra
addu $1,$4,$0
div $4,$ra
multu $4,$3
mfhi $4
mfhi $4
mflo $1
addu $5,$5,$2
mflo $4
lui $4,38337
ori $5,$1,18712
addu $1,$4,$5
div $5,$ra
mflo $4
addiu $4,$4,-12620
lb $5,14($0)
srav $4,$1,$4
mult $4,$6
mtlo $1
lui $5,8099
mfhi $4
mtlo $3
srav $2,$0,$2
mtlo $4
addu $4,$5,$4
div $4,$ra
mthi $2
mthi $1
srav $4,$4,$6
mthi $1
mflo $1
sll $2,$2,30
multu $5,$5
addu $0,$0,$3
mfhi $5
multu $5,$4
multu $5,$5
sb $5,4($0)
mflo $3
ori $4,$4,45435
ori $4,$6,618
addiu $6,$5,-25615
mthi $5
sb $4,11($0)
srav $4,$1,$1
lui $0,15610
multu $4,$6
mthi $4
mult $3,$3
srav $2,$2,$4
multu $1,$1
srav $6,$5,$5
div $4,$ra
mthi $1
mtlo $2
sll $4,$1,16
mthi $4
divu $1,$ra
multu $5,$5
ori $2,$2,31246
sb $6,1($0)
addu $1,$1,$1
div $2,$ra
lui $4,5194
sb $2,7($0)
addiu $1,$1,-29122
divu $4,$ra
mthi $6
mult $1,$2
multu $2,$2
mflo $6
srav $1,$1,$4
div $6,$ra
divu $0,$ra
mthi $5
ori $4,$2,38290
addiu $5,$1,-18748
mtlo $1
mflo $5
mfhi $3
mthi $3
lui $4,16288
mtlo $4
addiu $5,$3,-19717
sll $0,$0,10
addiu $3,$3,-19334
addu $6,$5,$6
srav $5,$2,$2
addu $2,$2,$1
addiu $1,$6,7053
sb $5,8($0)
mfhi $6
mfhi $1
multu $1,$1
mthi $0
addu $6,$4,$2
srav $4,$5,$1
addiu $4,$4,15913
sb $5,12($0)
lui $6,13030
lb $2,1($0)
mfhi $5
mfhi $1
sll $1,$5,1
sll $2,$2,28
mflo $5
ori $6,$2,38457
sb $4,9($0)
mult $0,$1
addu $1,$1,$2
addiu $5,$5,10372
ori $4,$2,4719
lui $6,17132
mult $5,$6
mult $1,$4
srav $5,$4,$1
mflo $4
srav $4,$4,$4
mult $2,$2
sll $1,$4,24
mthi $1
mtlo $1
addu $4,$2,$4
mthi $4
div $1,$ra
mtlo $5
sb $1,11($0)
divu $1,$ra
mflo $6
ori $2,$2,62384
lb $6,16($0)
mthi $3
mtlo $3
mfhi $3
sll $1,$4,6
mfhi $5
ori $0,$0,24718
divu $1,$ra
ori $4,$1,56587
sb $4,4($0)
mult $2,$6
lb $2,14($0)
lui $5,58512
sb $3,0($0)
sb $3,11($0)
lb $4,3($0)
mthi $4
lui $2,51089
multu $4,$4
div $4,$ra
multu $3,$2
mthi $4
addu $1,$4,$4
div $4,$ra
srav $6,$6,$6
mflo $4
lui $1,17397
lui $0,48426
lb $0,8($0)
sb $0,5($0)
mfhi $5
mfhi $5
mfhi $4
lui $4,47973
mthi $3
addiu $4,$0,-7336
addu $4,$4,$1
sb $2,0($0)
sll $2,$2,0
lb $5,5($0)
multu $0,$2
srav $4,$4,$4
lb $0,16($0)
lb $2,14($0)
sb $2,6($0)
mflo $4
mfhi $5
srav $4,$5,$1
div $6,$ra
ori $4,$2,21543
sb $6,14($0)
mtlo $4
sb $4,0($0)
sb $5,13($0)
lb $1,1($0)
mthi $5
addiu $1,$1,1363
mfhi $6
sll $4,$1,28
ori $5,$1,63644
div $4,$ra
sll $2,$2,22
divu $4,$ra
mfhi $2
div $3,$ra
addu $4,$2,$4
mflo $4
lb $5,7($0)
addiu $1,$6,29244
sll $5,$1,2
srav $6,$6,$6
lb $4,9($0)
lui $1,4250
ori $2,$2,47068
sll $6,$6,2
lui $5,18612
mthi $0
mthi $5
div $5,$ra
mflo $1
mtlo $1
mfhi $1
addiu $0,$0,8499
mult $1,$1
div $5,$ra
multu $5,$5
sb $1,6($0)
mfhi $0
multu $5,$2
lb $5,3($0)
mflo $5
ori $4,$4,6502
mfhi $1
sll $4,$1,4
addiu $0,$4,-26311
addiu $1,$4,-15956
addiu $2,$0,-16698
lui $4,23109
mtlo $4
sll $5,$2,0
divu $5,$ra
multu $4,$4
lb $5,16($0)
mult $2,$2
div $2,$ra
ori $5,$2,1829
addu $5,$5,$1
mflo $3
mflo $5
lb $0,10($0)
mfhi $0
sll $6,$2,10
sb $3,10($0)
addu $1,$1,$1
addiu $1,$1,-18024
sb $4,14($0)
divu $5,$ra
addu $1,$4,$5
div $4,$ra
multu $4,$2
addu $5,$4,$2
mflo $5
mtlo $5
sb $6,1($0)
mthi $4
mtlo $6
sb $1,2($0)
addu $4,$2,$2
mflo $1
mult $1,$2
mtlo $1
lb $3,7($0)
multu $0,$2
srav $0,$6,$1
multu $4,$4
mthi $4
mthi $4
addu $1,$0,$3
mfhi $0
sb $4,10($0)
mflo $1
ori $1,$1,34096
mtlo $1
mthi $5
addu $2,$2,$2
addu $6,$2,$6
addiu $4,$5,19296
ori $4,$0,35083
lui $4,64831
div $5,$ra
mfhi $1
divu $6,$ra
sb $1,11($0)
mult $4,$4
mult $4,$4
srav $4,$0,$1
mult $5,$5
mthi $5
div $5,$ra
srav $4,$4,$4
mthi $2
ori $4,$2,34175
multu $1,$1
addiu $5,$5,-21724
ori $5,$5,45862
mflo $4
mult $3,$5
srav $1,$1,$5
lui $1,25559
addiu $6,$6,25416
mthi $0
mtlo $4
multu $4,$4
div $1,$ra
ori $2,$2,14231
sll $5,$4,23
multu $5,$5
sb $5,11($0)
addu $4,$4,$4
sll $1,$1,16
mtlo $1
lui $4,36783
mflo $4
mfhi $4
sll $5,$4,11
divu $2,$ra
ori $3,$5,27565
lb $4,10($0)
mtlo $1
sll $5,$4,3
multu $4,$4
sb $4,8($0)
div $1,$ra
mtlo $3
mfhi $0
ori $1,$1,29801
lb $5,7($0)
mtlo $4
divu $5,$ra
multu $1,$2
addiu $5,$0,13219
mult $1,$2
sll $0,$0,17
sb $1,1($0)
mthi $2
lb $1,2($0)
addu $4,$4,$4
addu $0,$0,$2
lb $0,5($0)
addiu $5,$5,23161
mult $4,$4
mthi $0
mflo $2
mthi $6
div $4,$ra
addu $3,$3,$3
srav $1,$1,$3
lb $1,1($0)
mtlo $5
mflo $3
sll $4,$4,6
div $2,$ra
mflo $3
mtlo $1
lui $4,33131
multu $5,$5
mflo $1
mthi $0
div $2,$ra
addiu $4,$3,12854
div $4,$ra
lb $4,13($0)
divu $5,$ra
srav $4,$1,$1
srav $3,$1,$3
divu $5,$ra
mult $5,$5
divu $1,$ra
div $2,$ra
sll $4,$3,10
sb $5,12($0)
srav $2,$2,$3
lui $4,23641
srav $3,$2,$3
mflo $4
addiu $1,$2,11481
mult $6,$6
sb $5,13($0)
sll $0,$2,2
div $1,$ra
mthi $1
addiu $0,$1,-2393
sll $6,$2,8
div $3,$ra
sb $4,13($0)
lui $4,51021
lui $5,7854
addiu $4,$1,27489
mflo $1
mflo $5
div $3,$ra
sll $5,$4,2
lb $2,8($0)
addu $5,$2,$2
mflo $5
srav $4,$1,$4
mult $4,$5
srav $4,$3,$3
multu $4,$4
ori $2,$2,64464
sll $4,$2,5
mfhi $5
addiu $4,$6,23443
mthi $4
sb $4,6($0)
divu $3,$ra
mult $6,$2
multu $4,$4
div $5,$ra
srav $4,$2,$1
div $4,$ra
ori $5,$5,22494
mtlo $0
addiu $4,$1,-9461
sb $4,3($0)
mult $4,$6
lb $5,8($0)
div $6,$ra
divu $4,$ra
div $5,$ra
mfhi $5
mfhi $4
mthi $6
mult $0,$1
mfhi $5
mfhi $6
mult $5,$6
addu $3,$5,$3
div $4,$ra
ori $2,$2,10615
mthi $4
sll $4,$2,14
srav $3,$4,$3
addiu $3,$2,-13696
ori $1,$3,6416
mflo $5
lb $4,6($0)
addu $0,$4,$4
mthi $3
lui $0,16712
div $0,$ra
lui $5,48997
mfhi $1
mflo $6
mthi $4
sll $4,$4,18
addiu $3,$4,-10626
sb $5,14($0)
div $1,$ra
addu $2,$2,$4
addiu $1,$6,19720
mtlo $1
mthi $3
multu $1,$0
sb $1,2($0)
lui $1,53410
addu $4,$4,$3
mult $5,$1
mflo $4
sb $4,16($0)
divu $4,$ra
mult $2,$4
sll $5,$1,20
lb $0,13($0)
addu $5,$5,$3
addiu $2,$2,13099
mfhi $1
divu $1,$ra
ori $5,$6,32160
div $4,$ra
multu $5,$4
ori $5,$6,6540
srav $1,$1,$1
lb $4,2($0)
mfhi $1
mthi $5
mflo $6
lb $2,0($0)
sll $5,$4,31
ori $1,$2,18825
mthi $4
lb $5,12($0)
mfhi $5
sb $3,4($0)
srav $2,$2,$2
mfhi $4
mfhi $1
addiu $5,$1,-184
mtlo $5
mult $2,$0
lb $6,14($0)
srav $1,$3,$3
srav $4,$1,$3
sb $1,3($0)
addu $4,$6,$5
lui $6,4088
mthi $4
div $0,$ra
ori $1,$1,28645
mthi $4
srav $0,$0,$4
div $4,$ra
mtlo $4
mtlo $1
div $4,$ra
div $3,$ra
srav $2,$4,$2
addu $1,$0,$2
mflo $5
sb $5,10($0)
divu $1,$ra
sb $0,0($0)
divu $2,$ra
srav $5,$5,$4
addiu $6,$6,-21847
lui $1,34413
mflo $4
sll $4,$4,12
multu $4,$4
mthi $2
sb $4,16($0)
mthi $3
sb $4,14($0)
addu $4,$4,$2
addu $4,$2,$0
mflo $1
addiu $1,$2,-22592
srav $4,$4,$4
mthi $1
addiu $1,$1,-26167
sb $0,12($0)
addu $1,$2,$2
lb $1,10($0)
lb $4,8($0)
mthi $3
div $3,$ra
multu $2,$2
multu $4,$4
lb $6,13($0)
ori $5,$1,57816
div $0,$ra
addiu $4,$4,11133
lb $4,9($0)
addiu $1,$1,-13995
divu $1,$ra
divu $0,$ra
mfhi $5
multu $5,$4
addu $0,$4,$0
sll $5,$1,8
divu $6,$ra
divu $3,$ra
mthi $5
sll $5,$2,13
sll $5,$4,31
mult $2,$2
mult $1,$2
addiu $1,$4,-24402
addu $3,$4,$3
addu $1,$2,$1
mult $6,$6
mthi $4
multu $6,$2
lb $6,5($0)
addiu $4,$4,4187
div $6,$ra
divu $4,$ra
srav $5,$2,$4
addu $0,$0,$0
lb $3,15($0)
mthi $4
sb $5,10($0)
mult $1,$4
mflo $5
multu $1,$0
sll $6,$1,6
srav $5,$5,$5
lb $0,1($0)
divu $3,$ra
mflo $2
sll $4,$6,4
addiu $4,$5,23757
sll $4,$2,0
div $3,$ra
div $1,$ra
lb $4,3($0)
addu $4,$1,$4
mult $4,$2
mult $0,$4
mflo $2
mflo $5
mflo $2
div $4,$ra
mtlo $6
mflo $4
ori $5,$5,2152
mthi $6
addu $2,$2,$2
sll $1,$1,8
lb $2,11($0)
mflo $4
mthi $4
mult $2,$2
multu $0,$2
sb $1,14($0)
addu $4,$5,$5
divu $5,$ra
ori $1,$1,42611
divu $4,$ra
ori $3,$1,36124
mtlo $6
lui $0,33409
sll $1,$4,18
mtlo $1
mfhi $5
addiu $4,$4,14662
addiu $4,$4,-24536
div $2,$ra
addu $6,$5,$3
sll $4,$1,6
mtlo $6
mthi $4
ori $5,$0,25344
mtlo $2
srav $0,$4,$1
mthi $4
sb $4,8($0)
mtlo $3
addiu $4,$1,24497
lb $4,9($0)
sb $4,0($0)
mult $5,$0
addu $4,$4,$4
sll $6,$2,0
mtlo $4
mflo $1
ori $4,$5,19672
divu $4,$ra
multu $1,$0
lb $6,2($0)
addu $5,$5,$5
lui $3,31481
divu $1,$ra
lb $1,14($0)
mflo $3
mthi $3
ori $1,$4,19053
mflo $5
srav $2,$2,$4
mtlo $5
addiu $4,$4,29740
|
programs/oeis/021/A021520.asm | neoneye/loda | 22 | 83184 | <reponame>neoneye/loda
; A021520: Decimal expansion of 1/516.
; 0,0,1,9,3,7,9,8,4,4,9,6,1,2,4,0,3,1,0,0,7,7,5,1,9,3,7,9,8,4,4,9,6,1,2,4,0,3,1,0,0,7,7,5,1,9,3,7,9,8,4,4,9,6,1,2,4,0,3,1,0,0,7,7,5,1,9,3,7,9,8,4,4,9,6,1,2,4,0,3,1,0,0,7,7,5,1,9,3,7,9,8,4,4,9,6,1,2,4
add $0,1
mov $1,10
pow $1,$0
sub $1,6
mul $1,7
div $1,21
add $1,4
div $1,172
mod $1,10
mov $0,$1
|
alloy4fun_models/trashltl/models/11/BDHfCrqynzXxL6gtH.als | Kaixi26/org.alloytools.alloy | 0 | 4202 | open main
pred idBDHfCrqynzXxL6gtH_prop12 {
some f : File | eventually f in Trash => eventually f not in Trash
}
pred __repair { idBDHfCrqynzXxL6gtH_prop12 }
check __repair { idBDHfCrqynzXxL6gtH_prop12 <=> prop12o } |
Task/Long-multiplication/Ada/long-multiplication-4.ada | LaudateCorpus1/RosettaCodeData | 1 | 12136 | type Long_Number is array (Natural range <>) of Unsigned_32;
function "*" (Left, Right : Long_Number) return Long_Number is
Result : Long_Number (0..Left'Length + Right'Length - 1) := (others => 0);
Accum : Unsigned_64;
begin
for I in Left'Range loop
for J in Right'Range loop
Accum := Unsigned_64 (Left (I)) * Unsigned_64 (Right (J));
for K in I + J..Result'Last loop
exit when Accum = 0;
Accum := Accum + Unsigned_64 (Result (K));
Result (K) := Unsigned_32 (Accum and 16#FFFF_FFFF#);
Accum := Accum / 2**32;
end loop;
end loop;
end loop;
for Index in reverse Result'Range loop -- Normalization
if Result (Index) /= 0 then
return Result (0..Index);
end if;
end loop;
return (0 => 0);
end "*";
|
agda/Avionics/SafetyEnvelopes/Properties.agda | helq/safety-envelopes-sentinels | 0 | 521 | module Avionics.SafetyEnvelopes.Properties where
open import Data.Bool using (Bool; true; false; _∧_; T)
open import Data.Empty using (⊥; ⊥-elim)
open import Data.List as List using (List; []; _∷_; any)
open import Data.List.Relation.Unary.Any as Any using (Any; here; there; satisfied)
open import Data.Maybe using (Maybe; just; nothing; is-just; _>>=_)
open import Data.Product as Prod using (∃-syntax; _×_; proj₁; proj₂) renaming (_,_ to ⟨_,_⟩)
open import Data.Sum using (_⊎_; inj₁; inj₂)
open import Function using (_∘_)
open import Relation.Binary.PropositionalEquality as Eq using (_≡_; refl; cong; cong₂; inspect; [_]; sym; trans)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _≡˘⟨_⟩_; _≡⟨_⟩_; _∎)
open import Relation.Nullary using (Dec; yes; no; ¬_)
open import Relation.Nullary.Decidable using (toWitness; fromWitness)
open import Relation.Unary using (_∈_)
open import Avionics.Bool using (≡→T; T∧→×; ×→T∧; lem∧)
open import Avionics.List using (≡→any; any-map; any-map-rev; any→≡)
open import Avionics.Real
using (ℝ; _+_; _-_; -_; _*_; _÷_; _^_; _<ᵇ_; _≤_; _<_; _<?_; _≤?_; _≢0;
0ℝ; 1ℝ; 2ℝ; 1/2; abs; 1/_; _^2; √_; fromℕ;
double-neg;
⟨0,∞⟩; [0,∞⟩;
<-transˡ; 2>0; ⟨0,∞⟩→0<; 0<→⟨0,∞⟩; >0→≢0; >0→≥0;
0≟0≡yes0≡0;
abs<x→<x∧-x<; neg-involutive; neg-distrib-+; neg-mono-<->; neg-def; m-m≡0;
+-comm; +-assoc; *-comm; *-assoc; +-monoˡ-<; m÷n<o≡m<o*n; m<o÷n≡m*n<o; neg-distribˡ-*; √x^2≡absx;
x*x≡x^2; x^2*y^2≡⟨xy⟩^2; 1/x^2≡⟨1/x⟩^2)
open import Avionics.Probability using (NormalDist; Dist)
open import Avionics.SafetyEnvelopes
using (inside; inside'; mahalanobis1; z-predictable'; P[_|X=_]_; classify''; classify; M→pbs;
StallClasses; Stall; NoStall; Uncertain;
no-uncertain;
safety-envelope; z-predictable; Model; τ-confident;
Stall≡1-NoStall; NoStall≡1-Stall; ≤p→¬≤1-p; ≤1-p→¬≤p
)
open NormalDist using (σ; μ)
--<ᵇ→< : ∀ {x y} → T (x <ᵇ y) → x < y
--<ᵇ→< = toWitness
-- Preliminary defitinions
-- `pi` is the prediction interval for the z score, i.e.,
-- pi(N (μ, σ), z) = [μ − zσ, μ + zσ]
pi : NormalDist → ℝ → ℝ → Set
pi nd z x = (μ nd) - z * (σ nd) < x
× x < (μ nd) + z * (σ nd)
extractDists : Model → List NormalDist
extractDists M = List.map (proj₁ ∘ proj₂) (Model.fM M)
------------------------------ Starting point - Theorem 2 ------------------------------
-- Theorem 1 says:
-- In the case of univariate normal distributions, the z-predictability condition
-- > mahalanobis(μ, x, σ²-¹) < z
-- reduces to
-- > μ - zσ < x <ᵇ (μ + zσ)
-- the prediction interval with a z-score of z
z-pred-interval≡mahalanobis<z : ∀ (nd z x)
→ inside nd z x ≡ inside' nd z x
z-pred-interval≡mahalanobis<z nd z x =
begin
inside nd z x
≡⟨⟩
(u - z * s <ᵇ x) ∧ (x <ᵇ (u + z * s))
≡⟨ cong (λ e → ((u - z * s) <ᵇ x) ∧ (x <ᵇ e)) (
begin
u + z * s
≡˘⟨ cong₂ (_+_) (neg-involutive _) (neg-involutive _) ⟩
-(- u) + -(-(z * s))
≡˘⟨ neg-distrib-+ _ _ ⟩
-((- u) + (- (z * s)))
≡⟨⟩
-(- u - z * s)
∎
) ⟩
(u - z * s <ᵇ x) ∧ (x <ᵇ -(- u - z * s))
≡⟨ cong (λ e → (e <ᵇ x) ∧ (x <ᵇ -(- u - z * s))) (
begin
u - z * s
≡˘⟨ cong (_+ (- (z * s))) (neg-involutive _) ⟩
-(- u) + (- (z * s))
≡˘⟨ neg-distrib-+ _ _ ⟩
-(- u + z * s)
∎
) ⟩
(-(- u + z * s) <ᵇ x) ∧ (x <ᵇ -(- u - z * s))
≡˘⟨ cong (λ e → (-(- u + z * s) <ᵇ e) ∧ (e <ᵇ -(- u - z * s))) (neg-involutive _) ⟩
(-(- u + z * s) <ᵇ -(- x)) ∧ (-(- x) <ᵇ -(- u - z * s))
≡˘⟨ cong ((-(- u + z * s) <ᵇ -(- x)) ∧_) (neg-mono-<-> _ _) ⟩
(-(- u + z * s) <ᵇ -(- x)) ∧ (- u - z * s <ᵇ - x)
≡˘⟨ cong (_∧ (- u - z * s <ᵇ - x)) (neg-mono-<-> _ _) ⟩
(- x <ᵇ - u + z * s) ∧ (- u - z * s <ᵇ - x)
≡⟨ cong (_∧ (- u - z * s <ᵇ - x)) (
begin
- x <ᵇ - u + z * s
≡˘⟨ cong (_<ᵇ - u + z * s) (neg-def _) ⟩
0ℝ - x <ᵇ - u + z * s
≡˘⟨ cong (λ e → e - x <ᵇ - u + z * s) (trans (+-comm _ _) (m-m≡0 _)) ⟩
(- u + u) - x <ᵇ - u + z * s
≡˘⟨ cong (_<ᵇ - u + z * s) (+-assoc _ _ _) ⟩
(- u) + (u - x) <ᵇ - u + z * s
≡˘⟨ +-monoˡ-< _ _ _ ⟩
u - x <ᵇ z * s
∎
) ⟩
(u - x <ᵇ z * s) ∧ (- u - z * s <ᵇ - x)
≡⟨ cong ((u - x <ᵇ z * s) ∧_) (
begin
- u - z * s <ᵇ - x
≡˘⟨ cong (- u - z * s <ᵇ_) (neg-def _) ⟩
- u - z * s <ᵇ 0ℝ - x
≡˘⟨ cong (λ e → - u - z * s <ᵇ e - x) (trans (+-comm _ _) (m-m≡0 _)) ⟩
- u - z * s <ᵇ (- u + u) - x
≡˘⟨ cong (- u - z * s <ᵇ_) (+-assoc _ _ _) ⟩
- u - z * s <ᵇ - u + (u - x)
≡˘⟨ +-monoˡ-< _ _ _ ⟩
- (z * s) <ᵇ u - x
∎
) ⟩
(u - x <ᵇ z * s) ∧ (- (z * s) <ᵇ u - x)
≡˘⟨ cong ((u - x <ᵇ z * s) ∧_) (
begin
- z <ᵇ (u - x) ÷ s
≡⟨ m<o÷n≡m*n<o _ _ _ ⟩
(- z) * s <ᵇ (u - x)
≡˘⟨ cong (_<ᵇ (u - x)) (neg-distribˡ-* _ _) ⟩
- (z * s) <ᵇ u - x
∎
) ⟩
(u - x <ᵇ z * s) ∧ (- z <ᵇ (u - x) ÷ s)
≡˘⟨ cong (_∧ (- z <ᵇ (u - x) ÷ s)) (m÷n<o≡m<o*n _ _ _) ⟩
((u - x) ÷ s <ᵇ z) ∧ (- z <ᵇ (u - x) ÷ s)
≡˘⟨ abs<x→<x∧-x< ⟩
abs ((u - x) ÷ s) <ᵇ z
≡˘⟨ cong (_<ᵇ z) (√x^2≡absx _) ⟩
√(((u - x) ÷ s)^2) <ᵇ z
≡⟨⟩
√(((u - x) * (1/ s))^2) <ᵇ z
≡˘⟨ cong (λ e → √ e <ᵇ z) (
begin
(u - x) * (1/ (s * s)) * (u - x)
≡⟨ *-comm _ _ ⟩
(u - x) * ((u - x) * (1/ (s * s)))
≡⟨ *-assoc _ _ _ ⟩
(u - x) * (u - x) * (1/ (s * s))
≡⟨ cong (λ e → (u - x) * (u - x) * (1/ e)) (x*x≡x^2 _) ⟩
(u - x) * (u - x) * (1/ (s ^2))
≡⟨ cong ((u - x) * (u - x) *_) (1/x^2≡⟨1/x⟩^2 _) ⟩
(u - x) * (u - x) * (1/ s) ^2
≡⟨ cong (_* (1/ s) ^2) (x*x≡x^2 _) ⟩
(u - x)^2 * (1/ s) ^2
≡⟨ x^2*y^2≡⟨xy⟩^2 _ _ ⟩
((u - x) * (1/ s))^2
∎
)⟩
√((u - x) * (1/ (s * s)) * (u - x)) <ᵇ z
≡⟨⟩
mahalanobis1 u x (1/ (s * s)) <ᵇ z
≡⟨⟩
inside' nd z x
∎
where u = μ nd
s = σ nd
---- ############ Theorem 1 END ############
------------------------------ Starting point - Theorem 2 ------------------------------
-- Proof of Theorem 2 (paper)
--
-- In words, the Property 1 says that:
-- The energy signal x is z-predictable iff there exist ⟨α, v⟩ s.t.
-- M(⟨α, v⟩)1 = di and x ∈ pi(di , z).
--
-- Notice that `Any (λ nd → x ∈ pi nd z) nds` translates to:
-- there exists nd such that `nd ∈ nds` and `x ∈ pi(nd, z)`
follows-def←' : ∀ (nds z x)
→ z-predictable' nds z x ≡ ⟨ x , true ⟩
→ Any (λ nd → x ∈ pi nd z) nds
follows-def←' nds z x res≡x,true = Any-x∈pi
where
res≡true = cong proj₂ res≡x,true
-- the first `toWitness` takes a result `(μ nd - z * σ nd) <ᵇ x` (a
-- boolean) and produces a proof of the type `(μ nd) - z * (σ nd) < x`
-- assuming we have provided an operator `<?`
toWitness' = λ nd → Prod.map (toWitness {Q = (μ nd - z * σ nd) <? x})
(toWitness {Q = x <? (μ nd + z * σ nd)})
-- We find the value for which `inside z x` becomes true in the list `nds`
Any-bool = ≡→any (λ nd → inside nd z x) nds res≡true
-- Converting the boolean proof into a proof at the type level
Any-x∈pi = Any.map (λ {nd} → toWitness' nd ∘ T∧→×) Any-bool
-- forward proof
follows-def→' : ∀ (nds z x)
→ Any (λ nd → x ∈ pi nd z) nds
→ z-predictable' nds z x ≡ ⟨ x , true ⟩
follows-def→' nds z x any[x∈pi-z]nds = let
-- converts a tuple of `(μ nd) - z * (σ nd) < x , x < (μ nd + z * σ nd)`
-- (a proof) into a boolean
fromWitness' nd = λ{⟨ μ-zσ<x , x<μ+zσ ⟩ →
×→T∧ ⟨ (fromWitness {Q = (μ nd - z * σ nd) <? x} μ-zσ<x)
, (fromWitness {Q = x <? (μ nd + z * σ nd)} x<μ+zσ)
⟩}
-- Converting from a proof on `_<_` to a proof on `_<ᵇ_`
any[inside]nds = (Any.map (λ {nd} → fromWitness' nd) any[x∈pi-z]nds)
-- Transforming the prove from Any into equality (_≡_)
z-pred-x≡⟨x,true⟩ = any→≡ (λ nd → inside nd z x) nds any[inside]nds
-- Extending the result from a single Bool value to a pair `ℝ × Bool`
in cong (⟨ x ,_⟩) z-pred-x≡⟨x,true⟩
-- From the prove above we can obtain the value `nd` and its prove `x ∈ pi nd z`
-- Note: An element of ∃[ nd ] (x ∈ pi nd z) is a tuple of the form ⟨ nd , proof ⟩
--prop1← : ∀ (nds z x)
-- → z-predictable' nds z x ≡ ⟨ x , true ⟩
-- → ∃[ nd ] (x ∈ pi nd z)
--prop1← nds z x res≡x,true = satisfied (follows-def←' nds z x res≡x,true)
-- This proofs is telling us that `z-predictable` follows from the definition
follows-def← : ∀ (M z x)
→ z-predictable M z x ≡ ⟨ x , true ⟩
→ Any (λ nd → x ∈ pi nd z) (extractDists M)
follows-def← M z x res≡x,true = follows-def←' (extractDists M) z x res≡x,true
follows-def→ : ∀ (M z x)
→ Any (λ nd → x ∈ pi nd z) (extractDists M)
→ z-predictable M z x ≡ ⟨ x , true ⟩
follows-def→ M z x Any[x∈pi-nd-z]M = follows-def→' (extractDists M) z x Any[x∈pi-nd-z]M
-- ############ FINAL RESULT - Theorem 1 ############
-- In words: Given a Model `M` and parameter `z`, if `x` is z-predictable, then
-- there exists θ (a flight state) such that they are associated to a `nd`
-- (Normal Distribution) and `x` falls withing the Predictable Interval
theorem1← : ∀ (M z x)
→ z-predictable M z x ≡ ⟨ x , true ⟩
→ Any (λ{⟨ θ , ⟨ nd , p ⟩ ⟩ → x ∈ pi nd z}) (Model.fM M)
theorem1← M z x res≡x,true = any-map (proj₁ ∘ proj₂) (follows-def← M z x res≡x,true)
-- The reverse of theorem1←
theorem1→ : ∀ (M z x)
→ Any (λ{⟨ θ , ⟨ nd , p ⟩ ⟩ → x ∈ pi nd z}) (Model.fM M)
→ z-predictable M z x ≡ ⟨ x , true ⟩
theorem1→ M z x Any[θ→x∈pi-nd-z]M = follows-def→ M z x (any-map-rev (proj₁ ∘ proj₂) Any[θ→x∈pi-nd-z]M)
-- ################# Theorem 2 END ##################
------------------------------ Starting point - Theorem 2 ------------------------------
lem← : ∀ (pbs τ x k)
→ classify'' pbs τ x ≡ k
→ k ≡ Uncertain ⊎ ∃[ p ] ((P[ k |X= x ] pbs ≡ just p) × (τ ≤ p))
lem← pbs τ x k _ with P[ Stall |X= x ] pbs | inspect (P[ Stall |X=_] pbs) x
lem← _ _ _ Uncertain _ | nothing | [ P[k|X=x]≡nothing ] = inj₁ refl
lem← _ τ _ _ _ | just p | [ _ ] with τ ≤? p | τ ≤? (1ℝ - p)
lem← _ _ _ Stall _ | just p | [ P[k|X=x]≡justp ] | yes τ≤p | no ¬τ≤1-p = inj₂ ⟨ p , ⟨ P[k|X=x]≡justp , τ≤p ⟩ ⟩
lem← _ _ _ NoStall _ | just p | [ P[k|X=x]≡justp ] | no ¬τ≤p | yes τ≤1-p =
let P[NoStall|X=x]≡just1-p = Stall≡1-NoStall P[k|X=x]≡justp
in inj₂ ⟨ 1ℝ - p , ⟨ P[NoStall|X=x]≡just1-p , τ≤1-p ⟩ ⟩
lem← _ _ _ Uncertain _ | _ | _ | _ | _ = inj₁ refl
lem→' : ∀ (pbs τ x p)
-- This line is asking for the main assumptions for the code to work properly:
-- * 0.5 < τ ≤ 1
-- * 0 ≤ p ≤ 1
→ (1/2 < τ × τ ≤ 1ℝ) × (0ℝ ≤ p × p ≤ 1ℝ)
→ (P[ Stall |X= x ] pbs) ≡ just p
→ τ ≤ (1ℝ - p)
→ classify'' pbs τ x ≡ NoStall
lem→' pbs _ x _ _ _ _ with P[ Stall |X= x ] pbs
lem→' _ τ _ _ _ _ _ | just p with τ ≤? p | τ ≤? (1ℝ - p)
lem→' _ _ _ _ _ _ _ | just p | no _ | yes _ = refl
lem→' _ _ _ _ _ refl τ≤1-p | just p | _ | no ¬τ≤1-p = ⊥-elim (¬τ≤1-p τ≤1-p)
lem→' _ _ _ _ assumpts refl τ≤1-p | just p | yes τ≤p | yes _ = ⊥-elim (¬τ≤p τ≤p)
where
1/2<τ = proj₁ (proj₁ assumpts)
τ≤1 = proj₂ (proj₁ assumpts)
0≤p = proj₁ (proj₂ assumpts)
p≤1 = proj₂ (proj₂ assumpts)
¬τ≤p = ≤1-p→¬≤p 1/2<τ τ≤1 0≤p p≤1 τ≤1-p
τ≤p→τ≤1-⟨1-p⟩ : ∀ τ p → τ ≤ p → τ ≤ 1ℝ - (1ℝ - p)
τ≤p→τ≤1-⟨1-p⟩ τ p τ≤p rewrite double-neg p 1ℝ = τ≤p
lem→ : ∀ (pbs τ x k)
→ (1/2 < τ × τ ≤ 1ℝ)
→ ∃[ p ] (((P[ k |X= x ] pbs) ≡ just p) × (τ ≤ p))
→ classify'' pbs τ x ≡ k
lem→ pbs _ x Stall _ _ with P[ Stall |X= x ] pbs
lem→ _ τ _ _ _ _ | just p with τ ≤? p | τ ≤? (1ℝ - p)
lem→ _ _ _ _ _ _ | just p | yes _ | no _ = refl
lem→ _ _ _ _ _ ⟨ _ , ⟨ refl , τ≤p ⟩ ⟩ | just p | no ¬τ≤p | _ = ⊥-elim (¬τ≤p τ≤p)
lem→ _ _ _ _ 1/2<τ≤1 ⟨ _ , ⟨ refl , τ≤p ⟩ ⟩ | just p | yes _ | yes τ≤1-p = ⊥-elim (¬τ≤1-p τ≤1-p)
where 1/2<τ = proj₁ 1/2<τ≤1
τ≤1 = proj₂ 1/2<τ≤1
postulate 0≤p : 0ℝ ≤ p
p≤1 : p ≤ 1ℝ
¬τ≤1-p = ≤p→¬≤1-p 1/2<τ τ≤1 0≤p p≤1 τ≤p
lem→ pbs τ x NoStall 1/2<τ≤1 ⟨ p , ⟨ P[k|X=x]≡justp , τ≤p ⟩ ⟩ = let
P[S|X=x]≡just1-p = NoStall≡1-Stall P[k|X=x]≡justp
τ≤1-⟨1-p⟩ = τ≤p→τ≤1-⟨1-p⟩ τ p τ≤p
assumptions = ⟨ 1/2<τ≤1 , 0≤p≤1 ⟩
in lem→' pbs τ x (1ℝ - p) assumptions P[S|X=x]≡just1-p τ≤1-⟨1-p⟩
where postulate 0≤p≤1 : (0ℝ ≤ 1ℝ - p × 1ℝ - p ≤ 1ℝ)
prop2M-prior← : ∀ (M τ x k)
→ classify M τ x ≡ k
→ k ≡ Uncertain ⊎ ∃[ p ] (((P[ k |X= x ] (M→pbs M)) ≡ just p) × (τ ≤ p))
prop2M-prior← M = lem← (M→pbs M)
prop2M-prior←' : ∀ (M τ x k)
→ k ≡ Stall ⊎ k ≡ NoStall
→ classify M τ x ≡ k
→ ∃[ p ] (((P[ k |X= x ] (M→pbs M)) ≡ just p) × (τ ≤ p))
prop2M-prior←' M τ x k _ cMτx≡k with prop2M-prior← M τ x k cMτx≡k
prop2M-prior←' _ _ _ Stall (inj₁ _) _ | inj₂ P[k|X=x]≥τ = P[k|X=x]≥τ
prop2M-prior←' _ _ _ NoStall _ _ | inj₂ P[k|X=x]≥τ = P[k|X=x]≥τ
prop2M-prior→ : ∀ (M τ x k)
→ (1/2 < τ × τ ≤ 1ℝ)
→ ∃[ p ] (((P[ k |X= x ] (M→pbs M)) ≡ just p) × (τ ≤ p))
→ classify M τ x ≡ k
prop2M-prior→ M τ x k 1/2<τ≤1 = lem→ (M→pbs M) τ x k 1/2<τ≤1
prop2M← : ∀ (M τ x)
→ τ-confident M τ x ≡ true
→ ∃[ k ] ((classify M τ x ≡ k) × (k ≡ Stall ⊎ k ≡ NoStall))
prop2M← M τ x τconf≡true with classify M τ x
... | Stall = ⟨ Stall , ⟨ refl , inj₁ refl ⟩ ⟩
... | NoStall = ⟨ NoStall , ⟨ refl , inj₂ refl ⟩ ⟩
prop2M→ : ∀ (M τ x k)
→ k ≡ Stall ⊎ k ≡ NoStall
→ classify M τ x ≡ k
→ τ-confident M τ x ≡ true
prop2M→ M τ x Stall (inj₁ k≡Stall) cMτx≡k = cong no-uncertain cMτx≡k
prop2M→ M τ x NoStall (inj₂ k≡NoStall) cMτx≡k = cong no-uncertain cMτx≡k
---- ############ FINAL RESULT - Theorem 3 ############
-- Theorem 3 says:
-- a classification k is τ-confident iff τ ≤ P[ k | X = x ]
theorem2← : ∀ (M τ x)
→ τ-confident M τ x ≡ true
→ ∃[ k ] (∃[ p ] (((P[ k |X= x ] (M→pbs M)) ≡ just p) × (τ ≤ p))) -- which means: τ ≤ P[ k | X = x ]
theorem2← M τ x τconf≡true = let -- prop2M-prior← M τ x k (prop2M← M τ x k τconf≡true)
⟨ k , ⟨ cMτx≡k , k≢Uncertain ⟩ ⟩ = prop2M← M τ x τconf≡true
in ⟨ k , prop2M-prior←' M τ x k k≢Uncertain cMτx≡k ⟩
theorem2→ : ∀ (M τ x k)
→ (1/2 < τ × τ ≤ 1ℝ)
→ k ≡ Stall ⊎ k ≡ NoStall
→ ∃[ p ] (((P[ k |X= x ] (M→pbs M)) ≡ just p) × (τ ≤ p)) -- which means: τ ≤ P[ k | X = x ]
→ τ-confident M τ x ≡ true
theorem2→ M τ x k 1/2<τ≤1 k≢Uncertain ⟨p,⟩ =
prop2M→ M τ x k k≢Uncertain (prop2M-prior→ M τ x k 1/2<τ≤1 ⟨p,⟩)
---- ############ Theorem 3 END ############
------------------------------ Starting point - Theorem 3 ------------------------------
---- ############ FINAL RESULT - Theorem 4 ############
-- The final theorem is more a corolary. It follows from Theorem 1 and 2
prop3M← : ∀ (M z τ x)
→ safety-envelope M z τ x ≡ true
→ (Any (λ{⟨ θ , ⟨ nd , p ⟩ ⟩ → x ∈ pi nd z}) (Model.fM M))
× ∃[ k ] (∃[ p ] (((P[ k |X= x ] (M→pbs M)) ≡ just p) × (τ ≤ p)))
prop3M← M z τ x seM≡true = let
-- Taking from the safety-envelope definition its components
⟨ left , τ-conf ⟩ =
lem∧ {a = proj₂ (z-predictable M z x)}
{b = τ-confident M τ x}
seM≡true
z-pred-x≡⟨x,true⟩ = cong (⟨ x ,_⟩) left
in ⟨ theorem1← M z x z-pred-x≡⟨x,true⟩ , theorem2← M τ x τ-conf ⟩
prop3M→ : ∀ (M z τ x k)
→ (1/2 < τ × τ ≤ 1ℝ)
→ k ≡ Stall ⊎ k ≡ NoStall
→ (Any (λ{⟨ θ , ⟨ nd , p ⟩ ⟩ → x ∈ pi nd z}) (Model.fM M))
× ∃[ p ] (((P[ k |X= x ] (M→pbs M)) ≡ just p) × (τ ≤ p))
→ safety-envelope M z τ x ≡ true
prop3M→ M z τ x k 1/2<τ≤1 k≢Uncertain ⟨ Any[θ→x∈pi-nd-z]M , ⟨p,⟩ ⟩ = let
z-pred≡⟨x,true⟩ = theorem1→ M z x Any[θ→x∈pi-nd-z]M
τ-conf = theorem2→ M τ x k 1/2<τ≤1 k≢Uncertain ⟨p,⟩
in cong₂ (_∧_) (cong proj₂ z-pred≡⟨x,true⟩) τ-conf
---- ############ Theorem 4 END ############
|
programs/oeis/111/A111199.asm | neoneye/loda | 22 | 81886 | ; A111199: Numbers n such that 4k + 9 is prime.
; 1,2,5,7,8,11,13,16,20,22,23,25,26,32,35,37,41,43,46,47,55,56,58,62,65,67,68,71,76,77,82,85,86,91,95,97,98,100,103,106,110,112,113,125,128,133,137,140,142,146,148,151,152,158,161,163,166,167,173,175,181,187,188,190,191,197,200,203,205,211,212,217,218,230,232,233,236,242,247,250,251,253,256,260,263,265,271,272,275,277,280,286,293,296,298,301,302,305,307,310
mov $1,1
add $1,$0
seq $1,5098 ; Numbers n such that 4n + 1 is prime.
sub $1,2
mov $0,$1
|
other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver0/sfc/ys_w64.asm | prismotizm/gigaleak | 0 | 246183 | Name: ys_w64.asm
Type: file
Size: 22163
Last-Modified: '2016-05-13T04:50:38Z'
SHA-1: 5A3A00130CC3446808BF436D1E56424BC1E91049
Description: null
|
Task/Sorting-algorithms-Gnome-sort/Ada/sorting-algorithms-gnome-sort-3.ada | mullikine/RosettaCodeData | 1 | 26652 | with Gnome_Sort;
with Ada.Text_Io; use Ada.Text_Io;
procedure Gnome_Sort_Test is
type Index is range 0..9;
type Buf is array(Index) of Integer;
procedure Sort is new Gnome_Sort(Integer, Index, Buf);
A : Buf := (900, 700, 800, 600, 400, 500, 200, 100, 300, 0);
begin
for I in A'range loop
Put(Integer'Image(A(I)));
end loop;
New_Line;
Sort(A);
for I in A'range loop
Put(Integer'Image(A(I)));
end loop;
New_Line;
end Gnome_Sort_Test;
|
antlr-editing-plugins/antlr-in-memory-build/src/test/resources/org/nemesis/antlr/memory/tool/Epsilon.g4 | timboudreau/ANTLR4-Plugins-for-NetBeans | 1 | 756 | grammar Epsilon;
// TODO: Add your lexer and parser rules here
// Example rules
compilation_unit
: array
| number
| mods
| hexenites
;
array
: OpenBrace number (Comma number)+ CloseBrace;
number
: Integer;
mods : mod+;
mod : (ModA | ModB | ModC)*;
hexenites : hexen+;
hexen : Hex*;
Integer
: MINUS? DIGITS;
LineComment
: OPEN_LINE_COMMENT.*? S_LINE_END -> channel(1);
Comment
: OPEN_COMMENT.*? CLOSE_COMMENT -> channel(1);
Whitespace
: (' ' | '\t' | '\n' | '\r')+ -> channel(2);
Comma
: ',';
OpenBrace
: '[';
CloseBrace
: ']';
ModA : '`';
ModB : '^';
ModC : '!';
HexNum : (HEX | DIGIT)+;
fragment HEX : 'a' | 'b' | 'c' | 'd' | 'e' | 'f';
fragment OPEN_LINE_COMMENT
: '//';
fragment OPEN_COMMENT
: '/*';
fragment CLOSE_COMMENT
: '*/';
fragment S_LINE_END
: '\r'? '\n';
fragment DIGITS
: DIGIT+;
fragment DIGIT
: [0-9];
fragment MINUS
: '-';
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_662.asm | ljhsiun2/medusa | 9 | 16672 | <reponame>ljhsiun2/medusa<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0xc31a, %r10
xor $41423, %rax
mov (%r10), %r9d
nop
nop
nop
nop
xor $51077, %r10
lea addresses_D_ht+0x117c6, %r9
clflush (%r9)
nop
nop
cmp $27478, %r13
movb $0x61, (%r9)
nop
sub $45958, %r10
lea addresses_WC_ht+0x4a40, %rsi
lea addresses_A_ht+0xf9a, %rdi
clflush (%rdi)
nop
cmp %r9, %r9
mov $88, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp %rsi, %rsi
lea addresses_UC_ht+0x182e2, %rcx
nop
nop
nop
add $40530, %rsi
movb (%rcx), %r14b
nop
inc %r14
lea addresses_WC_ht+0x16a1e, %rax
sub %rsi, %rsi
mov (%rax), %di
nop
nop
xor $29934, %r14
lea addresses_D_ht+0x107c0, %rdi
nop
nop
nop
nop
and $20815, %r10
movups (%rdi), %xmm4
vpextrq $1, %xmm4, %r14
nop
nop
cmp $43293, %rcx
lea addresses_UC_ht+0x212a, %r10
nop
lfence
movb $0x61, (%r10)
sub %r14, %r14
lea addresses_normal_ht+0x55a, %r9
nop
nop
nop
and %rsi, %rsi
movl $0x61626364, (%r9)
nop
nop
add $20465, %rdi
lea addresses_A_ht+0x1821a, %rsi
lea addresses_normal_ht+0xc01a, %rdi
nop
nop
nop
nop
add %r14, %r14
mov $82, %rcx
rep movsb
add %rax, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r9
push %rax
push %rbp
push %rbx
push %rdx
push %rsi
// Load
lea addresses_A+0x619a, %rax
nop
nop
nop
cmp $684, %rbp
mov (%rax), %esi
nop
nop
nop
nop
nop
dec %rax
// Store
lea addresses_UC+0x1ecda, %rdx
nop
nop
nop
nop
nop
sub $12219, %r9
movl $0x51525354, (%rdx)
nop
nop
cmp %rbp, %rbp
// Store
lea addresses_normal+0xc296, %rbp
nop
nop
nop
nop
xor $15208, %rbx
mov $0x5152535455565758, %r14
movq %r14, (%rbp)
nop
nop
nop
cmp %rbx, %rbx
// Store
lea addresses_RW+0x846a, %rbx
nop
nop
nop
cmp %rdx, %rdx
mov $0x5152535455565758, %r9
movq %r9, %xmm4
movups %xmm4, (%rbx)
nop
nop
add $578, %rdx
// Faulty Load
lea addresses_WT+0x181a, %r9
nop
nop
nop
cmp %rsi, %rsi
vmovups (%r9), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rbp
lea oracles, %rdx
and $0xff, %rbp
shlq $12, %rbp
mov (%rdx,%rbp,1), %rbp
pop %rsi
pop %rdx
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal', 'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}}
{'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/001/A001947.asm | neoneye/loda | 22 | 245825 | ; A001947: a(n) = Lucas(5*n+2).
; 3,29,322,3571,39603,439204,4870847,54018521,599074578,6643838879,73681302247,817138163596,9062201101803,100501350283429,1114577054219522,12360848946698171,137083915467899403,1520283919093591604,16860207025497407047,186982561199565069121,2073668380220713167378,22997334743627409910279,255044350560122222180447,2828485190904971853895196,31368381450514812615027603,347880681146567910619198829,3858055874062761829426214722,42786495295836948034307560771,474509504128269190206809383203,5262391040706798040309210776004,58360810951903047633608127919247,647231311511640322009998617887721,7177905237579946589743592924684178,79604188924891052809189520789413679,882823983411381527490828321608234647
mul $0,5
seq $0,14739 ; Expansion of (1+x^2)/(1-2*x+x^3).
add $0,2
|
firmware/rom.asm | mnaberez/f2mc8dump | 5 | 176480 | <gh_stars>1-10
;F2MC-8L Dumper
;
;This program dumps every byte of the memory space (0x0000-0xFFFF) out on
;P30-P37, strobing P40 low after each byte. It has been used to dump the
;internal ROM on the MB89623R, MB89625R, and MB89677AR. P30-P37 are normal
;outputs. P40 is open drain on the MB8962x and needs a 47K pull-up to Vcc.
;P40 is a normal output on MB89677AR. Dumping wraps around memory and
;continues forever. The string "RAMSTART" is written at the start of RAM
;(0x0080) to make it easy to separate the dumps.
;
;Load this program into an external ROM (MOD0=Vcc, MOD1=Vss) at 0xE000. On
;reset, it will write the dumping code to RAM and then jump it. While it is
;running, change MOD0 to Vss. This selects the internal ROM mode. The
;internal ROM will replace the external ROM in the memory map. The dumping
;code running from RAM will dump the internal ROM.
;
sycc = 0x0007 ;System Clock Control Register (MB8967x only)
pdr3 = 0x000c ;Port 3 Data Register
ddr3 = 0x000d ;Port 3 Data Direction Register
pdr4 = 0x000e ;Port 4 Data Register
ddr4 = 0x000f ;Port 4 Data Direction Register (MB8967x only)
ram = 0x0080 ;Start address of RAM
.define mb8967x ;Comment this line out if MCU is not MB8967x
.F2MC8L
.area CODE1 (ABS)
.org 0xe000
reset:
;Initialize hardware registers
.ifdef mb8967x
mov sycc, #0x17 ;Set clock frequency to fastest
mov ddr4, #0x01 ;Set P40 as output
.endif
mov ddr3, #0xff ;Set P30-P37 as outputs
;Write "RAMSTART" string at the start of RAM to make it easy to identify
mov ram+0x00, #'R
mov ram+0x01, #'A
mov ram+0x02, #'M
mov ram+0x03, #'S
mov ram+0x04, #'T
mov ram+0x05, #'A
mov ram+0x06, #'R
mov ram+0x07, #'T
;Write code into RAM to dump all memory out P30-P37 with /STROBE on P40
mov ram+0x08, #0x06 ;06 00 mov a, @ix+0 ;A = byte at address IX
mov ram+0x09, #0x00
mov ram+0x0a, #0x45 ;45 0c mov pdr3, a ;Put byte on P30-P37
mov ram+0x0b, #<pdr3
mov ram+0x0c, #0x85 ;85 0e 00 mov pdr4, #0 ;P40 = Low (/STROBE)
mov ram+0x0d, #<pdr4
mov ram+0x0e, #0x00
mov ram+0x0f, #0x85 ;85 0e 01 mov pdr4, #1 ;P40 = High (/STROBE)
mov ram+0x10, #<pdr4
mov ram+0x11, #0x01
mov ram+0x12, #0xc2 ;c2 incw ix
mov ram+0x13, #0x21 ;21 00 88 jmp ram+0x08
mov ram+0x14, #>(ram+0x08)
mov ram+0x15, #<(ram+0x08)
;Start dumping
movw ix, #0 ;IX = 0 (start address for dumping)
jmp ram+0x08 ;Jump to dumping code in RAM
.ascii "EXTERNALROM" ;String to make the external ROM easy to identify
.org 0xfffd
.byte 0x01 ;Mode byte
.word reset ;Reset vector
|
kbd.asm | ChartreuseK/z80monitor | 5 | 2434 | <reponame>ChartreuseK/z80monitor<filename>kbd.asm
#data _RAM
LAST_SCAN: DS 1 ; Last pressed key
#code _ROM
;---------------------------------------
; Get Scancode
KBD_GETSCAN:
#local
LD B, 0x01 ; Start at row 0
LD A, 0 ; Row offset in decode table
LOOP:
LD C, PORT_KBD
IN C, (C) ; Read from port BC, B used for scanning key rows
JR NZ, FND ; Found a keypress
ADD A, 8 ; Next row
SLA B ; Shift to next row
JR NC, LOOP ; Loop till we find a keycode or run out of rows
LD A, 0 ; No key pressed
RET
FND:
LD B, A ; Save our row offset into B
LD A, 0
FND_LOOP:
RR C ; Rotate C until we find the bit# of the match
JR C, BIT
INC A ; Next bit
JR FND_LOOP ; Fine to loop since we know a bit is set
BIT:
OR A, B ; Or with the row offset - 00 rrr bbb
PUSH AF ; Save A
; Scan in modifiers
;Left Shift J0 - Ctrl J1 - Right Shift J5
; J is connected to IP2 on the 68681
; TODO: Optimize, this is way too big...
XOR A ; Modifiers
LD B, 0x20 ; Scan Shift L
CALL SCANMOD
JR Z, NOSHIFTR
OR $40 ; Shift mask
NOSHIFTR:
LD B, 0x02 ; Scan Shift R
CALL SCANMOD
JR Z, NOSHIFT
OR $40
NOSHIFT:
LD B, 0x01 ; Scan ctrl
CALL SCANMOD
JR Z, NOCTRL
OR $80
NOCTRL:
LD B, A
POP AF
OR B
RET
; Scans modifier key
; (68681 seems quite slow/inconsitant at detecting changes, our workaround
; for now is to spam the scan a ton of times. Seems to work consistently.
; We use IN opcodes from the 68681 since they're slightly longer than memory
; reads due to the WAIT state circuitry for /DTACK)
; Ideally we should add another buffer to read the state without the 68681
; or see if we can get the plain unbuffered input port on the 68681 to work
;
; UGLY UGLY HACK, Figure out a hardware fix....
;
; Sets Z corresponding to the scanned bit
; Row/Rows to scan in B
SCANMOD:
#local
PUSH DE
PUSH BC
LD E, A
LD BC, 0x0000 | SER_IPCR
IN C, (C) ; Reset IPCR to start
POP BC
LD C, SER_SRA ; Use SRA so we don't affect the ports
XOR A ; Loop 256 times
SCANLOOP:
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
IN D, (C) ; Scan the row
SUB 1
JR NZ, SCANLOOP
LD BC, 0x0000 | SER_IPCR ; Scan in change register
IN C, (C) ; Re-read IPCR
BIT 6, C ; Check IP2 change
LD A, E
POP DE
RET
#endlocal
#endlocal
;---------------------------------------
; Convert scancode to ASCII(ish)
SCAN2KEY:
#local
;PUSH AF ; Save A
BIT 6, A ; Test Shift
JR Z, NOSHIFT
LD HL, KBD_DECODE_SHIFT ; Shifted keys don't quite correspond
JR DECODE ; to ASCII shifts so can't just mask $20
NOSHIFT:
LD HL, KBD_DECODE
DECODE:
AND 0x3F ; Mask off ctrl and shift bits
LD C, A ; Scancode as the offset
LD B, 0
ADD HL, BC ; Offset into table
LD A, (HL)
RET
POP AF ; Restore A
LD B, A ; Save scancode (so we can test ctrl)
LD A, (HL) ; Read in the value from table
BIT 7, B ; Ctrl bit
JR Z, NOCTRL
AND $9F ; Mask $40 and $20, convert to CTRL keys
NOCTRL:
RET
#endlocal
;---------------------------------------
; Waits for a key to be pressed, and returns the ASCII value
KBD_GETKEY:
#local
PUSH BC
PUSH HL
LOOP:
CALL KBD_GETSCAN
LD BC, 20 ; Give some delay for debounce
CALL DELAY
LD B, A ; Save original scancode
AND $9F ; Mask off Control and shift
LD HL, LAST_SCAN
CP (HL) ; Compare with last scancode
JR Z, LOOP ; If same as last key ignore
LD (HL), A ; Save as new last key (even if blank)
AND A ; Retest scancode
JR Z, LOOP ; Wait for a keypress
LD A, B ; Restore original code
CALL SCAN2KEY ; Convert scancode to ASCII
POP HL
POP BC
RET
#endlocal
;---------------------------------------
; Check if a key is being pressed, return ASCII value, or 0 if none pressed
KBD_GETKEYNB:
#local
PUSH BC
PUSH HL
LOOP:
CALL KBD_GETSCAN
LD BC, 4 ; Give some delay for debounce
CALL DELAY
LD HL, LAST_SCAN
CP (HL) ; Compare with last scancode
JR Z, END2 ; If same as last key ignore
LD (HL), A ; Save as new last key (even if blank)
AND A ; Retest scancode
JR Z, END2 ; No key being pressed
CALL SCAN2KEY ; Convert scancode to ASCII
POP HL
POP BC
RET
END2: ; Exit, no key pressed
XOR A
POP HL
POP BC
RET
#endlocal
;===============================================================================
; Static Data
; Keyboard decoding matrix. For keyboard taken from Motorola Pager Terminal
; See KBDMAP.TXT for more information on keyboard decoding, and special
; keys (Values >= $80)
KBD_DECODE:
DB $80, $81, $82, $83, $84, $08, $0A, $20 ; Row 0 (00000001)
DB $85, $86, 's', 'x', $87, $88, '2', 'w' ; Row 1 (00000010)
DB 'n', 'm', 'j', 'h', 'u', '6', '7', 'y' ; Row 2 (00000100)
DB ',', '.', 'k', 'l', 'i', '9', '8', 'o' ; Row 3 (00001000)
DB $89, $8A, 'd', 'c', $8B, $8C, '3', 'e' ; Row 4 (00010000)
DB '/', ';', $27, '[', '=', '0', 'p', '-' ; Row 5 (00100000)
DB $8D, 'z', $8E, 'a', 'q', $1B, '1', $09 ; Row 6 (01000000)
DB 'b', 'v', 'g', 'f', 't', '5', '4', 'r' ; Row 7 (10000000)
; Shifted keys, not quite a standard keyboard layout
KBD_DECODE_SHIFT:
DB $80, $81, $82, $83, $84, $08, $0A, $20 ; Row 0
DB $85, $86, 'S', 'X', $87, $88, '@', 'W' ; Row 1
DB 'N', 'M', 'J', 'H', 'U', '\', '&', 'Y' ; Row 2
DB ',', '.', 'K', 'L', 'I', '(', '*', 'O' ; Row 3
DB $89, $8A, 'D', 'C', $8B, $8C, '#', 'E' ; Row 4
DB '?', ':', '"', ']', '+', ')', 'P', '_' ; Row 5
DB $8D, 'Z', $8E, 'A', 'Q', $1B, '!', $09 ; Row 6
DB 'B', 'V', 'G', 'F', 'T', '%', '$', 'R' ; Row 7
|
oeis/176/A176044.asm | neoneye/loda-programs | 11 | 169293 | ; A176044: n-th-prime without last digit.
; Submitted by <NAME>(s4)
; 0,0,0,0,1,1,1,1,2,2,3,3,4,4,4,5,5,6,6,7,7,7,8,8,9,10,10,10,10,11,12,13,13,13,14,15,15,16,16,17,17,18,19,19,19,19,21,22,22,22,23,23,24,25,25,26,26,27,27,28,28,29,30,31,31,31,33,33,34,34,35,35,36,37,37,38,38,39,40,40,41,42,43,43,43,44,44,45,46,46,46,47,48,49,49,50,50,52,52,54
seq $0,6005 ; The odd prime numbers together with 1.
div $0,10
|
oeis/022/A022365.asm | neoneye/loda-programs | 11 | 244499 | ; A022365: Fibonacci sequence beginning 0, 31.
; Submitted by <NAME>
; 0,31,31,62,93,155,248,403,651,1054,1705,2759,4464,7223,11687,18910,30597,49507,80104,129611,209715,339326,549041,888367,1437408,2325775,3763183,6088958,9852141,15941099,25793240,41734339,67527579,109261918,176789497,286051415,462840912,748892327,1211733239,1960625566,3172358805,5132984371,8305343176,13438327547,21743670723,35181998270,56925668993,92107667263,149033336256,241141003519,390174339775,631315343294,1021489683069,1652805026363,2674294709432,4327099735795,7001394445227,11328494181022
mov $3,1
lpb $0
sub $0,1
mov $2,$3
add $3,$1
mov $1,$2
lpe
mov $0,$1
mul $0,31
|
oeis/342/A342850.asm | neoneye/loda-programs | 11 | 174441 | ; A342850: Number of sets in the geometry determined by the Hausdorff metric at each location between two sets defined by a complete bipartite graph K(3,n) (with n at least 4) missing three edges, where all three removed edges are incident to different vertices in the 3-point set and none of the removed edges are incident to the same vertex in the other set.
; Submitted by <NAME>
; 162,1242,9018,64098,451602,3169962,22215978,155590578,1089370242,7626300282,53386227738,373709971458,2615988932082,18311979920202,128184031628298,897288737958738,6281022715393122,43967163656797722,307770159544721658
add $0,1
mov $1,7
pow $1,$0
mul $1,3
mov $2,3
pow $2,$0
sub $1,$2
mov $0,$1
div $0,6
mul $0,54
|
home/reset_player_sprite.asm | opiter09/ASM-Machina | 1 | 29484 | <gh_stars>1-10
ResetPlayerSpriteData::
ld hl, wSpriteStateData1
call ResetPlayerSpriteData_ClearSpriteData
ld hl, wSpriteStateData2
call ResetPlayerSpriteData_ClearSpriteData
ld a, $1
ld [wSpritePlayerStateData1PictureID], a
ld [wSpritePlayerStateData2ImageBaseOffset], a
ld hl, wSpritePlayerStateData1YPixels
ld [hl], $3c ; set Y screen pos
inc hl
inc hl
ld [hl], $40 ; set X screen pos
ret
; overwrites sprite data with zeroes
ResetPlayerSpriteData_ClearSpriteData::
ld bc, $10
xor a
jp FillMemory
|
audio/sfx/battle_33.asm | adhi-thirumala/EvoYellow | 16 | 83512 | SFX_Battle_33_Ch1:
duty 2
unknownsfx0x20 6, 241, 0, 5
unknownsfx0x20 6, 241, 128, 5
unknownsfx0x20 6, 241, 0, 6
unknownsfx0x20 6, 241, 128, 6
unknownsfx0x20 8, 241, 0, 7
endchannel
SFX_Battle_33_Ch2:
duty 3
unknownsfx0x20 6, 225, 16, 5
unknownsfx0x20 6, 225, 144, 5
unknownsfx0x20 6, 225, 16, 6
unknownsfx0x20 6, 225, 144, 6
unknownsfx0x20 8, 225, 16, 7
endchannel
|
software/driver/ublox8.ads | TUM-EI-RCS/StratoX | 12 | 119 | -- Institution: Technische Universität München
-- Department: Realtime Computer Systems (RCS)
-- Project: StratoX
--
-- Authors: <NAME> (<EMAIL>)
--
-- Description: Driver for the GPS Module Ublox LEA-6H
--
-- ToDo:
-- [ ] Implementation
package ublox8 with SPARK_Mode is
end ublox8;
|
lib/cubical/elims/SuspSmash.agda | danbornside/HoTT-Agda | 0 | 3266 | {-# OPTIONS --without-K #-}
open import HoTT
open import lib.cubical.elims.CubeMove
open import lib.cubical.elims.CofWedge
module lib.cubical.elims.SuspSmash where
module _ {i j k} {X : Ptd i} {Y : Ptd j} {C : Type k}
(f : Suspension (X ∧ Y) → C) (g : Suspension (X ∧ Y) → C)
(north* : f (north _) == g (north _))
(south* : f (south _) == g (south _))
(cod* : (s : fst X × fst Y) → Square north* (ap f (merid _ (cfcod _ s)))
(ap g (merid _ (cfcod _ s))) south*)
where
private
base* = transport
(λ κ → Square north* (ap f (merid _ κ)) (ap g (merid _ κ)) south*)
(! (cfglue _ (winl (snd X))))
(cod* (snd X , snd Y))
CubeType : (w : X ∨ Y)
→ Square north* (ap f (merid _ (cfcod _ (∨-in-× X Y w))))
(ap g (merid _ (cfcod _ (∨-in-× X Y w)))) south*
→ Type _
CubeType w sq =
Cube base* sq
(natural-square (λ _ → north*) (cfglue _ w))
(natural-square (ap f ∘ merid _) (cfglue _ w))
(natural-square (ap g ∘ merid _) (cfglue _ w))
(natural-square (λ _ → south*) (cfglue _ w))
fill : (w : X ∨ Y)
(sq : Square north* (ap f (merid _ (cfcod _ (∨-in-× X Y w))))
(ap g (merid _ (cfcod _ (∨-in-× X Y w)))) south*)
→ Σ (Square north* idp idp north*) (λ p → CubeType w (p ⊡h sq))
fill w sq =
(fst fill' ,
cube-right-from-front (fst fill') sq (snd fill'))
where
fill' = fill-cube-right _ _ _ _ _
fill0 = fill (winl (snd X)) (cod* (snd X , snd Y))
fillX = λ x → fill (winl x) (fst fill0 ⊡h cod* (x , snd Y))
fillY = λ y → fill (winr y) (fst fill0 ⊡h cod* (snd X , y))
fillX0 : fst (fillX (snd X)) == hid-square
fillX0 = ⊡h-unit-l-unique _ (fst fill0 ⊡h cod* (snd X , snd Y))
(fill-cube-right-unique (snd (fillX (snd X)))
∙ ! (fill-cube-right-unique (snd fill0)))
fillY0 : fst (fillY (snd Y)) == hid-square
fillY0 = ⊡h-unit-l-unique _ (fst fill0 ⊡h cod* (snd X , snd Y))
(fill-cube-right-unique (snd (fillY (snd Y)))
∙ ! (fill-cube-right-unique
(snd (fill (winr (snd Y)) (cod* (snd X , snd Y)))))
∙ ! (ap (λ w → fst (fill w (cod* (∨-in-× X Y w)))
⊡h cod* (snd X , snd Y))
wglue))
where
fill-square : (w : X ∨ Y)
→ Square north* (ap f (merid _ (cfcod _ (∨-in-× X Y w))))
(ap g (merid _ (cfcod _ (∨-in-× X Y w)))) south*
fill-square w =
fst (fill-cube-right base*
(natural-square (λ _ → north*) (cfglue _ w))
(natural-square (ap f ∘ merid _) (cfglue _ w))
(natural-square (ap g ∘ merid _) (cfglue _ w))
(natural-square (λ _ → south*) (cfglue _ w)))
abstract
coh : (s : X ∧ Y)
→ north* == south* [ (λ z → f z == g z) ↓ merid _ s ]
coh = ↓-='-from-square ∘ cof-wedge-square-elim _ _ _ _
base*
(λ {(x , y) →
fst (fillX x) ⊡h fst (fillY y) ⊡h fst fill0 ⊡h cod* (x , y)})
(λ x → transport (λ sq → CubeType (winl x) (fst (fillX x) ⊡h sq))
(! (ap (λ sq' → sq' ⊡h fst fill0 ⊡h cod* (x , snd Y)) fillY0
∙ ⊡h-unit-l (fst fill0 ⊡h cod* (x , snd Y))))
(snd (fillX x)))
(λ y → transport (CubeType (winr y))
(! (ap (λ sq' → sq' ⊡h fst (fillY y) ⊡h fst fill0 ⊡h cod* (snd X , y))
fillX0
∙ ⊡h-unit-l (fst (fillY y) ⊡h fst fill0 ⊡h cod* (snd X , y))))
(snd (fillY y)))
susp-smash-path-elim : ((σ : Suspension (X ∧ Y)) → f σ == g σ)
susp-smash-path-elim = Suspension-elim _ north* south* coh
|
src/Bisimilarity/Weak/CCS.agda | nad/up-to | 0 | 3859 | <gh_stars>0
------------------------------------------------------------------------
-- Lemmas related to weak bisimilarity and CCS
------------------------------------------------------------------------
{-# OPTIONS --sized-types #-}
open import Prelude hiding (step-→)
module Bisimilarity.Weak.CCS {ℓ} {Name : Type ℓ} where
open import Equality.Propositional
open import Prelude.Size
open import Function-universe equality-with-J hiding (id; _∘_)
import Bisimilarity.CCS as SE
import Bisimilarity.Equational-reasoning-instances
import Bisimilarity.Weak.Equational-reasoning-instances
open import Equational-reasoning
import Expansion.CCS as E
import Expansion.Equational-reasoning-instances
open import Labelled-transition-system.CCS Name
import Bisimilarity CCS as S
open import Bisimilarity.Weak CCS
open import Expansion CCS using (_≳_; ≳:_)
import Labelled-transition-system.Equational-reasoning-instances CCS
as Dummy
-- An instantiation of a module with helper lemmas.
private
module CL {i} =
E.Cong-lemmas
[ i ]_≈′_ right-to-left (⇒̂→[]⇒ (λ ())) ⇒→⇒̂
map-⇒̂ map-⇒̂′ zip-⇒̂
(λ hyp {P Q} → λ where
(silent s done) →
_
, (! P →⟨ silent s done ⟩■)
, (! P ∼⟨ symmetric SE.6-1-2 ⟩
! P ∣ P ∼≡⟨ refl ⟩■
! P ∣ Q)
(silent s (step {q = R} s′ P⟶R R⇒Q)) →
_
, (! P →⟨ ⟶→⇒ s′ (replication (par-right P⟶R)) ⟩
! P ∣ R →⟨ silent s (map-⇒ par-right R⇒Q) ⟩■)
, (! P ∣ Q ■)
(non-silent ¬s P⇒Q) →
_
, (! P →⟨ non-silent ¬s (hyp P⇒Q) ⟩■)
, (! P ∣ Q ■))
mutual
-- _∣_ preserves weak bisimilarity.
infix 6 _∣-cong_ _∣-cong′_
_∣-cong_ : ∀ {i P P′ Q Q′} →
[ i ] P ≈ P′ → [ i ] Q ≈ Q′ → [ i ] P ∣ Q ≈ P′ ∣ Q′
P≈P′ ∣-cong Q≈Q′ =
⟨ Σ-map id (Σ-map id symmetric) ∘
rl (symmetric P≈P′) (symmetric Q≈Q′)
, rl P≈P′ Q≈Q′
⟩
where
rl = CL.∣-cong _∣-cong′_
_∣-cong′_ : ∀ {i P P′ Q Q′} →
[ i ] P ≈′ P′ → [ i ] Q ≈′ Q′ → [ i ] P ∣ Q ≈′ P′ ∣ Q′
force (P≈P′ ∣-cong′ Q≈Q′) = force P≈P′ ∣-cong force Q≈Q′
-- _·_ preserves weak bisimilarity.
infix 12 _·-cong_ _·-cong′_
_·-cong_ :
∀ {i μ μ′ P P′} →
μ ≡ μ′ → [ i ] force P ≈′ force P′ → [ i ] μ · P ≈ μ′ · P′
_·-cong_ {i} refl P≈P′ =
⟨ Σ-map id (Σ-map id symmetric) ∘ rl (symmetric P≈P′)
, rl P≈P′
⟩
where
rl = CL.·-cong {i = i}
_·-cong′_ :
∀ {i μ μ′ P P′} →
μ ≡ μ′ → [ i ] force P ≈′ force P′ → [ i ] μ · P ≈′ μ′ · P′
force (μ≡μ′ ·-cong′ P≈P′) = μ≡μ′ ·-cong P≈P′
-- _∙_ preserves weak bisimilarity.
infix 12 _∙-cong_ _∙-cong′_
_∙-cong_ : ∀ {i μ μ′ P P′} →
μ ≡ μ′ → [ i ] P ≈ P′ → [ i ] μ ∙ P ≈ μ′ ∙ P′
refl ∙-cong P≈P′ = refl ·-cong convert {a = ℓ} P≈P′
_∙-cong′_ : ∀ {i μ μ′ P P′} →
μ ≡ μ′ → [ i ] P ≈′ P′ → [ i ] μ ∙ P ≈′ μ′ ∙ P′
force (μ≡μ′ ∙-cong′ P≈P′) = μ≡μ′ ∙-cong force P≈P′
-- _∙ turns equal actions into weakly bisimilar processes.
infix 12 _∙-cong _∙-cong′
_∙-cong : ∀ {μ μ′} → μ ≡ μ′ → μ ∙ ≈ μ′ ∙
refl ∙-cong = reflexive
_∙-cong′ : ∀ {μ μ′} → μ ≡ μ′ → μ ∙ ≈′ μ′ ∙
refl ∙-cong′ = reflexive
mutual
-- ⟨ν_⟩ preserves weak bisimilarity.
⟨ν_⟩-cong : ∀ {i a a′ P P′} →
a ≡ a′ → [ i ] P ≈ P′ → [ i ] ⟨ν a ⟩ P ≈ ⟨ν a′ ⟩ P′
⟨ν_⟩-cong {i} {a} {P = P} {P′} refl P≈P′ =
⟨ Σ-map id (Σ-map id symmetric) ∘
CL.⟨ν⟩-cong ⟨ν refl ⟩-cong′ (symmetric P≈P′)
, CL.⟨ν⟩-cong ⟨ν refl ⟩-cong′ P≈P′
⟩
⟨ν_⟩-cong′ : ∀ {i a a′ P P′} →
a ≡ a′ → [ i ] P ≈′ P′ → [ i ] ⟨ν a ⟩ P ≈′ ⟨ν a′ ⟩ P′
force (⟨ν a≡a′ ⟩-cong′ P≈P′) = ⟨ν a≡a′ ⟩-cong (force P≈P′)
mutual
-- !_ preserves weak bisimilarity.
infix 10 !-cong_ !-cong′_
!-cong_ : ∀ {i P P′} →
[ i ] P ≈ P′ → [ i ] ! P ≈ ! P′
!-cong_ {i} {P} {P′} P≈P′ =
⟨ Σ-map id (Σ-map id symmetric) ∘
CL.!-cong _∣-cong′_ !-cong′_ (symmetric P≈P′)
, CL.!-cong _∣-cong′_ !-cong′_ P≈P′
⟩
!-cong′_ : ∀ {i P P′} → [ i ] P ≈′ P′ → [ i ] ! P ≈′ ! P′
force (!-cong′ P≈P′) = !-cong (force P≈P′)
-- _⊕_ does not, in general, preserve weak bisimilarity in its first
-- argument (assuming that Name is inhabited).
¬⊕-congˡ : Name → ¬ (∀ {P P′ Q} → P ≈ P′ → P ⊕ Q ≈ P′ ⊕ Q)
¬⊕-congˡ x =
(∀ {P P′ Q} → P ≈ P′ → P ⊕ Q ≈ P′ ⊕ Q) ↝⟨ _∘ ≳⇒≈ ⟩
(∀ {P P′ Q} → P ≳ P′ → P ⊕ Q ≈ P′ ⊕ Q) ↝⟨ E.¬⊕-congˡ-≳≈ x ⟩□
⊥ □
-- _⊕_ does not, in general, preserve weak bisimilarity in its second
-- argument (assuming that Name is inhabited).
¬⊕-congʳ : Name → ¬ (∀ {P Q Q′} → Q ≈ Q′ → P ⊕ Q ≈ P ⊕ Q′)
¬⊕-congʳ x =
(∀ {P Q Q′} → Q ≈ Q′ → P ⊕ Q ≈ P ⊕ Q′) ↝⟨ _∘ ≳⇒≈ ⟩
(∀ {P Q Q′} → Q ≳ Q′ → P ⊕ Q ≈ P ⊕ Q′) ↝⟨ E.¬⊕-congʳ-≳≈ x ⟩□
⊥ □
-- Some congruence lemmas for combinations of _⊕_ and _·_.
⊕·-cong :
∀ {i P μ Q Q′} →
[ i ] force Q ≈′ force Q′ → [ i ] P ⊕ μ · Q ≈ P ⊕ μ · Q′
⊕·-cong {i} Q≈Q′ =
⟨ Σ-map id (Σ-map id symmetric) ∘ CL.⊕·-cong (symmetric Q≈Q′)
, CL.⊕·-cong {i = i} Q≈Q′
⟩
⊕·-cong′ :
∀ {i P μ Q Q′} →
[ i ] force Q ≈′ force Q′ → [ i ] P ⊕ μ · Q ≈′ P ⊕ μ · Q′
force (⊕·-cong′ Q≈Q′) = ⊕·-cong Q≈Q′
·⊕-cong : ∀ {i P P′ μ Q} →
[ i ] force P ≈′ force P′ → [ i ] μ · P ⊕ Q ≈ μ · P′ ⊕ Q
·⊕-cong {P = P} {P′} {μ} {Q} P≈P′ =
μ · P ⊕ Q ∼⟨ SE.⊕-comm ⟩
Q ⊕ μ · P ∼′⟨ ⊕·-cong P≈P′ ⟩ S.∼:
Q ⊕ μ · P′ ∼⟨ SE.⊕-comm ⟩■
μ · P′ ⊕ Q
·⊕-cong′ :
∀ {i P P′ μ Q} →
[ i ] force P ≈′ force P′ → [ i ] μ · P ⊕ Q ≈′ μ · P′ ⊕ Q
force (·⊕-cong′ P≈P′) = ·⊕-cong P≈P′
infix 8 _·⊕·-cong_ _·⊕·-cong′_
_·⊕·-cong_ :
∀ {i μ₁ μ₂ P₁ P₁′ P₂ P₂′} →
[ i ] force P₁ ≈′ force P₁′ → [ i ] force P₂ ≈′ force P₂′ →
[ i ] μ₁ · P₁ ⊕ μ₂ · P₂ ≈ μ₁ · P₁′ ⊕ μ₂ · P₂′
_·⊕·-cong_ {i} P₁≈P₁′ P₂≈P₂′ =
⟨ Σ-map id (Σ-map id symmetric) ∘
CL.·⊕·-cong (symmetric P₁≈P₁′) (symmetric P₂≈P₂′)
, CL.·⊕·-cong {i = i} P₁≈P₁′ P₂≈P₂′
⟩
_·⊕·-cong′_ :
∀ {i μ₁ μ₂ P₁ P₁′ P₂ P₂′} →
[ i ] force P₁ ≈′ force P₁′ → [ i ] force P₂ ≈′ force P₂′ →
[ i ] μ₁ · P₁ ⊕ μ₂ · P₂ ≈′ μ₁ · P₁′ ⊕ μ₂ · P₂′
force (P₁≈′P₁′ ·⊕·-cong′ P₂≈′P₂′) = P₁≈′P₁′ ·⊕·-cong P₂≈′P₂′
-- _[_] preserves weak bisimilarity for non-degenerate contexts. (This
-- result is similar to Theorem 6.5.25 in "Enhancements of the
-- bisimulation proof method" by Pous and Sangiorgi.)
--
-- TODO: This definition is very similar to E._[_]-cong. Find some way
-- to reduce the code duplication. (There was much less code
-- duplication before contexts were made coinductive.)
infix 5 _[_]-cong _[_]-cong′
_[_]-cong :
∀ {i n Ps Qs} {C : Context ∞ n} →
Non-degenerate ∞ C → (∀ x → [ i ] Ps x ≈ Qs x) →
[ i ] C [ Ps ] ≈ C [ Qs ]
hole [ Ps≈Qs ]-cong = Ps≈Qs _
∅ [ Ps≈Qs ]-cong = reflexive
D₁ ∣ D₂ [ Ps≈Qs ]-cong = (D₁ [ Ps≈Qs ]-cong) ∣-cong (D₂ [ Ps≈Qs ]-cong)
action D [ Ps≈Qs ]-cong = refl ·-cong λ { .force → force D [ Ps≈Qs ]-cong }
⟨ν⟩ D [ Ps≈Qs ]-cong = ⟨ν refl ⟩-cong (D [ Ps≈Qs ]-cong)
! D [ Ps≈Qs ]-cong = !-cong (D [ Ps≈Qs ]-cong)
D₁ ⊕ D₂ [ Ps≈Qs ]-cong = ⊕-cong Ps≈Qs D₁ D₂
where
_[_]-cong′ :
∀ {i n Ps Qs} {C : Context ∞ n} →
Non-degenerate′ ∞ C → (∀ x → [ i ] Ps x ≈ Qs x) →
[ i ] C [ Ps ] ≈′ C [ Qs ]
force (D [ Ps≈Qs ]-cong′) = force D [ Ps≈Qs ]-cong
⊕-cong :
∀ {i n Ps Qs} {C₁ C₂ : Context ∞ n} →
(∀ x → [ i ] Ps x ≈ Qs x) →
Non-degenerate-summand ∞ C₁ →
Non-degenerate-summand ∞ C₂ →
[ i ] (C₁ [ Ps ]) ⊕ (C₂ [ Ps ]) ≈ (C₁ [ Qs ]) ⊕ (C₂ [ Qs ])
⊕-cong {Ps = Ps} {Qs} Ps≈Qs = λ where
(process P₁) (process P₂) →
(context P₁ [ Ps ]) ⊕ (context P₂ [ Ps ]) ∼⟨ symmetric (SE.≡→∼ (context-[] P₁) SE.⊕-cong SE.≡→∼ (context-[] P₂)) ⟩
P₁ ⊕ P₂ ∼⟨ SE.≡→∼ (context-[] P₁) SE.⊕-cong SE.≡→∼ (context-[] P₂) ⟩■
(context P₁ [ Qs ]) ⊕ (context P₂ [ Qs ])
(process P₁) (action {μ = μ₂} {C = C₂} D₂) →
(context P₁ [ Ps ]) ⊕ μ₂ · (C₂ [ Ps ]′) ∼⟨ symmetric (SE.≡→∼ (context-[] P₁)) SE.⊕-cong (_ ■) ⟩
P₁ ⊕ μ₂ · (C₂ [ Ps ]′) ∼′⟨ ⊕·-cong (D₂ [ Ps≈Qs ]-cong′) ⟩ S.∼:
P₁ ⊕ μ₂ · (C₂ [ Qs ]′) ∼⟨ SE.≡→∼ (context-[] P₁) SE.⊕-cong (_ ■) ⟩■
(context P₁ [ Qs ]) ⊕ μ₂ · (C₂ [ Qs ]′)
(action {μ = μ₁} {C = C₁} D₁) (process P₂) →
μ₁ · (C₁ [ Ps ]′) ⊕ (context P₂ [ Ps ]) ∼⟨ (_ ■) SE.⊕-cong symmetric (SE.≡→∼ (context-[] P₂)) ⟩
μ₁ · (C₁ [ Ps ]′) ⊕ P₂ ∼′⟨ ·⊕-cong (D₁ [ Ps≈Qs ]-cong′) ⟩ S.∼:
μ₁ · (C₁ [ Qs ]′) ⊕ P₂ ∼⟨ (_ ■) SE.⊕-cong SE.≡→∼ (context-[] P₂) ⟩■
μ₁ · (C₁ [ Qs ]′) ⊕ (context P₂ [ Qs ])
(action {μ = μ₁} {C = C₁} D₁) (action {μ = μ₂} {C = C₂} D₂) →
μ₁ · (C₁ [ Ps ]′) ⊕ μ₂ · (C₂ [ Ps ]′) ∼⟨ (D₁ [ Ps≈Qs ]-cong′) ·⊕·-cong (D₂ [ Ps≈Qs ]-cong′) ⟩■
μ₁ · (C₁ [ Qs ]′) ⊕ μ₂ · (C₂ [ Qs ]′)
_[_]-cong′ :
∀ {i n Ps Qs} {C : Context ∞ n} →
Non-degenerate ∞ C → (∀ x → [ i ] Ps x ≈′ Qs x) →
[ i ] C [ Ps ] ≈′ C [ Qs ]
force (C [ Ps≈Qs ]-cong′) = C [ (λ x → force (Ps≈Qs x)) ]-cong
-- A variant of _[_]-cong for weakly guarded contexts.
--
-- Note that the input uses the primed variant of weak bisimilarity.
--
-- I got the idea for this lemma from Lemma 23 in Schäfer and Smolka's
-- "Tower Induction and Up-to Techniques for CCS with Fixed Points".
[]-cong-w :
∀ {i n Ps Qs} {C : Context ∞ n} →
Weakly-guarded C → Non-degenerate ∞ C → (∀ x → [ i ] Ps x ≈′ Qs x) →
[ i ] C [ Ps ] ≈ C [ Qs ]
[]-cong-w () hole
[]-cong-w _ ∅ Ps≈Qs = reflexive
[]-cong-w (W₁ ∣ W₂) (D₁ ∣ D₂) Ps≈Qs = []-cong-w W₁ D₁ Ps≈Qs ∣-cong
[]-cong-w W₂ D₂ Ps≈Qs
[]-cong-w action (action D) Ps≈Qs = refl ·-cong
(force D [ Ps≈Qs ]-cong′)
[]-cong-w (⟨ν⟩ W) (⟨ν⟩ D) Ps≈Qs = ⟨ν refl ⟩-cong
([]-cong-w W D Ps≈Qs)
[]-cong-w (! W) (! D) Ps≈Qs = !-cong []-cong-w W D Ps≈Qs
[]-cong-w {Ps = Ps} {Qs}
(W₁ ⊕ W₂) (D₁ ⊕ D₂) Ps≈Qs = case D₁ ,′ D₂ of λ where
(process P₁ , process P₂) →
(context P₁ [ Ps ]) ⊕ (context P₂ [ Ps ]) ∼⟨ symmetric (SE.≡→∼ (context-[] P₁) SE.⊕-cong SE.≡→∼ (context-[] P₂)) ⟩
P₁ ⊕ P₂ ∼⟨ SE.≡→∼ (context-[] P₁) SE.⊕-cong SE.≡→∼ (context-[] P₂) ⟩■
(context P₁ [ Qs ]) ⊕ (context P₂ [ Qs ])
(process P₁ , action {μ = μ₂} {C = C₂} D₂) →
(context P₁ [ Ps ]) ⊕ μ₂ · (C₂ [ Ps ]′) ∼⟨ symmetric (SE.≡→∼ (context-[] P₁)) SE.⊕-cong (_ ■) ⟩
P₁ ⊕ μ₂ · (C₂ [ Ps ]′) ∼′⟨ ⊕·-cong (force D₂ [ Ps≈Qs ]-cong′) ⟩ S.∼:
P₁ ⊕ μ₂ · (C₂ [ Qs ]′) ∼⟨ SE.≡→∼ (context-[] P₁) SE.⊕-cong (_ ■) ⟩■
(context P₁ [ Qs ]) ⊕ μ₂ · (C₂ [ Qs ]′)
(action {μ = μ₁} {C = C₁} D₁ , process P₂) →
μ₁ · (C₁ [ Ps ]′) ⊕ (context P₂ [ Ps ]) ∼⟨ (_ ■) SE.⊕-cong symmetric (SE.≡→∼ (context-[] P₂)) ⟩
μ₁ · (C₁ [ Ps ]′) ⊕ P₂ ∼′⟨ ·⊕-cong (force D₁ [ Ps≈Qs ]-cong′) ⟩ S.∼:
μ₁ · (C₁ [ Qs ]′) ⊕ P₂ ∼⟨ (_ ■) SE.⊕-cong SE.≡→∼ (context-[] P₂) ⟩■
μ₁ · (C₁ [ Qs ]′) ⊕ (context P₂ [ Qs ])
(action {μ = μ₁} {C = C₁} D₁ , action {μ = μ₂} {C = C₂} D₂) →
μ₁ · (C₁ [ Ps ]′) ⊕ μ₂ · (C₂ [ Ps ]′) ∼⟨ (force D₁ [ Ps≈Qs ]-cong′) ·⊕·-cong (force D₂ [ Ps≈Qs ]-cong′) ⟩■
μ₁ · (C₁ [ Qs ]′) ⊕ μ₂ · (C₂ [ Qs ]′)
-- A generalisation to systems of inequations of the following
-- property: If two processes satisfy the same equation X ≳ C [ X ],
-- for a weakly guarded, non-degenerate context C, then the two
-- processes are weakly bisimilar (assuming extensionality).
--
-- This result is a variant of Bisimilarity.CCS.unique-solutions.
-- Proposition 4.4.4 in Milner's "Operational and Algebraic Semantics
-- of Concurrent Processes" is perhaps more useful in practice, as
-- well as some of the results in Sangiorgi's "Equations,
-- Contractions, and Unique Solutions".
module _ (ext : Proc-extensionality) where
mutual
unique-solutions :
∀ {i n} {Ps Qs : Fin n → Proc ∞} {C : Fin n → Context ∞ n} →
(∀ x → Weakly-guarded (C x)) →
(∀ x → Non-degenerate ∞ (C x)) →
(∀ x → Ps x ≳ C x [ Ps ]) →
(∀ x → Qs x ≳ C x [ Qs ]) →
∀ x → [ i ] Ps x ≈ Qs x
unique-solutions {i} {Ps = Ps} {Qs} {C} w nd ≳C[Ps] ≳C[Qs] x =
Ps x ∼⟨ ≳C[Ps] x ⟩
C x [ Ps ] ∼′⟨ ≈: ⟨ lr ≳C[Ps] ≳C[Qs] , Σ-map id (Σ-map id symmetric) ∘ lr ≳C[Qs] ≳C[Ps] ⟩ ⟩ ≳:
C x [ Qs ] ∽⟨ ≳C[Qs] x ⟩■
Qs x
where
lr :
∀ {Ps Qs μ P} →
(∀ x → Ps x ≳ C x [ Ps ]) →
(∀ x → Qs x ≳ C x [ Qs ]) →
C x [ Ps ] [ μ ]⟶ P →
∃ λ Q → C x [ Qs ] [ μ ]⇒̂ Q × [ i ] P ≈′ Q
lr {Ps} {Qs} {μ} ≳C[Ps] ≳C[Qs] ⟶P =
case 6-2-15-nd ext (C x) (w x) (nd x) ⟶P of λ where
(C′ , nd′ , refl , trs) →
_
, (C x [ Qs ] →⟨ trs Qs ⟩■
C′ [ Qs ])
, (C′ [ Ps ] ∼⟨ nd′ [ unique-solutions′ w nd ≳C[Ps] ≳C[Qs] ]-cong′ ⟩■
C′ [ Qs ])
unique-solutions′ :
∀ {i n} {Ps Qs : Fin n → Proc ∞} {C : Fin n → Context ∞ n} →
(∀ x → Weakly-guarded (C x)) →
(∀ x → Non-degenerate ∞ (C x)) →
(∀ x → Ps x ≳ C x [ Ps ]) →
(∀ x → Qs x ≳ C x [ Qs ]) →
∀ x → [ i ] Ps x ≈′ Qs x
force (unique-solutions′ w nd ≳C[Ps] ≳C[Qs] x) =
unique-solutions w nd ≳C[Ps] ≳C[Qs] x
|
alloy4fun_models/trashltl/models/11/SdYAKhKCBTk57sJmD.als | Kaixi26/org.alloytools.alloy | 0 | 1653 | open main
pred idSdYAKhKCBTk57sJmD_prop12 {
all f:File | eventually f in Trash implies f in Trash
}
pred __repair { idSdYAKhKCBTk57sJmD_prop12 }
check __repair { idSdYAKhKCBTk57sJmD_prop12 <=> prop12o } |
oeis/192/A192747.asm | neoneye/loda-programs | 11 | 176491 | ; A192747: Coefficient of x in the reduction by x^2->x+1 of the polynomial p(n,x) defined below in Comments.
; Submitted by <NAME>(s1)
; 0,1,6,15,32,61,110,191,324,541,894,1467,2396,3901,6338,10283,16668,27001,43722,70779,114560,185401,300026,485495,785592,1271161,2056830,3328071,5384984,8713141,14098214,22811447,36909756,59721301,96631158
lpb $0
sub $0,1
add $1,$3
add $2,1
add $3,3
mov $4,$2
add $2,$1
mov $1,$4
lpe
mov $0,$2
|
mc-sema/validator/x86/tests/BSF32rm.asm | randolphwong/mcsema | 2 | 2710 | BITS 32
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=FLAG_CF|FLAG_OF|FLAG_SF|FLAG_AF|FLAG_PF
;TEST_FILE_META_END
;TEST_BEGIN_RECORDING
lea ecx, [esp-0x20]
mov dword [ecx], 0x114400
bsf eax, [ecx]
mov ecx, 0
;TEST_END_RECORDING
|
util/bootsect-footer.asm | fsmv/bootstrap-os | 2 | 99970 | <reponame>fsmv/bootstrap-os
; Provided under the MIT License: http://mit-license.org/
; Copyright (c) 2020 <NAME> <<EMAIL>>
times 0x200-4-2-0x40-2-($-$$) db 0 ; Pad with zeros up to 512 bytes
dd 0xDEADC0DE ; Windows reserved unique drive number
dw 0x0000 ; Just extra padding
times 0x40 db 0 ; Empty partition table
dw 0xAA55 ; BIOS bootable drive magic number
|
source/machine-w64-mingw32/x86_64/seh/c-unwind_pe.adb | ytomino/drake | 33 | 3291 | <gh_stars>10-100
with Ada.Unchecked_Conversion;
with System.Address_To_Constant_Access_Conversions;
with System.Storage_Elements;
with C.stdint;
package body C.unwind_pe is
pragma Suppress (All_Checks);
use type System.Storage_Elements.Storage_Offset;
procedure unreachable
with Import,
Convention => Intrinsic, External_Name => "__builtin_unreachable";
pragma No_Return (unreachable);
package unsigned_char_const_ptr_Conv is
new System.Address_To_Constant_Access_Conversions (
C.unsigned_char,
C.unsigned_char_const_ptr);
function "+" (Left : C.unsigned_char_const_ptr; Right : C.ptrdiff_t)
return C.unsigned_char_const_ptr
with Convention => Intrinsic;
pragma Inline_Always ("+");
function "+" (Left : C.unsigned_char_const_ptr; Right : C.ptrdiff_t)
return C.unsigned_char_const_ptr is
begin
return unsigned_char_const_ptr_Conv.To_Pointer (
unsigned_char_const_ptr_Conv.To_Address (Left)
+ System.Storage_Elements.Storage_Offset (Right));
end "+";
-- implementation
function size_of_encoded_value (encoding : unsigned_char)
return unsigned_int is
begin
if encoding = DW_EH_PE_omit then
return 0;
end if;
case encoding and 16#07# is
when DW_EH_PE_absptr =>
return void_ptr'Size / Standard'Storage_Unit;
when DW_EH_PE_udata2 =>
return 2;
when DW_EH_PE_udata4 =>
return 4;
when DW_EH_PE_udata8 =>
return 8;
when others =>
null;
end case;
gxx_abort;
end size_of_encoded_value;
function base_of_encoded_value (
encoding : unsigned_char;
context : access unwind.struct_Unwind_Context)
return unwind.Unwind_Ptr is
begin
if encoding = DW_EH_PE_omit then
return 0;
end if;
case encoding and 16#70# is
when DW_EH_PE_absptr
| DW_EH_PE_pcrel
| DW_EH_PE_aligned =>
return 0;
when DW_EH_PE_textrel =>
return unwind.Unwind_GetTextRelBase (context);
when DW_EH_PE_datarel =>
return unwind.Unwind_GetDataRelBase (context);
when DW_EH_PE_funcrel =>
return unwind.Unwind_GetRegionStart (context);
when others =>
null;
end case;
gxx_abort;
end base_of_encoded_value;
function read_uleb128 (
p : access constant unsigned_char;
val : access unwind.uleb128_t)
return unsigned_char_const_ptr
is
Mutable_p : unsigned_char_const_ptr := unsigned_char_const_ptr (p);
shift : unsigned_int := 0;
byte : unsigned_char;
result : unwind.uleb128_t;
begin
result := 0;
loop
byte := Mutable_p.all;
Mutable_p := Mutable_p + 1;
if shift >= unwind.uleb128_t'Size then
unreachable;
end if;
result := result
or Shift_Left (
unwind.uleb128_t (byte) and 16#7f#,
Natural (shift));
shift := shift + 7;
exit when not ((byte and 16#80#) /= 0);
end loop;
val.all := result;
return Mutable_p;
end read_uleb128;
function read_sleb128 (
p : access constant unsigned_char;
val : access unwind.sleb128_t)
return unsigned_char_const_ptr
is
Mutable_p : unsigned_char_const_ptr := unsigned_char_const_ptr (p);
shift : unsigned_int := 0;
byte : unsigned_char;
result : unwind.uleb128_t;
begin
result := 0;
loop
byte := Mutable_p.all;
Mutable_p := Mutable_p + 1;
if shift >= unwind.uleb128_t'Size then
unreachable;
end if;
result := result
or Shift_Left (
unwind.uleb128_t (byte) and 16#7f#,
Natural (shift));
shift := shift + 7;
exit when not ((byte and 16#80#) /= 0);
end loop;
if shift < result'Size and then (byte and 16#40#) /= 0 then
result := result or (-Shift_Left (1, Natural (shift)));
end if;
val.all := unwind.sleb128_t (result);
return Mutable_p;
end read_sleb128;
function read_encoded_value_with_base (
encoding : unsigned_char;
base : unwind.Unwind_Ptr;
p : access constant unsigned_char;
val : access unwind.Unwind_Ptr)
return unsigned_char_const_ptr
is
function Cast is
new Ada.Unchecked_Conversion (void_ptr, unwind.Unwind_Internal_Ptr);
type Unwind_Internal_Ptr_ptr is access all unwind.Unwind_Internal_Ptr;
function Cast is
new Ada.Unchecked_Conversion (
unwind.Unwind_Internal_Ptr,
Unwind_Internal_Ptr_ptr);
Mutable_p : unsigned_char_const_ptr := unsigned_char_const_ptr (p);
type unaligned (unchecked_tag : unsigned_int := 0) is record
case unchecked_tag is
when 0 =>
ptr : void_ptr;
when DW_EH_PE_udata2 =>
u2 : stdint.uint16_t;
when DW_EH_PE_udata4 =>
u4 : stdint.uint32_t;
when DW_EH_PE_udata8 =>
u8 : stdint.uint64_t;
when DW_EH_PE_sdata2 =>
s2 : stdint.int16_t;
when DW_EH_PE_sdata4 =>
s4 : stdint.int32_t;
when others => -- DW_EH_PE_sdata8
s8 : stdint.int64_t;
end case;
end record;
pragma Unchecked_Union (unaligned);
type unaligned_ptr is access all unaligned;
function Cast is
new Ada.Unchecked_Conversion (unsigned_char_const_ptr, unaligned_ptr);
function Cast is
new Ada.Unchecked_Conversion (
unaligned_ptr,
unwind.Unwind_Internal_Ptr);
u : constant unaligned_ptr := Cast (Mutable_p);
result : unwind.Unwind_Internal_Ptr;
begin
if encoding = DW_EH_PE_aligned then
declare
a : unwind.Unwind_Internal_Ptr :=
unwind.Unwind_Internal_Ptr (
System.Storage_Elements.To_Integer (
unsigned_char_const_ptr_Conv.To_Address (Mutable_p)));
begin
a := (a + void_ptr'Size / Standard'Storage_Unit - 1)
and -(void_ptr'Size / Standard'Storage_Unit);
result := Cast (a).all;
Mutable_p := unsigned_char_const_ptr_Conv.To_Pointer (
System'To_Address (
System.Storage_Elements.Integer_Address (
a + void_ptr'Size / Standard'Storage_Unit)));
end;
else
case encoding and 16#0f# is
when DW_EH_PE_absptr =>
result := Cast (u.ptr);
Mutable_p := Mutable_p + void_ptr'Size / Standard'Storage_Unit;
when DW_EH_PE_uleb128 =>
declare
tmp : aliased unwind.uleb128_t;
begin
Mutable_p := read_uleb128 (Mutable_p, tmp'Access);
result := unwind.Unwind_Internal_Ptr (tmp);
end;
when DW_EH_PE_sleb128 =>
declare
tmp : aliased unwind.sleb128_t;
begin
Mutable_p := read_sleb128 (Mutable_p, tmp'Access);
result := unwind.Unwind_Internal_Ptr (tmp);
end;
when DW_EH_PE_udata2 =>
result := unwind.Unwind_Internal_Ptr (u.u2);
Mutable_p := Mutable_p + 2;
when DW_EH_PE_udata4 =>
result := unwind.Unwind_Internal_Ptr (u.u4);
Mutable_p := Mutable_p + 4;
when DW_EH_PE_udata8 =>
result := unwind.Unwind_Internal_Ptr (u.u8);
Mutable_p := Mutable_p + 8;
when DW_EH_PE_sdata2 =>
result := unwind.Unwind_Internal_Ptr (u.s2);
Mutable_p := Mutable_p + 2;
when DW_EH_PE_sdata4 =>
result := unwind.Unwind_Internal_Ptr (u.s4);
Mutable_p := Mutable_p + 4;
when DW_EH_PE_sdata8 =>
result := unwind.Unwind_Internal_Ptr (u.s8);
Mutable_p := Mutable_p + 8;
when others =>
gxx_abort;
end case;
if result /= 0 then
if (encoding and 16#70#) = DW_EH_PE_pcrel then
result := result + Cast (u);
else
result := result + base;
end if;
if (encoding and DW_EH_PE_indirect) /= 0 then
result := Cast (result).all;
end if;
end if;
end if;
val.all := result;
return Mutable_p;
end read_encoded_value_with_base;
function read_encoded_value (
context : access unwind.struct_Unwind_Context;
encoding : unsigned_char;
p : access constant unsigned_char;
val : access unwind.Unwind_Ptr)
return unsigned_char_const_ptr is
begin
return read_encoded_value_with_base (
encoding,
base_of_encoded_value (encoding, context),
p,
val);
end read_encoded_value;
end C.unwind_pe;
|
test/Fail/Issue1413.agda | redfish64/autonomic-agda | 0 | 4210 | -- Andreas, 2015-05-06 issue reported by <NAME>
{-# OPTIONS --copatterns #-}
record Foo (A : Set) : Set where
field
foo : A
open Foo {{...}} public
record ⊤ : Set where
instance
Foo⊤ : Foo ⊤
foo Foo⊤ = {!!}
-- foo {{Foo⊤}} = {!!}
-- Error WAS:
-- An internal error has occurred. Please report this as a bug.
-- Location of the error: src/full/Agda/TypeChecking/Rules/LHS/Split.hs:103
-- Better error:
-- Not a valid projection for a copattern: foo
-- when checking that the clause foo Foo⊤ = ? has type Foo ⊤
|
programs/oeis/050/A050815.asm | neoneye/loda | 22 | 22487 | ; A050815: Number of positive Fibonacci numbers with n decimal digits.
; 6,5,5,4,5,5,5,4,5,5,5,5,4,5,5,5,5,4,5,5,5,4,5,5,5,5,4,5,5,5,5,4,5,5,5,4,5,5,5,5,4,5,5,5,4,5,5,5,5,4,5,5,5,5,4,5,5,5,4,5,5,5,5,4,5,5,5,5,4,5,5,5,4,5,5,5,5,4,5,5,5,5,4,5,5,5,4,5,5,5,5,4,5,5,5,5,4,5,5,5
mov $1,2
mov $2,$0
lpb $0
mov $0,$2
sub $1,1
add $0,$1
sub $0,1
seq $0,105564 ; Number of blocks of exactly 4 Fibonacci numbers having equal length <= n.
lpe
add $1,4
mov $0,$1
|
Assembler/tests/optimizations/b.asm | asifmallik/SCALE-MAMBA | 196 | 80305 | <reponame>asifmallik/SCALE-MAMBA
ldi c0, 3
ldsi s0, 3
crash
# these statements are unreachable
# FIXME: report a better error
clear_memory
clear_registers
|
Grammar/JanC.g4 | kris701/JanC | 0 | 4390 | grammar JanC;
// Global Scope
compileUnit: EOL* (unit EOL+)* (unit EOL*)? EOF;
// Unit and Impr
unit: decl | impr;
impr: stmt | expr;
// Decl
decl: 'every' delay=NUM EOL* impr # EveryTaskNode
| 'on' '(' condition=expr ')' EOL* impr # OnTaskNode
| 'once' EOL* impr # OnceTaskNode
| 'idle' EOL* impr # IdleTaskNode
| type=typeLiteral name=ID '(' parameters? ')' impr # FuncDecl
| varDecl # VarDeclNodeB
| 'struct' name=ID EOL* '{' EOL* (varDecl (EOL+ varDecl)*)? EOL* '}' # StructDecl
| 'module' name=ID EOL* '{' EOL* (unit (EOL+ unit)*)? EOL* '}' # ModuleDecl
;
parameters: varDecl (EOL* ',' varDecl)*;
// Stmt
stmt: varDecl # VarDeclNodeA
| '{' EOL* (impr (EOL+ impr)*)? EOL* '}' # BlockStmt
| 'if' '(' condition=expr ')' EOL* thenBody=impr EOL* ('else' EOL* elseBody=impr EOL*)? # IfStmt
| 'while' '(' condition=expr ')' EOL* body=impr # WhileStmt
| 'for' EOL* '(' init=impr ',' condition=expr ',' iteration=impr ')' EOL* body=impr # ForStmt
| location=expr op=(ASSIGN|SUB_ASSIGN|ADD_ASSIGN|MUL_ASSIGN|DIV_ASSIGN) value=expr # AssignStmt
| 'return' (value=expr)? # ReturnStmt
| 'switch' '(' value=expr ')' EOL* '{' switchCaseStmt+ '}' (EOL* 'else' EOL* defaultCase=impr)? # SwitchStmt
| 'critical' EOL* body=impr # CriticalStmt
;
switchCaseStmt: EOL* value=expr impr EOL*;
// Expr
expr: 'ref' '(' EOL* argument EOL* ')' # RefCallExpr
| item=expr '(' EOL* arguments? EOL* ')' # CallExpr
| '(' EOL* expr EOL* ')' # GroupingExpr
| op=MINUS expr # UnaryExpr
| structExpr=expr DOT memberName=identifier # MemberAccess
| left=expr op=(TIMES|DIV) right=expr # BinaryExpr
| left=expr op=(PLUS|MINUS) right=expr # BinaryExpr
| left=expr op=(EQUALS|NOT_EQUALS|LESS_THAN|LESS_THAN_OR_EQUALS|GREATER_THAN|GREATER_THAN_OR_EQUALS) right=expr # BinaryExpr
| value=NUM # NumberLiteral
| value=STR # StringLiteral
| identifier # IdentifierExpr
| value=('true'|'false') # BoolLiteral
| '!' expresion=expr # NotNode
| typeLiteral '{' EOL* (structLiteralMember (EOL* ',' EOL* structLiteralMember)*)? EOL* '}' # StructLiteral
;
structLiteralMember: (name=ID '=' )? value=expr;
arguments: argument (EOL* ',' argument)*;
argument: expr; // Named args may be possible in the future.
identifier: id=ID;
// Types
typeLiteral: baseType=ID # LiteralType
| 'ref<' typeLiteral '>' # LiteralTypeRef
| typeLiteral '.' memberName=ID # LiteralTypeAccess
;
// Other
varDecl: CONST? type=typeLiteral name=ID ('=' value=expr)?;
// Lexer Elements
// Lexer Tokens
PLUS: '+'; MINUS: '-'; TIMES: '*';
DIV: '/'; ASSIGN: '='; SUB_ASSIGN: '-=';
ADD_ASSIGN: '+='; MUL_ASSIGN: '*='; DIV_ASSIGN: '/=';
EQUALS: '=='; NOT_EQUALS: '!='; LESS_THAN: '<';
LESS_THAN_OR_EQUALS: '<='; GREATER_THAN: '>'; GREATER_THAN_OR_EQUALS: '>=';
DOT: '.'; CONST: 'const';
// Lexer Literals
STR: '"' ~('\n'|'"')* '"';
NUM: [0-9]+ ('.' [0-9]+)? ([eE] [+-]? [0-9]+)?;
ID: [a-zA-Z_][a-zA-Z_0-9]*;
// Lexer Comment
COMMENT: '/*' (COMMENT|.)*? '*/' -> skip;
LINE_COMMENT: '//' ~[\r\n]* -> skip;
// Lexer Other
EOL: [\r\n];
WS: [ \t] -> channel(HIDDEN);
|
PipeLine-CPU/2_final_shift.asm | MyLife97/MipsPipelineCPU | 0 | 94317 | <filename>PipeLine-CPU/2_final_shift.asm<gh_stars>0
#I
lui $1,0xffff
ori $1,$1,0xffac
sll $2,$1,8
sll $3,$1,17
sll $4,$1,28
ori $5,$0,0x1928
sll $2,$5,4
sll $3,$5,12
sll $4,$5,22
lui $1,0xffff
ori $1,$1,0xf928
sra $2,$1,25
sra $3,$1,15
sra $4,$1,9
ori $1,$0,0x2561
sra $2,$1,22
sra $3,$1,17
sra $4,$1,4
lui $1,0xfaef
ori $1,$1,0x1228
srl $2,$1,21
srl $3,$1,16
srl $4,$1,3
ori $1,$0,0x5528
srl $2,$1,24
srl $3,$1,14
srl $4,$1,2
lui $1,0xffff
ori $1,$1,0xffac
ori $5,$0,8
ori $6,$0,17
ori $7,$0,28
sllv $2,$1,$5
sllv $3,$1,$6
sllv $4,$1,$7
ori $1,$0,0x1928
ori $5,$0,4
ori $6,$0,15
sllv $2,$1,$5
sllv $3,$1,$6
ori $7,$0,25
sllv $4,$1,$7
lui $1,0xffff
ori $1,$1,0xf928
ori $6,$0,5
ori $5,$0,23
srav $2,$1,$5
ori $7,$0,17
srav $3,$1,$6
srav $4,$1,$7
ori $1,$0,0x2561
ori $5,$0,15
ori $6,$0,25
ori $7,$0,23
srav $2,$1,$5
srav $3,$1,$6
srav $4,$1,$7
lui $1,0xfaef
ori $1,$1,0x1228
ori $5,$0,11
ori $6,$0,26
ori $7,$0,7
srlv $2,$1,$5
srlv $3,$1,$6
srlv $4,$1,$7
ori $1,$0,0x5528
ori $5,$0,23
ori $6,$0,13
ori $7,$0,4
srlv $2,$1,$5
srlv $3,$1,$6
srlv $4,$1,$7
#R
lui $1,0xfcae
ori $1,$1,0x23cc
ori $2,$0,0x1606
add $1,$1,$2
sll $2,$1,8
sll $3,$1,17
sll $4,$1,28
ori $5,$0,0x1928
ori $6,$0,0x2998
add $5,$5,$6
sll $2,$5,4
sll $3,$5,12
sll $4,$5,22
lui $1,0xffff
ori $1,$1,0xf928
ori $2,$0,0x2839
sub $1,$1,$2
sra $2,$1,25
sra $3,$1,15
sra $4,$1,9
ori $1,$0,0x7561
ori $2,$0,0x0292
sub $1,$1,$2
sra $2,$1,22
sra $3,$1,17
sra $4,$1,4
lui $1,0xfaef
ori $1,$1,0x1228
ori $2,$0,0x9284
or $1,$1,$2
srl $2,$1,21
srl $3,$1,16
srl $4,$1,3
ori $1,$0,0x5528
ori $2,$0,0x3921
or $1,$1,$2
srl $2,$1,24
srl $3,$1,14
srl $4,$1,2
lui $1,0xffff
ori $1,$1,0xffac
ori $5,$0,8
ori $6,$0,17
ori $7,$0,28
lui $2,0xffff
ori $2,$2,0xe283
and $1,$1,$2
sllv $2,$1,$5
sllv $3,$1,$6
sllv $4,$1,$7
ori $5,$0,0xe927
ori $8,$0,4
ori $9,$0,15
ori $10,$0,25
ori $6,$0,0xc836
and $5,$5,$6
sllv $2,$5,$8
sllv $3,$5,$9
sllv $4,$5,$10
lui $1,0xffff
ori $1,$1,0xf928
ori $5,$0,23
ori $6,$0,5
ori $7,$0,17
lui $2,0xfcfc
ori $2,$2,0xfafa
nor $1,$2,$1
srav $2,$1,$5
srav $3,$1,$6
srav $4,$1,$7
ori $1,$0,0x2561
ori $5,$0,15
ori $6,$0,5
ori $7,$0,23
ori $2,$0,0x3631
nor $1,$1,$2
srav $2,$1,$5
srav $3,$1,$6
srav $4,$1,$7
lui $1,0xfaef
ori $1,$1,0x1228
ori $5,$0,11
ori $6,$0,26
ori $7,$0,7
lui $2,0xf882
ori $2,$2,0x9821
xor $1,$1,$2
srlv $2,$1,$5
srlv $3,$1,$6
srlv $4,$1,$7
ori $1,$0,0x5528
ori $5,$0,23
ori $6,$0,13
ori $7,$0,4
ori $2,$0,0x8273
xor $1,$1,$2
srlv $2,$1,$5
srlv $3,$1,$6
srlv $4,$1,$7
#md
lui $1,0xffff
ori $1,$1,0xffac
lui $2,0x1291
ori $2,$2,0x9382
mult $1,$2
mfhi $1
sll $2,$1,8
sll $3,$1,17
sll $4,$1,28
ori $5,$0,0x1928
ori $2,$0,0x9928
div $2,$5
mfhi $5
sll $2,$5,4
sll $3,$5,12
sll $4,$5,22
lui $1,0xffff
ori $1,$1,0xf928
lui $2,0xace9
ori $2,$2,0x9928
multu $1,$2
mfhi $1
sra $2,$1,25
sra $3,$1,15
sra $4,$1,9
ori $2,$0,0x9382
ori $1,$0,0x2561
divu $1,$2
mflo $1
sra $2,$1,22
sra $3,$1,17
sra $4,$1,4
lui $1,0xfaef
ori $1,$1,0x1228
lui $2,0x8839
ori $2,$2,0x291c
div $1,$2
mfhi $1
mflo $1
srl $2,$1,21
srl $3,$1,16
srl $4,$1,3
ori $1,$0,0x5528
ori $2,$0,0x992f
multu $1,$2
mflo $1
srl $2,$1,24
srl $3,$1,14
srl $4,$1,2
lui $1,0xffff
ori $1,$1,0xffac
lui $2,0x9f82
ori $2,$2,0x9918
div $1,$2
ori $5,$0,8
ori $6,$0,17
ori $7,$0,28
mfhi $1
sllv $2,$1,$5
sllv $3,$1,$6
sllv $4,$1,$7
ori $5,$0,0x1928
ori $6,$0,0x9928
ori $5,$0,4
ori $6,$0,15
ori $7,$0,25
divu $6,$5
mflo $5
sllv $2,$5,$5
sllv $3,$5,$6
sllv $4,$5,$7
lui $1,0xffff
ori $1,$1,0xf928
ori $2,$0,0x9348
divu $1,$2
ori $5,$0,23
ori $6,$0,5
ori $7,$0,17
mflo $1
srav $2,$1,$5
srav $3,$1,$6
srav $4,$1,$7
ori $1,$0,0x2561
lui $2,0xf938
ori $2,$2,0x8832
mult $1,$2
ori $5,$0,15
ori $6,$0,25
ori $7,$0,23
mflo $1
srav $2,$1,$5
srav $3,$1,$6
srav $4,$1,$7
lui $1,0xfaef
ori $1,$1,0x1228
ori $2,$0,0x9938
multu $1,$2
ori $5,$0,11
ori $6,$0,26
ori $7,$0,7
mflo $1
srlv $2,$1,$5
srlv $3,$1,$6
srlv $4,$1,$7
ori $1,$0,0x5528
lui $2,0xf928
ori $2,$2,0x9938
div $1,$2
ori $5,$0,23
ori $6,$0,13
ori $7,$0,4
mfhi $1
srlv $2,$1,$5
srlv $3,$1,$6
srlv $4,$1,$7
#mtmf
lui $1,0xffff
ori $1,$1,0xffac
lui $2,0x1291
ori $2,$2,0x9382
mthi $2
mfhi $1
sll $2,$1,8
sll $3,$1,17
sll $4,$1,28
ori $5,$0,0x1928
ori $2,$0,0x9928
mthi $2
mtlo $4
mfhi $5
sll $2,$5,4
sll $3,$5,12
sll $4,$5,22
lui $1,0xffff
ori $1,$1,0xf928
lui $2,0xace9
ori $2,$2,0x9928
mtlo $1
mthi $2
mfhi $1
sra $2,$1,25
sra $3,$1,15
sra $4,$1,9
ori $2,$0,0x9382
ori $1,$0,0x2561
mtlo $2
mthi $3
mflo $1
sra $2,$1,22
sra $3,$1,17
sra $4,$1,4
lui $1,0xfaef
ori $1,$1,0x1228
lui $2,0x8839
ori $2,$2,0x291c
mthi $2
mtlo $4
mfhi $1
mflo $1
srl $2,$1,21
srl $3,$1,16
srl $4,$1,3
ori $1,$0,0x5528
ori $2,$0,0x992f
mtlo $2
mthi $3
mflo $1
srl $2,$1,24
srl $3,$1,14
srl $4,$1,2
lui $1,0xffff
ori $1,$1,0xffac
lui $2,0x9f82
ori $2,$2,0x9918
mthi $2
mtlo $3
ori $5,$0,8
ori $6,$0,17
ori $7,$0,28
mfhi $1
sllv $2,$1,$5
sllv $3,$1,$6
sllv $4,$1,$7
ori $5,$0,0x1928
ori $6,$0,0x9928
div $6,$5
ori $5,$0,4
ori $6,$0,15
ori $7,$0,25
mfhi $3
mtlo $3
mflo $5
sllv $2,$5,$5
sllv $3,$5,$6
sllv $4,$5,$7
lui $1,0xffff
ori $1,$1,0xf928
ori $2,$0,0x9348
divu $1,$2
ori $5,$0,23
ori $6,$0,5
ori $7,$0,17
mfhi $2
mtlo $2
mflo $1
srav $2,$1,$5
srav $3,$1,$6
srav $4,$1,$7
ori $1,$0,0x2561
lui $2,0xf938
ori $2,$2,0x8832
mult $1,$2
ori $5,$0,15
ori $6,$0,25
ori $7,$0,23
mfhi $3
mtlo $3
mflo $1
srav $2,$1,$5
srav $3,$1,$6
srav $4,$1,$7
lui $1,0xfaef
ori $1,$1,0xf228
ori $2,$0,0xe938
multu $1,$2
ori $5,$0,11
ori $6,$0,26
ori $7,$0,7
mfhi $4
mtlo $4
mflo $1
srlv $2,$1,$5
srlv $3,$1,$6
srlv $4,$1,$7
ori $1,$0,0x5528
lui $2,0xf928
ori $2,$2,0x9938
div $1,$2
ori $5,$0,23
ori $6,$0,13
ori $7,$0,4
mflo $3
mthi $3
mfhi $1
srlv $2,$1,$5
srlv $3,$1,$6
srlv $4,$1,$7
#load
#initial
lui $1,0xff19
ori $1,$1,0x6384
lui $2,0x7cfd
ori $2,$2,0x5788
lui $3,0xa83c
ori $3,$3,0x8847
lui $4,0x9382
ori $4,$4,0xacfe
ori $5,$0,0x2281
ori $6,$0,0x9928
lui $7,0x0003
ori $7,$7,0x0028
sw $1,0($0)
sw $2,4($0)
sw $3,8($0)
sw $4,12($0)
sw $5,16($0)
sw $6,20($0)
sw $7,24($0)
lw $1,0($0)
sll $2,$1,8
sll $3,$1,17
sll $4,$1,28
lw $5,4($0)
sll $2,$5,4
sll $3,$5,12
sll $4,$5,22
lh $1,6($0)
sra $2,$1,25
sra $3,$1,15
sra $4,$1,9
lh $1,2($0)
sra $2,$1,22
sra $3,$1,17
sra $4,$1,4
lhu $1,10($0)
srl $2,$1,21
srl $3,$1,16
srl $4,$1,3
lbu $1,13($0)
srl $2,$1,24
srl $3,$1,14
srl $4,$1,2
ori $5,$0,8
ori $6,$0,17
ori $7,$0,28
lb $1,7($0)
sllv $2,$1,$5
sllv $3,$1,$6
sllv $4,$1,$7
ori $5,$0,0x1928
ori $5,$0,4
ori $6,$0,15
ori $7,$0,25
lh $1,12($0)
sllv $2,$5,$5
sllv $3,$5,$6
sllv $4,$5,$7
ori $5,$0,23
ori $6,$0,5
ori $7,$0,17
lhu $1,16($0)
srav $2,$1,$5
srav $3,$1,$6
srav $4,$1,$7
ori $5,$0,15
ori $6,$0,25
ori $7,$0,23
lbu $1,22($0)
srav $2,$1,$5
srav $3,$1,$6
srav $4,$1,$7
ori $5,$0,11
ori $6,$0,26
ori $7,$0,7
lb $1,19($0)
srlv $2,$1,$5
srlv $3,$1,$6
srlv $4,$1,$7
ori $5,$0,23
ori $6,$0,13
ori $7,$0,4
lbu $1,4($0)
srlv $2,$1,$5
srlv $3,$1,$6
srlv $4,$1,$7
#shift
lui $1,0xffff
ori $1,$1,0xffac
sll $2,$1,8
sll $3,$2,7
sll $4,$3,2
ori $5,$0,0x1928
sll $2,$5,4
sll $3,$2,2
sll $4,$3,7
lui $1,0xffff
ori $1,$1,0xf928
sra $2,$1,5
sra $3,$2,1
sra $4,$3,3
ori $1,$0,0x2561
sra $2,$1,2
sra $3,$2,1
sra $4,$3,2
lui $1,0xfaef
ori $1,$1,0x1228
srl $2,$1,2
srl $3,$2,4
srl $4,$3,3
ori $1,$0,0x5528
srl $2,$1,4
srl $3,$2,4
srl $4,$3,2
lui $1,0xffff
ori $1,$1,0xffac
ori $5,$0,3
ori $6,$0,1
ori $7,$0,2
sllv $2,$1,$5
sllv $3,$2,$6
sllv $4,$3,$7
ori $1,$0,0x1928
ori $5,$0,4
ori $6,$0,1
ori $7,$0,5
sllv $2,$1,$5
sllv $3,$2,$6
sllv $4,$3,$7
lui $1,0xffff
ori $1,$1,0xf928
ori $5,$0,3
ori $6,$0,5
ori $7,$0,1
srav $2,$1,$5
srav $3,$2,$6
srav $4,$3,$7
ori $1,$0,0xa561
ori $5,$0,1
ori $6,$0,2
ori $7,$0,3
srav $2,$1,$5
srav $3,$2,$6
srav $4,$3,$7
lui $1,0xfaef
ori $1,$1,0x1228
ori $5,$0,1
ori $6,$0,2
ori $7,$0,5
srlv $2,$1,$5
srlv $3,$2,$6
srlv $4,$3,$7
ori $1,$0,0x9528
ori $5,$0,2
ori $6,$0,3
ori $7,$0,4
srlv $2,$1,$5
srlv $3,$2,$6
srlv $4,$3,$7
#set
lui $1,0xffff
ori $1,$1,0xffac
slt $1,$1,$0
sll $2,$1,8
sll $3,$1,17
sll $4,$1,28
sltu $5,$1,$0
sll $2,$5,4
sll $3,$5,12
sll $4,$5,22
lui $1,0xffff
ori $1,$1,0xffac
ori $7,$0,28
ori $5,$0,8
slti $1,$1,0x7a93
sllv $2,$1,$5
lui $1,0xffff
ori $1,$1,0xffac
slti $6,$1,17
sllv $3,$1,$6
sllv $4,$1,$7
lui $5,0xf928
ori $5,$5,0x1928
ori $6,$0,3
ori $7,$0,5
ori $1,$0,9
sltiu $6,$5,1
sllv $2,$5,$1
sllv $3,$5,$6
sllv $4,$5,$7
#jaljalr
jal t1
sll $2,$31,8
nop
nop
t1:
sll $3,$31,17
sll $4,$31,28
jal t2
sra $2,$31,3
nop
nop
t2:
sra $3,$31,2
sra $4,$31,1
jal t3
srl $2,$31,3
nop
nop
t3:
srl $3,$31,2
srl $4,$31,1
ori $5,$0,8
ori $6,$0,17
ori $7,$0,28
jal t4
sllv $2,$31,$5
nop
nop
t4:
sllv $3,$31,$6
sllv $4,$31,$7
ori $1,$0,0x1928
ori $5,$0,4
ori $6,$0,1
jal t5
sllv $2,$31,$5
nop
nop
t5:
sllv $3,$31,$6
ori $7,$0,5
sllv $4,$31,$7
ori $6,$0,5
ori $5,$0,2
jal t6
srav $2,$31,$5
nop
nop
t6:
ori $7,$0,1
srav $3,$31,$6
srav $4,$31,$7
ori $5,$0,1
ori $6,$0,2
ori $7,$0,3
jal t7
srlv $2,$31,$5
nop
nop
t7:
srlv $3,$31,$6
srlv $4,$31,$7
ori $5,$0,2
ori $6,$0,1
ori $7,$0,3
ori $1,$0,0x3a6c
jalr $2,$1
srlv $2,$2,$5
nop
srlv $3,$2,$6
srlv $4,$2,$7 |
programs/oeis/143/A143643.asm | karttu/loda | 0 | 167449 | <filename>programs/oeis/143/A143643.asm
; A143643: Numerators of the lower principal convergents and the lower intermediate convergents to 3^(1/2).
; 1,3,5,12,19,45,71,168,265,627,989,2340,3691,8733,13775,32592,51409,121635,191861,453948,716035,1694157,2672279,6322680,9973081,23596563,37220045,88063572,138907099,328657725,518408351,1226567328,1934726305,4577611587,7220496869,17083879020,26947261171,63757904493,100568547815
lpb $0,1
add $2,1
add $1,$2
add $2,$1
trn $2,$0
sub $0,1
add $1,$2
lpe
add $1,1
|
Transynther/x86/_processed/NC/_st_zr_un_sm_/i7-7700_9_0xca.log_21829_606.asm | ljhsiun2/medusa | 9 | 163044 | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x10f04, %rbp
nop
nop
dec %rax
movb (%rbp), %r8b
nop
nop
xor $61020, %rdx
lea addresses_WC_ht+0xab1c, %rsi
lea addresses_D_ht+0x172dc, %rdi
nop
nop
nop
nop
nop
xor %r13, %r13
mov $114, %rcx
rep movsw
nop
nop
nop
cmp $18318, %r8
lea addresses_D_ht+0x1c55c, %rdx
clflush (%rdx)
nop
nop
sub %rsi, %rsi
mov (%rdx), %r13w
sub %r8, %r8
lea addresses_WT_ht+0x1d75c, %r8
nop
nop
nop
dec %rsi
mov (%r8), %rcx
dec %rdx
lea addresses_WC_ht+0xbcee, %rcx
inc %rax
mov (%rcx), %r8d
and $56158, %r13
lea addresses_WT_ht+0xcedc, %r13
cmp %rbp, %rbp
movb $0x61, (%r13)
nop
add %rbp, %rbp
lea addresses_normal_ht+0xb81c, %rsi
lea addresses_A_ht+0xc35c, %rdi
add %rax, %rax
mov $114, %rcx
rep movsq
nop
nop
nop
cmp %rdi, %rdi
lea addresses_A_ht+0x875c, %rsi
lea addresses_normal_ht+0x935c, %rdi
nop
nop
nop
nop
xor %rax, %rax
mov $92, %rcx
rep movsl
sub %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %r8
push %r9
push %rax
push %rcx
// Store
lea addresses_A+0x1677c, %rcx
nop
nop
nop
nop
nop
and %r13, %r13
mov $0x5152535455565758, %rax
movq %rax, (%rcx)
nop
nop
cmp %rax, %rax
// Store
mov $0x2fe472000000035c, %r15
nop
nop
nop
nop
and %r13, %r13
movb $0x51, (%r15)
nop
nop
cmp %r13, %r13
// Faulty Load
mov $0x2fe472000000035c, %r15
nop
nop
nop
nop
inc %r13
mov (%r15), %cx
lea oracles, %r8
and $0xff, %rcx
shlq $12, %rcx
mov (%r8,%rcx,1), %rcx
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_NC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 2, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': True, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}}
{'00': 3349, '5f': 951, '51': 17529}
51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 5f 5f 5f 51 00 5f 51 51 51 51 51 00 51 5f 51 51 51 51 51 5f 00 51 51 00 51 51 51 51 51 51 51 51 51 51 00 51 00 51 51 00 51 51 51 51 51 5f 51 51 00 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 00 5f 51 51 00 51 51 5f 51 00 51 51 00 51 00 51 51 51 51 00 51 51 51 00 51 51 51 51 51 51 51 51 51 51 51 51 00 00 5f 5f 51 51 00 51 51 51 51 00 51 51 00 51 51 51 51 51 51 51 00 51 51 51 51 5f 51 5f 51 51 51 51 51 51 5f 51 51 51 51 51 51 51 51 51 51 51 51 51 00 51 51 51 5f 51 51 51 51 51 51 00 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 5f 51 51 00 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 00 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 00 51 51 51 00 51 00 51 51 51 51 5f 51 51 51 51 51 51 51 51 51 51 51 51 00 00 51 51 51 00 00 00 51 5f 51 00 51 5f 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 00 00 51 51 51 51 51 51 51 51 51 51 51 51 00 51 51 5f 51 51 51 51 51 51 00 00 51 51 5f 51 51 51 51 5f 51 51 51 51 51 51 51 51 51 00 51 51 51 51 51 00 51 51 51 51 51 51 00 51 51 51 51 5f 51 51 51 51 51 51 51 51 51 51 51 51 51 51 00 51 51 00 51 51 5f 51 00 00 51 00 00 51 00 51 51 51 51 51 51 00 51 5f 51 51 51 51 5f 51 51 51 00 51 51 51 51 51 51 51 00 51 51 51 51 51 51 00 51 51 51 00 51 51 5f 51 51 51 51 51 51 51 51 51 5f 51 51 51 51 5f 00 51 00 51 51 51 51 51 51 51 51 5f 00 51 51 51 51 51 51 51 51 51 51 51 51 51 00 51 51 51 51 00 51 51 51 51 51 51 51 51 51 51 51 51 51 51 5f 51 51 51 51 51 51 00 51 51 51 51 51 51 51 5f 51 51 51 51 51 51 51 51 51 00 00 51 51 51 51 51 51 51 00 00 51 51 51 51 5f 51 51 00 51 00 51 51 5f 5f 51 51 51 51 51 51 51 51 51 51 51 5f 51 51 51 51 51 00 51 00 51 51 51 51 51 51 00 00 51 51 51 51 51 51 51 51 51 51 00 00 00 51 51 51 51 51 51 00 51 51 51 51 00 51 51 00 51 00 51 51 51 51 51 51 00 51 51 51 51 51 51 00 51 00 51 00 51 5f 51 51 51 51 00 00 5f 51 00 51 51 51 51 00 51 51 00 51 51 51 51 51 5f 51 51 51 51 00 51 51 00 51 51 51 00 51 51 51 51 5f 51 00 51 51 51 51 51 51 51 00 51 51 51 51 51 51 51 00 00 51 00 00 51 00 51 51 00 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 00 51 51 51 51 51 51 51 5f 5f 51 00 51 51 51 00 51 51 51 51 51 51 51 51 51 00 51 51 51 5f 51 00 51 51 51 51 51 51 00 00 00 51 51 51 00 51 51 51 51 51 51 51 00 51 00 00 51 51 51 51 51 51 00 51 51 51 51 51 51 00 51 51 51 51 00 00 51 51 51 51 51 51 51 51 51 51 51 51 51 00 51 00 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 5f 51 51 5f 51 00 51 51 51 51 51 51 51 51 51 5f 00 51 5f 51 51 51 51 51 51 51 00 51 51 51 51 51 51 51 51 51 51 51 00 00 00 51 51 51 51 51 51 51 51 5f 51 00 51 51 51 51 00 51 5f 51 00 51 5f 00 51 51 51 00 51 51 00 51 51 51 00 51 51 51 51 51 51 51 51 51 51 51 00 51 51 51 51 51 51 51 51 5f 51 51 51 51 51 51 51 51 51 51 51 51 00 51 51 51 51 51 51 51 51 5f 51 51 51 5f 51 51 51 51 51 51 51 51 51 00 00 51 51 51 5f 51 51 51 51 51 51 51 51 51 51 51 00 51 51 51 51 51 51 51 51 51 51 51 51 51 51 5f 00 51 51 51 51 51 51 51 51 51 51 51 00 51 51 51 51 51 00 51 51 51 5f 51 51 51 51 51 51 51 00
*/
|
Data/List/Sorting/Functions.agda | Lolirofle/stuff-in-agda | 6 | 7166 | <gh_stars>1-10
import Lvl
open import Data.Boolean
open import Type
module Data.List.Sorting.Functions {ℓ} {T : Type{ℓ}} (_≤?_ : T → T → Bool) where
open import Data.List
import Data.List.Functions as List
-- Inserts an element to a sorted list so that the resulting list is still sorted.
insert : T → List(T) → List(T)
insert x ∅ = List.singleton(x)
insert x (y ⊰ l) = if(x ≤? y) then (x ⊰ y ⊰ l) else (y ⊰ insert x l)
-- Merges two sorted lists so that the resulting list is still sorted.
merge : List(T) → List(T) → List(T)
merge = List.foldᵣ insert
-- Merges a list of sorted lists so that the resulting list is still sorted.
mergeAll : List(List(T)) → List(T)
mergeAll = List.foldᵣ merge ∅
open import Data.Tuple
open import Data.Option
import Data.Option.Functions as Option
-- Extracts a smallest element from a list.
extractMinimal : List(T) → Option(T ⨯ List(T))
extractMinimal ∅ = None
extractMinimal (x ⊰ ∅) = Some(x , ∅)
extractMinimal (x ⊰ l@(_ ⊰ _)) = Option.map(\{(la , las) → if(x ≤? la) then (x , l) else (la , x ⊰ las)}) (extractMinimal l)
|
tb/tprog/asm/test.mult.asm | mshaklunov/mips_onemore | 0 | 104647 | <gh_stars>0
#MULT INSTRUCTION
#1 NEGATIVE A, POSITIVE B: A=0x80000_0000-0xFFFF_0000, B=0x0000_0000-0x0000_7FFF
lui $1 0x8000
ori $1 0x0000
lui $2 0x0000
ori $2 0x0000
lui $3 0x0000
ori $3 0x0000
lui $4 0x0000
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xC000
ori $1 0x0000
lui $2 0x0000
ori $2 0x0001
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0xC000
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xE000
ori $1 0x0000
lui $2 0x0000
ori $2 0x0003
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0xA000
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xF000
ori $1 0x0000
lui $2 0x0000
ori $2 0x0007
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x9000
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xF800
ori $1 0x0000
lui $2 0x0000
ori $2 0x000F
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x8800
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xFC00
ori $1 0x0000
lui $2 0x0000
ori $2 0x001F
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x8400
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xFE00
ori $1 0x0000
lui $2 0x0000
ori $2 0x003F
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x8200
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xFF00
ori $1 0x0000
lui $2 0x0000
ori $2 0x007F
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x8100
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xFF80
ori $1 0x0000
lui $2 0x0000
ori $2 0x00FF
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x8080
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xFFC0
ori $1 0x0000
lui $2 0x0000
ori $2 0x01FF
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x8040
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xFFE0
ori $1 0x0000
lui $2 0x0000
ori $2 0x03FF
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x8020
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xFFF0
ori $1 0x0000
lui $2 0x0000
ori $2 0x07FF
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x8010
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xFFF8
ori $1 0x0000
lui $2 0x0000
ori $2 0x0FFF
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x8008
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xFFFC
ori $1 0x0000
lui $2 0x0000
ori $2 0x1FFF
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x8004
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xFFFE
ori $1 0x0000
lui $2 0x0000
ori $2 0x3FFF
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x8002
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0xFFFF
ori $1 0x0000
lui $2 0x0000
ori $2 0x7FFF
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x8001
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
#2 POSITIVE A, POSITIVE B: A=0x7FFF_0000-0x7FFF_FFFE, B=0x0000_FFFF-0x7FFF_FFFF
lui $1 0x7FFF
ori $1 0x0000
lui $2 0x0000
ori $2 0xFFFF
lui $3 0x0000
ori $3 0x7FFE
lui $4 0x8001
ori $4 0x0000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0x8000
lui $2 0x0001
ori $2 0xFFFF
lui $3 0x0000
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x8000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xC000
lui $2 0x0003
ori $2 0xFFFF
lui $3 0x0001
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x4000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xE000
lui $2 0x0007
ori $2 0xFFFF
lui $3 0x0003
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x2000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xF000
lui $2 0x000F
ori $2 0xFFFF
lui $3 0x0007
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x1000
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xF800
lui $2 0x001F
ori $2 0xFFFF
lui $3 0x000F
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x0800
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xFC00
lui $2 0x003F
ori $2 0xFFFF
lui $3 0x001F
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x0400
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xFE00
lui $2 0x007F
ori $2 0xFFFF
lui $3 0x003F
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x0200
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xFF00
lui $2 0x00FF
ori $2 0xFFFF
lui $3 0x007F
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x0100
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xFF80
lui $2 0x01FF
ori $2 0xFFFF
lui $3 0x00FF
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x0080
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xFFC0
lui $2 0x03FF
ori $2 0xFFFF
lui $3 0x01FF
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x0040
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xFFE0
lui $2 0x07FF
ori $2 0xFFFF
lui $3 0x03FF
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x0020
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xFFF0
lui $2 0x0FFF
ori $2 0xFFFF
lui $3 0x07FF
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x0010
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xFFF8
lui $2 0x1FFF
ori $2 0xFFFF
lui $3 0x0FFF
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x0008
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xFFFC
lui $2 0x3FFF
ori $2 0xFFFF
lui $3 0x1FFF
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x0004
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
lui $1 0x7FFF
ori $1 0xFFFE
lui $2 0x7FFF
ori $2 0xFFFF
lui $3 0x3FFF
ori $3 0xFFFE
lui $4 0x8000
ori $4 0x0002
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
#3 POSITIVE A, NEGATIVE B
lui $1 0x7FFF
ori $1 0xFFFF
lui $2 0xFFFF
ori $2 0xFFFF
lui $3 0xFFFF
ori $3 0xFFFF
lui $4 0x8000
ori $4 0x0001
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
#4 NEGATIVE A, NEGATIVE B
lui $1 0xFFFF
ori $1 0xFFFF
lui $2 0xFFFF
ori $2 0xFFFF
lui $3 0x0000
ori $3 0x0000
lui $4 0x0000
ori $4 0x0001
mult $1 $2
mfhi $5
mflo $6
bne $3 $5 fail
sll $0 $0 0
bne $4 $6 fail
sll $0 $0 0
|
Partial/PComp.agda | hbasold/Sandbox | 0 | 11578 | {-# OPTIONS --without-K #-}
module PComp where
open import Data.Empty
open import Data.Sum
open import Data.Nat as Nat
open import Data.Nat.Properties.Simple
open import Data.Nat.Properties
open import Data.Product
open import Data.Bool renaming (Bool to 𝔹)
open import Data.Bool.Properties
open import Relation.Nullary
open import Relation.Binary.PropositionalEquality
open import Relation.Binary
open DecTotalOrder ≤-decTotalOrder using ()
renaming (refl to ≤-refl; trans to ≤-trans)
-- open import Size
-- record D {i : Size} (A : Set) : Set where
-- coinductive
-- field step : {j : Size< i} → A ⊎ D {j} A
-- open D public
-- μ' : ∀{i} → (ℕ → 𝔹) → ℕ → D {i} ℕ
-- μ' p n .step = if p n then inj₁ n else inj₂ (μ' p (suc n))
primRec : {X Y : Set} → (X → Y) → (ℕ → Y → X → Y) → ℕ → X → Y
primRec f g zero x = f x
primRec f g (suc n) x = g n (primRec f g n x) x
record D (A : Set) : Set where
coinductive
field step : A ⊎ D A
open D public
μ' : (ℕ → 𝔹) → ℕ → D ℕ
c : (ℕ → 𝔹) → ℕ → 𝔹 → ℕ ⊎ (D ℕ)
μ' p n .step = c p n (p n)
c p n false = inj₂ (μ' p (1 + n))
c p n true = inj₁ n
μ : (ℕ → 𝔹) → D ℕ
μ p = μ' p 0
isEven : ℕ → 𝔹
isEven zero = true
isEven (suc zero) = false
isEven (suc (suc n)) = isEven n
data _↓_ {A : Set} (d : D A) (a : A) : Set where
now : d .step ≡ inj₁ a → d ↓ a
later : {d' : D A} → d .step ≡ inj₂ d' → d' ↓ a → d ↓ a
foo : μ' isEven 3 ↓ 4
foo = later (cong inj₂ refl) (now refl)
μ-finds-tt : ∀{p : ℕ → 𝔹} {m n : ℕ} → μ' p m ↓ n → p n ≡ true
μ-finds-tt {p} {m} (now q) with p m | inspect p m
μ-finds-tt {p} {m} (now ()) | false | _
μ-finds-tt {p} {m} (now refl) | true | [ eq ] = eq
μ-finds-tt {p} {m} (later q t) with p m
μ-finds-tt {p} {m} (later refl t) | false = μ-finds-tt t
μ-finds-tt {p} {m} (later () t) | true
-- | Compute the number of steps taken to obtain p n = tt.
μ-dist : ∀{p : ℕ → 𝔹} {m n : ℕ} → μ' p m ↓ n → ∃ λ k → n ≡ m + k
μ-dist {p} {m} (now q) with p m
μ-dist {p} {m} (now ()) | false
μ-dist {p} {m} (now refl) | true = (0 , sym (+-identityʳ m))
μ-dist {p} {m} (later q t) with p m
μ-dist {p} {m} (later refl t) | false =
let (k , e) = μ-dist t
in (1 + k , trans e (sym (+-suc m k)))
μ-dist {p} {m} (later () t) | true
empty-interval : ∀ {m k} → m ≤ k → k < m → ⊥
empty-interval z≤n ()
empty-interval (s≤s p) (s≤s q) = empty-interval p q
suc≤⇒≤ : ∀ m n → suc m ≤ n → m ≤ n
suc≤⇒≤ m zero ()
suc≤⇒≤ .0 (suc n) (s≤s z≤n) = z≤n
suc≤⇒≤ .(suc _) (suc .(suc _)) (s≤s (s≤s p)) = s≤s (suc≤⇒≤ _ _ (s≤s p))
-- | The proof proceeds by induction on the termination proof t : μ' p m ↓ n.
-- In the process, we first distinguishing whether m = k or m < k.
-- Next, we check whether the computation has termination, that is, whether
-- t = now ... or t = later.
-- Finally, we distinguish on the values of p m, which allows us to make
-- a computation step with μ'. The other cases follow then from there.
μ-min : ∀{p : ℕ → 𝔹} {m n : ℕ} → μ' p m ↓ n → ∀ k → m ≤′ k → k < n → p k ≡ false
-- m = k
---- t = now
μ-min {p} {.m} (now q) m ≤′-refl u with p m
μ-min {p} {.m} (now q) m ≤′-refl u | false = refl
μ-min {p} {.m} (now refl) m ≤′-refl u | true = ⊥-elim (1+n≰n u)
-- m = k
---- t = later
μ-min {p} {.m} (later q t) m ≤′-refl u with p m
μ-min {p} {.m} (later q t) m ≤′-refl u | false = refl
μ-min {p} {.m} (later () t) m ≤′-refl u | true
-- m < k
---- t = now
μ-min {p} {m} (now q) .(suc _) (≤′-step l) u with p m
μ-min {p} {m} (now ()) .(suc _) (≤′-step l) u | false
μ-min {p} {.(suc _)} (now refl) .(suc _) (≤′-step l) (s≤s u) | true =
⊥-elim (empty-interval (suc≤⇒≤ _ _ (≤′⇒≤ l)) u)
-- m < k
---- t = later
μ-min {p} {m} (later q t) .(suc _) (≤′-step {k'} l) u with p m
μ-min {p} {m} (later refl t) .(suc _) (≤′-step {k'} l) u | false =
μ-min t (suc k') (s≤′s l) u
μ-min {p} {m} (later () t) .(suc n) (≤′-step {n} l) u | true
Min : (ℕ → Set) → ℕ → Set
Min P n = P n × ∀ k → k < n → ¬ (P k)
-- | Definition of partial correctness for the μ-operator.
-- This states that if μ p terminates with n as result, then n is the
-- minimal number, for which p n ≡ true.
PartialCorrectness : Set
PartialCorrectness = ∀{p : ℕ → 𝔹} {n : ℕ} →
μ p ↓ n → Min (λ k → p k ≡ true) n
μ-pcorrect : PartialCorrectness
μ-pcorrect t = (μ-finds-tt t , (λ k u → not-¬ (μ-min t k (z≤′n) u)))
-- Correctness : Set
-- Correctness = ∀{p : ℕ → 𝔹} →
-- ¬(∃ λ n → μ p ↓ n) → ∀ n → ¬(p n ≡ true)
-- find-min' : ∀{p : ℕ → 𝔹} → ∀ n → p n ≡ true → (m : ℕ) → m ≤ n →
-- (∃ λ k → k ≤ n × p k ≡ true)
-- find-min' {p} last pt zero l with p 0 | inspect p 0
-- find-min' {p} last pt zero l | false | e = (last , ≤-refl , pt)
-- find-min' {p} last pt zero l | true | [ e ] = (zero , l , e)
-- find-min' {p} last pt (suc m) l with p m | inspect p m
-- find-min' {p} last pt (suc m) l | false | e =
-- find-min' last pt m (suc≤⇒≤ m last l)
-- find-min' {p} last pt (suc m) l | true | [ e ] =
-- let (k , k≤last , q) = find-min' {p} m e m ≤-refl
-- in (k , ≤-trans k≤last (suc≤⇒≤ m last l) , q)
-- find-min : ∀{p : ℕ → 𝔹} → ∀ n → p n ≡ true → (∃ λ k → k ≤ n × p k ≡ true)
-- find-min {p} n pt = find-min' {p} n pt n ≤-refl
-- min-terminate : ∀{p : ℕ → 𝔹} → ∀ n (e : p n ≡ true) (m : ℕ) → m ≤ n → ∃ λ k → μ p ↓ k
-- min-terminate {p} last pt zero m≤n with p 0 | inspect p 0
-- min-terminate {p} last pt zero m≤n | false | e = {!!} , {!!}
-- min-terminate {p} last pt zero m≤n | true | e = {!!}
-- min-terminate {p} last pt (suc m) m≤n = {!!}
-- lem : ∀{p : ℕ → 𝔹} → ∀ n → p n ≡ true → ∃ λ k → μ p ↓ k
-- lem {p} zero q with p 0 | inspect p 0
-- lem {p} zero () | false | _
-- lem {p} zero q | true | [ e ] = (0 , now (cong (c p 0) e))
-- lem {p} (suc n) q with p (suc n) | inspect p (suc n)
-- lem {p} (suc n) () | false | e
-- lem {p} (suc n) q | true | e =
-- let (k , t) = lem n {!!}
-- in (suc n , now {!!})
-- μ-correct : Correctness
-- μ-correct q n pt = q (lem n pt)
|
programs/oeis/085/A085538.asm | neoneye/loda | 22 | 171718 | <gh_stars>10-100
; A085538: a(n) = n^5 - n^4.
; 0,0,16,162,768,2500,6480,14406,28672,52488,90000,146410,228096,342732,499408,708750,983040,1336336,1784592,2345778,3040000,3889620,4919376,6156502,7630848,9375000,11424400,13817466,16595712,19803868,23490000,27705630,32505856,37949472,44099088,51021250,58786560,67469796,77150032,87910758,99840000,113030440,127579536,143589642,161168128,180427500,201485520,224465326,249495552,276710448,306250000,338260050,372892416,410305012,450661968,494133750,540897280,591136056,645040272,702806938,764640000,830750460,901356496,976683582,1056964608,1142440000,1233357840,1329973986,1432552192,1541364228,1656690000,1778817670,1908043776,2044673352,2189020048,2341406250,2502163200,2671631116,2850159312,3038106318,3235840000,3443737680,3662186256,3891582322,4132332288,4384852500,4649569360,4926919446,5217349632,5521317208,5839290000,6171746490,6519175936,6882078492,7260965328,7656358750,8068792320,8498810976,8946971152,9413840898
mov $1,$0
sub $0,1
pow $1,4
mul $0,$1
|
timers/div_resets_timer_overflow/main.asm | AntonioND/gbc-hw-tests | 6 | 4999 |
INCLUDE "hardware.inc"
INCLUDE "header.inc"
SECTION "var",BSS
ram_ptr: DS 2
repeat_loop: DS 1
SECTION "Main",HOME
;--------------------------------------------------------------------------
;- Main() -
;--------------------------------------------------------------------------
Main:
ld hl,$A000
ld a,[Init_Reg_A]
cp a,$11
jr nz,.skipchange1
ld a,0
ld [repeat_loop],a
call CPU_slow
.skipchange1:
repeat_all:
; -------------------------------------------------------
ld a,$0A
ld [$0000],a ; enable ram
ld a,0
ld [rTMA],a
ld [rIF],a
ld [rDIV],a
ld [rTIMA],a
ld [rDIV],a
ld a,TACF_STOP|TACF_65KHZ
ld [rTAC],a
ld a,TACF_START|TACF_65KHZ
ld [rTAC],a
jp Main2
; -------------------------------------------------------
; -------------------------------------------------------
SECTION "Main2",ROMX
Main2:
REPETITIONS_1 SET 0
REPT 20
REPETITIONS_2 SET 0
REPT 20
xor a,a
ld [rIF],a
ld a,$FE
ld [rDIV],a
ld [rTIMA],a
REPT REPETITIONS_1
nop
ENDR
ld a,0
ld [rDIV],a
REPT REPETITIONS_2
nop
ENDR
ld a,[rTIMA]
ld [hl+],a
ld a,[rIF]
and a,IEF_TIMER
ld [hl+],a
REPETITIONS_2 SET REPETITIONS_2+1
ENDR
REPETITIONS_1 SET REPETITIONS_1+1
ENDR
; -------------------------------------------------------
push hl ; magic number
ld [hl],$12
inc hl
ld [hl],$34
inc hl
ld [hl],$56
inc hl
ld [hl],$78
pop hl
ld a,$00
ld [$0000],a ; disable ram
; -------------------------------------------------------
ld a,[Init_Reg_A]
cp a,$11
jr nz,.skipchange2
ld a,[repeat_loop]
and a,a
jr nz,.endloop
; -------------------------------------------------------
call CPU_fast
ld a,1
ld [repeat_loop],a
jp repeat_all
.skipchange2:
.endloop:
halt
jr .endloop
|
src/apsepp-test_reporter_class-stub-create.adb | thierr26/ada-apsepp | 0 | 15555 | -- Copyright (C) 2019 <NAME> <<EMAIL>>
-- MIT license. Please refer to the LICENSE file.
function Apsepp.Test_Reporter_Class.Stub.Create return Test_Reporter_Stub is
begin
return (Test_Reporter_Interfa with null record);
end Apsepp.Test_Reporter_Class.Stub.Create;
|
multibytedecsum.asm | adey99/8085asmcodes | 0 | 172505 | <reponame>adey99/8085asmcodes
// SUM OF A SERIES OF MULTIBYTE DECIMAL NUMBERS
# ORG 2400H
# BEGIN 2400H
LDA COUNTER
MOV B,A
LXI D,2601
LOOP: LXI H,SIZE
MOV C,M
LXI H,SUM
ORA A
BACK: LDAX D
ADC M
DAA
MOV M,A
INX D
INX H
DCR C
JNZ BACK
DCR B
JNZ LOOP
HLT
// COUNT FOR THE LENGTH OF SERIES
# ORG 2500H
# COUNTER: DB 03H
// COUNT FOR THE NUMBER OF BYTES PLACED IN THE MEMORY LOCATION
# ORG 2501H
# SIZE: DB 05H
// 1ST NUMBER TO BE ADDED = 0024568945
#ORG 2601H
# DB 45H,89H,56H,24H,00H
// 2ND NUMBER TO BE ADDED = 0054863564
#ORG 2606H
# DB 64H,35H,86H,54H,00H
// 3RD NUMBER TO BE ADDED = 0032718907
#ORG 260BH
# DB 07H,89H,71H,32H,00H
// WHERE ANSWER SUM WILL BE STORED
#ORG 2800
# SUM: DB 00H,00H,00H,00H,00H
// ANSWER
// 0024568945
// +0054863564
// +0032718907
// ---------------------
// 0112151416
|
oeis/175/A175484.asm | neoneye/loda-programs | 11 | 23169 | <filename>oeis/175/A175484.asm<gh_stars>10-100
; A175484: a(n) = (1/2)*(A175482(n)+A175483(n)).
; Submitted by <NAME>(w2)
; 5,13,9,11,17,13,25,23,37,15,41,17,25,53,21,39,65,33,21,47,77,37,51,23,85,29,27,59,97,45,25,101,27,113,71,121,57,41,133,137,45,33,35,69,157,43,99,73,33,39,181,185,57,85,193,51,119,35,123,93,55,131,217,221,37,45
seq $0,175461 ; Semiprimes of form 8n+5.
seq $0,3415 ; a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(mn) = m*a(n) + n*a(m).
div $0,2
|
alloy4fun_models/trashltl/models/4/zytxdLjwPKhk6MnYZ.als | Kaixi26/org.alloytools.alloy | 0 | 5327 | open main
pred idzytxdLjwPKhk6MnYZ_prop5 {
eventually (some f : File | File' = File - f)
}
pred __repair { idzytxdLjwPKhk6MnYZ_prop5 }
check __repair { idzytxdLjwPKhk6MnYZ_prop5 <=> prop5o } |
programs/oeis/103/A103454.asm | karttu/loda | 1 | 87597 | <gh_stars>1-10
; A103454: a(n) = 0^n + 4^n - 1.
; 1,3,15,63,255,1023,4095,16383,65535,262143,1048575,4194303,16777215,67108863,268435455,1073741823,4294967295,17179869183,68719476735,274877906943,1099511627775,4398046511103,17592186044415,70368744177663,281474976710655,1125899906842623,4503599627370495
mov $1,4
pow $1,$0
trn $1,2
add $1,1
|
uuu/src/apps/games/boxed_in/level.asm | ekscrypto/Unununium | 7 | 10774 | <reponame>ekscrypto/Unununium
;IN: esi=pointer to compressed level data
; OUT: edi=pointer to decompressed level data
Set_level_up:
mov ecx,18 * 14
xor edx,edx
externfunc mem.alloc
mov DWORD [pleveldata],edi
mov ecx,18 * 14
xor edx,edx
externfunc mem.alloc
mov DWORD [plastmove],edi
retn
Unpack_level:
mov eax,[CurrentLevel]
mov ebx , ((18*14) / 2)
mul ebx
mov esi , level_data
add esi , eax
mov edi , dword [pleveldata]
mov ecx,(18 * 14) / 2
.unpack_byte:
mov al,[esi]
shr al,4
mov [edi + 0],al
mov al,[esi]
and al,1111b
mov [edi + 1],al
inc esi
add edi,2
loop .unpack_byte
call NumberBoxesSet
push ecx
call NumberTargets
pop eax
add eax,ecx
mov [NumberToSet],al
mov DWORD [NumberMoves],0
ClearScreen:
mov edi,0xA0000
mov eax,0xFFFFFFFF
mov ecx,(320 * 200) / 4
rep stosd
DrawTitle:
mov esi,BoxedIn
mov edi,0xA0000 + 125
mov al,11
externfunc gfx.render.13h.string
ClearLastMove:
mov esi,[plastmove]
mov DWORD [esi],0xFFFFFFFF
DrawLevelNumber:
mov eax,[CurrentLevel]
inc eax
aam
add ax,0x3030
rol ax,8
mov [LevelNumber + 7],ax
mov esi,LevelNumber
mov edi,0xA0000 + (320 * 186) + 200
mov al,11
externfunc gfx.render.13h.string
call DrawMoveNumber
ret
SaveMove:
pushad
mov esi,[pleveldata]
mov edi,[plastmove]
mov ecx,(18 * 14) / 4
rep movsd
popad
ret
RestoreLastMove:
mov esi,[plastmove]
cmp DWORD [esi],0xFFFFFFFF
je EndRestoreLastMove
dec DWORD [NumberMoves]
mov edi,[pleveldata]
xor edx,edx
mov ecx,(18 * 14)
RestoreTile:
mov al,[esi]
mov [edi],al
inc edx
inc esi
inc edi
cmp al,PLAYER_EMPTY
je CalcNewPlayerPos
loop RestoreTile
jmp EndRestoreLastMove
CalcNewPlayerPos:
call CalculatePlayerPosition
dec ecx
jmp RestoreTile
EndRestoreLastMove:
mov esi,[plastmove]
mov DWORD [esi],0xFFFFFFFF
ret
DrawMoveNumber:
mov esi,BlankString
mov edi,0xA0000 + (320 * 186) + 20
mov al,255
externfunc gfx.render.13h.string
mov DWORD [MoveNumber + 6],'0000'
mov eax,[NumberMoves]
mov ebx,10
mov edi,MoveNumber + 9
NextDigit:
xor edx,edx
div ebx
add dl,0x30
mov [edi],dl
dec edi
cmp eax,0
jnz NextDigit
mov esi,MoveNumber
mov edi,0xA0000 + (320 * 186) + 20
mov al,11
externfunc gfx.render.13h.string
ret
NumberBoxesSet:
mov esi,[pleveldata]
xor ecx,ecx
xor edx,edx
TestForSetBox:
mov al,[esi]
inc esi
cmp edx,(18 * 14)
je EndTestForSetBox
inc edx
cmp al,SET
jne TestForSetBox
inc ecx
jmp TestForSetBox
EndTestForSetBox:
ret
NumberTargets:
mov esi,[pleveldata]
xor ecx,ecx
xor edx,edx
TestForTarget:
mov al,[esi]
inc esi
cmp edx,(18 * 14)
je EndTestForTarget
inc edx
cmp al,PLAYER_EMPTY
je PlayerFound
cmp al,TARGET
jne TestForTarget
inc ecx
jmp TestForTarget
PlayerFound:
call CalculatePlayerPosition
jmp TestForTarget
EndTestForTarget:
ret
CalculatePlayerPosition:
pushad
mov eax,edx
dec eax
xor edx,edx
mov ebx,18
div ebx
mov DWORD [PlayerX],edx
mov DWORD [PlayerY],eax
popad
ret
Draw_level:
mov ebp,[pleveldata]
mov edi,0xA0000 + (16 * 320) + 52
mov edx,14
.next_row:
push edi
mov ecx,18
.draw_row:
push edi
push ecx
.draw_square:
xor eax,eax
mov al,[ebp]
inc ebp
mov ebx,144
push edx
mul ebx
pop edx
mov esi,eax
add esi,square_gfx
mov ecx,12
.draw_line:
push ecx
mov ecx,12
.draw_pixel:
movsb
loop .draw_pixel
add edi,308
pop ecx
loop .draw_line
pop ecx
pop edi
add edi,12
loop .draw_row
pop edi
add edi,3840
dec edx
jnz .next_row
ret
;variables
pleveldata : dd 0
plastmove: DD 0
temp: dd 0
LevelNumber: DB 'Level: 00',0
BlankString: DB 219,219,219,219,219,219,219,219,219,219,0
MoveNumber: DB 'Move: 0000',0
BoxedIn: DB 'Boxed In!',0
level_data :
%include "levels.inc"
|
AntlrLetterCaseBenchmark/CaseInsensitiveGrammar.g4 | KvanTTT/AntlrBenchmarks | 2 | 7139 | lexer grammar CaseInsensitiveGrammar;
WORD: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z;
WS: [ \t\r\n]+ -> channel(HIDDEN);
fragment A: [aA];
fragment B: [bB];
fragment C: [cC];
fragment D: [dD];
fragment E: [eE];
fragment F: [fF];
fragment G: [gG];
fragment H: [hH];
fragment I: [iI];
fragment J: [jJ];
fragment K: [kK];
fragment L: [lL];
fragment M: [mM];
fragment N: [nN];
fragment O: [oO];
fragment P: [pP];
fragment Q: [qQ];
fragment R: [rR];
fragment S: [sS];
fragment T: [tT];
fragment U: [uU];
fragment V: [vV];
fragment W: [wW];
fragment X: [xX];
fragment Y: [yY];
fragment Z: [zZ]; |
archive/agda-3/src/Oscar/Class/[ExtensibleType].agda | m0davis/oscar | 0 | 6480 |
open import Oscar.Prelude
module Oscar.Class.[ExtensibleType] where
record [ExtensibleType]
{𝔵} {𝔛 : Ø 𝔵}
{𝔟} {𝔒₂ : 𝔛 → Ø 𝔟}
{ℓ̇} (_↦_ : ∀ {x} → 𝔒₂ x → 𝔒₂ x → Ø ℓ̇)
: Ø₀ where
constructor ∁
no-eta-equality
|
programs/oeis/298/A298028.asm | karttu/loda | 1 | 9371 | ; A298028: Coordination sequence of Dual(3.6.3.6) tiling with respect to a trivalent node.
; 1,3,12,9,24,15,36,21,48,27,60,33,72,39,84,45,96,51,108,57,120,63,132,69,144,75,156,81,168,87,180,93,192,99,204,105,216,111,228,117,240,123,252,129,264,135,276,141,288,147,300,153,312,159,324,165,336,171,348,177,360,183,372,189,384,195,396,201,408,207,420,213,432,219,444,225,456,231,468,237,480,243,492,249,504,255,516,261,528,267,540,273,552,279,564,285,576,291,588,297,600,303,612,309,624,315,636,321,648,327,660,333,672,339,684,345,696,351,708,357,720,363,732,369,744,375,756,381,768,387,780,393,792,399,804,405,816,411,828,417,840,423,852,429,864,435,876,441,888,447,900,453,912,459,924,465,936,471,948,477,960,483,972,489,984,495,996,501,1008,507,1020,513,1032,519,1044,525,1056,531,1068,537,1080,543,1092,549,1104,555,1116,561,1128,567,1140,573,1152,579,1164,585,1176,591,1188,597,1200,603,1212,609,1224,615,1236,621,1248,627,1260,633,1272,639,1284,645,1296,651,1308,657,1320,663,1332,669,1344,675,1356,681,1368,687,1380,693,1392,699,1404,705,1416,711,1428,717,1440,723,1452,729,1464,735,1476,741,1488,747
mov $1,$0
gcd $0,2
mul $1,6
mul $1,$0
trn $1,2
div $1,2
add $1,1
|
oeis/083/A083577.asm | neoneye/loda-programs | 11 | 242329 | ; A083577: Prime star numbers.
; Submitted by <NAME>
; 13,37,73,181,337,433,541,661,937,1093,2053,2281,2521,3037,3313,5581,5953,6337,6733,7561,7993,8893,10333,10837,11353,12421,12973,13537,15913,18481,20533,21961,25741,27337,32413,33301,36037,36973,42841,44893,46993,52453,54721,57037,60601,61813,65521,68053,69337,71941,75937,82837,87121,91513,93001,96013,100621,102181,105337,108541,110161,113437,123553,132313,137713,139537,146953,152641,156493,164341,170353,178537,182701,191173,206461,213193,215461,222337,229321,238801,243613,248473,253381,258337
mov $2,332202
lpb $2
mov $3,$5
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,12
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,18
add $5,$1
lpe
mov $0,$5
add $0,1
|
Relatorios/Tarefa 07/Resolucao/codigo/programa12.asm | RafaelAmauri/Arquitetura-de-Computadores-2 | 0 | 22963 | ori $t0, $zero, 0x1001
sll $t0, $t0, 16
sw $t0, 0($t0)
ori $t1, $zero, 0x1001
sll $t1, $t1, 16
ori $t1, $t1, 0x004
sw $t1, 0($t1)
ori $t2, $zero, 0x1001
sll $t2 $t2, 16
ori $t2, $t2, 0x0008
sw $t2, 0($t2)
or $s0, $zero, $t2
|
third_party/antlr_grammars_v4/powerbuilderdw/PowerBuilderDWLexer.g4 | mikhan808/rsyntaxtextarea-antlr4-extension | 2 | 4753 | /*
BSD License
Copyright (c) 2020, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of Tom Everett 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.
*/
lexer grammar PowerBuilderDWLexer;
// Keywords
TABLE: 'TABLE';
COLUMN: 'COLUMN';
RETRIEVE: 'RETRIEVE';
PBSELECT: 'PBSELECT';
VERSION: 'VERSION';
ARGUMENTS: 'ARGUMENTS';
SORT: 'SORT';
ANY: 'ANY';
BLOB: 'BLOB';
BOOLEAN: 'BOOLEAN';
BYTE: 'BYTE';
CHARACTER: 'CHARACTER';
CHAR: 'CHAR';
DATE_TYPE: 'DATE';
DATETIME: 'DATETIME';
DECIMAL: 'DECIMAL';
DEC: 'DEC';
DOUBLE: 'DOUBLE';
INTEGER: 'INTEGER';
INT: 'INT';
LONG: 'LONG';
LONGLONG: 'LONGLONG';
REAL: 'REAL';
STRING: 'STRING';
TIME_TYPE: 'TIME';
UNSIGNEDINTEGER: 'UNSIGNEDINTEGER';
UINT: 'UINT';
UNSIGNEDLONG: 'UNSIGNEDLONG';
ULONG: 'ULONG';
WINDOW: 'WINDOW';
TRUE: 'TRUE';
FALSE: 'FALSE';
GLOBAL: 'GLOBAL';
SHARED: 'SHARED';
END: 'END';
INDIRECT : 'INDIRECT';
VARIABLES: 'VARIABLES';
FORWARD: 'FORWARD';
PUBLIC: 'PUBLIC';
PRIVATE: 'PRIVATE';
FUNCTION: 'FUNCTION';
SUBROUTINE: 'SUBROUTINE';
READONLY: 'READONLY';
PROTOTYPES: 'PROTOTYPES';
TYPE: 'TYPE';
ON: 'ON';
TO: 'TO';
FROM: 'FROM';
REF: 'REF';
NULL: 'NULL';
UPDATE: 'UPDATE';
CASE: 'CASE';
DYNAMIC: 'DYNAMIC';
WITHIN: 'WITHIN';
PRIVATEWRITE: 'PRIVATEWRITE';
PROTECTED: 'PROTECTED';
PRIVATEREAD: 'PRIVATEREAD';
PROTECTEDREAD: 'PROTECTEDREAD';
PROTECTEDWRITE: 'PROTECTEDWRITE';
LOCAL: 'LOCAL';
EVENT: 'EVENT';
OPEN: 'OPEN';
GOTO: 'GOTO';
ELSE: 'ELSE';
IF: 'IF';
THEN: 'THEN';
ELSEIF: 'ELSEIF';
TRY: 'TRY';
EXIT: 'EXIT';
CHOOSE: 'CHOOSE';
IS: 'IS';
CONTINUE: 'CONTINUE';
DO: 'DO';
WHILE: 'WHILE';
FOR: 'FOR';
CLOSE: 'CLOSE';
NEXT: 'NEXT';
LOOP: 'LOOP';
UNTIL: 'UNTIL';
STEP: 'STEP';
CATCH: 'CATCH';
FINALLY: 'FINALLY';
THROW: 'THROW';
RELEASE: 'RELEASE';
CREATE: 'CREATE';
DESTROY: 'DESTROY';
USING: 'USING';
POST: 'POST';
TRIGGER: 'TRIGGER';
SELECT: 'SELECT';
DELETE: 'DELETE';
INSERT: 'INSERT';
DESCRIBE: 'DESCRIBE';
RETURN: 'RETURN';
OR: 'OR';
AND: 'AND';
NOT: 'NOT';
CALL: 'CALL';
HALT: 'HALT';
SUPER: 'SUPER';
LIBRARY: 'LIBRARY';
SYSTEM: 'SYSTEM';
RPCFUNC: 'RPCFUNC';
ALIAS: 'ALIAS';
THROWS: 'THROWS';
AUTOINSTANTIATE: 'AUTOINSTANTIATE';
DESCRIPTOR: 'DESCRIPTOR';
// Operators
EQ: '=';
GT: '>';
GTE: '>=';
LT: '<';
LTE: '<=';
GTLT: '<>';
PLUS: '+';
MINUS: '-';
PLUSEQ: '+=';
MINUSEQ: '-=';
COLONCOLON: '::';
MULT: '*';
DIV: '/';
MULTEQ: '*=';
DIVEQ: '/=';
CARAT: '^';
LCURLY: '{';
RCURLY: '}';
LBRACE: '[';
RBRACE: ']';
BRACES: '[]';
TICK: '`';
DQUOTED_STRING: '"' ('~~' | ~'"' | '~"')* '"';
QUOTED_STRING: '\'' (~'\'' | '~\'')* '\'';
COMMA: ',';
SEMI: ';';
LPAREN: '(';
RPAREN: ')';
COLON: ':';
DQUOTE: '"';
TQ: '???';
DOUBLE_PIPE: '||';
DOTDOTDOT: '...';
// Literals
NUMBER: (NUM '.' NUM | '.' NUM | NUM) ('E' ('+' | '-')? NUM)? ('D' | 'F')?;
DOT: '.';
DATE: DIGIT DIGIT DIGIT DIGIT '-' DIGIT DIGIT '-' DIGIT DIGIT;
TIME: DIGIT DIGIT ':' DIGIT DIGIT ':' DIGIT DIGIT (':' DIGIT DIGIT DIGIT DIGIT DIGIT DIGIT)?;
BINDPAR: ':' ID_PARTS;
EXPORT_HEADER: '$' LETTER ((LETTER | DIGIT | '-' | '#' | '%' | '_'))* '$' (LETTER | DIGIT | '.' | ' ' | '_')+ ~[\r\n];
ENUM: ID_PARTS '!';
ID: ID_PARTS;
RET_LIT: RETRIEVE EQ DQUOTED_STRING;
ARGS_LIT: ARGUMENTS EQ LPAREN LPAREN .+? RPAREN RPAREN ;
SORT_LIT: SORT EQ DQUOTED_STRING;
// Hidden
LINE_CONTINUATION: '&' WS* [\r\n] -> channel(HIDDEN);
SL_COMMENT: '//' ~ [\r\n]* -> channel(HIDDEN);
ML_COMMENT: '/*' .*? '*/' -> channel(HIDDEN);
WS: [ \t\r\n]+ -> channel(HIDDEN);
// Fragments
fragment ID_PARTS
: [A-Z] ([A-Z] | DIGIT | '-' | '$' | '#' | '%' | '_')*
;
fragment NUM
: DIGIT+
;
fragment DIGIT
: '0' .. '9'
;
fragment LETTER
: 'A' .. 'Z'
; |
test/asset/agda-stdlib-1.0/Data/List/Relation/Subset/Setoid/Properties.agda | omega12345/agda-mode | 0 | 12975 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- This module is DEPRECATED. Please use
-- Data.List.Relation.Binary.Subset.Setoid.Properties directly.
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.Relation.Subset.Setoid.Properties where
open import Data.List.Relation.Binary.Subset.Setoid.Properties public
|
programs/oeis/208/A208665.asm | karttu/loda | 0 | 164918 | <filename>programs/oeis/208/A208665.asm<gh_stars>0
; A208665: Numbers that match odd ternary polynomials; see Comments.
; 3,6,27,30,33,54,57,60,243,246,249,270,273,276,297,300,303,486,489,492,513,516,519,540,543,546,2187,2190,2193,2214,2217,2220,2241,2244,2247,2430,2433,2436,2457,2460,2463,2484,2487,2490,2673,2676,2679
mov $3,$0
add $3,1
mov $4,$0
lpb $3,1
mov $0,$4
sub $3,1
sub $0,$3
add $0,1
pow $0,2
mov $5,59049
gcd $5,$0
mov $2,$5
div $2,8
mul $2,18
add $2,3
add $1,$2
lpe
|
data/maps/objects/GameCorner.asm | opiter09/ASM-Machina | 1 | 244590 | <reponame>opiter09/ASM-Machina<filename>data/maps/objects/GameCorner.asm
GameCorner_Object:
db $f ; border block
def_warps
warp 15, 17, 7, LAST_MAP
warp 16, 17, 7, LAST_MAP
warp 17, 4, 1, ROCKET_HIDEOUT_B1F
def_signs
sign 9, 4, 12 ; CeladonGameCornerText12
def_objects
object SPRITE_BEAUTY, 2, 6, STAY, DOWN, 1 ; person
object SPRITE_CLERK, 5, 6, STAY, DOWN, 2 ; person
object SPRITE_MIDDLE_AGED_MAN, 2, 10, STAY, LEFT, 3 ; person
object SPRITE_BEAUTY, 2, 13, STAY, LEFT, 4 ; person
object SPRITE_FISHING_GURU, 5, 11, STAY, RIGHT, 5 ; person
object SPRITE_MIDDLE_AGED_WOMAN, 8, 11, STAY, LEFT, 6 ; person
object SPRITE_GYM_GUIDE, 8, 14, STAY, LEFT, 7 ; person
object SPRITE_GAMBLER, 11, 15, STAY, RIGHT, 8 ; person
object SPRITE_CLERK, 14, 11, STAY, LEFT, 9 ; person
object SPRITE_GENTLEMAN, 17, 13, STAY, RIGHT, 10 ; person
object SPRITE_ROCKET, 9, 5, STAY, UP, 11, OPP_ROCKET, 7
def_warps_to GAME_CORNER
|
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/named_block.adb | ouankou/rose | 488 | 522 |
procedure Named_Block is
begin
TheBlock: declare
type IntArray is array(1..2) of Integer;
ia : IntArray := (others => 0);
begin
null;
end TheBlock;
end Named_Block;
|
data/mapHeaders/RockTunnel1F.asm | AmateurPanda92/pokemon-rby-dx | 9 | 14789 | <gh_stars>1-10
RockTunnel1F_h:
db CAVERN ; tileset
db ROCK_TUNNEL_1F_HEIGHT, ROCK_TUNNEL_1F_WIDTH ; dimensions (y, x)
dw RockTunnel1F_Blocks ; blocks
dw RockTunnel1F_TextPointers ; texts
dw RockTunnel1F_Script ; scripts
db 0 ; connections
dw RockTunnel1F_Object ; objects
|
src/sysvar.asm | lantange/Pure64 | 366 | 160010 | <reponame>lantange/Pure64
; =============================================================================
; Pure64 -- a 64-bit OS/software loader written in Assembly for x86-64 systems
; Copyright (C) 2008-2020 Return Infinity -- see LICENSE.TXT
;
; System Variables
; =============================================================================
message: db 10, 'Pure64 OK', 10
;CONFIG
cfg_smpinit: db 1 ; By default SMP is enabled. Set to 0 to disable.
; Memory locations
E820Map: equ 0x0000000000004000
InfoMap: equ 0x0000000000005000
SystemVariables: equ 0x0000000000005A00
VBEModeInfoBlock: equ 0x0000000000005C00 ; 256 bytes
; DQ - Starting at offset 0, increments by 0x8
os_ACPITableAddress: equ SystemVariables + 0x00
os_LocalX2APICAddress: equ SystemVariables + 0x10
os_Counter_Timer: equ SystemVariables + 0x18
os_Counter_RTC: equ SystemVariables + 0x20
os_LocalAPICAddress: equ SystemVariables + 0x28
os_IOAPICAddress: equ SystemVariables + 0x30
os_HPETAddress: equ SystemVariables + 0x38
; DD - Starting at offset 128, increments by 4
os_BSP: equ SystemVariables + 128
mem_amount: equ SystemVariables + 132 ; in MiB
; DW - Starting at offset 256, increments by 2
cpu_speed: equ SystemVariables + 256
cpu_activated: equ SystemVariables + 258
cpu_detected: equ SystemVariables + 260
; DB - Starting at offset 384, increments by 1
os_IOAPICCount: equ SystemVariables + 384
align 16
GDTR32: ; Global Descriptors Table Register
dw gdt32_end - gdt32 - 1 ; limit of GDT (size minus one)
dq gdt32 ; linear address of GDT
align 16
gdt32:
dw 0x0000, 0x0000, 0x0000, 0x0000 ; Null desciptor
dw 0xFFFF, 0x0000, 0x9A00, 0x00CF ; 32-bit code descriptor
dw 0xFFFF, 0x0000, 0x9200, 0x00CF ; 32-bit data descriptor
gdt32_end:
; -----------------------------------------------------------------------------
align 16
GDTR64: ; Global Descriptors Table Register
dw gdt64_end - gdt64 - 1 ; limit of GDT (size minus one)
dq 0x0000000000001000 ; linear address of GDT
gdt64: ; This structure is copied to 0x0000000000001000
SYS64_NULL_SEL equ $-gdt64 ; Null Segment
dq 0x0000000000000000
SYS64_CODE_SEL equ $-gdt64 ; Code segment, read/execute, nonconforming
dq 0x0020980000000000 ; 0x00209A0000000000
SYS64_DATA_SEL equ $-gdt64 ; Data segment, read/write, expand down
dq 0x0000900000000000 ; 0x0020920000000000
gdt64_end:
IDTR64: ; Interrupt Descriptor Table Register
dw 256*16-1 ; limit of IDT (size minus one) (4096 bytes - 1)
dq 0x0000000000000000 ; linear address of IDT
; -----------------------------------------------------------------------------
; VESA
; Mandatory information for all VBE revisions
VBEModeInfoBlock.ModeAttributes equ VBEModeInfoBlock + 0 ; DW - mode attributes
VBEModeInfoBlock.WinAAttributes equ VBEModeInfoBlock + 2 ; DB - window A attributes
VBEModeInfoBlock.WinBAttributes equ VBEModeInfoBlock + 3 ; DB - window B attributes
VBEModeInfoBlock.WinGranularity equ VBEModeInfoBlock + 4 ; DW - window granularity in KB
VBEModeInfoBlock.WinSize equ VBEModeInfoBlock + 6 ; DW - window size in KB
VBEModeInfoBlock.WinASegment equ VBEModeInfoBlock + 8 ; DW - window A start segment
VBEModeInfoBlock.WinBSegment equ VBEModeInfoBlock + 10 ; DW - window B start segment
VBEModeInfoBlock.WinFuncPtr equ VBEModeInfoBlock + 12 ; DD - real mode pointer to window function
VBEModeInfoBlock.BytesPerScanLine equ VBEModeInfoBlock + 16 ; DW - bytes per scan line
; Mandatory information for VBE 1.2 and above
VBEModeInfoBlock.XResolution equ VBEModeInfoBlock + 18 ; DW - horizontal resolution in pixels or characters
VBEModeInfoBlock.YResolution equ VBEModeInfoBlock + 20 ; DW - vertical resolution in pixels or characters
VBEModeInfoBlock.XCharSize equ VBEModeInfoBlock + 22 ; DB - character cell width in pixels
VBEModeInfoBlock.YCharSize equ VBEModeInfoBlock + 23 ; DB - character cell height in pixels
VBEModeInfoBlock.NumberOfPlanes equ VBEModeInfoBlock + 24 ; DB - number of memory planes
VBEModeInfoBlock.BitsPerPixel equ VBEModeInfoBlock + 25 ; DB - bits per pixel
VBEModeInfoBlock.NumberOfBanks equ VBEModeInfoBlock + 26 ; DB - number of banks
VBEModeInfoBlock.MemoryModel equ VBEModeInfoBlock + 27 ; DB - memory model type
VBEModeInfoBlock.BankSize equ VBEModeInfoBlock + 28 ; DB - bank size in KB
VBEModeInfoBlock.NumberOfImagePages equ VBEModeInfoBlock + 29 ; DB - number of image pages
VBEModeInfoBlock.Reserved equ VBEModeInfoBlock + 30 ; DB - reserved (0x00 for VBE 1.0-2.0, 0x01 for VBE 3.0)
; Direct Color fields (required for direct/6 and YUV/7 memory models)
VBEModeInfoBlock.RedMaskSize equ VBEModeInfoBlock + 31 ; DB - size of direct color red mask in bits
VBEModeInfoBlock.RedFieldPosition equ VBEModeInfoBlock + 32 ; DB - bit position of lsb of red mask
VBEModeInfoBlock.GreenMaskSize equ VBEModeInfoBlock + 33 ; DB - size of direct color green mask in bits
VBEModeInfoBlock.GreenFieldPosition equ VBEModeInfoBlock + 34 ; DB - bit position of lsb of green mask
VBEModeInfoBlock.BlueMaskSize equ VBEModeInfoBlock + 35 ; DB - size of direct color blue mask in bits
VBEModeInfoBlock.BlueFieldPosition equ VBEModeInfoBlock + 36 ; DB - bit position of lsb of blue mask
VBEModeInfoBlock.RsvdMaskSize equ VBEModeInfoBlock + 37 ; DB - size of direct color reserved mask in bits
VBEModeInfoBlock.RsvdFieldPosition equ VBEModeInfoBlock + 38 ; DB - bit position of lsb of reserved mask
VBEModeInfoBlock.DirectColorModeInfo equ VBEModeInfoBlock + 39 ; DB - direct color mode attributes
; Mandatory information for VBE 2.0 and above
VBEModeInfoBlock.PhysBasePtr equ VBEModeInfoBlock + 40 ; DD - physical address for flat memory frame buffer
VBEModeInfoBlock.Reserved1 equ VBEModeInfoBlock + 44 ; DD - Reserved - always set to 0
VBEModeInfoBlock.Reserved2 equ VBEModeInfoBlock + 48 ; DD - Reserved - always set to 0
; =============================================================================
; EOF
|
data/pokemon/base_stats/starmie.asm | AtmaBuster/pokeplat-gen2 | 6 | 104664 | db 0 ; species ID placeholder
db 60, 75, 85, 115, 100, 85
; hp atk def spd sat sdf
db WATER, PSYCHIC ; type
db 60 ; catch rate
db 207 ; base exp
db STARDUST, STAR_PIECE ; items
db GENDER_UNKNOWN ; gender ratio
db 20 ; step cycles to hatch
INCBIN "gfx/pokemon/starmie/front.dimensions"
db GROWTH_SLOW ; growth rate
dn EGG_WATER_3, EGG_WATER_3 ; egg groups
db 70 ; happiness
; tm/hm learnset
tmhm WATER_PULSE, TOXIC, HAIL, HIDDEN_POWER, ICE_BEAM, BLIZZARD, HYPER_BEAM, LIGHT_SCREEN, PROTECT, RAIN_DANCE, FRUSTRATION, THUNDERBOLT, THUNDER, RETURN, PSYCHIC_M, DOUBLE_TEAM, REFLECT, FACADE, SECRET_POWER, REST, SKILL_SWAP, BRINE, ENDURE, RECYCLE, GIGA_IMPACT, FLASH, AVALANCHE, THUNDER_WAVE, GYRO_BALL, PSYCH_UP, SLEEP_TALK, NATURAL_GIFT, DREAM_EATER, GRASS_KNOT, SWAGGER, SUBSTITUTE, FLASH_CANNON, TRICK_ROOM, SURF, WATERFALL, DIVE, ICY_WIND, ROLLOUT, SIGNAL_BEAM, SNORE, SWIFT, TRICK, TWISTER
; end
|
contrib/ayacc/src/ayacc-initialize.adb | faelys/gela-asis | 4 | 17019 | <reponame>faelys/gela-asis
-- $Header: /cf/ua/arcadia/alex-ayacc/ayacc/src/RCS/ayacc_separates.a,v 1.1 88/08/08 12:07:39 arcadia Exp $
-- Copyright (c) 1990 Regents of the University of California.
-- All rights reserved.
--
-- The primary authors of ayacc were <NAME> and <NAME>.
-- Enhancements were made by <NAME>.
--
-- Send requests for ayacc information to <EMAIL>
-- Send bug reports for ayacc to <EMAIL>
--
-- Redistribution and use in source and binary forms are permitted
-- provided that the above copyright notice and this paragraph are
-- duplicated in all such forms and that any documentation,
-- advertising materials, and other materials related to such
-- distribution and use acknowledge that the software was developed
-- by the University of California, Irvine. The name of the
-- University may not be used to endorse or promote products derived
-- from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-- Module : ayacc_separates.ada
-- Component of : ayacc
-- Version : 1.2
-- Date : 11/21/86 12:28:51
-- SCCS File : disk21~/rschm/hasee/sccs/ayacc/sccs/sxayacc_separates.ada
-- $Header: /cf/ua/arcadia/alex-ayacc/ayacc/src/RCS/ayacc_separates.a,v 1.1 88/08/08 12:07:39 arcadia Exp $
-- $Log: ayacc_separates.a,v $
--Revision 1.1 88/08/08 12:07:39 arcadia
--Initial revision
--
-- Revision 0.0 86/02/19 18:36:14 ada
--
-- These files comprise the initial version of Ayacc
-- designed and implemented by <NAME> and <NAME>.
-- Ayacc has been compiled and tested under the Verdix Ada compiler
-- version 4.06 on a vax 11/750 running Unix 4.2BSD.
--
-- Revision 0.1 88/03/16
-- Additional argument added to allow user to specify file extension
-- to be used for generated Ada files. -- kn
with String_Pkg; use String_Pkg;
separate (Ayacc)
procedure Initialize is
use Ayacc_File_Names, Options;
Input_File, Extension, Options : String_Type := Create ("");
type Switch is ( On , Off );
C_Lex_Flag,
Debug_Flag,
Summary_Flag,
-- UMASS CODES :
Error_Recovery_Flag,
-- END OF UMASS CODES.
Verbose_Flag : Switch;
Invalid_Command_Line : exception;
procedure Get_Arguments (File : out String_Type;
C_Lex : out Switch;
Debug : out Switch;
Summary : out Switch;
Verbose : out Switch;
-- UMASS CODES :
Error_Recovery : out Switch;
-- END OF UMASS CODES.
Extension : out String_Type) is separate;
begin
Get_Arguments (Input_File,
C_Lex_Flag,
Debug_Flag,
Summary_Flag,
Verbose_Flag,
-- UMASS CODES :
Error_Recovery_Flag,
-- END OF UMASS CODES.
Extension);
New_Line;
Put_Line (" Ayacc (File => """ & Value (Input_File) & """,");
Put_Line (" C_Lex => " &
Value (Mixed (Switch'Image(C_Lex_Flag))) & ',');
Put_Line (" Debug => " &
Value (Mixed (Switch'Image(Debug_Flag))) & ',');
Put_Line (" Summary => " &
Value (Mixed (Switch'Image(Summary_Flag))) & ',');
Put_Line (" Verbose => " &
Value (Mixed (Switch'Image(Verbose_Flag))) & ",");
-- UMASS CODES :
Put_Line (" Error_Recovery => " &
Value (Mixed (Switch'Image(Error_Recovery_Flag))) & ");");
-- END OF UMASS CODES.
New_Line;
if C_Lex_Flag = On then
Options := Options & Create ("i");
end if;
if Debug_Flag = On then
Options := Options & Create ("d");
end if;
if Summary_Flag = On then
Options := Options & Create ("s");
end if;
if Verbose_Flag = On then
Options := Options & Create ("v");
end if;
-- UMASS CODES :
if Error_Recovery_Flag = On then
Options := Options & Create ("e");
end if;
-- END OF UMASS CODES.
Set_File_Names (Value (Input_File), Value(Extension));
Set_Options (Value (Options));
exception
when Invalid_Command_Line =>
raise Illegal_Argument_List;
end Initialize;
|
programs/oeis/100/A100040.asm | karttu/loda | 0 | 102631 | <gh_stars>0
; A100040: a(n) = 2*n^2 + n - 5.
; -5,-2,5,16,31,50,73,100,131,166,205,248,295,346,401,460,523,590,661,736,815,898,985,1076,1171,1270,1373,1480,1591,1706,1825,1948,2075,2206,2341,2480,2623,2770,2921,3076,3235,3398,3565,3736,3911,4090,4273,4460,4651,4846,5045,5248,5455,5666,5881,6100,6323,6550,6781,7016,7255,7498,7745,7996,8251,8510,8773,9040,9311,9586,9865,10148,10435,10726,11021,11320,11623,11930,12241,12556,12875,13198,13525,13856,14191,14530,14873,15220,15571,15926,16285,16648,17015,17386,17761,18140,18523,18910,19301,19696,20095,20498,20905,21316,21731,22150,22573,23000,23431,23866,24305,24748,25195,25646,26101,26560,27023,27490,27961,28436,28915,29398,29885,30376,30871,31370,31873,32380,32891,33406,33925,34448,34975,35506,36041,36580,37123,37670,38221,38776,39335,39898,40465,41036,41611,42190,42773,43360,43951,44546,45145,45748,46355,46966,47581,48200,48823,49450,50081,50716,51355,51998,52645,53296,53951,54610,55273,55940,56611,57286,57965,58648,59335,60026,60721,61420,62123,62830,63541,64256,64975,65698,66425,67156,67891,68630,69373,70120,70871,71626,72385,73148,73915,74686,75461,76240,77023,77810,78601,79396,80195,80998,81805,82616,83431,84250,85073,85900,86731,87566,88405,89248,90095,90946,91801,92660,93523,94390,95261,96136,97015,97898,98785,99676,100571,101470,102373,103280,104191,105106,106025,106948,107875,108806,109741,110680,111623,112570,113521,114476,115435,116398,117365,118336,119311,120290,121273,122260,123251,124246
mul $0,2
add $0,1
bin $0,2
sub $0,5
mov $1,$0
|
02-Tooling/03-revealing-anchors.applescript | Rolias/discover-applescript | 0 | 3841 | <filename>02-Tooling/03-revealing-anchors.applescript
tell application "System Preferences"
activate
set savedDelimiter to AppleScript's text item delimiters
set AppleScript's text item delimiters to linefeed
set the current pane to pane "Displays"
set anchorNames to name of every anchor of current pane
log anchorNames as text
reveal anchor "displaysArrangementTab" of current pane
set AppleScript's text item delimiters to savedDelimiter
end tell |
libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_VRAMmemset.asm | jpoikela/z88dk | 640 | 99004 | <filename>libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_VRAMmemset.asm
; void SMS_VRAMmemset(unsigned int dst,unsigned char value,unsigned int size)
SECTION code_clib
SECTION code_SMSlib
PUBLIC _SMS_VRAMmemset
EXTERN asm_SMSlib_VRAMmemset
_SMS_VRAMmemset:
pop af
pop hl
dec sp
pop de
pop bc
push bc
push de
inc sp
push hl
push af
ld e,d
jp asm_SMSlib_VRAMmemset
|
oeis/146/A146313.asm | neoneye/loda-programs | 11 | 18605 | <reponame>neoneye/loda-programs<gh_stars>10-100
; A146313: a(n) = cosh( (2n - 1)*arcsinh(sqrt(2)) )^2 = 1 - cos( (2n - 1)*arcsin(sqrt(3)) )^2.
; Submitted by <NAME>
; 3,243,23763,2328483,228167523,22358088723,2190864527283,214682365584963,21036680962799043,2061380051988721203,201994208413931878803,19793371044513335401443,1939548368153892937462563,190055946708036994535929683,18623543229019471571583646323,1824917180497200177020661409923,178823260145496597876453234526083,17522854577078169391715396322146163,1717060925293515103790232386335797843,168254447824187402002051058464586042403,16487218825845071881097213497143096357603
mov $3,1
lpb $0
sub $0,1
mov $1,$3
mul $1,8
add $2,$1
add $3,$2
lpe
pow $3,2
mov $0,$3
mul $0,3
|
source/server/ada_lsp-contexts.ads | reznikmm/ada_lsp | 11 | 22113 | <filename>source/server/ada_lsp-contexts.ads
-- Copyright (c) 2017 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Ada.Containers.Hashed_Maps;
with Ada.Containers.Doubly_Linked_Lists;
with League.Strings.Hash;
with LSP.Messages;
with Incr.Lexers.Incremental;
with Incr.Nodes;
with Incr.Parsers.Incremental;
with Ada_LSP.Ada_Lexers;
with Ada_LSP.Ada_Parser_Data;
with Ada_LSP.Completions;
with Ada_LSP.Documents;
package Ada_LSP.Contexts is
type Context is tagged limited private;
not overriding procedure Initialize
(Self : in out Context;
Root : League.Strings.Universal_String);
not overriding procedure Load_Document
(Self : in out Context;
Item : LSP.Messages.TextDocumentItem);
not overriding function Get_Document
(Self : Context;
URI : LSP.Messages.DocumentUri)
return Ada_LSP.Documents.Document_Access;
not overriding procedure Update_Document
(Self : in out Context;
Item : not null Ada_LSP.Documents.Document_Access);
-- Reparse document after changes
not overriding procedure Add_Completion_Handler
(Self : in out Context;
Value : not null Ada_LSP.Completions.Handler_Access);
not overriding procedure Fill_Completions
(Self : Context;
Context : Ada_LSP.Completions.Context'Class;
Result : in out LSP.Messages.CompletionList);
not overriding function Get_Parser_Data_Provider
(Self : Context) return Ada_LSP.Ada_Parser_Data.Provider_Access;
private
package Document_Maps is new Ada.Containers.Hashed_Maps
(Key_Type => LSP.Messages.DocumentUri,
Element_Type => Ada_LSP.Documents.Document_Access,
Hash => League.Strings.Hash,
Equivalent_Keys => League.Strings."=",
"=" => Ada_LSP.Documents."=");
type Kind_Map is array (Incr.Nodes.Node_Kind range <>) of Boolean;
type Provider is new Ada_LSP.Ada_Parser_Data.Provider with record
Is_Defining_Name : Kind_Map (108 .. 120);
end record;
overriding function Is_Defining_Name
(Self : Provider;
Kind : Incr.Nodes.Node_Kind) return Boolean;
package Completion_Handler_Lists is new Ada.Containers.Doubly_Linked_Lists
(Ada_LSP.Completions.Handler_Access, Ada_LSP.Completions."=");
type Context is tagged limited record
Root : League.Strings.Universal_String;
Documents : Document_Maps.Map;
Batch_Lexer : aliased Ada_LSP.Ada_Lexers.Batch_Lexer;
Incr_Lexer : aliased Incr.Lexers.Incremental.Incremental_Lexer;
Incr_Parser : aliased Incr.Parsers.Incremental.Incremental_Parser;
Provider : aliased Ada_LSP.Contexts.Provider;
Completions : Completion_Handler_Lists.List;
end record;
end Ada_LSP.Contexts;
|
oeis/037/A037732.asm | neoneye/loda-programs | 11 | 87301 | ; A037732: Base 6 digits are, in order, the first n terms of the periodic sequence with initial period 2,1,0,3.
; Submitted by <NAME>
; 2,13,78,471,2828,16969,101814,610887,3665324,21991945,131951670,791710023,4750260140,28501560841,171009365046,1026056190279,6156337141676,36938022850057,221628137100342,1329768822602055
mov $2,2
lpb $0
sub $0,1
add $1,$2
mul $1,6
add $2,19
mod $2,4
lpe
add $1,$2
mov $0,$1
|
get_VM_name.applescript | mikeiacovacci/focus | 2 | 908 | tell application "VMware Fusion"
activate
end tell
tell application "System Events"
set frontAppProcess to first application process whose frontmost is true
end tell
tell frontAppProcess
if (count of windows) > 0 then
set window_name to name of front window
end if
end tell
|
MSDOS/Virus.MSDOS.Unknown.ninja_1.asm | fengjixuchui/Family | 3 | 97824 | <gh_stars>1-10
;NINJA virus v1.1 _sandoz_
;I dont believe that NINJA scans, it was developed from Soviet block virus
;code that was aquired late in 1988. For this reason some features are missing
;such as original encryption, which really wont be missed. However some features
;are rather unique. used were System Violator's Virus Mutator and some luck.
;an oldie but interesting.
cseg segment
assume cs:cseg, ds:cseg, es:cseg, ss:cseg
org 100h
l_0100: mov bx,offset l_0146 ;0100.BB 0146
jmp bx ;Register jump ;0103 FF E3
;-------victim code----------------------------------------------
; ...
org 0146h
;=======virus code begin=========================================
; in resident virus this code begins at 9000h:0A000h
;----------------------------------------------------------------
l_0146: push ds ;<- Entry into virus ;0146 1E
push es ;0147 06
push ax ;0148 50
NOP
push ds ;<-victim code restore ;0149 1E
pop es ;014A 07
mov si,bx ;offset wejscia w wirusa;014B 8B F3
add si,02D3h ;(419)changed code saved;014D.81 C6 02D3
mov di,0100h ;changed code address ;0151.BF 0100
mov cx,5 ;length of change ;0154 B9 0005
rep movsb ;0157 F3/ A4
push ds ;0159 1E
xor ax,ax ;<- get int 8 ;015A 31 C0
push ax ;015C 50
pop ds ;015D 1F
mov si,20h ;int 8h ;015E.BE 0020
mov di,bx ;0161 8B FB
add di,0E6h ;(022Ch)=old int 8 ;0163.81 C7 00E6
mov cx,4 ;0167 B9 0004
rep movsb ;016A F3/ A4
mov ax,bx ;016C 8B C3
add ax,57h ;(019Dh)=continuat. adr.;016E 05 0057
call s_0193 ;0171 E8 001F
pop ds ;0174 1F
l_0175: jmp short l_0175 ;int 8 waiting loop ;0175 EB FE
;<----- return after int 8 service-------------------------------
l_0177: cli ;<- int 8 vector restore;0177 FA
xor ax,ax ;0178 31 C0
mov es,ax ;017A 8E C0
mov di,0020h ;017C.BF 20 00
mov si,bx ;017F 8B F3
add si,0E9h ;(022Ch) ;0181.81 C6 E6 00
mov cx,4 ;0185 B9 04 00
repz movsb ;0188 F3 / A4
sti ;018A FB
NOP
pop ax ;<- run victim programm ;018B 58
pop es ;018C 07
pop ds ;018D 1F
mov bx,0100h ;execution begin address;018E.BB 00 01
jmp bx ;0191 FF E3
;<----- "get int 8" routine -------------------------------------
s_0193 proc near
cli ; Disable interrupts ;0193 FA
mov ds:[20h],ax ;0194 A3 0020
mov ds:[22h],es ;0197 8C 06 0022
sti ; Enable interrupts ;019B FB
retn ;019C C3
s_0193 endp
;<----- code executed after interrupt int 8----------------------
l_019D: pushf ;019D 9C
push ax ;019E 50
push bx ;019F 53
push cx ;01A0 51
push dx ;01A1 52
push si ;01A2 56
push di ;01A3 57
push es ;01A4 06
push ds ;01A5 1E
push bp ;01A6 55
mov bp,sp ;01A7 8B EC
mov ax,bx ;base to virus code ;01A9 8B C3
add ax,2Fh ;(175h) ;01AB 05 002F
cmp ss:[bp+14h],ax ;interrupted code CS seg;01AE 36 39 46 14
jnz l_0220 ;-> we must wait again ;01B2 75 6C
l_01B4: add word ptr ss:[BP+14],3 ;chng ret addr to l_0177;01B4 36 83 46 14 03
;<- restore int 8 vector
push ds ;02B9 1E
xor ax,ax ;01BA 31 C0
push ax ;01BC 50
POP DS ;01BD 1F
CLI ;01BE FA
MOV AX,cs:[BX+00E6h] ;(022Ch) old int 8 vect ;01BF 2E 8B 87 E6 00
MOV ds:[20h],AX ;01C4 A3 20 00
MOV AX,cs:[BX+00E8h] ;01C7 2E 8B 87 E8 00
MOV ds:[22h],AX ;01CC A3 22 00
POP DS ;01CF 1F
MOV AX,9000h ;memory last 64KB ;01D0 B8 00 90
MOV ES,AX ;01D3 8E C0
MOV SI,BX ;virus code begin ;01D5 8B F3
MOV DI,0A000h ;the last 24KB of mem ;01D7 BF 00 A0
MOV AL,es:[DI] ;01DA 26 8A 05
CMP AL,1Eh ;allready installed ? ;01DD 3C 1E
JZ l_0220 ;-> yes, end of job ;01DF 74 3F
MOV CX,02FBh ;virus code length ;01E1 B9 FB 02
REPZ MOVSB ;copy virus code ;01E4 F3 / A4
;<- Make link to DOS
CALL s_0230 ;first DOS version ;01E6 E8 47 00
JZ l_0220 ;-> O.K. ;01E9 74 35
CALL s_027D ;Second DOS version ;01EB E8 8F 00
JZ l_0220 ;-> O.K. ;01EE 74 30
CALL s_02CA ;third DOS version ;01F0 E8 D7 00
JZ l_0220 ;-> O.K. ;01F3 74 2B
;<- Unknown DOS version, BRUTE installation
MOV AX,9000h ;01F5 B8 00 90
PUSH AX ;01F8 50
POP ES ;01F9 07
XOR AX,AX ;01FA 31 C0
PUSH AX ;01FC 50
POP DS ;01FD 1F
MOV AX,ds:[84h] ;01FE A1 84 00
MOV es:[0A1DFh],AX ;(0325) ;0201 26 A3 DF A1
MOV es:[0A2CEh],AX ;(0414) ;0205 26 A3 CE A2
MOV AX,ds:[86h] ;0209 A1 86 00
MOV es:[0A1E1h],AX ;(0327) ;020C 26 A3 E1 A1
MOV es:[0A2D0h],AX ;(0416) ;0210 26 A3 D0 A2
MOV AX,0A1D1h ;(0317) new int 21h hndl;0214 B8 D1 A1
MOV ds:[84h],AX ;int 21h ;0217 A3 84 00
MOV AX,9000h ;resident virus segment ;021A B8 00 90
MOV ds:[86h],AX ;021D A3 86 00
l_0220: pop bp ;0220 5D
pop ds ;0221 1F
pop es ;0221 07
pop di ;0222 5F
pop si ;0223 5E
pop dx ;0224 5A
pop cx ;0226 59
pop bx ;0227 5B
pop ax ;0228 58
popf ;0229 9D
sti ;022A FB
db 0EAh ;022B EA
r_00E6 db 0ABh,00h,0C2h,0Bh ;022C AB 00 C2 0B
; jmp 0BC2:00AB ;-> oryginal int 8
;================================================================
; Make link to DOS - first DOS version
;----------------------------------------------------------------
s_0230: PUSH DS ;0230 1E
PUSH ES ;0231 06
XOR AX,AX ;<- check possibility ;0232 31 C0
PUSH AX ;0234 50
POP DS ;0235 1F
MOV AX,ds:[86h] ;oryginal int 21h seg ;0236 A1 86 00
PUSH AX ;0239 50
POP DS ;023A 1F
MOV BX,0100h ;023B BB 00 01
CMP BYTE PTR [BX],0E9h ;023E 80 3F E9
JNZ l_027A ;-> unknown system ;0241 75 37
INC BX ;0243 43
CMP BYTE PTR [BX],53h ;0244 80 3F 53
JNZ l_027A ;-> unknown system ;0247 75 31
INC BX ;0249 43
CMP BYTE PTR [BX],22h ;024A 80 3F 22
JNZ l_027A ;-> unknown system ;024D 75 2B
;<- make link to DOS
MOV AX,9000h ;024F B8 00 90
MOV ES,AX ;0252 8E C0
MOV SI,1223h ;0254 BE 23 12
MOV DI,0A2CEh ;(0414) ;0257 BF CE A2
MOV CX,4 ;025A B9 04 00
REPZ MOVSB ;025D F3 / A4
MOV SI,1223h ;025F BE 23 12
MOV DI,0A1DFh ;(0325) ;0262 BF DF A1
MOV CX,4 ;0265 B9 04 00
REPZ MOVSB ;0268 F3 / A4
MOV AX,0A1D1h ;(0317)=new int 21h hndl;026A B8 D1 A1
MOV ds:[1223h],AX ;026D A3 23 12
MOV AX,9000h ;0270 B8 00 90
MOV ds:[1225h],AX ;0273 A3 25 12
XOR AX,AX ;0276 31 C0
CMP AL,AH ;0278 38 E0
l_027A: pop es ;027A 07
pop ds ;027B 1F
retn ;027C C3
;================================================================
; Make link to DOS - second DOS version
;----------------------------------------------------------------
s_027D: push ds ;027D 1E
push es ;027E 06
xor ax,ax ;<- check possibility ;027F 31 C0
push ax ;0281 50
pop ds ;0282 1F
mov ax,ds:[86h] ;oryginal int 21h seg ;0283 A1 0086
push ax ;0286 50
pop ds ;0287 1F
mov bx,0100h ;0288 .BB 0100
cmp byte ptr [bx],0E9h ;028B 80 3F E9
jne l_02C7 ;-> unknown system ;028E 75 37
inc bx ;0290 43
cmp byte ptr [bx],0CAh ;0291 80 3F CA
jne l_02C7 ;-> unknown system ;0294 75 31
inc bx ;0296 43
cmp byte ptr [bx],13h ;0297 80 3F 13
jne l_02C7 ;-> unknown system ;029A 75 2B
;<- make link to DOS
mov ax,9000h ;029C B8 9000
mov es,ax ;029F 8E C0
mov si,011Dh ;02A1 .BE 011D
mov di,0A2CEh ;(0414) ;02A4 .BF A2CE
mov cx,4 ;02A7 B9 0004
rep movsb ;02AA F3/ A4
mov si,011Dh ;02AC .BE 011D
mov di,0A1DFh ;(0325) ;02AF .BF A1DF
mov cx,4 ;02B2 B9 0004
rep movsb ;02B5 F3/ A4
mov ax,0A1D1h ;(0317)=new int 21h hndl;02B7 B8 A1D1
mov ds:[011Dh],ax ;02BA A3 011D
mov ax,9000h ;02BD B8 9000
mov ds:[011Fh],ax ;02C0 A3 011F
xor ax,ax ;02C3 31 C0
cmp al,ah ;02C5 38 E0
l_02C7: pop es ;02C7 07
pop ds ;02C8 1F
retn ;02C9 C3
;===============================================================
; Make link to DOS - third DOS version
;---------------------------------------------------------------
s_02CA: push ds ;02CA 1E
push es ;02CB 06
xor ax,ax ;<- check possibility ;02CC 31 C0
push ax ;02CE 50
pop ds ;02CF 1F
mov ax,ds:[86h] ;oryginal int 21h seg ;02D0 A1 0086
push ax ;02D3 50
pop ds ;02D4 1F
mov bx,100h ;02D5 .BB 0100
cmp byte ptr [bx],0E9h ;02D8 80 3F E9
jne l_0314 ;-> unknown system ;02DB 75 37
inc bx ;02DD 43
cmp byte ptr [bx],15h ;02DE 80 3F 15
jne l_0314 ;-> unknown system ;02E1 75 31
inc bx ;02E3 43
cmp byte ptr [bx],5 ;02E4 80 3F 05
jne l_0314 ;-> unknown system ;02E7 75 2B
;<- make link to DOS
mov ax,9000h ;02E9 B8 9000
mov es,ax ;02EC 8E C0
mov si,0040Fh ;02EE .BE 040F
mov di,0A2CEh ;(0414) ;02F1 .BF A2CE
mov cx,4 ;02F4 B9 0004
rep movsb ;02F7 F3/ A4
mov si,0040Fh ;02F9 .BE 040F
mov di,0A1DFh ;(0325) ;02FC .BF A1DF
mov cx,4 ;02FF B9 0004
rep movsb ;0302 F3/ A4
mov ax,0A1D1h ;(0317)=new int 21h hndl;0304 B8 A1D1
mov ds:[040Fh],ax ;0307 A3 040F
mov ax,9000h ;030A B8 9000
mov ds:[0411h],ax ;030D A3 0411
xor ax,ax ;0310 31 C0
cmp al,ah ;0312 38 E0
l_0314: pop es ;0314 07
pop ds ;0315 1F
retn ;0316 C3
;==========================================================================
; New int 21h handling subroutine
;--------------------------------------------------------------------------
T_A1D1: cmp ah,3Dh ;open file ? ;0317 80 FC 3D
je l_0321 ;-> Yes ;031A 74 05
cmp ah,4Bh ;load&execute/load ovl ?;031C 80 FC 4B
jne l_0324 ;-> No ;031F 75 03
l_0321: call s_0329 ;-> infect file ;0321 E8 0005
l_0324: db 0EAh ;<- oryginal int 21h ;0324 EA
d_A1DF dw 1460h,0273h ;old int 21h ;0325 60 14 73 02
; jmp far ptr 0273:1460
;==========================================================================
; Infecting subroutine
;--------------------------------------------------------------------------
s_0329 proc near
push ax ;0329 50
push bx ;032A 53
push cx ;032B 51
push dx ;032C 52
push ds ;032D 1E
push di ;032E 57
push si ;032F 56
push es ;0330 06
push ds ;0331 1E
push es ;0332 06
NOP
xor ax,ax ;<- get int 24h ;0333 31 C0
push ax ;0335 50
pop ds ;0336 1F
push cs ;0337 0E
pop es ;0338 07
mov si,90h ;int 24h vector ;0339 .BE 0090
mov di,0A2E0h ;(0426)-old vector safes;033C .BF A2E0
mov cx,4 ;double word ;033F B9 0004
rep movsb ;0342 F3/ A4
mov ax,0A2C9h ;(040F)=new int 24h ;0344 B8 A2C9
mov ds:[90h],ax ;0347 A3 0090
mov ds:[92h],cs ;034A 8C 0E 0092
NOP
pop es ;034E 07
pop ds ;034F 1F
mov di,dx ;file path ;0350 8B FA
push ds ;0352 1E
pop es ;0353 07
mov cx,40h ;find dot ;0354 B9 0040
mov al,2Eh ;0357 B0 2E
repne scasb ;0359 F2/ AE
cmp cx,0 ;035B 83 F9 00
jne l_0363 ;035E 75 03
jmp l_0406 ;-> no file extension ;0360 E9 00A3
l_0363: push cs ;0363 0E
pop es ;0364 07
mov si,di ;0365 8B F7
mov di,0A2DDh ;(0423)='COM' ;0367 .BF A2DD
mov cx,3 ;036A B9 0003
repe cmpsb ;036D F3/ A6
cmp cx,0 ;036F 83 F9 00
je l_0377 ;0372 74 03
jmp l_0406 ;-> it isn't *.COM ;0374 E9 008F
;<- *.COM file infection
l_0377: mov ax,4300h ;Get file attributes ;0377 B8 4300
call s_0412 ;int 21h call ;037A E8 0095
mov ds:[0A2E4h],cx ;(042A) ;037D 89 0E A2E4
and cx,0FFFEh ;no R/O ;0381 81 E1 FFFE
mov ax,4301h ;Set file attributes ;0385 B8 4301
call s_0412 ;int 21h call ;0388 E8 0087
mov ah,3Dh ;Open File ;038B B4 3D
mov al,2 ;R/W access ;038D B0 02
call s_0412 ;int 21h call ;038F E8 0080
jc l_0406 ;-> Opening Error ;0392 72 72
push cs ;0394 0E
pop ds ;0395 1F
mov bx,ax ;file handle ;0396 8B D8
mov dx,0A2D3h ;(0419) = file buffer ;0398 BA A2D3
mov cx,5 ;bytes count ;039B B9 0005
mov ah,3Fh ;read file ;039E B4 3F
call s_0412 ;int 21h call ;03A0 E8 006F
mov ah,0BBh ;allready infected ? ;03A3 B4 BB
cmp ah,ds:[0A2D3h] ;(0419) ;03A5 3A 26 A2D3
je l_03E2 ;-> yes, close file ;03A9 74 37
xor cx,cx ;03AB 31 C9
xor dx,dx ;03AD 31 D2
mov ah,42h ;Move file ptr ;03AF B4 42
mov al,2 ;EOF + offset ;03B1 B0 02
call s_0412 ;int 21h call ;03B3 E8 005C
cmp ax,0FA00h ;file size =<64000 ;03B6 3D FA00
ja l_03E2 ;-> above, close file ;03B9 77 27
add ax,100h ;PSP length ;03BB 05 0100
mov ds:[0A2D9h],ax ;(041F) - vir.begin addr;03BE A3 A2D9
mov ah,40h ;Write file ;03C1 B4 40
mov dx,0A000h ;address of buffer ;03C3 BA A000
mov cx,2FBh ;bytes count ;03C6 B9 02FB
call s_0412 ;int 21h call ;03C9 E8 0046
xor cx,cx ;03CC 31 C9
xor dx,dx ;03CE 31 D2
mov ah,42h ;Move file ptr ;03D0 B4 42
mov al,0 ;BOF + offset ;03D2 B0 00
call s_0412 ;int 21h call ;03D4 E8 003B
mov ah,40h ;Write file ;03D7 B4 40
mov dx,0A2D8h ;(041E)=BOF virus code ;03D9 BA A2D8
mov cx,5 ;code length ;03DC B9 0005
call s_0412 ;int 21h call ;03DF E8 0030
l_03E2: mov ah,3Eh ;close file ;03E2 B4 3E
call s_0412 ;int 21h call ;03E4 E8 002B
mov cx,ds:[0A2E4h] ;(042A) - old atribute ;03E7 8B 0E A2E4
mov ax,4301h ;set file attributes ;03EB B8 4301
call s_0412 ;int 21h call ;03EE E8 0021
push ds ;03F1 1E
push es ;03F2 06
xor ax,ax ;restore int 24h vector ;03F3 31 C0
push ax ;03F5 50
pop es ;03F6 07
push cs ;03F7 0E
pop ds ;03F8 1F
mov di,90h ;int 24h vector ;03F9 .BF 0090
mov si,0A2E0h ;(0426) - old int 24h ;03FC .BE A2E0
mov cx,4 ;double word ;03FF B9 0004
rep movsb ;0402 F3/ A4
pop es ;0404 07
pop ds ;0405 1F
l_0406: pop es ;<- EXIT ;0406 07
pop si ;0407 5E
pop di ;0408 5F
pop ds ;0409 1F
pop dx ;040A 5A
pop cx ;040B 59
pop bx ;040C 5B
pop ax ;040D 58
retn ;040E C3
s_0329 endp
;================================================================
; int 24h handling routine (only infection time)
;----------------------------------------------------------------
T_A2C9: mov al,0 ;ignore critical error ;040F B0 00
iret ;0411 CF
;================================================================
; hidden int 21h call
;----------------------------------------------------------------
s_0412 proc near
pushf ;0412 9C
db 9Ah ;0413 9A
d_A2CE dw 1460h,0273h ;old int 21h ;0414 60 14 73 02
;call far ptr 0273:1460
retn ;0418 C3
s_0412 endp
;<----- oryginal BOF code
d_A2D3 db 31h,0Dh,0Ah,32h,0Dh ;0419 31 0D 0A 32 0D
;<----- wirus BOF code
d_A2D8 db 0BBh ;041E BB
d_A2D9 dw 0146h ;virus begin address ;041F 46 01
dw 0E3FFh ;0421 FF E3
;<----- work bytes
d_A2DD db 'COM' ;file extension pattern ;0423 43 4F 4D
d_A2E0 dw 0556h,1232h ;old int 24h vector ;0426 56 05 32 12
d_A2E4 dw 0 ;file attributes ;042A 00 00
;<----- just my way of sayin' howdy
db '-=NINJA=- <sandoz 1993>' ;042C 50 43 2D 46 4C 55
; 20 62 79 20 57 49
; 5A 41 52 44 20 31
; 39 39 31
cseg ends
end l_0100
|
libraries/xsprites/spritemanager.asm | paulscottrobson/cerberus-2080 | 1 | 14051 | <reponame>paulscottrobson/cerberus-2080
; *********************************************************************************************
; *********************************************************************************************
;
; Name: spritemanager.asm
; Purpose: Sprite Manager
; Created: 1st November 2021
; Author: <NAME> (<EMAIL>)
;
; *********************************************************************************************
; *********************************************************************************************
;
; Sprite Record:
;
; Current Data: (as per xsprite.asm)
; 0..6 X:2 Y:2 Graphics:2 Control:1
; 7 Status byte
; To Copy data:
; 8..14 X:2 Y:2 Graphics:2 Control:1
; 15 Change flag
;
; When being updated, if the change flag is set, then the sprite is removed, then data
; (8-14) is copied to (0-6), then the sprite redrawn
;
; The option also exists to erase all sprites ; the point of such being that one can update
; the background. This sets all the change flags so the sprites are redrawn on the next sync.
;
; *********************************************************************************************
;
;
; Reset Sprite Manager. HL points to data block, DE is number of sprites
;
;
; *********************************************************************************************
;; [CALL] SPR.RESET
SPMReset:
push af
push bc
push de
push hl
ld (SPMData),hl ; save count and address
ld a,e
ld (SPMCount),a
add a,a ; double, as we clear it twice (2 x 8 byte blocks)
ld b,a
_SPMClear:
ld c,6 ; write out 6 $FFs to position and graphic
_SPMClear2:
ld (hl),$FF
inc hl
dec c
jr nz,_SPMClear2
ld (hl),c ; followed by 2 zeros (control and status/change byte)
inc hl
ld (hl),c
inc hl
djnz _SPMClear
ld hl,SPMUnused ; no current selection
ld (SPMCurrent),hl
call SPRInitialise ; erase the sprite control records.
pop hl
pop de
pop bc
pop af
ret
;; [END]
; *********************************************************************************************
;
; Sprite functions/words. A sprite is selected via SPMSelect and then moved, graphics
; set etc. by other functions. SPMUpdate updates all sprites. Parameters at L/HL then DE.
;
; *********************************************************************************************
;; [CALL] SPR.SELECT
SPMSelect:
push af
push bc
push hl
ld a,(SPMCount)
cp l ; compare max vs selected.
jr z,_SPMSFail ; must be >
jp m,_SPMSFail
add hl,hl ; x 16
add hl,hl
add hl,hl
add hl,hl
ld de,(SPMData) ; add base address
add hl,de
jr _SPMSExit ; write and exit
_SPMSFail:
ld hl,SPMUnused
_SPMSExit:
ld (SPMCurrent),hl
pop hl
pop de
pop af
ret
;; [END]
; *********************************************************************************************
;
; X Y SPR.MOVE
;
; *********************************************************************************************
;; [CALL] SPR.MOVE
SPMMove:
push ix
ld ix,(SPMCurrent)
ld (ix+8),e ; write X
ld (ix+9),d
ld (ix+10),l ; write Y
ld (ix+11),h
_SPMGeneralExit:
set 7,(ix+15)
pop ix
ret
;;[END]
; *********************************************************************************************
;
; GDATA SPR.IMAGE
;
; *********************************************************************************************
;; [CALL] SPR.IMAGE
SPRImage:
push ix
ld ix,(SPMCurrent)
ld (ix+12),l
ld (ix+13),h
jr _SPMGeneralExit
;; [END]
; *********************************************************************************************
;
; CBYTE SPR.CONTROL
;
; *********************************************************************************************
;; [CALL] SPR.CONTROL
SPMControl:
push ix
ld ix,(SPMCurrent)
ld (ix+14),l
jr _SPMGeneralExit
;; [END]
; *********************************************************************************************
;
; <bool> SPR.VFLIP / HFLIP
;
; *********************************************************************************************
;; [CALL] SPR.HFLIP
SPMHFlip:
push af
push ix
ld ix,(SPMCurrent)
res 5,(ix+14)
ld a,l
or h
jr z,_SPCTExit
set 5,(ix+14)
jr _SPCTExit
;; [END]
;; [CALL] SPR.VFLIP
SPMVFlip:
push af
push ix
ld ix,(SPMCurrent)
res 6,(ix+14)
ld a,l
or h
jr z,_SPCTExit
set 7,(ix+14)
_SPCTExit:
set 7,(ix+15)
pop ix
pop af
ret
;; [END]
; *********************************************************************************************
;
; Update all sprites
;
; *********************************************************************************************
;; [CALL] SPR.UPDATE
SPMUpdate:
push af
push bc
push de
push hl
push ix
ld a,(SPMCount)
ld b,a
ld ix,(SPMData)
_SPMUpdateLoop:
ld a,(ix+15) ; check redraw flag
or a
call nz,_SPMUpdateOne ; if non zero update this one
ld de,16
add ix,de
djnz _SPMUpdateLoop
pop ix
pop hl
pop bc
pop de
pop af
ret
;
; Updates one sprite from new data if redraw flag found set.
;
_SPMUpdateOne:
push bc
ld (ix+15),0 ; clear the redraw flag.
call SpriteXErase ; erase sprite
push ix ; copy target address in DE
pop de
ld hl,8
add hl,de ; target DE, source HL
ld bc,7 ; copy 7 bytes over
ldir
call SpriteXDraw ; redraw sprite
pop bc
ret
;; [END]
; *********************************************************************************************
;
; Hide all sprites (to change background)
;
; *********************************************************************************************
;; [CALL] SPR.HIDE.ALL
SPMHideAll:
push af
push bc
push de
push ix
ld a,(SPMCount)
ld b,a
ld ix,(SPMData)
ld de,16
_SPMHideLoop:
call SpriteXErase ; remove sprite
set 7,(ix+15) ; force redraw next update
add ix,de
djnz _SPMHideLoop
pop hl
pop bc
pop de
pop af
ret
;; [END]
SPMData: ; address of sprite
.dw 0
SPMCount: ; number of sprites
.dw 0
SPMCurrent: ; currently selected sprite (may point to unused junk space)
.dw 0
SPMUnused: ; space for junk writes.
.ds 16,0
|
src/base/log/util-log-appenders-consoles.ads | RREE/ada-util | 60 | 4711 | -----------------------------------------------------------------------
-- util-log-appenders-consoles -- Console log appenders
-- Copyright (C) 2001 - 2019, 2021 <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.
-----------------------------------------------------------------------
-- Write log events to the console.
package Util.Log.Appenders.Consoles is
type Console_Appender (Length : Positive) is new Appender with private;
type Console_Appender_Access is access all Console_Appender'Class;
overriding
procedure Append (Self : in out Console_Appender;
Message : in Util.Strings.Builders.Builder;
Date : in Ada.Calendar.Time;
Level : in Level_Type;
Logger : in String);
-- Flush the log events.
overriding
procedure Flush (Self : in out Console_Appender);
-- Create a console appender and configure it according to the properties
function Create (Name : in String;
Properties : in Util.Properties.Manager;
Default : in Level_Type)
return Appender_Access;
private
type Console_Appender (Length : Positive) is new Appender (Length) with record
Stderr : Boolean := False;
Prefix : Util.Properties.Value;
end record;
end Util.Log.Appenders.Consoles;
|
experiments/test-suite/mutation-based/20/6/dll.als | kaiyuanw/AlloyFLCore | 1 | 2140 | pred test21 {
some disj DLL0: DLL {some disj Node0, Node1: Node {
DLL = DLL0
header = DLL0->Node1
Node = Node0 + Node1
no pre
nxt = Node1->Node0
elem = Node0->-1 + Node1->-1
UniqueElem[]
}}
}
run test21 for 3 expect 0
pred test46 {
some disj DLL0: DLL {some disj Node0, Node1: Node {
DLL = DLL0
header = DLL0->Node1
Node = Node0 + Node1
no pre
nxt = Node0->Node1 + Node1->Node0
elem = Node0->-7 + Node1->-8
}}
}
run test46 for 3 expect 0
pred test41 {
some disj DLL0: DLL {some disj Node0, Node1, Node2: Node {
DLL = DLL0
header = DLL0->Node2
Node = Node0 + Node1 + Node2
pre = Node0->Node0
nxt = Node1->Node0 + Node2->Node1
elem = Node0->-2 + Node1->-7 + Node2->-8
RepOk[]
}}
}
run test41 for 3 expect 0
pred test10 {
some disj DLL0: DLL {some disj Node0, Node1: Node {
DLL = DLL0
header = DLL0->Node1
Node = Node0 + Node1
no pre
nxt = Node1->Node0
elem = Node0->5 + Node1->6
}}
}
run test10 for 3 expect 1
pred test33 {
some disj DLL0: DLL {some disj Node0, Node1: Node {
DLL = DLL0
header = DLL0->Node1
Node = Node0 + Node1
pre = Node0->Node0
nxt = Node1->Node0
elem = Node0->-7 + Node1->-8
ConsistentPreAndNxt[]
}}
}
run test33 for 3 expect 0
pred test2 {
some disj DLL0, DLL1: DLL {some disj Node0, Node1, Node2: Node {
DLL = DLL0 + DLL1
header = DLL1->Node2
Node = Node0 + Node1 + Node2
no pre
nxt = Node0->Node1 + Node2->Node0
elem = Node0->6 + Node1->5 + Node2->0
}}
}
run test2 for 3 expect 0
pred test1 {
no DLL
no header
no Node
no pre
no nxt
no elem
}
run test1 for 3 expect 0
pred test31 {
some disj DLL0: DLL {some disj Node0, Node1, Node2: Node {
DLL = DLL0
header = DLL0->Node2
Node = Node0 + Node1 + Node2
no pre
nxt = Node1->Node0 + Node2->Node1
elem = Node0->-1 + Node1->-7 + Node2->-8
Sorted[]
}}
}
run test31 for 3 expect 1
pred test24 {
some disj DLL0: DLL {some disj Node0, Node1, Node2: Node {
DLL = DLL0
header = DLL0->Node2
Node = Node0 + Node1 + Node2
no pre
nxt = Node1->Node0 + Node2->Node1
elem = Node0->-4 + Node1->-7 + Node2->-8
Sorted[]
}}
}
run test24 for 3 expect 1
|
experiments/test-suite/mutation-based/10/5/nqueens.als | kaiyuanw/AlloyFLCore | 1 | 3708 | pred test47 {
some disj Queen0, Queen1, Queen2, Queen3: Queen {
Queen = Queen0 + Queen1 + Queen2 + Queen3
row = Queen0->0 + Queen1->0 + Queen2->3 + Queen3->0
col = Queen0->0 + Queen1->0 + Queen2->2 + Queen3->0
nothreat[Queen3,Queen2]
}
}
run test47 for 4 expect 1
pred test39 {
some disj Queen0, Queen1, Queen2, Queen3: Queen {
Queen = Queen0 + Queen1 + Queen2 + Queen3
row = Queen0->1 + Queen1->0 + Queen2->3 + Queen3->2
col = Queen0->0 + Queen1->0 + Queen2->3 + Queen3->2
nothreat[Queen3,Queen2]
}
}
run test39 for 4 expect 0
pred test8 {
some disj Queen0: Queen {
Queen = Queen0
row = Queen0->0
no col
}
}
run test8 for 4 expect 0
pred test6 {
some disj Queen0, Queen1, Queen2: Queen {
Queen = Queen0 + Queen1 + Queen2
row = Queen0->2 + Queen1->-7 + Queen1->1 + Queen1->6 + Queen2->-7 + Queen2->0 + Queen2->2 + Queen2->5
col = Queen0->1 + Queen1->1 + Queen2->1
}
}
run test6 for 4 expect 0
pred test72 {
some disj Queen0: Queen {
Queen = Queen0
row = Queen0->1
col = Queen0->0
}
}
run test72 for 4 expect 0
pred test31 {
some disj Queen0, Queen1, Queen2, Queen3: Queen {
Queen = Queen0 + Queen1 + Queen2 + Queen3
row = Queen0->0 + Queen1->2 + Queen2->2 + Queen3->1
col = Queen0->3 + Queen1->2 + Queen2->2 + Queen3->0
nothreat[Queen3,Queen2]
}
}
run test31 for 4 expect 1
pred test18 {
some disj Queen0, Queen1, Queen2, Queen3: Queen {
Queen = Queen0 + Queen1 + Queen2 + Queen3
row = Queen0->2 + Queen1->3 + Queen2->0 + Queen3->0
col = Queen0->3 + Queen1->1 + Queen2->1 + Queen3->0
nothreat[Queen3,Queen2]
}
}
run test18 for 4 expect 0
|
base/remoteboot/bootfloppy/src/bootware/tcpip/tftp.asm | npocmaka/Windows-Server-2003 | 17 | 173961 | ;===================================================================
; TFTP.ASM
;
; TFTP file transfer code for TCP/IP NID.
;===================================================================
;--------------------------------------------------------------------
; TransferFile
;
; Main BOOTP processing loop.
;
;--------------------------------------------------------------------
Proc TransferFile
push ds
pop es ; es = ds
call PrintCRLF
cmp [Verbose], 0 ; are we in verbose mode?
jne @@doIt ; yes
mov bx, offset tx_TFTP
call Print
jmp @@skip
@@doIt:
mov bx, offset tx_Transfering
call Print
; mov bx, 3
; call AIChangeReceiveMask ; enable broadcast reception
mov bx, [NamePtr] ; get pointer to file name
call Print ; print image file name
mov al, ' '
call PrintChar
@@skip:
mov [Counter], 1
call PrintTransferValue ; update screen counter
mov ax, 1000h ; BootWare load segment
cmp [Protocol], IP_BINL ; are we doing TCP/IP BINL?
jne @@notBINL
mov ax, 7c0h ; PXE load segment
@@notBINL:
; set starting pointer for image (1000:0)
mov [word ptr Transfer+2], ax
mov [word ptr Transfer], 0
mov [PacketNum], 0
mov [TFTP.Size], size OpenTFTPStruct
mov [TFTP.Flags], 1 ; enable large block size
mov eax, [GatewayIP]
mov [(TFTP.Gateway)], eax
mov eax, [ServerIP]
mov [TFTP.Address], eax
mov ax, [NamePtr]
mov [TFTP.FileName], ax
mov [(TFTP.FileName)+2], ds
mov [word ptr TFTP.Callback], offset TFTPCallback
mov [(word ptr TFTP.Callback)+2], cs
mov di, offset TFTP
call AIOpenTFTP ; transfer the file
or ax, ax ; was there an error?
je @@notIP ; no error
push ax
call PrintCRLF
mov bx, offset ErrorMsg
call Print ; print "Error: "
pop ax
cmp ax, 25 ; IP error?
jne @@notIP
mov bx, offset tx_CantResolve
call Print
lea si, [GatewayIP]
cmp [GatewayIP], 0 ; is there a gateway?
jne isGW
lea si, [ServerIP]
isGW:
call PrintIP
xor ax, 1 ; set flags to return with error
@@notIP:
ret
endp
;--------------------------------------------------------------------
; TftpCallback
;
; Callback function for TFTP transfer.
;
; Parameters:
; ax - packet type
; bx - packet number
; cx - packet size
; es:di - pointer to data
;
; Returns:
; ax - status
;--------------------------------------------------------------------
Proc TftpCallback far
push ds ; save caller ds
push cs
pop ds ; set ds = cs
cmp ax, -2 ; is this a timeout callback?
jne notTimeout ; no
call Timeout
jmp callbackExit
notTimeout:
call ProcessPacket
or ax, ax ; was there an error?
jne callbackExit ; yes
call PrintTransferValue ; update screen counter
inc [PacketNum] ; increase packet number
xor ax, ax ; return "no error"
callbackExit:
pop ds ; restore ds
ret ; status returned in ax
endp
;--------------------------------------------------------------------
; CheckTimeout
;
; Parameters:
; none
;
; Returns:
; ax = 0 if ok
;--------------------------------------------------------------------
Proc Timeout
mov ah, 1
int 16h ; check keyboard for a key
jz noKey2 ; no key pressed
xor ax, ax
int 16h ; read keyboard
cmp ax, 011Bh ; ESC code
je timeoutDone ; ESC - time's up
noKey2:
inc [Counter]
call PrintTransferValue ; update screen
add cx, 9 ; add half second to time out
xor ax, ax ; clear return status
cmp [Counter], 20 ; have we reached retry limit?
jne timeoutOK ; no
timeoutDone:
inc ax ; return error value
timeoutOK:
ret
endp
;--------------------------------------------------------------------
; ProcessPacket
;
; Parameters:
; es:di - pointer to data
; bx - packet number
; cx - packet size
;
; Returns:
; ax = 0 if ok
;--------------------------------------------------------------------
Proc ProcessPacket
cmp ax, 5 ; is this an error packet
jne no_error ; nope
call ErrorTFTP ; handle the error
tftp_error:
mov ax, -1
ret ; return with error
no_error:
cmp ax, 3 ; is this a data packet
jne tftp_error ; nope
;------------------------------------------------------------
; Copy data from packet into memory
;------------------------------------------------------------
cmp [PacketNum], 0 ; is this the first packet?
jne not_first ; no
call CheckAPI ; check if image uses the ROMs API
call CheckExtended ; check if extended image
jc tftp_error ; there was an error
not_first:
cmp [HeadSize], 0 ; data left in header?
jne saveHeader ; yes put data in conventional RAM
cmp [ExtFlag], 1 ; are we using extended memory
je doExtended ; copy to extended memory
call CopyRam ; copy all to convetional RAM
jc tftp_error ; if error - send NAK
jmp processOK ; no error - done
saveHeader:
mov ax, cx ; save total size in ax
cmp [HeadSize], cx ; do we have more data then needed?
ja moreTogo
mov cx, [HeadSize]
moreTogo:
sub [HeadSize], cx
notExtended:
call CopyRam ; copy to convetional RAM
jc tftp_error ; if error - send NAK
add di, cx ; update new starting offset
sub ax, cx ; subtract what we saved from total
cmp ax, 0
je processOK ; nothing remaining
mov cx, ax
doExtended:
call CopyExtended ; put packet in extended RAM
jc tftp_error ; if error - send NAK
processOK:
xor ax, ax
ret ; return with no error
endp
;--------------------------------------------------------------------
; CheckAPI
;
; Checks the contents of the first packet received to see if the image
; is a BWAPI image, if it is we set a flag to not disengage the ROM.
;
; Parameters:
; es:di - pointer to packet data
;
; Returns:
; nothing
;--------------------------------------------------------------------
Proc CheckAPI
cmp [word ptr es:di+2], 'WB'
jne notAPI ; look for "BWAPI" at offset 2
cmp [word ptr es:di+4], 'PA'
jne notAPI
mov [NoDisengage], 1 ; set flag to not disengage
notAPI:
ret
endp
;--------------------------------------------------------------------
; CheckExtended
;
; Checks the contents of the first packet received to see if the image
; should be saved in extended memory.
;
; Parameters:
; es:di - pointer to packet data
;
; Returns:
; ax = 0 if OK
;--------------------------------------------------------------------
Proc CheckExtended
; look for extended memory signature
cmp [word ptr es:di+14], 'xE'
jne not_extended ; no signature
cmp [word ptr es:di+16], 'xT'
jne not_extended ; no signature
mov ah, 88h
int 15h ; get extended memory size
cmp [es:di+12], ax ; compare with size of image
ja exterror ; not enough memory
mov ax, [es:di+10] ; get size of header code
mov [HeadSize], ax ; save header size
mov [ExtFlag], 1 ; set extended memory flag
mov [ExtendedAddress], 0 ; set starting extended memory address
mov [ExtendedAddress+2], 11h
not_extended:
clc
ret ; return no error
exterror:
mov bx, offset tx_extmemerror
call PrintError
stc
ret ; return with error
endp
;--------------------------------------------------------------------
; CopyRam
;
; Copies image into conventional RAM.
;
; On entry:
; cx - size to copy
; es:di pointer to data packet
;
; Returns:
; carry clear - everything OK
; carry set - something went wrong
;--------------------------------------------------------------------
Proc CopyRam
ifdef TSR
clc ; clear carry for OK
ret
endif
push ax
push cx ; save count
push di ; save data address
push es ; save data segment
push ds ; save our ds
; set ds:si to packet address, es:di to RAM address
mov si, di ; move source address into si
push es
les di, [Transfer] ; get RAM pointer into es:di
pop ds ; ds = packet segment
rep movsb ; copy packet
pop ds ; restore our ds
mov ax, di ; move ending offset to ax
mov cl, 16 ; divide offset into a paragraph
div cl ; number
xor cx, cx ; cx = 0
xchg cl, ah ; cx is new offset,
; ax is paragraph count
mov bx, es ; add paragraphs to segment
add bx, ax
mov [word ptr Transfer], cx ; save new offset
mov [word ptr Transfer+2], bx ; save new segment
pop es ; restore our es
;------------------------------------------------------------
; Check new segment to make sure the image is not going to
; over write our code. If it is print error message and
; set error state.
;------------------------------------------------------------
mov ax, cs ; get our current code segment
cmp bx, ax
jb copyRamOk ; not going to over write
mov bx, offset tx_toolarge
call PrintError ; error: "Image file too large."
stc ; set carry for error
jc copyRamExit
copyRamOk:
clc ; clear carry for OK
copyRamExit:
pop di ; restore data pointer
pop cx ; restore packet size
pop ax
ret
endp
;--------------------------------------------------------------------
; CopyExtended
;
; Copies image into extended RAM.
;
; On entry:
; cx - size to copy
; es:di pointer to data
;
; Returns:
; carry clear - everything OK
; carry set - something went wrong
;--------------------------------------------------------------------
Proc CopyExtended
push es ; save es
pusha ; save all registers
;------------------------------------------------------------
; Source address must be converted to 24 bit address for
; extended memory INT15 copy function
;------------------------------------------------------------
push cx ; save packet size
push di ; save packet address
push es ; save packet segment
push ds
pop es ; es = our segment
mov di, offset GDT ; get GDT location
mov cx, (size DESCRIPTOR)/2
xor ax, ax
rep stosw ; zero the GDT (es:di)
pop ax ; ax = packet segment
pop bx ; bx = packet offset
xor dx, dx ; dx = 0
mov cx, 16
mul cx ; dx:ax = ax * 16
add ax, bx ; add offset
adc dx, 0 ; dx:ax is now 24 bit source address
pop cx ; get copy bytes size
push cx ; save it again
mov [GDT.SourceLimit], cx ; set copy size
mov [GDT.TargetLimit], cx ; set copy size
mov [GDT.SourceRights], 93h ; set copy rights
mov [GDT.TargetRights], 93h ; set copy rights
mov [GDT.SourceLoWord], ax ; set source address lo word
mov [GDT.SourceHiByte], dl ; set source address hi byte
mov ax, [ExtendedAddress] ; get 24 bit extended memory address
mov dx, [ExtendedAddress+2]
mov [GDT.TargetLoWord], ax ; set dest address low word
mov [GDT.TargetHiByte], dl ; set dest address hi byte
inc cx
shr cx, 1 ; now cx is word count
mov si, offset GDT ; address of GDT (ds:di)
mov ah, 87h
int 15h ; move data to/from extended memory
pop cx ; restore byte count in CX
pushf ; save INT15 status
add [ExtendedAddress], cx ; calc next address
adc [ExtendedAddress+2], 0
popf ; restore INT15 status
popa ; restore registers
pop es ; restore es
ret ; return - carry set/cleared in INT15
endp
;--------------------------------------------------------------------
; ErrorTFTP
;
; Something is wrong with the TFTP transfer.
;
; Parameters:
; ds:di - pointer to packet
;
;--------------------------------------------------------------------
Proc ErrorTFTP
mov si, di
mov di, offset StringBuffer
err_loop: ; copy error message into local memory
lodsb
stosb
or al, al ; was a null moved?
jne err_loop
call PrintCRLF
mov bx, offset tx_error
call Print
mov bx, offset StringBuffer
call Print
ret
endp
;--------------------------------------------------------------------
; Check4SecureMode
;
; Checks if TFTP secure mode is enabled, if it is then the path
; is removed from the file name returned from the BOOTP/DHCP server.
;
;--------------------------------------------------------------------
Proc Check4SecureMode
cmp [byte ptr si], 0 ; check first character of name
je noName ; no file name specified
;------------------------------------------------------------
; Check for secure mode, if so then we only want the file name.
;------------------------------------------------------------
test [IPFeature], 1 ; check for secure mode
; clear = non secure, set = secure
jz notSecure ; nope
mov di, si ; save path start in di
; find the end of the file name
findEnd:
inc si
cmp [byte ptr si], 0
jne findEnd
; now scan back to find the beginning of the name
findStart:
cmp si, di ; at start of path string?
je notSecure ; yep, there is no /
dec si
mov al, [si] ; get character
cmp al, '\'
je foundIt
cmp al, ':'
je foundIt
cmp al, '/'
jne findStart
foundIt:
inc si
notSecure:
mov [NamePtr], si ; save pointer to file name
noName:
ret
endp
|
programs/oeis/282/A282798.asm | jmorken/loda | 1 | 86766 | ; A282798: Decimal representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 505", based on the 5-celled von Neumann neighborhood.
; 1,0,7,4,31,20,127,84,511,340,2047,1364,8191,5460,32767,21844,131071,87380,524287,349524,2097151,1398100,8388607,5592404,33554431,22369620,134217727,89478484,536870911,357913940,2147483647,1431655764,8589934591,5726623060,34359738367,22906492244,137438953471,91625968980,549755813887,366503875924,2199023255551,1466015503700,8796093022207,5864062014804,35184372088831,23456248059220,140737488355327,93824992236884,562949953421311,375299968947540,2251799813685247,1501199875790164,9007199254740991,6004799503160660
add $0,2
mov $2,2
sub $2,$0
add $2,$0
pow $2,$0
lpb $0
gcd $0,2
div $0,2
add $1,$2
mov $3,$2
sub $3,1
sub $1,$3
add $3,$1
add $1,$3
lpe
sub $1,9
div $1,6
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.