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
test/interaction/Issue2575.agda
shlevy/agda
1,989
4381
module Issue2575 where import Issue2575.M
test/Common/Integer.agda
KDr2/agda
0
14737
<filename>test/Common/Integer.agda {-# OPTIONS --cubical-compatible #-} module Common.Integer where open import Agda.Builtin.Int public renaming (Int to Integer)
programs/oeis/245/A245288.asm
neoneye/loda
22
9437
<gh_stars>10-100 ; A245288: a(n) = (4*n^2 - 2*n - 1 + (2*n^2 - 2*n + 1)*(-1)^n)/16. ; 0,0,1,1,5,3,12,6,22,10,35,15,51,21,70,28,92,36,117,45,145,55,176,66,210,78,247,91,287,105,330,120,376,136,425,153,477,171,532,190,590,210,651,231,715,253,782,276,852,300,925,325,1001,351,1080,378,1162,406,1247,435,1335,465,1426,496,1520,528,1617,561,1717,595,1820,630,1926,666,2035,703,2147,741,2262,780,2380,820,2501,861,2625,903,2752,946,2882,990,3015,1035,3151,1081,3290,1128,3432,1176,3577,1225 mov $4,2 mov $6,$0 lpb $4 mov $0,$6 mov $2,0 sub $4,1 add $0,$4 sub $0,1 mov $5,0 lpb $0 sub $0,1 add $2,$0 sub $0,1 add $5,$2 lpe mov $3,$4 mul $3,$5 add $1,$3 lpe min $6,1 mul $6,$5 sub $1,$6 mov $0,$1
src/day-15/adventofcode-day_15.ads
persan/advent-of-code-2020
0
27770
<filename>src/day-15/adventofcode-day_15.ads<gh_stars>0 package Adventofcode.Day_15 is end Adventofcode.Day_15;
tools-src/gnu/gcc/gcc/ada/5lml-tgt.adb
enfoTek/tomato.linksys.e2000.nvram-mod
80
7062
<gh_stars>10-100 ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- M L I B . T G T -- -- (GNU/Linux Version) -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 2001, Ada Core Technologies, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ -- This package provides a set of target dependent routines to build -- static, dynamic and shared libraries. -- This is the GNU/Linux version of the body. with Ada.Characters.Handling; use Ada.Characters.Handling; with GNAT.Directory_Operations; use GNAT.Directory_Operations; with MLib.Fil; with MLib.Utl; with Namet; use Namet; with Opt; with Osint; use Osint; with Output; use Output; with System; package body MLib.Tgt is use GNAT; use MLib; -- ??? serious lack of comments below, all these declarations need to -- be commented, none are: package Files renames MLib.Fil; package Tools renames MLib.Utl; Args : Argument_List_Access := new Argument_List (1 .. 20); Last_Arg : Natural := 0; Cp : constant String_Access := Locate_Exec_On_Path ("cp"); Force : constant String_Access := new String'("-f"); procedure Add_Arg (Arg : String); ------------- -- Add_Arg -- ------------- procedure Add_Arg (Arg : String) is begin if Last_Arg = Args'Last then declare New_Args : constant Argument_List_Access := new Argument_List (1 .. Args'Last * 2); begin New_Args (Args'Range) := Args.all; Args := New_Args; end; end if; Last_Arg := Last_Arg + 1; Args (Last_Arg) := new String'(Arg); end Add_Arg; ----------------- -- Archive_Ext -- ----------------- function Archive_Ext return String is begin return "a"; end Archive_Ext; ----------------- -- Base_Option -- ----------------- function Base_Option return String is begin return ""; end Base_Option; --------------------------- -- Build_Dynamic_Library -- --------------------------- procedure Build_Dynamic_Library (Ofiles : Argument_List; Foreign : Argument_List; Afiles : Argument_List; Options : Argument_List; Lib_Filename : String; Lib_Dir : String; Lib_Address : String := ""; Lib_Version : String := ""; Relocatable : Boolean := False) is Lib_File : constant String := Lib_Dir & Directory_Separator & "lib" & Files.Ext_To (Lib_Filename, DLL_Ext); use type Argument_List; use type String_Access; Version_Arg : String_Access; Symbolic_Link_Needed : Boolean := False; begin if Opt.Verbose_Mode then Write_Str ("building relocatable shared library "); Write_Line (Lib_File); end if; if Lib_Version = "" then Tools.Gcc (Output_File => Lib_File, Objects => Ofiles, Options => Options); else Version_Arg := new String'("-Wl,-soname," & Lib_Version); if Is_Absolute_Path (Lib_Version) then Tools.Gcc (Output_File => Lib_Version, Objects => Ofiles, Options => Options & Version_Arg); Symbolic_Link_Needed := Lib_Version /= Lib_File; else Tools.Gcc (Output_File => Lib_Dir & Directory_Separator & Lib_Version, Objects => Ofiles, Options => Options & Version_Arg); Symbolic_Link_Needed := Lib_Dir & Directory_Separator & Lib_Version /= Lib_File; end if; if Symbolic_Link_Needed then declare Success : Boolean; Oldpath : String (1 .. Lib_Version'Length + 1); Newpath : String (1 .. Lib_File'Length + 1); Result : Integer; function Symlink (Oldpath : System.Address; Newpath : System.Address) return Integer; pragma Import (C, Symlink, "__gnat_symlink"); begin Oldpath (1 .. Lib_Version'Length) := Lib_Version; Oldpath (Oldpath'Last) := ASCII.NUL; Newpath (1 .. Lib_File'Length) := Lib_File; Newpath (Newpath'Last) := ASCII.NUL; Delete_File (Lib_File, Success); Result := Symlink (Oldpath'Address, Newpath'Address); end; end if; end if; end Build_Dynamic_Library; -------------------- -- Copy_ALI_Files -- -------------------- procedure Copy_ALI_Files (From : Name_Id; To : Name_Id) is Dir : Dir_Type; Name : String (1 .. 1_000); Last : Natural; Success : Boolean; From_Dir : constant String := Get_Name_String (From); To_Dir : constant String_Access := new String'(Get_Name_String (To)); begin Last_Arg := 0; Open (Dir, From_Dir); loop Read (Dir, Name, Last); exit when Last = 0; if Last > 4 and then To_Lower (Name (Last - 3 .. Last)) = ".ali" then Add_Arg (From_Dir & Directory_Separator & Name (1 .. Last)); end if; end loop; if Last_Arg /= 0 then if not Opt.Quiet_Output then Write_Str ("cp -f "); for J in 1 .. Last_Arg loop Write_Str (Args (J).all); Write_Char (' '); end loop; Write_Line (To_Dir.all); end if; Spawn (Cp.all, Force & Args (1 .. Last_Arg) & To_Dir, Success); if not Success then Fail ("could not copy ALI files to library dir"); end if; end if; end Copy_ALI_Files; ------------------------- -- Default_DLL_Address -- ------------------------- function Default_DLL_Address return String is begin return ""; end Default_DLL_Address; ------------- -- DLL_Ext -- ------------- function DLL_Ext return String is begin return "so"; end DLL_Ext; -------------------- -- Dynamic_Option -- -------------------- function Dynamic_Option return String is begin return "-shared"; end Dynamic_Option; ------------------- -- Is_Object_Ext -- ------------------- function Is_Object_Ext (Ext : String) return Boolean is begin return Ext = ".o"; end Is_Object_Ext; -------------- -- Is_C_Ext -- -------------- function Is_C_Ext (Ext : String) return Boolean is begin return Ext = ".c"; end Is_C_Ext; -------------------- -- Is_Archive_Ext -- -------------------- function Is_Archive_Ext (Ext : String) return Boolean is begin return Ext = ".a" or else Ext = ".so"; end Is_Archive_Ext; ------------- -- Libgnat -- ------------- function Libgnat return String is begin return "libgnat.a"; end Libgnat; ----------------------------- -- Libraries_Are_Supported -- ----------------------------- function Libraries_Are_Supported return Boolean is begin return True; end Libraries_Are_Supported; -------------------------------- -- Linker_Library_Path_Option -- -------------------------------- function Linker_Library_Path_Option (Directory : String) return String_Access is begin return new String'("-Wl,-rpath," & Directory); end Linker_Library_Path_Option; ---------------- -- Object_Ext -- ---------------- function Object_Ext return String is begin return "o"; end Object_Ext; ---------------- -- PIC_Option -- ---------------- function PIC_Option return String is begin return "-fPIC"; end PIC_Option; end MLib.Tgt;
002-assembly/common-cmp.asm
dingjingmaster/learn-kernel
0
104159
.data wages: .quad 46000 .bss .lcomm taxes, 8 .text .global _main _main: movq $50000, %rax cmpq %rax, wages(%rip) jae higher movq $2000, taxes(%rip) jmp done higher: movq $4000, taxes(%rip) done: movq $60, %rax xorq %rdi, %rdi syscall .end
util.asm
adkennan/BurgerMayhem
0
2040
<reponame>adkennan/BurgerMayhem WRITE_HEX sta LINE_VAL stx LINE_NUM pha tya pha txa pha ldx LINE_NUM lda #<SCREEN_0 sta LINE_PTR_LO lda #>SCREEN_0 sta LINE_PTR_HI @loop clc adc #$28 sta LINE_PTR_LO bcc @got_line inc LINE_PTR_HI @got_line dex bne @loop lda LINE_VAL ldy #1 jsr SHOW_DIGIT lda LINE_VAL ror ror ror ror ldy #0 jsr SHOW_DIGIT pla tax pla tay pla rts SHOW_DIGIT pha and #$0f cmp #$0a bcc @show clc adc #1 @show sta (LINE_PTR_LO),y pla rts SET_BIT tay lda NUM_FLAG,y rts
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/lto5.adb
best08618/asylo
7
30523
-- { dg-do run } -- { dg-options "-flto" { target lto } } with Lto5_Pkg; procedure Lto5 is begin null; end;
alloy4fun_models/trashltl/models/11/C9z7ppWRTScgrzSfh.als
Kaixi26/org.alloytools.alloy
0
2410
open main pred idC9z7ppWRTScgrzSfh_prop12 { all f: File | eventually always f in Trash } pred __repair { idC9z7ppWRTScgrzSfh_prop12 } check __repair { idC9z7ppWRTScgrzSfh_prop12 <=> prop12o }
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_818.asm
ljhsiun2/medusa
9
176103
<filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_818.asm .global s_prepare_buffers s_prepare_buffers: push %r13 push %r15 push %r9 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0xeb1e, %rbp nop nop nop nop nop cmp %r9, %r9 movb (%rbp), %r15b nop add %rsi, %rsi lea addresses_UC_ht+0x19bde, %rbp nop nop nop nop nop xor $964, %rdi mov (%rbp), %r13 add $60557, %r15 lea addresses_WC_ht+0x41de, %rdi nop nop nop and $39701, %rbx vmovups (%rdi), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $0, %xmm0, %r9 and %rbp, %rbp lea addresses_WC_ht+0xb25e, %rsi lea addresses_WT_ht+0x1391e, %rdi nop nop xor %rbx, %rbx mov $116, %rcx rep movsw nop nop nop cmp $30454, %rcx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r15 pop %r13 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r14 push %r15 push %r9 push %rbp push %rdi // Store lea addresses_UC+0x411e, %r14 nop add $14080, %r13 mov $0x5152535455565758, %rbp movq %rbp, %xmm1 movups %xmm1, (%r14) nop nop nop nop cmp %r14, %r14 // Store lea addresses_A+0xe35e, %r9 nop nop nop nop inc %r15 mov $0x5152535455565758, %r14 movq %r14, %xmm7 movups %xmm7, (%r9) nop nop and %r13, %r13 // Store lea addresses_WT+0x1f86e, %rbp nop nop nop and %rdi, %rdi movb $0x51, (%rbp) sub %r14, %r14 // Faulty Load lea addresses_PSE+0xed1e, %r9 nop nop nop nop sub $4187, %r12 movb (%r9), %r15b lea oracles, %r9 and $0xff, %r15 shlq $12, %r15 mov (%r9,%r15,1), %r15 pop %rdi pop %rbp pop %r9 pop %r15 pop %r14 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 9, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 3, 'size': 1, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 4, 'size': 1, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 6, 'size': 8, 'same': False, 'NT': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 32, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': True}} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
programs/oeis/133/A133653.asm
karttu/loda
1
19009
<reponame>karttu/loda<filename>programs/oeis/133/A133653.asm<gh_stars>1-10 ; A133653: A007318^(-1) * A003261. ; 1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130,134,138,142,146,150,154 mul $0,4 bin $1,$0 sub $0,$1 add $0,2 mov $1,$0
libsrc/stdio/abc80/fgetc_cons.asm
grancier/z180
0
92927
; ; ABC80 Routines ; ; getkey() Wait for keypress ; ; Maj 2000 - <NAME> ; ; ; $Id: fgetc_cons.asm,v 1.5 2016/06/12 17:00:21 dom Exp $ ; SECTION code_clib PUBLIC fgetc_cons .fgetc_cons ld a,(65013) and 127 jr z,fgetc_cons ld l,a xor a ld (65013),a ld h,a ret
untested/x86/floatShit.asm
GabrielRavier/Generic-Assembly-Samples
0
166101
%include "macros.inc" global _fmin global _fmax global _ftrunc global _fround global _fabs global _fadd global _fchs global _fdiv global _fpatan global _fclamp global _fsign global _fintersect global _ftoi global _facos global _fasin global _fatan global _fceil global _fexp global _ffloor global _ffmod global _fldexp global _flog global _flog10 global _ffpclassify global _fisfinite global _fpow global _fisinf global _fisnan global _fisnormal global _fsignbit global _fisunordered global _fcopysign global _fexp2 global _fexpm1 global _filogb global _fllrint global _fllround global _flog1p global _flog2 global _flogb global _fnearbyint global _fremainder global _fhypot segment .rodata align 16 maxInt dd 0x80000000 align 16 twoPow23 dd 8388608.0 align 16 one dd 1.0 align 16 minusZeroPoint5 dd -0.5 align 16 zeroPoint5 dd 0.5 align 16 onePoint5 dd 1.5 align 16 fourMinus0 dd -0.0, -0.0, -0.0, -0.0 minus0 equ fourMinus0 align 16 plusInf dd 0x7F800000 align 16 plusInfMin1 dd 0x7F7FFFFF align 16 fltMin dd 0x800000 align 16 fourNaNs dd 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF NaN equ fourNaNs align 16 NaNPlus0s dd 0x7FFFFFFF, 0, 0, 0 segment .text align=16 _fmin: fld dword [esp + 4] fld dword [esp + 8] fcom fnstsw ax sahf ja .noU fst st1 .noU: fstp st0 ret align 16 _fmini686: fld dword [esp + 4] fld dword [esp + 8] fcom fnstsw ax sahf fcmovnbe st0, st1 fstp st1 ret align 16 _fminSSE: sub esp, 12 movss xmm0, dword [esp + 16] minss xmm0, dword [esp + 20] movss dword [esp], xmm0 fld dword [esp] add esp, 12 ret align 16 _fminAVX: sub esp, 12 vmovss xmm0, dword [esp + 16] vminss xmm0, dword [esp + 20] vmovss dword [esp], xmm0 fld dword [esp] add esp, 12 ret align 16 _fmax: fld dword [esp + 4] fld dword [esp + 8] fcom fnstsw ax sahf jp .yup jb .nope .yup: fst st1 .nope: fstp st0 ret align 16 _fmaxi686: fld dword [esp + 4] fld dword [esp + 8] fxch st1 fcom fnstsw ax sahf fcmovbe st0, st1 fstp st1 ret align 16 _fmaxSSE: sub esp, 12 movss xmm0, dword [esp + 16] maxss xmm0, dword [esp + 20] movss dword [esp], xmm0 fld dword [esp] add esp, 12 ret align 16 _fmaxAVX: sub esp, 12 vmovss xmm0, dword [esp + 16] vmaxss xmm0, dword [esp + 20] vmovss dword [esp], xmm0 fld dword [esp] add esp, 12 ret align 16 _ftrunc: sub esp, 12 fldz fld dword [esp + 16] fxch st1 fcomp fnstsw ax sahf jbe .above0 fld st0 frndint fcom st1 fnstsw ax sahf fstp st1 jnb .noAdd fld1 faddp st1, st0 .noAdd: jmp .return align 16 .above0: fld st0 frndint fcom st1 fnstsw ax sahf fstp st1 jna .return fld1 fsubp st1, st0 .return: add esp, 12 ret align 16 _ftruncSSE: sub esp, 12 movss xmm1, dword [esp + 16] xorps xmm0, xmm0 comiss xmm0, xmm1 jbe .above0 movss xmm3, dword [maxInt] movaps xmm0, xmm1 andps xmm3, xmm1 movss xmm2, dword [twoPow23] xorps xmm0, xmm3 cmpltss xmm0, xmm2 andps xmm2, xmm0 movaps xmm0, xmm1 orps xmm2, xmm3 addss xmm0, xmm2 subss xmm0, xmm2 movaps xmm4, xmm0 subss xmm4, xmm1 movss xmm1, dword [one] cmpltss xmm4, xmm3 andps xmm4, xmm1 addss xmm0, xmm4 jmp .return align 16 .above0: movss xmm3, dword [maxInt] movaps xmm0, xmm1 andps xmm3, xmm1 movss xmm2, dword [twoPow23] xorps xmm0, xmm3 cmpltss xmm0, xmm2 andps xmm2, xmm0 movaps xmm0, xmm1 orps xmm2, xmm3 addss xmm0, xmm2 subss xmm0, xmm2 movaps xmm4, xmm0 subss xmm4, xmm1 movss xmm1, dword [one] cmpnless xmm4, xmm3 andps xmm4, xmm1 subss xmm0, xmm4 .return: movss dword [esp], xmm0 fld dword [esp] add esp, 12 ret align 16 _ftruncSSE4: sub esp, 12 movss xmm1, dword [esp + 16] xorps xmm0, xmm0 comiss xmm0, xmm1 jbe .above0 roundss xmm0, xmm1, 2 jmp .return align 16 .above0: roundss xmm0, xmm1, 1 .return: movss dword [esp], xmm0 fld dword [esp] add esp, 12 ret align 16 _ftruncAVX: sub esp, 12 vmovss xmm1, dword [esp + 16] vxorps xmm0, xmm0 vcomiss xmm0, xmm1 jbe .above0 vroundss xmm0, xmm1, 2 jmp .return align 16 .above0: vroundss xmm0, xmm1, 1 .return: vmovss dword [esp], xmm0 fld dword [esp] add esp, 12 ret align 16 _fround: fld dword [esp + 4] fld dword [minusZeroPoint5] fcomp fnstsw ax sahf jae .return fcom dword [zeroPoint5] fnstsw ax sahf jae .return fstp st0 fldz .return: ret align 16 _froundSSE: sub esp, 12 movss xmm1, dword [esp + 16] movss xmm0, dword [minusZeroPoint5] comiss xmm0, xmm1 jae .return comiss xmm1, dword [zeroPoint5] jae .return xorps xmm1, xmm1 .return: movss dword [esp], xmm1 fld dword [esp] add esp, 12 ret align 16 _froundAVX: sub esp, 12 vmovss xmm1, dword [esp + 16] vmovss xmm0, dword [minusZeroPoint5] vcomiss xmm0, xmm1 jae .return vcomiss xmm1, dword [zeroPoint5] jae .return vxorps xmm1, xmm1 .return: vmovss dword [esp], xmm1 fld dword [esp] add esp, 12 ret _fabs: fld dword [esp + 4] fabs ret align 16 _fabsSSE: sub esp, 12 xorps xmm0, xmm0 cvttss2si eax, [esp + 16] cdq xor eax, edx sub eax, edx cvtsi2ss xmm0, eax movss dword [esp], xmm0 fld dword [esp] add esp, 12 ret segment .rodata align=16 xmmDat dq 0x7FFFFFFF, 0 segment .text align=16 _fabsSSE2: sub esp, 4 movss xmm0, [esp + 8] andps xmm0, [xmmDat] movss dword [esp], xmm0 fld dword [esp] add esp, 4 ret align 16 _fabsAVX: sub esp, 4 vmovss xmm0, dword [esp + 8] vandps xmm0, [xmmDat] vmovss dword [esp], xmm0 fld dword [esp] add esp, 4 ret align 16 _fadd: fld dword [esp + 4] fadd dword [esp + 8] ret align 16 _faddSSE: sub esp, 12 movss xmm0, [esp + 16] addss xmm0, [esp + 20] retFloat esp, xmm0 add esp, 12 ret align 16 _faddAVX: sub esp, 4 vmovss xmm0, [esp + 12] vaddss xmm0, [esp + 8] retFloatAVX esp, xmm0 add esp, 4 ret align 16 _fchs: fld dword [esp + 4] fchs ret segment .rodata align=16 xmmDat2 dd -0.0, -0.0, -0.0, -0.0 segment .text align=16 _fchsSSE: push eax movss xmm0, [esp + 4] xorps xmm0, [xmmDat2] retFloat esp, xmm0 pop eax ret align 16 _fchsAVX: sub esp, 4 vmovss xmm0, [esp + 4] vxorps xmm0, [xmmDat2] retFloatAVX esp, xmm0 pop eax ret align 16 _fdiv: fld dword [esp + 48] ftst fnstsw ax test ah, 0x40 jne .ret0 fdivr dword [esp + 4] ret .ret0: fstp st0 fldz ret align 16 _fdivMMX: fld dword [esp + 8] fldz fcomip st0, st1 je .ret0 fld dword [esp + 4] fdivrp st1, st0 ret align 16 .ret0: fstp st0 fldz ret align 16 _fdivSSE: push eax movss xmm1, [esp + 4 + 8] xorps xmm0, xmm0 ucomiss xmm0, xmm1 je .return movss xmm0, [esp + 4 + 4] divss xmm0, xmm1 .return: retFloat esp, xmm0 pop eax ret align 16 _fdivAVX: sub esp, 4 vxorps xmm0, xmm0 vmovss xmm1, [esp + 4 + 8] vcomiss xmm1, xmm0 je .return vmovss xmm0, [esp + 4 + 4] vdivss xmm0, xmm1 .return: retFloatAVX esp, xmm0 add esp, 4 ret align 16 _fpatan: fld dword [esp + 4] ftst fnstsw ax test ah, 0x40 jne .ret0 fdivr dword [esp + 8] fld1 fpatan ret align 16 .ret0: fstp st0 fldz ret align 16 _fclamp: fld dword [esp + 4] fld dword [esp + 8] fld dword [esp + 12] fcom st2 fnstsw ax sahf ja .above fst st2 .above: fstp st0 fcom fnstsw ax sahf fxch st1 ja .above2 fst st1 .above2: fstp st0 ret align 16 _fclampi686: fld dword [esp + 8] fld dword [esp + 12] fld dword [esp + 4] fucomi st1 fxch st1 fcmovbe st0, st1 fstp st1 fucomi st1 fcmovb st0, st1 fstp st1 ret align 16 _fclampSSE: push eax movss xmm0, [esp + 8] minss xmm0, [esp + 16] maxss xmm0, [esp + 12] retFloat esp, xmm0 pop eax ret align 16 _fclampAVX: push eax vmovss xmm0, [esp + 8] vminss xmm0, [esp + 16] vmaxss xmm0, [esp + 12] retFloatAVX esp, xmm0 pop eax ret align 16 _fsign: fld dword [esp + 4] fldz fucompp fnstsw ax sahf fld1 fld st0 fchs ja .above fstp st0 fldz fxch st1 .above: fstp st1 ret align 16 _fsigni686: fld dword [esp + 4] fldz fucomp st1 fstp st1 fld1 fld st0 fchs fxch st1 fcmovnbe st0, st1 fstp st1 ret segment .rodata align 16 fltChoice dd 1.0, -1.0 segment .text align=16 _fsignSSE: xorps xmm0, xmm0 xor eax, eax ucomiss xmm0, [esp + 4] seta al fld dword [fltChoice + eax * 4] ret align 16 _fsignAVX: vxorps xmm0, xmm0 xor eax, eax vucomiss xmm0, [esp + 4] seta al fld dword [fltChoice + eax * 4] ret align 16 _fintersect: fld dword [esp + 4] fsub dword [esp + 8] fdivr dword [esp + 4] ret align 16 _fintersectSSE: push eax movss xmm0, [esp + 8] movaps xmm1, xmm0 subss xmm1, [esp + 12] divss xmm0, xmm1 retFloat esp, xmm0 pop eax ret align 16 _fintersectAVX: push eax vmovss xmm0, [esp + 8] vsubss xmm1, xmm0, [esp + 12] vdivss xmm0, xmm1 retFloatAVX esp, xmm0 pop eax ret align 16 _ftoi: sub esp, 8 fnstcw [esp + 6] fld dword [esp + 12] movzx eax, word [esp + 6] or ah, 12 mov [esp + 4], ax fldcw [esp + 4] fistp dword [esp] fldcw [esp + 6] mov eax, [esp] add esp, 8 ret align 16 _ftoiSSE: cvttss2si eax, [esp + 4] ret align 16 _facos: fld dword [esp + 4] fld st0 fmul st0, st1 fsubr dword [one] fsqrt fxch st1 fpatan ret align 16 _fasin: fld dword [esp + 4] fld st0 fmul st0, st1 fsubr dword [one] fsqrt fpatan ret align 16 _fatan: fld dword [esp + 4] fld1 fpatan ret align 16 _fceil: push eax fnstcw [esp + 2] mov ax, [esp + 2] and ah, -13 or ah, 8 mov [esp], ax fld dword [esp + 8] fldcw [esp] frndint fldcw [esp + 2] pop edx ret align 16 _fceilSSE4: sub esp, 4 roundss xmm0, [esp + 8], 10 retFloat esp, xmm0 add esp, 4 ret segment .rodata align=16 expData dd 0x5C17F0BC, 0xB8AA3B29, 0x3FFF segment .text align=16 _fexp: fld tword [expData] fmul dword [esp + 4] fld st0 frndint fsub st1, st0 fxch st1 f2xm1 fadd dword [one] fscale fstp st1 ret align 16 _fexpi686: fldl2e fmul dword [esp + 4] fld st0 frndint fsub st1, st0 fxch st1 f2xm1 fadd dword [one] fscale fstp st1 ret align 16 _ffloor: push eax fnstsw [esp + 2] mov ax, [esp + 2] and ah, -13 or ah, 4 mov [esp], ax fld dword [esp + 8] fldcw [esp] frndint fldcw [esp + 2] pop edx ret align 16 _ffloorSSE: sub esp, 12 movss xmm2, [esp + 16] movss xmm3, [minus0] xorps xmm0, xmm3 movss xmm4, [twoPow23] cmpltss xmm0, xmm1 andps xmm1, xmm0 orps xmm1, xmm3 addss xmm6, xmm1 subss xmm6, xmm1 movaps xmm5, xmm6 subss xmm5, xmm2 cmpnless xmm5, xmm3 andps xmm5, xmm4 subss xmm6, xmm5 retFloat esp, xmm6 add esp, 12 ret align 16 _ffloorSSE4: sub esp, 4 roundss xmm0, [esp + 8], 9 retFloat esp, xmm0 add esp, 4 ret align 16 _ffmod: fld dword [esp + 8] fld dword [esp + 4] .loop: fprem fnstsw ax test ah, 4 jne .loop fstp st1 ret align 16 _fldexp: fld dword [esp + 4] fild dword [esp + 8] fxch st1 fscale fstp st1 ret align 16 _flog: fldln2 fld dword [esp + 4] fyl2x ret align 16 _flog10: fldlg2 fld dword [esp + 4] fyl2x ret align 16 _ffpclassify: fld dword [esp + 4] fldz fucomp st1 fnstsw ax mov ecx, 2 sahf je .popAndRetEcx fabs fld dword [plusInf] fxch st1 fucom st1 fstp st1 mov ecx, 1 sahf jne .continue .popAndRetEcx: fstp st0 mov eax, ecx ret .continue: fld dword [fltMin] fxch st1 fucompp fnstsw ax xor eax, ecx sahf setae cl add ecx, 3 fldz fstp st0 mov eax, ecx ret align 16 _ffpclassifyi686: fld dword [esp + 4] mov eax, 2 fldz fucomp st3 je .popAndRet fabs mov eax, 1 fld dword [plusInf] fxch st1 fucomi st1 fstp st1 jmp .continue .popAndRet: fstp st0 ret .continue: fld dword [plusInf] xor eax, eax fxch st1 fucomp st1 fstp st0 setae al add eax, 3 fldz fstp st0 ret _ffpclassifySSE2: movss xmm0, [esp + 4] xorps xmm1, xmm1 mov eax, 2 ucomiss xmm0, xmm1 jne .continue jp .continue .ret: ret align 16 .continue: ucomiss xmm0, xmm0 jp .ret0 andps xmm0, [fourNaNs] mov eax, 1 ucomiss xmm0, [plusInf] jae .ret movss xmm1, [fltMin] xor eax, eax ucomiss xmm1, xmm0 setbe al add eax, 3 ret align 16 .ret0: xor eax, eax ret align 16 _fisfinite: fld dword [esp + 4] fabs fld dword [plusInf] fucompp fnstsw ax test ah, 1 sete al ret align 16 _fisfinitei686: fld dword [esp + 4] fabs fld dword [plusInf] fucomip st0, st1 fstp st0 setnb al ret align 16 _fisfiniteSSE: movss xmm0, [esp + 4] andps xmm0, [fourNaNs] ucomiss xmm0, [plusInf] setne al ret align 16 _fpow: fldln2 fld dword [esp + 4] fyl2x fmul dword [esp + 8] fldl2e fmulp st1, st0 fld st0 frndint fsub st1, st0 fxch st1 f2xm1 fadd dword [one] fscale fstp st1 ret align 16 _fisinf: push eax fld dword [esp + 8] fstp dword [esp] fld dword [esp] fxam fnstsw ax fstp st0 and ah, 0x45 cmp ah, 5 sete al pop edx ret align 16 _fisinfSSE: movss xmm0, [esp + 4] andps xmm0, [fourNaNs] ucomiss xmm0, [plusInf] sete al ret align 16 _fisnan: fld dword [esp + 4] fucomp st0 fnstsw ax test ah, 4 setne al ret align 16 _fisnani686: fld dword [esp + 4] fucomip st0, st0 setp al ret align 16 _fisnanSSE: movss xmm0, [esp + 4] ucomiss xmm0, xmm0 setp al ret align 16 _fisnormal: fld dword [esp + 4] fabs fld dword [plusInfMin1] fucomp st1 fnstsw ax test ah, 1 setne dl fld dword [fltMin] fxch st1 fucompp fnstsw ax test ax, 1 setne al or al, dl xor al, 1 ret align 16 _fisnormali686: fld dword [esp + 4] fabs fld dword [plusInfMin1] fucomip st0, st1 fld dword [fltMin] fxch st1 setb al fucomip st0, st1 fstp st0 setb dl or al, dl xor al, 1 ret align 16 _fisnormalSSE: movss xmm0, [esp + 4] ucomiss xmm0, xmm0 setnp cl andps xmm0, [fourNaNs] ucomiss xmm0, [plusInf] setb dl movss xmm1, [fltMin] ucomiss xmm1, xmm0 setbe al and al, dl and al, cl ret align 16 _fsignbit: mov eax, [esp + 4] shr eax, 31 ret align 16 _fisunordered: fld dword [esp + 4] fld dword [esp + 8] fucompp fnstsw ax test ah, 4 setne al ret align 16 _fisunorderedi686: fld dword [esp + 4] fld dword [esp + 8] fucomip st0, st1 fstp st0 setp al ret align 16 _fisunorderedSSE: movss xmm0, [esp + 4] ucomiss xmm0, [esp + 8] setp al ret align 16 _fcopysign: fld dword [esp + 4] fxam fnstsw ax fstp st0 fld dword [esp + 8] fabs test ah, 2 je .noInverse fchs .noInverse: ret align 16 _fcopysignSSE: push eax movss xmm0, [esp + 8] movss xmm1, [esp + 12] andps xmm1, [fourMinus0] andps xmm0, [fourNaNs] orps xmm0, xmm1 retFloat esp, xmm0 pop eax ret align 16 _fexp2: fld dword [esp + 4] fld st0 frndint fsub st1, st0 fxch st1 f2xm1 fadd dword [one] fscale fstp st1 ret align 16 _fexpm1: fldl2e fmul dword [esp + 4] fld st0 frndint fsub st1, st0 fld1 fxch st2 f2xm1 fscale fxch st2 fscale fstp st1 fsub dword [one] faddp st1, st0 ret align 16 _filogb: sub esp, 8 fnstcw [esp + 6] fld dword [esp + 12] fxtract fstp st0 movzx eax, word [esp + 6] or ax, 0xC00 mov [esp + 4], ax fldcw [esp + 4] fistp dword [esp] fldcw [esp + 6] mov eax, [esp] add esp, 8 ret align 16 _fllrint: sub esp, 12 fld dword [esp + 16] fistp qword [esp] mov eax, [esp] mov edx, [esp + 4] add esp, 12 ret align 16 _fllround: sub esp, 20 fld dword [esp + 24] fxam fnstsw ax mov ecx, eax fabs fadd dword [zeroPoint5] fnstcw [esp + 14] mov dx, [esp + 14] and dh, -0xD or dh, 4 mov [esp + 12], dx fldcw [esp + 12] fistp qword [esp] fldcw [esp + 14] mov eax, [esp] mov edx, [esp + 4] and ch, 2 je .return neg eax adc edx, 0 neg edx .return: add esp, 20 ret segment .rodata align=16 log1pDat1 dd 0xC4336F8, 0x95F61998, 0x3FFD align 16 log1pDat2 dd 0xD1CF79AC, 0xB17217F7, 0x3FFE segment .text align=16 _flog1p: fld dword [esp + 4] fld st0 fabs fld tword [log1pDat1] fxch st1 fcompp fnstsw ax test ah, 5 je .norm fld tword [log1pDat2] fxch st1 fyl2xp1 ret align 16 .norm: fld1 faddp st1, st0 fld tword [log1pDat2] fxch st1 fyl2x ret align 16 _flog1pi686: fld dword [esp + 4] fabs fld tword [log1pDat1] fxch st1 fcomip st0, st1 fstp st0 jnb .norm fldln2 fld dword [esp + 4] fyl2xp1 ret align 16 .norm: fld1 fadd dword [esp + 4] fldln2 fxch st1 fyl2x ret align 16 _flog2: fld1 fld dword [esp + 4] fyl2x ret align 16 _flogb: fld dword [esp + 4] fxtract fstp st0 ret align 16 _fnearbyint: sub esp, 4 fnstcw [esp + 2] fld dword [esp + 8] movzx eax, word [esp + 2] or ax, 0x20 mov [esp], ax fldcw [esp] frndint fclex fldcw [esp + 2] pop eax ret align 16 _fremainder: fld dword [esp + 8] fld dword [esp + 4] .loop: fprem1 fnstsw ax sahf jp .loop fstp st1 ret align 16 _fhypot: fld dword [esp + 4] fld dword [esp + 8] fld dword [esp + 12] fld st2 fabs fld st2 fabs fld st2 fabs fxch st2 fcom st1 fnstsw ax test ah, 1 je .yup fstp st0 fld st0 fcomp st2 fnstsw ax test ah, 5 jne .nope fstp st1 jmp .continue .yup2: fstp st1 .continue: ftst fnstsw ax test ah, 64 jne .nope2 fld1 fdiv st0, st1 fmul st4, st0 fmul st3, st0 fmulp st2, st0 fxch st3 fmul st0, st0 fxch st2 fmul st0, st0 faddp st2, st0 fmul st0, st0 faddp st1, st0 fsqrt fmulp st1, st0 ret .yup: fstp st1 fcom st1 fnstsw ax test ah, 5 je .yup2 fstp st0 jmp .continue .nope: fstp st0 jmp .continue .nope2: fstp st0 fstp st0 fstp st0 fstp st0 fldz ret align 16 _fhypoti686: fld dword [esp + 4] fabs fld dword [esp + 8] fabs fld dword [esp + 12] fabs fxch st1 fcomi st0, st2 jbe .biggerEqual fstp st2 fxch st1 fcomi st0, st1 fcmovb st0, st1 fstp st1 fldz fcomip st0, st1 je .popAndRet0 .notEqual: fld1 fdiv st0, st1 fld dword [esp + 4] fmul st0, st1 fld dword [esp + 8] fmul st0, st2 fxch st2 fmul dword [esp + 12] fxch st1 fmul st0, st0 fxch st2 fmul st0, st0 faddp st2, st0 fmul st0, st0 faddp st1, st0 fsqrt fmulp st1, st0 ret align 16 .biggerEqual: fstp st0 fxch st1 fcomi st0, st1 fcmovb st0, st1 fstp st1 fldz fcomip st0, st1 jne .notEqual fstp st0 jmp .ret0 align 16 .popAndRet0: fstp st0 .ret0: fldz ret align 16 _fhypotSSE: sub esp, 12 movss xmm3, [esp + 16] movss xmm1, [esp + 20] andps xmm3, [NaNPlus0s] andps xmm1, [NaNPlus0s] movss xmm2, [esp + 24] andps xmm2, [NaNPlus0s] comiss xmm1, xmm3 jbe .biggerEqual movaps xmm4, xmm2 maxss xmm4, xmm1 jmp .continue align 16 .biggerEqual: movaps xmm4, xmm2 maxss xmm4, xmm3 .continue: xorps xmm0, xmm0 ucomiss xmm4, xmm0 jp .parity je .ret0 .parity: movss xmm0, [one] divss xmm0, xmm4 mulss xmm3, xmm3 mulss xmm1, xmm1 mulss xmm2, xmm2 addss xmm3, xmm1 addss xmm3, xmm2 mulss xmm3, xmm0 mulss xmm3, xmm0 sqrtss xmm3, xmm3 mulss xmm4, xmm3 jmp .return align 16 .ret0: xorps xmm4, xmm4 .return: retFloat esp, xmm4 add esp, 12 ret align 16 _fhypotAVX: push eax vmovss xmm0, [esp + 16] vmovss xmm1, [esp + 12] vmovss xmm2, [esp + 8] vmovaps xmm4, [fourNaNs] vandps xmm3, xmm2, xmm4 vandps xmm2, xmm1, xmm4 vandps xmm0, xmm4 vmaxss xmm1, xmm0, xmm2 vmaxss xmm4, xmm0, xmm3 vcmpltss xmm5, xmm3, xmm2 vblendvps xmm1, xmm4, xmm1, xmm5 vxorps xmm4, xmm4 vucomiss xmm1, xmm4 je .retXmm4 vmovss xmm4, [one] vdivss xmm4, xmm4, xmm1 vmulss xmm3, xmm3, xmm4 vmulss xmm3, xmm3, xmm3 vmulss xmm2, xmm2, xmm4 vaddss xmm2, xmm3, xmm2 vmulss xmm0, xmm0, xmm4 vmulss xmm0, xmm0, xmm0 vaddss xmm0, xmm2, xmm0 vsqrtss xmm0, xmm0, xmm0 vmulss xmm4, xmm0, xmm1 .retXmm4: retFloatAVX esp, xmm4 pop eax ret align 16 _fhypotFMA: push eax vmovss xmm0, [esp + 16] vmovss xmm1, [esp + 12] vmovss xmm2, [esp + 8] vbroadcastss xmm4, [NaN] vandps xmm2, xmm2, xmm4 vandps xmm3, xmm1, xmm4 vandps xmm0, xmm0, xmm4 vmaxss xmm1, xmm0, xmm3 vmaxss xmm4, xmm0, xmm2 vcmpltss xmm5, xmm2, xmm3 vblendvps xmm1, xmm4, xmm1, xmm5 vxorps xmm4, xmm4, xmm4 vucomiss xmm1, xmm4 je .retXmm4 vmovss xmm4, [one] vdivss xmm4, xmm4, xmm1 vmulss xmm2, xmm2, xmm4 vmulss xmm3, xmm3, xmm4 vmulss xmm3, xmm3, xmm3 vfmadd231ss xmm3, xmm2, xmm2 ; xmm3 = xmm2² + xmm3 vmulss xmm0, xmm0, xmm4 vfmadd213ss xmm0, xmm0, xmm3 ; xmm0 = xmm0² + xmm3 vsqrtss xmm0, xmm0, xmm0 vmulss xmm4, xmm0, xmm1 .retXmm4: retFloatAVX esp, xmm4 pop eax ret
boot.asm
harishtpj/MKS
0
91977
<gh_stars>0 ;; Assembly Kernel Loader MAGIC_NUMBER equ 0x1BADB002 ; define the magic number constant FLAGS equ 0x0 ; multiboot flags CHECKSUM equ -MAGIC_NUMBER ; calculate the checksum ; (magic number + checksum + flags should equal 0) KERNEL_STACK_SIZE equ 8192 ; size of stack in bytes section .text ; Multiboot spec align 4 dd MAGIC_NUMBER dd FLAGS dd CHECKSUM global start extern kernel ; opens kernel and kernel related files start: ; the loader label (defined as entry point in linker script) cli ; block interrupts mov esp, kernel_stack + KERNEL_STACK_SIZE ; point esp to the start of the stack (end of memory area) call kernel ; calls main kernel function hlt ; halt the CPU section .bss align 4 ; align at 4 bytes kernel_stack: ; label points to beginning of memory resb KERNEL_STACK_SIZE ; reserve stack for the kernel
neio/src/main/grammar/ClassParser.g4
FlashYoshi/neio
0
828
/* [The BSD License] Copyright (c) 2012 <NAME> and <NAME> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 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 author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ parser grammar ClassParser; options { tokenVocab = ClassLexer; } document : namespace importDeclaration* classDef body EOF; namespace : NAMESPACE namespaceReference SCOLON; namespaceReference : Identifier (DOT Identifier)*; importDeclaration : IMPORT type (DOT STAR)? SCOLON; classDef : ABSTRACT? header Identifier inheritance* SCOLON; header : CLASS | INTERFACE; inheritance : ( EXTENDS type | IMPLEMENTS type); body : ( fieldDecl SCOLON | fieldAssignmentExpression SCOLON | (methodExpression SCOLON | method))+ | ; fieldDecl : modifier* type Identifier; fieldAssignmentExpression : var=fieldDecl EQUALS val=expression; method : methodExpression block; methodExpression : modifier* methodHeader L_BRACE parameters? R_BRACE; methodHeader : (SMALLER typeParameterList BIGGER)? (rtype=type | vd=VOID)? name=(Identifier | MethodIdentifier | STAR | MINUS | PIPE | HAT | EQUALS); modifier : ABSTRACT | PRIVATE | PROTECTED | PUBLIC | FINAL | STATIC | NESTED | SURROUND; block : LC_BRACE statement* RC_BRACE; statement : RETURN expression? SCOLON #returnStatement | variableDeclaration SCOLON #variableDeclarationStatement | assignmentExpression SCOLON #assignmentStatement | ifteStatement #ifStatement | StringLiteral #TextModeStatement | WHILE L_BRACE expression R_BRACE (block | SCOLON) #whileLoop | FOR L_BRACE init=variableDeclaration SCOLON cond=expression SCOLON update=assignmentExpression R_BRACE block #forLoop | expression SCOLON #expressionStatement ; ifteStatement : IF L_BRACE ifCondition=expression R_BRACE ifBlock=block (ELSE (elseBlock=block | elif=ifteStatement))?; variableDeclaration : neioNewCall | type Identifier (EQUALS expression); assignmentExpression : var=expression EQUALS val=expression; literal : StringLiteral #stringLiteral | CharLiteral #charLiteral | Integer #intLiteral | Double #doubleLiteral | (TRUE | FALSE) #boolLiteral | NULL #nullLiteral ; expression : literal #literalExpression | TextMode #TextMode | L_BRACE type R_BRACE expression #castExpression | Identifier DOT CLASS #classLiteral | SUPER #superExpression | SUPER arguments #superDelegation | THIS #selfExpression | THIS arguments #thisDelegation | Identifier #identifierExpression | constructorCall #newExpression | neioNewCall #neioNewExpression | expression DOT Identifier #chainExpression | L_BRACE expression R_BRACE #parExpression | expression DOT name=(Identifier | NAMESPACE | MethodIdentifier | STAR| MINUS | EQUALS | HAT) args=arguments #qualifiedCallExpression | name=(Identifier | NAMESPACE | MethodIdentifier | STAR | MINUS | EQUALS | HAT) args=arguments #selfCallExpression | op=E_MARK right=expression #notExpression | left=expression op=(INCR | DECR) #postfixCrementExpression | op=(INCR | DECR) right=expression #prefixCrementExpression | op=(PLUS | MINUS) right=expression #prefixExpression | left=expression op=OR right=expression #orExpression | left=expression op=AND right=expression #andExpression | left=expression op=HAT right=expression #exponentiationExpression | left=expression op=PIPE right=expression #pipeExpression | left=expression op=AMPERSAND right=expression #ampersandExpression | left=expression op=(EQUAL | NOT_EQUAL) right=expression #equalityExpression | left=expression op=(STAR | SLASH | PERCENT) right=expression #highPriorityNumbericalExpression | left=expression op=(PLUS | MINUS) right=expression #lowPriorityNumbericalExpression | left=expression op=(L_SHIFT | RR_SHIFT | R_SHIFT) right=expression #shiftExpression | left=expression op=(LEQ | GEQ | BIGGER | SMALLER) right=expression #orderExpression ; constructorCall : NEW type arguments; neioNewCall : NEW type arguments Identifier; arguments : L_BRACE expression (COMMA expression)* R_BRACE #someArguments | L_BRACE R_BRACE #emptyArguments ; parameters : parameter (COMMA parameter)*; parameter : type Identifier; type : identifier (DOT identifier)* (SMALLER typeArgumentList BIGGER)? (ARRAY)?; typeArgumentList : typeArgumentList COMMA type #typeArguments | type #typeArgument | Q_MARK EXTENDS bound=type #boundedTypeArgument ; typeParameterList : typeParameterList COMMA type #typeParameters | type #typeParameter | Identifier EXTENDS bound=type #boundedTypeParameter ; identifier : Identifier | NAMESPACE;
src/Tactic/By/Parametrised.agda
nad/equality
3
371
<gh_stars>1-10 ------------------------------------------------------------------------ -- A tactic aimed at making equational reasoning proofs more readable -- in modules that are parametrised by an implementation of equality ------------------------------------------------------------------------ -- The tactic uses the first instance of Equality-with-J that it finds -- in the context. {-# OPTIONS --without-K --safe #-} open import Equality open import Prelude module Tactic.By.Parametrised {c⁺} (eq : ∀ {a p} → Equality-with-J a p c⁺) where open Derived-definitions-and-properties eq open import List eq open import Monad eq open import Tactic.By eq as TB open import TC-monad eq as TC open TB public using (⟨_⟩) ------------------------------------------------------------------------ -- The ⟨by⟩ tactic private -- Finds the first instance of "∀ Δ → Equality-with-J something" in -- the context (if any; Δ must not contain "visible" arguments), -- starting from the "outside", and returns a term standing for this -- instance. find-Equality-with-J : TC Term find-Equality-with-J = do c ← getContext n ← search (reverse c) return (var (length c ∸ suc n) []) where search : List (Arg TC.Type) → TC ℕ search [] = typeError (strErr err ∷ []) where err = "⟨by⟩: No instance of Equality-with-J found in the context." search (a@(arg _ t) ∷ args) = do if ok t then return 0 else suc ⟨$⟩ search args where ok : Term → Bool ok (def f _) = if eq-Name f (quote Equality-with-J) then true else false ok (pi (arg (arg-info visible _) _) _) = false ok (pi _ (abs _ b)) = ok b ok _ = false open ⟨By⟩ (λ where (def (quote Reflexive-relation._≡_) (arg _ a ∷ _ ∷ arg _ A ∷ arg _ x ∷ arg _ y ∷ [])) → return $ just (a , A , x , y) _ → return nothing) find-Equality-with-J (λ eq p → def (quote sym) (varg eq ∷ varg p ∷ [])) (λ eq lhs rhs f p → def (quote cong) (varg eq ∷ replicate 4 (harg unknown) ++ harg lhs ∷ harg rhs ∷ varg f ∷ varg p ∷ [])) false public
bb-runtimes/examples/sam4s-xplained/tetris/main.adb
JCGobbi/Nucleo-STM32G474RE
0
17046
------------------------------------------------------------------------------ -- -- -- GNAT EXAMPLE -- -- -- -- Copyright (C) 2013-2015, 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. -- -- -- ------------------------------------------------------------------------------ with Interfaces; use Interfaces; with System; pragma Warnings (Off); with System.SAM4S; use System.SAM4S; pragma Warnings (On); with Ada.Real_Time; use Ada.Real_Time; with Fonts; with Leds; use Leds; with Oled; use Oled; with Tetris; use Tetris; procedure Main is Now : Time := Clock; -- The current time. We don't really use a ravenscar architecture: no -- periodic task. Slow_Fall_Period : constant Time_Span := Milliseconds (1000 / 2 / 4); -- Quarter of time to wait before a piece falls. We allow 2 rotations -- or moves per fall, and 4 falls per second. Quick_Fall_Period : constant Time_Span := Milliseconds (50); -- Time to wait when a piece is dropped Blink_Period : constant Time_Span := Milliseconds (100); -- Blinking period for leds at the end of the game Fall_Period : Time_Span; Nbr_Pieces : Natural; -- Number of pieces fallen. This is the score. procedure Draw_Board (With_Piece : Boolean); -- Draw on the OLED screen the board and the falling piece procedure Draw_Board (With_Piece : Boolean) is type Screen_Type is array (0 .. 3, Y_Coord) of Unsigned_8; Screen : Screen_Type := (others => (others => 0)); X_Start : constant := 1; Zoom : constant := 3; Pixels_Per_Byte : constant := 8; subtype Screen_Col is Natural range 0 .. 31; procedure Set_Screen_Pixel (X : Screen_Col; Y : Y_Coord) is Mask : constant Unsigned_8 := 2 ** (X mod Pixels_Per_Byte); Byte : Unsigned_8 renames Screen (X / Pixels_Per_Byte, Y); begin Byte := Byte or Mask; end Set_Screen_Pixel; procedure Set_Pixel (X : X_Coord; Y : Y_Coord) is X_Pos : constant Natural := 3 * (X - X_Coord'First); begin for I in 1 .. Zoom loop Set_Screen_Pixel (X_Pos + I - 1 + X_Start, Y); end loop; end Set_Pixel; Num : Natural; Digit : Natural; begin -- Vertical borders for Y in Y_Coord loop Set_Screen_Pixel (X_Start - 1, Y); Set_Screen_Pixel (X_Start + X_Size * Zoom, Y); end loop; -- The board for Y in Y_Coord loop for X in X_Coord loop if Cur_Board (Y)(X) /= Empty then Set_Pixel (X, Y); end if; end loop; end loop; -- The current piece if With_Piece then case Cur_Piece.S is when O => Set_Pixel (Cur_Piece.X, Cur_Piece.Y); Set_Pixel (Cur_Piece.X, Cur_Piece.Y + 1); Set_Pixel (Cur_Piece.X + 1, Cur_Piece.Y); Set_Pixel (Cur_Piece.X + 1, Cur_Piece.Y + 1); when I => for Y in I_Delta loop for X in I_Delta loop if Possible_I_Shapes (Cur_Piece.D) (Y, X) then Set_Pixel (Cur_Piece.X + X, Cur_Piece.Y + Y); end if; end loop; end loop; when Three_Shape => for Y in Three_Delta loop for X in Three_Delta loop if Possible_Three_Shapes (Cur_Piece.S, Cur_Piece.D) (Y, X) then Set_Pixel (Cur_Piece.X + X, Cur_Piece.Y + Y); end if; end loop; end loop; end case; end if; -- Draw Num := Nbr_Pieces; for X in Screen'Range (1) loop Oled_Set_Page (Unsigned_8 (X)); for Y in Screen'Range (2) loop for I in 1 .. Zoom loop Oled_Draw (Screen (X, Y)); end loop; end loop; -- Border Oled_Draw (16#ff#); -- Score if Num /= 0 or X = Screen'First (1) then Oled_Draw (0); Oled_Draw (0); Digit := Num mod 10; for J in Fonts.Glyph_Type'Range loop Oled_Draw (Fonts.Digit_Font (Digit) (J)); end loop; Num := Num / 10; end if; end loop; end Draw_Board; Rnd : Unsigned_32 := 137; -- Simple random generator. Success : Boolean; type Led_Step_Type is mod 3; Led_Step : Led_Step_Type; -- Led chaser begin -- Init the devices Leds.Init; Oled_Init; -- Game loop Game : loop -- Clear board Cur_Board := (others => (others => Empty)); Nbr_Pieces := 0; Oled_Clear; Led_Step := 0; Piece : loop -- Add a new piece Rnd := Rnd * 1103515245 + 12345; Cur_Piece := (S => Cell'Val (1 + ((Rnd / 65536) mod 7)), D => North, X => X_Size / 2, Y => Y_Coord'First); Cur_State := Piece_Falling; -- Stop the game when the piece cannot appear exit Piece when not Valid_Configuration; -- Draw the board, including the new piece Draw_Board (True); Fall_Period := Slow_Fall_Period; -- Make the piece falling Fall : loop Set_Led (False); -- Led chaser Set_Led1 (Led_Step = 0); Set_Led2 (Led_Step = 1); Set_Led3 (Led_Step = 2); Led_Step := Led_Step + 1; -- At most 2 rotations or moves per fall for J in 1 .. 2 loop -- Check button if Button1_Pressed then Do_Action (Move_Right, Success); elsif Button2_Pressed then Do_Action (Turn_Clockwise, Success); elsif Button3_Pressed then Do_Action (Move_Left, Success); elsif Button_Pressed then Fall_Period := Quick_Fall_Period; end if; Now := Now + Fall_Period; delay until Now; Draw_Board (True); end loop; -- Fall and continue unless the piece hits the ground Do_Action (Move_Down, Success); exit Fall when not Success; Draw_Board (True); end loop Fall; -- Done with that piece Cur_State := Piece_Blocked; Nbr_Pieces := Nbr_Pieces + 1; Set_Led (True); Set_Led1 (True); Set_Led2 (True); Set_Led3 (True); Include_Piece_In_Board; Delete_Complete_Lines; Now := Now + Fall_Period; delay until Now; end loop Piece; -- Lost! declare Toggle : Boolean := True; begin loop -- Wait for any button exit when Button1_Pressed or Button2_Pressed or Button3_Pressed or Button_Pressed; -- Change the seed of the random generator Rnd := Rnd + 1; -- Toggle leds Set_Led (Toggle); Set_Led1 (not Toggle); Set_Led2 (Toggle); Set_Led3 (not Toggle); Now := Now + Blink_Period; delay until Now; Toggle := not Toggle; end loop; end; end loop Game; end Main;
examples/music/funkyforest.asm
azurda/gingerbread
109
8396
<filename>examples/music/funkyforest.asm ; File created by mod2gbt SECTION "funkyforest_0",ROMX funkyforest_0: DB $AB,$1F, $AB,$AA,$03, $93,$17, $8C,$0F DB $00, $2F, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $28, $28, $22, $8C,$0F DB $20, $20, $20, $20 DB $AB,$1F, $A3,$1F, $8E,$17, $8C,$0F DB $28, $28, $22, $28 DB $20, $20, $20, $20 DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $AB,$1F, $A3,$1F, $00, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $28, $28, $00, $20 DB $A9,$1F, $A1,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $A6,$1F, $9F,$1F, $95,$17, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $28, $28, $22, $20 DB $AB,$1F, $A3,$1F, $97,$17, $8C,$0F DB $28, $28, $22, $20 DB $20, $20, $20, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $49,$00, $20 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_1",ROMX funkyforest_1: DB $A4,$1F, $9C,$1F, $8C,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $28, $22, $20 DB $00, $00, $00, $20 DB $20, $93,$1F, $20, $8C,$0F DB $00, $00, $00, $20 DB $00, $98,$1F, $00, $8C,$0F DB $00, $00, $00, $28 DB $00, $28, $00, $20 DB $00, $00, $00, $20 DB $AB,$1F, $9F,$1F, $8C,$17, $8C,$0F DB $00, $00, $00, $20 DB $20, $28, $22, $8C,$0F DB $00, $00, $00, $28 DB $00, $20, $20, $20 DB $00, $00, $00, $20 DB $A8,$1F, $9F,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $A9,$1F, $A1,$1F, $90,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $28, $22, $20 DB $00, $00, $00, $20 DB $20, $20, $20, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $A8,$1F, $93,$1F, $00, $8C,$0F DB $00, $00, $00, $28 DB $28, $28, $00, $20 DB $00, $00, $00, $20 DB $20, $20, $00, $8C,$0F DB $00, $00, $00, $20 DB $A9,$1F, $95,$1F, $8E,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $28, $22, $20 DB $00, $00, $00, $20 DB $A8,$1F, $96,$10, $20, $8C,$0F DB $00, $00, $00, $20 DB $A6,$1F, $97,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $28, $28, $00, $8C,$0F DB $00, $00, $00, $20 DB $20, $20, $00, $8C,$0F DB $00, $00, $49,$00, $20 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_2",ROMX funkyforest_2: DB $A8,$1F, $98,$1F, $90,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $28, $22, $20 DB $00, $00, $00, $20 DB $20, $20, $20, $8C,$0F DB $00, $00, $00, $20 DB $00, $98,$1F, $00, $8C,$0F DB $00, $00, $00, $28 DB $00, $28, $00, $20 DB $00, $00, $00, $20 DB $A8,$1F, $95,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $28, $28, $00, $8C,$0F DB $00, $00, $00, $28 DB $20, $20, $00, $20 DB $00, $00, $00, $20 DB $A9,$1F, $95,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $AA,$1F, $94,$1F, $00, $8C,$0F DB $00, $00, $00, $28 DB $28, $28, $00, $20 DB $00, $00, $00, $20 DB $AB,$1F, $93,$1F, $93,$17, $8C,$0F DB $00, $00, $00, $20 DB $28, $28, $22, $8C,$0F DB $00, $00, $00, $28 DB $20, $20, $20, $20 DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $97,$1F, $93,$1F, $00, $8C,$0F DB $00, $00, $00, $28 DB $28, $28, $00, $20 DB $00, $00, $00, $20 DB $98,$1F, $95,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $97,$1F, $93,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $28, $28, $00, $8C,$0F DB $00, $00, $00, $20 DB $20, $20, $00, $8C,$0F DB $00, $00, $49,$00, $20 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_3",ROMX funkyforest_3: DB $AD,$1F, $9E,$1F, $8E,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $28, $00, $20 DB $00, $00, $20, $20 DB $20, $20, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $9A,$1F, $90,$17, $8C,$0F DB $00, $00, $00, $28 DB $00, $28, $00, $20 DB $00, $00, $20, $20 DB $AD,$1F, $9E,$1F, $00, $8C,$0F DB $28, $28, $00, $20 DB $20, $20, $92,$17, $8C,$0F DB $00, $00, $00, $28 DB $20, $20, $00, $20 DB $00, $00, $20, $20 DB $AD,$1F, $9A,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $AD,$1F, $9E,$1F, $8E,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $28, $00, $20 DB $00, $00, $20, $20 DB $AB,$1F, $A3,$1F, $93,$17, $8C,$0F DB $00, $00, $00, $20 DB $20, $20, $00, $8C,$0F DB $00, $00, $20, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $AB,$1F, $A3,$1F, $93,$17, $8C,$0F DB $00, $00, $00, $28 DB $20, $20, $00, $20 DB $00, $00, $00, $20 DB $00, $00, $90,$17, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $8E,$17, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $AB,$1F, $A3,$1F, $93,$17, $8C,$0F DB $AA,$1F, $A2,$1F, $00, $20 DB $A9,$1F, $A1,$1F, $00, $8C,$0F DB $A8,$18, $A0,$18, $00, $20 DB $A6,$14, $9F,$14, $00, $8C,$0F DB $20, $20, $20, $20 DB $AB,$1F, $9C,$1F, $00, $8C,$0F DB $00, $00, $49,$00, $20 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_4",ROMX funkyforest_4: DB $AD,$1F, $9D,$1F, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $28, $00, $20 DB $00, $00, $20, $20 DB $20, $20, $00, $00 DB $00, $00, $00, $00 DB $00, $9D,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $00, $A1,$18, $00, $20 DB $00, $00, $20, $20 DB $B2,$1F, $A4,$14, $00, $00 DB $00, $00, $00, $00 DB $28, $9D,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $20, $A1,$18, $00, $20 DB $00, $00, $20, $20 DB $AD,$1F, $A4,$14, $00, $00 DB $00, $00, $00, $00 DB $B0,$1F, $9D,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $A4,$18, $00, $20 DB $00, $00, $20, $20 DB $20, $A1,$14, $00, $00 DB $00, $00, $00, $00 DB $00, $9D,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $00, $9F,$18, $00, $20 DB $00, $00, $20, $20 DB $00, $A1,$14, $00, $00 DB $00, $00, $00, $00 DB $AD,$1F, $A4,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $A9,$18, $00, $20 DB $00, $00, $20, $20 DB $20, $A8,$14, $00, $00 DB $00, $00, $00, $00 DB $B2,$1F, $A4,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $A1,$18, $00, $20 DB $00, $00, $20, $20 DB $B0,$1F, $9D,$14, $00, $00 DB $00, $00, $00, $00 DB $AD,$1F, $98,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $9A,$18, $00, $20 DB $00, $00, $20, $20 DB $20, $9C,$14, $00, $00 DB $00, $00, $49,$00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_5",ROMX funkyforest_5: DB $AC,$1F, $9D,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $A0,$18, $00, $20 DB $00, $00, $20, $20 DB $20, $A4,$14, $00, $00 DB $00, $00, $00, $00 DB $00, $9D,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $00, $A0,$18, $00, $20 DB $00, $00, $20, $20 DB $B2,$1F, $A4,$14, $00, $00 DB $00, $00, $00, $00 DB $28, $9D,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $20, $A0,$18, $00, $20 DB $00, $00, $20, $20 DB $AC,$1F, $A4,$14, $00, $00 DB $00, $00, $00, $00 DB $B0,$1F, $9D,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $A0,$18, $00, $20 DB $00, $00, $20, $20 DB $20, $A4,$14, $00, $00 DB $00, $00, $00, $00 DB $AC,$1F, $9D,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $9F,$18, $00, $20 DB $00, $00, $20, $20 DB $20, $A0,$14, $00, $00 DB $00, $00, $00, $00 DB $B2,$1F, $A4,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $A9,$18, $00, $20 DB $00, $00, $20, $20 DB $B0,$1F, $A7,$14, $00, $00 DB $00, $00, $00, $00 DB $AC,$1F, $A4,$1C, $91,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $A0,$18, $00, $20 DB $00, $00, $20, $20 DB $20, $9D,$14, $00, $00 DB $00, $00, $00, $00 DB $AB,$1F, $9F,$1F, $93,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $28, $00, $20 DB $00, $00, $20, $20 DB $20, $20, $00, $00 DB $00, $00, $49,$00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_6",ROMX funkyforest_6: DB $20, $20, $8C,$17, $8C,$8A,$03 DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $20, $20 DB $B2,$1F, $A3,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $28, $28, $00, $8C,$0F DB $00, $00, $00, $28 DB $20, $20, $00, $20 DB $00, $00, $00, $20 DB $AB,$1F, $9C,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $B2,$1F, $9F,$1F, $00, $8C,$0F DB $00, $00, $00, $28 DB $20, $9E,$1F, $00, $20 DB $00, $00, $00, $20 DB $B1,$1F, $9D,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $B0,$1F, $9C,$1F, $00, $8C,$0F DB $00, $00, $00, $28 DB $28, $28, $00, $20 DB $00, $00, $00, $20 DB $20, $20, $00, $8C,$0F DB $00, $00, $00, $20 DB $AD,$1F, $9C,$1F, $8C,$17, $8C,$0F DB $00, $00, $00, $28 DB $28, $28, $00, $20 DB $00, $00, $20, $20 DB $20, $20, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $AD,$1F, $9C,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $28, $28, $00, $8C,$0F DB $00, $00, $00, $28 DB $20, $20, $00, $20 DB $00, $00, $00, $20 DB $AA,$1F, $9A,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $28, $28, $00, $8C,$0F DB $00, $00, $00, $20 DB $20, $20, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $49,$00, $20 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_7",ROMX funkyforest_7: DB $AB,$1F, $A3,$1F, $93,$17, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $28, $28, $22, $8C,$0F DB $20, $20, $20, $20 DB $AB,$1F, $A3,$1F, $8E,$17, $8C,$0F DB $28, $28, $22, $28 DB $20, $20, $20, $20 DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $AB,$1F, $A3,$1F, $00, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $28, $28, $00, $20 DB $A9,$1F, $A1,$1F, $00, $8C,$0F DB $00, $00, $00, $20 DB $A6,$1F, $9F,$1F, $95,$17, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $28, $28, $22, $20 DB $AB,$1F, $A3,$1F, $97,$17, $8C,$0F DB $28, $28, $22, $20 DB $20, $20, $20, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $AB,$2F, $00, $00, $8C,$0F DB $2C, $00, $00, $20 DB $AD,$2F, $00, $00, $8C,$0F DB $2C, $00, $00, $28 DB $28, $00, $00, $20 DB $24, $00, $00, $20 DB $B0,$2F, $00, $00, $8C,$0F DB $2C, $00, $00, $20 DB $B7,$2F, $00, $00, $8C,$0F DB $24, $00, $00, $28 DB $B6,$2F, $00, $00, $20 DB $24, $00, $00, $20 DB $B4,$2F, $00, $00, $8C,$0F DB $24, $00, $00, $20 DB $B7,$2F, $00, $00, $8C,$0F DB $2C, $00, $00, $20 DB $28, $00, $00, $8C,$0F DB $24, $00, $00, $20 DB $20, $00, $00, $8C,$0F DB $00, $00, $49,$00, $20 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_8",ROMX funkyforest_8: DB $BA,$2F, $9C,$1F, $8C,$17, $8C,$0F DB $2C, $A4,$91,$00, $00, $28 DB $28, $9C,$91,$00, $22, $20 DB $24, $A4,$91,$00, $00, $20 DB $B9,$2F, $A4,$91,$00, $20, $8C,$0F DB $00, $9C,$91,$00, $00, $20 DB $00, $A4,$1C, $00, $8C,$0F DB $00, $9C,$18, $00, $28 DB $2C, $A4,$14, $00, $20 DB $28, $20, $00, $20 DB $BA,$2F, $A4,$1C, $8C,$17, $8C,$0F DB $28, $00, $00, $20 DB $20, $20, $22, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $20, $20 DB $00, $00, $00, $20 DB $B9,$2F, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $95,$1F, $90,$17, $8C,$0F DB $00, $9D,$91,$00, $00, $28 DB $2C, $95,$91,$00, $22, $20 DB $28, $9D,$91,$00, $00, $20 DB $B8,$2F, $95,$91,$00, $20, $8C,$0F DB $28, $9D,$91,$00, $00, $20 DB $20, $95,$1C, $00, $8C,$0F DB $00, $9D,$18, $00, $28 DB $00, $95,$14, $00, $20 DB $00, $20, $00, $20 DB $00, $9D,$1F, $00, $8C,$0F DB $00, $28, $00, $20 DB $00, $20, $00, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $00, $98,$1F, $00, $8C,$0F DB $00, $28, $00, $20 DB $B4,$2F, $20, $8E,$17, $8C,$0F DB $2C, $00, $00, $28 DB $28, $00, $22, $20 DB $24, $00, $00, $20 DB $B3,$2F, $98,$1F, $20, $8C,$0F DB $24, $28, $00, $20 DB $B2,$2F, $20, $00, $8C,$0F DB $24, $00, $00, $20 DB $20, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $49,$00, $20 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_9",ROMX funkyforest_9: DB $B1,$2F, $97,$1F, $90,$17, $8C,$0F DB $2C, $9F,$91,$00, $00, $28 DB $28, $97,$91,$00, $22, $20 DB $24, $9F,$91,$00, $00, $20 DB $20, $97,$91,$00, $20, $8C,$0F DB $00, $9F,$91,$00, $00, $20 DB $B0,$2F, $97,$1C, $00, $8C,$0F DB $2C, $9F,$18, $00, $28 DB $28, $97,$14, $00, $20 DB $24, $20, $00, $20 DB $AF,$2F, $9F,$1F, $00, $8C,$0F DB $28, $28, $00, $20 DB $20, $20, $00, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $00, $20 DB $AF,$2F, $9F,$1F, $93,$17, $8C,$0F DB $28, $28, $00, $20 DB $20, $20, $22, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $20, $20 DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $B0,$2F, $00, $00, $8C,$0F DB $2C, $00, $00, $28 DB $28, $00, $00, $20 DB $24, $00, $00, $20 DB $BC,$2F, $00, $00, $8C,$0F DB $2C, $00, $00, $20 DB $28, $00, $00, $8C,$0F DB $24, $00, $00, $28 DB $20, $00, $00, $20 DB $00, $00, $00, $20 DB $B0,$2F, $00, $00, $8C,$0F DB $2C, $00, $00, $20 DB $BA,$2F, $00, $00, $8C,$0F DB $2C, $00, $00, $20 DB $28, $00, $00, $8C,$0F DB $24, $00, $00, $20 DB $20, $00, $00, $8C,$0F DB $00, $00, $49,$00, $20 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_10",ROMX funkyforest_10: DB $BA,$2F, $9C,$1F, $8C,$17, $8C,$0F DB $00, $A4,$91,$00, $00, $28 DB $00, $9C,$91,$00, $22, $20 DB $00, $A4,$91,$00, $00, $20 DB $00, $9C,$91,$00, $20, $8C,$0F DB $00, $A4,$91,$00, $00, $20 DB $00, $9C,$1C, $00, $8C,$0F DB $00, $A4,$18, $00, $28 DB $00, $9C,$14, $00, $20 DB $00, $20, $00, $20 DB $00, $A4,$1C, $8C,$17, $8C,$0F DB $B9,$2F, $00, $00, $20 DB $B8,$2F, $20, $22, $8C,$0F DB $B7,$2F, $00, $00, $28 DB $B6,$2F, $00, $20, $20 DB $B7,$2F, $00, $00, $20 DB $B6,$2F, $00, $00, $8C,$0F DB $B5,$2F, $00, $00, $20 DB $B4,$2F, $95,$1F, $90,$17, $8C,$0F DB $B3,$2F, $9D,$91,$00, $00, $28 DB $B4,$2F, $95,$91,$00, $22, $20 DB $B3,$2F, $9D,$91,$00, $00, $20 DB $B2,$2F, $95,$91,$00, $20, $8C,$0F DB $B1,$2F, $9D,$91,$00, $00, $20 DB $B0,$2F, $95,$1C, $00, $8C,$0F DB $00, $9D,$18, $00, $28 DB $00, $95,$14, $00, $20 DB $00, $20, $00, $20 DB $20, $9D,$1F, $00, $8C,$0F DB $00, $28, $00, $20 DB $A9,$2F, $20, $00, $8C,$0F DB $AA,$2F, $00, $00, $28 DB $A9,$2F, $00, $00, $20 DB $AA,$2F, $00, $00, $20 DB $A9,$2F, $98,$1F, $00, $8C,$0F DB $AA,$2F, $28, $00, $20 DB $A9,$2F, $20, $8E,$17, $8C,$0F DB $AA,$2F, $00, $00, $28 DB $A9,$2F, $00, $22, $20 DB $AA,$2F, $00, $00, $20 DB $A9,$2F, $98,$1F, $20, $8C,$0F DB $AA,$2F, $28, $00, $20 DB $20, $20, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $49,$00, $20 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_11",ROMX funkyforest_11: DB $00, $A1,$1F, $8E,$17, $8C,$0F DB $00, $A6,$91,$00, $00, $28 DB $00, $A1,$91,$00, $00, $20 DB $00, $A6,$91,$00, $20, $20 DB $00, $A1,$91,$00, $00, $8C,$0F DB $00, $A6,$91,$00, $00, $20 DB $00, $A1,$1C, $90,$17, $8C,$0F DB $00, $A6,$18, $00, $28 DB $00, $A1,$14, $00, $20 DB $00, $20, $20, $20 DB $00, $A6,$1F, $00, $8C,$0F DB $00, $28, $00, $20 DB $00, $20, $92,$17, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $20, $20 DB $00, $00, $00, $8C,$0F DB $00, $00, $00, $20 DB $00, $00, $8E,$17, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $20, $20 DB $00, $9F,$1F, $93,$17, $8C,$0F DB $00, $28, $00, $20 DB $00, $20, $00, $8C,$0F DB $00, $00, $20, $28 DB $00, $00, $00, $20 DB $B6,$28, $00, $00, $20 DB $B8,$28, $00, $00, $8C,$0F DB $B9,$28, $00, $00, $20 DB $BA,$28, $00, $93,$17, $8C,$0F DB $B9,$28, $00, $00, $28 DB $BA,$28, $00, $00, $20 DB $B9,$28, $00, $00, $20 DB $BA,$28, $00, $90,$17, $8C,$0F DB $B9,$28, $00, $00, $20 DB $BA,$28, $00, $8E,$17, $8C,$0F DB $B9,$28, $00, $00, $28 DB $BB,$29, $00, $00, $20 DB $B9,$29, $00, $00, $20 DB $BB,$29, $00, $93,$17, $8C,$0F DB $B9,$29, $00, $00, $20 DB $BC,$29, $00, $00, $8C,$0F DB $B9,$29, $00, $00, $20 DB $BC,$29, $00, $00, $8C,$0F DB $B9,$29, $00, $20, $20 DB $BC,$29, $00, $00, $8C,$0F DB $B9,$29, $00, $49,$00, $20 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_12",ROMX funkyforest_12: DB $BD,$29, $9D,$1F, $91,$17, $8C,$0F DB $B9,$29, $00, $00, $28 DB $BD,$29, $28, $00, $20 DB $B9,$29, $00, $20, $20 DB $BD,$29, $20, $00, $00 DB $B9,$29, $00, $00, $00 DB $BE,$29, $9D,$1C, $91,$17, $8C,$0F DB $B9,$29, $00, $00, $28 DB $BE,$29, $A1,$18, $00, $20 DB $B9,$2A, $00, $20, $20 DB $BE,$2A, $A4,$14, $00, $00 DB $B9,$2A, $00, $00, $00 DB $BC,$2A, $9D,$1C, $91,$17, $8C,$0F DB $BF,$2A, $00, $00, $28 DB $BC,$2A, $A1,$18, $00, $20 DB $B9,$2A, $00, $20, $20 DB $BC,$2A, $A4,$14, $00, $00 DB $BF,$2A, $00, $00, $00 DB $BC,$2C, $9D,$1C, $91,$17, $8C,$0F DB $B9,$2C, $00, $00, $28 DB $BC,$2C, $A4,$18, $00, $20 DB $BF,$2C, $00, $20, $20 DB $BC,$2C, $A1,$14, $00, $00 DB $B9,$2C, $00, $00, $00 DB $BC,$2C, $9D,$1C, $91,$17, $8C,$0F DB $BF,$2C, $00, $00, $28 DB $BC,$2C, $9F,$18, $00, $20 DB $B9,$2C, $00, $20, $20 DB $BC,$2C, $A1,$14, $00, $00 DB $BF,$2C, $00, $00, $00 DB $BC,$2C, $A4,$1C, $91,$17, $8C,$0F DB $B9,$2D, $00, $00, $28 DB $BC,$2D, $A9,$18, $00, $20 DB $BF,$2D, $00, $20, $20 DB $BC,$2D, $A8,$14, $00, $00 DB $B9,$2D, $00, $00, $00 DB $BC,$2D, $A4,$1C, $91,$17, $8C,$0F DB $BF,$2D, $00, $00, $28 DB $BC,$2D, $A1,$18, $00, $20 DB $B9,$2D, $00, $20, $20 DB $BC,$2D, $9D,$14, $00, $00 DB $BF,$2D, $00, $00, $00 DB $BC,$2D, $98,$1C, $91,$17, $8C,$0F DB $B9,$2D, $00, $00, $28 DB $BC,$2D, $9A,$18, $00, $20 DB $BF,$2D, $00, $20, $20 DB $BC,$2D, $9C,$14, $00, $00 DB $B9,$2D, $00, $49,$00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_13",ROMX funkyforest_13: DB $BA,$2D, $9D,$1C, $91,$17, $8C,$0F DB $BC,$2D, $00, $00, $28 DB $BF,$2D, $A0,$18, $00, $20 DB $BC,$2D, $00, $20, $20 DB $BA,$2D, $A4,$14, $00, $00 DB $B8,$2D, $00, $00, $00 DB $BF,$2D, $9D,$1C, $91,$17, $8C,$0F DB $BC,$2D, $00, $00, $28 DB $BA,$2D, $A0,$18, $00, $20 DB $B8,$2D, $00, $20, $20 DB $BF,$2D, $A4,$14, $00, $00 DB $BC,$2D, $00, $00, $00 DB $BA,$2D, $9D,$1C, $91,$17, $8C,$0F DB $B8,$2E, $00, $00, $28 DB $BF,$2E, $A0,$18, $00, $20 DB $BC,$2E, $00, $20, $20 DB $BA,$2E, $A4,$14, $00, $00 DB $B8,$2E, $00, $00, $00 DB $BA,$2E, $9D,$1C, $91,$17, $8C,$0F DB $BC,$2E, $00, $00, $28 DB $C0,$2E, $A0,$18, $00, $20 DB $BC,$2E, $00, $20, $20 DB $B8,$2E, $A4,$14, $00, $00 DB $BC,$2E, $00, $00, $00 DB $C1,$2E, $9D,$1C, $91,$17, $8C,$0F DB $BF,$2E, $00, $00, $28 DB $BC,$2F, $9F,$18, $00, $20 DB $B8,$2F, $00, $20, $20 DB $C1,$2F, $A0,$14, $00, $00 DB $BF,$2F, $00, $00, $00 DB $BC,$2F, $A4,$1C, $91,$17, $8C,$0F DB $B8,$2F, $00, $00, $28 DB $C1,$2F, $A9,$18, $00, $20 DB $BF,$2F, $00, $20, $20 DB $BC,$2F, $A7,$14, $00, $00 DB $B8,$2F, $00, $00, $00 DB $C2,$2F, $A4,$1C, $91,$17, $8C,$0F DB $C1,$2F, $00, $00, $28 DB $BF,$2F, $A0,$18, $00, $20 DB $BC,$2F, $00, $20, $20 DB $BA,$2F, $9D,$14, $00, $00 DB $B8,$2F, $00, $00, $00 DB $C3,$2F, $9D,$1C, $91,$17, $8C,$0F DB $C1,$2F, $00, $00, $28 DB $BE,$2F, $A0,$18, $00, $20 DB $BC,$2F, $00, $20, $20 DB $BA,$2F, $A4,$14, $00, $00 DB $B8,$2F, $00, $49,$00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_14",ROMX funkyforest_14: DB $C3,$2F, $9C,$1C, $8C,$17, $8C,$0F DB $C1,$2F, $00, $00, $28 DB $BE,$2F, $9F,$18, $00, $20 DB $BB,$2F, $00, $20, $20 DB $B7,$2F, $A4,$14, $00, $00 DB $C3,$2F, $00, $00, $00 DB $C1,$2F, $9C,$1C, $8C,$17, $8C,$0F DB $BE,$2F, $00, $00, $28 DB $BB,$2F, $9F,$18, $00, $20 DB $B7,$2F, $00, $20, $20 DB $C3,$2F, $A4,$14, $00, $00 DB $C1,$2F, $00, $00, $00 DB $BE,$2F, $9C,$1C, $8C,$17, $8C,$0F DB $BB,$2F, $00, $00, $28 DB $B7,$2F, $9F,$18, $00, $20 DB $C3,$2F, $00, $20, $20 DB $C1,$2F, $A4,$14, $00, $00 DB $BE,$2F, $00, $00, $00 DB $BB,$2F, $9C,$1C, $8C,$17, $8C,$0F DB $B7,$2F, $00, $00, $28 DB $C3,$2F, $9F,$18, $00, $20 DB $C0,$2F, $00, $20, $20 DB $BC,$2F, $9C,$14, $00, $00 DB $BA,$2F, $00, $00, $00 DB $B7,$2F, $98,$1C, $8C,$17, $8C,$0F DB $C3,$2F, $00, $00, $28 DB $C0,$2F, $9C,$18, $00, $20 DB $BC,$2F, $00, $20, $20 DB $BA,$2F, $9F,$14, $00, $00 DB $B7,$2F, $00, $00, $00 DB $BA,$2F, $9F,$1F, $8C,$17, $8C,$0F DB $2C, $2C, $00, $28 DB $28, $28, $00, $20 DB $24, $24, $20, $20 DB $B7,$2F, $9C,$1F, $00, $00 DB $28, $28, $00, $00 DB $20, $20, $8C,$17, $8C,$0F DB $00, $00, $00, $28 DB $00, $00, $00, $20 DB $00, $00, $20, $20 DB $B7,$2F, $9C,$1F, $00, $00 DB $2C, $2C, $00, $00 DB $B6,$2F, $9B,$1F, $8C,$17, $8C,$0F DB $2C, $2C, $00, $28 DB $28, $28, $00, $20 DB $24, $24, $20, $20 DB $B5,$2F, $9A,$1F, $00, $8C,$0F DB $2C, $49,$00, $48,$00, $20 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 DB $00, $00, $00, $00 SECTION "funkyforest_data",ROMX funkyforest_data:: DB BANK(funkyforest_0) DW funkyforest_0 DB BANK(funkyforest_1) DW funkyforest_1 DB BANK(funkyforest_2) DW funkyforest_2 DB BANK(funkyforest_1) DW funkyforest_1 DB BANK(funkyforest_3) DW funkyforest_3 DB BANK(funkyforest_4) DW funkyforest_4 DB BANK(funkyforest_5) DW funkyforest_5 DB BANK(funkyforest_6) DW funkyforest_6 DB BANK(funkyforest_7) DW funkyforest_7 DB BANK(funkyforest_8) DW funkyforest_8 DB BANK(funkyforest_9) DW funkyforest_9 DB BANK(funkyforest_10) DW funkyforest_10 DB BANK(funkyforest_11) DW funkyforest_11 DB BANK(funkyforest_12) DW funkyforest_12 DB BANK(funkyforest_13) DW funkyforest_13 DB BANK(funkyforest_14) DW funkyforest_14 DB $00 DW $0000
dv3/msd/salt4.asm
olifink/smsqe
0
244699
; DV3 MSDOS Sector Allocate, Locate and Truncate V3.00  1993 <NAME> section dv3 xdef msd_sal4 xdef msd_slc4 xdef msd_str4 xref msd_setmu include 'dev8_keys_DOS' include 'dev8_dv3_keys' include 'dev8_dv3_msd_keys' include 'dev8_keys_err' include 'dev8_mac_assert' include 'dev8_mac_xword' ;+++ ; DV3 MSDOS allocate new group of sectors ; ; d0 cr known logical drive group / logical drive group ; d1 c p file group of known drive group ; d2 c p next file group ; d6 c p file ID ; d7 c p drive ID / number ; a0 c p pointer to channel block ; a3 c p pointer to linkage ; a4 c p pointer to drive definition ; ; status return positive (OK) or standard error ; ;--- msd_sal4 ms4a.reg reg d1/d2/a2 movem.l ms4a.reg,-(sp) subq.l #1,d2 blt.s ms4a_new ; new file bsr.s ms4l_find ; find previous group blt.s ms4a_exit move.l d0,d2 ; keep previus group bsr.s ms4a_vg ; looking from d0 ble.s ms4a_drfl ; ... not found add.l d2,d2 ; index the FAT for previous group add.l d2,a2 move.w d0,d1 xword d1 move.w d1,(a2) ; link new one into list jsr msd_setmu ms4a_exit movem.l (sp)+,ms4a.reg rts ms4a_drfl ms4n_drfl moveq #err.drfl,d0 bra.s ms4a_exit ; drive full ;+++ ; DV3 MSDOS allocate first group of new file ; ; d0 r logical drive group ; d6 c u file ID (0 if not allocated) ; d7 c p drive ID / number ; a0 c p pointer to channel block ; a3 c p pointer to linkage ; a4 c p pointer to drive definition ; ; status return positive (OK) or standard error ;--- ;;;msd_snw4 ;;; movem.l ms4a.reg,-(sp) ms4a_new bsr.s ms4a_vg0 ; look for vacant sector from start ble.s ms4n_drfl ; ... not found move.w d0,d6 ; use first group number as file ID move.l d0,d3c_flid(a0) ; and set ID in channel movem.l (sp)+,ms4a.reg rts ; look for vacant group ms4a_vg bsr.s ms4a_vgx ; look for vacant group from d0 bgt.s ms4a_rts ; .. ok ms4a_vg0 moveq #1,d0 ; try from start ms4a_vgx move.l mdf_fat(a4),a2 ; base of FAT addq.l #1,d0 ; + 1 entry add.l d0,a2 ; + group offset add.l d0,a2 moveq #0,d1 move.w mdf_fent(a4),d1 ; number to search subq.l #1,d1 sub.l d0,d1 blt.s ms4a_nv ; ... none assert dos.free,0 ms4a_vloop tst.w (a2)+ ; free? dbeq d1,ms4a_vloop bne.s ms4a_nv ; none move.w #dos.eff4,-(a2) ; new end of file subq.w #1,ddf_afree+2(a4) jsr msd_setmu move.l a2,d0 move.l mdf_fat(a4),a2 ; base of FAT sub.l a2,d0 lsr.l #1,d0 ; new group number ms4a_rts rts ms4a_nv moveq #0,d0 ; no vacant groups rts ;+++ ; DV3 MSDOS locate group of sectors ; ; d0 cr known logical drive group / logical drive group ; d1 c p file group of known drive group ; d2 c p file group required ; d6 c p file ID ; d7 c p drive ID / number ; a0 c p pointer to channel block ; a3 c p pointer to linkage ; a4 c p pointer to drive definition ; ; status return positive (OK) or standard error ;--- msd_slc4 ms4l.reg reg d1/d2/a2 movem.l ms4l.reg,-(sp) bsr.s ms4l_find movem.l (sp)+,ms4l.reg rts ; routine to find a group in the map ms4l_find tst.w d0 ; any known group? beq.s ms4l_start cmp.w d1,d2 ; req sector before or after known? bhi.s ms4l_look ; here or after beq.s ms4l_d0 ms4l_start move.l d6,d0 ; zeroth cluster moveq #0,d1 ms4l_look move.l mdf_fat(a4),a2 sub.w d1,d2 ; go this far beq.s ms4l_d0 subq.w #1,d2 ms4l_ckl move.l d0,d1 ; cluster in long add.l d1,d1 ; index table move.w (a2,d1.l),d0 ; next xword d0 dbeq d2,ms4l_ckl beq.s ms4l_mchk ; ... empty sector cmp.w ddf_atotal+2(a4),d0 ; valid sector? blo.s ms4l_d0 ; ... yes ms4l_mchk moveq #err.mchk,d0 ; oops, not found ms4l_d0 tst.l d0 rts ;+++ ; DV3 MSDOS truncate sector allocation ; ; d0 cr known logical drive group / error status ; d1 c p file group of known drive group ; d2 c p first file group to free ; d6 c u file ID ; d7 c p drive ID / number ; a0 c p pointer to channel block ; a3 c p pointer to linkage ; a4 c p pointer to drive definition ; ; status return standard ;--- msd_str4 tst.l d6 ; any sectors allocated at all? bne.s ms4t_do ; ... yes moveq #0,d0 rts ms4t_do ms4t.reg reg d1/d2/d3/a1/a2 movem.l ms4t.reg,-(sp) subq.l #1,d2 ; previous sector blt.s ms4t_start ; ... none bsr.s ms4l_find ; find previous blt.s ms4t_exit move.l d0,d1 add.l d1,d1 ; index table move.w (a2,d1.l),d0 ; ... next group xword d0 move.w #dos.eff4,(a2,d1.l) ; set new end of file move.l d1,d2 ; check for sector update bra.s ms4t_sa1 ms4t_start move.l d6,d0 ; start at beginning of file moveq #0,d6 ; no ID now move.l d6,d3c_flid(a0) ; nor in channel block move.l d0,d2 add.l d2,d2 ; our check for update ms4t_sa1 move.l mdf_fat(a4),a1 move.l ddf_smask(a4),d3 not.l d3 and.l d3,d2 ; just the sector bra.s ms4t_cknext ms4t_loop move.l d0,d1 add.l d1,d1 move.w (a1,d1.l),d0 ; next group beq.s ms4t_mchk ; ... oops xword d0 clr.w (a1,d1.l) ; clear it addq.w #1,ddf_afree+2(a4) ; ... one more sector free and.l d3,d1 ; sector the same as previous? cmp.l d2,d1 beq.s ms4t_cknext bsr.s ms4t_upd ; mark updated move.l d1,d2 ; our next check ms4t_cknext cmp.w ddf_atotal+2(a4),d0 ; valid next sector? blo.s ms4t_loop ; ... yes cmp.w #dos.eof4,d0 ; end of file? blo.s ms4t_mchk ; ... no move.l d1,d2 bsr.s ms4t_upd ; last sector updated moveq #0,d0 ms4t_exit movem.l (sp)+,ms4t.reg rts ms4t_mchk moveq #err.mchk,d0 bra.s ms4t_exit rts ms4t_upd lea (a1,d2.l),a2 ; this sector updated jmp msd_setmu end
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1776.asm
ljhsiun2/medusa
9
8673
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r8 push %rbp // Faulty Load lea addresses_A+0x4903, %rbp clflush (%rbp) nop nop mfence mov (%rbp), %r8w lea oracles, %r10 and $0xff, %r8 shlq $12, %r8 mov (%r10,%r8,1), %r8 pop %rbp pop %r8 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 8, 'AVXalign': True}, 'OP': 'LOAD'} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'35': 21829} 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 */
src/siphash-general.adb
jhumphry/SPARK_SipHash
5
15276
<filename>src/siphash-general.adb -- SipHash.General -- Implementing SipHash over a general private type -- Copyright (c) 2015, <NAME> - see LICENSE file for details with Ada.Storage_IO, System.Storage_Elements; -- Rather than simply writing the object into a buffer and calling the main -- SipHash routine, this implementation takes advantage of the fact that the -- padding required is always constant and does not need to be recalculated -- each time, giving a minor speed increase. function SipHash.General (m : T) return Hash_Type is package T_Storage is new Ada.Storage_IO(Element_Type => T); Buffer_Size : System.Storage_Elements.Storage_Offset renames T_Storage.Buffer_Size; procedure Write (Buffer : out T_Storage.Buffer_Type; Item : T) renames T_Storage.Write; use System.Storage_Elements; Padded_Blocks : constant Storage_Count := ((Buffer_Size / 8) + 1); Padded_Buffer_Size : constant Storage_Count := Padded_Blocks * 8; B : Storage_Array(1..Padded_Buffer_Size) := (others => 0); m_pos : Storage_Offset := 1; m_i : U64; v : SipHash_State := Get_Initial_State; begin -- This compile-time check is useful for GNAT but in GNATprove it currently -- just generates a warning that it can not yet prove them correct. pragma Warnings (GNATprove, Off, "Compile_Time_Error"); pragma Compile_Time_Error (Storage_Element'Size /= 8, "This implementation of SipHash cannot work " & "with Storage_Element'Size /= 8."); pragma Warnings (GNATprove, On, "Compile_Time_Error"); Write(Buffer => B(1..Buffer_Size), Item => m); B(B'Last) := Storage_Element(Buffer_Size mod 256); for I in 1..Padded_Blocks loop pragma Loop_Invariant (m_pos = (I-1) * 8 + 1); m_i := SArray8_to_U64_LE(B(m_pos..m_pos+7)); v(3) := v(3) xor m_i; for J in 1..c_rounds loop Sip_Round(v); end loop; v(0) := v(0) xor m_i; m_pos := m_pos + 8; end loop; return Hash_Type'Mod(Sip_Finalization(v)); end SipHash.General;
src/tim.asm
no111u3/m48_robo_asm
0
243266
;**************************************************************** .include "m48def.inc" .include "service.inc" .macro incm lds r16, @0 lds r17, @0+1 subi r16,(-1) sbci r17,(-1) sts @0, r16 sts @0+1, r17 .endm ;**************************************************************** ; Data ;**************************************************************** .dseg .org SRAM_START ; because avra ignores device specific segment placement address ccnt: .byte 2 tcnt: .byte 2 ;**************************************************************** ; Code ;**************************************************************** .cseg .org 0x000 rjmp reset ; Reset Handler reti ; rjmp EXT_INT0 ; IRQ0 Handler reti ; rjmp EXT_INT1 ; IRQ1 Handler reti ; rjmp PCINT0 ; PCINT0 Handler reti ; rjmp PCINT1 ; PCINT1 Handler reti ; rjmp PCINT2 ; PCINT2 Handler reti ; rjmp WDT ; Watchdog Timer Handler reti ; rjmp TIM2_COMPA ; Timer2 Compare A Handler reti ; rjmp TIM2_COMPB ; Timer2 Compare B Handler reti ; rjmp TIM2_OVF ; Timer2 Overflow Handler reti ; rjmp TIM1_CAPT ; Timer1 Capture Handler reti ; rjmp TIM1_COMPA ; Timer1 Compare A Handler reti ; rjmp TIM1_COMPB ; Timer1 Compare B Handler reti ; rjmp TIM1_OVF ; Timer1 Overflow Handler reti ; rjmp TIM0_COMPA ; Timer0 Compare A Handler reti ; rjmp TIM0_COMPB ; Timer0 Compare B Handler rjmp TIM0_OVF ; Timer0 Overflow Handler reti ; rjmp SPI_STC ; SPI Transfer Complete Handler reti ; rjmp USART_RXC ; USART, RX Complete Handler reti ; rjmp USART_UDRE ; USART, UDR Empty Handler reti ; rjmp USART_TXC ; USART, TX Complete Handler reti ; rjmp ADC ; ADC Conversion Complete Handler reti ; rjmp EE_RDY ; EEPROM Ready Handler reti ; rjmp ANA_COMP ; Analog Comparator Handler reti ; rjmp TWI ; 2-wire Serial Interface Handler reti ; rjmp SPM_RDY ; Store Program Memory Ready Handler ; Timer0 Overflow Handler ======================================= TIM0_OVF: pushf push r17 incm tcnt pop r17 popf reti reset: sset RAMEND regram_clear SRAM_START, RAMEND+1 start: ; Internal hardware init ======================================== setb DDRC, 5, r16 ; DDRC.5 = 1 setb DDRC, 4, r16 ; DDRC.6 = 1 setb PORTC, 3, r16 ; PORC.3 = 1 clrb DDRC, 3, r16 ; DDRC.3 = 0 setb TIMSK0, TOIE0, r16 ; Enable Timer0 interrupt ldi r16, 1 << CS00 ; Start Timer0, prescale to 1. uout TCCR0B, r16 sei ; Enable interrupts ;================================================================ ; Eternal hardware init ========================================= ;================================================================ ; Main ========================================================== Main: sbis pinc, 3 ; check button if pressed rjmp BT_Push ; jump to push button handler setb PORTC, 5, r16 ; Enable led 1 Next: lds r16, tcnt lds r17, tcnt+1 cpi r16, 0x0 ; Compare by byte brne NoMatch cpi r17, 0x10 brne NoMatch Match: invb PORTC, 4, r16, r17 ; Switch led 2 ; Clear counter, with clear timer0 cnt register clr r16 cli ; disable interrupts for atomic operations uout TCNT0, r16 ; clear timer0 counter sts tcnt, r16 ; clear program counter sts tcnt+1, r16 sei ; enable interrupts NoMatch: nop incm ccnt rjmp Main BT_Push: clrb PORTC, 5, r16 ; Disable led 1 rjmp Next rjmp pc ;================================================================ ;**************************************************************** ; Eeprom Data ;**************************************************************** .eseg
Cubical/Data/Int/Divisibility.agda
howsiyu/cubical
0
6402
<reponame>howsiyu/cubical<filename>Cubical/Data/Int/Divisibility.agda {- Base facts about that the ring ℤ is Bézout domain -} {-# OPTIONS --safe #-} module Cubical.Data.Int.Divisibility where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Function open import Cubical.Foundations.HLevels open import Cubical.Data.Nat hiding (+-assoc ; +-comm ; ·-comm) renaming (_·_ to _·ℕ_; _+_ to _+ℕ_ ; ·-assoc to ·ℕ-assoc) open import Cubical.Data.Nat.Order open import Cubical.Data.Nat.Divisibility using (m∣n→m≤n) renaming (_∣_ to _∣ℕ_ ; isProp∣ to isProp∣ℕ ; stDivIneq to stDivIneqℕ) open import Cubical.Data.Nat.Mod open import Cubical.Data.Int hiding (_+_ ; _·_ ; _-_ ; -_ ; addEq ; ·Comm ; ·Assoc ; +Comm ; +Assoc) open import Cubical.Data.Empty as Empty open import Cubical.Data.Sum open import Cubical.Data.Sigma open import Cubical.HITs.PropositionalTruncation as Prop open import Cubical.Relation.Nullary open import Cubical.Algebra.CommRing open import Cubical.Algebra.CommRing.Instances.Int renaming (ℤ to Ringℤ) open import Cubical.Algebra.RingSolver.Reflection private variable m n k : ℤ -- It seems there are bugs when applying ring solver to integers. -- The following is a work-around. private module Helper {ℓ : Level}(𝓡 : CommRing ℓ) where open CommRingStr (𝓡 .snd) helper1 : (a b m d r : 𝓡 .fst) → (- a · d + b) · m + a · (d · m + r) ≡ a · r + b · m helper1 = solve 𝓡 helper2 : (d m r : 𝓡 .fst) → (d · m + r) + (- d) · m ≡ r helper2 = solve 𝓡 helper3 : (n m d r : 𝓡 .fst) → n ≡ d · m + r → n + (- d) · m ≡ r helper3 n m d r p = (λ t → p t + (- d) · m) ∙ helper2 d m r open Helper Ringℤ open CommRingStr (Ringℤ .snd) -- The Divisibility Relation -- Most definitions are the same as in Cubical.Data.Nat.Divisibility _∣_ : ℤ → ℤ → Type m ∣ n = ∃[ c ∈ ℤ ] c · m ≡ n isProp∣ : isProp (m ∣ n) isProp∣ = squash -- Untruncated divisiblility relation _∣'_ : ℤ → ℤ → Type pos 0 ∣' n = 0 ≡ n pos (suc m) ∣' n = Σ[ c ∈ ℤ ] c · (pos (suc m)) ≡ n (negsuc m) ∣' n = Σ[ c ∈ ℤ ] c · (negsuc m) ≡ n isProp∣' : isProp (m ∣' n) isProp∣' {m = pos 0} {n = n} = isSetℤ 0 n isProp∣' {m = pos (suc m)} {n = n} p q = Σ≡Prop (λ _ → isSetℤ _ _) (·rCancel (pos (suc m)) _ _ (p .snd ∙ sym (q .snd)) (λ r → snotz (injPos r))) isProp∣' {m = negsuc m} {n = n} p q = Σ≡Prop (λ _ → isSetℤ _ _) (·rCancel (negsuc m) _ _ (p .snd ∙ sym (q .snd)) (negsucNotpos _ 0)) ∣→∣' : (m n : ℤ) → m ∣ n → m ∣' n ∣→∣' (pos 0) n ∣ c , p ∣ = ·Comm 0 c ∙ p ∣→∣' (pos (suc m)) n ∣ p ∣ = p ∣→∣' (negsuc m) n ∣ p ∣ = p ∣→∣' m n (squash p q i) = isProp∣' (∣→∣' _ _ p) (∣→∣' _ _ q) i ∣'→∣ : (m n : ℤ) → m ∣' n → m ∣ n ∣'→∣ (pos 0) n p = ∣ 0 , p ∣ ∣'→∣ (pos (suc m)) n p = ∣ p ∣ ∣'→∣ (negsuc m) n p = ∣ p ∣ ∣≃∣' : (m n : ℤ) → (m ∣ n) ≃ (m ∣' n) ∣≃∣' m n = propBiimpl→Equiv isProp∣ isProp∣' (∣→∣' _ _) (∣'→∣ _ _) -- Properties of divisibility ∣-left : m ∣ (m · k) ∣-left {k = k} = ∣ k , ·Comm k _ ∣ ∣-right : m ∣ (k · m) ∣-right {k = k} = ∣ k , refl ∣ ∣-refl : m ≡ n → m ∣ n ∣-refl p = ∣ 1 , p ∣ ∣-zeroˡ : 0 ∣ m → 0 ≡ m ∣-zeroˡ = ∣→∣' _ _ ∣-zeroʳ : m ∣ 0 ∣-zeroʳ = ∣ 0 , refl ∣ ∣-+ : k ∣ m → k ∣ n → k ∣ (m + n) ∣-+ = Prop.map2 λ {(c₁ , p) (c₂ , q) → (c₁ + c₂ , ·DistL+ c₁ c₂ _ ∙ (λ t → p t + q t))} ∣-trans : k ∣ m → m ∣ n → k ∣ n ∣-trans = Prop.map2 λ {(c₁ , p) (c₂ , q) → (c₂ · c₁ , sym (·Assoc c₂ c₁ _) ∙ cong (c₂ ·_) p ∙ q)} ∣-left· : k ∣ n → k ∣ (n · m) ∣-left· {k = k} {m = m} p = ∣-trans p (∣-left {k = m}) ∣-right· : k ∣ m → k ∣ (n · m) ∣-right· {k = k} {n = n} p = ∣-trans p (∣-right {k = n}) -- Natural numbers back and forth (using abs) ∣→∣ℕ : m ∣ n → abs m ∣ℕ abs n ∣→∣ℕ {m = m} = Prop.rec isProp∣ℕ (λ (c , h) → ∣ abs c , sym (abs· c m) ∙ cong abs h ∣) private ∣ℕ→∣-helper : (m n : ℤ) → (c : ℕ)(h : c ·ℕ abs m ≡ abs n) → (m ≡ pos (abs m)) ⊎ (m ≡ - pos (abs m)) → (n ≡ pos (abs n)) ⊎ (n ≡ - pos (abs n)) → Σ[ d ∈ ℤ ] d · m ≡ n ∣ℕ→∣-helper _ _ c _ (inl _) (inl _) .fst = pos c ∣ℕ→∣-helper m n c h (inl p) (inl q) .snd = (λ t → pos c · p t) ∙ sym (pos·pos c (abs m)) ∙ cong pos h ∙ sym q ∣ℕ→∣-helper _ _ c _ (inl _) (inr _) .fst = - pos c ∣ℕ→∣-helper m n c h (inl p) (inr q) .snd = (λ t → - pos c · p t) ∙ sym (-DistL· (pos c) (pos (abs m))) ∙ (λ t → - pos·pos c (abs m) (~ t)) ∙ cong (-_) (cong pos h) ∙ sym q ∣ℕ→∣-helper _ _ c _ (inr _) (inl _) .fst = - pos c ∣ℕ→∣-helper m n c h (inr p) (inl q) .snd = (λ t → - pos c · p t) ∙ sym (-DistLR· (pos c) (pos (abs m))) ∙ sym (pos·pos c (abs m)) ∙ cong pos h ∙ sym q ∣ℕ→∣-helper _ _ c _ (inr _) (inr _) .fst = pos c ∣ℕ→∣-helper m n c h (inr p) (inr q) .snd = (λ t → pos c · p t) ∙ sym (-DistR· (pos c) (pos (abs m))) ∙ (λ t → - pos·pos c (abs m) (~ t)) ∙ cong (-_) (cong pos h) ∙ sym q ∣ℕ→∣ : abs m ∣ℕ abs n → m ∣ n ∣ℕ→∣ = Prop.rec isProp∣ (λ (c , h) → ∣ ∣ℕ→∣-helper _ _ c h (abs→⊎ _ _ refl) (abs→⊎ _ _ refl) ∣) ¬∣→¬∣ℕ : ¬ m ∣ n → ¬ abs m ∣ℕ abs n ¬∣→¬∣ℕ p q = p (∣ℕ→∣ q) -- Inequality for strict divisibility stDivIneq : ¬ m ≡ 0 → ¬ m ∣ n → k ∣ m → k ∣ n → abs k < abs m stDivIneq p q h h' = stDivIneqℕ (¬x≡0→¬abs≡0 p) (¬∣→¬∣ℕ q) (∣→∣ℕ h) (∣→∣ℕ h') -- Exact division divide : m ∣ n → ℤ divide {m = pos 0} _ = 0 divide {m = pos (suc m)} p = ∣→∣' _ _ p .fst divide {m = negsuc m} p = ∣→∣' _ _ p .fst divideEq : (p : m ∣ n) → divide p · m ≡ n divideEq {m = pos 0} = ∣→∣' _ _ divideEq {m = pos (suc m)} p = ∣→∣' _ _ p .snd divideEq {m = negsuc m} p = ∣→∣' _ _ p .snd -- Bézout and Euclidean Domain record Bézout (m n : ℤ) : Type where constructor bezout field coef₁ : ℤ coef₂ : ℤ gcd : ℤ identity : coef₁ · m + coef₂ · n ≡ gcd isCD : (gcd ∣ m) × (gcd ∣ n) open Bézout Bézout0 : (n : ℤ) → Bézout 0 n Bézout0 n .coef₁ = 0 Bézout0 n .coef₂ = 1 Bézout0 n .gcd = n Bézout0 n .identity = +Comm 0 n Bézout0 n .isCD = ∣-zeroʳ , ∣-refl refl bézoutReduction : (m d r : ℤ) → Bézout r m → Bézout m (d · m + r) bézoutReduction m d r b .coef₁ = - b .coef₁ · d + b .coef₂ bézoutReduction m d r b .coef₂ = b .coef₁ bézoutReduction m d r b .gcd = b .gcd bézoutReduction m d r b .identity = helper1 (b .coef₁) (b .coef₂) m d r ∙ b .identity bézoutReduction m d r b .isCD .fst = b .isCD .snd bézoutReduction m d r b .isCD .snd = ∣-+ (∣-right· {n = d} (b .isCD .snd)) (b .isCD .fst) -- Properties of Bézout identity module _ (b : Bézout m n) where private g = b .gcd gcdIsGCD : k ∣ m → k ∣ n → k ∣ g gcdIsGCD {k = k} p q = subst (k ∣_) (b .identity) (∣-+ (∣-right· {n = b .coef₁} p) (∣-right· {n = b .coef₂} q)) gcd≡0 : g ≡ 0 → (m ≡ 0) × (n ≡ 0) gcd≡0 p .fst = sym (∣-zeroˡ (subst (λ a → a ∣ _) p (b .isCD .fst))) gcd≡0 p .snd = sym (∣-zeroˡ (subst (λ a → a ∣ _) p (b .isCD .snd))) ¬m≡0→¬gcd≡0 : ¬ m ≡ 0 → ¬ g ≡ 0 ¬m≡0→¬gcd≡0 p q = p (gcd≡0 q .fst) div₁ div₂ : ℤ div₁ = divide (b .isCD .fst) div₂ = divide (b .isCD .snd) div·-helper : g · (div₁ · n) ≡ g · (div₂ · m) div·-helper = ·Assoc g div₁ n ∙ (λ i → ·Comm g div₁ i · n) ∙ (λ i → divideEq (b .isCD .fst) i · n) ∙ ·Comm m n ∙ (λ i → divideEq (b .isCD .snd) (~ i) · m) ∙ (λ i → ·Comm div₂ g i · m) ∙ sym (·Assoc g div₂ m) div·-g≠0 : ¬ g ≡ 0 → div₁ · n ≡ div₂ · m div·-g≠0 p = ·lCancel _ _ _ div·-helper p div·-g≡0 : g ≡ 0 → div₁ · n ≡ div₂ · m div·-g≡0 p = (λ i → div₁ · gcd≡0 p .snd i) ∙ ·Comm div₁ 0 ∙ ·Comm 0 div₂ ∙ (λ i → div₂ · gcd≡0 p .fst (~ i)) div·-case : Dec (g ≡ 0) → div₁ · n ≡ div₂ · m div·-case (yes p) = div·-g≡0 p div·-case (no ¬p) = div·-g≠0 ¬p div· : div₁ · n ≡ div₂ · m div· = div·-case (discreteℤ g 0) div·- : - div₂ · m + div₁ · n ≡ 0 div·- = (λ i → -DistL· div₂ m (~ i) + div₁ · n) ∙ subst (λ a → - a + div₁ · n ≡ 0) div· (-Cancel' (div₁ · n)) -- Quotient and Remainder record QuotRem (m n : ℤ) : Type where constructor quotrem field div : ℤ rem : ℤ quotEq : n ≡ div · m + rem normIneq : (rem ≡ 0) ⊎ ((¬ rem ≡ 0) × (abs rem < abs m)) open QuotRem -- Using remainder to decide divisibility module _ (m n : ℤ)(qr : QuotRem m n) where rem≡0→m∣n : qr .rem ≡ 0 → m ∣ n rem≡0→m∣n p = ∣ qr .div , (λ i → qr .div · m + p (~ i)) ∙ sym (qr .quotEq) ∣ m∣n→rem≡0 : m ∣ n → qr .rem ≡ 0 m∣n→rem≡0 p = case qr .normIneq return _ of λ { (inl q) → q ; (inr q) → let ∣+ = ∣-+ p (∣-right {m = m} {k = - qr .div}) m∣r = subst (m ∣_) (helper3 _ _ (qr .div) (qr .rem) (qr .quotEq)) ∣+ m≤r = m∣n→m≤n (¬x≡0→¬abs≡0 (q .fst)) (∣→∣ℕ m∣r) in Empty.rec (<-asym (q .snd) m≤r) } m∣n→rem≡0' : (p : m ∣ n) → qr .normIneq ≡ inl (m∣n→rem≡0 p) m∣n→rem≡0' p = case (qr .normIneq) return (λ x → x ≡ inl (m∣n→rem≡0 p)) of λ { (inl q) → cong inl (isSet→SquareP (λ i j → isSetℤ) q (m∣n→rem≡0 p) refl refl) ; (inr q) → Empty.rec (q .fst (m∣n→rem≡0 p)) } rem≢0→m∤n : ¬ qr .rem ≡ 0 → ¬ m ∣ n rem≢0→m∤n p q = p (m∣n→rem≡0 q) -- The Euclidean Algorithm module _ (decEq0 : (n : ℤ) → Dec (n ≡ 0)) (quotRem : (m n : ℤ)(¬z : ¬ m ≡ 0) → QuotRem m n) where euclidStep : (norm : ℕ) → (m n : ℤ)(h : abs m < norm) → (b : QuotRem m n) → Bézout m n euclidStep 0 _ _ h _ = Empty.rec (¬-<-zero h) euclidStep (suc N) m n h (quotrem div rem quotEq (inl p)) = let q = subst (λ r → n ≡ div · m + r) p quotEq in bezout 1 0 m refl (∣-refl refl , subst (λ k → m ∣ k) (sym q) (∣-right {k = div})) euclidStep (suc N) m n h (quotrem div rem quotEq (inr p)) = let b = euclidStep N rem m (<≤-trans (p .snd) (pred-≤-pred h)) (quotRem _ _ (p .fst)) in subst (λ x → Bézout m x) (sym quotEq) (bézoutReduction _ div _ b) private euclid-helper : (m n : ℤ)(dec : Dec (m ≡ 0)) → Bézout m n euclid-helper m n (yes z) = subst (λ x → Bézout x n) (sym z) (Bézout0 n) euclid-helper m n (no ¬z) = euclidStep (suc (abs m)) m n ≤-refl (quotRem m n ¬z) euclid : (m n : ℤ) → Bézout m n euclid m n = euclid-helper m n (decEq0 _) -- Euclid algorithm when divisibility holds euclid∣ : (m n : ℤ) → ¬ m ≡ 0 → m ∣ n → (euclid m n .coef₁ ≡ 1) × (euclid m n .coef₂ ≡ 0) euclid∣ _ _ = euclid∣-helper _ _ (decEq0 _) where euclid∣-helper : (m n : ℤ)(dec : Dec (m ≡ 0)) → ¬ m ≡ 0 → m ∣ n → (euclid-helper m n dec .coef₁ ≡ 1) × (euclid-helper m n dec .coef₂ ≡ 0) euclid∣-helper _ _ (yes z) q = Empty.rec (q z) euclid∣-helper m n (no ¬z) _ q = let qr = quotRem m n ¬z path : qr ≡ quotrem _ _ _ _ path t = record qr { normIneq = m∣n→rem≡0' _ _ qr q t } in (λ t → euclidStep (suc (abs m)) m n ≤-refl (path t) .coef₁) , (λ t → euclidStep (suc (abs m)) m n ≤-refl (path t) .coef₂) -- The ring ℤ is an Euclidean domain private dec-helper : {ℓ ℓ' : Level}{A : Type ℓ}{B : Type ℓ'} → Dec A → B → A ⊎ ((¬ A) × B) dec-helper (yes p) _ = inl p dec-helper (no ¬p) b = inr (¬p , b) quotRemPosPos : (m n : ℕ)(¬z : ¬ pos m ≡ 0) → QuotRem (pos m) (pos n) quotRemPosPos m n _ .div = pos (quotient n / m) quotRemPosPos m n _ .rem = pos (remainder n / m) quotRemPosPos m n _ .quotEq = (λ t → pos (≡remainder+quotient m n (~ t))) ∙ pos+ (remainder n / m) (m ·ℕ (quotient n / m)) ∙ +Comm (pos (remainder n / m)) (pos (m ·ℕ (quotient n / m))) ∙ (λ t → pos·pos m (quotient n / m) t + pos (remainder n / m)) ∙ (λ t → ·Comm (pos m) (pos (quotient n / m)) t + pos (remainder n / m)) quotRemPosPos 0 n ¬z .normIneq = Empty.rec (¬z refl) quotRemPosPos (suc m) n ¬z .normIneq = dec-helper (discreteℤ _ 0) (mod< m n) quotRemNegPos : (m n : ℕ)(¬z : ¬ - pos m ≡ 0) → QuotRem (- pos m) (pos n) quotRemNegPos m n ¬z .div = - (quotRemPosPos m n (λ p → ¬z (λ t → - p t)) .div) quotRemNegPos m n ¬z .rem = quotRemPosPos m n (λ p → ¬z (λ t → - p t)) .rem quotRemNegPos m n ¬z .quotEq = quotRemPosPos m n (λ p → ¬z (λ t → - p t)) .quotEq ∙ (λ t → -DistLR· (pos (quotient n / m)) (pos m) t + (pos (remainder n / m))) quotRemNegPos 0 n ¬z .normIneq = Empty.rec (¬z refl) quotRemNegPos (suc m) n ¬z .normIneq = quotRemPosPos (suc m) n (λ p → ¬z (λ t → - p t)) .normIneq private quotRemPos-helper : (m : ℤ)(k n : ℕ)(¬z : ¬ m ≡ 0) → (m ≡ pos k) ⊎ (m ≡ - pos k) → QuotRem m (pos n) quotRemPos-helper m k n ¬z (inl p) = subst (λ l → QuotRem l (pos n)) (sym p) (quotRemPosPos k n (λ r → ¬z (p ∙ r))) quotRemPos-helper m k n ¬z (inr p) = subst (λ l → QuotRem l (pos n)) (sym p) (quotRemNegPos k n (λ r → ¬z (p ∙ r))) quotRemPos : (m : ℤ)(n : ℕ)(¬z : ¬ m ≡ 0) → QuotRem m (pos n) quotRemPos m n ¬z = quotRemPos-helper m (abs m) n ¬z (abs→⊎ _ _ refl) private sum-helper : (m r : ℤ) → (r ≡ 0) ⊎ ((¬ r ≡ 0) × (abs r < abs m)) → (- r ≡ 0) ⊎ ((¬ - r ≡ 0) × (abs (- r) < abs m)) sum-helper m r (inl p) = inl (λ t → - p t) sum-helper m r (inr p) = inr ((λ q → p .fst (sym (-Involutive r) ∙ (λ t → - q t))) , subst (λ k → k < abs m) (sym (abs- r)) (p .snd)) quotRemNeg : (m : ℤ)(n : ℕ)(¬z : ¬ m ≡ 0) → QuotRem m (- pos n) quotRemNeg m n ¬z .div = - (quotRemPos m n ¬z .div) quotRemNeg m n ¬z .rem = - (quotRemPos m n ¬z .rem) quotRemNeg m n ¬z .quotEq = (λ t → - quotRemPos m n ¬z .quotEq t) ∙ -Dist+ (quotRemPos m n ¬z .div · m) (quotRemPos m n ¬z .rem) ∙ (λ t → -DistL· (quotRemPos m n ¬z .div) m t + - quotRemPos m n ¬z .rem) quotRemNeg m n ¬z .normIneq = sum-helper m _ (quotRemPos m n ¬z .normIneq) private quotRem-helper : (m n : ℤ)(k : ℕ)(¬z : ¬ m ≡ 0) → (n ≡ pos k) ⊎ (n ≡ - pos k) → QuotRem m n quotRem-helper m n k ¬z (inl p) = subst (λ l → QuotRem m l) (sym p) (quotRemPos m k ¬z) quotRem-helper m n k ¬z (inr p) = subst (λ l → QuotRem m l) (sym p) (quotRemNeg m k ¬z) -- The quotient-remainder Theorem and the Bézout identity quotRem : (m n : ℤ)(¬z : ¬ m ≡ 0) → QuotRem m n quotRem m n ¬z = quotRem-helper m n (abs n) ¬z (abs→⊎ _ _ refl) bézout : (m n : ℤ) → Bézout m n bézout = euclid (λ m → discreteℤ m 0) quotRem bézout∣ : (m n : ℤ) → ¬ m ≡ 0 → m ∣ n → (bézout m n .coef₁ ≡ 1) × (bézout m n .coef₂ ≡ 0) bézout∣ = euclid∣ (λ m → discreteℤ m 0) quotRem -- Divisibility is decidable dec∣ : (m n : ℤ) → Dec (m ∣ n) dec∣ m n = case discreteℤ m 0 return (λ _ → Dec (m ∣ n)) of λ { (yes p) → case discreteℤ n 0 return (λ _ → Dec (m ∣ n)) of λ { (yes p) → yes (subst (m ∣_) (sym p) ∣-zeroʳ) ; (no ¬p) → no (λ r → ¬p (sym (∣-zeroˡ (subst (_∣ n) p r)))) } ; (no ¬p) → let qr = quotRem m n ¬p in case discreteℤ (qr .rem) 0 return (λ _ → Dec (m ∣ n)) of λ { (yes p) → yes (rem≡0→m∣n _ _ qr p) ; (no ¬p) → no (rem≢0→m∤n _ _ qr ¬p) }}
codec/decoder/core/x86/dct.asm
tp-m/openh264
1
176270
<filename>codec/decoder/core/x86/dct.asm ;*! ;* \copy ;* Copyright (c) 2009-2013, Cisco Systems ;* 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. ;* ;* 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. ;* ;* ;* dct.asm ;* ;* Abstract ;* WelsDctFourT4_sse2 ;* ;* History ;* 8/4/2009 Created ;* ;* ;*************************************************************************/ %include "asm_inc.asm" ;******************************************************************************* ; Macros and other preprocessor constants ;******************************************************************************* %macro MMX_SumSubDiv2 3 movq %3, %2 psraw %3, $01 paddw %3, %1 psraw %1, $01 psubw %1, %2 %endmacro %macro MMX_SumSub 3 movq %3, %2 psubw %2, %1 paddw %1, %3 %endmacro %macro MMX_IDCT 6 MMX_SumSub %4, %5, %6 MMX_SumSubDiv2 %3, %2, %1 MMX_SumSub %1, %4, %6 MMX_SumSub %3, %5, %6 %endmacro %macro MMX_StoreDiff4P 5 movd %2, %5 punpcklbw %2, %4 paddw %1, %3 psraw %1, $06 paddsw %1, %2 packuswb %1, %2 movd %5, %1 %endmacro ;******************************************************************************* ; Code ;******************************************************************************* SECTION .text ;******************************************************************************* ; void IdctResAddPred_mmx( uint8_t *pPred, const int32_t kiStride, int16_t *pRs ) ;******************************************************************************* WELS_EXTERN IdctResAddPred_mmx %assign push_num 0 LOAD_3_PARA SIGN_EXTENSION r1, r1d movq mm0, [r2+ 0] movq mm1, [r2+ 8] movq mm2, [r2+16] movq mm3, [r2+24] MMX_Trans4x4W mm0, mm1, mm2, mm3, mm4 MMX_IDCT mm1, mm2, mm3, mm4, mm0, mm6 MMX_Trans4x4W mm1, mm3, mm0, mm4, mm2 MMX_IDCT mm3, mm0, mm4, mm2, mm1, mm6 WELS_Zero mm7 WELS_DW32 mm6 MMX_StoreDiff4P mm3, mm0, mm6, mm7, [r0] MMX_StoreDiff4P mm4, mm0, mm6, mm7, [r0+r1] lea r0, [r0+2*r1] MMX_StoreDiff4P mm1, mm0, mm6, mm7, [r0] MMX_StoreDiff4P mm2, mm0, mm6, mm7, [r0+r1] emms ret
kernel/interrupt.asm
YaoLiTao/XV6-LIKE
2
91990
[SECTION .text] extern exception_handler extern disp_IRQ GLOBAL EOI ;默认中断 GLOBAL divide_error GLOBAL single_step_exception GLOBAL nmi GLOBAL breakpoint_exception GLOBAL overflow GLOBAL bounds_check GLOBAL inval_opcode GLOBAL copr_not_available GLOBAL double_fault GLOBAL copr_seg_overrun GLOBAL inval_tss GLOBAL segment_not_present GLOBAL stack_exception GLOBAL general_protection GLOBAL page_fault GLOBAL copr_error GLOBAL IRQ_00 GLOBAL IRQ_01 GLOBAL IRQ_02 ;不可用 GLOBAL IRQ_03 GLOBAL IRQ_04 GLOBAL IRQ_05 GLOBAL IRQ_06 GLOBAL IRQ_07 GLOBAL IRQ_08 GLOBAL IRQ_09 GLOBAL IRQ_10 GLOBAL IRQ_11 GLOBAL IRQ_12 GLOBAL IRQ_13 GLOBAL IRQ_14 GLOBAL IRQ_15 EOI: mov al, 20h out 20h, al nop nop nop nop ret divide_error: push 0xFFFFFFFF ; no err code push 0 ; vector_no = 0 jmp exception single_step_exception: push 0xFFFFFFFF ; no err code push 1 ; vector_no = 1 jmp exception nmi: push 0xFFFFFFFF ; no err code push 2 ; vector_no = 2 jmp exception breakpoint_exception: push 0xFFFFFFFF ; no err code push 3 ; vector_no = 3 jmp exception overflow: push 0xFFFFFFFF ; no err code push 4 ; vector_no = 4 jmp exception bounds_check: push 0xFFFFFFFF ; no err code push 5 ; vector_no = 5 jmp exception inval_opcode: push 0xFFFFFFFF ; no err code push 6 ; vector_no = 6 jmp exception copr_not_available: push 0xFFFFFFFF ; no err code push 7 ; vector_no = 7 jmp exception double_fault: push 8 ; vector_no = 8 jmp exception copr_seg_overrun: push 0xFFFFFFFF ; no err code push 9 ; vector_no = 9 jmp exception inval_tss: push 10 ; vector_no = A jmp exception segment_not_present: push 11 ; vector_no = B jmp exception stack_exception: push 12 ; vector_no = C jmp exception general_protection: push 13 ; vector_no = D jmp exception page_fault: push 14 ; vector_no = E jmp exception copr_error: push 0xFFFFFFFF ; no err code push 16 ; vector_no = 10h jmp exception exception: call exception_handler add esp, 4*2 ; 让栈顶指向 EIP,堆栈中从顶向下依次是:EIP、CS、EFLAGS hlt IRQ_00: push 0 call disp_IRQ add esp, 4 hlt IRQ_01: push 1 call disp_IRQ add esp, 4 hlt IRQ_02: push 2 call disp_IRQ add esp, 4 hlt IRQ_03: push 3 call disp_IRQ add esp, 4 hlt IRQ_04: push 4 call disp_IRQ add esp, 4 hlt IRQ_05: push 5 call disp_IRQ add esp, 4 hlt IRQ_06: push 6 call disp_IRQ add esp, 4 hlt IRQ_07: push 7 call disp_IRQ add esp, 4 hlt IRQ_08: push 8 call disp_IRQ add esp, 4 hlt IRQ_09: push 9 call disp_IRQ add esp, 4 hlt IRQ_10: push 10 call disp_IRQ add esp, 4 hlt IRQ_11: push 11 call disp_IRQ add esp, 4 hlt IRQ_12: push 12 call disp_IRQ add esp, 4 hlt IRQ_13: push 13 call disp_IRQ add esp, 4 hlt IRQ_14: push 14 call disp_IRQ add esp, 4 hlt IRQ_15: push 15 call disp_IRQ add esp, 4 hlt
libsrc/_DEVELOPMENT/stdio/c/sccz80/fileno.asm
meesokim/z88dk
0
20750
; int fileno(FILE *stream) INCLUDE "clib_cfg.asm" SECTION code_stdio ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF __CLIB_OPT_MULTITHREAD & $02 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC fileno EXTERN asm_fileno fileno: push hl pop ix jp asm_fileno ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ELSE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC fileno EXTERN fileno_unlocked defc fileno = fileno_unlocked ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
theorems/homotopy/Hopf.agda
cmknapp/HoTT-Agda
0
9769
<reponame>cmknapp/HoTT-Agda {-# OPTIONS --without-K #-} open import HoTT import homotopy.HopfConstruction open import homotopy.CircleHSpace open import homotopy.SuspensionJoin using () renaming (e to suspension-join) import homotopy.JoinAssocCubical module homotopy.Hopf where module Hopf = homotopy.HopfConstruction S¹ S¹-connected S¹-hSpace Hopf : S² → Type₀ Hopf = Hopf.H.f Hopf-fiber : Hopf north == S¹ Hopf-fiber = idp Hopf-total : Σ _ Hopf == S³ Hopf-total = Σ _ Hopf =⟨ Hopf.theorem ⟩ S¹ * S¹ =⟨ ua (suspension-join S⁰) |in-ctx (λ u → u * S¹) ⟩ (S⁰ * S⁰) * S¹ =⟨ homotopy.JoinAssocCubical.*-assoc ⟩ S⁰ * (S⁰ * S¹) =⟨ ! (ua (suspension-join S¹)) |in-ctx (λ u → S⁰ * u) ⟩ S⁰ * S² =⟨ ! (ua (suspension-join S²)) ⟩ S³ ∎
libtool/src/gmp-6.1.2/mpn/powerpc64/mode32/sqr_diagonal.asm
kroggen/aergo
1,602
28998
<filename>libtool/src/gmp-6.1.2/mpn/powerpc64/mode32/sqr_diagonal.asm dnl PowerPC-64 mpn_sqr_diagonal. dnl Copyright 2001-2003, 2005, 2006, 20010 Free Software Foundation, Inc. dnl This file is part of the GNU MP Library. dnl dnl The GNU MP Library is free software; you can redistribute it and/or modify dnl it under the terms of either: dnl dnl * the GNU Lesser General Public License as published by the Free dnl Software Foundation; either version 3 of the License, or (at your dnl option) any later version. dnl dnl or dnl dnl * the GNU General Public License as published by the Free Software dnl Foundation; either version 2 of the License, or (at your option) any dnl later version. dnl dnl or both in parallel, as here. dnl dnl The GNU MP Library is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License dnl for more details. dnl dnl You should have received copies of the GNU General Public License and the dnl GNU Lesser General Public License along with the GNU MP Library. If not, dnl see https://www.gnu.org/licenses/. include(`../config.m4') C cycles/limb C POWER3/PPC630 18 C POWER4/PPC970 ? C POWER5 7.25 C POWER6 9.5 C INPUT PARAMETERS define(`rp', r3) define(`up', r4) define(`n', r5) ASM_START() PROLOGUE(mpn_sqr_diagonal) ifdef(`HAVE_ABI_mode32', ` rldicl n, n, 0, 32') C zero extend n rldicl. r0, n, 0,62 C r0 = n & 3, set cr0 addi n, n, 3 C compute count... cmpdi cr6, r0, 2 srdi n, n, 2 C ...for ctr mtctr n C copy count into ctr beq cr0, L(b00) blt cr6, L(b01) beq cr6, L(b10) L(b11): ld r0, 0(up) ld r10, 8(up) ld r12, 16(up) addi rp, rp, -16 mulld r7, r0, r0 mulhdu r8, r0, r0 mulld r9, r10, r10 mulhdu r10, r10, r10 mulld r11, r12, r12 mulhdu r12, r12, r12 addi up, up, 24 b L(11) ALIGN(16) L(b01): ld r0, 0(up) addi rp, rp, -48 addi up, up, 8 mulld r11, r0, r0 mulhdu r12, r0, r0 b L(01) ALIGN(16) L(b10): ld r0, 0(up) ld r12, 8(up) addi rp, rp, -32 addi up, up, 16 mulld r9, r0, r0 mulhdu r10, r0, r0 mulld r11, r12, r12 mulhdu r12, r12, r12 b L(10) ALIGN(32) L(b00): L(top): ld r0, 0(up) ld r8, 8(up) ld r10, 16(up) ld r12, 24(up) mulld r5, r0, r0 mulhdu r6, r0, r0 mulld r7, r8, r8 mulhdu r8, r8, r8 mulld r9, r10, r10 mulhdu r10, r10, r10 mulld r11, r12, r12 mulhdu r12, r12, r12 addi up, up, 32 std r5, 0(rp) std r6, 8(rp) L(11): std r7, 16(rp) std r8, 24(rp) L(10): std r9, 32(rp) std r10, 40(rp) L(01): std r11, 48(rp) std r12, 56(rp) addi rp, rp, 64 bdnz L(top) blr EPILOGUE()
programs/oeis/038/A038585.asm
neoneye/loda
22
243970
<reponame>neoneye/loda ; A038585: Write n in binary, delete 0's. ; 1,1,11,1,11,11,111,1,11,11,111,11,111,111,1111,1,11,11,111,11,111,111,1111,11,111,111,1111,111,1111,1111,11111,1,11,11,111,11,111,111,1111,11,111,111,1111,111,1111,1111,11111,11,111,111,1111,111,1111,1111,11111,111,1111,1111,11111,1111,11111,11111,111111,1,11,11,111,11,111,111,1111,11,111,111,1111,111,1111,1111,11111,11,111,111,1111,111,1111,1111,11111,111,1111,1111,11111,1111,11111,11111,111111,11,111,111,1111,111 seq $0,48881 ; a(n) = A000120(n+1) - 1 = wt(n+1) - 1. mov $1,10 pow $1,$0 div $1,9 mul $1,10 add $1,1 mov $0,$1
ee/hk/text.asm
olifink/smsqe
0
3297
; HOTKEY Find address of text V2.00  1994 <NAME> section hotkey xdef hktx_llrc xdef hktx_grab xref met_llrc xref met_grab hktx_llrc lea met_llrc,a1 rts hktx_grab lea met_grab,a1 rts end
sechub-analyzer-cli/src/test/resources/code/ADA/single_line.adb
manu-ki/sechub
79
24479
<filename>sechub-analyzer-cli/src/test/resources/code/ADA/single_line.adb -- SPDX-License-Identifier: MIT with Ada.Text_IO; use Ada.Text_IO; procedure Hello is begin -- NOSECHUB Put_Line ("Hello, world!"); -- END-NOSECHUB end Hello;
programs/oeis/204/A204131.asm
karttu/loda
0
178213
<gh_stars>0 ; A204131: Symmetric matrix based on f(i,j)=(2i-1 if i=j and 1 otherwise), by antidiagonals. ; 1,1,1,1,3,1,1,1,1,1,1,1,5,1,1,1,1,1,1,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,9,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,11,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,13,1,1,1,1,1,1,1,1,1,1,1,1,1 lpb $0,1 add $1,4 sub $0,$1 lpe lpb $0,1 div $0,8 mov $1,$2 lpe div $1,2 add $1,1
lista1/exerc1.asm
Durfan/ufsj-lab-aoc1
0
169533
.data a: .word 3 b: .word 6 c: .word .text la $s0,a lw $t0,0($s0) la $s1,b lw $t1,0($s1) add $t0,$t0,$t1 la $s2,c sw $t0,0($s2)
programs/oeis/335/A335115.asm
karttu/loda
0
244347
<reponame>karttu/loda ; A335115: a(2*n) = 2*n - a(n), a(2*n+1) = 2*n + 1. ; 1,1,3,3,5,3,7,5,9,5,11,9,13,7,15,11,17,9,19,15,21,11,23,15,25,13,27,21,29,15,31,21,33,17,35,27,37,19,39,25,41,21,43,33,45,23,47,33,49,25,51,39,53,27,55,35,57,29,59,45,61,31,63,43,65,33,67,51,69,35,71,45,73,37,75 lpb $0,1 mov $2,$0 gcd $0,2 bin $0,2 sub $0,1 div $2,2 mul $0,$2 add $1,$2 lpe mul $1,2 add $1,1
x86/showInputKeyboard.asm
ovictoraurelio/assembly-lessons
1
83194
org 0x7c00 ;this command jmp 0x0000:start string: db "Digite um numero: ", 13, 10, 0 start: ; ax is a reg to geral use ; ds mov ax,0 ;ax = 0 mov ds,ax ;ds = 0 mov cl,0x0D ;cl = 0 ; load first memory postion of my string on SI (source) mov si, string scanf: mov ah,0 ; Keyboard read int 16h ; Keyboard interrupt cmp ah,cl je end printKeyboard: mov ah, 0xe ; Screen show content of al int 10h ; Screen interrupt jmp scanf end: jmp $ times 510 - ($ - $$) db 0 dw 0xaa55
CPU/cpu_test/test_storage/test6_sw_I.asm
SilenceX12138/MIPS-Microsystems
55
84414
<filename>CPU/cpu_test/test_storage/test6_sw_I.asm ori $2,$0,1 ori $3,$0,4 sw $2,-4($3) ori $4,$0,9394 ori $5,$0,7337 sw $5,4($0) ori $8,$0,5 ori $9,$0,8 nop sw $8,0($9) ori $11,$0,7 ori $12,$0,12 nop nop sw $11,0($12) ori $14,$0,16 ori $15,$0,8796 nop sw $15,0($14) ori $21,$0,20 ori $22,$0,1298 nop nop sw $22,0($21)
interpreter/test/test_state_machine4.asm
straceX/asminterpreter
0
83592
0 PUSH 0 1 WRITE
Driver/Printer/PrintCom/Cursor/cursorSetCursorTosh.asm
steakknife/pcgeos
504
166504
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved PROJECT: PC GEOS MODULE: toshiba 24-pin print driver FILE: toshiba24Cursor.asm AUTHOR: <NAME>, 14 March 1990 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 3/14/90 Initial revision DESCRIPTION: This file contains most of the code to implement the toshiba 24-pin print driver cursor movement support $Id: cursorSetCursorTosh.asm,v 1.1 97/04/18 11:49:45 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PrintSetCursor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: sets the new cursor position in the PSTATE and moves the printhead to the new position. The resolution for positioning the printhead is based on the current character pitch, as the routine uses tabs to position the printhead in the X direction. The printhead can be moved in either direction in X, but only down the page (increasing Y). CALLED BY: EXTERNAL PASS: bp - Segment of PSTATE cx.si - WWFixed new X position in points dx.ax - WWFixed new Y position in points RETURN: carry - set if some communications problem DESTROYED: PSEUDO CODE/STRATEGY: 1 if desired position is below the current one, do y positioning 2 do X positioning KNOWN BUGS/SIDE EFFECTS/IDEAS: none REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 03/90 Initial version Dave 03/92 changed to do Y first, and generalize pitch support. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SET_CURSOR_MODIFIES_FONT = 1 PrintSetCursor proc far uses si,es .enter mov es,bp ;get PSTATE segment. call PrintClearStyles jc exit ;save the X position words. push cx ;integer push si ;fraction ;Service the Y position. call PrConvertToDriverCoordinates sub dx,es:[PS_cursorPos].P_y ;see if the position desired is below clc ; make sure carry is clear for exiting ; when there are no errors. "jle" does ; not look at the carry bit jle serviceXPosition ;dont update position if neg or zero. mov es:[PS_cursorPos].P_x,0ffffh ;cram a large value.... call PrLineFeed ;adjust the position in PSTATE and ;the printhead position. ;Service the X position. serviceXPosition: ;recover the X position words. pop cx ;pop fraction into cx pop dx ;and integer into dx ;now in the correct reg for WWFixed. jc exit ;pass errors from PrLineFeed out. ;before doing any X movement, make sure the position is to the ;right of the last set cursor position. cmp es:[PS_cursorPos].P_x,dx ;save the new X Position. je exit ;do nothing before exiting. jb storeNewXPosition push cx mov cl,C_CR ;send a carriage return. call PrintStreamWriteByte pop cx jc exit storeNewXPosition: mov es:[PS_cursorPos].P_x,dx ;save the new X Position. ;we'll use 10pitch to get as much standardization ;as possible from most printers. ;dx.cx must be the new X position. mov ax,9102 ;x .1388888 for 10 pitch. clr bx call GrMulWWFixed ;dx.cx = # of chars to tab. shl cx,1 ;do any necessary rounding. adc dx,0 ;dl is assumed to have the correct ;tab character position at this point. push dx ;get the character position. mov bl,TP_10_PITCH mov cx,FID_DTC_URW_ROMAN mov dx,12 call PrintSetFont pop cx ;get the character position. jc exit jcxz exit ;if no cursor movement from left, dont. ;do a little limit checking..... inc cl ;printer subs 1 to get value.... cmp cl,126 jb clCorrect mov cl,125 clCorrect: mov si, offset pr_codes_AbsTab call SendCodeOut jc exit call PrintStreamWriteByte exit: .leave ret PrintSetCursor endp
src/asf-components-utils-scrollers.ads
jquorning/ada-asf
12
30565
----------------------------------------------------------------------- -- components-utils-scrollers -- Data scrollers -- Copyright (C) 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 ASF.Contexts.Faces; with ASF.Components.Html; with ASF.Components.Holders; package ASF.Components.Utils.Scrollers is -- ------------------------------ -- UIScroller -- ------------------------------ -- type UIScroller is new ASF.Components.Html.UIHtmlComponent with private; -- Get the list value holder that the scroller is controlling. function Get_List (UI : in UIScroller; Context : in ASF.Contexts.Faces.Faces_Context'Class) return Holders.List_Holder_Access; procedure Render_Page (UI : in UIScroller; Name : in String; Page : in Positive; Context : in out ASF.Contexts.Faces.Faces_Context'Class); -- Encode the data scroller. overriding procedure Encode_Children (UI : in UIScroller; Context : in out ASF.Contexts.Faces.Faces_Context'Class); private type UIScroller is new ASF.Components.Html.UIHtmlComponent with null record; end ASF.Components.Utils.Scrollers;
test/Succeed/Issue224.agda
cruhland/agda
1,989
17201
module Issue224 where data Maybe (A : Set) : Set where nothing : Maybe A just : A → Maybe A data D (A : Set) : Maybe A → Set where d₁ : (x : A) → D A (just x) d₂ : ∀ {x} → D A x → D A x data S : ∀ {A x} → D A x → Set₁ where s : ∀ {A x} {d : D A x} → S d → S (d₂ d) foo : {A : Set} → S (d₂ (d₁ (nothing {A}))) → Set₁ foo (s _) = Set -- Bug.agda:19,6-9 -- Panic: Pattern match failure in do expression at -- src/full/Agda/TypeChecking/Rules/LHS/Unify.hs:331:2-5 -- when checking that the pattern s _ has type S (d₂ (d₁ nothing))
educational-material/3sem/demo/sem3-08/hello-world/assembly/hello.asm
AOrps/SigMal
3
104996
<filename>educational-material/3sem/demo/sem3-08/hello-world/assembly/hello.asm ; nasnow (input file).asm ; clang (input file).o -o (output file name) -W1 ; Follow instructions above for compilation on MacOS section .data msg db "Hello", 10 section .text global _main _main: mov rax, 0x2000004 ; 4 - sys_write mov rdi, 1 ; arg 1: destination. 1 = STDOUT mov rsi, msg ; arg 2: char * mov rdx, 13 ; arg 3: len of output syscall mov rax, 0x2000001 ; 1 - sys_exit xor rdi, rdi ; return code = 0 syscall
src/http_status.ads
psyomn/ash
11
8351
<gh_stars>10-100 -- Copyright 2019 <NAME> (psyomn) -- -- 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 HTTP_Status is type Code is new Positive; type Code_Range is range 100 .. 599; Bad_Code_Error : exception; -- Info CONTINUE : constant Code := 100; SWITCHING_PROTOCOLS : constant Code := 101; -- Success OK : constant Code := 200; CREATED : constant Code := 201; ACCEPTED : constant Code := 202; NON_AUTHORITATIVE_INFORMATION : constant Code := 203; NO_CONTENT : constant Code := 204; RESET_CONTENT : constant Code := 205; PARTIAL_CONTENT : constant Code := 206; -- Redirections MULTIPLE_CHOICES : constant Code := 300; MOVED_PERMANENTLY : constant Code := 301; FOUND : constant Code := 302; SEE_OTHER : constant Code := 303; NOT_MODIFIED : constant Code := 304; USE_PROXY : constant Code := 305; UNUSED : constant Code := 306; TEMPORARY_REDIRECT : constant Code := 307; -- PEBKAC BAD_REQUEST : constant Code := 400; UNAUTHORIZED : constant Code := 401; PAYMENT_REQUIRED : constant Code := 402; FORBIDDEN : constant Code := 403; NOT_FOUND : constant Code := 404; METHOD_NOT_ALLOWED : constant Code := 405; NOT_ACCEPTABLE : constant Code := 406; PROXY_AUTH_REQUIRED : constant Code := 407; REQUEST_TIMEOUT : constant Code := 408; CONFLICT : constant Code := 409; GONE : constant Code := 410; LENGTH_REQUIRED : constant Code := 411; PRECONDITION_FAILED : constant Code := 412; REQUEST_ENTITY_TOO_LARGE : constant Code := 413; REQUEST_URI_TOO_LONG : constant Code := 414; UNSUPPORTED_MEDIA_TYPE : constant Code := 415; REQUESTED_RANGE_NOT_SATISFIABLE : constant Code := 416; EXPECTATION_FAILED : constant Code := 417; -- BOOM INTERNAL_ERROR : constant Code := 500; NOT_IMPLEMENTED : constant Code := 501; BAD_GATEWAY : constant Code := 502; SERVICE_UNAVAILABLE : constant Code := 503; GATEWAY_TIMEOUT : constant Code := 504; HTTP_VERSION_NOT_SUPPORTED : constant Code := 505; function Message_Of_Code (C : Code) return String; end HTTP_Status;
oeis/279/A279136.asm
neoneye/loda-programs
11
13126
; A279136: a(n) = n*Sum_{i=0..n-1} binomial(n,i)*binomial(i-1,n-i-1)/(n-i). ; Submitted by <NAME> ; 0,1,3,10,27,76,210,589,1659,4708,13428,38479,110682,319411,924339,2681410,7794939,22702396,66229212,193495279,566069052,1658026093,4861703289,14269842184,41922504570,123265254451,362719839225,1068105234304 mov $1,3 mov $2,2 mov $3,$0 mov $4,1 lpb $3 mul $1,$4 mul $1,$3 mul $1,2 mul $2,-2 add $5,$4 div $1,$5 div $2,2 add $2,$1 sub $3,1 add $4,2 lpe mov $0,$2 div $0,2 sub $0,1
src/src/c/common/irq/pmirq.asm
amindlost/wdosx
7
102521
<reponame>amindlost/wdosx ;---------------------------------------------------------------------------- ; Configuration parameters ; NUM_INTERRUPT_STACKS = 4 INTERRUPT_STACK_SIZE = 1000h ;---------------------------------------------------------------------------- ; TASM red tape ; .386 .model flat .code PUBLICDLL SetIRQHandler PUBLICDLL GetIRQHandler SIZE_OF_ENTRY EQU ((OFFSET __entryEnd - OFFSET __entryStart) SHR 4) SIZE_OF_WRAPPER EQU ((OFFSET __wrapperEnd - OFFSET __wrapperStart) SHR 4) ;+--------------------------------------------------------------------------- ; DLL Entry point ; DllMain PROC NEAR pushad mov DataSelector, ds mov TIBSelector, fs mov ebx, 8 mov edi, OFFSET __wrapperStart mov esi, OFFSET __entryStart @@getSetLoop: mov eax, 0204h int 31h mov [edi + SIZE_OF_WRAPPER - 8], edx mov [edi + SIZE_OF_WRAPPER - 4], ecx mov edx, esi mov ecx, cs mov eax, 0205h int 31h add esi, SIZE_OF_ENTRY add edi, SIZE_OF_WRAPPER inc ebx cmp ebx, 78h je @@getSetDone cmp ebx, 16 jne @@getSetLoop mov ebx, 70h jmp @@getSetLoop @@getSetDone: popad mov eax, 1 retn 12 DllMain ENDP ;---------------------------------------------------------------------------- ; The actual interrupt glue code ; EnterInterrupt PROC NEAR xchg ecx, [esp] push eax push edx push gs push fs push es push ds mov ds, DWORD PTR cs:[OFFSET DataSelector] mov fs, TIBSelector mov edx, ss mov eax, esp push ds push ds pop es pop ss mov esp, DWORD PTR [OFFSET IntStackTop] sub DWORD PTR [OFFSET IntStackTop], INTERRUPT_STACK_SIZE push edx push eax call ecx cli lss esp, [esp] add DWORD PTR [OFFSET IntStackTop], INTERRUPT_STACK_SIZE pop ds pop es pop fs pop gs pop edx pop eax pop ecx iretd EnterInterrupt ENDP ;---------------------------------------------------------------------------- ; Standard Interrupt entry points ; __entryStart LABEL NEAR i = 0 REPT 16 IrqEntry CATSTR <Irq>,%i,<Entry> IrqEntry LABEL NEAR call EnterInterrupt jmp DWORD PTR [OFFSET HandlerArray + i * 4] i = i + 1 ENDM __entryEnd LABEL NEAR ;---------------------------------------------------------------------------- ; NEAR callable irq handler entries with IRET stackframe ; __wrapperStart LABEL NEAR i = 0 REPT 16 xchg eax, [esp] push eax push eax pushfd pop eax xchg [esp + 8], eax mov [esp + 4], cs db 0EAh dd ? dd ? i = i + 1 ENDM __wrapperEnd LABEL NEAR ;+---------------------------------------------------------------------------- ; GetIrqHandler ; GetIrqHandler PROC NEAR mov eax, [esp + 4] mov eax, [eax * 4 + OFFSET HandlerArray] retn 4 GetIrqHandler ENDP ;+---------------------------------------------------------------------------- ; SetIrqHandler ; SetIrqHandler PROC NEAR mov edx, [esp + 4] mov eax, [esp + 8] mov [edx * 4 + OFFSET HandlerArray], eax retn 8 SetIrqHandler ENDP .data HandlerArray LABEL DWORD i = 0 REPT 16 dd OFFSET __wrapperStart + i * SIZE_OF_WRAPPER i = i + 1 ENDM IntStackTop dd OFFSET TheTopOfStack .data? DataSelector dd ? TIBSelector dd ? db NUM_INTERRUPT_STACKS * INTERRUPT_STACK_SIZE DUP (?) TheTopOfStack LABEL DWORD END DllMain
Task/Phrase-reversals/AppleScript/phrase-reversals.applescript
LaudateCorpus1/RosettaCodeData
1
4535
-- REVERSED PHRASES, COMPONENT WORDS, AND WORD ORDER --------------------- -- reverseString, reverseEachWord, reverseWordOrder :: String -> String on stringReverse(s) |reverse|(s) end stringReverse on reverseEachWord(s) wordLevel(curry(my map)'s |λ|(my |reverse|))'s |λ|(s) end reverseEachWord on reverseWordOrder(s) wordLevel(my |reverse|)'s |λ|(s) end reverseWordOrder -- wordLevel :: ([String] -> [String]) -> String -> String on wordLevel(f) script on |λ|(x) unwords(mReturn(f)'s |λ|(|words|(x))) end |λ| end script end wordLevel -- TEST ---------------------------------------------------------------------- on run unlines(|<*>|({stringReverse, reverseEachWord, reverseWordOrder}, ¬ {"rosetta code phrase reversal"})) --> -- "lasrever esarhp edoc attesor -- attesor edoc esarhp lasrever -- reversal phrase code rosetta" end run -- GENERIC FUNCTIONS --------------------------------------------------------- -- A list of functions applied to a list of arguments -- (<*> | ap) :: [(a -> b)] -> [a] -> [b] on |<*>|(fs, xs) set {nf, nx} to {length of fs, length of xs} set acc to {} repeat with i from 1 to nf tell mReturn(item i of fs) repeat with j from 1 to nx set end of acc to |λ|(contents of (item j of xs)) end repeat end tell end repeat return acc end |<*>| -- curry :: (Script|Handler) -> Script on curry(f) script on |λ|(a) script on |λ|(b) |λ|(a, b) of mReturn(f) end |λ| end script end |λ| end script end curry -- intercalate :: Text -> [Text] -> Text on intercalate(strText, lstText) set {dlm, my text item delimiters} to {my text item delimiters, strText} set strJoined to lstText as text set my text item delimiters to dlm return strJoined end intercalate -- map :: (a -> b) -> [a] -> [b] on map(f, xs) tell mReturn(f) set lng to length of xs set lst to {} repeat with i from 1 to lng set end of lst to |λ|(item i of xs, i, xs) end repeat return lst end tell end map -- Lift 2nd class handler function into 1st class script wrapper -- mReturn :: Handler -> Script on mReturn(f) if class of f is script then f else script property |λ| : f end script end if end mReturn -- reverse :: [a] -> [a] on |reverse|(xs) if class of xs is text then (reverse of characters of xs) as text else reverse of xs end if end |reverse| -- words :: String -> [String] on |words|(s) words of s end |words| -- unlines :: [String] -> String on unlines(lstLines) intercalate(linefeed, lstLines) end unlines -- unwords :: [String] -> String on unwords(lstWords) intercalate(space, lstWords) end unwords
alloy4fun_models/trashltl/models/5/Rmr6tBfXhLma3jHoM.als
Kaixi26/org.alloytools.alloy
0
1622
<filename>alloy4fun_models/trashltl/models/5/Rmr6tBfXhLma3jHoM.als open main pred idRmr6tBfXhLma3jHoM_prop6 { all f: File | once f in Trash implies always f in Trash } pred __repair { idRmr6tBfXhLma3jHoM_prop6 } check __repair { idRmr6tBfXhLma3jHoM_prop6 <=> prop6o }
variables.asm
mkiesinski/the-way-nes
2
5036
<filename>variables.asm spriteTileFirst .rs 1 spriteTileSecnd .rs 1 spriteY .rs 1 spriteDirection .rs 1 spriteAttributes .rs 1 spriteX .rs 1 rowsToDraw .rs 1 maxFrame .rs 1 gamestate .rs 1 palleteID .rs 1 source .rs 2 sourceBank .rs 1 playerInput .rs 1 frame .rs 1 ;; player playerDirection .rs 1 playerAttributes .rs 1 playerPosX .rs 1 playerPosY .rs 1 playerFrameControl .rs 1 playerFrame .rs 1 ;; map rendering background_row .rs $20 data_x .rs 1 data_y .rs 1 mapPointer .rs 2 metaTilesetPointer .rs 2 metaTilePointer .rs 2 repeatMetaTile .rs 1 ;; enemies enemyPointer .rs 2 enemies .rs $30 ;; space for 6 enemies, each takes up 8 bytes enemiesOffset .rs 1
scripts/SSAnneB1F.asm
opiter09/ASM-Machina
1
97859
<filename>scripts/SSAnneB1F.asm SSAnneB1F_Script: jp EnableAutoTextBoxDrawing SSAnneB1F_TextPointers: text_end ; unused
gfx/pokemon/mantine/anim.asm
Dev727/ancientplatinum
28
176035
<reponame>Dev727/ancientplatinum frame 1, 15 frame 2, 15 frame 3, 15 frame 0, 15 frame 4, 15 frame 0, 15 frame 5, 15 endanim
programs/oeis/046/A046992.asm
neoneye/loda
22
85346
; A046992: a(n) = Sum_{k=1..n} pi(k) (cf. A000720). ; 0,1,3,5,8,11,15,19,23,27,32,37,43,49,55,61,68,75,83,91,99,107,116,125,134,143,152,161,171,181,192,203,214,225,236,247,259,271,283,295,308,321,335,349,363,377,392,407,422,437,452,467,483,499,515,531,547,563,580,597,615,633,651,669,687,705,724,743,762,781,801,821,842,863,884,905,926,947,969,991,1013,1035,1058,1081,1104,1127,1150,1173,1197,1221,1245,1269,1293,1317,1341,1365,1390,1415,1440,1465 lpb $0 mov $2,$0 sub $0,1 seq $2,720 ; pi(n), the number of primes <= n. Sometimes called PrimePi(n) to distinguish it from the number 3.14159... add $1,$2 lpe mov $0,$1
src/GBA.Input.adb
98devin/ada-gba-dev
7
22549
<gh_stars>1-10 -- Copyright (c) 2021 <NAME> -- zlib License -- see LICENSE for details. with Interfaces; use Interfaces; with Ada.Unchecked_Conversion; package body GBA.Input is function Cast is new Ada.Unchecked_Conversion(Key_Flags, Key_Set); function Cast is new Ada.Unchecked_Conversion(Key_Set, Key_Flags); function To_Flags (S : Key_Set) return Key_Flags is ( Cast(S) ); function To_Flags (K : Key) return Key_Flags is function Cast is new Ada.Unchecked_Conversion(Unsigned_16, Key_Flags); begin return Cast(Shift_Left(1, Key'Enum_Rep(K))); end; function "or" (K1, K2 : Key) return Key_Flags is ( To_Flags(K1) or To_Flags(K2) ); function "or" (F : Key_Flags; K : Key) return Key_Flags is ( F or To_Flags(K) ); function Read_Key_State return Key_Flags is ( not Key_Input ); function Read_Key_State return Key_Set is ( not Cast(Key_Input) ); procedure Disable_Input_Interrupt_Request is begin Key_Control.Interrupt_Requested := False; end; procedure Request_Interrupt_If_Key_Pressed(K : Key) is Flags : Key_Flags := To_Flags (K); begin Key_Control := ( Flags => Flags , Interrupt_Requested => True , Interrupt_Op => Disjunction ); end; procedure Request_Interrupt_If_Any_Pressed(F : Key_Flags) is begin Key_Control := ( Flags => F , Interrupt_Requested => True , Interrupt_Op => Disjunction ); end; procedure Request_Interrupt_If_All_Pressed(F : Key_Flags) is begin Key_Control := ( Flags => F , Interrupt_Requested => True , Interrupt_Op => Conjunction ); end; end GBA.Input;
programs/oeis/053/A053698.asm
neoneye/loda
22
27895
; A053698: a(n) = n^3 + n^2 + n + 1. ; 1,4,15,40,85,156,259,400,585,820,1111,1464,1885,2380,2955,3616,4369,5220,6175,7240,8421,9724,11155,12720,14425,16276,18279,20440,22765,25260,27931,30784,33825,37060,40495,44136,47989,52060,56355,60880,65641,70644,75895,81400,87165,93196,99499,106080,112945,120100,127551,135304,143365,151740,160435,169456,178809,188500,198535,208920,219661,230764,242235,254080,266305,278916,291919,305320,319125,333340,347971,363024,378505,394420,410775,427576,444829,462540,480715,499360,518481,538084,558175,578760,599845,621436,643539,666160,689305,712980,737191,761944,787245,813100,839515,866496,894049,922180,950895,980200 mov $1,$0 pow $0,2 add $0,1 mul $1,$0 add $0,$1
programs/oeis/095/A095663.asm
neoneye/loda
22
240414
<reponame>neoneye/loda<filename>programs/oeis/095/A095663.asm ; A095663: Eighth column (m=7) of (1,3)-Pascal triangle A095660. ; 3,22,92,288,750,1716,3564,6864,12441,21450,35464,56576,87516,131784,193800,279072,394383,547998,749892,1012000,1348490,1776060,2314260,2985840,3817125,4838418,6084432,7594752,9414328,11594000,14191056 mov $1,$0 add $0,6 bin $0,$1 add $1,21 mul $0,$1 div $0,7
bb-runtimes/runtimes/ravenscar-sfp-stm32g474/gnarl/s-tasdeb.ads
JCGobbi/Nucleo-STM32G474RE
0
25090
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . T A S K I N G . D E B U G -- -- -- -- S p e c -- -- -- -- Copyright (C) 1997-2021, 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. -- -- -- -- -- -- -- -- -- -- -- -- 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/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This package encapsulates all direct interfaces to task debugging services -- that are needed by gdb with gnat mode. -- (Ravenscar version) with System.Tasking; package System.Tasking.Debug is pragma Preelaborate; ------------------------- -- General GDB support -- ------------------------- procedure Add_Task_Id (T : Task_Id); pragma Inline (Add_Task_Id); -- Make the task whose Task_Id is T visible from GDB end System.Tasking.Debug;
programs/oeis/092/A092498.asm
jmorken/loda
1
178103
; A092498: G.f.: (1+x+2x^2)/((1-x)^3*(1-x^3)). ; 1,4,11,23,41,67,102,147,204,274,358,458,575,710,865,1041,1239,1461,1708,1981,2282,2612,2972,3364,3789,4248,4743,5275,5845,6455,7106,7799,8536,9318,10146,11022,11947,12922,13949,15029,16163,17353,18600,19905,21270,22696,24184,25736,27353,29036,30787,32607,34497,36459,38494,40603,42788,45050,47390,49810,52311,54894,57561,60313,63151,66077,69092,72197,75394,78684,82068,85548,89125,92800,96575,100451,104429,108511,112698,116991,121392,125902,130522,135254,140099,145058,150133,155325,160635,166065,171616,177289,183086,189008,195056,201232,207537,213972,220539,227239,234073,241043,248150,255395,262780,270306,277974,285786,293743,301846,310097,318497,327047,335749,344604,353613,362778,372100,381580,391220,401021,410984,421111,431403,441861,452487,463282,474247,485384,496694,508178,519838,531675,543690,555885,568261,580819,593561,606488,619601,632902,646392,660072,673944,688009,702268,716723,731375,746225,761275,776526,791979,807636,823498,839566,855842,872327,889022,905929,923049,940383,957933,975700,993685,1011890,1030316,1048964,1067836,1086933,1106256,1125807,1145587,1165597,1185839,1206314,1227023,1247968,1269150,1290570,1312230,1334131,1356274,1378661,1401293,1424171,1447297,1470672,1494297,1518174,1542304,1566688,1591328,1616225,1641380,1666795,1692471,1718409,1744611,1771078,1797811,1824812,1852082,1879622,1907434,1935519,1963878,1992513,2021425,2050615,2080085,2109836,2139869,2170186,2200788,2231676,2262852,2294317,2326072,2358119,2390459,2423093,2456023,2489250,2522775,2556600,2590726,2625154,2659886,2694923,2730266,2765917,2801877,2838147,2874729,2911624,2948833,2986358,3024200,3062360,3100840,3139641,3178764,3218211,3257983,3298081,3338507,3379262,3420347,3461764,3503514 mov $2,$0 mov $3,$0 lpb $0 lpb $0 sub $0,1 add $4,$2 lpe lpb $4 add $1,2 sub $4,1 lpe trn $2,2 add $1,$2 trn $2,1 mov $0,$2 lpe lpb $3 add $1,1 sub $3,1 lpe add $1,1
dv3/qlf/fsel.asm
olifink/smsqe
0
104350
; DV3 QL Format Select V3.00  1992 <NAME> section dv3 xdef qlf_fsel xref dv3_slen xref dv3_setfd xref dv3_redef xref qlf_tbwa include 'dev8_dv3_keys' include 'dev8_dv3_qlf_keys' include 'dev8_keys_ql5b' include 'dev8_keys_qlwa' include 'dev8_keys_err' include 'dev8_mac_assert' ;+++ ; DV3 QL Format Select ; ; d0 cr format type / error code ; d1 c p format dependent flag ; d7 c p drive ID / number ; a0 c p pointer to physical format table ; a3 c p pointer to linkage ; a4 c p pointer to drive definition ; ; status return standard ; ;--- qlf_fsel qfs.reg reg d1/d2/d3/d4/d5/d6/a1/a2 movem.l qfs.reg,-(sp) move.b ddl_mtype(a3),d2 subq.b #ddl.flp,d2 ; floppy disk? bne.l qfs_hdisk ; ... no tst.b ddl_cylhds(a3) ; accessed by tracks? beq.l qfs_nimp ; ... no move.w dff_cyls(a0),d4 ; number of cylinders move.w dff_heads(a0),d3 ; number of heads cmp.l #10,dff_size+dff.size*ddf.2048(a0) ; at least 10 2k byte sectors? bge.s qfs_fed ; ... yes, QL ED format moveq #3,d5 ; allocate by 3s moveq #ddf.512,d1 ; 512 byte sectors move.l dff_size+dff.size*ddf.512(a0),d2 ; how many 512 sectors? cmp.b #18,d2 ; 18? bge.s qfs_fhd cmp.b #9,d2 ; as many as 9? blt.l qfs_nimp moveq #9,d2 ; nine sectors per track assert ddf.ql5a,0 clr.b ddf_stype(a4) ; old format bra.s qfs_fset qfs_fhd moveq #18,d2 ; 18 sectors per track bra.s qfs_f5b qfs_fed moveq #1,d5 ; allocate by ones moveq #ddf.2048,d1 ; 2048 byte sectors moveq #10,d2 qfs_f5b move.b #ddf.ql5b,ddf_stype(a4) qfs_fset move.w #ddf.rdid,ddf_rdid+2(a4) ; set root director ID move.b d1,ddf_slflag(a4) jsr dv3_slen ; set lengths move.w ddf_slen(a4),d1 ; sector length move.w d4,d6 ; tracks mulu d2,d6 mulu d3,d6 ; total sectors divu d5,d6 ; total groups (no remainder) moveq #q5a_gmap-1,d0 add.w d6,d0 add.w d6,d0 ; map space required add.w d6,d0 ; 3 bytes / group (+header-1) move.w #qdf_map+1,a1 add.l d0,a1 ; top of map (rel a4) divu d1,d0 addq.w #1,d0 ; room for complete sectors exg d0,d1 ; keep sectors required mulu d1,d0 add.l #qdf_map,d0 move.l d0,a2 jsr dv3_redef ; re-allocate drive definition bne.l qfs_exit ; ... oops add.l a4,a1 move.l a1,qdf_mtop(a4) ; set top of map move.w d1,qdf_msect(a4) ; and number of sectors add.l a4,a2 lea qdf_map(a4),a1 moveq #-1,d0 qsf_fclr move.l d0,-(a2) ; preset to all $FF cmp.l a1,a2 bgt.s qsf_fclr assert ddf_slen,ddf_strk-2,ddf_sintlv-6,ddf_sskew-8 lea ddf_slen(a4),a2 move.w (a2)+,d1 ; sector length move.w d2,(a2)+ ; sectors per track addq.l #2,a2 clr.l (a2)+ ; interleave and skew assert ddf_sskew,ddf_heads-2,ddf_scyl-4 move.w d3,(a2)+ ; heads mulu d3,d2 move.w d2,(a2)+ ; sectors per cylinder assert ddf_scyl,ddf_asect-2,ddf_asize-4,ddf_atotal-6 move.w d5,(a2)+ ; allocation sectors mulu d5,d1 move.w d1,(a2)+ ; allocation bytes move.l d6,(a2)+ ; total allocation bra.l qfs_ok qfs_hdisk subq.b #ddl.hd-ddl.flp,d2 ; hard disk? bne.l qfs_nimp ; ... no moveq #0,d2 ; sectors per track moveq #0,d3 ; number of tracks moveq #0,d4 ; number of cylinders move.l dff_size+dff.size*ddf.512(a0),d6 ; 512 byte sectors tst.b ddl_cylhds(a3) ; accessed by tracks? beq.s qfs_hdlog ; ... no move.w d6,d2 ; sectors per track move.w dff_heads(a0),d3 ; number of heads move.w dff_cyls(a0),d4 ; number of cylinders mulu d3,d6 mulu d4,d6 ; total sectors qfs_hdlog lea qlf_tbwa,a2 ; set QLWA jsr dv3_setfd move.l d6,d5 clr.w d5 swap d5 ; sectors /65536 addq.w #1,d5 ; rounded up +, gives allocation size cmp.w #$80,d5 ; $80 * $200 = $10000 is too large bls.s qfs_small ; ... ok move.w #$7f,d5 ; allocs cannot be 65536 bytes move.l #$7f*$ffff,d6 qfs_small cmp.w #4,d5 ; at least 4? bge.s qfs_hset ; ... yes moveq #4,d5 qfs_hset move.b #ddf.qlwa,ddf_stype(a4) move.b #ddf.512,ddf_slflag(a4) jsr dv3_slen ; set lengths move.w ddf_slen(a4),d1 ; sector length move.l d6,d0 divu d5,d0 ; total allocation units moveq #0,d6 move.w d0,d6 moveq #qwa_gmap-1,d0 add.l d6,d0 ; map space required add.l d6,d0 ; 2 bytes / group (+header-1) divu d1,d0 addq.w #1,d0 ; room for complete sectors swap d3 move.w d0,d3 ; number of swap sectors mulu d1,d0 add.l #qdf_map,d0 move.l d0,a1 jsr dv3_redef ; re-allocate drive definition bne.s qfs_exit ; ... oops add.l a4,a1 ; top of map move.l a1,qdf_mtop(a4) ; set top of map move.w d3,qdf_msect(a4) ; map sectors swap d3 assert ddf_strk,ddf_sintlv-4,ddf_sskew-6 lea ddf_strk(a4),a2 move.w d2,(a2)+ ; sectors per track addq.l #2,a2 clr.l (a2)+ ; interleave and skew assert ddf_sskew,ddf_heads-2,ddf_scyl-4 move.w d3,(a2)+ ; heads and sectors per cylinder move.w d2,d0 mulu d3,d0 move.w d0,(a2)+ assert ddf_scyl,ddf_asect-2,ddf_asize-4,ddf_atotal-6 move.w d5,(a2)+ ; allocation sectors mulu d5,d1 move.w d1,(a2)+ ; allocation bytes move.l d6,(a2)+ ; total allocation qfs_ok move.l ddf_psoff(a4),ddf_lsoff(a4) ; set sector offset moveq #0,d0 qfs_exit movem.l (sp)+,qfs.reg rts qfs_nimp moveq #err.nimp,d0 bra.s qfs_exit end
src/fot/FOTC/Program/Iter0/Iter0.agda
asr/fotc
11
12149
------------------------------------------------------------------------------ -- A partial function: iter₀ ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module FOTC.Program.Iter0.Iter0 where open import FOTC.Base open import FOTC.Base.List ------------------------------------------------------------------------------ postulate iter₀ : D → D → D iter₀-eq : ∀ f n → iter₀ f n ≡ (if (iszero₁ n) then [] else (n ∷ iter₀ f (f · n))) {-# ATP axiom iter₀-eq #-}
grammar/Xiang.g4
OpenXiangShan/vcd-to-log
0
6487
<filename>grammar/Xiang.g4 grammar Xiang; main : event* ; event : StringLiteral ':' '{' expression '}' ; expression : '(' inner=expression ')' | expression op=(Mul | Div) expression | expression op=(Add | Minus) expression | expression op=(Equal | NotEqual) expression | expression op=And expression | expression op=Or expression | expression op=BitAnd expression | expression op=BitOr expression | op=Not expression | op=Reverse expression | signal ; signal : instance_path '.' Identifier | Constant ; instance_path : Identifier ('.' Identifier)* ; Identifier : [a-zA-Z_] [a-zA-Z0-9_]* ; StringLiteral : '"' [a-zA-Z0-9_ ]+ '"' ; Constant : '0x' [a-f0-9]+ | '0X' [A-F0-9]+ | '0b' [0|1]+ | '0o' [0-7]+ | [0-9]+ ; Mul : '*' ; Div : '/' ; Add : '+' ; Minus : '-' ; And : '&&' ; Or : '||' ; Equal : '=='; NotEqual : '!='; Not : '!'; Reverse : '~'; BitAnd : '&'; BitOr : '|'; WS : [ \r\n\t]+ -> skip;
Lab12/lab12.asm
richardhyy/AssemblyLab
3
102718
assume cs:code code segment start: ; Set Up the Interruption Handler mov ax,cs mov ds,ax mov si,offset do0 mov ax,0 mov es,ax mov di,200h mov cx,offset do0end-offset do0 ; w/o offset: 0B28:000F B92D00 MOV CX,002D ; w/ offset: 0B28:000F B92D00 MOV CX,002D cld rep movsb ; Set Interruption Vector Table mov ax,0 mov es,ax mov word ptr es:[0*4],200h ; offset mov word ptr es:[0*4+2],0 ; segment ; Test the Handler mov ax,1000h mov bh,1 div bh mov ax,4c00h int 21h ; Interruption Handler do0: jmp short do0start db "overflow!" do0start:mov ax,cs mov ds,ax mov si,202h ; points to the text mov ax,0b800h mov es,ax mov di,12*160 + 36*2 mov cx,9 ; length of the string s: mov al,[si] mov es:[di],al inc si add di,2 loop s mov ax,4c00h int 21h do0end: nop code ends end start
oeis/261/A261065.asm
neoneye/loda-programs
11
93013
; A261065: Second column of A086872. ; Submitted by <NAME>(s2) ; 1,8,75,840,11025,166320,2837835,54054000,1137161025,26189163000,655383804075,17709112020600,513880482740625,15938200818540000,526174085058496875,18422283260401020000,681816379418800250625,26597171457203972625000,1090705672840839577396875 mov $2,$0 seq $0,1879 ; a(n) = (2n+2)!/(n!*2^(n+1)). add $2,3 mul $2,$0 mov $0,$2 div $0,3
oeis/313/A313879.asm
neoneye/loda-programs
11
94817
; A313879: Coordination sequence Gal.6.343.3 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; Submitted by <NAME>(s1) ; 1,5,10,16,21,26,32,38,43,48,54,59,64,69,74,80,85,90,96,102,107,112,118,123,128,133,138,144,149,154,160,166,171,176,182,187,192,197,202,208,213,218,224,230,235,240,246,251,256,261 mov $3,$0 add $3,1 mov $7,$0 lpb $3 mov $0,$7 sub $3,1 sub $0,$3 mov $4,$0 mul $0,2 mov $5,2 mov $6,$4 bin $6,2 lpb $0 mov $0,4 div $6,$5 mov $5,3 mod $6,3 add $0,$6 sub $0,1 mul $6,5 lpe mov $2,$0 add $2,2 add $1,$2 lpe sub $1,1 mov $0,$1
tests/lib_a/src/lib_a.adb
alire-project/resources
0
21668
<reponame>alire-project/resources with Ada.Text_IO; use Ada.Text_IO; package body Lib_A is ------------------- -- Print_Content -- ------------------- procedure Print_Content is File : File_Type; begin Open (File, In_File, Lib_A.Resources.Resource_Path & "/text_file.txt"); while not End_Of_File (File) loop Put_Line (Get_Line (File)); end loop; Close (File); end Print_Content; end Lib_A;
.emacs.d/elpa/wisi-3.1.3/wisitoken-syntax_trees.ads
caqg/linux-home
0
20568
<reponame>caqg/linux-home<gh_stars>0 -- Abstract : -- -- Syntax tree type and operations. -- -- Design : -- -- There is one syntax tree for each parallel parser. There is one -- shared Terminals array (provided by the master parser), matching -- the actual input text. -- -- Node contains a Parent component, to make it easy to traverse the -- tree in any direction. However, we do not set the Parent nodes -- while parsing, to simplify branching the syntax tree for parallel -- parsing. When a new nonterm is added to a branched tree, if it set -- the parent component of its children, it would first have to move -- those children, and all intervening nodes, into the branched tree. -- Since Shared_Terminals nodes are created before all other nodes -- (when the lexer is run, to allow Lexer_To_Augmented to store info -- in the node), that would mean every branched tree is a practically -- complete copy of the entire tree, significantly slowing down -- parsing (by a factor of 250 on ada-mode wisi.adb when we did this -- by mistake!). -- -- The parent components are set by Set_Parents, which is called by -- Parser.Execute_Actions before the actions are executed. -- Fortunately, we don't need the parent components during error -- recover. After calling Set_Parents (ie, while editing the syntax -- tree after parse), any functions that modify children or parents -- update the corresponding links, setting them to Invalid_Node_Index -- or Deleted_Child as appropriate. -- -- We provide Base_Tree and Tree in one package, because only Tree -- needs an API; the only way Base_Tree is accessed is via Tree. -- -- Base_Tree and Tree are not limited to allow -- wisitoken-parse-lr-parser_lists.ads Prepend_Copy to copy them. No -- Adjust is needed; Shared_Tree is shared between parsers, and -- Augmented pointers are also shared, since during parse they are -- set only for Shared_Terminals. -- -- Copyright (C) 2018 - 2020 Free Software Foundation, Inc. -- -- 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 MERCHAN- -- TABILITY 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. pragma License (Modified_GPL); with Ada.Finalization; with SAL.Gen_Unbounded_Definite_Vectors; with WisiToken.Lexer; package WisiToken.Syntax_Trees is type Base_Tree is new Ada.Finalization.Controlled with private; type Base_Tree_Access is access all Base_Tree; overriding procedure Finalize (Tree : in out Base_Tree); -- Free any allocated storage. function Is_Empty (Tree : in Base_Tree) return Boolean; type Tree is new Ada.Finalization.Controlled with private; type Tree_Variable_Reference (Element : not null access Tree) is null record with Implicit_Dereference => Element; type Tree_Constant_Reference (Element : not null access constant Tree) is null record with Implicit_Dereference => Element; function Is_Empty (Tree : in Syntax_Trees.Tree) return Boolean; procedure Initialize (Branched_Tree : in out Tree; Shared_Tree : in Base_Tree_Access; Flush : in Boolean; Set_Parents : in Boolean := False) with Pre => Branched_Tree.Is_Empty and Shared_Tree.Is_Empty; -- Set Branched_Tree to refer to Shared_Tree. overriding procedure Finalize (Tree : in out Syntax_Trees.Tree); -- Free any allocated storage. type Node_Label is (Shared_Terminal, -- text is user input, accessed via Parser.Terminals Virtual_Terminal, -- no text; inserted during error recovery Virtual_Identifier, -- text in user data, created during tree rewrite Nonterm -- contains terminals/nonterminals/identifiers ); type User_Data_Type is tagged limited null record; -- Many test languages don't need this, so we default the procedures -- to null. type User_Data_Access is access all User_Data_Type'Class; procedure Set_Lexer_Terminals (User_Data : in out User_Data_Type; Lexer : in WisiToken.Lexer.Handle; Terminals : in Base_Token_Array_Access_Constant) is null; procedure Reset (User_Data : in out User_Data_Type) is null; -- Reset to start a new parse. procedure Initialize_Actions (User_Data : in out User_Data_Type; Tree : in Syntax_Trees.Tree'Class) is null; -- Called by Execute_Actions, before processing the tree. procedure Lexer_To_Augmented (User_Data : in out User_Data_Type; Tree : in out Syntax_Trees.Tree'Class; Token : in Base_Token; Lexer : not null access WisiToken.Lexer.Instance'Class) is null; -- Read auxiliary data from Lexer, do something useful with it. -- Called before parsing, once for each token in the input stream. If -- Token is a grammar token, client can use Tree.Set_Augmented -- (Token.Tree_Node). function Insert_After (User_Data : in out User_Data_Type; Tree : in Syntax_Trees.Tree'Class; Token : in Valid_Node_Index; Insert_On_Blank_Line : in Boolean) return Boolean; -- Return True if ID should be treated as if inserted after the -- previous shared terminal, rather than before the next (which is -- the default). This can affect which line it appears on, which -- affects indentation. Called from Insert_Token. -- -- The default implementation always returns False. procedure Insert_Token (User_Data : in out User_Data_Type; Tree : in out Syntax_Trees.Tree'Class; Token : in Valid_Node_Index) is null; -- Token was inserted in error recovery; update other tokens and Tree -- as needed. Called from Execute_Actions for each inserted token, -- before processing the syntax tree. procedure Delete_Token (User_Data : in out User_Data_Type; Tree : in out Syntax_Trees.Tree'Class; Token_Index : in WisiToken.Token_Index) is null; -- Token at Token_Index was deleted in error recovery; update -- remaining tokens as needed. Called from Execute_Actions for each -- deleted token, before processing the syntax tree. procedure Reduce (User_Data : in out User_Data_Type; Tree : in out Syntax_Trees.Tree'Class; Nonterm : in Valid_Node_Index; Tokens : in Valid_Node_Index_Array) is null; -- Reduce Tokens to Nonterm. Nonterm.Byte_Region is computed by -- caller. type Semantic_Action is access procedure (User_Data : in out User_Data_Type'Class; Tree : in out Syntax_Trees.Tree; Nonterm : in Valid_Node_Index; Tokens : in Valid_Node_Index_Array); -- Routines of this type are called by -- WisiToken.LR.Parser.Execute_Actions when it processes a Nonterm -- node in the syntax tree. Tokens are the children of Nonterm. Null_Action : constant Semantic_Action := null; procedure Clear (Tree : in out Syntax_Trees.Base_Tree); procedure Clear (Tree : in out Syntax_Trees.Tree); -- Delete all Elements and free associated memory; keep results of -- Initialize. procedure Flush (Tree : in out Syntax_Trees.Tree); -- Move all nodes in branched part to shared tree, set Flush mode -- True. procedure Set_Flush_False (Tree : in out Syntax_Trees.Tree); -- Set Flush mode False; use Flush to set True. function Flushed (Tree : in Syntax_Trees.Tree) return Boolean; function Copy_Subtree (Tree : in out Syntax_Trees.Tree; Root : in Valid_Node_Index) return Valid_Node_Index with Pre => Tree.Flushed and Tree.Parents_Set; -- Deep copy (into Tree) subtree of Tree rooted at Root. Return root -- of new subtree; it has no parent. -- -- Parents of new child nodes are set. Node index order is preserved. -- References to objects external to tree are shallow copied -- (Terminals, Augmented, Action). function Add_Nonterm (Tree : in out Syntax_Trees.Tree; Production : in Production_ID; Children : in Valid_Node_Index_Array; Action : in Semantic_Action := null; Default_Virtual : in Boolean := False) return Valid_Node_Index with Pre => not Tree.Traversing and (for all C of Children => C /= Deleted_Child); -- Add a new Nonterm node, which can be empty. Result points to the -- added node. If Children'Length = 0, set Nonterm.Virtual := -- Default_Virtual. -- -- If Tree.Parents_Set, then Children.Parent are set to the new node, -- and in previous parents of those children (if any), the -- corresponding entry in Children is set to Deleted_Child. function Add_Terminal (Tree : in out Syntax_Trees.Tree; Terminal : in Token_Index; Terminals : in Base_Token_Arrays.Vector) return Valid_Node_Index with Pre => not Tree.Traversing; -- Add a new Terminal node. Terminal must be an index into Terminals. -- Result points to the added node. function Add_Terminal (Tree : in out Syntax_Trees.Tree; Terminal : in Token_ID; Before : in Base_Token_Index := Invalid_Token_Index) return Valid_Node_Index with Pre => not Tree.Traversing; -- Add a new Virtual_Terminal node with no parent. Before is the -- index of the terminal in Terminals that this virtual is inserted -- before during error correction; if Invalid_Token_Index, it is -- inserted during EBNF translation, and there is no such terminal. -- Result points to the added node. function Before (Tree : in Syntax_Trees.Tree; Virtual_Terminal : in Valid_Node_Index) return Base_Token_Index with Pre => Tree.Is_Virtual_Terminal (Virtual_Terminal); function Add_Identifier (Tree : in out Syntax_Trees.Tree; ID : in Token_ID; Identifier : in Identifier_Index; Byte_Region : in WisiToken.Buffer_Region) return Valid_Node_Index with Pre => Tree.Flushed and (not Tree.Traversing); -- Add a new Virtual_Identifier node with no parent. Byte_Region -- should point to an area in the source buffer related to the new -- identifier, to aid debugging. Result points to the added node. procedure Add_Child (Tree : in out Syntax_Trees.Tree; Parent : in Valid_Node_Index; Child : in Valid_Node_Index) with Pre => Tree.Flushed and Tree.Parents_Set and (not Tree.Traversing) and Tree.Is_Nonterm (Parent); -- Sets Child.Parent. function Child_Index (Tree : in out Syntax_Trees.Tree; Parent : in Valid_Node_Index; Child : in Valid_Node_Index) return SAL.Peek_Type with Pre => Tree.Has_Child (Parent, Child); procedure Replace_Child (Tree : in out Syntax_Trees.Tree; Parent : in Valid_Node_Index; Child_Index : in SAL.Peek_Type; Old_Child : in Valid_Node_Index; New_Child : in Valid_Node_Index; Old_Child_New_Parent : in Node_Index := Invalid_Node_Index) with Pre => Tree.Flushed and Tree.Parents_Set and (not Tree.Traversing) and (Tree.Is_Nonterm (Parent) and then (Tree.Child (Parent, Child_Index) = Old_Child and (Old_Child = Deleted_Child or else Tree.Parent (Old_Child) = Parent))); -- In Parent.Children, replace child at Child_Index with New_Child. -- Unless Old_Child is Deleted_Child, set Old_Child.Parent to -- Old_Child_New_Parent (may be Invalid_Node_Index). Unless New_Child -- is Deleted_Child, set New_Child.Parent to Parent. -- -- If Old_Child is Deleted_Child, Old_Child_New_Parent should be left -- to default. procedure Set_Children (Tree : in out Syntax_Trees.Tree; Node : in Valid_Node_Index; New_ID : in WisiToken.Production_ID; Children : in Valid_Node_Index_Array) with Pre => Tree.Flushed and Tree.Parents_Set and (not Tree.Traversing) and Tree.Is_Nonterm (Node) and (for all C of Children => C /= Deleted_Child); -- If parents of current Node.Children are not Invalid_Node_Index, -- set corresponding entry in those parents to Deleted_Child, then -- set Parent to Invalid_Node_Index. -- -- Then set ID of Node to New_ID, and Node.Children to Children; set -- parents of Children to Node. -- -- If New_ID /= Tree.Production_ID (Node), Node.Action is set -- to null, because the old Action probably no longer applies. procedure Delete_Parent (Tree : in out Syntax_Trees.Tree; Node : in Valid_Node_Index) with Pre => Tree.Flushed and Tree.Parents_Set and (not Tree.Traversing) and Tree.Parent (Node) /= Invalid_Node_Index; -- Set child in Node.Parent to Deleted_Child. If Node.Parent = -- Tree.Root, set Tree.Root to Node. Set Node.Parent to -- Invalid_Node_Index. procedure Set_Node_Identifier (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index; ID : in Token_ID; Identifier : in Identifier_Index) with Pre => Tree.Flushed and Tree.Parents_Set and (not Tree.Traversing) and Tree.Is_Nonterm (Node); -- Set parents of current Node.Children to Invalid_Node_Index. -- Then change Node to a Virtual_Identifier. procedure Set_State (Tree : in out Syntax_Trees.Tree; Node : in Valid_Node_Index; State : in State_Index); function State (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Unknown_State_Index; function Label (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Node_Label; function Child_Count (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Ada.Containers.Count_Type with Pre => Tree.Is_Nonterm (Node); function Children (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Valid_Node_Index_Array with Pre => Tree.Is_Nonterm (Node); -- Any children that were cleared by Add_Nonterm are returned as -- Deleted_Child. function Child (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index; Child_Index : in Positive_Index_Type) return Node_Index with Pre => Tree.Is_Nonterm (Node); function Has_Branched_Nodes (Tree : in Syntax_Trees.Tree) return Boolean; function Has_Children (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Boolean with Pre => Tree.Is_Nonterm (Node); function Has_Child (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index; Child : in Valid_Node_Index) return Boolean with Pre => Tree.Is_Nonterm (Node); function Has_Parent (Tree : in Syntax_Trees.Tree; Child : in Valid_Node_Index) return Boolean; function Has_Parent (Tree : in Syntax_Trees.Tree; Children : in Valid_Node_Index_Array) return Boolean; function Buffer_Region_Is_Empty (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Boolean; -- True if contained buffer region is empty; always the case for -- virtual tokens, and for most copied tokens. Use Has_Children or -- Child_Count to see if Node has children. function Is_Nonterm (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Boolean; function Is_Shared_Terminal (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Boolean; function Is_Virtual_Terminal (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Boolean; function Is_Virtual (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Boolean; -- Virtual_Terminal, Virtual_Identifier, or Nonterm that contains some Virtual tokens. function Is_Virtual_Identifier (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Boolean; function Traversing (Tree : in Syntax_Trees.Tree) return Boolean; function Parents_Set (Tree : in Syntax_Trees.Tree) return Boolean; procedure Set_Parents (Tree : in out Syntax_Trees.Tree) with Pre => Tree.Flushed and Tree.Root /= Invalid_Node_Index; function Parent (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index; Count : in Positive := 1) return Node_Index with Pre => Tree.Parents_Set; -- Return Count parent of Node. procedure Set_Name_Region (Tree : in out Syntax_Trees.Tree; Node : in Valid_Node_Index; Region : in Buffer_Region) with Pre => Tree.Is_Nonterm (Node); function ID (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return WisiToken.Token_ID; function Production_ID (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return WisiToken.Production_ID with Pre => Tree.Is_Nonterm (Node); function Byte_Region (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return WisiToken.Buffer_Region; function RHS_Index (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Natural with Pre => Tree.Is_Nonterm (Node); function Same_Token (Tree_1 : in Syntax_Trees.Tree'Class; Index_1 : in Valid_Node_Index; Tree_2 : in Syntax_Trees.Tree'Class; Index_2 : in Valid_Node_Index) return Boolean; -- True if the two tokens have the same ID and Byte_Region. function Recover_Token (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return WisiToken.Recover_Token; function Recover_Token_Array (Tree : in Syntax_Trees.Tree; Nodes : in Valid_Node_Index_Array) return WisiToken.Recover_Token_Array; procedure Set_Augmented (Tree : in out Syntax_Trees.Tree; Node : in Valid_Node_Index; Value : in Base_Token_Class_Access); -- Value will be deallocated when Tree is finalized. function Augmented (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Base_Token_Class_Access; -- Returns result of Set_Augmented. function Augmented_Const (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Base_Token_Class_Access_Constant; function Action (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Semantic_Action with Pre => Tree.Is_Nonterm (Node); function Find_Ancestor (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index; ID : in Token_ID; Max_Parent : in Boolean := False) return Node_Index with Pre => Tree.Parents_Set; function Find_Ancestor (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index; IDs : in Token_ID_Array; Max_Parent : in Boolean := False) return Node_Index with Pre => Tree.Parents_Set; -- Return the ancestor of Node that contains ID (starting search with -- Node.Parent), or Invalid_Node_Index if none match. -- -- If Max_Parent, return max parent found if none match; this will be -- Invalid_Node_Index if Node has no parent. function Find_Sibling (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index; ID : in Token_ID) return Node_Index with Pre => Tree.Parents_Set and then Tree.Has_Parent (Node); -- Return the sibling of Node that contains ID, or Invalid_Node_Index if -- none match. function Find_Child (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index; ID : in Token_ID) return Node_Index with Pre => Tree.Is_Nonterm (Node); -- Return the child of Node whose ID is ID, or Invalid_Node_Index if -- none match. function Find_Descendant (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index; ID : in Token_ID) return Node_Index; -- Return the descendant of Node (may be Node) whose ID is ID, or -- Invalid_Node_Index if none match. function Find_Descendant (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index; Predicate : access function (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Boolean) return Node_Index; -- Return the descendant of Node (may be Node) for which Predicate -- returns True, or Invalid_Node_Index if none do. function Is_Descendant_Of (Tree : in Syntax_Trees.Tree; Root : in Valid_Node_Index; Descendant : in Valid_Node_Index) return Boolean with Pre => Tree.Parents_Set and Tree.Is_Nonterm (Root); procedure Set_Root (Tree : in out Syntax_Trees.Tree; Root : in Valid_Node_Index); function Root (Tree : in Syntax_Trees.Tree) return Node_Index; -- Return value set by Set_Root. -- returns Invalid_Node_Index if Tree is empty. function Sub_Tree_Root (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Valid_Node_Index with Pre => Tree.Parents_Set; -- Return top ancestor of Node. procedure Process_Tree (Tree : in out Syntax_Trees.Tree; Process_Node : access procedure (Tree : in out Syntax_Trees.Tree; Node : in Valid_Node_Index); Root : in Node_Index := Invalid_Node_Index) with Pre => Root /= Invalid_Node_Index or Tree.Root /= Invalid_Node_Index; -- Traverse subtree of Tree rooted at Root (default Tree.Root) in -- depth-first order, calling Process_Node on each node. function Identifier (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Base_Identifier_Index with Pre => Tree.Is_Virtual_Identifier (Node); function Terminal (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Base_Token_Index with Pre => Tree.Is_Shared_Terminal (Node); function First_Shared_Terminal (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Base_Token_Index; -- Returns first shared terminal in subtree under Node -- (ignoring virtual terminals). If result is Invalid_Token_Index, -- all terminals are virtual, or a nonterm is empty. function Last_Shared_Terminal (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Base_Token_Index; -- Returns last shared terminal in subtree under Node (ignoring -- virtual terminals). If result is Invalid_Token_Index, all -- terminals are virtual, or a nonterm is empty. function Get_Terminals (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Valid_Node_Index_Array; -- Return sequence of terminals in Node. -- -- "Terminals" can be Shared_Terminal, Virtual_Terminal, -- Virtual_Identifier. function First_Terminal (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Node_Index; -- First of Get_Terminals. Invalid_Node_Index if Node is an empty nonterminal. function Last_Terminal (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Node_Index; -- Last of Get_Terminals. Invalid_Node_Index if Node is an empty nonterminal. function Prev_Terminal (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Node_Index with Pre => Tree.Parents_Set and Tree.Label (Node) in Shared_Terminal | Virtual_Terminal | Virtual_Identifier; -- Return the terminal that is immediately before Node in Tree; -- Invalid_Node_Index if Node is the first terminal in Tree. function Next_Terminal (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Node_Index with Pre => Tree.Parents_Set and Tree.Label (Node) in Shared_Terminal | Virtual_Terminal | Virtual_Identifier; -- Return the terminal that is immediately after Node in Tree; -- Invalid_Node_Index if Node is the last terminal in Tree. function Get_Terminal_IDs (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Token_ID_Array; -- Same as Get_Terminals, but return the IDs. function First_Terminal_ID (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Token_ID; -- First of Get_Terminal_IDs; Invalid_Token_ID if Node is empty. function Get_IDs (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index; ID : in Token_ID) return Valid_Node_Index_Array; -- Return all descendants of Node matching ID. function Image (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index; Descriptor : in WisiToken.Descriptor; Include_Children : in Boolean := False; Include_RHS_Index : in Boolean := False; Node_Numbers : in Boolean := False) return String; function Image (Tree : in Syntax_Trees.Tree; Nodes : in Valid_Node_Index_Array; Descriptor : in WisiToken.Descriptor) return String; -- For debug and error messages. function First_Index (Tree : in Syntax_Trees.Tree) return Node_Index; function Last_Index (Tree : in Syntax_Trees.Tree) return Node_Index; package Node_Sets is new SAL.Gen_Unbounded_Definite_Vectors (Valid_Node_Index, Boolean, Default_Element => False); function Image (Item : in Node_Sets.Vector; Inverted : in Boolean := False) return String; -- Simple list of numbers, for debugging function Error_Message (Tree : in Syntax_Trees.Tree; Terminals : in Base_Token_Array_Access_Constant; Node : in Valid_Node_Index; File_Name : in String; Message : in String) return String; -- Get Line, column from Node. type Validate_Node is access procedure (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index; Node_Image_Output : in out Boolean); -- Called by Validate_Tree for each node visited; perform other -- checks, output to Text_IO.Current_Error. If Node_Image_Output is -- False, output Image (Tree, Node, Descriptor, Node_Numbers => True) once -- before any error messages. procedure Validate_Tree (Tree : in out Syntax_Trees.Tree; Terminals : in Base_Token_Array_Access_Constant; Descriptor : in WisiToken.Descriptor; File_Name : in String; Root : in Node_Index := Invalid_Node_Index; Validate_Node : in Syntax_Trees.Validate_Node := null) with Pre => Tree.Flushed and Tree.Parents_Set; -- Verify child/parent links, and that no children are Deleted_Child. -- Violations output a message to Text_IO.Current_Error. type Image_Augmented is access function (Aug : in Base_Token_Class_Access) return String; type Image_Action is access function (Action : in Semantic_Action) return String; procedure Print_Tree (Tree : in Syntax_Trees.Tree; Descriptor : in WisiToken.Descriptor; Root : in Node_Index := Invalid_Node_Index; Image_Augmented : in Syntax_Trees.Image_Augmented := null; Image_Action : in Syntax_Trees.Image_Action := null) with Pre => Tree.Flushed; -- Print tree rooted at Root (default Tree.Root) to -- Text_IO.Current_Output, for debugging. For each node, -- Image_Augmented is called if it is not null and node.augmented is -- not null. private use all type Ada.Containers.Count_Type; type Node (Label : Node_Label := Virtual_Terminal) is -- Label has a default to allow changing the label during tree editing. record ID : WisiToken.Token_ID := Invalid_Token_ID; Byte_Region : Buffer_Region := Null_Buffer_Region; -- Computed by Set_Children, used in Semantic_Check actions and debug -- messages. Parent : Node_Index := Invalid_Node_Index; State : Unknown_State_Index := Unknown_State; -- Parse state that was on stack with this token, to allow undoing a -- reduce. Augmented : Base_Token_Class_Access := null; case Label is when Shared_Terminal => Terminal : Token_Index; -- into Parser.Terminals when Virtual_Terminal => Before : Base_Token_Index := Invalid_Token_Index; -- into Parser.Terminals when Virtual_Identifier => Identifier : Identifier_Index; -- into user data when Nonterm => Virtual : Boolean := False; -- True if any child node is Virtual_Terminal or Nonterm with Virtual -- set. Used by Semantic_Check actions. RHS_Index : Natural; -- With ID, index into Productions. -- Used for debug output, keep for future use. Action : Semantic_Action := null; Name : Buffer_Region := Null_Buffer_Region; -- Name is set and checked by Semantic_Check actions. Children : Valid_Node_Index_Arrays.Vector; Min_Terminal_Index : Base_Token_Index := Invalid_Token_Index; -- Cached for push_back of nonterminals during recovery end case; end record; subtype Nonterm_Node is Node (Nonterm); package Node_Arrays is new SAL.Gen_Unbounded_Definite_Vectors (Valid_Node_Index, Node, Default_Element => (others => <>)); type Base_Tree is new Ada.Finalization.Controlled with record Nodes : Node_Arrays.Vector; -- During normal parsing, tokens are added to Nodes by "parallel" -- LALR parsers, but they are all run from one Ada task, so there's -- no need for Nodes to be Protected. Packrat parsing also has a -- single Ada task. -- -- During McKenzie_Recover, which has multiple Ada tasks, the syntax -- tree is read but not modified. Augmented_Present : Boolean := False; -- True if Set_Augmented has been called on any node. Declared in -- Base_Tree so it can be checked by Finalize (Base_Tree) and -- Finalize (Tree). Traversing : Boolean := False; -- True while traversing tree in Process_Tree. -- Declared in Base_Tree so it is cleared by Finalize. Parents_Set : Boolean := False; -- We don't set Node.Parent until after parse is done; see Design -- note above. end record; function Is_Empty (Tree : in Base_Tree) return Boolean is (Tree.Nodes.Length = 0); type Tree is new Ada.Finalization.Controlled with record Shared_Tree : Base_Tree_Access; -- If we need to set anything (ie parent) in Shared_Tree, we move the -- branch point instead, unless Flush = True. Last_Shared_Node : Node_Index := Invalid_Node_Index; Branched_Nodes : Node_Arrays.Vector; Flush : Boolean := False; -- If Flush is True, all nodes are in Shared_Tree. Otherwise, all -- greater than Last_Shared_Node are in Branched_Nodes. -- -- We maintain Last_Shared_Node when Flush is True or False, so -- subprograms that have no reason to check Flush can rely on -- Last_Shared_Node. Root : Node_Index := Invalid_Node_Index; end record with Type_Invariant => (Shared_Tree = null or else (if Tree.Flush then Last_Shared_Node = Shared_Tree.Nodes.Last_Index and Branched_Nodes.Length = 0 else Last_Shared_Node <= Shared_Tree.Nodes.Last_Index and Last_Shared_Node < Branched_Nodes.First_Index)); subtype Node_Const_Ref is Node_Arrays.Constant_Reference_Type; subtype Node_Var_Ref is Node_Arrays.Variable_Reference_Type; function Get_Node_Const_Ref (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Node_Const_Ref is (if Node <= Tree.Last_Shared_Node then Tree.Shared_Tree.Nodes.Constant_Ref (Node) else Tree.Branched_Nodes.Constant_Ref (Node)); function Get_Node_Var_Ref (Tree : in Syntax_Trees.Tree; Node : in Valid_Node_Index) return Node_Var_Ref is (if Node <= Tree.Last_Shared_Node then Tree.Shared_Tree.Nodes.Variable_Ref (Node) else Tree.Branched_Nodes.Variable_Ref (Node)); function Is_Empty (Tree : in Syntax_Trees.Tree) return Boolean is (Tree.Branched_Nodes.Length = 0 and (Tree.Shared_Tree = null or else Tree.Shared_Tree.Is_Empty)); function Parents_Set (Tree : in Syntax_Trees.Tree) return Boolean is (Tree.Shared_Tree.Parents_Set); end WisiToken.Syntax_Trees;
http.ads
zorodc/ada-http1
0
15520
<gh_stars>0 -- -- Nice little HTTP 1.x request parser. Uses a state machine. -- Operates by cutting up the incoming request string into sections. -- package HTTP with SPARK_Mode => On is type Version is delta 0.1 range 1.0 .. 9.9; type Indexes is record First : Natural := 1; Last : Natural := 0; end record; end HTTP;
Light/Implementation/Relation/Decidable.agda
zamfofex/lightlib
1
16309
<gh_stars>1-10 {-# OPTIONS --omega-in-omega --no-termination-check --overlapping-instances #-} {-# OPTIONS --allow-unsolved-metas #-} module Light.Implementation.Relation.Decidable where open import Light.Variable.Levels open import Light.Variable.Sets open import Light.Library.Relation.Decidable using (Library ; Dependencies) open import Light.Library.Data.Empty as Empty using (Empty) open import Light.Library.Data.Unit as Unit using (Unit ; unit) open import Light.Library.Data.Both as Both using (Both) import Light.Library.Data.Product as Product open import Light.Library.Data.These as These using (These) import Light.Implementation.Data.Empty import Light.Implementation.Data.Unit import Light.Implementation.Data.Product import Light.Implementation.Data.These import Light.Package instance dependencies : Dependencies dependencies = record {} instance library : Library dependencies library = record { Implementation ; to‐witness = λ ⦃ a ⦄ → Implementation.to‐witness a ; to‐false‐witness = λ ⦃ a ⦄ → Implementation.to‐false‐witness a ; from‐witness = λ ⦃ a ⦄ → Implementation.from‐witness a ; from‐false‐witness = λ ⦃ a ⦄ → Implementation.from‐false‐witness a } where module Implementation where open import Light.Implementation.Relation.Sets using (base) public data Decidable (𝕒 : Set ℓ) : Set ℓ where yes : 𝕒 → Decidable 𝕒 no : (𝕒 → Empty) → Decidable 𝕒 module Style where true : Decidable Unit true = yes unit false : Decidable Empty false = no λ a → a ¬_ : Decidable 𝕒 → Decidable (𝕒 → Empty) ¬ yes a = no λ f → f a ¬ no a = yes a _∧_ : ∀ {𝕒 : Set aℓ} {𝕓 : Set bℓ} (a? : Decidable 𝕒) (b? : Decidable 𝕓) → Decidable (Both 𝕒 𝕓) yes a ∧ yes b = yes (Both.both a b) no f ∧ _ = no λ both → f (Both.first both) _ ∧ no f = no λ both → f (Both.second both) _∨_ : ∀ {𝕒 : Set aℓ} {𝕓 : Set bℓ} (a? : Decidable 𝕒) (b? : Decidable 𝕓) → Decidable (These 𝕒 𝕓) no af ∨ no bf = no {!!} yes a ∨ yes b = yes (These.these a b) yes a ∨ no _ = yes (These.this a) no _ ∨ yes b = yes (These.that b) _⇢_ : ∀ {𝕒 : Set aℓ} {𝕓 : Set bℓ} (a? : Decidable 𝕒) (b? : Decidable 𝕓) → Decidable (𝕒 → 𝕓) _ ⇢ yes b = yes λ _ → b no af ⇢ _ = yes λ a → Empty.eliminate (af a) yes a ⇢ no bf = no λ f → bf (f a) True False : Decidable 𝕒 → Set True (yes _) = Unit True (no _) = Empty False a? = True (¬ a?) style = record { Style } if′_then_else_ : Decidable 𝕒 → 𝕓 → 𝕓 → 𝕓 if′ yes _ then a else _ = a if′ no _ then _ else a = a if_then_else_ : ∀ (a : Decidable 𝕒) → (∀ ⦃ witness : 𝕒 ⦄ → 𝕓) → (∀ ⦃ witness : 𝕒 → Empty ⦄ → 𝕓) → 𝕓 if yes w then a else _ = a ⦃ witness = w ⦄ if no w then _ else a = a ⦃ witness = w ⦄ to‐witness : ∀ {a? : Decidable 𝕒} → Style.True a? → 𝕒 to‐false‐witness : ∀ {a? : Decidable 𝕒} → Style.False a? → 𝕒 → Empty from‐witness : ∀ {a? : Decidable 𝕒} → 𝕒 → Style.True a? from‐false‐witness : ∀ {a? : Decidable 𝕒} → (𝕒 → Empty) → Style.False a? to‐witness {a? = yes a} _ = a to‐false‐witness {a? = no f} _ = f from‐witness {a? = yes a} _ = _ from‐witness {a? = no f} w = f w from‐false‐witness {a? = no f} _ = _ from‐false‐witness {a? = yes a} w = w a
src/bindings/adabase-bindings.ads
jrmarino/AdaBase
30
2254
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../../License.txt package AdaBase.Bindings is pragma Pure; end AdaBase.Bindings;
libsrc/_DEVELOPMENT/math/float/math48/c/sccz80/cm48_sccz80p_dparam2.asm
meesokim/z88dk
0
167316
<reponame>meesokim/z88dk SECTION code_fp_math48 PUBLIC cm48_sccz80p_dparam2 EXTERN am48_dloadb cm48_sccz80p_dparam2: ; read two math48 doubles from the stack ; ; enter : stack = double x, doubly y, ret1, ret0 ; ; exit : AC'= y ; AC = x ld hl,15 add hl,sp call am48_dloadb ld hl,9 add hl,sp jp am48_dloadb
oeis/015/A015211.asm
neoneye/loda-programs
11
10250
; A015211: Sum of Gaussian binomial coefficients for q=20. ; Submitted by <NAME> ; 1,2,23,844,185665,135410486,594398635307,8667459765860128,760847587518093084949,221888491692526853220309770,389554408585486196960076347534591,2272138934040070259456673438099474759412,79780747422585051663155569402234152922601984233,9306681233389620355765703688696327962346419745729209054,6535638847471529819244197534377377521656641070826046568856433875,15248066545856831676522907328658838446497425466019690293379273391983658696 mov $1,$0 mov $0,0 add $1,1 mov $2,1 lpb $1 sub $1,1 mov $4,$2 mul $2,10 mul $4,$3 add $0,$4 sub $3,$4 add $3,$0 add $3,$2 mul $2,2 lpe mov $0,$3 div $0,200 add $0,1
tests/covered/CH.agda
andrejtokarcik/agda-semantics
3
13917
<reponame>andrejtokarcik/agda-semantics module CH where data ℕ : Set where zero : ℕ succ : ℕ → ℕ infixl 6 _+_ _+_ : ℕ → ℕ → ℕ zero + m = m (succ n) + m = succ (n + m) infix 4 _≡_ data _≡_ {A : Set} (x : A) : A → Set where refl : x ≡ x {- t1 : {n : ℕ} -> zero ≡ n t1 = refl -} data _==_ {A : Set} : A → A → Set where refl' : (a : A) → a == a sym : ∀ x y → x == y → y == x sym .a .a (refl' a) = refl' a
src/research/interrupt_vector_table.asm
MijnOS/MijnOS
0
100678
BITS 16 ;=========== ; Start of the bootloader ;=========== start: mov ax,07C0h ; Set up 4K stack space after this bootloader add ax,288 ; (4096 + 512) / 16 bytes per paragraph mov ss,ax mov sp,4096 mov ax,07C0h ; Set data segment to where we're loaded mov ds,ax ; mov ah,00h ; set video mode to graphics ; mov al,10h ; int 10h call print_ivt mov si,text_string ; Put string position into SI call print_string ; Call our string-printing routine jmp $ ; Jump here - infinite loop! text_string db 0Dh, 0Ah, 'This is my cool new OS!', 0Dh, 0Ah, 0 ;=========== ; Prints a string onto the screen ;=========== print_string: ; Routine: output string in SI to screen mov ah,0Eh ; int 10h 'print char' function .repeat: lodsb ; Get character from string cmp al,0 je .done ; If char is zero, end of string int 10h ; Otherwise, print it jmp .repeat .done: ret ;=========== ; Display the contents of the Interrupt Vector Table ;=========== print_ivt: push ax push bx push cx push dx push es mov ax,0000h mov es,ax ; IVT table segment mov bx,ax ; IVT index offset .pi_loop: mov cx,[es:bx] ; IVT[i].segment mov dx,[es:bx+2] ; IVT[i].offset mov ax,cx ; print the segment shr ax,8 push ax call print_hex mov ax,cx and ax,0FFh push ax call print_hex add sp,4 mov ax,dx ; print the offset shr ax,8 push ax call print_hex mov ax,cx and ax,0FFh push ax call print_hex add sp,4 ;push ax ; increment the counter ;mov ax,bx ;shr ax,2 ; Goes on a base of 4 ;and ax,7 ;cmp ax,0 ;pop ax ;jne .pi_print ;mov si,newline ; seperate the lines in the table ;call print_string .pi_print: add bx,4 cmp bx,0400h ; 4 * 256 / 4 * 16 == 4 * 16*16 jl .pi_loop .pi_done: pop es pop dx pop cx pop bx pop ax ret newline db 0Dh, 0Ah, 0 ;=========== ; Print HEX character ; void print_hex(byte); ;=========== print_hex: push ax push bx push dx mov bx,sp mov dx,[ss:bx+8] .ph_high: ; Display high-byte mov ax,dx and ax,0F0h shr ax,4 cmp ax,10 jl .ph_high_digit .ph_high_char: add ax,37h jmp .ph_high_done .ph_high_digit: add ax,30h .ph_high_done: mov ah,0Eh int 10h .ph_low: ; Display low-byte mov ax,dx and ax,0Fh cmp ax,10 jl .ph_low_digit .ph_low_char: add ax,37h jmp .ph_low_done .ph_low_digit: add ax,30h .ph_low_done: mov ah,0Eh int 10h .ph_done: pop dx pop bx pop ax ret times 510-($-$$) db 0 ; Pad remainder of boot sector with 0s dw 0xAA55 ; The standard PC boot signature
tests/src/shared/gl_test-display_backend.adb
Cre8or/OpenGLAda
79
1172
-- part of OpenGLAda, (c) 2017 <NAME> -- released under the terms of the MIT license, see the file "COPYING" with Ada.Text_IO; with Glfw.Windows.Context; with Glfw.Windows.Hints; with Glfw.Input.Keys; with Glfw.Errors; package body GL_Test.Display_Backend is type Test_Window is new Glfw.Windows.Window with null record; overriding procedure Close_Requested (Object : not null access Test_Window) is begin Object.Destroy; end Close_Requested; type Main_Window_Type is not null access Test_Window; Main_Window : constant Main_Window_Type := new Test_Window; procedure Print_Error (Code : Glfw.Errors.Kind; Description : String) is begin Ada.Text_IO.Put_Line ("Error occured (" & Code'Img & "): " & Description); end Print_Error; procedure Enable_Print_Errors is begin Glfw.Errors.Set_Callback (Print_Error'Access); end Enable_Print_Errors; procedure Init (Debugging : Boolean := False) is begin Enable_Print_Errors; Glfw.Init; if Debugging then Glfw.Windows.Hints.Set_Debug_Context (True); end if; end Init; procedure Open_Window (Width, Height : Natural; Depth_Bits : Natural := 0) is begin if not Main_Window.Initialized then Glfw.Windows.Hints.Set_Depth_Bits (Depth_Bits); Main_Window.Init (Glfw.Size (Width), Glfw.Size (Height), "Test Window"); end if; Main_Window.Show; Main_Window.Enable_Callback (Glfw.Windows.Callbacks.Close); Glfw.Windows.Context.Make_Current (Main_Window); end Open_Window; procedure Swap_Buffers is begin Glfw.Windows.Context.Swap_Buffers (Main_Window); end Swap_Buffers; procedure Poll_Events is begin Glfw.Input.Poll_Events; end Poll_Events; procedure Wait_For_Events is begin Glfw.Input.Wait_For_Events; end Wait_For_Events; procedure Set_Window_Title (Value : String) is begin Main_Window.Set_Title (Value); end Set_Window_Title; function Escape_Pressed return Boolean is use type Glfw.Input.Button_State; begin return Main_Window.Initialized and then Main_Window.Key_State (Glfw.Input.Keys.Escape) = Glfw.Input.Pressed; end Escape_Pressed; function Window_Opened return Boolean is begin return Main_Window.Initialized and then Main_Window.Visible; end Window_Opened; procedure Close_Window is begin Main_Window.Destroy; end Close_Window; procedure Shutdown renames Glfw.Shutdown; procedure Configure_Minimum_OpenGL_Version (Major, Minor : Natural) is begin Glfw.Windows.Hints.Set_Minimum_OpenGL_Version (Major, Minor); -- needed for OSX if Major >= 3 then Glfw.Windows.Hints.Set_Forward_Compat (True); Glfw.Windows.Hints.Set_Profile (Glfw.Windows.Context.Core_Profile); end if; end Configure_Minimum_OpenGL_Version; end GL_Test.Display_Backend;
3-mid/opengl/source/lean/geometry/opengl-geometry-lit_colored.adb
charlie5/lace-alire
1
28672
with openGL.Program.lit, openGL.Buffer.general, openGL.Shader, openGL.Attribute, openGL.Tasks, openGL.Errors, GL.lean, GL.Pointers, Interfaces.C.Strings, System.storage_Elements; package body openGL.Geometry.lit_colored is use GL.lean, GL.Pointers, Interfaces, System; ------------------ -- Shader Program -- type Program is record vertex_Shader : aliased Shader.item; fragment_Shader : aliased Shader.item; Program : openGL.Program.lit.view; end record; ----------- --- Globals -- the_Program : aliased Program; Name_1 : constant String := "Site"; Name_2 : constant String := "Normal"; Name_3 : constant String := "Color"; Name_4 : constant String := "Shine"; Attribute_1_Name : aliased C.char_array := C.to_C (Name_1); Attribute_2_Name : aliased C.char_array := C.to_C (Name_2); Attribute_3_Name : aliased C.char_array := C.to_C (Name_3); Attribute_4_Name : aliased C.char_array := C.to_C (Name_4); Attribute_1_Name_ptr : aliased constant C.strings.chars_ptr := C.strings.to_chars_ptr (Attribute_1_Name'Access); Attribute_2_Name_ptr : aliased constant C.strings.chars_ptr := C.strings.to_chars_ptr (Attribute_2_Name'Access); Attribute_3_Name_ptr : aliased constant C.strings.chars_ptr := C.strings.to_chars_ptr (Attribute_3_Name'Access); Attribute_4_Name_ptr : aliased constant C.strings.chars_ptr := C.strings.to_chars_ptr (Attribute_4_Name'Access); --------- -- Forge -- function new_Geometry return View is use System.storage_Elements; use type openGL.Program.lit.view; procedure define (the_Program : access Program) is use Attribute.Forge; Sample : Vertex; Attribute_1, Attribute_2, Attribute_3, Attribute_4 : Attribute.view; begin the_Program.Program := new openGL.Program.lit.item; the_Program. vertex_Shader.define (Shader.Vertex, "assets/opengl/shader/lit_colored.vert"); the_Program.fragment_Shader.define (Shader.Fragment, "assets/opengl/shader/lit_colored.frag"); the_Program.Program.define (the_Program. vertex_Shader'Access, the_Program.fragment_Shader'Access); Attribute_1 := new_Attribute (Name => Name_1, gl_Location => the_Program.Program.attribute_Location (Name_1), Size => 3, data_Kind => attribute.GL_FLOAT, Stride => lit_colored.Vertex'Size / 8, Offset => 0, Normalized => False); Attribute_2 := new_Attribute (Name => Name_2, gl_Location => the_Program.Program.attribute_Location (Name_2), Size => 3, data_Kind => attribute.GL_FLOAT, Stride => lit_colored.Vertex'Size / 8, Offset => Sample.Normal (1)'Address - Sample.Site (1)'Address, Normalized => False); Attribute_3 := new_Attribute (Name => Name_3, gl_Location => the_Program.Program.attribute_Location (Name_3), Size => 4, data_Kind => attribute.GL_UNSIGNED_BYTE, Stride => lit_colored.Vertex'Size / 8, Offset => Sample.Color.Primary.Red'Address - Sample.Site (1) 'Address, Normalized => True); Attribute_4 := new_Attribute (Name => Name_4, gl_Location => the_Program.Program.attribute_Location (Name_4), Size => 1, data_Kind => attribute.GL_FLOAT, Stride => lit_colored.Vertex'Size / 8, Offset => Sample.Shine 'Address - Sample.Site (1) 'Address, Normalized => True); the_Program.Program.add (Attribute_1); the_Program.Program.add (Attribute_2); the_Program.Program.add (Attribute_3); the_Program.Program.add (Attribute_4); glBindAttribLocation (program => the_Program.Program.gl_Program, index => the_Program.Program.Attribute (named => Name_1).gl_Location, name => +Attribute_1_Name_ptr); Errors.log; glBindAttribLocation (program => the_Program.Program.gl_Program, index => the_Program.Program.Attribute (named => Name_2).gl_Location, name => +Attribute_2_Name_ptr); Errors.log; glBindAttribLocation (program => the_Program.Program.gl_Program, index => the_Program.Program.Attribute (named => Name_3).gl_Location, name => +Attribute_3_Name_ptr); Errors.log; glBindAttribLocation (program => the_Program.Program.gl_Program, index => the_Program.Program.Attribute (named => Name_4).gl_Location, name => +Attribute_4_Name_ptr); Errors.log; end define; Self : constant View := new Geometry.lit_colored.item; begin Tasks.check; if the_Program.Program = null -- Define the shaders and program, if required. then define (the_Program'Access); end if; Self.Program_is (openGL.Program.view (the_Program.Program)); return Self; end new_Geometry; ---------- -- Vertex -- function is_Transparent (Self : in Vertex_array) return Boolean is function get_Color (Index : in Index_t) return rgba_Color is (Self (Index).Color); function my_Transparency is new get_Transparency (any_Index_t => Index_t, get_Color => get_Color); begin return my_Transparency (Count => Self'Length); end is_Transparent; -------------- -- Attributes -- package openGL_Buffer_of_geometry_Vertices is new Buffer.general (base_Object => Buffer.array_Object, Index => Index_t, Element => Vertex, Element_Array => Vertex_array); procedure Vertices_are (Self : in out Item; Now : in Vertex_array) is use openGL_Buffer_of_geometry_Vertices.Forge; begin Buffer.free (Self.Vertices); Self.is_Transparent := False; self.Vertices := new openGL_Buffer_of_geometry_Vertices.Object' (to_Buffer (Now, usage => Buffer.static_Draw)); Self.is_Transparent := is_Transparent (Now); -- Set the bounds. -- declare function get_Site (Index : in Index_t) return Vector_3 is (Now (Index).Site); function bounding_Box is new get_Bounds (Index_t, get_Site); begin Self.Bounds_are (bounding_Box (count => Now'Length)); end; end Vertices_are; end openGL.Geometry.lit_colored;
firmware/glyphs/der_rouge.asm
ddomurad/avrVideoCard
0
177292
<gh_stars>0 .org 0x1800 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .org 0x1900 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x18, 0x36, 0x24, 0x8, 0x0, 0x3c, 0x18 .db 0xc, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x3c, 0x18 .db 0x3c, 0x3c, 0xe, 0x3e, 0x1e, 0x7e, 0x3c, 0x3c, 0x0, 0x0 .db 0x6, 0x0, 0x60, 0x3c, 0x3c, 0x18, 0x7e, 0x3c, 0x7c, 0x7f .db 0x7f, 0x3e, 0xe7, 0x3c, 0x3f, 0x73, 0x70, 0x63, 0x67, 0x3c .db 0x7e, 0x3c, 0xfc, 0x1e, 0x3f, 0xe7, 0xe7, 0xe7, 0xc3, 0xe7 .db 0x7e, 0x1c, 0x40, 0x38, 0x18, 0x0, 0x10, 0x0, 0x60, 0x0 .db 0x6, 0x0, 0xe, 0x0, 0xe0, 0x18, 0x18, 0x70, 0x38, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0xc, 0x18, 0x30, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .org 0x1a00 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x18, 0x36, 0x7e, 0x3e, 0x64, 0x66, 0x18 .db 0x18, 0x18, 0x24, 0x18, 0x0, 0x0, 0x0, 0x6, 0x66, 0x38 .db 0x66, 0x66, 0x1e, 0x32, 0x30, 0x6, 0x66, 0x66, 0x18, 0x18 .db 0xc, 0x0, 0x30, 0x66, 0x66, 0x3c, 0x33, 0x76, 0x36, 0x31 .db 0x31, 0x73, 0x66, 0x18, 0xc, 0x36, 0x30, 0x77, 0x76, 0x66 .db 0x33, 0x66, 0x66, 0x32, 0x2d, 0x66, 0x66, 0x66, 0x66, 0x66 .db 0x46, 0x18, 0x60, 0x18, 0x3c, 0x0, 0x8, 0x0, 0x60, 0x0 .db 0x6, 0x0, 0x18, 0x0, 0x60, 0x0, 0x0, 0x30, 0x18, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x18, 0x18, 0x18, 0x32, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .org 0x1b00 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x18, 0x12, 0x24, 0x68, 0x48, 0x3c, 0x8 .db 0x30, 0xc, 0x18, 0x18, 0x0, 0x0, 0x0, 0xc, 0x66, 0x18 .db 0xc, 0x6, 0x36, 0x30, 0x7c, 0x6, 0x66, 0x66, 0x18, 0x18 .db 0x18, 0x3c, 0x18, 0x6, 0x66, 0x66, 0x33, 0x60, 0x33, 0x30 .db 0x30, 0x60, 0x66, 0x18, 0xc, 0x3c, 0x30, 0x7f, 0x76, 0x66 .db 0x33, 0x66, 0x66, 0x30, 0xc, 0x66, 0x66, 0x42, 0x3c, 0x66 .db 0xc, 0x18, 0x30, 0x18, 0x66, 0x0, 0x0, 0x3c, 0x7c, 0x3c .db 0x3e, 0x3c, 0x18, 0x7e, 0x7c, 0x38, 0x38, 0x33, 0x18, 0x54 .db 0x5c, 0x3c, 0x7e, 0x3e, 0x36, 0x3e, 0x78, 0x77, 0x66, 0x63 .db 0x36, 0x66, 0x7c, 0x10, 0x18, 0x8, 0x7e, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .org 0x1c00 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x18, 0x0, 0x24, 0x3e, 0x10, 0x19, 0x0 .db 0x30, 0xc, 0x7e, 0x7e, 0x0, 0x7e, 0x0, 0x18, 0x6e, 0x18 .db 0x18, 0xc, 0x66, 0x3c, 0x66, 0xc, 0x3c, 0x3e, 0x0, 0x0 .db 0x30, 0x0, 0xc, 0x1c, 0x6e, 0x7e, 0x3e, 0x60, 0x33, 0x3c .db 0x3c, 0x60, 0x7e, 0x18, 0xc, 0x38, 0x30, 0x6b, 0x7e, 0x66 .db 0x3e, 0x66, 0x7c, 0x1c, 0xc, 0x66, 0x24, 0x5a, 0x18, 0x3e .db 0x18, 0x18, 0x18, 0x18, 0x0, 0x0, 0x0, 0x6, 0x66, 0x66 .db 0x66, 0x66, 0x7e, 0xcc, 0x66, 0x18, 0x18, 0x36, 0x18, 0x6a .db 0x66, 0x66, 0x33, 0x66, 0x3b, 0x60, 0x30, 0x36, 0x66, 0x6b .db 0x1c, 0x66, 0x4c, 0x30, 0x18, 0xc, 0x4c, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .org 0x1d00 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x18, 0x0, 0x7e, 0xb, 0x24, 0x3e, 0x0 .db 0x30, 0xc, 0x18, 0x18, 0x0, 0x0, 0x0, 0x30, 0x76, 0x18 .db 0x30, 0x6, 0x67, 0x6, 0x66, 0x18, 0x66, 0x6, 0x0, 0x0 .db 0x18, 0x3c, 0x18, 0x18, 0x6e, 0x66, 0x33, 0x60, 0x33, 0x30 .db 0x30, 0x67, 0x66, 0x18, 0xc, 0x3c, 0x30, 0x63, 0x6e, 0x66 .db 0x30, 0x66, 0x66, 0x6, 0xc, 0x66, 0x3c, 0x5a, 0x3c, 0xc .db 0x30, 0x18, 0xc, 0x18, 0x0, 0x0, 0x0, 0x3e, 0x66, 0x60 .db 0x66, 0x7e, 0x18, 0x7c, 0x66, 0x18, 0x18, 0x3c, 0x18, 0x6a .db 0x66, 0x66, 0x3e, 0x66, 0x30, 0x7e, 0x30, 0x36, 0x24, 0x6b .db 0x8, 0x3e, 0x18, 0x10, 0x18, 0x8, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .org 0x1e00 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x24, 0x3e, 0x4c, 0x66, 0x0 .db 0x18, 0x18, 0x24, 0x18, 0x10, 0x0, 0x18, 0x60, 0x66, 0x18 .db 0x62, 0x66, 0x7f, 0x6, 0x66, 0x18, 0x66, 0xc, 0x18, 0x18 .db 0xc, 0x0, 0x30, 0x0, 0x60, 0x66, 0x33, 0x76, 0x36, 0x31 .db 0x30, 0x73, 0x66, 0x18, 0xc, 0x36, 0x31, 0x63, 0x6e, 0x66 .db 0x30, 0x6e, 0x66, 0x26, 0xc, 0x7e, 0x18, 0x3c, 0x66, 0x18 .db 0x62, 0x18, 0x6, 0x18, 0x0, 0x0, 0x0, 0x66, 0x66, 0x66 .db 0x66, 0x60, 0x18, 0xc, 0x66, 0x18, 0x18, 0x36, 0x18, 0x6a .db 0x66, 0x66, 0x30, 0x3e, 0x30, 0x6, 0x30, 0x36, 0x3c, 0x6b .db 0x1c, 0x6, 0x32, 0x18, 0x18, 0x18, 0x0, 0x54, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .org 0x1f00 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x18, 0x0, 0x0, 0x8, 0x0, 0x3d, 0x0 .db 0xc, 0x30, 0x0, 0x0, 0x20, 0x0, 0x18, 0x0, 0x3c, 0x3c .db 0x7e, 0x3c, 0x6, 0x3c, 0x3c, 0x38, 0x3c, 0x38, 0x18, 0x8 .db 0x6, 0x0, 0x60, 0x18, 0x3c, 0xe7, 0x7e, 0x3c, 0x7c, 0x7f .db 0x78, 0x3f, 0xe7, 0x3c, 0x38, 0x73, 0x7f, 0x63, 0xe6, 0x3c .db 0x78, 0x3f, 0xe7, 0x3c, 0x1e, 0x3c, 0x18, 0x24, 0xc3, 0x70 .db 0x7e, 0x1c, 0x0, 0x38, 0x0, 0x7e, 0x0, 0x3e, 0x7c, 0x3c .db 0x3e, 0x3c, 0x3c, 0x78, 0xe7, 0x3c, 0x70, 0x73, 0x3c, 0xeb .db 0xe7, 0x3c, 0x78, 0x7, 0x78, 0x7c, 0x1c, 0x1c, 0x18, 0x36 .db 0x36, 0x3c, 0x7e, 0xc, 0x18, 0x30, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 .db 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
programs/oeis/063/A063960.asm
neoneye/loda
22
245947
<gh_stars>10-100 ; A063960: Sum of non-unitary prime divisors of n!: sum of those prime factors for which the exponent exceeds 1. ; 0,0,0,2,2,5,5,5,5,10,10,10,10,17,17,17,17,17,17,17,17,28,28,28,28,41,41,41,41,41,41,41,41,58,58,58,58,77,77,77,77,77,77,77,77,100,100,100,100,100,100,100,100,100,100,100,100,129,129,129,129,160,160,160,160,160,160,160,160,160,160,160,160,197,197,197,197,197,197,197,197,238,238,238,238,281,281,281,281,281,281,281,281,328,328,328,328,328,328,328 sub $0,1 div $0,2 seq $0,34387 ; Sum of primes <= n.
8088/xtce/gentests/runstub.asm
reenigne/reenigne
92
12192
org 0 cpu 8086 xor ax,ax mov ds,ax mov word[0x20],irq0a mov [0x22],cs mov word[0xff*4],interruptFF mov [0xff*4+2],cs mov word[0xfe*4],interruptFF mov [0xfe*4+2],cs mov word[3*4],int3handler mov [3*4+2],cs ; Enable auto-EOI mov al,0x13 ; ICW4 needed, not cascaded, call address interval 8, edge triggered out 0x20,al ; Set ICW1 mov al,0x08 ; Interrupt vector address out 0x21,al ; Set ICW2 mov al,0x0f ; 8086/8088 mode, auto-EOI, buffered mode/master, not special fully nested mode out 0x21,al ; Set ICW4 mov al,0xbc ; Enable IRQs 0 (timer), 1 (keyboard) and 6 (floppy disk). out 0x21,al ; Leave disabled 2 (EGA/VGA/slave 8259) 3 (COM2/COM4), 4 (COM1/COM3), 5 (hard drive, LPT2) and 7 (LPT1) ; Code executed on real hardware starts here jmp $+2 ; Set up and save some registers for test mov ax,cs mov ds,ax mov es,ax mov [savedSP],sp mov [savedSS],ss mov ax,cs add ax,0x1000 mov ss,ax mov word[testBuffer],0 mov [testBuffer+2],ax ; Set up programmable delay mov bl,dh mov bh,0 add bx,bx mov si,[delayTable + bx] mov di,patch+1 mov cx,10 patchLoop: movsb add di,3 loop patchLoop ; Set up some more registers mov ax,ss mov ds,ax mov es,ax xor bx,bx mov cx,bx mov si,bx mov di,bx mov bp,bx mov sp,bx ; Start refresh at requested rate mov al,(1 << 6) | 0x30 | (2 << 1) out 0x43,al jmp $+2 ; Reset queue for sniffer decoder mov al,dl out 0x41,al mov al,0 out 0x41,al ; Programmable delay 0-80 cycles (plus a constant) mov dl,1 patch: %rep 10 mov al,0 mul dl %endrep ; Set up very last registers and start test mov ax,bx mov dx,bx jmp far [cs:testBuffer] int3handler: add sp,4 popf retf irq0: iret irq0a: interruptFF: mov al,0x70 out 0x43,al mov al,0 out 0x41,al out 0x41,al times 4 nop ; Code executed on real hardware ends here savedSP: dw 0 savedSS: dw 0 testBuffer: dw 0, 0 delayData: %assign i 0 %rep 81 %assign k i %assign j 0 %rep 10 %if k <= 0 db 0 %elif k >= 8 db 0xff %else db 0xff >> (8-k) %endif %assign k k-8 %assign j j+1 %endrep %assign i i+1 %endrep delayTable: %assign i 0 %rep 81 dw delayData + i*10 %assign i i+1 %endrep
agda-stdlib-0.9/src/Data/Star/BoundedVec.agda
qwe2/try-agda
1
14421
<filename>agda-stdlib-0.9/src/Data/Star/BoundedVec.agda ------------------------------------------------------------------------ -- The Agda standard library -- -- Bounded vectors (inefficient implementation) ------------------------------------------------------------------------ -- Vectors of a specified maximum length. module Data.Star.BoundedVec where open import Data.Star open import Data.Star.Nat open import Data.Star.Decoration open import Data.Star.Pointer open import Data.Star.List using (List) open import Data.Unit open import Function import Data.Maybe as Maybe open import Relation.Binary open import Relation.Binary.Consequences ------------------------------------------------------------------------ -- The type -- Finite sets decorated with elements (note the use of suc). BoundedVec : Set → ℕ → Set BoundedVec a n = Any (λ _ → a) (λ _ → ⊤) (suc n) [] : ∀ {a n} → BoundedVec a n [] = this tt infixr 5 _∷_ _∷_ : ∀ {a n} → a → BoundedVec a n → BoundedVec a (suc n) _∷_ = that ------------------------------------------------------------------------ -- Increasing the bound -- Note that this operation is linear in the length of the list. ↑ : ∀ {a n} → BoundedVec a n → BoundedVec a (suc n) ↑ {a} = gmap inc lift where inc = Maybe.map (map-NonEmpty suc) lift : Pointer (λ _ → a) (λ _ → ⊤) =[ inc ]⇒ Pointer (λ _ → a) (λ _ → ⊤) lift (step x) = step x lift (done _) = done _ ------------------------------------------------------------------------ -- Conversions fromList : ∀ {a} → (xs : List a) → BoundedVec a (length xs) fromList ε = [] fromList (x ◅ xs) = x ∷ fromList xs toList : ∀ {a n} → BoundedVec a n → List a toList xs = gmap (const tt) decoration (init xs)
wof/lcs/base/1C5.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
6
90521
<filename>wof/lcs/base/1C5.asm copyright zengfr site:http://github.com/zengfr/romhack 012C20 move.b #$0, ($1c5,A5) [base+1C4] 012C26 move.l #$90b12c, ($1ce,A5) 012C8C bpl $12c98 [base+1C5] 012C94 subq.b #1, ($1c4,A5) [base+1C5] 012C98 cmpi.b #$32, ($1c5,A5) [base+1C4] 012C9E bne $12ca4 [base+1C5] 012CAA bpl $12cf8 [base+1C5] copyright zengfr site:http://github.com/zengfr/romhack
examples and results/quadro of number from 1 to 99/user_code[for user].asm
Hollbrok/CPU_cpp_version
5
93121
push 1 pop rbx L2: push rbx push 2 pow out push rbx push 1 add pop rbx push rbx push 100 jb :L2 hlt
Task/Character-codes/Ada/character-codes.ada
LaudateCorpus1/RosettaCodeData
1
9231
with Ada.Text_IO; use Ada.Text_IO; procedure Char_Code is begin Put_Line (Character'Val (97) & " =" & Integer'Image (Character'Pos ('a'))); end Char_Code;
Old Programmes/8085/Addition/2_ADD_8N.asm
illuminati-inc-2020/school
0
81174
;Add 2 N-byte numbers ;Input : 00A0H <- N ; : 00B0H <- first number ; : 00C0H <- second number ;Output : 00D0h <- sum LDA 00A0H MOV C, A LXI SP, 0FFFFH LXI H, 00D0H PUSH H LXI H, 00B0H LXI D, 00C0H SUB A LOOP: RAR MOV A, M INX H XCHG ADC M INX H XTHL MOV M, A INX H XTHL RAL DCR C JNZ LOOP XTHL ANI 01H MOV M, A HLT
spaceship/src/missile.ads
kndtime/ada-spaceship
0
24043
package Missile is type Missile_State is (ALIVE, TOUCHED, DEAD); type Missile is record State : Missile_State := DEAD; X : Integer; Y : Integer; Max_Y: Integer; Speed : Integer; end record; procedure appear_mis(s : in out Missile; X : Integer; Y : Integer; Max_Y : Integer) with Pre => Y /= Max_Y and s.State /= ALIVE, Post => s.State = ALIVE; procedure move_mis(s : in out Missile) with Pre => s.State /= DEAD; end Missile;
alloy4fun_models/trashltl/models/4/PhLFC3T3voJ8SuXhu.als
Kaixi26/org.alloytools.alloy
0
2863
open main pred idPhLFC3T3voJ8SuXhu_prop5 { some f : File | eventually (f not in File) } pred __repair { idPhLFC3T3voJ8SuXhu_prop5 } check __repair { idPhLFC3T3voJ8SuXhu_prop5 <=> prop5o }
pwnlib/shellcraft/templates/aarch64/linux/cat.asm
DrKeineLust/pwntools
10
26776
<reponame>DrKeineLust/pwntools <% from pwnlib import shellcraft %> <%page args="filename, fd=1"/> <%docstring> Opens a file and writes its contents to the specified file descriptor. Example: >>> write('flag', 'This is the flag\n') >>> shellcode = shellcraft.cat('flag') + shellcraft.exit(0) >>> print(disasm(asm(shellcode))) 0: d28d8cce mov x14, #0x6c66 // #27750 4: f2acec2e movk x14, #0x6761, lsl #16 8: f81f0fee str x14, [sp, #-16]! c: d29ff380 mov x0, #0xff9c // #65436 10: f2bfffe0 movk x0, #0xffff, lsl #16 14: f2dfffe0 movk x0, #0xffff, lsl #32 18: f2ffffe0 movk x0, #0xffff, lsl #48 1c: 910003e1 mov x1, sp 20: aa1f03e2 mov x2, xzr 24: aa1f03e3 mov x3, xzr 28: d2800708 mov x8, #0x38 // #56 2c: d4000001 svc #0x0 30: aa0003e1 mov x1, x0 34: d2800020 mov x0, #0x1 // #1 38: aa1f03e2 mov x2, xzr 3c: d29fffe3 mov x3, #0xffff // #65535 40: f2afffe3 movk x3, #0x7fff, lsl #16 44: d28008e8 mov x8, #0x47 // #71 48: d4000001 svc #0x0 4c: aa1f03e0 mov x0, xzr 50: d2800ba8 mov x8, #0x5d // #93 54: d4000001 svc #0x0 >>> run_assembly(shellcode).recvline() b'This is the flag\n' </%docstring> <% if fd == 'x0': raise Exception("File descriptor cannot be x0, it will be overwritten") %> ${shellcraft.open(filename)} ${shellcraft.syscall('SYS_sendfile', fd, 'x0', 0, 0x7fffffff)}
Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2_notsx.log_1_1594.asm
ljhsiun2/medusa
9
94736
<filename>Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2_notsx.log_1_1594.asm .global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r15 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_D_ht+0x9111, %rbp nop cmp %r10, %r10 mov $0x6162636465666768, %rcx movq %rcx, %xmm3 and $0xffffffffffffffc0, %rbp vmovaps %ymm3, (%rbp) nop nop nop nop nop add %rcx, %rcx lea addresses_WT_ht+0x7cd1, %r15 nop nop nop nop nop cmp $7955, %rcx mov (%r15), %ax inc %rbp lea addresses_normal_ht+0x16109, %rbp nop nop nop and $34209, %rsi movb (%rbp), %cl nop cmp %r15, %r15 lea addresses_UC_ht+0x9331, %rsi lea addresses_UC_ht+0x1f11, %rdi clflush (%rdi) nop nop nop nop add $51345, %r11 mov $57, %rcx rep movsw xor %r11, %r11 lea addresses_A_ht+0xff11, %rsi lea addresses_normal_ht+0xa611, %rdi nop nop nop nop and %rbp, %rbp mov $53, %rcx rep movsq sub $42922, %r15 lea addresses_UC_ht+0x8691, %rax nop nop nop sub %rsi, %rsi mov $0x6162636465666768, %r11 movq %r11, %xmm7 and $0xffffffffffffffc0, %rax movntdq %xmm7, (%rax) add %rbp, %rbp lea addresses_WC_ht+0x8811, %r11 clflush (%r11) nop nop nop nop nop xor $36716, %r10 mov (%r11), %di nop nop nop nop inc %r11 pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r15 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r8 push %r9 push %rax push %rsi // Store lea addresses_RW+0x16b11, %rax sub %r8, %r8 movl $0x51525354, (%rax) nop nop nop nop nop and %r10, %r10 // Store lea addresses_RW+0xedb5, %r9 clflush (%r9) nop sub %rsi, %rsi mov $0x5152535455565758, %r8 movq %r8, (%r9) and %r12, %r12 // Load mov $0x311, %rax add $50148, %r9 vmovups (%rax), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $0, %xmm5, %r10 nop nop nop nop nop and $55431, %rsi // Store mov $0x8a9, %r10 cmp %rsi, %rsi movw $0x5152, (%r10) nop nop nop sub %rsi, %rsi // Load lea addresses_WT+0xc211, %r11 nop nop nop nop dec %r12 vmovups (%r11), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $1, %xmm5, %r10 nop nop nop nop xor $4804, %r11 // Load lea addresses_UC+0x12b11, %r10 clflush (%r10) cmp %rax, %rax mov (%r10), %esi nop nop cmp %r10, %r10 // Store lea addresses_WT+0x1b821, %r8 nop cmp %r9, %r9 movw $0x5152, (%r8) xor $4889, %r8 // Faulty Load lea addresses_RW+0x16b11, %r10 nop sub %r11, %r11 mov (%r10), %r12d lea oracles, %rax and $0xff, %r12 shlq $12, %r12 mov (%rax,%r12,1), %r12 pop %rsi pop %rax pop %r9 pop %r8 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_P', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 1, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 1, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'54': 1} 54 */
lib/asm/philox_bmi2_4x64.asm
zhouyan/MCKL
12
9003
;;============================================================================ ;; MCKL/lib/asm/philox_bmi2_4x64.asm ;;---------------------------------------------------------------------------- ;; MCKL: Monte Carlo Kernel Library ;;---------------------------------------------------------------------------- ;; Copyright (c) 2013-2018, <NAME> ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions are met: ;; ;; 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. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS ;; AND ANY EXPRESS OR IMPLIED WARRANTIES, inc4LUDING, 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, inc4IDENTAL, SPECIAL, EXEMPLARY, OR ;; CONSEQUENTIAL DAMAGES (inc4LUDING, 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 (inc4LUDING NEGLIGENCE OR OTHERWISE) ;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ;; POSSIBILITY OF SUCH DAMAGE. ;;============================================================================ global mckl_philox4x64_bmi2_kernel default rel %macro rbox 1 vmovq rax, %1 ; k0 xor rax, r11 ; t1 vmovq rdx, xmm10 ; m2 mulx rsi, r11, r12 ; t2 vpextrq rbx, %1, 1 ; k1 xor rbx, r13 ; t3 vmovq rdx, xmm11 ; m0 mulx r12, r13, r10 ; t0 mov r10, rsi xor r12, rbx xor r10, rax %endmacro section .text ; rdi:ctr.data() ; rsi:n ; rdx:r ; rcx:mul:weyl:key mckl_philox4x64_bmi2_kernel: push rbx push r12 push r13 push r14 push r15 test rsi, rsi jz .return mov r8, [rdi + 0x00] ; counter[0] mov r9, [rdi + 0x08] ; counter[1] mov r14, [rdi + 0x10] ; counter[2] mov r15, [rdi + 0x18] ; counter[3] add [rdi], rsi adc qword [rdi + 0x08], 0 adc qword [rdi + 0x10], 0 adc qword [rdi + 0x18], 0 vmovdqu xmm15, [rcx + 0x10] ; weyl vmovdqu xmm0, [rcx + 0x20] ; round_key[0] vpaddq xmm1, xmm0, xmm15 ; round_key[1] vpaddq xmm2, xmm1, xmm15 ; round_key[2] vpaddq xmm3, xmm2, xmm15 ; round_key[3] vpaddq xmm4, xmm3, xmm15 ; round_key[4] vpaddq xmm5, xmm4, xmm15 ; round_key[5] vpaddq xmm6, xmm5, xmm15 ; round_key[6] vpaddq xmm7, xmm6, xmm15 ; round_key[7] vpaddq xmm8, xmm7, xmm15 ; round_key[8] vpaddq xmm9, xmm8, xmm15 ; round_key[9] mov rdi, rdx ; r vmovdqu xmm10, [rcx] ; multiplier[0] vpshufd xmm11, xmm10, 0x4E ; multiplier[1] mov rcx, rsi ; n align 16 .loop: add r8, 1 jnc .skip adc r9, 0 adc r14, 0 adc r15, 0 .skip: mov r10, r8 ; s0 mov r11, r9 ; s1 mov r12, r14 ; s2 mov r13, r15 ; s3 rbox xmm0 rbox xmm1 rbox xmm2 rbox xmm3 rbox xmm4 rbox xmm5 rbox xmm6 rbox xmm7 rbox xmm8 rbox xmm9 mov [rdi + 0x00], r10 mov [rdi + 0x08], r11 mov [rdi + 0x10], r12 mov [rdi + 0x18], r13 dec rcx add rdi, 0x20 test rcx, rcx jnz .loop .return: pop r15 pop r14 pop r13 pop r12 pop rbx ret ; vim:ft=nasm
src/lv-objx-textarea.ads
Fabien-Chouteau/ada-lvlg
3
21732
<filename>src/lv-objx-textarea.ads with Lv.Style; with Lv.Objx.Page; with Lv.Objx.Label; package Lv.Objx.Textarea is subtype Instance is Obj_T; Cursor_Last : constant := 16#7FFF#; type Cursor_Type_T is (Cursor_None, Cursor_Line, Cursor_Block, Cursor_Outline, Cursor_Underline, Cursor_Hidden); type Style_T is (Style_Bg, Style_Sb, Style_Cursor); -- Create a text area objects -- @param par pointer to an object, it will be the parent of the new text area -- @param copy pointer to a text area object, if not NULL then the new object will be copied from it -- @return pointer to the created text area function Create (Par : Obj_T; Copy : Instance) return Instance; -- Insert a character to the current cursor position. -- To add a wide char, e.g. 'Á' use `lv_txt_encoded_conv_wc('Á')` -- @param self pointer to a text area object -- @param c a character (e.g. 'a') procedure Add_Char (Self : Instance; C : Uint32_T); -- Insert a text to the current cursor position -- @param self pointer to a text area object -- @param txt a '\0' terminated string to insert procedure Add_Text (Self : Instance; Txt : C_String_Ptr); -- Delete a the left character from the current cursor position -- @param self pointer to a text area object procedure Del_Char (Self : Instance); ---------------------- -- Setter functions -- ---------------------- -- Set the text of a text area -- @param self pointer to a text area -- @param txt pointer to the text procedure Set_Text (Self : Instance; Txt : C_String_Ptr); -- Set the cursor position -- @param obj pointer to a text area object -- @param pos the new cursor position in character index -- < 0 : index from the end of the text -- LV_TA_CURSOR_LAST: go after the last character procedure Set_Cursor_Pos (Self : Instance; Pos : Int16_T); -- Set the cursor type. -- @param self pointer to a text area object -- @param cur_type: element of 'lv_cursor_type_t' procedure Set_Cursor_Type (Self : Instance; Cur_Type : Cursor_Type_T); -- Enable/Disable password mode -- @param self pointer to a text area object -- @param pwd_en true: enable, false: disable procedure Set_Pwd_Mode (Self : Instance; Pwd_En : U_Bool); -- Configure the text area to one line or back to normal -- @param self pointer to a Text area object -- @param en true: one line, false: normal procedure Set_One_Line (Self : Instance; En : U_Bool); -- Set the alignment of the text area. -- In one line mode the text can be scrolled only with `LV_LABEL_ALIGN_LEFT`. -- This function should be called if the size of text area changes. -- @param self pointer to a text are object -- @param align the desired alignment from `lv_label_align_t`. (LV_LABEL_ALIGN_LEFT/CENTER/RIGHT) procedure Set_Text_Align (Self : Instance; Align : Label.Align_T); -- Set a list of characters. Only these characters will be accepted by the text area -- @param self pointer to Text Area -- @param list list of characters. Only the pointer is saved. E.g. "+-.,0123456789" procedure Set_Accepted_Chars (Self : Instance; List : C_String_Ptr); -- Set max length of a Text Area. -- @param self pointer to Text Area -- @param num the maximal number of characters can be added (`lv_ta_set_text` ignores it) procedure Set_Max_Length (Self : Instance; Num : Uint16_T); -- Set an action to call when the Text area is clicked -- @param self pointer to a Text area -- @param action a function pointer procedure Set_Action (Self : Instance; Action : Action_Func_T); -- Set the scroll bar mode of a text area -- @param self pointer to a text area object -- @param sb_mode the new mode from 'lv_page_sb_mode_t' enum procedure Set_Sb_Mode (Self : Instance; Mode : Page.Mode_T); -- Set a style of a text area -- @param self pointer to a text area object -- @param type which style should be set -- @param style pointer to a style procedure Set_Style (Self : Instance; Type_P : Style_T; Style : access Lv.Style.Style); ---------------------- -- Getter functions -- ---------------------- -- Get the text of a text area. In password mode it gives the real text (not '*'s). -- @param self pointer to a text area object -- @return pointer to the text function Text (Self : Instance) return C_String_Ptr; -- Get the label of a text area -- @param self pointer to a text area object -- @return pointer to the label object function Label (Self : Instance) return Label.Instance; -- Get the current cursor position in character index -- @param self pointer to a text area object -- @return the cursor position function Cursor_Pos (Self : Instance) return Uint16_T; -- Get the current cursor visibility. -- @param self pointer to a text area object -- @return true: the cursor is drawn, false: the cursor is hidden function Cursor_Show (Self : Instance) return U_Bool; -- Get the current cursor type. -- @param self pointer to a text area object -- @return element of 'lv_cursor_type_t' function Cursor_Type (Self : Instance) return Cursor_Type_T; -- Get the password mode attribute -- @param self pointer to a text area object -- @return true: password mode is enabled, false: disabled function Pwd_Mode (Self : Instance) return U_Bool; -- Get the one line configuration attribute -- @param self pointer to a text area object -- @return true: one line configuration is enabled, false: disabled function One_Line (Self : Instance) return U_Bool; -- Get a list of accepted characters. -- @param self pointer to Text Area -- @return list of accented characters. function Accepted_Chars (Self : Instance) return C_String_Ptr; -- Set max length of a Text Area. -- @param self pointer to Text Area -- @return the maximal number of characters to be add function Max_Length (Self : Instance) return Uint16_T; -- Set an action to call when the Text area is clicked -- @param self pointer to a Text area -- @param action a function pointer function Action (Self : Instance) return Action_Func_T; -- Get the scroll bar mode of a text area -- @param self pointer to a text area object -- @return scrollbar mode from 'lv_page_sb_mode_t' enum function Sb_Mode (Self : Instance) return Page.Mode_T; -- Get a style of a text area -- @param self pointer to a text area object -- @param type which style should be get -- @return style pointer to a style function Style (Self : Instance; Type_P : Style_T) return access Lv.Style.Style; -- Move the cursor one character right -- @param self pointer to a text area object procedure Cursor_Right (Self : Instance); -- Move the cursor one character left -- @param self pointer to a text area object procedure Cursor_Left (Self : Instance); -- Move the cursor one line down -- @param self pointer to a text area object procedure Cursor_Down (Self : Instance); -- Move the cursor one line up -- @param self pointer to a text area object procedure Cursor_Up (Self : Instance); ------------- -- Imports -- ------------- pragma Import (C, Create, "lv_ta_create"); pragma Import (C, Add_Char, "lv_ta_add_char"); pragma Import (C, Add_Text, "lv_ta_add_text"); pragma Import (C, Del_Char, "lv_ta_del_char"); pragma Import (C, Set_Text, "lv_ta_set_text"); pragma Import (C, Set_Cursor_Pos, "lv_ta_set_cursor_pos"); pragma Import (C, Set_Cursor_Type, "lv_ta_set_cursor_type"); pragma Import (C, Set_Pwd_Mode, "lv_ta_set_pwd_mode"); pragma Import (C, Set_One_Line, "lv_ta_set_one_line"); pragma Import (C, Set_Text_Align, "lv_ta_set_text_align"); pragma Import (C, Set_Accepted_Chars, "lv_ta_set_accepted_chars"); pragma Import (C, Set_Max_Length, "lv_ta_set_max_length"); pragma Import (C, Set_Action, "lv_ta_set_action_inline"); pragma Import (C, Set_Sb_Mode, "lv_ta_set_sb_mode_inline"); pragma Import (C, Set_Style, "lv_ta_set_style"); pragma Import (C, Text, "lv_ta_get_text"); pragma Import (C, Label, "lv_ta_get_label"); pragma Import (C, Cursor_Pos, "lv_ta_get_cursor_pos"); pragma Import (C, Cursor_Show, "lv_ta_get_cursor_show"); pragma Import (C, Cursor_Type, "lv_ta_get_cursor_type"); pragma Import (C, Pwd_Mode, "lv_ta_get_pwd_mode"); pragma Import (C, One_Line, "lv_ta_get_one_line"); pragma Import (C, Accepted_Chars, "lv_ta_get_accepted_chars"); pragma Import (C, Max_Length, "lv_ta_get_max_length"); pragma Import (C, Action, "lv_ta_get_action_inline"); pragma Import (C, Sb_Mode, "lv_ta_get_sb_mode_inline"); pragma Import (C, Style, "lv_ta_get_style"); pragma Import (C, Cursor_Right, "lv_ta_cursor_right"); pragma Import (C, Cursor_Left, "lv_ta_cursor_left"); pragma Import (C, Cursor_Down, "lv_ta_cursor_down"); pragma Import (C, Cursor_Up, "lv_ta_cursor_up"); for Cursor_Type_T'Size use 8; for Cursor_Type_T use (Cursor_None => 0, Cursor_Line => 1, Cursor_Block => 2, Cursor_Outline => 3, Cursor_Underline => 4, Cursor_Hidden => 8); for Style_T'Size use 8; for Style_T use (Style_Bg => 0, Style_Sb => 1, Style_Cursor => 2); end Lv.Objx.Textarea;
Scripts Pack Source Items/Scripts Pack/Core Components/Keyboard Behaviour (10.7).applescript
Phorofor/ScriptsPack.macOS
1
1465
<filename>Scripts Pack Source Items/Scripts Pack/Core Components/Keyboard Behaviour (10.7).applescript # Scripts Pack - Tweak various preference variables in macOS # <Phorofor, https://github.com/Phorofor/> -- Keyboard Behaviour -- Versions compatible: macOS 10.7 -- Preference Identifier: GlobalPreferences -- Preference Keys: ApplePressAndHoldEnabled -- Preference location: ~/Library/Preferences/.GlobalPreferences.plist -- Default value (integer): 0 set MacVer to do shell script "sw_vers -productVersion" set Min to "10.7.0" as string if MacVer < Min then display alert "Outdated Mac OS Version!" message "You're using Mac OS " & MacVer & ". This feature is only available in Lion (10.7)+ and is not supported by your current version of Mac OS. This script will have no effect!" buttons ["OK"] as warning cancel button 1 else set tZ to "Use Key Repeat Behaviour" set sTz to "NO" set bT to "You've decided to use the key repeat behaviour." try set prValue to do shell script "defaults read -g ApplePressAndHoldEnabled" if prValue = "NO" then set prValue to "The key repeat behaviour is enabled." set tZ to "Use Character Accent Behaviour" set sTz to "YES" set bT to "You've decided to enable the keyboard character accent behaviour." else set prValue to "The keyboard character accent is enabled." end if on error set prValue to "The Keyboard character accent keys are enabled by default." end try display alert "Change Keyboard Behaviour?" message "In Lion, holding a key will most likely show the character accent for that key or letter when holding it down instead of repeating the key." & return & return & prValue buttons {"Cancel", "Clear", tZ} default button 3 cancel button 1 if the button returned of the result is tZ then do shell script "defaults write -g ApplePressAndHoldEnabled " & sTz else do shell script "defaults delete -g ApplePressAndHoldEnabled" end if display alert "GlobalPreferences - Changes Applied!" message bT & " You'll be able to see your changes the next time you restart your applications." end if
Lab Work/5th-semester/assembly-language/book/CH-07/7_11.asm
akazad13/bsc-academic-work
0
17434
<filename>Lab Work/5th-semester/assembly-language/book/CH-07/7_11.asm .MODEL SMALL .STACK 100H .DATA MSG1 DB 0AH,'TYPE A BINARY NUMBER, UP TO 16 DIGITS: $' MSG2 DB 0AH,'ILLEGAL BINARY DIGIT, TRY AGAIN: $'; MSG3 DB 'IN HEX IT IS $' I DB 0 .CODE MAIN PROC ; initializing data segment MOV AX,@DATA MOV DS,AX LEA DX,MSG1 ; getting offset of 1st message MOV AH,9 ; string print function INT 21H ; printing 1st message JMP _TOP ; jump to TOP _ILLIGAL: ; for printing illegal error message LEA DX,MSG2 ; getting offset of 2nd message MOV AH,9 ; string print function INT 21H ; printing 2nd message _TOP: XOR BX,BX ; reset BX MOV AH,1 ; single char function _WHILE: INT 21H ; single char input CMP AL,0DH ; check whether AL = carriage return or not JE _PRINT ; if yes jump to _PRINT CMP AL,'0' ; check if AL<0 JL _ILLIGAL ; if yes, jump to _ILLIGAL CMP AL,'1' ; check if AL>1 JG _ILLIGAL ; if yes, jump to _ILLIGAL AND AL,0FH ; getting the digit SHL BX,1 ; shift 1 bit to left OR BL,AL JMP _WHILE _PRINT: LEA DX,MSG3 ; getting offset of 1st message MOV AH,9 ; string print function INT 21H ; printing 1st message XOR DX,DX ; Clear DX MOV CL,4 ; CL = 4 MOV I,0 MOV AH,2 ; single char output function _WHILE1: CMP I,4 JE _EXIT MOV DL,BH ; DL = BH SHR DL,CL ; shift DL , 4 time to right ROL BX,CL ; shift BX to 1 bit left CMP DL,9 ; if it is digit JLE _DIGIT ; yes, then go to _DIGIT ADD DL,55D ; else make it a letter JMP _OUTPUT ;output function _DIGIT: ADD DL,30H ; conver number to ascii character _OUTPUT: INT 21H ; print the char INC I ; I= I+1 JMP _WHILE1 ; jump to _LOOP _EXIT: MOV AH,4CH ; dos return function INT 21H ; return from the dos MAIN ENDP END MAIN ; terminate programme
assign9/assign9.asm
Andrew-Slade/Assembler
0
84152
<reponame>Andrew-Slade/Assembler<filename>assign9/assign9.asm //KC03H99A JOB ,'ANDREW SLADE',MSGCLASS=H 00010031 //JSTEP01 EXEC PGM=ASSIST 00020031 //STEPLIB DD DSN=KC00NIU.ASSIST.LOADLIB,DISP=SHR 00030031 //SYSPRINT DD SYSOUT=* 00040031 //FT05F001 DD DSN=KC02322.CSCI360.DATAFA17(DATA7),DISP=SHR 00050031 //SYSIN DD * 00060031 *************************************************** 00070031 * ASSIGNMENT 9- EXTERNAL SUBROUTINES * 00080031 * ANDREW SLADE * 00090031 * DATE DUE: 12/04/2017 * 00100031 *************************************************** 00110031 *PROCEDURE * 00120031 * * * 00130031 *1 PRINT HEADER * 00140031 * * * 00150031 *2 CLEAR REGISTERS * 00160031 * * * 00170031 *3 READ RECORDS * 00180031 * * * 00190031 *4 COMPUTE TOTAL * 00200031 * * * 00210031 *5 COUNT RECORDS * 00220031 * * * 00230031 *6 COMPARE RECORDS WITH ZERO * 00240031 * * * 00250031 *7 STORE HIGHEST OR LOWEST VALUE * 00260031 * * * 00270031 *8 COUNT NUMBER OF POSITIVE VALUES, NEGATIVE VAL- * 00280031 * UES, AND ZERO VALUES * 00290031 * * * 00300031 *9 CALCULATE AVERGAGE VALUE * 00310031 * * * 00320031 *10 STORE VALUES * 00330031 * * * 00340031 *11 PRINT REPORTS * 00350031 * * * 00360031 *FUNCTION: READ DATA SET, PROCESS DATA, OUTPUT * 00370031 * * META DATA AS WELL AS DATA SET WITH LAB-* 00380031 * * ELS. COUNT NEGATIVE, POSITIVE, AND * 00390031 * * ZERO VALUES AS WELL AS STORING HIGHEST,* 00400031 * * LOWEST AND AVERAGE VALUES. * 00410031 *INPUT: A DATAFILE FROM ANOTHER USER * 00420031 * * * 00430031 *ENTRY CONDS: NONE * 00440031 * * * 00450031 *EXIT CONDS: NONE * 00460031 * * * 00470031 *NOTES: NONE * 00480031 * * * 00490031 *OUTPUT: A REPORT SHOWING META DATA FOR THE DATA * 00500031 * * SET. * 00510031 * * * 00520031 *REGISTER USAGE: R2: READS IN RECORDS * 00530031 * * R3: HOLDS HIGHEST * 00540031 * * R4: USED IN DIVISION AS THE EVEN * 00550031 * * COMPONENT OF THE PAIR * 00560031 * * R5: HOLDS TOTAL IN DIVISION, IS * 00570031 * * THE ODD COMPONENT OF THE PAIR* 00580031 * * R6: HOLDS THE RECORD COUNT IN THE* 00590031 * * DIVISION PROCESS * 00600031 * * R8: USED FOR HOLDING BUFFER VAL * 00610031 * * R9: HOLDS LOWEST, RECORDS * 00611032 * * R10: USED TO COUNT RECORDS * 00620031 * * R11: USED TO COUNT NEGATIVE, POS-* 00630031 * * ITIVE, AND ZERO VALUES * 00640031 * * R12: STD LINKAGE * 00650032 * * R13: HOLDS LOWEST * 00660031 * * R14: HOLDS SYSTEM ADDRESS * 00670031 * * R15: HOLDS PROGRAM FOR ADDRESSAB-* 00680031 * * ILITY * 00690031 *************************************************** 00700031 ASSIGN9 CSECT 00710032 STM 14,12,12(13) STORE REGISTERS 00711046 LR 12,15 ADDRESS OF ASSIGN9 00712046 USING ASSIGN9,12 ESTABLISH ADDRESSABILITY 00720043 LA 14,SAVER POINT TO SAVE AREA 00721046 ST 13,4(,14) BACKWARD POINTR 00722046 ST 14,8(,13) FORWARD POINTER 00723046 LR 13,14 POINT TO SAVE AREA 00724046 * 00730031 XPRNT CCA,133 PRINT HEADER #1 00740031 * 00750031 SR 12,12 CLEAR AN AREA FOR TOTAL 00760031 SR 10,10 CLEAR AN AREA FOR INCREMENT 00770031 SR 5,5 CLEAR AN AREA FOR TOTAL 00780031 SR 6,6 CLEAR AN AREA FOR RECCOUNT 00790031 * 00800031 XREAD BUFFER,80 READ INTO BUFFER 00810031 READF BL ENDREADF BRANCH WHEN DONE READING 00820042 * COUNT RECORDS 00830031 LA 10,1(0,10) INCREMENT RECORD COUNT 00840031 ST 10,COUNT STORE COUNT 00850031 C 10,=F'1' COMPARE TO SEE IF FIRST REC 00860031 BE ISONE SEE IF IS FIRST 00870031 BNE ISNT IF ISNT, SKIP 00880031 ISONE MVC CCB(1),=C'0' DOUBLE SPACE 00890031 B CHANGED BRANCH WHEN DONE 00900031 ISNT MVC CCB(1),=C' ' SINGLE SPACE 00910031 B CHANGED BRANCH WHEN DONE 00920031 CHANGED XDECI 2,BUFFER CONVERT 00930031 SR 11,11 CLEAR COUNTER 00940031 LTR 2,2 TEST VALUES 00950031 BH POSC BRANCH TO POSITIVE IF POS 00960031 BL NEGC BRANCH TO NEGATIVE IF NEG 00970031 BZ ZEROC BRANCH TO ZERO IF ZERO 00980031 * POSITIVE BRANCH 00990031 POSC L 11,PI LOAD POSITIVE COUNT 01000031 LA 11,1(0,11) INCREMENT 01010031 ST 11,PI STORE 01020031 B OVERC END PROCESS 01030031 * NEGATIVE BRANCH 01040031 NEGC L 11,NI LOAD NEGATIVE COUNT 01050031 LA 11,1(0,11) INCREMENT 01060031 ST 11,NI STORE 01070031 B OVERC END PROCESS 01080031 * ZERO BRANCH 01090031 ZEROC L 11,ZI LOAD ZERO COUNT 01100031 LA 11,1(0,11) INCREMENT 01110031 ST 11,ZI STORE 01120031 OVERC SR 11,11 CLEAR OUT A SPACE FOR USE 01130031 * SUBROUTINE 01140031 LA 1,PARLIST POINT TO PARAMETER LIST 01150031 L 15,=V(PROCNUM) LOAD PROCNUM 01151037 BALR 14,15 BRANCH TO PROCNUM 01152037 L 3,HIGHEST LOAD HIGHEST 01170045 L 7,LOWEST LOAD LOWEST 01180045 XDECO 3,HIGH STORE HIGH AS CHAR 01190031 XDECO 7,LOW STORE LOW AS CHAR 01200034 * END OF SUBROUTINE 01210031 XPRNT CCB,133 PRINT READ RECORD 01220031 B READF LOOP BACK TO READF FOR ANY CODE 01230031 ENDREADF XPRNT CCC,133 PRINT HEADER 2 01240031 * 01250031 * CALC AVERAGE 01260031 SR 4,4 CLEAR FOR DIVISION 01270031 SR 5,5 CLEAR FOR DIVISION 01280031 SR 6,6 CLEAR FOR DIVISION 01290031 * 01300031 L 5,TOTAL LOAD TOTAL 01310031 L 6,COUNT LOAD RECORD COUNT 01320031 DR 4,6 DIVIDE TOTAL BY COUNT 01330031 XDECO 5,AVG STORE AVERAGE 01340031 * END CALC AVERAGE 01350031 L 11,ZI LOAD NUMBER OF ZEROS 01360031 XDECO 11,ZEROS STORE NUMBER OF ZEROS AS CHAR 01370031 * 01380031 L 11,PI LOAD NUMBER OF POSITIVES 01390031 XDECO 11,POSTS STORE NUMBER OF POS AS CHAR 01400031 * 01410031 L 11,NI LOAD NUMBER OF NEGATIVES 01420031 XDECO 11,NEGS STORE NUMBER OF NEGS AS CHAR 01430031 * PRINT VALUES 01440031 XPRNT CCD,133 PRINT ZERO NUMBER COUNT 01450031 XPRNT CCE,133 PRINT POSITIVE NUMBER COUNT 01460031 XPRNT CCF,133 PRINT NEGATIVE NUMBER COUNT 01470031 XPRNT CCG,133 PRINT AVERAGE VALUE 01480031 XPRNT CCH,133 PRINT HIGHEST VALUE 01490031 XPRNT CCI,133 PRINT LOWEST VALUE 01500031 * 01510031 L 13,4(,13) LOAD SAVE AREA 01511046 LM 14,12,12(13) LOAD ALL REGISTERS BACK 01512046 BR 14 BREAK TO OS 01520046 * 01530031 LTORG 01540031 SAVER DS 18F SAVE AREA FOR ALL REGS 01541046 BUFFER DC 80C'%' CREATES BUFFER AND FILLS 01550031 * 01560031 PI DC F'0' COUNT OF POSITIVE NUMBERS 01570031 NI DC F'0' COUNT OF NEGATIVE NUMBERS 01580031 ZI DC F'0' COUNT OF ZEROS 01590031 HIGHEST DC F'0' CURRENT HIGH 01600031 LOWEST DC F'0' CURRENT LOW 01610031 TOTAL DC F'0' TOTAL 01620031 COUNT DC F'0' RECORD COUNT 01630031 * 01640031 INC DC F'0' A PLACE TO HOLD RECORD COUNT 01650031 * 01660031 CCB DC C' ' CARRIAGE CONTROL 01670031 DC 6C' ' SPACES 01680031 DC C'NUMBER PROCESSED:' 01690031 VAL1 DS CL12 STORAGE FOR VAL 2 01700031 DC C' ' SPACE 01710031 STATUS DS 8C' ' VALUE OF COMPARISON 01720031 DC 99C' ' SPACES 01730046 * 01780031 CCA DC C'1' CARRIAGE CONTROL 01790031 DC 4C' ' SPACES 01800031 HEADER1 DC C'**** NUMBER REPORT ****' 01810031 DC 106C' ' SPACES 01820031 * 01830031 CCC DC C'0' CARRIAGE CONTROL 01840031 DC 4C' ' SPACES 01850031 HEADER2 DC C'**** TOTALS ****' 01860031 DC 113C' ' SPACES 01870031 * CURRENT ISSUE, CALCULATING COUNTS OF 01880031 CCD DC C'0' NEGATIVE,POSITIVE AND ZEROS 01890031 DC 6C' ' SPACES 01900031 DC C'NUMBER OF ZEROS:' 01910031 DC 3C' ' SPACES 01920031 ZEROS DC 12C' ' TOTAL NUMBER OF ZEROS 01930031 DC 94C' ' SPACES 01940031 * 01950031 CCE DC C' ' CC 01960031 DC 6C' ' SPACES 01970031 DC C'NUMBER OF POSITIVE:' 01980031 POSTS DC 12C' ' TOTAL NUMBER OF ZEROS 01990031 DC 95C' ' SPACES 02000031 * 02010031 CCF DC C' ' CC 02020031 DC 6C' ' SPACES 02030031 DC C'NUMBER OF NEGATIVE:' 02040031 NEGS DC 12C' ' TOTAL NUMBER OF ZEROS 02050031 DC 95C' ' SPACES 02060031 * 02070031 CCG DC C' ' CARRIAGE CONTROL 02080031 DC 17C' ' SPACES 02090031 DC C'AVERAGE:' 02100031 AVG DC 12C' ' AVERAGE VALUE 02110031 DC 95C' ' SPACES 02120031 * 02130031 CCH DC C' ' CARRIAGE CONTROL 02140031 DC 17C' ' SPACES 02150031 DC C'HIGHEST:' 02160031 HIGH DC 12C' ' HIGHEST VALUE 02170031 DC 95C' ' SPACES 02180031 * 02190031 CCI DC C' ' CARRIAGE CONTROL 02200031 DC 17C' ' SPACES 02210031 DC C'LOWEST:' 02220031 DC C' ' 02230031 LOW DC 12C' ' LOWEST VALUE 02240031 DC 95C' ' SPACES 02250031 * 02260031 PARLIST DC A(BUFFER) 02270031 DC A(VAL1) 02280031 DC A(STATUS) 02290031 DC A(HIGHEST) 02300031 DC A(LOWEST) 02310031 DC A(TOTAL) 02320031 * 02330031 * EXTERNAL SUBROUTINE 02340040 PROCNUM CSECT 02350036 STM 14,12,12(13) SAVE ALL REGS 02351036 LR 12,15 ADDRESS OF PROCNUM 02352046 USING PROCNUM,12 ADDRESSABILITY 02353046 LA 14,SAVEAR STORAGE POINTER 02354046 ST 13,4(,14) BACKWARD POINTER 02355046 ST 14,8(,13) FORWARD POINTER 02356046 LR 13,14 POINT TO SAVE AREA 02357046 LM 2,7,0(1) R2 <- BUFFER 02360031 * R3 <- VAL1(DECO AREA) 02370031 * R4 <- STATUS (NEG,POS,Z) 02380031 * R5 <- HIGH (HIGHEST) 02390031 * R6 <- LOW (LOWEST) 02400031 * R7 <- TOTAL 02410031 * READ RECORDS 02420031 L 9,0(,7) LOAD TOTAL 02430034 XDECI 8,0(,2) CONVERT TO USABLE FORM 02440031 AR 9,8 ADD VALUES TOGETHER 02450034 ST 9,0(,7) STORE TOTAL 02460034 * COMPARE VALUES 02470031 LTR 8,8 TEST VALUES 02480031 BH POS BRANCH TO POSITIVE IF POS 02490031 BL NEG BRANCH TO NEGATIVE IF NEG 02500031 BZ ZERO BRANCH TO ZERO IF ZERO 02510031 * POSITIVE BRANCH 02520031 POS MVC 0(8,4),=C'POSITIVE' 02530031 C 8,0(,5) COMPARE POSITIVE VALS 02540031 BH HIGHER BRANCH ON GREATER THAN 02550031 BNH ENDP BRANCH OTHERWISE 02560031 HIGHER ST 8,0(,5) STORE HIGHER VALUE 02570031 ENDP B OVER END PROCESS 02580031 * NEGATIVE BRANCH 02590031 NEG MVC 0(8,4),=C'NEGATIVE' 02600031 C 8,0(,6) COMPARE NEGATIVE VALS 02610031 BL LOWER BRANCH ON LESS THAN 02620031 BNL ENDN BRANCH ON NOT LESS THAN 02630031 LOWER ST 8,0(,6) STORE LOWER VALUE 02640031 ENDN B OVER END PROCESS 02650031 * ZERO BRANCH 02660031 ZERO MVC 0(8,4),=C'ZERO ' 02670031 OVER XDECO 8,0(,3) STORE CHAR FORM OF REC 02680031 XREAD 0(,2),80 READ RECORD 02690031 * 02700031 L 13,4(,13) ADDRESS OF CALL ROUTINE 02701046 L 14,12(,13) RESTORE CALLER REGISTER 02702046 LM 0,12,20(13) RESTORES CALLERS REGISTERS 02703046 BR 14 GO BACK TO CALLER ROUTINE 02720046 * 02730031 LTORG 02740031 SAVEAR DS 18F SAVE AREA FOR REGISTERS 02741046 * 02760031 END ASSIGN9 02770032 /* 02780031 // 02790031
programs/oeis/294/A294936.asm
jmorken/loda
1
179982
; A294936: Characteristic function for nondeficient numbers (A023196): a(n) = 1 if A001065(n) >= n, 0 otherwise. ; 0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0 lpb $0 mov $2,$0 cal $2,48050 ; Chowla's function: sum of divisors of n except 1 and n. sub $2,$0 sub $0,$2 sub $0,1 mov $1,22 lpe div $1,22
theorems/homotopy/EilenbergMacLane.agda
cmknapp/HoTT-Agda
0
6583
<reponame>cmknapp/HoTT-Agda {-# OPTIONS --without-K #-} open import HoTT open import homotopy.HSpace renaming (HSpaceStructure to HSS) open import homotopy.Freudenthal open import homotopy.IterSuspensionStable open import homotopy.Pi2HSusp open import homotopy.EM1HSpace module homotopy.EilenbergMacLane where -- EM(G,n) when G is π₁(A,a₀) module EMImplicit {i} (A : Type i) (cA : is-connected 0 A) (gA : has-level 1 A) (A-H : HSS A) where private a₀ = HSS.e A-H X = ⊙[ A , a₀ ] ⊙EM : (n : ℕ) → Ptd i ⊙EM O = ⊙Ω X ⊙EM (S n) = ⊙Trunc ⟨ S n ⟩ (⊙Susp^ n X) module _ (n : ℕ) where EM = fst (⊙EM n) embase = snd (⊙EM n) EM-level : (n : ℕ) → has-level ⟨ n ⟩ (fst (⊙EM n)) EM-level O = gA a₀ a₀ EM-level (S n) = Trunc-level EM-conn : (n : ℕ) → is-connected ⟨ n ⟩ (EM (S n)) EM-conn n = Trunc-preserves-conn ⟨ S n ⟩ (transport (λ t → is-connected t (fst (⊙Susp^ n X))) (+2+0 ⟨ n ⟩₋₂) (⊙Susp^-conn n cA)) {- π (S k) (EM (S n)) (embase (S n)) == π k (EM n) (embase n) where k > 0 and n = S (S n') -} module Stable (k n : ℕ) (indexing : S k ≤ S (S n)) where private SSn : ℕ SSn = S (S n) lte : ⟨ S k ⟩ ≤T ⟨ SSn ⟩ lte = ⟨⟩-monotone-≤ $ indexing Skle : S k ≤ (S n) *2 Skle = ≤-trans indexing (lemma n) where lemma : (n' : ℕ) → S (S n') ≤ (S n') *2 lemma O = inl idp lemma (S n') = ≤-trans (≤-ap-S (lemma n')) (inr ltS) private module SS = Susp^StableSucc X cA k (S n) Skle abstract stable : πS (S k) (⊙EM (S SSn)) == πS k (⊙EM SSn) stable = πS (S k) (⊙EM (S SSn)) =⟨ πS-below-trunc _ _ _ (≤T-ap-S lte) ⟩ πS (S k) (⊙Susp^ SSn X) =⟨ SS.stable ⟩ πS k (⊙Susp^ (S n) X) =⟨ ! (πS-below-trunc _ _ _ lte) ⟩ πS k (⊙EM SSn) ∎ module BelowDiagonal where π₁ : (n : ℕ) → πS 0 (⊙EM (S (S n))) == Lift-Unit-group π₁ n = contr-is-0ᴳ (πS 0 (⊙EM (S (S n)))) (connected-at-level-is-contr (raise-level-≤T (≤T-ap-S (≤T-ap-S (-2≤T ⟨ n ⟩₋₂))) (Trunc-level {n = 0})) (Trunc-preserves-conn 0 (path-conn (EM-conn (S n))))) -- some clutter here arises from the definition of <; -- any simple way to avoid this? πS-below : (k n : ℕ) → (S k < n) → πS k (⊙EM n) == Lift-Unit-group πS-below 0 .2 ltS = π₁ 0 πS-below 0 .3 (ltSR ltS) = π₁ 1 πS-below 0 (S (S n)) (ltSR (ltSR _)) = π₁ n πS-below (S k) ._ ltS = Stable.stable k k (inr ltS) ∙ πS-below k _ ltS πS-below (S k) ._ (ltSR ltS) = Stable.stable k (S k) (inr (ltSR ltS)) ∙ πS-below k _ (ltSR ltS) πS-below (S k) ._ (ltSR (ltSR ltS)) = Stable.stable k (S (S k)) (inr (ltSR (ltSR ltS))) ∙ πS-below k _ (ltSR (ltSR ltS)) πS-below (S k) (S (S (S n))) (ltSR (ltSR (ltSR lt))) = Stable.stable k n (inr (<-cancel-S (ltSR (ltSR (ltSR lt))))) ∙ πS-below k _ (<-cancel-S (ltSR (ltSR (ltSR lt)))) module OnDiagonal where π₁ : πS 0 (⊙EM 1) == πS 0 X π₁ = πS-below-trunc 0 1 X ≤T-refl private module Π₂ = Pi2HSusp A gA cA A-H π₂ : πS 1 (⊙EM 2) == πS 0 X π₂ = πS-below-trunc 1 2 (⊙Susp X) ≤T-refl ∙ Π₂.π₂-Suspension πS-diag : (n : ℕ) → πS n (⊙EM (S n)) == πS 0 X πS-diag 0 = π₁ πS-diag 1 = π₂ πS-diag (S (S n)) = Stable.stable (S n) n ≤-refl ∙ πS-diag (S n) module AboveDiagonal where πS-above : (k n : ℕ) → (n < S k) → πS k (⊙EM n) == Lift-Unit-group πS-above k n lt = contr-is-0ᴳ (πS k (⊙EM n)) (inhab-prop-is-contr [ idp^ (S k) ] (Trunc-preserves-level 0 (Ω^-level-in -1 (S k) _ (raise-level-≤T (lemma lt) (EM-level n))))) where lemma : {k n : ℕ} → n < k → ⟨ n ⟩ ≤T (⟨ k ⟩₋₂ +2+ -1) lemma ltS = inl (! (+2+-comm _ -1)) lemma (ltSR lt) = ≤T-trans (lemma lt) (inr ltS) module Spectrum where private module Π₂ = Pi2HSusp A gA cA A-H spectrum0 : ⊙Ω (⊙EM 1) == ⊙EM 0 spectrum0 = ⊙Ω (⊙EM 1) =⟨ ⊙ua (⊙≃-in (Trunc=-equiv _ _) idp) ⟩ ⊙Trunc 0 (⊙Ω X) =⟨ ⊙ua (⊙≃-in (unTrunc-equiv _ (gA a₀ a₀)) idp) ⟩ ⊙Ω X ∎ spectrum1 : ⊙Ω (⊙EM 2) == ⊙EM 1 spectrum1 = ⊙Ω (⊙EM 2) =⟨ ⊙ua (⊙≃-in (Trunc=-equiv _ _) idp) ⟩ ⊙Trunc 1 (⊙Ω (⊙Susp X)) =⟨ Π₂.⊙main-lemma ⟩ X =⟨ ! (⊙ua (⊙≃-in (unTrunc-equiv _ gA) idp)) ⟩ ⊙EM 1 ∎ private sconn : (n : ℕ) → is-connected ⟨ S n ⟩ (fst (⊙Susp^ (S n) X)) sconn n = transport (λ t → is-connected t (fst (⊙Susp^ (S n) X))) (+2+0 ⟨ n ⟩₋₁) (⊙Susp^-conn (S n) cA) kle : (n : ℕ) → ⟨ S (S n) ⟩ ≤T ⟨ n ⟩ +2+ ⟨ n ⟩ kle O = inl idp kle (S n) = ≤T-trans (≤T-ap-S (kle n)) (≤T-trans (inl (! (+2+-βr ⟨ n ⟩ ⟨ n ⟩))) (inr ltS)) module FS (n : ℕ) = FreudenthalEquiv ⟨ n ⟩₋₁ ⟨ S (S n) ⟩ (kle n) (fst (⊙Susp^ (S n) X)) (snd (⊙Susp^ (S n) X)) (sconn n) spectrumSS : (n : ℕ) → ⊙Ω (⊙EM (S (S (S n)))) == ⊙EM (S (S n)) spectrumSS n = ⊙Ω (⊙EM (S (S (S n)))) =⟨ ⊙ua (⊙≃-in (Trunc=-equiv _ _) idp) ⟩ ⊙Trunc ⟨ S (S n) ⟩ (⊙Ω (⊙Susp^ (S (S n)) X)) =⟨ ! (FS.⊙path n) ⟩ ⊙EM (S (S n)) ∎ abstract spectrum : (n : ℕ) → ⊙Ω (⊙EM (S n)) == ⊙EM n spectrum 0 = spectrum0 spectrum 1 = spectrum1 spectrum (S (S n)) = spectrumSS n module EMExplicit {i} (G : Group i) (G-abelian : is-abelian G) where module K₁ = EM₁ G module HSpace = EM₁HSpace G G-abelian open EMImplicit K₁.EM₁ K₁.EM₁-conn K₁.emlevel HSpace.H-EM₁ public open BelowDiagonal public using (πS-below) πS-diag : (n : ℕ) → πS n (⊙EM (S n)) == G πS-diag n = OnDiagonal.πS-diag n ∙ K₁.π₁.π₁-iso open AboveDiagonal public using (πS-above) open Spectrum public using (spectrum)
oeis/139/A139393.asm
neoneye/loda-programs
11
177075
<gh_stars>10-100 ; A139393: a(n) = Sum_{i=1..m} e(i) * 10^(m-i) where e(1) <= ... <= e(m) are the nonzero exponents in the prime factorization of n: a representation of the prime signature of n. ; Submitted by <NAME> ; 0,1,1,2,1,11,1,3,2,11,1,12,1,11,11,4,1,12,1,12,11,11,1,13,2,11,3,12,1,111,1,5,11,11,11,22,1,11,11,13,1,111,1,12,12,11,1,14,2,12,11,12,1,13,11,13,11,11,1,112,1,11,12,6,11,111,1,12,11,111,1,23,1,11,12,12,11,111,1,14,4,11,1,112,11,11,11,13,1,112,11,12,11,11,11,15,1,12,12,22 seq $0,37916 ; Concatenate exponents in prime factorization of n. seq $0,4185 ; Arrange digits of n in increasing order, then (for n>0) omit the zeros.
src/ada/src/common/uxas-common-string_constant-content_type.ads
VVCAS-Sean/OpenUxAS
88
22396
-- see OpenUxAS\src\Includes\Constants\UxAS_String.h package UxAS.Common.String_Constant.Content_Type is Json : constant String := "json"; Lmcp : constant String := "lmcp"; Text : constant String := "text"; Xml : constant String := "xml"; end UxAS.Common.String_Constant.Content_Type;
src/asm/Fonts.asm
fourstix/1802PixieVideoTTY
1
87576
; ********************************************************************************************* ; Copyright (c) 2020 ; by <NAME> ; ; Changes: ; <NAME>, July, 2020 - Put Font definations into separate file ; <NAME>, August, 2020 - Changed DEL to 1 pixel wide space ; ; Font definition ; ; The font has 96 printable characters, and requires 288 bytes of memory. ; ; The characters are encoded in standard ASCII, beginning with 20H and ending at 7FH. Each ; character has a height of 5 pixels and a variable width of 1 - 5 pixels. ; ; In order to save memory, the patterns of two characters have been combined into one. Without ; this, the complete 96 character font would have required 480 bytes. The 'left' character ; stands for the lower even ASCII code, the 'right' one for the following ; uneven ASCII code. The DrawCharacter subroutine will either mask the left character or ; shift the right one over to the position of the left one when a character is drawn. ; ; Each line defines two characters of variable width, together no more than 8 pixels. The ; first byte contains the width of each character. The upper four bits hold the width of ; the left character in the pattern, the lower four bits hold the width of the right character. ; ; The following five bytes contain the bit patterns of the characters. Beginning at the left ; (most significant) bit, the pattern of the left character (up to its specified width) is ; immediately followed by the bits of the right character. Any remaining bits to the right ; (if both characters together are less than 8 pixels wide) must be set to 0. ; ********************************************************************************************** Font: db 0011H, 0040H, 0040H, 0040H, 0000H, 0040H ; space and ! db 0035H, 00AAH, 00BFH, 000AH, 001FH, 000AH ; " and # db 0033H, 0074H, 00C4H, 0048H, 0070H, 00D4H ; $ and % db 0041H, 0048H, 00A8H, 0040H, 00A0H, 00D0H ; & and ' db 0022H, 0060H, 0090H, 0090H, 0090H, 0060H ; ( and ) db 0033H, 0000H, 00A8H, 005CH, 00A8H, 0000H ; * and + db 0022H, 0000H, 0000H, 0030H, 0040H, 0080H ; , and - db 0013H, 0010H, 0010H, 0020H, 0040H, 00C0H ; . and / db 0033H, 0048H, 00B8H, 00A8H, 00A8H, 005CH ; 0 and 1 db 0033H, 00D8H, 0024H, 0048H, 0084H, 00F8H ; 2 and 3 db 0033H, 003CH, 00B0H, 00F8H, 0024H, 0038H ; 4 and 5 db 0033H, 005CH, 0084H, 00C4H, 00A8H, 0048H ; 6 and 7 db 0033H, 0048H, 00B4H, 004CH, 00A4H, 0048H ; 8 and 9 db 0012H, 0000H, 0020H, 0080H, 0020H, 00C0H ; : and ; db 0032H, 0020H, 0058H, 0080H, 0058H, 0020H ; < and = db 0033H, 0088H, 0054H, 0024H, 0048H, 0088H ; > and ? db 0033H, 0048H, 00F4H, 009CH, 00B4H, 0054H ; @ and A db 0033H, 00CCH, 00B0H, 00D0H, 00B0H, 00CCH ; B and C db 0033H, 00DCH, 00B0H, 00B8H, 00B0H, 00DCH ; D and E db 0033H, 00ECH, 0090H, 00D0H, 0094H, 008CH ; F and G db 0033H, 00BCH, 00A8H, 00E8H, 00A8H, 00BCH ; H and I db 0033H, 0034H, 0034H, 0038H, 00B4H, 0054H ; J and K db 0035H, 0091H, 009BH, 0095H, 0091H, 00F1H ; L and M db 0043H, 009EH, 00DAH, 00BAH, 009AH, 009EH ; N and O db 0034H, 00DEH, 00B2H, 00D2H, 0096H, 009EH ; P and Q db 0033H, 00CCH, 00B0H, 00C8H, 00A4H, 00B8H ; R and S db 0033H, 00F4H, 0054H, 0054H, 0054H, 005CH ; T and U db 0035H, 00B1H, 00B1H, 00B1H, 00B5H, 004AH ; V and W db 0033H, 00B4H, 00B4H, 0048H, 00A8H, 00A8H ; X and Y db 0032H, 00F8H, 0030H, 0050H, 0090H, 00F8H ; Z and [ db 0032H, 0098H, 0088H, 0048H, 0028H, 0038H ; \ and ] db 0033H, 0040H, 00A0H, 0000H, 0000H, 001CH ; ^ and _ db 0023H, 0040H, 0098H, 0028H, 0028H, 0018H ; ' and a db 0033H, 0080H, 00CCH, 00B0H, 00B0H, 00CCH ; b and c db 0033H, 0020H, 006CH, 00B4H, 00B8H, 006CH ; d and e db 0023H, 0058H, 00A8H, 00F0H, 0088H, 00B0H ; f and g db 0031H, 0090H, 0080H, 00D0H, 00B0H, 00B0H ; h and i db 0023H, 0060H, 0028H, 0070H, 0068H, 00A8H ; j and k db 0025H, 0080H, 0094H, 00AAH, 00AAH, 006AH ; l and m db 0033H, 0000H, 00C8H, 00B4H, 00B4H, 00A8H ; n and o db 0033H, 0000H, 00CCH, 00B4H, 00CCH, 0084H ; p and q db 0023H, 0000H, 0058H, 00B0H, 0088H, 00B0H ; r and s db 0023H, 0080H, 00E8H, 00A8H, 00A8H, 0058H ; t and u db 0035H, 0000H, 00B1H, 00B5H, 00B5H, 004AH ; v and w db 0033H, 0000H, 00B4H, 004CH, 0044H, 00A8H ; x and y db 0033H, 000CH, 00E8H, 0030H, 0048H, 00ECH ; z and { db 0013H, 00E0H, 00A0H, 0090H, 00A0H, 00E0H ; | and } db 0041H, 0000H, 0050H, 00A0H, 0000H, 0000H ; ~ and DEL ;------------------------------------------------------------------------------------------
03-Tooling/01-system-event.applescript
Rolias/discover-applescript
0
1600
<reponame>Rolias/discover-applescript<filename>03-Tooling/01-system-event.applescript tell application "System Events" name of processes end tell
home/scrolling_menu.asm
Dev727/ancientplatinum
28
82601
ScrollingMenu:: call CopyMenuData ldh a, [hROMBank] push af ld a, BANK(_ScrollingMenu) ; aka BANK(_InitScrollingMenu) rst Bankswitch call _InitScrollingMenu call .UpdatePalettes call _ScrollingMenu pop af rst Bankswitch ld a, [wMenuJoypad] ret .UpdatePalettes: ld hl, wVramState bit 0, [hl] jp nz, UpdateTimePals jp SetPalettes InitScrollingMenu:: ld a, [wMenuBorderTopCoord] dec a ld b, a ld a, [wMenuBorderBottomCoord] sub b ld d, a ld a, [wMenuBorderLeftCoord] dec a ld c, a ld a, [wMenuBorderRightCoord] sub c ld e, a push de call Coord2Tile pop bc jp Textbox JoyTextDelay_ForcehJoyDown:: call DelayFrame ldh a, [hInMenu] push af ld a, $1 ldh [hInMenu], a call JoyTextDelay pop af ldh [hInMenu], a ldh a, [hJoyLast] and D_RIGHT + D_LEFT + D_UP + D_DOWN ld c, a ldh a, [hJoyPressed] and A_BUTTON + B_BUTTON + SELECT + START or c ld c, a ret
pygoslin/data/goslin/LipidMaps.g4
Fadi2200/pygoslin
8
4599
//////////////////////////////////////////////////////////////////////////////// // MIT License // // Copyright (c) 2017 <NAME> - dominik.kopczynski {at} isas.de // <NAME> - bing.peng {at} isas.de // <NAME> - nils.hoffmann {at} isas.de // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the 'Software'), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. //////////////////////////////////////////////////////////////////////////////// //// This is a BNF grammer for lipid subspecies identifiers followed by //// J.K. Pauling et al. 2017, PLoS One, 12(11):e0188394. grammar LipidMaps; /* first rule is always start rule */ lipid: lipid_rule EOF; lipid_rule: lipid_mono | lipid_mono isotope; lipid_mono: lipid_pure | lipid_pure isoform; lipid_pure: pure_fa | gl | pl | sl | pk | sterol | mediator; isoform: square_open_bracket isoform_inner square_close_bracket; isoform_inner : 'rac' | 'iso' | 'iso' number | 'R'; isotope: SPACE round_open_bracket element number round_close_bracket | DASH round_open_bracket element number round_close_bracket | DASH element number; element: 'd'; /* pure fatty acid */ pure_fa: hg_fa pure_fa_species | fa_no_hg; fa_no_hg: fa; pure_fa_species: round_open_bracket fa round_close_bracket | fa | round_open_bracket fa2 round_close_bracket; hg_fa: 'FA' | 'WE' | 'CoA' | 'CAR' | 'FAHFA' | 'CoA'; fa2 : fa2_unsorted | fa2_sorted; fa2_unsorted: fa DASH fa | fa UNDERSCORE fa; fa2_sorted: fa SLASH fa | fa BACKSLASH fa; fa3 : fa3_unsorted | fa3_sorted; fa3_unsorted: fa DASH fa DASH fa | fa UNDERSCORE fa UNDERSCORE fa; fa3_sorted: fa SLASH fa SLASH fa | fa BACKSLASH fa BACKSLASH fa; fa4 : fa4_unsorted | fa4_sorted; fa4_unsorted: fa DASH fa DASH fa DASH fa | fa UNDERSCORE fa UNDERSCORE fa UNDERSCORE fa; fa4_sorted: fa SLASH fa SLASH fa SLASH fa | fa BACKSLASH fa BACKSLASH fa BACKSLASH fa; lcb_fa_sorted: lcb SLASH fa | lcb BACKSLASH fa; species_fa : fa; /* glycerolipid rules */ gl: sgl | tgl; sgl: hg_sglc sgl_species | hg_sglc sgl_subspecies; sgl_species: round_open_bracket fa round_close_bracket | fa; sgl_subspecies: round_open_bracket fa2 round_close_bracket | fa2; tgl: hg_glc tgl_species | hg_glc tgl_subspecies; tgl_species: round_open_bracket fa round_close_bracket | fa; tgl_subspecies: round_open_bracket fa3 round_close_bracket | fa3; hg_sglc: hg_sgl | hg_sgl headgroup_separator; hg_sgl: 'MGDG' | 'DGDG' | 'SQDG' | 'SQMG' | 'DG' | 'DGCC' | 'PE-GlcDG'; hg_glc: hg_gl | hg_gl headgroup_separator; hg_gl: 'MG' | 'DG' | 'TG'; /* phospholipid rules */ pl: lpl | dpl | cl | fourpl | threepl; lpl: hg_lplc round_open_bracket fa_lpl round_close_bracket | hg_lplc fa_lpl; fa_lpl: fa | fa2; dpl: hg_ddpl dpl_species | hg_ddpl dpl_subspecies; dpl_species: round_open_bracket fa round_close_bracket | fa; dpl_subspecies: round_open_bracket fa2 round_close_bracket | fa2; cl: hg_clc cl_species | hg_clc cl_subspecies; cl_species: round_open_bracket fa round_close_bracket | fa; cl_subspecies: round_open_bracket '1\'-' square_open_bracket fa2 square_close_bracket ',3\'-' square_open_bracket fa2 square_close_bracket round_close_bracket | hg_clc '1\'-' square_open_bracket fa2 square_close_bracket ',3\'-' square_open_bracket fa2 square_close_bracket; fourpl: hg_fourplc round_open_bracket fa4 round_close_bracket | hg_fourplc fa4 | hg_fourplc round_open_bracket species_fa round_close_bracket | hg_fourplc species_fa; threepl: hg_threeplc round_open_bracket fa3 round_close_bracket | hg_threeplc fa3 | hg_threeplc round_open_bracket species_fa round_close_bracket | hg_threeplc species_fa; hg_ddpl: hg_dplc pip_position | hg_dplc; hg_clc: hg_cl | hg_cl headgroup_separator; hg_cl: 'CL'; hg_dplc: hg_dpl | hg_dpl headgroup_separator; hg_dpl: 'LBPA' | 'CDP-DG' | 'DMPE' | 'MMPE' | 'PA' | 'PC' | 'PE' | 'PEt' | 'PG' | 'PI' | 'PIP' | 'PIP2' | 'PIP3' | 'PS' | 'PIM1' | 'PIM2' | 'PIM3' | 'PIM4' | 'PIM5' | 'PIM6' | 'Glc-DG' | 'PGP' | 'PE-NMe2' | 'AC2SGL' | 'DAT' | 'PE-NMe' | 'PT' | 'Glc-GP' | 'PPA' | 'PnC' | 'PnE' | '6-Ac-Glc-GP'; hg_lplc: hg_lpl | hg_lpl headgroup_separator; hg_lpl: 'LysoPC' | 'LPC' | 'LysoPE' | 'LPE' | 'LPI' | 'LPG' | 'LPS' | 'LPIM1' | 'LPIM2' | 'LPIM3' | 'LPIM4' | 'LPIM5' | 'LPIM6' | 'CPA' | 'LPA'; hg_fourplc: hg_fourpl | hg_fourpl headgroup_separator; hg_fourpl: 'PAT16' | 'PAT18'; pip_position: square_open_bracket pip_pos square_close_bracket; pip_pos: pip_pos COMMA pip_pos | number '\''; hg_threeplc: hg_threepl | hg_threepl headgroup_separator; hg_threepl: 'SLBPA' | 'PS-NAc' | 'NAPE'; /* sphingolipid rules */ sl: lsl | dsl | sphingoxine; lsl: hg_lslc round_open_bracket lcb round_close_bracket | hg_lslc lcb; dsl: hg_dslc dsl_species | hg_dslc dsl_subspecies; dsl_species: round_open_bracket lcb round_close_bracket | lcb; dsl_subspecies: round_open_bracket lcb_fa_sorted round_close_bracket | lcb_fa_sorted; sphingoxine: sphingoxine_pure | sphingoxine_var; sphingoxine_pure: sphingosine_name | sphinganine_name; sphingoxine_var: ctype headgroup_separator sphingosine_name | ctype headgroup_separator sphinganine_name; sphingosine_name: 'Sphingosine' | 'So' | 'Sphingosine-1-phosphate'; sphinganine_name: 'Sphinganine' | 'Sa' | 'Sphinganine-1-phosphate'; ctype: 'C' number; hg_dslc: hg_dsl | hg_dsl headgroup_separator; hg_dsl: 'Cer' | 'CerP' | 'EPC' | 'GB3' | 'GB4' | 'GD3' | 'GM3' | 'GM4' | 'Hex3Cer' | 'Hex2Cer' | 'HexCer' | 'IPC' | 'M(IP)2C' | 'MIPC' | 'SHexCer' | 'SulfoHexCer' | 'SM' | 'PE-Cer' | 'PI-Cer' | 'GlcCer' | 'FMC-5' | 'FMC-6' | 'LacCer' | 'GalCer' | 'C1P' | special_cer; special_cer : special_cer_prefix '-Cer'; special_cer_prefix : '1-O-' special_cer_prefix_1_O | '(3\'-sulfo)Galbeta'; special_cer_prefix_1_O : 'myristoyl' | 'palmitoyl' | 'stearoyl' | 'eicosanoyl' | 'behenoyl' | 'lignoceroyl' | 'cerotoyl' | 'carboceroyl' | 'tricosanoyl'; hg_lslc: hg_lsl | hg_lsl headgroup_separator; hg_lsl: 'SPH' | 'Sph' | 'S1P' | 'HexSph' | 'SPC' | 'SPH-P' | 'LysoSM' | 'SIP'; /* polyketides */ pk : pk_hg pk_fa; pk_hg : 'RESORCINOL' | 'ANACARD' | 'PHENOL' | 'CATECHOL'; pk_fa : round_open_bracket fa round_close_bracket; /* sterol lipids */ sterol: chc | chec; chc: ch | ch headgroup_separator; ch: 'Cholesterol'; chec: che | che headgroup_separator | che_fa; che: fa headgroup_separator hg_che; che_fa: hg_che round_open_bracket fa round_close_bracket; hg_che: 'Cholesteryl ester' | 'Cholesterol ester' | 'CE'; /* mediator lipids */ mediator: mediator_var | mediator_const; mediator_var: mediator_prefix mediator_name_separator mediator_var_names | '(+/-)-' mediator_prefix mediator_name_separator mediator_var_names; mediator_prefix: mediator_numbers | mediator_prefix mediator_prefix; mediator_numbers: mediator_numbers mediator_separator mediator_numbers | mediator_number_pure | mediator_number_pure mediator_pos; mediator_number_pure: number | round_open_bracket number round_close_bracket; mediator_pos: 'R' | 'S'; mediator_var_names: mediator_var_name | mediator_oxo '-' mediator_var_name; mediator_var_name: 'HHTrE' | 'EpOME' | 'HODE' | 'HOTrE' | 'DHET' | 'EET' | 'EpETE' | 'HEPE' | 'HETE' | 'PGJ2' | 'HDoHE' | 'HpETE' | 'ETE' | 'DiHETE' | 'LXA4'; mediator_const: 'Arachidonic acid' | 'Arachidonic Acid' | 'alpha-LA' | 'DHA' | 'EPA' | 'Linoleic acid' | 'LTB4' | 'LTC4' | 'LTD4' | 'Maresin 1' | 'Palmitic acid' | 'PGB2' | 'PGD2' | 'PGE2' | 'PGF2alpha' | 'PGI2' | 'Resolvin D1' | 'Resolvin D2' | 'Resolvin D3' | 'Resolvin D5' | 'tetranor-12-HETE' | 'TXB1' | 'TXB2' | 'TXB3'; mediator_oxo: 'Oxo' | 'oxo'; /* generic rules */ fa: fa_unmod | fa_unmod fa_mod | fa_unmod fa_mod_separator fa_mod; fa_unmod: round_open_bracket ether fa_pure round_close_bracket | round_open_bracket fa_pure round_close_bracket | ether fa_pure | fa_pure; fa_mod: round_open_bracket modification round_close_bracket; modification: modification ',' modification | number mod_text | mod_text; mod_text: mod_text mod_text | square_open_bracket mod_text square_close_bracket | 'OH' | 'Ke' | 'S' | 'OOH' | 'My' | 'Me' | 'R' | 'Br' | 'CHO' | 'COOH' | 'Cp' | '(R)' | 'Ep' | 'OH2' | 'OH3' | 'OH4' | 'OH6' | 'cyclo' | 'cyclo2' | 'KE2' | 'Ke2' | 'NH2' | 'Me6' | 'Me2' | 'Me3' | 'Y'; ether: 'P-' | 'O-'; fa_pure: carbon carbon_db_separator db | carbon carbon_db_separator db db_hydroxyl_separator hydroxyl; lcb_fa: lcb_fa_unmod | lcb_fa_unmod lcb_fa_mod; lcb_fa_unmod: carbon carbon_db_separator db; lcb_fa_mod: round_open_bracket modification round_close_bracket; lcb: hydroxyl_lcb lcb_fa | lcb_fa; carbon: number; db : db_count | db_count db_positions; db_count : number; db_positions : ROB db_position RCB; db_position : db_single_position | db_position db_position_separator db_position; db_single_position : db_position_number | db_position_number cistrans; db_position_number : number; cistrans : 'E' | 'Z'; hydroxyl: number; hydroxyl_lcb: 'm' | 'd' | 't'; number: '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | number number; /* separators */ SPACE : ' '; COLON : ':'; SEMICOLON : ';'; DASH : '-'; UNDERSCORE : '_'; SLASH : '/'; BACKSLASH : '\\'; COMMA: ','; ROB: '('; RCB: ')'; SOB: '['; SCB: ']'; fa_separator: UNDERSCORE | SLASH | BACKSLASH | DASH; headgroup_separator: SPACE; fa_mod_separator: SPACE; carbon_db_separator: COLON; db_hydroxyl_separator: SEMICOLON; db_position_separator: COMMA; mediator_separator: COMMA; mediator_name_separator: DASH; round_open_bracket: ROB; round_close_bracket: RCB; square_open_bracket: SOB; square_close_bracket: SCB;
special_keys/expose.scpt
caius/special_keys
0
2516
-- Expose key is code 160 tell application "System Events" to key code 160
libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_unlink.asm
jpoikela/z88dk
640
170587
<filename>libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_unlink.asm ; unsigned char esx_f_unlink(unsigned char *filename) SECTION code_esxdos PUBLIC esx_f_unlink EXTERN asm_esx_f_unlink defc esx_f_unlink = asm_esx_f_unlink ; SDCC bridge for Classic IF __CLASSIC PUBLIC _esx_f_unlink defc _esx_f_unlink = esx_f_unlink ENDIF
alloy4fun_models/trainstlt/models/5/47kGb6MLfvciY5Edz.als
Kaixi26/org.alloytools.alloy
0
2461
<filename>alloy4fun_models/trainstlt/models/5/47kGb6MLfvciY5Edz.als open main pred id47kGb6MLfvciY5Edz_prop6 { always Signal != Signal' } pred __repair { id47kGb6MLfvciY5Edz_prop6 } check __repair { id47kGb6MLfvciY5Edz_prop6 <=> prop6o }