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
data/baseStats/poliwhirl.asm
AmateurPanda92/pokemon-rby-dx
9
171794
db DEX_POLIWHIRL ; pokedex id db 65 ; base hp db 65 ; base attack db 65 ; base defense db 90 ; base speed db 50 ; base special db WATER ; species type 1 db WATER ; species type 2 db 120 ; catch rate db 131 ; base exp yield INCBIN "pic/bmon/poliwhirl.pic",0,1 ; 66, sprite dimensions dw PoliwhirlPicFront dw PoliwhirlPicBack ; attacks known at lvl 0 db BUBBLE db HYPNOSIS db WATER_GUN db 0 db 3 ; growth rate ; learnset tmlearn 1,5,6,8 tmlearn 9,10,11,12,13,14 tmlearn 17,18,19,20 tmlearn 26,27,29,31,32 tmlearn 34,35,40 tmlearn 44,46 tmlearn 50,53,54 db 0 ; padding
gcc-gcc-7_3_0-release/gcc/ada/s-diinio.adb
best08618/asylo
7
24725
<reponame>best08618/asylo<filename>gcc-gcc-7_3_0-release/gcc/ada/s-diinio.adb<gh_stars>1-10 ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . D I M . I N T E G E R _ I O -- -- -- -- B o d y -- -- -- -- Copyright (C) 2011-2012, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package body System.Dim.Integer_IO is package Num_Dim_Integer_IO is new Ada.Text_IO.Integer_IO (Num_Dim_Integer); --------- -- Put -- --------- procedure Put (File : File_Type; Item : Num_Dim_Integer; Width : Field := Default_Width; Base : Number_Base := Default_Base; Symbol : String := "") is begin Num_Dim_Integer_IO.Put (File, Item, Width, Base); Ada.Text_IO.Put (File, Symbol); end Put; procedure Put (Item : Num_Dim_Integer; Width : Field := Default_Width; Base : Number_Base := Default_Base; Symbol : String := "") is begin Num_Dim_Integer_IO.Put (Item, Width, Base); Ada.Text_IO.Put (Symbol); end Put; procedure Put (To : out String; Item : Num_Dim_Integer; Base : Number_Base := Default_Base; Symbol : String := "") is begin Num_Dim_Integer_IO.Put (To, Item, Base); To := To & Symbol; end Put; ---------------- -- Put_Dim_Of -- ---------------- pragma Warnings (Off); -- kill warnings on unreferenced formals procedure Put_Dim_Of (File : File_Type; Item : Num_Dim_Integer; Symbol : String := "") is begin Ada.Text_IO.Put (File, Symbol); end Put_Dim_Of; procedure Put_Dim_Of (Item : Num_Dim_Integer; Symbol : String := "") is begin Ada.Text_IO.Put (Symbol); end Put_Dim_Of; procedure Put_Dim_Of (To : out String; Item : Num_Dim_Integer; Symbol : String := "") is begin To := Symbol; end Put_Dim_Of; end System.Dim.Integer_IO;
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_70_980.asm
ljhsiun2/medusa
9
25884
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %rbp push %rbx push %rsi // Faulty Load lea addresses_WC+0xd81b, %rbx nop and $28548, %r14 vmovups (%rbx), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $1, %xmm7, %rbp lea oracles, %r14 and $0xff, %rbp shlq $12, %rbp mov (%r14,%rbp,1), %rbp pop %rsi pop %rbx pop %rbp pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'00': 70} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
asm/config.asm
b00lduck/cbmpet-asm
0
167607
.const BASIC = $0401 .const GLOBALS = $0470 .const PETSCIITABLE = $04f0 .const MAIN = $0539 // 1337 .const ZP_BACKUP = $7d00 .const VVRAM = $7e00 .const VRAM = $8000 .const VVRAM_SIZE = $0160 .const VVRAM_END = VVRAM + VVRAM_SIZE .const VVRAM_TEMP = $7000 // VVRAM IS 88x32 pixel (80x32 + padding left and right 4px) // which is 22x16 bytes = #352 ($0160) // we dont need floating point kernal stuff, so we can use this area of the zero page .const ZP1 = $54 .const ZP2 = $56 .const ZP3 = $58 .const ZP4 = $5a .const ZP5 = $5c .const ZP6 = $5e .const ZP7 = $60 .const ZP8 = $62 // PRNG 16 .const ZP10 = $66 .const ZP11 = $67 .const ZP12 = $68 .const ZP13 = $69 // PRNG 8 .const ZP14 = $6a .const ZP15 = $6b .const ZP_ISR = $90 // Hardware interrupt
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce3002d.ada
best08618/asylo
7
2133
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce3002d.ada -- CE3002D.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT NUMBER_BASE IS A SUBTYPE OF INTEGER, WITH -- NUMBER_BASE'FIRST EQUAL 2 AND NUMBER_BASE'LAST EQUAL 16. -- SPS 10/1/82 WITH REPORT; USE REPORT; WITH TEXT_IO; USE TEXT_IO; PROCEDURE CE3002D IS BEGIN TEST ("CE3002D", "CHECK THAT NUMBER_BASE IS A SUBTYPE " & "OF INTEGER WITH NUMBER_BASE'FIRST = 2 " & "AND NUMBER_BASE'LAST = 16"); DECLARE X : INTEGER; Y : NUMBER_BASE; BEGIN IF NUMBER_BASE'FIRST /= IDENT_INT (2) THEN FAILED ("NUMBER_BASE'FIRST NOT 2"); END IF; IF NUMBER_BASE'LAST /= IDENT_INT (16) THEN FAILED ("NUMBER_BASE'LAST NOT 16"); END IF; X := IDENT_INT (3); Y := X; Y := IDENT_INT (8); X := Y; END; RESULT; END CE3002D;
oeis/014/A014253.asm
neoneye/loda-programs
11
83848
; A014253: a(n) = b(n)^2, where b(n) = b(n-1)^2 + b(n-2)^2 (A000283). ; Submitted by <NAME> ; 0,1,1,4,25,841,749956,563696135209,317754178344723197077225,100967717855888389973004528722798800700252204356,10194480049026283217304918048014173896648364893322762109171869301365366992922226561465025859561,103927423469994929869877727987632937260736008668167913201776816265832125213002314437790795017528104105964750729382441442140418351355937108663554330747512372881509145558760964320151937382889 mov $3,1 lpb $0 sub $0,1 add $2,$3 pow $2,2 mov $3,$1 mov $1,$2 lpe mov $0,$1
libsrc/games/spectrum/bit_open_di.asm
jpoikela/z88dk
640
178691
<gh_stars>100-1000 ; $Id: bit_open_di.asm,v 1.10 2017-01-02 21:15:51 aralbrec Exp $ ; ; ZX Spectrum 1 bit sound functions ; ; Open sound and disable interrupts for exact timing ; ; <NAME> - 28/9/2001 ; SECTION code_clib PUBLIC bit_open_di PUBLIC _bit_open_di EXTERN __snd_tick EXTERN __bit_irqstatus EXTERN __SYSVAR_BORDCR INCLUDE "games/games.inc" .bit_open_di ._bit_open_di ld a,i ; get the current status of the irq line di push af ex (sp),hl ld (__bit_irqstatus),hl pop hl ld a,(__SYSVAR_BORDCR) rra rra rra and 7 or 8 push de ld e,a ld a,(__snd_tick) and sndbit_mask or e pop de ld (__snd_tick),a ret
util/gut/iowp.asm
olifink/smsqe
0
91421
<gh_stars>0 ; General IO utility: do IO, wait, preserve regs V2.00  1988 <NAME> section gen_util xdef gu_iowp include 'dev8_keys_qdos_io' nop ; prevent bra.s failing ;+++ ; This routine does simple io (wait forever) preserving regs ; ; d0 cr action / error code ; d1 c p call parm ; a0 c p channel ID ; a1 c p call parm ; error returns standard ;--- gu_iowp movem.l d1/d3/a1,-(sp) moveq #forever,d3 ; wait forever trap #do.io movem.l (sp)+,d1/d3/a1 tst.l d0 rts end
src/com/touzbi/ansa/antlrgrammar/Comments.g4
tzbee/ansa-bot
1
6793
lexer grammar Comments; LINE_COMMENT : '##' ~[\r\n]* -> skip ;
complexity-drafts/Examples-Source.agda
benhuds/Agda
2
2658
<gh_stars>1-10 open import Preliminaries open import Source-lang module Examples-Source where ----- examples nexp = [] |- nat dbl-test4 : nexp dbl-test4 = app dbl (suc (suc z)) four : nexp four = suc (suc (suc (suc z))) eqs4 : evals dbl-test4 four ((0c +c 0c) +c (0c +c (1c +c (0c +c (0c +c (1c +c (0c +c (0c +c (1c +c 0c))))))))) eqs4 = app-evals lam-evals (s-evals (s-evals z-evals)) (rec-evals (s-evals (s-evals z-evals)) (evals-rec-s (s-evals (s-evals (force-evals delay-evals (rec-evals (s-evals z-evals) (evals-rec-s (s-evals (s-evals (force-evals delay-evals (rec-evals z-evals (evals-rec-z z-evals)))))))))))) dbl-test0 : nexp dbl-test0 = app dbl z zero : nexp zero = z eqs0 : evals dbl-test0 zero ((0c +c 0c) +c (0c +c (1c +c 0c))) eqs0 = app-evals lam-evals z-evals (rec-evals z-evals (evals-rec-z z-evals)) add-test0 : nexp add-test0 = app (app add z) z eqs01 : evals add-test0 zero ((((0c +c 0c) +c 0c) +c 0c) +c (0c +c (1c +c 0c))) eqs01 = app-evals (app-evals lam-evals z-evals lam-evals) z-evals (rec-evals z-evals (evals-rec-z z-evals)) one : nexp one = suc z two : nexp two = suc (suc z) add-test1 : nexp add-test1 = app (app add (suc z)) z eqs11 : evals add-test1 one ((((0c +c 0c) +c 0c) +c 0c) +c (0c +c (1c +c (0c +c (0c +c (1c +c 0c)))))) eqs11 = app-evals (app-evals lam-evals (s-evals z-evals) lam-evals) z-evals (rec-evals (s-evals z-evals) (evals-rec-s (s-evals (force-evals delay-evals (rec-evals z-evals (evals-rec-z z-evals)))))) add-test1' : nexp add-test1' = app (app add z) (suc z) eqs11' : evals add-test1' one ((((0c +c 0c) +c 0c) +c 0c) +c (0c +c (1c +c 0c))) eqs11' = app-evals (app-evals lam-evals z-evals lam-evals) (s-evals z-evals) (rec-evals z-evals (evals-rec-z (s-evals z-evals))) add-test2 : nexp add-test2 = app (app add z) four eqs12 : evals add-test2 four ((((0c +c 0c) +c 0c) +c 0c) +c (0c +c (1c +c 0c))) eqs12 = app-evals (app-evals lam-evals z-evals lam-evals) (s-evals (s-evals (s-evals (s-evals z-evals)))) (rec-evals z-evals (evals-rec-z (s-evals (s-evals (s-evals (s-evals z-evals)))))) add-test2' : nexp add-test2' = app (app add four) z eqs12' : evals add-test2' four ((((0c +c 0c) +c 0c) +c 0c) +c (0c +c (1c +c (0c +c (0c +c (1c +c (0c +c (0c +c (1c +c (0c +c (0c +c (1c +c (0c +c (0c +c (1c +c 0c))))))))))))))) eqs12' = app-evals (app-evals lam-evals (s-evals (s-evals (s-evals (s-evals z-evals)))) lam-evals) z-evals (rec-evals (s-evals (s-evals (s-evals (s-evals z-evals)))) (evals-rec-s (s-evals (force-evals delay-evals (rec-evals (s-evals (s-evals (s-evals z-evals))) (evals-rec-s (s-evals (force-evals delay-evals (rec-evals (s-evals (s-evals z-evals)) (evals-rec-s (s-evals (force-evals delay-evals (rec-evals (s-evals z-evals) (evals-rec-s (s-evals (force-evals delay-evals (rec-evals z-evals (evals-rec-z z-evals)))))))))))))))))) mult-test1 : nexp mult-test1 = app (app mult two) two eqs111 : evals mult-test1 four ((((0c +c 0c) +c 0c) +c 0c) +c (0c +c (1c +c ((((0c +c 0c) +c 0c) +c (0c +c (0c +c (1c +c ((((0c +c 0c) +c 0c) +c (0c +c (0c +c (1c +c 0c)))) +c (0c +c (1c +c (0c +c (0c +c (1c +c (0c +c (0c +c (1c +c 0c))))))))))))) +c (0c +c (1c +c (0c +c (0c +c (1c +c (0c +c (0c +c (1c +c 0c)))))))))))) eqs111 = app-evals (app-evals lam-evals (s-evals (s-evals z-evals)) lam-evals) (s-evals (s-evals z-evals)) (rec-evals (s-evals (s-evals z-evals)) (evals-rec-s (app-evals (app-evals lam-evals (s-evals (s-evals z-evals)) lam-evals) (force-evals delay-evals (rec-evals (s-evals z-evals) (evals-rec-s (app-evals (app-evals lam-evals (s-evals (s-evals z-evals)) lam-evals) (force-evals delay-evals (rec-evals z-evals (evals-rec-z z-evals))) (rec-evals (s-evals (s-evals z-evals)) (evals-rec-s (s-evals (force-evals delay-evals (rec-evals (s-evals z-evals) (evals-rec-s (s-evals (force-evals delay-evals (rec-evals z-evals (evals-rec-z z-evals)))))))))))))) (rec-evals (s-evals (s-evals z-evals)) (evals-rec-s (s-evals (force-evals delay-evals (rec-evals (s-evals z-evals) (evals-rec-s (s-evals (force-evals delay-evals (rec-evals z-evals (evals-rec-z (s-evals (s-evals z-evals))))))))))))))) mult-test2 : nexp mult-test2 = app (app mult one) one eqs112 : evals mult-test2 one ((((0c +c 0c) +c 0c) +c 0c) +c (0c +c (1c +c ((((0c +c 0c) +c 0c) +c (0c +c (0c +c (1c +c 0c)))) +c (0c +c (1c +c (0c +c (0c +c (1c +c 0c))))))))) eqs112 = app-evals (app-evals lam-evals (s-evals z-evals) lam-evals) (s-evals z-evals) (rec-evals (s-evals z-evals) (evals-rec-s (app-evals (app-evals lam-evals (s-evals z-evals) lam-evals) (force-evals delay-evals (rec-evals z-evals (evals-rec-z z-evals))) (rec-evals (s-evals z-evals) (evals-rec-s (s-evals (force-evals delay-evals (rec-evals z-evals (evals-rec-z z-evals))))))))) mult-test0 : nexp mult-test0 = app (app mult zero) zero eqs00 : evals mult-test0 zero ((((0c +c 0c) +c 0c) +c 0c) +c (0c +c (1c +c 0c))) eqs00 = app-evals (app-evals lam-evals z-evals lam-evals) z-evals (rec-evals z-evals (evals-rec-z z-evals))
Template/cpu_a.asm
EmbeddedInsights/uC-CPU
17
2522
;******************************************************************************************************** ; uC/CPU ; CPU CONFIGURATION & PORT LAYER ; ; Copyright 2004-2021 Silicon Laboratories Inc. www.silabs.com ; ; SPDX-License-Identifier: APACHE-2.0 ; ; This software is subject to an open source license and is distributed by ; Silicon Laboratories Inc. pursuant to the terms of the Apache License, ; Version 2.0 available at www.apache.org/licenses/LICENSE-2.0. ; ;******************************************************************************************************** ;******************************************************************************************************** ; ; CPU PORT FILE ; ; TEMPLATE ; ; $$$$ Insert CPU Name ; $$$$ Insert Compiler Name ; ; Filename : cpu_a.asm $$$$ Insert CPU assembly port file name ; Version : V1.32.01 $$$$ Insert CPU assembly port file version number ;******************************************************************************************************** ; Note(s) : (1) To provide the required CPU port functionality, insert the appropriate CPU- &/or ; compiler-specific code to perform the stated actions wherever '$$$$' comments are ; found. ; ; #### This note MAY be entirely removed for specific CPU port files. ;******************************************************************************************************** ;******************************************************************************************************** ; PUBLIC FUNCTIONS ;******************************************************************************************************** ; $$$$ Extern required CPU port functions : PUBLIC CPU_IntDis PUBLIC CPU_IntEn PUBLIC CPU_SR_Push PUBLIC CPU_SR_Pop PUBLIC CPU_SR_Save PUBLIC CPU_SR_Restore PUBLIC CPU_CntLeadZeros PUBLIC CPU_CntTrailZeros PUBLIC CPU_RevBits ;******************************************************************************************************** ; EQUATES ;******************************************************************************************************** ; $$$$ Define possible required CPU equates : ;******************************************************************************************************** ; CODE GENERATION DIRECTIVES ;******************************************************************************************************** ; $$$$ Insert possible required CPU-compiler code generation directives : ;******************************************************************************************************** ; DISABLE/ENABLE INTERRUPTS ; ; Description : Disable/Enable interrupts. ; ; (1) (a) For CPU_CRITICAL_METHOD_INT_DIS_EN, interrupts are enabled/disabled WITHOUT saving ; or restoring the state of the interrupt status. ; ; ; Prototypes : void CPU_IntDis(void); ; void CPU_IntEn (void); ;******************************************************************************************************** CPU_IntDis ; $$$$ Insert code to disable CPU interrupts CPU_IntEn ; $$$$ Insert code to enable CPU interrupts ;******************************************************************************************************** ; PUSH/POP CPU STATUS REGISTER ; ; Description : Push/Pop the state of CPU interrupts onto the local stack, if possible. ; ; (1) (b) For CPU_CRITICAL_METHOD_STATUS_STK, the state of the interrupt status flag is ; stored in onto the local stack & interrupts are then disabled. The previous ; interrupt status state is restored from the local stack into the CPU's status ; register. ; ; ; Prototypes : void CPU_SR_Push(void); ; void CPU_SR_Pop (void); ;******************************************************************************************************** CPU_SR_Push ; $$$$ Insert code to push CPU status onto local stack & disable interrupts CPU_SR_Pop ; $$$$ Insert code to pop CPU status from local stack ;******************************************************************************************************** ; SAVE/RESTORE CPU STATUS REGISTER ; ; Description : Save/Restore the state of CPU interrupts, if possible. ; ; (1) (c) For CPU_CRITICAL_METHOD_STATUS_LOCAL, the state of the interrupt status flag is ; stored in the local variable 'cpu_sr' & interrupts are then disabled ('cpu_sr' is ; allocated in all functions that need to disable interrupts). The previous interrupt ; status state is restored by copying 'cpu_sr' into the CPU's status register. ; ; ; Prototypes : CPU_SR CPU_SR_Save (void); ; void CPU_SR_Restore(CPU_SR cpu_sr); ; ; Note(s) : (1) These functions are used in general like this : ; ; void Task (void *p_arg) ; { ; CPU_SR_ALLOC(); /* Allocate storage for CPU status register */ ; : ; : ; CPU_CRITICAL_ENTER(); /* cpu_sr = CPU_SR_Save(); */ ; : ; : ; CPU_CRITICAL_EXIT(); /* CPU_SR_Restore(cpu_sr); */ ; : ; } ;******************************************************************************************************** CPU_SR_Save ; $$$$ Insert code to save CPU status register(s) & disable interrupts CPU_SR_Restore ; $$$$ Insert code to restore CPU status register(s) ;******************************************************************************************************** ; CPU_CntLeadZeros() ; COUNT LEADING ZEROS ; ; Description : Counts the number of contiguous, most-significant, leading zero bits before the ; first binary one bit in a data value. ; ; Prototype : CPU_DATA CPU_CntLeadZeros(CPU_DATA val); ; ; Argument(s) : val Data value to count leading zero bits. ; ; Return(s) : Number of contiguous, most-significant, leading zero bits in 'val'. ; ; Note(s) : (1) (a) Supports up to the following data value sizes, depending on the configured ; size of 'CPU_DATA' (see 'cpu.h CPU WORD CONFIGURATION Note #1') : ; ; (1) 8-bits ; (2) 16-bits ; (3) 32-bits ; (4) 64-bits ; ; (b) (1) For 8-bit values : ; ; b07 b06 b05 b04 b03 b02 b01 b00 # Leading Zeros ; --- --- --- --- --- --- --- --- --------------- ; 1 x x x x x x x 0 ; 0 1 x x x x x x 1 ; 0 0 1 x x x x x 2 ; 0 0 0 1 x x x x 3 ; 0 0 0 0 1 x x x 4 ; 0 0 0 0 0 1 x x 5 ; 0 0 0 0 0 0 1 x 6 ; 0 0 0 0 0 0 0 1 7 ; 0 0 0 0 0 0 0 0 8 ; ; ; (2) For 16-bit values : ; ; b15 b14 b13 ... b04 b03 b02 b01 b00 # Leading Zeros ; --- --- --- --- --- --- --- --- --------------- ; 1 x x x x x x x 0 ; 0 1 x x x x x x 1 ; 0 0 1 x x x x x 2 ; : : : : : : : : : ; : : : : : : : : : ; 0 0 0 1 x x x x 11 ; 0 0 0 0 1 x x x 12 ; 0 0 0 0 0 1 x x 13 ; 0 0 0 0 0 0 1 x 14 ; 0 0 0 0 0 0 0 1 15 ; 0 0 0 0 0 0 0 0 16 ; ; ; (3) For 32-bit values : ; ; b31 b30 b29 ... b04 b03 b02 b01 b00 # Leading Zeros ; --- --- --- --- --- --- --- --- --------------- ; 1 x x x x x x x 0 ; 0 1 x x x x x x 1 ; 0 0 1 x x x x x 2 ; : : : : : : : : : ; : : : : : : : : : ; 0 0 0 1 x x x x 27 ; 0 0 0 0 1 x x x 28 ; 0 0 0 0 0 1 x x 29 ; 0 0 0 0 0 0 1 x 30 ; 0 0 0 0 0 0 0 1 31 ; 0 0 0 0 0 0 0 0 32 ; ; ; (4) For 64-bit values : ; ; b63 b62 b61 ... b04 b03 b02 b01 b00 # Leading Zeros ; --- --- --- --- --- --- --- --- --------------- ; 1 x x x x x x x 0 ; 0 1 x x x x x x 1 ; 0 0 1 x x x x x 2 ; : : : : : : : : : ; : : : : : : : : : ; 0 0 0 1 x x x x 59 ; 0 0 0 0 1 x x x 60 ; 0 0 0 0 0 1 x x 61 ; 0 0 0 0 0 0 1 x 62 ; 0 0 0 0 0 0 0 1 63 ; 0 0 0 0 0 0 0 0 64 ; ; (2) MUST be defined in 'cpu_a.asm' (or 'cpu_c.c') if CPU_CFG_LEAD_ZEROS_ASM_PRESENT ; is #define'd in 'cpu_cfg.h' or 'cpu.h'. ;******************************************************************************************************** CPU_CntLeadZeros ; $$$$ Insert code to count the number of contiguous, most-significant, ... ; ... leading zero bits in 'val' (see Note #1b) ;******************************************************************************************************** ; CPU_CntTrailZeros() ; COUNT TRAILING ZEROS ; ; Description : Counts the number of contiguous, least-significant, trailing zero bits before the ; first binary one bit in a data value. ; ; Prototype : CPU_DATA CPU_CntTrailZeros(CPU_DATA val); ; ; Argument(s) : val Data value to count trailing zero bits. ; ; Return(s) : Number of contiguous, least-significant, trailing zero bits in 'val'. ; ; Note(s) : (1) (a) Supports up to the following data value sizes, depending on the configured ; size of 'CPU_DATA' (see 'cpu.h CPU WORD CONFIGURATION Note #1') : ; ; (1) 8-bits ; (2) 16-bits ; (3) 32-bits ; (4) 64-bits ; ; (b) (1) For 8-bit values : ; ; b07 b06 b05 b04 b03 b02 b01 b00 # Trailing Zeros ; --- --- --- --- --- --- --- --- ---------------- ; x x x x x x x 1 0 ; x x x x x x 1 0 1 ; x x x x x 1 0 0 2 ; x x x x 1 0 0 0 3 ; x x x 1 0 0 0 0 4 ; x x 1 0 0 0 0 0 5 ; x 1 0 0 0 0 0 0 6 ; 1 0 0 0 0 0 0 0 7 ; 0 0 0 0 0 0 0 0 8 ; ; ; (2) For 16-bit values : ; ; b15 b14 b13 b12 b11 ... b02 b01 b00 # Trailing Zeros ; --- --- --- --- --- --- --- --- ---------------- ; x x x x x x x 1 0 ; x x x x x x 1 0 1 ; x x x x x 1 0 0 2 ; : : : : : : : : : ; : : : : : : : : : ; x x x x 1 0 0 0 11 ; x x x 1 0 0 0 0 12 ; x x 1 0 0 0 0 0 13 ; x 1 0 0 0 0 0 0 14 ; 1 0 0 0 0 0 0 0 15 ; 0 0 0 0 0 0 0 0 16 ; ; ; (3) For 32-bit values : ; ; b31 b30 b29 b28 b27 ... b02 b01 b00 # Trailing Zeros ; --- --- --- --- --- --- --- --- ---------------- ; x x x x x x x 1 0 ; x x x x x x 1 0 1 ; x x x x x 1 0 0 2 ; : : : : : : : : : ; : : : : : : : : : ; x x x x 1 0 0 0 27 ; x x x 1 0 0 0 0 28 ; x x 1 0 0 0 0 0 29 ; x 1 0 0 0 0 0 0 30 ; 1 0 0 0 0 0 0 0 31 ; 0 0 0 0 0 0 0 0 32 ; ; ; (4) For 64-bit values : ; ; b63 b62 b61 b60 b59 ... b02 b01 b00 # Trailing Zeros ; --- --- --- --- --- --- --- --- ---------------- ; x x x x x x x 1 0 ; x x x x x x 1 0 1 ; x x x x x 1 0 0 2 ; : : : : : : : : : ; : : : : : : : : : ; x x x x 1 0 0 0 59 ; x x x 1 0 0 0 0 60 ; x x 1 0 0 0 0 0 61 ; x 1 0 0 0 0 0 0 62 ; 1 0 0 0 0 0 0 0 63 ; 0 0 0 0 0 0 0 0 64 ; ; (2) MUST be defined in 'cpu_a.asm' (or 'cpu_c.c') if CPU_CFG_TRAIL_ZEROS_ASM_PRESENT ; is #define'd in 'cpu_cfg.h' or 'cpu.h'. ;******************************************************************************************************** CPU_CntTrailZeros ; $$$$ Insert code to count the number of contiguous, least-significant, ... ; ... trailing zero bits in 'val' (see Note #1b) ;******************************************************************************************************** ; CPU_RevBits() ; REVERSE BITS ; ; Description : Reverses the bits in a data value. ; ; Prototypes : CPU_DATA CPU_RevBits(CPU_DATA val); ; ; Argument(s) : val Data value to reverse bits. ; ; Return(s) : Value with all bits in 'val' reversed (see Note #1). ; ; Note(s) : (1) The final, reversed data value for 'val' is such that : ; ; 'val's final bit 0 = 'val's original bit N ; 'val's final bit 1 = 'val's original bit (N - 1) ; 'val's final bit 2 = 'val's original bit (N - 2) ; ; ... ... ; ; 'val's final bit (N - 2) = 'val's original bit 2 ; 'val's final bit (N - 1) = 'val's original bit 1 ; 'val's final bit N = 'val's original bit 0 ;******************************************************************************************************** CPU_RevBits ; $$$$ Insert code to reverse the bits in 'val' (see Note #1) ;******************************************************************************************************** ; CPU ASSEMBLY PORT FILE END ;******************************************************************************************************** ; $$$$ Insert assembly end-of-file directive, if any
programs/oeis/280/A280098.asm
karttu/loda
1
16017
; A280098: The sum of the divisors of 24*n - 1, divided by 24. ; 1,2,3,5,6,7,7,8,11,10,11,14,13,17,15,16,19,18,28,20,21,24,25,31,25,30,27,31,35,30,31,35,38,41,35,36,37,38,54,46,41,45,43,53,49,46,57,48,62,55,51,55,56,76,55,60,57,63,71,60,80,62,63,77,65,66,67,78,83,74,77,79,78,93,86,76,77,78,95,85,85,94,91,112,85,86,87,88,124,96,95,92,98,126,99,114,105,98,130,100,101,102,118,125,115,106,114,108,131,140,111,112,113,137,120,133,134,125,143,120,121,122,133,186,125,126,139,133,155,130,150,132,133,161,140,147,145,176,180,140,150,142,148,173,171,152,147,153,217,155,151,174,153,185,155,165,157,168,220,175,161,183,163,197,171,190,167,175,203,170,187,172,198,217,210,182,184,178,215,206,187,199,183,221,194,186,214,203,227,196,191,204,211,285,195,196,205,198,248,200,252,209,203,270,205,206,207,256,270,210,217,212,225,280,272,222,224,218,263,220,221,254,223,286,225,270,245,228,316,230,242,245,233,281,235,270,266,238,304,259,241,242,300,293,245,246,247,271,310,286 add $0,1 mul $0,4 sub $0,1 cal $0,98098 ; a(n) = sigma(6*n+5)/6. mov $1,$0 sub $1,4 div $1,4 add $1,1
FeaturePatches/Roam/Roam.asm
xragey/smw
4
172046
<filename>FeaturePatches/Roam/Roam.asm ;------------------------------------------------------------------------------- ; ; Roam.asm ; by Ragey <<EMAIL>> ; https://github.com/xragey/smw ; ; Replaces the vanilla game's oam seeking routine. For information and usage ; instructions, review the readme provided in the git repository. ; ;------------------------------------------------------------------------------- @asar 1.71 !sa1 = 0 !fast = 0 !bank = $00 !addr = $0000 !long = $000000 !Sprite009E = $009E !Sprite00C2 = $00C2 !Sprite14C8 = $14C8 !Sprite1549 = $1549 !Sprite15EA = $15EA ; ------------------------------------------------------------------------------ ; To enable support for custom sprites, change this value to 1. Recommended to ; activate as soon as you've applied a sprite tool, such as Pixi or Giepy. !cSupportCustomSprites = 0 ; To enable support for dynamic cluster sprite oam tile assignment, change this ; value to 1. You should enable this if you can; only disable it if you heavily ; edited the cluster sprite system and rely on static oam assignment for them. !cClusterSpritesUseAllocator = 1 ; 1 byte ; Holds the slot that will be assigned to the next request for one or more oam ; tile(s). !OamIndex = $0AF5|!addr ; 20 bytes ; Holds the oam slot that was assigned to individual cluster sprites, similar to ; $15EA for regular sprites. Unused if !cClusterSpritesUseAllocator is disabled. !ClusterOamIndex = $0F5E|!addr ; ------------------------------------------------------------------------------ ; Refresh the allocator at the beginning of each frame. org $00A1DA autoclean jml Refresh nop freecode Refresh: lda $1426|!addr beq + jml $00A1DF|!long + ldy #$44 lda $13F9|!addr beq + ldy #$24 + sty !OamIndex jml $00A1E4|!long ; Oam assignment algorithm. Uses a lookup table. org $0180D1 Allocator: .Return rts .SpriteOam lda !Sprite14C8,x beq .Return lda !OamIndex sta !Sprite15EA,x autoclean jsl Allocate nop #9 .Continue warnpc $0180EA freecode Allocate: .SpecialSprites lda !Sprite009E,x cmp #$35 beq .Yoshi cmp #$87 bne .DetermineSpriteType .LakituCloud ldy #$00 lda !Sprite00C2,x bne + ldy #$34 lda $13F9|!addr beq + ldy #$14 bra + .Yoshi ldy #$3C lda $13F9|!addr beq + ldy #$1C + tya sta !Sprite15EA,x rtl .DetermineSpriteType phx if !cSupportCustomSprites { lda !Sprite7FAB10,x bit #$08 beq .StandardSprite .CustomSprite lda !Sprite7FAB9E,x tax lda !OamIndex tay clc adc.l .CustomSpriteTileCount,x sta !OamIndex plx rtl } endif .StandardSprite lda !Sprite009E,x tax lda !OamIndex tay clc adc.l .StandardSpriteTileCount,x sta !OamIndex plx rtl ; Table contains the amount of oam tiles, times 4, used by each standard sprite. ; Unless you've changed how these sprites behave, this table should not need to ; be changed. .StandardSpriteTileCount db $04,$04,$04,$04,$0C,$0C,$0C,$0C ; 00-07 db $0C,$0C,$0C,$0C,$0C,$0C,$08,$04 ; 08-0F db $0C,$04,$00,$04,$10,$04,$04,$00 ; 10-17 db $04,$00,$08,$04,$04,$04,$08,$00 ; 18-1F db $04,$08,$08,$08,$08,$08,$14,$10 ; 20-27 db $50,$00,$08,$08,$04,$04,$04,$10 ; 28-2F db $0C,$04,$0C,$10,$08,$00,$00,$04 ; 30-37 db $04,$04,$14,$14,$14,$04,$04,$08 ; 38-3F db $08,$0C,$0C,$08,$08,$08,$14,$04 ; 40-47 db $04,$08,$04,$08,$04,$04,$04,$0C ; 48-4F db $0C,$04,$10,$24,$00,$14,$14,$14 ; 50-57 db $00,$14,$14,$0C,$14,$14,$24,$28 ; 58-5F db $08,$04,$0C,$14,$24,$0C,$0C,$10 ; 60-67 db $04,$00,$04,$14,$14,$00,$10,$14 ; 68-6F db $14,$0C,$0C,$0C,$04,$04,$04,$04 ; 70-77 db $04,$04,$D8,$0C,$00,$04,$0C,$0C ; 78-7F db $04,$04,$00,$0C,$0C,$00,$18,$00 ; 80-87 db $00,$00,$04,$08,$04,$28,$00,$10 ; 88-8F db $40,$14,$14,$14,$14,$14,$14,$14 ; 90-97 db $14,$0C,$10,$10,$10,$14,$18,$40 ; 98-9F db $00,$40,$14,$18,$10,$04,$14,$00 ; A0-A7 db $14,$18,$0C,$08,$14,$14,$28,$04 ; A8-AF db $04,$04,$04,$08,$10,$00,$04,$0C ; B0-B7 db $0C,$04,$0C,$10,$0C,$04,$04,$10 ; B8-BF db $14,$14,$04,$10,$10,$50,$04,$00 ; C0-C7 db $04,$00,$00,$00,$00,$00,$00,$00 ; C8-CF db $00,$00,$00,$00,$00,$00,$00,$00 ; D0-D7 db $00,$00,$00,$00,$00,$00,$00,$00 ; D8-DF db $00,$00,$00,$00,$00,$00,$00,$00 ; E0-E7 db $00,$00,$00,$00,$00,$00,$00,$00 ; E8-EF db $00,$00,$00,$00,$00,$00,$00,$00 ; F0-F7 db $00,$00,$00,$00,$00,$00,$00,$00 ; F8-FF if !cSupportCustomSprites { ; Table contains the amount of oam tiles, times 4, used by each custom sprite. ; You should update this table as you add custom sprites to your game. .CustomSpriteTileCount db $00,$00,$00,$00,$00,$00,$00,$00 ; 00-07 db $00,$00,$00,$00,$00,$00,$00,$00 ; 08-0F db $00,$00,$00,$00,$00,$00,$00,$00 ; 10-17 db $00,$00,$00,$00,$00,$00,$00,$00 ; 18-1F db $00,$00,$00,$00,$00,$00,$00,$00 ; 20-27 db $00,$00,$00,$00,$00,$00,$00,$00 ; 28-2F db $00,$00,$00,$00,$00,$00,$00,$00 ; 30-37 db $00,$00,$00,$00,$00,$00,$00,$00 ; 38-3F db $00,$00,$00,$00,$00,$00,$00,$00 ; 40-47 db $00,$00,$00,$00,$00,$00,$00,$00 ; 48-4F db $00,$00,$00,$00,$00,$00,$00,$00 ; 50-57 db $00,$00,$00,$00,$00,$00,$00,$00 ; 58-5F db $00,$00,$00,$00,$00,$00,$00,$00 ; 60-67 db $00,$00,$00,$00,$00,$00,$00,$00 ; 68-6F db $00,$00,$00,$00,$00,$00,$00,$00 ; 70-77 db $00,$00,$00,$00,$00,$00,$00,$00 ; 78-7F db $00,$00,$00,$00,$00,$00,$00,$00 ; 80-87 db $00,$00,$00,$00,$00,$00,$00,$00 ; 88-8F db $00,$00,$00,$00,$00,$00,$00,$00 ; 90-97 db $00,$00,$00,$00,$00,$00,$00,$00 ; 98-9F db $00,$00,$00,$00,$00,$00,$00,$00 ; A0-A7 db $00,$00,$00,$00,$00,$00,$00,$00 ; A8-AF db $00,$00,$00,$00,$00,$00,$00,$00 ; B0-B7 db $00,$00,$00,$00,$00,$00,$00,$00 ; B8-BF db $00,$00,$00,$00,$00,$00,$00,$00 ; C0-C7 db $00,$00,$00,$00,$00,$00,$00,$00 ; C8-CF db $00,$00,$00,$00,$00,$00,$00,$00 ; D0-D7 db $00,$00,$00,$00,$00,$00,$00,$00 ; D8-DF db $00,$00,$00,$00,$00,$00,$00,$00 ; E0-E7 db $00,$00,$00,$00,$00,$00,$00,$00 ; E8-EF db $00,$00,$00,$00,$00,$00,$00,$00 ; F0-F7 db $00,$00,$00,$00,$00,$00,$00,$00 ; F8-FF } endif ; Implements a dynamic oam tile assignment scheme for cluster sprites. if !cClusterSpritesUseAllocator { org $02FF50 AllocateClusterSprite: ldy !OamIndex tya sta !ClusterOamIndex,x clc adc #$04 sta !OamIndex rts AllocateSumoFire: ldy !OamIndex tya sta !ClusterOamIndex,x clc adc #$08 sta !OamIndex rts warnpc $02FF6C ; Remap sumo brothers' fire pillar cluster sprite. org $02F940 SumoFire: jsr AllocateSumoFire sty !Sprite15EA nop #3 warnpc $02F949 ; Remap other cluster sprites. Note that the candle flames are intentionally not ; remapped to ensure that they will always use the bottom five slots, just as in ; the vanilla game. org $02FCCD : lda !ClusterOamIndex,x org $02FCD9 : ldy !ClusterOamIndex,x org $02FD4A : jsr AllocateClusterSprite org $02FD98 : ldy !ClusterOamIndex,x org $02FE48 : jsr AllocateClusterSprite } endif ; Shift Mario's oam slot by 1. This fixes Super Mario's head disappearing while ; carrying certain items, such as MechaKoopas. org $00E2B2 : db $14,$D4,$14,$E8 ; Shift Yoshi's oam slot by 1 while turning around. This fixes Yoshi's head ; disappearing while riding Lakitu's cloud. org $01EF62 : db $08 ; Prevent Lakitu's cloud from using hardcoded slots. This allows us to free 8 ; oam slots while Mario is behind the scenery (e.g. climbing nets). org $01E8DE lda !Sprite15EA,x sta $18B6|!addr sta $0E clc adc #$04 sta $0F warnpc $01E8EB ; Prevent Lakitu's fishing rod from using hardcoded slots, which messes up the ; allocator. org $02E6EC nop #2 autoclean jsl AllocateFishingLine warnpc $02E6F2 freecode AllocateFishingLine: lda !OamIndex clc adc #$08 sta !Sprite15EA,x tay clc adc #$20 sta !OamIndex rtl ; Prevent the swiveling net door from using hardcoded slots, which messes up the ; allocator. org $01BB33 lda !Sprite15EA,x sta $0F warnpc $01BB38
regtests/servlet-filters-tests.adb
My-Colaborations/ada-servlet
6
17111
<reponame>My-Colaborations/ada-servlet<gh_stars>1-10 ----------------------------------------------------------------------- -- Filters Tests - Unit tests for Servlet.Filters -- Copyright (C) 2015, 2018 <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. ----------------------------------------------------------------------- package body Servlet.Filters.Tests is -- ------------------------------ -- Increment the counter each time Do_Filter is called. -- ------------------------------ procedure Do_Filter (F : in Test_Filter; Request : in out Requests.Request'Class; Response : in out Responses.Response'Class; Chain : in out Servlet.Core.Filter_Chain) is use type Core.Servlet_Registry_Access; Registry : constant Core.Servlet_Registry_Access := Core.Get_Servlet_Context (Chain); begin if Registry /= null then F.Count.all := F.Count.all + 1; end if; Servlet.Core.Do_Filter (Chain => Chain, Request => Request, Response => Response); end Do_Filter; -- ------------------------------ -- Initialize the test filter. -- ------------------------------ overriding procedure Initialize (Server : in out Test_Filter; Config : in Servlet.Core.Filter_Config) is Name : constant String := Core.Get_Filter_Name (Config); begin if Name = "F1" or else Name = "F2" then Server.Count := Server.Counter'Unchecked_Access; end if; end Initialize; end Servlet.Filters.Tests;
chap15/ex9/scatter_avx.asm
JamesType/optimization-manual
374
90280
<filename>chap15/ex9/scatter_avx.asm ; ; Copyright (C) 2021 by Intel Corporation ; ; Permission to use, copy, modify, and/or distribute this software for any ; purpose with or without fee is hereby granted. ; ; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH ; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY ; AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, ; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM ; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR ; OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR ; PERFORMANCE OF THIS SOFTWARE. ; ; .globl scatter_avx ; void scatter_avx(int32_t *in, int32_t *out, unt32_t *index, size_t len); ; On entry: ; rcx = in ; rdx = out ; r8 = index ; r9 = len .code scatter_avx PROC public push rbx ; registers are already initialised correctly. ; mov rcx, InBuf ; mov rdx, OutBuf ; mov r8, Index mov r10, r9 xor r9, r9 loop1: vmovaps ymm0, [rcx + 4*r9] movsxd rax, dword ptr[r8 + 4*r9] movsxd rbx, dword ptr[r8 + 4*r9 + 4] vmovss dword ptr[rdx + 4*rax], xmm0 movsxd rax, dword ptr[r8 + 4*r9 + 8] vpalignr xmm1, xmm0, xmm0, 4 vmovss dword ptr[rdx + 4*rbx], xmm1 movsxd rbx, dword ptr[r8 + 4*r9 + 12] vpalignr xmm2, xmm0, xmm0, 8 vmovss dword ptr[rdx + 4*rax], xmm2 movsxd rax, dword ptr[r8 + 4*r9 + 16] vpalignr xmm3, xmm0, xmm0, 12 vmovss dword ptr[rdx + 4*rbx], xmm3 movsxd rbx, dword ptr[r8 + 4*r9 + 20] vextractf128 xmm0, ymm0, 1 vmovss dword ptr[rdx + 4*rax], xmm0 movsxd rax, dword ptr[r8 + 4*r9 + 24] vpalignr xmm1, xmm0, xmm0, 4 vmovss dword ptr[rdx + 4*rbx], xmm1 movsxd rbx, dword ptr[r8 + 4*r9 + 28] vpalignr xmm2, xmm0, xmm0, 8 vmovss dword ptr[rdx + 4*rax], xmm2 vpalignr xmm3, xmm0, xmm0, 12 vmovss dword ptr[rdx + 4*rbx], xmm3 add r9, 8 cmp r9, r10 jl loop1 vzeroupper pop rbx ret scatter_avx ENDP end
Task/Pythagorean-triples/Ada/pythagorean-triples.ada
LaudateCorpus1/RosettaCodeData
1
1524
with Ada.Text_IO; procedure Pythagorean_Triples is type Large_Natural is range 0 .. 2**63-1; -- this is the maximum for gnat procedure New_Triangle(A, B, C: Large_Natural; Max_Perimeter: Large_Natural; Total_Cnt, Primitive_Cnt: in out Large_Natural) is Perimeter: constant Large_Natural := A + B + C; begin if Perimeter <= Max_Perimeter then Primitive_Cnt := Primitive_Cnt + 1; Total_Cnt := Total_Cnt + Max_Perimeter / Perimeter; New_Triangle(A-2*B+2*C, 2*A-B+2*C, 2*A-2*B+3*C, Max_Perimeter, Total_Cnt, Primitive_Cnt); New_Triangle(A+2*B+2*C, 2*A+B+2*C, 2*A+2*B+3*C, Max_Perimeter, Total_Cnt, Primitive_Cnt); New_Triangle(2*B+2*C-A, B+2*C-2*A, 2*B+3*C-2*A, Max_Perimeter, Total_Cnt, Primitive_Cnt); end if; end New_Triangle; T_Cnt, P_Cnt: Large_Natural; begin for I in 1 .. 9 loop T_Cnt := 0; P_Cnt := 0; New_Triangle(3,4,5, 10**I, Total_Cnt => T_Cnt, Primitive_Cnt => P_Cnt); Ada.Text_IO.Put_Line("Up to 10 **" & Integer'Image(I) & " :" & Large_Natural'Image(T_Cnt) & " Triples," & Large_Natural'Image(P_Cnt) & " Primitives"); end loop; end Pythagorean_Triples;
libsrc/_DEVELOPMENT/fcntl/z80/drivers/terminal/tty/asm_tty_output_char.asm
meesokim/z88dk
0
103999
<reponame>meesokim/z88dk<gh_stars>0 SECTION code_fcntl PUBLIC asm_tty_output_char asm_tty_output_char: ; c = action code ; stack = & tty.action pop hl scf ret
elan520-software_timer_registers.ads
Jellix/elan520
0
19291
------------------------------------------------------------------------ -- Copyright (C) 2005-2020 by <<EMAIL>> -- -- -- -- This work is free. You can redistribute it and/or modify it under -- -- the terms of the Do What The Fuck You Want To Public License, -- -- Version 2, as published by Sam Hocevar. See the LICENSE file for -- -- more details. -- ------------------------------------------------------------------------ pragma License (Unrestricted); ------------------------------------------------------------------------ -- AMD Élan(tm) SC 520 embedded microprocessor -- -- MMCR -> Software Timer Registers -- -- -- -- reference: User's Manual Chapter 18, -- -- Register Set Manual Chapter 15 -- ------------------------------------------------------------------------ package Elan520.Software_Timer_Registers is USEC_IN_MSEC : constant := 1_000; -- used in counter register stuff subtype Milliseconds is Integer range 0 .. 2**16 - 1; subtype Microseconds is Integer range 0 .. USEC_IN_MSEC - 1; -- maximum value which can be read (65535ms + 999us) subtype Full_Microseconds is Integer range 0 .. USEC_IN_MSEC * Milliseconds'Last + Microseconds'Last; -- used in configuration register (timer calibration) type Base_Frequency is (MHz_33_333, MHz_33_000); for Base_Frequency use (MHz_33_333 => 2#0#, MHz_33_000 => 2#1#); --------------------------------------------------------------------- -- Software Timer Millisecond Count (SWTMRMILLI) -- -- Memory Mapped, Read Only -- -- MMCR Offset C60h -- -- -- -- Software Timer Microsecond Count (SWTMRMICRO) -- -- Memory Mapped, Read Only -- -- MMCR Offset C62h -- --------------------------------------------------------------------- -- because it would be quite stupid to declare both registers -- independent from each other (which would force us to read each -- single register individually which does not make sense unless we -- care about the timing of _internal_ processor bus cycles), let us -- declare the type as if this would be one single (32-bit-)register -- only -- this easily makes sure that with each reading a correct result is -- delivered (see note on side effect next) -- SIDEEFFECT: the milliseconds counter Ms_Cnt is reset to zero on -- reads MMCR_OFFSET_TIMER : constant := 16#C60#; TIMER_SIZE : constant := 32; type Timer is record -- milliseconds counter (read first) Ms_Cnt : Milliseconds; -- microseconds counter (latched when Ms_Cnt is read) Us_Cnt : Microseconds; end record; for Timer use record Ms_Cnt at 0 range 0 .. 15; -- at MMCR + 16#C60# Us_Cnt at 0 range 16 .. 25; -- at MMCR + 16#C62# -- bits 26 .. 31 are reserved end record; for Timer'Size use TIMER_SIZE; --------------------------------------------------------------------- -- Software Timer Configuration (SWTMRCFG) -- -- Memory Mapped, Read/Write -- -- MMCR Offset C64h -- --------------------------------------------------------------------- MMCR_OFFSET_CONFIGURATION : constant := 16#C64#; CONFIGURATION_SIZE : constant := 8; type Configuration is record Xtal_Freq : Base_Frequency; end record; for Configuration use record Xtal_Freq at 0 range 0 .. 0; -- bits 1 .. 7 are reserved end record; for Configuration'Size use CONFIGURATION_SIZE; function To_Microseconds (Timer_Read : in Timer) return Full_Microseconds; pragma Pure_Function (To_Microseconds); end Elan520.Software_Timer_Registers;
src/GenConfig.g4
cmingjian/GenComplete
0
7519
grammar GenConfig; file:commendDec optionsDec arrays; commendDec:'command' ID ';'; optionsDec:'options' '{' (optionList';')+ '}' ';'; optionList : String arrayName #optionStringAndArray | String #optionSingle | arrayName #optionArray ; arrayName: Arrayname| ArraynameFile| ArraynameFileOnly| ArraynameDir| ArraynameFileSuff; arrays:arrayDec*; arrayDec:'array' Arrayname '{' String(','String)*'}' ';'; ArraynameFile:'$file'; ArraynameFileOnly:'$file_only'; ArraynameDir:'$dir'; ArraynameFileSuff:'$file' '.' [a-zA-Z0-9]+; Arrayname:'$'[a-zA-Z0-9]+; ID : [_a-zA-Z][_a-zA-Z0-9]* ; String: '"'(~[ \t\n])*?'"'; // 命令行参数中,单个参数中不允许有空格 Space: (' ' | '\t' |'\r'?'\n') -> skip; LineComment : '//' .*? '\r'? '\n' -> skip ; Comment : '/*' .*? '*/' -> skip ;
ga_lib/src/gl_util.adb
rogermc2/GA_Ada
3
4034
<gh_stars>1-10 with Interfaces; with Ada.Text_IO; use Ada.Text_IO; with GL; with GL.Window; with Utilities; with Blade; with Blade_Types; with E3GA; with E3GA_Utilities; package body GL_Util is -- ------------------------------------------------------------------ -- function From_GL (V3 : GL.Types.Singles.Vector3) return E3GA.Vector is -- begin -- return (Float (V3 (GL.X)), Float (V3 (GL.X)), Float (V3 (GL.Y))); -- end From_GL; -- ------------------------------------------------------------------------- -- function From_GL (V3 : GL.Types.Singles.Vector3) return C3GA.Vector_E3 is -- begin -- return C3GA.Set_Coords (Float (V3 (GL.X)), Float (V3 (GL.X)), -- Float (V3 (GL.Y))); -- end From_GL; -- ------------------------------------------------------------------------- -- procedure GL_Color_3fm (R, G, B : GL.Types.Single) is -- A : constant GL.Types.Single := 0.3; -- D : constant GL.Types.Single := 0.7; -- Ambient : constant array (1 .. 4) of GL.Types.Single -- := (A * R, A * G, A * B, 1.0); -- Dif : constant array (1 .. 4) of GL.Types.Single -- := (D * R, D * G, D * B, 1.0); -- begin -- null; -- end GL_Color_3fm; -- ------------------------------------------------------------------ -- Load_Pick_Matrix procedure Load_Pick_Matrix is begin null; end Load_Pick_Matrix; -- ------------------------------------------------------------------ procedure Print_GL_Int3_Array (Name : String; anArray : GL.Types.Ints.Vector3_Array) is begin Put_Line (Name & ": "); for Index in anArray'First .. anArray'Last loop Utilities.Print_Vector ("", anArray (Index)); end loop; New_Line; end Print_GL_Int3_Array; -- ------------------------------------------------------------------------ -- Rotor_GL_Multiply multiplies GL_Matrix by rotor 'R' procedure Rotor_GL_Multiply (R : Multivectors.Rotor; GL_Matrix : in out GL.Types.Singles.Matrix4) is use E3GA; use Multivectors; use GL; use GL.Types.Singles; IR : constant Rotor := To_Rotor (General_Inverse (R)); E_Rot : Multivectors.Multivector; E1_IR : Multivectors.Multivector; Image : Vector3_Array (1 .. 4); VC : Vector3; Matrix : Matrix4 := Identity4; Image_Row : Int := 0; begin E1_IR := Geometric_Product (e1, IR); if not Is_Null (E1_IR ) then -- compute the images of all OpenGL basis vectors E_Rot := Geometric_Product (R, E1_IR); Image (1) := To_GL (E_Rot); E_Rot := Geometric_Product (R, Geometric_Product (e2, IR)); Image (2) := To_GL (E_Rot); E_Rot := Geometric_Product (R, Geometric_Product (e3, IR)); Image (3) := To_GL (E_Rot); Image (4) := (0.0, 0.0, 0.0); -- Image of origin -- Transfer the coordinates to the OpenGL matrix for row in GL.Index_Homogeneous loop Image_Row := Image_Row + 1; VC := Image (Image_Row); Matrix (row, X) := VC (X); Matrix (row, Y) := VC (Y); Matrix (row, Z) := VC (Z); end loop; GL_Matrix := Matrix * GL_Matrix; end if; exception when others => Put_Line ("An exception occurred in GL_Util.Rotor_GL_Multiply."); raise; end Rotor_GL_Multiply; -- ------------------------------------------------------------------------- -- Pick_Matrix defines a picking region procedure Pick_Matrix (Centre_X, Centre_Y : GL.Types.Size; Width, Height : GL.Types.Size) is begin GL.Window.Set_Viewport (Centre_X, Centre_Y, Width, Height); end Pick_Matrix; -- ------------------------------------------------------------------ function Rotor_To_GL_Matrix (R : Multivectors.Rotor) return GL.Types.Singles.Matrix4 is use GL; M3 : GA_Maths.GA_Matrix3; GL_Matrix : GL.Types.Singles.Matrix4 := GL.Types.Singles.Identity4; Mrow : integer := 0; Mcol : integer := 0; begin E3GA_Utilities.Rotor_To_Matrix (R, M3); for row in Index_Homogeneous range X .. Z loop Mrow := Mrow + 1; for col in Index_Homogeneous range X .. Z loop Mcol := Mcol + 1; GL_Matrix (col, row) := GL.Types.Single (M3 (Mrow, Mcol)); end loop; Mcol := 0; end loop; return GL_Matrix; exception when others => Put_Line ("An exception occurred in GL_Util.Rotor_To_GL_Matrix."); raise; end Rotor_To_GL_Matrix; -- ------------------------------------------------------------------------- function To_GL (V3 : Multivectors.Multivector) return GL.Types.Doubles.Vector3 is use Interfaces; use Blade.Blade_List_Package; use Blade; use Blade_Types; Blades : constant Blade.Blade_List := Multivectors.Get_Blade_List (V3); Curs : Cursor := Blades.First; BM : Unsigned_32; Value : Double; Val_X : Double := 0.0; Val_Y : Double := 0.0; Val_Z : Double := 0.0; begin while Has_Element (Curs) loop BM := Bitmap (Element (Curs)); Value := Double (Blade.Weight (Element (Curs))); if (BM and E3_Base'Enum_Rep (E3_e1)) /= 0 then Val_X := Val_X + Value; end if; if (BM and E3_Base'Enum_Rep (E3_e2)) /= 0 then Val_Y := Val_Y + Value; end if; if (BM and E3_Base'Enum_Rep (E3_e3)) /= 0 then Val_Z := Val_Z + Value; end if; Next (Curs); end loop; return (Val_X, Val_Y, Val_Z); exception when others => Put_Line ("An exception occurred in GL_Util.To_GL Double."); raise; end To_GL; -- ------------------------------------------------------------------------- function To_GL (V3 : Multivectors.Multivector) return GL.Types.Singles.Vector3 is use Interfaces; use Blade.Blade_List_Package; use Blade; use Blade_Types; Blades : constant Blade.Blade_List := Multivectors.Get_Blade_List (V3); Curs : Cursor := Blades.First; BM : Unsigned_32; Value : Single; Val_X : Single := 0.0; Val_Y : Single := 0.0; Val_Z : Single := 0.0; begin while Has_Element (Curs) loop BM := Bitmap (Element (Curs)); Value := Single (Blade.Weight (Element (Curs))); if (BM and E3_Base'Enum_Rep (E3_e1)) /= 0 then Val_X := Val_X + Value; end if; if (BM and E3_Base'Enum_Rep (E3_e2)) /= 0 then Val_Y := Val_Y + Value; end if; if (BM and E3_Base'Enum_Rep (E3_e3)) /= 0 then Val_Z := Val_Z + Value; end if; Next (Curs); end loop; return (Val_X, Val_Y, Val_Z); exception when others => Put_Line ("An exception occurred in GL_Util.To_GL Single."); raise; end To_GL; -- ------------------------------------------------------------------------- -- function To_GL (V3 : C3GA.Vector_E3) return GL.Types.Singles.Vector3 is -- C3_Coords : constant GA_Maths.Array_3D := C3GA.Get_Coords (V3); -- begin -- -- return (Single (C3_Coords (1)), Single (C3_Coords (2)), -- Single (C3_Coords (3))); -- end To_GL; -- ------------------------------------------------------------------------- -- function To_GL (V3 : E3GA.Vector) return GL.Types.Singles.Vector3 is -- begin -- return (Single (V3 (1)), Single (V3 (2)), Single (V3 (3))); -- end To_GL; -- ------------------------------------------------------------------------- function To_GL (V3 : GA_Maths.Float_3D) return GL.Types.Singles.Vector3 is begin return (Single (V3 (1)), Single (V3 (2)), Single (V3 (3))); end To_GL; -- --------------------------------------------------------------------- procedure Viewport_Coordinates (Pt_World : GA_Maths.Float_3D; Model_View_Matrix, Projection_Matrix : GL.Types.Singles.Matrix4; Coords : out GL.Types.Singles.Vector2) is use GL; use GL.Types.Singles; VP_X : Int; VP_Y : Int; Window_Width : Size; Window_Height : Size; PT1 : constant Vector4 := (Single (Pt_World (1)), Single (Pt_World (2)), Single (Pt_World (3)), 1.0); PT2 : constant Vector4 := Projection_Matrix * Model_View_Matrix * PT1; begin -- PT1 := Projection_Matrix * PT2; GL.Window.Get_Viewport (VP_X, VP_Y, Window_Width, Window_Height); Coords (X) := Single (VP_X) + (1.0 + PT2 (X) / PT2 (W)) * Single (Window_Width) / 2.0; Coords (Y) := Single (VP_Y) + (1.0 + PT2 (Y) / PT2 (W)) * Single (Window_Height) / 2.0; exception when others => Put_Line ("An exception occurred in GL_Util.Viewport_Coordinates."); raise; end Viewport_Coordinates; -- ------------------------------------------------------------------------- end GL_Util;
university/language-concepts-labs/9/ada/bubble.ads
honno/code-solutions
0
9697
-- specification of the package - -- read this to get an overview of the package; -- see bubble.adb for the implementation package Bubble is -- state shared by all tasks (ie threads) protected State is -- a setter for a, b, c, d procedure Set_All(a, b, c, d : Integer); -- get a, b, c, d but only when a <= b <= c <= d -- block when they are not sorted entry Wait_Until_Sorted(a, b, c, d : out Integer); -- entries for detecting when neighbouring numbers -- are not in order and swapping them: entry BubbleAB; entry BubbleBC; entry BubbleCD; private procedure Print_State; a, b, c, d : Integer := 0; end State; -- tasks for swapping neighbours in State: task BubbleAB; task BubbleBC; task BubbleCD; end Bubble;
_maps/Eggman2.asm
vladjester2020/Sonic1TMR
0
172167
; --------------------------------------------------------------------------- ; Sprite mappings - Eggman (FZ) ; --------------------------------------------------------------------------- dc.w byte_1A3DE-Map_Eggman2 dc.w byte_1A3FD-Map_Eggman2 byte_1A3DE: dc.b 6 dc.b $E4, 8, 0, $20, $F4 dc.b $EC, $D, 0, $23, $E4 dc.b $EC, 9, 0, $2B, 4 dc.b $FC, 5, $20, $3A, $E4 dc.b $FC, $E, $20, $3E, 4 dc.b $14, 4, $20, $4A, 4 byte_1A3FD: dc.b 6 dc.b $E4, $A, 0, $31, $F4 dc.b $EC, 5, 0, $23, $E4 dc.b $EC, 9, 0, $2B, 4 dc.b $FC, 5, $20, $3A, $E4 dc.b $FC, $E, $20, $3E, 4 dc.b $14, 4, $20, $4A, 4 even
src/test/ref/procedure-callingconvention-stack-13.asm
jbrandwood/kickc
2
247847
// Test a procedure with calling convention stack // Recursion that works (no local variables) // Commodore 64 PRG executable file .file [name="procedure-callingconvention-stack-13.prg", type="prg", segments="Program"] .segmentdef Program [segments="Basic, Code, Data"] .segmentdef Basic [start=$0801] .segmentdef Code [start=$80d] .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(main) .const STACK_BASE = $103 .label SCREEN = $400 .segment Code // __register(A) char pow2(__register(A) char n) pow2: { .const OFFSET_STACK_N = 0 .const OFFSET_STACK_RETURN_0 = 0 tsx lda STACK_BASE+OFFSET_STACK_N,x // if (n == 0) cmp #0 beq __b1 // n-1 sec sbc #1 // char c = pow2(n-1) pha jsr pow2 pla // return c+c; asl jmp __breturn __b1: lda #1 __breturn: // } tsx sta STACK_BASE+OFFSET_STACK_RETURN_0,x rts } main: { // pow2(6) lda #6 pha jsr pow2 pla // *SCREEN = pow2(6) sta SCREEN // } rts }
libsrc/_DEVELOPMENT/fcntl/c/sccz80/vopen.asm
jpoikela/z88dk
640
173528
<gh_stars>100-1000 ; int vopen(const char *path, int oflag, void *arg) SECTION code_clib SECTION code_fcntl PUBLIC vopen EXTERN asm_vopen vopen: pop af pop hl pop bc pop de push de push bc push hl push af jp asm_vopen
data/mart_inventories.asm
etdv-thevoid/pokemon-rgb-enhanced
1
24871
<filename>data/mart_inventories.asm<gh_stars>1-10 ; mart inventories are below ; they are texts ; Viridian ViridianCashierText:: TX_MART POKE_BALL, ANTIDOTE, PARLYZ_HEAL, BURN_HEAL ; Pewter PewterCashierText:: TX_MART POKE_BALL, POTION, ESCAPE_ROPE, ANTIDOTE, AWAKENING, PARLYZ_HEAL, BURN_HEAL ; Cerulean CeruleanCashierText:: TX_MART POKE_BALL, POTION, REPEL, ANTIDOTE, AWAKENING, PARLYZ_HEAL, BURN_HEAL ; Bike shop TX_MART BICYCLE ; Vermilion VermilionCashierText:: TX_MART GREAT_BALL, SUPER_POTION, REPEL, ESCAPE_ROPE, ANTIDOTE, AWAKENING ; Lavender LavenderCashierText:: TX_MART GREAT_BALL, SUPER_POTION, REVIVE, SUPER_REPEL, ESCAPE_ROPE, ANTIDOTE, PARLYZ_HEAL, BURN_HEAL, ICE_HEAL ; Celadon Dept. Store 2F (1) CeladonMart2Clerk1Text:: TX_MART GREAT_BALL, SUPER_POTION, REVIVE, SUPER_REPEL, FULL_HEAL, ETHER ; Celadon Dept. Store 2F (2) CeladonMart2Clerk2Text:: TX_MART TM_32, TM_44, TM_45, TM_02, TM_09, TM_17, TM_26, TM_48, TM_22 ; Celadon Dept. Store 4F CeladonMart4ClerkText:: TX_MART POKE_DOLL, WATER_STONE, THUNDER_STONE, FIRE_STONE, LEAF_STONE ; Celadon Dept. Store 5F (1) CeladonMart5Clerk1Text:: TX_MART X_ATTACK, X_DEFEND, X_SPEED, X_SPECIAL, X_ACCURACY, GUARD_SPEC, DIRE_HIT ; Celadon Dept. Store 5F (2) CeladonMart5Clerk2Text:: TX_MART HP_UP, PROTEIN, IRON, CARBOS, CALCIUM, PP_UP ; Fuchsia FuchsiaCashierText:: TX_MART ULTRA_BALL, HYPER_POTION, REVIVE, SUPER_REPEL, ESCAPE_ROPE, FULL_HEAL ; unused ??? TX_MART POKE_BALL, POTION ; Cinnabar CinnabarCashierText:: TX_MART ULTRA_BALL, MAX_POTION, HYPER_POTION, REVIVE, MAX_REPEL, ESCAPE_ROPE, FULL_HEAL ; Saffron SaffronCashierText:: TX_MART GREAT_BALL, HYPER_POTION, SUPER_POTION, REVIVE, SUPER_REPEL, FULL_HEAL ; Indigo IndigoCashierText:: TX_MART ULTRA_BALL, FULL_RESTORE, MAX_POTION, FULL_HEAL, MAX_REVIVE, REVIVE, MAX_REPEL
oeis/091/A091913.asm
neoneye/loda-programs
11
177045
<gh_stars>10-100 ; A091913: Triangle read by rows: a(n,k) = C(n,k)*(2^(n-k) - 1) for k<n, a(n,k) = 0 for k>=n, where k=0...max(n-1,0). ; Submitted by <NAME> ; 0,1,3,2,7,9,3,15,28,18,4,31,75,70,30,5,63,186,225,140,45,6,127,441,651,525,245,63,7,255,1016,1764,1736,1050,392,84,8,511,2295,4572,5292,3906,1890,588,108,9,1023,5110,11475,15240,13230,7812,3150,840,135,10,2047 sub $0,1 lpb $0 add $1,1 sub $0,$1 lpe add $1,1 sub $2,$0 add $2,$1 bin $1,$0 mov $0,2 pow $0,$2 sub $0,1 mul $1,$0 mov $0,$1
src/tm.adb
STR-UPM/ToyOBDH
1
6185
<filename>src/tm.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. -- -- -- ------------------------------------------------------------------------------ -- The implementation of the TM package uses sockets to send telemetry -- messages to the ground station. The IP address and port to which the -- messages are sent are defined in the IP package. Edit and recompile -- as necessary to adapt to the real GS address. with IP; with Measurements; use Measurements; with Ada.Streams; use Ada.Streams; with GNAT.Sockets; use GNAT.Sockets; with Ada.Unchecked_Conversion; with System; pragma Warnings(Off); with System.IO; -- for debugging pragma Warnings(On); package body TM is ---------------------------------- -- Transmitter protected object -- ---------------------------------- protected Transmitter with Priority => System.Priority'Last -- replace with ceiling priority when available is procedure Send (Message : TM_Message); end Transmitter; -- The send operation is encapsulated in a protected object because -- it can be called by the Basic_TM and Log_TM tasks. ---------- -- Send -- ---------- procedure Send (Message : TM_Message) is begin Transmitter.Send(Message); end Send; -------------------------- -- Internal procedures -- -------------------------- procedure Send_Socket (Message : TM_Message); -- Send a message trough an IP socket ---------------------- -- Transmitter body -- ---------------------- protected body Transmitter is procedure Send (Message : TM_Message) is begin Send_Socket (Message); end Send; end Transmitter; ----------------- -- Send_Socket -- ----------------- procedure Send_Socket (Message : TM_Message) is Socket : Socket_Type; GS_Address : Sock_Addr_Type; subtype TM_Stream is Ada.Streams.Stream_Element_Array (1..TM_Message'Size/8); function To_Stream is new Ada.Unchecked_Conversion (TM_Message, TM_Stream); Stream : TM_Stream := To_Stream(Message); Last : Ada.Streams.Stream_Element_Offset; begin -- Create UDP socket Create_Socket (Socket, Family_Inet, Socket_Datagram); -- Destination address for TM GS_Address := (Family => Family_Inet, Addr => IP.GS_IP, Port => IP.GS_Port ); -- Send message Send_Socket(Socket, Stream, Last, GS_Address); Close_Socket(Socket); -- Log message case Message.Kind is when Basic => pragma Debug (System.IO.Put_Line("TM " & Message.Data.Value'Img)); when Housekeeping => pragma Debug (System.IO.Put_Line("HK ---------")); for i in 1..Message.Length loop pragma Debug (System.IO.Put_Line(" " & Message.Data_Log(i).Value'Img)); end loop; pragma Debug (System.IO.Put_Line("-------------")); end case; end Send_Socket; end TM;
dsl-antlr/src/main/antlr4/io/fixprotocol/orchestra/dsl/antlr/Score.g4
dendisuhubdy/fix-orchestra
0
3085
<gh_stars>0 /** * DSL grammar for FIX Orchestra */ grammar Score; EQUAL : ('=='|'eq') ; NOT_EQUAL : ('!='|'ne') ; LT : ('<'|'lt') ; LE : ('<='|'le') ; GE : ('>='|'ge') ; GT : ('>'|'gt') ; ADD : '+' ; HYPHEN : '-' ; MUL : '*' ; DIV : '/' ; MOD : ('%'|'mod') ; LPAREN : '(' ; RPAREN : ')' ; NOT : '!' ; OR : ('or' | '||') ; AND : ('and' | '&&') ; IN : 'in' ; LBRACE : '{' ; RBRACE : '}' ; LBRACK : '[' ; RBRACK : ']' ; VAR : '$' ; USCORE : '_'; COLON: ':'; DOT: '.'; HASH: '#'; CODE: '^'; EXISTS: 'exists'; anyExpression: assignment | expr ; assignment: var '=' expr ; expr: '-' expr # unaryMinus | '!' expr # logicalNot | expr op=('*'|'/'|'%'|'mod') expr # mulDiv | expr op=('+'|'-') expr # addSub | val=expr 'in' '{' member+=expr (',' member+=expr)* '}' # contains | val=expr 'between' min=expr 'and' max=expr # range | expr op=('<'|'<='|'>'|'>='|'lt'|'le'|'gt'|'ge') expr # relational | expr op=('=='|'!='|'eq'|'ne') expr # equality | expr op=('and'|'&&') expr # logicalAnd | expr op=('or'|'||') expr # logicalOr | '(' expr ')' # parens | '#' DATETIME '#' # timestamp | '#' TIME '#' # timeonly | '#' DATE '#' # dateonly | '#' PERIOD '#' # duration | UINT # integer | DECIMAL # decimal | CHAR # character | STRING # string | 'exists' var # exist | var # variable // lowest priority so variables do not shadow keywords ; index: '[' UINT ']' ; pred: '[' ID '==' expr ']' ; qual: ID (index | pred)? ; /** * $=variable, %=code symbolic name, in=incoming message, out=outgoing message, this=local scope */ var: scope=('$'|'^'|'in.'|'out.'|'this.')? qual ('.' qual )*; DATETIME: DATE TIME ; DATE: DIGIT DIGIT DIGIT DIGIT '-' DIGIT DIGIT '-' DIGIT DIGIT ; TIME: 'T' DIGIT DIGIT ':' DIGIT DIGIT (':' DIGIT DIGIT)? ('.' DIGIT+)? TZD ; fragment TZD: ('Z' | SIGN DIGIT DIGIT? ':' DIGIT DIGIT ); PERIOD: 'P' (DIGIT+ 'Y')? (DIGIT+ 'M')? (DIGIT+ 'W')? (DIGIT+ 'D')? ('T' (DIGIT+ 'H')? (DIGIT+ 'M' )? (DIGIT+ 'S')?)? ; DECIMAL: DIGIT+ '.' DIGIT+ ; UINT: DIGIT+; STRING: '"' STRINGCHAR+ '"' ; CHAR: '\'' STRINGCHAR '\'' ; ID: LETTER (LETTER | DIGIT | '_')* ; fragment STRINGCHAR: ~["\\] | ESC ; fragment ESC: '\\' [btnfr"'\\] ; fragment LETTER: [a-zA-Z] ; fragment NONZERO: [1-9] ; fragment DIGIT: [0-9] ; fragment SIGN: [+-] ; WS: [ \t\n\r]+ -> skip ; COMMENT: '/*' .*? '*/' -> skip ; LINE_COMMENT: '//' ~[\r\n]* -> skip ;
Task/Subtractive-generator/Ada/subtractive-generator-1.ada
LaudateCorpus1/RosettaCodeData
1
28289
<reponame>LaudateCorpus1/RosettaCodeData package Subtractive_Generator is type State is private; procedure Initialize (Generator : in out State; Seed : Natural); procedure Next (Generator : in out State; N : out Natural); private type Number_Array is array (Natural range <>) of Natural; type State is record R : Number_Array (0 .. 54); Last : Natural; end record; end Subtractive_Generator;
Transynther/x86/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_21829_667.asm
ljhsiun2/medusa
9
89733
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r14 push %r15 push %r8 push %rbp push %rcx push %rdi push %rsi lea addresses_D_ht+0xd75a, %r14 nop nop nop nop nop and %r8, %r8 mov $0x6162636465666768, %r12 movq %r12, %xmm0 movups %xmm0, (%r14) nop nop nop nop nop dec %r8 lea addresses_A_ht+0xd432, %rsi lea addresses_UC_ht+0x465a, %rdi cmp $61052, %rbp mov $52, %rcx rep movsq nop nop nop nop add %r14, %r14 lea addresses_UC_ht+0x568a, %r14 inc %rsi movb $0x61, (%r14) nop sub %rbp, %rbp lea addresses_normal_ht+0x50da, %rsi lea addresses_normal_ht+0x732a, %rdi clflush (%rsi) nop nop sub $5500, %r15 mov $49, %rcx rep movsl nop nop nop nop cmp %r8, %r8 pop %rsi pop %rdi pop %rcx pop %rbp pop %r8 pop %r15 pop %r14 pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r15 push %r9 push %rbp push %rdi push %rsi // Store lea addresses_D+0x176ea, %r15 nop nop xor %rbp, %rbp mov $0x5152535455565758, %rsi movq %rsi, %xmm7 movups %xmm7, (%r15) xor %rbp, %rbp // Store lea addresses_A+0x666a, %rdi clflush (%rdi) nop xor $29301, %rsi mov $0x5152535455565758, %r13 movq %r13, (%rdi) nop nop nop nop nop xor %r13, %r13 // Load lea addresses_WT+0x305a, %r13 nop nop nop nop dec %rdi movb (%r13), %r9b // Exception!!! nop nop nop nop nop mov (0), %rsi nop nop cmp $31804, %r13 // Store lea addresses_A+0x62a, %rdi inc %r11 mov $0x5152535455565758, %rsi movq %rsi, %xmm1 vmovups %ymm1, (%rdi) nop cmp $12847, %r13 // Faulty Load lea addresses_US+0xc2ea, %rdi nop nop nop nop sub $31444, %r11 mov (%rdi), %r13w lea oracles, %rbp and $0xff, %r13 shlq $12, %r13 mov (%rbp,%r13,1), %r13 pop %rsi pop %rdi pop %rbp pop %r9 pop %r15 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_US', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_D', 'same': False, 'size': 16, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_A', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_US', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 16, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_UC_ht', 'same': True, 'size': 1, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': True}, 'OP': 'REPM'} {'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 */
Appl/Art/Decks/GeoDeck/CGASpadeK.asm
steakknife/pcgeos
504
29314
CGASpadeK label byte word C_BLACK Bitmap <67,41,0,BMF_MONO> db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x3c, 0x70, 0x02, 0x10, 0x84, 0x20, 0x00, 0x00, 0x00 db 0x18, 0xe0, 0x03, 0x29, 0x4a, 0x60, 0x01, 0x00, 0x00 db 0x1b, 0x9f, 0xff, 0xc6, 0x31, 0xff, 0xff, 0x00, 0x00 db 0x1e, 0x10, 0x40, 0xd5, 0x55, 0x80, 0x02, 0x80, 0x00 db 0x1b, 0x91, 0xf0, 0x7f, 0xff, 0x80, 0x02, 0x80, 0x00 db 0x18, 0xf3, 0xf8, 0x55, 0x01, 0x40, 0x04, 0x40, 0x00 db 0x3c, 0x77, 0xfc, 0xab, 0xef, 0x40, 0x04, 0x40, 0x00 db 0x00, 0x17, 0xfc, 0xaa, 0x11, 0x40, 0x04, 0x40, 0x00 db 0x00, 0x13, 0x58, 0xaa, 0x09, 0x40, 0x04, 0x40, 0x00 db 0x00, 0x10, 0xe0, 0xaa, 0x11, 0x60, 0x04, 0x40, 0x00 db 0x00, 0x10, 0x00, 0xaa, 0x82, 0xd0, 0x04, 0x40, 0x00 db 0x00, 0x10, 0x03, 0x2f, 0xab, 0xfc, 0x04, 0x40, 0x00 db 0x00, 0x10, 0x1c, 0xf4, 0xef, 0xaf, 0x64, 0x4c, 0x00 db 0x00, 0x11, 0xf7, 0x58, 0x1e, 0x5a, 0xbf, 0xf8, 0x00 db 0x00, 0x16, 0xfd, 0xac, 0x3c, 0xad, 0x6f, 0xe0, 0x00 db 0x00, 0x1d, 0x9e, 0xd6, 0x71, 0x7a, 0xb1, 0xf0, 0x00 db 0x00, 0x1b, 0x9b, 0x6b, 0xe2, 0xdf, 0x56, 0x10, 0x00 db 0x00, 0x7d, 0x99, 0xbf, 0xff, 0xb1, 0xf6, 0x10, 0x00 db 0x00, 0xfe, 0xc7, 0x6a, 0xea, 0xdc, 0x6f, 0xe0, 0x00 db 0x01, 0x0d, 0xf1, 0xbf, 0xff, 0xb3, 0x37, 0xc0, 0x00 db 0x01, 0x0d, 0x5f, 0x68, 0xfa, 0xdb, 0x3b, 0x00, 0x00 db 0x01, 0xf1, 0xab, 0xd1, 0xcd, 0x6f, 0x37, 0x00, 0x00 db 0x00, 0xfe, 0xd6, 0xa7, 0x86, 0xb7, 0xed, 0x00, 0x00 db 0x03, 0xff, 0xab, 0x4f, 0x03, 0x5d, 0xf1, 0x00, 0x00 db 0x06, 0x44, 0xde, 0xbe, 0xe5, 0xe7, 0x01, 0x00, 0x00 db 0x00, 0x44, 0x07, 0xfa, 0xbe, 0x98, 0x01, 0x00, 0x00 db 0x00, 0x44, 0x01, 0x68, 0x2a, 0xa0, 0x01, 0x00, 0x00 db 0x00, 0x44, 0x00, 0xd1, 0x0a, 0xa0, 0xe1, 0x00, 0x00 db 0x00, 0x44, 0x00, 0x52, 0x0a, 0xa3, 0x59, 0x00, 0x00 db 0x00, 0x44, 0x00, 0x51, 0x0a, 0xa7, 0xfd, 0x00, 0x00 db 0x00, 0x44, 0x00, 0x5e, 0xfa, 0xa7, 0xfd, 0xc7, 0x80 db 0x00, 0x44, 0x00, 0x50, 0x15, 0x43, 0xf9, 0xe3, 0x00 db 0x00, 0x28, 0x00, 0x3f, 0xff, 0xc1, 0xf1, 0x3b, 0x00 db 0x00, 0x28, 0x00, 0x35, 0x55, 0x60, 0x41, 0x0f, 0x00 db 0x00, 0x1f, 0xff, 0xf1, 0x8c, 0x7f, 0xff, 0x3b, 0x00 db 0x00, 0x10, 0x00, 0xca, 0x52, 0x98, 0x00, 0xe3, 0x00 db 0x00, 0x00, 0x00, 0x84, 0x21, 0x08, 0x01, 0xc7, 0x80 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
oeis/034/A034682.asm
neoneye/loda-programs
11
173233
<filename>oeis/034/A034682.asm<gh_stars>10-100 ; A034682: Sum of eighth powers of unitary divisors. ; Submitted by <NAME> ; 1,257,6562,65537,390626,1686434,5764802,16777217,43046722,100390882,214358882,430053794,815730722,1481554114,2563287812,4294967297,6975757442,11063007554,16983563042,25600456162,37828630724,55090232674,78310985282,110092097954,152587890626,209642795554,282429536482,377807828674,500246412962,658764967684,852891037442,1099511627777,1406622983684,1792769662594,2251881546052,2821153019714,3512479453922,4364775701794,5352824997764,6553617167842,7984925229122,9721958096068,11688200277602 add $0,1 pow $0,8 mov $1,1 mov $2,2 lpb $0 mov $3,$0 lpb $3 mov $4,$0 mod $4,$2 add $2,1 cmp $4,0 cmp $4,0 sub $3,$4 lpe mov $5,1 lpb $0 dif $0,$2 mul $5,$2 lpe add $5,1 mul $1,$5 lpe mov $0,$1
snapshot/Ada/server-properties.ada
daemonl/openapi-codegen
0
1746
swagger.dir=web swagger.web.enable=false swagger.ui.enable=true swagger.port=8080 swagger.apps=app swagger.users=users swagger.key=<KEY> app.list=1 app.1.client_id=test-app app.1.client_secret=test-app-secret app.1.scope=none users.list=1,2 users.1.username=admin users.1.password=<PASSWORD> users.2.username=test users.2.password=<PASSWORD> # Configuration for log4j log4j.rootCategory=DEBUG,console,result log4j.appender.console=Console log4j.appender.console.level=DEBUG log4j.appender.console.layout=level-message log4j.appender.result=File log4j.appender.result.File=swagger_petstore.log # Logger configuration log4j.logger.log=WARN log4j.logger.Util.Properties=DEBUG log4j.logger.Util.Log=WARN log4j.logger.Util=DEBUG log4j.logger.Servlet=DEBUG log4j.logger.Util.Serialize.Mappers=WARN log4j.logger.Util.Serialize.IO=INFO
oeis/030/A030834.asm
neoneye/loda-programs
11
242327
<reponame>neoneye/loda-programs<gh_stars>10-100 ; A030834: [ exp(9/22)*n! ]. ; Submitted by <NAME> ; 1,3,9,36,180,1083,7587,60699,546297,5462971,60092689,721112275,9374459578,131242434103,1968636511549,31498184184798,535469131141580,9638444360548444,183130442850420440,3662608857008408818 add $0,1 mov $2,1 lpb $0 mul $1,6 add $1,$0 mul $2,$0 sub $0,1 add $1,2 mul $1,3 div $1,44 add $1,$2 lpe mov $0,$1
programs/oeis/292/A292046.asm
neoneye/loda
22
80158
; A292046: The list of distinct values of A072464. ; 1,3,6,7,11,12,13,14,16,17,18,19,20,21,22,23,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113 mov $1,$0 lpb $1 seq $1,70939 ; Length of binary representation of n. add $0,$1 sub $1,1 lpe add $0,1
agda/Algebra/Construct/Free/Semilattice/Relation/Unary/Any/Def.agda
oisdk/combinatorics-paper
0
15888
{-# OPTIONS --cubical --safe #-} module Algebra.Construct.Free.Semilattice.Relation.Unary.Any.Def where open import Prelude hiding (⊥; ⊤) open import Algebra.Construct.Free.Semilattice.Eliminators open import Algebra.Construct.Free.Semilattice.Definition open import Cubical.Foundations.HLevels open import Data.Empty.UniversePolymorphic open import HITs.PropositionalTruncation.Sugar open import HITs.PropositionalTruncation.Properties open import HITs.PropositionalTruncation open import Data.Unit.UniversePolymorphic private variable p : Level dup-◇ : (P : A → Type p) → (x : A) (xs : Type p) → ∥ P x ⊎ ∥ P x ⊎ xs ∥ ∥ ⇔ ∥ P x ⊎ xs ∥ dup-◇ P x xs .inv p = ∣ inr p ∣ dup-◇ P x xs .fun ps = ps >>= either (∣_∣ ∘ inl) id dup-◇ P x xs .leftInv p = squash _ p dup-◇ P x xs .rightInv p = squash p _ swap-◇ : {x y xs : Type p} → ∥ x ⊎ ∥ y ⊎ xs ∥ ∥ → ∥ y ⊎ ∥ x ⊎ xs ∥ ∥ swap-◇ p = p >>= either′ (∣_∣ ∘ inr ∘ ∣_∣ ∘ inl) (mapʳ (∣_∣ ∘ inr) ∥$∥_) com-◇ : (P : A → Type p) → (x y : A) (xs : Type p) → ∥ P x ⊎ ∥ P y ⊎ xs ∥ ∥ ⇔ ∥ P y ⊎ ∥ P x ⊎ xs ∥ ∥ com-◇ P y z xs .fun = swap-◇ com-◇ P y z xs .inv = swap-◇ com-◇ P y z xs .leftInv p = squash _ p com-◇ P y z xs .rightInv p = squash _ p ◇′ : (P : A → Type p) → 𝒦 A → hProp p ◇′ P = 𝒦-rec isSetHProp (λ { x (xs , _) → ∥ P x ⊎ xs ∥ , squash }) (⊥ , λ ()) (λ x xs → ΣProp≡ (λ _ → isPropIsProp) (isoToPath (dup-◇ P x (xs .fst)))) (λ x y xs → ΣProp≡ (λ _ → isPropIsProp) (isoToPath (com-◇ P x y (xs .fst)))) {-# INLINE ◇′ #-} ◇ : (P : A → Type p) → 𝒦 A → Type p ◇ P xs = ◇′ P xs .fst isProp-◇ : ∀ {P : A → Type p} {xs} → isProp (◇ P xs) isProp-◇ {P = P} {xs = xs} = ◇′ P xs .snd
gcc-gcc-7_3_0-release/gcc/ada/s-flocon.ads
best08618/asylo
7
23874
<filename>gcc-gcc-7_3_0-release/gcc/ada/s-flocon.ads ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . F L O A T _ C O N T R O L -- -- -- -- S p e c -- -- -- -- Copyright (C) 2000-2011, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Control functions for floating-point unit package System.Float_Control is pragma Pure; -- This is not fully correct, but this unit is with-ed by pure units -- (eg s-imgrea). procedure Reset; pragma Inline (Reset); -- Reset the floating-point processor to the default state needed to get -- correct Ada semantics for the target. Some third party tools change -- the settings for the floating-point processor. Reset can be called -- to reset the floating-point processor into the mode required by GNAT -- for correct operation. Use this call after a call to foreign code if -- you suspect incorrect floating-point operation after the call. -- -- For example under Windows NT some system DLL calls change the default -- FPU arithmetic to 64 bit precision mode. However, since in Ada 95 it -- is required to provide full access to the floating-point types of the -- architecture, GNAT requires full 80-bit precision mode, and Reset makes -- sure this mode is established. -- -- Similarly on the PPC processor, it is important that overflow and -- underflow exceptions be disabled. -- -- The call to Reset simply has no effect if the target environment -- does not give rise to such concerns. end System.Float_Control;
OwO.applescript
BRAVO68WEB/OwO
0
4693
<filename>OwO.applescript display dialog "OwO" buttons "OwO"
test/interaction/ExtendedLambdaCase.agda
asr/agda-kanso
0
12016
<filename>test/interaction/ExtendedLambdaCase.agda module ExtendedLambdaCase where data Bool : Set where true false : Bool data Void : Set where foo : Bool -> Bool -> Bool -> Bool foo = λ { x → λ { y z → {!!} } } data Bar : (Bool -> Bool) -> Set where baz : (t : Void) -> Bar λ { x → {!!} } -- with hidden argument data Bar' : (Bool -> Bool) -> Set where baz' : {t : Void} -> Bar' λ { x' → {!!} }
alloy4fun_models/trashltl/models/10/c2QPdyu84PH4Ya7aX.als
Kaixi26/org.alloytools.alloy
0
1248
open main pred idc2QPdyu84PH4Ya7aX_prop11 { (File-Protected ) in Protected ' } pred __repair { idc2QPdyu84PH4Ya7aX_prop11 } check __repair { idc2QPdyu84PH4Ya7aX_prop11 <=> prop11o }
old/Sets/Quotient.agda
timjb/HoTT-Agda
294
8044
{-# OPTIONS --without-K #-} open import Base open import Homotopy.TruncatedHIT open import Spaces.Spheres open import Integers module Sets.Quotient {i j} (A : Set i) ⦃ p : is-set A ⦄ (R : A → A → Set j) ⦃ q : (x y : A) → is-prop (R x y) ⦄ where private data _#/_ : Set (max i j) where #proj : A → _#/_ #top : (f : hSⁿ ⟨0⟩ → _#/_) → _#/_ _/_ : Set (max i j) _/_ = _#/_ proj : A → _/_ proj = #proj postulate -- HIT eq : (x y : A) (p : R x y) → proj x ≡ proj y top : (f : hSⁿ ⟨0⟩ → _/_) → _/_ top = #top postulate -- HIT rays : (f : hSⁿ ⟨0⟩ → _/_) (x : hSⁿ ⟨0⟩) → top f ≡ f x #/-rec : ∀ {k} (P : _/_ → Set k) (proj* : (x : A) → P (proj x)) (eq* : (x y : A) (p : R x y) → transport P (eq x y p) (proj* x) ≡ proj* y) (top* : (f : hSⁿ ⟨0⟩ → _/_) (p : (x : hSⁿ ⟨0⟩) → P (f x)) → P (top f)) (rays* : (f : hSⁿ ⟨0⟩ → _/_) (p : (x : hSⁿ ⟨0⟩) → P (f x)) (x : hSⁿ ⟨0⟩) → transport P (rays f x) (top* f p) ≡ p x) → ((t : _/_) → P t) #/-rec P proj* eq* top* rays* (#proj x) = proj* x #/-rec P proj* eq* top* rays* (#top f) = top* f (λ x → #/-rec P proj* eq* top* rays* (f x)) #/-rec-nondep : ∀ {k} (B : Set k) (proj* : A → B) (eq* : (x y : A) (p : R x y) → proj* x ≡ proj* y) (top* : (f : hSⁿ ⟨0⟩ → _/_) (p : hSⁿ ⟨0⟩ → B) → B) (rays* : (f : hSⁿ ⟨0⟩ → _/_) (p : hSⁿ ⟨0⟩ → B) (x : hSⁿ ⟨0⟩) → top* f p ≡ p x) → (_/_ → B) #/-rec-nondep B proj* eq* top* rays* (#proj x) = proj* x #/-rec-nondep B proj* eq* top* rays* (#top f) = top* f (λ x → #/-rec-nondep B proj* eq* top* rays* (f x)) /-rec : ∀ {k} (P : _/_ → Set k) (proj* : (x : A) → P (proj x)) (eq* : (x y : A) (p : R x y) → transport P (eq x y p) (proj* x) ≡ proj* y) (trunc : (x : _/_) → is-set (P x)) → ((t : _/_) → P t) /-rec P proj* eq* trunc = #/-rec P proj* eq* (λ f p₁ → π₁ (u f p₁)) (λ f p₁ → π₂ (u f p₁)) where u : _ u = truncated-has-filling-dep _/_ P ⟨0⟩ (λ ()) (λ f → (top f , rays f)) /-rec-nondep : ∀ {k} (B : Set k) (proj* : A → B) (eq* : (x y : A) (p : R x y) → proj* x ≡ proj* y) (trunc : is-set B) → (_/_ → B) /-rec-nondep B proj* eq* trunc = #/-rec-nondep B proj* eq* (λ _ p → π₁ (u p)) (λ _ p → π₂ (u p)) where u : _ u = truncated-has-spheres-filled ⟨0⟩ _ trunc -- Reduction rules for paths are not needed
oeis/275/A275120.asm
neoneye/loda-programs
11
4183
; A275120: List the least common multiples of {1, 2, ..., k} for k = 0, 1, ...; this sequence gives the length of the n-th block of consecutive equal numbers. ; Submitted by <NAME>(s4) ; 2,1,1,1,2,1,1,2,2,3,1,2,4,2,2,2,2,1,5,4,2,4,2,4,6,2,3,3,4,2,6,2,2,6,8,4,2,4,2,4,8,4,2,1,3,6,2,10,2,6,6,4,2,4,6,2,10,2,4,2,12,12,4,2,4,6,2,2,8,5,1,6,6,2,6,4,2,6,4,14,4,2,4,14,6,6,4,2,4,6,2,6,6,6,4,6,8,4,8,10 mov $3,$0 mov $5,2 lpb $5 mov $0,$3 mov $2,0 sub $5,1 add $0,$5 add $0,1 lpb $0 sub $0,1 seq $2,15 ; Smallest prime power >= n. lpe mov $0,$2 mov $6,$5 mul $6,$2 add $4,$6 lpe min $3,1 mul $3,$0 mov $0,$4 sub $0,$3
libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sdcc_iy/esx_m_tapein_open.asm
jpoikela/z88dk
640
103719
<filename>libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sdcc_iy/esx_m_tapein_open.asm ; unsigned char esx_m_tapein_open(unsigned char *filename) SECTION code_esxdos PUBLIC _esx_m_tapein_open EXTERN _esx_m_tapein_open_fastcall _esx_m_tapein_open: pop af pop hl push hl push af jp _esx_m_tapein_open_fastcall
Transynther/x86/_processed/AVXALIGN/_st_/i7-8650U_0xd2_notsx.log_5_254.asm
ljhsiun2/medusa
9
28664
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r13 push %r8 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_WC_ht+0xd8ee, %rsi sub $40885, %r9 movups (%rsi), %xmm6 vpextrq $1, %xmm6, %r12 nop nop add %r8, %r8 lea addresses_UC_ht+0xad9a, %r13 nop nop and $41270, %r10 movw $0x6162, (%r13) nop sub $15521, %rsi lea addresses_UC_ht+0xbd3e, %r8 nop sub %r13, %r13 movb $0x61, (%r8) nop nop nop nop xor %r10, %r10 lea addresses_WT_ht+0x1893e, %r10 nop nop nop nop nop sub %rax, %rax movw $0x6162, (%r10) xor $31316, %r12 lea addresses_normal_ht+0x301e, %rsi lea addresses_WC_ht+0x573e, %rdi nop nop nop nop sub %r13, %r13 mov $66, %rcx rep movsq nop nop nop nop cmp $1800, %r9 lea addresses_A_ht+0x1033e, %r9 nop nop nop add $16308, %rcx movups (%r9), %xmm2 vpextrq $0, %xmm2, %r10 nop xor $5761, %r8 lea addresses_A_ht+0x1cbe, %r12 nop nop nop nop nop add %r13, %r13 mov $0x6162636465666768, %r9 movq %r9, %xmm3 vmovups %ymm3, (%r12) nop nop nop inc %rsi lea addresses_UC_ht+0x1897e, %r9 sub %rsi, %rsi movb $0x61, (%r9) nop nop nop inc %rcx lea addresses_WC_ht+0x1373e, %rsi nop nop nop nop nop inc %r12 mov (%rsi), %r8w nop nop nop xor $50895, %rax lea addresses_WC_ht+0x189e, %r10 sub %r12, %r12 movb (%r10), %r9b nop nop nop nop nop xor $48003, %rsi lea addresses_UC_ht+0xa53e, %rsi lea addresses_WT_ht+0x9a94, %rdi nop nop nop nop and %r13, %r13 mov $6, %rcx rep movsb nop nop nop xor $46158, %r8 lea addresses_WT_ht+0xb63e, %rax nop xor $16508, %r12 mov $0x6162636465666768, %rdi movq %rdi, (%rax) nop nop nop cmp %r12, %r12 lea addresses_WC_ht+0x7e, %r10 dec %rax mov (%r10), %rcx nop nop nop nop nop sub %rax, %rax pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r15 push %r8 push %r9 push %rbx push %rsi // Load lea addresses_WT+0x194e6, %r9 nop nop nop add %r13, %r13 movb (%r9), %r8b nop nop nop cmp $48232, %r9 // Store mov $0x4e844e000000056e, %rsi nop nop nop nop nop and %r11, %r11 movw $0x5152, (%rsi) nop nop sub $26135, %r8 // Store mov $0x5a898800000001a6, %r8 nop xor %rsi, %rsi movw $0x5152, (%r8) nop and %rsi, %rsi // Faulty Load lea addresses_D+0x4f3e, %r11 nop nop nop nop inc %r13 mov (%r11), %r15d lea oracles, %r13 and $0xff, %r15 shlq $12, %r15 mov (%r13,%r15,1), %r15 pop %rsi pop %rbx pop %r9 pop %r8 pop %r15 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 6, 'same': False}} {'36': 5} 36 36 36 36 36 */
oeis/068/A068983.asm
neoneye/loda-programs
11
177121
; A068983: a(n) = Sum_{k=0..n} (k^k-k!). ; Submitted by <NAME> ; 0,2,23,255,3260,49196,867699,17604595,404662204,10401033404,295672787215,9211294233871,312080173805324,11423999821072140,449316582527563515,18896039733447227131,846135945932355895308,40192537618855187742732,2018612071634068368034711 add $0,1 lpb $0 mov $2,$0 sub $0,1 seq $2,36679 ; a(n) = n^n - n!. add $1,$2 lpe mov $0,$1
src/asis/asis-compilation_units-relations.ads
My-Colaborations/dynamo
15
17747
------------------------------------------------------------------------------ -- -- -- ASIS-for-GNAT INTERFACE COMPONENTS -- -- -- -- A S I S . C O M P I L A T I O N _ U N I T S . R E L A T I O N S -- -- -- -- S p e c -- -- -- -- Copyright (c) 2006, Free Software Foundation, Inc. -- -- -- -- This specification is adapted from the Ada Semantic Interface -- -- Specification Standard (ISO/IEC 15291) for use with GNAT. In accordance -- -- with the copyright of that document, you can freely copy and modify this -- -- specification, provided that if you redistribute a modified version, any -- -- changes that you have made are clearly indicated. The copyright notice -- -- above, and the license provisions that follow apply solely to the -- -- contents of the part following the private keyword. -- -- -- -- ASIS-for-GNAT is free software; you can redistribute it and/or modify it -- -- under terms of the GNU General Public License as published by the Free -- -- Software Foundation; either version 2, or (at your option) any later -- -- version. ASIS-for-GNAT is distributed in the hope that it will be use- -- -- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- -- -- CHANTABILITY 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 ASIS-for-GNAT; see file -- -- COPYING. If not, write to the Free Software Foundation, 51 Franklin -- -- Street, Fifth Floor, Boston, MA 02110-1301, USA. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the -- -- Software Engineering Laboratory of the Swiss Federal Institute of -- -- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the -- -- Scientific Research Computer Center of Moscow State University (SRCC -- -- MSU), Russia, with funding partially provided by grants from the Swiss -- -- National Science Foundation and the Swiss Academy of Engineering -- -- Sciences. ASIS-for-GNAT is now maintained by AdaCore -- -- (http://www.adacore.com). -- -- -- ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 12 package Asis.Compilation_Units.Relations ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ package Asis.Compilation_Units.Relations is ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Asis.Compilation_Units.Relations encapsulates semantic relationship -- concepts used in ASIS. ------------------------------------------------------------------------------ -- 12.1 type Relationship ------------------------------------------------------------------------------ -- Relationship queries provide references to compilation units that are -- related, in some specific fashion, to one or more given compilation units. -- Compilation units located by these queries are returned as a set of -- ordered lists. type Relationship (Consistent_Length : Asis.ASIS_Natural; Inconsistent_Length : Asis.ASIS_Natural; Missing_Length : Asis.ASIS_Natural; Circular_Length : Asis.ASIS_Natural) is record Consistent : Asis.Compilation_Unit_List (1 .. Consistent_Length); Inconsistent : Asis.Compilation_Unit_List (1 .. Inconsistent_Length); Missing : Asis.Compilation_Unit_List (1 .. Missing_Length); Circular : Asis.Compilation_Unit_List (1 .. Circular_Length); end record; -- The following describes the semantics of the unit lists returned by the -- queries Semantic_Dependence_Order and Elaboration_Order: -- -- Each query returns a set of four lists. Every unit returned will have the -- same Enclosing_Context. The lists are: -- -- a) (Consistent) A list of consistent ordered units. -- b) (Inconsistent) A list of units that are inconsistent with one or -- more units on which they semantically depend. -- c) (Missing) A list of units that have missing (nonexistent) related -- units. -- d) (Circular) A list of circular semantic dependencies between units. -- -- -- a) The consistent units list: -- -- The semantics for the ordering of units in the first list are defined by -- the individual queries. -- -- Every unit in this list is unique. No duplicates are returned; no -- two units in the list are Is_Equal or Is_Identical. -- -- b) The inconsistent units list: -- -- The second list is made up of unit pairs. -- -- Each pairing defines an inconsistent semantic dependence relationship. -- The right unit of each pair semantically depends on the preceding left -- unit. All rightmost units of each pair are always inconsistent, and will -- not appear in the consistent units list. The leftmost unit can be either -- consistent or inconsistent. If a leftmost units is consistent, then it -- also appears in the consistent units list; otherwise the unit is part of -- an inconsistent transitive relationship. -- -- The unit pairs are ordered such that there are no forward semantic -- dependencies between the inconsistent units. Each inconsistent unit's -- supporters always precede it in the list. -- -- As an example, given four units, A withs B, B withs C, and C withs D; -- if D is replaced, the inconsistent list contains six units with the -- three pairs: -- -- DC CB BA -- -- The list indicates that units C, B, and A are inconsistent (the -- rightmost units of each pair). Semantic dependencies such as B depends -- on C also are indicated. The units C, B, and A are in an order that -- could be submitted to the compiler (a possible recompilation order). -- -- If a unit is inconsistent because the source for the unit has been -- edited (or otherwise been made inconsistent by some action of the user -- or implementation) then the unit references Nil_Compilation_Unit as the -- cause of the inconsistency (e.g., (Nil A Nil B) is a list of two -- inconsistent units, neither of which can point to a third unit as the -- cause for their being inconsistent). -- -- --|IP An implementation is allowed to use Nil_Compilation_Unit value for -- --|IP the first unit of each pair if it cannot determine the supporting -- --|IP unit causing the inconsistent semantic dependence. -- -- For the above example, the list returned is: -- -- DC DB DA CB CA BA -- -- This list reports all dependencies: -- -- D withed by C withed by B withed by A => DC DB DA -- C withed by B withed by A => CB CA -- B withed by A => BA -- -- c) The missing dependence list: -- -- The third list is made up of unit pairs. Each pairing consists of a -- unit followed by a missing related unit needed by the first unit. -- A missing unit is a required Compilation_Unit, with a known name, with a -- Unit_Kind that is either A_Nonexistent_Declaration or -- A_Nonexistent_Body. -- -- For example: -- -- Given a list containing the units: AB AC -- -- If Unit_Kind(B) = A_Nonexistent_Declaration and -- Unit_Kind(C) = A_Nonexistent_Body then -- -- It can be deduced that: -- A is missing a needed supporter B (A depends semantically on B). -- A is missing a needed related unit body C -- (depending on the kind for A, C can be A's required body or some -- subunit of A) -- -- A unit is reported as missing only if the Post-Compilation Rules of Ada -- determine it to be needed. Reference Manual 10.2. -- -- d) The circular dependence list: -- -- Circular dependencies between compilation units are provided in the -- fourth list. There may be more than one set of circular dependencies. -- The ordering of distinct sets in the list is implementation-defined. -- This list will never contain nonexistent units. -- -- The list is made up of unit pairs. The second unit of each pair depends -- semantically on the first unit. A circularity is established when the -- first unit of a pair also appears as the second unit of a later pair. -- (See the unit A in the example below; it is the first unit of the first -- pair and is the second unit of the third pair). The next set of circular -- dependent units, if any, starts with the next unit in the list (the unit -- D in the example below). -- -- For example: -- -- Given a list containing the units: AC CB BA DG GF FE ED -- -- It can be determined that there are two sets of circularly dependent -- units: -- {A, B, C} and {D, E, F, G} -- -- The dependencies are: A depends on B, B depends on C, C depends on A. -- D depends on E, E depends on F, F depends on G, G depends on D. -- -- Each circle of dependence is reported exactly once. It is not reported -- once for each unit in the circle. -- ------------------------------------------------------------------------------ -- 12.2 constant Nil_Relationship ------------------------------------------------------------------------------ Nil_Relationship : constant Relationship := (Consistent_Length => 0, Inconsistent_Length => 0, Missing_Length => 0, Circular_Length => 0, Consistent => Asis.Nil_Compilation_Unit_List, Inconsistent => Asis.Nil_Compilation_Unit_List, Missing => Asis.Nil_Compilation_Unit_List, Circular => Asis.Nil_Compilation_Unit_List); ------------------------------------------------------------------------------ -- 12.3 function Semantic_Dependence_Order ------------------------------------------------------------------------------ -- Semantic Dependence Relationships - Reference Manual 10.1.1(24). -- Elaboration Dependence Relationships - Reference Manual 10.1.1(25). -- -- --|AN Application Note: -- --|AN -- --|AN To properly determine unit consistency, use one of the two semantic -- --|AN dependence queries: Elaboration_Order or Semantic_Dependence_Order. -- --|AN These queries return a value of the type Relationship, which contains -- --|AN lists of consistent, inconsistent, missing and circular units. -- --|AN -- --|AN For these two queries, the existence of units in one or more of the -- --|AN inconsistent, missing, or circular units list means that the -- --|AN consistent unit list may not be complete. -- --|AN -- --|AN Applications that do not check for inconsistent, missing, or circular -- --|AN units before using the consistent list might not operate as expected. -- --|AN ------------------------------------------------------------------------------ function Semantic_Dependence_Order (Compilation_Units : Asis.Compilation_Unit_List; Dependent_Units : Asis.Compilation_Unit_List; The_Context : Asis.Context; Relation : Asis.Relation_Kinds) return Relationship; ------------------------------------------------------------------------------ -- Compilation_Units - Specifies a list of pertinent units -- Dependent_Units - Specifies dependents used to limit the query -- The_Context - Specifies a program Context for context -- Relation - Specifies the relationship to query -- -- Produces a Relationship value containing compilation_unit elements related -- to the given Compilation_Units by the specified relation. -- -- The compilation_unit elements in the consistent units list are ordered such -- that there are no forward semantic dependencies. -- -- Dependent_Units are ignored unless the Relation is Descendants or -- Dependents. The union of units in the needed units of the Dependent_Units -- list provide a limiting context for the query. Only members of these -- needed units are present in the result. -- -- If the Dependent_Units list is Is_Nil, the context for the search is the -- entire Context. The result of such a query is the full (unlimited) -- list of Dependents for the Compilation_Units. -- -- All units in the result will have an Enclosing_Context value that -- Is_Identical to The_Context. -- -- Appropriate Unit_Kinds: -- A_Procedure -- A_Function -- A_Package -- A_Generic_Procedure -- A_Generic_Function -- A_Generic_Package -- A_Procedure_Instance -- A_Function_Instance -- A_Package_Instance -- A_Procedure_Renaming -- A_Function_Renaming -- A_Package_Renaming -- A_Generic_Procedure_Renaming -- A_Generic_Function_Renaming -- A_Generic_Package_Renaming -- A_Procedure_Body -- A_Function_Body -- A_Package_Body -- A_Procedure_Body_Subunit -- A_Function_Body_Subunit -- A_Package_Body_Subunit -- A_Task_Body_Subunit -- A_Protected_Body_Subunit -- An_Unknown_Unit -- See Implementation Permissions -- -- The Semantic_Dependence_Order query should never raise an exception -- when processing inconsistent unit (sub)sets. This query is the only -- means for an application to know if a given unit is consistent with -- (some of) its supporters (dependents), and therefore the related -- semantic processing can give valuable results for this unit. -- -- --|IP Implementation Permissions: -- --|IP -- --|IP The handling of An_Unknown_Unit is implementation specific. It can be -- --|IP possible to obtain Semantic Dependence Relationships when starting -- --|IP with a list containing one or more units that are An_Unknown_Unit. -- --|IP However, results may vary across ASIS implementations. -- --|AN---------------------------------------------------------------------- -- --|AN Semantic_Dependence_Order defines consistent units to be ordered such -- --|AN that there are no forward semantic dependencies. -- ------------------------------------------------------------------------------ -- 12.4 function Elaboration_Order ------------------------------------------------------------------------------ function Elaboration_Order (Compilation_Units : Asis.Compilation_Unit_List; The_Context : Asis.Context) return Relationship; ------------------------------------------------------------------------------ -- Compilation_Units - Specifies a list of units to elaborate -- The_Context - Specifies a program Context for context -- -- Produces, in elaboration order, a Relationship value containing compilation -- units required to elaborate the given compilation units. -- -- The return value contains the set of ordered lists described above for the -- queries on Semantic Dependence Relationships. If the inconsistent, -- missing, and circular lists are empty, the consistent list will contain -- all units required to elaborate the arguments. -- --|IP -- --|IP The Relationship value may include any number of -- --|IP implementation-specific runtime support packages. -- -- The first unit in the Consistent units list will always be the -- specification for package Standard. The list will contain all units -- required to elaborate the arguments. -- -- Use the Context_Clause_Elements query to get pragma Elaborate elements -- for a compilation unit. -- -- Appropriate Unit_Kinds: -- A_Procedure -- A_Function -- A_Package -- A_Generic_Procedure -- A_Generic_Function -- A_Generic_Package -- A_Procedure_Instance -- A_Function_Instance -- A_Package_Instance -- A_Procedure_Renaming -- A_Function_Renaming -- A_Package_Renaming -- A_Generic_Procedure_Renaming -- A_Generic_Function_Renaming -- A_Generic_Package_Renaming -- A_Procedure_Body -- A_Function_Body -- A_Package_Body -- A_Procedure_Body_Subunit -- A_Function_Body_Subunit -- A_Package_Body_Subunit -- A_Task_Body_Subunit -- A_Protected_Body_Subunit -- An_Unknown_Unit -- See Implementation Permissions -- -- --|IP Implementation Permissions: -- --|IP -- --|IP The handling of An_Unknown_Unit is implementation specific. It can -- --|IP be possible to obtain Semantic Dependence Relationships when starting -- --|IP with a list containing one or more units that are An_Unknown_Unit. -- --|IP However, results may vary across ASIS implementations. -- ------------------------------------------------------------------------------ end Asis.Compilation_Units.Relations;
programs/oeis/187/A187331.asm
karttu/loda
1
178589
; A187331: a(n) = Sum_{k=1..4} floor(k*n/4). ; 0,1,4,6,10,11,14,16,20,21,24,26,30,31,34,36,40,41,44,46,50,51,54,56,60,61,64,66,70,71,74,76,80,81,84,86,90,91,94,96,100,101,104,106,110,111,114,116,120,121,124,126,130,131,134,136,140,141,144,146,150,151,154,156,160,161,164,166,170,171,174,176,180,181,184,186,190,191,194,196,200,201,204,206,210,211,214,216,220,221,224,226,230,231,234,236,240,241,244,246,250,251,254,256,260,261,264,266,270,271,274,276,280,281,284,286,290,291,294,296,300,301,304,306,310,311,314,316,320,321,324,326,330,331,334,336,340,341,344,346,350,351,354,356,360,361,364,366,370,371,374,376,380,381,384,386,390,391,394,396,400,401,404,406,410,411,414,416,420,421,424,426,430,431,434,436,440,441,444,446,450,451,454,456,460,461,464,466,470,471,474,476,480,481,484,486,490,491,494,496,500,501,504,506,510,511,514,516,520,521,524,526,530,531,534,536,540,541,544,546,550,551,554,556,560,561,564,566,570,571,574,576,580,581,584,586,590,591,594,596,600,601,604,606,610,611,614,616,620,621 mov $1,5 mul $1,$0 gcd $0,4 add $1,$0 sub $1,4 div $1,2
firmware/coreboot/3rdparty/libgfxinit/common/ironlake/hw-gfx-gma-port_detect.adb
fabiojna02/OpenCellular
1
18706
-- -- Copyright (C) 2016-2017 secunet Security Networks AG -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, 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. -- with HW.GFX.GMA.Config; with HW.GFX.GMA.Registers; with HW.GFX.GMA.Config_Helpers; package body HW.GFX.GMA.Port_Detect is DP_PORT_DETECTED : constant := 1 * 2 ** 2; PCH_DIGI_PORT_DETECTED : constant := 1 * 2 ** 2; PCH_LVDS_PORT_DETECTED : constant := 1 * 2 ** 1; SHOTPLUG_CTL_DETECT_MASK : constant := 16#0003_0303#; type PCH_Digital_Port_Value is array (PCH_HDMI_Port) of Word32; SHOTPLUG_CTL_HPD_INPUT_ENABLE : constant PCH_Digital_Port_Value := (PCH_HDMI_B => 1 * 2 ** 4, PCH_HDMI_C => 1 * 2 ** 12, PCH_HDMI_D => 1 * 2 ** 20); SHOTPLUG_CTL_SHORT_PULSE_MASK : constant PCH_Digital_Port_Value := (PCH_HDMI_B => 3 * 2 ** 2, PCH_HDMI_C => 3 * 2 ** 10, PCH_HDMI_D => 3 * 2 ** 18); SHOTPLUG_CTL_HPD_STATUS : constant PCH_Digital_Port_Value := (PCH_HDMI_B => 3 * 2 ** 0, PCH_HDMI_C => 3 * 2 ** 8, PCH_HDMI_D => 3 * 2 ** 16); SHOTPLUG_CTL_LONG_DETECT : constant PCH_Digital_Port_Value := (PCH_HDMI_B => 1 * 2 ** 1, PCH_HDMI_C => 1 * 2 ** 9, PCH_HDMI_D => 1 * 2 ** 17); type PCH_Digital_Regs is array (PCH_HDMI_Port) of Registers.Registers_Index; PCH_HDMI : constant PCH_Digital_Regs := (PCH_HDMI_B => Registers.PCH_HDMIB, PCH_HDMI_C => Registers.PCH_HDMIC, PCH_HDMI_D => Registers.PCH_HDMID); PCH_DP : constant PCH_Digital_Regs := (PCH_HDMI_B => Registers.PCH_DP_B, PCH_HDMI_C => Registers.PCH_DP_C, PCH_HDMI_D => Registers.PCH_DP_D); procedure Initialize is Internal_Detected, HDMI_Detected, DP_Detected : Boolean; type PCH_Port_To_GMA_Port is array (PCH_HDMI_Port) of Port_Type; To_Digital_Port : constant PCH_Port_To_GMA_Port := (PCH_HDMI_B => HDMI1, PCH_HDMI_C => HDMI2, PCH_HDMI_D => HDMI3); To_DP_Port : constant PCH_Port_To_GMA_Port := (PCH_HDMI_B => DP1, PCH_HDMI_C => DP2, PCH_HDMI_D => DP3); begin case Config.Internal_Display is when LVDS => -- PCH_LVDS Registers.Is_Set_Mask (Register => Registers.PCH_LVDS, Mask => PCH_LVDS_PORT_DETECTED, Result => Internal_Detected); when DP => -- eDP Registers.Is_Set_Mask (Register => Registers.DP_CTL_A, Mask => DP_PORT_DETECTED, Result => Internal_Detected); when None => Internal_Detected := False; end case; Config.Valid_Port (Internal) := Internal_Detected; -- PCH_HDMI_[BCD], PCH_DP_[BCD] share hotplug registers for PCH_Port in PCH_HDMI_Port loop Registers.Is_Set_Mask (Register => PCH_HDMI (PCH_Port), Mask => PCH_DIGI_PORT_DETECTED, Result => HDMI_Detected); Config.Valid_Port (To_Digital_Port (PCH_Port)) := HDMI_Detected; Registers.Is_Set_Mask (Register => PCH_DP (PCH_Port), Mask => PCH_DIGI_PORT_DETECTED, Result => DP_Detected); Config.Valid_Port (To_DP_Port (PCH_Port)) := DP_Detected; if HDMI_Detected or DP_Detected then Registers.Unset_And_Set_Mask (Register => Registers.SHOTPLUG_CTL, Mask_Unset => SHOTPLUG_CTL_DETECT_MASK or SHOTPLUG_CTL_SHORT_PULSE_MASK (PCH_Port), Mask_Set => SHOTPLUG_CTL_HPD_INPUT_ENABLE (PCH_Port) or SHOTPLUG_CTL_HPD_STATUS (PCH_Port)); -- clear else Registers.Unset_Mask (Register => Registers.SHOTPLUG_CTL, Mask => SHOTPLUG_CTL_DETECT_MASK or SHOTPLUG_CTL_HPD_INPUT_ENABLE (PCH_Port)); end if; end loop; end Initialize; procedure Hotplug_Detect (Port : in Active_Port_Type; Detected : out Boolean) is Ctl32 : Word32; PCH_Port : constant GMA.PCH_Port := (case Port is when DP1 => PCH_HDMI_B, when DP2 => PCH_HDMI_C, when DP3 => PCH_HDMI_D, when others => Config_Helpers.To_PCH_Port (Port)); begin if PCH_Port in PCH_HDMI_B .. PCH_HDMI_D then Registers.Read (Registers.SHOTPLUG_CTL, Ctl32, Verbose => False); Detected := (Ctl32 and SHOTPLUG_CTL_LONG_DETECT (PCH_Port)) /= 0; if (Ctl32 and SHOTPLUG_CTL_HPD_STATUS (PCH_Port)) /= 0 then Registers.Unset_And_Set_Mask (Register => Registers.SHOTPLUG_CTL, Mask_Unset => SHOTPLUG_CTL_DETECT_MASK, Mask_Set => SHOTPLUG_CTL_HPD_STATUS (PCH_Port)); end if; else Detected := False; end if; end Hotplug_Detect; procedure Clear_Hotplug_Detect (Port : Active_Port_Type) is Ignored_HPD : Boolean; begin pragma Warnings (GNATprove, Off, "unused assignment to ""Ignored_HPD""", Reason => "We want to clear pending events only"); Port_Detect.Hotplug_Detect (Port, Ignored_HPD); pragma Warnings (GNATprove, On, "unused assignment to ""Ignored_HPD"""); end Clear_Hotplug_Detect; end HW.GFX.GMA.Port_Detect;
programs/oeis/080/A080084.asm
neoneye/loda
22
98853
; A080084: Number of prime factors in the factorial of the n-th prime, counted with multiplicity. ; 1,2,5,8,16,20,29,33,41,56,60,76,85,89,98,114,129,134,151,160,166,180,192,207,229,240,244,254,260,271,308,321,338,342,369,374,391,409,418,435,451,457,484,492,502,507,541,572,585,590,601,616,623,653,674,689,705,711,729,740,744,773,814,824,830,840,883,900,928,933,948,962,985,1003,1022,1031,1051,1074,1086,1110,1138,1144,1171,1179,1194,1207,1225,1248,1259,1264,1275,1309,1336,1347,1371,1381,1399,1439,1444,1498 seq $0,40 ; The prime numbers. seq $0,22559 ; Sum of exponents in prime-power factorization of n!.
src/firmware/Platform/Timer0/Initialise.asm
pete-restall/Cluck2Sesame-Prototype
1
243
#include "Platform.inc" #include "TailCalls.inc" #include "InitialisationChain.inc" #include "Timer0.inc" radix decimal constrainedToMcuFastClockFrequencyHz 4000000 NON_TIMER0_MASK equ (1 << NOT_RABPU) | (1 << INTEDG) PRESCALER_DIVIDE_BY_128 equ b'00000110' extern INITIALISE_AFTER_TIMER0 Timer0 code global initialiseTimer0 initialiseTimer0: .safelySetBankFor slowTmr0 clrf slowTmr0 clrf tmr0Overflow .setBankFor OPTION_REG movlw NON_TIMER0_MASK andwf OPTION_REG .setBankFor INTCON bcf INTCON, T0IF .setBankFor TMR0 clrf TMR0 .setBankFor OPTION_REG movlw PRESCALER_DIVIDE_BY_128 iorwf OPTION_REG tcall INITIALISE_AFTER_TIMER0 end
libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sccz80/exp_fastcall.asm
Frodevan/z88dk
640
240988
<filename>libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sccz80/exp_fastcall.asm SECTION code_fp_math32 PUBLIC exp_fastcall EXTERN _m32_expf defc exp_fastcall = _m32_expf ; SDCC bridge for Classic IF __CLASSIC PUBLIC _exp_fastcall defc _exp_fastcall = _m32_expf ENDIF
commands/communication/zoom/leave-meeting.applescript
daviddzhou/script-commands
3,305
1651
#!/usr/bin/osascript # Required parameters: # @raycast.author <NAME> # @raycast.authorURL https://github.com/farisaziz12 # @raycast.schemaVersion 1 # @raycast.title Leave Meeting # @raycast.mode silent # @raycast.packageName Zoom # @raycast.description Leaves Current Zoom meeting # @raycast.needsConfirmation true # Optional parameters: # @raycast.icon images/zoom-logo.png tell application "zoom.us" activate tell application "System Events" keystroke "w" using {command down} delay 0.5 key code 36 log "Meeting left" end tell end tell
programs/oeis/190/A190815.asm
jmorken/loda
1
166363
; A190815: A bisection of A049690. ; 0,3,9,17,31,45,63,87,111,139,173,205,243,287,329,373,435,487,535,607,663,727,809,877,955,1037,1117,1205,1293,1385,1475,1595,1695,1783,1913,2005,2123,2267,2379,2487,2629,2763,2893,3041,3177,3313,3473,3625,3761,3941,4081,4245,4443,4595,4773,4961,5129,5313,5513,5701,5861,6091,6291,6463,6717,6897,7107,7347,7547,7771,8005,8237,8453,8709,8937,9165,9459,9675,9891,10203,10435,10675,10997,11241,11503,11787,12063,12347,12627,12919,13193,13517,13813,14077,14421,14673,14991,15375,15639,15955,16313,16645,16941,17305,17629,17905,18323,18675,18987,19383,19687,20023,20437,20781,21151,21555,21899,22275,22691,23039,23405,23865,24267,24595,25051,25415,25809,26281,26665,27089,27497,27925,28347,28771,29211,29623,30149,30565,30941,31493,31865,32329,32891,33275,33707,34203,34683,35143,35663,36139,36563,37115,37603,38035,38581,39025,39527,40151,40607,41131,41667,42143,42647,43211,43747,44183,44841,45389,45845,46493,46973,47489,48119,48639,49209,49797,50333,50917,51549,52097,52647,53349,53857,54385,55103,55631,56183,56875,57443,57995,58661,59293,59931,60555,61191,61771,62459,63111,63663,64455,64991,65655,66415,66967,67583,68311,68991,69603,70315,70951,71561,72401,73093,73693,74477,75053,75771,76563,77219,77903,78661,79297,80027,80823,81503,82191,83039,83791,84367,85279,85919,86619,87529,88233,88987,89751,90527,91259,92003,92791,93525,94437,95141,95849,96815,97475,98285,99165,99885,100633 mul $0,2 lpb $0 mov $1,$0 cal $1,61571 ; Duplicate of A049690. mov $0,1 lpe
specs/ada/server/ike/tkmrpc-operation_handlers-ike-isa_create_child.ads
DrenfongWong/tkm-rpc
0
5749
with Tkmrpc.Request; with Tkmrpc.Response; package Tkmrpc.Operation_Handlers.Ike.Isa_Create_Child is procedure Handle (Req : Request.Data_Type; Res : out Response.Data_Type); -- Handler for the isa_create_child operation. end Tkmrpc.Operation_Handlers.Ike.Isa_Create_Child;
oeis/239/A239794.asm
neoneye/loda-programs
11
84801
<reponame>neoneye/loda-programs ; A239794: 5*n^2 + 4*n - 15. ; Submitted by <NAME> ; -6,13,42,81,130,189,258,337,426,525,634,753,882,1021,1170,1329,1498,1677,1866,2065,2274,2493,2722,2961,3210,3469,3738,4017,4306,4605,4914,5233,5562,5901,6250,6609,6978,7357,7746,8145,8554,8973,9402,9841,10290,10749,11218,11697,12186,12685,13194,13713,14242,14781,15330,15889,16458,17037,17626,18225,18834,19453,20082,20721,21370,22029,22698,23377,24066,24765,25474,26193,26922,27661,28410,29169,29938,30717,31506,32305,33114,33933,34762,35601,36450,37309,38178,39057,39946,40845,41754,42673,43602 add $0,1 mov $1,$0 sub $0,4 pow $1,2 add $0,$1 mul $0,4 add $0,$1 add $0,1
awa/src/awa-wikis-writers-html.ads
Letractively/ada-awa
0
11321
----------------------------------------------------------------------- -- awa-wikis-writers-html -- Wiki HTML writer -- Copyright (C) 2011, 2012, 2013, 2015 <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 Ada.Strings.Wide_Wide_Unbounded; with AWA.Wikis.Documents; with ASF.Contexts.Writer; package AWA.Wikis.Writers.Html is use Ada.Strings.Wide_Wide_Unbounded; -- ------------------------------ -- Wiki to HTML writer -- ------------------------------ type Html_Writer is new AWA.Wikis.Documents.Document_Reader with private; -- Set the output writer. procedure Set_Writer (Document : in out Html_Writer; Writer : in ASF.Contexts.Writer.Response_Writer_Access); -- Add a section header in the document. overriding procedure Add_Header (Document : in out Html_Writer; Header : in Unbounded_Wide_Wide_String; Level : in Positive); -- Add a line break (<br>). overriding procedure Add_Line_Break (Document : in out Html_Writer); -- Add a paragraph (<p>). Close the previous paragraph if any. -- The paragraph must be closed at the next paragraph or next header. overriding procedure Add_Paragraph (Document : in out Html_Writer); -- Add a blockquote (<blockquote>). The level indicates the blockquote nested level. -- The blockquote must be closed at the next header. overriding procedure Add_Blockquote (Document : in out Html_Writer; Level : in Natural); -- Add a list item (<li>). Close the previous paragraph and list item if any. -- The list item will be closed at the next list item, next paragraph or next header. overriding procedure Add_List_Item (Document : in out Html_Writer; Level : in Positive; Ordered : in Boolean); -- Add an horizontal rule (<hr>). overriding procedure Add_Horizontal_Rule (Document : in out Html_Writer); -- Add a link. overriding procedure Add_Link (Document : in out Html_Writer; Name : in Unbounded_Wide_Wide_String; Link : in Unbounded_Wide_Wide_String; Language : in Unbounded_Wide_Wide_String; Title : in Unbounded_Wide_Wide_String); -- Add an image. overriding procedure Add_Image (Document : in out Html_Writer; Link : in Unbounded_Wide_Wide_String; Alt : in Unbounded_Wide_Wide_String; Position : in Unbounded_Wide_Wide_String; Description : in Unbounded_Wide_Wide_String); -- Add a quote. overriding procedure Add_Quote (Document : in out Html_Writer; Quote : in Unbounded_Wide_Wide_String; Link : in Unbounded_Wide_Wide_String; Language : in Unbounded_Wide_Wide_String); -- Add a text block with the given format. overriding procedure Add_Text (Document : in out Html_Writer; Text : in Unbounded_Wide_Wide_String; Format : in AWA.Wikis.Documents.Format_Map); -- Add a text block that is pre-formatted. procedure Add_Preformatted (Document : in out Html_Writer; Text : in Unbounded_Wide_Wide_String; Format : in Unbounded_Wide_Wide_String); -- Finish the document after complete wiki text has been parsed. overriding procedure Finish (Document : in out Html_Writer); private procedure Close_Paragraph (Document : in out Html_Writer); procedure Open_Paragraph (Document : in out Html_Writer); type List_Style_Array is array (1 .. 32) of Boolean; type Html_Writer is new AWA.Wikis.Documents.Document_Reader with record Writer : ASF.Contexts.Writer.Response_Writer_Access := null; Format : AWA.Wikis.Documents.Format_Map := (others => False); Has_Paragraph : Boolean := False; Need_Paragraph : Boolean := False; Current_Level : Natural := 0; List_Styles : List_Style_Array := (others => False); Has_Item : Boolean := False; Quote_Level : Natural := 0; end record; end AWA.Wikis.Writers.Html;
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_ix/tgamma_fastcall.asm
meesokim/z88dk
0
16848
SECTION code_fp_math48 PUBLIC _tgamma_fastcall EXTERN cm48_sdccix_tgamma_fastcall defc _tgamma_fastcall = cm48_sdccix_tgamma_fastcall
src/dir-converter.asm
alexkazik/tapecart-browser
5
97885
<reponame>alexkazik/tapecart-browser type struct { byte [16] name; byte type; lohi address; byte[3] size; lohi loadaddress; byte[8] bundleData; } _FSEntry type struct { byte[2] system_data; byte[13] id; _FSEntry[127] entries; byte [17] eof; } _TapCrtFS pointer _TapCrtFS TapCrtFS = 0x1000 pointer byte[] DisplayFS = 0x0800 block dirConverter local lohi _src @ zp local lohi _dst @ zp local _FSEntry _tmpEntry @ zp calc_slider: // calc size // a == numEntries sta div_var.src2.lo lda 0 sta div_var.src2.hi lda (23*23) & 0xff sta div_var.src1.lo lda (23*23) >> 8 sta div_var.src1.hi jsr div16round.run // basic checks: size should be 2-22 lda div_var.quot.lo cmp 2 bcs _min_ok lda 2 bne _set _min_ok: cmp 22 bcc _max_ok lda 22 _max_ok: _set: sta sliderSize // calc step size lda 0 sta div_var.src1.lo lda 23 sec sbc sliderSize sta div_var.src1.hi // drawStartLast = P_NUM_DIR_ENTRIES-23 lda numEntries sec sbc 23 sta drawStartLast sta div_var.src2.lo lda 0 sta div_var.src2.hi jsr div16round.run lda div_var.quot.lo sta sliderPositionIncrease.lo lda div_var.quot.hi sta sliderPositionIncrease.hi rts exit: // skip the 1st entry if it's a separator { lda DisplayFS[24] cmp 0xf0 bne __skip inc drawOffset __skip: } // calculate slider increase lda numEntries cmp 23+1 bcs calc_slider // no slider lda 0 sta sliderSize // never move screen offset down sta drawStartLast rts add_separator: // add begin lda 25 sta [_dst], y iny // copy filename { ldx 0 __loop: lda _tmpEntry.name, x // check for valid char beq __end_filename cmp 0x20 bcc __invalid cmp 0x7b bcc __ok __invalid: lda 0x60 __ok: ora 0x80 sta [_dst], y inx iny cpx 15 // max length (the 16th is required for the "end" symbol) bne __loop __end_filename: } { lda 26 sta [_dst], y iny lda 29 __loop: sta [_dst], y iny cpy 23 bne __loop } lda 27 sta [_dst], y iny jmp copy_file_info run: sei lda addr(TapCrtFS.entries) & 0xff sta _src.lo lda addr(TapCrtFS.entries) >> 8 sta _src.hi lda addr(DisplayFS) & 0xff sta _dst.lo if (addr(DisplayFS) & 0xff) != 0 lda 0 endif sta drawStart sta drawOffset sta numEntries sta sliderPosition.lo sta sliderPosition.hi lda addr(DisplayFS) >> 8 sta _dst.hi big_loop: { ldy size(_FSEntry)-1 __loop: lda [_src], y sta _tmpEntry, y dey bpl __loop } $(macroAddConstToLoHi "_src" 32) // output pointer ldy 0 // check for a valid filetype (and store icon) ldx _tmpEntry.type lda typeToIcon, x bmi big_loop // unsupported type { bne __skip jmp exit __skip: } sta [_dst], y iny ora 1 sta [_dst], y iny cpx 0xf0 beq add_separator // check load address for 0x0801 lda _tmpEntry.loadaddress.lo cmp 0x01 bne big_loop lda _tmpEntry.loadaddress.hi cmp 0x08 bne big_loop // check for load address + size < 0xd000 lda _tmpEntry.loadaddress.lo clc adc _tmpEntry.size[0] lda _tmpEntry.loadaddress.hi adc _tmpEntry.size[1] tax lda 0 adc _tmpEntry.size[2] bne big_loop // la+s > 0xffff cpx 0xd0 bcs big_loop // la+s > 0xcfff // copy filename { ldx 0 __loop: lda _tmpEntry.name, x // check for valid char beq __do_space cmp 0x20 bcc __invalid cmp 0x7b bcc __ok __invalid: lda 0x60 bne __ok __do_space: lda 0x20 __ok: sta [_dst], y inx iny cpx 16 // size(_tmpEntry.name) bne __loop } // add space lda 0x20 sta [_dst], y iny // add size lda _tmpEntry.size[1] cmp (1000*1024 >> 8) & 0xff lda _tmpEntry.size[2] sbc (1000*1024 >> 16) & 0xff bcc _show_kib _show_mib: // add mb lda _tmpEntry.size[1] sta div_var.src1.lo lda _tmpEntry.size[2] sta div_var.src1.hi lda (100*1024 >> 8) & 0xff sta div_var.src2.lo lda (100*1024 >> 16) & 0xff sta div_var.src2.hi jsr div16round.run ldy 19 -- restore y (killed by div16round) // 1s ldx 0 mib_1: lda div_var.quot.lo sec sbc 10 bcc mib_1_x sta div_var.quot.lo inx bpl mib_1 mib_1_x: txa ora 0x30 sta [_dst], y iny // dot lda 0x2e sta [_dst], y iny // 1/10th mib_10: lda div_var.quot.lo ora 0x30 sta [_dst], y iny // add m lda 0x6d // 'M' sta [_dst], y iny bne _done_size _show_kib: local byte[3] _kib_show @zp // init 0 lda 0 -- sta _kib_show[0] -- 1 sta _kib_show[1] -- 10 sta _kib_show[2] -- 100 // tmp space: div_var.rem.lo / div_var.rem.hi for _tmpEntry.size[1] / [2] lda _tmpEntry.size[2] sta div_var.rem.hi // div 1024, round up if required lda _tmpEntry.size[1] lsr div_var.rem.hi ror lsr div_var.rem.hi ror adc 0 sta div_var.rem.lo bcc no_round inc div_var.rem.hi no_round: // 100s kib_100: lda div_var.rem.lo sec sbc 100 tax lda div_var.rem.hi sbc (100 >> 8) & 0xff bcc kib_10 stx div_var.rem.lo sta div_var.rem.hi inc _kib_show[2] bpl kib_100 // 10s kib_10: lda div_var.rem.lo sec sbc 10 bcc kib_1 sta div_var.rem.lo inc _kib_show[1] bpl kib_10 kib_1: lda div_var.rem.lo sta _kib_show[0] ldx 2 kib_loop: lda _kib_show, x bne kib_loop_show cpx 0 beq kib_loop_show kib_loop_space: lda 0x20 ^ 0x30 kib_loop_show: eor 0x30 sta [_dst], y iny dex bpl kib_loop // add k lda 0x4b // 'k' sta [_dst], y iny _done_size: // add end of line marker lda 123 sta [_dst], y iny copy_file_info: // copy file-info { ldx 0 __loop: lda _tmpEntry.type, x sta [_dst], y inx iny cpx 16 bne __loop } // increase output pointer $(macroAddConstToLoHi "_dst" 40) // added a file inc numEntries jmp big_loop end
programs/oeis/257/A257198.asm
karttu/loda
0
246855
; A257198: Number of permutations of length n having exactly one descent such that the first element of the permutation is an odd number. ; 0,0,2,6,16,36,78,162,332,672,1354,2718,5448,10908,21830,43674,87364,174744,349506,699030,1398080,2796180,5592382,11184786,22369596,44739216,89478458,178956942,357913912,715827852,1431655734,2863311498,5726623028,11453246088,22906492210,45812984454,91625968944,183251937924,366503875886,733007751810,1466015503660,2932031007360,5864062014762,11728124029566,23456248059176,46912496118396,93824992236838,187649984473722,375299968947492,750599937895032,1501199875790114,3002399751580278,6004799503160608 lpb $0,1 sub $0,1 add $3,1 add $4,5 mov $2,$4 sub $2,5 add $1,$2 mov $4,$3 add $3,$2 mul $4,2 lpe
src/sparknacl-utils.ads
yannickmoy/SPARKNaCl
76
3147
private package SPARKNaCl.Utils with Pure, SPARK_Mode => On is --=================================================== -- Exported subprogram declarations -- -- Note that these subprograms appear in a distinct -- private child package so they are NOT -- primitive operations of either types Byte_Seq or -- GF, but they ARE potentially usable by other -- public children of SPARKNaCl. --=================================================== -- Constant time conditional swap of P and Q. Note that -- if a Normal_GF is passed in, this property is retained -- on swapping (or not...) This is required Pack_25519. -- In the original TweetNaCl sources, this was called -- "sel25519" procedure CSwap16 (P : in out Normal_GF; Q : in out Normal_GF; Swap : in Boolean) with Global => null, Contract_Cases => (Swap => (P = Q'Old and Q = P'Old), not Swap => (P = P'Old and Q = Q'Old)); -- Reduces N modulo (2**255 - 19) then packs the -- value into 32 bytes little-endian. function Pack_25519 (N : in Normal_GF) return Bytes_32 with Global => null, Pure_Function; function Inv_25519 (I : in Normal_GF) return Normal_GF with Global => null, Pure_Function; function Unpack_25519 (N : in Bytes_32) return Normal_GF with Global => null, Pure_Function; end SPARKNaCl.Utils;
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c95095c.ada
best08618/asylo
7
1273
-- C95095C.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT OVERLOADED ENTRY DECLARATIONS -- ARE PERMITTED IN WHICH THERE IS A MINIMAL -- DIFFERENCE BETWEEN THE DECLARATIONS. -- (C) THE BASE TYPE OF A PARAMETER IS DIFFERENT FROM THAT -- OF THE CORRESPONDING ONE. -- JWC 7/24/85 WITH REPORT; USE REPORT; PROCEDURE C95095C IS BEGIN TEST ("C95095C", "ENTRY OVERLOADING WITH " & "MINIMAL DIFFERENCES"); -------------------------------------------------- -- THE BASE TYPE OF ONE PARAMETER IS -- DIFFERENT FROM THAT OF THE CORRESPONDING -- ONE. DECLARE TYPE NEWINT IS NEW INTEGER; I, J, K : INTEGER := 0; N : NEWINT; S : STRING (1..2) := "12"; TASK T IS ENTRY E (I1 : INTEGER; N1 : OUT NEWINT; I2 : IN OUT INTEGER); ENTRY E (I1 : INTEGER; N1 : OUT INTEGER; I2 : IN OUT INTEGER); END T; TASK BODY T IS BEGIN LOOP SELECT ACCEPT E (I1 : INTEGER; N1 : OUT NEWINT; I2 : IN OUT INTEGER) DO S (1) := 'A'; N1 := 0; -- THIS VALUE IS IRRELEVENT. END E; OR ACCEPT E (I1 : INTEGER; N1 : OUT INTEGER; I2 : IN OUT INTEGER) DO S (2) := 'B'; N1 := 0; -- THIS VALUE IS IRRELEVENT. END E; OR TERMINATE; END SELECT; END LOOP; END T; BEGIN T.E (I, N, K); T.E (I, J, K); IF S /= "AB" THEN FAILED ("ENTRIES DIFFERING ONLY BY " & "THE BASE TYPE OF A PARAMETER " & "CAUSED CONFUSION"); END IF; END; -------------------------------------------------- RESULT; END C95095C;
BinaryTranslation/src/pt/up/fe/specs/binarytranslation/lex/PseudoInstruction.g4
specs-feup/specs-hw
3
7141
/** * Copyright 2020 SPeCS. * * 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. under the License. */ /* * The purpose of this grammar is to be able to express the operation of * an instruction using the ASM fields as operators */ grammar PseudoInstruction; @header { package pt.up.fe.specs.binarytranslation.lex.generated; } /************************************************************ * Parsing */ pseudoInstruction : statement+; /* Question mark stands for: zero or one * Plus stands for: one or more * Star stands for: zero or more */ statementlist : statement | LBRACE statement* RBRACE; statement : expression STATEMENTEND # plainStmt | 'if' LPAREN condition=expression RPAREN ifsats=statementlist # ifStatement | 'if' LPAREN condition=expression RPAREN ifsats=statementlist ('else' elsestats=statementlist) # ifElseStatement; expression : operand # variableExpr | LPAREN expression RPAREN # parenExpr | functionName LPAREN arguments? RPAREN # functionExpr | operator right=expression # unaryExpr | left=expression operator right=expression # binaryExpr | left=expression rlop right=expression # assignmentExpr; rlop: EQ; /* Built ins */ ADDR : 'addr'; // gets address of own instruction, called as "addr()" BYTE : 'byte'; CLZ : 'clz'; MSB : 'msb'; LSB : 'lsb'; MSW : 'msw'; LSW : 'lsw'; SQRT: 'sqrt'; SETCARRY: 'setCarry'; GETCARRY: 'getCarry'; SEXTEND: 'sext'; UCAST: 'unsigned'; SCAST: 'signed'; FLOAT: 'float'; functionName : BYTE | CLZ | MSB | LSB | MSW | LSW | SETCARRY | GETCARRY | SEXTEND | UCAST | SCAST | FLOAT | SQRT; arguments: expression (',' expression)*; /* Operators and operands */ operator : PLUS | MINUS | TIMES | DIV | GT | GET | LT | LET | EQUALS | NEQUALS | RSHIFT | LSHIFT | RASHIFT | LNOT | LOR | LAND | BXOR | BOR | BAND; /* Any symbol that can be defined (anything but an operator) */ integerval: INT; doubleval: DOUBLE; unsignednumber: (integerval | doubleval); signednumber: MINUS (integerval | doubleval); number: unsignednumber | signednumber; metafield: METASYMBOL processorRegister=ASMFIELD; rangesubscript: ASMFIELD LBRACK loidx=integerval SEMI hiidx=integerval RBRACK; scalarsubscript : ASMFIELD LBRACK idx=integerval RBRACK; operand: ASMFIELD # Field | (metafield) # metaFieldOperand | (number) # Literal | scalarsubscript # scalarsubscriptOperand | rangesubscript # rangesubscriptOperand; /************************************************************ * Lexing */ /* Generic Tokens */ LPAREN : '('; RPAREN : ')'; LBRACK : '[' ; RBRACK : ']' ; LBRACE : '{' ; RBRACE : '}' ; SEMI : ':' ; STATEMENTEND : ';' ; /* Operators */ PLUS : '+'; MINUS : '-'; TIMES : '*'; DIV : '/'; GT : '>'; GET : '>='; LT : '<'; LET : '<='; EQ : '='; EQUALS : '=='; NEQUALS : '!='; LNOT : '~'; LOR : '||'; LAND : '&&'; BOR : '|'; BAND : '&'; BXOR : '^'; RSHIFT : '>>'; LSHIFT : '<<'; RASHIFT : '>>>'; fragment DIGIT: [0-9]; fragment CHARACTER: [A-Za-z]; /* Any possible field in the ASM field list of any instruction */ /* New ASMFIELD regex for RISC-V: [A-Za-z][A-Za-z0-9]+ */ METASYMBOL : '$'; ASMFIELD : CHARACTER+; /* Literal Numbers */ INT : DIGIT+; DOUBLE : DIGIT+'.'DIGIT+; /* We're going to ignore all white space characters */ WS : [ \t\r\n]+ -> skip ;
models/amalgam/paper/unused/chordbug.als
transclosure/Amalgam
4
1428
<reponame>transclosure/Amalgam /* ======================================================================== A MODEL OF THE FULL CHORD ROUTING PROTOCOL IN ALLOY <NAME>, 15 June 2010 Copyright AT&T Labs, Inc., 2009, 2010, 2011, 2012. ======================================================================== */ open util/ordering[Time] as trace open util/ordering[Node] as ring /* ======================================================================== TEMPORAL STRUCTURE Note that if time has a scope of x, there will be exactly x times, not x or fewer. However, there need not be x-1 real events, because Null events will take up the slack. ======================================================================== */ sig Time { } abstract sig Event { pre: Time, post: Time, cause: lone (Event - Null) } sig Null extends Event { } { no cause } fact TemporalStructure { all t: Time - trace/last | one e: Event | e.pre = t all t: trace/last | no e: Event | e.pre = t all e: Event | e.post = (e.pre).next } fact CauseHasSingleEffect { cause in Event lone -> Event } fact CausePrecedesEffect { all e1, e2: Event | e1 = e2.cause => lt[e1.pre,e2.pre] } /* ======================================================================== STRUCTURE OF A RING NETWORK Simplifications: 1) In this model, the node itself, its IP address, and its hashed identifier are all conflated. 2) The successor list of a node has size 2. This brevity does not eliminate any interesting behaviors. 3) Fingers are not included in this model, as they have no effect on ring structure, and the early fingers and successors coincide. ======================================================================== */ sig Node { succ: Node lone -> Time, succ2: Node lone -> Time, prdc: Node lone -> Time, bestSucc: Node lone -> Time } { -- This defines bestSucc. all t: Time | (Member[succ.t,t] && Member[succ2.t,t] => bestSucc.t = succ.t) && (Member[succ.t,t] && NonMember[succ2.t,t] => bestSucc.t = succ.t) && (NonMember[succ.t,t] && Member[succ2.t,t] => bestSucc.t = succ2.t) && (NonMember[succ.t,t] && NonMember[succ2.t,t] => no bestSucc.t) -- A node is unambiguously a member or not. all t: Time | Member[this,t] || NonMember[this,t] } pred Member [n: Node, t: Time] { some n.succ.t } pred NonMember [n: Node, t: Time] { no n.succ.t && no n.prdc.t && no n.succ2.t } pred Between [n1, n2, n3: Node] { lt[n1,n3] => ( lt[n1,n2] && lt[n2,n3] ) else ( lt[n1,n2] || lt[n2,n3] ) } -- for all x and y, Between{x,y,x] -- for all x, ! Between{x,x,x] -- for all x and y, ! Between{x,x,y] -- for all x and y, ! Between{y,x,x] /* ======================================================================== CANDIDATE INVARIANT PROPERTIES ======================================================================== */ pred OneOrderedRing [t: Time] { let ringMembers = { n: Node | n in n.(^(bestSucc.t)) } | some ringMembers -- at least one ring && (all disj n1, n2: ringMembers | n1 in n2.(^(bestSucc.t)) ) -- not two && (all disj n1, n2, n3: ringMembers | -- ring is globally n2 = n1.bestSucc.t => ! Between[n1,n3,n2] -- ordered ) } pred ConnectedAppendages [t: Time] { let members = { n: Node | Member[n,t] } | let ringMembers = { n: members | n in n.(^(bestSucc.t)) } | all na: members - ringMembers | -- na is in some nc: ringMembers | nc in na.(^(bestSucc.t)) -- an appendage -- yet reaches ring } pred AntecedentPredecessors [t: Time] { all n: Node | let antes = (succ.t).n | Member[n.prdc.t,t] => n.prdc.t in antes } pred OrderedAppendages [t: Time] { let members = { n: Node | Member[n,t] } | let ringMembers = { n: members | n in n.(^(bestSucc.t)) } | let appendSucc = bestSucc.t - (ringMembers -> Node) | all n: ringMembers | all disj a1, a2, a3: (members - ringMembers) + n | ( n in a1.(^appendSucc) && a2 = a1.appendSucc && (a1 in a3.(^appendSucc) || a3 in a2.(^appendSucc) ) ) => ! Between[a1,a3,a2] } pred OrderedMerges [t: Time] { let ringMembers = { n: Node | n in n.(^(succ.t)) } | all disj n1, n2, n3: Node | ( n3 in n1.bestSucc.t && n3 in n2.bestSucc.t && n1 in ringMembers && n2 !in ringMembers && n3 in ringMembers ) => Between[n1,n2,n3] } pred DistinctSuccessors [t: Time] { let members = { n: Node | Member[n,t] } | let ringMembers = { n: members | n in n.(^(succ.t)) } | all n: members | ( (n.succ2.t = n.succ.t => (# ringMembers = 1 && n in ringMembers)) && (n.succ2.t = n => (# ringMembers <= 2 && n in ringMembers)) ) } pred OrderedSuccessors [t: Time] { let members = { n: Node | Member[n,t] } | let ringMembers = { n: members | n in n.(^(succ.t)) } | all n: members | some n.succ2.t => ( Between[n,n.succ.t,n.succ2.t] || n = ringMembers ) } pred ValidSuccessorList [t: Time] { let members = { n: Node | Member[n,t] } | all disj n, m: members | let antes = (succ.t).n | Between[n.succ.t,m,n.succ2.t] -- n's successors skip over a live node m => m !in antes.succ2.t -- m is not in successor list of any n antecedent } pred ReachableSuccessor2 [t: Time] { let members = { n: Node | Member[n,t] } | let ringMembers = { n: Node | n in n.(^(bestSucc.t)) } | ( (all n: members - ringMembers | Member[n.succ2.t,t] => n.succ2.t in n.(^(bestSucc.t)) ) && (all n: ringMembers | Member[n.succ2.t,t] => ( n.succ2.t in ringMembers || ( let altSucc = bestSucc.t + n->n.succ2.t - n->n.succ.t | let altRingMembers = { a: Node | a in n.(^(altSucc)) } | all disj a1, a2, a3: altRingMembers | a2 = a1.altSucc => ! Between[a1,a3,a2] ) ) ) ) } pred AvengerInvariant [t: Time] { let members = { n: Node | Member[n,t] } | all n: members | Member[n.prdc.t,t] => ! Between[n.prdc.t,n.bestSucc.t,n] } pred Valid [t: Time] { OneOrderedRing[t] -- from PODC Full, revised && ConnectedAppendages[t] -- from PODC Full, revised && AntecedentPredecessors[t] -- new && OrderedAppendages[t] -- from PODC Full && OrderedMerges[t] -- from PODC Full && DistinctSuccessors[t] -- new && OrderedSuccessors[t] -- new && ValidSuccessorList[t] -- from PODC Full, revised && ReachableSuccessor2[t] -- new } -- These are the only properties needed for an undisturbed network to -- become ideal through stabilization and reconciliation. pred CoreValid [t: Time] { OneOrderedRing[t] && ConnectedAppendages[t] } pred SomeBestSuccessor [t: Time] { all n: Node | Member[n,t] => some n.bestSucc.t } assert ValidImpliesSomeBestSuccessor { all t: Time | Valid[t] => SomeBestSuccessor[t] } check ValidImpliesSomeBestSuccessor for 7 but 0 Event, 1 Time /* ======================================================================== IDEAL PROPERTIES ======================================================================== */ pred Stable [t: Time] { let members = { n: Node | Member[n,t] } | all n1, n2: members | n2 = n1.succ.t <=> n1 = n2.prdc.t } pred AllRing [t: Time] { let members = { n: Node | some n.succ.t } | all n1, n2: members | n2 in n1.(^(succ.t)) } pred Reconciled [t: Time] { let members = { n: Node | Member[n,t] } | all n: members | Member[n.succ.t,t] && Member[n.succ2.t,t] && n.succ2.t = (n.succ.t).succ.t } pred Succ2Correctness [t: Time] { let members = { n: Node | Member[n,t] } | all n: members | (Member[n.succ2.t,t] && n.succ2.t != n.bestSucc.t) => n.succ2.t = (n.bestSucc.t).bestSucc.t } pred Ideal [t: Time] { Valid[t] && Stable[t] -- from PODC Full, revised && Reconciled[t] -- from PODC Full, revised } assert IdealImpliesAllRing { all t: Time | Ideal[t] => AllRing[t] } check IdealImpliesAllRing for 7 but 0 Event, 1 Time assert IdealImpliesSucc2Correct { all t: Time | Ideal[t] => Succ2Correctness[t] } check IdealImpliesSucc2Correct for 7 but 0 Event, 1 Time /* ======================================================================== SPECIFICATION OF EVENTS Chord assumes that a node's successor list is long enough so that the probability of all of its successor's being dead is extremely low. In Alloy this assumption is encoded deterministically. The specification of the Fail event will not allow a node to fail if it would leave another node with no live node in its successor list. Straightforward bug fixes: 1) The Join specification checks that the successor adopted by the joining node is live. Otherwise the join will not actually connect the joining node to the network. 2) The Stabilize specification checks that the successor adopted by the stabilizing node is live. Otherwise the ring can be lost easily. These bugs were found during analysis. They are fixed so that analysis can find other problems. ======================================================================== */ abstract sig RingEvent extends Event { node: Node } sig Join extends RingEvent { } { no cause } sig Stabilize extends RingEvent { } { no cause } sig Notified extends RingEvent { newPrdc: Node } { some cause } sig Fail extends RingEvent { } { no cause } sig Flush extends RingEvent { } { no cause } sig Update extends RingEvent { } { no cause } sig Reconcile extends RingEvent { } { no cause } fact NonMemberCanJoin { all j: Join, n: j.node, t: j.pre | { NonMember[n,t] (some m: Node | Member[m,t] && Between[m,n,m.succ.t] && Member[m.succ.t,t] && n.succ.(j.post) = m.succ.t ) no n.prdc.(j.post) no cause:>j } } fact StabilizeMayChangeSuccessor { all s: Stabilize, n: s.node, t: s.pre | let newSucc = (n.succ.t).prdc.t | { Member[n,t] Member[n.succ.t,t] ( ( some newSucc && Between[n,newSucc,n.succ.t] && Member[newSucc,t] ) -- accept new successor or not => n.succ.(s.post) = newSucc else n.succ.(s.post) = n.succ.t ) (some f: Notified | f.cause = s && f.node = n.succ.(s.post) && f.newPrdc = n ) } } fact NotifiedMayChangePredecessor { all f: Notified, n: f.node, p: f.newPrdc, t: f.pre | ( Member[n,t] && (no n.prdc.t || Between[n.prdc.t,p,n]) ) -- accept new predecessor => (n.prdc.(f.post) = p && no cause:>f) -- else do nothing else (n.prdc.(f.post) = n.prdc.t && no cause:>f) } fact MemberCanFail { all f: Fail, n: f.node, t: f.pre | { Member[n,t] (all m: Node | m.succ.t = n => Member[m.succ2.t,t]) (all m: Node | m.succ2.t = n => Member[m.succ.t,t]) n.succ.t != n.succ2.t NonMember[n,f.post] no cause:>f } } fact FlushMayChangePredecessor { all f: Flush, n: f.node, t: f.pre | { (Member[n,t] && NonMember[n.prdc.t,t]) => no n.prdc.(f.post) else n.prdc.(f.post) = n.prdc.t no cause:>f } } fact UpdateMayChangeSuccessor { all u: Update, n: u.node, t: u.pre | let oldSucc = n.succ.t | let oldSucc2 = n.succ2.t | { (Member[n,t] && NonMember[oldSucc,t] && some oldSucc2) => ( n.succ.(u.post) = oldSucc2 && no n.succ2.(u.post) ) else (n.succ.(u.post) = oldSucc && n.succ2.(u.post) = oldSucc2) -- at least one of the two must be a member no cause:>u } } fact ReconcileMayChangeSuccessor2 { all r: Reconcile, n: r.node, t: r.pre | let oldSucc2 = n.succ2.t | let newSucc2 = (n.succ.t).succ.t | { -- not necessarily a member ( Member[n,t] && Member[n.succ.t,t] && newSucc2 != oldSucc2 -- this must be a change && (newSucc2 = n.succ.t => -- this must not be redundant n.succ.t = n) ) => n.succ2.(r.post) = newSucc2 else n.succ2.(r.post) = oldSucc2 no cause:>r } } /* ======================================================================== FRAME CONDITIONS Frame conditions say, "and nothing else changes." ======================================================================== */ fact SuccessorFieldFrameCondition { all e: Event, n: Node | n.succ.(e.pre) != n.succ.(e.post) => ( (e in Join && e.node = n) || (e in Stabilize && e.node = n) || (e in Fail && e.node = n) || (e in Update && e.node = n) ) } fact Successor2FieldFrameCondition { all e: Event, n: Node | n.succ2.(e.pre) != n.succ2.(e.post) => ( (e in Fail && e.node = n) || (e in Update && e.node = n) || (e in Reconcile && e.node = n) ) } fact PredecessorFieldFrameCondition { all e: Event, n: Node | n.prdc.(e.pre) != n.prdc.(e.post) => ( (e in Notified && e.node = n) || (e in Fail && e.node = n) || (e in Flush && e.node = n) ) } /* ======================================================================== CHANGE PREDICATES Change predicates identify states in which, if an event occurs, it will change the state. ======================================================================== */ pred StabilizationWillChangeSuccessor [n, nSucc: Node, t: Time] { let newSucc = (n.succ.t).prdc.t | Member[n,t] && some newSucc && Between[n,newSucc,n.succ.t] && Member[newSucc,t] && nSucc = newSucc } pred StabilizationShouldChangePredecessor [n, nSucc: Node, t: Time] { ( ( StabilizationWillChangeSuccessor[n,nSucc,t] || (nSucc = n.succ.t && Member[n,t] && Member[nSucc,t]) ) && ( no nSucc.prdc.t || (some nSucc.prdc.t && Between[nSucc.prdc.t,n,nSucc]) ) ) } pred ReconciliationWillFlushPredecessor [n: Node, t: Time] { Member[n,t] && some n.prdc.t && NonMember[n.prdc.t,t] } pred ReconciliationWillChangeSuccessor [n, nSucc: Node, t: Time] { Member[n,t] && NonMember[n.succ.t,t] && some n.succ2.t && nSucc = n.succ2.t } pred ReconciliationWillChangeSuccessor2 [n, nSucc2: Node, t: Time] { let oldSucc2 = n.succ2.t | let newSucc2 = (n.succ.t).succ.t | Member[n,t] && Member[n.succ.t,t] && nSucc2 = newSucc2 && newSucc2 != oldSucc2 && (newSucc2 = n.succ.t => n.succ.t = n) } /* ======================================================================== LIVENESS VERIFICATION ======================================================================== */ assert ValidRingIsImprovable { ( CoreValid[trace/first] && ! Ideal[trace/first] ) => ( (some n1, n2: Node | StabilizationWillChangeSuccessor[n1,n2,trace/first]) || (some n1, n2: Node | StabilizationShouldChangePredecessor[n1,n2,trace/first]) || (some n: Node | ReconciliationWillFlushPredecessor[n,trace/first]) || (some n1, n2: Node | ReconciliationWillChangeSuccessor[n1,n2,trace/first]) || (some n1, n2: Node | ReconciliationWillChangeSuccessor2[n1,n2,trace/first]) ) } check ValidRingIsImprovable for 5 but 0 Event, 1 Time check ValidRingIsImprovable for 7 but 0 Event, 1 Time assert IdealRingCannotImprove { Ideal[trace/first] => ( (no n1, n2: Node | StabilizationWillChangeSuccessor[n1,n2,trace/first]) && (no n1, n2: Node | StabilizationShouldChangePredecessor[n1,n2,trace/first]) && (no n: Node | ReconciliationWillFlushPredecessor[n,trace/first]) && (no n1, n2: Node | ReconciliationWillChangeSuccessor[n1,n2,trace/first]) && (no n1, n2: Node | ReconciliationWillChangeSuccessor2[n1,n2,trace/first]) ) } check IdealRingCannotImprove for 5 but 0 Event, 1 Time check IdealRingCannotImprove for 7 but 0 Event, 1 Time /* ======================================================================== SAFETY VERIFICATION OF INITIALIZATION AND SINGLE OPERATIONS This verification cannot be completed because there is no invariant strong enough to imply CoreValid. These safety checks use a weak form of the desired invariant that can be changed easily here. By experimenting, we try to find as many fixable problems as possible. ======================================================================== */ assert InitialIsValid { let members = { n: Node | Member[n,trace/first] } | ( one members && members.succ.trace/first = members && no members.prdc.trace/first && no members.succ2.trace/first ) => Valid[trace/first] } check InitialIsValid for 1 but 0 Event, 1 Time assert JoinPreservesValidity { some Join && Valid[trace/first] => WeakJValid[trace/last] } check JoinPreservesValidity for 3 but 1 Event, 2 Time check JoinPreservesValidity for 4 but 1 Event, 2 Time check JoinPreservesValidity for 5 but 1 Event, 2 Time pred WeakJValid [t: Time] { OneOrderedRing[t] && ConnectedAppendages[t] -- && AntecedentPredecessors[t] -- && OrderedAppendages[t] -- && OrderedMerges[t] && DistinctSuccessors[t] && OrderedSuccessors[t] -- && ValidSuccessorList[t] -- && ReachableSuccessor2[t] } assert StabilizationPreservesValidity { some Stabilize && Valid[trace/first] => WeakSValid[trace/last] } check StabilizationPreservesValidity for 3 but 2 Event, 3 Time-- 1587 ms check StabilizationPreservesValidity for 4 but 2 Event, 3 Time-- 19853 ms check StabilizationPreservesValidity for 5 but 2 Event, 3 Time-- 362522 ms pred WeakSValid [t: Time] { OneOrderedRing[t] && ConnectedAppendages[t] && AntecedentPredecessors[t] && OrderedAppendages[t] -- && OrderedMerges[t] -- && DistinctSuccessors[t] -- && OrderedSuccessors[t] && ReachableSuccessor2[t] -- && ValidSuccessorList[t] } assert FailPreservesValidity { some Fail && Valid[trace/first] => WeakFValid[trace/last] } check FailPreservesValidity for 3 but 1 Event, 2 Time check FailPreservesValidity for 4 but 1 Event, 2 Time check FailPreservesValidity for 5 but 1 Event, 2 Time pred WeakFValid [t: Time] { OneOrderedRing[t] && ConnectedAppendages[t] && AntecedentPredecessors[t] -- && OrderedMerges[t] -- && OrderedAppendages[t] -- && DistinctSuccessors[t] -- && OrderedSuccessors[t] && ValidSuccessorList[t] -- && ReachableSuccessor2[t] } assert FlushPreservesValidity { some Flush && Valid[trace/first] => Valid[trace/last] } check FlushPreservesValidity for 3 but 1 Event, 2 Time check FlushPreservesValidity for 4 but 1 Event, 2 Time check FlushPreservesValidity for 5 but 1 Event, 2 Time assert UpdatePreservesValidity { some Update && Valid[trace/first] => Valid[trace/last] } check UpdatePreservesValidity for 3 but 1 Event, 2 Time check UpdatePreservesValidity for 4 but 1 Event, 2 Time check UpdatePreservesValidity for 5 but 1 Event, 2 Time assert ReconcilePreservesValidity { some Reconcile && Valid[trace/first] => WeakRValid[trace/last] } check ReconcilePreservesValidity for 3 but 1 Event, 2 Time check ReconcilePreservesValidity for 4 but 1 Event, 2 Time check ReconcilePreservesValidity for 5 but 1 Event, 2 Time pred WeakRValid [t: Time] { OneOrderedRing[t] && ConnectedAppendages[t] && AntecedentPredecessors[t] && OrderedAppendages[t] && OrderedMerges[t] && DistinctSuccessors[t] -- && OrderedSuccessors[t] -- && ValidSuccessorList[t] && ReachableSuccessor2[t] } /* ======================================================================== VALIDATION OF COUNTEREXAMPLES: all checked previously pred CounterOrderedMerges { some disj n0, n1, n2, n3: Node, disj e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12: Event | { lt[n0,n1] && lt[n1,n2] && lt[n2,n3] e0.post = e1.pre e1.post = e2.pre e2.post = e3.pre e3.post = e4.pre e4.post = e5.pre e5.post = e6.pre e6.post = e7.pre e7.post = e8.pre e8.post = e9.pre e9.post = e10.pre e10.post = e11.pre e11.post = e12.pre (let members0 = { n: Node | Member[n,trace/first] } | members0 = n0 && no members0.prdc.trace/first && no members0.succ2.trace/first ) e0 in Join && e0.node = n3 e1 in Stabilize && e1.node = n3 e2 in Notified && e2.node = n0 e3 in Stabilize && e3.node = n0 e4 in Notified && e4.node = n3 -- ring of size 2 e5 in Join && e5.node = n1 e6 in Join && e6.node = n2 e7 in Stabilize && e7.node = n1 e8 in Notified && e8.node = n3 -- up to first snapshot of figure e9 in Stabilize && e9.node = n2 e10 in Notified && e10.node = n3 -- second e11 in Stabilize && e11.node = n0 e12 in Notified && e12.node = n2 -- third } } run CounterOrderedMerges for 1 but 4 Node, 13 Event, 14 Time pred CounterOrderedAppendages { some disj n0, n1, n2, n3: Node, disj e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18: Event | { lt[n0,n1] && lt[n1,n2] && lt[n2,n3] e0.post = e1.pre e1.post = e2.pre e2.post = e3.pre e3.post = e4.pre e4.post = e5.pre e5.post = e6.pre e6.post = e7.pre e7.post = e8.pre e8.post = e9.pre e9.post = e10.pre e10.post = e11.pre e11.post = e12.pre e12.post = e13.pre e13.post = e14.pre e14.post = e15.pre e15.post = e16.pre e16.post = e17.pre e17.post = e18.pre (let members0 = { n: Node | Member[n,trace/first] } | members0 = n0 && no members0.prdc.trace/first && no members0.succ2.trace/first ) e0 in Join && e0.node = n1 e1 in Join && e1.node = n2 e2 in Join && e2.node = n3 e3 in Stabilize && e3.node = n2 e4 in Notified && e4.node = n0 -- up to first snapshot of figure e5 in Stabilize && e5.node = n0 e6 in Notified && e6.node = n2 e7 in Stabilize && e7.node = n3 e8 in Notified && e8.node = n0 -- second e9 in Stabilize && e9.node = n1 e10 in Notified && e10.node = n3 e11 in Reconcile && e11.node = n2 e12 in Reconcile && e12.node = n3 -- third e13 in Fail && e13.node = n0 e14 in Update && e14.node = n2 e15 in Update && e15.node = n3 e16 in Flush && e16.node = n3 e17 in Stabilize && e17.node = n3 e18 in Notified && e18.node = n2 -- fourth } } run CounterOrderedAppendages for 1 but 4 Node, 19 Event, 20 Time pred CounterValidSuccessorList { some disj n0, n1, n2, n3: Node, disj e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18: Event | { lt[n0,n1] && lt[n1,n2] && lt[n2,n3] e0.post = e1.pre e1.post = e2.pre e2.post = e3.pre e3.post = e4.pre e4.post = e5.pre e5.post = e6.pre e6.post = e7.pre e7.post = e8.pre e8.post = e9.pre e9.post = e10.pre e10.post = e11.pre e11.post = e12.pre e12.post = e13.pre e13.post = e14.pre e14.post = e15.pre e15.post = e16.pre e16.post = e17.pre e17.post = e18.pre (let members0 = { n: Node | Member[n,trace/first] } | members0 = n0 && no members0.prdc.trace/first && no members0.succ2.trace/first ) e0 in Join && e0.node = n2 e1 in Stabilize && e1.node = n2 e2 in Notified && e2.node = n0 e3 in Stabilize && e3.node = n0 e4 in Notified && e4.node = n2 -- ring of size 2 e5 in Join && e5.node = n1 e6 in Reconcile && e6.node = n1 -- up to first snapshot of figure e7 in Join && e7.node = n3 e8 in Stabilize && e8.node = n3 e9 in Notified && e9.node = n0 e10 in Stabilize && e10.node = n2 e11 in Notified && e11.node = n3 e12 in Reconcile && e12.node = n0 -- second e13 in Stabilize && e13.node = n1 e14 in Notified && e14.node = n2 e15 in Stabilize && e15.node = n0 e16 in Notified && e16.node = n1 -- third e17 in Fail && e17.node = n2 e18 in Update && e18.node = n1 -- fourth } } run CounterValidSuccessorList for 1 but 4 Node, 19 Event, 20 Time pred CounterConnectedAppendages { some disj n0, n1, n2, n3: Node, disj e0, e1, e2, e3, e4, e5, e6, e7, e8: Event | { lt[n0,n1] && lt[n1,n2] && lt[n2,n3] e0.post = e1.pre e1.post = e2.pre e2.post = e3.pre e3.post = e4.pre e4.post = e5.pre e5.post = e6.pre e6.post = e7.pre e7.post = e8.pre (let members0 = { n: Node | Member[n,trace/first] } | members0 = n0 && no members0.prdc.trace/first && no members0.succ2.trace/first ) e0 in Join && e0.node = n2 e1 in Stabilize && e1.node = n2 e2 in Notified && e2.node = n0 e3 in Stabilize && e3.node = n0 e4 in Notified && e4.node = n2 e5 in Reconcile && e5.node = n0 -- first e6 in Fail && e6.node = n2 -- second e7 in Join && e7.node = n1 e8 in Update && e8.node = n0 -- third } } run CounterConnectedAppendages for 1 but 4 Node, 9 Event, 10 Time -- Can only be instantiated with the bug fix in Join removed. pred CounterAtLeastOneRing { some disj n0, n1, n2, n3: Node, disj e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11: Event | { lt[n0,n1] && lt[n1,n2] && lt[n2,n3] e0.post = e1.pre e1.post = e2.pre e2.post = e3.pre e3.post = e4.pre e4.post = e5.pre e5.post = e6.pre e6.post = e7.pre e7.post = e8.pre e8.post = e9.pre e9.post = e10.pre e10.post = e11.pre (let members0 = { n: Node | Member[n,trace/first] } | members0 = n0 && no members0.prdc.trace/first && no members0.succ2.trace/first ) e0 in Join && e0.node = n2 e1 in Stabilize && e1.node = n2 e2 in Notified && e2.node = n0 e3 in Stabilize && e3.node = n0 e4 in Notified && e4.node = n2 -- ring of size 2 e5 in Join && e5.node = n1 e6 in Stabilize && e6.node = n1 e7 in Notified && e7.node = n2 -- up to first snapshot of figure e8 in Fail && e8.node = n1 -- second e9 in Stabilize && e9.node = n0 e10 in Notified && e10.node = n1 e11 in Flush && e11.node = n2 -- third } } run CounterAtLeastOneRing for 1 but 4 Node, 12 Event, 13 Time -- Can only be instantiated with the bug fix in Stabilize removed. pred CounterAtMostOneRing { some disj n0, n1, n2, n3: Node, disj e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20: Event | { lt[n0,n1] && lt[n1,n2] && lt[n2,n3] e0.post = e1.pre e1.post = e2.pre e2.post = e3.pre e3.post = e4.pre e4.post = e5.pre e5.post = e6.pre e6.post = e7.pre e7.post = e8.pre e8.post = e9.pre e9.post = e10.pre e10.post = e11.pre e11.post = e12.pre e12.post = e13.pre e13.post = e14.pre e14.post = e15.pre e15.post = e16.pre e16.post = e17.pre e17.post = e18.pre e18.post = e19.pre e19.post = e20.pre (let members0 = { n: Node | Member[n,trace/first] } | members0 = n0 && no members0.prdc.trace/first && no members0.succ2.trace/first ) e0 in Join && e0.node = n2 e1 in Stabilize && e1.node = n2 e2 in Notified && e2.node = n0 e3 in Stabilize && e3.node = n0 e4 in Notified && e4.node = n2 e5 in Reconcile && e5.node = n0 e6 in Reconcile && e6.node = n2 -- up to first snapshot of figure e7 in Join && e7.node = n1 e8 in Stabilize && e8.node = n1 e9 in Notified && e9.node = n2 e10 in Stabilize && e10.node = n0 e11 in Notified && e11.node = n1 e12 in Join && e12.node = n3 e13 in Stabilize && e13.node = n3 e14 in Notified && e14.node = n0 e15 in Stabilize && e15.node = n2 e16 in Notified && e16.node = n3 -- up to second snapshot of figure e17 in Fail && e17.node = n1 e18 in Fail && e18.node = n3 e19 in Update && e19.node = n0 e20 in Update && e20.node = n2 -- last snapshot of figure } } run CounterAtMostOneRing for 1 but 4 Node, 21 Event, 22 Time -- The counterexample to OrderedRing is very similar, and is not modeled. ======================================================================== */ /* ======================================================================== VALIDATION OF CHANGE PREDICATES: all checked previously assert SSChangeWorksSequentially { all n, nSucc: Node | ( Valid[trace/first] && StabilizationWillChangeSuccessor[n,nSucc,trace/first] && (some s: Stabilize | s.node = n) ) => n.succ.trace/last = nSucc } check SSChangeWorksSequentially for 5 but 1 Event, 2 Time assert SPChangeWorksSequentially { all n, nSucc: Node | ( Valid[trace/first] && StabilizationShouldChangePredecessor[n,nSucc,trace/first] && (some s: Stabilize | s.node = n) ) => nSucc.prdc.trace/last = n } check SPChangeWorksSequentially for 5 but 2 Event, 3 Time assert RPChangeWorksSequentially { all n: Node | ( Valid[trace/first] && ReconciliationWillFlushPredecessor[n,trace/first] && (some f: Flush | f.node = n) ) => no n.prdc.trace/last } check RPChangeWorksSequentially for 5 but 1 Event, 2 Time assert RSChangeWorksSequentially { all n, nSucc: Node | ( Valid[trace/first] && ReconciliationWillChangeSuccessor[n,nSucc,trace/first] && (some u: Update | u.node = n) ) => n.succ.trace/last = nSucc } check RSChangeWorksSequentially for 5 but 1 Event, 2 Time assert RS2ChangeWorksSequentially { all n, nSucc2: Node | ( Valid[trace/first] && ReconciliationWillChangeSuccessor2[n,nSucc2,trace/first] && (some r: Reconcile | r.node = n) ) => n.succ2.trace/last = nSucc2 } check RS2ChangeWorksSequentially for 5 but 1 Event, 2 Time ======================================================================== */ /* ======================================================================== VALIDATION OF RING STRUCTURE: all checked previously pred NotOneOrderedRing [t: Time] { ! OneOrderedRing[t] && ConnectedAppendages[t] && AntecedentPredecessors[t] && OrderedAppendages[t] && OrderedMerges[t] && DistinctSuccessors[t] && OrderedSuccessors[t] && ValidSuccessorList[t] && ReachableSuccessor2[t] } run NotOneOrderedRing for 2 but 0 Event, 1 Time pred DisconnectedAppendage [t: Time] { OneOrderedRing[t] && ! ConnectedAppendages[t] && AntecedentPredecessors[t] && OrderedAppendages[t] && OrderedMerges[t] && DistinctSuccessors[t] && OrderedSuccessors[t] && ValidSuccessorList[t] && ReachableSuccessor2[t] } run DisconnectedAppendage for 3 but 0 Event, 1 Time pred NonAntecedentPredecessor [t: Time] { OneOrderedRing[t] && ConnectedAppendages[t] && ! AntecedentPredecessors[t] && OrderedAppendages[t] && OrderedMerges[t] && DistinctSuccessors[t] && OrderedSuccessors[t] && ValidSuccessorList[t] && ReachableSuccessor2[t] } run NonAntecedentPredecessor for 2 but 0 Event, 1 Time pred DisorderedAppendage [t: Time] { OneOrderedRing[t] && ConnectedAppendages[t] && AntecedentPredecessors[t] && ! OrderedAppendages[t] && OrderedMerges[t] && DistinctSuccessors[t] && OrderedSuccessors[t] && ValidSuccessorList[t] && ReachableSuccessor2[t] } run DisorderedAppendage for 3 but 0 Event, 1 Time pred DisorderedMerge [t: Time] { OneOrderedRing[t] && ConnectedAppendages[t] && AntecedentPredecessors[t] && OrderedAppendages[t] && ! OrderedMerges[t] && DistinctSuccessors[t] && OrderedSuccessors[t] && ValidSuccessorList[t] && ReachableSuccessor2[t] } run DisorderedMerge for 3 but 0 Event, 1 Time pred RedundantSuccessors [t: Time] { OneOrderedRing[t] && ConnectedAppendages[t] && AntecedentPredecessors[t] && OrderedAppendages[t] && OrderedMerges[t] && ! DistinctSuccessors[t] && OrderedSuccessors[t] && ValidSuccessorList[t] && ReachableSuccessor2[t] } run RedundantSuccessors for 2 but 0 Event, 1 Time pred DisorderedSuccessors [t: Time] { OneOrderedRing[t] && ConnectedAppendages[t] && AntecedentPredecessors[t] && OrderedAppendages[t] && OrderedMerges[t] && DistinctSuccessors[t] && ! OrderedSuccessors[t] && ValidSuccessorList[t] && ReachableSuccessor2[t] } run DisorderedSuccessors for 2 but 0 Event, 1 Time pred InvalidSuccessors [t: Time] { OneOrderedRing[t] && ConnectedAppendages[t] && AntecedentPredecessors[t] && OrderedAppendages[t] && OrderedMerges[t] && DistinctSuccessors[t] && OrderedSuccessors[t] && ! ValidSuccessorList[t] && ReachableSuccessor2[t] } run InvalidSuccessors for 4 but 0 Event, 1 Time pred ExternalSuccessor [t: Time] { OneOrderedRing[t] && ConnectedAppendages[t] && AntecedentPredecessors[t] && OrderedAppendages[t] && OrderedMerges[t] && DistinctSuccessors[t] && OrderedSuccessors[t] && ValidSuccessorList[t] && ! ReachableSuccessor2[t] } run ExternalSuccessor for 3 but 0 Event, 1 Time pred ValidRingWithOneMember [t: Time] { let members = { n: Node | Member[n,t] } | # members = 1 && Valid[t] && ! Ideal[t] } run ValidRingWithOneMember for 1 but 0 Event, 1 Time pred ValidRingWithTwoMembers [t: Time] { let members = { n: Node | Member[n,t] } | # members = 2 && Valid[t] && ! Ideal[t] } run ValidRingWithTwoMembers for 2 but 0 Event, 1 Time pred ValidRingWithThreeMembers [t: Time] { let members = { n: Node | Member[n,t] } | # members = 3 && Valid[t] && ! Ideal[t] } run ValidRingWithThreeMembers for 3 but 0 Event, 1 Time pred ValidRingWithFourMembers [t: Time] { let members = { n: Node | Member[n,t] } | # members = 4 && Valid[t] && ! Ideal[t] } run ValidRingWithFourMembers for 4 but 0 Event, 1 Time pred ValidRingWithFiveMembers [t: Time] { let members = { n: Node | Member[n,t] } | # members = 5 && Valid[t] && ! Ideal[t] } run ValidRingWithFiveMembers for 5 but 0 Event, 1 Time pred ValidRingWithSixMembers [t: Time] { let members = { n: Node | Member[n,t] } | # members = 6 && Valid[t] && ! Ideal[t] } run ValidRingWithSixMembers for 6 but 0 Event, 1 Time pred UnStable [t: Time] { Valid[t] && ! Stable[t] && Reconciled[t] } run UnStable for 3 but 0 Event, 1 Time pred UnReconciled [t: Time] { Valid[t] && Stable[t] && ! Reconciled[t] } run UnReconciled for 1 but 0 Event, 1 Time pred IdealRingWithThreeMembers [t: Time] { let members = { n: Node | Member[n,t] } | # members = 3 && Ideal[t] } run IdealRingWithThreeMembers for 3 but 0 Event, 1 Time pred IdealRingWithFourMembers [t: Time] { let members = { n: Node | Member[n,t] } | # members = 4 && Ideal[t] } run IdealRingWithFourMembers for 4 but 0 Event, 1 Time pred IdealRingWithFiveMembers [t: Time] { let members = { n: Node | Member[n,t] } | # members = 5 && Ideal[t] } run IdealRingWithFiveMembers for 5 but 0 Event, 1 Time pred IdealRingWithSixMembers [t: Time] { let members = { n: Node | Member[n,t] } | # members = 6 && Ideal[t] } run IdealRingWithSixMembers for 6 but 0 Event, 1 Time ======================================================================== */
alloy4fun_models/trashltl/models/9/pL9wHh47Khn2jgXmF.als
Kaixi26/org.alloytools.alloy
0
1468
open main pred idpL9wHh47Khn2jgXmF_prop10 { always all f: File | f in Protected since f in Protected } pred __repair { idpL9wHh47Khn2jgXmF_prop10 } check __repair { idpL9wHh47Khn2jgXmF_prop10 <=> prop10o }
runtime/src/exc_engine/x64/cookie.asm
Shtan7/KTL
38
16839
<filename>runtime/src/exc_engine/x64/cookie.asm ; Licensed under the MIT License <http://opensource.org/licenses/MIT>. ; Copyright (c) <NAME> aka Dym93OK extern report_security_check_failure: proc extern __security_cookie: qword .code __security_check_cookie proc public cmp rcx, __security_cookie bnd jnz short ReportFailure rol rcx, 10h test cx, 0FFFFh bnd jnz short RestoreRcx ret RestoreRcx: ror rcx, 10h ReportFailure: jmp report_security_check_failure __security_check_cookie endp end
test/Fail/Issue585t.agda
cruhland/agda
1,989
151
<filename>test/Fail/Issue585t.agda -- Andreas, 2012-03-13 module Issue585t where postulate A : Set a : A -- just so that A is not empty and the constraints are solvable -- however, Agda picks the wrong solution data B : Set where inn : A -> B out : B -> A out (inn a) = a postulate P : (y : A) (z : B) → Set p : (x : B) → P (out x) x mutual d : B d = inn _ -- Y g : P (out d) d g = p _ -- X -- Agda previously solved d = inn (out d) -- -- out X = out d = out (inn Y) = Y -- X = d -- -- Now this does not pass the occurs check, so unsolved metas should remain.
source/a-stbltr.adb
ytomino/drake
33
21161
<reponame>ytomino/drake<filename>source/a-stbltr.adb<gh_stars>10-100 with Ada.Exception_Identification.From_Here; package body Ada.Streams.Block_Transmission is pragma Suppress (All_Checks); use Exception_Identification.From_Here; procedure Read ( Stream : not null access Root_Stream_Type'Class; Item : out Array_Type) is begin if Element_Type'Size = Element_Type'Stream_Size and then Array_Type'Component_Size = Element_Type'Stream_Size then declare Item_As_SEA : Stream_Element_Array ( 1 .. (Element_Type'Stream_Size / Stream_Element'Size) * Item'Length); for Item_As_SEA'Address use Item'Address; begin Stream_Element_Arrays.Read (Stream, Item_As_SEA); end; else Array_Type'Read (Stream, Item); end if; end Read; procedure Write ( Stream : not null access Root_Stream_Type'Class; Item : Array_Type) is begin if Element_Type'Size = Element_Type'Stream_Size and then Array_Type'Component_Size = Element_Type'Stream_Size then declare Item_As_SEA : Stream_Element_Array ( 1 .. (Element_Type'Stream_Size / Stream_Element'Size) * Item'Length); for Item_As_SEA'Address use Item'Address; begin Stream_Element_Arrays.Write (Stream, Item_As_SEA); end; else Array_Type'Write (Stream, Item); end if; end Write; function Input ( Stream : not null access Root_Stream_Type'Class) return Array_Type is First, Last : Index_Type'Base; begin Index_Type'Base'Read (Stream, First); Index_Type'Base'Read (Stream, Last); if First < Index_Type'First or else Last > Index_Type'Last then Raise_Exception (Data_Error'Identity); end if; return Result : Array_Type (First .. Last) do Read (Stream, Result); end return; end Input; procedure Output ( Stream : not null access Root_Stream_Type'Class; Item : Array_Type) is begin Index_Type'Write (Stream, Item'First); Index_Type'Write (Stream, Item'Last); Write (Stream, Item); end Output; package body Stream_Element_Arrays is procedure Read ( Stream : not null access Root_Stream_Type'Class; Item : out Stream_Element_Array) is I : Stream_Element_Offset := Item'First; begin if I <= Item'Last then loop declare Last : Stream_Element_Offset; begin Streams.Read (Stream.all, Item (I .. Item'Last), Last); exit when Last >= Item'Last; if Last < I then Raise_Exception (End_Error'Identity); end if; I := Last + 1; end; end loop; end if; end Read; procedure Write ( Stream : not null access Root_Stream_Type'Class; Item : Stream_Element_Array) is begin Streams.Write (Stream.all, Item); end Write; end Stream_Element_Arrays; end Ada.Streams.Block_Transmission;
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_608.asm
ljhsiun2/medusa
9
19839
<filename>Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_608.asm .global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %rax push %rbx push %rcx push %rdx push %rsi lea addresses_UC_ht+0xf2c5, %rdx clflush (%rdx) nop nop nop add %rcx, %rcx movb $0x61, (%rdx) nop add $45057, %rax lea addresses_WC_ht+0x17db, %rsi nop nop nop and %rbx, %rbx mov $0x6162636465666768, %r13 movq %r13, (%rsi) nop nop nop nop nop xor $54697, %rbx lea addresses_WC_ht+0x12690, %rbx and %r14, %r14 movb $0x61, (%rbx) nop nop xor %r14, %r14 lea addresses_normal_ht+0x616d, %rbx clflush (%rbx) add %rax, %rax movb $0x61, (%rbx) cmp %rdx, %rdx lea addresses_WT_ht+0x13885, %rdx nop add $45504, %rsi movups (%rdx), %xmm4 vpextrq $0, %xmm4, %r13 nop nop nop nop sub $3389, %rbx lea addresses_UC_ht+0x6685, %rbx nop cmp %rax, %rax movups (%rbx), %xmm2 vpextrq $0, %xmm2, %r13 nop nop add %rcx, %rcx lea addresses_UC_ht+0x12885, %rax nop nop cmp $57656, %rdx mov $0x6162636465666768, %r14 movq %r14, %xmm4 vmovups %ymm4, (%rax) nop nop xor $15629, %rsi pop %rsi pop %rdx pop %rcx pop %rbx pop %rax pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r13 push %r14 push %r8 // Faulty Load lea addresses_WT+0x1e085, %r11 clflush (%r11) nop and $49200, %r8 mov (%r11), %r14d lea oracles, %r10 and $0xff, %r14 shlq $12, %r14 mov (%r10,%r14,1), %r14 pop %r8 pop %r14 pop %r13 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8}} {'39': 21829} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
programs/oeis/160/A160538.asm
neoneye/loda
22
15454
; A160538: a(n) = 4*(n^4-n^3). ; 0,32,216,768,2000,4320,8232,14336,23328,36000,53240,76032,105456,142688,189000,245760,314432,396576,493848,608000,740880,894432,1070696,1271808,1500000,1757600,2047032,2370816,2731568,3132000 mov $1,$0 add $1,1 pow $1,3 mul $0,$1 div $0,2 mul $0,8
HlslDecompiler.Tests/ShaderAssembly/vs_matrix44_vector4_multiply.asm
TBirdSoars/HlslDecompiler
20
174387
vs_3_0 def c4, 5, 2, 3, 4 dcl_position v0 dcl_position o0 dcl_position1 o1 dcl_position2 o2 dcl_position3 o3 mul r0, c1, v0.y mad r0, c0, v0.x, r0 mad r0, c2, v0.z, r0 mad o0, c3, v0.w, r0 mul r0, c1, v0.x mad r0, c0, v0.y, r0 mad r0, c2, v0.z, r0 mad o1, c3, v0.w, r0 mul r0, c1, v0.x_abs mad r0, c0, v0.y_abs, r0 mad r0, c2, v0.z_abs, r0 mad o2, c3, v0.w_abs, r0 mul r0, c4, v0 mul r1, r0.y, c1 mad r1, c0, r0.x, r1 mad r1, c2, r0.z, r1 mad o3, c3, r0.w, r1
programs/oeis/095/A095374.asm
jmorken/loda
1
85820
; A095374: One less than the number of divisors of 2*n + 1. ; 1,1,1,2,1,1,3,1,1,3,1,2,3,1,1,3,3,1,3,1,1,5,1,2,3,1,3,3,1,1,5,3,1,3,1,1,5,3,1,4,1,3,3,1,3,3,3,1,5,1,1,7,1,1,3,1,3,5,3,2,3,3,1,3,1,3,7,1,1,3,3,3,5,1,1,5,3,1,3,3,1,7,1,2,5,1,5,3,1,1,3,3,3,7,1,1,7,1,1,3,3,3,5,3,1,3,3,3,3,3,1,8,1,1,7,1,3,3,1,1,5,5,3,3,1,3,7,1,3,5,1,3,3,1,1,7,5,1,5,1,1,7,3,2,3,1,3,7,3,3,3,3,1,3,1,1,11,1,3,3,3,5,3,3,1,5,3,1,3,3,3,7,1,1,7,1,3,7,1,2,5,3,1,5,3,1,7,3,1,3,1,7,5,1,3,3,3,1,7,1,3,9,3,1,3,3,3,3,1,1,5,5,3,7,1,1,7,3,1,8,1,3,3,1,3,3,7,1,7,1,1,7,1,3,3,3,5,5,1,3,7,3,1,3,1,3,11,3,1,3 add $0,1 mul $0,2 cal $0,1227 ; Number of odd divisors of n. mul $0,2 mov $1,$0 sub $1,4 div $1,2 add $1,1
Examples/pointer tester.asm
cubed-guy/ice
3
240470
extern _printf extern _malloc global _main segment .bss $pointer: resd 1 segment .data _p: db `%u\n`, 0 _c: db 0, 0 _ln: db 0, 10, 0 segment .text _main: ;2: pointer = 5 push 1 call _malloc mov dword [$pointer], eax mov byte [eax], 5 ;3: printnum(pointer) xor eax, eax xor eax, dword [$pointer] push eax push _p call _printf add esp, 8
llvm-gcc-4.2-2.9/gcc/ada/a-exexpr.adb
vidkidz/crossbridge
1
3604
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- A D A . E X C E P T I O N S . E X C E P T I O N _ P R O P A G A T I O N -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2006 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This is the default version, using the __builtin_setjmp/longjmp EH -- mechanism. with System.Storage_Elements; use System.Storage_Elements; pragma Warnings (Off); -- Since several constructs give warnings in 3.14a1, including unreferenced -- variables and pragma Unreferenced itself. separate (Ada.Exceptions) package body Exception_Propagation is procedure builtin_longjmp (buffer : Address; Flag : Integer); pragma No_Return (builtin_longjmp); pragma Import (C, builtin_longjmp, "_gnat_builtin_longjmp"); --------------------- -- Setup_Exception -- --------------------- procedure Setup_Exception (Excep : EOA; Current : EOA; Reraised : Boolean := False) is pragma Unreferenced (Excep, Current, Reraised); begin -- In the GNAT-SJLJ case this "stack" only exists implicitely, by way of -- local occurrence declarations together with save/restore operations -- generated by the front-end, and this routine has nothing to do. null; end Setup_Exception; ------------------------- -- Propagate_Exception -- ------------------------- procedure Propagate_Exception (E : Exception_Id; From_Signal_Handler : Boolean) is pragma Inspection_Point (E); Jumpbuf_Ptr : constant Address := Get_Jmpbuf_Address.all; Excep : constant EOA := Get_Current_Excep.all; begin -- Compute the backtrace for this occurrence if corresponding binder -- option has been set. Call_Chain takes care of the reraise case. Call_Chain (Excep); -- Note on above call to Call_Chain: -- We used to only do this if From_Signal_Handler was not set, -- based on the assumption that backtracing from a signal handler -- would not work due to stack layout oddities. However, since -- 1. The flag is never set in tasking programs (Notify_Exception -- performs regular raise statements), and -- 2. No problem has shown up in tasking programs around here so -- far, this turned out to be too strong an assumption. -- As, in addition, the test was -- 1. preventing the production of backtraces in non-tasking -- programs, and -- 2. introducing a behavior inconsistency between -- the tasking and non-tasking cases, -- we have simply removed it -- If the jump buffer pointer is non-null, transfer control using -- it. Otherwise announce an unhandled exception (note that this -- means that we have no finalizations to do other than at the outer -- level). Perform the necessary notification tasks in both cases. if Jumpbuf_Ptr /= Null_Address then if not Excep.Exception_Raised then Excep.Exception_Raised := True; Exception_Traces.Notify_Handled_Exception; end if; builtin_longjmp (Jumpbuf_Ptr, 1); else Exception_Traces.Notify_Unhandled_Exception; Exception_Traces.Unhandled_Exception_Terminate; end if; end Propagate_Exception; end Exception_Propagation;
test/Succeed/Issue5731.agda
sseefried/agda
1
5309
-- This file just tests that the options --no-save-metas and -- --save-metas are parsed correctly. {-# OPTIONS --no-save-metas --save-metas #-}
Univalence/PiEquiv.agda
JacquesCarette/pi-dual
14
5366
{-# OPTIONS --without-K #-} module PiEquiv where open import Data.Empty open import Data.Unit open import Data.Sum using (_⊎_; inj₁; inj₂) open import Data.Product using (_×_; Σ; _,_; proj₁; proj₂) open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; trans; cong; cong₂) open import Function using (_∘_; id) open import Equiv open import EquivEquiv open _≋_ open import TypeEquiv as TE open import TypeEquivEquiv -- open import TypeEquivCat open import PiU open import PiLevel0 open import PiLevel1 open import Data.Sum.Properties2 open import Data.SumProd.Properties ------------------------------------------------------------------------------ -- A combinator t₁ ⟷ t₂ denotes an equivalence to types -- note how we don't have to look at the types at all. ⟦_⟧ : U → Set ⟦ ZERO ⟧ = ⊥ ⟦ ONE ⟧ = ⊤ ⟦ PLUS t₁ t₂ ⟧ = ⟦ t₁ ⟧ ⊎ ⟦ t₂ ⟧ ⟦ TIMES t₁ t₂ ⟧ = ⟦ t₁ ⟧ × ⟦ t₂ ⟧ eval : {t₁ t₂ : U} → (t₁ ⟷ t₂) → ⟦ t₁ ⟧ → ⟦ t₂ ⟧ eval unite₊l (inj₁ ()) eval unite₊l (inj₂ v) = v eval uniti₊l v = inj₂ v eval unite₊r (inj₁ x) = x eval unite₊r (inj₂ ()) eval uniti₊r v = inj₁ v eval swap₊ (inj₁ v) = inj₂ v eval swap₊ (inj₂ v) = inj₁ v eval assocl₊ (inj₁ v) = inj₁ (inj₁ v) eval assocl₊ (inj₂ (inj₁ v)) = inj₁ (inj₂ v) eval assocl₊ (inj₂ (inj₂ v)) = inj₂ v eval assocr₊ (inj₁ (inj₁ v)) = inj₁ v eval assocr₊ (inj₁ (inj₂ v)) = inj₂ (inj₁ v) eval assocr₊ (inj₂ v) = inj₂ (inj₂ v) eval unite⋆l (tt , v) = v eval uniti⋆l v = (tt , v) eval unite⋆r (v , tt) = v eval uniti⋆r v = v , tt eval swap⋆ (v₁ , v₂) = (v₂ , v₁) eval assocl⋆ (v₁ , (v₂ , v₃)) = ((v₁ , v₂) , v₃) eval assocr⋆ ((v₁ , v₂) , v₃) = (v₁ , (v₂ , v₃)) eval absorbr (x , _) = x eval absorbl (_ , y) = y eval factorzl () eval factorzr () eval dist (inj₁ v₁ , v₃) = inj₁ (v₁ , v₃) eval dist (inj₂ v₂ , v₃) = inj₂ (v₂ , v₃) eval factor (inj₁ (v₁ , v₃)) = (inj₁ v₁ , v₃) eval factor (inj₂ (v₂ , v₃)) = (inj₂ v₂ , v₃) eval distl (v , inj₁ x) = inj₁ (v , x) eval distl (v , inj₂ y) = inj₂ (v , y) eval factorl (inj₁ (x , y)) = x , inj₁ y eval factorl (inj₂ (x , y)) = x , inj₂ y eval id⟷ v = v eval (c₁ ◎ c₂) v = eval c₂ (eval c₁ v) eval (c₁ ⊕ c₂) (inj₁ v) = inj₁ (eval c₁ v) eval (c₁ ⊕ c₂) (inj₂ v) = inj₂ (eval c₂ v) eval (c₁ ⊗ c₂) (v₁ , v₂) = (eval c₁ v₁ , eval c₂ v₂) -- useful to have the backwards eval too evalB : {t₁ t₂ : U} → (t₁ ⟷ t₂) → ⟦ t₂ ⟧ → ⟦ t₁ ⟧ evalB unite₊l x = inj₂ x evalB uniti₊l (inj₁ ()) evalB uniti₊l (inj₂ y) = y evalB unite₊r v = inj₁ v evalB uniti₊r (inj₁ x) = x evalB uniti₊r (inj₂ ()) evalB swap₊ (inj₁ x) = inj₂ x evalB swap₊ (inj₂ y) = inj₁ y evalB assocl₊ (inj₁ (inj₁ x)) = inj₁ x evalB assocl₊ (inj₁ (inj₂ y)) = inj₂ (inj₁ y) evalB assocl₊ (inj₂ y) = inj₂ (inj₂ y) evalB assocr₊ (inj₁ x) = inj₁ (inj₁ x) evalB assocr₊ (inj₂ (inj₁ x)) = inj₁ (inj₂ x) evalB assocr₊ (inj₂ (inj₂ y)) = inj₂ y evalB unite⋆l x = tt , x evalB uniti⋆l (tt , x) = x evalB unite⋆r v = v , tt evalB uniti⋆r (v , tt) = v evalB swap⋆ (x , y) = y , x evalB assocl⋆ ((x , y) , z) = x , y , z evalB assocr⋆ (x , y , z) = (x , y) , z evalB absorbr () evalB absorbl () evalB factorzr (_ , x) = x evalB factorzl (x , _) = x evalB dist (inj₁ (x , y)) = inj₁ x , y evalB dist (inj₂ (x , y)) = inj₂ x , y evalB factor (inj₁ x , z) = inj₁ (x , z) evalB factor (inj₂ y , z) = inj₂ (y , z) evalB distl (inj₁ (x , y)) = x , inj₁ y evalB distl (inj₂ (x , y)) = x , inj₂ y evalB factorl (v , inj₁ x) = inj₁ (v , x) evalB factorl (v , inj₂ y) = inj₂ (v , y) evalB id⟷ x = x evalB (c₀ ◎ c₁) x = evalB c₀ (evalB c₁ x) evalB (c₀ ⊕ c₁) (inj₁ x) = inj₁ (evalB c₀ x) evalB (c₀ ⊕ c₁) (inj₂ y) = inj₂ (evalB c₁ y) evalB (c₀ ⊗ c₁) (x , y) = evalB c₀ x , evalB c₁ y -- should probably prove that these are inverses! -- to a certain extent, no need, because here's -- the right way to do it: c2equiv : {t₁ t₂ : U} → (c : t₁ ⟷ t₂) → ⟦ t₁ ⟧ ≃ ⟦ t₂ ⟧ c2equiv unite₊l = TE.unite₊equiv c2equiv uniti₊l = TE.uniti₊equiv c2equiv unite₊r = TE.unite₊′equiv c2equiv uniti₊r = TE.uniti₊′equiv c2equiv swap₊ = TE.swap₊equiv c2equiv assocl₊ = TE.assocl₊equiv c2equiv assocr₊ = TE.assocr₊equiv c2equiv unite⋆l = TE.unite⋆equiv c2equiv uniti⋆l = TE.uniti⋆equiv c2equiv unite⋆r = TE.unite⋆′equiv c2equiv uniti⋆r = TE.uniti⋆′equiv c2equiv swap⋆ = TE.swap⋆equiv c2equiv assocl⋆ = TE.assocl⋆equiv c2equiv assocr⋆ = TE.assocr⋆equiv c2equiv absorbr = TE.distzequiv c2equiv absorbl = TE.distzrequiv c2equiv factorzr = TE.factorzrequiv c2equiv factorzl = TE.factorzequiv c2equiv dist = TE.distequiv c2equiv factor = TE.factorequiv c2equiv distl = TE.distlequiv c2equiv factorl = TE.factorlequiv c2equiv id⟷ = id≃ c2equiv (c ◎ c₁) = c2equiv c₁ ● c2equiv c c2equiv (c ⊕ c₁) = (c2equiv c) ⊎≃ (c2equiv c₁) c2equiv (c ⊗ c₁) = (c2equiv c) ×≃ (c2equiv c₁) -- and these are 'coherent' -- first with evaluation: lemma0 : {t₁ t₂ : U} → (c : t₁ ⟷ t₂) → (v : ⟦ t₁ ⟧) → eval c v ≡ proj₁ (c2equiv c) v lemma0 unite₊l (inj₁ ()) lemma0 unite₊l (inj₂ y) = refl lemma0 uniti₊l v = refl lemma0 unite₊r (inj₁ x) = refl lemma0 unite₊r (inj₂ ()) lemma0 uniti₊r v = refl lemma0 PiLevel0.swap₊ (inj₁ x) = refl lemma0 PiLevel0.swap₊ (inj₂ y) = refl lemma0 PiLevel0.assocl₊ (inj₁ x) = refl lemma0 PiLevel0.assocl₊ (inj₂ (inj₁ x)) = refl lemma0 PiLevel0.assocl₊ (inj₂ (inj₂ y)) = refl lemma0 PiLevel0.assocr₊ (inj₁ (inj₁ x)) = refl lemma0 PiLevel0.assocr₊ (inj₁ (inj₂ y)) = refl lemma0 PiLevel0.assocr₊ (inj₂ y) = refl lemma0 unite⋆l v = refl -- yay for η ! lemma0 uniti⋆l v = refl lemma0 unite⋆r v = refl lemma0 uniti⋆r v = refl lemma0 PiLevel0.swap⋆ v = refl lemma0 PiLevel0.assocl⋆ v = refl lemma0 PiLevel0.assocr⋆ v = refl lemma0 absorbr v = refl lemma0 absorbl v = refl lemma0 factorzr () lemma0 factorzl () lemma0 PiLevel0.dist (inj₁ x , proj₂) = refl lemma0 PiLevel0.dist (inj₂ y , proj₂) = refl lemma0 PiLevel0.factor (inj₁ x) = refl lemma0 PiLevel0.factor (inj₂ y) = refl lemma0 PiLevel0.distl (proj₁ , inj₁ x) = refl lemma0 PiLevel0.distl (proj₁ , inj₂ y) = refl lemma0 PiLevel0.factorl (inj₁ x) = refl lemma0 PiLevel0.factorl (inj₂ y) = refl lemma0 id⟷ v = refl lemma0 (c ◎ c₁) v = trans (cong (eval c₁) (lemma0 c v)) ( trans (lemma0 c₁ (proj₁ (c2equiv c) v)) (sym (β₁ v))) lemma0 (c ⊕ c₁) (inj₁ x) = trans (cong inj₁ (lemma0 c x)) (sym (β⊎₁ (inj₁ x))) lemma0 (c ⊕ c₁) (inj₂ y) = trans (cong inj₂ (lemma0 c₁ y)) (sym (β⊎₁ (inj₂ y))) lemma0 (c ⊗ c₁) (x , y) = trans (cong₂ _,_ (lemma0 c x) (lemma0 c₁ y)) (sym (β×₁ (x , y))) lemma1 : {t₁ t₂ : U} → (c : t₁ ⟷ t₂) → (v : ⟦ t₂ ⟧) → evalB c v ≡ proj₁ (sym≃ (c2equiv c)) v lemma1 PiLevel0.unite₊l v = refl lemma1 PiLevel0.uniti₊l (inj₁ ()) lemma1 PiLevel0.uniti₊l (inj₂ y) = refl lemma1 PiLevel0.unite₊r v = refl lemma1 uniti₊r (inj₁ x) = refl lemma1 uniti₊r (inj₂ ()) lemma1 PiLevel0.swap₊ (inj₁ x) = refl lemma1 PiLevel0.swap₊ (inj₂ y) = refl lemma1 PiLevel0.assocl₊ (inj₁ (inj₁ x)) = refl lemma1 PiLevel0.assocl₊ (inj₁ (inj₂ y)) = refl lemma1 PiLevel0.assocl₊ (inj₂ y) = refl lemma1 PiLevel0.assocr₊ (inj₁ x) = refl lemma1 PiLevel0.assocr₊ (inj₂ (inj₁ x)) = refl lemma1 PiLevel0.assocr₊ (inj₂ (inj₂ y)) = refl lemma1 PiLevel0.unite⋆l v = refl lemma1 PiLevel0.uniti⋆l (tt , x) = refl lemma1 PiLevel0.unite⋆r v = refl lemma1 uniti⋆r (x , tt) = refl lemma1 PiLevel0.swap⋆ (x , y) = refl lemma1 PiLevel0.assocl⋆ ((x , y) , z) = refl lemma1 PiLevel0.assocr⋆ (x , y , z) = refl lemma1 absorbr () lemma1 absorbl () lemma1 PiLevel0.factorzr (_ , ()) lemma1 factorzl (() , v) lemma1 PiLevel0.dist (inj₁ (proj₁ , proj₂)) = refl lemma1 PiLevel0.dist (inj₂ (proj₁ , proj₂)) = refl lemma1 PiLevel0.factor (inj₁ x , proj₂) = refl lemma1 PiLevel0.factor (inj₂ y , proj₂) = refl lemma1 PiLevel0.distl (inj₁ (proj₁ , proj₂)) = refl lemma1 PiLevel0.distl (inj₂ (proj₁ , proj₂)) = refl lemma1 PiLevel0.factorl (v , inj₁ x) = refl lemma1 PiLevel0.factorl (v , inj₂ y) = refl lemma1 id⟷ v = refl lemma1 (c₀ ◎ c₁) v = trans ( trans (cong (evalB c₀) (lemma1 c₁ v)) (lemma1 c₀ (gg (c2equiv c₁) v)) ) (sym (β₂ v)) lemma1 (c₀ ⊕ c₁) (inj₁ x) = trans (cong inj₁ (lemma1 c₀ x)) (sym (β⊎₂ (inj₁ x))) -- cong inj₁ (lemma1 c₀ x) lemma1 (c₀ ⊕ c₁) (inj₂ y) = trans (cong inj₂ (lemma1 c₁ y)) (sym (β⊎₂ (inj₂ y))) lemma1 (c₀ ⊗ c₁) (x , y) = trans (cong₂ _,_ (lemma1 c₀ x) (lemma1 c₁ y)) (sym (β×₂ (x , y))) -- and with reverse !≡sym≃ : {t₁ t₂ : U} → (c : t₁ ⟷ t₂) → c2equiv (! c) ≋ sym≃ (c2equiv c) !≡sym≃ unite₊l = id≋ !≡sym≃ uniti₊l = id≋ !≡sym≃ unite₊r = id≋ !≡sym≃ uniti₊r = id≋ !≡sym≃ PiLevel0.swap₊ = id≋ !≡sym≃ PiLevel0.assocl₊ = id≋ !≡sym≃ PiLevel0.assocr₊ = id≋ !≡sym≃ unite⋆l = id≋ !≡sym≃ uniti⋆l = id≋ !≡sym≃ unite⋆r = id≋ !≡sym≃ uniti⋆r = id≋ !≡sym≃ PiLevel0.swap⋆ = id≋ !≡sym≃ PiLevel0.assocl⋆ = id≋ !≡sym≃ PiLevel0.assocr⋆ = id≋ !≡sym≃ absorbr = id≋ !≡sym≃ absorbl = id≋ !≡sym≃ PiLevel0.factorzr = id≋ !≡sym≃ factorzl = id≋ !≡sym≃ PiLevel0.dist = id≋ !≡sym≃ PiLevel0.factor = id≋ !≡sym≃ PiLevel0.distl = id≋ !≡sym≃ PiLevel0.factorl = id≋ !≡sym≃ id⟷ = id≋ !≡sym≃ (c ◎ c₁) = trans≋ (EquivEquiv._◎_ (!≡sym≃ c) (!≡sym≃ c₁)) (sym≋ sym≃●) !≡sym≃ (c ⊕ c₁) = trans≋ ((!≡sym≃ c) ⊎≋ (!≡sym≃ c₁)) (sym≋ sym≃-distrib⊎) !≡sym≃ (c ⊗ c₁) = trans≋ ((!≡sym≃ c) ×≋ (!≡sym≃ c₁)) (sym≋ sym≃-distrib×) left-inv : {t₁ t₂ : U} (c : t₁ ⟷ t₂) → (c2equiv (! c) ● c2equiv c) ≋ id≃ left-inv c = let p = c2equiv c in trans≋ (!≡sym≃ c EquivEquiv.◎ id≋) (linv≋ p) right-inv : {t₁ t₂ : U} (c : t₁ ⟷ t₂) → (c2equiv c ● c2equiv (! c)) ≋ id≃ right-inv c = let p = c2equiv c in trans≋ (id≋ EquivEquiv.◎ (!≡sym≃ c)) (rinv≋ p) ---------------------------------------------------------- cc2equiv : {t₁ t₂ : U} {c₁ c₂ : t₁ ⟷ t₂} (ce : c₁ ⇔ c₂) → c2equiv c₁ ≋ c2equiv c₂ cc2equiv assoc◎l = ●-assoc cc2equiv assoc◎r = ●-assocl cc2equiv assocl⊕l = assocl₊-nat cc2equiv assocl⊕r = sym≋ assocl₊-nat cc2equiv assocl⊗l = assocl⋆-nat cc2equiv assocl⊗r = sym≋ assocl⋆-nat cc2equiv assocr⊕r = assocr₊-nat cc2equiv assocr⊗l = sym≋ assocr⋆-nat cc2equiv assocr⊗r = assocr⋆-nat cc2equiv assocr⊕l = sym≋ assocr₊-nat cc2equiv dist⇔l = dist-nat cc2equiv dist⇔r = sym≋ dist-nat cc2equiv distl⇔l = distl-nat cc2equiv distl⇔r = sym≋ distl-nat cc2equiv factor⇔l = factor-nat cc2equiv factor⇔r = sym≋ factor-nat cc2equiv factorl⇔l = factorl-nat cc2equiv factorl⇔r = sym≋ factorl-nat cc2equiv idl◎l = rid≋ cc2equiv idl◎r = sym≋ rid≋ cc2equiv idr◎l = lid≋ cc2equiv idr◎r = sym≋ lid≋ cc2equiv (linv◎l {c = c}) = left-inv c cc2equiv (linv◎r {c = c}) = sym≋ (left-inv c) cc2equiv (rinv◎l {c = c}) = right-inv c cc2equiv (rinv◎r {c = c}) = sym≋ (right-inv c) cc2equiv (unite₊l⇔l {c₁ = c₁} {c₂}) = sym≋ (unite₊-nat {f = c2equiv c₂}) cc2equiv unite₊l⇔r = unite₊-nat cc2equiv uniti₊l⇔l = sym≋ uniti₊-nat cc2equiv uniti₊l⇔r = uniti₊-nat cc2equiv unite₊r⇔l = sym≋ unite₊′-nat cc2equiv unite₊r⇔r = unite₊′-nat cc2equiv uniti₊r⇔l = sym≋ uniti₊′-nat cc2equiv uniti₊r⇔r = uniti₊′-nat cc2equiv swapl₊⇔ = sym≋ swap₊-nat cc2equiv swapr₊⇔ = swap₊-nat cc2equiv unitel⋆⇔l = sym≋ unite⋆-nat cc2equiv uniter⋆⇔l = unite⋆-nat cc2equiv unitil⋆⇔l = sym≋ uniti⋆-nat cc2equiv unitir⋆⇔l = uniti⋆-nat cc2equiv unitel⋆⇔r = sym≋ unite⋆′-nat cc2equiv uniter⋆⇔r = unite⋆′-nat cc2equiv unitil⋆⇔r = sym≋ uniti⋆′-nat cc2equiv unitir⋆⇔r = uniti⋆′-nat cc2equiv swapl⋆⇔ = sym≋ swap⋆-nat cc2equiv swapr⋆⇔ = swap⋆-nat cc2equiv id⇔ = id≋ cc2equiv (trans⇔ ce ce₁) = trans≋ (cc2equiv ce) (cc2equiv ce₁) cc2equiv (ce ⊡ ce₁) = (cc2equiv ce₁) EquivEquiv.◎ (cc2equiv ce) cc2equiv (resp⊕⇔ ce ce₁) = cc2equiv ce ⊎≋ cc2equiv ce₁ cc2equiv (resp⊗⇔ ce ce₁) = cc2equiv ce ×≋ cc2equiv ce₁ cc2equiv id⟷⊕id⟷⇔ = [id,id]≋id cc2equiv split⊕-id⟷ = sym≋ [id,id]≋id cc2equiv hom⊕◎⇔ = ⊎●≋●⊎ cc2equiv hom◎⊕⇔ = sym≋ ⊎●≋●⊎ cc2equiv id⟷⊗id⟷⇔ = id×id≋id cc2equiv split⊗-id⟷ = sym≋ id×id≋id cc2equiv hom⊗◎⇔ = ×●≋●× cc2equiv hom◎⊗⇔ = sym≋ ×●≋●× cc2equiv triangle⊕l = unite-assocr₊-coh cc2equiv triangle⊕r = sym≋ unite-assocr₊-coh cc2equiv triangle⊗l = unite-assocr⋆-coh cc2equiv triangle⊗r = sym≋ unite-assocr⋆-coh cc2equiv unite₊l-coh-l = unite₊l-coh cc2equiv unite₊l-coh-r = sym≋ unite₊l-coh cc2equiv unite⋆l-coh-l = unite⋆l-coh cc2equiv unite⋆l-coh-r = sym≋ unite⋆l-coh cc2equiv pentagon⊕l = assocr₊-coh cc2equiv pentagon⊕r = sym≋ assocr₊-coh cc2equiv pentagon⊗l = assocr⋆-coh cc2equiv pentagon⊗r = sym≋ assocr⋆-coh cc2equiv hexagonr⊕l = assocr₊-swap₊-coh cc2equiv hexagonr⊕r = sym≋ assocr₊-swap₊-coh cc2equiv hexagonl⊕l = assocl₊-swap₊-coh cc2equiv hexagonl⊕r = sym≋ assocl₊-swap₊-coh cc2equiv hexagonr⊗l = assocr⋆-swap⋆-coh cc2equiv hexagonr⊗r = sym≋ assocr⋆-swap⋆-coh cc2equiv hexagonl⊗l = assocl⋆-swap⋆-coh cc2equiv hexagonl⊗r = sym≋ assocl⋆-swap⋆-coh cc2equiv absorbl⇔l = distzr-nat cc2equiv absorbl⇔r = sym≋ distzr-nat cc2equiv absorbr⇔l = distz-nat cc2equiv absorbr⇔r = sym≋ distz-nat cc2equiv factorzl⇔l = factorz-nat cc2equiv factorzl⇔r = sym≋ factorz-nat cc2equiv factorzr⇔l = factorzr-nat cc2equiv factorzr⇔r = sym≋ factorzr-nat cc2equiv swap₊distl⇔l = A×[B⊎C]≃[A×C]⊎[A×B] cc2equiv swap₊distl⇔r = sym≋ A×[B⊎C]≃[A×C]⊎[A×B] cc2equiv dist-swap⋆⇔l = [A⊎B]×C≃[C×A]⊎[C×B] cc2equiv dist-swap⋆⇔r = sym≋ [A⊎B]×C≃[C×A]⊎[C×B] cc2equiv assocl₊-dist-dist⇔l = [A⊎B⊎C]×D≃[A×D⊎B×D]⊎C×D cc2equiv assocl₊-dist-dist⇔r = sym≋ [A⊎B⊎C]×D≃[A×D⊎B×D]⊎C×D cc2equiv assocl⋆-distl⇔l = A×B×[C⊎D]≃[A×B]×C⊎[A×B]×D cc2equiv assocl⋆-distl⇔r = sym≋ A×B×[C⊎D]≃[A×B]×C⊎[A×B]×D cc2equiv absorbr0-absorbl0⇔ = 0×0≃0 cc2equiv absorbl0-absorbr0⇔ = sym≋ 0×0≃0 cc2equiv absorbr⇔distl-absorb-unite = 0×[A⊎B]≃0 cc2equiv distl-absorb-unite⇔absorbr = sym≋ 0×[A⊎B]≃0 cc2equiv unite⋆r0-absorbr1⇔ = 0×1≃0 cc2equiv absorbr1-unite⋆r-⇔ = sym≋ 0×1≃0 cc2equiv absorbl≡swap⋆◎absorbr = A×0≃0 cc2equiv swap⋆◎absorbr≡absorbl = sym≋ A×0≃0 cc2equiv absorbr⇔[assocl⋆◎[absorbr⊗id⟷]]◎absorbr = 0×A×B≃0 cc2equiv [assocl⋆◎[absorbr⊗id⟷]]◎absorbr⇔absorbr = sym≋ 0×A×B≃0 cc2equiv [id⟷⊗absorbr]◎absorbl⇔assocl⋆◎[absorbl⊗id⟷]◎absorbr = A×0×B≃0 cc2equiv assocl⋆◎[absorbl⊗id⟷]◎absorbr⇔[id⟷⊗absorbr]◎absorbl = sym≋ A×0×B≃0 cc2equiv elim⊥-A[0⊕B]⇔l = A×[0+B]≃A×B cc2equiv elim⊥-A[0⊕B]⇔r = sym≋ A×[0+B]≃A×B cc2equiv elim⊥-1[A⊕B]⇔l = 1×[A⊎B]≃A⊎B cc2equiv elim⊥-1[A⊕B]⇔r = sym≋ 1×[A⊎B]≃A⊎B cc2equiv fully-distribute⇔l = [A⊎B]×[C⊎D]≃[[A×C⊎B×C]⊎A×D]⊎B×D cc2equiv fully-distribute⇔r = sym≋ [A⊎B]×[C⊎D]≃[[A×C⊎B×C]⊎A×D]⊎B×D -- -- These programs really are equivalent. Here's two ways to see that: -- 1. they give the same results as programs: ≋⇒≡ : {t₁ t₂ : U} {c₁ c₂ : t₁ ⟷ t₂} (ce : c₁ ⇔ c₂) → eval c₁ ∼ eval c₂ ≋⇒≡ {c₁ = c₁} {c₂} ce = trans∼ (lemma0 c₁) ( trans∼ (_≋_.f≡ (cc2equiv ce)) (sym∼ (lemma0 c₂))) -- 2. in fact, you can run one forward, then the other -- backward, and that's the identity ping-pong : {t₁ t₂ : U} {c₁ c₂ : t₁ ⟷ t₂} (ce : c₁ ⇔ c₂) → evalB c₂ ∘ eval c₁ ∼ id ping-pong {c₁ = c₁} {c₂} ce = trans∼ (cong₂∘ (lemma1 c₂) (lemma0 c₁)) ( trans∼ (cong∘r (proj₁ (c2equiv c₁)) (_≋_.f≡ (flip≋ (cc2equiv (2! ce))) )) ( trans∼(sym∼ β₁) (_≋_.f≡ (linv≋ (c2equiv c₁)))))
Transynther/x86/_processed/P/_zr_/i9-9900K_12_0xa0_notsx.log_5242_868.asm
ljhsiun2/medusa
9
11010
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r15 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0xe182, %rsi lea addresses_UC_ht+0x1ebe2, %rdi nop nop nop sub $7211, %r10 mov $20, %rcx rep movsq nop nop mfence lea addresses_A_ht+0xec62, %r15 nop nop nop and $54248, %r9 mov (%r15), %r13d nop and $39313, %rsi lea addresses_WC_ht+0xb7e2, %rsi lea addresses_WT_ht+0x14c22, %rdi nop nop inc %rbx mov $90, %rcx rep movsw nop add %rdi, %rdi pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r15 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r9 push %rcx push %rdx push %rsi // Load lea addresses_D+0x1ed62, %rsi nop nop nop nop nop and %r9, %r9 movb (%rsi), %cl nop nop nop nop nop cmp %r14, %r14 // Faulty Load mov $0xbe2, %rdx nop nop nop nop nop sub $26751, %r11 mov (%rdx), %rsi lea oracles, %rdx and $0xff, %rsi shlq $12, %rsi mov (%rdx,%rsi,1), %rsi pop %rsi pop %rdx pop %rcx pop %r9 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_P', 'AVXalign': True, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_P', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}} {'00': 5242} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
programs/oeis/133/A133044.asm
jmorken/loda
1
25846
; A133044: Area of the spiral of equilateral triangles with side lengths which follow the Padovan sequence, divided by the area of the initial triangle. ; 1,2,3,7,11,20,36,61,110,191,335,591,1032,1816,3185,5586,9811,17207,30203,53004,93004,163229,286430,502655,882111,1547967,2716528,4767152,8365761,14680930,25763171,45211271,79340235,139232356,244335860,428779421,752455502,1320467391,2317258575,4066505551,7136219576,12523192392,21976670833,38566368434,67679259059,118768819959,208424749435,365759938460,641863946396,1126392704957,1976681401278,3468834043647,6087379392511,10682606140415,18746666933856,32898107119456,57732153443585,101312866705346,177791687082435,312002660905351,547526501435147,960842029041716,1686160217561540,2959004907510141,5192691626501166,9112538563060927 mov $2,$0 mov $3,$0 add $3,1 lpb $3 mov $0,$2 sub $3,1 sub $0,$3 cal $0,134816 ; Padovan's spiral numbers. pow $0,2 add $1,$0 lpe
asm/bcopy.asm
GabrielRavier/Generic-Assembly-Samples
0
858
; Performance for copying a 100000 bytes buffer for all the versions (lower is better) : ; 386 : 26053/8336 = 2.94 ; SSE : 9112/8944 = 1.02 ; SSE2 : 9018/8960 = 1.01 ; std : 8487/8510 = 1.00 ; SSSE3 : 7928/8631 = 0.92 ; AVX2 : 6691/8487 = 0.79 ; Calculated by using the clocks taken by the algorithm divided by the clocks taken by the std version global @ASM_bcopy@12 extern _getInstructionSet segment .data align=16 actualASM_bcopyPtr dd actualASM_bcopyGetPtr segment .text align=16 %define source ecx %define destination edx %define length 4 %define result eax actualASM_bcopy386: push ebp push edi mov edi, destination push esi mov esi, source push ebx mov ecx, [esp + 16 + length] cmp ecx, 16 jb .lessThan16 cmp esi, edi jb .doBackwards cmp ecx, 680 jb .doManualLoopForwards mov eax, esi xor eax, edi and eax, 0ffh jz .forwardsMovs .doManualLoopForwards: sub ecx, 16 .forwardsManualLoop: sub ecx, 16 mov eax, [esi] mov ebx, [esi + 4] mov [edi], eax mov [edi + 4], ebx mov eax, [esi + 8] mov ebx, [esi + 12] mov [edi + 8], eax mov [edi + 12], ebx lea esi, [esi + 16] lea edi, [edi + 16] jnb .forwardsManualLoop add ecx, 16 jmp .lessThan16 align 16 .forwardsMovs: mov eax, [esi + ecx - 4] lea ebx, [edi + ecx - 4] shr ecx, 2 rep movsd mov [ebx], eax jmp .return align 16 .backwardsMovs: mov eax, [esi] mov ebx, edi lea esi, [esi + ecx - 4] lea edi, [edi + ecx - 4] shr ecx, 2 std rep movsd mov [ebx], eax cld jmp .return align 16 .doBackwards: cmp ecx, 680 jb .backwardsNoMovs mov eax, esi xor eax, edi and eax, 0FFh jz .backwardsMovs .backwardsNoMovs: add esi, ecx add edi, ecx sub ecx, 16 .backwardsManualLoop: sub ecx, 16 mov eax, [esi - 4] mov ebx, [esi - 8] mov [edi - 4], eax mov [edi - 8], ebx mov eax, [esi - 12] mov ebx, [esi - 16] mov [edi - 12], eax mov [edi - 16], ebx lea esi, [esi - 16] lea edi, [edi - 16] jnb .backwardsManualLoop add ecx, 16 ; Calculate position to head sub esi, ecx sub edi, ecx align 16 .lessThan16: cmp ecx, 8 jb .lessThan8 mov eax, [esi] mov ebx, [esi + 4] mov ebp, [esi + ecx - 8] mov esi, [esi + ecx - 4] mov [edi], eax mov [edi + 4], ebx mov [edi + ecx - 8], ebp mov [edi + ecx - 4], esi jmp .return align 16 .lessThan8: cmp ecx, 4 jb .lessThan4 mov eax, [esi] mov ebx, [esi + ecx - 4] mov [edi], eax mov [esi + ecx - 4], ebx jmp .return align 16 .lessThan4: cmp ecx, 2 jb .lessThan2 mov dx, [esi] mov bx, [esi + ecx - 2] mov [edi], dx mov [edi + ecx - 2], bx jmp .return align 16 .lessThan2: cmp ecx, 1 jb .return mov cl, [esi] mov [edi], cl align 16 .return: pop ebx pop esi pop edi pop ebp ret 4 ; end of actualASM_bcopy386 align 16 %define backDest edi %define backSrc esi %define regLength ecx actualASM_bcopySSE: push ebp push backDest mov backDest, destination push backSrc mov backSrc, source push ebx sub destination, backSrc mov regLength, dword [esp + 16 + length] lea eax, [regLength - 1] cmp destination, regLength jb .doReverse test regLength, regLength je .return lea ebx, [backSrc + 16] lea ebp, [backDest + 16] cmp backDest, ebx setnb dl cmp esi, ebp setnb bl or dl, bl cmp eax, 14 seta bl test dl, bl je .doMovsb mov edx, backDest or edx, backSrc test dl, 15 jne .doMovsb mov ebp, regLength mov edx, backSrc and ebp, -16 mov ebx, backDest add ebp, backSrc align 16 .xmmLoop: movaps xmm0, oword [edx] add edx, 16 add ebx, 16 movaps oword [ebx - 16], xmm0 cmp edx, ebp jne .xmmLoop mov edx, regLength and edx, -16 add backDest, edx add backSrc, edx sub eax, edx cmp regLength, edx je .return movzx ecx, byte [backSrc] test eax, eax mov byte [backDest], cl je .return %macro doTrailingByteSSE1 3 movzx %3, byte [backSrc + %1] cmp eax, %1 mov byte [backDest + %1], %2 je .return %endmacro doTrailingByteSSE1 1, bl, ebx doTrailingByteSSE1 2, dl, edx doTrailingByteSSE1 3, cl, ecx doTrailingByteSSE1 4, bl, ebx doTrailingByteSSE1 5, dl, edx doTrailingByteSSE1 6, cl, ecx doTrailingByteSSE1 7, bl, ebx doTrailingByteSSE1 8, dl, edx doTrailingByteSSE1 9, cl, ecx doTrailingByteSSE1 10, bl, ebx doTrailingByteSSE1 11, dl, edx doTrailingByteSSE1 12, cl, ecx doTrailingByteSSE1 13, bl, ebx movzx eax, byte [backSrc + 14] mov byte [backDest + 14], al .return: pop ebx pop backSrc pop backDest pop ebp ret 4 align 16 .doReverse: movzx edx, byte [backSrc + eax] mov byte [backDest + eax], dl dec eax cmp eax, -1 je .return movzx edx, byte [backSrc + eax] mov byte [backDest + eax], dl dec eax cmp eax, -1 jne .doReverse jmp .return align 16 .doMovsb: add regLength, backDest .movsbLoop: movsb cmp backDest, regLength jne .movsbLoop jmp .return ; end of actualASM_bcopySSE1 align 16 %define backSrc esi %define backDest edi %define regLength ecx actualASM_bcopySSE2: push ebp push backDest push backSrc push ebx mov backSrc, source mov backDest, destination mov regLength, dword [esp + 16 + length] lea eax, [regLength - 1] sub destination, backSrc cmp destination, regLength jb .doReverse test regLength, regLength je .return lea ebx, [backDest + 16] cmp backSrc, ebx setnb bl lea ebp, [backSrc + 16] cmp backDest, ebp setnb dl or bl, dl je .doMovsb cmp eax, 29 jbe .doMovsb mov edx, backSrc neg edx and edx, 15 je .alreadyAligned %macro doAlignSSE2 1 lea ebp, [backSrc + %1] movzx eax, byte [backSrc + %1 - 1] lea ebx, [backDest + %1] mov byte [backDest + %1 - 1], al lea eax, [regLength - %1 - 1] cmp edx, %1 je .endAlign %endmacro doAlignSSE2 1 doAlignSSE2 2 doAlignSSE2 3 doAlignSSE2 4 doAlignSSE2 5 doAlignSSE2 6 doAlignSSE2 7 doAlignSSE2 8 doAlignSSE2 9 doAlignSSE2 10 doAlignSSE2 11 doAlignSSE2 12 doAlignSSE2 13 doAlignSSE2 14 lea ebp, [backSrc + 15] movzx eax, byte [backSrc + 14] lea ebx, [backDest + 15] mov byte [backDest + 14], al lea eax, [regLength - 16] .endAlign: ; mov ecx, regLength sub ecx, edx ; mov esi, backSrc add esi, edx add edx, backDest mov edi, ecx and edi, -16 add edi, esi .xmmLoop: movdqa xmm0, oword [esi] movdqu oword [edx], xmm0 add esi, 16 add edx, 16 cmp esi, edi jne .xmmLoop mov esi, ecx and esi, -16 add ebx, esi add ebp, esi sub eax, esi cmp ecx, esi je .return movzx ecx, byte [ebp] mov byte [ebx], cl test eax, eax je .return %macro doTrailingByteSSE2edx 1 movzx edx, byte [ebp + %1] mov byte [ebx + %1], dl cmp eax, %1 je .return %endmacro %macro doTrailingByteSSE2ecx 1 movzx ecx, byte [ebp + %1] mov byte [ebx + %1], cl cmp eax, %1 je .return %endmacro doTrailingByteSSE2edx 1 doTrailingByteSSE2ecx 2 doTrailingByteSSE2edx 3 doTrailingByteSSE2ecx 4 doTrailingByteSSE2edx 5 doTrailingByteSSE2ecx 6 doTrailingByteSSE2edx 7 doTrailingByteSSE2ecx 8 doTrailingByteSSE2edx 9 doTrailingByteSSE2ecx 10 doTrailingByteSSE2edx 11 doTrailingByteSSE2ecx 12 doTrailingByteSSE2edx 13 movzx eax, byte [ebp + 14] mov byte [ebx + 14], al .return: pop ebx pop backSrc pop backDest pop ebp ret 4 align 16 .doReverse: movzx ebx, byte [backSrc + eax] mov byte [backDest + eax], cl sub eax, 1 cmp eax, -1 je .return movzx ebx, byte [backSrc + eax] mov byte [backDest + eax], bl sub eax, 1 cmp eax, -1 jne .doReverse jmp .return .doMovsb: add regLength, backSrc .movsbLoop: movsb cmp backSrc, regLength jne .movsbLoop jmp .return .alreadyAligned: mov ebp, backSrc mov ebx, backDest jmp .endAlign ; End of actualASM_bcopySSE2 align 16 actualASM_bcopySSSE3: push ebp push edi push esi push ebx sub esp, 28 mov edi, destination mov esi, source mov edx, [esp + 44 + length] lea eax, [edx - 1] cmp edi, source jnb .destBiggerThanSrc test edx, edx je .return lea ecx, [ecx + 16] cmp edi, ecx lea ecx, [edi + 16] setnb bl cmp esi, ecx setnb cl or bl, cl je .doMovsb cmp eax, 14 jbe .doMovsb mov ebp, edx mov ecx, esi mov ebx, edi and ebp, -16 add ebp, esi .xmmLoop: movdqu xmm0, oword [ecx] movups oword [ebx], xmm0 add ecx, 16 add ebx, 16 cmp ecx, ebp jne .xmmLoop mov ebx, edx and ebx, -16 add esi, ebx add edi, ebx sub eax, ebx cmp edx, ebx je .return movzx edx, byte [esi] mov byte [edi], dl test eax, eax je .return movzx edx, byte [esi + 1] mov byte [edi + 1], dl cmp eax, 1 je .return movzx edx, byte [esi + 2] mov byte [edi + 2], dl cmp eax, 2 je .return movzx edx, byte [esi + 3] mov byte [edi + 3], dl cmp eax, 3 je .return movzx edx, byte [esi + 4] mov byte [edi + 4], dl cmp eax, 4 je .return movzx edx, byte [esi + 5] mov byte [edx + 5], dl cmp eax, 5 je .return movzx edx, byte [esi + 6] mov byte [edi + 6], dl cmp eax, 6 je .return movzx edx, byte [ebp + 7] mov byte [edi + 7], dl cmp eax, 7 je .return movzx edx, byte [esi + 8] mov byte [edi + 8], dl cmp eax, 8 je .return movzx edx, byte [esi + 9] mov byte [edi + 9], dl cmp eax, 9 je .return movzx edx, byte [esi + 10] mov byte [edi + 10], dl cmp eax, 10 je .return movzx edx, byte [esi + 11] mov byte [edi + 11], dl cmp eax, 11 je .return movzx edx, byte [esi + 12] mov byte [edi + 12], dl cmp eax, 12 je .return movzx edx, byte [esi + 13] mov byte [edi + 13], dl cmp eax, 13 je .return movzx eax, byte [esi + 14] mov byte [edi + 14], al .return: add esp, 28 pop ebx pop esi pop edi pop ebp ret 4 .destBiggerThanSrc: lea ebx, [source + eax] mov dword [esp + 4], ebx lea ecx, [edi + eax] mov dword [esp + 8], ecx test edx, edx je .return lea ebx, [edx - 16] lea ecx, [esi + ebx] lea ebp, [edi + ebx] mov dword [esp + 12], ecx lea ebx, [edi + edx] cmp ecx, ebx setnb byte [esp + 3] movzx ecx, byte [esp + 3] lea ebx, [esi + edx] cmp ebp, edx setnb bl or cl, bl je .doByteLoop cmp eax, 14 jbe .doByteLoop mov ecx, dword [esp + 12] mov esi, edx mov ebx, ebp and esi, -16 mov edi, ecx sub edi, esi mov esi, edi .xmmLoopReverse: movdqu xmm1, oword [ecx] movups oword [ebx], xmm1 sub ecx, 16 sub edx, 16 cmp ecx, esi jne .xmmLoopReverse mov esi, edx mov ebx, dword [esp + 4] and esi, -16 mov ecx, esi sub eax, esi neg ecx add ebx, ecx add ecx, dword [esp + 8] cmp edx, esi je .return movzx edx, byte [ebx] mov byte [ecx], dl test eax, eax je .return movzx edx, byte [ebx + 1] mov byte [ecx + 1], dl cmp eax, 1 je .return movzx edx, byte [ebx + 2] mov byte [ecx + 2], dl cmp eax, 2 je .return movzx edx, byte [ebx + 3] mov byte [ecx + 3], dl cmp eax, 3 je .return movzx edx, byte [ebx + 4] mov byte [ecx + 4], dl cmp eax, 4 je .return movzx edx, byte [ebx + 5] mov byte [ecx + 5], dl cmp eax, 5 je .return movzx edx, byte [ebx + 6] mov byte [ecx + 6], dl cmp eax, 6 je .return movzx edx, byte [ebx + 7] mov byte [ecx + 7], dl cmp eax, 7 je .return movzx edx, byte [ebx + 8] mov byte [ecx + 8], dl cmp eax, 8 je .return movzx edx, byte [ebx + 9] mov byte [ecx + 9], dl cmp eax, 9 je .return movzx edx, byte [ebx + 10] mov byte [ecx + 10], dl cmp eax, 10 je .return movzx edx, byte [ebx + 11] mov byte [ecx + 11], dl cmp eax, 11 je .return movzx edx, byte [ebx + 12] mov byte [ecx + 12], dl cmp eax, 12 je .return movzx edx, byte [ebx + 13] mov byte [ecx + 13], dl cmp eax, 13 je .return movzx eax, byte [ebx + 14] mov byte [ecx + 14], al jmp .return align 16 .doMovsb: add edx, esi .movsbLoop: movsb cmp esi, edx jne .movsbLoop jmp .return align 16 .doByteLoop: lea ebx, [esi - 1] lea ecx, [edi - 1] .byteLoop: movzx edx, byte [ebx + eax + 1] mov byte [ecx + eax + 1], dl dec eax cmp eax, -1 jne .byteLoop jmp .return align 16 actualASM_bcopyAVX: push ebp mov ebp, esp push edi push esi push ebx mov edi, destination and esp, -32 ; Align stack sub esp, 32 mov eax, dword [ebp + 4 + length] lea ebx, [eax - 1] mov dword [esp + 28], ebx cmp destination, source jnb .destBiggerThanSrc test eax, eax je .return lea ebx, [source + 32] cmp destination, ebx setnb bl mov esi, ebx lea ebx, [destination + 32] mov edx, esi cmp source, edx setnb bl or dl, bl je .doMovsb cmp dword [esp + 28], 30 jbe .doMovsb mov esi, eax mov edx, source mov ebx, edi and esi, -32 add esi, source .avxLoop: vmovdqu xmm1, oword [edx] add edx, 32 vinsertf128 ymm0, ymm1, oword [edx - 16], 1 add ebx, 32 vmovups oword [ebx - 32], xmm0 vextractf128 oword [ebx - 16], ymm0, 1 cmp edx, esi jne .avxLoop mov edx, eax and edx, -32 lea esi, [source + edx] add edi, edx cmp eax, edx je .avxReturn .movsbLoopAfterAvx: movsb cmp esi, source jne .movsbLoopAfterAvx .avxReturn: vzeroupper .return: lea esp, [ebp - 12] pop ebx pop esi pop edi pop ebp ret 4 align 16 .destBiggerThanSrc: lea esi, [eax - 1] lea ebx, [source + esi] lea edx, [edx + esi] mov dword [esp + 16], ebx mov dword [esp + 12], edx test eax, eax je .return lea ebx, [eax - 16] lea edx, [edi + ebx] lea esi, [source + ebx] mov dword [esp + 24], edx lea ebx, [edi + eax] cmp esi, ebx setnb byte [esp + 23] movzx edx, byte [esp + 23] lea ebx, [source + eax] cmp dword [esp + 24], ebx setnb bl or dl, bl je .doReverseByteLoop cmp dword [esp + 28], 14 jbe .doReverseByteLoop mov ebx, dword [esp + 24] lea edx, [eax - 1] mov ecx, esi mov esi, eax and esi, -16 mov edi, ecx sub edi, esi mov esi, edi .reverseAvxLoop: vmovdqu xmm2, oword [ecx] sub ecx, 16 sub ebx, 16 vmovups oword [ebx + 16], xmm2 cmp ecx, esi jne .reverseAvxLoop mov ebx, eax mov esi, dword [esp + 16] and ebx, -16 mov ecx, ebx sub edx, ebx neg ecx add esi, ecx add ecx, dword [esp + 12] cmp eax, ebx je .return movzx eax, byte [esi] mov byte [ecx], al test edx, edx je .return movzx eax, byte [esi-1] mov byte [ecx-1], al cmp edx, 1 je .return movzx eax, byte [esi-2] mov byte [ecx-2], al cmp edx, 2 je .return movzx eax, byte [esi-3] mov byte [ecx-3], al cmp edx, 3 je .return movzx eax, byte [esi-4] mov byte [ecx-4], al cmp edx, 4 je .return movzx eax, byte [esi-5] mov byte [ecx-5], al cmp edx, 5 je .return movzx eax, byte [esi-6] mov byte [ecx-6], al cmp edx, 6 je .return movzx eax, byte [esi-7] mov byte [ecx-7], al cmp edx, 7 je .return movzx eax, byte [esi-8] mov byte [ecx-8], al cmp edx, 8 je .return movzx eax, byte [esi-9] mov byte [ecx-9], al cmp edx, 9 je .return movzx eax, byte [esi-10] mov byte [ecx-10], al cmp edx, 10 je .return movzx eax, byte [esi-11] mov byte [ecx-11], al cmp edx, 11 je .return movzx eax, byte [esi-12] mov byte [ecx-12], al cmp edx, 12 je .return movzx eax, byte [esi-13] mov byte [ecx-13], al cmp edx, 13 je .return movzx eax, byte [esi-14] mov byte [ecx-14], al jmp .return align 16 .doMovsb: add eax, ecx mov esi, ecx .movsbLoop: movsb cmp esi, eax jne .movsbLoop jmp .return align 16 .doReverseByteLoop: mov edx, dword [esp + 28] lea ebx, [source - 1] lea ecx, [edi - 1] .reverseByteLoop: movzx eax, byte [ebx + edx + 1] mov byte [ecx + edx + 1], al dec edx cmp edx, -1 jne .reverseByteLoop jmp .return ; End of actualASM_bcopyAVX align 16 %define backSrc esi %define regLength eax actualASM_bcopyAVX2: push ebp mov ebp, esp push edi push backSrc push ebx and esp, -32 sub esp, 32 mov backSrc, source mov regLength, dword [ebp + 4 + length] dec regLength mov ecx, destination sub ecx, backSrc cmp ecx, dword [ebp + 4 + length] jnb .doForwards mov ebx, dword [ebp + 4 + length] lea ecx, [ebx - 32] lea edi, [backSrc + ecx] mov dword [esp + 28], edi lea edi, [destination + ecx] mov ebx, dword [ebp + 4 + length] add ebx, esi cmp edi, ebx setnb cl mov ebx, dword [ebp + 4 + length] add ebx, edx cmp dword [esp + 28], ebx setnb bl or cl, bl je .doByteByByte cmp eax, 30 jbe .doByteByByte mov ecx, dword [esp + 28] mov dword [esp + 28], edi mov edi, dword [ebp + 4 + length] and edi, -32 mov ebx, ecx sub ebx, edi mov edi, ebx mov ebx, dword [esp + 28] .reverseAvxLoop: vmovdqu ymm0, yword [ecx] vmovdqu yword [ebx], ymm0 sub ecx, 32 sub ebx, 32 cmp edi, ecx jne .reverseAvxLoop mov ecx, dword [ebp + 4 + length] and ecx, -32 sub eax, ecx cmp dword [ebp + 4 + length], ecx je .avxReturn .trailingBytesLoopReverseLoop: mov bl, byte [backSrc + eax] mov byte [edx + eax], cl dec eax cmp eax, -1 jne .trailingBytesLoopReverseLoop .avxReturn: vzeroupper .return: lea esp, [ebp - 12] pop ebx pop backSrc pop edi pop ebp ret 4 align 16 .doByteByByte: mov cl, byte [esi + eax] mov byte [edx + eax], cl dec eax cmp eax, -1 je .return mov cl, byte [esi + eax] mov byte [edx + eax], cl dec eax cmp eax, -1 jne .doByteByByte jmp .return .doForwards: mov ebx, dword [ebp + 4 + length] test ebx, ebx je .return lea edi, [edx + 32] cmp esi, edi setnb bl lea ecx, [backSrc + 32] cmp edx, ecx setnb cl or bl, cl je .doMovsb cmp eax, 30 jbe .doMovsb mov eax, esi mov edi, edx mov ebx, dword [ebp + 4 + length] and ebx, -32 add ebx, backSrc .avxLoop: vmovdqu ymm1, yword [eax] vmovdqu yword [edi], ymm1 add eax, 32 add edi, 32 cmp eax, ebx jne .avxLoop mov ecx, dword [ebp + 4 + length] and ecx, -32 lea edi, [edx + ecx] add esi, ecx cmp dword [ebp + 4 + length], ecx je .avxReturn add edx, dword [ebp + 4 + length] .trailingBytesMovsbLoop: movsb cmp edx, edi jne .trailingBytesMovsbLoop jmp .avxReturn .doMovsb: mov eax, dword [ebp + 4 + length] add eax, edx mov edi, edx .movsbLoop: movsb cmp eax, edi jne .movsbLoop jmp .return ; End of actualASM_bcopyAVX2 align 16 %define SSESupported 3 %define SSE2Supported 4 %define SSSE3Supported 6 %define AVXSupported 11 %define AVX2Supported 13 @ASM_bcopy@12: jmp dword [actualASM_bcopyPtr] align 16 actualASM_bcopyGetPtr: push ebx sub esp, 24 mov dword [esp + 12], destination mov dword [esp + 8], source mov ebx, [esp + 28 + length] call _getInstructionSet cmp eax, SSESupported - 1 mov source, dword [esp + 8] mov destination, dword [esp + 12] jg .not386 mov dword [actualASM_bcopyPtr], actualASM_bcopy386 jmp .doJmp .not386: cmp eax, SSE2Supported - 1 jne .notSSE mov dword [actualASM_bcopyPtr], actualASM_bcopySSE jmp .doJmp .notSSE: cmp eax, SSSE3Supported - 1 jg .notSSE2 mov dword [actualASM_bcopyPtr], actualASM_bcopySSE2 jmp .doJmp .notSSE2: cmp eax, AVX2Supported - 1 jg .notSSSE3 mov dword [actualASM_bcopyPtr], actualASM_bcopySSSE3 jmp .doJmp .notSSSE3: mov dword [actualASM_bcopyPtr], actualASM_bcopyAVX2 .doJmp: mov dword [esp + 28 + length], ebx add esp, 24 pop ebx jmp dword [actualASM_bcopyPtr]
basics/integer_as_border.als
nowavailable/alloy_als_study
0
2563
<filename>basics/integer_as_border.als<gh_stars>0 /* 石の上にも三年。 */ abstract sig Border { val: one Int } one sig BorderThree extends Border {} { val = 3 } // 0〜7 one sig BorderZero extends Border {} { val = 0 } abstract sig Year { val: one Int } one sig ThisYear extends Year {} sig SinceYear extends Year { whose: one Craftman } sig Craftman { sinceYear: one SinceYear } abstract sig Career { guys: set Craftman } one sig Rookie, FullGrown extends Career {} fact generic { // CraftmanのsinceYearとして作用していないSinceYearは、不要。 sinceYear = ~whose // rookieGuysとfullGrownGuysは互いに素。 disj[Rookie.guys, FullGrown.guys] // 開始年は過去である、等。 all sYear:SinceYear, tYear:ThisYear | tYear.val >= sYear.val && sYear.val >= BorderZero.val } fact bizLogic { all c:Craftman, r:Rookie, f:FullGrown, y:ThisYear, b:BorderThree | let rGuys = r.guys, fGuys = f.guys | y.val.minus[c.sinceYear.val] > b.val implies c in fGuys else c in rGuys } run {} for 4 Int, 4 Craftman, 6 Year
src/net-protos-icmp.ads
stcarrez/ada-enet
16
26344
----------------------------------------------------------------------- -- net-protos-icmp -- ICMP v4 Network protocol -- Copyright (C) 2016, 2018 <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 Net.Interfaces; with Net.Buffers; package Net.Protos.Icmp is -- Send a ICMP echo request packet to the target IP. The ICMP header is -- initialized with the given sequence and identifier so that ICMP reply -- can be identified. procedure Echo_Request (Ifnet : in out Net.Interfaces.Ifnet_Type'Class; Target_Ip : in Ip_Addr; Packet : in out Net.Buffers.Buffer_Type; Seq : in Net.Uint16; Ident : in Net.Uint16; Status : out Error_Code) with Pre => not Packet.Is_Null, Post => Packet.Is_Null; -- Receive and handle an ICMP packet. procedure Receive (Ifnet : in out Net.Interfaces.Ifnet_Type'Class; Packet : in out Net.Buffers.Buffer_Type) with Pre => not Packet.Is_Null, Post => Packet.Is_Null; end Net.Protos.Icmp;
Transynther/x86/_processed/US/_st_sm_/i7-7700_9_0x48.log_21829_1983.asm
ljhsiun2/medusa
9
10693
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x1176b, %rdx nop nop nop nop nop xor $26709, %rbx movw $0x6162, (%rdx) nop cmp $47481, %rbp lea addresses_D_ht+0x17578, %rsi lea addresses_A_ht+0x8711, %rdi nop nop nop nop nop xor $54360, %r12 mov $53, %rcx rep movsb add $15525, %rsi lea addresses_WT_ht+0xcf04, %r10 nop nop nop nop nop cmp $64908, %rdi movw $0x6162, (%r10) nop nop nop and $41992, %r10 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %r15 push %rbx push %rdi push %rsi // Store lea addresses_US+0xe36b, %r12 nop nop and %r15, %r15 mov $0x5152535455565758, %rsi movq %rsi, %xmm7 movups %xmm7, (%r12) nop nop nop nop nop add %r14, %r14 // Faulty Load lea addresses_US+0xe36b, %rbx nop nop nop nop add %r11, %r11 mov (%rbx), %r12 lea oracles, %rdi and $0xff, %r12 shlq $12, %r12 mov (%rdi,%r12,1), %r12 pop %rsi pop %rdi pop %rbx pop %r15 pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 10, 'size': 2, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}} {'58': 21829} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
RFC5322Parser.g4
ProtonMail/go-rfc5322
3
4269
parser grammar RFC5322Parser; options { tokenVocab=RFC5322Lexer; } // ------------------- // 3.2. Lexical tokens // ------------------- quotedChar: vchar | wsp; quotedPair : Backslash quotedChar | obsQP ; fws : (wsp* crlf)? wsp+ | obsFWS ; ctext : alpha | Exclamation | DQuote | Hash | Dollar | Percent | Ampersand | SQuote | Asterisk | Plus | Comma | Minus | Period | Slash | Digit | Colon | Semicolon | Less | Equal | Greater | Question | At | LBracket | RBracket | Caret | Underscore | Backtick | LCurly | Pipe | RCurly | Tilde | obsCtext | UTF8NonAscii ; ccontent : ctext | quotedPair | comment ; comment: LParens (fws? ccontent)* fws? RParens; cfws : (fws? comment)+ fws? | fws ; atext : alpha | Digit | Exclamation | Hash | Dollar | Percent | Ampersand | SQuote | Asterisk | Plus | Minus | Slash | Equal | Question | Caret | Underscore | Backtick | LCurly | Pipe | RCurly | Tilde | UTF8NonAscii ; atom: atext+; // Allow dotAtom to have a trailing period; some messages in the wild look like this. dotAtom: atext+ (Period atext+)* Period?; qtext : alpha | Exclamation | Hash | Dollar | Percent | Ampersand | SQuote | LParens | RParens | Asterisk | Plus | Comma | Minus | Period | Slash | Digit | Colon | Semicolon | Less | Equal | Greater | Question | At | LBracket | RBracket | Caret | Underscore | Backtick | LCurly | Pipe | RCurly | Tilde | obsQtext | UTF8NonAscii ; quotedContent : qtext | quotedPair ; quotedValue: (fws? quotedContent)*; quotedString: DQuote quotedValue fws? DQuote; word : (cfws? encodedWord cfws?)+ | cfws? atom cfws? | cfws? quotedString cfws? ; // -------------------------------- // 3.3. Date and Time Specification // -------------------------------- dateTime: (dayOfweek Comma)? day month year hour Colon minute (Colon second)? zone? cfws? EOF; dayOfweek : fws? dayName | cfws? dayName cfws? ; dayName : M O N | T U E | W E D | T H U | F R I | S A T | S U N ; day : fws? Digit Digit? fws | cfws? Digit Digit? cfws? ; month : J A N | F E B | M A R | A P R | M A Y | J U N | J U L | A U G | S E P | O C T | N O V | D E C ; year : fws Digit Digit Digit Digit fws | cfws? Digit Digit cfws? ; // NOTE: RFC5322 requires two digits for the hour, but we // relax that requirement a bit, allowing single digits. hour : Digit? Digit | cfws? Digit? Digit cfws? ; minute : Digit Digit | cfws? Digit Digit cfws? ; second : Digit Digit | cfws? Digit Digit cfws? ; offset: (Plus | Minus)? Digit Digit Digit Digit; zone : fws offset | obsZone ; // -------------------------- // 3.4. Address Specification // -------------------------- address : mailbox | group ; mailbox : nameAddr | addrSpec ; nameAddr: displayName? angleAddr; angleAddr : cfws? Less addrSpec? Greater cfws? | obsAngleAddr ; // relax this definition to allow the final semicolon to be optional // and to permit it to be surrounded by quotes. group: DQuote? displayName Colon groupList? DQuote? Semicolon? cfws?; unspaced: Period | At; displayName : word+ | word (word | unspaced | cfws)* ; mailboxList : mailbox (Comma mailbox)* | obsMboxList ; addressList : address ((Comma | Semicolon) address)* EOF | obsAddrList EOF ; groupList : mailboxList | cfws | obsGroupList ; // Allow addrSpec contain a port. addrSpec: localPart At domain (Colon port)?; localPart : cfws? dotAtom cfws? | cfws? quotedString cfws? | obsLocalPart ; port: Digit+; domain : cfws? dotAtom cfws? | cfws? domainLiteral cfws? | cfws? obsDomain cfws? ; domainLiteral: LBracket (fws? dtext)* fws? RBracket; dtext : alpha | Exclamation | DQuote | Hash | Dollar | Percent | Ampersand | SQuote | LParens | RParens | Asterisk | Plus | Comma | Minus | Period | Slash | Digit | Colon | Semicolon | Less | Equal | Greater | Question | At | Caret | Underscore | Backtick | LCurly | Pipe | RCurly | Tilde //| obsDtext | UTF8NonAscii ; // ---------------------------------- // 4.1. Miscellaneous Obsolete Tokens // ---------------------------------- obsNoWSCTL : U_01_08 | U_0B | U_0C | U_0E_1F | Delete ; obsCtext: obsNoWSCTL; obsQtext: obsNoWSCTL; obsQP: Backslash (U_00 | obsNoWSCTL | LF | CR); // --------------------------------- // 4.2. Obsolete Folding White Space // --------------------------------- obsFWS: wsp+ (crlf wsp+); // --------------------------- // 4.3. Obsolete Date and Time // --------------------------- obsZone : U T | U T C | G M T | E S T | E D T | C S T | C D T | M S T | M D T | P S T | P D T //| obsZoneMilitary ; // ------------------------ // 4.4. Obsolete Addressing // ------------------------ obsAngleAddr: cfws? Less obsRoute addrSpec Greater cfws?; obsRoute: obsDomainList Colon; obsDomainList: (cfws | Comma)* At domain (Comma cfws? (At domain)?)*; obsMboxList: (cfws? Comma)* mailbox (Comma (mailbox | cfws)?)*; obsAddrList: (cfws? Comma)* address (Comma (address | cfws)?)*; obsGroupList: (cfws? Comma)+ cfws?; obsLocalPart: word (Period word)*; obsDomain: atom (Period atom)*; // ------------------------------------ // 2. Syntax of encoded-words (RFC2047) // ------------------------------------ encodedWord: Equal Question charset Question encoding Question encodedText Question Equal; charset: token; encoding: token; token: tokenChar+; tokenChar : alpha | Exclamation | Hash | Dollar | Percent | Ampersand | SQuote | Asterisk | Plus | Minus | Digit | Backslash | Caret | Underscore | Backtick | LCurly | Pipe | RCurly | Tilde ; encodedText: encodedChar+; encodedChar : alpha | Exclamation | DQuote | Hash | Dollar | Percent | Ampersand | SQuote | LParens | RParens | Asterisk | Plus | Comma | Minus | Period | Slash | Digit | Colon | Semicolon | Less | Equal | Greater | At | LBracket | Backslash | RBracket | Caret | Underscore | Backtick | LCurly | Pipe | RCurly | Tilde ; // ------------------------- // B.1. Core Rules (RFC5234) // ------------------------- crlf: CR LF; wsp: SP | TAB; vchar : alpha | Exclamation | DQuote | Hash | Dollar | Percent | Ampersand | SQuote | LParens | RParens | Asterisk | Plus | Comma | Minus | Period | Slash | Digit | Colon | Semicolon | Less | Equal | Greater | Question | At | LBracket | Backslash | RBracket | Caret | Underscore | Backtick | LCurly | Pipe | RCurly | Tilde | UTF8NonAscii ; alpha: A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z ;
test/interaction/Issue208.agda
asr/agda-kanso
1
10596
module Issue208 where record R : Set where foo : Set foo = {!!}
src/helios-commands-agent.adb
stcarrez/helios
1
26852
<gh_stars>1-10 ----------------------------------------------------------------------- -- helios-commands-agent -- Helios agent commands -- Copyright (C) 2017, 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 Ada.Text_IO; with Util.Log; with Util.Properties; with Util.Events.Timers; with Helios.Monitor.Agent; with Helios.Reports.Files; with Helios.Reports.Remote; package body Helios.Commands.Agent is use Ada.Strings.Unbounded; procedure Setup_Report (Runtime : in out Helios.Monitor.Agent.Runtime_Type; Config : in Util.Properties.Manager; Server : in Util.Properties.Manager); File_Report : aliased Helios.Reports.Files.File_Report_Type; Remote_Report : aliased Helios.Reports.Remote.Remote_Report_Type; procedure Setup_Report (Runtime : in out Helios.Monitor.Agent.Runtime_Type; Config : in Util.Properties.Manager; Server : in Util.Properties.Manager) is Mode : constant String := Config.Get ("mode", "file"); Timer : Util.Events.Timers.Timer_Ref; begin Runtime.Report_Period := Helios.Monitor.Get_Period (Config, "period", 300); if Mode = "file" then File_Report.Period := Runtime.Report_Period; File_Report.Path := To_Unbounded_String (Config.Get ("pattern", "report-%F-%H-%M-%S.json")); Runtime.Timers.Set_Timer (File_Report'Access, Timer, File_Report.Period); else Remote_Report.Period := Runtime.Report_Period; -- Remote_Report.URI := To_Unbounded_String (Config.Get ("remote_uri")); Remote_Report.Set_Server_Config (Server); Helios.Reports.Remote.Start (Remote_Report'Access); Runtime.Timers.Set_Timer (Remote_Report'Access, Timer, Remote_Report.Period); end if; end Setup_Report; -- ------------------------------ -- Execute a information command to report information about the agent and monitoring. -- ------------------------------ overriding procedure Execute (Command : in out Command_Type; Name : in String; Args : in Argument_List'Class; Context : in out Context_Type) is begin if Args.Get_Count /= 0 then Helios.Commands.Usage (Args); else Load (Context); Setup_Report (Context.Runtime, Context.Config.Get ("report"), Context.Server); Monitor.Agent.Configure (Context.Runtime, Context.Config); Monitor.Agent.Run (Context.Runtime); end if; exception when Util.Properties.NO_PROPERTY => Command.Log (Util.Log.ERROR_LEVEL, Name, "Missing report configuration"); raise Error; end Execute; -- ------------------------------ -- Write the help associated with the command. -- ------------------------------ overriding procedure Help (Command : in out Command_Type; Name : in String; Context : in out Context_Type) is pragma Unreferenced (Name, Command, Context); begin Ada.Text_IO.Put_Line ("agent: start the monitoring agent"); Ada.Text_IO.New_Line; Ada.Text_IO.Put_Line ("Usage: agent"); Ada.Text_IO.New_Line; Ada.Text_IO.Put_Line (" The agent command is the main command to run the agent and"); Ada.Text_IO.Put_Line (" to monitor the system components according to the configuration."); end Help; end Helios.Commands.Agent;
src/presets/14ice_menu.asm
rioscrodrigo/sm_practice_hack
0
243849
; PresetsMenu14ice: ; dw #presets_goto_14ice_crateria ; dw #presets_goto_14ice_brinstar ; dw #presets_goto_14ice_wrecked_ship ; dw #presets_goto_14ice_brinstar_revisit ; dw #presets_goto_14ice_upper_norfair ; dw #presets_goto_14ice_lower_norfair ; dw #presets_goto_14ice_maridia ; dw #presets_goto_14ice_tourian ; dw #$0000 ; %cm_header("PRESETS FOR 14 ICE") ; presets_goto_14ice_crateria: ; %cm_submenu("Crateria", #presets_submenu_14ice_crateria) ; presets_goto_14ice_brinstar: ; %cm_submenu("Brinstar", #presets_submenu_14ice_brinstar) ; presets_goto_14ice_wrecked_ship: ; %cm_submenu("Wrecked Ship", #presets_submenu_14ice_wrecked_ship) ; presets_goto_14ice_brinstar_revisit: ; %cm_submenu("Brinstar Revisit", #presets_submenu_14ice_brinstar_revisit) ; presets_goto_14ice_upper_norfair: ; %cm_submenu("Upper Norfair", #presets_submenu_14ice_upper_norfair) ; presets_goto_14ice_lower_norfair: ; %cm_submenu("Lower Norfair", #presets_submenu_14ice_lower_norfair) ; presets_goto_14ice_maridia: ; %cm_submenu("Maridia", #presets_submenu_14ice_maridia) ; presets_goto_14ice_tourian: ; %cm_submenu("Tourian", #presets_submenu_14ice_tourian) ; presets_submenu_14ice_crateria: ; dw #presets_14ice_crateria_ceres_elevator ; dw #presets_14ice_crateria_ceres_last_3_rooms ; dw #presets_14ice_crateria_ship ; dw #presets_14ice_crateria_morph ; dw #presets_14ice_crateria_climb ; dw #presets_14ice_crateria_bomb_torizo ; dw #presets_14ice_crateria_terminator ; dw #$0000 ; %cm_header("CRATERIA") ; presets_submenu_14ice_brinstar: ; dw #presets_14ice_brinstar_green_brinstar_elevator ; dw #presets_14ice_brinstar_big_pink ; dw #presets_14ice_brinstar_red_tower ; dw #presets_14ice_brinstar_hellway ; dw #presets_14ice_brinstar_caterpillar_room ; dw #presets_14ice_brinstar_leaving_power_bombs ; dw #presets_14ice_brinstar_kihunter_room ; dw #presets_14ice_brinstar_moat ; dw #presets_14ice_brinstar_ocean ; dw #$0000 ; %cm_header("BRINSTAR") ; presets_submenu_14ice_wrecked_ship: ; dw #presets_14ice_wrecked_ship_wrecked_ship_shaft ; dw #presets_14ice_wrecked_ship_phantoon ; dw #presets_14ice_wrecked_ship_wrecked_ship_supers ; dw #presets_14ice_wrecked_ship_shaft_revisit ; dw #presets_14ice_wrecked_ship_attic ; dw #presets_14ice_wrecked_ship_bowling_alley_path ; dw #presets_14ice_wrecked_ship_bowling_alley ; dw #presets_14ice_wrecked_ship_leaving_gravity ; dw #$0000 ; %cm_header("WRECKED SHIP") ; presets_submenu_14ice_brinstar_revisit: ; dw #presets_14ice_brinstar_revisit_red_tower_elevator ; dw #presets_14ice_brinstar_revisit_breaking_tube ; dw #presets_14ice_brinstar_revisit_entering_kraids_lair ; dw #presets_14ice_brinstar_revisit_baby_kraid_entering ; dw #presets_14ice_brinstar_revisit_kraid ; dw #presets_14ice_brinstar_revisit_baby_kraid_exiting ; dw #presets_14ice_brinstar_revisit_kraid_etank ; dw #$0000 ; %cm_header("BRINSTAR REVISIT") ; presets_submenu_14ice_upper_norfair: ; dw #presets_14ice_upper_norfair_ice_beam ; dw #presets_14ice_upper_norfair_ice_escape ; dw #presets_14ice_upper_norfair_precathedral ; dw #presets_14ice_upper_norfair_bubble_mountain ; dw #presets_14ice_upper_norfair_magdollite_room ; dw #presets_14ice_upper_norfair_kronic_boost ; dw #$0000 ; %cm_header("UPPER NORFAIR") ; presets_submenu_14ice_lower_norfair: ; dw #presets_14ice_lower_norfair_ln_main_hall ; dw #presets_14ice_lower_norfair_pillars ; dw #presets_14ice_lower_norfair_worst_room ; dw #presets_14ice_lower_norfair_amphitheatre ; dw #presets_14ice_lower_norfair_kihunter_stairs ; dw #presets_14ice_lower_norfair_wasteland ; dw #presets_14ice_lower_norfair_metal_pirates ; dw #presets_14ice_lower_norfair_ridley ; dw #presets_14ice_lower_norfair_leaving_ridley ; dw #presets_14ice_lower_norfair_wasteland_revisit ; dw #presets_14ice_lower_norfair_kihunter_stairs_revisit ; dw #presets_14ice_lower_norfair_fireflea_room ; dw #presets_14ice_lower_norfair_three_musketeers ; dw #presets_14ice_lower_norfair_bubble_mountain_revisit ; dw #$0000 ; %cm_header("LOWER NORFAIR") ; presets_submenu_14ice_maridia: ; dw #presets_14ice_maridia_entering_maridia ; dw #presets_14ice_maridia_mt_everest ; dw #presets_14ice_maridia_ice_clip ; dw #presets_14ice_maridia_botwoon ; dw #presets_14ice_maridia_botwoon_etank_room ; dw #presets_14ice_maridia_colosseum ; dw #presets_14ice_maridia_draygon ; dw #presets_14ice_maridia_colosseum_revisit ; dw #presets_14ice_maridia_reverse_botwoon ; dw #presets_14ice_maridia_aqueduct_revisit ; dw #presets_14ice_maridia_everest_revisit ; dw #presets_14ice_maridia_red_tower_green_gate ; dw #$0000 ; %cm_header("MARIDIA") ; presets_submenu_14ice_tourian: ; dw #presets_14ice_tourian_kihunter_room_revisit ; dw #presets_14ice_tourian_terminator_revisit ; dw #presets_14ice_tourian_pirate_shaft_revisit ; dw #presets_14ice_tourian_metroids_1 ; dw #presets_14ice_tourian_metroids_2 ; dw #presets_14ice_tourian_metroids_3 ; dw #presets_14ice_tourian_metroids_4 ; dw #presets_14ice_tourian_baby ; dw #presets_14ice_tourian_zeb_skip ; dw #presets_14ice_tourian_escape_room_3 ; dw #presets_14ice_tourian_escape_parlor ; dw #$0000 ; %cm_header("TOURIAN") ; Crateria ; presets_14ice_crateria_ceres_elevator: ; %cm_preset("Ceres Elevator", #preset_14ice_crateria_ceres_elevator) ; presets_14ice_crateria_ceres_last_3_rooms: ; %cm_preset("Ceres Last 3 Rooms", #preset_14ice_crateria_ceres_last_3_rooms) ; presets_14ice_crateria_ship: ; %cm_preset("Ship", #preset_14ice_crateria_ship) ; presets_14ice_crateria_morph: ; %cm_preset("Morph", #preset_14ice_crateria_morph) ; presets_14ice_crateria_climb: ; %cm_preset("Climb", #preset_14ice_crateria_climb) ; presets_14ice_crateria_bomb_torizo: ; %cm_preset("Bomb Torizo", #preset_14ice_crateria_bomb_torizo) ; presets_14ice_crateria_terminator: ; %cm_preset("Terminator", #preset_14ice_crateria_terminator) ; Brinstar ; presets_14ice_brinstar_green_brinstar_elevator: ; %cm_preset("Green Brinstar Elevator", #preset_14ice_brinstar_green_brinstar_elevator) ; presets_14ice_brinstar_big_pink: ; %cm_preset("Big Pink", #preset_14ice_brinstar_big_pink) ; presets_14ice_brinstar_red_tower: ; %cm_preset("Red Tower", #preset_14ice_brinstar_red_tower) ; presets_14ice_brinstar_hellway: ; %cm_preset("Hellway", #preset_14ice_brinstar_hellway) ; presets_14ice_brinstar_caterpillar_room: ; %cm_preset("Caterpillar Room", #preset_14ice_brinstar_caterpillar_room) ; presets_14ice_brinstar_leaving_power_bombs: ; %cm_preset("Leaving Power Bombs", #preset_14ice_brinstar_leaving_power_bombs) ; presets_14ice_brinstar_kihunter_room: ; %cm_preset("Kihunter Room", #preset_14ice_brinstar_kihunter_room) ; presets_14ice_brinstar_moat: ; %cm_preset("Moat", #preset_14ice_brinstar_moat) ; presets_14ice_brinstar_ocean: ; %cm_preset("Ocean", #preset_14ice_brinstar_ocean) ; Wrecked Ship ; presets_14ice_wrecked_ship_wrecked_ship_shaft: ; %cm_preset("Wrecked Ship Shaft", #preset_14ice_wrecked_ship_wrecked_ship_shaft) ; presets_14ice_wrecked_ship_phantoon: ; %cm_preset("Phantoon", #preset_14ice_wrecked_ship_phantoon) ; presets_14ice_wrecked_ship_wrecked_ship_supers: ; %cm_preset("Wrecked Ship Supers", #preset_14ice_wrecked_ship_wrecked_ship_supers) ; presets_14ice_wrecked_ship_shaft_revisit: ; %cm_preset("Shaft Revisit", #preset_14ice_wrecked_ship_shaft_revisit) ; presets_14ice_wrecked_ship_attic: ; %cm_preset("Attic", #preset_14ice_wrecked_ship_attic) ; presets_14ice_wrecked_ship_bowling_alley_path: ; %cm_preset("Bowling Alley Path", #preset_14ice_wrecked_ship_bowling_alley_path) ; presets_14ice_wrecked_ship_bowling_alley: ; %cm_preset("Bowling Alley", #preset_14ice_wrecked_ship_bowling_alley) ; presets_14ice_wrecked_ship_leaving_gravity: ; %cm_preset("Leaving Gravity", #preset_14ice_wrecked_ship_leaving_gravity) ; Brinstar Revisit ; presets_14ice_brinstar_revisit_red_tower_elevator: ; %cm_preset("Red Tower Elevator", #preset_14ice_brinstar_revisit_red_tower_elevator) ; presets_14ice_brinstar_revisit_breaking_tube: ; %cm_preset("Breaking Tube", #preset_14ice_brinstar_revisit_breaking_tube) ; presets_14ice_brinstar_revisit_entering_kraids_lair: ; %cm_preset("Entering Kraids Lair", #preset_14ice_brinstar_revisit_entering_kraids_lair) ; presets_14ice_brinstar_revisit_baby_kraid_entering: ; %cm_preset("Baby Kraid (Entering)", #preset_14ice_brinstar_revisit_baby_kraid_entering) ; presets_14ice_brinstar_revisit_kraid: ; %cm_preset("Kraid", #preset_14ice_brinstar_revisit_kraid) ; presets_14ice_brinstar_revisit_baby_kraid_exiting: ; %cm_preset("Baby Kraid (Exiting)", #preset_14ice_brinstar_revisit_baby_kraid_exiting) ; presets_14ice_brinstar_revisit_kraid_etank: ; %cm_preset("Kraid E-tank", #preset_14ice_brinstar_revisit_kraid_etank) ; Upper Norfair ; presets_14ice_upper_norfair_ice_beam: ; %cm_preset("Ice Beam", #preset_14ice_upper_norfair_ice_beam) ; presets_14ice_upper_norfair_ice_escape: ; %cm_preset("Ice Escape", #preset_14ice_upper_norfair_ice_escape) ; presets_14ice_upper_norfair_precathedral: ; %cm_preset("Pre-Cathedral", #preset_14ice_upper_norfair_precathedral) ; presets_14ice_upper_norfair_bubble_mountain: ; %cm_preset("Bubble Mountain", #preset_14ice_upper_norfair_bubble_mountain) ; presets_14ice_upper_norfair_magdollite_room: ; %cm_preset("Magdollite Room", #preset_14ice_upper_norfair_magdollite_room) ; presets_14ice_upper_norfair_kronic_boost: ; %cm_preset("Kronic Boost", #preset_14ice_upper_norfair_kronic_boost) ; Lower Norfair ; presets_14ice_lower_norfair_ln_main_hall: ; %cm_preset("LN Main Hall", #preset_14ice_lower_norfair_ln_main_hall) ; presets_14ice_lower_norfair_pillars: ; %cm_preset("Pillars", #preset_14ice_lower_norfair_pillars) ; presets_14ice_lower_norfair_worst_room: ; %cm_preset("Worst Room", #preset_14ice_lower_norfair_worst_room) ; presets_14ice_lower_norfair_amphitheatre: ; %cm_preset("Amphitheatre", #preset_14ice_lower_norfair_amphitheatre) ; presets_14ice_lower_norfair_kihunter_stairs: ; %cm_preset("Kihunter Stairs", #preset_14ice_lower_norfair_kihunter_stairs) ; presets_14ice_lower_norfair_wasteland: ; %cm_preset("Wasteland", #preset_14ice_lower_norfair_wasteland) ; presets_14ice_lower_norfair_metal_pirates: ; %cm_preset("Metal Pirates", #preset_14ice_lower_norfair_metal_pirates) ; presets_14ice_lower_norfair_ridley: ; %cm_preset("Ridley", #preset_14ice_lower_norfair_ridley) ; presets_14ice_lower_norfair_leaving_ridley: ; %cm_preset("Leaving Ridley", #preset_14ice_lower_norfair_leaving_ridley) ; presets_14ice_lower_norfair_wasteland_revisit: ; %cm_preset("Wasteland Revisit", #preset_14ice_lower_norfair_wasteland_revisit) ; presets_14ice_lower_norfair_kihunter_stairs_revisit: ; %cm_preset("Kihunter Stairs Revisit", #preset_14ice_lower_norfair_kihunter_stairs_revisit) ; presets_14ice_lower_norfair_fireflea_room: ; %cm_preset("Fireflea Room", #preset_14ice_lower_norfair_fireflea_room) ; presets_14ice_lower_norfair_three_musketeers: ; %cm_preset("Three Musketeers", #preset_14ice_lower_norfair_three_musketeers) ; presets_14ice_lower_norfair_bubble_mountain_revisit: ; %cm_preset("Bubble Mountain Revisit", #preset_14ice_lower_norfair_bubble_mountain_revisit) ; Maridia ; presets_14ice_maridia_entering_maridia: ; %cm_preset("Entering Maridia", #preset_14ice_maridia_entering_maridia) ; presets_14ice_maridia_mt_everest: ; %cm_preset("Mt Everest", #preset_14ice_maridia_mt_everest) ; presets_14ice_maridia_ice_clip: ; %cm_preset("Ice Clip", #preset_14ice_maridia_ice_clip) ; presets_14ice_maridia_botwoon: ; %cm_preset("Botwoon", #preset_14ice_maridia_botwoon) ; presets_14ice_maridia_botwoon_etank_room: ; %cm_preset("Botwoon E-tank Room", #preset_14ice_maridia_botwoon_etank_room) ; presets_14ice_maridia_colosseum: ; %cm_preset("Colosseum", #preset_14ice_maridia_colosseum) ; presets_14ice_maridia_draygon: ; %cm_preset("Draygon", #preset_14ice_maridia_draygon) ; presets_14ice_maridia_colosseum_revisit: ; %cm_preset("Colosseum Revisit", #preset_14ice_maridia_colosseum_revisit) ; presets_14ice_maridia_reverse_botwoon: ; %cm_preset("Reverse Botwoon", #preset_14ice_maridia_reverse_botwoon) ; presets_14ice_maridia_aqueduct_revisit: ; %cm_preset("Aqueduct Revisit", #preset_14ice_maridia_aqueduct_revisit) ; presets_14ice_maridia_everest_revisit: ; %cm_preset("Everest Revisit", #preset_14ice_maridia_everest_revisit) ; presets_14ice_maridia_red_tower_green_gate: ; %cm_preset("Red Tower Green Gate", #preset_14ice_maridia_red_tower_green_gate) ; Tourian ; presets_14ice_tourian_kihunter_room_revisit: ; %cm_preset("Kihunter Room Revisit", #preset_14ice_tourian_kihunter_room_revisit) ; presets_14ice_tourian_terminator_revisit: ; %cm_preset("Terminator Revisit", #preset_14ice_tourian_terminator_revisit) ; presets_14ice_tourian_pirate_shaft_revisit: ; %cm_preset("Pirate Shaft Revisit", #preset_14ice_tourian_pirate_shaft_revisit) ; presets_14ice_tourian_metroids_1: ; %cm_preset("Metroids 1", #preset_14ice_tourian_metroids_1) ; presets_14ice_tourian_metroids_2: ; %cm_preset("Metroids 2", #preset_14ice_tourian_metroids_2) ; presets_14ice_tourian_metroids_3: ; %cm_preset("Metroids 3", #preset_14ice_tourian_metroids_3) ; presets_14ice_tourian_metroids_4: ; %cm_preset("Metroids 4", #preset_14ice_tourian_metroids_4) ; presets_14ice_tourian_baby: ; %cm_preset("Baby", #preset_14ice_tourian_baby) ; presets_14ice_tourian_zeb_skip: ; %cm_preset("Zeb Skip", #preset_14ice_tourian_zeb_skip) ; presets_14ice_tourian_escape_room_3: ; %cm_preset("Escape Room 3", #preset_14ice_tourian_escape_room_3) ; presets_14ice_tourian_escape_parlor: ; %cm_preset("Escape Parlor", #preset_14ice_tourian_escape_parlor)
12_02CBMScrDisp/bak/12_01ScrDisp.asm
phaze101/C64-Bedtime-Coding-Public
0
19045
<gh_stars>0 ;============================================================================ ; C64 Bedtime Coding ; By Phaze 101 ; ; Article 12 - Example 01 ;============================================================================ ; I wish to thank all those that sent me emails or get in touch with me ; regarding this serious or articles. ; ; Also I would like to thank my team for their help in making these articles ; possible and for their help in translating these articles to Italian. ; ; If you find any bugs (I am not not perfect) or issues please get in touch. ; I will do my best to help out where possible however do allow sometime ; since I also have a day job to deal with. ;============================================================================== ; Where to assemble in memory ;============================================================================== * = $c000 ;============================================================================== ; Constants V1.0 ; ; In future this will be a separate file ;============================================================================== ;Base Addresses ScrBase = $0400 ScrCol = $d800 ZeroPtr1Low = $03 ZeroPtr1High = $04 ZeroPtr2Low = $05 ZeroPtr2High = $06 ;Temp Memory Locations in Page Zero ZeroTmpMem01 = $02 ZeroTmpMem02 = $2A ZeroTmpMem03 = $52 ;C64 colours Definitions Black = 0 White = 1 Red = 2 Cyan = 3 Purple = 4 Green = 5 Blue = 6 Yellow = 7 Orange = 8 Brown = 9 LightRed = 10 DarkGray = 11 MediumGray = 12 LightGreen = 13 LightBlue = 14 LightGray = 15 ;Character Values SpaceCharacter = 32 ;Logic constants False = 0 True = 1 ;============================================================================== ; Main Entry ;============================================================================== Main ldx #Green ldy #LightGreen jsr SetBgBorder jsr DisplayScreens jsr WaitForSpace ldx #Blue ;Restore Background Colour ldy #LightBlue ;Restore Border Colour jsr SetBgBorder lda #SpaceCharacter ;Fill value ldy #Black ;Colour Value jsr ScrFill rts ;============================================================================== ; Set Baground and Border ; ; Input ; X Register - Value for Background ; Y Register - Valeu for Border ;============================================================================== SetBgBorder stx $d021 sty $d020 rts ;============================================================================== ; Screen Fill ; Set the screen text to a colour ; ; Input ; A register = Fill Value ; Y register = Colour Value ;============================================================================== ScrFill sta $fb ;Fill Character ldx #$00 ScrLoop lda $fb sta ScrBase,x ; Screen 1024 sta ScrBase+250,x ; Screen 1024 + 250 sta ScrBase+500,x ; Screen 1024 + 500 sta ScrBase+750,x ; Screen 1024 + 750 tya ; Colour Value is in Y register sta ScrCol,x ; Colour Mem 55296 sta ScrCol+250,x ; Colour Mem 55296 + 250 sta ScrCol+500,x ; Colour Mem 55296 + 500 sta ScrCol+750,x ; Colour Mem 55296 + 750 inx cpx #$fa bne ScrLoop rts ;============================================================================== ; Wait for Space bar to be pressed ;============================================================================== WaitForSpace ; sei lda #%11111111 sta $dc02 lda #%00000000 sta $dc03 lda #$7f ;%01111111 - only row 7 KB matrix sta $dc00 WaitLoop1 lda $dc01 and #$10 ;mask %00010000 bne WaitLoop1 WaitLoop2 lda $dc01 and #$10 ;mask %00010000 beq WaitLoop2 ; cli rts ;============================================================================== ; Set Cursor Position on Screen ; ; Input ; X register - number of Colums ; Y register - number of rows ;============================================================================== SetCurs cld cpy #$0 beq AddColumn ;Use an addition to calculate rows CalcRow clc lda #$28 adc Buf2 sta Buf2 lda #$0 adc Buf2+1 sta Buf2+1 dey bne CalcRow ;Add Column AddColumn cpx #$0 beq AddScrBase clc txa adc Buf2 sta Buf2 lda #$0 adc Buf2+1 sta Buf2+1 ;Add position to base address AddScrBase clc lda Buf1 adc Buf2 sta Buf3 lda Buf1+1 adc Buf2+1 sta Buf3+1 rts Buf1 word ScrBase Buf2 word $0000 ;Holds offset from Screen Base Address Buf3 word $0000 ;Holds Screen Address where to write first char ;============================================================================== ; Print At with Colour ; 1. Handles number Strings in one Pass ; 2. Read X and Y values from first 2 bytes before each string ; 3. String 3rd byte contains Colour ; 4. Handles colour for the string ; ; PrintAT requires that ZeroTmpMem01 is set before it is called. ; ZeroTmpMem01 is used by PrintAT to know how many strings it needs to print ;============================================================================== PrintAT ;Init Part sta $fb ;source - Pointing to first byte X value sty $fc ;Get offset for screen and colour men SetPos jsr ClearBuffers ;make sure buffers are clear ldy #$0 lda ($fb),y ;Get No of Columns tax iny lda ($fb),y ;Get No of Rows tay jsr SetCurs ;Calculate Offset in colour memory clc lda #<ScrCol adc Buf2 sta ZeroPtr1Low lda #>ScrCol adc Buf2+1 sta ZeroPtr1High ;Get text colour and sore it in memory ldy #$2 lda ($fb),y sta ZeroTmpMem02 ;Set Source to the String that will be Printed - skip 3 Bytes clc lda #$03 adc $fb sta $fb lda #$0 adc $fc sta $fc ;Set Destination on the Screen lda Buf3 ;destination sta $fd lda Buf3+1 sta $fe ;Read String and Display it ldy #$0 lda ($fb),y PrtLoop beq PrintNextString sta ($fd),y lda ZeroTmpMem02 sta (ZeroPtr1Low),y iny lda ($fb),y bne PrtLoop ;Is there more strings to print PrintNextString dec ZeroTmpMem01 ;we could have used DEC NoStrs but in doing so ;the next time we run the program NoStrs will ;be a zero and we will not know how many ;strings there are to read ; cmp NoStrs ;this is not needed but for clarity is commented beq PrintExit ;If there is then Point to the next String iny ;AddrNextString clc tya adc $fb sta $fb lda #$0 adc $fc sta $fc jmp SetPos PrintExit rts ;============================================================================== ; Display Screen with Text ;============================================================================== DisplayScreens lda #SpaceCharacter ;Fill value ldy #Black ;Colour Value jsr ScrFill ;Display Home Screen lda HomeScreen ;Get number of strings sta ZeroTmpMem01 ;store it in out templocation lda #<HomeScreen+1 ;CBMProgStudio Enable ;Calc address first then Lo/Hi Byte ldy #>HomeScreen+1 ;CBMProgStudio Enable ;Calc address first then Lo/Hi Byte jsr PrintAT jsr WaitForSpace lda #SpaceCharacter ;Fill value ldy #Black ;Colour Value jsr ScrFill ;Display Game Screen jsr CBMScreen jsr WaitForSpace lda #SpaceCharacter ;Fill value ldy #Black ;Colour Value jsr ScrFill ;Display Game Over Screen lda GameOverScreen ;Get number of strings sta ZeroTmpMem01 ;store it in out temp location lda #<GameOverScreen+1 ;CBMProgStudio Enable ;Calc address first then Lo/Hi Byte ldy #>GameOverScreen+1 ;CBMProgStudio Enable ;Calc address first then Lo/Hi Byte jsr PrintAT rts ;============================================================================== ; CBM Prog Studio Screen Display ;============================================================================== CBMScreen ldx #$00 ldy #$00 @Loop lda Screen_1_Screen_data,y sta ScrBase,x ; Screen 1024 lda Screen_1_Screen_data+250,y sta ScrBase+250,x ; Screen 1024 + 250 lda Screen_1_Screen_data+500,y sta ScrBase+500,x ; Screen 1024 + 500 lda Screen_1_Screen_data+750,y sta ScrBase+750,x ; Screen 1024 + 750 lda Screen_1_Colour_data,y sta ScrCol,x ; Colour Mem 55296 lda Screen_1_Colour_data+250,y sta ScrCol+250,x ; Colour Mem 55296 + 250 lda Screen_1_Colour_data+500,y sta ScrCol+500,x ; Colour Mem 55296 + 500 lda Screen_1_Colour_data+750,y sta ScrCol+750,x ; Colour Mem 55296 + 750 iny inx cpx #$fa bne @Loop rts ;============================================================================== ; Clear Memory Buffers ;============================================================================== ClearBuffers ldy #$4 lda #$0 ClrBufLoop dey sta Buf2,y bne ClrBufLoop rts ;============================================================================== ; Data ; ; First byte is number of strings to Read ; First 2 bytes of each string are the X and Y position on the screen ; Third Byte is the colour of our string ; Each String ternimantes with a value of 0 ;============================================================================== HomeScreen byte $06 byte $01,$01,Black ;X,Y Position text 'phaze101',0 byte $04,$05,DarkGray text 'in collaboration with',0 byte $07,$09,MediumGray text 'retroprogramming italia',0 byte $0a,$0d,LightGray text 'presents',0 byte $0d,$11,MediumGray text 'panic 101',0 byte $10,$15,White text 'press any key to play',0 GameScreen byte $08 ;No of Strings to Print byte $01,$00,White ;X,Y Position + colour text 'score:0000',0 byte $0f,$00,Blue text 'hi-score:0000',0 byte $20,$00,Red text 'Lives:3',0 byte $00,$04,Brown text '{127*40}',0 byte $00,$09,Brown text '{127*40}',0 byte $00,$0e,Brown text '{127*40}',0 byte $00,$13,Brown text '{127*40}',0 byte $00,$18,Black text '{102*40}',0 GameOverScreen byte $02 byte $0f,$0c,Black ;X,Y Position text 'Game Over',0 byte $0c,$18,White text 'press any key to play again',0 ;============================================================================== ; CBM Prg Studio Screen Editor Output Data - Saved as Assember data ; ; Please note that this is nearly 2K of Data (1000 chars + 1000 colours) ;============================================================================== ; Screen 1 - Screen data Screen_1_Screen_data BYTE $20,$13,$03,$0F,$12,$05,$3A,$30,$30,$30,$30,$20,$20,$20,$20,$08,$09,$2D,$13,$03,$0F,$12,$05,$3A,$30,$30,$30,$30,$20,$20,$20,$20,$0C,$09,$16,$05,$13,$3A,$33,$20 BYTE $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20 BYTE $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20 BYTE $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20 BYTE $66,$66,$66,$6B,$73,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$6B,$73,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66 BYTE $20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20 BYTE $20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20 BYTE $20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20 BYTE $20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20 BYTE $66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$6B,$73,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$6B,$73,$66,$66,$66,$66 BYTE $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20 BYTE $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20 BYTE $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20 BYTE $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20 BYTE $66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$6B,$73,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66 BYTE $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20 BYTE $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20 BYTE $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20 BYTE $20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20 BYTE $66,$66,$66,$66,$66,$66,$6B,$73,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$6B,$73,$66,$66,$66,$66,$66,$66 BYTE $20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20 BYTE $20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20 BYTE $20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20 BYTE $20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$6B,$73,$20,$20,$20,$20,$20,$20 BYTE $66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66,$66 ; Screen 1 - Colour data Screen_1_Colour_data BYTE $05,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$05,$05,$05,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$06,$05,$05,$05,$02,$02,$02,$02,$02,$02,$02,$05 BYTE $05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05 BYTE $05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05 BYTE $05,$05,$05,$05,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05 BYTE $00,$00,$00,$0C,$0C,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0C,$0C,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 BYTE $05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05 BYTE $05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05 BYTE $05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05 BYTE $05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05 BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0C,$0C,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0C,$0C,$00,$00,$00,$00 BYTE $05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05 BYTE $05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05 BYTE $05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05 BYTE $05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05 BYTE $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0C,$0C,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 BYTE $05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05 BYTE $05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05 BYTE $05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05 BYTE $05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05 BYTE $00,$00,$00,$00,$00,$00,$0C,$0C,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$0C,$0C,$00,$00,$00,$00,$00,$00 BYTE $05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05 BYTE $05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05 BYTE $05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05 BYTE $05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$05,$0C,$0C,$05,$05,$05,$05,$05,$05 BYTE $09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09
Data0/data/presets/humanai.pre.als
tmesser/DyingLightMods
1
969
<reponame>tmesser/DyingLightMods sub main() { alias("Character", "DW_Zombie_A_Vessel", "Biter_Man"); alias("Character", "DW_Zombie_A_Vessel_A", "Biter_Man"); alias("Character", "DW_Zombie_A_Vessel_B", "Biter_Man"); alias("Character", "DW_Zombie_A_Vessel_C", "Biter_Man"); alias("Character", "DW_Zombie_A_Vessel_Fast", "Biter_Man"); alias("Character", "DW_Zombie_A_Vessel_Fast_A", "Biter_Man"); alias("Character", "DW_Zombie_A_Vessel_Fast_C", "Biter_Man"); alias("Character", "DW_Zombie_A_Vessel_Fast_B", "Biter_Man"); alias("Character", "DW_ZombieW_A_Vessel_NoGrab", "BiterNoGrab_Woman"); alias("Character", "DW_Zombie_Worker", "Biter_Man"); alias("Character", "DW_Zombie_A_Vessel_NoGrab", "BiterNoGrab_Man"); alias("Character", "DW_Zombie_B_Vessel_NoGrab", "BiterNoGrab_Man"); alias("Character", "DW_Zombie_A_Vessel_Blister", "BiterBlister_Man"); alias("Character", "DW_Zombie_A_Vessel_Poison", "BiterPoison_Man"); alias("Character", "DW_Zombie_A_Vessel_With_Weapon", "BiterWeapon_Man"); alias("Character", "DW_Zombie_A_Vessel_Stinger_Rednec", "BiterStinger_Redneck"); alias("Character", "DW_Zombie_Redneck", "Biter_Redneck"); alias("Character", "Alan_Prime", "Prime"); alias("Character", "Special_Prime", "Prime"); alias("Character", "Arena_Armored", "Demolisher"); alias("Character", "Arena_Thug", "Goon_Slums"); alias("Character", "Courier_Thug", "Goon_Slums"); alias("Character", "Special_Thug", "Goon_Slums"); alias("Character", "Special_Thug_Armed_Easy", "Goon_Slums"); alias("Character", "Special_Thug_Armed_Medium", "Goon_Wasteland"); alias("Character", "Special_Thug_Armed_Hard", "Goon_OldTown"); alias("Character", "Special_Thug_Boss", "Goon_OldTown"); alias("Character", "Arena_Volatile", "Volatile"); alias("Character", "Arena_Zombie_A_Infected", "Viral_Man"); alias("Character", "Arena_Zombie_A_Vessel", "Biter_Man"); alias("Character", "DW_Zombie_A_Spitter_Easy", "Toad_Slums"); alias("Character", "DW_Zombie_A_Spitter_Medium", "Toad_Wasteland"); alias("Character", "DW_Zombie_A_Spitter_Hard", "Toad_OldTown"); alias("Character", "DW_Zombie_A_Spitter_Boss", "Toad_OldTown"); alias("Character", "DW_Zombie_Screamer", "Screamer"); alias("Character", "Special_Armored", "Demolisher"); alias("Character", "Special_SuicideBomber", "RunningBomber"); alias("Character", "Special_StadiumSuicideBomber", "RunningBomber_Stadium"); alias("Character", "Special_Suicider", "Bomber"); alias("Character", "Special_Suicider_Poison", "BomberPoison"); alias("Character", "wasteland_armored_naked", "Demolisher_Wasteland"); alias("Character", "DW_DeadStinger_001", "BiterStinger_Man"); alias("Character", "DW_Zombie_A_Vessel_Grab", "BiterStinger_Man"); alias("Character", "DW_DeadZombie_001", "BiterStinger_Man"); alias("Character", "DW_Zombie_A_Vessel_Stinger", "BiterStinger_Man"); alias("Character", "DW_F_NightWalker_A", "NightWalker_Woman"); alias("Character", "DW_M_NightWalker_A", "NightWalker_Man"); alias("Character", "DW_M_NightWalker_B", "NightWalker_Man"); alias("Character", "DW_ZombieW_A_Infected", "Viral_Woman"); alias("Character", "DW_ZombieW_A_Stinger", "BiterStinger_Woman"); alias("Character", "DW_ZombieW_A_Vessel", "Biter_Woman"); alias("Character", "DW_ZombieW_A_Vessel_Blister", "BiterBlister_Woman"); alias("Character", "DW_ZombieW_B_Vessel", "Biter_Woman"); alias("Character", "DW_Zombie_A_Infected_Blister", "ViralBlister_Man"); alias("Character", "DW_Zombie_A_Infected_Redneck", "Viral_Redneck"); alias("Character", "DW_Zombie_A_Spitter_Poison", "ToadPoison"); alias("Character", "DW_Zombie_A_Infected_Poison", "ViralPoison_Man"); alias("Character", "DW_Zombie_A_Infected_Humanity_TEST", "ViralHumanity_Man"); alias("Character", "DW_Zombie_A_Infected", "Viral_Man"); alias("Character", "DW_Zombie_A_Vessel_Lurker", "BiterLurker_Man"); alias("Character", "DW_Zombie_GasTank", "GasTank"); alias("Character", "DW_Zombie_GasTank_FireProof", "GasTank"); alias("Character", "InfVolatileForm_A", "Volatile"); alias("Character", "DW_M_Zombie_A_Walker_NEW", "Biter_Man"); alias("Character", "DW_M_Zombie_A_Walker_NEW_NW", "Biter_Man_NW"); alias("Character", "DW_M_Zombie_B_Fast_Walker_NEW", "Biter_Man"); alias("Character", "DW_M_Zombie_B_Fast_Walker_NEW_NW", "Biter_Man_NW"); alias("Character", "DW_ZombieW_A_Vessel", "Biter_Woman"); alias("Character", "DW_ZombieW_A_Vessel_NW", "Biter_Woman_NW"); alias("Character", "DW_Zombie_A_Infected_Burn", "ViralBurn_Man"); alias("Character", "Volatile_Scout_Detector_Demo_E3", "Volatile"); alias("Character", "Volatile_Scout_Demo_E3", "Volatile"); alias("Character", "Special_Thug_Poison_Scaled", "GoonPoison"); alias("Character", "Special_Thug_Poison", "GoonPoison"); alias("Character", "Special_Thug_GasTank", "GasTank"); alias("Character", "Special_Hulk", "Demolisher_Wasteland"); alias("Character", "Infected_Humanity_Demo_E3", "ViralHumanity_Man"); alias("Character", "Dead_Volatile_Demo_E3", "Volatile"); alias("Character", "DW_Zombie_A_Vessel_Burn", "BiterBurn_Man"); alias("Character", "DW_Zombie_Hive_Brood", "Hive_Brood"); }
ada_gui-gnoga-server-template_parser.adb
jrcarter/Ada_GUI
19
3437
<filename>ada_gui-gnoga-server-template_parser.adb -- Ada_GUI implementation based on Gnoga. Adapted 2021 -- -- -- GNOGA - The GNU Omnificent GUI for Ada -- -- -- -- G N O G A . S E R V E R . T E M P L A T E _ P A R S E R -- -- -- -- B o d y -- -- -- -- -- -- Copyright (C) 2014 <NAME> -- -- -- -- This library 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 library is distributed in the hope that it will be -- -- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are -- -- granted additional permissions described in the GCC Runtime Library -- -- Exception, version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- For more information please go to http://www.gnoga.com -- ------------------------------------------------------------------------------ with Ada.Text_IO; with Ada.Strings.Fixed; with GNAT.OS_Lib; package body Ada_GUI.Gnoga.Server.Template_Parser is Template_Directory : Ada.Strings.Unbounded.Unbounded_String := Ada.Strings.Unbounded.To_Unbounded_String (Gnoga.Server.Templates_Directory); -------------- -- Finalize -- -------------- overriding procedure Finalize (Object : in out View_Data) is begin Clear (Object); end Finalize; ------------------- -- Variable_Name -- ------------------- procedure Variable_Name (Data : in out View_Data; Name : String) is begin Data.Name := Ada.Strings.Unbounded.To_Unbounded_String (Name); end Variable_Name; ------------ -- Insert -- ------------ procedure Insert (Data : in out View_Data; Key : String; Value : String) is begin Data.String_Values.Insert (Key, Value); end Insert; procedure Insert (Data : in out View_Data; Key : String; Value : Integer) is String_Value : constant String := Integer'Image (Value); begin Insert (Data, Key, String_Value (String_Value'First + 1 .. String_Value'Last)); end Insert; ------------------ -- Insert_Array -- ------------------ procedure Insert_Array (Data : in out View_Data; Vector : Gnoga.Data_Array_Type) is begin for I in Vector.First_Index .. Vector.Last_Index loop declare K : constant String := I'Img; begin Data.Insert (K (K'First + 1 .. K'Last), Vector.Element (I)); end; end loop; end Insert_Array; ----------------------- -- Insert_Array_Item -- ----------------------- procedure Insert_Array_Item (Data : in out View_Data; Key : String; Vector : Gnoga.Data_Array_Type) is Map : Gnoga.Data_Map_Type; begin for I in Vector.First_Index .. Vector.Last_Index loop declare K : constant String := I'Img; begin Map.Insert (K (K'First + 1 .. K'Last), Vector.Element (I)); end; end loop; Data.Insert_Map_Item (Key, Map); end Insert_Array_Item; ---------------- -- Insert_Map -- ---------------- procedure Insert_Map (Data : in out View_Data; Map : Gnoga.Data_Map_Type) is procedure foreach (Cursor : Gnoga.Data_Maps.Cursor); -- Iterate through required members procedure foreach (Cursor : Gnoga.Data_Maps.Cursor) is begin Data.Insert (Gnoga.Data_Maps.Key (Cursor), Gnoga.Data_Maps.Element (Cursor)); end foreach; begin Map.Iterate (foreach'Access); end Insert_Map; --------------------- -- Insert_Map_Item -- --------------------- procedure Insert_Map_Item (Data : in out View_Data; Key : String; Map : Gnoga.Data_Map_Type) is begin Data.Map_Values.Insert (Key, Map); end Insert_Map_Item; ---------------------- -- Insert_Recordset -- ---------------------- procedure Insert_Recordset (Data : in out View_Data; RS : in out Gnoga.Server.Database.Recordset'Class) is I : Integer := 1; begin while RS.Next loop declare Key : constant String := I'Img; begin I := I + 1; Data.Insert_Map_Item (Key (Key'First + 1 .. Key'Last), RS.Field_Values); end; end loop; end Insert_Recordset; ------------------- -- Insert_Record -- ------------------- procedure Insert_Record_Item (Data : in out View_Data; Key : String; Row : Gnoga.Server.Model.Active_Record'Class) is begin Data.Insert_Map_Item (Key, Row.Values); end Insert_Record_Item; ---------------- -- Inser_Rows -- ---------------- procedure Insert_Rows (Data : in out View_Data; Row : Gnoga.Server.Model.Queries.Active_Record_Array.Vector) is begin for I in 1 .. Natural (Row.Length) loop declare Key : constant String := I'Img; begin Data.Insert_Record_Item (Key => Key (Key'First + 1 .. Key'Last), Row => Row.Element (I)); end; end loop; end Insert_Rows; ------------------- -- Insert_Query -- ------------------- procedure Insert_Query (Data : in out View_Data; C : Gnoga.Server.Database.Connection'Class; Query : String) is RS : Gnoga.Server.Database.Recordset'Class := C.Query (Query); begin Insert_Recordset (Data, RS); end Insert_Query; ----------- -- Clear -- ----------- procedure Clear (Data : in out View_Data) is begin Data.String_Values.Clear; Data.Map_Values.Clear; end Clear; ---------------- -- Parse_Name -- ---------------- function Parse_Name (Name : String) return String is use Ada.Strings.Fixed; Templates_Dir : constant String := Ada.Strings.Unbounded.To_String (Template_Directory); begin if Index (Name, ":") > 0 or Name (Name'First) = GNAT.OS_Lib.Directory_Separator then return Name; end if; if Templates_Dir = "" then return Name; else return Templates_Dir & GNAT.OS_Lib.Directory_Separator & Name; end if; end Parse_Name; ---------------------------- -- Set_Template_Directory -- ---------------------------- procedure Set_Template_Directory (Directory : String) is begin Template_Directory := Ada.Strings.Unbounded.To_Unbounded_String (Directory); end Set_Template_Directory; ----------------------- -- Add_Error_Message -- ----------------------- procedure Add_Error_Message (Message : String) is begin Error_Queue.Append (Message); end Add_Error_Message; ----------------------- -- Clear_Error_Queue -- ----------------------- procedure Clear_Error_Queue is begin Error_Queue.Clear; end Clear_Error_Queue; ---------------------- -- Add_Info_Message -- ---------------------- procedure Add_Info_Message (Message : String) is begin Info_Queue.Append (Message); end Add_Info_Message; ---------------------- -- Clear_Info_Queue -- ---------------------- procedure Clear_Info_Queue is begin Info_Queue.Clear; end Clear_Info_Queue; -------------------------- -- Write_String_To_File -- -------------------------- procedure Write_String_To_File (File_Name : String; Value : String) is use Ada.Text_IO; F : File_Type; begin Create (File => F, Mode => Out_File, Name => File_Name); Put (F, Value); Close (F); end Write_String_To_File; end Ada_GUI.Gnoga.Server.Template_Parser;
tools-src/gnu/gcc/gcc/ada/s-vallli.adb
enfoTek/tomato.linksys.e2000.nvram-mod
80
19249
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . V A L _ L L I -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992,1993,1994,1995,1996 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with System.Unsigned_Types; use System.Unsigned_Types; with System.Val_LLU; use System.Val_LLU; with System.Val_Util; use System.Val_Util; package body System.Val_LLI is --------------------------- -- Scn_Long_Long_Integer -- --------------------------- function Scan_Long_Long_Integer (Str : String; Ptr : access Integer; Max : Integer) return Long_Long_Integer is Uval : Long_Long_Unsigned; -- Unsigned result Minus : Boolean := False; -- Set to True if minus sign is present, otherwise to False Start : Positive; -- Saves location of first non-blank (not used in this case) begin Scan_Sign (Str, Ptr, Max, Minus, Start); Uval := Scan_Long_Long_Unsigned (Str, Ptr, Max); -- Deal with overflow cases, and also with maximum negative number if Uval > Long_Long_Unsigned (Long_Long_Integer'Last) then if Minus and then Uval = Long_Long_Unsigned (-(Long_Long_Integer'First)) then return Long_Long_Integer'First; else raise Constraint_Error; end if; -- Negative values elsif Minus then return -(Long_Long_Integer (Uval)); -- Positive values else return Long_Long_Integer (Uval); end if; end Scan_Long_Long_Integer; ----------------------------- -- Value_Long_Long_Integer -- ----------------------------- function Value_Long_Long_Integer (Str : String) return Long_Long_Integer is V : Long_Long_Integer; P : aliased Integer := Str'First; begin V := Scan_Long_Long_Integer (Str, P'Access, Str'Last); Scan_Trailing_Blanks (Str, P); return V; end Value_Long_Long_Integer; end System.Val_LLI;
111.asm
LeslieYon/8086asm
0
11484
<gh_stars>0 DSEG SEGMENT;数据段 STRING1 DB 1,2,3,4,5 DSEG ENDS ESEG SEGMENT;附加段 STRING2 DB 5 DUP(?) ESEG ENDS SSEG SEGMENT;堆栈段 DW 10 DUP(?) SSEG ENDS CSEG SEGMENT;代码段 ASSUME CS:CSEG,DS:DSEG;声明各段于段寄存器的关系 ASSUME ES:ESEG,SS:SSEG START: MOV AX,DSEG;设定数据段 MOV DS,AX MOV AX,ESEG;设定附加段 MOV ES,AX MOV AX,SSEG;设定堆栈段 MOV SS,AX LEA SI,STRING1;将str1复制到str2的位置 LEA DI,STRING2 MOV CX,5 CLD;设置复制方向为从低到高 REP MOVSB MOV AH,4CH;程序结束 INT 21H CSEG ENDS END START
programs/oeis/219/A219647.asm
neoneye/loda
22
173602
<reponame>neoneye/loda<filename>programs/oeis/219/A219647.asm ; A219647: Positions of zeros in A219649. ; 0,2,5,9,13,18,23,29,36,43,51,59,67,76,85,95,105,115,126,137,148,160,172,185,198,211,225,239,253,268,283,298,314,330,347,364,382,400,418,437,456,475,495,515,535,556,577,599,621,643,666,689,712,735,759,784,809,835,861,887,914,941,968,996,1024,1052,1081,1110,1140,1170,1200,1231,1262,1293,1324,1356,1388,1420,1453,1486,1519,1553,1587,1621,1656,1691,1726,1761,1796,1832,1868,1905,1942,1979,2017,2055,2093,2132,2171,2210 max $1,$0 seq $1,219646 ; Partial sums of A219642. add $1,$0 mov $0,$1
asm/patches/swordless.asm
Crain-32/wwrando
47
91475
<filename>asm/patches/swordless.asm ; Make Phantom Ganon take damage from the Skull Hammer instead of the Master Sword. .open "files/rels/d_a_fganon.rel" ; Phantom Ganon .org 0x5EE0 ; In damage_check__FP12fganon_class ; Checks the damage type bit. Change it from checking bit 00000002 (sword damage) to bit 00010000 (hammer damage). rlwinm. r0, r0, 0, 15, 15 .org 0x5EF0 ; In damage_check__FP12fganon_class ; Skip the code that checks that you have a master sword equipped. b 0x5F0C .close ; Temporarily give the player the Hero's Sword during the Ganondorf fight by hijacking the code that temporarily removes your bow. ; And do the same while in Orca's house so you can get his two items. .open "sys/main.dol" .org 0x80235F10 ; In phase_4__FP13dScnPly_ply_c b give_temporary_sword_during_ganondorf_fight_in_swordless .org 0x8023607C ; In phase_4__FP13dScnPly_ply_c b give_temporary_sword_in_orcas_house_in_swordless .org 0x80236084 ; In phase_4__FP13dScnPly_ply_c b remove_temporary_sword_when_loading_stage_in_swordless .close
asmtest.asm
brice-v/InstructionSetSimulator
0
8759
#Assembly Language Test Start: lda 0x04 adda 0x1F inva adda 0x2F sta 0x4000 jsr [TEST] ldx 0x400 sta 0x400 inca sta 0x401 inca sta 0x402 ldb [X+0] ldb [X+1] ldb [x+2] stb [x+500] sta [X+501] End: hlt TEST: lda 0x06 ldb 0x03 lds 0x5012 psha pshb rfs
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_1517_628.asm
ljhsiun2/medusa
9
242783
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r14 push %r8 push %r9 push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x10437, %r8 nop nop nop nop nop cmp $59340, %rdx movups (%r8), %xmm4 vpextrq $0, %xmm4, %r11 nop nop nop and $31387, %r8 lea addresses_normal_ht+0x5637, %r13 nop nop nop nop xor %r9, %r9 mov $0x6162636465666768, %r14 movq %r14, %xmm4 vmovups %ymm4, (%r13) cmp $23974, %r9 lea addresses_UC_ht+0x308f, %rsi lea addresses_A_ht+0x1b5ab, %rdi nop nop nop nop nop add %r11, %r11 mov $77, %rcx rep movsw nop nop nop and %r8, %r8 lea addresses_normal_ht+0x3b6f, %rdi nop nop inc %r11 movw $0x6162, (%rdi) nop nop nop inc %rcx lea addresses_WC_ht+0xb9b7, %rsi lea addresses_UC_ht+0x7637, %rdi nop sub %r13, %r13 mov $98, %rcx rep movsw nop nop nop and $3642, %rdx lea addresses_UC_ht+0x89b7, %r8 nop nop nop nop sub $26145, %rsi movb (%r8), %r13b nop nop nop nop xor %r11, %r11 lea addresses_normal_ht+0x17a37, %r8 nop nop add $38169, %rsi movb $0x61, (%r8) nop nop nop xor $60037, %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %r9 pop %r8 pop %r14 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r8 push %rax push %rbp push %rbx // Store lea addresses_normal+0x16d8f, %r11 nop nop and %rbp, %rbp mov $0x5152535455565758, %r8 movq %r8, %xmm1 vmovups %ymm1, (%r11) nop nop nop nop nop cmp %r13, %r13 // Store lea addresses_RW+0x2757, %r8 nop nop nop inc %rax mov $0x5152535455565758, %r10 movq %r10, %xmm0 movaps %xmm0, (%r8) add $21822, %rax // Store lea addresses_WT+0x5737, %r13 nop nop nop nop add $51692, %rbx movl $0x51525354, (%r13) nop nop xor %rbx, %rbx // Faulty Load lea addresses_RW+0x19e37, %rbp sub $8459, %rax mov (%rbp), %r8w lea oracles, %rax and $0xff, %r8 shlq $12, %r8 mov (%rax,%r8,1), %r8 pop %rbx pop %rbp pop %rax pop %r8 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 32, 'NT': True, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 3}} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': True, 'size': 16, 'NT': False, 'same': False, 'congruent': 4}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': True, 'size': 4, 'NT': False, 'same': False, 'congruent': 8}} [Faulty Load] {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 11}} {'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}} {'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}} {'src': {'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 1, 'NT': False, 'same': False, 'congruent': 10}} {'32': 1517} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
Theory-and-Practice-of-Formal-Languages-Parsing/Grammars/CaseInsensitivityRuntime/CaseInsensitivityRuntimeLexer.g4
KvanTTT/Samples
0
7507
lexer grammar CaseInsensitivityRuntimeLexer; Abstract: 'abstract'; BoolType: 'boolean'; BoolConstant: 'true' | 'false'; WHITESPACE: [ \r\n\t]+ -> channel(HIDDEN);
libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sccz80/floor_fastcall.asm
Frodevan/z88dk
640
17555
<gh_stars>100-1000 SECTION code_fp_math32 PUBLIC floor_fastcall EXTERN m32_floor_fastcall defc floor_fastcall = m32_floor_fastcall ; SDCC bridge for Classic IF __CLASSIC PUBLIC _floor_fastcall defc _floor_fastcall = m32_floor_fastcall ENDIF
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cd/cd2a31c.ada
best08618/asylo
7
9780
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cd/cd2a31c.ada -- CD2A31C.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT INTEGER 'SIZE SPECIFICATIONS CAN BE GIVEN: -- IN THE VISIBLE OR PRIVATE PART OF A PACKAGE FOR A TYPE -- DECLARED IN THE VISIBLE PART; -- FOR A DERIVED INTEGER TYPE; -- FOR A DERIVED PRIVATE TYPE WHOSE FULL DECLARATION IS AS -- AN INTEGER TYPE; -- FOR AN INTEGER TYPE IN A GENERIC UNIT. -- HISTORY: -- PWB 06/17/87 CREATED ORIGINAL TEST. -- DHH 04/06/89 CHANGED EXTENSION FROM '.DEP' TO '.ADA', CHANGED -- SIZE CLAUSE VALUE TO 9, AND ADDED REPRESENTAION -- CLAUSE CHECK AND INCLUDED TEST FOR INTEGER IN A -- GENERIC UNIT. -- JRL 03/27/92 REMOVED TESTING OF NONOBJECTIVE TYPES. -- DTN 06/17/92 REMOVED THE LENGTH CLAUSE FOR TYPE PRIVATE_INT. WITH REPORT; USE REPORT; WITH LENGTH_CHECK; -- CONTAINS A CALL TO 'FAILED'. PROCEDURE CD2A31C IS TYPE BASIC_INT IS RANGE -60 .. 80; SPECIFIED_SIZE : CONSTANT := 9; TYPE DERIVED_INT IS NEW BASIC_INT; FOR DERIVED_INT'SIZE USE SPECIFIED_SIZE; PACKAGE P IS TYPE INT_IN_P IS RANGE -125 .. 125; FOR INT_IN_P'SIZE USE SPECIFIED_SIZE; TYPE PRIVATE_INT IS PRIVATE; TYPE ALT_INT_IN_P IS RANGE -125 .. 125; PRIVATE TYPE PRIVATE_INT IS RANGE -125 .. 125; FOR ALT_INT_IN_P'SIZE USE SPECIFIED_SIZE; END P; USE P; TYPE DERIVED_PRIVATE_INT IS NEW PRIVATE_INT; FOR DERIVED_PRIVATE_INT'SIZE USE SPECIFIED_SIZE; MINIMUM_SIZE : INTEGER := IDENT_INT(SPECIFIED_SIZE); -- SIZE SPECIFICATION GIVEN IN A GENERIC PROCEDURE. GENERIC PROCEDURE GENPROC; PROCEDURE GENPROC IS TYPE CHECK_INT IS RANGE -125 .. 125; FOR CHECK_INT'SIZE USE SPECIFIED_SIZE; PROCEDURE CHECK_4 IS NEW LENGTH_CHECK (CHECK_INT); BEGIN IF CHECK_INT'SIZE /= MINIMUM_SIZE THEN FAILED ("GENERIC CHECK_INT'SIZE IS INCORRECT"); END IF; CHECK_4 (-60, 9, "GENERIC CHECK_INT"); END GENPROC; PROCEDURE NEWPROC IS NEW GENPROC; PROCEDURE CHECK_1 IS NEW LENGTH_CHECK (DERIVED_INT); PROCEDURE CHECK_2 IS NEW LENGTH_CHECK (INT_IN_P); PROCEDURE CHECK_3 IS NEW LENGTH_CHECK (ALT_INT_IN_P); BEGIN TEST("CD2A31C", "CHECK THAT 'SIZE SPECIFICATIONS CAN BE GIVEN IN " & "VISIBLE OR PRIVATE PART OF PACKAGE FOR INTEGER " & "TYPE DECLARED IN VISIBLE PART, AND FOR " & "DERIVED INTEGER TYPES " & "AND DERIVED PRIVATE TYPES WHOSE FULL DECLARATIONS " & "ARE AS INTEGER TYPES"); CHECK_1 (-60, 9, "DERIVED_INT"); CHECK_2 (-60, 9, "INT_IN_P"); CHECK_3 (-60, 9, "ALT_INT_IN_P"); NEWPROC; IF DERIVED_INT'SIZE /= MINIMUM_SIZE THEN FAILED ("DERIVED_INT'SIZE INCORRECT"); END IF; IF INT_IN_P'SIZE /= MINIMUM_SIZE THEN FAILED ("INT_IN_P'SIZE INCORRECT"); END IF; IF ALT_INT_IN_P'SIZE /= MINIMUM_SIZE THEN FAILED ("ALT_INT_IN_P'SIZE INCORRECT"); END IF; IF DERIVED_PRIVATE_INT'SIZE /= MINIMUM_SIZE THEN FAILED ("DERIVED_PRIVATE_INT'SIZE INCORRECT"); END IF; RESULT; END CD2A31C;
src/main/antlr/XSimpleGrammar.g4
oguzp1/cse232b-xml-project
0
5846
grammar XSimpleGrammar; WS : [ \t\r\n] -> skip ; xq : forClause whereClause returnClause; forClause : 'for' VAR 'in' path (',' VAR 'in' path)* ; whereClause : 'where' cond ; returnClause : 'return' ret ; path : ('doc' '(' '"' FILENAME '"' ')' | VAR) (sep pathname)* sep pathname | ('doc' '(' '"' FILENAME '"' ')' | VAR) (sep pathname)* sep 'text' '(' ')' ; pathname : NAME | '*' ; sep : '/' | '//' ; ret : VAR | ret ',' ret | '<' NAME '>' '{' ret '}' '<' '/' NAME '>' | path ; cond : (VAR | STRINGCONSTANT) 'eq' (VAR | STRINGCONSTANT) | (VAR | STRINGCONSTANT) '=' (VAR | STRINGCONSTANT) | cond 'and' cond ; NAME : ('-' | [a-zA-Z0-9_])+ ; FILENAME : NAME '.' NAME ; STRINGCONSTANT : ["](',' | '!' | '.' | ':' | '?' | '-' | [ a-zA-Z0-9])*["] ; VAR : [$][a-zA-Z0-9_]+ ;
quizzes/1/p4/P4_1.asm
plibither8/iiitd_cse231-os
3
85986
global long_add long_add: push ebp mov ebp, esp mov eax, [ebp+20] add eax, [ebp+16] add eax, [ebp+12] add eax, [ebp+8] mov esp, ebp pop ebp ret
source/sql/firebird/matreshka-internals-sql_drivers-firebird-fields.adb
svn2github/matreshka
24
24549
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- SQL Database Access -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision: 1793 $ $Date: 2011-06-11 10:40:44 +0300 (Сб, 11 июн 2011) $ ------------------------------------------------------------------------------ with Ada.Streams; with Ada.Unchecked_Deallocation; with System.Address_To_Access_Conversions; with League.Calendars.ISO_8601; package body Matreshka.Internals.SQL_Drivers.Firebird.Fields is procedure Free is new Ada.Unchecked_Deallocation (Isc_Short, Isc_Short_Access); procedure Free is new Ada.Unchecked_Deallocation (Sql_Data_Array, Sql_Data_Array_Access); package To_Isc_Date is new System.Address_To_Access_Conversions (Isc_Date); package To_Isc_Timestamp is new System.Address_To_Access_Conversions (Isc_Timestamp); package To_Isc_Time is new System.Address_To_Access_Conversions (Isc_Time); package To_Long_Long_Integer is new System.Address_To_Access_Conversions (Long_Long_Integer); package To_Short_Float is new System.Address_To_Access_Conversions (Short_Float); package To_Short_Integer is new System.Address_To_Access_Conversions (Short_Integer); package To_Long_Integer is new System.Address_To_Access_Conversions (Long_Integer); package To_Long_Float is new System.Address_To_Access_Conversions (Long_Float); Calendar : League.Calendars.ISO_8601.ISO_8601_Calendar; -------------------- -- Adjust_Sqldata -- -------------------- procedure Adjust_Sqldata (Self : not null access Field) is use type Isc_Short; begin if Self.Sql_Dada_Space /= null and then Self.Sql_Dada_Space'Length = Self.Sqlvar.Sqllen then return; end if; Self.Free_Sqldata; Self.Alloc_Sqldata (Self.Sqlvar.Sqllen); end Adjust_Sqldata; ------------------- -- Alloc_Sqldata -- ------------------- procedure Alloc_Sqldata (Self : not null access Field; Size : Isc_Short) is use type Isc_Short; begin if Size > 0 then Self.Sql_Dada_Space := new Sql_Data_Array (1 .. Size); Self.Sql_Dada_Space.all := (others => 0); Self.Sqlvar.Sqldata := Self.Sql_Dada_Space (1)'Address; end if; end Alloc_Sqldata; ------------------ -- Alloc_Sqlind -- ------------------ procedure Alloc_Sqlind (Self : not null access Field) is begin if Self.Sqlvar.Sqlind = null then Self.Sqlvar.Sqlind := new Isc_Short'(0); end if; end Alloc_Sqlind; ------------------- -- Adjust_Sqlind -- ------------------- procedure Adjust_Sqlind (Self : not null access Field) is begin if Self.Sqlvar.Sqltype (Isc_Sqlind_Flag) then Self.Alloc_Sqlind; else Free (Self.Sqlvar.Sqlind); end if; end Adjust_Sqlind; ---------------- -- As_Boolean -- ---------------- function As_Boolean (Self : not null access Field) return Boolean is begin return To_Short_Integer.To_Pointer (Self.Sqlvar.Sqldata).all = Isc_True; end As_Boolean; ------------- -- As_Date -- ------------- function As_Date (Self : not null access Field) return League.Calendars.Date is use League.Calendars.ISO_8601; use type Interfaces.C.int; C_Date : aliased C_Time; begin Isc_Decode_Sql_Date (To_Isc_Date.To_Pointer (Self.Sqlvar.Sqldata), C_Date'Access); return Create (Year_Number (C_Date.Tm_Year + 1900), Month_Number (C_Date.Tm_Mon + 1), Day_Number (C_Date.Tm_Mday)); end As_Date; ------------- -- As_Date -- ------------- procedure As_Date (Self : not null access Field; Value : League.Calendars.Date) is use Interfaces.C; C_Date : aliased C_Time; Date : aliased Isc_Date; begin C_Date.Tm_Year := int (Calendar.Year (Value)) - 1900; C_Date.Tm_Mon := int (Calendar.Month (Value)) - 1; C_Date.Tm_Mday := int (Calendar.Day (Value)); Isc_Encode_Sql_Date (C_Date'Access, Date'Access); Self.Set_Value (Isc_Type_Date, Isc_Date'Size / 8, Date'Address); end As_Date; ------------------ -- As_Date_Time -- ------------------ function As_Date_Time (Self : not null access Field) return League.Calendars.Date_Time is use League.Calendars.ISO_8601; use type Interfaces.C.int; C_Date : aliased C_Time; begin Isc_Decode_Timestamp (To_Isc_Timestamp.To_Pointer (Self.Sqlvar.Sqldata), C_Date'Access); raise Program_Error with "Not Implemented"; -- return Create -- (Year_Number (C_Date.Tm_Year + 1900), -- Month_Number (C_Date.Tm_Mon + 1), -- Day_Number (C_Date.Tm_Mday), -- Create (Hour_Number (C_Date.Tm_Hour), -- Minute_Number (C_Date.Tm_Min), -- Second_Number (C_Date.Tm_Sec))); return League.Calendars.Clock; end As_Date_Time; ------------------ -- As_Date_Time -- ------------------ procedure As_Date_Time (Self : not null access Field; Value : League.Calendars.Date_Time) is use Interfaces.C; C_Date : aliased C_Time; Timestamp : aliased Isc_Timestamp; begin C_Date.Tm_Year := int (Calendar.Year (Value)) - 1900; C_Date.Tm_Mon := int (Calendar.Month (Value)) - 1; C_Date.Tm_Mday := int (Calendar.Day (Value)); C_Date.Tm_Hour := int (Calendar.Hour (Value)); C_Date.Tm_Min := int (Calendar.Minute (Value)); C_Date.Tm_Sec := int (Calendar.Second (Value)); Isc_Encode_Timestamp (C_Date'Access, Timestamp'Access); Self.Set_Value (Isc_Type_Timestamp, Isc_Timestamp'Size / 8, Timestamp'Address); end As_Date_Time; ------------------- -- As_Long_Float -- ------------------- function As_Long_Float (Self : not null access Field) return Long_Float is use type Isc_Short; begin if Self.Sql_Type = Isc_Type_Double or else Self.Sql_Type = Isc_Type_D_Float then return To_Long_Float.To_Pointer (Self.Sqlvar.Sqldata).all; elsif Self.Sql_Type = Isc_Type_Long then return Long_Float (To_Long_Integer.To_Pointer (Self.Sqlvar.Sqldata).all) / Long_Float (10 ** Integer (-Self.Sqlvar.Sqlscale)); else raise Constraint_Error; end if; end As_Long_Float; --------------------- -- As_Long_Integer -- --------------------- function As_Long_Integer (Self : not null access Field) return Long_Integer is begin return To_Long_Integer.To_Pointer (Self.Sqlvar.Sqldata).all; end As_Long_Integer; -------------------- -- As_Short_Float -- -------------------- function As_Short_Float (Self : not null access Field) return Short_Float is use type Isc_Short; begin if Self.Sql_Type = Isc_Type_Float then return To_Short_Float.To_Pointer (Self.Sqlvar.Sqldata).all; elsif Self.Sql_Type = Isc_Type_Short then return Short_Float (To_Short_Integer.To_Pointer (Self.Sqlvar.Sqldata).all) / Short_Float (10 ** Integer (-Self.Sqlvar.Sqlscale)); else raise Constraint_Error; end if; end As_Short_Float; ---------------------- -- As_Short_Integer -- ---------------------- function As_Short_Integer (Self : not null access Field) return Short_Integer is begin return To_Short_Integer.To_Pointer (Self.Sqlvar.Sqldata).all; end As_Short_Integer; ------------- -- As_Time -- ------------- function As_Time (Self : not null access Field) return League.Calendars.Time is use League.Calendars.ISO_8601; C_Date : aliased C_Time; Dummy : League.Calendars.Time; begin Isc_Decode_Sql_Time (To_Isc_Time.To_Pointer (Self.Sqlvar.Sqldata), C_Date'Access); raise Program_Error with "Not Implemented"; -- return Create -- (Hour_Number (C_Date.Tm_Hour), -- Minute_Number (C_Date.Tm_Min), -- Second_Number (C_Date.Tm_Sec)); return Dummy; end As_Time; ------------- -- As_Time -- ------------- procedure As_Time (Self : not null access Field; Value : League.Calendars.Time) is use Interfaces.C; C_Date : aliased C_Time; Time : aliased Isc_Time; begin C_Date.Tm_Hour := int (Calendar.Hour (Value)); C_Date.Tm_Min := int (Calendar.Minute (Value)); C_Date.Tm_Sec := int (Calendar.Second (Value)); Isc_Encode_Sql_Time (C_Date'Access, Time'Access); Self.Set_Value (Isc_Type_Time, Isc_Time'Size / 8, Time'Address); end As_Time; ------------------------ -- As_Universal_Float -- ------------------------ function As_Universal_Float (Self : not null access Field) return League.Holders.Universal_Float is use type Isc_Short; v : constant Long_Long_Integer := To_Long_Long_Integer.To_Pointer (Self.Sqlvar.Sqldata).all; begin return League.Holders.Universal_Float (Long_Long_Float (v) / Long_Long_Float (10 ** Integer (-Self.Sqlvar.Sqlscale))); end As_Universal_Float; ------------------------ -- As_Universal_Float -- ------------------------ procedure As_Universal_Float (Self : not null access Field; Value : League.Holders.Universal_Float) is use League.Holders; use type Universal_Float; use type Isc_Short; v : constant Universal_Integer := Universal_Integer (Universal_Float'Truncation (Value * Universal_Float (10 ** Integer (-Self.Srv_Sql_Scale)))); begin Self.As_Universal_Integer (v); Self.Sqlvar.Sqlscale := Self.Srv_Sql_Scale; end As_Universal_Float; -------------------------- -- As_Universal_Integer -- -------------------------- function As_Universal_Integer (Self : not null access Field) return League.Holders.Universal_Integer is begin return League.Holders.Universal_Integer (To_Long_Long_Integer.To_Pointer (Self.Sqlvar.Sqldata).all); end As_Universal_Integer; -------------------------- -- As_Universal_Integer -- -------------------------- procedure As_Universal_Integer (Self : not null access Field; Value : League.Holders.Universal_Integer) is use type Isc_Short; V : Long_Long_Integer := Long_Long_Integer (Value); begin Self.Set_Value (Isc_Type_Int64, Long_Long_Integer'Size / 8, V'Address); end As_Universal_Integer; --------------- -- As_String -- --------------- function As_String (Self : not null access Field) return League.Strings.Universal_String is use Ada.Streams; Len : Integer; function Get_Length (Addr : Isc_Address) return Integer; function Extract (Addr : Isc_Address; From : Stream_Element_Offset; To : Stream_Element_Offset) return Stream_Element_Array; ---------------- -- Get_Length -- ---------------- function Get_Length (Addr : Isc_Address) return Integer is subtype Header is Isc_String (1 .. 2); package To_Header is new System.Address_To_Access_Conversions (Header); begin return Integer (Isc_Vax_Integer (To_Header.To_Pointer (Addr) (1 .. 2), 2)); end Get_Length; ------------- -- Extract -- ------------- function Extract (Addr : Isc_Address; From : Stream_Element_Offset; To : Stream_Element_Offset) return Stream_Element_Array is subtype Constrained is Stream_Element_Array (1 .. To); package To_Array is new System.Address_To_Access_Conversions (Constrained); begin return To_Array.To_Pointer (Addr) (From .. To); end Extract; begin if Self.Sql_Type = Isc_Type_Text then Len := Integer (Self.Sqlvar.Sqllen); else Len := Get_Length (Self.Sqlvar.Sqldata); end if; declare Result : Ada.Streams.Stream_Element_Array (1 .. Ada.Streams.Stream_Element_Offset (Len)); begin if Self.Sql_Type = Isc_Type_Text then Result := Extract (Self.Sqlvar.Sqldata, 1, Stream_Element_Offset (Len)); else Result := Extract (Self.Sqlvar.Sqldata, 3, Stream_Element_Offset (Len + 2)); end if; return League.Text_Codecs.Decode (Self.Codec.all, Result); end; end As_String; --------------- -- As_String -- --------------- procedure As_String (Self : not null access Field; Value : League.Strings.Universal_String) is use type Interfaces.C.char; Sql_Type : Isc_Sqltype; begin Sql_Type := Self.Server_Sql_Type; declare Item : constant Ada.Streams.Stream_Element_Array := Self.Codec.Encode (Value).To_Stream_Element_Array; begin if Item'Length > 32767 then raise Constraint_Error; end if; if Self.Utf then Self.Sqlvar.Sqlsubtype := 3; -- UNICODE_FSS end if; if Item'Length > 0 then Self.Set_Value (Isc_Type_Text, Item'Length, Item (Item'First)'Address); else if Is_Numeric_Type (Sql_Type) or else Is_Datetime_Type (Sql_Type) then Self.Set_Null (True); else Self.Set_Value (Isc_Type_Text, 0, Zero); end if; end if; end; end As_String; -------------- -- Finalize -- -------------- overriding procedure Finalize (Self : in out Field) is begin if Self.Sqlvar /= null then Free (Self.Sqlvar.Sqlind); end if; Self.Free_Sqldata; end Finalize; ------------------ -- Free_Sqldata -- ------------------ procedure Free_Sqldata (Self : in out Field) is begin Free (Self.Sql_Dada_Space); Self.Sqlvar.Sqldata := System.Null_Address; end Free_Sqldata; ------------- -- Is_Null -- ------------- function Is_Null (Self : not null access Field) return Boolean is use type Isc_Short; begin return (Self.Is_Nullable and then Self.Sqlvar.Sqlind.all = -1) or else Self.Sqlvar.Sqltype = Isc_Type_Empty or else Self.Sqlvar.Sqltype = Isc_Type_Empty1; end Is_Null; ----------------- -- Is_Nullable -- ----------------- function Is_Nullable (Self : not null access Field) return Boolean is begin if Self.Sqlvar.Sqltype (Isc_Sqlind_Flag) then Self.Alloc_Sqlind; return True; else return False; end if; end Is_Nullable; ----------------- -- Is_Nullable -- ----------------- procedure Is_Nullable (Self : not null access Field; Value : Boolean) is begin if Value /= Self.Is_Nullable then if Value then Self.Sqlvar.Sqltype (Isc_Sqlind_Flag) := True; Self.Alloc_Sqlind; else Self.Sqlvar.Sqltype (Isc_Sqlind_Flag) := False; Free (Self.Sqlvar.Sqlind); end if; end if; end Is_Nullable; -------------------- -- Reserv_Sqldata -- -------------------- procedure Reserv_Sqldata (Self : not null access Field; Size : Isc_Short) is use type Isc_Short; begin if Self.Sql_Dada_Space /= null and then Self.Sql_Dada_Space'Length = Size then return; end if; Self.Free_Sqldata; Self.Alloc_Sqldata (Size); end Reserv_Sqldata; --------------------- -- Server_Sql_Type -- --------------------- function Server_Sql_Type (Self : not null access Field) return Isc_Sqltype is Result : Isc_Sqltype := Self.Srv_Sql_Type; begin Result (Isc_Sqlind_Flag) := False; return Result; end Server_Sql_Type; -------------- -- Set_Null -- -------------- procedure Set_Null (Self : not null access Field; Value : Boolean) is use type Isc_Short; begin if Value then if Self.Sqlvar.Sqltype = Isc_Type_Empty or else Self.Sqlvar.Sqltype = Isc_Type_Empty1 then Self.Sqlvar.Sqltype := Isc_Type_Text; Self.Sqlvar.Sqllen := 0; Self.Free_Sqldata; end if; if not Self.Is_Nullable then Self.Is_Nullable (True); end if; Self.Sqlvar.Sqlind.all := -1; else if Self.Is_Nullable then Self.Sqlvar.Sqlind.all := 0; end if; end if; end Set_Null; --------------- -- Set_Value -- --------------- procedure Set_Value (Self : not null access Field; Sql_Type : Isc_Sqltype; Size : Isc_Short; Value : Isc_Address) is use type Isc_Address; use type Isc_Short; subtype C_Array is Sql_Data_Array (1 .. Size); package To_Array_Conv is new System.Address_To_Access_Conversions (C_Array); Set_Sql_Type : Isc_Sqltype := Sql_Type; begin if Self.Is_Null then Self.Set_Null (False); end if; Self.Sqlvar.Sqlscale := 0; if Value = Zero or else Size = 0 then Self.Sqlvar.Sqllen := 0; Self.Reserv_Sqldata (1); else Self.Sqlvar.Sqllen := Size; if Self.Sql_Dada_Space /= null and then Self.Sql_Dada_Space'Length /= Self.Sqlvar.Sqllen then Self.Free_Sqldata; end if; if Self.Sql_Dada_Space = null then Self.Alloc_Sqldata (Self.Sqlvar.Sqllen); end if; Self.Sql_Dada_Space (1 .. Size) := To_Array_Conv.To_Pointer (Value) (1 .. Size); end if; Set_Sql_Type (Isc_Sqlind_Flag) := Self.Sqlvar.Sqltype (Isc_Sqlind_Flag); Self.Sqlvar.Sqltype := Set_Sql_Type; end Set_Value; -------------- -- Sql_Type -- -------------- function Sql_Type (Self : not null access Field) return Isc_Sqltype is Result : Isc_Sqltype := Self.Sqlvar.Sqltype; begin Result (Isc_Sqlind_Flag) := False; return Result; end Sql_Type; ----------- -- Value -- ----------- function Value (Self : not null access Field) return League.Holders.Holder is use League.Holders; use type Isc_Short; Sql_Type : Isc_Sqltype; Result : Holder; begin if Self.Is_Null then return Result; end if; Sql_Type := Self.Sql_Type; if Sql_Type = Isc_Type_Text or else Sql_Type = Isc_Type_Varying then Replace_Element (Result, Self.As_String); elsif Sql_Type = Isc_Type_Short then if Self.Sqlvar.Sqlscale /= 0 then Replace_Element (Result, Universal_Float (Self.As_Short_Float)); else Replace_Element (Result, Universal_Integer (Self.As_Short_Integer)); end if; elsif Sql_Type = Isc_Type_Long then if Self.Sqlvar.Sqlscale /= 0 then Replace_Element (Result, Universal_Float (Self.As_Long_Float)); else Replace_Element (Result, Universal_Integer (Self.As_Long_Integer)); end if; elsif Sql_Type = Isc_Type_Float then Replace_Element (Result, Universal_Float (Self.As_Short_Float)); elsif Sql_Type = Isc_Type_Double or else Sql_Type = Isc_Type_D_Float then Replace_Element (Result, Universal_Float (Self.As_Long_Float)); elsif Sql_Type = Isc_Type_Blob then Replace_Element (Result, League.Strings.To_Universal_String ("(BLOB)")); elsif Sql_Type = Isc_Type_Array then Replace_Element (Result, League.Strings.To_Universal_String ("(ARRAY)")); elsif Sql_Type = Isc_Type_Quad then raise Constraint_Error; elsif Sql_Type = Isc_Type_Time then Replace_Element (Result, Self.As_Time); elsif Sql_Type = Isc_Type_Timestamp then Replace_Element (Result, Self.As_Date_Time); elsif Sql_Type = Isc_Type_Date then Replace_Element (Result, Self.As_Date); elsif Sql_Type = Isc_Type_Int64 then if Self.Sqlvar.Sqlscale /= 0 then Replace_Element (Result, Self.As_Universal_Float); else Replace_Element (Result, Self.As_Universal_Integer); end if; elsif Sql_Type = Isc_Type_Boolean then Replace_Element (Result, League.Strings.To_Universal_String (Boolean'Wide_Wide_Image (Self.As_Boolean))); else raise Constraint_Error; end if; return Result; end Value; ----------- -- Value -- ----------- procedure Value (Self : not null access Field; Holder : League.Holders.Holder) is begin if League.Holders.Is_Empty (Holder) then Self.Set_Null (True); elsif League.Holders.Is_Universal_String (Holder) then Self.As_String (League.Holders.Element (Holder)); elsif League.Holders.Is_Abstract_Integer (Holder) then Self.As_Universal_Integer (League.Holders.Element (Holder)); elsif League.Holders.Is_Abstract_Float (Holder) then Self.As_Universal_Float (League.Holders.Element (Holder)); elsif League.Holders.Is_Time (Holder) then Self.As_Time (League.Holders.Element (Holder)); elsif League.Holders.Is_Date (Holder) then Self.As_Date (League.Holders.Element (Holder)); elsif League.Holders.Is_Date_Time (Holder) then Self.As_Date_Time (League.Holders.Element (Holder)); else raise Constraint_Error; end if; end Value; end Matreshka.Internals.SQL_Drivers.Firebird.Fields;