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
oeis/234/A234787.asm
neoneye/loda-programs
11
96335
; A234787: Cubes (with at least two digits) that become squares when their rightmost digit is removed. ; 1000,64000,729000,4096000,15625000,46656000,117649000,262144000,531441000,1000000000,1771561000,2985984000,4826809000,7529536000,11390625000,16777216000,24137569000,34012224000,47045881000,64000000000,85766121000,113379904000,148035889000,191102976000,244140625000,308915776000,387420489000,481890304000,594823321000,729000000000,887503681000,1073741824000,1291467969000,1544804416000,1838265625000,2176782336000,2565726409000,3010936384000,3518743761000,4096000000000,4750104241000,5489031744000 add $0,1 pow $0,6 mul $0,1000
Search and Sort/Merge Sort.asm
MrR0B0T777/MIPS_Programming
0
86117
<reponame>MrR0B0T777/MIPS_Programming<gh_stars>0 .data array: .word 1 2 3 6 4 arraySize: .word 5 c: .word 0:100 .text main: la $a0, array addi $a1, $0, 0 addi $a2, $0, 4 jal mergesort jal Print #print array li $v0, 10 syscall mergesort: blt $a1, $a2, ret addi $sp, $sp, -16 sw $ra, 12($sp) sw $a1, 8($sp) sw $a2, 4($sp) add $s0, $a1, $a2 sra $s0, $s0, 1 sw $s0, 0($sp) ## stored ra, left, right, mid #high = mid add $a2, $s0, $zero jal mergesort #restore from stack lw $s0, 0($sp) lw $a2, 4($sp) lw $a1, 8($sp) #low = mid+1 add $a1, $s0, 1 jal mergesort #restore from stack again #restore from stack lw $a3, 0($sp) #A3 IS NOW MID lw $a2, 4($sp) lw $a1, 8($sp) jal merge #merge em together lw $ra, 12($sp) addi $sp, $sp , 16 ret: jr $ra merge: #we have two arrays now #we need to merge em #keep a new location for array 'c' add $s0, $a1, $0 #low i add $s1, $a1, $0 #low k add $s2, $a3, 1 #mid+1 j while1: blt $a3, $s0, while2 blt $a2, $s2, while2 #we don't want a far jump :P, we goto while3 from while2 RIP j if if: sll $t0, $s0, 2 #conversion to word from byte add $t0, $t0 , $a0 #a0 is base lw $t1, 0($t0) #load *(int*)(a+i)value sll $t2, $s2,2 add $t2, $t2, $a0 # (int*)(a+j) lw $t3, 0($t2) #dereference la $t4, c sll $t5, $s1, 2 add $t4, $t4, $t5 #c[k] blt $t3, $t1, else #A[j] < A[i] sw $t1, 0($t4) #c[k] = a[i] addi $s1, $s1, 1 #k++ addi $s0, $s0, 1 #i++ j while1 else: #t3 stored sw $t3, 0($t4) #c[k] = a[i] addi $s1, $s1, 1 addi $s2, $s2, 1 #j++ j while1 while2: ##copycontents blt $a3, $a0, while3 #if mid < i sll $t0, $s0, 2 # # $t0 = i*4 add $t0, $a0, $t0 # add offset to the address of a[0]; now $t0 = address of a[i] lw $t1, 0($t0) # load value of a[i] into $t7 la $t2, c # Get start address of c sll $t3, $s1, 2 # k*4 add $t3, $t3, $t2 # $t3 = c[k] sw $t1, 0($t3) # saving $t1 (value of a[i]) into address of $t3, which is c[k] addi $s1, $s1, 1 # k++ addi $s0, $s0, 1 # i++ j while2 # Go to next iteration while3: ##copycontents again blt $a2, $s1, For_Initializer #if high < j then go to For loop sll $t2, $s2, 2 # $t2 = j*4 add $t2, $t2, $a0 # add offset to the address of a[0]; now $t2 = address of a[j] lw $t3, 0($t2) # $t2 = value in a[j] la $t4, c # Get start address of c sll $t5, $s1, 2 # k*4 add $t4, $t4, $t5 # $t4 is address of c[k] sw $t3, 0($t4) # $t3 => c[k]; addi $s1, $s1, 1 # k++ addi $s2, $s2, 1 # j++ j While3 # Go to next iteration For_Initializer: add $t0, $a1, $zero # t0 = low addi $t1, $a2, 1 # t1 = high+1 la $t4, c # t4 = c j For For: bge $t0, $t1, sortEnd # if t0 >= t1, go to sortEnd sll $t2, $t0, 2 # ptr offset now in $t2 ptr from low to high+1 add $t3, $t2, $a0 # add the offset to the address of a => a[ptr] add $t5, $t2, $t4 # add the offset to the address of c => c[ptr] lw $t6, 0($t5) # loads value of c[i] into $t6 sw $t6, 0($t3) # a[i] = c[i] addi $t0, $t0, 1 # increment $t0 by 1 for the i++ part of For loop j For # Go to next iteration sortEnd: jr $ra # return to calling routine Print: add $t0, $a1, $zero # initialize $t0 to low add $t1, $a2, $zero # initialize $t1 to high la $t4, array2 # load the address of the array into $t4 Print_Loop: blt $t1, $t0, Exit # if $t1 < $t0, go to exit sll $t3, $t0, 2 # $t0 * 4 to get the offset add $t3, $t3, $t4 # add the offset to the address of array to get array[$t3] lw $t2, 0($t3) # load the value at array[$t0] to $t2 move $a0, $t2 # move the value to $a0 for printing li $v0, 1 # the MIPS call for printing the numbers syscall addi $t0, $t0, 1 # increment $t0 by 1 for the loop la $a0, Space # prints a comma and space between the numbers li $v0, 4 # MIPS call to print a prompt syscall j Print_Loop # Go to next iteration of the loop Exit: jr $ra # jump to the address in $ra; Go back to main
libsrc/stdio/__printf_handle_ll.asm
ahjelm/z88dk
640
86093
<filename>libsrc/stdio/__printf_handle_ll.asm IF !__CPU_INTEL__ && !__CPU_GBZ80__ MODULE __printf_handle_ll SECTION code_clib PUBLIC __printf_handle_ll EXTERN __printf_format_table64 EXTERN __printf_format_search_loop ; Entry: hl = fmt ; de = ap ; ix = printf context __printf_handle_ll: ld c,(hl) ; next bit of format inc hl push hl ;save next format ld hl,__printf_format_table64 jp __printf_format_search_loop ENDIF
case-studies/performance/verification/alloy/ppc/tests/bclwdww010.als
uwplse/memsynth
19
3383
module tests/bclwdww010 open program open model /** PPC bclwdww010 "DpsR Fre LwSyncdWW Wse LwSyncdWW Rfe" Cycle=DpsR Fre LwSyncdWW Wse LwSyncdWW Rfe Relax=BCLwSyncdWW Safe=Fre Wse LwSyncdWW DpsR { 0:r2=y; 0:r4=x; 1:r2=x; 1:r4=y; 2:r2=y; } P0 | P1 | P2 ; li r1,2 | li r1,2 | lwz r1,0(r2) ; stw r1,0(r2) | stw r1,0(r2) | xor r3,r1,r1 ; lwsync | lwsync | lwzx r4,r3,r2 ; li r3,1 | li r3,1 | ; stw r3,0(r4) | stw r3,0(r4) | ; exists (x=2 /\ y=2 /\ 2:r1=1 /\ 2:r4=1) **/ one sig x, y extends Location {} one sig P1, P2, P3 extends Processor {} one sig op1 extends Write {} one sig op2 extends Lwsync {} one sig op3 extends Write {} one sig op4 extends Write {} one sig op5 extends Lwsync {} one sig op6 extends Write {} one sig op7 extends Read {} one sig op8 extends Read {} fact { P1.write[1, op1, y, 2] P1.lwsync[2, op2] P1.write[3, op3, x, 1] P2.write[4, op4, x, 2] P2.lwsync[5, op5] P2.write[6, op6, y, 1] P3.read[7, op7, y, 1] P3.read[8, op8, y, 1] and op8.dep[op7] } fact { y.final[2] x.final[2] } Allowed: run { Allowed_PPC } for 5 int expect 0
programs/oeis/201/A201004.asm
neoneye/loda
0
165940
<filename>programs/oeis/201/A201004.asm ; A201004: Triangular numbers, T(m), that are five-quarters of another triangular number; T(m) such that 4*T(m) = 5*T(k) for some k. ; 0,45,14535,4680270,1507032450,485259768675,156252138480945,50312703331095660,16200534220474321620,5216521706289400466025,1679703788890966475738475,540859403501184915787322970,174155048223592651917042257910,56077384668593332732371819724095,18056743708238829547171808908900725 mov $2,$0 seq $2,119032 ; a(n+2)=18a(n+1)-a(n)+8. add $1,$2 mul $1,$2 add $1,$2 div $1,2 mov $0,$1
libsrc/adt/stack/adt_StackPeek.asm
jpoikela/z88dk
640
23803
; void __FASTCALL__ *adt_StackPeek(struct adt_Stack *s) ; 09.2005, 11.2006 aralbrec SECTION code_clib PUBLIC adt_StackPeek PUBLIC _adt_StackPeek ; return the item at the top of the stack ; but don't pop it! ; ; enter: HL = struct adt_Stack * ; exit : HL = item at top of stack or 0 if stack empty .adt_StackPeek ._adt_StackPeek inc hl inc hl ld a,(hl) inc hl ld h,(hl) ld l,a or h ret z ld a,(hl) inc hl ld h,(hl) ld l,a ret
Language/language4.asm
Unshifted1337/AssemblyExercises
0
89170
<reponame>Unshifted1337/AssemblyExercises f4: subq $40, %rsp movl $1, (%rsp) movl $0, 16(%rsp) .L2: leaq 16(%rsp), %rsi movq %rsp, %rdi call callfunc movl 16(%rsp), %eax cmpl %eax, (%rsp) jne .L2 addq $40, %rsp ret
Cats/Limit.agda
JLimperg/cats
24
2669
<filename>Cats/Limit.agda {-# OPTIONS --without-K --safe #-} module Cats.Limit where open import Level open import Cats.Category.Base open import Cats.Category.Cones as Cones using (Cone ; Cones ; ConesF ; cone-iso→obj-iso) open import Cats.Category.Constructions.Terminal using (HasTerminal) open import Cats.Category.Constructions.Unique using (∃!′) open import Cats.Category.Fun as Fun using (Trans ; _↝_) open import Cats.Functor using (Functor) open import Cats.Util.Conv import Cats.Category.Constructions.Terminal as Terminal import Cats.Category.Constructions.Iso as Iso open Cone open Cones._⇒_ open Functor open Fun._≈_ open Trans private module Cs {lo la l≈ lo′ la′ l≈′} {C : Category lo la l≈} {D : Category lo′ la′ l≈′} {F : Functor C D} = Category (Cones F) module _ {lo la l≈ lo′ la′ l≈′} {J : Category lo la l≈} {Z : Category lo′ la′ l≈′} where private module J = Category J module Z = Category Z IsLimit : {D : Functor J Z} → Cone D → Set (lo ⊔ la ⊔ lo′ ⊔ la′ ⊔ l≈′) IsLimit {D} = Terminal.IsTerminal {C = Cones D} record Limit (D : Functor J Z) : Set (lo ⊔ la ⊔ lo′ ⊔ la′ ⊔ l≈′) where field cone : Cone D isLimit : IsLimit cone open Cone cone using () renaming (arr to proj) private hasTerminal : HasTerminal (Cones D) hasTerminal = record { ⊤ = cone ; isTerminal = isLimit } open HasTerminal hasTerminal public using ( ! ; !-unique ) renaming ( ⊤-unique to cone-unique ; ⇒⊤-unique to ⇒cone-unique ) !! : (cone′ : Cone D) → cone′ .Cone.Apex Z.⇒ cone .Cone.Apex !! cone′ = ! cone′ .arr !!-unique : {cone′ : Cone D} (f : cone′ Cs.⇒ cone) → !! cone′ Z.≈ f .arr !!-unique f = !-unique f arr∘!! : ∀ cone′ {j} → proj j Z.∘ !! cone′ Z.≈ cone′ .Cone.arr j arr∘!! cone′ = ! cone′ .commute _ !!∘ : ∀ {C D} (f : C Cs.⇒ D) → !! D Z.∘ f .arr Z.≈ !! C !!∘ {C} {D} f = Z.≈.sym (!!-unique record { commute = λ j → let open Z.≈-Reasoning in begin proj j Z.∘ !! D Z.∘ f .arr ≈⟨ Z.unassoc ⟩ (proj j Z.∘ !! D) Z.∘ f .arr ≈⟨ Z.∘-resp-l (arr∘!! D) ⟩ D .arr j Z.∘ f .arr ≈⟨ f .commute j ⟩ C .arr j ∎ }) open Cone cone public open Limit public instance HasObj-Limit : ∀ {D} → HasObj (Limit D) _ _ _ HasObj-Limit {D} = record { Cat = Cones D ; _ᴼ = cone } module _ {D : Functor J Z} where unique : (l m : Limit D) → Iso.Build._≅_ (Cones D) (l ᴼ) (m ᴼ) unique l m = Terminal.terminal-unique (isLimit l) (isLimit m) obj-unique : (l m : Limit D) → Iso.Build._≅_ Z (l ᴼ ᴼ) (m ᴼ ᴼ) obj-unique l m = cone-iso→obj-iso _ (unique l m) module _ {F G : Functor J Z} where trans : (ϑ : Trans F G) (l : Limit F) (m : Limit G) → l .Apex Z.⇒ m .Apex trans ϑ l m = !! m (ConesF .fmap ϑ .fobj (l .cone)) arr∘trans : ∀ ϑ l m c → m .arr c Z.∘ trans ϑ l m Z.≈ ϑ .component c Z.∘ l .arr c arr∘trans ϑ l m c = arr∘!! m (ConesF .fmap ϑ .fobj (l .cone)) trans-resp : ∀ {ϑ ι} l m → ϑ Fun.≈ ι → trans ϑ l m Z.≈ trans ι l m trans-resp {ϑ} {ι} l m ϑ≈ι = !!-unique m record { commute = λ j → Z.≈.trans (arr∘trans ι l m j) (Z.∘-resp-l (Z.≈.sym (≈-elim ϑ≈ι))) } trans-id : {F : Functor J Z} (l : Limit F) → trans Fun.id l l Z.≈ Z.id trans-id l = !!-unique l record { commute = λ j → Z.≈.trans Z.id-r (Z.≈.sym Z.id-l) } trans-∘ : {F G H : Functor J Z} (ϑ : Trans G H) (ι : Trans F G) → ∀ l m n → trans ϑ m n Z.∘ trans ι l m Z.≈ trans (ϑ Fun.∘ ι) l n trans-∘ {F} {G} {H} ϑ ι l m n = Z.≈.sym (!!-unique n record { commute = λ j → let open Z.≈-Reasoning in begin n .arr j Z.∘ trans ϑ m n Z.∘ trans ι l m ≈⟨ Z.unassoc ⟩ (n .arr j Z.∘ trans ϑ m n) Z.∘ trans ι l m ≈⟨ Z.∘-resp-l (arr∘trans ϑ m n j ) ⟩ (ϑ .component j Z.∘ m .arr j) Z.∘ trans ι l m ≈⟨ Z.assoc ⟩ ϑ .component j Z.∘ m .arr j Z.∘ trans ι l m ≈⟨ Z.∘-resp-r (arr∘trans ι l m j) ⟩ ϑ .component j Z.∘ ι .component j Z.∘ l .arr j ≈⟨ Z.unassoc ⟩ (ϑ Fun.∘ ι) .component j Z.∘ l .arr j ∎ }) record _HasLimitsOf_ {lo la l≈} (C : Category lo la l≈) {lo′ la′ l≈′} (J : Category lo′ la′ l≈′) : Set (lo ⊔ la ⊔ l≈ ⊔ lo′ ⊔ la′ ⊔ l≈′ ) where private module C = Category C module J↝C = Category (J ↝ C) field lim′ : (F : Functor J C) → Limit F lim : Functor J C → C.Obj lim F = lim′ F .cone .Apex limF : Functor (J ↝ C) C limF = record { fobj = λ F → lim F ; fmap = λ {F} {G} ϑ → trans ϑ (lim′ _) (lim′ _) ; fmap-resp = λ ϑ≈ι → trans-resp (lim′ _) (lim′ _) ϑ≈ι ; fmap-id = trans-id (lim′ _) ; fmap-∘ = trans-∘ _ _ (lim′ _) (lim′ _) (lim′ _) } record Complete {lo la l≈} (C : Category lo la l≈) lo′ la′ l≈′ : Set (lo ⊔ la ⊔ l≈ ⊔ suc (lo′ ⊔ la′ ⊔ l≈′)) where field lim′ : ∀ {J : Category lo′ la′ l≈′} (F : Functor J C) → Limit F hasLimitsOf : (J : Category lo′ la′ l≈′) → C HasLimitsOf J hasLimitsOf J ._HasLimitsOf_.lim′ = lim′ private open module HasLimitsOf {J} = _HasLimitsOf_ (hasLimitsOf J) public hiding (lim′) preservesLimits : ∀ {lo la l≈ lo′ la′ l≈′} → {C : Category lo la l≈} {D : Category lo′ la′ l≈′} → Functor C D → (lo″ la″ l≈″ : Level) → Set _ preservesLimits {C = C} F lo″ la″ l≈″ = {J : Category lo″ la″ l≈″} → {D : Functor J C} → {c : Cone D} → IsLimit c → IsLimit (Cones.apFunctor F c)
Source/display.ads
XMoose25X/Advanced-Dungeon-Assault
1
25398
<reponame>XMoose25X/Advanced-Dungeon-Assault<gh_stars>1-10 package display is --IMPORTANT: This function must be called before any other functions --This Initializes the package for use procedure Initialize(width, height : Integer); --The color type consists of 4 ANSI codes in series [ 0 ; 27 ; 37 ; 40 m --A code or string of codes must always begin with the ESC character (ASCII.ESC or Character'Val(27)) --The Codes are usually 2 digits long and usually start with '[' and end with 'm', but not always --Codes in series are separated by ';' --References for ANSI codes : http://ascii-table.com/ansi-escape-sequences-vt-100.php -- http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html --Below subtype colorType is String(1..13); --colors colorDefault: constant colorType := ASCII.ESC & "[0;27;37;40m"; --red colorRed : constant colorType := ASCII.ESC & "[0;27;31;40m"; colorRedL : constant colorType := ASCII.ESC & "[1;27;31;40m"; colorRedI : constant colorType := ASCII.ESC & "[0;07;31;40m"; --green colorGreen : constant colorType := ASCII.ESC & "[0;27;32;40m"; colorGreenL : constant colorType := ASCII.ESC & "[1;27;32;40m"; colorGreenI : constant colorType := ASCII.ESC & "[0;07;32;40m"; --yellow colorYellow : constant colorType := ASCII.ESC & "[0;27;33;40m"; colorYellowL: constant colorType := ASCII.ESC & "[1;27;33;40m"; colorYellowI: constant colorType := ASCII.ESC & "[0;07;33;40m"; --blue colorBlue : constant colorType := ASCII.ESC & "[0;27;34;40m"; colorBlueL : constant colorType := ASCII.ESC & "[1;27;34;40m"; colorBlueI : constant colorType := ASCII.ESC & "[0;07;34;40m"; --magenta colorMag : constant colorType := ASCII.ESC & "[0;27;35;40m"; colorMagL : constant colorType := ASCII.ESC & "[1;27;35;40m"; colorMagI : constant colorType := ASCII.ESC & "[0;07;35;40m"; --cyan colorCyan : constant colorType := ASCII.ESC & "[0;27;36;40m"; colorCyanL : constant colorType := ASCII.ESC & "[1;27;36;40m"; colorCyanI : constant colorType := ASCII.ESC & "[0;07;36;40m"; --black colorBlack : constant colorType := ASCII.ESC & "[0;27;30;40m"; colorBlackL : constant colorType := ASCII.ESC & "[1;27;30;40m"; colorBlackI : constant colorType := ASCII.ESC & "[0;07;30;40m"; --white colorWhite : constant colorType := ASCII.ESC & "[0;27;37;40m"; colorWhiteL : constant colorType := ASCII.ESC & "[1;27;37;40m"; colorWhiteI : constant colorType := ASCII.ESC & "[0;07;37;40m"; --A PixelType contains a character and a colorType Type PixelType is record char : Character; color : colorType; end record; --tests if 2 pixels are the same function "=" (L, R : pixelType) return Boolean; --an imageBox is a 2-dimensional array of pixelType Type ImageBox is array(0..127,0..63) of PixelType; --a sprite is an image that can be placed and moved around on the screen Type SpriteType is record Width : Integer; Height : Integer; Image : ImageBox; color : colorType;--deprecated end record; --Character constants --These Constants contain symbols that look best when using the Terminal font --NOTE: these characters must be entered with Character'Val(charID). The compiler will not accept these in strings --Refernece for Extended ASCII: http://www.asciitable.com/index/extend.gif Char_Block : constant Character := character'val(219);-- Û Char_BorderV : constant Character := character'val(186);-- º Vertical Border Char_BorderH : constant Character := character'val(205);-- Í Horizontal Border Char_BorderTL : constant Character := character'val(201);-- É Top Left Corner Char_BorderTR : constant Character := character'val(187);-- » Top Right Corner Char_BorderBL : constant Character := character'val(200);-- È Bottom Left Corner Char_BorderBR : constant Character := character'val(188);-- ¼ Bottom Right Corner --screen width and height. These start at 0, so a width of 149 is actually 150 pixels wide Screen_Width : Integer := 149; Screen_Height : Integer := 39; --this defines the screen; Screen : array(0..Screen_Width,0..Screen_Height) of PixelType; --sets a pixel on the screen with the piven character and color(optional) procedure setPixel(X,Y : Integer; char : character; color : colorType := colorDefault); procedure setPixel(X,Y : Integer; pixel : PixelType); --returns the pixel at the position X,Y function getPixel(X,Y : Integer) return PixelType; --loads a formatted sprite file --To format a sprite file, you must use the spritemaker executable and convert an unformatted sprite --an unformatted sprite is a text file that contains: (width height) new line (ASCII image) function LoadSprite(FileName : String) return SpriteType; procedure SetSprite(posX, posY : Integer; sprite : SpriteType); --text functions --these set Text on the screen starting at position X,Y; Left Aligned procedure setText(posX,posY : Integer; Item : String; color : colorType := colorDefault); procedure setText(posX,posY : Integer; Item : Character; color : colorType := colorDefault); --Refresh Screen --This must be called to draw the screen to the console --take care not to call this too often, it can be slow procedure Refresh; --ClearDisplay resets the display array to blank spaces -- This does NOT clear the screen procedure ClearDisplay; --WipeScreen physically clears the console --This does not reset the display array --it is recommended not to use this often, but it is useful procedure WipeScreen; Private end display;
proglangs-learning/Agda/plfa-exercises/part1/Decidable.agda
helq/old_code
0
7724
<filename>proglangs-learning/Agda/plfa-exercises/part1/Decidable.agda module plfa-exercises.part1.Decidable where import Relation.Binary.PropositionalEquality as Eq open Eq using (_≡_; refl; sym; cong) open Eq.≡-Reasoning open import Data.Nat using (ℕ; zero; suc; pred) open import Data.Product using (_×_) renaming (_,_ to ⟨_,_⟩) open import Data.Sum using (_⊎_; inj₁; inj₂) open import Relation.Nullary using (¬_) open import Relation.Nullary.Negation using () renaming (contradiction to ¬¬-intro) open import Data.Unit using (⊤; tt) open import Data.Empty using (⊥; ⊥-elim) open import plfa.part1.Relations using (_<_; z<s; s<s) open import plfa.part1.Isomorphism using (_⇔_) open import Function.Base using (_∘_) infix 4 _≤_ data _≤_ : ℕ → ℕ → Set where z≤n : ∀ {n : ℕ} -------- → zero ≤ n s≤s : ∀ {m n : ℕ} → m ≤ n ------------- → suc m ≤ suc n _ : 2 ≤ 4 _ = s≤s (s≤s z≤n) ¬4≤2 : ¬ (4 ≤ 2) --¬4≤2 (s≤s (s≤s ())) = ? -- This causes Agda to die! TODO: Report ¬4≤2 (s≤s (s≤s ())) data Bool : Set where true : Bool false : Bool infix 4 _≤ᵇ_ _≤ᵇ_ : ℕ → ℕ → Bool zero ≤ᵇ n = true suc m ≤ᵇ zero = false suc m ≤ᵇ suc n = m ≤ᵇ n _ : (2 ≤ᵇ 4) ≡ true _ = refl _ : (5 ≤ᵇ 4) ≡ false _ = refl T : Bool → Set T true = ⊤ T false = ⊥ ≤→≤ᵇ : ∀ {m n} → (m ≤ n) → T (m ≤ᵇ n) ≤→≤ᵇ z≤n = tt ≤→≤ᵇ (s≤s m≤n) = ≤→≤ᵇ m≤n ≤ᵇ→≤ : ∀ {m n} → T (m ≤ᵇ n) → (m ≤ n) ≤ᵇ→≤ {zero} {_} tt = z≤n -- What is going on in here? Left `t` has type `T (suc m ≤ᵇ suc n)` and the right `t` has type `T (m ≤ᵇ n)` -- λ m n → T (suc m ≤ᵇ suc n) => reduces to: λ m n → T (m ≤ᵇ n) -- Ohh! Ok. It is because the third rule of `≤ᵇ` reduces `suc m ≤ᵇ suc n` to `m ≤ᵇ n` ≤ᵇ→≤ {suc m} {suc n} t = s≤s (≤ᵇ→≤ {m} {n} t) -- λ m → T (suc m ≤ᵇ zero) => reduces to: λ m → ⊥ -- which means that there are no rules for `fromᵇ {suc m} {zero}` ≤ᵇ→≤ {suc m} {zero} () proof≡computation : ∀ {m n} → (m ≤ n) ⇔ T (m ≤ᵇ n) proof≡computation {m} {n} = record { from = ≤ᵇ→≤ ; to = ≤→≤ᵇ } T→≡ : ∀ (b : Bool) → T b → b ≡ true T→≡ true tt = refl T→≡ false () --postulate -- lie : false ≡ true ≡→T : ∀ {b : Bool} → b ≡ true → T b --≡→T {false} refl = ? -- This is impossible because of refl's definition. Unification forces `b` to be `true` --≡→T {false} rewrite lie = λ refl → ? -- Even postulating a lie, it is impossible to create a bottom value ≡→T refl = tt _ : 2 ≤ 4 _ = ≤ᵇ→≤ tt ¬4≤2₂ : ¬ (4 ≤ 2) --¬4≤2₂ 4≤2 = ≤→≤ᵇ 4≤2 --¬4≤2₂ = ≤→≤ᵇ {4} {2} -- The type of `T (4 ≤ᵇ 2)` which reduces to `T false` and then `⊥` ¬4≤2₂ = ≤→≤ᵇ -- Notice how defining ≤ᵇ lifts from us the demand of computing the correct -- `evidence` (implementation) for the `proof` (function type) data Dec (A : Set) : Set where yes : A → Dec A no : ¬ A → Dec A ¬s≤z : {m : ℕ} → ¬ (suc m) ≤ zero --¬s≤z = ≤→≤ᵇ ¬s≤z () ¬s≤s : {m n : ℕ} → ¬ m ≤ n → ¬ suc m ≤ suc n ¬s≤s ¬m≤n = λ { (s≤s m≤n) → ¬m≤n m≤n } _≤?_ : (m n : ℕ) → Dec (m ≤ n) zero ≤? n = yes z≤n (suc m) ≤? zero = no ¬s≤z (suc m) ≤? (suc n) with m ≤? n ... | yes m≤n = yes (s≤s m≤n) ... | no ¬m≤n = no (¬s≤s ¬m≤n) -- `2 ≤? 4` reduces to `yes (s≤s (s≤s z≤n))` _ : Dec (2 ≤ 4) _ = 2 ≤? 4 _ = yes (s≤s (s≤s (z≤n {2}))) ⌊_⌋ : ∀ {A : Set} → Dec A → Bool ⌊ yes x ⌋ = true ⌊ no ¬x ⌋ = false _ : Bool _ = true _ = ⌊ 3 ≤? 4 ⌋ _ : ⌊ 3 ≤? 4 ⌋ ≡ true _ = refl _ : ⌊ 3 ≤? 2 ⌋ ≡ false _ = refl toWitness : ∀ {A : Set} {D : Dec A} → T ⌊ D ⌋ → A toWitness {_} {yes v} tt = v --toWitness {_} {no _} = ? -- `T ⌊ no x ⌋ → A` reduces to `⊥ → A` toWitness {_} {no _} () -- Empty because there is no value for `⊥` fromWitness : ∀ {A : Set} {D : Dec A} → A → T ⌊ D ⌋ fromWitness {_} {yes _} _ = tt fromWitness {_} {no ¬a} a = ¬a a -- with type ⊥ _ : 2 ≤ 4 --_ = toWitness {D = 2 ≤? 4} tt _ = toWitness {_} {2 ≤? 4} tt ¬4≤2₃ : ¬ (4 ≤ 2) --¬4≤2₃ = fromWitness {D = 4 ≤? 2} ¬4≤2₃ = fromWitness {_} {4 ≤? 2} ¬z<z : ¬ (zero < zero) ¬z<z () ¬s<z : ∀ {m : ℕ} → ¬ (suc m < zero) ¬s<z () _<?_ : ∀ (m n : ℕ) → Dec (m < n) zero <? zero = no ¬z<z zero <? suc n = yes z<s suc m <? zero = no ¬s<z suc m <? suc n with m <? n ... | yes m<n = yes (s<s m<n) ... | no ¬m<n = no λ{(s<s m<n) → ¬m<n m<n} _ : ⌊ 2 <? 4 ⌋ ≡ true _ = refl ¬z≡sn : ∀ {n : ℕ} → ¬ zero ≡ suc n ¬z≡sn () _≡ℕ?_ : ∀ (m n : ℕ) → Dec (m ≡ n) zero ≡ℕ? zero = yes refl zero ≡ℕ? (suc n) = no ¬z≡sn --(suc m) ≡ℕ? zero = no (λ{sn≡z → ¬z≡sn (sym sn≡z)}) --(suc m) ≡ℕ? zero = no (¬z≡sn ∘ sym) (suc m) ≡ℕ? zero = no ((λ()) ∘ sym) --The following doesn't work though --(suc m) ≡ℕ? zero with zero ≡ℕ? (suc m) --... | yes z≡sm = yes (sym z≡sm) --... | no ¬z≡sm = no (¬z≡sm ∘ sym) (suc m) ≡ℕ? (suc n) with m ≡ℕ? n ... | yes m≡n = yes (cong suc m≡n) ... | no ¬m≡n = no (¬m≡n ∘ (cong pred)) infixr 6 _×-dec_ _×-dec_ : ∀ {A B : Set} → Dec A → Dec B → Dec (A × B) yes x ×-dec yes y = yes ⟨ x , y ⟩ no ¬x ×-dec _ = no λ{ ⟨ x , y ⟩ → ¬x x } _ ×-dec no ¬y = no λ{ ⟨ x , y ⟩ → ¬y y } infixr 6 _⊎-dec_ _⊎-dec_ : ∀ {A B : Set} → Dec A → Dec B → Dec (A ⊎ B) yes x ⊎-dec _ = yes (inj₁ x) _ ⊎-dec yes y = yes (inj₂ y) no ¬x ⊎-dec no ¬y = no λ{(inj₁ x) → ¬x x; (inj₂ y) → ¬y y} ¬? : ∀ {A : Set} → Dec A → Dec (¬ A) ¬? (yes x) = no (¬¬-intro x) ¬? (no ¬x) = yes ¬x _→-dec_ : ∀ {A B : Set} → Dec A → Dec B → Dec (A → B) _ →-dec yes y = yes (λ _ → y) --no ¬x →-dec _ = yes ((λ()) ∘ ¬x) no ¬x →-dec _ = yes (⊥-elim ∘ ¬x) yes x →-dec no ¬y = no (λ{x→y → ¬y (x→y x)}) infixr 6 _∧_ _∧_ : Bool → Bool → Bool true ∧ true = true false ∧ _ = false _ ∧ false = false ∧-× : ∀ {A B : Set} (x : Dec A) (y : Dec B) → ⌊ x ⌋ ∧ ⌊ y ⌋ ≡ ⌊ x ×-dec y ⌋ ∧-× (yes x) (yes y) = refl ∧-× (no ¬x) _ = refl ∧-× (yes x) (no ¬y) = refl _iff_ : Bool → Bool → Bool true iff true = true false iff false = true _ iff _ = false _⇔-dec_ : ∀ {A B : Set} → Dec A → Dec B → Dec (A ⇔ B) yes x ⇔-dec yes y = yes (record { from = λ{_ → x} ; to = λ{_ → y} }) no ¬x ⇔-dec no ¬y = yes (record { from = (λ()) ∘ ¬y ; to = (λ()) ∘ ¬x }) yes x ⇔-dec no ¬y = no (λ x⇔y → ¬y (_⇔_.to x⇔y x)) no ¬x ⇔-dec yes y = no (λ x⇔y → ¬x (_⇔_.from x⇔y y)) iff-⇔ : ∀ {A B : Set} (x : Dec A) (y : Dec B) → ⌊ x ⌋ iff ⌊ y ⌋ ≡ ⌊ x ⇔-dec y ⌋ iff-⇔ (yes x) (yes y) = refl iff-⇔ (no ¬x) (no ¬y) = refl iff-⇔ (no ¬x) (yes y) = refl iff-⇔ (yes x) (no ¬y) = refl
source/league/matreshka-internals-settings-ini_managers-paths__posix.adb
svn2github/matreshka
24
19878
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This version of package intended to be used on POSIX systems. -- -- This package is conformant to "XDG Base Directory Specification". ------------------------------------------------------------------------------ separate (Matreshka.Internals.Settings.Ini_Managers) package body Paths is use type League.Characters.Universal_Character; HOME : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("HOME"); XDG_CONFIG_HOME : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("XDG_CONFIG_HOME"); XDG_CONFIG_DIRS : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("XDG_CONFIG_DIRS"); ------------------ -- System_Paths -- ------------------ function System_Paths return League.String_Vectors.Universal_String_Vector is Dirs : League.String_Vectors.Universal_String_Vector; Path : League.Strings.Universal_String; Paths : League.String_Vectors.Universal_String_Vector; begin -- Looking for XDG_CONFIG_DIRS environment variable and construct list -- directories from its value. if League.Application.Environment.Contains (XDG_CONFIG_DIRS) then Dirs := League.Application.Environment.Value (XDG_CONFIG_DIRS).Split (':', League.Strings.Skip_Empty); for J in 1 .. Dirs.Length loop Path := Dirs.Element (J); -- Resolve relative paths relativealy home directory. if Path.Element (1) /= '/' then Path := League.Application.Environment.Value (HOME) & '/' & Path; end if; -- Check for trailing path separator and add it when necessary. if Path.Element (Path.Length) /= '/' then Path.Append ('/'); end if; Paths.Append (Path); end loop; end if; -- Use default directory when directories list is not constructed. if Paths.Is_Empty then Paths.Append (League.Strings.To_Universal_String ("/etc/xdg/")); end if; return Paths; end System_Paths; --------------- -- User_Path -- --------------- function User_Path return League.Strings.Universal_String is Path : League.Strings.Universal_String; begin -- First, looking for XDG_CONFIG_HOME environment variable, it overrides -- default path. if League.Application.Environment.Contains (XDG_CONFIG_HOME) then Path := League.Application.Environment.Value (XDG_CONFIG_HOME); end if; -- When XDG_CONFIG_HOME environment variable is not defined, use -- $HOME/.config directory. if Path.Is_Empty then Path := League.Application.Environment.Value (HOME) & '/' & ".config"; -- Otherwise, when XDG_CONFIG_HOME is relative path, construct full -- path as $HOME/$XDG_CONFIG_HOME. elsif Path.Element (1).To_Wide_Wide_Character /= '/' then Path := League.Application.Environment.Value (HOME) & '/' & Path; end if; -- Check for trailing path separator and add it when necessary. if Path.Element (Path.Length) /= '/' then Path.Append ('/'); end if; return Path; end User_Path; end Paths;
libsrc/_DEVELOPMENT/adt/b_vector/c/sccz80/b_vector_resize_callee.asm
teknoplop/z88dk
8
16696
; int b_vector_resize(b_vector_t *v, size_t n) SECTION code_clib SECTION code_adt_b_vector PUBLIC b_vector_resize_callee EXTERN asm_b_vector_resize b_vector_resize_callee: pop hl pop de ex (sp),hl jp asm_b_vector_resize
Ada/gnat/hw.adb
egustafson/sandbox
2
28144
<filename>Ada/gnat/hw.adb with TEXT_IO; use TEXT_IO; procedure HW is task HELLO; task WORLD is entry PRINT_NOW; end WORLD; -- -- -- End of type declairations. -- -- -- task body HELLO is begin PUT("Hello, "); WORLD.PRINT_NOW; end HELLO; task body WORLD is begin accept PRINT_NOW; PUT("World"); NEW_LINE; end WORLD; -- The tasks become active as soon as the procedure under which -- their scope falls becomes active. (i.e. when procedure HW -- becomes active then it's tasks are started. begin -- HW (Hello World) null; end HW;
programs/oeis/090/A090417.asm
jmorken/loda
1
167082
; A090417: Primes of the form floor(2*Pi*n/(e*log(n))). ; 7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281 add $0,3 cal $0,40 ; The prime numbers. mov $1,$0
oeis/241/A241606.asm
neoneye/loda-programs
11
243967
<filename>oeis/241/A241606.asm ; A241606: A linear divisibility sequence of the fourth order related to A003779. ; Submitted by <NAME> ; 1,11,95,781,6336,51205,413351,3335651,26915305,217172736,1752296281,14138673395,114079985111,920471087701,7426955448000,59925473898301,483517428660911,3901330906652795,31478457514091281,253988526230055936 mul $0,2 add $0,2 seq $0,5178 ; Number of domino tilings of 4 X (n-1) board.
src/gen-commands-docs.adb
Letractively/ada-gen
0
13707
----------------------------------------------------------------------- -- gen-commands-docs -- Extract and generate documentation for the project -- Copyright (C) 2012 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with GNAT.Command_Line; with Ada.Text_IO; with Gen.Artifacts.Docs; with Gen.Model.Packages; package body Gen.Commands.Docs is use GNAT.Command_Line; -- ------------------------------ -- Execute the command with the arguments. -- ------------------------------ procedure Execute (Cmd : in Command; Generator : in out Gen.Generator.Handler) is pragma Unreferenced (Cmd); Doc : Gen.Artifacts.Docs.Artifact; M : Gen.Model.Packages.Model_Definition; begin Generator.Read_Project ("dynamo.xml", False); -- Setup the target directory where the distribution is created. declare Target_Dir : constant String := Get_Argument; begin if Target_Dir'Length = 0 then Generator.Error ("Missing target directory"); return; end if; Generator.Set_Result_Directory (Target_Dir); end; Doc.Prepare (M, Generator); end Execute; -- ------------------------------ -- Write the help associated with the command. -- ------------------------------ procedure Help (Cmd : in Command; Generator : in out Gen.Generator.Handler) is pragma Unreferenced (Cmd, Generator); use Ada.Text_IO; begin Put_Line ("build-doc: Extract and generate the project documentation"); Put_Line ("Usage: build-doc"); New_Line; Put_Line (" Extract the documentation from the project source files and generate the"); Put_Line (" project documentation. The following files are scanned:"); Put_Line (" - Ada specifications (src/*.ads)"); Put_Line (" - XML configuration files (config/*.xml)"); Put_Line (" - XML database model files (db/*.xml)"); end Help; end Gen.Commands.Docs;
out/Sum/Signature.agda
JoeyEremondi/agda-soas
39
6914
{- This second-order signature was created from the following second-order syntax description: syntax Sum | S type _⊕_ : 2-ary | l30 term inl : α -> α ⊕ β inr : β -> α ⊕ β case : α ⊕ β α.γ β.γ -> γ theory (lβ) a : α f : α.γ g : β.γ |> case (inl(a), x.f[x], y.g[y]) = f[a] (rβ) b : β f : α.γ g : β.γ |> case (inr(b), x.f[x], y.g[y]) = g[b] (cη) s : α ⊕ β c : (α ⊕ β).γ |> case (s, x.c[inl(x)], y.c[inr(y)]) = c[s] -} module Sum.Signature where open import SOAS.Context -- Type declaration data ST : Set where _⊕_ : ST → ST → ST infixl 30 _⊕_ open import SOAS.Syntax.Signature ST public open import SOAS.Syntax.Build ST public -- Operator symbols data Sₒ : Set where inlₒ inrₒ : {α β : ST} → Sₒ caseₒ : {α β γ : ST} → Sₒ -- Term signature S:Sig : Signature Sₒ S:Sig = sig λ { (inlₒ {α}{β}) → (⊢₀ α) ⟼₁ α ⊕ β ; (inrₒ {α}{β}) → (⊢₀ β) ⟼₁ α ⊕ β ; (caseₒ {α}{β}{γ}) → (⊢₀ α ⊕ β) , (α ⊢₁ γ) , (β ⊢₁ γ) ⟼₃ γ } open Signature S:Sig public
sample_tests/basic.asm
NullOsama/SIC-Assembler
0
243893
COPY START 1000 FIRST STL RETADR CLOOP JSUB RDREC LDA LENGTH COMP ZERO JEQ ENDFIL JSUB WRREC J CLOOP ENDFIL LDA EOF STA BUFFER LDA THREE STA LENGTH JSUB WRREC LDL RETADR RSUB EOF BYTE C'EOF' THREE WORD 3 ZERO WORD 0 RETADR RESW 1 LENGTH RESW 1 BUFFER RESB 4096 RDREC LDX ZERO LDA ZERO RLOOP TD INPUT JEQ RLOOP RD INPUT COMP ZERO JEQ EXIT STCH BUFFER,X TIX MAXLEN JLT RLOOP EXIT STX LENGTH RSUB INPUT BYTE X'F1' MAXLEN WORD 4096 WRREC LDX ZERO WLOOP TD OUTPUT JEQ WLOOP LDCH BUFFER,X WD OUTPUT TIX LENGTH JLT WLOOP RSUB OUTPUT BYTE X'05' END FIRST
Cubical/Structures/Constant.agda
RobertHarper/cubical
0
5428
<filename>Cubical/Structures/Constant.agda {- Constant structure: _ ↦ A -} {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Structures.Constant where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.SIP private variable ℓ ℓ' : Level -- Structured isomorphisms module _ (A : Type ℓ') where ConstantStructure : Type ℓ → Type ℓ' ConstantStructure _ = A ConstantEquivStr : StrEquiv {ℓ} ConstantStructure ℓ' ConstantEquivStr (_ , a) (_ , a') _ = a ≡ a' constantUnivalentStr : UnivalentStr {ℓ} ConstantStructure ConstantEquivStr constantUnivalentStr e = idEquiv _
gfx/pokemon/charmeleon/anim.asm
Dev727/ancientplatinum
28
9505
<filename>gfx/pokemon/charmeleon/anim.asm frame 3, 08 frame 2, 08 frame 3, 08 frame 2, 08 frame 1, 15 frame 3, 08 frame 4, 30 endanim
src/input/input_xy.asm
furrtek/GB303
90
160840
<reponame>furrtek/GB303<gh_stars>10-100 input_xy: call playstop ld a,(JOYP_CURRENT) ;Select ? bit 2,a ret nz ld a,(HWOK_ADC) ;No controls if pots are OK or a ret nz ld a,(JOYP_ACTIVE) bit 4,a jr z,+ ld a,(CUTOFFSET) cp 96-1 jr z,+ inc a ld (CUTOFFSET),a +: ld a,(JOYP_ACTIVE) bit 5,a jr z,+ ld a,(CUTOFFSET) or a jr z,+ dec a ld (CUTOFFSET),a +: ld a,(JOYP_ACTIVE) bit 6,a jr z,+ ld a,(RESON) cp 16-1 jr z,+ inc a ld (RESON),a +: ld a,(JOYP_ACTIVE) bit 7,a jr z,+ ld a,(RESON) or a jr z,+ dec a ld (RESON),a +: ret
src/sdl-events-keyboards.adb
Fabien-Chouteau/sdlada
89
30077
<gh_stars>10-100 -------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2020, <NAME> -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- -- 3. This notice may not be removed or altered from any source -- distribution. -------------------------------------------------------------------------------------------------------------------- with Interfaces.C.Strings; package body SDL.Events.Keyboards is package C renames Interfaces.C; function Value (Name : in String) return SDL.Events.Keyboards.Scan_Codes is function SDL_Get_Scan_Code_From_Name (Name : in C.char_array) return SDL.Events.Keyboards.Scan_Codes with Import => True, Convention => C, External_Name => "SDL_GetScancodeFromName"; begin return SDL_Get_Scan_Code_From_Name (C.To_C (Name)); end Value; function Image (Scan_Code : in SDL.Events.Keyboards.Scan_Codes) return String is function SDL_Get_Scan_Code_Name (Scan_Code : in SDL.Events.Keyboards.Scan_Codes) return C.Strings.chars_ptr with Import => True, Convention => C, External_Name => "SDL_GetScancodeName"; begin return C.Strings.Value (SDL_Get_Scan_Code_Name (Scan_Code)); end Image; function Value (Name : in String) return SDL.Events.Keyboards.Key_Codes is function SDL_Get_Key_From_Name (Name : in C.char_array) return SDL.Events.Keyboards.Key_Codes with Import => True, Convention => C, External_Name => "SDL_GetKeyFromName"; begin return SDL_Get_Key_From_Name (C.To_C (Name)); end Value; function Image (Key_Code : in SDL.Events.Keyboards.Key_Codes) return String is function SDL_Get_Key_Name (Key_Code : in SDL.Events.Keyboards.Key_Codes) return C.Strings.chars_ptr with Import => True, Convention => C, External_Name => "SDL_GetKeyName"; begin return C.Strings.Value (SDL_Get_Key_Name (Key_Code)); end Image; function To_Key_Code (Scan_Code : in SDL.Events.Keyboards.Scan_Codes) return SDL.Events.Keyboards.Key_Codes is function SDL_Get_Key_From_Scan_Code (Scan_Code : in SDL.Events.Keyboards.Scan_Codes) return SDL.Events.Keyboards.Key_Codes with Import => True, Convention => C, External_Name => "SDL_GetKeyFromScancode"; begin return SDL_Get_Key_From_Scan_Code (Scan_Code); end To_Key_Code; function To_Scan_Code (Key_Code : in SDL.Events.Keyboards.Key_Codes) return SDL.Events.Keyboards.Scan_Codes is function SDL_Get_Scan_Code_From_Key (Key_Code : in SDL.Events.Keyboards.Key_Codes) return SDL.Events.Keyboards.Scan_Codes with Import => True, Convention => C, External_Name => "SDL_GetScancodeFromKey"; begin return SDL_Get_Scan_Code_From_Key (Key_Code); end To_Scan_Code; end SDL.Events.Keyboards;
src/servlet-routes-servlets-rest.ads
My-Colaborations/ada-servlet
6
21856
<reponame>My-Colaborations/ada-servlet<gh_stars>1-10 ----------------------------------------------------------------------- -- servlet-reoutes-servlets-rest -- Route for the REST API -- Copyright (C) 2016 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Servlet.Rest; package Servlet.Routes.Servlets.Rest is type Descriptor_Array is array (Servlet.Rest.Method_Type) of Servlet.Rest.Descriptor_Access; -- The route has one descriptor for each REST method. type API_Route_Type is new Servlet.Routes.Servlets.Servlet_Route_Type with record Descriptors : Descriptor_Array; end record; type API_Route_Type_Access is access all API_Route_Type'Class; end Servlet.Routes.Servlets.Rest;
libsrc/_DEVELOPMENT/arch/zx/display/c/sccz80/zx_saddr2aaddr.asm
meesokim/z88dk
0
173139
<filename>libsrc/_DEVELOPMENT/arch/zx/display/c/sccz80/zx_saddr2aaddr.asm ; void *zx_saddr2aaddr(void *saddr) SECTION code_arch PUBLIC zx_saddr2aaddr zx_saddr2aaddr: INCLUDE "arch/zx/display/z80/asm_zx_saddr2aaddr.asm"
programs/oeis/057/A057037.asm
karttu/loda
0
168732
<gh_stars>0 ; A057037: Let R(i,j) be the rectangle with antidiagonals 1; 2,3; 4,5,6; ...; each k is an R(i(k),j(k)) and A057037(n)=j(2n-1). ; 1,1,2,4,2,5,3,1,5,3,1,6,4,2,8,6,4,2,9,7,5,3,1,9,7,5,3,1,10,8,6,4,2,12,10,8,6,4,2,13,11,9,7,5,3,1,13,11,9,7,5,3,1,14,12,10,8,6,4,2,16,14,12,10,8,6,4,2,17,15,13,11,9,7,5,3,1,17,15,13 mov $1,1 mov $2,$0 mul $2,2 mov $3,$2 add $3,1 lpb $3,1 mov $0,$3 trn $3,$1 add $1,1 lpe sub $1,$0
programs/oeis/010/A010986.asm
karttu/loda
1
245921
; A010986: Binomial coefficient C(n,33). ; 1,34,595,7140,66045,501942,3262623,18643560,95548245,445891810,1917334783,7669339132,28760021745,101766230790,341643774795,1093260079344,3348108992991,9847379391150,27900908274925,76360380541900,202355008436035,520341450264090,1300853625660225,3167295784216200,7522327487513475 add $0,33 mov $1,$0 bin $1,33
a05/a05A.asm
Sahilsinggh/MP_SEM4
1
166238
global fileDescriptor,char,buffer,lenText; extern _TextCount; %include "macro.asm" section .data dash: db 10,"----------------------------------------------------------",10; lenDash: equ $-dash; reqFile: db "Enter File Name (with extension): "; lenReqFile: equ $-reqFile; reqChar: db "Enter Character to Search: "; lenReqChar: equ $-reqChar; errMsg: db "File Opening Error!"; lenErrMsg: equ $-errMsg; space: db " "; newLine: db 10d; section .bss buffer: resb 8192; lenBuffer: equ $-buffer; fileName: resb 64; char: resb 2; fileDescriptor: resq 1; lenText: resq 1; section .text global _start _start: print dash,lenDash; print reqFile,lenReqFile; read fileName,64; dec rax; //String Length in RAX on SYS_READ call mov byte[fileName+rax],0; print reqChar,lenReqChar; read char,2; fopen fileName; //File-Descriptor is Stored in RAX on SYS_OPEN call cmp rax,-1d; //-1 is returned to RAX in Case of File Opening Error jle error; // jle is used for Signed Comparison mov [fileDescriptor],rax; fread [fileDescriptor],buffer,lenBuffer; mov [lenText],rax; //String Length in RAX on SYS_READ call call _TextCount; jmp exit error: print errMsg,lenErrMsg; exit: print dash,lenDash; fclose [fileDescriptor] mov rax,60; mov rdi,0; syscall;
data/tilesets/ledge_tiles.asm
opiter09/ASM-Machina
1
102461
<reponame>opiter09/ASM-Machina LedgeTiles: ; player direction, tile player standing on, ledge tile, input required db SPRITE_FACING_DOWN, $2C, $37, D_DOWN db SPRITE_FACING_DOWN, $39, $36, D_DOWN db SPRITE_FACING_DOWN, $39, $37, D_DOWN db SPRITE_FACING_LEFT, $2C, $27, D_LEFT db SPRITE_FACING_LEFT, $39, $27, D_LEFT db SPRITE_FACING_RIGHT, $2C, $0D, D_RIGHT db SPRITE_FACING_RIGHT, $2C, $1D, D_RIGHT db SPRITE_FACING_RIGHT, $39, $0D, D_RIGHT db -1 ; end
tools/configure/configure-rtl_version.adb
svn2github/matreshka
24
29516
<reponame>svn2github/matreshka ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Tools Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2014, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This procedure detects version of compiler and construct RTL's version -- suffux. ------------------------------------------------------------------------------ with GNAT.Expect; with GNAT.Regpat; procedure Configure.RTL_Version is use Ada.Strings.Unbounded; use GNAT.Expect; use GNAT.Regpat; function "+" (Item : String) return Unbounded_String renames To_Unbounded_String; ------------------------ -- Detect_RTL_Version -- ------------------------ procedure Detect_RTL_Version is GCC_Process : Process_Descriptor; Result : Expect_Match; Matches : Match_Array (0 .. 4); GCC_Version : Unbounded_String; Pro_Version : Unbounded_String; GPL_Version : Unbounded_String; begin -- Looking for GNAT Pro or GNAT GPL sinature. Non_Blocking_Spawn (GCC_Process, "gcc", (1 => new String'("-v")), 4096, True); begin Expect (GCC_Process, Result, "gcc \S+ [0-9]+\.[0-9]+\.[0-9]+.*" & "(GNAT Pro ([0-9]+\.[0-9]+)\.[0-9]+w?" & "|GNAT GPL ([0-9][0-9][0-9][0-9])" & "|GNAT GPL gpl-([0-9][0-9][0-9][0-9]))", Matches); if Matches (1) /= No_Match then if Matches (4) /= No_Match then GPL_Version := +Expect_Out (GCC_Process) (Matches (4).First .. Matches (4).Last); elsif Matches (3) /= No_Match then GPL_Version := +Expect_Out (GCC_Process) (Matches (3).First .. Matches (3).Last); else Pro_Version := +Expect_Out (GCC_Process) (Matches (2).First .. Matches (2).Last); end if; end if; exception when GNAT.Expect.Process_Died => -- This exception is raised when there is no match found in the -- process's output, so when GNAT compiler doesn't output GNAT -- Pro or GNAT GPL signature. null; end; Close (GCC_Process); -- Looking for GCC version. Non_Blocking_Spawn (GCC_Process, "gcc", (1 => new String'("-v")), 4096, True); Expect (GCC_Process, Result, "gcc \S+ ([0-9]+\.[0-9]+)\.[0-9]+", Matches); GCC_Version := +Expect_Out (GCC_Process) (Matches (1).First .. Matches (1).Last); Close (GCC_Process); -- Select most appropriate version. For GNAT Pro and GNAT GPL it is -- vendor's version, for FSF GCC it is version of GCC core. if Pro_Version /= Null_Unbounded_String then Substitutions.Insert (RTL_Version_Suffix_Name, '-' & Pro_Version); elsif GPL_Version /= Null_Unbounded_String then Substitutions.Insert (RTL_Version_Suffix_Name, '-' & GPL_Version); else Substitutions.Insert (RTL_Version_Suffix_Name, '-' & GCC_Version); end if; end Detect_RTL_Version; begin Detect_RTL_Version; end Configure.RTL_Version;
src/dovado_rtl/antlr/old_grammars/SysVerilogHDL.g4
DavideConficconi/dovado
12
5718
<reponame>DavideConficconi/dovado<gh_stars>10-100 // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. //*******************************************************************/ // * Company: Microsoft Corporation */ * Engineer: <NAME> */ * */ * Revision: */ * // Revision 0.1.0 - Internal Beta Release */ * Revision 0.2.0 - ANTLR GitHub Release */ * */ * // Additional Comments: */ * */ *******************************************************************/ grammar SysVerilogHDL; /**********LEXER**********/ // Channels fragment COMMENT_TEXT: .*?; Carriage_return: '\r' -> channel(HIDDEN); Forward_slash_forward_slash: '//' -> channel(3); Forward_slash_star: '/*' -> channel(3); New_line: '\n' -> channel(HIDDEN); Star_forward_slash: '*/' -> channel(3); Block_comment: Forward_slash_star COMMENT_TEXT Star_forward_slash -> channel(3); //Line directive emitted by preprocessor before and after include file insertion. Line_directive: '`line' .*? Carriage_return? New_line -> channel(2); One_line_comment: Forward_slash_forward_slash COMMENT_TEXT Carriage_return? New_line -> channel(3); WHITE_SPACE: [ \t\r\n]+ -> channel(HIDDEN); // numbers fragment Binary_base: Quote [sS]? [bB]; fragment Binary_digit: X_digit | Z_digit | [01]; fragment Binary_value: Binary_digit ( '_' | Binary_digit)*; fragment Decimal_base: Quote [sS]? [dD]; fragment Decimal_digit: [0-9]; fragment Exp: 'e' | 'E'; fragment Hex_base: Quote [sS]? [hH]; fragment Hex_digit: X_digit | Z_digit | [0-9a-fA-F]; fragment Hex_value: Hex_digit ( '_' | Hex_digit)*; fragment No_base: Quote [sS]?; fragment Non_zero_decimal_digit: [1-9]; fragment Non_zero_unsigned_number: Non_zero_decimal_digit ('_' | Decimal_digit)*; fragment Octal_base: Quote [sS]? [oO]; fragment Octal_digit: X_digit | Z_digit | [0-7]; fragment Octal_value: Octal_digit ( '_' | Octal_digit)*; fragment Size: Non_zero_unsigned_number; fragment Unsigned_number: Decimal_digit ( '_' | Decimal_digit)*; fragment X_digit: [xX]; fragment Z_digit: [zZ?]; Binary_number: ( Size)? Binary_base Binary_value; Decimal_number: Unsigned_number | ( Size)? Decimal_base Unsigned_number | ( Size)? Decimal_base X_digit ( '_')* | ( Size)? Decimal_base Z_digit ( '_')* | No_base Unsigned_number | No_base X_digit ( '_')* | No_base Z_digit ( '_')*; Fixed_point_number: Unsigned_number Dot Unsigned_number; Hex_number: ( Size)? Hex_base Hex_value; Octal_number: ( Size)? Octal_base Octal_value; Real_exp_form: Unsigned_number (Dot Unsigned_number)? Exp ('+' | '-')? Unsigned_number; Unbased_unsized_literal: '\'0' | '\'1' | Quote Z_or_x; // Keywords Always: 'always'; Always_comb: 'always_comb'; Always_ff: 'always_ff'; And: 'and'; Assert: 'assert'; Assign: 'assign'; Automatic: 'automatic'; Begin: 'begin'; Bit: 'bit'; Buf: 'buf'; Bufif0: 'bufif0'; Bufif1: 'bufif1'; Byte: 'byte'; Case_keyword: 'case'; Casez: 'casez'; Casex: 'casex'; Cell: 'cell'; Cmos: 'cmos'; Config: 'config'; Const: 'const'; Deassign: 'deassign'; Default: 'default'; Default_nettype: '`default_nettype'; Defparam: 'defparam'; Design: 'design'; Disable: 'disable'; Do: 'do'; Edge: 'edge'; Else: 'else'; End: 'end'; Endcase: 'endcase'; Endconfig: 'endconfig'; Endfunction: 'endfunction'; Endgenerate: 'endgenerate'; Endmodule: 'endmodule'; Endpackage: 'endpackage'; Endproperty: 'endproperty'; Endspecify: 'endspecify'; Endtask: 'endtask'; Enum: 'enum'; Event_keyword: 'event'; Final: 'final'; For: 'for'; Force: 'force'; Forever: 'forever'; Fork: 'fork'; Function: 'function'; Generate: 'generate'; Genvar: 'genvar'; Highz0: 'highz0'; Highz1: 'highz1'; If: 'if'; Iff: 'iff'; Ifnone: 'ifnone'; Import: 'import'; Incdir: '-incdir'; Initial: 'initial'; Inout: 'inout'; Input: 'input'; Instance: 'instance'; Int: 'int'; Integer: 'integer'; Join: 'join'; Join_any: 'join_any'; Join_none: 'join_none'; Large: 'large'; Liblist: 'liblist'; Library: '`library'; Localparam: 'localparam'; Logic: 'logic'; Macromodule: 'macromodule'; Medium: 'medium'; Module_keyword_only: 'module'; Nand: 'nand'; Negedge: 'negedge'; Nmos: 'nmos'; NONE: 'none'; Nor: 'nor'; Not: 'not'; Notif0: 'notif0'; Notif1: 'notif1'; Noshowcancelled: 'noshowcancelled'; Or: 'or '; Output: 'output'; Parameter: 'parameter'; Path_pulse_dollar: 'PATHPULSE$'; Posedge: 'posedge'; Package: 'package'; Packed: 'packed'; Pmos: 'pmos'; Property: 'property'; Pull0: 'pull0'; Pull1: 'pull1'; Pullup: 'pullup'; Pulldown: 'pulldown'; Pulsestyle_ondetect: 'pulsestyle_ondetect'; Pulsestyle_onevent: 'pulsestyle_onevent'; Rcmos: 'rcmos'; Real: 'real'; Realtime: 'realtime'; Ref: 'ref'; Reg: 'reg'; Release: 'release'; Repeat: 'repeat'; Return: 'return'; Rnmos: 'rnmos'; Rpmos: 'rpmos'; Rtran: 'rtran'; Rtranif0: 'rtranif0'; Rtranif1: 'rtranif1'; Scalared: 'scalared'; Showcancelled: 'showcancelled'; Signed: 'signed'; Small: 'small'; Specify: 'specify'; Specparam: 'specparam'; Static: 'static'; SVString: 'string'; Strong0: 'strong0'; Strong1: 'strong1'; Struct: 'struct'; Supply0: 'supply0'; Supply1: 'supply1'; Task: 'task'; Tick_timescale: '`timescale'; Time: 'time'; Timeprecision: 'timeprecision'; Timeunit: 'timeunit'; Tran: 'tran'; Tranif0: 'tranif0'; Tranif1: 'tranif1'; Tri: 'tri'; Tri_and: 'triand'; Tri_or: 'trior'; Tri_reg: 'trireg'; Tri0: 'tri0'; Tri1: 'tri1'; Typedef: 'typedef'; UnionStruct: 'union'; Unsigned: 'unsigned'; Use: 'use'; Uwire: 'uwire'; Vectored: 'vectored'; Wait: 'wait'; Wand: 'wand'; Weak0: 'weak0'; Weak1: 'weak1'; While: 'while'; Wire: 'wire'; Wor: 'wor'; Xnor: 'xnor'; Xor: 'xor'; module_keyword: Module_keyword_only | Macromodule; struct_keyword: Struct | UnionStruct; any_case_keyword: Case_keyword | Casez | Casex; // literals fragment ALPHA: [a-zA-Z_]; fragment DIGIT: [0-9]; Dollar_Identifier: '$' [a-zA-Z0-9_$] [a-zA-Z0-9_$]*; Escaped_identifier: '\\' ~[ \r\t\n]*; Simple_identifier: ALPHA (ALPHA | DIGIT)*; String_literal: '"' (~('"' | '\n' | '\r') | '""')* '"'; // punctuation At: '@'; Close_parenthesis: ')'; Colon: ':'; Comma: ','; Dash_right_angle: '->'; Dot: '.'; Dollar: '$'; Double_colon: '::'; Equal: '='; Equals_right_angle: '=>'; Forward_slash: '/'; Hash: '#'; Left_angle_equals: '<='; Left_bracket: '['; Left_curly_bracket: '{'; Minus_colon: '-:'; Open_parenthesis: '('; Plus_colon: '+:'; Question_mark: '?'; Quote: '\''; Right_bracket: ']'; Right_curly_bracket: '}'; Semicolon: ';'; Star: '*'; Star_right_angle: '*>'; Tilde: '~'; semicolon: ';' | ';;' | ';' ';'; //Operators // polarity_operator : '+' | '-' ; unary_operator: '+' | '-' | '!' | '~' | '&' | '~&' | '|' | '~|' | '^' | '~^' | '^~'; binary_operator: '+' | '-' | '*' | '/' | '%' | '==' | '!=' | '===' | '!==' | '&&' | '||' | '**' | '<' | '<=' | '>' | '>=' | '&' | '|' | '^' | '^~' | '~^' | '>>' | '<<' | '>>>' | '<<<'; //unary_module_path_operator : '!' | '~' | '&' | '~&' | '|' | '~|' | '^' | '~^' | '^~' ; // binary_module_path_operator : '==' | '!=' | '&&' | '||' | '&' | '|' | '^' | '^~' | '~^' ; unary_assign_operator: '++' | '--'; binary_assign_operator: '+=' | '-=' | '&=' | '|='; //Time fragment Time_unit: 's ' | 'ms' | 'us' | 'ns' | 'ps' | ' fs'; Time_literal: Decimal_number ' '? Time_unit | Fixed_point_number ' '? Time_unit; //Edge fragment Edge_descriptor: '01' | '10' | Z_or_x Zero_or_one | Zero_or_one Z_or_x; fragment Zero_or_one: [01]; fragment Z_or_x: [xXzZ]; Edge_control_specifier: Edge Right_bracket Edge_descriptor (Comma Edge_descriptor)* Left_bracket; /**********LEXER**********/ /**********PARSER**********/ //Source Text source_text: description_star EOF; //Description description_star: ( description)*; header_text: compiler_directive | design_attribute | import_package; design_attribute: attribute_instance; compiler_directive: timescale_compiler_directive | default_nettype_statement; description: header_text | package_declaration semicolon? | module_declaration semicolon? | function_declaration semicolon? | enum_declaration semicolon? | typedef_declaration semicolon?; /**********PARSER**********/ /**********MODULES**********/ module_declaration: attribute_instance_star module_keyword module_identifier module_interface semicolon module_item_star Endmodule (colon_module_identifier)?; module_identifier: identifier; module_interface: (module_parameter_interface)? ( module_port_interface )?; module_parameter_interface: Hash Open_parenthesis (list_of_interface_parameters)? Close_parenthesis; module_port_interface: Open_parenthesis (list_of_interface_ports)? Close_parenthesis; module_item_star: (module_item)*; module_item: import_package | parameter_item_semicolon | attr_port_item_semicolon //| variable_item | attr_variable_item_semicolon | subroutine_item_semicolon | attr_construct_item | attr_generated_instantiation | attr_component_item | compiler_item | type_item ; //| verification_item colon_module_identifier: Colon module_identifier; /**********MODULES**********/ /**********PACKAGES**********/ package_declaration: attribute_instance_star Package package_identifier semicolon package_item_star Endpackage ( colon_package_identifier )?; package_identifier: identifier; colon_package_identifier: Colon package_identifier; package_item_star: (package_item)*; package_item: import_package | parameter_item_semicolon //| attr_port_item_semicolon | variable_item | attr_variable_item_semicolon | subroutine_item_semicolon //| attr_construct_item | attr_generated_instantiation | attr_component_item | compiler_item | type_item ; //| verification_item import_package: Import package_identifier Double_colon Star semicolon | Import package_identifier Double_colon package_item_identifier semicolon; package_item_identifier: identifier; /**********PACKAGES**********/ /**********ITEMS**********/ parameter_item_semicolon: parameter_item semicolon; parameter_item: parameter_declaration | local_parameter_declaration | parameter_override; attr_port_item_semicolon: attribute_instance_star port_declaration semicolon; //attr_port_item_semicolon : attr_port_declaration_semicolon ; attr_variable_item_semicolon: attribute_instance_star variable_item semicolon; variable_item: net_declaration | reg_declaration | logic_declaration | bits_declaration | integer_declaration | int_declaration | real_declaration | time_declaration | realtime_declaration | event_declaration | genvar_declaration | usertype_variable_declaration | string_declaration | struct_declaration | enum_declaration; subroutine_item_semicolon: subroutine_item semicolon?; subroutine_item: task_declaration | function_declaration; attr_construct_item: attribute_instance_star construct_item; construct_item: continuous_assign | initial_construct | final_construct | always_construct; attr_component_item: attribute_instance_star component_item; component_item: module_instantiation | gate_instantiation; compiler_item: timescale_compiler_directive | timeunit_directive semicolon | timeprecision_directive semicolon; type_item: default_nettype_statement | typedef_declaration semicolon; //verification_item : assertion_property_block | specify_block | specparam_declaration | // property_block ; null_item: semicolon; /**********ITEMS**********/ /**********PARAMETERS**********/ list_of_interface_parameters: list_of_parameter_declarations | list_of_parameter_descriptions; list_of_parameter_declarations: parameter_declaration comma_parameter_declaration_star; comma_parameter_declaration_star: (comma_parameter_declaration)*; comma_parameter_declaration: Comma parameter_declaration; list_of_parameter_descriptions: list_of_variable_descriptions; param_declaration: (Signed | Unsigned)? (dimension_plus)? list_of_hierarchical_variable_descriptions ; param_description: param_declaration //| net_declaration | reg_declaration | logic_declaration //| bits_declaration | integer_declaration | int_declaration | real_declaration | time_declaration | realtime_declaration //| event_declaration | genvar_declaration | usertype_variable_declaration | string_declaration //| struct_declaration | enum_declaration; parameter_declaration: Parameter param_description; local_parameter_declaration: Localparam param_description; parameter_override: Defparam param_description; /**********PARAMETERS**********/ /**********PORTS**********/ list_of_tf_interface_ports: list_of_port_identifiers | list_of_tf_port_declarations; list_of_tf_port_declarations: list_of_tf_port_declarations_comma | list_of_tf_port_declarations_semicolon; list_of_tf_port_declarations_comma: attr_tf_port_declaration comma_attr_tf_port_declaration_star; comma_attr_tf_port_declaration_star: ( comma_attr_tf_port_declaration )*; comma_attr_tf_port_declaration: Comma attr_tf_port_declaration; list_of_tf_port_declarations_semicolon: attr_tf_port_declaration_semicolon_plus; attr_tf_port_declaration_semicolon_plus: ( attr_tf_port_declaration_semicolon )+; attr_tf_port_declaration_semicolon_star: ( attr_tf_port_declaration_semicolon )*; attr_tf_port_declaration_semicolon: attr_tf_port_declaration semicolon; attr_tf_port_declaration: attribute_instance_star tf_port_declaration; tf_port_declaration: inout_declaration | input_declaration | output_declaration | ref_declaration | tf_declaration; list_of_interface_ports: list_of_port_identifiers | list_of_port_declarations; list_of_port_identifiers: port_identifier comma_port_identifier_star (Comma)?; comma_port_identifier_star: ( comma_port_identifier)*; comma_port_identifier: Comma port_identifier; port_identifier: identifier; list_of_port_declarations: list_of_port_declarations_comma | list_of_port_declarations_semicolon; list_of_port_declarations_comma: attr_port_declaration comma_attr_port_declaration_star; comma_attr_port_declaration_star: (comma_attr_port_declaration)*; comma_attr_port_declaration: Comma attr_port_declaration; list_of_port_declarations_semicolon: attr_port_declaration_semicolon_plus; attr_port_declaration_semicolon_plus: ( attr_port_declaration_semicolon )+; attr_port_declaration_semicolon_star: ( attr_port_declaration_semicolon )*; attr_port_declaration_semicolon: attr_port_declaration semicolon; attr_port_declaration: attribute_instance_star port_declaration; port_declaration: inout_declaration | input_declaration | output_declaration | ref_declaration ; //| tf_declaration port_description: (Signed | Unsigned)? (dimension_plus)? list_of_variable_descriptions; inout_description: port_description | net_declaration; input_description: port_description | net_declaration | reg_declaration | logic_declaration | bits_declaration | int_declaration | integer_declaration | real_declaration | time_declaration | usertype_variable_declaration | string_declaration; output_description: port_description | net_declaration | reg_declaration | logic_declaration | integer_declaration | time_declaration | usertype_variable_declaration | string_declaration; ref_description: port_description | net_declaration | reg_declaration | logic_declaration | integer_declaration | time_declaration | usertype_variable_declaration | string_declaration; tf_declaration: port_description | real_declaration | net_declaration | reg_declaration | logic_declaration | bits_declaration | int_declaration | integer_declaration | time_declaration | usertype_variable_declaration | string_declaration; inout_declaration: Inout inout_description; input_declaration: Input input_description; output_declaration: Output output_description; ref_declaration: Ref ref_description; /**********PORTS**********/ /**********DECLARATIONS**********/ user_type: user_type_identifer; user_type_identifer: identifier; dimension_plus: ( dimension)+; dimension_star: ( dimension)*; dimension: Left_bracket range_expression Right_bracket; range_expression: index_expression | sb_range | base_increment_range | base_decrement_range; index_expression: expression | Dollar | Star; sb_range: base_expression Colon expression; base_increment_range: base_expression Plus_colon expression; base_decrement_range: base_expression Minus_colon expression; base_expression: expression; net_type: Supply0 | Supply1 | Tri | Tri_and | Tri_or | Tri_reg | Tri0 | Tri1 | Uwire | Wire | Wand | Wor | NONE; drive_strength: Open_parenthesis drive_strength_value_0 Comma drive_strength_value_1 Close_parenthesis; drive_strength_value_0: strength0 | strength1 | highz0 | highz1; drive_strength_value_1: strength0 | strength1 | highz0 | highz1; strength0: Supply0 | Strong0 | Pull0 | Weak0; strength1: Supply1 | Strong1 | Pull1 | Weak1; highz0: Highz0; highz1: Highz1; charge_strength: Open_parenthesis charge_size Close_parenthesis; charge_size: Small | Medium | Large; list_of_variable_descriptions: variable_description comma_variable_description_star; comma_variable_description_star: (comma_variable_description)*; comma_variable_description: Comma variable_description; variable_description: variable_identifier (dimension_plus)? (Equal expression)?; variable_identifier: identifier; list_of_hierarchical_variable_descriptions: hierarchical_variable_description comma_hierarchical_variable_description_star; comma_hierarchical_variable_description_star: ( comma_hierarchical_variable_description )*; comma_hierarchical_variable_description: Comma hierarchical_variable_description; hierarchical_variable_description: hierarchical_variable_identifier (dimension_plus)? ( Equal expression )?; hierarchical_variable_identifier: hierarchical_identifier; net_declaration: net_type (user_type)? (drive_strength)? (charge_strength)? ( Vectored | Scalared )? (Signed | Unsigned)? (dimension_plus)? (delay)? list_of_variable_descriptions; reg_declaration: Reg (Signed | Unsigned)? (dimension_plus)? list_of_variable_descriptions; logic_declaration: Logic (Signed | Unsigned)? (dimension_plus)? list_of_variable_descriptions; bits_type: Bit | Byte; bits_declaration: bits_type (Signed | Unsigned)? (dimension_plus)? list_of_variable_descriptions; integer_declaration: (Automatic)? Integer (Signed | Unsigned)? list_of_variable_descriptions; int_declaration: (Automatic | Static | Const)? Int ( Signed | Unsigned )? list_of_variable_descriptions; real_declaration: Real list_of_variable_descriptions; time_declaration: Time list_of_variable_descriptions; realtime_declaration: Realtime list_of_variable_descriptions; event_declaration: Event_keyword list_of_variable_descriptions; genvar_declaration: Genvar list_of_variable_descriptions; usertype_variable_declaration: (Automatic)? user_type (dimension)? list_of_variable_descriptions; string_declaration: SVString list_of_variable_descriptions; struct_declaration: struct_type list_of_variable_descriptions; enum_declaration: enumerated_type list_of_variable_descriptions; /**********DECLARATIONS**********/ /**********FUNCTIONS**********/ function_declaration: Function (Automatic)? (Signed | Unsigned)? (function_type)? ( dimension )? function_identifier (function_interface)? semicolon function_item_declaration_star function_statement Endfunction ( colon_function_identifier )?; function_type: Logic | Integer | Int | Real | Realtime | Time | Reg | SVString | bits_type | user_type; function_identifier: identifier; function_interface: Open_parenthesis (list_of_tf_interface_ports)? Close_parenthesis; function_item_declaration_star: ( function_item_declaration_semicolon )*; function_item_declaration_semicolon: function_item_declaration semicolon; function_item_declaration: block_item_declaration | port_declaration; function_statement: statement_star; colon_function_identifier: Colon function_identifier; /**********FUNCTIONS**********/ /**********TASKS**********/ task_declaration: Task (Automatic)? task_identifier (task_interface)? semicolon task_item_declaration_star task_statement Endtask; task_identifier: identifier; task_interface: Open_parenthesis (list_of_tf_interface_ports)? Close_parenthesis; task_item_declaration_semicolon: task_item_declaration semicolon; task_item_declaration: block_item_declaration | port_declaration; task_item_declaration_star: ( task_item_declaration_semicolon)*; task_statement: statement_star; /**********TASKS**********/ /**********STRUCTS**********/ struct_item_semicolon: struct_item semicolon; struct_item_star: (struct_item_semicolon)*; struct_item: logic_declaration | bits_declaration | int_declaration | integer_declaration | usertype_variable_declaration | time_declaration; struct_type: struct_keyword (Packed)? Left_curly_bracket struct_item_star Right_curly_bracket; /**********STRUCTS**********/ /**********ENUM**********/ enum_type: Integer | Logic | bits_type | Int; list_of_enum_items: enum_item comma_enum_item_star; enum_item: enum_identifier | enum_identifier Equal expression; enum_identifier: identifier; comma_enum_item_star: (comma_enum_item)*; comma_enum_item: Comma enum_item; enumerated_type: Enum (enum_type)? (Signed | Unsigned)? (dimension)? Left_curly_bracket list_of_enum_items Right_curly_bracket; /**********ENUM**********/ /**********MODULE INST**********/ module_instantiation: module_identifier (parameter_interface_assignments)? list_of_module_instances semicolon; parameter_interface_assignments: Hash Open_parenthesis (list_of_interface_assignments)? Close_parenthesis; list_of_interface_assignments: list_of_ordered_interface_assignments | list_of_named_interface_assignments; list_of_ordered_interface_assignments: ordered_interface_assignment comma_ordered_interface_assignment_star; comma_ordered_interface_assignment_star: ( comma_ordered_interface_assignment )*; comma_ordered_interface_assignment: Comma (ordered_interface_assignment)?; ordered_interface_assignment: expression; list_of_named_interface_assignments: named_interface_assignment comma_named_interface_assignment_star; comma_named_interface_assignment_star: ( comma_named_interface_assignment )*; comma_named_interface_assignment: Comma named_interface_assignment; named_interface_assignment: Dot identifier ( Open_parenthesis (expression)? Close_parenthesis )? | Dot Star; list_of_module_instances: module_instance comma_module_instance_star; comma_module_instance_star: ( comma_module_instance)*; comma_module_instance: Comma module_instance; module_instance: module_instance_identifier (port_interface_assignments)?; module_instance_identifier: arrayed_identifier; arrayed_identifier: simple_arrayed_identifier | escaped_arrayed_identifier; simple_arrayed_identifier: Simple_identifier (dimension)?; escaped_arrayed_identifier: Escaped_identifier (dimension)?; port_interface_assignments: Open_parenthesis (list_of_interface_assignments)? Close_parenthesis; /**********MODULE INST**********/ /**********GATE INST**********/ delay: Hash delay_value | Hash Open_parenthesis list_of_delay_values Close_parenthesis; list_of_delay_values: delay_value comma_delay_value_star; comma_delay_value_star: (comma_delay_value)*; comma_delay_value: Comma delay_value; delay_value: expression; pulldown_strength: Open_parenthesis strength0 Comma strength1 Close_parenthesis | Open_parenthesis strength1 Comma strength0 Close_parenthesis | Open_parenthesis strength0 Close_parenthesis; pullup_strength: Open_parenthesis strength0 Comma strength1 Close_parenthesis | Open_parenthesis strength1 Comma strength0 Close_parenthesis | Open_parenthesis strength1 Close_parenthesis; gate_instance_identifier: arrayed_identifier; gate_instantiation: cmos_instantiation | mos_instantiation | pass_instantiation | pulldown_instantiation | pullup_instantiation | enable_instantiation | n_input_instantiation | n_output_instantiation | pass_enable_instantiation; enable_gatetype: Bufif0 | Bufif1 | Notif0 | Notif1; mos_switchtype: Nmos | Pmos | Rnmos | Rpmos; cmos_switchtype: Cmos | Rcmos; n_output_gatetype: Buf | Not; n_input_gatetype: And | Nand | Or | Nor | Xor | Xnor; pass_switchtype: Tran | Rtran; pass_enable_switchtype: Tranif0 | Tranif1 | Rtranif1 | Rtranif0; pulldown_instantiation: Pulldown (pulldown_strength)? list_of_pull_gate_instance semicolon; pullup_instantiation: Pullup (pullup_strength)? list_of_pull_gate_instance semicolon; enable_instantiation: enable_gatetype (drive_strength)? (delay)? list_of_enable_gate_instance semicolon; mos_instantiation: mos_switchtype (delay)? list_of_mos_switch_instance semicolon; cmos_instantiation: cmos_switchtype (delay)? list_of_cmos_switch_instance semicolon; n_output_instantiation: n_output_gatetype (drive_strength)? (delay)? list_of_n_output_gate_instance semicolon; n_input_instantiation: n_input_gatetype (drive_strength)? (delay)? list_of_n_input_gate_instance semicolon; pass_instantiation: pass_switchtype list_of_pass_switch_instance semicolon; pass_enable_instantiation: pass_enable_switchtype (delay)? list_of_pass_enable_switch_instance semicolon; list_of_pull_gate_instance: pull_gate_instance comma_pull_gate_instance_star; list_of_enable_gate_instance: enable_gate_instance comma_enable_gate_instance_star; list_of_mos_switch_instance: mos_switch_instance comma_mos_switch_instance_star; list_of_cmos_switch_instance: cmos_switch_instance comma_cmos_switch_instance_star; list_of_n_input_gate_instance: n_input_gate_instance comma_n_input_gate_instance_star; list_of_n_output_gate_instance: n_output_gate_instance comma_n_output_gate_instance_star; list_of_pass_switch_instance: pass_switch_instance comma_pass_switch_instance_star; list_of_pass_enable_switch_instance: pass_enable_switch_instance comma_pass_enable_switch_instance_star; comma_pull_gate_instance_star: (comma_pull_gate_instance)*; comma_enable_gate_instance_star: (comma_enable_gate_instance)*; comma_mos_switch_instance_star: (comma_mos_switch_instance)*; comma_cmos_switch_instance_star: (comma_cmos_switch_instance)*; comma_n_input_gate_instance_star: (comma_n_input_gate_instance)*; comma_n_output_gate_instance_star: (comma_n_output_gate_instance)*; comma_pass_switch_instance_star: (comma_pass_switch_instance)*; comma_pass_enable_switch_instance_star: ( comma_pass_enable_switch_instance )*; comma_pull_gate_instance: Comma pull_gate_instance; comma_enable_gate_instance: Comma enable_gate_instance; comma_mos_switch_instance: Comma mos_switch_instance; comma_cmos_switch_instance: Comma cmos_switch_instance; comma_n_input_gate_instance: Comma n_input_gate_instance; comma_n_output_gate_instance: Comma n_output_gate_instance; comma_pass_switch_instance: Comma pass_switch_instance; comma_pass_enable_switch_instance: Comma pass_enable_switch_instance; pull_gate_instance: (gate_instance_identifier)? pull_gate_interface; enable_gate_instance: (gate_instance_identifier)? enable_gate_interface; mos_switch_instance: (gate_instance_identifier)? mos_switch_interface; cmos_switch_instance: (gate_instance_identifier)? cmos_switch_interface; n_input_gate_instance: (gate_instance_identifier)? n_input_gate_interface; n_output_gate_instance: (gate_instance_identifier)? n_output_gate_interface; pass_switch_instance: (gate_instance_identifier)? pass_switch_interface; pass_enable_switch_instance: (gate_instance_identifier)? pass_enable_switch_interface; pull_gate_interface: Open_parenthesis output_terminal Close_parenthesis; enable_gate_interface: Open_parenthesis output_terminal Comma input_terminal Comma enable_terminal Close_parenthesis; mos_switch_interface: Open_parenthesis output_terminal Comma input_terminal Comma enable_terminal Close_parenthesis; cmos_switch_interface: Open_parenthesis output_terminal Comma input_terminal Comma ncontrol_terminal Comma pcontrol_terminal Close_parenthesis; n_input_gate_interface: Open_parenthesis output_terminal Comma list_of_input_terminals Close_parenthesis; n_output_gate_interface: Open_parenthesis list_of_output_terminals Comma input_terminal Close_parenthesis; pass_switch_interface: Open_parenthesis inout_terminal Comma inout_terminal Close_parenthesis; pass_enable_switch_interface: Open_parenthesis inout_terminal Comma inout_terminal Comma enable_terminal Close_parenthesis; list_of_input_terminals: input_terminal comma_input_terminal_star; list_of_output_terminals: output_terminal comma_output_terminal_star; comma_input_terminal_star: (comma_input_terminal)*; comma_output_terminal_star: (comma_output_terminal)*; comma_input_terminal: Comma input_terminal; comma_output_terminal: Comma output_terminal; enable_terminal: expression; input_terminal: expression; inout_terminal: expression; ncontrol_terminal: expression; output_terminal: expression; pcontrol_terminal: expression; /**********GATE INST**********/ /**********STATEMENT**********/ statement_star: ( statement_semicolon)*; statement_semicolon: attribute_instance_star statement semicolon? | null_statement; statement: assignment_statement | flow_control_statement | block_statement | task_call_statement | event_statement | procedural_statement | expression_statement | subroutine_statement; assignment_statement: blocking_assignment | nonblocking_assignment | prefix_assignment | postfix_assignment | operator_assignment | declarative_assignment; flow_control_statement: case_statement | conditional_statement | loop_statement; block_statement: par_block | seq_block; task_call_statement: task_enable | system_task_enable | disable_statement; event_statement: event_trigger | wait_statement; procedural_statement: procedural_continuous_assignments | procedural_timing_control_statement | procedural_assertion_statement | property_statement; expression_statement: expression; subroutine_statement: return_statement; return_statement: Return expression | Return; null_statement: semicolon; /**********STATEMENT**********/ /**********PROCEDURAL**********/ procedural_continuous_assignments: assign_statement | deassign_statement | force_statement | release_statement; assign_statement: Assign assignment_statement; deassign_statement: Deassign variable_lvalue; force_statement: Force assignment_statement; release_statement: Release variable_lvalue; procedural_timing_control_statement: delay_or_event_control statement_semicolon; property_statement: disable_condition_statement; disable_condition_statement: Disable Iff Open_parenthesis expression Close_parenthesis property_expression; property_expression: expression; procedural_assertion_statement: assert_statement (assert_else_statement)?; assert_else_statement: Else statement; assert_statement: (hierarchical_identifier Colon)? Assert Open_parenthesis expression Close_parenthesis; /**********PROCEDURAL**********/ /**********TASKENABLE**********/ system_task_enable: system_task_identifier (task_interface_assignments)?; system_task_identifier: Dollar_Identifier; task_interface_assignments: Open_parenthesis (list_of_interface_assignments)? Close_parenthesis; task_enable: hierarchical_task_identifier (task_interface_assignments)?; hierarchical_task_identifier: hierarchical_identifier; disable_statement: Disable hierarchical_task_identifier | Disable hierarchical_block_identifier; hierarchical_block_identifier: hierarchical_identifier; /**********TASKENABLE**********/ /**********ASSIGNMENTS**********/ variable_lvalue: hierarchical_variable_lvalue | variable_concatenation; hierarchical_variable_lvalue: primary_hierarchical_identifier; variable_concatenation: Left_curly_bracket variable_concatenation_value comma_vcv_star Right_curly_bracket; variable_concatenation_value: primary_hierarchical_identifier | variable_concatenation; comma_vcv_star: ( Comma variable_concatenation_value)*; blocking_assignment: variable_lvalue Equal (delay_or_event_control)? expression; nonblocking_assignment: variable_lvalue Left_angle_equals (delay_or_event_control)? expression; prefix_assignment: unary_assign_operator variable_lvalue; postfix_assignment: variable_lvalue unary_assign_operator; operator_assignment: variable_lvalue binary_assign_operator expression; declarative_assignment: reg_declaration | logic_declaration | bits_declaration | integer_declaration | int_declaration | genvar_declaration; /**********ASSIGNMENTS**********/ /**********DELAY_EVENT**********/ delay_or_event_control: delay_control | event_control | repeat_event_control; delay_control: Hash delay_value | Hash Open_parenthesis delay_value Close_parenthesis | Hash Open_parenthesis mintypmax_expression Close_parenthesis; event_control: event_control_identifier | event_control_expression | event_control_wildcard; event_control_identifier: At event_identifier; event_control_expression: At Open_parenthesis event_expression Close_parenthesis; event_expression: single_event_expression | event_expression_or; single_event_expression: expression | hierarchical_identifier | event_expression_edgespec expression; event_expression_edgespec: Posedge | Negedge; event_expression_or: list_of_event_expression_comma | list_of_event_expression_or; list_of_event_expression_comma: single_event_expression comma_event_expression_star; comma_event_expression_star: (comma_event_expression)*; comma_event_expression: Comma single_event_expression; list_of_event_expression_or: single_event_expression or_event_expression_star; or_event_expression_star: (or_event_expression)*; or_event_expression: Or single_event_expression; event_control_wildcard: At Star | At Open_parenthesis Star Close_parenthesis; repeat_event_control: Repeat Open_parenthesis expression Close_parenthesis event_control; event_trigger: Dash_right_angle hierarchical_event_identifier; hierarchical_event_identifier: hierarchical_identifier; event_identifier: identifier; wait_statement: Wait Open_parenthesis expression Close_parenthesis statement_semicolon; /**********DELAY_EVENT**********/ /**********GENERATES**********/ attr_generated_instantiation: attribute_instance_star generated_instantiation; generated_instantiation: Generate generate_item_star Endgenerate semicolon?; generate_item_star: ( generate_item)*; generate_item: generate_conditional_statement | generate_case_statement | generate_loop_statement | generate_block //| import_package | parameter_item_semicolon //| attr_port_item_semicolon | attr_variable_item_semicolon | subroutine_item_semicolon | attr_construct_item //| attr_generated_instantiation | attr_component_item //| compiler_item | type_item | verification_item | null_item; generate_block: Begin (generate_colon_block_identifier0)? generate_item_star End ( generate_colon_block_identifier1 )? semicolon?; generate_colon_block_identifier0: generate_colon_block_identifier; generate_colon_block_identifier1: generate_colon_block_identifier; generate_colon_block_identifier: Colon generate_block_identifier; generate_block_identifier: identifier; generate_conditional_statement: generate_if_statement (generate_else_statement)?; generate_if_statement: If Open_parenthesis conditional_expression Close_parenthesis generate_item; generate_else_statement: Else generate_item; generate_loop_statement: generate_forever_loop_statement | generate_repeat_loop_statement | generate_while_loop_statement | generate_do_loop_statement | generate_for_loop_statement; generate_forever_loop_statement: Forever generate_item; generate_repeat_loop_statement: Repeat Open_parenthesis loop_terminate_expression Close_parenthesis generate_item; generate_while_loop_statement: While Open_parenthesis loop_terminate_expression Close_parenthesis generate_item; generate_do_loop_statement: Do generate_item While Open_parenthesis loop_terminate_expression Close_parenthesis semicolon; generate_for_loop_statement: For Open_parenthesis loop_init_assignment semicolon loop_terminate_expression semicolon ( loop_step_assignment )? Close_parenthesis generate_item; generate_case_statement: any_case_keyword Open_parenthesis case_switch Close_parenthesis generate_case_item_star Endcase; generate_case_item_star: ( generate_case_item)*; generate_case_item: (case_item_key) Colon generate_item | Default (Colon)? generate_item; /**********GENERATES**********/ /**********CONDITIONAL STATEMENT**********/ conditional_statement: if_statement (else_statement)?; if_statement: If Open_parenthesis conditional_expression Close_parenthesis statement_semicolon; else_statement: Else statement_semicolon; conditional_expression: expression; /**********CONDITIONAL STATEMENT**********/ /**********LOOP STATEMENT**********/ loop_statement: forever_loop_statement | repeat_loop_statement | while_loop_statement | do_loop_statement | for_loop_statement; forever_loop_statement: Forever statement_semicolon; repeat_loop_statement: Repeat Open_parenthesis loop_terminate_expression Close_parenthesis statement_semicolon; while_loop_statement: While Open_parenthesis loop_terminate_expression Close_parenthesis statement_semicolon; do_loop_statement: Do statement_semicolon While Open_parenthesis loop_terminate_expression Close_parenthesis semicolon; for_loop_statement: For Open_parenthesis loop_init_assignment semicolon loop_terminate_expression semicolon ( loop_step_assignment )? Close_parenthesis statement_semicolon; loop_init_assignment: declarative_assignment | blocking_assignment; loop_terminate_expression: expression; loop_step_assignment: blocking_assignment | postfix_assignment | prefix_assignment | operator_assignment; /**********LOOP STATEMENT**********/ /**********CASE STATEMENT**********/ case_statement: any_case_keyword Open_parenthesis case_switch Close_parenthesis case_item_star Endcase; case_item_star: ( case_item)*; case_item: (case_item_key) Colon statement_semicolon | Default (Colon)? statement_semicolon; case_switch: expression; case_item_key: case_item_key_expression comma_case_item_key_expression_star; case_item_key_expression: expression; comma_case_item_key_expression: Comma case_item_key_expression; comma_case_item_key_expression_star: ( comma_case_item_key_expression )*; /**********CASE STATEMENT**********/ /**********EXPRESSION**********/ expression: unary_expression | unary_post_assign_expression | unary_pre_assign_expression | binary_expression | ternary_expression | mintypmax_expression | single_expression; single_expression: String_literal //| primary_range | primary | arrayed_structured_value | structured_value; primary_range: primary dimension; primary: number | concatenation | multiple_concatenation | function_call | system_function_call | constant_function_call | imported_function_call | primary_imported_hierarchical_identifier | primary_hierarchical_identifier | type_cast_expression | parenthesis_expression; unary_expression: unary_operator expression; unary_post_assign_expression: single_expression unary_assign_operator; unary_pre_assign_expression: unary_assign_operator single_expression; binary_expression: single_expression binary_operator expression; ternary_expression: single_expression Question_mark expression Colon expression; mintypmax_expression: single_expression Colon expression Colon expression; structured_value: Quote Left_curly_bracket expression (Comma expression)* Right_curly_bracket | Quote Left_curly_bracket expression Right_curly_bracket | Left_curly_bracket Right_curly_bracket; arrayed_structured_value: Quote Left_curly_bracket arrayed_structure_item_plus Right_curly_bracket; arrayed_structure_item: Default Colon expression | hierarchical_identifier Colon expression; comma_arrayed_structure_item: Comma arrayed_structure_item; comma_arrayed_structure_item_star: (comma_arrayed_structure_item)*; arrayed_structure_item_plus: arrayed_structure_item comma_arrayed_structure_item_star; variable_type_cast: variable_type Quote expression; width_type_cast: number Quote expression; sign_type_cast: (Signed | Unsigned) Quote expression; null_type_cast: Quote expression; variable_type: Int | user_type //| Logic | Integer | Real | Realtime | Time | Reg | SVString | bits_type; type_cast_identifier: identifier; type_cast_expression: variable_type_cast | width_type_cast | sign_type_cast | null_type_cast; function_call: hierarchical_function_identifier attribute_instance_star function_interface_assignments; hierarchical_function_identifier: hierarchical_identifier; function_interface_assignments: Open_parenthesis (list_of_interface_assignments)? Close_parenthesis; system_function_call: system_function_identifier (function_interface_assignments)?; system_function_identifier: Dollar_Identifier; constant_function_call: function_call; imported_function_call: imported_function_hierarchical_identifier attribute_instance_star function_interface_assignments ; imported_function_hierarchical_identifier: imported_hierarchical_identifier; primary_hierarchical_identifier: hierarchical_identifier (dimension_plus)?; primary_imported_hierarchical_identifier: imported_hierarchical_identifier (dimension_plus)?; imported_hierarchical_identifier: identifier Double_colon hierarchical_identifier; parenthesis_expression: Open_parenthesis expression Close_parenthesis; concatenation: Left_curly_bracket expression comma_expression_star Right_curly_bracket; multiple_concatenation: Left_curly_bracket expression concatenation Right_curly_bracket; comma_expression_plus: ( Comma expression)+; comma_expression_star: ( Comma expression)*; /**********EXPRESSION**********/ /**********TYPEDEF**********/ typedef_declaration: Typedef typedef_definition typedef_identifier; typedef_identifier: identifier; typedef_definition: typedef_definition_type | enumerated_type | struct_type; typedef_definition_type: complex_type | typedef_type; complex_type: typedef_type (Signed | Unsigned)? (dimension_plus)?; typedef_type: Reg | Logic | bits_type | net_type | user_type; /**********TYPEDEF**********/ /**********BLOCK**********/ par_block: Fork (Colon block_identifier)? block_item_declaration_star statement_star join_keyword ( colon_block_identifier )?; seq_block: Begin (Colon block_identifier)? block_item_declaration_star statement_star End ( colon_block_identifier )?; block_identifier: identifier; colon_block_identifier: Colon block_identifier; block_item_declaration_star: (block_item_declaration_semicolon)*; block_item_declaration_semicolon: block_item_declaration semicolon; block_item_declaration: reg_declaration | event_declaration | logic_declaration | bits_declaration | integer_declaration | int_declaration | local_parameter_declaration | parameter_declaration | real_declaration | realtime_declaration | time_declaration | string_declaration | usertype_variable_declaration; join_keyword: Join | Join_none | Join_any; /**********BLOCK**********/ /**********CONSTRUCTS**********/ continuous_assign: Assign (drive_strength)? (delay)? list_of_variable_assignments semicolon; list_of_variable_assignments: variable_assignment comma_variable_assignment_star; comma_variable_assignment_star: ( comma_variable_assignment)*; comma_variable_assignment: Comma variable_assignment; variable_assignment: variable_lvalue Equal expression; initial_construct: Initial statement_semicolon; final_construct: Final statement_semicolon; always_keyword: Always | Always_comb | Always_ff; always_construct: always_keyword statement_semicolon; /**********CONSTRUCTS**********/ /**********ATTRIBUTES**********/ attribute_instance_star: ( attribute_instance)*; attribute_instance: Open_parenthesis Star attr_spec attr_spec_star Star Close_parenthesis; attr_spec_star: ( Comma attr_spec)*; attr_spec: attr_name Equal expression | attr_name; attr_name: identifier; /**********ATTRIBUTES**********/ /**********LISTS**********/ /**********LISTS**********/ /**********IDENTIFIERS**********/ identifier: Simple_identifier | Escaped_identifier; /**********IDENTIFIERS**********/ /**********HIERARCHICAL IDENTIFIERS**********/ hierarchical_identifier: hierarchical_identifier_branch_item dot_hierarchical_identifier_branch_item_star; dot_hierarchical_identifier_branch_item_star: ( dot_hierarchical_identifier_branch_item )*; dot_hierarchical_identifier_branch_item: Dot hierarchical_identifier_branch_item; hierarchical_identifier_branch_item: identifier (dimension_plus)?; /**********HIERARCHICAL IDENTIFIERS**********/ /**********TIME DIRECTIVES**********/ timescale_compiler_directive: Tick_timescale Time_literal Forward_slash Time_literal; timeunit_directive: Timeunit Time_literal; timeprecision_directive: Timeprecision Time_literal; /**********TIME DIRECTIVES**********/ /**********NETTYPE DIRECTIVES**********/ default_nettype_statement: Default_nettype net_type; /**********NETTYPE DIRECTIVES**********/ /**********NUMBERS**********/ number: integral_number | real_number; integral_number: Decimal_number | Octal_number | Binary_number | Hex_number; real_number: Fixed_point_number | Real_exp_form; /**********NUMBERS**********/ /**********VERIFICATION**********/ //assertion_property_block : (assert_identifier_colon)? Assert Property Open_parenthesis statement Close_parenthesis (assert_property_statement)? ( assert_else_statement )? (semicolon)? ; //assert_identifier_colon : assertion_identifier Colon ; //assert_property_statement : statement ; //specify_block : Specify ( specify_item )* Endspecify ; //specify_item : specparam_declaration | pulsestyle_declaration | showcancelled_declaration | // path_declaration ; //specparam_declaration : Specparam (dimension)? list_of_specparam_assignments ; //pulsestyle_declaration : Pulsestyle_onevent list_of_path_outputs semicolon | Pulsestyle_ondetect // list_of_path_outputs semicolon ; //showcancelled_declaration : Showcancelled list_of_path_outputs semicolon | Noshowcancelled // list_of_path_outputs semicolon ; //path_declaration : simple_path_declaration semicolon | edge_sensitive_path_declaration semicolon | // state_dependent_path_declaration semicolon ; //list_of_specparam_assignments : specparam_assignment ( Comma specparam_assignment )* ; //state_dependent_path_declaration : If Open_parenthesis module_path_expression Close_parenthesis // simple_path_declaration | If Open_parenthesis module_path_expression Close_parenthesis // edge_sensitive_path_declaration | Ifnone simple_path_declaration ; //edge_sensitive_path_declaration : parallel_edge_sensitive_path_description Equal path_delay_value // | full_edge_sensitive_path_description Equal path_delay_value ; //parallel_edge_sensitive_path_description : Open_parenthesis ( edge_identifier )? specify_input_terminal_descriptor Equals_right_angle specify_output_terminal_descriptor ( polarity_operator )? Colon data_source_expression Close_parenthesis ; //simple_path_declaration : parallel_path_description Equal path_delay_value | full_path_description // Equal path_delay_value ; //full_path_description : Open_parenthesis list_of_path_inputs ( polarity_operator )? Star_right_angle list_of_path_outputs Close_parenthesis ; //specparam_assignment : specparam_identifier Equal constant_mintypmax_expression | // pulse_control_specparam ; //parallel_path_description : ( specify_input_terminal_descriptor ( polarity_operator )? Equals_right_angle specify_output_terminal_descriptor ) ; //path_delay_value : list_of_path_delay_expressions | Open_parenthesis // list_of_path_delay_expressions Close_parenthesis ; //full_edge_sensitive_path_description : Open_parenthesis ( edge_identifier )? list_of_path_inputs Star_right_angle list_of_path_outputs ( polarity_operator )? Colon data_source_expression Close_parenthesis ; //list_of_path_outputs : specify_output_terminal_descriptor ( Comma specify_output_terminal_descriptor )* ; //specparam_identifier : identifier ; //pulse_control_specparam : Path_pulse_dollar Equal Open_parenthesis reject_limit_value ( Comma // error_limit_value )? Close_parenthesis semicolon | Path_pulse_dollar // specify_input_terminal_descriptor Dollar specify_output_terminal_descriptor Equal // Open_parenthesis reject_limit_value ( Comma error_limit_value )? Close_parenthesis semicolon ; //specify_output_terminal_descriptor : output_identifier | output_identifier Left_bracket // constant_expression Right_bracket | output_identifier Left_bracket range_expression Right_bracket // ; //output_identifier : output_port_identifier | inout_port_identifier ; //list_of_path_delay_expressions : t_path_delay_expression | trise_path_delay_expression Comma // tfall_path_delay_expression | trise_path_delay_expression Comma tfall_path_delay_expression Comma // tz_path_delay_expression | t01_path_delay_expression Comma t10_path_delay_expression Comma // t0z_path_delay_expression Comma tz1_path_delay_expression Comma t1z_path_delay_expression Comma // tz0_path_delay_expression | t01_path_delay_expression Comma t10_path_delay_expression Comma // t0z_path_delay_expression Comma tz1_path_delay_expression Comma t1z_path_delay_expression Comma // tz0_path_delay_expression Comma t0x_path_delay_expression Comma tx1_path_delay_expression Comma // t1x_path_delay_expression Comma tx0_path_delay_expression Comma txz_path_delay_expression Comma // tzx_path_delay_expression ; //edge_identifier : Posedge | Negedge ; //list_of_path_inputs : specify_input_terminal_descriptor ( Comma specify_input_terminal_descriptor )* ; //specify_input_terminal_descriptor : input_identifier | input_identifier Left_bracket // constant_expression Right_bracket | input_identifier Left_bracket range_expression Right_bracket // ; //data_source_expression : expression ; //reject_limit_value : limit_value ; //error_limit_value : limit_value ; //output_port_identifier : identifier ; //input_identifier : input_port_identifier | inout_port_identifier ; //inout_port_identifier : identifier ; //t_path_delay_expression : path_delay_expression ; //trise_path_delay_expression : path_delay_expression ; //tfall_path_delay_expression : path_delay_expression ; //tz_path_delay_expression : path_delay_expression ; //t01_path_delay_expression : path_delay_expression ; //t10_path_delay_expression : path_delay_expression ; //t0z_path_delay_expression : path_delay_expression ; //tz1_path_delay_expression : path_delay_expression ; //t1z_path_delay_expression : path_delay_expression ; //tz0_path_delay_expression : path_delay_expression ; //t0x_path_delay_expression : path_delay_expression ; //tx1_path_delay_expression : path_delay_expression ; //t1x_path_delay_expression : path_delay_expression ; //tx0_path_delay_expression : path_delay_expression ; //txz_path_delay_expression : path_delay_expression ; //tzx_path_delay_expression : path_delay_expression ; //recursive set of rules module_path_primary : number | identifier | module_path_concatenation | // module_path_multiple_concatenation | function_call | system_function_call | // constant_function_call | Open_parenthesis module_path_mintypmax_expression Close_parenthesis ; //module_path_multiple_concatenation : Left_curly_bracket constant_expression module_path_concatenation Right_curly_bracket ; //module_path_concatenation : Left_curly_bracket module_path_expression ( Comma module_path_expression )* Right_curly_bracket ; //module_path_mintypmax_expression : module_path_expression (Colon module_path_expression Colon module_path_expression)? ; //module_path_expression : ( module_path_primary | unary_module_path_operator // attribute_instance_star module_path_primary ) ( binary_module_path_operator // attribute_instance_star module_path_expression | Question_mark attribute_instance_star // module_path_expression Colon module_path_expression )* ; //limit_value : constant_mintypmax_expression ; //input_port_identifier : identifier ; //path_delay_expression : constant_mintypmax_expression ; //constant_mintypmax_expression : constant_expression | constant_expression Colon // constant_expression Colon constant_expression ; //property_block : Property assertion_identifier semicolon statement Endproperty ; //assertion_identifier : identifier ; /**********VERIFICATION**********/ /**********LIBRARY**********/ //library_descriptions : library_declaration | config_declaration ; //library_declaration : Library library_identifier file_path_spec ( Comma file_path_spec )* ( Incdir file_path_spec ( Comma file_path_spec )* )? semicolon ; //library_identifier : identifier ; //file_path_spec : String_literal ; //config_declaration : Config config_identifier semicolon design_statement ( config_rule_statement )* Endconfig semicolon? ; //config_identifier : identifier ; //design_statement : Design ( ( library_identifier Dot )? cell_identifier )* semicolon ; //config_rule_statement : Default liblist_clause | inst_clause liblist_clause | inst_clause // use_clause | cell_clause liblist_clause | cell_clause use_clause ; //liblist_clause : Liblist library_identifier* ; //inst_clause : Instance inst_name ; //use_clause : Use ( library_identifier Dot )? cell_identifier ( Colon Config )? ; //cell_clause : Cell ( library_identifier Dot )? cell_identifier ; //cell_identifier : identifier ; //inst_name : topmodule_identifier ( Dot instance_identifier )* ; //topmodule_identifier : identifier ; //instance_identifier : identifier ; /**********LIBRARY**********/
Trash/test/Fold.g4
studentmain/AntlrVSIX
67
5257
<filename>Trash/test/Fold.g4 grammar A; s : a ; a : e ( ';' e )+ ; e : e '*' e | INT ; SEMI : ';' ; MUL : '*' ; INT : [0-9]+ ; WS : [ \t\n]+ -> skip ;
src/main/resources/project-templates/aws_web_server_blocks/src/@[email protected]
WinterAlexander/Ada-IntelliJ
17
21020
with AWS.Utils; with WBlocks.Widget_Counter; package body @[email protected] is use AWS; use AWS.Services; ------------------ -- Onclick_Incr -- ------------------ procedure Onclick_Incr (Request : in Status.Data; Context : not null access Web_Block.Context.Object; Translations : in out Templates.Translate_Set) is N : Natural := 0; begin if Context.Exist ("N") then N := Natural'Value (Context.Get_Value ("N")); end if; N := N + 1; Context.Set_Value ("N", Utils.Image (N)); Templates.Insert (Translations, Templates.Assoc (WBlocks.Widget_Counter.COUNTER, N)); end Onclick_Incr; end @[email protected];
alloy4fun_models/trainstlt/models/4/hEhaeHs2CkvFnZAwP.als
Kaixi26/org.alloytools.alloy
0
3889
<filename>alloy4fun_models/trainstlt/models/4/hEhaeHs2CkvFnZAwP.als open main pred idhEhaeHs2CkvFnZAwP_prop5 { all t:Train| { always (t.pos in Exit implies no t.pos') } } pred __repair { idhEhaeHs2CkvFnZAwP_prop5 } check __repair { idhEhaeHs2CkvFnZAwP_prop5 <=> prop5o }
src/game.asm
Pentacour/viruslqp79_msx
4
5491
<filename>src/game.asm MODULE MGAME K_MAX_CONTINUES_FOR_GOOD_ENDING EQU 3 ;=========================================== ;::SHOW_INTRO ;=========================================== SHOW_INTRO CALL LOAD_INTRO CALL PLAYER_OFF DI PUSH AF LD A, K_SONG_INTRO CALL CARGA_CANCION POP AF LD HL, 0XF000 LD [MWORK.TMP_COUNTER], HL .PRESS_KEY_LOOP LD HL, [MWORK.TMP_COUNTER] DEC HL LD [MWORK.TMP_COUNTER], HL LD A, L CP 0 JP NZ, .CONTINUE LD A, H CP 0 JP Z, MAIN_SEL_GAME .CONTINUE XOR A ; CHECK SPACE KEY CALL GTTRIG CP 0 JP Z, .PRESS_KEY_LOOP JP MAIN_SEL_GAME ;========================================== ;::LOAD_INTRO ;========================================== LOAD_INTRO CALL MSCREEN.CLEAR_SCREEN CALL DISSCR CALL SETGAMEPAGE0 LD HL, MDATAP0.INTRO_PATTERNS_0 LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL LD BC, 32*8*8 CALL LDIRVM CALL SETGAMEPAGE0 LD HL, MDATAP0.INTRO_COLORS_0 LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL LD BC, 32*8*8 CALL LDIRVM CALL SETGAMEPAGE0 LD HL, MDATAP0.INTRO_PATTERNS_1 LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+32*8*8 LD BC, 32*8*8 CALL LDIRVM CALL SETGAMEPAGE0 LD HL, MDATAP0.INTRO_COLORS_1 LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+32*8*8 LD BC, 32*8*8 CALL LDIRVM CALL SETGAMEPAGE0 LD HL, MDATAP0.INTRO_PATTERNS_2 LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+32*8*8*2 LD BC, 32*8*8 CALL LDIRVM CALL SETGAMEPAGE0 LD HL, MDATAP0.INTRO_COLORS_2 LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+32*8*8*2 LD BC, 32*8*8 CALL LDIRVM CALL MSUPPORT.FILL_CAMERA_INCREMENTAL CALL ENASCR RET ;=========================================== ;::SHOW_SELECT_GAME ;=========================================== SHOW_SELECT_GAME CALL DISSCR CALL MSCREEN.CLEAR_SCREEN LD HL, MDATA.SELECT_GAME_PATTERNS LD DE, MDATA.SELECT_GAME_COLORS CALL MSUPPORT.LOAD_TILESET_ONE_BANK CALL ENASCR LD HL, MWORK.CAMERA_SCREEN+32*4+7 LD A, 64 LD B, 6 .LOOP_ROWS PUSH BC LD B, 18 .LOOP_COL LD [HL], A INC HL INC A DJNZ .LOOP_COL LD BC, 14 ADD HL, BC ADD C POP BC DJNZ .LOOP_ROWS LD DE, MWORK.CAMERA_SCREEN+32*15+9 LD HL, PUSH_SPACE_KEY_TEXT CALL MSCREEN.RENDER_TEXT LD DE, MWORK.CAMERA_SCREEN+32*16+9 LD HL, PUSH_SPACE_KEY_LINE_TEXT CALL MSCREEN.RENDER_TEXT LD HL, 0XC000 LD [MWORK.TMP_COUNTER], HL .LOOP_CHECK_KEY LD A, [MWORK.TMP_COUNTER] AND 16 CP 16 JP Z, .FLASH_OFF_0 ; ;FLASH_ON_0 LD DE, MWORK.CAMERA_SCREEN+32*15+9 LD HL, PLAY_START_TEXT CALL MSCREEN.RENDER_TEXT LD DE, MWORK.CAMERA_SCREEN+32*16+9 LD HL, PLAY_START_LINE_TEXT CALL MSCREEN.RENDER_TEXT JP .RENDER .FLASH_OFF_0 LD DE, MWORK.CAMERA_SCREEN+32*15+9 LD HL, BLANK_TEXT CALL MSCREEN.RENDER_TEXT LD DE, MWORK.CAMERA_SCREEN+32*16+9 LD HL, BLANK_TEXT CALL MSCREEN.RENDER_TEXT ; .RENDER LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 48 HALT CALL MSUPPORT.UFLDIRVM XOR A CALL GTTRIG CP 0 JP NZ, .SELECT_GAME LD A, 1 CALL GTTRIG CP 0 JP NZ, .SELECT_GAME LD HL, [MWORK.TMP_COUNTER] DEC HL LD [MWORK.TMP_COUNTER], HL LD A, L CP 0 ;JP Z, SHOW_INTRO JP .LOOP_CHECK_KEY .SELECT_GAME CALL PLAYER_OFF /* LD HL, FX_ZOMBIE_EXPLODE;FX_TAKE LD [PUNTERO_SONIDO], HL LD HL,INTERR SET 2,[HL] */ LD B, 80 .LOOP_SELECT_GAME PUSH BC LD A, B AND 4 CP 4 JP Z, .FLASH_OFF ;FLASH_ON LD DE, MWORK.CAMERA_SCREEN+32*15+9 LD HL, PLAY_START_TEXT CALL MSCREEN.RENDER_TEXT LD DE, MWORK.CAMERA_SCREEN+32*16+9 LD HL, PLAY_START_LINE_TEXT CALL MSCREEN.RENDER_TEXT JP .CONTINUE_SELECT_GAME .FLASH_OFF LD DE, MWORK.CAMERA_SCREEN+32*15+9 LD HL, BLANK_TEXT CALL MSCREEN.RENDER_TEXT LD DE, MWORK.CAMERA_SCREEN+32*16+9 LD HL, BLANK_TEXT CALL MSCREEN.RENDER_TEXT .CONTINUE_SELECT_GAME HALT LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 48 CALL MSUPPORT.UFLDIRVM POP BC DJNZ .LOOP_SELECT_GAME CALL COOL_CLEAR_SCREEN JP MAIN_INIT_GAME PUSH_SPACE_KEY_TEXT DB 16, 50, 13, 17, 15, 7, 1, 15, 13, 2, 3, 5, 1, 84, 5, 18, 52 PUSH_SPACE_KEY_LINE_TEXT DB 16, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0 PLAY_START_TEXT DB 16, 0, 0, 50, 13, 9, 2, 18, 1, 15, 16, 2, 85, 16, 52, 0, 0 PLAY_START_LINE_TEXT DB 16, 0, 0, 0, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 0, 0, 0 BLANK_TEXT DB 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ;================================ ;::COOL_CLEAR_SCREEN ;================================ COOL_CLEAR_SCREEN LD HL, NAMTBL LD B, 31 .LOOP_ROW HALT PUSH BC PUSH HL LD B, 23 .LOOP_COL PUSH BC XOR A CALL WRTVRM LD BC, 32 ADD HL, BC POP BC DJNZ .LOOP_COL POP HL INC HL POP BC DJNZ .LOOP_ROW RET ;=========================================== ;::INIT_GAME ;=========================================== INIT_GAME CALL MSCREEN.CLEAR_SCREEN XOR A LD [MWORK.NUM_OF_CONTINUES], A LD A, 1 LD [MWORK.ALREADY_CONTINUE], A LD A, MWORK.K_EOF LD [MWORK.LIST_ENTITIES_DATA_END], A LD A, MWORK.K_INITIAL_PLAYER_LIVES LD [MWORK.PLAYER_LIVES], A LD A, MWORK.K_NORMAL_SHOOT LD [MWORK.PLAYER_SHOOT_TYPE], A LD A, 1 LD [MWORK.PLAYER_SHOOT_COST], A LD A, MWORK.K_START_MAP LD [MWORK.LEVEL], A ;.INIT_CONTINUE XOR A LD [MWORK.RUN_NUMBER], A XOR A LD [MWORK.PLAYER_POINTS], A LD [MWORK.PLAYER_POINTS+1], A LD [MWORK.PLAYER_POINTS+2], A LD HL, MWORK.THE_MAP LD [MWORK.CAMERA_OFFSET], HL LD HL, MDATA.SPRITE_EXPLOSION_F1 LD DE, SPRTBL+128 LD BC, 32*4+32 CALL LDIRVM ;; ;CLEAR SCOREBOARD ZONE XOR A LD DE, MWORK.CAMERA_SCREEN LD B, 64 .LOOPCLEARSCOREBOARD LD [DE], A INC DE DJNZ .LOOPCLEARSCOREBOARD LD HL, ENTITY.SPRITES_TABLE_SEQUENCES LD [MWORK.CURRENT_SPRITES_TABLE], HL LD [MWORK.CURRENT_SPRITES_TABLE_POSITION], HL CALL RESET_SPRITES JP MAIN_INIT_LEVEL ;========================================= ;::RESET_SPRITES ;========================================= RESET_SPRITES LD HL, ENTITY.SPRITES_TABLE_SEQUENCES LD [MWORK.CURRENT_SPRITES_TABLE], HL LD [MWORK.CURRENT_SPRITES_TABLE_POSITION], HL LD A, 209 LD [MWORK.SPRITES_TABLE_0], A LD [MWORK.SPRITES_TABLE_1], A LD [MWORK.SPRITES_TABLE_2], A LD [MWORK.SPRITES_TABLE_3], A LD [MWORK.SPRITES_TABLE_4], A LD [MWORK.SPRITES_TABLE_5], A LD [MWORK.SPRITES_TABLE_6], A LD [MWORK.SPRITES_TABLE_7], A CALL MSUPPORT.INIT_SPRITES_SIZE RET ;============================================ ;::INIT_LEVEL ;============================================ INIT_LEVEL LD A, [MWORK.ALREADY_CONTINUE] CP 1 JP Z, INIT_LEVEL_CONTINUE LD A, [MWORK.LEVEL] CP 16 JP Z, SHOW_HALF_QUEST CP 32 JP Z, SHOW_ENDING AND 3 CP 3 CALL Z, SHOW_INTERMISSION INIT_LEVEL_CONTINUE XOR A LD [MWORK.INTER_SCROLL_COUNTER_Y], A LD [MWORK.INTER_SCROLL_COUNTER_X], A LD [MWORK.CHARGE_BULLETS_COUNTER], A LD [MWORK.CURRENT_NUMBER_OF_ZOMBIES], A LD [MWORK.PLAYER_IMMUNITY], A LD [MWORK.CURRENT_NUMBER_OF_SHOOTS], A LD A, MWORK.K_MAX_BULLETS_COUNT LD [MWORK.PLAYER_BULLETS], A LD A, [MWORK.PLAYER_LIVES] ADD 2 CP MWORK.K_INITIAL_PLAYER_LIVES JP C, INIT_LEVEL_CONTINUE_2 LD A, MWORK.K_INITIAL_PLAYER_LIVES INIT_LEVEL_CONTINUE_2 LD [MWORK.PLAYER_LIVES], A CALL MSCREEN.CLEAR_SCREEN CALL SHOW_LEVEL_ANIMATION LD HL, MDATA.TILESET_PATTERNS LD DE, MDATA.TILESET_COLORS CALL MSCREEN.LOAD_TILESET_ONE_BANK CALL CHECK_BLUE_HOUSES CALL ENTITY.RESET_ENTITIES XOR A LD [MWORK.CAMERA_CHANGED], A LD [MWORK.PLAYER_SHOOT_WAIT], A LD [MWORK.PRE_GAME_OVER], A LD A, 1 LD [MWORK.PLAYER_SPACE_KEY_PRESSED], A ;INIT MAP LD HL, MDATA.MAP_LEVELS LD A, [MWORK.LEVEL] CP 32 JP C, .PRE_INIT_MAP SUB 32 .PRE_INIT_MAP CP 16 JP C, .INIT_MAP LD HL, MDATA.MAP_LEVELS_P16 .INIT_MAP SLA A ;*16 SLA A SLA A SLA A LD C, A LD B, 0 ADD HL, BC CALL BUILD_MAP ;INIT CAMERA AND PLAYER LD A, [MWORK.LEVEL] CP 32 JP C, .INITCAMERASTART SUB 32 .INITCAMERASTART SLA A SLA A LD C, A LD B, 0 LD HL, MDATA.CAMERA_AND_PLAYER_LOCATIONS ADD HL, BC ;CAMERA LD A, [HL] LD [MWORK.CAMERA_TILE_Y_TOP], A ADD MSCREEN.K_CAMERA_HEIGHT-1 LD [MWORK.CAMERA_TILE_Y_DOWN], A INC HL LD A, [HL] LD [MWORK.CAMERA_TILE_X_LEFT], A ADD MSCREEN.K_CAMERA_WIDTH-1 LD [MWORK.CAMERA_TILE_X_RIGHT], A INC HL ;PLAYER LD A, [HL] LD [MWORK.PLAYER_Y], A INC HL LD A, [HL] LD [MWORK.PLAYER_X], A LD A, MPLAYER.K_KEY_RIGHT LD [MWORK.PLAYER_DIRECTION], A ;SURVIVORS LD A, [MWORK.LEVEL] LD D, 3;2 CP 32 JP C, .INITSURVIVORSSTART SUB 32 LD D, 3 .INITSURVIVORSSTART LD B, A SLA A ;*6 SLA A ; SLA A ADD B ADD B LD C, A LD B, 0 LD HL, MDATA.SURVIVOR_LOCATIONS ADD HL, BC LD B, D .LOOPINITSURVIVORS PUSH BC PUSH HL LD A, ENTITY.K_ENTITY_SURVIVOR CALL INIT_ENTITY PUSH HL POP IX LD [IX+ENTITY.K_OFFSET_COUNTER], 0 LD [IX+ENTITY.K_OFFSET_STATE], 96 POP HL INC HL ;NEXT POSITION INC HL POP BC DJNZ .LOOPINITSURVIVORS ;INITZOMBIES LD A, [MWORK.LEVEL] LD L, A LD H, 0 ADD HL, HL ADD HL, HL ADD HL, HL ADD HL, HL LD C, A LD B, 0 ADD HL, BC ADD HL, BC LD B, H LD C, L LD HL, MDATA.CREATE_ZOMBIES_LOCATIONS_QUEST ADD HL, BC LD A, [HL] LD [MWORK.ZOMBIES_SPEED], A INC HL LD A, [HL] INC HL LD [MWORK.CURRENT_ZOMBIE_TYPE], A CP ENTITY.K_ZOMBIE_STRONG JP Z, .ZOMBIESTRONG .ZOMBIESTANDARD XOR A LD [MWORK.SHOOTS_TO_KILL_ZOMBIE], A JP .STARTCREATINGZOMBIES .ZOMBIESTRONG LD A, 1 LD [MWORK.SHOOTS_TO_KILL_ZOMBIE], A PUSH HL LD HL, MDATA.STRONG_ZOMBIES_PATTERNS LD DE, MDATA.STRONG_ZOMBIES_COLORS CALL LOAD_STRONG_ZOMBIES_TILE_SET POP HL .STARTCREATINGZOMBIES LD B, 4 .LOOPINITCREATEZOMBIES PUSH BC PUSH HL LD A, [HL] ;HOUSE OR TERRAIN INC HL INC HL CALL INIT_ENTITY LD [IX+ENTITY.K_OFFSET_STATE], 1 POP HL INC HL LD A, [HL] LD [IX+ENTITY.K_OFFSET_CREATE_FREQUENCY], A INC HL INC HL INC HL POP BC DJNZ .LOOPINITCREATEZOMBIES .TRATEEXIT LD A, [MWORK.LEVEL] CP 32 JP C, .STARTEXITLOCATIONS SUB 32 .STARTEXITLOCATIONS LD C, A ADD A ADD C LD C, A LD B, 0 LD HL, MDATA.EXIT_LOCATIONS ADD HL, BC LD A, [HL] INC HL CALL INIT_ENTITY LD [IX+ENTITY.K_OFFSET_COUNTER], 0 ;FOR ANIMATION CALL PUT_EXIT_DOOR_IN_MAP LD A, [IX] LD [MWORK.ENTITY_EXIT], A LD A, [IX+ENTITY.K_OFFSET_MAP_Y] LD [MWORK.ENTITY_EXIT_MAP_Y], A LD A, [IX+ENTITY.K_OFFSET_MAP_X] LD [MWORK.ENTITY_EXIT_MAP_X], A ; LD A, [MWORK.LEVEL] ; CP 32 ; JP C, .TWOSURVIVORS .THREESURVIVORS LD A, 3 JR .ASSIGNSURVIVORS ;.TWOSURVIVORS LD A, 2 .ASSIGNSURVIVORS LD [MWORK.SURVIVORS_TO_SAVE], A JP MAIN_INIT_LEVEL_CONTINUE ;============================================ ;::CHECK_BLUE_HOUSES ;============================================ CHECK_BLUE_HOUSES LD A, [MWORK.LEVEL] AND 8 CP 8 RET NZ CALL SETGAMEPAGE0 LD HL, MDATAP0.BLUE_HOUSES_PATTERNS LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+146*8 LD BC, 64 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+256*8+146*8 LD BC, 64 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+256*8*2+146*8 LD BC, 64 CALL LDIRVM CALL SETGAMEPAGE0 LD HL, MDATAP0.BLUE_HOUSES_COLOR LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+146*8 LD BC, 64 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+256*8+146*8 LD BC, 64 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+256*8*2+146*8 LD BC, 64 CALL LDIRVM RET ;============================================ ;::SET_LEVEL_SONG ;============================================ SET_LEVEL_SONG LD A, [MWORK.LEVEL] CP 32 JP C, .CONTINUE SUB 32 .CONTINUE LD C, A LD B, 0 LD HL, MDATA.LEVEL_SONGS ADD HL, BC LD A, [HL] LD [MWORK.CURRENT_SONG], A RET ;============================================ ;::BUILD_MAP ;============================================ BUILD_MAP LD DE, MWORK.THE_MAP LD B, 4 ;4 MACROTILES PER COLUMN .SROWSLOOP PUSH BC LD B, 4 ;8 MACROTILES PER ROW .SCOLSLOOP PUSH BC LD A, [HL] ;LEFT MACROTILE CODE SRL A SRL A SRL A SRL A CALL BUILD_MACRO_TILE ;INCREMENTS DE EX DE, HL LD BC, 8 ADD HL, BC EX DE, HL ; LD A, [HL] AND 0X0F CALL BUILD_MACRO_TILE ;INCREMENTS DE EX DE, HL LD BC, 8 ADD HL, BC EX DE, HL ;INCREMENTS HL INC HL POP BC DJNZ .SCOLSLOOP ;NEXT ROW EX DE, HL LD BC, 64*7 ADD HL, BC EX DE, HL ; POP BC DJNZ .SROWSLOOP RET ;============================================ ;::BUILD_MACRO_TILE ; IN: A MACROTILE CODE ; DE ADDRESS OF MAP POSITION ;============================================ BUILD_MACRO_TILE PUSH HL PUSH DE LD BC, MDATA.BLOCK_00 LD L, A LD H, 0 ADD HL,HL ;MUL64 ADD HL,HL ADD HL,HL ADD HL,HL ADD HL,HL ADD HL,HL ADD HL, BC LD B, 8 ;8 TILES IN A ROW .SROWSLOOP PUSH BC LD BC, 8 LDIR ;NEXT ROW EX DE, HL LD BC, 64-8 ;NEXT LINE ADD HL, BC EX DE, HL POP BC DJNZ .SROWSLOOP POP DE POP HL RET ;================================= ;::PUT_EXIT_DOOR_IN_MAP ; IX ;================================ PUT_EXIT_DOOR_IN_MAP LD L, [IX+ENTITY.K_OFFSET_MAP_Y] LD H, 0 ADD HL, HL ;*64 ADD HL, HL ADD HL, HL ADD HL, HL ADD HL, HL ADD HL, HL LD C, [IX+ENTITY.K_OFFSET_MAP_X] LD B, 0 ADD HL, BC LD BC, MWORK.THE_MAP ADD HL, BC LD A, [IX] CP ENTITY.K_ENTITY_EXIT_UP JP Z, .UP CP ENTITY.K_ENTITY_EXIT_DOWN JP Z, .DOWN CP ENTITY.K_ENTITY_EXIT_LEFT JP Z, .LEFT ;.RIGHT LD [HL], 167 LD BC, -64 ADD HL, BC LD [HL], 166 RET .LEFT DEC HL LD [HL], 167 LD BC, -64 ADD HL, BC LD [HL], 166 RET .UP LD BC, -65 ADD HL, BC LD [HL], 162 INC HL LD [HL], 163 LD BC, 63 ADD HL, BC LD [HL], 164 INC HL LD [HL], 165 RET .DOWN LD [HL], 169 DEC HL LD [HL], 168 RET ;================================= ;::PUT_EXIT_OPEN_IN_MAP ;================================ PUT_EXIT_OPEN_IN_MAP LD A, [MWORK.ENTITY_EXIT_MAP_Y] LD L, A LD H, 0 ADD HL, HL ;*64 ADD HL, HL ADD HL, HL ADD HL, HL ADD HL, HL ADD HL, HL LD A, [MWORK.ENTITY_EXIT_MAP_X] LD C, A LD B, 0 ADD HL, BC LD BC, MWORK.THE_MAP ADD HL, BC LD A, [MWORK.ENTITY_EXIT] CP ENTITY.K_ENTITY_EXIT_UP JP Z, .UP CP ENTITY.K_ENTITY_EXIT_LEFT JP Z, .LEFT CP ENTITY.K_ENTITY_EXIT_DOWN JP Z, .DOWN ;.RIGHT LD [HL], 11 DEC HL LD [HL], 0 LD BC, -64 ADD HL, BC LD [HL], 0 INC HL LD [HL], 11 RET .UP LD [HL], 0 DEC HL LD [HL], 0 LD BC, -64 ADD HL, BC LD [HL], 7 INC HL LD [HL], 7 RET .LEFT LD [HL], 0 DEC HL LD [HL], 19 LD BC, -64 ADD HL, BC LD [HL], 19 INC HL LD [HL], 0 RET .DOWN LD [HL], 15 DEC HL LD [HL], 15 LD BC, -64 ADD HL, BC LD [HL], 0 INC HL LD [HL], 0 RET ;========================================= ;::LOAD_STRONG_ZOMBIES_TILE_SET ; IN->HL PATTERNS, DE, COLORS ;========================================= LOAD_STRONG_ZOMBIES_TILE_SET PUSH DE LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+32*8 LD BC, 32*8*2 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+32*8*8+32*8 LD BC, 32*8*2 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+32*8*8*2+32*8 LD BC, 32*8*2 CALL LDIRVM POP HL LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+32*8 LD BC, 32*8*2 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+32*8*8+32*8 LD BC, 32*8*2 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+32*8*8*2+32*8 LD BC, 32*8*2 CALL LDIRVM RET ;========================================== ;::INIT_ENTITY ; IN->HL POINTER TO INITIALIZE DATA, A ENTITY TYPE ;========================================== INIT_ENTITY PUSH HL PUSH AF CALL ENTITY.GET_NEXT_EMPTY_INDESTRUCTIBLE PUSH HL POP IX POP AF LD [IX], A LD [IX+ENTITY.K_OFFSET_IS_VISIBLE], 0 LD [IX+ENTITY.K_OFFSET_NOVISIBLE_COUNTER], 0 POP DE LD A, [DE] LD [IX+ENTITY.K_OFFSET_MAP_X], A INC DE LD A, [DE] LD [IX+ENTITY.K_OFFSET_MAP_Y], A LD [IX+ENTITY.K_OFFSET_STATE], 0 CALL ENTITY.CHECK_IF_VISIBLE RET ;========================================= ;::SHOW_LEVEL_ANIMATION ;========================================= SHOW_LEVEL_ANIMATION CALL PLAYER_OFF CALL DISSCR LD HL, MDATA.TITLES_PATTERNS LD DE, MDATA.TITLES_COLORS CALL LOAD_TILE_SET_ONE_BANK LD BC, 32*24 LD DE, MWORK.CAMERA_SCREEN CALL MSUPPORT.RESET_BIG_RAM LD B, 12 LD DE, MWORK.CAMERA_SCREEN+32*8 LD HL, MWORK.CAMERA_SCREEN+32*8+30 .LOOP PUSH BC PUSH DE PUSH HL CALL RENDER_LEVEL_TEXT POP HL PUSH HL CALL RENDER_LEVEL_NUMBER ; TO VRAM HALT LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 48 CALL MSUPPORT.UFLDIRVM POP HL DEC HL POP DE INC DE POP BC DJNZ .LOOP CALL ENASCR CALL MSUPPORT.INIT_SPRITES_SIZE JP .SHOWPRESSKEY LD A, 120; 0XEF .WAITLOOP HALT DEC A CP 0 JP NZ, .WAITLOOP JP .CONTINUE .SHOWPRESSKEY CALL SHOW_PRESS_KEY .CONTINUE PUSH AF CALL SET_LEVEL_SONG LD A, [MWORK.CURRENT_SONG] CALL CARGA_CANCION LD DE, MWORK.CAMERA_SCREEN+32*12+10 LD HL, PRESS_KEY_TILES_OFF LD BC, 13 LDIR HALT LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 48 CALL MSUPPORT.UFLDIRVM POP AF CALL MSUPPORT.WAIT_FEW_SECONDS CALL MSCREEN.CLEAR_SCREEN RET ;========================================== ;::LOAD_TILE_SET_ONE_BANK ; IN->HL PATTERNS, DE, COLORS ;========================================== LOAD_TILE_SET_ONE_BANK PUSH DE LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL LD BC, 32*8*8 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+32*8*8 LD BC, 32*8*8 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+32*8*8*2 LD BC, 32*8*8 CALL LDIRVM POP HL LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL LD BC, 32*8*8 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+32*8*8 LD BC, 32*8*8 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+32*8*8*2 LD BC, 32*8*8 CALL LDIRVM RET ;========================================= ;::RENDER_LEVEL_TEXT ; IN->DE SCREEN POSITION ;========================================= RENDER_LEVEL_TEXT LD HL, LEVEL_TEXT_TILES LD BC, 8 LDIR LD BC, 32-8 EX DE, HL ADD HL, BC EX DE, HL LD BC, 8 LDIR RET LEVEL_TEXT_TILES DB 0, 31, 32, 33, 34, 35, 36, 37 DB 0, 38, 39, 40, 41, 42, 43, 44 ;========================================= ;::RENDER_LEVEL_NUMBER ; IN->HL SCREEN POSITION, A NUMBER ;======================================== RENDER_LEVEL_NUMBER INC HL LD A, [MWORK.LEVEL] INC A CP 10 JP C, .ONEDIGIT CP 20 JP C, .TENS CP 30 JP C, .TWENTIES CP 40 JP C, .THIRTIES CP 50 JP C, .FOURTIES CP 60 JP C, .FIFTIES ;.SIXTIES LD [HL], 13 ;1 LD BC, 32 ADD HL, BC LD [HL], 14 ;1 LD BC, -31 ADD HL, BC SUB 60 JP .ONEDIGIT .TENS LD [HL], 3 ;1 LD BC, 32 ADD HL, BC LD [HL], 4 ;1 LD BC, -31 ADD HL, BC SUB 10 JP .ONEDIGIT .TWENTIES LD [HL], 5 ;1 LD BC, 32 ADD HL, BC LD [HL], 6 ;1 LD BC, -31 ADD HL, BC SUB 20 JP .ONEDIGIT .THIRTIES LD [HL], 7 ;1 LD BC, 32 ADD HL, BC LD [HL], 8 ;1 LD BC, -31 ADD HL, BC SUB 30 JP .ONEDIGIT .FOURTIES LD [HL], 9 ;1 LD BC, 32 ADD HL, BC LD [HL], 10 ;1 LD BC, -31 ADD HL, BC SUB 40 JP .ONEDIGIT .FIFTIES LD [HL], 11 ;1 LD BC, 32 ADD HL, BC LD [HL], 12 ;1 LD BC, -31 ADD HL, BC SUB 50 .ONEDIGIT SLA A INC A LD [HL], A INC HL LD [HL], 0 INC A LD BC, 31 ADD HL, BC LD [HL], A INC HL LD [HL], 0 RET ;===================================== ;::SHOW_PRESS_KEY ;===================================== SHOW_PRESS_KEY .PRESSKEYLOOP LD DE, MWORK.CAMERA_SCREEN+32*12+10 LD A, [MWORK.LEVEL] CP 9 JP c, .CONTINUE INC DE .CONTINUE LD A, [MWORK.ANIMATION_TICK] INC A LD [MWORK.ANIMATION_TICK], A AND 31 CP 16 JP C, .PRESSKEYOFF LD HL, PRESS_KEY_TILES_ON JP .PRESSKEYRENDER .PRESSKEYOFF LD HL, PRESS_KEY_TILES_OFF .PRESSKEYRENDER LD BC, 12 LDIR ; TO VRAM HALT LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 48 CALL MSUPPORT.UFLDIRVM ;CHECK SPACE XOR A CALL GTTRIG CP 0 JP NZ, .RET LD a, 1 CALL GTTRIG CP 0 JP Z, .PRESSKEYLOOP .RET RET ;===================================== ;::SHOW_KEY_PRESSED ;===================================== SHOW_KEY_PRESSED LD B, 75 .PRESSKEYLOOP PUSH BC LD DE, MWORK.CAMERA_SCREEN+32*12+10 LD A, [MWORK.ANIMATION_TICK] INC A LD [MWORK.ANIMATION_TICK], A AND 7 CP 4 JP C, .PRESSKEYOFF LD HL, PRESS_KEY_TILES_ON JP .PRESSKEYRENDER .PRESSKEYOFF LD HL, PRESS_KEY_TILES_OFF .PRESSKEYRENDER LD BC, 12 LDIR ; TO VRAM HALT LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 48 CALL MSUPPORT.UFLDIRVM POP BC DJNZ .PRESSKEYLOOP RET PRESS_KEY_TILES_ON DB 94, 95, 90, 96, 96, 0, 0, 96, 94, 99, 101, 90 PRESS_KEY_TILES_OFF DB 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ;===================================== ;::SHOW_PRESS_SPACE_TO_CONTINUE ; OUT->Z NO CONTINUE ;===================================== SHOW_PRESS_SPACE_TO_CONTINUE CALL MSUPPORT.WAIT_SECONDS LD A, 31 LD [MWORK.TMP_COUNTER], A XOR A LD [MWORK.TMP_COUNTER+1], A .PRESSKEYLOOP LD DE, MWORK.CAMERA_SCREEN+32*14+4 LD A, [MWORK.ANIMATION_TICK] INC A LD [MWORK.ANIMATION_TICK], A AND 31 CP 16 JP C, .PRESSKEYOFF XOR A LD [MWORK.TMP_COUNTER+1], A LD HL, PRESS_SPACE_TILES_ON JP .PRESSKEYRENDER .PRESSKEYOFF LD A, [MWORK.TMP_COUNTER+1] CP 1 JP Z, .PRESSKEYOFFCONTINUE LD A, 1 LD [MWORK.TMP_COUNTER+1], A LD A, [MWORK.TMP_COUNTER] DEC A LD [MWORK.TMP_COUNTER], A LD [MWORK.CAMERA_SCREEN+32*17+15], A CP 20 RET Z .PRESSKEYOFFCONTINUE LD HL, PRESS_SPACE_TILES_OFF .PRESSKEYRENDER LD BC, 23 LDIR HALT LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 48 CALL MSUPPORT.UFLDIRVM XOR A CALL GTTRIG CP 0 JP NZ, .RET LD A, 1 CALL GTTRIG CP 0 JP Z, .PRESSKEYLOOP .RET XOR A CP 1 RET PRESS_SPACE_TILES_ON DB 0, 0, 0, 96, 94, 99, 101, 90, 0, 102, 93, 0, 101, 93, 92, 102, 103, 92, 97, 90 ;DB 94, 95, 90, 96, 96, 0, 96, 94, 99, 101, 90, 0, 102, 93, 0, 101, 93, 92, 102, 103, 92, 97, 90 PRESS_SPACE_TILES_OFF DB 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ;======================================== ;::SHOW_BONUS_ANIMATION ;======================================== SHOW_BONUS_ANIMATION CALL PLAYER_OFF CALL MSCREEN.CLEAR_SCREEN LD HL, MDATA.TITLES_PATTERNS LD DE, MDATA.TITLES_COLORS CALL LOAD_TILE_SET_ONE_BANK CALL MSCREEN.CLEAR_CAMERA LD HL, BONUS_TILES LD DE, MWORK.CAMERA_SCREEN+8*32+12 LD BC, 5 LDIR .LOOP LD A, [MWORK.ANIMATION_TICK] INC A LD [MWORK.ANIMATION_TICK], A AND 7 CP 7 JR NZ, .LOOPCONTINUE LD HL, FX_TAKE LD [PUNTERO_SONIDO], HL LD HL,INTERR SET 2,[HL] .LOOPCONTINUE ;SUBSTRACTS COUNT DOWN CALL ENTITY.DECREMENT_COUNT_DOWN PUSH AF ;SAVE Z ;ADD POINTS LD A, 0X01 LD HL, MWORK.PLAYER_POINTS CALL ENTITY.ADD_POINTS LD HL, MWORK.CAMERA_SCREEN+8*32+19 CALL RENDER_BONUS_TIME LD HL, MWORK.CAMERA_SCREEN+10*32+19 CALL RENDER_BONUS_POINTS HALT LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 48 CALL MSUPPORT.UFLDIRVM ;CHECK IF COUNTDOWN = 0 POP AF JP NZ, .LOOP LD B, 8*6 .LOOPWAIT HALT DJNZ .LOOPWAIT RET BONUS_TILES DB 89, 93, 92, 97, 96 ;======================================= ;::RENDER_BONUS_POINTS ; IN-> HL SCREEN POSITION ;====================================== RENDER_BONUS_POINTS LD A, [MWORK.PLAYER_POINTS] CALL RENDER_BIG_NUMBER DEC HL DEC HL LD A, [MWORK.PLAYER_POINTS+1] CALL RENDER_BIG_NUMBER DEC HL DEC HL LD A, [MWORK.PLAYER_POINTS+2] CALL RENDER_BIG_NUMBER RET ;======================================= ;::RENDER_BONUS_TIME ; IN-> HL SCREEN POSITION ;====================================== RENDER_BONUS_TIME LD A, [MWORK.COUNT_DOWN] AND 0X0F ADD 21 LD [HL], A LD A, [MWORK.COUNT_DOWN+1] LD B, A SRL A SRL A SRL A SRL A ADD 21 INC HL LD [HL], A LD A, [MWORK.COUNT_DOWN+1] AND 0X0F ADD 21 INC HL LD [HL], A RET ;=================================== ;::RENDER_BIG_NUMBER ; IN->HL SCREEN POSITION, A TWO DIGITS BCD ;=================================== RENDER_BIG_NUMBER PUSH HL PUSH AF AND 0X0F SLA A INC A LD [HL], A LD BC, 32 ADD HL, BC INC A LD [HL], A POP AF SRL A SRL A SRL A SRL A SLA A INC A INC A DEC HL LD [HL], A LD BC, -32 ADD HL, BC DEC A LD [HL], A POP HL RET ;========================================== ;::SHOW_HALF_QUEST ;========================================== SHOW_HALF_QUEST CALL DISSCR CALL LOAD_HALF_QUEST LD HL, MWORK.CAMERA_SCREEN LD B, 2 .LOOP PUSH BC LD B, 0 XOR A .LOOPBANK LD [HL], A INC HL INC A DJNZ .LOOPBANK POP BC DJNZ .LOOP HALT LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 48 CALL MSUPPORT.UFLDIRVM CALL ENASCR CALL MSUPPORT.INIT_SPRITES_SIZE LD HL, .TEXT0 LD DE, NAMTBL+32*8*2 CALL WRITE_TEXT CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS LD HL, .TEXT1 LD DE, NAMTBL+32*8*2+32*2 CALL WRITE_TEXT CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS LD HL, .TEXT2 LD DE, NAMTBL+32*8*2+32*4 CALL WRITE_TEXT LD HL, .TEXT3 LD DE, NAMTBL+32*8*2+32*6 CALL WRITE_TEXT CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS JP INIT_LEVEL_CONTINUE .TEXT0 DB _SP, _A, _M, _Y, _AD, _SP, _T, _H, _E, _R, _E, _SP, _A, _R, _E, _SP, _M, _O, _R, _E, _SP, _S, _U, _R, _V, _I, _V, _O, _R, _S, _SP, _SP .TEXT1 DB _SP, _T, _H, _E, _Y, _SP, _A, _R, _E, _SP, _C, _A, _L, _L, _I, _N, _G, _SP, _B, _Y, _SP, _P, _H, _O, _N, _E, _SP, _SP, _SP, _SP, _SP, _SP .TEXT2 DB _SP, _LI, _SP, _O, _K, _AD, _SP, _I, _SP, _H, _O, _P, _E, _SP, _T, _H, _E, _Y, _SP, _A, _R, _E, _SP, _N, _O, _T, _SP, _SP, _SP, _SP, _SP, _SP .TEXT3 DB _SP, _G, _R, _E, _E, _N, _SP, _N, _O, _R, _SP, _B, _L, _U, _E, _SP, _W, _H, _E, _N, _SP, _I, _SP, _A, _R, _R, _I, _V, _E, _AD, _SP, _SP .TEXT4 DB _SP, _SP, _SP, _SP, _SP, _C, _O, _N, _T, _I, _N, _U, _E, _SP, _T, _H, _E, _SP, _G, _A, _M, _E, _SP, _W, _I, _T, _H, _SP, _SP, _SP, _SP, _SP .TEXT5 DB _SP, _SP, _SP, _SP, _SP, _SP, _T, _H, _E, _SP, _P, _H, _Y, _S, _I, _C, _A, _L, _SP, _E, _D, _I, _T, _I, _O, _N, _SP, _SP, _SP, _SP, _SP, _SP ;========================================== ;::LOAD_HALF_QUEST ;========================================== LOAD_HALF_QUEST CALL MSCREEN.CLEAR_SCREEN LD HL, MDATAP0.HALF_QUEST_PATTERNS_0 LD DE, CHRTBL CALL LOAD_BANK LD HL, MDATAP0.HALF_QUEST_PATTERNS_1 LD DE, CHRTBL+32*8*8 CALL LOAD_BANK LD BC, 32*8*8 ;RESET BUFFER OF BANK LD DE, MWORK.TMP_UNZIP CALL MSUPPORT.RESET_BIG_RAM CALL SETGAMEPAGE0 LD HL, MDATAP0.ALPHABET_PATTERNS LD DE, MWORK.TMP_UNZIP + 224*8 ;LOAD ALPHABET IN LAST LINE OF BANK CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+32*8*8*2 LD BC, 32*8*8 CALL LDIRVM LD HL, MDATAP0.HALF_QUEST_COLORS_0 LD DE, CLRTBL CALL LOAD_BANK LD HL, MDATAP0.HALF_QUEST_COLORS_1 LD DE, CLRTBL+32*8*8 CALL LOAD_BANK LD BC, 32*8*8 ;RESET BUFFER OF BANK LD DE, MWORK.TMP_UNZIP CALL MSUPPORT.RESET_BIG_RAM CALL SETGAMEPAGE0 LD HL, MDATAP0.ALPHABET_COLORS LD DE, MWORK.TMP_UNZIP + 224*8 ;LOAD ALPHABET IN LAST LINE OF BANK CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+32*8*8*2 LD BC, 32*8*8 CALL LDIRVM RET ;========================================== ;::LOAD_BANK ; IN-> HL ORIGIN, DE->SCREENDEST ;========================================== LOAD_BANK PUSH DE CALL SETGAMEPAGE0 LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP POP DE LD BC, 32*8*8 CALL LDIRVM RET ;========================================== ;::SHOW_INTERMISSION ;========================================== SHOW_INTERMISSION CALL DISSCR CALL LOAD_INTERMISSION CALL MSCREEN.CLEAR_CAMERA LD HL, MWORK.CAMERA_SCREEN LD B, 3 .LOOP PUSH BC LD B, 0 XOR A .LOOPBANK LD [HL], A INC HL INC A DJNZ .LOOPBANK POP BC DJNZ .LOOP HALT LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 48 CALL MSUPPORT.UFLDIRVM CALL ENASCR CALL MSUPPORT.INIT_SPRITES_SIZE CALL GET_RANDOM_INTERMISSION_TEXT LD DE, NAMTBL+32*23 CALL WRITE_TEXT CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS RET ;========================================== ;::LOAD_INTERMISSION ;========================================== LOAD_INTERMISSION CALL SETGAMEPAGE0 LD HL, MDATAP0.INTERMISION_PATTERNS_0 LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL LD BC, 32*8*8 CALL LDIRVM CALL SETGAMEPAGE0 LD HL, MDATAP0.INTERMISION_PATTERNS_1 LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+32*8*8 LD BC, 32*8*8 CALL LDIRVM CALL SETGAMEPAGE0 LD HL, MDATAP0.INTERMISION_PATTERNS_2 LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+32*8*8*2 LD BC, 32*8*8 CALL LDIRVM CALL SETGAMEPAGE0 LD HL, MDATAP0.INTERMISION_COLORS_0 LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL LD BC, 32*8*8 CALL LDIRVM CALL SETGAMEPAGE0 LD HL, MDATAP0.INTERMISION_COLORS_1 LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+32*8*8 LD BC, 32*8*8 CALL LDIRVM CALL SETGAMEPAGE0 LD HL, MDATAP0.INTERMISION_COLORS_2 LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+32*8*8*2 LD BC, 32*8*8 CALL LDIRVM RET ;========================================== ;::WRITE_TEXT ; IN->DE POSITION TO WRITE, HL TEXT ;========================================== WRITE_TEXT LD BC, 32 CALL LDIRVM RET ;======================================= ;::GET_RANDOM_INTERMISSION_TEXT ; OUT->HL TEXT ;======================================= GET_RANDOM_INTERMISSION_TEXT LD A, [MWORK.ANIMATION_TICK] AND 7 SLA A LD C, A LD B, 0 LD HL, .INTERMISSIONTEXTS ADD HL, BC LD E, [HL] INC HL LD D, [HL] EX DE, HL RET .INTERMISSIONTEXTS DW .TEXT0 DW .TEXT1 DW .TEXT2 DW .TEXT3 DW .TEXT4 DW .TEXT5 DW .TEXT2 DW .TEXT1 .TEXT0 DB _SP, _SP, _SP, _I, _AP, _M, _SP, _S, _O, _SP, _H, _O, _T, _SP, _B, _U, _T, _SP, _I, _AP, _M, _SP, _N, _O, _T, _SP, _F, _O, _O, _D, _AD, _SP .TEXT1 DB _W, _H, _E, _R, _E, _SP, _A, _R, _E, _SP, _T, _H, _E, _SP, _P, _L, _A, _N, _T, _S, _SP, _T, _O, _SP, _H, _E, _L, _P, _SP, _M, _E, _QU .TEXT2 DB _I, _SP, _T, _H, _I, _N, _K, _SP, _I, _SP, _W, _I, _L, _L, _SP, _B, _E, _C, _O, _M, _E, _SP, _V, _E, _G, _E, _T, _A, _R, _I, _A, _N .TEXT3 DB _SP, _P, _L, _E, _A, _S, _E, _SP, _T, _I, _M, _E, _SP, _O, _U, _T, _AD, _SP, _I, _SP, _N, _E, _E, _D, _SP, _A, _SP, _B, _E, _E, _R, _SP .TEXT4 DB _SP, _U, _P, _S, _AD, _SP, _Z, _O, _M, _B, _I, _E, _S, _SP, _A, _T, _E, _SP, _M, _Y, _SP, _N, _E, _I, _G, _H, _B, _O, _U, _R, _S, _SP .TEXT5 DB _SP, _SP, _SP, _SP, _SP, _SP, _SP, _SP, _SP, _SP, _I, _SP, _A, _M, _SP, _L, _E, _G, _E, _N, _D, _AD, _SP, _SP, _SP, _SP, _SP, _SP, _SP, _SP, _SP, _SP ;========================================== ;::SHOWENDING ;========================================== SHOW_ENDING LD A, [MWORK.NUM_OF_CONTINUES] CP K_MAX_CONTINUES_FOR_GOOD_ENDING JP C, SHOW_GOOD_ENDING JP SHOW_BAD_ENDING ;========================================== ;::SHOW_GOOG_ENDING ;========================================== SHOW_GOOD_ENDING CALL DISSCR CALL LOAD_GOOD_ENDING CALL MSCREEN.CLEAR_SCREEN CALL MSCREEN.CLEAR_CAMERA LD HL, MWORK.CAMERA_SCREEN+32*8 LD B, 2 .LOOP PUSH BC LD B, 0 XOR A .LOOPBANK LD [HL], A INC HL INC A DJNZ .LOOPBANK POP BC DJNZ .LOOP HALT LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 48 CALL MSUPPORT.UFLDIRVM CALL ENASCR CALL MSUPPORT.INIT_SPRITES_SIZE LD A, MPLAYER.K_KEY_DOWN LD [MWORK.PLAYER_DIRECTION], A LD A, 116 LD [MWORK.PLAYER_X], A LD A, 112 LD [MWORK.PLAYER_Y], A CALL MPLAYER.SET_PLAYER_FRAME HALT CALL MSCREEN.RENDER_SPRITES LD A, K_SONG_3 CALL CARGA_CANCION LD HL, .TEXT0 LD DE, NAMTBL+32*1 CALL WRITE_TEXT CALL MSUPPORT.WAIT_SECONDS LD HL, .TEXT1 LD DE, NAMTBL+32*3 CALL WRITE_TEXT CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS LD HL, .TEXT2 LD DE, NAMTBL+32*5 CALL WRITE_TEXT CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS LD HL, .TEXT3 LD DE, NAMTBL+32*7 CALL WRITE_TEXT CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS JP SHOW_ENDING_STAFF /* CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL PLAYER_OFF CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS JP MAIN_INTRO */ .TEXT0 DB _SP, _Y, _O, _U, _SP, _H, _A, _V, _E, _SP, _S, _A, _V, _E, _D, _SP, _M, _A, _N, _Y, _SP, _P, _E, _O, _P, _L, _E, _SP, _SP, _SP, _SP, _SP .TEXT1 DB _SP, _I, _N, _SP, _T, _I, _M, _E, _AD, _SP, _S, _O, _M, _E, _SP, _O, _F, _SP, _T, _H, _E, _M, _SP, _S, _C, _I, _E, _N, _T, _I, _S, _T .TEXT2 DB _SP, _W, _H, _O, _SP, _H, _A, _V, _E, _SP, _B, _E, _E, _N, _SP, _A, _B, _L, _E, _SP, _T, _O, _SP, _C, _O, _N, _T, _A, _I, _N, _SP, _SP .TEXT3 DB _SP, _T, _H, _E, _SP, _E, _P, _I, _D, _E, _M, _I, _C, _SP, _LI, _W, _E, _L, _L, _SP, _D, _O, _N, _E, _SP, _A, _M, _Y, _AD, _SP, _SP, _SP ;========================================== ;::LOAD_GOOD_ENDING ;========================================== LOAD_GOOD_ENDING CALL MSCREEN.CLEAR_SCREEN LD BC, 32*8*8 ;RESET BUFFER OF BANK0 LD DE, MWORK.TMP_UNZIP CALL MSUPPORT.RESET_BIG_RAM CALL SETGAMEPAGE0 LD HL, MDATAP0.ALPHABET_PATTERNS LD DE, MWORK.TMP_UNZIP + 224*8 ;LOAD ALPHABET IN LAST LINE OF BANK0 CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL LD BC, 32*8*8 CALL LDIRVM LD HL, MDATAP0.COMMON_ENDING_PATTERNS_1 LD DE, CHRTBL+32*8*8 CALL LOAD_BANK LD HL, MDATAP0.GOOD_ENDING_PATTERNS_2 LD DE, CHRTBL+32*8*8*2 CALL LOAD_BANK LD BC, 32*8*8 ;RESET BUFFER OF BANK0 LD DE, MWORK.TMP_UNZIP CALL MSUPPORT.RESET_BIG_RAM CALL SETGAMEPAGE0 LD HL, MDATAP0.ALPHABET_COLORS LD DE, MWORK.TMP_UNZIP + 224*8 CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL LD BC, 32*8*8 CALL LDIRVM LD HL, MDATAP0.COMMON_ENDING_COLORS_1 LD DE, CLRTBL+32*8*8 CALL LOAD_BANK LD HL, MDATAP0.GOOD_ENDING_COLORS_2 LD DE, CLRTBL+32*8*8*2 CALL LOAD_BANK RET ;========================================== ;::SHOW_BAD_ENDING ;========================================== SHOW_BAD_ENDING CALL DISSCR CALL LOAD_BAD_ENDING CALL MSCREEN.CLEAR_SCREEN CALL MSCREEN.CLEAR_CAMERA LD HL, MWORK.CAMERA_SCREEN+32*8 LD B, 2 .LOOP PUSH BC LD B, 0 XOR A .LOOPBANK LD [HL], A INC HL INC A DJNZ .LOOPBANK POP BC DJNZ .LOOP HALT LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 48 CALL MSUPPORT.UFLDIRVM CALL ENASCR CALL MSUPPORT.INIT_SPRITES_SIZE LD A, MPLAYER.K_KEY_DOWN LD [MWORK.PLAYER_DIRECTION], A LD A, 116 LD [MWORK.PLAYER_X], A LD A, 112 LD [MWORK.PLAYER_Y], A CALL MPLAYER.SET_PLAYER_FRAME HALT CALL MSCREEN.RENDER_SPRITES LD A, K_SONG_GAME_OVER CALL CARGA_CANCION LD HL, .TEXT0 LD DE, NAMTBL+32*1 CALL WRITE_TEXT CALL MSUPPORT.WAIT_SECONDS LD HL, .TEXT1 LD DE, NAMTBL+32*3 CALL WRITE_TEXT CALL MSUPPORT.WAIT_SECONDS LD HL, .TEXT2 LD DE, NAMTBL+32*5 CALL WRITE_TEXT CALL MSUPPORT.WAIT_SECONDS LD HL, .TEXT3 LD DE, NAMTBL+32*7 CALL WRITE_TEXT CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS LD A, K_SONG_3 CALL CARGA_CANCION CALL MSUPPORT.WAIT_SECONDS CALL SHOW_ENDING_STAFF /* CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_SECONDS CALL PLAYER_OFF JP MAIN_INTRO */ .TEXT0 DB _SP, _S, _O, _R, _R, _Y, _SP, _A, _M, _Y, _SP, _Y, _O, _U, _SP, _A, _R, _R, _I, _V, _E, _SP, _T, _O, _O, _SP, _L, _A, _T, _E, _SP, _SP .TEXT1 DB _SP, _Z, _O, _M, _B, _I, _E, _S, _SP, _W, _E, _N, _T, _SP, _T, _O, _SP, _R, _E, _S, _E, _A, _R, _C, _H, _SP, _SP, _SP, _SP, _SP, _SP, _SP .TEXT2 DB _SP, _F, _A, _C, _I, _L, _T, _Y, _SP, _A, _N, _D, _SP, _P, _O, _L, _L, _U, _T, _E, _D, _SP, _T, _H, _E, _SP, _R, _I, _V, _E, _R .TEXT3 DB _SP, _T, _H, _E, _SP, _E, _P, _I, _D, _E, _M, _I, _C, _SP, _W, _I, _L, _L, _SP, _S, _P, _R, _E, _A, _D, _AD, _SP, _SP, _SP, _SP, _SP ;========================================== ;::LOAD_BAD_ENDING ;========================================== LOAD_BAD_ENDING CALL MSCREEN.CLEAR_SCREEN LD BC, 32*8*8 ;RESET BUFFER OF BANK0 LD DE, MWORK.TMP_UNZIP CALL MSUPPORT.RESET_BIG_RAM CALL SETGAMEPAGE0 LD HL, MDATAP0.ALPHABET_PATTERNS LD DE, MWORK.TMP_UNZIP + 224*8 ;LOAD ALPHABET IN LAST LINE OF BANK0 CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL LD BC, 32*8*8 CALL LDIRVM LD HL, MDATAP0.COMMON_ENDING_PATTERNS_1 LD DE, CHRTBL+32*8*8 CALL LOAD_BANK LD HL, MDATAP0.BAD_ENDING_PATTERNS_2 LD DE, CHRTBL+32*8*8*2 CALL LOAD_BANK LD BC, 32*8*8 ;RESET BUFFER OF BANK0 LD DE, MWORK.TMP_UNZIP CALL MSUPPORT.RESET_BIG_RAM CALL SETGAMEPAGE0 LD HL, MDATAP0.ALPHABET_COLORS LD DE, MWORK.TMP_UNZIP + 224*8 CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL LD BC, 32*8*8 CALL LDIRVM LD HL, MDATAP0.COMMON_ENDING_COLORS_1 LD DE, CLRTBL+32*8*8 CALL LOAD_BANK LD HL, MDATAP0.BAD_ENDING_COLORS_2 LD DE, CLRTBL+32*8*8*2 CALL LOAD_BANK RET ;======================================== ;::SHOW_ENDING_STAFF ;======================================== SHOW_ENDING_STAFF CALL DISSCR CALL MSCREEN.CLEAR_SCREEN CALL LOAD_STAFF_TILES CALL ENASCR LD HL, MWORK.TMP_UNZIP+32 LD DE, .INDEX .MAIN_LOOP LD B, 25 .LOOP HALT DJNZ .LOOP LD A, [DE] INC DE PUSH DE CP 0 JP Z, .WRITE_BLANK CP MWORK.K_EOF JP Z, .END LD DE, MWORK.CAMERA_SCREEN+23*32 LD BC, 32 LDIR .DO_SCROLL CALL DO_SCROLL POP DE JP .MAIN_LOOP .END POP DE CALL MSUPPORT.WAIT_SECONDS CALL MSUPPORT.WAIT_FEW_SECONDS CALL PLAYER_OFF JP MAIN_INTRO .WRITE_BLANK PUSH HL LD HL, MWORK.TMP_UNZIP LD BC, 32 LD DE, MWORK.CAMERA_SCREEN+23*32 LDIR POP HL JP .DO_SCROLL .INDEX DB 1, 0, 0, 0 ;STAFF DB 1, 0, 1, 0, 0, 0 ;ARDUDBOY DB 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0 ;PIXEL ART DB 1, 0, 1, 0, 0, 0 ; MUSIC DB 1, 0, 1 ; PENTACOUR DB 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 DB 0, 0, 0, MWORK.K_EOF ;======================================== ;::LOAD_STAFF_TILES ;======================================== LOAD_STAFF_TILES CALL SETGAMEPAGE0 LD HL, MDATAP0.STAFF_PATTERNS LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL LD BC, 32*8*8 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+32*8*8 LD BC, 32*8*8 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CHRTBL+32*8*8*2 LD BC, 32*8*8 CALL LDIRVM CALL SETGAMEPAGE0 LD HL, MDATAP0.STAFF_COLORS LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL LD BC, 32*8*8 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+32*8*8 LD BC, 32*8*8 CALL LDIRVM LD HL, MWORK.TMP_UNZIP LD DE, CLRTBL+32*8*8*2 LD BC, 32*8*8 CALL LDIRVM CALL SETGAMEPAGE0 LD HL, MDATAP0.STAFF_TILES LD DE, MWORK.TMP_UNZIP CALL PLETTER.UNPACK CALL RESTOREBIOS EI RET ;======================================== ;::DO_SCROLL ;======================================== DO_SCROLL PUSH HL PUSH DE LD HL, MWORK.CAMERA_SCREEN+32 LD DE, MWORK.CAMERA_SCREEN LD BC, 23*32 LDIR HALT LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 14;48 CALL MSUPPORT.UFLDIRVM POP DE POP HL RET ;========================================= ;::TRATE_PAUSE ;========================================= TRATE_PAUSE CALL PLAYER_OFF LD B, 30 LD HL, FX_TAKE ;//TODO Mejorar LD [PUNTERO_SONIDO], HL LD HL,INTERR SET 2,[HL] .WaitLoop HALT DJNZ .WaitLoop .CheckF1 HALT LD A, 6 ;F1 CALL SNSMAT AND 32 CP 0 JR NZ, .CheckF1 LD HL, FX_TAKE ;//TODO Mejorar LD [PUNTERO_SONIDO], HL LD HL,INTERR SET 2,[HL] LD B, 30 .WaitLoop2 HALT DJNZ .WaitLoop2 LD A, [MWORK.SURVIVORS_TO_SAVE] CP 0 JP Z, .RUN_MUSIC LD A, [MWORK.CURRENT_SONG] CALL CARGA_CANCION RET .RUN_MUSIC DI PUSH IX LD A, K_SONG_RUN CALL CARGA_CANCION POP IX EI RET ;======================================== ;::SHOW_GAME_OVER ;======================================== SHOW_GAME_OVER CALL PLAYER_OFF CALL MSCREEN.CLEAR_SCREEN LD HL, MDATA.TITLES_PATTERNS LD DE, MDATA.TITLES_COLORS CALL LOAD_TILE_SET_ONE_BANK LD A, K_SONG_GAME_OVER CALL CARGA_CANCION LD HL, MWORK.CAMERA_SCREEN+6*32+9 LD A, 61 LD B, 14 .LOOPUP LD [HL], A INC HL INC A DJNZ .LOOPUP LD HL, MWORK.CAMERA_SCREEN+7*32+9 LD A, 75 LD B, 14 .LOOPDOWN LD [HL], A INC HL INC A DJNZ .LOOPDOWN LD HL, MWORK.CAMERA_SCREEN+9*32+18 CALL RENDER_BONUS_POINTS HALT LD HL, MWORK.CAMERA_SCREEN LD DE, NAMTBL LD B, 48 CALL MSUPPORT.UFLDIRVM CALL SHOW_PRESS_SPACE_TO_CONTINUE JP Z, MAIN_INTRO LD A, 1 LD [MWORK.ALREADY_CONTINUE], A LD A, [MWORK.NUM_OF_CONTINUES] INC A LD [MWORK.NUM_OF_CONTINUES], A CP K_MAX_CONTINUES_FOR_GOOD_ENDING JP C, .CONTINUE LD A, K_MAX_CONTINUES_FOR_GOOD_ENDING LD [MWORK.NUM_OF_CONTINUES], A .CONTINUE LD A, MWORK.K_INITIAL_PLAYER_LIVES LD [MWORK.PLAYER_LIVES], A XOR A LD [MWORK.PLAYER_POINTS], A LD [MWORK.PLAYER_POINTS+1], A LD [MWORK.PLAYER_POINTS+2], A JP MAIN_INIT_LEVEL _SP EQU 224 _A EQU 225 _B EQU 226 _C EQU 227 _D EQU 228 _E EQU 229 _F EQU 230 _G EQU 231 _H EQU 232 _I EQU 233 _J EQU 234 _K EQU 235 _L EQU 236 _M EQU 237 _N EQU 238 _O EQU 239 _P EQU 240 _Q EQU 241 _R EQU 242 _S EQU 243 _T EQU 244 _U EQU 245 _V EQU 246 _W EQU 247 _X EQU 248 _Y EQU 249 _Z EQU 250 _AD EQU 251 _QU EQU 252 _LI EQU 253 _AP EQU 254 ENDMODULE
dv3/fd/pcf/p2ms.asm
olifink/smsqe
0
17476
<reponame>olifink/smsqe<gh_stars>0 ; DV3 PC Compatible Pause 2 ms  2000 <NAME> section dv3 xdef fd_p2ms ; pause 2 ms xref.l fdc_stat include 'dev8_dv3_keys' include 'dev8_dv3_fd_keys' ;+++ ; Pause 2 ms ; ; all registers preserved ; ;--- fd_p2ms fp2.reg reg d0/a0 movem.l fp2.reg,-(sp) lea fdc_stat,a0 ; status register address move.l fdl_1sec(a3),d0 ; 1 second timer ish fp2_wait tst.b (a0) ; status sub.l #500,d0 ; count down bgt.s fp2_wait movem.l (sp)+,fp2.reg rts end
software/hal/boards/components/MS5611/ms5611-driver.ads
TUM-EI-RCS/StratoX
12
28869
-- Institution: Technische Universitaet Muenchen -- Department: Realtime Computer Systems (RCS) -- Project: StratoX -- -- Authors: <NAME> (<EMAIL>) -- <NAME> (<EMAIL>) with Units; -- @summary Driver for the Barometer MS5611-01BA03 package MS5611.Driver with SPARK_Mode, Abstract_State => (State, Coefficients), Initializes => (State, Coefficients) -- all have defaults in the body is type Device_Type is (Baro, NONE); type Error_Type is (SUCCESS, FAILURE); subtype Time_Type is Units.Time_Type; -- FIXME: this is critical: those subtypes don't have 0.0 in their range, thus a constraint error -- is raised whenever an object of those is declared without initialization. subtype Temperature_Type is Units.Temperature_Type range 233.15 .. 358.15; -- (-)40 .. 85degC, limits from datasheet subtype Pressure_Type is Units.Pressure_Type range 1000.0 .. 120000.0; -- 10 .. 1200 mbar, limits from datasheet -- this influences the measurement noise/precision and conversion time type OSR_Type is (OSR_256, -- 0.012degC/0.065mbar, <0.6ms OSR_512, OSR_1024, OSR_2048, OSR_4096 -- 0.002degC/0.012mbar, <9.04ms ) with Default_Value => OSR_256; procedure Reset; -- send a soft-reset to the device. procedure Init; -- initialize the device, get chip-specific compensation values procedure Update_Val (have_update : out Boolean); -- trigger measurement update. Should be called periodically. function Get_Temperature return Temperature_Type; -- get temperature from buffer -- @return the last known temperature measurement function Get_Pressure return Pressure_Type; -- get barometric pressure from buffer -- @return the last known pressure measurement procedure Self_Check (Status : out Error_Type); -- implements the self-check of the barometer. -- It checks the measured altitude for validity by -- comparing them to altitude_offset. Furthermore it can adapt -- the takeoff altitude. -- @param Status returns the result of self check end MS5611.Driver;
src/PJ/flic386p/libsrc/gluecode/convclk.asm
AnimatorPro/Animator-Pro
119
104205
;***************************************************************************** ;* CONVCLK.ASM - Code to convert clock values between milliseconds and jiffies ;***************************************************************************** include stdmacro.i _DATA segment clockscale dd (256*1000)/70 SHIFTSCALE equ 8 _DATA ends _TEXT segment extrn pj_clock_1000:near public pj_clock_jiffies public _pj_clock_jiffies public pj_clock_ms2jiffies public _pj_clock_ms2jiffies public pj_clock_jiffies2ms public _pj_clock_jiffies2ms ;***************************************************************************** ;* ULONG pj_clock_jiffies(void) ;***************************************************************************** pj_clock_jiffies proc near _pj_clock_jiffies proc near call pj_clock_1000 cdq shld edx,eax,SHIFTSCALE shl eax,SHIFTSCALE div clockscale ret _pj_clock_jiffies endp pj_clock_jiffies endp ;***************************************************************************** ;* ULONG pj_clock_ms2jiffies(ULONG ms) ;***************************************************************************** pj_clock_ms2jiffies proc near _pj_clock_ms2jiffies proc near Entry Args #ms mov eax,#ms cdq shld edx,eax,SHIFTSCALE shl eax,SHIFTSCALE div clockscale Exit _pj_clock_ms2jiffies endp pj_clock_ms2jiffies endp ;***************************************************************************** ;* ULONG pj_clock_jiffies2ms(ULONG jiffies) ;***************************************************************************** pj_clock_jiffies2ms proc near _pj_clock_jiffies2ms proc near Entry Args #jiffies mov eax,#jiffies mul clockscale shrd eax,edx,SHIFTSCALE Exit _pj_clock_jiffies2ms endp pj_clock_jiffies2ms endp _TEXT ends end
Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2_notsx.log_2574_369.asm
ljhsiun2/medusa
9
102562
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r14 push %r15 push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x143cd, %r10 nop nop nop nop nop cmp $18692, %r14 mov (%r10), %di nop nop nop nop nop and $26313, %r14 lea addresses_A_ht+0x15f9f, %rsi lea addresses_UC_ht+0xd997, %rdi clflush (%rsi) nop nop dec %rdx mov $8, %rcx rep movsq nop nop xor %r10, %r10 lea addresses_UC_ht+0x2bd7, %rsi lea addresses_normal_ht+0xa6f7, %rdi clflush (%rdi) nop nop nop nop nop add $35698, %r11 mov $104, %rcx rep movsw nop sub $9545, %rdi lea addresses_A_ht+0x16b29, %rsi lea addresses_WT_ht+0x121d7, %rdi nop nop nop nop nop inc %r15 mov $86, %rcx rep movsl nop nop add %rsi, %rsi lea addresses_D_ht+0x1a357, %rsi nop nop nop sub $57906, %rdi mov $0x6162636465666768, %r15 movq %r15, %xmm2 movups %xmm2, (%rsi) nop nop add %rdx, %rdx lea addresses_WC_ht+0x152d7, %r10 and $33019, %rcx mov $0x6162636465666768, %rdx movq %rdx, %xmm7 vmovups %ymm7, (%r10) nop sub %r11, %r11 lea addresses_A_ht+0xd337, %r11 nop and $32655, %rcx mov $0x6162636465666768, %rsi movq %rsi, %xmm3 movups %xmm3, (%r11) nop nop nop inc %r15 lea addresses_WC_ht+0x71cd, %rdi clflush (%rdi) nop xor %rcx, %rcx and $0xffffffffffffffc0, %rdi vmovaps (%rdi), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $0, %xmm2, %r11 nop nop nop nop xor $25748, %r10 pop %rsi pop %rdx pop %rdi pop %rcx pop %r15 pop %r14 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r9 push %rbp push %rdx push %rsi // Store mov $0x4d7, %r10 nop nop nop nop sub %rbp, %rbp movl $0x51525354, (%r10) sub $57169, %rbp // Store lea addresses_D+0x12ed7, %r11 nop nop xor %r10, %r10 movb $0x51, (%r11) nop nop nop nop cmp %rsi, %rsi // Load lea addresses_WC+0x43d7, %r10 clflush (%r10) nop nop nop sub %rsi, %rsi mov (%r10), %r11d nop nop cmp $58736, %rbp // Load lea addresses_UC+0xb057, %r10 nop nop nop nop nop and %rdx, %rdx movb (%r10), %r11b add %rbp, %rbp // Store lea addresses_WC+0x1b29f, %rdx add %r9, %r9 movl $0x51525354, (%rdx) nop nop nop nop xor $65085, %rdx // Load lea addresses_RW+0x13447, %rbp nop nop cmp %r11, %r11 movups (%rbp), %xmm2 vpextrq $0, %xmm2, %r9 nop nop nop sub %rdx, %rdx // Load lea addresses_WT+0xad7, %rsi nop nop nop nop nop inc %r13 movntdqa (%rsi), %xmm7 vpextrq $0, %xmm7, %rdx nop nop nop sub $45188, %r10 // Faulty Load mov $0x4d7, %r9 add $59129, %r11 movntdqa (%r9), %xmm7 vpextrq $1, %xmm7, %rsi lea oracles, %r10 and $0xff, %rsi shlq $12, %rsi mov (%r10,%rsi,1), %rsi pop %rsi pop %rdx pop %rbp pop %r9 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_P', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 9, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_P', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': False}} {'00': 2574} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
data/jpred4/jp_batch_1613899824__ncAp6aK/jp_batch_1613899824__ncAp6aK.als
jonriege/predict-protein-structure
0
4418
SILENT_MODE BLOCK_FILE jp_batch_1613899824__ncAp6aK.concise.blc MAX_NSEQ 813 MAX_INPUT_LEN 815 OUTPUT_FILE jp_batch_1613899824__ncAp6aK.concise.ps PORTRAIT POINTSIZE 8 IDENT_WIDTH 12 X_OFFSET 2 Y_OFFSET 2 DEFINE_FONT 0 Helvetica DEFAULT DEFINE_FONT 1 Helvetica REL 0.75 DEFINE_FONT 7 Helvetica REL 0.6 DEFINE_FONT 3 Helvetica-Bold DEFAULT DEFINE_FONT 4 Times-Bold DEFAULT DEFINE_FONT 5 Helvetica-BoldOblique DEFAULT # DEFINE_COLOUR 3 1 0.62 0.67 # Turquiose DEFINE_COLOUR 4 1 1 0 # Yellow DEFINE_COLOUR 5 1 0 0 # Red DEFINE_COLOUR 7 1 0 1 # Purple DEFINE_COLOUR 8 0 0 1 # Blue DEFINE_COLOUR 9 0 1 0 # Green DEFINE_COLOUR 10 0.41 0.64 1.00 # Pale blue DEFINE_COLOUR 11 0.41 0.82 0.67 # Pale green DEFINE_COLOUR 50 0.69 0.18 0.37 # Pink (helix) DEFINE_COLOUR 51 1.00 0.89 0.00 # Gold (strand) NUMBER_INT 10 SETUP # # Highlight specific residues. # Avoid highlighting Lupas 'C' predictions by # limiting the highlighting to the alignments Scol_CHARS C 1 1 324 802 4 Ccol_CHARS H ALL 5 Ccol_CHARS P ALL 8 SURROUND_CHARS LIV ALL # # Replace known structure types with whitespace SUB_CHARS 1 803 324 812 H SPACE SUB_CHARS 1 803 324 812 E SPACE SUB_CHARS 1 803 324 812 - SPACE STRAND 5 806 11 COLOUR_TEXT_REGION 5 806 11 806 51 STRAND 36 806 41 COLOUR_TEXT_REGION 36 806 41 806 51 STRAND 67 806 68 COLOUR_TEXT_REGION 67 806 68 806 51 STRAND 80 806 85 COLOUR_TEXT_REGION 80 806 85 806 51 STRAND 118 806 123 COLOUR_TEXT_REGION 118 806 123 806 51 STRAND 145 806 150 COLOUR_TEXT_REGION 145 806 150 806 51 STRAND 173 806 179 COLOUR_TEXT_REGION 173 806 179 806 51 STRAND 185 806 190 COLOUR_TEXT_REGION 185 806 190 806 51 STRAND 257 806 263 COLOUR_TEXT_REGION 257 806 263 806 51 STRAND 273 806 281 COLOUR_TEXT_REGION 273 806 281 806 51 STRAND 287 806 291 COLOUR_TEXT_REGION 287 806 291 806 51 HELIX 15 806 28 COLOUR_TEXT_REGION 15 806 28 806 50 HELIX 48 806 57 COLOUR_TEXT_REGION 48 806 57 806 50 HELIX 73 806 74 COLOUR_TEXT_REGION 73 806 74 806 50 HELIX 92 806 113 COLOUR_TEXT_REGION 92 806 113 806 50 HELIX 128 806 136 COLOUR_TEXT_REGION 128 806 136 806 50 HELIX 151 806 165 COLOUR_TEXT_REGION 151 806 165 806 50 HELIX 211 806 221 COLOUR_TEXT_REGION 211 806 221 806 50 HELIX 223 806 229 COLOUR_TEXT_REGION 223 806 229 806 50 HELIX 236 806 250 COLOUR_TEXT_REGION 236 806 250 806 50 HELIX 297 806 321 COLOUR_TEXT_REGION 297 806 321 806 50 STRAND 5 811 11 COLOUR_TEXT_REGION 5 811 11 811 51 STRAND 36 811 41 COLOUR_TEXT_REGION 36 811 41 811 51 STRAND 66 811 69 COLOUR_TEXT_REGION 66 811 69 811 51 STRAND 80 811 85 COLOUR_TEXT_REGION 80 811 85 811 51 STRAND 118 811 124 COLOUR_TEXT_REGION 118 811 124 811 51 STRAND 145 811 151 COLOUR_TEXT_REGION 145 811 151 811 51 STRAND 173 811 179 COLOUR_TEXT_REGION 173 811 179 811 51 STRAND 185 811 190 COLOUR_TEXT_REGION 185 811 190 811 51 STRAND 257 811 263 COLOUR_TEXT_REGION 257 811 263 811 51 STRAND 274 811 282 COLOUR_TEXT_REGION 274 811 282 811 51 STRAND 287 811 291 COLOUR_TEXT_REGION 287 811 291 811 51 HELIX 15 811 26 COLOUR_TEXT_REGION 15 811 26 811 50 HELIX 46 811 56 COLOUR_TEXT_REGION 46 811 56 811 50 HELIX 92 811 112 COLOUR_TEXT_REGION 92 811 112 811 50 HELIX 126 811 137 COLOUR_TEXT_REGION 126 811 137 811 50 HELIX 152 811 165 COLOUR_TEXT_REGION 152 811 165 811 50 HELIX 211 811 229 COLOUR_TEXT_REGION 211 811 229 811 50 HELIX 237 811 251 COLOUR_TEXT_REGION 237 811 251 811 50 HELIX 297 811 322 COLOUR_TEXT_REGION 297 811 322 811 50 STRAND 5 812 11 COLOUR_TEXT_REGION 5 812 11 812 51 STRAND 35 812 40 COLOUR_TEXT_REGION 35 812 40 812 51 STRAND 81 812 84 COLOUR_TEXT_REGION 81 812 84 812 51 STRAND 118 812 123 COLOUR_TEXT_REGION 118 812 123 812 51 STRAND 146 812 149 COLOUR_TEXT_REGION 146 812 149 812 51 STRAND 172 812 178 COLOUR_TEXT_REGION 172 812 178 812 51 STRAND 185 812 191 COLOUR_TEXT_REGION 185 812 191 812 51 STRAND 256 812 264 COLOUR_TEXT_REGION 256 812 264 812 51 STRAND 272 812 276 COLOUR_TEXT_REGION 272 812 276 812 51 STRAND 286 812 291 COLOUR_TEXT_REGION 286 812 291 812 51 HELIX 13 812 29 COLOUR_TEXT_REGION 13 812 29 812 50 HELIX 49 812 57 COLOUR_TEXT_REGION 49 812 57 812 50 HELIX 73 812 76 COLOUR_TEXT_REGION 73 812 76 812 50 HELIX 93 812 113 COLOUR_TEXT_REGION 93 812 113 812 50 HELIX 132 812 135 COLOUR_TEXT_REGION 132 812 135 812 50 HELIX 150 812 164 COLOUR_TEXT_REGION 150 812 164 812 50 HELIX 211 812 220 COLOUR_TEXT_REGION 211 812 220 812 50 HELIX 223 812 230 COLOUR_TEXT_REGION 223 812 230 812 50 HELIX 235 812 249 COLOUR_TEXT_REGION 235 812 249 812 50 HELIX 297 812 320 COLOUR_TEXT_REGION 297 812 320 812 50
externals/mpir-3.0.0/mpn/x86_64w/k8/addlsh_n.asm
JaminChan/eos_win
12
173695
; PROLOGUE(mpn_addlsh_n) ; Copyright 2009 <NAME> ; ; Windows Conversion Copyright 2008 <NAME> ; ; This file is part of the MPIR Library. ; ; The MPIR Library is free software; you can redistribute it and/or modify ; it under the terms of the GNU Lesser General Public License as published ; by the Free Software Foundation; either version 2.1 of the License, or (at ; your option) any later version. ; ; The MPIR Library is distributed in the hope that it will be useful, but ; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public ; License for more details. ; ; You should have received a copy of the GNU Lesser General Public License ; along with the MPIR Library; see the file COPYING.LIB. If not, write ; to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ; Boston, MA 02110-1301, USA. ; ; mp_limb_t mpn_addlsh_n(mp_ptr, mp_ptr, mp_ptr, mp_size_t, mp_uint, mp_limb_t) ; mp_limb_t mpn_addlsh_nc(mp_ptr, mp_ptr, mp_ptr, mp_size_t, mp_uint) ; rax rdi rsi rdx rcx r8 r9 ; rax rcx rdx r8 r9 [rsp+40] [rsp+48] %include "yasm_mac.inc" CPU Athlon64 BITS 64 %define reg_save_list rbx, rsi, rdi, rbp, r12, r13, r14, r15 LEAF_PROC mpn_addlsh_n mov r10, r9 xor r9, r9 jmp entry LEAF_PROC mpn_addlsh_nc mov r10, r9 mov r9, [rsp+48] jmp entry xalign 16 entry: FRAME_PROC ?mpn_addlsh, 0, reg_save_list lea rdi, [rcx+r10*8] lea rsi, [rdx+r10*8] lea rdx, [r8+r10*8] mov ecx, dword [rsp+stack_use+40] neg rcx shr r9, cl neg r10 xor rax, rax test r10, 3 jz .2 .1: mov r8, [rdx+r10*8] mov r11, r8 neg rcx shl r8, cl neg rcx shr r11, cl or r8, r9 mov r9, r11 add rax, 1 adc r8, [rsi+r10*8] sbb rax, rax mov [rdi+r10*8], r8 inc r10 test r10, 3 jnz .1 .2: cmp r10, 0 jz .4 xalign 16 .3: mov r8, [rdx+r10*8] mov rbp, [rdx+r10*8+8] mov rbx, [rdx+r10*8+16] mov r12, [rdx+r10*8+24] mov r11, r8 mov r13, rbp mov r14, rbx mov r15, r12 neg rcx shl r8, cl shl rbp, cl shl rbx, cl shl r12, cl neg rcx shr r11, cl shr r13, cl shr r14, cl shr r15, cl or r8, r9 or rbp, r11 or rbx, r13 or r12, r14 mov r9, r15 add rax, 1 adc r8, [rsi+r10*8] adc rbp, [rsi+r10*8+8] adc rbx, [rsi+r10*8+16] adc r12, [rsi+r10*8+24] sbb rax, rax mov [rdi+r10*8], r8 mov [rdi+r10*8+8], rbp mov [rdi+r10*8+16], rbx mov [rdi+r10*8+24], r12 add r10, 4 jnz .3 .4: neg rax add rax, r9 END_PROC reg_save_list end
notes/papers/fossacs-2012/Examples.agda
asr/fotc
11
13395
<filename>notes/papers/fossacs-2012/Examples.agda {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module Examples where data _∨_ (A B : Set) : Set where inl : A → A ∨ B inr : B → A ∨ B postulate commOr : {A B : Set} → A ∨ B → B ∨ A {-# ATP prove commOr #-}
nicolai/thesis/HHHUU-ComplicatedTypes.agda
nicolaikraus/HoTT-Agda
1
9910
<gh_stars>1-10 {-# OPTIONS --without-K #-} {- Here, we derive our main theorem: there is a type in the n-th universe that is not an n-type, implying the n-th universe is not n-truncated. The n-th universe restricted to n-types is hence a 'strict' n-type. For this, we first derive local-global looping in a modular way. A technical point worth noting is that Agda does not implement cumulative universes. Since that means the crucial steps in our transformations (where we pass between universes uning univalence) can not be expressed using equality without resorting to explicit lifting, we decide to explicitely uses equivalences (and pointed equivalences, respectively) instead where possible. As a drawback, we have to use lemmata showing preservation of (pointed) equivalences of various (pointed) type constructions, a parametricity property derived for free from univalence-induced equalities. -} module HHHUU-ComplicatedTypes where open import lib.Basics hiding (_⊔_) open import lib.Equivalences2 open import lib.NType2 open import lib.types.Bool open import lib.types.Nat hiding (_+_) open import lib.types.Paths open import lib.types.Sigma open import lib.types.Pi open import lib.types.TLevel open import Preliminaries open import Pointed open import UniverseOfNTypes -- The argument that (Type lzero) is not a set is standard. -- We omit it and the argument that (Type (S lzero)) is not a 1-Type: -- they are both special cases of the general theorem we prove. -- The general theorem is formalised in this file. --Definition 7.3.1 -- We have fibered notions of the loop space contruction and n-truncatedness. module _ {i} {X : Type• i} {j} where {- Note that the definition of the family of path types differs slightly from that in the thesis, which would correspond to transport P p x == x. We use dependent paths since this follows the design of the HoTT community's Agda library. There is no actual difference; both types are equivalent. -} Ω̃ : Fam• X j → Fam• (Ω X) j Ω̃ (P , x) = ((λ p → x == x [ P ↓ p ]) , idp) fam-has-level : ℕ₋₂ → Fam• X j → Type (i ⊔ j) fam-has-level n Q = (a : base X) → has-level n (fst Q a) {- == Pointed dependent sums == Pointed families as defined above enable us to introduce a Σ-connective for pointed types. Because of the abstract nature of some of our lemmata, we give Σ• in its uncurried form and first define the type of its parameter. -} Σ•-param : ∀ i j → Type (lsucc (i ⊔ j)) Σ•-param i j = Σ (Type• i) (λ X → Fam• X j) module _ {i j} where Ω-Σ•-param : Σ•-param i j → Σ•-param i j Ω-Σ•-param (X , W) = (Ω X , Ω̃ W) -- Definition 7.3.2 Σ• : Σ•-param i j → Type• (i ⊔ j) Σ• (X , Q) = (Σ (base X) (fst Q) , (pt X , snd Q)) -- Lemma 7.3.3 {- Commutativity of pointed dependent sums and the loop space construction will become an important technical tool, enabling us to work at a more abstract level later on. -} Ω-Σ•-comm : (R : Σ•-param i j) → Ω (Σ• R) ≃• Σ• (Ω-Σ•-param R) Ω-Σ•-comm _ = (=Σ-eqv _ _ , idp) ⁻¹• {- Pointed dependent products. This is not quite the equivalent of Π for pointed types: the domain parameter is just an ordinary non-pointed type. However, to enable our goal of abstractly working with pointed types, defining this notion is useful. -} Π•-param : ∀ i j → Type (lsucc (i ⊔ j)) Π•-param i j = Σ (Type i) (λ A → A → Type• j) module _ {i j} where Ω-Π•-param : Π•-param i j → Π•-param i j Ω-Π•-param (A , F) = (A , Ω ∘ F) -- Definition 7.3.4 Π• : Π•-param i j → Type• (i ⊔ j) Π• (A , Y) = (Π A (base ∘ Y) , pt ∘ Y) -- Lemma 7.3.5 {- Pointed dependent products and loop space construction on its codomain parameter commute as well. -} Ω-Π•-comm : (R : Π•-param i j) → Ω (Π• R) ≃• Π• (Ω-Π•-param R) Ω-Π•-comm _ = (app=-equiv , idp) Ω^-Π•-comm : (C : Type i) (F : C → Type• j) (n : ℕ) → (Ω ^ n) (Π• (C , F)) ≃• Π• (C , ((Ω ^ n) ∘ F)) Ω^-Π•-comm C F 0 = ide• _ Ω^-Π•-comm C F (S n) = Ω^-Π•-comm C _ n ∘e• equiv-Ω^ n (Ω-Π•-comm _) equiv-Π• : ∀ {i₀ i₁ j₀ j₁} {R₀ : Π•-param i₀ j₀} {R₁ : Π•-param i₁ j₁} → Σ (fst R₀ ≃ fst R₁) (λ u → ∀ a → snd R₀ (<– u a) ≃• snd R₁ a) → Π• R₀ ≃• Π• R₁ equiv-Π• (u , v) = (equiv-Π u (fst ∘ v) , λ= (snd ∘ v)) -- Lemma 7.4.1 -- In an n-th loop space, we can forget components of truncation level n. forget-Ω^-Σ•₂ : ∀ {i j} {X : Type• i} (Q : Fam• X j) (n : ℕ) → fam-has-level (n -2) Q → (Ω ^ n) (Σ• (X , Q)) ≃• (Ω ^ n) X forget-Ω^-Σ•₂ {X = X} Q O h = (Σ₂-contr h , idp) forget-Ω^-Σ•₂ {i} {X = X} Q (S n) h = (Ω ^ (S n)) (Σ• (X , Q)) ≃•⟨ equiv-Ω^ n (Ω-Σ•-comm _) ⟩ (Ω ^ n) (Σ• (Ω X , Ω̃ Q)) ≃•⟨ forget-Ω^-Σ•₂ {i} _ n (λ _ → ↓-level h) ⟩ (Ω ^ (S n)) X ≃•∎ -- Lemma 7.4.2 {- Our Local-global looping principle. We would like to state this principle in the form of Ωⁿ⁺¹ (Type i , A) == ∀• a → Ωⁿ (A , a) for n ≥ 1. Unfortunately, the two sides have different universe levels since (Type i , A) lives in Type• (suc i) instead of Type• i. Morally, this is outbalanced by the extra Ω on the left-hand side, which might help explain on an intuitive level why the n-th universe ends up being not an n-type. The reason why the univalence principle (A ≡ B) ≃ (A ≃ B) cannot be written as (A ≡ B) ≡ (A ≃ B) is precisely the same. -} module _ {i} {A : Type i} where -- The degenerate pre-base case carries around a propositional component. Ω-Type : Ω (Type i , A) ≃• Σ• (Π• (A , λ a → (A , a)) , (is-equiv , idf-is-equiv _)) Ω-Type = Ω (Type i , A) ≃•⟨ ide• _ ⟩ ((A == A) , idp) ≃•⟨ ua-equiv• ⁻¹• ⟩ ((A ≃ A) , ide _) ≃•⟨ ide• _ ⟩ ((Σ (A → A) is-equiv) , (idf _ , idf-is-equiv _)) ≃•⟨ ide• _ ⟩ Σ• (Π• (A , λ a → (A , a)) , (is-equiv , idf-is-equiv _)) ≃•∎ -- The base case. Ω²-Type : (Ω ^ 2) (Type i , A) ≃• Π• (A , λ a → Ω (A , a)) Ω²-Type = (Ω ^ 2) (Type i , A) ≃•⟨ equiv-Ω Ω-Type ⟩ Ω (Σ• (Π• (A , λ a → (A , a)) , (is-equiv , idf-is-equiv _))) ≃•⟨ forget-Ω^-Σ•₂ {i} _ 1 (is-equiv-is-prop ∘ _) ⟩ Ω (Π• (A , λ a → (A , a))) ≃•⟨ Ω-Π•-comm _ ⟩ Π• (A , λ a → Ω (A , a)) ≃•∎ -- The general case follows by permuting Ω and Π• repeatedly. Ω^-Type : (n : ℕ) → (Ω ^ (n + 2)) (Type i , A) ≃• Π• (A , λ a → (Ω ^ (n + 1)) (A , a)) Ω^-Type n = Ω^-Π•-comm _ _ n ∘e• equiv-Ω^ n Ω²-Type -- Lemma 7.4.3 is taken from the library -- lib.NType2._-Type-level_ {- The pointed family P (see thesis). It takes an n-type A and returns the space of (n+1)-loops with basepoint A in U_n^n (the n-th universe restricted to n-types). This crucial restriction to n-types implies it is just a set. -} module _ (n : ℕ) (A : ⟨ n ⟩ -Type 「 n 」) where -- Definition of P and -- Corollary 7.4.4 P : ⟨0⟩ -Type• 「 n + 1 」 P = Ω^-≤' (n + 1) q where q : ⟨ n + 1 ⟩ -Type• 「 n + 1 」 q = –> Σ-comm-snd (((⟨ n ⟩ -Type-≤ 「 n 」) , A)) -- Forgetting about the truncation level, we may present P as follows: Q : Type• 「 n + 1 」 Q = (Ω ^ (n + 1)) (Type 「 n 」 , fst A) P-is-Q : fst P ≃• Q P-is-Q = equiv-Ω^ n (forget-Ω^-Σ•₂ _ 1 (λ _ → has-level-is-prop)) -- Definition of the type 'Loop' and -- Lemma 7.4.5 {- The type 'Loop' of (images of) n-loops in U_(n-1)^(n-1) is just the dependent sum over P except for the special case n ≡ 0, where we take U_(-1)^(-1) (and hence Loop) to be the booleans. The boilerplate with raise-≤T is just to verify that Loop n is n-truncated. The bulk of the rest of this module consists of showing the n-th universe is not n-truncated at basepoint Loop n, i.e. that Q n (Loop n) is not contractible. Warning: The indexing of Loop starts at -1 in the thesis, but we use natural numbers here (starting at 0), thus everything is shifted by one. -} Loop : (n : ℕ) → ⟨ n ⟩ -Type 「 n 」 Loop 0 = (Bool , Bool-is-set) Loop (S n) = Σ-≤ (⟨ n ⟩ -Type-≤ 「 n 」) (λ A → raise-≤T {n = ⟨ n + 1 ⟩} (≤T-+2+-l ⟨0⟩ (-2≤T _)) (fst (<– Σ-comm-snd (P n A)))) -- Lemma 7.4.6, preparations -- The base case is given in Section 7.2 or the thesis. -- It is done as usual (there is a non-trivial automorphism on booleans). -- Let us go slowly. module negation where -- Negation. ~ : Bool → Bool ~ = λ {true → false; false → true} -- Negation is an equivalence. e : Bool ≃ Bool e = equiv ~ ~ inv inv where inv = λ {true → idp; false → idp} base-case : ¬ (is-contr• (Q 0 (Loop 0))) base-case c = Bool-false≠true false-is-true where -- Negation being equal to the identity yields a contradiction. false-is-true = false =⟨ ! (coe-β e true) ⟩ coe (ua e) true =⟨ ap (λ p → coe p true) (! (c (ua e))) ⟩ coe idp true =⟨ idp ⟩ true ∎ -- Let us now turn towards the successor case. module _ (m : ℕ) where -- We expand the type we are later going to assume contractible. Q-L-is-… = Q (m + 1) (Loop (m + 1)) ≃•⟨ ide• _ ⟩ (Ω ^ (m + 2)) (_ , ⟦ Loop (m + 1) ⟧) ≃•⟨ (Ω^-Type m) ⟩ Π• (_ , λ {(A , q) → Ω ^ (m + 1) $ (⟦ Loop (m + 1) ⟧ , (A , q))}) ≃•⟨ ide• _ ⟩ Π• (_ , λ {(A , q) → Ω ^ (m + 1) $ Σ• ((_ , A) , (base ∘ fst ∘ P m , q))}) ≃•∎ -- What we really want is to arrive at contractibility of E (m ≥ 1)... E = Π• (⟦ Loop (m + 1) ⟧ , λ {(A , q) → Ω ^ (m + 1) $ ((⟨ m ⟩ -Type 「 m 」) , A)}) -- ...or at least show that the following element f of E is trivial (m ≡ 0). f : base E f (_ , q) = q -- We want to use our assumption of contractibility of Q (n + 1) (Loop (n + 1)) -- to show that f is trivial, i.e. constant with value the basepoint. f-is-trivial : (m : ℕ) → is-contr• (Q (m + 1) (Loop (m + 1))) → f m == pt (E m) -- m ≡ 0 f-is-trivial 0 c = ap (λ f' → fst ∘ f') (! (–> (equiv-is-contr• …-is-E') c f')) where -- This is almost E, except for the additional component -- specifying that the first component p should commute with q. E' = Π• (_ , λ {(A , q) → (Σ (A == A) (λ p → q == q [ (λ x → x == x) ↓ p ]) , (idp , idp))}) -- This "almost" E comes from Q 1 (Loop 1), hence can be shown contractible. …-is-E' : Q 1 (Loop 1) ≃• E' …-is-E' = equiv-Π• (ide _ , Ω-Σ•-comm ∘ _) ∘e• Q-L-is-… 0 -- Fortunately, f can be 'extended' to an element f' of E', -- and triviality of f' implies triviality of f. f' = λ {(_ , q) → (q , ↓-idf=idf-in (∙=∙' q q))} -- m ≥ 1: We can show Q (k + 2) (Loop (k + 2)) ≃ E (k + 1), -- thus E is contractible, hence f trivial. f-is-trivial (S k) c = ! (–> (equiv-is-contr• (…-is-E ∘e• Q-L-is-… (k + 1))) c (f (k + 1))) where …-is-E : _ ≃• E (k + 1) …-is-E = equiv-Π• (ide _ , equiv-Ω^ k ∘ (λ {(A , q) → forget-Ω^-Σ•₂ {「 k + 2 」} (base ∘ fst ∘ P (k + 1) , q) 2 (snd ∘ P (k + 1))})) -- Lemma 7.4.6, part 1 -- Our main lemma: like in the thesis, but in negative form. -- This is sufficient to prove our results, and easier to formalise. main : (n : ℕ) → ¬ (is-contr• (Q n (Loop n))) main 0 = negation.base-case main (S m) c = main m step where {- We know Q (m + 1) (Loop (m + 1)) is contractible, use that to show that the above f is trivial, deduce f (Loop m , p) ≡ p is trivial for all p in P m (Loop m), which implies P m (Loop m) is contractible. But this is just another form of Q m (Loop m), so the conclusion follows by induction hypothesis. -} step : is-contr• (Q m (Loop m)) step = –> (equiv-is-contr• (P-is-Q m (Loop m))) (λ q → app= (! (f-is-trivial m c)) (Loop m , q)) -- Lemma 7.4.6, part 2 -- Alternate form of the main lemma main' : (n : ℕ) → ¬ (is-contr• ((Ω ^ (n + 1)) ((⟨ n ⟩ -Type 「 n 」) , Loop n ))) main' n = main n ∘ –> (equiv-is-contr• (P-is-Q n (Loop n))) -- Small helper thingy helpy : ∀ {i} {n : ℕ} {X : Type• i} → has-level• (n -1) X → is-contr• ((Ω ^ n) X) helpy {n = n} {X} = <– contr•-equiv-prop ∘ trunc-many n ∘ transport (λ k → has-level• (k -2) X) (+-comm 1 n) -- Main theorems now fall out as corollaries. module _ (n : ℕ) where {- Recall that L n is n-truncated. We also know it is not (n-1)-truncated, it is thus a 'strict' n-type. -} Loop-is-not-trunc : ¬ (has-level (n -1) ⟦ Loop n ⟧) Loop-is-not-trunc = main n ∘ helpy ∘ (λ t → universe-=-level t t) -- Theorem 7.4.7 -- The n-th universe is not n-truncated. Type-is-not-trunc : ¬ (has-level ⟨ n ⟩ (Type 「 n 」)) Type-is-not-trunc = main n ∘ helpy -- Theorem 7.4.8 -- MAIN RESULT: -- The n-th universe restricted to n-types is a 'strict' (n+1)-type. -- We do not repeat that it is (n+1)-truncated; this is formalised above -- (7.4.3). Instead, we only show that it is not an n-type. Type-≤-is-not-trunc : ¬ (has-level ⟨ n ⟩ (⟨ n ⟩ -Type 「 n 」)) Type-≤-is-not-trunc = main' n ∘ helpy
oeis/090/A090115.asm
neoneye/loda-programs
11
13148
; A090115: a(n)=Product[p(n)-j, j=1..n]/n!=A090114(n)/n!. ; 1,1,4,15,252,924,11440,43758,497420,13123110,54627300,1251677700,12033222880,52860229080,511738760544,10363194502115,197548686920970,925029565741050,17302625882942400,161884603662657876 mov $2,$0 seq $0,40 ; The prime numbers. sub $0,1 add $2,1 bin $0,$2
oeis/213/A213772.asm
neoneye/loda-programs
11
245132
; A213772: Principal diagonal of the convolution array A213771. ; 1,11,42,106,215,381,616,932,1341,1855,2486,3246,4147,5201,6420,7816,9401,11187,13186,15410,17871,20581,23552,26796,30325,34151,38286,42742,47531,52665,58156,64016,70257,76891,83930,91386,99271,107597,116376,125620,135341,145551,156262,167486,179235,191521,204356,217752,231721,246275,261426,277186,293567,310581,328240,346556,365541,385207,405566,426630,448411,470921,494172,518176,542945,568491,594826,621962,649911,678685,708296,738756,770077,802271,835350,869326,904211,940017,976756,1014440 mul $0,4 mov $1,$0 add $1,3 pow $1,3 add $1,$0 mov $0,$1 div $0,32 add $0,1
programs/oeis/051/A051869.asm
karttu/loda
1
83638
; A051869: 17-gonal (or heptadecagonal) numbers: n*(15*n-13)/2. ; 0,1,17,48,94,155,231,322,428,549,685,836,1002,1183,1379,1590,1816,2057,2313,2584,2870,3171,3487,3818,4164,4525,4901,5292,5698,6119,6555,7006,7472,7953,8449,8960,9486,10027,10583,11154,11740,12341,12957,13588,14234,14895,15571,16262,16968,17689,18425,19176,19942,20723,21519,22330,23156,23997,24853,25724,26610,27511,28427,29358,30304,31265,32241,33232,34238,35259,36295,37346,38412,39493,40589,41700,42826,43967,45123,46294,47480,48681,49897,51128,52374,53635,54911,56202,57508,58829,60165,61516,62882,64263,65659,67070,68496,69937,71393,72864,74350,75851,77367,78898,80444,82005,83581,85172,86778,88399,90035,91686,93352,95033,96729,98440,100166,101907,103663,105434,107220,109021,110837,112668,114514,116375,118251,120142,122048,123969,125905,127856,129822,131803,133799,135810,137836,139877,141933,144004,146090,148191,150307,152438,154584,156745,158921,161112,163318,165539,167775,170026,172292,174573,176869,179180,181506,183847,186203,188574,190960,193361,195777,198208,200654,203115,205591,208082,210588,213109,215645,218196,220762,223343,225939,228550,231176,233817,236473,239144,241830,244531,247247,249978,252724,255485,258261,261052,263858,266679,269515,272366,275232,278113,281009,283920,286846,289787,292743,295714,298700,301701,304717,307748,310794,313855,316931,320022,323128,326249,329385,332536,335702,338883,342079,345290,348516,351757,355013,358284,361570,364871,368187,371518,374864,378225,381601,384992,388398,391819,395255,398706,402172,405653,409149,412660,416186,419727,423283,426854,430440,434041,437657,441288,444934,448595,452271,455962,459668,463389 mov $1,$0 bin $0,2 mul $0,15 add $1,$0
aes_mbr/boot.asm
DavidBuchanan314/cursed-code
3
93594
BITS 16 ORG 0x7c00 start: cli xor ax, ax mov ds, ax mov es, ax mov fs, ax mov ss, ax mov gs, ax ; TODO: these might not all be needed, could save some bytes maybe xor bx, bx mov sp, 0x7c00 ; what osdev says to do to enable SSE mov eax, cr0 and ax, 0xfffb or ax, 0x2 mov cr0, eax mov eax, cr4 or ax, 3 << 9 mov cr4, eax mov si, msg call puts mov di, password ; user input goes here input: xor ah, ah int 0x16 stosb mov ah, 0xe int 0x10 ; does int10h clobber al? I hope not... cmp di, password+16 jne input movaps xmm0, [aes_key] movaps xmm3, [password] call do_aes pxor xmm3, [pw_enc] ptest xmm3, xmm3 je decs2 mov si, oof call puts jmp $ decs2: mov si, stage2 s2loop: movaps xmm0, [password] ; password is now key movaps xmm3, [si] call do_aes movaps [si], xmm3 add si, 0x10 cmp si, pw_enc jne s2loop jmp stage2 ; xmm0 = key ; xmm3 = data do_aes: pxor xmm2, xmm2 pxor xmm3, xmm0 mov bl, 0xe5 mov cx, 10 mov byte [rcon+5], 1 encloop: rcon: aeskeygenassist xmm1, xmm0, 69 pshufd xmm1, xmm1, 0b11111111 shufps xmm2, xmm0, 0b00010000 pxor xmm0, xmm2 shufps xmm2, xmm0, 0b10001100 pxor xmm0, xmm2 pxor xmm0, xmm1 movzx ax, byte [rcon+5] shl ax, 1 div bl mov [rcon+5], ah loop next aesenclast xmm3, xmm0 ret next: aesenc xmm3, xmm0 jmp encloop puts: mov ah, 0xe lodsb test al, al jz .done int 0x10 jmp puts .done: ret msg: DB 0xd, 0xa, "We upgraded from RC4 this year!", 0xd, 0xa DB "Password: ", 0 oof: DB 0xd, 0xa, "big oof", 0 ALIGN 16 stage2: mov si, winmsg call puts jmp $ winmsg: DB 0xd, 0xa, 0xd, 0xa, "Wow, 512 bytes is a lot of space, I even had room for this verbose message.", 0xd, 0xa DB "I hope you enjoy the rest of AOTW!", 0xd, 0xa DB 0xd, 0xa, "Anyway, here's your flag: ", 0x1a," AOTW{XXXXXXXXXXXXXXXX} ", 0x1b, 0xd, 0xa DB 0xd, 0xa, " - Retr0id", 0 TIMES 0x200-0x20-($-$$) \ DB 0 pw_enc: DB 247, 254, 26, 128, 54, 81, 56, 144, 160, 52, 17, 109, 48, 94, 82, 84 ; Encrypted AAAAs (for testing) ;DB 61, 145, 88, 74, 207, 26, 238, 227, 115, 141, 211, 145, 202, 35, 41, 176 aes_key: ;random bytes + 55aa DB 109, 121, 128, 185, 165, 10, 151, 36, 13, 45, 252, 54, 13, 149 DB 0x55, 0xAA password:
1-base/math/source/generic/pure/geometry/trigonometry/any_math-any_fast_trigonometry.ads
charlie5/lace
20
6676
with cached_Trigonometry; generic package any_math.any_fast_Trigonometry is package Default is new cached_Trigonometry (Float_type => any_Math.Real, slot_Count => 10_000); end any_math.any_fast_Trigonometry;
programs/oeis/100/A100886.asm
jmorken/loda
1
163724
<gh_stars>1-10 ; A100886: Expansion of x*(1+3*x+2*x^2)/((1+x+x^2)*(1-x-x^2)). ; 0,1,3,3,5,10,14,23,39,61,99,162,260,421,683,1103,1785,2890,4674,7563,12239,19801,32039,51842,83880,135721,219603,355323,574925,930250,1505174,2435423,3940599,6376021,10316619,16692642,27009260,43701901,70711163,114413063,185124225,299537290,484661514,784198803,1268860319,2053059121,3321919439,5374978562,8696898000,14071876561,22768774563,36840651123,59609425685,96450076810,156059502494,252509579303,408569081799,661078661101,1069647742899,1730726404002,2800374146900,4531100550901,7331474697803,11862575248703,19194049946505,31056625195210,50250675141714,81307300336923,131557975478639,212865275815561,344423251294199,557288527109762,901711778403960,1459000305513721,2360712083917683,3819712389431403,6180424473349085 mov $4,2 mov $6,$0 lpb $4 mov $0,$6 sub $4,1 add $0,$4 sub $0,1 mov $3,$0 mov $8,2 lpb $8 mov $0,$3 sub $8,1 add $0,$8 sub $0,2 cal $0,33811 ; Convolution of natural numbers n >= 1 with Lucas numbers L(k)(A000032) for k >= 2. mov $5,$0 div $5,2 mov $7,$8 lpb $7 sub $7,1 mov $9,$5 lpe lpe lpb $3 mov $3,0 sub $9,$5 lpe mov $2,$4 mov $5,$9 lpb $2 mov $1,$5 sub $2,1 lpe lpe lpb $6 sub $1,$5 mov $6,0 lpe
Task/Shell-one-liner/Ada/shell-one-liner.ada
LaudateCorpus1/RosettaCodeData
1
6219
echo 'with Ada.text_IO; use Ada.text_IO; procedure X is begin Put("Hello!"); end X;' > x.adb; gnatmake x; ./x; rm x.adb x.ali x.o x
src/connections/adabase-connection-base-mysql.ads
jrmarino/AdaBase
30
16435
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../../License.txt with AdaBase.Interfaces.Connection; with AdaBase.Bindings.MySQL; with Ada.Exceptions; package AdaBase.Connection.Base.MySQL is package AIC renames AdaBase.Interfaces.Connection; package ABM renames AdaBase.Bindings.MySQL; package EX renames Ada.Exceptions; type MySQL_Connection is new Base_Connection and AIC.iConnection with private; type MySQL_Connection_Access is access all MySQL_Connection; type fldlen is array (Positive range <>) of Natural; type fetch_status is (success, truncated, spent, error); overriding procedure setAutoCommit (conn : out MySQL_Connection; auto : Boolean); overriding procedure setCompressed (conn : out MySQL_Connection; compressed : Boolean); overriding function compressed (conn : MySQL_Connection) return Boolean; overriding procedure setUseBuffer (conn : out MySQL_Connection; buffered : Boolean); overriding function useBuffer (conn : MySQL_Connection) return Boolean; overriding procedure setMultiQuery (conn : out MySQL_Connection; multiple : Boolean); overriding function multiquery (conn : MySQL_Connection) return Boolean; overriding procedure setTransactionIsolation (conn : out MySQL_Connection; isolation : Trax_Isolation); overriding function description (conn : MySQL_Connection) return String; overriding function SqlState (conn : MySQL_Connection) return SQL_State; overriding function driverMessage (conn : MySQL_Connection) return String; overriding function driverCode (conn : MySQL_Connection) return Driver_Codes; overriding function lastInsertID (conn : MySQL_Connection) return Trax_ID; overriding procedure commit (conn : out MySQL_Connection); overriding procedure rollback (conn : out MySQL_Connection); overriding procedure disconnect (conn : out MySQL_Connection); overriding procedure execute (conn : out MySQL_Connection; sql : String); overriding procedure connect (conn : out MySQL_Connection; database : String; username : String := blankstring; password : String := blankstring; hostname : String := blankstring; socket : String := blankstring; port : Posix_Port := portless); overriding procedure set_character_set (conn : out MySQL_Connection; charset : String); overriding function character_set (conn : out MySQL_Connection) return String; overriding function rows_affected_by_execution (conn : MySQL_Connection) return Affected_Rows; procedure use_result (conn : MySQL_Connection; result_handle : out ABM.MYSQL_RES_Access); procedure free_result (conn : MySQL_Connection; result_handle : out ABM.MYSQL_RES_Access); procedure store_result (conn : MySQL_Connection; result_handle : out ABM.MYSQL_RES_Access); function field_count (conn : MySQL_Connection) return Natural; function fields_in_result (conn : MySQL_Connection; result_handle : ABM.MYSQL_RES_Access) return Natural; function rows_in_result (conn : MySQL_Connection; result_handle : ABM.MYSQL_RES_Access) return Affected_Rows; function fetch_field (conn : MySQL_Connection; result_handle : ABM.MYSQL_RES_Access) return ABM.MYSQL_FIELD_Access; function fetch_row (conn : MySQL_Connection; result_handle : ABM.MYSQL_RES_Access) return ABM.MYSQL_ROW_access; function fetch_next_set (conn : MySQL_Connection) return Boolean; function fetch_lengths (conn : MySQL_Connection; result_handle : ABM.MYSQL_RES_Access; num_columns : Positive) return fldlen; function field_name_field (conn : MySQL_Connection; field : ABM.MYSQL_FIELD_Access) return String; function field_name_table (conn : MySQL_Connection; field : ABM.MYSQL_FIELD_Access) return String; function field_name_database (conn : MySQL_Connection; field : ABM.MYSQL_FIELD_Access) return String; procedure field_data_type (conn : MySQL_Connection; field : ABM.MYSQL_FIELD_Access; std_type : out field_types; size : out Natural); function field_allows_null (conn : MySQL_Connection; field : ABM.MYSQL_FIELD_Access) return Boolean; ----------------------------------------------------------------------- -- PREPARED STATEMENT FUNCTIONS -- ----------------------------------------------------------------------- function prep_LastInsertID (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access) return Trax_ID; function prep_SqlState (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access) return SQL_State; function prep_DriverCode (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access) return Driver_Codes; function prep_DriverMessage (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access) return String; procedure prep_free_result (conn : MySQL_Connection; stmt : out ABM.MYSQL_STMT_Access); procedure prep_store_result (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access); procedure initialize_and_prepare_statement (conn : MySQL_Connection; stmt : out ABM.MYSQL_STMT_Access; sql : String); function prep_markers_found (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access) return Natural; function prep_result_metadata (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access) return ABM.MYSQL_RES_Access; function prep_bind_parameters (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access; bind : out ABM.MYSQL_BIND_Array) return Boolean; function prep_bind_result (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access; bind : out ABM.MYSQL_BIND_Array) return Boolean; function prep_execute (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access) return Boolean; function prep_rows_in_result (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access) return Affected_Rows; function prep_fetch_bound (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access) return fetch_status; function prep_close_statement (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access) return Boolean; function prep_rows_affected_by_execution (conn : MySQL_Connection; stmt : ABM.MYSQL_STMT_Access) return Affected_Rows; NOT_WHILE_CONNECTED : exception; AUTOCOMMIT_FAIL : exception; COMMIT_FAIL : exception; ROLLBACK_FAIL : exception; QUERY_FAIL : exception; CONNECT_FAIL : exception; TRAXISOL_FAIL : exception; CHARSET_FAIL : exception; INITIALIZE_FAIL : exception; STMT_NOT_VALID : exception; RESULT_FAIL : exception; BINDING_FAIL : exception; SET_OPTION_FAIL : exception; private type MySQL_Connection is new Base_Connection and AIC.iConnection with record prop_compressed : Boolean := True; prop_buffered : Boolean := True; prop_multiquery : Boolean := False; info_description : String (1 .. 24) := "MySQL 5.5+ native driver"; handle : ABM.MYSQL_Access := null; end record; function convert_version (mysql_version : Natural) return CT.Text; function S2P (S : CT.Text) return ABM.ICS.chars_ptr; function S2P (S : String) return ABM.ICS.chars_ptr; procedure establish_uniform_encoding (conn : out MySQL_Connection); procedure retrieve_uniform_encoding (conn : out MySQL_Connection); overriding procedure finalize (conn : in out MySQL_Connection); end AdaBase.Connection.Base.MySQL;
2 Year/2015 Pattern/MPL/Assignment 7.asm
bhushanasati25/College
4
22111
<filename>2 Year/2015 Pattern/MPL/Assignment 7.asm ;Write X86 program to sort the list of integers in ;ascending/descending order. ;Read the input from the text file and write the sorted data back ;to the same text file using bubble sort section .data fname db 'a.txt',0 msg1 db 'File opened Sucessfully',0xa len1 equ $-msg1 msg2 db 'Error in opening File ',0xa len2 equ $-msg2 msg3 db 'Sorted array is:',0xa len3 equ $-msg3 section .bss fd_in resb 8 buffer resb 200 buff_len resb 8 count1 resb 8 count2 resb 8 section .text global _start _start: xor rax,rax xor rbx,rbx xor rcx,rcx mov rax,2 mov rdi,fname mov rsi,2 mov rdx,0777 syscall mov qword[fd_in],rax bt rax,63 jc next mov rax,1 mov rdi,1 mov rsi,msg1 mov rdx,len1 syscall jmp next2 next: mov rax,1 mov rdi,1 mov rsi,msg2 mov rdx,len2 syscall next2: mov rax,0 mov rdi,[fd_in] mov rsi,buffer mov rdx,200 syscall mov qword[buff_len],rax mov qword[buff_len],rax ;for rounds mov qword[count1],rax mov qword[count2],rax bubble: mov al,byte[count2] mov byte[count1],al dec byte[count1] mov rsi,buffer mov rdi,buffer+1 loop: mov bl,byte[rsi] mov cl,byte[rdi] cmp bl,cl ja swap inc rsi inc rdi dec byte[count1] jnz loop dec byte[buff_len] jnz bubble jmp end swap: mov byte[rsi],cl mov byte[rdi],bl inc rsi inc rdi dec byte[count1] jnz loop dec byte[buff_len] jnz bubble end: mov rax,1 mov rdi,1 mov rsi,msg3 mov rdx,len3 syscall mov rax,1 mov rdi,1 mov rsi,buffer mov rdx,qword[count2] syscall mov rax,1 mov rdi,qword[fd_in] mov rsi,msg3 mov rdx,len3 syscall mov rax,1 mov rdi,qword[fd_in] mov rsi,buffer mov rdx,qword[count2] syscall mov rax,3 mov rdi,fname syscall mov rax,60 mov rdi,0 syscall
My Codes/Lab_1/Lab1.asm
jahinmahbub/CSE331L_Section_7_Summer_2020_NSU
0
9174
; You may customize this and other start-up templates; ; The location of this template is c:\emu8086\inc\0_com_template.txt org 100h ; #include<stdio.h> ;Variable declaration ;A DB 10; int a = 10 Data Type: Define Byte (8 bits of space) ;B DW 15; int b = 15 Data Type: Define word (16 Bits of space) ;K EQU 10; Constant ;arrays ;a DB 10,15,10,11,12 ;b DB 10h,15h,10h,11h,12h ; Hex Values ; a b are basically int a[10] = {10,11,12} ;c DB 10 DUP(?) ;d DB 5 DUP(1,2) ;1,2,1,2 ;ARR1 DB DUP(5,10,12) ;MOV BX, offset ARR1 ;MOV [BX],6 ;MOV [BX+1],10 MOV BX,10 ;INC BX; DOING i++ in C Basically. DEC BX;DOING i-- in C Basically. MOV BX, 35H MOV DI, 12H LEA SI, [BX+DI] ret ;return 0
oeis/099/A099072.asm
neoneye/loda-programs
11
246880
; A099072: First differences of A000960, divided by 2. ; Submitted by <NAME> ; 1,2,3,3,4,6,5,7,8,6,9,12,7,17,13,8,15,18,9,21,19,6,30,11,24,19,23,18,30,27,22,18,42,11,30,42,9,39,36,30,19,56,6,48,57,13,44,46,17,45,69,13,41,49,56,27,85,18,30,84,26,64,26,64,47,54,45,94,17,36,85,60,23,79,98 mov $2,$0 mov $4,2 lpb $4 mov $0,$2 sub $4,1 add $0,$4 trn $0,1 add $0,1 seq $0,960 ; Flavius Josephus's sieve: Start with the natural numbers; at the k-th sieving step, remove every (k+1)-st term of the sequence remaining after the (k-1)-st sieving step; iterate. div $0,2 mov $5,$4 mul $5,$0 add $3,$5 lpe min $2,1 mul $2,$0 mov $0,$3 sub $0,$2
testsuite/ubic/output/ncurses_4.asm
alexgarzao/UOP
0
90971
<reponame>alexgarzao/UOP .constant_pool .const 0 string [start] .const 1 string [constructor] .const 2 string [main_win] .const 3 string [perfil_win] .const 4 string [ncurses.initscr] .const 5 string [ncurses.refresh] .const 6 int [17] .const 7 int [80] .const 8 int [0] .const 9 string [ncurses.newwin] .const 10 string [ncurses.box] .const 11 int [1] .const 12 int [5] .const 13 string [Nome: ] .const 14 int [4] .const 15 string [ncurses.mvwwrite] .const 16 int [2] .const 17 string [Interesse geral: ] .const 18 int [3] .const 19 string [Interesse especifico] .const 20 string [Localização: ] .const 21 string [ncurses.wrefresh] .const 22 string [ncurses.getch] .const 23 string [ncurses.endwin] .end .entity start .valid_context_when (always) .method constructor .var 0 int main_win .var 1 int perfil_win lcall 4 --> [ncurses.initscr] lcall 5 --> [ncurses.refresh] ldconst 6 --> [17] ldconst 7 --> [80] ldconst 8 --> [0] ldconst 8 --> [0] lcall 9 --> [ncurses.newwin] stvar 1 --> [perfil_win] ldvar 1 --> [perfil_win] ldconst 8 --> [0] ldconst 8 --> [0] lcall 10 --> [ncurses.box] ldvar 1 --> [perfil_win] ldconst 11 --> [1] ldconst 12 --> [5] ldconst 13 --> [Nome: ] ldconst 14 --> [4] lcall 15 --> [ncurses.mvwwrite] ldvar 1 --> [perfil_win] ldconst 16 --> [2] ldconst 12 --> [5] ldconst 17 --> [Interesse geral: ] ldconst 14 --> [4] lcall 15 --> [ncurses.mvwwrite] ldvar 1 --> [perfil_win] ldconst 18 --> [3] ldconst 12 --> [5] ldconst 19 --> [Interesse especifico] ldconst 14 --> [4] lcall 15 --> [ncurses.mvwwrite] ldvar 1 --> [perfil_win] ldconst 14 --> [4] ldconst 12 --> [5] ldconst 20 --> [Localização: ] ldconst 14 --> [4] lcall 15 --> [ncurses.mvwwrite] ldvar 1 --> [perfil_win] lcall 21 --> [ncurses.wrefresh] lcall 5 --> [ncurses.refresh] lcall 22 --> [ncurses.getch] lcall 23 --> [ncurses.endwin] exit .end .end
benchmark/benchmark_graph_1.adb
skill-lang/skillAdaTestSuite
1
12598
with Ada.Numerics.Discrete_Random; with Ada.Text_IO; with Ada.Unchecked_Deallocation; with Hashing; with Graph_1.Api; package body Benchmark_Graph_1 is package Skill renames Graph_1.Api; use Graph_1; use Skill; type State_Type is access Skill_State; State : State_Type; procedure Create (N : Integer; File_Name : String) is function Hash is new Hashing.Discrete_Hash (Integer); type Objects_Type is array (0 .. N-1) of Node_Type_Access; type Objects_Type_Access is access Objects_Type; Objects : Objects_Type_Access := new Objects_Type; procedure Free is new Ada.Unchecked_Deallocation (Objects_Type, Objects_Type_Access); begin State := new Skill_State; Skill.Create (State); for I in 0 .. N-1 loop Objects (I) := New_Node (State, null, null, null, null); end loop; for I in 0 .. N-1 loop declare X : Node_Type_Access := Objects (I); A : Integer := Integer (Hash (N + I, 13371)) mod N; B : Integer := Integer (Hash (N + I, 13372)) mod N; C : Integer := Integer (Hash (N + I, 13373)) mod N; D : Integer := Integer (Hash (N + I, 13374)) mod N; begin -- Ada.Text_IO.Put_Line (A'Img & B'Img & C'Img & D'Img); X.Set_North (Objects (A)); X.Set_East (Objects (B)); X.Set_South (Objects (C)); X.Set_West (Objects (D)); end; end loop; Free (Objects); end Create; procedure Write (N : Integer; File_Name : String) is begin Skill.Write (State, File_Name); end Write; procedure Read (N : Integer; File_Name : String) is begin State := new Skill_State; Skill.Read (State, File_Name); end Read; procedure Create_More (N : Integer; File_Name : String) is function Hash is new Hashing.Discrete_Hash (Integer); type Objects_Type is array (0 .. N-1) of Node_Type_Access; type Objects_Type_Access is access Objects_Type; Objects : Objects_Type_Access := new Objects_Type; procedure Free is new Ada.Unchecked_Deallocation (Objects_Type, Objects_Type_Access); begin for I in 0 .. N-1 loop Objects (I) := New_Node (State, null, null, null, null); end loop; for I in 0 .. N-1 loop declare X : Node_Type_Access := Objects (I); A : Integer := Integer (Hash (N + I, 13375)) mod N; B : Integer := Integer (Hash (N + I, 13376)) mod N; C : Integer := Integer (Hash (N + I, 13377)) mod N; D : Integer := Integer (Hash (N + I, 13378)) mod N; begin -- Ada.Text_IO.Put_Line (A'Img & B'Img & C'Img & D'Img); X.Set_North (Objects (A)); X.Set_East (Objects (B)); X.Set_South (Objects (C)); X.Set_West (Objects (D)); end; end loop; Free (Objects); end Create_More; procedure Append (N : Integer; File_Name : String) is begin Skill.Append (State); end Append; procedure Reset (N : Integer; File_Name : String) is procedure Free is new Ada.Unchecked_Deallocation (Skill_State, State_Type); begin Skill.Close (State); Free (State); end Reset; end Benchmark_Graph_1;
Patches/Multiplayer_Hack/ASM/menu_music.asm
abitalive/SuperSmashBros
4
100814
// Menu music constant SramTrackMenu(0x7F00) // Menu track variable SRAM location constant TrackMenu(0x80500002) // Menu track variable location origin 0x050038 base 0x800D4658 jal MenuMusicRead origin 0x0500A8 base 0x800D46C8 jal MenuMusicInit // Boot origin 0x11DAAC base 0x80132B1C jal MenuMusic // Back from 1P/training/bonus practice css origin 0x11F118 base 0x80133008 jal MenuMusic // Back from screen adjust origin 0x120D58 base 0x801335A8 jal MenuMusic // Back from sound test origin 0x1222F8 base 0x80132EA8 jal MenuMusic // Back from versus css origin 0x1250F0 base 0x80134740 jal MenuMusic // Versus css origin 0x139578 base 0x8013B2F8 jal MenuMusic // 1P css origin 0x140734 base 0x80138534 jal MenuMusic // Training css origin 0x1474B4 base 0x80137ED4 jal MenuMusic // Bonus practice css origin 0x14CF08 base 0x80136ED8 jal MenuMusic // Versus record origin 0x15D4F8 base 0x801365B8 jal MenuMusic // Characters origin 0x160084 base 0x80134034 jal MenuMusic // Characters origin 0x121E40 base 0x801329F0 jal MenuMusicChange // Versus record origin 0x121E98 base 0x80132A48 jal MenuMusicChange // Screen adjust origin 0x12FC20 base 0x801327C0 jal MenuMusicChange // Back from 1P css origin 0x13EEDC base 0x80136CDC jal MenuMusicChange // Back from versus css origin 0x1363A0 base 0x80138120 jal MenuMusicChange // Back from bonus practice css origin 0x14B7B4 base 0x80135784 jal MenuMusicChange // Back from training css origin 0x144DD0 base 0x801357F0 jal MenuMusicChange // Back from sound test origin 0x188644 base 0x80132274 jal MenuMusicChange origin 0x188548 base 0x80132178 jal MenuMusicSave pullvar pc, origin scope MenuMusicRead: { addiu sp, -0x18 sw ra, 0x14 (sp) jal SramRead // Original instruction nop lli a0, SramTrackMenu // SRAM source addiu a1, sp, 0x10 // RAM destination jal SramRead lli a2, 0x01 // Size lbu t0, 0x10 (sp) lua(t1, TrackMenu) sb t0, TrackMenu (t1) End: lw ra, 0x14 (sp) jr ra addiu sp, 0x18 } scope MenuMusicInit: { addiu sp, -0x18 sw ra, 0x14 (sp) jal 0x800D45F4 // Original instruction nop lua(t0, TrackMenu) lli t1, 0x2C sb t1, TrackMenu (t0) sb t1, 0x10 (sp) addiu a0, sp, 0x10 // RAM source lli a1, SramTrackMenu // SRAM destination jal SramWrite // SRAM Write lli a2, 0x01 // Size End: lw ra, 0x14 (sp) jr ra addiu sp, 0x18 } scope MenuMusic: { addiu sp, -0x18 sw ra, 0x14 (sp) lua(t0, TrackMenu) lbu t0, TrackMenu (t0) // Saved track lli t1, 0x2C beq t0, t1, Original // If saved track == 0x2C (menu); use original track nop lua(t1, ScreenPrevious) lbu t1, ScreenPrevious (t1) // Last screen lli t2, 0x01 beq t1, t2, SavedTrack // Else if last screen == title screen; use saved track lli t2, 0x16 beq t1, t2, SavedTrack // Or last screen == versus; use saved track lli t2, 0x18 beq t1, t2, SavedTrack // Or last screen == results screen; use saved track lli t2, 0x1B beq t1, t2, SavedTrack // Or last screen == boot; use saved track lli t2, 0x34 beq t1, t2, SavedTrack // Or last screen == 1p game; use saved track lli t2, 0x35 beq t1, t2, SavedTrack // Or last screen == bonus practice; use saved track lli t2, 0x36 beq t1, t2, SavedTrack // Or last screen == training; use saved track nop la t1, 0x80132EB0 bne ra, t1, End // If ra != 0x80132EB0 (back from sound test) nop lui t1, 0x800A lw t1, 0xD974 (t1) // Pointer to current track lw t1, 0 (t1) // Current track li t2, 0xFFFFFFFF beq t1, t2, SavedTrack // And current track == 0xFFFFFFFF nop b End nop SavedTrack: move a1, t0 // Use saved track Original: jal 0x80020AB4 // Original instructions or a0, r0, r0 End: lw ra, 0x14 (sp) jr ra addiu sp, 0x18 } scope MenuMusicChange: { addiu sp, -0x18 sw ra, 0x14 (sp) SavedTrack: lua(t0, TrackMenu) lbu t0, TrackMenu (t0) // Saved track lli t1, 0x2C beq t0, t1, Original // If saved track == 0x2C (menu); original instruction nop NoTrack: la t0, 0x8013227C bne ra, t0, End // If ra != 0x8013227C (back from sound test) nop lui t0, 0x800A lw t0, 0xD974 (t0) // Pointer to current track lw t0, 0 (t0) // Current track li t1, 0xFFFFFFFF bne t0, t1, End // And current track == 0xFFFFFFFF nop Original: jal 0x80020A74 // Original instruction nop End: lw ra, 0x14 (sp) jr ra addiu sp, 0x18 } scope MenuMusicSave: { addiu sp, -0x18 sw ra, 0x14 (sp) lua(t0, TrackMenu) sb a1, TrackMenu (t0) // Save a1 addiu a0, sp, 0x10 // RAM source sb a1, 0 (a0) lli a1, SramTrackMenu // SRAM destination jal SramWrite // SRAM Write lli a2, 0x01 // Size lua(t0, TrackMenu) lbu a1, TrackMenu (t0) // Restore a1 jal 0x80020AB4 // Original instructions or a0, r0, r0 End: lw ra, 0x14 (sp) jr ra addiu sp, 0x18 } pushvar origin, pc
examples/receive/receive_example.adb
SALLYPEMDAS/DW1000
9
26119
------------------------------------------------------------------------------- -- Copyright (c) 2016 <NAME> -- -- Permission is hereby granted, free of charge, to any person obtaining a -- copy of this software and associated documentation files (the "Software"), -- to deal in the Software without restriction, including without limitation -- the rights to use, copy, modify, merge, publish, distribute, sublicense, -- and/or sell copies of the Software, and to permit persons to whom the -- Software is furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- with Ada.Real_Time; use Ada.Real_Time; with DecaDriver; with DW1000.BSP; with DW1000.Driver; use DW1000.Driver; with DW1000.Types; -- This simple example demonstrates using the DW1000 to receive packets. procedure Receive_Example with SPARK_Mode, Global => (Input => Ada.Real_Time.Clock_Time, In_Out => (DW1000.BSP.Device_State, DecaDriver.Driver)), Depends => (DecaDriver.Driver =>+ DW1000.BSP.Device_State, DW1000.BSP.Device_State =>+ DecaDriver.Driver, null => Ada.Real_Time.Clock_Time) is Rx_Packet : DW1000.Types.Byte_Array (1 .. 127) := (others => 0); Rx_Packet_Length : DecaDriver.Frame_Length_Number; Rx_Frame_Info : DecaDriver.Frame_Info_Type; Rx_Status : DecaDriver.Rx_Status_Type; Rx_Overrun : Boolean; begin -- Driver must be initialized once before it is used. DecaDriver.Driver.Initialize (Load_Antenna_Delay => True, Load_XTAL_Trim => True, Load_UCode_From_ROM => True); -- Configure the DW1000 DecaDriver.Driver.Configure (DecaDriver.Configuration_Type' (Channel => 1, PRF => PRF_64MHz, Tx_Preamble_Length => PLEN_1024, Rx_PAC => PAC_8, Tx_Preamble_Code => 9, Rx_Preamble_Code => 9, Use_Nonstandard_SFD => False, Data_Rate => Data_Rate_110k, PHR_Mode => Standard_Frames, SFD_Timeout => 1024 + 64 + 1)); -- We don't need to configure the transmit power in this example, because -- we don't transmit any frames! -- Enable the LEDs controlled by the DW1000. DW1000.Driver.Configure_LEDs (Tx_LED_Enable => True, -- Enable transmit LED Rx_LED_Enable => True, -- Enable receive LED Rx_OK_LED_Enable => False, SFD_LED_Enable => False, Test_Flash => True); -- Flash both LEDs once -- In this example we only want to receive valid packets without errors, -- so configure the DW1000 to automatically re-enable the receiver when -- errors occur. The driver will not be notified of receiver errors whilst -- this is enabled. DW1000.Driver.Set_Auto_Rx_Reenable (Enable => True); -- Continuously receive packets loop -- Enable the receiver to listen for a packet DecaDriver.Driver.Start_Rx_Immediate; -- Wait for a packet DecaDriver.Driver.Rx_Wait (Frame => Rx_Packet, Length => Rx_Packet_Length, Frame_Info => Rx_Frame_Info, Status => Rx_Status, Overrun => Rx_Overrun); -- When execution has reached here then a packet has been received -- successfully. end loop; end Receive_Example;
alloy4fun_models/trainstlt/models/4/DMdMBNFmH3ggB8RNB.als
Kaixi26/org.alloytools.alloy
0
717
open main pred idDMdMBNFmH3ggB8RNB_prop5 { all t : Train | some (t.pos & Exit) implies Train' = (Train - t) else( t.pos' in t.pos.prox) } pred __repair { idDMdMBNFmH3ggB8RNB_prop5 } check __repair { idDMdMBNFmH3ggB8RNB_prop5 <=> prop5o }
src/sdl-events-touches.ads
Fabien-Chouteau/sdlada
1
13682
<filename>src/sdl-events-touches.ads -------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2020, <NAME> -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- -- 3. This notice may not be removed or altered from any source -- distribution. -------------------------------------------------------------------------------------------------------------------- -- SDL.Events.Touches -- -- WARNING!! A lot of the data bindings in this specification is guess-work, especially the ranges for things. There -- also an inconsistency in the usage of Fingers_Touching within SDL itself. -- -- See: -- https://bugzilla.libsdl.org/show_bug.cgi?id=3060 -- http://lists.libsdl.org/pipermail/sdl-libsdl.org/2015-July/098468.html -------------------------------------------------------------------------------------------------------------------- with Interfaces.C; package SDL.Events.Touches is -- Touch events. Finger_Down : constant Event_Types := 16#0000_0700#; Finger_Up : constant Event_Types := Finger_Down + 1; Finger_Motion : constant Event_Types := Finger_Down + 2; -- Gesture events. Dollar_Gesture : constant Event_Types := 16#0000_0800#; Dollar_Record : constant Event_Types := Dollar_Gesture + 1; Dollar_Multi_Gesture : constant Event_Types := Dollar_Gesture + 2; -- TODO: Find out if these really should be signed or not, the C version uses Sint64 for both. type Touch_IDs is range -1 .. 2 ** 63 - 1 with Convention => C, Size => 64; type Finger_IDs is range 0 .. 2 ** 63 - 1 with Convention => C, Size => 64; type Gesture_IDs is range 0 .. 2 ** 63 - 1 with Convention => C, Size => 64; type Touch_Locations is digits 3 range 0.0 .. 1.0 with Convention => C, Size => 32; type Touch_Distances is digits 3 range -1.0 .. 1.0 with Convention => C, Size => 32; type Touch_Pressures is digits 3 range 0.0 .. 1.0 with Convention => C, Size => 32; type Finger_Events is record Event_Type : Event_Types; -- Will be set to Finger_Down, Finger_Up or Finger_Motion. Time_Stamp : Time_Stamps; Touch_ID : Touch_IDs; Finger_ID : Finger_IDs; X : Touch_Locations; Y : Touch_Locations; Delta_X : Touch_Distances; Delta_Y : Touch_Distances; Pressure : Touch_Pressures; end record with Convention => C; type Finger_Rotations is digits 3 range -360.0 .. 360.0 with Convention => C, Size => 32; subtype Finger_Pinches is Interfaces.C.C_float; type Fingers_Touching is range 0 .. 2 ** 16 - 1 with Convention => C, Size => 16; type Multi_Gesture_Events is record Event_Type : Event_Types; -- Will be set to Dollar_Multi_Gesture. Time_Stamp : Time_Stamps; Touch_ID : Touch_IDs; Theta : Finger_Rotations; Distance : Finger_Pinches; Centre_X : Touch_Locations; Centre_Y : Touch_Locations; Fingers : Fingers_Touching; Padding : Padding_16; end record with Convention => C; subtype Dollar_Errors is Interfaces.C.C_float; type Dollar_Events is record Event_Type : Event_Types; -- Will be set to Dollar_Gesture or Dollar_Record. Time_Stamp : Time_Stamps; Touch_ID : Touch_IDs; Gesture_ID : Gesture_IDs; Fingers : Fingers_Touching; Error : Dollar_Errors; Centre_X : Touch_Locations; Centre_Y : Touch_Locations; end record with Convention => C; private for Finger_Events use record Event_Type at 0 * SDL.Word range 0 .. 31; Time_Stamp at 1 * SDL.Word range 0 .. 31; Touch_ID at 2 * SDL.Word range 0 .. 63; Finger_ID at 4 * SDL.Word range 0 .. 63; X at 6 * SDL.Word range 0 .. 31; Y at 7 * SDL.Word range 0 .. 31; Delta_X at 8 * SDL.Word range 0 .. 31; Delta_Y at 9 * SDL.Word range 0 .. 31; Pressure at 10 * SDL.Word range 0 .. 31; end record; for Multi_Gesture_Events use record Event_Type at 0 * SDL.Word range 0 .. 31; Time_Stamp at 1 * SDL.Word range 0 .. 31; Touch_ID at 2 * SDL.Word range 0 .. 63; Theta at 4 * SDL.Word range 0 .. 31; Distance at 5 * SDL.Word range 0 .. 31; Centre_X at 6 * SDL.Word range 0 .. 31; Centre_Y at 7 * SDL.Word range 0 .. 31; Fingers at 8 * SDL.Word range 0 .. 15; Padding at 8 * SDL.Word range 16 .. 31; end record; for Dollar_Events use record Event_Type at 0 * SDL.Word range 0 .. 31; Time_Stamp at 1 * SDL.Word range 0 .. 31; Touch_ID at 2 * SDL.Word range 0 .. 63; Gesture_ID at 4 * SDL.Word range 0 .. 63; Fingers at 6 * SDL.Word range 0 .. 31; -- Inconsistent, type is 16 bits, but SDL uses 32 here. Error at 7 * SDL.Word range 0 .. 31; Centre_X at 8 * SDL.Word range 0 .. 31; Centre_Y at 9 * SDL.Word range 0 .. 31; end record; end SDL.Events.Touches;
programs/oeis/130/A130974.asm
neoneye/loda
22
25491
; A130974: Period 6: repeat [1, 1, 1, 3, 3, 3]. ; 1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3,3,3,1,1,1,3 div $0,3 mov $1,3 pow $1,$0 mod $1,8 mov $0,$1
programs/oeis/184/A184624.asm
karttu/loda
0
176397
<reponame>karttu/loda ; A184624: a(n) = floor(n*r +h), where r=sqrt(2), h=-1/4; complement of A184619. ; 1,2,3,5,6,8,9,11,12,13,15,16,18,19,20,22,23,25,26,28,29,30,32,33,35,36,37,39,40,42,43,45,46,47,49,50,52,53,54,56,57,59,60,61,63,64,66,67,69,70,71,73,74,76,77,78,80,81,83,84,86,87,88,90,91,93,94,95,97,98,100,101,102,104,105,107,108,110,111,112,114,115,117,118,119,121,122,124,125,127,128,129,131,132,134,135,136,138,139,141,142,143,145,146,148,149,151,152,153,155,156,158,159,160,162,163,165,166,168,169,170,172,173,175,176,177,179,180,182,183,185,186,187,189,190,192,193,194,196,197,199,200,201,203,204,206,207,209,210,211,213,214,216,217,218,220,221,223,224,226,227,228,230,231,233,234,235,237,238,240,241,242,244,245,247,248,250,251,252,254,255,257,258,259,261,262,264,265,267,268,269,271,272,274,275,276,278,279,281,282,284,285,286,288,289,291,292,293,295,296,298,299,300,302,303,305,306,308,309,310,312,313,315,316,317,319,320,322,323,325,326,327,329,330,332,333,334,336,337,339,340,341,343,344,346,347,349,350,351,353 mov $2,$0 add $2,2 add $0,$2 pow $0,2 mov $1,2 lpb $0,1 sub $0,$1 trn $0,1 add $1,4 lpe sub $1,10 div $1,4 add $1,1
src/antlr/FasmLexer.g4
common-config-bot/fasm
6
7024
// Copyright 2017-2022 F4PGA Authors // // 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. // // SPDX-License-Identifier: Apache-2.0 lexer grammar FasmLexer; // White space S : [ \t] -> skip ; // Skip all outer white space NEWLINE : [\n\r] ; // NEWLINE is not skipped, because it is needed to break lines. // Matches a feature identifier fragment IDENTIFIER : [a-zA-Z] [0-9a-zA-Z_]* ; FEATURE : IDENTIFIER ('.' IDENTIFIER)* ; // Number values // The leading '[hbdo] is kept in the same token to // disambiguate the grammar. HEXADECIMAL_VALUE : '\'h' [ \t]* [0-9a-fA-F_]+ ; BINARY_VALUE : '\'b' [ \t]* [01_]+ ; DECIMAL_VALUE : '\'d' [ \t]* [0-9_]+ ; OCTAL_VALUE : '\'o' [ \t]* [0-7_]+ ; INT : [0-9]+ ; // Everything after a # until a newline. COMMENT_CAP : '#' (~[\n\r])* ; // Simple tokens // These are not referenced in the parser by name, // but instead by the character they match. // They need to be here so the lexer will tokenize them. // This is needed because otherwise an IDENTIFIER with // a leading dot, or no dot, could also be an ANNOTATION_NAME. EQUAL : '=' ; OPEN_BRACKET : '[' ; COLON : ':' ; CLOSE_BRACKET : ']' ; // An opening curly bracket enters ANNOTATION_MODE BEGIN_ANNOTATION : '{' -> pushMode(ANNOTATION_MODE) ; // https://github.com/antlr/antlr4/issues/1226#issuecomment-230382658 // Any character which does not match one of the above rules will appear in the token stream as // an ErrorCharacter token. This ensures the lexer itself will never encounter a syntax error, // so all error handling may be performed by the parser. ErrorCharacter : . ; // Inside an annotation, only the rules below apply. // That is why there is some duplication. mode ANNOTATION_MODE; // White space is skipped. ANNOTATION_S : [ \t] -> skip ; ANNOTATION_NAME : [.a-zA-Z] [0-9a-zA-Z_]* ; fragment NON_ESCAPE_CHARACTERS : ~[\\"] ; fragment ESCAPE_SEQUENCES : [\\] [\\"] ; ANNOTATION_VALUE : '"' (NON_ESCAPE_CHARACTERS | ESCAPE_SEQUENCES)* '"' ; // Simple tokens. ANNOTATION_EQUAL : '=' ; ANNOTATION_COMMA : ',' ; // A closing curly bracket pops out of ANNOTATION_MODE END_ANNOTATION : '}' -> popMode ;
programs/oeis/084/A084104.asm
jmorken/loda
1
84766
; A084104: A period 6 sequence. ; 1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7,7,4,1,1,4,7 mod $0,6 lpb $0 mul $0,4 mod $0,5 lpe mov $1,$0 mul $1,3 add $1,1
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xa0.log_21829_1313.asm
ljhsiun2/medusa
9
19758
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r14 push %rbp push %rcx push %rdi push %rsi lea addresses_WC_ht+0x1b645, %rsi lea addresses_WC_ht+0x7495, %rdi nop nop add $33879, %rbp mov $71, %rcx rep movsw nop nop nop nop nop add $60903, %r14 pop %rsi pop %rdi pop %rcx pop %rbp pop %r14 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %rax push %rbp push %rcx push %rsi // Store lea addresses_PSE+0x1143d, %r10 nop nop nop and %rcx, %rcx mov $0x5152535455565758, %rbp movq %rbp, (%r10) nop nop sub %r10, %r10 // Faulty Load lea addresses_US+0x1295, %rsi nop nop and %r13, %r13 mov (%rsi), %ecx lea oracles, %r13 and $0xff, %rcx shlq $12, %rcx mov (%r13,%rcx,1), %rcx pop %rsi pop %rcx pop %rbp pop %rax pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 8}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': True, 'congruent': 4, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_WC_ht'}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
smsq/qpc/ip/io.asm
olifink/smsqe
0
241807
<reponame>olifink/smsqe ; IP IO routines V1.00  2004 <NAME> section ip xdef ip_io xref io_ckchn include 'dev8_keys_err' include 'dev8_keys_socket' include 'dev8_smsq_qpc_keys' include 'dev8_smsq_qpc_ip_data' ip_io move.l a0,-(sp) ; cmp.l #ip.accept,d0 ; beq.s ip_chan1 ; cmp.l #ip.dup,d0 ; bne.s ip_doio ;ip_chan1 ; movem.l d0/d7/a0-a1/a3,-(sp) ; moveq #0,d0 ; move.l a1,a0 ; check channel it ; jsr io_ckchn ; tst.l d0 ; bmi.s ip_ipar ; cmp.l #chn.id,chn_id(a0) ; really IP channel? ; bne.s ip_ipar ; ... no ; move.l chn_data(a0),a1 ; data address for that channel ; move.l chn_data(a0),a0 ; Internal data ; dc.w qpc.ipio ; movem.l (sp)+,d0/d7/a0-a1/a3 ; bra.s ip_exit ip_doio move.l chn_data(a0),a0 ; Internal data dc.w qpc.ipio ip_exit movem.l (sp)+,a0 rts ;ip_ipar ; movem.l (sp)+,d0/d7/a0-a1/a3 ; moveq #err.ipar,d0 ; bra.s ip_exit end
oeis/142/A142526.asm
neoneye/loda-programs
11
3077
<gh_stars>10-100 ; A142526: Primes congruent to 41 mod 52. ; Submitted by <NAME> ; 41,197,353,457,509,613,769,821,977,1237,1289,1549,1601,1861,1913,2017,2069,2381,2693,2797,2953,3109,3733,3889,4201,4253,4357,4409,4513,4721,4877,5189,5449,5501,5657,5813,6073,6229,7321,7477,7529,7789,7841,8101,8933,9349,9661,9817,9973,10181,10337,10597,10753,10909,11117,11273,11689,11897,12157,12781,13093,13249,13457,13613,13873,14029,14081,14341,14549,14653,15017,15121,15173,15277,15329,15641,15797,15901,16057,16369,16421,16889,16993,17669,17929,17981,18397,18553,18917,19073,19333,19489,19541 mov $1,5 mov $2,$0 add $2,2 pow $2,2 lpb $2 add $1,35 mov $3,$1 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,17 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 sub $2,1 lpe mov $0,$1 add $0,36
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/NES_Ver2/us_asm/zel_dmap.asm
prismotizm/gigaleak
0
87491
<filename>other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/NES_Ver2/us_asm/zel_dmap.asm<gh_stars>0 Name: zel_dmap.asm Type: file Size: 90418 Last-Modified: '2016-05-13T04:27:09Z' SHA-1: 634E4118EB117FC1FC465552D4935DE088CE504F Description: null
src/data.ads
Rassol/AdaSem
0
23189
<gh_stars>0 -- Specification of class called data -- This class is generic type class generic n:Integer; -- Parametr used in class p:Integer; package data is --Declaration of private types type Vector is private; type Matrix is private; --Input Vector from keyboard procedure Vector_Input(A: out Vector; S: in String); --Fill Vector with 1 procedure Vector_Fill(A: out Vector; B: in Integer); --Print Vector on screen procedure Vector_Output(A: in Vector); --Input Matrix from keyboard procedure Matrix_Input(A: out Matrix; S: in String); --Fill Matrix with 1 procedure Matrix_Fill(A: out Matrix; B: in Integer); --Print Matrix on screen procedure Matrix_Output(A: in Matrix); --Calculating Func1 procedure Func(A: out Vector; B,C: in Vector;MO,MK,MR: in Matrix; d: in Integer; num: in integer); --Determination declarated private types private type Vector is array (1..n) of Integer; type Matrix is array (1..n) of Vector; end Data;
Send Info.applescript
EnglishLFC/Omnifocus
0
114
<reponame>EnglishLFC/Omnifocus (* Script that takes clipboard text and makes an OmniFocus task to send that info to a person. Puts the task in Miscellaneous Gives it the context Email Sets a due date in 2 days from now Blame: <NAME> <EMAIL> *) set theProject to "Miscellaneous" set theTaskTitle to "Send information to " set theContext to "Email" set theDueDate to (current date) + 2 * days set theBody to "Send information about " & (the clipboard as text) activate display dialog "Who are you sending to?" default answer "" with title "Need a name" set thePerson to text returned of result set theTitle to theTaskTitle & thePerson tell application "OmniFocus" set will autosave of front document to false tell default document set lstProj to flattened projects where name = theProject set oProj to item 1 of lstProj set lstContexts to flattened contexts where name = theContext set oContext to item 1 of lstContexts tell oProj set theTask to make new task with properties {name:theTitle, note:theBody, context:oContext, due date:theDueDate} end tell end tell set will autosave of front document to true end tell
src/tk/tk-winfo.adb
thindil/tashy2
2
11309
-- Copyright (c) 2021 <NAME> <<EMAIL>> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. with Ada.Strings.Fixed; with Tcl.Strings; use Tcl.Strings; package body Tk.Winfo is function Atom (A_Name: String; Interpreter: Tcl_Interpreter := Get_Interpreter; Window: Tk_Widget := Null_Widget) return Positive is begin if Window /= Null_Widget then return Tcl_Eval (Tcl_Script => "winfo atom -displayof " & Tk_Path_Name(Widgt => Window) & " " & A_Name, Interpreter => Tk_Interp(Widgt => Window)) .Result; end if; return Tcl_Eval (Tcl_Script => "winfo atom " & A_Name, Interpreter => Interpreter) .Result; end Atom; function Atom_Name (Atom_Id: Positive; Interpreter: Tcl_Interpreter := Get_Interpreter; Window: Tk_Widget := Null_Widget) return String is begin if Window /= Null_Widget then return Tcl_Eval (Tcl_Script => "winfo atomname -displayof " & Tk_Path_Name(Widgt => Window) & Positive'Image(Atom_Id), Interpreter => Tk_Interp(Widgt => Window)) .Result; end if; return Tcl_Eval (Tcl_Script => "winfo atomname" & Positive'Image(Atom_Id), Interpreter => Interpreter) .Result; end Atom_Name; function Cells(Window: Tk_Widget) return Natural is begin return Tcl_Eval (Tcl_Script => "winfo cells " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Cells; function Children(Window: Tk_Widget) return Widgets_Array is Interpreter: constant Tcl_Interpreter := Tk_Interp(Widgt => Window); Result_List: constant Array_List := Split_List (List => Tcl_Eval (Tcl_Script => "winfo children " & Tk_Path_Name(Widgt => Window), Interpreter => Interpreter) .Result, Interpreter => Interpreter); begin return Widgets: Widgets_Array(1 .. Result_List'Last) := (others => Null_Widget) do Fill_Result_Array_Loop : for I in 1 .. Result_List'Last loop Widgets(I) := Get_Widget (Path_Name => To_Ada_String(Source => Result_List(I)), Interpreter => Interpreter); end loop Fill_Result_Array_Loop; end return; end Children; function Containing (Root_Window_X, Root_Window_Y: Pixel_Data; Window: Tk_Widget := Null_Widget; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tk_Widget is begin return Get_Widget (Path_Name => Tcl_Eval (Tcl_Script => "winfo containing" & (if Window = Null_Widget then "" else " -displayof " & Tk_Path_Name(Widgt => Window) & "") & " " & Pixel_Data_Image(Value => Root_Window_X) & " " & Pixel_Data_Image(Value => Root_Window_Y), Interpreter => (if Window = Null_Widget then Interpreter else Tk_Interp(Widgt => Window))) .Result, Interpreter => (if Window = Null_Widget then Interpreter else Tk_Interp(Widgt => Window))); end Containing; function Colors_Depth(Window: Tk_Widget) return Positive is begin return Tcl_Eval (Tcl_Script => "winfo depth " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Colors_Depth; function Floating_Point_Pixels (Window: Tk_Widget; Number: Pixel_Data) return Float is begin return Tcl_Eval (Tcl_Script => "winfo fpixels " & Tk_Path_Name(Widgt => Window) & " " & Pixel_Data_Image(Value => Number)) .Result; end Floating_Point_Pixels; function Geometry(Window: Tk_Widget) return Window_Geometry is use Ada.Strings.Fixed; Result: constant String := Tcl_Eval (Tcl_Script => "winfo geometry " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; Start_Index, End_Index: Positive := 1; begin return Win_Geometry: Window_Geometry := Empty_Window_Geometry do End_Index := Index(Source => Result, Pattern => "x"); Win_Geometry.Width := Natural'Value(Result(1 .. End_Index - 1)); Start_Index := End_Index + 1; --## rule off ASSIGNMENTS End_Index := Index(Source => Result, Pattern => "+", From => Start_Index); Win_Geometry.Height := Natural'Value(Result(Start_Index .. End_Index - 1)); Start_Index := End_Index + 1; End_Index := Index(Source => Result, Pattern => "+", From => Start_Index); Win_Geometry.X := Natural'Value(Result(Start_Index .. End_Index - 1)); Start_Index := End_Index + 1; --## rule on ASSIGNMENTS Win_Geometry.Y := Natural'Value(Result(Start_Index .. Result'Last)); end return; end Geometry; function Height(Window: Tk_Widget) return Positive is begin return Tcl_Eval (Tcl_Script => "winfo height " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Height; function Id(Window: Tk_Widget) return Positive is Result: constant String := Tcl_Eval (Tcl_Script => "winfo id " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; begin return Positive'Value("16#" & Result(3 .. Result'Last) & "#"); end Id; function Interpreters (Window: Tk_Widget := Null_Widget; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List is begin return Split_List (List => Tcl_Eval (Tcl_Script => "winfo interps " & (if Window = Null_Widget then "" else " -displayof " & Tk_Path_Name(Widgt => Window)), Interpreter => (if Window = Null_Widget then Interpreter else Tk_Interp(Widgt => Window))) .Result, Interpreter => (if Window = Null_Widget then Interpreter else Tk_Interp(Widgt => Window))); end Interpreters; function Manager(Window: Tk_Widget) return String is Result: constant String := Tcl_Eval (Tcl_Script => "winfo manager " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; begin if Result'Length = 0 then return "unknown"; end if; return Result; end Manager; function Name(Window: Tk_Widget) return String is Result: constant String := Tcl_Eval (Tcl_Script => "winfo name " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; begin if Result'Length = 0 then return "unknown"; end if; return Result; end Name; function Path_Name (Window_Id: Positive; Window: Tk_Widget := Null_Widget; Interpreter: Tcl_Interpreter := Get_Interpreter) return String is begin if Window /= Null_Widget then return Tcl_Eval (Tcl_Script => "winfo pathname -displayof " & Tk_Path_Name(Widgt => Window) & Positive'Image(Window_Id), Interpreter => Tk_Interp(Widgt => Window)) .Result; end if; return Tcl_Eval (Tcl_Script => "winfo pathname" & Positive'Image(Window_Id), Interpreter => Interpreter) .Result; end Path_Name; function Pixels(Window: Tk_Widget; Number: Pixel_Data) return Integer is begin return Tcl_Eval (Tcl_Script => "winfo pixels " & Tk_Path_Name(Widgt => Window) & " " & Pixel_Data_Image(Value => Number)) .Result; end Pixels; function Pointer_X(Window: Tk_Widget) return Extended_Natural is begin return Extended_Natural'Value (Tcl_Eval (Tcl_Script => "winfo pointerx " & Tk_Path_Name(Widgt => Window)) .Result); end Pointer_X; function Pointer_X_Y(Window: Tk_Widget) return Point_Position is Interpreter: constant Tcl_Interpreter := Tk_Interp(Widgt => Window); Result_List: constant Array_List := Split_List (List => Tcl_Eval (Tcl_Script => "winfo pointerxy " & Tk_Path_Name(Widgt => Window), Interpreter => Interpreter) .Result, Interpreter => Interpreter); begin return Pointer_Location: Point_Position := Empty_Point_Position do Pointer_Location.X := Extended_Natural'Value(To_Ada_String(Source => Result_List(1))); Pointer_Location.Y := Extended_Natural'Value(To_Ada_String(Source => Result_List(2))); end return; end Pointer_X_Y; function Pointer_Y(Window: Tk_Widget) return Extended_Natural is begin return Extended_Natural'Value (Tcl_Eval (Tcl_Script => "winfo pointery " & Tk_Path_Name(Widgt => Window)) .Result); end Pointer_Y; function Requested_Height(Window: Tk_Widget) return Natural is begin return Tcl_Eval (Tcl_Script => "winfo reqheight " & Tk_Path_Name(Widgt => Window)) .Result; end Requested_Height; function Requested_Width(Window: Tk_Widget) return Natural is begin return Tcl_Eval (Tcl_Script => "winfo reqheight " & Tk_Path_Name(Widgt => Window)) .Result; end Requested_Width; function Rgb(Window: Tk_Widget; Color_Name: String) return Color_Type is Interpreter: constant Tcl_Interpreter := Tk_Interp(Widgt => Window); Result_List: constant Array_List := Split_List (List => Tcl_Eval (Tcl_Script => "winfo rgb " & Tk_Path_Name(Widgt => Window) & " " & Color_Name, Interpreter => Interpreter) .Result, Interpreter => Interpreter); begin return Colors: Color_Type := Empty_Color do Colors.Red := Color_Range'Value(To_Ada_String(Source => Result_List(1))); Colors.Blue := Color_Range'Value(To_Ada_String(Source => Result_List(2))); Colors.Green := Color_Range'Value(To_Ada_String(Source => Result_List(3))); end return; end Rgb; function Root_X(Window: Tk_Widget) return Extended_Natural is begin return Extended_Natural'Value (Tcl_Eval (Tcl_Script => "winfo rootx " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result); end Root_X; function Root_Y(Window: Tk_Widget) return Extended_Natural is begin return Extended_Natural'Value (Tcl_Eval (Tcl_Script => "winfo rooty " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result); end Root_Y; function Screen_Cells(Window: Tk_Widget) return Positive is begin return Tcl_Eval (Tcl_Script => "winfo screencells " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Screen_Cells; function Screen_Depth(Window: Tk_Widget) return Positive is begin return Tcl_Eval (Tcl_Script => "winfo screendepth " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Screen_Depth; function Screen_Height(Window: Tk_Widget) return Positive is begin return Tcl_Eval (Tcl_Script => "winfo screenheight " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Screen_Height; function Screen_Milimeters_Height(Window: Tk_Widget) return Positive is begin return Tcl_Eval (Tcl_Script => "winfo screenmmheight " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Screen_Milimeters_Height; function Screen_Milimeters_Width(Window: Tk_Widget) return Positive is begin return Tcl_Eval (Tcl_Script => "winfo screenmmwidth " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Screen_Milimeters_Width; function Screen_Visual(Window: Tk_Widget) return Screen_Visual_Type is Result: constant String := Tcl_Eval (Tcl_Script => "winfo screenvisual " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; begin if Result'Length = 0 then return TRUECOLOR; end if; return Screen_Visual_Type'Value(Result); end Screen_Visual; function Screen_Width(Window: Tk_Widget) return Positive is begin return Tcl_Eval (Tcl_Script => "winfo screenwidth " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Screen_Width; function Visual_Id(Window: Tk_Widget) return Positive is Result: constant String := Tcl_Eval (Tcl_Script => "winfo visualid " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; begin return Positive'Value("16#" & Result(3 .. Result'Last) & "#"); end Visual_Id; function Visuals_Available (Window: Tk_Widget; Include_Ids: Boolean := False) return Visuals_List is Interpreter: constant Tcl_Interpreter := Tk_Interp(Widgt => Window); Result_List: constant Array_List := Split_List (List => Tcl_Eval (Tcl_Script => "winfo visualsavailable " & Tk_Path_Name(Widgt => Window) & (if Include_Ids then " includeids" else ""), Interpreter => Interpreter) .Result, Interpreter => Interpreter); Result_Values: Array_List(1 .. (if Include_Ids then 3 else 2)) := (others => Null_Tcl_String); begin return Visuals: Visuals_List (Result_List'Range) := (others => Default_Visual) do Set_Visuals_List_Loop : for I in Result_List'Range loop Result_Values := Split_List (List => To_Ada_String(Source => Result_List(I)), Interpreter => Interpreter); Visuals(I).Visual_Type := Screen_Visual_Type'Value (To_Ada_String(Source => Result_Values(1))); Visuals(I).Depth := Positive'Value(To_Ada_String(Source => Result_Values(2))); if Include_Ids then Visuals(I).Id := Positive'Value ("16#" & To_Ada_String(Source => Result_Values(3)) (3 .. To_Ada_String(Source => Result_Values(3))'Last) & "#"); end if; end loop Set_Visuals_List_Loop; end return; end Visuals_Available; function Virtual_Root_Height(Window: Tk_Widget) return Positive is begin return Tcl_Eval (Tcl_Script => "winfo vrootheight " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Virtual_Root_Height; function Virtual_Root_Width(Window: Tk_Widget) return Positive is begin return Tcl_Eval (Tcl_Script => "winfo vrootwidth " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Virtual_Root_Width; function Virtual_Root_X(Window: Tk_Widget) return Integer is begin return Tcl_Eval (Tcl_Script => "winfo vrootx " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Virtual_Root_X; function Virtual_Root_Y(Window: Tk_Widget) return Integer is begin return Tcl_Eval (Tcl_Script => "winfo vrooty " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Virtual_Root_Y; function Width(Window: Tk_Widget) return Positive is begin return Tcl_Eval (Tcl_Script => "winfo width " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Width; function X(Window: Tk_Widget) return Natural is begin return Tcl_Eval (Tcl_Script => "winfo x " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end X; function Y(Window: Tk_Widget) return Natural is begin return Tcl_Eval (Tcl_Script => "winfo y " & Tk_Path_Name(Widgt => Window), Interpreter => Tk_Interp(Widgt => Window)) .Result; end Y; end Tk.Winfo;
srcs/vm/svm.asm
gamozolabs/falkervisor_grilled_cheese
145
162760
<reponame>gamozolabs/falkervisor_grilled_cheese<filename>srcs/vm/svm.asm [bits 64] section .text struc vm .host_vmcb: resq 1 .vmcb: resq 1 .host_vmcb_pa: resq 1 .vmcb_pa: resq 1 .host_xsave: resq 1 .xsave: resq 1 endstruc struc gprs .rax: resq 1 .rbx: resq 1 .rcx: resq 1 .rdx: resq 1 .rdi: resq 1 .rsi: resq 1 .rbp: resq 1 .rsp: resq 1 .r8: resq 1 .r9: resq 1 .r10: resq 1 .r11: resq 1 .r12: resq 1 .r13: resq 1 .r14: resq 1 .r15: resq 1 .rip: resq 1 .rfl: resq 1 endstruc global svm_asm_step svm_asm_step: clgi ; Save all non-volatile registers push rbx push rbp push rsi push rdi push r12 push r13 push r14 push r15 ; Save the vm pointer and regs push rdi push rsi ; r15 - Pointer to struct _svm_vm ; r14 - Pointer to gprs mov r15, rdi mov r14, rsi ; Save host state mov edx, 0x40000000 mov eax, 0x00000007 xor ecx, ecx xsetbv mov rbx, [r15 + vm.host_xsave] xsave [rbx] mov rax, [r15 + vm.host_vmcb_pa] vmsave ; Load guest xsave mov edx, 0x40000000 mov eax, 0x00000007 mov rbx, [r15 + vm.xsave] xrstor [rbx] ; Load guest vmsave mov rax, [r15 + vm.vmcb_pa] vmload mov rbx, [r14 + gprs.rbx] mov rcx, [r14 + gprs.rcx] mov rdx, [r14 + gprs.rdx] mov rdi, [r14 + gprs.rdi] mov rsi, [r14 + gprs.rsi] mov rbp, [r14 + gprs.rbp] mov r8, [r14 + gprs.r8] mov r9, [r14 + gprs.r9] mov r10, [r14 + gprs.r10] mov r11, [r14 + gprs.r11] mov r12, [r14 + gprs.r12] mov r13, [r14 + gprs.r13] mov r15, [r14 + gprs.r15] mov r14, [r14 + gprs.r14] vmrun ; Restore gprs mov rax, [rsp] mov [rax + gprs.rbx], rbx mov [rax + gprs.rcx], rcx mov [rax + gprs.rdx], rdx mov [rax + gprs.rsi], rsi mov [rax + gprs.rdi], rdi mov [rax + gprs.rbp], rbp mov [rax + gprs.r8], r8 mov [rax + gprs.r9], r9 mov [rax + gprs.r10], r10 mov [rax + gprs.r11], r11 mov [rax + gprs.r12], r12 mov [rax + gprs.r13], r13 mov [rax + gprs.r14], r14 mov [rax + gprs.r15], r15 ; Get the gprs and vm pointer pop r14 pop r15 ; Save guest state mov edx, 0x40000000 mov eax, 0x00000007 xor ecx, ecx xsetbv mov rbx, [r15 + vm.xsave] xsave [rbx] mov rax, [r15 + vm.vmcb_pa] vmsave ; Load host xsave mov edx, 0x40000000 mov eax, 0x00000007 mov rbx, [r15 + vm.host_xsave] xrstor [rbx] ; Load host vmsave mov rax, [r15 + vm.host_vmcb_pa] vmload ; Restore all non-volatile registers pop r15 pop r14 pop r13 pop r12 pop rdi pop rsi pop rbp pop rbx stgi ret
programs/oeis/133/A133891.asm
karttu/loda
1
12160
<reponame>karttu/loda<gh_stars>1-10 ; A133891: Binomial(n+p,n) mod p, where p=12. ; 1,1,7,11,8,8,0,0,6,2,2,2,4,4,4,0,3,3,9,9,0,0,0,0,0,0,0,4,4,4,8,8,5,9,3,3,8,8,8,4,10,10,6,6,0,0,0,0,3,3,9,9,0,0,4,4,4,8,8,8,0,0,0,8,5,5,7,7,4,0,0,0,6,6,6,6,0,0,0,0,3,7,1,1,8,8,8,0,0,0,8,8,8,4,4,4,9,9,3,3,0,0,0,0 mov $1,$0 add $1,12 bin $1,12 mod $1,12
Ada95/samples/sample-menu_demo-handler.adb
arc-aosp/external_libncurses
35
30158
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample.Menu_Demo.Handler -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998,2004 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, distribute with modifications, sublicense, and/or sell -- -- copies of the Software, and to permit persons to whom the Software is -- -- furnished to do so, subject to the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: <NAME>, 1996 -- Version Control -- $Revision: 1.15 $ -- $Date: 2004/08/21 21:37:00 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Sample.Menu_Demo.Aux; with Sample.Manifest; use Sample.Manifest; with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; package body Sample.Menu_Demo.Handler is package Aux renames Sample.Menu_Demo.Aux; procedure Drive_Me (M : in Menu; Title : in String := "") is L : Line_Count; C : Column_Count; Y : Line_Position; X : Column_Position; begin Aux.Geometry (M, L, C, Y, X); Drive_Me (M, Y, X, Title); end Drive_Me; procedure Drive_Me (M : in Menu; Lin : in Line_Position; Col : in Column_Position; Title : in String := "") is Mask : Event_Mask := No_Events; Old : Event_Mask; Pan : Panel := Aux.Create (M, Title, Lin, Col); V : Cursor_Visibility := Invisible; begin -- We are only interested in Clicks with the left button Register_Reportable_Events (Left, All_Clicks, Mask); Old := Start_Mouse (Mask); Set_Cursor_Visibility (V); loop declare K : Key_Code := Aux.Get_Request (M, Pan); R : constant Driver_Result := Driver (M, K); begin case R is when Menu_Ok => null; when Unknown_Request => declare I : constant Item := Current (M); O : Item_Option_Set; begin if K = Key_Mouse then K := SELECT_ITEM; end if; Get_Options (I, O); if K = SELECT_ITEM and then not O.Selectable then Beep; else if My_Driver (M, K, Pan) then exit; end if; end if; end; when others => Beep; end case; end; end loop; End_Mouse (Old); Aux.Destroy (M, Pan); end Drive_Me; end Sample.Menu_Demo.Handler;
libsrc/msx/msx_noblank.asm
RC2014Z80/z88dk
8
162349
; ; MSX specific routines ; by <NAME>, 30/11/2007 ; ; void msx_noblank(); ; ; Enable screen ; ; $Id: msx_noblank.asm,v 1.5 2016-06-16 19:30:25 dom Exp $ ; SECTION code_clib PUBLIC msx_noblank PUBLIC _msx_noblank EXTERN msxbios INCLUDE "msxbios.def" msx_noblank: _msx_noblank: push ix ld ix,ENASCR call msxbios pop ix ret
Cubical/Algebra/CommAlgebra/FreeCommAlgebra/Properties.agda
howsiyu/cubical
0
11386
{-# OPTIONS --safe #-} module Cubical.Algebra.CommAlgebra.FreeCommAlgebra.Properties where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.HLevels open import Cubical.Foundations.Structure open import Cubical.Foundations.Function hiding (const) open import Cubical.Foundations.Isomorphism open import Cubical.Data.Sigma.Properties using (Σ≡Prop) open import Cubical.HITs.SetTruncation open import Cubical.Algebra.CommRing open import Cubical.Algebra.CommAlgebra.FreeCommAlgebra.Base open import Cubical.Algebra.Ring using () open import Cubical.Algebra.CommAlgebra open import Cubical.Algebra.CommAlgebra.Instances.Initial open import Cubical.Algebra.Algebra open import Cubical.Data.Empty open import Cubical.Data.Sigma private variable ℓ ℓ' ℓ'' : Level module Theory {R : CommRing ℓ} {I : Type ℓ'} where open CommRingStr (snd R) using (0r; 1r) renaming (_·_ to _·r_; _+_ to _+r_; ·Comm to ·r-comm; ·Rid to ·r-rid) module _ (A : CommAlgebra R ℓ'') (φ : I → ⟨ A ⟩) where open CommAlgebraStr (A .snd) open AlgebraTheory (CommRing→Ring R) (CommAlgebra→Algebra A) open Construction using (var; const) renaming (_+_ to _+c_; -_ to -c_; _·_ to _·c_) imageOf0Works : 0r ⋆ 1a ≡ 0a imageOf0Works = 0-actsNullifying 1a imageOf1Works : 1r ⋆ 1a ≡ 1a imageOf1Works = ⋆-lid 1a inducedMap : ⟨ R [ I ] ⟩ → ⟨ A ⟩ inducedMap (var x) = φ x inducedMap (const r) = r ⋆ 1a inducedMap (P +c Q) = (inducedMap P) + (inducedMap Q) inducedMap (-c P) = - inducedMap P inducedMap (Construction.+-assoc P Q S i) = +-assoc (inducedMap P) (inducedMap Q) (inducedMap S) i inducedMap (Construction.+-rid P i) = let eq : (inducedMap P) + (inducedMap (const 0r)) ≡ (inducedMap P) eq = (inducedMap P) + (inducedMap (const 0r)) ≡⟨ refl ⟩ (inducedMap P) + (0r ⋆ 1a) ≡⟨ cong (λ u → (inducedMap P) + u) (imageOf0Works) ⟩ (inducedMap P) + 0a ≡⟨ +-rid _ ⟩ (inducedMap P) ∎ in eq i inducedMap (Construction.+-rinv P i) = let eq : (inducedMap P - inducedMap P) ≡ (inducedMap (const 0r)) eq = (inducedMap P - inducedMap P) ≡⟨ +-rinv _ ⟩ 0a ≡⟨ sym imageOf0Works ⟩ (inducedMap (const 0r))∎ in eq i inducedMap (Construction.+-comm P Q i) = +-comm (inducedMap P) (inducedMap Q) i inducedMap (P ·c Q) = inducedMap P · inducedMap Q inducedMap (Construction.·-assoc P Q S i) = ·Assoc (inducedMap P) (inducedMap Q) (inducedMap S) i inducedMap (Construction.·-lid P i) = let eq = inducedMap (const 1r) · inducedMap P ≡⟨ cong (λ u → u · inducedMap P) imageOf1Works ⟩ 1a · inducedMap P ≡⟨ ·Lid (inducedMap P) ⟩ inducedMap P ∎ in eq i inducedMap (Construction.·-comm P Q i) = ·-comm (inducedMap P) (inducedMap Q) i inducedMap (Construction.ldist P Q S i) = ·Ldist+ (inducedMap P) (inducedMap Q) (inducedMap S) i inducedMap (Construction.+HomConst s t i) = ⋆-ldist s t 1a i inducedMap (Construction.·HomConst s t i) = let eq = (s ·r t) ⋆ 1a ≡⟨ cong (λ u → u ⋆ 1a) (·r-comm _ _) ⟩ (t ·r s) ⋆ 1a ≡⟨ ⋆-assoc t s 1a ⟩ t ⋆ (s ⋆ 1a) ≡⟨ cong (λ u → t ⋆ u) (sym (·Rid _)) ⟩ t ⋆ ((s ⋆ 1a) · 1a) ≡⟨ ⋆-rassoc t (s ⋆ 1a) 1a ⟩ (s ⋆ 1a) · (t ⋆ 1a) ∎ in eq i inducedMap (Construction.0-trunc P Q p q i j) = isSetAlgebra (CommAlgebra→Algebra A) (inducedMap P) (inducedMap Q) (cong _ p) (cong _ q) i j module _ where open IsAlgebraHom inducedHom : AlgebraHom (CommAlgebra→Algebra (R [ I ])) (CommAlgebra→Algebra A) inducedHom .fst = inducedMap inducedHom .snd .pres0 = 0-actsNullifying _ inducedHom .snd .pres1 = imageOf1Works inducedHom .snd .pres+ x y = refl inducedHom .snd .pres· x y = refl inducedHom .snd .pres- x = refl inducedHom .snd .pres⋆ r x = (r ⋆ 1a) · inducedMap x ≡⟨ ⋆-lassoc r 1a (inducedMap x) ⟩ r ⋆ (1a · inducedMap x) ≡⟨ cong (λ u → r ⋆ u) (·Lid (inducedMap x)) ⟩ r ⋆ inducedMap x ∎ module _ (A : CommAlgebra R ℓ'') where open CommAlgebraStr (A .snd) open AlgebraTheory (CommRing→Ring R) (CommAlgebra→Algebra A) open Construction using (var; const) renaming (_+_ to _+c_; -_ to -c_; _·_ to _·c_) Hom = CommAlgebraHom (R [ I ]) A open IsAlgebraHom evaluateAt : Hom → I → ⟨ A ⟩ evaluateAt φ x = φ .fst (var x) mapRetrievable : ∀ (φ : I → ⟨ A ⟩) → evaluateAt (inducedHom A φ) ≡ φ mapRetrievable φ = refl proveEq : ∀ {X : Type ℓ''} (isSetX : isSet X) (f g : ⟨ R [ I ] ⟩ → X) → (var-eq : (x : I) → f (var x) ≡ g (var x)) → (const-eq : (r : ⟨ R ⟩) → f (const r) ≡ g (const r)) → (+-eq : (x y : ⟨ R [ I ] ⟩) → (eq-x : f x ≡ g x) → (eq-y : f y ≡ g y) → f (x +c y) ≡ g (x +c y)) → (·-eq : (x y : ⟨ R [ I ] ⟩) → (eq-x : f x ≡ g x) → (eq-y : f y ≡ g y) → f (x ·c y) ≡ g (x ·c y)) → (-eq : (x : ⟨ R [ I ] ⟩) → (eq-x : f x ≡ g x) → f (-c x) ≡ g (-c x)) → f ≡ g proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (var x) = var-eq x i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (const x) = const-eq x i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (x +c y) = +-eq x y (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x) (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i y) i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (-c x) = -eq x ((λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x)) i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (x ·c y) = ·-eq x y (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x) (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i y) i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (Construction.+-assoc x y z j) = let rec : (x : ⟨ R [ I ] ⟩) → f x ≡ g x rec x = (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x) a₀₋ : f (x +c (y +c z)) ≡ g (x +c (y +c z)) a₀₋ = +-eq _ _ (rec x) (+-eq _ _ (rec y) (rec z)) a₁₋ : f ((x +c y) +c z) ≡ g ((x +c y) +c z) a₁₋ = +-eq _ _ (+-eq _ _ (rec x) (rec y)) (rec z) a₋₀ : f (x +c (y +c z)) ≡ f ((x +c y) +c z) a₋₀ = cong f (Construction.+-assoc x y z) a₋₁ : g (x +c (y +c z)) ≡ g ((x +c y) +c z) a₋₁ = cong g (Construction.+-assoc x y z) in isSet→isSet' isSetX a₀₋ a₁₋ a₋₀ a₋₁ j i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (Construction.+-rid x j) = let rec : (x : ⟨ R [ I ] ⟩) → f x ≡ g x rec x = (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x) a₀₋ : f (x +c (const 0r)) ≡ g (x +c (const 0r)) a₀₋ = +-eq _ _ (rec x) (const-eq 0r) a₁₋ : f x ≡ g x a₁₋ = rec x a₋₀ : f (x +c (const 0r)) ≡ f x a₋₀ = cong f (Construction.+-rid x) a₋₁ : g (x +c (const 0r)) ≡ g x a₋₁ = cong g (Construction.+-rid x) in isSet→isSet' isSetX a₀₋ a₁₋ a₋₀ a₋₁ j i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (Construction.+-rinv x j) = let rec : (x : ⟨ R [ I ] ⟩) → f x ≡ g x rec x = (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x) a₀₋ : f (x +c (-c x)) ≡ g (x +c (-c x)) a₀₋ = +-eq x (-c x) (rec x) (-eq x (rec x)) a₁₋ : f (const 0r) ≡ g (const 0r) a₁₋ = const-eq 0r a₋₀ : f (x +c (-c x)) ≡ f (const 0r) a₋₀ = cong f (Construction.+-rinv x) a₋₁ : g (x +c (-c x)) ≡ g (const 0r) a₋₁ = cong g (Construction.+-rinv x) in isSet→isSet' isSetX a₀₋ a₁₋ a₋₀ a₋₁ j i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (Construction.+-comm x y j) = let rec : (x : ⟨ R [ I ] ⟩) → f x ≡ g x rec x = (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x) a₀₋ : f (x +c y) ≡ g (x +c y) a₀₋ = +-eq x y (rec x) (rec y) a₁₋ : f (y +c x) ≡ g (y +c x) a₁₋ = +-eq y x (rec y) (rec x) a₋₀ : f (x +c y) ≡ f (y +c x) a₋₀ = cong f (Construction.+-comm x y) a₋₁ : g (x +c y) ≡ g (y +c x) a₋₁ = cong g (Construction.+-comm x y) in isSet→isSet' isSetX a₀₋ a₁₋ a₋₀ a₋₁ j i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (Construction.·-assoc x y z j) = let rec : (x : ⟨ R [ I ] ⟩) → f x ≡ g x rec x = (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x) a₀₋ : f (x ·c (y ·c z)) ≡ g (x ·c (y ·c z)) a₀₋ = ·-eq _ _ (rec x) (·-eq _ _ (rec y) (rec z)) a₁₋ : f ((x ·c y) ·c z) ≡ g ((x ·c y) ·c z) a₁₋ = ·-eq _ _ (·-eq _ _ (rec x) (rec y)) (rec z) a₋₀ : f (x ·c (y ·c z)) ≡ f ((x ·c y) ·c z) a₋₀ = cong f (Construction.·-assoc x y z) a₋₁ : g (x ·c (y ·c z)) ≡ g ((x ·c y) ·c z) a₋₁ = cong g (Construction.·-assoc x y z) in isSet→isSet' isSetX a₀₋ a₁₋ a₋₀ a₋₁ j i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (Construction.·-lid x j) = let rec : (x : ⟨ R [ I ] ⟩) → f x ≡ g x rec x = (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x) a₀₋ : f ((const 1r) ·c x) ≡ g ((const 1r) ·c x) a₀₋ = ·-eq _ _ (const-eq 1r) (rec x) a₁₋ : f x ≡ g x a₁₋ = rec x a₋₀ : f ((const 1r) ·c x) ≡ f x a₋₀ = cong f (Construction.·-lid x) a₋₁ : g ((const 1r) ·c x) ≡ g x a₋₁ = cong g (Construction.·-lid x) in isSet→isSet' isSetX a₀₋ a₁₋ a₋₀ a₋₁ j i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (Construction.·-comm x y j) = let rec : (x : ⟨ R [ I ] ⟩) → f x ≡ g x rec x = (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x) a₀₋ : f (x ·c y) ≡ g (x ·c y) a₀₋ = ·-eq _ _ (rec x) (rec y) a₁₋ : f (y ·c x) ≡ g (y ·c x) a₁₋ = ·-eq _ _ (rec y) (rec x) a₋₀ : f (x ·c y) ≡ f (y ·c x) a₋₀ = cong f (Construction.·-comm x y) a₋₁ : g (x ·c y) ≡ g (y ·c x) a₋₁ = cong g (Construction.·-comm x y) in isSet→isSet' isSetX a₀₋ a₁₋ a₋₀ a₋₁ j i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (Construction.ldist x y z j) = let rec : (x : ⟨ R [ I ] ⟩) → f x ≡ g x rec x = (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x) a₀₋ : f ((x +c y) ·c z) ≡ g ((x +c y) ·c z) a₀₋ = ·-eq (x +c y) z (+-eq _ _ (rec x) (rec y)) (rec z) a₁₋ : f ((x ·c z) +c (y ·c z)) ≡ g ((x ·c z) +c (y ·c z)) a₁₋ = +-eq _ _ (·-eq _ _ (rec x) (rec z)) (·-eq _ _ (rec y) (rec z)) a₋₀ : f ((x +c y) ·c z) ≡ f ((x ·c z) +c (y ·c z)) a₋₀ = cong f (Construction.ldist x y z) a₋₁ : g ((x +c y) ·c z) ≡ g ((x ·c z) +c (y ·c z)) a₋₁ = cong g (Construction.ldist x y z) in isSet→isSet' isSetX a₀₋ a₁₋ a₋₀ a₋₁ j i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (Construction.+HomConst s t j) = let rec : (x : ⟨ R [ I ] ⟩) → f x ≡ g x rec x = (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x) a₀₋ : f (const (s +r t)) ≡ g (const (s +r t)) a₀₋ = const-eq (s +r t) a₁₋ : f (const s +c const t) ≡ g (const s +c const t) a₁₋ = +-eq _ _ (const-eq s) (const-eq t) a₋₀ : f (const (s +r t)) ≡ f (const s +c const t) a₋₀ = cong f (Construction.+HomConst s t) a₋₁ : g (const (s +r t)) ≡ g (const s +c const t) a₋₁ = cong g (Construction.+HomConst s t) in isSet→isSet' isSetX a₀₋ a₁₋ a₋₀ a₋₁ j i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (Construction.·HomConst s t j) = let rec : (x : ⟨ R [ I ] ⟩) → f x ≡ g x rec x = (λ i → proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x) a₀₋ : f (const (s ·r t)) ≡ g (const (s ·r t)) a₀₋ = const-eq (s ·r t) a₁₋ : f (const s ·c const t) ≡ g (const s ·c const t) a₁₋ = ·-eq _ _ (const-eq s) (const-eq t) a₋₀ : f (const (s ·r t)) ≡ f (const s ·c const t) a₋₀ = cong f (Construction.·HomConst s t) a₋₁ : g (const (s ·r t)) ≡ g (const s ·c const t) a₋₁ = cong g (Construction.·HomConst s t) in isSet→isSet' isSetX a₀₋ a₁₋ a₋₀ a₋₁ j i proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i (Construction.0-trunc x y p q j k) = let P : (x : ⟨ R [ I ] ⟩) → f x ≡ g x P x i = proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x Q : (x : ⟨ R [ I ] ⟩) → f x ≡ g x Q x i = proveEq isSetX f g var-eq const-eq +-eq ·-eq -eq i x in isOfHLevel→isOfHLevelDep 2 (λ z → isProp→isSet (isSetX (f z) (g z))) _ _ (cong P p) (cong Q q) (Construction.0-trunc x y p q) j k i homRetrievable : ∀ (f : Hom) → inducedMap A (evaluateAt f) ≡ fst f homRetrievable f = proveEq (isSetAlgebra (CommAlgebra→Algebra A)) (inducedMap A (evaluateAt f)) (λ x → f $a x) (λ x → refl) (λ r → r ⋆ 1a ≡⟨ cong (λ u → r ⋆ u) (sym f.pres1) ⟩ r ⋆ (f $a (const 1r)) ≡⟨ sym (f.pres⋆ r _) ⟩ f $a (const r ·c const 1r) ≡⟨ cong (λ u → f $a u) (sym (Construction.·HomConst r 1r)) ⟩ f $a (const (r ·r 1r)) ≡⟨ cong (λ u → f $a (const u)) (·r-rid r) ⟩ f $a (const r) ∎) (λ x y eq-x eq-y → ι (x +c y) ≡⟨ refl ⟩ (ι x + ι y) ≡⟨ cong (λ u → u + ι y) eq-x ⟩ ((f $a x) + ι y) ≡⟨ cong (λ u → (f $a x) + u) eq-y ⟩ ((f $a x) + (f $a y)) ≡⟨ sym (f.pres+ _ _) ⟩ (f $a (x +c y)) ∎) (λ x y eq-x eq-y → ι (x ·c y) ≡⟨ refl ⟩ ι x · ι y ≡⟨ cong (λ u → u · ι y) eq-x ⟩ (f $a x) · (ι y) ≡⟨ cong (λ u → (f $a x) · u) eq-y ⟩ (f $a x) · (f $a y) ≡⟨ sym (f.pres· _ _) ⟩ f $a (x ·c y) ∎) (λ x eq-x → ι (-c x) ≡⟨ refl ⟩ - ι x ≡⟨ cong (λ u → - u) eq-x ⟩ - (f $a x) ≡⟨ sym (f.pres- x) ⟩ f $a (-c x) ∎) where ι = inducedMap A (evaluateAt f) module f = IsAlgebraHom (f .snd) evaluateAt : {R : CommRing ℓ} {I : Type ℓ'} (A : CommAlgebra R ℓ'') (f : CommAlgebraHom (R [ I ]) A) → (I → fst A) evaluateAt A f x = f $a (Construction.var x) inducedHom : {R : CommRing ℓ} {I : Type ℓ'} (A : CommAlgebra R ℓ'') (φ : I → fst A ) → CommAlgebraHom (R [ I ]) A inducedHom A φ = Theory.inducedHom A φ homMapIso : {R : CommRing ℓ} {I : Type ℓ} (A : CommAlgebra R ℓ') → Iso (CommAlgebraHom (R [ I ]) A) (I → (fst A)) Iso.fun (homMapIso A) = evaluateAt A Iso.inv (homMapIso A) = inducedHom A Iso.rightInv (homMapIso A) = λ ϕ → Theory.mapRetrievable A ϕ Iso.leftInv (homMapIso {R = R} {I = I} A) = λ f → Σ≡Prop (λ f → isPropIsCommAlgebraHom {M = R [ I ]} {N = A} f) (Theory.homRetrievable A f) homMapPath : {R : CommRing ℓ} {I : Type ℓ} (A : CommAlgebra R ℓ') → CommAlgebraHom (R [ I ]) A ≡ (I → fst A) homMapPath A = isoToPath (homMapIso A) module _ {R : CommRing ℓ} {A B : CommAlgebra R ℓ''} where open AlgebraHoms A′ = CommAlgebra→Algebra A B′ = CommAlgebra→Algebra B R′ = (CommRing→Ring R) ν : AlgebraHom A′ B′ → (⟨ A ⟩ → ⟨ B ⟩) ν φ = φ .fst {- Hom(R[I],A) → (I → A) ↓ ↓ Hom(R[I],B) → (I → B) -} naturalR : {I : Type ℓ'} (ψ : CommAlgebraHom A B) (f : CommAlgebraHom (R [ I ]) A) → (fst ψ) ∘ evaluateAt A f ≡ evaluateAt B (ψ ∘a f) naturalR ψ f = refl {- Hom(R[I],A) → (I → A) ↓ ↓ Hom(R[J],A) → (J → A) -} naturalL : {I J : Type ℓ'} (φ : J → I) (f : CommAlgebraHom (R [ I ]) A) → (evaluateAt A f) ∘ φ ≡ evaluateAt A (f ∘a (inducedHom (R [ I ]) (λ x → Construction.var (φ x)))) naturalL φ f = refl module _ {R : CommRing ℓ} where {- Prove that the FreeCommAlgebra over R on zero generators is isomorphic to the initial R-Algebra - R itsself. -} freeOn⊥ : CommAlgebraEquiv (R [ ⊥ ]) (initialCAlg R) freeOn⊥ = equivByInitiality R (R [ ⊥ ]) {- Show that R[⊥] has the universal property of the initial R-Algbera and conclude that those are isomorphic -} λ B → let to : CommAlgebraHom (R [ ⊥ ]) B → (⊥ → fst B) to = evaluateAt B from : (⊥ → fst B) → CommAlgebraHom (R [ ⊥ ]) B from = inducedHom B from-to : (x : _) → from (to x) ≡ x from-to x = Σ≡Prop (λ f → isPropIsCommAlgebraHom {M = R [ ⊥ ]} {N = B} f) (Theory.homRetrievable B x) equiv : CommAlgebraHom (R [ ⊥ ]) B ≃ (⊥ → fst B) equiv = isoToEquiv (iso to from (λ x → isContr→isOfHLevel 1 isContr⊥→A _ _) from-to) in isOfHLevelRespectEquiv 0 (invEquiv equiv) isContr⊥→A
programs/oeis/177/A177018.asm
jmorken/loda
1
9764
; A177018: a(n) is the smallest integer >= a(n-1) such that a(n) + A067076(n) + n-1 is an odd prime. ; 3,3,3,4,4,5,5,6,8,8,10,11,11,12,14,16,16,18,19,19,21,22,24,27,28,28,29,29,30,36,37,39,39,43,43,45,47,48,50,52,52,56,56,57,57,62,67,68,68,69,71,71,75,77,79,81,81,83,84,84,88,94,95,95,96,102,104,108,108,109,111,114,116,118,119,121,124,125,128,132,132,136,136,138,139,141,144,145,145,146,151,154,155,158,159,161,166,166,174,176,180,182,184,184,186,190,192,194,194,196,198,199,199,204,208,208,209,211,213,213,218,219,221,224,228,231,235,238,240,242,243,246,248,249,252,253,259,263,268,268,272,272,273,273,277,283,284,284,285,291,292,292,293,302,303,306,310,313,314,316,318,324,325,327,329,332,334,339,340,342,342,346,346,348,352,352,356,356,358,366,367,367,368,370,372,375,377,379,389,389,393,396,400,402,404,407,412,413,415,417,417,419,424,428,436,436,437,439,439,441,442,442,443,448,448,450,466,468,470,473,481,485,491,492,492,493,495,498,499,499,501,506,510,510,511,511,512,514,519,524,527,532,534,535,537,540,541,544,545,551 add $0,1 cal $0,173072 ; n-th prime minus n-th even number. add $0,12 mov $1,$0 sub $1,13 div $1,2 add $1,3
src/generate-offset-tiles.asm
santiontanon/triton
41
90100
;----------------------------------------------- ; inputs: ; - base_tiles are uncompressed in "buffer" ; - tile type offsets uncompressed in "tileTypeBuffers" generate_offset_tiles: ; 1) calculate base tile pattern and attribute pointers and put them in IX and IY ld ix,buffer ld l,(ix) inc ix ld h,(ix) inc ix ld bc,buffer+2 add hl,bc push hl pop iy ; 2) bank 0: ld hl,tileTypeBuffers exx ld de,CHRTBL2+21*8 exx call generate_offset_tiles_bank ; 3) banks 1 and 2: push hl exx ld de,CHRTBL2+256*8+43*8 exx call generate_offset_tiles_bank pop hl exx ld de,CHRTBL2+256*8*2+43*8 exx ;jp generate_offset_tiles_bank ;----------------------------------------------- ; recreates the offset tiles for one bank. ; input: ; ; - hl: ptr to the tile type definitions (first byte is the # of them) ; - shadow hl: pointer in VDP to copy ; - ix: base patterns ; - iy: base attributes generate_offset_tiles_bank: ld b,(hl) ; number of tiles inc hl generate_offset_tiles_bank_loop: push bc ; process one tile type: ; 1) copy the first base tile and attributes to a memory buffer: ld a,(hl) inc hl ld de,text_buffer cp #ff jr z,generate_offset_tiles_bank_complete_overwrite cp 240 jr nc,generate_offset_tiles_bank_merge_tiles call generate_offset_tiles_get_base_tile jr generate_offset_tiles_bank_no_flag_overwrite generate_offset_tiles_bank_merge_tiles: ; a has the offset push af ld a,(hl) inc hl call generate_offset_tiles_get_base_tile ; 2) copy the second base tile and attributes to a memory buffer: ld a,(hl) inc hl ld de,text_buffer+16 call generate_offset_tiles_get_base_tile pop af ; 3) offset them the right amount and calculate pattern and attributes: push af push ix push iy and #03 ; clear the overwrite flags ld ix,text_buffer ld iy,text_buffer+16 ld b,8 generate_offset_tiles_bank_shift_outer_loop: ld c,(ix) ; first tile ld d,0 ld e,(iy) ; second tile push af or a jr z,generate_offset_tiles_bank_shift_loop_end generate_offset_tiles_bank_shift_loop: sla c sla c sla e rl d sla e rl d dec a jr nz,generate_offset_tiles_bank_shift_loop generate_offset_tiles_bank_shift_loop_end: ; merge pattern and attributes: ld a,c or a jr nz,generate_offset_tiles_bank_shift_loop_color_from_first ld c,(iy+8) ld (ix+8),c generate_offset_tiles_bank_shift_loop_color_from_first: or d ld (ix),a pop af inc ix inc iy djnz generate_offset_tiles_bank_shift_outer_loop pop iy pop ix pop af bit 3,a jr z,generate_offset_tiles_bank_no_flag_overwrite ld de,text_buffer+8 ld bc,8 ldir generate_offset_tiles_bank_no_flag_overwrite: ; 4) copy it to VDP: call generate_offset_tiles_copy_to_vdp pop bc djnz generate_offset_tiles_bank_loop ret generate_offset_tiles_bank_complete_overwrite: ld de,text_buffer ld bc,16 ldir jr generate_offset_tiles_bank_no_flag_overwrite generate_offset_tiles_get_base_tile: push hl ld l,a ld h,0 add hl,hl add hl,hl add hl,hl push hl push ix pop bc add hl,bc ld bc,8 ldir pop hl push iy pop bc add hl,bc ld bc,8 ldir pop hl ret generate_offset_tiles_copy_to_vdp: exx push de push de ld hl,text_buffer ld bc,8 call fast_LDIRVM pop hl ld bc,CLRTBL2-CHRTBL2 add hl,bc ex de,hl ld hl,text_buffer+8 ld bc,8 push bc call fast_LDIRVM pop bc pop hl add hl,bc ex de,hl exx ret
programs/oeis/170/A170792.asm
neoneye/loda
22
17190
<gh_stars>10-100 ; A170792: a(n) = n^9*(n^10 + 1)/2. ; 0,1,262400,581140575,137439084544,9536744140625,304679875044096,5699447612863375,72057594105036800,675425859030206289,5000000000500000000,30579545225386246991,159739999687891353600,730960145193025305025,2988151979484787721984,11084189100284724609375,37778931862991521447936,119536217842634956361825,354117672677768017824000,989209827830318138410879,2621440000000256000000000,6624248320165910202813681,16032488606509786457516800,37307735463796255857284975,83749764955013897439412224,181898940354587554931640625,383233632600183659989150976,785021449541044618619009775,1566652225014709504963379200,3051630623295002998362412769,5811307335000009841500000000,10835331109985211317168219071,19807040628566101990572032000,35541427092480012403900735425,62671404580248339259228459264,108708335736972304651349609375,185659646372829690611073417216,312465995495421128855008462225,518630842213417328115366982400,849566810664416093051627770959,1374389534720000131072000000000,2197168084834401742996209222161,3473013903282936715999940179200,5430885671830208558750453311375,8405641386529486752917658927104,12882725884179993902891712890625,19559998010842339690636019750656,29432645871939743213296598374175,43908996768733634403021461913600,64967405723561510872792871804449,95367431640625000976562500000000,138932339909343565634005384821951,200924794768683668806532507238400,288543653687247217846031314667825,411577325736973203954049248639744,583258537754197564434565005859375,821376961748509246567567427895296,1149720465664695466063366516400625,1599933316226086732757987337452800,2213901148343972228766812807592239,3046798700052480005038848000000000,4170968111636714185655239970257441,5680834076991919546835722826489600,7699108570367854902983329454459775,10384593717069655266068191913181184,13941958335642300717953688962890625,18633943727462148588605481715835136,24796549714202131896875481292196575,32857865364569225392490568826880000,43361343350598715034354120127973329,56994475926865715020176803500000000,74624018143601556590972610501007631,97339124677518106233764527787212800,126504025836542412978482542720342225,163822171846303318769714565189895424,211414129262266214974514007568359375,271911927002388100854835196943794176,348573030827116574591391976165417025,445417684029625329930398773635475200,567393999853440477559842445949546719,720575940379279360067108864000000000,912400181570036563754573306576791521 mov $1,$0 pow $0,9 mov $2,$1 pow $2,10 mul $2,$0 add $0,$2 div $0,2
hmi_sdk/hmi_sdk/Tools/ffmpeg-2.6.2/libavcodec/x86/h264_weight.asm
APCVSRepo/android_packet
4
91945
<reponame>APCVSRepo/android_packet ;***************************************************************************** ;* SSE2-optimized weighted prediction code ;***************************************************************************** ;* Copyright (c) 2004-2005 <NAME>, <NAME> ;* Copyright (C) 2010 <NAME> <<EMAIL>> ;* ;* This file is part of FFmpeg. ;* ;* FFmpeg is free software; you can redistribute it and/or ;* modify it under the terms of the GNU Lesser General Public ;* License as published by the Free Software Foundation; either ;* version 2.1 of the License, or (at your option) any later version. ;* ;* FFmpeg is distributed in the hope that it will be useful, ;* but WITHOUT ANY WARRANTY; without even the implied warranty of ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;* Lesser General Public License for more details. ;* ;* You should have received a copy of the GNU Lesser General Public ;* License along with FFmpeg; if not, write to the Free Software ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;****************************************************************************** %include "libavutil/x86/x86util.asm" SECTION .text ;----------------------------------------------------------------------------- ; biweight pred: ; ; void ff_h264_biweight_16_sse2(uint8_t *dst, uint8_t *src, int stride, ; int height, int log2_denom, int weightd, ; int weights, int offset); ; and ; void ff_h264_weight_16_sse2(uint8_t *dst, int stride, int height, ; int log2_denom, int weight, int offset); ;----------------------------------------------------------------------------- %macro WEIGHT_SETUP 0 add r5, r5 inc r5 movd m3, r4d movd m5, r5d movd m6, r3d pslld m5, m6 psrld m5, 1 %if mmsize == 16 pshuflw m3, m3, 0 pshuflw m5, m5, 0 punpcklqdq m3, m3 punpcklqdq m5, m5 %else pshufw m3, m3, 0 pshufw m5, m5, 0 %endif pxor m7, m7 %endmacro %macro WEIGHT_OP 2 movh m0, [r0+%1] movh m1, [r0+%2] punpcklbw m0, m7 punpcklbw m1, m7 pmullw m0, m3 pmullw m1, m3 paddsw m0, m5 paddsw m1, m5 psraw m0, m6 psraw m1, m6 packuswb m0, m1 %endmacro INIT_MMX mmxext cglobal h264_weight_16, 6, 6, 0 WEIGHT_SETUP .nextrow: WEIGHT_OP 0, 4 mova [r0 ], m0 WEIGHT_OP 8, 12 mova [r0+8], m0 add r0, r1 dec r2d jnz .nextrow REP_RET %macro WEIGHT_FUNC_MM 2 cglobal h264_weight_%1, 6, 6, %2 WEIGHT_SETUP .nextrow: WEIGHT_OP 0, mmsize/2 mova [r0], m0 add r0, r1 dec r2d jnz .nextrow REP_RET %endmacro INIT_MMX mmxext WEIGHT_FUNC_MM 8, 0 INIT_XMM sse2 WEIGHT_FUNC_MM 16, 8 %macro WEIGHT_FUNC_HALF_MM 2 cglobal h264_weight_%1, 6, 6, %2 WEIGHT_SETUP sar r2d, 1 lea r3, [r1*2] .nextrow: WEIGHT_OP 0, r1 movh [r0], m0 %if mmsize == 16 movhps [r0+r1], m0 %else psrlq m0, 32 movh [r0+r1], m0 %endif add r0, r3 dec r2d jnz .nextrow REP_RET %endmacro INIT_MMX mmxext WEIGHT_FUNC_HALF_MM 4, 0 INIT_XMM sse2 WEIGHT_FUNC_HALF_MM 8, 8 %macro BIWEIGHT_SETUP 0 %if ARCH_X86_64 %define off_regd r7d %else %define off_regd r3d %endif mov off_regd, r7m add off_regd, 1 or off_regd, 1 add r4, 1 cmp r5, 128 jne .normal sar r5, 1 sar r6, 1 sar off_regd, 1 sub r4, 1 .normal %if cpuflag(ssse3) movd m4, r5d movd m0, r6d %else movd m3, r5d movd m4, r6d %endif movd m5, off_regd movd m6, r4d pslld m5, m6 psrld m5, 1 %if cpuflag(ssse3) punpcklbw m4, m0 pshuflw m4, m4, 0 pshuflw m5, m5, 0 punpcklqdq m4, m4 punpcklqdq m5, m5 %else %if mmsize == 16 pshuflw m3, m3, 0 pshuflw m4, m4, 0 pshuflw m5, m5, 0 punpcklqdq m3, m3 punpcklqdq m4, m4 punpcklqdq m5, m5 %else pshufw m3, m3, 0 pshufw m4, m4, 0 pshufw m5, m5, 0 %endif pxor m7, m7 %endif %endmacro %macro BIWEIGHT_STEPA 3 movh m%1, [r0+%3] movh m%2, [r1+%3] punpcklbw m%1, m7 punpcklbw m%2, m7 pmullw m%1, m3 pmullw m%2, m4 paddsw m%1, m%2 %endmacro %macro BIWEIGHT_STEPB 0 paddsw m0, m5 paddsw m1, m5 psraw m0, m6 psraw m1, m6 packuswb m0, m1 %endmacro INIT_MMX mmxext cglobal h264_biweight_16, 7, 8, 0 BIWEIGHT_SETUP movifnidn r3d, r3m .nextrow: BIWEIGHT_STEPA 0, 1, 0 BIWEIGHT_STEPA 1, 2, 4 BIWEIGHT_STEPB mova [r0], m0 BIWEIGHT_STEPA 0, 1, 8 BIWEIGHT_STEPA 1, 2, 12 BIWEIGHT_STEPB mova [r0+8], m0 add r0, r2 add r1, r2 dec r3d jnz .nextrow REP_RET %macro BIWEIGHT_FUNC_MM 2 cglobal h264_biweight_%1, 7, 8, %2 BIWEIGHT_SETUP movifnidn r3d, r3m .nextrow: BIWEIGHT_STEPA 0, 1, 0 BIWEIGHT_STEPA 1, 2, mmsize/2 BIWEIGHT_STEPB mova [r0], m0 add r0, r2 add r1, r2 dec r3d jnz .nextrow REP_RET %endmacro INIT_MMX mmxext BIWEIGHT_FUNC_MM 8, 0 INIT_XMM sse2 BIWEIGHT_FUNC_MM 16, 8 %macro BIWEIGHT_FUNC_HALF_MM 2 cglobal h264_biweight_%1, 7, 8, %2 BIWEIGHT_SETUP movifnidn r3d, r3m sar r3, 1 lea r4, [r2*2] .nextrow: BIWEIGHT_STEPA 0, 1, 0 BIWEIGHT_STEPA 1, 2, r2 BIWEIGHT_STEPB movh [r0], m0 %if mmsize == 16 movhps [r0+r2], m0 %else psrlq m0, 32 movh [r0+r2], m0 %endif add r0, r4 add r1, r4 dec r3d jnz .nextrow REP_RET %endmacro INIT_MMX mmxext BIWEIGHT_FUNC_HALF_MM 4, 0 INIT_XMM sse2 BIWEIGHT_FUNC_HALF_MM 8, 8 %macro BIWEIGHT_SSSE3_OP 0 pmaddubsw m0, m4 pmaddubsw m2, m4 paddsw m0, m5 paddsw m2, m5 psraw m0, m6 psraw m2, m6 packuswb m0, m2 %endmacro INIT_XMM ssse3 cglobal h264_biweight_16, 7, 8, 8 BIWEIGHT_SETUP movifnidn r3d, r3m .nextrow: movh m0, [r0] movh m2, [r0+8] movh m3, [r1+8] punpcklbw m0, [r1] punpcklbw m2, m3 BIWEIGHT_SSSE3_OP mova [r0], m0 add r0, r2 add r1, r2 dec r3d jnz .nextrow REP_RET INIT_XMM ssse3 cglobal h264_biweight_8, 7, 8, 8 BIWEIGHT_SETUP movifnidn r3d, r3m sar r3, 1 lea r4, [r2*2] .nextrow: movh m0, [r0] movh m1, [r1] movh m2, [r0+r2] movh m3, [r1+r2] punpcklbw m0, m1 punpcklbw m2, m3 BIWEIGHT_SSSE3_OP movh [r0], m0 movhps [r0+r2], m0 add r0, r4 add r1, r4 dec r3d jnz .nextrow REP_RET
programs/oeis/289/A289721.asm
karttu/loda
0
83022
; A289721: Let a(0)=1. Then a(n) = sums of consecutive strings of positive integers of length 3*n, starting with the integer 2. ; 1,9,45,135,306,585,999,1575,2340,3321,4545,6039,7830,9945,12411,15255,18504,22185,26325,30951,36090,41769,48015,54855,62316,70425,79209,88695,98910,109881,121635,134199,147600,161865,177021,193095,210114,228105,247095,267111,288180,310329,333585,357975,383526,410265,438219,467415,497880,529641,562725,597159,632970,670185,708831,748935,790524,833625,878265,924471,972270,1021689,1072755,1125495,1179936,1236105,1294029,1353735,1415250,1478601,1543815,1610919,1679940,1750905,1823841,1898775,1975734,2054745,2135835,2219031,2304360,2391849,2481525,2573415,2667546,2763945,2862639,2963655,3067020,3172761,3280905,3391479,3504510,3620025,3738051,3858615,3981744,4107465,4235805,4366791,4500450,4636809,4775895,4917735,5062356,5209785,5360049,5513175,5669190,5828121,5989995,6154839,6322680,6493545,6667461,6844455,7024554,7207785,7394175,7583751,7776540,7972569,8171865,8374455,8580366,8789625,9002259,9218295,9437760,9660681,9887085,10116999,10350450,10587465,10828071,11072295,11320164,11571705,11826945,12085911,12348630,12615129,12885435,13159575,13437576,13719465,14005269,14295015,14588730,14886441,15188175,15493959,15803820,16117785,16435881,16758135,17084574,17415225,17750115,18089271,18432720,18780489,19132605,19489095,19849986,20215305,20585079,20959335,21338100,21721401,22109265,22501719,22898790,23300505,23706891,24117975,24533784,24954345,25379685,25809831,26244810,26684649,27129375,27579015,28033596,28493145,28957689,29427255,29901870,30381561,30866355,31356279,31851360,32351625,32857101,33367815,33883794,34405065,34931655,35463591,36000900,36543609,37091745,37645335,38204406,38768985,39339099,39914775,40496040,41082921,41675445,42273639,42877530,43487145,44102511,44723655,45350604,45983385,46622025,47266551,47916990,48573369,49235715,49904055,50578416,51258825,51945309,52637895,53336610,54041481,54752535,55469799,56193300,56923065,57659121,58401495,59150214,59905305,60666795,61434711,62209080,62989929,63777285,64571175,65371626,66178665,66992319,67812615,68639580,69473241 mov $2,$0 add $2,$0 mov $3,2 mov $5,$0 lpb $3,1 add $2,1 add $2,$0 trn $0,1 lpb $2,1 add $4,$0 add $1,$4 sub $2,1 lpe sub $3,$3 lpe lpb $5,1 add $1,8 sub $5,1 lpe add $1,1
alloy4fun_models/trashltl/models/11/2nwXkQWCBzstRRMM7.als
Kaixi26/org.alloytools.alloy
0
1771
<reponame>Kaixi26/org.alloytools.alloy open main pred id2nwXkQWCBzstRRMM7_prop12 { always (eventually File in Trash) } pred __repair { id2nwXkQWCBzstRRMM7_prop12 } check __repair { id2nwXkQWCBzstRRMM7_prop12 <=> prop12o }
lemmas-progress-checks.agda
hazelgrove/hazelnut-agda
0
12033
open import Nat open import Prelude open import dynamics-core module lemmas-progress-checks where -- boxed values don't have an instruction transition boxedval-not-trans : ∀{d d'} → d boxedval → d →> d' → ⊥ boxedval-not-trans (BVVal VNum) () boxedval-not-trans (BVVal VLam) () boxedval-not-trans (BVArrCast x bv) (ITCastID) = x refl boxedval-not-trans (BVHoleCast () bv) (ITCastID) boxedval-not-trans (BVHoleCast () bv) (ITCastSucceed x₁) boxedval-not-trans (BVHoleCast GArrHole bv) (ITGround (MGArr x)) = x refl boxedval-not-trans (BVHoleCast x a) (ITExpand ()) boxedval-not-trans (BVHoleCast x x₁) (ITCastFail x₂ () x₄) boxedval-not-trans (BVVal (VInl x)) () boxedval-not-trans (BVVal (VInr x)) () boxedval-not-trans (BVSumCast x x₁) ITCastID = x refl boxedval-not-trans (BVHoleCast GSumHole x₁) (ITGround (MGSum x₂)) = x₂ refl boxedval-not-trans (BVInl bv) () boxedval-not-trans (BVInr bv) () boxedval-not-trans (BVPair bv bv₁) () boxedval-not-trans (BVProdCast x bv) ITCastID = x refl boxedval-not-trans (BVHoleCast GProdHole bv) (ITGround (MGProd x)) = x refl -- indets don't have an instruction transition indet-not-trans : ∀{d d'} → d indet → d →> d' → ⊥ indet-not-trans IEHole () indet-not-trans (INEHole x) () indet-not-trans (IAp x₁ () x₂) (ITLam) indet-not-trans (IAp x (ICastArr x₁ ind) x₂) ITApCast = x _ _ _ _ _ refl indet-not-trans (ICastArr x ind) (ITCastID) = x refl indet-not-trans (ICastGroundHole () ind) (ITCastID) indet-not-trans (ICastGroundHole x ind) (ITCastSucceed ()) indet-not-trans (ICastGroundHole GArrHole ind) (ITGround (MGArr x)) = x refl indet-not-trans (ICastHoleGround x ind ()) (ITCastID) indet-not-trans (ICastHoleGround x ind x₁) (ITCastSucceed x₂) = x _ _ refl indet-not-trans (ICastHoleGround x ind GArrHole) (ITExpand (MGArr x₂)) = x₂ refl indet-not-trans (ICastGroundHole x a) (ITExpand ()) indet-not-trans (ICastHoleGround x a x₁) (ITGround ()) indet-not-trans (ICastGroundHole x x₁) (ITCastFail x₂ () x₄) indet-not-trans (ICastHoleGround x x₁ x₂) (ITCastFail x₃ x₄ x₅) = x _ _ refl indet-not-trans (IFailedCast x x₁ x₂ x₃) () indet-not-trans (IPlus1 () x₁) (ITPlus x₂) indet-not-trans (IPlus2 x ()) (ITPlus x₂) indet-not-trans (ICase x x₂ x₃ (IInl x₄)) ITCaseInl = x _ _ refl indet-not-trans (ICase x x₂ x₃ (IInr x₄)) ITCaseInr = x₂ _ _ refl indet-not-trans (ICase x x₂ x₃ (ICastSum x₁ x₄)) ITCaseCast = x₃ _ _ _ _ _ refl indet-not-trans (ICastSum x x₂) ITCastID = x refl indet-not-trans (ICastGroundHole GSumHole x₂) (ITGround (MGSum x₁)) = x₁ refl indet-not-trans (ICastGroundHole GProdHole ind) (ITGround (MGProd x)) = x refl indet-not-trans (ICastHoleGround x x₂ GSumHole) (ITExpand (MGSum x₁)) = x₁ refl indet-not-trans (ICastHoleGround x ind GProdHole) (ITExpand (MGProd x₁)) = x₁ refl indet-not-trans (IInl ind) () indet-not-trans (IInr ind) () indet-not-trans (IPair1 ind x) () indet-not-trans (IPair2 x ind) () indet-not-trans (IFst x x₁ ind) ITFstPair = x _ _ refl indet-not-trans (IFst x x₁ ind) ITFstCast = x₁ _ _ _ _ _ refl indet-not-trans (ISnd x x₁ ind) ITSndPair = x _ _ refl indet-not-trans (ISnd x x₁ ind) ITSndCast = x₁ _ _ _ _ _ refl indet-not-trans (ICastProd x ind) ITCastID = x refl indet-not-trans (ICastGroundHole GNum ind) (ITGround ()) indet-not-trans (ICastHoleGround x ind GNum) (ITExpand ()) -- finals don't have an instruction transition final-not-trans : ∀{d d'} → d final → d →> d' → ⊥ final-not-trans (FBoxedVal x) = boxedval-not-trans x final-not-trans (FIndet x) = indet-not-trans x -- finals cast from a ground are still final final-gnd-cast : ∀{ d τ } → d final → τ ground → (d ⟨ τ ⇒ ⦇-⦈ ⟩) final final-gnd-cast (FBoxedVal x) gnd = FBoxedVal (BVHoleCast gnd x) final-gnd-cast (FIndet x) gnd = FIndet (ICastGroundHole gnd x) -- if an expression results from filling a hole in an evaluation context, -- the hole-filler must have been final final-sub-final : ∀{d ε x} → d final → d == ε ⟦ x ⟧ → x final final-sub-final x FHOuter = x final-sub-final (FBoxedVal (BVVal ())) (FHPlus1 eps) final-sub-final (FBoxedVal (BVVal ())) (FHPlus2 eps) final-sub-final (FBoxedVal (BVVal ())) (FHAp1 eps) final-sub-final (FBoxedVal (BVVal ())) (FHAp2 eps) final-sub-final (FBoxedVal (BVVal ())) (FHNEHole eps) final-sub-final (FBoxedVal (BVVal ())) (FHCast eps) final-sub-final (FBoxedVal (BVVal ())) (FHFailedCast y) final-sub-final (FBoxedVal (BVArrCast x₁ x₂)) (FHCast eps) = final-sub-final (FBoxedVal x₂) eps final-sub-final (FBoxedVal (BVHoleCast x₁ x₂)) (FHCast eps) = final-sub-final (FBoxedVal x₂) eps final-sub-final (FIndet (IPlus1 x x₁)) (FHPlus1 eps) = final-sub-final (FIndet x) eps final-sub-final (FIndet (IPlus2 x x₁)) (FHPlus1 eps) = final-sub-final x eps final-sub-final (FIndet (IPlus1 x x₁)) (FHPlus2 eps) = final-sub-final x₁ eps final-sub-final (FIndet (IPlus2 x x₁)) (FHPlus2 eps) = final-sub-final (FIndet x₁) eps final-sub-final (FIndet (IAp x₁ x₂ x₃)) (FHAp1 eps) = final-sub-final (FIndet x₂) eps final-sub-final (FIndet (IAp x₁ x₂ x₃)) (FHAp2 eps) = final-sub-final x₃ eps final-sub-final (FIndet (INEHole x₁)) (FHNEHole eps) = final-sub-final x₁ eps final-sub-final (FIndet (ICastArr x₁ x₂)) (FHCast eps) = final-sub-final (FIndet x₂) eps final-sub-final (FIndet (ICastGroundHole x₁ x₂)) (FHCast eps) = final-sub-final (FIndet x₂) eps final-sub-final (FIndet (ICastHoleGround x₁ x₂ x₃)) (FHCast eps) = final-sub-final (FIndet x₂) eps final-sub-final (FIndet (IFailedCast x₁ x₂ x₃ x₄)) (FHFailedCast y) = final-sub-final x₁ y final-sub-final (FBoxedVal (BVVal ())) (FHCase eps) final-sub-final (FBoxedVal (BVSumCast x x₁)) (FHCast eps) = final-sub-final (FBoxedVal x₁) eps final-sub-final (FIndet (ICase x x₁ x₂ x₃)) (FHCase eps) = final-sub-final (FIndet x₃) eps final-sub-final (FIndet (ICastSum x x₁)) (FHCast eps) = final-sub-final (FIndet x₁) eps final-sub-final (FBoxedVal (BVVal (VInl x))) (FHInl eps) = final-sub-final (FBoxedVal (BVVal x)) eps final-sub-final (FBoxedVal (BVInl x)) (FHInl eps) = final-sub-final (FBoxedVal x) eps final-sub-final (FIndet (IInl x)) (FHInl eps) = final-sub-final (FIndet x) eps final-sub-final (FBoxedVal (BVVal (VInr x))) (FHInr eps) = final-sub-final (FBoxedVal (BVVal x)) eps final-sub-final (FBoxedVal (BVInr x)) (FHInr eps) = final-sub-final (FBoxedVal x) eps final-sub-final (FBoxedVal (BVProdCast x x₁)) (FHCast eps) = final-sub-final (FBoxedVal x₁) eps final-sub-final (FIndet (IInr x)) (FHInr eps) = final-sub-final (FIndet x) eps final-sub-final (FBoxedVal (BVVal ())) (FHFst eps) final-sub-final (FBoxedVal (BVVal ())) (FHSnd eps) final-sub-final (FBoxedVal (BVVal (VPair x x₁))) (FHPair1 eps) = final-sub-final (FBoxedVal (BVVal x)) eps final-sub-final (FBoxedVal (BVPair x x₁)) (FHPair1 eps) = final-sub-final (FBoxedVal x) eps final-sub-final (FBoxedVal (BVVal (VPair x x₁))) (FHPair2 eps) = final-sub-final (FBoxedVal (BVVal x₁)) eps final-sub-final (FBoxedVal (BVPair x x₁)) (FHPair2 eps) = final-sub-final (FBoxedVal x₁) eps final-sub-final (FIndet (IFst x x₁ x₂)) (FHFst eps) = final-sub-final (FIndet x₂) eps final-sub-final (FIndet (ISnd x x₁ x₂)) (FHSnd eps) = final-sub-final (FIndet x₂) eps final-sub-final (FIndet (IPair1 x x₁)) (FHPair1 eps) = final-sub-final (FIndet x) eps final-sub-final (FIndet (IPair2 x x₁)) (FHPair1 eps) = final-sub-final x eps final-sub-final (FIndet (IPair1 x x₁)) (FHPair2 eps) = final-sub-final x₁ eps final-sub-final (FIndet (IPair2 x x₁)) (FHPair2 eps) = final-sub-final (FIndet x₁) eps final-sub-final (FIndet (ICastProd x x₁)) (FHCast eps) = final-sub-final (FIndet x₁) eps final-sub-not-trans : ∀{d d' d'' ε} → d final → d == ε ⟦ d' ⟧ → d' →> d'' → ⊥ final-sub-not-trans f sub step = final-not-trans (final-sub-final f sub) step
List 01/ex 07 (buble sort).asm
LeonardoSanBenitez/Assembly-exercises
0
86252
<reponame>LeonardoSanBenitez/Assembly-exercises # Title: Exercice 07 # Author: <NAME> # Brief: Buble sort in an integer array, in crescent order (the order can be easily changed in code) # Varibles map # s0 (i) = outer counter # s1 (j) = inner counter # s2 (n) = array size # s3 = array addr # Pseudo code C # for (i=4; i <= n-4 ; i+=4) # for(j=0; j <= n - i - 4; j+=4) # if(a[j] < a[j+4]){ # temp=a[j+4]; # a[j+4]=a[j]; # a[j]=temp; # } ## debug init addi $t0, $zero, 8 addi $t1, $zero, 5 addi $t2, $zero, 1 addi $t3, $zero, 3 addi $t4, $zero, 2 addi $t5, $zero, 20 addi $t6, $zero, 7 addi $t7, $zero, 666 sw $t0, 0 ($gp) sw $t1, 4 ($gp) sw $t2, 8 ($gp) sw $t3, 12 ($gp) sw $t4, 16 ($gp) sw $t5, 20 ($gp) sw $t6, 24 ($gp) sw $t7, 28 ($gp) ## debug end addi $t0, $zero, 28 # array size (in bits) add $s3, $zero, $gp # array addr: 0x00 addi $s2, $t0, -4 # s2 = max comparation position addi $s0, $zero, 4 # i = 4 for1b: bgt $s0, $s2, for1e # for (i=4; i <= n-4 ; i+=4) addi $s1, $zero, 0 for2b: sub $t0, $s2, $s0 bgt $s1, $t0, for2e # for(j=0; j <= n - i - 4; j+=4) add $t0, $s1, $s3 # t0 = [j] addr lw $t1, 0($t0) # t1 = a[j] lw $t2, 4($t0) # t2 = a[j+4] bge $t1, $t2, if1e # if(a[j] < a[j+4]) ## CHANGE ORDER HERE sw $t1, 4 ($t0) # a[j+4]=a[j]; sw $t2, 0 ($t0) # a[j]= a[j+4] before change ; if1e: addi $s1, $s1, 4 # j+=4 j for2b # end of inner loop for2e: addi $s0, $s0, 4 # i+=4 j for1b # end of outer loop for1e:
bin/grab-mail-link.scpt
andrewsardone/dotfiles
16
2351
<filename>bin/grab-mail-link.scpt #!/usr/bin/env osascript -- https://thesweetsetup.com/working-email-urls-macos/ tell application "Mail" set selectedMessages to selection set theMessage to item 1 of selectedMessages set messageid to message id of theMessage -- Make URL (must use URL-encoded values for "<" and ">") set messageidEncoded to do shell script "php -r 'echo urlencode(\"" & messageid & "\");'" set urlText to "message://" & "%3C" & messageidEncoded & "%3E" set the clipboard to urlText end tell
library/fmGUI_Menus/fmGUI_ClickMenuItem.applescript
NYHTC/applescript-fm-helper
1
3789
-- fmGUI_ClickMenuItem({menuItemRef:null, waitForMenuAvailable: null}) -- <NAME>, NYHTC -- click on a menu item in FileMaker (* HISTORY: 1.1 - 2017-11-06 ( eshagdar ): we should not wait for the menu item to be available since clicking it may disable it ( e.g. manage DB ). Instead, briefly delay, then exit. 1.0 - 2016-10-18 ( eshagdar ): first created REQUIRES: fmGUI_AppFrontMost *) on run tell application "System Events" tell application process "FileMaker Pro Advanced" set frontmost to true --set someMenuItem to menu item "Copy" of menu 1 of menu bar item "Edit" of menu bar 1 --set someMenuItem to first menu item of menu 1 of menu item "Manage" of menu 1 of menu bar item "File" of menu bar 1 whose name starts with "Scripts" set someMenuItem to menu item "Select All" of menu 1 of menu bar item "Edit" of menu bar 1 end tell end tell --set someMenuItem to coerceToString(someMenuItem) fmGUI_ClickMenuItem({menuItemRef:someMenuItem}) end run -------------------- -- START OF CODE -------------------- on fmGUI_ClickMenuItem(prefs) -- version 1.1, <NAME> set defaultPrefs to {menuItemRef:null, waitForMenuAvailable:false} set prefs to prefs & defaultPrefs set menuItemRef to ensureObjectRef(menuItemRef of prefs) try fmGUI_AppFrontMost() tell application "System Events" tell application process "FileMaker Pro Advanced" click menuItemRef end tell end tell if waitForMenuAvailable of prefs then return fmGUI_Wait_MenuItemAvailable({menuItemRef:menuItemRef}) delay 0.1 -- pause to give a chance for menus to redraw return true on error errMsg number errNum error "Unable to fmGUI_ClickMenuItem - " & errMsg number errNum end try end fmGUI_ClickMenuItem -------------------- -- END OF CODE -------------------- on fmGUI_AppFrontMost() tell application "htcLib" to fmGUI_AppFrontMost() end fmGUI_AppFrontMost on fmGUI_Wait_MenuItemAvailable(prefs) set prefs to {menuItemRef:my coerceToString(menuItemRef of prefs)} & prefs tell application "htcLib" to fmGUI_Wait_MenuItemAvailable(prefs) end fmGUI_Wait_MenuItemAvailable on coerceToString(incomingObject) -- 2017-07-12 ( eshagdar ): bootstrap code to bring a coerceToString into this file for the sample to run ( instead of having a copy of the handler locally ). tell application "Finder" to set coercePath to (container of (container of (path to me)) as text) & "text parsing:coerceToString.applescript" set codeCoerce to read file coercePath as text tell application "htcLib" to set codeCoerce to "script codeCoerce " & return & getTextBetween({sourceText:codeCoerce, beforeText:"-- START OF CODE", afterText:"-- END OF CODE"}) & return & "end script" & return & "return codeCoerce" set codeCoerce to run script codeCoerce tell codeCoerce to coerceToString(incomingObject) end coerceToString on ensureObjectRef(someObjectRef) -- 2017-07-12 ( eshagdar ): bootstrap code to bring a ensureObjectRef into this file for the sample to run ( instead of having a copy of the handler locally ). tell application "Finder" to set ensureObjPath to (container of (container of (path to me)) as text) & "text parsing:ensureObjectRef.applescript" set codeEnsureObj to read file ensureObjPath as text tell application "htcLib" to set codeEnsureObj to "script codeEnsureObj " & return & getTextBetween({sourceText:codeEnsureObj, beforeText:"-- START OF CODE", afterText:"-- END OF CODE"}) & return & "end script" & return & "return codeEnsureObj" set codeEnsureObj to run script codeEnsureObj tell codeEnsureObj to ensureObjectRef(someObjectRef) end ensureObjectRef
oeis/178/A178301.asm
neoneye/loda-programs
11
18974
<reponame>neoneye/loda-programs<gh_stars>10-100 ; A178301: Triangle T(n,k) = binomial(n,k)*binomial(n+k+1,n+1) read by rows, 0 <= k <= n. ; Submitted by <NAME> ; 1,1,3,1,8,10,1,15,45,35,1,24,126,224,126,1,35,280,840,1050,462,1,48,540,2400,4950,4752,1716,1,63,945,5775,17325,27027,21021,6435,1,80,1540,12320,50050,112112,140140,91520,24310,1,99,2376,24024,126126,378378,672672,700128,393822,92378,1,120,3510,43680,286650,1100736,2598960,3818880,3401190,1679600,352716,1,143,5005,75075,600600,2858856,8576568,16628040,20785050,16166150,7113106,1352078,1,168,6930,123200,1178100,6785856,25069968,61395840,100727550,109432400,75508356,29953728,5200300,1,195,9360 lpb $0 mov $1,$0 add $2,1 sub $0,$2 add $1,1 lpe bin $1,$0 bin $2,$0 mul $1,$2 mov $0,$1
source/amf/uml/amf-uml-operations.ads
svn2github/matreshka
24
22655
<gh_stars>10-100 ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ -- Operation specializes TemplateableElement in order to support -- specification of template operations and bound operations. Operation -- specializes ParameterableElement to specify that an operation can be -- exposed as a formal template parameter, and provided as an actual -- parameter in a binding of a template. -- -- An operation may invoke both the execution of method behaviors as well as -- other behavioral responses. -- -- An operation is a behavioral feature of a classifier that specifies the -- name, type, parameters, and constraints for invoking an associated -- behavior. ------------------------------------------------------------------------------ with AMF.UML.Behavioral_Features; limited with AMF.UML.Classes; limited with AMF.UML.Constraints.Collections; limited with AMF.UML.Data_Types; limited with AMF.UML.Interfaces; limited with AMF.UML.Operation_Template_Parameters; limited with AMF.UML.Operations.Collections; with AMF.UML.Parameterable_Elements; limited with AMF.UML.Parameters.Collections; limited with AMF.UML.Redefinable_Elements; with AMF.UML.Templateable_Elements; limited with AMF.UML.Types.Collections; package AMF.UML.Operations is pragma Preelaborate; type UML_Operation is limited interface and AMF.UML.Behavioral_Features.UML_Behavioral_Feature and AMF.UML.Templateable_Elements.UML_Templateable_Element and AMF.UML.Parameterable_Elements.UML_Parameterable_Element; type UML_Operation_Access is access all UML_Operation'Class; for UML_Operation_Access'Storage_Size use 0; not overriding function Get_Body_Condition (Self : not null access constant UML_Operation) return AMF.UML.Constraints.UML_Constraint_Access is abstract; -- Getter of Operation::bodyCondition. -- -- An optional Constraint on the result values of an invocation of this -- Operation. not overriding procedure Set_Body_Condition (Self : not null access UML_Operation; To : AMF.UML.Constraints.UML_Constraint_Access) is abstract; -- Setter of Operation::bodyCondition. -- -- An optional Constraint on the result values of an invocation of this -- Operation. not overriding function Get_Class (Self : not null access constant UML_Operation) return AMF.UML.Classes.UML_Class_Access is abstract; -- Getter of Operation::class. -- -- The class that owns the operation. not overriding procedure Set_Class (Self : not null access UML_Operation; To : AMF.UML.Classes.UML_Class_Access) is abstract; -- Setter of Operation::class. -- -- The class that owns the operation. not overriding function Get_Datatype (Self : not null access constant UML_Operation) return AMF.UML.Data_Types.UML_Data_Type_Access is abstract; -- Getter of Operation::datatype. -- -- The DataType that owns this Operation. not overriding procedure Set_Datatype (Self : not null access UML_Operation; To : AMF.UML.Data_Types.UML_Data_Type_Access) is abstract; -- Setter of Operation::datatype. -- -- The DataType that owns this Operation. not overriding function Get_Interface (Self : not null access constant UML_Operation) return AMF.UML.Interfaces.UML_Interface_Access is abstract; -- Getter of Operation::interface. -- -- The Interface that owns this Operation. not overriding procedure Set_Interface (Self : not null access UML_Operation; To : AMF.UML.Interfaces.UML_Interface_Access) is abstract; -- Setter of Operation::interface. -- -- The Interface that owns this Operation. not overriding function Get_Is_Ordered (Self : not null access constant UML_Operation) return Boolean is abstract; -- Getter of Operation::isOrdered. -- -- This information is derived from the return result for this Operation. -- Specifies whether the return parameter is ordered or not, if present. not overriding function Get_Is_Query (Self : not null access constant UML_Operation) return Boolean is abstract; -- Getter of Operation::isQuery. -- -- Specifies whether an execution of the BehavioralFeature leaves the -- state of the system unchanged (isQuery=true) or whether side effects -- may occur (isQuery=false). not overriding procedure Set_Is_Query (Self : not null access UML_Operation; To : Boolean) is abstract; -- Setter of Operation::isQuery. -- -- Specifies whether an execution of the BehavioralFeature leaves the -- state of the system unchanged (isQuery=true) or whether side effects -- may occur (isQuery=false). not overriding function Get_Is_Unique (Self : not null access constant UML_Operation) return Boolean is abstract; -- Getter of Operation::isUnique. -- -- This information is derived from the return result for this Operation. -- Specifies whether the return parameter is unique or not, if present. not overriding function Get_Lower (Self : not null access constant UML_Operation) return AMF.Optional_Integer is abstract; -- Getter of Operation::lower. -- -- Specifies the lower multiplicity of the return parameter, if present. -- This information is derived from the return result for this Operation. overriding function Get_Owned_Parameter (Self : not null access constant UML_Operation) return AMF.UML.Parameters.Collections.Ordered_Set_Of_UML_Parameter is abstract; -- Getter of Operation::ownedParameter. -- -- Specifies the ordered set of formal parameters of this -- BehavioralFeature. -- Specifies the parameters owned by this Operation. not overriding function Get_Postcondition (Self : not null access constant UML_Operation) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is abstract; -- Getter of Operation::postcondition. -- -- An optional set of Constraints specifying the state of the system when -- the Operation is completed. not overriding function Get_Precondition (Self : not null access constant UML_Operation) return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is abstract; -- Getter of Operation::precondition. -- -- An optional set of Constraints on the state of the system when the -- Operation is invoked. overriding function Get_Raised_Exception (Self : not null access constant UML_Operation) return AMF.UML.Types.Collections.Set_Of_UML_Type is abstract; -- Getter of Operation::raisedException. -- -- References the Types representing exceptions that may be raised during -- an invocation of this operation. not overriding function Get_Redefined_Operation (Self : not null access constant UML_Operation) return AMF.UML.Operations.Collections.Set_Of_UML_Operation is abstract; -- Getter of Operation::redefinedOperation. -- -- References the Operations that are redefined by this Operation. not overriding function Get_Template_Parameter (Self : not null access constant UML_Operation) return AMF.UML.Operation_Template_Parameters.UML_Operation_Template_Parameter_Access is abstract; -- Getter of Operation::templateParameter. -- -- The template parameter that exposes this element as a formal parameter. not overriding procedure Set_Template_Parameter (Self : not null access UML_Operation; To : AMF.UML.Operation_Template_Parameters.UML_Operation_Template_Parameter_Access) is abstract; -- Setter of Operation::templateParameter. -- -- The template parameter that exposes this element as a formal parameter. not overriding function Get_Type (Self : not null access constant UML_Operation) return AMF.UML.Types.UML_Type_Access is abstract; -- Getter of Operation::type. -- -- This information is derived from the return result for this Operation. -- Specifies the return result of the operation, if present. not overriding function Get_Upper (Self : not null access constant UML_Operation) return AMF.Optional_Unlimited_Natural is abstract; -- Getter of Operation::upper. -- -- Specifies the upper multiplicity of the return parameter, if present. -- This information is derived from the return result for this Operation. overriding function Is_Consistent_With (Self : not null access constant UML_Operation; Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return Boolean is abstract; -- Operation Operation::isConsistentWith. -- -- A redefining operation is consistent with a redefined operation if it -- has the same number of owned parameters, and the type of each owned -- parameter conforms to the type of the corresponding redefined parameter. -- The query isConsistentWith() specifies, for any two Operations in a -- context in which redefinition is possible, whether redefinition would -- be consistent in the sense of maintaining type covariance. Other senses -- of consistency may be required, for example to determine consistency in -- the sense of contravariance. Users may define alternative queries under -- names different from 'isConsistentWith()', as for example, users may -- define a query named 'isContravariantWith()'. not overriding function Is_Ordered (Self : not null access constant UML_Operation) return Boolean is abstract; -- Operation Operation::isOrdered. -- -- If this operation has a return parameter, isOrdered equals the value of -- isOrdered for that parameter. Otherwise isOrdered is false. not overriding function Is_Unique (Self : not null access constant UML_Operation) return Boolean is abstract; -- Operation Operation::isUnique. -- -- If this operation has a return parameter, isUnique equals the value of -- isUnique for that parameter. Otherwise isUnique is true. not overriding function Lower (Self : not null access constant UML_Operation) return Integer is abstract; -- Operation Operation::lower. -- -- If this operation has a return parameter, lower equals the value of -- lower for that parameter. Otherwise lower is not defined. not overriding function Return_Result (Self : not null access constant UML_Operation) return AMF.UML.Parameters.Collections.Set_Of_UML_Parameter is abstract; -- Operation Operation::returnResult. -- -- The query returnResult() returns the set containing the return -- parameter of the Operation if one exists, otherwise, it returns an -- empty set not overriding function Types (Self : not null access constant UML_Operation) return AMF.UML.Types.UML_Type_Access is abstract; -- Operation Operation::type. -- -- If this operation has a return parameter, type equals the value of type -- for that parameter. Otherwise type is not defined. not overriding function Upper (Self : not null access constant UML_Operation) return AMF.Unlimited_Natural is abstract; -- Operation Operation::upper. -- -- If this operation has a return parameter, upper equals the value of -- upper for that parameter. Otherwise upper is not defined. end AMF.UML.Operations;
src/ada-pulse/src/pulse-proplist.ads
mstewartgallus/linted
0
22459
<filename>src/ada-pulse/src/pulse-proplist.ads -- Copyright 2016 <NAME> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -- implied. See the License for the specific language governing -- permissions and limitations under the License. with System; with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; with Libc.Stddef; package Pulse.Proplist with Spark_Mode => Off is -- unsupported macro: PA_PROP_MEDIA_NAME "media.name" -- unsupported macro: PA_PROP_MEDIA_TITLE "media.title" -- unsupported macro: PA_PROP_MEDIA_ARTIST "media.artist" -- unsupported macro: PA_PROP_MEDIA_COPYRIGHT "media.copyright" -- unsupported macro: PA_PROP_MEDIA_SOFTWARE "media.software" -- unsupported macro: PA_PROP_MEDIA_LANGUAGE "media.language" -- unsupported macro: PA_PROP_MEDIA_FILENAME "media.filename" -- unsupported macro: PA_PROP_MEDIA_ICON "media.icon" -- unsupported macro: PA_PROP_MEDIA_ICON_NAME "media.icon_name" -- unsupported macro: PA_PROP_MEDIA_ROLE "media.role" -- unsupported macro: PA_PROP_FILTER_WANT "filter.want" -- unsupported macro: PA_PROP_FILTER_APPLY "filter.apply" -- unsupported macro: PA_PROP_FILTER_SUPPRESS "filter.suppress" -- unsupported macro: PA_PROP_EVENT_ID "event.id" -- unsupported macro: PA_PROP_EVENT_DESCRIPTION "event.description" -- unsupported macro: PA_PROP_EVENT_MOUSE_X "event.mouse.x" -- unsupported macro: PA_PROP_EVENT_MOUSE_Y "event.mouse.y" -- unsupported macro: PA_PROP_EVENT_MOUSE_HPOS "event.mouse.hpos" -- unsupported macro: PA_PROP_EVENT_MOUSE_VPOS "event.mouse.vpos" -- unsupported macro: PA_PROP_EVENT_MOUSE_BUTTON "event.mouse.button" -- unsupported macro: PA_PROP_WINDOW_NAME "window.name" -- unsupported macro: PA_PROP_WINDOW_ID "window.id" -- unsupported macro: PA_PROP_WINDOW_ICON "window.icon" -- unsupported macro: PA_PROP_WINDOW_ICON_NAME "window.icon_name" -- unsupported macro: PA_PROP_WINDOW_X "window.x" -- unsupported macro: PA_PROP_WINDOW_Y "window.y" -- unsupported macro: PA_PROP_WINDOW_WIDTH "window.width" -- unsupported macro: PA_PROP_WINDOW_HEIGHT "window.height" -- unsupported macro: PA_PROP_WINDOW_HPOS "window.hpos" -- unsupported macro: PA_PROP_WINDOW_VPOS "window.vpos" -- unsupported macro: PA_PROP_WINDOW_DESKTOP "window.desktop" -- unsupported macro: PA_PROP_WINDOW_X11_DISPLAY "window.x11.display" -- unsupported macro: PA_PROP_WINDOW_X11_SCREEN "window.x11.screen" -- unsupported macro: PA_PROP_WINDOW_X11_MONITOR "window.x11.monitor" -- unsupported macro: PA_PROP_WINDOW_X11_XID "window.x11.xid" -- unsupported macro: PA_PROP_APPLICATION_NAME "application.name" -- unsupported macro: PA_PROP_APPLICATION_ID "application.id" -- unsupported macro: PA_PROP_APPLICATION_VERSION "application.version" -- unsupported macro: PA_PROP_APPLICATION_ICON "application.icon" -- unsupported macro: PA_PROP_APPLICATION_ICON_NAME "application.icon_name" -- unsupported macro: PA_PROP_APPLICATION_LANGUAGE "application.language" -- unsupported macro: PA_PROP_APPLICATION_PROCESS_ID "application.process.id" -- unsupported macro: PA_PROP_APPLICATION_PROCESS_BINARY "application.process.binary" -- unsupported macro: PA_PROP_APPLICATION_PROCESS_USER "application.process.user" -- unsupported macro: PA_PROP_APPLICATION_PROCESS_HOST "application.process.host" -- unsupported macro: PA_PROP_APPLICATION_PROCESS_MACHINE_ID "application.process.machine_id" -- unsupported macro: PA_PROP_APPLICATION_PROCESS_SESSION_ID "application.process.session_id" -- unsupported macro: PA_PROP_DEVICE_STRING "device.string" -- unsupported macro: PA_PROP_DEVICE_API "device.api" -- unsupported macro: PA_PROP_DEVICE_DESCRIPTION "device.description" -- unsupported macro: PA_PROP_DEVICE_BUS_PATH "device.bus_path" -- unsupported macro: PA_PROP_DEVICE_SERIAL "device.serial" -- unsupported macro: PA_PROP_DEVICE_VENDOR_ID "device.vendor.id" -- unsupported macro: PA_PROP_DEVICE_VENDOR_NAME "device.vendor.name" -- unsupported macro: PA_PROP_DEVICE_PRODUCT_ID "device.product.id" -- unsupported macro: PA_PROP_DEVICE_PRODUCT_NAME "device.product.name" -- unsupported macro: PA_PROP_DEVICE_CLASS "device.class" -- unsupported macro: PA_PROP_DEVICE_FORM_FACTOR "device.form_factor" -- unsupported macro: PA_PROP_DEVICE_BUS "device.bus" -- unsupported macro: PA_PROP_DEVICE_ICON "device.icon" -- unsupported macro: PA_PROP_DEVICE_ICON_NAME "device.icon_name" -- unsupported macro: PA_PROP_DEVICE_ACCESS_MODE "device.access_mode" -- unsupported macro: PA_PROP_DEVICE_MASTER_DEVICE "device.master_device" -- unsupported macro: PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE "device.buffering.buffer_size" -- unsupported macro: PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE "device.buffering.fragment_size" -- unsupported macro: PA_PROP_DEVICE_PROFILE_NAME "device.profile.name" -- unsupported macro: PA_PROP_DEVICE_INTENDED_ROLES "device.intended_roles" -- unsupported macro: PA_PROP_DEVICE_PROFILE_DESCRIPTION "device.profile.description" -- unsupported macro: PA_PROP_MODULE_AUTHOR "module.author" -- unsupported macro: PA_PROP_MODULE_DESCRIPTION "module.description" -- unsupported macro: PA_PROP_MODULE_USAGE "module.usage" -- unsupported macro: PA_PROP_MODULE_VERSION "module.version" -- unsupported macro: PA_PROP_FORMAT_SAMPLE_FORMAT "format.sample_format" -- unsupported macro: PA_PROP_FORMAT_RATE "format.rate" -- unsupported macro: PA_PROP_FORMAT_CHANNELS "format.channels" -- unsupported macro: PA_PROP_FORMAT_CHANNEL_MAP "format.channel_map" -- unsupported macro: PA_UPDATE_SET PA_UPDATE_SET -- unsupported macro: PA_UPDATE_MERGE PA_UPDATE_MERGE -- unsupported macro: PA_UPDATE_REPLACE PA_UPDATE_REPLACE type pa_proplist is limited private; type pa_proplist_access is access all pa_proplist; function pa_proplist_new return pa_proplist_access; -- /usr/include/pulse/proplist.h:277 pragma Import (C, pa_proplist_new, "pa_proplist_new"); procedure pa_proplist_free (p : pa_proplist_access); -- /usr/include/pulse/proplist.h:280 pragma Import (C, pa_proplist_free, "pa_proplist_free"); function pa_proplist_key_valid (key : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/pulse/proplist.h:283 pragma Import (C, pa_proplist_key_valid, "pa_proplist_key_valid"); function pa_proplist_sets (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr; value : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/pulse/proplist.h:289 pragma Import (C, pa_proplist_sets, "pa_proplist_sets"); function pa_proplist_setp (p : pa_proplist_access; pair : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/pulse/proplist.h:297 pragma Import (C, pa_proplist_setp, "pa_proplist_setp"); function pa_proplist_setf (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr; format : Interfaces.C.Strings.chars_ptr -- , ... ) return int; -- /usr/include/pulse/proplist.h:304 pragma Import (C, pa_proplist_setf, "pa_proplist_setf"); function pa_proplist_set (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr; data : System.Address; nbytes : Libc.Stddef.size_t) return int; -- /usr/include/pulse/proplist.h:309 pragma Import (C, pa_proplist_set, "pa_proplist_set"); function pa_proplist_gets (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings .chars_ptr; -- /usr/include/pulse/proplist.h:315 pragma Import (C, pa_proplist_gets, "pa_proplist_gets"); function pa_proplist_get (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr; data : System.Address; nbytes : access Libc.Stddef.size_t) return int; -- /usr/include/pulse/proplist.h:322 pragma Import (C, pa_proplist_get, "pa_proplist_get"); type pa_update_mode is (PA_UPDATE_SET, PA_UPDATE_MERGE, PA_UPDATE_REPLACE); pragma Convention (C, pa_update_mode); -- /usr/include/pulse/proplist.h:325 subtype pa_update_mode_t is pa_update_mode; procedure pa_proplist_update (p : pa_proplist_access; mode : pa_update_mode_t; other : System.Address); -- /usr/include/pulse/proplist.h:349 pragma Import (C, pa_proplist_update, "pa_proplist_update"); function pa_proplist_unset (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/pulse/proplist.h:353 pragma Import (C, pa_proplist_unset, "pa_proplist_unset"); function pa_proplist_unset_many (p : pa_proplist_access; keys : System.Address) return int; -- /usr/include/pulse/proplist.h:360 pragma Import (C, pa_proplist_unset_many, "pa_proplist_unset_many"); function pa_proplist_iterate (p : pa_proplist_access; state : System.Address) return Interfaces.C.Strings .chars_ptr; -- /usr/include/pulse/proplist.h:371 pragma Import (C, pa_proplist_iterate, "pa_proplist_iterate"); function pa_proplisto_string (p : pa_proplist_access) return Interfaces.C.Strings .chars_ptr; -- /usr/include/pulse/proplist.h:377 pragma Import (C, pa_proplisto_string, "pa_proplisto_string"); function pa_proplisto_string_sep (p : pa_proplist_access; sep : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings .chars_ptr; -- /usr/include/pulse/proplist.h:382 pragma Import (C, pa_proplisto_string_sep, "pa_proplisto_string_sep"); function pa_proplist_from_string (str : Interfaces.C.Strings.chars_ptr) return System.Address; -- /usr/include/pulse/proplist.h:386 pragma Import (C, pa_proplist_from_string, "pa_proplist_from_string"); function pa_proplist_contains (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/pulse/proplist.h:390 pragma Import (C, pa_proplist_contains, "pa_proplist_contains"); procedure pa_proplist_clear (p : pa_proplist_access); -- /usr/include/pulse/proplist.h:393 pragma Import (C, pa_proplist_clear, "pa_proplist_clear"); function pa_proplist_copy (p : pa_proplist_access) return System.Address; -- /usr/include/pulse/proplist.h:397 pragma Import (C, pa_proplist_copy, "pa_proplist_copy"); function pa_proplist_size (p : pa_proplist_access) return unsigned; -- /usr/include/pulse/proplist.h:400 pragma Import (C, pa_proplist_size, "pa_proplist_size"); function pa_proplist_isempty (p : pa_proplist_access) return int; -- /usr/include/pulse/proplist.h:403 pragma Import (C, pa_proplist_isempty, "pa_proplist_isempty"); function pa_proplist_equal (a : System.Address; b : System.Address) return int; -- /usr/include/pulse/proplist.h:407 pragma Import (C, pa_proplist_equal, "pa_proplist_equal"); private type pa_proplist is limited record null; end record; end Pulse.Proplist;
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca.log_16872_497.asm
ljhsiun2/medusa
9
3105
<reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca.log_16872_497.asm .global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r9 push %rax push %rdx lea addresses_normal_ht+0x7cb8, %r11 nop nop xor %rax, %rax mov (%r11), %r9w nop nop nop sub %rdx, %rdx lea addresses_A_ht+0x3158, %rdx clflush (%rdx) nop nop nop and %rax, %rax mov (%rdx), %r11 nop nop xor $48239, %r12 pop %rdx pop %rax pop %r9 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r12 push %r15 push %r9 push %rax push %rbp push %rbx push %rcx // Store lea addresses_RW+0x27f8, %rbx nop xor %rbp, %rbp movb $0x51, (%rbx) nop nop sub %r15, %r15 // Store lea addresses_RW+0xcf2c, %rbp clflush (%rbp) nop nop nop nop nop add $50906, %r12 movl $0x51525354, (%rbp) nop nop nop nop add $27318, %rbp // Load lea addresses_normal+0x86d8, %rbp dec %rbx movb (%rbp), %r15b nop nop nop add %rbx, %rbx // Store lea addresses_WT+0x19558, %rbp nop inc %rax movb $0x51, (%rbp) nop nop cmp %rbp, %rbp // Store lea addresses_UC+0x15958, %r12 clflush (%r12) nop nop nop nop nop sub $22893, %rbp movw $0x5152, (%r12) and $49860, %rbp // Faulty Load lea addresses_UC+0x15958, %rbx nop nop nop cmp $20247, %rax mov (%rbx), %rbp lea oracles, %r15 and $0xff, %rbp shlq $12, %rbp mov (%r15,%rbp,1), %rbp pop %rcx pop %rbx pop %rbp pop %rax pop %r9 pop %r15 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_RW'}} {'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_RW'}} {'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 1, 'NT': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT'}} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_UC'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'52': 16872} 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 */
examples/arinc653-sampling/sample-ada/cpu/pr1/main.adb
ana/pok
0
15909
<gh_stars>0 -- POK header -- -- The following file is a part of the POK project. Any modification should -- be made according to the POK licence. You CANNOT use this file or a part -- of a file for your own project. -- -- For more information on the POK licence, please see our LICENCE FILE -- -- Please follow the coding guidelines described in doc/CODING_GUIDELINES -- -- Copyright (c) 2007-2022 POK team package body Main is procedure Printf (String : in Interfaces.C.char_array); pragma Import (C, Printf, "printf"); Pr1_Pdataout_Id : Sampling_Port_Id_Type; procedure Send is T : Standard.Integer := 0; Data : Standard.Integer; Ret : Return_Code_Type; begin T := 3; loop Data := T; Printf ("Send..."); T := T + 1; Write_Sampling_Message (Pr1_Pdataout_Id, Data'Address, 4, Ret); Periodic_Wait (Ret); end loop; end Send; procedure Main is Ret : Return_Code_Type; Attr : Process_Attribute_Type; Id : Process_Id_Type; Port_Name : Sampling_Port_Name_Type := "pr1_pdataout "; begin Port_Name (13) := ASCII.NUL; Create_Sampling_Port (Port_Name, 4, Source, 15, Pr1_Pdataout_Id, Ret); Attr.Period := 1000; Attr.Deadline := Soft; Attr.Time_Capacity := 1; Attr.Stack_Size := 4096; Attr.Entry_Point := Send'Address; Create_Process (Attr, Id, Ret); Set_Partition_Mode (Normal, Ret); end Main; end Main;
tests/src/Safe_Alloc/sa_arrays_tests.adb
mhatzl/spark_unbound
8
2163
with Spark_Unbound.Safe_Alloc; with AUnit.Assertions; use AUnit.Assertions; with Ada.Exceptions; package body SA_Arrays_Tests is procedure TestAlloc_WithForcingStorageError_ResultNullReturned(T : in out Test_Fixture) is type Array_Type is array (Integer range <>) of Integer; type Array_Acc is access Array_Type; package Int_Arrays is new Spark_Unbound.Safe_Alloc.Arrays(Element_Type => Integer, Index_Type => Integer, Array_Type => Array_Type, Array_Type_Acc => Array_Acc); Arr_Acc : Array_Acc; Array_Last : Integer := 1_000_000_000; Storage_Error_Forced : Boolean := False; -- table to keep track of allocated arrays to be freed later type Acc_Table_Array is array (Integer range <>) of Array_Acc; Acc_Table : Acc_Table_Array(0 .. 1_000_000); Table_Index : Integer := Acc_Table'First; begin declare begin loop exit when (Storage_Error_Forced or else Table_Index >= Acc_Table'Last); begin Arr_Acc := Int_Arrays.Alloc(First => Integer'First, Last => Array_Last); begin Acc_Table(Table_Index) := Arr_Acc; Table_Index := Table_Index + 1; exception when others => Assert(False, "Table append failed"); end; if Arr_Acc = null then Storage_Error_Forced := True; elsif Array_Last < Integer'Last - Array_Last then Array_Last := Array_Last + Array_Last; else Array_Last := Integer'Last; end if; exception when E : others => Assert(False, "Alloc failed: " & Ada.Exceptions.Exception_Name(E) & " => " & Ada.Exceptions.Exception_Message(E)); end; end loop; -- free allocated for I in Acc_Table'First .. Acc_Table'Last loop Int_Arrays.Free(Acc_Table(I)); end loop; Assert(Storage_Error_Forced, "Storage_Error could not be forced. Last value = " & Array_Last'Image); exception when E : others => Assert(False, "Exception got raised with Last = " & Array_Last'Image & " Reason: " & Ada.Exceptions.Exception_Name(E) & " => " & Ada.Exceptions.Exception_Message(E)); end; end TestAlloc_WithForcingStorageError_ResultNullReturned; end SA_Arrays_Tests;
base/boot/SingLdrArm/common/memset.asm
sphinxlogic/Singularity-RDK-2.0
0
102882
; ; void * ; memset( void *dest, int c, size_t count ); ; ; The memset function sets the first count bytes of ; dest to the character c (value). ; OPT 2 ; disable listing INCLUDE kxarm.inc OPT 1 ; reenable listing value RN R1 ; int c count RN R2 dest RN R3 temp RN R12 IF Thumbing THUMBAREA ENDIF NESTED_ENTRY memset PROLOG_END IF Thumbing ; Switch from Thumb mode to ARM mode DCW 0x4778 ; bx pc DCW 0x46C0 ; nop ENDIF SUBS count, count, #4 MOV dest, R0 ;Save R0 for return BLT BYTESET AND value, value, #&FF ORR value, value, value, LSL #8 CHECKALIGN ; 2-3 cycles ANDS temp, dest, #3 ;Check alignment and fix if possible BNE ALIGN BLOCKSET ; 6-7 cycles ORR value, value, value, LSL #16 SUBS count, count, #12 MOV temp, value BLT BLKSET8 BLKSET16 ; 7 cycles/16 bytes STMIA dest!, {value, temp} SUBS count, count, #16 STMIA dest!, {value, temp} BGE BLKSET16 BLKSET8 ; 4 cycles/8 bytes ADDS count, count, #8 STMGEIA dest!, {value, temp} SUBGE count, count, #8 BLKSET4 ADDS count, count, #4 ; 4 cycles/4 bytes STRGE value, [dest], #4 BYTESET ADDLTS count, count, #4 BEQ EXIT STRB value, [dest], #1 ; 5 cycles/1-3bytes CMP count, #2 STRGEB value, [dest], #1 STRGTB value, [dest], #1 EXIT IF Interworking :LOR: Thumbing BX lr ELSE MOV pc, lr ENDIF ALIGN ; 8 cycles/1-3 bytes TST dest, #1 ;Check byte alignment SUBNE count, count, #1 STRNEB value, [dest], #1 TST dest, #2 ;Check Half-word alignment SUBNE count, count, #2 STRNEH value, [dest], #2 B BLOCKSET ENTRY_END END
oeis/330/A330170.asm
neoneye/loda-programs
11
29244
; A330170: a(n) = 2^n + 3^n + 6^n - 1. ; Submitted by <NAME>(s3) ; 10,48,250,1392,8050,47448,282250,1686432,10097890,60526248,362976250,2177317872,13062296530,78368963448,470199366250,2821153019712,16926788715970,101560344351048,609360902796250,3656161927895952,21936961102828210,131621735227521048,789730317205170250,4738381620767930592,28430288877251865250,170581730721511145448,1023490376703200952250,6140942237341876387632,36845653355419807219090,221073919926625563736248,1326443518942075691166250,7958661111799425368211072,47751966665237474462841730 add $0,1 mov $1,2 pow $1,$0 add $1,1 mov $2,3 pow $2,$0 mul $2,$1 add $1,$2 mov $0,$1 sub $0,2
oeis/275/A275541.asm
neoneye/loda-programs
11
84086
; A275541: (n)! + (n + 1)!!/(n + 1) - 2 ; Submitted by <NAME> ; 0,0,1,6,25,126,733,5086,40423,363262,3629743,39920638,479011993,6227066878,87178426333,1307675013118,20922791915023,355687438417918,6402373740187423,121645100594626558,2432902008831369073 mov $1,1 mov $2,1 lpb $0 mul $1,$0 add $3,$0 sub $0,2 sub $3,1 mul $2,$3 trn $3,$1 lpe add $1,1 mul $2,$1 mov $0,$2 sub $0,2
programs/oeis/267/A267208.asm
karttu/loda
0
90806
<reponame>karttu/loda<gh_stars>0 ; A267208: Middle column of the "Rule 109" elementary cellular automaton starting with a single ON (black) cell. ; 1,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0 pow $1,$0 add $1,$0 pow $1,4 mod $1,3
base/Kernel/Native/arm/cyclecounter.asm
sphinxlogic/Singularity-RDK-2.0
0
20130
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Microsoft Research Singularity ARM Bootstrap ;;; ;;; |defining ?g_GetCycleCount@Class_Microsoft_Singularity_Isal_Isa@@SA_KXZ| EQU 1 |defining ?g_EnableCycleCounter@Class_Microsoft_Singularity_Isal_Isa@@SAXXZ| EQU 1 include hal.inc TEXTAREA ;;; ;;; Reset cycle counter ;;; ;;; "void __cdecl ResetCycleCounter(void)" ;;; LEAF_ENTRY ?ResetCycleCounter@@YAXXZ mrc p15, 0, r1, c9, c12, 0 ; read PMCR orr r1, r1, #8 ; set C mcr p15, 0, r1, c9, c12, 0 ; set PMCR ; bkpt 0xffff bx lr LEAF_END ;;; ;;; Check for cycle counter wrap ;;; ;;; "bool __cdecl CycleCounterWrapped(void)" ;;; LEAF_ENTRY ?CycleCounterWrapped@@YA_NXZ mrc p15, 0, r1, c9, c12, 3 ; read overflow status mov r1, r1, lsr #31 ; move CC overflow to bit 0 and r0, r1, #1 ; check bit 0 ; bkpt 0xffff bx lr LEAF_END ;;; ;;; Clear cycle counter wrap flag ;;; ;;; "void __cdecl ClearCycleCounterWrap(void)" ;;; LEAF_ENTRY ?ClearCycleCounterWrap@@YAXXZ mrc p15, 0, r1, c9, c12, 3 ; read overflow status bic r1, r1, #0x80000000 ; clear CC overflow bit mcr p15, 0, r1, c9, c12, 3 ; set overflow status ; bkpt 0xffff bx lr LEAF_END ;;; ;;; Enable cycle counter ;;; ;;; "void __cdecl EnableCycleCounter(void)" ;;; LEAF_ENTRY ?g_EnableCycleCounter@Class_Microsoft_Singularity_Isal_Isa@@SAXXZ mrc p15, 0, r1, c9, c12, 0 ; read PMCR orr r1, r1, #1 ; set E (enable) bit mcr p15, 0, r1, c9, c12, 0 ; write PMCR mrc p15, 0, r1, c9, c12, 1 ; read PM count enable set register orr r1, r1, #0x80000000 ; set C (CC enable) bit mcr p15, 0, r1, c9, c12, 1 ; write PM count enable set register ; bkpt 0xffff bx lr LEAF_END ;;; ;;; Disable cycle counter ;;; ;;; "void __cdecl DisableCycleCounter(void)" ;;; LEAF_ENTRY ?DisableCycleCounter@@YAXXZ mrc p15, 0, r1, c9, c12, 1 ; read PM count enable set register bic r1, r1, #0x80000000 ; clear C (CC enable) bit mcr p15, 0, r1, c9, c12, 1 ; write PM count enable set register mrc p15, 0, r1, c9, c12, 0 ; read PMCR bic r1, r1, #1 ; clear E (enable) bit mcr p15, 0, r1, c9, c12, 0 ; write PMCR ; bkpt 0xffff bx lr LEAF_END ;;; ;;; "public: static unsigned __int64 __cdecl Class_Microsoft_Singularity_Isal_Isa::g_GetCycleCount(void)" ;;; LEAF_ENTRY ?g_GetCycleCount@Class_Microsoft_Singularity_Isal_Isa@@SA_KXZ mrc p15, 0, r0, c9, c13, 0 mov r1, #0 ; bkpt 0xffff bx lr LEAF_END ;;; ;;; "unsigned __int64 __cdecl RDTSC(void)" ;;; LEAF_ENTRY ?RDTSC@@YA_KXZ mrc p15, 0, r0, c9, c13, 0 mov r1, #0 ; bkpt 0xffff bx lr LEAF_END END
non_regression/switch_x86_macosx.o.asm
LRGH/plasmasm
1
87382
<gh_stars>1-10 .macosx_version_min 10, 10 .section __TEXT,__text,regular,pure_instructions .align 4, 0x90 .globl _PyToken_OneChar _PyToken_OneChar: pushl %ebp movl %esp, %ebp movl 8(%ebp), %ecx cmpl $93, %ecx jg L0000001C L0000000B: cmpl $57, %ecx jg L0000002D L00000010: cmpl $37, %ecx jne L00000061 L00000015: movl $24, %eax popl %ebp ret L0000001C: cmpl $95, %ecx jg L00000050 L00000021: cmpl $94, %ecx jne L00000091 L00000026: movl $33, %eax popl %ebp ret L0000002D: addl $-58, %ecx cmpl $6, %ecx ja L00000091 L00000035: call L0000003A L0000003A: popl %edx movl $11, %eax addl L000000A8-L0000003A(%edx,%ecx,4), %edx jmp *%edx L00000049: movl $22, %eax popl %ebp ret L00000050: cmpl $124, %ecx jg L0000006D L00000055: cmpl $96, %ecx jne L00000079 L0000005A: movl $25, %eax popl %ebp ret L00000061: cmpl $46, %ecx jne L00000091 L00000066: movl $23, %eax popl %ebp ret L0000006D: cmpl $125, %ecx jne L00000085 L00000072: movl $27, %eax popl %ebp ret L00000079: cmpl $123, %ecx jne L00000091 L0000007E: movl $26, %eax popl %ebp ret L00000085: cmpl $126, %ecx jne L00000091 L0000008A: movl $32, %eax popl %ebp ret L00000091: movl $51, %eax L00000096: popl %ebp ret L00000098: movl $21, %eax popl %ebp ret L0000009F: movl $50, %eax popl %ebp ret .align 2, 0x90 L000000A8: .long L00000096-L0000003A .long L00000091-L0000003A .long L00000091-L0000003A .long L00000049-L0000003A .long L00000098-L0000003A .long L00000091-L0000003A .long L0000009F-L0000003A # ---------------------- .align 4, 0x90 .globl _PyToken_TwoChars _PyToken_TwoChars: pushl %ebp movl %esp, %ebp movl 12(%ebp), %ecx movl 8(%ebp), %eax cmpl $60, %eax jg L00000103 L000000DE: addl $-33, %eax cmpl $14, %eax ja L0000018A L000000EA: call L000000EF L000000EF: popl %edx addl L000001B0-L000000EF(%edx,%eax,4), %edx jmp *%edx L000000F9: movl $29, %eax jmp L00000185 L00000103: cmpl $93, %eax jg L00000114 L00000108: cmpl $61, %eax jne L00000120 L0000010D: movl $28, %eax jmp L00000185 L00000114: cmpl $94, %eax jne L00000142 L00000119: movl $44, %eax jmp L00000185 L00000120: cmpl $62, %eax jne L0000018A L00000125: cmpl $62, %ecx movl $35, %eax movl $51, %edx cmove %eax, %edx cmpl $61, %ecx movl $31, %eax cmovne %edx, %eax popl %ebp ret L00000142: cmpl $124, %eax jne L0000018A L00000147: movl $43, %eax jmp L00000185 L0000014E: movl $41, %eax jmp L00000185 L00000155: movl $42, %eax jmp L00000185 L0000015C: cmpl $61, %ecx movl $39, %eax movl $51, %edx cmove %eax, %edx cmpl $42, %ecx movl $36, %eax cmovne %edx, %eax popl %ebp ret L00000179: movl $37, %eax jmp L00000185 L00000180: movl $38, %eax L00000185: cmpl $61, %ecx je L0000018F L0000018A: movl $51, %eax L0000018F: popl %ebp ret L00000191: cmpl $61, %ecx movl $40, %eax movl $51, %edx cmove %eax, %edx cmpl $47, %ecx movl $48, %eax cmovne %edx, %eax popl %ebp ret .align 2, 0x90 L000001B0: .long L000000F9-L000000EF .long L0000018A-L000000EF .long L0000018A-L000000EF .long L0000018A-L000000EF .long L0000014E-L000000EF .long L00000155-L000000EF .long L0000018A-L000000EF .long L0000018A-L000000EF .long L0000018A-L000000EF .long L0000015C-L000000EF .long L00000179-L000000EF .long L0000018A-L000000EF .long L00000180-L000000EF .long L0000018A-L000000EF .long L00000191-L000000EF # ---------------------- .align 4, 0x90 .globl _main _main: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi movl $51, %ecx movl 8(%ebp), %edx cmpl $93, %edx jg L00000216 L00000202: cmpl $57, %edx jg L0000022A L00000207: cmpl $37, %edx jne L00000263 L0000020C: movl $24, %eax jmp L000002C8 L00000216: cmpl $95, %edx jg L00000252 L0000021B: cmpl $94, %edx jne L00000293 L00000220: movl $33, %eax jmp L000002C8 L0000022A: leal -58(%edx), %esi cmpl $6, %esi ja L00000293 L00000232: call L00000237 L00000237: popl %edi movl $11, %eax addl L000002D0-L00000237(%edi,%esi,4), %edi jmp *%edi L00000246: movl $28, %ecx movl $22, %eax jmp L000002C8 L00000252: cmpl $124, %edx jg L0000026F L00000257: cmpl $96, %edx jne L0000027B L0000025C: movl $25, %eax jmp L000002C8 L00000263: cmpl $46, %edx jne L00000293 L00000268: movl $23, %eax jmp L000002C8 L0000026F: cmpl $125, %edx jne L00000287 L00000274: movl $27, %eax jmp L000002C8 L0000027B: cmpl $123, %edx jne L00000293 L00000280: movl $26, %eax jmp L000002C8 L00000287: cmpl $126, %edx jne L00000293 L0000028C: movl $32, %eax jmp L000002C8 L00000293: movl $51, %eax cmpl $42, %edx jne L000002A4 L0000029D: movl $36, %ecx jmp L000002C8 L000002A4: cmpl $47, %edx jne L000002B0 L000002A9: movl $48, %ecx jmp L000002C8 L000002B0: movl $51, %ecx jmp L000002C8 L000002B7: movl $35, %ecx movl $21, %eax jmp L000002C8 L000002C3: movl $50, %eax L000002C8: addl %ecx, %eax popl %esi popl %edi popl %ebp ret .align 2, 0x90 L000002D0: .long L000002C8-L00000237 .long L00000293-L00000237 .long L00000293-L00000237 .long L00000246-L00000237 .long L000002B7-L00000237 .long L00000293-L00000237 .long L000002C3-L00000237 # ---------------------- .subsections_via_symbols
programs/oeis/087/A087165.asm
karttu/loda
0
10678
<reponame>karttu/loda ; A087165: a(n)=1 when n == 1 (mod 4), otherwise a(n) = a(n - ceiling(n/4)) + 1. Removing all the 1's results in the original sequence with every term incremented by 1. ; 1,2,3,4,1,5,2,6,1,3,7,2,1,4,8,3,1,2,5,9,1,4,2,3,1,6,10,2,1,5,3,4,1,2,7,11,1,3,2,6,1,4,5,2,1,3,8,12,1,2,4,3,1,7,2,5,1,6,3,2,1,4,9,13,1,2,3,5,1,4,2,8,1,3,6,2,1,7,4,3,1,2,5,10,1,14,2,3,1,4,6,2,1,5,3,9,1,2,4,7,1,3,2 mov $27,$0 mov $29,2 lpb $29,1 clr $0,27 mov $0,$27 sub $29,1 add $0,$29 lpb $0,1 mul $0,3 div $0,4 add $2,$0 lpe mov $1,$2 mov $30,$29 lpb $30,1 mov $28,$1 sub $30,1 lpe lpe lpb $27,1 mov $27,0 sub $28,$1 lpe mov $1,$28 add $1,1
lib/Explore/Fin.agda
crypto-agda/explore
2
1788
{-# OPTIONS --without-K #-} open import Data.Nat open import Data.Two open import Data.Zero open import Data.Fin.NP open import Type open import Function open import Relation.Binary.PropositionalEquality.NP import Explore.Universe.Base open import Explore.Core open import Explore.Zero open import Explore.One open import Explore.Two open import Explore.Universe.Type -- Exploring Fin comes in two flavors Regular & Custom -- We recommend Regular if you want to work for arbitrary values of n. -- We recommend Custom if you want to work for particular values of n (2, 6...). module Explore.Fin where module Regular n = Explore.Universe.Base (≃ᵁ (Finᵁ n) (Fin n) (Finᵁ≃Fin n)) module Custom where module _ n where open Explore.Universe.Base (≃ᵁ (Finᵁ' n) (Fin n) (Finᵁ'≃Fin n)) public Finᵉ0-𝟘ᵉ : (λ {M : ★₀} (ε : M) op f → explore 0 ε op (f ∘ Fin▹𝟘)) ≡ 𝟘ᵉ Finᵉ0-𝟘ᵉ = refl Finᵉ1-𝟙ᵉ : (λ {M : ★₀} (ε : M) op f → explore 1 ε op (f ∘ Fin▹𝟙)) ≡ 𝟙ᵉ Finᵉ1-𝟙ᵉ = refl Finᵉ2-𝟚ᵉ : (λ {M : ★₀} (ε : M) op f → explore 2 ε op (f ∘ Fin▹𝟚)) ≡ 𝟚ᵉ Finᵉ2-𝟚ᵉ = refl module ByHand {ℓ} where Finᵉ' : ∀ n → Explore ℓ (Fin n) Finᵉ' zero z _⊕_ f = z Finᵉ' (suc n) z _⊕_ f = f zero ⊕ Finᵉ' n z _⊕_ (f ∘ suc) -- Finᵉ and Finᵉ' are extensionally equal. -- Moreover the simplicity of the proof shows that the two functions are computing -- in the same way. Finᵉ-Finᵉ' : ∀ n {M} (ε : M) (_⊕_ : M → M → M) (f : Fin n → M) → Regular.explore n ε _⊕_ f ≡ Finᵉ' n ε _⊕_ f Finᵉ-Finᵉ' zero ε _⊕_ f = idp Finᵉ-Finᵉ' (suc n) ε _⊕_ f = ap (_⊕_ (f zero)) (Finᵉ-Finᵉ' n ε _⊕_ (f ∘ suc))
programs/oeis/010/A010955.asm
jmorken/loda
1
10845
<filename>programs/oeis/010/A010955.asm ; A010955: Binomial coefficient C(39,n). ; 1,39,741,9139,82251,575757,3262623,15380937,61523748,211915132,635745396,1676056044,3910797436,8122425444,15084504396,25140840660,37711260990,51021117810,62359143990,68923264410,68923264410,62359143990,51021117810,37711260990 mov $1,39 bin $1,$0