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
q2.asm
tatticoder/Simple-Code
0
20247
.MODE SMALL .CODE .386 .STARTUP MOV AX,3H MOV BX,4H ADD [BX],AX .EXIT END
programs/oeis/241/A241520.asm
neoneye/loda
22
104782
; A241520: Numbers n such that n^2 == -1 (mod 89). ; 34,55,123,144,212,233,301,322,390,411,479,500,568,589,657,678,746,767,835,856,924,945,1013,1034,1102,1123,1191,1212,1280,1301,1369,1390,1458,1479,1547,1568,1636,1657,1725,1746,1814,1835,1903,1924,1992,2013,2081,2102,2170,2191,2259,2280,2348,2369,2437,2458,2526,2547,2615,2636,2704,2725,2793,2814,2882,2903,2971,2992,3060,3081,3149,3170,3238,3259,3327,3348,3416,3437,3505,3526,3594,3615,3683,3704,3772,3793,3861,3882,3950,3971,4039,4060,4128,4149,4217,4238,4306,4327,4395,4416 mov $2,$0 add $0,9 mov $1,6 mov $3,6 mov $4,23 lpb $0 trn $0,2 add $1,3 add $4,$3 add $1,$4 trn $3,1 lpe lpb $2 add $1,21 sub $2,1 lpe sub $1,172 mov $0,$1
src/test/kc/complex/borderline_pacman/byteboozer_decrunch.asm
jbrandwood/kickc
2
19383
// ByteBoozer Decruncher /HCL May.2003 // B2 Decruncher December 2014 .importonce .filenamespace b2 // You must set .const B2_ZP_BASE prior the import of this file .if (B2_ZP_BASE > $ff) { .error "B2_ZP_BASE must be in zeropage. Was $" + toHexString(B2_ZP_BASE,4) } .label zp_base = B2_ZP_BASE .label bits = zp_base .label put = zp_base + 2 .macro @B2_DECRUNCH(addr) { ldy #<addr ldx #>addr jsr b2.Decrunch } .macro GetNextBit() { asl bits bne DgEnd jsr GetNewBits DgEnd: } .macro GetLen() { lda #1 GlLoop: :GetNextBit() bcc GlEnd :GetNextBit() rol bpl GlLoop GlEnd: } Decrunch: sty Get1+1 sty Get2+1 sty Get3+1 stx Get1+2 stx Get2+2 stx Get3+2 ldx #0 jsr GetNewBits sty put-1,x cpx #2 bcc *-7 lda #$80 sta bits DLoop: :GetNextBit() bcs Match Literal: // Literal run.. get length. :GetLen() sta LLen+1 ldy #0 LLoop: Get3: lda $feed,x inx bne *+5 jsr GnbInc L1: sta (put),y iny LLen: cpy #0 bne LLoop clc tya adc put sta put bcc *+4 inc put+1 iny beq DLoop // Has to continue with a match.. Match: // Match.. get length. :GetLen() sta MLen+1 // Length 255 -> EOF cmp #$ff beq End // Get num bits cmp #2 lda #0 rol :GetNextBit() rol :GetNextBit() rol tay lda Tab,y beq M8 // Get bits < 8 M_1: :GetNextBit() rol bcs M_1 bmi MShort M8: // Get byte eor #$ff tay Get2: lda $feed,x inx bne *+5 jsr GnbInc jmp Mdone MShort: ldy #$ff Mdone: //clc adc put sta MLda+1 tya adc put+1 sta MLda+2 ldy #$ff MLoop: iny MLda: lda $beef,y sta (put),y MLen: cpy #0 bne MLoop //sec tya adc put sta put bcc *+4 inc put+1 jmp DLoop End: rts GetNewBits: Get1: ldy $feed,x sty bits rol bits inx bne GnbEnd GnbInc: inc Get1+2 inc Get2+2 inc Get3+2 GnbEnd: rts Tab: // Short offsets .byte %11011111 // 3 .byte %11111011 // 6 .byte %00000000 // 8 .byte %10000000 // 10 // Long offsets .byte %11101111 // 4 .byte %11111101 // 7 .byte %10000000 // 10 .byte %11110000 // 13
src/002/separated.ads
xeenta/learning-ada
0
12904
<reponame>xeenta/learning-ada package Separated is procedure Watch_Me; function Look_Out return Float; end Separated;
programs/oeis/070/A070321.asm
jmorken/loda
1
101144
; A070321: Greatest squarefree number <= n. ; 1,2,3,3,5,6,7,7,7,10,11,11,13,14,15,15,17,17,19,19,21,22,23,23,23,26,26,26,29,30,31,31,33,34,35,35,37,38,39,39,41,42,43,43,43,46,47,47,47,47,51,51,53,53,55,55,57,58,59,59,61,62,62,62,65,66,67,67,69,70,71,71,73,74,74,74,77,78,79,79,79,82,83,83,85,86,87,87,89,89,91,91,93,94,95,95,97,97,97,97,101,102,103,103,105,106,107,107,109,110,111,111,113,114,115,115,115,118,119,119,119,122,123,123,123,123,127,127,129,130,131,131,133,134,134,134,137,138,139,139,141,142,143,143,145,146,146,146,149,149,151,151,151,154,155,155,157,158,159,159,161,161,163,163,165,166,167,167,167,170,170,170,173,174,174,174,177,178,179,179,181,182,183,183,185,186,187,187,187,190,191,191,193,194,195,195,197,197,199,199,201,202,203,203,205,206,206,206,209,210,211,211,213,214,215,215,217,218,219,219,221,222,223,223,223,226,227,227,229,230,231,231,233,233,235,235,237,238,239,239,241,241,241,241,241,246,247,247,249,249 lpb $0 mov $3,$0 cal $3,8683 ; Möbius (or Moebius) function mu(n). mu(1) = 1; mu(n) = (-1)^k if n is the product of k different primes; otherwise mu(n) = 0. sub $0,1 mov $2,$3 lpb $2 mov $0,1073741846 div $2,7 lpe lpe mov $1,11 add $1,$0 sub $1,10
kernel/dev/flash.asm
TheMachine02/Sorcery
14
247375
<filename>kernel/dev/flash.asm define KERNEL_FLASH_MAPPING $E00003 define KERNEL_FLASH_CTRL $E00005 define KERNEL_FLASH_SIZE $400000 flash: .init: ld hl, .phy_program ld de, flash_program ld bc, .phy_program_size ldir ld hl, .FLASH_DEV ld c, KERNEL_VFS_PERMISSION_RW or KERNEL_VFS_TYPE_BLOCK_DEVICE ld de, .phy_mem_ops jp _mknod .FLASH_DEV: db "/dev/flash", 0 .phy_mem_ops: jp .phy_read jp .phy_write jp .phy_ioctl ret dl 0 ret dl 0 ret .phy_program: if $ < $D00000 org flash_program end if .phy_erase: ; erase sector hl call .unlock ex de, hl ; first cycle ld hl, $000AAA ld (hl), l ld hl, $000555 ld (hl), l add hl, hl ld (hl), $80 ; second cycle ld (hl), l ld hl, $000555 ld (hl), l ex de, hl ld (hl), $30 ; timeout 50µs call .phy_timeout .phy_erase_loop: ld de, (KERNEL_INTERRUPT_ISR) ld a, d or a, e call nz, .phy_suspend ld a, (hl) inc a jr nz, .phy_erase_loop ret .phy_suspend: ld a, $B0 ld ($0), a ; check for DQ6 toggle .phy_suspend_busy_wait: bit 6, (hl) jr z, .phy_suspend_busy_wait ; perform interrupt call .lock ei halt di ; re unlock call .unlock ld a, $30 ld ($0), a ret .phy_timeout: ; wait a bit more than 50 µs push bc ; 10 ld b, 181 ; + 8 .phy_timeout_wait: djnz .phy_timeout_wait ; + 2348 (=180*13+1*8) pop bc ; + 16 ret ; + 21 ; = 2403 ... 2403/48Mhz=50,0625 µs .phy_ioctl: ret ; no op .phy_read: or a, a sbc hl, hl ret .phy_write: ; write hl to flash de buffer for bc bytes call .unlock ; we will write hl to de address .phy_write_loop: ld a, (de) and a, (hl) push hl ld hl, $000AAA ld (hl), l ld hl, $000555 ld (hl), l add hl, hl ld (hl), $A0 ; byte to program = A ld (de), a ; now we need to check for the write to complete ; 6 micro second typical, ~300 cycles wait call .phy_status_polling ; schedule if need for an interrupt ld hl, (KERNEL_INTERRUPT_ISR) ld a, h or a, l jr z, .phy_write_continue ; perform interrupt ; save all ? call .lock ei halt di ; re unlock call .unlock .phy_write_continue: pop hl inc de cpi jp pe, .phy_write_loop jp .lock .phy_status_polling: and a, $80 ld h, a .phy_busy_wait: ld a, (de) xor a, h add a, a ret nc jp p, .phy_busy_wait ld a, (de) xor a, h rlca jr nc, .phy_busy_wait .phy_abort: ld a, $F0 ld ($0), a ret .phy_program_size:=$-.phy_erase org .phy_program + .phy_program_size
nat-to-string.agda
heades/AUGL
0
13157
<reponame>heades/AUGL module nat-to-string where open import bool open import char open import eq open import list open import maybe open import nat open import nat-division open import nat-thms open import product open import string open import termination ℕ-to-digitsh : (base : ℕ) → 1 < base ≡ tt → (x : ℕ) → ↓𝔹 _>_ x → 𝕃 ℕ ℕ-to-digitsh _ _ 0 _ = [] ℕ-to-digitsh base bp (suc x) (pf↓ fx) with (suc x) ÷ base ! (<=ℕff2 base bp) ... | q , r , p , _ = r :: (ℕ-to-digitsh base bp q (fx (÷<{base}{q}{r}{x} bp p))) ℕ-to-digits : ℕ → 𝕃 ℕ ℕ-to-digits x = reverse (ℕ-to-digitsh 10 refl x (↓-> x)) digit-to-string : ℕ → string digit-to-string 0 = "0" digit-to-string 1 = "1" digit-to-string 2 = "2" digit-to-string 3 = "3" digit-to-string 4 = "4" digit-to-string 5 = "5" digit-to-string 6 = "6" digit-to-string 7 = "7" digit-to-string 8 = "8" digit-to-string 9 = "9" digit-to-string _ = "unexpected-digit" digits-to-string : 𝕃 ℕ → string digits-to-string [] = "" digits-to-string (d :: ds) = (digit-to-string d) ^ (digits-to-string ds) ℕ-to-string : ℕ → string ℕ-to-string 0 = "0" ℕ-to-string (suc x) = digits-to-string (ℕ-to-digits (suc x)) string-to-digit : char → maybe ℕ string-to-digit '0' = just 0 string-to-digit '1' = just 1 string-to-digit '2' = just 2 string-to-digit '3' = just 3 string-to-digit '4' = just 4 string-to-digit '5' = just 5 string-to-digit '6' = just 6 string-to-digit '7' = just 7 string-to-digit '8' = just 8 string-to-digit '9' = just 9 string-to-digit _ = nothing -- the digits are in order from least to most significant digits-to-ℕh : ℕ → ℕ → 𝕃 ℕ → ℕ digits-to-ℕh multiplier sum [] = sum digits-to-ℕh multiplier sum (x :: xs) = digits-to-ℕh (10 * multiplier) (x * multiplier + sum) xs digits-to-ℕ : 𝕃 ℕ → ℕ digits-to-ℕ digits = digits-to-ℕh 1 0 digits string-to-ℕ : string → maybe ℕ string-to-ℕ s with 𝕃maybe-map string-to-digit (reverse (string-to-𝕃char s)) ... | nothing = nothing ... | just ds = just (digits-to-ℕ ds)
lib/Haskell/Prim/Monad.agda
flupe/agda2hs
0
15719
<filename>lib/Haskell/Prim/Monad.agda module Haskell.Prim.Monad where open import Haskell.Prim open import Haskell.Prim.Applicative open import Haskell.Prim.Either open import Haskell.Prim.Foldable open import Haskell.Prim.Functor open import Haskell.Prim.List open import Haskell.Prim.Maybe open import Haskell.Prim.Monoid open import Haskell.Prim.String open import Haskell.Prim.Tuple -------------------------------------------------- -- Monad record Monad (m : Set → Set) : Set₁ where field _>>=_ : m a → (a → m b) → m b overlap ⦃ super ⦄ : Applicative m return : a → m a return = pure _>>_ : m a → m b → m b m >> m₁ = m >>= λ _ → m₁ _=<<_ : (a → m b) → m a → m b _=<<_ = flip _>>=_ open Monad ⦃ ... ⦄ public mapM₋ : ⦃ Monad m ⦄ → ⦃ Foldable t ⦄ → (a → m b) → t a → m ⊤ mapM₋ f = foldr (λ x k → f x >> k) (pure tt) sequence₋ : ⦃ Monad m ⦄ → ⦃ Foldable t ⦄ → t (m a) → m ⊤ sequence₋ = foldr _>>_ (pure tt) instance iMonadList : Monad List iMonadList ._>>=_ = flip concatMap iMonadMaybe : Monad Maybe iMonadMaybe ._>>=_ m k = maybe Nothing k m iMonadEither : Monad (Either a) iMonadEither ._>>=_ m k = either Left k m iMonadFun : Monad (λ b → a → b) iMonadFun ._>>=_ f k r = k (f r) r iMonadTuple₂ : ⦃ Monoid a ⦄ → Monad (a ×_) iMonadTuple₂ ._>>=_ (a , x) k = first (a <>_) (k x) iMonadTuple₃ : ⦃ Monoid a ⦄ → ⦃ Monoid b ⦄ → Monad (a × b ×_) iMonadTuple₃ ._>>=_ (a , b , x) k = case k x of λ where (a₁ , b₁ , y) → a <> a₁ , b <> b₁ , y iMonadTuple₄ : ⦃ Monoid a ⦄ → ⦃ Monoid b ⦄ → ⦃ Monoid c ⦄ → Monad (λ d → Tuple (a ∷ b ∷ c ∷ d ∷ [])) iMonadTuple₄ ._>>=_ (a ∷ b ∷ c ∷ x ∷ []) k = case k x of λ where (a₁ ∷ b₁ ∷ c₁ ∷ y ∷ []) → a <> a₁ ∷ b <> b₁ ∷ c <> c₁ ∷ y ∷ [] record MonadFail (m : Set → Set) : Set₁ where field fail : String → m a overlap ⦃ super ⦄ : Monad m open MonadFail ⦃ ... ⦄ public instance MonadFailList : MonadFail List MonadFailList .fail _ = [] MonadFailMaybe : MonadFail Maybe MonadFailMaybe .fail _ = Nothing
test/Succeed/Issue59b.agda
cruhland/agda
1,989
6828
{-# OPTIONS --sized-types #-} open import Common.Size data Heap : (i j : Size) → Set where node : (i j : Size) → Heap (↑ i) (↑ j) postulate _∪_ : Heap ∞ ∞ → Heap ∞ ∞ → Heap ∞ ∞ mkH : ∀ i j → Heap i j merge : (i j : Size) → Heap i j → Heap ∞ ∞ merge .(↑ i) .(↑ j) (node i j) with Set merge .(↑ i) .(↑ j) (node i j) | _ = merge i (↑ j) (mkH i (↑ j)) ∪ merge (↑ i) j (mkH (↑ i) j)
programs/oeis/167/A167808.asm
jmorken/loda
1
160212
<reponame>jmorken/loda ; A167808: Numerator of x(n) = x(n-1) + x(n-2), x(0)=0, x(1)=1/2. ; 0,1,1,1,3,5,4,13,21,17,55,89,72,233,377,305,987,1597,1292,4181,6765,5473,17711,28657,23184,75025,121393,98209,317811,514229,416020,1346269,2178309,1762289,5702887,9227465,7465176,24157817,39088169,31622993,102334155,165580141,133957148,433494437,701408733,567451585,1836311903,2971215073,2403763488,7778742049,12586269025,10182505537,32951280099,53316291173,43133785636,139583862445,225851433717,182717648081,591286729879,956722026041,774004377960,2504730781961,4052739537881,3278735159921,10610209857723,17167680177565,13888945017644,44945570212853,72723460248141,58834515230497,190392490709135,308061521170129,249227005939632,806515533049393,1304969544928657,1055742538989025,3416454622906707,5527939700884757,4472197161895732 mov $1,7 mov $5,6 lpb $0 sub $0,1 mov $2,$3 mov $3,3 add $3,$5 add $5,$2 lpe mul $1,$3 add $4,6 gcd $3,$4 add $0,$3 div $1,$0 div $1,21
maps/MountMoonB2F.asm
zavytar/pokecolorless
0
168061
<reponame>zavytar/pokecolorless<gh_stars>0 object_const_def ; object_event constants const MOUNTMOONB2F_SUPERNERD const MOUNTMOONB2F_TM const MOUNTMOONB2F_ITEMBALL1 const MOUNTMOONB2F_ROCK1 const MOUNTMOONB2F_ROCK2 const MOUNTMOONB2F_ROCK3 const MOUNTMOONB2F_ROCK4 MountMoonB2F_MapScripts: db 0 ; scene scripts db 0 ; callbacks TrainerSuperNerdMiguel: trainer SUPER_NERD, SUPER_NERD_MIGUEL, EVENT_BEAT_SUPER_NERD_MIGUEL, SuperNerdMiguelSeenText, SuperNerdMiguelBeatenText, 0, .Script .Script: endifjustbattled opentext writetext SuperNerdMiguelAfterBattleText waitbutton closetext end MountMoonB2F_TM: opentext verbosegiveitem TM_THIEF iffalse .done disappear MOUNTMOONB2F_TM closetext setevent EVENT_GOT_TM46_THIEF_AT_MOUNT_MOON_B2F end .done end MountMoonB2FNugget: itemball NUGGET MtMoonB2F_Rock1: MtMoonB2F_Rock2: MtMoonB2F_Rock3: MtMoonB2F_Rock4: jumpstd smashrock SuperNerdMiguelSeenText: text "I'm looking for" line "#MON fossils!" done SuperNerdMiguelBeatenText: text "Agh! Couldn't" line "make it!" done SuperNerdMiguelAfterBattleText: text "Far away, on" line "CINNABAR ISLAND," cont "there's a #MON" cont "LAB." para "They do research" line "on regenerating" cont "fossils." done MountMoonB2F_MapEvents: db 0, 0 ; filler db 4 ; warp events warp_event 21, 25, MOUNT_MOON_B1F, 5 ; to NUGGET warp_event 25, 9, MOUNT_MOON_B1F, 6 ; to TM warp_event 7, 7, MOUNT_MOON_B1F, 8 ; to EXIT warp_event 21, 17, MOUNT_MOON_B1F, 7 ; back to B2F, EXIT db 0 ; coord events db 0 ; bg events db 7 ; object events object_event 14, 12, SPRITE_SUPER_NERD, SPRITEMOVEDATA_SPINRANDOM_FAST, 2, 2, -1, -1, 0, OBJECTTYPE_TRAINER, 0, TrainerSuperNerdMiguel, -1 ; Super Nerd object_event 29, 4, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 4, MountMoonB2F_TM, EVENT_GOT_TM46_THIEF_AT_MOUNT_MOON_B2F ;TM46 - Thief object_event 25, 22, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, MountMoonB2FNugget, EVENT_MOUNT_MOON_B2F_NUGGET object_event 10, 18, SPRITE_ROCK, SPRITEMOVEDATA_SMASHABLE_ROCK, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, MtMoonB2F_Rock1, -1 object_event 12, 8, SPRITE_ROCK, SPRITEMOVEDATA_SMASHABLE_ROCK, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, MtMoonB2F_Rock2, -1 object_event 10, 10, SPRITE_ROCK, SPRITEMOVEDATA_SMASHABLE_ROCK, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, MtMoonB2F_Rock3, -1 object_event 14, 20, SPRITE_ROCK, SPRITEMOVEDATA_SMASHABLE_ROCK, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, MtMoonB2F_Rock4, -1
Tests/NetNewsWireTests/ScriptingTests/scripts/testURLsOfCurrentArticle.applescript
bubudrc/NetNewsWire
3,016
3530
-- this script tests that it is possible to get the url property of the current article -- it uses system event accessibility scripting to set up the main window -- one needs to authorize scripting accessibility control in the System Preferences' -- Privacy and security pane try tell application "NetNewsWire" {url, permalink, external url} of current article end tell on error message return {test_result:false, script_result:message} end try return {test_result:true, script_result:"tests passed"}
programs/oeis/098/A098723.asm
neoneye/loda
22
93340
<gh_stars>10-100 ; A098723: a(n) = C(n, 4)^(n-5). ; 1,1,15,1225,343000,252047376,408410100000,1291467969000000,7281760530523359375,68304345527688750390625,1009036084126126084036009001,22455695662847780324059072265625,725747031014354499889356800000000000 mov $1,-5 bin $1,$0 sub $0,1 pow $1,$0 mov $0,$1
oeis/107/A107384.asm
neoneye/loda-programs
11
15642
; A107384: a(n)= a(n-1) +3*a(n-2) -3*a(n-4). ; Submitted by <NAME> ; 0,1,1,2,5,8,20,38,83,173,362,767,1604,3386,7112,14969,31493,66242,139385,293204,616880,1297766,2730251,5743937,12084050,25422563,53483960,112519838,236719568,498011393,1047718217,2204192882 lpb $0 sub $0,1 mul $1,3 add $2,2 mov $3,$1 mov $1,$2 add $4,$3 mov $2,$4 mov $4,$3 sub $4,4 lpe mov $0,$1 div $0,2
libsrc/target/zx/stdio/__zx_printc_attr.asm
ahjelm/z88dk
640
29139
<gh_stars>100-1000 MODULE __zx_printc_attr SECTION code_driver PUBLIC __zx_printc_attr EXTERN __zx_screenmode EXTERN __zx_console_attr IF FORsam EXTERN SCREEN_BASE EXTERN __sam_graphics_pageout ENDIF ; Set the attributes for the character that has just been printed ; ; Entry: de = screen address __zx_printc_attr: IF FORts2068|FORzxn ld a,d and @0100000 ld l,a ld a,(__zx_screenmode) cp 6 ret z cp 2 jr nz,not_hi_colour set 5,d ld a,(__zx_console_attr) ld b,8 hires_set_attr: ld (de),a dec d djnz hires_set_attr ret not_hi_colour: ENDIF ld a,d rrca rrca rrca and 3 IF FORsam or +(SCREEN_BASE / 256) + 24 ELSE or 88 ENDIF IF FORts2068|zxn or l ;Add in screen 1 bit ENDIF ld d,a ld a,(__zx_console_attr) ld (de),a IF FORsam call __sam_graphics_pageout ENDIF ret
programs/oeis/311/A311344.asm
karttu/loda
0
25159
<reponame>karttu/loda ; A311344: Coordination sequence Gal.5.95.1 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; 1,4,8,12,16,22,26,30,34,38,42,46,50,54,60,64,68,72,76,80,84,88,92,98,102,106,110,114,118,122,126,130,136,140,144,148,152,156,160,164,168,174,178,182,186,190,194,198,202,206 mov $4,$0 mov $5,$0 lpb $0,1 sub $2,$2 add $2,6 add $3,1 sub $0,$3 sub $0,1 trn $0,2 sub $4,$3 add $2,$4 sub $2,1 mov $3,5 mov $4,3 add $4,$2 lpe mov $1,$2 trn $1,5 add $1,4 lpb $5,1 add $1,3 sub $5,1 lpe sub $1,3
programs/oeis/168/A168096.asm
karttu/loda
1
101956
; A168096: a(n) = number of natural numbers m such that n - 6 <= m <= n + 6. ; 6,7,8,9,10,11,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13 mov $1,$0 trn $0,7 sub $1,$0 add $1,6
programs/oeis/213/A213046.asm
karttu/loda
1
14937
; A213046: Convolution of Lucas numbers and positive integers repeated (A000032 and A008619). ; 2,3,8,13,25,41,71,116,193,314,514,834,1356,2197,3562,5767,9339,15115,24465,39590,64067,103668,167748,271428,439190,710631,1149836,1860481,3010333,4870829,7881179,12752024,20633221,33385262,54018502,87403782,141422304,228826105,370248430,599074555,969323007,1568397583,2537720613,4106118218,6643838855,10749957096,17393795976,28143753096,45537549098,73681302219,119218851344,192900153589,312119004961,505019158577,817138163567,1322157322172,2139295485769,3461452807970,5600748293770,9062201101770,14662949395572,23725150497373,38388099892978,62113250390383,100501350283395,162614600673811,263115950957241,425730551631086,688846502588363,1114577054219484,1803423556807884,2918000611027404,4721424167835326,7639424778862767 add $0,3 mov $2,$0 div $2,2 cal $0,14217 ; a(n) = floor(phi^n), where phi = (1+sqrt(5))/2 is the golden ratio. mov $1,$0 sub $1,$2 sub $1,1
s-taprop.adb
ytomino/gnat4drake
0
18155
<filename>s-taprop.adb with System.Address_To_Named_Access_Conversions; with System.Tasks; package body System.Task_Primitives.Operations is package Task_Id_Conv is new Address_To_Named_Access_Conversions ( Tasks.Task_Record, Tasks.Task_Id); procedure Abort_Task (T : System.Tasking.Task_Id) is begin System.Tasks.Send_Abort (Task_Id_Conv.To_Pointer (T)); end Abort_Task; end System.Task_Primitives.Operations;
programs/oeis/204/A204897.asm
neoneye/loda
22
28207
; A204897: a(n) = (p(n)-q(n))/n, where (p(n), q(n)) is the least pair of primes for which n divides p(n)-q(n). ; 1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,2,1,1,1,1,1,2,1,1,1,2,1,2,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,1,1,2,1,1,1,1,1,2,1,2,1,1,1,2,1,1,1,2,1,2,1,1,1,2,1,2,1,2,1,1,1,2,1,1,1 add $0,2 mov $1,$0 seq $1,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $1,2 gcd $1,$0 mov $0,$1
U9200/Tests/CpuTest.asm
sboydlns/univacemulators
2
11008
START DS CL5 * * TEST1 - load, store and add half word * TEST2 - subtract half word * TEST3 - compare half word * TEST4 - logical instructions TM, NI, OI * TEST5 - logical instructions CLI, MVI, AI * TEST6 - character instructions MVC, CLC, TR, MVN * TEST7 - character instructins NC, OC * TEST8 - decimal instructions PACK, UNPK * TEST9 - decimal instructions CP, AP * TEST10 - decimal instructions SP * TEST11 - decimal instructions MP, DP, ZAP * TEST12 - decimal instructions MVO, ED * TEST13 - branch and link BAL * TEST255 - execute all tests * TEST DS XL1 DS CL12 * * Address of first instruction executed after load (STRT) * DC XL2'0080' DS XL2 * * Instruction executed after Clear - Start * B RSET * DS CL102 * * Halt and wait for operator to enter test # at address 5 * STRT HPR X'0001' MVI ALLT,0 LOOP CLI TEST,1 BEQ TST1 CLI TEST,2 BEQ TST2 CLI TEST,3 BEQ TST3 CLI TEST,4 BEQ TST4 CLI TEST,5 BEQ TST5 CLI TEST,6 BEQ TST6 CLI TEST,7 BEQ TST7 CLI TEST,8 BEQ TST8 CLI TEST,9 BEQ TST9 CLI TEST,10 BEQ TSTA CLI TEST,11 BEQ TSTB CLI TEST,12 BEQ TSTC CLI TEST,13 BEQ TSTD CLI TEST,255 BEQ ALL * Invalid test # B STRT * * Do all tests * ALL MVI ALLT,1 MVI TEST,1 B LOOP * * TEST 1 - Test all half word instructions for basic functionality * * Load a value and make sure it loaded properly TST1 LH 8,ONE CH 8,ONE BEQ T11 HPR X'0101' R8 <> X'0001' - FAIL B STRT * Store a value and make sure it stored properly T11 STH 8,TMP1 LH 9,TMP1 CH 9,ONE BEQ T12 HPR X'0102' R9 <> X'0001' - FAIL B STRT * Add two numbers checking all possible condition codes T12 LH 8,ONE AH 8,TWO BP T13 HPR X'0103' R8 NOT POSITIVE - FAIL B STRT T13 CH 8,THRE BEQ T14 HPR X'0104' R8 <> X'0003' - FAIL B STRT T14 LH 8,ONE AH 8,NEG1 BZ T15 HPR X'0105' R8 <> X'0000' - FAIL B STRT T15 LH 8,ZERO AH 8,NEG1 BM T16 HPR X'0106' R8 NOT NEGATIVE - FAIL B STRT T16 CH 8,NEG1 BEQ T17 HPR X'0107' R8 <> X'FFFF' - FAIL B STRT T17 LH 8,MAXH AH 8,ONE BOV T18 HPR X'0108' NO OVERFLOW - FAIL B STRT T18 CH 8,MINH BEQ T19 HPR X'0109' R8 <> X'8000' - FAIL B STRT T19 LH 8,MINH AH 8,NEG1 BOV T1A HPR X'010A' NO OVERFLOW - FAIL B STRT T1A CH 8,MAXH BEQ T1B HPR X'010B' R8 <> X'07FFF' - FAIL B STRT T1B B DONE * * TEST 2 - Subtract two numbers checking all possible condition codes * TST2 LH 8,TWO SH 8,ONE BP T21 HPR X'0201' NOT POSITIVE - FAIL B STRT T21 CH 8,ONE BEQ T22 HPR X'0202' NOT = X'0001' - FAIL B STRT T22 LH 8,ONE SH 8,ONE BZ T23 HPR X'0203' NOT = ZERO - FAIL B STRT T23 LH 8,ZERO SH 8,ONE BM T24 HPR X'0204' NOT NEGATIVE - FAIL T24 CH 8,NEG1 BEQ T25 HPR X'0205' NOT = X'FFFF' - FAIL B STRT T25 LH 8,MAXH SH 8,NEG1 BOV T26 HPR X'0206' NOT OVERFLOW - FAIL B STRT T26 CH 8,MINH BEQ T27 HPR X'0207' NOT = X'8000' - FAIL B STRT T27 LH 8,MINH SH 8,ONE BOV T28 HPR X'0208' NOT OVERFLOW - FAIL T28 CH 8,MAXH BEQ T29 HPR X'0209 NOT = X'07FFF' - FAIL B STRT T29 LH 8,NEG8 SH 8,NEG9 BC 14,T2A HPR X'0209' OVERFLOW FAIL T2A B DONE * * TEST 3 - Check all combinations of compare half word * TST3 LH 8,ONE CH 8,TWO BLT T31 HPR X'0301' NOT < - FAIL B STRT T31 LH 8,TWO CH 8,ONE BGT T32 HPR X'0302' NOT > - FAIL B STRT T32 LH 8,ONE CH 8,ONE BEQ T33 NOT = - FAIL HPR X'0303' B STRT T33 B DONE * * TEST 4 - Check logical instructions TM, NI, OI * TST4 TM XFF,X'55' BC 1,T41 HPR X'0401' TEST FOR ALL ONES MATCH FAILED B STRT T41 TM ZERO,X'55' BC 8,T42 HPR X'0402' TEST FOR NO ONES MATCH FAILED B STRT T42 TM X50,X'55' BC 4,T43 HPR X'0403' TEST FOR SOME ONES MATCH FAILED B STRT T43 LH 8,NEG1 STH 8,TMP1 NI TMP1,X'55' BC 4,T44 HPR X'0404' NOT SOME ONES - FAILED B STRT T44 CLI TMP1,X'55' BEQ T45 HPR X'0405' NOT X'55' - FAILED B STRT T45 NI TMP1,X'AA' BC 8,T46 HPR X'0406' NOT ALL ZEROS - FAILED B STRT T46 CLI TMP1,X'00' BEQ T47 HPR X'0407' NOT = ZERO - FAILED B STRT T47 LH 8,ZERO STH 8,TMP1 OI TMP1,X'00' BC 8,T48 HPR X'0408' NOT ALL ZERO - FAILED B STRT T48 CLI TMP1,X'00' BEQ T49 HPR X'0409' NOT = ZERO - FAILED B STRT T49 OI TMP1,X'55' BC 4,T4A HPR X'040A' NOT SOME ONES - FAILED B STRT T4A CLI TMP1,X'55' BEQ T4B HPR X'040B' NOT = X'55' - FAILED B STRT T4B B DONE * * TEST 5 - CLI, MVI, AI * TST5 MVI TMP1,X'80' CLI TMP1,X'80' BEQ T51 HPR X'0501' NOT = X'80' FAIL B STRT T51 CLI TMP1,X'7F' BGT T52 HPR 'X0502' NOT > - FAIL B STRT T52 CLI TMP1,X'81' BLT T53 HPR X'0503' NOT < - FAIL B STRT T53 LH 8,ZERO STH 8,TMP1 AI TMP1,X'01' BP T54 HPR X'0504' NOT POSITIVE - FAIL B STRT T54 LH 8,TMP1 CH 8,ONE BEQ T55 HPR X'0505' NOT = ONE - FAIL B STRT T55 AI TMP1,X'FF' BZ T56 HPR X'0506' NOT ZERO - FAIL B STRT T56 LH 8,TMP1 CH 8,ZERO BEQ T57 HPR X'0507' NOT = ZERO - FAIL B STRT T57 AI TMP1,X'FF' BM T58 HPR X'0508' NOT NEGATIVE - FAIL B STRT T58 LH 8,TMP1 CH 8,NEG1 BEQ T59 HPR X'0509' B STRT T59 B DONE * * TEST 6 - MVC, CLC, TR, MVN * TST6 MVC TMP2,ABC CLC TMP2,ABC BEQ T61 HPR X'0601' NOT = - FAIL B STRT T61 CLC TMP2,BCD BLT T62 HPR X'0602' NOT < - FAIL B STRT T62 CLC BCD,TMP2 BGT T63 HPR X'0603' NOT > - FAIL B STRT T63 MVC TMP2,XLT TR TMP2,ABC CLC TMP2,ABC BEQ T64 HPR X'0604' NOT = - FAIL B STRT T64 MVC TMP2(5),MVN1 MVN TMP2(5),MVN2 CLC TMP2(5),MVN2 BEQ T65 HPR X'0605' B STRT T65 B DONE * * TEST7 - character instruction NC, OC * TST7 MVC TMP1,ZERO NC TMP1,ONE BC 8,T71 HPR X'0701' NOT ALL ZERO - FAIL B STRT T71 CLC TMP1,ZERO BEQ T72 HPR X'0702' NOT = ZERO - FAIL B STRT T72 MVC TMP1,ONE NC TMP1,THRE BC 4,T73 HPR X'0703' NOT SOME ONES - FAIL B STRT T73 CLC TMP1,ONE BEQ T74 HPR X'0704' NOT = 1 - FAIL B STRT T74 MVC TMP1,ZERO OC TMP1,ZERO BC 8,T75 HPR X'0705' NOT ALL ZERO - FAIL B STRT T75 CLC TMP1,ZERO BEQ T76 HPR X'0706' NOT = ZERO - FAIL B STRT T76 MVC TMP1,ZERO OC TMP1,ONE BC 4,T77 HPR X'0707' NOT SOME ONES - FAIL T77 CLC TMP1,ONE BEQ T78 HPR X'0708' NOT = 1 - FAIL B STRT T78 B DONE * * TEST8 - decimal instructions PACK, UNPK * TST8 PACK TMP3,ZONE CLC TMP3,P3 BEQ T81 HPR X'0801' B STRT T81 PACK TMP4,ZONE CLC TMP4,P4 BEQ T82 HPR X'0802' B STRT T82 PACK TMP5,ZONE CLC TMP5,P5 BEQ T83 HPR X'0803' B STRT T83 UNPK TMP5,P4 CLC TMP5,Z5 BEQ T84 HPR X'0804' B STRT T84 UNPK TMP6,P4 CLC TMP6,Z6 BEQ T85 HPR X'0805' B STRT T85 UNPK TMP7,P4 CLC TMP7,Z7 BEQ T86 HPR X'0806' B STRT T86 B DONE * * TEST9 - decimal instructions CP, AP * TST9 CP P3,P3 BEQ T91 HPR X'0901' NOT = - FAIL B STRT T91 CP P3H,P3 BGT T92 HPR X'0902' NOT > - FAIL B STRT T92 CP P3L,P3 BLT T93 HPR X'0903' NOT < - FAIL B STRT T93 MVC TMP3,PONE AP TMP3,PTWO BP T94 HPR X'0904' NOT POSITIVE - FAIL B STRT T94 CP TMP3,PTHR BEQ T95 HPR X'0905' NOT = 3 - FAIL B STRT T95 MVC TMP3,PONE AP TMP3,PNG1 BZ T96 HPR X'0906' NOT ZERO - FAIL B START T96 MVC TMP3,PZRO AP TMP3,PNG1 BM T97 HPR X'0907' NOT NEGATIVE - FAIL B STRT T97 CP TMP3,PNG1 BEQ T98 HPR X'0908' NOT = -1 - FAIL B STRT T98 MVC TMP3,PMAX AP TMP3,PONE BOV T99 HPR X'0909' NOT OVERFLOW - FAIL B STRT T99 CP TMP3,PZRO BEQ T9A HPR X'090A' NOT = ZERO - FAIL B STRT T9A MVC TMP3,PMIN AP TMP3,PNG1 BOV T9B HPR X'090B' NOT OVERFLOW - FAIL B STRT T9B CP TMP3,PZRO BEQ T9C HPR X'090C' NOT = ZERO - FAIL B STRT T9C B DONE * * TEST10 - decimal instructions SP * TSTA MVC TMP3,PTWO SP TMP3,PONE BP TA1 HPR X'0A01' NOT POSITIVE - FAIL B STRT TA1 CP TMP3,PONE BEQ TA2 HPR X'0A02' NOT = 1 - FAIL B STRT TA2 MVC TMP3,PONE SP TMP3,PONE BZ TA3 HPR X'0A03' NOT ZERO - FAIL B STRT TA3 MVC TMP3,PZRO SP TMP3,PONE BM TA4 HPR X'0A04' NOT NEGATIVE - FAIL B STRT TA4 CP TMP3,PNG1 BEQ TA5 HPR X'0A05' NOT = -1 - FAIL B STRT TA5 MVC TMP3,PMAX SP TMP3,PNG1 BOV TA6 HPR X'0A06' NOT OVERFLOW - FAIL B STRT TA6 CP TMP3,PZRO BEQ TA7 HPR X'0A07' NOT = ZERO - FAIL B STRT TA7 MVC TMP3,PMIN SP TMP3,PONE BOV TA8 HPR X'0A08' NOT OVERFLOW - FAIL B STRT TA8 CP TMP3,PZRO BEQ TA9 HPR X'0A08' NOT = ZERO - FAIL B STRT TA9 B DONE * * TEST11 - decimal instructions MP, DP, ZAP * TSTB ZAP TMP5,PTWO MP TMP5,PTWO CP TMP5,PFOR BEQ TB1 HPR X'0B01' NOT = 4 - FAIL B STRT TB1 ZAP TMP5,PTWO MP TMP5,PNG1 CP TMP5,PNG2 BEQ TB2 HPR X'0B02' NOT = -2 - FAIL B STRT TB2 ZAP TMP5,PFOR DP TMP5,PTWO CP TMP5(2),PTWO BEQ TB3 HPR X'0B03' NOT = 2 - FAIL B STRT TB3 CP TMP5+2(2),PZRO BEQ TB4 HPR X'0B04' NOT = ZERO - FAIL B STRT TB4 ZAP TMP5,PFOR DP TMP5,PNG2+2(2) CP TMP5(2),PNG2+2(2) BEQ TB5 HPR X'0B05' NOT = -2 - FAIL B STRT TB5 CP TMP5+2(2),PZRO BEQ TB6 HPR X'0B06' NOT = ZERO - FAIL B STRT TB6 B DONE * * TEST12 - decimal instructions MVO, ED * TSTC ZAP TMP5,PZRO MVO TMP5,PONE NC TMP5+3(1),X0F CP TMP5,PTEN BEQ TC1 HPR X'0C01' NOT = - FAIL B STRT TC1 MVC TMP8,ED1 ED TMP8,P4 BP TC2 HPR X'0C02' NOT POSITIVE - FAIL B STRT TC2 CLC TMP8,ERS1 BEQ TC3 INCORRECT RESULT - FAIL HPR X'0C03' B STRT TC3 MVC TMP8,ED1 ED TMP8,P4NG BM TC4 HPR X'0C04' NOT NEGATIVE - FAIL B STRT TC4 CLC TMP8,ERS2 BEQ TC5 HPR X'0C05' INCORRECT RESULT - FAIL B STRT TC5 MVC TMP8,ED1 ED TMP8,PZR3 BZ TC6 HPR X'0C06' NOT ZERO - FAIL B STRT TC6 CLC TMP8,ERS3 BEQ TC7 HPR X'0C07' INCORRECT RESULT - FAIL B STRT TC7 MVO P4,P4 TEST OVERLAPPING FIELDS CLC P4,P4O BEQ TC8 HPR X'0C07' B STRT TC8 B DONE * * TEST13 - brank and link BAL * TSTD BAL 8,BAL1 CLI TMP1,X'55' BEQ TD1 HPR X'0D01' B STRT TD1 B DONE BAL1 MVI TMP1,X'55' B 0(,8) * Test successful, notify operator DONE CLI ALLT,1 BNE STOP AI TEST-1,1 B LOOP STOP HPR X'0002' TEST SUCCESSFUL B STRT * * Test Clear - Start (reset) functionality * RSET HPR X'7FFF' B STRT ZERO DC XL2'0' ONE DC XL2'1' TWO DC XL2'2' THRE DC XL2'3' NEG1 DC XL2'FFFF' MAXH DC XL2'7FFF' MINH DC XL2'8000' TMP1 DS XL2 X50 DC XL1'50' XFF DC XL1'FF' ABC DC CL16'ABCDEF0123456789' BCD DC CL16'BCDEF01234567899' XLT DC XL16'000102030405060708090A0B0C0D0E0F' MVN1 DC CL5'ABCDE' MVN2 DC CL5'EDCBA' TMP2 DS CL16 ZONE DC CL5'12345' TMP3 DS XL2 TMP4 DS XL3 TMP5 DS XL4 TMP6 DS XL5 TMP7 DS XL6 TMP8 DS CL8 P3 DC XL2'345F' P3H DC XL2'456F' P3L DC XL2'234F' P4 DC XL3'12345F' P4O DC XL3'2345FF' P4NG DC XL3'12345D' P5 DC XL4'0012345F' Z5 DC CL4'2345' Z6 DC CL5'12345' Z7 DC CL6'012345' PONE DC XL2'001C' PTWO DC XL2'002C' PTHR DC XL2'003C' PFOR DC XL4'0000004C' PTEN DC XL4'0000010C' PZRO DC XL2'000C' PZR3 DC XL3'00000C' PNG1 DC XL2'001D' PNG2 DC XL4'0000002D' PMAX DC XL2'999C' PMIN DC XL2'999D' X0F DC XL1'0F' ED1 DC CL1' ' DC XL2'2020' DC CL1',' DC XL3'202120' DC CL1'-' ERS1 DC CL8' 12,345 ' ERS2 DC CL8' 12,345-' ERS3 DC CL8' 0 ' ALLT DC XL1'0' NEG8 DC XL2'8002' NEG9 DC XL2'8000' END STRT
archive/agda-3/src/Oscar/Class/Reflexivity/Function.agda
m0davis/oscar
0
6017
open import Oscar.Prelude open import Oscar.Class open import Oscar.Class.Reflexivity module Oscar.Class.Reflexivity.Function where module _ {a} where instance 𝓡eflexivityFunction : Reflexivity.class Function⟦ a ⟧ 𝓡eflexivityFunction .⋆ = ¡
programs/oeis/037/A037165.asm
neoneye/loda
22
88593
; A037165: a(n) = prime(n)*prime(n+1) - prime(n) - prime(n+1). ; 1,7,23,59,119,191,287,395,615,839,1079,1439,1679,1931,2391,3015,3479,3959,4619,5039,5615,6395,7215,8447,9599,10199,10811,11447,12095,14111,16379,17679,18767,20423,22199,23399,25271,26891,28551,30615,32039,34199,36479,37631,38807,41579,46619,50171,51527,52895,55215,57119,59999,63999,67071,70215,72359,74519,77279,78959,82343,89351,94859,96719,98591,104279,110879,116255,120407,122495,126015,131027,136151,140615,144395,148215,153647,158399,163199,170543,175559,180599,185759,189215,193595,198015,204287,209759,212519,215291,222747,232307,238139,244019,249995,255015,264159,271439,281879,294839 seq $0,40 ; The prime numbers. seq $0,13636 ; n*nextprime(n). mov $1,$0 seq $1,3415 ; a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(mn) = m*a(n) + n*a(m). sub $0,$1 div $0,2 mul $0,2 add $0,1
programs/oeis/050/A050407.asm
karttu/loda
1
865
<filename>programs/oeis/050/A050407.asm<gh_stars>1-10 ; A050407: a(n) = n*(n^2 - 6*n + 11)/6. ; 0,1,1,1,2,5,11,21,36,57,85,121,166,221,287,365,456,561,681,817,970,1141,1331,1541,1772,2025,2301,2601,2926,3277,3655,4061,4496,4961,5457,5985,6546,7141,7771,8437,9140,9881,10661,11481,12342,13245,14191,15181,16216,17297,18425,19601,20826,22101,23427,24805,26236,27721,29261,30857,32510,34221,35991,37821,39712,41665,43681,45761,47906,50117,52395,54741,57156,59641,62197,64825,67526,70301,73151,76077,79080,82161,85321,88561,91882,95285,98771,102341,105996,109737,113565,117481,121486,125581,129767,134045,138416,142881,147441,152097,156850,161701,166651,171701,176852,182105,187461,192921,198486,204157,209935,215821,221816,227921,234137,240465,246906,253461,260131,266917,273820,280841,287981,295241,302622,310125,317751,325501,333376,341377,349505,357761,366146,374661,383307,392085,400996,410041,419221,428537,437990,447581,457311,467181,477192,487345,497641,508081,518666,529397,540275,551301,562476,573801,585277,596905,608686,620621,632711,644957,657360,669921,682641,695521,708562,721765,735131,748661,762356,776217,790245,804441,818806,833341,848047,862925,877976,893201,908601,924177,939930,955861,971971,988261,1004732,1021385,1038221,1055241,1072446,1089837,1107415,1125181,1143136,1161281,1179617,1198145,1216866,1235781,1254891,1274197,1293700,1313401,1333301,1353401,1373702,1394205,1414911,1435821,1456936,1478257,1499785,1521521,1543466,1565621,1587987,1610565,1633356,1656361,1679581,1703017,1726670,1750541,1774631,1798941,1823472,1848225,1873201,1898401,1923826,1949477,1975355,2001461,2027796,2054361,2081157,2108185,2135446,2162941,2190671,2218637,2246840,2275281,2303961,2332881,2362042,2391445,2421091,2450981,2481116,2511497 sub $0,1 bin $0,3 add $0,1 mov $1,$0
lists/listsummation.asm
ihasdapie/AssemblyLearning
1
25213
section .data ; standard constants LF equ 10 NULL equ 0 TRUE equ 1 FALSE equ 0 EXIT_SUCCESS equ 0 STDIN equ 0 STDOUT equ 1 STDERR equ 2 SYS_read equ 0 SYS_write equ 1 SYS_open equ 2 SYS_close equ 3 SYS_fork equ 57 SYS_exit equ 60 SYS_create equ 85 SYS_time equ 201 ; my variables myList dd 1,2,3,4,5,100,920,85 myListLen dd 8 sum dd 0 section .text global _start _start: ; process: ; for x in range(myListLen): ; sum = sum + list[x] ; register to store current list value r9d ; register to store index at x rsi (counter) ; register for loop (ecx loop <>) mov ecx, dword [myListLen] mov r9d, 0 ;sum mov rsi, 0 ; counter sumLoop: mov r9d, dword [myList+(rsi*4)]; dword is 4 bytes add dword [sum], r9d inc rsi loop sumLoop done: mov rax, SYS_exit mov rdi, EXIT_SUCCESS syscall
gcc-gcc-7_3_0-release/gcc/ada/exp_ch12.adb
best08618/asylo
7
30260
<reponame>best08618/asylo<filename>gcc-gcc-7_3_0-release/gcc/ada/exp_ch12.adb ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- E X P _ C H 1 2 -- -- -- -- B o d y -- -- -- -- Copyright (C) 1997-2011, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Atree; use Atree; with Checks; use Checks; with Einfo; use Einfo; with Exp_Util; use Exp_Util; with Nmake; use Nmake; with Sinfo; use Sinfo; with Snames; use Snames; with Stand; use Stand; with Tbuild; use Tbuild; package body Exp_Ch12 is ------------------------------------ -- Expand_N_Generic_Instantiation -- ------------------------------------ -- If elaboration entity is defined and this is not an outer level entity, -- we need to generate a check for it here. procedure Expand_N_Generic_Instantiation (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); Ent : constant Entity_Id := Entity (Name (N)); begin if Etype (Name (N)) = Any_Type then return; end if; if Present (Elaboration_Entity (Ent)) and then not Is_Compilation_Unit (Ent) and then not Elaboration_Checks_Suppressed (Ent) then Insert_Action (Instance_Spec (N), Make_Raise_Program_Error (Loc, Condition => Make_Op_Not (Loc, Right_Opnd => Make_Attribute_Reference (Loc, Attribute_Name => Name_Elaborated, Prefix => New_Occurrence_Of (Ent, Loc))), Reason => PE_Access_Before_Elaboration)); end if; end Expand_N_Generic_Instantiation; end Exp_Ch12;
orka/src/gl/implementation/gl-api-uniforms-doubles.ads
onox/orka
52
9760
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2016 onox <<EMAIL>> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. package GL.API.Uniforms.Doubles is pragma Preelaborate; use GL.Types.Doubles; package Uniform1 is new Loader.Procedure_With_3_Params ("glProgramUniform1d", UInt, Int, Double); package Uniform2v is new Loader.Procedure_With_4_Params ("glProgramUniform2dv", UInt, Int, Size, Vector2_Array); package Uniform3v is new Loader.Procedure_With_4_Params ("glProgramUniform3dv", UInt, Int, Size, Vector3_Array); package Uniform4v is new Loader.Procedure_With_4_Params ("glProgramUniform4dv", UInt, Int, Size, Vector4_Array); package Uniform_Matrix4 is new Loader.Procedure_With_5_Params ("glProgramUniformMatrix4dv", UInt, Int, Size, Low_Level.Bool, Matrix4_Array); end GL.API.Uniforms.Doubles;
oeis/001/A001526.asm
neoneye/loda-programs
11
19308
<reponame>neoneye/loda-programs ; A001526: (7n+1)(7n+6). ; 6,104,300,594,986,1476,2064,2750,3534,4416,5396,6474,7650,8924,10296,11766,13334,15000,16764,18626,20586,22644,24800,27054,29406,31856,34404,37050,39794,42636,45576,48614,51750,54984,58316,61746,65274,68900,72624,76446,80366,84384,88500,92714,97026,101436,105944,110550,115254,120056,124956,129954,135050,140244,145536,150926,156414,162000,167684,173466,179346,185324,191400,197574,203846,210216,216684,223250,229914,236676,243536,250494,257550,264704,271956,279306,286754,294300,301944,309686 add $0,1 bin $0,2 mul $0,98 add $0,6
src/gen/gstreamer-gst_low_level-gstreamer_0_10_gst_video_gstbasevideodecoder_h.ads
persan/A-gst
1
5140
<gh_stars>1-10 pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; with System; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideocodec_h; with glib; with glib.Values; with System; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_base_gstadapter_h; -- limited with GStreamer.GST_Low_Level.glib_2_0_glib_glist_h; with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h; with glib; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideodecoder_h is -- unsupported macro: GST_TYPE_BASE_VIDEO_DECODER (gst_base_video_decoder_get_type()) -- arg-macro: function GST_BASE_VIDEO_DECODER (obj) -- return G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_VIDEO_DECODER,GstBaseVideoDecoder); -- arg-macro: function GST_BASE_VIDEO_DECODER_CLASS (klass) -- return G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASE_VIDEO_DECODER,GstBaseVideoDecoderClass); -- arg-macro: function GST_BASE_VIDEO_DECODER_GET_CLASS (obj) -- return G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_BASE_VIDEO_DECODER,GstBaseVideoDecoderClass); -- arg-macro: function GST_IS_BASE_VIDEO_DECODER (obj) -- return G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_VIDEO_DECODER); -- arg-macro: function GST_IS_BASE_VIDEO_DECODER_CLASS (obj) -- return G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_VIDEO_DECODER); GST_BASE_VIDEO_DECODER_SINK_NAME : aliased constant String := "sink" & ASCII.NUL; -- gst/video/gstbasevideodecoder.h:53 GST_BASE_VIDEO_DECODER_SRC_NAME : aliased constant String := "src" & ASCII.NUL; -- gst/video/gstbasevideodecoder.h:59 -- unsupported macro: GST_BASE_VIDEO_DECODER_FLOW_NEED_DATA GST_FLOW_CUSTOM_SUCCESS -- unsupported macro: GST_BASE_VIDEO_DECODER_FLOW_DROPPED GST_FLOW_CUSTOM_SUCCESS_1 -- unsupported macro: GST_BASE_AUDIO_DECODER_ERROR(el,w,domain,code,text,debug,ret) G_STMT_START { gchar *__txt = _gst_element_error_printf text; gchar *__dbg = _gst_element_error_printf debug; GstBaseVideoDecoder *dec = GST_BASE_VIDEO_DECODER (el); ret = _gst_base_video_decoder_error (dec, w, GST_ ## domain ## _ERROR, GST_ ## domain ## _ERROR_ ## code, __txt, __dbg, __FILE__, GST_FUNCTION, __LINE__); } G_STMT_END -- GStreamer -- * Copyright (C) 2008 <NAME> <<EMAIL>> -- * Copyright (C) 2011 <NAME> <<EMAIL>>. -- * Copyright (C) 2011 Nokia Corporation. All rights reserved. -- * Contact: <NAME> <<EMAIL>> -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, or (at your option) any later version. -- * -- * This 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 -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the -- * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- * Boston, MA 02111-1307, USA. -- --* -- * GST_BASE_VIDEO_DECODER_SINK_NAME: -- * -- * The name of the templates for the sink pad. -- --* -- * GST_BASE_VIDEO_DECODER_SRC_NAME: -- * -- * The name of the templates for the source pad. -- --* -- * GST_BASE_VIDEO_DECODER_FLOW_NEED_DATA: -- * -- * Returned while parsing to indicate more data is needed. -- * --* -- * GST_BASE_VIDEO_DECODER_FLOW_DROPPED: -- * -- * Returned when the event/buffer should be dropped. -- type GstBaseVideoDecoder; type u_GstBaseVideoDecoder_padding_array is array (0 .. 19) of System.Address; --subtype GstBaseVideoDecoder is u_GstBaseVideoDecoder; -- gst/video/gstbasevideodecoder.h:75 type GstBaseVideoDecoderClass; type u_GstBaseVideoDecoderClass_padding_array is array (0 .. 19) of System.Address; --subtype GstBaseVideoDecoderClass is u_GstBaseVideoDecoderClass; -- gst/video/gstbasevideodecoder.h:76 -- do not use this one, use macro below -- skipped func _gst_base_video_decoder_error --* -- * GST_BASE_VIDEO_DECODER_ERROR: -- * @el: the base video decoder element that generates the error -- * @weight: element defined weight of the error, added to error count -- * @domain: like CORE, LIBRARY, RESOURCE or STREAM (see #gstreamer-GstGError) -- * @code: error code defined for that domain (see #gstreamer-GstGError) -- * @text: the message to display (format string and args enclosed in -- * parentheses) -- * @debug: debugging information for the message (format string and args -- * enclosed in parentheses) -- * @ret: variable to receive return value -- * -- * Utility function that audio decoder elements can use in case they encountered -- * a data processing error that may be fatal for the current "data unit" but -- * need not prevent subsequent decoding. Such errors are counted and if there -- * are too many, as configured in the context's max_errors, the pipeline will -- * post an error message and the application will be requested to stop further -- * media processing. Otherwise, it is considered a "glitch" and only a warning -- * is logged. In either case, @ret is set to the proper value to -- * return to upstream/caller (indicating either GST_FLOW_ERROR or GST_FLOW_OK). -- --* -- * GstBaseVideoDecoder: -- * -- * The opaque #GstBaseVideoDecoder data structure. -- type GstBaseVideoDecoder is record base_video_codec : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideocodec_h.GstBaseVideoCodec; -- gst/video/gstbasevideodecoder.h:125 sink_clipping : aliased GLIB.gboolean; -- gst/video/gstbasevideodecoder.h:128 do_byte_time : aliased GLIB.gboolean; -- gst/video/gstbasevideodecoder.h:129 packetized : aliased GLIB.gboolean; -- gst/video/gstbasevideodecoder.h:130 max_errors : aliased GLIB.gint; -- gst/video/gstbasevideodecoder.h:131 input_adapter : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_base_gstadapter_h.GstAdapter; -- gst/video/gstbasevideodecoder.h:135 output_adapter : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_base_gstadapter_h.GstAdapter; -- gst/video/gstbasevideodecoder.h:137 current_frame : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideocodec_h.GstVideoFrame; -- gst/video/gstbasevideodecoder.h:145 current_frame_events : access GStreamer.GST_Low_Level.glib_2_0_glib_glist_h.GList; -- gst/video/gstbasevideodecoder.h:147 input_offset : aliased GLIB.guint64; -- gst/video/gstbasevideodecoder.h:149 frame_offset : aliased GLIB.guint64; -- gst/video/gstbasevideodecoder.h:151 timestamps : access GStreamer.GST_Low_Level.glib_2_0_glib_glist_h.GList; -- gst/video/gstbasevideodecoder.h:153 have_sync : aliased GLIB.gboolean; -- gst/video/gstbasevideodecoder.h:155 timestamp_offset : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime; -- gst/video/gstbasevideodecoder.h:160 field_index : aliased int; -- gst/video/gstbasevideodecoder.h:161 last_timestamp : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime; -- gst/video/gstbasevideodecoder.h:164 error_count : aliased GLIB.gint; -- gst/video/gstbasevideodecoder.h:165 gather : access GStreamer.GST_Low_Level.glib_2_0_glib_glist_h.GList; -- gst/video/gstbasevideodecoder.h:169 parse : access GStreamer.GST_Low_Level.glib_2_0_glib_glist_h.GList; -- gst/video/gstbasevideodecoder.h:171 parse_gather : access GStreamer.GST_Low_Level.glib_2_0_glib_glist_h.GList; -- gst/video/gstbasevideodecoder.h:173 decode : access GStreamer.GST_Low_Level.glib_2_0_glib_glist_h.GList; -- gst/video/gstbasevideodecoder.h:175 queued : access GStreamer.GST_Low_Level.glib_2_0_glib_glist_h.GList; -- gst/video/gstbasevideodecoder.h:177 process : aliased GLIB.gboolean; -- gst/video/gstbasevideodecoder.h:178 base_picture_number : aliased GLIB.guint64; -- gst/video/gstbasevideodecoder.h:181 reorder_depth : aliased int; -- gst/video/gstbasevideodecoder.h:182 distance_from_sync : aliased int; -- gst/video/gstbasevideodecoder.h:183 dropped : aliased GLIB.guint; -- gst/video/gstbasevideodecoder.h:186 processed : aliased GLIB.guint; -- gst/video/gstbasevideodecoder.h:187 padding : u_GstBaseVideoDecoder_padding_array; -- gst/video/gstbasevideodecoder.h:190 end record; pragma Convention (C_Pass_By_Copy, GstBaseVideoDecoder); -- gst/video/gstbasevideodecoder.h:123 --< protected > -- parse tracking -- input data -- assembles current frame --< private > -- FIXME move to real private part ? -- * (and introduce a context ?) -- ... being tracked here; -- * only available during parsing -- FIXME remove and add parameter to method -- events that should apply to the current frame -- relative offset of input data -- relative offset of frame -- tracking ts and offsets -- whether parsing is in sync -- maybe sort-of protected ? -- combine to yield (presentation) ts -- last outgoing ts -- reverse playback -- collect input -- to-be-parsed -- collected parsed frames -- frames to be handled == decoded -- collected output -- no comment ... -- qos messages: frames dropped/processed -- FIXME before moving to base --* -- * GstBaseVideoDecoderClass: -- * @start: Optional. -- * Called when the element starts processing. -- * Allows opening external resources. -- * @stop: Optional. -- * Called when the element stops processing. -- * Allows closing external resources. -- * @set_format: Notifies subclass of incoming data format (caps). -- * @scan_for_sync: Optional. -- * Allows subclass to obtain sync for subsequent parsing -- * by custom means (above an beyond scanning for specific -- * marker and mask). -- * @parse_data: Required for non-packetized input. -- * Allows chopping incoming data into manageable units (frames) -- * for subsequent decoding. -- * @reset: Optional. -- * Allows subclass (codec) to perform post-seek semantics reset. -- * @handle_frame: Provides input data frame to subclass. -- * @finish: Optional. -- * Called to request subclass to dispatch any pending remaining -- * data (e.g. at EOS). -- * -- * Subclasses can override any of the available virtual methods or not, as -- * needed. At minimum @handle_frame needs to be overridden, and @set_format -- * and likely as well. If non-packetized input is supported or expected, -- * @parse needs to be overridden as well. -- type GstBaseVideoDecoderClass is record base_video_codec_class : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideocodec_h.GstBaseVideoCodecClass; -- gst/video/gstbasevideodecoder.h:223 start : access function (arg1 : access GstBaseVideoDecoder) return GLIB.gboolean; -- gst/video/gstbasevideodecoder.h:225 stop : access function (arg1 : access GstBaseVideoDecoder) return GLIB.gboolean; -- gst/video/gstbasevideodecoder.h:227 scan_for_sync : access function (arg1 : access GstBaseVideoDecoder; arg2 : GLIB.gboolean; arg3 : int; arg4 : int) return int; -- gst/video/gstbasevideodecoder.h:230 parse_data : access function (arg1 : access GstBaseVideoDecoder; arg2 : GLIB.gboolean) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstFlowReturn; -- gst/video/gstbasevideodecoder.h:232 set_format : access function (arg1 : access GstBaseVideoDecoder; arg2 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideocodec_h.GstVideoState) return GLIB.gboolean; -- gst/video/gstbasevideodecoder.h:234 reset : access function (arg1 : access GstBaseVideoDecoder) return GLIB.gboolean; -- gst/video/gstbasevideodecoder.h:236 finish : access function (arg1 : access GstBaseVideoDecoder) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstFlowReturn; -- gst/video/gstbasevideodecoder.h:238 handle_frame : access function (arg1 : access GstBaseVideoDecoder; arg2 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideocodec_h.GstVideoFrame) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstFlowReturn; -- gst/video/gstbasevideodecoder.h:240 capture_mask : aliased GLIB.guint32; -- gst/video/gstbasevideodecoder.h:244 capture_pattern : aliased GLIB.guint32; -- gst/video/gstbasevideodecoder.h:245 padding : u_GstBaseVideoDecoderClass_padding_array; -- gst/video/gstbasevideodecoder.h:248 end record; pragma Convention (C_Pass_By_Copy, GstBaseVideoDecoderClass); -- gst/video/gstbasevideodecoder.h:221 --< private > -- FIXME before moving to base procedure gst_base_video_decoder_class_set_capture_pattern (klass : access GstBaseVideoDecoderClass; mask : GLIB.guint32; pattern : GLIB.guint32); -- gst/video/gstbasevideodecoder.h:251 pragma Import (C, gst_base_video_decoder_class_set_capture_pattern, "gst_base_video_decoder_class_set_capture_pattern"); function gst_base_video_decoder_get_frame (coder : access GstBaseVideoDecoder; frame_number : int) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideocodec_h.GstVideoFrame; -- gst/video/gstbasevideodecoder.h:254 pragma Import (C, gst_base_video_decoder_get_frame, "gst_base_video_decoder_get_frame"); function gst_base_video_decoder_get_oldest_frame (coder : access GstBaseVideoDecoder) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideocodec_h.GstVideoFrame; -- gst/video/gstbasevideodecoder.h:256 pragma Import (C, gst_base_video_decoder_get_oldest_frame, "gst_base_video_decoder_get_oldest_frame"); procedure gst_base_video_decoder_add_to_frame (base_video_decoder : access GstBaseVideoDecoder; n_bytes : int); -- gst/video/gstbasevideodecoder.h:258 pragma Import (C, gst_base_video_decoder_add_to_frame, "gst_base_video_decoder_add_to_frame"); procedure gst_base_video_decoder_lost_sync (base_video_decoder : access GstBaseVideoDecoder); -- gst/video/gstbasevideodecoder.h:260 pragma Import (C, gst_base_video_decoder_lost_sync, "gst_base_video_decoder_lost_sync"); function gst_base_video_decoder_have_frame (base_video_decoder : access GstBaseVideoDecoder) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstFlowReturn; -- gst/video/gstbasevideodecoder.h:261 pragma Import (C, gst_base_video_decoder_have_frame, "gst_base_video_decoder_have_frame"); procedure gst_base_video_decoder_set_sync_point (base_video_decoder : access GstBaseVideoDecoder); -- gst/video/gstbasevideodecoder.h:263 pragma Import (C, gst_base_video_decoder_set_sync_point, "gst_base_video_decoder_set_sync_point"); function gst_base_video_decoder_set_src_caps (base_video_decoder : access GstBaseVideoDecoder) return GLIB.gboolean; -- gst/video/gstbasevideodecoder.h:264 pragma Import (C, gst_base_video_decoder_set_src_caps, "gst_base_video_decoder_set_src_caps"); function gst_base_video_decoder_alloc_src_buffer (base_video_decoder : access GstBaseVideoDecoder) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/video/gstbasevideodecoder.h:265 pragma Import (C, gst_base_video_decoder_alloc_src_buffer, "gst_base_video_decoder_alloc_src_buffer"); function gst_base_video_decoder_alloc_src_frame (base_video_decoder : access GstBaseVideoDecoder; frame : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideocodec_h.GstVideoFrame) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstFlowReturn; -- gst/video/gstbasevideodecoder.h:266 pragma Import (C, gst_base_video_decoder_alloc_src_frame, "gst_base_video_decoder_alloc_src_frame"); function gst_base_video_decoder_get_state (base_video_decoder : access GstBaseVideoDecoder) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideocodec_h.GstVideoState; -- gst/video/gstbasevideodecoder.h:268 pragma Import (C, gst_base_video_decoder_get_state, "gst_base_video_decoder_get_state"); function gst_base_video_decoder_get_max_decode_time (base_video_decoder : access GstBaseVideoDecoder; frame : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideocodec_h.GstVideoFrame) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTimeDiff; -- gst/video/gstbasevideodecoder.h:269 pragma Import (C, gst_base_video_decoder_get_max_decode_time, "gst_base_video_decoder_get_max_decode_time"); function gst_base_video_decoder_finish_frame (base_video_decoder : access GstBaseVideoDecoder; frame : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideocodec_h.GstVideoFrame) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstFlowReturn; -- gst/video/gstbasevideodecoder.h:272 pragma Import (C, gst_base_video_decoder_finish_frame, "gst_base_video_decoder_finish_frame"); function gst_base_video_decoder_drop_frame (dec : access GstBaseVideoDecoder; frame : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideocodec_h.GstVideoFrame) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstFlowReturn; -- gst/video/gstbasevideodecoder.h:274 pragma Import (C, gst_base_video_decoder_drop_frame, "gst_base_video_decoder_drop_frame"); function gst_base_video_decoder_get_type return GLIB.GType; -- gst/video/gstbasevideodecoder.h:276 pragma Import (C, gst_base_video_decoder_get_type, "gst_base_video_decoder_get_type"); end GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_gstbasevideodecoder_h;
GoodLang/src/com/itmo/obobrov/GoodLang.g4
olegggatttor/MT
0
6946
grammar GoodLang; program : NL* (entities (NL+ | EOF))* EOF ; entities : function ; function : AT NAME (LPAR argument (COMMA argument)* RPAR)? LSCOPE body? RSCOPE ; argument : NAME ; body : ((loop | assigment | ret | call | read | write | when | ) NL)* ; when : WHEN LSCOPE whenBody RSCOPE ; whenBody : whenCond* elseBranch? NL* ; elseBranch : (OTHERWISE DO ((LSCOPE body? RSCOPE) | body)) | NL ; whenCond : (orCondition DO ((LSCOPE body? RSCOPE) | body)) | NL ; read : NAME READ ; write : expression WRITE ; ret : RET expression; assigment :NAME (COMMA NAME)* ASSIGN expression (COMMA expression)* ; loop : WHILE orCondition LSCOPE body? RSCOPE ; orCondition : andCondition (OR andCondition)* ; andCondition : condition (AND condition)* ; condition : NOT condition | LPAR orCondition RPAR | expression cmp expression | TRUE | FALSE ; cmp : EQ | LT | GT | LE | GE | NE ; expression : multiplier (MUL multiplier | DIV multiplier)* ; multiplier : element (ADD element | SUB element)* ; element : (SUB element) | (ADD element) | CONST | NAME | call | LPAR expression RPAR ; call : NAME LPAR expression? (COMMA expression)* RPAR ; OTHERWISE : 'otherwise' ; WHEN : 'when' ; DO : 'do' ; READ : '<-' ; WRITE : '->' ; RET : 'ret' ; ADD : '+' ; SUB : '-' ; MUL : '*' ; DIV : '/' ; ASSIGN : '=' ; WHILE : 'while' ; CONST : [1-9][0-9]* | '0' ; TRUE : 'True' ; FALSE : 'False' ; EQ : '==' ; LT : '<' ; GT : '>' ; LE : '<=' ; GE : '>=' ; NE : '!=' ; NOT : '!' ; AND : 'and' ; OR : 'or' ; LSCOPE : '{' ; RSCOPE : '}' ; LPAR : '(' ; RPAR : ')' ; DOTS : ':' ; COMMA : ',' ; AT : '@' ; NAME : [a-zA-Z][a-zA-Z0-9]* ; NL : [\n\r] ; BLANK : [\t ] -> skip ;
1A/S5/PIM/tps/tp8generique/frequences_caracteres.adb
MOUDDENEHamza/ENSEEIHT
4
8810
with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with ABR; -- Afficher la fréquence absolue des caractères d'une chaîne de caractère. procedure Frequences_Caracteres is package ABR_String_Integer is new ABR (T_Cle => Character, T_Donnee => Integer, "<" => "<"); use ABR_String_Integer; procedure Afficher (C : in Character) is begin Put ("'" & C & "'"); end Afficher; procedure Afficher (N : in Integer) is begin Put (N, 1); end Afficher; procedure Afficher_Debug is new ABR_String_Integer.Afficher_Debug (Afficher, Afficher); procedure Afficher is new ABR_String_Integer.Afficher (Afficher, Afficher); -- Calculer la fréquence absolue (Frequences) de chaque caractère de Texte. procedure Calculer_Frequences_Absolues (Texte : in String ; Frequences : out T_ABR) is begin Initialiser (Frequences); for I in Texte'Range loop declare C : constant Character := Texte (I); begin Modifier (Frequences, C, La_Donnee (Frequences, C) + 1); exception when Cle_Absente_Exception => Inserer (Frequences, C, 1); end; end loop; end Calculer_Frequences_Absolues; Frequences: T_ABR; begin Calculer_Frequences_Absolues ("DCEFABCCAABAA", Frequences); -- afficher les résultats Put_Line ("Nombre de caractères différents : " & Integer'Image (Taille (Frequences))); Afficher (Frequences); Afficher_Debug (Frequences); -- vérifier les résulats pragma Assert (Taille (Frequences) = 6); pragma Assert (La_Donnee (Frequences, 'A') = 5); pragma Assert (La_Donnee (Frequences, 'B') = 2); pragma Assert (La_Donnee (Frequences, 'C') = 3); for C in Character range 'D'..'F' loop pragma Assert (La_Donnee (Frequences, C) = 1); end loop; end Frequences_Caracteres;
Structure/Category.agda
Lolirofle/stuff-in-agda
6
16344
<filename>Structure/Category.agda import Lvl module Structure.Category {ℓₒ ℓₘ ℓₑ : Lvl.Level} where open import Functional using (swap) open import Logic open import Logic.Propositional import Structure.Categorical.Names as Names open import Structure.Categorical.Properties open import Structure.Semicategory{ℓₒ}{ℓₘ}{ℓₑ} open import Structure.Operator import Structure.Relator.Names as Names open import Structure.Relator.Properties open import Structure.Setoid open import Type -- Obj is the collection of objects. -- _⟶_ is the collection of morphisms. module _ {Obj : Type{ℓₒ}} (_⟶_ : Obj → Obj → Type{ℓₘ}) ⦃ morphism-equiv : ∀{x y} → Equiv{ℓₑ}(x ⟶ y) ⦄ where -- A category is a structure on a relation called a morphism. -- -- It can be seen as a generalization of the structure in functions between a collection of types/sets. -- More specifically, the algebraic properties of functions regarding composition and the identity function. -- In this case, sets are objects and functions are morphisms. -- See `Type.Category`. -- -- It can also be seen as a generalized algebraic structure, or more specifically a generalization of monoids. -- The type of a monoid's operator is usually restricted to a single type, but a category allows it to vary (depending on the rules of morphism instead). -- (One can loosely call a category to be a monoid without the "closed" property of algebraic structures). -- In this case, the binary operation is (_∘_) and the laws are the usual identity and associative laws. -- See `Structure.Category.Monoid`. -- -- A category can also be constructed by letting objects be the models of algebraic structures, and morphisms the homomorphisms of the respective algebraic structure. -- -- In the case of categories being the objects in a category, functors are homomorphisms, and therefore also the morphisms. -- See `Structure.Category.Category`. -- -- An alternative interpretation of the definition: -- A type (Obj) and a binary relation (Morphism) on this type is a category when: -- • The relator is transitive. -- • The relator is reflexive. -- • The reflexivity proof inside the transitivity proof does not result in a new proof. -- • Chains of the transitivity proofs can be applied in any order and the resulting proof will be the same. -- See `Relator.Equals.Category` for an example of this kind of binary relation. -- -- A more concrete interpretation of the binary relation one is that a category describes a graph. -- Vertices are objects and morphisms are paths between the vertices. -- The operator joins two paths into one, and the identity is a loop (the empty path). -- See `Graph.Category`. -- -- A category is the common pattern seen in all the examples above. record Category : Stmt{ℓₒ Lvl.⊔ ℓₘ Lvl.⊔ ℓₑ} where field -- Existence of morphisms constructed by connecting two morphisms (The composition of two morphisms). -- Existence of a binary operator on morphisms connecting the ends of two morphisms. -- Also a proof of transitivity for the binary relator (_⟶_). -- Note that this is the operator like the operators in other algebraic structures with binary operators -- ∀{x y z : Obj} → (y ⟶ z) → (x ⟶ y) → (x ⟶ z) _∘_ : Names.SwappedTransitivity(_⟶_) -- Existence of a morphism connected to itself (The identity morphism). -- Also a proof of reflexivity for the binary relator (_⟶_). -- ∀{x : Obj} → (x ⟶ x) id : Names.Reflexivity(_⟶_) infixr 20 _∘_ field -- The binary operator respects the equivalence relation. ⦃ binaryOperator ⦄ : ∀{x y z} → BinaryOperator(_∘_ {x}{y}{z}) -- The binary operator on mophisms is associative. -- Or, the order of applying two transitivies on three proofs does not matter. It is the same proof. -- ∀{x y z w : Obj}{f : y ⟶ x}{g : z ⟶ y}{h : w ⟶ z} → ((f ∘ g) ∘ h ≡ f ∘ (g ∘ h)) ⦃ associativity ⦄ : Morphism.Associativity(\{x} → _∘_ {x}) -- The morphism `id` behaves like aa identity element with respect to the binary operator. -- Or, applying the proof of reflexivity on transitivity is an identity function for proofs. ⦃ identity ⦄ : Morphism.Identity(_∘_)(\{x} → id{x}) instance identityₗ : Morphism.Identityₗ(_∘_)(\{x} → id{x}) identityₗ = [∧]-elimₗ identity instance identityᵣ : Morphism.Identityᵣ(_∘_)(\{x} → id{x}) identityᵣ = [∧]-elimᵣ identity -- As stated in `id`, this can be interpreted as proof of reflexivity when `Morphism` is interpreted as a binary relation. morphism-reflexivity : Reflexivity(_⟶_) morphism-reflexivity = intro id semicategory : Semicategory(_⟶_) Semicategory._∘_ semicategory = _∘_ Semicategory.binaryOperator semicategory = binaryOperator Semicategory.associativity semicategory = associativity open Semicategory(semicategory) hiding (_∘_ ; binaryOperator ; associativity) public -- A category object can be used when one refers to a category as an object. -- Examples of usage are in functors (morphism between categories) or in equivalences of categories. record CategoryObject : Stmt{Lvl.𝐒(ℓₒ Lvl.⊔ ℓₘ Lvl.⊔ ℓₑ)} where constructor intro field {Object} : Type{ℓₒ} {Morphism} : Object → Object → Type{ℓₘ} ⦃ morphism-equiv ⦄ : ∀{x y} → Equiv{ℓₑ}(Morphism x y) category : Category(Morphism) instance category-instance = category
experiments/test-suite/mutation-based/10/4/balancedBST.als
kaiyuanw/AlloyFLCore
1
1198
<gh_stars>1-10 pred test70 { some disj BinaryTree0: BinaryTree {some disj Node0, Node1, Node2, Node3: Node { BinaryTree = BinaryTree0 root = BinaryTree0->Node3 Node = Node0 + Node1 + Node2 + Node3 left = Node2->Node1 + Node3->Node2 right = Node3->Node0 elem = Node0->7 + Node1->7 + Node2->-5 + Node3->-8 Balanced[] }} } run test70 for 4 expect 1 pred test104 { some disj BinaryTree0: BinaryTree {some disj Node0, Node1, Node2: Node { BinaryTree = BinaryTree0 root = BinaryTree0->Node2 Node = Node0 + Node1 + Node2 no left right = Node1->Node0 + Node2->Node1 elem = Node0->5 + Node1->5 + Node2->-1 }} } run test104 for 4 expect 1 pred test94 { some disj BinaryTree0: BinaryTree {some disj Node0: Node { BinaryTree = BinaryTree0 root = BinaryTree0->Node0 Node = Node0 no left no right elem = Node0->-4 }} } run test94 for 4 expect 1 pred test93 { some disj BinaryTree0: BinaryTree {some disj Node0, Node1, Node2: Node { BinaryTree = BinaryTree0 root = BinaryTree0->Node2 Node = Node0 + Node1 + Node2 left = Node0->Node2 right = Node0->Node1 + Node2->Node0 elem = Node0->7 + Node1->5 + Node2->5 }} } run test93 for 4 expect 0 pred test44 { some disj BinaryTree0: BinaryTree {some disj Node0, Node1: Node { BinaryTree = BinaryTree0 root = BinaryTree0->Node1 Node = Node0 + Node1 no left right = Node1->Node0 elem = Node0->1 + Node1->1 Sorted[] }} } run test44 for 4 expect 0 pred test77 { some disj BinaryTree0: BinaryTree {some disj Node0, Node1: Node { BinaryTree = BinaryTree0 root = BinaryTree0->Node0 Node = Node0 + Node1 no left right = Node0->Node1 elem = Node0->7 + Node1->6 Depth[Node1] = 2 }} } run test77 for 4 expect 1 pred test86 { some disj BinaryTree0: BinaryTree {some disj Node0, Node1, Node2: Node { BinaryTree = BinaryTree0 root = BinaryTree0->Node2 Node = Node0 + Node1 + Node2 left = Node2->Node0 right = Node0->Node1 + Node2->Node0 elem = Node0->-6 + Node1->-7 + Node2->-8 }} } run test86 for 4 expect 0 pred test72 { some disj BinaryTree0: BinaryTree {some disj Node0, Node1, Node2: Node { BinaryTree = BinaryTree0 root = BinaryTree0->Node2 Node = Node0 + Node1 + Node2 left = Node2->Node1 right = Node2->Node0 elem = Node0->3 + Node1->3 + Node2->2 RepOk[] }} } run test72 for 4 expect 0 pred test55 { some disj BinaryTree0: BinaryTree {some disj Node0, Node1, Node2: Node { BinaryTree = BinaryTree0 root = BinaryTree0->Node1 Node = Node0 + Node1 + Node2 left = Node2->Node0 right = Node1->Node2 elem = Node0->2 + Node1->-8 + Node2->7 HasAtMostOneChild[Node2] }} } run test55 for 4 expect 1 pred test92 { some disj BinaryTree0: BinaryTree {some disj Node0, Node1, Node2: Node { BinaryTree = BinaryTree0 root = BinaryTree0->Node2 Node = Node0 + Node1 + Node2 left = Node0->Node2 right = Node0->Node1 + Node2->Node0 elem = Node0->7 + Node1->4 + Node2->0 }} } run test92 for 4 expect 0 pred test56 { some disj BinaryTree0: BinaryTree {some disj Node0, Node1, Node2: Node { BinaryTree = BinaryTree0 root = BinaryTree0->Node2 Node = Node0 + Node1 + Node2 left = Node2->Node1 right = Node1->Node0 elem = Node0->7 + Node1->7 + Node2->6 HasAtMostOneChild[Node2] }} } run test56 for 4 expect 1
Irvine/Examples/ch05/32 bit/InputLoop.asm
alieonsido/ASM_TESTING
0
81639
; Library Test #1: Integer I/O (InputLoop.asm) ; Tests the Clrscr, Crlf, DumpMem, ReadInt, SetTextColor, ; WaitMsg, WriteBin, WriteHex, and WriteString procedures. INCLUDE Irvine32.inc .data COUNT = 4 BlueTextOnGray = blue + (lightGray * 16) DefaultColor = lightGray + (black * 16) arrayD SDWORD 12345678h,1A4B2000h,3434h,7AB9h prompt BYTE "Enter a 32-bit signed integer: ",0 .code main PROC ; Set text color to blue text on a light gray background mov eax,BlueTextOnGray call SetTextColor call Clrscr ; clear the screen ; Display an array using DumpMem. mov esi,OFFSET arrayD ; starting OFFSET mov ebx,TYPE arrayD ; doubleword = 4 bytes mov ecx,LENGTHOF arrayD ; number of units in arrayD call DumpMem ; display memory ; Ask the user to input a sequence of signed integers call Crlf ; new line mov ecx,COUNT L1: mov edx,OFFSET prompt call WriteString call ReadInt ; input integer into EAX call Crlf ; new line ; Display the integer in decimal, hexadecimal, and binary call WriteInt ; display in signed decimal call Crlf call WriteHex ; display in hexadecimal call Crlf call WriteBin ; display in binary call Crlf call Crlf Loop L1 ; repeat the loop ; Return console window to default colors. call WaitMsg ; "Press any key..." mov eax,DefaultColor call SetTextColor call Clrscr exit main ENDP END main
programs/oeis/036/A036141.asm
karttu/loda
0
166215
; A036141: a(n) = 6^n mod 109. ; 1,6,36,107,97,37,4,24,35,101,61,39,16,96,31,77,26,47,64,57,15,90,104,79,38,10,60,33,89,98,43,40,22,23,29,65,63,51,88,92,7,42,34,95,25,41,28,59,27,53,100,55,3,18,108,103,73,2,12,72,105,85,74,8,48,70,93,13,78,32,83,62,45,52,94,19,5,30,71,99,49,76,20,11,66,69,87,86,80,44,46,58,21,17,102,67,75,14,84,68,81,50,82,56,9,54,106,91,1,6,36,107,97,37,4,24,35,101,61,39,16,96,31,77,26,47,64,57,15,90,104,79,38,10,60,33,89,98,43,40,22,23,29,65,63,51,88,92,7,42,34,95,25,41,28,59,27,53,100,55,3,18,108,103,73,2,12,72,105,85,74,8,48,70,93,13,78,32,83,62,45,52,94,19,5,30,71,99,49,76,20,11,66,69,87,86,80,44,46,58,21,17,102,67,75,14,84,68,81,50,82,56,9,54,106,91,1,6,36,107,97,37,4,24,35,101,61,39,16,96,31,77,26,47,64,57,15,90,104,79,38,10,60,33,89,98,43,40,22,23 mov $1,1 lpb $0,1 sub $0,1 mul $1,6 mod $1,109 lpe
home.asm
opiter09/ASM-Machina
1
99081
INCLUDE "constants.asm" SECTION "NULL", ROM0 NULL:: INCLUDE "home/header.asm" SECTION "High Home", ROM0 INCLUDE "home/lcd.asm" INCLUDE "home/clear_sprites.asm" INCLUDE "home/copy.asm" SECTION "Home", ROM0 INCLUDE "home/start.asm" INCLUDE "home/joypad.asm" INCLUDE "data/maps/map_header_pointers.asm" INCLUDE "home/overworld.asm" INCLUDE "home/pokemon.asm" INCLUDE "home/print_bcd.asm" INCLUDE "home/pics.asm" INCLUDE "data/tilesets/collision_tile_ids.asm" INCLUDE "home/copy2.asm" INCLUDE "home/text.asm" INCLUDE "home/vcopy.asm" INCLUDE "home/init.asm" INCLUDE "home/vblank.asm" INCLUDE "home/fade.asm" INCLUDE "home/serial.asm" INCLUDE "home/timer.asm" INCLUDE "home/audio.asm" INCLUDE "home/update_sprites.asm" INCLUDE "data/items/marts.asm" INCLUDE "home/overworld_text.asm" INCLUDE "home/uncompress.asm" INCLUDE "home/reset_player_sprite.asm" INCLUDE "home/fade_audio.asm" INCLUDE "home/text_script.asm" INCLUDE "home/start_menu.asm" INCLUDE "home/count_set_bits.asm" INCLUDE "home/inventory.asm" INCLUDE "home/list_menu.asm" INCLUDE "home/names.asm" INCLUDE "home/reload_tiles.asm" INCLUDE "home/item.asm" INCLUDE "home/textbox.asm" INCLUDE "home/npc_movement.asm" INCLUDE "home/trainers.asm" INCLUDE "home/map_objects.asm" INCLUDE "home/trainers2.asm" INCLUDE "home/money.asm" INCLUDE "home/bankswitch.asm" INCLUDE "home/yes_no.asm" INCLUDE "home/pathfinding.asm" INCLUDE "home/load_font.asm" INCLUDE "home/tilemap.asm" INCLUDE "home/delay.asm" INCLUDE "home/names2.asm" INCLUDE "home/item_price.asm" INCLUDE "home/copy_string.asm" INCLUDE "home/joypad2.asm" INCLUDE "home/math.asm" INCLUDE "home/print_text.asm" INCLUDE "home/move_mon.asm" INCLUDE "home/array.asm" INCLUDE "home/compare.asm" INCLUDE "home/oam.asm" INCLUDE "home/window.asm" INCLUDE "home/print_num.asm" INCLUDE "home/array2.asm" INCLUDE "home/palettes.asm" INCLUDE "home/reload_sprites.asm" INCLUDE "home/give.asm" INCLUDE "home/random.asm" INCLUDE "home/predef.asm" INCLUDE "home/hidden_objects.asm" INCLUDE "home/predef_text.asm"
Userland/dummy/asm/stdioASM.asm
fsammart/SistemasOperativos
0
3810
GLOBAL readC GLOBAL writeC GLOBAL sys_call section .text readC: push rbp mov rbp, rsp mov rdx, rdi mov rcx, rsi mov rdi, 3 mov rsi, 0 int 80h mov rsp, rbp pop rbp ret writeC: push rbp mov rbp, rsp mov rcx, rsi mov rdx, rdi mov rdi, 4 mov rsi, 0 int 80h mov rsp, rbp pop rbp ret sys_call: push rbp mov rbp, rsp int 80h mov rsp, rbp pop rbp ret
oeis/270/A270607.asm
neoneye/loda-programs
11
243167
; A270607: Number of 2X2X2 triangular 0..n arrays with some element plus some adjacent element totalling n+1 or n-1 exactly once. ; 6,0,36,36,96,120,204,252,360,432,564,660,816,936,1116,1260,1464,1632,1860,2052,2304,2520,2796,3036,3336,3600,3924,4212,4560,4872,5244,5580,5976,6336,6756,7140,7584,7992,8460,8892,9384,9840,10356,10836,11376,11880,12444,12972,13560,14112,14724,15300,15936,16536,17196,17820,18504,19152,19860,20532,21264,21960,22716,23436,24216,24960,25764,26532,27360,28152,29004,29820,30696,31536,32436,33300,34224,35112,36060,36972,37944,38880,39876,40836,41856,42840,43884,44892,45960,46992,48084,49140,50256 mov $2,$0 pow $0,2 mov $3,1 add $3,$0 mov $0,$3 add $0,4 mov $3,1 trn $3,$2 sub $3,1 pow $3,$0 sub $0,$3 add $0,2 add $2,$3 lpb $0 sub $0,1 sub $0,$2 add $0,2 mov $2,0 lpe sub $0,6 mul $0,6
proofs/AKS/Algebra/Structures.agda
mckeankylej/thesis
1
11514
<reponame>mckeankylej/thesis open import Level using (_⊔_; suc; Lift; lift) open import Function using (_$_; _∘_; _⤖_) open import Relation.Nullary using (¬_) open import Relation.Nullary.Decidable using (False) open import Relation.Binary using (Rel; Decidable; Setoid; DecSetoid; IsEquivalence; IsDecEquivalence) open import Data.Empty using (⊥) open import Data.Product using (∃-syntax; _,_) open import Data.Sum using (_⊎_) module AKS.Algebra.Structures {c ℓ} (C : Set c) (_≈_ : Rel C ℓ) where open import Data.Unit using (⊤; tt) open import Agda.Builtin.FromNat using (Number) open import AKS.Nat using (ℕ; _<_; _≟_) open import AKS.Fin using (Fin) open import Algebra.Core using (Op₂; Op₁) open import Algebra.Structures _≈_ using (IsCommutativeRing; IsAbelianGroup) infix 4 _≉_ _≉_ : Rel C ℓ x ≉ y = x ≈ y → ⊥ record IsNonZeroCommutativeRing (_+_ _*_ : Op₂ C) (-_ : Op₁ C) (0# 1# : C) : Set (c ⊔ ℓ) where field isCommutativeRing : IsCommutativeRing _+_ _*_ -_ 0# 1# 0#≉1# : 0# ≉ 1# open IsCommutativeRing isCommutativeRing public open import Relation.Binary.Reasoning.Setoid setoid open import Algebra.Properties.Ring (record { isRing = isRing }) using (-‿distribˡ-*; -‿involutive) 1#≉0# : 1# ≉ 0# 1#≉0# = 0#≉1# ∘ sym 0#≉-1# : 0# ≉ - 1# 0#≉-1# 0#≈-1# = 0#≉1# $ begin 0# ≈⟨ sym (zeroʳ 0#) ⟩ 0# * 0# ≈⟨ *-cong 0#≈-1# 0#≈-1# ⟩ (- 1#) * (- 1#) ≈⟨ sym (-‿distribˡ-* 1# (- 1#)) ⟩ - (1# * (- 1#)) ≈⟨ -‿cong (*-identityˡ (- 1#)) ⟩ - (- 1#) ≈⟨ -‿involutive 1# ⟩ 1# ∎ -1#≉0# : - 1# ≉ 0# -1#≉0# = 0#≉-1# ∘ sym C/0 : Set (c ⊔ ℓ) C/0 = ∃[ x ] (x ≉ 0#) 1#-nonzero : C/0 1#-nonzero = 1# , 1#≉0# -1#-nonzero : C/0 -1#-nonzero = - 1# , -1#≉0# fromNat : ℕ → C fromNat ℕ.zero = 0# fromNat (ℕ.suc ℕ.zero) = 1# fromNat (ℕ.suc (ℕ.suc n)) = 1# + fromNat (ℕ.suc n) instance C-number : Number C C-number = record { Constraint = λ _ → Lift c ⊤ ; fromNat = λ n → fromNat n } record IsIntegralDomain (_+_ _*_ : Op₂ C) (-_ : Op₁ C) (0# 1# : C) : Set (c ⊔ ℓ) where field isNonZeroCommutativeRing : IsNonZeroCommutativeRing _+_ _*_ -_ 0# 1# *-cancelˡ : ∀ x {y z} → x ≉ 0# → (x * y) ≈ (x * z) → y ≈ z open IsNonZeroCommutativeRing isNonZeroCommutativeRing public open import Relation.Binary.Reasoning.Setoid setoid *-cancelʳ : ∀ x {y z} → x ≉ 0# → (y * x) ≈ (z * x) → y ≈ z *-cancelʳ x {y} {z} x≉0 y*x≈z*x = *-cancelˡ x x≉0 $ begin (x * y) ≈⟨ *-comm x y ⟩ (y * x) ≈⟨ y*x≈z*x ⟩ (z * x) ≈⟨ *-comm z x ⟩ (x * z) ∎ *≉0 : ∀ {c₁ c₂} → c₁ ≉ 0# → c₂ ≉ 0# → c₁ * c₂ ≉ 0# *≉0 {c₁} {c₂} c₁≉0 c₂≉0 c₁*c₂≈0 = c₂≉0 $ *-cancelˡ c₁ c₁≉0 $ begin (c₁ * c₂) ≈⟨ c₁*c₂≈0 ⟩ (0#) ≈⟨ sym (zeroʳ c₁) ⟩ (c₁ * 0#) ∎ infixl 7 _*-nonzero_ _*-nonzero_ : C/0 → C/0 → C/0 (c₁ , c₁≉0) *-nonzero (c₂ , c₂≉0) = c₁ * c₂ , *≉0 c₁≉0 c₂≉0 module Divisibility (_*_ : Op₂ C) where infix 4 _∣_ record _∣_ (d : C) (a : C) : Set (c ⊔ ℓ) where constructor divides field quotient : C equality : a ≈ (quotient * d) infix 4 _∤_ _∤_ : C → C → Set (c ⊔ ℓ) d ∤ a = ¬ (d ∣ a) record IsGCD (gcd : Op₂ C) : Set (c ⊔ ℓ) where field gcd[a,b]∣a : ∀ a b → gcd a b ∣ a gcd[a,b]∣b : ∀ a b → gcd a b ∣ b gcd-greatest : ∀ {c a b} → c ∣ a → c ∣ b → c ∣ gcd a b record IsGCDDomain (_+_ _*_ : Op₂ C) (-_ : Op₁ C) (0# 1# : C) (gcd : Op₂ C) : Set (c ⊔ ℓ) where open Divisibility _*_ public field isIntegralDomain : IsIntegralDomain _+_ _*_ -_ 0# 1# gcd-isGCD : IsGCD gcd open IsIntegralDomain isIntegralDomain public record IsUniqueFactorizationDomain (_+_ _*_ : Op₂ C) (-_ : Op₁ C) (0# 1# : C) (gcd : Op₂ C) : Set (c ⊔ ℓ) where field isGCDDomain : IsGCDDomain _+_ _*_ -_ 0# 1# gcd -- TODO define factorization open IsGCDDomain isGCDDomain public module Modulus (0# : C) (∣_∣ : ∀ n {n≉0 : n ≉ 0#} → ℕ) (_mod_ : ∀ (n m : C) {m≉0 : m ≉ 0#} → C) where data Remainder (n : C) (m : C) {m≉0 : m ≉ 0#} : Set (c ⊔ ℓ) where 0≈ : (r≈0 : (n mod m) {m≉0} ≈ 0#) → Remainder n m 0≉ : (r≉0 : (n mod m) {m≉0} ≉ 0#) → ∣ n mod m ∣ {r≉0} < ∣ m ∣ {m≉0} → Remainder n m module _ (_+_ _*_ : Op₂ C) (-_ : Op₁ C) (0# 1# : C) (∣_∣ : ∀ n {n≉0 : n ≉ 0#} → ℕ) (_div_ : ∀ (n m : C) {m≉0 : m ≉ 0#} → C) (_mod_ : ∀ (n m : C) {m≉0 : m ≉ 0#} → C) (gcd : Op₂ C) where record IsEuclideanDomain : Set (c ⊔ ℓ) where open Modulus 0# ∣_∣ _mod_ public field isUniqueFactorizationDomain : IsUniqueFactorizationDomain _+_ _*_ -_ 0# 1# gcd division : ∀ n m {m≉0 : m ≉ 0#} → n ≈ ((m * (n div m) {m≉0}) + (n mod m) {m≉0}) modulus : ∀ n m {m≉0 : m ≉ 0#} → Remainder n m {m≉0} div-cong : ∀ {x₁ x₂} {y₁ y₂} → x₁ ≈ x₂ → y₁ ≈ y₂ → ∀ {y₁≉0 y₂≉0} → (x₁ div y₁) {y₁≉0} ≈ (x₂ div y₂) {y₂≉0} mod-cong : ∀ {x₁ x₂} {y₁ y₂} → x₁ ≈ x₂ → y₁ ≈ y₂ → ∀ {y₁≉0 y₂≉0} → (x₁ mod y₁) {y₁≉0} ≈ (x₂ mod y₂) {y₂≉0} open IsUniqueFactorizationDomain isUniqueFactorizationDomain public record IsField (_+_ _*_ : Op₂ C) (-_ : Op₁ C) (0# 1# : C) (_/_ : ∀ (n m : C) {m≉0 : m ≉ 0#} → C) (gcd : Op₂ C) : Set (c ⊔ ℓ) where field isEuclideanDomain : IsEuclideanDomain _+_ _*_ -_ 0# 1# (λ _ → 0) _/_ (λ _ _ → 0#) gcd open IsEuclideanDomain isEuclideanDomain public renaming (div-cong to /-cong) open import Relation.Binary.Reasoning.Setoid setoid m*[n/m]≈n : ∀ n m {m≉0 : m ≉ 0#} → (m * (n / m) {m≉0}) ≈ n m*[n/m]≈n n m {m≉0} = begin (m * (n / m) {m≉0}) ≈⟨ sym (+-identityʳ (m * (n / m) {m≉0})) ⟩ ((m * (n / m) {m≉0}) + 0#) ≈⟨ sym (division n m) ⟩ n ∎ [n/m]*m≈n : ∀ n m {m≉0 : m ≉ 0#} → ((n / m) {m≉0} * m) ≈ n [n/m]*m≈n n m {m≉0} = begin ((n / m) * m) ≈⟨ *-comm (n / m) m ⟩ (m * (n / m)) ≈⟨ m*[n/m]≈n n m ⟩ n ∎ /≉0 : ∀ {c₁ c₂} → c₁ ≉ 0# → (c₂≉0 : c₂ ≉ 0#) → (c₁ / c₂) {c₂≉0} ≉ 0# /≉0 {c₁} {c₂} c₁≉0 c₂≉0 c₁/c₂≈0 = 0#≉1# $ *-cancelˡ c₂ c₂≉0 $ begin c₂ * 0# ≈⟨ *-congˡ (sym (zeroˡ ((c₂ / c₁) {c₁≉0}))) ⟩ c₂ * (0# * (c₂ / c₁)) ≈⟨ *-congˡ (*-congʳ (sym (c₁/c₂≈0))) ⟩ c₂ * ((c₁ / c₂) * (c₂ / c₁)) ≈⟨ sym (*-assoc c₂ (c₁ / c₂) (c₂ / c₁)) ⟩ (c₂ * (c₁ / c₂)) * (c₂ / c₁) ≈⟨ *-congʳ (m*[n/m]≈n c₁ c₂) ⟩ c₁ * (c₂ / c₁) ≈⟨ m*[n/m]≈n c₂ c₁ ⟩ c₂ ≈⟨ sym (*-identityʳ c₂) ⟩ c₂ * 1# ∎ infixl 7 _/-nonzero_ _/-nonzero_ : C/0 → C/0 → C/0 (c₁ , c₁≉0) /-nonzero (c₂ , c₂≉0) = (c₁ / c₂) {c₂≉0} , /≉0 c₁≉0 c₂≉0 infix 8 _⁻¹ _⁻¹ : ∀ x {x≉0 : x ≉ 0#} → C _⁻¹ x {x≉0} = (1# / x) {x≉0} ⁻¹-inverseʳ : ∀ x {x≉0 : x ≉ 0#} → (x * (x ⁻¹) {x≉0}) ≈ 1# ⁻¹-inverseʳ = m*[n/m]≈n 1# ⁻¹-inverseˡ : ∀ x {x≉0 : x ≉ 0#} → ((x ⁻¹) {x≉0} * x) ≈ 1# ⁻¹-inverseˡ = [n/m]*m≈n 1# x⁻¹≉0 : ∀ x {x≉0 : x ≉ 0#} → (x ⁻¹) {x≉0} ≉ 0# x⁻¹≉0 x {x≉0} = /≉0 1#≉0# x≉0 -- 0#≉1# $ begin -- 0# ≈⟨ sym (zeroʳ x) ⟩ -- x * 0# ≈⟨ *-congˡ (sym x⁻¹≈0) ⟩ -- x * (x ⁻¹) {x≉0} ≈⟨ ⁻¹-inverseʳ x ⟩ -- 1# ∎ ⁻¹-cong : ∀ {x y} {x≉0 : x ≉ 0#} {y≉0 : y ≉ 0#} → x ≈ y → (x ⁻¹) {x≉0} ≈ (y ⁻¹) {y≉0} ⁻¹-cong {x} {y} {x≉0} {y≉0} x≈y = *-cancelˡ x x≉0 $ begin (x * (x ⁻¹)) ≈⟨ ⁻¹-inverseʳ x ⟩ 1# ≈⟨ sym (⁻¹-inverseʳ y {y≉0}) ⟩ (y * (y ⁻¹)) ≈⟨ *-congʳ (sym x≈y) ⟩ (x * (y ⁻¹)) ∎ record IsDecField (_≈?_ : Decidable _≈_) (_+_ _*_ : Op₂ C) (-_ : Op₁ C) (0# 1# : C) (_/_ : ∀ (n m : C) {m≉0 : m ≉ 0#} → C) (gcd : Op₂ C) : Set (c ⊔ ℓ) where field isField : IsField _+_ _*_ -_ 0# 1# _/_ gcd open IsField isField public isDecEquivalence : IsDecEquivalence _≈_ isDecEquivalence = record { isEquivalence = isEquivalence ; _≟_ = _≈?_ } record IsFiniteField (_≈?_ : Decidable _≈_) (_+_ _*_ : Op₂ C) (-_ : Op₁ C) (0# 1# : C) (_/_ : ∀ (n m : C) {m≉0 : m ≉ 0#} → C) (gcd : Op₂ C) (cardinality : ℕ) : Set (suc c ⊔ ℓ) where field isDecField : IsDecField _≈?_ _+_ _*_ -_ 0# 1# _/_ gcd C↦Fin[cardinality] : C ⤖ Fin cardinality open IsDecField isDecField public
test/Succeed/Issue493.agda
cruhland/agda
1,989
17200
<filename>test/Succeed/Issue493.agda module Issue493 where module M where postulate A B C : Set module M₁ = M renaming (B to Y) hiding (A) module M₂ = M using (A) using (B) module M₃ = M hiding (A) hiding (B) open M using (A) public
source/web/tools/a2js/webapi/html/webapi-html-option_elements.ads
svn2github/matreshka
24
7769
<reponame>svn2github/matreshka ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Web API Definition -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2017, <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 <NAME>, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with WebAPI.HTML.Elements; with WebAPI.HTML.Validity_States; package WebAPI.HTML.Option_Elements is pragma Preelaborate; type HTML_Option_Element is limited interface and WebAPI.HTML.Elements.HTML_Element; type HTML_Option_Element_Access is access all HTML_Option_Element'Class with Storage_Size => 0; -- XXX Not implemented -- -- interface HTMLOptionElement : HTMLElement { -- readonly attribute HTMLFormElement? form; not overriding function Get_Disabled (Self : not null access constant HTML_Option_Element) return Boolean is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "disabled"; not overriding procedure Set_Disabled (Self : not null access constant HTML_Option_Element; To : Boolean) is abstract with Import => True, Convention => JavaScript_Property_Setter, Link_Name => "disabled"; not overriding function Get_Label (Self : not null access constant HTML_Option_Element) return WebAPI.DOM_String is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "label"; not overriding procedure Set_Label (Self : not null access constant HTML_Option_Element; To : WebAPI.DOM_String) is abstract with Import => True, Convention => JavaScript_Property_Setter, Link_Name => "label"; not overriding function Get_Default_Selected (Self : not null access constant HTML_Option_Element) return Boolean is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "defaultSelected"; not overriding procedure Set_Default_Selected (Self : not null access constant HTML_Option_Element; To : Boolean) is abstract with Import => True, Convention => JavaScript_Property_Setter, Link_Name => "defaultSelected"; not overriding function Get_Selected (Self : not null access constant HTML_Option_Element) return Boolean is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "selected"; not overriding procedure Set_Selected (Self : not null access constant HTML_Option_Element; To : Boolean) is abstract with Import => True, Convention => JavaScript_Property_Setter, Link_Name => "selected"; not overriding function Get_Value (Self : not null access constant HTML_Option_Element) return WebAPI.DOM_String is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "value"; not overriding procedure Set_Value (Self : not null access constant HTML_Option_Element; To : WebAPI.DOM_String) is abstract with Import => True, Convention => JavaScript_Property_Setter, Link_Name => "value"; not overriding function Get_Text (Self : not null access constant HTML_Option_Element) return WebAPI.DOM_String is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "text"; not overriding procedure Set_Text (Self : not null access constant HTML_Option_Element; To : WebAPI.DOM_String) is abstract with Import => True, Convention => JavaScript_Property_Setter, Link_Name => "text"; not overriding function Get_Index (Self : not null access constant HTML_Option_Element) return WebAPI.DOM_Long is abstract with Import => True, Convention => JavaScript_Property_Getter, Link_Name => "index"; end WebAPI.HTML.Option_Elements;
programs/oeis/033/A033425.asm
karttu/loda
1
176403
<gh_stars>1-10 ; A033425: [ 10^7/n ]. ; 10000000,5000000,3333333,2500000,2000000,1666666,1428571,1250000,1111111,1000000,909090,833333,769230,714285,666666,625000,588235,555555,526315,500000,476190,454545,434782,416666,400000,384615 mov $1,5 mov $3,$0 cmp $3,$0 add $3,4 add $1,$3 pow $1,7 mov $2,$0 add $2,1 div $1,$2
test/Fail/Issue1609d.agda
cruhland/agda
1,989
9226
<filename>test/Fail/Issue1609d.agda<gh_stars>1000+ -- Andreas, 2015-07-13 Better parse errors for illegal type signatures A with B : Set
6502EMU/Instructions/CLC.asm
austinbentley/6502toAVR
0
243585
<gh_stars>0 /* * CLC.asm * * Created: 5/13/2018 2:52:01 PM * Author: ROTP */ CLC_implied: swapPCwithTEMPPC CBR SR, CARRY_FLAG ADIW ZH:ZL, 1 RET
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_21829_563.asm
ljhsiun2/medusa
9
83134
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %r15 push %r8 push %rbp push %rcx push %rdi push %rsi lea addresses_A_ht+0x67f9, %r8 nop sub $55510, %rsi movw $0x6162, (%r8) nop nop and $45579, %r14 lea addresses_D_ht+0xaaca, %rsi lea addresses_WC_ht+0x7f9, %rdi nop nop nop add %r15, %r15 mov $43, %rcx rep movsl nop nop nop nop nop and %rbp, %rbp lea addresses_WC_ht+0x15ff9, %rsi lea addresses_WC_ht+0x1af7d, %rdi cmp %r13, %r13 mov $119, %rcx rep movsq nop nop nop nop nop xor %rbp, %rbp pop %rsi pop %rdi pop %rcx pop %rbp pop %r8 pop %r15 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r14 push %r15 push %rdi push %rdx // Store lea addresses_D+0xa279, %r15 sub $61117, %r14 movl $0x51525354, (%r15) nop nop nop sub $52132, %rdx // Faulty Load lea addresses_normal+0x67f9, %rdi nop nop nop nop nop cmp %r13, %r13 mov (%rdi), %r11w lea oracles, %r15 and $0xff, %r11 shlq $12, %r11 mov (%r15,%r11,1), %r11 pop %rdx pop %rdi pop %r15 pop %r14 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}} {'34': 21829} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
src/antlr/com/gmalmquist/gs/GerbilScript.g4
gmalmquist/gerbil
0
5442
grammar GerbilScript; start : stat+ ; stat : declarationStat ';' | functionDeclaration | expr ';' | ';' | block | returnStatement | breakStatement | yieldStatement | controlBlock | classDefinition ; block : '{' stat* '}' ; declarationStat : ('var' | type) multiAssignment | ('var' | type) ID ; functionDeclaration : 'function' ID '(' parameters? ')' returnType? '{' stat* '}' ; anonymousFunctionDeclaration : 'function' '(' parameters? ')' returnType? '{' stat* '}' ; returnType : ':' type; type : reference ; returnStatement : 'return' expr ';' ; breakStatement : 'break' ';' ; yieldStatement : 'yield' expr? ';' ; classDefinition : 'class' ID ('extends' reference)? '{' classMember* '}' ; classMember : visibility? declarationStat ';' | visibility? methodDeclaration | visibility ? accessorDeclaration ; methodDeclaration : type? ID '(' parameters? ')' block ; // Don't mark 'get' and 'set' as keywords, because we // don't want to prevent them from being identifiers. accessorDeclaration : type? ID '{' (ID (block|';'))+ '}' ; visibility : 'public' | 'private' ; controlBlock : ifStatement | whileLoop | forLoop | forInLoop | doWhileLoop | switchStatement | tryCatchStatement | withStatement ; ifStatement : 'if' '(' expr ')' stat; whileLoop : 'while' '(' expr ')' stat; forLoop : 'for' '(' (declarationStat | multiAssignment)? ';' expr? ';' expr? ')' stat; forInLoop : 'for' '(' ID 'in' expr ')' stat; doWhileLoop : 'do' block 'while' '(' expr ')' ';' ; switchStatement : 'switch' '(' expr ')' '{' switchCase* '}'; withStatement : 'with' '(' expr ('as' ID)? ')' stat; switchCase : 'case' expr ':' stat* | 'default' ':' stat* ; tryCatchStatement : 'try' block (catchClause | finallyClause) | 'try' block catchClause finallyClause ; catchClause : 'catch' '(' ID ')' block | 'catch' block ; finallyClause : 'finally' block ; multiAssignment : assignmentStat (',' assignmentStat)* ; assignmentStat : reference '=' expr | reference '*=' expr | reference '/=' expr | reference '+=' expr | reference '-=' expr | reference '~=' expr | reference '^=' expr | reference '**=' expr | reference '++' | reference '--' ; expr : '(' expr ')' | expr dereference+ | '-' expr | '!' expr | '~' expr | expr ('**' | '.**') expr | expr ('^' | '.^') expr | expr ('*' | '.*') expr | expr ('/' | './') expr | expr ('+' | '.+') expr | expr ('-' | '.-') expr | expr ('%' | '.%') expr | expr '?' expr ':' expr | expr '>>' expr | expr '<<' expr | expr 'instanceof' expr | expr '&&' expr | expr '||' expr | expr '&' expr | expr '|' expr | expr ('===' | '!==') expr | expr ('==' | '!=') expr | expr ('<' | '<=') expr | expr ('>' | '>=') expr | jsonArray | jsonDictionary | literal | ID | anonymousFunctionDeclaration | assignmentStat ; jsonArray : '[' expr? ','? ']' | '[' expr (',' expr)* ','? ']' ; jsonDictionary : '{' jsonKVPair? ','? '}' | '{' jsonKVPair (',' jsonKVPair)* ','? '}' ; jsonKVPair : (literal | ID) ':' expr ; reference : ID dereference* ; dereference : '.' ID # MemberDereference | '[' arguments ']' # ArrayDereference | '[' slices ']' # ArraySlice | '(' arguments? ')' # MethodCall ; arguments : expr (',' expr)* ; slices : slice (',' slice)* ; slice : expr ':' expr? | ':' expr | ':' | expr ; parameters : type? ID defaultValue? (',' type? ID defaultValue? )* ; defaultValue : '=' expr ; literal : STRING | number | 'undefined' | 'null' ; number : BIN_INT | OCT_INT | TER_INT | PLAIN_NUMBER | COLOR_INT ; STRING : DQ (ESC | ~'"')*? DQ | SQ (ESC | ~'\'')*? SQ ; fragment ESC : BS DQ | BS SQ | BS BS | BS [tnbar] ; fragment DQ : '"'; fragment SQ : '\''; fragment BS : '\\' ; ID : [$_a-zA-Z] [$_a-zA-Z0-9]* ; PLAIN_NUMBER : FLOAT | INT | HEX_INT; fragment INT : '0' | [1-9] [0-9]* ; fragment FLOAT : [0-9]+ '.' [0-9]* | '.' [0-9]+ ; fragment HEX_INT : '0x' [0-9A-Fa-f]+ ; // Number formats not in vanilla JS BIN_INT : '0b' [0-1]+ ; TER_INT : '0t' [0-2]+ ; OCT_INT : '0o' [0-7]+ ; COLOR_INT : '#' [0-9A-Fa-f]+ ; WS : [ \t\r\n] -> skip ; LINE_COMMENT : '//' ~[\n]* -> skip ; BLOCK_COMMENT : '/*' .*? '*/' -> skip ;
oeis/301/A301717.asm
neoneye/loda-programs
11
92267
; A301717: Partial sums of A301716. ; Submitted by <NAME>(s4) ; 1,7,19,37,55,85,121,157,205,253,307,373,439,511,589,673,763,859,961,1063,1177,1297,1417,1549,1681,1819,1969,2119,2275,2437,2605,2779,2959,3145,3331,3529,3733,3937,4153,4369,4591,4825,5059,5299,5545,5797,6055,6319,6589,6859,7141,7429,7717,8017,8317,8623 add $0,1 bin $0,2 mul $0,14 div $0,3 add $0,2 div $0,5 mul $0,6 add $0,1
src/scripts/front_app.applescript
brianm/deeplinker
0
2403
tell application "System Events" set frontApp to first application process whose frontmost is true set frontAppName to name of frontApp tell process frontAppName tell (1st window whose value of attribute "AXMain" is true) set windowTitle to value of attribute "AXTitle" end tell end tell end tell set frontAppId to id of application frontAppName return {id: frontAppId, name: frontAppName, title: windowTitle}
archs/fences_as_relations/exec_ppc.als
mpardalos/memalloy
20
1052
<gh_stars>10-100 module exec_ppc[E] open exec_H[E] sig Exec_PPC extends Exec_H { sync, lwsync, isync:E->E }{ is_fence_rel[isync, sb] is_fence_rel[sync, sb] is_fence_rel[lwsync, sb] // the full fence implies the lightweight fence sync in lwsync } one sig rm_isync extends PTag {} one sig rm_sync extends PTag {} one sig rm_lwsync extends PTag {} fun isync[e:PTag->E, X:Exec_PPC] : E->E { mk_fence_rel[e, rm_isync, X.isync, X.sb] } fun sync[e:PTag->E, X:Exec_PPC] : E->E { mk_fence_rel[e, rm_sync + rm_lwsync, X.sync, X.sb] } fun lwsync[e:PTag->E, X:Exec_PPC] : E->E { mk_fence_rel[e, rm_lwsync, X.lwsync, X.sb] }
src/semantica-gci.ads
alvaromb/Compilemon
1
5828
<reponame>alvaromb/Compilemon with Semantica.Declsc3a, Pilas, Decls.Dgenerals; use Semantica.Declsc3a; package Semantica.gci is Camp_Nul : constant Camp := (Const, Var_Nul); type T_Param is record Base, Despl : num_Var; end record; procedure Genera (Instr : in tInstruccio; C1 : in Camp := Camp_Nul; C2 : in Camp := Camp_Nul; C3 : in Camp := Camp_Nul); procedure Inicia_Generacio (nomFitxer : in String); procedure Gci_Decprocediment (A : in Pnode); procedure gci_Programa (A : in Pnode); procedure Gci_Encap (A : in Pnode; I : in Id_Nom); procedure gci_Pencap (A : in Pnode); procedure gci_Param (A : in Pnode); procedure gci_Declaracions (A : in Pnode); procedure gci_Decvar (A : in Pnode); procedure gci_Declsvar (A : in Pnode); procedure gci_Decconst (A : in Pnode); procedure gci_Deccol (A : in Pnode); procedure gci_Pcoleccio (A : in Pnode; base: in out Valor; Idarray : out Id_nom); procedure gci_Bloc (A : in Pnode); procedure Gci_Assignacio (Idref, Iddref, Idrexp, Iddexp: in num_var); --Procediments procedure gci_Referencia_Proc (A : in Pnode; Idproc : out num_proc); procedure gci_Ref_Pri (A : in Pnode; Idproc : out num_proc); procedure gci_Identificador (A : in Pnode; Idres, Iddesp: out num_var; Idtipus : out Id_Nom); procedure gci_Constant (A : in Pnode; Idres : out Num_var); procedure gci_Expressio (A : in Pnode; Idr, Idd: out num_var); procedure gci_Expressioc (A : in Pnode; Idres,Idresdesp: out num_var); procedure gci_Exp_Relacional (IdResE, IdResD, IddespE, IddespD : in num_var; IdResultExp, IddespExp : out num_var; Op : in Operacio); procedure gci_Exp_Logica (IdResE, IdResD, IddespE, IddespD : in num_var; IdResultExp, IddespExp : out num_var; Op : in Operacio); procedure gci_Exp_Aritmetica (IdResE, IdResD, IddespE, IddespD : in num_var; IdResultExp, IddespExp : out num_var; Op : in Operacio); procedure gci_Expressiou (A : in Pnode; Idr, Idd : out num_var); procedure gci_Exp_Negacio (idRes, Iddesp : in num_var; IdresultExp, IddespExp : out num_var); procedure gci_Exp_Neglogica (idRes, Iddesp : in num_var; IdresultExp, IddespExp : out num_var); procedure gci_Referencia_Var (A : in Pnode; Idres, Iddesp: out Num_Var; Idtipus : out Id_Nom); --Arrays procedure gci_Ref_Pri (A : in Pnode; Idres, Iddesp, Idbase : out Num_var; Idtipus : out Id_Nom; It_Idx : out Cursor_Idx); procedure gci_Ref_Rec (A : in Pnode; Idres, Iddesp: out num_var; Idtipus : out Id_Nom); procedure gci_Sconds (A : in Pnode); procedure gci_Scondc (A : in Pnode); procedure gci_Srep (A : in Pnode); procedure Calcula_Despls; private Nprofunditat : nprof; end Semantica.gci;
constants.asm
chaos-lord/CryEd
1
26228
<reponame>chaos-lord/CryEd include "constants/misc_constants.asm" include "constants/sfx_constants.asm" include "constants/gfx_constants.asm" include "constants/text_constants.asm" include "constants/battle_constants.asm" include "constants/audio_constants.asm" include "constants/cry_constants.asm" include "constants/music_constants.asm" include "constants/hardware_constants.asm" include "constants/wram_constants.asm" include "constants/input_constants.asm" include "constants/pokemon_data_constants.asm"
programs/oeis/106/A106505.asm
jmorken/loda
1
2649
; A106505: Ordered and uniqued length of side common to the two angles, one being the double of the other, of a primitive integer-sided triangle. ; 5,7,9,11,13,15,16,17,19,21,23,24,25,27,29,31,32,33,35,37,39,40,41,43,45,47,48,49,51,53,55,56,57,59,61,63,64,65,67,69,71,72,73,75,77,79,80,81,83,85,87,88,89,91,93,95,96,97,99,101,103,104,105,107,109,111,112 mov $2,$0 lpb $2 trn $0,5 add $1,2 trn $1,$0 sub $2,1 lpe add $1,5
agda-stdlib/src/Algebra/FunctionProperties/Consequences/Core.agda
DreamLinuxer/popl21-artifact
5
17242
------------------------------------------------------------------------ -- The Agda standard library -- -- This module is DEPRECATED. ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Algebra.FunctionProperties.Consequences.Core {a} {A : Set a} where {-# WARNING_ON_IMPORT "Algebra.FunctionProperties.Consequences.Core was deprecated in v1.3. Use Algebra.Consequences.Base instead." #-} open import Algebra.Consequences.Base public
fiat-amd64/144.28_ratio10700_seed380019983455042_mul_p521.asm
dderjoel/fiat-crypto
491
1225
<filename>fiat-amd64/144.28_ratio10700_seed380019983455042_mul_p521.asm SECTION .text GLOBAL mul_p521 mul_p521: sub rsp, 0x2d8 ; last 0x30 (6) for Caller - save regs mov [ rsp + 0x2a8 ], rbx; saving to stack mov [ rsp + 0x2b0 ], rbp; saving to stack mov [ rsp + 0x2b8 ], r12; saving to stack mov [ rsp + 0x2c0 ], r13; saving to stack mov [ rsp + 0x2c8 ], r14; saving to stack mov [ rsp + 0x2d0 ], r15; saving to stack mov rax, rdx; preserving value of arg2 into a new reg mov rdx, [ rsi + 0x0 ]; saving arg1[0] in rdx. mulx r10, r11, [ rax + 0x0 ]; x162, x161<- arg1[0] * arg2[0] imul rbx, [ rax + 0x38 ], 0x2; x10001 <- arg2[7] * 0x2 imul rbp, [ rax + 0x40 ], 0x2; x10000 <- arg2[8] * 0x2 mov rdx, [ rsi + 0x8 ]; arg1[1] to rdx mulx r12, r13, rbp; x72, x71<- arg1[1] * x10000 imul r14, [ rax + 0x20 ], 0x2; x10004 <- arg2[4] * 0x2 imul r15, [ rax + 0x30 ], 0x2; x10002 <- arg2[6] * 0x2 mov rdx, [ rsi + 0x28 ]; arg1[5] to rdx mulx rcx, r8, r14; x52, x51<- arg1[5] * x10004 imul r9, [ rax + 0x8 ], 0x2; x10007 <- arg2[1] * 0x2 mov rdx, rbx; x10001 to rdx mov [ rsp + 0x0 ], rdi; spilling out1 to mem mulx rbx, rdi, [ rsi + 0x10 ]; x70, x69<- arg1[2] * x10001 mov [ rsp + 0x8 ], r10; spilling x162 to mem imul r10, [ rax + 0x18 ], 0x2; x10005 <- arg2[3] * 0x2 mov [ rsp + 0x10 ], r12; spilling x72 to mem mov r12, rdx; preserving value of x10001 into a new reg mov rdx, [ rsi + 0x40 ]; saving arg1[8] in rdx. mov [ rsp + 0x18 ], r11; spilling x161 to mem mulx r9, r11, r9; x16, x15<- arg1[8] * x10007 mov rdx, r15; x10002 to rdx mov [ rsp + 0x20 ], r13; spilling x71 to mem mulx r15, r13, [ rsi + 0x18 ]; x66, x65<- arg1[3] * x10002 mov [ rsp + 0x28 ], rbx; spilling x70 to mem imul rbx, [ rax + 0x28 ], 0x2; x10003 <- arg2[5] * 0x2 mov [ rsp + 0x30 ], rbp; spilling x10000 to mem imul rbp, [ rax + 0x10 ], 0x2; x10006 <- arg2[2] * 0x2 xchg rdx, rbp; x10006, swapping with x10002, which is currently in rdx mov [ rsp + 0x38 ], rdi; spilling x69 to mem mov [ rsp + 0x40 ], r15; spilling x66 to mem mulx rdi, r15, [ rsi + 0x38 ]; x30, x29<- arg1[7] * x10006 mov [ rsp + 0x48 ], rcx; spilling x52 to mem xor rcx, rcx adox r11, r15 adox rdi, r9 xchg rdx, r10; x10005, swapping with x10006, which is currently in rdx mulx r9, r15, [ rsi + 0x30 ]; x42, x41<- arg1[6] * x10005 adcx r11, r15 adcx r9, rdi mov rdi, rdx; preserving value of x10005 into a new reg mov rdx, [ rsi + 0x20 ]; saving arg1[4] in rdx. mulx r15, rcx, rbx; x60, x59<- arg1[4] * x10003 mov [ rsp + 0x50 ], r15; spilling x60 to mem xor r15, r15 adox r11, r8 adcx r11, rcx setc r8b; spill CF x176 to reg (r8) clc; adcx r11, r13 mov rdx, [ rsi + 0x38 ]; arg1[7] to rdx mulx r13, rcx, rdi; x28, x27<- arg1[7] * x10005 mov rdx, [ rsi + 0x40 ]; arg1[8] to rdx mulx r10, r15, r10; x14, x13<- arg1[8] * x10006 adox r9, [ rsp + 0x48 ] mov rdx, [ rax + 0x0 ]; arg2[0] to rdx mov [ rsp + 0x58 ], r10; spilling x14 to mem mov [ rsp + 0x60 ], r13; spilling x28 to mem mulx r10, r13, [ rsi + 0x8 ]; x144, x143<- arg1[1] * arg2[0] movzx r8, r8b lea r9, [ r8 + r9 ] mov r8, [ rsp + 0x50 ] lea r9, [r8+r9] mov rdx, rbx; x10003 to rdx mulx rbx, r8, [ rsi + 0x28 ]; x50, x49<- arg1[5] * x10003 xchg rdx, r12; x10001, swapping with x10003, which is currently in rdx mov [ rsp + 0x68 ], r10; spilling x144 to mem mov [ rsp + 0x70 ], r13; spilling x143 to mem mulx r10, r13, [ rsi + 0x18 ]; x64, x63<- arg1[3] * x10001 adcx r9, [ rsp + 0x40 ] xchg rdx, r14; x10004, swapping with x10001, which is currently in rdx mov [ rsp + 0x78 ], r10; spilling x64 to mem mov [ rsp + 0x80 ], rbx; spilling x50 to mem mulx r10, rbx, [ rsi + 0x30 ]; x40, x39<- arg1[6] * x10004 test al, al adox r11, [ rsp + 0x38 ] adox r9, [ rsp + 0x28 ] adcx r11, [ rsp + 0x20 ] mov [ rsp + 0x88 ], r13; spilling x63 to mem mov r13, -0x2 ; moving imm to reg inc r13; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r15, rcx mov rcx, rdx; preserving value of x10004 into a new reg mov rdx, [ rsi + 0x20 ]; saving arg1[4] in rdx. mov [ rsp + 0x90 ], r10; spilling x40 to mem mulx r13, r10, rbp; x58, x57<- arg1[4] * x10002 mov [ rsp + 0x98 ], r13; spilling x58 to mem mov r13, [ rsp + 0x58 ]; load m64 x14 to register64 adox r13, [ rsp + 0x60 ] mov [ rsp + 0xa0 ], r10; spilling x57 to mem mov r10, -0x2 ; moving imm to reg inc r10; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r11, [ rsp + 0x18 ] adcx r9, [ rsp + 0x10 ] adox r9, [ rsp + 0x8 ] mov r10, r11; x195, copying x191 here, cause x191 is needed in a reg for other than x195, namely all: , x195, x197, size: 2 shrd r10, r9, 58; x195 <- x193||x191 >> 58 mov [ rsp + 0xa8 ], r10; spilling x195 to mem xor r10, r10 adox r15, rbx adcx r15, r8 adox r13, [ rsp + 0x90 ] mov rdx, [ rsi + 0x10 ]; arg1[2] to rdx mulx r8, rbx, [ rsp + 0x30 ]; x68, x67<- arg1[2] * x10000 setc r10b; spill CF x431 to reg (r10) shr r9, 58; x196 <- x193>> 58 mov [ rsp + 0xb0 ], r9; spilling x196 to mem xor r9, r9 adox r15, [ rsp + 0xa0 ] adcx r15, [ rsp + 0x88 ] mov rdx, rbp; x10002 to rdx mulx rbp, r9, [ rsi + 0x28 ]; x48, x47<- arg1[5] * x10002 movzx r10, r10b lea r13, [ r10 + r13 ] mov r10, [ rsp + 0x80 ] lea r13, [r10+r13] adox r13, [ rsp + 0x98 ] mov r10, rdx; preserving value of x10002 into a new reg mov rdx, [ rax + 0x8 ]; saving arg2[1] in rdx. mov [ rsp + 0xb8 ], rbp; spilling x48 to mem mov [ rsp + 0xc0 ], r9; spilling x47 to mem mulx rbp, r9, [ rsi + 0x0 ]; x160, x159<- arg1[0] * arg2[1] adcx r13, [ rsp + 0x78 ] mov [ rsp + 0xc8 ], rbp; spilling x160 to mem xor rbp, rbp adox r15, rbx adcx r15, [ rsp + 0x70 ] mov rdx, [ rsi + 0x40 ]; arg1[8] to rdx mulx rdi, rbx, rdi; x12, x11<- arg1[8] * x10005 adox r8, r13 mov rdx, [ rsi + 0x10 ]; arg1[2] to rdx mulx r13, rbp, [ rax + 0x0 ]; x128, x127<- arg1[2] * arg2[0] mov [ rsp + 0xd0 ], r13; spilling x128 to mem mov r13, -0x2 ; moving imm to reg inc r13; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r15, r9 adcx r8, [ rsp + 0x68 ] clc; adcx r15, [ rsp + 0xa8 ] mov rdx, [ rsi + 0x38 ]; arg1[7] to rdx mulx r9, r13, rcx; x26, x25<- arg1[7] * x10004 adox r8, [ rsp + 0xc8 ] adcx r8, [ rsp + 0xb0 ] mov [ rsp + 0xd8 ], rbp; spilling x127 to mem mov rbp, r15; x458, copying x454 here, cause x454 is needed in a reg for other than x458, namely all: , x460, x458, size: 2 shrd rbp, r8, 58; x458 <- x456||x454 >> 58 mov rdx, [ rax + 0x8 ]; arg2[1] to rdx mov [ rsp + 0xe0 ], rbp; spilling x458 to mem mov [ rsp + 0xe8 ], rdi; spilling x12 to mem mulx rbp, rdi, [ rsi + 0x8 ]; x142, x141<- arg1[1] * arg2[1] test al, al adox rbx, r13 adox r9, [ rsp + 0xe8 ] mov rdx, [ rsi + 0x30 ]; arg1[6] to rdx mov [ rsp + 0xf0 ], rbp; spilling x142 to mem mulx r13, rbp, r12; x38, x37<- arg1[6] * x10003 adcx rbx, rbp adcx r13, r9 xor r9, r9 adox rbx, [ rsp + 0xc0 ] adox r13, [ rsp + 0xb8 ] mov rdx, [ rax + 0x10 ]; arg2[2] to rdx mulx rbp, r9, [ rsi + 0x0 ]; x158, x157<- arg1[0] * arg2[2] mov rdx, [ rsi + 0x18 ]; arg1[3] to rdx mov [ rsp + 0xf8 ], rbp; spilling x158 to mem mov [ rsp + 0x100 ], r9; spilling x157 to mem mulx rbp, r9, [ rsp + 0x30 ]; x62, x61<- arg1[3] * x10000 mov rdx, [ rsi + 0x20 ]; arg1[4] to rdx mov [ rsp + 0x108 ], rdi; spilling x141 to mem mov [ rsp + 0x110 ], rbp; spilling x62 to mem mulx rdi, rbp, r14; x56, x55<- arg1[4] * x10001 adcx rbx, rbp adcx rdi, r13 add rbx, r9; could be done better, if r0 has been u8 as well mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx mulx r13, r9, [ rax + 0x18 ]; x156, x155<- arg1[0] * arg2[3] adcx rdi, [ rsp + 0x110 ] add rbx, [ rsp + 0xd8 ]; could be done better, if r0 has been u8 as well adcx rdi, [ rsp + 0xd0 ] shr r8, 58; x459 <- x456>> 58 add rbx, [ rsp + 0x108 ]; could be done better, if r0 has been u8 as well mov rdx, [ rsi + 0x10 ]; arg1[2] to rdx mov [ rsp + 0x118 ], r13; spilling x156 to mem mulx rbp, r13, [ rax + 0x8 ]; x126, x125<- arg1[2] * arg2[1] mov [ rsp + 0x120 ], r9; spilling x155 to mem mov r9, -0x2 ; moving imm to reg inc r9; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox rbx, [ rsp + 0x100 ] adcx rdi, [ rsp + 0xf0 ] mov rdx, [ rsi + 0x20 ]; arg1[4] to rdx mov [ rsp + 0x128 ], rbp; spilling x126 to mem mulx r9, rbp, [ rsp + 0x30 ]; x54, x53<- arg1[4] * x10000 clc; adcx rbx, [ rsp + 0xe0 ] adox rdi, [ rsp + 0xf8 ] adcx r8, rdi mov rdx, r12; x10003 to rdx mulx r12, rdi, [ rsi + 0x38 ]; x24, x23<- arg1[7] * x10003 mov [ rsp + 0x130 ], r13; spilling x125 to mem mov r13, rdx; preserving value of x10003 into a new reg mov rdx, [ rsi + 0x30 ]; saving arg1[6] in rdx. mov [ rsp + 0x138 ], r9; spilling x54 to mem mov [ rsp + 0x140 ], rbp; spilling x53 to mem mulx r9, rbp, r10; x36, x35<- arg1[6] * x10002 mov rdx, [ rsi + 0x40 ]; arg1[8] to rdx mov [ rsp + 0x148 ], r8; spilling x463 to mem mulx rcx, r8, rcx; x10, x9<- arg1[8] * x10004 mov [ rsp + 0x150 ], rbx; spilling x461 to mem xor rbx, rbx adox r8, rdi adcx r8, rbp adox r12, rcx adcx r9, r12 mov rdx, r14; x10001 to rdx mulx r14, rdi, [ rsi + 0x28 ]; x46, x45<- arg1[5] * x10001 mov rbp, [ rsp + 0x150 ]; load m64 x461 to register64 mov rcx, [ rsp + 0x148 ]; load m64 x463 to register64 mov r12, rbp; x465, copying x461 here, cause x461 is needed in a reg for other than x465, namely all: , x467, x465, size: 2 shrd r12, rcx, 58; x465 <- x463||x461 >> 58 mov rbx, rdx; preserving value of x10001 into a new reg mov rdx, [ rsi + 0x8 ]; saving arg1[1] in rdx. mov [ rsp + 0x158 ], r12; spilling x465 to mem mov [ rsp + 0x160 ], r9; spilling x364 to mem mulx r12, r9, [ rax + 0x10 ]; x140, x139<- arg1[1] * arg2[2] test al, al adox r8, rdi adox r14, [ rsp + 0x160 ] mov rdx, [ rsi + 0x40 ]; arg1[8] to rdx mulx r13, rdi, r13; x8, x7<- arg1[8] * x10003 mov rdx, [ rax + 0x0 ]; arg2[0] to rdx mov [ rsp + 0x168 ], r13; spilling x8 to mem mov [ rsp + 0x170 ], rdi; spilling x7 to mem mulx r13, rdi, [ rsi + 0x18 ]; x114, x113<- arg1[3] * arg2[0] adcx r8, [ rsp + 0x140 ] mov [ rsp + 0x178 ], r12; spilling x140 to mem mov r12, -0x2 ; moving imm to reg inc r12; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r8, rdi adcx r14, [ rsp + 0x138 ] clc; adcx r8, [ rsp + 0x130 ] mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx mulx rdi, r12, [ rax + 0x20 ]; x154, x153<- arg1[0] * arg2[4] adox r13, r14 mov rdx, [ rsi + 0x28 ]; arg1[5] to rdx mov [ rsp + 0x180 ], rdi; spilling x154 to mem mulx r14, rdi, [ rsp + 0x30 ]; x44, x43<- arg1[5] * x10000 adcx r13, [ rsp + 0x128 ] add r8, r9; could be done better, if r0 has been u8 as well mov rdx, r10; x10002 to rdx mulx r10, r9, [ rsi + 0x38 ]; x22, x21<- arg1[7] * x10002 adcx r13, [ rsp + 0x178 ] add r8, [ rsp + 0x120 ]; could be done better, if r0 has been u8 as well mov [ rsp + 0x188 ], r12; spilling x153 to mem mov r12, -0x2 ; moving imm to reg inc r12; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r8, [ rsp + 0x158 ] mov r12, rdx; preserving value of x10002 into a new reg mov rdx, [ rsi + 0x10 ]; saving arg1[2] in rdx. mov [ rsp + 0x190 ], r14; spilling x44 to mem mov [ rsp + 0x198 ], rdi; spilling x43 to mem mulx r14, rdi, [ rax + 0x10 ]; x124, x123<- arg1[2] * arg2[2] adcx r13, [ rsp + 0x118 ] mov [ rsp + 0x1a0 ], r14; spilling x124 to mem mov r14, 0x3ffffffffffffff ; moving imm to reg mov [ rsp + 0x1a8 ], rdi; spilling x123 to mem seto dil; spill OF x469 to reg (rdi) and r11, r14; x197 <- x191&0x3ffffffffffffff mov rdx, [ rax + 0x0 ]; arg2[0] to rdx mov [ rsp + 0x1b0 ], r11; spilling x197 to mem mulx r14, r11, [ rsi + 0x20 ]; x102, x101<- arg1[4] * arg2[0] shr rcx, 58; x466 <- x463>> 58 sar dil, 1 adcx rcx, r13 mov rdi, r8; x472, copying x468 here, cause x468 is needed in a reg for other than x472, namely all: , x474, x472, size: 2 shrd rdi, rcx, 58; x472 <- x470||x468 >> 58 mov r13, 0x3ffffffffffffff ; moving imm to reg and r8, r13; x474 <- x468&0x3ffffffffffffff adox r9, [ rsp + 0x170 ] mov rdx, [ rsi + 0x30 ]; arg1[6] to rdx mov [ rsp + 0x1b8 ], rdi; spilling x472 to mem mulx r13, rdi, rbx; x34, x33<- arg1[6] * x10001 adcx r9, rdi adox r10, [ rsp + 0x168 ] adcx r13, r10 add r9, [ rsp + 0x198 ]; could be done better, if r0 has been u8 as well mov rdi, [ rsp + 0x0 ]; load m64 out1 to register64 mov [ rdi + 0x18 ], r8; out1[3] = x474 adcx r13, [ rsp + 0x190 ] add r9, r11; could be done better, if r0 has been u8 as well adcx r14, r13 mov rdx, [ rax + 0x18 ]; arg2[3] to rdx mulx r11, r10, [ rsi + 0x8 ]; x138, x137<- arg1[1] * arg2[3] mov rdx, [ rax + 0x8 ]; arg2[1] to rdx mulx r8, r13, [ rsi + 0x18 ]; x112, x111<- arg1[3] * arg2[1] mov [ rsp + 0x0 ], rdi; spilling out1 to mem xor rdi, rdi adox r9, r13 adcx r9, [ rsp + 0x1a8 ] adox r8, r14 mov r14, -0x3 ; moving imm to reg inc r14; OF<-0x0, preserve CF (debug 7; load -3, increase it, save it as -2). #last resort adox r9, r10 adcx r8, [ rsp + 0x1a0 ] mov rdx, r12; x10002 to rdx mulx rdx, r12, [ rsi + 0x40 ]; x6, x5<- arg1[8] * x10002 adox r11, r8 add r9, [ rsp + 0x188 ]; could be done better, if r0 has been u8 as well adcx r11, [ rsp + 0x180 ] mov r10, rdx; preserving value of x6 into a new reg mov rdx, [ rsi + 0x28 ]; saving arg1[5] in rdx. mulx r13, r8, [ rax + 0x0 ]; x92, x91<- arg1[5] * arg2[0] mov rdx, [ rsi + 0x8 ]; arg1[1] to rdx mulx rdi, r14, [ rax + 0x20 ]; x136, x135<- arg1[1] * arg2[4] mov rdx, [ rsi + 0x38 ]; arg1[7] to rdx mov [ rsp + 0x1c0 ], rdi; spilling x136 to mem mov [ rsp + 0x1c8 ], r14; spilling x135 to mem mulx rdi, r14, rbx; x20, x19<- arg1[7] * x10001 shr rcx, 58; x473 <- x470>> 58 mov [ rsp + 0x1d0 ], r13; spilling x92 to mem xor r13, r13 adox r9, [ rsp + 0x1b8 ] adcx r12, r14 mov rdx, [ rsi + 0x10 ]; arg1[2] to rdx mulx r14, r13, [ rax + 0x18 ]; x122, x121<- arg1[2] * arg2[3] adox rcx, r11 mov rdx, [ rsi + 0x30 ]; arg1[6] to rdx mov [ rsp + 0x1d8 ], r14; spilling x122 to mem mulx r11, r14, [ rsp + 0x30 ]; x32, x31<- arg1[6] * x10000 mov [ rsp + 0x1e0 ], r13; spilling x121 to mem setc r13b; spill CF x295 to reg (r13) mov [ rsp + 0x1e8 ], r11; spilling x32 to mem mov r11, r9; x479, copying x475 here, cause x475 is needed in a reg for other than x479, namely all: , x479, x481, size: 2 shrd r11, rcx, 58; x479 <- x477||x475 >> 58 shr rcx, 58; x480 <- x477>> 58 sar r13b, 1 adcx rdi, r10 adox r12, r14 clc; adcx r12, r8 mov rdx, [ rax + 0x10 ]; arg2[2] to rdx mulx r10, r8, [ rsi + 0x18 ]; x110, x109<- arg1[3] * arg2[2] adox rdi, [ rsp + 0x1e8 ] mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx mulx r13, r14, [ rax + 0x28 ]; x152, x151<- arg1[0] * arg2[5] mov rdx, [ rax + 0x8 ]; arg2[1] to rdx mov [ rsp + 0x1f0 ], rcx; spilling x480 to mem mov [ rsp + 0x1f8 ], r11; spilling x479 to mem mulx rcx, r11, [ rsi + 0x20 ]; x100, x99<- arg1[4] * arg2[1] mov [ rsp + 0x200 ], r13; spilling x152 to mem mov r13, -0x2 ; moving imm to reg inc r13; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r12, r11 mov rdx, [ rax + 0x30 ]; arg2[6] to rdx mulx r11, r13, [ rsi + 0x0 ]; x150, x149<- arg1[0] * arg2[6] adcx rdi, [ rsp + 0x1d0 ] clc; adcx r12, r8 adox rcx, rdi mov rdx, [ rsi + 0x40 ]; arg1[8] to rdx mulx rbx, r8, rbx; x4, x3<- arg1[8] * x10001 mov rdi, -0x2 ; moving imm to reg inc rdi; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r12, [ rsp + 0x1e0 ] seto dil; spill OF x315 to reg (rdi) mov [ rsp + 0x208 ], r11; spilling x150 to mem mov r11, -0x2 ; moving imm to reg inc r11; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r12, [ rsp + 0x1c8 ] mov rdx, [ rax + 0x20 ]; arg2[4] to rdx mov [ rsp + 0x210 ], r13; spilling x149 to mem mulx r11, r13, [ rsi + 0x10 ]; x120, x119<- arg1[2] * arg2[4] adcx r10, rcx movzx rdi, dil lea r10, [ rdi + r10 ] mov rdi, [ rsp + 0x1d8 ] lea r10, [rdi+r10] mov rdx, [ rsi + 0x38 ]; arg1[7] to rdx mulx rcx, rdi, [ rsp + 0x30 ]; x18, x17<- arg1[7] * x10000 mov rdx, [ rax + 0x10 ]; arg2[2] to rdx mov [ rsp + 0x218 ], r11; spilling x120 to mem mov [ rsp + 0x220 ], r13; spilling x119 to mem mulx r11, r13, [ rsi + 0x20 ]; x98, x97<- arg1[4] * arg2[2] clc; adcx r12, r14 adox r10, [ rsp + 0x1c0 ] adcx r10, [ rsp + 0x200 ] add r12, [ rsp + 0x1f8 ]; could be done better, if r0 has been u8 as well mov r14, -0x2 ; moving imm to reg inc r14; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r8, rdi adox rcx, rbx adcx r10, [ rsp + 0x1f0 ] mov rbx, r12; x486, copying x482 here, cause x482 is needed in a reg for other than x486, namely all: , x486, x488, size: 2 shrd rbx, r10, 58; x486 <- x484||x482 >> 58 mov rdx, [ rsi + 0x30 ]; arg1[6] to rdx mulx rdi, r14, [ rax + 0x0 ]; x84, x83<- arg1[6] * arg2[0] mov rdx, [ rax + 0x8 ]; arg2[1] to rdx mov [ rsp + 0x228 ], rbx; spilling x486 to mem mov [ rsp + 0x230 ], r11; spilling x98 to mem mulx rbx, r11, [ rsi + 0x28 ]; x90, x89<- arg1[5] * arg2[1] test al, al adox r8, r14 adox rdi, rcx adcx r8, r11 mov rcx, -0x2 ; moving imm to reg inc rcx; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r8, r13 adcx rbx, rdi adox rbx, [ rsp + 0x230 ] mov rdx, [ rsi + 0x8 ]; arg1[1] to rdx mulx r13, r14, [ rax + 0x28 ]; x134, x133<- arg1[1] * arg2[5] mov rdx, [ rax + 0x18 ]; arg2[3] to rdx mulx r11, rdi, [ rsi + 0x18 ]; x108, x107<- arg1[3] * arg2[3] shr r10, 58; x487 <- x484>> 58 add r8, rdi; could be done better, if r0 has been u8 as well mov rdx, [ rsp + 0x30 ]; x10000 to rdx mulx rdx, rdi, [ rsi + 0x40 ]; x2, x1<- arg1[8] * x10000 adcx r11, rbx add r8, [ rsp + 0x220 ]; could be done better, if r0 has been u8 as well adcx r11, [ rsp + 0x218 ] test al, al adox r8, r14 mov rbx, rdx; preserving value of x2 into a new reg mov rdx, [ rax + 0x30 ]; saving arg2[6] in rdx. mulx r14, rcx, [ rsi + 0x8 ]; x132, x131<- arg1[1] * arg2[6] adox r13, r11 adcx r8, [ rsp + 0x210 ] mov rdx, [ rsi + 0x38 ]; arg1[7] to rdx mov [ rsp + 0x238 ], r15; spilling x454 to mem mulx r11, r15, [ rax + 0x0 ]; x78, x77<- arg1[7] * arg2[0] adcx r13, [ rsp + 0x208 ] test al, al adox rdi, r15 mov rdx, [ rax + 0x8 ]; arg2[1] to rdx mov [ rsp + 0x240 ], r14; spilling x132 to mem mulx r15, r14, [ rsi + 0x30 ]; x82, x81<- arg1[6] * arg2[1] adcx r8, [ rsp + 0x228 ] adox r11, rbx adcx r10, r13 mov rdx, [ rax + 0x38 ]; arg2[7] to rdx mulx rbx, r13, [ rsi + 0x0 ]; x148, x147<- arg1[0] * arg2[7] mov rdx, [ rax + 0x20 ]; arg2[4] to rdx mov [ rsp + 0x248 ], rbx; spilling x148 to mem mov [ rsp + 0x250 ], r13; spilling x147 to mem mulx rbx, r13, [ rsi + 0x18 ]; x106, x105<- arg1[3] * arg2[4] mov [ rsp + 0x258 ], rcx; spilling x131 to mem xor rcx, rcx adox rdi, r14 adox r15, r11 mov rdx, [ rsi + 0x28 ]; arg1[5] to rdx mulx r14, r11, [ rax + 0x10 ]; x88, x87<- arg1[5] * arg2[2] mov rcx, r8; x493, copying x489 here, cause x489 is needed in a reg for other than x493, namely all: , x495, x493, size: 2 shrd rcx, r10, 58; x493 <- x491||x489 >> 58 mov [ rsp + 0x260 ], rcx; spilling x493 to mem xor rcx, rcx adox rdi, r11 mov rdx, [ rax + 0x18 ]; arg2[3] to rdx mulx r11, rcx, [ rsi + 0x20 ]; x96, x95<- arg1[4] * arg2[3] adcx rdi, rcx adox r14, r15 mov rdx, [ rsi + 0x10 ]; arg1[2] to rdx mulx r15, rcx, [ rax + 0x28 ]; x118, x117<- arg1[2] * arg2[5] adcx r11, r14 test al, al adox rdi, r13 adcx rdi, rcx adox rbx, r11 adcx r15, rbx xor r13, r13 adox rdi, [ rsp + 0x258 ] mov rdx, [ rax + 0x0 ]; arg2[0] to rdx mulx r14, rcx, [ rsi + 0x40 ]; x74, x73<- arg1[8] * arg2[0] adox r15, [ rsp + 0x240 ] shr r10, 58; x494 <- x491>> 58 xor r11, r11 adox rdi, [ rsp + 0x250 ] adox r15, [ rsp + 0x248 ] mov rdx, [ rax + 0x20 ]; arg2[4] to rdx mulx r13, rbx, [ rsi + 0x20 ]; x94, x93<- arg1[4] * arg2[4] mov rdx, [ rax + 0x30 ]; arg2[6] to rdx mov [ rsp + 0x268 ], r13; spilling x94 to mem mulx r11, r13, [ rsi + 0x10 ]; x116, x115<- arg1[2] * arg2[6] mov rdx, [ rax + 0x38 ]; arg2[7] to rdx mov [ rsp + 0x270 ], r11; spilling x116 to mem mov [ rsp + 0x278 ], r13; spilling x115 to mem mulx r11, r13, [ rsi + 0x8 ]; x130, x129<- arg1[1] * arg2[7] adcx rdi, [ rsp + 0x260 ] mov rdx, [ rsi + 0x18 ]; arg1[3] to rdx mov [ rsp + 0x280 ], r11; spilling x130 to mem mov [ rsp + 0x288 ], r13; spilling x129 to mem mulx r11, r13, [ rax + 0x28 ]; x104, x103<- arg1[3] * arg2[5] mov rdx, [ rax + 0x8 ]; arg2[1] to rdx mov [ rsp + 0x290 ], r11; spilling x104 to mem mov [ rsp + 0x298 ], r13; spilling x103 to mem mulx r11, r13, [ rsi + 0x38 ]; x76, x75<- arg1[7] * arg2[1] adcx r10, r15 mov r15, rdi; x500, copying x496 here, cause x496 is needed in a reg for other than x500, namely all: , x500, x502, size: 2 shrd r15, r10, 58; x500 <- x498||x496 >> 58 mov [ rsp + 0x2a0 ], r15; spilling x500 to mem xor r15, r15 adox rcx, r13 adox r11, r14 mov rdx, [ rsi + 0x30 ]; arg1[6] to rdx mulx r14, r13, [ rax + 0x10 ]; x80, x79<- arg1[6] * arg2[2] adcx rcx, r13 mov rdx, [ rax + 0x18 ]; arg2[3] to rdx mulx r13, r15, [ rsi + 0x28 ]; x86, x85<- arg1[5] * arg2[3] adcx r14, r11 test al, al adox rcx, r15 adox r13, r14 adcx rcx, rbx adcx r13, [ rsp + 0x268 ] mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx mulx rbx, r11, [ rax + 0x40 ]; x146, x145<- arg1[0] * arg2[8] xor r15, r15 adox rcx, [ rsp + 0x298 ] adcx rcx, [ rsp + 0x278 ] adox r13, [ rsp + 0x290 ] mov r14, -0x3 ; moving imm to reg inc r14; OF<-0x0, preserve CF (debug 7; load -3, increase it, save it as -2). #last resort adox rcx, [ rsp + 0x288 ] adcx r13, [ rsp + 0x270 ] clc; adcx rcx, r11 adox r13, [ rsp + 0x280 ] adcx rbx, r13 mov r11, 0x3ffffffffffffff ; moving imm to reg mov r13, [ rsp + 0x238 ]; x460, copying x454 here, cause x454 is needed in a reg for other than x460, namely all: , x460, size: 1 and r13, r11; x460 <- x454&0x3ffffffffffffff shr r10, 58; x501 <- x498>> 58 xor r14, r14 adox rcx, [ rsp + 0x2a0 ] adox r10, rbx and rbp, r11; x467 <- x461&0x3ffffffffffffff mov r15, 0x1ffffffffffffff ; moving imm to reg mov rbx, rcx; x509, copying x503 here, cause x503 is needed in a reg for other than x509, namely all: , x509, x507, size: 2 and rbx, r15; x509 <- x503&0x1ffffffffffffff shrd rcx, r10, 57; x507 <- x505||x503 >> 57 and r9, r11; x481 <- x475&0x3ffffffffffffff adox rcx, [ rsp + 0x1b0 ] seto r14b; spill OF x511 to reg (r14) shr r10, 57; x508 <- x505>> 57 movzx r15, r14b; x512, copying x511 here, cause x511 is needed in a reg for other than x512, namely all: , x512, size: 1 lea r15, [ r15 + r10 ] and rdi, r11; x502 <- x496&0x3ffffffffffffff mov r14, rcx; x513, copying x510 here, cause x510 is needed in a reg for other than x513, namely all: , x513, x514, size: 2 shrd r14, r15, 58; x513 <- x512||x510 >> 58 and rcx, r11; x514 <- x510&0x3ffffffffffffff lea r14, [ r14 + r13 ] mov r13, [ rsp + 0x0 ]; load m64 out1 to register64 mov [ r13 + 0x0 ], rcx; out1[0] = x514 mov r10, r14; x516, copying x515 here, cause x515 is needed in a reg for other than x516, namely all: , x516, x517, size: 2 shr r10, 58; x516 <- x515>> 58 and r12, r11; x488 <- x482&0x3ffffffffffffff and r14, r11; x517 <- x515&0x3ffffffffffffff mov [ r13 + 0x20 ], r9; out1[4] = x481 mov [ r13 + 0x8 ], r14; out1[1] = x517 and r8, r11; x495 <- x489&0x3ffffffffffffff lea r10, [ r10 + rbp ] mov [ r13 + 0x10 ], r10; out1[2] = x518 mov [ r13 + 0x38 ], rdi; out1[7] = x502 mov [ r13 + 0x28 ], r12; out1[5] = x488 mov [ r13 + 0x40 ], rbx; out1[8] = x509 mov [ r13 + 0x30 ], r8; out1[6] = x495 mov rbx, [ rsp + 0x2a8 ]; restoring from stack mov rbp, [ rsp + 0x2b0 ]; restoring from stack mov r12, [ rsp + 0x2b8 ]; restoring from stack mov r13, [ rsp + 0x2c0 ]; restoring from stack mov r14, [ rsp + 0x2c8 ]; restoring from stack mov r15, [ rsp + 0x2d0 ]; restoring from stack add rsp, 0x2d8 ret ; cpu AMD Ryzen 7 5800X 8-Core Processor ; clocked at 2200 MHz ; first cyclecount 217.17, best 139.53125, lastGood 144.28125 ; seed 380019983455042 ; CC / CFLAGS clang / -march=native -mtune=native -O3 ; time needed: 3015708 ms / 60000 runs=> 50.2618ms/run ; Time spent for assembling and measureing (initial batch_size=65, initial num_batches=101): 120003 ms ; Ratio (time for assembling + measure)/(total runtime for 60000runs): 0.03979264570707774 ; number reverted permutation/ tried permutation: 19393 / 30014 =64.613% ; number reverted decision/ tried decision: 18237 / 29987 =60.816%
sw/552tests/inst_tests/jalr_1.asm
JPShen-UWM/ThreadKraken
1
96298
// Original test: ./bolanows/hw4/problem6/jalr_1.asm // Author: bolanows // Test source code follows // Tests to jump to registers other than r7 LBI r3 26 Nop Nop JALR r3, 0 // Should jump to Target, PC = 26 Nop Nop Nop Halt Nop Nop Nop Nop Nop Nop // PC = 26 Target Nop Halt
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_657.asm
ljhsiun2/medusa
9
4186
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r15 push %r8 push %r9 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x1aa1d, %r15 nop cmp $33091, %rdx mov $0x6162636465666768, %r9 movq %r9, (%r15) nop nop nop nop nop dec %r8 lea addresses_normal_ht+0x7e1d, %rsi cmp %r8, %r8 movb $0x61, (%rsi) add %rbx, %rbx lea addresses_WT_ht+0x289d, %rsi lea addresses_UC_ht+0x1741d, %rdi nop nop nop nop and $38745, %r8 mov $68, %rcx rep movsb nop nop nop nop dec %rdi lea addresses_UC_ht+0x1d0f5, %rdi nop nop nop nop xor %rbx, %rbx movb $0x61, (%rdi) nop nop nop nop and $62276, %rdx lea addresses_D_ht+0x1a0d9, %rdx nop nop nop nop nop cmp $26136, %rcx movl $0x61626364, (%rdx) nop nop nop nop nop sub $7015, %rcx lea addresses_A_ht+0xb21d, %rcx nop add %rsi, %rsi mov (%rcx), %di nop nop nop nop and %r9, %r9 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r9 pop %r8 pop %r15 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r8 push %r9 push %rax push %rbx push %rdi // Load lea addresses_RW+0xf91, %rbx clflush (%rbx) nop cmp $4354, %r9 movb (%rbx), %al nop nop cmp $22088, %r9 // Faulty Load lea addresses_WC+0x1861d, %r8 dec %r11 movups (%r8), %xmm6 vpextrq $1, %xmm6, %rdi lea oracles, %r11 and $0xff, %rdi shlq $12, %rdi mov (%r11,%rdi,1), %rdi pop %rdi pop %rbx pop %rax pop %r9 pop %r8 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 4, 'NT': True, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 7}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 11}} {'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 1}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 2}} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
oeis/269/A269745.asm
neoneye/loda-programs
11
96258
<filename>oeis/269/A269745.asm ; A269745: Maximal number of 1's in an n X n {0,1} Toeplitz matrix with property that no four 1's form a square with sides parallel to the edges of the matrix. ; Submitted by <NAME> ; 1,3,6,10,14,18,23,29,36,44,52,60,68,76 mov $2,$0 mov $4,$0 lpb $2 mov $0,$4 sub $2,1 sub $0,$2 mov $5,$0 add $5,1 mov $6,0 mov $7,$0 lpb $5 mov $0,$7 sub $5,1 sub $0,$5 div $0,2 seq $0,70488 ; a(n) = n^3 mod 26. div $0,2 seq $0,93719 ; a(n) = (n mod 2)^(n mod 3). add $6,$0 lpe add $3,$6 lpe mov $0,$3 add $0,1
src/dll/BugslayerUtil.asm
szapp/Ninja
17
92341
<reponame>szapp/Ninja ; DLL loader for Ninja %include "inc/stackops.inc" bits 32 extern LoadLibraryA extern GetProcAddress extern SetUnhandledExceptionFilter extern Ninja export DllMain section .data DLLhndl dd 0x0 _GetFaultReason dd GetFaultReason.init _GetFirstStackTraceString dd GetFirstStackTraceString.init _GetNextStackTraceString dd GetNextStackTraceString.init _GetRegisterString dd GetRegisterString.init _SetCrashHandlerFilter dd SetCrashHandlerFilter.init %define DLLFileName 'BUGSLAYERUTILG.DLL' msgFaultReasonDLLNotFound db 'Fault reason could not be determined, because ', DLLFileName,' was not ' db 'found.', 0 msgStackTraceDLLNotFound db 'Stack trace could not be determined, because ', DLLFileName,' was not ' db 'found.', 0 msgRegisterDLLNotFound db 'Registers could not be determined, because ', DLLFileName,' was not ' db 'found.', 0 dllFileName db DLLFileName, 0 char_GetFaultReason db 'GetFaultReason', 0 char_GetFirstStackTraceString db 'GetFirstStackTraceString', 0 char_GetNextStackTraceString db 'GetNextStackTraceString', 0 char_GetRegisterString db 'GetRegisterString', 0 char_SetCrashHandlerFilter db 'SetCrashHandlerFilter', 0 section .text ; int __cdecl redirectDLL(void) redirectDLL: resetStackoffset push dllFileName call LoadLibraryA addStack 4 test eax, eax jnz .getProcAddr ret .getProcAddr: mov DWORD [DLLhndl], eax %macro fillAPI 1 push char_%1 push DWORD [DLLhndl] call GetProcAddress test eax, eax jnz %%succ ret %%succ: mov DWORD [_%1], eax addStack 2*4 %endmacro fillAPI GetFaultReason fillAPI GetFirstStackTraceString fillAPI GetNextStackTraceString fillAPI GetRegisterString fillAPI SetCrashHandlerFilter verifyStackoffset mov eax, [DLLhndl] ret ; bool __stdcall DLLMain(DWORD hinstDLL, DWORD fdwReason, void *lpvReserved) DllMain: resetStackoffset mov eax, [esp+stackoffset+0x8] ; fdwReason mov eax, DWORD 0x1 ret 0xC verifyStackoffset ; Load library on very first call, after that jump to function directly %macro setupAPI 3 export %1 %1: jmp DWORD [_%1] .init: call redirectDLL test eax, eax jnz %1 mov eax, %3 ret %2 %endmacro setupAPI GetFaultReason,0x4,msgFaultReasonDLLNotFound setupAPI GetFirstStackTraceString,0x8,msgStackTraceDLLNotFound ; Must always return a valid string pointer setupAPI GetNextStackTraceString,0x8,0 ; May always return zero (do-while condition) setupAPI GetRegisterString,0x4,msgRegisterDLLNotFound ; int __stdcall SetCrashHandlerFilter(int (__stdcall *lpTopLevelExceptionFilter)()) export SetCrashHandlerFilter SetCrashHandlerFilter: jmp DWORD [_SetCrashHandlerFilter] .init: call redirectDLL test eax, eax jnz SetCrashHandlerFilter push DWORD [esp+0x4] ; If DLL not found, set manually call SetUnhandledExceptionFilter xor eax, eax ret 0x4
src/Categories/Category/Construction/MonoidalFunctors.agda
TOTBWF/agda-categories
0
11590
{-# OPTIONS --without-K --safe #-} open import Categories.Category.Monoidal.Structure using (MonoidalCategory) module Categories.Category.Construction.MonoidalFunctors {o ℓ e o′ ℓ′ e′} (C : MonoidalCategory o ℓ e) (D : MonoidalCategory o′ ℓ′ e′) where -- The functor category for a given pair of monoidal categories open import Level open import Data.Product using (_,_) open import Relation.Binary.Construct.On using (isEquivalence) open import Categories.Category using (Category) open import Categories.Category.Monoidal open import Categories.Functor.Monoidal import Categories.NaturalTransformation.Monoidal as NT open import Categories.NaturalTransformation.Equivalence using (_≃_; ≃-isEquivalence) open MonoidalCategory D module Lax where MonoidalFunctors : Category (o ⊔ ℓ ⊔ e ⊔ o′ ⊔ ℓ′ ⊔ e′) (o ⊔ ℓ ⊔ ℓ′ ⊔ e′) (o ⊔ e′) MonoidalFunctors = record { Obj = MonoidalFunctor C D ; _⇒_ = MonoidalNaturalTransformation ; _≈_ = λ α β → U α ≃ U β ; id = idNT ; _∘_ = _∘ᵥ_ ; assoc = assoc ; sym-assoc = sym-assoc ; identityˡ = identityˡ ; identityʳ = identityʳ ; identity² = identity² ; equiv = isEquivalence U ≃-isEquivalence ; ∘-resp-≈ = λ α₁≈β₁ α₂≈β₂ → ∘-resp-≈ α₁≈β₁ α₂≈β₂ } where open NT.Lax renaming (id to idNT) open MonoidalNaturalTransformation using (U) module Strong where MonoidalFunctors : Category (o ⊔ ℓ ⊔ e ⊔ o′ ⊔ ℓ′ ⊔ e′) (o ⊔ ℓ ⊔ ℓ′ ⊔ e′) (o ⊔ e′) MonoidalFunctors = record { Obj = StrongMonoidalFunctor C D ; _⇒_ = MonoidalNaturalTransformation ; _≈_ = λ α β → U α ≃ U β ; id = idNT ; _∘_ = _∘ᵥ_ ; assoc = assoc ; sym-assoc = sym-assoc ; identityˡ = identityˡ ; identityʳ = identityʳ ; identity² = identity² ; equiv = isEquivalence U ≃-isEquivalence ; ∘-resp-≈ = λ α₁≈β₁ α₂≈β₂ → ∘-resp-≈ α₁≈β₁ α₂≈β₂ } where open NT.Strong renaming (id to idNT) open MonoidalNaturalTransformation using (U)
pkgs/tools/yasm/src/modules/arch/x86/tests/sse5-err.asm
manggoguy/parsec-modified
64
11013
fmaddpd xmm1, xmm2, xmm1, xmm3 ; illegal fmaddpd xmm1, xmm2, xmm3, xmm3 ; illegal fmaddpd xmm1, xmm2, xmm2, xmm3 ; illegal fmaddps xmm1, xmm2, xmm1, xmm3 ; illegal fmaddps xmm1, xmm2, xmm3, xmm3 ; illegal fmaddps xmm1, xmm2, xmm2, xmm3 ; illegal fmaddsd xmm1, xmm2, xmm1, xmm3 ; illegal fmaddsd xmm1, xmm2, xmm3, xmm3 ; illegal fmaddsd xmm1, xmm2, xmm2, xmm3 ; illegal fmaddss xmm1, xmm2, xmm1, xmm3 ; illegal fmaddss xmm1, xmm2, xmm3, xmm3 ; illegal fmaddss xmm1, xmm2, xmm2, xmm3 ; illegal fmsubpd xmm1, xmm2, xmm1, xmm3 ; illegal fmsubpd xmm1, xmm2, xmm3, xmm3 ; illegal fmsubpd xmm1, xmm2, xmm2, xmm3 ; illegal fmsubps xmm1, xmm2, xmm1, xmm3 ; illegal fmsubps xmm1, xmm2, xmm3, xmm3 ; illegal fmsubps xmm1, xmm2, xmm2, xmm3 ; illegal fmsubsd xmm1, xmm2, xmm1, xmm3 ; illegal fmsubsd xmm1, xmm2, xmm3, xmm3 ; illegal fmsubsd xmm1, xmm2, xmm2, xmm3 ; illegal fmsubss xmm1, xmm2, xmm1, xmm3 ; illegal fmsubss xmm1, xmm2, xmm3, xmm3 ; illegal fmsubss xmm1, xmm2, xmm2, xmm3 ; illegal fnmaddpd xmm1, xmm2, xmm1, xmm3 ; illegal fnmaddpd xmm1, xmm2, xmm3, xmm3 ; illegal fnmaddpd xmm1, xmm2, xmm2, xmm3 ; illegal fnmaddps xmm1, xmm2, xmm1, xmm3 ; illegal fnmaddps xmm1, xmm2, xmm3, xmm3 ; illegal fnmaddps xmm1, xmm2, xmm2, xmm3 ; illegal fnmaddsd xmm1, xmm2, xmm1, xmm3 ; illegal fnmaddsd xmm1, xmm2, xmm3, xmm3 ; illegal fnmaddsd xmm1, xmm2, xmm2, xmm3 ; illegal fnmaddss xmm1, xmm2, xmm1, xmm3 ; illegal fnmaddss xmm1, xmm2, xmm3, xmm3 ; illegal fnmaddss xmm1, xmm2, xmm2, xmm3 ; illegal fnmsubpd xmm1, xmm2, xmm1, xmm3 ; illegal fnmsubpd xmm1, xmm2, xmm3, xmm3 ; illegal fnmsubpd xmm1, xmm2, xmm2, xmm3 ; illegal fnmsubps xmm1, xmm2, xmm1, xmm3 ; illegal fnmsubps xmm1, xmm2, xmm3, xmm3 ; illegal fnmsubps xmm1, xmm2, xmm2, xmm3 ; illegal fnmsubsd xmm1, xmm2, xmm1, xmm3 ; illegal fnmsubsd xmm1, xmm2, xmm3, xmm3 ; illegal fnmsubsd xmm1, xmm2, xmm2, xmm3 ; illegal fnmsubss xmm1, xmm2, xmm1, xmm3 ; illegal fnmsubss xmm1, xmm2, xmm3, xmm3 ; illegal fnmsubss xmm1, xmm2, xmm2, xmm3 ; illegal pcmov xmm1, xmm2, xmm1, xmm3 ; illegal pcmov xmm1, xmm2, xmm3, xmm3 ; illegal pcmov xmm1, xmm2, xmm2, xmm3 ; illegal permpd xmm1, xmm2, xmm1, xmm3 ; illegal permpd xmm1, xmm2, xmm3, xmm3 ; illegal permpd xmm1, xmm2, xmm2, xmm3 ; illegal permps xmm1, xmm2, xmm1, xmm3 ; illegal permps xmm1, xmm2, xmm3, xmm3 ; illegal permps xmm1, xmm2, xmm2, xmm3 ; illegal pmacsdd xmm1, xmm2, xmm1, xmm3 ; illegal pmacsdd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacsdqh xmm1, xmm2, xmm1, xmm3 ; illegal pmacsdqh xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacsdql xmm1, xmm2, xmm1, xmm3 ; illegal pmacsdql xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacssdd xmm1, xmm2, xmm1, xmm3 ; illegal pmacssdd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacssdqh xmm1, xmm2, xmm1, xmm3 ; illegal pmacssdqh xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacssdql xmm1, xmm2, xmm1, xmm3 ; illegal pmacssdql xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacsswd xmm1, xmm2, xmm1, xmm3 ; illegal pmacsswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacssww xmm1, xmm2, xmm1, xmm3 ; illegal pmacssww xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacswd xmm1, xmm2, xmm1, xmm3 ; illegal pmacswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmacsww xmm1, xmm2, xmm1, xmm3 ; illegal pmacsww xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmadcsswd xmm1, xmm2, xmm1, xmm3 ; illegal pmadcsswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pmadcswd xmm1, xmm2, xmm1, xmm3 ; illegal pmadcswd xmm1, xmm1, xmm2, xmm3 ; illegal - better message? pperm xmm1, xmm2, xmm1, xmm3 ; illegal pperm xmm1, xmm2, xmm3, xmm3 ; illegal pperm xmm1, xmm2, xmm2, xmm3 ; illegal
oeis/054/A054442.asm
neoneye/loda-programs
11
247345
<reponame>neoneye/loda-programs ; A054442: Second convolution of A001405 (central binomial numbers). ; Submitted by <NAME> ; 1,3,9,22,54,123,281,618,1362,2934,6330,13452,28620,60243,126921,265282,554874,1153506,2399390,4966740,10286196,21219038,43790154,90076452,185353204,380364108,780786516,1599015192,3275589144 mov $2,$0 add $2,1 mov $4,$0 lpb $2 mov $0,$4 sub $2,1 sub $0,$2 mov $3,$0 div $0,2 mul $1,2 add $3,1 bin $3,$0 mul $3,2 add $1,$3 lpe mov $0,$1 div $0,2
programs/oeis/057/A057902.asm
neoneye/loda
22
88590
<gh_stars>10-100 ; A057902: a(n) = 5^prime(n). ; 25,125,3125,78125,48828125,1220703125,762939453125,19073486328125,11920928955078125,186264514923095703125,4656612873077392578125,72759576141834259033203125,45474735088646411895751953125,1136868377216160297393798828125,710542735760100185871124267578125 seq $0,40 ; The prime numbers. mov $1,5 pow $1,$0 mov $0,$1
test/Succeed/GeneralizeIssue1.agda
shlevy/agda
1,989
2881
<filename>test/Succeed/GeneralizeIssue1.agda variable S : Set data D (A : Set) : Set1 where d : S → D A
1-source-files/main-sources/elite-disc.asm
markmoxon/elite-beebasm
251
173098
\ ****************************************************************************** \ \ ELITE DISC IMAGE SCRIPT \ \ Elite was written by <NAME> and <NAME> and is copyright Acornsoft 1984 \ \ The code on this site is identical to the source discs released on Ian Bell's \ personal website at http://www.elitehomepage.org/ (it's just been reformatted \ to be more readable) \ \ The commentary is copyright <NAME>, and any misunderstandings or mistakes \ in the documentation are entirely my fault \ \ The terminology and notations used in this commentary are explained at \ https://www.bbcelite.com/about_site/terminology_used_in_this_commentary.html \ \ The deep dive articles referred to in this commentary can be found at \ https://www.bbcelite.com/deep_dives \ \ ------------------------------------------------------------------------------ \ \ This source file produces the following SSD disc image: \ \ * elite-cassette-from-source-disc.ssd \ \ This can be loaded into an emulator or a real BBC Micro. \ \ ****************************************************************************** \PUTFILE "1-source-files/boot-files/$.!BOOT.bin", "!BOOT", &FFFFFF, &FFFFFF PUTFILE "1-source-files/basic-programs/$.ELITE.bin", "ELITE", &FF1900, &FF8023 PUTFILE "3-assembled-output/ELITE.bin", "ELTdata", &FF1100, &FF2000 PUTFILE "3-assembled-output/ELTcode.bin", "ELTcode", &FF1128, &FF1128 PUTFILE "3-assembled-output/README.txt", "README", &FFFFFF, &FFFFFF
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c43204e.ada
best08618/asylo
7
11211
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c43204e.ada -- C43204E.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT AN ARRAY AGGREGATE WITH AN OTHERS CHOICE CAN APPEAR -- AS THE INITIALIZATION EXPRESSION OF A CONSTRAINED CONSTANT, -- VARIABLE OBJECT DECLARATION, OR RECORD COMPONENT DECLARATION, -- AND THAT THE BOUNDS OF THE AGGREGATE ARE DETERMINED CORRECTLY. -- HISTORY: -- JET 08/15/88 CREATED ORIGINAL TEST. WITH REPORT; USE REPORT; PROCEDURE C43204E IS TYPE ARR11 IS ARRAY (INTEGER RANGE -3 .. 3) OF INTEGER; TYPE ARR12 IS ARRAY (IDENT_INT(-3) .. IDENT_INT(3)) OF INTEGER; TYPE ARR13 IS ARRAY (IDENT_INT(1) .. IDENT_INT(-1)) OF INTEGER; TYPE ARR21 IS ARRAY (INTEGER RANGE -1 .. 1, INTEGER RANGE -1 .. 1) OF INTEGER; TYPE ARR22 IS ARRAY (IDENT_INT(-1) .. IDENT_INT(1), IDENT_INT(-1) .. IDENT_INT(1)) OF INTEGER; TYPE ARR23 IS ARRAY (INTEGER RANGE -1 .. 1, IDENT_INT(-1) .. IDENT_INT(1)) OF INTEGER; TYPE ARR24 IS ARRAY (IDENT_INT(1) .. IDENT_INT(-1), IDENT_INT(-1) .. IDENT_INT(1)) OF INTEGER; CA11 : CONSTANT ARR11 := (1, OTHERS => IDENT_INT(2)); CA12 : CONSTANT ARR12 := (OTHERS => IDENT_INT(2)); CA13 : CONSTANT ARR13 := (OTHERS => IDENT_INT(2)); CA21 : CONSTANT ARR21 := (OTHERS => (-1..1 => IDENT_INT(2))); CA22 : CONSTANT ARR22 := (OTHERS => (-1..1 => IDENT_INT(2))); CA23 : CONSTANT ARR23 := (-1..1 => (OTHERS => IDENT_INT(2))); CA24 : CONSTANT ARR24 := (OTHERS => (OTHERS => IDENT_INT(2))); VA11 : ARR11 := (1,1, OTHERS => IDENT_INT(2)); VA12 : ARR12 := (OTHERS => IDENT_INT(2)); VA13 : ARR13 := (OTHERS => IDENT_INT(2)); VA21 : ARR21 := ((1,1,1), OTHERS => (-1..1 => IDENT_INT(2))); VA22 : ARR22 := (-1 => (1,1,1), 0..1 => (OTHERS => IDENT_INT(2))); VA23 : ARR23 := (OTHERS => (OTHERS => IDENT_INT(2))); VA24 : ARR24 := (OTHERS => (OTHERS => IDENT_INT(2))); TYPE REC IS RECORD RA11 : ARR11 := (1,1,1, OTHERS => IDENT_INT(2)); RA12 : ARR12 := (OTHERS => IDENT_INT(2)); RA13 : ARR13 := (OTHERS => IDENT_INT(2)); RA21 : ARR21 := ((1,1,1), (1,1,1), OTHERS => (IDENT_INT(2), IDENT_INT(2), IDENT_INT(2))); RA22 : ARR22 := (OTHERS => (OTHERS => IDENT_INT(2))); RA23 : ARR23 := (-1 => (OTHERS => 1), 0..1 => (OTHERS => IDENT_INT(2))); RA24 : ARR24 := (OTHERS => (OTHERS => IDENT_INT(2))); END RECORD; R : REC; BEGIN TEST ("C43204E", "CHECK THAT AN ARRAY AGGREGATE WITH AN OTHERS " & "CHOICE CAN APPEAR AS THE INITIALIZATION " & "EXPRESSION OF A CONSTRAINED CONSTANT, " & "VARIABLE OBJECT DECLARATION, OR RECORD " & "COMPONENT DECLARATION, AND THAT THE BOUNDS OF " & "THE AGGREGATE ARE DETERMINED CORRECTLY"); IF CA11 /= (1, 2, 2, 2, 2, 2, 2) THEN FAILED("INCORRECT VALUE OF CA11"); END IF; IF CA12 /= (2, 2, 2, 2, 2, 2, 2) THEN FAILED("INCORRECT VALUE OF CA12"); END IF; IF CA13'LENGTH /= 0 THEN FAILED("INCORRECT VALUE OF CA13"); END IF; IF CA21 /= ((2,2,2), (2,2,2), (2,2,2)) THEN FAILED("INCORRECT VALUE OF CA21"); END IF; IF CA22 /= ((2,2,2), (2,2,2), (2,2,2)) THEN FAILED("INCORRECT VALUE OF CA22"); END IF; IF CA23 /= ((2,2,2), (2,2,2), (2,2,2)) THEN FAILED("INCORRECT VALUE OF CA23"); END IF; IF CA24'LENGTH /= 0 OR CA24'LENGTH(2) /= 3 THEN FAILED("INCORRECT VALUE OF CA24"); END IF; IF VA11 /= (1, 1, 2, 2, 2, 2, 2) THEN FAILED("INCORRECT VALUE OF VA11"); END IF; IF VA12 /= (2, 2, 2, 2, 2, 2, 2) THEN FAILED("INCORRECT VALUE OF VA12"); END IF; IF VA13'LENGTH /= 0 THEN FAILED("INCORRECT VALUE OF VA13"); END IF; IF VA21 /= ((1,1,1), (2,2,2), (2,2,2)) THEN FAILED("INCORRECT VALUE OF VA21"); END IF; IF VA22 /= ((1,1,1), (2,2,2), (2,2,2)) THEN FAILED("INCORRECT VALUE OF VA22"); END IF; IF VA23 /= ((2,2,2), (2,2,2), (2,2,2)) THEN FAILED("INCORRECT VALUE OF VA23"); END IF; IF VA24'LENGTH /= 0 OR VA24'LENGTH(2) /= 3 THEN FAILED("INCORRECT VALUE OF VA24"); END IF; IF R.RA11 /= (1, 1, 1, 2, 2, 2, 2) THEN FAILED("INCORRECT VALUE OF RA11"); END IF; IF R.RA12 /= (2, 2, 2, 2, 2, 2, 2) THEN FAILED("INCORRECT VALUE OF RA12"); END IF; IF R.RA13'LENGTH /= 0 THEN FAILED("INCORRECT VALUE OF RA13"); END IF; IF R.RA21 /= ((1,1,1), (1,1,1), (2,2,2)) THEN FAILED("INCORRECT VALUE OF RA21"); END IF; IF R.RA22 /= ((2,2,2), (2,2,2), (2,2,2)) THEN FAILED("INCORRECT VALUE OF RA22"); END IF; IF R.RA23 /= ((1,1,1), (2,2,2), (2,2,2)) THEN FAILED("INCORRECT VALUE OF RA23"); END IF; IF R.RA24'LENGTH /= 0 OR R.RA24'LENGTH(2) /= 3 THEN FAILED("INCORRECT VALUE OF RA24"); END IF; RESULT; EXCEPTION WHEN OTHERS => FAILED ("UNEXPECTED CONSTRAINT_ERROR OR OTHER EXCEPTION " & "RAISED"); RESULT; END C43204E;
programs/oeis/250/A250655.asm
neoneye/loda
22
3153
; A250655: Number of (n+1) X (7+1) 0..1 arrays with nondecreasing x(i,j)-x(i,j-1) in the i direction and nondecreasing min(x(i,j),x(i-1,j)) in the j direction. ; 81,169,345,697,1401,2809,5625,11257,22521,45049,90105,180217,360441,720889,1441785,2883577,5767161,11534329,23068665,46137337,92274681,184549369,369098745,738197497,1476395001,2952790009,5905580025,11811160057,23622320121,47244640249,94489280505,188978561017,377957122041,755914244089,1511828488185,3023656976377,6047313952761,12094627905529,24189255811065,48378511622137,96757023244281,193514046488569,387028092977145,774056185954297,1548112371908601,3096224743817209,6192449487634425,12384898975268857,24769797950537721,49539595901075449,99079191802150905,198158383604301817,396316767208603641,792633534417207289,1585267068834414585,3170534137668829177,6341068275337658361,12682136550675316729,25364273101350633465,50728546202701266937,101457092405402533881,202914184810805067769,405828369621610135545,811656739243220271097,1623313478486440542201,3246626956972881084409,6493253913945762168825,12986507827891524337657,25973015655783048675321,51946031311566097350649,103892062623132194701305,207784125246264389402617,415568250492528778805241,831136500985057557610489,1662273001970115115220985,3324546003940230230441977,6649092007880460460883961,13298184015760920921767929,26596368031521841843535865,53192736063043683687071737,106385472126087367374143481,212770944252174734748286969,425541888504349469496573945,851083777008698938993147897,1702167554017397877986295801,3404335108034795755972591609,6808670216069591511945183225,13617340432139183023890366457,27234680864278366047780732921,54469361728556732095561465849,108938723457113464191122931705,217877446914226928382245863417,435754893828453856764491726841,871509787656907713528983453689,1743019575313815427057966907385,3486039150627630854115933814777,6972078301255261708231867629561,13944156602510523416463735259129,27888313205021046832927470518265,55776626410042093665854941036537 mov $1,2 pow $1,$0 mul $1,88 sub $1,7 mov $0,$1
fiat-amd64/63.88_ratio13929_seed3975821006667828_mul_p256.asm
dderjoel/fiat-crypto
491
22937
SECTION .text GLOBAL mul_p256 mul_p256: sub rsp, 0x80 ; last 0x30 (6) for Caller - save regs mov [ rsp + 0x50 ], rbx; saving to stack mov [ rsp + 0x58 ], rbp; saving to stack mov [ rsp + 0x60 ], r12; saving to stack mov [ rsp + 0x68 ], r13; saving to stack mov [ rsp + 0x70 ], r14; saving to stack mov [ rsp + 0x78 ], r15; saving to stack mov rax, [ rsi + 0x0 ]; load m64 x4 to register64 mov r10, rdx; preserving value of arg2 into a new reg mov rdx, [ rdx + 0x8 ]; saving arg2[1] in rdx. mulx r11, rbx, rax; x10, x9<- x4 * arg2[1] mov rdx, rax; x4 to rdx mulx rax, rbp, [ r10 + 0x0 ]; x12, x11<- x4 * arg2[0] mulx r12, r13, [ r10 + 0x18 ]; x6, x5<- x4 * arg2[3] mulx rdx, r14, [ r10 + 0x10 ]; x8, x7<- x4 * arg2[2] xor r15, r15 adox rbx, rax adox r14, r11 adox r13, rdx mov rcx, 0xffffffff ; moving imm to reg mov rdx, rbp; x11 to rdx mulx rbp, r8, rcx; x23, x22<- x11 * 0xffffffff adox r12, r15 mov r9, 0xffffffffffffffff ; moving imm to reg mulx r11, rax, r9; x25, x24<- x11 * 0xffffffffffffffff adcx r8, r11 mov r11, [ rsi + 0x8 ]; load m64 x1 to register64 adc rbp, 0x0 add rax, rdx; could be done better, if r0 has been u8 as well adcx r8, rbx mov rax, rdx; preserving value of x11 into a new reg mov rdx, [ r10 + 0x0 ]; saving arg2[0] in rdx. mulx rbx, r15, r11; x46, x45<- x1 * arg2[0] mov r9, -0x2 ; moving imm to reg inc r9; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r15, r8 adcx rbp, r14 mov r14, 0xffffffffffffffff ; moving imm to reg mov rdx, r14; 0xffffffffffffffff to rdx mulx r14, r8, r15; x69, x68<- x54 * 0xffffffffffffffff mov r9, [ rsi + 0x10 ]; load m64 x2 to register64 mov rdx, 0xffffffff00000001 ; moving imm to reg mulx rax, rcx, rax; x21, x20<- x11 * 0xffffffff00000001 mov rdx, 0xffffffff ; moving imm to reg mov [ rsp + 0x0 ], rdi; spilling out1 to mem mov [ rsp + 0x8 ], r9; spilling x2 to mem mulx rdi, r9, r15; x67, x66<- x54 * 0xffffffff mov [ rsp + 0x10 ], rax; spilling x21 to mem mov rax, rdx; preserving value of 0xffffffff into a new reg mov rdx, [ r10 + 0x8 ]; saving arg2[1] in rdx. mov [ rsp + 0x18 ], r12; spilling x19 to mem mov [ rsp + 0x20 ], rcx; spilling x20 to mem mulx r12, rcx, r11; x44, x43<- x1 * arg2[1] setc al; spill CF x34 to reg (rax) clc; adcx r9, r14 mov r14, 0x0 ; moving imm to reg adcx rdi, r14 mov rdx, r11; x1 to rdx mulx r11, r14, [ r10 + 0x10 ]; x42, x41<- x1 * arg2[2] clc; adcx rcx, rbx mulx rdx, rbx, [ r10 + 0x18 ]; x40, x39<- x1 * arg2[3] adox rcx, rbp adcx r14, r12 adcx rbx, r11 seto bpl; spill OF x57 to reg (rbp) mov r12, -0x2 ; moving imm to reg inc r12; OF<-0x0, preserve CF (debug: 6; load -2, increase it, save as -1) adox r8, r15 setc r8b; spill CF x52 to reg (r8) clc; movzx rax, al adcx rax, r12; loading flag adcx r13, [ rsp + 0x20 ] adox r9, rcx mov rax, [ rsp + 0x10 ]; load m64 x21 to register64 mov r11, [ rsp + 0x18 ]; x37, copying x19 here, cause x19 is needed in a reg for other than x37, namely all: , x37--x38, size: 1 adcx r11, rax movzx rax, r8b; x53, copying x52 here, cause x52 is needed in a reg for other than x53, namely all: , x53, size: 1 lea rax, [ rax + rdx ] mov rdx, 0xffffffff00000001 ; moving imm to reg mulx r15, rcx, r15; x65, x64<- x54 * 0xffffffff00000001 setc r8b; spill CF x38 to reg (r8) clc; movzx rbp, bpl adcx rbp, r12; loading flag adcx r13, r14 adcx rbx, r11 movzx rbp, r8b; x62, copying x38 here, cause x38 is needed in a reg for other than x62, namely all: , x62--x63, size: 1 adcx rbp, rax adox rdi, r13 adox rcx, rbx adox r15, rbp seto r14b; spill OF x83 to reg (r14) adc r14b, 0x0 movzx r14, r14b mov r8, rdx; preserving value of 0xffffffff00000001 into a new reg mov rdx, [ r10 + 0x0 ]; saving arg2[0] in rdx. mulx r11, rax, [ rsp + 0x8 ]; x91, x90<- x2 * arg2[0] adox rax, r9 mov r9, 0xffffffffffffffff ; moving imm to reg mov rdx, rax; x99 to rdx mulx rax, r13, r9; x114, x113<- x99 * 0xffffffffffffffff mov rbx, 0xffffffff ; moving imm to reg mulx rbp, r12, rbx; x112, x111<- x99 * 0xffffffff mov rbx, rdx; preserving value of x99 into a new reg mov rdx, [ r10 + 0x8 ]; saving arg2[1] in rdx. mulx r8, r9, [ rsp + 0x8 ]; x89, x88<- x2 * arg2[1] adcx r12, rax mov rax, 0x0 ; moving imm to reg adcx rbp, rax clc; adcx r13, rbx mov rdx, [ r10 + 0x10 ]; arg2[2] to rdx mulx r13, rax, [ rsp + 0x8 ]; x87, x86<- x2 * arg2[2] mov byte [ rsp + 0x28 ], r14b; spilling byte x83 to mem mov r14, [ rsi + 0x18 ]; load m64 x3 to register64 mov [ rsp + 0x30 ], r15; spilling x81 to mem setc r15b; spill CF x119 to reg (r15) clc; adcx r9, r11 mov rdx, [ r10 + 0x8 ]; arg2[1] to rdx mov [ rsp + 0x38 ], r13; spilling x87 to mem mulx r11, r13, r14; x134, x133<- x3 * arg2[1] adox r9, rdi adcx rax, r8 adox rax, rcx seto dil; spill OF x104 to reg (rdi) mov rcx, 0x0 ; moving imm to reg dec rcx; OF<-0x0, preserve CF (debug: state 4 (thanks Paul)) movzx r15, r15b adox r15, rcx; loading flag adox r9, r12 mov rdx, [ r10 + 0x0 ]; arg2[0] to rdx mulx r8, r12, r14; x136, x135<- x3 * arg2[0] adox rbp, rax setc r15b; spill CF x95 to reg (r15) clc; adcx r13, r8 setc al; spill CF x138 to reg (rax) clc; adcx r12, r9 mov r9, 0xffffffffffffffff ; moving imm to reg mov rdx, r12; x144 to rdx mulx r12, r8, r9; x159, x158<- x144 * 0xffffffffffffffff adcx r13, rbp mov rbp, 0xffffffff ; moving imm to reg mulx rcx, r9, rbp; x157, x156<- x144 * 0xffffffff setc bpl; spill CF x147 to reg (rbp) clc; adcx r9, r12 mov r12, 0x0 ; moving imm to reg adcx rcx, r12 mov r12, rdx; preserving value of x144 into a new reg mov rdx, [ r10 + 0x18 ]; saving arg2[3] in rdx. mov [ rsp + 0x40 ], rcx; spilling x162 to mem mov byte [ rsp + 0x48 ], bpl; spilling byte x147 to mem mulx rcx, rbp, [ rsp + 0x8 ]; x85, x84<- x2 * arg2[3] clc; adcx r8, r12 adcx r9, r13 setc r8b; spill CF x166 to reg (r8) clc; mov r13, -0x1 ; moving imm to reg movzx r15, r15b adcx r15, r13; loading flag adcx rbp, [ rsp + 0x38 ] mov r15, 0xffffffff00000001 ; moving imm to reg mov rdx, r15; 0xffffffff00000001 to rdx mulx rbx, r15, rbx; x110, x109<- x99 * 0xffffffff00000001 mov r13, 0x0 ; moving imm to reg adcx rcx, r13 mulx r12, r13, r12; x155, x154<- x144 * 0xffffffff00000001 clc; mov rdx, -0x1 ; moving imm to reg movzx rdi, dil adcx rdi, rdx; loading flag adcx rbp, [ rsp + 0x30 ] adox r15, rbp mov rdx, r14; x3 to rdx mulx r14, rdi, [ r10 + 0x10 ]; x132, x131<- x3 * arg2[2] movzx rbp, byte [ rsp + 0x28 ]; x107, copying x83 here, cause x83 is needed in a reg for other than x107, namely all: , x107--x108, size: 1 adcx rbp, rcx adox rbx, rbp seto cl; spill OF x128 to reg (rcx) adc cl, 0x0 movzx rcx, cl mulx rdx, rbp, [ r10 + 0x18 ]; x130, x129<- x3 * arg2[3] add al, 0x7F; load flag from rm/8 into OF, clears other flag. NODE, if operand1 is not a byte reg, this fails. seto al; since that has deps, resore it whereever it was adox r11, rdi movzx rax, byte [ rsp + 0x48 ]; load byte memx147 to register64 mov rdi, -0x1 ; moving imm to reg adcx rax, rdi; loading flag adcx r15, r11 adox rbp, r14 mov rax, 0x0 ; moving imm to reg adox rdx, rax adcx rbp, rbx dec rax; OF<-0x0, preserve CF (debug: state 1(0x0) (thanks Paul)) movzx r8, r8b adox r8, rax; loading flag adox r15, [ rsp + 0x40 ] movzx r8, cl; x152, copying x128 here, cause x128 is needed in a reg for other than x152, namely all: , x152--x153, size: 1 adcx r8, rdx adox r13, rbp adox r12, r8 seto r14b; spill OF x173 to reg (r14) adc r14b, 0x0 movzx r14, r14b mov rbx, r9; x174, copying x165 here, cause x165 is needed in a reg for other than x174, namely all: , x174--x175, x184, size: 2 mov rcx, 0xffffffffffffffff ; moving imm to reg sub rbx, rcx mov r11, r15; x176, copying x167 here, cause x167 is needed in a reg for other than x176, namely all: , x176--x177, x185, size: 2 mov rdx, 0xffffffff ; moving imm to reg sbb r11, rdx mov rbp, r13; x178, copying x169 here, cause x169 is needed in a reg for other than x178, namely all: , x186, x178--x179, size: 2 sbb rbp, 0x00000000 mov r8, r12; x180, copying x171 here, cause x171 is needed in a reg for other than x180, namely all: , x187, x180--x181, size: 2 mov rax, 0xffffffff00000001 ; moving imm to reg sbb r8, rax movzx rdx, r14b; _, copying x173 here, cause x173 is needed in a reg for other than _, namely all: , _--x183, size: 1 sbb rdx, 0x00000000 cmovc r8, r12; if CF, x187<- x171 (nzVar) mov r12, [ rsp + 0x0 ]; load m64 out1 to register64 mov [ r12 + 0x18 ], r8; out1[3] = x187 cmovc r11, r15; if CF, x185<- x167 (nzVar) mov [ r12 + 0x8 ], r11; out1[1] = x185 cmovc rbp, r13; if CF, x186<- x169 (nzVar) mov [ r12 + 0x10 ], rbp; out1[2] = x186 cmovc rbx, r9; if CF, x184<- x165 (nzVar) mov [ r12 + 0x0 ], rbx; out1[0] = x184 mov rbx, [ rsp + 0x50 ]; restoring from stack mov rbp, [ rsp + 0x58 ]; restoring from stack mov r12, [ rsp + 0x60 ]; restoring from stack mov r13, [ rsp + 0x68 ]; restoring from stack mov r14, [ rsp + 0x70 ]; restoring from stack mov r15, [ rsp + 0x78 ]; restoring from stack add rsp, 0x80 ret ; cpu Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz ; clocked at 4799 MHz ; first cyclecount 81.05, best 63.67857142857143, lastGood 63.88181818181818 ; seed 3975821006667828 ; CC / CFLAGS clang / -march=native -mtune=native -O3 ; time needed: 656452 ms / 60000 runs=> 10.940866666666667ms/run ; Time spent for assembling and measureing (initial batch_size=112, initial num_batches=101): 124326 ms ; Ratio (time for assembling + measure)/(total runtime for 60000runs): 0.18939084655085214 ; number reverted permutation/ tried permutation: 22223 / 29906 =74.310% ; number reverted decision/ tried decision: 23073 / 30095 =76.667%
src/startup.adb
JCGobbi/Nucleo-STM32G474RE
0
17949
<filename>src/startup.adb with Ada.Real_Time; use Ada.Real_Time; with STM_Board; use STM_Board; with Inverter_ADC; use Inverter_ADC; with Inverter_PWM; use Inverter_PWM; package body Startup is -- procedure Wait_Until_V_Battery; -- Wait until battery voltage is between minimum and maximum. -- Enable this routine only when the hardware is connected. ---------------- -- Initialize -- ---------------- procedure Initialize is begin -- Initialize GPIO ports Initialize_GPIO; -- Select gain = 1.0 to see only sine table sinusoid Sine_Gain := 1.0; -- Initialize sensors ADC Initialize_ADC; -- Do not start while the battery voltage is outside maximum and minimum -- Wait_Until_V_Battery; -- Select the AC frequency of the inverter if Read_Input (AC_Frequency_Pin) then -- 50 Hz PWM_Frequency_Hz := 25_000.0; else -- 60 Hz PWM_Frequency_Hz := 30_000.0; end if; -- Disable PWM gate drivers because some gate drivers enable with -- low level. Set_PWM_Gate_Power (False); -- Initialize sine generator Initialize_CORDIC; -- Initialize PWM generator Initialize_PWM (Frequency => PWM_Frequency_Hz, Deadtime => PWM_Deadtime, Alignment => Center); Initialized := STM_Board.Is_Initialized and Inverter_ADC.Is_Initialized and Inverter_PWM.Is_Initialized; end Initialize; -------------------- -- Start_Inverter -- -------------------- procedure Start_Inverter is begin -- Test if all peripherals are correctly initialized while not Initialized loop Set_Toggle (Green_LED); delay until Clock + Milliseconds (1); -- arbitrary end loop; -- Enable PWM gate drivers Inverter_PWM.Set_PWM_Gate_Power (True); -- Start generating the sinusoid Inverter_PWM.Start_PWM; end Start_Inverter; -------------------------- -- Wait_Until_V_Battery -- -------------------------- -- procedure Wait_Until_V_Battery is -- Period : constant Time_Span := Milliseconds (1); -- Next_Release : Time := Clock; -- Counter : Integer := 0; -- begin -- loop -- exit when Test_V_Battery; -- Next_Release := Next_Release + Period; -- delay until Next_Release; -- Counter := Counter + 1; -- if (Counter > 1_000) then -- Set_Toggle (Red_LED); -- Counter := 0; -- end if; -- end loop; -- Turn_Off (Red_LED); -- end Wait_Until_V_Battery; end Startup;
helpers/fact_2_3_1_0.als
Alan32Liu/SWEN90010A2Marking
0
2396
<gh_stars>0 pred did_not_call {all s: State | no s.last_called} pred did_not_connect {all s: State | no s.audio} fact {did_not_call or did_not_connect} // fact {all s, s': State | not no s.last_called or no s'.audio}
alloy4fun_models/trashltl/models/12/stAeeMZLb3SKfAaQr.als
Kaixi26/org.alloytools.alloy
0
1119
<gh_stars>0 open main pred idstAeeMZLb3SKfAaQr_prop13 { always some f:File | f in Trash implies always once f in File-Trash } pred __repair { idstAeeMZLb3SKfAaQr_prop13 } check __repair { idstAeeMZLb3SKfAaQr_prop13 <=> prop13o }
programs/oeis/066/A066373.asm
neoneye/loda
22
100056
; A066373: a(n) = (3*n-2)*2^(n-3). ; 2,7,20,52,128,304,704,1600,3584,7936,17408,37888,81920,176128,376832,802816,1703936,3604480,7602176,15990784,33554432,70254592,146800640,306184192,637534208,1325400064,2751463424,5704253440,11811160064,24427626496,50465865728,104152956928,214748364800,442381631488,910533066752,1872605741056,3848290697216,7902739824640,16217796509696,33260226740224,68169720922112,139637976727552,285873023221760,584940185976832,1196268651020288,2445313860173824,4996180836614144,10203467905761280,20829148276588544,42502721483309056,86694292826882048,176766285374291968,360287970189639680,734086739261390848,1495195076287004672,3044433348102455296,6196953087261802496,12610078956637388800,25652503477502345216,52169698083459825664,106068778423829921792,215596321361480384512,438110171750601850880,890055401556485865472,1807780919223536058368,3670902070668200771584,7452484605778658852864,15126330140441832325120,30695382138652693889024,62276207992843446255616,126323303416763009466368,256188381695678252843008,519460313115660973506560,1053087725679930882654208,2134509650257079636590592,4325687698308595015745536,8764712192206061516619776,17756097975589866003496960,35965543133535217947508736,72837780631781407776047104,147488949992984759314153472,298604677444813406152425472,604462909807314587353088000,1223432929450004724802650112,2475880078570760549798248448,5009788596483023299982393344,10135634071649051000736579584,20503381900664110803016744960,41470991316060239209120661504,83870437661584513624415666176,169597785382097097661180018688,342909390882050336147057410048,693246421999812953943509565440,1401348124471050471185808621568,2832406809884950068969196224512,5724234741655598391133550411776,11567311727082593288657416749056,23372307941707979590095465349120,47219984858501545205752194400256,95390707667174262462626916204544 mov $1,$0 mul $0,3 add $0,4 mov $2,2 pow $2,$1 mul $0,$2 div $0,2
mc-sema/validator/x86_64/tests/ADC8rr.asm
randolphwong/mcsema
2
92433
<reponame>randolphwong/mcsema BITS 64 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS= ;TEST_FILE_META_END ; ADC8rr mov ch, 0xc mov dh, 0x10 ;TEST_BEGIN_RECORDING adc ch, dh ;TEST_END_RECORDING
include/mpir-3.0.0/mpn/add_err2_n.asm
theprogrammermachine/EogenVirtualMachine
0
3954
dnl AMD64 mpn_add_err2_n dnl Copyright (C) 2009, <NAME> dnl All rights reserved. dnl Redistribution and use in source and binary forms, with or without dnl modification, are permitted provided that the following conditions are dnl met: dnl 1. Redistributions of source code must retain the above copyright notice, dnl this list of conditions and the following disclaimer. dnl 2. Redistributions in binary form must reproduce the above copyright dnl notice, this list of conditions and the following disclaimer in the dnl documentation and/or other materials provided with the distribution. dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS dnl ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A dnl PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT dnl HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED dnl TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. include(`../config.m4') C cycles/limb C K8,K9: 4.5 C K10: ? C P4: ? C P6-15 (Core2): ? C P6-28 (Atom): ? C C mp_limb_t mpn_add_err2_n (* rp,* up, * vp, * ep, * yp1, * yp2, n, cy) C C INPUT PARAMETERS define(`rp', `%rdi') define(`up', `%rsi') define(`vp', `%rdx') define(`ep', `%rcx') define(`yp1', `%r8') define(`yp2', `%r9') define(`n_param', `8(%rsp)') define(`cy_param', `16(%rsp)') define(`cy1', `%r14') define(`cy2', `%rax') define(`n', `%r10') define(`w', `%rbx') define(`e1l', `%rbp') define(`e1h', `%r11') define(`e2l', `%r12') define(`e2h', `%r13') ASM_START() TEXT ALIGN(16) PROLOGUE(mpn_add_err2_n) mov cy_param, cy2 C cy2 mov n_param, n C n push %rbx push %rbp push %r12 push %r13 push %r14 xor e1l, e1l C zero e1l, e1h, e2l, e2h xor e1h, e1h xor e2l, e2l xor e2h, e2h sub yp1, yp2 C yp2 -= yp1 lea (rp,n,8), rp C rp += n, up += n, vp += n lea (up,n,8), up lea (vp,n,8), vp test $1, n C if n is odd goto L(odd) jnz L(odd) lea -8(yp1,n,8), yp1 C { yp1 += n - 1 } neg n C { n = -n } jmp L(top) ALIGN(16) L(odd): C n is odd, do extra iteration lea -16(yp1,n,8), yp1 C yp1 += n - 2 neg n C { n = -n } shr $1, cy2 C rp[0] = up[0] + vp[0] + (cy2&1) mov (up,n,8), w adc (vp,n,8), w cmovc 8(yp1), e1l C if carry2 el1 = *(yp1+1) cmovc 8(yp1,yp2), e2l C if carry2 e2l = *(yp2+1) mov w, (rp,n,8) sbb cy2, cy2 C move carry2 into cy2 inc n C n++ jz L(end) C goto end if we are done ALIGN(16) L(top): mov (up,n,8), w shr $1, cy2 C restore carry2 adc (vp,n,8), w mov w, (rp,n,8) C rp[n] = up[n] + vp[n] + carry2 sbb cy1, cy1 C generate mask, preserve CF mov 8(up,n,8), w C rp[n] = up[n+1] + vp[n+1] + carry1 adc 8(vp,n,8), w mov w, 8(rp,n,8) sbb cy2, cy2 C generate mask, preserve CF mov (yp1), w C (e1h:e1l) += cy1 * yp1 limb and cy1, w add w, e1l adc $0, e1h and (yp1,yp2), cy1 C (e2h:e2l) += cy1 * yp2 limb add cy1, e2l adc $0, e2h mov -8(yp1), w C (e1h:e1l) += cy2 * next yp1 limb and cy2, w add w, e1l adc $0, e1h mov -8(yp1,yp2), w C (e2h:e2l) += cy2 * next yp2 limb and cy2, w add w, e2l adc $0, e2h add $2, n C n += 2 lea -16(yp1), yp1 C yp1 -= 2 jnz L(top) C if not done goto top L(end): mov e1l, (ep) C write out e1l, e1h, e2l, e2h mov e1h, 8(ep) mov e2l, 16(ep) mov e2h, 24(ep) and $1, %eax C return carry pop %r14 pop %r13 pop %r12 pop %rbp pop %rbx ret EPILOGUE()
test/Fail/Issue5079.agda
cagix/agda
1,989
3594
open import Agda.Builtin.Bool data D : Set where c : Bool → D f : @0 D → Bool f (c true) = true f (c false) = false
mc-sema/validator/x86_64/tests/SUBR_F32m.asm
randolphwong/mcsema
2
87231
<reponame>randolphwong/mcsema BITS 64 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS=FLAG_FPU_PE|FLAG_FPU_C1 ;TEST_FILE_META_END FLDPI ;TEST_BEGIN_RECORDING lea rdi, [rsp-0xc] FST dword [rdi] FSUBR dword [rdi] mov edi, 0 ;TEST_END_RECORDING
untested/ARM/bmiStuff.asm
GabrielRavier/Generic-Assembly-Samples
0
246466
code32 format ELF public _andn public _blsi public _blsr public _andn64 public _blsi64 public _blsr64 section '.text' executable align 16 _andn: bic r0, r1, r0 bx lr _blsi: rsb r3, r0, #0 and r0, r0, r3 bx lr _blsr: sub r3, r0, #1 and r0, r0, r3 bx lr _andn64: bic r0, r2, r0 bic r1, r3, r1 bx lr _blsi64: rsbs r2, r0, #0 rsc r3, r1, #0 and r0, r0, r2 and r1, r1, r3 bx lr _blsr64: subs r2, r0, #1 sbc r3, r1, #0 and r0, r0, r2 and r1, r1, r3 bx lr
test/Succeed/Issue1592a.agda
shlevy/agda
3
106
-- Andreas 2015-01-07 fixing polarity of projection-like functions -- {-# OPTIONS -v tc.polarity:20 -v tc.proj.like:10 #-} -- {-# OPTIONS -v tc.conv.elim:25 --show-implicit #-} open import Common.Size -- List covariant covariant data List (i : Size) (A : Set) : Set where [] : List i A cons : ∀{j : Size< i} → A → List j A → List i A -- Id mixed mixed mixed covariant -- Id is projection-like in argument l Id : ∀{i A} (l : List i A) → Set → Set Id [] X = X Id (cons _ _) X = X -- should pass cast : ∀{i A} (l : List i A) → Id l (List i A) → Id l (List ∞ A) cast l x = x
src/databases-sqlite.adb
skordal/databases
0
13043
<gh_stars>0 -- Databases - A simple database library for Ada applications -- (c) <NAME> 2019 <<EMAIL>> -- Report bugs and issues on <https://github.com/skordal/databases/issues> -- vim:ts=3:sw=3:et:si:sta with Ada.Text_IO; with Interfaces.C.Pointers; package body Databases.Sqlite is function Get_Value (This : in Column_Data) return Databases.Sql_Integer is function Sqlite3_Value_Int (Value : in Sqlite_Value_Pointer) return C.long; pragma Import (C, Sqlite3_Value_Int); Value : constant C.long := Sqlite3_Value_Int (This.Value_Object); begin return Databases.Sql_Integer (Value); end Get_Value; function Get_Value (This : in Column_Data) return Databases.Sql_Float is function Sqlite3_Value_Double (Value : in Sqlite_Value_Pointer) return C.double; pragma Import (C, Sqlite3_Value_Double); Value : constant C.double := Sqlite3_Value_Double (This.Value_Object); begin return Databases.Sql_Float (Value); end Get_Value; function Get_Value (This : in Column_Data) return Databases.Sql_Data_Array is package Byte_Array_Pointers is new Interfaces.C.Pointers ( Index => Natural, Element => Interfaces.Unsigned_8, Element_Array => Databases.Sql_Data_Array, Default_Terminator => 0); function Sqlite3_Value_Bytes (Value : in Sqlite_Value_Pointer) return C.ptrdiff_t; pragma Import (C, Sqlite3_Value_Bytes); function Sqlite3_Value_Blob (Value : in Sqlite_Value_Pointer) return Byte_Array_Pointers.Pointer; pragma Import (C, Sqlite3_Value_Blob); Blob_Pointer : constant Byte_Array_Pointers.Pointer := Sqlite3_Value_Blob (This.Value_Object); begin return Byte_Array_Pointers.Value (Blob_Pointer, Sqlite3_Value_Bytes (This.Value_Object)); end Get_Value; function Get_Value (This : in Column_Data) return String is package Char_Array_Pointers is new Interfaces.C.Pointers ( Index => C.size_t, Element => C.char, Element_Array => C.char_array, Default_Terminator => C.nul); function Sqlite3_Value_Text (Value : in Sqlite_Value_Pointer) return Char_Array_Pointers.Pointer; pragma Import (C, Sqlite3_Value_Text); Text_Pointer : constant Char_Array_Pointers.Pointer := Sqlite3_Value_Text (This.Value_Object); begin return C.To_Ada (Char_Array_Pointers.Value (Text_Pointer)); end Get_Value; procedure Finalize (This : in out Column_Data) is procedure Sqlite3_Value_Free (Value : in Sqlite_Value_Pointer); pragma Import (C, Sqlite3_Value_Free); begin Sqlite3_Value_Free (This.Value_Object); end Finalize; function Get_Column_Count (This : in Row_Data) return Natural is begin return Natural (This.Columns.Length); end Get_Column_Count; function Get_Column (This : in Row_Data; Index : in Positive) return Column_Data_Access is begin if Index > Natural (This.Columns.Length) then raise Databases.Invalid_Column_Index; else return This.Columns.Element (Index); end if; end Get_Column; procedure Finalize (This : in out Row_Data) is begin for Col of This.Columns loop Databases.Free (Col); end loop; end Finalize; function Get_Row (This : in Statement_Result; Row : in Positive) return Row_Data_Access is begin if Row > Natural (This.Rows.Length) then raise Invalid_Row_Index; else return This.Rows.Element (Row); end if; end Get_Row; function Get_Status (This : in Statement_Result) return Databases.Statement_Execution_Status is begin return This.Result_Status; end Get_Status; function Get_Returned_Row_Count (This : in Statement_Result) return Natural is begin return Natural (This.Rows.Length); end Get_Returned_Row_Count; procedure Finalize (This : in out Statement_Result) is begin for Row of This.Rows loop Databases.Free (Row); end loop; end Finalize; procedure Bind (This : in out Prepared_Statement; Index : in Positive; Value : in Sql_Integer) is function Sqlite3_Bind_Int64 (Statement : in Sqlite_Prepared_Statement_Pointer; Index : in C.int; Value : in C.long) return Sqlite_Status_Code; pragma Import (C, Sqlite3_Bind_Int64); Status_Code : constant Sqlite_Status_Code := Sqlite3_Bind_Int64 ( This.Stmt_Instance, C.int (Index), C.long (Value)); begin Handle_Sqlite_Status_Code (Status_Code); end Bind; procedure Bind (This : in out Prepared_Statement; Index : in Positive; Value : in Sql_Float) is function Sqlite3_Bind_Double (Statement : in Sqlite_Prepared_Statement_Pointer; Index : in C.int; Value : in C.double) return Sqlite_Status_Code; pragma Import (C, Sqlite3_Bind_Double); Status_Code : constant Sqlite_Status_Code := Sqlite3_Bind_Double ( This.Stmt_Instance, C.int (Index), C.double (Value)); begin Handle_Sqlite_Status_Code (Status_Code); end Bind; procedure Bind (This : in out Prepared_Statement; Index : in Positive; Value : in Boolean) is begin if Value then Bind (This, Index, 1); else Bind (This, Index, 0); end if; end Bind; procedure Bind (This : in out Prepared_Statement; Index : in Positive; Value : in String) is function Sqlite_Wrapper_Bind_String (Statement : in Sqlite_Prepared_Statement_Pointer; Index : in C.int; Value : in C.char_array) return Sqlite_Status_Code; pragma Import (C, Sqlite_Wrapper_Bind_String); Status_Code : constant Sqlite_Status_Code := Sqlite_Wrapper_Bind_String ( This.Stmt_Instance, C.int (Index), C.To_C (Value)); begin Handle_Sqlite_Status_Code (Status_Code); end Bind; procedure Clear (This : in out Prepared_Statement) is function Sqlite3_Clear_Bindings (Statement : in Sqlite_Prepared_Statement_Pointer) return Sqlite_Status_Code; pragma Import (C, Sqlite3_Clear_Bindings); Status_Code : constant Sqlite_Status_Code := Sqlite3_Clear_Bindings (This.Stmt_Instance); begin Handle_Sqlite_Status_Code (Status_Code); end Clear; procedure Reset (This : in out Prepared_Statement) is function Sqlite3_Reset (Statement : in Sqlite_Prepared_Statement_Pointer) return Sqlite_Status_Code; pragma Import (C, Sqlite3_Reset); Status_Code : constant Sqlite_Status_Code := Sqlite3_Reset (This.Stmt_Instance); begin Handle_Sqlite_Status_Code (Status_Code); end Reset; function Execute (This : in out Prepared_Statement) return Statement_Result_Access is use type Interfaces.C.int; function Sqlite3_Step (Statement : in Sqlite_Prepared_Statement_Pointer) return Sqlite_Status_Code; pragma Import (C, Sqlite3_Step); function Sqlite3_Column_Count (Statement : in Sqlite_Prepared_Statement_Pointer) return C.int; pragma Import (C, Sqlite3_Column_Count); function Sqlite3_Column_Value (Statement : in Sqlite_Prepared_Statement_Pointer; Col : in C.int) return Sqlite_Value_Pointer; pragma Import (C, Sqlite3_Column_Value); function Sqlite3_Value_Dup (Value : in Sqlite_Value_Pointer) return Sqlite_Value_Pointer; pragma Import (C, Sqlite3_Value_Dup); Status_Code : Sqlite_Status_Code; Return_Value : constant Statement_Result_Access := new Statement_Result'(Ada.Finalization.Controlled with Result_Status => Failure, Rows => Row_Data_Vectors.Empty_Vector); begin loop Status_Code := Sqlite3_Step (This.Stmt_Instance); case Status_Code is when Sqlite_Done => Statement_Result (Return_Value.all).Result_Status := Success; exit; when Sqlite_Row => -- FIXME: For SQLite, all results must be read and stored here to be accessible, as the SQLite API does -- FIXME: not provide a separate results object that allows reading objects separately from the statement. declare Row : constant Row_Data_Access := new Row_Data; begin for Col in 0 .. Sqlite3_Column_Count(This.Stmt_Instance) - 1 loop declare Column : constant Column_Data_Access := new Column_Data; begin Column_Data (Column.all).Value_Object := Sqlite3_Value_Dup (Sqlite3_Column_Value (This.Stmt_Instance, Col)); Row_Data (Row.all).Columns.Append (Column); end; end loop; Statement_Result (Return_Value.all).Rows.Append (Row); end; when others => Handle_Sqlite_Status_Code (Status_Code); end case; end loop; return Return_Value; end Execute; function Execute (This : in out Prepared_Statement) return Statement_Execution_Status is Results : Statement_Result_Access := This.Execute; Return_Value : constant Statement_Execution_Status := Results.Get_Status; begin Databases.Free (Results); return Return_Value; end Execute; procedure Finalize (This : in out Prepared_Statement) is procedure Sqlite_Wrapper_Free_Prepared_Statement (Statement : in Sqlite_Prepared_Statement_Pointer); pragma Import (C, Sqlite_Wrapper_Free_Prepared_Statement); begin Sqlite_Wrapper_Free_Prepared_Statement (This.Stmt_Instance); end Finalize; function Open (Filename : in String; Create : in Boolean := False) return Databases.Database_Access is function Sqlite_Wrapper_Open (Filename : in C.char_array; Create_File : in C.int; Status : out Sqlite_Status_Code) return Sqlite_Instance_Pointer; pragma Import (C, Sqlite_Wrapper_Open); Create_File : constant C.int := (if Create then 1 else 0); Status_Code : Sqlite_Status_Code; Db_Instance : constant Sqlite_Instance_Pointer := Sqlite_Wrapper_Open (C.To_C (Filename), Create_File, Status_Code); begin Handle_Sqlite_Status_Code (Status_Code); return new Database'(Instance => Db_Instance); end Open; procedure Close (This : in out Database) is procedure Sqlite_Wrapper_Close (Instance : in Sqlite_Instance_Pointer); pragma Import (C, Sqlite_Wrapper_Close); begin Sqlite_Wrapper_Close (This.Instance); This.Instance := null; end Close; function Is_Open (This : in Database) return Boolean is begin return This.Instance /= null; end Is_Open; function Prepare (This : in out Database; Statement : in String) return Databases.Prepared_Statement_Access is function Sqlite_Wrapper_Prepare (Instance : in Sqlite_Instance_Pointer; Statement : in C.char_array; Statement_Length : in C.int; Status_Code : out Sqlite_Status_Code) return Sqlite_Prepared_Statement_Pointer; pragma Import (C, Sqlite_Wrapper_Prepare); Status_Code : Sqlite_Status_Code; Statement_Instance : constant Sqlite_Prepared_Statement_Pointer := Sqlite_Wrapper_Prepare (This.Instance, C.To_C (Statement), C.int (Statement'Length), Status_Code); begin Handle_Sqlite_Status_Code (Status_Code); return new Prepared_Statement'(Ada.Finalization.Controlled with Db_Instance => This.Instance, Stmt_Instance => Statement_Instance); end Prepare; procedure Handle_Sqlite_Status_Code (Status : in Sqlite_Status_Code) is begin case Status is when Sqlite_Ok => return; when Sqlite_IOErr => raise Databases.IO_Error; when Sqlite_Cant_Open => raise Databases.File_Error; when others => Ada.Text_IO.Put_Line ("Databases.Sqlite: Got unknown error code: " & Sqlite_Status_Code'Image (Status)); raise Databases.Unspecified_Error; end case; end Handle_Sqlite_Status_Code; end Databases.Sqlite;
scripts/music/en/previousTrack.applescript
dnedry2/vscode-itunes
16
833
tell application "Music" back track end tell
prototyping/Properties/TypeCheck.agda
MeltzDev/luau
0
5673
{-# OPTIONS --rewriting #-} module Properties.TypeCheck where open import Agda.Builtin.Equality using (_≡_; refl) open import Agda.Builtin.Bool using (Bool; true; false) open import FFI.Data.Maybe using (Maybe; just; nothing) open import FFI.Data.Either using (Either) open import Luau.TypeCheck using (_⊢ᴱ_∈_; _⊢ᴮ_∈_; ⊢ᴼ_; ⊢ᴴ_; _⊢ᴴᴱ_▷_∈_; _⊢ᴴᴮ_▷_∈_; nil; var; addr; number; bool; string; app; function; block; binexp; done; return; local; nothing; orUnknown; tgtBinOp) open import Luau.Syntax using (Block; Expr; Value; BinaryOperator; yes; nil; addr; number; bool; string; val; var; binexp; _$_; function_is_end; block_is_end; _∙_; return; done; local_←_; _⟨_⟩; _⟨_⟩∈_; var_∈_; name; fun; arg; +; -; *; /; <; >; ==; ~=; <=; >=) open import Luau.Type using (Type; nil; unknown; never; number; boolean; string; _⇒_; src; tgt) open import Luau.RuntimeType using (RuntimeType; nil; number; function; string; valueType) open import Luau.VarCtxt using (VarCtxt; ∅; _↦_; _⊕_↦_; _⋒_; _⊝_) renaming (_[_] to _[_]ⱽ) open import Luau.Addr using (Addr) open import Luau.Var using (Var; _≡ⱽ_) open import Luau.Heap using (Heap; Object; function_is_end) renaming (_[_] to _[_]ᴴ) open import Properties.Contradiction using (CONTRADICTION) open import Properties.Dec using (yes; no) open import Properties.Equality using (_≢_; sym; trans; cong) open import Properties.Product using (_×_; _,_) open import Properties.Remember using (Remember; remember; _,_) typeOfᴼ : Object yes → Type typeOfᴼ (function f ⟨ var x ∈ S ⟩∈ T is B end) = (S ⇒ T) typeOfᴹᴼ : Maybe(Object yes) → Maybe Type typeOfᴹᴼ nothing = nothing typeOfᴹᴼ (just O) = just (typeOfᴼ O) typeOfⱽ : Heap yes → Value → Maybe Type typeOfⱽ H nil = just nil typeOfⱽ H (bool b) = just boolean typeOfⱽ H (addr a) = typeOfᴹᴼ (H [ a ]ᴴ) typeOfⱽ H (number n) = just number typeOfⱽ H (string x) = just string typeOfᴱ : Heap yes → VarCtxt → (Expr yes) → Type typeOfᴮ : Heap yes → VarCtxt → (Block yes) → Type typeOfᴱ H Γ (var x) = orUnknown(Γ [ x ]ⱽ) typeOfᴱ H Γ (val v) = orUnknown(typeOfⱽ H v) typeOfᴱ H Γ (M $ N) = tgt(typeOfᴱ H Γ M) typeOfᴱ H Γ (function f ⟨ var x ∈ S ⟩∈ T is B end) = S ⇒ T typeOfᴱ H Γ (block var b ∈ T is B end) = T typeOfᴱ H Γ (binexp M op N) = tgtBinOp op typeOfᴮ H Γ (function f ⟨ var x ∈ S ⟩∈ T is C end ∙ B) = typeOfᴮ H (Γ ⊕ f ↦ (S ⇒ T)) B typeOfᴮ H Γ (local var x ∈ T ← M ∙ B) = typeOfᴮ H (Γ ⊕ x ↦ T) B typeOfᴮ H Γ (return M ∙ B) = typeOfᴱ H Γ M typeOfᴮ H Γ done = nil mustBeFunction : ∀ H Γ v → (never ≢ src (typeOfᴱ H Γ (val v))) → (function ≡ valueType(v)) mustBeFunction H Γ nil p = CONTRADICTION (p refl) mustBeFunction H Γ (addr a) p = refl mustBeFunction H Γ (number n) p = CONTRADICTION (p refl) mustBeFunction H Γ (bool true) p = CONTRADICTION (p refl) mustBeFunction H Γ (bool false) p = CONTRADICTION (p refl) mustBeFunction H Γ (string x) p = CONTRADICTION (p refl) mustBeNumber : ∀ H Γ v → (typeOfᴱ H Γ (val v) ≡ number) → (valueType(v) ≡ number) mustBeNumber H Γ (addr a) p with remember (H [ a ]ᴴ) mustBeNumber H Γ (addr a) p | (just O , q) with trans (cong orUnknown (cong typeOfᴹᴼ (sym q))) p mustBeNumber H Γ (addr a) p | (just function f ⟨ var x ∈ T ⟩∈ U is B end , q) | () mustBeNumber H Γ (addr a) p | (nothing , q) with trans (cong orUnknown (cong typeOfᴹᴼ (sym q))) p mustBeNumber H Γ (addr a) p | nothing , q | () mustBeNumber H Γ (number n) p = refl mustBeString : ∀ H Γ v → (typeOfᴱ H Γ (val v) ≡ string) → (valueType(v) ≡ string) mustBeString H Γ (addr a) p with remember (H [ a ]ᴴ) mustBeString H Γ (addr a) p | (just O , q) with trans (cong orUnknown (cong typeOfᴹᴼ (sym q))) p mustBeString H Γ (addr a) p | (just function f ⟨ var x ∈ T ⟩∈ U is B end , q) | () mustBeString H Γ (addr a) p | (nothing , q) with trans (cong orUnknown (cong typeOfᴹᴼ (sym q))) p mustBeString H Γ (addr a) p | (nothing , q) | () mustBeString H Γ (string x) p = refl typeCheckᴱ : ∀ H Γ M → (Γ ⊢ᴱ M ∈ (typeOfᴱ H Γ M)) typeCheckᴮ : ∀ H Γ B → (Γ ⊢ᴮ B ∈ (typeOfᴮ H Γ B)) typeCheckᴱ H Γ (var x) = var refl typeCheckᴱ H Γ (val nil) = nil typeCheckᴱ H Γ (val (addr a)) = addr (orUnknown (typeOfᴹᴼ (H [ a ]ᴴ))) typeCheckᴱ H Γ (val (number n)) = number typeCheckᴱ H Γ (val (bool b)) = bool typeCheckᴱ H Γ (val (string x)) = string typeCheckᴱ H Γ (M $ N) = app (typeCheckᴱ H Γ M) (typeCheckᴱ H Γ N) typeCheckᴱ H Γ (function f ⟨ var x ∈ T ⟩∈ U is B end) = function (typeCheckᴮ H (Γ ⊕ x ↦ T) B) typeCheckᴱ H Γ (block var b ∈ T is B end) = block (typeCheckᴮ H Γ B) typeCheckᴱ H Γ (binexp M op N) = binexp (typeCheckᴱ H Γ M) (typeCheckᴱ H Γ N) typeCheckᴮ H Γ (function f ⟨ var x ∈ T ⟩∈ U is C end ∙ B) = function (typeCheckᴮ H (Γ ⊕ x ↦ T) C) (typeCheckᴮ H (Γ ⊕ f ↦ (T ⇒ U)) B) typeCheckᴮ H Γ (local var x ∈ T ← M ∙ B) = local (typeCheckᴱ H Γ M) (typeCheckᴮ H (Γ ⊕ x ↦ T) B) typeCheckᴮ H Γ (return M ∙ B) = return (typeCheckᴱ H Γ M) (typeCheckᴮ H Γ B) typeCheckᴮ H Γ done = done typeCheckᴼ : ∀ H O → (⊢ᴼ O) typeCheckᴼ H nothing = nothing typeCheckᴼ H (just function f ⟨ var x ∈ T ⟩∈ U is B end) = function (typeCheckᴮ H (x ↦ T) B) typeCheckᴴ : ∀ H → (⊢ᴴ H) typeCheckᴴ H a {O} p = typeCheckᴼ H (O) typeCheckᴴᴱ : ∀ H Γ M → (Γ ⊢ᴴᴱ H ▷ M ∈ typeOfᴱ H Γ M) typeCheckᴴᴱ H Γ M = (typeCheckᴴ H , typeCheckᴱ H Γ M) typeCheckᴴᴮ : ∀ H Γ M → (Γ ⊢ᴴᴮ H ▷ M ∈ typeOfᴮ H Γ M) typeCheckᴴᴮ H Γ M = (typeCheckᴴ H , typeCheckᴮ H Γ M)
boot/16bit-print_hex.asm
Soptq/sim-osv2
0
18179
print_hex: pusha mov cx, 0 ; to print hex 0x1234, we need to convert it to string 0x1234 and then call print function ; for 0-9, we will just add 0x30 to them so that 0x0 could be 0x30 ; for A-F, we will add to them so that 0xA could be 0x41 hex_loop: cmp cx, 4 ; iterate 4 times as each register currently has 16 bits / 4 bytes je end mov ax, dx; and ax, 0x000f ; mask every byte except the last one add al, 0x30 cmp al, 0x39 jle step2 ; if alphabet is 0-9, continue add al, 7 ; after adding 0x30, A becomes 0x3A. In order to make it 0x41, we add another 7 to it. step2: mov bx, HEX_OUT + 5 sub bx, cx mov [bx], al ror dx, 4 ; circle right shift 4 bits / 1 byte add cx, 1 jmp hex_loop end: mov bx, HEX_OUT call print popa ret HEX_OUT: db '0x0000', 0
Transynther/x86/_processed/AVXALIGN/_st_zr_4k_sm_/i3-7100_9_0x84_notsx.log_21829_908.asm
ljhsiun2/medusa
9
94935
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r13 push %r9 push %rbp push %rbx push %rcx lea addresses_A_ht+0x16573, %r11 xor %r9, %r9 mov (%r11), %r10d nop add $21056, %rbp lea addresses_WT_ht+0x14f3, %rbx nop nop sub $9454, %r13 mov (%rbx), %cx nop xor %rcx, %rcx lea addresses_UC_ht+0xe9f3, %r11 nop xor %rbp, %rbp movb (%r11), %r9b and %rcx, %rcx lea addresses_A_ht+0x139b3, %rbp nop nop nop xor $14319, %r11 movw $0x6162, (%rbp) and $23159, %r9 lea addresses_UC_ht+0x4ef3, %rbx nop nop nop nop xor %r9, %r9 vmovups (%rbx), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $1, %xmm2, %rcx nop and $32672, %r9 pop %rcx pop %rbx pop %rbp pop %r9 pop %r13 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r14 push %r8 push %r9 push %rax push %rcx push %rdi push %rdx // Store lea addresses_RW+0x13f3b, %rcx clflush (%rcx) nop nop nop nop and $17565, %rdx mov $0x5152535455565758, %rax movq %rax, %xmm5 movups %xmm5, (%rcx) nop nop nop nop sub %rax, %rax // Store lea addresses_US+0x5f73, %r8 nop nop sub %rcx, %rcx mov $0x5152535455565758, %rax movq %rax, (%r8) nop nop nop nop nop inc %r9 // Store lea addresses_WT+0x2f73, %rdx add %rdi, %rdi mov $0x5152535455565758, %rcx movq %rcx, (%rdx) nop xor $48411, %r9 // Load lea addresses_normal+0x433, %rcx nop cmp %r8, %r8 mov (%rcx), %r14 nop nop nop nop inc %rdx // Faulty Load lea addresses_US+0x5f73, %rdi dec %r9 movntdqa (%rdi), %xmm5 vpextrq $0, %xmm5, %rax lea oracles, %rdx and $0xff, %rax shlq $12, %rax mov (%rdx,%rax,1), %rax pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r14 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_US', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_RW', 'same': False, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_US', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WT', 'same': False, 'size': 8, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_US', 'same': True, 'size': 16, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_A_ht', 'same': True, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'00': 4899, '58': 16930} 58 58 58 58 58 58 00 58 58 58 58 58 00 58 58 58 00 58 58 58 58 58 58 58 58 58 00 58 58 58 00 58 58 58 58 00 00 58 58 00 00 00 58 00 00 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 00 00 58 00 58 58 58 58 58 58 58 58 00 58 58 58 00 58 58 58 00 58 58 58 58 58 58 58 00 58 58 00 00 58 00 00 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 00 00 58 58 00 58 00 00 58 58 58 58 00 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 00 58 58 58 58 58 58 58 58 58 00 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 00 00 58 58 58 00 58 00 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 00 00 58 58 00 00 00 58 58 00 58 00 00 00 00 58 00 00 58 58 58 58 00 58 58 58 58 00 58 58 58 58 58 58 58 58 00 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 00 58 58 00 58 58 00 58 58 58 00 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 00 58 58 58 00 58 58 58 00 58 58 58 00 58 58 58 58 00 58 58 58 58 58 58 58 00 58 00 00 58 58 58 00 00 00 00 58 58 58 58 58 58 58 58 58 00 58 58 00 58 58 58 58 00 58 58 58 00 00 58 58 58 58 58 58 00 00 00 00 00 58 58 58 58 58 00 00 58 58 58 00 58 58 58 58 58 58 58 58 00 00 00 58 58 58 58 00 58 58 00 58 00 58 00 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 00 58 00 58 58 00 58 58 58 58 00 58 58 58 58 58 58 58 00 00 00 00 58 58 58 00 58 58 58 58 00 58 00 00 58 58 58 58 00 00 58 58 58 58 58 58 00 58 58 00 00 00 58 00 58 00 00 00 58 58 58 00 58 58 58 58 58 00 58 58 00 00 58 58 58 58 58 58 00 58 58 58 58 00 58 58 58 58 58 00 00 00 58 00 58 00 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 00 58 58 58 58 00 58 58 58 58 00 58 00 58 58 00 58 58 58 58 58 00 58 58 58 58 00 58 58 58 58 58 00 00 58 58 58 58 00 00 58 58 00 58 00 58 00 00 58 58 00 58 58 58 58 58 00 00 58 58 58 58 58 58 00 58 00 58 58 58 00 00 58 58 00 00 58 58 58 58 58 00 58 58 58 58 58 00 58 00 58 58 58 00 00 58 58 58 58 00 58 58 58 00 58 58 00 58 00 58 58 58 00 58 58 58 00 58 58 00 00 00 00 58 58 58 58 58 58 00 58 58 00 58 58 58 58 58 58 58 58 58 58 58 00 00 58 58 58 58 58 58 00 58 00 00 58 58 58 58 00 00 58 58 00 00 58 58 58 58 58 00 00 58 00 58 58 58 58 58 00 58 58 58 58 58 58 00 00 00 58 58 58 00 58 00 00 00 58 58 58 00 00 58 58 00 00 58 58 00 00 58 00 00 00 58 58 58 58 58 58 00 58 58 58 00 58 58 58 58 58 00 58 58 00 58 00 00 58 58 58 58 58 58 58 58 58 58 58 58 00 58 00 58 00 00 58 58 00 58 58 00 00 58 58 58 00 58 58 58 00 58 58 58 00 58 00 58 58 58 00 58 00 58 00 58 58 58 58 00 58 58 00 58 00 58 58 58 58 00 58 58 58 58 58 58 58 00 00 00 58 58 58 58 58 58 58 00 58 00 58 58 58 58 00 00 58 58 58 00 58 00 00 00 00 00 00 00 58 00 58 58 58 00 00 58 58 58 00 00 58 58 58 58 58 58 58 58 00 00 58 58 58 58 58 58 58 58 58 58 58 00 58 58 00 00 58 58 58 58 58 58 58 00 58 58 58 58 00 00 00 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_1068.asm
ljhsiun2/medusa
9
173342
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r15 push %r9 push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0xb8fe, %r12 clflush (%r12) nop nop xor $31792, %r9 movw $0x6162, (%r12) dec %r13 lea addresses_D_ht+0x1e2fe, %rsi lea addresses_A_ht+0x109fe, %rdi nop nop nop nop xor $20878, %rdx mov $71, %rcx rep movsl nop nop nop nop nop xor $9454, %r15 pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r15 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r8 push %rax push %rbp push %rbx // Store lea addresses_D+0xe2de, %rbx nop nop nop and %rax, %rax mov $0x5152535455565758, %r13 movq %r13, %xmm7 movups %xmm7, (%rbx) nop and %r12, %r12 // Store lea addresses_normal+0x19efe, %r12 clflush (%r12) nop nop nop nop nop and $10997, %r8 movl $0x51525354, (%r12) nop nop nop nop add %r8, %r8 // Faulty Load lea addresses_RW+0xf2fe, %r8 nop dec %rax mov (%r8), %r13w lea oracles, %rbx and $0xff, %r13 shlq $12, %r13 mov (%rbx,%r13,1), %r13 pop %rbx pop %rbp pop %rax pop %r8 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_RW', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 3}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 10}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_RW', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 9}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 6}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 8}} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
util/thg/nthu.asm
olifink/smsqe
0
7902
* Find the next Job using a Thing v0.00  Feb 1988 J.R.Oakley QJUMP * (It's just one Job after another) section thing * include 'dev8_mac_assert' include 'dev8_keys_err' include 'dev8_keys_sys' include 'dev8_keys_thg' * xref th_find xref th_nxtu xref th_exit * xdef th_nthu *+++ * Find a thing, given its name, and return the Job ID of the Job that * owns the given usage block, and the address of the next usage block: * this allows application code to generate a list of Jobs that are * using a Thing. * * Registers: * Entry Exit * D0 0, ITNF, IJOB * D1 Job ID of owner of block * D2/D3 smashed * A0 name of thing (>=3 chars) preserved * A1 usage block or 0 next usage block, or first * A2/A3 smashed * A6 pointer to system variables preserved *--- th_nthu move.l a1,a2 ; keep pointer to current usage block jsr th_find(pc) ; find the Thing bne.s thu_exit ; ...oops jsr th_nxtu(pc) ; usage code can find user and next thu_exit jmp th_exit(pc) * end
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/named_test.adb
best08618/asylo
7
21480
<gh_stars>1-10 -- { dg-do run } with Text_IO; use Text_IO; procedure Named_Test is type Base is tagged limited record Flag : boolean; Value : integer; end record; -- function Build (X : Integer; Y : Integer) return Base is begin return Result : Base do Result.Flag := (X = Y); Result.Value := X * Y; end return; end; -- type Table is array (1..1) of Base; It : Table := (1 => Build ( Y => 17, X => 11)); begin if It (1).Flag or else It (1).Value /= 187 then raise Program_Error; end if; end;
src/macros.asm
Q-Bert-Reynolds/gun-hockey-gb
1
169108
TRAMPOLINE: MACRO ;\1 = jump address ld b, BANK(\1) ld hl, \1 call Trampoline ENDM PUSH_VAR: MACRO ;\1 = WRAM address ld a, [\1] push af ENDM POP_VAR: MACRO ;\1 = WRAM address pop af ld [\1], a ENDM ;Debug messages can contain expressions between %%. ;When enabled in the settings, whenever a debug message is encountered in the code, it will be logged to the debug messages window or log file. ;Debug messages also support ternary operators in the form: "%boolean expression%text if true;text if false;". DEBUG_LOG_STRING: MACRO; \1 = string ld d, d jr .end\@ dw $6464 dw $0000 db \1,0 .end\@: ENDM DEBUG_LOG_ADDRESS: MACRO; \1 = address, \2 = bank ld d, d jr .end\@ dw $6464 dw $0001 db \1 dw \2 .end\@: ENDM DEBUG_LOG_LABEL: MACRO; \1 = label DEBUG_LOG_ADDRESS \1, BANK(\1) ENDM SET_LCD_INTERRUPT: MACRO ;\1 = interrupt address di ld b, ~IEF_LCDC ld a, [rIE] and a, b ld [rIE], a xor a ld [rSTAT], a ld hl, rLCDInterrupt ld bc, \1 ld a, b ld [hli], a ld a, c ld [hl], a ld b, IEF_LCDC ld a, [rIE] or a, b ld [rIE], a ld a, STATF_LYC ld [rSTAT], a ei ENDM DISABLE_LCD_INTERRUPT: MACRO di ld b, ~IEF_LCDC ld a, [rIE] and a, b ld [rIE], a xor a ld [rSTAT], a ld hl, rLCDInterrupt ld bc, EndLCDInterrupt ld a, b ld [hli], a ld a, c ld [hl], a ei ENDM HIDE_ALL_SPRITES: MACRO xor a ld b, 40 ld hl, oam_buffer .loop\@ ld [hli], a ld [hli], a inc hl inc hl dec b jr nz, .loop\@ ENDM CLEAR_SCREEN: MACRO ;\1 = tile ld a, \1 call ClearScreen ENDM CLEAR_BKG_AREA: MACRO ;x, y, w, h, tile ld a, \5 ld bc, \3 * \4 ld hl, tile_buffer call mem_Set ld d, \1 ld e, \2 ld h, \3 ld l, \4 ld bc, tile_buffer call gbdk_SetBkgTiles ENDM CLEAR_WIN_AREA: MACRO ;x, y, w, h, tile ld a, \5 ld bc, \3 * \4 ld hl, tile_buffer call mem_Set ld d, \1 ld e, \2 ld h, \3 ld l, \4 ld bc, tile_buffer call gbdk_SetWinTiles ENDM UPDATE_INPUT_AND_JUMP_TO_IF_BUTTONS: MACRO ; \1=address, \2=buttons call UpdateInput JUMP_TO_IF_BUTTONS \1, \2 ENDM JUMP_TO_IF_BUTTONS: MACRO ; \1=address, \2=buttons ld a, [last_button_state] and a jr nz, .skip\@ ld a, [button_state] and \2 jp nz, \1 .skip\@ ENDM EXITABLE_DELAY: MACRO ; \1=address, \2=buttons, \3=frames ld a, \3 .loop\@ push af UPDATE_INPUT_AND_JUMP_TO_IF_BUTTONS .jump\@, \2 call gbdk_WaitVBL pop af dec a jr nz, .loop\@ jr .exit\@ .jump\@ pop af jp \1 .exit\@ ENDM WAITPAD_UP: MACRO .loop\@ call gbdk_WaitVBL call UpdateInput ld a, [last_button_state] and a jr nz, .loop\@ ENDM WAITPAD_UP_OR_FRAMES: MACRO ; \1=frames ld a, \1 .loop\@ push af;frames call gbdk_WaitVBL call UpdateInput ld a, [last_button_state] and a jr z, .exit\@ pop af;frames dec a jr nz, .loop\@ push af;frames .exit\@ pop af;frames ENDM SET_DEFAULT_PALETTE: MACRO ld hl, rBGP ld [hl], DMG_PAL_BDLW ld hl, rOBP0 ld [hl], DMG_PAL_BDLW ld hl, rOBP1 ld [hl], DMG_PAL_DLWW ENDM RGB: MACRO ;\1 = red, \2 = green, \3 = blue DW (\3 << 10 | \2 << 5 | \1) ENDM D24: MACRO ;\1 = 24 bit number DB (\1 & $FF0000) >> 16 DB (\1 & $00FF00) >> 8 DB (\1 & $0000FF) ENDM BETWEEN: MACRO; if \1 <= a < \2 IF \1 > \2 PRINTT "ERROR: LOWER BOUND CAN'T BE HIGHER THAN UPPER BOUND." ELIF \1 < 0 && \2 >= 0 cp 128 jr c, .positive\@ cp \1 jr nc, .true\@ jr .false\@ .positive\@ cp \2 jr c, .true\@ jr .false\@ ELSE cp \1 jr c, .false\@ cp \2 jr nc, .false\@ jr .true\@ ENDC .false\@ xor a jr .end\@ .true\@ ld a, 1 and a .end\@ ENDM
tools-src/gnu/gcc/gcc/ada/exp_code.adb
enfoTek/tomato.linksys.e2000.nvram-mod
80
4863
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- E X P _ C O D E -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1996-2001 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Atree; use Atree; with Einfo; use Einfo; with Errout; use Errout; with Fname; use Fname; with Lib; use Lib; with Namet; use Namet; with Nlists; use Nlists; with Nmake; use Nmake; with Opt; use Opt; with Rtsfind; use Rtsfind; with Sem_Eval; use Sem_Eval; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; with Stringt; use Stringt; with Tbuild; use Tbuild; package body Exp_Code is ----------------------- -- Local_Subprograms -- ----------------------- function Asm_Constraint (Operand_Var : Node_Id) return Node_Id; -- Common processing for Asm_Input_Constraint and Asm_Output_Constraint. -- Obtains the constraint argument from the global operand variable -- Operand_Var, which must be non-Empty. function Asm_Operand (Operand_Var : Node_Id) return Node_Id; -- Common processing for Asm_Input_Value and Asm_Output_Variable. Obtains -- the value/variable argument from Operand_Var, the global operand -- variable. Returns Empty if no operand available. function Get_String_Node (S : Node_Id) return Node_Id; -- Given S, a static expression node of type String, returns the -- string literal node. This is needed to deal with the use of constants -- for these expressions, which is perfectly permissible. procedure Next_Asm_Operand (Operand_Var : in out Node_Id); -- Common processing for Next_Asm_Input and Next_Asm_Output, updates -- the value of the global operand variable Operand_Var appropriately. procedure Setup_Asm_IO_Args (Arg : Node_Id; Operand_Var : out Node_Id); -- Common processing for Setup_Asm_Inputs and Setup_Asm_Outputs. Arg -- is the actual parameter from the call, and Operand_Var is the global -- operand variable to be initialized to the first operand. ---------------------- -- Global Variables -- ---------------------- Current_Input_Operand : Node_Id := Empty; -- Points to current Asm_Input_Operand attribute reference. Initialized -- by Setup_Asm_Inputs, updated by Next_Asm_Input, and referenced by -- Asm_Input_Constraint and Asm_Input_Value. Current_Output_Operand : Node_Id := Empty; -- Points to current Asm_Output_Operand attribute reference. Initialized -- by Setup_Asm_Outputs, updated by Next_Asm_Output, and referenced by -- Asm_Output_Constraint and Asm_Output_Variable. -------------------- -- Asm_Constraint -- -------------------- function Asm_Constraint (Operand_Var : Node_Id) return Node_Id is begin pragma Assert (Present (Operand_Var)); return Get_String_Node (First (Expressions (Operand_Var))); end Asm_Constraint; -------------------------- -- Asm_Input_Constraint -- -------------------------- -- Note: error checking on Asm_Input attribute done in Sem_Attr function Asm_Input_Constraint return Node_Id is begin return Get_String_Node (Asm_Constraint (Current_Input_Operand)); end Asm_Input_Constraint; --------------------- -- Asm_Input_Value -- --------------------- -- Note: error checking on Asm_Input attribute done in Sem_Attr function Asm_Input_Value return Node_Id is begin return Asm_Operand (Current_Input_Operand); end Asm_Input_Value; ----------------- -- Asm_Operand -- ----------------- function Asm_Operand (Operand_Var : Node_Id) return Node_Id is begin if No (Operand_Var) then return Empty; else return Next (First (Expressions (Operand_Var))); end if; end Asm_Operand; --------------------------- -- Asm_Output_Constraint -- --------------------------- -- Note: error checking on Asm_Output attribute done in Sem_Attr function Asm_Output_Constraint return Node_Id is begin return Asm_Constraint (Current_Output_Operand); end Asm_Output_Constraint; ------------------------- -- Asm_Output_Variable -- ------------------------- -- Note: error checking on Asm_Output attribute done in Sem_Attr function Asm_Output_Variable return Node_Id is begin return Asm_Operand (Current_Output_Operand); end Asm_Output_Variable; ------------------ -- Asm_Template -- ------------------ function Asm_Template (N : Node_Id) return Node_Id is Call : constant Node_Id := Expression (Expression (N)); Temp : constant Node_Id := First_Actual (Call); begin -- Require static expression for template. We also allow a string -- literal (this is useful for Ada 83 mode where string expressions -- are never static). if Is_OK_Static_Expression (Temp) or else (Ada_83 and then Nkind (Temp) = N_String_Literal) then return Get_String_Node (Temp); else Error_Msg_N ("asm template argument is not static", Temp); return Empty; end if; end Asm_Template; ---------------------- -- Clobber_Get_Next -- ---------------------- Clobber_Node : Node_Id; -- String literal node for clobber string. Initialized by Clobber_Setup, -- and not modified by Clobber_Get_Next. Empty if clobber string was in -- error (resulting in no clobber arguments being returned). Clobber_Ptr : Nat; -- Pointer to current character of string. Initialized to 1 by the call -- to Clobber_Setup, and then updated by Clobber_Get_Next. function Clobber_Get_Next return Address is Str : constant String_Id := Strval (Clobber_Node); Len : constant Nat := String_Length (Str); C : Character; begin if No (Clobber_Node) then return Null_Address; end if; -- Skip spaces and commas before next register name loop -- Return null string if no more names if Clobber_Ptr > Len then return Null_Address; end if; C := Get_Character (Get_String_Char (Str, Clobber_Ptr)); exit when C /= ',' and then C /= ' '; Clobber_Ptr := Clobber_Ptr + 1; end loop; -- Acquire next register name Name_Len := 0; loop Name_Len := Name_Len + 1; Name_Buffer (Name_Len) := C; Clobber_Ptr := Clobber_Ptr + 1; exit when Clobber_Ptr > Len; C := Get_Character (Get_String_Char (Str, Clobber_Ptr)); exit when C = ',' or else C = ' '; end loop; Name_Buffer (Name_Len + 1) := ASCII.NUL; return Name_Buffer'Address; end Clobber_Get_Next; ------------------- -- Clobber_Setup -- ------------------- procedure Clobber_Setup (N : Node_Id) is Call : constant Node_Id := Expression (Expression (N)); Clob : constant Node_Id := Next_Actual ( Next_Actual ( Next_Actual ( First_Actual (Call)))); begin if not Is_OK_Static_Expression (Clob) then Error_Msg_N ("asm clobber argument is not static", Clob); Clobber_Node := Empty; else Clobber_Node := Get_String_Node (Clob); Clobber_Ptr := 1; end if; end Clobber_Setup; --------------------- -- Expand_Asm_Call -- --------------------- procedure Expand_Asm_Call (N : Node_Id) is Loc : constant Source_Ptr := Sloc (N); procedure Check_IO_Operand (N : Node_Id); -- Check for incorrect input or output operand procedure Check_IO_Operand (N : Node_Id) is Err : Node_Id := N; begin -- The only identifier allows is No_xxput_Operands. Since we -- know the type is right, it is sufficient to see if the -- referenced entity is in a runtime routine. if Nkind (N) = N_Identifier and then Is_Predefined_File_Name (Unit_File_Name (Get_Source_Unit (Entity (N)))) then return; -- An attribute reference is fine, again the analysis reasonably -- guarantees that the attribute must be subtype'Asm_??put. elsif Nkind (N) = N_Attribute_Reference then return; -- The only other allowed form is an array aggregate in which -- all the entries are positional and are attribute references. elsif Nkind (N) = N_Aggregate then if Present (Component_Associations (N)) then Err := First (Component_Associations (N)); elsif Present (Expressions (N)) then Err := First (Expressions (N)); while Present (Err) loop exit when Nkind (Err) /= N_Attribute_Reference; Next (Err); end loop; if No (Err) then return; end if; end if; end if; -- If we fall through, Err is pointing to the bad node Error_Msg_N ("Asm operand has wrong form", Err); end Check_IO_Operand; -- Start of processing for Expand_Asm_Call begin -- Check that the input and output operands have the right -- form, as required by the documentation of the Asm feature: -- OUTPUT_OPERAND_LIST ::= -- No_Output_Operands -- | OUTPUT_OPERAND_ATTRIBUTE -- | (OUTPUT_OPERAND_ATTRIBUTE @{,OUTPUT_OPERAND_ATTRIBUTE@}) -- OUTPUT_OPERAND_ATTRIBUTE ::= -- SUBTYPE_MARK'Asm_Output (static_string_EXPRESSION, NAME) -- INPUT_OPERAND_LIST ::= -- No_Input_Operands -- | INPUT_OPERAND_ATTRIBUTE -- | (INPUT_OPERAND_ATTRIBUTE @{,INPUT_OPERAND_ATTRIBUTE@}) -- INPUT_OPERAND_ATTRIBUTE ::= -- SUBTYPE_MARK'Asm_Input (static_string_EXPRESSION, EXPRESSION) declare Arg_Output : constant Node_Id := Next_Actual (First_Actual (N)); Arg_Input : constant Node_Id := Next_Actual (Arg_Output); begin Check_IO_Operand (Arg_Output); Check_IO_Operand (Arg_Input); end; -- If we have the function call case, we are inside a code statement, -- and the tree is already in the necessary form for gigi. if Nkind (N) = N_Function_Call then null; -- For the procedure case, we convert the call into a code statement else pragma Assert (Nkind (N) = N_Procedure_Call_Statement); -- Note: strictly we should change the procedure call to a function -- call in the qualified expression, but since we are not going to -- reanalyze (see below), and the interface subprograms in this -- package don't care, we can leave it as a procedure call. Rewrite (N, Make_Code_Statement (Loc, Expression => Make_Qualified_Expression (Loc, Subtype_Mark => New_Occurrence_Of (RTE (RE_Asm_Insn), Loc), Expression => Relocate_Node (N)))); -- There is no need to reanalyze this node, it is completely analyzed -- already, at least sufficiently for the purposes of the abstract -- procedural interface defined in this package. Set_Analyzed (N); end if; end Expand_Asm_Call; --------------------- -- Get_String_Node -- --------------------- function Get_String_Node (S : Node_Id) return Node_Id is begin if Nkind (S) = N_String_Literal then return S; else pragma Assert (Ekind (Entity (S)) = E_Constant); return Get_String_Node (Constant_Value (Entity (S))); end if; end Get_String_Node; --------------------- -- Is_Asm_Volatile -- --------------------- function Is_Asm_Volatile (N : Node_Id) return Boolean is Call : constant Node_Id := Expression (Expression (N)); Vol : constant Node_Id := Next_Actual ( Next_Actual ( Next_Actual ( Next_Actual ( First_Actual (Call))))); begin if not Is_OK_Static_Expression (Vol) then Error_Msg_N ("asm volatile argument is not static", Vol); return False; else return Is_True (Expr_Value (Vol)); end if; end Is_Asm_Volatile; -------------------- -- Next_Asm_Input -- -------------------- procedure Next_Asm_Input is begin Next_Asm_Operand (Current_Input_Operand); end Next_Asm_Input; ---------------------- -- Next_Asm_Operand -- ---------------------- procedure Next_Asm_Operand (Operand_Var : in out Node_Id) is begin pragma Assert (Present (Operand_Var)); if Nkind (Parent (Operand_Var)) = N_Aggregate then Operand_Var := Next (Operand_Var); else Operand_Var := Empty; end if; end Next_Asm_Operand; --------------------- -- Next_Asm_Output -- --------------------- procedure Next_Asm_Output is begin Next_Asm_Operand (Current_Output_Operand); end Next_Asm_Output; ---------------------- -- Setup_Asm_Inputs -- ---------------------- procedure Setup_Asm_Inputs (N : Node_Id) is Call : constant Node_Id := Expression (Expression (N)); begin Setup_Asm_IO_Args (Next_Actual (Next_Actual (First_Actual (Call))), Current_Input_Operand); end Setup_Asm_Inputs; ----------------------- -- Setup_Asm_IO_Args -- ----------------------- procedure Setup_Asm_IO_Args (Arg : Node_Id; Operand_Var : out Node_Id) is begin -- Case of single argument if Nkind (Arg) = N_Attribute_Reference then Operand_Var := Arg; -- Case of list of arguments elsif Nkind (Arg) = N_Aggregate then if Expressions (Arg) = No_List then Operand_Var := Empty; else Operand_Var := First (Expressions (Arg)); end if; -- Otherwise must be default (no operands) case else Operand_Var := Empty; end if; end Setup_Asm_IO_Args; ----------------------- -- Setup_Asm_Outputs -- ----------------------- procedure Setup_Asm_Outputs (N : Node_Id) is Call : constant Node_Id := Expression (Expression (N)); begin Setup_Asm_IO_Args (Next_Actual (First_Actual (Call)), Current_Output_Operand); end Setup_Asm_Outputs; end Exp_Code;
oeis/083/A083305.asm
neoneye/loda-programs
11
173087
; A083305: (4*(n+10)^n+n^n)/5. ; Submitted by <NAME> ; 1,9,116,1763,30784,608125,13431104,328435647,8819323904,258227642321,8194000000000,280279062767899,10285785324929024,403289664570492357,16830798499899981824,745145638470458984375,34890683668357841158144,1723120618512823480401433,89530853568169585920966656,4883004681203125254380904531,278963723600000000000000000000,16661573632116917791000612744589,1038527657282438369617578595188736,67443095707905507614197858737301423,4556269690801968361125267072157220864,319753438346370253345549106597900390625 mov $2,2 add $2,$0 add $2,8 pow $2,$0 pow $0,$0 mul $2,4 add $0,$2 div $0,5
contrib/ayacc/src/string_pkg.ads
faelys/gela-asis
4
29348
<filename>contrib/ayacc/src/string_pkg.ads -- Module : string_pkg_.ada -- Component of : common_library -- Version : 1.2 -- Date : 11/21/86 16:35:52 -- SCCS File : disk21~/rschm/hasee/sccs/common_library/sccs/sxstring_pkg_.ada -- $Source: /nosc/work/abstractions/string/RCS/string.spc,v $ -- $Revision: 209 $ -- $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ -- $Author: ron $ -- $Source: /nosc/work/abstractions/string/RCS/string.spc,v $ -- $Revision: 209 $ -- $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ -- $Author: ron $ package string_pkg is --| Overview: --| Package string_pkg exports an abstract data type, string_type. A --| string_type value is a sequence of characters. The values have arbitrary --| length. For a value, s, with length, l, the individual characters are --| numbered from 1 to l. These values are immutable; characters cannot be --| replaced or appended in a destructive fashion. --| --| In the documentation for this package, we are careful to distinguish --| between string_type objects, which are Ada objects in the usual sense, --| and string_type values, the members of this data abstraction as described --| above. A string_type value is said to be associated with, or bound to, --| a string_type object after an assignment (:=) operation. --| --| The operations provided in this package fall into three categories: --| --| 1. Constructors: These functions typically take one or more string_type --| objects as arguments. They work with the values associated with --| these objects, and return new string_type values according to --| specification. By a slight abuse of language, we will sometimes --| coerce from string_type objects to values for ease in description. --| --| 2. Heap Management: --| These operations (make_persistent, flush, mark, release) control the --| management of heap space. Because string_type values are --| allocated on the heap, and the type is not limited, it is necessary --| for a user to assume some responsibility for garbage collection. --| String_type is not limited because of the convenience of --| the assignment operation, and the usefulness of being able to --| instantiate generic units that contain private type formals. --| ** Important: To use this package properly, it is necessary to read --| the descriptions of the operations in this section. --| --| 3. Queries: These functions return information about the values --| that are associated with the argument objects. The same conventions --| for description of operations used in (1) is adopted. --| --| A note about design decisions... The decision to not make the type --| limited causes two operations to be carried over from the representation. --| These are the assignment operation, :=, and the "equality" operator, "=". --| See the discussion at the beginning of the Heap Management section for a --| discussion of :=. --| See the spec for the first of the equal functions for a discussion of "=". --| --| The following is a complete list of operations, written in the order --| in which they appear in the spec. Overloaded subprograms are followed --| by (n), where n is the number of subprograms of that name. --| --| 1. Constructors: --| Empty_String --| create --| "&" (3) --| substr --| splice --| insert (3) --| lower (2) --| upper (2) --| mixed (2) --| 2. Heap Management: --| make_persistent (2) --| flush --| mark, release --| 3. Queries: --| is_empty --| length --| value --| fetch --| equal (3) --| equivalent (3) --| "<" (3), --| "<=" (3) --| match_c --| match_not_c --| match_s (2) --| match_any (2) --| match_none (2) --| Notes: --| Programmer: <NAME> type string_type is private; bounds: exception; --| Raised on index out of bounds. any_empty: exception; --| Raised on incorrect use of match_any. illegal_alloc: exception; --| Raised by value creating operations. illegal_dealloc: exception; --| Raised by release. -- Constructors: function Empty_String return String_Type; --| Raises: Illegal_Alloc --| Effects: returns String_Pkg.Create (""); pragma Inline (Empty_String); function create(s: string) return string_type; --| Raises: illegal_alloc --| Effects: --| Return a value consisting of the sequence of characters in s. --| Sometimes useful for array or record aggregates. --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function "&"(s1, s2: string_type) return string_type; --| Raises: illegal_alloc --| Effects: --| Return the concatenation of s1 and s2. --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function "&"(s1: string_type; s2: string) return string_type; --| Raises: illegal_alloc --| Effects: --| Return the concatenation of s1 and create(s2). --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function "&"(s1: string; s2: string_type) return string_type; --| Raises: illegal_alloc --| Effects: --| Return the concatenation of create(s1) and s2. --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function substr(s: string_type; i: positive; len: natural) return string_type; --| Raises: bounds, illegal_alloc --| Effects: --| Return the substring, of specified length, that occurs in s at --| position i. If len = 0, then returns the empty value. --| Otherwise, raises bounds if either i or (i + len - 1) --| is not in 1..length(s). --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function splice(s: string_type; i: positive; len: natural) return string_type; --| Raises: bounds, illegal_alloc --| Effects: --| Let s be the string, abc, where a, b and c are substrings. If --| substr(s, i, length(b)) = b, for some i in 1..length(s), then --| splice(s, i, length(b)) = ac. --| Returns a value equal to s if len = 0. Otherwise, raises bounds if --| either i or (i + len - 1) is not in 1..length(s). --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function insert(s1, s2: string_type; i: positive) return string_type; --| Raises: bounds, illegal_alloc --| Effects: --| Return substr(s1, 1, i - 1) & s2 & --| substr(s1, i, length(s1) - i + 1). --| equal(splice(insert(s1, s2, i), i, length(s2)), s1) holds if no --| exception is raised by insert. --| Raises bounds if is_empty(s1) or else i is not in 1..length(s1). --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function insert(s1: string_type; s2: string; i: positive) return string_type; --| Raises: bounds, illegal_alloc --| Effects: --| Return substr(s1, 1, i - 1) & s2 & --| substr(s1, i, length(s1) - i + 1). --| equal(splice(insert(s1, s2, i), i, length(s2)), s1) holds if no --| exception is raised by insert. --| Raises bounds if is_empty(s1) or else i is not in 1..length(s1). --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function insert(s1: string; s2: string_type; i: positive) return string_type; --| Raises: bounds, illegal_alloc --| Effects: --| Return s1(s1'first..i - 1) & s2 & --| s1(i..length(s1) - i + 1). --| equal(splice(insert(s1, s2, i), i, length(s2)), s1) holds if no --| exception is raised by insert. --| Raises bounds if i is not in s'range. --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function lower(s: string) return string_type; --| Raises: illegal_alloc --| Effects: --| Return a value that contains exactly those characters in s with --| the exception that all upper case characters are replaced by their --| lower case counterparts. --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function lower(s: string_type) return string_type; --| Raises: illegal_alloc --| Effects: --| Return a value that is a copy of s with the exception that all --| upper case characters are replaced by their lower case counterparts. --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function upper(s: string) return string_type; --| Raises: illegal_alloc --| Effects: --| Return a value that contains exactly those characters in s with --| the exception that all lower case characters are replaced by their --| upper case counterparts. --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function upper(s: string_type) return string_type; --| Raises: illegal_alloc --| Effects: --| Return a value that is a copy of s with the exception that all --| lower case characters are replaced by their upper case counterparts. --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function Mixed (S: String) return String_Type; --| Raises: Illegal_Alloc --| Effects: --| Return a value that contains exactly those characters in s with --| the exception that all upper case characters are replaced by their --| lower case counterparts with the exception of the first character and --| each character following an underscore which are forced to upper case. --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) function Mixed (S: String_Type) return String_Type; --| Raises: Illegal_Alloc --| Effects: --| Return a value that contains exactly those characters in s with --| the exception that all upper case characters are replaced by their --| lower case counterparts with the exception of the first character and --| each character following an underscore which are forced to upper case. --| Raises illegal_alloc if string space has been improperly --| released. (See procedures mark/release.) -- Heap Management (including object/value binding): -- -- Two forms of heap management are provided. The general scheme is to "mark" -- the current state of heap usage, and to "release" in order to reclaim all -- space that has been used since the last mark. However, this alone is -- insufficient because it is frequently desirable for objects to remain -- associated with values for longer periods of time, and this may come into -- conflict with the need to clean up after a period of "string hacking." -- To deal with this problem, we introduce the notions of "persistent" and -- "nonpersistent" values. -- -- The nonpersistent values are those that are generated by the constructors -- in the previous section. These are claimed by the release procedure. -- Persistent values are generated by the two make_persistent functions -- described below. These values must be disposed of individually by means of -- the flush procedure. -- -- This allows a description of the meaning of the ":=" operation. For a -- statement of the form, s := expr, where expr is a string_type expression, -- the result is that the value denoted/created by expr becomes bound to the -- the object, s. Assignment in no way affects the persistence of the value. -- If expr happens to be an object, then the value associated with it will be -- shared. Ideally, this sharing would not be visible, since values are -- immutable. However, the sharing may be visible because of the memory -- management, as described below. Programs which depend on such sharing are -- erroneous. function make_persistent(s: string_type) return string_type; --| Effects: --| Returns a persistent value, v, containing exactly those characters in --| value(s). The value v will not be claimed by any subsequent release. --| Only an invocation of flush will claim v. After such a claiming --| invocation of flush, the use (other than :=) of any other object to --| which v was bound is erroneous, and program_error may be raised for --| such a use. function make_persistent(s: string) return string_type; --| Effects: --| Returns a persistent value, v, containing exactly those chars in s. --| The value v will not be claimed by any subsequent release. --| Only an invocation of flush will reclaim v. After such a claiming --| invocation of flush, the use (other than :=) of any other object to --| which v was bound is erroneous, and program_error may be raised for --| such a use. procedure flush(s: in out string_type); --| Effects: --| Return heap space used by the value associated with s, if any, to --| the heap. s becomes associated with the empty value. After an --| invocation of flush claims the value, v, then any use (other than :=) --| of an object to which v was bound is erroneous, and program_error --| may be raised for such a use. --| --| This operation should be used only for persistent values. The mark --| and release operations are used to deallocate space consumed by other --| values. For example, flushing a nonpersistent value implies that a --| release that tries to claim this value will be erroneous, and --| program_error may be raised for such a use. procedure mark; --| Effects: --| Marks the current state of heap usage for use by release. --| An implicit mark is performed at the beginning of program execution. procedure release; --| Raises: illegal_dealloc --| Effects: --| Releases all heap space used by nonpersistent values that have been --| allocated since the last mark. The values that are claimed include --| those bound to objects as well as those produced and discarded during --| the course of general "string hacking." If an invocation of release --| claims a value, v, then any subsequent use (other than :=) of any --| other object to which v is bound is erroneous, and program_error may --| be raised for such a use. --| --| Raises illegal_dealloc if the invocation of release does not balance --| an invocation of mark. It is permissible to match the implicit --| initial invocation of mark. However, subsequent invocations of --| constructors will raise the illegal_alloc exception until an --| additional mark is performed. (Anyway, there is no good reason to --| do this.) In any case, a number of releases matching the number of --| currently active marks is implicitly performed at the end of program --| execution. --| --| Good citizens generally perform their own marks and releases --| explicitly. Extensive string hacking without cleaning up will --| cause your program to run very slowly, since the heap manager will --| be forced to look hard for chunks of space to allocate. -- Queries: function is_empty(s: string_type) return boolean; --| Effects: --| Return true iff s is the empty sequence of characters. function length(s: string_type) return natural; --| Effects: --| Return number of characters in s. function value(s: string_type) return string; --| Effects: --| Return a string, s2, that contains the same characters that s --| contains. The properties, s2'first = 1 and s2'last = length(s), --| are satisfied. This implies that, for a given string, s3, --| value(create(s3))'first may not equal s3'first, even though --| value(create(s3)) = s3 holds. Thus, "content equality" applies --| although the string objects may be distinguished by the use of --| the array attributes. function fetch(s: string_type; i: positive) return character; --| Raises: bounds --| Effects: --| Return the ith character in s. Characters are numbered from --| 1 to length(s). Raises bounds if i not in 1..length(s). function equal(s1, s2: string_type) return boolean; --| Effects: --| Value equality relation; return true iff length(s1) = length(s2) --| and, for all i in 1..length(s1), fetch(s1, i) = fetch(s2, i). --| The "=" operation is carried over from the representation. --| It allows one to distinguish among the heap addresses of --| string_type values. Even "equal" values may not be "=", although --| s1 = s2 implies equal(s1, s2). --| There is no reason to use "=". function equal(s1: string_type; s2: string) return boolean; --| Effects: --| Return equal(s1, create(s2)). function equal(s1: string; s2: string_type) return boolean; --| Effects: --| Return equal(create(s1), s2). --|=========================================================================== --| Overview: Equivalent is the Case Insensitive version of Equal function Equivalent (Left, Right : in String_Type) return Boolean; function Equivalent (Left : in String; Right : in String_Type) return Boolean; function Equivalent (Left : in String_Type; Right : in String) return Boolean; --|=========================================================================== function "<"(s1: string_type; s2: string_type) return boolean; --| Effects: --| Lexicographic comparison; return value(s1) < value(s2). function "<"(s1: string_type; s2: string) return boolean; --| Effects: --| Lexicographic comparison; return value(s1) < s2. function "<"(s1: string; s2: string_type) return boolean; --| Effects: --| Lexicographic comparison; return s1 < value(s2). function "<="(s1: string_type; s2: string_type) return boolean; --| Effects: --| Lexicographic comparison; return value(s1) <= value(s2). function "<="(s1: string_type; s2: string) return boolean; --| Effects: --| Lexicographic comparison; return value(s1) <= s2. function "<="(s1: string; s2: string_type) return boolean; --| Effects: --| Lexicographic comparison; return s1 <= value(s2). function match_c(s: string_type; c: character; start: positive := 1) return natural; --| Raises: no_match --| Effects: --| Return the minimum index, i in start..length(s), such that --| fetch(s, i) = c. Returns 0 if no such i exists, --| including the case where is_empty(s). function match_not_c(s: string_type; c: character; start: positive := 1) return natural; --| Raises: no_match --| Effects: --| Return the minimum index, i in start..length(s), such that --| fetch(s, i) /= c. Returns 0 if no such i exists, --| including the case where is_empty(s). function match_s(s1, s2: string_type; start: positive := 1) return natural; --| Raises: no_match. --| Effects: --| Return the minimum index, i, in start..length(s1), such that, --| for all j in 1..length(s2), fetch(s2, j) = fetch(s1, i + j - 1). --| This is the position of the substring, s2, in s1. --| Returns 0 if no such i exists, including the cases --| where is_empty(s1) or is_empty(s2). --| Note that equal(substr(s1, match_s(s1, s2, i), length(s2)), s2) --| holds, providing that match_s does not raise an exception. function match_s(s1: string_type; s2: string; start: positive := 1) return natural; --| Raises: no_match. --| Effects: --| Return the minimum index, i, in start..length(s1), such that, --| for all j in s2'range, s2(j) = fetch(s1, i + j - 1). --| This is the position of the substring, s2, in s1. --| Returns 0 if no such i exists, including the cases --| where is_empty(s1) or s2 = "". --| Note that equal(substr(s1, match_s(s1, s2, i), s2'length), s2) --| holds, providing that match_s does not raise an exception. function match_any(s, any: string_type; start: positive := 1) return natural; --| Raises: no_match, any_empty --| Effects: --| Return the minimum index, i in start..length(s), such that --| fetch(s, i) = fetch(any, j), for some j in 1..length(any). --| Raises any_empty if is_empty(any). --| Otherwise, returns 0 if no such i exists, including the case --| where is_empty(s). function match_any(s: string_type; any: string; start: positive := 1) return natural; --| Raises: no_match, any_empty --| Effects: --| Return the minimum index, i, in start..length(s), such that --| fetch(s, i) = any(j), for some j in any'range. --| Raises any_empty if any = "". --| Otherwise, returns 0 if no such i exists, including the case --| where is_empty(s). function match_none(s, none: string_type; start: positive := 1) return natural; --| Raises: no_match --| Effects: --| Return the minimum index, i in start..length(s), such that --| fetch(s, i) /= fetch(none, j) for each j in 1..length(none). --| If (not is_empty(s)) and is_empty(none), then i is 1. --| Returns 0 if no such i exists, including the case --| where is_empty(s). function match_none(s: string_type; none: string; start: positive := 1) return natural; --| Raises: no_match. --| Effects: --| Return the minimum index, i in start..length(s), such that --| fetch(s, i) /= none(j) for each j in none'range. --| If not is_empty(s) and none = "", then i is 1. --| Returns 0 if no such i exists, including the case --| where is_empty(s). private type string_type is access string; --| Abstract data type, string_type, is a constant sequence of chars --| of arbitrary length. Representation type is access string. --| It is important to distinguish between an object of the rep type --| and its value; for an object, r, val(r) denotes the value. --| --| Representation Invariant: I: rep --> boolean --| I(r: rep) = (val(r) = null) or else --| (val(r).all'first = 1 & --| val(r).all'last >= 0 & --| (for all r2, val(r) = val(r2) /= null => r is r2)) --| --| Abstraction Function: A: rep --> string_type --| A(r: rep) = if r = null then --| the empty sequence --| elsif r'last = 0 then --| the empty sequence --| else --| the sequence consisting of r(1),...,r(r'last). end string_pkg;
src/main/antlr4/KuduSql.g4
gnawoal/kudu-shell
0
2522
grammar KuduSql;
testsuite/tests-parser_data-xml_reader.ads
reznikmm/increment
5
21017
<filename>testsuite/tests-parser_data-xml_reader.ads -- Copyright (c) 2015-2017 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with League.Strings; with XML.SAX.Attributes; with XML.SAX.Content_Handlers; with XML.Templates.Streams; with Tests.Commands; package Tests.Parser_Data.XML_Reader is type Reader (Data : access Provider) is limited new XML.SAX.Content_Handlers.SAX_Content_Handler with private; function Get_Commands (Self : Reader) return Tests.Commands.Command_Vectors.Vector; private type Reader (Data : access Provider) is limited new XML.SAX.Content_Handlers.SAX_Content_Handler with record Collect_Text : Boolean := False; Collect_XML : Boolean := False; Index : Positive; Text : League.Strings.Universal_String; List : League.String_Vectors.Universal_String_Vector; Commands : Tests.Commands.Command_Vectors.Vector; Vector : XML.Templates.Streams.XML_Stream_Element_Vectors.Vector; end record; overriding procedure Characters (Self : in out Reader; Text : League.Strings.Universal_String; Success : in out Boolean); overriding procedure End_Element (Self : in out Reader; Namespace_URI : League.Strings.Universal_String; Local_Name : League.Strings.Universal_String; Qualified_Name : League.Strings.Universal_String; Success : in out Boolean); overriding function Error_String (Self : Reader) return League.Strings.Universal_String; overriding procedure Start_Element (Self : in out Reader; Namespace_URI : League.Strings.Universal_String; Local_Name : League.Strings.Universal_String; Qualified_Name : League.Strings.Universal_String; Attributes : XML.SAX.Attributes.SAX_Attributes; Success : in out Boolean); end Tests.Parser_Data.XML_Reader;
Control Statements/try/on error/on error errorMessage number errorNumber.applescript
looking-for-a-job/applescript-examples
1
2360
#!/usr/bin/osascript try er on error errorMessage number errorNumber set err to errorMessage & return & "errorNumber: " & errorNumber display alert (err) end try
examples/src/examples.ads
TNO/Rejuvenation-Ada
1
15525
package Examples is end Examples;
programs/oeis/249/A249674.asm
neoneye/loda
22
100003
; A249674: a(n) = 30*n. ; 0,30,60,90,120,150,180,210,240,270,300,330,360,390,420,450,480,510,540,570,600,630,660,690,720,750,780,810,840,870,900,930,960,990,1020,1050,1080,1110,1140,1170,1200,1230,1260,1290,1320,1350,1380,1410,1440,1470,1500,1530,1560,1590,1620,1650,1680,1710,1740,1770,1800,1830,1860,1890,1920,1950,1980,2010,2040,2070,2100,2130,2160,2190,2220,2250,2280,2310,2340,2370,2400,2430,2460,2490,2520,2550,2580,2610,2640,2670,2700,2730,2760,2790,2820,2850,2880,2910,2940,2970 mul $0,30
programs/oeis/044/A044941.asm
karttu/loda
0
170542
<reponame>karttu/loda ; A044941: Number of runs of even length in base 10 representation of n. ; 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0 mod $0,11 bin $0,10 mov $1,$0
DecisionModel/src/main/antlr/DeciLan.g4
OuHangKresnik/Ninja
0
1796
/** * Define a grammar called OuhangFirst * this grammar is similar to Java while much simpler */ grammar DeciLan; /** * Package. */ packageDeclaration : 'package' Identifier (DOT Identifier)* ';' ; /** * Import model. */ importModelDeclaration : 'import-model' Identifier (DOT Identifier)* ('.*')? ';' ; /** * Import java. */ importJavaDeclaration : 'import' Identifier (DOT Identifier)* ('.*')? ';' ; /** * Inject. */ injectDeclaration : 'inject' '{' fieldStatement* '}' ; /** * Input. */ inputDeclaration : 'input' '{' fieldStatement* '}' ; fieldStatement : Identifier ':' (Identifier | TypeWithParameters) ';' ; /** * Function. */ functionDeclaration : 'func' (Identifier | TypeWithParameters) Identifier parameterList '{' statement* '}' ; /** * Signal Attributes. */ signalAttributesDeclaration : Identifier '{' variableAssignmentStatement+ '}' ; /** * Model. */ modelDeclaration : 'model' (Identifier | TypeWithParameters) Identifier '{' statement* '}' ; parameterList : '(' ((parameterDeclaration ',')* parameterDeclaration)? ')' ; parameterDeclaration : (Identifier | TypeWithParameters) Identifier ; /** * Statement. */ statement : localVariableDeclarationStatement | variableAssignmentStatement | exprCallMethod ';' | '{' statement '}' | 'if' '(' expr ')' statement ('elif' '(' expr ')' statement)? ( 'else' statement )? | returnStatement ; returnStatement : 'return' expr ';' ; localVariableDeclarationStatement : (Identifier | TypeWithParameters) Identifier ';' | (Identifier | TypeWithParameters) variableAssignmentStatement ; variableAssignmentStatement : Identifier ASSIGN expr ';' | Identifier ADD_ASSIGN expr ';' | Identifier SUB_ASSIGN expr ';' | Identifier MUL_ASSIGN expr ';' | Identifier DIV_ASSIGN expr ';' | Identifier MOD_ASSIGN expr ';' ; expr // Expression will always have a value : exprBooleanOper | exprAddSub | exprMulDivMod | exprNot | exprAtom ; exprBooleanOper : (exprAtom | exprNot | exprMulDivMod | exprAddSub) ((LT | LTE | GT | GTE | EQ | NEQ | AND | OR) (exprAtom | exprNot | exprMulDivMod | exprAddSub))+ ; exprAddSub : (exprAtom | exprNot | exprMulDivMod) ((ADD | SUB) (exprAtom | exprNot | exprMulDivMod))+ ; exprMulDivMod : (exprAtom | exprNot) ((MUL | DIV | MOD) (exprAtom | exprNot))+ ; exprNot : NOT exprAtom ; exprAtom : Identifier | NULL | NAN | literal | exprCallMethod | '(' expr ')' ; exprCallMethod : (Identifier '.')? Identifier '(' ((expr ',')* expr)?')' ; /** * Tokens, include: * identifiers, types, literals, operators, separators and esc. */ Identifier // For Variable, Model or Function name : [a-zA-Z] [a-zA-Z_0-9]* // must start with letter ; TypeWithParameters : Identifier TypeParameters ; TypeParameters // doesn't support "extends", "super", template and array [] in type : '<' (Identifier | TypeWithParameters) (',' (Identifier | TypeWithParameters))* '>' ; /** * Literals, a much more simple version than Java literals. * For numeric literals, only support decimal. * Doesn't support scientific notation currently. */ literal : StringLiteral | BooleanLiteral | IntegerLiteral | LongLiteral | FloatLiteral | DoubleLiteral ; StringLiteral //? support unicode should check : '"' StringCharacters? '"' ; CharLiteral : '\'' SingleCharacter '\'' | '\'' EscapeSequence '\'' ; BooleanLiteral : TRUE | FALSE ; IntegerLiteral : NumericSign? (NonZeroDigits+ '0'*)* Digits ; LongLiteral : IntegerLiteral 'L' ; FloatLiteral : NumericSign? (NonZeroDigits+ '0'*)* Digits '.' Digits+ 'f'? ; DoubleLiteral : NumericSign? (NonZeroDigits+ '0'*)* Digits '.' Digits+ 'd' ; fragment NumericSign : [+-] ; fragment Digits : [0-9] ; fragment NonZeroDigits : [1-9] ; fragment StringCharacters : StringCharacter+ ; fragment StringCharacter : ~["\\] ; fragment SingleCharacter : ~['\\] ; fragment EscapeSequence : '\\' [btnfr"'\\] | '\\' OctalDigit // Octal Escape | '\\' OctalDigit OctalDigit // Octal Escape | '\\' [0-3] OctalDigit OctalDigit // Octal Escape | '\\' 'u' HexDigit HexDigit HexDigit HexDigit // Unicode Escape ; fragment OctalDigit : [0-7] ; fragment HexDigit : [0-9a-fA-F] ; /** * Keywords. */ TRUE : 'true' ; FALSE : 'false'; NULL : 'null' ; NAN : 'nan' ; VOID : 'void' ; // Operators GT : '>' ; LT : '<' ; GTE : '>=' ; LTE : '<=' ; EQ : '==' ; NEQ : '!=' ; ADD : '+' ; SUB : '-' ; MUL : '*' ; DIV : '/' ; MOD : '%' ; AND : '&&' ; OR : '||' ; NOT : '!' ; COLON : ':' ; ASSIGN : '=' ; ADD_ASSIGN : '+=' ; SUB_ASSIGN : '-=' ; MUL_ASSIGN : '*=' ; DIV_ASSIGN : '/=' ; MOD_ASSIGN : '%=' ; // Separators LPAREN : '(' ; RPAREN : ')' ; LBRACE : '{' ; RBRACE : '}' ; LBRACK : '[' ; RBRACK : ']' ; SEMI : ';' ; COMMA : ',' ; DOT : '.' ; // Ignore WS : [ \t\n\r\u000c]+ -> skip; COMMENT : '/*' .*? '*/' -> skip; LINE_COMMENT : '//' ~[\r\n]* -> skip; /** * CR (Carriage Return): \r, used in Mac OS before X * LF (Line Feed): \n, used in Unix/Max OS X * CR + LF: \r\n, used in Windows */
SmmBackdoor/x64_locate.asm
L0czek/SmmBackdoor
0
245567
[bits 64] [org 0] .section .text global get_rip global OriginalEntryPoint_offset extern BackdoorMain get_rip: call _next _next: pop rax ret .section .data [align 8] OriginalEntryPoint_offset: dq 0x1234567890abcdef BackdoorEntrypoint: dq BackdoorMain
hello_world/hello_world.asm
swapravo/AA-and-me
0
81401
<filename>hello_world/hello_world.asm ; tested on 32bit Ubuntu lts 12.04 global _start ; text section of the program ; This section is supposed to have hold instructions section .text ; _start is the assembly equivalent of the main() of java or C _start: ; we'll use systemcalls to print to the screen ; unistd_32.h contains a list of systemcall numbers ; for ia32, the unistd_32.h file is at /usr/include/i386-linux-gnu/asm/ ; systemcall for printing to screen is 4 ; we'll use the write(2) wrapper over systemcall 4 ; write(2) takes a file descriptor, a buffer and the length of the buffer ; stdin is mapped to fd 0, stdout to fd 1 and stderr to fd 2 ; we raise interrupt 0x80 to invoke the systemcalls ; the eax register must contain the systemcall number ; return value of the systemcalls is generally put back into the eax register mov eax, 0x4 ; ebx has 1 to imply that we want to write to stdout mov ebx, 0x1 ; referring to the string by its label mov ecx, message ; storing the length of the string in edx mov edx, mlen ; issuing the systemcall using interrupt 0x80 int 0x80 ; we'll exit the program now ; exiting is systemcall 1 ; we'll use the _exit(2) wrapper for this ; _exit(2) takes a systemcall number and an exit status code mov eax, 0x1 mov ebx, 0x0 int 0x80 ; data section of the program ; This is supposed to hold the initialised data values section .data message: db "Hello assembly!" mlen equ $-message
boot/isoboot.asm
semahawk/kernel
0
173746
org 0x7c00 bits 16 start: jmp 0x0000:boot ; pad with zeroes so the BIT starts at byte 8 times 8-($-$$) db 0 ; BIT = Boot Information Table BIT_PrimaryVolumeDescriptor dd 0 ; LBA of the Primary Volume Descriptor BIT_BootFileLocation dd 0 ; LBA of the Boot File BIT_BootFileLength dd 0 ; length of the boot file in bytes BIT_Checksum dd 0 ; 32 bit checksum BIT_Reserved times 40 db 0 ; reserved 'for future standardization' %macro putchar 1 push ax mov ax, 0xe00+%1 int 10h pop ax %endmacro %macro error 0 putchar '!' mov ebx, __LINE__ mov ecx, __LINE__ mov edx, __LINE__ jmp $ %endmacro %include "isofs.asm" %include "a20.asm" %include "elf.asm" %include "memory.asm" boot: ; update the segment register xor ax, ax mov ds, ax cli mov ss, ax ; put the stack just below the bootsector mov sp, 0x7bff sti ; remember the device's number mov [bootdrv], dl clear_the_screen: mov ah, 0 mov al, 3 int 10h ; a dwarf putchar 0x01 ; 'enter' unreal mode go_unreal: call enter_unreal_mode ; sigma putchar 0xe4 try_enabling_a20: call enable_a20_or_die ; ae putchar 0x91 load_the_kernel: call initialize_isofs_utilities ; a half putchar 0xab mov si, kernel_path call find_and_load_file mov esi, 0x10000 mov edx, dword [esi+0x18] mov dword [kernel_entry], edx ; and beyond! putchar 0xec load_and_parse_elf: call dispatch_elf_sections ; delta putchar 0xeb call detect_memory ; alpha putchar 0xe0 load_initrd: mov si, initrd_path call find_and_load_file ; phi! putchar 0xe8 initrd_loaded: ; set the `bootinfo' field mov dword [initrd_addr], 0x10000 mov dword [initrd_size], eax bye_real_mode: ; a lovely heart putchar 0x03 enter_protected_mode: cli lgdt [gdt] mov eax, cr0 or al, 1 mov cr0, eax jmp 0x08:protected_mode bits 32 protected_mode: mov eax, 0x10 mov ds, eax mov es, eax mov fs, eax mov gs, eax mov ss, eax ; is that necessary? mov esp, 0x5c00 ; the parameter for the kernel's C function mov eax, bootinfo push eax ; farewell! mov edx, dword [kernel_entry] jmp edx hang: cli hlt ; the device's number from which we've booted bootdrv: db 0 ; name/location of the kernel kernel_path: db "/BOOT/KERNEL/KERNEL.BIN", 0 ; kernel's entry point kernel_entry: dd 0xdeadbeef ; and of the initrd initrd_path: db "/BOOT/KERNEL/INITRD.BIN", 0 ; ; the `struct bootinfo' definition ; the field order and sizes must match with those in the declaration ; of `struct bootinfo' (found in kernel/common.h) ; bootinfo: ; {{{ initrd_addr: dd 0xffffffff initrd_size: dd 0xffffffff mem_avail: dd 0x0 ; meh.. memory_map: times 24 * 16 db 0 ; max 16 entries (is it enough?) ; }}} ; ; The Global Descriptor Table ; gdt_data: ; {{{ ; the null selector dq 0x0 ; nothing! ; the code selector: base = 0x0, limit = 0xfffff dw 0xffff ; limit low (0-15) dw 0x0 ; base low (0-15) db 0x0 ; base middle (16-23) db 10011010b ; access byte db 11001111b ; flags + limit (16-19) db 0x0 ; base high (24-31) ; the data selector: base = 0x0, limit = 0xfffff dw 0xffff ; limit low (0-15) dw 0x0 ; base low (0-15) db 0x0 ; base middle (16-23) db 10010010b ; access byte db 11001111b ; flags + limit (16-19) db 0x0 ; base high (24-31) ; THE actual descriptor gdt_end: gdt: dw gdt_end - gdt_data - 1 ; sizeof gdt dd gdt_data ; }}} ; padding so the bootsector is exactly 2048 bytes long times 2048-($-$$) db 0 ; vi: ft=nasm:ts=2:sw=2 expandtab
testc/keyboard/keyio.asm
krismuad/TOWNSEMU
124
84369
<reponame>krismuad/TOWNSEMU ASSUME CS:CODE PUBLIC CLEAR_IF PUBLIC SET_IF PUBLIC RESETKEYBIOS PUBLIC A0A1 PUBLIC A1A1 PUBLIC A1 PUBLIC A0 PUBLIC A1TODATA PUBLIC A2TODATA CODE SEGMENT CLEAR_IF PROC CLI RET CLEAR_IF ENDP SET_IF PROC STI RET SET_IF ENDP RESETKEYBIOS PROC XOR AH,AH INT 90H RET RESETKEYBIOS ENDP A0A1 PROC PUSH EBP MOV EBP,ESP PUSH ECX PUSH EBX PUSH EDX PUSH EDI CLI MOV DX,0602H MOV AL,0A0H OUT DX,AL CALL DELAY MOV AL,0A1H OUT DX,AL MOV EDI,[EBP+8] CALL READ STI POP EDI POP EDX POP EBX POP ECX POP EBP RET A0A1 ENDP A1A1 PROC PUSH EBP MOV EBP,ESP PUSH ECX PUSH EBX PUSH EDX PUSH EDI CLI MOV DX,0602H MOV AL,0A1H OUT DX,AL CALL DELAY MOV AL,0A1H OUT DX,AL MOV EDI,[EBP+8] CALL READ STI POP EDI POP EDX POP EBX POP ECX POP EBP RET A1A1 ENDP A1 PROC PUSH EBP MOV EBP,ESP PUSH ECX PUSH EBX PUSH EDX PUSH EDI CLI MOV DX,0602H MOV AL,0A1H OUT DX,AL MOV EDI,[EBP+8] CALL READ STI POP EDI POP EDX POP EBX POP ECX POP EBP RET A1 ENDP A0 PROC PUSH EBP MOV EBP,ESP PUSH ECX PUSH EBX PUSH EDX PUSH EDI CLI MOV DX,0602H MOV AL,0A0H OUT DX,AL MOV EDI,[EBP+8] CALL READ STI POP EDI POP EDX POP EBX POP ECX POP EBP RET A0 ENDP A1TODATA PROC PUSH EBP MOV EBP,ESP PUSH ECX PUSH EBX PUSH EDX PUSH EDI CLI MOV DX,0600H MOV AL,0A1H OUT DX,AL MOV EDI,[EBP+8] CALL READ STI POP EDI POP EDX POP EBX POP ECX POP EBP RET A1TODATA ENDP A2TODATA PROC PUSH EBP MOV EBP,ESP PUSH ECX PUSH EBX PUSH EDX PUSH EDI CLI MOV DX,0600H MOV AL,0A2H OUT DX,AL MOV EDI,[EBP+8] CALL READ STI POP EDI POP EDX POP EBX POP ECX POP EBP RET A2TODATA ENDP DELAY PROC PUSH ECX MOV ECX,10000 DELAY_LOOP: LOOP DELAY_LOOP POP ECX RET DELAY ENDP DELAY_WAIT_CODE PROC PUSH ECX MOV ECX,10000 DELAY_LOOP2: MOV DX,0602H IN AL,DX AND AL,1 JNE DELAY_LOOP2_BREAK LOOP DELAY_LOOP2 DELAY_LOOP2_BREAK: POP ECX RET DELAY_WAIT_CODE ENDP READ PROC XOR EBX,EBX MOV ECX,40*10000 READ_LOOP: MOV DX,0602H IN AL,DX AND AL,1 JE READ_LOOP_NEXT MOV DX,0600H IN AL,DX MOV BYTE PTR [EDI+EBX],AL ADD EBX,1 CMP EBX,40 JGE READ_LOOP_BREAK READ_LOOP_NEXT: LOOP READ_LOOP READ_LOOP_BREAK: MOV EAX,EBX RET READ ENDP CODE ENDS END