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
hopesup/src/main.asm
gb-archive/libbet
28
25807
.include "src/sms.inc" .asciitable map " " to "~" = $20 .enda .def STACK_SIZE 60 .export STACK_SIZE .ramsection "StackAndSAT" bank 0 slot WRAM0 align 256 stack_top ds STACK_SIZE sat_unused1 db sat_unused2 db sat_unused3 db sat_used db ; SAT fill level: $40 minimum, $80 maximum sat_y ds NUM_SPRITES sat_xn ds NUM_SPRITES*2 .ends .ramsection "MainWRAM" bank 0 slot WRAM0 ; This variable actually counts IRQs, not NMIs. But it's called ; "nmis" for consistency with my project templates on two other ; consoles that use NMI for vertical blank. nmis db pause_pressed db debughex0 db debughex1 db cur_score db max_score db cur_combo db .ends .bank 0 slot 0 ; Fixed entry points: reset, RST $38 (IRQ), and NMI (pause) ; IRQ handler in SMS has a fixed address $0038, shared by the vblank, ; hblank, and vcount interrupts (like STAT on Game Boy). This means ; a handler may have to distinguish them otherwise. It also means ; that unfortunately, we can't use RST $38 for an error handler for ; execution falling into padding the way ISSOtm's Game Boy code does. .org $0038 .section "irqhandler" force push af in a, (VDPSTATUS) ld a, (nmis) inc a ld (nmis), a pop af ei reti .ends .org $0066 .section "pausehandler" force ; Set a flag to cause the controller handler to read Start on ; controller 1 briefly push af ld a, 5 ld [pause_pressed], a pop af retn .ends ; Main program ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .section "main" free main: .if 1==0 ; Sprites use the second half of CRAM, at C010-C01F on SMS ; or C000-C01F on GG. vdp_seek $C010 ld hl,ObjPaletteData ld bc,(ObjPaletteDataEnd-ObjPaletteData)*256+VDPDATA otir .endif di call vdp_clear_sat call draw_bg ei ; Turn screen on ld a,MODEF_ON|MODEF_VIRQ out (VDPCTRL),a ld a,VDPMODE out (VDPCTRL),a xor a ld (nmis), a ; Game logic forever: ; Read controller 1 and move the sprite call read_pads ; Draw sprites ld hl, sat_used ld [hl], $40 call wait_vblank_irq call vdp_push_sat ld a, [new_keys] ;bit 7, a ;jr nz, main bit 4, a jr z, forever jr forever draw_bg: ; disable display while loading in a, (VDPSTATUS) xor a out (VDPCTRL),a ld a,VDPMODE out (VDPCTRL),a ; Load background palette data into the first half of CRAM, ; at VDP addresses C000-C00F on SMS or C000-C01F on GG. vdp_seek $C000 ld hl,PaletteData ld bc,(PaletteDataEnd-PaletteData)*256+VDPDATA otir ; Clear the pattern table vdp_seek_tile 0 ld a, $55 ld d, 40/8 call vmemset_256d ; Clear nametable and SAT call vdp_clear_nt ; load vwfcanvas vdp_seek_xy 8, 11 ld c, 16 ld b, c @loop: ld a, c inc c out [VDPDATA], a xor a out [VDPDATA], a djnz @loop call vwfClearBuf ld hl, hello_msg ld b, 4 call vwfPuts vdp_seek_tile 16 ld hl, lineImgBuf ld d, 1 call load_1bpp_font call load_status_chr call init_status_bar ; call draw_debughex ret PaletteData: drgb $000000,$555555,$AAAAAA,$FFFFFF PaletteDataEnd: hello_msg: .db "Nothing to see; move along", 0 .ends
.emacs.d/elpa/ada-mode-5.3.1/debug_gps_indent.adb
caqg/linux-home
0
2516
<filename>.emacs.d/elpa/ada-mode-5.3.1/debug_gps_indent.adb -- Abstract : -- -- call the GPS indentation engine with debug text -- -- Copyright (C) 2017 All Rights Reserved. -- -- This program is free software; you can redistribute it and/or -- modify it under terms of the GNU General Public License as -- published by the Free Software Foundation; either version 3, or (at -- your option) any later version. This program 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 General Public License for more details. You -- should have received a copy of the GNU General Public License -- distributed with this program; see file COPYING. If not, write to -- the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, -- MA 02110-1335, USA. pragma License (GPL); with Ada.Text_IO; use Ada.Text_IO; with Ada_Analyzer; with Case_Handling; with GNATCOLL.Symbols; with Language; procedure Debug_GPS_Indent is NL : constant Character := ASCII.LF; Buffer : constant String := "procedure Bug_002 is begin" & NL & "Error_Report.Report_Error (Severity =>" & NL & "Error_Report.Severe," & NL & "Description => ""In theory the counterp_process..., "" &" & NL & """as they should not differ but they do... """ & NL & "& ""the indexes, so that we do not crash....""," & NL & "Title => ""Curtain indexes should not differ but they do.""," & NL & "Caller_Scope => ""Curtain_Indexes_May_Differ"");" & NL & "end Bug_002;"; procedure Replace_Cb (Line : in Natural; First : in Natural; Last : in Natural; Replace : in String) is pragma Unreferenced (Last); begin -- Provide a place to put a debugger break when an indentation is computed. -- analyze calls replace_cb for ":", ":=" etc. We only -- want the leading spaces, for indentation. if Replace'Length > 0 and First = 1 then Put_Line (Natural'Image (Line) & Natural'Image (Replace'Length)); end if; end Replace_Cb; begin Ada_Analyzer.Analyze_Ada_Source (Buffer, GNATCOLL.Symbols.Allocate, Indent_Params => (Indent_Level => 3, Indent_Continue => 2, Indent_Decl => 2, -- no ada-mode equivalent Indent_Conditional => 1, -- no ada-mode equivalent Indent_Record => 3, Indent_Case_Extra => Language.Non_RM_Style, Casing_Policy => Case_Handling.Disabled, Reserved_Casing => Case_Handling.Unchanged, Ident_Casing => Case_Handling.Unchanged, Format_Operators => False, Use_Tabs => False, Align_On_Colons => False, Align_On_Arrows => False, Align_Decl_On_Colon => False, Indent_Comments => True, Stick_Comments => False), -- no ada-mode equivalent. From => 1, To => 7, Replace => Replace_Cb'Unrestricted_Access); end Debug_GPS_Indent;
assembler/tests/t_scmp/t_scmp.asm
paulscottrobson/RCA-Cosmac-VIP-III
1
166408
cpu sc/mp lde xae ane ore xre dae ade cae sio sr srl rr rrl halt ccl scl dint ien csa cas nop ldi 0x12 ani 0x23 ori 0x34 xri 0x45 dai 0x56 adi 0x67 cai 0x78 dly 0x89 xpal pc xpah p2 xppc p1 ld e(pc) st @e(p2) and 10(p1) or @-20(p3) xor vari vari: dad -30(p2) add @40(p1) cad vari jmp vari jp 10(p2) jz vari jnz vari ild vari dld -5(p2) ; org 0xfff ; ldi 0x20
src/day-11/adventofcode-day_11.ads
persan/advent-of-code-2020
0
13506
<reponame>persan/advent-of-code-2020 package Adventofcode.Day_11 is end Adventofcode.Day_11;
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1130.asm
ljhsiun2/medusa
9
90038
<filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_1130.asm<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r10 push %r15 push %r9 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_WC_ht+0x1e1cd, %rsi lea addresses_WC_ht+0xe78f, %rdi nop nop nop nop sub $45953, %rax mov $83, %rcx rep movsb nop and %rbp, %rbp lea addresses_WT_ht+0x158d7, %r10 nop nop add $326, %r15 movb (%r10), %cl nop nop and %r15, %r15 lea addresses_normal_ht+0x11097, %r15 nop lfence movb $0x61, (%r15) nop nop nop nop cmp $10306, %rcx lea addresses_UC_ht+0x9167, %r10 nop sub %rcx, %rcx movups (%r10), %xmm5 vpextrq $0, %xmm5, %rbp nop nop nop dec %rbp lea addresses_WT_ht+0x17d97, %rsi lea addresses_A_ht+0xe797, %rdi clflush (%rsi) nop nop nop nop nop and $20362, %r10 mov $65, %rcx rep movsb xor $58585, %rbp lea addresses_UC_ht+0x3457, %rdi nop nop nop cmp $173, %rsi vmovups (%rdi), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $0, %xmm4, %rax nop nop nop nop sub $845, %r15 lea addresses_D_ht+0x19597, %rdi nop nop nop sub $49794, %rax and $0xffffffffffffffc0, %rdi vmovaps (%rdi), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $1, %xmm2, %rsi nop nop nop nop nop add $35359, %rcx lea addresses_D_ht+0x6dbf, %rsi lea addresses_UC_ht+0x1db97, %rdi nop sub $48715, %r9 mov $22, %rcx rep movsq nop nop nop nop nop and $4012, %rdi lea addresses_D_ht+0x60ce, %rsi nop sub %r9, %r9 movb $0x61, (%rsi) nop nop nop dec %r9 lea addresses_WT_ht+0x1e597, %rcx nop add %r9, %r9 mov $0x6162636465666768, %rbp movq %rbp, (%rcx) nop nop nop and %r10, %r10 lea addresses_D_ht+0xe997, %r9 nop nop nop xor $4695, %r10 mov $0x6162636465666768, %rdi movq %rdi, %xmm2 vmovups %ymm2, (%r9) nop add %r9, %r9 pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r9 pop %r15 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %rbx push %rdi push %rdx // Faulty Load lea addresses_A+0xc997, %r13 nop nop nop xor %rdi, %rdi mov (%r13), %dx lea oracles, %rdi and $0xff, %rdx shlq $12, %rdx mov (%rdi,%rdx,1), %rdx pop %rdx pop %rdi pop %rbx pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_A'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1, 'same': True, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'35': 21829} 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 */
soundness/STT.agda
frelindb/agsyHOL
17
12671
<filename>soundness/STT.agda module STT where -- simple type theory {- open import Data.Bool open import Relation.Binary.PropositionalEquality open import Data.Nat hiding (_>_) -} open import StdLibStuff open import Syntax -- inference system data ⊢_ : ∀ {n} → {Γ : Ctx n} → Form Γ $o → Set where ax-1 : ∀ {n} → {Γ : Ctx n} {x : Var Γ} → (p : lookup-Var Γ x ≡ $o) → ⊢ ((var x p || var x p) => var x p) ax-2 : ∀ {n} → {Γ : Ctx n} {x y : Var Γ} → (px : lookup-Var Γ x ≡ $o) → (py : lookup-Var Γ y ≡ $o) → ⊢ (var x px => (var x px || var y py)) ax-3 : ∀ {n} → {Γ : Ctx n} {x y : Var Γ} → (px : lookup-Var Γ x ≡ $o) → (py : lookup-Var Γ y ≡ $o) → ⊢ ((var x px || var y py) => (var y py || var x px)) ax-4 : ∀ {n} → {Γ : Ctx n} {x y z : Var Γ} → (px : lookup-Var Γ x ≡ $o) → (py : lookup-Var Γ y ≡ $o) → (pz : lookup-Var Γ z ≡ $o) → ⊢ ((var x px => var y py) => ((var z pz || var x px) => (var z pz || var y py))) ax-5 : ∀ {n} → {Γ : Ctx n} {α : Type n} {x y : Var Γ} → (px : lookup-Var Γ x ≡ α > $o) → (py : lookup-Var Γ y ≡ α) → ⊢ (app Π (var x px) => app (var x px) (var y py)) ax-6 : ∀ {n} → {Γ : Ctx n} {α : Type n} {x y : Var Γ} → (px : lookup-Var Γ x ≡ α > $o) → (py : lookup-Var Γ y ≡ $o) → ⊢ ((![ α ] (weak (var y py) || app (weak (var x px)) (var this refl))) => (var y py || app Π (var x px))) ax-10-a : ∀ {n} → {Γ : Ctx n} {x y : Var Γ} → (px : lookup-Var Γ x ≡ $o) → (py : lookup-Var Γ y ≡ $o) → ⊢ ((var x px <=> var y py) => (var x px == var y py)) ax-10-b : ∀ {n} → {Γ : Ctx n} {α β : Type n} {f g : Var Γ} → (pf : lookup-Var Γ f ≡ α > β) → (pg : lookup-Var Γ g ≡ α > β) → ⊢ ((![ α ] (app (weak (var f pf)) (var this refl) == app (weak (var g pg)) (var this refl))) => (var f pf == var g pg)) ax-11 : ∀ {n} → {Γ : Ctx n} {α : Type n} {f : Var Γ} → (pf : lookup-Var Γ f ≡ α > $o) → ⊢ ((?[ α ] (app (weak (var f pf)) (var this refl))) => (app (var f pf) (app i (var f pf)))) -- inf-I in Henkin is α-conversion -- with de Bruijn-indeces we need context extension instead extend-context : ∀ {n} {Γ : Ctx n} (α : Type n) {F : Form Γ $o} → ⊢_ {_} {α ∷ Γ} (weak F) → ⊢ F inf-II : ∀ {n} → (Γ Γ' : Ctx n) {α β : Type n} (F : Form (Γ' ++ Γ) β → Form Γ $o) (G : Form (α ∷ (Γ' ++ Γ)) β) (H : Form (Γ' ++ Γ) α) → ⊢ (F ((^[ α ] G) · H) => F (sub H G)) -- formulated as an inference rule in Henkin, as an axiom (containing expressions) here inf-III : ∀ {n} → (Γ Γ' : Ctx n) {α β : Type n} (F : Form (Γ' ++ Γ) β → Form Γ $o) (G : Form (α ∷ (Γ' ++ Γ)) β) (H : Form (Γ' ++ Γ) α) → ⊢ (F (sub H G) => F ((^[ α ] G) · H)) -- formulated as an inference rule in Henkin, as an axiom (containing expressions) here inf-IV : ∀ {n} → {Γ : Ctx n} {α : Type n} (F : Form Γ (α > $o)) (x : Var Γ) (G : Form Γ α) → occurs x F ≡ false → (p : lookup-Var Γ x ≡ α) → ⊢ (app F (var x p)) → ⊢ (app F G) inf-V : ∀ {n} → {Γ : Ctx n} {F G : Form Γ $o} → ⊢ (F => G) → ⊢ F → ⊢ G inf-VI : ∀ {n} → {Γ : Ctx n} {α : Type n} {F : Form Γ (α > $o)} (x : Var Γ) → occurs x F ≡ false → (p : lookup-Var Γ x ≡ α) → ⊢ (app F (var x p) => app Π F) -- formulated as an inference rule in Henkin, as an axiom (containing expressions) here -- ------------------------- -- Variants of the axioms that are simpler to work with ax-1-s : ∀ {n} → {Γ : Ctx n} {F : Form Γ $o} → ⊢ ((F || F) => F) ax-2-s : ∀ {n} → {Γ : Ctx n} {F G : Form Γ $o} → ⊢ (F => (F || G)) ax-3-s : ∀ {n} → {Γ : Ctx n} {F G : Form Γ $o} → ⊢ ((F || G) => (G || F)) ax-4-s : ∀ {n} → {Γ : Ctx n} {F G H : Form Γ $o} → ⊢ ((F => G) => ((H || F) => (H || G))) ax-5-s : ∀ {n} → {Γ : Ctx n} {α : Type n} (F : Form (α ∷ Γ) $o) (G : Form Γ α) → ⊢ (![ α ] F => sub G F) ax-5-s2 : ∀ {n} → {Γ : Ctx n} {α : Type n} (F : Form Γ (α > $o)) (G : Form Γ α) → ⊢ ((![ α ] (~ (weak F · $ this {refl}))) => (~ (F · G))) ax-5-s3 : ∀ {n} → {Γ : Ctx n} {α : Type n} (F : Form Γ (α > $o)) (G : Form Γ α) → ⊢ ((!'[ α ] F) => (F · G)) ax-6-s : ∀ {n} → {Γ : Ctx n} {α : Type n} {F : Form Γ $o} {G : Form (α ∷ Γ) $o} → ⊢ ((![ α ] (weak F || G)) => (F || (![ α ] G))) ax-10-a-s : ∀ {n} → {Γ : Ctx n} {F G : Form Γ $o} → ⊢ ((F <=> G) => (F == G)) ax-10-b-s : ∀ {n} → {Γ : Ctx n} {α β : Type n} {F G : Form (α ∷ Γ) β} → ⊢ ((![ α ] (F == G)) => (^[ α ] F == ^[ α ] G)) ax-10-b-s2 : ∀ {n} → {Γ : Ctx n} {α β : Type n} {F G : Form Γ (α > β)} → ⊢ ((![ α ] (app (weak F) (var this refl) == app (weak G) (var this refl))) => (F == G)) ax-11-s : ∀ {n} → {Γ : Ctx n} {α : Type n} {F : Form (α ∷ Γ) $o} → ⊢ ((?[ α ] F => sub (ι α F) F)) ax-11-s2 : ∀ {n} → {Γ : Ctx n} {α : Type n} (F : Form Γ (α > $o)) → ⊢ ((?'[ α ] F) => (F · ι' α F)) inf-II-samectx : ∀ {n} → {Γ : Ctx n} {α β : Type n} (F : Form Γ β → Form Γ $o) (G : Form (α ∷ Γ) β) (H : Form Γ α) → ⊢ (F ((^[ α ] G) · H) => F (sub H G)) inf-II-samectx {_} {Γ} = inf-II Γ ε inf-III-samectx : ∀ {n} → {Γ : Ctx n} {α β : Type n} (F : Form Γ β → Form Γ $o) (G : Form (α ∷ Γ) β) (H : Form Γ α) → ⊢ (F (sub H G) => F ((^[ α ] G) · H)) inf-III-samectx {_} {Γ} = inf-III Γ ε inf-VI-s : ∀ {n} → {Γ : Ctx n} {α : Type n} {F : Form (α ∷ Γ) $o} → ⊢ F → ⊢ ![ α ] F -- ------------------------- ax-5-s F G = inf-V (inf-II-samectx (λ z → (![ _ ] F) => z) F G) (subst (λ z → ⊢ ((![ _ ] F) => ((^[ _ ] F) · z))) (sym (sub-weak-p-1' G (^[ _ ] F))) (inf-V (inf-II-samectx (λ z → z) (app Π (var this refl) => app (var this refl) (weak G)) (^[ _ ] F)) (extend-context (_ > $o) (inf-IV _ this _ (occurs-p-2 (lam _ (weak G))) refl (inf-V (inf-III-samectx (λ z → z) (app Π (var this refl) => app (var this refl) (weak-i (_ ∷ ε) _ (weak G))) (var this refl)) (extend-context _ (inf-V (inf-II-samectx (λ z → z) (app Π (var (next (next this)) refl) => app (var (next (next this)) refl) (var this refl)) _) (inf-IV _ this _ refl refl (inf-V (inf-III-samectx (λ z → z) _ _) (ax-5 {_} {_} {_} {next this} {this} refl refl)))))))))) inf-VI-s {_} {Γ} {α} {F} = λ h → extend-context α (inf-V (inf-VI this (occurs-p-2 (lam α F)) refl) (inf-V (inf-III-samectx (λ z → z) (weak-i (α ∷ ε) Γ F) (var this refl)) (subst (λ z → ⊢ z) (sym (sub-sub-weak-weak-p-3 F)) h))) ax-6-s {_} {Γ} {α} {F} {G} = subst (λ z → ⊢ ((![ α ] (weak F || z)) => (F || ![ α ] G))) (sub-sub-weak-weak-p F G) (inf-V (inf-II Γ (α ∷ ε) (λ z → ((![ α ] (weak F || z)) => (F || app Π (lam α G)))) (sub-i (α ∷ (α ∷ ε)) Γ F (weak-i (α ∷ ε) ($o ∷ Γ) (weak-i (α ∷ ε) Γ G))) (var this refl)) (subst (λ z → ⊢ ((![ α ] (weak F || app (sub-i (α ∷ ε) Γ F (weak (weak (lam α G)))) (var this refl))) => (F || app Π z))) (sym (sub-weak-p-1' (lam α G) F)) (inf-V (ax-5-s _ F) (inf-VI-s (inf-V (ax-5-s _ (weak (lam α G))) (inf-VI-s (ax-6 {_} {_} {α} {this} {next this} refl refl))))))) ax-10-b-s {_} {Γ} {α} {β} {F} {G} = subst (λ z → ⊢ ((![ α ] (F == z) => (lam α F == lam α G)))) (sub-sub-weak-weak-p-3 G) ( inf-V (inf-II Γ (α ∷ ε) (λ z → ((![ α ] (F == z)) => (lam α F == lam α G))) (weak-i (α ∷ ε) Γ G) (var this refl)) ( subst (λ z → ⊢ ((![ α ] (z == app (weak (lam α G)) (var this refl))) => (lam α F == lam α G))) (sub-sub-weak-weak-p-2 F G) ( inf-V (inf-II Γ (α ∷ ε) (λ z → (((![ α ] (z == app (weak (lam α G)) (var this refl)) => (lam α F == lam α G))))) (sub-i (α ∷ (α ∷ ε)) Γ (lam α G) (weak-i (α ∷ ε) ((α > β) ∷ Γ) (weak-i (α ∷ ε) Γ F))) (var this refl)) ( subst (λ z → ⊢ (((![ α ] (app (sub-i (α ∷ ε) Γ (lam α G) (weak (weak (lam α F)))) (var this refl) == app (weak (lam α G)) (var this refl)) => (z == lam α G))))) (sym (sub-weak-p-1' (lam α F) (lam α G))) (inf-V (ax-5-s _ (lam α G)) (inf-VI-s (inf-V (ax-5-s _ (weak (lam α F))) (inf-VI-s (ax-10-b {_} {_} {α} {β} {this} {next this} refl refl))))))))) ax-10-b-s2 {_} {Γ} {α} {β} {F} {G} = subst (λ z → (⊢ ((![ α ] (app (weak F) (var this refl) == app (weak G) (var this refl))) => (F == z)))) (sym (sub-weak-p-1' G F)) ( subst (λ z → (⊢ ((![ α ] (app (weak F) (var this refl) == app z (var this refl))) => (F == sub F (weak G))))) (sym (sub-weak-p-1 G F)) ( inf-V (ax-5-s ((![ α ] (app (weak (var this refl)) (var this refl) == app (weak (weak G)) (var this refl))) => (var this refl == weak G)) F) ( inf-VI-s ( inf-V (ax-5-s ((![ α ] (app (weak (var (next this) refl)) (var this refl) == app (weak (var this refl)) (var this refl))) => (var (next this) refl == var this refl)) (weak G)) ( inf-VI-s ( ax-10-b refl refl)))))) ax-11-s {_} {Γ} {α} {F} = subst (λ z → ⊢ ((?[ α ] z) => sub (app i (lam α F)) F)) (sub-sub-weak-weak-p-3 F) ( inf-V (inf-II Γ (α ∷ ε) (λ z → ((?[ α ] z) => sub (app i (lam α F)) F)) (weak-i (α ∷ ε) Γ F) (var this refl)) ( inf-V (inf-II Γ ε (λ z → ((?[ α ] app (weak (lam α F)) (var this refl)) => z)) F (app i (lam α F))) ( inf-V (ax-5-s _ (lam α F)) (inf-VI-s (ax-11 {_} {_} {α} {this} refl))))) ax-1-s {_} {_} {F} = inf-V (ax-5-s ((var this refl || var this refl) => var this refl) F) (inf-VI-s (ax-1 refl)) ax-2-s {_} {_} {F} {G} = subst (λ z → ⊢ (F => (F || z))) (sym (sub-weak-p-1' G F)) (inf-V (ax-5-s (var this refl => (var this refl || weak G)) F) (inf-VI-s (inf-V (ax-5-s (var (next this) refl => (var (next this) refl || var this refl)) (weak G)) (inf-VI-s (ax-2 refl refl))))) ax-3-s {_} {_} {F} {G} = subst (λ z → ⊢ ((F || z) => (z || F))) (sym (sub-weak-p-1' G F)) (inf-V (ax-5-s _ F) (inf-VI-s (inf-V (ax-5-s _ (weak G)) (inf-VI-s (ax-3 {_} {_} {next this} {this} refl refl))))) ax-4-s {_} {_} {F} {G} {H} = subst (λ z → ⊢ ((F => G) => ((z || F) => (z || G)))) (sym (sub-weak-p-1' H F)) (subst (λ z → ⊢ ((F => z) => ((sub F (weak H) || F) => (sub F (weak H) || z)))) (sym (sub-weak-p-1' G F)) (subst (λ z → ⊢ ((F => sub F (weak G)) => ((sub F z || F) => (sub F z || sub F (weak G))))) (sym (sub-weak-p-1' (weak H) (weak G))) (inf-V (ax-5-s _ F) (inf-VI-s (inf-V (ax-5-s _ (weak G)) (inf-VI-s (inf-V (ax-5-s _ (weak (weak H))) (inf-VI-s (ax-4 {_} {_} {next (next this)} {next this} {this} refl refl refl))))))))) ax-10-a-s {_} {_} {F} {G} = subst (λ z → ⊢ ((F <=> z) => (F == z))) (sym (sub-weak-p-1' G F)) (inf-V (ax-5-s _ F) (inf-VI-s (inf-V (ax-5-s _ (weak G)) (inf-VI-s (ax-10-a {_} {_} {next this} {this} refl refl))))) ax-5-s2 = λ F G → subst (λ z → ⊢ ((![ _ ] ~ (weak F · $ this {refl})) => ~ (z · G))) (sym (sub-weak-p-1' F G)) (ax-5-s (~ (weak F · $ this {refl})) G) ax-5-s3 = λ F G → subst (λ z → ⊢ ((!'[ _ ] F) => (F · z))) (sym (sub-weak-p-1' G F)) ( inf-V (ax-5-s ((!'[ _ ] ($ this {refl})) => (($ this {refl}) · weak G)) F) ( inf-VI-s ( inf-V (ax-5-s ((!'[ _ ] ($ (next this) {refl})) => (($ (next this) {refl}) · ($ this {refl}))) (weak G)) ( inf-VI-s ( ax-5 {_} {_} {_} {next this} {this} refl refl))))) ax-11-s2 F = inf-V (ax-5-s ((?'[ _ ] ($ this {refl})) => (($ this {refl}) · ι' _ ($ this {refl}))) F) ( inf-VI-s ( ax-11 refl)) -- ---------------------------------- mutual hn-form : ∀ {n} → {Γ : Ctx n} {β : Type n} (F : Form Γ β → Form Γ $o) (G : Form Γ β) (m : ℕ) → ⊢ F (headNorm m G) → ⊢ F G hn-form F (app G H) m p = hn-form' F G H m (hn-form (λ z → F (headNorm' m z H)) G m p) hn-form F (var _ _) m p = p hn-form F N m p = p hn-form F A m p = p hn-form F Π m p = p hn-form F i m p = p hn-form F (lam _ _) m p = p hn-form' : ∀ {n} → {Γ : Ctx n} {α β : Type n} (F : Form Γ β → Form Γ $o) (G : Form Γ (α > β)) (H : Form Γ α) (m : ℕ) → ⊢ F (headNorm' m G H) → ⊢ F (app G H) hn-form' F (lam α G) H (suc m) p = inf-V (inf-III-samectx F G H) (hn-form F (sub H G) m p) hn-form' F (lam α G) H 0 p = p hn-form' F (var _ _) H zero p = p hn-form' F (var _ _) H (suc _) p = p hn-form' F N H zero p = p hn-form' F N H (suc _) p = p hn-form' F A H zero p = p hn-form' F A H (suc _) p = p hn-form' F Π H zero p = p hn-form' F Π H (suc _) p = p hn-form' F i H zero p = p hn-form' F i H (suc _) p = p hn-form' F (app _ _) H zero p = p hn-form' F (app _ _) H (suc _) p = p
Cubical/Algebra/Polynomials/Multivariate/EquivCarac/An[Am[X]]-Anm[X].agda
guilhermehas/cubical
1
9134
<filename>Cubical/Algebra/Polynomials/Multivariate/EquivCarac/An[Am[X]]-Anm[X].agda {-# OPTIONS --safe --experimental-lossy-unification #-} module Cubical.Algebra.Polynomials.Multivariate.EquivCarac.An[Am[X]]-Anm[X] where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Isomorphism open import Cubical.Data.Nat renaming (_+_ to _+n_; _·_ to _·n_) open import Cubical.Data.Vec open import Cubical.Data.Vec.OperationsNat open import Cubical.Data.Sigma open import Cubical.Algebra.Ring open import Cubical.Algebra.CommRing open import Cubical.Algebra.Polynomials.Univariate.Base open import Cubical.Algebra.Polynomials.Multivariate.Base open import Cubical.Algebra.Polynomials.Multivariate.Properties open import Cubical.Algebra.CommRing.Instances.MultivariatePoly private variable ℓ ℓ' : Level module Comp-Poly-nm (A' : CommRing ℓ) (n m : ℕ) where private A = fst A' open CommRingStr (snd A') module Mr = Nth-Poly-structure A' m module N+Mr = Nth-Poly-structure A' (n +n m) module N∘Mr = Nth-Poly-structure (PolyCommRing A' m) n ----------------------------------------------------------------------------- -- direct sens N∘M→N+M-b : (v : Vec ℕ n) → Poly A' m → Poly A' (n +n m) N∘M→N+M-b v = Poly-Rec-Set.f A' m (Poly A' (n +n m)) trunc 0P (λ v' a → base (v ++ v') a) _poly+_ poly+Assoc poly+IdR poly+Comm (λ v' → base-0P (v ++ v')) (λ v' a b → base-poly+ (v ++ v') a b) N∘M→N+M : Poly (PolyCommRing A' m) n → Poly A' (n +n m) N∘M→N+M = Poly-Rec-Set.f (PolyCommRing A' m) n (Poly A' (n +n m)) trunc 0P N∘M→N+M-b _poly+_ poly+Assoc poly+IdR poly+Comm (λ _ → refl) (λ v a b → refl) -- ----------------------------------------------------------------------------- -- -- Converse sens N+M→N∘M : Poly A' (n +n m) → Poly (PolyCommRing A' m) n N+M→N∘M = Poly-Rec-Set.f A' (n +n m) (Poly (PolyCommRing A' m) n) trunc 0P (λ v a → let v , v' = sep-vec n m v in base v (base v' a)) _poly+_ poly+Assoc poly+IdR poly+Comm (λ v → (cong (base (fst (sep-vec n m v))) (base-0P (snd (sep-vec n m v)))) ∙ (base-0P (fst (sep-vec n m v)))) λ v a b → base-poly+ (fst (sep-vec n m v)) (base (snd (sep-vec n m v)) a) (base (snd (sep-vec n m v)) b) ∙ cong (base (fst (sep-vec n m v))) (base-poly+ (snd (sep-vec n m v)) a b) ----------------------------------------------------------------------------- -- Section e-sect : (P : Poly A' (n +n m)) → N∘M→N+M (N+M→N∘M P) ≡ P e-sect = Poly-Ind-Prop.f A' (n +n m) (λ P → N∘M→N+M (N+M→N∘M P) ≡ P) (λ _ → trunc _ _) refl (λ v a → cong (λ X → base X a) (sep-vec-id n m v)) (λ {U V} ind-U ind-V → cong₂ _poly+_ ind-U ind-V) ----------------------------------------------------------------------------- -- Retraction e-retr : (P : Poly (PolyCommRing A' m) n) → N+M→N∘M (N∘M→N+M P) ≡ P e-retr = Poly-Ind-Prop.f (PolyCommRing A' m) n (λ P → N+M→N∘M (N∘M→N+M P) ≡ P) (λ _ → trunc _ _) refl (λ v → Poly-Ind-Prop.f A' m (λ P → N+M→N∘M (N∘M→N+M (base v P)) ≡ base v P) (λ _ → trunc _ _) (sym (base-0P v)) (λ v' a → cong₂ base (sep-vec-fst n m v v') (cong (λ X → base X a) (sep-vec-snd n m v v'))) (λ {U V} ind-U ind-V → (cong₂ _poly+_ ind-U ind-V) ∙ (base-poly+ v U V))) (λ {U V} ind-U ind-V → cong₂ _poly+_ ind-U ind-V ) ----------------------------------------------------------------------------- -- Morphism of ring map-0P : N∘M→N+M (0P) ≡ 0P map-0P = refl N∘M→N+M-gmorph : (P Q : Poly (PolyCommRing A' m) n) → N∘M→N+M ( P poly+ Q) ≡ N∘M→N+M P poly+ N∘M→N+M Q N∘M→N+M-gmorph = λ P Q → refl map-1P : N∘M→N+M (N∘Mr.1P) ≡ N+Mr.1P map-1P = cong (λ X → base X 1r) (rep-concat n m 0 ) N∘M→N+M-rmorph : (P Q : Poly (PolyCommRing A' m) n) → N∘M→N+M ( P N∘Mr.poly* Q) ≡ N∘M→N+M P N+Mr.poly* N∘M→N+M Q N∘M→N+M-rmorph = -- Ind P Poly-Ind-Prop.f (PolyCommRing A' m) n (λ P → (Q : Poly (PolyCommRing A' m) n) → N∘M→N+M (P N∘Mr.poly* Q) ≡ (N∘M→N+M P N+Mr.poly* N∘M→N+M Q)) (λ P p q i Q j → trunc _ _ (p Q) (q Q) i j) (λ Q → refl) (λ v → -- Ind Base P Poly-Ind-Prop.f A' m (λ P → (Q : Poly (PolyCommRing A' m) n) → N∘M→N+M (base v P N∘Mr.poly* Q) ≡ (N∘M→N+M (base v P) N+Mr.poly* N∘M→N+M Q)) (λ P p q i Q j → trunc _ _ (p Q) (q Q) i j) (λ Q → cong (λ X → N∘M→N+M (X N∘Mr.poly* Q)) (base-0P v)) (λ v' a → -- Ind Q Poly-Ind-Prop.f (PolyCommRing A' m) n (λ Q → N∘M→N+M (base v (base v' a) N∘Mr.poly* Q) ≡ (N∘M→N+M (base v (base v' a)) N+Mr.poly* N∘M→N+M Q)) (λ _ → trunc _ _) (sym (N+Mr.poly*AnnihilR (N∘M→N+M (base v (base v' a))))) (λ w → -- Ind base Q Poly-Ind-Prop.f A' m _ (λ _ → trunc _ _) (sym (N+Mr.poly*AnnihilR (N∘M→N+M (base v (base v' a))))) (λ w' b → cong (λ X → base X (a · b)) (+n-vec-concat n m v w v' w')) λ {U V} ind-U ind-V → cong (λ X → N∘M→N+M (base v (base v' a) N∘Mr.poly* X)) (sym (base-poly+ w U V)) ∙ cong₂ (_poly+_ ) ind-U ind-V ∙ sym (cong (λ X → N∘M→N+M (base v (base v' a)) N+Mr.poly* N∘M→N+M X) (base-poly+ w U V)) ) -- End Ind base Q λ {U V} ind-U ind-V → cong₂ _poly+_ ind-U ind-V) -- End Ind Q λ {U V} ind-U ind-V Q → cong (λ X → N∘M→N+M (X N∘Mr.poly* Q)) (sym (base-poly+ v U V)) ∙ cong₂ _poly+_ (ind-U Q) (ind-V Q) ∙ sym (cong (λ X → (N∘M→N+M X) N+Mr.poly* (N∘M→N+M Q)) (sym (base-poly+ v U V)) )) -- End Ind base P λ {U V} ind-U ind-V Q → cong₂ _poly+_ (ind-U Q) (ind-V Q) -- End Ind P ----------------------------------------------------------------------------- -- Ring Equivalence module _ (A' : CommRing ℓ) (n m : ℕ) where open Comp-Poly-nm A' n m CRE-PolyN∘M-PolyN+M : CommRingEquiv (PolyCommRing (PolyCommRing A' m) n) (PolyCommRing A' (n +n m)) fst CRE-PolyN∘M-PolyN+M = isoToEquiv is where is : Iso _ _ Iso.fun is = N∘M→N+M Iso.inv is = N+M→N∘M Iso.rightInv is = e-sect Iso.leftInv is = e-retr snd CRE-PolyN∘M-PolyN+M = makeIsRingHom map-1P N∘M→N+M-gmorph N∘M→N+M-rmorph
agda/BBHeap/Push.agda
bgbianchi/sorting
6
13115
<filename>agda/BBHeap/Push.agda open import Relation.Binary.Core module BBHeap.Push {A : Set} (_≤_ : A → A → Set) (tot≤ : Total _≤_) (trans≤ : Transitive _≤_) where open import BBHeap _≤_ open import BBHeap.Equality _≤_ open import BBHeap.Equality.Properties _≤_ open import Bound.Lower A open import Bound.Lower.Order _≤_ open import Bound.Lower.Order.Properties _≤_ trans≤ open import Data.Sum renaming (_⊎_ to _∨_) open import Order.Total _≤_ tot≤ mutual push⋘ : {b : Bound}{x y : A}{l r : BBHeap (val y)} → LeB b (val x) → LeB b (val y) → l ⋘ r → BBHeap b push⋘ b≤x _ lf⋘ = left b≤x lf⋘ push⋘ {x = x} b≤x b≤y (ll⋘ {x = y₁} {x' = y₂} y≤y₁ y≤y₂ l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂) with tot≤ y₁ y₂ | tot≤ x y₁ | tot≤ x y₂ ... | inj₁ y₁≤y₂ | inj₁ x≤y₁ | _ = left b≤x (ll⋘ (lexy x≤y₁) (lexy (trans≤ x≤y₁ y₁≤y₂)) l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂) ... | inj₁ y₁≤y₂ | inj₂ y₁≤x | _ = let pl'≈l' = lemma-push⋘ (lexy y₁≤x) (lexy refl≤) l₁⋘r₁ ; l'⋘r' = ll⋘ (lexy refl≤) (lexy y₁≤y₂) l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂ ; pl'⋘r' = lemma≈⋘ pl'≈l' l'⋘r' in left (transLeB b≤y y≤y₁) pl'⋘r' ... | inj₂ y₂≤y₁ | _ | inj₁ x≤y₂ = left b≤x (ll⋘ (lexy (trans≤ x≤y₂ y₂≤y₁)) (lexy x≤y₂) l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂) ... | inj₂ y₂≤y₁ | _ | inj₂ y₂≤x = let pr'≈r' = lemma-push⋘ (lexy y₂≤x) (lexy refl≤) l₂⋘r₂ ; r'≈pr' = sym≈ pr'≈r' ; l'⋘r' = ll⋘ (lexy y₂≤y₁) (lexy refl≤) l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂ ; l'⋘pr' = lemma⋘≈ l'⋘r' r'≈pr' in left (transLeB b≤y y≤y₂) l'⋘pr' push⋘ {x = x} b≤x b≤y (lr⋘ {x = y₁} {x' = y₂} y≤y₁ y≤y₂ l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂) with tot≤ y₁ y₂ | tot≤ x y₁ | tot≤ x y₂ ... | inj₁ y₁≤y₂ | inj₁ x≤y₁ | _ = left b≤x (lr⋘ (lexy x≤y₁) (lexy (trans≤ x≤y₁ y₁≤y₂)) l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂) ... | inj₁ y₁≤y₂ | inj₂ y₁≤x | _ = let pl'≈l' = lemma-push⋙ (lexy y₁≤x) (lexy refl≤) l₁⋙r₁ ; l'⋘r' = lr⋘ (lexy refl≤) (lexy y₁≤y₂) l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂ ; pl'⋘r' = lemma≈⋘ pl'≈l' l'⋘r' in left (transLeB b≤y y≤y₁) pl'⋘r' ... | inj₂ y₂≤y₁ | _ | inj₁ x≤y₂ = left b≤x (lr⋘ (lexy (trans≤ x≤y₂ y₂≤y₁)) (lexy x≤y₂) l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂) ... | inj₂ y₂≤y₁ | _ | inj₂ y₂≤x = let pr'≈r' = lemma-push⋘ (lexy y₂≤x) (lexy refl≤) l₂⋘r₂ ; r'≈pr' = sym≈ pr'≈r' ; l'⋘r' = lr⋘ (lexy y₂≤y₁) (lexy refl≤) l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂ ; l'⋘pr' = lemma⋘≈ l'⋘r' r'≈pr' in left (transLeB b≤y y≤y₂) l'⋘pr' push⋙ : {b : Bound}{x y : A}{l r : BBHeap (val y)} → LeB b (val x) → LeB b (val y) → l ⋙ r → BBHeap b push⋙ {x = x} b≤x b≤y (⋙lf {x = z} y≤z) with tot≤ x z ... | inj₁ x≤z = right b≤x (⋙lf (lexy x≤z)) ... | inj₂ z≤x = right (transLeB b≤y y≤z) (⋙lf (lexy z≤x)) push⋙ {x = x} b≤x b≤y (⋙rl {x = y₁} {x' = y₂} y≤y₁ y≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂) with tot≤ y₁ y₂ | tot≤ x y₁ | tot≤ x y₂ ... | inj₁ y₁≤y₂ | inj₁ x≤y₁ | _ = right b≤x (⋙rl (lexy x≤y₁) (lexy (trans≤ x≤y₁ y₁≤y₂)) l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂) ... | inj₁ y₁≤y₂ | inj₂ y₁≤x | _ = let pl'≈l' = lemma-push⋘ (lexy y₁≤x) (lexy refl≤) l₁⋘r₁ ; l'⋙r' = ⋙rl (lexy refl≤) (lexy y₁≤y₂) l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂ ; pl'⋙r' = lemma≈⋙ pl'≈l' l'⋙r' in right (transLeB b≤y y≤y₁) pl'⋙r' ... | inj₂ y₂≤y₁ | _ | inj₁ x≤y₂ = right b≤x (⋙rl (lexy (trans≤ x≤y₂ y₂≤y₁)) (lexy x≤y₂) l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂) ... | inj₂ y₂≤y₁ | _ | inj₂ y₂≤x = let pr'≈r' = lemma-push⋘ (lexy y₂≤x) (lexy refl≤) l₂⋘r₂ ; r'≈pr' = sym≈ pr'≈r' ; l'⋙r' = ⋙rl (lexy y₂≤y₁) (lexy refl≤) l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂ ; l'⋙pr' = lemma⋙≈ l'⋙r' r'≈pr' in right (transLeB b≤y y≤y₂) l'⋙pr' push⋙ {x = x} b≤x b≤y (⋙rr {x = y₁} {x' = y₂} y≤y₁ y≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂) with tot≤ y₁ y₂ | tot≤ x y₁ | tot≤ x y₂ ... | inj₁ y₁≤y₂ | inj₁ x≤y₁ | _ = right b≤x (⋙rr (lexy x≤y₁) (lexy (trans≤ x≤y₁ y₁≤y₂)) l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂) ... | inj₁ y₁≤y₂ | inj₂ y₁≤x | _ = let pl'≈l' = lemma-push⋘ (lexy y₁≤x) (lexy refl≤) l₁⋘r₁ ; l'⋙r' = ⋙rr (lexy refl≤) (lexy y₁≤y₂) l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂ ; pl'⋙r' = lemma≈⋙ pl'≈l' l'⋙r' in right (transLeB b≤y y≤y₁) pl'⋙r' ... | inj₂ y₂≤y₁ | _ | inj₁ x≤y₂ = right b≤x (⋙rr (lexy (trans≤ x≤y₂ y₂≤y₁)) (lexy x≤y₂) l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂) ... | inj₂ y₂≤y₁ | _ | inj₂ y₂≤x = let pr'≈r' = lemma-push⋙ (lexy y₂≤x) (lexy refl≤) l₂⋙r₂ ; r'≈pr' = sym≈ pr'≈r' ; l'⋙r' = ⋙rr (lexy y₂≤y₁) (lexy refl≤) l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂ ; l'⋙pr' = lemma⋙≈ l'⋙r' r'≈pr' in right (transLeB b≤y y≤y₂) l'⋙pr' lemma-push⋘ : {b : Bound}{x y : A}{l r : BBHeap (val y)}(b≤x : LeB b (val x))(b≤y : LeB b (val y))(l⋘r : l ⋘ r) → push⋘ b≤x b≤y l⋘r ≈ left b≤y l⋘r lemma-push⋘ b≤x b≤y lf⋘ = ≈left b≤x b≤y lf⋘ lf⋘ ≈leaf ≈leaf lemma-push⋘ {x = x} b≤x b≤y (ll⋘ {x = y₁} {x' = y₂} y≤y₁ y≤y₂ l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂) with tot≤ y₁ y₂ | tot≤ x y₁ | tot≤ x y₂ ... | inj₁ y₁≤y₂ | inj₁ x≤y₁ | _ = let l⋘r = ll⋘ y≤y₁ y≤y₂ l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂ ; x≤y₂ = lexy (trans≤ x≤y₁ y₁≤y₂) ; l'⋘r' = ll⋘ (lexy x≤y₁) x≤y₂ l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂ ; l'≈l = ≈left (lexy x≤y₁) y≤y₁ l₁⋘r₁ l₁⋘r₁ refl≈ refl≈ ; r'≈r = ≈left x≤y₂ y≤y₂ l₂⋘r₂ l₂⋘r₂ refl≈ refl≈ in ≈left b≤x b≤y l'⋘r' l⋘r l'≈l r'≈r ... | inj₁ y₁≤y₂ | inj₂ y₁≤x | _ = let l⋘r = ll⋘ y≤y₁ y≤y₂ l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂ ; pl'≈l' = lemma-push⋘ (lexy y₁≤x) (lexy refl≤) l₁⋘r₁ ; l'⋘r' = ll⋘ (lexy refl≤) (lexy y₁≤y₂) l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂ ; pl'⋘r' = lemma≈⋘ pl'≈l' l'⋘r' ; l'≈l = ≈left (lexy refl≤) y≤y₁ l₁⋘r₁ l₁⋘r₁ refl≈ refl≈ ; pl'≈l = trans≈ pl'≈l' l'≈l ; r'≈r = ≈left (lexy y₁≤y₂) y≤y₂ l₂⋘r₂ l₂⋘r₂ refl≈ refl≈ in ≈left (transLeB b≤y y≤y₁) b≤y pl'⋘r' l⋘r pl'≈l r'≈r ... | inj₂ y₂≤y₁ | _ | inj₁ x≤y₂ = let l⋘r = ll⋘ y≤y₁ y≤y₂ l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂ ; x≤y₁ = lexy (trans≤ x≤y₂ y₂≤y₁) ; l'⋘r' = ll⋘ x≤y₁ (lexy x≤y₂) l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂ ; r'≈r = ≈left (lexy x≤y₂) y≤y₂ l₂⋘r₂ l₂⋘r₂ refl≈ refl≈ ; l'≈l = ≈left x≤y₁ y≤y₁ l₁⋘r₁ l₁⋘r₁ refl≈ refl≈ in ≈left b≤x b≤y l'⋘r' l⋘r l'≈l r'≈r ... | inj₂ y₂≤y₁ | _ | inj₂ y₂≤x = let l⋘r = ll⋘ y≤y₁ y≤y₂ l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂ ; pr'≈r' = lemma-push⋘ (lexy y₂≤x) (lexy refl≤) l₂⋘r₂ ; r'≈pr' = sym≈ pr'≈r' ; l'⋘r' = ll⋘ (lexy y₂≤y₁) (lexy refl≤) l₁⋘r₁ l₂⋘r₂ l₂≃r₂ r₁≃l₂ ; l'⋘pr' = lemma⋘≈ l'⋘r' r'≈pr' ; r'≈r = ≈left (lexy refl≤) y≤y₂ l₂⋘r₂ l₂⋘r₂ refl≈ refl≈ ; pr'≈r = trans≈ pr'≈r' r'≈r ; l'≈l = ≈left (lexy y₂≤y₁) y≤y₁ l₁⋘r₁ l₁⋘r₁ refl≈ refl≈ in ≈left (transLeB b≤y y≤y₂) b≤y l'⋘pr' l⋘r l'≈l pr'≈r lemma-push⋘ {x = x} b≤x b≤y (lr⋘ {x = y₁} {x' = y₂} y≤y₁ y≤y₂ l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂) with tot≤ y₁ y₂ | tot≤ x y₁ | tot≤ x y₂ ... | inj₁ y₁≤y₂ | inj₁ x≤y₁ | _ = let l⋘r = lr⋘ y≤y₁ y≤y₂ l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂ ; x≤y₂ = lexy (trans≤ x≤y₁ y₁≤y₂) ; l'⋘r' = lr⋘ (lexy x≤y₁) x≤y₂ l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂ ; l'≈l = ≈right (lexy x≤y₁) y≤y₁ l₁⋙r₁ l₁⋙r₁ refl≈ refl≈ ; r'≈r = ≈left x≤y₂ y≤y₂ l₂⋘r₂ l₂⋘r₂ refl≈ refl≈ in ≈left b≤x b≤y l'⋘r' l⋘r l'≈l r'≈r ... | inj₁ y₁≤y₂ | inj₂ y₁≤x | _ = let l⋘r = lr⋘ y≤y₁ y≤y₂ l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂ ; pl'≈l' = lemma-push⋙ (lexy y₁≤x) (lexy refl≤) l₁⋙r₁ ; l'⋘r' = lr⋘ (lexy refl≤) (lexy y₁≤y₂) l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂ ; pl'⋘r' = lemma≈⋘ pl'≈l' l'⋘r' ; l'≈l = ≈right (lexy refl≤) y≤y₁ l₁⋙r₁ l₁⋙r₁ refl≈ refl≈ ; pl'≈l = trans≈ pl'≈l' l'≈l ; r'≈r = ≈left (lexy y₁≤y₂) y≤y₂ l₂⋘r₂ l₂⋘r₂ refl≈ refl≈ in ≈left (transLeB b≤y y≤y₁) b≤y pl'⋘r' l⋘r pl'≈l r'≈r ... | inj₂ y₂≤y₁ | _ | inj₁ x≤y₂ = let l⋘r = lr⋘ y≤y₁ y≤y₂ l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂ ; x≤y₁ = lexy (trans≤ x≤y₂ y₂≤y₁) ; l'⋘r' = lr⋘ x≤y₁ (lexy x≤y₂) l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂ ; l'≈l = ≈right x≤y₁ y≤y₁ l₁⋙r₁ l₁⋙r₁ refl≈ refl≈ ; r'≈r = ≈left (lexy x≤y₂) y≤y₂ l₂⋘r₂ l₂⋘r₂ refl≈ refl≈ in ≈left b≤x b≤y l'⋘r' l⋘r l'≈l r'≈r ... | inj₂ y₂≤y₁ | _ | inj₂ y₂≤x = let l⋘r = lr⋘ y≤y₁ y≤y₂ l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂ ; pr'≈r' = lemma-push⋘ (lexy y₂≤x) (lexy refl≤) l₂⋘r₂ ; r'≈pr' = sym≈ pr'≈r' ; l'⋘r' = lr⋘ (lexy y₂≤y₁) (lexy refl≤) l₁⋙r₁ l₂⋘r₂ l₂≃r₂ l₁⋗l₂ ; l'⋘pr' = lemma⋘≈ l'⋘r' r'≈pr' ; l'≈l = ≈right (lexy y₂≤y₁) y≤y₁ l₁⋙r₁ l₁⋙r₁ refl≈ refl≈ ; r'≈r = ≈left (lexy refl≤) y≤y₂ l₂⋘r₂ l₂⋘r₂ refl≈ refl≈ ; pr'≈r = trans≈ pr'≈r' r'≈r in ≈left (transLeB b≤y y≤y₂) b≤y l'⋘pr' l⋘r l'≈l pr'≈r lemma-push⋙ : {b : Bound}{x y : A}{l r : BBHeap (val y)}(b≤x : LeB b (val x))(b≤y : LeB b (val y))(l⋙r : l ⋙ r) → push⋙ b≤x b≤y l⋙r ≈ right b≤y l⋙r lemma-push⋙ {x = x} b≤x b≤y (⋙lf {x = z} y≤z) with tot≤ x z ... | inj₁ x≤z = ≈right b≤x b≤y (⋙lf (lexy x≤z)) (⋙lf y≤z) (≈left (lexy x≤z) y≤z lf⋘ lf⋘ ≈leaf ≈leaf) ≈leaf ... | inj₂ z≤x = ≈right (transLeB b≤y y≤z) b≤y (⋙lf (lexy z≤x)) (⋙lf y≤z) (≈left (lexy z≤x) y≤z lf⋘ lf⋘ ≈leaf ≈leaf) ≈leaf lemma-push⋙ {x = x} b≤x b≤y (⋙rl {x = y₁} {x' = y₂} y≤y₁ y≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂) with tot≤ y₁ y₂ | tot≤ x y₁ | tot≤ x y₂ ... | inj₁ y₁≤y₂ | inj₁ x≤y₁ | _ = let l⋙r = ⋙rl y≤y₁ y≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂ ; x≤y₂ = lexy (trans≤ x≤y₁ y₁≤y₂) ; l'⋙r' = ⋙rl (lexy x≤y₁) x≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂ ; l'≈l = ≈left (lexy x≤y₁) y≤y₁ l₁⋘r₁ l₁⋘r₁ refl≈ refl≈ ; r'≈r = ≈left x≤y₂ y≤y₂ l₂⋘r₂ l₂⋘r₂ refl≈ refl≈ in ≈right b≤x b≤y l'⋙r' l⋙r l'≈l r'≈r ... | inj₁ y₁≤y₂ | inj₂ y₁≤x | _ = let l⋙r = ⋙rl y≤y₁ y≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂ ; pl'≈l' = lemma-push⋘ (lexy y₁≤x) (lexy refl≤) l₁⋘r₁ ; l'⋙r' = ⋙rl (lexy refl≤) (lexy y₁≤y₂) l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂ ; pl'⋙r' = lemma≈⋙ pl'≈l' l'⋙r' ; l'≈l = ≈left (lexy refl≤) y≤y₁ l₁⋘r₁ l₁⋘r₁ refl≈ refl≈ ; pl'≈l = trans≈ pl'≈l' l'≈l ; r'≈r = ≈left (lexy y₁≤y₂) y≤y₂ l₂⋘r₂ l₂⋘r₂ refl≈ refl≈ in ≈right (transLeB b≤y y≤y₁) b≤y pl'⋙r' l⋙r pl'≈l r'≈r ... | inj₂ y₂≤y₁ | _ | inj₁ x≤y₂ = let l⋙r = ⋙rl y≤y₁ y≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂ ; x≤y₁ = lexy (trans≤ x≤y₂ y₂≤y₁) ; l'⋙r' = ⋙rl x≤y₁ (lexy x≤y₂) l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂ ; l'≈l = ≈left x≤y₁ y≤y₁ l₁⋘r₁ l₁⋘r₁ refl≈ refl≈ ; r'≈r = ≈left (lexy x≤y₂) y≤y₂ l₂⋘r₂ l₂⋘r₂ refl≈ refl≈ in ≈right b≤x b≤y l'⋙r' l⋙r l'≈l r'≈r ... | inj₂ y₂≤y₁ | _ | inj₂ y₂≤x = let l⋙r = ⋙rl y≤y₁ y≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂ ; pr'≈r' = lemma-push⋘ (lexy y₂≤x) (lexy refl≤) l₂⋘r₂ ; r'≈pr' = sym≈ pr'≈r' ; l'⋙r' = ⋙rl (lexy y₂≤y₁) (lexy refl≤) l₁⋘r₁ l₁≃r₁ l₂⋘r₂ l₁⋗r₂ ; l'⋙pr' = lemma⋙≈ l'⋙r' r'≈pr' ; l'≈l = ≈left (lexy y₂≤y₁) y≤y₁ l₁⋘r₁ l₁⋘r₁ refl≈ refl≈ ; r'≈r = ≈left (lexy refl≤) y≤y₂ l₂⋘r₂ l₂⋘r₂ refl≈ refl≈ ; pr'≈r = trans≈ pr'≈r' r'≈r in ≈right (transLeB b≤y y≤y₂) b≤y l'⋙pr' l⋙r l'≈l pr'≈r lemma-push⋙ {x = x} b≤x b≤y (⋙rr {x = y₁} {x' = y₂} y≤y₁ y≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂) with tot≤ y₁ y₂ | tot≤ x y₁ | tot≤ x y₂ ... | inj₁ y₁≤y₂ | inj₁ x≤y₁ | _ = let l⋙r = ⋙rr y≤y₁ y≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂ ; x≤y₂ = lexy (trans≤ x≤y₁ y₁≤y₂) ; l'⋙r' = ⋙rr (lexy x≤y₁) x≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂ ; l'≈l = ≈left (lexy x≤y₁) y≤y₁ l₁⋘r₁ l₁⋘r₁ refl≈ refl≈ ; r'≈r = ≈right x≤y₂ y≤y₂ l₂⋙r₂ l₂⋙r₂ refl≈ refl≈ in ≈right b≤x b≤y l'⋙r' l⋙r l'≈l r'≈r ... | inj₁ y₁≤y₂ | inj₂ y₁≤x | _ = let l⋙r = ⋙rr y≤y₁ y≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂ ; pl'≈l' = lemma-push⋘ (lexy y₁≤x) (lexy refl≤) l₁⋘r₁ ; l'⋙r' = ⋙rr (lexy refl≤) (lexy y₁≤y₂) l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂ ; pl'⋙r' = lemma≈⋙ pl'≈l' l'⋙r' ; l'≈l = ≈left (lexy refl≤) y≤y₁ l₁⋘r₁ l₁⋘r₁ refl≈ refl≈ ; pl'≈l = trans≈ pl'≈l' l'≈l ; r'≈r = ≈right (lexy y₁≤y₂) y≤y₂ l₂⋙r₂ l₂⋙r₂ refl≈ refl≈ in ≈right (transLeB b≤y y≤y₁) b≤y pl'⋙r' l⋙r pl'≈l r'≈r ... | inj₂ y₂≤y₁ | _ | inj₁ x≤y₂ = let l⋙r = ⋙rr y≤y₁ y≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂ ; x≤y₁ = lexy (trans≤ x≤y₂ y₂≤y₁) ; l'⋙r' = ⋙rr x≤y₁ (lexy x≤y₂) l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂ ; l'≈l = ≈left x≤y₁ y≤y₁ l₁⋘r₁ l₁⋘r₁ refl≈ refl≈ ; r'≈r = ≈right (lexy x≤y₂) y≤y₂ l₂⋙r₂ l₂⋙r₂ refl≈ refl≈ in ≈right b≤x b≤y l'⋙r' l⋙r l'≈l r'≈r ... | inj₂ y₂≤y₁ | _ | inj₂ y₂≤x = let l⋙r = ⋙rr y≤y₁ y≤y₂ l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂ ; pr'≈r' = lemma-push⋙ (lexy y₂≤x) (lexy refl≤) l₂⋙r₂ ; r'≈pr' = sym≈ pr'≈r' ; l'⋙r' = ⋙rr (lexy y₂≤y₁) (lexy refl≤) l₁⋘r₁ l₁≃r₁ l₂⋙r₂ l₁≃l₂ ; l'⋙pr' = lemma⋙≈ l'⋙r' r'≈pr' ; l'≈l = ≈left (lexy y₂≤y₁) y≤y₁ l₁⋘r₁ l₁⋘r₁ refl≈ refl≈ ; r'≈r = ≈right (lexy refl≤) y≤y₂ l₂⋙r₂ l₂⋙r₂ refl≈ refl≈ ; pr'≈r = trans≈ pr'≈r' r'≈r in ≈right (transLeB b≤y y≤y₂) b≤y l'⋙pr' l⋙r l'≈l pr'≈r push : {b : Bound}{x : A} → LeB b (val x) → BBHeap b → BBHeap b push _ leaf = leaf push b≤x (left b≤y l⋘r) = push⋘ b≤x b≤y l⋘r push b≤x (right b≤y l⋙r) = push⋙ b≤x b≤y l⋙r
src/ada/src/uxas-common-sentinel_serial_buffers.adb
pat-rogers/OpenUxAS
0
27516
<gh_stars>0 package body UxAS.Common.Sentinel_Serial_Buffers is ----------------------------- -- Get_Next_Payload_String -- ----------------------------- procedure Get_Next_Payload_String (This : in out Sentinel_Serial_Buffer; New_Data_Chunk : String; Result : out String) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Get_Next_Payload_String unimplemented"); raise Program_Error with "Unimplemented procedure Get_Next_Payload_String"; end Get_Next_Payload_String; -------------------------------- -- Create_Sentinelized_String -- -------------------------------- function Create_Sentinelized_String (Data : String) return String is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Create_Sentinelized_String unimplemented"); return raise Program_Error with "Unimplemented function Create_Sentinelized_String"; end Create_Sentinelized_String; ------------------------- -- Calculated_Checksum -- ------------------------- function Calculated_Checksum (Str : String) return UInt32 is Result : UInt32 := 0; begin for C of Str loop Result := Result + Character'Pos (C); end loop; return Result; end Calculated_Checksum; ---------------------------------------------- -- Get_Detect_Sentinel_Base_Strings_Message -- ---------------------------------------------- function Get_Detect_Sentinel_Base_Strings_Message (Data : String) return String is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Get_Detect_Sentinel_Base_Strings_Message unimplemented"); return raise Program_Error with "Unimplemented function Get_Detect_Sentinel_Base_Strings_Message"; end Get_Detect_Sentinel_Base_Strings_Message; end UxAS.Common.Sentinel_Serial_Buffers;
oeis/095/A095126.asm
neoneye/loda-programs
11
91446
; A095126: Expansion of x*(4+5*x-x^2)/ (1-2*x-3*x^2+x^3). ; Submitted by <NAME> ; 4,13,37,109,316,922,2683,7816,22759,66283,193027,562144,1637086,4767577,13884268,40434181,117753589,342925453,998677492,2908377754,8469862531,24666180832,71833571503,209195822971,609226179619 mov $2,1 lpb $0 sub $0,1 add $1,2 add $3,$2 add $2,$3 mov $4,$3 add $4,$2 mov $2,$1 mov $1,$4 add $2,$3 lpe mov $0,$1 mul $0,3 add $0,4
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1956.asm
ljhsiun2/medusa
9
240419
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r9 push %rbp push %rcx push %rdi lea addresses_WC_ht+0x1e94a, %r13 clflush (%r13) nop nop nop nop cmp %rcx, %rcx mov $0x6162636465666768, %r9 movq %r9, %xmm7 vmovups %ymm7, (%r13) xor %rdi, %rdi lea addresses_WT_ht+0x1008a, %rbp nop nop and %r11, %r11 mov (%rbp), %r12d nop nop nop nop nop add $6825, %r11 lea addresses_UC_ht+0x9e64, %rcx nop nop nop sub $48615, %r9 mov $0x6162636465666768, %rbp movq %rbp, (%rcx) nop nop nop xor %rcx, %rcx lea addresses_WC_ht+0xc14a, %rcx nop nop nop xor %r9, %r9 mov (%rcx), %edi nop nop nop nop nop and $41080, %r9 lea addresses_UC_ht+0x15cca, %rbp nop nop nop nop nop dec %r12 mov (%rbp), %edi nop nop nop add %r11, %r11 lea addresses_normal_ht+0xa0ca, %rcx nop nop nop nop cmp %r9, %r9 mov $0x6162636465666768, %r12 movq %r12, %xmm0 movups %xmm0, (%rcx) nop nop nop inc %rbp pop %rdi pop %rcx pop %rbp pop %r9 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r14 push %rax push %rbp push %rbx push %rdi push %rdx // Faulty Load lea addresses_UC+0x40ca, %rdx nop nop nop nop and $48228, %rax vmovups (%rdx), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $1, %xmm5, %rdi lea oracles, %rax and $0xff, %rdi shlq $12, %rdi mov (%rax,%rdi,1), %rdi pop %rdx pop %rdi pop %rbx pop %rbp pop %rax pop %r14 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_UC', 'AVXalign': False, 'size': 4, 'NT': True, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_UC', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}} {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4, 'NT': True, 'same': False, 'congruent': 9}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 10}} {'37': 21829} 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 */
non_regression/other_x86_linux_20.o.asm
LRGH/plasmasm
1
177377
<filename>non_regression/other_x86_linux_20.o.asm .file "regexmodule.c" .section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat .hidden __x86.get_pc_thunk.bx .globl __x86.get_pc_thunk.bx .type __x86.get_pc_thunk.bx, @function __x86.get_pc_thunk.bx: movl (%esp), %ebx ret # ---------------------- .section .data.rel.ro.local,"wa",@progbits .local members .type members, @object members: .long .LC10 .long .LC11 .long .LC13 .long .LC14 .long .LC15 .long .LC16 .long 0 .size members, 28 # ---------------------- .section .rodata.str1.4,"aMS",@progbits,1 .LC8: .string "translation table must be 256 bytes" .LC23: .string "group() group name doesn't exist" # ---------------------- .LC00000045.str1.4: .zero 3 .align 4 .LC25: .string "group() only valid after successful match/search" # ---------------------- .LC00000079.str1.4: .zero 3 .align 4 .LC27: .string "the regex module is deprecated; please use the re module" # ---------------------- .section .rodata.str1.1,"aMS",@progbits,1 .LC0: .string "i:set_syntax" .LC1: .string "O|i:search" .LC2: .string "t#:search" .LC3: .string "search offset out of range" .LC4: .string "match failure" .LC5: .string "O|i:match" .LC6: .string "t#" .LC7: .string "match offset out of range" .LC9: .string "S|S:symcomp" .LC10: .string "last" .LC11: .string "regs" .LC12: .string "(ii)" .LC13: .string "translate" .LC14: .string "groupindex" .LC15: .string "realpat" .LC16: .string "givenpat" .LC17: .string "__members__" .LC18: .string "S|S:compile" .LC19: .string "SS:search" .LC20: .string "(S)" .LC21: .string "SS:match" .LC22: .string "not enough arguments" .LC24: .string "group() index out of range" .LC26: .string "regex" .LC28: .string "regex.error" .LC29: .string "error" .LC30: .string "casefold" .LC00000133.str1.1: .string "compile" .LC0000013B.str1.1: .string "symcomp" .LC00000143.str1.1: .string "match" .LC00000149.str1.1: .string "search" .LC00000150.str1.1: .string "set_syntax" .LC0000015B.str1.1: .string "get_syntax" .LC00000166.str1.1: .string "regex.regex" .LC00000172.str1.1: .string "group" # ---------------------- .section .data.rel.local,"wa",@progbits .local regex_global_methods .type regex_global_methods, @object regex_global_methods: .long .LC00000133.str1.1 .long regex_compile .long 1 .long 0 .long .LC0000013B.str1.1 .long regex_symcomp .long 1 .long 0 .long .LC00000143.str1.1 .long regex_match .long 1 .long 0 .long .LC00000149.str1.1 .long regex_search .long 1 .long 0 .long .LC00000150.str1.1 .long regex_set_syntax .long 1 .long 0 .long .LC0000015B.str1.1 .long regex_get_syntax .long 4 .long 0 .long 0 .long 0 .long 0 .long 0 .size regex_global_methods, 112 # ---------------------- .LD00000070.rel.local: .zero 16 # ---------------------- .local Regextype .type Regextype, @object Regextype: .long 1 .zero 8 .long .LC00000166.str1.1 .long 1116 .long 0 .long reg_dealloc .long 0 .long regobj_getattr .zero 156 .size Regextype, 192 # ---------------------- .local reg_methods .type reg_methods, @object reg_methods: .long .LC00000143.str1.1 .long regobj_match .long 1 .long 0 .long .LC00000149.str1.1 .long regobj_search .long 1 .long 0 .long .LC00000172.str1.1 .long regobj_group .long 1 .long 0 .long 0 .long 0 .long 0 .long 0 .size reg_methods, 64 # ---------------------- .text .local regex_get_syntax .type regex_get_syntax, @function regex_get_syntax: pushl %ebx call __x86.get_pc_thunk.bx .L00000006: addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $24, %esp movl _Py_re_syntax@GOT(%ebx), %eax movl (%eax), %eax movl %eax, (%esp) call PyInt_FromLong@PLT .L0000001F: addl $24, %esp popl %ebx ret .size regex_get_syntax, .-regex_get_syntax # ---------------------- .L00000024: .p2align 4 # ---------------------- .local regex_set_syntax .type regex_set_syntax, @function regex_set_syntax: pushl %ebx call __x86.get_pc_thunk.bx .L00000036: addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $40, %esp leal 28(%esp), %eax movl %eax, 8(%esp) leal .LC0@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl 52(%esp), %eax movl %eax, (%esp) call PyArg_ParseTuple@PLT .L0000005D: movl %eax, %edx xorl %eax, %eax testl %edx, %edx je .L000000BF .L00000065: movl 28(%esp), %eax movl %eax, (%esp) call _Py_re_set_syntax@PLT .L00000071: movl %eax, 28(%esp) movl cache_pat@GOTOFF(%ebx), %eax testl %eax, %eax je .L0000008A .L0000007F: movl (%eax), %ecx leal -1(%ecx), %edx testl %edx, %edx movl %edx, (%eax) je .L000000D8 .L0000008A: movl cache_prog@GOTOFF(%ebx), %eax movl $0, cache_pat@GOTOFF(%ebx) testl %eax, %eax je .L000000A9 .L0000009E: movl (%eax), %ecx leal -1(%ecx), %edx testl %edx, %edx movl %edx, (%eax) je .L000000C8 .L000000A9: movl 28(%esp), %eax movl $0, cache_prog@GOTOFF(%ebx) movl %eax, (%esp) call PyInt_FromLong@PLT .L000000BF: addl $40, %esp popl %ebx ret .L000000C4: .p2align 3 .L000000C8: movl 4(%eax), %edx movl %eax, (%esp) call *24(%edx) .L000000D1: jmp .L000000A9 .L000000D3: .p2align 3 .L000000D8: movl 4(%eax), %edx movl %eax, (%esp) call *24(%edx) .L000000E1: jmp .L0000008A .size regex_set_syntax, .-regex_set_syntax # ---------------------- .L000000E3: .p2align 4 # ---------------------- .local regobj_search .type regobj_search, @function regobj_search: pushl %edi pushl %esi pushl %ebx call __x86.get_pc_thunk.bx .L000000F8: addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $48, %esp leal 44(%esp), %eax movl 64(%esp), %esi movl %eax, 12(%esp) leal 32(%esp), %eax movl %eax, 8(%esp) movl $0, 44(%esp) leal .LC1@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl 68(%esp), %eax movl %eax, (%esp) call PyArg_ParseTuple@PLT .L00000133: testl %eax, %eax je .L00000208 .L0000013B: leal 40(%esp), %eax movl %eax, 12(%esp) leal 36(%esp), %eax movl %eax, 8(%esp) leal .LC2@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl 32(%esp), %eax movl %eax, (%esp) call PyArg_Parse@PLT .L00000161: testl %eax, %eax je .L00000208 .L00000169: movl 44(%esp), %eax testl %eax, %eax js .L000001F0 .L00000171: movl 40(%esp), %ecx cmpl %ecx, %eax jg .L000001F0 .L00000179: movl 1100(%esi), %edx movl %ecx, %edi subl %eax, %edi testl %edx, %edx je .L00000198 .L00000187: subl $1, (%edx) je .L00000218 .L00000190: movl 44(%esp), %eax movl 40(%esp), %ecx .L00000198: movl $0, 1100(%esi) leal 40(%esi), %edx movl %eax, 12(%esp) movl 36(%esp), %eax movl %edx, 20(%esp) movl %edi, 16(%esp) movl %ecx, 8(%esp) movl %eax, 4(%esp) leal 8(%esi), %eax movl %eax, (%esp) call _Py_re_search@PLT .L000001C8: cmpl $-1, %eax jl .L00000230 .L000001CD: je .L000001E0 .L000001CF: movl 32(%esp), %edx addl $1, (%edx) movl 32(%esp), %edx movl %edx, 1100(%esi) .L000001E0: movl %eax, (%esp) call PyInt_FromLong@PLT .L000001E8: addl $48, %esp popl %ebx popl %esi popl %edi ret .L000001EF: .p2align 3 .L000001F0: leal .LC3@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl RegexError@GOTOFF(%ebx), %eax movl %eax, (%esp) call PyErr_SetString@PLT .L00000208: addl $48, %esp xorl %eax, %eax popl %ebx popl %esi popl %edi ret .L00000211: .p2align 3 .L00000218: movl 1100(%esi), %eax movl 4(%eax), %edx movl %eax, (%esp) call *24(%edx) .L00000227: jmp .L00000190 .L0000022C: .p2align 3 .L00000230: call PyErr_Occurred@PLT .L00000235: testl %eax, %eax jne .L00000208 .L00000239: leal .LC4@GOTOFF(%ebx), %edx movl %edx, 4(%esp) movl RegexError@GOTOFF(%ebx), %edx movl %eax, 28(%esp) movl %edx, (%esp) call PyErr_SetString@PLT .L00000255: movl 28(%esp), %eax jmp .L000001E8 .size regobj_search, .-regobj_search # ---------------------- .L0000025B: .p2align 3 # ---------------------- .local regobj_match .type regobj_match, @function regobj_match: pushl %esi pushl %ebx call __x86.get_pc_thunk.bx .L00000267: addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $52, %esp leal 44(%esp), %eax movl 64(%esp), %esi movl %eax, 12(%esp) leal 32(%esp), %eax movl %eax, 8(%esp) movl $0, 44(%esp) leal .LC5@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl 68(%esp), %eax movl %eax, (%esp) call PyArg_ParseTuple@PLT .L000002A2: testl %eax, %eax je .L00000370 .L000002AA: leal 40(%esp), %eax movl %eax, 12(%esp) leal 36(%esp), %eax movl %eax, 8(%esp) leal .LC6@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl 32(%esp), %eax movl %eax, (%esp) call PyArg_Parse@PLT .L000002D0: testl %eax, %eax je .L00000370 .L000002D8: movl 44(%esp), %edx testl %edx, %edx js .L00000358 .L000002E0: movl 40(%esp), %ecx cmpl %ecx, %edx jg .L00000358 .L000002E8: movl 1100(%esi), %eax testl %eax, %eax je .L00000305 .L000002F2: movl (%eax), %ecx leal -1(%ecx), %edx testl %edx, %edx movl %edx, (%eax) je .L00000378 .L000002FD: movl 44(%esp), %edx movl 40(%esp), %ecx .L00000305: leal 40(%esi), %eax movl $0, 1100(%esi) movl %eax, 16(%esp) movl 36(%esp), %eax movl %edx, 12(%esp) movl %ecx, 8(%esp) movl %eax, 4(%esp) leal 8(%esi), %eax movl %eax, (%esp) call _Py_re_match@PLT .L00000331: cmpl $-1, %eax jl .L00000390 .L00000336: je .L00000349 .L00000338: movl 32(%esp), %edx addl $1, (%edx) movl 32(%esp), %edx movl %edx, 1100(%esi) .L00000349: movl %eax, (%esp) call PyInt_FromLong@PLT .L00000351: addl $52, %esp popl %ebx popl %esi ret .L00000357: .p2align 3 .L00000358: leal .LC7@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl RegexError@GOTOFF(%ebx), %eax movl %eax, (%esp) call PyErr_SetString@PLT .L00000370: addl $52, %esp xorl %eax, %eax popl %ebx popl %esi ret .L00000378: movl 1100(%esi), %eax movl 4(%eax), %edx movl %eax, (%esp) call *24(%edx) .L00000387: jmp .L000002FD .L0000038C: .p2align 3 .L00000390: call PyErr_Occurred@PLT .L00000395: testl %eax, %eax jne .L00000370 .L00000399: leal .LC4@GOTOFF(%ebx), %edx movl %edx, 4(%esp) movl RegexError@GOTOFF(%ebx), %edx movl %eax, 28(%esp) movl %edx, (%esp) call PyErr_SetString@PLT .L000003B5: movl 28(%esp), %eax jmp .L00000351 .size regobj_match, .-regobj_match # ---------------------- .L000003BB: .p2align 3 # ---------------------- .local newregexobject .type newregexobject, @function newregexobject: pushl %ebp movl %edx, %ebp pushl %edi movl %eax, %edi pushl %esi pushl %ebx call __x86.get_pc_thunk.bx .L000003CD: addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $44, %esp leal 28(%esp), %eax movl %eax, 12(%esp) leal 24(%esp), %eax movl %eax, 8(%esp) movl %edi, (%esp) leal .LC6@GOTOFF(%ebx), %eax movl %eax, 4(%esp) call PyArg_Parse@PLT .L000003F8: testl %eax, %eax je .L000004C9 .L00000400: testl %ebp, %ebp je .L00000417 .L00000404: movl %ebp, (%esp) call PyString_Size@PLT .L0000040C: cmpl $256, %eax jne .L000004F8 .L00000417: leal Regextype@GOTOFF(%ebx), %eax movl %eax, (%esp) call _PyObject_New@PLT .L00000425: testl %eax, %eax movl %eax, %esi je .L000004C9 .L0000042F: movl $0, 8(%eax) testl %ebp, %ebp movl $0, 12(%eax) leal 840(%eax), %eax movl %eax, 20(%esi) je .L000004D8 .L0000044E: movl %ebp, (%esp) call PyString_AsString@PLT .L00000456: testl %eax, %eax movl %eax, 24(%esi) je .L000004C4 .L0000045D: addl $1, (%ebp) .L00000461: movl 68(%esp), %eax movl %ebp, 1096(%esi) movl $0, 1100(%esi) movl %eax, 1104(%esi) movl 64(%esp), %eax addl $1, (%edi) movl %edi, 1112(%esi) addl $1, (%eax) movl %eax, 1108(%esi) leal 8(%esi), %eax movl %eax, 8(%esp) movl 28(%esp), %eax movl %eax, 4(%esp) movl 24(%esp), %eax movl %eax, (%esp) call _Py_re_compile_pattern@PLT .L000004AC: movl %esi, %edx testl %eax, %eax je .L000004CB .L000004B2: movl %eax, 4(%esp) movl RegexError@GOTOFF(%ebx), %eax movl %eax, (%esp) call PyErr_SetString@PLT .L000004C4: subl $1, (%esi) je .L000004E8 .L000004C9: xorl %edx, %edx .L000004CB: addl $44, %esp movl %edx, %eax popl %ebx popl %esi popl %edi popl %ebp ret .L000004D5: .p2align 3 .L000004D8: movl $0, 24(%esi) jmp .L00000461 .L000004E4: .p2align 3 .L000004E8: movl 4(%esi), %eax movl %esi, (%esp) call *24(%eax) .L000004F1: jmp .L000004C9 .L000004F3: .p2align 3 .L000004F8: leal .LC8@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl RegexError@GOTOFF(%ebx), %eax movl %eax, (%esp) call PyErr_SetString@PLT .L00000510: xorl %edx, %edx jmp .L000004CB .size newregexobject, .-newregexobject # ---------------------- .L00000514: .p2align 4 # ---------------------- .local regex_symcomp .type regex_symcomp, @function regex_symcomp: pushl %ebp pushl %edi pushl %esi pushl %ebx call __x86.get_pc_thunk.bx .L00000529: addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $204, %esp movl %gs:20, %eax movl %eax, 188(%esp) xorl %eax, %eax leal 52(%esp), %eax movl %eax, 12(%esp) leal 48(%esp), %eax movl %eax, 8(%esp) movl $0, 52(%esp) leal .LC9@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl 228(%esp), %eax movl %eax, (%esp) call PyArg_ParseTuple@PLT .L00000575: testl %eax, %eax je .L000006B8 .L0000057D: call PyDict_New@PLT .L00000582: testl %eax, %eax movl %eax, 28(%esp) je .L000006B8 .L0000058E: movl _Py_re_syntax@GOT(%ebx), %eax movl 48(%esp), %edi movl (%eax), %eax movl %edi, (%esp) movl %eax, 20(%esp) call PyString_AsString@PLT .L000005A6: testl %eax, %eax movl %eax, %ebp je .L00000698 .L000005B0: movl %edi, (%esp) call PyString_Size@PLT .L000005B8: testl %eax, %eax js .L00000698 .L000005C0: leal (%ebp,%eax), %esi cmpl %esi, %ebp je .L000007DA .L000005CC: movl %eax, 4(%esp) movl $0, (%esp) call PyString_FromStringAndSize@PLT .L000005DC: testl %eax, %eax movl %eax, 56(%esp) je .L00000698 .L000005E8: movl %eax, (%esp) call PyString_AsString@PLT .L000005F0: testl %eax, %eax je .L00000698 .L000005F8: cmpl %esi, %ebp jae .L0000090C .L00000600: movl 20(%esp), %edi xorl %edx, %edx movl $0, 32(%esp) andl $1, %edi movl %edi, 24(%esp) jmp .L0000063C .L00000617: .p2align 3 .L00000618: cmpb $91, %cl je .L000006E0 .L00000621: cmpb $92, %cl jne .L00000654 .L00000626: movb $92, (%eax) addl $1, %ebp addl $1, %eax movl $1, %edx .L00000634: cmpl %ebp, %esi jbe .L0000090C .L0000063C: movzbl (%ebp), %ecx cmpb $40, %cl jne .L00000618 .L00000645: movl 24(%esp), %edi xorl $1, %edi cmpl %edi, %edx je .L00000798 .L00000654: movb %cl, (%eax) addl $1, %ebp addl $1, %eax xorl %edx, %edx jmp .L00000634 .L00000660: movl %edx, %eax movl %ebp, %edx movl %eax, %ebp .L00000666: subl $1, (%edx) je .L0000092B .L0000066F: testl %ebp, %ebp je .L0000067D .L00000673: subl $1, (%ebp) je .L00000939 .L0000067D: movl 56(%esp), %eax testl %eax, %eax je .L00000698 .L00000685: subl $1, (%eax) jne .L00000698 .L0000068A: movl 56(%esp), %eax movl 4(%eax), %edx movl %eax, (%esp) call *24(%edx) .L00000697: .p2align 3 .L00000698: movl 28(%esp), %edx movl (%edx), %eax movl %eax, 20(%esp) subl $1, %eax testl %eax, %eax movl %eax, (%edx) jne .L000006B8 .L000006AB: movl 28(%esp), %edx movl 4(%edx), %eax movl %edx, (%esp) call *24(%eax) .L000006B8: xorl %eax, %eax .L000006BA: movl 188(%esp), %edx xorl %gs:20, %edx jne .L00000926 .L000006CE: addl $204, %esp popl %ebx popl %esi popl %edi popl %ebp ret .L000006D9: .p2align 4 .L000006E0: testl %edx, %edx jne .L00000654 .L000006E8: movb $91, (%eax) movzbl 1(%ebp), %ecx leal 1(%ebp), %edi movl %edi, 20(%esp) leal 2(%eax), %edi movb %cl, 1(%eax) movl 20(%esp), %ecx cmpl %ecx, %esi jbe .L00000729 .L00000704: cmpb $93, 1(%ebp) jne .L00000719 .L0000070A: jmp .L000007CC .L0000070F: .p2align 3 .L00000710: cmpb $93, (%ecx) je .L000007C8 .L00000719: addl $1, %ecx movzbl (%ecx), %eax addl $1, %edi cmpl %esi, %ecx movb %al, -1(%edi) jne .L00000710 .L00000729: movl 56(%esp), %eax movl %eax, (%esp) call PyString_AsString@PLT .L00000735: testl %eax, %eax je .L00000851 .L0000073D: subl %eax, %edi leal 56(%esp), %eax movl %edi, 4(%esp) movl %eax, (%esp) call _PyString_Resize@PLT .L0000074F: movl 56(%esp), %esi testl %esi, %esi je .L00000698 .L0000075B: movl 28(%esp), %eax movl 52(%esp), %edx movl %eax, 4(%esp) movl 48(%esp), %eax movl %eax, (%esp) movl %esi, %eax call newregexobject .L00000775: subl $1, (%esi) jne .L000006BA .L0000077E: movl 4(%esi), %edx movl %eax, 20(%esp) movl %esi, (%esp) call *24(%edx) .L0000078B: movl 20(%esp), %eax jmp .L000006BA .L00000794: .p2align 3 .L00000798: leal 1(%eax), %edi movb $40, (%eax) leal 1(%ebp), %eax cmpl %eax, %esi movl %eax, 20(%esp) jbe .L00000729 .L000007A9: addl $1, 32(%esp) cmpb $60, 1(%ebp) je .L000007E4 .L000007B4: movl %edi, %eax movl 20(%esp), %ebp xorl %edx, %edx jmp .L0000063C .L000007C1: .p2align 3 .L000007C8: movl %ecx, 20(%esp) .L000007CC: movl 20(%esp), %ebp movl %edi, %eax addl $1, %ebp jmp .L00000634 .L000007DA: addl $1, (%edi) movl %edi, %esi jmp .L0000075B .L000007E4: leal 2(%ebp), %ecx cmpl %ecx, %esi jbe .L00000729 .L000007EF: movzbl 2(%ebp), %edx cmpb $62, %dl je .L000007B4 .L000007F8: movl %ecx, 44(%esp) movl %edx, 36(%esp) call __ctype_b_loc@PLT .L00000805: movl 36(%esp), %edx movl 44(%esp), %ecx movl %edi, 36(%esp) movl (%eax), %eax movl %eax, %ebp leal 60(%esp), %eax movl %eax, 40(%esp) jmp .L00000828 .L0000081F: .p2align 3 .L00000820: movzbl (%ecx), %edx cmpb $62, %dl je .L00000863 .L00000828: movzbl %dl, %edi testb $8, (%ebp,%edi,2) jne .L0000083B .L00000832: cmpb $95, %dl jne .L000008D5 .L0000083B: addl $1, %ecx addl $1, %eax cmpl %esi, %ecx movb %dl, -1(%eax) jne .L00000820 .L00000848: movl 36(%esp), %edi jmp .L00000729 .L00000851: movl 56(%esp), %edx subl $1, (%edx) jne .L00000698 .L0000085E: jmp .L0000068A .L00000863: movb $0, (%eax) movl 40(%esp), %eax movl %ecx, 44(%esp) movl 36(%esp), %edi movl %eax, (%esp) call PyString_FromString@PLT .L0000087A: movl %eax, %ebp movl 32(%esp), %eax movl %eax, (%esp) call PyInt_FromLong@PLT .L00000888: testl %eax, %eax movl %eax, %edx je .L00000913 .L00000892: testl %ebp, %ebp je .L00000913 .L00000896: movl %eax, 8(%esp) movl %eax, 20(%esp) movl 28(%esp), %eax movl %ebp, 4(%esp) movl %eax, (%esp) call PyDict_SetItem@PLT .L000008AE: movl 20(%esp), %edx movl 44(%esp), %ecx testl %eax, %eax jne .L00000660 .L000008BE: subl $1, (%ebp) je .L000008F1 .L000008C4: subl $1, (%edx) je .L000008DE .L000008C9: leal 1(%ecx), %ebp movl %edi, %eax xorl %edx, %edx jmp .L00000634 .L000008D5: movl 36(%esp), %edi jmp .L000007B4 .L000008DE: movl 4(%edx), %eax movl %ecx, 20(%esp) movl %edx, (%esp) call *24(%eax) .L000008EB: movl 20(%esp), %ecx jmp .L000008C9 .L000008F1: movl 4(%ebp), %eax movl %edx, 36(%esp) movl %ecx, 20(%esp) movl %ebp, (%esp) call *24(%eax) .L00000902: movl 36(%esp), %edx movl 20(%esp), %ecx jmp .L000008C4 .L0000090C: movl %eax, %edi jmp .L00000729 .L00000913: movl %edx, %eax movl %ebp, %edx testl %edx, %edx movl %eax, %ebp jne .L00000666 .L00000921: jmp .L0000066F .L00000926: call __stack_chk_fail_local .L0000092B: movl 4(%edx), %eax movl %edx, (%esp) call *24(%eax) .L00000934: jmp .L0000066F .L00000939: movl 4(%ebp), %eax movl %ebp, (%esp) call *24(%eax) .L00000942: jmp .L0000067D .size regex_symcomp, .-regex_symcomp # ---------------------- .L00000947: .p2align 4 # ---------------------- .local reg_dealloc .type reg_dealloc, @function reg_dealloc: pushl %esi pushl %ebx subl $20, %esp movl 32(%esp), %esi call __x86.get_pc_thunk.bx .L0000095E: addl $_GLOBAL_OFFSET_TABLE_, %ebx movl 8(%esi), %eax testl %eax, %eax je .L00000973 .L0000096B: movl %eax, (%esp) call free@PLT .L00000973: movl 1096(%esi), %eax testl %eax, %eax je .L0000098C .L0000097D: movl (%eax), %ecx leal -1(%ecx), %edx testl %edx, %edx movl %edx, (%eax) je .L00000A50 .L0000098C: movl 1100(%esi), %eax testl %eax, %eax je .L000009A5 .L00000996: movl (%eax), %ecx leal -1(%ecx), %edx testl %edx, %edx movl %edx, (%eax) je .L00000A38 .L000009A5: movl 1104(%esi), %eax testl %eax, %eax je .L000009BA .L000009AF: movl (%eax), %ecx leal -1(%ecx), %edx testl %edx, %edx movl %edx, (%eax) je .L00000A20 .L000009BA: movl 1108(%esi), %eax testl %eax, %eax je .L000009CF .L000009C4: movl (%eax), %ecx leal -1(%ecx), %edx testl %edx, %edx movl %edx, (%eax) je .L00000A08 .L000009CF: movl 1112(%esi), %eax testl %eax, %eax je .L000009F3 .L000009D9: movl (%eax), %ecx leal -1(%ecx), %edx testl %edx, %edx movl %edx, (%eax) jne .L000009F3 .L000009E4: movl 1112(%esi), %eax movl 4(%eax), %edx movl %eax, (%esp) call *24(%edx) .L000009F3: movl %esi, (%esp) call PyObject_Free@PLT .L000009FB: addl $20, %esp popl %ebx popl %esi ret .L00000A01: .p2align 3 .L00000A08: movl 1108(%esi), %eax movl 4(%eax), %edx movl %eax, (%esp) call *24(%edx) .L00000A17: jmp .L000009CF .L00000A19: .p2align 4 .L00000A20: movl 1104(%esi), %eax movl 4(%eax), %edx movl %eax, (%esp) call *24(%edx) .L00000A2F: jmp .L000009BA .L00000A31: .p2align 3 .L00000A38: movl 1100(%esi), %eax movl 4(%eax), %edx movl %eax, (%esp) call *24(%edx) .L00000A47: jmp .L000009A5 .L00000A4C: .p2align 3 .L00000A50: movl 1096(%esi), %eax movl 4(%eax), %edx movl %eax, (%esp) call *24(%edx) .L00000A5F: jmp .L0000098C .size reg_dealloc, .-reg_dealloc # ---------------------- .L00000A64: .p2align 4 # ---------------------- .local regobj_getattr .type regobj_getattr, @function regobj_getattr: pushl %ebp movl $5, %ecx pushl %edi pushl %esi pushl %ebx call __x86.get_pc_thunk.bx .L00000A7E: addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $28, %esp movl 52(%esp), %esi leal .LC11@GOTOFF(%ebx), %edi repz cmpsb jne .L00000B50 .L00000A99: movl 48(%esp), %eax movl 1100(%eax), %edx testl %edx, %edx je .L00000BD0 .L00000AAB: movl filler.9451@GOTOFF(%ebx), %eax testl %eax, %eax je .L00000C78 .L00000AB9: movl $100, (%esp) call PyTuple_New@PLT .L00000AC5: testl %eax, %eax movl %eax, %edi je .L00000B3F .L00000ACB: movl 48(%esp), %eax xorl %ebp, %ebp leal 40(%eax), %esi leal .LC12@GOTOFF(%ebx), %eax movl %eax, 12(%esp) jmp .L00000B11 .L00000AE0: cmpl $-1, %ecx jne .L00000B1E .L00000AE5: movl filler.9451@GOTOFF(%ebx), %eax addl $1, (%eax) .L00000AEE: movl %eax, 8(%esp) movl %ebp, 4(%esp) movl %edi, (%esp) call PyTuple_SetItem@PLT .L00000AFE: testl %eax, %eax js .L00000B36 .L00000B02: addl $1, %ebp addl $4, %esi cmpl $100, %ebp je .L00000C70 .L00000B11: movl 400(%esi), %eax movl (%esi), %ecx cmpl $-1, %eax je .L00000AE0 .L00000B1E: movl %eax, 8(%esp) movl 12(%esp), %eax movl %ecx, 4(%esp) movl %eax, (%esp) call Py_BuildValue@PLT .L00000B32: testl %eax, %eax jne .L00000AEE .L00000B36: subl $1, (%edi) je .L00000C10 .L00000B3F: xorl %eax, %eax .L00000B41: addl $28, %esp popl %ebx popl %esi popl %edi popl %ebp ret .L00000B49: .p2align 4 .L00000B50: movl 52(%esp), %esi leal .LC10@GOTOFF(%ebx), %ebp movl $5, %ecx movl %ebp, %edi repz cmpsb jne .L00000B88 .L00000B65: movl 48(%esp), %eax movl 1100(%eax), %eax testl %eax, %eax je .L00000BD0 .L00000B73: addl $1, (%eax) movl 48(%esp), %eax movl 1100(%eax), %eax .L00000B80: addl $28, %esp popl %ebx popl %esi popl %edi popl %ebp ret .L00000B88: movl 52(%esp), %esi movl $10, %ecx leal .LC13@GOTOFF(%ebx), %edi repz cmpsb je .L00000BE8 .L00000B9B: movl 52(%esp), %esi movl $11, %ecx leal .LC14@GOTOFF(%ebx), %edi repz cmpsb jne .L00000C20 .L00000BAE: movl 48(%esp), %eax movl 1104(%eax), %eax testl %eax, %eax je .L00000BD0 .L00000BBC: addl $1, (%eax) movl 48(%esp), %eax movl 1104(%eax), %eax jmp .L00000B80 .L00000BCB: .p2align 3 .L00000BD0: movl _Py_NoneStruct@GOT(%ebx), %eax addl $1, (%eax) addl $28, %esp popl %ebx popl %esi popl %edi popl %ebp ret .L00000BE1: .p2align 3 .L00000BE8: movl 48(%esp), %eax movl 1096(%eax), %eax testl %eax, %eax je .L00000BD0 .L00000BF6: addl $1, (%eax) movl 48(%esp), %eax movl 1096(%eax), %eax addl $28, %esp popl %ebx popl %esi popl %edi popl %ebp ret .L00000C0B: .p2align 3 .L00000C10: movl 4(%edi), %eax movl %edi, (%esp) call *24(%eax) .L00000C19: xorl %eax, %eax jmp .L00000B41 .L00000C20: movl 52(%esp), %esi movl $8, %ecx leal .LC15@GOTOFF(%ebx), %edi repz cmpsb je .L00000CB0 .L00000C33: movl 52(%esp), %esi movl $9, %ecx leal .LC16@GOTOFF(%ebx), %edi repz cmpsb jne .L00000CD4 .L00000C4A: movl 48(%esp), %eax movl 1108(%eax), %eax testl %eax, %eax je .L00000BD0 .L00000C5C: addl $1, (%eax) movl 48(%esp), %eax movl 1108(%eax), %eax jmp .L00000B80 .L00000C6E: .p2align 3 .L00000C70: movl %edi, %eax jmp .L00000B80 .L00000C77: .p2align 3 .L00000C78: leal .LC12@GOTOFF(%ebx), %eax movl $-1, 8(%esp) movl $-1, 4(%esp) movl %eax, (%esp) call Py_BuildValue@PLT .L00000C96: testl %eax, %eax movl %eax, filler.9451@GOTOFF(%ebx) jne .L00000AB9 .L00000CA4: xorl %eax, %eax jmp .L00000B41 .L00000CAB: .p2align 3 .L00000CB0: movl 48(%esp), %eax movl 1112(%eax), %eax testl %eax, %eax je .L00000BD0 .L00000CC2: addl $1, (%eax) movl 48(%esp), %eax movl 1112(%eax), %eax jmp .L00000B80 .L00000CD4: movl 52(%esp), %esi movl $12, %ecx leal .LC17@GOTOFF(%ebx), %edi repz cmpsb jne .L00000D45 .L00000CE7: movl $6, (%esp) call PyList_New@PLT .L00000CF3: testl %eax, %eax movl %eax, %edi je .L00000B3F .L00000CFD: xorl %esi, %esi jmp .L00000D32 .L00000D01: .p2align 3 .L00000D08: movl %eax, 8(%esp) movl %esi, 4(%esp) movl %edi, (%esp) call PyList_SetItem@PLT .L00000D18: testl %eax, %eax js .L00000B36 .L00000D20: addl $1, %esi movl members@GOTOFF(%ebx,%esi,4), %ebp testl %ebp, %ebp je .L00000C70 .L00000D32: movl %ebp, (%esp) call PyString_FromString@PLT .L00000D3A: testl %eax, %eax jne .L00000D08 .L00000D3E: .p2align 3 jmp .L00000B36 .L00000D45: movl 52(%esp), %eax movl %eax, 8(%esp) movl 48(%esp), %eax movl %eax, 4(%esp) leal reg_methods@GOTOFF(%ebx), %eax movl %eax, (%esp) call Py_FindMethod@PLT .L00000D63: jmp .L00000B80 .size regobj_getattr, .-regobj_getattr # ---------------------- .L00000D68: .p2align 4 # ---------------------- .local update_cache .type update_cache, @function update_cache: pushl %edi movl %eax, %edi pushl %esi pushl %ebx call __x86.get_pc_thunk.bx .L00000D7A: addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $48, %esp movl %eax, 4(%esp) movl $1, (%esp) call PyTuple_Pack@PLT .L00000D93: testl %eax, %eax movl %eax, %esi je .L00000EAC .L00000D9D: movl cache_pat@GOTOFF(%ebx), %eax cmpl %eax, %edi je .L00000EA8 .L00000DAB: testl %eax, %eax je .L00000DBE .L00000DAF: movl (%eax), %ecx leal -1(%ecx), %edx testl %edx, %edx movl %edx, (%eax) je .L00000E80 .L00000DBE: movl cache_prog@GOTOFF(%ebx), %eax movl $0, cache_pat@GOTOFF(%ebx) testl %eax, %eax je .L00000DE1 .L00000DD2: movl (%eax), %ecx leal -1(%ecx), %edx testl %edx, %edx movl %edx, (%eax) je .L00000E70 .L00000DE1: leal 44(%esp), %eax movl %eax, 12(%esp) leal 40(%esp), %eax movl %eax, 8(%esp) leal .LC18@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl %esi, (%esp) movl $0, 40(%esp) movl $0, 44(%esp) call PyArg_ParseTuple@PLT .L00000E13: testl %eax, %eax je .L00000E90 .L00000E17: movl 40(%esp), %eax movl 44(%esp), %edx movl $0, 4(%esp) movl %eax, (%esp) call newregexobject .L00000E2F: testl %eax, %eax movl %eax, cache_prog@GOTOFF(%ebx) je .L00000EB3 .L00000E39: addl $1, (%edi) xorl %eax, %eax movl %edi, cache_pat@GOTOFF(%ebx) .L00000E44: movl (%esi), %ecx leal -1(%ecx), %edx testl %edx, %edx movl %edx, (%esi) je .L00000E58 .L00000E4F: addl $48, %esp popl %ebx popl %esi popl %edi ret .L00000E56: .p2align 3 .L00000E58: movl 4(%esi), %edx movl %eax, 28(%esp) movl %esi, (%esp) call *24(%edx) .L00000E65: movl 28(%esp), %eax addl $48, %esp popl %ebx popl %esi popl %edi ret .L00000E70: movl 4(%eax), %edx movl %eax, (%esp) call *24(%edx) .L00000E79: jmp .L00000DE1 .L00000E7E: .p2align 3 .L00000E80: movl 4(%eax), %edx movl %eax, (%esp) call *24(%edx) .L00000E89: jmp .L00000DBE .L00000E8E: .p2align 3 .L00000E90: movl $0, cache_prog@GOTOFF(%ebx) movl $-1, %eax jmp .L00000E44 .L00000EA1: .p2align 3 .L00000EA8: xorl %eax, %eax jmp .L00000E44 .L00000EAC: movl $-1, %eax jmp .L00000E4F .L00000EB3: orl $-1, %eax jmp .L00000E44 .size update_cache, .-update_cache # ---------------------- .L00000EB8: .p2align 4 # ---------------------- .local regex_search .type regex_search, @function regex_search: pushl %esi pushl %ebx call __x86.get_pc_thunk.bx .L00000EC7: addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $52, %esp leal 44(%esp), %eax movl %eax, 12(%esp) leal 40(%esp), %eax movl %eax, 8(%esp) leal .LC19@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl 68(%esp), %eax movl %eax, (%esp) call PyArg_ParseTuple@PLT .L00000EF6: testl %eax, %eax je .L00000F48 .L00000EFA: movl 40(%esp), %eax call update_cache .L00000F03: testl %eax, %eax js .L00000F48 .L00000F07: movl 44(%esp), %eax movl %eax, 4(%esp) leal .LC20@GOTOFF(%ebx), %eax movl %eax, (%esp) call Py_BuildValue@PLT .L00000F1D: testl %eax, %eax movl %eax, %esi je .L00000F48 .L00000F23: movl %eax, 4(%esp) movl cache_prog@GOTOFF(%ebx), %eax movl %eax, (%esp) call regobj_search .L00000F35: movl (%esi), %ecx leal -1(%ecx), %edx testl %edx, %edx movl %edx, (%esi) je .L00000F50 .L00000F40: addl $52, %esp popl %ebx popl %esi ret .L00000F46: .p2align 3 .L00000F48: addl $52, %esp xorl %eax, %eax popl %ebx popl %esi ret .L00000F50: movl 4(%esi), %edx movl %eax, 28(%esp) movl %esi, (%esp) call *24(%edx) .L00000F5D: movl 28(%esp), %eax addl $52, %esp popl %ebx popl %esi ret .size regex_search, .-regex_search # ---------------------- .L00000F67: .p2align 4 # ---------------------- .local regex_match .type regex_match, @function regex_match: pushl %esi pushl %ebx call __x86.get_pc_thunk.bx .L00000F77: addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $52, %esp leal 44(%esp), %eax movl %eax, 12(%esp) leal 40(%esp), %eax movl %eax, 8(%esp) leal .LC21@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl 68(%esp), %eax movl %eax, (%esp) call PyArg_ParseTuple@PLT .L00000FA6: testl %eax, %eax je .L00000FF8 .L00000FAA: movl 40(%esp), %eax call update_cache .L00000FB3: testl %eax, %eax js .L00000FF8 .L00000FB7: movl 44(%esp), %eax movl %eax, 4(%esp) leal .LC20@GOTOFF(%ebx), %eax movl %eax, (%esp) call Py_BuildValue@PLT .L00000FCD: testl %eax, %eax movl %eax, %esi je .L00000FF8 .L00000FD3: movl %eax, 4(%esp) movl cache_prog@GOTOFF(%ebx), %eax movl %eax, (%esp) call regobj_match .L00000FE5: movl (%esi), %ecx leal -1(%ecx), %edx testl %edx, %edx movl %edx, (%esi) je .L00001000 .L00000FF0: addl $52, %esp popl %ebx popl %esi ret .L00000FF6: .p2align 3 .L00000FF8: addl $52, %esp xorl %eax, %eax popl %ebx popl %esi ret .L00001000: movl 4(%esi), %edx movl %eax, 28(%esp) movl %esi, (%esp) call *24(%edx) .L0000100D: movl 28(%esp), %eax addl $52, %esp popl %ebx popl %esi ret .size regex_match, .-regex_match # ---------------------- .L00001017: .p2align 4 # ---------------------- .local regobj_group .type regobj_group, @function regobj_group: pushl %ebp pushl %edi pushl %esi pushl %ebx subl $44, %esp call __x86.get_pc_thunk.bx .L0000102C: addl $_GLOBAL_OFFSET_TABLE_, %ebx movl 68(%esp), %eax movl 64(%esp), %edi movl %eax, (%esp) call PyTuple_Size@PLT .L00001042: testl %eax, %eax movl %eax, 20(%esp) js .L000011C8 .L0000104E: je .L0000130B .L00001054: cmpl $1, 20(%esp) je .L000011D8 .L0000105F: movl 20(%esp), %eax movl %eax, (%esp) call PyTuple_New@PLT .L0000106B: testl %eax, %eax movl %eax, 24(%esp) je .L000011C8 .L00001077: xorl %esi, %esi jmp .L000010B2 .L0000107B: .p2align 3 .L00001080: movl _Py_NoneStruct@GOT(%ebx), %eax addl $1, (%eax) .L00001089: movl %eax, 8(%esp) movl 24(%esp), %eax movl %esi, 4(%esp) movl %eax, (%esp) call PyTuple_SetItem@PLT .L0000109D: testl %eax, %eax js .L000011B1 .L000010A5: addl $1, %esi cmpl %esi, 20(%esp) jle .L000012B0 .L000010B2: movl 68(%esp), %eax movl %esi, 4(%esp) movl %eax, (%esp) call PyTuple_GetItem@PLT .L000010C2: testl %eax, %eax movl %eax, %ebp je .L000011B1 .L000010CC: movl 4(%eax), %eax cmpl PyString_Type@GOT(%ebx), %eax je .L000010ED .L000010D7: movl PyString_Type@GOT(%ebx), %ecx movl %eax, (%esp) movl %ecx, 4(%esp) call PyType_IsSubtype@PLT .L000010E9: testl %eax, %eax je .L00001111 .L000010ED: movl 1104(%edi), %eax testl %eax, %eax je .L00001290 .L000010FB: movl %ebp, 4(%esp) movl %eax, (%esp) call PyDict_GetItem@PLT .L00001107: testl %eax, %eax movl %eax, %ebp je .L00001290 .L00001111: movl %ebp, (%esp) call PyInt_AsLong@PLT .L00001119: cmpl $-1, %eax movl %eax, %edx je .L00001188 .L00001120: cmpl $99, %eax ja .L00001199 .L00001125: movl 1100(%edi), %eax testl %eax, %eax je .L000012EE .L00001133: leal (%edi,%edx,4), %edx movl 440(%edx), %ecx movl 40(%edx), %ebp testl %ecx, %ecx js .L00001080 .L00001147: movl %ebp, %edx shrl $31, %edx testb %dl, %dl jne .L00001080 .L00001154: movl %eax, (%esp) movl %ecx, 28(%esp) call PyString_AsString@PLT .L00001160: testl %eax, %eax je .L000011B1 .L00001164: movl 28(%esp), %ecx subl %ebp, %ecx addl %eax, %ebp movl %ecx, 4(%esp) movl %ebp, (%esp) call PyString_FromStringAndSize@PLT .L00001178: testl %eax, %eax jne .L00001089 .L00001180: jmp .L000011B1 .L00001182: .p2align 3 .L00001188: .p2align 4 call PyErr_Occurred@PLT .L00001195: testl %eax, %eax jne .L000011B1 .L00001199: leal .LC24@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl RegexError@GOTOFF(%ebx), %eax movl %eax, (%esp) call PyErr_SetString@PLT .L000011B1: movl 24(%esp), %edi movl (%edi), %eax movl %eax, 20(%esp) subl $1, %eax testl %eax, %eax movl %eax, (%edi) je .L00001280 .L000011C8: xorl %eax, %eax .L000011CA: addl $44, %esp popl %ebx popl %esi popl %edi popl %ebp ret .L000011D2: .p2align 3 .L000011D8: movl 68(%esp), %eax movl $0, 4(%esp) movl %eax, (%esp) call PyTuple_GetItem@PLT .L000011EC: testl %eax, %eax movl %eax, %esi je .L000011C8 .L000011F2: movl 4(%eax), %eax movl PyString_Type@GOT(%ebx), %edx cmpl %edx, %eax je .L0000120F .L000011FF: movl %edx, 4(%esp) movl %eax, (%esp) call PyType_IsSubtype@PLT .L0000120B: testl %eax, %eax je .L00001233 .L0000120F: movl 1104(%edi), %eax testl %eax, %eax je .L00001356 .L0000121D: movl %esi, 4(%esp) movl %eax, (%esp) call PyDict_GetItem@PLT .L00001229: testl %eax, %eax movl %eax, %esi je .L00001356 .L00001233: movl %esi, (%esp) call PyInt_AsLong@PLT .L0000123B: cmpl $-1, %eax movl %eax, %edx je .L0000132A .L00001246: cmpl $99, %eax ja .L00001337 .L0000124F: movl 1100(%edi), %eax testl %eax, %eax je .L0000135E .L0000125D: leal (%edi,%edx,4), %edx movl 440(%edx), %edi movl 40(%edx), %esi testl %edi, %edi jns .L000012C0 .L0000126D: movl _Py_NoneStruct@GOT(%ebx), %eax addl $1, (%eax) addl $44, %esp popl %ebx popl %esi popl %edi popl %ebp ret .L0000127E: .p2align 3 .L00001280: movl 4(%edi), %eax movl %edi, (%esp) call *24(%eax) .L00001289: jmp .L000011C8 .L0000128E: .p2align 3 .L00001290: leal .LC23@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl RegexError@GOTOFF(%ebx), %eax movl %eax, (%esp) call PyErr_SetString@PLT .L000012A8: jmp .L000011B1 .L000012AD: .p2align 3 .L000012B0: movl 24(%esp), %eax addl $44, %esp popl %ebx popl %esi popl %edi popl %ebp ret .L000012BC: .p2align 3 .L000012C0: movl %esi, %edx shrl $31, %edx testb %dl, %dl jne .L0000126D .L000012C9: movl %eax, (%esp) call PyString_AsString@PLT .L000012D1: testl %eax, %eax je .L000011C8 .L000012D9: subl %esi, %edi addl %esi, %eax movl %edi, 4(%esp) movl %eax, (%esp) call PyString_FromStringAndSize@PLT .L000012E9: jmp .L000011CA .L000012EE: leal .LC25@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl RegexError@GOTOFF(%ebx), %eax movl %eax, (%esp) call PyErr_SetString@PLT .L00001306: jmp .L000011B1 .L0000130B: leal .LC22@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl PyExc_TypeError@GOT(%ebx), %eax movl (%eax), %eax movl %eax, (%esp) call PyErr_SetString@PLT .L00001325: jmp .L000011C8 .L0000132A: call PyErr_Occurred@PLT .L0000132F: testl %eax, %eax jne .L000011C8 .L00001337: leal .LC24@GOTOFF(%ebx), %eax .L0000133D: movl %eax, 4(%esp) movl RegexError@GOTOFF(%ebx), %eax movl %eax, (%esp) call PyErr_SetString@PLT .L0000134F: xorl %eax, %eax jmp .L000011CA .L00001356: leal .LC23@GOTOFF(%ebx), %eax jmp .L0000133D .L0000135E: leal .LC25@GOTOFF(%ebx), %edx movl %edx, 4(%esp) movl RegexError@GOTOFF(%ebx), %edx movl %eax, 20(%esp) movl %edx, (%esp) call PyErr_SetString@PLT .L0000137A: movl 20(%esp), %eax jmp .L000011CA .size regobj_group, .-regobj_group # ---------------------- .L00001383: .p2align 4 # ---------------------- .local regex_compile .type regex_compile, @function regex_compile: pushl %ebp xorl %ebp, %ebp pushl %edi pushl %esi pushl %ebx call __x86.get_pc_thunk.bx .L0000139B: addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $60, %esp leal 36(%esp), %eax movl %eax, 12(%esp) leal 32(%esp), %eax movl %eax, 8(%esp) movl $0, 32(%esp) movl $0, 36(%esp) leal .LC18@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl 84(%esp), %eax movl %eax, (%esp) call PyArg_ParseTuple@PLT .L000013DA: testl %eax, %eax je .L000014EE .L000013E2: movl 32(%esp), %esi leal 44(%esp), %eax movl %eax, 12(%esp) leal 40(%esp), %eax movl 36(%esp), %edi movl %eax, 8(%esp) leal .LC6@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl %esi, (%esp) call PyArg_Parse@PLT .L0000140C: testl %eax, %eax je .L000014EC .L00001414: testl %edi, %edi je .L0000142B .L00001418: movl %edi, (%esp) call PyString_Size@PLT .L00001420: cmpl $256, %eax jne .L00001518 .L0000142B: leal Regextype@GOTOFF(%ebx), %eax movl %eax, (%esp) call _PyObject_New@PLT .L00001439: testl %eax, %eax movl %eax, %edx je .L000014EC .L00001443: movl $0, 8(%eax) testl %edi, %edi movl $0, 12(%eax) leal 840(%eax), %eax movl %eax, 20(%edx) je .L000014F8 .L00001462: movl %edi, (%esp) movl %edx, 28(%esp) call PyString_AsString@PLT .L0000146E: movl 28(%esp), %edx testl %eax, %eax movl %eax, 24(%edx) je .L000014E7 .L00001479: addl $1, (%edi) .L0000147C: leal 8(%edx), %eax movl %edi, 1096(%edx) movl $0, 1100(%edx) movl $0, 1104(%edx) addl $1, (%esi) movl %esi, 1112(%edx) addl $1, (%esi) movl %esi, 1108(%edx) movl %eax, 8(%esp) movl 44(%esp), %eax movl %edx, 28(%esp) movl %eax, 4(%esp) movl 40(%esp), %eax movl %eax, (%esp) call _Py_re_compile_pattern@PLT .L000014C7: movl 28(%esp), %edx movl %edx, %ebp testl %eax, %eax je .L000014EE .L000014D1: movl %eax, 4(%esp) movl RegexError@GOTOFF(%ebx), %eax movl %eax, (%esp) call PyErr_SetString@PLT .L000014E3: movl 28(%esp), %edx .L000014E7: subl $1, (%edx) je .L00001508 .L000014EC: xorl %ebp, %ebp .L000014EE: addl $60, %esp movl %ebp, %eax popl %ebx popl %esi popl %edi popl %ebp ret .L000014F8: movl $0, 24(%edx) jmp .L0000147C .L00001504: .p2align 3 .L00001508: movl 4(%edx), %eax xorl %ebp, %ebp movl %edx, (%esp) call *24(%eax) .L00001513: jmp .L000014EE .L00001515: .p2align 3 .L00001518: leal .LC8@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl RegexError@GOTOFF(%ebx), %eax movl %eax, (%esp) call PyErr_SetString@PLT .L00001530: jmp .L000014EE .size regex_compile, .-regex_compile # ---------------------- .L00001532: .p2align 4 # ---------------------- .globl initregex .type initregex, @function initregex: pushl %ebp pushl %edi pushl %esi pushl %ebx call __x86.get_pc_thunk.bx .L00001549: addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $44, %esp movl $1012, 16(%esp) movl $0, 12(%esp) movl $0, 8(%esp) movl PyType_Type@GOT(%ebx), %eax movl %eax, Regextype@GOTOFF+4(%ebx) leal regex_global_methods@GOTOFF(%ebx), %eax movl %eax, 4(%esp) leal .LC26@GOTOFF(%ebx), %eax movl %eax, (%esp) call Py_InitModule4@PLT .L0000158E: testl %eax, %eax je .L00001600 .L00001592: movl %eax, (%esp) call PyModule_GetDict@PLT .L0000159A: movl %eax, 24(%esp) movl %eax, %edi leal .LC27@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl PyExc_DeprecationWarning@GOT(%ebx), %eax movl (%eax), %eax movl %eax, (%esp) call PyErr_Warn@PLT .L000015BA: testl %eax, %eax js .L00001600 .L000015BE: leal .LC28@GOTOFF(%ebx), %eax movl $0, 8(%esp) movl $0, 4(%esp) movl %eax, (%esp) call PyErr_NewException@PLT .L000015DC: testl %eax, %eax movl %eax, RegexError@GOTOFF(%ebx) je .L00001600 .L000015E6: movl %eax, 8(%esp) leal .LC29@GOTOFF(%ebx), %eax movl %eax, 4(%esp) movl %edi, (%esp) call PyDict_SetItemString@PLT .L000015FC: testl %eax, %eax je .L00001608 .L00001600: addl $44, %esp popl %ebx popl %esi popl %edi popl %ebp ret .L00001608: movl $256, 4(%esp) movl $0, (%esp) call PyString_FromStringAndSize@PLT .L0000161C: testl %eax, %eax movl %eax, 28(%esp) je .L00001600 .L00001624: movl %eax, (%esp) call PyString_AsString@PLT .L0000162C: testl %eax, %eax movl %eax, %edi je .L00001600 .L00001632: call __ctype_b_loc@PLT .L00001637: xorl %esi, %esi movl %eax, %ebp jmp .L00001658 .L0000163D: .p2align 3 .L00001640: call __ctype_tolower_loc@PLT .L00001645: movl (%eax), %eax movl (%eax,%esi,4), %eax movb %al, (%edi,%esi) addl $1, %esi cmpl $256, %esi je .L00001672 .L00001658: movl (%ebp), %eax testb $1, 1(%eax,%esi,2) jne .L00001640 .L00001662: movl %esi, %eax movb %al, (%edi,%esi) addl $1, %esi cmpl $256, %esi jne .L00001658 .L00001672: leal .LC30@GOTOFF(%ebx), %eax movl 28(%esp), %edi movl %eax, 4(%esp) movl 24(%esp), %eax movl %edi, 8(%esp) movl %eax, (%esp) call PyDict_SetItemString@PLT .L00001690: testl %eax, %eax js .L00001600 .L00001698: movl (%edi), %eax movl %eax, 24(%esp) subl $1, %eax testl %eax, %eax movl %eax, (%edi) je .L000016B1 .L000016A7: call PyErr_Occurred@PLT .L000016AC: jmp .L00001600 .L000016B1: movl 28(%esp), %ecx movl 4(%ecx), %eax movl %ecx, (%esp) call *24(%eax) .L000016BE: jmp .L000016A7 .size initregex, .-initregex # ---------------------- .local filler.9451 .comm filler.9451,4,4 # ---------------------- .local cache_prog .comm cache_prog,4,4 # ---------------------- .local cache_pat .comm cache_pat,4,4 # ---------------------- .local RegexError .comm RegexError,4,4 # ---------------------- .hidden __stack_chk_fail_local .ident "GCC: (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4" .section .note.GNU-stack,"",@progbits
programs/oeis/042/A042970.asm
neoneye/loda
22
4250
; A042970: a(n) = binomial(n, floor(n/2)) mod n. ; 0,0,0,2,0,2,0,6,0,2,0,0,0,2,0,6,0,2,0,16,0,2,0,4,0,2,0,20,0,0,0,6,0,2,0,24,0,2,0,20,0,6,0,28,0,2,0,12,0,2,0,32,0,20,0,0,0,2,0,4,0,2,0,6,0,42,0,40,0,42,0,52,0,2,0,44,0,20,0,20,0,2,0,0,0,2,0,48,0,0,0,52,0,2,0,60,0,2,0,56 mov $1,$0 add $1,1 dif $1,2 bin $0,$1 mod $0,$1 mul $0,2
src/third_party/nasm/test/elif.asm
Mr-Sheep/naiveproxy
2,219
161776
;Testname=unoptimized; Arguments=-O0 -fobj -oelif.obj; Files=stdout stderr elif.obj ;Testname=optimized; Arguments=-Ox -fobj -oelif.obj; Files=stdout stderr elif.obj %macro DosPrintMsg 1+ %ifnid %1 section .data %%str_to_print:db %1 section .text mov dx,%%str_to_print mov ah,9 int 0x21 %else mov dx,(%1) mov ah,9 int 0x21 %endif %endmacro %macro DosExit 1 %if (%1) == 0 ;use short-form return 0 exit int 0x20 %elif ((%1) < 256) && ((%1) > 0) mov ax,0x4C00 | (%1) int 0x21 %else %error Invalid return value %endif %endmacro org 0x100 DosPrintMsg predefined_str DosPrintMsg "Using string with macro-defined label",10,0 DosExit 0 DosExit 1 DosExit 256 section .data predefined_str:db "Using string with predefined label",10,0
Base/Change/Equivalence/Base.agda
inc-lc/ilc-agda
10
11778
------------------------------------------------------------------------ -- INCREMENTAL λ-CALCULUS -- -- Delta-observational equivalence - base definitions ------------------------------------------------------------------------ module Base.Change.Equivalence.Base where open import Relation.Binary.PropositionalEquality open import Base.Change.Algebra open import Function module _ {a} {A : Set a} {{ca : ChangeAlgebra A}} {x : A} where -- Delta-observational equivalence: these asserts that two changes -- give the same result when applied to a base value. -- To avoid unification problems, use a one-field record (a Haskell "newtype") -- instead of a "type synonym". record _≙_ (dx dy : Δ x) : Set a where -- doe = Delta-Observational Equivalence. constructor doe field proof : x ⊞ dx ≡ x ⊞ dy open _≙_ public -- Same priority as ≡ infix 4 _≙_ open import Relation.Binary -- _≙_ is indeed an equivalence relation: ≙-refl : ∀ {dx} → dx ≙ dx ≙-refl = doe refl ≙-sym : ∀ {dx dy} → dx ≙ dy → dy ≙ dx ≙-sym ≙ = doe $ sym $ proof ≙ ≙-trans : ∀ {dx dy dz} → dx ≙ dy → dy ≙ dz → dx ≙ dz ≙-trans ≙₁ ≙₂ = doe $ trans (proof ≙₁) (proof ≙₂) -- That's standard congruence applied to ≙ ≙-cong : ∀ {b} {B : Set b} (f : A → B) {dx dy} → dx ≙ dy → f (x ⊞ dx) ≡ f (x ⊞ dy) ≙-cong f da≙db = cong f $ proof da≙db ≙-isEquivalence : IsEquivalence (_≙_) ≙-isEquivalence = record { refl = ≙-refl ; sym = ≙-sym ; trans = ≙-trans } ≙-setoid : Setoid a a ≙-setoid = record { Carrier = Δ x ; _≈_ = _≙_ ; isEquivalence = ≙-isEquivalence } ≙-syntax : ∀ {a} {A : Set a} {{ca : ChangeAlgebra A}} (x : A) (dx₁ dx₂ : Δ x) → Set a ≙-syntax x dx₁ dx₂ = _≙_ {x = x} dx₁ dx₂ syntax ≙-syntax x dx₁ dx₂ = dx₁ ≙₍ x ₎ dx₂
src/sockets-can.ads
glencornell/ada-socketcan
2
4514
-- MIT License -- -- Copyright (c) 2021 <NAME> <<EMAIL>> -- -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to deal -- in the Software without restriction, including without limitation the rights -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in all -- copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- SOFTWARE. -- SETUP: -- -- The Linux kernel must be compiled with support for SocketCAN -- ("can" and "can_raw" modules) with a driver for your specific CAN -- controller interface. There is a virtual CAN driver for testing -- purposes which can be loaded and created in Linux with the -- commands below. -- -- $ modprobe can -- $ modprobe can_raw -- $ modprobe vcan -- $ sudo ip link add dev vcan0 type vcan -- $ sudo ip link set up vcan0 -- $ ip link show vcan0 -- 3: vcan0: <NOARP,UP,LOWER_UP> mtu 16 qdisc noqueue state UNKNOWN -- link/can -- -- EXAMPLES: -- -- The following code snippet is a working example of the SocketCAN -- API that sends a packet using the raw interface. It is based on -- the notes documented in the Linux Kernel. -- -- with Gnat.Sockets; -- with Sockets.Can; -- with Sockets.Can_Frame; -- procedure Socketcan_Test is -- Socket : Sockets.Can.Socket_Type; -- Address : Sockets.Can.Sock_Addr_Type; -- Frame : Sockets.Can_Frame.Can_Frame; -- begin -- Sockets.Can.Create_Socket(Socket); -- Address.If_Index := Sockets.Can.If_Name_To_Index("vcan0"); -- Sockets.Can.Bind_Socket(Socket, Address); -- frame.can_id := 16#123#; -- frame.can_dlc := 2; -- frame.Data(0) := 16#11#; -- frame.Data(1) := 16#22#; -- Sockets.Can.Send_Socket(Socket, Frame); -- end Socketcan_Test; -- -- The packet can be analyzed on the vcan0 interface using the -- candump utility which is part of the SocketCAN can-utils package. -- On another shell, type the following command to view the output of -- the program ablve. -- -- $ candump vcan0 -- vcan0 123 [2] 11 22 with Ada.Streams; with Gnat.Sockets; with Sockets.Can_Frame; package Sockets.Can is subtype Socket_Type is Gnat.Sockets.Socket_Type; -- Sockets are used to implement a reliable bi-directional -- point-to-point, datagram-based connection between -- hosts. subtype Request_Flag_Type is Gnat.Sockets.Request_Flag_Type; No_Request_Flag : constant Request_Flag_Type := Gnat.Sockets.No_Request_Flag; Socket_Error : exception; -- There is only one exception in this package to deal with an error during -- a socket routine. Once raised, its message contains a string describing -- the error code. type Family_Type is (Family_Can); -- Address family (or protocol family) identifies the -- communication domain and groups protocols with similar address -- formats. This is represented as the "domain" parameter in the -- socket(2) man page. type Mode_Type is (Socket_Dgram, Socket_Raw); type Protocol_Type is (Can_Raw, Can_Bcm); type Sock_Addr_Type (Family : Family_Type := Family_Can) is record case Family is when Family_Can => If_Index : Natural := 0; end case; end record; -- Socket addresses fully define a socket connection with protocol family, -- an Internet address and a port. -- CAN ID based filter in can_register(). -- Description: -- A filter matches, when -- -- <received_can_id> & mask == can_id & mask -- -- The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can -- filter for error message frames (CAN_ERR_FLAG bit set in mask). type Can_Filter is record Can_Id : aliased Can_Frame.Can_Id_Type; -- relevant bits of CAN ID which are not masked out. Can_Mask : aliased Can_Frame.Can_Id_Type; -- CAN mask (see description) end record; type Can_Filter_Array_Type is array (Positive range <>) of Can_Filter; function If_Name_To_Index (If_Name : String) return Natural; -- Return the index for the given interface name. Raises -- Socket_Error on error. procedure Create_Socket (Socket : out Socket_Type; Family : in Family_Type := Family_Can; Mode : in Mode_Type := Socket_Raw; Protocol : in Protocol_Type := Can_Raw); -- Create an endpoint for communication. Raises Socket_Error on error procedure Bind_Socket (Socket : Socket_Type; Address : Sock_Addr_Type); -- Once a socket is created, assign a local address to it. Raise -- Socket_Error on error. procedure Connect_Socket (Socket : Socket_Type; Address : Sock_Addr_Type); -- Connect to a SOCK_DGRAM CAN socket. Raise Socket_Error on -- error. function Open (If_Name : String) return Socket_Type; -- Convenience routine to create a socket and bind to a named -- interface (eg: "can0"). This is the same as the following code -- segment: -- Sockets.Can.Create_Socket(Socket); -- Address.If_Index := Sockets.Can.If_Name_To_Index("vcan0"); -- Sockets.Can.Bind_Socket(Socket, Address); -- return Socket; procedure Receive_Socket (Socket : Socket_Type; Item : out Sockets.Can_Frame.Can_Frame); -- Convenience routine to receive a raw CAN frame from -- Socket. Raise Socket_Error on error. procedure Send_Socket (Socket : Socket_Type; Item : Sockets.Can_Frame.Can_Frame); -- Convenience routine to transmit a raw CAN frame over a socket. -- Raises Socket_Error on any detected error condition. procedure Apply_Filters (Socket : Socket_Type; Filters : Can_Filter_Array_Type; Are_Can_Fd_Frames_Enabled : Boolean := False); -- Ask the kernel to filter inbound CAN packets on a given socket -- (family_can, socket_raw) according to the supplied list. -- Additionally, tell the kernel that you want to receive CAN FD -- frames that match the given filters. type Can_Stream is new Ada.Streams.Root_Stream_Type with private; procedure Create_Stream (Stream : in out Can_Stream; Socket : Socket_Type); -- Initialize the stream to the created socket. procedure Open (Stream : in out Can_Stream; If_Name : in String); -- Convenience routine to open a socketcan socket, bind to the raw -- interface and create a can_stream object. procedure Read (Stream : in out Can_Stream; Item : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset); -- Read data from the stream procedure Write (Stream : in out Can_Stream; Item : Ada.Streams.Stream_Element_Array); -- Write data to the stream procedure Flush_Read (Stream : in out Can_Stream); -- Reset the read buffer procedure Flush_Write (Stream : in out Can_Stream); -- Send anything in the write buffer and reset it. If the write -- buffer is empty, then no message is written to the CAN -- interface. procedure Raise_Socket_Error (Error : Integer); -- Raise Socket_Error with an exception message describing the -- error code from errno. function Err_Code_Image (E : Integer) return String; -- Return the value of E surrounded with brackets private pragma No_Component_Reordering (Sock_Addr_Type); pragma Convention (C_Pass_By_Copy, Can_Filter); pragma Convention (C, Can_Filter_Array_Type); use type Ada.Streams.Stream_Element_Offset; Sizeof_Frame : constant Ada.Streams.Stream_Element_Offset := (Sockets.Can_Frame.Can_Frame'Size + 7) / 8; Read_Buffer_First : constant Ada.Streams.Stream_Element_Offset := 1; Read_Buffer_Last : constant Ada.Streams.Stream_Element_Offset := Sizeof_Frame; Write_Buffer_First : constant Ada.Streams.Stream_Element_Offset := 1; Write_Buffer_Last : constant Ada.Streams.Stream_Element_Offset := Sizeof_Frame; -- Read_Buffer_End is a sentinel one stream element beyond the -- last element in the buffer, when the read_offset is set to -- this, then the read_buffer is empty and we need to read another -- CAN frame. Read_Buffer_End : constant Ada.Streams.Stream_Element_Offset := Read_Buffer_Last + 1; type Can_Stream is new Ada.Streams.Root_Stream_Type with record Socket : Socket_Type := Gnat.Sockets.No_Socket; Read_Buffer : aliased Ada.Streams.Stream_Element_Array (Read_Buffer_First .. Read_Buffer_Last); Read_Offset : Ada.Streams.Stream_Element_Offset := Read_Buffer_End; Write_Buffer : aliased Ada.Streams.Stream_Element_Array (Write_Buffer_First .. Write_Buffer_Last); Write_Offset : Ada.Streams.Stream_Element_Offset := Write_Buffer_First; end record; end Sockets.Can;
libsrc/stdio/ansi/f_ansi.asm
Frodevan/z88dk
38
18923
<reponame>Frodevan/z88dk ; ; Z80 ANSI Library ; ;--------------------------------------------------- ; ANSI specifics handling. ; (Intel 8086 to Z80 port) ; ; Optimized for speed in the case of multi-character write requests. ; Original NANSI terminal driver (C) 1986 <NAME> - http://www.kegel.com ; Modifications by <NAME> without restrictions. ; ; - Port to Z80 and some improvement by <NAME> - 21/4/2000 ; - Small fix on the "set cursor position" range checks - 21/11/2002 ; ; MISSING or surely buggy Escapes: ; I - Cursor up and scroll down if on top ; L - Insert lines: to be completed ; M - Delete lines: to be completed ; ; ; $Id: f_ansi.asm,v 1.15 2016-04-04 18:31:22 dom Exp $ ; SECTION code_clib PUBLIC f_ansi EXTERN ansi_putc EXTERN ansi_attr EXTERN ansi_CHAR EXTERN ansi_cls EXTERN ansi_LF EXTERN ansi_DSR6 EXTERN ansi_BEL EXTERN ansi_del_line EXTERN __console_w EXTERN __console_h EXTERN __console_x EXTERN __console_y ;--------------------------------------------------- ; Fire out all the buffer (pointed by HL; len DE) ;--------------------------------------------------- .f_ansi ld a,d or e ret z .show ; **** Link to ANSI engine **** ld bc,(escvector) ld a,b or c jp nz,f_in_escape ld a,(hl) inc hl dec de cp 27 jp z,f_escape ; Hide the following two lines to disable CSI. cp 155 ;h9b ;CSI? jp z,f_9b ; ***************************** ;------------------------ cp 12 ; Form Feed (CLS) ? ;------------------------ jr nz,noFF call docls jr loopn .noFF ;------------------------ ; cp 13 ; CR? ;------------------------ ; jr nz,NoCR ; ld a,(__console_x) ; xor a ; ld (__console_x),a ; jr loopn ;.NoCR ;------------------------ ; Temporary (?) patch. ; CR becomes CR+LF ;------------------------ cp 13 jr z,isLF ;------------------------ cp 10 ; LF? jr nz,NoLF ;------------------------ .isLF ;------------------------ ; push hl push de call ansi_LF pop de pop hl jr loopn .NoLF cp 9 ; TAB? jr nz,NoTAB push hl push de ld a,(__console_x) rra rra inc a rla rla push hl ld hl,__console_w cp (hl) pop hl jp p,OutTAB ld (__console_x),a .OutTAB pop de pop hl jr loopn .NoTAB ;------------------------ cp 7 ; BEL? ;------------------------ jr nz,NoBEL push hl push de call ansi_BEL pop de pop hl jr loopn .NoBEL ;------------------------ cp 8 ; BackSpace ;------------------------ jr nz,NoBS ld a,(__console_x) and a jr z,firstc ; are we in the first column? dec a ld (__console_x),a jr loopn .firstc ld a,(__console_y) and a jr z,loopn dec a ld (__console_y),a ld a,(__console_w) dec a ld (__console_x),a jr loopn .NoBS ; **** Link to ANSI engine **** .f_not_ANSI ; push hl push de call ansi_putc pop de pop hl .loopn ld a,d or e jp nz,show .f_loopdone ret ; ***************************** ;------------------------------------------------ ; Clear screen and set text position to HOME ;------------------------------------------------ .docls push hl push de push bc call ansi_cls xor a ; HOME cursor ld (__console_y),a ld (__console_x),a pop bc pop de pop hl ret ; A state machine implementation of the mechanics of ANSI terminal control ; string parsing. ; ; Entered with a jump to f_escape when driver finds an escape, or ; to f_in_escape when the last string written to this device ended in the ; middle of an escape sequence. ; ; Exits by jumping to f_ANSI_exit when an escape sequence ends, or ; to f_not_ANSI when a bad escape sequence is found, or (after saving state) ; to f_loopdone when the write ends in the middle of an escape sequence. ; ; Parameters are stored as bytes in param_buffer. If a parameter is ; omitted, it is stored as zero. Each character in a keyboard reassignment ; command counts as one parameter. ; ; When a complete escape sequence has been parsed, the address of the ; ANSI routine to call is found in ansi_fn_table. ; ; Register usage during parsing: ; HL points to the incoming string. ; DE holds the length remaining in the incoming string. ; BC is the (incrementing) pointer to param_buffer .f_ANSI_exit ld bc,0 ld (escvector), bc jp loopn ;----- f_in_escape --------------------------------------------------- ; Main loop noticed that escvector was not zero. ; Recall value of BC saved when sleep was jumped to, and jump into parser. .f_in_escape ld bc, (escvector) push bc ld bc, (cur_parm_ptr) ret ;----- syntax_error --------------------------------------- ; A character was rejected by the state machine. Exit to ; main loop, and print offending character. Let main loop ; decrement DE (length of input string). .syntax_error ld bc,0 ld (escvector), bc jp f_not_ANSI ; exit, print offending char ;----- f_escape ------------------------------------------------------ ; We found an escape. Next character should be a left bracket. .f_escape ; next_is f_bracket ld a,d or e jr nz, f_bracket ld bc, f_bracket ld (escvector), bc jp f_loopdone ;----- f_bracket ----------------------------------------------------- ; Last char was an escape. This one should be a [; if not, print it. ; Next char should begin a parameter string. .f_bracket ld a, (hl) inc hl dec de cp '[' jr nz, syntax_error .f_9b ; Entry for CSI. (Eq. ESC[) ; Set up for getting a parameter string. ld bc, param_buffer xor a ; zero ld (bc), a ; default first char dec bc ; point buffer before start ld (eat_key), a ; no eaten key ; next_is f_get_args ld a,d or e jr nz, f_get_args ld (cur_parm_ptr), bc ld bc, f_get_args ld (escvector), bc jp f_loopdone ;----- f_get_args --------------------------------------------------- ; Last char was a [. If the current char is a '=' or a '?', save ; it for SET/RESET MODE, and then proceed to f_get_param. .f_get_args ld a,(hl) inc hl dec de cp '=' jr z, fga_ignore cp '?' jr nz, get_param_B .fga_ignore ld (eat_key), a ; save = or ? ; next_is f_get_param ld a,d or e jr nz, f_get_param ld (cur_parm_ptr), bc ld bc, f_get_param ld (escvector), bc jp f_loopdone ;----- f_get_param --------------------------------------------------- ; Last char was one of the four characters "]?=;". ; We are getting the first digit of a parameter, a quoted string, ; a ;, or a command. .f_get_param ld a,(hl) inc hl dec de .get_param_B ; jump to here if no fetch of character cp '0' jp m, fgp_may_quote cp '9'+1 jp p, fgp_may_quote ; if bc <param_end bc++ push hl ld h,b ld l,c push bc ld bc,param_end sbc hl,bc pop bc pop hl jr nc,NoBCinc inc bc .NoBCinc ; It's the first digit. Initialize parameter with it. sub '0' ld (bc), a ; next_is f_in_param ld a,d or e jp nz, f_in_param ld (cur_parm_ptr), bc ld bc, f_in_param ld (escvector), bc jp f_loopdone .fgp_may_quote cp '"' jr z, fgp_isquote cp '\\' jp nz, fgp_semi_or_cmd ; jump to code shared with f_in_param .fgp_isquote ld (string_term), a ; save it for end of string ; and read string into param_buffer ; next_is f_get_string ld a,d or e jr nz, f_get_string ld (cur_parm_ptr), bc ld bc, f_get_string ld (escvector), bc jp f_loopdone .fgp_semi_or_cmd cp ';' ; is it a semi? jp nz, fgp_cmd ; no, then it's a command ; if bc <param_end bc++ push hl ld h,b ld l,c push bc ld bc,param_end sbc hl,bc pop bc pop hl jr nc,NoBCinc2 inc bc .NoBCinc2 xor a ; zero ld (bc), a ; it is a zero parameter .f_goto_next ;next_is f_get_param ld a,d or e jr nz, f_get_param ld (cur_parm_ptr), bc ld bc, f_get_param ld (escvector), bc jp f_loopdone ;----- f_get_string ------------------------------------- ; Last character was a quote or a string element. ; Get characters until ending quote found. .f_get_string ld a, (hl) inc hl dec de push hl ld hl, string_term cp (hl) pop hl jr z, fgs_init_next_param ; if bc <param_end bc++ push hl ld h,b ld l,c push bc ld bc,param_end sbc hl,bc pop bc pop hl jr nc,NoBCinc3 inc bc .NoBCinc3 ld (bc), a ;next_is f_get_string ld a,d or e jr nz, f_get_string ld (cur_parm_ptr), bc ld bc, f_get_string ld (escvector), bc jp f_loopdone ; Ending quote was found. .fgs_init_next_param ;next_is f_eat_semi ld a,d or e jr nz, f_eat_semi ld (cur_parm_ptr), bc ld bc, f_eat_semi ld (escvector), bc jp f_loopdone ;----- f_eat_semi ------------------------------------- ; Last character was an ending quote. ; If this char is a semi, eat it ; Then goto f_get_param .f_eat_semi ld a,(hl) inc hl dec de cp ';' jp nz, get_param_B jr f_goto_next ;------ f_in_param ------------------------------------- ; Last character was a digit. ; Looking for more digits, a semicolon, or a command character. .f_in_param ld a,(hl) inc hl dec de cp '0' jp m, fgp_not_digit cp '9'+1 jp p, fgp_not_digit ; It's another digit. Add into current parameter. sub '0' push bc push af ld a, (bc) ld c,a ld b,9 .Per10 add a, c djnz Per10 ld c,a pop af add a, c pop bc ld (bc), a ;next_is f_in_param ld a,d or e jr nz, f_in_param ld (cur_parm_ptr), bc ld bc, f_in_param ld (escvector), bc jp f_loopdone .fgp_not_digit cp ';' jp z, f_goto_next .fgp_cmd ; It must be a command letter. push hl push de ;Count no. of parameters in reg. B ld h,b ld l,c ld bc,param_buffer dec bc scf ccf sbc hl,bc ld b,l ; if B=0 -> set to 1 first parameter (B is still = 0) inc b dec b jr nz,no_default push af ld hl,param_buffer ld a,1 ld (hl),a pop af .no_default ; Command interpreter ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%% m %%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%% Set graphic rendition %%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cp 'm' jp nz,no_m inc b dec b jr nz,m_nodefault ld hl,param_buffer ld a,0 ld (hl),a inc b .m_nodefault ld hl,param_buffer .loop_m ld a,(hl) call ansi_attr inc hl dec b jp nz,loop_m jp f_cmd_exit .no_m ;.temp jp f_cmd_exit ;%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%% C %%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%% Cursor forward %%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%% cp 'C' ; CUF - Cursor foreward jr nz,no_C ld hl,param_buffer ld a,(__console_x) add a,(hl) push bc push af ld a,(__console_w) ld b,a pop af inc b cp b pop bc jp p, no_C_FWD ld (__console_x),a jp f_cmd_exit .no_C_FWD ld a,(__console_w) dec a ld (__console_x),a jp f_cmd_exit .no_C ;%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%% D %%%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%% Cursor backward %%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%%% cp 'D' ; CUB - Cursor backward jr nz,no_D ld hl,param_buffer ld a,(__console_x) sub (hl) jp nc, no_D_TOP xor a .no_D_TOP ld (__console_x),a jp f_cmd_exit .no_D ;%%%%%%%%%%%%%%%%%%%%%% ;%% A %%%%%%%%%%%%%%%%% ;%%%%%%%% Cursor UP %%% ;%%%%%%%%%%%%%%%%%%%%%% cp 'A' ; CUU - Cursor up jr nz,no_A ld hl,param_buffer .f_ansi_cup ld a,(__console_y) sub (hl) jp p, no_A_TOP xor a .no_A_TOP ld (__console_y),a jp f_cmd_exit .no_A ;%%%%%%%%%%%%%%%%%%%%%%%% ;%% B %%%%%%%%%%%%%%%%%%% ;%%%%%%%% Cursor DOWN %%% ;%%%%%%%%%%%%%%%%%%%%%%%% cp 'B' ; CUD - Cursor down jr nz,no_B ld hl,param_buffer ld a,(__console_y) add a,(hl) push bc push af ld a,(__console_h) ld b,a pop af inc b cp b pop bc jp p, no_B_FWD ld (__console_y),a jp f_cmd_exit .no_B_FWD ld a,(__console_h) dec a ld (__console_y),a jp f_cmd_exit .no_B ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%% s - j %%%%%%%%%%%%%%%%%%%% ;%%%%%%%% save cursor pos. %%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cp 's' ; SCP - Save cursor position jr z,do_s cp 'j' jr nz,no_s .do_s ld a,(__console_x) ld (scp_x),a ld a,(__console_y) ld (scp_y),a jp f_cmd_exit .no_s ;%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%% u - k %%%%%%%%%%%%%%%%%% ;%%%%%%%% r. cursor pos. %%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%% cp 'u' ; RCP - Restore cursor position jr z,do_u cp 'k' jr nz,no_u .do_u ld a,(scp_x) ld (__console_x),a ld a,(scp_y) ld (__console_y),a jp f_cmd_exit .no_u ;%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%% H %%%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%% SET cursor pos. %%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%%% cp 'f' ; HVP not fully functional jr z,IsHVP cp 'H' ; CUP - Cursor position jr nz,no_H .IsHVP inc b dec b jr nz,H_Nodeflt ld hl,param_buffer ld a,1 ld (hl),a inc hl ld (hl),a .H_Nodeflt dec b jr nz,H_nodef1 ld hl,param_buffer inc hl ld a,1 ld (hl),a .H_nodef1 ld hl,param_buffer ; point to row ld a,(hl) and a jr z,HLineOK push hl dec a ld hl,__console_h cp (hl) pop hl jr c,HLineOK ld a,(__console_h) ; position next char at max possible row dec a .HLineOK ld (__console_y),a inc hl ; point to column ld a,(hl) and a jr z,HColOK dec a ; char position ld hl,__console_w cp (hl) jr c,HColOK ld a,(__console_w) ; position next char at max possible column dec a .HColOK ld (__console_x),a jp f_cmd_exit .no_H ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%% b %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%% Erase from start of display %%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cp 'b' jr z,is_J1_b ;%%%%%%%%%%%%%%%% ;%% J %%%%%%%%%%% ;%%%%%%%% CLS %%% ;%%%%%%%%%%%%%%%% cp 'J' ; ED - Erase in display jp nz,no_J inc b dec b jr nz,J_nodefault ld hl,param_buffer ld a,0 ld (hl),a ; inc b --not useful (1 parameter only) .J_nodefault ld hl,param_buffer ld a,(hl) and a ; from cursor to end of screen jr nz,no_J_0 ; First, from cursor to EOL ld a,(__console_y) push af ld a,(__console_x) push af .j0loop push af ld a,32 ;' ' ; BLANK call ansi_CHAR ; The low level video routine pop af inc a ld (__console_x),a ld hl,__console_w cp (hl) jp m,j0loop pop af ld (__console_x),a ; restore orig. cursor pos. pop af ld (__console_y),a ; restore orig. cursor pos. ; Then, from the cursor line + 1 up to the last line .j0LineLoop inc a inc a ld hl,__console_h cp (hl) jp z,f_cmd_exit ;dec a push af call ansi_del_line pop af jr j0LineLoop .no_J_0 cp 1 ; from (0;0) to cursor jr nz,no_J_1 .is_J1_b ; First, from cursor to 0 ld a,(__console_y) push af ld a,(__console_x) push af .j1loop push af ld a,32 ;' ' ; BLANK call ansi_CHAR ; The low level video routine pop af dec a ld (__console_x),a cp 0 jp p,j1loop pop af ld (__console_x),a ; restore orig. cursor pos. pop af ld (__console_y),a ; restore orig. cursor pos. ; Then, from the cursor line - 1 up to 0 and a jp z,f_cmd_exit .j1LineLoop dec a push af call ansi_del_line pop af cp 0 jp p,j1LineLoop jp f_cmd_exit .no_J_1 cp 2 ; entire screen (+home cursor [non-standard]) jp nz,f_cmd_exit ; Syntax Error! ; clear all screen call docls jp f_cmd_exit .no_J ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%% o %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%% Erase from start of line %%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cp 'o' jr z,is_K1_o ;%%%%%%%%%%%%%%%%%%%%%%%%%% ;%% K %%%%%%%%%%%%%%%%%%%%% ;%%%%%%%% Erase in line %%% ;%%%%%%%%%%%%%%%%%%%%%%%%%% cp 'K' ; EL - Erase in line jp nz,no_K inc b dec b jr nz,K_nodefault ld hl,param_buffer ld a,0 ld (hl),a ; inc b --not useful (1 parameter only) .K_nodefault ld hl,param_buffer ld a,(hl) and a ; From cursor to end of line jr nz,no_K_0 ld a,(__console_x) push af .K0loop push af ld a,32 ; ' ' ; BLANK call ansi_CHAR ; The low level video routine pop af inc a ld (__console_x),a ld hl,__console_w cp (hl) jp m,K0loop pop af ld (__console_x),a ; restore orig. cursor pos. .no_K_0 cp 1 ; From beginning of line to cursor jr nz,no_K_1 .is_K1_o ld a,(__console_x) push af .K1loop push af ld a,32 ;' ' ; BLANK call ansi_CHAR ; The low level video routine pop af dec a ld (__console_x),a cp 0 jp p,K1loop pop af ld (__console_x),a ; restore orig. cursor pos. jp f_cmd_exit .no_K_1 cp 2 ; entire screen (+home cursor [non-standard]) jp nz,f_cmd_exit ; Syntax Error! ld a,(__console_y) call ansi_del_line jp f_cmd_exit .no_K ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%% l %%%%%%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%% Erase current line %%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cp 'l' jr nz,noecl ld a,(__console_y) call ansi_del_line jp f_cmd_exit .noecl ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%% n %%%%%%%%%%%%%%%%%%%%%%%%%%%% ;%%%%%%%% Device Status Report %%% ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cp 'n' ; DSR - Device status report jp nz,no_n inc b dec b jp z, f_cmd_exit ; only mode 6 is supported .n_nodefault ld hl,param_buffer ld a,(hl) cp 6 jp z, f_cmd_exit ; only mode 6 is supported call ansi_DSR6 jp f_cmd_exit .no_n ;%%%%%%%%%%%%%%%%%%%%%%%%% ;%% L %%%%%%%%%%%%%%%%%%%% ;%%%%%%%% Insert Lines %%% ;%%%%%%%%%%%%%%%%%%%%%%%%% cp 'L' ; IL - Insert lines jr nz,no_L ld hl,param_buffer ld b,(hl) ld a,(__console_y) jp f_cmd_exit .no_L ;%%%%%%%%%%%%%%%%%%%%%%%%% ;%% M %%%%%%%%%%%%%%%%%%%% ;%%%%%%%% Delete Lines %%% ;%%%%%%%%%%%%%%%%%%%%%%%%% cp 'M' ; DL - Delete lines jr nz,no_MM ld hl,param_buffer ld a,(hl) .no_MM ;%% E X I T %% .f_cmd_exit pop de pop hl jp f_ANSI_exit ;----------------------------------------- ; Variables declaration ;----------------------------------------- SECTION bss_clib .scp_x defb 0 .scp_y defb 0 .escvector defw 0 .cur_parm_ptr defw 0 .eat_key defb 0 .string_term defb 0 .param_buffer defs 40 .param_end defw 0
software/hal/hpl/STM32/svd/stm32f429x/stm32_svd-syscfg.ads
TUM-EI-RCS/StratoX
12
27191
-- This spec has been automatically generated from STM32F429x.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; with HAL; with System; package STM32_SVD.SYSCFG is pragma Preelaborate; --------------- -- Registers -- --------------- -------------------- -- MEMRM_Register -- -------------------- subtype MEMRM_MEM_MODE_Field is HAL.UInt3; subtype MEMRM_SWP_FMC_Field is HAL.UInt2; -- memory remap register type MEMRM_Register is record -- Memory mapping selection MEM_MODE : MEMRM_MEM_MODE_Field := 16#0#; -- unspecified Reserved_3_7 : HAL.UInt5 := 16#0#; -- Flash bank mode selection FB_MODE : Boolean := False; -- unspecified Reserved_9_9 : HAL.Bit := 16#0#; -- FMC memory mapping swap SWP_FMC : MEMRM_SWP_FMC_Field := 16#0#; -- unspecified Reserved_12_31 : HAL.UInt20 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for MEMRM_Register use record MEM_MODE at 0 range 0 .. 2; Reserved_3_7 at 0 range 3 .. 7; FB_MODE at 0 range 8 .. 8; Reserved_9_9 at 0 range 9 .. 9; SWP_FMC at 0 range 10 .. 11; Reserved_12_31 at 0 range 12 .. 31; end record; ------------------ -- PMC_Register -- ------------------ -- peripheral mode configuration register type PMC_Register is record -- unspecified Reserved_0_15 : HAL.Short := 16#0#; -- ADC1DC2 ADC1DC2 : Boolean := False; -- ADC2DC2 ADC2DC2 : Boolean := False; -- ADC3DC2 ADC3DC2 : Boolean := False; -- unspecified Reserved_19_22 : HAL.UInt4 := 16#0#; -- Ethernet PHY interface selection MII_RMII_SEL : Boolean := False; -- unspecified Reserved_24_31 : HAL.Byte := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PMC_Register use record Reserved_0_15 at 0 range 0 .. 15; ADC1DC2 at 0 range 16 .. 16; ADC2DC2 at 0 range 17 .. 17; ADC3DC2 at 0 range 18 .. 18; Reserved_19_22 at 0 range 19 .. 22; MII_RMII_SEL at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; ---------------------- -- EXTICR1_Register -- ---------------------- ------------------ -- EXTICR1.EXTI -- ------------------ -- EXTICR1_EXTI array element subtype EXTICR1_EXTI_Element is HAL.UInt4; -- EXTICR1_EXTI array type EXTICR1_EXTI_Field_Array is array (0 .. 3) of EXTICR1_EXTI_Element with Component_Size => 4, Size => 16; -- Type definition for EXTICR1_EXTI type EXTICR1_EXTI_Field (As_Array : Boolean := False) is record case As_Array is when False => -- EXTI as a value Val : HAL.Short; when True => -- EXTI as an array Arr : EXTICR1_EXTI_Field_Array; end case; end record with Unchecked_Union, Size => 16; for EXTICR1_EXTI_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- external interrupt configuration register 1 type EXTICR1_Register is record -- EXTI x configuration (x = 0 to 3) EXTI : EXTICR1_EXTI_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for EXTICR1_Register use record EXTI at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; ---------------------- -- EXTICR2_Register -- ---------------------- ------------------ -- EXTICR2.EXTI -- ------------------ -- EXTICR2_EXTI array element subtype EXTICR2_EXTI_Element is HAL.UInt4; -- EXTICR2_EXTI array type EXTICR2_EXTI_Field_Array is array (4 .. 7) of EXTICR2_EXTI_Element with Component_Size => 4, Size => 16; -- Type definition for EXTICR2_EXTI type EXTICR2_EXTI_Field (As_Array : Boolean := False) is record case As_Array is when False => -- EXTI as a value Val : HAL.Short; when True => -- EXTI as an array Arr : EXTICR2_EXTI_Field_Array; end case; end record with Unchecked_Union, Size => 16; for EXTICR2_EXTI_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- external interrupt configuration register 2 type EXTICR2_Register is record -- EXTI x configuration (x = 4 to 7) EXTI : EXTICR2_EXTI_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for EXTICR2_Register use record EXTI at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; ---------------------- -- EXTICR3_Register -- ---------------------- ------------------ -- EXTICR3.EXTI -- ------------------ -- EXTICR3_EXTI array element subtype EXTICR3_EXTI_Element is HAL.UInt4; -- EXTICR3_EXTI array type EXTICR3_EXTI_Field_Array is array (8 .. 11) of EXTICR3_EXTI_Element with Component_Size => 4, Size => 16; -- Type definition for EXTICR3_EXTI type EXTICR3_EXTI_Field (As_Array : Boolean := False) is record case As_Array is when False => -- EXTI as a value Val : HAL.Short; when True => -- EXTI as an array Arr : EXTICR3_EXTI_Field_Array; end case; end record with Unchecked_Union, Size => 16; for EXTICR3_EXTI_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- external interrupt configuration register 3 type EXTICR3_Register is record -- EXTI x configuration (x = 8 to 11) EXTI : EXTICR3_EXTI_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for EXTICR3_Register use record EXTI at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; ---------------------- -- EXTICR4_Register -- ---------------------- ------------------ -- EXTICR4.EXTI -- ------------------ -- EXTICR4_EXTI array element subtype EXTICR4_EXTI_Element is HAL.UInt4; -- EXTICR4_EXTI array type EXTICR4_EXTI_Field_Array is array (12 .. 15) of EXTICR4_EXTI_Element with Component_Size => 4, Size => 16; -- Type definition for EXTICR4_EXTI type EXTICR4_EXTI_Field (As_Array : Boolean := False) is record case As_Array is when False => -- EXTI as a value Val : HAL.Short; when True => -- EXTI as an array Arr : EXTICR4_EXTI_Field_Array; end case; end record with Unchecked_Union, Size => 16; for EXTICR4_EXTI_Field use record Val at 0 range 0 .. 15; Arr at 0 range 0 .. 15; end record; -- external interrupt configuration register 4 type EXTICR4_Register is record -- EXTI x configuration (x = 12 to 15) EXTI : EXTICR4_EXTI_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_16_31 : HAL.Short := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for EXTICR4_Register use record EXTI at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; -------------------- -- CMPCR_Register -- -------------------- -- Compensation cell control register type CMPCR_Register is record -- Read-only. Compensation cell power-down CMP_PD : Boolean; -- unspecified Reserved_1_7 : HAL.UInt7; -- Read-only. READY READY : Boolean; -- unspecified Reserved_9_31 : HAL.UInt23; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CMPCR_Register use record CMP_PD at 0 range 0 .. 0; Reserved_1_7 at 0 range 1 .. 7; READY at 0 range 8 .. 8; Reserved_9_31 at 0 range 9 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- System configuration controller type SYSCFG_Peripheral is record -- memory remap register MEMRM : MEMRM_Register; -- peripheral mode configuration register PMC : PMC_Register; -- external interrupt configuration register 1 EXTICR1 : EXTICR1_Register; -- external interrupt configuration register 2 EXTICR2 : EXTICR2_Register; -- external interrupt configuration register 3 EXTICR3 : EXTICR3_Register; -- external interrupt configuration register 4 EXTICR4 : EXTICR4_Register; -- Compensation cell control register CMPCR : CMPCR_Register; end record with Volatile; for SYSCFG_Peripheral use record MEMRM at 0 range 0 .. 31; PMC at 4 range 0 .. 31; EXTICR1 at 8 range 0 .. 31; EXTICR2 at 12 range 0 .. 31; EXTICR3 at 16 range 0 .. 31; EXTICR4 at 20 range 0 .. 31; CMPCR at 32 range 0 .. 31; end record; -- System configuration controller SYSCFG_Periph : aliased SYSCFG_Peripheral with Import, Address => SYSCFG_Base; end STM32_SVD.SYSCFG;
programs/oeis/206/A206351.asm
karttu/loda
0
161832
; A206351: a(n) = 7*a(n-1) - a(n-2) - 4 with a(1)=1, a(2)=3. ; 1,3,16,105,715,4896,33553,229971,1576240,10803705,74049691,507544128,3478759201,23843770275,163427632720,1120149658761,7677619978603,52623190191456,360684711361585,2472169789339635 mov $3,1 lpb $0,1 sub $0,1 add $4,$3 add $1,$4 add $3,$4 mov $2,$3 add $2,$1 sub $1,$1 add $1,$4 add $2,$4 add $3,$2 sub $3,4 lpe add $1,$3
programs/oeis/022/A022776.asm
neoneye/loda
22
165153
; A022776: Place where n-th 1 occurs in A023115. ; 1,2,4,7,10,14,19,24,30,37,45,53,62,72,82,93,105,118,131,145,160,175,191,208,225,243,262,282,302,323,345,367,390,414,439,464,490,517,544,572,601,630,660,691,723,755,788,822,856,891,927,964,1001,1039,1078,1117,1157,1198,1240,1282,1325,1369,1413,1458,1504,1550,1597,1645,1694,1743,1793,1844,1895,1947,2000,2054,2108,2163,2219,2275,2332,2390,2448,2507,2567,2628,2689,2751,2814,2877,2941,3006,3072,3138,3205,3273,3341,3410,3480,3551 sub $0,1 mov $2,$0 max $0,0 seq $0,183139 ; a(n) = [1/r]+[2/r]+...+[n/r], where r=sqrt(2) and []=floor. add $2,1 add $2,$0 mov $0,$2 add $0,1
msp430x2/msp430g2553/svd/msp430_svd-usci_a0_uart_mode.ads
ekoeppen/MSP430_Generic_Ada_Drivers
0
18602
-- This spec has been automatically generated from msp430g2553.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with System; -- USCI_A0 UART Mode package MSP430_SVD.USCI_A0_UART_MODE is pragma Preelaborate; --------------- -- Registers -- --------------- -- UCA0ABCTL_UCDELIM array type UCA0ABCTL_UCDELIM_Field_Array is array (0 .. 1) of MSP430_SVD.Bit with Component_Size => 1, Size => 2; -- Type definition for UCA0ABCTL_UCDELIM type UCA0ABCTL_UCDELIM_Field (As_Array : Boolean := False) is record case As_Array is when False => -- UCDELIM as a value Val : MSP430_SVD.UInt2; when True => -- UCDELIM as an array Arr : UCA0ABCTL_UCDELIM_Field_Array; end case; end record with Unchecked_Union, Size => 2; for UCA0ABCTL_UCDELIM_Field use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- USCI A0 LIN Control type UCA0ABCTL_Register is record -- Auto Baud Rate detect enable UCABDEN : MSP430_SVD.Bit := 16#0#; -- unspecified Reserved_1_1 : MSP430_SVD.Bit := 16#0#; -- Break Timeout error UCBTOE : MSP430_SVD.Bit := 16#0#; -- Sync-Field Timeout error UCSTOE : MSP430_SVD.Bit := 16#0#; -- Break Sync Delimiter 0 UCDELIM : UCA0ABCTL_UCDELIM_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_6_7 : MSP430_SVD.UInt2 := 16#0#; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for UCA0ABCTL_Register use record UCABDEN at 0 range 0 .. 0; Reserved_1_1 at 0 range 1 .. 1; UCBTOE at 0 range 2 .. 2; UCSTOE at 0 range 3 .. 3; UCDELIM at 0 range 4 .. 5; Reserved_6_7 at 0 range 6 .. 7; end record; -- UCA0IRTCTL_UCIRTXPL array type UCA0IRTCTL_UCIRTXPL_Field_Array is array (0 .. 5) of MSP430_SVD.Bit with Component_Size => 1, Size => 6; -- Type definition for UCA0IRTCTL_UCIRTXPL type UCA0IRTCTL_UCIRTXPL_Field (As_Array : Boolean := False) is record case As_Array is when False => -- UCIRTXPL as a value Val : MSP430_SVD.UInt6; when True => -- UCIRTXPL as an array Arr : UCA0IRTCTL_UCIRTXPL_Field_Array; end case; end record with Unchecked_Union, Size => 6; for UCA0IRTCTL_UCIRTXPL_Field use record Val at 0 range 0 .. 5; Arr at 0 range 0 .. 5; end record; -- USCI A0 IrDA Transmit Control type UCA0IRTCTL_Register is record -- IRDA Encoder/Decoder enable UCIREN : MSP430_SVD.Bit := 16#0#; -- IRDA Transmit Pulse Clock Select UCIRTXCLK : MSP430_SVD.Bit := 16#0#; -- IRDA Transmit Pulse Length 0 UCIRTXPL : UCA0IRTCTL_UCIRTXPL_Field := (As_Array => False, Val => 16#0#); end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for UCA0IRTCTL_Register use record UCIREN at 0 range 0 .. 0; UCIRTXCLK at 0 range 1 .. 1; UCIRTXPL at 0 range 2 .. 7; end record; -- UCA0IRRCTL_UCIRRXFL array type UCA0IRRCTL_UCIRRXFL_Field_Array is array (0 .. 5) of MSP430_SVD.Bit with Component_Size => 1, Size => 6; -- Type definition for UCA0IRRCTL_UCIRRXFL type UCA0IRRCTL_UCIRRXFL_Field (As_Array : Boolean := False) is record case As_Array is when False => -- UCIRRXFL as a value Val : MSP430_SVD.UInt6; when True => -- UCIRRXFL as an array Arr : UCA0IRRCTL_UCIRRXFL_Field_Array; end case; end record with Unchecked_Union, Size => 6; for UCA0IRRCTL_UCIRRXFL_Field use record Val at 0 range 0 .. 5; Arr at 0 range 0 .. 5; end record; -- USCI A0 IrDA Receive Control type UCA0IRRCTL_Register is record -- IRDA Receive Filter enable UCIRRXFE : MSP430_SVD.Bit := 16#0#; -- IRDA Receive Input Polarity UCIRRXPL : MSP430_SVD.Bit := 16#0#; -- IRDA Receive Filter Length 0 UCIRRXFL : UCA0IRRCTL_UCIRRXFL_Field := (As_Array => False, Val => 16#0#); end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for UCA0IRRCTL_Register use record UCIRRXFE at 0 range 0 .. 0; UCIRRXPL at 0 range 1 .. 1; UCIRRXFL at 0 range 2 .. 7; end record; -- Async. Mode: USCI Mode 1 type UCA0CTL0_UCMODE_Field is (-- Sync. Mode: USCI Mode: 0 Ucmode_0, -- Sync. Mode: USCI Mode: 1 Ucmode_1, -- Sync. Mode: USCI Mode: 2 Ucmode_2, -- Sync. Mode: USCI Mode: 3 Ucmode_3) with Size => 2; for UCA0CTL0_UCMODE_Field use (Ucmode_0 => 0, Ucmode_1 => 1, Ucmode_2 => 2, Ucmode_3 => 3); -- USCI A0 Control Register 0 type UCA0CTL0_Register is record -- Sync-Mode 0:UART-Mode / 1:SPI-Mode UCSYNC : MSP430_SVD.Bit := 16#0#; -- Async. Mode: USCI Mode 1 UCMODE : UCA0CTL0_UCMODE_Field := MSP430_SVD.USCI_A0_UART_MODE.Ucmode_0; -- Async. Mode: Stop Bits 0:one / 1: two UCSPB : MSP430_SVD.Bit := 16#0#; -- Async. Mode: Data Bits 0:8-bits / 1:7-bits UC7BIT : MSP430_SVD.Bit := 16#0#; -- Async. Mode: MSB first 0:LSB / 1:MSB UCMSB : MSP430_SVD.Bit := 16#0#; -- Async. Mode: Parity 0:odd / 1:even UCPAR : MSP430_SVD.Bit := 16#0#; -- Async. Mode: Parity enable UCPEN : MSP430_SVD.Bit := 16#0#; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for UCA0CTL0_Register use record UCSYNC at 0 range 0 .. 0; UCMODE at 0 range 1 .. 2; UCSPB at 0 range 3 .. 3; UC7BIT at 0 range 4 .. 4; UCMSB at 0 range 5 .. 5; UCPAR at 0 range 6 .. 6; UCPEN at 0 range 7 .. 7; end record; -- USCI 0 Clock Source Select 1 type UCA0CTL1_UCSSEL_Field is (-- USCI 0 Clock Source: 0 Ucssel_0, -- USCI 0 Clock Source: 1 Ucssel_1, -- USCI 0 Clock Source: 2 Ucssel_2, -- USCI 0 Clock Source: 3 Ucssel_3) with Size => 2; for UCA0CTL1_UCSSEL_Field use (Ucssel_0 => 0, Ucssel_1 => 1, Ucssel_2 => 2, Ucssel_3 => 3); -- USCI A0 Control Register 1 type UCA0CTL1_Register is record -- USCI Software Reset UCSWRST : MSP430_SVD.Bit := 16#0#; -- Send next Data as Break UCTXBRK : MSP430_SVD.Bit := 16#0#; -- Send next Data as Address UCTXADDR : MSP430_SVD.Bit := 16#0#; -- Dormant (Sleep) Mode UCDORM : MSP430_SVD.Bit := 16#0#; -- Break interrupt enable UCBRKIE : MSP430_SVD.Bit := 16#0#; -- RX Error interrupt enable UCRXEIE : MSP430_SVD.Bit := 16#0#; -- USCI 0 Clock Source Select 1 UCSSEL : UCA0CTL1_UCSSEL_Field := MSP430_SVD.USCI_A0_UART_MODE.Ucssel_0; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for UCA0CTL1_Register use record UCSWRST at 0 range 0 .. 0; UCTXBRK at 0 range 1 .. 1; UCTXADDR at 0 range 2 .. 2; UCDORM at 0 range 3 .. 3; UCBRKIE at 0 range 4 .. 4; UCRXEIE at 0 range 5 .. 5; UCSSEL at 0 range 6 .. 7; end record; -- USCI Second Stage Modulation Select 2 type UCA0MCTL_UCBRS_Field is (-- USCI Second Stage Modulation: 0 Ucbrs_0, -- USCI Second Stage Modulation: 1 Ucbrs_1, -- USCI Second Stage Modulation: 2 Ucbrs_2, -- USCI Second Stage Modulation: 3 Ucbrs_3, -- USCI Second Stage Modulation: 4 Ucbrs_4, -- USCI Second Stage Modulation: 5 Ucbrs_5, -- USCI Second Stage Modulation: 6 Ucbrs_6, -- USCI Second Stage Modulation: 7 Ucbrs_7) with Size => 3; for UCA0MCTL_UCBRS_Field use (Ucbrs_0 => 0, Ucbrs_1 => 1, Ucbrs_2 => 2, Ucbrs_3 => 3, Ucbrs_4 => 4, Ucbrs_5 => 5, Ucbrs_6 => 6, Ucbrs_7 => 7); -- USCI First Stage Modulation Select 3 type UCA0MCTL_UCBRF_Field is (-- USCI First Stage Modulation: 0 Ucbrf_0, -- USCI First Stage Modulation: 1 Ucbrf_1, -- USCI First Stage Modulation: 2 Ucbrf_2, -- USCI First Stage Modulation: 3 Ucbrf_3, -- USCI First Stage Modulation: 4 Ucbrf_4, -- USCI First Stage Modulation: 5 Ucbrf_5, -- USCI First Stage Modulation: 6 Ucbrf_6, -- USCI First Stage Modulation: 7 Ucbrf_7, -- USCI First Stage Modulation: 8 Ucbrf_8, -- USCI First Stage Modulation: 9 Ucbrf_9, -- USCI First Stage Modulation: A Ucbrf_10, -- USCI First Stage Modulation: B Ucbrf_11, -- USCI First Stage Modulation: C Ucbrf_12, -- USCI First Stage Modulation: D Ucbrf_13, -- USCI First Stage Modulation: E Ucbrf_14, -- USCI First Stage Modulation: F Ucbrf_15) with Size => 4; for UCA0MCTL_UCBRF_Field use (Ucbrf_0 => 0, Ucbrf_1 => 1, Ucbrf_2 => 2, Ucbrf_3 => 3, Ucbrf_4 => 4, Ucbrf_5 => 5, Ucbrf_6 => 6, Ucbrf_7 => 7, Ucbrf_8 => 8, Ucbrf_9 => 9, Ucbrf_10 => 10, Ucbrf_11 => 11, Ucbrf_12 => 12, Ucbrf_13 => 13, Ucbrf_14 => 14, Ucbrf_15 => 15); -- USCI A0 Modulation Control type UCA0MCTL_Register is record -- USCI 16-times Oversampling enable UCOS16 : MSP430_SVD.Bit := 16#0#; -- USCI Second Stage Modulation Select 2 UCBRS : UCA0MCTL_UCBRS_Field := MSP430_SVD.USCI_A0_UART_MODE.Ucbrs_0; -- USCI First Stage Modulation Select 3 UCBRF : UCA0MCTL_UCBRF_Field := MSP430_SVD.USCI_A0_UART_MODE.Ucbrf_0; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for UCA0MCTL_Register use record UCOS16 at 0 range 0 .. 0; UCBRS at 0 range 1 .. 3; UCBRF at 0 range 4 .. 7; end record; -- USCI A0 Status Register type UCA0STAT_Register is record -- USCI Busy Flag UCBUSY : MSP430_SVD.Bit := 16#0#; -- USCI Address received Flag UCADDR : MSP430_SVD.Bit := 16#0#; -- USCI RX Error Flag UCRXERR : MSP430_SVD.Bit := 16#0#; -- USCI Break received UCBRK : MSP430_SVD.Bit := 16#0#; -- USCI Parity Error Flag UCPE : MSP430_SVD.Bit := 16#0#; -- USCI Overrun Error Flag UCOE : MSP430_SVD.Bit := 16#0#; -- USCI Frame Error Flag UCFE : MSP430_SVD.Bit := 16#0#; -- USCI Listen mode UCLISTEN : MSP430_SVD.Bit := 16#0#; end record with Volatile_Full_Access, Object_Size => 8, Bit_Order => System.Low_Order_First; for UCA0STAT_Register use record UCBUSY at 0 range 0 .. 0; UCADDR at 0 range 1 .. 1; UCRXERR at 0 range 2 .. 2; UCBRK at 0 range 3 .. 3; UCPE at 0 range 4 .. 4; UCOE at 0 range 5 .. 5; UCFE at 0 range 6 .. 6; UCLISTEN at 0 range 7 .. 7; end record; ----------------- -- Peripherals -- ----------------- -- USCI_A0 UART Mode type USCI_A0_UART_MODE_Peripheral is record -- USCI A0 LIN Control UCA0ABCTL : aliased UCA0ABCTL_Register; -- USCI A0 IrDA Transmit Control UCA0IRTCTL : aliased UCA0IRTCTL_Register; -- USCI A0 IrDA Receive Control UCA0IRRCTL : aliased UCA0IRRCTL_Register; -- USCI A0 Control Register 0 UCA0CTL0 : aliased UCA0CTL0_Register; -- USCI A0 Control Register 1 UCA0CTL1 : aliased UCA0CTL1_Register; -- USCI A0 Baud Rate 0 UCA0BR0 : aliased MSP430_SVD.Byte; -- USCI A0 Baud Rate 1 UCA0BR1 : aliased MSP430_SVD.Byte; -- USCI A0 Modulation Control UCA0MCTL : aliased UCA0MCTL_Register; -- USCI A0 Status Register UCA0STAT : aliased UCA0STAT_Register; -- USCI A0 Receive Buffer UCA0RXBUF : aliased MSP430_SVD.Byte; -- USCI A0 Transmit Buffer UCA0TXBUF : aliased MSP430_SVD.Byte; end record with Volatile; for USCI_A0_UART_MODE_Peripheral use record UCA0ABCTL at 16#1# range 0 .. 7; UCA0IRTCTL at 16#2# range 0 .. 7; UCA0IRRCTL at 16#3# range 0 .. 7; UCA0CTL0 at 16#4# range 0 .. 7; UCA0CTL1 at 16#5# range 0 .. 7; UCA0BR0 at 16#6# range 0 .. 7; UCA0BR1 at 16#7# range 0 .. 7; UCA0MCTL at 16#8# range 0 .. 7; UCA0STAT at 16#9# range 0 .. 7; UCA0RXBUF at 16#A# range 0 .. 7; UCA0TXBUF at 16#B# range 0 .. 7; end record; -- USCI_A0 UART Mode USCI_A0_UART_MODE_Periph : aliased USCI_A0_UART_MODE_Peripheral with Import, Address => USCI_A0_UART_MODE_Base; end MSP430_SVD.USCI_A0_UART_MODE;
archive/agda-3/src/Oscar/Class/Transitivity/Function.agda
m0davis/oscar
0
8065
open import Oscar.Prelude open import Oscar.Class open import Oscar.Class.Transitivity module Oscar.Class.Transitivity.Function where module _ {a} where instance 𝓣ransitivityFunction : Transitivity.class Function⟦ a ⟧ 𝓣ransitivityFunction .⋆ f g = g ∘ f
oeis/030/A030657.asm
neoneye/loda-programs
11
166286
<reponame>neoneye/loda-programs<gh_stars>10-100 ; A030657: Parity of digits of Pi. ; Submitted by <NAME> ; 1,1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,0,1,0,0,0,0,0,0,1,1,0,1,0,1,1,1,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,1,0,0,1,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,1,1,0,0,1,1,1,0,0,1 mov $1,1 mov $2,1 mov $3,$0 mul $3,5 sub $3,1 lpb $3 mul $1,$3 mov $4,$1 cmp $4,0 mov $5,$3 mul $5,2 add $5,1 mul $2,$5 add $1,$2 cmp $4,0 mov $5,$0 add $5,$4 div $1,$5 add $1,$0 div $2,$5 sub $3,1 lpe mul $1,2 mov $6,10 pow $6,$0 div $2,$6 div $1,$2 add $1,$6 mov $0,$1 mod $0,2
FoldingText 2 plugins and scripts/FTGroupByTag.applescript
korm/tree-tools
134
744
property pTitle : "FoldingText Report - Group lines by Tags" property pVer : "0.1" property pAuthor : "<NAME>" property pblnDebug : false property pDescription : " Creates a new report, based on the active FoldingText document. The new document contains only tagged lines, and these are grouped under (sorted) tag headings. " property pGroupPrefix : "##" property pstrJS : " function(editor, options) { //debugger; var tree = editor.tree(), lstTags = tree.tags(true).sort(), strHeadPrefix = options.grouplevel, strListPrefix = '- ', lstTagged = [], lstReport = [], strTag; lstTags.forEach(function(strTag) { var strTitle = strTag[0].toUpperCase() + strTag.slice(1); lstReport.push([strHeadPrefix, strTitle].join(' ')); lstTagged = tree.evaluateNodePath('//@' + strTag); lstTagged.forEach(function(oNode) { lstReport.push(strListPrefix + oNode.text()); }); lstReport.push(''); // gap before next heading }); return lstReport.join('\\n'); } " tell application "FoldingText" if not pblnDebug then set lstDocs to documents if lstDocs ≠ {} then set strGroupedByTag to "" tell item 1 of lstDocs set strGroupedByTag to (evaluate script pstrJS with options {grouplevel:pGroupPrefix}) end tell if strGroupedByTag ≠ "" then make new document with properties {text contents:strGroupedByTag} end if end if else -- (interactive debugging in the SDK) -- The document will be the SDK Debugging Editor default doc -- (make sure that FoldingText > Help > Software Development Kit > editor is running -- and that there is at least one 'debugger;' breakpoint line somewhere in the Javascript ) debug script pstrJS with options {grouplevel:pGroupPrefix} end if end tell strGroupedByTag
src/ffi-c/src/stdint_h.ads
shintakezou/adaplayground
0
28592
<gh_stars>0 pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with Interfaces.C.Extensions; package stdint_h is subtype uint8_t is unsigned_char; -- /usr/include/stdint.h:48 end stdint_h;
src/obdh.adb
STR-UPM/ToyOBDH
1
21762
<reponame>STR-UPM/ToyOBDH<filename>src/obdh.adb ------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017, Universidad Politécnica de Madrid -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- This is the main procedure for the toy_obdh example. with Reader; pragma Unreferenced (Reader); -- The Reader package contains the task that reads the temperature sensor. with Basic_TM; pragma Unreferenced (Basic_TM); -- The Basic_TM package contains the task that generates -- basic telemetry messages that are sent to the ground station. with HK_TM; pragma Unreferenced (HK_TM); -- The HK_TM package contains the task that generates -- housekeeping telemetry messages that are sent to the ground station. with TC_Receiver; pragma Unreferenced (TC_Receiver); -- The TC_Receiver package contains the task that receives TC messages -- from the ground station and decodes them. -- Although these packages are not referenced directly in the main procedure, -- we need them in the closure of the context clauses so that -- they will be included in the executable. with System; procedure OBDH is pragma Priority (System.Priority'First); begin -- do nothing while application tasks run loop null; end loop; end OBDH;
Assignment7/prog1.asm
nikhilnayak98/CSE2011
0
165211
<filename>Assignment7/prog1.asm # Copy string to another string .data msg1 : .asciiz "Enter a string - " msg2 : .asciiz "\nString - " str : .word 0 buffer : .space 20 .text main: la $a0, msg1 li $v0, 4 syscall li $v0, 8 la $a0, buffer li $a1, 20 move $t0, $a0 syscall la $a0, msg2 li $v0, 4 syscall lw $t0, str la $a0, buffer move $v0, $t0 li $v0, 4 syscall li $v0, 10 syscall
src/main/antlr/Jass.g4
Cokemonkey11/wc3libs
22
5114
// Define a grammar called Jass grammar Jass; options { language = Java; } @header { package net.moonlightflower.wc3libs.antlr; } BOOL_LITERAL: 'true' | 'false' ; int_literal: ID_INT_LITERAL | DEC_INT_LITERAL | OCT_INT_LITERAL | HEX_INT_LITERAL ; DEC_INT_LITERAL: [1-9] [0-9]* | [0-9] ; OCT_INT_LITERAL: '0' [0-7]* ; HEX_INT_LITERAL: (('0' [xX]) | '$') [0-9a-fA-F]+ ; ID_INT_LITERAL: '\'' ([\u0000-\u0026\u0028-\u00FF]+) '\'' ; REAL_LITERAL: ([0-9]+ '.' [0-9]*) | ('.' [0-9]+) ; STRING_LITERAL: '"' ( EscapeSequence | ~('\\'|'"'|'\r'|'\n') | NEW_LINES )* '"'; NULL_LITERAL: 'null'; COMMENT_SINGLE: '//' (~('\n'|'\r'))*; COMMENT_BLOCK: '/*' (~('*') | ('*' + ~('/')))* '*/'; fragment EscapeSequence: '\\' [abfnrtvz"'\\]; CURLY_L: '{' ; CURLY_R: '}' ; COMMA: ',' ; NEW_LINES: ('\r\n' | '\n' | '\r')+ ; PARENS_L: '('; PARENS_R: ')'; BRACKET_L: '['; BRACKET_R: ']'; LOCAL: 'local'; ARRAY_DECL: 'array'; CONST_DECL: 'constant'; BOOL_OP_CONJUNCT: 'and'; BOOL_OP_DISJUNCT: 'or' ; BOOL_OP_NEG: 'not' ; GLOBALS_START: 'globals'; GLOBALS_END: 'endglobals'; DEBUG: 'debug'; FUNCTION: 'function'; ENDFUNCTION: 'endfunction'; TAKES: 'takes'; RETURNS: 'returns'; RETURN: 'return'; NOTHING: 'nothing'; ASSIGN_OP: '='; TYPE_DECL: 'type'; TYPE_EXTENDS: 'extends'; NATIVE: 'native'; CALL: 'call'; SET: 'set'; IF: 'if'; THEN: 'then'; ELSE: 'else'; ELSEIF: 'elseif'; ENDIF: 'endif'; LOOP: 'loop'; ENDLOOP: 'endloop'; EXITWHEN: 'exitwhen'; WS: (' ' | '\t')+ -> skip ; ID: ID_START (ID_TAIL)* ; fragment ID_START: [A-Za-z] ; fragment ID_TAIL: [A-Z] | [a-z] | [0-9] | '_' ; ADD: '+'; SUB: '-'; MULT: '*'; DIV: '/'; MOD: '%'; LESS: '<'; LESS_EQUAL: '<='; EQUAL: '=='; UNEQUAL: '!='; GREATER: '>'; GREATER_EQUAL: '>='; root: NEW_LINES? (top_decl (NEW_LINES top_decl)*)? NEW_LINES?; top_decl: type_decl | native_decl | globals_block | func_impl ; globals_block: GLOBALS_START NEW_LINES (global_decl NEW_LINES)* NEW_LINES? GLOBALS_END ; var_name: ID; func_name: ID; type_name: ID; var_ref: ID; func_ref: ID; type_ref: ID; global_decl: type_ref ARRAY_DECL var_name | CONST_DECL? type_ref var_name (ASSIGN_OP val=expr)? ; expr: handle_expr | null_expr | code_expr | bool_expr | int_expr | real_expr | string_expr ; handle_expr: handle_literal | handle_parens | any_expr_atom ; handle_literal: null_literal; handle_parens: PARENS_L handle_expr PARENS_R; code_expr: code_literal | code_parens | any_expr_atom ; code_parens: PARENS_L code_expr PARENS_R; code_literal: FUNCTION func_ref | null_literal ; null_expr: null_literal | null_parens | any_expr_atom ; null_parens: PARENS_L null_expr PARENS_R; null_literal: NULL_LITERAL; bool_expr: bool_maybe_disjunct; bool_maybe_disjunct: left=bool_maybe_disjunct BOOL_OP_DISJUNCT right=bool_maybe_conjunct | exit=bool_maybe_conjunct ; bool_maybe_conjunct: left=bool_maybe_conjunct BOOL_OP_CONJUNCT right=bool_maybe_full_relation | exit=bool_maybe_full_relation ; bool_maybe_full_relation: bool_full_relation | bool_maybe_num_order_relation ; bool_full_relation: bool_null_relation | bool_handle_relation | bool_code_relation | bool_bool_relation | bool_num_relation | bool_string_relation ; bool_null_relation: left=null_expr bool_relation_op right=null_expr; bool_handle_relation: left=handle_expr bool_relation_op right=handle_expr; bool_code_relation: left=code_expr bool_relation_op right=code_expr; bool_bool_relation: left=bool_maybe_num_order_relation bool_relation_op right=bool_maybe_num_order_relation; bool_num_relation: left=num_expr bool_relation_op right=num_expr; bool_string_relation: left=string_expr bool_relation_op right=string_expr; bool_maybe_num_order_relation: bool_num_order_relation | bool_maybe_unary ; bool_num_order_relation: left=num_expr bool_num_order_relation_op right=num_expr; bool_maybe_unary: BOOL_OP_NEG bool_maybe_unary | bool_atom ; bool_atom: any_expr_atom | bool_literal | bool_parens ; bool_literal: BOOL_LITERAL; bool_parens: PARENS_L bool_expr PARENS_R; bool_relation_op: EQUAL | UNEQUAL; bool_num_order_relation_op: LESS | LESS_EQUAL | GREATER | GREATER_EQUAL; num_expr: int_expr | real_expr ; int_expr: int_maybe_sum; int_maybe_sum: left=int_maybe_sum num_sum_op right=int_maybe_prod | int_maybe_prod ; int_maybe_prod: left=int_maybe_prod num_prod_op right=int_maybe_unary | int_maybe_unary ; int_maybe_unary: num_unary_op int_maybe_unary | int_atom ; int_atom: int_literal | int_parens | any_expr_atom ; //int_literal: //INT_LITERAL; int_parens: PARENS_L int_expr PARENS_R; real_expr: real_maybe_sum; real_maybe_sum: left=real_maybe_sum num_sum_op right=real_maybe_prod | real_maybe_prod ; real_maybe_prod: left=real_maybe_prod num_prod_op right=real_maybe_unary | real_maybe_unary ; real_maybe_unary: num_unary_op real_maybe_unary | real_atom ; real_atom: int_atom | real_literal | real_parens | any_expr_atom ; real_literal: REAL_LITERAL; real_parens: PARENS_L real_expr PARENS_R; num_sum_op: ADD | SUB; num_prod_op: MULT | DIV | MOD; num_unary_op: ADD | SUB; string_expr: string_maybe_concat; string_maybe_concat: left=string_maybe_concat string_concat_op right=string_atom | string_atom ; string_atom: string_literal | string_parens | any_expr_atom ; string_literal: STRING_LITERAL | null_literal ; string_parens: PARENS_L string_expr PARENS_R; string_concat_op: ADD; any_expr_atom: func_call | var_ref | array_read ; func_call: func_ref PARENS_L arg_list PARENS_R; arg_list: (expr (COMMA expr)*)? ; array_read: var_ref BRACKET_L int_expr BRACKET_R; local_var_decl: LOCAL ( ( type_ref ARRAY_DECL var_name ) | ( type_ref var_name (ASSIGN_OP expr)? ) ) ; local_var_decl_list: local_var_decl (NEW_LINES local_var_decl)* ; statement: call | set_var | selection | loop | exitwhen | rule_return | debug ; statement_list: statement (NEW_LINES statement)* ; call: CALL func_call ; set_var: SET var_ref (BRACKET_L index=int_expr BRACKET_R)? ASSIGN_OP val=expr ; condition: bool_expr ; selection_elseif_branch: ELSEIF condition THEN NEW_LINES statement_list? NEW_LINES? ; selection_else_branch: ELSE NEW_LINES statement_list? NEW_LINES? ; selection: IF condition THEN NEW_LINES thenStatements=statement_list? NEW_LINES? elseif_branches+=selection_elseif_branch* else_branch=selection_else_branch? ENDIF ; loop: LOOP NEW_LINES (loop_body NEW_LINES)? NEW_LINES? ENDLOOP ; exitwhen: EXITWHEN condition ; loop_body: loop_body_line (NEW_LINES loop_body_line)*; loop_body_line: statement_list ; rule_return: RETURN expr? ; debug: DEBUG (call | set_var | selection | loop) ; func_decl: CONST_DECL? FUNCTION func_name TAKES params=func_param_list RETURNS returnType=func_return_type ; func_impl: func_decl NEW_LINES (body=func_body NEW_LINES)? ENDFUNCTION ; func_return_type: NOTHING | type_ref ; func_param_list: NOTHING | (params=func_param (COMMA func_param)*) ; func_param: type_ref var_name ; func_body: local_var_decl_list | statement_list | local_var_decl_list NEW_LINES statement_list ; type_decl: TYPE_DECL type_name TYPE_EXTENDS type_ref ; native_decl: CONST_DECL? NATIVE func_name TAKES params=func_param_list RETURNS returnType=func_return_type ;
asm/negative.asm
tigercosmos/16bitjs
509
93153
.data .number -10 .text .global main: main: lda b, .number mvi a, 0 mvi c, 0 sys hlt
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_51.asm
ljhsiun2/medusa
9
89759
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r15 push %r9 push %rbp push %rbx push %rcx push %rdi lea addresses_WT_ht+0x1dd0b, %r15 nop nop nop nop xor $39361, %rdi movw $0x6162, (%r15) nop nop nop nop add %r9, %r9 lea addresses_D_ht+0x13f0b, %rdi nop nop xor $57260, %rcx vmovups (%rdi), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $1, %xmm0, %rbx nop add $60667, %r9 lea addresses_WT_ht+0x3863, %rbx nop nop and %rbp, %rbp movb $0x61, (%rbx) add %rcx, %rcx lea addresses_WC_ht+0x12c8b, %r9 nop nop nop nop sub $56066, %rcx mov (%r9), %r15 nop nop nop nop add %r15, %r15 lea addresses_normal_ht+0xa70b, %rdi clflush (%rdi) nop nop nop nop nop sub %rbx, %rbx movw $0x6162, (%rdi) nop nop nop nop nop and $2262, %rbp lea addresses_WT_ht+0xab63, %rbx nop nop cmp $35873, %r9 and $0xffffffffffffffc0, %rbx vmovntdqa (%rbx), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $1, %xmm4, %rbp sub %rcx, %rcx lea addresses_UC_ht+0x63c7, %r9 clflush (%r9) nop nop and %rdi, %rdi movb $0x61, (%r9) nop nop cmp $37291, %rbx pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r15 pop %r13 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r15 push %r8 push %rax push %rbp push %rdx // Store lea addresses_D+0x1338b, %rdx sub $39207, %r15 movb $0x51, (%rdx) nop inc %r10 // Store lea addresses_normal+0x15c8b, %r15 nop nop nop inc %r12 mov $0x5152535455565758, %rax movq %rax, (%r15) nop nop xor $50099, %r8 // Store lea addresses_WT+0x1b1f, %rbp nop nop nop cmp %r10, %r10 mov $0x5152535455565758, %r12 movq %r12, %xmm5 movups %xmm5, (%rbp) nop nop nop dec %rax // Store lea addresses_UC+0x1870b, %r12 nop nop nop xor %r15, %r15 movw $0x5152, (%r12) nop nop add $57661, %rbp // Load lea addresses_normal+0x498b, %r10 sub $22205, %rax movb (%r10), %r8b nop nop nop nop and %r10, %r10 // Faulty Load lea addresses_WC+0x1c30b, %rax nop nop and $34863, %r15 movb (%rax), %r12b lea oracles, %rdx and $0xff, %r12 shlq $12, %r12 mov (%rdx,%r12,1), %r12 pop %rdx pop %rbp pop %rax pop %r8 pop %r15 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WC', 'congruent': 0}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D', 'congruent': 7}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal', 'congruent': 6}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT', 'congruent': 2}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_UC', 'congruent': 5}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_normal', 'congruent': 5}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WC', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT_ht', 'congruent': 9}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_D_ht', 'congruent': 10}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WT_ht', 'congruent': 2}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC_ht', 'congruent': 7}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_normal_ht', 'congruent': 6}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_WT_ht', 'congruent': 2}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_UC_ht', 'congruent': 2}, 'OP': 'STOR'} {'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 */
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_272.asm
ljhsiun2/medusa
9
164676
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r8 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x109fd, %rsi lea addresses_A_ht+0x123d, %rdi nop add $46793, %r13 mov $127, %rcx rep movsl nop add %rbx, %rbx lea addresses_normal_ht+0x177e5, %rsi lea addresses_WC_ht+0x142f7, %rdi nop nop nop inc %r8 mov $111, %rcx rep movsq nop nop nop nop nop add %r8, %r8 lea addresses_A_ht+0x1b19d, %r13 nop nop nop nop add %rdx, %rdx movb (%r13), %r8b nop nop sub $41942, %rcx lea addresses_WC_ht+0x8ac3, %rcx nop nop dec %rdx mov $0x6162636465666768, %rdi movq %rdi, %xmm2 movups %xmm2, (%rcx) nop cmp %rsi, %rsi lea addresses_UC_ht+0x11b67, %rsi lea addresses_WT_ht+0x1b07d, %rdi nop nop nop nop add $59628, %r12 mov $107, %rcx rep movsw nop xor %rbx, %rbx lea addresses_WC_ht+0x13fd, %r12 clflush (%r12) nop and $24490, %rdi mov (%r12), %r13 nop and $31255, %rbx lea addresses_UC_ht+0x1a06d, %rsi lea addresses_normal_ht+0x19ffd, %rdi nop nop nop and %r13, %r13 mov $60, %rcx rep movsl nop nop nop add $64901, %rcx lea addresses_WC_ht+0x3ffd, %rsi lea addresses_normal_ht+0x3b85, %rdi nop nop sub %rdx, %rdx mov $59, %rcx rep movsb nop nop dec %rbx lea addresses_WT_ht+0x1047d, %r8 nop nop sub $33002, %rsi movw $0x6162, (%r8) nop nop nop xor $15952, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r8 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %rbx push %rcx push %rdi push %rsi // REPMOV lea addresses_WC+0xf0fb, %rsi lea addresses_PSE+0x1346f, %rdi nop nop nop nop xor %r11, %r11 mov $34, %rcx rep movsw add %rdi, %rdi // Faulty Load lea addresses_RW+0x6dfd, %rbx nop nop and %r12, %r12 movb (%rbx), %r11b lea oracles, %r12 and $0xff, %r11 shlq $12, %r11 mov (%r12,%r11,1), %r11 pop %rsi pop %rdi pop %rcx pop %rbx pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_PSE', 'congruent': 1, 'same': False}} [Faulty Load] {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}} {'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 1}} {'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 2, 'NT': True, 'same': False, 'congruent': 3}} {'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 */
src/resources/music_game_over.asm
h1romas4/z88dk-msx-template
5
84390
<reponame>h1romas4/z88dk-msx-template<filename>src/resources/music_game_over.asm ; license:MIT License ; copyright-holders:<NAME> _music_game_over: DB 0 DW _music_game_over_trk1 DW _music_game_over_trk2 DW _music_game_over_trk3 _music_game_over_trk1: DB 201, %10, 200, 15 , 21 , 28 , 20 , 28 , 19 , 28 , 18 , 28 , 17 , 112 DB 255 _music_game_over_trk2: DB 201, %10, 200, 15 , 45 , 7 , 46 , 7 , 45 , 7 , 46 , 7 , 45 , 7 , 46 , 7 DB 45 , 7 , 46 , 7 , 45 , 7 , 46 , 7 , 45 , 7 , 46 , 7 , 45 , 7 , 46 , 7 DB 45 , 7 , 46 , 7 , 45 , 112 DB 255 _music_game_over_trk3: DB 201, %10, 200, 15 , 43 , 7 , 44 , 7 , 43 , 7 , 44 , 7 , 43 , 7 , 44 , 7 DB 43 , 7 , 44 , 7 , 43 , 7 , 44 , 7 , 43 , 7 , 44 , 7 , 43 , 7 , 44 , 7 DB 43 , 7 , 44 , 7 , 43 , 112 DB 255
Library/Config/Pref/prefFileSelector.asm
steakknife/pcgeos
504
26043
<filename>Library/Config/Pref/prefFileSelector.asm<gh_stars>100-1000 COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1992 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: prefFileSelector.asm AUTHOR: <NAME> ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 10/27/92 Initial version. DESCRIPTION: $Id: prefFileSelector.asm,v 1.1 97/04/04 17:50:37 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrefFileSelectorLoadOptions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: Save the original selection PASS: *ds:si = PrefFileSelectorClass object ds:di = PrefFileSelectorClass instance data es = dgroup RETURN: DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 10/27/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ PrefFileSelectorLoadOptions method dynamic PrefFileSelectorClass, MSG_GEN_LOAD_OPTIONS uses ax,cx,dx,bp .enter sub sp, size FileLongName mov di, sp mov cx, ss mov ds, cx mov es, cx lea si, ss:[bp].GOP_category lea dx, ss:[bp].GOP_key call InitFileReadString jc done .leave ret PrefFileSelectorLoadOptions endm
pwnlib/shellcraft/templates/aarch64/linux/setsockopt_timeout.asm
zaratec/pwntools
5
20483
<% from pwnlib.shellcraft.aarch64.linux import setsockopt from pwnlib.shellcraft.aarch64 import mov from pwnlib.constants import SOL_SOCKET, SO_RCVTIMEO %> <%page args="sock, secs"/> <%docstring> Invokes the syscall for setsockopt with specified timeout. See 'man 2 setsockopt' for more information. Arguments: sock(int): sock secs(int): secs </%docstring> eor x4, x4, x4 ${mov('x3', secs)} stp x3, x4, [sp, #-16]! ${setsockopt(sock, 'SOL_SOCKET', 'SO_RCVTIMEO', 'sp', 16)}
build-utils/protocol-base-mspec/src/main/antlr4/org/apache/plc4x/plugins/codegenerator/language/mspec/expression/Expression.g4
amrod-/plc4x
0
2273
grammar Expression; /* This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <http://unlicense.org/> Borrowed part of this Grammar: https://github.com/bkiers/tiny-language-antlr4/blob/master/src/main/antlr4/tl/antlr4/TL.g4 */ expressionString : expression EOF ; expression : '-' expression #unaryMinusExpression | '!' expression #notExpression | <assoc=right> expression '^' expression #powerExpression | expression op=( '*' | '/' | '%' ) expression #multExpression | expression op=( '+' | '-' ) expression #addExpression | expression op=( '>=' | '<=' | '>' | '<' ) expression #compExpression | expression op=( '==' | '!=' ) expression #eqExpression | expression '&&' expression #andExpression | expression '||' expression #orExpression | expression '?' expression ':' expression #ifExpression | Number #numberExpression | Bool #boolExpression | Null #nullExpression | identifierSegment #identifierExpression | String indexes? #stringExpression | '(' expression ')' indexes? #expressionExpression ; identifierSegment : name=Identifier args=identifierSegmentArguments? index=identifierSegmentIndexes? ('.' rest=identifierSegmentRest)? ; identifierSegmentArguments : arguments ; identifierSegmentIndexes : indexes ; identifierSegmentRest : identifierSegment ; arguments : '(' (expression (',' expression)*)? ')' ; indexes : ( '[' expression ']' )+ ; Null : 'null'; Bool : 'true' | 'false' ; Number : Int ( '.' Digit* )? ; Identifier : [a-zA-Z_] [a-zA-Z_0-9]* ; String : ["] ( ~["\r\n\\] | '\\' ~[\r\n] )* ["] | ['] ( ~['\r\n\\] | '\\' ~[\r\n] )* ['] ; Space : [ \t\r\n\u000C] -> skip ; fragment Int : [1-9] Digit* | '0' ; fragment Digit : [0-9] ;
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_720.asm
ljhsiun2/medusa
9
176235
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r8 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0x12498, %rax nop nop xor %r10, %r10 movb (%rax), %r8b nop add %rsi, %rsi lea addresses_D_ht+0x7d28, %rsi lea addresses_UC_ht+0x1be18, %rdi nop nop nop inc %r10 mov $84, %rcx rep movsl add %rax, %rax lea addresses_normal_ht+0x70b8, %rsi nop cmp $65330, %rcx movups (%rsi), %xmm1 vpextrq $1, %xmm1, %r8 inc %rax lea addresses_WT_ht+0xfb18, %rsi lea addresses_A_ht+0x1ecb0, %rdi cmp $30014, %r8 mov $117, %rcx rep movsb nop dec %rax lea addresses_D_ht+0x166b8, %rsi lea addresses_normal_ht+0x168b8, %rdi clflush (%rdi) nop nop nop sub $65504, %r11 mov $5, %rcx rep movsb nop nop cmp %r8, %r8 lea addresses_WC_ht+0xbdb8, %r10 and $32826, %r11 mov $0x6162636465666768, %rax movq %rax, (%r10) nop nop nop nop nop cmp %r11, %r11 lea addresses_UC_ht+0x1beb8, %rax nop add $47691, %r8 movw $0x6162, (%rax) nop nop nop nop cmp %r10, %r10 lea addresses_D_ht+0x15a38, %rcx nop nop dec %rsi movups (%rcx), %xmm7 vpextrq $1, %xmm7, %r10 nop nop nop nop nop xor %rax, %rax lea addresses_D_ht+0x1298, %r10 nop nop nop dec %rax and $0xffffffffffffffc0, %r10 vmovntdqa (%r10), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %r8 nop nop xor $41404, %rax lea addresses_WC_ht+0x56b8, %r11 clflush (%r11) nop nop and $62094, %rsi mov $0x6162636465666768, %rax movq %rax, (%r11) nop nop dec %rsi lea addresses_A_ht+0x74b8, %rsi lea addresses_UC_ht+0xd4b8, %rdi clflush (%rdi) nop nop nop xor %rax, %rax mov $31, %rcx rep movsb nop nop add %rdi, %rdi lea addresses_WC_ht+0x8594, %rsi lea addresses_UC_ht+0x20b8, %rdi nop nop nop sub %rbx, %rbx mov $47, %rcx rep movsw add $23440, %r8 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r9 push %rdx // Faulty Load lea addresses_normal+0x36b8, %rdx nop nop nop cmp $56203, %r11 movups (%rdx), %xmm7 vpextrq $0, %xmm7, %r10 lea oracles, %r11 and $0xff, %r10 shlq $12, %r10 mov (%r11,%r10,1), %r10 pop %rdx pop %r9 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 7}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 4}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': True, 'AVXalign': True, 'size': 8, 'congruent': 7}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}, 'dst': {'same': True, 'congruent': 8, 'type': 'addresses_UC_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_UC_ht'}} {'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 */
Engines/Win32/Blm.asm
Mingzhi5/MalwareRepository
0
177948
<filename>Engines/Win32/Blm.asm use32 BLM: cld lea ebx, [esi+ecx] ; ebx = ptr to end of code to morph nextcode: push ebx xor ecx, ecx push 4 pop ebx call .innext pop ebx rol edx, 7 ; simple RAND function neg dx cmp ebx, esi ja nextcode ret .next: movsb .innext: mov al, [esi] and al, 11100111b cmp al, 00100110b ; es/cs/ss/ds segment? jz .next ; check if more mov al, [esi] and al, 11111110b cmp al, 01100100b ; fs/gs segment? jz .next ; check if more cmp al, 11110010b ; repz/repnz? jz .next ; check if more cmp al, 01100110b ; WORD? jnz opcode mov bl, 2 ; set WORD size jmp .next opcode: mov al, [esi] cmp al, 0fh jnz branch_start movsb or al, [esi] ; ????1111 cmp al, 10001111b jz .6byte ; -> jxx label32 cmp al, 10111111b jz .3byte ; -> movzx/bt? jmp .done .6byte: movsb movsb movsb .3byte: movsb .done: movsb ret branch_start: shl al, 1 jc branch_1xxxxxxx branch_0xxxxxxx:shl al, 1 jc branch_01xxxxxx branch_00xxxxxx:shl al, 4 jnc op_rmrm_d op_eax: mov al, [esi] shr al, 1 jc .pr32 movsb movsb ret ; -> op al, imm8 .pr32: add ecx, ebx ; -> op eax, imm32 rep movsb movsb ret branch_01xxxxxx:cmp al, 11000000b jb .ncjump movsb ; -> jxx label8 .ncjump: cmp al, 068h jz do_5byte ; -> push imm32 cmp al, 06ah jnz .done ; -> popad/pushad/pop/push/dec/inc (reg) stosb ; -> push imm8 .done: movsb ret op_rmrm_d: mov al, [esi+1] ; -> add/or/adc/sbb/and/sub/xor/cmp r/m,r/m rcr edx, 1 ; rand true/false jc .nomorph cmp al, 11000000b .nomorph: jb op_rm ; (jc == jb so little optimization) lodsb xor al, 00000010b stosb lodsb and eax, 00111111b ; 00000000 00regreg shl eax, 5 ; 00000reg reg00000 shr al, 2 ; 00000reg 00reg000 or al, ah ; 00000xxx 00regreg or al, 11000000b ; 11regreg stosb ret branch_1xxxxxxx:shl al, 1 jc branch_11xxxxxx branch_10xxxxxx:shl al, 1 jc branch_101xxxxx branch_100xxxxx:shl al, 1 jc branch_01xxxxxx.ncjump ; -> xchg eax,reg/cwde/cdq/pushf/popf/sahf/lahf branch_1000xxxx:cmp al, 01000000b jae op_rm ; -> test/xchg/mov/lea/pop r/m(,r/m) shl al, 3 jc op_rmimm8 ; -> add/or/adc/sbb/and/sub/xor/cmp r/m,imm8 jmp op_rmimm32 ; -> add/or/adc/sbb/and/sub/xor/cmp r/m,imm32 branch_101xxxxx:shl al, 1 jc branch_1011xxxx branch_1010xxxx:and al, 11100000b cmp al, 00100000b jb op_eax ; -> test eax, imm cmp al, 10000000b jz do_5byte ; -> mov mem32, eax movsb ret ; -> movs/stos/lods/scas branch_1011xxxx:shl al, 1 jnc branch_1100001x.2byte ; -> mov reg, imm8 jmp op_eax.pr32 ; -> mov reg, imm32 do_5byte: movsd movsb ret branch_11xxxxxx:shl al, 1 jc branch_111xxxxx branch_110xxxxx:shl al, 1 jc branch_1101xxxx branch_1100xxxx:cmp al, 11010000b jz branch_1100001x.2byte ; -> int imm8 shl al, 1 jc branch_1100001x.done ; -> leave/int 3 branch_11000xxx:shl al, 1 jc op_rm_w ; -> mov r/m, imm branch_110000xx:shl al, 1 jc branch_1100001x inc ecx ; -> rol/ror/rcl/rcr/shl/shr/sal/sar reg, 1 jmp op_rm branch_1100001x:shl al, 1 jc .done .3byte: movsb .2byte: movsb ; -> ret imm16 .done: movsb ret ; -> ret branch_1101xxxx:shl al, 2 jc branch_1100001x.done ; -> xlatb branch_1101x0xx:jmp op_rm ; -> rol/ror/rcl/rcr/shl/shr/sal/sar reg, 1 branch_111xxxxx:shl al, 1 jc branch_1111xxxx branch_1110xxxx:shl al, 1 jnc branch_11101010 ; -> loop label branch_11101xxx:cmp al, 00100000b jz branch_111010x0.done ; -> call label branch_111010x0:shl al, 2 jc branch_11101010 .done: movsd ; -> jmp label32 movsb ret branch_11101010:movsb movsb ret ; -> jmp label8 branch_1111xxxx:shl al, 1 jc branch_11111xxx branch_11110xxx:shl al, 2 jnc branch_11111xxx.done ; -> cmc branch_11111x1x:mov al, [esi+1] ; al = modr/m and al, 00111000b jnz op_rm ; -> not/mul/div/idiv jmp op_rm_w ; -> test branch_11111xxx:shl al, 1 jc .done ; -> clc/stc/cli shr al, 1 jc op_rm ; -> inc/dec/call/jmp/push .done: movsb ret ; -> cld/std op_rm_w: mov al, [esi] shr al, 1 jnc op_rmimm8 op_rmimm32: add ecx, ebx ; imm length will be 4 or 2 dec ecx op_rmimm8: inc ecx ; imm length = 1 byte op_rm: movsb lodsb stosb cmp al, 11000000b ; op reg, reg jae .done mov ah, al and al, 111b shr ah, 6 jz .regaddr cmp ah, 00000001b jz .ddone add ecx, 3 ; op reg, [reg+dword] .ddone: inc ecx ; op reg, [reg+byte] .cmpsib: cmp al, 00000100b jnz .done xor ebx, ebx mov eax, ebx lodsb ; 00000000 iiregreg shl eax, 2 ; 000000ii regreg00 xchg bl, ah ; 00000000 regreg00 shl eax, 3 ; 00000reg reg00000 shr al, 5 ; 00000reg 00000reg cmp ah, 4 jz .randindex cmp al, 4 jz .nosib or bl, bl ; index = 1? jnz .nosib rcr edx, 1 jnc .nosib ; randomly abort switch xchg al, ah jmp .nosib .randindex: mov bl, dl ; index is random and bl, 00000011b .nosib: shl al, 5 ; 00000reg reg00000 shr eax, 3 ; 00000000 regreg00 mov ah, bl ; 000000ii regreg00 shr eax, 2 ; 00000000 iiregreg stosb .done: rep movsb ret .regaddr: cmp al, 00000101b ; op reg, [dword] jnz .cmpsib movsd jmp .done BLM: db 252,141,28,14,83,49,201,106,4,91,232,13,0,0,0,91 db 193,194,7,102,247,218,57,243,119,234,195,164,138,6,36,231 db 60,38,116,247,138,6,36,254,60,100,116,239,60,242,116,235 db 60,102,117,4,179,2,235,227,138,6,60,15,117,19,164,10 db 6,60,143,116,6,60,191,116,5,235,4,164,164,164,164,164 db 195,208,224,114,75,208,224,114,20,192,224,4,115,31,138,6 db 208,232,114,3,164,164,195,1,217,243,164,164,195,60,192,114 db 1,164,60,104,116,95,60,106,117,1,170,164,195,138,70,1 db 209,218,114,2,60,192,15,130,179,0,0,0,172,52,2,170 db 172,131,224,63,193,224,5,192,232,2,8,224,12,192,170,195 db 208,224,114,52,208,224,114,23,208,224,114,198,60,64,15,131 db 139,0,0,0,192,224,3,15,130,129,0,0,0,235,124,208 db 224,114,12,36,224,60,32,114,149,60,128,116,8,164,195,208 db 224,115,37,235,146,165,164,195,208,224,114,38,208,224,114,27 db 60,208,116,20,208,224,114,17,208,224,114,73,208,224,114,3 db 65,235,76,208,224,114,2,164,164,164,195,192,224,2,114,249 db 235,61,208,224,114,19,208,224,115,12,60,32,116,5,192,224 db 2,114,3,165,164,195,164,164,195,208,224,114,14,192,224,2 db 115,17,138,70,1,36,56,117,22,235,10,208,224,114,4,208 db 232,114,12,164,195,138,6,208,232,115,3,1,217,73,65,164 db 172,170,60,192,115,76,136,196,36,7,192,236,6,116,70,128 db 252,1,116,3,131,193,3,65,60,4,117,54,49,219,137,216 db 172,193,224,2,134,220,193,224,3,192,232,5,128,252,4,116 db 16,60,4,116,17,8,219,117,13,209,218,115,9,134,196,235 db 5,136,211,128,227,3,192,224,5,193,232,3,136,220,193,232 db 2,170,243,164,195,60,5,117,191,165,235,246
src/drivers/eic_u2254/sam-eic.ads
Fabien-Chouteau/samd51-hal
1
16306
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2020, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ package SAM.EIC is type EXTINT_Pin is range 0 .. 15; type EIC_Clock is (GCLK_EIC, CLK_ULP32K); function EIC_Enabled return Boolean; procedure Enable_EIC (Clock : EIC_Clock) with Post => EIC_Enabled; type Sense_Kind is (None, Rise, Fall, Both, High, Low); procedure Configure (Pin : EXTINT_Pin; Sense : Sense_Kind; Enable_Interrupt : Boolean; Debouncer : Boolean; Event_Output : Boolean := False) with Pre => not EIC_Enabled; function Pin_State (Pin : EXTINT_Pin) return Boolean; procedure Enable_Interrupt (Pin : EXTINT_Pin); procedure Disable_Interrupt (Pin : EXTINT_Pin); procedure Clear_Interrupt (Pin : EXTINT_Pin); function Interrupt_State (Pin : EXTINT_Pin) return Boolean; -- NOT IMPLEMENTED -- type Debouncer_Clock is (GCLK_EIC, Low_Frequency_Clock); -- type Debounder_Sample_Nb is (Debouncer_3_Samples, -- Debouncer_7_Samples); -- procedure Configure_Debouncer (Clock : Debouncer_Clock; -- Sample_0 : Debounder_Sample_Nb; -- Prescaler_0 : UInt3; -- Sample_1 : Debounder_Sample_Nb; -- Prescaler_1 : UInt3); -- private for Sense_Kind use (None => 0, Rise => 1, Fall => 2, Both => 3, High => 4, Low => 5); end SAM.EIC;
test/Succeed/ProjectionLikeFunctions.agda
shlevy/agda
1,989
3156
<filename>test/Succeed/ProjectionLikeFunctions.agda -- Getting projection like functions right was a little tricky. -- Here are the cases that didn't work and weren't caught by -- existing test cases. module ProjectionLikeFunctions where record Wrap (A : Set) : Set where constructor [_] field unwrap : A postulate Nat : Set n : Nat Thm : Nat → Set prf : ∀ n → Thm n module M x (p : Thm x) (w : Wrap Nat) where module W = Wrap w module M′ = M n (prf n) ([ n ]) test₁ : Thm M′.W.unwrap test₁ = prf n eq! : ∀ x (S : Thm x) → Wrap Nat → Nat eq! s S [n] = W.unwrap module Local where module W = Wrap [n] test₂ : Thm (eq! n (prf n) [ n ]) test₂ = prf n
dropin/src/lexer-source-c_handler.adb
robdaemon/AdaYaml
32
14592
-- part of AdaYaml, (c) 2017 <NAME> -- released under the terms of the MIT license, see the file "copying.txt" with Interfaces.C; package body Lexer.Source.C_Handler is use type Yaml.C.Bool; procedure Read_Data (S : in out Instance; Buffer : out String; Length : out Natural) is begin if not S.Handler.all (S.Data, Buffer (Buffer'First)'Address, Buffer'Length, Interfaces.C.size_t (Length)) then raise Lexer_Error with "Error when reading into buffer"; end if; end Read_Data; function As_Source (Data : System.Address; Handler : Yaml.C.Read_Handler) return Pointer is (new Instance'(Source.Instance with Handler => Handler, Data => Data)); end Lexer.Source.C_Handler;
programs/oeis/033/A033297.asm
neoneye/loda
22
4998
; A033297: Number of ordered rooted trees with n edges such that the rightmost leaf of each subtree is at even level. Equivalently, number of Dyck paths of semilength n with no return descents of odd length. ; 1,1,4,10,32,100,329,1101,3761,13035,45751,162261,580639,2093801,7601044,27756626,101888164,375750536,1391512654,5172607766,19293659254,72188904386,270870709264,1019033438060,3842912963392,14524440108760,55009110807244,208738840943116,793503375708252,3021483126384052,11523152912842857,44010911964205341,168325218448037769,644618823701692995,2471666671205608267,9488131714654845225,36462672609966897139,140271190177039804261,540154181552935996129,2081972860723556112691,8031945730914342021329,31012484180990101937911,119840995024095249722789,463459124568901443365251,1793658729508346629888469,6946669982024826760157851,26922103775166220126271639,104405794467003145351720261,405146450712613992702888311,1573115207043546660920886145,6111670463470769724309930011,23757496482301856225832487501,92400374973480578024721358379,359559343054472893422888151045,1399855273554345977569591724927,5452601654290527519980066739385,21248351202484324384265154173279,82840109086637979649233164638801,323104886040939006081410278728311,1260746078555181036605362500310585,4921381880029674613881718346905751,19218355863015952211829740199367561,75077494695756027576105644747012564,293401675180060631902903397966534386 lpb $0 mov $2,$0 sub $0,2 seq $2,71724 ; a(n) = 3*binomial(2n, n-1)/(n+2), n > 0, with a(0)=1. add $1,$2 lpe add $1,1 mov $0,$1
Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2.log_9297_1145.asm
ljhsiun2/medusa
9
161736
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r8 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_normal_ht+0x10e58, %rsi lea addresses_A_ht+0x1ccf0, %rdi clflush (%rsi) cmp %r12, %r12 mov $2, %rcx rep movsl xor %rax, %rax lea addresses_UC_ht+0x12658, %r9 cmp %r8, %r8 mov $0x6162636465666768, %rsi movq %rsi, %xmm4 vmovups %ymm4, (%r9) nop nop nop xor %rsi, %rsi lea addresses_normal_ht+0x7f8a, %rsi nop nop cmp %r9, %r9 movb (%rsi), %r12b nop xor %rcx, %rcx lea addresses_UC_ht+0x14000, %rax sub %r9, %r9 mov (%rax), %r8d nop nop nop nop nop inc %rdi lea addresses_WC_ht+0x63cf, %rax xor $58863, %r12 movl $0x61626364, (%rax) nop nop cmp %r8, %r8 lea addresses_D_ht+0x1c938, %rcx nop nop inc %r9 mov (%rcx), %r12 nop nop nop nop and $11997, %rsi lea addresses_D_ht+0x1df58, %rsi lea addresses_D_ht+0x4558, %rdi cmp %r15, %r15 mov $112, %rcx rep movsq nop nop nop and %r9, %r9 pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r8 push %r9 push %rdi push %rsi // Store mov $0x658, %rsi clflush (%rsi) nop nop nop cmp %r8, %r8 mov $0x5152535455565758, %r9 movq %r9, %xmm3 vmovups %ymm3, (%rsi) nop nop and %rdi, %rdi // Faulty Load lea addresses_WC+0xf58, %rdi nop nop nop nop sub %r8, %r8 mov (%rdi), %r12d lea oracles, %r8 and $0xff, %r12 shlq $12, %r12 mov (%r8,%r12,1), %r12 pop %rsi pop %rdi pop %r9 pop %r8 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': True, 'NT': True, 'congruent': 4, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}} {'00': 9297} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
Override/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm
LeeLeahy/quarkfsp
2
87541
<reponame>LeeLeahy/quarkfsp<filename>Override/IntelFsp2Pkg/FspSecCore/Ia32/FspHelper.nasm ;; @file ; Provide FSP helper function. ; ; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR> ; This program and the accompanying materials ; are licensed and made available under the terms and conditions of the BSD License ; which accompanies this distribution. The full text of the license may be found at ; http://opensource.org/licenses/bsd-license.php. ; ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ;; SECTION .text global ASM_PFX(FspInfoHeaderRelativeOff) ASM_PFX(FspInfoHeaderRelativeOff): ; ; This value will be pached by the build script ; DD 0x12345678 global ASM_PFX(AsmGetFspBaseAddress) ASM_PFX(AsmGetFspBaseAddress): mov eax, ASM_PFX(AsmGetFspInfoHeader) sub eax, dword [ASM_PFX(FspInfoHeaderRelativeOff)] add eax, 0x1C mov eax, dword [eax] ret global ASM_PFX(AsmGetFspInfoHeader) ASM_PFX(AsmGetFspInfoHeader): mov eax, ASM_PFX(AsmGetFspInfoHeader) sub eax, dword [ASM_PFX(FspInfoHeaderRelativeOff)] ret
src/norx-compare_tags.ads
jhumphry/SPARK_NORX
9
27756
<gh_stars>1-10 -- NORX.Compare_Tags -- Compare two Tag_Type values using a constant-time approach. This is split out -- into a separate child unit from NORX so that different compilation flags can -- be used. It is advisable to prevent optimisation of this function or else -- a clever compiler might use a short-circuit approach. That might produce -- logically identical results but it would leak information to attackers if -- the timing of the decoding program can be observed. -- Copyright (c) 2016, <NAME> - see LICENSE file for details pragma Restrictions(No_Implementation_Attributes, No_Implementation_Identifiers, No_Implementation_Units, No_Obsolescent_Features); generic function NORX.Compare_Tags (L, R : Tag_Type) return Boolean; -- This function compares two tags and returns a Boolean to indicate -- if they are equal. It aims to perform the comparison in constant -- time regardless of the inputs, as required by section 2.5 of the -- specification
reference_asm/font_from_rom.asm
tashiww/maten_tools
1
247554
; ######################################################################################## ; # Generated by the active disassembly feature of the Exodus emulation platform ; # ; # Creation Date: 2020-11-25 22:30:31 ; # Analysis Region: 0x00001FE8 - 0x0000200C ; ######################################################################################## org $00001FE8 MOVEM.l A1/A0/D2/D1/D0, -(A7) MOVE.w A1, D2 ; $F000 SUBI.w #$0010, D0 ; control codes are $00~$0F ; BMI.b *+$46 ; branch to $203A if control code BMI.b *+$48 ; add 2 cuz exodus adds it in maybe. EXT.l D0 ; contains character code from table ; LSL.w #5, D0 ; multiply character code by 32 for 16x16 font LSL.w #4, D0 ; 8x16 font so we only do half that much LEA $000648E6, A0 ; ROM offset for font ADDA.l D0, A0 MOVEM.l A0/D0, -(A7) MOVE.w #$0080, D0 ; BSR.w *+$1B1A ; jump to $3B24
src/features/paging/set_kernel_break.asm
FranchuFranchu/fran-os
1
174957
<reponame>FranchuFranchu/fran-os<filename>src/features/paging/set_kernel_break.asm ; Implements sbrk() for the kernel kernel_break_point dd 0 ; Needs to be done after paging kernel_set_break_setup: call kernel_paging_new_kernel_page.calculate_virtual_address mov [kernel_break_point], ebx mov eax, [kernel_break_point] ret ; https://linux.die.net/man/2/sbrk ; IN = ebx: Signed number representing how much to increment/decrement the kernel area ; OUT = ebx: New end of kernel memory kernel_set_break: push eax push ecx cmp ebx, 0 jnz .nonzero ; Zero mov ebx, [kernel_break_point] pop ecx pop eax ret .nonzero: test ebx, 1 << 31 jz .unsigned .signed: and ebx, ~(1<<31) sub ebx, 1 << 31 ret ; Freeing kernel pages isn't implemented yet .unsigned: add ebx, [kernel_break_point] .allocate_if_necessary: ; Check if new pages need to be allocated mov eax, [kernel_break_point] shr ebx, 12 shr eax, 12 sub ebx, eax mov ecx, ebx .loopy: cmp ecx, 0 je .end push ecx call kernel_paging_new_kernel_page pop ecx dec ecx jmp .loopy .end: add ebx, 4096 mov [kernel_break_point], ebx pop ecx pop eax ret
oeis/144/A144739.asm
neoneye/loda-programs
11
244203
; A144739: 7-factorial numbers A114799(7*n+3): Partial products of A017017(k) = 7*k+3, a(0) = 1. ; 1,3,30,510,12240,379440,14418720,648842400,33739804800,1990648483200,131382799891200,9590944392057600,767275551364608000,66752972968720896000,6274779459059764224000,633752725365036186624000,68445294339423908155392000,7871208849033749437870080000,960287479582117431420149760000,123877084866093148653199319040000,16847283541788668216835107389440000,2409161546475779555007420356689920000,361374231971366933251113053503488000000,56735754419504608520424749400047616000000 mov $2,4 mov $3,3 mov $4,$0 lpb $4 mul $2,$3 add $3,7 sub $4,1 lpe mov $0,$2 div $0,4
src/sys/processes/util-processes-tools.adb
RREE/ada-util
60
9445
<gh_stars>10-100 ----------------------------------------------------------------------- -- util-processes-tools -- System specific and low level operations -- Copyright (C) 2018, 2019 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Systems.Os; with Util.Streams.Texts; package body Util.Processes.Tools is procedure Execute (Command : in String; Process : in out Util.Streams.Pipes.Pipe_Stream; Output : in out Util.Strings.Vectors.Vector; Status : out Integer) is Text : Util.Streams.Texts.Reader_Stream; begin Text.Initialize (Process'Unchecked_Access); Process.Open (Command, Util.Processes.READ); while not Text.Is_Eof loop declare Line : Ada.Strings.Unbounded.Unbounded_String; begin Text.Read_Line (Line, Strip => True); if Ada.Strings.Unbounded.Length (Line) > 0 then Output.Append (Ada.Strings.Unbounded.To_String (Line)); end if; end; end loop; Process.Close; Status := Process.Get_Exit_Status; end Execute; -- ------------------------------ -- Execute the command and append the output in the vector array. -- The program output is read line by line and the standard input is closed. -- Return the program exit status. -- ------------------------------ procedure Execute (Command : in String; Output : in out Util.Strings.Vectors.Vector; Status : out Integer) is Proc : Util.Streams.Pipes.Pipe_Stream; begin Proc.Add_Close (Util.Systems.Os.STDIN_FILENO); Execute (Command, Proc, Output, Status); end Execute; procedure Execute (Command : in String; Input_Path : in String; Output : in out Util.Strings.Vectors.Vector; Status : out Integer) is Proc : Util.Streams.Pipes.Pipe_Stream; begin Proc.Set_Input_Stream (Input_Path); Execute (Command, Proc, Output, Status); end Execute; end Util.Processes.Tools;
alloy4fun_models/trashltl/models/9/zRxamj9XpATDrckN8.als
Kaixi26/org.alloytools.alloy
0
12
open main pred idzRxamj9XpATDrckN8_prop10 { always no Protected - Protected' } pred __repair { idzRxamj9XpATDrckN8_prop10 } check __repair { idzRxamj9XpATDrckN8_prop10 <=> prop10o }
src/risi_script-types-implementation-creators.ads
OneWingedShark/Risi
1
11152
<reponame>OneWingedShark/Risi With Risi_Script.Types.Internals; Private With Risi_Script.Types.Implementation; Private Package Risi_Script.Types.Implementation.Creators is Package Internal renames Risi_Script.Types.Internals; Function Create ( Item : Internal.Integer_Type ) return Representation; -- Function Create ( Item : Internal.Array_Type ) return Representation; -- Function Create ( Item : Internal.Hash_Type ) return Representation; -- Function Create ( Item : Internal.String_Type ) return Representation; Function Create ( Item : Internal.Real_Type ) return Representation; Function Create ( Item : Internal.Pointer_Type ) return Representation; -- Function Create ( Item : Internal.Reference_Type) return Representation; Function Create ( Item : Internal.Fixed_Type ) return Representation; Function Create ( Item : Internal.Boolean_Type ) return Representation; Function Create ( Item : Internal.Func_Type ) return Representation; Private Function Create ( Item : Internal.Integer_Type ) return Representation renames Internal_Create; Function Create ( Item : Internal.Real_Type ) return Representation renames Internal_Create; Function Create ( Item : Internal.Pointer_Type ) return Representation renames Internal_Create; Function Create ( Item : Internal.Fixed_Type ) return Representation renames Internal_Create; Function Create ( Item : Internal.Boolean_Type ) return Representation renames Internal_Create; Function Create ( Item : Internal.Func_Type ) return Representation renames Internal_Create; End Risi_Script.Types.Implementation.Creators;
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_15_1836.asm
ljhsiun2/medusa
9
1992
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r15 push %rbp push %rdx lea addresses_normal_ht+0x1727d, %r11 nop nop and $44337, %rbp movl $0x61626364, (%r11) nop nop nop nop nop inc %r15 pop %rdx pop %rbp pop %r15 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r14 push %r9 push %rcx // Faulty Load lea addresses_A+0x1166, %r13 nop nop nop dec %r14 vmovups (%r13), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %rcx lea oracles, %r11 and $0xff, %rcx shlq $12, %rcx mov (%r11,%rcx,1), %rcx pop %rcx pop %r9 pop %r14 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal_ht'}} {'00': 15} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
programs/oeis/335/A335756.asm
neoneye/loda
22
176882
<gh_stars>10-100 ; A335756: A cup filling problem starting with 2 empty cups of sizes 3 and n, where a(n) is the number of unreachable states (see details in comments). ; 2,0,2,12,6,8,22,12,14,32,18,20,42,24,26,52,30,32,62,36,38,72,42,44,82,48,50,92,54,56,102,60,62,112,66,68,122,72,74,132,78,80,142,84,86,152,90,92,162,96,98,172,102,104,182,108,110,192,114,116,202,120,122,212,126,128,222 mov $1,$0 gcd $0,3 add $0,2 mov $2,3 add $2,$1 mul $0,$2 sub $0,12 div $0,3 mul $0,2
test/Fail/Safe-flag-only-scope-checking-1.agda
alhassy/agda
3
899
<filename>test/Fail/Safe-flag-only-scope-checking-1.agda {-# OPTIONS --safe #-} useful-lemma : ∀ {a} {A : Set a} → A useful-lemma = useful-lemma
include/sf-network-tcpsocket.ads
Fabien-Chouteau/ASFML
0
26068
--////////////////////////////////////////////////////////// -- SFML - Simple and Fast Multimedia Library -- Copyright (C) 2007-2015 <NAME> (<EMAIL>) -- This software is provided 'as-is', without any express or implied warranty. -- In no event will the authors be held liable for any damages arising from the use of this software. -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it freely, -- subject to the following restrictions: -- 1. The origin of this software must not be misrepresented; -- you must not claim that you wrote the original software. -- If you use this software in a product, an acknowledgment -- in the product documentation would be appreciated but is not required. -- 2. Altered source versions must be plainly marked as such, -- and must not be misrepresented as being the original software. -- 3. This notice may not be removed or altered from any source distribution. --////////////////////////////////////////////////////////// --////////////////////////////////////////////////////////// with Sf.Network.IpAddress; with Sf.System.Time; with Sf.Network.SocketStatus; with System; package Sf.Network.TcpSocket is --////////////////////////////////////////////////////////// --////////////////////////////////////////////////////////// --////////////////////////////////////////////////////////// --////////////////////////////////////////////////////////// --////////////////////////////////////////////////////////// --/ @brief Create a new TCP socket --/ --/ @return A new sfTcpSocket object --/ --////////////////////////////////////////////////////////// function create return sfTcpSocket_Ptr; --////////////////////////////////////////////////////////// --/ @brief Destroy a TCP socket --/ --/ @param socket TCP socket to destroy --/ --////////////////////////////////////////////////////////// procedure destroy (socket : sfTcpSocket_Ptr); --////////////////////////////////////////////////////////// --/ @brief Set the blocking state of a TCP listener --/ --/ In blocking mode, calls will not return until they have --/ completed their task. For example, a call to --/ sfTcpSocket_receive in blocking mode won't return until --/ new data was actually received. --/ In non-blocking mode, calls will always return immediately, --/ using the return code to signal whether there was data --/ available or not. --/ By default, all sockets are blocking. --/ --/ @param socket TCP socket object --/ @param blocking sfTrue to set the socket as blocking, sfFalse for non-blocking --/ --////////////////////////////////////////////////////////// procedure setBlocking (socket : sfTcpSocket_Ptr; blocking : sfBool); --////////////////////////////////////////////////////////// --/ @brief Tell whether a TCP socket is in blocking or non-blocking mode --/ --/ @param socket TCP socket object --/ --/ @return sfTrue if the socket is blocking, sfFalse otherwise --/ --////////////////////////////////////////////////////////// function isBlocking (socket : sfTcpSocket_Ptr) return sfBool; --////////////////////////////////////////////////////////// --/ @brief Get the port to which a TCP socket is bound locally --/ --/ If the socket is not connected, this function returns 0. --/ --/ @param socket TCP socket object --/ --/ @return Port to which the socket is bound --/ --////////////////////////////////////////////////////////// function getLocalPort (socket : sfTcpSocket_Ptr) return sfUint16; --////////////////////////////////////////////////////////// --/ @brief Get the address of the connected peer of a TCP socket --/ --/ It the socket is not connected, this function returns --/ sfIpAddress_None. --/ --/ @param socket TCP socket object --/ --/ @return Address of the remote peer --/ --////////////////////////////////////////////////////////// function getRemoteAddress (socket : sfTcpSocket_Ptr) return Sf.Network.IpAddress.sfIpAddress; --////////////////////////////////////////////////////////// --/ @brief Get the port of the connected peer to which --/ a TCP socket is connected --/ --/ If the socket is not connected, this function returns 0. --/ --/ @param socket TCP socket object --/ --/ @return Remote port to which the socket is connected --/ --////////////////////////////////////////////////////////// function getRemotePort (socket : sfTcpSocket_Ptr) return sfUint16; --////////////////////////////////////////////////////////// --/ @brief Connect a TCP socket to a remote peer --/ --/ In blocking mode, this function may take a while, especially --/ if the remote peer is not reachable. The last parameter allows --/ you to stop trying to connect after a given timeout. --/ If the socket was previously connected, it is first disconnected. --/ --/ @param socket TCP socket object --/ @param remoteAddress Address of the remote peer --/ @param remotePort Port of the remote peer --/ @param timeout Maximum time to wait --/ --/ @return Status code --/ --////////////////////////////////////////////////////////// function connect (socket : sfTcpSocket_Ptr; remoteAddress : Sf.Network.IpAddress.sfIpAddress; remotePort : sfUint16; timeout : Sf.System.Time.sfTime) return Sf.Network.SocketStatus.sfSocketStatus; --////////////////////////////////////////////////////////// --/ @brief Disconnect a TCP socket from its remote peer --/ --/ This function gracefully closes the connection. If the --/ socket is not connected, this function has no effect. --/ --/ @param socket TCP socket object --/ --////////////////////////////////////////////////////////// procedure disconnect (socket : sfTcpSocket_Ptr); --////////////////////////////////////////////////////////// --/ @brief Send raw data to the remote peer of a TCP socket --/ --/ To be able to handle partial sends over non-blocking --/ sockets, use the sfTcpSocket_sendPartial(sfTcpSocket*, const void*, std::size_t, sfSize_t*) --/ overload instead. --/ This function will fail if the socket is not connected. --/ --/ @param socket TCP socket object --/ @param data Pointer to the sequence of bytes to send --/ @param size Number of bytes to send --/ --/ @return Status code --/ --////////////////////////////////////////////////////////// function send (socket : sfTcpSocket_Ptr; data : Standard.System.Address; size : sfSize_t) return Sf.Network.SocketStatus.sfSocketStatus; --////////////////////////////////////////////////////////// --/ @brief Send raw data to the remote peer --/ --/ This function will fail if the socket is not connected. --/ --/ @param socket TCP socket object --/ @param data Pointer to the sequence of bytes to send --/ @param size Number of bytes to send --/ @param sent The number of bytes sent will be written here --/ --/ @return Status code --/ --////////////////////////////////////////////////////////// function sendPartial (socket : sfTcpSocket_Ptr; data : Standard.System.Address; size : sfSize_t; sent : access sfSize_t) return Sf.Network.SocketStatus.sfSocketStatus; --////////////////////////////////////////////////////////// --/ @brief Receive raw data from the remote peer of a TCP socket --/ --/ In blocking mode, this function will wait until some --/ bytes are actually received. --/ This function will fail if the socket is not connected. --/ --/ @param socket TCP socket object --/ @param data Pointer to the array to fill with the received bytes --/ @param size Maximum number of bytes that can be received --/ @param received This variable is filled with the actual number of bytes received --/ --/ @return Status code --/ --////////////////////////////////////////////////////////// function receive (socket : sfTcpSocket_Ptr; data : Standard.System.Address; size : sfSize_t; received : access sfSize_t) return Sf.Network.SocketStatus.sfSocketStatus; --////////////////////////////////////////////////////////// --/ @brief Send a formatted packet of data to the remote peer of a TCP socket --/ --/ In non-blocking mode, if this function returns sfSocketPartial, --/ you must retry sending the same unmodified packet before sending --/ anything else in order to guarantee the packet arrives at the remote --/ peer uncorrupted. --/ This function will fail if the socket is not connected. --/ --/ @param socket TCP socket object --/ @param packet Packet to send --/ --/ @return Status code --/ --////////////////////////////////////////////////////////// function sendPacket (socket : sfTcpSocket_Ptr; packet : sfPacket_Ptr) return Sf.Network.SocketStatus.sfSocketStatus; --////////////////////////////////////////////////////////// --/ @brief Receive a formatted packet of data from the remote peer --/ --/ In blocking mode, this function will wait until the whole packet --/ has been received. --/ This function will fail if the socket is not connected. --/ --/ @param socket TCP socket object --/ @param packet Packet to fill with the received data --/ --/ @return Status code --/ --////////////////////////////////////////////////////////// function receivePacket (socket : sfTcpSocket_Ptr; packet : sfPacket_Ptr) return Sf.Network.SocketStatus.sfSocketStatus; private pragma Import (C, create, "sfTcpSocket_create"); pragma Import (C, destroy, "sfTcpSocket_destroy"); pragma Import (C, setBlocking, "sfTcpSocket_setBlocking"); pragma Import (C, isBlocking, "sfTcpSocket_isBlocking"); pragma Import (C, getLocalPort, "sfTcpSocket_getLocalPort"); pragma Import (C, getRemoteAddress, "sfTcpSocket_getRemoteAddress"); pragma Import (C, getRemotePort, "sfTcpSocket_getRemotePort"); pragma Import (C, connect, "sfTcpSocket_connect"); pragma Import (C, disconnect, "sfTcpSocket_disconnect"); pragma Import (C, send, "sfTcpSocket_send"); pragma Import (C, sendPartial, "sfTcpSocket_sendPartial"); pragma Import (C, receive, "sfTcpSocket_receive"); pragma Import (C, sendPacket, "sfTcpSocket_sendPacket"); pragma Import (C, receivePacket, "sfTcpSocket_receivePacket"); end Sf.Network.TcpSocket;
AntlrLeftRecursionBenchmark/LeftRecursionGrammar.g4
KvanTTT/AntlrBenchmarks
2
6600
<filename>AntlrLeftRecursionBenchmark/LeftRecursionGrammar.g4 grammar LeftRecursionGrammar; leftRecExprRoot : leftRecExpr EOF ; notLeftRecExprRoot : notLeftRecExpr EOF ; leftRecExpr : atom | <assoc=right> leftRecExpr '^' leftRecExpr | leftRecExpr ('*' | '/' | '%') leftRecExpr | leftRecExpr ('+' | '-') leftRecExpr | leftRecExpr ('==' | '!=') leftRecExpr | leftRecExpr '&&' leftRecExpr | leftRecExpr '||' leftRecExpr ; notLeftRecExpr : logicalAndExpr ('||' logicalAndExpr)* ; logicalAndExpr : equalExpr ('&&' equalExpr)* ; equalExpr : addExpr (('==' | '!=') addExpr)* ; addExpr : multExpr (('+' | '-') multExpr)* ; multExpr : powerExpr (('*' | '/' | '%') powerExpr)* ; powerExpr : atom ('^' atom)* ; atom : ID | DIGIT ; CARET: '^'; STAR : '*'; SLASH: '/'; PERCENT: '%'; PLUS: '+'; MINUS: '-'; EQUAL: '=='; NOT_EQUAL: '!='; LOGICAL_AND: '&&'; LOGICAL_OR: '||'; QUESTION: '?'; COLON: ':'; ID: [a-zA-Z_][a-zA-Z0-9_]*; DIGIT: [0-9]+; WS: [ \t\r\n] -> channel(HIDDEN);
test/Succeed/Issue1724.agda
KDr2/agda
0
6475
<reponame>KDr2/agda {-# OPTIONS --cubical-compatible --rewriting --confluence-check #-} module _ where {- Rewriting relation -} postulate _↦_ : ∀ {i} {A : Set i} → A → A → Set i idr : ∀ {i} {A : Set i} {a : A} → a ↦ a {-# BUILTIN REWRITE _↦_ #-} {- Identity type -} infixr 3 _==_ data _==_ {i} {A : Set i} (a : A) : A → Set i where idp : a == a ap : ∀ {i j} {A : Set i} {B : Set j} (f : A → B) {x y : A} → (p : x == y) → f x == f y ap f idp = idp postulate A : Set C : A → Set -- Definition of W postulate W : Set c : A → W module _ {l} {P : W → Set l} (c* : (a : A) → P (c a)) where postulate W-elim : (w : W) → P w W-c-β : (a : A) → W-elim (c a) ↦ c* a {-# REWRITE W-c-β #-} -- Definition of P P : W → Set P = W-elim C -- Definition of WT postulate WT : Set cT : (a : A) (x : C a) → WT -- Definition of TotP record TotP : Set where constructor _,_ field fst : W snd : P fst -- Function from TotP to WT from-curry : (x : W) (y : P x) → WT from-curry = W-elim cT from : TotP → WT from (x , y) = from-curry x y postulate a : A x y : C a foo : (c a , x) == (c a , y) bar : cT a x == cT a y rew1 : ap from foo ↦ bar {-# REWRITE rew1 #-} -- The following has exactly the same type as [rew1], so [idr] should work rew1' : ap from foo ↦ bar rew1' = idr
handyman.raven/src/main/antlr/in.handyman.raven/gmr/Raven.g4
SP-2827/handyman
1
1999
<gh_stars>1-10 grammar Raven; import JSON; process: 'process' name=STRING '{' tryBlock=tryClause catchBlock=catchClause finallyBlock= finallyClause '}'; tryClause : 'try' '{' (actions+=action)* '}' ; finallyClause: 'finally' '{' (actions+=action)* '}' ; catchClause: 'catch' '{' (actions+=action)* '}' ; action: (abort |assign |callProcess |forkProcess |spawnProcess |dogLeg |copyData |dropFile |loadCsv |restApi |transform |multitude |exportCsv |createDirectory |createFile |deleteFileDirectory |transferFileDirectory |createTAR |extractTAR |importCsvToDB |producerConsumerModel |producer |consumer |pushJson |mapJsonContext); multitude: 'multitude' 'as' name=STRING ('on' on= STRING)* 'using' '{' (actions+=action)* '}' ('on-condition' condition=expression)* ('fielding' writeThreadCount=NON_ZERO_DIGIT)*; // this is for creating POJO WRT definition //attribute:(startProcess); copyData: ('copydata' 'as' name=STRING 'from' source=STRING 'to' to=STRING 'using' '{' value=STRING '}' ('on-condition' condition=expression)* ('fielding' writeThreadCount=NON_ZERO_DIGIT)* ('with-fetch-batch-size' fetchBatchSize=NON_ZERO_DIGIT)* ('with-write-batch-size' writeBatchSize=NON_ZERO_DIGIT)*) ; transform: 'transform' 'as' name= STRING 'on' on= STRING 'using' '{' value+=STRING '}' ('on-condition' condition=expression)* ('do-format' format=expression)*; loadCsv: 'loadcsv' 'as' name=STRING 'pid' pid=STRING 'from' source=STRING 'to' to=STRING 'with' delim=STRING 'by-batch' limit=STRING 'using' '{' value=STRING '}' ('on-condition' condition=expression)*; abort: 'abort' 'as' name=STRING '{' value=STRING '}' ('on-condition' condition=expression)* ; callProcess: 'callprocess' 'as' name=STRING 'with-target' target=STRING 'from-file' source=STRING 'using' datasource=STRING 'for-every' '{' value=STRING '}' ('on-condition' condition=expression)* ('on-parallel-fielding' forkBatchSize=STRING)*; forkProcess: 'forkprocess' 'as' name=STRING 'with-target' target=STRING 'from-file' source=STRING 'using' datasource=STRING 'for-every' '{' value=STRING '}' ('watermark' forkBatchSize=STRING)* ('on-condition' condition=expression)*; spawnProcess: 'spawn' 'as' name=STRING 'with-target' target=STRING 'from-file' source=STRING ('on-condition' condition=expression)*; dogLeg: 'dogleg' 'as' name=STRING 'use-parent-context' inheritContext=STRING 'using' '{' processList+=startProcess '}' ('on-condition' condition=expression)*; startProcess: 'start-process' name=STRING 'with-file' target=STRING ; assign: 'assign' 'as' name=STRING 'source' source=STRING 'using' '{' value=STRING '}' ('on-condition' condition=expression)* ; dropFile: 'dropfile' 'as' name=STRING 'in-path' target=STRING ('on-condition' condition=expression)* ; restApi: 'restapi' 'as' name=STRING 'source' source=STRING 'using' 'url' url=STRING 'method' method=STRING ('with headers' headers=json)* ('with params' params=json )* ('with body type' '{' bodyType=STRING '}') '{' (value+=restPart)* '}' ('on-condition' condition=expression)*; restPart: '{ part' 'as' partName=STRING 'with' partData=STRING ('type as' type=STRING)* '}'; exportCsv: 'exportCsv' 'as' name=STRING 'source' source=STRING 'executionSource' executionSource=STRING ('using' stmt= STRING)* 'targetLocation' targetLocation=STRING 'using' '{''}' ('on-condition' condition=expression)* ('fielding' writeThreadCount=STRING)* ; importCsvToDB: 'importCsvToDB' 'as' name= STRING 'target' target=resource 'on' tableName=STRING 'using' '{' value+=STRING '}' ('on-condition' condition=expression)* ('fielding' writeThreadCount=STRING)* ('batch' batchSize=STRING)*; extractTAR: 'extractTAR' 'as' name= STRING 'from' source=STRING 'destination' destination=STRING 'using' '{''}' ('on-condition' condition=expression)*; createTAR: 'createTAR' 'as' name= STRING 'from' source=STRING 'destination' destination=STRING 'extension' extension=STRING 'using' '{''}' ('on-condition' condition=expression)*; createDirectory: 'createDirectory' 'as' name= STRING 'using' '{' directoryPath+=STRING '}' ('on-condition' condition=expression)*; createFile: 'createFile' 'as' name= STRING 'location' location=STRING 'fileName' fileName=STRING 'extension' extension=STRING 'using' '{' value=STRING '}' ('on-condition' condition=expression)*; deleteFileDirectory: 'deleteFileDirectory' 'as' name= STRING 'using' '{' path+=STRING '}' ('on-condition' condition=expression)*; transferFileDirectory: 'transferFileDirectory' 'as' name= STRING 'from' source=STRING 'to' to=STRING 'operation' operation=STRING 'using' value=STRING '}' ('on-condition' condition=expression)*; producerConsumerModel: 'pcm' 'as' name=STRING 'on-resource' source=resource 'produce''{' produce+=producer '}' ('fielding' produceThreadCount=STRING)* 'consume''{' consume+=consumer '}'('fielding' consumeThreadCount=STRING)* ('on-condition' condition=expression)*; producer: 'producer''as' name=STRING ('push-result-at' push=STRING)* ('on-resource' source=resource)* 'for-every''{' stmt=STRING '}' 'execute''{' (actions+=action)* '}' ('on-condition' condition=expression)* ('fielding' threadCount=STRING)*; consumer: 'consumer''as' name=STRING ( 'pop-event-from' event=STRING 'on-resource' source=resource )* ('pop-result-from' pop=STRING 'limit' limit=STRING)* 'execute' '{' (actions+=action)* '}' ('on-condition' condition=expression)* ('fielding' threadCount=STRING)* ('on-standalone' standalone=expression)* ; pushJson : 'push-json-into-context' 'as' name=STRING 'with-key' key=STRING 'using-value' '{' value=json '}' ('on-condition' condition=expression)* ; mapJsonContext : 'map-json-into-context' 'as' name=STRING 'using' '{' value=STRING '}' ('on-condition' condition=expression)* ; expression :'if' (lhs=STRING operator=Operator rhs=STRING); log: 'log' 'as' 'level' level=STRING 'with' 'message' '{' message=STRING '}'; exception: 'raise exception' '{' message=STRING '}'; resource : STRING; //rules fragment DIGIT : [0-9]; fragment NON_Z_DIGIT : [1-9]; fragment TWODIGIT : DIGIT DIGIT; fragment LETTER : [A-Za-z]; fragment StringCharacters : StringCharacter+ ; fragment StringCharacter : ~["\\] ; NON_ZERO_DIGIT: NON_Z_DIGIT+; STRING : '"' StringCharacters? '"'; CRLF : ('\r'? '\n' | '\r')-> channel(HIDDEN) ; Operator: '<'|'>'|'=='|'contains' ; WS : [ \t\r\n\u000C]+ -> channel(HIDDEN) ; COMMENT : '/*' .*? '*/' -> channel(HIDDEN) ; LINE_COMMENT : '//' ~[\r\n]* -> channel(HIDDEN) ;
2 Year/2015 Pattern/MPL/Assignment 8.asm
bhushanasati25/College
4
240258
<reponame>bhushanasati25/College<gh_stars>1-10 ;Problem Statement:Write X86 menu driven Assembly Language Program (ALP) to implement OS (DOS) commands TYPE, COPY and DELETE using file operations. User is supposed to provide ;command line arguments in all cases. %macro cmn 4 ;input/output mov rax,%1 mov rdi,%2 mov rsi,%3 mov rdx,%4 syscall %endmacro %macro exit 0 mov rax,60 mov rdi,0 syscall %endmacro %macro fopen 1 mov rax,2 ;open mov rdi,%1 ;filename mov rsi,2 ;mode RW mov rdx,0777o ;File permissions syscall %endmacro %macro fread 3 mov rax,0 ;read mov rdi,%1 ;filehandle mov rsi,%2 ;buf mov rdx,%3 ;buf_len syscall %endmacro %macro fwrite 3 mov rax,1 ;write/print mov rdi,%1 ;filehandle mov rsi,%2 ;buf mov rdx,%3 ;buf_len syscall %endmacro %macro fclose 1 mov rax,3 ;close mov rdi,%1 ;file handle syscall %endmacro section .data menu db 'MENU : ',0Ah db "1. TYPE",0Ah db "2. COPY",0Ah db "3. DELETE",0Ah db "4. Exit",0Ah db "Enter your choice : " menulen equ $-menu msg db "Command : " msglen equ $-msg cpysc db "File copied successfully !!",0Ah cpysclen equ $-cpysc delsc db 'File deleted successfully !!',0Ah delsclen equ $-delsc err db "Error ...",0Ah errlen equ $-err cpywr db 'Command does not exist',0Ah cpywrlen equ $-cpywr err_par db 'Insufficient parameter',0Ah err_parlen equ $-err_par section .bss choice resb 2 buffer resb 50 name1 resb 15 name2 resb 15 cmdlen resb 1 filehandle1 resq 1 filehandle2 resq 1 abuf_len resq 1 ; actual buffer length dispnum resb 2 buf resb 4096 buf_len equ $-buf ; buffer initial length section .text global _start _start: again: cmn 1,1,menu,menulen cmn 0,0,choice,2 mov al,byte[choice] cmp al,31h jbe op1 cmp al,32h jbe op2 cmp al,33h jbe op3 exit ret op1: call tproc jmp again op2: call cpproc jmp again op3: call delproc jmp again ;type command procedure tproc: cmn 1,1,msg,msglen cmn 0,0,buffer,50 mov byte[cmdlen],al dec byte[cmdlen] mov rsi,buffer mov al,[rsi] ;search for correct type command cmp al,'t' jne skipt inc rsi dec byte[cmdlen] jz skipt mov al,[rsi] cmp al,'y' jne skipt inc rsi dec byte[cmdlen] jz skipt mov al,[rsi] cmp al,'p' jne skipt inc rsi dec byte[cmdlen] jz skipt mov al,[rsi] cmp al,'e' jne skipt inc rsi dec byte[cmdlen] jnz correctt cmn 1,1,err_par,err_parlen call exit skipt: cmn 1,1,cpywr,cpywrlen exit correctt: mov rdi,name1 ;finding file name call find_name fopen name1 ; on succes returns handle cmp rax,-1H ; on failure returns -1 jle error mov [filehandle1],rax xor rax,rax fread [filehandle1],buf, buf_len mov [abuf_len],rax dec byte[abuf_len] cmn 1,1,buf,abuf_len ;printing file content on screen ret ;copy command procedure cpproc: cmn 1,1,msg,msglen cmn 0,0,buffer,50 ;accept command mov byte[cmdlen],al dec byte[cmdlen] mov rsi,buffer mov al,[rsi] ;search for copy cmp al,'c' jne skip inc rsi dec byte[cmdlen] jz skip mov al,[rsi] cmp al,'o' jne skip inc rsi dec byte[cmdlen] jz skip mov al,[rsi] cmp al,'p' jne skip inc rsi dec byte[cmdlen] jz skip mov al,[rsi] cmp al,'y' jne skip inc rsi dec byte[cmdlen] jnz correct cmn 1,1,err_par,err_parlen exit skip: cmn 1,1,cpywr,cpywrlen exit correct: mov rdi,name1 ;finding first file name call find_name mov rdi,name2 ;finding second file name call find_name skip3: fopen name1 ; on succes returns handle cmp rax,-1H ; on failure returns -1 jle error mov [filehandle1],rax fopen name2 ; on succes returns handle cmp rax,-1H ; on failure returns -1 jle error mov [filehandle2],rax xor rax,rax fread [filehandle1],buf, buf_len mov [abuf_len],rax dec byte[abuf_len] fwrite [filehandle2],buf, [abuf_len] ;write to file fclose [filehandle1] fclose [filehandle2] cmn 1,1,cpysc,cpysclen jmp again error: cmn 1,1,err,errlen exit ret ;delete command procedure delproc: cmn 1,1,msg,msglen cmn 0,0,buffer,50 ;accept command mov byte[cmdlen],al dec byte[cmdlen] mov rsi,buffer mov al,[rsi] ;search for copy cmp al,'d' jne skipr inc rsi dec byte[cmdlen] jz skipr mov al,[rsi] cmp al,'e' jne skipr inc rsi dec byte[cmdlen] jz skipr mov al,[rsi] cmp al,'l' jne skipr inc rsi dec byte[cmdlen] jnz correctr cmn 1,1,err_par,err_parlen exit skipr: cmn 1,1,cpywr,cpywrlen exit correctr: mov rdi,name1 ;finding first file name call find_name mov rax,87 ;unlink system call mov rdi,name1 syscall cmp rax,-1H ; on failure returns -1 jle errord cmn 1,1,delsc,delsclen jmp again errord: cmn 1,1,err,errlen exit ret find_name: ;finding file name from command inc rsi dec byte[cmdlen] cont1: mov al,[rsi] mov [rdi],al inc rdi inc rsi mov al,[rsi] cmp al,20h ;searching for space je skip2 cmp al,0Ah ;searching for enter key je skip2 dec byte[cmdlen] jnz cont1 cmn 1,1,err,errlen exit skip2: ret
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt35_pkg.ads
best08618/asylo
7
27510
package Opt35_Pkg is pragma Pure; E : Exception; function F (I : Integer) return Integer; end Opt35_Pkg;
examples/timer/peripherals.ads
ekoeppen/STM32_Generic_Ada_Drivers
1
5469
with STM32GD.Timer; with STM32GD.Timer.Peripheral; with STM32_SVD.Interrupts; package Peripherals is package Timer is new STM32GD.Timer.Peripheral; end Peripherals;
Transynther/x86/_processed/NC/_zr_/i9-9900K_12_0xa0_notsx.log_21829_192.asm
ljhsiun2/medusa
9
247417
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r14 push %r15 push %rcx push %rsi // Faulty Load mov $0x26e097000000015a, %rcx nop add %rsi, %rsi mov (%rcx), %r15w lea oracles, %rcx and $0xff, %r15 shlq $12, %r15 mov (%rcx,%r15,1), %r15 pop %rsi pop %rcx pop %r15 pop %r14 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
oeis/097/A097708.asm
neoneye/loda-programs
11
29877
; A097708: Sum of prime length repunits; sum_k=1..n (r(p(k))), where r()= A002275 and p(k) is the k-th prime. ; Submitted by <NAME> ; 0,11,122,11233,1122344,11112233455,1122223344566,11112233334455677,1122223344445566788,11112233334455556677899,11111122223344445566667789010,1122222233334455556677778900121 lpb $0 sub $0,1 mov $2,$0 max $2,0 seq $2,31974 ; 1 repeated prime(n) times. add $1,$2 lpe mov $0,$1
programs/oeis/089/A089013.asm
neoneye/loda
22
27156
<filename>programs/oeis/089/A089013.asm<gh_stars>10-100 ; A089013: a(n) = (A088567(8n) mod 2). ; 1,0,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,0,1,0,0,1,1,1,0,0,1,1,0,1,1,0,0,0,1,0,0,1,1,0,0,0,1,1,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,1,0,1,1,0,0,0,1,0,0,1,1,0,0,0,1,1,0,1,1,0,0,0,1,0,0,1,1,1,0,0,1,1,0,1,1,1,0,0,1 mul $0,3 seq $0,38189 ; Bit to left of least significant 1-bit in binary expansion of n. cmp $0,0
mc-sema/validator/x86_64/tests/FINIT.asm
randolphwong/mcsema
2
241990
<gh_stars>1-10 BITS 64 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS= ;TEST_FILE_META_END FLDZ ;TEST_BEGIN_RECORDING FINIT ;TEST_END_RECORDING
programs/oeis/021/A021040.asm
jmorken/loda
1
103448
; A021040: Decimal expansion of 1/36. ; 0,2,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 mul $0,6 mov $1,6 add $1,$0 sub $0,1 mod $1,$0
3-mid/opengl/source/lean/text/private/opengl-fontimpl-texture.adb
charlie5/lace-alire
1
18917
<filename>3-mid/opengl/source/lean/text/private/opengl-fontimpl-texture.adb with openGL.Glyph.texture, openGL.Glyph.Container, openGL.Palette, openGL.Tasks, GL.Binding, GL.lean, GL.Pointers, freetype_c.Binding, ada.unchecked_Conversion; package body openGL.FontImpl.Texture is --------- -- Forge -- function to_FontImpl_texture (ftFont : access Font.item'Class; fontFilePath : in String) return fontImpl.texture.item is use freetype_c.Binding; Success : Boolean; begin return Self : fontImpl.texture.item do define (Self'Access, ftFont, fontFilePath); Self.load_Flags := freetype_c.FT_Int (FT_LOAD_NO_HINTING_flag or FT_LOAD_NO_BITMAP_flag); Self.numGlyphs := Self.Face.GlyphCount; Self.remGlyphs := Self.numGlyphs; Success := Self.FaceSize (20); if not Success then raise Error with "Unable to set font facesize for '" & fontFilePath & "'."; end if; end return; end to_FontImpl_texture; function new_FontImpl_texture (ftFont : access Font.item'Class; fontFilePath : in String) return access fontImpl.texture.item'Class is use freetype_c.Binding; Self : constant fontImpl.texture.view := new fontImpl.texture.item; Success : Boolean; begin define (Self, ftFont, fontFilePath); Self.load_Flags := freetype_c.FT_Int (FT_LOAD_NO_HINTING_flag or FT_LOAD_NO_BITMAP_flag); Self.numGlyphs := Self.Face.GlyphCount; Self.remGlyphs := Self.numGlyphs; Success := Self.FaceSize (20); if not Success then raise Error with "Unable to set font facesize for '" & fontFilePath & "'."; end if; return Self; end new_FontImpl_texture; function to_FontImpl_texture (ftFont : access openGL.Font.item'Class; pBufferBytes : in unsigned_char_Pointer; bufferSizeInBytes : in Natural) return fontImpl.texture.item is use freetype_c.Binding; begin return Self : fontImpl.texture.item do define (Self'Access, ftFont, pBufferBytes, bufferSizeInBytes); Self.load_Flags := freetype_c.FT_Int ( FT_LOAD_NO_HINTING_flag or FT_LOAD_NO_BITMAP_flag); Self.numGlyphs := Self.face.GlyphCount; Self.remGlyphs := Self.numGlyphs; end return; end to_FontImpl_texture; function new_FontImpl_texture (ftFont : access Font.item'Class; pBufferBytes : in unsigned_char_Pointer; bufferSizeInBytes : in Natural) return access fontImpl.texture.item'Class is begin return new fontImpl.texture.item' (to_FontImpl_texture (ftFont, pBufferBytes, bufferSizeInBytes)); end new_FontImpl_texture; procedure free_Textures (Self : in out Item) is use texture_name_Vectors, GL.lean; Cursor : texture_name_Vectors.Cursor := Self.textureIDList.First; the_Name : aliased openGL.Texture.texture_Name; begin Tasks.check; while has_Element (Cursor) loop the_Name := Element (Cursor); glDeleteTextures (1, the_Name'Access); next (Cursor); end loop; end free_Textures; overriding procedure destruct (Self : in out Item) is use type ada.Containers.Count_type; begin destruct (FontImpl.item (Self)); -- Destroy base class. if Self.textureIDList.Length > 0 then Self.free_Textures; end if; end destruct; -------------- -- Attributes -- overriding function FaceSize (Self : access Item; Size : in Natural; x_Res, y_Res : in Natural := 72) return Boolean is type access_FontImpl is access all FontImpl.item; Success : Boolean; begin if not Self.textureIDList.is_empty then Self.free_Textures; Self.textureIDList.clear; Self.numGlyphs := Self.Face.GlyphCount; Self.remGlyphs := Self.numGlyphs; end if; Success := access_FontImpl (Self).FaceSize (Size, x_Res, y_Res); return Success; end FaceSize; function Render (Self : access Item; Text : in String; Length : in Integer; Position : in Vector_3; Spacing : in Vector_3; Mode : in renderMode) return Vector_3 is use GL, GL.Binding; function to_Integer is new ada.unchecked_Conversion (fontImpl.RenderMode, Integer); Tmp : Vector_3; begin Tasks.check; glEnable (GL_BLEND); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable (GL_TEXTURE_2D); GlyphImpl.texture.ResetActiveTexture; Tmp := FontImpl.item (Self.all).Render (Text, Length, Position, Spacing, to_Integer (Mode)); return Tmp; end Render; function MakeGlyphImpl (Self : access Item; ftGlyph : in freetype_c.FT_GlyphSlot.item) return access Glyph.item'Class is tempGlyph : Glyph.Container.Glyph_view; begin Self.glyphHeight := Integer (Self.charSize.Height + 0.5); Self.glyphWidth := Integer (Self.charSize.Width + 0.5); if Self.glyphHeight < 1 then Self.glyphHeight := 1; end if; if Self.glyphWidth < 1 then Self.glyphWidth := 1; end if; if Self.textureIDList.is_empty then Self.textureIDList.append (Self.CreateTexture); Self.xOffset := Self.Padding; Self.yOffset := Self.Padding; end if; if Self.xOffset > (Integer (Self.textureWidth) - Self.glyphWidth) then Self.xOffset := Self.Padding; Self.yOffset := Self.yOffset + Self.glyphHeight; if Self.yOffset > (Integer (Self.textureHeight) - Self.glyphHeight) then Self.textureIDList.append (Self.CreateTexture); Self.yOffset := Self.Padding; end if; end if; tempGlyph := openGL.Glyph.texture.new_Glyph (ftGlyph, Self.textureIDList.last_Element, Self.xOffset, Self.yOffset, Integer (Self.textureWidth), Integer (Self.textureHeight)); Self.xOffset := Self.xOffset + Integer ( tempGlyph.BBox.Box.Upper (1) - tempGlyph.BBox.Box.Lower (1) + Real (Self.Padding) + 0.5); Self.remGlyphs := Self.remGlyphs - 1; return tempGlyph; end MakeGlyphImpl; function Quad (Self : access Item; for_Character : in Character) return GlyphImpl.texture.Quad_t is use freetype.charMap; Success : constant Boolean := Self.CheckGlyph (to_characterCode (for_Character)) with unreferenced; the_Glyph : constant Glyph.Container.Glyph_view := Self.glyphList.Glyph (to_characterCode (for_Character)); begin return Glyph.texture.item (the_Glyph.all).Quad ((0.0, 0.0, 0.0)); end Quad; procedure CalculateTextureSize (Self : in out Item) is use openGL.Texture, GL, GL.Binding; use type GL.GLsizei; H : Integer; begin Tasks.check; if Self.maximumGLTextureSize = 0 then Self.maximumGLTextureSize := 1024; glGetIntegerv (GL_MAX_TEXTURE_SIZE, Self.maximumGLTextureSize'Access); pragma assert (Self.maximumGLTextureSize /= 0); -- If you hit this then you have an invalid openGL context. end if; begin Self.textureWidth := Power_of_2_Ceiling ( (Self.remGlyphs * Self.glyphWidth) + (Self.Padding * 2)); exception when constraint_Error => Self.textureWidth := Self.maximumGLTextureSize; end; if Self.textureWidth > Self.maximumGLTextureSize then Self.textureWidth := Self.maximumGLTextureSize; end if; H := Integer ( Real (Integer (Self.textureWidth) - (Self.Padding * 2)) / Real (Self.glyphWidth) + 0.5); Self.textureHeight := Power_of_2_Ceiling ( ((Self.numGlyphs / H) + 1) * Self.glyphHeight); if Self.textureHeight > Self.maximumGLTextureSize then Self.textureHeight := Self.maximumGLTextureSize; end if; end CalculateTextureSize; function CreateTexture (Self : access Item) return openGL.Texture.texture_Name is use openGL.Palette, GL, GL.Binding; begin Tasks.check; Self.CalculateTextureSize; declare use GL.Pointers; the_Image : Image (1 .. Index_t (self.textureHeight), 1 .. Index_t (Self.textureWidth)) := (others => (others => +Black)); textID : aliased openGL.Texture.texture_Name; begin glGenTextures (1, textID'Access); glBindTexture (GL_TEXTURE_2D, textID); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D (GL_TEXTURE_2D, 0, GL_ALPHA, Self.textureWidth, Self.textureHeight, 0, GL_ALPHA, GL_UNSIGNED_BYTE, to_GLvoid_access (the_Image (1, 1).Red'Access)); return textID; end; end CreateTexture; function gl_Texture (Self : in Item) return openGL.Texture.texture_Name is begin return Self.textureIDList.last_Element; end gl_Texture; end openGL.FontImpl.Texture;
Rust-massaged.g4
jbclements/rust-antlr
39
6335
grammar Rust; // splitting issues: &&, <<, >>, >>=, || // be more consistent in use of *_list, *_seq, and *s. // NB: associativity may be wrong all over the place. // re-check trailing comma legal locations // UNICODE: okay, I just got lost in Unicode Standard Annex #31, // "Unicode Identifier and Pattern Syntax". // I get the sense that Rust intends to abide by Unicode standards // for identifiers; what I've done in this file approximates this, // I believe. // handling of macros is not yet a match for the parser, in part // because the parser does strange things; when there's a macro // in statement position, it parses it as a statement even if // it's an expression. @lexer::members { static int dotChar = 46; // is this character followed by an identifier or // a dot? this is used in parsing numbers, to distinguish // floating-point numbers from ranges and method calls. public boolean followed_by_ident_or_dot() { CharStream cs = getInputStream(); int nextChar = cs.LA(1); // KNOWN POTENTIAL ISSUE : this fn needs to be // aligned with the list appearing in xidstart.... return (java.lang.Character.isUnicodeIdentifierStart(nextChar) || nextChar == dotChar); } // are we at the beginning of the file? This is needed in // order to parse shebangs. public boolean at_beginning_of_file() { return (getInputStream().index() == 0); } } import "xidstart" , "xidcont"; /// <grammar> // you can either treat a program as a sequence of token-trees--this is // the "s-expression" approach to parsing--or as a prog. // a sequence of token trees tts : tt* ; // module contents prog : module_contents ; module_contents : extern_mod_view_item* view_item* mod_item*; // MODULE ITEMS : extern_mod_view_item : attrs_and_vis EXTERN MOD ident (lib_selectors)? SEMI ; view_item : attrs_and_vis USE view_paths SEMI ; mod_item : attrs_and_vis mod_decl | attrs_and_vis foreign_mod | attrs_and_vis type_decl | attrs_and_vis struct_decl | attrs_and_vis enum_decl | attrs_and_vis trait_decl | attrs_and_vis const_item | attrs_and_vis impl | attrs impl_trait_for_type | attrs_and_vis (UNSAFE)? item_fn_decl | attrs_and_vis EXTERN (LIT_STR)? item_fn_decl | macro_item ; mod_decl : MOD ident SEMI | MOD ident LBRACE module_contents RBRACE ; foreign_mod : EXTERN (LIT_STR)? MOD ident LBRACE foreign_item* RBRACE | EXTERN (LIT_STR)? LBRACE foreign_item* RBRACE ; foreign_item : attrs STATIC ident COLON ty SEMI | attrs visibility (UNSAFE)? FN ident (LT (generic_decls)? GT)? LPAREN (args)? RPAREN ret_ty SEMI ; type_decl : TYPE ident (LT (generic_decls)? GT)? EQ ty SEMI ; struct_decl : STRUCT ident (LT (generic_decls)? GT)? LBRACE (struct_fields (COMMA)?)? RBRACE | STRUCT ident (LT (generic_decls)? GT)? LPAREN (tys)? RPAREN SEMI | STRUCT ident (LT (generic_decls)? GT)? SEMI ; struct_fields : struct_field COMMA struct_fields | struct_field ; struct_field : attrs_and_vis mutability ident COLON ty | attrs DROP block ; enum_decl : ENUM ident (LT (generic_decls)? GT)? LBRACE (enum_variant_decls (COMMA)?)? RBRACE ; enum_variant_decls : enum_variant_decl COMMA enum_variant_decls | enum_variant_decl ; enum_variant_decl : attrs_and_vis ident LBRACE (struct_fields (COMMA)?)? RBRACE | attrs_and_vis ident LPAREN (tys)? RPAREN | attrs_and_vis ident EQ expr | attrs_and_vis ident ; trait_decl: TRAIT ident (LT (generic_decls)? GT)? (COLON traits)? LBRACE trait_method* RBRACE ; trait_method : attrs_and_vis (UNSAFE)? FN ident (LT (generic_decls)? GT)? LPAREN (self_ty_and_maybenamed_args)? RPAREN ret_ty SEMI | attrs_and_vis (UNSAFE)? FN ident (LT (generic_decls)? GT)? LPAREN (self_ty_and_maybenamed_args)? RPAREN ret_ty fun_body ; impl : IMPL (LT (generic_decls)? GT)? ty impl_body ; impl_trait_for_type : IMPL (LT (generic_decls)? GT)? trait FOR ty impl_body ; impl_body : SEMI | LBRACE impl_method* RBRACE ; impl_method : attrs_and_vis (UNSAFE)? FN ident (LT (generic_decls)? GT)? LPAREN (self_ty_and_args)? RPAREN ret_ty fun_body ; item_fn_decl : FN ident (LT (generic_decls)? GT)? LPAREN (args)? RPAREN ret_ty fun_body ; fun_body : LBRACE view_item* block_element* (block_last_element)? RBRACE ; block : LBRACE view_item* block_element* (block_last_element)? RBRACE ; block_element : expr_RL (SEMI)+ | stmt_not_just_expr (SEMI)* ; block_last_element : expr_RL | macro_parens | expr_stmt ; ret_ty : RARROW NOT | RARROW ty | /* nothing */ ; macro_item : ident NOT (ident)? parendelim | ident NOT (ident)? bracedelim ; attrs_and_vis : attrs visibility ; visibility : PUB | PRIV | /*nothing*/ ; // overly loose on "const", but soon it will disappear completely? mutability : MUT | CONST | /*nothing*/ ; lib_selectors : LPAREN (meta_items)? RPAREN ; attrs : /* nothing */ | attr attrs ; attr : POUND LBRACKET meta_item RBRACKET (SEMI)? | OUTER_DOC_COMMENT | INNER_DOC_COMMENT; meta_item : ident | ident EQ lit | ident LPAREN (meta_items)? RPAREN ; meta_items : meta_item | meta_item COMMA meta_items ; args : arg | arg COMMA args ; arg : (arg_mode)? mutability pat COLON ty ; arg_mode : AND AND | PLUS | obsoletemode ; // obsolete ++ mode used in librustc/middle/region.rs obsoletemode : PLUS PLUS ; self_ty_and_args : self_ty (COMMA args)? | args ; self_ty_and_maybenamed_args : self_ty (COMMA maybenamed_args)? | maybenamed_args ; self_ty : AND (lifetime)? mutability SELF | AT mutability SELF | TILDE mutability SELF | SELF ; maybetyped_args : maybetyped_arg | maybetyped_arg COMMA maybetyped_args ; maybetyped_arg : (arg_mode)? mutability pat (COLON ty)? ; maybenamed_args : maybenamed_arg | maybenamed_arg COMMA maybenamed_args ; maybenamed_arg : arg | ty ; // not treating '_' specially... I don't think I have to. pat : AT pat | TILDE pat | AND pat | LPAREN RPAREN | LPAREN pats RPAREN | LBRACKET (vec_pats)? RBRACKET // definitely ambiguity here with ident patterns | expr_RB (DOTDOT expr_RB)? | REF mutability ident (AT pat)? | COPYTOK ident (AT pat)? | path AT pat | path_with_colon_tps | path_with_colon_tps LBRACE pat_fields RBRACE | path_with_colon_tps LPAREN STAR RPAREN | path_with_colon_tps LPAREN (pats)? RPAREN ; pats : pat (COMMA)? | pat COMMA pats ; pats_or : pat | pat OR pats_or ; vec_pats : pat | DOTDOT ident | pat COMMA vec_pats | DOTDOT ident COMMA vec_pats_no_slice ; vec_pats_no_slice : pat | pat COMMA vec_pats_no_slice ; const_item : STATIC ident COLON ty EQ expr SEMI ; view_paths : view_path | view_path COMMA view_paths ; view_path : (MOD)? ident EQ non_global_path | (MOD)? non_global_path MOD_SEP LBRACE RBRACE | (MOD)? non_global_path MOD_SEP LBRACE idents (COMMA)? RBRACE | (MOD)? non_global_path MOD_SEP STAR | (MOD)? non_global_path ; pat_fields : IDENT (COLON pat)? | IDENT (COLON pat)? COMMA pat_fields | UNDERSCORE ; traits : trait | trait PLUS traits ; trait : path (LT (generics)? GT)? ; tys : ty | ty COMMA tys ; ty : LPAREN RPAREN | LPAREN ty RPAREN | LPAREN ty COMMA RPAREN | LPAREN tys RPAREN | AT box_or_uniq_pointee | TILDE box_or_uniq_pointee | STAR mutability ty | path (LT (generics)? GT)? | LBRACKET (obsoleteconst)? ty COMMA DOTDOT expr RBRACKET | LBRACKET (obsoleteconst)? ty RBRACKET | AND borrowed_pointee | EXTERN (LIT_STR)? (UNSAFE)? ty_fn | ty_closure | path (LT (generics)? GT)? ; box_or_uniq_pointee : (lifetime)? ty_closure | mutability ty ; borrowed_pointee : (lifetime)? ty_closure | (lifetime)? mutability ty ; ty_closure : (UNSAFE)? (ONCE)? ty_fn ; ty_fn : FN (LT (lifetimes)? GT)? LPAREN (maybenamed_args)? RPAREN ret_ty ; // obsolete: obsoleteconst : CONST ; // because of the bifurcated treatment of statements and semicolon requirements, // there's no "stmt" production; instead, upstream uses are treated independently. // a statement that is not parsed by the expr_RL rule stmt_not_just_expr : let_stmt // this one requires parens. I think this may be accidental, // because mod_item includes both kinds of macro invocation... and // this one can fall through to that one. | macro_parens | mod_item | expr_stmt ; let_stmt : LET mutability local_var_decl (COMMA local_var_decl)* SEMI ; local_var_decl : pat (COLON ty)? (EQ expr)? ; // from a parser standpoint, it would be simpler just // to allow lifetimes and type params to be intermixed. generic_decls : lifetime | lifetime COMMA generic_decls | ty_params ; ty_params : ty_param | ty_param COMMA ty_params ; ty_param : ident | ident COLON | ident COLON boundseq ; boundseq : bound | bound PLUS boundseq ; bound : STATIC_LIFETIME | ty | obsoletekind ; // take these out? obsoletekind : COPYTOK | CONST ; generics : lifetime | lifetime COMMA generics | tys ; lifetimes_in_braces : LT (lifetimes)? GT ; lifetimes : lifetime | lifetime COMMA lifetimes ; idents : ident | ident COMMA idents ; path : MOD_SEP? non_global_path ; non_global_path : ident (MOD_SEP ident)* ; // EXPRS exprs : expr | expr COMMA exprs ; expr : expr_1 EQ expr | expr_1 BINOPEQ expr | expr_1 DARROW expr | expr_1 ; expr_1 : expr_1 OR expr_2 | expr_2 ; expr_2 : expr_2 AND expr_3 | expr_3 ; expr_3 : expr_3 EQEQ expr_4 | expr_3 NE expr_4 | expr_4 ; expr_4 : expr_4 LT expr_5 | expr_4 LE expr_5 | expr_4 GE expr_5 | expr_4 GT expr_5 | expr_5 ; // there is no precedence 5 ... expr_5 : expr_6; expr_6 : expr_6 OR OR expr_7 | expr_7 ; expr_7 : expr_7 CARET expr_8 | expr_8 ; expr_8 : expr_8 AND expr_9 | expr_9 ; expr_9 : expr_9 LT LT expr_10 | expr_9 GT GT expr_10 | expr_10 ; expr_10 : expr_10 PLUS expr_11 | expr_10 MINUS expr_11 | expr_11 ; expr_11 : expr_11 AS ty | expr_12 ; expr_12 : expr_12 STAR expr_prefix | expr_12 DIV expr_prefix | expr_12 REM expr_prefix | expr_prefix ; expr_prefix : NOT expr_prefix | MINUS expr_prefix | STAR expr_prefix | AND (lifetime)? mutability expr_prefix | AT mutability expr_prefix | TILDE expr_prefix | expr_dot_or_call ; // refactoring to eliminate left-recursion would make this less readable... expr_dot_or_call : expr_dot_or_call DOT ident (MOD_SEP LT (generics)? GT)? (LPAREN (exprs)? RPAREN)? | expr_dot_or_call LPAREN (exprs)? RPAREN | expr_dot_or_call LBRACKET expr RBRACKET | expr_bottom ; expr_bottom // this covers (), (e), and tuples, including our goofy one-tuple: : LPAREN (exprs (COMMA)?)? RPAREN | expr_lambda | expr_stmt | expr_vector | __LOG LPAREN expr COMMA expr RPAREN | LOOP (ident)? | RETURN expr | RETURN | BREAK (ident)? | COPYTOK expr // this will overlap with the whole-stmt macro-invocation rule... // I don't think I can bear to | macro | path_with_colon_tps LBRACE field_inits default_field_inits RBRACE | path_with_colon_tps | lit ; // once again, with stmt_on_lhs restriction . the token // fooRL is just like foo but doesn't allow an expr_statement // as its beginning. // in this mode, we're concerned about // statements like if true {3} else {4} |a|a, which we // want to parse as a statement followed by a closure expression, // rather than as (if... | a) | a. expr_RL : expr_1RL EQ expr | expr_1RL BINOPEQ expr | expr_1RL DARROW expr | expr_1RL ; expr_1RL : expr_1RL OR expr_2 | expr_2RL ; expr_2RL : expr_2RL AND expr_3 | expr_3RL ; expr_3RL : expr_3RL EQEQ expr_4 | expr_3RL NE expr_4 | expr_4RL ; expr_4RL : expr_4RL LT expr_5 | expr_4RL LE expr_5 | expr_4RL GE expr_5 | expr_4RL GT expr_5 | expr_5RL ; // there is no precedence 5 ... expr_5RL : expr_6RL; expr_6RL : expr_6RL OR OR expr_7 | expr_7RL ; expr_7RL : expr_7RL CARET expr_8 | expr_8RL ; expr_8RL : expr_8RL AND expr_9 | expr_9RL ; expr_9RL : expr_9RL LT LT expr_10 | expr_9RL GT GT expr_10 | expr_10RL ; expr_10RL : expr_10RL PLUS expr_11 | expr_10RL MINUS expr_11 | expr_11RL ; expr_11RL : expr_11RL AS ty | expr_12RL ; expr_12RL : expr_12RL STAR expr_prefix | expr_12RL DIV expr_prefix | expr_12RL REM expr_prefix | expr_prefixRL ; expr_prefixRL : NOT expr_prefix | MINUS expr_prefix | STAR expr_prefix | AND (lifetime)? mutability expr_prefix | AT mutability expr_prefix | TILDE expr_prefix | expr_dot_or_callRL ; expr_dot_or_callRL // strange exception here: we allow .f() after stmt_exprs : expr_dot_or_call DOT ident (MOD_SEP LT (generics)? GT)? (LPAREN (exprs)? RPAREN)? | expr_dot_or_callRL LPAREN (exprs)? RPAREN | expr_dot_or_callRL LBRACKET expr RBRACKET | expr_bottomRL ; expr_bottomRL : LPAREN (exprs (COMMA)?)? RPAREN | expr_lambda // no expr_stmt here | expr_vector | __LOG LPAREN expr COMMA expr RPAREN | LOOP (ident)? | RETURN expr | RETURN | BREAK (ident)? | COPYTOK expr // this is an ambiguity, right? | macro | path_with_colon_tps LBRACE field_inits default_field_inits RBRACE | path_with_colon_tps | lit ; // expr_RB // these exprs are restricted; they may not contain the "or" operator. // this is used to artificially lower the precedence of | in patterns. expr_RB : expr_2 EQ expr_RB | expr_2 BINOPEQ expr_RB | expr_2 DARROW expr_RB // skipping over OR : | expr_2 ; // expr_RBB // these exprs are restricted; they may not contain "or" or the // double "oror" operator. This is used to prevent parsing of // lambda terms following uses of "do" or "for" from being treated // as "or" operators instead. expr_RBB // skipping over OR: : expr_2RBB EQ expr_RBB | expr_2RBB BINOPEQ expr_RBB | expr_2RBB DARROW expr_RBB | expr_2RBB ; expr_2RBB : expr_2RBB AND expr_3RBB | expr_3RBB ; expr_3RBB : expr_3RBB EQEQ expr_4RBB | expr_3RBB NE expr_4RBB | expr_4RBB ; expr_4RBB : expr_4RBB LT expr_5RBB | expr_4RBB LE expr_5RBB | expr_4RBB GE expr_5RBB | expr_4RBB GT expr_5RBB | expr_5RBB ; // there is no precedence 5 ... // skipping over OR OR : expr_5RBB : expr_7; // things that can be either statements (without semicolons) or expressions // these can't appear in certain positions, e.g. 'if true {3} else {4} + 19' // blocks need special treatment because they don't require commas when used // as the RHS of match clauses. expr_stmt : expr_stmt_block | expr_stmt_not_block ; expr_stmt_block : (UNSAFE)? block; expr_stmt_not_block : expr_if | expr_match | expr_while | expr_loop | expr_for | expr_do ; field_inits : field_init | field_init COMMA field_inits ; default_field_inits : COMMA DOTDOT expr | (COMMA)? ; field_init : mutability ident COLON expr ; expr_vector : LBRACKET RBRACKET | LBRACKET expr (COMMA DOTDOT expr)? RBRACKET | LBRACKET expr COMMA exprs (COMMA)? RBRACKET ; expr_if : IF expr block (ELSE block_or_if)? ; block_or_if : block | expr_if ; expr_for : FOR expr_RBB (OR (maybetyped_args)? OR)? block; expr_do : DO expr_RBB (OR (maybetyped_args)? OR)? block; expr_while : WHILE expr block ; expr_loop : LOOP (UNSAFE)? block | LOOP ident COLON block ; expr_match : MATCH expr LBRACE (match_clauses)? RBRACE ; match_clauses : match_final_clause | match_clause match_clauses ; match_final_clause : pats_or (IF expr)? FAT_ARROW (expr_RL | expr_stmt_not_block | expr_stmt_block ) (COMMA)? ; match_clause : pats_or (IF expr)? FAT_ARROW (expr_RL COMMA | expr_stmt_not_block COMMA | expr_stmt_block (COMMA)? ) ; expr_lambda : OR (maybetyped_args)? OR ret_ty expr ; // SELF and STATIC may be used as identifiers // not sure about underscore. should it even be a token? ident : IDENT | SELF | STATIC | UNDERSCORE ; lifetime : STATIC_LIFETIME | LIFETIME ; macro : macro_parens | macro_braces ; macro_parens : ident NOT parendelim ; macro_braces : ident NOT bracedelim ; path_with_tps : path (LT (generics)? GT)? ; path_with_colon_tps : path (MOD_SEP LT (generics)? GT )? ; lit : TRUE | FALSE | LIT_INT | LIT_FLOAT | LIT_STR | LPAREN RPAREN ; // TOKEN TREES: tt : nondelim | delimited ; delimited : parendelim | bracketdelim | bracedelim; parendelim : LPAREN tt* RPAREN ; bracketdelim : LBRACKET tt* RBRACKET ; bracedelim : LBRACE tt* RBRACE ; // putting in keywords to simplify things: nondelim : AS | BREAK | CONST | COPYTOK | DO | DROP | ELSE | ENUM | EXTERN | FALSE | FN | FOR | IF | IMPL | LET | __LOG | LOOP | MATCH | MOD | MUT | ONCE | PRIV | PUB | PURE | REF | RETURN | STATIC | STRUCT | SELF // I don't think super needs to be a keyword. // | SUPER | TRUE | TRAIT | TYPE | UNSAFE | USE | WHILE // Expression-operator symbols. // adding AND and PLUS and MINUS (etc) to make the grammar tractable: | AND | PLUS | MINUS | DIV | REM | CARET | OR | EQ | LT | LE | EQEQ | NE | GE | GT | NOT | TILDE | STAR | BINOPEQ // Structural symbols | AT | DOT | DOTDOT | COMMA | SEMI | COLON | MOD_SEP | RARROW | LARROW | DARROW | FAT_ARROW | POUND | DOLLAR // Literals | LIT_INT // It's not necessary to distinguish these for parsing: //| LIT_UINT //| LIT_INT_UNSUFFIXED | LIT_FLOAT //| LIT_FLOAT_UNSUFFIXED | LIT_STR // Name components | IDENT | UNDERSCORE | STATIC_LIFETIME | LIFETIME // Interpolation isn't present until after expansion // | INTERPOLATED | OUTER_DOC_COMMENT | INNER_DOC_COMMENT; /// </grammar> // putting keywords in to simplify things: AS : 'as' ; BREAK : 'break' ; CONST : 'const' ; COPYTOK : 'copy' ; DO : 'do' ; DROP : 'drop' ; ELSE : 'else' ; ENUM : 'enum' ; EXTERN : 'extern' ; FALSE : 'false' ; FN : 'fn' ; FOR : 'for' ; IF : 'if' ; IMPL : 'impl' ; LET : 'let' ; __LOG : '__log' ; LOOP : 'loop' ; MATCH : 'match' ; MOD : 'mod' ; MUT : 'mut' ; ONCE : 'once' ; PRIV : 'priv' ; PUB : 'pub' ; PURE : 'pure' ; REF : 'ref' ; RETURN : 'return' ; SELF : 'self' ; STATIC : 'static' ; STRUCT : 'struct' ; // I don't think super should be a keyword... // SUPER : 'super' ; TRUE : 'true' ; TRAIT : 'trait' ; TYPE : 'type' ; UNSAFE : 'unsafe' ; USE : 'use' ; WHILE : 'while' ; PLUS : '+' ; AND : '&' ; MINUS : '-' ; DIV : '/' ; REM : '%' ; CARET : '^' ; OR : '|' ; EQ : '=' ; LE : '<=' ; LT : '<'; EQEQ : '==' ; NE : '!=' ; GE : '>=' ; GT : '>' ; NOT : '!' ; TILDE : '~' ; STAR : '*' ; BINOPEQ : '/=' | '%=' | '^=' | '|=' | '-=' |'*=' | '&=' | '+=' | '<<=' | '>>=' ; /* Structural symbols */ AT : '@' ; DOT : '.' ; DOTDOT : '..' ; COMMA : ',' ; SEMI : ';' ; COLON : ':' ; MOD_SEP : '::' ; RARROW : '->' ; LARROW : '<-' ; DARROW : '<->' ; FAT_ARROW : '=>' ; LPAREN : '(' ; RPAREN : ')' ; LBRACKET : '[' ; RBRACKET : ']' ; LBRACE : '{' ; RBRACE : '}' ; POUND : '#' ; DOLLAR : '$' ; LIT_INT : LIT_CHAR | '0x' HEXDIGIT+ INTLIT_TY? | '0b' BINDIGIT+ INTLIT_TY? | DECDIGIT DECDIGIT_CONT* INTLIT_TY? ; LIT_FLOAT : DECDIGIT DECDIGIT_CONT* '.' {!followed_by_ident_or_dot()}? // nb: digit following '.' can't be underscore. | DECDIGIT DECDIGIT_CONT* '.' DECDIGIT DECDIGIT_CONT* LITFLOAT_EXP? LITFLOAT_TY? | DECDIGIT DECDIGIT_CONT* LITFLOAT_EXP LITFLOAT_TY? | DECDIGIT DECDIGIT_CONT* LITFLOAT_TY ; LIT_STR : '\"' STRCHAR* '\"' ; IDENT : IDSTART IDCONT* ; UNDERSCORE : '_' ; STATIC_LIFETIME : '\'static' ; LIFETIME : '\'' IDENT | '\'' SELF ; // the not-only-slashes restrictions is a real PITA: // must have at least one non-slash char OUTER_DOC_COMMENT : '///' '/' * NON_SLASH_OR_WS ~[\n]* | '///' '/' * [ \r\t] ~[ \r\t] ~[\n]* | '///' [ \t]* // again, we have to do a funny dance to fence out // only-stars. // CAN'T ABSTRACT OVER BLOCK_CHARS; learned this // the hard way ... :( | '/**' (~[*] | ('*'+ ~[*/]))* ~[*] (~[*] | ('*'+ ~[*/]))* '*'+ '/' ; INNER_DOC_COMMENT : '//!' ~[\n]* | '/*!' (~[*] | ('*'+ ~[*/]))* '*'+ '/' ; // HELPER DEFINITIONS: WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines OTHER_LINE_COMMENT : '//' ~[\n] * -> skip ; OTHER_BLOCK_COMMENT : '/*' (~[*] | ('*'+ ~[*/]))* '*'+ '/' -> skip ; SHEBANG_LINE : {at_beginning_of_file()}? '#!' ~[\n]* '\n' -> skip ; BINDIGIT : [0-1_] ; DECDIGIT : [0-9] ; DECDIGIT_CONT : [0-9_] ; HEXDIGIT : [0-9a-fA-F_] ; INTLIT_TY : ('u'|'i') ('8'|'16'|'32'|'64')? ; LITFLOAT_EXP : [eE] [+-]? DECDIGIT_CONT+ ; LITFLOAT_TY : 'f' ('32'|'64')? ; ESCAPEDCHAR : 'n' | 'r' | 't' | '\\' | '\'' | '\"' | 'x' HEXDIGIT HEXDIGIT | 'u' HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT | 'U' HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT ; LIT_CHAR : '\'\\' ESCAPEDCHAR '\'' | '\'' . '\'' ; STRCHAR : ~[\\"] | '\\' STRESCAPE ; STRESCAPE : '\n' | ESCAPEDCHAR ; IDSTART : [_a-zA-Z] | XIDSTART ; IDCONT : [_a-zA-Z0-9] | XIDCONT ; NON_SLASH_OR_WS : ~[ \t\r\n/] ;
programs/oeis/059/A059977.asm
neoneye/loda
22
100487
<gh_stars>10-100 ; A059977: a(n) = binomial(n+2, 2)^4. ; 1,81,1296,10000,50625,194481,614656,1679616,4100625,9150625,18974736,37015056,68574961,121550625,207360000,342102016,547981281,855036081,1303210000,1944810000,2847396321,4097152081,5802782976,8100000000,11156640625,15178486401,20415837456,27170906896,35806100625,46753250625,60523872256,77720518656,99049307841,125333700625,157529610000,196741925136,244242535681,301489944561,370150560000,452121760000,549556825041,664891837281,800874647056,960596010000,1147523000625,1365534810721,1618961043456,1912622616576,2251875390625,2642656640625,3091534492176,3605760445456,4193325113121,4863017300625,5624486560000,6488309350656,7466058943281,8570379205441,9815062410000,11215131210000,12786924926161,14548190295681,16518176833536,18717736960000,21169431050625,23897637567441,26928668432656,30290889808656,34014848450625,38133403800625,42681865994496,47698139955456,53222875750801,59299625390625,65975006250000,73298871298576,81324486324081,90108714338721,99712207360000,110199605760000,121639745379681,134105872607281,147675867622416,162432476010000,178463548950625,195862292196561,214727524045056,235163942523136,257282402000625,281200199450625,307041370579216,334936996048656,365025518020881,397453067250625,432373800960000,469950251728896,510353687638081,553764483904401,600372506250000,650377506250000 mov $1,-3 bin $1,$0 pow $1,4 mov $0,$1
Ada/inc/Problem_17.ads
Tim-Tom/project-euler
0
23953
<gh_stars>0 package Problem_17 is procedure Solve; end Problem_17;
oeis/143/A143861.asm
neoneye/loda-programs
11
240521
; A143861: Ulam's spiral (NNE spoke). ; 1,14,59,136,245,386,559,764,1001,1270,1571,1904,2269,2666,3095,3556,4049,4574,5131,5720,6341,6994,7679,8396,9145,9926,10739,11584,12461,13370,14311,15284,16289,17326,18395,19496,20629,21794,22991,24220,25481,26774,28099,29456,30845,32266,33719,35204,36721,38270,39851,41464,43109,44786,46495,48236,50009,51814,53651,55520,57421,59354,61319,63316,65345,67406,69499,71624,73781,75970,78191,80444,82729,85046,87395,89776,92189,94634,97111,99620,102161,104734,107339,109976,112645,115346,118079,120844 mov $1,$0 mul $1,16 sub $1,3 mul $0,$1 add $0,1
main.asm
Zeturic/bpre-pokerus
0
24238
.gba .thumb .open "rom.gba", "test.gba", 0x08000000 .org allocation .area allocation_size .importobj "build/linked.o" .endarea .org 0x08043A68 .area 8, 0xFE ldr r3, =RandomlyGivePartyPokerus |1 bx r3 .pool .endarea .org 0x08043B38 .area 8, 0xFE ldr r3, =UpdatePartyPokerusTime |1 bx r3 .pool .endarea .org 0x08043B40 .area 8, 0xFE ldr r3, =PartySpreadPokerus |1 bx r3 .pool .endarea .if 0 <= Special_IsPokerusInParty .org gSpecials + Special_IsPokerusInParty * 4 .word IsPokerusInParty |1 .endif .if 0 <= CHANCE_REDUCE_POKERUS_128_STEPS .org 0x0806D74C .area 0x34, 0xFE ldr r3, =UpdateHappinessStepCounter |1 bx r3 .pool .endarea .endif .close .definelabel gSpecials, readu32("rom.gba", 0x08069F18 & 0x1FFFFFF)
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_17_638.asm
ljhsiun2/medusa
9
171594
<filename>Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_17_638.asm .global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_WC_ht+0x466f, %rsi nop nop nop nop nop dec %r14 mov $0x6162636465666768, %r9 movq %r9, %xmm6 movups %xmm6, (%rsi) nop nop cmp $52230, %r10 lea addresses_D_ht+0xd8ef, %rsi lea addresses_A_ht+0xad6f, %rdi nop nop nop nop dec %r10 mov $29, %rcx rep movsb nop nop nop nop nop add %r14, %r14 lea addresses_WT_ht+0x1dd0f, %r10 nop nop nop nop nop dec %rax movw $0x6162, (%r10) nop nop nop nop nop add $53488, %rax lea addresses_WT_ht+0x34ef, %rax nop nop nop nop sub $40411, %r9 mov (%rax), %r10d nop nop nop add $16690, %rax lea addresses_WT_ht+0x1d1af, %r9 nop nop nop sub $32106, %rax mov (%r9), %r14d nop nop nop nop sub $56820, %rsi lea addresses_normal_ht+0x583a, %rax nop add %r14, %r14 mov (%rax), %di sub %rax, %rax lea addresses_WT_ht+0x44df, %rdi nop nop add %r9, %r9 movb $0x61, (%rdi) nop nop nop nop nop cmp %r10, %r10 lea addresses_UC_ht+0x1e46f, %rdi nop nop nop nop cmp $9016, %rsi mov $0x6162636465666768, %rax movq %rax, %xmm3 and $0xffffffffffffffc0, %rdi movaps %xmm3, (%rdi) nop nop sub $49120, %rdi lea addresses_D_ht+0x31ef, %rdi cmp %r9, %r9 mov $0x6162636465666768, %rcx movq %rcx, (%rdi) nop sub $26072, %r10 lea addresses_normal_ht+0xb8ef, %rsi lea addresses_A_ht+0x19ff7, %rdi nop nop nop nop nop add $36756, %r10 mov $0, %rcx rep movsw xor %r14, %r14 pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r8 push %rax push %rcx push %rdi push %rsi // Store lea addresses_WT+0x8923, %r14 xor $37215, %rdi mov $0x5152535455565758, %rax movq %rax, (%r14) nop nop nop nop nop xor $14478, %r8 // Store lea addresses_RW+0x137ef, %rsi nop nop nop nop nop xor %r10, %r10 mov $0x5152535455565758, %r8 movq %r8, %xmm2 movups %xmm2, (%rsi) nop nop nop inc %rcx // Store lea addresses_PSE+0xa52f, %rdi clflush (%rdi) nop nop nop nop nop xor %rsi, %rsi mov $0x5152535455565758, %r8 movq %r8, %xmm4 vmovaps %ymm4, (%rdi) and %rsi, %rsi // Load lea addresses_PSE+0x14cef, %rcx clflush (%rcx) add $25338, %r14 movb (%rcx), %al nop nop nop nop nop and %r14, %r14 // Store lea addresses_PSE+0x1fcef, %rsi nop nop nop nop nop xor %r10, %r10 mov $0x5152535455565758, %rdi movq %rdi, %xmm2 vmovups %ymm2, (%rsi) nop nop nop nop add $5, %r14 // Faulty Load lea addresses_PSE+0x1fcef, %r8 nop nop nop nop inc %r10 mov (%r8), %r14 lea oracles, %rdi and $0xff, %r14 shlq $12, %r14 mov (%rdi,%r14,1), %r14 pop %rsi pop %rdi pop %rcx pop %rax pop %r8 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 2, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'} {'dst': {'NT': True, 'AVXalign': True, 'size': 32, 'congruent': 6, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'src': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 3, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 8, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'src': {'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'} {'58': 17} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
Examples/Lib16/TestLib.asm
satadriver/LiunuxOS
0
174702
TITLE Testing the Link Library (TestLib.asm) ; Use this program to test individual Irvine16 ; library procedures. INCLUDE Irvine16.inc .data .code main PROC mov ax,@data mov ds,ax exit main ENDP END main
src/native/third_party/isa-l/igzip/igzip_deflate_hash.asm
eshelmarc/noobaa-core
178
13152
%include "options.asm" %include "lz0a_const.asm" %include "data_struct2.asm" %include "huffman.asm" %include "reg_sizes.asm" %define DICT_SLOP 8 %define DICT_END_SLOP 4 %ifidn __OUTPUT_FORMAT__, win64 %define arg1 rcx %define arg2 rdx %define arg3 r8 %define swap1 rdi %define swap2 rsi %else %define arg1 rdi %define arg2 rsi %define arg3 rdx %define swap1 r8 %define swap2 rcx %endif %define stream arg1 %define dict_offset arg2 %define dict_len arg3 %define f_i arg3 %define f_i_tmp swap1 %define hash swap2 %define hash2 r9 %define hash3 r10 %define hash4 r11 %define f_i_end rax %macro FUNC_SAVE 0 %ifidn __OUTPUT_FORMAT__, win64 push rsi push rdi %endif %endm %macro FUNC_RESTORE 0 %ifidn __OUTPUT_FORMAT__, win64 pop rdi pop rsi %endif %endm global isal_deflate_hash_lvl0_01 isal_deflate_hash_lvl0_01: FUNC_SAVE %ifnidn (arg1, stream) mov stream, arg1 %endif %ifnidn (arg2, dict_next) mov dict_offset, arg2 %endif mov f_i_end %+ d, dword [stream + _total_in] neg f_i add f_i, f_i_end sub dict_offset, f_i sub f_i_end, DICT_SLOP cmp f_i, f_i_end jg end_main main_loop: lea f_i_tmp, [f_i + 2] xor hash, hash crc32 hash %+ d, dword [f_i + dict_offset] xor hash2, hash2 crc32 hash2 %+ d, dword [f_i + dict_offset + 1] xor hash3, hash3 crc32 hash3 %+ d, dword [f_i_tmp + dict_offset] xor hash4, hash4 crc32 hash4 %+ d, dword [f_i_tmp + dict_offset + 1] and hash, HASH_MASK and hash2, HASH_MASK and hash3, HASH_MASK and hash4, HASH_MASK mov [stream + _internal_state_head + 2 * hash], f_i %+ w add f_i, 1 mov [stream + _internal_state_head + 2 * hash2], f_i %+ w add f_i, 3 mov [stream + _internal_state_head + 2 * hash3], f_i_tmp %+ w add f_i_tmp, 1 mov [stream + _internal_state_head + 2 * hash4], f_i_tmp %+ w cmp f_i, f_i_end jle main_loop end_main: add f_i_end, DICT_SLOP - DICT_END_SLOP cmp f_i, f_i_end jg end end_loop: xor hash, hash crc32 hash %+ d, dword [f_i + dict_offset] and hash, HASH_MASK mov [stream + _internal_state_head + 2 * hash], f_i %+ w add f_i, 1 cmp f_i, f_i_end jle end_loop end: FUNC_RESTORE ret
gyak/gyak3/sumDiagonal.adb
balintsoos/LearnAda
0
30085
<reponame>balintsoos/LearnAda with Ada.Text_IO; use Ada.Text_IO; procedure SumDiagonal is type Index is new Integer; type Elem is new Integer; type Matrix is array (Index range <>, Index range <>) of Elem; procedure Print ( M: in Matrix ) is begin for I in M'Range(1) loop for J in M'Range(2) loop Put( Elem'Image(M(I,J)) ); Put( Ascii.HT ); end loop; New_Line; end loop; end Print; function Sum (M: Matrix) return Elem is S: Elem := 0; begin for I in M'Range(1) loop S := S + M(I, I - M'First(1) + M'First(2)); end loop; return S; end Sum; M: Matrix := ((1,2,3),(1,2,3),(1,2,3)); S: Elem := 0; begin Print(M); S := Sum(M); Put( Elem'Image(S) ); end SumDiagonal;
Cubical/Data/Group.agda
limemloh/cubical
1
2151
{-# OPTIONS --cubical --safe #-} module Cubical.Data.Group where open import Cubical.Data.Group.Base public
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
jlcon/shardingsphere
0
560
<filename>shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4 /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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. */ grammar BaseRule; import Symbol, Keyword, MySQLKeyword, Literals; parameterMarker : QUESTION_ ; customKeyword : MAX | MIN | SUM | COUNT | GROUP_CONCAT | CAST | POSITION | SUBSTRING | SUBSTR | EXTRACT | TRIM | LAST_DAY | TRADITIONAL | TREE | MYSQL_ADMIN | INSTANT | INPLACE | COPY | UL_BINARY | AUTOCOMMIT ; literals : stringLiterals | numberLiterals | dateTimeLiterals | hexadecimalLiterals | bitValueLiterals | booleanLiterals | nullValueLiterals ; stringLiterals : characterSetName? STRING_ collateClause? ; numberLiterals : MINUS_? NUMBER_ ; dateTimeLiterals : (DATE | TIME | TIMESTAMP) STRING_ | LBE_ identifier STRING_ RBE_ ; hexadecimalLiterals : characterSetName? HEX_DIGIT_ collateClause? ; bitValueLiterals : characterSetName? BIT_NUM_ collateClause? ; booleanLiterals : TRUE | FALSE ; nullValueLiterals : NULL ; characterSetName : IDENTIFIER_ ; collationName_ : IDENTIFIER_ ; identifier : IDENTIFIER_ | unreservedWord | customKeyword ; unreservedWord : ACCOUNT | ACTION | ACTIVE | ADMIN | AFTER | AGAINST | AGGREGATE | ALGORITHM | ALWAYS | ANY | ASCII | AT | ATTRIBUTE | AUTOEXTEND_SIZE | AUTO_INCREMENT | AVG | AVG_ROW_LENGTH | BACKUP | BEGIN | BINLOG | BIT | BLOCK | BOOL | BOOLEAN | BTREE | BUCKETS | BYTE | CACHE | CASCADED | CATALOG_NAME | CHAIN | CHANGED | CHANNEL | CHARSET | CHECKSUM | CIPHER | CLASS_ORIGIN | CLIENT | CLONE | CLOSE | COALESCE | CODE | COLLATION | COLUMNS | COLUMN_FORMAT | COMMENT | COMMIT | COMMITTED | COMPACT | COMPLETION | COMPONENT | COMPRESSED | COMPRESSION | CONCURRENT | CONNECTION | CONSISTENT | CONSTRAINT_CATALOG | CONSTRAINT_NAME | CONSTRAINT_SCHEMA | CONTAINS | CONTEXT | CPU | CURRENT | CURSOR_NAME | DATA | DATAFILE | DATE | DATETIME | DAY | DEFAULT_AUTH | DEFINER | DEFINITION | DEALLOCATE | DELAY_KEY_WRITE | DESCRIPTION | DIAGNOSTICS | DIRECTORY | DISABLE | DISCARD | DISK | DO | DUMPFILE | DUPLICATE | DYNAMIC | ENABLE | ENCRYPTION | ENFORCED | END | ENDS | ENGINE | ENGINES | ENGINE_ATTRIBUTE | ENUM | ERROR | ERRORS | ESCAPE | EVENT | EVENTS | EVERY | EXCHANGE | EXCLUDE | EXECUTE | EXPANSION | EXPIRE | EXPORT | EXTENDED | EXTENT_SIZE | FAILED_LOGIN_ATTEMPTS | FAST | FAULTS | FIELDS | FILE | FILE_BLOCK_SIZE | FILTER | FIRST | FIXED | FLUSH | FOLLOWING | FOLLOWS | FORMAT | FULL | GENERAL | GEOMCOLLECTION | GEOMETRY | GEOMETRYCOLLECTION | GET_FORMAT | GET_MASTER_PUBLIC_KEY | GLOBAL | GRANTS | GROUP_REPLICATION | HANDLER | HASH | HELP | HISTOGRAM | HISTORY | HOST | HOSTS | HOUR | IDENTIFIED | IGNORE_SERVER_IDS | IMPORT | INACTIVE | INDEXES | INITIAL_SIZE | INSERT_METHOD | INSTALL | INSTANCE | INVISIBLE | INVOKER | IO | IO_THREAD | IPC | ISOLATION | ISSUER | JSON | JSON_VALUE | KEY_BLOCK_SIZE | LANGUAGE | LAST | LEAVES | LESS | LEVEL | LINESTRING | LIST | LOCAL | LOCKED | LOCKS | LOGFILE | LOGS | MANAGED | MASTER | MASTER_AUTO_POSITION | MASTER_COMPRESSION_ALGORITHMS | MASTER_CONNECT_RETRY | MASTER_DELAY | MASTER_HEARTBEAT_PERIOD | MASTER_HOST | MASTER_LOG_FILE | MASTER_LOG_POS | MASTER_PASSWORD | MASTER_PUBLIC_KEY_PATH | MASTER_PORT | MASTER_RETRY_COUNT | MASTER_SERVER_ID | MASTER_SSL | MASTER_SSL_CA | MASTER_SSL_CAPATH | MASTER_SSL_CERT | MASTER_SSL_CIPHER | MASTER_SSL_CRL | MASTER_SSL_CRLPATH | MASTER_SSL_KEY | MASTER_TLS_CIPHERSUITES | MASTER_TLS_VERSION | MASTER_USER | MASTER_ZSTD_COMPRESSION_LEVEL | MAX_CONNECTIONS_PER_HOUR | MAX_QUERIES_PER_HOUR | MAX_ROWS | MAX_SIZE | MAX_UPDATES_PER_HOUR | MAX_USER_CONNECTIONS | MEDIUM | MEMORY | MERGE | MESSAGE_TEXT | MICROSECOND | MIGRATE | MINUTE | MIN_ROWS | MODE | MODIFY | MONTH | MULTILINESTRING | MULTIPOINT | MULTIPOLYGON | MUTEX | MYSQL_ERRNO | NAME | NAMES | NATIONAL | NCHAR | NDB | NDBCLUSTER | NESTED | NETWORK_NAMESPACE | NEVER | NEW | NEXT | NO | NODEGROUP | NONE | NOWAIT | NO_WAIT | NULLS | NUMBER | NVARCHAR | OFFSET | OFF | OJ | OLD | ONE | ONLY | OPEN | OPTIONAL | OPTIONS | ORDINALITY | OTHERS | OWNER | PACK_KEYS | PAGE | PARSER | PARTIAL | PARTITIONING | PASSWORD | PASSWORD_LOCK_TIME | PATH | PERSIST | PERSIST_ONLY | PHASE | PLUGIN | PLUGINS | PLUGIN_DIR | POINT | POLYGON | PORT | PRECEDES | PRECEDING | PREPARE | PRESERVE | PREV | PRIVILEGES | PRIVILEGE_CHECKS_USER | PROCESS | PROCESSLIST | PROFILE | PROFILES | PROXY | QUARTER | QUERY| QUICK | RANDOM | READ_ONLY | REBUILD | RECOVER | REDO_BUFFER_SIZE | REDUNDANT | REFERENCE | RELAY | RELAYLOG | RELAY_LOG_FILE | RELAY_LOG_POS | RELAY_THREAD | RELOAD | REMOVE | REORGANIZE | REPAIR | REPEATABLE | REPLICATE_DO_DB | REPLICATE_DO_TABLE | REPLICATE_IGNORE_DB | REPLICATE_IGNORE_TABLE | REPLICATE_REWRITE_DB | REPLICATE_WILD_DO_TABLE | REPLICATE_WILD_IGNORE_TABLE | REPLICATION | REQUIRE_ROW_FORMAT | RESET | RESOURCE | RESPECT | RESTART | RESTORE | RESUME | RETAIN | RETURNED_SQLSTATE | RETURNING | RETURNS | REUSE | REVERSE | ROLE | ROLLBACK | ROLLUP | ROTATE | ROUTINE | ROW_COUNT | ROW_FORMAT | RTREE | SAVEPOINT | SCHEDULE | SCHEMA_NAME | SECOND | SECONDARY | SECONDARY_ENGINE | SECONDARY_ENGINE_ATTRIBUTE | SECONDARY_LOAD | SECONDARY_UNLOAD | SECURITY | SERIAL | SERIALIZABLE | SERVER | SESSION | SHARE | SHUTDOWN | SIGNED | SIMPLE | SLAVE | SLOW | SNAPSHOT | SOCKET | SOME | SONAME | SOUNDS | SOURCE | SQL_AFTER_GTIDS | SQL_AFTER_MTS_GAPS | SQL_BEFORE_GTIDS | SQL_BUFFER_RESULT | SQL_NO_CACHE | SQL_THREAD | SQL_TSI_DAY | SQL_TSI_HOUR | SQL_TSI_MINUTE | SQL_TSI_MONTH | SQL_TSI_QUARTER | SQL_TSI_SECOND | SQL_TSI_WEEK | SQL_TSI_YEAR | SRID | STACKED | START | STARTS | STATS_AUTO_RECALC | STATS_PERSISTENT | STATS_SAMPLE_PAGES | STATUS | STOP | STORAGE | STREAM | STRING | SUBCLASS_ORIGIN | SUBJECT | SUBPARTITION | SUBPARTITIONS | SUPER | SUSPEND | SWAPS | SWITCHES | SQL_CACHE | TABLES | TABLESPACE | TABLE_CHECKSUM | TABLE_NAME | TEMPORARY | TEMPTABLE | TEXT | THAN | THREAD_PRIORITY | TIES | TIME | TIMESTAMP | TIMESTAMPADD | TIMESTAMPDIFF | TLS | TRANSACTION | TRIGGERS | TRUNCATE | TYPE | TYPES | UNBOUNDED | UNCOMMITTED | UNDEFINED | UNDOFILE | UNDO_BUFFER_SIZE | UNICODE | UNINSTALL | UNKNOWN | UNTIL | UPGRADE | USER | USER_RESOURCES | USE_FRM | VALIDATION | VALUE | VARIABLES | VCPU | VIEW | VISIBLE | WAIT | WARNINGS | WEEK | WEIGHT_STRING | WITHOUT | WORK | WRAPPER | X509 | XA | XID | XML | YEAR ; variable : (AT_? AT_)? scope? DOT_? internalVariableName ; scope : GLOBAL | PERSIST | PERSIST_ONLY | SESSION | LOCAL ; internalVariableName : identifier | DEFAULT DOT_ identifier | identifier DOT_ identifier ; setExprOrDefault : expr | DEFAULT | ALL | BINARY | ROW | SYSTEM ; schemaName : identifier ; schemaNames : schemaName (COMMA_ schemaName)* ; schemaPairs : schemaPair (COMMA_ schemaPair)* ; schemaPair : LP_ schemaName COMMA_ schemaName RP_ ; tableName : (owner DOT_)? name ; columnName : (owner DOT_)? name ; indexName : identifier ; userName : STRING_ AT_ STRING_ | identifier | STRING_ ; eventName : (STRING_ | IDENTIFIER_) AT_ (STRING_ IDENTIFIER_) | identifier | STRING_ ; serverName : identifier | STRING_ ; wrapperName : identifier | STRING_ ; functionName : identifier | (owner DOT_)? identifier ; viewName : identifier | (owner DOT_)? identifier ; owner : identifier ; alias : identifier | STRING_ ; name : identifier ; tableNames : LP_? tableName (COMMA_ tableName)* RP_? ; viewNames : viewName (COMMA_ viewName)* ; columnNames : LP_? columnName (COMMA_ columnName)* RP_? ; groupName : IDENTIFIER_ ; routineName : identifier ; shardLibraryName : STRING_ ; componentName : STRING_ ; pluginName : IDENTIFIER_ ; hostName : STRING_ ; port : NUMBER_ ; cloneInstance : userName AT_ hostName COLON_ port ; cloneDir : IDENTIFIER_ ; channelName : IDENTIFIER_ ; logName : identifier ; roleName : (STRING_ | IDENTIFIER_) AT_ (STRING_ IDENTIFIER_) | IDENTIFIER_ ; engineName : IDENTIFIER_ ; triggerName : IDENTIFIER_ ; triggerTime : BEFORE | AFTER ; userOrRole : userName | roleName ; partitionName : IDENTIFIER_ ; triggerEvent : INSERT | UPDATE | DELETE ; triggerOrder : (FOLLOWS | PRECEDES) triggerName ; expr : booleanPrimary | expr logicalOperator expr | expr XOR expr | notOperator expr ; logicalOperator : OR | OR_ | AND | AND_ ; notOperator : NOT | NOT_ ; booleanPrimary : booleanPrimary IS NOT? (TRUE | FALSE | UNKNOWN | NULL) | booleanPrimary SAFE_EQ_ predicate | booleanPrimary comparisonOperator predicate | booleanPrimary comparisonOperator (ALL | ANY) subquery | predicate ; comparisonOperator : EQ_ | GTE_ | GT_ | LTE_ | LT_ | NEQ_ ; predicate : bitExpr NOT? IN subquery | bitExpr NOT? IN LP_ expr (COMMA_ expr)* RP_ | bitExpr NOT? BETWEEN bitExpr AND predicate | bitExpr SOUNDS LIKE bitExpr | bitExpr NOT? LIKE simpleExpr (ESCAPE simpleExpr)? | bitExpr NOT? REGEXP bitExpr | bitExpr ; bitExpr : bitExpr VERTICAL_BAR_ bitExpr | bitExpr AMPERSAND_ bitExpr | bitExpr SIGNED_LEFT_SHIFT_ bitExpr | bitExpr SIGNED_RIGHT_SHIFT_ bitExpr | bitExpr PLUS_ bitExpr | bitExpr MINUS_ bitExpr | bitExpr ASTERISK_ bitExpr | bitExpr SLASH_ bitExpr | bitExpr DIV bitExpr | bitExpr MOD bitExpr | bitExpr MOD_ bitExpr | bitExpr CARET_ bitExpr | bitExpr PLUS_ intervalExpression | bitExpr MINUS_ intervalExpression | simpleExpr ; simpleExpr : functionCall | parameterMarker | literals | columnName | simpleExpr COLLATE (STRING_ | identifier) | variable | simpleExpr OR_ simpleExpr | (PLUS_ | MINUS_ | TILDE_ | notOperator | BINARY) simpleExpr | ROW? LP_ expr (COMMA_ expr)* RP_ | EXISTS? subquery | LBE_ identifier expr RBE_ | identifier (JSON_SEPARATOR | JSON_UNQUOTED_SEPARATOR) STRING_ | matchExpression | caseExpression | intervalExpression ; functionCall : aggregationFunction | specialFunction | regularFunction ; aggregationFunction : aggregationFunctionName LP_ distinct? (expr (COMMA_ expr)* | ASTERISK_)? RP_ overClause? ; aggregationFunctionName : MAX | MIN | SUM | COUNT | AVG ; distinct : DISTINCT ; overClause : OVER (LP_ windowSpecification RP_ | identifier) ; windowSpecification : identifier? partitionClause? orderByClause? frameClause? ; partitionClause : PARTITION BY expr (COMMA_ expr)* ; frameClause : (ROWS | RANGE) (frameStart | frameBetween) ; frameStart : CURRENT ROW | UNBOUNDED PRECEDING | UNBOUNDED FOLLOWING | expr PRECEDING | expr FOLLOWING ; frameEnd : frameStart ; frameBetween : BETWEEN frameStart AND frameEnd ; specialFunction : groupConcatFunction | windowFunction | castFunction | convertFunction | positionFunction | substringFunction | extractFunction | charFunction | trimFunction | weightStringFunction | valuesFunction | currentUserFunction ; currentUserFunction : CURRENT_USER (LP_ RP_)? ; groupConcatFunction : GROUP_CONCAT LP_ distinct? (expr (COMMA_ expr)* | ASTERISK_)? (orderByClause)? (SEPARATOR expr)? RP_ ; windowFunction : identifier LP_ expr (COMMA_ expr)* RP_ overClause ; castFunction : CAST LP_ expr AS dataType RP_ ; convertFunction : CONVERT LP_ expr COMMA_ dataType RP_ | CONVERT LP_ expr USING identifier RP_ ; positionFunction : POSITION LP_ expr IN expr RP_ ; substringFunction : (SUBSTRING | SUBSTR) LP_ expr FROM NUMBER_ (FOR NUMBER_)? RP_ | (SUBSTRING | SUBSTR) LP_ expr COMMA_ NUMBER_ (COMMA_ NUMBER_)? RP_ ; extractFunction : EXTRACT LP_ identifier FROM expr RP_ ; charFunction : CHAR LP_ expr (COMMA_ expr)* (USING ignoredIdentifier)? RP_ ; trimFunction : TRIM LP_ (LEADING | BOTH | TRAILING) STRING_ FROM STRING_ RP_ ; valuesFunction : VALUES LP_ columnName RP_ ; weightStringFunction : WEIGHT_STRING LP_ expr (AS dataType)? levelClause? RP_ ; levelClause : LEVEL (levelInWeightListElement (COMMA_ levelInWeightListElement)* | NUMBER_ MINUS_ NUMBER_) ; levelInWeightListElement : NUMBER_ (ASC | DESC)? REVERSE? ; regularFunction : completeRegularFunction | shorthandRegularFunction ; shorthandRegularFunction : CURRENT_DATE | CURRENT_TIME | CURRENT_TIMESTAMP | LAST_DAY | LOCALTIME | LOCALTIMESTAMP ; completeRegularFunction : regularFunctionName (LP_ (expr (COMMA_ expr)* | ASTERISK_)? RP_) ; regularFunctionName : IF | LOCALTIME | LOCALTIMESTAMP | REPLACE | INTERVAL | MOD | DATABASE | LEFT | RIGHT | DATE | DAY | GEOMCOLLECTION | GEOMETRYCOLLECTION | LINESTRING | MULTILINESTRING | MULTIPOINT | MULTIPOLYGON | POINT | POLYGON | TIME | TIMESTAMP | TIMESTAMPADD | TIMESTAMPDIFF | DATE | CURRENT_TIMESTAMP | identifier ; matchExpression : MATCH columnNames AGAINST LP_ expr matchSearchModifier? RP_ ; matchSearchModifier : IN NATURAL LANGUAGE MODE | IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION | IN BOOLEAN MODE | WITH QUERY EXPANSION ; caseExpression : CASE simpleExpr? caseWhen+ caseElse? END ; datetimeExpr : expr ; binaryLogFileIndexNumber : NUMBER_ ; caseWhen : WHEN expr THEN expr ; caseElse : ELSE expr ; intervalExpression : INTERVAL intervalValue ; intervalValue : expr intervalUnit ; intervalUnit : MICROSECOND | SECOND | MINUTE | HOUR | DAY | WEEK | MONTH | QUARTER | YEAR | SECOND_MICROSECOND | MINUTE_MICROSECOND | MINUTE_SECOND | HOUR_MICROSECOND | HOUR_SECOND | HOUR_MINUTE | DAY_MICROSECOND | DAY_SECOND | DAY_MINUTE | DAY_HOUR | YEAR_MONTH ; subquery : 'refer subquery in DMStement.g4' ; orderByClause : ORDER BY orderByItem (COMMA_ orderByItem)* ; orderByItem : (columnName | numberLiterals | expr) (ASC | DESC)? ; dataType : dataTypeName dataTypeLength? characterSet? collateClause? (UNSIGNED | SIGNED)? ZEROFILL? | dataTypeName collectionOptions characterSet? collateClause? ; dataTypeName : INTEGER | INT | SMALLINT | TINYINT | MEDIUMINT | BIGINT | DECIMAL| NUMERIC | FLOAT | DOUBLE | BIT | BOOL | BOOLEAN | DEC | DATE | DATETIME | TIMESTAMP | TIME | YEAR | CHAR | VARCHAR | BINARY | VARBINARY | TINYBLOB | TINYTEXT | BLOB | TEXT | MEDIUMBLOB | MEDIUMTEXT | LONGBLOB | LONGTEXT | ENUM | SET | GEOMETRY | POINT | LINESTRING | POLYGON | MULTIPOINT | MULTILINESTRING | MULTIPOLYGON | GEOMETRYCOLLECTION | JSON | UNSIGNED | SIGNED | CHARACTER VARYING | FIXED | FLOAT4 | FLOAT8 | INT1 | INT2 | INT3 | INT4 | INT8 | LONG VARBINARY | LONG VARCHAR | LONG | MIDDLEINT ; dataTypeLength : LP_ NUMBER_ (COMMA_ NUMBER_)? RP_ ; collectionOptions : LP_ STRING_ (COMMA_ STRING_)* RP_ ; characterSet : (CHARSET | CHAR SET | CHARACTER SET) EQ_? ignoredIdentifier ; collateClause : COLLATE EQ_? (STRING_ | ignoredIdentifier) ; ignoredIdentifier : identifier (DOT_ identifier)? ; ignoredIdentifiers : ignoredIdentifier (COMMA_ ignoredIdentifier)* ; fieldOrVarSpec : LP_ (identifier (COMMA_ identifier)*)? RP_ ; notExistClause : IF NOT EXISTS ; existClause : IF EXISTS ; pattern : STRING_ ; connectionId : NUMBER_ ; labelName : identifier ; cursorName : identifier ; conditionName : identifier ; unionOption : ALL | DISTINCT ;
Monitor/common.asm
Martin-H1/6502
3
87250
<filename>Monitor/common.asm ; ----------------------------------------------------------------------------- ; Common module to define monitor aliases, data segments and macros. ; <NAME> <<EMAIL>> ; ----------------------------------------------------------------------------- ; establish module level scope to hide module locals. .scope ; ; Aliases ; ; Character set (ASCII) .alias AscBell $07 ; bell (Control-G) ASCII character .alias AscBS $08 ; backspace ASCII character .alias AscCC $03 ; break (Control-C) ASCII character .alias AscCR $0D ; carriage return ASCII character .alias AscDEL $7F ; DEL ASCII character .alias AscESC $1B ; Escape ASCII character .alias AscFF $0C ; Form feed ASCII character .alias AscGT $3E ; Greater than ASCII character .alias AscLF $0A ; line feed ASCII character .alias AscSP $20 ; space ASCII character .alias AscTAB $09 ; tab ASCII character .alias AscVT $0B ; vertical tab ASCII character ; ; consider adding multiply and divide routines ; ; ; Data segments ; .data MONZP .org $0080 .data MONDATA .org $0200 .text ; ; Macros ; ; ; Functions ; .scend
programs/oeis/324/A324129.asm
neoneye/loda
22
243502
; A324129: a(n) = n*Fibonacci(n) + ((-1)^n + 1)/2. ; 1,1,3,6,13,25,49,91,169,306,551,979,1729,3029,5279,9150,15793,27149,46513,79439,135301,229866,389643,659111,1112833,1875625,3156219,5303286,8898709,14912641,24961201,41734339,69705889,116311074,193898159,322961275,537492673,893839229,1485350423,2466593454,4093366201,6788785781,11252400433,18640260791,30861984253,51070642650,84470347539,139647108431,230761294849,381158360401,629313451251,1038615564774,1713466565149,2825763432169,4658448848689,7677112434475,12647680288153,20829811881234,34294630332983,56446599536419,92880525355201,152788577699621,251269851348623,413120630150046,679053430894273,1115899211541725,1833340742329009,3011353204261151,4945195296873589,8119163101808586,13327474349639451,21872368003079159,35888688855307009,58875633912605689,96567746324720619,158361380848353750,259650551340909733,425651356968126289,697662757255734193,1143314387949421459,1873338267877414801,3069014052224656386,5027074839172150463,8233172806864706251,13482054080574835393,22074117237445419725,36136868102564111879,59150572474559266446,96807724496216969929,158418168024419562821,259206047493373450801,424064241544173258119,693690470036663871469,1134614918606334536634,1855585776667612977699,3034341290324059490975,4961348050066399014913,8111250918515297028769,13259581529781261112803,21673376587620961733574 mov $2,$0 seq $0,45925 ; a(n) = n*Fibonacci(n). gcd $2,2 add $0,$2 sub $0,1
libsrc/math/math48/ftoa.asm
jpoikela/z88dk
640
178703
SECTION code_fp_math48 PUBLIC ftoa EXTERN _ftoa_impl ; sccz80 points to the implementation defc ftoa = _ftoa_impl
libsrc/_DEVELOPMENT/string/c/sccz80/strpbrk.asm
Frodevan/z88dk
640
165031
<filename>libsrc/_DEVELOPMENT/string/c/sccz80/strpbrk.asm<gh_stars>100-1000 ; char *strpbrk(const char *s1, const char *s2) SECTION code_clib SECTION code_string PUBLIC strpbrk EXTERN asm_strpbrk strpbrk: pop de pop de pop hl push hl push de push de IF __CLASSIC && __CPU_GBZ80__ call asm_strpbrk ld d,h ld e,l ret ELSE jp asm_strpbrk ENDIF ; SDCC bridge for Classic IF __CLASSIC PUBLIC _strpbrk defc _strpbrk = strpbrk ENDIF
MySource/14-loop-1....n sum.asm
mdabdullahibnaharun/Assembly-Language
0
165250
<filename>MySource/14-loop-1....n sum.asm org 100h include "emu8086.inc" .model small .stack 100h .data n db ? sum db 0 .code main proc mov ax,@data mov ds,ax print "Enter N: " mov ah,1 int 21h sub al,48 mov n,al printn mov bl,1 ;int i = 0 top: cmp bl,n ;cmp jg exit_loop ;bl <=n add sum,bl ;sum = sum + bl inc bl ;bl=bl+1 jmp top exit_loop: print "the sum is " mov ah,2 mov dl,sum int 21h mov ah,4ch int 21h main endp DEFINE_SCAN_NUM DEFINE_PRINT_NUM DEFINE_PRINT_NUM_UNS DEFINE_PRINT_STRING end main ret
libsrc/_DEVELOPMENT/compress/zx7/c/sccz80/dzx7_standard.asm
meesokim/z88dk
0
20283
; void dzx7_standard(void *src, void *dst) SECTION code_compress_zx7 PUBLIC dzx7_standard EXTERN asm_dzx7_standard dzx7_standard: pop af pop de pop hl push hl push de push af jp asm_dzx7_standard
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/ifaces.adb
best08618/asylo
7
6946
<reponame>best08618/asylo with Text_IO; use Text_IO; package body Ifaces is procedure op1 (this : Root) is begin null; end; procedure op2 (this : DT) is begin null; end; end;
programs/oeis/059/A059421.asm
karttu/loda
1
91773
; A059421: A diagonal of A059419. ; 16,136,616,2016,5376,12432,25872,49632,89232,152152,248248,390208,594048,879648,1271328,1798464,2496144,3405864,4576264,6063904,7934080,10261680,13132080,16642080,20900880,26031096,32169816,39469696 mov $1,5 add $1,$0 bin $1,$0 mov $2,2 add $2,$0 mul $2,5 add $2,2 mul $1,$2 sub $1,12 div $1,6 mul $1,8 add $1,16
lib/am335x_sdk/ti/csl/arch/c66x/src/intvecs.asm
brandonbraun653/Apollo
2
94375
<reponame>brandonbraun653/Apollo ;/* ; * Copyright (C) 2013-2017 Texas Instruments Incorporated - http://www.ti.com/ ; * ; * Redistribution and use in source and binary forms, with or without ; * modification, are permitted provided that the following conditions ; * are met: ; * ; * Redistributions of source code must retain the above copyright ; * notice, this list of conditions and the following disclaimer. ; * ; * Redistributions in binary form must reproduce the above copyright ; * notice, this list of conditions and the following disclaimer in the ; * documentation and/or other materials provided with the ; * distribution. ; * ; * Neither the name of Texas Instruments Incorporated nor the names of ; * its contributors may be used to endorse or promote products derived ; * from this software without specific prior written permission. ; * ; * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ; * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ; * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ; * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ; * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ; * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ; * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ; * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; * ; */ *------------------------------------------------------------------------------ * Global symbols defined here and exported out of this file *------------------------------------------------------------------------------ .asg init_regs, _init_regs .global _init_regs .global _INT_SetWaitForInterrupt *------------------------------------------------------------------------------ * Global symbols referenced in this file but defined somewhere else. * Remember that your interrupt service routines need to be referenced here. *------------------------------------------------------------------------------ .ref __IRQ_intTable .ref __ISR_Table .ref _main .ref __c_int00 .ref __stack .ref __STACK_SIZE *------------------------------------------------------------------------------ .sect ".text:_init_regs" .clink _init_regs: .asmfunc MVKL 0,B1 MVKH 0,B1 MVKL 0,A0 MVKH 0,A0 MV B1,B2 MV B1,B3 || MV B2,B4 MV B1,B5 || MV B2,B6 MV B1,B7 || MV B2,B8 MV B1,B9 || MV B2,B10 MV B1,B11 || MV B2,B12 MV B1,B13 || MV B2,B14 MV B1,B15 || MV B2,B16 MV B1,B17 || MV B2,B18 MV B1,B19 || MV B2,B20 MV B1,B21 || MV B2,B22 MV B1,B23 || MV B2,B24 MV B1,B25 || MV B2,B26 MV B1,B27 || MV B2,B28 MV B1,B29 || MV B2,B30 MV B1,B31 MV A0,A1 MV A1,A2 MV A1,A3 || MV A2,A4 MV A1,A5 || MV A2,A6 MV A1,A7 || MV A2,A8 MV A1,A9 || MV A2,A10 MV A1,A11 || MV A2,A12 MV A1,A13 || MV A2,A14 MV A1,A15 || MV A2,A16 MV A1,A17 || MV A2,A18 MV A1,A19 || MV A2,A20 MV A1,A21 || MV A2,A22 MV A1,A23 || MV A2,A24 MV A1,A25 || MV A2,A26 MV A1,A27 || MV A2,A28 MV A1,A29 || MV A2,A30 MV A1,A31 NOP 5 MVKL __c_int00,B0 MVKH __c_int00,B0 B B0 NOP 5 NOP 5 NOP 5 NOP 5 NOP 5 .endasmfunc _INT_SetWaitForInterrupt: IDLE RETNOP B3,5
Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i7-7700_9_0x48.log_21829_1086.asm
ljhsiun2/medusa
9
99717
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r9 push %rax push %rbp push %rbx push %rcx // Store lea addresses_normal+0x145d9, %r13 nop nop nop and %rbp, %rbp movw $0x5152, (%r13) nop nop nop dec %rax // Store lea addresses_WC+0xd4d9, %rcx nop nop nop nop nop cmp %rbx, %rbx movb $0x51, (%rcx) nop nop nop xor $34708, %r9 // Store lea addresses_UC+0x1a189, %r14 clflush (%r14) nop cmp %r13, %r13 mov $0x5152535455565758, %rbp movq %rbp, (%r14) xor $53083, %rax // Store lea addresses_US+0xf559, %rbp nop nop nop dec %r14 movl $0x51525354, (%rbp) nop and %rcx, %rcx // Faulty Load lea addresses_WC+0xd4d9, %rax nop nop nop nop add $32824, %rbx movaps (%rax), %xmm2 vpextrq $0, %xmm2, %r14 lea oracles, %rbp and $0xff, %r14 shlq $12, %r14 mov (%rbp,%r14,1), %r14 pop %rcx pop %rbx pop %rbp pop %rax pop %r9 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': True, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} <gen_prepare_buffer> {'51': 21816, '00': 13} 00 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 00 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 00 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 */
bugs/bug15.ada
daveshields/AdaEd
3
19009
package Tables is procedure Foo ; end Tables; ---------------------------- package Checked_text_io is procedure Foo; end Checked_text_io; ---------------------------- package body Checked_text_io is procedure Foo is begin null; end Foo; end Checked_text_io; ---------------------------- with Checked_Text_Io; package body Tables is package CTIO renames Checked_Text_IO; procedure Foo is begin null; end; end Tables ;
Transynther/x86/_processed/P/_zr_/i7-7700_9_0x48.log_1_1129.asm
ljhsiun2/medusa
9
161804
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %r8 push %r9 lea addresses_WT_ht+0x3775, %r13 sub $28437, %r9 movups (%r13), %xmm0 vpextrq $1, %xmm0, %r14 nop nop nop add $28681, %r8 pop %r9 pop %r8 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %r9 push %rax push %rbp // Faulty Load mov $0x835, %rax nop nop nop cmp $3100, %r14 movups (%rax), %xmm2 vpextrq $0, %xmm2, %r12 lea oracles, %r9 and $0xff, %r12 shlq $12, %r12 mov (%r9,%r12,1), %r12 pop %rbp pop %rax pop %r9 pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': False, 'NT': False}} {'00': 1} 00 */
references/DentShavit.g4
wevrem/wren
5
4195
<reponame>wevrem/wren /* * DentShavit.g4 * https://github.com/wevrem/wry * Author: <NAME> */ /* * This grammar is rigged up to test the DenterHelper class created by Yuval Shavit. */ grammar DentShavit; tokens { INDENT, DEDENT } //@lexer::header { // import DenterHelper; //} @lexer::members { private final DenterHelper denter = new DenterHelper(NEWLINE, DentShavitParser.INDENT, DentShavitParser.DEDENT) { @Override public Token pullToken() { return DentShavitLexer.super.nextToken(); } }; @Override public Token nextToken() { return denter.nextToken(); } } script : ( NEWLINE | statement )* EOF ; statement : simpleStatement | blockStatements ; simpleStatement : LEGIT+ NEWLINE ; blockStatements : LEGIT+ INDENT statement+ DEDENT ; NEWLINE: ('\r'? '\n' ' '*) ; WS : [ \t]+ ; BlockComment : '/*' ( BlockComment | . )*? '*/' -> channel(HIDDEN) ; // allow nesting comments LineComment : '//' ~[\r\n]* -> channel(HIDDEN) ; LEGIT : ~[ \t\r\n]+ ~[\r\n]*; // Replace with your language-specific rules...
apps/nrf24_modem/main.adb
ekoeppen/STM32_Generic_Ada_Drivers
1
7974
with Modem; procedure Main is begin if Modem.Init then Modem.Run; else Modem.Error; end if; end Main;
src/main/fragment/mos6502-common/vbuaa=vbuaa_minus_vbum1.asm
jbrandwood/kickc
2
172254
sec sbc {m1}
oeis/268/A268899.asm
neoneye/loda-programs
11
87919
<filename>oeis/268/A268899.asm ; A268899: Number of n X 3 0..2 arrays with some element plus some horizontally or antidiagonally adjacent neighbor totalling two exactly once. ; Submitted by <NAME> ; 12,168,1584,12960,98496,715392,5038848,34712064,235146240,1572120576,10400182272,68205846528,444063596544,2873352683520,18493942726656,118486616113152,756057455198208,4807171282305024,30467987000524800,192557677843316736,1213844602100908032,7634058822851493888,47910300198585237504,300097484760369070080,1876399009975360290816,11713278668331036966912,73008979660859473133568,454429723870396346793984,2824833418653815128719360,17538530964511513060048896,108768368502600812086689792 mov $1,$0 add $0,1 mul $0,4 sub $0,1 mov $2,6 pow $2,$1 mul $0,$2 mul $0,5 sub $0,15 div $0,15 mul $0,12 add $0,12
print.asm
rodolfovalentim/sistemb2016-1
0
87353
segment code ..start: mov ax, data mov ds, ax mov ax, stack mov ss, ax mov sp, stacktop ;abre arquivo mov ah, 3Dh mov al, 00 mov dx, filename mov cx, 1 int 21h mov word[handle], ax mov si, image read: mov ah, 3Fh mov bx, word[handle] mov cx, 1 mov dx, input int 21h ;verifica se o arquivo acabou cmp ax, cx jl finishread ;compara com o espaço mov dl, byte[input] cmp dl, 20h je store cmp dl, '0' jl finishread mov al, byte[buffer] sub dl, '0' mov bl, 0ah mul bl add al, dl mov byte[buffer], al jmp read store: mov dl, byte[buffer] mov byte[si], dl inc si mov byte[buffer], 00h jmp read finishread: ; termina a leitura da imagem mov dl, [buffer] mov byte[si], dl inc si mov byte[buffer], 00h jmp print print: ;imprime a imagem na tela mov byte[si], '$' mov dx, image mov ah, 09h int 21h doHistogram: mov si, image mov di, histogram mov cx, 62500 L2: mov bl, byte[si] add bx,bx add word[di+bx-1], 0001h inc si loop L2 acumulate: mov si, histogram mov di, cfd mov ax, [si] mov [di], ax add si, 2 mov cx, 255 L3: mov ax, [si] add [di+2], ax mov ax, [di] add [di+2], ax add di, 2 loop L3 exit: mov dx, histogram mov ah, 09h int 21h mov dx, cfd mov ah, 09h int 21h mov ah, 4Ch int 21h segment data filename db 'teste.txt', 0 buffer db 0 handle dw 0 input db 0 histogram: times 256 dw 0 cfd: times 256 dw 0 image: resb 62500 segment stack stack resb 256 stacktop:
repl/libmarkab/debugging.nasm
samblenny/markab-lab
0
91252
<gh_stars>0 ; Copyright (c) 2022 <NAME> ; SPDX-License-Identifier: MIT ; ; MarkabForth debugging words (meant to be included in ../libmarkab.nasm) ; This include path is relative to the working directory that will be in effect ; when running the Makefile in the parent directory of this file. So the ; include path is relative to ../Makefile, which is confusing. %include "libmarkab/common_macros.nasm" extern datCallDP extern datContext extern datDotS extern datDotSNone extern datDP extern datDPStr extern datForthP extern datHeap extern datHeapEnd extern datLast extern datVoc0Head extern DSBase extern mCR extern mDot extern mDup extern mFmtRtlClear extern mFmtRtlInt32 extern mFmtRtlPut extern mFmtRtlSpace extern mPrintDPStr extern mPush extern mStrPut.W extern mWordFetch extern RSBase extern Voc0Head global mDotS global mDotRet global mDumpVars ; Nondestructively print stack in current number base. ; ; The indexing math is tricky. The stack depth (DSDeep) tracks total cells on ; the stack, including T, which is a register. So, the number of stack cells in ; memory is DSDeep-1. Some examples: ; ; DSDeep Top Second_cell Third_cell Fourth_cell ; 0 -- -- -- -- ; 1 T -- -- -- ; 2 T [DSBase+0] -- -- ; 3 T [DSBase+4] [DSBase+0] -- ; 4 T [DSBase+8] [DSBase+4] [DSBase+0] ; mDotS: push rbp movq rdi, DSDeep test rdi, rdi ; if stack is empty, print the empty message jz .doneEmpty call mFmtRtlClear ; otherwise, prepare the formatting buffer ;--------------------- xor ebp, ebp ; start index at 1 because of T inc ebp mov edi, T ; prepare for mFmtRtlInt32(edi: T) ;--------------------- .for: ; Format stack cells call mFmtRtlInt32 ; format(edi: current stack cell) into PadRtl test VMFlags, VMErr jnz .doneFmtErr call mFmtRtlSpace ; add a space (rtl, so space goes to left of number) inc ebp ; inc index movq WQ, DSDeep ; stop if all stack cells have been formatted cmp ebp, W ja .done sub W, ebp ; otherwise, prepare for mFmtRtlInt32(rdi: stack cell) mov edi, [DSBase+4*W] jmp .for ; keep looping ;--------------------- .done: pop rbp call mFmtRtlSpace ; add a space (remember this is right to left) call mFmtRtlPut ; print the format buffer ret ;--------------------- .doneEmpty: pop rbp lea W, [datDotSNone] ; print empty stack message jmp mStrPut.W ;--------------------- .doneFmtErr: pop rbp ret mDotRet: ; Nondestructively print return stack in current base push rbp movq rdi, RSDeep test rdi, rdi ; if stack is empty, print the empty message jz .doneEmpty call mFmtRtlClear ; otherwise, prepare the formatting buffer ;--------------------- xor ebp, ebp ; start index at 1 because of R inc ebp mov edi, R ; prepare for mFmtRtlInt32(edi: R) ;--------------------- .for: ; Format stack cells call mFmtRtlInt32 ; format(edi: current stack cell) into PadRtl call mFmtRtlSpace ; add a space (rtl, so space goes to left of number) inc ebp ; inc index movq WQ, RSDeep ; stop if all stack cells have been formatted cmp ebp, W ja .done sub W, ebp ; otherwise, prepare for mFmtRtlInt32(rdi: stack cell) mov edi, [RSBase+4*W] jmp .for ; keep looping ;--------------------- .done: pop rbp call mFmtRtlSpace ; add a space (remember this is right to left) call mFmtRtlPut ; print the format buffer ret ;--------------------- .doneEmpty: pop rbp lea W, [datDotSNone] ; print empty stack message jmp mStrPut.W mDumpVars: ; Debug dump dictionary variables and stack call mCR fPush [Voc0Head], .end1 ; [Voc0Head] <address> <contents> lea W, [datVoc0Head] call .mDumpOneVar fPush ForthP, .end1 ; ForthP <address> <contents> lea W, [datForthP] call .mDumpOneVar fPush Context, .end1 ; Context <address> <contents> lea W, [datContext] call .mDumpOneVar fPush DP, .end1 ; DP <address> <contents> lea W, [datDP] call .mDumpOneVar fPush Last, .end1 ; Last <address> <contents> lea W, [datLast] call .mDumpOneVar fPush CallDP, .end1 ; CallDP <address> <contents> lea W, [datCallDP] call .mDumpOneVar fPush Heap, .end1 ; Heap <address> <contents> lea W, [datHeap] call .mDumpLabelW fPush HeapEnd, .end1 ; HeapEnd <address> <contents> lea W, [datHeapEnd] call .mDumpLabelW lea W, [datDPStr] ; string([DP]) <string> call mStrPut.W call mPrintDPStr call mCR lea W, [datDotS] ; .s <stack-items> call mStrPut.W call mDotS call mCR .end1: ret .mDumpOneVar: ; Print a line (caller prepares W and T) call mStrPut.W ; Print name of string (W points to string) fDo Dup, .end2 ; copy {T: address} -> {S: addr, T: addr} fDo Dot, .end2 ; print -> {T: addr} fDo WordFetch, .end2 ; fetch -> {T: contents of addr} fDo Dot, .end2 ; print -> {} .end2: call mCR ret .mDumpLabelW: ; This is for values that aren't pointers call mStrPut.W call mDot call mCR ret
tests/typing/bad/testfile-type-1.adb
xuedong/mini-ada
0
7702
with Ada.Text_IO; use Ada.Text_IO; procedure P is type t; begin put('a'); end;
test/Fail/ShapeIrrelevantIndexNoBecauseOfRecursion.agda
shlevy/agda
1,989
15618
{-# OPTIONS --experimental-irrelevance #-} module ShapeIrrelevantIndexNoBecauseOfRecursion where data ⊥ : Set where record ⊤ : Set where constructor trivial data Bool : Set where true false : Bool True : Bool → Set True false = ⊥ True true = ⊤ data D : ..(b : Bool) → Set where c : {b : Bool} → True b → D b -- because of the irrelevant index, -- D is in essence an existental type D : Set -- with constructor c : {b : Bool} → True b → D fromD : {b : Bool} → D b → True b fromD (c p) = p -- should fail cast : .(a b : Bool) → D a → D b cast _ _ x = x bot : ⊥ bot = fromD (cast true false (c trivial))
oeis/046/A046184.asm
neoneye/loda-programs
11
7149
; A046184: Indices of octagonal numbers which are also squares. ; Submitted by <NAME> ; 1,9,121,1681,23409,326041,4541161,63250209,880961761,12270214441,170902040409,2380358351281,33154114877521,461777249934009,6431727384198601,89582406128846401,1247721958419651009,17378525011746267721,242051628206028097081,3371344269872647091409,46956768150011031182641,654023409830281789465561,9109370969473934021335209,126877170162804794509227361,1767171011309793189107847841,24613516988174299853000642409,342822066823130404752901145881,4774895418535651366687615399921 seq $0,79935 ; a(n) = 4*a(n-1) - a(n-2) with a(1) = 1, a(2) = 3. pow $0,2
regtests/util-streams-buffered-lzma-tests.adb
My-Colaborations/ada-util
0
6758
<reponame>My-Colaborations/ada-util<filename>regtests/util-streams-buffered-lzma-tests.adb ----------------------------------------------------------------------- -- util-streams-buffered-lzma-tests -- Unit tests for encoding buffered streams -- Copyright (C) 2018, 2019 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Test_Caller; with Util.Streams.Files; with Util.Streams.Texts; with Ada.Streams.Stream_IO; package body Util.Streams.Buffered.Lzma.Tests is use Util.Streams.Files; use Ada.Streams.Stream_IO; package Caller is new Util.Test_Caller (Test, "Streams.Buffered.Lzma"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test Util.Streams.Buffered.Lzma.Write", Test_Compress_Stream'Access); Caller.Add_Test (Suite, "Test Util.Streams.Buffered.Lzma.Write (2)", Test_Compress_File_Stream'Access); end Add_Tests; procedure Test_Compress_Stream (T : in out Test) is Stream : aliased File_Stream; Buffer : aliased Util.Streams.Buffered.Lzma.Compress_Stream; Print : Util.Streams.Texts.Print_Stream; Path : constant String := Util.Tests.Get_Test_Path ("regtests/result/test-stream.lzma"); Expect : constant String := Util.Tests.Get_Path ("regtests/expect/test-stream.lzma"); begin Stream.Create (Mode => Out_File, Name => Path); Buffer.Initialize (Output => Stream'Access, Size => 1024); Print.Initialize (Output => Buffer'Access, Size => 5); for I in 1 .. 32 loop Print.Write ("abcd"); Print.Write (" fghij"); Print.Write (ASCII.LF); end loop; Print.Flush; Stream.Close; Util.Tests.Assert_Equal_Files (T => T, Expect => Expect, Test => Path, Message => "LZMA stream"); end Test_Compress_Stream; procedure Test_Compress_File_Stream (T : in out Test) is Stream : aliased File_Stream; In_Stream : aliased File_Stream; Buffer : aliased Util.Streams.Buffered.Lzma.Compress_Stream; Path : constant String := Util.Tests.Get_Test_Path ("regtests/result/test-big-stream.lzma"); Expect : constant String := Util.Tests.Get_Path ("regtests/expect/test-big-stream.lzma"); begin In_Stream.Open (Ada.Streams.Stream_IO.In_File, Util.Tests.Get_Path ("regtests/files/test-big-stream.bin")); Stream.Create (Mode => Out_File, Name => Path); Buffer.Initialize (Output => Stream'Access, Size => 32768); Util.Streams.Copy (From => In_Stream, Into => Buffer); Buffer.Flush; Buffer.Close; Util.Tests.Assert_Equal_Files (T => T, Expect => Expect, Test => Path, Message => "LZMA stream"); end Test_Compress_File_Stream; end Util.Streams.Buffered.Lzma.Tests;
home/bankswitch.asm
opiter09/ASM-Machina
1
170830
BankswitchHome:: ; switches to bank # in a ; Only use this when in the home bank! ld [wBankswitchHomeTemp], a ldh a, [hLoadedROMBank] ld [wBankswitchHomeSavedROMBank], a ld a, [wBankswitchHomeTemp] ldh [hLoadedROMBank], a ld [MBC1RomBank], a ret BankswitchBack:: ; returns from BankswitchHome ld a, [wBankswitchHomeSavedROMBank] ldh [hLoadedROMBank], a ld [MBC1RomBank], a ret Bankswitch:: ; self-contained bankswitch, use this when not in the home bank ; switches to the bank in b ldh a, [hLoadedROMBank] push af ld a, b ldh [hLoadedROMBank], a ld [MBC1RomBank], a ld bc, .Return push bc jp hl .Return pop bc ld a, b ldh [hLoadedROMBank], a ld [MBC1RomBank], a ret