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 |
|---|---|---|---|---|
agda-stdlib/src/Text/Tabular/Base.agda | DreamLinuxer/popl21-artifact | 5 | 16511 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- Fancy display functions for List-based tables
--
-- The functions in this module assume some (unenforced) invariants.
-- If you cannot guarantee that your data respects these invariants,
-- you should instead use Text.Tabular.List.
------------------------------------------------------------------------
{-# OPTIONS --safe --without-K #-}
module Text.Tabular.Base where
open import Data.Bool.Base using (if_then_else_)
open import Data.Char.Base using (Char)
open import Data.List.Base as List
using (List; []; _∷_; _?∷_; _++_; _∷ʳ?_; null; map; intersperse)
open import Data.Maybe.Base as Maybe using (Maybe; nothing; just; maybe)
open import Data.Nat.Base
open import Data.String.Base as String
using (String; fromChar; unlines; replicate; length)
open import Function.Base
open import Agda.Builtin.Equality
open String
using ( Alignment
; Left
; Center
; Right
) public
record TabularLine : Set where
field
left : Maybe String
cont : Maybe Char
sep : String
right : Maybe String
open TabularLine
record TabularConfig : Set where
field
top : Maybe TabularLine
sep : Maybe TabularLine
row : TabularLine
bot : Maybe TabularLine
open TabularConfig
unicode : TabularConfig
unicode .top = just λ where
.left → just "┌"
.cont → just '─'
.sep → "┬"
.right → just "┐"
unicode .sep = just λ where
.left → just "├"
.cont → just '─'
.sep → "┼"
.right → just "┤"
unicode .row = λ where
.left → just "│"
.cont → nothing
.sep → "│"
.right → just "│"
unicode .bot = just λ where
.left → just "└"
.cont → just '─'
.sep → "┴"
.right → just "┘"
ascii : TabularConfig
ascii .top = just λ where
.left → just "+"
.cont → just '-'
.sep → "-"
.right → just "+"
ascii .sep = just λ where
.left → just "|"
.cont → just '-'
.sep → "+"
.right → just "|"
ascii .row = λ where
.left → just "|"
.cont → nothing
.sep → "|"
.right → just "|"
ascii .bot = just λ where
.left → just "+"
.cont → just '-'
.sep → "-"
.right → just "+"
compact : TabularConfig → TabularConfig
compact c = record c { sep = nothing }
private
dropBorder : TabularLine → TabularLine
dropBorder l = record l { left = nothing; right = nothing }
noBorder : TabularConfig → TabularConfig
noBorder c .top = nothing
noBorder c .sep = Maybe.map dropBorder (c .sep)
noBorder c .row = dropBorder (c .row)
noBorder c .bot = nothing
private
space : TabularLine → TabularLine
space l = let pad = maybe fromChar " " (l .cont) in λ where
.left → Maybe.map (String._++ pad) (l .left)
.cont → l .cont
.sep → pad String.++ l .sep String.++ pad
.right → Maybe.map (pad String.++_) (l .right)
addSpace : TabularConfig → TabularConfig
addSpace c .top = Maybe.map space (c .top)
addSpace c .sep = Maybe.map space (c .sep)
addSpace c .row = space (c .row)
addSpace c .bot = Maybe.map space (c .bot)
whitespace : TabularConfig
whitespace .top = nothing
whitespace .sep = nothing
whitespace .row = λ where
.left → nothing
.cont → nothing
.sep → " "
.right → nothing
whitespace .bot = nothing
-- /!\ Invariants:
-- * the table is presented as a list of rows
-- * header has the same length as each one of the rows
-- i.e. we have a rectangular table
-- * all of the strings in a given column have the same length
unsafeDisplay : TabularConfig → List (List String) → List String
unsafeDisplay _ [] = []
unsafeDisplay c (header ∷ rows) =
map String.concat $ th ++ (trs ∷ʳ? lbot) where
cellsOf : Maybe Char → List String → List String
cellsOf nothing = id
cellsOf (just c) = map (λ cell → replicate (length cell) c)
lineOf : TabularLine → List String → List String
lineOf l xs = l .left
?∷ intersperse (l .sep) (cellsOf (l .cont) xs)
∷ʳ? l .right
mlineOf : Maybe TabularLine → List String → Maybe (List String)
mlineOf l xs = Maybe.map (λ l → lineOf l xs) l
ltop : Maybe (List String)
lsep : Maybe (List String)
tr : List String → List String
lbot : Maybe (List String)
ltop = mlineOf (c. top) header
lsep = mlineOf (c. sep) header
tr = lineOf (c. row)
lbot = mlineOf (c. bot) header
th = ltop ?∷ tr header ∷ []
trs = if null rows then id else (maybe _∷_ id lsep)
$ maybe intersperse id lsep
$ map tr rows
|
base/new/entrance/warden/unit0/res/zzzhead_64.asm | frednora/gramado | 609 | 17714 | <reponame>frednora/gramado<filename>base/new/entrance/warden/unit0/res/zzzhead_64.asm
;;
;; File: 1pump/arch/x86/pumpcore/head_64.asm
;;
;; The entry point of the base kernel for the x86_64 arch.
;; This documment will includo some other files.
;;
;; 2021 - Created by <NAME>.
;; - ported from the 32bit version
;;
; See:
; kernel/include/land/
%include "land/head.inc"
;
; Segmento .head_x86_64:
; Parte inicial do kernel.
; Esse marcador precisa ficar no começo do arquivo.
;
; segment .head_x86_64
__HEAD
[bits 64]
; Imports.
extern _code_begin
extern _data_end
extern _bss_end
; Multiboot support.
MULTIBOOT_MAGIC equ 0x1badb002
MULTIBOOT_PAGE_ALIGN equ 0x1
MULTIBOOT_MEMORY_INFO equ 0x2
MULTIBOOT_VIDEO_MODE equ 0x4
multiboot_flags equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_VIDEO_MODE
multiboot_checksum equ -(MULTIBOOT_MAGIC + multiboot_flags)
;;==================================
;; _kernel_begin:
;; Boot x86_64 entry point.
;; The kernel starts here for x86_64 arch.
;;
global _kernel_begin
_kernel_begin:
; #bugbug
; Porque estamos usando um jmp, sem nem mesmo configurarmos
; os registradores de segmento. Estamos confiando na configuração
; feita pelo BL.BIN.
; Bom mesmos seria começarmos com a configuração da gdt e dos
; registradores de segmento.
; #todo
; Precismos carregar a gdt o mais rápido possível.
.Lheadhang:
cli
hlt
JMP .Lheadhang
; #todo
; Ainda não sei se é possivel realizar esse salto.
; Então vamos parar por aqui.
JMP START
align 4
;; =============================================================
mboot_start:
; +-------------------+
;0 | magic: 0x1BADB002 | (required)
;4 | flags | (required)
;8 | checksum | (required)
; +-------------------+
;8 | header_addr | (present if flags[16] is set)
;12 | load_addr | (present if flags[16] is set)
;16 | load_end_addr | (present if flags[16] is set)
;20 | bss_end_addr | (present if flags[16] is set)
;24 | entry_addr | (present if flags[16] is set)
; +-------------------+
dd MULTIBOOT_MAGIC
dd multiboot_flags
dd multiboot_checksum
; fields used if MULTIBOOT_AOUT_KLUDGE is set in
; MULTIBOOT_HEADER_FLAGS
; for MULTIBOOT_MEMORY_INFO
dd 0x00000000 ;; header_addr - mboot_start ; these are PHYSICAL addresses
dd 0x00000000 ;; load_addr - _code_begin ; start of kernel .text (code) section
dd 0x00000000 ;; load_end_addr - _data_end ; end of kernel .data section
dd 0x00000000 ;; bss_end_addr - _bss_end ; end of kernel BSS
dd 0x00000000 ;; entry_addr - _kernel_begin ; kernel entry point (initial EIP)
; for MULTIBOOT_VIDEO_MODE
dd 0x00000000 ;; mode_type
dd 800 ;; width
dd 600 ;; height
dd 24 ;; depth
mboot_end:
;; =============================================================
align 4
%include "head/header.inc"
;; ...
; Restart the boot routine.
START:
cld
cli
; IN:
; al = 'G' (Graphic Mode).
; al = 'T' (Text Mode).
; ebx = LFB.
; ecx = BootBlock pointer.
; edx = BootBlock pointer.
; ebp = BootBlock pointer.
; #importante
; AL e EBX foram configurados pelo BL.BIN ??
; See: head.asm
;call head_init
jmp head_init
; Not reached
not_reached_loop:
cli
hlt
jmp not_reached_loop
; Includes:
; ========
; Esses includes são padronizados. Não acrescentar outros.
; Inicialização.
; Funções de apoio à inicialização do Kernel 32bit.
%include "head/head.asm"
%include "head/headlib.asm"
; Interrupções de hardware (irqs) e faults.
%include "hw/hw.asm"
%include "hw/hwlib.asm"
; Interrupções de software.
%include "sw/sw.asm"
%include "sw/swlib.asm"
;=================================================================
; DATA:
; Início do Segmento de dados.
; Coloca uma assinatura no todo.
segment .data
global _data_start
_data_start:
db 0x55
db 0xAA
;=================================================================
; BSS:
; Início do segmento BSS.
; Coloca uma assinatura no todo.
; Mas normalmente limpamos essa área.
segment .bss
global _bss_start
_bss_start:
;db 0x55
;db 0xAA
;
; End
;
|
oeis/112/A112341.asm | neoneye/loda-programs | 11 | 23979 | ; A112341: Number of primes between (prime(n)-1)^2 and prime(n)^2.
; Submitted by <NAME>
; 2,2,3,4,5,5,7,6,7,9,8,9,12,9,10,16,13,16,15,21,15,18,19,18,21,23,20,24,23,25,29,28,23,27,33,32,27,32,33,30,29,36,34,37,37,37,38,41,45,38,39,49,47,45,53,46,53,46,45,49,53,51,48,49,55,51,62,66,61,61,60,66,63,61
seq $0,6093 ; a(n) = prime(n) - 1.
seq $0,14085 ; Number of primes between n^2 and (n+1)^2.
|
programs/oeis/074/A074529.asm | neoneye/loda | 22 | 177098 | <reponame>neoneye/loda
; A074529: a(n) = 2^n + 3^n + 7^n.
; 3,12,62,378,2498,17082,118442,825858,5771618,40373802,282535322,1977505938,13841822738,96890612922,678227872202,4747575891618,33232973681858,232630643258442,1628413985593082,11398896348158898,79792269785444978,558545874545734362,3909821079968241962,27368747434232483778,191581231663012728098,1341068620511287064682,9387480340189687242842,65712362371160011842258,459986536567617021867218,3219905755881810641073402,22539340290898150293699722,157775382035463482158810338,1104427674245773670789118338,7730993719713003593293584522,54116956037968788867839196602,378818692265714813262176364018,2651730845859803566483039857458,18562115921018024586496493622042,129934811447124370969164696597482,909543680129865193375907794679298,6366805760909040143407993707780578,44567640326363232373188622168609962,311973482284542480720323851380846362
mov $3,$0
seq $0,74509 ; a(n) = 1^n + 3^n + 7^n.
add $0,6
mov $4,2
pow $4,$3
mov $2,$4
add $2,2
add $0,$2
sub $0,9
|
src/gl/interface/gl-uniforms.ads | Roldak/OpenGLAda | 79 | 6800 | -- part of OpenGLAda, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "COPYING"
with GL.Types; use GL.Types;
package GL.Uniforms is
pragma Preelaborate;
type Uniform is new Int;
procedure Set_Single (Location : Uniform; Value : Single);
procedure Set_Single (Location : Uniform; V1, V2 : Single);
procedure Set_Single (Location : Uniform; Value : Singles.Vector2);
procedure Set_Single (Location : Uniform; V1, V2, V3 : Single);
procedure Set_Single (Location : Uniform; Value : Singles.Vector3);
procedure Set_Single (Location : Uniform; V1, V2, V3, V4 : Single);
procedure Set_Single (Location : Uniform; Value : Singles.Vector4);
procedure Set_Single (Location : Uniform; Value : Single_Array);
procedure Set_Single (Location : Uniform; Value : Singles.Vector2_Array);
procedure Set_Single (Location : Uniform; Value : Singles.Vector3_Array);
procedure Set_Single (Location : Uniform; Value : Singles.Vector4_Array);
procedure Set_Single (Location : Uniform; Value : Singles.Matrix2);
procedure Set_Single (Location : Uniform; Value : Singles.Matrix3);
procedure Set_Single (Location : Uniform; Value : Singles.Matrix4);
procedure Set_Single (Location : Uniform; Value : Singles.Matrix2_Array);
procedure Set_Single (Location : Uniform; Value : Singles.Matrix3_Array);
procedure Set_Single (Location : Uniform; Value : Singles.Matrix4_Array);
procedure Set_Int (Location : Uniform; Value : Int);
procedure Set_Int (Location : Uniform; V1, V2 : Int);
procedure Set_Int (Location : Uniform; Value : Ints.Vector2);
procedure Set_Int (Location : Uniform; V1, V2, V3 : Int);
procedure Set_Int (Location : Uniform; Value : Ints.Vector3);
procedure Set_Int (Location : Uniform; V1, V2, V3, V4 : Int);
procedure Set_Int (Location : Uniform; Value : Ints.Vector4);
procedure Set_Int (Location : Uniform; Value : Int_Array);
procedure Set_Int (Location : Uniform; Value : Ints.Vector2_Array);
procedure Set_Int (Location : Uniform; Value : Ints.Vector3_Array);
procedure Set_Int (Location : Uniform; Value : Ints.Vector4_Array);
procedure Set_Int (Location : Uniform; Value : Ints.Matrix2);
procedure Set_Int (Location : Uniform; Value : Ints.Matrix3);
procedure Set_Int (Location : Uniform; Value : Ints.Matrix4);
procedure Set_Int (Location : Uniform; Value : Ints.Matrix2_Array);
procedure Set_Int (Location : Uniform; Value : Ints.Matrix3_Array);
procedure Set_Int (Location : Uniform; Value : Ints.Matrix4_Array);
procedure Set_UInt (Location : Uniform; Value : UInt);
procedure Set_UInt (Location : Uniform; V1, V2 : UInt);
procedure Set_UInt (Location : Uniform; Value : UInts.Vector2);
procedure Set_UInt (Location : Uniform; V1, V2, V3 : UInt);
procedure Set_UInt (Location : Uniform; Value : UInts.Vector3);
procedure Set_UInt (Location : Uniform; V1, V2, V3, V4 : UInt);
procedure Set_UInt (Location : Uniform; Value : UInts.Vector4);
procedure Set_UInt (Location : Uniform; Value : UInt_Array);
procedure Set_UInt (Location : Uniform; Value : UInts.Vector2_Array);
procedure Set_UInt (Location : Uniform; Value : UInts.Vector3_Array);
procedure Set_UInt (Location : Uniform; Value : UInts.Vector4_Array);
procedure Set_UInt (Location : Uniform; Value : UInts.Matrix2);
procedure Set_UInt (Location : Uniform; Value : UInts.Matrix3);
procedure Set_UInt (Location : Uniform; Value : UInts.Matrix4);
procedure Set_UInt (Location : Uniform; Value : UInts.Matrix2_Array);
procedure Set_UInt (Location : Uniform; Value : UInts.Matrix3_Array);
procedure Set_UInt (Location : Uniform; Value : UInts.Matrix4_Array);
end GL.Uniforms;
|
alloy4fun_models/trainstlt/models/10/X3ZzWDsLN7pnHzT56.als | Kaixi26/org.alloytools.alloy | 0 | 4062 | <gh_stars>0
open main
pred idX3ZzWDsLN7pnHzT56_prop11 {
always (all t:pos.Track | once t.pos in Entry)
}
pred __repair { idX3ZzWDsLN7pnHzT56_prop11 }
check __repair { idX3ZzWDsLN7pnHzT56_prop11 <=> prop11o } |
_build/dispatcher/jmp_ippsSHA512Duplicate_8edb123b.asm | zyktrcn/ippcp | 1 | 98069 | extern m7_ippsSHA512Duplicate:function
extern n8_ippsSHA512Duplicate:function
extern y8_ippsSHA512Duplicate:function
extern e9_ippsSHA512Duplicate:function
extern l9_ippsSHA512Duplicate:function
extern n0_ippsSHA512Duplicate:function
extern k0_ippsSHA512Duplicate:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsSHA512Duplicate
.Larraddr_ippsSHA512Duplicate:
dq m7_ippsSHA512Duplicate
dq n8_ippsSHA512Duplicate
dq y8_ippsSHA512Duplicate
dq e9_ippsSHA512Duplicate
dq l9_ippsSHA512Duplicate
dq n0_ippsSHA512Duplicate
dq k0_ippsSHA512Duplicate
segment .text
global ippsSHA512Duplicate:function (ippsSHA512Duplicate.LEndippsSHA512Duplicate - ippsSHA512Duplicate)
.Lin_ippsSHA512Duplicate:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsSHA512Duplicate:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsSHA512Duplicate]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsSHA512Duplicate:
|
demo2/adademo2.adb | MatrixMike/AdaDemo1 | 1 | 14905 | with Ada.Text_IO; use Ada.Text_IO;
procedure adademo2 is
type Day_type is range 1 .. 31;
type Month_type is range 1 .. 12;
type Year_type is range 1800 .. 2100;
type Hours is mod 24;
type Weekday is
(Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday);
type Date is record
Day : Day_type;
Month : Month_type;
Year : Year_type;
end record;
subtype Working_Hours is
Hours range 0 .. 12; -- at most 12 Hours to work a day
subtype Working_Day is Weekday range Monday .. Friday; -- Days to work
--begin
--Work_Load: constant array(Working_Day) of Working_Hours -- implicit type declaration
-- := (Friday => 6, Monday => 4, others => 10); -- lookup table for working hours with initialization
-- while a is not equal to b, loop.
--while a /= b loop
-- Ada.Text_IO.Put_Line ("Waiting");
--end loop;
--make into a procedure or function
--if a > b then
-- Ada.Text_IO.Put_Line ("Condition met");
--else
-- Ada.Text_IO.Put_Line ("Condition not met");
--end if;
begin
--loop
-- a := a + 1; how to define a
-- exit when a = 10;
--end loop;
for aWeekday in Weekday'Range loop -- loop over an enumeration
Put_Line
(Weekday'Image
(aWeekday)); -- output string representation of an enumeration
if aWeekday in
Working_Day
then -- check of a subtype of an enumeration
Put_Line (" to work for "); --&
-- Working_Hours'Image (Work_Load(aWeekday)) ); -- access into a lookup table
end if;
end loop;
end adademo2;
|
Index-Adress-Mode-Example.asm | utkudarilmaz/x86-Examples | 1 | 20722 | ; Verilen veri setindeki 2. indisteki sayiyi hedef adrese kopyalanmasi
data segment
tablo DB 10,20,30,40,50
veri DB ?
ends
stack segment
dw 128 dup(0)
ends
code segment
start:
; set segment registers:
mov ax, data
mov ds, ax
mov si,2
mov bl,tablo[si] ; tablo veri setinin 2. indisindeki verinin bl
; kaydedicisine aktarilmasi
lea di,veri ; Hedef adres ayarlanmasi
mov [di],bl
mov ax, 4c00h ; exit to operating system.
int 21h
ends
end start ; set entry point and stop the assembler.
|
test/Succeed/Issue3167.agda | cruhland/agda | 1,989 | 3771 | <reponame>cruhland/agda
-- Andreas, 2018-09-12, issue #3167
--
-- If --no-prop, then Set0 is the least sort and sort constraints
-- s <= Set0 should be solved by s = Set0.
{-# OPTIONS --no-prop #-}
-- (A : Set) can be inferred if Set0 is the bottom universe
data Wrap A : Set where
wrap : A → Wrap A
-- Should succeed with --no-prop
|
oeis/083/A083072.asm | neoneye/loda-programs | 11 | 160233 | ; A083072: A subdiagonal of number array A083064.
; Submitted by <NAME>
; 1,4,29,286,3511,51668,888889,17538454,390892451,9720791092,267004296901,8031916155134,262709978263279,9285541905849316,352765522430193905,14337731083770642838,620867368421052631579
mov $1,2
mov $2,$0
add $0,4
lpb $2
sub $1,1
mul $1,$0
sub $2,1
lpe
mov $0,$1
sub $0,1
|
alloy4fun_models/trashltl/models/11/JSWwpWHCnvBZAwQt9.als | Kaixi26/org.alloytools.alloy | 0 | 2433 | <filename>alloy4fun_models/trashltl/models/11/JSWwpWHCnvBZAwQt9.als
open main
pred idJSWwpWHCnvBZAwQt9_prop12 {
eventually some f:File | f not in Trash implies f in Trash'
}
pred __repair { idJSWwpWHCnvBZAwQt9_prop12 }
check __repair { idJSWwpWHCnvBZAwQt9_prop12 <=> prop12o } |
extern/game_support/stm32f4/src/stm32f4-fmc.ads | AdaCore/training_material | 15 | 7684 | <gh_stars>10-100
with System;
package STM32F4.FMC is
FMC_Bank1_SDRAM : constant := 16#00000000#;
FMC_Bank2_SDRAM : constant := 16#00000001#;
FMC_Bank1_NORSRAM1 : constant := 16#00000000#;
FMC_Bank1_NORSRAM2 : constant := 16#00000002#;
FMC_Bank1_NORSRAM3 : constant := 16#00000004#;
FMC_Bank1_NORSRAM4 : constant := 16#00000006#;
FMC_Bank2_NAND : constant := 16#00000010#;
FMC_Bank3_NAND : constant := 16#00000100#;
FMC_Bank4_PCCARD : constant := 16#00001000#;
FMC_RowBits_Number_11b : constant := 16#00000000#;
FMC_RowBits_Number_12b : constant := 16#00000004#;
FMC_RowBits_Number_13b : constant := 16#00000008#;
FMC_ColumnBits_Number_8b : constant := 16#0000_0000#;
FMC_ColumnBits_Number_9b : constant := 16#0000_0001#;
FMC_ColumnBits_Number_10b : constant := 16#0000_0002#;
FMC_ColumnBits_Number_11b : constant := 16#0000_0003#;
FMC_SDMemory_Width_8b : constant := 16#0000_0000#;
FMC_SDMemory_Width_16b : constant := 16#0000_0010#;
FMC_SDMemory_Width_32b : constant := 16#0000_0020#;
FMC_InternalBank_Number_2 : constant := 16#0000_0000#;
FMC_InternalBank_Number_4 : constant := 16#0000_0040#;
FMC_CAS_Latency_1 : constant := 16#0000_0080#;
FMC_CAS_Latency_2 : constant := 16#0000_0100#;
FMC_CAS_Latency_3 : constant := 16#0000_0180#;
FMC_Write_Protection_Disable : constant := 16#0000_0000#;
FMC_Write_Protection_Enable : constant := 16#0000_0200#;
FMC_SDClock_Disable : constant := 16#0000_0000#;
FMC_SDClock_Period_2 : constant := 16#0000_0800#;
FMC_SDClock_Period_3 : constant := 16#0000_0C00#;
FMC_Read_Burst_Disable : constant := 16#0000_0000#;
FMC_Read_Burst_Enable : constant := 16#0000_1000#;
FMC_ReadPipe_Delay_0 : constant := 16#0000_0000#;
FMC_ReadPipe_Delay_1 : constant := 16#0000_2000#;
FMC_ReadPipe_Delay_2 : constant := 16#0000_4000#;
FMC_Command_Mode_Normal : constant := 16#0000_0000#;
FMC_Command_Mode_CLK_Enabled : constant := 16#0000_0001#;
FMC_Command_Mode_PALL : constant := 16#0000_0002#;
FMC_Command_Mode_AutoRefresh : constant := 16#0000_0003#;
FMC_Command_Mode_LoadMode : constant := 16#0000_0004#;
FMC_Command_Mode_Selfrefresh : constant := 16#0000_0005#;
FMC_Command_Mode_PowerDown : constant := 16#0000_0006#;
FMC_Command_Target_Bank2 : constant := 16#0000_0008#;
FMC_Command_Target_Bank1 : constant := 16#0000_0010#;
FMC_Command_Target_Bank1_2 : constant := 16#0000_0018#;
FMC_NormalMode_Status : constant := 16#0000_0000#;
-- FMC_SelfRefreshMode_Status : constant := FMC_SDSR_MODES1_0;
-- FMC_PowerDownMode_Status : constant := FMC_SDSR_MODES1_1;
FMC_IT_RisingEdge : constant := 16#0000_0008#;
FMC_IT_Level : constant := 16#0000_0010#;
FMC_IT_FallingEdge : constant := 16#0000_0020#;
FMC_IT_Refresh : constant := 16#0000_4000#;
FMC_FLAG_RisingEdge : constant := 16#0000_0001#;
FMC_FLAG_Level : constant := 16#0000_0002#;
FMC_FLAG_FallingEdge : constant := 16#0000_0004#;
FMC_FLAG_FEMPT : constant := 16#0000_0040#;
FMC_FLAG_Refresh : constant := 16#0000_0001#;
FMC_FLAG_Busy : constant := 16#0000_0020#;
type Word_x2 is array (0 .. 1) of Word with Pack, Size => 2 * 32;
FMC_Base : constant := 16#A000_0000#;
FMC_Bank1_R_BASE : constant := FMC_BASE + 16#0000#;
FMC_Bank1E_R_BASE : constant := FMC_BASE + 16#0104#;
FMC_Bank2_R_BASE : constant := FMC_BASE + 16#0060#;
FMC_Bank3_R_BASE : constant := FMC_BASE + 16#0080#;
FMC_Bank4_R_BASE : constant := FMC_BASE + 16#00A0#;
FMC_Bank5_6_R_BASE : constant := FMC_BASE + 16#0140#;
type FMC_Bank1_Registers is array (1 .. 8) of Word with Pack;
Bank1 : FMC_Bank1_Registers
with Volatile, Address => System'To_Address (FMC_Bank1_R_BASE);
type FMC_Bank1E_Registers is array (1 .. 7) of Word with Pack;
Bank1E : FMC_Bank1E_Registers
with Volatile, Address => System'To_Address (FMC_Bank1E_R_BASE);
type FMC_Bank2_3_Registers is record
PCR : Word;
SR : Word;
PMEM : Word;
PATT : Word;
Reserved : Word;
ECCR : Word;
end record with Pack, Size => 6 * 32;
Bank2 : FMC_Bank2_3_Registers
with Volatile, Address => System'To_Address (FMC_Bank2_R_BASE);
Bank3 : FMC_Bank2_3_Registers
with Volatile, Address => System'To_Address (FMC_Bank3_R_BASE);
type FMC_Bank4_Registers is record
PCR : Word;
SR : Word;
PMEM : Word;
PATT : Word;
PIO : Word;
end record with Pack, Size => 5 * 32;
Bank4 : FMC_Bank4_Registers
with Volatile, Address => System'To_Address (FMC_Bank4_R_BASE);
type FMC_Bank5_6_Registers is record
SDCR : Word_x2;
SDTR : Word_x2;
SDCMR : Word;
SDRTR : Word;
SDSR : Word;
end record with Pack, Size => 7 * 32;
Bank5_6 : FMC_Bank5_6_Registers
with Volatile, Address => System'To_Address (FMC_Bank5_6_R_BASE);
type FMC_SDRAM_TimingInit_Config is record
LoadToActiveDelay : Word;
ExitSelfRefreshDelay : Word;
SelfRefreshTime : Word;
RowCycleDelay : Word;
WriteRecoveryTime : Word;
RPDelay : Word;
RCDDelay : Word;
end record;
type FMC_SDRAM_Init_Config is record
Bank : Integer;
ColumnBitsNumber : Word;
RowBitsNumber : Word;
SDMemoryDataWidth : Word;
InternalBankNumber : Word;
CASLatency : Word;
WriteProtection : Word;
SDClockPeriod : Word;
ReadBurst : Word;
ReadPipeDelay : Word;
Timing_Conf : FMC_SDRAM_TimingInit_Config;
end record;
type FMC_SDRAM_Cmd_Conf is record
CommandMode : Word;
CommandTarget : Word;
AutoRefreshNumber : Word;
ModeRegisterDefinition : Word;
end record;
procedure FMC_SDRAM_Init (SDRAM_Conf : FMC_SDRAM_Init_Config);
procedure FMC_SDRAM_Cmd (Cmd : FMC_SDRAM_Cmd_Conf);
function FMC_Get_Flag (Bank : Word; Flag : Word) return Boolean;
procedure FMC_Set_Refresh_Count (Cnt : Word);
end STM32F4.FMC;
|
src/main/fragment/mos6502-common/vdum1=vdum2_rol_9.asm | jbrandwood/kickc | 2 | 166068 | lda #0
sta {m1}
lda {m2}
asl
sta {m1}+1
lda {m2}+1
rol
sta {m1}+2
lda {m2}+2
rol
sta {m1}+3
|
grovlin-parser/src/main/antlr/GrovlinParser.g4 | arturbosch/grovlin | 8 | 1284 | parser grammar GrovlinParser;
options { tokenVocab=GrovlinLexer; }
grovlinFile
: statements EOF
;
statements
: (statement ) *
;
statement
: memberDeclaration #memberDeclarationStatement
| varDeclaration #varDeclarationStatement
| expressionStmt #expressionStatement
| assignment #assignmentStatement
| ifStmt #ifStatement
| forStmt #forStatement
| whileStmt #whileStatement
| returnStmt #returnStatement
;
expressionStmt
: expression
;
ifStmt
: IF expression LBRACE statements RBRACE (elifs=elifStmt)* (elseStmt)?
;
elifStmt
: ELIF expression LBRACE statements RBRACE
;
elseStmt
: ELSE LBRACE statements RBRACE (elifStmt|elseStmt)?
;
forStmt
: FOR ID SEMICOLON expression LBRACE statements RBRACE
;
whileStmt
: WHILE expression LBRACE statements RBRACE
;
returnStmt
: RETURN expression
;
typeDeclaration
: TRAIT typeName=TYPEID (EXTENDS extendTypes+=TYPEID (COMMA extendTypes+=TYPEID)*)? (LBRACE memberDeclaration* RBRACE)?
;
objectDeclaration
: OBJECT objectName=TYPEID (EXTENDS extendObject=TYPEID)? (AS extendTypes+=TYPEID (COMMA extendTypes+=TYPEID)*)? (LBRACE
memberDeclaration* RBRACE)?
;
memberDeclaration
: propertyDeclaration #propertyMemberDeclaration
| typeDeclaration #typeMemberDeclaration
| objectDeclaration #objectMemberDeclaration
| defDeclaration #defMemberDeclaration
;
propertyDeclaration
: (OVERRIDE)? TYPEID (ID|assignment)
;
defDeclaration
: methodDeclaration #MethodDefinition
| lambdaDeclaration #LambdaDefinition
;
methodDeclaration
: (OVERRIDE)? DEF ID LPAREN parameterList? RPAREN (SEMICOLON TYPEID)? (LBRACE statements RBRACE)?
;
parameterList
: parameter (COMMA parameter)*
;
parameter
: TYPEID ID
;
lambdaDeclaration
: DEF ID ASSIGN LBRACE statements RBRACE
;
varDeclaration
: (VAR | VAL) assignment
;
assignment
: ID ASSIGN expression
;
argumentList
: argument (COMMA argument)*
;
argument
: expression
;
expression
: TYPEID LPAREN RPAREN # objectCreationExpression
| THIS # thisExpression
| scope=expression POINT fieldName=ID # getterAccessExpression
| scope=expression POINT assignment # setterAccessExpression
| scope=expression POINT methodName=ID LPAREN argumentList? RPAREN # callExpression
| methodName=ID LPAREN argumentList? RPAREN # callExpression
| LPAREN expression RPAREN # parenExpression
| left=expression operator=(EQUAL|INEQUAL|LESS|LESSEQUAL|GREATER|GREATEREQUAL) right=expression # binaryOperation
| left=expression operator=(PLUS|MINUS) right=expression # binaryOperation
| left=expression operator=XOR right=expression # binaryOperation
| left=expression operator=(DIV|MUL|AND) right=expression # binaryOperation
| left=expression operator=OR right=expression # binaryOperation
| value=expression AS targetType=type # typeConversion
| INTLIT POINT POINT INTLIT # intRangeExpression
| ID # varReference
| MINUS expression # minusExpression
| NOT expression # notExpression
| INTLIT # intLiteral
| DECLIT # decimalLiteral
| BOOLLIT # boolLiteral
| STRINGLIT # stringLiteral
;
type
: INT # integer
| DECIMAL # decimal
| BOOL # bool
| STRING # string
| TYPEID # userType
;
|
pixy/src/host/pantilt_in_ada/specs/pixy_h.ads | GambuzX/Pixy-SIW | 1 | 18099 | <filename>pixy/src/host/pantilt_in_ada/specs/pixy_h.ads
--
-- Copyright (c) 2015, <NAME> <<EMAIL>>
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above copyright
-- notice and this permission notice appear in all copies.
--
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
-- TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
-- NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
-- CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-- PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
--
pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with stdint_h;
with Interfaces.C.Strings;
package pixy_h is
-- unsupported macro: PIXY_MAX_SIGNATURE 7
-- unsupported macro: PIXY_MIN_X 0
-- unsupported macro: PIXY_MAX_X 319
-- unsupported macro: PIXY_MIN_Y 0
-- unsupported macro: PIXY_MAX_Y 199
-- unsupported macro: PIXY_RCS_MIN_POS 0
-- unsupported macro: PIXY_RCS_MAX_POS 1000
-- unsupported macro: PIXY_RCS_CENTER_POS ((PIXY_RCS_MAX_POS-PIXY_RCS_MIN_POS)/2)
-- unsupported macro: PIXY_BLOCKTYPE_NORMAL 0
-- unsupported macro: PIXY_BLOCKTYPE_COLOR_CODE 1
package Class_Block is
type Block is limited record
c_type : aliased stdint_h.uint16_t; -- ../../libpixyusb/include/pixy.h:73
signature : aliased stdint_h.uint16_t; -- ../../libpixyusb/include/pixy.h:74
x : aliased stdint_h.uint16_t; -- ../../libpixyusb/include/pixy.h:75
y : aliased stdint_h.uint16_t; -- ../../libpixyusb/include/pixy.h:76
width : aliased stdint_h.uint16_t; -- ../../libpixyusb/include/pixy.h:77
height : aliased stdint_h.uint16_t; -- ../../libpixyusb/include/pixy.h:78
angle : aliased stdint_h.int16_t; -- ../../libpixyusb/include/pixy.h:79
end record;
pragma Import (CPP, Block);
procedure print (this : access Block; buf : Interfaces.C.Strings.chars_ptr); -- ../../libpixyusb/include/pixy.h:50
pragma Import (CPP, print, "_ZN5Block5printEPc");
end;
use Class_Block;
function pixy_init return int; -- ../../libpixyusb/include/pixy.h:90
pragma Import (C, pixy_init, "pixy_init");
function pixy_blocks_are_new return int; -- ../../libpixyusb/include/pixy.h:99
pragma Import (C, pixy_blocks_are_new, "pixy_blocks_are_new");
function pixy_get_blocks (max_blocks : stdint_h.uint16_t; blocks : access Block) return int; -- ../../libpixyusb/include/pixy.h:116
pragma Import (C, pixy_get_blocks, "pixy_get_blocks");
function pixy_command (name : Interfaces.C.Strings.chars_ptr -- , ...
) return int; -- ../../libpixyusb/include/pixy.h:124
pragma Import (C, pixy_command, "pixy_command");
procedure pixy_close; -- ../../libpixyusb/include/pixy.h:129
pragma Import (C, pixy_close, "pixy_close");
procedure pixy_error (error_code : int); -- ../../libpixyusb/include/pixy.h:135
pragma Import (C, pixy_error, "pixy_error");
function pixy_led_set_RGB
(red : stdint_h.uint8_t;
green : stdint_h.uint8_t;
blue : stdint_h.uint8_t) return int; -- ../../libpixyusb/include/pixy.h:145
pragma Import (C, pixy_led_set_RGB, "pixy_led_set_RGB");
function pixy_led_set_max_current (current : stdint_h.uint32_t) return int; -- ../../libpixyusb/include/pixy.h:153
pragma Import (C, pixy_led_set_max_current, "pixy_led_set_max_current");
function pixy_led_get_max_current return int; -- ../../libpixyusb/include/pixy.h:160
pragma Import (C, pixy_led_get_max_current, "pixy_led_get_max_current");
function pixy_cam_set_auto_white_balance (value : stdint_h.uint8_t) return int; -- ../../libpixyusb/include/pixy.h:169
pragma Import (C, pixy_cam_set_auto_white_balance, "pixy_cam_set_auto_white_balance");
function pixy_cam_get_auto_white_balance return int; -- ../../libpixyusb/include/pixy.h:177
pragma Import (C, pixy_cam_get_auto_white_balance, "pixy_cam_get_auto_white_balance");
function pixy_cam_get_white_balance_value return stdint_h.uint32_t; -- ../../libpixyusb/include/pixy.h:184
pragma Import (C, pixy_cam_get_white_balance_value, "pixy_cam_get_white_balance_value");
function pixy_cam_set_white_balance_value
(red : stdint_h.uint8_t;
green : stdint_h.uint8_t;
blue : stdint_h.uint8_t) return int; -- ../../libpixyusb/include/pixy.h:194
pragma Import (C, pixy_cam_set_white_balance_value, "pixy_cam_set_white_balance_value");
function pixy_cam_set_auto_exposure_compensation (enable : stdint_h.uint8_t) return int; -- ../../libpixyusb/include/pixy.h:203
pragma Import (C, pixy_cam_set_auto_exposure_compensation, "pixy_cam_set_auto_exposure_compensation");
function pixy_cam_get_auto_exposure_compensation return int; -- ../../libpixyusb/include/pixy.h:211
pragma Import (C, pixy_cam_get_auto_exposure_compensation, "pixy_cam_get_auto_exposure_compensation");
function pixy_cam_set_exposure_compensation (gain : stdint_h.uint8_t; compensation : stdint_h.uint16_t) return int; -- ../../libpixyusb/include/pixy.h:220
pragma Import (C, pixy_cam_set_exposure_compensation, "pixy_cam_set_exposure_compensation");
function pixy_cam_get_exposure_compensation (gain : access stdint_h.uint8_t; compensation : access stdint_h.uint16_t) return int; -- ../../libpixyusb/include/pixy.h:229
pragma Import (C, pixy_cam_get_exposure_compensation, "pixy_cam_get_exposure_compensation");
function pixy_cam_set_brightness (brightness : stdint_h.uint8_t) return int; -- ../../libpixyusb/include/pixy.h:237
pragma Import (C, pixy_cam_set_brightness, "pixy_cam_set_brightness");
function pixy_cam_get_brightness return int; -- ../../libpixyusb/include/pixy.h:244
pragma Import (C, pixy_cam_get_brightness, "pixy_cam_get_brightness");
function pixy_rcs_get_position (channel : stdint_h.uint8_t) return int; -- ../../libpixyusb/include/pixy.h:252
pragma Import (C, pixy_rcs_get_position, "pixy_rcs_get_position");
function pixy_rcs_set_position (channel : stdint_h.uint8_t; position : stdint_h.uint16_t) return int; -- ../../libpixyusb/include/pixy.h:261
pragma Import (C, pixy_rcs_set_position, "pixy_rcs_set_position");
function pixy_rcs_set_frequency (frequency : stdint_h.uint16_t) return int; -- ../../libpixyusb/include/pixy.h:267
pragma Import (C, pixy_rcs_set_frequency, "pixy_rcs_set_frequency");
function pixy_get_firmware_version
(major : access stdint_h.uint16_t;
minor : access stdint_h.uint16_t;
build : access stdint_h.uint16_t) return int; -- ../../libpixyusb/include/pixy.h:277
pragma Import (C, pixy_get_firmware_version, "pixy_get_firmware_version");
end pixy_h;
|
Transynther/x86/_processed/NC/_st_zr_sm_/i9-9900K_12_0xca.log_21829_378.asm | ljhsiun2/medusa | 9 | 88131 | <filename>Transynther/x86/_processed/NC/_st_zr_sm_/i9-9900K_12_0xca.log_21829_378.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x1051d, %r14
and %rbp, %rbp
movb (%r14), %r9b
nop
nop
nop
nop
inc %r12
lea addresses_D_ht+0x142a3, %rsi
lea addresses_D_ht+0xdd9d, %rdi
xor %r14, %r14
mov $59, %rcx
rep movsb
cmp %rsi, %rsi
lea addresses_D_ht+0xc8dd, %rsi
lea addresses_WT_ht+0x2c87, %rdi
clflush (%rdi)
nop
nop
nop
add %r12, %r12
mov $22, %rcx
rep movsb
nop
inc %r12
lea addresses_UC_ht+0x4a5d, %rbp
nop
nop
nop
nop
nop
and $40361, %r12
movl $0x61626364, (%rbp)
nop
nop
cmp $36247, %rdi
lea addresses_UC_ht+0x10d5d, %rcx
dec %rdi
movl $0x61626364, (%rcx)
nop
nop
nop
nop
nop
xor %r9, %r9
lea addresses_WT_ht+0x1e15d, %rcx
nop
nop
nop
dec %rdi
movl $0x61626364, (%rcx)
nop
nop
nop
nop
nop
add %rsi, %rsi
lea addresses_A_ht+0x12b5d, %rdi
nop
nop
cmp $56885, %rsi
mov (%rdi), %r14w
nop
nop
nop
nop
xor $22530, %r12
lea addresses_A_ht+0x16ddd, %rdi
nop
nop
nop
nop
sub $6503, %rsi
mov $0x6162636465666768, %r9
movq %r9, (%rdi)
nop
nop
nop
nop
nop
sub $62621, %r12
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r9
push %rbp
push %rbx
push %rdi
push %rdx
// Store
mov $0xae5, %r12
nop
nop
nop
inc %r9
movb $0x51, (%r12)
nop
nop
inc %rbp
// Store
lea addresses_A+0xf05d, %r9
nop
nop
nop
xor %rbx, %rbx
movb $0x51, (%r9)
nop
nop
nop
cmp %r14, %r14
// Load
lea addresses_D+0x1a593, %rbx
cmp $21551, %r12
mov (%rbx), %r14
nop
inc %rbx
// Store
mov $0x557f140000000d5d, %r12
nop
nop
sub %rdx, %rdx
mov $0x5152535455565758, %rbx
movq %rbx, (%r12)
nop
nop
sub %rbx, %rbx
// Faulty Load
mov $0x557f140000000d5d, %rbp
sub $53512, %rdi
mov (%rbp), %r14d
lea oracles, %rbp
and $0xff, %r14
shlq $12, %r14
mov (%rbp,%r14,1), %r14
pop %rdx
pop %rdi
pop %rbx
pop %rbp
pop %r9
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_NC', 'same': True, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_P', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': True, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': True, 'type': 'addresses_NC', 'same': True, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_NC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 7}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 1}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': True, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': True, 'congruent': 7}}
{'00': 5228, '58': 16601}
00 58 58 00 58 00 58 58 58 58 00 58 00 58 58 58 58 58 58 00 58 58 58 58 58 00 58 00 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 00 58 00 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 00 00 00 58 58 00 00 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 00 58 00 58 58 58 58 00 58 00 58 58 58 58 58 58 58 58 58 58 58 58 00 58 00 58 58 58 58 58 58 58 58 00 00 58 00 58 58 00 58 58 58 00 58 58 58 00 58 00 00 58 58 58 58 58 58 58 00 58 58 58 58 58 00 00 58 00 58 58 58 58 58 58 58 58 58 58 58 00 58 58 00 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 00 58 58 58 58 00 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 00 00 58 58 58 58 58 00 00 58 58 58 58 58 00 58 58 58 00 58 58 00 58 58 58 58 00 00 58 58 00 58 00 58 58 58 00 58 58 00 58 00 58 58 58 58 58 00 58 58 00 58 00 58 00 58 00 00 00 58 58 58 58 58 58 58 58 58 58 58 00 00 58 58 00 58 00 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 00 00 58 58 00 58 58 58 58 00 58 58 58 58 00 00 58 58 58 00 58 58 00 00 58 00 00 00 58 00 58 00 58 58 00 58 58 00 58 58 58 58 58 58 58 58 00 00 58 58 00 58 58 58 58 00 58 58 58 58 00 58 58 58 58 58 58 58 00 58 58 58 58 58 58 00 00 00 58 00 58 58 58 58 58 58 58 58 58 00 58 00 00 58 58 00 58 58 58 58 58 00 00 00 58 58 00 58 00 58 58 58 00 58 58 58 58 58 00 58 00 00 00 00 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 00 00 58 58 58 58 58 58 58 58 58 58 58 58 00 00 58 00 00 58 00 00 00 58 58 00 00 58 58 58 00 58 58 00 00 00 58 58 00 58 58 58 58 58 58 58 58 58 58 00 00 58 58 58 58 58 00 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 00 00 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 00 58 00 00 58 00 58 58 58 00 58 58 58 58 00 58 58 00 00 58 00 58 00 58 00 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 00 00 58 00 00 58 58 58 58 58 00 58 58 00 00 00 58 58 58 58 58 58 58 58 58 58 00 58 00 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 00 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 00 58 58 58 00 00 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 00 58 00 00 58 58 58 58 00 58 58 58 00 58 58 58 58 58 58 58 00 58 58 58 58 58 58 00 00 58 58 58 58 58 00 58 58 58 00 00 00 58 58 58 58 58 58 58 00 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 00 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 00 58 00 00 58 58 58 58 58 58 00 58 00 58 58 58 58 58 58 58 58 58 00 58 58 58 00 00 58 00 58 58 58 58 58 58 58 58 00 58 58 58 00 58 58 58 58 00 58 58 58 00 00 58 58 00 58 58 58 58 58 58 58 58 00 00 58 58 58 58 58 58 00 58 58 00 58 58 58 00 58 58 58 58 00 58 58 58 00 58 58 58 00 58 58 00 00 58 58 58 00 58 58 00 00 58 58 58 00 00 58 58 58 00 58 00 58 58 58 58 58 58 00 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 00 58 00 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 00 00 58 00 58 58 58 58 58 58 58 00 00 58 00 58 58 58
*/
|
programs/oeis/250/A250353.asm | jmorken/loda | 1 | 104139 | <reponame>jmorken/loda
; A250353: Number of length 4 arrays x(i), i=1..4 with x(i) in i..i+n and no value appearing more than 2 times.
; 16,75,235,581,1221,2287,3935,6345,9721,14291,20307,28045,37805,49911,64711,82577,103905,129115,158651,192981,232597,278015,329775,388441,454601,528867,611875,704285,806781,920071,1044887,1181985,1332145
mov $1,$0
mov $3,$0
trn $0,1
sub $1,$0
add $1,16
mov $2,29
mov $4,$3
lpb $2
add $1,$4
sub $2,1
lpe
mov $6,$3
lpb $6
add $5,$4
sub $6,1
lpe
mov $2,20
mov $4,$5
lpb $2
add $1,$4
sub $2,1
lpe
mov $5,0
mov $6,$3
lpb $6
add $5,$4
sub $6,1
lpe
mov $2,8
mov $4,$5
lpb $2
add $1,$4
sub $2,1
lpe
mov $5,0
mov $6,$3
lpb $6
add $5,$4
sub $6,1
lpe
mov $2,1
mov $4,$5
lpb $2
add $1,$4
sub $2,1
lpe
|
app/grammar/HIPML.g4 | vitrayatech/hipml-typescript | 0 | 3483 | grammar HIPML ;
policy : policySection+ ;
policySection : attributesSection
| coverageSection
| exclusionsSection
| conditionsSection
| definitionsSection
| contactSection
;
// Attributes section
attributesSection : ATTRIBUTES_SECTION_NAME ':' attributesBody ;
attributesBody : attribute+ ;
attribute : attributeString
| attributeDate
| attributeNumber
;
attributeString : ATTRIBUTES_KEY_WITH_STRING_VALUES ':' string ;
attributeDate : ATTRIBUTES_KEY_WITH_DATE_VALUES ':' date ;
attributeNumber : ATTRIBUTES_KEY_WITH_NUMBER_VALUES ':' (numberExpr | switchStmt) ;
// Coverage section
coverageSection : COVERAGE_SECTION_NAME ':' coverageBody ;
coverageBody : coverageItem+ ;
coverageItem : coverageItemName (',' coverageItemName)* (':' coverageItemDetails)? ;
coverageItemName : procedure
| diagnosis
| service
;
// Either (limits and one condition) OR (limits and no condition) OR just one condition should exist
coverageItemDetails : coverageItemLimit+ coverageItemCondition
| coverageItemLimit+
| coverageItemCondition
;
coverageItemLimit : COVERAGE_ITEM_LIMIT_KEY ':' (numberExpr | switchStmt) ;
coverageItemCondition : COVERAGE_ITEM_CONDITION_KEY ':' booleanExpr ;
// Exclusions section
exclusionsSection: EXCLUSIONS_SECTION_NAME ':' exclusionBody ;
exclusionBody : exclusionItem+ ;
// The item names for coverage and exclusions are the same
exclusionItem : coverageItemName (',' coverageItemName)* (':' exclusionItemCondition)? ;
exclusionItemCondition : EXCLUSIONS_ITEM_CONDITION_KEY ':' booleanExpr ;
conditionsSection: CONDITIONS_SECTION_NAME ':' conditionsBody ;
conditionsBody: conditionsItem+ ;
conditionsItem: CONDITIONS_ITEM_KEY ':' booleanExpr ;
definitionsSection: DEFINITIONS_SECTION_NAME ':' MULTILINE_STRING ;
contactSection: CONTACT_SECTION_NAME ':' MULTILINE_STRING ;
// Switch statement - choosing one of the choices based on conditions
switchStmt: SWITCH_PREFIX switchExpr+ switchDefaultExpr ;
switchExpr : GROUP_EXPR_STMT_PREFIX (numberExpr | string) IF booleanExpr ;
switchDefaultExpr : GROUP_EXPR_STMT_PREFIX (numberExpr | string) SWITCH_DEFAULT_SUFFIX ;
// Returns boolean
booleanExpr : ALL_ARE_TRUE booleanGroupExprStmt+
| ALL_ARE_FALSE booleanGroupExprStmt+
| AT_LEAST_ONE_IS_TRUE booleanGroupExprStmt+
| AT_LEAST_ONE_IS_FALSE booleanGroupExprStmt+
| booleanExpr AND booleanExpr
| booleanExpr OR booleanExpr
| comparatorExpr
| listOpExpr
| '(' booleanExpr ')'
;
booleanGroupExprStmt : GROUP_EXPR_STMT_PREFIX booleanExpr;
// Returns boolean
comparatorExpr : numberExpr LT numberExpr
| numberExpr LTE numberExpr
| numberExpr GT numberExpr
| numberExpr GTE numberExpr
| numberExpr EQ numberExpr
| numberExpr NE numberExpr
| (variable | string) EQ (variable | string)
| (variable | string) NE (variable | string)
;
groupFnExpr : (MIN | LOW_OF) numberExpr (',' numberExpr)* AND numberExpr
| (MAX | HIGH_OF) numberExpr (',' numberExpr)* AND numberExpr
;
numberExpr : numberExpr MUL numberExpr
| numberExpr DIV numberExpr
| numberExpr PER numberExpr
| numberExpr ADD numberExpr
| numberExpr SUB numberExpr
| dateExpr
| groupFnExpr
| variable
| amount
| number
| '(' numberExpr ')'
;
// List operations
listOpExpr : (list | variable) (CONTAINS | DOES_NOT_CONTAIN) (LIST_MATCH_ANY_ONE | LIST_MATCH_ALL)? (singleValue | list) ;
singleValue : number
| amount
| variable
| date
| string
| procedure
| diagnosis
| service
;
list : '[' listExpr ']' ;
listExpr : amount (',' amount)*
| variable (',' variable)*
| date (',' date)*
| string (',' string)*
| procedure (',' procedure)*
| diagnosis (',' diagnosis)*
| service (',' service)*
;
dateExpr : DIFF_DAYS (variable | date) AND (variable | date)
| DIFF_MONTHS (variable | date) AND (variable | date)
| DIFF_YEARS (variable | date) AND (variable | date)
;
variable : VARIABLE ;
diagnosis : DIAGNOSIS ;
procedure : PROCEDURE ;
service : SERVICE ;
amount : AMOUNT ;
date : DATE ;
number : NUMBER ;
string : STRING ;
bool : BOOLEAN ;
//-----------------------------------------
// Lexer rules
//-----------------------------------------
METADATA_SECTION_NAME : 'Policy Metadata' ;
ATTRIBUTES_SECTION_NAME : 'Policy Attributes' ;
COVERAGE_SECTION_NAME : 'Coverage' ;
EXCLUSIONS_SECTION_NAME : 'Exclusions' ;
CONDITIONS_SECTION_NAME : 'Conditions' ;
DEFINITIONS_SECTION_NAME : 'Definitions' ;
CONTACT_SECTION_NAME : 'Contact' ;
METADATA_KEY : 'DocType'
| 'DocVersion'
;
ATTRIBUTES_KEY_WITH_STRING_VALUES : 'Name'
| 'Issuer'
| 'UIN'
| 'Type'
| 'Category'
| 'URL'
| 'Version'
;
ATTRIBUTES_KEY_WITH_DATE_VALUES : 'Approval Date'
| 'Effective Date'
| 'Expiration Date'
;
ATTRIBUTES_KEY_WITH_NUMBER_VALUES : 'Sum Insured'
| 'Default copay %'
| 'Pre-hospitalization period'
| 'Post-hospitalization period'
| 'Default limit per policy period'
| 'Default limit per policy year'
| 'Default limit per claim'
| 'Default limit per person'
| 'Default limit per family'
| 'Default limit on number of claims per policy period'
| 'Default limit on number of claims per policy year'
| 'Default corporate buffer limit per claim'
| 'Default corporate buffer limit per person'
| 'Default corporate buffer limit per family'
| 'Default corporate buffer limit on number of claims'
| 'Default waiting period'
;
COVERAGE_ITEM_LIMIT_KEY : 'Limit per policy period'
| 'Limit per policy year'
| 'Limit per claim'
| 'Limit per person'
| 'Limit per family'
| 'Limit per day'
| 'Limit on number of claims per policy period'
| 'Limit on number of claims per policy year'
| 'Corporate buffer limit per claim'
| 'Corporate buffer limit per person'
| 'Corporate buffer limit per family'
| 'Corporate buffer limit on number of claims'
| 'Copay %'
| 'Waiting period'
;
COVERAGE_ITEM_CONDITION_KEY : 'Included only if' ;
EXCLUSIONS_ITEM_CONDITION_KEY : 'Excluded unless' ;
CONDITIONS_ITEM_KEY : 'Patient Eligibility'
| 'Claim Admissibility'
;
VARIABLE : 'Var' '(' ALPHABET KEYCHAR*? ')' ;
PROCEDURE : 'Prc' '(' ALPHABET KEYCHAR*? ')' ;
DIAGNOSIS : 'Dgn' '(' ALPHABET KEYCHAR*? ')' ;
SERVICE : 'Svc' '(' ALPHABET KEYCHAR*? ')' ;
AMOUNT : 'Amt' '(' HYPHEN? DIGIT (DIGIT | ',')* ('.' DIGIT+)? ')' ;
SWITCH_PREFIX : [Oo] 'ne of the following:' ;
GROUP_EXPR_STMT_PREFIX: '- ' ;
SWITCH_DEFAULT_SUFFIX : 'if none of the above matches'
| 'default'
;
ALL_ARE_TRUE : [Aa] 'll of the following are true:' ;
ALL_ARE_FALSE : [Aa] 'll of the following are false:' ;
AT_LEAST_ONE_IS_TRUE : [Aa] ('t least' | 'ny' ) ' one of the following is true:' ;
AT_LEAST_ONE_IS_FALSE : [Aa] ('t least' | 'ny' ) ' one of the following is false:' ;
IF : 'if' ;
AND : 'and' ;
OR : 'or' ;
CONTAINS: 'contains' ;
DOES_NOT_CONTAIN: 'does not contain' ;
ADD : '+' | 'plus' ;
SUB : HYPHEN | 'minus' ;
MUL : '*' | 'x' | 'times' | 'multiplied by' ;
DIV : '/' | 'divided by' ;
PER : '% of' | 'percentage of' ;
LT : '<' | 'is less than' ;
LTE : '<=' | 'is less than or equal to' ;
GT : '>' | 'is greater than' ;
GTE : '>=' | 'is greater than or equal to' ;
NE : '!=' | 'is not equal to' | 'is not' ;
EQ : '==' | 'is equal to' | 'is' ;
MIN : [Mm] 'inimum of' ;
MAX : [Mm] 'aximum of' ;
LOW_OF : [Ww] 'hichever is lower of' ;
HIGH_OF : [Ww] 'hichever is higher of' ;
DIFF_DAYS : [Nn] 'umber of days between' ;
DIFF_MONTHS : [Nn] 'umber of months between' ;
DIFF_YEARS : [Nn] 'umber of years between' ;
LIST_MATCH_ANY_ONE : 'any of' ;
LIST_MATCH_ALL : 'all of' ;
DATE : [12] DIGIT DIGIT DIGIT HYPHEN [01] DIGIT HYPHEN [0123] DIGIT
| [12] DIGIT DIGIT DIGIT '/' [01] DIGIT '/' [0123] DIGIT ;
BOOLEAN : [Tt] 'rue' | [Ff] 'alse' ;
NUMBER : HYPHEN? DIGIT DIGIT* ('.' DIGIT+)? ;
STRING : '"' (ESC | .)*? '"' ;
MULTILINE_STRING: '{{' .*? '}}' ;
// Hyphen has to come after SUB as they match the same literal
HYPHEN : '-' ;
fragment ESC : '\\' [btnr"\\] ;
fragment DIGIT : [0-9] ;
fragment ALPHABET : [a-zA-Z] ;
fragment KEYCHAR : ( ALPHABET | DIGIT | [_. -]) ;
LINE_COMMENT : '//' .*? '\r'? '\n' -> skip ;
COMMENT : '/*' .*? '*/' -> skip ;
WS : [ \t\r\n]+ -> skip ;
|
llvm-gcc-4.2-2.9/gcc/ada/g-dyntab.adb | vidkidz/crossbridge | 1 | 20796 | <reponame>vidkidz/crossbridge<filename>llvm-gcc-4.2-2.9/gcc/ada/g-dyntab.adb
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . D Y N A M I C _ T A B L E S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2000-2006, 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 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with GNAT.Heap_Sort_G;
with System; use System;
with System.Memory; use System.Memory;
with Unchecked_Conversion;
package body GNAT.Dynamic_Tables is
Min : constant Integer := Integer (Table_Low_Bound);
-- Subscript of the minimum entry in the currently allocated table
-----------------------
-- Local Subprograms --
-----------------------
procedure Reallocate (T : in out Instance);
-- Reallocate the existing table according to the current value stored
-- in Max. Works correctly to do an initial allocation if the table
-- is currently null.
pragma Warnings (Off);
-- These unchecked conversions are in fact safe, since they never
-- generate improperly aliased pointer values.
function To_Address is new Unchecked_Conversion (Table_Ptr, Address);
function To_Pointer is new Unchecked_Conversion (Address, Table_Ptr);
pragma Warnings (On);
--------------
-- Allocate --
--------------
procedure Allocate
(T : in out Instance;
Num : Integer := 1)
is
begin
T.P.Last_Val := T.P.Last_Val + Num;
if T.P.Last_Val > T.P.Max then
Reallocate (T);
end if;
end Allocate;
------------
-- Append --
------------
procedure Append (T : in out Instance; New_Val : Table_Component_Type) is
begin
Increment_Last (T);
T.Table (Table_Index_Type (T.P.Last_Val)) := New_Val;
end Append;
--------------------
-- Decrement_Last --
--------------------
procedure Decrement_Last (T : in out Instance) is
begin
T.P.Last_Val := T.P.Last_Val - 1;
end Decrement_Last;
--------------
-- For_Each --
--------------
procedure For_Each (Table : Instance) is
Quit : Boolean := False;
begin
for Index in Table_Low_Bound .. Table_Index_Type (Table.P.Last_Val) loop
Action (Index, Table.Table (Index), Quit);
exit when Quit;
end loop;
end For_Each;
----------
-- Free --
----------
procedure Free (T : in out Instance) is
begin
Free (To_Address (T.Table));
T.Table := null;
T.P.Length := 0;
end Free;
--------------------
-- Increment_Last --
--------------------
procedure Increment_Last (T : in out Instance) is
begin
T.P.Last_Val := T.P.Last_Val + 1;
if T.P.Last_Val > T.P.Max then
Reallocate (T);
end if;
end Increment_Last;
----------
-- Init --
----------
procedure Init (T : in out Instance) is
Old_Length : constant Integer := T.P.Length;
begin
T.P.Last_Val := Min - 1;
T.P.Max := Min + Table_Initial - 1;
T.P.Length := T.P.Max - Min + 1;
-- If table is same size as before (happens when table is never
-- expanded which is a common case), then simply reuse it. Note
-- that this also means that an explicit Init call right after
-- the implicit one in the package body is harmless.
if Old_Length = T.P.Length then
return;
-- Otherwise we can use Reallocate to get a table of the right size.
-- Note that Reallocate works fine to allocate a table of the right
-- initial size when it is first allocated.
else
Reallocate (T);
end if;
end Init;
----------
-- Last --
----------
function Last (T : Instance) return Table_Index_Type is
begin
return Table_Index_Type (T.P.Last_Val);
end Last;
----------------
-- Reallocate --
----------------
procedure Reallocate (T : in out Instance) is
New_Length : Integer;
New_Size : size_t;
begin
if T.P.Max < T.P.Last_Val then
while T.P.Max < T.P.Last_Val loop
New_Length := T.P.Length * (100 + Table_Increment) / 100;
if New_Length > T.P.Length then
T.P.Length := New_Length;
else
T.P.Length := T.P.Length + 1;
end if;
T.P.Max := Min + T.P.Length - 1;
end loop;
end if;
New_Size :=
size_t ((T.P.Max - Min + 1) *
(Table_Type'Component_Size / Storage_Unit));
if T.Table = null then
T.Table := To_Pointer (Alloc (New_Size));
elsif New_Size > 0 then
T.Table :=
To_Pointer (Realloc (Ptr => To_Address (T.Table),
Size => New_Size));
end if;
if T.P.Length /= 0 and then T.Table = null then
raise Storage_Error;
end if;
end Reallocate;
-------------
-- Release --
-------------
procedure Release (T : in out Instance) is
begin
T.P.Length := T.P.Last_Val - Integer (Table_Low_Bound) + 1;
T.P.Max := T.P.Last_Val;
Reallocate (T);
end Release;
--------------
-- Set_Item --
--------------
procedure Set_Item
(T : in out Instance;
Index : Table_Index_Type;
Item : Table_Component_Type)
is
begin
if Integer (Index) > T.P.Last_Val then
Set_Last (T, Index);
end if;
T.Table (Index) := Item;
end Set_Item;
--------------
-- Set_Last --
--------------
procedure Set_Last (T : in out Instance; New_Val : Table_Index_Type) is
begin
if Integer (New_Val) < T.P.Last_Val then
T.P.Last_Val := Integer (New_Val);
else
T.P.Last_Val := Integer (New_Val);
if T.P.Last_Val > T.P.Max then
Reallocate (T);
end if;
end if;
end Set_Last;
----------------
-- Sort_Table --
----------------
procedure Sort_Table (Table : in out Instance) is
Temp : Table_Component_Type;
-- A temporary position to simulate index 0
-- Local subprograms
function Index_Of (Idx : Natural) return Table_Index_Type;
-- Apply Natural to indexs of the table
function Lower_Than (Op1, Op2 : Natural) return Boolean;
-- Compare two components
procedure Move (From : Natural; To : Natural);
-- Move one component
package Heap_Sort is new GNAT.Heap_Sort_G (Move, Lower_Than);
--------------
-- Index_Of --
--------------
function Index_Of (Idx : Natural) return Table_Index_Type is
J : constant Integer'Base :=
Table_Index_Type'Pos (First) + Idx - 1;
begin
return Table_Index_Type'Val (J);
end Index_Of;
----------
-- Move --
----------
procedure Move (From : Natural; To : Natural) is
begin
if From = 0 then
Table.Table (Index_Of (To)) := Temp;
elsif To = 0 then
Temp := Table.Table (Index_Of (From));
else
Table.Table (Index_Of (To)) :=
Table.Table (Index_Of (From));
end if;
end Move;
----------------
-- Lower_Than --
----------------
function Lower_Than (Op1, Op2 : Natural) return Boolean is
begin
if Op1 = 0 then
return Lt (Temp, Table.Table (Index_Of (Op2)));
elsif Op2 = 0 then
return Lt (Table.Table (Index_Of (Op1)), Temp);
else
return
Lt (Table.Table (Index_Of (Op1)),
Table.Table (Index_Of (Op2)));
end if;
end Lower_Than;
-- Start of processing for Sort_Table
begin
Heap_Sort.Sort (Natural (Last (Table) - First) + 1);
end Sort_Table;
end GNAT.Dynamic_Tables;
|
libsrc/_DEVELOPMENT/arch/zx/display/c/sdcc_iy/zx_saddrcleft_fastcall.asm | meesokim/z88dk | 0 | 26842 |
; void *zx_saddrcleft_fastcall(void *saddr)
SECTION code_arch
PUBLIC _zx_saddrcleft_fastcall
_zx_saddrcleft_fastcall:
INCLUDE "arch/zx/display/z80/asm_zx_saddrcleft.asm"
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2505.asm | ljhsiun2/medusa | 9 | 23296 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x1ca88, %rsi
lea addresses_UC_ht+0x5088, %rdi
nop
and %r11, %r11
mov $39, %rcx
rep movsb
nop
nop
nop
xor $5592, %r12
lea addresses_WT_ht+0xa5c8, %rsi
lea addresses_A_ht+0x1da88, %rdi
nop
nop
nop
nop
dec %r8
mov $6, %rcx
rep movsw
nop
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_WT_ht+0x17488, %r12
clflush (%r12)
nop
nop
nop
nop
nop
inc %rbx
mov (%r12), %cx
xor $26862, %rsi
lea addresses_A_ht+0x6a88, %rsi
lea addresses_UC_ht+0x11d70, %rdi
nop
add $1274, %rdx
mov $18, %rcx
rep movsl
and $8458, %rcx
lea addresses_WC_ht+0x94e0, %rsi
lea addresses_UC_ht+0x7eee, %rdi
clflush (%rdi)
nop
nop
nop
nop
and $42393, %r12
mov $18, %rcx
rep movsl
nop
nop
nop
xor %r11, %r11
lea addresses_WT_ht+0x138d8, %rsi
nop
nop
nop
nop
nop
xor %r8, %r8
mov $0x6162636465666768, %rdx
movq %rdx, %xmm6
vmovups %ymm6, (%rsi)
nop
sub %rdx, %rdx
lea addresses_D_ht+0xf9c0, %r8
nop
and $26036, %rbx
mov $0x6162636465666768, %r11
movq %r11, %xmm4
and $0xffffffffffffffc0, %r8
vmovaps %ymm4, (%r8)
nop
nop
nop
and $913, %rdx
lea addresses_WC_ht+0x4888, %r8
nop
nop
sub %r12, %r12
movl $0x61626364, (%r8)
nop
nop
nop
nop
nop
dec %r12
lea addresses_UC_ht+0x1698, %rsi
lea addresses_normal_ht+0x1888, %rdi
nop
nop
nop
nop
nop
dec %r8
mov $34, %rcx
rep movsq
nop
nop
nop
add %r8, %r8
lea addresses_normal_ht+0x5238, %rsi
lea addresses_D_ht+0xaa9c, %rdi
nop
nop
nop
and %rdx, %rdx
mov $111, %rcx
rep movsb
nop
nop
and $26288, %rdi
lea addresses_normal_ht+0xee08, %rsi
lea addresses_D_ht+0x15649, %rdi
nop
nop
add %rdx, %rdx
mov $112, %rcx
rep movsb
nop
nop
nop
nop
nop
and $63124, %rdi
lea addresses_WT_ht+0xfc28, %rcx
nop
nop
cmp %rbx, %rbx
mov (%rcx), %r11w
nop
nop
nop
nop
inc %rcx
lea addresses_UC_ht+0x1a2a0, %rcx
nop
nop
inc %r11
mov $0x6162636465666768, %rsi
movq %rsi, %xmm0
vmovups %ymm0, (%rcx)
sub %rdi, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r15
push %rax
push %rbp
push %rsi
// Store
lea addresses_US+0xebe8, %rsi
nop
nop
xor $51219, %r11
mov $0x5152535455565758, %r15
movq %r15, (%rsi)
dec %rsi
// Store
mov $0x448, %rsi
clflush (%rsi)
nop
dec %rax
movb $0x51, (%rsi)
add %r11, %r11
// Store
lea addresses_WC+0x1b48, %rbp
add %rsi, %rsi
movw $0x5152, (%rbp)
nop
cmp %rbp, %rbp
// Faulty Load
lea addresses_UC+0x11088, %r10
nop
nop
nop
sub %r14, %r14
vmovups (%r10), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %r11
lea oracles, %rsi
and $0xff, %r11
shlq $12, %r11
mov (%rsi,%r11,1), %r11
pop %rsi
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 5, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 4, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 6, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 10, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': True, 'congruent': 2, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 11, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 5, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
libtool/src/gmp-6.1.2/mpn/s390_32/esame/bdiv_dbm1c.asm | kroggen/aergo | 1,602 | 245178 | <gh_stars>1000+
dnl S/390-32 mpn_bdiv_dbm1c for systems with MLR instruction.
dnl Copyright 2011 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 z900 14
C z990 10
C z9 ?
C z10 ?
C z196 ?
C INPUT PARAMETERS
define(`qp', `%r2')
define(`up', `%r3')
define(`n', `%r4')
define(`bd', `%r5')
define(`cy', `%r6')
ASM_START()
TEXT
ALIGN(16)
PROLOGUE(mpn_bdiv_dbm1c)
stm %r6, %r7, 24(%r15)
lhi %r7, 0 C zero index register
L(top): l %r1, 0(%r7,up)
mlr %r0, bd
slr %r6, %r1
st %r6, 0(%r7,qp)
slbr %r6, %r0
la %r7, 4(%r7)
brct n, L(top)
lr %r2, %r6
lm %r6, %r7, 24(%r15)
br %r14
EPILOGUE()
|
Categories/Object/IndexedProduct.agda | copumpkin/categories | 98 | 759 | <gh_stars>10-100
{-# OPTIONS --universe-polymorphism #-}
open import Categories.Category
module Categories.Object.IndexedProduct {o ℓ e} (C : Category o ℓ e) where
-- An indexed product is similar to a limit, but the diagram is from a Set
-- (irrelevant Setoid here) rather than a category, so there are no subobjects
-- involved.
open Category C
open Equiv
open import Level
open import Relation.Binary as Bi using ()
open import Categories.Support.Equivalence
import Categories.Object.Indexed as IObj
import Categories.Morphism.Indexed as IArrow
-- Borrowed from Dan Doel's definition of products
record IndexedProduct {c q} (B : Setoid c q) (As : IObj.Dust C B) : Set (o ⊔ ℓ ⊔ e ⊔ c ⊔ q) where
module B = Setoid B
open B using (_≈_)
open Heterogeneous C
open IObj C B
open IArrow C B
Cone : Obj → _
Cone apex = apex ⇒∗ As
cone-setoid : Obj → Setoid _ _
cone-setoid apex = fan-setoid apex As
_≜_ : ∀ {apex} → Bi.Rel (Cone apex) _
_≜_ {apex} = Setoid._≈_ (cone-setoid apex)
field
∏ : Obj
π : Cone ∏
-- convenience!
π[_] : (x : B.Carrier) → (∏ ⇒ (As ! x))
π[_] x = π ‼ x
-- ↑ XXX for some reason it won't parse as π[ x ]
.π-cong : ∀ {x y} → x ≈ y → (π[ x ] ∼ π[ y ])
π-cong x≈y = cong₁ π x≈y
π▹_ : ∀ {X} (f : X ⇒ ∏) → Cone X
π▹_ f = _▹_ {Zs = As} π f
field
uncurry : ∀ {V} → Cone V → V ⇒ ∏
-- XXX fs should be implicit but call sites can't infer it
-- because of eta-driven irrelevant-field dropping
.commute∗ : ∀ {V} (fs : Cone V) → (π▹ uncurry fs) ≜ fs
.universal : ∀ {V} (fs : Cone V) {i : V ⇒ ∏}
→ (∀ {x} → π[ x ] ∘ i ≡ fs ‼ x) → uncurry fs ≡ i
-- convenience?
.commute : ∀ {V} (fs : Cone V) {x} → (π[ x ] ∘ uncurry fs) ≡ fs ‼ x
commute fs {x} = ∼⇒≡ (commute∗ fs B.refl)
.universal∗ : ∀ {V} (fs : Cone V) {i : V ⇒ ∏}
→ ((π▹ i) ≜ fs) → uncurry fs ≡ i
universal∗ fs pf = universal fs (∼⇒≡ (pf B.refl))
.g-η : ∀ {C} {f : C ⇒ ∏} → (uncurry (π▹ f) ≡ f)
g-η {f = f} = universal (π▹ f) Equiv.refl
.η : uncurry π ≡ Category.id C
η = universal π identityʳ
.uncurry-cong : ∀ {V} {fs gs : Cone V} → (∀ {x} → fs ‼ x ≡ gs ‼ x) → uncurry fs ≡ uncurry gs
uncurry-cong {fs = fs} {gs} eq =
universal fs (Equiv.trans (commute gs) (Equiv.sym eq))
.uncurry-cong∗ : ∀ {V} {fs gs : Cone V} → fs ≜ gs → uncurry fs ≡ uncurry gs
uncurry-cong∗ {V} {fs} {gs} eq = universal∗ fs
(≜-trans {π▹ uncurry gs} {gs} {fs} (commute∗ gs) (≜-sym {fs} {gs} eq))
where
open Setoid (cone-setoid V) using ()
renaming (trans to ≜-trans; sym to ≜-sym)
.uncurry∘ : ∀ {V W} (fs : Cone V) {q : W ⇒ V} → (uncurry fs) ∘ q ≡ uncurry (_▹_ {Zs = As} fs q)
uncurry∘ fs {q} = Equiv.sym (universal (_▹_ {Zs = As} fs q) (Equiv.trans (Equiv.sym assoc) (∘-resp-≡ˡ (commute fs))))
{-
open import Categories.Morphisms
Commutative : ∀ {A B} → (p₁ : Product A B) (p₂ : Product B A) → _≅_ C (Product.A×B p₁) (Product.A×B p₂)
Commutative p₁ p₂ = record
{ f = ⟨ π₂ , π₁ ⟩′
; g = ⟨ π′₂ , π′₁ ⟩
; iso = record
{ isoˡ = isoˡ
; isoʳ = isoʳ
}
}
where
module p₁ = Product p₁
module p₂ = Product p₂
open Product p₁
open Product p₂ renaming (A×B to B×A; π₁ to π′₁; π₂ to π′₂; ⟨_,_⟩ to ⟨_,_⟩′)
idˡ : A×B ⇒ A×B
idˡ = ⟨ π′₂ , π′₁ ⟩ ∘ ⟨ π₂ , π₁ ⟩′
idʳ : B×A ⇒ B×A
idʳ = ⟨ π₂ , π₁ ⟩′ ∘ ⟨ π′₂ , π′₁ ⟩
.idˡ-commutes₁ : π₁ ∘ idˡ ≡ π₁
idˡ-commutes₁ = begin
π₁ ∘ idˡ
↑⟨ assoc ⟩
(π₁ ∘ ⟨ π′₂ , π′₁ ⟩) ∘ ⟨ π₂ , π₁ ⟩′
↓⟨ ∘-resp-≡ˡ p₁.commute₁ ⟩
π′₂ ∘ ⟨ π₂ , π₁ ⟩′
↓⟨ p₂.commute₂ ⟩
π₁
∎
where
open HomReasoning
.idˡ-commutes₂ : π₂ ∘ idˡ ≡ π₂
idˡ-commutes₂ = begin
π₂ ∘ idˡ
↑⟨ assoc ⟩
(π₂ ∘ ⟨ π′₂ , π′₁ ⟩) ∘ ⟨ π₂ , π₁ ⟩′
↓⟨ ∘-resp-≡ˡ p₁.commute₂ ⟩
π′₁ ∘ ⟨ π₂ , π₁ ⟩′
↓⟨ p₂.commute₁ ⟩
π₂
∎
where
open HomReasoning
.isoˡ : idˡ ≡ id
isoˡ = begin
idˡ
↑⟨ p₁.universal idˡ-commutes₁ idˡ-commutes₂ ⟩
⟨ π₁ , π₂ ⟩
↓⟨ p₁.η ⟩
id
∎
where
open HomReasoning
.idʳ-commutes₁ : π′₁ ∘ idʳ ≡ π′₁
idʳ-commutes₁ = begin
π′₁ ∘ idʳ
↑⟨ assoc ⟩
(π′₁ ∘ ⟨ π₂ , π₁ ⟩′) ∘ ⟨ π′₂ , π′₁ ⟩
↓⟨ ∘-resp-≡ˡ p₂.commute₁ ⟩
π₂ ∘ ⟨ π′₂ , π′₁ ⟩
↓⟨ p₁.commute₂ ⟩
π′₁
∎
where
open HomReasoning
.idʳ-commutes₂ : π′₂ ∘ idʳ ≡ π′₂
idʳ-commutes₂ = begin
π′₂ ∘ idʳ
↑⟨ assoc ⟩
(π′₂ ∘ ⟨ π₂ , π₁ ⟩′) ∘ ⟨ π′₂ , π′₁ ⟩
↓⟨ ∘-resp-≡ˡ p₂.commute₂ ⟩
π₁ ∘ ⟨ π′₂ , π′₁ ⟩
↓⟨ p₁.commute₁ ⟩
π′₂
∎
where
open HomReasoning
.isoʳ : idʳ ≡ id
isoʳ = begin
idʳ
↑⟨ p₂.universal idʳ-commutes₁ idʳ-commutes₂ ⟩
⟨ π′₁ , π′₂ ⟩′
↓⟨ p₂.η ⟩
id
∎
where
open HomReasoning
Associative : ∀ {X Y Z} (p₁ : Product X Y) (p₂ : Product Y Z) (p₃ : Product X (Product.A×B p₂)) (p₄ : Product (Product.A×B p₁) Z) → _≅_ C (Product.A×B p₃) (Product.A×B p₄)
Associative p₁ p₂ p₃ p₄ = record
{ f = f
; g = g
; iso = record
{ isoˡ = isoˡ
; isoʳ = isoʳ
}
}
where
module p₁ = Product p₁
module p₂ = Product p₂
module p₃ = Product p₃
module p₄ = Product p₄
open Product p₁ hiding (π₁; π₂) renaming (⟨_,_⟩ to ⟨_,_⟩p₁)
open Product p₂ hiding (π₁; π₂) renaming (A×B to B×C; ⟨_,_⟩ to ⟨_,_⟩p₂)
open Product p₃ renaming (A×B to A×[B×C])
open Product p₄ renaming (A×B to [A×B]×C; π₁ to π′₁; π₂ to π′₂; ⟨_,_⟩ to ⟨_,_⟩′)
f : A×[B×C] ⇒ [A×B]×C
f = ⟨ ⟨ π₁ , p₂.π₁ ∘ π₂ ⟩p₁ , p₂.π₂ ∘ π₂ ⟩′
g : [A×B]×C ⇒ A×[B×C]
g = ⟨ p₁.π₁ ∘ π′₁ , ⟨ p₁.π₂ ∘ π′₁ , π′₂ ⟩p₂ ⟩
idˡ : A×[B×C] ⇒ A×[B×C]
idˡ = g ∘ f
idʳ : [A×B]×C ⇒ [A×B]×C
idʳ = f ∘ g
.cmˡ₁ : π₁ ∘ idˡ ≡ π₁
cmˡ₁ = begin
π₁ ∘ idˡ
↑⟨ assoc ⟩
(π₁ ∘ g) ∘ f
↓⟨ ∘-resp-≡ˡ p₃.commute₁ ⟩
(p₁.π₁ ∘ π′₁) ∘ f
↓⟨ assoc ⟩
p₁.π₁ ∘ (π′₁ ∘ f)
↓⟨ ∘-resp-≡ʳ p₄.commute₁ ⟩
p₁.π₁ ∘ ⟨ p₃.π₁ , p₂.π₁ ∘ p₃.π₂ ⟩p₁
↓⟨ p₁.commute₁ ⟩
p₃.π₁
∎
where
open HomReasoning
.cmˡ₂₁ : p₂.π₁ ∘ (⟨ p₁.π₂ ∘ p₄.π₁ , p₄.π₂ ⟩p₂ ∘ f) ≡ p₂.π₁ ∘ p₃.π₂
cmˡ₂₁ = begin
p₂.π₁ ∘ (⟨ p₁.π₂ ∘ p₄.π₁ , p₄.π₂ ⟩p₂ ∘ f)
↑⟨ assoc ⟩
(p₂.π₁ ∘ ⟨ p₁.π₂ ∘ p₄.π₁ , p₄.π₂ ⟩p₂) ∘ f
↓⟨ ∘-resp-≡ˡ p₂.commute₁ ⟩
(p₁.π₂ ∘ p₄.π₁) ∘ f
↓⟨ assoc ⟩
p₁.π₂ ∘ (p₄.π₁ ∘ f)
↓⟨ ∘-resp-≡ʳ p₄.commute₁ ⟩
p₁.π₂ ∘ ⟨ p₃.π₁ , p₂.π₁ ∘ p₃.π₂ ⟩p₁
↓⟨ p₁.commute₂ ⟩
p₂.π₁ ∘ p₃.π₂
∎
where
open HomReasoning
.cmˡ₂₂ : p₂.π₂ ∘ (⟨ p₁.π₂ ∘ p₄.π₁ , p₄.π₂ ⟩p₂ ∘ f) ≡ p₂.π₂ ∘ p₃.π₂
cmˡ₂₂ = begin
p₂.π₂ ∘ (⟨ p₁.π₂ ∘ p₄.π₁ , p₄.π₂ ⟩p₂ ∘ f)
↑⟨ assoc ⟩
(p₂.π₂ ∘ ⟨ p₁.π₂ ∘ p₄.π₁ , p₄.π₂ ⟩p₂) ∘ f
↓⟨ ∘-resp-≡ˡ p₂.commute₂ ⟩
p₄.π₂ ∘ f
↓⟨ p₄.commute₂ ⟩
p₂.π₂ ∘ p₃.π₂
∎
where
open HomReasoning
.cmˡ₂ : π₂ ∘ idˡ ≡ π₂
cmˡ₂ = begin
π₂ ∘ idˡ
↑⟨ assoc ⟩
(π₂ ∘ g) ∘ f
↓⟨ ∘-resp-≡ˡ p₃.commute₂ ⟩
⟨ p₁.π₂ ∘ p₄.π₁ , p₄.π₂ ⟩p₂ ∘ f
↑⟨ p₂.universal cmˡ₂₁ cmˡ₂₂ ⟩
⟨ p₂.π₁ ∘ p₃.π₂ , p₂.π₂ ∘ p₃.π₂ ⟩p₂
↓⟨ p₂.g-η ⟩
p₃.π₂
∎
where
open HomReasoning
.isoˡ : idˡ ≡ id
isoˡ = begin
idˡ
↑⟨ p₃.universal cmˡ₁ cmˡ₂ ⟩
⟨ π₁ , π₂ ⟩
↓⟨ p₃.η ⟩
id
∎
where
open HomReasoning
.cmʳ₁₁ : p₁.π₁ ∘ (⟨ p₃.π₁ , p₂.π₁ ∘ p₃.π₂ ⟩p₁ ∘ g) ≡ p₁.π₁ ∘ p₄.π₁
cmʳ₁₁ = begin
p₁.π₁ ∘ (⟨ p₃.π₁ , p₂.π₁ ∘ p₃.π₂ ⟩p₁ ∘ g)
↑⟨ assoc ⟩
(p₁.π₁ ∘ ⟨ p₃.π₁ , p₂.π₁ ∘ p₃.π₂ ⟩p₁) ∘ g
↓⟨ ∘-resp-≡ˡ p₁.commute₁ ⟩
p₃.π₁ ∘ g
↓⟨ p₃.commute₁ ⟩
p₁.π₁ ∘ p₄.π₁
∎
where
open HomReasoning
.cmʳ₁₂ : p₁.π₂ ∘ (⟨ p₃.π₁ , p₂.π₁ ∘ p₃.π₂ ⟩p₁ ∘ g) ≡ p₁.π₂ ∘ p₄.π₁
cmʳ₁₂ = begin
p₁.π₂ ∘ (⟨ p₃.π₁ , p₂.π₁ ∘ p₃.π₂ ⟩p₁ ∘ g)
↑⟨ assoc ⟩
(p₁.π₂ ∘ ⟨ p₃.π₁ , p₂.π₁ ∘ p₃.π₂ ⟩p₁) ∘ g
↓⟨ ∘-resp-≡ˡ p₁.commute₂ ⟩
(p₂.π₁ ∘ p₃.π₂) ∘ g
↓⟨ assoc ⟩
p₂.π₁ ∘ (p₃.π₂ ∘ g)
↓⟨ ∘-resp-≡ʳ p₃.commute₂ ⟩
p₂.π₁ ∘ ⟨ p₁.π₂ ∘ p₄.π₁ , p₄.π₂ ⟩p₂
↓⟨ p₂.commute₁ ⟩
p₁.π₂ ∘ p₄.π₁
∎
where
open HomReasoning
.cmʳ₁ : π′₁ ∘ idʳ ≡ π′₁
cmʳ₁ = begin
π′₁ ∘ idʳ
↑⟨ assoc ⟩
(π′₁ ∘ f) ∘ g
↓⟨ ∘-resp-≡ˡ p₄.commute₁ ⟩
⟨ π₁ , p₂.π₁ ∘ p₃.π₂ ⟩p₁ ∘ g
↑⟨ p₁.universal cmʳ₁₁ cmʳ₁₂ ⟩
⟨ p₁.π₁ ∘ p₄.π₁ , p₁.π₂ ∘ p₄.π₁ ⟩p₁
↓⟨ p₁.g-η ⟩
π′₁
∎
where
open HomReasoning
.cmʳ₂ : π′₂ ∘ idʳ ≡ π′₂
cmʳ₂ = begin
π′₂ ∘ idʳ
↑⟨ assoc ⟩
(π′₂ ∘ f) ∘ g
↓⟨ ∘-resp-≡ˡ p₄.commute₂ ⟩
(p₂.π₂ ∘ p₃.π₂) ∘ g
↓⟨ assoc ⟩
p₂.π₂ ∘ (p₃.π₂ ∘ g)
↓⟨ ∘-resp-≡ʳ p₃.commute₂ ⟩
p₂.π₂ ∘ ⟨ p₁.π₂ ∘ p₄.π₁ , p₄.π₂ ⟩p₂
↓⟨ p₂.commute₂ ⟩
p₄.π₂
∎
where
open HomReasoning
.isoʳ : idʳ ≡ id
isoʳ = begin
idʳ
↑⟨ p₄.universal cmʳ₁ cmʳ₂ ⟩
⟨ π′₁ , π′₂ ⟩′
↓⟨ p₄.η ⟩
id
∎
where
open HomReasoning
-} |
Transynther/x86/_processed/NONE/_ht_st_zr_un_/i7-8650U_0xd2.log_12154_8.asm | ljhsiun2/medusa | 9 | 169853 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x9659, %rsi
lea addresses_D_ht+0x1af39, %rdi
nop
nop
nop
and %r13, %r13
mov $42, %rcx
rep movsb
nop
nop
nop
nop
inc %r11
pop %rsi
pop %rdi
pop %rcx
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r15
push %r8
push %rbx
push %rdi
push %rdx
// Store
lea addresses_UC+0x1039, %r15
nop
nop
xor $3220, %rdx
mov $0x5152535455565758, %r12
movq %r12, (%r15)
nop
nop
cmp $2389, %r15
// Store
lea addresses_US+0x6b39, %rbx
cmp $7964, %r8
movb $0x51, (%rbx)
nop
nop
dec %r12
// Store
lea addresses_WC+0xdc59, %r8
nop
nop
nop
nop
nop
cmp $59512, %rdi
movl $0x51525354, (%r8)
dec %r12
// Store
lea addresses_WC+0x9539, %rdx
nop
nop
cmp %r8, %r8
movl $0x51525354, (%rdx)
nop
nop
nop
nop
and %r12, %r12
// Faulty Load
lea addresses_A+0x5339, %r13
nop
nop
nop
add $8537, %r8
movups (%r13), %xmm7
vpextrq $1, %xmm7, %rdx
lea oracles, %r13
and $0xff, %rdx
shlq $12, %rdx
mov (%r13,%rdx,1), %rdx
pop %rdx
pop %rdi
pop %rbx
pop %r8
pop %r15
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}}
{'00': 10104, '47': 1622, '13': 240, 'e0': 31, 'a0': 12, '10': 11, 'f0': 41, 'd0': 12, '30': 17, 'b0': 28, '50': 2, '20': 19, '29': 3, '90': 2, '40': 3, 'c0': 6, '80': 1}
00 47 00 00 00 00 47 00 00 47 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 13 00 00 00 00 00 00 47 00 00 00 47 00 00 47 47 00 00 00 00 47 00 00 00 00 47 00 47 00 00 00 47 00 00 00 47 00 00 00 00 47 00 00 00 00 00 00 00 00 47 00 00 00 47 47 00 00 00 47 00 00 00 00 00 47 00 00 00 00 13 00 00 00 00 00 00 00 00 00 00 00 e0 47 00 00 13 00 00 00 00 47 00 00 00 00 47 00 00 00 13 00 00 00 00 00 00 47 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 47 00 00 00 00 00 47 00 00 00 00 13 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 47 00 00 47 00 47 00 47 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 47 00 00 47 00 00 00 00 47 00 00 47 a0 00 00 47 00 47 00 47 00 00 00 00 00 00 00 00 00 00 00 47 00 47 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 47 00 00 00 00 47 00 00 00 00 00 00 00 00 10 00 00 47 00 47 13 00 47 00 00 47 00 00 47 47 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 47 00 00 47 00 00 00 00 47 00 00 00 47 00 00 47 47 47 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 47 00 00 00 00 00 47 00 00 00 47 00 00 00 00 00 00 47 00 00 00 47 f0 00 47 00 00 47 00 13 00 00 00 00 00 00 00 00 00 47 00 00 00 00 47 00 00 00 47 00 00 00 00 00 00 47 47 00 47 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 d0 00 47 00 00 47 00 00 00 00 47 00 00 10 00 00 00 00 00 47 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 13 47 00 00 30 00 00 47 00 00 00 47 47 00 00 13 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 47 00 47 47 47 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 13 00 00 00 00 00 13 00 00 00 00 00 00 00 00 00 13 00 00 00 47 00 00 e0 00 00 00 00 00 00 00 47 00 47 00 13 00 00 00 00 00 00 00 00 47 00 00 47 00 00 47 00 00 00 00 47 00 00 00 00 00 13 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 13 47 00 00 47 00 00 00 00 00 47 47 00 00 47 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 47 00 e0 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 47 00 00 00 00 00 47 47 00 00 00 00 00 00 47 00 00 00 00 00 00 00 47 00 00 00 00 00 47 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 47 00 00 00 00 47 00 00 00 00 00 00 00 00 47 00 47 00 00 00 13 00 47 00 00 47 00 47 00 00 00 00 00 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 e0 13 00 00 00 47 00 47 00 00 00 00 00 00 00 47 00 00 00 00 47 00 47 00 47 00 47 00 00 00 47 00 47 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 b0 00 00 00 00 00 00 00 47 00 00 47 00 00 00 00 47 47 00 00 00 00 13 47 00 00 00 00 47 00 00 b0 00 00 00 00 00 00 00 00 00 13 00 00 00 00 00 00 00 47 47 00 00 00 00 47 00 00 47 00 00 00 00 13 00 00 00 00 00 00 47 00 00 00 00 00 47 00 00 00 00 00 00 00 00 00 47 47 00 47 00 50 b0 00 00 00 47 00 47 00 00 47 00 00 00 00 13 00 00 00 00 00 47 00 00 00 00 47 00 00 00 00 00 00 47 00 00 00 00 00 13 00 00 00
*/
|
Ficha 2 - Tratamento de dados de 8, 16 e 32 bits/02b.asm | FEUP-MIEIC/MPCP | 0 | 12149 | <gh_stars>0
include mpcp.inc
.data
wseq SWORD -5,-4,-3,-2,-1,0,1,2,3,127
dwseq SDWORD 10 DUP (?)
.code
main PROC C
mov ESI, OFFSET wseq
mov EDI, OFFSET dwseq
mov ECX, LENGTHOF wseq
ciclo:
mov AX, [ESI]
CWDE
mov [EDI], EAX
add ESI, TYPE wseq
add EDI, TYPE dwseq
loop ciclo
invoke ExitProcess, 0
main ENDP
end |
programs/oeis/151/A151542.asm | karttu/loda | 1 | 169872 | ; A151542: Generalized pentagonal numbers: a(n) = 12*n + 3*n*(n-1)/2.
; 0,12,27,45,66,90,117,147,180,216,255,297,342,390,441,495,552,612,675,741,810,882,957,1035,1116,1200,1287,1377,1470,1566,1665,1767,1872,1980,2091,2205,2322,2442,2565,2691,2820,2952,3087,3225,3366,3510,3657,3807,3960,4116,4275,4437,4602,4770,4941,5115,5292,5472,5655,5841,6030,6222,6417,6615,6816,7020,7227,7437,7650,7866,8085,8307,8532,8760,8991,9225,9462,9702,9945,10191,10440,10692,10947,11205,11466,11730,11997,12267,12540,12816,13095,13377,13662,13950,14241,14535,14832,15132,15435,15741,16050,16362,16677,16995,17316,17640,17967,18297,18630,18966,19305,19647,19992,20340,20691,21045,21402,21762,22125,22491,22860,23232,23607,23985,24366,24750,25137,25527,25920,26316,26715,27117,27522,27930,28341,28755,29172,29592,30015,30441,30870,31302,31737,32175,32616,33060,33507,33957,34410,34866,35325,35787,36252,36720,37191,37665,38142,38622,39105,39591,40080,40572,41067,41565,42066,42570,43077,43587,44100,44616,45135,45657,46182,46710,47241,47775,48312,48852,49395,49941,50490,51042,51597,52155,52716,53280,53847,54417,54990,55566,56145,56727,57312,57900,58491,59085,59682,60282,60885,61491,62100,62712,63327,63945,64566,65190,65817,66447,67080,67716,68355,68997,69642,70290,70941,71595,72252,72912,73575,74241,74910,75582,76257,76935,77616,78300,78987,79677,80370,81066,81765,82467,83172,83880,84591,85305,86022,86742,87465,88191,88920,89652,90387,91125,91866,92610,93357,94107,94860,95616
mov $1,$0
add $0,7
mul $1,$0
div $1,2
mul $1,3
|
Keyboard_button_display/init.asm | ViacheslavBobrov/Intel_8051_Microcontroller | 0 | 177728 | ORG 0000h ; Program Start Address
LJMP INIT ; Go to the beginning of the initialization procedure
; -- Table of interrupt vectors -----------------------------------------------------------
ORG 001Bh ; T/C1 interrupt vector address
LJMP IT100 ; Go to T/C1 interrupt processing
; --Initialization of the microcontroller --------------------------------------------------------
ORG 0030h ; Initialization start address
INIT:
CLR EA ; Disable all interrupts
MOV SP, #070h ; Stack bottom
; __ Timers Initialation _____
MOV TMOD, #00010000b ; Setting 1st timer operation mode for T/C1
MOV TH1, #08Ah ; Setting the initial value of the timer T/C1 = 30 ms
MOV TL1, #0D0h ; Setting the initial value of the timer T/C1
MOV TCON, #01000000b ; Turn on the T/C1 timer
; __ Interrupts Initialation ___
MOV IP, #00000000b ; Setting Interrupt Priorities
MOV IE, #00001000b ; Enabling T/C1 timer interrupt
; __ Initialization of program components __
SLEEP EQU 000H ; Shows whether the set delay time has passed.
MOV P3, #0 ; P3 port reset
MOV DPTR, #100H
SETB EA ; Enabling Interrupts
LJMP M11 ; Transition to the main.asm program
ORG 0170H ; Creating a table of segmented keyboard codes
TABL:
; 0 1 2 3 4 5 6 7 8 9 A B C D E F
DB 00,00,00,00,00,00,00,B9,00,00,00,5E,00,79,71,00 ; 7
DB 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 ; 8
DB 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 ; 9
DB 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 ; A
DB 00,00,00,00,00,00,00,7C,00,00,00,DF,00,FD,4F,00 ; B
DB 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 ; C
DB 00,00,00,00,00,00,00,77,00,00,00,7F,00,6D,5B,00 ; D
DB 00,00,00,00,00,00,00,3F,00,00,00,07,00,66,06,00 ; E |
src/offmt.ads | Fabien-Chouteau/offmt | 0 | 10985 | with Interfaces;
-- Offloaded Log Formatting
package Offmt is
procedure Log (Str : String) is null;
subtype U8 is Interfaces.Unsigned_8;
subtype U16 is Interfaces.Unsigned_16;
subtype U32 is Interfaces.Unsigned_32;
-- Danger Zone --
type Log_Id is new U16;
procedure Start_Frame (Id : Log_Id);
procedure End_Frame;
procedure Push_U8 (V : U8);
procedure Push_U16 (V : U16);
procedure Push_U32 (V : U32);
end Offmt;
|
libsrc/_DEVELOPMENT/math/float/math32/c/sccz80/cm32_sccz80_fsmax.asm | rjcorrig/z88dk | 0 | 11785 | <reponame>rjcorrig/z88dk
; float __fsmax (float number)
SECTION code_clib
SECTION code_math
PUBLIC cm32_sccz80_fsmax
EXTERN m32_fsmax_fastcall
; convert sccz80 float to infinity with correct sign
;
; enter : stack = ret
; DEHL = sccz80_float number
;
; exit : DEHL = sccz80_float(infinity)
;
; uses : af, bc, de, hl
DEFC cm32_sccz80_fsmax = m32_fsmax_fastcall ; enter stack = ret
; DEHL = d32_float
; return DEHL = d32_float
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_257.asm | ljhsiun2/medusa | 9 | 5854 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %rcx
push %rsi
// Faulty Load
lea addresses_normal+0x1ad79, %r13
nop
nop
nop
cmp %r11, %r11
vmovups (%r13), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %r10
lea oracles, %r13
and $0xff, %r10
shlq $12, %r10
mov (%r13,%r10,1), %r10
pop %rsi
pop %rcx
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
oeis/028/A028365.asm | neoneye/loda-programs | 11 | 25636 | <gh_stars>10-100
; A028365: Order of general affine group over GF(2), AGL(n,2).
; Submitted by <NAME>(s1.)
; 1,2,24,1344,322560,319979520,1290157424640,20972799094947840,1369104324918194995200,358201502736997192984166400,375234700595146883504949480652800,1573079924978208093254925489963584716800,26385458351250481733136055834218002085052416000,1770481986396919364617154013905548534404418268823552000,475231131781377719509366115693602433255794024417464359583744000,510259969886794669593834275239764653850381608487716607442306323185664000
mov $2,1
mov $4,1
lpb $0
sub $0,1
add $3,$2
mul $4,$3
mul $4,$2
mul $2,2
lpe
mul $4,$2
mov $0,$4
|
oeis/157/A157729.asm | neoneye/loda-programs | 11 | 92744 | ; A157729: a(n) = Fibonacci(n) + 5.
; Submitted by <NAME>(m1)
; 5,6,6,7,8,10,13,18,26,39,60,94,149,238,382,615,992,1602,2589,4186,6770,10951,17716,28662,46373,75030,121398,196423,317816,514234,832045,1346274,2178314,3524583,5702892,9227470,14930357,24157822,39088174,63245991,102334160,165580146,267914301,433494442,701408738,1134903175,1836311908,2971215078,4807526981,7778742054,12586269030,20365011079,32951280104,53316291178,86267571277,139583862450,225851433722,365435296167,591286729884,956722026046,1548008755925,2504730781966,4052739537886,6557470319847
seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
add $0,5
|
test/Fail/ScopeIrrelevantRecordField.agda | redfish64/autonomic-agda | 3 | 8156 | {-# OPTIONS --no-irrelevant-projections #-}
module ScopeIrrelevantRecordField where
record Bla : Set1 where
constructor mkBla
field
.bla0 bla1 .{bla2 bla3} {bla4 .bla5} : Set
bla0' : Bla -> Set
bla0' = Bla.bla0 -- should fail with bla0 not in scope
|
tests/testme-native.asm | gregdionne/mcbasic | 5 | 24041 | ; Assembly for testme-native.bas
; compiled with mcbasic -native
; Equates for MC-10 MICROCOLOR BASIC 1.0
;
; Direct page equates
DP_LNUM .equ $E2 ; current line in BASIC
DP_TABW .equ $E4 ; current tab width on console
DP_LPOS .equ $E6 ; current line position on console
DP_LWID .equ $E7 ; current line width of console
;
; Memory equates
M_KBUF .equ $4231 ; keystrobe buffer (8 bytes)
M_PMSK .equ $423C ; pixel mask for SET, RESET and POINT
M_IKEY .equ $427F ; key code for INKEY$
M_CRSR .equ $4280 ; cursor location
M_LBUF .equ $42B2 ; line input buffer (130 chars)
M_MSTR .equ $4334 ; buffer for small string moves
M_CODE .equ $4346 ; start of program space
;
; ROM equates
R_BKMSG .equ $E1C1 ; 'BREAK' string location
R_ERROR .equ $E238 ; generate error and restore direct mode
R_BREAK .equ $E266 ; generate break and restore direct mode
R_RESET .equ $E3EE ; setup stack and disable CONT
R_SPACE .equ $E7B9 ; emit " " to console
R_QUEST .equ $E7BC ; emit "?" to console
R_REDO .equ $E7C1 ; emit "?REDO" to console
R_EXTRA .equ $E8AB ; emit "?EXTRA IGNORED" to console
R_DMODE .equ $F7AA ; display OK prompt and restore direct mode
R_KPOLL .equ $F879 ; if key is down, do KEYIN, else set Z CCR flag
R_KEYIN .equ $F883 ; poll key for key-down transition set Z otherwise
R_PUTC .equ $F9C9 ; write ACCA to console
R_MKTAB .equ $FA7B ; setup tabs for console
R_GETLN .equ $FAA4 ; get line, returning with X pointing to M_BUF-1
R_SETPX .equ $FB44 ; write pixel character to X
R_CLRPX .equ $FB59 ; clear pixel character in X
R_MSKPX .equ $FB7C ; get pixel screen location X and mask in R_PMSK
R_CLSN .equ $FBC4 ; clear screen with color code in ACCB
R_CLS .equ $FBD4 ; clear screen with space character
R_SOUND .equ $FFAB ; play sound with pitch in ACCA and duration in ACCB
R_MCXID .equ $FFDA ; ID location for MCX BASIC
; direct page registers
.org $80
strtcnt .block 1
strbuf .block 2
strend .block 2
strfree .block 2
strstop .block 2
dataptr .block 2
inptptr .block 2
redoptr .block 2
letptr .block 2
.org $a3
r1 .block 5
r2 .block 5
r3 .block 5
rend
rvseed .block 2
tmp1 .block 2
tmp2 .block 2
tmp3 .block 2
tmp4 .block 2
tmp5 .block 2
argv .block 10
; main program
.org M_CODE
jsr progbegin
jsr clear
LINE_10
; X(4)=9
ldab #4
jsr ld_ir1_pb
ldx #INTARR_X
jsr arrref1_ir1_ix
ldab #9
jsr ld_ip_pb
; Y=X(4)+Y(8,12)
ldab #4
jsr ld_ir1_pb
ldx #INTARR_X
jsr arrval1_ir1_ix
ldab #8
jsr ld_ir2_pb
ldab #12
jsr ld_ir3_pb
ldx #INTARR_Y
jsr arrval2_ir2_ix
jsr add_ir1_ir1_ir2
ldx #INTVAR_Y
jsr ld_ix_ir1
; Y(8,12)=2
ldab #8
jsr ld_ir1_pb
ldab #12
jsr ld_ir2_pb
ldx #INTARR_Y
jsr arrref2_ir1_ix
ldab #2
jsr ld_ip_pb
LLAST
; END
jsr progend
.module mdalloc
; alloc D bytes in array memory.
; then relink strings.
alloc
std tmp1
ldx strfree
addd strfree
std strfree
ldd strend
addd tmp1
std strend
sts tmp2
subd tmp2
blo _ok
ldab #OM_ERROR
jmp error
_ok
lds strfree
des
_again
dex
dex
ldd ,x
pshb
psha
cpx strbuf
bhi _again
lds tmp2
ldx strbuf
ldd strbuf
addd tmp1
std strbuf
clra
_nxtz
staa ,x
inx
cpx strbuf
blo _nxtz
ldx strbuf
; relink permanent strings
; ENTRY: X points to offending link word in strbuf
; EXIT: X points to strend
strlink
cpx strend
bhs _rts
stx tmp1
ldd tmp1
addd #2
ldx ,x
std 1,x
ldab 0,x
ldx 1,x
abx
bra strlink
_rts
rts
.module mdmul12
mul12
ldaa tmp1+1
ldab tmp2+1
mul
std tmp3
ldaa tmp1
ldab tmp2+1
mul
addb tmp3
stab tmp3
ldaa tmp1+1
ldab tmp2
mul
tba
adda tmp3
ldab tmp3+1
rts
.module mdprint
print
_loop
ldaa ,x
jsr R_PUTC
inx
decb
bne _loop
rts
.module mdref1
; validate offset from 1D descriptor X and argv
; if empty desc, then alloc D bytes in array memory and 11 elements.
; return word offset in D and byte offset in tmp1
ref1
std tmp1
ldd ,x
bne _preexist
ldd strbuf
std ,x
ldd #11
std 2,x
ldd tmp1
pshx
jsr alloc
pulx
_preexist
ldd 0+argv
subd 2,x
bhi _err
ldd 0+argv
std tmp1
lsld
rts
_err
ldab #BS_ERROR
jmp error
.module mdref2
; get offset from 2D descriptor X and argv.
; return word offset in D and byte offset in tmp1
ref2
ldd 2,x
std tmp1
subd 0+argv
bls _err
ldd 2+argv
std tmp2
subd 4,x
bhs _err
jsr mul12
addd 0+argv
std tmp1
lsld
rts
_err
ldab #BS_ERROR
jmp error
.module mdrefint
; return int/str array reference in D/tmp1
refint
addd tmp1
addd 0,x
std tmp1
rts
add_ir1_ir1_ir2 ; numCalls = 1
.module modadd_ir1_ir1_ir2
ldd r1+1
addd r2+1
std r1+1
ldab r1
adcb r2
stab r1
rts
arrref1_ir1_ix ; numCalls = 1
.module modarrref1_ir1_ix
ldd r1+1
std 0+argv
ldd #33
jsr ref1
jsr refint
std letptr
rts
arrref2_ir1_ix ; numCalls = 1
.module modarrref2_ir1_ix
ldd r1+1
std 0+argv
ldd r1+1+5
std 2+argv
jsr ref2
jsr refint
std letptr
rts
arrval1_ir1_ix ; numCalls = 1
.module modarrval1_ir1_ix
ldd r1+1
std 0+argv
ldd #33
jsr ref1
jsr refint
ldx tmp1
ldab ,x
stab r1
ldd 1,x
std r1+1
rts
arrval2_ir2_ix ; numCalls = 1
.module modarrval2_ir2_ix
ldd r2+1
std 0+argv
ldd r2+1+5
std 2+argv
jsr ref2
jsr refint
ldx tmp1
ldab ,x
stab r2
ldd 1,x
std r2+1
rts
clear ; numCalls = 1
.module modclear
clra
ldx #bss
bra _start
_again
staa ,x
inx
_start
cpx #bes
bne _again
stx strbuf
stx strend
inx
inx
stx strfree
ldx #$8FFF
stx strstop
ldx #startdata
stx dataptr
rts
ld_ip_pb ; numCalls = 2
.module modld_ip_pb
ldx letptr
stab 2,x
ldd #0
std 0,x
rts
ld_ir1_pb ; numCalls = 3
.module modld_ir1_pb
stab r1+2
ldd #0
std r1
rts
ld_ir2_pb ; numCalls = 2
.module modld_ir2_pb
stab r2+2
ldd #0
std r2
rts
ld_ir3_pb ; numCalls = 1
.module modld_ir3_pb
stab r3+2
ldd #0
std r3
rts
ld_ix_ir1 ; numCalls = 1
.module modld_ix_ir1
ldd r1+1
std 1,x
ldab r1
stab 0,x
rts
progbegin ; numCalls = 1
.module modprogbegin
ldx R_MCXID
cpx #'h'*256+'C'
bne _mcbasic
pulx
clrb
pshb
pshb
pshb
stab strtcnt
jmp ,x
_reqmsg .text "?MICROCOLOR BASIC ROM REQUIRED"
_mcbasic
ldx #_reqmsg
ldab #30
jsr print
pulx
rts
progend ; numCalls = 1
.module modprogend
pulx
pula
pula
pula
jsr R_RESET
jmp R_DMODE
NF_ERROR .equ 0
RG_ERROR .equ 4
OD_ERROR .equ 6
FC_ERROR .equ 8
OV_ERROR .equ 10
OM_ERROR .equ 12
BS_ERROR .equ 16
DD_ERROR .equ 18
LS_ERROR .equ 28
error
jmp R_ERROR
; data table
startdata
enddata
; block started by symbol
bss
; Numeric Variables
INTVAR_Y .block 3
; String Variables
; Numeric Arrays
INTARR_X .block 4 ; dims=1
INTARR_Y .block 6 ; dims=2
; String Arrays
; block ended by symbol
bes
.end
|
asm/clock.ext.asm | RockmanEXEZone/MMBN45-English-Translation | 6 | 21487 | <filename>asm/clock.ext.asm
// 0x200F859 = RTC state
// 0x0 RTC not checked
// 0x1 Running on real RTC
// 0x2 Detected RTC broken at startup
// 0x3 Requesting RTC Init from Continue
// 0x4 Fake RTC initialized, do continue
// 0x5 Running on fake RTC
.align 2
clock_preBoot:
// Clear real/fake RTC states
ldr r0,=0x200F850
mov r1,0x14
ldr r2,=0x800090D
mov r14,r2
bl r14
ldr r0,=0x8000245
bx r0
.align 2
clock_softResetRtc:
push r14
// Clear all RTC data except fake RTC and decimal states
ldr r0,=0x200F850
mov r1,0x0
str r1,[r0]
str r1,[r0,0x4]
@@clearRest:
add r0,0x14
mov r1,0x1C
ldr r2,=0x800090D
mov r14,r2
bl r14
ldr r0,=0x8005FA3
bx r0
.align 2
clock_openRtcOnContinue:
ldr r1,=0x200F850
ldrb r0,[r1,0x9] // fake rtc state
cmp r0,0x3
bne @@checkMenu
mov r0,0x2
strb r0,[r1,0x9] // fake rtc state
@@checkMenu:
ldrb r0,[r5,0x8]
tst r0,r0
bne @@checkContinue
@@doNewGame:
ldr r0,=0x80020F9
mov r14,r0
bl r14
ldr r0,=0x8028ECB
bx r0
@@checkContinue:
cmp r0,0x1
bne @@doSetTime
// Check if there is a last chosen Navi
// Get last used Navi
ldr r0,=0x8000CED
mov r14,r15
bx r0
// Check if Navi has been used before
mov r1,0x80
add r1,r1,r0
mov r0,0xE
ldr r3,=0x80287AF
mov r14,r15
bx r3
bne @@checkRtcState
// This is a starter save, go through whole setup
// Set game state to profile entry
ldr r0,=0x8039C53
mov r14,r15
bx r0
// Clear flag 0x1E06 (bypasses save initialization)
mov r0,0x1E
mov r1,0x6
ldr r3,=0x802874F
mov r14,r15
bx r3
b @@end
@@checkRtcState:
ldr r1,=0x200F850
ldrb r0,[r1,0x9] // fake rtc state
cmp r0,0x2
beq @@doRtcInit
@@checkName:
// Check if name needs to be initialized
ldr r0,=0x2000E50
ldrb r0,[r0]
tst r0,r0
bne @@doContinue
@@doNameInput:
// Set game state to profile entry
ldr r0,=0x8039C53
mov r14,r15
bx r0
@@profileNameOnly:
// Set profile entry to name only
ldr r1,=0x200F5E8
mov r0,0x2
strb r0,[r1,0x7]
// Start profile entry music
mov r0,0x38
ldr r1,=0x800055B
mov r14,r15
bx r1
@@end:
pop r7,r15
@@doRtcInit:
mov r0,0x3
strb r0,[r1,0x9] // fake rtc state
b @@doSetTime
@@doContinue:
ldr r0,=0x8028EFB
bx r0
@@doSetTime:
ldr r0,=0x8028F2D
bx r0
.pool
.align 4
clock_setTimeStateTable:
.dw 0x803A635 // 00
.dw 0x803A69B // 04
.dw 0x803A725 // 08
.dw 0x803A7FD // 0C
.dw 0x803A829 // 10
.dw 0x803A85F // 14
.dw @setTimeStateRtcInit|1
.align 2
clock_setRtcInitState:
ldr r0,=0x200F850
ldrb r0,[r0,0x9] // fake rtc state
cmp r0,0x1
beq @@checkContinue
cmp r0,0x5
beq @@checkContinue
// Check need to fill existing RTC
ldrb r0,[r5,0xF]
tst r0,r0
beq @@checkContinue
// RTC not running, init from last datetime (if possible)
// Check last datetime valid
ldr r0,=(0x2003D40+0xC)
ldrb r1,[r0] // year
cmp r1,0x63
bgt @@checkContinue
ldrb r1,[r0,0x1] // month
cmp r1,0x1
blt @@checkContinue
cmp r1,0xC
bgt @@checkContinue
ldr r1,=0x800644F // get days in month
mov r14,r1
bl r14
ldr r2,=(0x2003D40+0xC)
ldrb r1,[r2,0x2] // day
cmp r1,0x1
blt @@checkContinue
cmp r1,r0
bgt @@checkContinue
ldrb r1,[r2,0x3] // hour
cmp r1,0x17
bgt @@checkContinue
ldrb r1,[r2,0x4] // minute
cmp r1,0x3B
bgt @@checkContinue
// Copy datetime
ldr r0,=0x200F850
add r0,0x14
ldrb r1,[r2] // year
strb r1,[r0,0x0]
ldrb r1,[r2,0x1] // month
strb r1,[r0,0x1]
ldrb r1,[r2,0x2] // day
strb r1,[r0,0x2]
ldrb r1,[r2,0x3] // hour
strb r1,[r0,0x4]
ldrb r1,[r2,0x4] // minute
strb r1,[r0,0x5]
// Set weekday
mov r1,0x0
ldr r2,=0x80065C1
mov r14,r2
bl r14
@@checkContinue:
ldr r0,=0x200F850
ldrb r0,[r0,0x9] // fake rtc state
cmp r0,0x3
bne @@normal
// Go to RTC init message state
mov r0,0x18
strb r0,[r5,0x1]
bl @setTimeStateRtcInit
pop r15
@@normal:
mov r0,0x1E
mov r1,0x1E
ldr r3,=0x80287AF
mov r14,r3
bl r14
ldr r0,=0x803A679
bx r0
.align 2
clock_disableRtcInitAbort:
ldr r0,=0x200F850
ldrb r0,[r0,0x9] // fake rtc state
cmp r0,0x3
beq @@noAbort
ldrb r0,[r5,0xF]
tst r0,r0
beq @@noAbort
@@abort:
mov r1,0x10
ldr r2,=0x803A6E5
bx r2
@@noAbort:
ldr r0,=0x803A709
bx r0
.align 2
@setTimeStateRtcInit:
push r4,r14
ldrb r0,[r5,0x2]
tst r0,r0
bne @@substate04
// Show RTC battery empty message
ldr r0,=file_clockmsg
mov r1,0x0
ldr r2,=0x804F7B7
mov r14,r2
bl r14
mov r0,0x4
strb r0,[r5,0x2]
b @@end
@@substate04:
// Check if message finished
mov r0,0x80
ldr r1,=0x8055409
mov r14,r1
bl r14
bne @@end
// Play sound effect
//mov r0,0x7E
//ldr r1,=0x8000535
//mov r14,r1
//bl r14
@@nextState:
// Go to state 04
mov r0,0x4
strb r0,[r5,0x1]
mov r0,0x0
strb r0,[r5,0x2]
@@end:
pop r4,r15
.align 2
clock_applyRtcChange:
ldr r1,=0x200F850
ldrh r0,[r1,0x14] // year and month
strh r0,[r1,0xA]
ldrh r0,[r1,0x16] // day and weekday
strh r0,[r1,0xC]
ldrh r0,[r1,0x18] // hour and minute
strh r0,[r1,0xE]
ldrb r0,[r1,0x1A] // second
strb r0,[r1,0x10]
ldrb r0,[r1,0x9] // fake rtc state
cmp r0,0x2 // rtc broken at startup, but chose New Game or Set Time
beq @@markTimeSet
cmp r0,0x3 // rtc broken at startup, and chose Continue
bne @@normal
@@markTimeSetAndContinue:
mov r0,0x4 // must do continue after exit
strb r0,[r1,0x9] // fake rtc state
// Restart RTC
ldr r0,=0x8005FB7
mov r14,r0
bl r14
b @@end
@@markTimeSet:
mov r0,0x5 // fake rtc running
strb r0,[r1,0x9] // fake rtc state
@@normal:
// If saved game exists
mov r0,0x1E
mov r1,0x6
ldr r3,=0x80287AF
mov r14,r3
bl r14
beq @@end
// Restart RTC, reset tournaments and Zennys
ldr r0,=0x8006805
mov r14,r0
bl r14
@@end:
ldr r0,=0x803A75D
bx r0
.align 2
clock_continueAfterRtcInit:
ldr r1,=0x200F850
ldrb r0,[r1,0x9] // fake rtc state
cmp r0,0x4
bne @@returnToTitle
@@continueGame:
mov r0,0x5
strb r0,[r1,0x9] // fake rtc state
ldr r0,=0x80041F5
mov r14,r0
bl r14
// Undo music stop
mov r3,r10
ldr r3,[r3,0x40]
mov r0,0x38
strb r0,[r3,0x19]
mov r0,0x1E
mov r1,0x6
ldr r3,=0x802871F
mov r14,r3
bl r14
mov r0,0x1E
mov r1,0x1E
ldr r3,=0x80287AF
mov r14,r3
bl r14
bne @@openNaviSelect
@@openOverworld:
ldr r0,=0x8030755
mov r14,r0
bl r14
mov r3,r10
ldr r0,[r3]
mov r1,0x4
strb r1,[r0]
ldr r0,=0x803675D
mov r14,r0
bl r14
ldr r0,=0x80067DD
mov r14,r0
bl r14
pop r15
@@openNaviSelect:
ldr r0,=0x8038DF5
mov r14,r0
bl r14
pop r15
@@returnToTitle:
mov r3,r10
ldr r0,[r3]
mov r1,0x0
strb r1,[r0]
ldr r0,=0x8028C6D
mov r14,r0
bl r14
ldr r0,=0x8029433
bx r0
.pool
.align 2
clock_fakeRtc:
push r4,r14
sub sp,0x4
// Check if fake RTC has been started
ldrb r0,[r7,0x9] // fake rtc state
cmp r0,0x2
bge @@tickFakeRtc
@@doRealRtc:
// Begin RTC
mov r0,r7
ldr r1,=0x80ECDF1
mov r14,r1
bl r14
// Get date/time from RTC
mov r0,r7
ldr r1,=0x80ECF65
mov r14,r1
bl r14
ldr r4,=0x800661D // 0x99 -> 99
// RTC working check
// Check year valid
ldrb r0,[r7] // Year 0x00...0x99
cmp r0,0x99
bgt @@isBroken // Year > 99
lsl r1,r0,0x1C
lsr r1,r1,0x1C
cmp r1,0x9
bgt @@isBroken // Hex digit in year 0X
lsr r1,r0,0x4
cmp r1,0x9
bgt @@isBroken // Hex digit in year X0
// Convert year
mov r14,r4
bl r14
str r0,[sp]
// Check month valid
ldrb r0,[r7,0x1] // Month 0x01...0x12
tst r0,r0
beq @@isBroken // Month < 1
cmp r0,0x12
bgt @@isBroken // Month > 12
lsl r1,r0,0x1C
lsr r1,r1,0x1C
cmp r1,0x9
bgt @@isBroken // Hex digit in month 0X
lsr r1,r0,0x4
cmp r1,0x9
bgt @@isBroken // Hex digit in month X0
// Convert month
mov r14,r4
bl r14
mov r1,sp
strb r0,[r1,0x1]
// Check day valid
ldrb r0,[r7,0x1] // Day 0x01...0x31
tst r0,r0
beq @@isBroken // Day < 1
lsl r1,r0,0x1C
lsr r1,r1,0x1C
cmp r1,0x9
bgt @@isBroken // Hex digit in day 0X
lsr r1,r0,0x4
cmp r1,0x9
bgt @@isBroken // Hex digit in day X0
// Convert day
mov r14,r4
bl r14
mov r4,r0
// Day max check
mov r0,sp
ldr r1,=0x800644F // Get days in month
mov r14,r1
bl r14
cmp r4,r0
bgt @@isBroken // Day > max
// Check weekday valid
ldrb r0,[r7,0x3]
cmp r0,0x6
bgt @@isBroken
// Check hour valid
ldrb r0,[r7,0x4]
cmp r0,0x23
bgt @@isBroken // Hour > 23
lsl r1,r0,0x1C
lsr r1,r1,0x1C
cmp r1,0x9
bgt @@isBroken // Hex digit in hour 0X
lsr r1,r0,0x4
cmp r1,0x9
bgt @@isBroken // Hex digit in hour X0
// Check minute valid
ldrb r0,[r7,0x5]
cmp r0,0x59
bgt @@isBroken // Minute > 59
lsl r1,r0,0x1C
lsr r1,r1,0x1C
cmp r1,0x9
bgt @@isBroken // Hex digit in minute 0X
lsr r1,r0,0x4
cmp r1,0x9
bgt @@isBroken // Hex digit in minute X0
// Check second valid
ldrb r0,[r7,0x6]
cmp r0,0x59
bgt @@isBroken // Second > 59
lsl r1,r0,0x1C
lsr r1,r1,0x1C
cmp r1,0x9
bgt @@isBroken // Hex digit in second 0X
lsr r1,r0,0x4
cmp r1,0x9
bgt @@isBroken // Hex digit in second X0
@@isWorking:
// Increment frame counter
ldrb r0,[r7,0x8]
add r0,0x1
cmp r0,0x3C
bge @@checkSecondChanged
strb r0,[r7,0x8]
@@checkSecondChanged:
// Get the previous second
ldrb r0,[r7,0x10]
// Convert to hex
ldr r4,=0x800662D
mov r14,r4
bl r14
// Get the current second
ldrb r1,[r7,0x6]
// If second changed, reset frame counter
cmp r0,r1
beq @@markWorking
mov r0,0x0
strb r0,[r7,0x8]
@@markWorking:
// Mark real RTC working
mov r0,0x1
strb r0,[r7,0x9] // fake rtc state
// Do rest of RTC stuff as normal
add sp,0x4
pop r4,r15
@@isBroken:
// Clear fake RTC state
mov r0,0x0
strb r0,[r7,0x7]
// Check if we have a valid date/time
ldrb r0,[r7,0x9] // fake rtc state
cmp r0,0x1
beq @@brokeMidGame
@@brokeAtStartup:
// Mark fake RTC as not initialized
mov r0,0x2
strb r0,[r7,0x9] // fake rtc state
b @@initializeTimeDate
@@brokeMidGame:
// Mark fake RTC as already initialized
mov r0,0x5
strb r0,[r7,0x9] // fake rtc state
b @@setFakeRtc
@@tickFakeRtc:
cmp r0,0x4
blt @@initializeTimeDate
// Increment frame counter
ldrb r0,[r7,0x8]
add r0,0x1
strb r0,[r7,0x8]
cmp r0,0x3C
blt @@setFakeRtc
@@incSecond:
mov r0,0x0
strb r0,[r7,0x8]
ldrb r0,[r7,0x10]
add r0,0x1
strb r0,[r7,0x10]
cmp r0,0x3C
blt @@setFakeRtc
@@incMinute:
mov r0,0x0
strb r0,[r7,0x10]
ldrb r0,[r7,0xF]
add r0,0x1
strb r0,[r7,0xF]
cmp r0,0x3C
blt @@setFakeRtc
@@incHour:
mov r0,0x0
strb r0,[r7,0xF]
ldrb r0,[r7,0xE]
add r0,0x1
strb r0,[r7,0xE]
cmp r0,0x18
blt @@setFakeRtc
@@incWeekday:
mov r0,0x0
strb r0,[r7,0xE]
ldrb r0,[r7,0xD]
add r0,0x1
strb r0,[r7,0xD]
cmp r0,0x7
blt @@incDay
mov r0,0h
strb r0,[r7,0xD]
@@incDay:
// Get days in current month
ldr r0,=0x800644F
mov r14,r0
mov r0,r7
add r0,0xA
bl r14
ldrb r1,[r7,0xC]
add r1,0x1
strb r1,[r7,0xC]
cmp r1,r0
ble @@setFakeRtc
@@incMonth:
mov r0,0x1
strb r0,[r7,0xC]
ldrb r0,[r7,0xB]
add r0,0x1
strb r0,[r7,0xB]
cmp r0,0xC
ble @@setFakeRtc
@@incYear:
mov r0,0x1
strb r0,[r7,0xB]
ldrb r0,[r7,0xA]
add r0,0x1
strb r0,[r7,0xA]
cmp r0,0x63
ble @@setFakeRtc
@@initializeTimeDate:
// Initialize the RTC to 1/1/2000, 0:00 AM
mov r0,0x0
strb r0,[r7,0xA] // dec year
strh r0,[r7,0xE] // dec hour, minute
str r0,[r7,0x10] // dec second, state, unknowns
strb r0,[r7,0x8] // fake RTC frames
mov r0,0x1
strb r0,[r7,0xB] // dec month
strb r0,[r7,0xC] // dec day
mov r0,0x6 // Saturday
strb r0,[r7,0xD]
@@setFakeRtc:
// Copy RTC from dec to hex
ldr r4,=0x800662D
// Copy year
ldrb r0,[r7,0xA]
mov r14,r4
bl r14
strb r0,[r7]
// Copy month
ldrb r0,[r7,0xB]
mov r14,r4
bl r14
strb r0,[r7,0x1]
// Copy day
ldrb r0,[r7,0xC]
mov r14,r4
bl r14
strb r0,[r7,0x2]
// Copy weekday
ldrb r0,[r7,0xD]
strb r0,[r7,0x3]
// Copy hour
ldrb r0,[r7,0xE]
mov r14,r4
bl r14
strb r0,[r7,0x4]
// Copy minute
ldrb r0,[r7,0xF]
mov r14,r4
bl r14
strb r0,[r7,0x5]
// Copy second
ldrb r0,[r7,0x10]
mov r14,r4
bl r14
strb r0,[r7,0x6]
// Clear state
mov r0,0x0
strb r0,[r7,0x7]
add sp,0x4
pop r4,r15
.pool
|
alloy4fun_models/trainstlt/models/16/7afxh5pxQCCNTor2K.als | Kaixi26/org.alloytools.alloy | 0 | 4064 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred id7afxh5pxQCCNTor2K_prop17 {
always (some t:Train | historically no Train.pos and eventually(t.pos in Exit and historically no Exit))
}
pred __repair { id7afxh5pxQCCNTor2K_prop17 }
check __repair { id7afxh5pxQCCNTor2K_prop17 <=> prop17o } |
pwnlib/shellcraft/templates/i386/linux/recvsize.asm | DrKeineLust/pwntools | 8,966 | 28272 | <filename>pwnlib/shellcraft/templates/i386/linux/recvsize.asm
<% from pwnlib.shellcraft import common %>
<% from pwnlib.shellcraft import i386 %>
<%docstring>
Recives 4 bytes size field
Useful in conjuncion with findpeer and stager
Args:
sock, the socket to read the payload from.
reg, the place to put the size (default ecx).
Leaves socket in ebx
</%docstring>
<%page args="sock, reg='ecx'"/>
<%
recvsize = common.label("recvsize")
%>
${recvsize}:
${i386.linux.syscall('SYS_read', sock, 'esp', 4)}
pop ${reg}
|
projects/batfish/src/main/antlr4/org/batfish/grammar/mrv/Mrv_subtemplate.g4 | zabrewer/batfish | 763 | 1682 | <filename>projects/batfish/src/main/antlr4/org/batfish/grammar/mrv/Mrv_subtemplate.g4<gh_stars>100-1000
parser grammar Mrv_subtemplate;
import Mrv_common;
options {
tokenVocab = MrvLexer;
}
a_subtemplate
:
SUBTEMPLATE PERIOD
(
a_subtemplate_idletimeout
| a_subtemplate_sercurityv3
| a_subtemplate_prompt
)
;
a_subtemplate_idletimeout
:
IDLETIMEOUT nidecl
;
a_subtemplate_sercurityv3
:
SECURITYV3 nidecl
;
a_subtemplate_prompt
:
PROMPT nsdecl
;
|
cd&command/cdcommand.applescript | MuteBardTison/alfred-workflows | 1 | 3354 | <filename>cd&command/cdcommand.applescript
on run theQuery
tell application "Finder"
try
set targetFolder to (folder of front window as alias)
on error
set targetFolder to (path to home folder)
end try
set targetPath to quoted form of (the POSIX path of targetFolder)
if (theQuery as string) is not "" then
set theCommand to (theQuery as string)
else
set theCommand to "cd " & targetPath
end if
end tell
tell application "Terminal"
activate
set terminalWindow to ""
if (count of windows) is greater than 0 then
repeat with theWindow in windows
if theWindow is not busy then
set terminalWindow to theWindow
set frontmost of terminalWindow to true
exit repeat
end if
end repeat
end if
if terminalWindow is not "" then
do script theCommand in terminalWindow
else
do script theCommand
end if
end tell
end run |
aom_dsp/x86/intrapred_ssse3.asm | merryApple/aom | 147 | 9797 | <reponame>merryApple/aom
;
; Copyright (c) 2016, Alliance for Open Media. All rights reserved
;
; This source code is subject to the terms of the BSD 2 Clause License and
; the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
; was not distributed with this source code in the LICENSE file, you can
; obtain it at www.aomedia.org/license/software. If the Alliance for Open
; Media Patent License 1.0 was not distributed with this source code in the
; PATENTS file, you can obtain it at www.aomedia.org/license/patent.
;
;
%include "third_party/x86inc/x86inc.asm"
SECTION_RODATA
pb_1: times 16 db 1
sh_b12345677: db 1, 2, 3, 4, 5, 6, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0
sh_b23456777: db 2, 3, 4, 5, 6, 7, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0
sh_b0123456777777777: db 0, 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7
sh_b1234567777777777: db 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
sh_b2345677777777777: db 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
sh_b123456789abcdeff: db 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15
sh_b23456789abcdefff: db 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15
sh_b32104567: db 3, 2, 1, 0, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0
sh_b8091a2b345: db 8, 0, 9, 1, 10, 2, 11, 3, 4, 5, 0, 0, 0, 0, 0, 0
sh_b76543210: db 7, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
sh_b65432108: db 6, 5, 4, 3, 2, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0
sh_b54321089: db 5, 4, 3, 2, 1, 0, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0
sh_b89abcdef: db 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0
sh_bfedcba9876543210: db 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
SECTION .text
; ------------------------------------------
; input: x, y, z, result
;
; trick from pascal
; (x+2y+z+2)>>2 can be calculated as:
; result = avg(x,z)
; result -= xor(x,z) & 1
; result = avg(result,y)
; ------------------------------------------
%macro X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 4
pavgb %4, %1, %3
pxor %3, %1
pand %3, [GLOBAL(pb_1)]
psubb %4, %3
pavgb %4, %2
%endmacro
INIT_XMM ssse3
cglobal d63e_predictor_4x4, 3, 4, 5, dst, stride, above, goffset
GET_GOT goffsetq
movq m3, [aboveq]
pshufb m1, m3, [GLOBAL(sh_b23456777)]
pshufb m2, m3, [GLOBAL(sh_b12345677)]
X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 m3, m2, m1, m4
pavgb m3, m2
; store 4 lines
movd [dstq ], m3
movd [dstq+strideq], m4
lea dstq, [dstq+strideq*2]
psrldq m3, 1
psrldq m4, 1
movd [dstq ], m3
movd [dstq+strideq], m4
RESTORE_GOT
RET
INIT_XMM ssse3
cglobal d153_predictor_4x4, 4, 5, 4, dst, stride, above, left, goffset
GET_GOT goffsetq
movd m0, [leftq] ; l1, l2, l3, l4
movd m1, [aboveq-1] ; tl, t1, t2, t3
punpckldq m0, m1 ; l1, l2, l3, l4, tl, t1, t2, t3
pshufb m0, [GLOBAL(sh_b32104567)]; l4, l3, l2, l1, tl, t1, t2, t3
psrldq m1, m0, 1 ; l3, l2, l1, tl, t1, t2, t3
psrldq m2, m0, 2 ; l2, l1, tl, t1, t2, t3
; comments below are for a predictor like this
; A1 B1 C1 D1
; A2 B2 A1 B1
; A3 B3 A2 B2
; A4 B4 A3 B3
X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 m0, m1, m2, m3 ; 3-tap avg B4 B3 B2 B1 C1 D1
pavgb m1, m0 ; 2-tap avg A4 A3 A2 A1
punpcklqdq m3, m1 ; B4 B3 B2 B1 C1 D1 x x A4 A3 A2 A1 ..
DEFINE_ARGS dst, stride, stride3
lea stride3q, [strideq*3]
pshufb m3, [GLOBAL(sh_b8091a2b345)] ; A4 B4 A3 B3 A2 B2 A1 B1 C1 D1 ..
movd [dstq+stride3q ], m3
psrldq m3, 2 ; A3 B3 A2 B2 A1 B1 C1 D1 ..
movd [dstq+strideq*2], m3
psrldq m3, 2 ; A2 B2 A1 B1 C1 D1 ..
movd [dstq+strideq ], m3
psrldq m3, 2 ; A1 B1 C1 D1 ..
movd [dstq ], m3
RESTORE_GOT
RET
INIT_XMM ssse3
cglobal d153_predictor_8x8, 4, 5, 8, dst, stride, above, left, goffset
GET_GOT goffsetq
movq m0, [leftq] ; [0- 7] l1-8 [byte]
movhps m0, [aboveq-1] ; [8-15] tl, t1-7 [byte]
pshufb m1, m0, [GLOBAL(sh_b76543210)] ; l8-1 [word]
pshufb m2, m0, [GLOBAL(sh_b65432108)] ; l7-1,tl [word]
pshufb m3, m0, [GLOBAL(sh_b54321089)] ; l6-1,tl,t1 [word]
pshufb m0, [GLOBAL(sh_b89abcdef)] ; tl,t1-7 [word]
psrldq m4, m0, 1 ; t1-7 [word]
psrldq m5, m0, 2 ; t2-7 [word]
; comments below are for a predictor like this
; A1 B1 C1 D1 E1 F1 G1 H1
; A2 B2 A1 B1 C1 D1 E1 F1
; A3 B3 A2 B2 A1 B1 C1 D1
; A4 B4 A3 B3 A2 B2 A1 B1
; A5 B5 A4 B4 A3 B3 A2 B2
; A6 B6 A5 B5 A4 B4 A3 B3
; A7 B7 A6 B6 A5 B5 A4 B4
; A8 B8 A7 B7 A6 B6 A5 B5
pavgb m6, m1, m2 ; 2-tap avg A8-A1
X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 m0, m4, m5, m7 ; 3-tap avg C-H1
X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 m1, m2, m3, m0 ; 3-tap avg B8-1
punpcklbw m6, m0 ; A-B8, A-B7 ... A-B2, A-B1
DEFINE_ARGS dst, stride, stride3
lea stride3q, [strideq*3]
movhps [dstq+stride3q], m6 ; A-B4, A-B3, A-B2, A-B1
palignr m0, m7, m6, 10 ; A-B3, A-B2, A-B1, C-H1
movq [dstq+strideq*2], m0
psrldq m0, 2 ; A-B2, A-B1, C-H1
movq [dstq+strideq ], m0
psrldq m0, 2 ; A-H1
movq [dstq ], m0
lea dstq, [dstq+strideq*4]
movq [dstq+stride3q ], m6 ; A-B8, A-B7, A-B6, A-B5
psrldq m6, 2 ; A-B7, A-B6, A-B5, A-B4
movq [dstq+strideq*2], m6
psrldq m6, 2 ; A-B6, A-B5, A-B4, A-B3
movq [dstq+strideq ], m6
psrldq m6, 2 ; A-B5, A-B4, A-B3, A-B2
movq [dstq ], m6
RESTORE_GOT
RET
INIT_XMM ssse3
cglobal d153_predictor_16x16, 4, 5, 8, dst, stride, above, left, goffset
GET_GOT goffsetq
mova m0, [leftq]
movu m7, [aboveq-1]
; comments below are for a predictor like this
; A1 B1 C1 D1 E1 F1 G1 H1 I1 J1 K1 L1 M1 N1 O1 P1
; A2 B2 A1 B1 C1 D1 E1 F1 G1 H1 I1 J1 K1 L1 M1 N1
; A3 B3 A2 B2 A1 B1 C1 D1 E1 F1 G1 H1 I1 J1 K1 L1
; A4 B4 A3 B3 A2 B2 A1 B1 C1 D1 E1 F1 G1 H1 I1 J1
; A5 B5 A4 B4 A3 B3 A2 B2 A1 B1 C1 D1 E1 F1 G1 H1
; A6 B6 A5 B5 A4 B4 A3 B3 A2 B2 A1 B1 C1 D1 E1 F1
; A7 B7 A6 B6 A5 B5 A4 B4 A3 B3 A2 B2 A1 B1 C1 D1
; A8 B8 A7 B7 A6 B6 A5 B5 A4 B4 A3 B3 A2 B2 A1 B1
; A9 B9 A8 B8 A7 B7 A6 B6 A5 B5 A4 B4 A3 B3 A2 B2
; Aa Ba A9 B9 A8 B8 A7 B7 A6 B6 A5 B5 A4 B4 A3 B3
; Ab Bb Aa Ba A9 B9 A8 B8 A7 B7 A6 B6 A5 B5 A4 B4
; Ac Bc Ab Bb Aa Ba A9 B9 A8 B8 A7 B7 A6 B6 A5 B5
; Ad Bd Ac Bc Ab Bb Aa Ba A9 B9 A8 B8 A7 B7 A6 B6
; Ae Be Ad Bd Ac Bc Ab Bb Aa Ba A9 B9 A8 B8 A7 B7
; Af Bf Ae Be Ad Bd Ac Bc Ab Bb Aa Ba A9 B9 A8 B8
; Ag Bg Af Bf Ae Be Ad Bd Ac Bc Ab Bb Aa Ba A9 B9
pshufb m6, m7, [GLOBAL(sh_bfedcba9876543210)]
palignr m5, m0, m6, 15
palignr m3, m0, m6, 14
X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 m0, m5, m3, m4 ; 3-tap avg B3-Bg
pshufb m1, m0, [GLOBAL(sh_b123456789abcdeff)]
pavgb m5, m0 ; A1 - Ag
punpcklbw m0, m4, m5 ; A-B8 ... A-B1
punpckhbw m4, m5 ; A-B9 ... A-Bg
pshufb m3, m7, [GLOBAL(sh_b123456789abcdeff)]
pshufb m5, m7, [GLOBAL(sh_b23456789abcdefff)]
X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 m7, m3, m5, m1 ; 3-tap avg C1-P1
pshufb m6, m0, [GLOBAL(sh_bfedcba9876543210)]
DEFINE_ARGS dst, stride, stride3
lea stride3q, [strideq*3]
palignr m2, m1, m6, 14
mova [dstq ], m2
palignr m2, m1, m6, 12
mova [dstq+strideq ], m2
palignr m2, m1, m6, 10
mova [dstq+strideq*2], m2
palignr m2, m1, m6, 8
mova [dstq+stride3q ], m2
lea dstq, [dstq+strideq*4]
palignr m2, m1, m6, 6
mova [dstq ], m2
palignr m2, m1, m6, 4
mova [dstq+strideq ], m2
palignr m2, m1, m6, 2
mova [dstq+strideq*2], m2
pshufb m4, [GLOBAL(sh_bfedcba9876543210)]
mova [dstq+stride3q ], m6
lea dstq, [dstq+strideq*4]
palignr m2, m6, m4, 14
mova [dstq ], m2
palignr m2, m6, m4, 12
mova [dstq+strideq ], m2
palignr m2, m6, m4, 10
mova [dstq+strideq*2], m2
palignr m2, m6, m4, 8
mova [dstq+stride3q ], m2
lea dstq, [dstq+strideq*4]
palignr m2, m6, m4, 6
mova [dstq ], m2
palignr m2, m6, m4, 4
mova [dstq+strideq ], m2
palignr m2, m6, m4, 2
mova [dstq+strideq*2], m2
mova [dstq+stride3q ], m4
RESTORE_GOT
RET
INIT_XMM ssse3
cglobal d153_predictor_32x32, 4, 5, 8, dst, stride, above, left, goffset
GET_GOT goffsetq
mova m0, [leftq]
movu m7, [aboveq-1]
movu m1, [aboveq+15]
pshufb m4, m1, [GLOBAL(sh_b123456789abcdeff)]
pshufb m6, m1, [GLOBAL(sh_b23456789abcdefff)]
X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 m1, m4, m6, m2 ; 3-tap avg above [high]
palignr m3, m1, m7, 1
palignr m5, m1, m7, 2
X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 m7, m3, m5, m1 ; 3-tap avg above [low]
pshufb m7, [GLOBAL(sh_bfedcba9876543210)]
palignr m5, m0, m7, 15
palignr m3, m0, m7, 14
X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 m0, m5, m3, m4 ; 3-tap avg B3-Bg
pavgb m5, m0 ; A1 - Ag
punpcklbw m6, m4, m5 ; A-B8 ... A-B1
punpckhbw m4, m5 ; A-B9 ... A-Bg
pshufb m6, [GLOBAL(sh_bfedcba9876543210)]
pshufb m4, [GLOBAL(sh_bfedcba9876543210)]
DEFINE_ARGS dst, stride, stride3, left, line
lea stride3q, [strideq*3]
palignr m5, m2, m1, 14
palignr m7, m1, m6, 14
mova [dstq ], m7
mova [dstq+16 ], m5
palignr m5, m2, m1, 12
palignr m7, m1, m6, 12
mova [dstq+strideq ], m7
mova [dstq+strideq+16 ], m5
palignr m5, m2, m1, 10
palignr m7, m1, m6, 10
mova [dstq+strideq*2 ], m7
mova [dstq+strideq*2+16], m5
palignr m5, m2, m1, 8
palignr m7, m1, m6, 8
mova [dstq+stride3q ], m7
mova [dstq+stride3q+16 ], m5
lea dstq, [dstq+strideq*4]
palignr m5, m2, m1, 6
palignr m7, m1, m6, 6
mova [dstq ], m7
mova [dstq+16 ], m5
palignr m5, m2, m1, 4
palignr m7, m1, m6, 4
mova [dstq+strideq ], m7
mova [dstq+strideq+16 ], m5
palignr m5, m2, m1, 2
palignr m7, m1, m6, 2
mova [dstq+strideq*2 ], m7
mova [dstq+strideq*2+16], m5
mova [dstq+stride3q ], m6
mova [dstq+stride3q+16 ], m1
lea dstq, [dstq+strideq*4]
palignr m5, m1, m6, 14
palignr m3, m6, m4, 14
mova [dstq ], m3
mova [dstq+16 ], m5
palignr m5, m1, m6, 12
palignr m3, m6, m4, 12
mova [dstq+strideq ], m3
mova [dstq+strideq+16 ], m5
palignr m5, m1, m6, 10
palignr m3, m6, m4, 10
mova [dstq+strideq*2 ], m3
mova [dstq+strideq*2+16], m5
palignr m5, m1, m6, 8
palignr m3, m6, m4, 8
mova [dstq+stride3q ], m3
mova [dstq+stride3q+16 ], m5
lea dstq, [dstq+strideq*4]
palignr m5, m1, m6, 6
palignr m3, m6, m4, 6
mova [dstq ], m3
mova [dstq+16 ], m5
palignr m5, m1, m6, 4
palignr m3, m6, m4, 4
mova [dstq+strideq ], m3
mova [dstq+strideq+16 ], m5
palignr m5, m1, m6, 2
palignr m3, m6, m4, 2
mova [dstq+strideq*2 ], m3
mova [dstq+strideq*2+16], m5
mova [dstq+stride3q ], m4
mova [dstq+stride3q+16 ], m6
lea dstq, [dstq+strideq*4]
mova m7, [leftq]
mova m3, [leftq+16]
palignr m5, m3, m7, 15
palignr m0, m3, m7, 14
X_PLUS_2Y_PLUS_Z_PLUS_2_RSH_2 m3, m5, m0, m2 ; 3-tap avg Bh -
pavgb m5, m3 ; Ah -
punpcklbw m3, m2, m5 ; A-B8 ... A-B1
punpckhbw m2, m5 ; A-B9 ... A-Bg
pshufb m3, [GLOBAL(sh_bfedcba9876543210)]
pshufb m2, [GLOBAL(sh_bfedcba9876543210)]
palignr m7, m6, m4, 14
palignr m0, m4, m3, 14
mova [dstq ], m0
mova [dstq+16 ], m7
palignr m7, m6, m4, 12
palignr m0, m4, m3, 12
mova [dstq+strideq ], m0
mova [dstq+strideq+16 ], m7
palignr m7, m6, m4, 10
palignr m0, m4, m3, 10
mova [dstq+strideq*2 ], m0
mova [dstq+strideq*2+16], m7
palignr m7, m6, m4, 8
palignr m0, m4, m3, 8
mova [dstq+stride3q ], m0
mova [dstq+stride3q+16 ], m7
lea dstq, [dstq+strideq*4]
palignr m7, m6, m4, 6
palignr m0, m4, m3, 6
mova [dstq ], m0
mova [dstq+16 ], m7
palignr m7, m6, m4, 4
palignr m0, m4, m3, 4
mova [dstq+strideq ], m0
mova [dstq+strideq+16 ], m7
palignr m7, m6, m4, 2
palignr m0, m4, m3, 2
mova [dstq+strideq*2 ], m0
mova [dstq+strideq*2+16], m7
mova [dstq+stride3q ], m3
mova [dstq+stride3q+16 ], m4
lea dstq, [dstq+strideq*4]
palignr m7, m4, m3, 14
palignr m0, m3, m2, 14
mova [dstq ], m0
mova [dstq+16 ], m7
palignr m7, m4, m3, 12
palignr m0, m3, m2, 12
mova [dstq+strideq ], m0
mova [dstq+strideq+16 ], m7
palignr m7, m4, m3, 10
palignr m0, m3, m2, 10
mova [dstq+strideq*2 ], m0
mova [dstq+strideq*2+16], m7
palignr m7, m4, m3, 8
palignr m0, m3, m2, 8
mova [dstq+stride3q ], m0
mova [dstq+stride3q+16 ], m7
lea dstq, [dstq+strideq*4]
palignr m7, m4, m3, 6
palignr m0, m3, m2, 6
mova [dstq ], m0
mova [dstq+16 ], m7
palignr m7, m4, m3, 4
palignr m0, m3, m2, 4
mova [dstq+strideq ], m0
mova [dstq+strideq+16 ], m7
palignr m7, m4, m3, 2
palignr m0, m3, m2, 2
mova [dstq+strideq*2 ], m0
mova [dstq+strideq*2+16], m7
mova [dstq+stride3q ], m2
mova [dstq+stride3q+16 ], m3
RESTORE_GOT
RET
|
programs/Desktop: Hide.applescript | Strajk/setup | 50 | 2459 | <reponame>Strajk/setup<filename>programs/Desktop: Hide.applescript
do shell script "defaults write com.apple.finder CreateDesktop -bool FALSE;killall Finder" |
src/Tactic/Nat.agda | L-TChen/agda-prelude | 111 | 11185 | <filename>src/Tactic/Nat.agda
module Tactic.Nat where
open import Prelude
open import Tactic.Nat.Generic (quote _≤_) (quote id) (quote id) public
{-
All tactics know about addition, multiplication and subtraction
of natural numbers, and can prove equalities and inequalities (_<_).
The available tactics are:
* auto
Prove an equation or inequality.
* by eq
Prove the goal using the given assumption. For equalities it simplifies
the goal and the assumption and checks if they match any of the following
forms (up to symmetry):
a ≡ b → a ≡ b
a + b ≡ 0 → a ≡ 0
For inequalities, to prove a < b -> c < d, it simplifies the assumption and
goal and then tries to prove c′ ≤ a′ and b′ ≤ d′.
When proving that an inequality follows from an equality a ≡ b, the equality
is weakened to a ≤ b before applying the above procedure.
Proving an equality from an inequality works if the inequality simplifies to
a ≤ 0 (or a < 0 in which case it's trivial). It then reduces that to a ≡ 0
and tries to prove the goal from that.
* refute eq
Proves an arbitrary proposition given a false equation. Works for equations
that simplify to 0 ≡ suc n (or symmetric) or n < 0, for some n.
* simplify-goal ?
Simplify the current goal and let you keep working on the new goal.
In most cases 'by prf' works better than
'simplify-goal prf' since it will also simplify prf. The advantage
of simplify-goal is that it allows holes in prf.
* simplify eq λ x → ?
Simplify the given equation (and the current goal) and bind the simplified
equation to x in the new goal.
* induction
Prove a goal ∀ n → P n using induction. Applies 'auto' in the base case
and 'by IH' in the step case.
-}
|
src/main/antlr4/se/gu/faxe/fileAnnotations.g4 | TobiasOnGitHub/FAXE-Feature_Annotation_eXtraction_Engine | 1 | 7248 | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
grammar fileAnnotations;
SPACE: ' '* -> skip ; // ignores all more than one-time space characters
//WS: [ \n\t\r]+ -> skip;
WS: [\r]+ -> skip;
fileAnnotations: ((fileAnnotation) '\n'*)* ;
fileAnnotation: fileReferences ':'? '\n'+ lpqReferences ;
fileReferences: (fileReference (' '* fileReference)* ' '*) | (fileReference (' '* ',' ' '* fileReference)* ' '*) ;
fileReference: ('"' fileName '"') | (fileName) ;
fileName: STRING | (STRING'.'STRING);
lpqReferences: (lpq (' '* lpq)* ' '*) | (lpq (' '* ',' ' '* lpq)* ' '*);
lpq: STRING ('::'STRING)* # Feature;
STRING: ([A-Z]+|[a-z]+|[0-9]+|'_'+|'\''+)+; // -> restriction from Clafer and follow their definition |
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca_notsx.log_19_926.asm | ljhsiun2/medusa | 9 | 174840 | <filename>Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xca_notsx.log_19_926.asm
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r9
push %rbx
push %rcx
push %rdi
// Store
lea addresses_WT+0x1ad3d, %r9
clflush (%r9)
nop
nop
nop
nop
xor %rdi, %rdi
movb $0x51, (%r9)
nop
nop
nop
nop
xor $12865, %r12
// Faulty Load
lea addresses_US+0x1b115, %r9
nop
add $14859, %r11
movb (%r9), %cl
lea oracles, %r11
and $0xff, %rcx
shlq $12, %rcx
mov (%r11,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
<gen_prepare_buffer>
{'00': 19}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
agda/book/SFHC/v01-01-basics.agda | haroldcarr/learn-haskell-coq-ml-etc | 36 | 16412 | -- this is so this can be imported even though it has unresolved holes
{-# OPTIONS --allow-unsolved-metas #-}
module v01-01-basics where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎)
data day : Set where
mon : day
tue : day
wed : day
thu : day
fri : day
sat : day
sun : day
next-weekday : day → day
next-weekday mon = tue
next-weekday tue = wed
next-weekday wed = thu
next-weekday thu = fri
next-weekday fri = mon
next-weekday sat = mon
next-weekday sun = mon
_ : next-weekday fri ≡ mon
_ = refl
_ : next-weekday (next-weekday sat) ≡ tue
_ = refl
data bool : Set where
true : bool
false : bool
negb : bool → bool
negb true = false
negb false = true
andb : bool → bool → bool
andb true b2 = b2
andb false _ = false
orb : bool → bool → bool
orb true _ = true
orb false b2 = b2
_ : orb false false ≡ false
_ = refl
_ : orb false true ≡ true
_ = refl
_ : orb true false ≡ true
_ = refl
_ : orb true true ≡ true
_ = refl
nandb : bool → bool → bool
nandb true true = false
nandb _ _ = true
_ : nandb false false ≡ true
_ = refl
_ : nandb false true ≡ true
_ = refl
_ : nandb true false ≡ true
_ = refl
_ : nandb true true ≡ false
_ = refl
andb3 : bool → bool → bool → bool
andb3 true true true = true
andb3 _ _ _ = false
_ : andb3 true true true ≡ true
_ = refl
_ : andb3 false true true ≡ false
_ = refl
_ : andb3 true false true ≡ false
_ = refl
_ : andb3 true true false ≡ false
_ = refl
data rgb : Set where
red : rgb
green : rgb
blue : rgb
data color : Set where
black : color
white : color
primary : rgb → color
monochrome : color → bool
monochrome black = true
monochrome white = true
monochrome (primary _) = false
isred : color → bool
isred (primary red) = true
isred _ = false
data bit : Set where
B0 : bit
B1 : bit
data nybble : Set where
bits : (b0 b1 b2 b3 : bit) → nybble
all-zero : nybble → bool
all-zero (bits B0 B0 B0 B0) = true
all-zero _ = false
_ : all-zero (bits B1 B0 B1 B0) ≡ false
_ = refl
_ : all-zero (bits B0 B0 B0 B0) ≡ true
_ = refl
data nat : Set where
O : nat
S : nat → nat
pred : nat → nat
pred O = O
pred (S n) = n
{-# BUILTIN NATURAL nat #-}
_ : S (S (S (S O))) ≡ 4
_ = refl
minustwo : nat → nat
minustwo O = O
minustwo (S O) = O
minustwo (S (S n)) = n
_ : minustwo 4 ≡ 2
_ = refl
evenb : nat → bool
evenb O = true
evenb (S O) = false
evenb (S (S n)) = evenb n
oddb : nat → bool
oddb n = negb (evenb n)
_ : oddb 1 ≡ true
_ = refl
_ : oddb 4 ≡ false
_ = refl
plus : nat → nat → nat
plus O m = m
plus (S n) m = S (plus n m)
_ : plus 3 2 ≡ 5
_ = refl
mult : nat → nat → nat
mult O m = 0
mult (S n) m = plus m (mult n m)
_ : mult 3 3 ≡ 9
_ = refl
minus : nat → nat → nat
minus O _ = O
minus x O = x
minus (S n) (S m) = minus n m
exp : (base power : nat) → nat
exp _ O = S O
exp b (S p) = mult b (exp b p)
_ : exp 2 0 ≡ 1
_ = refl
_ : exp 2 1 ≡ 2
_ = refl
_ : exp 2 2 ≡ 4
_ = refl
_ : exp 2 3 ≡ 8
_ = refl
factorial : nat → nat
factorial O = 1
factorial (S n) = mult (S n) (factorial n)
_ : factorial 3 ≡ 6
_ = refl
_ : factorial 5 ≡ mult 10 12
_ = refl
_+_ : nat → nat → nat
_+_ = plus
_-_ : nat → nat → nat
_-_ = minus
_*_ : nat → nat → nat
_*_ = mult
infixl 6 _+_ _-_
infixl 7 _*_
{-# BUILTIN NATPLUS _+_ #-}
{-# BUILTIN NATTIMES _*_ #-}
{-# BUILTIN NATMINUS _-_ #-}
eqb : (n m : nat) → bool
eqb O O = true
eqb O (S _) = false
eqb (S _) O = false
eqb (S l) (S r) = eqb l r
leb : (n m : nat) → bool
leb O _ = true
leb (S n) O = false
leb (S n) (S m) = leb n m
_ : leb 2 2 ≡ true
_ = refl
_ : leb 2 4 ≡ true
_ = refl
_ : leb 4 2 ≡ false
_ = refl
_=?_ : (n m : nat) → bool
_=?_ = eqb
_<=?_ : (n m : nat) → bool
_<=?_ = leb
infix 4 _=?_
infix 4 _<=?_
_ : (4 <=? 2) ≡ false
_ = refl
ltb : (n m : nat) → bool
ltb O O = false
ltb O (S m) = true
ltb (S n) O = false
ltb (S n) (S m) = ltb n m
_<?_ : (n m : nat) → bool
_<?_ = ltb
infix 4 _<?_
_ : ltb 2 2 ≡ false
_ = refl
_ : ltb 2 4 ≡ true
_ = refl
_ : ltb 4 2 ≡ false
_ = refl
-- proof by simplification
plus-O-n : ∀ {n : nat} → 0 + n ≡ n
plus-O-n = refl
plus-1-l : ∀ {n : nat} → 1 + n ≡ S n
plus-1-l = refl
mult-O-l : ∀ {n : nat} → 0 * n ≡ 0
mult-O-l = refl
-- proof by rewriting
plus-id-example : ∀ {n m : nat}
→ n ≡ m
→ n + n ≡ m + m
plus-id-example n≡m rewrite n≡m = refl
plus_id_exercise : ∀ {n m o : nat}
→ n ≡ m
→ m ≡ o
→ n + m ≡ m + o
plus_id_exercise n≡m m≡o rewrite n≡m | m≡o = refl
*0 : ∀ (m : nat) → m * 0 ≡ 0
*0 0 = refl
*0 (S m) = *0 m
mult-n-O : ∀ (n : nat) → 0 ≡ n * 0
mult-n-O n rewrite *0 n = refl
*1 : ∀ (n : nat) → n * 1 ≡ n
*1 0 = refl
*1 (S n) rewrite *1 n = refl
1* : ∀ (n : nat) → 1 * n ≡ n
1* 0 = refl
1* (S n) rewrite 1* n = refl
mult-n-Sm : ∀ (n m : nat) → n * m + n ≡ n * S m
mult-n-Sm O m = refl
mult-n-Sm n O rewrite *0 n | plus-O-n {n} | *1 n = refl
mult-n-Sm (S n) (S m) = {!!} -- TODO
mult-n-0-m-0 : ∀ (p q : nat)
→ (p * 0) + (q * 0) ≡ 0
mult-n-0-m-0 p q rewrite *0 p | *0 q = refl
mult-n-1 : ∀ (p : nat) → p * 1 ≡ p
mult-n-1 = *1
-- proof by case analysis
plus-1-neq-0 : ∀ (n : nat) → ((n + 1) =? 0) ≡ false
plus-1-neq-0 O = refl
plus-1-neq-0 (S n) rewrite plus-1-neq-0 n = refl
negb-involutive : ∀ (b : bool) → negb (negb b) ≡ b
negb-involutive true = refl
negb-involutive false = refl
andb-commutative : ∀ (b c : bool) → andb b c ≡ andb c b
andb-commutative false false = refl
andb-commutative false true = refl
andb-commutative true false = refl
andb-commutative true true = refl
andb3-exchange : ∀ (b c d : bool) → andb (andb b c) d ≡ andb (andb b d) c
andb3-exchange true true true = refl
andb3-exchange true true false = refl
andb3-exchange true false true = refl
andb3-exchange true false false = refl
andb3-exchange false true true = refl
andb3-exchange false true false = refl
andb3-exchange false false true = refl
andb3-exchange false false false = refl
andb-true-elim2 : ∀ (b c : bool)
→ andb b c ≡ true
→ c ≡ true
andb-true-elim2 false _ ()
andb-true-elim2 true false ()
andb-true-elim2 true true _ = refl
zero-nbeq-plus-1 : ∀ (n : nat) → (0 =? (n + 1)) ≡ false
zero-nbeq-plus-1 O = refl
zero-nbeq-plus-1 (S n) rewrite zero-nbeq-plus-1 n = refl
identity-fn-applied-twice : ∀ {f : bool → bool} (b : bool)
→ f b ≡ b
→ f (f b) ≡ b
identity-fn-applied-twice b p rewrite p | p = refl
negation-fn-applied-twice : ∀ {f : bool → bool} {b : bool} -- TODO
→ f b ≡ negb b
→ f (f b) ≡ b
negation-fn-applied-twice {f} {false} p = {!!} -- TODO
negation-fn-applied-twice {f} {true} p = {!!} -- TODO
andb-eq-orb : ∀ (b c : bool)
→ andb b c ≡ orb b c
→ b ≡ c
andb-eq-orb true c p rewrite p = refl
andb-eq-orb false c p rewrite p = refl
-- NOTE: lowest order bit is on LEFT
data bin : Set where
Z : bin
B₀ : bin → bin
B₁ : bin → bin
incr : bin → bin
incr Z = B₁ Z
incr (B₀ x) = B₁ x
incr (B₁ x) = B₀ (incr x)
bin-to-nat : bin → nat
bin-to-nat Z = 0
bin-to-nat (B₀ x) = 2 * (bin-to-nat x)
bin-to-nat (B₁ x) = 1 + 2 * (bin-to-nat x)
_ : (incr (B₁ Z)) ≡ B₀ (B₁ Z)
_ = refl
_ : (incr (B₀ (B₁ Z))) ≡ B₁ (B₁ Z)
_ = refl
_ : (incr (B₁ (B₁ Z))) ≡ B₀ (B₀ (B₁ Z))
_ = refl
_ : bin-to-nat (B₀ (B₁ Z)) ≡ 2
_ = refl
_ : bin-to-nat (incr (B₁ Z)) ≡ 1 + bin-to-nat (B₁ Z)
_ = refl
_ : bin-to-nat (incr (incr (B₁ Z))) ≡ 2 + bin-to-nat (B₁ Z)
_ = refl
|
tier-1/gmp/source/thin/gmp_c-binding.ads | charlie5/cBound | 2 | 30532 | -- This file is generated by SWIG. Please do *not* modify by hand.
--
with gmp_c.Pointers;
with gmp_c.a_a_gmp_randstate_struct;
with gmp_c.gmp_randstate_t;
with gmp_c.mp_ptr;
with gmp_c.mp_srcptr;
with gmp_c.mpf_ptr;
with gmp_c.mpf_srcptr;
with gmp_c.mpf_t;
with gmp_c.mpq_ptr;
with gmp_c.mpq_srcptr;
with gmp_c.mpz_ptr;
with gmp_c.mpz_srcptr;
with Interfaces.C;
with Interfaces.C.Strings;
with Swig;
with Swig.Pointers;
with Interfaces.C;
package gmp_c.Binding is
procedure randinit
(arg_3_1 : in gmp_c.gmp_randstate_t.Item;
arg_3_2 : in gmp_c.gmp_randalg_t);
procedure randinit_default (arg_1 : in gmp_c.gmp_randstate_t.Item);
procedure randinit_lc_2exp
(arg_4_1 : in gmp_c.gmp_randstate_t.Item;
arg_4_2 : in gmp_c.mpz_srcptr.Item;
arg_4_3 : in Interfaces.C.unsigned_long;
arg_4_4 : in gmp_c.mp_bitcnt_t);
function randinit_lc_2exp_size
(arg_2_1 : in gmp_c.gmp_randstate_t.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t) return Interfaces.C.int;
procedure randinit_mt (arg_1 : in gmp_c.gmp_randstate_t.Item);
procedure randinit_set
(arg_2_1 : in gmp_c.gmp_randstate_t.Item;
arg_2_2 : in gmp_c.a_a_gmp_randstate_struct.Pointer);
procedure randseed
(arg_2_1 : in gmp_c.gmp_randstate_t.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
procedure randseed_ui
(arg_2_1 : in gmp_c.gmp_randstate_t.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
procedure randclear (arg_1 : in gmp_c.gmp_randstate_t.Item);
function urandomb_ui
(arg_2_1 : in gmp_c.gmp_randstate_t.Item;
arg_2_2 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
function urandomm_ui
(arg_2_1 : in gmp_c.gmp_randstate_t.Item;
arg_2_2 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
function asprintf
(arg_3_1 : in Swig.Pointers.chars_ptr_Pointer;
arg_3_2 : in Interfaces.C.Strings.chars_ptr) return Interfaces.C.int;
function printf
(arg_2 : in Interfaces.C.Strings.chars_ptr) return Interfaces.C.int;
function snprintf
(arg_4_1 : in Interfaces.C.Strings.chars_ptr;
arg_4_2 : in Interfaces.C.size_t;
arg_4_3 : in Interfaces.C.Strings.chars_ptr) return Interfaces.C.int;
function sprintf
(arg_3_1 : in Interfaces.C.Strings.chars_ptr;
arg_3_2 : in Interfaces.C.Strings.chars_ptr) return Interfaces.C.int;
function scanf
(arg_2 : in Interfaces.C.Strings.chars_ptr) return Interfaces.C.int;
function sscanf
(arg_3_1 : in Interfaces.C.Strings.chars_ptr;
arg_3_2 : in Interfaces.C.Strings.chars_ptr) return Interfaces.C.int;
function realloc
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mp_size_t) return Swig.void_ptr;
procedure add
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure add_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure addmul
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure addmul_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure z_and
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure array_init
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mp_size_t;
arg_3_3 : in gmp_c.mp_size_t);
procedure bin_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure bin_uiui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure cdiv_q
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure cdiv_q_2exp
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
function cdiv_q_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
procedure cdiv_qr
(arg_4_1 : in gmp_c.mpz_ptr.Item;
arg_4_2 : in gmp_c.mpz_ptr.Item;
arg_4_3 : in gmp_c.mpz_srcptr.Item;
arg_4_4 : in gmp_c.mpz_srcptr.Item);
function cdiv_qr_ui
(arg_4_1 : in gmp_c.mpz_ptr.Item;
arg_4_2 : in gmp_c.mpz_ptr.Item;
arg_4_3 : in gmp_c.mpz_srcptr.Item;
arg_4_4 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
procedure cdiv_r
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure cdiv_r_2exp
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
function cdiv_r_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
function cdiv_ui
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
procedure clear (arg_1 : in gmp_c.mpz_ptr.Item);
procedure a_a_gmpz_clears (arg_2 : in gmp_c.mpz_ptr.Item);
procedure clrbit
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t);
function cmp
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function cmp_d
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.double) return Interfaces.C.int;
function a_a_gmpz_cmp_si
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.long) return Interfaces.C.int;
function a_a_gmpz_cmp_ui
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long) return Interfaces.C.int;
function cmpabs
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function cmpabs_d
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.double) return Interfaces.C.int;
function cmpabs_ui
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long) return Interfaces.C.int;
procedure com
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
procedure combit
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t);
function congruent_p
(arg_3_1 : in gmp_c.mpz_srcptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function congruent_2exp_p
(arg_3_1 : in gmp_c.mpz_srcptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t) return Interfaces.C.int;
function congruent_ui_p
(arg_3_1 : in gmp_c.mpz_srcptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in Interfaces.C.unsigned_long) return Interfaces.C.int;
procedure divexact
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure divexact_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
function divisible_p
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function divisible_ui_p
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long) return Interfaces.C.int;
function divisible_2exp_p
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t) return Interfaces.C.int;
procedure dump (arg_1 : in gmp_c.mpz_srcptr.Item);
function z_export
(arg_7_1 : in Swig.void_ptr;
arg_7_2 : in Swig.Pointers.size_t_Pointer;
arg_7_3 : in Interfaces.C.int;
arg_7_4 : in Interfaces.C.size_t;
arg_7_5 : in Interfaces.C.int;
arg_7_6 : in Interfaces.C.size_t;
arg_7_7 : in gmp_c.mpz_srcptr.Item) return Swig.void_ptr;
procedure fac_ui
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
procedure a_a_gmpz_2fac_ui
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
procedure a_a_gmpz_mfac_uiui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure a_a_gmpz_primorial_ui
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
procedure fdiv_q
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure fdiv_q_2exp
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
function fdiv_q_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
procedure fdiv_qr
(arg_4_1 : in gmp_c.mpz_ptr.Item;
arg_4_2 : in gmp_c.mpz_ptr.Item;
arg_4_3 : in gmp_c.mpz_srcptr.Item;
arg_4_4 : in gmp_c.mpz_srcptr.Item);
function fdiv_qr_ui
(arg_4_1 : in gmp_c.mpz_ptr.Item;
arg_4_2 : in gmp_c.mpz_ptr.Item;
arg_4_3 : in gmp_c.mpz_srcptr.Item;
arg_4_4 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
procedure fdiv_r
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure fdiv_r_2exp
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
function fdiv_r_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
function fdiv_ui
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
procedure fib_ui
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
procedure fib2_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_ptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
function fits_sint_p
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function fits_slong_p
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function fits_sshort_p
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
procedure gcd
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
function gcd_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
procedure gcdext
(arg_5_1 : in gmp_c.mpz_ptr.Item;
arg_5_2 : in gmp_c.mpz_ptr.Item;
arg_5_3 : in gmp_c.mpz_ptr.Item;
arg_5_4 : in gmp_c.mpz_srcptr.Item;
arg_5_5 : in gmp_c.mpz_srcptr.Item);
function get_d
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.double;
function get_d_2exp
(arg_2_1 : in Swig.Pointers.long_Pointer;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.double;
function get_si (arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.long;
function get_str
(arg_3_1 : in Interfaces.C.Strings.chars_ptr;
arg_3_2 : in Interfaces.C.int;
arg_3_3 : in gmp_c.mpz_srcptr.Item)
return Interfaces.C.Strings.chars_ptr;
function hamdist
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return gmp_c.mp_bitcnt_t;
procedure import
(arg_7_1 : in gmp_c.mpz_ptr.Item;
arg_7_2 : in Interfaces.C.size_t;
arg_7_3 : in Interfaces.C.int;
arg_7_4 : in Interfaces.C.size_t;
arg_7_5 : in Interfaces.C.int;
arg_7_6 : in Interfaces.C.size_t;
arg_7_7 : in Swig.void_ptr);
procedure init (arg_1 : in gmp_c.mpz_ptr.Item);
procedure init2
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t);
procedure a_a_gmpz_inits (arg_2 : in gmp_c.mpz_ptr.Item);
procedure init_set
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
procedure init_set_d
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.double);
procedure init_set_si
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.long);
function init_set_str
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int;
procedure init_set_ui
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
function invert
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
procedure ior
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
function jacobi
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function kronecker_si
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.long) return Interfaces.C.int;
function kronecker_ui
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long) return Interfaces.C.int;
function si_kronecker
(arg_2_1 : in Interfaces.C.long;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function ui_kronecker
(arg_2_1 : in Interfaces.C.unsigned_long;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
procedure lcm
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure lcm_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure lucnum_ui
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
procedure lucnum2_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_ptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
function millerrabin
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.int) return Interfaces.C.int;
procedure the_mod
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure mul
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure mul_2exp
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
procedure mul_si
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.long);
procedure mul_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure nextprime
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
function perfect_power_p
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
procedure pow_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure powm
(arg_4_1 : in gmp_c.mpz_ptr.Item;
arg_4_2 : in gmp_c.mpz_srcptr.Item;
arg_4_3 : in gmp_c.mpz_srcptr.Item;
arg_4_4 : in gmp_c.mpz_srcptr.Item);
procedure a_a_gmpz_powm_sec
(arg_4_1 : in gmp_c.mpz_ptr.Item;
arg_4_2 : in gmp_c.mpz_srcptr.Item;
arg_4_3 : in gmp_c.mpz_srcptr.Item;
arg_4_4 : in gmp_c.mpz_srcptr.Item);
procedure powm_ui
(arg_4_1 : in gmp_c.mpz_ptr.Item;
arg_4_2 : in gmp_c.mpz_srcptr.Item;
arg_4_3 : in Interfaces.C.unsigned_long;
arg_4_4 : in gmp_c.mpz_srcptr.Item);
function probab_prime_p
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.int) return Interfaces.C.int;
procedure random
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mp_size_t);
procedure random2
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mp_size_t);
procedure realloc2
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t);
function remove
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item) return gmp_c.mp_bitcnt_t;
function root
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long) return Interfaces.C.int;
procedure rootrem
(arg_4_1 : in gmp_c.mpz_ptr.Item;
arg_4_2 : in gmp_c.mpz_ptr.Item;
arg_4_3 : in gmp_c.mpz_srcptr.Item;
arg_4_4 : in Interfaces.C.unsigned_long);
procedure rrandomb
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.gmp_randstate_t.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
function scan0
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t) return gmp_c.mp_bitcnt_t;
function scan1
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t) return gmp_c.mp_bitcnt_t;
procedure set
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
procedure set_d
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.double);
procedure set_f
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure set_si
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.long);
function set_str
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int;
procedure set_ui
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
procedure setbit
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t);
function sizeinbase
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.int) return Interfaces.C.size_t;
procedure sqrt
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
procedure sqrtrem
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_ptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure sub
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure sub_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure ui_sub
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure submul
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure submul_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure swap
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_ptr.Item);
function tdiv_ui
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
procedure tdiv_q
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure tdiv_q_2exp
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
function tdiv_q_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
procedure tdiv_qr
(arg_4_1 : in gmp_c.mpz_ptr.Item;
arg_4_2 : in gmp_c.mpz_ptr.Item;
arg_4_3 : in gmp_c.mpz_srcptr.Item;
arg_4_4 : in gmp_c.mpz_srcptr.Item);
function tdiv_qr_ui
(arg_4_1 : in gmp_c.mpz_ptr.Item;
arg_4_2 : in gmp_c.mpz_ptr.Item;
arg_4_3 : in gmp_c.mpz_srcptr.Item;
arg_4_4 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
procedure tdiv_r
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure tdiv_r_2exp
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
function tdiv_r_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long)
return Interfaces.C.unsigned_long;
function tstbit
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t) return Interfaces.C.int;
procedure ui_pow_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure urandomb
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.gmp_randstate_t.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
procedure urandomm
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.gmp_randstate_t.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure z_xor
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure add
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mpq_srcptr.Item);
procedure canonicalize (arg_1 : in gmp_c.mpq_ptr.Item);
procedure clear (arg_1 : in gmp_c.mpq_ptr.Item);
procedure a_a_gmpq_clears (arg_2 : in gmp_c.mpq_ptr.Item);
function cmp
(arg_2_1 : in gmp_c.mpq_srcptr.Item;
arg_2_2 : in gmp_c.mpq_srcptr.Item) return Interfaces.C.int;
function a_a_gmpq_cmp_si
(arg_3_1 : in gmp_c.mpq_srcptr.Item;
arg_3_2 : in Interfaces.C.long;
arg_3_3 : in Interfaces.C.unsigned_long) return Interfaces.C.int;
function a_a_gmpq_cmp_ui
(arg_3_1 : in gmp_c.mpq_srcptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in Interfaces.C.unsigned_long) return Interfaces.C.int;
function a_a_gmpq_cmp_z
(arg_2_1 : in gmp_c.mpq_srcptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
procedure div
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mpq_srcptr.Item);
procedure div_2exp
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
function equal
(arg_2_1 : in gmp_c.mpq_srcptr.Item;
arg_2_2 : in gmp_c.mpq_srcptr.Item) return Interfaces.C.int;
procedure get_num
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpq_srcptr.Item);
procedure get_den
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpq_srcptr.Item);
function get_d
(arg_1 : in gmp_c.mpq_srcptr.Item) return Interfaces.C.double;
function get_str
(arg_3_1 : in Interfaces.C.Strings.chars_ptr;
arg_3_2 : in Interfaces.C.int;
arg_3_3 : in gmp_c.mpq_srcptr.Item)
return Interfaces.C.Strings.chars_ptr;
procedure init (arg_1 : in gmp_c.mpq_ptr.Item);
procedure a_a_gmpq_inits (arg_2 : in gmp_c.mpq_ptr.Item);
procedure inv
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpq_srcptr.Item);
procedure mul
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mpq_srcptr.Item);
procedure mul_2exp
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
procedure set
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpq_srcptr.Item);
procedure set_d
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in Interfaces.C.double);
procedure set_den
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
procedure set_f
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure set_num
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
procedure set_si
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in Interfaces.C.long;
arg_3_3 : in Interfaces.C.unsigned_long);
function set_str
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int;
procedure set_ui
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure set_z
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
procedure sub
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mpq_srcptr.Item);
procedure swap
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpq_ptr.Item);
procedure the_abs
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure add
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mpf_srcptr.Item);
procedure add_ui
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure ceil
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure clear (arg_1 : in gmp_c.mpf_ptr.Item);
procedure a_a_gmpf_clears (arg_2 : in gmp_c.mpf_ptr.Item);
function cmp
(arg_2_1 : in gmp_c.mpf_srcptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
function a_a_gmpf_cmp_z
(arg_2_1 : in gmp_c.mpf_srcptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function cmp_d
(arg_2_1 : in gmp_c.mpf_srcptr.Item;
arg_2_2 : in Interfaces.C.double) return Interfaces.C.int;
function cmp_si
(arg_2_1 : in gmp_c.mpf_srcptr.Item;
arg_2_2 : in Interfaces.C.long) return Interfaces.C.int;
function cmp_ui
(arg_2_1 : in gmp_c.mpf_srcptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long) return Interfaces.C.int;
procedure div
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mpf_srcptr.Item);
procedure div_2exp
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
procedure div_ui
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure dump (arg_1 : in gmp_c.mpf_srcptr.Item);
function eq
(arg_3_1 : in gmp_c.mpf_srcptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t) return Interfaces.C.int;
function fits_sint_p
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
function fits_slong_p
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
function fits_sshort_p
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
function fits_uint_p
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
function fits_ulong_p
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
function fits_ushort_p
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
procedure floor
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
function get_d
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.double;
function get_d_2exp
(arg_2_1 : in Swig.Pointers.long_Pointer;
arg_2_2 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.double;
function get_default_prec return gmp_c.mp_bitcnt_t;
function get_prec
(arg_1 : in gmp_c.mpf_srcptr.Item) return gmp_c.mp_bitcnt_t;
function get_si (arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.long;
function get_str
(arg_5_1 : in Interfaces.C.Strings.chars_ptr;
arg_5_2 : in gmp_c.Pointers.mp_exp_t_Pointer;
arg_5_3 : in Interfaces.C.int;
arg_5_4 : in Interfaces.C.size_t;
arg_5_5 : in gmp_c.mpf_srcptr.Item)
return Interfaces.C.Strings.chars_ptr;
function get_ui
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.unsigned_long;
procedure init (arg_1 : in gmp_c.mpf_ptr.Item);
procedure init2
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t);
procedure a_a_gmpf_inits (arg_2 : in gmp_c.mpf_ptr.Item);
procedure init_set
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure init_set_d
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.double);
procedure init_set_si
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.long);
function init_set_str
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int;
procedure init_set_ui
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
function integer_p
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
procedure mul
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mpf_srcptr.Item);
procedure mul_2exp
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
procedure mul_ui
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure neg
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure pow_ui
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure random2
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mp_size_t;
arg_3_3 : in gmp_c.mp_exp_t);
procedure reldiff
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mpf_srcptr.Item);
procedure set
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure set_d
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.double);
procedure set_default_prec (arg_1 : in gmp_c.mp_bitcnt_t);
procedure set_prec
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t);
procedure set_prec_raw
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t);
procedure set_q
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpq_srcptr.Item);
procedure set_si
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.long);
function set_str
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int;
procedure set_ui
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
procedure set_z
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
function size (arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.size_t;
procedure sqrt
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure sqrt_ui
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
procedure sub
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mpf_srcptr.Item);
procedure sub_ui
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure swap
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_ptr.Item);
procedure trunc
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure ui_div
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in gmp_c.mpf_srcptr.Item);
procedure ui_sub
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in gmp_c.mpf_srcptr.Item);
procedure urandomb
(arg_3_1 : in gmp_c.mpf_t.Item;
arg_3_2 : in gmp_c.gmp_randstate_t.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
function a_a_gmpn_add_n
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_srcptr.Item;
arg_4_4 : in gmp_c.mp_size_t) return gmp_c.mp_limb_t;
function a_a_gmpn_addmul_1
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_size_t;
arg_4_4 : in gmp_c.mp_limb_t) return gmp_c.mp_limb_t;
procedure a_a_gmpn_divexact_1
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_size_t;
arg_4_4 : in gmp_c.mp_limb_t);
function a_a_gmpn_divexact_by3c
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_size_t;
arg_4_4 : in gmp_c.mp_limb_t) return gmp_c.mp_limb_t;
function a_a_gmpn_divrem
(arg_6_1 : in gmp_c.mp_ptr.Item;
arg_6_2 : in gmp_c.mp_size_t;
arg_6_3 : in gmp_c.mp_ptr.Item;
arg_6_4 : in gmp_c.mp_size_t;
arg_6_5 : in gmp_c.mp_srcptr.Item;
arg_6_6 : in gmp_c.mp_size_t) return gmp_c.mp_limb_t;
function a_a_gmpn_divrem_1
(arg_5_1 : in gmp_c.mp_ptr.Item;
arg_5_2 : in gmp_c.mp_size_t;
arg_5_3 : in gmp_c.mp_srcptr.Item;
arg_5_4 : in gmp_c.mp_size_t;
arg_5_5 : in gmp_c.mp_limb_t) return gmp_c.mp_limb_t;
function a_a_gmpn_divrem_2
(arg_5_1 : in gmp_c.mp_ptr.Item;
arg_5_2 : in gmp_c.mp_size_t;
arg_5_3 : in gmp_c.mp_ptr.Item;
arg_5_4 : in gmp_c.mp_size_t;
arg_5_5 : in gmp_c.mp_srcptr.Item) return gmp_c.mp_limb_t;
function a_a_gmpn_div_qr_2
(arg_5_1 : in gmp_c.mp_ptr.Item;
arg_5_2 : in gmp_c.mp_ptr.Item;
arg_5_3 : in gmp_c.mp_srcptr.Item;
arg_5_4 : in gmp_c.mp_size_t;
arg_5_5 : in gmp_c.mp_srcptr.Item) return gmp_c.mp_limb_t;
function a_a_gmpn_gcd
(arg_5_1 : in gmp_c.mp_ptr.Item;
arg_5_2 : in gmp_c.mp_ptr.Item;
arg_5_3 : in gmp_c.mp_size_t;
arg_5_4 : in gmp_c.mp_ptr.Item;
arg_5_5 : in gmp_c.mp_size_t) return gmp_c.mp_size_t;
function a_a_gmpn_gcd_1
(arg_3_1 : in gmp_c.mp_srcptr.Item;
arg_3_2 : in gmp_c.mp_size_t;
arg_3_3 : in gmp_c.mp_limb_t) return gmp_c.mp_limb_t;
function a_a_gmpn_gcdext_1
(arg_4_1 : in gmp_c.Pointers.mp_limb_signed_t_Pointer;
arg_4_2 : in gmp_c.Pointers.mp_limb_signed_t_Pointer;
arg_4_3 : in gmp_c.mp_limb_t;
arg_4_4 : in gmp_c.mp_limb_t) return gmp_c.mp_limb_t;
function a_a_gmpn_gcdext
(arg_7_1 : in gmp_c.mp_ptr.Item;
arg_7_2 : in gmp_c.mp_ptr.Item;
arg_7_3 : in gmp_c.Pointers.mp_size_t_Pointer;
arg_7_4 : in gmp_c.mp_ptr.Item;
arg_7_5 : in gmp_c.mp_size_t;
arg_7_6 : in gmp_c.mp_ptr.Item;
arg_7_7 : in gmp_c.mp_size_t) return gmp_c.mp_size_t;
function a_a_gmpn_get_str
(arg_4_1 : in Swig.Pointers.unsigned_char_Pointer;
arg_4_2 : in Interfaces.C.int;
arg_4_3 : in gmp_c.mp_ptr.Item;
arg_4_4 : in gmp_c.mp_size_t) return Interfaces.C.size_t;
function a_a_gmpn_hamdist
(arg_3_1 : in gmp_c.mp_srcptr.Item;
arg_3_2 : in gmp_c.mp_srcptr.Item;
arg_3_3 : in gmp_c.mp_size_t) return gmp_c.mp_bitcnt_t;
function a_a_gmpn_lshift
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_size_t;
arg_4_4 : in Interfaces.C.unsigned) return gmp_c.mp_limb_t;
function a_a_gmpn_mod_1
(arg_3_1 : in gmp_c.mp_srcptr.Item;
arg_3_2 : in gmp_c.mp_size_t;
arg_3_3 : in gmp_c.mp_limb_t) return gmp_c.mp_limb_t;
function a_a_gmpn_mul
(arg_5_1 : in gmp_c.mp_ptr.Item;
arg_5_2 : in gmp_c.mp_srcptr.Item;
arg_5_3 : in gmp_c.mp_size_t;
arg_5_4 : in gmp_c.mp_srcptr.Item;
arg_5_5 : in gmp_c.mp_size_t) return gmp_c.mp_limb_t;
function a_a_gmpn_mul_1
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_size_t;
arg_4_4 : in gmp_c.mp_limb_t) return gmp_c.mp_limb_t;
procedure a_a_gmpn_mul_n
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_srcptr.Item;
arg_4_4 : in gmp_c.mp_size_t);
procedure a_a_gmpn_sqr
(arg_3_1 : in gmp_c.mp_ptr.Item;
arg_3_2 : in gmp_c.mp_srcptr.Item;
arg_3_3 : in gmp_c.mp_size_t);
procedure a_a_gmpn_com
(arg_3_1 : in gmp_c.mp_ptr.Item;
arg_3_2 : in gmp_c.mp_srcptr.Item;
arg_3_3 : in gmp_c.mp_size_t);
function a_a_gmpn_perfect_square_p
(arg_2_1 : in gmp_c.mp_srcptr.Item;
arg_2_2 : in gmp_c.mp_size_t) return Interfaces.C.int;
function a_a_gmpn_perfect_power_p
(arg_2_1 : in gmp_c.mp_srcptr.Item;
arg_2_2 : in gmp_c.mp_size_t) return Interfaces.C.int;
function a_a_gmpn_popcount
(arg_2_1 : in gmp_c.mp_srcptr.Item;
arg_2_2 : in gmp_c.mp_size_t) return gmp_c.mp_bitcnt_t;
function a_a_gmpn_pow_1
(arg_5_1 : in gmp_c.mp_ptr.Item;
arg_5_2 : in gmp_c.mp_srcptr.Item;
arg_5_3 : in gmp_c.mp_size_t;
arg_5_4 : in gmp_c.mp_limb_t;
arg_5_5 : in gmp_c.mp_ptr.Item) return gmp_c.mp_size_t;
function a_a_gmpn_preinv_mod_1
(arg_4_1 : in gmp_c.mp_srcptr.Item;
arg_4_2 : in gmp_c.mp_size_t;
arg_4_3 : in gmp_c.mp_limb_t;
arg_4_4 : in gmp_c.mp_limb_t) return gmp_c.mp_limb_t;
procedure a_a_gmpn_random
(arg_2_1 : in gmp_c.mp_ptr.Item;
arg_2_2 : in gmp_c.mp_size_t);
procedure a_a_gmpn_random2
(arg_2_1 : in gmp_c.mp_ptr.Item;
arg_2_2 : in gmp_c.mp_size_t);
function a_a_gmpn_rshift
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_size_t;
arg_4_4 : in Interfaces.C.unsigned) return gmp_c.mp_limb_t;
function a_a_gmpn_scan0
(arg_2_1 : in gmp_c.mp_srcptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t) return gmp_c.mp_bitcnt_t;
function a_a_gmpn_scan1
(arg_2_1 : in gmp_c.mp_srcptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t) return gmp_c.mp_bitcnt_t;
function a_a_gmpn_set_str
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in Swig.Pointers.unsigned_char_Pointer;
arg_4_3 : in Interfaces.C.size_t;
arg_4_4 : in Interfaces.C.int) return gmp_c.mp_size_t;
function a_a_gmpn_sqrtrem
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_ptr.Item;
arg_4_3 : in gmp_c.mp_srcptr.Item;
arg_4_4 : in gmp_c.mp_size_t) return gmp_c.mp_size_t;
function a_a_gmpn_sub_n
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_srcptr.Item;
arg_4_4 : in gmp_c.mp_size_t) return gmp_c.mp_limb_t;
function a_a_gmpn_submul_1
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_size_t;
arg_4_4 : in gmp_c.mp_limb_t) return gmp_c.mp_limb_t;
procedure a_a_gmpn_tdiv_qr
(arg_7_1 : in gmp_c.mp_ptr.Item;
arg_7_2 : in gmp_c.mp_ptr.Item;
arg_7_3 : in gmp_c.mp_size_t;
arg_7_4 : in gmp_c.mp_srcptr.Item;
arg_7_5 : in gmp_c.mp_size_t;
arg_7_6 : in gmp_c.mp_srcptr.Item;
arg_7_7 : in gmp_c.mp_size_t);
procedure a_a_gmpn_and_n
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_srcptr.Item;
arg_4_4 : in gmp_c.mp_size_t);
procedure a_a_gmpn_andn_n
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_srcptr.Item;
arg_4_4 : in gmp_c.mp_size_t);
procedure a_a_gmpn_nand_n
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_srcptr.Item;
arg_4_4 : in gmp_c.mp_size_t);
procedure a_a_gmpn_ior_n
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_srcptr.Item;
arg_4_4 : in gmp_c.mp_size_t);
procedure a_a_gmpn_iorn_n
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_srcptr.Item;
arg_4_4 : in gmp_c.mp_size_t);
procedure a_a_gmpn_nior_n
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_srcptr.Item;
arg_4_4 : in gmp_c.mp_size_t);
procedure a_a_gmpn_xor_n
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_srcptr.Item;
arg_4_4 : in gmp_c.mp_size_t);
procedure a_a_gmpn_xnor_n
(arg_4_1 : in gmp_c.mp_ptr.Item;
arg_4_2 : in gmp_c.mp_srcptr.Item;
arg_4_3 : in gmp_c.mp_srcptr.Item;
arg_4_4 : in gmp_c.mp_size_t);
procedure a_a_gmpn_copyi
(arg_3_1 : in gmp_c.mp_ptr.Item;
arg_3_2 : in gmp_c.mp_srcptr.Item;
arg_3_3 : in gmp_c.mp_size_t);
procedure a_a_gmpn_copyd
(arg_3_1 : in gmp_c.mp_ptr.Item;
arg_3_2 : in gmp_c.mp_srcptr.Item;
arg_3_3 : in gmp_c.mp_size_t);
procedure a_a_gmpn_zero
(arg_2_1 : in gmp_c.mp_ptr.Item;
arg_2_2 : in gmp_c.mp_size_t);
procedure a_a_gmpn_cnd_swap
(arg_4_1 : in gmp_c.mp_limb_t;
arg_4_2 : in gmp_c.Pointers.mp_limb_t_Pointer;
arg_4_3 : in gmp_c.Pointers.mp_limb_t_Pointer;
arg_4_4 : in gmp_c.mp_size_t);
procedure the_abs
(a_a_gmp_w : in gmp_c.mpz_ptr.Item;
a_a_gmp_u : in gmp_c.mpz_srcptr.Item);
function fits_uint_p
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function fits_ulong_p
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function fits_ushort_p
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function get_ui
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.unsigned_long;
function getlimbn
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item;
a_a_gmp_n : in gmp_c.mp_size_t) return gmp_c.mp_limb_t;
procedure neg
(a_a_gmp_w : in gmp_c.mpz_ptr.Item;
a_a_gmp_u : in gmp_c.mpz_srcptr.Item);
function perfect_square_p
(a_a_gmp_a : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function popcount
(a_a_gmp_u : in gmp_c.mpz_srcptr.Item) return gmp_c.mp_bitcnt_t;
procedure set_q
(a_a_gmp_w : in gmp_c.mpz_ptr.Item;
a_a_gmp_u : in gmp_c.mpq_srcptr.Item);
function size
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.size_t;
procedure the_abs
(a_a_gmp_w : in gmp_c.mpq_ptr.Item;
a_a_gmp_u : in gmp_c.mpq_srcptr.Item);
procedure neg
(a_a_gmp_w : in gmp_c.mpq_ptr.Item;
a_a_gmp_u : in gmp_c.mpq_srcptr.Item);
function a_a_gmpn_add
(a_a_gmp_wp : in gmp_c.mp_ptr.Item;
a_a_gmp_xp : in gmp_c.mp_srcptr.Item;
a_a_gmp_xsize : in gmp_c.mp_size_t;
a_a_gmp_yp : in gmp_c.mp_srcptr.Item;
a_a_gmp_ysize : in gmp_c.mp_size_t) return gmp_c.mp_limb_t;
function a_a_gmpn_add_1
(a_a_gmp_dst : in gmp_c.mp_ptr.Item;
a_a_gmp_src : in gmp_c.mp_srcptr.Item;
a_a_gmp_size : in gmp_c.mp_size_t;
a_a_gmp_n : in gmp_c.mp_limb_t) return gmp_c.mp_limb_t;
function a_a_gmpn_cmp
(a_a_gmp_xp : in gmp_c.mp_srcptr.Item;
a_a_gmp_yp : in gmp_c.mp_srcptr.Item;
a_a_gmp_size : in gmp_c.mp_size_t) return Interfaces.C.int;
function a_a_gmpn_zero_p
(a_a_gmp_p : in gmp_c.mp_srcptr.Item;
a_a_gmp_n : in gmp_c.mp_size_t) return Interfaces.C.int;
function a_a_gmpn_sub
(a_a_gmp_wp : in gmp_c.mp_ptr.Item;
a_a_gmp_xp : in gmp_c.mp_srcptr.Item;
a_a_gmp_xsize : in gmp_c.mp_size_t;
a_a_gmp_yp : in gmp_c.mp_srcptr.Item;
a_a_gmp_ysize : in gmp_c.mp_size_t) return gmp_c.mp_limb_t;
function a_a_gmpn_sub_1
(a_a_gmp_dst : in gmp_c.mp_ptr.Item;
a_a_gmp_src : in gmp_c.mp_srcptr.Item;
a_a_gmp_size : in gmp_c.mp_size_t;
a_a_gmp_n : in gmp_c.mp_limb_t) return gmp_c.mp_limb_t;
function a_a_gmpn_neg
(a_a_gmp_rp : in gmp_c.mp_ptr.Item;
a_a_gmp_up : in gmp_c.mp_srcptr.Item;
a_a_gmp_n : in gmp_c.mp_size_t) return gmp_c.mp_limb_t;
private
pragma Import (C, randinit, "Ada_randinit");
pragma Import (C, randinit_default, "Ada_randinit_default");
pragma Import (C, randinit_lc_2exp, "Ada_randinit_lc_2exp");
pragma Import (C, randinit_lc_2exp_size, "Ada_randinit_lc_2exp_size");
pragma Import (C, randinit_mt, "Ada_randinit_mt");
pragma Import (C, randinit_set, "Ada_randinit_set");
pragma Import (C, randseed, "Ada_randseed");
pragma Import (C, randseed_ui, "Ada_randseed_ui");
pragma Import (C, randclear, "Ada_randclear");
pragma Import (C, urandomb_ui, "Ada_urandomb_ui");
pragma Import (C, urandomm_ui, "Ada_urandomm_ui");
pragma Import (C, asprintf, "Ada_asprintf");
pragma Import (C, printf, "Ada_printf");
pragma Import (C, snprintf, "Ada_snprintf");
pragma Import (C, sprintf, "Ada_sprintf");
pragma Import (C, scanf, "Ada_scanf");
pragma Import (C, sscanf, "Ada_sscanf");
pragma Import (C, realloc, "Ada_realloc");
procedure add_v1
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure add
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item) renames
add_v1;
pragma Import (C, add_v1, "Ada_add__SWIG_0");
procedure add_ui_v1
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure add_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long) renames
add_ui_v1;
pragma Import (C, add_ui_v1, "Ada_add_ui__SWIG_0");
pragma Import (C, addmul, "Ada_addmul");
pragma Import (C, addmul_ui, "Ada_addmul_ui");
pragma Import (C, z_and, "Ada_z_and");
pragma Import (C, array_init, "Ada_array_init");
pragma Import (C, bin_ui, "Ada_bin_ui");
pragma Import (C, bin_uiui, "Ada_bin_uiui");
pragma Import (C, cdiv_q, "Ada_cdiv_q");
pragma Import (C, cdiv_q_2exp, "Ada_cdiv_q_2exp");
pragma Import (C, cdiv_q_ui, "Ada_cdiv_q_ui");
pragma Import (C, cdiv_qr, "Ada_cdiv_qr");
pragma Import (C, cdiv_qr_ui, "Ada_cdiv_qr_ui");
pragma Import (C, cdiv_r, "Ada_cdiv_r");
pragma Import (C, cdiv_r_2exp, "Ada_cdiv_r_2exp");
pragma Import (C, cdiv_r_ui, "Ada_cdiv_r_ui");
pragma Import (C, cdiv_ui, "Ada_cdiv_ui");
procedure clear_v1 (arg_1 : in gmp_c.mpz_ptr.Item);
procedure clear (arg_1 : in gmp_c.mpz_ptr.Item) renames clear_v1;
pragma Import (C, clear_v1, "Ada_clear__SWIG_0");
pragma Import (C, a_a_gmpz_clears, "Ada___gmpz_clears");
pragma Import (C, clrbit, "Ada_clrbit");
function cmp_v1
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function cmp
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int renames
cmp_v1;
pragma Import (C, cmp_v1, "Ada_cmp__SWIG_0");
function cmp_d_v1
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.double) return Interfaces.C.int;
function cmp_d
(arg_2_1 : in gmp_c.mpz_srcptr.Item;
arg_2_2 : in Interfaces.C.double) return Interfaces.C.int renames
cmp_d_v1;
pragma Import (C, cmp_d_v1, "Ada_cmp_d__SWIG_0");
pragma Import (C, a_a_gmpz_cmp_si, "Ada___gmpz_cmp_si");
pragma Import (C, a_a_gmpz_cmp_ui, "Ada___gmpz_cmp_ui");
pragma Import (C, cmpabs, "Ada_cmpabs");
pragma Import (C, cmpabs_d, "Ada_cmpabs_d");
pragma Import (C, cmpabs_ui, "Ada_cmpabs_ui");
pragma Import (C, com, "Ada_com");
pragma Import (C, combit, "Ada_combit");
pragma Import (C, congruent_p, "Ada_congruent_p");
pragma Import (C, congruent_2exp_p, "Ada_congruent_2exp_p");
pragma Import (C, congruent_ui_p, "Ada_congruent_ui_p");
pragma Import (C, divexact, "Ada_divexact");
pragma Import (C, divexact_ui, "Ada_divexact_ui");
pragma Import (C, divisible_p, "Ada_divisible_p");
pragma Import (C, divisible_ui_p, "Ada_divisible_ui_p");
pragma Import (C, divisible_2exp_p, "Ada_divisible_2exp_p");
procedure dump_v1 (arg_1 : in gmp_c.mpz_srcptr.Item);
procedure dump (arg_1 : in gmp_c.mpz_srcptr.Item) renames dump_v1;
pragma Import (C, dump_v1, "Ada_dump__SWIG_0");
pragma Import (C, z_export, "Ada_z_export");
pragma Import (C, fac_ui, "Ada_fac_ui");
pragma Import (C, a_a_gmpz_2fac_ui, "Ada___gmpz_2fac_ui");
pragma Import (C, a_a_gmpz_mfac_uiui, "Ada___gmpz_mfac_uiui");
pragma Import (C, a_a_gmpz_primorial_ui, "Ada___gmpz_primorial_ui");
pragma Import (C, fdiv_q, "Ada_fdiv_q");
pragma Import (C, fdiv_q_2exp, "Ada_fdiv_q_2exp");
pragma Import (C, fdiv_q_ui, "Ada_fdiv_q_ui");
pragma Import (C, fdiv_qr, "Ada_fdiv_qr");
pragma Import (C, fdiv_qr_ui, "Ada_fdiv_qr_ui");
pragma Import (C, fdiv_r, "Ada_fdiv_r");
pragma Import (C, fdiv_r_2exp, "Ada_fdiv_r_2exp");
pragma Import (C, fdiv_r_ui, "Ada_fdiv_r_ui");
pragma Import (C, fdiv_ui, "Ada_fdiv_ui");
pragma Import (C, fib_ui, "Ada_fib_ui");
pragma Import (C, fib2_ui, "Ada_fib2_ui");
function fits_sint_p_v1
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function fits_sint_p
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int renames
fits_sint_p_v1;
pragma Import (C, fits_sint_p_v1, "Ada_fits_sint_p__SWIG_0");
function fits_slong_p_v1
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function fits_slong_p
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int renames
fits_slong_p_v1;
pragma Import (C, fits_slong_p_v1, "Ada_fits_slong_p__SWIG_0");
function fits_sshort_p_v1
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function fits_sshort_p
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int renames
fits_sshort_p_v1;
pragma Import (C, fits_sshort_p_v1, "Ada_fits_sshort_p__SWIG_0");
pragma Import (C, gcd, "Ada_gcd");
pragma Import (C, gcd_ui, "Ada_gcd_ui");
pragma Import (C, gcdext, "Ada_gcdext");
function get_d_v1
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.double;
function get_d
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.double renames
get_d_v1;
pragma Import (C, get_d_v1, "Ada_get_d__SWIG_0");
function get_d_2exp_v1
(arg_2_1 : in Swig.Pointers.long_Pointer;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.double;
function get_d_2exp
(arg_2_1 : in Swig.Pointers.long_Pointer;
arg_2_2 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.double renames
get_d_2exp_v1;
pragma Import (C, get_d_2exp_v1, "Ada_get_d_2exp__SWIG_0");
function get_si_v1
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.long;
function get_si
(arg_1 : in gmp_c.mpz_srcptr.Item) return Interfaces.C.long renames
get_si_v1;
pragma Import (C, get_si_v1, "Ada_get_si__SWIG_0");
function get_str_v1
(arg_3_1 : in Interfaces.C.Strings.chars_ptr;
arg_3_2 : in Interfaces.C.int;
arg_3_3 : in gmp_c.mpz_srcptr.Item)
return Interfaces.C.Strings.chars_ptr;
function get_str
(arg_3_1 : in Interfaces.C.Strings.chars_ptr;
arg_3_2 : in Interfaces.C.int;
arg_3_3 : in gmp_c.mpz_srcptr.Item)
return Interfaces.C.Strings.chars_ptr renames
get_str_v1;
pragma Import (C, get_str_v1, "Ada_get_str__SWIG_0");
pragma Import (C, hamdist, "Ada_hamdist");
pragma Import (C, import, "Ada_import");
procedure init_v1 (arg_1 : in gmp_c.mpz_ptr.Item);
procedure init (arg_1 : in gmp_c.mpz_ptr.Item) renames init_v1;
pragma Import (C, init_v1, "Ada_init__SWIG_0");
procedure init2_v1
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t);
procedure init2
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t) renames
init2_v1;
pragma Import (C, init2_v1, "Ada_init2__SWIG_0");
pragma Import (C, a_a_gmpz_inits, "Ada___gmpz_inits");
procedure init_set_v1
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
procedure init_set
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) renames
init_set_v1;
pragma Import (C, init_set_v1, "Ada_init_set__SWIG_0");
procedure init_set_d_v1
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.double);
procedure init_set_d
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.double) renames
init_set_d_v1;
pragma Import (C, init_set_d_v1, "Ada_init_set_d__SWIG_0");
procedure init_set_si_v1
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.long);
procedure init_set_si
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.long) renames
init_set_si_v1;
pragma Import (C, init_set_si_v1, "Ada_init_set_si__SWIG_0");
function init_set_str_v1
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int;
function init_set_str
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int renames
init_set_str_v1;
pragma Import (C, init_set_str_v1, "Ada_init_set_str__SWIG_0");
procedure init_set_ui_v1
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
procedure init_set_ui
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long) renames
init_set_ui_v1;
pragma Import (C, init_set_ui_v1, "Ada_init_set_ui__SWIG_0");
pragma Import (C, invert, "Ada_invert");
pragma Import (C, ior, "Ada_ior");
pragma Import (C, jacobi, "Ada_jacobi");
pragma Import (C, kronecker_si, "Ada_kronecker_si");
pragma Import (C, kronecker_ui, "Ada_kronecker_ui");
pragma Import (C, si_kronecker, "Ada_si_kronecker");
pragma Import (C, ui_kronecker, "Ada_ui_kronecker");
pragma Import (C, lcm, "Ada_lcm");
pragma Import (C, lcm_ui, "Ada_lcm_ui");
pragma Import (C, lucnum_ui, "Ada_lucnum_ui");
pragma Import (C, lucnum2_ui, "Ada_lucnum2_ui");
pragma Import (C, millerrabin, "Ada_millerrabin");
pragma Import (C, the_mod, "Ada_mod");
procedure mul_v1
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure mul
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item) renames
mul_v1;
pragma Import (C, mul_v1, "Ada_mul__SWIG_0");
procedure mul_2exp_v1
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
procedure mul_2exp
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t) renames
mul_2exp_v1;
pragma Import (C, mul_2exp_v1, "Ada_mul_2exp__SWIG_0");
pragma Import (C, mul_si, "Ada_mul_si");
procedure mul_ui_v1
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure mul_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long) renames
mul_ui_v1;
pragma Import (C, mul_ui_v1, "Ada_mul_ui__SWIG_0");
pragma Import (C, nextprime, "Ada_nextprime");
pragma Import (C, perfect_power_p, "Ada_perfect_power_p");
procedure pow_ui_v1
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure pow_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long) renames
pow_ui_v1;
pragma Import (C, pow_ui_v1, "Ada_pow_ui__SWIG_0");
pragma Import (C, powm, "Ada_powm");
pragma Import (C, a_a_gmpz_powm_sec, "Ada___gmpz_powm_sec");
pragma Import (C, powm_ui, "Ada_powm_ui");
pragma Import (C, probab_prime_p, "Ada_probab_prime_p");
pragma Import (C, random, "Ada_random");
procedure random2_v1
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mp_size_t);
procedure random2
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mp_size_t) renames
random2_v1;
pragma Import (C, random2_v1, "Ada_random2__SWIG_0");
pragma Import (C, realloc2, "Ada_realloc2");
pragma Import (C, remove, "Ada_remove");
pragma Import (C, root, "Ada_root");
pragma Import (C, rootrem, "Ada_rootrem");
pragma Import (C, rrandomb, "Ada_rrandomb");
pragma Import (C, scan0, "Ada_scan0");
pragma Import (C, scan1, "Ada_scan1");
procedure set_v1
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
procedure set
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) renames
set_v1;
pragma Import (C, set_v1, "Ada_set__SWIG_0");
procedure set_d_v1
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.double);
procedure set_d
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.double) renames
set_d_v1;
pragma Import (C, set_d_v1, "Ada_set_d__SWIG_0");
procedure set_f_v1
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure set_f
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item) renames
set_f_v1;
pragma Import (C, set_f_v1, "Ada_set_f__SWIG_0");
procedure set_si_v1
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.long);
procedure set_si
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.long) renames
set_si_v1;
pragma Import (C, set_si_v1, "Ada_set_si__SWIG_0");
function set_str_v1
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int;
function set_str
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int renames
set_str_v1;
pragma Import (C, set_str_v1, "Ada_set_str__SWIG_0");
procedure set_ui_v1
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
procedure set_ui
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long) renames
set_ui_v1;
pragma Import (C, set_ui_v1, "Ada_set_ui__SWIG_0");
pragma Import (C, setbit, "Ada_setbit");
pragma Import (C, sizeinbase, "Ada_sizeinbase");
procedure sqrt_v1
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
procedure sqrt
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) renames
sqrt_v1;
pragma Import (C, sqrt_v1, "Ada_sqrt__SWIG_0");
pragma Import (C, sqrtrem, "Ada_sqrtrem");
procedure sub_v1
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure sub
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in gmp_c.mpz_srcptr.Item) renames
sub_v1;
pragma Import (C, sub_v1, "Ada_sub__SWIG_0");
procedure sub_ui_v1
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure sub_ui
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.mpz_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long) renames
sub_ui_v1;
pragma Import (C, sub_ui_v1, "Ada_sub_ui__SWIG_0");
procedure ui_sub_v1
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in gmp_c.mpz_srcptr.Item);
procedure ui_sub
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in gmp_c.mpz_srcptr.Item) renames
ui_sub_v1;
pragma Import (C, ui_sub_v1, "Ada_ui_sub__SWIG_0");
pragma Import (C, submul, "Ada_submul");
pragma Import (C, submul_ui, "Ada_submul_ui");
procedure swap_v1
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_ptr.Item);
procedure swap
(arg_2_1 : in gmp_c.mpz_ptr.Item;
arg_2_2 : in gmp_c.mpz_ptr.Item) renames
swap_v1;
pragma Import (C, swap_v1, "Ada_swap__SWIG_0");
pragma Import (C, tdiv_ui, "Ada_tdiv_ui");
pragma Import (C, tdiv_q, "Ada_tdiv_q");
pragma Import (C, tdiv_q_2exp, "Ada_tdiv_q_2exp");
pragma Import (C, tdiv_q_ui, "Ada_tdiv_q_ui");
pragma Import (C, tdiv_qr, "Ada_tdiv_qr");
pragma Import (C, tdiv_qr_ui, "Ada_tdiv_qr_ui");
pragma Import (C, tdiv_r, "Ada_tdiv_r");
pragma Import (C, tdiv_r_2exp, "Ada_tdiv_r_2exp");
pragma Import (C, tdiv_r_ui, "Ada_tdiv_r_ui");
pragma Import (C, tstbit, "Ada_tstbit");
pragma Import (C, ui_pow_ui, "Ada_ui_pow_ui");
procedure urandomb_v1
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.gmp_randstate_t.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
procedure urandomb
(arg_3_1 : in gmp_c.mpz_ptr.Item;
arg_3_2 : in gmp_c.gmp_randstate_t.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t) renames
urandomb_v1;
pragma Import (C, urandomb_v1, "Ada_urandomb__SWIG_0");
pragma Import (C, urandomm, "Ada_urandomm");
pragma Import (C, z_xor, "Ada_z_xor");
procedure add_v2
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mpq_srcptr.Item);
procedure add
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mpq_srcptr.Item) renames
add_v2;
pragma Import (C, add_v2, "Ada_add__SWIG_1");
pragma Import (C, canonicalize, "Ada_canonicalize");
procedure clear_v2 (arg_1 : in gmp_c.mpq_ptr.Item);
procedure clear (arg_1 : in gmp_c.mpq_ptr.Item) renames clear_v2;
pragma Import (C, clear_v2, "Ada_clear__SWIG_1");
pragma Import (C, a_a_gmpq_clears, "Ada___gmpq_clears");
function cmp_v2
(arg_2_1 : in gmp_c.mpq_srcptr.Item;
arg_2_2 : in gmp_c.mpq_srcptr.Item) return Interfaces.C.int;
function cmp
(arg_2_1 : in gmp_c.mpq_srcptr.Item;
arg_2_2 : in gmp_c.mpq_srcptr.Item) return Interfaces.C.int renames
cmp_v2;
pragma Import (C, cmp_v2, "Ada_cmp__SWIG_1");
pragma Import (C, a_a_gmpq_cmp_si, "Ada___gmpq_cmp_si");
pragma Import (C, a_a_gmpq_cmp_ui, "Ada___gmpq_cmp_ui");
pragma Import (C, a_a_gmpq_cmp_z, "Ada___gmpq_cmp_z");
procedure div_v1
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mpq_srcptr.Item);
procedure div
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mpq_srcptr.Item) renames
div_v1;
pragma Import (C, div_v1, "Ada_div__SWIG_0");
procedure div_2exp_v1
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
procedure div_2exp
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t) renames
div_2exp_v1;
pragma Import (C, div_2exp_v1, "Ada_div_2exp__SWIG_0");
pragma Import (C, equal, "Ada_equal");
pragma Import (C, get_num, "Ada_get_num");
pragma Import (C, get_den, "Ada_get_den");
function get_d_v2
(arg_1 : in gmp_c.mpq_srcptr.Item) return Interfaces.C.double;
function get_d
(arg_1 : in gmp_c.mpq_srcptr.Item) return Interfaces.C.double renames
get_d_v2;
pragma Import (C, get_d_v2, "Ada_get_d__SWIG_1");
function get_str_v2
(arg_3_1 : in Interfaces.C.Strings.chars_ptr;
arg_3_2 : in Interfaces.C.int;
arg_3_3 : in gmp_c.mpq_srcptr.Item)
return Interfaces.C.Strings.chars_ptr;
function get_str
(arg_3_1 : in Interfaces.C.Strings.chars_ptr;
arg_3_2 : in Interfaces.C.int;
arg_3_3 : in gmp_c.mpq_srcptr.Item)
return Interfaces.C.Strings.chars_ptr renames
get_str_v2;
pragma Import (C, get_str_v2, "Ada_get_str__SWIG_1");
procedure init_v2 (arg_1 : in gmp_c.mpq_ptr.Item);
procedure init (arg_1 : in gmp_c.mpq_ptr.Item) renames init_v2;
pragma Import (C, init_v2, "Ada_init__SWIG_1");
pragma Import (C, a_a_gmpq_inits, "Ada___gmpq_inits");
pragma Import (C, inv, "Ada_inv");
procedure mul_v2
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mpq_srcptr.Item);
procedure mul
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mpq_srcptr.Item) renames
mul_v2;
pragma Import (C, mul_v2, "Ada_mul__SWIG_1");
procedure mul_2exp_v2
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
procedure mul_2exp
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t) renames
mul_2exp_v2;
pragma Import (C, mul_2exp_v2, "Ada_mul_2exp__SWIG_1");
procedure set_v2
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpq_srcptr.Item);
procedure set
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpq_srcptr.Item) renames
set_v2;
pragma Import (C, set_v2, "Ada_set__SWIG_1");
procedure set_d_v2
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in Interfaces.C.double);
procedure set_d
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in Interfaces.C.double) renames
set_d_v2;
pragma Import (C, set_d_v2, "Ada_set_d__SWIG_1");
pragma Import (C, set_den, "Ada_set_den");
procedure set_f_v2
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure set_f
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item) renames
set_f_v2;
pragma Import (C, set_f_v2, "Ada_set_f__SWIG_1");
pragma Import (C, set_num, "Ada_set_num");
procedure set_si_v2
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in Interfaces.C.long;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure set_si
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in Interfaces.C.long;
arg_3_3 : in Interfaces.C.unsigned_long) renames
set_si_v2;
pragma Import (C, set_si_v2, "Ada_set_si__SWIG_1");
function set_str_v2
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int;
function set_str
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int renames
set_str_v2;
pragma Import (C, set_str_v2, "Ada_set_str__SWIG_1");
procedure set_ui_v2
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure set_ui
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in Interfaces.C.unsigned_long) renames
set_ui_v2;
pragma Import (C, set_ui_v2, "Ada_set_ui__SWIG_1");
procedure set_z_v1
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
procedure set_z
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) renames
set_z_v1;
pragma Import (C, set_z_v1, "Ada_set_z__SWIG_0");
procedure sub_v2
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mpq_srcptr.Item);
procedure sub
(arg_3_1 : in gmp_c.mpq_ptr.Item;
arg_3_2 : in gmp_c.mpq_srcptr.Item;
arg_3_3 : in gmp_c.mpq_srcptr.Item) renames
sub_v2;
pragma Import (C, sub_v2, "Ada_sub__SWIG_1");
procedure swap_v2
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpq_ptr.Item);
procedure swap
(arg_2_1 : in gmp_c.mpq_ptr.Item;
arg_2_2 : in gmp_c.mpq_ptr.Item) renames
swap_v2;
pragma Import (C, swap_v2, "Ada_swap__SWIG_1");
procedure the_abs_v1
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure the_abs
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item) renames
the_abs_v1;
pragma Import (C, the_abs_v1, "Ada_abs__SWIG_0");
procedure add_v3
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mpf_srcptr.Item);
procedure add
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mpf_srcptr.Item) renames
add_v3;
pragma Import (C, add_v3, "Ada_add__SWIG_2");
procedure add_ui_v2
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure add_ui
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long) renames
add_ui_v2;
pragma Import (C, add_ui_v2, "Ada_add_ui__SWIG_1");
pragma Import (C, ceil, "Ada_ceil");
procedure clear_v3 (arg_1 : in gmp_c.mpf_ptr.Item);
procedure clear (arg_1 : in gmp_c.mpf_ptr.Item) renames clear_v3;
pragma Import (C, clear_v3, "Ada_clear__SWIG_2");
pragma Import (C, a_a_gmpf_clears, "Ada___gmpf_clears");
function cmp_v3
(arg_2_1 : in gmp_c.mpf_srcptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
function cmp
(arg_2_1 : in gmp_c.mpf_srcptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int renames
cmp_v3;
pragma Import (C, cmp_v3, "Ada_cmp__SWIG_2");
pragma Import (C, a_a_gmpf_cmp_z, "Ada___gmpf_cmp_z");
function cmp_d_v2
(arg_2_1 : in gmp_c.mpf_srcptr.Item;
arg_2_2 : in Interfaces.C.double) return Interfaces.C.int;
function cmp_d
(arg_2_1 : in gmp_c.mpf_srcptr.Item;
arg_2_2 : in Interfaces.C.double) return Interfaces.C.int renames
cmp_d_v2;
pragma Import (C, cmp_d_v2, "Ada_cmp_d__SWIG_1");
pragma Import (C, cmp_si, "Ada_cmp_si");
pragma Import (C, cmp_ui, "Ada_cmp_ui");
procedure div_v2
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mpf_srcptr.Item);
procedure div
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mpf_srcptr.Item) renames
div_v2;
pragma Import (C, div_v2, "Ada_div__SWIG_1");
procedure div_2exp_v2
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
procedure div_2exp
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t) renames
div_2exp_v2;
pragma Import (C, div_2exp_v2, "Ada_div_2exp__SWIG_1");
pragma Import (C, div_ui, "Ada_div_ui");
procedure dump_v2 (arg_1 : in gmp_c.mpf_srcptr.Item);
procedure dump (arg_1 : in gmp_c.mpf_srcptr.Item) renames dump_v2;
pragma Import (C, dump_v2, "Ada_dump__SWIG_1");
pragma Import (C, eq, "Ada_eq");
function fits_sint_p_v2
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
function fits_sint_p
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int renames
fits_sint_p_v2;
pragma Import (C, fits_sint_p_v2, "Ada_fits_sint_p__SWIG_1");
function fits_slong_p_v2
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
function fits_slong_p
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int renames
fits_slong_p_v2;
pragma Import (C, fits_slong_p_v2, "Ada_fits_slong_p__SWIG_1");
function fits_sshort_p_v2
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
function fits_sshort_p
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int renames
fits_sshort_p_v2;
pragma Import (C, fits_sshort_p_v2, "Ada_fits_sshort_p__SWIG_1");
function fits_uint_p_v1
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
function fits_uint_p
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int renames
fits_uint_p_v1;
pragma Import (C, fits_uint_p_v1, "Ada_fits_uint_p__SWIG_0");
function fits_ulong_p_v1
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
function fits_ulong_p
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int renames
fits_ulong_p_v1;
pragma Import (C, fits_ulong_p_v1, "Ada_fits_ulong_p__SWIG_0");
function fits_ushort_p_v1
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int;
function fits_ushort_p
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.int renames
fits_ushort_p_v1;
pragma Import (C, fits_ushort_p_v1, "Ada_fits_ushort_p__SWIG_0");
pragma Import (C, floor, "Ada_floor");
function get_d_v3
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.double;
function get_d
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.double renames
get_d_v3;
pragma Import (C, get_d_v3, "Ada_get_d__SWIG_2");
function get_d_2exp_v2
(arg_2_1 : in Swig.Pointers.long_Pointer;
arg_2_2 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.double;
function get_d_2exp
(arg_2_1 : in Swig.Pointers.long_Pointer;
arg_2_2 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.double renames
get_d_2exp_v2;
pragma Import (C, get_d_2exp_v2, "Ada_get_d_2exp__SWIG_1");
pragma Import (C, get_default_prec, "Ada_get_default_prec");
pragma Import (C, get_prec, "Ada_get_prec");
function get_si_v2
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.long;
function get_si
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.long renames
get_si_v2;
pragma Import (C, get_si_v2, "Ada_get_si__SWIG_1");
function get_str_v3
(arg_5_1 : in Interfaces.C.Strings.chars_ptr;
arg_5_2 : in gmp_c.Pointers.mp_exp_t_Pointer;
arg_5_3 : in Interfaces.C.int;
arg_5_4 : in Interfaces.C.size_t;
arg_5_5 : in gmp_c.mpf_srcptr.Item)
return Interfaces.C.Strings.chars_ptr;
function get_str
(arg_5_1 : in Interfaces.C.Strings.chars_ptr;
arg_5_2 : in gmp_c.Pointers.mp_exp_t_Pointer;
arg_5_3 : in Interfaces.C.int;
arg_5_4 : in Interfaces.C.size_t;
arg_5_5 : in gmp_c.mpf_srcptr.Item)
return Interfaces.C.Strings.chars_ptr renames
get_str_v3;
pragma Import (C, get_str_v3, "Ada_get_str__SWIG_2");
function get_ui_v1
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.unsigned_long;
function get_ui
(arg_1 : in gmp_c.mpf_srcptr.Item)
return Interfaces.C.unsigned_long renames
get_ui_v1;
pragma Import (C, get_ui_v1, "Ada_get_ui__SWIG_0");
procedure init_v3 (arg_1 : in gmp_c.mpf_ptr.Item);
procedure init (arg_1 : in gmp_c.mpf_ptr.Item) renames init_v3;
pragma Import (C, init_v3, "Ada_init__SWIG_2");
procedure init2_v2
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t);
procedure init2
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mp_bitcnt_t) renames
init2_v2;
pragma Import (C, init2_v2, "Ada_init2__SWIG_1");
pragma Import (C, a_a_gmpf_inits, "Ada___gmpf_inits");
procedure init_set_v2
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure init_set
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item) renames
init_set_v2;
pragma Import (C, init_set_v2, "Ada_init_set__SWIG_1");
procedure init_set_d_v2
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.double);
procedure init_set_d
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.double) renames
init_set_d_v2;
pragma Import (C, init_set_d_v2, "Ada_init_set_d__SWIG_1");
procedure init_set_si_v2
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.long);
procedure init_set_si
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.long) renames
init_set_si_v2;
pragma Import (C, init_set_si_v2, "Ada_init_set_si__SWIG_1");
function init_set_str_v2
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int;
function init_set_str
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int renames
init_set_str_v2;
pragma Import (C, init_set_str_v2, "Ada_init_set_str__SWIG_1");
procedure init_set_ui_v2
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
procedure init_set_ui
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long) renames
init_set_ui_v2;
pragma Import (C, init_set_ui_v2, "Ada_init_set_ui__SWIG_1");
pragma Import (C, integer_p, "Ada_integer_p");
procedure mul_v3
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mpf_srcptr.Item);
procedure mul
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mpf_srcptr.Item) renames
mul_v3;
pragma Import (C, mul_v3, "Ada_mul__SWIG_2");
procedure mul_2exp_v3
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
procedure mul_2exp
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t) renames
mul_2exp_v3;
pragma Import (C, mul_2exp_v3, "Ada_mul_2exp__SWIG_2");
procedure mul_ui_v2
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure mul_ui
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long) renames
mul_ui_v2;
pragma Import (C, mul_ui_v2, "Ada_mul_ui__SWIG_1");
procedure neg_v1
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure neg
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item) renames
neg_v1;
pragma Import (C, neg_v1, "Ada_neg__SWIG_0");
procedure pow_ui_v2
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure pow_ui
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long) renames
pow_ui_v2;
pragma Import (C, pow_ui_v2, "Ada_pow_ui__SWIG_1");
procedure random2_v2
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mp_size_t;
arg_3_3 : in gmp_c.mp_exp_t);
procedure random2
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mp_size_t;
arg_3_3 : in gmp_c.mp_exp_t) renames
random2_v2;
pragma Import (C, random2_v2, "Ada_random2__SWIG_1");
pragma Import (C, reldiff, "Ada_reldiff");
procedure set_v3
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure set
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item) renames
set_v3;
pragma Import (C, set_v3, "Ada_set__SWIG_2");
procedure set_d_v3
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.double);
procedure set_d
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.double) renames
set_d_v3;
pragma Import (C, set_d_v3, "Ada_set_d__SWIG_2");
pragma Import (C, set_default_prec, "Ada_set_default_prec");
pragma Import (C, set_prec, "Ada_set_prec");
pragma Import (C, set_prec_raw, "Ada_set_prec_raw");
procedure set_q_v1
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpq_srcptr.Item);
procedure set_q
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpq_srcptr.Item) renames
set_q_v1;
pragma Import (C, set_q_v1, "Ada_set_q__SWIG_0");
procedure set_si_v3
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.long);
procedure set_si
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.long) renames
set_si_v3;
pragma Import (C, set_si_v3, "Ada_set_si__SWIG_2");
function set_str_v3
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int;
function set_str
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in Interfaces.C.Strings.chars_ptr;
arg_3_3 : in Interfaces.C.int) return Interfaces.C.int renames
set_str_v3;
pragma Import (C, set_str_v3, "Ada_set_str__SWIG_2");
procedure set_ui_v3
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long);
procedure set_ui
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in Interfaces.C.unsigned_long) renames
set_ui_v3;
pragma Import (C, set_ui_v3, "Ada_set_ui__SWIG_2");
procedure set_z_v2
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item);
procedure set_z
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpz_srcptr.Item) renames
set_z_v2;
pragma Import (C, set_z_v2, "Ada_set_z__SWIG_1");
function size_v1
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.size_t;
function size
(arg_1 : in gmp_c.mpf_srcptr.Item) return Interfaces.C.size_t renames
size_v1;
pragma Import (C, size_v1, "Ada_size__SWIG_0");
procedure sqrt_v2
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item);
procedure sqrt
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_srcptr.Item) renames
sqrt_v2;
pragma Import (C, sqrt_v2, "Ada_sqrt__SWIG_1");
pragma Import (C, sqrt_ui, "Ada_sqrt_ui");
procedure sub_v3
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mpf_srcptr.Item);
procedure sub
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in gmp_c.mpf_srcptr.Item) renames
sub_v3;
pragma Import (C, sub_v3, "Ada_sub__SWIG_2");
procedure sub_ui_v2
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long);
procedure sub_ui
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in gmp_c.mpf_srcptr.Item;
arg_3_3 : in Interfaces.C.unsigned_long) renames
sub_ui_v2;
pragma Import (C, sub_ui_v2, "Ada_sub_ui__SWIG_1");
procedure swap_v3
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_ptr.Item);
procedure swap
(arg_2_1 : in gmp_c.mpf_ptr.Item;
arg_2_2 : in gmp_c.mpf_ptr.Item) renames
swap_v3;
pragma Import (C, swap_v3, "Ada_swap__SWIG_2");
pragma Import (C, trunc, "Ada_trunc");
pragma Import (C, ui_div, "Ada_ui_div");
procedure ui_sub_v2
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in gmp_c.mpf_srcptr.Item);
procedure ui_sub
(arg_3_1 : in gmp_c.mpf_ptr.Item;
arg_3_2 : in Interfaces.C.unsigned_long;
arg_3_3 : in gmp_c.mpf_srcptr.Item) renames
ui_sub_v2;
pragma Import (C, ui_sub_v2, "Ada_ui_sub__SWIG_1");
procedure urandomb_v2
(arg_3_1 : in gmp_c.mpf_t.Item;
arg_3_2 : in gmp_c.gmp_randstate_t.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t);
procedure urandomb
(arg_3_1 : in gmp_c.mpf_t.Item;
arg_3_2 : in gmp_c.gmp_randstate_t.Item;
arg_3_3 : in gmp_c.mp_bitcnt_t) renames
urandomb_v2;
pragma Import (C, urandomb_v2, "Ada_urandomb__SWIG_1");
pragma Import (C, a_a_gmpn_add_n, "Ada___gmpn_add_n");
pragma Import (C, a_a_gmpn_addmul_1, "Ada___gmpn_addmul_1");
pragma Import (C, a_a_gmpn_divexact_1, "Ada___gmpn_divexact_1");
pragma Import (C, a_a_gmpn_divexact_by3c, "Ada___gmpn_divexact_by3c");
pragma Import (C, a_a_gmpn_divrem, "Ada___gmpn_divrem");
pragma Import (C, a_a_gmpn_divrem_1, "Ada___gmpn_divrem_1");
pragma Import (C, a_a_gmpn_divrem_2, "Ada___gmpn_divrem_2");
pragma Import (C, a_a_gmpn_div_qr_2, "Ada___gmpn_div_qr_2");
pragma Import (C, a_a_gmpn_gcd, "Ada___gmpn_gcd");
pragma Import (C, a_a_gmpn_gcd_1, "Ada___gmpn_gcd_1");
pragma Import (C, a_a_gmpn_gcdext_1, "Ada___gmpn_gcdext_1");
pragma Import (C, a_a_gmpn_gcdext, "Ada___gmpn_gcdext");
pragma Import (C, a_a_gmpn_get_str, "Ada___gmpn_get_str");
pragma Import (C, a_a_gmpn_hamdist, "Ada___gmpn_hamdist");
pragma Import (C, a_a_gmpn_lshift, "Ada___gmpn_lshift");
pragma Import (C, a_a_gmpn_mod_1, "Ada___gmpn_mod_1");
pragma Import (C, a_a_gmpn_mul, "Ada___gmpn_mul");
pragma Import (C, a_a_gmpn_mul_1, "Ada___gmpn_mul_1");
pragma Import (C, a_a_gmpn_mul_n, "Ada___gmpn_mul_n");
pragma Import (C, a_a_gmpn_sqr, "Ada___gmpn_sqr");
pragma Import (C, a_a_gmpn_com, "Ada___gmpn_com");
pragma Import (C, a_a_gmpn_perfect_square_p, "Ada___gmpn_perfect_square_p");
pragma Import (C, a_a_gmpn_perfect_power_p, "Ada___gmpn_perfect_power_p");
pragma Import (C, a_a_gmpn_popcount, "Ada___gmpn_popcount");
pragma Import (C, a_a_gmpn_pow_1, "Ada___gmpn_pow_1");
pragma Import (C, a_a_gmpn_preinv_mod_1, "Ada___gmpn_preinv_mod_1");
pragma Import (C, a_a_gmpn_random, "Ada___gmpn_random");
pragma Import (C, a_a_gmpn_random2, "Ada___gmpn_random2");
pragma Import (C, a_a_gmpn_rshift, "Ada___gmpn_rshift");
pragma Import (C, a_a_gmpn_scan0, "Ada___gmpn_scan0");
pragma Import (C, a_a_gmpn_scan1, "Ada___gmpn_scan1");
pragma Import (C, a_a_gmpn_set_str, "Ada___gmpn_set_str");
pragma Import (C, a_a_gmpn_sqrtrem, "Ada___gmpn_sqrtrem");
pragma Import (C, a_a_gmpn_sub_n, "Ada___gmpn_sub_n");
pragma Import (C, a_a_gmpn_submul_1, "Ada___gmpn_submul_1");
pragma Import (C, a_a_gmpn_tdiv_qr, "Ada___gmpn_tdiv_qr");
pragma Import (C, a_a_gmpn_and_n, "Ada___gmpn_and_n");
pragma Import (C, a_a_gmpn_andn_n, "Ada___gmpn_andn_n");
pragma Import (C, a_a_gmpn_nand_n, "Ada___gmpn_nand_n");
pragma Import (C, a_a_gmpn_ior_n, "Ada___gmpn_ior_n");
pragma Import (C, a_a_gmpn_iorn_n, "Ada___gmpn_iorn_n");
pragma Import (C, a_a_gmpn_nior_n, "Ada___gmpn_nior_n");
pragma Import (C, a_a_gmpn_xor_n, "Ada___gmpn_xor_n");
pragma Import (C, a_a_gmpn_xnor_n, "Ada___gmpn_xnor_n");
pragma Import (C, a_a_gmpn_copyi, "Ada___gmpn_copyi");
pragma Import (C, a_a_gmpn_copyd, "Ada___gmpn_copyd");
pragma Import (C, a_a_gmpn_zero, "Ada___gmpn_zero");
pragma Import (C, a_a_gmpn_cnd_swap, "Ada___gmpn_cnd_swap");
procedure the_abs_v2
(a_a_gmp_w : in gmp_c.mpz_ptr.Item;
a_a_gmp_u : in gmp_c.mpz_srcptr.Item);
procedure the_abs
(a_a_gmp_w : in gmp_c.mpz_ptr.Item;
a_a_gmp_u : in gmp_c.mpz_srcptr.Item) renames
the_abs_v2;
pragma Import (C, the_abs_v2, "Ada_abs__SWIG_1");
function fits_uint_p_v2
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function fits_uint_p
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int renames
fits_uint_p_v2;
pragma Import (C, fits_uint_p_v2, "Ada_fits_uint_p__SWIG_1");
function fits_ulong_p_v2
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function fits_ulong_p
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int renames
fits_ulong_p_v2;
pragma Import (C, fits_ulong_p_v2, "Ada_fits_ulong_p__SWIG_1");
function fits_ushort_p_v2
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int;
function fits_ushort_p
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.int renames
fits_ushort_p_v2;
pragma Import (C, fits_ushort_p_v2, "Ada_fits_ushort_p__SWIG_1");
function get_ui_v2
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.unsigned_long;
function get_ui
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item)
return Interfaces.C.unsigned_long renames
get_ui_v2;
pragma Import (C, get_ui_v2, "Ada_get_ui__SWIG_1");
pragma Import (C, getlimbn, "Ada_getlimbn");
procedure neg_v2
(a_a_gmp_w : in gmp_c.mpz_ptr.Item;
a_a_gmp_u : in gmp_c.mpz_srcptr.Item);
procedure neg
(a_a_gmp_w : in gmp_c.mpz_ptr.Item;
a_a_gmp_u : in gmp_c.mpz_srcptr.Item) renames
neg_v2;
pragma Import (C, neg_v2, "Ada_neg__SWIG_1");
pragma Import (C, perfect_square_p, "Ada_perfect_square_p");
pragma Import (C, popcount, "Ada_popcount");
procedure set_q_v2
(a_a_gmp_w : in gmp_c.mpz_ptr.Item;
a_a_gmp_u : in gmp_c.mpq_srcptr.Item);
procedure set_q
(a_a_gmp_w : in gmp_c.mpz_ptr.Item;
a_a_gmp_u : in gmp_c.mpq_srcptr.Item) renames
set_q_v2;
pragma Import (C, set_q_v2, "Ada_set_q__SWIG_1");
function size_v2
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.size_t;
function size
(a_a_gmp_z : in gmp_c.mpz_srcptr.Item) return Interfaces.C.size_t renames
size_v2;
pragma Import (C, size_v2, "Ada_size__SWIG_1");
procedure the_abs_v3
(a_a_gmp_w : in gmp_c.mpq_ptr.Item;
a_a_gmp_u : in gmp_c.mpq_srcptr.Item);
procedure the_abs
(a_a_gmp_w : in gmp_c.mpq_ptr.Item;
a_a_gmp_u : in gmp_c.mpq_srcptr.Item) renames
the_abs_v3;
pragma Import (C, the_abs_v3, "Ada_abs__SWIG_2");
procedure neg_v3
(a_a_gmp_w : in gmp_c.mpq_ptr.Item;
a_a_gmp_u : in gmp_c.mpq_srcptr.Item);
procedure neg
(a_a_gmp_w : in gmp_c.mpq_ptr.Item;
a_a_gmp_u : in gmp_c.mpq_srcptr.Item) renames
neg_v3;
pragma Import (C, neg_v3, "Ada_neg__SWIG_2");
pragma Import (C, a_a_gmpn_add, "Ada___gmpn_add");
pragma Import (C, a_a_gmpn_add_1, "Ada___gmpn_add_1");
pragma Import (C, a_a_gmpn_cmp, "Ada___gmpn_cmp");
pragma Import (C, a_a_gmpn_zero_p, "Ada___gmpn_zero_p");
pragma Import (C, a_a_gmpn_sub, "Ada___gmpn_sub");
pragma Import (C, a_a_gmpn_sub_1, "Ada___gmpn_sub_1");
pragma Import (C, a_a_gmpn_neg, "Ada___gmpn_neg");
end gmp_c.Binding;
|
programs/oeis/163/A163704.asm | jmorken/loda | 1 | 12112 | <gh_stars>1-10
; A163704: Number of n X 2 binary arrays with all 1s connected, a path of 1s from left column to lower right corner, and no 1 having more than two 1s adjacent.
; 1,5,11,21,38,66,112,187,309,507,828,1348,2190,3553,5759,9329,15106,24454,39580,64055,103657,167735,271416,439176,710618,1149821,1860467,3010317,4870814,7881162,12752008,20633203,33385245,54018483,87403764,141422284,228826086,370248409,599074535,969322985,1568397562,2537720590,4106118196,6643838831,10749957073,17393795951,28143753072,45537549072,73681302194,119218851317,192900153563,312119004933,505019158550,817138163538,1322157322144,2139295485739,3461452807941,5600748293739,9062201101740,14662949395540,23725150497342,38388099892945,62113250390351,100501350283361,162614600673778,263115950957206,425730551631052,688846502588327,1114577054219449,1803423556807847,2918000611027368,4721424167835288,7639424778862730
mov $1,$0
mov $7,$0
lpb $0
mov $4,$5
mov $6,$1
add $6,$2
add $2,4
trn $4,$0
sub $0,1
mov $1,$4
mov $3,5
add $6,2
add $5,$6
lpe
add $1,$3
trn $1,4
lpb $7
add $1,3
sub $7,1
lpe
add $1,1
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c47009a.ada | best08618/asylo | 7 | 1001 | -- C47009A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- WHEN THE TYPE MARK IN A QUALIFIED EXPRESSION DENOTES A
-- CONSTRAINED ACCESS TYPE, CHECK THAT CONSTRAINT_ERROR IS RAISED
-- WHEN THE VALUE OF THE OPERAND IS NOT NULL AND THE DESIGNATED
-- OBJECT HAS INDEX BOUNDS OR DISCRIMINANT VALUES THAT DO NOT EQUAL
-- THOSE SPECIFIED IN THE ACCESS TYPE'S CONSTRAINT.
-- HISTORY:
-- RJW 7/23/86
-- DWC 07/24/87 REVISED TO MAKE THE ACCESS TYPE UNCONSTRAINED
-- AND TO PREVENT DEAD VARIABLE OPTIMIZATION.
WITH REPORT; USE REPORT;
PROCEDURE C47009A IS
BEGIN
TEST( "C47009A", "WHEN THE TYPE MARK IN A QUALIFIED EXPRESSION " &
"DENOTES A CONSTRAINED ACCESS TYPE, CHECK " &
"THAT CONSTRAINT_ERROR IS RAISED WHEN THE " &
"VALUE OF THE OPERAND IS NOT NULL AND THE " &
"DESIGNATED OBJECT HAS INDEX BOUNDS OR " &
"DISCRIMINANT VALUES THAT DO NOT EQUAL THOSE " &
"SPECIFIED IN THE ACCESS TYPE'S CONSTRAINT" );
DECLARE
TYPE ARR IS ARRAY (NATURAL RANGE <>) OF INTEGER;
TYPE ACC1 IS ACCESS ARR;
SUBTYPE ACC1S IS ACC1 (IDENT_INT (1) .. IDENT_INT (5));
A : ACC1;
B : ARR (IDENT_INT (2) .. IDENT_INT (6));
BEGIN
A := ACC1S'(NEW ARR'(B'FIRST .. B'LAST => 0));
IF A'FIRST = 1 THEN
FAILED ( "NO EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC1 - 1" );
ELSE
FAILED ( "NO EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC1 - 2" );
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC1" );
END;
DECLARE
TYPE ARR IS ARRAY (NATURAL RANGE <>, NATURAL RANGE <>)
OF INTEGER;
TYPE ACC2 IS ACCESS ARR;
SUBTYPE ACC2S IS ACC2 (IDENT_INT (1) .. IDENT_INT (5),
IDENT_INT (1) .. IDENT_INT (1));
A : ACC2;
B : ARR (IDENT_INT (1) .. IDENT_INT (5),
IDENT_INT (2) .. IDENT_INT (2));
BEGIN
A := ACC2S'(NEW ARR'(B'RANGE => (B'RANGE (2) => 0)));
IF A'FIRST = 1 THEN
FAILED ( "NO EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC2 - 1" );
ELSE
FAILED ( "NO EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC2 - 2" );
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC2" );
END;
DECLARE
TYPE REC (D : INTEGER) IS
RECORD
NULL;
END RECORD;
TYPE ACC3 IS ACCESS REC;
SUBTYPE ACC3S IS ACC3 (IDENT_INT (3));
A : ACC3;
B : REC (IDENT_INT (5)) := (D => (IDENT_INT (5)));
BEGIN
A := ACC3S'(NEW REC'(B));
IF A = NULL THEN
FAILED ( "NO EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC3 - 1" );
ELSE
FAILED ( "NO EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC3 - 2" );
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC3" );
END;
DECLARE
TYPE REC (D1,D2 : INTEGER) IS
RECORD
NULL;
END RECORD;
TYPE ACC4 IS ACCESS REC;
SUBTYPE ACC4S IS ACC4 (IDENT_INT (4), IDENT_INT (5));
A : ACC4;
B : REC (IDENT_INT (5), IDENT_INT (4)) :=
(D1 => (IDENT_INT (5)), D2 => (IDENT_INT (4)));
BEGIN
A := ACC4S'(NEW REC'(B));
IF A = NULL THEN
FAILED ( "NO EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC4 - 1" );
ELSE
FAILED ( "NO EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC4 - 2" );
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION RAISED FOR DISC VALUES " &
"DIFFERENT FROM THOSE OF TYPE ACC4" );
END;
DECLARE
PACKAGE PKG IS
TYPE REC (D : INTEGER) IS PRIVATE;
B : CONSTANT REC;
PRIVATE
TYPE REC (D : INTEGER) IS
RECORD
NULL;
END RECORD;
B : CONSTANT REC := (D => (IDENT_INT (4)));
END PKG;
USE PKG;
TYPE ACC5 IS ACCESS REC;
SUBTYPE ACC5S IS ACC5 (IDENT_INT (3));
A : ACC5;
BEGIN
A := ACC5S'(NEW REC'(B));
IF A = NULL THEN
FAILED ( "NO EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC5 - 1" );
ELSE
FAILED ( "NO EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC5 - 2" );
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION RAISED FOR DISC VALUES " &
"DIFFERENT FROM THOSE OF TYPE ACC5" );
END;
DECLARE
PACKAGE PKG1 IS
TYPE REC (D : INTEGER) IS LIMITED PRIVATE;
TYPE ACC6 IS ACCESS REC;
SUBTYPE ACC6S IS ACC6 (IDENT_INT (6));
FUNCTION F RETURN ACC6;
PRIVATE
TYPE REC (D : INTEGER) IS
RECORD
NULL;
END RECORD;
END PKG1;
PACKAGE BODY PKG1 IS
FUNCTION F RETURN ACC6 IS
BEGIN
RETURN NEW REC'(D => IDENT_INT (5));
END F;
END PKG1;
PACKAGE PKG2 IS END PKG2;
PACKAGE BODY PKG2 IS
USE PKG1;
A : ACC6;
BEGIN
A := ACC6S'(F);
IF A = NULL THEN
FAILED ( "NO EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC6 - 1" );
ELSE
FAILED ( "NO EXCEPTION RAISED FOR INDEX BOUNDS " &
"DIFFERENT FROM THOSE OF TYPE ACC6 - 2" );
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ( "WRONG EXCEPTION RAISED FOR DISC " &
"VALUES DIFFERENT FROM THOSE OF TYPE " &
"ACC6" );
END PKG2;
BEGIN
NULL;
END;
RESULT;
END C47009A;
|
src/yaml-demo.adb | sparre/aYAML | 2 | 18300 | <filename>src/yaml-demo.adb<gh_stars>1-10
with YAML.Vector; pragma Unreferenced (YAML.Vector);
with YAML.Object; pragma Unreferenced (YAML.Object);
procedure YAML.Demo is
begin
null;
end YAML.Demo;
|
src/masks.asm | NotImplementedLife/rubik | 4 | 23040 | SECTION "Tile Masks Vars", WRAMX[$D000], ALIGN[8]
PaintTmp::
DS $B00
SECTION "Tile Masks Logic", ROM0
;-Func---------------------------------------------------------
ProcessPaintData:
;----------------------------------------------ProcessPaintData
; Arguments :
;--------------------------------------------------------------
; de = target tile
; hl = mask data
;--------------------------------------------------------------
xor a
.loop4
push af
ld a, [hli] ; load brush slot [1..27 | 0=inactive]
cp 0
jr z, .skipBrush
dec a
push hl
ld b, 0
ld c, a
ld hl, BshSlots
add hl, bc
ld a, [hl] ; get brush id [0..5]
swap a ; $0X --> $X0 [mul a, 16]
ld c, a
ld hl, Brush0
add hl, bc
ld b, h
ld c, l
pop hl
; At this point:
; - bc points to brush
; - de points to target tile (WRAM1)
; - hl points to tile mask
; Next step:
; target[i] |= Brush[i] & Mask[i] for 0<=i<16
push de
xor a
.paintLoop
push af
ld a, [hl] ; a = M
push hl
ld h, b
ld l, c
and [hl] ; a = M & B
inc bc
ld h, d
ld l, e
or [hl] ; a = T | (M & B)
ld [hl], a ; update Target[i]
inc de
pop hl
inc hl
pop af
inc a
cp a, 16
jr nz, .paintLoop ; end of tile paint
pop de ; preserve target address for next brush
; hl increased by 16 (next mask)
.skipBrush
pop af
inc a
cp 4
jr nz, .loop4
; Increase de by 16 (go to next target) :
ld a, e
add $10
ld e, a
ret nc
inc d
ret
;----------------------------------------------ProcessPaintData
;-Func---------------------------------------------------------
PaintTiles0::
;---------------------------------------------------PaintTiles0
; load cube 0 "blank" tiles into memory
ld hl, PaintTmp
ld de, Cube0Tiles
ld bc, $0B00
call loadMemory
ld de, PaintTmp
ld hl, TileMasks0
ld a, $A1
.loop
push af
call ProcessPaintData
pop af
dec a
cp 0
jr nz, .loop
ld de, PaintTmp
ld bc, PaintTmp + $0B00
ld hl, $8000
call loadMemorySTAT
;halt
ret
;---------------------------------------------------PaintTiles0
;-Func---------------------------------------------------------
PaintTiles1::
;---------------------------------------------------PaintTiles1
; load cube 1 "blank" tiles into memory
ld hl, PaintTmp
ld de, Cube1Tiles
ld bc, $0B00
call loadMemory
ld de, PaintTmp
ld hl, TileMasks1
ld a, $85
.loop
push af
call ProcessPaintData
pop af
dec a
cp 0
jr nz, .loop
ld de, PaintTmp
ld bc, PaintTmp + $0B00
ld hl, $8D00
call loadMemorySTAT
;halt
ret
;---------------------------------------------------PaintTiles1
|
programs/oeis/091/A091916.asm | neoneye/loda | 22 | 81845 | ; A091916: Maximum of odd products of partitions of n.
; 1,1,1,3,3,5,9,9,15,27,27,45,81,81,135,243,243,405,729,729,1215,2187,2187,3645,6561,6561,10935,19683,19683,32805,59049,59049,98415,177147,177147,295245,531441,531441,885735,1594323,1594323,2657205,4782969,4782969
mov $2,$0
mov $0,0
mul $2,2
add $0,$2
div $0,3
seq $0,83658 ; a(n) = a(n-1) + a(n-2) + gcd(a(n-1),a(n-2)) for n>1, with a(0)=1, a(1)=1.
|
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-valint.ads | djamal2727/Main-Bearing-Analytical-Model | 0 | 25200 | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . V A L _ I N T --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains routines for scanning signed Integer values for use
-- in Text_IO.Integer_IO, and the Value attribute.
package System.Val_Int is
pragma Preelaborate;
function Scan_Integer
(Str : String;
Ptr : not null access Integer;
Max : Integer) return Integer;
-- This function scans the string starting at Str (Ptr.all) for a valid
-- integer according to the syntax described in (RM 3.5(43)). The substring
-- scanned extends no further than Str (Max). There are three cases for the
-- return:
--
-- If a valid integer is found after scanning past any initial spaces, then
-- Ptr.all is updated past the last character of the integer (but trailing
-- spaces are not scanned out).
--
-- If no valid integer is found, then Ptr.all points either to an initial
-- non-digit character, or to Max + 1 if the field is all spaces and the
-- exception Constraint_Error is raised.
--
-- If a syntactically valid integer is scanned, but the value is out of
-- range, or, in the based case, the base value is out of range or there
-- is an out of range digit, then Ptr.all points past the integer, and
-- Constraint_Error is raised.
--
-- Note: these rules correspond to the requirements for leaving the pointer
-- positioned in Text_Io.Get
--
-- Note: if Str is null, i.e. if Max is less than Ptr, then this is a
-- special case of an all-blank string, and Ptr is unchanged, and hence
-- is greater than Max as required in this case.
function Value_Integer (Str : String) return Integer;
-- Used in computing X'Value (Str) where X is a signed integer type whose
-- base range does not exceed the base range of Integer. Str is the string
-- argument of the attribute. Constraint_Error is raised if the string is
-- malformed, or if the value is out of range.
end System.Val_Int;
|
Assembler/test/cohadar/assembler/constants/hex00.asm | cohadar/parapascal | 0 | 104776 | // test for hex constants
.CODE
//======================================
@main():
const 0x12345678
syscall %DEBUG
const 0xFEDCBA98
syscall %DEBUG
exit 0
|
Fields/FieldOfFractions/Setoid.agda | Smaug123/agdaproofs | 4 | 5986 | {-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Rings.Definition
open import Setoids.Setoids
open import Sets.EquivalenceRelations
open import Rings.IntegralDomains.Definition
open import Rings.IntegralDomains.Lemmas
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
module Fields.FieldOfFractions.Setoid {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_+_ : A → A → A} {_*_ : A → A → A} {R : Ring S _+_ _*_} (I : IntegralDomain R) where
record fieldOfFractionsSet : Set (a ⊔ b) where
field
num : A
denom : A
.denomNonzero : (Setoid._∼_ S denom (Ring.0R R) → False)
fieldOfFractionsSetoid : Setoid fieldOfFractionsSet
Setoid._∼_ fieldOfFractionsSetoid (record { num = a ; denom = b ; denomNonzero = b!=0 }) (record { num = c ; denom = d ; denomNonzero = d!=0 }) = Setoid._∼_ S (a * d) (b * c)
Equivalence.reflexive (Setoid.eq fieldOfFractionsSetoid) {record { num = a ; denom = b ; denomNonzero = b!=0 }} = Ring.*Commutative R
Equivalence.symmetric (Setoid.eq fieldOfFractionsSetoid) {record { num = a ; denom = b ; denomNonzero = b!=0 }} {record { num = c ; denom = d ; denomNonzero = d!=0 }} ad=bc = transitive (Ring.*Commutative R) (transitive (symmetric ad=bc) (Ring.*Commutative R))
where
open Equivalence (Setoid.eq S)
Equivalence.transitive (Setoid.eq fieldOfFractionsSetoid) {record { num = a ; denom = b ; denomNonzero = b!=0 }} {record { num = c ; denom = d ; denomNonzero = d!=0 }} {record { num = e ; denom = f ; denomNonzero = f!=0 }} ad=bc cf=de = p5
where
open Setoid S
open Ring R
open Equivalence eq
p : (a * d) * f ∼ (b * c) * f
p = Ring.*WellDefined R ad=bc reflexive
p2 : (a * f) * d ∼ b * (d * e)
p2 = transitive (transitive (symmetric *Associative) (transitive (*WellDefined reflexive *Commutative) *Associative)) (transitive p (transitive (symmetric *Associative) (*WellDefined reflexive cf=de)))
p3 : (a * f) * d ∼ (b * e) * d
p3 = transitive p2 (transitive (*WellDefined reflexive *Commutative) *Associative)
p4 : ((d ∼ 0R) → False) → ((a * f) ∼ (b * e))
p4 = cancelIntDom I (transitive *Commutative (transitive p3 *Commutative))
p5 : (a * f) ∼ (b * e)
p5 = p4 λ t → exFalso (d!=0 t)
|
libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sdcc_ix/tshc_visit_wc_attr_callee.asm | jpoikela/z88dk | 640 | 245145 | <filename>libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sdcc_ix/tshc_visit_wc_attr_callee.asm<gh_stars>100-1000
; void tshc_visit_wc_attr(struct r_Rect8 *r, void *function)
SECTION code_clib
SECTION code_arch
PUBLIC _tshc_visit_wc_attr_callee
PUBLIC l0_tshc_visit_wc_attr_callee
EXTERN asm_tshc_visit_wc_attr
_tshc_visit_wc_attr_callee:
pop af
pop bc
pop de
push af
l0_tshc_visit_wc_attr_callee:
push bc
ex (sp),ix
call asm_tshc_visit_wc_attr
pop ix
ret
|
test/asset/agda-stdlib-1.0/Data/List/Relation/Unary/First/Properties.agda | omega12345/agda-mode | 0 | 2643 | <filename>test/asset/agda-stdlib-1.0/Data/List/Relation/Unary/First/Properties.agda
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties of First
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.Relation.Unary.First.Properties where
open import Data.Empty
open import Data.Fin using (suc)
open import Data.List.Base as List using (List; []; _∷_)
open import Data.List.Relation.Unary.All as All using (All; []; _∷_)
open import Data.List.Relation.Unary.Any as Any using (here; there)
open import Data.List.Relation.Unary.First
import Data.Sum as Sum
open import Function
open import Relation.Binary.PropositionalEquality as P using (_≡_; refl; _≗_)
open import Relation.Unary
open import Relation.Nullary.Negation
------------------------------------------------------------------------
-- map
module _ {a b p q} {A : Set a} {B : Set b} {P : Pred B p} {Q : Pred B q} where
map⁺ : {f : A → B} → First (P ∘′ f) (Q ∘′ f) ⊆ First P Q ∘′ List.map f
map⁺ [ qfx ] = [ qfx ]
map⁺ (pfxs ∷ pqfxs) = pfxs ∷ map⁺ pqfxs
map⁻ : {f : A → B} → First P Q ∘′ List.map f ⊆ First (P ∘′ f) (Q ∘′ f)
map⁻ {f} {[]} ()
map⁻ {f} {x ∷ xs} [ qfx ] = [ qfx ]
map⁻ {f} {x ∷ xs} (pfx ∷ pqfxs) = pfx ∷ map⁻ pqfxs
------------------------------------------------------------------------
-- (++)
module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where
++⁺ : ∀ {xs ys} → All P xs → First P Q ys → First P Q (xs List.++ ys)
++⁺ [] pqys = pqys
++⁺ (px ∷ pxs) pqys = px ∷ ++⁺ pxs pqys
⁺++ : ∀ {xs} → First P Q xs → ∀ ys → First P Q (xs List.++ ys)
⁺++ [ qx ] ys = [ qx ]
⁺++ (px ∷ pqxs) ys = px ∷ ⁺++ pqxs ys
------------------------------------------------------------------------
-- Relationship to All
module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where
All⇒¬First : P ⊆ ∁ Q → All P ⊆ ∁ (First P Q)
All⇒¬First p⇒¬q [] ()
All⇒¬First p⇒¬q (px ∷ pxs) [ qx ] = ⊥-elim (p⇒¬q px qx)
All⇒¬First p⇒¬q (_ ∷ pxs) (_ ∷ hf) = All⇒¬First p⇒¬q pxs hf
First⇒¬All : Q ⊆ ∁ P → First P Q ⊆ ∁ (All P)
First⇒¬All q⇒¬p [ qx ] (px ∷ pxs) = q⇒¬p qx px
First⇒¬All q⇒¬p (_ ∷ pqxs) (_ ∷ pxs) = First⇒¬All q⇒¬p pqxs pxs
------------------------------------------------------------------------
-- Irrelevance
unique-index : ∀ {xs} → P ⊆ ∁ Q → (f₁ f₂ : First P Q xs) → index f₁ ≡ index f₂
unique-index p⇒¬q [ _ ] [ _ ] = refl
unique-index p⇒¬q [ qx ] (px ∷ _) = ⊥-elim (p⇒¬q px qx)
unique-index p⇒¬q (px ∷ _) [ qx ] = ⊥-elim (p⇒¬q px qx)
unique-index p⇒¬q (_ ∷ f₁) (_ ∷ f₂) = P.cong suc (unique-index p⇒¬q f₁ f₂)
irrelevant : P ⊆ ∁ Q → Irrelevant P → Irrelevant Q → Irrelevant (First P Q)
irrelevant p⇒¬q p-irr q-irr [ qx₁ ] [ qx₂ ] = P.cong [_] (q-irr qx₁ qx₂)
irrelevant p⇒¬q p-irr q-irr [ qx₁ ] (px₂ ∷ f₂) = ⊥-elim (p⇒¬q px₂ qx₁)
irrelevant p⇒¬q p-irr q-irr (px₁ ∷ f₁) [ qx₂ ] = ⊥-elim (p⇒¬q px₁ qx₂)
irrelevant p⇒¬q p-irr q-irr (px₁ ∷ f₁) (px₂ ∷ f₂) =
P.cong₂ _∷_ (p-irr px₁ px₂) (irrelevant p⇒¬q p-irr q-irr f₁ f₂)
------------------------------------------------------------------------
-- Decidability
module _ {a p} {A : Set a} {P : Pred A p} where
first? : Decidable P → Decidable (First P (∁ P))
first? P? xs = Sum.toDec
$ Sum.map₂ (All⇒¬First contradiction)
$ first (Sum.fromDec ∘ P?) xs
------------------------------------------------------------------------
-- Conversion to Any
module _ {a p} {A : Set a} {P : Pred A p} where
fromAny∘toAny≗id : ∀ {xs} → fromAny {Q = P} {x = xs} ∘′ toAny ≗ id
fromAny∘toAny≗id [ qx ] = refl
fromAny∘toAny≗id (px ∷ pqxs) = P.cong (_ ∷_) (fromAny∘toAny≗id pqxs)
toAny∘fromAny≗id : ∀ {xs} → toAny {Q = P} ∘′ fromAny {x = xs} ≗ id
toAny∘fromAny≗id (here px) = refl
toAny∘fromAny≗id (there v) = P.cong there (toAny∘fromAny≗id v)
------------------------------------------------------------------------
-- Equivalence between the inductive definition and the view
module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where
toView : ∀ {as} → First P Q as → FirstView P Q as
toView [ qx ] = [] ++ qx ∷ _
toView (px ∷ pqxs) with toView pqxs
... | pxs ++ qy ∷ ys = (px ∷ pxs) ++ qy ∷ ys
fromView : ∀ {as} → FirstView P Q as → First P Q as
fromView (pxs ++ qy ∷ ys) = ++⁺ pxs [ qy ]
|
oeis/093/A093103.asm | neoneye/loda-programs | 11 | 247871 | <filename>oeis/093/A093103.asm<gh_stars>10-100
; A093103: a(1)=1, a(2)=8, a(n+2) = 8*a(n+1) + 21*a(n).
; Submitted by <NAME>(s4)
; 1,8,85,848,8569,86360,870829,8780192,88528945,892615592,9000032581,90745188080,914962188841,9225346460408,93016977648925,937868096859968,9456301305507169,95345640478116680,961347451240583989
mov $1,1
lpb $0
sub $0,1
mov $2,$3
mul $2,21
mul $3,0
add $3,$1
mul $1,8
add $1,$2
lpe
mov $0,$1
|
oeis/113/A113301.asm | neoneye/loda-programs | 11 | 13617 | <gh_stars>10-100
; A113301: Sum of odd-indexed terms of tribonacci numbers.
; Submitted by <NAME>
; 0,1,5,18,62,211,715,2420,8188,27701,93713,317030,1072506,3628263,12274327,41523752,140473848,475219625,1607656477,5438662906,18398864822,62242913851,210566269283,712340586524,2409830942708,8152399683933,27579370581033,93300342369742,315632797374194,1067778105073359,3612267454964015,12220213267339600,41340685362056176,139854536808472145,473124509054812213,1600568749334964962,5414685293868179246,18317749139994314915,61968501463186088955,209637938823420761028,709200067073442686956
mul $0,2
mov $1,2
mov $2,1
lpb $0
sub $0,1
sub $2,2
add $2,$1
add $1,$3
sub $1,$2
add $3,1
add $3,$2
add $2,$1
lpe
mov $0,$2
div $0,2
|
libsrc/input/alphatro/in_Inkey.asm | jpoikela/z88dk | 640 | 81765 | <filename>libsrc/input/alphatro/in_Inkey.asm
; uint in_Inkey(void)
; 06.2018 suborb
; Read current state of keyboard but only return
; keypress if a single key is pressed.
SECTION code_clib
PUBLIC in_Inkey
PUBLIC _in_Inkey
EXTERN in_keytranstbl
; exit : carry set and HL = 0 for no keys registered
; else HL = ASCII character code
; uses : AF,BC,DE,HL
;
.in_Inkey
._in_Inkey
ld de,0
in a,($2b)
and @11111100
jr nz, gotkey
ld e,8
in a,($2a)
and @11111010
jr nz, gotkey
ld e,16
in a,($29)
and @00101111
jr nz, gotkey
ld e,24
in a,($28)
and @11111100
jr nz, gotkey
ld e,32
in a,($27)
and a
jr nz, gotkey
ld e,40
in a,($26)
and a
jr nz, gotkey
ld e,48
in a,($25)
and a
jr nz, gotkey
ld e,56
in a,($24)
and a
jr nz, gotkey
ld e,64
in a,($23)
and a
jr nz, gotkey
ld e,72
in a,($22)
and a
jr nz, gotkey
ld e,80
in a,($21)
and a
jr nz, gotkey
ld e,88
in a,($20)
and a
jr nz, gotkey
nokey:
ld hl,0
scf
ret
gotkey:
; a = key pressed
; e = offset
ld c,8
hitkey_loop:
rlca
jr c,doneinc
inc e
dec c
jr nz,hitkey_loop
doneinc:
; Check for shift and control
ld bc, 96 * 2
in a,($29)
bit 6,a ;Control
jr nz, got_modifier
ld bc, 96
in a,($2a)
bit 2,a ;shift key
jr nz,got_modifier
ld bc,0
got_modifier:
ld hl,in_keytranstbl
add hl,bc
add hl,de
ld a,(hl)
cp 255
jr z, nokey
ld l,a
ld h,0
and a
ret
|
oeis/021/A021941.asm | neoneye/loda-programs | 11 | 99003 | ; A021941: Decimal expansion of 1/937.
; Submitted by <NAME>(s4.)
; 0,0,1,0,6,7,2,3,5,8,5,9,1,2,4,8,6,6,5,9,5,5,1,7,6,0,9,3,9,1,6,7,5,5,6,0,2,9,8,8,2,6,0,4,0,5,5,4,9,6,2,6,4,6,7,4,4,9,3,0,6,2,9,6,6,9,1,5,6,8,8,3,6,7,1,2,9,1,3,5,5,3,8,9,5,4,1,0,8,8,5,8,0,5,7,6,3,0,7
add $0,1
mov $2,10
pow $2,$0
div $2,937
mov $0,$2
mod $0,10
|
macros/scripts/text.asm | AtmaBuster/pokeplat-gen2 | 6 | 167265 | <reponame>AtmaBuster/pokeplat-gen2
text EQUS "db TX_START," ; Start writing text.
next EQUS "db \"<NEXT>\"," ; Move a line down.
line EQUS "db \"<LINE>\"," ; Start writing at the bottom line.
page EQUS "db \"@\"," ; Start a new Pokédex page.
para EQUS "db \"<PARA>\"," ; Start a new paragraph.
cont EQUS "db \"<CONT>\"," ; Scroll to the next line.
done EQUS "db \"<DONE>\"" ; End a text box.
prompt EQUS "db \"<PROMPT>\"" ; Prompt the player to end a text box (initiating some other event).
; TextCommands indexes (see home/text.asm)
enum_start
enum TX_START ; $00
text_start: MACRO
db TX_START
ENDM
enum TX_RAM ; $01
text_ram: MACRO
db TX_RAM
dw \1
ENDM
enum TX_BCD ; $02
text_bcd: MACRO
db TX_BCD
dw \1
db \2
ENDM
enum TX_MOVE ; $03
text_move: MACRO
db TX_MOVE
dw \1
ENDM
enum TX_BOX ; $04
text_box: MACRO
db TX_BOX
dw \1
db \2, \3
ENDM
enum TX_LOW ; $05
text_low: MACRO
db TX_LOW
ENDM
enum TX_WAIT_BUTTON ; $06
text_waitbutton: MACRO
db TX_WAIT_BUTTON
ENDM
enum TX_SCROLL ; $07
text_scroll: MACRO
db TX_SCROLL
ENDM
enum TX_START_ASM ; $08
text_asm: MACRO
db TX_START_ASM
ENDM
enum TX_NUM ; $09
text_decimal: MACRO
db TX_NUM
dw \1 ; address
dn \2, \3 ; bytes, digits
ENDM
enum TX_PAUSE ; $0a
text_pause: MACRO
db TX_PAUSE
ENDM
enum TX_SOUND_DEX_FANFARE_50_79 ; $0b
sound_dex_fanfare_50_79: MACRO
db TX_SOUND_DEX_FANFARE_50_79
ENDM
enum TX_DOTS ; $0c
text_dots: MACRO
db TX_DOTS
db \1
ENDM
enum TX_LINK_WAIT_BUTTON ; $0d
text_linkwaitbutton: MACRO
db TX_LINK_WAIT_BUTTON
ENDM
enum TX_SOUND_DEX_FANFARE_20_49 ; $0e
sound_dex_fanfare_20_49: MACRO
db TX_SOUND_DEX_FANFARE_20_49
ENDM
enum TX_SOUND_ITEM ; $0f
sound_item: MACRO
db TX_SOUND_ITEM
ENDM
enum TX_SOUND_CAUGHT_MON ; $10
sound_caught_mon: MACRO
db TX_SOUND_CAUGHT_MON
ENDM
enum TX_SOUND_DEX_FANFARE_80_109 ; $11
sound_dex_fanfare_80_109: MACRO
db TX_SOUND_DEX_FANFARE_80_109
ENDM
enum TX_SOUND_FANFARE ; $12
sound_fanfare: MACRO
db TX_SOUND_FANFARE
ENDM
enum TX_SOUND_SLOT_MACHINE_START ; $13
sound_slot_machine_start: MACRO
db TX_SOUND_SLOT_MACHINE_START
ENDM
enum TX_STRINGBUFFER ; $14
text_buffer: MACRO
db TX_STRINGBUFFER
db \1
ENDM
enum TX_DAY ; $15
text_today: MACRO
db TX_DAY
ENDM
enum TX_FAR ; $16
text_far: MACRO
db TX_FAR
dw \1
db BANK(\1)
ENDM
enum TX_BIG ; $17
text_big: MACRO
db TX_BIG
db \1
ENDM
enum_set $50
enum TX_END ; $50
text_end: MACRO
db TX_END
ENDM
|
1A/S5/PIM/projet/src/foret.adb | MOUDDENEHamza/ENSEEIHT | 4 | 23831 | -------------------------------------------------------------------------------
-- Fichier : foret.adb
-- Auteur : <NAME> & <NAME>
-- Objectif : Implantation du module Foret
-- Crée : Jeudi Déc 12 2019
--------------------------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
package body Foret is
----------------------------------Constuctor--------------------------------
-- Initialiser Forest. Forest est vide.
procedure Initialize_Forest (F : out Forest) is
begin
Initialiser (F);
end Initialize_Forest;
-- Ajouter un Arbre dans la Forest.
procedure Add_To_Forest (F : in out Forest; Ab : in T_ABG) is
begin
Ajouter (F, Ab);
end Add_To_Forest;
----------------------------------------------------------------------------
-- Vérifier si une foret donnée est vide.
function Is_Empty_Forest (F : in Forest) return Boolean is
begin
return (Est_Vide (F));
end Is_Empty_Forest;
----------------------------------------------------------------------------
-- Vérifier si un arbre est dans la foret.
function Is_Present_Forest (F : in Forest; ID : Integer) return Boolean is
tmp : Forest;
begin
if (Is_Empty_Forest (F)) then
return False;
else
Tmp := F;
while (not (Is_Empty_Forest (Tmp))) loop
if (Get_ID (Get_Element (Tmp)) = ID) then
return True;
end if;
Tmp := Get_Next (Tmp);
end loop;
end if;
return False;
end Is_Present_Forest;
----------------------------------------------------------------------------
-- Trouver un ID dans la foret.
procedure Find_Tree (F : in Forest; Ab : out T_ABG; ID : in Integer) is
Tmp : Forest;
begin
if (Est_Vide (F)) then
raise ABSENT_TREE_EXCEPTION;
else
Tmp := F;
while (not (Est_Vide (Tmp))) loop
if (Get_ID (Get_Element (Tmp)) = ID) then
Ab := Get_Element (Tmp);
end if;
Tmp := Get_Next (Tmp);
end loop;
end if;
end Find_Tree;
----------------------------------------------------------------------------
-- Mettre à jour la foret.
procedure Update_Forest (F : in Forest; Old_Ab, New_Ab : in T_ABG) is
begin
Edit_Set (F, Old_Ab, New_Ab);
end Update_Forest;
----------------------------------------------------------------------------
-- Supprimer un arbre de la foret.
procedure Remove_Tree (F : in out Forest; Ab : in T_ABG) is
begin
Supprimer (F, Ab);
end Remove_Tree;
----------------------------------------------------------------------------
-- Ajouter un concubain à un individu donné.
procedure Get_Set_Cohabitant (F : in out Forest; ID, Child_ID : in Integer) is
Tmp : Forest;
begin
if (Is_Empty_Forest (F)) then
Null;
else
Tmp := F;
while (not (Is_Empty_Forest (Tmp))) loop
if (not (Is_Present_ID (Get_Element (F), Child_ID))) then
Tmp := Get_Next (Tmp);
elsif ((Is_Present_ID (Get_Element (F), Child_ID)) and get_Child_ID (Get_Element(F), get_ID (Get_Element(F))) /= Child_ID and
ID /= get_ID (Get_Element(F))) then
Put (Integer'Image (get_ID (Get_Element(F))) & " ");
Tmp := Get_Next (Tmp);
end if;
end loop;
end if;
end Get_Set_Cohabitant;
----------------------------------------------------------------------------
-- Obtenir l'ensemble des demis frères et demie-soeur d'un individu donné.
procedure Get_Set_Half_Brother (F : in Forest; ID, Father_ID, Mother_ID : in Integer) is
Tmp : Forest;
begin
if (Is_Empty_Forest (F)) then
Null;
else
Tmp := F;
while (not (Is_Empty_Forest (Tmp))) loop
if (not (Is_Present_ID (Get_Element (F), Father_ID)) and (not (Is_Present_ID (Get_Element (F), Mother_ID)))) then
Tmp := Get_Next (Tmp);
elsif ((Is_Present_ID (Get_Element (F), Father_ID)) and get_Child_ID (Get_Element(F), Father_ID) /= ID) then
Put (Integer'Image (get_Child_ID (Get_Element(F),Father_ID)) & " ");
Tmp := Get_Next (Tmp);
elsif ((Is_Present_ID (Get_Element (F), Mother_ID)) and get_Child_ID (Get_Element(F), Mother_ID) /= ID) then
Put (Integer'Image (get_Child_ID (Get_Element(F), Mother_ID)) & " ");
Tmp := Get_Next (Tmp);
end if;
end loop;
end if;
end Get_Set_Half_Brother;
----------------------------------------------------------------------------
-- Détruire Forest. Forest est vide.
procedure Destruct_Forest (F : in out Forest) is
begin
Detruire (F);
end Destruct_Forest;
end Foret;
|
source/uaflex/uaflex-generator-tables.ads | svn2github/matreshka | 24 | 19499 | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2017, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.Internals.Finite_Automatons;
with League.Strings;
package UAFLEX.Generator.Tables is
type State_Map is array
(Matreshka.Internals.Finite_Automatons.State range <>) of
Matreshka.Internals.Finite_Automatons.State;
-- Map from original states to remaped states
procedure Map_Final_Dead_Ends
(DFA : Matreshka.Internals.Finite_Automatons.DFA;
First_Dead_End : out Matreshka.Internals.Finite_Automatons.State;
First_Final : out Matreshka.Internals.Finite_Automatons.State;
Dead_End_Map : out State_Map);
-- Remap final states without any further edges to the end of state range
procedure Split_To_Distinct
(List : Matreshka.Internals.Finite_Automatons.Vectors.Vector;
Result : out Matreshka.Internals.Finite_Automatons.Vectors.Vector);
procedure Go
(DFA : Matreshka.Internals.Finite_Automatons.DFA;
Dead_End_Map : State_Map;
First_Dead_End : Matreshka.Internals.Finite_Automatons.State;
First_Final : Matreshka.Internals.Finite_Automatons.State;
Unit : League.Strings.Universal_String;
File : String;
Types : League.Strings.Universal_String;
Scanner : League.Strings.Universal_String;
Classes : Matreshka.Internals.Finite_Automatons.Vectors.Vector);
procedure Types
(DFA : Matreshka.Internals.Finite_Automatons.DFA;
Dead_End_Map : State_Map;
First_Dead_End : Matreshka.Internals.Finite_Automatons.State;
First_Final : Matreshka.Internals.Finite_Automatons.State;
Unit : League.Strings.Universal_String;
File : String;
Classes : Matreshka.Internals.Finite_Automatons.Vectors.Vector);
end UAFLEX.Generator.Tables;
|
oeis/237/A237450.asm | neoneye/loda-programs | 11 | 80196 | ; A237450: Triangle read by rows, T(n,k) = !n + (k-1)*(n-1)!, with n>=1, 1<=k<=n; Position of the first n-letter permutation beginning with number k in the list of lexicographically sorted permutations A030299.
; Submitted by <NAME>(s4)
; 1,2,3,4,6,8,10,16,22,28,34,58,82,106,130,154,274,394,514,634,754,874,1594,2314,3034,3754,4474,5194,5914,10954,15994,21034,26074,31114,36154,41194,46234,86554,126874,167194,207514,247834,288154,328474,368794,409114,771994,1134874,1497754,1860634,2223514,2586394,2949274,3312154,3675034,4037914,7666714,11295514,14924314,18553114,22181914,25810714,29439514,33068314,36697114,40325914,43954714,83871514,123788314,163705114,203621914,243538714,283455514,323372314,363289114,403205914,443122714,483039514
mov $3,$0
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
sub $0,$3
sub $0,1
mov $2,1
mov $4,1
lpb $0
sub $0,$4
trn $0,1
mul $2,$4
add $4,1
lpe
add $1,$2
lpe
mov $0,$1
add $0,1
|
Vlv2TbltDevicePkg/Library/CpuIA32Lib/X64/Cpu.asm | lvjianmin-loongson/uefi | 0 | 85674 | <reponame>lvjianmin-loongson/uefi<gh_stars>0
TITLE Cpu.asm: Assembly code for the x64 resources
;
; This file contains an 'Intel Sample Driver' and is
; licensed for Intel CPUs and chipsets under the terms of your
; license agreement with Intel or your vendor. This file may
; be modified by the user, subject to additional terms of the
; license agreement
;
;
; Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved
;
; This program and the accompanying materials are licensed and made available under
; the terms and conditions of the BSD License that accompanies this distribution.
; The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
;
;
;
;
;* Module Name:
;*
;* Cpu.asm
;*
;* Abstract:
;*
;------------------------------------------------------------------------------
text SEGMENT
;------------------------------------------------------------------------------
; VOID
; EfiHalt (
; VOID
; )
;------------------------------------------------------------------------------
EfiHalt PROC PUBLIC
hlt
ret
EfiHalt ENDP
;------------------------------------------------------------------------------
; VOID
; EfiWbinvd (
; VOID
; )
;------------------------------------------------------------------------------
EfiWbinvd PROC PUBLIC
wbinvd
ret
EfiWbinvd ENDP
;------------------------------------------------------------------------------
; VOID
; EfiInvd (
; VOID
; )
;------------------------------------------------------------------------------
EfiInvd PROC PUBLIC
invd
ret
EfiInvd ENDP
;------------------------------------------------------------------------------
; VOID
; EfiCpuid (
; IN UINT32 RegisterInEax, // rcx
; OUT EFI_CPUID_REGISTER *Reg OPTIONAL // rdx
; )
;------------------------------------------------------------------------------
EfiCpuid PROC PUBLIC
push rbx
mov r8, rdx ; r8 = *Reg
mov rax, rcx ; RegisterInEax
cpuid
cmp r8, 0
je _Exit
mov [r8 + 0], eax ; Reg->RegEax
mov [r8 + 4], ebx ; Reg->RegEbx
mov [r8 + 8], ecx ; Reg->RegEcx
mov [r8 + 12], edx ; Reg->RegEdx
_Exit:
pop rbx
ret
EfiCpuid ENDP
;------------------------------------------------------------------------------
; UINT64
; EfiReadMsr (
; IN UINT32 Index, // rcx
; )
;------------------------------------------------------------------------------
EfiReadMsr PROC PUBLIC
rdmsr
sal rdx, 32 ; edx:eax -> rax
or rax, rdx ; rax = edx:eax
ret
EfiReadMsr ENDP
;------------------------------------------------------------------------------
; VOID
; EfiWriteMsr (
; IN UINT32 Index, // rcx
; IN UINT64 Value // rdx
; )
;------------------------------------------------------------------------------
EfiWriteMsr PROC PUBLIC
mov rax, rdx ; rdx = Value
sar rdx, 32 ; convert rdx to edx upper 32-bits
wrmsr ; wrmsr[ecx] result = edx:eax
ret
EfiWriteMsr ENDP
;------------------------------------------------------------------------------
; UINT64
; EfiReadTsc (
; VOID
; );
;------------------------------------------------------------------------------
EfiReadTsc PROC PUBLIC
rdtsc
shl rax, 32
shrd rax, rdx, 32
ret
EfiReadTsc ENDP
;------------------------------------------------------------------------------
; VOID
; EfiDisableCache (
; VOID
; );
;------------------------------------------------------------------------------
EfiDisableCache PROC PUBLIC
; added a check to see if cache is already disabled. If it is, then skip.
mov rax, cr0
and rax, 060000000h
cmp rax, 0
jne @f
mov rax, cr0
or rax, 060000000h
mov cr0, rax
wbinvd
@@:
ret
EfiDisableCache ENDP
;------------------------------------------------------------------------------
; VOID
; EfiEnableCache (
; VOID
; );
;------------------------------------------------------------------------------
EfiEnableCache PROC PUBLIC
wbinvd
mov rax, cr0
and rax, 09fffffffh
mov cr0, rax
ret
EfiEnableCache ENDP
;------------------------------------------------------------------------------
; UINTN
; EfiGetEflags (
; VOID
; );
;------------------------------------------------------------------------------
EfiGetEflags PROC PUBLIC
pushfq
pop rax
ret
EfiGetEflags ENDP
;------------------------------------------------------------------------------
; VOID
; EfiDisableInterrupts (
; VOID
; );
;------------------------------------------------------------------------------
EfiDisableInterrupts PROC PUBLIC
cli
ret
EfiDisableInterrupts ENDP
;------------------------------------------------------------------------------
; VOID
; EfiEnableInterrupts (
; VOID
; );
;------------------------------------------------------------------------------
EfiEnableInterrupts PROC PUBLIC
sti
ret
EfiEnableInterrupts ENDP
;------------------------------------------------------------------------------
; VOID
; EfiCpuidExt (
; IN UINT32 RegisterInEax,
; IN UINT32 CacheLevel,
; OUT EFI_CPUID_REGISTER *Regs
; )
;------------------------------------------------------------------------------
EfiCpuidExt PROC PUBLIC
push rbx
mov rax, rcx ; rax = RegisterInEax
mov rcx, rdx ; rcx = CacheLevel
cpuid
mov [r8 + 0 ], eax ; Reg->RegEax
mov [r8 + 4 ], ebx ; Reg->RegEbx
mov [r8 + 8 ], ecx ; Reg->RegEcx
mov [r8 + 12], edx ; Reg->RegEdx
pop rbx
ret
EfiCpuidExt ENDP
END
|
alloy4fun_models/trashltl/models/11/QquBpcutGB87jEtfJ.als | Kaixi26/org.alloytools.alloy | 0 | 1797 | open main
pred idQquBpcutGB87jEtfJ_prop12 {
some f : File | eventually f in Trash => always f in Trash
}
pred __repair { idQquBpcutGB87jEtfJ_prop12 }
check __repair { idQquBpcutGB87jEtfJ_prop12 <=> prop12o } |
Library/GrObj/Pointer/pointerZoom.asm | steakknife/pcgeos | 504 | 172473 | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1992 -- All Rights Reserved
PROJECT: GrObj
MODULE: Pointer
FILE: zoom.asm
AUTHOR: <NAME>, Sep 15, 1992
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Steve 9/15/92 Initial revision
DESCRIPTION:
$Id: pointerZoom.asm,v 1.1 97/04/04 18:08:40 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjClassStructures segment resource
;Define the class record
ZoomPointerClass
GrObjClassStructures ends
GrObjRequiredExtInteractive2Code segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ZoomActivateCreate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Puts pointer in it's standard mode for zooming
PASS:
*(ds:si) - instance data
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of ZoomClass
cl - ActivateCreateFlags
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 1/31/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ZoomActivateCreate method dynamic ZoomPointerClass, MSG_GO_ACTIVATE_CREATE
uses cx,dx,bp
.enter
clr ds:[di].GOI_actionModes
; If ACF_NOTIFY set then send method to all objects on
; the selection list notifying them of activation.
;
test cl, mask ACF_NOTIFY
jz done
mov ax,MSG_GO_SEND_ANOTHER_TOOL_ACTIVATED
call ObjCallInstanceNoLock
done:
.leave
ret
ZoomActivateCreate endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ZoomStartSelect
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Handle start select
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of ZoomClass
ss:bp - GrObjMouseData
RETURN:
ax - MouseReturnFlags
if MRF_SET_POINTER_IMAGE
cx:dx - optr of pointer image
else
cx,dx - DESTROYED
DESTROYED:
see RETURN
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/21/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ZoomStartSelect method dynamic ZoomPointerClass, MSG_GO_LARGE_START_SELECT
.enter
mov ax,MSG_GB_ZOOM_OUT_ABOUT_POINT
test ss:[bp].GOMD_goFA, mask GOFA_CONSTRAIN
jnz sendToBody
mov ax,MSG_GB_ZOOM_IN_ABOUT_POINT
sendToBody:
mov dx,size PointDWFixed
mov di,mask MF_STACK or mask MF_FIXUP_DS
call GrObjMessageToBody
mov ax,mask MRF_PROCESSED
.leave
ret
ZoomStartSelect endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ZoomGetPointerImage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Return OD of pointer image
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of ZoomClass
ss:bp - PointDWFixed
RETURN:
ax -MRF_SET_POINTER_IMAGE
cx:dx - od of pointer image
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 5/15/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ZoomGetPointerImage method dynamic ZoomPointerClass, MSG_GO_GET_POINTER_IMAGE
.enter
mov ax,mask MRF_SET_POINTER_IMAGE
mov cx,handle ptrZoom
mov dx,offset ptrZoom
.leave
ret
ZoomGetPointerImage endm
GrObjRequiredExtInteractive2Code ends
|
notes/papers/implicit/examples/Simple.agda | cruhland/agda | 1,989 | 5170 |
module Simple where
postulate
Nat : Set
zero : Nat
-- we want
-- ?0 zero = zero
-- and then
-- ?0 x = x
|
Sources/Ya just played yourself.scpt | ckd/music-scripts | 0 | 4328 | -- Ya just played yourself
-- Dumb script to increment play count of selected track by one and update the last played date.
tell application "Music"
set sel to selection of front browser window
if sel is {} then
display dialog "Nothing is selected." buttons {"Quit"} with icon 0
return
end if
repeat with i from 1 to (count of sel)
set thisTrack to item i of sel
set currentPlayCount to played count of thisTrack
set played date of thisTrack to (current date)
set played count of thisTrack to (currentPlayCount + 1)
end repeat
end tell
|
bb-runtimes/arm/nordic/nrf52/nrf52840/setup_board.adb | JCGobbi/Nucleo-STM32G474RE | 0 | 22001 | <gh_stars>0
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- Copyright (C) 2012-2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This file is based on the startup code from the following file in Nordic's
-- nRF5 SDK (version 15.1.0): modules/nrfx/mdk/system_nrf52840.c for errata
-- workarounds and configuration of the SWD pins and reset pin.
--
-- This Errata_X functions detect if certain errata are applicable for the
-- MCU. If they are applicable, then a workaround is applied for the errata.
-- Some of these errata workarounds rely on reading and/or writing registers
-- that are not documented in the datasheet. As mentioned above, these
-- register addresses and values are copied from Nordic's nRF5 SDK.
pragma Ada_2012; -- To work around pre-commit check?
pragma Suppress (All_Checks);
with System;
with System.Machine_Code; use System.Machine_Code;
with Interfaces.NRF52; use Interfaces.NRF52;
with Interfaces.NRF52.CCM; use Interfaces.NRF52.CCM;
with Interfaces.NRF52.CLOCK; use Interfaces.NRF52.CLOCK;
with Interfaces.NRF52.FICR; use Interfaces.NRF52.FICR;
with Interfaces.NRF52.GPIO; use Interfaces.NRF52.GPIO;
with Interfaces.NRF52.NVMC; use Interfaces.NRF52.NVMC;
with Interfaces.NRF52.UICR; use Interfaces.NRF52.UICR;
with Interfaces.NRF52.TEMP; use Interfaces.NRF52.TEMP;
procedure Setup_Board is
---------------------------
-- Board Configuration --
---------------------------
Use_HFXO : constant Boolean := False;
-- Set to True to use the high-frequency external oscillator (HFXO).
-- When False, the on-chip oscillator is used.
-- The HFXO can also be turned on and off later by the main program.
LFCLK_Source : constant LFCLKSRC_SRC_Field := Xtal;
-- Selects the source for the LFCLK.
-- Xtal selects the external 32.768 kHz crystal (LFXO).
-- Rc selects the internal 32.768 kHz RC oscillator.
-- Synth selects the LFCLK synthesized from the 16 MHz HFCLK.
Use_SWO_Trace : constant Boolean := True;
-- Set to True to enable the SWO trace pins.
Use_Reset_Pin : constant Boolean := True;
-- When True, P0.18 will be configured as the reset pin.
LFRC_Used : constant Boolean := LFCLK_Source = Rc;
-- When the LFRC oscillator is not used it is put into ultra-low power mode
--------------------------
-- Errata Workarounds --
--------------------------
-- Some of these registers are not documented in the Objective Product Spec
-- but they are used in the nRF5 SDK startup code to detect when
-- certain errata are applicable.
Undocumented_Reg_1 : UInt32
with Address => System'To_Address (16#1000_0130#);
Undocumented_Reg_2 : UInt32
with Address => System'To_Address (16#1000_0134#);
-- Undocumented Registers used for the workaround of Erratas 98, 115, 120.
Errata_98_Reg : UInt32
with Volatile, Address => System'To_Address (16#4000_568C#);
Errata_115_Reg_1 : UInt32
with Volatile, Address => System'To_Address (16#4000_0EE4#);
Errata_115_Reg_2 : UInt32
with Volatile, Address => System'To_Address (16#1000_0258#);
Errata_120_Reg : UInt32
with Volatile, Address => System'To_Address (16#4002_9640#);
-- The POWER.RESETREAS register.
-- We define this here instead of including Interfaces.POWER as a
-- workaround for a warning about unused bits in the definition
-- of RAM_Cluster in the auto-generated code.
POWER_RESETREAS : UInt32
with Volatile, Address => System'To_Address (16#4000_0400#);
-- The following functions detect if different errata are applicable on
-- the specific MCU revision. For example, Errata_36 checks if a errata #36
-- is applicable ("CLOCK: Some registers are not reset when expected").
function Errata_36 return Boolean is
(Undocumented_Reg_1 = 8 and Undocumented_Reg_2 = 0)
with Inline_Always;
function Errata_66 return Boolean is
(Undocumented_Reg_1 = 8 and Undocumented_Reg_2 = 0)
with Inline_Always;
function Errata_98 return Boolean is
(Undocumented_Reg_1 = 8 and Undocumented_Reg_2 = 0)
with Inline_Always;
function Errata_103 return Boolean is
(Undocumented_Reg_1 = 8 and Undocumented_Reg_2 = 0)
with Inline_Always;
function Errata_115 return Boolean is
(Undocumented_Reg_1 = 8 and Undocumented_Reg_2 = 0)
with Inline_Always;
function Errata_120 return Boolean is
(Undocumented_Reg_1 = 8 and Undocumented_Reg_2 = 0)
with Inline_Always;
function Errata_136 return Boolean is
(Undocumented_Reg_1 = 8 and Undocumented_Reg_2 = 0)
with Inline_Always;
procedure NVIC_SystemReset;
procedure NVIC_SystemReset is
SCB_AIRCR : UInt32
with Volatile, Address => System'To_Address (16#E000_ED0C#);
VECTKEY : constant UInt32 := 16#05FA_0000#;
PRIGROUP_Mask : constant UInt32 := 16#0000_0700#;
SYSRESETREQ : constant UInt32 := 16#0000_0004#;
begin
-- Ensure all outstanding memory accesses including buffered write
-- are completed before reset
Asm ("dsb", Volatile => True);
SCB_AIRCR := VECTKEY or (SCB_AIRCR and PRIGROUP_Mask) or SYSRESETREQ;
Asm ("dsb", Volatile => True);
loop
null;
end loop;
end NVIC_SystemReset;
begin
-- Enable SWO trace pins
if Use_SWO_Trace then
CLOCK_Periph.TRACECONFIG.TRACEMUX := Serial;
P1_Periph.PIN_CNF (0) := PIN_CNF_Register'
(DIR => Output,
INPUT => Connect,
PULL => Disabled,
Reserved_4_7 => 0,
DRIVE => H0H1,
Reserved_11_15 => 0,
SENSE => Disabled,
Reserved_18_31 => 0);
end if;
-- Workaround for Errata 36 "CLOCK: Some registers are not reset when
-- expected".
if Errata_36 then
CLOCK_Periph.EVENTS_DONE := (EVENTS_DONE => 0, others => <>);
CLOCK_Periph.EVENTS_CTTO := (EVENTS_CTTO => 0, others => <>);
CLOCK_Periph.CTIV.CTIV := 0;
end if;
-- Workaround for Errata 66 "TEMP: Linearity specification not met with
-- default settings"
if Errata_66 then
TEMP_Periph.A0.A0 := FICR_Periph.TEMP.A0.A;
TEMP_Periph.A1.A1 := FICR_Periph.TEMP.A1.A;
TEMP_Periph.A2.A2 := FICR_Periph.TEMP.A2.A;
TEMP_Periph.A3.A3 := FICR_Periph.TEMP.A3.A;
TEMP_Periph.A4.A4 := FICR_Periph.TEMP.A4.A;
TEMP_Periph.A5.A5 := FICR_Periph.TEMP.A5.A;
TEMP_Periph.B0.B0 := FICR_Periph.TEMP.B0.B;
TEMP_Periph.B1.B1 := FICR_Periph.TEMP.B1.B;
TEMP_Periph.B2.B2 := FICR_Periph.TEMP.B2.B;
TEMP_Periph.B3.B3 := FICR_Periph.TEMP.B3.B;
TEMP_Periph.B4.B4 := FICR_Periph.TEMP.B4.B;
TEMP_Periph.B5.B5 := FICR_Periph.TEMP.B5.B;
TEMP_Periph.T0.T0 := FICR_Periph.TEMP.T0.T;
TEMP_Periph.T1.T1 := FICR_Periph.TEMP.T1.T;
TEMP_Periph.T2.T2 := FICR_Periph.TEMP.T2.T;
TEMP_Periph.T3.T3 := FICR_Periph.TEMP.T3.T;
TEMP_Periph.T4.T4 := FICR_Periph.TEMP.T4.T;
end if;
-- Workaround for Errata 98 "NFCT: Not able to communicate with the peer"
if Errata_98 then
Errata_98_Reg := 16#0003_8148#;
end if;
-- Workaround for Errata 103 "CCM: Wrong reset value of CCM MAXPACKETSIZE"
if Errata_103 then
CCM_Periph.MAXPACKETSIZE.MAXPACKETSIZE := 16#FB#;
end if;
-- Workaround for Errata 115 "RAM: RAM content cannot be trusted upon
-- waking up from System ON Idle or System OFF mode"
if Errata_115 then
Errata_115_Reg_1 := ((Errata_115_Reg_1 and 16#FFFF_FFF0#)
or (Errata_115_Reg_2 and 16#0000_000F#));
end if;
-- Workaround for Errata 120 "QSPI: Data read or written is corrupted"
if Errata_120 then
Errata_120_Reg := 16#200#;
end if;
-- Workaround for Errata 136 "System: Bits in RESETREAS are set when they
-- should not be"
if Errata_136 then
-- Clear all flags except RESETPIN if RESETPIN is the reset reason
if (POWER_RESETREAS and 16#0000_0001#) /= 0 then
POWER_RESETREAS := 16#FFFF_FFFE#;
end if;
end if;
if Use_Reset_Pin then
-- Enable nRESET pin on P0.18
if UICR_Periph.PSELRESET (0).CONNECT = Disconnected or
UICR_Periph.PSELRESET (1).CONNECT = Disconnected
then
NVMC_Periph.CONFIG := CONFIG_Register'
(WEN => Wen,
Reserved_2_31 => 0);
loop
exit when NVMC_Periph.READY.READY = Ready;
end loop;
UICR_Periph.PSELRESET (0) := PSELRESET_Register'
(PIN => 18,
PORT => 0,
Reserved_6_30 => 0,
CONNECT => Connected);
loop
exit when NVMC_Periph.READY.READY = Ready;
end loop;
UICR_Periph.PSELRESET (1) := PSELRESET_Register'
(PIN => 18,
PORT => 0,
Reserved_6_30 => 0,
CONNECT => Connected);
loop
exit when NVMC_Periph.READY.READY = Ready;
end loop;
NVMC_Periph.CONFIG := CONFIG_Register'
(WEN => Ren,
Reserved_2_31 => 0);
loop
exit when NVMC_Periph.READY.READY = Ready;
end loop;
NVIC_SystemReset;
end if;
end if;
-- Configure the 32.768 kHz external crystal.
-- The LFCLK will be started later, if required by the runtime.
--
-- The Ravenscar runtime uses LFCLK as its timing source for task delays,
-- so LFCLK will be started by System.BB.Board_Support.Initialize_Board.
--
-- The ZFP runtime does not use LFCLK, so it is not started in ZFP.
CLOCK_Periph.LFCLKSRC := LFCLKSRC_Register'
(SRC => LFCLK_Source,
Reserved_2_15 => 0,
BYPASS => Disabled,
EXTERNAL => Disabled,
Reserved_18_31 => 0);
-- If the internal RC oscillator is not used as the LFCLK source, then
-- put it into ultra-low power (ULP) mode to save some power.
if not LFRC_Used then
CLOCK_Periph.LFRCMODE.MODE := Ulp;
end if;
-- Optionally enable the external HFXO.
-- If HFXO is disabled, then the HFCLK will use the internal HF oscillator
if Use_HFXO then
CLOCK_Periph.TASKS_HFCLKSTART := (TASKS_HFCLKSTART => 1,
others => <>);
end if;
end Setup_Board;
|
src/ewok-mpu-handler.adb | PThierry/ewok-kernel | 0 | 12498 | --
-- Copyright 2018 The wookey project team <<EMAIL>>
-- - <NAME>
-- - <NAME>
-- - <NAME>
-- - <NAME>
-- - <NAME>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
with ada.unchecked_conversion;
with ewok.tasks; use ewok.tasks;
with ewok.tasks.debug;
with ewok.tasks_shared; use ewok.tasks_shared;
with ewok.devices_shared; use ewok.devices_shared;
with ewok.sched;
with ewok.debug;
with ewok.interrupts;
with soc.interrupts;
with m4.scb;
package body ewok.mpu.handler
with spark_mode => off
is
function memory_fault_handler
(frame_a : t_stack_frame_access)
return t_stack_frame_access
is
#if not CONFIG_KERNEL_PANIC_FREEZE
new_frame_a : t_stack_frame_access
#end if;
begin
if m4.scb.SCB.CFSR.MMFSR.MMARVALID then
pragma DEBUG (debug.log (debug.ERROR,
"MPU: MMFAR.ADDRESS = " &
system_address'image (m4.scb.SCB.MMFAR.ADDRESS)));
end if;
if m4.scb.SCB.CFSR.MMFSR.MLSPERR then
pragma DEBUG (debug.log (debug.ERROR,
"MPU: MemManage fault during floating-point lazy state preservation"));
end if;
if m4.scb.SCB.CFSR.MMFSR.MSTKERR then
pragma DEBUG (debug.log (debug.ERROR,
"MPU: stacking for an exception entry has caused access violation"));
end if;
if m4.scb.SCB.CFSR.MMFSR.MUNSTKERR then
pragma DEBUG (debug.log (debug.ERROR,
"MPU: unstack for an exception return has caused access violation"));
end if;
if m4.scb.SCB.CFSR.MMFSR.DACCVIOL then
pragma DEBUG (debug.log (debug.ERROR,
"MPU: the processor attempted a load or store at a location that does not permit the operation"));
end if;
if m4.scb.SCB.CFSR.MMFSR.IACCVIOL then
pragma DEBUG (debug.log (debug.ERROR,
"MPU: the processor attempted an instruction fetch from a location that does not permit execution"));
end if;
pragma DEBUG (ewok.tasks.debug.crashdump (frame_a));
-- On memory fault, the task is not scheduled anymore
ewok.tasks.set_state
(ewok.sched.get_current, TASK_MODE_MAINTHREAD, ewok.tasks.TASK_STATE_FAULT);
#if CONFIG_KERNEL_PANIC_FREEZE
debug.panic ("Memory fault!");
return frame_a;
#else
new_frame_a := ewok.sched.do_schedule (frame_a);
return new_frame_a;
#end if;
end memory_fault_handler;
procedure init
is
ok : boolean;
begin
ewok.interrupts.set_task_switching_handler
(soc.interrupts.INT_MEMMANAGE,
memory_fault_handler'access,
ID_KERNEL,
ID_DEV_UNUSED,
ok);
if not ok then raise program_error; end if;
end init;
end ewok.mpu.handler;
|
Lista Assembly/questao3.asm | joaovictor42/Arquitetura-de-Computadores | 0 | 4889 | <filename>Lista Assembly/questao3.asm
extern scanf, printf
global main
section .bss
varA resd 1
varB resd 1
section .data
msgEntrada1 db "Digite o primeiro valor:", 0H
msgEntrada2 db "Digite o segundo valor:", 0H
msgSaida db "O maior valor eh: %d", 0AH, 0H
formatoEntrada db "%d", 0H
section .text
main:
push msgEntrada1
call printf
add esp, 4
push varA
push formatoEntrada
call scanf
add esp, 8
push msgEntrada2
call printf
add esp, 4
push varB
push formatoEntrada
call scanf
add esp, 8
mov eax, [varA]
cmp eax, [varB]
jl maiorEhB
jmp saida
maiorEhB:
mov eax, [varB]
saida:
push eax
push msgSaida
call printf
add esp, 8
mov eax, 1
xor ebx, ebx
int 80h
|
list_package.adb | ddugovic/words | 4 | 25288 | <filename>list_package.adb
with CONFIG; use CONFIG;
with STRINGS_PACKAGE; use STRINGS_PACKAGE;
with LATIN_FILE_NAMES; use LATIN_FILE_NAMES;
with WORD_PARAMETERS; use WORD_PARAMETERS;
with INFLECTIONS_PACKAGE; use INFLECTIONS_PACKAGE;
with DICTIONARY_PACKAGE; use DICTIONARY_PACKAGE;
with ADDONS_PACKAGE; use ADDONS_PACKAGE;
with UNIQUES_PACKAGE; use UNIQUES_PACKAGE;
with WORD_SUPPORT_PACKAGE; use WORD_SUPPORT_PACKAGE;
with DEVELOPER_PARAMETERS; use DEVELOPER_PARAMETERS;
with WORD_PACKAGE; use WORD_PACKAGE;
with DICTIONARY_FORM;
with PUT_EXAMPLE_LINE;
with LIST_SWEEP;
with PUT_STAT;
package body LIST_PACKAGE is
package BOOLEAN_IO is new TEXT_IO.ENUMERATION_IO(BOOLEAN);
subtype XONS is PART_OF_SPEECH_TYPE range TACKON..SUFFIX;
type DICTIONARY_MNPC_RECORD is record
D_K : DICTIONARY_KIND := DEFAULT_DICTIONARY_KIND;
MNPC : MNPC_TYPE := NULL_MNPC;
DE : DICTIONARY_ENTRY := NULL_DICTIONARY_ENTRY;
end record;
NULL_DICTIONARY_MNPC_RECORD : DICTIONARY_MNPC_RECORD
:= (X, NULL_MNPC, NULL_DICTIONARY_ENTRY);
MAX_MEANING_PRINT_SIZE : constant := 79;
MM : INTEGER := MAX_MEANING_SIZE;
I, J, K : INTEGER := 0;
INFLECTION_FREQUENCY : array (FREQUENCY_TYPE) of STRING(1..8) :=
(" ", -- X
"mostfreq", -- A
"sometime", -- B
"uncommon", -- C
"infreq ", -- D
"rare ", -- E
"veryrare", -- F
"inscript", -- I
" ", -- Not used
" " );
INFLECTION_AGE : array (AGE_TYPE) of STRING(1..8) :=
("Always ", -- X
"Archaic ", -- A
"Early ", -- B
"Classic ", -- C
"Late ", -- D
"Later ", -- E
"Medieval", -- F
"Scholar ", -- G
"Modern " ); -- H
DICTIONARY_FREQUENCY : array (FREQUENCY_TYPE) of STRING(1..8) :=
(" ", -- X
"veryfreq", -- A
"frequent", -- B
"common ", -- C
"lesser ", -- D
"uncommon", -- E
"veryrare", -- F
"inscript", -- I
"graffiti", -- J
"Pliny " );-- N
DICTIONARY_AGE : array (AGE_TYPE) of STRING(1..8) :=
(" ", -- X
"Archaic ", -- A
"Early ", -- B
"Classic ", -- C
"Late ", -- D
"Later ", -- E
"Medieval", -- F
"NeoLatin", -- G
"Modern " ); -- H
function CAP_STEM(S : STRING) return STRING is
begin
if ALL_CAPS then
return UPPER_CASE(S);
elsif CAPITALIZED then
return UPPER_CASE(S(S'FIRST)) & S(S'FIRST+1..S'LAST);
else
return S;
end if;
end CAP_STEM;
function CAP_ENDING(S : STRING) return STRING is
begin
if ALL_CAPS then
return UPPER_CASE(S);
else
return S;
end if;
end CAP_ENDING;
procedure PUT_DICTIONARY_FLAGS(OUTPUT : TEXT_IO.FILE_TYPE;
DE : DICTIONARY_ENTRY;
HIT : out BOOLEAN) is
begin
if WORDS_MODE(SHOW_AGE) or
(TRIM(DICTIONARY_AGE(DE.TRAN.AGE))'LENGTH /= 0) then -- Not X
TEXT_IO.PUT(OUTPUT, " " & TRIM(DICTIONARY_AGE(DE.TRAN.AGE)));
HIT := TRUE;
end if;
if (WORDS_MODE(SHOW_FREQUENCY) or
(DE.TRAN.FREQ >= D)) and
(TRIM(DICTIONARY_FREQUENCY(DE.TRAN.FREQ))'LENGTH /= 0) then
TEXT_IO.PUT(OUTPUT, " " & TRIM(DICTIONARY_FREQUENCY(DE.TRAN.FREQ)));
HIT := TRUE;
end if;
end PUT_DICTIONARY_FLAGS;
procedure PUT_DICTIONARY_FORM(OUTPUT : TEXT_IO.FILE_TYPE;
D_K : DICTIONARY_KIND;
MNPC : DICT_IO.COUNT;
DE : DICTIONARY_ENTRY) is
CHIT, DHIT, EHIT, FHIT, LHIT : BOOLEAN := FALSE; -- Things on this line?
DICTIONARY_LINE_NUMBER : INTEGER := INTEGER(MNPC);
--DE : DICTIONARY_ENTRY := DM.DE;
begin -- PUT_DICTIONARY_FORM
if WORDS_MODE(DO_DICTIONARY_FORMS) then
if WORDS_MDEV(DO_PEARSE_CODES) then
TEXT_IO.PUT(OUTPUT, "02 ");
DHIT := TRUE;
end if;
if DICTIONARY_FORM(DE)'LENGTH /= 0 then
TEXT_IO.PUT(OUTPUT, DICTIONARY_FORM(DE) & " ");
--TEXT_IO.PUT(OUTPUT, PART_OF_SPEECH_TYPE'IMAGE(DE.PART.POFS)& " ");
-- if DE.PART.POFS = N then
-- TEXT_IO.PUT(OUTPUT, " " & GENDER_TYPE'IMAGE(DE.PART.N.GENDER) & " ");
-- end if;
-- if (DE.PART.POFS = V) and then (DE.PART.V.KIND in GEN..PERFDEF) then
-- TEXT_IO.PUT(OUTPUT, " " & VERB_KIND_TYPE'IMAGE(DE.PART.V.KIND) & " ");
-- end if;
DHIT := TRUE;
end if;
end if;
if WORDS_MDEV(SHOW_DICTIONARY_CODES) and then
DE.PART.POFS not in XONS then
TEXT_IO.PUT(OUTPUT, " [");
AGE_TYPE_IO.PUT(OUTPUT, DE.TRAN.AGE);
AREA_TYPE_IO.PUT(OUTPUT, DE.TRAN.AREA);
GEO_TYPE_IO.PUT(OUTPUT, DE.TRAN.GEO);
FREQUENCY_TYPE_IO.PUT(OUTPUT, DE.TRAN.FREQ);
SOURCE_TYPE_IO.PUT(OUTPUT, DE.TRAN.SOURCE);
TEXT_IO.PUT(OUTPUT, "] ");
CHIT := TRUE;
end if;
if WORDS_MDEV(SHOW_DICTIONARY) then
TEXT_IO.PUT(OUTPUT, EXT(D_K) & ">");
EHIT := TRUE;
end if;
if WORDS_MDEV(SHOW_DICTIONARY_LINE) then
if DICTIONARY_LINE_NUMBER > 0 then
TEXT_IO.PUT(OUTPUT, "("
& TRIM(INTEGER'IMAGE(DICTIONARY_LINE_NUMBER)) & ")");
LHIT := TRUE;
end if;
end if;
PUT_DICTIONARY_FLAGS(OUTPUT, DE, FHIT);
if (CHIT or DHIT or EHIT or FHIT or LHIT) then
TEXT_IO.NEW_LINE(OUTPUT);
end if;
--end if;
end PUT_DICTIONARY_FORM;
procedure LIST_STEMS(OUTPUT : TEXT_IO.FILE_TYPE;
RAW_WORD : STRING;
INPUT_LINE : STRING;
PA : in out PARSE_ARRAY;
PA_LAST : in out INTEGER) is
use TEXT_IO;
use DICT_IO;
-- The main WORD processing has been to produce an array of PARSE_RECORD
-- type PARSE_RECORD is
-- record
-- STEM : STEM_TYPE := NULL_STEM_TYPE;
-- IR : INFLECTION_RECORD := NULL_INFLECTION_RECORD;
-- D_K : DICTIONARY_KIND := DEFAULT_DICTIONARY_KIND;
-- MNPC : DICT_IO.COUNT := NULL_MNPC;
-- end record;
-- This has involved STEMFILE and INFLECTS, no DICTFILE
-- PARSE_RECORD is put through the LIST_SWEEP procedure that does TRIMing
-- Then, for processing for output, the data is converted to arrays of
-- type STEM_INFLECTION_RECORD is
-- record
-- STEM : STEM_TYPE := NULL_STEM_TYPE;
-- IR : INFLECTION_RECORD := NULL_INFLECTION_RECORD;
-- end record;
-- and
-- type DICTIONARY_MNPC_RECORD is
-- record
-- D_K : DICTIONARY_KIND;
-- MNPC : MNPC_TYPE;
-- DE : DICTIONARY_ENTRY;
-- end record;
-- containing the same data plus the DICTFILE data DICTIONARY_ENTRY
-- but breaking it into two arrays allows different manipulation
-- These are only within this routine, used to clean up the output
type STEM_INFLECTION_RECORD is
record
STEM : STEM_TYPE := NULL_STEM_TYPE;
IR : INFLECTION_RECORD := NULL_INFLECTION_RECORD;
end record;
NULL_STEM_INFLECTION_RECORD : STEM_INFLECTION_RECORD;
STEM_INFLECTION_ARRAY_SIZE : constant := 10;
STEM_INFLECTION_ARRAY_ARRAY_SIZE : constant := 40;
type STEM_INFLECTION_ARRAY is array (INTEGER range <>) of STEM_INFLECTION_RECORD;
type STEM_INFLECTION_ARRAY_ARRAY is array (INTEGER range <>)
of STEM_INFLECTION_ARRAY(1..STEM_INFLECTION_ARRAY_SIZE);
SRA, OSRA, NULL_SRA : STEM_INFLECTION_ARRAY(1..STEM_INFLECTION_ARRAY_SIZE)
:= (others => (NULL_STEM_TYPE, NULL_INFLECTION_RECORD));
SRAA, NULL_SRAA : STEM_INFLECTION_ARRAY_ARRAY(1..STEM_INFLECTION_ARRAY_ARRAY_SIZE)
:= (others => NULL_SRA);
-- type DICTIONARY_MNPC_RECORD is record
-- D_K : DICTIONARY_KIND := DEFAULT_DICTIONARY_KIND;
-- MNPC : MNPC_TYPE := NULL_MNPC;
-- DE : DICTIONARY_ENTRY := NULL_DICTIONARY_ENTRY;
-- end record;
-- NULL_DICTIONARY_MNPC_RECORD : DICTIONARY_MNPC_RECORD
-- := (X, NULL_MNPC, NULL_DICTIONARY_ENTRY);
DM, ODM : DICTIONARY_MNPC_RECORD := NULL_DICTIONARY_MNPC_RECORD;
DICTIONARY_MNPC_ARRAY_SIZE : constant := 40;
type DICTIONARY_MNPC_ARRAY is array (1..DICTIONARY_MNPC_ARRAY_SIZE)
of DICTIONARY_MNPC_RECORD;
DMA, ODMA, NULL_DMA : DICTIONARY_MNPC_ARRAY;
--MEANING_ARRAY_SIZE : constant := 5;
--MEANING_ARRAY : array (1..MEANING_ARRAY_SIZE) of MEANING_TYPE;
DEA : DICTIONARY_ENTRY := NULL_DICTIONARY_ENTRY;
W : constant STRING := RAW_WORD;
J, J1, J2, K : INTEGER := 0;
THERE_IS_AN_ADVERB : BOOLEAN := FALSE;
procedure PUT_INFLECTION(SR : STEM_INFLECTION_RECORD;
DM : DICTIONARY_MNPC_RECORD) is
-- Handles putting ONLY_MEAN, PEARSE_CODES, CAPS, QUAL, V_KIND, FLAGS
procedure PUT_INFLECTION_FLAGS is
begin
if (WORDS_MODE(SHOW_AGE) or
(SR.IR.AGE /= X)) and -- Warn even if not to show AGE
TRIM(INFLECTION_AGE(SR.IR.AGE))'LENGTH /= 0 then
TEXT_IO.PUT(OUTPUT, " " & INFLECTION_AGE(SR.IR.AGE));
end if;
if (WORDS_MODE(SHOW_FREQUENCY) or
(SR.IR.FREQ >= C)) and -- Warn regardless
TRIM(INFLECTION_FREQUENCY(SR.IR.FREQ))'LENGTH /= 0 then
TEXT_IO.PUT(OUTPUT, " " & INFLECTION_FREQUENCY(SR.IR.FREQ));
end if;
end PUT_INFLECTION_FLAGS;
begin
--TEXT_IO.PUT_LINE("PUT_INFLECTION ");
if (not WORDS_MODE(DO_ONLY_MEANINGS) and
not (CONFIGURATION = ONLY_MEANINGS)) then
TEXT_IO.SET_COL(OUTPUT, 1);
if WORDS_MDEV(DO_PEARSE_CODES) then
if DM.D_K = ADDONS then
TEXT_IO.PUT(OUTPUT, "05 ");
elsif DM.D_K in XXX..YYY then
TEXT_IO.PUT(OUTPUT, "06 ");
else
TEXT_IO.PUT(OUTPUT, "01 ");
end if;
end if;
--TEXT_IO.PUT(OUTPUT, CAP_STEM(TRIM(SR.STEM)));
TEXT_IO.PUT(OUTPUT, (TRIM(SR.STEM)));
if SR.IR.ENDING.SIZE > 0 then
TEXT_IO.PUT(OUTPUT, ".");
--TEXT_IO.PUT(OUTPUT, TRIM(CAP_ENDING(SR.IR.ENDING.SUF)));
TEXT_IO.PUT(OUTPUT, TRIM((SR.IR.ENDING.SUF)));
end if;
if WORDS_MDEV(DO_PEARSE_CODES) then
TEXT_IO.SET_COL(OUTPUT, 25);
else
TEXT_IO.SET_COL(OUTPUT, 22);
end if;
if SR.IR /= NULL_INFLECTION_RECORD then
--PRINT_MODIFIED_QUAL: -- Really pedantic
--declare
-- OUT_STRING : STRING(1..QUALITY_RECORD_IO.DEFAULT_WIDTH);
--WHICH_START : constant INTEGER
-- := PART_OF_SPEECH_TYPE_IO.DEFAULT_WIDTH + 1 + 1; -- 8
--VARIANT_START : constant INTEGER
-- := WHICH_START + WHICH_TYPE_IO_DEFAULT_WIDTH + 1;
--VARIANT_FINISH : constant INTEGER
-- := VARIANT_START + VARIANT_TYPE_IO_DEFAULT_WIDTH;
--WHICH_BLANK : constant STRING(WHICH_START..VARIANT_START) := (others => ' ');
--VARIANT_BLANK : constant STRING(VARIANT_START..VARIANT_FINISH) := (others => ' ');
--begin
-- QUALITY_RECORD_IO.PUT(OUT_STRING, SR.IR.QUAL);
-- case SR.IR.QUAL.POFS is
-- when N | NUM | V | VPAR | SUPINE => -- ADJ?
-- OUT_STRING(VARIANT_START..VARIANT_FINISH) := VARIANT_BLANK;
-- when PRON | PACK =>
-- OUT_STRING(WHICH_START..VARIANT_FINISH) := WHICH_BLANK & VARIANT_BLANK;
-- when ADJ =>
-- if SR.IR.QUAL.ADJ.DECL.WHICH = 1 then
-- OUT_STRING(VARIANT_START..VARIANT_FINISH) := VARIANT_BLANK;
-- end if;
-- when others =>
-- null;
-- end case;
-- TEXT_IO.PUT(OUTPUT, OUT_STRING);
--end PRINT_MODIFIED_QUAL;
--QUALITY_RECORD_IO.PUT(OUTPUT, SR.IR.QUAL);
--NEW_LINE(OUTPUT);
--DICTIONARY_ENTRY_IO.PUT(OUTPUT, DM.DE);
--NEW_LINE(OUTPUT);
PRINT_MODIFIED_QUAL:
declare
OUT_STRING : STRING(1..QUALITY_RECORD_IO.DEFAULT_WIDTH);
PASSIVE_START : INTEGER :=
PART_OF_SPEECH_TYPE_IO.DEFAULT_WIDTH + 1 +
DECN_RECORD_IO.DEFAULT_WIDTH + 1 +
TENSE_TYPE_IO.DEFAULT_WIDTH + 1;
PASSIVE_FINISH : INTEGER :=
PASSIVE_START +
VOICE_TYPE_IO.DEFAULT_WIDTH;
PPL_START : INTEGER :=
PART_OF_SPEECH_TYPE_IO.DEFAULT_WIDTH + 1 +
DECN_RECORD_IO.DEFAULT_WIDTH + 1 +
CASE_TYPE_IO.DEFAULT_WIDTH + 1 +
NUMBER_TYPE_IO.DEFAULT_WIDTH + 1 +
GENDER_TYPE_IO.DEFAULT_WIDTH + 1 +
TENSE_TYPE_IO.DEFAULT_WIDTH + 1;
PPL_FINISH : INTEGER :=
PPL_START +
VOICE_TYPE_IO.DEFAULT_WIDTH;
PASSIVE_BLANK : constant STRING(1..VOICE_TYPE_IO.DEFAULT_WIDTH) :=
(others => ' ');
begin
--TEXT_IO.PUT_LINE("PASSIVE_START = " & INTEGER'IMAGE(PASSIVE_START));
--TEXT_IO.PUT_LINE("PASSIVE_FINISH = " & INTEGER'IMAGE(PASSIVE_FINISH));
--TEXT_IO.PUT_LINE("PPL_START = " & INTEGER'IMAGE(PPL_START));
--TEXT_IO.PUT_LINE("PPL_FINISH = " & INTEGER'IMAGE(PPL_FINISH));
--
--TEXT_IO.PUT_LINE("START PRINT MODIFIED QUAL " );
-- QUALITY_RECORD_IO.PUT(OUT_STRING, SR.IR.QUAL);
-- if (DM.D_K in GENERAL..LOCAL) and then -- UNIQUES has no DE
-- (SR.IR.QUAL.POFS = V) and then
-- ((SR.IR.QUAL.V.TENSE_VOICE_MOOD.MOOD in IND..INF) and
-- (DM.DE.PART.V.KIND = DEP)) then
----TEXT_IO.PUT_LINE("PRINT MODIFIED QUAL 1a" );
-- OUT_STRING(PASSIVE_START+1..PASSIVE_FINISH) := PASSIVE_BLANK;
----TEXT_IO.PUT_LINE("PRINT MODIFIED QUAL 2a" );
-- elsif (DM.D_K in GENERAL..LOCAL) and then -- UNIQUES has no DE
-- (SR.IR.QUAL.POFS = VPAR) and then
-- ((SR.IR.QUAL.V.TENSE_VOICE_MOOD.MOOD = PPL) and
-- (DM.DE.PART.V.KIND = DEP)) then
--TEXT_IO.PUT_LINE("PRINT MODIFIED QUAL 1b" );
-- OUT_STRING(PPL_START+1..PPL_FINISH) := PASSIVE_BLANK;
--TEXT_IO.PUT_LINE("PRINT MODIFIED QUAL 2b" );
--
-- end if;
----TEXT_IO.PUT_LINE("PRINT MODIFIED QUAL 3" );
--TEXT_IO.PUT_LINE("START PRINT MODIFIED QUAL " );
QUALITY_RECORD_IO.PUT(OUT_STRING, SR.IR.QUAL);
if (DM.D_K in GENERAL..LOCAL) then -- UNIQUES has no DE
if (SR.IR.QUAL.POFS = V) and then
(DM.DE.PART.V.KIND = DEP) and then
(SR.IR.QUAL.V.TENSE_VOICE_MOOD.MOOD in IND..INF) then
--TEXT_IO.PUT_LINE("START PRINT MODIFIED QUAL V" );
OUT_STRING(PASSIVE_START+1..PASSIVE_FINISH) := PASSIVE_BLANK;
elsif (SR.IR.QUAL.POFS = VPAR) and then
(DM.DE.PART.V.KIND = DEP) and then
(SR.IR.QUAL.VPAR.TENSE_VOICE_MOOD.MOOD = PPL) then
--TEXT_IO.PUT_LINE("START PRINT MODIFIED QUAL VPAR" );
OUT_STRING(PPL_START+1..PPL_FINISH) := PASSIVE_BLANK;
end if;
end if;
TEXT_IO.PUT(OUTPUT, OUT_STRING);
--TEXT_IO.PUT_LINE("PRINT MODIFIED QUAL 4" );
end PRINT_MODIFIED_QUAL;
-- if ((SR.IR.QUAL.POFS = NUM) and -- Don't want on inflection
-- (DM.D_K in GENERAL..UNIQUE)) and then
-- (DM.DE.KIND.NUM_VALUE > 0) then
-- TEXT_IO.PUT(OUTPUT, " ");
-- INFLECTIONS_PACKAGE.INTEGER_IO.PUT(OUTPUT, DM.DE.KIND.NUM_VALUE);
-- end if;
PUT_INFLECTION_FLAGS;
TEXT_IO.NEW_LINE(OUTPUT);
PUT_EXAMPLE_LINE(OUTPUT, SR.IR, DM.DE); -- Only full when DO_EXAMPLES
else
TEXT_IO.NEW_LINE(OUTPUT);
end if;
end if;
end PUT_INFLECTION;
-- procedure PUT_DICTIONARY_FORM(OUTPUT : TEXT_IO.FILE_TYPE;
-- DM : DICTIONARY_MNPC_RECORD) is
-- HIT : BOOLEAN := FALSE; -- Is anything on this line
-- DICTIONARY_LINE_NUMBER : INTEGER := INTEGER(DM.MNPC);
-- DE : DICTIONARY_ENTRY := DM.DE;
--
--
-- begin -- PUT_DICTIONARY_FORM
-- if WORDS_MODE(DO_DICTIONARY_FORMS) then
-- if WORDS_MDEV(DO_PEARSE_CODES) then
-- TEXT_IO.PUT(OUTPUT, "02 ");
-- HIT := TRUE;
-- end if;
-- if DICTIONARY_FORM(DE)'LENGTH /= 0 then
-- TEXT_IO.PUT(OUTPUT, DICTIONARY_FORM(DE) & " ");
-- HIT := TRUE;
-- end if;
-- end if;
--
--
--
-- if WORDS_MDEV(SHOW_DICTIONARY_CODES) and then
-- DE.PART.POFS not in XONS then
-- TEXT_IO.PUT(OUTPUT, " [");
-- AGE_TYPE_IO.PUT(OUTPUT, DE.TRAN.AGE);
-- AREA_TYPE_IO.PUT(OUTPUT, DE.TRAN.AREA);
-- GEO_TYPE_IO.PUT(OUTPUT, DE.TRAN.GEO);
-- FREQUENCY_TYPE_IO.PUT(OUTPUT, DE.TRAN.FREQ);
-- SOURCE_TYPE_IO.PUT(OUTPUT, DE.TRAN.SOURCE);
-- TEXT_IO.PUT(OUTPUT, "] ");
-- HIT := TRUE;
-- end if;
--
--
-- if WORDS_MDEV(SHOW_DICTIONARY) then
-- TEXT_IO.PUT(OUTPUT, EXT(DM.D_K) & ">");
-- HIT := TRUE;
-- end if;
--
--
-- if WORDS_MDEV(SHOW_DICTIONARY_LINE) then
-- if DICTIONARY_LINE_NUMBER > 0 then
-- TEXT_IO.PUT(OUTPUT, "("
-- & TRIM(INTEGER'IMAGE(DICTIONARY_LINE_NUMBER)) & ")");
-- HIT := TRUE;
-- end if;
-- end if;
--
--
--
-- PUT_DICTIONARY_FLAGS(DM, HIT);
--
--
-- if HIT then
-- TEXT_IO.NEW_LINE(OUTPUT);
-- end if;
--
-- --end if;
--
-- end PUT_DICTIONARY_FORM;
--
--
procedure PUT_FORM(SR : STEM_INFLECTION_RECORD;
DM : DICTIONARY_MNPC_RECORD) is
-- Handles PEARSE_CODES and DICTIONARY_FORM (which has FLAGS) and D_K
-- The Pearse 02 is handled in PUT_DICTIONARY_FORM
begin
if (SR.IR.QUAL.POFS not in XONS) and
(DM.D_K in GENERAL..UNIQUE) then
--DICTIONARY_ENTRY_IO.PUT(DM.DE);
PUT_DICTIONARY_FORM(OUTPUT, DM.D_K, DM.MNPC, DM.DE);
end if;
end PUT_FORM;
function TRIM_BAR(S : STRING) return STRING is
-- Takes vertical bars from begining of MEAN and TRIMs
begin
if S'LENGTH >3 and then S(S'FIRST..S'FIRST+3) = "||||" then
return TRIM(S(S'FIRST+4.. S'LAST));
elsif S'LENGTH >2 and then S(S'FIRST..S'FIRST+2) = "|||" then
return TRIM(S(S'FIRST+3.. S'LAST));
elsif S'LENGTH > 1 and then S(S'FIRST..S'FIRST+1) = "||" then
return TRIM(S(S'FIRST+2.. S'LAST));
elsif S(S'FIRST) = '|' then
return TRIM(S(S'FIRST+1.. S'LAST));
else
return TRIM(S);
end if;
end TRIM_BAR;
procedure PUT_MEANING(OUTPUT : TEXT_IO.FILE_TYPE;
RAW_MEANING : STRING) is
-- Handles the MM screen line limit and TRIM_BAR, then TRIMs
begin
TEXT_IO.PUT(OUTPUT, TRIM(HEAD(TRIM_BAR(RAW_MEANING), MM)));
end PUT_MEANING;
function CONSTRUCTED_MEANING(SR : STEM_INFLECTION_RECORD;
DM : DICTIONARY_MNPC_RECORD) return STRING is
-- Constructs the meaning for NUM from NUM.SORT and NUM_VALUE
S : STRING(1..MAX_MEANING_SIZE) := NULL_MEANING_TYPE;
N : INTEGER := 0;
begin
if DM.DE.PART.POFS = NUM then
N := DM.DE.PART.NUM.VALUE;
if SR.IR.QUAL.POFS = NUM then -- Normal parse
case SR.IR.QUAL.NUM.SORT is
when CARD =>
S := HEAD(INTEGER'IMAGE(N) & " - (CARD answers 'how many');", MAX_MEANING_SIZE);
when ORD =>
S := HEAD(INTEGER'IMAGE(N) & "th - (ORD, 'in series'); (a/the)" & INTEGER'IMAGE(N) &
"th (part) (fract w/pars?);", MAX_MEANING_SIZE);
when DIST =>
S := HEAD(INTEGER'IMAGE(N) & " each/apiece/times/fold/together/at a time - 'how many each'; by " &
INTEGER'IMAGE(N) & "s; ", MAX_MEANING_SIZE);
when ADVERB =>
S := HEAD(INTEGER'IMAGE(N) & " times, on" & INTEGER'IMAGE(N) &
" occasions - (ADVERB answers 'how often');", MAX_MEANING_SIZE);
when others =>
null;
end case;
else -- there is fix so POFS is not NUM
S := HEAD("Number " & INTEGER'IMAGE(N), MAX_MEANING_SIZE);
end if;
end if;
return S;
end CONSTRUCTED_MEANING;
procedure PUT_MEANING_LINE(SR : STEM_INFLECTION_RECORD;
DM : DICTIONARY_MNPC_RECORD) is
begin
if DM.D_K not in ADDONS..PPP then
if WORDS_MDEV(DO_PEARSE_CODES) then
TEXT_IO.PUT(OUTPUT, "03 ");
end if;
if DM.DE.PART.POFS = NUM and then DM.DE.PART.NUM.VALUE > 0 then
TEXT_IO.PUT_LINE(OUTPUT, CONSTRUCTED_MEANING(SR, DM)); -- Constructed MEANING
elsif DM.D_K = UNIQUE then
PUT_MEANING(OUTPUT, UNIQUES_DE(DM.MNPC).MEAN);
TEXT_IO.NEW_LINE(OUTPUT);
else
PUT_MEANING(OUTPUT, TRIM_BAR(DM.DE.MEAN));
TEXT_IO.NEW_LINE(OUTPUT);
end if;
else
if DM.D_K = RRR then
if RRR_MEANING /= NULL_MEANING_TYPE then
--PUT_DICTIONARY_FLAGS;
if WORDS_MDEV(DO_PEARSE_CODES) then
TEXT_IO.PUT(OUTPUT, "03 ");
end if;
PUT_MEANING(OUTPUT, RRR_MEANING); -- Roman Numeral
RRR_MEANING := NULL_MEANING_TYPE;
TEXT_IO.NEW_LINE(OUTPUT);
end if;
elsif DM.D_K = NNN then
if NNN_MEANING /= NULL_MEANING_TYPE then
--PUT_DICTIONARY_FLAGS;
if WORDS_MDEV(DO_PEARSE_CODES) then
TEXT_IO.PUT(OUTPUT, "03 ");
end if;
PUT_MEANING(OUTPUT, NNN_MEANING); -- Unknown Name
NNN_MEANING := NULL_MEANING_TYPE;
TEXT_IO.NEW_LINE(OUTPUT);
end if;
elsif DM.D_K = XXX then
if XXX_MEANING /= NULL_MEANING_TYPE then
if WORDS_MDEV(DO_PEARSE_CODES) then
TEXT_IO.PUT(OUTPUT, "06 ");
end if;
PUT_MEANING(OUTPUT, XXX_MEANING); -- TRICKS
XXX_MEANING := NULL_MEANING_TYPE;
TEXT_IO.NEW_LINE(OUTPUT);
end if;
elsif DM.D_K = YYY then
if YYY_MEANING /= NULL_MEANING_TYPE then
if WORDS_MDEV(DO_PEARSE_CODES) then
TEXT_IO.PUT(OUTPUT, "06 ");
end if;
PUT_MEANING(OUTPUT, YYY_MEANING); -- Syncope
YYY_MEANING := NULL_MEANING_TYPE;
TEXT_IO.NEW_LINE(OUTPUT);
end if;
elsif DM.D_K = PPP then
if PPP_MEANING /= NULL_MEANING_TYPE then
if WORDS_MDEV(DO_PEARSE_CODES) then
TEXT_IO.PUT(OUTPUT, "06 ");
end if;
PUT_MEANING(OUTPUT, PPP_MEANING); -- Compounds
PPP_MEANING := NULL_MEANING_TYPE;
TEXT_IO.NEW_LINE(OUTPUT);
end if;
elsif DM.D_K = ADDONS then
if WORDS_MDEV(DO_PEARSE_CODES) then
TEXT_IO.PUT(OUTPUT, "06 ");
end if;
PUT_MEANING(OUTPUT, MEANS(INTEGER(DM.MNPC)));
TEXT_IO.NEW_LINE(OUTPUT);
end if;
end if;
end PUT_MEANING_LINE;
begin
TRIMMED := FALSE;
-- Since this procedure weeds out possible parses, if it weeds out all
-- (or all of a class) it must fix up the rest of the parse array,
-- e.g., it must clean out dangling prefixes and suffixes
-- -- Just to find the words with long/complicated output at the processing level
-- -- This is done with the final PA_LAST, entering LIST_STEM, before SWEEP
-- if PA_LAST > PA_LAST_MAX then
-- PUT_STAT("$PA_LAST_MAX for RAW_WORD " & HEAD(RAW_WORD, 24) & " = " & INTEGER'IMAGE(PA_LAST));
-- PA_LAST_MAX := PA_LAST;
-- end if;
--TEXT_IO.PUT_LINE("PA on entering LIST_STEMS PA_LAST = " & INTEGER'IMAGE(PA_LAST));
--for I in 1..PA_LAST loop
--PARSE_RECORD_IO.PUT(PA(I)); TEXT_IO.NEW_LINE;
--end loop;
if (TEXT_IO.NAME(OUTPUT) =
TEXT_IO.NAME(TEXT_IO.STANDARD_OUTPUT)) then
MM := MAX_MEANING_PRINT_SIZE; -- to keep from overflowing screen line
-- or even adding blank line
else
MM := MAX_MEANING_SIZE;
end if;
------- The gimick of adding an ADV if there is only ADJ VOC ----
--TEXT_IO.PUT_LINE("About to do the ADJ -> ADV kludge");
for I in PA'FIRST..PA_LAST loop
if PA(I).IR.QUAL.POFS = ADV then
THERE_IS_AN_ADVERB := TRUE;
exit;
end if;
end loop;
--TEXT_IO.PUT_LINE("In the ADJ -> ADV kludge Checked to see if there is an ADV");
if ((not THERE_IS_AN_ADVERB) and (WORDS_MODE(DO_FIXES))) then
--TEXT_IO.PUT_LINE("In the ADJ -> ADV kludge There is no ADV");
for I in reverse PA'FIRST..PA_LAST loop
if PA(I).IR.QUAL.POFS = ADJ and then
(PA(I).IR.QUAL.ADJ = ((1, 1), VOC, S, M, POS) or
((PA(I).IR.QUAL.ADJ.CS = VOC) and
(PA(I).IR.QUAL.ADJ.NUMBER = S) and
(PA(I).IR.QUAL.ADJ.GENDER = M) and
(PA(I).IR.QUAL.ADJ.CO = SUPER))) then
J := I;
while J >= PA'FIRST loop --Back through other ADJ cases
if PA(J).IR.QUAL.POFS /= ADJ then
J2 := J; -- J2 is first (reverse) that is not ADJ
exit;
end if;
J := J - 1;
end loop;
while J >= PA'FIRST loop -- Sweep up associated fixes
if PA(J).IR.QUAL.POFS not in XONS then
J1 := J; -- J1 is first (reverse) that is not XONS
exit;
end if;
J := J - 1;
end loop;
for J in J1+1..J2 loop
PA(PA_LAST+J-J1+1) := PA(J);
end loop;
--TEXT_IO.PUT_LINE("In the ADJ -> ADV kludge Ready to add PA for ADV");
PA_LAST := PA_LAST + J2 - J1 + 1;
PA(PA_LAST) := PA(J2+1);
--TEXT_IO.PUT_LINE("In the ADJ -> ADV kludge Adding SUFFIX E ADV");
PA(PA_LAST) := ("e ",
((SUFFIX, NULL_SUFFIX_RECORD), 0, NULL_ENDING_RECORD, X, B),
PPP, NULL_MNPC);
--PARSE_RECORD_IO.PUT(PA(PA_LAST)); TEXT_IO.NEW_LINE;
PA_LAST := PA_LAST + 1;
if PA(J2+1).IR.QUAL.ADJ.CO = POS then
--TEXT_IO.PUT_LINE("In the ADJ -> ADV kludge Adding POS for ADV");
PA(PA_LAST) := (PA(J2+1).STEM,
((POFS => ADV, ADV => (CO => PA(J2+1).IR.QUAL.ADJ.CO)),
KEY => 0, ENDING => (1, "e "), AGE => X, FREQ => B),
PA(J2+1).D_K,
PA(J2+1).MNPC);
--PARSE_RECORD_IO.PUT(PA(PA_LAST)); TEXT_IO.NEW_LINE;
PPP_MEANING :=
HEAD("-ly; -ily; Converting ADJ to ADV",
MAX_MEANING_SIZE);
elsif PA(J2+1).IR.QUAL.ADJ.CO = SUPER then
PA(PA_LAST) := (PA(J2+1).STEM,
((POFS => ADV, ADV => (CO => PA(J2+1).IR.QUAL.ADJ.CO)),
KEY => 0, ENDING => (2, "me "), AGE => X, FREQ => B),
PA(J2+1).D_K,
PA(J2+1).MNPC);
PPP_MEANING :=
HEAD("-estly; -estily; most -ly, very -ly Converting ADJ to ADV",
MAX_MEANING_SIZE);
end if;
--TEXT_IO.PUT_LINE("In the ADJ -> ADV kludge Done adding PA for ADV");
end if; -- PA(I).IR.QUAL.POFS = ADJ
end loop;
end if; -- not THERE_IS_AN_ADVERB
-- TEXT_IO.PUT_LINE("In the ADJ -> ADV kludge FINISHED");
LIST_SWEEP(PA(1..PA_LAST), PA_LAST);
--TEXT_IO.PUT_LINE("PA after leaving LIST_SWEEP PA_LAST = " & INTEGER'IMAGE(PA_LAST));
--for I in 1..PA_LAST loop
--PARSE_RECORD_IO.PUT(PA(I)); TEXT_IO.NEW_LINE;
--end loop;
--
-- -- Does STATS
--
--TEXT_IO.PUT_LINE("Before STATING FIXES");
if WORDS_MDEV(WRITE_STATISTICS_FILE) then -- Omit rest of output
for I in 1..PA_LAST loop -- Just to PUT_STAT
if (PA(I).D_K = ADDONS) then
if PA(I).IR.QUAL.POFS = PREFIX then
PUT_STAT("ADDON PREFIX at "
& HEAD(INTEGER'IMAGE(LINE_NUMBER), 8) & HEAD(INTEGER'IMAGE(WORD_NUMBER), 4)
& " " & HEAD(W, 20) & " " & PA(I).STEM & " " & INTEGER'IMAGE(INTEGER(PA(I).MNPC)));
elsif PA(I).IR.QUAL.POFS = SUFFIX then
PUT_STAT("ADDON SUFFIX at "
& HEAD(INTEGER'IMAGE(LINE_NUMBER), 8) & HEAD(INTEGER'IMAGE(WORD_NUMBER), 4)
& " " & HEAD(W, 20) & " " & PA(I).STEM & " " & INTEGER'IMAGE(INTEGER(PA(I).MNPC)));
elsif PA(I).IR.QUAL.POFS = TACKON then
PUT_STAT("ADDON TACKON at "
& HEAD(INTEGER'IMAGE(LINE_NUMBER), 8) & HEAD(INTEGER'IMAGE(WORD_NUMBER), 4)
& " " & HEAD(W, 20) & " " & PA(I).STEM & " " & INTEGER'IMAGE(INTEGER(PA(I).MNPC)));
end if;
end if;
end loop;
---- -- Just to find the words with long/complicated output at the LIST level
---- -- This is done with the final PA_LAST, after SWEEP
---- if PA_LAST > FINAL_PA_LAST_MAX then
---- PUT_STAT("$FINAL_PA_LAST_MAX for RAW_WORD " & HEAD(RAW_WORD, 24) & " = " & INTEGER'IMAGE(PA_LAST));
---- FINAL_PA_LAST_MAX := PA_LAST;
---- end if;
end if;
--TEXT_IO.PUT_LINE("After STATING FIXES");
-- Convert from PARSE_RECORDs to DICTIONARY_MNPC_RECORD and STEM_INFLECTION_RECORD
--TEXT_IO.PUT_LINE("Doing arrays in LIST_STEMS PA_LAST = " &
-- INTEGER'IMAGE(PA_LAST));
I := 1; -- I cycles on PA
J := 0; -- J indexes the number of DMA arrays -- Initialize
SRAA := NULL_SRAA;
DMA := NULL_DMA;
CYCLE_OVER_PA:
while I <= PA_LAST loop -- I cycles over full PA array
--TEXT_IO.PUT_LINE("Starting loop for I I = " & INTEGER'IMAGE(I));
ODM := NULL_DICTIONARY_MNPC_RECORD;
if PA(I).D_K = UNIQUE then
J := J + 1;
SRAA(J)(1) := (PA(I).STEM, PA(I).IR);
--TEXT_IO.PUT_LINE("UNIQUE I = " & INTEGER'IMAGE(I) & " J = " & INTEGER'IMAGE(J));
DM := NULL_DICTIONARY_MNPC_RECORD;
DM.D_K := UNIQUE;
DM.MNPC := PA(I).MNPC;
DM.DE := UNIQUES_DE(PA(I).MNPC);
DMA(J) := DM;
I := I + 1;
else
case PA(I).IR.QUAL.POFS is
when N =>
OSRA := NULL_SRA;
ODMA := NULL_DMA;
--ODM := NULL_DICTIONARY_MNPC_RECORD;
--DM := NULL_DICTIONARY_MNPC_RECORD;
while PA(I).IR.QUAL.POFS = N and
I <= PA_LAST loop
--TEXT_IO.PUT_LINE("Starting loop for N I = " & INTEGER'IMAGE(I) & " K = " & INTEGER'IMAGE(K));
if PA(I).MNPC /= ODM.MNPC then -- Encountering new MNPC
OSRA := SRA;
K := 1; -- K indexes within the MNPCA array -- Initialize
--TEXT_IO.PUT_LINE("Starting IRA for N I = " & INTEGER'IMAGE(I) & " K = " & INTEGER'IMAGE(K));
J := J + 1; -- J indexes the number of MNPCA arrays - Next MNPCA
--TEXT_IO.PUT_LINE("Shifting J for N I = " & INTEGER'IMAGE(I) & " J = " & INTEGER'IMAGE(J));
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
DICT_IO.SET_INDEX(DICT_FILE(PA(I).D_K), PA(I).MNPC);
DICT_IO.READ(DICT_FILE(PA(I).D_K), DEA);
DM := (PA(I).D_K, PA(I).MNPC, DEA);
DMA(J) := DM;
ODM := DM;
else
K := K + 1; -- K indexes within the MNPCA array - Next MNPC
--TEXT_IO.PUT_LINE("Continuing IRA for N I = " & INTEGER'IMAGE(I) & " K = " & INTEGER'IMAGE(K)
-- & " J = " & INTEGER'IMAGE(J));
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
end if;
I := I + 1; -- I cycles over full PA array
end loop;
when PRON =>
OSRA := NULL_SRA;
ODMA := NULL_DMA;
--ODM := NULL_DICTIONARY_MNPC_RECORD;
--DM := NULL_DICTIONARY_MNPC_RECORD;
while PA(I).IR.QUAL.POFS = PRON and
I <= PA_LAST loop
if PA(I).MNPC /= ODM.MNPC then -- Encountering new MNPC
OSRA := SRA;
K := 1; -- K indexes within the MNPCA array -- Initialize
J := J + 1; -- J indexes the number of MNPCA arrays - Next MNPCA
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
DICT_IO.SET_INDEX(DICT_FILE(PA(I).D_K), PA(I).MNPC);
DICT_IO.READ(DICT_FILE(PA(I).D_K), DEA);
DM := (PA(I).D_K, PA(I).MNPC, DEA);
DMA(J) := DM;
ODM := DM;
else
K := K + 1; -- K indexes within the MNPCA array - Next MNPC
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
end if;
I := I + 1; -- I cycles over full PA array
end loop;
when PACK =>
OSRA := NULL_SRA;
ODMA := NULL_DMA;
--ODM := NULL_DICTIONARY_MNPC_RECORD;
--DM := NULL_DICTIONARY_MNPC_RECORD;
while PA(I).IR.QUAL.POFS = PACK and
I <= PA_LAST loop
if PA(I).MNPC /= ODM.MNPC then -- Encountering new MNPC
OSRA := SRA;
K := 1; -- K indexes within the MNPCA array -- Initialize
J := J + 1; -- J indexes the number of MNPCA arrays - Next MNPCA
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
DICT_IO.SET_INDEX(DICT_FILE(PA(I).D_K), PA(I).MNPC);
DICT_IO.READ(DICT_FILE(PA(I).D_K), DEA);
DM := (PA(I).D_K, PA(I).MNPC, DEA);
DMA(J) := DM;
ODM := DM;
else
K := K + 1; -- K indexes within the MNPCA array - Next MNPC
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
end if;
I := I + 1; -- I cycles over full PA array
end loop;
when ADJ =>
OSRA := NULL_SRA;
ODMA := NULL_DMA;
--ODM := NULL_DICTIONARY_MNPC_RECORD;
--DM := NULL_DICTIONARY_MNPC_RECORD;
while PA(I).IR.QUAL.POFS = ADJ and
I <= PA_LAST loop
--TEXT_IO.PUT_LINE("SRAA - ADJ");
if PA(I).MNPC /= ODM.MNPC then -- Encountering new MNPC
OSRA := SRA;
K := 1; -- K indexes within the MNPCA array -- Initialize
J := J + 1; -- J indexes the number of MNPCA arrays - Next MNPCA
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
DICT_IO.SET_INDEX(DICT_FILE(PA(I).D_K), PA(I).MNPC);
DICT_IO.READ(DICT_FILE(PA(I).D_K), DEA);
DM := (PA(I).D_K, PA(I).MNPC, DEA);
DMA(J) := DM;
ODM := DM;
else
K := K + 1; -- K indexes within the MNPCA array - Next MNPC
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
end if;
--TEXT_IO.PUT_LINE("SRAA + ADJ");
I := I + 1; -- I cycles over full PA array
end loop;
when NUM =>
OSRA := NULL_SRA;
ODMA := NULL_DMA;
--ODM := NULL_DICTIONARY_MNPC_RECORD;
--DM := NULL_DICTIONARY_MNPC_RECORD;
while PA(I).IR.QUAL.POFS = NUM and
I <= PA_LAST loop
if (PA(I).D_K = RRR) then -- Roman numeral
OSRA := SRA;
K := 1; -- K indexes within the MNPCA array -- Initialize
J := J + 1; -- J indexes the number of MNPCA arrays - Next MNPCA
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
--DICT_IO.SET_INDEX(DICT_FILE(PA(I).D_K), PA(I).MNPC);
--DICT_IO.READ(DICT_FILE(PA(I).D_K), DEA);
DEA := NULL_DICTIONARY_ENTRY;
DM := (PA(I).D_K, PA(I).MNPC, DEA);
DMA(J) := DM;
ODM := DM;
elsif (PA(I).MNPC /= ODM.MNPC) then -- Encountering new MNPC
OSRA := SRA;
K := 1; -- K indexes within the MNPCA array -- Initialize
J := J + 1; -- J indexes the number of MNPCA arrays - Next MNPCA
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
DICT_IO.SET_INDEX(DICT_FILE(PA(I).D_K), PA(I).MNPC);
DICT_IO.READ(DICT_FILE(PA(I).D_K), DEA);
DM := (PA(I).D_K, PA(I).MNPC, DEA);
DMA(J) := DM;
ODM := DM;
else
K := K + 1; -- K indexes within the MNPCA array - Next MNPC
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
end if;
I := I + 1; -- I cycles over full PA array
end loop;
when V | VPAR | SUPINE =>
OSRA := NULL_SRA;
ODMA := NULL_DMA;
--ODM := NULL_DICTIONARY_MNPC_RECORD;
--DM := NULL_DICTIONARY_MNPC_RECORD;
while (PA(I).IR.QUAL.POFS = V or
PA(I).IR.QUAL.POFS = VPAR or
PA(I).IR.QUAL.POFS = SUPINE) and
I <= PA_LAST loop
--TEXT_IO.PUT_LINE("Starting loop for VPAR I = " & INTEGER'IMAGE(I) & " K = " & INTEGER'IMAGE(K));
if (PA(I).MNPC /= ODM.MNPC) and (PA(I).D_K /= PPP) then -- Encountering new MNPC
OSRA := SRA; -- But not for compound
K := 1; -- K indexes within the MNPCA array -- Initialize
--TEXT_IO.PUT_LINE("Starting IRA for VPAR I = " & INTEGER'IMAGE(I) & " K = " & INTEGER'IMAGE(K));
J := J + 1; -- J indexes the number of MNPCA arrays - Next MNPCA
--TEXT_IO.PUT_LINE("Shifting J for VPAR I = " & INTEGER'IMAGE(I) & " J = " & INTEGER'IMAGE(J));
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
if PA(I).D_K /= PPP then
DICT_IO.SET_INDEX(DICT_FILE(PA(I).D_K), PA(I).MNPC);
DICT_IO.READ(DICT_FILE(PA(I).D_K), DEA);
end if; -- use previous DEA
DM := (PA(I).D_K, PA(I).MNPC, DEA);
DMA(J) := DM;
ODM := DM;
else
K := K + 1; -- K indexes within the MNPCA array - Next MNPC
--TEXT_IO.PUT_LINE("Continuing IRA for VPAR I = " & INTEGER'IMAGE(I) & " K = " & INTEGER'IMAGE(K)
-- & " J = " & INTEGER'IMAGE(J));
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
end if;
I := I + 1; -- I cycles over full PA array
end loop;
when others =>
--TEXT_IO.PUT_LINE("Others");
OSRA := NULL_SRA;
ODMA := NULL_DMA;
--ODM := NULL_DICTIONARY_MNPC_RECORD;
--DM := NULL_DICTIONARY_MNPC_RECORD;
while I <= PA_LAST loop
--TEXT_IO.PUT_LINE("Starting loop for OTHER I = " & INTEGER'IMAGE(I) & " K = " & INTEGER'IMAGE(K));
if (ODM.D_K /= PA(I).D_K) or
(ODM.MNPC /= PA(I).MNPC) then -- Encountering new single (K only 1)
OSRA := SRA;
K := 1; -- K indexes within the MNPCA array -- Initialize
--TEXT_IO.PUT_LINE("Starting IRA for OTHER I = " & INTEGER'IMAGE(I) & " K = " & INTEGER'IMAGE(K));
J := J + 1; -- J indexes the number of MNPCA arrays - Next MNPCA
--TEXT_IO.PUT_LINE("Shifting J for OTHER I = " & INTEGER'IMAGE(I) & " J = " & INTEGER'IMAGE(J));
SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
if PA(I).MNPC /= NULL_MNPC then
if PA(I).D_K = ADDONS then
DEA := NULL_DICTIONARY_ENTRY; -- Fix for ADDONS in MEANS, not DICT_IO
else
DICT_IO.SET_INDEX(DICT_FILE(PA(I).D_K), PA(I).MNPC);
DICT_IO.READ(DICT_FILE(PA(I).D_K), DEA);
end if;
else -- Has no dictionary to read
DEA:= NULL_DICTIONARY_ENTRY;
end if;
DM := (PA(I).D_K, PA(I).MNPC, DEA);
DMA(J) := DM;
ODM := DM;
--else
-- K := K + 1; -- K indexes within the MNPCA array - Next MNPC
-- SRAA(J)(K) := (PA(I).STEM, PA(I).IR);
end if;
I := I + 1; -- I cycles over full PA array
exit; -- Since Other is only one, don't loop
end loop;
end case;
end if;
-- -- This just for developer test, will be commented out
-- if K > SRA_MAX then
-- SRA_MAX := K;
--PUT_STAT("*SRA_MAX for RAW_WORD " & HEAD(RAW_WORD, 26) & " = " & INTEGER'IMAGE(SRA_MAX));
-- end if;
-- if J > DMA_MAX then
-- DMA_MAX := J;
--PUT_STAT("*DMA_MAX for RAW_WORD " & HEAD(RAW_WORD, 26) & " = " & INTEGER'IMAGE(DMA_MAX));
-- end if;
end loop CYCLE_OVER_PA;
--TEXT_IO.PUT_LINE("Made QA");
--TEXT_IO.PUT_LINE("QA ARRAYS FFFFFF ======================================");
-- for J in 1..DICTIONARY_MNPC_ARRAY_SIZE loop
-- if DMA(J) /= NULL_DICTIONARY_MNPC_RECORD then
-- TEXT_IO.PUT(INTEGER'IMAGE(J) & " ");
-- DICTIONARY_KIND_IO.PUT(DMA(J).D_K); TEXT_IO.PUT(" ");
-- MNPC_IO.PUT(DMA(J).MNPC); TEXT_IO.NEW_LINE;
-- end if;
-- end loop;
-- for J in 1..STEM_INFLECTION_ARRAY_ARRAY_SIZE loop
-- for K in 1..STEM_INFLECTION_ARRAY_SIZE loop
-- if SRAA(J)(K) /= NULL_STEM_INFLECTION_RECORD then
-- TEXT_IO.PUT(INTEGER'IMAGE(J) & " " & INTEGER'IMAGE(K) & " ");
-- QUALITY_RECORD_IO.PUT(SRAA(J)(K).IR.QUAL); TEXT_IO.NEW_LINE;
-- end if;
-- end loop;
-- end loop;
-- Sets + if capitalized
-- Strangely enough, it may enter LIST_STEMS with PA_LAST /= 0
-- but be weeded and end up with no parse after LIST_SWEEP - PA_LAST = 0
if PA_LAST = 0 then -- WORD failed
--???? (DMA(1).D_K in ADDONS..YYY and then TRIM(DMA(1).DE.STEMS(1)) /= "que") then -- or used FIXES/TRICKS
if WORDS_MODE(IGNORE_UNKNOWN_NAMES) and CAPITALIZED then
NNN_MEANING := HEAD(
"Assume this is capitalized proper name/abbr, under MODE IGNORE_UNKNOWN_NAME ",
MAX_MEANING_SIZE);
PA(1) := (HEAD(RAW_WORD, MAX_STEM_SIZE),
((N, ((0, 0), X, X, X)), 0, NULL_ENDING_RECORD, X, X),
NNN, NULL_MNPC);
PA_LAST := 1; -- So LIST_NEIGHBORHOOD will not be called
SRAA := NULL_SRAA;
DMA := NULL_DMA;
SRAA(1)(1) := (PA(1).STEM, PA(1).IR);
DMA(1) := (NNN, 0, NULL_DICTIONARY_ENTRY);
elsif WORDS_MODE(IGNORE_UNKNOWN_CAPS) and ALL_CAPS then
NNN_MEANING := HEAD(
"Assume this is capitalized proper name/abbr, under MODE IGNORE_UNKNOWN_CAPS ",
MAX_MEANING_SIZE);
PA(1) := (HEAD(RAW_WORD, MAX_STEM_SIZE),
((N, ((0, 0), X, X, X)), 0, NULL_ENDING_RECORD, X, X),
NNN, NULL_MNPC);
PA_LAST := 1;
SRAA := NULL_SRAA;
DMA := NULL_DMA;
SRAA(1)(1) := (PA(1).STEM, PA(1).IR);
DMA(1) := (NNN, 0, NULL_DICTIONARY_ENTRY);
end if;
end if;
-- -- Does STATS
--
----TEXT_IO.PUT_LINE("Before STATING FIXES");
-- if WORDS_MDEV(WRITE_STATISTICS_FILE) then -- Omit rest of output
----
---- for I in 1..PA_LAST loop -- Just to PUT_STAT
---- if (PA(I).D_K = ADDONS) then
---- if PA(I).IR.QUAL.POFS = PREFIX then
---- PUT_STAT("ADDON PREFIX at "
---- & HEAD(INTEGER'IMAGE(LINE_NUMBER), 8) & HEAD(INTEGER'IMAGE(WORD_NUMBER), 4)
---- & " " & HEAD(W, 20) & " " & PA(I).STEM);
---- elsif PA(I).IR.QUAL.POFS = SUFFIX then
---- PUT_STAT("ADDON SUFFIX at "
---- & HEAD(INTEGER'IMAGE(LINE_NUMBER), 8) & HEAD(INTEGER'IMAGE(WORD_NUMBER), 4)
---- & " " & HEAD(W, 20) & " " & PA(I).STEM);
---- elsif PA(I).IR.QUAL.POFS = TACKON then
---- PUT_STAT("ADDON TACKON at "
---- & HEAD(INTEGER'IMAGE(LINE_NUMBER), 8) & HEAD(INTEGER'IMAGE(WORD_NUMBER), 4)
---- & " " & HEAD(W, 20) & " " & PA(I).STEM);
---- end if;
---- end if;
---- end loop;
--
--
---- -- Just to find the words with long/complicated output at the LIST level
---- -- This is done with the final PA_LAST, after SWEEP
-- if PA_LAST > FINAL_PA_LAST_MAX then
-- PUT_STAT("$FINAL_PA_LAST_MAX for RAW_WORD " & HEAD(RAW_WORD, 24) & " = " & INTEGER'IMAGE(PA_LAST));
-- FINAL_PA_LAST_MAX := PA_LAST;
-- end if;
--
-- end if;
if PA_LAST = 0 then
if WORDS_MODE(WRITE_OUTPUT_TO_FILE) then
if WORDS_MDEV(DO_PEARSE_CODES) then
TEXT_IO.PUT(OUTPUT, "04 ");
end if;
TEXT_IO.PUT(OUTPUT, RAW_WORD);
TEXT_IO.SET_COL(OUTPUT, 30);
INFLECTIONS_PACKAGE.INTEGER_IO.PUT(OUTPUT, LINE_NUMBER, 7);
INFLECTIONS_PACKAGE.INTEGER_IO.PUT(OUTPUT, WORD_NUMBER, 7);
TEXT_IO.PUT_LINE(OUTPUT, " ======== UNKNOWN ");
--TEXT_IO.NEW_LINE(OUTPUT);
else -- Just screen output
if WORDS_MDEV(DO_PEARSE_CODES) then
TEXT_IO.PUT("04 ");
end if;
TEXT_IO.PUT(RAW_WORD);
TEXT_IO.SET_COL(30);
TEXT_IO.PUT_LINE(" ======== UNKNOWN ");
--TEXT_IO.NEW_LINE;
end if;
if WORDS_MODE(WRITE_UNKNOWNS_TO_FILE) then
if WORDS_MDEV(INCLUDE_UNKNOWN_CONTEXT) or
WORDS_MDEV(DO_ONLY_INITIAL_WORD) then
TEXT_IO.PUT_LINE(INPUT_LINE);
TEXT_IO.PUT_LINE(UNKNOWNS, INPUT_LINE);
end if;
if WORDS_MDEV(DO_PEARSE_CODES) then
TEXT_IO.PUT(UNKNOWNS, "04 ");
end if;
TEXT_IO.PUT(UNKNOWNS, RAW_WORD);
TEXT_IO.SET_COL(UNKNOWNS, 30);
INFLECTIONS_PACKAGE.INTEGER_IO.PUT(UNKNOWNS, LINE_NUMBER, 7);
INFLECTIONS_PACKAGE.INTEGER_IO.PUT(UNKNOWNS, WORD_NUMBER, 7);
TEXT_IO.PUT_LINE(UNKNOWNS, " ======== UNKNOWN ");
end if;
end if;
if PA_LAST = 0 then
if WORDS_MODE(DO_STEMS_FOR_UNKNOWN) then
if WORDS_MODE(WRITE_OUTPUT_TO_FILE) and then
not WORDS_MODE(WRITE_UNKNOWNS_TO_FILE) then
LIST_NEIGHBORHOOD(OUTPUT, RAW_WORD);
elsif WORDS_MODE(WRITE_OUTPUT_TO_FILE) and then
WORDS_MODE(WRITE_UNKNOWNS_TO_FILE) then
LIST_NEIGHBORHOOD(OUTPUT, RAW_WORD);
LIST_NEIGHBORHOOD(UNKNOWNS, RAW_WORD);
elsif (NAME(CURRENT_INPUT) = NAME(STANDARD_INPUT)) then
LIST_NEIGHBORHOOD(OUTPUT, RAW_WORD);
end if;
end if;
end if;
if PA_LAST = 0 then
if WORDS_MDEV(UPDATE_LOCAL_DICTIONARY) and -- Don't if reading from file
(NAME(CURRENT_INPUT) = NAME(STANDARD_INPUT)) then
UPDATE_LOCAL_DICTIONARY_FILE;
WORD(RAW_WORD, PA, PA_LAST); -- Circular if you dont update!!!!!
end if;
end if;
-- Exit if UNKNOWNS ONLY (but had to do STATS above)
if WORDS_MODE(DO_UNKNOWNS_ONLY) then -- Omit rest of output
return;
end if;
--TEXT_IO.PUT_LINE("PUTting INFLECTIONS");
J := 1;
OSRA := NULL_SRA;
OUTPUT_LOOP:
while DMA(J) /= NULL_DICTIONARY_MNPC_RECORD loop
----!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-- if (J > 1) and then ((DMA(J-1).D_K = PPP) or --!!!!!!!!!!!!!!!!!!!!!!!!
-- (DICTIONARY_FORM(DMA(J).DE) = DICTIONARY_FORM(DMA(J-1).DE))) then --!!!!!!!!!!!!!!!!!!!!!!!!
-- null; --!!!!!!ND mod!!!!!!!!!!!!
-- else --!!!!!!!!!!!!!!!!!!!!!!!!
-- NEW_LINE(OUTPUT); --!!!!!!!!!!!!!!!!!!!!!!!!
-- end if; --!!!!!!!!!!!!!!!!!!!!!!!!
-- --!!!!!!!!!!!!!!!!!!!!!!!!
-- --!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if SRAA(J) /= OSRA then -- Skips one identical SRA
-- no matter what comes next
PUT_INFLECTION_ARRAY_J:
for K in SRAA(J)'RANGE loop
exit when SRAA(J)(K) = NULL_STEM_INFLECTION_RECORD;
PUT_INFLECTION(SRAA(J)(K), DMA(J));
if SRAA(J)(K).STEM(1..3) = "PPL" then
TEXT_IO.PUT_LINE(OUTPUT, HEAD(PPP_MEANING, MM));
end if;
end loop PUT_INFLECTION_ARRAY_J;
OSRA := SRAA(J);
end if;
--TEXT_IO.PUT_LINE("PUTting FORM");
PUTTING_FORM:
begin
if J = 1 or else
DICTIONARY_FORM(DMA(J).DE) /= DICTIONARY_FORM(DMA(J-1).DE) then
-- Put at first chance, skip duplicates
PUT_FORM(SRAA(J)(1), DMA(J));
end if;
end PUTTING_FORM;
--TEXT_IO.PUT_LINE("PUTting MEANING");
PUTTING_MEANING:
begin
if (DMA(J).D_K in GENERAL..UNIQUE) then
if (DMA(J).DE.MEAN /= DMA(J+1).DE.MEAN) then
-- This if handles simple multiple MEAN with same IR and FORM
-- by anticipating duplicates and waiting until change
PUT_MEANING_LINE(SRAA(J)(1), DMA(J));
end if;
else
PUT_MEANING_LINE(SRAA(J)(1), DMA(J));
end if;
end PUTTING_MEANING;
DO_PAUSE:
begin
if I = PA_LAST then
TEXT_IO.NEW_LINE(OUTPUT);
elsif (INTEGER(TEXT_IO.LINE(OUTPUT)) >
SCROLL_LINE_NUMBER + OUTPUT_SCREEN_SIZE) then
PAUSE(OUTPUT);
SCROLL_LINE_NUMBER := INTEGER(TEXT_IO.LINE(OUTPUT));
end if;
end DO_PAUSE;
--TEXT_IO.PUT_LINE("End of OUTPUT_LOOP with J = " & INTEGER'IMAGE(J));
J := J + 1;
end loop OUTPUT_LOOP;
--TEXT_IO.PUT_LINE("Finished OUTPUT_LOOP");
if TRIMMED then
PUT(OUTPUT, '*');
end if;
TEXT_IO.NEW_LINE(OUTPUT);
exception
when others =>
TEXT_IO.PUT_LINE("Unexpected exception in LIST_STEMS processing " & RAW_WORD);
PUT_STAT("EXCEPTION LS at "
& HEAD(INTEGER'IMAGE(LINE_NUMBER), 8) & HEAD(INTEGER'IMAGE(WORD_NUMBER), 4)
& " " & HEAD(W, 20) & " " & PA(I).STEM);
end LIST_STEMS;
procedure LIST_ENTRY(OUTPUT : TEXT_IO.FILE_TYPE;
D_K : DICTIONARY_KIND;
MN : DICT_IO.COUNT) is
DE : DICTIONARY_ENTRY;
begin
DICT_IO.READ(DICT_FILE(D_K), DE, MN);
TEXT_IO.PUT(OUTPUT, "=> ");
--TEXT_IO.PUT_LINE(OUTPUT, DICTIONARY_FORM(DE));
PUT_DICTIONARY_FORM(OUTPUT, D_K, MN, DE);
TEXT_IO.PUT_LINE(OUTPUT,
TRIM(HEAD(DE.MEAN, MM))); -- so it wont line wrap/put CR
end LIST_ENTRY;
procedure UNKNOWN_SEARCH(UNKNOWN : in STRING;
UNKNOWN_COUNT : out DICT_IO.COUNT) is
use STEM_IO;
D_K : constant DICTIONARY_KIND := GENERAL;
J, J1, J2, JJ : STEM_IO.COUNT := 0;
INDEX_ON : constant STRING := UNKNOWN;
INDEX_FIRST, INDEX_LAST : STEM_IO.COUNT := 0;
DS : DICTIONARY_STEM;
FIRST_TRY, SECOND_TRY : BOOLEAN := TRUE;
function FIRST_TWO(W : STRING) return STRING is
-- 'v' could be represented by 'u', like the new Oxford Latin Dictionary
-- Fixes the first two letters of a word/stem which can be done right
S : constant STRING := LOWER_CASE(W);
SS : STRING(W'RANGE) := W;
function UI(C : CHARACTER) return CHARACTER is
begin
if (C = 'v') then
return 'u';
elsif (C = 'V') then
return 'U';
elsif (C = 'j') then
return 'i';
elsif (C = 'J') then
return 'I';
else
return C;
end if;
end UI;
begin
if S'LENGTH = 1 then
SS(S'FIRST) := UI(W(S'FIRST));
else
SS(S'FIRST) := UI(W(S'FIRST));
SS(S'FIRST+1) := UI(W(S'FIRST+1));
end if;
return SS;
end FIRST_TWO;
begin
if DICTIONARY_AVAILABLE(D_K) then
if not IS_OPEN(STEM_FILE(D_K)) then
OPEN(STEM_FILE(D_K), STEM_IO.IN_FILE,
ADD_FILE_NAME_EXTENSION(STEM_FILE_NAME,
DICTIONARY_KIND'IMAGE(D_K)));
end if;
INDEX_FIRST := FIRST_INDEX(FIRST_TWO(INDEX_ON), D_K);
INDEX_LAST := LAST_INDEX(FIRST_TWO(INDEX_ON), D_K);
if INDEX_FIRST > 0 and then INDEX_FIRST <= INDEX_LAST then
J1 := STEM_IO.COUNT(INDEX_FIRST); --######################
J2 := STEM_IO.COUNT(INDEX_LAST);
FIRST_TRY := TRUE;
SECOND_TRY := TRUE;
J := (J1 + J2) / 2;
BINARY_SEARCH:
loop
if (J1 = J2-1) or (J1 = J2) then
if FIRST_TRY then
J := J1;
FIRST_TRY := FALSE;
elsif SECOND_TRY then
J := J2;
SECOND_TRY := FALSE;
else
JJ := J;
exit BINARY_SEARCH;
end if;
end if;
SET_INDEX(STEM_FILE(D_K), STEM_IO.COUNT(J));
READ(STEM_FILE(D_K), DS);
if LTU(LOWER_CASE(DS.STEM), UNKNOWN) then
J1 := J;
J := (J1 + J2) / 2;
elsif GTU(LOWER_CASE(DS.STEM), UNKNOWN) then
J2 := J;
J := (J1 + J2) / 2;
else
for I in reverse J1..J loop
SET_INDEX(STEM_FILE(D_K), STEM_IO.COUNT(I));
READ(STEM_FILE(D_K), DS);
if EQU(LOWER_CASE(DS.STEM), UNKNOWN) then
JJ := I;
else
exit;
end if;
end loop;
for I in J+1..J2 loop
SET_INDEX(STEM_FILE(D_K), STEM_IO.COUNT(I));
READ(STEM_FILE(D_K), DS);
if EQU(LOWER_CASE(DS.STEM), UNKNOWN) then
JJ := I;
else
exit BINARY_SEARCH;
end if;
end loop;
exit BINARY_SEARCH;
end if;
end loop BINARY_SEARCH;
J1 := JJ;
J2 := STEM_IO.COUNT(INDEX_LAST);
end if;
UNKNOWN_COUNT := DS.MNPC;
CLOSE(STEM_FILE(D_K)); --??????
end if;
--TEXT_IO.PUT_LINE("Leaving LIST_NEIGHBORHOOD UNKNOWN_SEARCH");
end UNKNOWN_SEARCH;
procedure LIST_NEIGHBORHOOD(OUTPUT : TEXT_IO.FILE_TYPE;
INPUT_WORD : STRING) is
D_K : constant DICTIONARY_KIND := GENERAL;
DE : DICTIONARY_ENTRY;
UNK_MNPC : DICT_IO.COUNT;
begin
--TEXT_IO.PUT_LINE("Entering LIST_NEIGHBORHOOD");
if (TEXT_IO.NAME(OUTPUT) =
TEXT_IO.NAME(TEXT_IO.STANDARD_OUTPUT)) then
MM := MAX_MEANING_PRINT_SIZE; -- to keep from overflowing screen line
else
MM := MAX_MEANING_SIZE;
end if;
UNKNOWN_SEARCH(HEAD(INPUT_WORD, MAX_STEM_SIZE), UNK_MNPC);
--TEXT_IO.PUT_LINE("UNK_MNPC = " & INTEGER'IMAGE(INTEGER(UNK_MNPC)));
if INTEGER(UNK_MNPC) > 0 then
TEXT_IO.PUT_LINE(OUTPUT,
"---------- Entries in GENEAL Dictionary around the UNKNOWN ----------");
PAUSE(OUTPUT);
for MN in DICT_IO.COUNT(INTEGER(UNK_MNPC)-5)..
DICT_IO.COUNT(INTEGER(UNK_MNPC)+3) loop
LIST_ENTRY(OUTPUT, D_K, MN);
end loop;
end if;
--TEXT_IO.PUT_LINE("Leaving LIST_NEIGHBORHOOD");
end LIST_NEIGHBORHOOD;
end LIST_PACKAGE;
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_885.asm | ljhsiun2/medusa | 9 | 2809 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r8
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0xdc8a, %r8
nop
nop
nop
nop
nop
inc %r9
movl $0x61626364, (%r8)
nop
nop
nop
inc %rbx
lea addresses_UC_ht+0x63cd, %rsi
lea addresses_A_ht+0x1178d, %rdi
nop
nop
nop
nop
sub $8058, %rbx
mov $80, %rcx
rep movsl
nop
nop
cmp $49974, %r8
lea addresses_WC_ht+0xbd61, %rax
cmp %rbx, %rbx
mov $0x6162636465666768, %r8
movq %r8, %xmm7
movups %xmm7, (%rax)
nop
nop
add %rsi, %rsi
lea addresses_A_ht+0x1844d, %r8
nop
nop
nop
cmp %r9, %r9
movw $0x6162, (%r8)
nop
nop
nop
nop
nop
inc %rcx
lea addresses_WT_ht+0x6c61, %rsi
lea addresses_D_ht+0x6bcd, %rdi
add $43127, %rdx
mov $67, %rcx
rep movsw
nop
nop
nop
nop
and $59938, %rbx
lea addresses_D_ht+0x415b, %rbx
nop
inc %rax
mov $0x6162636465666768, %rdx
movq %rdx, (%rbx)
nop
nop
nop
cmp %r9, %r9
lea addresses_A_ht+0x145cd, %rsi
lea addresses_WC_ht+0x13e5d, %rdi
xor %rax, %rax
mov $18, %rcx
rep movsq
nop
nop
nop
nop
nop
and $49287, %rdx
lea addresses_WC_ht+0x136cd, %rax
nop
nop
nop
nop
nop
add %r9, %r9
mov $0x6162636465666768, %rsi
movq %rsi, %xmm7
and $0xffffffffffffffc0, %rax
movaps %xmm7, (%rax)
nop
nop
nop
sub %r8, %r8
lea addresses_UC_ht+0xbcd, %r9
nop
nop
nop
add $2031, %rax
movb $0x61, (%r9)
nop
and %rdx, %rdx
lea addresses_A_ht+0x3dcd, %rax
nop
nop
nop
and %rdi, %rdi
mov $0x6162636465666768, %r8
movq %r8, %xmm1
and $0xffffffffffffffc0, %rax
vmovaps %ymm1, (%rax)
nop
nop
nop
sub %rdx, %rdx
lea addresses_UC_ht+0x1dfcd, %rbx
nop
add $24833, %rdx
mov (%rbx), %ax
nop
nop
add $36099, %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r8
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r8
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_WC+0x13dcd, %rsi
nop
nop
nop
nop
add %r13, %r13
movw $0x5152, (%rsi)
cmp $22247, %rbp
// REPMOV
lea addresses_A+0xcc8d, %rsi
lea addresses_PSE+0x35cd, %rdi
xor %r14, %r14
mov $90, %rcx
rep movsw
nop
nop
nop
and $1116, %rdx
// Store
lea addresses_A+0x854d, %rbp
nop
cmp $44820, %r14
movl $0x51525354, (%rbp)
dec %r8
// Faulty Load
lea addresses_WC+0x13dcd, %rdx
xor %rdi, %rdi
vmovups (%rdx), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %rcx
lea oracles, %rdi
and $0xff, %rcx
shlq $12, %rcx
mov (%rdi,%rcx,1), %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_A'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_PSE'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 7}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6}}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
|
programs/oeis/141/A141534.asm | karttu/loda | 0 | 26620 | ; A141534: Derived from the centered polygonal numbers: start with the first triangular number, then the sum of the first square number and the second triangular number, then the sum of first pentagonal number, the second square number and the third triangular number, and so on and so on...
; 1,4,11,26,55,105,184,301,466,690,985,1364,1841,2431,3150,4015,5044,6256,7671,9310,11195,13349,15796,18561,21670,25150,29029,33336,38101,43355,49130,55459,62376,69916,78115,87010,96639,107041,118256,130325,143290,157194,172081,187996,204985,223095,242374,262871,284636,307720,332175,358054,385411,414301,444780,476905,510734,546326,583741,623040,664285,707539,752866,800331,850000,901940,956219,1012906,1072071,1133785,1198120,1265149,1334946,1407586,1483145,1561700,1643329,1728111,1816126,1907455,2002180,2100384,2202151,2307566,2416715,2529685,2646564,2767441,2892406,3021550,3154965,3292744,3434981,3581771,3733210,3889395,4050424,4216396,4387411,4563570,4744975,4931729,5123936,5321701,5525130,5734330,5949409,6170476,6397641,6631015,6870710,7116839,7369516,7628856,7894975,8167990,8448019,8735181,9029596,9331385,9640670,9957574,10282221,10614736,10955245,11303875,11660754,12026011,12399776,12782180,13173355,13573434,13982551,14400841,14828440,15265485,15712114,16168466,16634681,17110900,17597265,18093919,18601006,19118671,19647060,20186320,20736599,21298046,21870811,22455045,23050900,23658529,24278086,24909726,25553605,26209880,26878709,27560251,28254666,28962115,29682760,30416764,31164291,31925506,32700575,33489665,34292944,35110581,35942746,36789610,37651345,38528124,39420121,40327511,41250470,42189175,43143804,44114536,45101551,46105030,47125155,48162109,49216076,50287241,51375790,52481910,53605789,54747616,55907581,57085875,58282690,59498219,60732656,61986196,63259035,64551370,65863399,67195321,68547336,69919645,71312450,72725954,74160361,75615876,77092705,78591055,80111134,81653151,83217316,84803840,86412935,88044814,89699691,91377781,93079300,94804465,96553494,98326606,100124021,101945960,103792645,105664299,107561146,109483411,111431320,113405100,115404979,117431186,119483951,121563505,123670080,125803909,127965226,130154266,132371265,134616460,136890089,139192391,141523606,143883975,146273740,148693144,151142431,153621846,156131635,158672045,161243324,163845721,166479486,169144870
mov $12,$0
mov $14,$0
add $14,1
lpb $14,1
clr $0,12
mov $0,$12
sub $14,1
sub $0,$14
mov $9,$0
mov $11,$0
add $11,1
lpb $11,1
mov $0,$9
sub $11,1
sub $0,$11
mov $2,$0
bin $2,2
mov $5,$0
add $5,$0
trn $5,5
add $5,$0
add $5,$2
add $5,1
add $10,$5
lpe
add $13,$10
lpe
mov $1,$13
|
Menus/equip_ship_menu.asm | TinfoilAsteroid/EliteNext | 9 | 92860 | <gh_stars>1-10
eqshp_prices_page_marker DB "EquipShipPG63"
eqshp_boiler_text DW $0250,eqship_title
DW $0220,name_expanded
DW $B008,eqship_cash
eqship_title DB "Equip Ship",0
eqship_cash DB "Cash : ",0
txt_eqshp_amount DB "00.0",0
txt_eqshp_quantity DB "999",0
txt_eqshp_cargo DB "999",0
eqshp_cursor DW $0000
eqshp_position equ $1808
eqshp_uom equ $68
eqshp_price equ $88
eqshp_Quantity equ $B0
eqshp_Cargo equ $E0
eqshp_UomOffset equ 46
eqshp_blank_line DB " ",0
eqshp_item_price DS 20
eqshp_cash_position equ $B048
eqshp_cash_amount DS 20
eqshp_cash_UoM DB " Cr ",0
eqshp_selected_row DB 0
eqshp_current_topItem DB 0
eqshp_current_end DB 0
eqship_buffer_rows EQU 128
eqship_buffer_row_len EQU 32
eqship_display_buff_len EQU eqship_buffer_rows * eqship_buffer_row_len
eqship_display_buffer: DS eqship_display_buff_len ; maxium of 128 items can be coded for
eqship_buyable_buffer: DS 128
eqship_buffer_cash_col: EQU 21
eqship_fitted_module: EQU 29
;----------------------------------------------------------------------------------------------------------------------------------
eqshp_highlight_row: ld a,(eqshp_selected_row)
add a,3
ld d,a
ld e,L1InvHighlight
MMUSelectLayer1
call l1_hilight_row
ret
;----------------------------------------------------------------------------------------------------------------------------------
eqshp_lowlight_row ld a,(eqshp_selected_row)
add a,3
ld d,a
ld e,L1InvLowlight
MMUSelectLayer1
call l1_hilight_row
ret
;----------------------------------------------------------------------------------------------------------------------------------
eqshp_DispDEIXtoIY1DP: call eqshp_DispDEIXtoIY
ld (iy+2),0
ld a,(IY+0)
ld (IY+1),a
ld a,"."
ld (IY+0),a
inc IY
inc IY
ret
;----------------------------------------------------------------------------------------------------------------------------------
eqshp_DispDEIXtoIY: ld (.EQSHPclcn32z),ix
ld (.EQSHPclcn32zIX),de
ld ix,.EQSHPclcn32t+36
ld b,9
ld c,0
.EQSHPclcn321: ld a,'0'
or a
.EQSHPclcn322: ld e,(ix+0)
ld d,(ix+1)
ld hl,(.EQSHPclcn32z)
sbc hl,de
ld (.EQSHPclcn32z),hl
ld e,(ix+2)
ld d,(ix+3)
ld hl,(.EQSHPclcn32zIX)
sbc hl,de
ld (.EQSHPclcn32zIX),hl
jr c,.EQSHPclcn325
inc c
inc a
jr .EQSHPclcn322
.EQSHPclcn325: ld e,(ix+0)
ld d,(ix+1)
ld hl,(.EQSHPclcn32z)
add hl,de
ld (.EQSHPclcn32z),hl
ld e,(ix+2)
ld d,(ix+3)
ld hl,(.EQSHPclcn32zIX)
adc hl,de
ld (.EQSHPclcn32zIX),hl
ld de,-4
add ix,de
inc c
dec c
jr z,.EQSHPclcn323
ld (iy+0),a
inc iy
.EQSHPclcn323: djnz .EQSHPclcn321
ld a,(.EQSHPclcn32z)
add A,'0'
ld (iy+0),a
ret
.EQSHPclcn32t dw 1,0, 10,0, 100,0, 1000,0, 10000,0
dw $86a0,1, $4240,$0f, $9680,$98, $e100,$05f5, $ca00,$3b9a
.EQSHPclcn32z ds 2
.EQSHPclcn32zIX ds 2
;----------------------------------------------------------------------------------------------------------------------------------
; "DispHL, writes HL to DE address"
EQSHP_DispHLtoDE: ld bc,-10000
call EQSHP_Num1
ld bc,-1000
call EQSHP_Num1
ld bc,-100
call EQSHP_Num1
ld c,-10
call EQSHP_Num1
ld c,-1
EQSHP_Num1: ld a,'0'-1
.Num2: inc a
add hl,bc
jr c,.Num2
sbc hl,bc
ld (de),a
inc de
ret
;----------------------------------------------------------------------------------------------------------------------------------
EQSHP_DispAtoDE: ld h,0
ld l,a
jp EQSHP_DispHLtoDE
;----------------------------------------------------------------------------------------------------------------------------------
EQSHP_DispPriceAtoDE: ld h,0
ld l,a
ld bc,-100
call .NumLeadBlank1
ld c,-10
call EQSHP_Num1
ld a,'.' ; we could assume preformat but
ld (de),a ; we can optimse that later TODO
inc de ; with just an inc De
ld c,-1
jr EQSHP_Num1
.NumLeadBlank1: ld a,'0'-1
.NumLeadBlank2: inc a
add hl,bc
jr c,.NumLeadBlank2
cp '0'
jr nz,.DontBlank
.Blank: ld a,' '
.DontBlank: sbc hl,bc
ld (de),a
inc de
ret
;----------------------------------------------------------------------------------------------------------------------------------
EQSHP_DispQtyAtoDE: cp 0
jr z,.NoStock
ld h,0
ld l,a
ld bc,-100
call .NumLeadBlank1
.WasLead0: cp ' '
jr nz,.NotHundredsZero
ld c,-10
call .NumLeadBlank1
ld c,-1
jr EQSHP_Num1
.NotHundredsZero: ld c,-10
call EQSHP_Num1
ld c,-1
jr EQSHP_Num1
.NumLeadBlank1: ld a,'0'-1
.NumLeadBlank2: inc a
add hl,bc
jr c,.NumLeadBlank2
cp '0'
jr nz,.DontBlank
.Blank: ld a,' '
.DontBlank: sbc hl,bc
ld (de),a
inc de
ret
.NoStock: ld a,' '
ld (de),a
inc de
ld (de),a
inc de
ld a,'-'
ld (de),a
inc de
ret
;----------------------------------------------------------------------------------------------------------------------------------
EQSHP_print_boiler_text: INCLUDE "Menus/print_boiler_text_inlineInclude.asm"
;----------------------------------------------------------------------------------------------------------------------------------
eqshp_GetCash: ld hl,(Cash+2)
ex de,hl
ld ix,(Cash)
ld iy,eqshp_cash_amount
call eqshp_DispDEIXtoIY1DP
push IY
pop de
ld hl,eqshp_cash_UoM
ld bc,11
ldir
ret
;----------------------------------------------------------------------------------------------------------------------------------
eqshp_DisplayCash: call eqshp_GetCash
ld hl,eqshp_cash_amount
ld de,eqshp_cash_position
MMUSelectLayer1
call l1_print_at
ret
;----------------------------------------------------------------------------------------------------------------------------------
eqshp_expand_word: ld a,(hl)
cp 0
ret z
ld (de),a
inc hl
inc de
jr eqshp_expand_word
; hl = list of words
; de = adress to expand to
eqshp_expand_name: ld a,(hl)
ld b,a
inc hl
ld a,(hl) ; its a 16 bit
dec hl ; move back one for now, need to optimise laters
or b
jr nz,.MoreToDo
; ld (de),a we dont want the null marker now
ret
.MoreToDo: push hl,,de
ld a,(hl) ; bodge for now no optimise
ld e,a
inc hl
ld a,(hl)
ld d,a
ex hl,de ; hl is now Word... address
pop de ; de back to pointer to buffer
.ProcessWord: call eqshp_expand_word
ld a," " ; speculative space
ld (de),a
inc de
pop hl ; get string pointer back
inc hl
inc hl ; on to next word
jr eqshp_expand_name
eqshp_buffer_list: ld hl,eqship_display_buffer ; hl - target buffer
ld a,1 ; so it will still skip them on printing
ld de, eqship_display_buff_len
call memfill_dma ; full buffer with ASCII 1 (unprintable character)
ld hl,eqship_display_buffer+eqship_buffer_row_len-1
ld de,eqship_buffer_row_len
ld b,ShipEquipTableSize
xor a
.EoLLoop: ld (hl),a ; fix all buffer lines with a null
add hl,de
djnz .EoLLoop
ld b,ShipEquipTableSize ; CurrentGameMaxEquipment
ld ix,ShipEquipmentList ; ix = equipment master table
ld iy,eqship_display_buffer ; iy = target buffer
ld c,0 ; Current Row
.ProcessRow: ld a,(ix+1) ; get can buy
cp $FF ; if its $FF then do not display
jp nz,.BufferItem
.DoNotDisplay: ld de,ShipEquipTableRowLen ; mov eto next equipment list, 7 = row length
add ix,de
djnz .ProcessRow
jp .DoneProcess
.BufferItem: push iy,,ix,,bc
ld a,(ix+0) ; get can buy
ld hl,eqship_buyable_buffer ;
ld e,c
ld d,0 ;
add hl,de ;
ld (hl),a ; set buyable to 0
ld hl,ShipEquipNameTable ; look up equipment name
ld d,EquipNameTableRowLen ; ship equip name row length
ld e,c
mul
add hl,de ; hl = dword list of work pointers
ld de,iy ; de = 0 column at current display buffer row
push bc
call eqshp_expand_name ; expand name
pop bc
ld de,eqship_buffer_cash_col ; move buffer column to 20
add iy,de
push iy
ld a,(ix+4)
ld e,a
ld a,(ix+5)
ld d,a ; de = price
ld ix,de
;push de
;pop ix
ld de,0 ; deix = price
call eqshp_DispDEIXtoIY ; print it to pos IY
ld a," "
ld (IY+0),a
ld (IY+1),a
ld (IY+2),a
pop iy
call .RightJustify
pop iy,,ix,,bc
.CheckFitted: ld a,(ix+7)
ld (iy+eqship_fitted_module),a
ld de,eqship_buffer_row_len
add iy,de ; now iy = start of next column
ld de,ShipEquipTableRowLen
add ix,de
inc c
djnz .ProcessRow
.DoneProcess: ld a,c
ld (eqshp_current_end),a
ret
.RightJustify: call .RightJustify2
.RightJustify2: call .RightJustify3
.RightJustify3: ld a,(iy+3)
cp " "
call z,.ShuffleRight
ret
.ShuffleRight: push iy
pop hl
ld a,3
add hl,a
ld a,(iy+2)
ld (hl),a
dec hl
ld a,(iy+1)
ld (hl),a
dec hl
ld a,(iy+0)
ld (hl),a
dec hl
ld a," "
ld (hl),a
ret
draw_eqship_items: MMUSelectLayer1
call l1_cls
ld b,3
ld hl,eqshp_boiler_text
call EQSHP_print_boiler_text
call eqshp_DisplayCash
ld a,(eqshp_current_topItem)
ld d,eqship_buffer_row_len
ld e,a
mul
ld hl,eqship_display_buffer
add hl,de
ld a,(eqshp_current_topItem)
ld b,a
ld a,(eqshp_current_end)
sub b
JumpIfALTNusng 18, .FillScreen
.JustWindowing: ld b,18
jr .ReadyToPrint
.FillScreen: ld b,a ; the mumber of rows to display
.ReadyToPrint: ld de,eqshp_position
.DrawARow: push de,,hl,,bc ; "l1 PrintAt, pixel row, whole char col, DE = yx, HL = message Addr"
call l1_print_at:
pop hl,,bc ; get mesage addr back and move down one line
ld de,eqship_buffer_row_len
add hl,de
pop de ; get output row back
ld a,8
add a,d
ld d,a
djnz .DrawARow
ret
draw_eqshp_menu: InitNoDoubleBuffer
ld a,$20
ld (MenuIdMax),a
.SetData: ld a,(Galaxy)
MMUSelectGalaxyA
call galaxy_planet_data
call galaxy_equip_market
ld bc,(PresentSystemX)
call galaxy_name_at_bc
call galaxy_planet_data
xor a
ld (eqshp_current_topItem),a
call eqshp_buffer_list
.Drawbox: ld bc,$0101
ld de,$BEFD
ld a,$C0
MMUSelectLayer2
call l2_draw_box
ld bc,$0A01
ld de,$FEC0
call l2_draw_horz_line
.StaticText: ld a,(Galaxy)
MMUSelectGalaxyA
ld a,25
call expandTokenToString
call GetDigramGalaxySeed
call draw_eqship_items
.InitialHighlight: xor a
ld (eqshp_selected_row),a ; assume on row zero
call eqshp_highlight_row
.DisCash: call eqshp_DisplayCash
ret
;----------------------------------------------------------------------------------------------------------------------------------
eqip_refesh_buffer: call eqshp_buffer_list
ld a,(eqshp_selected_row) ; get revised list length
ld b,a
ld a,(eqshp_current_topItem) ; get current top of screen
ld c,a
add b ; a = top + selected row
ld hl,eqshp_current_end
CallIfAGTENusng (hl), .NewListShorter ; if a > new list len then rebuild
jp .RedrawList
.NewListShorter: push bc
call eqshp_lowlight_row
pop bc
ld a,(eqshp_current_end) ; b = end of list
sub c ; minus current top
ld (eqshp_selected_row),a
.RedrawList: call eqshp_highlight_row
call draw_eqship_items
ret
;----------------------------------------------------------------------------------------------------------------------------------
; Handles all the input whilst in the market menu
loop_eqshp_menu: ld a,c_Pressed_CursorUp
call is_key_pressed
call z,eqshp_UpPressed
ld a,c_Pressed_CursorDown
call is_key_pressed
call z,eqshp_DownPressed
ld a,c_Pressed_RollLeft
call is_key_pressed
call z,eqshp_LeftPressed
ld a,c_Pressed_RollRight
call is_key_pressed
call z,eqshp_RightPressed
ret
;----------------------------------------------------------------------------------------------------------------------------------
eqshp_UpPressed: ld a,(eqshp_selected_row)
cp 0
jr z,.check_scroll_up
call eqshp_lowlight_row
ld hl,eqshp_selected_row
dec (hl)
call eqshp_highlight_row
ret
.check_scroll_up: ld a,(eqshp_current_topItem)
cp 0
ret z
dec a ; chjange later to buffering step back 1
ld (eqshp_current_topItem),a
call draw_eqship_items
ret
;----------------------------------------------------------------------------------------------------------------------------------
eqshp_DownPressed: ld a,(eqshp_current_end)
ld b,a ; This check is if the current list is < one screen
dec b
ld a,(eqshp_selected_row)
cp b
ret z
cp 17
jr z, .check_scroll_down
call eqshp_lowlight_row
ld hl,eqshp_selected_row
inc (hl)
call eqshp_highlight_row
ret
.check_scroll_down: ld b,a
ld a,(eqshp_current_topItem)
add b
inc a
ld hl,eqshp_current_end
ReturnIfAGTEusng (hl)
.can_scroll_down: ld hl,eqshp_current_topItem
inc (hl)
call draw_eqship_items
ret
;----------------------------------------------------------------------------------------------------------------------------------
eqshp_LeftPressed: ld a,(Galaxy)
MMUSelectGalaxyA
ld ix,ShipEquipmentList
.IsItFuel: ld a,(eqshp_current_topItem) ; Can't refund fuel
ld b,a
ld a,(eqshp_selected_row)
add b
cp 0
ret z
.FuelNotSelected: ld c,a
.FindInTable: ld d,ShipEquipTableRowLen
ld e,a
mul
add ix,de
ld a,(ix+7)
cp "-"
ret z
.CheckIfMissle: ld a,c
cp EQ_MISSILE
jr z,.RefundMissle
.RefundItemCash: ld e,(ix+4)
ld d,(ix+5)
push hl,,bc
call addDEtoCash ; refund laser value
pop hl,,bc
ld a,"-"
ld (ix+7),a
ld hl,EquipmentFitted
ld a,c ; get back current laser ref
add hl,a
ld (hl),EquipmentItemNotFitted; remove laser from equipment
call eqip_refesh_buffer
ld a,(ix+8)
cp $FF
ret z
.ItsALaser ld hl,LaserType ; clear out respective current laser
ld b,a
ld a,(ix+9)
add hl,a
ld (hl),$FF ; $FF = not fitted
ret
.RefundMissle ld e,(ix+4)
ld d,(ix+5)
push hl,,bc
call addDEtoCash ; refund laser value
pop hl,,bc
ld a,(ix+7)
dec a
cp "0"
jr nz,.NotAllSold
.AllSold: ld a,"-"
.NotAllSold: ld (ix+7),a
call eqip_refesh_buffer
ret
;----------------------------------------------------------------------------------------------------------------------------------
eqshp_RightPressed: ld a,(Galaxy)
MMUSelectGalaxyA
ld ix,ShipEquipmentList
ld a,(eqshp_current_topItem)
ld b,a
ld a,(eqshp_selected_row)
add a,b
cp EQ_MISSILE
jr nz,.NotAMissileBuy
.ItsAMissile: ex af,af'
ld a,"4"
ld (.CompareCheck+1),a
ex af,af'
jp .FindInTable
.NotAMissileBuy: ex af,af'
ld a,"*"
ld (.CompareCheck+1),a
ex af,af'
.FindInTable: ld d,ShipEquipTableRowLen
ld e,a
mul
add ix,de
ld a,(ix+7)
.CompareCheck: cp "*"; not true for missles astyou can buy 1 to 4
ret z
.Purchasable: ld b,a
ld a,(ix+6)
cp EQ_MISSILE
jr nz,.NotMissleMax
.MissleQuanity: ld hl,NbrMissiles
ld a,b
cp (hl)
ret z
.NotMissleMax: ld c,a
ld a,(ix+1)
cp $FF
ret z
.CheckCash: ld hl,(Cash+2)
ld a,h
or l
jr nz,.MoreThanRequired
ld hl,(Cash)
ld a,h
cp 0
jr nz,.MoreThanRequired
ld a,(ix+2)
cp l
jr nc,.MoreThanRequired
ret ; Insufficient Funds
.MoreThanRequired: ld a,(ix+6)
cp 0
jr z,.MaxFuelOut
cp 1
jr z,.AddMissle
JumpIfAGTENusng EQ_FRONT_PULSE,.AddLaser
.AddNormalItem: ld hl,EquipmentFitted
add hl,a
ld (hl),EquipmentItemFitted
ld a,"*"
jp .AddedItem
.MaxFuelOut: MaxFuelMacro
ld a,"*"
jp .AddedItem
.AddMissle: ld hl,NbrMissiles
inc (hl)
ld a,(hl)
add "0"
jp .AddedItem
.AddLaser: ld a,(ix+8) ; Get if its a laser, $FF = no laser
cp $FF
jr nz,.BuyLaser
.LargeCargoBay: ;TODO
.RefundExistingLaser: ld c,a ; retain current laser nbr
ld hl,ShipEquipmentList
ld d,ShipEquipTableRowLen
ld e,a
mul
add hl,de ; now we have the row for the current laser
ld a,4
add hl,a
ld a,(hl)
ld e,a
inc hl
ld a,(hl)
ld d,a
push hl,,bc
call addDEtoCash ; refund laser value
pop hl,,bc
ld a,2
add hl,a
ld a,"-"
ld (hl),a ; clear on ship equipment
ld hl,EquipmentFitted
ld a,c ; get back current laser ref
add hl,a
ld (hl),EquipmentItemNotFitted ; remove laser from equipment
.BuyLaser: ld hl,EquipmentFitted
ld a,(ix+6)
add hl,a
ld (hl),EquipmentItemFitted
ld a,(ix+9) ; get laser position
ld hl,LaserType
add hl,a
ld a,(ix+8) ; get type
ld (hl),a
ld a,"*"
.AddedItem ld (ix+7),a
ld e,(ix+4)
ld d,(ix+5)
call subDEfromCash
call eqip_refesh_buffer
ret |
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_409.asm | ljhsiun2/medusa | 9 | 242368 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r14
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x10823, %rsi
lea addresses_UC_ht+0x12253, %rdi
cmp $40600, %r12
mov $20, %rcx
rep movsl
nop
inc %r10
lea addresses_D_ht+0x3513, %rdx
nop
nop
nop
nop
nop
xor %r14, %r14
movb (%rdx), %r12b
nop
nop
nop
nop
mfence
lea addresses_D_ht+0x1cee3, %rsi
lea addresses_WT_ht+0xe023, %rdi
nop
nop
nop
inc %r13
mov $94, %rcx
rep movsl
nop
nop
nop
sub $49957, %rcx
lea addresses_D_ht+0x2db, %rsi
cmp %rdx, %rdx
vmovups (%rsi), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %rdi
and %r10, %r10
lea addresses_normal_ht+0xa3a3, %r13
nop
xor %r10, %r10
and $0xffffffffffffffc0, %r13
movaps (%r13), %xmm0
vpextrq $1, %xmm0, %rcx
nop
nop
nop
nop
cmp $61501, %r10
lea addresses_UC_ht+0x1d823, %rdx
nop
nop
nop
nop
xor $44528, %rcx
movl $0x61626364, (%rdx)
nop
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_D_ht+0x16023, %rdi
nop
nop
add %r12, %r12
movw $0x6162, (%rdi)
nop
xor %r14, %r14
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r14
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r14
push %r8
push %rcx
// Faulty Load
lea addresses_PSE+0x18823, %r13
nop
nop
nop
dec %r8
vmovups (%r13), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $0, %xmm6, %r14
lea oracles, %r11
and $0xff, %r14
shlq $12, %r14
mov (%r11,%r14,1), %r14
pop %rcx
pop %r8
pop %r14
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 6, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2}}
{'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
*/
|
os.asm | picosonic/bbm | 4 | 6994 | <reponame>picosonic/bbm<filename>os.asm
; OS function vectors
USERV = &0200
BRKV = &0202
IRQ1V = &0204
IRQ2V = &0206
CLIV = &0208
BYTEV = &020A
WORDV = &020C
WRCHV = &020E
RDCHV = &0210
FILEV = &0212
ARGSV = &0214
BGETV = &0216
BPUTV = &0218
GBPBV = &021A
FINDV = &021C
FSCV = &021E
EVNTV = &0220
UPTV = &0222
NETV = &0224
VDUV = &0226
KEYV = &0228
INSBV = &022A
REMVB = &022C
CNPV = &022E
IND1V = &0230
IND2V = &0232
IND3V = &0234
; OS memory locations
ZP_ECONET_WORKSPACE = &90
LANGUAGE_WORKSPACE = &400
SOUND_WORKSPACE = &800
NMI_WORKSPACE = &D00
; OS function call locations
OSFSC = &F1B1 ; filing system control (entry via FSCV)
OSWRSC = &FFB3 ; write byte to screen
OSRDSC = &FFB9 ; read byte from screen
OSNULL = &FFA6 ; blank function handler (just an RTS)
VDUCHR = &FFBC ; VDU character output
OSEVEN = &FFBF ; generate an EVENT
GSINIT = &FFC2 ; initialise OS string
GSREAD = &FFC5 ; read character from input stream
NVRDCH = &FFC8 ; non vectored OSRDCH
NVWRCH = &FFCB ; non vectored OSWRCH
OSFIND = &FFCE ; open or close a file
OSGBPB = &FFD1 ; transfer block to or from a file (get block / put block)
OSBPUT = &FFD4 ; save a byte to file
OSBGET = &FFD7 ; get a byte from file
OSARGS = &FFDA ; read or write file attributes
OSFILE = &FFDD ; read or write a complete file
OSRDCH = &FFE0 ; get a byte from current input stream
OSASCI = &FFE3 ; output a byte to VDU stream expanding CR (&0D) to LF/CR (&0A,&0D)
OSNEWL = &FFE7 ; output a LF/CR to VDU stream
OSWRCH = &FFEE ; output a character to the VDU stream
OSWORD = &FFF1 ; perform operation using parameter table
OSBYTE = &FFF4 ; perform operation on single byte
OSCLI = &FFF7 ; pass string to command line interpreter
; System hardware
FREDBASE = &FC00 ; memory mapped hardware
JIMBASE = &FD00 ; 64K paged memory
SHEILABASE = &FE00 ; system peripherals
; 6845 CRTC
CRTC00 = SHEILABASE+&00 ; address register (5 bit)
CRTC01 = SHEILABASE+&01 ; data register
; 6850 ACIA
ACIA08 = SHEILABASE+&08 ; Control / Status
ACIA09 = SHEILABASE+&09 ; Data
; Serial ULA
; Video ULA
ULA_VID20 = SHEILABASE+&20 ; video control register
ULA_VID21 = SHEILABASE+&21 ; colour palette
ULA_VID22 = SHEILABASE+&22 ; border control
ULA_VID23 = SHEILABASE+&23 ; 24-bit palette selection
; Paged ROM selector
PAGEROM = SHEILABASE+&30 ; paged ROM select (4 bit)
; 6522 System VIA
SYSVIA_REGB = SHEILABASE+&40
SYSVIA_REGA = SHEILABASE+&41
SYSVIA_DDRB = SHEILABASE+&42
SYSVIA_DDRA = SHEILABASE+&43
; 6522 User/Printer VIA
USERVIA_REGB = SHEILABASE+&60 ; User port
USERVIA_REGA = SHEILABASE+&61 ; Printer port
USERVIA_DDRB = SHEILABASE+&62 ; Data direction register B
USERVIA_DDRA = SHEILABASE+&63 ; Data direction register A
USERVIA_T2CL = SHEILABASE+&68 ; T2 low order counter
USERVIA_T2CH = SHEILABASE+&69 ; T2 high order counter
USERVIA_SR = SHEILABASE+&6A ; Shift register
USERVIA_ACR = SHEILABASE+&6B ; Auxilary control register
USERVIA_PCR = SHEILABASE+&6C ; Peripheral control register
USERVIA_IFR = SHEILABASE+&6D ; Interrupt flag register
USERVIA_IER = SHEILABASE+&6E ; Interrupt enable register
; 8271 FDC
FDC_STATUS = SHEILABASE+&80
FDC_RESULT = SHEILABASE+&81
FDC_COMMAND = SHEILABASE+&80
FDC_PARAM = SHEILABASE+&81
FDC_RESET = SHEILABASE+&82
FDC_DATA = SHEILABASE+&84
; 68B54 Econet
; uPD7002 ADC
; Tube ULA
; Other constants
MODE0BASE = &3000
MODE1BASE = &3000
MODE2BASE = &3000
MODE3BASE = &4000
MODE4BASE = &5800
MODE5BASE = &5800
MODE6BASE = &6000
MODE7BASE = &7C00
ROMSBASE = &8000
; Zero page availibility
; &00 to &6F - available to machine code programs not using BASIC
; &70 to &8F - reserved by BASIC for the user
; Colours in mode 1
;
; Default logical colours :
;
; 0 black (0)
; 1 red (1)
; 2 yellow (3)
; 3 white (7)
;
; Actual colours :
;
; 0 black
; 1 red
; 2 green
; 3 yellow
; 4 blue
; 5 magenta
; 6 cyan
; 7 white |
src/Coirc/Format.agda | larrytheliquid/coirc | 0 | 12462 | module Coirc.Format where
open import Data.Empty
open import Data.Unit
open import Data.Bool
open import Data.Nat
open import Data.Char
open import Data.String
open import Data.List
open import Data.Sum
open import Data.Product
open import Coirc
infixr 3 _∣_
infixr 1 _>>_ _>>-_ _>>=_
within? : Char → ℕ → ℕ → Bool
within? c start end = toBool lower ∧ toBool higher
where
target = toNat c
lower = suc target ∸ start
higher = suc end ∸ target
toBool : ℕ → Bool
toBool zero = false
toBool (suc _) = true
data DarRange (start end : ℕ) : Bool → Set where
dar : (c : Char) → DarRange start end (within? c start end)
data Dar : ℕ → Set where
dar : (c : Char) → Dar (toNat c)
data U : Set where
CHAR : U
DAR : ℕ → U
DAR-RANGE : ℕ → ℕ → U
`*! `*sp `*crlf : U
El : U → Set
El CHAR = Char
El (DAR n) = Dar n
El (DAR-RANGE n m) = DarRange n m true
El `*! = String
El `*sp = String
El `*crlf = String
mutual
data Format : Set where
Fail End : Format
As : Event → Format
Base : U → Format
Skip Or And : Format → Format → Format
Use : (f : Format) → (⟦ f ⟧ → Format) → Format
⟦_⟧ : Format → Set
⟦ Fail ⟧ = ⊥
⟦ End ⟧ = ⊤
⟦ As _ ⟧ = Event
⟦ Base u ⟧ = El u
⟦ Skip _ f ⟧ = ⟦ f ⟧
⟦ Or f₁ f₂ ⟧ = ⟦ f₁ ⟧ ⊎ ⟦ f₂ ⟧
⟦ And f₁ f₂ ⟧ = ⟦ f₁ ⟧ × ⟦ f₂ ⟧
⟦ Use f₁ f₂ ⟧ = Σ ⟦ f₁ ⟧ λ x → ⟦ f₂ x ⟧
_>>_ : Format → Format → Format
f₁ >> f₂ = Skip f₁ f₂
_>>-_ : Format → Format → Format
x >>- y = And x y
_>>=_ : (f : Format) → (⟦ f ⟧ → Format) → Format
x >>= y = Use x y
_∣_ : Format → Format → Format
x ∣ y = Or x y
char : Char → Format
char c = Base (DAR (toNat c))
str : String → Format
str s = chars (toList s)
where
chars : List Char → Format
chars [] = End
chars (x ∷ xs) = char x >>- chars xs
DIGIT = Base (DAR-RANGE (toNat '0') (toNat '9'))
cl = char ':'
sp = char ' '
cr = char '\r'
lf = char '\n'
crlf = cr >>- lf
prefix = cl >> Base `*sp
Notice : Format
Notice =
prefix >>
sp >>
str "NOTICE" >>
sp >> char '*' >> sp >>
Base `*crlf >> -- text
crlf >>
As notice
NumericReply : Format
NumericReply =
prefix >>
sp >>
(DIGIT >>- DIGIT >>- DIGIT) >>
sp >>
Base `*sp >> -- target
sp >>
Base `*crlf >> -- text
crlf >>
As numeric
Mode : Format
Mode =
prefix >>
sp >>
str "MODE" >>
sp >>
Base `*sp >> -- nickname
sp >>
Base `*crlf >> -- modes
crlf >>
As mode
Ping : Format
Ping =
str "PING" >>
sp >>
Base `*crlf >> -- server
crlf >>
As ping
Privmsg : Format
Privmsg =
cl >>
Base `*! >>= λ source →
Base `*sp >>
sp >>
str "PRIVMSG" >>
sp >>
Base `*sp >> -- target
sp >>
cl >>
Base `*crlf >>= λ text →
crlf >>
As (privmsg source text)
|
src/stars/tests/tests/mmio_test.asm | kevintmcdonnell/stars | 9 | 92716 | <reponame>kevintmcdonnell/stars
.data
pumpkin: .ascii " )\\\n"
.ascii " .'`--`'.\n"
.ascii "/ ^ ^ \\\n"
.ascii "\\ \\/\\/\\/ /\n"
.asciiz " '------' "
.text
main:
li $a1, 0xffff0000 # base addr of the mmio
li $t0, 0xffff0fa0 # upper addr
la $t1, pumpkin
li $t3, 0 # row
li $t4, 0 # col
li $t5, 80
loop1:
lbu $t2, 0($t1)
beqz $t2, exit
li $t6, '\n'
bne $t6, $t2, next
addi $t3, $t3, 1
li $t4, 0
addi $t1, $t1, 1
b loop1
next:
mul $t7, $t5, $t3
add $t7, $t7, $t4
li $t6, 2
mul $t7, $t7, $t6
add $t7, $t7, $a1
sb $t2, 0($t7)
li $t2, 0x3d
sb $t2, 1($t7)
addi $t4, $t4, 1
addi $t1, $t1, 1
b loop1
exit:
la $a0, pumpkin
li $v0, 4
syscall
li $v0, 5
syscall
li $v0, 10
syscall |
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1579.asm | ljhsiun2/medusa | 9 | 101669 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x9705, %rsi
clflush (%rsi)
nop
nop
nop
dec %r9
vmovups (%rsi), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %r14
nop
nop
nop
inc %r10
lea addresses_A_ht+0xc85, %rcx
nop
nop
sub $56629, %rax
mov (%rcx), %r14w
nop
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_A_ht+0x1b485, %rsi
lea addresses_UC_ht+0x15385, %rdi
clflush (%rdi)
nop
nop
nop
nop
inc %r13
mov $88, %rcx
rep movsb
nop
nop
nop
add $1916, %rsi
lea addresses_D_ht+0x1a585, %rcx
inc %r10
mov $0x6162636465666768, %r9
movq %r9, %xmm5
vmovups %ymm5, (%rcx)
nop
inc %rdi
lea addresses_WT_ht+0xe545, %r10
and $64168, %rsi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm2
vmovups %ymm2, (%r10)
nop
nop
nop
nop
inc %rax
lea addresses_WT_ht+0x16685, %r14
sub %rdi, %rdi
movb $0x61, (%r14)
nop
nop
nop
dec %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r15
push %rcx
push %rdi
// Faulty Load
lea addresses_WT+0x1cc85, %r13
nop
nop
nop
nop
nop
cmp $60463, %r10
vmovups (%r13), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $1, %xmm7, %rdi
lea oracles, %r15
and $0xff, %rdi
shlq $12, %rdi
mov (%r15,%rdi,1), %rdi
pop %rdi
pop %rcx
pop %r15
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
|
ee/ptr/base.asm | olifink/smsqe | 0 | 83515 | <filename>ee/ptr/base.asm
; PTR Base
include 'dev8_mac_text'
include 'dev8_mac_config02'
section base
xref pt_start
lea pt_conf,a5 ; point to config info
bra.s pt_start
section config
xref.l pt_vers
mkcfhead {QPTR},{pt_vers}
mkcfitem 'PT_Q',code,0,pt_nqimi,,,\
{Do you wish to ignore the QIMI interface},0,N,{No},$ff,Y,{Yes}
mkcfend
pt_conf
pt_nqimi dc.b 0
dc.b 0,0,0
end
|
examples/kernel/drivers/io/hid/encoder/encoder.asm | rostislav-nikitin/socOS | 1 | 176546 | .cseg
.org 0x00
rcall main_thread
; include drivers interrupts
;.include "../../../../../../lib/kernel/drivers/{driver_name}_int.asm"
; include drivers definitions
.include "../../../../../../src/kernel/kernel_def.asm"
;.include "../../../../../../src/kernel/drivers/{driver_name}_def.asm"
.include "../../../../../../src/kernel/drivers/device_def.asm"
.include "../../../../../../src/kernel/drivers/io/device_io_def.asm"
.include "../../../../../../src/kernel/drivers/io/out_bit_def.asm"
.include "../../../../../../src/kernel/drivers/io/hid/led_def.asm"
.include "../../../../../../src/kernel/drivers/io/hid/encoder_def.asm"
;.include components data segments
;.include "../../../../../../lib/kernel/thread_dseg.asm"
; custom data & descriptors
.dseg
led1: .BYTE SZ_ST_LED
led2: .BYTE SZ_ST_LED
encoder1: .BYTE SZ_ST_ENCODER
; main thread
.cseg
; skip interrupts vector
.org 0x14
; include components code segments
.include "../../../../../../src/extensions/delay_cseg.asm"
.include "../../../../../../src/kernel/kernel_cseg.asm"
;.include "../../../../../../src/kernel/drivers/{driver_name}_cseg.asm"
.include "../../../../../../src/kernel/drivers/device_cseg.asm"
.include "../../../../../../src/kernel/drivers/io/device_io_cseg.asm"
.include "../../../../../../src/kernel/drivers/io/out_bit_cseg.asm"
.include "../../../../../../src/kernel/drivers/io/hid/led_cseg.asm"
.include "../../../../../../src/kernel/drivers/io/hid/encoder_cseg.asm"
main_thread:
; stack initialization
m_init_stack
; init leds
m_led_init led1, DDRC, PORTC, (1 << BIT4)
m_led_init led2, DDRC, PORTC, (1 << BIT5)
; init encoder
m_encoder_init encoder1, DDRC, PINC, PORTC, (1 << BIT1), (1 << BIT2), encoder1_on_turn_handler
main_thread_loop:
m_encoder_handle_io encoder1, r16
rjmp main_thread_loop
encoder1_on_turn_handler:
encoder1_on_turn_handler_check_cw:
cpi YL, ENCODER_DIRECTION_CW
brne encoder1_on_turn_handler_check_ccw
m_led_on led1
m_led_off led2
rjmp encoder1_on_turn_handler_end
encoder1_on_turn_handler_check_ccw:
cpi YL, ENCODER_DIRECTION_CCW
m_led_off led1
m_led_on led2
encoder1_on_turn_handler_end:
ret
|
MSDOS/Virus.MSDOS.Unknown.doors.asm | fengjixuchui/Family | 3 | 240336 | title DOORS.ASM - Switch Color/Mono Screens On Keyboard Request
;
VECTORS segment at 0h ; 8088 / 80286 Interrupt Vector Area
org 9h*4 ; IBM PC Keyboard is Int 9H
KB_INT_VECTOR label dword ; Double word label
;
VECTORS ends
;
ROM_BIOS_DATA segment at 40h ; Low Memory "BIOS" Parameters
;
org 10h ; Location of EQUIP_FLAG
EQUIP_FLAG dw ? ; Contains video settings
; in bits 4 and 5
;
org 17h ; Location of KB_FLAG
KB_FLAG db ? ; Contains Alt (bit 3) &
; Right Shift (bit 0) States
ROM_BIOS_DATA ends
;
; Initialization Routine
;
CODE_SEG segment
assume cs:CODE_SEG
org 100h ; COM program format
BEGIN: jmp SWAP_VECTORS ; Initialize vectors and attach to DOS
;
ROM_KB_INT dd 0 ; Double word to save address of
; ROM-BIOS keyboard interrupt
; DOORS_INT intercepts the keyboard interrupt and switches
; screens if [Alt]-[Right Shift] combination is pressed
;
DOORS_INT proc near
assume ds:nothing
push ds ; Push all affected registers
push es
push ax
push bx
push cx
push dx
push si
push di
;
pushf ; Push Flags for fake interrupt call
call ROM_KB_INT ; to BIOS program to read keyboard
;
assume ds:ROM_BIOS_DATA ; Define data segment to read
mov ax,ROM_BIOS_DATA ; keyboard flag & equipment flag
mov ds,ax
mov al,KB_FLAG ; Get keyboard flag
and al,09h ; Isolate [Alt] + [Right Shift]
cmp al,09h ; Are they pressed?
jne RETURN ; No, quit
;
; [Alt] + [Right Shift] are pressed -- Continue processing
; Check on video mode - quit if not monochrome, color 80x25 or BW 80x25
;
mov ah,15 ; Call Func 15 of Int 10h to
int 10h ; get video state of the PC
cmp al,7 ; Is screen monochrome?
je SCREEN_OKAY ; Yes, go switch screens
cmp al,3 ; Is screen color text?
jbe CHECK_40_OR_80 ; Yes, go check for 80 or 40 char
jmp RETURN ; Screen is in graphics mode, quit
CHECK_40_or_80:
cmp al,1 ; Is screen 40-character?
jbe RETURN ; Yes, quit
;
SCREEN_OKAY:
;
; Save the current cursor position
;
mov ah,3 ; Call Func 3 of Int 10H
mov bh,0 ; to read cursor position
int 10h ; (page zero for color screen)
;
; Screen switch routine - Establish calling argument (AL) for Int 10h
;
mov bx,EQUIP_FLAG ; Current equipment flag to BX
mov cx,bx ; Make a copy of it in CX
and cx,30h ; Extract screen information
xor bx,cx ; Erase current screen information in BX
or bx,20h ; Set BX to color 80x25
mov al,3 ; Set AL for color 80x25 in Int 10h
cmp cx,30h ; Is current mono?
je SET_MODE ; Yes, switch to color
or bx,30h ; No, set BX for monochrome
mov al,7 ; Set AL for monochrome in Int 10h
SET_MODE:
mov EQUIP_FLAG,bx ; Write BX to equipment flag
xor ah,ah ; Use Func 0 of Int 10h to
int 10h ; change screen parameters
;
; Restore Cursor
;
mov ah,2 ; Use Func 2 of Int 10h to restore
mov bh,0 ; cursor on new screen (position in DX)
int 10h
;
; After screens are switched, set DS and ES registers to move screen data
;
mov ax,0b000h ; Load ES with Mono Segment
mov es,ax
mov ax,0b800h ; Load DS with Color Segment
mov ds,ax
cmp cx,30h ; Did we switch from mono?
jne COPY_THE_SCREEN ; Yes, move data from mono to color
push ds ; No, swap ES and DS to move data
push es ; from color to mono
pop ds
pop es
COPY_THE_SCREEN:
xor di,di ; Start at zero offsets
xor si,si
mov cx,2000 ; 2000 chars + attrs per screen
cld ; Make sure move is 'forward'
rep movsw ; Move Words with string instruction
;
RETURN:
pop di ; Restore saved registers
pop si
pop dx
pop cx
pop bx
pop ax
pop es
pop ds
iret ; Return to system
DOORS_INT endp
;
; This procedure initializes the new keyboard interupt vectors
;
SWAP_VECTORS proc near
assume ds:VECTORS
mov ax,VECTORS ; Set up the data
mov ds,ax ; segment for vectors
cli ; Disable interrupts
mov ax,word ptr KB_INT_VECTOR ; Store addresses
mov word ptr ROM_KB_INT,ax ; of BIOS program
mov ax,word ptr KB_INT_VECTOR[2]
mov word ptr ROM_KB_INT[2],ax
mov word ptr KB_INT_VECTOR, offset DOORS_INT ; Substitute Our
mov word ptr KB_INT_VECTOR[2],cs ; Program
sti ; Enable interrupts
mov dx,offset SWAP_VECTORS ; End of new resident
; program
int 27h ; Terminate resident
SWAP_VECTORS endp
CODE_SEG ends
end BEGIN
;
|
a51test/(23)RL_A.a51 | Aimini/51cpu | 0 | 90662 | MOV A,#9
START:
RL A
SJMP START |
z80sbcFiles/source/monitor.asm | roberts7531/z80Computer | 0 | 103642 | <filename>z80sbcFiles/source/monitor.asm
;==================================================================================
; Contents of this file are copyright Grant Searle
; HEX routines from <NAME>.
;
; You have permission to use this for NON COMMERCIAL USE ONLY
; If you wish to use it elsewhere, please include an acknowledgement to myself.
;
; http://searle.hostei.com/grant/index.html
;
; eMail: <EMAIL>
;
; If the above don't work, please perform an Internet search to see if I have
; updated the web page hosting service.
;
;==================================================================================
;------------------------------------------------------------------------------
;
; Z80 Monitor Rom
;
;------------------------------------------------------------------------------
; General Equates
;------------------------------------------------------------------------------
CR .EQU 0DH
LF .EQU 0AH
ESC .EQU 1BH
CTRLC .EQU 03H
CLS .EQU 0CH
; CF registers
CF_DATA .EQU $10
CF_FEATURES .EQU $11
CF_ERROR .EQU $11
CF_SECCOUNT .EQU $12
CF_SECTOR .EQU $13
CF_CYL_LOW .EQU $14
CF_CYL_HI .EQU $15
CF_HEAD .EQU $16
CF_STATUS .EQU $17
CF_COMMAND .EQU $17
CF_LBA0 .EQU $13
CF_LBA1 .EQU $14
CF_LBA2 .EQU $15
CF_LBA3 .EQU $16
;CF Features
CF_8BIT .EQU 1
CF_NOCACHE .EQU 082H
;CF Commands
CF_READ_SEC .EQU 020H
CF_WRITE_SEC .EQU 030H
CF_SET_FEAT .EQU 0EFH
loadAddr .EQU 0D000h ; CP/M load address
numSecs .EQU 24 ; Number of 512 sectors to be loaded
;BASIC cold and warm entry points
BASCLD .EQU $2000
BASWRM .EQU $2003
SER_BUFSIZE .EQU 40H
SER_FULLSIZE .EQU 30H
SER_EMPTYSIZE .EQU 5
RTS_HIGH .EQU 0E8H
RTS_LOW .EQU 0EAH
SIOA_D .EQU $00
SIOA_C .EQU $02
SIOB_D .EQU $01
SIOB_C .EQU $03
.ORG $4000
serABuf .ds SER_BUFSIZE
serAInPtr .ds 2
serARdPtr .ds 2
serABufUsed .ds 1
serBBuf .ds SER_BUFSIZE
serBInPtr .ds 2
serBRdPtr .ds 2
serBBufUsed .ds 1
primaryIO .ds 1
secNo .ds 1
dmaAddr .ds 2
stackSpace .ds 32
STACK .EQU $ ; Stack top
;------------------------------------------------------------------------------
; START OF MONITOR ROM
;------------------------------------------------------------------------------
MON .ORG $0000 ; MONITOR ROM RESET VECTOR
;------------------------------------------------------------------------------
; Reset
;------------------------------------------------------------------------------
RST00 DI ;Disable INTerrupts
JP INIT ;Initialize Hardware and go
NOP
NOP
NOP
NOP
;------------------------------------------------------------------------------
; TX a character over RS232 wait for TXDONE first.
;------------------------------------------------------------------------------
RST08 JP conout
NOP
NOP
NOP
NOP
NOP
;------------------------------------------------------------------------------
; RX a character from buffer wait until char ready.
;------------------------------------------------------------------------------
RST10 JP conin
NOP
NOP
NOP
NOP
NOP
;------------------------------------------------------------------------------
; Check input buffer status
;------------------------------------------------------------------------------
RST18 JP CKINCHAR
;------------------------------------------------------------------------------
; SIO Vector = 0x60
;------------------------------------------------------------------------------
.ORG $0060
.DW serialInt
;------------------------------------------------------------------------------
; Serial interrupt handlers
; Same interrupt called if either of the inputs receives a character
; so need to check the status of each SIO input.
;------------------------------------------------------------------------------
serialInt: PUSH AF
PUSH HL
; Check if there is a char in channel A
; If not, there is a char in channel B
SUB A
OUT (SIOA_C),A
IN A,(SIOA_C) ; Status byte D2=TX Buff Empty, D0=RX char ready
RRCA ; Rotates RX status into Carry Flag,
JR NC, serialIntB
serialIntA:
LD HL,(serAInPtr)
INC HL
LD A,L
CP (serABuf+SER_BUFSIZE) & $FF
JR NZ, notAWrap
LD HL,serABuf
notAWrap:
LD (serAInPtr),HL
IN A,(SIOA_D)
LD (HL),A
LD A,(serABufUsed)
INC A
LD (serABufUsed),A
CP SER_FULLSIZE
JR C,rtsA0
LD A,$05
OUT (SIOA_C),A
LD A,RTS_HIGH
OUT (SIOA_C),A
rtsA0:
POP HL
POP AF
EI
RETI
serialIntB:
LD HL,(serBInPtr)
INC HL
LD A,L
CP (serBBuf+SER_BUFSIZE) & $FF
JR NZ, notBWrap
LD HL,serBBuf
notBWrap:
LD (serBInPtr),HL
IN A,(SIOB_D)
LD (HL),A
LD A,(serBBufUsed)
INC A
LD (serBBufUsed),A
CP SER_FULLSIZE
JR C,rtsB0
LD A,$05
OUT (SIOB_C),A
LD A,RTS_HIGH
OUT (SIOB_C),A
rtsB0:
POP HL
POP AF
EI
RETI
;------------------------------------------------------------------------------
; Console input routine
; Use the "primaryIO" flag to determine which input port to monitor.
;------------------------------------------------------------------------------
conin:
PUSH HL
LD A,(primaryIO)
CP 0
JR NZ,coninB
coninA:
waitForCharA:
LD A,(serABufUsed)
CP $00
JR Z, waitForCharA
LD HL,(serARdPtr)
INC HL
LD A,L
CP (serABuf+SER_BUFSIZE) & $FF
JR NZ, notRdWrapA
LD HL,serABuf
notRdWrapA:
DI
LD (serARdPtr),HL
LD A,(serABufUsed)
DEC A
LD (serABufUsed),A
CP SER_EMPTYSIZE
JR NC,rtsA1
LD A,$05
OUT (SIOA_C),A
LD A,RTS_LOW
OUT (SIOA_C),A
rtsA1:
LD A,(HL)
EI
POP HL
RET ; Char ready in A
coninB:
waitForCharB:
LD A,(serBBufUsed)
CP $00
JR Z, waitForCharB
LD HL,(serBRdPtr)
INC HL
LD A,L
CP (serBBuf+SER_BUFSIZE) & $FF
JR NZ, notRdWrapB
LD HL,serBBuf
notRdWrapB:
DI
LD (serBRdPtr),HL
LD A,(serBBufUsed)
DEC A
LD (serBBufUsed),A
CP SER_EMPTYSIZE
JR NC,rtsB1
LD A,$05
OUT (SIOB_C),A
LD A,RTS_LOW
OUT (SIOB_C),A
rtsB1:
LD A,(HL)
EI
POP HL
RET ; Char ready in A
;------------------------------------------------------------------------------
; Console output routine
; Use the "primaryIO" flag to determine which output port to send a character.
;------------------------------------------------------------------------------
conout: PUSH AF ; Store character
LD A,(primaryIO)
CP 0
JR NZ,conoutB1
JR conoutA1
conoutA:
PUSH AF
conoutA1: CALL CKSIOA ; See if SIO channel A is finished transmitting
JR Z,conoutA1 ; Loop until SIO flag signals ready
POP AF ; RETrieve character
OUT (SIOA_D),A ; OUTput the character
RET
conoutB:
PUSH AF
conoutB1: CALL CKSIOB ; See if SIO channel B is finished transmitting
JR Z,conoutB1 ; Loop until SIO flag signals ready
POP AF ; RETrieve character
OUT (SIOB_D),A ; OUTput the character
RET
;------------------------------------------------------------------------------
; I/O status check routine
; Use the "primaryIO" flag to determine which port to check.
;------------------------------------------------------------------------------
CKSIOA
SUB A
OUT (SIOA_C),A
IN A,(SIOA_C) ; Status byte D2=TX Buff Empty, D0=RX char ready
RRCA ; Rotates RX status into Carry Flag,
BIT 1,A ; Set Zero flag if still transmitting character
RET
CKSIOB
SUB A
OUT (SIOB_C),A
IN A,(SIOB_C) ; Status byte D2=TX Buff Empty, D0=RX char ready
RRCA ; Rotates RX status into Carry Flag,
BIT 1,A ; Set Zero flag if still transmitting character
RET
;------------------------------------------------------------------------------
; Check if there is a character in the input buffer
; Use the "primaryIO" flag to determine which port to check.
;------------------------------------------------------------------------------
CKINCHAR
LD A,(primaryIO)
CP 0
JR NZ,ckincharB
ckincharA:
LD A,(serABufUsed)
CP $0
RET
ckincharB:
LD A,(serBBufUsed)
CP $0
RET
;------------------------------------------------------------------------------
; Filtered Character I/O
;------------------------------------------------------------------------------
RDCHR RST 10H
CP LF
JR Z,RDCHR ; Ignore LF
CP ESC
JR NZ,RDCHR1
LD A,CTRLC ; Change ESC to CTRL-C
RDCHR1 RET
WRCHR CP CR
JR Z,WRCRLF ; When CR, write CRLF
CP CLS
JR Z,WR ; Allow write of "CLS"
CP ' ' ; Don't write out any other control codes
JR C,NOWR ; ie. < space
WR RST 08H
NOWR RET
WRCRLF LD A,CR
RST 08H
LD A,LF
RST 08H
LD A,CR
RET
;------------------------------------------------------------------------------
; Initialise hardware and start main loop
;------------------------------------------------------------------------------
INIT LD SP,STACK ; Set the Stack Pointer
LD HL,serABuf
LD (serAInPtr),HL
LD (serARdPtr),HL
LD HL,serBBuf
LD (serBInPtr),HL
LD (serBRdPtr),HL
xor a ;0 to accumulator
LD (serABufUsed),A
LD (serBBufUsed),A
; Initialise SIO
LD A,$00
OUT (SIOA_C),A
LD A,$18
OUT (SIOA_C),A
LD A,$04
OUT (SIOA_C),A
LD A,$C4
OUT (SIOA_C),A
LD A,$01
OUT (SIOA_C),A
LD A,$18
OUT (SIOA_C),A
LD A,$03
OUT (SIOA_C),A
LD A,$E1
OUT (SIOA_C),A
LD A,$05
OUT (SIOA_C),A
LD A,RTS_LOW
OUT (SIOA_C),A
LD A,$00
OUT (SIOB_C),A
LD A,$18
OUT (SIOB_C),A
LD A,$04
OUT (SIOB_C),A
LD A,$C4
OUT (SIOB_C),A
LD A,$01
OUT (SIOB_C),A
LD A,$18
OUT (SIOB_C),A
LD A,$02
OUT (SIOB_C),A
LD A,$60 ; INTERRUPT VECTOR ADDRESS
OUT (SIOB_C),A
LD A,$03
OUT (SIOB_C),A
LD A,$E1
OUT (SIOB_C),A
LD A,$05
OUT (SIOB_C),A
LD A,RTS_LOW
OUT (SIOB_C),A
; Interrupt vector in page 0
LD A,$00
LD I,A
IM 2
EI
; Display the "Press space to start" message on both consoles
LD A,$00
LD (primaryIO),A
LD HL,INITTXT
CALL PRINT
LD A,$01
LD (primaryIO),A
LD HL,INITTXT
CALL PRINT
; Wait until space is in one of the buffers to determine the active console
waitForSpace:
CALL ckincharA
jr Z,notInA
LD A,$00
LD (primaryIO),A
CALL conin
CP ' '
JP NZ, waitForSpace
JR spacePressed
notInA:
CALL ckincharB
JR Z,waitForSpace
LD A,$01
LD (primaryIO),A
CALL conin
CP ' '
JP NZ, waitForSpace
JR spacePressed
spacePressed:
; Clear message on both consoles
LD A,$0C
CALL conoutA
CALL conoutB
; primaryIO is now set to the channel where SPACE was pressed
CALL TXCRLF ; TXCRLF
LD HL,SIGNON ; Print SIGNON message
CALL PRINT
;------------------------------------------------------------------------------
; Monitor command loop
;------------------------------------------------------------------------------
MAIN LD HL,MAIN ; Save entry point for Monitor
PUSH HL ; This is the return address
MAIN0 CALL TXCRLF ; Entry point for Monitor, Normal
LD A,'>' ; Get a ">"
RST 08H ; print it
MAIN1 CALL RDCHR ; Get a character from the input port
CP ' ' ; <spc> or less?
JR C,MAIN1 ; Go back
CP ':' ; ":"?
JP Z,LOAD ; First character of a HEX load
CALL WRCHR ; Print char on console
CP '?'
JP Z,HELP
AND $5F ; Make character uppercase
CP 'R'
JP Z,RST00
CP 'B'
JP Z,BASIC
CP 'G'
JP Z,GOTO
CP 'X'
JP Z,CPMLOAD
LD A,'?' ; Get a "?"
RST 08H ; Print it
JR MAIN0
;------------------------------------------------------------------------------
; Print string of characters to Serial A until byte=$00, WITH CR, LF
;------------------------------------------------------------------------------
PRINT LD A,(HL) ; Get character
OR A ; Is it $00 ?
RET Z ; Then RETurn on terminator
RST 08H ; Print it
INC HL ; Next Character
JR PRINT ; Continue until $00
TXCRLF LD A,$0D ;
RST 08H ; Print character
LD A,$0A ;
RST 08H ; Print character
RET
;------------------------------------------------------------------------------
; Get a character from the console, must be $20-$7F to be valid (no control characters)
; <Ctrl-c> and <SPACE> breaks with the Zero Flag set
;------------------------------------------------------------------------------
GETCHR CALL RDCHR ; RX a Character
CP $03 ; <ctrl-c> User break?
RET Z
CP $20 ; <space> or better?
JR C,GETCHR ; Do it again until we get something usable
RET
;------------------------------------------------------------------------------
; Gets two ASCII characters from the console (assuming them to be HEX 0-9 A-F)
; Moves them into B and C, converts them into a byte value in A and updates a
; Checksum value in E
;------------------------------------------------------------------------------
GET2 CALL GETCHR ; Get us a valid character to work with
LD B,A ; Load it in B
CALL GETCHR ; Get us another character
LD C,A ; load it in C
CALL BCTOA ; Convert ASCII to byte
LD C,A ; Build the checksum
LD A,E
SUB C ; The checksum should always equal zero when checked
LD E,A ; Save the checksum back where it came from
LD A,C ; Retrieve the byte and go back
RET
;------------------------------------------------------------------------------
; Gets four Hex characters from the console, converts them to values in HL
;------------------------------------------------------------------------------
GETHL LD HL,$0000 ; Gets xxxx but sets Carry Flag on any Terminator
CALL ECHO ; RX a Character
CP $0D ; <CR>?
JR NZ,GETX2 ; other key
SETCY SCF ; Set Carry Flag
RET ; and Return to main program
;------------------------------------------------------------------------------
; This routine converts last four hex characters (0-9 A-F) user types into a value in HL
; Rotates the old out and replaces with the new until the user hits a terminating character
;------------------------------------------------------------------------------
GETX LD HL,$0000 ; CLEAR HL
GETX1 CALL ECHO ; RX a character from the console
CP $0D ; <CR>
RET Z ; quit
CP $2C ; <,> can be used to safely quit for multiple entries
RET Z ; (Like filling both DE and HL from the user)
GETX2 CP $03 ; Likewise, a <ctrl-C> will terminate clean, too, but
JR Z,SETCY ; It also sets the Carry Flag for testing later.
ADD HL,HL ; Otherwise, rotate the previous low nibble to high
ADD HL,HL ; rather slowly
ADD HL,HL ; until we get to the top
ADD HL,HL ; and then we can continue on.
SUB $30 ; Convert ASCII to byte value
CP $0A ; Are we in the 0-9 range?
JR C,GETX3 ; Then we just need to sub $30, but if it is A-F
SUB $07 ; We need to take off 7 more to get the value down to
GETX3 AND $0F ; to the right hex value
ADD A,L ; Add the high nibble to the low
LD L,A ; Move the byte back to A
JR GETX1 ; and go back for next character until he terminates
;------------------------------------------------------------------------------
; Convert ASCII characters in B C registers to a byte value in A
;------------------------------------------------------------------------------
BCTOA LD A,B ; Move the hi order byte to A
SUB $30 ; Take it down from Ascii
CP $0A ; Are we in the 0-9 range here?
JR C,BCTOA1 ; If so, get the next nybble
SUB $07 ; But if A-F, take it down some more
BCTOA1 RLCA ; Rotate the nybble from low to high
RLCA ; One bit at a time
RLCA ; Until we
RLCA ; Get there with it
LD B,A ; Save the converted high nybble
LD A,C ; Now get the low order byte
SUB $30 ; Convert it down from Ascii
CP $0A ; 0-9 at this point?
JR C,BCTOA2 ; Good enough then, but
SUB $07 ; Take off 7 more if it's A-F
BCTOA2 ADD A,B ; Add in the high order nybble
RET
;------------------------------------------------------------------------------
; Get a character and echo it back to the user
;------------------------------------------------------------------------------
ECHO CALL RDCHR
CALL WRCHR
RET
;------------------------------------------------------------------------------
; GOTO command
;------------------------------------------------------------------------------
GOTO CALL GETHL ; ENTRY POINT FOR <G>oto addr. Get XXXX from user.
RET C ; Return if invalid
PUSH HL
RET ; Jump to HL address value
;------------------------------------------------------------------------------
; LOAD Intel Hex format file from the console.
; [Intel Hex Format is:
; 1) Colon (Frame 0)
; 2) Record Length Field (Frames 1 and 2)
; 3) Load Address Field (Frames 3,4,5,6)
; 4) Record Type Field (Frames 7 and 8)
; 5) Data Field (Frames 9 to 9+2*(Record Length)-1
; 6) Checksum Field - Sum of all byte values from Record Length to and
; including Checksum Field = 0 ]
;------------------------------------------------------------------------------
LOAD LD E,0 ; First two Characters is the Record Length Field
CALL GET2 ; Get us two characters into BC, convert it to a byte <A>
LD D,A ; Load Record Length count into D
CALL GET2 ; Get next two characters, Memory Load Address <H>
LD H,A ; put value in H register.
CALL GET2 ; Get next two characters, Memory Load Address <L>
LD L,A ; put value in L register.
CALL GET2 ; Get next two characters, Record Field Type
CP $01 ; Record Field Type 00 is Data, 01 is End of File
JR NZ,LOAD2 ; Must be the end of that file
CALL GET2 ; Get next two characters, assemble into byte
LD A,E ; Recall the Checksum byte
AND A ; Is it Zero?
JR Z,LOAD00 ; Print footer reached message
JR LOADERR ; Checksums don't add up, Error out
LOAD2 LD A,D ; Retrieve line character counter
AND A ; Are we done with this line?
JR Z,LOAD3 ; Get two more ascii characters, build a byte and checksum
CALL GET2 ; Get next two chars, convert to byte in A, checksum it
LD (HL),A ; Move converted byte in A to memory location
INC HL ; Increment pointer to next memory location
LD A,'.' ; Print out a "." for every byte loaded
RST 08H ;
DEC D ; Decrement line character counter
JR LOAD2 ; and keep loading into memory until line is complete
LOAD3 CALL GET2 ; Get two chars, build byte and checksum
LD A,E ; Check the checksum value
AND A ; Is it zero?
RET Z
LOADERR LD HL,CKSUMERR ; Get "Checksum Error" message
CALL PRINT ; Print Message from (HL) and terminate the load
RET
LOAD00 LD HL,LDETXT ; Print load complete message
CALL PRINT
RET
;------------------------------------------------------------------------------
; Start BASIC command
;------------------------------------------------------------------------------
BASIC
LD HL,BASTXT
CALL PRINT
CALL GETCHR
RET Z ; Cancel if CTRL-C
AND $5F ; uppercase
CP 'C'
JP Z,BASCLD
CP 'W'
JP Z,BASWRM
RET
;------------------------------------------------------------------------------
; Display Help command
;------------------------------------------------------------------------------
HELP LD HL,HLPTXT ; Print Help message
CALL PRINT
RET
;------------------------------------------------------------------------------
; CP/M load command
;------------------------------------------------------------------------------
CPMLOAD
LD HL,CPMTXT
CALL PRINT
CALL GETCHR
RET Z ; Cancel if CTRL-C
AND $5F ; uppercase
CP 'Y'
JP Z,CPMLOAD2
RET
CPMTXT
.BYTE $0D,$0A
.TEXT "Boot CP/M?"
.BYTE $00
CPMTXT2
.BYTE $0D,$0A
.TEXT "Loading CP/M..."
.BYTE $0D,$0A,$00
CPMLOAD2
LD HL,CPMTXT2
CALL PRINT
CALL cfWait
LD A,CF_8BIT ; Set IDE to be 8bit
OUT (CF_FEATURES),A
LD A,CF_SET_FEAT
OUT (CF_COMMAND),A
CALL cfWait
LD A,CF_NOCACHE ; No write cache
OUT (CF_FEATURES),A
LD A,CF_SET_FEAT
OUT (CF_COMMAND),A
LD B,numSecs
LD A,0
LD (secNo),A
LD HL,loadAddr
LD (dmaAddr),HL
processSectors:
CALL cfWait
LD A,(secNo)
OUT (CF_LBA0),A
LD A,0
OUT (CF_LBA1),A
OUT (CF_LBA2),A
LD a,0E0H
OUT (CF_LBA3),A
LD A,1
OUT (CF_SECCOUNT),A
call read
LD DE,0200H
LD HL,(dmaAddr)
ADD HL,DE
LD (dmaAddr),HL
LD A,(secNo)
INC A
LD (secNo),A
djnz processSectors
; Start CP/M using entry at top of BIOS
; The current active console stream ID is pushed onto the stack
; to allow the CBIOS to pick it up
; 0 = SIO A, 1 = SIO B
ld A,(primaryIO)
PUSH AF
ld HL,($FFFE)
jp (HL)
;------------------------------------------------------------------------------
; Read physical sector from host
read:
PUSH AF
PUSH BC
PUSH HL
CALL cfWait
LD A,CF_READ_SEC
OUT (CF_COMMAND),A
CALL cfWait
LD c,4
LD HL,(dmaAddr)
rd4secs:
LD b,128
rdByte:
nop
nop
in A,(CF_DATA)
LD (HL),A
iNC HL
dec b
JR NZ, rdByte
dec c
JR NZ,rd4secs
POP HL
POP BC
POP AF
RET
; Wait for disk to be ready (busy=0,ready=1)
cfWait:
PUSH AF
cfWait1:
in A,(CF_STATUS)
AND 080H
cp 080H
JR Z,cfWait1
POP AF
RET
;------------------------------------------------------------------------------
SIGNON .BYTE "Z80 SBC Boot ROM 1.1"
.BYTE " by <NAME>"
.BYTE $0D,$0A
.BYTE "Type ? for options"
.BYTE $0D,$0A,$00
BASTXT
.BYTE $0D,$0A
.TEXT "Cold or Warm ?"
.BYTE $0D,$0A,$00
CKSUMERR .BYTE "Checksum error"
.BYTE $0D,$0A,$00
INITTXT
.BYTE $0C
.TEXT "Press [SPACE] to activate console"
.BYTE $0D,$0A, $00
LDETXT
.TEXT "Load complete."
.BYTE $0D,$0A, $00
HLPTXT
.BYTE $0D,$0A
.TEXT "R - Reset"
.BYTE $0D,$0A
.TEXT "BC or BW - ROM BASIC Cold or Warm"
.BYTE $0D,$0A
.TEXT "X - Boot CP/M (load $D000-$FFFF from disk)"
.BYTE $0D,$0A
.TEXT ":nnnnnn... - Load Intel-Hex file record"
.BYTE $0D,$0A
.BYTE $00
;------------------------------------------------------------------------------
FINIS .END
|
iterm3-new.applescript | mkrogh/9to5 | 1 | 1978 | <filename>iterm3-new.applescript
tell application "iTerm"
set new_term to (create window with default profile)
tell new_term
select
end tell
end tell |
src/Data/Vec/Any/Membership/Propositional/Properties.agda | tizmd/agda-vector-any | 0 | 8487 | module Data.Vec.Any.Membership.Propositional.Properties where
open import Algebra
open import Data.Vec as Vec
open import Data.Vec.Any
open import Data.Vec.Any.Membership.Propositional
open import Data.Vec.Any.Properties
import Data.Vec.Any.Membership.Properties as Membershipᵖ
open import Function
open import Function.Inverse as Inv using (_↔_)
import Function.Related as Related
open import Function.Related.TypeIsomorphisms
open import Relation.Binary.PropositionalEquality as P
import Relation.Binary.Sigma.Pointwise as Σ
open import Relation.Unary using (_⟨×⟩_)
open import Data.Product
private
module ×⊎ {k ℓ} = CommutativeSemiring (×⊎-CommutativeSemiring k ℓ)
-- map
module _ {a b} {A : Set a} {B : Set b} {f : A → B} where
∈′-map⁺ : ∀ {n x}{xs : Vec A n} → x ∈′ xs → f x ∈′ Vec.map f xs
∈′-map⁺ = Membershipᵖ.∈′-map⁺ (P.setoid _) (P.setoid _) (P.cong f)
∈′-map⁻ : ∀ {n y}{xs : Vec A n} → y ∈′ Vec.map f xs → ∃ λ x → x ∈′ xs × y ≡ f x
∈′-map⁻ = Membershipᵖ.∈′-map⁻ (P.setoid _) (P.setoid _)
map-∈′↔ : ∀ {n y}{xs : Vec A n} →
(∃ λ x → x ∈′ xs × y ≡ f x) ↔ y ∈′ Vec.map f xs
map-∈′↔ {n}{y}{xs} =
(∃ λ x → x ∈′ xs × y ≡ f x) ↔⟨ Any↔ ⟩
Any (λ x → y ≡ f x) xs ↔⟨ map↔ ⟩
y ∈′ Vec.map f xs ∎
where open Related.EquationalReasoning
|
src/Dijkstra/EitherD/Syntax.agda | LaudateCorpus1/bft-consensus-agda | 0 | 15163 | {- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2021, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
module Dijkstra.EitherD.Syntax where
open import Dijkstra.EitherD
open import Dijkstra.EitherLike
open import Dijkstra.Syntax
open import Haskell.Prelude
private
variable
E : Set
A B C : Set
-- From this instance declaration, we get _<$>_, pure, and _<*>_ also.
instance
Monad-EitherD : ∀ {E : Set} → Monad (EitherD E)
Monad.return Monad-EitherD = EitherD-return
Monad._>>=_ Monad-EitherD = EitherD-bind
-- These instance declarations give us variant conditional operations that we
-- can define to play nice with `EitherD-weakestPre`
instance
EitherD-MonadIfD : MonadIfD{ℓ₃ = ℓ0} (EitherD E)
MonadIfD.monad EitherD-MonadIfD = Monad-EitherD
MonadIfD.ifD‖ EitherD-MonadIfD = EitherD-if
EitherD-MonadMaybeD : MonadMaybeD (EitherD E)
MonadMaybeD.monad EitherD-MonadMaybeD = Monad-EitherD
MonadMaybeD.maybeD EitherD-MonadMaybeD = EitherD-maybe
EitherD-MonadEitherD : MonadEitherD (EitherD E)
MonadEitherD.monad EitherD-MonadEitherD = Monad-EitherD
MonadEitherD.eitherD EitherD-MonadEitherD = EitherD-either
-- `EitherD` is Either-like
instance
EitherD-EitherLike : EitherLike EitherD
EitherLike.fromEither EitherD-EitherLike (Left a) = EitherD-bail a
EitherLike.fromEither EitherD-EitherLike (Right b) = EitherD-return b
EitherLike.toEither EitherD-EitherLike = EitherD-run
|
src/gen-commands-database.adb | Letractively/ada-gen | 0 | 30213 | -----------------------------------------------------------------------
-- gen-commands-database -- Database creation from application model
-- Copyright (C) 2011, 2012 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with GNAT.Command_Line;
with GNAT.Expect;
with GNAT.OS_Lib;
with Ada.Text_IO;
with Ada.Strings.Fixed;
with Ada.IO_Exceptions;
with Ada.Directories;
with Ada.Exceptions;
with Util.Strings;
with Util.Files;
with Util.Log.Loggers;
with ADO.Drivers.Connections;
with ADO.Sessions.Factory;
with ADO.Statements;
with ADO.Queries;
with ADO.Parameters;
with System;
with Gen.Database.Model;
package body Gen.Commands.Database is
use GNAT.Command_Line;
use Util.Log;
Log : constant Loggers.Logger := Loggers.Create ("Gen.Commands.Database");
-- Check if the database with the given name exists.
function Has_Database (DB : in ADO.Sessions.Session'Class;
Name : in String) return Boolean;
-- Check if the database with the given name has some tables.
function Has_Tables (DB : in ADO.Sessions.Session'Class;
Name : in String) return Boolean;
-- Expect filter to print the command output/error
procedure Command_Output (Descriptor : in GNAT.Expect.Process_Descriptor'Class;
Data : in String;
Closure : in System.Address);
-- Execute the external command <b>Name</b> with the arguments in <b>Args</b>
-- and send the content of the file <b>Input</b> to that command.
procedure Execute_Command (Name : in String;
Args : in GNAT.OS_Lib.Argument_List;
Input : in String);
-- Create the MySQL tables in the database. The tables are created by launching
-- the external command 'mysql' and using the create-xxx-mysql.sql generated scripts.
procedure Create_Mysql_Tables (Name : in String;
Model : in String;
Config : in ADO.Drivers.Connections.Configuration;
Generator : in out Gen.Generator.Handler);
-- Create the database identified by the given name.
procedure Create_Database (DB : in ADO.Sessions.Master_Session;
Name : in String);
-- Create the user and grant him access to the database.
procedure Create_User_Grant (DB : in ADO.Sessions.Master_Session;
Name : in String;
User : in String;
Password : in String);
-- ------------------------------
-- Check if the database with the given name exists.
-- ------------------------------
function Has_Database (DB : in ADO.Sessions.Session'Class;
Name : in String) return Boolean is
Query : ADO.Queries.Context;
Stmt : ADO.Statements.Query_Statement;
begin
Query.Set_Query (Gen.Database.Model.Query_Database_List);
Stmt := DB.Create_Statement (Query);
Stmt.Execute;
while Stmt.Has_Elements loop
declare
D : constant String := Stmt.Get_String (0);
begin
if Name = D then
return True;
end if;
end;
Stmt.Next;
end loop;
return False;
end Has_Database;
-- ------------------------------
-- Check if the database with the given name has some tables.
-- ------------------------------
function Has_Tables (DB : in ADO.Sessions.Session'Class;
Name : in String) return Boolean is
Query : ADO.Queries.Context;
Stmt : ADO.Statements.Query_Statement;
begin
Query.Set_Query (Gen.Database.Model.Query_Table_List);
Stmt := DB.Create_Statement (Query);
Stmt.Bind_Param ("name", ADO.Parameters.Token (Name));
Stmt.Execute;
return Stmt.Has_Elements;
end Has_Tables;
-- ------------------------------
-- Create the database identified by the given name.
-- ------------------------------
procedure Create_Database (DB : in ADO.Sessions.Master_Session;
Name : in String) is
use Ada.Strings.Unbounded;
Query : ADO.Queries.Context;
Stmt : ADO.Statements.Query_Statement;
begin
Log.Info ("Creating database '{0}'", Name);
Query.Set_Query (Gen.Database.Model.Query_Create_Database);
Stmt := DB.Create_Statement (Query);
Stmt.Bind_Param ("name", ADO.Parameters.Token (Name));
Stmt.Execute;
end Create_Database;
-- ------------------------------
-- Create the user and grant him access to the database.
-- ------------------------------
procedure Create_User_Grant (DB : in ADO.Sessions.Master_Session;
Name : in String;
User : in String;
Password : in String) is
use Ada.Strings.Unbounded;
Query : ADO.Queries.Context;
Stmt : ADO.Statements.Query_Statement;
begin
Log.Info ("Granting access for user '{0}' to database '{1}'", User, Name);
if Password'Length > 0 then
Query.Set_Query (Gen.Database.Model.Query_Create_User_With_Password);
else
Query.Set_Query (Gen.Database.Model.Query_Create_User_No_Password);
end if;
Stmt := DB.Create_Statement (Query);
Stmt.Bind_Param ("name", ADO.Parameters.Token (Name));
Stmt.Bind_Param ("user", ADO.Parameters.Token (User));
if Password'Length > 0 then
Stmt.Bind_Param ("password", Password);
end if;
Stmt.Execute;
Query.Set_Query (Gen.Database.Model.Query_Flush_Privileges);
Stmt := DB.Create_Statement (Query);
Stmt.Execute;
end Create_User_Grant;
-- ------------------------------
-- Expect filter to print the command output/error
-- ------------------------------
procedure Command_Output (Descriptor : in GNAT.Expect.Process_Descriptor'Class;
Data : in String;
Closure : in System.Address) is
pragma Unreferenced (Descriptor, Closure);
begin
Log.Error ("{0}", Data);
end Command_Output;
-- ------------------------------
-- Execute the external command <b>Name</b> with the arguments in <b>Args</b>
-- and send the content of the file <b>Input</b> to that command.
-- ------------------------------
procedure Execute_Command (Name : in String;
Args : in GNAT.OS_Lib.Argument_List;
Input : in String) is
Proc : GNAT.Expect.Process_Descriptor;
Status : Integer;
Func : constant GNAT.Expect.Filter_Function := Command_Output'Access;
Result : GNAT.Expect.Expect_Match;
Content : Ada.Strings.Unbounded.Unbounded_String;
begin
Util.Files.Read_File (Path => Input, Into => Content);
GNAT.Expect.Non_Blocking_Spawn (Descriptor => Proc,
Command => Name,
Args => Args,
Buffer_Size => 4096,
Err_To_Out => True);
GNAT.Expect.Add_Filter (Descriptor => Proc,
Filter => Func,
Filter_On => GNAT.Expect.Output);
GNAT.Expect.Send (Descriptor => Proc,
Str => Ada.Strings.Unbounded.To_String (Content),
Add_LF => False,
Empty_Buffer => False);
GNAT.Expect.Expect (Proc, Result, ".*");
GNAT.Expect.Close (Descriptor => Proc,
Status => Status);
if Status = 0 then
Log.Info ("Database schema created successfully.");
else
Log.Error ("Error while creating the database schema.");
end if;
exception
when Ada.IO_Exceptions.Name_Error =>
Log.Error ("Cannot read {0}", Input);
end Execute_Command;
-- ------------------------------
-- Create the MySQL tables in the database. The tables are created by launching
-- the external command 'mysql' and using the create-xxx-mysql.sql generated scripts.
-- ------------------------------
procedure Create_Mysql_Tables (Name : in String;
Model : in String;
Config : in ADO.Drivers.Connections.Configuration;
Generator : in out Gen.Generator.Handler) is
Database : constant String := Config.Get_Database;
Username : constant String := Config.Get_Property ("user");
Password : constant String := Config.Get_Property ("password");
Dir : constant String := Util.Files.Compose (Model, "mysql");
File : constant String := Util.Files.Compose (Dir, "create-" & Name & "-mysql.sql");
begin
Log.Info ("Creating database tables using schema '{0}'", File);
if not Ada.Directories.Exists (File) then
Generator.Error ("SQL file '{0}' does not exist.", File);
Generator.Error ("Please, run the following command: dynamo generate db");
return;
end if;
if Password'Length > 0 then
declare
Args : GNAT.OS_Lib.Argument_List (1 .. 3);
begin
Args (1) := new String '("--user=" & Username);
Args (2) := new String '("--password=" & Password);
Args (3) := new String '(Database);
Execute_Command ("mysql", Args, File);
end;
else
declare
Args : GNAT.OS_Lib.Argument_List (1 .. 2);
begin
Args (1) := new String '("--user=" & Username);
Args (2) := new String '(Database);
Execute_Command ("mysql", Args, File);
end;
end if;
end Create_Mysql_Tables;
-- ------------------------------
-- Execute the command with the arguments.
-- ------------------------------
procedure Execute (Cmd : in Command;
Generator : in out Gen.Generator.Handler) is
pragma Unreferenced (Cmd);
use Ada.Strings.Unbounded;
procedure Create_Database (Model : in String;
Database : in String;
Username : in String;
Password : in String);
-- ------------------------------
-- Create the database, the user and the tables.
-- ------------------------------
procedure Create_Database (Model : in String;
Database : in String;
Username : in String;
Password : in String) is
Factory : ADO.Sessions.Factory.Session_Factory;
Config : ADO.Drivers.Connections.Configuration;
Root_Connection : Unbounded_String;
Pos : Natural;
begin
Config.Set_Connection (Database);
if Config.Get_Property ("user") = "" then
Generator.Error ("Invalid database connection: missing user property");
return;
end if;
if Config.Get_Database = "" then
Generator.Error ("Invalid database connection: no database name specified");
return;
end if;
-- Build a connection string to create the database.
Pos := Util.Strings.Index (Database, ':');
Append (Root_Connection, Database (Database'First .. Pos));
Append (Root_Connection, "//");
Append (Root_Connection, Config.Get_Server);
if Config.Get_Port > 0 then
Append (Root_Connection, ':');
Append (Root_Connection, Util.Strings.Image (Config.Get_Port));
end if;
Append (Root_Connection, "/?user=");
Append (Root_Connection, Username);
if Password'Length > 0 then
Append (Root_Connection, "&password=");
Append (Root_Connection, Password);
end if;
Log.Info ("Connecting to {0} for database setup", Root_Connection);
-- Initialize the session factory to connect to the
-- database defined by root connection (which should allow the database creation).
Factory.Create (To_String (Root_Connection));
declare
Name : constant String := Generator.Get_Project_Name;
DB : constant ADO.Sessions.Master_Session := Factory.Get_Master_Session;
begin
-- Create the database only if it does not already exists.
if not Has_Database (DB, Config.Get_Database) then
Create_Database (DB, Config.Get_Database);
end if;
-- If some tables exist, don't try to create tables again.
-- We could improve by reading the current database schema, comparing with our
-- schema and create what is missing (new tables, new columns).
if Has_Tables (DB, Config.Get_Database) then
Generator.Error ("The database {0} exists", Config.Get_Database);
else
-- Create the user grant. On MySQL, it is safe to do this several times.
Create_User_Grant (DB, Config.Get_Database,
Config.Get_Property ("user"),
Config.Get_Property ("password"));
-- And now create the tables by using the SQL script generated by Dyanmo.
Create_Mysql_Tables (Name, Model, Config, Generator);
end if;
-- Remember the database connection string.
Generator.Set_Project_Property ("database", Database);
Generator.Save_Project;
exception
when E : others =>
Generator.Error (Ada.Exceptions.Exception_Message (E));
end;
end Create_Database;
Model : constant String := Get_Argument;
Arg1 : constant String := Get_Argument;
Arg2 : constant String := Get_Argument;
Arg3 : constant String := Get_Argument;
begin
Generator.Read_Project ("dynamo.xml");
-- Initialize the database drivers.
ADO.Drivers.Initialize (Generator.Get_Properties);
-- Check if a database is specified in the command line and use it.
if Ada.Strings.Fixed.Index (Arg1, "://") > 0 or Arg3'Length > 0 then
Create_Database (Model, Arg1, Arg2, Arg3);
else
declare
Database : constant String := Generator.Get_Project_Property ("database");
begin
-- Otherwise, get the database identification from dynamo.xml configuration.
if Ada.Strings.Fixed.Index (Database, "://") = 0 then
Generator.Error ("No database specified.");
return;
end if;
Create_Database (Model, Database, Arg1, Arg2);
end;
end if;
end Execute;
-- ------------------------------
-- Write the help associated with the command.
-- ------------------------------
procedure Help (Cmd : in Command;
Generator : in out Gen.Generator.Handler) is
pragma Unreferenced (Cmd, Generator);
use Ada.Text_IO;
begin
Put_Line ("create-database: Creates the database");
Put_Line ("Usage: create-database MODEL [CONNECTION] ADMIN-USER [ADMIN-PASSWORD]");
New_Line;
Put_Line (" Create the database specified by the connection string.");
Put_Line (" The connection string has the form:");
Put_Line (" driver://host[:port]/database");
New_Line;
Put_Line (" The database must not exist. The user specified in the connection string");
Put_Line (" is granted the access to the new database.");
end Help;
end Gen.Commands.Database;
|
asdc-controller/src/main/antlr4/org/onap/so/asdc/utils/ASDCLogging.g4 | msyoon222/so-tata | 16 | 3311 | grammar ASDCLogging;
doc : value+;
list : listName ':' '{' (obj (',' obj)*)? '}';
simplePair : key ':' keyValue;
complexPair : key ':' obj;
value : simplePair | list | complexPair ;
obj
: '{' 'NULL' '}'
| 'NULL'
| '{' value+ '}'
| value+
| '{' '}'
;
key : STRING;
keyValue : STRING;
listName : LIST_NAME;
LIST_NAME : STRING 'List' | 'RelatedArtifacts';
STRING : ~[:\r\n{},]+;
LINE_COMMENT
: '//' ~[\r\n]* -> skip
;
WS: [ \t\n\r]+ -> skip ;
|
actions/playqueue.applescript | andreifilip123/play-song | 0 | 4081 | -- plays workflow queue in iTunes --
on loadConfig()
return (load script POSIX file (do shell script "./resources/compile-config.sh"))
end loadConfig
on run query
set config to loadConfig()
playQueue() of config
end run
|
programs/oeis/127/A127920.asm | neoneye/loda | 22 | 83535 | <filename>programs/oeis/127/A127920.asm
; A127920: 1/6 of product of three numbers: n-th prime, previous and following number.
; 1,4,20,56,220,364,816,1140,2024,4060,4960,8436,11480,13244,17296,24804,34220,37820,50116,59640,64824,82160,95284,117480,152096,171700,182104,204156,215820,240464,341376,374660,428536,447580,551300,573800,644956,721764,776216,862924,955860,988260,1161280,1198144,1274196,1313400,1565620,1848224,1949476,2001460,2108184,2275280,2332880,2635500,2829056,3031864,3244140,3317040,3542276,3697960,3777484,4192244,4822356,5013320,5110664,5309116,6044060,6378736,6963596,7084700,7331104,7711320,8238416,8649124,9073260,9363584,9810580,10428396,10746800,11402920,12259940,12436340,13343760,13530384,14100680,14489644,15086400,15907256,16328620,16542064,16974516,18316960,19250136,19728380,20708500,21210504,21978620,23570040,23842524,26389980
seq $0,40 ; The prime numbers.
add $0,1
bin $0,3
|
programs/oeis/016/A016901.asm | neoneye/loda | 22 | 105449 | <reponame>neoneye/loda
; A016901: a(n) = (5*n + 4)^5.
; 1024,59049,537824,2476099,7962624,20511149,45435424,90224199,164916224,282475249,459165024,714924299,1073741824,1564031349,2219006624,3077056399,4182119424,5584059449,7339040224,9509900499,12166529024,15386239549,19254145824,23863536599,29316250624,35723051649,43204003424,51888844699,61917364224,73439775749,86617093024,101621504799,118636749824,137858491849,159494694624,183765996899,210906087424,241162079949,274794888224,312079600999,353305857024,398778220049,448816553824,503756397099,563949338624,629763392149,701583371424,779811265199,864866612224,957186876249,1057227821024,1165463885299,1282388557824,1408514752349,1544375182624,1690522737399,1847530855424,2015993900449,2196527536224,2389769101499,2596377985024,2817036000549,3052447761824,3303341057599,3570467226624,3854601532649,4156543539424,4477117485699,4817172660224,5177583776749,5559251349024,5963102065799,6390089165824,6841192812849,7317420470624,7819807277899,8349416423424,8907339520949,9494696984224,10112638401999,10762342913024,11445019581049,12161907769824,12914277518099,13703429914624,14530697473149,15397444507424,16305067506199,17254995508224,18248690477249,19287647677024,20373396046299,21507498573824,22691552673349,23927190558624,25216079618399,26559922791424,27960458941449,29419463232224,30938747502499
mul $0,5
add $0,4
pow $0,5
|
Structure/Operator/Vector/Subspaces/Span.agda | Lolirofle/stuff-in-agda | 6 | 10290 | import Lvl
open import Structure.Operator.Vector
open import Structure.Setoid
open import Type
module Structure.Operator.Vector.Subspaces.Span
{ℓᵥ ℓₛ ℓᵥₑ ℓₛₑ}
{V : Type{ℓᵥ}} ⦃ equiv-V : Equiv{ℓᵥₑ}(V) ⦄
{S : Type{ℓₛ}} ⦃ equiv-S : Equiv{ℓₛₑ}(S) ⦄
{_+ᵥ_ : V → V → V}
{_⋅ₛᵥ_ : S → V → V}
{_+ₛ_ _⋅ₛ_ : S → S → S}
⦃ vectorSpace : VectorSpace(_+ᵥ_)(_⋅ₛᵥ_)(_+ₛ_)(_⋅ₛ_) ⦄
where
open VectorSpace(vectorSpace)
open import Logic.Predicate
open import Numeral.CoordinateVector as Vec using () renaming (Vector to Vec)
open import Numeral.Finite
open import Numeral.Natural
open import Sets.ExtensionalPredicateSet as PredSet using (PredSet ; _∈_ ; [∋]-binaryRelator)
open import Structure.Container.SetLike using (SetElement)
private open module SetLikeFunctionProperties{ℓ} = Structure.Container.SetLike.FunctionProperties{C = PredSet{ℓ}(V)}{E = V}(_∈_)
open import Structure.Function.Multi
open import Structure.Operator
open import Structure.Operator.Vector.LinearCombination ⦃ vectorSpace = vectorSpace ⦄
open import Structure.Operator.Vector.LinearCombination.Proofs
open import Structure.Operator.Vector.Subspace ⦃ vectorSpace = vectorSpace ⦄
open import Structure.Relator.Properties
open import Syntax.Function
open import Syntax.Transitivity
private variable n : ℕ
private variable vf : Vec(n)(V)
private variable sf : Vec(n)(S)
Span : Vec(n)(V) → PredSet(V)
Span(vf) = PredSet.⊶(linearCombination(vf))
Span-subspace : ∀{vf} → Subspace(Span{n}(vf))
∃.witness (_closed-under₂_.proof (Subspace.add-closure (Span-subspace {vf = vf})) ([∃]-intro sf₁) ([∃]-intro sf₂)) = Vec.map₂(_+ₛ_) sf₁ sf₂
∃.proof (_closed-under₂_.proof (Subspace.add-closure (Span-subspace {vf = vf})) {v₁} {v₂} ([∃]-intro sf₁ ⦃ p₁ ⦄) ([∃]-intro sf₂ ⦃ p₂ ⦄)) =
linearCombination vf (Vec.map₂(_+ₛ_) sf₁ sf₂) 🝖[ _≡_ ]-[ preserving₂(linearCombination vf) (Vec.map₂(_+ₛ_)) (_+ᵥ_) ]
(linearCombination vf sf₁) +ᵥ (linearCombination vf sf₂) 🝖[ _≡_ ]-[ congruence₂(_+ᵥ_) ⦃ [+ᵥ]-binary-operator ⦄ p₁ p₂ ]
v₁ +ᵥ v₂ 🝖-end
∃.witness (_closed-under₁_.proof (Subspace.mul-closure Span-subspace {s}) ([∃]-intro sf)) = Vec.map(s ⋅ₛ_) sf
∃.proof (_closed-under₁_.proof (Subspace.mul-closure (Span-subspace {vf = vf}) {s}) {v} ([∃]-intro sf ⦃ p ⦄)) =
linearCombination vf (i ↦ s ⋅ₛ sf(i)) 🝖[ _≡_ ]-[ preserving₁(linearCombination vf) (Vec.map(s ⋅ₛ_)) (s ⋅ₛᵥ_) ]
s ⋅ₛᵥ (linearCombination vf sf) 🝖[ _≡_ ]-[ congruence₂ᵣ(_⋅ₛᵥ_)(s) p ]
s ⋅ₛᵥ v 🝖-end
|
oeis/020/A020798.asm | neoneye/loda-programs | 11 | 242269 | <filename>oeis/020/A020798.asm
; A020798: Decimal expansion of 1/sqrt(41).
; Submitted by <NAME>
; 1,5,6,1,7,3,7,6,1,8,8,8,6,0,6,0,6,5,5,2,4,1,0,2,8,7,0,1,1,2,7,2,7,1,5,2,7,9,3,1,8,0,9,7,8,8,4,4,4,1,5,0,9,4,7,6,9,0,0,6,6,4,9,4,3,0,9,3,1,2,8,6,7,8,5,2,8,9,6,6,0,3,4,8,5,2,0,8,3,6,6,4,0,2,4,0,7,3,0,8
mov $1,1
mov $2,1
mov $3,$0
add $3,8
mov $4,$0
mov $0,2
add $4,3
mov $7,10
pow $7,$4
mov $9,10
lpb $3
mov $4,$2
pow $4,2
mul $4,41
mov $5,$1
pow $5,2
add $4,$5
mov $6,$1
mov $1,$4
mul $6,$2
mul $6,2
mov $2,$6
mov $8,$4
div $8,$7
max $8,2
div $1,$8
div $2,$8
sub $3,2
lpe
mov $3,$9
pow $3,$0
div $2,$3
mov $0,$2
mod $0,10
|
programs/oeis/164/A164089.asm | jmorken/loda | 1 | 98085 | ; A164089: For n >=4, a(n) = the numerical value of the substring of binary n containing all digits but the first and last. a(1) = a(2) = a(3) = 0.
; 0,0,0,0,0,1,1,0,0,1,1,2,2,3,3,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61
add $0,1
mov $3,2
lpb $0
div $0,2
mul $0,2
trn $0,1
mod $1,$3
trn $1,3
div $1,2
mov $2,5
add $2,$1
add $1,$2
trn $3,3
add $3,4
lpe
sub $1,5
div $1,2
|
src/glfw-api.ads | zrmyers/GLFWAda | 0 | 7467 | <filename>src/glfw-api.ads
--------------------------------------------------------------------------------
-- MIT License
--
-- Copyright (c) 2020 <NAME>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
--------------------------------------------------------------------------------
with Interfaces.C;
with Interfaces.C.Strings;
with Interfaces.C.Pointers;
with Glfw.Error;
with Glfw.Window_Hints;
private package Glfw.Api is
type Char_Ptr_Array is Array(Natural range <>) of
aliased Interfaces.C.Strings.Chars_Ptr;
package Char_Ptr_Array_Ptrs is new Interfaces.C.Pointers (
index => Natural,
Element => Interfaces.C.Strings.Chars_Ptr,
Element_Array => Char_Ptr_Array,
Default_Terminator => Interfaces.C.Strings.Null_Ptr) ;
subtype Char_Ptr_Array_Ptr is Char_Ptr_Array_Ptrs.Pointer;
----------------------------------------------------------------------------
-- Platform Level Functions
----------------------------------------------------------------------------
-- Import the glfwInit() function from the GLFW C library.
function glfwInit return Glfw_Bool;
pragma Import (Convention => C,
Entity => glfwInit,
External_Name => "glfwInit");
-- Import the glfwTerminate() function from the GLFW C library.
procedure glfwTerminate;
pragma Import (Convention => C,
Entity => glfwTerminate,
External_Name => "glfwTerminate");
-- Import the glfwGetError() function from the GLFW C library.
function glfwGetError
(
message : out Interfaces.C.Strings.chars_ptr
)
return Error.Enum_Return_Codes;
pragma Import (Convention => C,
Entity => glfwGetError,
External_Name => "glfwGetError");
-- Import the glfwPollEvents() function from the GLFW C library
procedure glfwPollEvents;
pragma Import (Convention => C,
Entity => glfwPollEvents,
External_Name => "glfwPollEvents");
----------------------------------------------------------------------------
-- Window Level Functions
----------------------------------------------------------------------------
-- Import the glfwWindowHint() function from the GLFW C library
procedure glfwWindowHint
(
window_hint : in Glfw.Window_Hints.Enum_Window_Hints;
window_hint_value : in Glfw.Glfw_Bool
);
procedure glfwWindowHint
(
window_hint : in Glfw.Window_Hints.Enum_Window_Hints;
window_hint_value : in Glfw.Glfw_Int
);
procedure glfwWindowHint
(
window_hint : in Glfw.Window_Hints.Enum_Window_Hints;
window_hint_value : in Glfw.Enum_Client_Api
);
procedure glfwWindowHint
(
window_hint : in Glfw.Window_Hints.Enum_Window_Hints;
window_hint_value : in Glfw.Enum_Context_Api
);
procedure glfwWindowHint
(
window_hint : in Glfw.Window_Hints.Enum_Window_Hints;
window_hint_value : in Glfw.Enum_Context_Robustness
);
procedure glfwWindowHint
(
window_hint : in Glfw.Window_Hints.Enum_Window_Hints;
window_hint_value : in Glfw.Enum_Context_Release_Behavior
);
procedure glfwWindowHint
(
window_hint : in Glfw.Window_Hints.Enum_Window_Hints;
window_hint_value : in Glfw.Enum_OpenGl_Profile
);
pragma Import (Convention => C,
Entity => glfwWindowHint,
External_Name => "glfwWindowHint");
-- Import the glfwWindHintString() function from the GLFW Library.
procedure glfwWindowHintString
(
window_hint : in Glfw.Window_Hints.Enum_Window_Hints;
window_hint_value : in Interfaces.C.Strings.chars_ptr
);
pragma Import (Convention => C,
Entity => glfwWindowHintString,
External_Name => "glfwWindowHintString");
-- Import the glfwCreateWindow() function from the GLFW Library.
function glfwCreateWindow
(
width : in Window_Dimmension;
height : in Window_Dimmension;
title : in Interfaces.C.Strings.chars_ptr;
monitor : in Glfw_Monitor;
window : in Glfw_Window
)
return Glfw_Window;
pragma Import (Convention => C,
Entity => glfwCreateWindow,
External_Name => "glfwCreateWindow");
-- Import the glfwWindowShouldClose() function from the GLFW Library.
function glfwWindowShouldClose
(
window : in Glfw_Window
)
return Glfw_Bool;
pragma Import (Convention => C,
Entity => glfwWindowShouldClose,
External_Name => "glfwWindowShouldClose");
-- Import the glfwDestroyWindow() function from the GLFW Library.
procedure glfwDestroyWindow
(
window : in Glfw_Window
);
pragma Import (Convention => C,
Entity => glfwDestroyWindow,
External_Name => "glfwDestroyWindow");
function glfwGetRequiredInstanceExtensions
(
p_extension_count : out Interfaces.C.unsigned
)
return Char_Ptr_Array_Ptr;
pragma Import (Convention => C,
Entity => glfwGetRequiredInstanceExtensions,
External_Name => "glfwGetRequiredInstanceExtensions");
end Glfw.Api;
|
Task/Increment-a-numerical-string/AppleScript/increment-a-numerical-string.applescript | LaudateCorpus1/RosettaCodeData | 1 | 1930 | <filename>Task/Increment-a-numerical-string/AppleScript/increment-a-numerical-string.applescript
use AppleScript version "2.4"
use framework "Foundation"
use scripting additions
-- succString :: Bool -> String -> String
on succString(blnPruned, s)
script go
on |λ|(w)
try
if w contains "." then
set v to w as real
else
set v to w as integer
end if
{(1 + v) as string}
on error
if blnPruned then
{}
else
{w}
end if
end try
end |λ|
end script
unwords(concatMap(go, |words|(s)))
end succString
-- TEST ---------------------------------------------------
on run
script test
on |λ|(bln)
succString(bln, ¬
"41 pine martens in 1491.3 -1.5 mushrooms ≠ 136")
end |λ|
end script
unlines(map(test, {true, false}))
end run
--> 42 1492.3 -0.5 137
--> 42 pine martens in 1492.3 -0.5 mushrooms ≠ 137
-- GENERIC ------------------------------------------------
-- concatMap :: (a -> [b]) -> [a] -> [b]
on concatMap(f, xs)
set lng to length of xs
set acc to {}
tell mReturn(f)
repeat with i from 1 to lng
set acc to acc & |λ|(item i of xs, i, xs)
end repeat
end tell
return acc
end concatMap
-- 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 :: First-class m => (a -> b) -> m (a -> b)
on mReturn(f)
if class of f is script then
f
else
script
property |λ| : f
end script
end if
end mReturn
-- unlines :: [String] -> String
on unlines(xs)
set {dlm, my text item delimiters} to ¬
{my text item delimiters, linefeed}
set str to xs as text
set my text item delimiters to dlm
str
end unlines
-- unwords :: [String] -> String
on unwords(xs)
set {dlm, my text item delimiters} to ¬
{my text item delimiters, space}
set s to xs as text
set my text item delimiters to dlm
return s
end unwords
-- words :: String -> [String]
on |words|(s)
set ca to current application
(((ca's NSString's stringWithString:(s))'s ¬
componentsSeparatedByCharactersInSet:(ca's ¬
NSCharacterSet's whitespaceAndNewlineCharacterSet()))'s ¬
filteredArrayUsingPredicate:(ca's ¬
NSPredicate's predicateWithFormat:"0 < length")) as list
end |words|
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.