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 |
|---|---|---|---|---|
oeis/041/A041425.asm | neoneye/loda-programs | 11 | 29427 | <filename>oeis/041/A041425.asm
; A041425: Denominators of continued fraction convergents to sqrt(228).
; Submitted by <NAME>(s3)
; 1,10,301,3020,90901,912030,27451801,275430040,8290353001,83178960050,2503659154501,25119770505060,756096774306301,7586087513568070,228338722181348401,2290973309327052080,68957538001992910801,691866353329256160090,20824948137879677713501,208941347732126033295100,6289065380101660676566501,63099595148748732798960110,1899276919842563644645369801,19055868793574385179252658120,573575340727074119022225113401,5754809276064315575401503792130,173217853622656541381067338877301
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
mov $3,$1
mov $1,$2
dif $2,3
mul $2,30
lpe
mov $0,$2
div $0,30
|
Cubical/HITs/2GroupoidTruncation/Properties.agda | dan-iel-lee/cubical | 0 | 10059 | {-
This file contains:
- Properties of 2-groupoid truncations
-}
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.2GroupoidTruncation.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Univalence
open import Cubical.HITs.2GroupoidTruncation.Base
private
variable
ℓ : Level
A : Type ℓ
rec : ∀ {B : Type ℓ} → is2Groupoid B → (A → B) → ∥ A ∥₄ → B
rec gB f ∣ x ∣₄ = f x
rec gB f (squash₄ _ _ _ _ _ _ t u i j k l) =
gB _ _ _ _ _ _ (λ m n o → rec gB f (t m n o)) (λ m n o → rec gB f (u m n o))
i j k l
elim : {B : ∥ A ∥₄ → Type ℓ}
(bG : (x : ∥ A ∥₄) → is2Groupoid (B x))
(f : (x : A) → B ∣ x ∣₄) (x : ∥ A ∥₄) → B x
elim bG f ∣ x ∣₄ = f x
elim bG f (squash₄ x y p q r s u v i j k l) =
isOfHLevel→isOfHLevelDep 4 bG _ _ _ _ _ _
(λ j k l → elim bG f (u j k l)) (λ j k l → elim bG f (v j k l))
(squash₄ x y p q r s u v)
i j k l
elim2 : {B : ∥ A ∥₄ → ∥ A ∥₄ → Type ℓ}
(gB : ((x y : ∥ A ∥₄) → is2Groupoid (B x y)))
(g : (a b : A) → B ∣ a ∣₄ ∣ b ∣₄)
(x y : ∥ A ∥₄) → B x y
elim2 gB g = elim (λ _ → is2GroupoidΠ (λ _ → gB _ _))
(λ a → elim (λ _ → gB _ _) (g a))
elim3 : {B : (x y z : ∥ A ∥₄) → Type ℓ}
(gB : ((x y z : ∥ A ∥₄) → is2Groupoid (B x y z)))
(g : (a b c : A) → B ∣ a ∣₄ ∣ b ∣₄ ∣ c ∣₄)
(x y z : ∥ A ∥₄) → B x y z
elim3 gB g = elim2 (λ _ _ → is2GroupoidΠ (λ _ → gB _ _ _))
(λ a b → elim (λ _ → gB _ _ _) (g a b))
2GroupoidTruncIs2Groupoid : is2Groupoid ∥ A ∥₄
2GroupoidTruncIs2Groupoid a b p q r s = squash₄ a b p q r s
2GroupoidTruncIdempotent≃ : is2Groupoid A → ∥ A ∥₄ ≃ A
2GroupoidTruncIdempotent≃ {A = A} hA = isoToEquiv f
where
f : Iso ∥ A ∥₄ A
Iso.fun f = rec hA (idfun A)
Iso.inv f x = ∣ x ∣₄
Iso.rightInv f _ = refl
Iso.leftInv f = elim (λ _ → isOfHLevelSuc 4 2GroupoidTruncIs2Groupoid _ _) (λ _ → refl)
2GroupoidTruncIdempotent : is2Groupoid A → ∥ A ∥₄ ≡ A
2GroupoidTruncIdempotent hA = ua (2GroupoidTruncIdempotent≃ hA)
|
programs/oeis/305/A305154.asm | karttu/loda | 1 | 25502 | <filename>programs/oeis/305/A305154.asm<gh_stars>1-10
; A305154: a(n) = 36*2^n + 9.
; 45,81,153,297,585,1161,2313,4617,9225,18441,36873,73737,147465,294921,589833,1179657,2359305,4718601,9437193,18874377,37748745,75497481,150994953,301989897,603979785,1207959561,2415919113,4831838217,9663676425,19327352841,38654705673,77309411337,154618822665,309237645321
mov $1,2
pow $1,$0
sub $1,1
mul $1,36
add $1,45
|
other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/old_cos/sfc/yst_vma.asm | prismotizm/gigaleak | 0 | 246002 | Name: yst_vma.asm
Type: file
Size: 8516
Last-Modified: '2016-05-13T04:52:55Z'
SHA-1: 959348699C483CD817B070EE0A92493BBB8C9BCA
Description: null
|
patch.asm | jvisser/msu-md-super-hang-on | 1 | 10563 | ; Mega CD MMIO addresses used for communicating with msu-md driver on the mega cd (mode 1)
MSU_COMM_CMD equ $a12010 ; Comm command 0 (high byte)
MSU_COMM_ARG equ $a12011 ; Comm command 0 (low byte)
MSU_COMM_ARG32 equ $a12012 ; Comm command 1/2
MSU_COMM_CMD_CK equ $a1201f ; Comm command 7 (low byte)
MSU_COMM_STATUS equ $a12020 ; Comm status 0 (0-ready, 1-init, 2-cmd busy)
; msu-md commands
MSU_PLAY equ $1100 ; PLAY decimal no. of track (1-99) playback will be stopped in the end of track
MSU_PLAY_LOOP equ $1200 ; PLAY LOOP decimal no. of track (1-99) playback will restart the track when end is reached
MSU_PAUSE equ $1300 ; PAUSE vol fading time. 1/75 of sec. (75 equal to 1 sec) instant stop if 0 pause playback
MSU_RESUME equ $1400 ; RESUME none. resume playback
MSU_VOL equ $1500 ; VOL volume 0-255. set cdda volume
MSU_NOSEEK equ $1600 ; NOSEEK 0-on(default state), 1-off(no seek delays) seek time emulation switch
MSU_PLAYOF equ $1a00 ; PLAYOF #1 = decimal no. of track (1-99) #2 = offset in sectors from the start of the track to apply when looping play cdda track and loop from specified sector offset
; Where to put the code
ROM_END equ $7f220
; MACROS: ------------------------------------------------------------------------------------------
macro MSU_WAIT
.\@
tst.b MSU_COMM_STATUS
bne.s .\@
endm
macro MSU_COMMAND cmd, param
MSU_WAIT
move.w #(\1|\2),MSU_COMM_CMD ; Send msu cmd
addq.b #1,MSU_COMM_CMD_CK ; Increment command clock
endm
macro PLAY_TRACK trackId
MSU_WAIT
MSU_COMMAND MSU_PLAY_LOOP,\1
endm
; MEGA DRIVE OVERRIDES : ------------------------------------------------------------------------------------------
; M68000 Reset vector
org $4
dc.l ENTRY_POINT ; Custom entry point for redirecting
org $6bac ; Original ENTRY POINT
Game
org $7ddc
nop
jsr fade_out.l
org $6852
nop
jsr stop_music_ext.l
org $689c
nop
jsr stop_music.l
org $6a26
nop
jsr stop_music.l
org $739e
nop
jsr stop_music.l
org $8898
nop
jsr stop_music.l
org $b382
nop
jsr stop_music.l
org $abb6 ; This seems to be a bug where address $b1 is used instead of immediate value #$b1
nop
jsr stop_music.l
org $ab20
jsr pause_music.l
org $ab0e
jsr resume_music.l
org $7e1e
jmp play_music_song_select.l
nop
nop
org $871c
jsr play_music_stage_start.l
nop
nop
org $68b6
jsr play_music_sound_test.l
bra.s play_music_sound_test_after
org $6922
play_music_sound_test_after
org $5f02
nop
jsr play_music_81.l
org $7c44
nop
jsr play_music_81.l
org $b42a
nop
jsr play_music_86.l
org $e2e0
nop
jsr play_music_87.l
org $507a
nop
jsr play_music_8a.l
org $6768
nop
jsr play_music_8a.l
org $6e8c
sound_command
; MSU-MD Init: -------------------------------------------------------------------------------------
org ROM_END
ENTRY_POINT
bsr.s audio_init
jmp Game
audio_init
jsr msu_driver_init
tst.b d0 ; if 1: no CD Hardware found
.audio_init_fail
bne.s .audio_init_fail ; Loop forever
MSU_COMMAND MSU_NOSEEK, 1
MSU_COMMAND MSU_VOL, 255
rts
; Sound: -------------------------------------------------------------------------------------
align 2
fade_out
; 2 second fade out
MSU_COMMAND MSU_PAUSE, 150
rts
stop_music_ext
; Original code
move.w d0,$c70e.w
stop_music
MSU_COMMAND MSU_PAUSE, 0
; Send stop command to original code
move.b #$b1,d7
jmp sound_command
pause_music
MSU_COMMAND MSU_PAUSE, 0
; Original code
lea $a01c08,a1
rts
resume_music
MSU_COMMAND MSU_RESUME, 0
; Original code
lea $a01c09,a1
rts
play_music_song_select
; Original code
move.b d7,$ff0518
bra.s play_music
play_music_stage_start
; Original code
move.b $ff0518,d7
; Fall through to play_music
play_music
movem.l d7/a0,-(sp)
subi.w #$81,d7
ext.w d7
add.w d7,d7
lea AUDIO_TBL,a0
move.w (a0,d7),MSU_COMM_CMD
addq.b #1,MSU_COMM_CMD_CK
movem.l (sp)+,d7/a0
rts
play_music_sound_test
cmpi.w #8,d0
bge.s .non_music
movem.l d0/a0,-(sp)
add.w d0,d0
lea AUDIO_TBL,a0
move.w (a0,d0),MSU_COMM_CMD
addq.b #1,MSU_COMM_CMD_CK
movem.l (sp)+,d0/a0
rts
.non_music
move.b (a0,d0),d7
jmp sound_command
; Select Your Class
play_music_81
PLAY_TRACK 1
rts
; Finished
play_music_86
PLAY_TRACK 6
rts
; Enter Your Name
play_music_87
PLAY_TRACK 7
rts
; Winner (Shop BGM)
play_music_8a
PLAY_TRACK 8
rts
; TABLES: ------------------------------------------------------------------------------------------
align 2
AUDIO_TBL ; #Track Name
dc.w MSU_PLAY_LOOP|01 ; 01 - Select Your Class
dc.w MSU_PLAY_LOOP|02 ; 02 - Outride a Crisis
dc.w MSU_PLAY_LOOP|04 ; 04 - Winning Run
dc.w MSU_PLAY_LOOP|03 ; 03 - Sprinter
dc.w MSU_PLAY_LOOP|05 ; 05 - Hard Road
dc.w MSU_PLAY_LOOP|06 ; 06 - Finished
dc.w MSU_PLAY_LOOP|07 ; 07 - Enter Your Name
dc.w MSU_PLAY_LOOP|08 ; 08 - Winner (Shop BGM)
; MSU-MD DRIVER: -----------------------------------------------------------------------------------
align 2
msu_driver_init
incbin "msu-drv.bin"
|
src/ewok-sanitize.ads | mfkiwl/ewok-kernel-security-OS | 65 | 14122 | <reponame>mfkiwl/ewok-kernel-security-OS
--
-- Copyright 2018 The wookey project team <<EMAIL>>
-- - <NAME>
-- - Arnauld Michelizza
-- - <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 ewok.tasks_shared; use ewok.tasks_shared;
with ewok.exported.dma;
package ewok.sanitize
with spark_mode => on
is
-- Assertions are ignored in compilation
pragma assertion_policy (pre => IGNORE, post => IGNORE, assert => IGNORE);
function is_range_in_devices_region
(ptr : system_address;
size : unsigned_32;
task_id : ewok.tasks_shared.t_task_id)
return boolean;
function is_word_in_data_region
(ptr : system_address;
task_id : ewok.tasks_shared.t_task_id;
mode : ewok.tasks_shared.t_task_mode) return boolean
with
global => null,
post => (if ptr > system_address'last - 3 then
is_word_in_data_region'result = false);
function is_word_in_txt_region
(ptr : system_address;
task_id : ewok.tasks_shared.t_task_id) return boolean
with
global => null,
post => (if ptr > system_address'last - 3 then
is_word_in_txt_region'result = false);
function is_word_in_allocated_device
(ptr : system_address;
task_id : ewok.tasks_shared.t_task_id)
return boolean;
function is_word_in_any_region
(ptr : system_address;
task_id : ewok.tasks_shared.t_task_id;
mode : ewok.tasks_shared.t_task_mode) return boolean
with
global => null,
post => (if ptr > system_address'last - 3 then
is_word_in_any_region'result = false);
function is_range_in_data_region
(ptr : system_address;
size : unsigned_32;
task_id : ewok.tasks_shared.t_task_id;
mode : ewok.tasks_shared.t_task_mode) return boolean
with
global => null,
post => (if size > 0 and ptr > system_address'last - (size - 1) then
is_range_in_data_region'result = false);
function is_range_in_txt_region
(ptr : system_address;
size : unsigned_32;
task_id : ewok.tasks_shared.t_task_id) return boolean
with
global => null,
post => (if size > 0 and ptr > system_address'last - (size - 1) then
is_range_in_txt_region'result = false);
function is_range_in_any_region
(ptr : system_address;
size : unsigned_32;
task_id : ewok.tasks_shared.t_task_id;
mode : ewok.tasks_shared.t_task_mode) return boolean
with
global => null,
post => (if size > 0 and ptr > system_address'last - (size - 1) then
is_range_in_any_region'result = false);
function is_range_in_dma_shm
(ptr : system_address;
size : unsigned_32;
dma_access : ewok.exported.dma.t_dma_shm_access;
task_id : ewok.tasks_shared.t_task_id) return boolean
with
global => null,
post => (if size > 0 and ptr > system_address'last - (size - 1) then
is_range_in_dma_shm'result = false);
end ewok.sanitize;
|
rivulet-shared/src/main/antlr4/io/rivulet/HTMLAttributes.g4 | gmu-swe/rivulet | 9 | 6496 | /* [The "BSD licence"]
* Copyright (c) 2013 <NAME>
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*
*
* Based on the ANTLR4 example grammar for HTML (https://github.com/antlr/grammars-v4/tree/master/html), original
* @author <NAME>. */
grammar HTMLAttributes;
@header {
import java.util.LinkedList;
}
@parser::members {
public LinkedList<String[]> attributes = new LinkedList<>();
}
@lexer::members {
@Override
public void notifyListeners(LexerNoViableAltException e) {
throw new ParseCancellationException();
}
@Override
public void recover(LexerNoViableAltException e) {
throw new ParseCancellationException();
}
}
parse
: TAG_OPEN NAME attribute* TAG_CLOSE {if(true) throw new io.rivulet.internal.EndOfAttributeException();}
| EOF
;
attribute
: NAME '=' value {attributes.add(new String[]{$NAME.text, $value.text});}
| NAME {attributes.add(new String[]{$NAME.text, null});}
;
value
: VALUE
| NAME
;
TAG_OPEN
: '<'
;
TAG_CLOSE
: '/>'
| '>'
;
fragment
NAME_START
: [a-zA-Z]
| '\u2070'..'\u218F'
| '\u2C00'..'\u2FEF'
| '\u3001'..'\uD7FF'
| '\uF900'..'\uFDCF'
| '\uFDF0'..'\uFFFD'
;
fragment
NAME_CHAR
: NAME_START
| '-'
| '_'
| '.'
| [0-9]
| '\u00B7'
| '\u0300'..'\u036F'
| '\u203F'..'\u2040'
;
NAME
: NAME_START NAME_CHAR*
;
VALUE
: '\'' (~'\'')* '\''
| '"' (~'"')* '"'
| (~[ \t\r\n\f"'`=<>])+
;
WHITESPACE
: [ \t\r\n\f] -> skip
;
OTHER
: .+?
;
|
staf-interpreter/src/main/antlr4/Staf.g4 | Virmak/staf | 2 | 7013 | grammar Staf;
staf_file
: suite_name? imports_section? vars_section? keywords_section? test_cases_section? EOF
;
suite_name
: TEST_SUITE string documentation?
;
documentation
: '[' .*? ']'
;
imports_section
: IMPORTS import_stat*
;
import_stat
: IMPORT import_obj
;
import_obj
: (string | IDENTIFIER)
;
vars_section
: VARS assignment*
;
// Test cases section ***/
test_cases_section
: TEST_CASES test_case_declaration*
;
test_case_declaration
: test_case_before* test_case_priority? keyword_name ':' documentation? test_case_body END
;
test_case_before
: '@' LBRACKET keyword_name RBRACKET
;
test_case_body
: ((GIVEN | WHEN | THEN | 'AND')? statement)*
;
test_case_priority
: (INT|IGNORE) '-'
;
// End test cases ***/
// Keywords section ***/
keywords_section
: KEYWORDS keyword_declaration*
;
keyword_declaration
: keyword_name keyword_declaration_arguments
documentation?
keyword_body
keyword_return_stat
;
keyword_body
: statement*
;
statement
: (exit_loop | assignment | keyword_call | for_stat | run_keyword_if)
;
run_keyword_if
: RUN KEYWORD IF LPARENT expression RPARENT (keyword_call|exit_loop) run_keyword_else?
;
run_keyword_else
: ELSE (keyword_call|exit_loop)
;
exit_loop
: EXIT LOOP exit_loop_condition?
;
exit_loop_condition
: (IF LPARENT expression RPARENT )
;
keyword_call
: keyword_name keyword_call_arguments
;
keyword_call_arguments
: LPARENT (object (COMMA object)*)? RPARENT
;
keyword_return_stat
: (RETURN object) | END
;
keyword_name
: (IDENTIFIER|reserved_keyword) (IDENTIFIER|reserved_keyword)*
;
reserved_keyword
: IMPORT | FOR | GIVEN | WHEN | THEN
;
keyword_declaration_arguments
: LPARENT (variable (COMMA variable)*)? RPARENT
;
// End keywords section ***/
assignment
: variable_reference EQUAL (object | NULL)
;
for_stat
: FOR variable ':' (complex_object | variable_reference | keyword_call)
for_stat_body
ENDFOR
;
for_stat_body
: statement*
;
listLiteral
: LBRACKET (object (COMMA object)*)? RBRACKET
;
dictionaryLiteral
: '{' (keyValuePair (',' keyValuePair)*)? '}'
;
keyValuePair
: (IDENTIFIER | string) ':' object
;
object
: complex_object | scalar_object | expression
;
complex_object
: ( dictionaryLiteral | listLiteral)
;
scalar_object
: (primitive | variable_reference | keyword_call)
;
variable_reference
: variable_reference brackets_item_access // list style item access i.e. list[x]
| variable_reference dot_item_access // dict style item access i.e. dict.x
| variable
;
primitive
: string
| bool
| number
;
variable
: '$' IDENTIFIER
;
dot_item_access
: DOT IDENTIFIER
;
brackets_item_access
: LBRACKET expression RBRACKET
;
expression
: (MINUS | NOT) expression
| expression mulop expression
| expression addop expression
| expression binop expression
| LPARENT expression RPARENT
| scalar_object
;
mulop
: MUL | DIV | MOD
;
addop
: PLUS | MINUS
;
binop
: AND_OP | OR | EQUAL EQUAL | LT | GT | LTE | GTE | NE
;
number
: (INT | FLOAT)
;
string
: SINGLE_STRING
| DOUBLE_STRING
;
bool
: TRUE
| FALSE
;
SINGLE_STRING
: '\'' ~('\'')* '\''
;
DOUBLE_STRING
: '"' ~('"')* '"'
;
EQUAL
: '='
;
COMMA
: ','
;
RUN: R U N;
KEYWORD: K E Y W O R D;
IF : I F;
ELSE : E L S E;
PLUS : '+' ;
MINUS : '-' ;
MUL : '*' ;
DIV : '/' ;
MOD : '%' ;
LT : '<' ;
GT : '>' ;
LTE : '<=';
GTE : '>=';
NE : '!=';
NOT : '!';
AND_OP : '&';
OR : O R;
LPARENT : '(';
RPARENT : ')';
LBRACKET : '[';
RBRACKET : ']';
LBRACE : '{';
RBRACE : '}';
DOT : '.';
COLON : ':';
DOLLAR : '$';
TRUE : T R U E;
FALSE : F A L S E;
INT
: [0-9]+
;
FLOAT
: [0-9]+ '.' [0-9]+;
COMMENT
: '#' ~[\r\n]* -> skip
;
SPACE
: [ \t]+ -> skip
;
NL: ('\r\n' | '\r' | '\n') -> skip;
// RESERVED KEYWORDS
TEST_SUITE
: T E S T SPACE* S U I T E SPACE*
;
IMPORTS
: I M P O R T S
;
IMPORT
: I M P O R T
;
VARS
: V A R S
;
KEYWORDS
: K E Y W O R D S
;
TEST_CASES
: T E S T SPACE* C A S E S
;
BEGIN
: B E G I N
;
END
: E N D
;
RETURN
: R E T U R N
;
FOR
: F O R
;
ENDFOR
: E N D F O R
;
NULL
: N U L L
;
GIVEN
: G I V E N
;
WHEN
: W H E N
;
THEN
: T H E N
;
IGNORE
: I G N O R E
;
EXIT : E X I T;
LOOP : L O O P;
IDENTIFIER
: [A-Za-z0-9_]+
;
fragment A:('a'|'A');
fragment B:('b'|'B');
fragment C:('c'|'C');
fragment D:('d'|'D');
fragment E:('e'|'E');
fragment F:('f'|'F');
fragment G:('g'|'G');
fragment H:('h'|'H');
fragment I:('i'|'I');
fragment J:('j'|'J');
fragment K:('k'|'K');
fragment L:('l'|'L');
fragment M:('m'|'M');
fragment N:('n'|'N');
fragment O:('o'|'O');
fragment P:('p'|'P');
fragment Q:('q'|'Q');
fragment R:('r'|'R');
fragment S:('s'|'S');
fragment T:('t'|'T');
fragment U:('u'|'U');
fragment V:('v'|'V');
fragment W:('w'|'W');
fragment X:('x'|'X');
fragment Y:('y'|'Y');
fragment Z:('z'|'Z'); |
Lab04-05/25_04.asm | Krl1/PTM_L | 0 | 10479 | <filename>Lab04-05/25_04.asm
LJMP START
LCDstatus equ 0FF2EH
LCDcontrol equ 0FF2CH
LCDdataWR equ 0FF2DH
LCDdataRD equ 0FF2FH
#define HOME 0x80
#define INITDISP 0x38
#define HOM2 0xc0
#define LCDON 0x0e
#define CLEAR 0x01
P5 EQU 0F8H
P7 EQU 0DBH
ORG 0100H
LCDcntrlWR MACRO x
LOCAL loop
loop: MOV DPTR, #LCDstatus
MOVX A, @DPTR
JB ACC.7, loop
MOV DPTR, #LCDcontrol
MOV A, x
MOVX @DPTR, A
ENDM
LCDcharWR MACRO
LOCAL loop1, loop2
PUSH ACC
loop1: MOV DPTR, #LCDstatus
MOVX A, @DPTR
JB ACC.7, loop1
loop2: MOV DPTR, #LCDdataWR
POP ACC
MOVX @DPTR, A
ENDM
init_LCD MACRO
LCDcntrlWR #INITDISP
LCDcntrlWR #CLEAR
LCDcntrlWR #LCDON
ENDM
putchrLCD:
LCDcharWR
RET
putstrLCD:
CLR A
MOVC A, @A+DPTR
JZ EXIT
PUSH DPH
PUSH DPL
CALL putchrLCD
POP DPL
POP DPH
INC DPTR
SJMP putstrLCD
EXIT: RET
INITIALIZE:
MOV DPTR, #80EBH //0
MOV A, #30H
MOVX @DPTR, A
MOV DPTR, #8077H //1
MOV A, #31H
MOVX @DPTR, A
MOV DPTR, #807BH //2
MOV A, #32H
MOVX @DPTR, A
MOV DPTR, #807DH //3
MOV A, #33H
MOVX @DPTR, A
MOV DPTR, #80B7H //4
MOV A, #34H
MOVX @DPTR, A
MOV DPTR, #80BBH //5
MOV A, #35H
MOVX @DPTR, A
MOV DPTR, #80BDH //6
MOV A, #36H
MOVX @DPTR, A
MOV DPTR, #80D7H //7
MOV A, #37H
MOVX @DPTR, A
MOV DPTR, #80DBH //8
MOV A, #38H
MOVX @DPTR, A
MOV DPTR, #80DDH //9
MOV A, #39H
MOVX @DPTR, A
MOV DPTR, #807EH //A
MOV A, #41H
MOVX @DPTR, A
MOV DPTR, #80BEH //B
MOV A, #42H
MOVX @DPTR, A
MOV DPTR, #80DEH
MOV A, #43H
MOVX @DPTR, A
MOV DPTR, #80EEH //D
MOV A, #44H
MOVX @DPTR, A
MOV DPTR, #80E7H //*
MOV A, #2AH
MOVX @DPTR, A
MOV DPTR, #80EDH //#
MOV A, #23H
MOVX @DPTR, A
RET
CZY_WCISNIETY:
MOV A, P7
ANL A, R0
MOV R2, A
CLR C
SUBB A, R0
MOV R5, A
RET
W1:
MOV R0, #7FH
MOV A, R0
MOV P5, A
CALL CZY_WCISNIETY
MOV A, R2
MOV R3, A
MOV A, R5
JZ EXIT1
SPUST:
CALL CZY_WCISNIETY
JNZ SPUST
MOV A, R3
MOV DPH, #80H
MOV DPL, A
MOVX A, @DPTR
LCDcntrlWR #CLEAR
CALL putchrLCD
MOV P1, A
EXIT1:
RET
W2:
MOV R0, #0BFH
MOV A, R0
MOV P5, A
CALL CZY_WCISNIETY
MOV A, R2
MOV R3, A
MOV A, R5
JZ EXIT2
SPUST2:
CALL CZY_WCISNIETY
JNZ SPUST2
MOV A, R3
MOV DPH, #80H
MOV DPL, A
MOVX A, @DPTR
MOV P1, A
EXIT2:
RET
W3:
MOV R0, #0DFH
MOV A, R0
MOV P5, A
CALL CZY_WCISNIETY
MOV A, R2
MOV R3, A
MOV A, R5
JZ EXIT3
SPUST3:
CALL CZY_WCISNIETY
JNZ SPUST3
MOV A, R3
MOV DPH, #80H
MOV DPL, A
MOVX A, @DPTR
MOV P1, A
EXIT3:
RET
W4:
MOV R0, #0EFH
MOV A, R0
MOV P5, A
CALL CZY_WCISNIETY
MOV A, R2
MOV R3, A
MOV A, R5
JZ WYJSCIE
SPUST4:
CALL CZY_WCISNIETY
JNZ SPUST4
MOV A, R3
MOV DPH, #80H
MOV DPL, A
MOVX A, @DPTR
MOV P1, A
WYJSCIE:
RET
START:
CALL INITIALIZE
init_LCD
PETLA:
CALL W1
CALL W2
CALL W3
CALL W4
JMP PETLA
NOP
NOP
NOP
JMP $
END START |
rom/example/score_bcd.asm | novoru/GBR | 0 | 89979 | <reponame>novoru/GBR
; -----------------------------------------------------------------------------
; Example: Game score in Binary Coded Decimal
; -----------------------------------------------------------------------------
; This is alternative approach to score_hex.asm. If you've never heard of BCD
; here's some reading: https://ehaskins.com/2018-01-30%20Z80%20DAA/
; Font comes from ZX Spectrum - https://en.wikipedia.org/wiki/ZX_Spectrum_character_set
; More examples by tmk @ https://github.com/gitendo/helloworld
; -----------------------------------------------------------------------------
INCLUDE "hardware.inc" ; system defines
SECTION "VBL",ROM0[$0040] ; vblank interrupt handler
jp vbl
SECTION "Start",ROM0[$100] ; start vector, followed by header data applied by rgbfix.exe
nop
jp start
SECTION "Example",ROM0[$150] ; code starts here
start:
di ; disable interrupts
ld sp,$E000 ; setup stack
.wait_vbl ; wait for vblank to properly disable lcd
ld a,[rLY]
cp $90
jr nz,.wait_vbl
xor a
ld [rIF],a ; reset important registers
ld [rLCDC],a
ld [rSTAT],a
ld [rSCX],a
ld [rSCY],a
ld [rLYC],a
ld [rIE],a
ld hl,_RAM ; clear ram (fill with a which is 0 here)
ld bc,$2000-2 ; watch out for stack ;)
call fill
ld hl,_HRAM ; clear hram
ld c,$80 ; a = 0, b = 0 here, so let's save a byte and 4 cycles (ld c,$80 - 2/8 vs ld bc,$80 - 3/12)
call fill
ld hl,_VRAM ; clear vram, lcdc is disabled so you have 'easy' access
ld b,$18 ; a = 0, bc should be $1800; c = 0 here, so..
call fill
ld a,$20 ; ascii code for 'space' character
; no need to setup hl since _SCRN0 ($9800) and _SCRN1 ($9C00) are part of _VRAM, just continue
ld b,8 ; bc should be $800 (_SCRN0/1 are 32*32 bytes); c = 0 here, so..
call fill
ld a,%10010011 ; bits: 7-6 = 1st color, 5-4 = 2nd, 3-2 = 3rd and 1-0 = 4th color
; color values: 00 - light, 01 - gray, 10 - dark gray, 11 - dark
ld [rBGP],a ; bg palette
ld [rOBP0],a ; obj palettes (not used in this example)
ld [rOBP1],a
ld hl,font ; font data
ld de,_VRAM+$200 ; place it here to get ascii mapping ('space' code is $20, tile size $10)
ld bc,1776 ; font_8x8.chr file size
call copy
ld hl,text ; menu text
ld de,_SCRN0+$A0 ; center it a bit
ld b,8 ; it has 8 lines
call copy_text
ld a,IEF_VBLANK ; vblank interrupt
ld [rIE],a ; setup
ld a,LCDCF_ON | LCDCF_BG8000 | LCDCF_BG9800 | LCDCF_OBJ8 | LCDCF_OBJOFF | LCDCF_WINOFF | LCDCF_BGON
; lcd setup: tiles at $8000, map at $9800, 8x8 sprites (disabled), no window, etc.
ld [rLCDC],a ; enable lcd
ei ; enable interrupts
.loop
call parse_input ; read joypad and update inputs array that holds individual keys status
halt ; save battery
; nop ; nop after halt is mandatory but rgbasm takes care of it :)
jr .loop ; endless loop
vbl: ; update screen
ld hl,score
ld de,_SCRN0+$E7 ; this points exactly at map coordinate where score string is stored
ld c,3 ; score takes 3 bytes, each byte holds 2 digits
.copy ; copy from hram to vram without waiting for access since it's vblank
ld a,[hl+] ; get byte
ld b,a ; store it for further processing
and a,$F0 ; leave upper nible, remove lower one
swap a ; swap nibbles with places, lower is upper now and upper is lower
or $30 ; upper nibble is 3, lower keeps its value - we have valid number in ascii notation now
ld [de],a ; put it on screen - map actually
inc de ; next map entry
ld a,b ; restore byte and repeat process above to lower nibble
and a,$0F
or $30
ld [de],a
inc de
dec c ; repeat 3 times
jr nz,.copy
reti
;-------------------------------------------------------------------------------
parse_input:
;-------------------------------------------------------------------------------
call read_keys ; read joypad
.btn_a
bit 0,c ; is button a pressed ? (bit must be 1)
jr z,.btn_b ; no, check other key (apparently it's 0)
ld bc,1 ; 1 - thousands and hundreds
ld a,$30 ; increase score by 3000
call increase_score ; read explanation there
ret
.btn_b
bit 1,c ; ...
jr z,.right
ld bc,1
ld a,$30 ; decrease score by 3000
call decrease_score
ret
.right
bit 4,b ; b has no debounce check, counter will be increasing while button is pressed
jr z,.left
ld bc,2 ; 2 - tens and ones
ld a,$01 ; increase score by 1
call increase_score
ret
.left
bit 5,b
jr z,.up
ld bc,2
ld a,$01 ; decrease score by 1
call decrease_score
ret
.up
bit 6,c
jr z,.down
ld bc,2 ; 2 - tens and ones
ld a,$20 ; increase score by 20
call increase_score
ret
.down
bit 7,c
jr z,.done
ld bc,2
ld a,$20 ; decrease score by 20
call decrease_score
.done
ret
;-------------------------------------------------------------------------------
copy:
;-------------------------------------------------------------------------------
; hl - source address
; de - destination
; bc - size
inc b
inc c
jr .skip
.copy
ld a,[hl+]
ld [de],a
inc de
.skip
dec c
jr nz,.copy
dec b
jr nz,.copy
ret
;-------------------------------------------------------------------------------
copy_text:
;-------------------------------------------------------------------------------
; hl - text to display
; de - _SCRN0 or _SCRN1
; b - rows
; c - columns
.next_row
ld c,20
.row
ld a,[hl+] ; fetch one byte from text array and increase hl to point to another one
ld [de],a ; store it at _SCRN0
inc de ; unfortunately there's no [de+]
dec c ; one byte done
jr nz,.row ; next byte, copy untill c=0
ld a,e ; our row = 20 which is what you can see on the screen
add a,12 ; the part you don't see = 12, so we need to add it
jr nc,.skip ; to make sure the next row is copied at right offset
inc d ; nc flag is set when a+12 > 255
.skip
ld e,a
dec b ; next row, copy untill b=0
jr nz,.next_row
ret
;-------------------------------------------------------------------------------
fill:
;-------------------------------------------------------------------------------
; a - byte to fill with
; hl - destination address
; bc - size of area to fill
inc b
inc c
jr .skip
.fill
ld [hl+],a
.skip
dec c
jr nz,.fill
dec b
jr nz,.fill
ret
;-------------------------------------------------------------------------------
read_keys:
;-------------------------------------------------------------------------------
; this function returns two different values in b and c registers:
; b - returns raw state (pressing key triggers given action continuously as long as it's pressed - it does not prevent bouncing)
; c - returns debounced state (pressing key triggers given action only once - key must be released and pressed again)
ld a,$20 ; read P15 - returns a, b, select, start
ldh [rP1],a
ldh a,[rP1] ; mandatory
ldh a,[rP1]
cpl ; rP1 returns not pressed keys as 1 and pressed as 0, invert it to make result more readable
and $0f ; lower nibble has a, b, select, start state
swap a
ld b,a
ld a,$10 ; read P14 - returns up, down, left, right
ldh [rP1],a
ldh a,[rP1] ; mandatory
ldh a,[rP1]
ldh a,[rP1]
ldh a,[rP1]
ldh a,[rP1]
ldh a,[rP1]
cpl ; rP1 returns not pressed keys as 1 and pressed as 0, invert it to make result more readable
and $0f ; lower nibble has up, down, left, right state
or b ; combine P15 and P14 states in one byte
ld b,a ; store it
ldh a,[previous] ; this is when important part begins, load previous P15 & P14 state
xor b ; result will be 0 if it's the same as current read
and b ; keep buttons that were pressed during this read only
ldh [current],a ; store final result in variable and register
ld c,a
ld a,b ; current P15 & P14 state will be previous in next read
ldh [previous],a
ld a,$30 ; reset rP1
ldh [rP1],a
ret
;-------------------------------------------------------------------------------
increase_score:
;-------------------------------------------------------------------------------
; score consists of 3 bytes, each byte holds two digits in bcd format ie. 00 - 99
; bc - points to a pair of digits in score
; 0 - hundreds of thousands and tens of thousands, 1 - thousands and hundreds, 2 - tens and ones
; a - value of register (upper/lower byte) decides which digit gets increased, use bcd values only ie. $01, $20, $09, etc.
; hl - score offset in ram
ld hl,score ; get offset
add hl,bc ; move to a pair of digits to be updated
inc c ; recycle pointer to a counter of pair of digits left
add a,[hl] ; add selected pair of digits to value
daa ; keep result as bcd
ld [hl-],a ; store it and move to another pair of digits
ret nc ; carry flag is set when overflow occurs (ie. $99 + $20 = $19), we need to update other pairs then
.recurse
dec c ; counter keeps track of pair of digits we're dealing with
ret z
ld a,b ; b = 0 here, we save 1 byte and 4 cycles by not using ld b,0
adc a,[hl] ; carry flag is set so 1 will be added to adjacent pair of digits
daa ; keep result as bcd
ld [hl-],a ; store it
call c,.recurse ; if there's overflow go to another pair of digits (update the rest of the score)
ret
;-------------------------------------------------------------------------------
decrease_score:
;-------------------------------------------------------------------------------
; clone of increase_score that does subtraction, look at the comments above
ld hl,score
add hl,bc
inc c
ld b,a
ld a,[hl]
sub a,b
daa
ld [hl-],a
ret nc
ld b,0
.recurse
dec c
ret z
ld a,[hl]
sbc a,b
daa
ld [hl-],a
call c,.recurse
ret
;-------------------------------------------------------------------------------
font:
INCBIN "font_8x8.chr" ; converted with https://github.com/gitendo/bmp2cgb
text:
DB " Score: "
DB " "
DB " 00000 "
DB " "
DB " Press UP or DOWN, "
DB " LEFT or RIGHT, "
DB " A or B "
DB " to update score. "
;-------------------------------------------------------------------------------
SECTION "Variables",HRAM
score: DS 3 ; score in bcd format, ranges from 000000 to 999999, should be enough for most games ;)
current: DS 1 ; usually you read keys state and store it into variable for further processing
previous: DS 1 ; this is previous keys state used by debouncing part of read_keys function
|
src/Sized.agda | jstolarek/dep-typed-wbl-heaps | 1 | 10591 | <filename>src/Sized.agda
-- This module is copied from Agda's standard library. It has been
-- renamed (original name is Size) to avoid name clash in case you
-- have the standard library installed.
------------------------------------------------------------------------
-- The Agda standard library
--
-- Sizes for Agda's sized types
------------------------------------------------------------------------
module Sized where
postulate
Size : Set
↑_ : Size → Size
∞ : Size
{-# BUILTIN SIZE Size #-}
{-# BUILTIN SIZESUC ↑_ #-}
{-# BUILTIN SIZEINF ∞ #-}
|
src/cpu/registers_asm.asm | AlexandreArduino/mykernel | 9 | 15258 | <filename>src/cpu/registers_asm.asm<gh_stars>1-10
[BITS 64]
GLOBAL dump_registers_asm
GLOBAL registers_saved
GLOBAL number_registers
REGISTERS_COUNT equ 13
number_registers:
dw REGISTERS_COUNT
registers_saved:
resb 8 * REGISTERS_COUNT
dump_registers_asm:
mov [registers_saved], rax
mov [registers_saved + 8], rbx
mov [registers_saved + 16], rcx
mov [registers_saved + 24], rdx
mov [registers_saved + 32], rsi
mov [registers_saved + 40], rdi
mov [registers_saved + 48], r8
mov [registers_saved + 56], r9
mov [registers_saved + 64], r10
mov [registers_saved + 72], r11
mov [registers_saved + 80], r12
mov [registers_saved + 88], r13
mov [registers_saved + 96], r14
mov [registers_saved + 104], r15
ret |
agda/Data/Unit.agda | oisdk/combinatorics-paper | 6 | 2169 | <reponame>oisdk/combinatorics-paper<gh_stars>1-10
{-# OPTIONS --without-K --safe #-}
module Data.Unit where
open import Agda.Builtin.Unit public
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/slice2.adb | best08618/asylo | 7 | 1258 | <reponame>best08618/asylo
-- { dg-do compile }
-- { dg-options "-O" }
package body Slice2 is
function F (I : R1) return R2 is
Val : R2;
begin
Val.Text (1 .. 8) := I.Text (1 .. 8);
return Val;
end F;
end Slice2;
|
getcount.asm | SchneiderAJ/Metis2020 | 0 | 1732 | .code
GetCountAsm proc
mov rax, 0
ret
GetCountAsm endp
end |
Lenguajes de interfaz/prac07.asm | Abel-RM/materias-tec | 0 | 22752 | <filename>Lenguajes de interfaz/prac07.asm
title prac07
.model small
.data
nd1 db 5h,2h,1h
nd2 db 4h,8h,4h
res db 0h,0h,0h
msg db "error$",0ah,0dh
.code
main proc near
.startup
mov al,nd1+2
sub al,nd2+2
aas
mov res+2,al
mov al,nd1+1
sbb al,nd2+1
aas
mov res+1,al
mov al,nd1
sbb al,nd2
aas
mov res,al
;imprimir resultados
mov bx,0001h
mov ah,02h
mov dl,res
add dl,30h
int 21h
mov dl,res+1
add dl,30h
int 21h
mov dl,res+2
add dl,30h
int 21h
.exit
main endp
end |
Week5-Task-Code/1.asm | mdabdullahibnaharun/Assembly-Language | 0 | 161146 | <gh_stars>0
org 100h
include "emu8086.inc"
.model small
.stack 100h
.data
.code
main proc
mov cx , 80 ; numb of strs to display
mov ah , 2 ; display char function
mov dl , '*' ; char to display
loop_strs:
int 21h ; display a star
loop loop_strs ; repeat 80 times
mov ah,4ch
int 21h
main endp
DEFINE_SCAN_NUM ;cx
DEFINE_PRINT_NUM ;ax
DEFINE_PRINT_NUM_UNS ;ax
DEFINE_PRINT_STRING ;ds/si
end main
ret |
src/lib/searching-source.applescript | kamontat/iMessageAPI | 3 | 667 | -- ---------------------------------
-- BSD 3-Clause License
-- Copyright (c) 2017, <NAME> All rights reserved.
-- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-- * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-- WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-- ---------------------------------
-- Creator: <NAME>
-- Create at: 19/08/2560
-- Update at: 19/08/2560
-- Version: 2.0.0
-- ---------------------------------
property code_tag : "searching_iMessage_APIs"
property code_desc : "Add logger to script"
property code_version : "v2.1.1"
property str_size : 100
property iPhone_label : "iPhone"
property mobile_label : "mobile"
property email_label : "email"
property iCloud_label : "iCloud"
----- TESTING CODE -----
-- tell application "Contacts"
-- tell SEARCH
-- log (getiPhone from "Nattana")
-- log (getiCloud from "Nattana")
-- set pp to searchPeople by "Nat"
-- repeat with p in pp
-- log (get name of p)
-- end repeat
-- end tell
-- end tell
----- END TESTING CODE -----
script SEARCH
-- log to system log
-- @params - msg - message to log
to syslog(msg)
-- log "logger -t '" & code_tag & "'" & msg
do shell script "logger -t '" & code_tag & "' " & "\"" & msg & "\""
end syslog
-- @return only version
to getVersion()
syslog("get version " & code_version)
return code_version
end getVersion
-- @return version and description
to versionToString()
syslog("print version " & code_version)
return code_desc & " (" & code_version & ")"
end versionToString
to replaceNL(someText)
return my replaceText(someText, "
", " ")
end replaceNL
to replaceSpace(someText)
return my replaceText(someText, " ", "")
end replaceSpace
to replaceDash(someText)
return my replaceText(someText, "-", "")
end replaceDash
to replaceText(someText, oldItem, newItem)
set {tempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, oldItem}
try
set {itemList, AppleScript's text item delimiters} to {text items of someText, newItem}
set {someText, AppleScript's text item delimiters} to {itemList as text, tempTID}
on error errorMessage number errorNumber -- oops
set AppleScript's text item delimiters to tempTID
error errorMessage number errorNumber -- pass it on
end try
return someText
end replaceText
-- check is regex matches with every text of person (just one of them is enough)
-- @params - eachPerson - input person
-- @params - regex - searching text
-- @params - checked - bypass method by return true
-- @return boolean, true if matched or checked is true
to matchesTextParams(eachPerson, regex, checked)
if checked then return true
repeat with val in (properties of eachPerson) as list
if class of val = text and (count val) < str_size then
set newValue to replaceNL(val)
if newValue contains regex then
return true
end if
-- log {class of newValue, newValue, (count newValue)}
end if
end repeat
return false
end matchesTextParams
-- check is regex matches with telephone number of person or not
-- @params - eachPerson - input person
-- @params - regex - searching telephone number
-- @params - checked - bypass method by return true
-- @return boolean, true if matched or checked is true
to matchesTelephoneParams(eachPerson, regex, checked)
if checked then return true
tell application "Contacts"
repeat with val in (value of phones of eachPerson) as list
set newValue to my replaceNL(my replaceSpace(my replaceDash(val)))
if newValue contains regex then
return true
end if
-- log {class of newValue, newValue, (count newValue)}
end repeat
return false
end tell
end matchesTelephoneParams
-- check is regex matches with email of input person or not
-- @params - eachPerson - input person
-- @params - regex - searching email
-- @params - checked - bypass method by return true
-- @return boolean, true if matched or checked is true
to matchesEmailParams(eachPerson, regex, checked)
if checked then return true
tell application "Contacts"
repeat with val in (value of emails of eachPerson) as list
if val contains regex then
return true
end if
-- log {class of val, val, (count val)}
end repeat
return false
end tell
end matchesEmailParams
-- get people list or indv. person with regex return 1 element
-- @params - regex - searching text
-- @params - allPeople - {people list}, either people in Contact application or result of this method
-- @return {people} matches with regex or list of {person}
-- @throw 123 - if person with regex not found
to filterPeople by allPeople given regex:regex
syslog("filter person " & regex)
set peopleList to {}
tell application "Contacts"
repeat with eachPerson in allPeople
set s to false
set s to my matchesTextParams(eachPerson, regex, s) -- check with text parameters
set s to my matchesTelephoneParams(eachPerson, regex, s) -- check with telephone parameters
set s to my matchesEmailParams(eachPerson, regex, s) -- check with email parameters
if s then
copy eachPerson to end of peopleList
set s to false
end if
end repeat
set s to (count peopleList)
-- error
if s = 0 then
my syslog("filter person (error) zero result")
error "person regex = \"" & regex & "\" not found" number 123
-- indv person
else if s = 1 then
set p to first item of peopleList
my syslog("filter person (result) " & (name of p))
return p
-- else people
else
my syslog("filter person (result) " & s & " person(s)")
return peopleList
end if
end tell
end filterPeople
-- get all people by regex
-- @return {people} matches with regex or list of {person}
to searchPeople by regex
tell application "Contacts"
return filterPeople of me by people given regex:regex
end tell
end searchPeople
-- get indv person from given regex
-- @return {person}
-- @throw 155 - regex given more that 1 person
to getPerson from regex
tell application "Contacts"
set p to filterPeople of me by people given regex:regex
if class of p = list then
set str to "
"
set n to 0
repeat with pp in p
set str to str & " || " & (get name of pp)
set n to n + 1
if (n mod 5) = 0 then set str to str & "
"
end repeat
error "Too many person or regex not unique enough." & "
" & "List: (" & (count p) & ")" & (str) number 155
end if
return p
end tell
end getPerson
-- get iPhone phone number from regex person description (can be firstname lastname email telephone etc.)
-- if more than 1, get first only
-- @return text of iPhone
-- @throw 123 - if person with regex not found
-- @throw 124 - if phone label invalid
-- @throw 155 - regex given more that 1 person
to getiPhone from regex
return replaceDash(first item of (getPhones from regex by iPhone_label)'s item 2)
end getiPhone
-- get mobile phone from regex person description (can be firstname lastname email telephone etc.) with index specify (start with 1..n)
-- if more than 1, get first only
-- @return text of mobile phone
-- @throw 120 - if index too many
-- @throw 123 - if person with regex not found
-- @throw 124 - if phone label invalid
-- @throw 155 - regex given more that 1 person
to getMobile from regex given index:index
set ms to getMobiles(regex)
set s to (count ms)
if s < index then
error "have " & s & ", but require " & index number 120
end if
return replaceDash(item index of ms)
end getMobile
-- get icloud mail from regex person description (can be firstname lastname email telephone etc.)
-- @return text of iCloud mail
-- @throw 123 - if person with regex not found
-- @throw 125 - if email label invalid
-- @throw 155 - regex given more that 1 person
to getiCloud from regex
return first item of (getEmails from regex by iCloud_label)'s item 2
end getiCloud
-- get mobile phones number from regex person description (can be firstname lastname email telephone etc.)
-- @return format: list("TEL1", "TEL2", ...)
-- @throw 123 - if person with regex not found
-- @throw 124 - if phone label invalid
-- @throw 155 - regex given more that 1 person
to getMobiles from regex
return (getPhones from regex by mobile_label)'s item 2
end getMobiles
-- get phones from regex person description (can be firstname lastname email telephone etc.)
-- @return format: list("LABEL", "TEL1", "TEL2", ...)
-- @throw 123 - if person with regex not found
-- @throw 124 - if phone label invalid
-- @throw 155 - regex given more that 1 person
to getPhones from regex by pLabel
tell application "Contacts"
set p to getPerson of me from regex
set phoneList to value of phones of p whose label = pLabel
if (count phoneList) = 0 then
error "phone label = \"" & pLabel & "\" not found" number 124
end if
return {pLabel, phoneList}
end tell
end getPhones
-- get emails from regex person description (can be firstname lastname email telephone etc.)
-- @return format: list("LABEL", "MAIL1", "MAIL2", ...)
-- @throw 123 - if person with regex not found
-- @throw 125 - if email label invalid
-- @throw 155 - regex given more that 1 person
to getEmails from regex by eLabel
tell application "Contacts"
set p to getPerson of me from regex
set emailList to value of emails of p whose label = eLabel
if (count emailList) = 0 then
error "email label = \"" & eLabel & "\" not found" number 125
end if
return {eLabel, emailList}
end tell
end getEmails
end script |
programs/oeis/248/A248337.asm | neoneye/loda | 22 | 166623 | ; A248337: 6^n - 4^n.
; 0,2,20,152,1040,6752,42560,263552,1614080,9815552,59417600,358602752,2160005120,12993585152,78095728640,469111242752,2816814940160,16909479575552,101491237191680,609084862103552,3655058928435200,21932552593866752
mov $2,$0
mov $0,6
pow $0,$2
mov $1,4
pow $1,$2
sub $0,$1
|
oeis/226/A226705.asm | neoneye/loda-programs | 11 | 12623 | <filename>oeis/226/A226705.asm
; A226705: G.f.: 1 / (1 + 12*x*G(x)^4 - 16*x*G^5) where G(x) = 1 + x*G(x)^6 is the g.f. of A002295.
; Submitted by <NAME>
; 1,4,48,600,7856,105684,1447392,20075416,281086416,3964453368,56240518128,801624722232,11470976280960,164691196943212,2371222443727584,34224696393237360,495036708728067088,7173892793100898728,104135761805147016096,1513892435551302963792,22038120029359538166096,321204966935519976819732,4686727047771407759936864,68453344121913122137547328,1000738214719371376823408256,14642484251649327122287099584,214411924463767156482532212240,3141938022443784176598530205000,46072116572335313516249093836224
mov $3,$0
mov $5,$0
add $5,1
lpb $5
mov $0,$3
mul $2,5
sub $5,1
sub $0,$5
add $0,$2
bin $0,$2
mov $2,$3
mul $4,-2
add $4,$0
lpe
mov $0,$4
|
test/Succeed/Issue384.agda | shlevy/agda | 1,989 | 16182 | <gh_stars>1000+
module Issue384 where
postulate
D : (A : Set) → A → Set
data I : Set where
i : I
D′ : (A : Set) → A → I → Set
D′ A x i = D A x
postulate
Q : (A : Set) → A → Set
q : ∀ j A (x : A) → D′ A x j → Q A x
A : Set
x : A
d : D A x
P : (A : Set) → A → Set
p : P (Q _ _) (q _ _ _ d)
|
ChaosTheory/ChaosTheory/Binary/music.asm | spheenik/conspiracy | 19 | 4850 | <gh_stars>10-100
;----------------------------------------
%macro include_binary 2
global %1
%1 incbin %2
%1end:
global %1_size
%1_size dd %1end - %1
%endmacro
;----------------------------------------
section .data
include_binary _music, "music.mvm"
|
extern/gnat_sdl/gnat_sdl2/src/sdl_surface_h.ads | AdaCore/training_material | 15 | 26828 | pragma Ada_2005;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with SDL_stdinc_h;
limited with SDL_pixels_h;
with System;
with SDL_rect_h;
limited with SDL_rwops_h;
with SDL_blendmode_h;
package SDL_surface_h is
SDL_SWSURFACE : constant := 0; -- ..\SDL2_tmp\SDL_surface.h:52
SDL_PREALLOC : constant := 16#00000001#; -- ..\SDL2_tmp\SDL_surface.h:53
SDL_RLEACCEL : constant := 16#00000002#; -- ..\SDL2_tmp\SDL_surface.h:54
SDL_DONTFREE : constant := 16#00000004#; -- ..\SDL2_tmp\SDL_surface.h:55
-- arg-macro: function SDL_MUSTLOCK (S)
-- return ((S).flags and SDL_RLEACCEL) /= 0;
-- arg-macro: procedure SDL_LoadBMP (file)
-- SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
-- arg-macro: procedure SDL_SaveBMP (surface, file)
-- SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
-- unsupported macro: SDL_BlitSurface SDL_UpperBlit
-- unsupported macro: SDL_BlitScaled SDL_UpperBlitScaled
-- Simple DirectMedia Layer
-- Copyright (C) 1997-2018 <NAME> <<EMAIL>>
-- This software is provided 'as-is', without any express or implied
-- warranty. In no event will the authors be held liable for any damages
-- arising from the use of this software.
-- Permission is granted to anyone to use this software for any purpose,
-- including commercial applications, and to alter it and redistribute it
-- freely, subject to the following restrictions:
-- 1. The origin of this software must not be misrepresented; you must not
-- claim that you wrote the original software. If you use this software
-- in a product, an acknowledgment in the product documentation would be
-- appreciated but is not required.
-- 2. Altered source versions must be plainly marked as such, and must not be
-- misrepresented as being the original software.
-- 3. This notice may not be removed or altered from any source distribution.
--
--*
-- * \file SDL_surface.h
-- *
-- * Header file for ::SDL_Surface definition and management functions.
--
-- Set up for C function definitions, even when using C++
--*
-- * \name Surface flags
-- *
-- * These are the currently supported flags for the ::SDL_Surface.
-- *
-- * \internal
-- * Used internally (read-only).
--
-- @{
-- @}
-- Surface flags
--*
-- * Evaluates to true if the surface needs to be locked before access.
--
--*
-- * \brief A collection of pixels used in software blitting.
-- *
-- * \note This structure should be treated as read-only, except for \c pixels,
-- * which, if not NULL, contains the raw pixel data for the surface.
--
--*< Read-only
type SDL_BlitMap;
type SDL_Surface is record
flags : aliased SDL_stdinc_h.Uint32; -- ..\SDL2_tmp\SDL_surface.h:71
format : access SDL_pixels_h.SDL_PixelFormat; -- ..\SDL2_tmp\SDL_surface.h:72
w : aliased int; -- ..\SDL2_tmp\SDL_surface.h:73
h : aliased int; -- ..\SDL2_tmp\SDL_surface.h:73
pitch : aliased int; -- ..\SDL2_tmp\SDL_surface.h:74
pixels : System.Address; -- ..\SDL2_tmp\SDL_surface.h:75
userdata : System.Address; -- ..\SDL2_tmp\SDL_surface.h:78
locked : aliased int; -- ..\SDL2_tmp\SDL_surface.h:81
lock_data : System.Address; -- ..\SDL2_tmp\SDL_surface.h:82
clip_rect : aliased SDL_rect_h.SDL_Rect; -- ..\SDL2_tmp\SDL_surface.h:85
map : access SDL_BlitMap; -- ..\SDL2_tmp\SDL_surface.h:88
refcount : aliased int; -- ..\SDL2_tmp\SDL_surface.h:91
end record;
pragma Convention (C_Pass_By_Copy, SDL_Surface); -- ..\SDL2_tmp\SDL_surface.h:69
--*< Read-only
--*< Read-only
--*< Read-only
--*< Read-write
--* Application data associated with the surface
--*< Read-write
--* information needed for surfaces requiring locks
--*< Read-only
--*< Read-only
--* clipping information
--*< Read-only
--* info for fast blit mapping to other surfaces
--*< Private
type SDL_BlitMap is null record; -- incomplete struct
--* Reference count -- used when freeing surface
--*< Read-mostly
--*
-- * \brief The type of function used for surface blitting functions.
--
type SDL_blit is access function
(arg1 : access SDL_Surface;
arg2 : access SDL_rect_h.SDL_Rect;
arg3 : access SDL_Surface;
arg4 : access SDL_rect_h.SDL_Rect) return int;
pragma Convention (C, SDL_blit); -- ..\SDL2_tmp\SDL_surface.h:97
--*
-- * \brief The formula used for converting between YUV and RGB
--
--*< Full range JPEG
--*< BT.601 (the default)
--*< BT.709
--*< BT.601 for SD content, BT.709 for HD content
type SDL_YUV_CONVERSION_MODE is
(SDL_YUV_CONVERSION_JPEG,
SDL_YUV_CONVERSION_BT601,
SDL_YUV_CONVERSION_BT709,
SDL_YUV_CONVERSION_AUTOMATIC);
pragma Convention (C, SDL_YUV_CONVERSION_MODE); -- ..\SDL2_tmp\SDL_surface.h:109
--*
-- * Allocate and free an RGB surface.
-- *
-- * If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
-- * If the depth is greater than 8 bits, the pixel format is set using the
-- * flags '[RGB]mask'.
-- *
-- * If the function runs out of memory, it will return NULL.
-- *
-- * \param flags The \c flags are obsolete and should be set to 0.
-- * \param width The width in pixels of the surface to create.
-- * \param height The height in pixels of the surface to create.
-- * \param depth The depth in bits of the surface to create.
-- * \param Rmask The red mask of the surface to create.
-- * \param Gmask The green mask of the surface to create.
-- * \param Bmask The blue mask of the surface to create.
-- * \param Amask The alpha mask of the surface to create.
--
function SDL_CreateRGBSurface
(flags : SDL_stdinc_h.Uint32;
width : int;
height : int;
depth : int;
Rmask : SDL_stdinc_h.Uint32;
Gmask : SDL_stdinc_h.Uint32;
Bmask : SDL_stdinc_h.Uint32;
Amask : SDL_stdinc_h.Uint32) return access SDL_Surface; -- ..\SDL2_tmp\SDL_surface.h:129
pragma Import (C, SDL_CreateRGBSurface, "SDL_CreateRGBSurface");
-- !!! FIXME for 2.1: why does this ask for depth? Format provides that.
function SDL_CreateRGBSurfaceWithFormat
(flags : SDL_stdinc_h.Uint32;
width : int;
height : int;
depth : int;
format : SDL_stdinc_h.Uint32) return access SDL_Surface; -- ..\SDL2_tmp\SDL_surface.h:134
pragma Import (C, SDL_CreateRGBSurfaceWithFormat, "SDL_CreateRGBSurfaceWithFormat");
function SDL_CreateRGBSurfaceFrom
(pixels : System.Address;
width : int;
height : int;
depth : int;
pitch : int;
Rmask : SDL_stdinc_h.Uint32;
Gmask : SDL_stdinc_h.Uint32;
Bmask : SDL_stdinc_h.Uint32;
Amask : SDL_stdinc_h.Uint32) return access SDL_Surface; -- ..\SDL2_tmp\SDL_surface.h:137
pragma Import (C, SDL_CreateRGBSurfaceFrom, "SDL_CreateRGBSurfaceFrom");
function SDL_CreateRGBSurfaceWithFormatFrom
(pixels : System.Address;
width : int;
height : int;
depth : int;
pitch : int;
format : SDL_stdinc_h.Uint32) return access SDL_Surface; -- ..\SDL2_tmp\SDL_surface.h:146
pragma Import (C, SDL_CreateRGBSurfaceWithFormatFrom, "SDL_CreateRGBSurfaceWithFormatFrom");
procedure SDL_FreeSurface (surface : access SDL_Surface); -- ..\SDL2_tmp\SDL_surface.h:148
pragma Import (C, SDL_FreeSurface, "SDL_FreeSurface");
--*
-- * \brief Set the palette used by a surface.
-- *
-- * \return 0, or -1 if the surface format doesn't use a palette.
-- *
-- * \note A single palette can be shared with many surfaces.
--
function SDL_SetSurfacePalette (surface : access SDL_Surface; palette : access SDL_pixels_h.SDL_Palette) return int; -- ..\SDL2_tmp\SDL_surface.h:157
pragma Import (C, SDL_SetSurfacePalette, "SDL_SetSurfacePalette");
--*
-- * \brief Sets up a surface for directly accessing the pixels.
-- *
-- * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write
-- * to and read from \c surface->pixels, using the pixel format stored in
-- * \c surface->format. Once you are done accessing the surface, you should
-- * use SDL_UnlockSurface() to release it.
-- *
-- * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
-- * to 0, then you can read and write to the surface at any time, and the
-- * pixel format of the surface will not change.
-- *
-- * No operating system or library calls should be made between lock/unlock
-- * pairs, as critical system locks may be held during this time.
-- *
-- * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
-- *
-- * \sa SDL_UnlockSurface()
--
function SDL_LockSurface (surface : access SDL_Surface) return int; -- ..\SDL2_tmp\SDL_surface.h:179
pragma Import (C, SDL_LockSurface, "SDL_LockSurface");
--* \sa SDL_LockSurface()
procedure SDL_UnlockSurface (surface : access SDL_Surface); -- ..\SDL2_tmp\SDL_surface.h:181
pragma Import (C, SDL_UnlockSurface, "SDL_UnlockSurface");
--*
-- * Load a surface from a seekable SDL data stream (memory or file).
-- *
-- * If \c freesrc is non-zero, the stream will be closed after being read.
-- *
-- * The new surface should be freed with SDL_FreeSurface().
-- *
-- * \return the new surface, or NULL if there was an error.
--
function SDL_LoadBMP_RW (src : access SDL_rwops_h.SDL_RWops; freesrc : int) return access SDL_Surface; -- ..\SDL2_tmp\SDL_surface.h:192
pragma Import (C, SDL_LoadBMP_RW, "SDL_LoadBMP_RW");
--*
-- * Load a surface from a file.
-- *
-- * Convenience macro.
--
--*
-- * Save a surface to a seekable SDL data stream (memory or file).
-- *
-- * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
-- * BMP directly. Other RGB formats with 8-bit or higher get converted to a
-- * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
-- * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
-- * not supported.
-- *
-- * If \c freedst is non-zero, the stream will be closed after being written.
-- *
-- * \return 0 if successful or -1 if there was an error.
--
function SDL_SaveBMP_RW
(surface : access SDL_Surface;
dst : access SDL_rwops_h.SDL_RWops;
freedst : int) return int; -- ..\SDL2_tmp\SDL_surface.h:215
pragma Import (C, SDL_SaveBMP_RW, "SDL_SaveBMP_RW");
--*
-- * Save a surface to a file.
-- *
-- * Convenience macro.
--
--*
-- * \brief Sets the RLE acceleration hint for a surface.
-- *
-- * \return 0 on success, or -1 if the surface is not valid
-- *
-- * \note If RLE is enabled, colorkey and alpha blending blits are much faster,
-- * but the surface must be locked before directly accessing the pixels.
--
function SDL_SetSurfaceRLE (surface : access SDL_Surface; flag : int) return int; -- ..\SDL2_tmp\SDL_surface.h:234
pragma Import (C, SDL_SetSurfaceRLE, "SDL_SetSurfaceRLE");
--*
-- * \brief Sets the color key (transparent pixel) in a blittable surface.
-- *
-- * \param surface The surface to update
-- * \param flag Non-zero to enable colorkey and 0 to disable colorkey
-- * \param key The transparent pixel in the native surface format
-- *
-- * \return 0 on success, or -1 if the surface is not valid
-- *
-- * You can pass SDL_RLEACCEL to enable RLE accelerated blits.
--
function SDL_SetColorKey
(surface : access SDL_Surface;
flag : int;
key : SDL_stdinc_h.Uint32) return int; -- ..\SDL2_tmp\SDL_surface.h:248
pragma Import (C, SDL_SetColorKey, "SDL_SetColorKey");
--*
-- * \brief Returns whether the surface has a color key
-- *
-- * \return SDL_TRUE if the surface has a color key, or SDL_FALSE if the surface is NULL or has no color key
--
function SDL_HasColorKey (surface : access SDL_Surface) return SDL_stdinc_h.SDL_bool; -- ..\SDL2_tmp\SDL_surface.h:256
pragma Import (C, SDL_HasColorKey, "SDL_HasColorKey");
--*
-- * \brief Gets the color key (transparent pixel) in a blittable surface.
-- *
-- * \param surface The surface to update
-- * \param key A pointer filled in with the transparent pixel in the native
-- * surface format
-- *
-- * \return 0 on success, or -1 if the surface is not valid or colorkey is not
-- * enabled.
--
function SDL_GetColorKey (surface : access SDL_Surface; key : access SDL_stdinc_h.Uint32) return int; -- ..\SDL2_tmp\SDL_surface.h:268
pragma Import (C, SDL_GetColorKey, "SDL_GetColorKey");
--*
-- * \brief Set an additional color value used in blit operations.
-- *
-- * \param surface The surface to update.
-- * \param r The red color value multiplied into blit operations.
-- * \param g The green color value multiplied into blit operations.
-- * \param b The blue color value multiplied into blit operations.
-- *
-- * \return 0 on success, or -1 if the surface is not valid.
-- *
-- * \sa SDL_GetSurfaceColorMod()
--
function SDL_SetSurfaceColorMod
(surface : access SDL_Surface;
r : SDL_stdinc_h.Uint8;
g : SDL_stdinc_h.Uint8;
b : SDL_stdinc_h.Uint8) return int; -- ..\SDL2_tmp\SDL_surface.h:283
pragma Import (C, SDL_SetSurfaceColorMod, "SDL_SetSurfaceColorMod");
--*
-- * \brief Get the additional color value used in blit operations.
-- *
-- * \param surface The surface to query.
-- * \param r A pointer filled in with the current red color value.
-- * \param g A pointer filled in with the current green color value.
-- * \param b A pointer filled in with the current blue color value.
-- *
-- * \return 0 on success, or -1 if the surface is not valid.
-- *
-- * \sa SDL_SetSurfaceColorMod()
--
function SDL_GetSurfaceColorMod
(surface : access SDL_Surface;
r : access SDL_stdinc_h.Uint8;
g : access SDL_stdinc_h.Uint8;
b : access SDL_stdinc_h.Uint8) return int; -- ..\SDL2_tmp\SDL_surface.h:299
pragma Import (C, SDL_GetSurfaceColorMod, "SDL_GetSurfaceColorMod");
--*
-- * \brief Set an additional alpha value used in blit operations.
-- *
-- * \param surface The surface to update.
-- * \param alpha The alpha value multiplied into blit operations.
-- *
-- * \return 0 on success, or -1 if the surface is not valid.
-- *
-- * \sa SDL_GetSurfaceAlphaMod()
--
function SDL_SetSurfaceAlphaMod (surface : access SDL_Surface; alpha : SDL_stdinc_h.Uint8) return int; -- ..\SDL2_tmp\SDL_surface.h:313
pragma Import (C, SDL_SetSurfaceAlphaMod, "SDL_SetSurfaceAlphaMod");
--*
-- * \brief Get the additional alpha value used in blit operations.
-- *
-- * \param surface The surface to query.
-- * \param alpha A pointer filled in with the current alpha value.
-- *
-- * \return 0 on success, or -1 if the surface is not valid.
-- *
-- * \sa SDL_SetSurfaceAlphaMod()
--
function SDL_GetSurfaceAlphaMod (surface : access SDL_Surface; alpha : access SDL_stdinc_h.Uint8) return int; -- ..\SDL2_tmp\SDL_surface.h:326
pragma Import (C, SDL_GetSurfaceAlphaMod, "SDL_GetSurfaceAlphaMod");
--*
-- * \brief Set the blend mode used for blit operations.
-- *
-- * \param surface The surface to update.
-- * \param blendMode ::SDL_BlendMode to use for blit blending.
-- *
-- * \return 0 on success, or -1 if the parameters are not valid.
-- *
-- * \sa SDL_GetSurfaceBlendMode()
--
function SDL_SetSurfaceBlendMode (surface : access SDL_Surface; blendMode : SDL_blendmode_h.SDL_BlendMode) return int; -- ..\SDL2_tmp\SDL_surface.h:339
pragma Import (C, SDL_SetSurfaceBlendMode, "SDL_SetSurfaceBlendMode");
--*
-- * \brief Get the blend mode used for blit operations.
-- *
-- * \param surface The surface to query.
-- * \param blendMode A pointer filled in with the current blend mode.
-- *
-- * \return 0 on success, or -1 if the surface is not valid.
-- *
-- * \sa SDL_SetSurfaceBlendMode()
--
function SDL_GetSurfaceBlendMode (surface : access SDL_Surface; blendMode : access SDL_blendmode_h.SDL_BlendMode) return int; -- ..\SDL2_tmp\SDL_surface.h:352
pragma Import (C, SDL_GetSurfaceBlendMode, "SDL_GetSurfaceBlendMode");
--*
-- * Sets the clipping rectangle for the destination surface in a blit.
-- *
-- * If the clip rectangle is NULL, clipping will be disabled.
-- *
-- * If the clip rectangle doesn't intersect the surface, the function will
-- * return SDL_FALSE and blits will be completely clipped. Otherwise the
-- * function returns SDL_TRUE and blits to the surface will be clipped to
-- * the intersection of the surface area and the clipping rectangle.
-- *
-- * Note that blits are automatically clipped to the edges of the source
-- * and destination surfaces.
--
function SDL_SetClipRect (surface : access SDL_Surface; rect : access constant SDL_rect_h.SDL_Rect) return SDL_stdinc_h.SDL_bool; -- ..\SDL2_tmp\SDL_surface.h:368
pragma Import (C, SDL_SetClipRect, "SDL_SetClipRect");
--*
-- * Gets the clipping rectangle for the destination surface in a blit.
-- *
-- * \c rect must be a pointer to a valid rectangle which will be filled
-- * with the correct values.
--
procedure SDL_GetClipRect (surface : access SDL_Surface; rect : access SDL_rect_h.SDL_Rect); -- ..\SDL2_tmp\SDL_surface.h:377
pragma Import (C, SDL_GetClipRect, "SDL_GetClipRect");
-- * Creates a new surface identical to the existing surface
--
function SDL_DuplicateSurface (surface : access SDL_Surface) return access SDL_Surface; -- ..\SDL2_tmp\SDL_surface.h:383
pragma Import (C, SDL_DuplicateSurface, "SDL_DuplicateSurface");
--*
-- * Creates a new surface of the specified format, and then copies and maps
-- * the given surface to it so the blit of the converted surface will be as
-- * fast as possible. If this function fails, it returns NULL.
-- *
-- * The \c flags parameter is passed to SDL_CreateRGBSurface() and has those
-- * semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and
-- * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
-- * surface.
--
function SDL_ConvertSurface
(src : access SDL_Surface;
fmt : access constant SDL_pixels_h.SDL_PixelFormat;
flags : SDL_stdinc_h.Uint32) return access SDL_Surface; -- ..\SDL2_tmp\SDL_surface.h:395
pragma Import (C, SDL_ConvertSurface, "SDL_ConvertSurface");
function SDL_ConvertSurfaceFormat
(src : access SDL_Surface;
pixel_format : SDL_stdinc_h.Uint32;
flags : SDL_stdinc_h.Uint32) return access SDL_Surface; -- ..\SDL2_tmp\SDL_surface.h:397
pragma Import (C, SDL_ConvertSurfaceFormat, "SDL_ConvertSurfaceFormat");
--*
-- * \brief Copy a block of pixels of one format to another format
-- *
-- * \return 0 on success, or -1 if there was an error
--
function SDL_ConvertPixels
(width : int;
height : int;
src_format : SDL_stdinc_h.Uint32;
src : System.Address;
src_pitch : int;
dst_format : SDL_stdinc_h.Uint32;
dst : System.Address;
dst_pitch : int) return int; -- ..\SDL2_tmp\SDL_surface.h:405
pragma Import (C, SDL_ConvertPixels, "SDL_ConvertPixels");
--*
-- * Performs a fast fill of the given rectangle with \c color.
-- *
-- * If \c rect is NULL, the whole surface will be filled with \c color.
-- *
-- * The color should be a pixel of the format used by the surface, and
-- * can be generated by the SDL_MapRGB() function.
-- *
-- * \return 0 on success, or -1 on error.
--
function SDL_FillRect
(dst : access SDL_Surface;
rect : access constant SDL_rect_h.SDL_Rect;
color : SDL_stdinc_h.Uint32) return int; -- ..\SDL2_tmp\SDL_surface.h:421
pragma Import (C, SDL_FillRect, "SDL_FillRect");
function SDL_FillRects
(dst : access SDL_Surface;
rects : access constant SDL_rect_h.SDL_Rect;
count : int;
color : SDL_stdinc_h.Uint32) return int; -- ..\SDL2_tmp\SDL_surface.h:423
pragma Import (C, SDL_FillRects, "SDL_FillRects");
--*
-- * Performs a fast blit from the source surface to the destination surface.
-- *
-- * This assumes that the source and destination rectangles are
-- * the same size. If either \c srcrect or \c dstrect are NULL, the entire
-- * surface (\c src or \c dst) is copied. The final blit rectangles are saved
-- * in \c srcrect and \c dstrect after all clipping is performed.
-- *
-- * \return If the blit is successful, it returns 0, otherwise it returns -1.
-- *
-- * The blit function should not be called on a locked surface.
-- *
-- * The blit semantics for surfaces with and without blending and colorkey
-- * are defined as follows:
-- * \verbatim
-- RGBA->RGB:
-- Source surface blend mode set to SDL_BLENDMODE_BLEND:
-- alpha-blend (using the source alpha-channel and per-surface alpha)
-- SDL_SRCCOLORKEY ignored.
-- Source surface blend mode set to SDL_BLENDMODE_NONE:
-- copy RGB.
-- if SDL_SRCCOLORKEY set, only copy the pixels matching the
-- RGB values of the source color key, ignoring alpha in the
-- comparison.
-- RGB->RGBA:
-- Source surface blend mode set to SDL_BLENDMODE_BLEND:
-- alpha-blend (using the source per-surface alpha)
-- Source surface blend mode set to SDL_BLENDMODE_NONE:
-- copy RGB, set destination alpha to source per-surface alpha value.
-- both:
-- if SDL_SRCCOLORKEY set, only copy the pixels matching the
-- source color key.
-- RGBA->RGBA:
-- Source surface blend mode set to SDL_BLENDMODE_BLEND:
-- alpha-blend (using the source alpha-channel and per-surface alpha)
-- SDL_SRCCOLORKEY ignored.
-- Source surface blend mode set to SDL_BLENDMODE_NONE:
-- copy all of RGBA to the destination.
-- if SDL_SRCCOLORKEY set, only copy the pixels matching the
-- RGB values of the source color key, ignoring alpha in the
-- comparison.
-- RGB->RGB:
-- Source surface blend mode set to SDL_BLENDMODE_BLEND:
-- alpha-blend (using the source per-surface alpha)
-- Source surface blend mode set to SDL_BLENDMODE_NONE:
-- copy RGB.
-- both:
-- if SDL_SRCCOLORKEY set, only copy the pixels matching the
-- source color key.
-- \endverbatim
-- *
-- * You should call SDL_BlitSurface() unless you know exactly how SDL
-- * blitting works internally and how to use the other blit functions.
--
--*
-- * This is the public blit function, SDL_BlitSurface(), and it performs
-- * rectangle validation and clipping before passing it to SDL_LowerBlit()
--
function SDL_UpperBlit
(src : access SDL_Surface;
srcrect : access constant SDL_rect_h.SDL_Rect;
dst : access SDL_Surface;
dstrect : access SDL_rect_h.SDL_Rect) return int; -- ..\SDL2_tmp\SDL_surface.h:489
pragma Import (C, SDL_UpperBlit, "SDL_UpperBlit");
--*
-- * This is a semi-private blit function and it performs low-level surface
-- * blitting only.
--
function SDL_LowerBlit
(src : access SDL_Surface;
srcrect : access SDL_rect_h.SDL_Rect;
dst : access SDL_Surface;
dstrect : access SDL_rect_h.SDL_Rect) return int; -- ..\SDL2_tmp\SDL_surface.h:497
pragma Import (C, SDL_LowerBlit, "SDL_LowerBlit");
--*
-- * \brief Perform a fast, low quality, stretch blit between two surfaces of the
-- * same pixel format.
-- *
-- * \note This function uses a static buffer, and is not thread-safe.
--
function SDL_SoftStretch
(src : access SDL_Surface;
srcrect : access constant SDL_rect_h.SDL_Rect;
dst : access SDL_Surface;
dstrect : access constant SDL_rect_h.SDL_Rect) return int; -- ..\SDL2_tmp\SDL_surface.h:507
pragma Import (C, SDL_SoftStretch, "SDL_SoftStretch");
--*
-- * This is the public scaled blit function, SDL_BlitScaled(), and it performs
-- * rectangle validation and clipping before passing it to SDL_LowerBlitScaled()
--
function SDL_UpperBlitScaled
(src : access SDL_Surface;
srcrect : access constant SDL_rect_h.SDL_Rect;
dst : access SDL_Surface;
dstrect : access SDL_rect_h.SDL_Rect) return int; -- ..\SDL2_tmp\SDL_surface.h:518
pragma Import (C, SDL_UpperBlitScaled, "SDL_UpperBlitScaled");
--*
-- * This is a semi-private blit function and it performs low-level surface
-- * scaled blitting only.
--
function SDL_LowerBlitScaled
(src : access SDL_Surface;
srcrect : access SDL_rect_h.SDL_Rect;
dst : access SDL_Surface;
dstrect : access SDL_rect_h.SDL_Rect) return int; -- ..\SDL2_tmp\SDL_surface.h:526
pragma Import (C, SDL_LowerBlitScaled, "SDL_LowerBlitScaled");
--*
-- * \brief Set the YUV conversion mode
--
procedure SDL_SetYUVConversionMode (mode : SDL_YUV_CONVERSION_MODE); -- ..\SDL2_tmp\SDL_surface.h:533
pragma Import (C, SDL_SetYUVConversionMode, "SDL_SetYUVConversionMode");
--*
-- * \brief Get the YUV conversion mode
--
function SDL_GetYUVConversionMode return SDL_YUV_CONVERSION_MODE; -- ..\SDL2_tmp\SDL_surface.h:538
pragma Import (C, SDL_GetYUVConversionMode, "SDL_GetYUVConversionMode");
--*
-- * \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
--
function SDL_GetYUVConversionModeForResolution (width : int; height : int) return SDL_YUV_CONVERSION_MODE; -- ..\SDL2_tmp\SDL_surface.h:543
pragma Import (C, SDL_GetYUVConversionModeForResolution, "SDL_GetYUVConversionModeForResolution");
-- Ends C function definitions when using C++
-- vi: set ts=4 sw=4 expandtab:
end SDL_surface_h;
|
third_party/antlr_grammars_v4/apt/apt.g4 | mikhan808/rsyntaxtextarea-antlr4-extension | 4 | 5335 | // Generated with UniGrammar (https://gitlab.com/KOLANICH/UniGrammar.py)
// for antlr4 (https://github.com/antlr/antlr4) backend
grammar apt;
// productions
record: commented=commenterR? rType=TypeR WSS options=optionsR? uri=uriR WSS distribution=wordWithDash components=componentsR WSS?;
wordWithDashSegment: Word | Dash;
wordWithDash: wordWithDashSegment+;
component: WSS cId=wordWithDash;
componentsR: component+;
optionsR: openingBrace=OptionsStart pairs=optionsList closingBrace=OptionsEnd WSS;
optionsList: firstOption=optionR restOptions=additionalOptions;
additionalOptions: additionalOption*;
additionalOption: separator=OptionsSeparator option=optionR;
optionR: key=OptionName OptionNameValueSeparator value=optionValue;
wordWithPlus: Plus word=Word;
uriSchema: word=Word restWords=restSchemaWords;
restSchemaWords: wordWithPlus*;
genericURI: schema=uriSchema Colon restOfURI=nonSpaceString;
uriR: cdromURI | genericURI;
commenterR: CommentMarker WSS;
optionValueSegment: Word | PunctuationAllowedInOptionValue | Dash | OptionName | CdromSchema | TypeR | Plus | Colon;
optionValue: optionValueSegment+;
nonSquareBracketStringSegment: NonWhitespaceNonOptionValueNonSquareRightBracketNonEq | optionValueSegment | OptionNameValueSeparator;
nonSquareBracketString: nonSquareBracketStringSegment+;
nonSpaceStringSegment: nonSquareBracketStringSegment | OptionsEnd;
nonSpaceString: nonSpaceStringSegment+;
singleTickEnclosedString: SingleTick nonSquareBracketString SingleTick;
doubleTickEnclosedString: DoubleTick nonSquareBracketString DoubleTick;
tickEnclosedString: singleTickEnclosedString | doubleTickEnclosedString;
enclosedString: OptionsStart tickEnclosedString OptionsEnd;
cdromURI: CdromSchema Colon enclosedString nonSpaceString;
// keywords
TypeR: 'deb' | 'deb-src';
OptionName: 'arch' | 'lang' | 'target' | 'pdiffs' | 'by-hash' | 'valid-until-max' | 'allow-downgrade-to-insecure' | 'allow-weak' | 'allow-insecure' | 'trusted' | 'signed-by' | 'check-valid-until' | 'valid-until-min' | 'check-date' | 'inrelease-path' | 'date-max-future';
CdromSchema: 'cdrom:';
// tokens
Word: WordChar+;
WSS: WS+;
// characters
WS: [ \t\n\r\u{000b}\u{000c}];
PunctuationAllowedInOptionValue: [/.];
OptionsStart: '[';
OptionsEnd: ']';
OptionNameValueSeparator: '=';
CommentMarker: '#';
Plus: '+';
Colon: ':';
OptionsSeparator: ',';
Dash: '-';
SingleTick: '\'';
DoubleTick: '"';
WordChar: [0-9A-Z_a-z];
NonWhitespaceNonOptionValueNonSquareRightBracketNonEq: ~[\t-\r "#'+-:=A-\]_a-z];
|
Classes/list/loop.applescript | looking-for-a-job/applescript-examples | 1 | 3938 | <filename>Classes/list/loop.applescript
set potato_list to {"small potato", "big potato", "banged potato", "round potato"}
repeat with i from 1 to (length of potato_list)
set potato to item i of potato_list
# ...
end repeat
repeat with potato in potato_list
end repeat
|
src/Progress.agda | peterthiemann/definitional-session | 9 | 11616 | module Progress where
open import Data.Bool
open import Data.Empty
open import Data.Maybe hiding (Any ; All)
open import Data.Nat
open import Data.List
open import Data.List.All
open import Data.List.Any
open import Data.Product
open import Data.Unit
open import Relation.Nullary
open import Relation.Binary.PropositionalEquality
open import Typing
open import Syntax
open import Global
open import Channel
open import Values
open import Session
open import Schedule
open import ProcessSyntax
open import ProcessRun
-- resources appear in pairs
data Paired : SEntry → Set where
aon-nothing : Paired nothing
aon-all : ∀ {s} → Paired (just (s , POSNEG))
-- need lemmas for matchXAndGo ...
-- matchXandGo-preserves-paired
matchWaitAndGo-preserves-paired :
∀ {G G₁ G₂ G₁₁ G₁₂ φ G₂₁ G₂₂ Gnext tpnext}
{ss : SSplit G G₁ G₂}
{ss-cl : SSplit G₁ G₁₁ G₁₂}
{v : Val G₁₁ (TChan send!)}
{cl-κ : Cont G₁₂ φ TUnit}
{ss-GG' : SSplit G₂ G₂₁ G₂₂}
→ All Paired G
→ (tp' : ThreadPool G₂₁)
→ (tp'' : ThreadPool G₂₂)
→ matchWaitAndGo ss (ss-cl , v , cl-κ) ss-GG' tp' tp'' ≡ just (Gnext , tpnext)
→ All Paired Gnext
matchWaitAndGo-preserves-paired all-paired (tnil ina) tp'' ()
matchWaitAndGo-preserves-paired {ss-GG' = ss-GG'} all-paired (tcons ss cmd@(Fork ss₁ κ₁ κ₂) tp') tp'' match-≡
with ssplit-compose5 ss-GG' ss
... | Gi , ss-tp' , ss' =
matchWaitAndGo-preserves-paired all-paired tp' (tcons ss' cmd tp'') match-≡
matchWaitAndGo-preserves-paired {ss-GG' = ss-GG'} all-paired (tcons ss cmd@(Ready ss₁ v κ) tp') tp'' match-≡ with ssplit-compose5 ss-GG' ss
... | Gi , ss-tp' , ss' =
matchWaitAndGo-preserves-paired all-paired tp' (tcons ss' cmd tp'') match-≡
matchWaitAndGo-preserves-paired {ss-GG' = ss-GG'} all-paired (tcons ss cmd@(Halt x x₁ x₂) tp') tp'' match-≡ with ssplit-compose5 ss-GG' ss
... | Gi , ss-tp' , ss' =
matchWaitAndGo-preserves-paired all-paired tp' (tcons ss' cmd tp'') match-≡
matchWaitAndGo-preserves-paired {ss-GG' = ss-GG'} all-paired (tcons ss cmd@(New s κ) tp') tp'' match-≡ with ssplit-compose5 ss-GG' ss
... | Gi , ss-tp' , ss' =
matchWaitAndGo-preserves-paired all-paired tp' (tcons ss' cmd tp'') match-≡
matchWaitAndGo-preserves-paired {ss-GG' = ss-GG'} all-paired (tcons ss cmd@(Close ss₁ v κ) tp') tp'' match-≡ with ssplit-compose5 ss-GG' ss
... | Gi , ss-tp' , ss' =
matchWaitAndGo-preserves-paired all-paired tp' (tcons ss' cmd tp'') match-≡
matchWaitAndGo-preserves-paired {ss-GG' = ss-GG'} all-paired (tcons ss cmd@(Send ss₁ ss-args vch v κ) tp') tp'' match-≡ with ssplit-compose5 ss-GG' ss
... | Gi , ss-tp' , ss' =
matchWaitAndGo-preserves-paired all-paired tp' (tcons ss' cmd tp'') match-≡
matchWaitAndGo-preserves-paired {ss-GG' = ss-GG'} all-paired (tcons ss cmd@(Recv ss₁ vch κ) tp') tp'' match-≡ with ssplit-compose5 ss-GG' ss
... | Gi , ss-tp' , ss' =
matchWaitAndGo-preserves-paired all-paired tp' (tcons ss' cmd tp'') match-≡
matchWaitAndGo-preserves-paired {ss-GG' = ss-GG'} all-paired (tcons ss cmd@(Select ss₁ lab vch κ) tp') tp'' match-≡ with ssplit-compose5 ss-GG' ss
... | Gi , ss-tp' , ss' =
matchWaitAndGo-preserves-paired all-paired tp' (tcons ss' cmd tp'') match-≡
matchWaitAndGo-preserves-paired {ss-GG' = ss-GG'} all-paired (tcons ss cmd@(Branch ss₁ vch dcont) tp') tp'' match-≡ with ssplit-compose5 ss-GG' ss
... | Gi , ss-tp' , ss' =
matchWaitAndGo-preserves-paired all-paired tp' (tcons ss' cmd tp'') match-≡
matchWaitAndGo-preserves-paired {ss-GG' = ss-GG'} all-paired (tcons ss cmd@(NSelect ss₁ lab vch κ) tp') tp'' match-≡ with ssplit-compose5 ss-GG' ss
... | Gi , ss-tp' , ss' =
matchWaitAndGo-preserves-paired all-paired tp' (tcons ss' cmd tp'') match-≡
matchWaitAndGo-preserves-paired {ss-GG' = ss-GG'} all-paired (tcons ss cmd@(NBranch ss₁ vch dcont) tp') tp'' match-≡ with ssplit-compose5 ss-GG' ss
... | Gi , ss-tp' , ss' =
matchWaitAndGo-preserves-paired all-paired tp' (tcons ss' cmd tp'') match-≡
matchWaitAndGo-preserves-paired {ss = ss-top} {ss-cl = ss-cl} {v = VChan cl-b cl-vcr} {ss-GG' = ss-tp}
all-paired (tcons ss cmd@(Wait ss₁ (VChan w-b w-vcr) κ) tp-wl) tp-acc match-≡
with ssplit-compose6 ss ss₁
... | Gi , ss-g3gi , ss-g4g2
with ssplit-compose6 ss-tp ss-g3gi
... | Gi' , ss-g3gi' , ss-gtpacc
with ssplit-join ss-top ss-cl ss-g3gi'
... | Gchannels , Gother , ss-top' , ss-channels , ss-others
with vcr-match ss-channels cl-vcr w-vcr
matchWaitAndGo-preserves-paired {ss = ss-top} {ss-cl} {VChan cl-b cl-vcr} {ss-GG' = ss-tp} all-paired (tcons ss cmd@(Wait ss₁ (VChan w-b w-vcr) κ) tp-wl) tp-acc match-≡ | Gi , ss-g3gi , ss-g4g2 | Gi' , ss-g3gi' , ss-gtpacc | Gchannels , Gother , ss-top' , ss-channels , ss-others | nothing with ssplit-compose5 ss-tp ss
... | _ , ss-tp' , ss' =
matchWaitAndGo-preserves-paired all-paired tp-wl (tcons ss' cmd tp-acc) match-≡
matchWaitAndGo-preserves-paired {ss = ss-top} {ss-cl} {VChan cl-b cl-vcr} {ss-GG' = ss-tp} all-paired (tcons ss cmd@(Wait ss₁ (VChan w-b w-vcr) κ) tp-wl) tp-acc refl | Gi , ss-g3gi , ss-g4g2 | Gi' , ss-g3gi' , ss-gtpacc | Gchannels , Gother , ss-top' , ss-channels , ss-others | just x = {!!}
-- remains to prove All Paired Gother
step-preserves-paired : ∀ {G G' ev tp'} → All Paired G → (tp : ThreadPool G) → Original.step tp ≡ (_,_ {G'} ev tp') → All Paired G'
step-preserves-paired all-paired tp step-≡ with tp
step-preserves-paired all-paired tp refl | tnil ina = all-paired
step-preserves-paired all-paired tp refl | tcons ss (Fork ss₁ κ₁ κ₂) tp' = all-paired
step-preserves-paired all-paired tp refl | tcons ss (Ready ss₁ v κ) tp' = all-paired
step-preserves-paired all-paired tp step-≡ | tcons ss (Halt x x₁ x₂) tp' with inactive-left-ssplit ss x
step-preserves-paired all-paired tp refl | tcons ss (Halt x x₁ x₂) tp' | refl = all-paired
step-preserves-paired all-paired tp refl | tcons ss (New s κ) tp' = aon-all ∷ all-paired
step-preserves-paired all-paired tp step-≡ | tcons{G₁}{G₂} ss (Close ss-vκ v κ) tp'
with ssplit-refl-left-inactive G₂
... | G' , ina-G' , ss-GG'
with matchWaitAndGo ss (ss-vκ , v , κ) ss-GG' tp' (tnil ina-G')
step-preserves-paired all-paired tp refl | tcons {G₁} {G₂} ss (Close ss-vκ v κ) tp' | G' , ina-G' , ss-GG' | just (Gnext , tpnext) = matchWaitAndGo-preserves-paired {ss = ss}{ss-cl = ss-vκ}{v = v}{cl-κ = κ}{ss-GG'} all-paired tp' (tnil ina-G') p
where
p : matchWaitAndGo ss (ss-vκ , v , κ) ss-GG' tp' (tnil ina-G') ≡ just (Gnext , tpnext)
p = sym {!refl!}
step-preserves-paired all-paired tp refl | tcons {G₁} {G₂} ss (Close ss-vκ v κ) tp' | G' , ina-G' , ss-GG' | nothing = all-paired
step-preserves-paired all-paired tp refl | tcons ss (Wait ss₁ v κ) tp' = all-paired
step-preserves-paired all-paired tp refl | tcons ss (Send ss₁ ss-args vch v κ) tp' = all-paired
step-preserves-paired all-paired tp step-≡ | tcons{G₁}{G₂} ss (Recv ss-vκ vch κ) tp' with ssplit-refl-left-inactive G₂
... | G' , ina-G' , ss-GG' with matchSendAndGo ss (ss-vκ , vch , κ) ss-GG' tp' (tnil ina-G')
... | just (G-next , tp-next) = {!!}
step-preserves-paired all-paired tp refl | tcons {G₁} {G₂} ss (Recv ss-vκ vch κ) tp' | G' , ina-G' , ss-GG' | nothing = all-paired
step-preserves-paired all-paired tp step-≡ | tcons{G₁}{G₂} ss (Select ss-vκ lab vch κ) tp' with ssplit-refl-left-inactive G₂
... | G' , ina-G' , ss-GG' with matchBranchAndGo ss (ss-vκ , lab , vch , κ) ss-GG' tp' (tnil ina-G')
... | just (G-next , tp-next) = {!!}
step-preserves-paired all-paired tp refl | tcons {G₁} {G₂} ss (Select ss-vκ lab vch κ) tp' | G' , ina-G' , ss-GG' | nothing = all-paired
step-preserves-paired all-paired tp refl | tcons ss (Branch ss₁ vch dcont) tp' = all-paired
step-preserves-paired all-paired tp step-≡ | tcons{G₁}{G₂} ss (NSelect ss-vκ lab vch κ) tp' with ssplit-refl-left-inactive G₂
... | G' , ina-G' , ss-GG' with matchNBranchAndGo ss (ss-vκ , lab , vch , κ) ss-GG' tp' (tnil ina-G')
... | just (G-next , tp-next) = {!!}
step-preserves-paired all-paired tp refl | tcons {G₁} {G₂} ss (NSelect ss-vκ lab vch κ) tp' | G' , ina-G' , ss-GG' | nothing = all-paired
step-preserves-paired all-paired tp refl | tcons ss (NBranch ss₁ vch dcont) tp' = all-paired
-- check if the first thread can make a step
topCanStep : ∀ {G} → ThreadPool G → Set
topCanStep (tnil ina) = ⊥
topCanStep (tcons ss (Fork ss₁ κ₁ κ₂) tp) = ⊤
topCanStep (tcons ss (Ready ss₁ v κ) tp) = ⊤
topCanStep (tcons ss (Halt x x₁ x₂) tp) = ⊤
topCanStep (tcons ss (New s κ) tp) = ⊤
topCanStep (tcons{G₁}{G₂} ss (Close ss-vκ v κ) tp) with ssplit-refl-left-inactive G₂
... | G' , ina-G' , ss-GG' = Is-just (matchWaitAndGo ss (ss-vκ , v , κ) ss-GG' tp (tnil ina-G'))
topCanStep (tcons ss (Wait ss₁ v κ) tp) = ⊥
topCanStep (tcons ss (Send ss₁ ss-args vch v κ) tp) = ⊥
topCanStep (tcons{G₁}{G₂} ss (Recv ss-vκ vch κ) tp) with ssplit-refl-left-inactive G₂
... | G' , ina-G' , ss-GG' = Is-just (matchSendAndGo ss (ss-vκ , vch , κ) ss-GG' tp (tnil ina-G'))
topCanStep (tcons{G₁}{G₂} ss (Select ss-vκ lab vch κ) tp) with ssplit-refl-left-inactive G₂
... | G' , ina-G' , ss-GG' = Is-just (matchBranchAndGo ss (ss-vκ , lab , vch , κ) ss-GG' tp (tnil ina-G'))
topCanStep (tcons ss (Branch ss₁ vch dcont) tp) = ⊥
topCanStep (tcons{G₁}{G₂} ss (NSelect ss-vκ lab vch κ) tp) with ssplit-refl-left-inactive G₂
... | G' , ina-G' , ss-GG' = Is-just (matchNBranchAndGo ss (ss-vκ , lab , vch , κ) ss-GG' tp (tnil ina-G'))
topCanStep (tcons ss (NBranch ss₁ vch dcont) tp) = ⊥
tpLength : ∀ {G} → ThreadPool G → ℕ
tpLength (tnil ina) = 0
tpLength (tcons ss cmd tp) = suc (tpLength tp)
allRotations : ∀ {G} → ThreadPool G → List (ThreadPool G)
allRotations tp = nRotations (tpLength tp) tp
where
rotate : ∀ {G} → ThreadPool G → ThreadPool G
rotate (tnil ina) = tnil ina
rotate (tcons ss cmd tp) = tsnoc ss tp cmd
nRotations : ∀ {G} ℕ → ThreadPool G → List (ThreadPool G)
nRotations zero tp = []
nRotations (suc n) tp = tp ∷ nRotations n (rotate tp)
-- the thread pool can step if any command in the pool can make a step
canStep : ∀ {G} → ThreadPool G → Set
canStep tp = Any topCanStep (allRotations tp)
deadlocked : ∀ {G} → ThreadPool G → Set
deadlocked (tnil ina) = ⊥
deadlocked tp@(tcons _ _ _) = ¬ canStep tp
-- progress
|
src/stl.ads | SKNZ/BezierToSTL | 0 | 18807 | <gh_stars>0
with Vecteurs; use Vecteurs;
package STL is
-- Prend une liste de segments et cree l'objet 3d par rotations
-- Requiert Taille(Segments) > 0
procedure Creation(
Segments : in out Liste_Points.Liste ;
Facettes : out Liste_Facettes.Liste;
Nombre_Facettes : Positive);
-- Sauvegarde le fichier stl
procedure Sauvegarder(
Nom_Fichier : String ;
Facettes : Liste_Facettes.Liste);
end;
|
ADL/drivers/stm32h743/stm32-comp.ads | JCGobbi/Nucleo-STM32H743ZI | 0 | 23887 | <filename>ADL/drivers/stm32h743/stm32-comp.ads
private with STM32_SVD.COMP;
package STM32.COMP is
type Comparator is limited private;
procedure Enable (This : in out Comparator)
with Post => Enabled (This);
procedure Disable (This : in out Comparator)
with Post => not Enabled (This);
function Enabled (This : Comparator) return Boolean;
type I_Input_Port is
(One_Quarter_Vrefint,
One_Half_Vrefint,
Three_Quarter_Vrefint,
Vrefint,
DAC_CH1,
DAC_CH2,
Option_7,
Option_8);
-- These bits allows to select the source connected to the inverting input
-- of the comparator. The first 6 options are common, the last 2 options
-- change for each comparator:
-- Option COMP1 COMP2
-- 7 PB1 PE10
-- 8 PC4 PE7
-- See RM0433 rev 7 chapter 24.3.2 pg 1094 Table 233: COMP input/output
-- internal signals and Table 234: COMP input/output pins.
procedure Set_I_Input_Port
(This : in out Comparator;
Input : I_Input_Port)
with Post => Get_I_Input_Port (This) = Input;
-- Select the source connected to the inverting input of the comparator.
-- See RM0433 rev 7 chapter 24.3.2 pg 1094 Table 233: COMP input/output
-- internal signals and Table 234: COMP input/output pins.
function Get_I_Input_Port
(This : Comparator) return I_Input_Port;
-- Return the source connected to the inverting input of the comparator.
type NI_Input_Port is
(Option_1,
Option_2);
-- These bits allows to select the source connected to the non-inverting
-- input of the comparator:
-- Option COMP1 COMP2
-- 1 PB0 PE9
-- 2 PB2 PE11
-- See RM0433 rev 7 chapter 24.3.2 pg 1094 Table 233: COMP input/output
-- internal signals and Table 234: COMP input/output pins.
procedure Set_NI_Input_Port
(This : in out Comparator;
Input : NI_Input_Port)
with Post => Get_NI_Input_Port (This) = Input;
-- Select the source connected to the non-inverting input of the comparator.
-- See RM0433 rev 7 chapter 24.3.2 pg 1094 Table 233: COMP input/output
-- internal signals and Table 234: COMP input/output pins.
function Get_NI_Input_Port
(This : Comparator) return NI_Input_Port;
-- Return the source connected to the non-inverting input of the comparator.
type Output_Polarity is
(Not_Inverted,
Inverted);
-- This bit is used to invert the comparator output.
procedure Set_Output_Polarity
(This : in out Comparator;
Output : Output_Polarity)
with Post => Get_Output_Polarity (This) = Output;
-- Used to invert the comparator output.
function Get_Output_Polarity (This : Comparator) return Output_Polarity;
-- Return the comparator output polarity.
type Comparator_Hysteresis is
(No_Hysteresis,
Low_Hysteresis,
Medium_Hysteresis,
High_Hysteresis);
-- These bits select the hysteresis of the comparator.
procedure Set_Comparator_Hysteresis
(This : in out Comparator;
Value : Comparator_Hysteresis)
with Post => Get_Comparator_Hysteresis (This) = Value;
-- Select the comparator hysteresis value.
function Get_Comparator_Hysteresis (This : Comparator)
return Comparator_Hysteresis;
-- Return the comparator hysteresis value.
type Output_Blanking is
(No_Blanking,
TIM1_OC5,
TIM2_OC3,
TIM3_OC3,
TIM3_OC4,
TIM8_OC5,
TIM15_OC1)
with Size => 4;
-- These bits select which Timer output controls the comparator output
-- blanking.
-- See RM0433 rev 7 chapter 24.3.2 pg 1094 Table 233: COMP input/output
-- internal signals
procedure Set_Output_Blanking
(This : in out Comparator;
Output : Output_Blanking)
with Post => Get_Output_Blanking (This) = Output;
-- Select which Timer output controls the comparator output blanking.
function Get_Output_Blanking (This : Comparator) return Output_Blanking;
-- Return which Timer output controls the comparator output blanking.
procedure Set_Vrefint_Scaler_Resistor
(This : in out Comparator;
Enabled : Boolean)
with Post => Get_Vrefint_Scaler_Resistor (This) = Enabled;
-- Enables the operation of resistor bridge in the VREFINT scaler. To
-- disable the resistor bridge, BRGEN bits of all COMP_CxCSR registers must
-- be set to Disable state. When the resistor bridge is disabled, the 1/4
-- VREFINT, 1/2 VREFINT, and 3/4 VREFINT inputs of the input selector
-- receive VREFINT voltage.
function Get_Vrefint_Scaler_Resistor (This : Comparator) return Boolean;
-- Return True if VREFINT resistor bridge is enabled.
procedure Set_Vrefint_Scaler
(This : in out Comparator;
Enabled : Boolean)
with Post => Get_Vrefint_Scaler (This) = Enabled;
-- Enables the operation of VREFINT scaler at the inverting input of all
-- comparator. To disable the VREFINT scaler, SCALEN bits of all COMP_CxCSR
-- registers must be set to Disable state. When the VREFINT scaler is
-- disabled, the 1/4 VREFINT, 1/2 VREFINT, 3/4 VREFINT and VREFINT inputs
-- of the multiplexer should not be selected.
function Get_Vrefint_Scaler (This : Comparator) return Boolean;
-- Return True if VREFINT scaler is enabled.
type Comparator_Output is (Low, High);
function Get_Comparator_Output (This : Comparator) return Comparator_Output;
-- Read the comparator output before the polarity selector and blanking:
-- Low = non-inverting input is below inverting input,
-- High = (non-inverting input is above inverting input
type AF_Port_Source is
(PA6, PA8, PB12, PE6, PE15, PG2, PG3, PG4, PI1, PI4, PK2)
with Size => 4;
procedure Set_AF_Port_Source
(This : Comparator;
Port : AF_Port_Source);
type COMP_Power_Mode is
(High_Speed,
Medium_Speed_1,
Medium_Speed_2,
Very_Low_Speed);
procedure Set_Power_Mode
(This : in out Comparator;
Mode : COMP_Power_Mode);
type Init_Parameters is record
Input_Minus : I_Input_Port;
Input_Plus : NI_Input_Port;
Output_Pol : Output_Polarity;
Hysteresis : Comparator_Hysteresis;
Blanking_Source : Output_Blanking;
Power_Mode : COMP_Power_Mode;
end record;
procedure Configure_Comparator
(This : in out Comparator;
Param : Init_Parameters);
type COMP_Status_Flag is
(Comparator_Output_Value,
Interrupt_Indicated);
function Status
(This : Comparator;
Flag : COMP_Status_Flag)
return Boolean;
procedure Enable_Interrupt (This : in out Comparator)
with Inline, Post => Interrupt_Enabled (This);
procedure Disable_Interrupt (This : in out Comparator)
with Inline, Post => not Interrupt_Enabled (This);
function Interrupt_Enabled (This : Comparator) return Boolean
with Inline;
procedure Clear_Interrupt_Pending (This : in out Comparator)
with Inline;
procedure Set_Lock_Comparator (This : in out Comparator)
with Post => Get_Lock_Comparator (This) = True;
-- Allows to have COMPx_CFGR and COMP_OR registers as read-only. It can
-- only be cleared by a system reset.
function Get_Lock_Comparator (This : Comparator) return Boolean;
-- Return the comparator lock bit state.
private
-----------------
-- Peripherals --
-----------------
-- representation for the whole Comparator type -----------------
type Comparator is record
CFGR : STM32_SVD.COMP.CFGR1_Register;
end record with Volatile, Size => 1 * 32;
for Comparator use record
CFGR at 16#00# range 0 .. 31;
end record;
end STM32.COMP;
|
src/fsmaker.adb | Fabien-Chouteau/fsmaker | 0 | 11551 | <reponame>Fabien-Chouteau/fsmaker
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Simple_Logging;
with GNAT.OS_Lib;
package body FSmaker is
--------------------
-- To_Target_Path --
--------------------
function To_Target_Path (Str : String) return Target_Path is
begin
if Str'Length = 0 then
return Empty_Path;
elsif Str (Str'First) /= '/' then
raise Program_Error with "Invalid target path";
return Empty_Path;
else
return AAA.Strings.Split (Str (Str'First + 1 .. Str'Last), '/');
end if;
end To_Target_Path;
------------------
-- Pretty_Print --
------------------
procedure Pretty_Print (Tree : Directory_Tree;
Indent : String := "|")
is
begin
for Elt of Tree loop
Simple_Logging.Always (Indent & "-" & To_String (Elt.Name));
if Elt.Kind = Dir then
Pretty_Print (Elt.Entries, Indent & "-|");
end if;
end loop;
end Pretty_Print;
end FSmaker;
|
src/cart.asm | hundredrabbits/Donsol | 113 | 28105 | <gh_stars>100-1000
;; Cart
include "src/head.asm"
;;
.org $C000
;; init
__INIT: ;
include "src/init.asm"
;; jump back to Forever, infinite loop
__MAIN: ;
include "src/main.asm"
JMP __MAIN
;; NMI
__NMI: ;
include "src/nmi.asm" ;
RTI ; return from interrupt
;; includes
include "src/helpers.asm"
include "src/splash.asm"
include "src/game.asm"
include "src/deck.asm"
include "src/player.asm"
include "src/room.asm"
include "src/tests.asm"
include "src/tables.asm"
;; vectors
.pad $FFFA
.dw __NMI
.dw __INIT
.dw 0
;; include sprites
.incbin "src/sprite.chr" |
src/generated/mersenne_h.ads | csb6/libtcod-ada | 0 | 10043 | <filename>src/generated/mersenne_h.ads
pragma Ada_2012;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Extensions; use Interfaces.C.Extensions;
with mersenne_types_h;
with Interfaces.C.Strings;
package mersenne_h is
-- BSD 3-Clause License
-- *
-- * Copyright © 2008-2021, Jice and the libtcod contributors.
-- * All rights reserved.
-- *
-- * Redistribution and use in source and binary forms, with or without
-- * modification, are permitted provided that the following conditions are met:
-- *
-- * 1. Redistributions of source code must retain the above copyright notice,
-- * this list of conditions and the following disclaimer.
-- *
-- * 2. Redistributions in binary form must reproduce the above copyright notice,
-- * this list of conditions and the following disclaimer in the documentation
-- * and/or other materials provided with the distribution.
-- *
-- * 3. Neither the name of the copyright holder nor the names of its
-- * contributors may be used to endorse or promote products derived from
-- * this software without specific prior written permission.
-- *
-- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- * POSSIBILITY OF SUCH DAMAGE.
--
function TCOD_random_get_instance return mersenne_types_h.TCOD_random_t -- mersenne.h:41
with Import => True,
Convention => C,
External_Name => "TCOD_random_get_instance";
function TCOD_random_new (algo : mersenne_types_h.TCOD_random_algo_t) return mersenne_types_h.TCOD_random_t -- mersenne.h:42
with Import => True,
Convention => C,
External_Name => "TCOD_random_new";
function TCOD_random_save (mersenne : mersenne_types_h.TCOD_random_t) return mersenne_types_h.TCOD_random_t -- mersenne.h:43
with Import => True,
Convention => C,
External_Name => "TCOD_random_save";
procedure TCOD_random_restore (mersenne : mersenne_types_h.TCOD_random_t; backup : mersenne_types_h.TCOD_random_t) -- mersenne.h:44
with Import => True,
Convention => C,
External_Name => "TCOD_random_restore";
function TCOD_random_new_from_seed (algo : mersenne_types_h.TCOD_random_algo_t; seed : Unsigned_32) return mersenne_types_h.TCOD_random_t -- mersenne.h:45
with Import => True,
Convention => C,
External_Name => "TCOD_random_new_from_seed";
procedure TCOD_random_delete (mersenne : mersenne_types_h.TCOD_random_t) -- mersenne.h:46
with Import => True,
Convention => C,
External_Name => "TCOD_random_delete";
procedure TCOD_random_set_distribution (mersenne : mersenne_types_h.TCOD_random_t; distribution : mersenne_types_h.TCOD_distribution_t) -- mersenne.h:48
with Import => True,
Convention => C,
External_Name => "TCOD_random_set_distribution";
function TCOD_random_get_int
(mersenne : mersenne_types_h.TCOD_random_t;
min : int;
max : int) return int -- mersenne.h:50
with Import => True,
Convention => C,
External_Name => "TCOD_random_get_int";
function TCOD_random_get_float
(mersenne : mersenne_types_h.TCOD_random_t;
min : float;
max : float) return float -- mersenne.h:51
with Import => True,
Convention => C,
External_Name => "TCOD_random_get_float";
function TCOD_random_get_double
(mersenne : mersenne_types_h.TCOD_random_t;
min : double;
max : double) return double -- mersenne.h:52
with Import => True,
Convention => C,
External_Name => "TCOD_random_get_double";
function TCOD_random_get_int_mean
(mersenne : mersenne_types_h.TCOD_random_t;
min : int;
max : int;
mean : int) return int -- mersenne.h:54
with Import => True,
Convention => C,
External_Name => "TCOD_random_get_int_mean";
function TCOD_random_get_float_mean
(mersenne : mersenne_types_h.TCOD_random_t;
min : float;
max : float;
mean : float) return float -- mersenne.h:55
with Import => True,
Convention => C,
External_Name => "TCOD_random_get_float_mean";
function TCOD_random_get_double_mean
(mersenne : mersenne_types_h.TCOD_random_t;
min : double;
max : double;
mean : double) return double -- mersenne.h:56
with Import => True,
Convention => C,
External_Name => "TCOD_random_get_double_mean";
function TCOD_random_dice_new (s : Interfaces.C.Strings.chars_ptr) return mersenne_types_h.TCOD_dice_t -- mersenne.h:58
with Import => True,
Convention => C,
External_Name => "TCOD_random_dice_new";
function TCOD_random_dice_roll (mersenne : mersenne_types_h.TCOD_random_t; dice : mersenne_types_h.TCOD_dice_t) return int -- mersenne.h:59
with Import => True,
Convention => C,
External_Name => "TCOD_random_dice_roll";
function TCOD_random_dice_roll_s (mersenne : mersenne_types_h.TCOD_random_t; s : Interfaces.C.Strings.chars_ptr) return int -- mersenne.h:60
with Import => True,
Convention => C,
External_Name => "TCOD_random_dice_roll_s";
end mersenne_h;
|
sources/md/markdown-atx_headings.ads | reznikmm/markdown | 0 | 19909 | -- SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with Ada.Tags;
with League.Strings;
with Markdown.Blocks;
limited with Markdown.Visitors;
package Markdown.ATX_Headings is
type ATX_Heading is new Markdown.Blocks.Block with private;
overriding function Create
(Line : not null access Markdown.Blocks.Text_Line) return ATX_Heading;
overriding procedure Visit
(Self : in out ATX_Heading;
Visitor : in out Markdown.Visitors.Visitor'Class);
procedure Filter
(Line : Markdown.Blocks.Text_Line;
Tag : in out Ada.Tags.Tag;
CIP : out Can_Interrupt_Paragraph);
subtype Heading_Level is Positive range 1 .. 6;
function Title (Self : ATX_Heading'Class)
return League.Strings.Universal_String;
function Level (Self : ATX_Heading'Class) return Heading_Level;
private
type ATX_Heading is new Markdown.Blocks.Block with record
Title : League.Strings.Universal_String;
Level : Heading_Level := 1;
end record;
end Markdown.ATX_Headings;
|
Definition/Typed/Consequences/NeTypeEq.agda | CoqHott/logrel-mltt | 2 | 12228 | <reponame>CoqHott/logrel-mltt<gh_stars>1-10
{-# OPTIONS --safe #-}
module Definition.Typed.Consequences.NeTypeEq where
open import Definition.Untyped
open import Definition.Typed
open import Definition.Typed.Properties
open import Definition.Typed.Weakening
open import Definition.Typed.Consequences.Syntactic
open import Definition.Typed.Consequences.Injectivity
open import Definition.Typed.Consequences.Substitution
open import Tools.Product
import Tools.PropositionalEquality as PE
-- to be moved in Untyped
typelevel-injectivity : ∀ {r r' l l'} → [ r , l ] PE.≡ [ r' , l' ] → r PE.≡ r' × l PE.≡ l'
typelevel-injectivity PE.refl = PE.refl , PE.refl
-- Helper function for the same variable instance of a context have equal types.
varTypeEq′ : ∀ {n R rR T rT Γ} → n ∷ R ^ rR ∈ Γ → n ∷ T ^ rT ∈ Γ → R PE.≡ T × rR PE.≡ rT
varTypeEq′ here here = PE.refl , PE.refl
varTypeEq′ (there n∷R) (there n∷T) with varTypeEq′ n∷R n∷T
... | PE.refl , PE.refl = PE.refl , PE.refl
-- The same variable instance of a context have equal types.
varTypeEq : ∀ {x A B rA rB Γ} → Γ ⊢ A ^ rA → Γ ⊢ B ^ rB
→ x ∷ A ^ rA ∈ Γ
→ x ∷ B ^ rB ∈ Γ
→ Γ ⊢ A ≡ B ^ rA × rA PE.≡ rB
varTypeEq A B x∷A x∷B with varTypeEq′ x∷A x∷B
... | PE.refl , PE.refl = refl A , PE.refl
-- The same neutral term have equal types.
-- to use this with different relevances rA rB we need unicity of relevance for types
neTypeEq : ∀ {t A B rA lA lA' Γ} → Neutral t → Γ ⊢ t ∷ A ^ [ rA , lA ] → Γ ⊢ t ∷ B ^ [ rA , lA' ] →
lA PE.≡ lA' × Γ ⊢ A ≡ B ^ [ rA , lA ]
neTypeEq (var x) (var x₁ x₂) (var x₃ x₄) =
let V , e = varTypeEq (syntacticTerm (var x₃ x₂)) (syntacticTerm (var x₃ x₄)) x₂ x₄
_ , el = typelevel-injectivity e
in el , V
neTypeEq (∘ₙ neT) (t∷A ∘ⱼ t∷A₁) (t∷B ∘ⱼ t∷B₁) with neTypeEq neT t∷A t∷B
... | e , q = let _ , _ , _ , elG , w = injectivity q
in PE.cong _ elG , substTypeEq w (genRefl t∷A₁)
neTypeEq (natrecₙ neT) (natrecⱼ x t∷A t∷A₁ t∷A₂) (natrecⱼ x₁ t∷B t∷B₁ t∷B₂) =
PE.refl , refl (substType x₁ t∷B₂)
neTypeEq Emptyrecₙ (Emptyrecⱼ x t∷A) (Emptyrecⱼ x₁ t∷B) =
PE.refl , refl x₁
neTypeEq (Idₙ X) (Idⱼ Y Y₁ Y₂) (Idⱼ Z Z₁ Z₂) =
let e , q = neTypeEq X Y Z
el = next-inj e
in e , PE.subst (λ l → _ ⊢ _ ≡ SProp l ^ _) el (refl (Ugenⱼ (wfTerm Y) ) )
neTypeEq (Idℕₙ X) (Idⱼ Y Y₁ Y₂) (Idⱼ Z Z₁ Z₂) =
let e , q = neTypeEq X Y₁ Z₁
el = ιinj e
in PE.cong next el , PE.subst (λ l → _ ⊢ _ ≡ SProp l ^ _) el (refl (Ugenⱼ (wfTerm Y) ) )
neTypeEq (Idℕ0ₙ X) (Idⱼ Y Y₁ Y₂) (Idⱼ Z Z₁ Z₂) =
let e , q = neTypeEq X Y₂ Z₂
el = ιinj e
in PE.cong next el , PE.subst (λ l → _ ⊢ _ ≡ SProp l ^ _) el (refl (Ugenⱼ (wfTerm Y) ) )
neTypeEq (IdℕSₙ X) (Idⱼ Y Y₁ Y₂) (Idⱼ Z Z₁ Z₂) =
let e , q = neTypeEq X Y₂ Z₂
el = ιinj e
in PE.cong next el , PE.subst (λ l → _ ⊢ _ ≡ SProp l ^ _) el (refl (Ugenⱼ (wfTerm Y) ) )
neTypeEq (IdUₙ X) (Idⱼ Y Y₁ Y₂) (Idⱼ Z Z₁ Z₂) =
let e , q = neTypeEq X Y₁ Z₁
el = ιinj e
in PE.cong next el , PE.subst (λ l → _ ⊢ _ ≡ SProp l ^ _) el (refl (Ugenⱼ (wfTerm Y) ) )
neTypeEq (IdUℕₙ X) (Idⱼ Y Y₁ Y₂) (Idⱼ Z Z₁ Z₂) =
let e , q = neTypeEq X Y₂ Z₂
el = ιinj e
in PE.cong next el , PE.subst (λ l → _ ⊢ _ ≡ SProp l ^ _) el (refl (Ugenⱼ (wfTerm Y) ) )
neTypeEq (IdUΠₙ X) (Idⱼ Y Y₁ Y₂) (Idⱼ Z Z₁ Z₂) =
let e , q = neTypeEq X Y₂ Z₂
el = ιinj e
in PE.cong next el , PE.subst (λ l → _ ⊢ _ ≡ SProp l ^ _) el (refl (Ugenⱼ (wfTerm Y) ) )
neTypeEq X (castⱼ Y Y₁ Y₂ Y₃) (castⱼ Z Z₁ Z₂ Z₃) = PE.refl , refl (univ Y₁)
neTypeEq x (conv t∷A x₁) t∷B =
let e , q = neTypeEq x t∷A t∷B
in e , trans (sym x₁) q
neTypeEq x t∷A (conv t∷B x₃) =
let e , q = neTypeEq x t∷A t∷B
in e , trans q (PE.subst (λ l → _ ⊢ _ ≡ _ ^ [ _ , l ]) (PE.sym e) x₃)
natTypeEq : ∀ {A rA lA Γ} → Γ ⊢ ℕ ∷ A ^ [ rA , lA ] → rA PE.≡ ! × lA PE.≡ ι ¹ × Γ ⊢ A ≡ U ⁰ ^ [ ! , ι ¹ ]
natTypeEq (ℕⱼ x) = PE.refl , PE.refl , refl (univ (univ 0<1 x))
natTypeEq (conv X x) = let eqrA , eqlA , eqAU = natTypeEq X in eqrA , eqlA ,
trans (sym (PE.subst (λ l → _ ⊢ _ ≡ _ ^ [ _ , l ] ) eqlA (PE.subst (λ r → _ ⊢ _ ≡ _ ^ [ r , _ ]) eqrA x))) eqAU
emptyTypeEq : ∀ {A rA lA Γ l} → Γ ⊢ Empty l ∷ A ^ [ rA , lA ] →
rA PE.≡ ! × lA PE.≡ next l × Γ ⊢ A ≡ SProp l ^ [ ! , next l ]
emptyTypeEq (Emptyⱼ x) = PE.refl , PE.refl , refl (Ugenⱼ x)
emptyTypeEq (conv X x) = let eqrA , eqlA , eqAU = emptyTypeEq X in eqrA , eqlA ,
trans (sym (PE.subst (λ l → _ ⊢ _ ≡ _ ^ [ _ , l ] ) eqlA (PE.subst (λ r → _ ⊢ _ ≡ _ ^ [ r , _ ]) eqrA x))) eqAU
|
parsers/src/main/goslin/Systematic.g4 | lifs-tools/jg | 4 | 1060 | /*
* MIT License
*
* Copyright (c) the authors (listed in global LICENSE file)
*
* 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.
*/
grammar Systematic;
/* first rule is always start rule, EOF = end of file */
lipid : lipid_category EOF;
lipid_category : FA | GL | GP | SL | ST;
/* fatty acids */
FA : fa;
/* glycero lipids */
GL : gl | xdg | xmg;
gl : generic_fa DASH gl_ending | generic_fa2 DASH gl_ending | generic_fa3 DASH gl_ending;
gl_ending : 'glycerol' | sn_rac DASH 'glycerol';
xdg : generic_fa2 DASH xdg_xmg_ending;
xmg : generic_fa DASH xdg_xmg_ending;
xdg_xmg_ending : '3-o-β-d-galactosyl-sn-glycerol' | '3-o-(6\'-o-α-d-galactosyl-β-d-galactosyl)-sn-glycerol' | '3-o-(α-d-galactosyl1-6)-β-d-galactosyl-sn-glycerol' | '3-(6\'-sulfo-α-d-quinovosyl)-sn-glycerol';
sn_rac : 'rac' | 'sn';
generic_fa : generic_position DASH generic_fa_rob | generic_position generic_fa_rob_s | generic_position DASH ROB number COLON number generic_fa_rob;
generic_fa2 : generic_position COMMA generic_position DASH 'di' generic_fa_rob | generic_position COMMA generic_position DASH 'di' DASH generic_fa_rob | generic_fa DASH generic_fa;
generic_fa3 : generic_position COMMA generic_position COMMA generic_position DASH 'tri' generic_fa_rob | generic_fa DASH generic_fa2 | generic_fa2 DASH generic_fa;
generic_fa_rob : ROB fa RCB | fa;
generic_fa_rob_s : ROB fa RCB;
generic_position : generic_pos | generic_pos DASH 'o';
generic_pos : number;
/* phospho glycero lipids */
GP : gp | cl;
gp : generic_fa DASH gp_ending | generic_fa2 DASH gp_ending;
/* PC, PE, PS */
gp_ending : 'sn-glycero-3-phosphocholine' | 'sn-glycero-3-phosphoethanolamine' | 'sn-glycero-3-phosphoserine';
fa : fatty_acid | acetyl;
acetyl : 'acetyl';
fatty_acid: regular_fatty_acid | wax | CAR | ethanolamine | amine | acetic_acid;
wax : wax_ester fatty_acid_type | wax_ester regular_fatty_acid;
wax_ester : fatty_acid SPACE | ROB fatty_acid RCB SPACE | methyl SPACE | methyl DASH;
methyl : 'methyl';
CAR : car_positions DASH CAR_fa '-4-(' CAR_spec ')butanoate';
CAR_fa : SOB regular_fatty_acid SCB | COB regular_fatty_acid CCB;
CAR_spec : 'trimethylammonio' | 'trimethylazaniumyl';
car_positions : functional_position | ROB car_position RCB DASH functional_position;
ethanolamine : amine_prefix ROB fatty_acid RCB DASH 'ethanolamine';
amine : amine_prefix amine_n DASH regular_fatty_acid SPACE 'amine';
amine_prefix : 'n-' | '(+/-)n-';
amine_n : fatty_acid | ROB fatty_acid RCB | methyl;
acetic_acid : acetic_recursion 'acetic acid';
acetic_recursion : fatty_acid | ROB fatty_acid RCB | SOB fatty_acid SCB | COB fatty_acid CCB;
regular_fatty_acid : ate_type |
ol_position_description |
furan |
additional_descriptions furan |
sum_add furan |
additional_len acid_type_regular |
additional_len acid_type_double |
additional_descriptions double_bond_positions fatty_length acid_type_double |
sum_add fatty_length acid_type_regular |
sum_add fatty_length acid_type_double |
fg_pos_summary fatty_length acid_type_double |
fg_pos_summary double_bond_positions fatty_length acid_type_double |
sum_add double_bond_positions fatty_length acid_type_double;
additional_len : additional_descriptions fatty_length | fatty_length;
sum_add : fg_pos_summary additional_descriptions;
ol_position_description : ol_position DASH fatty_length ol_ending |
fg_pos_summary ol_position DASH fatty_length ol_ending |
fg_pos_summary DASH ol_position DASH fatty_length ol_ending |
sum_add ol_position DASH fatty_length ol_ending |
sum_add DASH ol_position DASH fatty_length ol_ending |
additional_descriptions ol_position DASH fatty_length ol_ending |
additional_descriptions DASH ol_position DASH fatty_length ol_ending;
ol_ending : 'ol' | 'nol';
ol_position : ol_pos | ol_pos PRIME | ol_pos cistrans_b | ol_pos PRIME cistrans_b;
ol_pos : number;
fatty_length : notation_specials | notation_regular | cycle notation_specials | cycle notation_regular;
notation_regular : notation_last_digit | notation_last_digit notation_second_digit | notation_second_digit;
/* 1, 2, 2, 3, 4, 4, 4, 5, 6, 7, 8, 9 */
notation_last_digit : 'un' | 'hen' | 'do' | 'di' | 'tri' | 'buta' | 'but' | 'tetra' | 'penta' | 'pent' | 'hexa' | 'hex' | 'hepta' | 'hept' | 'octa' | 'oct' | 'nona' | 'non';
/* 0, 10, 10, 20, 20, 30 */
notation_second_digit: 'deca' | 'dec' | 'cosa' | 'cos' | 'eicosa' | 'eicos' | 'triaconta' | 'triacont' | 'tetraconta' | 'tetracont' | 'pentaconta' | 'pantacont' | 'hexaconta' | 'hexacont' | 'heptaconta' | 'heptacont' | 'octaconta' | 'octacont' | 'nonaconta' | 'nonacont';
/* 4, 10, 20, 21, 21, 30, 30 */
notation_specials: 'etha' | 'eth' | 'buta' | 'but' | 'butr' | 'valer' | 'propa' | 'propi' | 'propio' | 'prop' | 'eicosa' | 'eicos' | 'icosa' | 'icos' | prosta | isoprop;
isoprop: 'isoprop';
prosta : 'prosta' | 'prost' | 'prostan';
acid_type_regular: acid_single_type | acid_single_type cyclo_position;
acid_type_double: db_num acid_type_regular;
acid_single_type: 'noic acid' | 'nic acid' | 'nal' | dioic | 'noyloxy' | 'noyl' | ol | dial | 'noate' | 'nate' | CoA | yl | 'ne' | 'nyloxy';
CoA : 'noyl' coa | 'yl' coa | 'nyl' coa;
furan : 'furan' DASH furan_pos DASH 'yl';
furan_pos : number;
coa : 'coa' | '-coa';
yl : 'yl' | 'nyl' | 'n' DASH yl_ending DASH 'yl' | DASH yl_ending DASH 'yl';
yl_ending: number;
db_num: DASH double_bond_positions DASH db_length db_suffix | DASH double_bond_positions DASH db_suffix | db_length db_suffix | db_suffix;
db_suffix : 'e' | 'ne' | 'ene' | 'en' | 'n';
dial : 'dial';
db_length: notation_regular;
dioic : 'n' DASH functional_positions DASH dioic_acid | DASH functional_positions DASH dioic_acid | 'ne' dioic_acid;
dioic_acid : 'dioic acid';
ol : 'nol' | db_suffix DASH hydroxyl_positions DASH notation_regular 'ol' | db_suffix DASH hydroxyl_position DASH 'ol' | DASH hydroxyl_positions DASH notation_regular 'ol' | DASH hydroxyl_position DASH 'ol';
ate_type : ate | additional_descriptions ate;
ate : 'formate' | 'acetate' | 'butyrate' | 'propionate' | 'valerate' | isobut;
isobut : 'isobutyrate';
hydroxyl_positions : hydroxyl_positions pos_separator hydroxyl_positions | hydroxyl_position;
hydroxyl_position : hydroxyl_number | hydroxyl_number cistrans_b | hydroxyl_number PRIME cistrans_b;
hydroxyl_number : number;
additional_descriptions : additional_descriptions_m | additional_descriptions_m DASH;
additional_descriptions_m : additional_descriptions_m additional_descriptions_m | additional_description;
additional_description : functional_group | functional_group DASH | pos_neg | reduction | reduction DASH;
functional_group : multi_functional_group | single_functional_group | epoxy | methylene_group;
pos_neg : '(+/-)-' | '(+)-' | '(-)-';
double_bond_positions : double_bond_positions_pure DASH | ROB double_bond_positions_pure RCB DASH | double_bond_positions_pure | ROB double_bond_positions_pure RCB;
double_bond_positions_pure : double_bond_positions_pure pos_separator double_bond_positions_pure | double_bond_position;
double_bond_position : db_number | db_number cistrans_b | db_number PRIME | db_number PRIME cistrans_b | cistrans_b;
cistrans_b : cistrans | ROB cistrans RCB;
cistrans : 'e' | 'z' | 'r' | 's' | 'a' | 'b' | 'c';
db_number : number;
fg_pos_summary : functional_positions DASH;
multi_functional_group : functional_positions DASH functional_length functional_group_type | functional_positions DASH functional_group_type;
functional_length : notation_last_digit | notation_second_digit | notation_last_digit notation_second_digit;
functional_positions : functional_positions_pure | ROB functional_positions_pure RCB;
functional_positions_pure : functional_positions_pure pos_separator functional_positions_pure | functional_position;
single_functional_group : functional_position DASH functional_group_type_name | functional_position functional_group_type_name | recursion_description | recursion_description DASH;
functional_group_type_name : functional_group_type | ROB functional_group_type RCB;
functional_group_type : 'hydroxy' | 'oxo' | 'bromo' | 'thio' | 'keto' | 'methyl' | 'hydroperoxy' | homo | 'phospho' | 'fluro' | 'fluoro' | 'chloro' | methylene | 'sulfooxy' | 'amino' | 'sulfanyl' | 'methoxy' | 'iodo' | 'cyano' | 'nitro' | 'oh' | 'thio' | 'mercapto' | 'carboxy' | 'acetoxy' | 'cysteinyl' | 'phenyl' | 's-glutathionyl' | 's-cysteinyl' | 'butylperoxy' | 'dimethylarsinoyl' | 'methylsulfanyl' | 'imino' | 's-cysteinylglycinyl';
epoxy : functional_position pos_separator functional_position DASH 'epoxy' | functional_position ROB functional_position RCB DASH 'epoxy' | ROB functional_position pos_separator functional_position RCB DASH 'epoxy';
methylene_group : functional_positions DASH methylene;
methylene : 'methylene';
/* acetoxy : 'acetoxy'; */
functional_position : functional_position_pure | ROB functional_position_pure RCB;
functional_position_pure : functional_pos | functional_pos PRIME | functional_pos func_stereo | functional_pos PRIME func_stereo | func_stereo;
functional_pos : number;
func_stereo : cistrans_b;
reduction : functional_position DASH 'nor' | functional_positions DASH functional_length 'nor';
homo : 'homo';
cycle : 'cyclo';
cyclo_position : '-cyclo' SOB functional_position pos_separator functional_position SCB | ' cyclo' SOB functional_position pos_separator functional_position SCB | ' cyclo ' SOB functional_position pos_separator functional_position SCB | '-cyclo-' SOB functional_position pos_separator functional_position SCB | ' cyclo-' SOB functional_position pos_separator functional_position SCB;
recursion_description : recursion_position DASH recursion;
recursion : fatty_acid | ROB fatty_acid RCB | SOB fatty_acid SCB | COB fatty_acid CCB;
recursion_position : ROB functional_positions RCB | recursion_pos | recursion_pos cistrans_b;
recursion_pos : number;
/* separators */
SPACE : ' ';
COLON : ':';
SEMICOLON : ';';
DASH : '-' | '‐';
UNDERSCORE : '_';
SLASH : '/';
BACKSLASH : '\\';
COMMA: ',';
ROB: '(';
RCB: ')';
SOB: '[';
SCB: ']';
COB: '{';
CCB: '}';
PRIME: '\'';
pos_separator : COMMA;
number : digit | digit number;
digit : '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
|
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_800.asm | ljhsiun2/medusa | 9 | 86279 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r15
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x3b39, %rcx
nop
sub $31378, %r15
movw $0x6162, (%rcx)
nop
sub %r10, %r10
lea addresses_UC_ht+0x30d9, %r14
nop
nop
nop
nop
dec %rax
mov $0x6162636465666768, %r15
movq %r15, (%r14)
nop
nop
cmp %rsi, %rsi
lea addresses_WT_ht+0x1c819, %r10
nop
nop
sub %rsi, %rsi
movb (%r10), %al
nop
and $7508, %r15
lea addresses_A_ht+0x13859, %rsi
lea addresses_UC_ht+0x1a7d9, %rdi
clflush (%rsi)
nop
nop
xor %rbp, %rbp
mov $60, %rcx
rep movsq
nop
nop
nop
and $59747, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %rbp
push %rbx
push %rcx
// Load
mov $0x5c52d500000005d9, %r8
dec %rcx
vmovaps (%r8), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $0, %xmm1, %rbp
nop
nop
nop
nop
inc %rbp
// Faulty Load
mov $0x5c52d500000005d9, %rbx
nop
nop
nop
nop
xor $887, %rbp
mov (%rbx), %r14
lea oracles, %rbx
and $0xff, %r14
shlq $12, %r14
mov (%rbx,%r14,1), %r14
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': True, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 5, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 5, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': True}}
{'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
*/
|
3rdParties/src/nasm/nasm-2.15.02/test/br3392640.asm | blue3k/StormForge | 1 | 240437 | %imacro mac 1-2
j%+1
%endmacro
mac c, label
|
programs/oeis/087/A087572.asm | neoneye/loda | 22 | 100968 | ; A087572: Smallest prime of the form n + (n-1) + (n-2) + ...(n-k), k < n, or 0 if no such prime exists.
; 0,2,3,7,5,11,7,0,17,19,11,23,13,0,29,31,17,0,19,0,41,43,23,47,0,0,53,0,29,59,31,0,0,67,0,71,37,0,0,79,41,83,43,0,89,0,47,0,97,0,101,103,53,107,109,0,113,0,59,0,61,0,0,127,0,131,67,0,137,139,71,0,73,0,149,151,0
mov $12,2
mov $13,1
lpb $12,3
mov $1,$0
seq $1,20639 ; Lpf(n): least prime dividing n (when n > 1); a(1) = 1. Or, smallest prime factor of n, or smallest prime divisor of n.
lpb $1
sub $0,1
lpb $13
add $2,1
mul $2,$1
trn $13,4
lpe
mov $1,$0
lpe
mul $0,2
mul $12,$10
lpe
mov $0,$2
|
src/Human/Empty.agda | MaisaMilena/JuiceMaker | 6 | 16973 | <filename>src/Human/Empty.agda
module Human.Empty where
data Empty : Set where
void : ∀ {P : Set} → Empty → P
void ()
|
src/PJ/flic386p/libsrc/drvcomn/drvsegs.asm | AnimatorPro/Animator-Pro | 119 | 94451 | <gh_stars>100-1000
;*****************************************************************************
;* DRVSEGS.ASM - get/put_hseg, and get/put_rectpix driver functions.
;*
;* NOTES:
;* This module contains entry points used by other DRVxxxx.ASM
;* modules, as well as routines provided to the host.
;*
;* For what it's worth, the routines in this module are the
;* most performance-critical functions within the driver.
;*
;* MAINTENANCE:
;* 03/27/91 <NAME>
;* Basically a total re-write.
;*****************************************************************************
;******************************************************************************
;* *
;* Copyright (C) 1991 by Autodesk, Inc. *
;* *
;* Permission to use, copy, modify, and distribute this software and *
;* its documentation for the purpose of creating applications for *
;* Autodesk Animator, is hereby granted in accordance with the terms *
;* of the License Agreement accompanying this product. *
;* *
;* Autodesk makes no warrantees, express or implied, as to the *
;* correctness of this code or any derivative works which incorporate *
;* it. Autodesk provides the code on an ''as-is'' basis and *
;* explicitly disclaims any liability, express or implied, for *
;* errors, omissions, and other problems in the code, including *
;* consequential and incidental damages. *
;* *
;* Use, duplication, or disclosure by the U.S. Government is *
;* subject to restrictions set forth in FAR 52.227-19 (Commercial *
;* Computer Software - Restricted Rights) and DFAR 252.227-7013 (c) *
;* (1) (ii) (Rights in Technical Data and Computer Software, as *
;* applicable. *
;* *
;******************************************************************************
include stdmacro.i
include drvcomn.i
_TEXT segment
public _pj_vdrv_put_hseg ; entry point for other ASM routines
public _pj_vdrv_get_hseg ; entry point fo rother ASM routines
public pj_vdrv_put_hseg
public pj_vdrv_get_hseg
public pj_vdrv_put_rectpix
public pj_vdrv_get_rectpix
;*****************************************************************************
;* _pj_vdrv_put_hseg - internal service routine
;* Entry:
;* eax = y coordinate
;* ecx = width
;* edx -> pj_vdrv_wcontrol
;* edi = x coordinate
;* esi -> input buffer
;* es = 0x0034 (DOS memory segment)
;* Exit:
;* eax - trashed
;* ecx - trashed
;* esi -> next byte in input buffer
;* edi - trashed
;* all others preserved
;*****************************************************************************
align 4
_pj_vdrv_put_hseg proc near
add edi,[eax*8+ytab_offs] ; 4
mov eax,[eax*8+ytab_bank] ; 4
cmp eax,[edx].wwrcurbank ; 6
jne short #newbank ; 3
#putseg: ;
add edi,[edx].wwraddr ; 6
mov al,cl ; 2 do typical fastmove stuff...
and al,3 ; 2
shr ecx,2 ; 3
rep movsd ; X
mov cl,al ; 2
rep movsb ; X
ret
align 4
#newbank:
test eax,0FFFF0000h ; is this a split line?
jnz short #splitline ; yep, go handle it.
SetWriteBank ; nope, just set the new write bank
jmp short #putseg ; then continue.
align 4
#splitline:
and eax,0000FFFFh ; clean split_at value from eax.
cmp edi,[edx].woffsmask ; is the starting X address after the
jbe short #checkend ; split? if not, go check the ending
and edi,[edx].woffsmask ; address, else increment to the next
inc eax ; (post-split) bank number, mask the
cmp eax,[edx].wwrcurbank ; address to the new bank. if the
je short #putseg ; new bank is the current bank, we're
SetWriteBank ; all set, else set the new write
jmp short #putseg ; bank, then continue.
align 4
#checkend:
cmp eax,[edx].wwrcurbank ; we have to do at least some output
je short #ok_bank ; before the split, make sure we're
SetWriteBank ; in the right bank before proceesing.
#ok_bank:
lea eax,[ecx+edi-1] ; make a pointer to the last input byte,
sub eax,[edx].woffsmask ; compare it to the split mask. if all
jbe short #putseg ; input before split, go do normal move.
sub ecx,eax ; counts: eax=postsplit, ecx=presplit.
add edi,[edx].wwraddr ; add video address to input pointer.
shr ecx,1 ; move the pre-split data...
rep movsw ;
adc ecx,0 ;
rep movsb ;
mov ecx,eax ; restore the post-split count to its
xor edi,edi ; normal register. adjust the input
mov eax,[edx].wwrcurbank ; pointer to the new bank. put the
inc eax ; current bank number, increment to
SetWriteBank ; the next bank, go switch banks.
jmp short #putseg ; handle post-split data as normal.
_pj_vdrv_put_hseg endp
;*****************************************************************************
;* _pj_vdrv_get_hseg - internal service routine
;* Entry:
;* eax = y coordinate
;* ecx = width
;* edx -> pj_vdrv_wcontrol
;* esi = x coordinate
;* edi -> output buffer
;* es = 0x0014 (normal data segment for pharlap)
;* Exit:
;* eax - trashed
;* ecx - trashed
;* esi - trashed
;* edi -> next byte in output buffer
;* all others preserved
;*****************************************************************************
align 4
_pj_vdrv_get_hseg proc near
add esi,[eax*8+ytab_offs] ; 4
mov eax,[eax*8+ytab_bank] ; 4
cmp eax,[edx].wrdcurbank ; 6
jne short #newbank ; 3
#getseg: ;
add esi,[edx].wrdaddr ; 6
mov al,cl ; 2 do typical fastmove stuff...
and al,3 ; 2
shr ecx,2 ; 3
rep movs dptr es:[edi],gs:[esi] ; X
mov cl,al ; 2
rep movs bptr es:[edi],gs:[esi] ; X
ret
align 4
#newbank:
test eax,0FFFF0000h ; is this a split line?
jnz short #splitline ; yep, go handle it.
SetReadBank ; nope, just set the new read bank
jmp short #getseg ; then continue.
align 4
#splitline:
and eax,0000FFFFh ; clean split_at value from eax.
cmp esi,[edx].woffsmask ; is the starting X address after the
jbe short #checkend ; split? if not, go check the ending
and esi,[edx].woffsmask ; address, else increment to the next
inc eax ; (post-split) bank number, mask the
cmp eax,[edx].wrdcurbank ; address to the new bank. if the
je short #getseg ; new bank is the current bank, we're
SetReadBank ; all set, else set the new read
jmp short #getseg ; bank, then continue.
align 4
#checkend:
cmp eax,[edx].wrdcurbank ; we have to do at least some output
je short #ok_bank ; before the split, make sure we're
SetReadBank ; in the right bank before proceeding.
#ok_bank:
lea eax,[ecx+esi-1] ; make a pointer to the last input byte,
sub eax,[edx].woffsmask ; compare it to the split mask. if all
jbe short #getseg ; input before split, go do normal move.
sub ecx,eax ; counts: eax=postsplit, ecx=presplit.
add esi,[edx].wrdaddr ; add video address to input pointer.
shr ecx,1 ; move the pre-split data...
rep movs wptr es:[edi],gs:[esi] ;
adc ecx,0 ;
rep movs bptr es:[edi],gs:[esi] ;
mov ecx,eax ; restore the post-split count to its
xor esi,esi ; normal register. adjust the input
mov eax,[edx].wrdcurbank ; pointer to the new bank. get the
inc eax ; current bank number, increment to
SetReadBank ; the next bank, go switch banks.
jmp short #getseg ; handle post-split data as normal.
_pj_vdrv_get_hseg endp
;*****************************************************************************
;* void pj_vdrv_put_hseg(Raster *r, Pixel pixbuf, int x, int y, int w)
;*****************************************************************************
align 4
pj_vdrv_put_hseg proc near
Entry
Args #raster,#pixbuf,#x,#y,#w
Save esi,edi,es
mov ax,gs
mov es,ax
lea edx,pj_vdrv_wcontrol ; 2
mov ecx,#w ; 4
mov eax,#y ; 4
mov edi,#x ; 4
mov esi,#pixbuf ; 4
call _pj_vdrv_put_hseg
Restore esi,edi,es
Exit
pj_vdrv_put_hseg endp
;*****************************************************************************
;* void pj_vdrv_get_hseg(Raster *r, Pixel pixbuf, int x, int y, int w)
;*****************************************************************************
align 4
pj_vdrv_get_hseg proc near
Entry
Args #raster,#pixbuf,#x,#y,#w
Save esi,edi
lea edx,pj_vdrv_wcontrol ; 2
mov ecx,#w ; 4
mov eax,#y ; 4
mov esi,#x ; 4
mov edi,#pixbuf ; 4
call _pj_vdrv_get_hseg
Restore esi,edi
Exit
pj_vdrv_get_hseg endp
;*****************************************************************************
;* void pj_vdrv_put_rectpix(Raster *rast, Pixel *pixbuf, int x,y,w,h);
;*****************************************************************************
align 4
pj_vdrv_put_rectpix proc near
Entry
Args #rast,#pixbuf,#x,#y,#w,#h
Save ebx,esi,edi,ebp,es
mov ax,gs
mov es,ax
mov ebp,#h
mov ebx,#y
mov esi,#pixbuf
lea edx,pj_vdrv_wcontrol
#loop: ; load parm regs...
mov ecx,#w ; width
mov eax,ebx ; y
mov edi,#x ; x
call _pj_vdrv_put_hseg
inc ebx
dec ebp
jnz #loop
Restore ebx,esi,edi,ebp,es
Exit
pj_vdrv_put_rectpix endp
;*****************************************************************************
;*
;*****************************************************************************
align 4
pj_vdrv_get_rectpix proc near
Entry
Args #rast,#pixbuf,#x,#y,#w,#h
Save ebx,esi,edi,ebp
mov ebp,#h
mov ebx,#y
mov edi,#pixbuf
lea edx,pj_vdrv_wcontrol
#loop: ; load parm regs...
mov ecx,#w ; width
mov eax,ebx ; y
mov esi,#x ; x
call _pj_vdrv_get_hseg
inc ebx
dec ebp
jnz #loop
Restore ebx,esi,edi,ebp
Exit
pj_vdrv_get_rectpix endp
_TEXT ends
end
|
dino/lcs/123p/2C.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | 6 | 90928 | <reponame>zengfr/arcade_game_romhacking_sourcecode_top_secret_data
copyright zengfr site:http://github.com/zengfr/romhack
00042A move.l D1, (A0)+
00042C dbra D0, $42a
001454 move.l D2, ($2c,A6)
001458 tst.w D1 [123p+ 2C, 123p+ 2E, etc+2C, etc+2E]
00149A move.l D2, ($2c,A6)
00149E tst.w D1 [123p+ 2C, 123p+ 2E]
004D94 move.l D1, (A1)+
004D96 dbra D0, $4d94
019446 tst.b ($2c,A6)
01944A beq $19462 [123p+ 2C]
019620 cmpi.b #$0, ($2c,A6)
019626 bne $1962c
0197CC cmp.b ($2c,A6), D0 [123p+ 80]
0197D0 beq $19810 [123p+ 2C]
019A1C tst.b ($2c,A6)
019A20 bne $19a26
019E38 tst.b ($2c,A6)
019E3C bne $19e46 [123p+ 2C]
01A07A tst.b ($2c,A6)
01A07E beq $1a084 [123p+ 2C]
01A372 tst.b ($2c,A0) [123p+ 70]
01A376 bne $1a37c [123p+ 2C]
01AB44 tst.b ($2c,A6) [123p+ 51]
01AB48 bne $1ab68 [123p+ 2C]
01AC7A cmp.b ($2c,A6), D0 [123p+ 80]
01AC7E beq $1acbe [123p+ 2C]
01AD56 cmp.b ($2c,A6), D0 [123p+ 80]
01AD5A beq $1ad74 [123p+ 2C]
01AEA6 tst.b ($2c,A6)
01AEAA beq $1aeba [123p+ 2C]
01AEE8 tst.b ($2c,A6)
01AEEC beq $1aefc [123p+ 2C]
01AF38 tst.b ($2c,A6)
01AF3C bne $1af46 [123p+ 2C]
01B002 tst.b ($2c,A6) [123p+ 25]
01B006 beq $1b00a [123p+ 2C]
01B4F8 cmp.b ($2c,A6), D0 [123p+ 80]
01B4FC beq $1b536 [123p+ 2C]
01B516 cmpi.b #$1, ($2c,A6)
01B51C beq $1b536 [123p+ 2C]
01B62C cmp.b ($2c,A6), D0 [123p+ 80]
01B630 beq $1b64a [123p+ 2C]
01B7D6 cmp.b ($2c,A6), D0 [123p+ 80]
01B7DA beq $1b81a [123p+ 2C]
01B8A2 tst.b ($2c,A6)
01B8A6 beq $1b908 [123p+ 2C]
01B920 move.b ($2c,A6), D0
01B924 cmp.b ($80,A6), D0 [123p+ 2C]
01B996 tst.b ($2c,A6)
01B99A beq $1b9a0 [123p+ 2C]
01C2A0 tst.b ($2c,A6)
01C2A4 bne $1c2ac [123p+ 2C]
01C30C tst.b ($2c,A6)
01C310 bne $1c318 [123p+ 2C]
01C484 tst.b ($2c,A6)
01C488 bne $1c490 [123p+ 2C]
01C520 tst.b ($2c,A6)
01C524 bne $1c52c [123p+ 2C]
01C644 tst.b ($2c,A6)
01C648 bne $1c650 [123p+ 2C]
01C6BA tst.b ($2c,A6)
01C6BE bne $1c6c6 [123p+ 2C]
01C7E8 tst.b ($2c,A6)
01C7EC bne $1c7f4 [123p+ 2C]
01CCCA tst.b ($2c,A6)
01CCCE bne $1ccd6 [123p+ 2C]
01CD38 tst.b ($2c,A6)
01CD3C bne $1cd44 [123p+ 2C]
01D778 move.b ($2c,A6), D5 [123p+115]
01D77C jsr $1426.l [123p+ 2C]
01D786 cmp.b ($2c,A6), D5
01D78A bcc $1d7b8 [123p+ 2C]
01D810 move.b ($2c,A6), D5 [123p+115]
01D814 jsr $1426.l [123p+ 2C]
01D81E cmp.b ($2c,A6), D5
01D822 bcc $1d84e [123p+ 2C]
01D8CA tst.b ($2c,A6)
01D8CE beq $1d93c [123p+ 2C]
01D8FC cmpi.b #$2, ($2c,A6)
01D902 beq $1d912 [123p+ 2C]
0247A4 move.b ($2c,A0), D0
0247A8 beq $247e2 [123p+ 2C]
024990 move.b ($2c,A0), D0
024994 beq $249d4 [123p+ 2C]
024A4E move.b ($2c,A0), D0
024A52 beq $24a92 [123p+ 2C]
02542E move.b ($2c,A0), D0
025432 beq $25444 [123p+ 2C]
025544 move.b ($2c,A0), D1
025548 move.b D1, ($b0,A6) [123p+ 2C]
025996 cmpi.b #$1, ($2c,A0)
02599C bne $259b2 [123p+ 2C]
0259A0 clr.b ($2c,A0)
0259A4 move.b ($3,A6), D0 [123p+ 2C]
025AB6 move.b ($2c,A0), D0
025ABA beq $25ad4 [123p+ 2C]
025B96 clr.b ($2c,A0)
025B9A move.b ($3,A6), D0
025BE8 cmpi.b #$1, ($2c,A0) [item+A6]
025BEE bne $25c20 [123p+ 2C]
025BF2 clr.b ($2c,A0)
025BF6 move.b ($3,A6), D0 [123p+ 2C]
025C20 cmpi.b #$2, ($2c,A0)
025C26 bne $25c54 [123p+ 2C]
025C2A clr.b ($2c,A0)
025C2E move.b ($3,A6), D0 [123p+ 2C]
028FAE tst.b ($2c,A0)
028FB2 beq $2903a [123p+ 2C]
02AA04 cmpi.b #$2, ($2c,A4)
02AA0A bne $2aa46 [123p+ 2C]
092BCE tst.b ($2c,A0)
092BD2 bne $92bd6 [123p+ 2C]
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAE6 move.l (A0), D2
0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAF4 move.l D2, (A0)+
0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
copyright zengfr site:http://github.com/zengfr/romhack
|
src/sys/streams/util-streams-buffered.adb | My-Colaborations/ada-util | 0 | 346 | <reponame>My-Colaborations/ada-util<gh_stars>0
-----------------------------------------------------------------------
-- util-streams-buffered -- Buffered streams utilities
-- Copyright (C) 2010, 2011, 2013, 2014, 2016, 2017, 2018, 2019, 2020 <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 Interfaces;
with Ada.IO_Exceptions;
with Ada.Unchecked_Deallocation;
package body Util.Streams.Buffered is
procedure Free_Buffer is
new Ada.Unchecked_Deallocation (Object => Stream_Element_Array,
Name => Buffer_Access);
-- ------------------------------
-- Initialize the stream to read or write on the given streams.
-- An internal buffer is allocated for writing the stream.
-- ------------------------------
procedure Initialize (Stream : in out Output_Buffer_Stream;
Output : access Output_Stream'Class;
Size : in Positive) is
begin
Free_Buffer (Stream.Buffer);
Stream.Last := Stream_Element_Offset (Size);
Stream.Buffer := new Stream_Element_Array (1 .. Stream.Last);
Stream.Output := Output;
Stream.Write_Pos := 1;
Stream.Read_Pos := 1;
Stream.No_Flush := False;
end Initialize;
-- ------------------------------
-- Initialize the stream to read from the string.
-- ------------------------------
procedure Initialize (Stream : in out Input_Buffer_Stream;
Content : in String) is
begin
Free_Buffer (Stream.Buffer);
Stream.Last := Stream_Element_Offset (Content'Length);
Stream.Buffer := new Stream_Element_Array (1 .. Content'Length);
Stream.Input := null;
Stream.Write_Pos := Stream.Last + 1;
Stream.Read_Pos := 1;
for I in Content'Range loop
Stream.Buffer (Stream_Element_Offset (I - Content'First + 1))
:= Character'Pos (Content (I));
end loop;
end Initialize;
-- ------------------------------
-- Initialize the stream with a buffer of <b>Size</b> bytes.
-- ------------------------------
procedure Initialize (Stream : in out Output_Buffer_Stream;
Size : in Positive) is
begin
Stream.Initialize (Output => null, Size => Size);
Stream.No_Flush := True;
Stream.Read_Pos := 1;
end Initialize;
-- ------------------------------
-- Initialize the stream to read or write on the given streams.
-- An internal buffer is allocated for writing the stream.
-- ------------------------------
procedure Initialize (Stream : in out Input_Buffer_Stream;
Input : access Input_Stream'Class;
Size : in Positive) is
begin
Free_Buffer (Stream.Buffer);
Stream.Last := Stream_Element_Offset (Size);
Stream.Buffer := new Stream_Element_Array (1 .. Stream.Last);
Stream.Input := Input;
Stream.Write_Pos := 1;
Stream.Read_Pos := 1;
end Initialize;
-- ------------------------------
-- Initialize the stream from the buffer created for an output stream.
-- ------------------------------
procedure Initialize (Stream : in out Input_Buffer_Stream;
From : in out Output_Buffer_Stream'Class) is
begin
Free_Buffer (Stream.Buffer);
Stream.Buffer := From.Buffer;
From.Buffer := null;
Stream.Input := null;
Stream.Read_Pos := 1;
Stream.Write_Pos := From.Write_Pos + 1;
Stream.Last := From.Last;
end Initialize;
-- ------------------------------
-- Close the sink.
-- ------------------------------
overriding
procedure Close (Stream : in out Output_Buffer_Stream) is
begin
if Stream.Output /= null then
Output_Buffer_Stream'Class (Stream).Flush;
Stream.Output.Close;
Free_Buffer (Stream.Buffer);
end if;
end Close;
-- ------------------------------
-- Get the direct access to the buffer.
-- ------------------------------
function Get_Buffer (Stream : in Output_Buffer_Stream) return Buffer_Access is
begin
return Stream.Buffer;
end Get_Buffer;
-- ------------------------------
-- Get the number of element in the stream.
-- ------------------------------
function Get_Size (Stream : in Output_Buffer_Stream) return Natural is
begin
return Natural (Stream.Write_Pos - Stream.Read_Pos);
end Get_Size;
-- ------------------------------
-- Write the buffer array to the output stream.
-- ------------------------------
overriding
procedure Write (Stream : in out Output_Buffer_Stream;
Buffer : in Ada.Streams.Stream_Element_Array) is
Start : Stream_Element_Offset := Buffer'First;
Pos : Stream_Element_Offset := Stream.Write_Pos;
Avail : Stream_Element_Offset;
Size : Stream_Element_Offset;
begin
while Start <= Buffer'Last loop
Size := Buffer'Last - Start + 1;
Avail := Stream.Last - Pos + 1;
if Avail = 0 then
if Stream.Output = null then
raise Ada.IO_Exceptions.End_Error with "Buffer is full";
end if;
Stream.Output.Write (Stream.Buffer (1 .. Pos - 1));
Stream.Write_Pos := 1;
Pos := 1;
Avail := Stream.Last - Pos + 1;
end if;
if Avail < Size then
Size := Avail;
end if;
Stream.Buffer (Pos .. Pos + Size - 1) := Buffer (Start .. Start + Size - 1);
Start := Start + Size;
Pos := Pos + Size;
Stream.Write_Pos := Pos;
-- If we have still more data than the buffer size, flush and write
-- the buffer directly.
if Start < Buffer'Last and then Buffer'Last - Start > Stream.Buffer'Length then
if Stream.Output = null then
raise Ada.IO_Exceptions.End_Error with "Buffer is full";
end if;
Stream.Output.Write (Stream.Buffer (1 .. Pos - 1));
Stream.Write_Pos := 1;
Stream.Output.Write (Buffer (Start .. Buffer'Last));
return;
end if;
end loop;
end Write;
-- ------------------------------
-- Flush the stream.
-- ------------------------------
overriding
procedure Flush (Stream : in out Output_Buffer_Stream) is
begin
if not Stream.No_Flush then
if Stream.Write_Pos > 1 then
if Stream.Output /= null then
Stream.Output.Write (Stream.Buffer (1 .. Stream.Write_Pos - 1));
end if;
Stream.Write_Pos := 1;
end if;
if Stream.Output /= null then
Stream.Output.Flush;
end if;
end if;
end Flush;
-- ------------------------------
-- Flush the buffer in the <tt>Into</tt> array and return the index of the
-- last element (inclusive) in <tt>Last</tt>.
-- ------------------------------
procedure Flush (Stream : in out Output_Buffer_Stream;
Into : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset) is
begin
if Stream.Write_Pos > 1 then
Into (Into'First .. Into'First + Stream.Write_Pos - 1) :=
Stream.Buffer (Stream.Buffer'First .. Stream.Write_Pos - 1);
Stream.Write_Pos := 1;
Last := Into'First + Stream.Write_Pos - 1;
else
Last := Into'First - 1;
end if;
end Flush;
-- ------------------------------
-- Flush the buffer stream to the unbounded string.
-- ------------------------------
procedure Flush (Stream : in out Output_Buffer_Stream;
Into : out Ada.Strings.Unbounded.Unbounded_String) is
begin
Ada.Strings.Unbounded.Set_Unbounded_String (Into, "");
if Stream.Write_Pos > 1 then
for I in 1 .. Stream.Write_Pos - 1 loop
Ada.Strings.Unbounded.Append (Into, Character'Val (Stream.Buffer (I)));
end loop;
Stream.Write_Pos := 1;
end if;
end Flush;
-- ------------------------------
-- Fill the buffer by reading the input stream.
-- Raises Data_Error if there is no input stream;
-- ------------------------------
procedure Fill (Stream : in out Input_Buffer_Stream) is
begin
if Stream.Input = null then
Stream.Eof := True;
else
Stream.Input.Read (Stream.Buffer (1 .. Stream.Last - 1), Stream.Write_Pos);
Stream.Eof := Stream.Write_Pos < 1;
if not Stream.Eof then
Stream.Write_Pos := Stream.Write_Pos + 1;
end if;
Stream.Read_Pos := 1;
end if;
end Fill;
-- ------------------------------
-- Read one character from the input stream.
-- ------------------------------
procedure Read (Stream : in out Input_Buffer_Stream;
Char : out Character) is
begin
if Stream.Read_Pos >= Stream.Write_Pos then
Stream.Fill;
if Stream.Eof then
raise Ada.IO_Exceptions.Data_Error with "End of buffer";
end if;
end if;
Char := Character'Val (Stream.Buffer (Stream.Read_Pos));
Stream.Read_Pos := Stream.Read_Pos + 1;
end Read;
procedure Read (Stream : in out Input_Buffer_Stream;
Value : out Ada.Streams.Stream_Element) is
begin
if Stream.Read_Pos >= Stream.Write_Pos then
Stream.Fill;
if Stream.Eof then
raise Ada.IO_Exceptions.Data_Error with "End of buffer";
end if;
end if;
Value := Stream.Buffer (Stream.Read_Pos);
Stream.Read_Pos := Stream.Read_Pos + 1;
end Read;
-- ------------------------------
-- Read one character from the input stream.
-- ------------------------------
procedure Read (Stream : in out Input_Buffer_Stream;
Char : out Wide_Wide_Character) is
use Interfaces;
Val : Ada.Streams.Stream_Element;
Result : Unsigned_32;
begin
Stream.Read (Val);
-- UTF-8 conversion
-- 7 U+0000 U+007F 1 0xxxxxxx
if Val <= 16#7F# then
Char := Wide_Wide_Character'Val (Val);
-- 11 U+0080 U+07FF 2 110xxxxx 10xxxxxx
elsif Val <= 16#DF# then
Result := Shift_Left (Unsigned_32 (Val and 16#1F#), 6);
Stream.Read (Val);
Result := Result or Unsigned_32 (Val and 16#3F#);
Char := Wide_Wide_Character'Val (Result);
-- 16 U+0800 U+FFFF 3 1110xxxx 10xxxxxx 10xxxxxx
elsif Val <= 16#EF# then
Result := Shift_Left (Unsigned_32 (Val and 16#0F#), 12);
Stream.Read (Val);
Result := Result or Shift_Left (Unsigned_32 (Val and 16#3F#), 6);
Stream.Read (Val);
Result := Result or Unsigned_32 (Val and 16#3F#);
Char := Wide_Wide_Character'Val (Result);
-- 21 U+10000 U+1FFFFF 4 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
else
Result := Shift_Left (Unsigned_32 (Val and 16#07#), 18);
Stream.Read (Val);
Result := Result or Shift_Left (Unsigned_32 (Val and 16#3F#), 12);
Stream.Read (Val);
Result := Result or Shift_Left (Unsigned_32 (Val and 16#3F#), 6);
Stream.Read (Val);
Result := Result or Unsigned_32 (Val and 16#3F#);
Char := Wide_Wide_Character'Val (Result);
end if;
end Read;
-- ------------------------------
-- Read into the buffer as many bytes as possible and return in
-- <b>last</b> the position of the last byte read.
-- ------------------------------
overriding
procedure Read (Stream : in out Input_Buffer_Stream;
Into : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset) is
Start : Stream_Element_Offset := Into'First;
Pos : Stream_Element_Offset := Stream.Read_Pos;
Avail : Stream_Element_Offset;
Size : Stream_Element_Offset;
Total : Stream_Element_Offset := 0;
begin
while Start <= Into'Last loop
Size := Into'Last - Start + 1;
Avail := Stream.Write_Pos - Pos;
if Avail = 0 then
Stream.Fill;
Pos := Stream.Read_Pos;
Avail := Stream.Write_Pos - Pos;
exit when Avail <= 0;
end if;
if Avail < Size then
Size := Avail;
end if;
Into (Start .. Start + Size - 1) := Stream.Buffer (Pos .. Pos + Size - 1);
Start := Start + Size;
Pos := Pos + Size;
Total := Total + Size;
Stream.Read_Pos := Pos;
end loop;
Last := Total;
end Read;
-- ------------------------------
-- Read into the buffer as many bytes as possible and return in
-- <b>last</b> the position of the last byte read.
-- ------------------------------
procedure Read (Stream : in out Input_Buffer_Stream;
Into : in out Ada.Strings.Unbounded.Unbounded_String) is
Pos : Stream_Element_Offset := Stream.Read_Pos;
Avail : Stream_Element_Offset;
begin
loop
Avail := Stream.Write_Pos - Pos;
if Avail = 0 then
Stream.Fill;
if Stream.Eof then
return;
end if;
Pos := Stream.Read_Pos;
Avail := Stream.Write_Pos - Pos;
end if;
for I in 1 .. Avail loop
Ada.Strings.Unbounded.Append (Into, Character'Val (Stream.Buffer (Pos)));
Pos := Pos + 1;
end loop;
Stream.Read_Pos := Pos;
end loop;
end Read;
procedure Read (Stream : in out Input_Buffer_Stream;
Into : in out Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String) is
Pos : Stream_Element_Offset;
Avail : Stream_Element_Offset;
C : Wide_Wide_Character;
begin
loop
Pos := Stream.Read_Pos;
Avail := Stream.Write_Pos - Pos;
if Avail = 0 then
Stream.Fill;
if Stream.Eof then
return;
end if;
Pos := Stream.Read_Pos;
Avail := Stream.Write_Pos - Pos;
end if;
Stream.Read (C);
Ada.Strings.Wide_Wide_Unbounded.Append (Into, C);
end loop;
end Read;
-- ------------------------------
-- Flush the stream and release the buffer.
-- ------------------------------
overriding
procedure Finalize (Stream : in out Output_Buffer_Stream) is
begin
if Stream.Buffer /= null then
if Stream.Output /= null then
Stream.Flush;
end if;
Free_Buffer (Stream.Buffer);
end if;
end Finalize;
-- ------------------------------
-- Returns True if the end of the stream is reached.
-- ------------------------------
function Is_Eof (Stream : in Input_Buffer_Stream) return Boolean is
begin
return Stream.Eof;
end Is_Eof;
-- ------------------------------
-- Flush the stream and release the buffer.
-- ------------------------------
overriding
procedure Finalize (Object : in out Input_Buffer_Stream) is
begin
if Object.Buffer /= null then
Free_Buffer (Object.Buffer);
end if;
end Finalize;
end Util.Streams.Buffered;
|
src/simple_blockchain-blockchain.adb | tomekw/simple_blockchain | 23 | 24444 | <reponame>tomekw/simple_blockchain
with Ada.Characters.Latin_1;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package body Simple_Blockchain.Blockchain is
function Get_Blocks (This : Object) return Block_Vectors.Vector is (This.Blocks);
function Get_Difficulty (This : Object) return Natural is (Natural (This.Difficulty));
function Image (This : Object) return String is
Result : Unbounded_String;
EOL : String(1 .. 2) := (1 => Ada.Characters.Latin_1.CR, 2 => Ada.Characters.Latin_1.LF);
begin
Append (Result, "Blockchain - difficulty: " & Get_Difficulty (This)'Image & ", blocks: " & Block_Vectors.Length (Get_Blocks (This))'Image & EOL);
for I in Get_Blocks (This).First_Index .. Get_Blocks (This).Last_Index loop
Append (Result, Block.Image (Get_Blocks (This) (I)) & EOL);
end loop;
return To_String (Result);
end Image;
function Is_Valid (This : Object) return Boolean is
Current_Block : Block.Object;
Next_Block : Block.Object;
begin
for I in Get_Blocks (This).First_Index .. (Get_Blocks (This).Last_Index - 1) loop
Current_Block := Block_Vectors.Element (Get_Blocks (This), I);
Next_Block := Block_Vectors.Element (Get_Blocks (This), I + 1);
if Block.Get_Hash (Next_Block) /= Block.Calculate_Hash (Block.Get_Previous_Hash (Next_Block), Block.Get_Timestamp (Next_Block), Block.Get_Nonce (Next_Block), Block.Get_Data (Next_Block)) then
return False;
end if;
if Block.Get_Hash (Current_Block) /= Block.Get_Previous_Hash (Next_Block) then
return False;
end if;
if Block.Get_Hash (Next_Block) (1.. Get_Difficulty (This)) /= Expected_Hash_Prefix (This) then
return False;
end if;
end loop;
return True;
end Is_Valid;
function Make (Difficulty : Blockchain_Difficulty) return Object is
begin
return (
Blocks => Block_Vectors.Empty_Vector,
Difficulty => Difficulty);
end Make;
procedure Mine_Block (This : in out Object; Data : String) is
New_Block : Block.Object;
Previous_Hash : String (1 .. 64);
begin
if Is_Empty (This) then
Previous_Hash := (others => '0');
else
Previous_Hash := Block.Get_Hash (Last_Block (This));
end if;
New_Block := Block.Make (Previous_Hash => Previous_Hash, Data => Data);
while Block.Get_Hash (New_Block) (1 .. Get_Difficulty (This)) /= Expected_Hash_Prefix (This) loop
Block.Recalculate_Hash (New_Block);
end loop;
Block_Vectors.Append (This.Blocks, New_Block);
end Mine_Block;
function Expected_Hash_Prefix (This : Object) return String is
begin
return Prefix : String (1 .. Get_Difficulty (This)) do
Prefix := (others => '0');
end return;
end Expected_Hash_Prefix;
function Is_Empty (This : Object) return Boolean is (Block_Vectors.Is_Empty (Get_Blocks (This)));
function Last_Block (This : Object) return Block.Object is (Block_Vectors.Last_Element (Get_Blocks (This)));
end Simple_Blockchain.Blockchain;
|
llvm-gcc-4.2-2.9/gcc/ada/exp_vfpt.ads | vidkidz/crossbridge | 1 | 15140 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ V F P T --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains specialized routines for handling the expansion
-- of arithmetic and conversion operations involving Vax format floating-
-- point formats as used on the Vax and the Alpha and the ia64.
with Types; use Types;
package Exp_VFpt is
procedure Expand_Vax_Arith (N : Node_Id);
-- The node N is an arithmetic node (N_Op_Abs, N_Op_Add, N_Op_Sub,
-- N_Op_Div, N_Op_Mul, N_Op_Minus where the operands are in Vax float
-- format. This procedure expands the necessary call.
procedure Expand_Vax_Comparison (N : Node_Id);
-- The node N is an arithmetic comparison node where the types to be
-- compared are in Vax float format. This procedure expands the necessary
-- call.
procedure Expand_Vax_Conversion (N : Node_Id);
-- The node N is a type conversion node where either the source or the
-- target type, or both, are Vax floating-point type.
procedure Expand_Vax_Real_Literal (N : Node_Id);
-- The node N is a real literal node where the type is a Vax floating-point
-- type. This procedure rewrites the node to eliminate the occurrence of
-- such constants.
procedure Expand_Vax_Valid (N : Node_Id);
-- The node N is an attribute reference node for the Valid attribute where
-- the prefix is of a Vax floating-point type. This procedure expands the
-- necessary call for the validity test.
end Exp_VFpt;
|
oeis/156/A156195.asm | neoneye/loda-programs | 11 | 28822 | <reponame>neoneye/loda-programs<gh_stars>10-100
; A156195: a(2n+2) = 6*a(2n+1), a(2n+1) = 6*a(2n) - 5^n*A000108(n), a(0)=1.
; Submitted by <NAME>
; 1,5,30,175,1050,6250,37500,224375,1346250,8068750,48412500,290343750,1742062500,10450312500,62701875000,376177734375,2257066406250,13541839843750,81251039062500,487496738281250,2924980429687500,17549718554687500,105298311328125000
mov $2,1
mov $3,$0
mov $4,1
mov $5,1
lpb $3
mul $2,$3
div $2,$4
sub $3,1
add $4,1
trn $5,$2
mul $2,5
add $5,$2
lpe
mov $0,$5
|
oeis/134/A134017.asm | neoneye/loda-programs | 11 | 179346 | ; A134017: Period 9: repeat 1, 2, 4, 3, 5, 3, 4, 2, 1.
; 1,2,4,3,5,3,4,2,1,1,2,4,3,5,3,4,2,1,1,2,4,3,5,3,4,2,1,1,2,4,3,5,3,4,2,1,1,2,4,3,5,3,4,2,1,1,2,4,3,5,3,4,2,1
lpb $0
mul $0,8
sub $0,1
mod $0,9
lpe
pow $0,3
mod $0,5
add $0,1
|
test/interaction/Issue2217.agda | cruhland/agda | 1,989 | 6394 | import Issue2217.M
{-# TERMINATING #-}
A : Set
A = ?
a : A
a = ?
|
ejercicios2/vectores.ads | iyan22/AprendeAda | 0 | 20960 | package vectores is
type Vector_De_Enteros is array (Integer range <>) of Integer;
type Vector_De_Reales is array (Integer range <>) of Float;
type Vector_De_Booleanos is array (Integer range <>) of Boolean;
type Vector_De_Caracteres is array (Integer range <>) of Character;
end vectores;
|
sdmmc.asm | luciodj/WAV-1K | 1 | 98594 | ;
; sdmmc.asm
;
#include "main.inc"
GLOBAL SD_MEDIAinit, SD_SECTORread, LBA
; SD card commands
#define CMD_RESET 0 ; a.k.a. GO_IDLE (CMD0)
#define CMD_INIT 1 ; a.k.a. SEND_OP_COND (CMD1)
#define CMD_SEND_CSD .9
#define CMD_SEND_CID .10
#define CMD_SET_BLEN .16
#define CMD_READ_SINGLE .17 ; read a single sector of data
#define CMD_WRITE_SINGLE .24
#define CMD_APP_CMD .55
#define CMD_SEND_APP_OP .41
; SD card responses
#define DATA_START 0xFE
#define DATA_ACCEPT 0x05
sdmmc_shr UDATA_SHR 0x70
LBA res 3
count res 1
count9 res 1
countH res 1
temp res 1
;---------------------------------------------------------------
SDMMC CODE
SD_Enable MACRO
banksel LATB
bcf SD_CS
ENDM
SPI_read MACRO
movlw 0xFF
call SPI_write
ENDM
SD_Disable MACRO
banksel LATB
bsf SD_CS
ENDM
SPI_init_slow
banksel SSP1STAT
set_sfr SSP1STAT,0x40
set_sfr SSP1CON1,0x2A
set_sfr SSP1ADD, .79
retlw 1
SPI_init_fast
banksel SSP1STAT
set_sfr SSP1STAT,0x40
set_sfr SSP1CON1,0x20
clrf SSP1ADD
retlw 1
SPI_write
; input W value to write
; output W read value
; output bank0
banksel SSP1CON1
bcf SSP1CON1,WCOL
movwf SSP1BUF
wait_until SSP1STAT,BF
movf SSP1BUF,W
return
;----------------------------------------------------------------
SD_CMDsend
; input LBA desired LBA
; input W desired CMD
; output W : status, SD still enabled!
SD_Enable
; 1. send the command : W
iorlw 0x40 ; add frame bit
call SPI_write
; 2. send the address : LBA * 512 (LBA << 9)
rlf LBA+1,W
rlf LBA+2,W
call SPI_write
rlf LBA,W
rlf LBA+1,W
call SPI_write
CLRC
rlf LBA,W
call SPI_write
movlw 0
call SPI_write
; 3. send CMD0 CRC
movlw 0x95
call SPI_write
; 4. wait for a response (allow up to 8 bytes delay)
movlw .9
movwf count9
SD_CMDsendL
SPI_read ; check if ready
xorlw 0xFF
bnz SD_CMDsendB
decfsz count9
goto SD_CMDsendL
SD_CMDsendB
xorlw 0xFF
return
; left SD enabled!
; return responses
; FF - timeout
; 00 - command accepted
; 01 - command received, card in idle state after RESET
;other codes:
; bit 0 = Idle state
; bit 1 = Erase Reset
; bit 2 = Illegal command
; bit 3 = Communication CRC error
; bit 4 = Erase sequence error
; bit 5 = Address error
; bit 6 = Parameter error
; bit 7 = Always 0
;-----------------------------------------------
SD_MEDIAinit
call SPI_init_slow
; 1. with the card not selected
SD_Disable
; 2. send 80 clock cycles to start up
movlw .10
movwf count
SD_MEDIAinitL1
movlw 0xFF
call SPI_write
decfsz count
goto SD_MEDIAinitL1
; 3. now select the card
SD_Enable
; 4. send a Reset command to enter SPI mode
clrf LBA+2
clrf LBA+1
clrf LBA
movlw CMD_RESET
call SD_CMDsend
SD_Disable
xorlw 0x01
bz SD_MEDIA5
SPI_read
retlw 0x84 ; reset command not accepted
; 5. send repeatedly INIT
SD_MEDIA5
SPI_read
movlw HIGH(.1000)+1
movwf countH
movlw LOW(.1000)
movwf count
SD_MEDIAinitL2
movlw CMD_INIT
call SD_CMDsend
SD_Disable
andlw 0xff
bz SD_MEDIAinitB
SPI_read
decfsz count
goto SD_MEDIAinitL2
decfsz countH
goto SD_MEDIAinitL2
iorlw 1
retlw 0x85 ; NZ init failure
;
SD_MEDIAinitB
SPI_read
call SPI_init_fast
andlw 0 ; Z success
return
;-------------------------------------------------------
SD_SECTORread
; input LBA selected lba
; input FSR0 : data buffer
; output W success if 00, failure otherwise
; 1. send read command
movlw CMD_READ_SINGLE
call SD_CMDsend
bnz SD_SECTORreadE
; 2. wait for DATA_START
SD_SECTORwait
movlw HIGH(.1000)+1
movwf countH
movlw LOW(.1000)
movwf count
SD_SECTORwaitL
SPI_read
xorlw DATA_START
bz SD_SECTORwaitB ; data has arrived
decfsz count
bra SD_SECTORwaitL
decfsz countH
bra SD_SECTORwaitL
SD_Disable
SPI_read
iorlw 1
return ; NZ failure
SD_SECTORwaitB
; 3. read data
banksel SSP1BUF
clrf count
read_loop
movlw 0xff
movwf SSP1BUF
wait_until SSP1STAT,BF
movf SSP1BUF,W
movwi FSR0++
decfsz count
goto read_loop
read_loop2
movlw 0xff
movwf SSP1BUF
wait_until SSP1STAT,BF
movf SSP1BUF,W
movwi FSR0++
decfsz count
goto read_loop2
; 5. ignore CRC
SPI_read
SPI_read
SD_SECTORreadE
SD_Disable
SPI_read
andlw 0
return ; Z success
END
|
programs/oeis/194/A194755.asm | karttu/loda | 1 | 23371 | ; A194755: Number of k such that {k*pi} > {n*pi}, where { } = fractional part.
; 0,0,0,0,0,0,0,7,6,5,4,3,2,1,14,12,10,8,6,4,2,21,18,15,12,9,6,3,28,24,20,16,12,8,4,35,30,25,20,15,10,5,42,36,30,24,18,12,6,49,42,35,28,21,14,7,56,48,40,32,24,16,8,63,54,45,36,27,18,9,70,60,50,40,30,20
mov $1,7
mov $2,$0
mod $0,7
sub $1,$0
sub $2,$0
mul $1,$2
div $1,7
|
oeis/109/A109013.asm | neoneye/loda-programs | 11 | 92546 | ; A109013: a(n) = gcd(n,10).
; Submitted by <NAME>
; 10,1,2,1,2,5,2,1,2,1,10,1,2,1,2,5,2,1,2,1,10,1,2,1,2,5,2,1,2,1,10,1,2,1,2,5,2,1,2,1,10,1,2,1,2,5,2,1,2,1,10,1,2,1,2,5,2,1,2,1,10,1,2,1,2,5,2,1,2,1,10,1,2,1,2,5,2,1,2,1,10,1,2,1,2,5,2,1,2,1,10,1,2,1,2,5,2,1
gcd $0,10
|
MSDOS/Virus.MSDOS.Unknown.loader.asm | fengjixuchui/Family | 3 | 172097 | PAGE ,132
VIRUS SEGMENT PARA PUBLIC 'CODE'
ASSUME CS:VIRUS,DS:VIRUS
call gyilk
int 20h
nop
gyilk: push ax
push bx
push cx
push dx
push es
push ds
push di
push si
call cim
cim: pop bx
mov si,5aa5h
mov di,55aah
push cs
pop es
ujra: add bx,1000
cmp bx,1000
jnc kilep1
jmp kilep
kilep1: push bx
mov ax,201h
mov dx,80h
mov cx,1
int 13h
pop bx
jnc tovabb
jmp kilep
tovabb: cmp si,0a55ah
jnz tivbi1
jmp kilep
tivbi1: mov ax,cs:word ptr [bx]
cmp ax,12cdh
jz kilep
tovbi: push bx
mov ax,201h
mov dx,0h
mov cx,1
int 13h
pop bx
jnc tovabbi
cmp ah,6
jz tovbi
jmp kilep
tovabbi: mov ax,cs
add ax,1000h
push bx
push ax
int 12h
mov bx,64
mul bx
sub ax,1000h
mov bx,ax
pop ax
cmp bx,ax
jnc oke1
pop bx
jmp kilep
oke1: pop bx
oke: mov es,ax
mov ax,cs:[bx+18h]
mov cx,cs:[bx+1ah]
mul cx
mov cx,ax
mov ax,cs:[bx+13h]
mov dx,0
div cx
sub bx,1000
push bx
mov ch,al
mov cl,1
mov bx,100h
mov dx,0
mov ax,208h
int 13h
pop bx
jc kilep
push bx
mov bx,100h
mov ax,es:[bx]
cmp ax,2452h
pop bx
jnz kilep
mov ax,bx
add ax,offset kilep-offset cim
push cs
push ax
mov ax,10ah
push es
push ax
retf
kilep: pop si
pop di
pop ds
pop es
pop dx
pop cx
pop bx
pop ax
ret
cime: dw 0
VEG EQU $
VIRUS ENDS
END
|
src/x86-64/syscalls/misc.asm | ohnx/ge | 0 | 84460 | <gh_stars>0
; =============================================================================
; BareMetal -- a 64-bit OS written in Assembly for x86-64 systems
; Copyright (C) 2008-2015 Return Infinity -- see LICENSE.TXT
;
; Misc Functions
; =============================================================================
; -----------------------------------------------------------------------------
; os_delay -- Delay by X eights of a second
; IN: RAX = Time in eights of a second
; OUT: All registers preserved
; A value of 8 in RAX will delay 1 second and a value of 1 will delay 1/8 of a second
; This function depends on the RTC (IRQ 8) so interrupts must be enabled.
os_delay:
push rcx
push rax
mov rcx, [os_ClockCounter] ; Grab the initial timer counter. It increments 8 times a second
add rax, rcx ; Add RCX so we get the end time we want
os_delay_loop:
cmp qword [os_ClockCounter], rax ; Compare it against our end time
jle os_delay_loop ; Loop if RAX is still lower
pop rax
pop rcx
ret
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; os_get_argv -- Get the value of an argument that was passed to the program
; IN: RAX = Argument number
; OUT: RAX = Start of numbered argument string
os_get_argv:
push rsi
push rcx
mov rsi, os_args
cmp al, 0x00
je os_get_argv_end
mov cl, al
os_get_argv_nextchar:
lodsb
cmp al, 0x00
jne os_get_argv_nextchar
dec cl
cmp cl, 0
jne os_get_argv_nextchar
os_get_argv_end:
mov rax, rsi
pop rcx
pop rsi
ret
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; os_system_config - View or modify system configuration options
; IN: RDX = Function #
; RAX = Variable
; OUT: RAX = Result
; All other registers preserved
os_system_config:
cmp rdx, 0
je os_system_config_timecounter
cmp rdx, 1
je os_system_config_argc
cmp rdx, 2
je os_system_config_argv
cmp rdx, 3
je os_system_config_networkcallback_get
cmp rdx, 4
je os_system_config_networkcallback_set
cmp rdx, 5
je os_system_config_clockcallback_get
cmp rdx, 6
je os_system_config_clockcallback_set
cmp rdx, 20
je os_system_config_video_base
cmp rdx, 21
je os_system_config_video_x
cmp rdx, 22
je os_system_config_video_y
cmp rdx, 23
je os_system_config_video_bpp
cmp rdx, 30
je os_system_config_mac
ret
os_system_config_timecounter:
mov rax, [os_ClockCounter] ; Grab the timer counter value. It increments 8 times a second
ret
os_system_config_argc:
xor eax, eax
mov al, [app_argc]
ret
os_system_config_argv:
call os_get_argv
ret
os_system_config_networkcallback_get:
mov rax, [os_NetworkCallback]
ret
os_system_config_networkcallback_set:
mov qword [os_NetworkCallback], rax
ret
os_system_config_clockcallback_get:
mov rax, [os_ClockCallback]
ret
os_system_config_clockcallback_set:
mov qword [os_ClockCallback], rax
ret
os_system_config_video_base:
mov rax, [os_VideoBase]
ret
os_system_config_video_x:
xor eax, eax
mov ax, [os_VideoX]
ret
os_system_config_video_y:
xor eax, eax
mov ax, [os_VideoY]
ret
os_system_config_video_bpp:
xor eax, eax
mov al, [os_VideoDepth]
ret
os_system_config_mac:
call os_net_status
ret
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; os_system_misc - Call misc OS sub-functions
; IN: RDX = Function #
; RAX = Variable 1
; RCX = Variable 2
; OUT: RAX = Result 1, dependant on system call
; RCX = Result 2, dependant on system call
os_system_misc:
; cmp rdx, X
; je os_system_misc_
cmp rdx, 1
je os_system_misc_smp_get_id
cmp rdx, 2
je os_system_misc_smp_lock
cmp rdx, 3
je os_system_misc_smp_unlock
cmp rdx, 4
je os_system_misc_debug_dump_mem
cmp rdx, 5
je os_system_misc_debug_dump_rax
cmp rdx, 6
je os_system_misc_delay
cmp rdx, 7
je os_system_misc_ethernet_status
cmp rdx, 8
je os_system_misc_mem_get_free
cmp rdx, 9
je os_system_misc_smp_numcores
cmp rdx, 10
je os_system_misc_smp_queuelen
ret
os_system_misc_smp_get_id:
call os_smp_get_id
ret
os_system_misc_smp_lock:
call os_smp_lock
ret
os_system_misc_smp_unlock:
call os_smp_unlock
ret
os_system_misc_debug_dump_mem:
push rsi
mov rsi, rax
call os_debug_dump_mem
pop rsi
ret
os_system_misc_debug_dump_rax:
call os_debug_dump_rax
ret
os_system_misc_delay:
call os_delay
ret
os_system_misc_ethernet_status:
call os_net_status
ret
os_system_misc_mem_get_free:
call os_mem_get_free
ret
os_system_misc_smp_numcores:
call os_smp_numcores
ret
os_system_misc_smp_queuelen:
call os_smp_queuelen
ret
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; reboot -- Reboot the computer
reboot:
in al, 0x64
test al, 00000010b ; Wait for an empty Input Buffer
jne reboot
mov al, 0xFE
out 0x64, al ; Send the reboot call to the keyboard controller
jmp reboot
; -----------------------------------------------------------------------------
; =============================================================================
; EOF
|
transformy/tables/gen/0002.asm | mborik/regression | 3 | 96935 | <gh_stars>1-10
ld a, 15
ld hl, basescradr + #05cb
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld a, 255
ld hl, basescradr + #05cc
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #05cd
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #05ce
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #05cf
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #05d0
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #05d1
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #05d2
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #05d3
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #05d4
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld a, 128
ld hl, basescradr + #00f5
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #05d5
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0815
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld (basescradr + #0835), a
ld (basescradr + #0935), a
ld (basescradr + #0ed5), a
ld (basescradr + #0fd5), a
ld a, 7
ld hl, basescradr + #00eb
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #080b
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #082b
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #084b
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld a, 192
ld hl, basescradr + #0855
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0875
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0895
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a35
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld (basescradr + #0dd5), a
ld a, 3
ld hl, basescradr + #086b
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #088b
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08ab
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08cb
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08eb
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld (basescradr + #0e4b), a
ld (basescradr + #0f4b), a
ld a, 224
ld hl, basescradr + #08b5
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08d5
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0d95
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
xor a
ld hl, basescradr + #0beb
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0bec
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0bed
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0bee
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0bef
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0bf0
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0bf1
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0bf2
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0bf3
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0bf4
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ret
|
testsuite/tests/T618-047__Ada_2020/f2020.adb | AdaCore/style_checker | 2 | 10442 | <gh_stars>1-10
------------------------------------------------------------------------------
-- Copyright (C) 2003-2006, AdaCore --
function F2020 (I : Integer) return String
is
type R is record
I : Integer;
end record;
X : R := (I => I);
Y : String := X'Image; -- Legal in Ada 2020
begin
if Y (Y'First) /= Character'Last then
Y (Y'First) := @'Last; -- Requires -gnat2020
end if;
return Y;
end F2020;
|
docs/www.playvectrex.com/designit/chrissalo/dot1.asm | mikepea/vectrex-playground | 5 | 15111 | <gh_stars>1-10
;***************************************************************************
; DEFINE SECTION
;***************************************************************************
INCLUDE "VECTREX.I" ; vectrex function includes
; start of vectrex memory with cartridge name...
ORG 0
;***************************************************************************
; HEADER SECTION
;***************************************************************************
DB "g GCE 1998", $80 ; 'g' is copyright sign
DW music1 ; music from the rom
DB $F8, $50, $20, -$56 ; height, width, rel y, rel x
; (from 0,0)
DB "PLOT A DOT",$80 ; some game information,
; ending with $80
DB 0 ; end of game header
;***************************************************************************
; CODE SECTION
;***************************************************************************
; here the cartridge program starts off
main:
JSR Wait_Recal ; Vectrex BIOS recalibration
JSR Intensity_5F ; Sets the intensity of the
; vector beam to $5f
; special attention here!!!
JSR Dot_here ; Plot a dot at the center of
; the screen
BRA main ; and repeat forever
;***************************************************************************
END main
;***************************************************************************
|
source/library/program-unit_naming.ads | reznikmm/gela | 0 | 30669 | <reponame>reznikmm/gela<filename>source/library/program-unit_naming.ads<gh_stars>0
-- SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
--
-- This package provides Unit_Naming_Schema interface and its methods.
package Program.Unit_Naming is
pragma Preelaborate;
type Unit_Naming_Schema is limited interface;
-- Interface to get compilation Text_Name for given compilation unit.
type Unit_Naming_Schema_Access is access all Unit_Naming_Schema'Class;
for Unit_Naming_Schema_Access'Storage_Size use 0;
not overriding function Standard_Text_Name (Self : Unit_Naming_Schema)
return Text is abstract;
-- Get compilation Text_Name for Standard library package.
not overriding function Declaration_Text_Name
(Self : Unit_Naming_Schema;
Name : Program.Text)
return Text is abstract;
-- Get compilation Text_Name for given library declaration unit.
not overriding function Body_Text_Name
(Self : Unit_Naming_Schema;
Name : Program.Text)
return Text is abstract;
-- Get compilation Text_Name for given body.
not overriding function Subunit_Text_Name
(Self : Unit_Naming_Schema;
Name : Program.Text)
return Text is abstract;
-- Get compilation Text_Name for given subunit.
end Program.Unit_Naming;
|
llvm/test/tools/llvm-ml/size_inference.asm | mkinsner/llvm | 2,338 | 176291 | ; RUN: not llvm-ml -filetype=s %s /Fo /dev/null 2>&1 | FileCheck %s --dump-input=always
.data
FOO STRUCT
dword_field DWORD 3
byte_field BYTE 4 DUP (1)
FOO ENDS
var FOO <>
.code
t1 PROC
mov eax, var.byte_field
; CHECK: error: invalid operand for instruction
mov eax, [var].byte_field
; CHECK: error: invalid operand for instruction
mov eax, [var.byte_field]
; CHECK: error: invalid operand for instruction
t1 ENDP
END
|
adium/ASUnitTests/GetWindowMinimized.applescript | sin-ivan/AdiumPipeEvent | 0 | 1244 | global HandyAdiumScripts
on run
tell application "Adium"
set c to minimized of window 1 --for later restore
set minimized of window 1 to (not c)
if (get minimized of window 1) is c then
--nothing to restore
error
end
set minimized of window 1 to c --restore
end tell
end run |
dll-manual-hijack/dll-fake-asm/main.asm | bernardopadua/blog-inversing | 0 | 91385 | [BITS 32]
global _start
[section .drectve info align=8]
db "kernel32.dll", 0x20
db "msvcrt.dll", 0x20
section .idata
extern __imp_send
extern __imp_LoadLibraryA
extern __imp_GetCurrentProcess
extern __imp_VirtualProtectEx
extern __imp_GetLastError
extern __imp_puts
extern __imp_fopen
extern __imp_fclose
extern __imp_fwrite
extern __imp_strlen
section .data
szdlltest db "dllsend2.dll", 0
addrdllsend dd 0
expfunc dd 0
impfunc dd 0
nbfunc db 0
oldprt dd 0
filename db "log.bin", 0
fileopenmd db "a+", 0
logfile dd 0
section .text
_start:
;cleaning
xor eax, eax
xor ebx, ebx
;getting the module address
push dword szdlltest
call [__imp_LoadLibraryA]
mov dword [addrdllsend], eax ;saving the dlltest2 base address
;grab exported functions of original DLL
mov ebx, [eax+0x3c] ;e_lfanew NTHEADER-offset
mov ebx, [eax+ebx+0x78] ;RVA export directory
mov cl, [eax+ebx+0x14] ;number of functions
mov [nbfunc], cl ;saving number of functions
mov ebx, [eax+ebx+0x1c] ;addresses to array of functions
add eax, ebx ;eax=baseaddress + ebx=RVA array of functions
mov dword [expfunc], eax ;saving address of functions
;saving the IAT of fake dll
mov eax, [esp+4] ;get dll base address on the stack
mov ebx, [eax+0x3c] ;e_lfanew NTHEADER-offset
mov ebx, [eax+ebx+0x80] ;RVA import directory
mov ebx, [eax+ebx+0x10] ;getting the RVA to IAT from the first dll (dlltest)
add eax, ebx ;Address for the IAT
mov dword [impfunc], eax
;change mem protection
xor ecx, ecx
xor eax, eax
xor edx, edx
mov cx, [nbfunc] ;this block calculates the size to change mem protection in VirtualProtectEx.
mov ax, 4 ;4=DWORD (pointer)
mul cx
mov ecx, eax
xor eax, eax
call [__imp_GetCurrentProcess]
mov edx, [impfunc]
push oldprt ;OUT PTR of VirtualProtect. pointer to receive previous access protection
push 0x04 ;new protection READ_WRITE
push ecx
push edx ;mem address to change
push eax
call [__imp_VirtualProtectEx] ;looks for VirtualProtectEx in Microsoft MSDN
cmp eax, 0 ;if 0 the protect failed
je geterror
;cleaning
xor eax, eax
xor ebx, ebx
xor ecx, ecx
xor edx, edx
;loop through the export and transfer to the imports
mov bl, 0
l_iexp:
mov ax, 4 ;4=DWORD (pointer)
mul bl
mov dx, ax ;index of array
cmp bl, byte [nbfunc]
je break_l
mov eax, [expfunc] ;iterating through IAT
mov eax, [eax+edx]
add eax, dword [addrdllsend] ;exp address
mov ecx, [impfunc]
lea ecx, [ecx+edx]
mov dword [ecx], eax
add bl, 1
jmp l_iexp
geterror:
call [__imp_GetLastError] ;Debugging purposes
break_l:
mov eax, 1
retn
send:
pushad ;save the register context in the stack
push dword [eax]
call [__imp_strlen]
push eax ;keep in the stack
push fileopenmd
push filename
call [__imp_fopen]
mov dword [logfile], eax
add esp, 8 ;cleaning the stack __cdecl
pop eax ;strlen keeped in the stack
pop ecx ;string parameter for original send
push dword [logfile]
push eax
push 1
push ecx
call [__imp_fwrite]
add esp, 16 ;cleaning the stack __cdecl
push dword [logfile]
call [__imp_fclose]
add esp, 4 ;cleaning the stack __cdecl
popad ;pop the register context back to each register
jmp [__imp_send]
retn
|
P6/data_P6_2/MDTest71.asm | alxzzhou/BUAA_CO_2020 | 1 | 22636 | ori $ra,$ra,0xf
ori $6,$6,5783
mflo $4
mtlo $2
addiu $5,$2,-14382
sb $2,16($0)
addu $5,$5,$5
mtlo $1
mult $5,$5
ori $2,$1,6177
mflo $4
sb $2,13($0)
mtlo $0
mult $4,$1
lui $1,32907
srav $3,$3,$3
ori $5,$5,2392
divu $0,$ra
lui $1,31070
multu $5,$5
lb $4,11($0)
sll $4,$6,31
srav $6,$0,$2
sb $5,9($0)
sll $1,$3,16
multu $2,$2
ori $5,$2,64
lb $4,5($0)
lb $4,5($0)
mthi $6
mult $5,$1
ori $4,$4,43620
multu $1,$1
divu $4,$ra
mfhi $0
srav $0,$3,$3
sb $0,13($0)
lui $6,1173
addu $4,$1,$3
lui $0,11729
addu $6,$0,$2
multu $3,$3
multu $4,$1
lui $5,27001
multu $1,$0
ori $6,$2,50703
mfhi $6
addu $1,$1,$3
srav $5,$3,$3
addiu $4,$6,28060
divu $1,$ra
mfhi $4
srav $4,$4,$3
mfhi $6
sll $5,$6,1
mult $1,$1
sll $1,$6,18
mfhi $4
lb $4,15($0)
addu $1,$6,$1
mthi $4
mflo $4
mult $4,$5
mflo $6
sb $1,1($0)
mthi $4
lb $3,2($0)
srav $4,$6,$0
div $3,$ra
mthi $0
divu $2,$ra
mult $1,$2
addiu $4,$2,4163
mthi $4
mflo $1
lui $1,38566
ori $4,$1,44333
mult $5,$0
addiu $1,$1,-588
ori $6,$5,45012
sll $1,$1,23
srav $3,$0,$3
lb $5,0($0)
ori $4,$4,7990
div $5,$ra
sll $3,$3,6
sb $5,8($0)
lb $2,13($0)
mthi $1
mtlo $0
srav $2,$1,$2
lui $4,2653
mtlo $1
mfhi $2
srav $6,$6,$4
srav $0,$2,$4
sll $4,$4,25
mult $5,$5
addiu $1,$2,-27410
addu $4,$5,$1
ori $4,$1,45133
sb $5,11($0)
sb $4,3($0)
sb $5,11($0)
ori $5,$5,59936
mult $5,$5
mthi $5
multu $1,$2
mfhi $4
mflo $4
lui $2,34958
divu $3,$ra
mtlo $6
lb $6,6($0)
div $4,$ra
mult $5,$4
lui $5,2481
addiu $5,$5,13097
sll $1,$1,1
mthi $4
ori $3,$3,3166
multu $2,$1
mflo $4
lb $2,12($0)
mflo $5
addiu $1,$6,-3625
addiu $2,$2,1808
ori $5,$4,56751
mtlo $2
mflo $1
mfhi $1
srav $4,$2,$1
mflo $3
mult $4,$0
mthi $3
addu $4,$1,$1
mthi $0
mtlo $0
mult $4,$1
sb $3,15($0)
mflo $0
ori $2,$0,55565
sll $5,$5,17
mult $0,$1
lb $2,11($0)
sll $2,$2,31
mult $2,$1
srav $4,$6,$4
mtlo $5
div $6,$ra
lui $1,52305
lui $2,63338
lui $3,58117
mfhi $4
lui $0,3945
lb $4,12($0)
ori $6,$4,3736
mult $4,$1
divu $6,$ra
addiu $1,$6,-31791
sll $2,$2,10
addu $4,$2,$3
mthi $5
sll $0,$5,23
sb $5,2($0)
ori $5,$5,43496
sll $6,$6,21
divu $5,$ra
ori $5,$0,5138
sll $2,$2,10
sb $3,6($0)
mflo $5
mtlo $4
mtlo $0
sb $0,14($0)
mtlo $5
multu $3,$2
divu $5,$ra
mtlo $3
ori $4,$4,50154
lb $6,9($0)
sll $5,$2,24
mthi $2
mfhi $0
lb $3,15($0)
mthi $4
multu $4,$4
srav $5,$6,$3
mflo $5
lb $4,14($0)
mfhi $5
multu $4,$6
addu $5,$3,$3
lui $1,57459
mflo $5
mfhi $1
lb $1,16($0)
lui $5,25663
divu $1,$ra
mthi $3
mfhi $1
sll $0,$2,11
mthi $4
mtlo $6
divu $5,$ra
mthi $3
lb $2,4($0)
srav $2,$0,$2
divu $4,$ra
lb $5,3($0)
sb $4,12($0)
lui $4,33827
mfhi $5
div $4,$ra
divu $1,$ra
lui $0,30240
addiu $4,$5,5459
div $5,$ra
sb $1,12($0)
addu $4,$2,$3
addiu $4,$4,-20393
lui $2,55129
srav $5,$0,$5
sb $5,10($0)
sb $5,13($0)
sb $5,10($0)
srav $6,$6,$6
mfhi $3
div $4,$ra
div $1,$ra
lui $1,11991
mfhi $1
divu $4,$ra
addiu $1,$1,-23764
addiu $5,$4,20394
mtlo $5
multu $1,$1
lui $4,8753
divu $4,$ra
addu $6,$0,$1
ori $2,$4,59587
lb $4,14($0)
sll $3,$4,19
lb $1,0($0)
divu $0,$ra
mtlo $5
ori $1,$5,25693
sll $4,$4,1
mflo $5
div $5,$ra
sb $5,2($0)
mthi $4
div $4,$ra
sll $3,$6,1
div $5,$ra
lui $4,46284
lb $4,8($0)
div $0,$ra
mtlo $6
sll $5,$5,18
sll $0,$4,6
sll $0,$6,13
addu $0,$2,$4
mflo $1
mflo $6
mfhi $5
mfhi $4
mfhi $4
divu $4,$ra
mult $0,$2
mult $3,$3
divu $4,$ra
mfhi $4
lb $5,3($0)
mfhi $4
ori $5,$1,26654
lb $6,2($0)
divu $6,$ra
mflo $6
div $1,$ra
mflo $2
sb $1,8($0)
addu $5,$2,$5
mult $3,$3
ori $5,$5,6506
sb $4,3($0)
mfhi $1
lb $4,8($0)
lb $5,16($0)
mtlo $0
sb $2,11($0)
srav $1,$1,$3
mthi $0
div $3,$ra
mflo $0
addiu $5,$5,-23121
multu $1,$1
mflo $6
divu $1,$ra
mflo $4
ori $3,$2,20318
mflo $1
addiu $5,$5,951
multu $5,$2
mthi $4
lb $1,1($0)
lb $4,9($0)
divu $4,$ra
mfhi $4
mthi $0
sll $4,$1,13
mthi $2
ori $4,$1,45454
addiu $2,$2,-26154
divu $4,$ra
sll $5,$1,24
mflo $0
ori $0,$5,12647
lb $3,4($0)
sb $6,0($0)
lui $0,57527
mtlo $4
divu $4,$ra
lb $6,6($0)
divu $5,$ra
srav $5,$2,$5
addu $6,$4,$4
mflo $6
mflo $2
mflo $3
mtlo $5
srav $4,$3,$3
multu $1,$4
mult $5,$5
divu $4,$ra
addu $1,$1,$3
mfhi $6
lui $5,6483
div $1,$ra
srav $6,$4,$4
lui $2,35264
addiu $4,$2,-8458
mflo $4
sll $5,$4,25
ori $6,$3,2129
mult $4,$4
lb $0,15($0)
mthi $4
divu $1,$ra
multu $6,$1
multu $4,$4
srav $3,$0,$3
multu $3,$1
lui $4,41766
srav $4,$6,$2
addiu $4,$2,22897
ori $0,$1,21642
addiu $4,$5,-1661
addiu $4,$6,11721
mflo $6
mfhi $3
divu $4,$ra
sll $2,$2,29
divu $1,$ra
mthi $5
srav $5,$5,$4
sll $0,$0,11
mfhi $5
multu $2,$2
addiu $4,$5,15893
mtlo $5
lb $0,0($0)
lb $4,10($0)
sb $0,7($0)
srav $3,$5,$3
div $4,$ra
ori $5,$4,44803
ori $4,$6,46085
lui $1,20044
sll $5,$5,19
srav $5,$2,$3
div $5,$ra
mfhi $3
lb $0,2($0)
addiu $5,$6,20344
addiu $5,$3,1043
addiu $5,$2,-26121
mtlo $3
sb $0,5($0)
ori $0,$6,62304
mflo $3
mfhi $4
multu $4,$2
divu $3,$ra
div $2,$ra
sll $6,$4,17
divu $5,$ra
addu $6,$0,$0
mult $5,$4
srav $5,$1,$4
addu $5,$5,$3
mult $5,$2
divu $5,$ra
addu $4,$4,$6
mult $1,$1
div $2,$ra
srav $5,$5,$5
addiu $4,$1,28223
lui $6,29172
mfhi $4
mult $1,$1
sll $2,$2,30
sb $5,11($0)
addu $4,$4,$4
addu $2,$2,$3
ori $5,$5,13508
multu $1,$6
lb $4,8($0)
mflo $4
mult $4,$4
addu $0,$2,$6
srav $0,$1,$2
addu $5,$5,$2
srav $4,$4,$2
mthi $5
sb $3,14($0)
addu $5,$6,$3
mthi $5
sb $2,0($0)
mtlo $1
ori $4,$1,54989
mtlo $4
multu $0,$3
sb $1,3($0)
mflo $5
div $5,$ra
sll $4,$4,15
sb $1,16($0)
multu $4,$4
mtlo $6
srav $4,$2,$4
lui $1,3207
srav $4,$4,$5
divu $6,$ra
lui $4,65195
ori $6,$2,25340
mult $5,$2
lui $1,30150
lb $1,11($0)
div $1,$ra
addu $0,$4,$6
mflo $1
mult $1,$1
mflo $1
srav $5,$5,$5
sb $2,1($0)
mflo $5
mfhi $5
lb $5,9($0)
addiu $5,$4,-3740
srav $4,$4,$2
multu $2,$1
sb $4,11($0)
srav $1,$0,$0
divu $5,$ra
mtlo $2
addiu $4,$0,-5243
lui $4,55774
lb $1,6($0)
addiu $2,$2,-1775
mthi $2
sb $5,8($0)
multu $2,$2
addu $6,$5,$3
div $1,$ra
mflo $3
divu $2,$ra
lb $0,9($0)
ori $1,$1,46628
mfhi $5
mult $4,$4
mtlo $1
addu $5,$5,$2
ori $4,$5,3726
lui $5,26504
mfhi $5
addiu $4,$4,23581
lb $5,15($0)
mthi $3
mult $4,$2
div $6,$ra
sb $6,0($0)
multu $4,$5
mfhi $2
addiu $3,$6,20820
mult $5,$2
lui $4,20966
addiu $0,$5,-23570
mfhi $1
mult $0,$3
mflo $4
mtlo $5
div $4,$ra
mfhi $2
lui $6,23116
mflo $6
mtlo $4
divu $3,$ra
divu $1,$ra
mult $0,$5
lb $1,15($0)
div $4,$ra
sb $2,13($0)
divu $4,$ra
div $5,$ra
divu $5,$ra
div $1,$ra
mfhi $5
mult $1,$5
mflo $4
addiu $1,$4,13133
lui $4,28942
divu $1,$ra
mflo $5
srav $6,$5,$3
lui $5,21378
addu $1,$1,$5
mtlo $4
mfhi $0
mthi $1
mtlo $0
divu $0,$ra
mflo $3
sll $1,$2,1
ori $4,$4,10950
mthi $3
addiu $2,$2,-32274
mflo $1
sll $4,$3,28
div $6,$ra
addiu $4,$4,-16227
addiu $0,$2,-15131
mflo $2
sb $4,6($0)
addu $3,$3,$3
mflo $0
divu $4,$ra
divu $4,$ra
mtlo $0
mfhi $4
mfhi $0
sb $4,1($0)
lb $1,15($0)
lb $3,15($0)
mthi $3
sll $4,$4,14
mfhi $5
mtlo $2
divu $6,$ra
mtlo $1
addu $5,$2,$2
lb $3,12($0)
lui $1,38683
mtlo $2
divu $4,$ra
multu $1,$0
sll $2,$2,6
div $4,$ra
srav $1,$2,$3
mthi $5
ori $1,$5,37334
mfhi $5
lb $1,16($0)
sb $3,13($0)
sll $5,$4,5
lb $1,15($0)
divu $5,$ra
sll $6,$4,12
sb $4,13($0)
lb $1,2($0)
ori $2,$2,49259
divu $4,$ra
mthi $4
lui $6,20373
sb $1,8($0)
addiu $4,$5,21762
mflo $4
divu $4,$ra
mfhi $0
sb $4,2($0)
mfhi $5
mthi $5
mult $4,$3
addu $4,$4,$3
divu $4,$ra
sb $5,9($0)
multu $1,$1
addiu $4,$5,-25754
mult $0,$0
srav $4,$1,$2
lui $6,40505
mthi $4
mtlo $0
addiu $5,$1,-16744
sll $4,$6,21
sb $5,0($0)
addiu $5,$4,-31230
addiu $3,$3,8360
sb $1,15($0)
mfhi $2
srav $3,$2,$3
lui $5,14048
mthi $4
mfhi $2
lb $4,4($0)
ori $5,$0,50870
srav $5,$4,$5
srav $1,$3,$3
srav $5,$2,$2
sb $1,10($0)
mfhi $3
lui $5,49355
mthi $0
mthi $4
mflo $4
sll $4,$2,16
mflo $1
divu $1,$ra
sll $1,$1,11
lui $4,7545
sll $5,$4,20
mfhi $4
mult $4,$5
div $1,$ra
divu $2,$ra
addiu $5,$0,7884
mthi $1
div $4,$ra
mtlo $4
mthi $1
lui $4,33266
div $3,$ra
lui $5,54354
mtlo $0
addiu $6,$1,-1919
multu $5,$5
sll $4,$1,13
addiu $1,$1,16145
mult $6,$4
mtlo $2
ori $4,$1,7191
multu $3,$3
lui $1,44339
sb $6,15($0)
srav $4,$1,$1
sb $2,3($0)
lui $4,32155
srav $3,$4,$3
lui $4,4020
lui $4,40005
addu $3,$5,$3
mflo $5
div $3,$ra
multu $5,$1
lb $1,16($0)
mthi $0
mult $5,$6
sb $2,13($0)
ori $4,$2,45881
mflo $4
addu $1,$5,$3
mtlo $5
lui $2,47262
srav $4,$3,$3
divu $4,$ra
mfhi $5
div $4,$ra
srav $6,$6,$2
mult $6,$2
ori $2,$2,37401
srav $0,$1,$1
srav $4,$0,$4
srav $4,$1,$1
sll $5,$2,7
mtlo $2
divu $6,$ra
ori $5,$4,35468
sb $0,6($0)
mfhi $6
addu $4,$4,$4
srav $5,$4,$3
multu $4,$1
lui $4,56000
mult $4,$0
addiu $5,$2,-32647
multu $4,$4
sll $5,$1,1
sb $1,15($0)
lb $0,14($0)
sb $3,4($0)
lui $1,58868
mthi $2
div $4,$ra
mult $6,$6
divu $6,$ra
ori $0,$4,3975
mflo $4
addiu $4,$4,-9766
mthi $4
lb $2,13($0)
sb $3,5($0)
mthi $4
sb $4,11($0)
multu $4,$1
sb $1,4($0)
lui $0,51680
divu $5,$ra
mult $4,$2
mthi $4
multu $1,$1
mflo $5
divu $5,$ra
addu $2,$2,$0
ori $1,$4,7716
mfhi $4
div $3,$ra
multu $4,$5
mthi $4
mult $0,$4
mflo $6
lui $3,25831
mflo $4
div $4,$ra
divu $6,$ra
div $4,$ra
multu $4,$4
lb $0,15($0)
ori $5,$5,43585
mtlo $5
mult $4,$2
mthi $5
mtlo $4
mthi $6
multu $2,$2
mthi $0
div $5,$ra
mflo $5
lui $4,51691
mfhi $0
srav $1,$4,$1
mflo $1
mfhi $6
mthi $0
sll $2,$2,29
srav $3,$1,$3
addu $5,$4,$5
addiu $2,$5,28341
multu $6,$1
sll $4,$1,10
sb $4,8($0)
mfhi $2
div $4,$ra
ori $6,$5,21554
divu $5,$ra
sb $5,5($0)
sb $4,14($0)
sb $0,13($0)
sb $0,13($0)
multu $1,$1
mult $2,$2
sll $2,$2,16
mfhi $1
mflo $6
mfhi $6
lui $5,22644
mflo $1
addu $1,$3,$3
divu $5,$ra
mtlo $3
addiu $0,$2,-31271
mtlo $1
divu $5,$ra
mult $1,$1
mthi $4
mfhi $6
lui $4,26137
mtlo $4
addiu $4,$5,6083
div $1,$ra
addu $3,$4,$3
srav $6,$6,$6
mult $6,$0
mfhi $2
sb $4,4($0)
addu $4,$6,$6
mthi $1
div $5,$ra
div $5,$ra
addu $1,$0,$4
addiu $4,$4,-1112
divu $0,$ra
lui $4,13038
addu $1,$1,$3
mult $6,$6
srav $1,$1,$1
divu $4,$ra
sb $5,0($0)
lui $6,62502
lui $2,41056
sll $4,$4,0
multu $1,$5
multu $5,$5
lui $1,35711
mfhi $1
sb $4,5($0)
sb $4,9($0)
mfhi $4
addiu $1,$0,-13386
lb $1,4($0)
sb $2,4($0)
divu $1,$ra
mthi $0
divu $4,$ra
lb $0,12($0)
ori $2,$5,24200
addiu $1,$4,14541
srav $4,$1,$4
mult $6,$6
mult $0,$2
div $6,$ra
srav $5,$5,$5
multu $4,$4
div $5,$ra
sb $4,16($0)
div $1,$ra
mthi $5
lb $4,15($0)
mtlo $4
ori $1,$5,4444
mult $4,$4
srav $4,$4,$4
mult $6,$2
ori $6,$2,50192
addiu $4,$1,-9610
multu $0,$4
mult $2,$2
multu $4,$4
mfhi $0
divu $6,$ra
ori $4,$0,50106
sb $5,11($0)
addiu $2,$2,-22719
div $3,$ra
mflo $6
srav $2,$6,$2
mflo $4
mtlo $0
divu $4,$ra
lb $3,4($0)
ori $2,$2,5888
divu $4,$ra
lb $1,4($0)
ori $6,$5,44274
lb $5,2($0)
multu $5,$2
mthi $2
mflo $1
ori $1,$5,17728
lui $6,24775
mult $3,$3
mtlo $0
mfhi $0
lb $1,14($0)
mflo $4
srav $3,$3,$3
mfhi $1
div $1,$ra
mflo $4
mthi $1
divu $3,$ra
mthi $2
sb $6,8($0)
multu $5,$3
ori $6,$4,13495
mult $5,$5
multu $1,$0
mult $3,$3
divu $6,$ra
mthi $5
|
alloy4fun_models/trashltl/models/10/H5HyYHEiXtpSBbQds.als | Kaixi26/org.alloytools.alloy | 0 | 656 | open main
pred idH5HyYHEiXtpSBbQds_prop11 {
always (Protected' = (File - Protected) + Protected )
}
pred __repair { idH5HyYHEiXtpSBbQds_prop11 }
check __repair { idH5HyYHEiXtpSBbQds_prop11 <=> prop11o } |
tools/scitools/conf/understand/ada/ada95/s-std.ads | brucegua/moocos | 1 | 8996 | -----------------------------------------------------------------------------
-- --
-- GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . S T D --
-- --
-- S p e c --
-- --
-- $Revision: 2 $ --
-- --
-- Copyright (c) 1992,1993,1994 NYU, All Rights Reserved --
-- --
-- The GNAT library is free software; you can redistribute it and/or modify --
-- it under terms of the GNU Library General Public License as published by --
-- the Free Software Foundation; either version 2, or (at your option) any --
-- later version. The GNAT library is distributed in the hope that it will --
-- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty --
-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- Library General Public License for more details. You should have --
-- received a copy of the GNU Library General Public License along with --
-- the GNAT library; see the file COPYING.LIB. If not, write to the Free --
-- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
-- --
------------------------------------------------------------------------------
-- This package contains some standard routines for operating on the
-- temporary (non-fixed-point) version of Duration used to support the
-- tasking routines. To be removed when fixed point is done ???
private package System.Std is
function "*" (D : Duration; I : Integer) return Duration;
function "*" (I : Integer; D : Duration) return Duration;
function "/" (D : Duration; I : Integer) return Duration;
end System.Std;
|
aflex/src/alsys_dos/mainb.ada | irion7/aflex-ayacc-mirror | 1 | 8643 | <filename>aflex/src/alsys_dos/mainb.ada<gh_stars>1-10
-- TITLE main body
-- AUTHOR: <NAME> (UCI)
-- DESCRIPTION driver routines for aflex. Calls drivers for all
-- high level routines from other packages.
-- $Header: /co/ua/self/arcadia/aflex/ada/src/RCS/mainB.a,v 1.23 90/10/15 20:00:28 self Exp Locker: self $
--***************************************************************************
-- This file is subject to the Arcadia License Agreement.
--
-- (see notice in aflex.a)
--
--***************************************************************************
with MISC_DEFS, MISC, COMMAND_LINE_INTERFACE, DFA, ECS, GEN, TEXT_IO, PARSER;
with MAIN_BODY, TSTRING, PARSE_TOKENS, SKELETON_MANAGER, EXTERNAL_FILE_MANAGER;
with EXTERNAL_FILE_MANAGER, INT_IO; use MISC_DEFS, COMMAND_LINE_INTERFACE,
TSTRING, EXTERNAL_FILE_MANAGER;
package body MAIN_BODY is
OUTFILE_CREATED : BOOLEAN := FALSE;
AFLEX_VERSION : STRING(1 .. 4) := "1.4a";
STARTTIME, ENDTIME : VSTRING;
-- aflexend - terminate aflex
--
-- note
-- This routine does not return.
procedure AFLEXEND(STATUS : in INTEGER) is
use TEXT_IO;
TBLSIZ : INTEGER;
begin
TERMINATION_STATUS := STATUS;
-- we'll return this value of the OS.
if (IS_OPEN(SKELFILE)) then
CLOSE(SKELFILE);
end if;
if (IS_OPEN(TEMP_ACTION_FILE)) then
DELETE(TEMP_ACTION_FILE);
end if;
if (IS_OPEN(DEF_FILE)) then
DELETE(DEF_FILE);
end if;
if (BACKTRACK_REPORT) then
if (NUM_BACKTRACKING = 0) then
TEXT_IO.PUT_LINE(BACKTRACK_FILE, "No backtracking.");
else
if (FULLTBL) then
INT_IO.PUT(BACKTRACK_FILE, NUM_BACKTRACKING, 0);
TEXT_IO.PUT_LINE(BACKTRACK_FILE,
" backtracking (non-accepting) states.");
else
TEXT_IO.PUT_LINE(BACKTRACK_FILE, "Compressed tables always backtrack."
);
end if;
end if;
CLOSE(BACKTRACK_FILE);
end if;
if (PRINTSTATS) then
ENDTIME := MISC.AFLEX_GETTIME;
TEXT_IO.PUT_LINE(STANDARD_ERROR, "aflex version " & AFLEX_VERSION &
" usage statistics:");
TSTRING.PUT_LINE(STANDARD_ERROR, " started at " & STARTTIME &
", finished at " & ENDTIME);
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, LASTNFA, 0);
TEXT_IO.PUT(STANDARD_ERROR, '/');
INT_IO.PUT(STANDARD_ERROR, CURRENT_MNS, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " NFA states");
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, LASTDFA, 0);
TEXT_IO.PUT(STANDARD_ERROR, '/');
INT_IO.PUT(STANDARD_ERROR, CURRENT_MAX_DFAS, 0);
TEXT_IO.PUT(STANDARD_ERROR, " DFA states (");
INT_IO.PUT(STANDARD_ERROR, TOTNST, 0);
TEXT_IO.PUT(STANDARD_ERROR, " words)");
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, NUM_RULES - 1, 0);
-- - 1 for def. rule
TEXT_IO.PUT_LINE(STANDARD_ERROR, " rules");
if (NUM_BACKTRACKING = 0) then
TEXT_IO.PUT_LINE(STANDARD_ERROR, " No backtracking");
else
if (FULLTBL) then
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, NUM_BACKTRACKING, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR,
" backtracking (non-accepting) states");
else
TEXT_IO.PUT_LINE(STANDARD_ERROR, " compressed tables always backtrack"
);
end if;
end if;
if (BOL_NEEDED) then
TEXT_IO.PUT_LINE(STANDARD_ERROR, " Beginning-of-line patterns used");
end if;
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, LASTSC, 0);
TEXT_IO.PUT(STANDARD_ERROR, '/');
INT_IO.PUT(STANDARD_ERROR, CURRENT_MAX_SCS, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " start conditions");
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, NUMEPS, 0);
TEXT_IO.PUT(STANDARD_ERROR, " epsilon states, ");
INT_IO.PUT(STANDARD_ERROR, EPS2, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " double epsilon states");
if (LASTCCL = 0) then
TEXT_IO.PUT_LINE(STANDARD_ERROR, " no character classes");
else
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, LASTCCL, 0);
TEXT_IO.PUT(STANDARD_ERROR, '/');
INT_IO.PUT(STANDARD_ERROR, CURRENT_MAXCCLS, 0);
TEXT_IO.PUT(STANDARD_ERROR, " character classes needed ");
INT_IO.PUT(STANDARD_ERROR, CCLMAP(LASTCCL) + CCLLEN(LASTCCL), 0);
TEXT_IO.PUT(STANDARD_ERROR, '/');
INT_IO.PUT(STANDARD_ERROR, CURRENT_MAX_CCL_TBL_SIZE, 0);
TEXT_IO.PUT(STANDARD_ERROR, " words of storage, ");
INT_IO.PUT(STANDARD_ERROR, CCLREUSE, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, "reused");
end if;
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, NUMSNPAIRS, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " state/nextstate pairs created");
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, NUMUNIQ, 0);
TEXT_IO.PUT(STANDARD_ERROR, '/');
INT_IO.PUT(STANDARD_ERROR, NUMDUP, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " unique/duplicate transitions");
if (FULLTBL) then
TBLSIZ := LASTDFA*NUMECS;
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, TBLSIZ, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " table entries");
else
TBLSIZ := 2*(LASTDFA + NUMTEMPS) + 2*TBLEND;
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, LASTDFA + NUMTEMPS, 0);
TEXT_IO.PUT(STANDARD_ERROR, '/');
INT_IO.PUT(STANDARD_ERROR, CURRENT_MAX_DFAS, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " base-def entries created");
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, TBLEND, 0);
TEXT_IO.PUT(STANDARD_ERROR, '/');
INT_IO.PUT(STANDARD_ERROR, CURRENT_MAX_XPAIRS, 0);
TEXT_IO.PUT(STANDARD_ERROR, " (peak ");
INT_IO.PUT(STANDARD_ERROR, PEAKPAIRS, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, ") nxt-chk entries created");
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, NUMTEMPS*NUMMECS, 0);
TEXT_IO.PUT(STANDARD_ERROR, '/');
INT_IO.PUT(STANDARD_ERROR, CURRENT_MAX_TEMPLATE_XPAIRS, 0);
TEXT_IO.PUT(STANDARD_ERROR, " (peak ");
INT_IO.PUT(STANDARD_ERROR, NUMTEMPS*NUMECS, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, ") template nxt-chk entries created");
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, NUMMT, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " empty table entries");
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, NUMPROTS, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " protos created");
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, NUMTEMPS, 0);
TEXT_IO.PUT(STANDARD_ERROR, " templates created, ");
INT_IO.PUT(STANDARD_ERROR, TMPUSES, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, "uses");
end if;
if (USEECS) then
TBLSIZ := TBLSIZ + CSIZE;
TEXT_IO.PUT_LINE(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, NUMECS, 0);
TEXT_IO.PUT(STANDARD_ERROR, '/');
INT_IO.PUT(STANDARD_ERROR, CSIZE, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " equivalence classes created");
end if;
if (USEMECS) then
TBLSIZ := TBLSIZ + NUMECS;
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, NUMMECS, 0);
TEXT_IO.PUT(STANDARD_ERROR, '/');
INT_IO.PUT(STANDARD_ERROR, CSIZE, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " meta-equivalence classes created");
end if;
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, HSHCOL, 0);
TEXT_IO.PUT(STANDARD_ERROR, " (");
INT_IO.PUT(STANDARD_ERROR, HSHSAVE, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " saved) hash collisions, ");
INT_IO.PUT(STANDARD_ERROR, DFAEQL, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " DFAs equal");
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, NUM_REALLOCS, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " sets of reallocations needed");
TEXT_IO.PUT(STANDARD_ERROR, " ");
INT_IO.PUT(STANDARD_ERROR, TBLSIZ, 0);
TEXT_IO.PUT_LINE(STANDARD_ERROR, " total table entries needed");
end if;
if (STATUS /= 0) then
raise AFLEX_TERMINATE;
end if;
end AFLEXEND;
-- aflexinit - initialize aflex
procedure AFLEXINIT is
use TEXT_IO, TSTRING;
SAWCMPFLAG, USE_STDOUT : BOOLEAN;
OUTPUT_FILE : FILE_TYPE;
INPUT_FILE : FILE_TYPE;
I : INTEGER;
ARG_CNT : INTEGER;
FLAG_POS : INTEGER;
ARG : VSTRING;
SKELNAME : VSTRING;
SKELNAME_USED : BOOLEAN := FALSE;
begin
PRINTSTATS := FALSE;
SYNTAXERROR := FALSE;
TRACE := FALSE;
SPPRDFLT := FALSE;
INTERACTIVE := FALSE;
CASEINS := FALSE;
BACKTRACK_REPORT := FALSE;
PERFORMANCE_REPORT := FALSE;
DDEBUG := FALSE;
FULLTBL := FALSE;
CONTINUED_ACTION := FALSE;
GEN_LINE_DIRS := TRUE;
USEMECS := TRUE;
USEECS := TRUE;
SAWCMPFLAG := FALSE;
USE_STDOUT := FALSE;
-- read flags
COMMAND_LINE_INTERFACE.INITIALIZE_COMMAND_LINE;
-- load up argv
EXTERNAL_FILE_MANAGER.INITIALIZE_FILES;
-- do external files setup
-- loop through the list of arguments
ARG_CNT := 1;
while (ARG_CNT <= ARGC - 1) loop
if ((CHAR(ARGV(ARG_CNT), 1) /= '-') or (LEN(ARGV(ARG_CNT)) < 2)) then
exit;
end if;
-- loop through the flags in this argument.
ARG := ARGV(ARG_CNT);
FLAG_POS := 2;
while (FLAG_POS <= LEN(ARG)) loop
case CHAR(ARG, FLAG_POS) is
when 'b' =>
BACKTRACK_REPORT := TRUE;
when 'd' =>
DDEBUG := TRUE;
when 'f' =>
USEECS := FALSE;
USEMECS := FALSE;
FULLTBL := TRUE;
when 'I' =>
INTERACTIVE := TRUE;
when 'i' =>
CASEINS := TRUE;
when 'L' =>
GEN_LINE_DIRS := FALSE;
when 'p' =>
PERFORMANCE_REPORT := TRUE;
when 'S' =>
if (FLAG_POS /= 2) then
MISC.AFLEXERROR("-S flag must be given separately");
end if;
SKELNAME := SLICE(ARG, FLAG_POS + 1, LEN(ARG));
SKELNAME_USED := TRUE;
goto GET_NEXT_ARG;
when 's' =>
SPPRDFLT := TRUE;
when 't' =>
USE_STDOUT := TRUE;
when 'T' =>
TRACE := TRUE;
when 'v' =>
PRINTSTATS := TRUE;
-- UMASS CODES :
-- Added an flag to indicate whether or not the aflex generated
-- codes will be used by Ayacc extension.
when 'E' =>
Ayacc_Extension_Flag := TRUE;
-- END OF UMASS CODES.
when others =>
MISC.AFLEXERROR("unknown flag " & CHAR(ARG, FLAG_POS));
end case;
FLAG_POS := FLAG_POS + 1;
end loop;
<<GET_NEXT_ARG>> ARG_CNT := ARG_CNT + 1;
-- go on to next argument from list.
end loop;
if (FULLTBL and USEMECS) then
MISC.AFLEXERROR("full table and -cm don't make sense together");
end if;
if (FULLTBL and INTERACTIVE) then
MISC.AFLEXERROR("full table and -I are (currently) incompatible");
end if;
if (ARG_CNT < ARGC) then
begin
if (ARG_CNT - ARGC > 1) then
MISC.AFLEXERROR("extraneous argument(s) given");
end if;
-- Tell aflex where to read input from.
INFILENAME := ARGV(ARG_CNT);
OPEN(INPUT_FILE, IN_FILE, STR(ARGV(ARG_CNT)));
SET_INPUT(INPUT_FILE);
exception
when NAME_ERROR =>
MISC.AFLEXFATAL("can't open " & INFILENAME);
end;
end if;
if (not USE_STDOUT) then
EXTERNAL_FILE_MANAGER.GET_SCANNER_FILE(OUTPUT_FILE);
OUTFILE_CREATED := TRUE;
end if;
if (BACKTRACK_REPORT) then
EXTERNAL_FILE_MANAGER.GET_BACKTRACK_FILE(BACKTRACK_FILE);
end if;
LASTCCL := 0;
LASTSC := 0;
--initialize the statistics
STARTTIME := MISC.AFLEX_GETTIME;
begin
-- open the skeleton file
if (SKELNAME_USED) then
OPEN(SKELFILE, IN_FILE, STR(SKELNAME));
SKELETON_MANAGER.SET_EXTERNAL_SKELETON;
end if;
exception
when USE_ERROR | NAME_ERROR =>
MISC.AFLEXFATAL("couldn't open skeleton file " & SKELNAME);
end;
-- without a third argument create make an anonymous temp file.
begin
CREATE(TEMP_ACTION_FILE, OUT_FILE);
CREATE(DEF_FILE, OUT_FILE);
exception
when USE_ERROR | NAME_ERROR =>
MISC.AFLEXFATAL("can't create temporary file");
end;
LASTDFA := 0;
LASTNFA := 0;
NUM_RULES := 0;
NUMAS := 0;
NUMSNPAIRS := 0;
TMPUSES := 0;
NUMECS := 0;
NUMEPS := 0;
EPS2 := 0;
NUM_REALLOCS := 0;
HSHCOL := 0;
DFAEQL := 0;
TOTNST := 0;
NUMUNIQ := 0;
NUMDUP := 0;
HSHSAVE := 0;
EOFSEEN := FALSE;
DATAPOS := 0;
DATALINE := 0;
NUM_BACKTRACKING := 0;
ONESP := 0;
NUMPROTS := 0;
VARIABLE_TRAILING_CONTEXT_RULES := FALSE;
BOL_NEEDED := FALSE;
LINENUM := 1;
SECTNUM := 1;
FIRSTPROT := NIL;
-- used in mkprot() so that the first proto goes in slot 1
-- of the proto queue
LASTPROT := 1;
if (USEECS) then
-- set up doubly-linked equivalence classes
ECGROUP(1) := NIL;
for CNT in 2 .. CSIZE loop
ECGROUP(CNT) := CNT - 1;
NEXTECM(CNT - 1) := CNT;
end loop;
NEXTECM(CSIZE) := NIL;
else
-- put everything in its own equivalence class
for CNT in 1 .. CSIZE loop
ECGROUP(CNT) := CNT;
NEXTECM(CNT) := BAD_SUBSCRIPT; -- to catch errors
end loop;
end if;
SET_UP_INITIAL_ALLOCATIONS;
end AFLEXINIT;
-- readin - read in the rules section of the input file(s)
procedure READIN is
begin
SKELETON_MANAGER.SKELOUT;
TEXT_IO.PUT("with " & TSTRING.STR(MISC.BASENAME) & "_dfa" & "; ");
TEXT_IO.PUT_LINE("use " & TSTRING.STR(MISC.BASENAME) & "_dfa" & "; ");
TEXT_IO.PUT("with " & TSTRING.STR(MISC.BASENAME) & "_io" & "; ");
TEXT_IO.PUT_LINE("use " & TSTRING.STR(MISC.BASENAME) & "_io" & "; ");
MISC.LINE_DIRECTIVE_OUT;
PARSER.YYPARSE;
if (USEECS) then
ECS.CRE8ECS(NEXTECM, ECGROUP, CSIZE, NUMECS);
ECS.CCL2ECL;
else
NUMECS := CSIZE;
end if;
exception
when PARSE_TOKENS.SYNTAX_ERROR =>
MISC.AFLEXERROR("fatal parse error at line " & INTEGER'IMAGE(LINENUM));
MAIN_BODY.AFLEXEND(1);
end READIN;
-- set_up_initial_allocations - allocate memory for internal tables
procedure SET_UP_INITIAL_ALLOCATIONS is
begin
CURRENT_MNS := INITIAL_MNS;
FIRSTST := ALLOCATE_INTEGER_ARRAY(CURRENT_MNS);
LASTST := ALLOCATE_INTEGER_ARRAY(CURRENT_MNS);
FINALST := ALLOCATE_INTEGER_ARRAY(CURRENT_MNS);
TRANSCHAR := ALLOCATE_INTEGER_ARRAY(CURRENT_MNS);
TRANS1 := ALLOCATE_INTEGER_ARRAY(CURRENT_MNS);
TRANS2 := ALLOCATE_INTEGER_ARRAY(CURRENT_MNS);
ACCPTNUM := ALLOCATE_INTEGER_ARRAY(CURRENT_MNS);
ASSOC_RULE := ALLOCATE_INTEGER_ARRAY(CURRENT_MNS);
STATE_TYPE := ALLOCATE_STATE_ENUM_ARRAY(CURRENT_MNS);
CURRENT_MAX_RULES := INITIAL_MAX_RULES;
RULE_TYPE := ALLOCATE_RULE_ENUM_ARRAY(CURRENT_MAX_RULES);
RULE_LINENUM := ALLOCATE_INTEGER_ARRAY(CURRENT_MAX_RULES);
CURRENT_MAX_SCS := INITIAL_MAX_SCS;
SCSET := ALLOCATE_INTEGER_ARRAY(CURRENT_MAX_SCS);
SCBOL := ALLOCATE_INTEGER_ARRAY(CURRENT_MAX_SCS);
SCXCLU := ALLOCATE_BOOLEAN_ARRAY(CURRENT_MAX_SCS);
SCEOF := ALLOCATE_BOOLEAN_ARRAY(CURRENT_MAX_SCS);
SCNAME := ALLOCATE_VSTRING_ARRAY(CURRENT_MAX_SCS);
ACTVSC := ALLOCATE_INTEGER_ARRAY(CURRENT_MAX_SCS);
CURRENT_MAXCCLS := INITIAL_MAX_CCLS;
CCLMAP := ALLOCATE_INTEGER_ARRAY(CURRENT_MAXCCLS);
CCLLEN := ALLOCATE_INTEGER_ARRAY(CURRENT_MAXCCLS);
CCLNG := ALLOCATE_INTEGER_ARRAY(CURRENT_MAXCCLS);
CURRENT_MAX_CCL_TBL_SIZE := INITIAL_MAX_CCL_TBL_SIZE;
CCLTBL := ALLOCATE_CHARACTER_ARRAY(CURRENT_MAX_CCL_TBL_SIZE);
CURRENT_MAX_DFA_SIZE := INITIAL_MAX_DFA_SIZE;
CURRENT_MAX_XPAIRS := INITIAL_MAX_XPAIRS;
NXT := ALLOCATE_INTEGER_ARRAY(CURRENT_MAX_XPAIRS);
CHK := ALLOCATE_INTEGER_ARRAY(CURRENT_MAX_XPAIRS);
CURRENT_MAX_TEMPLATE_XPAIRS := INITIAL_MAX_TEMPLATE_XPAIRS;
TNXT := ALLOCATE_INTEGER_ARRAY(CURRENT_MAX_TEMPLATE_XPAIRS);
CURRENT_MAX_DFAS := INITIAL_MAX_DFAS;
BASE := ALLOCATE_INTEGER_ARRAY(CURRENT_MAX_DFAS);
DEF := ALLOCATE_INTEGER_ARRAY(CURRENT_MAX_DFAS);
DFASIZ := ALLOCATE_INTEGER_ARRAY(CURRENT_MAX_DFAS);
ACCSIZ := ALLOCATE_INTEGER_ARRAY(CURRENT_MAX_DFAS);
DHASH := ALLOCATE_INTEGER_ARRAY(CURRENT_MAX_DFAS);
DSS := ALLOCATE_INT_PTR_ARRAY(CURRENT_MAX_DFAS);
DFAACC := ALLOCATE_DFAACC_UNION(CURRENT_MAX_DFAS);
end SET_UP_INITIAL_ALLOCATIONS;
end MAIN_BODY;
|
Definition/Typed.agda | fhlkfy/logrel-mltt | 0 | 15723 | <reponame>fhlkfy/logrel-mltt<filename>Definition/Typed.agda
{-# OPTIONS --without-K --safe #-}
module Definition.Typed where
open import Definition.Untyped hiding (_∷_)
open import Tools.Fin
open import Tools.Nat
open import Tools.Product
infixl 30 _∙_
infix 30 Πⱼ_▹_
infix 30 Σⱼ_▹_
infix 30 ⟦_⟧ⱼ_▹_
private
variable
n m : Nat
Γ : Con Term n
A B F : Term n
G : Term (1+ n)
x : Fin n
-- Well-typed variables
data _∷_∈_ : (x : Fin n) (A : Term n) (Γ : Con Term n) → Set where
here : x0 ∷ wk1 A ∈ (Γ ∙ A)
there : (h : x ∷ A ∈ Γ) → (x +1) ∷ wk1 A ∈ (Γ ∙ B)
mutual
-- Well-formed context
data ⊢_ : Con Term n → Set where
ε : ⊢ ε
_∙_ : ⊢ Γ
→ Γ ⊢ A
→ ⊢ Γ ∙ A
-- Well-formed type
data _⊢_ (Γ : Con Term n) : Term n → Set where
Uⱼ : ⊢ Γ → Γ ⊢ U
ℕⱼ : ⊢ Γ → Γ ⊢ ℕ
Emptyⱼ : ⊢ Γ → Γ ⊢ Empty
Unitⱼ : ⊢ Γ → Γ ⊢ Unit
Πⱼ_▹_ : Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ Π F ▹ G
Σⱼ_▹_ : Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ Σ F ▹ G
univ : Γ ⊢ A ∷ U
→ Γ ⊢ A
-- Well-formed term of a type
data _⊢_∷_ (Γ : Con Term n) : Term n → Term n → Set where
Πⱼ_▹_ : ∀ {F G}
→ Γ ⊢ F ∷ U
→ Γ ∙ F ⊢ G ∷ U
→ Γ ⊢ Π F ▹ G ∷ U
Σⱼ_▹_ : ∀ {F G}
→ Γ ⊢ F ∷ U
→ Γ ∙ F ⊢ G ∷ U
→ Γ ⊢ Σ F ▹ G ∷ U
ℕⱼ : ⊢ Γ → Γ ⊢ ℕ ∷ U
Emptyⱼ : ⊢ Γ → Γ ⊢ Empty ∷ U
Unitⱼ : ⊢ Γ → Γ ⊢ Unit ∷ U
var : ∀ {A x}
→ ⊢ Γ
→ x ∷ A ∈ Γ
→ Γ ⊢ var x ∷ A
lamⱼ : ∀ {F G t}
→ Γ ⊢ F
→ Γ ∙ F ⊢ t ∷ G
→ Γ ⊢ lam t ∷ Π F ▹ G
_∘ⱼ_ : ∀ {g a F G}
→ Γ ⊢ g ∷ Π F ▹ G
→ Γ ⊢ a ∷ F
→ Γ ⊢ g ∘ a ∷ G [ a ]
prodⱼ : ∀ {F G t u}
→ Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ t ∷ F
→ Γ ⊢ u ∷ G [ t ]
→ Γ ⊢ prod t u ∷ Σ F ▹ G
fstⱼ : ∀ {F G t}
→ Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ t ∷ Σ F ▹ G
→ Γ ⊢ fst t ∷ F
sndⱼ : ∀ {F G t}
→ Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ t ∷ Σ F ▹ G
→ Γ ⊢ snd t ∷ G [ fst t ]
zeroⱼ : ⊢ Γ
→ Γ ⊢ zero ∷ ℕ
sucⱼ : ∀ {n}
→ Γ ⊢ n ∷ ℕ
→ Γ ⊢ suc n ∷ ℕ
natrecⱼ : ∀ {G s z n}
→ Γ ∙ ℕ ⊢ G
→ Γ ⊢ z ∷ G [ zero ]
→ Γ ⊢ s ∷ Π ℕ ▹ (G ▹▹ G [ suc (var x0) ]↑)
→ Γ ⊢ n ∷ ℕ
→ Γ ⊢ natrec G z s n ∷ G [ n ]
Emptyrecⱼ : ∀ {A e}
→ Γ ⊢ A → Γ ⊢ e ∷ Empty → Γ ⊢ Emptyrec A e ∷ A
starⱼ : ⊢ Γ → Γ ⊢ star ∷ Unit
conv : ∀ {t A B}
→ Γ ⊢ t ∷ A
→ Γ ⊢ A ≡ B
→ Γ ⊢ t ∷ B
-- Type equality
data _⊢_≡_ (Γ : Con Term n) : Term n → Term n → Set where
univ : ∀ {A B}
→ Γ ⊢ A ≡ B ∷ U
→ Γ ⊢ A ≡ B
refl : ∀ {A}
→ Γ ⊢ A
→ Γ ⊢ A ≡ A
sym : ∀ {A B}
→ Γ ⊢ A ≡ B
→ Γ ⊢ B ≡ A
trans : ∀ {A B C}
→ Γ ⊢ A ≡ B
→ Γ ⊢ B ≡ C
→ Γ ⊢ A ≡ C
Π-cong : ∀ {F H G E}
→ Γ ⊢ F
→ Γ ⊢ F ≡ H
→ Γ ∙ F ⊢ G ≡ E
→ Γ ⊢ Π F ▹ G ≡ Π H ▹ E
Σ-cong : ∀ {F H G E}
→ Γ ⊢ F
→ Γ ⊢ F ≡ H
→ Γ ∙ F ⊢ G ≡ E
→ Γ ⊢ Σ F ▹ G ≡ Σ H ▹ E
-- Term equality
data _⊢_≡_∷_ (Γ : Con Term n) : Term n → Term n → Term n → Set where
refl : ∀ {t A}
→ Γ ⊢ t ∷ A
→ Γ ⊢ t ≡ t ∷ A
sym : ∀ {t u A}
→ Γ ⊢ t ≡ u ∷ A
→ Γ ⊢ u ≡ t ∷ A
trans : ∀ {t u r A}
→ Γ ⊢ t ≡ u ∷ A
→ Γ ⊢ u ≡ r ∷ A
→ Γ ⊢ t ≡ r ∷ A
conv : ∀ {A B t u}
→ Γ ⊢ t ≡ u ∷ A
→ Γ ⊢ A ≡ B
→ Γ ⊢ t ≡ u ∷ B
Π-cong : ∀ {E F G H}
→ Γ ⊢ F
→ Γ ⊢ F ≡ H ∷ U
→ Γ ∙ F ⊢ G ≡ E ∷ U
→ Γ ⊢ Π F ▹ G ≡ Π H ▹ E ∷ U
Σ-cong : ∀ {E F G H}
→ Γ ⊢ F
→ Γ ⊢ F ≡ H ∷ U
→ Γ ∙ F ⊢ G ≡ E ∷ U
→ Γ ⊢ Σ F ▹ G ≡ Σ H ▹ E ∷ U
app-cong : ∀ {a b f g F G}
→ Γ ⊢ f ≡ g ∷ Π F ▹ G
→ Γ ⊢ a ≡ b ∷ F
→ Γ ⊢ f ∘ a ≡ g ∘ b ∷ G [ a ]
β-red : ∀ {a t F G}
→ Γ ⊢ F
→ Γ ∙ F ⊢ t ∷ G
→ Γ ⊢ a ∷ F
→ Γ ⊢ (lam t) ∘ a ≡ t [ a ] ∷ G [ a ]
η-eq : ∀ {f g F G}
→ Γ ⊢ F
→ Γ ⊢ f ∷ Π F ▹ G
→ Γ ⊢ g ∷ Π F ▹ G
→ Γ ∙ F ⊢ wk1 f ∘ var x0 ≡ wk1 g ∘ var x0 ∷ G
→ Γ ⊢ f ≡ g ∷ Π F ▹ G
fst-cong : ∀ {t t' F G}
→ Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ t ≡ t' ∷ Σ F ▹ G
→ Γ ⊢ fst t ≡ fst t' ∷ F
snd-cong : ∀ {t t' F G}
→ Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ t ≡ t' ∷ Σ F ▹ G
→ Γ ⊢ snd t ≡ snd t' ∷ G [ fst t ]
Σ-β₁ : ∀ {F G t u}
→ Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ t ∷ F
→ Γ ⊢ u ∷ G [ t ]
→ Γ ⊢ fst (prod t u) ≡ t ∷ F
Σ-β₂ : ∀ {F G t u}
→ Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ t ∷ F
→ Γ ⊢ u ∷ G [ t ]
→ Γ ⊢ snd (prod t u) ≡ u ∷ G [ fst (prod t u) ]
Σ-η : ∀ {p r F G}
→ Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ p ∷ Σ F ▹ G
→ Γ ⊢ r ∷ Σ F ▹ G
→ Γ ⊢ fst p ≡ fst r ∷ F
→ Γ ⊢ snd p ≡ snd r ∷ G [ fst p ]
→ Γ ⊢ p ≡ r ∷ Σ F ▹ G
suc-cong : ∀ {m n}
→ Γ ⊢ m ≡ n ∷ ℕ
→ Γ ⊢ suc m ≡ suc n ∷ ℕ
natrec-cong : ∀ {z z′ s s′ n n′ F F′}
→ Γ ∙ ℕ ⊢ F ≡ F′
→ Γ ⊢ z ≡ z′ ∷ F [ zero ]
→ Γ ⊢ s ≡ s′ ∷ Π ℕ ▹ (F ▹▹ F [ suc (var x0) ]↑)
→ Γ ⊢ n ≡ n′ ∷ ℕ
→ Γ ⊢ natrec F z s n ≡ natrec F′ z′ s′ n′ ∷ F [ n ]
natrec-zero : ∀ {z s F}
→ Γ ∙ ℕ ⊢ F
→ Γ ⊢ z ∷ F [ zero ]
→ Γ ⊢ s ∷ Π ℕ ▹ (F ▹▹ F [ suc (var x0) ]↑)
→ Γ ⊢ natrec F z s zero ≡ z ∷ F [ zero ]
natrec-suc : ∀ {n z s F}
→ Γ ⊢ n ∷ ℕ
→ Γ ∙ ℕ ⊢ F
→ Γ ⊢ z ∷ F [ zero ]
→ Γ ⊢ s ∷ Π ℕ ▹ (F ▹▹ F [ suc (var x0) ]↑)
→ Γ ⊢ natrec F z s (suc n) ≡ (s ∘ n) ∘ (natrec F z s n)
∷ F [ suc n ]
Emptyrec-cong : ∀ {A A' e e'}
→ Γ ⊢ A ≡ A'
→ Γ ⊢ e ≡ e' ∷ Empty
→ Γ ⊢ Emptyrec A e ≡ Emptyrec A' e' ∷ A
η-unit : ∀ {e e'}
→ Γ ⊢ e ∷ Unit
→ Γ ⊢ e' ∷ Unit
→ Γ ⊢ e ≡ e' ∷ Unit
-- Term reduction
data _⊢_⇒_∷_ (Γ : Con Term n) : Term n → Term n → Term n → Set where
conv : ∀ {A B t u}
→ Γ ⊢ t ⇒ u ∷ A
→ Γ ⊢ A ≡ B
→ Γ ⊢ t ⇒ u ∷ B
app-subst : ∀ {A B t u a}
→ Γ ⊢ t ⇒ u ∷ Π A ▹ B
→ Γ ⊢ a ∷ A
→ Γ ⊢ t ∘ a ⇒ u ∘ a ∷ B [ a ]
β-red : ∀ {A B a t}
→ Γ ⊢ A
→ Γ ∙ A ⊢ t ∷ B
→ Γ ⊢ a ∷ A
→ Γ ⊢ (lam t) ∘ a ⇒ t [ a ] ∷ B [ a ]
fst-subst : ∀ {t t' F G}
→ Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ t ⇒ t' ∷ Σ F ▹ G
→ Γ ⊢ fst t ⇒ fst t' ∷ F
snd-subst : ∀ {t t' F G}
→ Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ t ⇒ t' ∷ Σ F ▹ G
→ Γ ⊢ snd t ⇒ snd t' ∷ G [ fst t ]
Σ-β₁ : ∀ {F G t u}
→ Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ t ∷ F
→ Γ ⊢ u ∷ G [ t ]
→ Γ ⊢ fst (prod t u) ⇒ t ∷ F
Σ-β₂ : ∀ {F G t u}
→ Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ t ∷ F
→ Γ ⊢ u ∷ G [ t ]
-- TODO(WN): Prove that 𝔍 ∷ G [ t ] is admissible
→ Γ ⊢ snd (prod t u) ⇒ u ∷ G [ fst (prod t u) ]
natrec-subst : ∀ {z s n n′ F}
→ Γ ∙ ℕ ⊢ F
→ Γ ⊢ z ∷ F [ zero ]
→ Γ ⊢ s ∷ Π ℕ ▹ (F ▹▹ F [ suc (var x0) ]↑)
→ Γ ⊢ n ⇒ n′ ∷ ℕ
→ Γ ⊢ natrec F z s n ⇒ natrec F z s n′ ∷ F [ n ]
natrec-zero : ∀ {z s F}
→ Γ ∙ ℕ ⊢ F
→ Γ ⊢ z ∷ F [ zero ]
→ Γ ⊢ s ∷ Π ℕ ▹ (F ▹▹ F [ suc (var x0) ]↑)
→ Γ ⊢ natrec F z s zero ⇒ z ∷ F [ zero ]
natrec-suc : ∀ {n z s F}
→ Γ ⊢ n ∷ ℕ
→ Γ ∙ ℕ ⊢ F
→ Γ ⊢ z ∷ F [ zero ]
→ Γ ⊢ s ∷ Π ℕ ▹ (F ▹▹ F [ suc (var x0) ]↑)
→ Γ ⊢ natrec F z s (suc n) ⇒ (s ∘ n) ∘ (natrec F z s n) ∷ F [ suc n ]
Emptyrec-subst : ∀ {n n′ A}
→ Γ ⊢ A
→ Γ ⊢ n ⇒ n′ ∷ Empty
→ Γ ⊢ Emptyrec A n ⇒ Emptyrec A n′ ∷ A
-- Type reduction
data _⊢_⇒_ (Γ : Con Term n) : Term n → Term n → Set where
univ : ∀ {A B}
→ Γ ⊢ A ⇒ B ∷ U
→ Γ ⊢ A ⇒ B
-- Term reduction closure
data _⊢_⇒*_∷_ (Γ : Con Term n) : Term n → Term n → Term n → Set where
id : ∀ {A t}
→ Γ ⊢ t ∷ A
→ Γ ⊢ t ⇒* t ∷ A
_⇨_ : ∀ {A t t′ u}
→ Γ ⊢ t ⇒ t′ ∷ A
→ Γ ⊢ t′ ⇒* u ∷ A
→ Γ ⊢ t ⇒* u ∷ A
-- Type reduction closure
data _⊢_⇒*_ (Γ : Con Term n) : Term n → Term n → Set where
id : ∀ {A}
→ Γ ⊢ A
→ Γ ⊢ A ⇒* A
_⇨_ : ∀ {A A′ B}
→ Γ ⊢ A ⇒ A′
→ Γ ⊢ A′ ⇒* B
→ Γ ⊢ A ⇒* B
-- Type reduction to whnf
_⊢_↘_ : (Γ : Con Term n) → Term n → Term n → Set
Γ ⊢ A ↘ B = Γ ⊢ A ⇒* B × Whnf B
-- Term reduction to whnf
_⊢_↘_∷_ : (Γ : Con Term n) → Term n → Term n → Term n → Set
Γ ⊢ t ↘ u ∷ A = Γ ⊢ t ⇒* u ∷ A × Whnf u
-- Type eqaulity with well-formed types
_⊢_:≡:_ : (Γ : Con Term n) → Term n → Term n → Set
Γ ⊢ A :≡: B = Γ ⊢ A × Γ ⊢ B × (Γ ⊢ A ≡ B)
-- Term equality with well-formed terms
_⊢_:≡:_∷_ : (Γ : Con Term n) → Term n → Term n → Term n → Set
Γ ⊢ t :≡: u ∷ A = (Γ ⊢ t ∷ A) × (Γ ⊢ u ∷ A) × (Γ ⊢ t ≡ u ∷ A)
-- Type reduction closure with well-formed types
record _⊢_:⇒*:_ (Γ : Con Term n) (A B : Term n) : Set where
constructor [_,_,_]
field
⊢A : Γ ⊢ A
⊢B : Γ ⊢ B
D : Γ ⊢ A ⇒* B
open _⊢_:⇒*:_ using () renaming (D to red; ⊢A to ⊢A-red; ⊢B to ⊢B-red) public
-- Term reduction closure with well-formed terms
record _⊢_:⇒*:_∷_ (Γ : Con Term n) (t u A : Term n) : Set where
constructor [_,_,_]
field
⊢t : Γ ⊢ t ∷ A
⊢u : Γ ⊢ u ∷ A
d : Γ ⊢ t ⇒* u ∷ A
open _⊢_:⇒*:_∷_ using () renaming (d to redₜ; ⊢t to ⊢t-redₜ; ⊢u to ⊢u-redₜ) public
-- Well-formed substitutions.
data _⊢ˢ_∷_ (Δ : Con Term m) : (σ : Subst m n) (Γ : Con Term n) → Set where
id : ∀ {σ} → Δ ⊢ˢ σ ∷ ε
_,_ : ∀ {A σ}
→ Δ ⊢ˢ tail σ ∷ Γ
→ Δ ⊢ head σ ∷ subst (tail σ) A
→ Δ ⊢ˢ σ ∷ Γ ∙ A
-- Conversion of well-formed substitutions.
data _⊢ˢ_≡_∷_ (Δ : Con Term m) : (σ σ′ : Subst m n) (Γ : Con Term n) → Set where
id : ∀ {σ σ′} → Δ ⊢ˢ σ ≡ σ′ ∷ ε
_,_ : ∀ {A σ σ′}
→ Δ ⊢ˢ tail σ ≡ tail σ′ ∷ Γ
→ Δ ⊢ head σ ≡ head σ′ ∷ subst (tail σ) A
→ Δ ⊢ˢ σ ≡ σ′ ∷ Γ ∙ A
-- Note that we cannot use the well-formed substitutions.
-- For that, we need to prove the fundamental theorem for substitutions.
⟦_⟧ⱼ_▹_ : (W : BindingType) → ∀ {F G}
→ Γ ⊢ F
→ Γ ∙ F ⊢ G
→ Γ ⊢ ⟦ W ⟧ F ▹ G
⟦ BΠ ⟧ⱼ ⊢F ▹ ⊢G = Πⱼ ⊢F ▹ ⊢G
⟦ BΣ ⟧ⱼ ⊢F ▹ ⊢G = Σⱼ ⊢F ▹ ⊢G
⟦_⟧ⱼᵤ_▹_ : (W : BindingType) → ∀ {F G}
→ Γ ⊢ F ∷ U
→ Γ ∙ F ⊢ G ∷ U
→ Γ ⊢ ⟦ W ⟧ F ▹ G ∷ U
⟦ BΠ ⟧ⱼᵤ ⊢F ▹ ⊢G = Πⱼ ⊢F ▹ ⊢G
⟦ BΣ ⟧ⱼᵤ ⊢F ▹ ⊢G = Σⱼ ⊢F ▹ ⊢G
|
oeis/078/A078916.asm | neoneye/loda-programs | 11 | 98093 | ; A078916: a(n) = prime(n) + 2*n.
; Submitted by <NAME>(s3)
; 4,7,11,15,21,25,31,35,41,49,53,61,67,71,77,85,93,97,105,111,115,123,129,137,147,153,157,163,167,173,189,195,203,207,219,223,231,239,245,253,261,265,277,281,287,291,305,319,325,329,335,343,347,359,367,375
mul $0,2
mov $2,$0
max $0,1
seq $0,173919 ; Numbers that are prime or one less than a prime.
add $0,3
add $2,$0
mov $0,$2
sub $0,1
|
src/lithium-legacy_filters.adb | faelys/lithium3 | 1 | 25635 | ------------------------------------------------------------------------------
-- Copyright (c) 2015, <NAME> --
-- --
-- Permission to use, copy, modify, and 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. --
------------------------------------------------------------------------------
package body Lithium.Legacy_Filters is
Open_Paragraph : constant Ada.Streams.Stream_Element_Array
:= (1 => Character'Pos ('<'),
2 => Character'Pos ('p'),
3 => Character'Pos ('>'));
Close_Paragraph : constant Ada.Streams.Stream_Element_Array
:= (1 => Character'Pos ('<'),
2 => Character'Pos ('/'),
3 => Character'Pos ('p'),
4 => Character'Pos ('>'),
5 => 10);
Open_Emphasis : constant Ada.Streams.Stream_Element_Array
:= (1 => Character'Pos ('<'),
2 => Character'Pos ('s'),
3 => Character'Pos ('t'),
4 => Character'Pos ('r'),
5 => Character'Pos ('o'),
6 => Character'Pos ('n'),
7 => Character'Pos ('g'),
8 => Character'Pos ('>'));
Close_Emphasis : constant Ada.Streams.Stream_Element_Array
:= (1 => Character'Pos ('<'),
2 => Character'Pos ('/'),
3 => Character'Pos ('s'),
4 => Character'Pos ('t'),
5 => Character'Pos ('r'),
6 => Character'Pos ('o'),
7 => Character'Pos ('n'),
8 => Character'Pos ('g'),
9 => Character'Pos ('>'));
Open_Anchor : constant Ada.Streams.Stream_Element_Array
:= (1 => Character'Pos ('['),
2 => Character'Pos ('<'),
3 => Character'Pos ('a'),
4 => Character'Pos (' '),
5 => Character'Pos ('h'),
6 => Character'Pos ('r'),
7 => Character'Pos ('e'),
8 => Character'Pos ('f'),
9 => Character'Pos ('='),
10 => Character'Pos ('"'));
Close_Link : constant Ada.Streams.Stream_Element_Array
:= (1 => Character'Pos ('"'),
2 => Character'Pos ('>'));
Close_Anchor : constant Ada.Streams.Stream_Element_Array
:= (1 => Character'Pos ('<'),
2 => Character'Pos ('/'),
3 => Character'Pos ('a'),
4 => Character'Pos ('>'),
5 => Character'Pos (']'));
Line_Break : constant Ada.Streams.Stream_Element_Array
:= (1 => Character'Pos ('<'),
2 => Character'Pos ('b'),
3 => Character'Pos ('r'),
4 => Character'Pos ('>'),
5 => 10);
Greater_Than : constant Ada.Streams.Stream_Element_Array
:= (1 => Character'Pos ('&'),
2 => Character'Pos ('g'),
3 => Character'Pos ('t'),
4 => Character'Pos (';'));
Less_Than : constant Ada.Streams.Stream_Element_Array
:= (1 => Character'Pos ('&'),
2 => Character'Pos ('l'),
3 => Character'Pos ('t'),
4 => Character'Pos (';'));
Quote : constant Ada.Streams.Stream_Element_Array
:= (1 => Character'Pos ('&'),
2 => Character'Pos ('q'),
3 => Character'Pos ('u'),
4 => Character'Pos ('o'),
5 => Character'Pos ('t'),
6 => Character'Pos (';'));
function Is_Space (Octet : Ada.Streams.Stream_Element) return Boolean
is (Octet in 9 | 10 | 13 | 32);
function Is_URI_Char (Octet : Ada.Streams.Stream_Element) return Boolean
is (Octet in Character'Pos ('a') .. Character'Pos ('z')
| Character'Pos ('A') .. Character'Pos ('Z')
| Character'Pos ('0') .. Character'Pos ('9')
| Character'Pos ('-') | Character'Pos ('_')
| Character'Pos ('.') | Character'Pos ('~')
| Character'Pos ('!') | Character'Pos ('*') | Character'Pos (''')
| Character'Pos ('(') | Character'Pos (')') | Character'Pos (';')
| Character'Pos (':') | Character'Pos ('@') | Character'Pos ('&')
| Character'Pos ('=') | Character'Pos ('+') | Character'Pos ('$')
| Character'Pos (',') | Character'Pos ('/') | Character'Pos ('?')
| Character'Pos ('%') | Character'Pos ('#') | Character'Pos ('[')
| Character'Pos (']'));
function Has_Allowed_URI_Prefix
(Fragment : in Ada.Streams.Stream_Element_Array)
return Boolean;
-- Return whether Fragment starts with an allowed URI prefix (scheme)
procedure Check_URI
(Data : in Ada.Streams.Stream_Element_Array;
Found : out Boolean;
Last : out Ada.Streams.Stream_Element_Offset);
-- Return whether Data starts with a valid URI followed by ']'
-- and what is the position of the clsoing mark.
------------------------------
-- Local Helper Subprograms --
------------------------------
function Has_Allowed_URI_Prefix
(Fragment : in Ada.Streams.Stream_Element_Array)
return Boolean
is
use type Ada.Streams.Stream_Element;
use type Ada.Streams.Stream_Element_Offset;
begin
return
(Fragment'Length > 2
and then Fragment (Fragment'First) = Character'Pos ('/')
and then Fragment (Fragment'First + 1) = Character'Pos ('/'))
or else
(Fragment'Length > 8
and then Fragment (Fragment'First)
in Character'Pos ('h') | Character'Pos ('H')
and then Fragment (Fragment'First + 1)
in Character'Pos ('t') | Character'Pos ('T')
and then Fragment (Fragment'First + 2)
in Character'Pos ('t') | Character'Pos ('T')
and then Fragment (Fragment'First + 3)
in Character'Pos ('p') | Character'Pos ('P')
and then ((Fragment (Fragment'First + 4) = Character'Pos (':')
and then Fragment (Fragment'First + 5) = Character'Pos ('/')
and then Fragment (Fragment'First + 6) = Character'Pos ('/'))
or else (Fragment (Fragment'First + 4)
in Character'Pos ('s') | Character'Pos ('S')
and then Fragment (Fragment'First + 5) = Character'Pos (':')
and then Fragment (Fragment'First + 6) = Character'Pos ('/')
and then Fragment (Fragment'First + 7)
= Character'Pos ('/'))));
end Has_Allowed_URI_Prefix;
procedure Check_URI
(Data : in Ada.Streams.Stream_Element_Array;
Found : out Boolean;
Last : out Ada.Streams.Stream_Element_Offset)
is
use type Ada.Streams.Stream_Element;
begin
Found := False;
if not Has_Allowed_URI_Prefix (Data) then
return;
end if;
for I in Data'Range loop
exit when Data (I) = Character'Pos (']');
Last := I;
if not Is_URI_Char (Data (I)) then
return;
end if;
end loop;
Found := True;
end Check_URI;
----------------------
-- Public Interface --
----------------------
overriding procedure Apply
(Object : in Filter;
Output : in out Ada.Streams.Root_Stream_Type'Class;
Data : in Ada.Streams.Stream_Element_Array)
is
pragma Unreferenced (Object);
use type Ada.Streams.Stream_Element_Offset;
procedure Catch_Up (To : in Ada.Streams.Stream_Element_Offset);
First : Ada.Streams.Stream_Element_Offset := Data'First;
Last : Ada.Streams.Stream_Element_Offset := Data'Last;
Next : Ada.Streams.Stream_Element_Offset;
procedure Catch_Up (To : in Ada.Streams.Stream_Element_Offset) is
begin
if Next < To then
Output.Write (Data (Next .. To - 1));
end if;
Next := To + 1;
end Catch_Up;
End_Of_Line : Boolean := False;
In_Paragraph : Boolean := True;
In_Emphasis : Boolean := False;
In_Link : Boolean := False;
begin
Trim_Beginning :
while First in Data'Range and then Data (First) in 9 | 10 | 13 | 32 loop
First := First + 1;
end loop Trim_Beginning;
Trim_End :
while Last in Data'Range and then Data (Last) in 9 | 10 | 13 | 32 loop
Last := Last - 1;
end loop Trim_End;
Next := First;
Output.Write (Open_Paragraph);
for I in First .. Last loop
case Data (I) is
when 13 => -- CR
null;
when 10 => -- LF
if End_Of_Line then
In_Paragraph := False;
End_Of_Line := False;
else
End_Of_Line := True;
end if;
when others =>
if End_Of_Line then
Output.Write (Line_Break);
End_Of_Line := False;
end if;
if not In_Paragraph then
if In_Emphasis then
Output.Write (Close_Emphasis);
In_Emphasis := False;
end if;
Output.Write (Close_Paragraph);
Output.Write (Open_Paragraph);
In_Paragraph := True;
end if;
end case;
case Data (I) is
when 10 | 13 =>
Catch_Up (I);
when Character'Pos ('"') =>
Catch_Up (I);
Output.Write (Quote);
when Character'Pos ('<') =>
Catch_Up (I);
Output.Write (Less_Than);
when Character'Pos ('>') =>
Catch_Up (I);
Output.Write (Greater_Than);
when Character'Pos ('*') =>
if In_Emphasis then
Catch_Up (I);
Output.Write (Close_Emphasis);
In_Emphasis := False;
elsif (I = Data'First or else Is_Space (Data (I - 1)))
and then I < Data'Last
and then not Is_Space (Data (I + 1))
then
Catch_Up (I);
Output.Write (Open_Emphasis);
In_Emphasis := True;
end if;
when Character'Pos ('[') =>
declare
Found : Boolean;
Last : Ada.Streams.Stream_Element_Offset;
begin
Check_URI (Data (I + 1 .. Data'Last), Found, Last);
if Found then
Catch_Up (I);
Output.Write (Open_Anchor);
Output.Write (Data (I + 1 .. Last));
Output.Write (Close_Link);
In_Link := True;
end if;
end;
when Character'Pos (']') =>
if In_Link then
Catch_Up (I);
Output.Write (Close_Anchor);
In_Link := False;
end if;
when others => null;
end case;
end loop;
Catch_Up (Last + 1);
if In_Emphasis then
Output.Write (Close_Emphasis);
end if;
if In_Paragraph then
Output.Write (Close_Paragraph);
end if;
end Apply;
function Create
(Arguments : in out Natools.S_Expressions.Lockable.Descriptor'Class)
return Natools.Web.Filters.Filter'Class
is
pragma Unreferenced (Arguments);
begin
return Filter'(null record);
end Create;
end Lithium.Legacy_Filters;
|
programs/oeis/083/A083662.asm | neoneye/loda | 22 | 94350 | <reponame>neoneye/loda<gh_stars>10-100
; A083662: a(n) = a(floor(n/2)) + a(floor(n/4)), n > 0; a(0)=1.
; 1,2,3,3,5,5,5,5,8,8,8,8,8,8,8,8,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34
lpb $0
div $0,2
mov $2,$3
add $2,1
mov $3,$1
add $1,$2
lpe
add $1,1
mov $0,$1
|
src/main/fragment/mos6502-common/vbuaa_eq_vbuc1_then_la1.asm | jbrandwood/kickc | 2 | 25217 | cmp #{c1}
beq {la1}
|
oeis/118/A118971.asm | neoneye/loda-programs | 11 | 805 | ; A118971: a(n) = 4*binomial(5*n+3,n)/(4*n+4).
; Submitted by <NAME>
; 1,4,26,204,1771,16380,158224,1577532,16112057,167710664,1772645420,18974357220,205263418941,2240623268512,24648785802336,272994644359580,3041495503591365,34064252968167180,383302465665133014,4331178750737856024,49126274119207062470,559128033689628934440,6383597250894765439440,73090435990898559198420,839063493796646402941371,9655586120310799264706880,111360847319535483080993120,1287021218005005245321456480,14903040493674217443817664120,172879384378494319632033484480
mov $1,$0
mov $2,1
add $2,$0
add $0,$2
mul $0,2
add $0,$2
bin $0,$1
div $0,$2
|
testsuite/tests/disk_partitions/src/tc_read_partitions.adb | rocher/Ada_Drivers_Library | 192 | 26481 | with Ada.Text_IO; use Ada.Text_IO;
with Partitions; use Partitions;
with File_Block_Drivers; use File_Block_Drivers;
with Test_Directories; use Test_Directories;
with File_IO;
procedure TC_Read_Partitions is
use type File_IO.Status_Code;
procedure List_Partitions (Path_To_Disk_Image : String);
---------------------
-- List_Partitions --
---------------------
procedure List_Partitions (Path_To_Disk_Image : String)
is
Disk : aliased File_Block_Driver;
Nbr : Natural;
P_Entry : Partition_Entry;
Status : File_IO.Status_Code;
begin
Status := Disk.Open (Path_To_Disk_Image, File_IO.Read_Only);
if Status /= File_IO.OK then
Put_Line ("Cannot open disk image '" & Path_To_Disk_Image & "'");
return;
end if;
Nbr := Number_Of_Partitions (Disk'Unchecked_Access);
Put_Line ("Disk '" & Path_To_Disk_Image & "' has " &
Nbr'Img & " parition(s)");
for Id in 1 .. Nbr loop
if Get_Partition_Entry (Disk'Unchecked_Access,
Id,
P_Entry) /= Status_Ok
then
Put_Line ("Cannot read partition :" & Id'Img);
else
Put_Line (" - partition :" & Id'Img);
Put_Line (" Status:" & P_Entry.Status'Img);
Put_Line (" Kind: " & P_Entry.Kind'Img);
Put_Line (" LBA: " & P_Entry.First_Sector_LBA'Img);
Put_Line (" Number of sectors: " & P_Entry.Number_Of_Sectors'Img);
end if;
end loop;
end List_Partitions;
begin
Mount_Test_Directory;
List_Partitions ("/" & Test_Dir_Mount_Name & "/disk_8_partitions.img");
end TC_Read_Partitions;
|
libsrc/_DEVELOPMENT/z80/c/sdcc_iy/z80_get_int_state.asm | meesokim/z88dk | 0 | 3866 | <reponame>meesokim/z88dk<gh_stars>0
; uint z80_get_int_state(void)
SECTION code_z80
PUBLIC _z80_get_int_state
EXTERN asm_z80_get_int_state
defc _z80_get_int_state = asm_z80_get_int_state
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1149.asm | ljhsiun2/medusa | 9 | 15371 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r14
push %r15
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x8443, %r12
nop
nop
xor %rbp, %rbp
mov $0x6162636465666768, %r15
movq %r15, (%r12)
nop
nop
nop
cmp $24839, %r13
lea addresses_UC_ht+0x15aa3, %r12
nop
nop
nop
nop
and %r14, %r14
movb $0x61, (%r12)
nop
nop
sub %rbp, %rbp
lea addresses_WC_ht+0x19b33, %rdx
clflush (%rdx)
nop
dec %rax
movb (%rdx), %r14b
nop
nop
nop
xor %r14, %r14
lea addresses_A_ht+0x1607c, %r13
clflush (%r13)
nop
inc %r12
mov $0x6162636465666768, %rdx
movq %rdx, (%r13)
nop
nop
sub $10033, %rbp
lea addresses_WT_ht+0x137c3, %rdx
nop
sub %r15, %r15
mov (%rdx), %r12
nop
nop
add $38175, %r15
lea addresses_WT_ht+0x3743, %rsi
lea addresses_WC_ht+0x81e3, %rdi
nop
nop
nop
add $12519, %rax
mov $71, %rcx
rep movsq
and $22363, %rdi
lea addresses_WT_ht+0xc0c3, %rdi
nop
dec %rsi
mov (%rdi), %eax
nop
nop
nop
cmp %rdi, %rdi
lea addresses_A_ht+0x11bb7, %rdx
nop
nop
dec %r13
movb (%rdx), %r14b
nop
nop
xor $59438, %r14
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %rbx
push %rcx
push %rdx
// Faulty Load
lea addresses_WC+0xb6c3, %r13
nop
nop
nop
nop
xor %rdx, %rdx
mov (%r13), %r11
lea oracles, %rbx
and $0xff, %r11
shlq $12, %r11
mov (%rbx,%r11,1), %r11
pop %rdx
pop %rcx
pop %rbx
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}}
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
|
traceur_final.adb | zyron92/banana_tree_generator | 0 | 27590 | with Geometry_Helpers, Traceur_Intermediaire;
use Geometry_Helpers, Traceur_Intermediaire;
package body Traceur_Final is
--Chercher l'arète suivante selon l'angle et le sens
function Chercher_Arete(Arete_Cour: in Ptr_Liste_Arretes_Adj; G: in Graphe; Sens_Trigo,Mode_Min: in Boolean) return Ptr_Liste_Arretes_Adj is
Cour,Arete_Suiv : Ptr_Liste_Arretes_Adj;
P1,P2,P3 : Coord_Point;
Angle_Suiv,Angle_Min,Angle_Max : Float;
begin
--Si on n'a pas d'autres arètes
Arete_Suiv := Arete_Cour;
--Valeurs initiales de l'angle à comparer
Angle_Min := 360.0;
Angle_Max := 0.0;
Cour := G(Arete_Cour.all.Arr.Id_SomDepart).Liste_Arr_Adj;
P1 := G(Arete_Cour.all.Arr.Id_SomDepart).Coord_Sommet;
P2 := G(Arete_Cour.all.Arr.Id_SomArrive).Coord_Sommet;
--Nous parcourons la liste d'adjacents appartenants au sommet de départ pour trouver l'arrète souhaité selon l'angle souhaité
while Cour/=null loop
--Nous traitons les arètes adjacentes qui ne sont pas l'arète_cour (pour ne pas tester les deux arètes identiques)
if Cour.all.Arr.Id_SomArrive /= Arete_Cour.all.Arr.Id_SomArrive then
P3 := G(Cour.all.Arr.Id_SomArrive).Coord_Sommet;
Angle_Suiv := Angle_Intersection_Arrete(Vecteur(P1,P2),Vecteur(P1,P3), P1,P2,P3, Sens_Trigo);
if Mode_Min and then Angle_Suiv < Angle_Min then
Angle_Min := Angle_Suiv;
Arete_Suiv := Cour;
elsif (not Mode_Min) and then Angle_Suiv > Angle_Max then
Angle_Max := Angle_Suiv;
Arete_Suiv := Cour;
end if;
end if;
Cour := Cour.all.Arr_Adj_Suiv;
end loop;
return Arete_Suiv;
end Chercher_Arete;
--Tracé de la courbe bézier d'un morceau du noeud depuis une arète vers une autre
procedure Tracer_Arete(Arete_Cour,Arete_Suiv: in Ptr_Liste_Arretes_Adj; Sens_Trigo: in Boolean; Fichier: in File_Type) is
AC, AS : Arrete;
begin
AC := Arete_Cour.all.Arr;
AS := Arete_Suiv.all.Arr;
if Sens_Trigo then
--Nous traçons si ce n'est pas encore tracé
if ((not AC.EstTrace_PCtl_T) and then (not AS.EstTrace_PCtl_I)) then
Tracer_Courbe(AC.PMilieu, AC.PCtl_T, AS.PCtl_I, AS.PMilieu, Fichier);
--Souvenir que nous avons tracé
Arete_Cour.all.Arr.EstTrace_PCtl_T := True;
Arete_Suiv.all.Arr.EstTrace_PCtl_I := True;
end if;
else
--Nous traçons si ce n'est pas encore tracé
if ((not AC.EstTrace_PCtl_I) and then (not AS.EstTrace_PCtl_T)) then
Tracer_Courbe(AC.PMilieu, AC.PCtl_I, AS.PCtl_T, AS.PMilieu, Fichier);
--Souvenir que nous avons tracé
Arete_Cour.all.Arr.EstTrace_PCtl_I := True;
Arete_Suiv.all.Arr.EstTrace_PCtl_T := True;
end if;
end if;
end Tracer_Arete;
--L'algo principal de tracé du noeud
procedure Tracer_Final(G:in Graphe; Fichier: in File_Type; Mode_Min: in Boolean) is
Arete_Cour, Arete_Suiv : Ptr_Liste_Arretes_Adj;
begin
--Nous parcourons tous les sommets (y compris les sommets dans le sous-graphe non-connecté (non-connexe) s'il existe)
for S in G'Range loop
--Nous parcourons toutes les arêtes adjacentes au sommet 'S'.
Arete_Cour := G(S).Liste_Arr_Adj;
while Arete_Cour /= null loop
--Le tracé à partir du point contrôle sens Trigo de côté sommet de départ se trouvant sur l'arête courante
Arete_Suiv := Chercher_Arete(Arete_Cour, G, True, Mode_Min);
Tracer_Arete(Arete_Cour, Arete_Suiv, True, Fichier);
--Le tracé à partir du point contrôle sens Inverse de côté sommet de départ se trouvant sur l'arête courante
Arete_Suiv := Chercher_Arete(Arete_Cour, G, False, Mode_Min);
Tracer_Arete(Arete_Cour, Arete_Suiv, False, Fichier);
--Nous avançons sur l'élement suivant de la liste
Arete_Cour := Arete_Cour.all.Arr_Adj_Suiv;
end loop;
end loop;
end Tracer_Final;
--Générer le fichier svg du tracé final avec ou sans le tracé intermédiaire
procedure Generer_Trace_Final (Nom_Fichier: in string; Couleur_Trait: in RGB; Epaisseur: in string; G: in Graphe; Avec_Intermediaire,Mode_Min: in Boolean) is
Fichier : File_Type;
begin
--Création et Les entêtes du fichier SVG
Create(Fichier,Out_File,Nom_Fichier);
Le_Debut(Fichier);
--Le tracé intermédiaire
if Avec_Intermediaire then
Appliquer_Couleur_Epaisseur(True,(R=>0,G=>0,B=>0),Epaisseur,Fichier);
Tracer_Arretes_Controls(G,Fichier,True);
Fin_Couleur_Translation(Fichier);
else
Tracer_Arretes_Controls(G,Fichier,False);
end if;
--Le tracé final
Appliquer_Couleur_Epaisseur(False,Couleur_Trait,Epaisseur,Fichier);
Tracer_Final(G,Fichier,Mode_Min);
Fin_Couleur_Translation(Fichier);
--Les queues & Fermeture du fichier SVG
La_Fin(Fichier);
Close(Fichier);
end Generer_Trace_Final;
end Traceur_Final;
|
arch/ARM/NXP/svd/lpc55s6x/nxp_svd-sct.ads | morbos/Ada_Drivers_Library | 2 | 11115 | -- Copyright 2016-2019 NXP
-- All rights reserved.SPDX-License-Identifier: BSD-3-Clause
-- This spec has been automatically generated from LPC55S6x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package NXP_SVD.SCT is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- SCT operation
type CONFIG_UNIFY_Field is
(
-- The SCT operates as two 16-bit counters named COUNTER_L and
-- COUNTER_H.
Dual_Counter,
-- The SCT operates as a unified 32-bit counter.
Unified_Counter)
with Size => 1;
for CONFIG_UNIFY_Field use
(Dual_Counter => 0,
Unified_Counter => 1);
-- SCT clock mode
type CONFIG_CLKMODE_Field is
(
-- System Clock Mode. The system clock clocks the entire SCT module
-- including the counter(s) and counter prescalers.
System_Clock_Mode,
-- Sampled System Clock Mode. The system clock clocks the SCT module,
-- but the counter and prescalers are only enabled to count when the
-- designated edge is detected on the input selected by the CKSEL field.
-- The minimum pulse width on the selected clock-gate input is 1 bus
-- clock period. This mode is the high-performance, sampled-clock mode.
Sampled_System_Clock_Mode,
-- SCT Input Clock Mode. The input/edge selected by the CKSEL field
-- clocks the SCT module, including the counters and prescalers, after
-- first being synchronized to the system clock. The minimum pulse width
-- on the clock input is 1 bus clock period. This mode is the low-power,
-- sampled-clock mode.
Sct_Input_Clock_Mode,
-- Asynchronous Mode. The entire SCT module is clocked directly by the
-- input/edge selected by the CKSEL field. In this mode, the SCT outputs
-- are switched synchronously to the SCT input clock - not the system
-- clock. The input clock rate must be at least half the system clock
-- rate and can be the same or faster than the system clock.
Asynchronous_Mode)
with Size => 2;
for CONFIG_CLKMODE_Field use
(System_Clock_Mode => 0,
Sampled_System_Clock_Mode => 1,
Sct_Input_Clock_Mode => 2,
Asynchronous_Mode => 3);
-- SCT clock select. The specific functionality of the designated
-- input/edge is dependent on the CLKMODE bit selection in this register.
type CONFIG_CKSEL_Field is
(
-- Rising edges on input 0.
Input_0_Rising_Edges,
-- Falling edges on input 0.
Input_0_Falling_Edge,
-- Rising edges on input 1.
Input_1_Rising_Edges,
-- Falling edges on input 1.
Input_1_Falling_Edge,
-- Rising edges on input 2.
Input_2_Rising_Edges,
-- Falling edges on input 2.
Input_2_Falling_Edge,
-- Rising edges on input 3.
Input_3_Rising_Edges,
-- Falling edges on input 3.
Input_3_Falling_Edge,
-- Rising edges on input 4.
Input_4_Rising_Edges,
-- Falling edges on input 4.
Input_4_Falling_Edge,
-- Rising edges on input 5.
Input_5_Rising_Edges,
-- Falling edges on input 5.
Input_5_Falling_Edge,
-- Rising edges on input 6.
Input_6_Rising_Edges,
-- Falling edges on input 6.
Input_6_Falling_Edge,
-- Rising edges on input 7.
Input_7_Rising_Edges,
-- Falling edges on input 7.
Input_7_Falling_Edge)
with Size => 4;
for CONFIG_CKSEL_Field use
(Input_0_Rising_Edges => 0,
Input_0_Falling_Edge => 1,
Input_1_Rising_Edges => 2,
Input_1_Falling_Edge => 3,
Input_2_Rising_Edges => 4,
Input_2_Falling_Edge => 5,
Input_3_Rising_Edges => 6,
Input_3_Falling_Edge => 7,
Input_4_Rising_Edges => 8,
Input_4_Falling_Edge => 9,
Input_5_Rising_Edges => 10,
Input_5_Falling_Edge => 11,
Input_6_Rising_Edges => 12,
Input_6_Falling_Edge => 13,
Input_7_Rising_Edges => 14,
Input_7_Falling_Edge => 15);
subtype CONFIG_INSYNC_Field is HAL.UInt4;
-- SCT configuration register
type CONFIG_Register is record
-- SCT operation
UNIFY : CONFIG_UNIFY_Field := NXP_SVD.SCT.Dual_Counter;
-- SCT clock mode
CLKMODE : CONFIG_CLKMODE_Field := NXP_SVD.SCT.System_Clock_Mode;
-- SCT clock select. The specific functionality of the designated
-- input/edge is dependent on the CLKMODE bit selection in this
-- register.
CKSEL : CONFIG_CKSEL_Field := NXP_SVD.SCT.Input_0_Rising_Edges;
-- A 1 in this bit prevents the lower match registers from being
-- reloaded from their respective reload registers. Setting this bit
-- eliminates the need to write to the reload registers MATCHREL if the
-- match values are fixed. Software can write to set or clear this bit
-- at any time. This bit applies to both the higher and lower registers
-- when the UNIFY bit is set.
NORELOAD_L : Boolean := False;
-- A 1 in this bit prevents the higher match registers from being
-- reloaded from their respective reload registers. Setting this bit
-- eliminates the need to write to the reload registers MATCHREL if the
-- match values are fixed. Software can write to set or clear this bit
-- at any time. This bit is not used when the UNIFY bit is set.
NORELOAD_H : Boolean := False;
-- Synchronization for input N (bit 9 = input 0, bit 10 = input 1,, bit
-- 12 = input 3); all other bits are reserved. A 1 in one of these bits
-- subjects the corresponding input to synchronization to the SCT clock,
-- before it is used to create an event. If an input is known to already
-- be synchronous to the SCT clock, this bit may be set to 0 for faster
-- input response. (Note: The SCT clock is the system clock for CKMODEs
-- 0-2. It is the selected, asynchronous SCT input clock for CKMODE3).
-- Note that the INSYNC field only affects inputs used for event
-- generation. It does not apply to the clock input specified in the
-- CKSEL field.
INSYNC : CONFIG_INSYNC_Field := 16#F#;
-- unspecified
Reserved_13_16 : HAL.UInt4 := 16#0#;
-- A one in this bit causes a match on match register 0 to be treated as
-- a de-facto LIMIT condition without the need to define an associated
-- event. As with any LIMIT event, this automatic limit causes the
-- counter to be cleared to zero in unidirectional mode or to change the
-- direction of count in bi-directional mode. Software can write to set
-- or clear this bit at any time. This bit applies to both the higher
-- and lower registers when the UNIFY bit is set.
AUTOLIMIT_L : Boolean := False;
-- A one in this bit will cause a match on match register 0 to be
-- treated as a de-facto LIMIT condition without the need to define an
-- associated event. As with any LIMIT event, this automatic limit
-- causes the counter to be cleared to zero in unidirectional mode or to
-- change the direction of count in bi-directional mode. Software can
-- write to set or clear this bit at any time. This bit is not used when
-- the UNIFY bit is set.
AUTOLIMIT_H : Boolean := False;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CONFIG_Register use record
UNIFY at 0 range 0 .. 0;
CLKMODE at 0 range 1 .. 2;
CKSEL at 0 range 3 .. 6;
NORELOAD_L at 0 range 7 .. 7;
NORELOAD_H at 0 range 8 .. 8;
INSYNC at 0 range 9 .. 12;
Reserved_13_16 at 0 range 13 .. 16;
AUTOLIMIT_L at 0 range 17 .. 17;
AUTOLIMIT_H at 0 range 18 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
-- L or unified counter direction select
type CTRL_BIDIR_L_Field is
(
-- Up. The counter counts up to a limit condition, then is cleared to
-- zero.
Up,
-- Up-down. The counter counts up to a limit, then counts down to a
-- limit condition or to 0.
Up_Down)
with Size => 1;
for CTRL_BIDIR_L_Field use
(Up => 0,
Up_Down => 1);
subtype CTRL_PRE_L_Field is HAL.UInt8;
-- Direction select
type CTRL_BIDIR_H_Field is
(
-- The H counter counts up to its limit condition, then is cleared to
-- zero.
Up,
-- The H counter counts up to its limit, then counts down to a limit
-- condition or to 0.
Up_Down)
with Size => 1;
for CTRL_BIDIR_H_Field use
(Up => 0,
Up_Down => 1);
subtype CTRL_PRE_H_Field is HAL.UInt8;
-- SCT control register
type CTRL_Register is record
-- This bit is 1 when the L or unified counter is counting down.
-- Hardware sets this bit when the counter is counting up, counter limit
-- occurs, and BIDIR = 1.Hardware clears this bit when the counter is
-- counting down and a limit condition occurs or when the counter
-- reaches 0.
DOWN_L : Boolean := False;
-- When this bit is 1 and HALT is 0, the L or unified counter does not
-- run, but I/O events related to the counter can occur. If a designated
-- start event occurs, this bit is cleared and counting resumes.
STOP_L : Boolean := False;
-- When this bit is 1, the L or unified counter does not run and no
-- events can occur. A reset sets this bit. When the HALT_L bit is one,
-- the STOP_L bit is cleared. It is possible to remove the halt
-- condition while keeping the SCT in the stop condition (not running)
-- with a single write to this register to simultaneously clear the HALT
-- bit and set the STOP bit. Once set, only software can clear this bit
-- to restore counter operation. This bit is set on reset.
HALT_L : Boolean := True;
-- Writing a 1 to this bit clears the L or unified counter. This bit
-- always reads as 0.
CLRCTR_L : Boolean := False;
-- L or unified counter direction select
BIDIR_L : CTRL_BIDIR_L_Field := NXP_SVD.SCT.Up;
-- Specifies the factor by which the SCT clock is prescaled to produce
-- the L or unified counter clock. The counter clock is clocked at the
-- rate of the SCT clock divided by PRE_L+1. Clear the counter (by
-- writing a 1 to the CLRCTR bit) whenever changing the PRE value.
PRE_L : CTRL_PRE_L_Field := 16#0#;
-- unspecified
Reserved_13_15 : HAL.UInt3 := 16#0#;
-- This bit is 1 when the H counter is counting down. Hardware sets this
-- bit when the counter is counting, a counter limit condition occurs,
-- and BIDIR is 1. Hardware clears this bit when the counter is counting
-- down and a limit condition occurs or when the counter reaches 0.
DOWN_H : Boolean := False;
-- When this bit is 1 and HALT is 0, the H counter does not, run but I/O
-- events related to the counter can occur. If such an event matches the
-- mask in the Start register, this bit is cleared and counting resumes.
STOP_H : Boolean := False;
-- When this bit is 1, the H counter does not run and no events can
-- occur. A reset sets this bit. When the HALT_H bit is one, the STOP_H
-- bit is cleared. It is possible to remove the halt condition while
-- keeping the SCT in the stop condition (not running) with a single
-- write to this register to simultaneously clear the HALT bit and set
-- the STOP bit. Once set, this bit can only be cleared by software to
-- restore counter operation. This bit is set on reset.
HALT_H : Boolean := True;
-- Writing a 1 to this bit clears the H counter. This bit always reads
-- as 0.
CLRCTR_H : Boolean := False;
-- Direction select
BIDIR_H : CTRL_BIDIR_H_Field := NXP_SVD.SCT.Up;
-- Specifies the factor by which the SCT clock is prescaled to produce
-- the H counter clock. The counter clock is clocked at the rate of the
-- SCT clock divided by PRELH+1. Clear the counter (by writing a 1 to
-- the CLRCTR bit) whenever changing the PRE value.
PRE_H : CTRL_PRE_H_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CTRL_Register use record
DOWN_L at 0 range 0 .. 0;
STOP_L at 0 range 1 .. 1;
HALT_L at 0 range 2 .. 2;
CLRCTR_L at 0 range 3 .. 3;
BIDIR_L at 0 range 4 .. 4;
PRE_L at 0 range 5 .. 12;
Reserved_13_15 at 0 range 13 .. 15;
DOWN_H at 0 range 16 .. 16;
STOP_H at 0 range 17 .. 17;
HALT_H at 0 range 18 .. 18;
CLRCTR_H at 0 range 19 .. 19;
BIDIR_H at 0 range 20 .. 20;
PRE_H at 0 range 21 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype LIMIT_LIMMSK_L_Field is HAL.UInt16;
subtype LIMIT_LIMMSK_H_Field is HAL.UInt16;
-- SCT limit event select register
type LIMIT_Register is record
-- If bit n is one, event n is used as a counter limit for the L or
-- unified counter (event 0 = bit 0, event 1 = bit 1, etc.). The number
-- of bits = number of events in this SCT.
LIMMSK_L : LIMIT_LIMMSK_L_Field := 16#0#;
-- If bit n is one, event n is used as a counter limit for the H counter
-- (event 0 = bit 16, event 1 = bit 17, etc.). The number of bits =
-- number of events in this SCT.
LIMMSK_H : LIMIT_LIMMSK_H_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for LIMIT_Register use record
LIMMSK_L at 0 range 0 .. 15;
LIMMSK_H at 0 range 16 .. 31;
end record;
subtype HALT_HALTMSK_L_Field is HAL.UInt16;
subtype HALT_HALTMSK_H_Field is HAL.UInt16;
-- SCT halt event select register
type HALT_Register is record
-- If bit n is one, event n sets the HALT_L bit in the CTRL register
-- (event 0 = bit 0, event 1 = bit 1, etc.). The number of bits = number
-- of events in this SCT.
HALTMSK_L : HALT_HALTMSK_L_Field := 16#0#;
-- If bit n is one, event n sets the HALT_H bit in the CTRL register
-- (event 0 = bit 16, event 1 = bit 17, etc.). The number of bits =
-- number of events in this SCT.
HALTMSK_H : HALT_HALTMSK_H_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for HALT_Register use record
HALTMSK_L at 0 range 0 .. 15;
HALTMSK_H at 0 range 16 .. 31;
end record;
subtype STOP_STOPMSK_L_Field is HAL.UInt16;
subtype STOP_STOPMSK_H_Field is HAL.UInt16;
-- SCT stop event select register
type STOP_Register is record
-- If bit n is one, event n sets the STOP_L bit in the CTRL register
-- (event 0 = bit 0, event 1 = bit 1, etc.). The number of bits = number
-- of events in this SCT.
STOPMSK_L : STOP_STOPMSK_L_Field := 16#0#;
-- If bit n is one, event n sets the STOP_H bit in the CTRL register
-- (event 0 = bit 16, event 1 = bit 17, etc.). The number of bits =
-- number of events in this SCT.
STOPMSK_H : STOP_STOPMSK_H_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for STOP_Register use record
STOPMSK_L at 0 range 0 .. 15;
STOPMSK_H at 0 range 16 .. 31;
end record;
subtype START_STARTMSK_L_Field is HAL.UInt16;
subtype START_STARTMSK_H_Field is HAL.UInt16;
-- SCT start event select register
type START_Register is record
-- If bit n is one, event n clears the STOP_L bit in the CTRL register
-- (event 0 = bit 0, event 1 = bit 1, etc.). The number of bits = number
-- of events in this SCT.
STARTMSK_L : START_STARTMSK_L_Field := 16#0#;
-- If bit n is one, event n clears the STOP_H bit in the CTRL register
-- (event 0 = bit 16, event 1 = bit 17, etc.). The number of bits =
-- number of events in this SCT.
STARTMSK_H : START_STARTMSK_H_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for START_Register use record
STARTMSK_L at 0 range 0 .. 15;
STARTMSK_H at 0 range 16 .. 31;
end record;
subtype COUNT_CTR_L_Field is HAL.UInt16;
subtype COUNT_CTR_H_Field is HAL.UInt16;
-- SCT counter register
type COUNT_Register is record
-- When UNIFY = 0, read or write the 16-bit L counter value. When UNIFY
-- = 1, read or write the lower 16 bits of the 32-bit unified counter.
CTR_L : COUNT_CTR_L_Field := 16#0#;
-- When UNIFY = 0, read or write the 16-bit H counter value. When UNIFY
-- = 1, read or write the upper 16 bits of the 32-bit unified counter.
CTR_H : COUNT_CTR_H_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for COUNT_Register use record
CTR_L at 0 range 0 .. 15;
CTR_H at 0 range 16 .. 31;
end record;
subtype STATE_STATE_L_Field is HAL.UInt5;
subtype STATE_STATE_H_Field is HAL.UInt5;
-- SCT state register
type STATE_Register is record
-- State variable.
STATE_L : STATE_STATE_L_Field := 16#0#;
-- unspecified
Reserved_5_15 : HAL.UInt11 := 16#0#;
-- State variable.
STATE_H : STATE_STATE_H_Field := 16#0#;
-- unspecified
Reserved_21_31 : HAL.UInt11 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for STATE_Register use record
STATE_L at 0 range 0 .. 4;
Reserved_5_15 at 0 range 5 .. 15;
STATE_H at 0 range 16 .. 20;
Reserved_21_31 at 0 range 21 .. 31;
end record;
-- INPUT_AIN array
type INPUT_AIN_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for INPUT_AIN
type INPUT_AIN_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AIN as a value
Val : HAL.UInt16;
when True =>
-- AIN as an array
Arr : INPUT_AIN_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for INPUT_AIN_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- INPUT_SIN array
type INPUT_SIN_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for INPUT_SIN
type INPUT_SIN_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SIN as a value
Val : HAL.UInt16;
when True =>
-- SIN as an array
Arr : INPUT_SIN_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for INPUT_SIN_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- SCT input register
type INPUT_Register is record
-- Read-only. Input 0 state. Input 0 state on the last SCT clock edge.
AIN : INPUT_AIN_Field;
-- Read-only. Input 0 state. Input 0 state following the synchronization
-- specified by INSYNC.
SIN : INPUT_SIN_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for INPUT_Register use record
AIN at 0 range 0 .. 15;
SIN at 0 range 16 .. 31;
end record;
subtype REGMODE_REGMOD_L_Field is HAL.UInt16;
subtype REGMODE_REGMOD_H_Field is HAL.UInt16;
-- SCT match/capture mode register
type REGMODE_Register is record
-- Each bit controls one match/capture register (register 0 = bit 0,
-- register 1 = bit 1, etc.). The number of bits = number of
-- match/captures in this SCT. 0 = register operates as match register.
-- 1 = register operates as capture register.
REGMOD_L : REGMODE_REGMOD_L_Field := 16#0#;
-- Each bit controls one match/capture register (register 0 = bit 16,
-- register 1 = bit 17, etc.). The number of bits = number of
-- match/captures in this SCT. 0 = register operates as match registers.
-- 1 = register operates as capture registers.
REGMOD_H : REGMODE_REGMOD_H_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for REGMODE_Register use record
REGMOD_L at 0 range 0 .. 15;
REGMOD_H at 0 range 16 .. 31;
end record;
subtype OUTPUT_OUT_Field is HAL.UInt16;
-- SCT output register
type OUTPUT_Register is record
-- Writing a 1 to bit n forces the corresponding output HIGH. Writing a
-- 0 forces the corresponding output LOW (output 0 = bit 0, output 1 =
-- bit 1, etc.). The number of bits = number of outputs in this SCT.
OUT_k : OUTPUT_OUT_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OUTPUT_Register use record
OUT_k at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- Set/clear operation on output 0. Value 0x3 is reserved. Do not program
-- this value.
type OUTPUTDIRCTRL_SETCLR0_Field is
(
-- Set and clear do not depend on the direction of any counter.
Independent,
-- Set and clear are reversed when counter L or the unified counter is
-- counting down.
L_Reversed,
-- Set and clear are reversed when counter H is counting down. Do not
-- use if UNIFY = 1.
H_Reversed)
with Size => 2;
for OUTPUTDIRCTRL_SETCLR0_Field use
(Independent => 0,
L_Reversed => 1,
H_Reversed => 2);
-- OUTPUTDIRCTRL_SETCLR array
type OUTPUTDIRCTRL_SETCLR_Field_Array is array (0 .. 15)
of OUTPUTDIRCTRL_SETCLR0_Field
with Component_Size => 2, Size => 32;
-- SCT output counter direction control register
type OUTPUTDIRCTRL_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SETCLR as a value
Val : HAL.UInt32;
when True =>
-- SETCLR as an array
Arr : OUTPUTDIRCTRL_SETCLR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for OUTPUTDIRCTRL_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- Effect of simultaneous set and clear on output 0.
type RES_O0RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR0 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR0 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O0RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 1.
type RES_O1RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR1 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR1 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O1RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 2.
type RES_O2RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR2 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output n (or set based on the SETCLR2 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O2RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 3.
type RES_O3RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR3 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR3 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O3RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 4.
type RES_O4RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR4 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR4 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O4RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 5.
type RES_O5RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR5 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR5 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O5RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 6.
type RES_O6RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR6 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR6 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O6RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 7.
type RES_O7RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR7 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output n (or set based on the SETCLR7 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O7RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 8.
type RES_O8RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR8 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR8 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O8RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 9.
type RES_O9RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR9 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR9 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O9RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 10.
type RES_O10RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR10 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR10 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O10RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 11.
type RES_O11RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR11 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR11 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O11RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 12.
type RES_O12RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR12 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR12 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O12RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 13.
type RES_O13RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR13 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR13 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O13RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 14.
type RES_O14RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR14 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR14 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O14RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- Effect of simultaneous set and clear on output 15.
type RES_O15RES_Field is
(
-- No change.
No_Change,
-- Set output (or clear based on the SETCLR15 field in the OUTPUTDIRCTRL
-- register).
Set,
-- Clear output (or set based on the SETCLR15 field).
Clear,
-- Toggle output.
Toggle_Output)
with Size => 2;
for RES_O15RES_Field use
(No_Change => 0,
Set => 1,
Clear => 2,
Toggle_Output => 3);
-- SCT conflict resolution register
type RES_Register is record
-- Effect of simultaneous set and clear on output 0.
O0RES : RES_O0RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 1.
O1RES : RES_O1RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 2.
O2RES : RES_O2RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 3.
O3RES : RES_O3RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 4.
O4RES : RES_O4RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 5.
O5RES : RES_O5RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 6.
O6RES : RES_O6RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 7.
O7RES : RES_O7RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 8.
O8RES : RES_O8RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 9.
O9RES : RES_O9RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 10.
O10RES : RES_O10RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 11.
O11RES : RES_O11RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 12.
O12RES : RES_O12RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 13.
O13RES : RES_O13RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 14.
O14RES : RES_O14RES_Field := NXP_SVD.SCT.No_Change;
-- Effect of simultaneous set and clear on output 15.
O15RES : RES_O15RES_Field := NXP_SVD.SCT.No_Change;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RES_Register use record
O0RES at 0 range 0 .. 1;
O1RES at 0 range 2 .. 3;
O2RES at 0 range 4 .. 5;
O3RES at 0 range 6 .. 7;
O4RES at 0 range 8 .. 9;
O5RES at 0 range 10 .. 11;
O6RES at 0 range 12 .. 13;
O7RES at 0 range 14 .. 15;
O8RES at 0 range 16 .. 17;
O9RES at 0 range 18 .. 19;
O10RES at 0 range 20 .. 21;
O11RES at 0 range 22 .. 23;
O12RES at 0 range 24 .. 25;
O13RES at 0 range 26 .. 27;
O14RES at 0 range 28 .. 29;
O15RES at 0 range 30 .. 31;
end record;
subtype DMAREQ0_DEV_0_Field is HAL.UInt16;
-- SCT DMA request 0 register
type DMAREQ0_Register is record
-- If bit n is one, event n triggers DMA request 0 (event 0 = bit 0,
-- event 1 = bit 1, etc.). The number of bits = number of events in this
-- SCT.
DEV_0 : DMAREQ0_DEV_0_Field := 16#0#;
-- unspecified
Reserved_16_29 : HAL.UInt14 := 16#0#;
-- A 1 in this bit triggers DMA request 0 when it loads the
-- MATCH_L/Unified registers from the RELOAD_L/Unified registers.
DRL0 : Boolean := False;
-- This read-only bit indicates the state of DMA Request 0. Note that if
-- the related DMA channel is enabled and properly set up, it is
-- unlikely that software will see this flag, it will be cleared rapidly
-- by the DMA service. The flag remaining set could point to an issue
-- with DMA setup.
DRQ0 : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DMAREQ0_Register use record
DEV_0 at 0 range 0 .. 15;
Reserved_16_29 at 0 range 16 .. 29;
DRL0 at 0 range 30 .. 30;
DRQ0 at 0 range 31 .. 31;
end record;
subtype DMAREQ1_DEV_1_Field is HAL.UInt16;
-- SCT DMA request 1 register
type DMAREQ1_Register is record
-- If bit n is one, event n triggers DMA request 1 (event 0 = bit 0,
-- event 1 = bit 1, etc.). The number of bits = number of events in this
-- SCT.
DEV_1 : DMAREQ1_DEV_1_Field := 16#0#;
-- unspecified
Reserved_16_29 : HAL.UInt14 := 16#0#;
-- A 1 in this bit triggers DMA request 1 when it loads the Match
-- L/Unified registers from the Reload L/Unified registers.
DRL1 : Boolean := False;
-- This read-only bit indicates the state of DMA Request 1. Note that if
-- the related DMA channel is enabled and properly set up, it is
-- unlikely that software will see this flag, it will be cleared rapidly
-- by the DMA service. The flag remaining set could point to an issue
-- with DMA setup.
DRQ1 : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DMAREQ1_Register use record
DEV_1 at 0 range 0 .. 15;
Reserved_16_29 at 0 range 16 .. 29;
DRL1 at 0 range 30 .. 30;
DRQ1 at 0 range 31 .. 31;
end record;
subtype EVEN_IEN_Field is HAL.UInt16;
-- SCT event interrupt enable register
type EVEN_Register is record
-- The SCT requests an interrupt when bit n of this register and the
-- event flag register are both one (event 0 = bit 0, event 1 = bit 1,
-- etc.). The number of bits = number of events in this SCT.
IEN : EVEN_IEN_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EVEN_Register use record
IEN at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype EVFLAG_FLAG_Field is HAL.UInt16;
-- SCT event flag register
type EVFLAG_Register is record
-- Bit n is one if event n has occurred since reset or a 1 was last
-- written to this bit (event 0 = bit 0, event 1 = bit 1, etc.). The
-- number of bits = number of events in this SCT.
FLAG : EVFLAG_FLAG_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EVFLAG_Register use record
FLAG at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CONEN_NCEN_Field is HAL.UInt16;
-- SCT conflict interrupt enable register
type CONEN_Register is record
-- The SCT requests an interrupt when bit n of this register and the SCT
-- conflict flag register are both one (output 0 = bit 0, output 1 = bit
-- 1, etc.). The number of bits = number of outputs in this SCT.
NCEN : CONEN_NCEN_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CONEN_Register use record
NCEN at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CONFLAG_NCFLAG_Field is HAL.UInt16;
-- SCT conflict flag register
type CONFLAG_Register is record
-- Bit n is one if a no-change conflict event occurred on output n since
-- reset or a 1 was last written to this bit (output 0 = bit 0, output 1
-- = bit 1, etc.). The number of bits = number of outputs in this SCT.
NCFLAG : CONFLAG_NCFLAG_Field := 16#0#;
-- unspecified
Reserved_16_29 : HAL.UInt14 := 16#0#;
-- The most recent bus error from this SCT involved writing CTR
-- L/Unified, STATE L/Unified, MATCH L/Unified, or the Output register
-- when the L/U counter was not halted. A word write to certain L and H
-- registers can be half successful and half unsuccessful.
BUSERRL : Boolean := False;
-- The most recent bus error from this SCT involved writing CTR H, STATE
-- H, MATCH H, or the Output register when the H counter was not halted.
BUSERRH : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CONFLAG_Register use record
NCFLAG at 0 range 0 .. 15;
Reserved_16_29 at 0 range 16 .. 29;
BUSERRL at 0 range 30 .. 30;
BUSERRH at 0 range 31 .. 31;
end record;
subtype CAP_CAPn_L_Field is HAL.UInt16;
subtype CAP_CAPn_H_Field is HAL.UInt16;
-- SCT capture register of capture channel
type CAP_Register is record
-- When UNIFY = 0, read the 16-bit counter value at which this register
-- was last captured. When UNIFY = 1, read the lower 16 bits of the
-- 32-bit value at which this register was last captured.
CAPn_L : CAP_CAPn_L_Field := 16#0#;
-- When UNIFY = 0, read the 16-bit counter value at which this register
-- was last captured. When UNIFY = 1, read the upper 16 bits of the
-- 32-bit value at which this register was last captured.
CAPn_H : CAP_CAPn_H_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CAP_Register use record
CAPn_L at 0 range 0 .. 15;
CAPn_H at 0 range 16 .. 31;
end record;
subtype MATCH_MATCHn_L_Field is HAL.UInt16;
subtype MATCH_MATCHn_H_Field is HAL.UInt16;
-- SCT match value register of match channels
type MATCH_Register is record
-- When UNIFY = 0, read or write the 16-bit value to be compared to the
-- L counter. When UNIFY = 1, read or write the lower 16 bits of the
-- 32-bit value to be compared to the unified counter.
MATCHn_L : MATCH_MATCHn_L_Field := 16#0#;
-- When UNIFY = 0, read or write the 16-bit value to be compared to the
-- H counter. When UNIFY = 1, read or write the upper 16 bits of the
-- 32-bit value to be compared to the unified counter.
MATCHn_H : MATCH_MATCHn_H_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for MATCH_Register use record
MATCHn_L at 0 range 0 .. 15;
MATCHn_H at 0 range 16 .. 31;
end record;
subtype CAPCTRL_CAPCONn_L_Field is HAL.UInt16;
subtype CAPCTRL_CAPCONn_H_Field is HAL.UInt16;
-- SCT capture control register
type CAPCTRL_Register is record
-- If bit m is one, event m causes the CAPn_L (UNIFY = 0) or the CAPn
-- (UNIFY = 1) register to be loaded (event 0 = bit 0, event 1 = bit 1,
-- etc.). The number of bits = number of match/captures in this SCT.
CAPCONn_L : CAPCTRL_CAPCONn_L_Field := 16#0#;
-- If bit m is one, event m causes the CAPn_H (UNIFY = 0) register to be
-- loaded (event 0 = bit 16, event 1 = bit 17, etc.). The number of bits
-- = number of match/captures in this SCT.
CAPCONn_H : CAPCTRL_CAPCONn_H_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CAPCTRL_Register use record
CAPCONn_L at 0 range 0 .. 15;
CAPCONn_H at 0 range 16 .. 31;
end record;
subtype MATCHREL_RELOADn_L_Field is HAL.UInt16;
subtype MATCHREL_RELOADn_H_Field is HAL.UInt16;
-- SCT match reload value register
type MATCHREL_Register is record
-- When UNIFY = 0, specifies the 16-bit value to be loaded into the
-- MATCHn_L register. When UNIFY = 1, specifies the lower 16 bits of the
-- 32-bit value to be loaded into the MATCHn register.
RELOADn_L : MATCHREL_RELOADn_L_Field := 16#0#;
-- When UNIFY = 0, specifies the 16-bit to be loaded into the MATCHn_H
-- register. When UNIFY = 1, specifies the upper 16 bits of the 32-bit
-- value to be loaded into the MATCHn register.
RELOADn_H : MATCHREL_RELOADn_H_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for MATCHREL_Register use record
RELOADn_L at 0 range 0 .. 15;
RELOADn_H at 0 range 16 .. 31;
end record;
----------------------------
-- EV cluster's Registers --
----------------------------
subtype EV_STATE_EV_STATEMSKn_Field is HAL.UInt16;
-- SCT event state register 0
type EV_STATE_EV_Register is record
-- If bit m is one, event n happens in state m of the counter selected
-- by the HEVENT bit (n = event number, m = state number; state 0 = bit
-- 0, state 1= bit 1, etc.). The number of bits = number of states in
-- this SCT.
STATEMSKn : EV_STATE_EV_STATEMSKn_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EV_STATE_EV_Register use record
STATEMSKn at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype EV_CTRL_EV_MATCHSEL_Field is HAL.UInt4;
-- Select L/H counter. Do not set this bit if UNIFY = 1.
type EV_CTRL_HEVENT_Field is
(
-- Selects the L state and the L match register selected by MATCHSEL.
L_Counter,
-- Selects the H state and the H match register selected by MATCHSEL.
H_Counter)
with Size => 1;
for EV_CTRL_HEVENT_Field use
(L_Counter => 0,
H_Counter => 1);
-- Input/output select
type EV_CTRL_OUTSEL_Field is
(
-- Selects the inputs selected by IOSEL.
Input,
-- Selects the outputs selected by IOSEL.
Output)
with Size => 1;
for EV_CTRL_OUTSEL_Field use
(Input => 0,
Output => 1);
subtype EV_CTRL_EV_IOSEL_Field is HAL.UInt4;
-- Selects the I/O condition for event n. (The detection of edges on
-- outputs lag the conditions that switch the outputs by one SCT clock). In
-- order to guarantee proper edge/state detection, an input must have a
-- minimum pulse width of at least one SCT clock period .
type EV_CTRL_IOCOND_Field is
(
-- LOW
Low,
-- Rise
Rise,
-- Fall
Fall,
-- HIGH
High)
with Size => 2;
for EV_CTRL_IOCOND_Field use
(Low => 0,
Rise => 1,
Fall => 2,
High => 3);
-- Selects how the specified match and I/O condition are used and combined.
type EV_CTRL_COMBMODE_Field is
(
-- OR. The event occurs when either the specified match or I/O condition
-- occurs.
Or_k,
-- MATCH. Uses the specified match only.
Match,
-- IO. Uses the specified I/O condition only.
Io,
-- AND. The event occurs when the specified match and I/O condition
-- occur simultaneously.
And_k)
with Size => 2;
for EV_CTRL_COMBMODE_Field use
(Or_k => 0,
Match => 1,
Io => 2,
And_k => 3);
-- This bit controls how the STATEV value modifies the state selected by
-- HEVENT when this event is the highest-numbered event occurring for that
-- state.
type EV_CTRL_STATELD_Field is
(
-- STATEV value is added into STATE (the carry-out is ignored).
Add,
-- STATEV value is loaded into STATE.
Load)
with Size => 1;
for EV_CTRL_STATELD_Field use
(Add => 0,
Load => 1);
subtype EV_CTRL_EV_STATEV_Field is HAL.UInt5;
-- Direction qualifier for event generation. This field only applies when
-- the counters are operating in BIDIR mode. If BIDIR = 0, the SCT ignores
-- this field. Value 0x3 is reserved.
type EV_CTRL_DIRECTION_Field is
(
-- Direction independent. This event is triggered regardless of the
-- count direction.
Direction_Independent,
-- Counting up. This event is triggered only during up-counting when
-- BIDIR = 1.
Counting_Up,
-- Counting down. This event is triggered only during down-counting when
-- BIDIR = 1.
Counting_Down)
with Size => 2;
for EV_CTRL_DIRECTION_Field use
(Direction_Independent => 0,
Counting_Up => 1,
Counting_Down => 2);
-- SCT event control register 0
type EV_CTRL_EV_Register is record
-- Selects the Match register associated with this event (if any). A
-- match can occur only when the counter selected by the HEVENT bit is
-- running.
MATCHSEL : EV_CTRL_EV_MATCHSEL_Field := 16#0#;
-- Select L/H counter. Do not set this bit if UNIFY = 1.
HEVENT : EV_CTRL_HEVENT_Field := NXP_SVD.SCT.L_Counter;
-- Input/output select
OUTSEL : EV_CTRL_OUTSEL_Field := NXP_SVD.SCT.Input;
-- Selects the input or output signal number associated with this event
-- (if any). Do not select an input in this register if CKMODE is 1x. In
-- this case the clock input is an implicit ingredient of every event.
IOSEL : EV_CTRL_EV_IOSEL_Field := 16#0#;
-- Selects the I/O condition for event n. (The detection of edges on
-- outputs lag the conditions that switch the outputs by one SCT clock).
-- In order to guarantee proper edge/state detection, an input must have
-- a minimum pulse width of at least one SCT clock period .
IOCOND : EV_CTRL_IOCOND_Field := NXP_SVD.SCT.Low;
-- Selects how the specified match and I/O condition are used and
-- combined.
COMBMODE : EV_CTRL_COMBMODE_Field := NXP_SVD.SCT.Or_k;
-- This bit controls how the STATEV value modifies the state selected by
-- HEVENT when this event is the highest-numbered event occurring for
-- that state.
STATELD : EV_CTRL_STATELD_Field := NXP_SVD.SCT.Add;
-- This value is loaded into or added to the state selected by HEVENT,
-- depending on STATELD, when this event is the highest-numbered event
-- occurring for that state. If STATELD and STATEV are both zero, there
-- is no change to the STATE value.
STATEV : EV_CTRL_EV_STATEV_Field := 16#0#;
-- If this bit is one and the COMBMODE field specifies a match component
-- to the triggering of this event, then a match is considered to be
-- active whenever the counter value is GREATER THAN OR EQUAL TO the
-- value specified in the match register when counting up, LESS THEN OR
-- EQUAL TO the match value when counting down. If this bit is zero, a
-- match is only be active during the cycle when the counter is equal to
-- the match value.
MATCHMEM : Boolean := False;
-- Direction qualifier for event generation. This field only applies
-- when the counters are operating in BIDIR mode. If BIDIR = 0, the SCT
-- ignores this field. Value 0x3 is reserved.
DIRECTION : EV_CTRL_DIRECTION_Field :=
NXP_SVD.SCT.Direction_Independent;
-- unspecified
Reserved_23_31 : HAL.UInt9 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EV_CTRL_EV_Register use record
MATCHSEL at 0 range 0 .. 3;
HEVENT at 0 range 4 .. 4;
OUTSEL at 0 range 5 .. 5;
IOSEL at 0 range 6 .. 9;
IOCOND at 0 range 10 .. 11;
COMBMODE at 0 range 12 .. 13;
STATELD at 0 range 14 .. 14;
STATEV at 0 range 15 .. 19;
MATCHMEM at 0 range 20 .. 20;
DIRECTION at 0 range 21 .. 22;
Reserved_23_31 at 0 range 23 .. 31;
end record;
-- no description available
type EV_Cluster is record
-- SCT event state register 0
EV_STATE : aliased EV_STATE_EV_Register;
-- SCT event control register 0
EV_CTRL : aliased EV_CTRL_EV_Register;
end record
with Volatile, Size => 64;
for EV_Cluster use record
EV_STATE at 16#0# range 0 .. 31;
EV_CTRL at 16#4# range 0 .. 31;
end record;
-- no description available
type EV_Clusters is array (0 .. 15) of EV_Cluster;
-----------------------------
-- OUT cluster's Registers --
-----------------------------
subtype OUT_SET_OUT_SET_Field is HAL.UInt16;
-- SCT output 0 set register
type OUT_SET_OUT_Register is record
-- A 1 in bit m selects event m to set output n (or clear it if SETCLRn
-- = 0x1 or 0x2) output 0 = bit 0, output 1 = bit 1, etc. The number of
-- bits = number of events in this SCT. When the counter is used in
-- bi-directional mode, it is possible to reverse the action specified
-- by the output set and clear registers when counting down, See the
-- OUTPUTCTRL register.
SET : OUT_SET_OUT_SET_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OUT_SET_OUT_Register use record
SET at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype OUT_CLR_OUT_CLR_Field is HAL.UInt16;
-- SCT output 0 clear register
type OUT_CLR_OUT_Register is record
-- A 1 in bit m selects event m to clear output n (or set it if SETCLRn
-- = 0x1 or 0x2) event 0 = bit 0, event 1 = bit 1, etc. The number of
-- bits = number of events in this SCT. When the counter is used in
-- bi-directional mode, it is possible to reverse the action specified
-- by the output set and clear registers when counting down, See the
-- OUTPUTCTRL register.
CLR : OUT_CLR_OUT_CLR_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for OUT_CLR_OUT_Register use record
CLR at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- no description available
type OUT_Cluster is record
-- SCT output 0 set register
OUT_SET : aliased OUT_SET_OUT_Register;
-- SCT output 0 clear register
OUT_CLR : aliased OUT_CLR_OUT_Register;
end record
with Volatile, Size => 64;
for OUT_Cluster use record
OUT_SET at 16#0# range 0 .. 31;
OUT_CLR at 16#4# range 0 .. 31;
end record;
-- no description available
type OUT_Clusters is array (0 .. 9) of OUT_Cluster;
-----------------
-- Peripherals --
-----------------
type SCT0_Disc is
(
Mode_1,
Mode_2);
-- SCTimer/PWM (SCT)
type SCT0_Peripheral
(Discriminent : SCT0_Disc := Mode_1)
is record
-- SCT configuration register
CONFIG : aliased CONFIG_Register;
-- SCT control register
CTRL : aliased CTRL_Register;
-- SCT limit event select register
LIMIT : aliased LIMIT_Register;
-- SCT halt event select register
HALT : aliased HALT_Register;
-- SCT stop event select register
STOP : aliased STOP_Register;
-- SCT start event select register
START : aliased START_Register;
-- SCT counter register
COUNT : aliased COUNT_Register;
-- SCT state register
STATE : aliased STATE_Register;
-- SCT input register
INPUT : aliased INPUT_Register;
-- SCT match/capture mode register
REGMODE : aliased REGMODE_Register;
-- SCT output register
OUTPUT : aliased OUTPUT_Register;
-- SCT output counter direction control register
OUTPUTDIRCTRL : aliased OUTPUTDIRCTRL_Register;
-- SCT conflict resolution register
RES : aliased RES_Register;
-- SCT DMA request 0 register
DMAREQ0 : aliased DMAREQ0_Register;
-- SCT DMA request 1 register
DMAREQ1 : aliased DMAREQ1_Register;
-- SCT event interrupt enable register
EVEN : aliased EVEN_Register;
-- SCT event flag register
EVFLAG : aliased EVFLAG_Register;
-- SCT conflict interrupt enable register
CONEN : aliased CONEN_Register;
-- SCT conflict flag register
CONFLAG : aliased CONFLAG_Register;
-- no description available
EV : aliased EV_Clusters;
-- no description available
OUT_k : aliased OUT_Clusters;
case Discriminent is
when Mode_1 =>
-- SCT capture register of capture channel
CAP0 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP1 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP2 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP3 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP4 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP5 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP6 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP7 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP8 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP9 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP10 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP11 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP12 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP13 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP14 : aliased CAP_Register;
-- SCT capture register of capture channel
CAP15 : aliased CAP_Register;
-- SCT capture control register
CAPCTRL0 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL1 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL2 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL3 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL4 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL5 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL6 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL7 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL8 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL9 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL10 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL11 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL12 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL13 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL14 : aliased CAPCTRL_Register;
-- SCT capture control register
CAPCTRL15 : aliased CAPCTRL_Register;
when Mode_2 =>
-- SCT match value register of match channels
MATCH0 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH1 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH2 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH3 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH4 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH5 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH6 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH7 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH8 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH9 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH10 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH11 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH12 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH13 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH14 : aliased MATCH_Register;
-- SCT match value register of match channels
MATCH15 : aliased MATCH_Register;
-- SCT match reload value register
MATCHREL0 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL1 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL2 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL3 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL4 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL5 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL6 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL7 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL8 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL9 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL10 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL11 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL12 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL13 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL14 : aliased MATCHREL_Register;
-- SCT match reload value register
MATCHREL15 : aliased MATCHREL_Register;
end case;
end record
with Unchecked_Union, Volatile;
for SCT0_Peripheral use record
CONFIG at 16#0# range 0 .. 31;
CTRL at 16#4# range 0 .. 31;
LIMIT at 16#8# range 0 .. 31;
HALT at 16#C# range 0 .. 31;
STOP at 16#10# range 0 .. 31;
START at 16#14# range 0 .. 31;
COUNT at 16#40# range 0 .. 31;
STATE at 16#44# range 0 .. 31;
INPUT at 16#48# range 0 .. 31;
REGMODE at 16#4C# range 0 .. 31;
OUTPUT at 16#50# range 0 .. 31;
OUTPUTDIRCTRL at 16#54# range 0 .. 31;
RES at 16#58# range 0 .. 31;
DMAREQ0 at 16#5C# range 0 .. 31;
DMAREQ1 at 16#60# range 0 .. 31;
EVEN at 16#F0# range 0 .. 31;
EVFLAG at 16#F4# range 0 .. 31;
CONEN at 16#F8# range 0 .. 31;
CONFLAG at 16#FC# range 0 .. 31;
EV at 16#300# range 0 .. 1023;
OUT_k at 16#500# range 0 .. 639;
CAP0 at 16#100# range 0 .. 31;
CAP1 at 16#104# range 0 .. 31;
CAP2 at 16#108# range 0 .. 31;
CAP3 at 16#10C# range 0 .. 31;
CAP4 at 16#110# range 0 .. 31;
CAP5 at 16#114# range 0 .. 31;
CAP6 at 16#118# range 0 .. 31;
CAP7 at 16#11C# range 0 .. 31;
CAP8 at 16#120# range 0 .. 31;
CAP9 at 16#124# range 0 .. 31;
CAP10 at 16#128# range 0 .. 31;
CAP11 at 16#12C# range 0 .. 31;
CAP12 at 16#130# range 0 .. 31;
CAP13 at 16#134# range 0 .. 31;
CAP14 at 16#138# range 0 .. 31;
CAP15 at 16#13C# range 0 .. 31;
CAPCTRL0 at 16#200# range 0 .. 31;
CAPCTRL1 at 16#204# range 0 .. 31;
CAPCTRL2 at 16#208# range 0 .. 31;
CAPCTRL3 at 16#20C# range 0 .. 31;
CAPCTRL4 at 16#210# range 0 .. 31;
CAPCTRL5 at 16#214# range 0 .. 31;
CAPCTRL6 at 16#218# range 0 .. 31;
CAPCTRL7 at 16#21C# range 0 .. 31;
CAPCTRL8 at 16#220# range 0 .. 31;
CAPCTRL9 at 16#224# range 0 .. 31;
CAPCTRL10 at 16#228# range 0 .. 31;
CAPCTRL11 at 16#22C# range 0 .. 31;
CAPCTRL12 at 16#230# range 0 .. 31;
CAPCTRL13 at 16#234# range 0 .. 31;
CAPCTRL14 at 16#238# range 0 .. 31;
CAPCTRL15 at 16#23C# range 0 .. 31;
MATCH0 at 16#100# range 0 .. 31;
MATCH1 at 16#104# range 0 .. 31;
MATCH2 at 16#108# range 0 .. 31;
MATCH3 at 16#10C# range 0 .. 31;
MATCH4 at 16#110# range 0 .. 31;
MATCH5 at 16#114# range 0 .. 31;
MATCH6 at 16#118# range 0 .. 31;
MATCH7 at 16#11C# range 0 .. 31;
MATCH8 at 16#120# range 0 .. 31;
MATCH9 at 16#124# range 0 .. 31;
MATCH10 at 16#128# range 0 .. 31;
MATCH11 at 16#12C# range 0 .. 31;
MATCH12 at 16#130# range 0 .. 31;
MATCH13 at 16#134# range 0 .. 31;
MATCH14 at 16#138# range 0 .. 31;
MATCH15 at 16#13C# range 0 .. 31;
MATCHREL0 at 16#200# range 0 .. 31;
MATCHREL1 at 16#204# range 0 .. 31;
MATCHREL2 at 16#208# range 0 .. 31;
MATCHREL3 at 16#20C# range 0 .. 31;
MATCHREL4 at 16#210# range 0 .. 31;
MATCHREL5 at 16#214# range 0 .. 31;
MATCHREL6 at 16#218# range 0 .. 31;
MATCHREL7 at 16#21C# range 0 .. 31;
MATCHREL8 at 16#220# range 0 .. 31;
MATCHREL9 at 16#224# range 0 .. 31;
MATCHREL10 at 16#228# range 0 .. 31;
MATCHREL11 at 16#22C# range 0 .. 31;
MATCHREL12 at 16#230# range 0 .. 31;
MATCHREL13 at 16#234# range 0 .. 31;
MATCHREL14 at 16#238# range 0 .. 31;
MATCHREL15 at 16#23C# range 0 .. 31;
end record;
-- SCTimer/PWM (SCT)
SCT0_Periph : aliased SCT0_Peripheral
with Import, Address => System'To_Address (16#40085000#);
end NXP_SVD.SCT;
|
test/data/ASM-360/subroutine2.asm | jfitz/code-stat | 0 | 173669 | <filename>test/data/ASM-360/subroutine2.asm
subr
stm r14,r12,12(r13) ! store multiple registers into caller's
! save area (r14,r15,r0,...,r12)
balr r12,0 ! set address in r12 for use as base reg
using *,r12 ! pseudo-op to tell assembler to use r12
la r11,savearea ! load address of my save area
st r13,savearea+4 ! store address of caller's save area
st r11,8(r13) ! store address of my save area in
! caller's save area
... body of subroutine ...
... r0 is used for return code, if present ...
l r13,savearea+4 ! load address of caller's save area
lm r14,r12,12(r13) ! load multiple registers from caller's
! save area (r14,r15,r0,...,r12)
br r14 ! return to caller
savearea
ds 18f ! 18-word save area
! byte 0: reserved
! byte 4: address of caller's save area
! byte 8: address of called subroutine's save area
! byte 12: contents of r14
! byte 16: contents of r15
! byte 20: contents of r0
! byte 24: contents of r1
! ...
! byte 68: contents of r12
|
src/test/ref/struct-ptr-23.asm | jbrandwood/kickc | 2 | 178120 | <reponame>jbrandwood/kickc
// Example of a struct containing an array
// Commodore 64 PRG executable file
.file [name="struct-ptr-23.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.const SIZEOF_STRUCT_PERSON = 5
.const OFFSET_STRUCT_PERSON_INITIALS = 1
.label SCREEN = $400
.segment Code
main: {
.label person = persons+SIZEOF_STRUCT_PERSON
// print_person(person)
ldx #0
lda #<persons
sta.z print_person.person
lda #>persons
sta.z print_person.person+1
jsr print_person
// print_person(person)
lda #<person
sta.z print_person.person
lda #>person
sta.z print_person.person+1
jsr print_person
// }
rts
}
// void print_person(__zp(2) struct Person *person)
print_person: {
.label __3 = 4
.label __4 = 2
.label person = 2
// '0'+person->id
lda #'0'
clc
ldy #0
adc (person),y
// SCREEN[idx++] = '0'+person->id
sta SCREEN,x
// SCREEN[idx++] = '0'+person->id;
inx
// SCREEN[idx++] = ' '
lda #' '
sta SCREEN,x
// SCREEN[idx++] = ' ';
inx
// SCREEN[idx++] = person->initials[0]
ldy #OFFSET_STRUCT_PERSON_INITIALS
lda (person),y
sta SCREEN,x
// SCREEN[idx++] = person->initials[0];
inx
// SCREEN[idx++] = person->initials[1]
tya
clc
adc.z person
sta.z __3
lda #0
adc.z person+1
sta.z __3+1
ldy #1
lda (__3),y
sta SCREEN,x
// SCREEN[idx++] = person->initials[1];
inx
// SCREEN[idx++] = person->initials[2]
lda #OFFSET_STRUCT_PERSON_INITIALS
clc
adc.z __4
sta.z __4
bcc !+
inc.z __4+1
!:
ldy #2
lda (__4),y
sta SCREEN,x
// SCREEN[idx++] = person->initials[2];
inx
// SCREEN[idx++] = ' '
lda #' '
sta SCREEN,x
// SCREEN[idx++] = ' ';
inx
// }
rts
}
.segment Data
persons: .byte 1
.text "jgr"
.byte 0, 8
.text "hbg"
.byte 0
|
programs/oeis/022/A022003.asm | karttu/loda | 1 | 168925 | ; A022003: Decimal expansion of 1/999.
; 0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1
mod $0,3
div $0,2
mov $1,$0
|
program.asm | martimfj/VBA-Compiler | 0 | 247750 | <filename>program.asm
SYS_EXIT equ 1
SYS_READ equ 3
SYS_WRITE equ 4
STDIN equ 0
STDOUT equ 1
True equ 1
False equ 0
segment .data
segment .bss
res RESB 1
section .text
global _start
print:
PUSH EBP
MOV EBP, ESP
MOV EAX, [EBP+8]
XOR ESI, ESI
print_dec:
MOV EDX, 0
MOV EBX, 0x000A
DIV EBX
ADD EDX, '0'
PUSH EDX
INC ESI
CMP EAX, 0
JZ print_next
JMP print_dec
print_next:
CMP ESI, 0
JZ print_exit
DEC ESI
MOV EAX, SYS_WRITE
MOV EBX, STDOUT
POP ECX
MOV [res], ECX
MOV ECX, res
MOV EDX, 1
INT 0x80
JMP print_next
print_exit:
POP EBP
RET
binop_je:
JE binop_true
JMP binop_false
binop_jg:
JG binop_true
JMP binop_false
binop_jl:
JL binop_true
JMP binop_false
binop_false:
MOV EBX, False
JMP binop_exit
binop_true:
MOV EBX, True
binop_exit:
RET
_start:
PUSH EBP
MOV EBP, ESP
PUSH DWORD 0 ; Dim BT as BOOLEAN - [EBP−4]
PUSH DWORD 0 ; Dim BF as BOOLEAN - [EBP−8]
MOV EBX, True
MOV [EBP-4], EBX ; BT = True
MOV EBX, False
MOV [EBP-8], EBX ; BF = False
MOV EBX, [EBP-8]
PUSH EBX
MOV EBX, [EBP-4]
POP EAX
AND EAX, EBX ; And: False & True
MOV EBX, EAX
PUSH EBX
CALL print
POP EBX
MOV EBX, [EBP-8]
PUSH EBX
MOV EBX, [EBP-4]
POP EAX
OR EAX, EBX ; Or: False | True
MOV EBX, EAX
PUSH EBX
CALL print
POP EBX
MOV EBX, [EBP-8]
MOV EBX, True ; Negation: !False
MOV EBX, False ; Negation: !True
PUSH EBX
CALL print
POP EBX
MOV EBX, [EBP-4]
PUSH EBX
MOV EBX, [EBP-8]
POP EAX
AND EAX, EBX ; And: True & False
MOV EBX, EAX
PUSH EBX
MOV EBX, [EBP-8]
POP EAX
OR EAX, EBX ; Or: False | False
MOV EBX, EAX
MOV EBX, True ; Negation: !False
PUSH EBX
CALL print
POP EBX
POP EBP
MOV EAX, 1
INT 0x80
|
eurasia/services4/srvinit/devices/sgx/cmplxstaterestore.asm | shaqfu786/GFX_Linux_DDK | 3 | 92272 | /*****************************************************************************
Name : cmplxstaterestore.asm
Title : Complex Geometry State restore USE program
Author : <NAME>
Created : 08/08/2006
Copyright : 2006 by Imagination Technologies Limited. All rights reserved.
No part of this software, either material or conceptual
may be copied or distributed, transmitted, transcribed,
stored in a retrieval system or translated into any
human or computer language in any form by any means,
electronic, mechanical, manual or other-wise, or
disclosed to third parties without the express written
permission of Imagination Technologies Limited, HomePark
Industrial Estate, King's Langley, Hertfordshire,
WD4 8LZ, U.K.
Description : USE program for restoring the complex geometry state
information after a context switch
Program Type : USE assembly language
Version : $Revision: 1.10 $
Modifications :
$Log: cmplxstaterestore.asm $
*****************************************************************************/
#include "usedefs.h"
.skipinvon;
#if defined(SGX_FEATURE_SLAVE_VDM_CONTEXT_SWITCH) && defined(SGX_FEATURE_MTE_STATE_FLUSH) && defined(SGX_FEATURE_COMPLEX_GEOMETRY_REV_2)
/* Set macro operations to only increment src2 */
smlsi #1,#1,#1,#1,#0,#0,#0,#0,#0,#0,#0;
#if defined(SGX_FEATURE_USE_UNLIMITED_PHASES)
/* No following phase. */
phas #0, #0, pixel, end, parallel;
#endif
/* Get the location of the memory structures as passed via PAs... */
MK_MEM_ACCESS_BPCACHE(ldad) pa0, [pa0, #DOFFSET(SGXMK_TA3D_CTL.sTARenderContext)], drc0;
wdf drc0;
MK_MEM_ACCESS(ldad) pa0, [pa0, #DOFFSET(SGXMKIF_HWRENDERCONTEXT.sMTEStateFlushDevAddr)], drc0;
wdf drc0;
/***************************************
Send the Complex Geometry MTE state information...
****************************************/
mov r0, #EURASIA_MTE_STATE_BUFFER_CMPLX_OFFSET;
iaddu32 r0, r0.low, pa0;
/* Copy the data from memory into PA regs... */
MK_MEM_ACCESS_BPCACHE(ldad.f4) pa0, [r0, #0++], drc1;
wdf drc1;
or pa3, pa3, #EURASIA_TAPDSSTATE_COMPLEXGEOM4_CTX_RESTORE;
/* Copy the data to the output buffer and then emit it... */
mov.rpt4 o0, pa0;
emitmtest.freep.end #0, #(EURASIA_MTEEMIT1_COMPLEX | EURASIA_MTEEMIT1_COMPLEX_PHASE1), #0;
#else
nop.end;
#endif
/*****************************************************************************
End of file (tastaterestore.asm)
*****************************************************************************/
|
Cubical/Algebra/Algebra.agda | FernandoLarrain/cubical | 1 | 13238 | {-# OPTIONS --safe #-}
module Cubical.Algebra.Algebra where
open import Cubical.Algebra.Algebra.Base public
open import Cubical.Algebra.Algebra.Properties public
|
test/Compiler/simple/TrailingImplicits.agda | cruhland/agda | 1,989 | 4025 | module TrailingImplicits where
-- see also https://lists.chalmers.se/pipermail/agda-dev/2015-January/000041.html
open import Common.IO
open import Common.Unit
open import Common.Nat
f : (m : Nat) {l : Nat} -> Nat
f zero {l = l} = l
f (suc y) = y
main : IO Unit
main = printNat (f 0 {1}) ,,
putStr "\n" ,,
printNat (f 30 {1})
|
cards/bn4/ModCards/134-D015 Default Full Synchro (0C).asm | RockmanEXEZone/MMBN-Mod-Card-Kit | 10 | 99723 | .include "defaults_mod.asm"
table_file_jp equ "exe4-utf8.tbl"
table_file_en equ "bn4-utf8.tbl"
game_code_len equ 3
game_code equ 0x4234574A // B4WJ
game_code_2 equ 0x42345745 // B4WE
game_code_3 equ 0x42345750 // B4WP
card_type equ 1
card_id equ 45
card_no equ "045"
card_sub equ "Mod Card 045"
card_sub_x equ 64
card_desc_len equ 2
card_desc_1 equ "Address 0C"
card_desc_2 equ "Default Full Synchro"
card_desc_3 equ ""
card_name_jp_full equ "デフォルトフルシンクロ"
card_name_jp_game equ "デフォルトフルシンクロ"
card_name_en_full equ "Default Full Synchro"
card_name_en_game equ "Default Full Synchro"
card_address equ "0C"
card_address_id equ 2
card_bug equ 0
card_wrote_en equ "Default Full Synchro"
card_wrote_jp equ "デフォルトフルシンクロ" |
programs/oeis/187/A187287.asm | jmorken/loda | 1 | 176228 | ; A187287: Number of 2-step one or two space at a time rook's tours on an n X n board summed over all starting positions.
; 0,8,36,80,140,216,308,416,540,680,836,1008,1196,1400,1620,1856,2108,2376,2660,2960,3276,3608,3956,4320,4700,5096,5508,5936,6380,6840,7316,7808,8316,8840,9380,9936,10508,11096,11700,12320,12956,13608,14276
mul $0,2
add $0,1
bin $0,2
trn $0,1
mov $1,$0
mul $1,4
|
libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sdcc_iy/esx_disk_stream_bytes.asm | jpoikela/z88dk | 640 | 3388 | ; void *esx_disk_stream_bytes(void *dst,uint16_t len)
SECTION code_esxdos
PUBLIC _esx_disk_stream_bytes
EXTERN asm_esx_disk_stream_bytes
_esx_disk_stream_bytes:
pop af
pop hl
pop de
push de
push hl
push af
jp asm_esx_disk_stream_bytes
|
data/pokemon/base_stats/gallade.asm | TastySnax12/pokecrystal16-493-plus | 2 | 177401 | <gh_stars>1-10
db 0 ; species ID placeholder
db 68, 125, 65, 80, 65, 115
; hp atk def spd sat sdf
db PSYCHIC, FIGHTING ; type
db 45 ; catch rate
db 233 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F0 ; gender ratio
db 100 ; unknown 1
db 20 ; step cycles to hatch
db 5 ; unknown 2
INCBIN "gfx/pokemon/gallade/front.dimensions"
db 0, 0, 0, 0 ; padding
db GROWTH_SLOW ; growth rate
dn EGG_INDETERMINATE, EGG_HUMANSHAPE ; egg groups
; tm/hm learnset
tmhm DYNAMICPUNCH, HEADBUTT, CURSE, TOXIC, ROCK_SMASH, PSYCH_UP, HIDDEN_POWER, SUNNY_DAY, SNORE, HYPER_BEAM, ICY_WIND, PROTECT, RAIN_DANCE, ENDURE, FRUSTRATION, EARTHQUAKE, RETURN, PSYCHIC_M, SHADOW_BALL, MUD_SLAP, DOUBLE_TEAM, ICE_PUNCH, SWAGGER, SLEEP_TALK, SWIFT, DEFENSE_CURL, THUNDERPUNCH, DREAM_EATER, DETECT, REST, ATTRACT, THIEF, FIRE_PUNCH, FURY_CUTTER, NIGHTMARE, CUT, STRENGTH, FLASH, THUNDERBOLT
; end
|
Driver/Font/Nimbus/nimbus.asm | steakknife/pcgeos | 504 | 104281 | <filename>Driver/Font/Nimbus/nimbus.asm
COMMENT @----------------------------------------------------------------------
Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Font Driver
FILE: nimbus.asm
AUTHOR: <NAME>
REVISION HISTORY:
Name Date Description
---- ---- -----------
Gene 11/03/89 Initial revision
DESCRIPTION:
This file implements a font driver using Nimbus-Q.
$Id: nimbus.asm,v 1.1 97/04/18 11:45:30 newdeal Exp $
------------------------------------------------------------------------------@
;------------------------------------------------------------------------------
; System Definition
;------------------------------------------------------------------------------
_Driver = 1
_FontDriver = 1
;------------------------------------------------------------------------------
; Include files
;------------------------------------------------------------------------------
include geos.def
include heap.def
include geode.def
include resource.def
include ec.def
include driver.def
include graphics.def
include gstring.def
include sem.def
include file.def
include lmem.def
include font.def
include localize.def
include char.def
include system.def
DefDriver Internal/fontDr.def
include Internal/tmatrix.def
include Internal/grWinInt.def
include Internal/gstate.def
include Internal/window.def
include Internal/threadIn.def
; Font Driver specific include files
;
include nimbusConstant.def ; constants used for font driver
include nimbusVariable.def ; Variables
idata segment
; Driver information table
;
DriverTable FontDriverInfoStruct <
<NimbusStrategy, <>, DRIVER_TYPE_FONT>,
FM_NIMBUSQ ; FDIS_maker
>
ForceRef DriverTable
idata ends
include nimbusMacros.def
WidthMod segment resource
include nimbusWidths.asm
include nimbusUtils.asm
include nimbusSetTrans.asm
include fontcomUtils.asm
WidthMod ends
CharMod segment resource
include nimbusChars.asm
include nimbusRegions.asm
include nimbusLoadFont.asm
include nimbusBig.asm
include nimbusBitmap.asm
NimbusStart label near
include nimbusMakechar.asm
include nimbusSegments.asm
include nimbusTrans.asm
include nimbusMul.asm
include nimbusContinuity.asm
AA_NIMBUS_SIZE equ $-NimbusStart
CharMod ends
MetricsMod segment resource
include nimbusMetrics.asm
include nimbusPath.asm
MetricsMod ends
InitMod segment resource
include nimbusInit.asm
include nimbusEscape.asm
include fontcomEscape.asm
InitMod ends
include nimbusEC.asm
Resident segment resource ;MODULE_FIXED
COMMENT }----------------------------------------------------------------------
FUNCTION: NimbusStrategy
DESCRIPTION: Entry point for driver. All access to devices performed
through this function
CALLED BY: EXTERNAL
PASS:
di - one of the following function codes:
Function # routine called Function
---------- -------------- --------
DR_INIT NimbusInit initialize
DR_EXIT NimbusExit exit
DR_FONT_GEN_CHAR NimbusGenChar generate one char
DR_FONT_GEN_WIDTHS NimbusGenWidths generate char widths
DR_FONT_CHAR_METRICS NimbusCharMetrics return character metrics
DR_FONT_INIT_FONTS NimbusInitFonts init non-GEOS fonts
DR_FONT_GEN_PATH NimbusGenPath generate outline path
DR_FONT_GEN_IN_REGION NimbusGenInRegion gen in passed region
RETURN:
depends on function called
carry - set if error
DESTROYED:
depends on function called
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
Calls routine from jump table
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Gene 5/89 modified for font driver
------------------------------------------------------------------------------}
EC <inDriverFlag byte 0 >
NimbusStrategy proc far
EC < tst cs:[inDriverFlag] >
EC < ERROR_NZ RECURSIVE_CALL_TO_FONT_DRIVER >
EC < inc cs:[inDriverFlag] >
tst di ;escape function (>=0x8000) ?
js escapeFunction ;branch if escape function
push bx
EC < cmp di, (size offTable) ;>
EC < ERROR_AE FONT_BAD_ROUTINE ;>
mov ax, cs:offTable[di] ;ax <- addr of routine in module
mov bx, cs:hanTable[di] ;bx <- handle of module
pop di ;pass old bx in di
tst bx ; function supported?
jz ignoreCall ; => no (carry clear)
call ProcCallModuleRoutine
callComplete:
EC < mov cs:[inDriverFlag],0 >
done:
EC < call ECNukeVariableBlock ;>
ret
ignoreCall:
mov bx, di
jmp callComplete
;
; The function is an escape function, so we deal with it specially
;
escapeFunction:
call NimbusFontEscape
jmp done
;----------------------------
NimbusStrategy endp
offTable nptr \
offset NimbusInit, ;DR_INIT
offset NimbusExit, ;DR_EXIT
0, ;DR_SUSPEND
0, ;DR_UNSUSPEND
offset NimbusGenChar, ;DR_FONT_GEN_CHAR
offset NimbusGenWidths, ;DR_FONT_GEN_WIDTHS
offset NimbusCharMetrics, ;DR_FONT_CHAR_METRICS
offset NimbusInitFonts, ;DR_FONT_INIT_FONTS
offset NimbusGenPath, ;DR_FONT_GEN_PATH
offset NimbusGenInRegion ;DR_FONT_GEN_IN_REGION
hanTable hptr \
handle InitMod, ;DR_INIT
handle InitMod, ;DR_EXIT
0, ;DR_SUSPEND
0, ;DR_UNSUSPEND
handle CharMod, ;DR_FONT_GEN_CHAR
handle WidthMod, ;DR_FONT_GEN_WIDTHS
handle MetricsMod, ;DR_FONT_CHAR_METRICS
handle InitMod, ;DR_FONT_INIT_FONTS
handle MetricsMod, ;DR_FONT_GEN_PATH
handle MetricsMod ;DR_FONT_GEN_IN_REGION
CheckHack <(length offTable) eq (length hanTable)>
Resident ends
end
|
FoldingText.lbaction/Contents/Scripts/notetag.scpt | raguay/MyLaunchBarActions | 29 | 1303 | property pTitle : "Add Message to any tag"
property pVer : "0.1"
property pAuthor : "<NAME>"
property pDescription : "
1. Looks for a node with the given tag,
2. add the message given to that point
"
property addMessage : "
function(editor, options) {
var tree=editor.tree(), q = options.toString().trim().split('|'), result='';
var tag = q[0], q = q[1];
var tnode=editor.tree().evaluateNodePath('//@'+tag)[0];
if(tnode) {
var message = tree.createNode(q);
tnode.appendChild(message);
} else {
result = 'No ' + tag + ' Found.';
}
return(result);
}
"
on run argv
tell application "FoldingText"
set lstDocs to documents
if lstDocs ≠ {} then
tell item 1 of lstDocs
return evaluate script addMessage with options { item 1 in argv }
end tell
end if
end tell
end run
|
libsrc/alloc/malloc-classic/HeapCreate.asm | jpoikela/z88dk | 640 | 166181 | <reponame>jpoikela/z88dk
; void __FASTCALL__ HeapCreate(void *heap)
; 12.2006 aralbrec
SECTION code_clib
PUBLIC HeapCreate
PUBLIC _HeapCreate
EXTERN l_setmem
; Just zero heap pointer to indicate empty heap.
;
; enter : hl = heap pointer
; uses : af, hl
.HeapCreate
._HeapCreate
xor a
jp l_setmem - 7 ; four bytes: 2*4-1
|
src/Categories/Pseudofunctor/Hom.agda | maxsnew/agda-categories | 0 | 5520 | <reponame>maxsnew/agda-categories<filename>src/Categories/Pseudofunctor/Hom.agda
{-# OPTIONS --without-K --safe #-}
open import Categories.Bicategory
-- The two Hom 2-functors from (op C) and C to Cats.
module Categories.Pseudofunctor.Hom {o ℓ e t} (C : Bicategory o ℓ e t) where
open import Data.Product using (_,_)
import Categories.Bicategory.Extras as BicategoryExtras
open import Categories.Bicategory.Opposite using (op)
open import Categories.Bicategory.Instance.Cats using (Cats)
import Categories.Category.Construction.Core as Core
open import Categories.Functor.Bifunctor.Properties
open import Categories.Pseudofunctor using (Pseudofunctor)
import Categories.Morphism.Reasoning as MorphismReasoning
import Categories.Morphism as Morphism
open import Categories.NaturalTransformation using (ntHelper)
open import Categories.NaturalTransformation.NaturalIsomorphism
using (niHelper)
open BicategoryExtras C
open Shorthands
open hom.HomReasoning
private
module MR {A} {B} where
open Core.Shorthands (hom A B) public
open MorphismReasoning (hom A B) public
open MR
-- The left and right hom-pseudofunctors for a given bicategory.
--
-- Note that these are *not* simply partial applications of a single
-- *binary* hom-pseudofunctor because pre-/post-composition with
-- identity 1-cells in bicategories is only weakly unitary, i.e. the
-- partial applications Hom[ id , f ] and Hom[ g , id ] would send a
-- 1-cell h to (id ∘ h ∘ f) and (g ∘ h ∘ id) which are isomorphic but
-- not strictly equal to (h ∘ f) and (g ∘ h).
-- The right hom-pseudofunctor (post-composition)
Hom[_,-] : Obj → Pseudofunctor C (Cats o ℓ e)
Hom[ A ,-] = record
{ P₀ = hom A
; P₁ = [-]⊚-
-- A curried version of the left unitor
; P-identity = niHelper (record
{ η = λ _ → ntHelper (record
{ η = λ f → unitˡ.⇐.η (_ , f)
; commute = λ _ → ⟺ ▷-∘ᵥ-λ⇐
})
; η⁻¹ = λ _ → ntHelper (record
{ η = λ f → unitˡ.⇒.η (_ , f)
; commute = λ _ → λ⇒-∘ᵥ-▷
})
; commute = λ _ → unitˡ.⇐.commute (_ , hom.id)
; iso = λ _ → record
{ isoˡ = λ {f} → unitˡ.iso.isoʳ (_ , f)
; isoʳ = λ {f} → unitˡ.iso.isoˡ (_ , f)
}
})
-- A curried version of the associator
; P-homomorphism = niHelper (record
{ η = λ{ (f , g) → ntHelper (record
{ η = λ h → ⊚-assoc.⇐.η ((f , g) , h)
; commute = λ _ → α⇐-▷-∘₁
}) }
; η⁻¹ = λ{ (f , g) → ntHelper (record
{ η = λ h → ⊚-assoc.⇒.η ((f , g) , h)
; commute = λ _ → α⇒-▷-∘₁
}) }
; commute = λ{ {f₁ , g₁} {f₂ , g₂} (β , γ) {h} → begin
α⇐ ∘ᵥ f₂ ▷ (γ ◁ h) ∘ᵥ β ◁ (g₁ ⊚₀ h)
≈˘⟨ refl⟩∘⟨ [ ⊚ ]-decompose₂ ⟩
α⇐ ∘ᵥ β ⊚₁ (γ ◁ h)
≈⟨ ⊚-assoc.⇐.commute ((β , γ) , id₂) ⟩
(β ⊚₁ γ) ◁ h ∘ᵥ α⇐
∎ }
; iso = λ{ (f , g) → record
{ isoˡ = λ {h} → ⊚-assoc.iso.isoʳ ((f , g) , h)
; isoʳ = λ {h} → ⊚-assoc.iso.isoˡ ((f , g) , h) }
}
})
; unitaryˡ = λ {_ _ f g} → begin
λ⇒ ◁ g ∘ᵥ α⇐ ∘ᵥ (id₂ ◁ (f ⊚₀ g)) ∘ᵥ λ⇐
≈⟨ refl⟩∘⟨ refl⟩∘⟨ ⊚.identity ⟩∘⟨refl ⟩
λ⇒ ◁ g ∘ᵥ α⇐ ∘ᵥ id₂ ∘ᵥ λ⇐ ≈⟨ unitorˡ-coherence ⟩∘⟨ refl⟩∘⟨ hom.identityˡ ⟩
(λ⇒ ∘ᵥ α⇒) ∘ᵥ α⇐ ∘ᵥ λ⇐ ≈⟨ isoʳ (unitorˡ ∘ᵢ associator) ⟩
id₂ ∎
; unitaryʳ = λ {_ _ f g} → begin
ρ⇒ ◁ g ∘ᵥ α⇐ ∘ᵥ f ▷ λ⇐ ∘ᵥ id₂
≈⟨ pushʳ (refl⟩∘⟨ hom.identityʳ) ⟩
(ρ⇒ ◁ g ∘ᵥ α⇐) ∘ᵥ f ▷ λ⇐
≈˘⟨ switch-tofromʳ (associator ⁻¹) triangle ⟩∘⟨refl ⟩
f ▷ λ⇒ ∘ᵥ f ▷ λ⇐
≈⟨ isoʳ (f ▷ᵢ unitorˡ) ⟩
id₂
∎
; assoc = λ {_ _ _ _ f g h e} → begin
α⇒ ◁ e ∘ᵥ α⇐ ∘ᵥ (id₂ ⊚₁ id₂) ∘ᵥ α⇐
≈⟨ refl⟩∘⟨ refl⟩∘⟨ ⊚.identity ⟩∘⟨refl ⟩
α⇒ ◁ e ∘ᵥ α⇐ ∘ᵥ id₂ ∘ᵥ α⇐
≈⟨ refl⟩∘⟨ refl⟩∘⟨ hom.identityˡ ⟩
α⇒ ◁ e ∘ᵥ α⇐ ∘ᵥ α⇐
≈˘⟨ switch-fromtoˡ ((associator ◁ᵢ e) ⁻¹)
(hom.sym-assoc ○ pentagon-inv) ⟩
α⇐ ∘ᵥ h ▷ α⇐
≈˘⟨ pushʳ hom.identityʳ ○ hom.identityʳ ⟩
α⇐ ∘ᵥ (h ▷ α⇐ ∘ᵥ id₂) ∘ᵥ id₂
∎
}
-- The left hom-pseudofunctor (pre-composition)
Hom[-,_] : Obj → Pseudofunctor (op C) (Cats o ℓ e)
Hom[-, B ] = record
{ P₀ = λ A → hom A B
; P₁ = -⊚[-]
-- A curried version of the right unitor
; P-identity = niHelper (record
{ η = λ _ → ntHelper (record
{ η = λ f → unitʳ.⇐.η (f , _)
; commute = λ _ → ⟺ ◁-∘ᵥ-ρ⇐
})
; η⁻¹ = λ _ → ntHelper (record
{ η = λ f → unitʳ.⇒.η (f , _)
; commute = λ _ → ρ⇒-∘ᵥ-◁
})
; commute = λ _ → unitʳ.⇐.commute (hom.id , _)
; iso = λ _ → record
{ isoˡ = λ {f} → unitʳ.iso.isoʳ (f , _)
; isoʳ = λ {f} → unitʳ.iso.isoˡ (f , _)
}
})
-- A curried version of the associator
; P-homomorphism = niHelper (record
{ η = λ{ (f , g) → ntHelper (record
{ η = λ h → ⊚-assoc.⇒.η ((h , g) , f)
; commute = λ _ → α⇒-◁-∘₁
}) }
; η⁻¹ = λ{ (f , g) → ntHelper (record
{ η = λ h → ⊚-assoc.⇐.η ((h , g) , f)
; commute = λ _ → α⇐-◁-∘₁
}) }
; commute = λ{ {f₁ , g₁} {f₂ , g₂} (β , γ) {h} → begin
α⇒ ∘ᵥ (h ▷ γ) ◁ f₂ ∘ᵥ (h ⊚₀ g₁) ▷ β
≈˘⟨ refl⟩∘⟨ [ ⊚ ]-decompose₁ ⟩
α⇒ ∘ᵥ (h ▷ γ) ⊚₁ β
≈⟨ ⊚-assoc.⇒.commute ((id₂ , γ) , β) ⟩
h ▷ (γ ⊚₁ β) ∘ᵥ α⇒
∎ }
; iso = λ{ (f , g) → record
{ isoˡ = λ {h} → ⊚-assoc.iso.isoˡ ((h , g) , f)
; isoʳ = λ {h} → ⊚-assoc.iso.isoʳ ((h , g) , f) }
}
})
; unitaryˡ = λ {_ _ f g} → begin
g ▷ ρ⇒ ∘ᵥ α⇒ ∘ᵥ ((g ⊚₀ f) ▷ id₂) ∘ᵥ ρ⇐
≈⟨ pushʳ (refl⟩∘⟨ ⊚.identity ⟩∘⟨refl) ⟩
(g ▷ ρ⇒ ∘ᵥ α⇒) ∘ᵥ id₂ ∘ᵥ ρ⇐ ≈⟨ ⟺ unitorʳ-coherence ⟩∘⟨ hom.identityˡ ⟩
ρ⇒ ∘ᵥ ρ⇐ ≈⟨ isoʳ unitorʳ ⟩
id₂ ∎
; unitaryʳ = λ {_ _ f g} → begin
g ▷ λ⇒ ∘ᵥ α⇒ ∘ᵥ ρ⇐ ◁ f ∘ᵥ id₂
≈⟨ pushʳ (refl⟩∘⟨ hom.identityʳ) ⟩
(g ▷ λ⇒ ∘ᵥ α⇒) ∘ᵥ ρ⇐ ◁ f
≈⟨ triangle ⟩∘⟨refl ⟩
ρ⇒ ◁ f ∘ᵥ ρ⇐ ◁ f
≈⟨ isoʳ (unitorʳ ◁ᵢ f) ⟩
id₂
∎
; assoc = λ {_ _ _ _ f g h e} → begin
e ▷ α⇐ ∘ᵥ α⇒ ∘ᵥ (id₂ ⊚₁ id₂) ∘ᵥ α⇒
≈⟨ refl⟩∘⟨ refl⟩∘⟨ ⊚.identity ⟩∘⟨refl ⟩
e ▷ α⇐ ∘ᵥ α⇒ ∘ᵥ id₂ ∘ᵥ α⇒
≈⟨ refl⟩∘⟨ refl⟩∘⟨ hom.identityˡ ⟩
e ▷ α⇐ ∘ᵥ α⇒ ∘ᵥ α⇒
≈˘⟨ switch-fromtoˡ (e ▷ᵢ associator) pentagon ⟩
α⇒ ∘ᵥ α⇒ ◁ h
≈˘⟨ pushʳ hom.identityʳ ○ hom.identityʳ ⟩
α⇒ ∘ᵥ (α⇒ ◁ h ∘ᵥ id₂) ∘ᵥ id₂
∎
}
|
oeis/015/A015570.asm | neoneye/loda-programs | 11 | 385 | ; A015570: Expansion of x/(1 - 7*x - 11*x^2).
; Submitted by <NAME>(s4)
; 0,1,7,60,497,4139,34440,286609,2385103,19848420,165175073,1374558131,11438832720,95191968481,792170939287,6592308228300,54860037930257,456535656023099,3799210009394520,31616362282015729,263105846077449823,2189520907644321780,18220810660362200513,151630404606622943171,1261841749510344807840,10500826697245266029761,87386046125330655094567,727211416547012511989340,6051726423207724789965617,50361410544471211161642059,419098864466583450821116200,3487667567255267478525876049
mov $1,1
lpb $0
sub $0,1
mov $2,$3
mul $2,21
mul $3,2
add $3,$1
mul $1,5
add $1,$2
lpe
mov $0,$3
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_775.asm | ljhsiun2/medusa | 9 | 16449 | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r8
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x21bc, %rsi
lea addresses_D_ht+0x18df8, %rdi
nop
nop
sub $49593, %r13
mov $17, %rcx
rep movsw
nop
nop
nop
nop
nop
sub $14848, %rcx
lea addresses_A_ht+0xb3bc, %rbx
nop
nop
nop
nop
nop
and %r9, %r9
movl $0x61626364, (%rbx)
nop
nop
xor $42335, %rbx
lea addresses_WC_ht+0x1e78c, %r13
nop
inc %r8
mov (%r13), %rdi
nop
nop
nop
inc %rdi
lea addresses_D_ht+0x15ccc, %rdi
clflush (%rdi)
nop
nop
nop
xor $42320, %rbx
movl $0x61626364, (%rdi)
nop
and %rsi, %rsi
lea addresses_WT_ht+0x19aac, %rsi
lea addresses_A_ht+0xc05c, %rdi
nop
nop
inc %rax
mov $8, %rcx
rep movsb
nop
nop
nop
xor %r8, %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r15
push %r8
push %rbp
push %rbx
// Store
lea addresses_PSE+0x2bcc, %r8
nop
nop
lfence
mov $0x5152535455565758, %r14
movq %r14, (%r8)
nop
nop
nop
cmp $51625, %rbp
// Faulty Load
lea addresses_WC+0xd36c, %r13
nop
nop
nop
nop
sub $2788, %rbx
mov (%r13), %r14w
lea oracles, %r8
and $0xff, %r14
shlq $12, %r14
mov (%r8,%r14,1), %r14
pop %rbx
pop %rbp
pop %r8
pop %r15
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_PSE'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}}
{'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
*/
|
examples/test_2.adb | ray2501/ada-adapcre | 0 | 6280 | <gh_stars>0
--
-- Basic test : compiling a pattern and finding the first match if any
-- Syntax : test_2 pattern subject
--
with Ada.Text_IO; use Ada.Text_IO;
with AdaPcre; use AdaPcre;
with Ada.Command_Line; use Ada.Command_Line;
procedure Test_2 is
Regexp : Pcre_Type;
Extra : Extra_type;
Msg : Message;
Last_Msg, ErrPos : Natural := 0;
Result : Match_Array (0 .. 30);
Retcode : Integer;
begin
if (Argument_Count = 1 and then Argument (1) = "-h") then
Put_Line ("A demo for the PCRE library.");
Put_Line ("Syntax : test_2 pattern subject");
return;
elsif (Argument_Count /= 2) then
Put_Line ("Wrong Argument count :" & Integer'Image (Argument_Count));
Put_Line ("Syntax : test_2 pattern subject");
return;
else
null;
end if;
declare
Pattern : constant String := Argument (1);
Subject : constant String := Argument (2);
begin
-- Now we are going to compile the regular expression pattern, and handle
-- errors that are detected.
Compile
(Matcher => Regexp,
Pattern => Pattern,
Error_Msg => Msg,
Last_Msg => Last_Msg,
Error_Offset => ErrPos);
-- Compilation failed: print the error message and exit
if Regexp = Null_Pcre then
Put_Line
("PCRE compilation failed at position " &
Pattern (Pattern'First + ErrPos .. Pattern'Last));
Put_Line (Msg (1 .. Last_Msg));
return;
end if;
Study (Extra, Regexp, Msg, Last_Msg);
-- Study failed: print the error message and exit
if Extra = Null_Extra and then Last_Msg > 0 then
Put ("PCRE study failed :");
Put_Line (Msg (1 .. Last_Msg));
Free (Regexp);
return;
end if;
Match (Retcode, Result, Regexp, Extra, Subject, Subject'Length);
if Retcode < 0 then
if Retcode = PCRE_ERROR_NOMATCH then
Put_Line ("No match");
else
Put_Line ("Matching error :" & Integer'Image (Retcode));
end if;
else
Put_Line ("Return code for pcre_match :" & Natural'Image (Retcode));
for I in 0 .. Retcode - 1 loop
Put
("Match succeeded at offsets " &
Integer'Image (Result (2 * I)) &
" and " &
Integer'Image (Result (2 * I + 1)));
Put_Line
("<" &
Subject (Result (2 * I) + 1 .. Result (2 * I + 1)) &
">");
end loop;
Put_Line ("Remember : position := subject'first + offset;");
end if;
end;
Free (Extra);
Free (Regexp);
end Test_2;
|
src/hershey_fonts/giza-hershey_fonts-markers.ads | Fabien-Chouteau/Giza | 7 | 7492 | <filename>src/hershey_fonts/giza-hershey_fonts-markers.ads
package Giza.Hershey_Fonts.Markers is
Font : constant Giza.Font.Ref_Const;
private
Glyph_0 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_1 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_2 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_3 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_4 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_5 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_6 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_7 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_8 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_9 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_10 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_11 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_12 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_13 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_14 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_15 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_16 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_17 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_18 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_19 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_20 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_21 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_22 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_23 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_24 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_25 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_26 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_27 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_28 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_29 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_30 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_31 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_32 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_33 : aliased constant Glyph :=
(Number_Of_Vectors => 18,
Width => 14,
Height => 14,
Y_Offset => -7,
X_Offset => -7,
Vects => (Raise_Pen,
(-1, -7),
(-4, -6),
(-6, -4),
(-7, -1),
(-7, 1),
(-6, 4),
(-4, 6),
(-1, 7),
(1, 7),
(4, 6),
(6, 4),
(7, 1),
(7, -1),
(6, -4),
(4, -6),
(1, -7),
(-1, -7)));
Glyph_34 : aliased constant Glyph :=
(Number_Of_Vectors => 6,
Width => 12,
Height => 12,
Y_Offset => -6,
X_Offset => -6,
Vects => (Raise_Pen,
(-6, -6),
(-6, 6),
(6, 6),
(6, -6),
(-6, -6)));
Glyph_35 : aliased constant Glyph :=
(Number_Of_Vectors => 5,
Width => 14,
Height => 12,
Y_Offset => -8,
X_Offset => -7,
Vects => (Raise_Pen,
(0, -8),
(-7, 4),
(7, 4),
(0, -8)));
Glyph_36 : aliased constant Glyph :=
(Number_Of_Vectors => 6,
Width => 12,
Height => 20,
Y_Offset => -10,
X_Offset => -6,
Vects => (Raise_Pen,
(0, -10),
(-6, 0),
(0, 10),
(6, 0),
(0, -10)));
Glyph_37 : aliased constant Glyph :=
(Number_Of_Vectors => 12,
Width => 16,
Height => 16,
Y_Offset => -9,
X_Offset => -8,
Vects => (Raise_Pen,
(0, -9),
(-2, -3),
(-8, -3),
(-3, 1),
(-5, 7),
(0, 3),
(5, 7),
(3, 1),
(8, -3),
(2, -3),
(0, -9)));
Glyph_38 : aliased constant Glyph :=
(Number_Of_Vectors => 14,
Width => 12,
Height => 12,
Y_Offset => -6,
X_Offset => -6,
Vects => (Raise_Pen,
(-2, -6),
(-2, -2),
(-6, -2),
(-6, 2),
(-2, 2),
(-2, 6),
(2, 6),
(2, 2),
(6, 2),
(6, -2),
(2, -2),
(2, -6),
(-2, -6)));
Glyph_39 : aliased constant Glyph :=
(Number_Of_Vectors => 6,
Width => 14,
Height => 14,
Y_Offset => -7,
X_Offset => -7,
Vects => (Raise_Pen,
(0, -7),
(0, 7),
Raise_Pen,
(-7, 0),
(7, 0)));
Glyph_40 : aliased constant Glyph :=
(Number_Of_Vectors => 6,
Width => 10,
Height => 10,
Y_Offset => -5,
X_Offset => -5,
Vects => (Raise_Pen,
(-5, -5),
(5, 5),
Raise_Pen,
(5, -5),
(-5, 5)));
Glyph_41 : aliased constant Glyph :=
(Number_Of_Vectors => 9,
Width => 10,
Height => 12,
Y_Offset => -6,
X_Offset => -5,
Vects => (Raise_Pen,
(0, -6),
(0, 6),
Raise_Pen,
(-5, -3),
(5, 3),
Raise_Pen,
(5, -3),
(-5, 3)));
Glyph_42 : aliased constant Glyph :=
(Number_Of_Vectors => 35,
Width => 8,
Height => 8,
Y_Offset => -4,
X_Offset => -4,
Vects => (Raise_Pen,
(-1, -4),
(-3, -3),
(-4, -1),
(-4, 1),
(-3, 3),
(-1, 4),
(1, 4),
(3, 3),
(4, 1),
(4, -1),
(3, -3),
(1, -4),
(-1, -4),
Raise_Pen,
(-3, -1),
(-3, 1),
Raise_Pen,
(-2, -2),
(-2, 2),
Raise_Pen,
(-1, -3),
(-1, 3),
Raise_Pen,
(0, -3),
(0, 3),
Raise_Pen,
(1, -3),
(1, 3),
Raise_Pen,
(2, -2),
(2, 2),
Raise_Pen,
(3, -1),
(3, 1)));
Glyph_43 : aliased constant Glyph :=
(Number_Of_Vectors => 27,
Width => 8,
Height => 8,
Y_Offset => -4,
X_Offset => -4,
Vects => (Raise_Pen,
(-4, -4),
(-4, 4),
(4, 4),
(4, -4),
(-4, -4),
Raise_Pen,
(-3, -3),
(-3, 3),
Raise_Pen,
(-2, -3),
(-2, 3),
Raise_Pen,
(-1, -3),
(-1, 3),
Raise_Pen,
(0, -3),
(0, 3),
Raise_Pen,
(1, -3),
(1, 3),
Raise_Pen,
(2, -3),
(2, 3),
Raise_Pen,
(3, -3),
(3, 3)));
Glyph_44 : aliased constant Glyph :=
(Number_Of_Vectors => 17,
Width => 10,
Height => 9,
Y_Offset => -6,
X_Offset => -5,
Vects => (Raise_Pen,
(0, -6),
(-5, 3),
(5, 3),
(0, -6),
Raise_Pen,
(0, -3),
(-3, 2),
Raise_Pen,
(0, -3),
(3, 2),
Raise_Pen,
(0, 0),
(-1, 2),
Raise_Pen,
(0, 0),
(1, 2)));
Glyph_45 : aliased constant Glyph :=
(Number_Of_Vectors => 17,
Width => 9,
Height => 10,
Y_Offset => -5,
X_Offset => -6,
Vects => (Raise_Pen,
(-6, 0),
(3, 5),
(3, -5),
(-6, 0),
Raise_Pen,
(-3, 0),
(2, 3),
Raise_Pen,
(-3, 0),
(2, -3),
Raise_Pen,
(0, 0),
(2, 1),
Raise_Pen,
(0, 0),
(2, -1)));
Glyph_46 : aliased constant Glyph :=
(Number_Of_Vectors => 17,
Width => 10,
Height => 9,
Y_Offset => -3,
X_Offset => -5,
Vects => (Raise_Pen,
(0, 6),
(5, -3),
(-5, -3),
(0, 6),
Raise_Pen,
(0, 3),
(3, -2),
Raise_Pen,
(0, 3),
(-3, -2),
Raise_Pen,
(0, 0),
(1, -2),
Raise_Pen,
(0, 0),
(-1, -2)));
Glyph_47 : aliased constant Glyph :=
(Number_Of_Vectors => 17,
Width => 9,
Height => 10,
Y_Offset => -5,
X_Offset => -3,
Vects => (Raise_Pen,
(6, 0),
(-3, -5),
(-3, 5),
(6, 0),
Raise_Pen,
(3, 0),
(-2, -3),
Raise_Pen,
(3, 0),
(-2, 3),
Raise_Pen,
(0, 0),
(-2, -1),
Raise_Pen,
(0, 0),
(-2, 1)));
Glyph_48 : aliased constant Glyph :=
(Number_Of_Vectors => 9,
Width => 28,
Height => 16,
Y_Offset => 0,
X_Offset => -14,
Vects => (Raise_Pen,
(-14, 0),
(14, 0),
Raise_Pen,
(-14, 0),
(0, 16),
Raise_Pen,
(14, 0),
(0, 16)));
Glyph_49 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_50 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_51 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_52 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_53 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_54 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_55 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_56 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_57 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_58 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_59 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_60 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_61 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_62 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_63 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_64 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_65 : aliased constant Glyph :=
(Number_Of_Vectors => 18,
Width => 14,
Height => 14,
Y_Offset => -7,
X_Offset => -7,
Vects => (Raise_Pen,
(-1, -7),
(-4, -6),
(-6, -4),
(-7, -1),
(-7, 1),
(-6, 4),
(-4, 6),
(-1, 7),
(1, 7),
(4, 6),
(6, 4),
(7, 1),
(7, -1),
(6, -4),
(4, -6),
(1, -7),
(-1, -7)));
Glyph_66 : aliased constant Glyph :=
(Number_Of_Vectors => 6,
Width => 12,
Height => 12,
Y_Offset => -6,
X_Offset => -6,
Vects => (Raise_Pen,
(-6, -6),
(-6, 6),
(6, 6),
(6, -6),
(-6, -6)));
Glyph_67 : aliased constant Glyph :=
(Number_Of_Vectors => 5,
Width => 14,
Height => 12,
Y_Offset => -8,
X_Offset => -7,
Vects => (Raise_Pen,
(0, -8),
(-7, 4),
(7, 4),
(0, -8)));
Glyph_68 : aliased constant Glyph :=
(Number_Of_Vectors => 6,
Width => 12,
Height => 20,
Y_Offset => -10,
X_Offset => -6,
Vects => (Raise_Pen,
(0, -10),
(-6, 0),
(0, 10),
(6, 0),
(0, -10)));
Glyph_69 : aliased constant Glyph :=
(Number_Of_Vectors => 12,
Width => 16,
Height => 16,
Y_Offset => -9,
X_Offset => -8,
Vects => (Raise_Pen,
(0, -9),
(-2, -3),
(-8, -3),
(-3, 1),
(-5, 7),
(0, 3),
(5, 7),
(3, 1),
(8, -3),
(2, -3),
(0, -9)));
Glyph_70 : aliased constant Glyph :=
(Number_Of_Vectors => 14,
Width => 12,
Height => 12,
Y_Offset => -6,
X_Offset => -6,
Vects => (Raise_Pen,
(-2, -6),
(-2, -2),
(-6, -2),
(-6, 2),
(-2, 2),
(-2, 6),
(2, 6),
(2, 2),
(6, 2),
(6, -2),
(2, -2),
(2, -6),
(-2, -6)));
Glyph_71 : aliased constant Glyph :=
(Number_Of_Vectors => 6,
Width => 14,
Height => 14,
Y_Offset => -7,
X_Offset => -7,
Vects => (Raise_Pen,
(0, -7),
(0, 7),
Raise_Pen,
(-7, 0),
(7, 0)));
Glyph_72 : aliased constant Glyph :=
(Number_Of_Vectors => 6,
Width => 10,
Height => 10,
Y_Offset => -5,
X_Offset => -5,
Vects => (Raise_Pen,
(-5, -5),
(5, 5),
Raise_Pen,
(5, -5),
(-5, 5)));
Glyph_73 : aliased constant Glyph :=
(Number_Of_Vectors => 9,
Width => 10,
Height => 12,
Y_Offset => -6,
X_Offset => -5,
Vects => (Raise_Pen,
(0, -6),
(0, 6),
Raise_Pen,
(-5, -3),
(5, 3),
Raise_Pen,
(5, -3),
(-5, 3)));
Glyph_74 : aliased constant Glyph :=
(Number_Of_Vectors => 35,
Width => 8,
Height => 8,
Y_Offset => -4,
X_Offset => -4,
Vects => (Raise_Pen,
(-1, -4),
(-3, -3),
(-4, -1),
(-4, 1),
(-3, 3),
(-1, 4),
(1, 4),
(3, 3),
(4, 1),
(4, -1),
(3, -3),
(1, -4),
(-1, -4),
Raise_Pen,
(-3, -1),
(-3, 1),
Raise_Pen,
(-2, -2),
(-2, 2),
Raise_Pen,
(-1, -3),
(-1, 3),
Raise_Pen,
(0, -3),
(0, 3),
Raise_Pen,
(1, -3),
(1, 3),
Raise_Pen,
(2, -2),
(2, 2),
Raise_Pen,
(3, -1),
(3, 1)));
Glyph_75 : aliased constant Glyph :=
(Number_Of_Vectors => 27,
Width => 8,
Height => 8,
Y_Offset => -4,
X_Offset => -4,
Vects => (Raise_Pen,
(-4, -4),
(-4, 4),
(4, 4),
(4, -4),
(-4, -4),
Raise_Pen,
(-3, -3),
(-3, 3),
Raise_Pen,
(-2, -3),
(-2, 3),
Raise_Pen,
(-1, -3),
(-1, 3),
Raise_Pen,
(0, -3),
(0, 3),
Raise_Pen,
(1, -3),
(1, 3),
Raise_Pen,
(2, -3),
(2, 3),
Raise_Pen,
(3, -3),
(3, 3)));
Glyph_76 : aliased constant Glyph :=
(Number_Of_Vectors => 17,
Width => 10,
Height => 9,
Y_Offset => -6,
X_Offset => -5,
Vects => (Raise_Pen,
(0, -6),
(-5, 3),
(5, 3),
(0, -6),
Raise_Pen,
(0, -3),
(-3, 2),
Raise_Pen,
(0, -3),
(3, 2),
Raise_Pen,
(0, 0),
(-1, 2),
Raise_Pen,
(0, 0),
(1, 2)));
Glyph_77 : aliased constant Glyph :=
(Number_Of_Vectors => 17,
Width => 9,
Height => 10,
Y_Offset => -5,
X_Offset => -6,
Vects => (Raise_Pen,
(-6, 0),
(3, 5),
(3, -5),
(-6, 0),
Raise_Pen,
(-3, 0),
(2, 3),
Raise_Pen,
(-3, 0),
(2, -3),
Raise_Pen,
(0, 0),
(2, 1),
Raise_Pen,
(0, 0),
(2, -1)));
Glyph_78 : aliased constant Glyph :=
(Number_Of_Vectors => 17,
Width => 10,
Height => 9,
Y_Offset => -3,
X_Offset => -5,
Vects => (Raise_Pen,
(0, 6),
(5, -3),
(-5, -3),
(0, 6),
Raise_Pen,
(0, 3),
(3, -2),
Raise_Pen,
(0, 3),
(-3, -2),
Raise_Pen,
(0, 0),
(1, -2),
Raise_Pen,
(0, 0),
(-1, -2)));
Glyph_79 : aliased constant Glyph :=
(Number_Of_Vectors => 17,
Width => 9,
Height => 10,
Y_Offset => -5,
X_Offset => -3,
Vects => (Raise_Pen,
(6, 0),
(-3, -5),
(-3, 5),
(6, 0),
Raise_Pen,
(3, 0),
(-2, -3),
Raise_Pen,
(3, 0),
(-2, 3),
Raise_Pen,
(0, 0),
(-2, -1),
Raise_Pen,
(0, 0),
(-2, 1)));
Glyph_80 : aliased constant Glyph :=
(Number_Of_Vectors => 9,
Width => 28,
Height => 16,
Y_Offset => 0,
X_Offset => -14,
Vects => (Raise_Pen,
(-14, 0),
(14, 0),
Raise_Pen,
(-14, 0),
(0, 16),
Raise_Pen,
(14, 0),
(0, 16)));
Glyph_81 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_82 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_83 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_84 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_85 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_86 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_87 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_88 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_89 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_90 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_91 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_92 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_93 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_94 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_95 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Glyph_96 : aliased constant Glyph :=
(Number_Of_Vectors => 0,
Width => 16,
Height => 0,
Y_Offset => 0,
X_Offset => -8,
Vects => (others => (Raise_Pen)));
Font_D : aliased constant Hershey_Font :=
(Number_Of_Glyphs => 97,
Glyphs =>
(
Glyph_0'Access,
Glyph_1'Access,
Glyph_2'Access,
Glyph_3'Access,
Glyph_4'Access,
Glyph_5'Access,
Glyph_6'Access,
Glyph_7'Access,
Glyph_8'Access,
Glyph_9'Access,
Glyph_10'Access,
Glyph_11'Access,
Glyph_12'Access,
Glyph_13'Access,
Glyph_14'Access,
Glyph_15'Access,
Glyph_16'Access,
Glyph_17'Access,
Glyph_18'Access,
Glyph_19'Access,
Glyph_20'Access,
Glyph_21'Access,
Glyph_22'Access,
Glyph_23'Access,
Glyph_24'Access,
Glyph_25'Access,
Glyph_26'Access,
Glyph_27'Access,
Glyph_28'Access,
Glyph_29'Access,
Glyph_30'Access,
Glyph_31'Access,
Glyph_32'Access,
Glyph_33'Access,
Glyph_34'Access,
Glyph_35'Access,
Glyph_36'Access,
Glyph_37'Access,
Glyph_38'Access,
Glyph_39'Access,
Glyph_40'Access,
Glyph_41'Access,
Glyph_42'Access,
Glyph_43'Access,
Glyph_44'Access,
Glyph_45'Access,
Glyph_46'Access,
Glyph_47'Access,
Glyph_48'Access,
Glyph_49'Access,
Glyph_50'Access,
Glyph_51'Access,
Glyph_52'Access,
Glyph_53'Access,
Glyph_54'Access,
Glyph_55'Access,
Glyph_56'Access,
Glyph_57'Access,
Glyph_58'Access,
Glyph_59'Access,
Glyph_60'Access,
Glyph_61'Access,
Glyph_62'Access,
Glyph_63'Access,
Glyph_64'Access,
Glyph_65'Access,
Glyph_66'Access,
Glyph_67'Access,
Glyph_68'Access,
Glyph_69'Access,
Glyph_70'Access,
Glyph_71'Access,
Glyph_72'Access,
Glyph_73'Access,
Glyph_74'Access,
Glyph_75'Access,
Glyph_76'Access,
Glyph_77'Access,
Glyph_78'Access,
Glyph_79'Access,
Glyph_80'Access,
Glyph_81'Access,
Glyph_82'Access,
Glyph_83'Access,
Glyph_84'Access,
Glyph_85'Access,
Glyph_86'Access,
Glyph_87'Access,
Glyph_88'Access,
Glyph_89'Access,
Glyph_90'Access,
Glyph_91'Access,
Glyph_92'Access,
Glyph_93'Access,
Glyph_94'Access,
Glyph_95'Access,
Glyph_96'Access
), Y_Advance => 20);
Font : constant Giza.Font.Ref_Const := Font_D'Access;
end Giza.Hershey_Fonts.Markers;
|
ada/original_2008/ada-gui/agar-gui-widget-textbox.ads | auzkok/libagar | 286 | 22615 | <gh_stars>100-1000
with agar.gui.widget.scrollbar;
with agar.gui.widget.editable;
package agar.gui.widget.textbox is
use type c.unsigned;
subtype cursor_pos_t is agar.gui.widget.editable.cursor_pos_t;
type flags_t is new c.unsigned;
TEXTBOX_MULTILINE : constant flags_t := 16#00001#;
TEXTBOX_PASSWORD : constant flags_t := 16#00004#;
TEXTBOX_ABANDON_FOCUS : constant flags_t := 16#00008#;
TEXTBOX_COMBO : constant flags_t := 16#00010#;
TEXTBOX_HFILL : constant flags_t := 16#00020#;
TEXTBOX_VFILL : constant flags_t := 16#00040#;
TEXTBOX_EXPAND : constant flags_t := TEXTBOX_HFILL or TEXTBOX_VFILL;
TEXTBOX_READONLY : constant flags_t := 16#00100#;
TEXTBOX_INT_ONLY : constant flags_t := 16#00200#;
TEXTBOX_FLT_ONLY : constant flags_t := 16#00400#;
TEXTBOX_CATCH_TAB : constant flags_t := 16#00800#;
TEXTBOX_CURSOR_MOVING : constant flags_t := 16#01000#;
TEXTBOX_STATIC : constant flags_t := 16#04000#;
TEXTBOX_NOEMACS : constant flags_t := 16#08000#;
TEXTBOX_NOWORDSEEK : constant flags_t := 16#10000#;
TEXTBOX_NOLATIN1 : constant flags_t := 16#20000#;
type textbox_t is limited private;
type textbox_access_t is access all textbox_t;
pragma convention (c, textbox_access_t);
string_max : constant := agar.gui.widget.editable.string_max;
-- API
function allocate
(parent : widget_access_t;
flags : flags_t;
label : string) return textbox_access_t;
pragma inline (allocate);
procedure set_static
(textbox : textbox_access_t;
enable : boolean);
pragma inline (set_static);
procedure set_password
(textbox : textbox_access_t;
enable : boolean);
pragma inline (set_password);
procedure set_float_only
(textbox : textbox_access_t;
enable : boolean);
pragma inline (set_float_only);
procedure set_integer_only
(textbox : textbox_access_t;
enable : boolean);
pragma inline (set_integer_only);
procedure set_label
(textbox : textbox_access_t;
text : string);
pragma inline (set_label);
procedure size_hint
(textbox : textbox_access_t;
text : string);
pragma inline (size_hint);
procedure size_hint_pixels
(textbox : textbox_access_t;
width : positive;
height : positive);
pragma inline (size_hint_pixels);
-- cursor manipulation
procedure map_position
(textbox : textbox_access_t;
x : integer;
y : integer;
index : out natural;
pos : out cursor_pos_t;
absolute : boolean);
pragma inline (map_position);
function move_cursor
(textbox : textbox_access_t;
x : integer;
y : integer;
absolute : boolean) return integer;
pragma inline (move_cursor);
function get_cursor_position (textbox : textbox_access_t) return integer;
pragma inline (get_cursor_position);
function set_cursor_position
(textbox : textbox_access_t;
position : integer) return integer;
pragma inline (set_cursor_position);
-- text manipulation
procedure set_string
(textbox : textbox_access_t;
text : string);
pragma inline (set_string);
procedure set_string_ucs4
(textbox : textbox_access_t;
text : wide_wide_string);
pragma inline (set_string_ucs4);
procedure clear_string (textbox : textbox_access_t);
pragma import (c, clear_string, "agar_gui_widget_textbox_clear_string");
procedure buffer_changed (textbox : textbox_access_t);
pragma import (c, buffer_changed, "agar_gui_widget_textbox_buffer_changed");
function get_integer (textbox : textbox_access_t) return integer;
pragma inline (get_integer);
function get_float (textbox : textbox_access_t) return float;
pragma inline (get_float);
function get_long_float (textbox : textbox_access_t) return long_float;
pragma inline (get_long_float);
function widget (textbox : textbox_access_t) return widget_access_t;
pragma inline (widget);
private
type textbox_t is record
widget : aliased widget_t;
editable : agar.gui.widget.editable.editable_access_t;
label_text : cs.chars_ptr;
label : c.int;
flags : flags_t;
box_pad_x : c.int;
box_pad_y : c.int;
label_pad_left : c.int;
label_pad_right : c.int;
width_label : c.int;
height_label : c.int;
horiz_scrollbar : agar.gui.widget.scrollbar.scrollbar_access_t;
vert_scrollbar : agar.gui.widget.scrollbar.scrollbar_access_t;
r : agar.gui.rect.rect_t;
r_label : agar.gui.rect.rect_t;
end record;
pragma convention (c, textbox_t);
end agar.gui.widget.textbox;
|
src/TwoPassMerge/NoProofs.agda | jstolarek/dep-typed-wbl-heaps | 1 | 13756 | ----------------------------------------------------------------------
-- Copyright: 2013, <NAME>, Lodz University of Technology --
-- --
-- License: See LICENSE file in root of the repo --
-- Repo address: https://github.com/jstolarek/dep-typed-wbl-heaps --
-- --
-- Basic implementation of weight-biased leftist heap. No proofs --
-- and no dependent types. Uses a two-pass merging algorithm. --
----------------------------------------------------------------------
{-# OPTIONS --sized-types #-}
module TwoPassMerge.NoProofs where
open import Basics.Nat
open import Basics hiding (_≥_)
open import Sized
-- Weight biased leftist heap is implemented using a binary tree. I
-- will interchangeably refer to children of a node as "subtrees" or
-- "subheaps".
--
-- A Heap usually stores elements of some type (Set) A with an
-- assigned priority. However to keep code easier to read each node
-- will only store Priority (a natural number). This will not affect
-- in any way proofs that we are conducting.
-- We begin with a simple implementation that uses no dependent
-- types. Note the we explicitly store rank in node constructor
-- (recall that rank is defined as number of elements in a
-- tree). Theoretically this information is redundant - we could
-- compute the size of a tree whenever we need it. The reason I choose
-- to store it in a node is that later, when we come to proving the
-- rank invariant, it will be instructive to show how information
-- stored inside a constructor is turned into an inductive family
-- index.
-- One more thing to note is that we will define most of our Heaps to
-- be sized types, ie. to use an implict index that defines how a
-- constructor affects the inductive size of the data structure. This
-- information is used to guide the termination checker in the
-- definitions of merge.
data Heap : {i : Size} → Set where
empty : {i : Size} → Heap {↑ i}
node : {i : Size} → Priority → Rank → Heap {i} → Heap {i} → Heap {↑ i}
-- Returns rank of node.
rank : Heap → Nat
rank empty = zero
rank (node _ r _ _) = r
-- Creates heap containing a single element with a given Priority
singleton : Priority → Heap
singleton p = node p one empty empty
-- Note [Two-pass merging algorithm]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
-- We use a two-pass implementation of merging algorithm. One pass,
-- implemented by merge, performs merging in a top-down manner. Second
-- one, implemented by makeT, ensures that rank invariant of weight
-- biased leftist tree is not violated after merging.
--
-- Notation:
--
-- h1, h2 - heaps being merged
-- p1, p2 - priority of root element in h1 and h2
-- l1 - left subtree in the first heap
-- r1 - right subtree in the first heap
-- l2 - left subtree in the second heap
-- r2 - right subtree in the second heap
--
-- Merge function analyzes four cases. Two of them are base cases:
--
-- a) h1 is empty - return h2
--
-- b) h2 is empty - return h1
--
-- The other two form the inductive definition of merge:
--
-- c) priority p1 is higher than p2 - p1 becomes new root, l1
-- becomes its one child and result of merging r1 with h2
-- becomes the other child:
--
-- p1
-- / \
-- / \
-- l1 r1+h2 -- here "+" denotes merging
--
-- d) priority p2 is higher than p2 - p2 becomes new root, l2
-- becomes its one child and result of merging r2 with h1
-- becomes the other child.
--
-- p2
-- / \
-- / \
-- l2 r2+h1
--
-- Note that there is no guarantee that rank of r1+h2 (or r2+h1) will
-- be smaller than rank of l1 (or l2). To ensure that merged heap
-- maintains the rank invariant we pass both childred - ie. either l1
-- and r1+h2 or l2 and r2+h1 - to makeT, which creates a new node by
-- inspecting sizes of children and swapping them if necessary.
-- makeT takes an element (priority) and two heaps (trees). It
-- constructs a new heap with element at the root and two heaps as
-- children. makeT ensures that WBL heap rank invariant is maintained
-- in the newly created tree by reversing left and right subtrees when
-- necessary (note the inversed r and l in the last case of makeT).
makeT : Priority → Heap → Heap → Heap
makeT p l r with rank l ≥ rank r
makeT p l r | true = node p (suc (rank l + rank r)) l r
makeT p l r | false = node p (suc (rank l + rank r)) r l
-- merge combines two heaps into one. There are two base cases and two
-- recursive cases - see [Two-pass Merging algorithm]. Recursive cases
-- call makeT to ensure that rank invariant is maintained after
-- merging.
merge : {i j : Size} → Heap {i} → Heap {j} → Heap
merge empty h2 = h2
merge h1 empty = h1
merge (node p1 h1-r l1 r1) (node p2 h2-r l2 r2)
with p1 < p2
merge (node p1 h1-r l1 r1) (node p2 h2-r l2 r2)
| true = makeT p1 l1 (merge r1 (node p2 h2-r l2 r2))
merge (node p1 h1-r l1 r1) (node p2 h2-r l2 r2)
| false = makeT p2 l2 (merge (node p1 h1-r l1 r1) r2)
-- Inserting into a heap is performed by merging that heap with newly
-- created singleton heap.
insert : Priority → Heap → Heap
insert p h = merge (singleton p) h
-- findMin returns element with highest priority, ie. root
-- element. Here we encounter first serious problem: we can't return
-- anything for empty node. If this was Haskell we could throw an
-- error, but Agda is a total language. This means that every program
-- written in Agda eventually terminates and produces a
-- result. Throwing errors is not allowed.
findMin : Heap → Priority
findMin empty = {!!} -- does it make sense to assume default
-- priority for empty heap?
findMin (node p _ _ _) = p
data Maybe (A : Set) : Set where
nothing : Maybe A
just : A → Maybe A
findMinM : Heap → Maybe Priority
findMinM empty = nothing
findMinM (node p _ _ _) = just p
-- deleteMin removes the element with the highest priority by merging
-- subtrees of a root element. Again the case of empty heap is
-- problematic. We could give it semantics by returning empty, but
-- this just doesn't feel right. Why should we be able to remove
-- elements from the empty heap?
deleteMin : Heap → Heap
deleteMin empty = {!!} -- should we insert empty?
deleteMin (node _ _ l r) = merge l r
-- As a quick sanity check let's construct some examples. Here's a
-- heap constructed by inserting following priorities into an empty
-- heap: 3, 0, 1, 2.
heap : Heap
heap = insert (suc (suc zero))
(insert (suc zero)
(insert zero
(insert (suc (suc (suc zero))) empty)))
-- Example usage of findMin
findMinInHeap : Priority
findMinInHeap = findMin heap
-- Example usage of deleteMin
deleteMinFromHeap : Heap
deleteMinFromHeap = deleteMin heap
|
programs/oeis/017/A017392.asm | neoneye/loda | 22 | 99060 | ; A017392: a(n) = (11*n)^4.
; 0,14641,234256,1185921,3748096,9150625,18974736,35153041,59969536,96059601,146410000,214358881,303595776,418161601,562448656,741200625,959512576,1222830961,1536953616,1908029761,2342560000,2847396321,3429742096,4097152081,4857532416,5719140625,6690585616,7780827681,8999178496,10355301121,11859210000,13521270961,15352201216,17363069361,19565295376,21970650625,24591257856,27439591201,30528476176,33871089681,37480960000,41371966801,45558341136,50054665441,54875873536,60037250625,65554433296,71443409521,77720518656,84402451441,91506250000,99049307841,107049369856,115524532321,124493242896,133974300625,143986855936,154550410641,165684817936,177410282401,189747360000,202716958081,216340335376,230639102001,245635219456,261351000625,277809109776,295032562561,313044726016,331869318561,351530410000,372052421521,393460125696,415778646481,439033459216,463250390625,488455618816,514675673281,541937434896,570268135921,599695360000,630247042161,661951468816,694837277761,728933458176,764269350625,800874647056,838779390801,878013976576,918609150481,960596010000,1004006004001,1048870932736,1095222947841,1143094552336,1192518600625,1243528298496,1296157203121,1350439223056,1406408618241
mul $0,11
pow $0,4
|
Transynther/x86/_processed/NC/_st_sm_/i9-9900K_12_0xca_notsx.log_2_140.asm | ljhsiun2/medusa | 9 | 160066 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r14
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x1140, %rsi
lea addresses_normal_ht+0xdd40, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
nop
and %r14, %r14
mov $74, %rcx
rep movsq
nop
sub %rax, %rax
lea addresses_WT_ht+0x1540, %rax
nop
nop
nop
nop
nop
sub %r12, %r12
movb (%rax), %bl
mfence
lea addresses_UC_ht+0x5d40, %rsi
lea addresses_D_ht+0x9d40, %rdi
nop
nop
xor %r13, %r13
mov $57, %rcx
rep movsl
sub %rbx, %rbx
lea addresses_normal_ht+0x17af8, %rax
nop
nop
nop
cmp $32299, %rcx
movb (%rax), %r13b
nop
nop
nop
sub %r14, %r14
lea addresses_WC_ht+0xdd40, %rsi
nop
nop
nop
nop
xor $57503, %rax
movb $0x61, (%rsi)
sub %rbx, %rbx
lea addresses_UC_ht+0x1bd40, %r13
nop
xor %rax, %rax
mov $0x6162636465666768, %rbx
movq %rbx, %xmm3
vmovups %ymm3, (%r13)
nop
nop
and $22171, %rbx
lea addresses_normal_ht+0xb6c0, %r13
nop
nop
nop
nop
nop
and $61301, %rcx
mov $0x6162636465666768, %rax
movq %rax, (%r13)
nop
nop
xor %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r14
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %r8
push %r9
push %rax
push %rbp
// Store
lea addresses_A+0x11c44, %rbp
nop
inc %r9
movw $0x5152, (%rbp)
nop
nop
nop
xor %rax, %rax
// Store
mov $0x3904310000000d40, %r11
nop
nop
add $31283, %rax
mov $0x5152535455565758, %r15
movq %r15, %xmm5
movups %xmm5, (%r11)
nop
nop
nop
add %r11, %r11
// Store
lea addresses_US+0xccc4, %rbp
xor %r10, %r10
mov $0x5152535455565758, %r11
movq %r11, %xmm3
movups %xmm3, (%rbp)
nop
nop
cmp %r8, %r8
// Store
lea addresses_RW+0x7ab0, %r11
nop
xor %r8, %r8
mov $0x5152535455565758, %rax
movq %rax, %xmm7
movups %xmm7, (%r11)
sub $17620, %r15
// Store
lea addresses_WT+0x7590, %r15
nop
nop
sub $448, %rbp
mov $0x5152535455565758, %rax
movq %rax, (%r15)
nop
nop
xor %rbp, %rbp
// Store
lea addresses_WC+0x9240, %rbp
nop
nop
inc %r8
movb $0x51, (%rbp)
nop
nop
nop
nop
sub %r9, %r9
// Load
lea addresses_D+0xbf40, %r8
sub %r9, %r9
movaps (%r8), %xmm7
vpextrq $0, %xmm7, %r10
nop
nop
nop
nop
nop
and %r9, %r9
// Store
lea addresses_A+0x1ab40, %r8
nop
nop
nop
nop
nop
and %r9, %r9
mov $0x5152535455565758, %rax
movq %rax, (%r8)
nop
nop
sub $11872, %r9
// Faulty Load
mov $0x3904310000000d40, %r10
sub %r15, %r15
mov (%r10), %rbp
lea oracles, %r9
and $0xff, %rbp
shlq $12, %rbp
mov (%r9,%rbp,1), %rbp
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7}}
{'58': 2}
58 58
*/
|
experiments/test-suite/mutation-based/10/7/nqueens.als | kaiyuanw/AlloyFLCore | 1 | 1354 | <reponame>kaiyuanw/AlloyFLCore<gh_stars>1-10
pred test48 {
some disj Queen0, Queen1, Queen2, Queen3: Queen {
Queen = Queen0 + Queen1 + Queen2 + Queen3
row = Queen0->3 + Queen1->0 + Queen2->2 + Queen3->0
col = Queen0->2 + Queen1->0 + Queen2->3 + Queen3->0
nothreat[Queen3,Queen2]
}
}
run test48 for 4 expect 1
pred test19 {
some disj Queen0, Queen1, Queen2, Queen3: Queen {
Queen = Queen0 + Queen1 + Queen2 + Queen3
row = Queen0->0 + Queen1->0 + Queen2->2 + Queen3->1
col = Queen0->0 + Queen1->0 + Queen2->1 + Queen3->3
nothreat[Queen3,Queen2]
}
}
run test19 for 4 expect 1
pred test7 {
some disj Queen0, Queen1, Queen2, Queen3: Queen {
Queen = Queen0 + Queen1 + Queen2 + Queen3
row = Queen0->0 + Queen1->1 + Queen2->0 + Queen3->0
col = Queen0->-2 + Queen0->-1 + Queen0->1 + Queen0->5 + Queen1->-6 + Queen1->-1 + Queen1->3 + Queen1->4 + Queen2->-6 + Queen2->-1 + Queen2->0 + Queen2->7 + Queen3->-3 + Queen3->-1 + Queen3->0 + Queen3->7
}
}
run test7 for 4 expect 0
pred test71 {
some disj Queen0, Queen1, Queen2: Queen {
Queen = Queen0 + Queen1 + Queen2
row = Queen0->6 + Queen1->6 + Queen2->5
col = Queen0->2 + Queen1->2 + Queen2->2
}
}
run test71 for 4 expect 0
pred test70 {
some disj Queen0, Queen1, Queen2, Queen3: Queen {
Queen = Queen0 + Queen1 + Queen2 + Queen3
row = Queen0->4 + Queen1->4 + Queen2->4 + Queen3->3
col = Queen0->1 + Queen1->1 + Queen2->1 + Queen3->1
}
}
run test70 for 4 expect 0
pred test29 {
some disj Queen0, Queen1, Queen2, Queen3: Queen {
Queen = Queen0 + Queen1 + Queen2 + Queen3
row = Queen0->1 + Queen1->0 + Queen2->1 + Queen3->3
col = Queen0->2 + Queen1->1 + Queen2->2 + Queen3->2
nothreat[Queen3,Queen2]
}
}
run test29 for 4 expect 0
pred test34 {
some disj Queen0, Queen1, Queen2, Queen3: Queen {
Queen = Queen0 + Queen1 + Queen2 + Queen3
row = Queen0->3 + Queen1->2 + Queen2->0 + Queen3->3
col = Queen0->1 + Queen1->0 + Queen2->0 + Queen3->2
nothreat[Queen3,Queen2]
}
}
run test34 for 4 expect 1
|
ada-text_io-complex_io.ads | mgrojo/adalib | 15 | 14338 | -- Standard Ada library specification
-- Copyright (c) 2003-2018 <NAME> <<EMAIL>>
-- Copyright (c) 2004-2016 AXE Consultants
-- Copyright (c) 2004, 2005, 2006 Ada-Europe
-- Copyright (c) 2000 The MITRE Corporation, Inc.
-- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
-- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
---------------------------------------------------------------------------
with Ada.Numerics.Generic_Complex_Types;
generic
with package Complex_Types is
new Ada.Numerics.Generic_Complex_Types (<>);
package Ada.Text_IO.Complex_IO is
use Complex_Types;
Default_Fore : Field := 2;
Default_Aft : Field := Real'Digits - 1;
Default_Exp : Field := 3;
procedure Get (File : in File_Type;
Item : out Complex;
Width : in Field := 0);
procedure Get (Item : out Complex;
Width : in Field := 0);
procedure Put (File : in File_Type;
Item : in Complex;
Fore : in Field := Default_Fore;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
procedure Put (Item : in Complex;
Fore : in Field := Default_Fore;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
procedure Get (From : in String;
Item : out Complex;
Last : out Positive);
procedure Put (To : out String;
Item : in Complex;
Aft : in Field := Default_Aft;
Exp : in Field := Default_Exp);
end Ada.Text_IO.Complex_IO;
|
Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0x84_notsx.log_21829_2278.asm | ljhsiun2/medusa | 9 | 9563 | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r8
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x15f9a, %rbp
add $36174, %r8
movw $0x6162, (%rbp)
nop
cmp $20841, %rbx
lea addresses_D_ht+0xb078, %rax
nop
nop
nop
nop
cmp $34553, %r14
mov $0x6162636465666768, %rdi
movq %rdi, (%rax)
nop
nop
nop
sub %rbx, %rbx
lea addresses_WT_ht+0x11a18, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
and $39060, %rax
mov $0x6162636465666768, %rbx
movq %rbx, %xmm1
and $0xffffffffffffffc0, %rdi
vmovntdq %ymm1, (%rdi)
nop
nop
nop
nop
cmp %rbp, %rbp
lea addresses_WC_ht+0x106f8, %rdi
nop
cmp %rbp, %rbp
mov $0x6162636465666768, %r14
movq %r14, %xmm1
movups %xmm1, (%rdi)
nop
nop
nop
and $1672, %rbx
lea addresses_normal_ht+0x16f3c, %rbp
nop
nop
dec %rdx
movups (%rbp), %xmm4
vpextrq $1, %xmm4, %rax
nop
nop
nop
nop
sub $7195, %r8
lea addresses_normal_ht+0x4258, %rbp
nop
nop
nop
nop
nop
cmp $27941, %rbx
movb (%rbp), %r14b
nop
nop
nop
nop
cmp $3084, %rbp
lea addresses_A_ht+0xb378, %rbp
nop
cmp %r14, %r14
mov (%rbp), %dx
nop
nop
nop
nop
nop
sub $34909, %rbp
lea addresses_D_ht+0x180dc, %rdx
clflush (%rdx)
nop
cmp $3173, %rax
movb (%rdx), %bl
nop
nop
nop
nop
inc %rax
lea addresses_UC_ht+0x6538, %rbp
nop
nop
nop
xor $57354, %r14
movw $0x6162, (%rbp)
nop
nop
nop
nop
nop
and %rax, %rax
lea addresses_D_ht+0x1b78, %rsi
lea addresses_UC_ht+0x15d78, %rdi
and $16062, %rax
mov $114, %rcx
rep movsq
nop
nop
nop
nop
cmp $33119, %rbp
lea addresses_normal_ht+0x2ea8, %r14
nop
sub %rsi, %rsi
movb (%r14), %r8b
cmp %r14, %r14
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %r8
push %rax
push %rbx
push %rdx
push %rsi
// Load
lea addresses_UC+0x10762, %rdx
clflush (%rdx)
nop
xor %r15, %r15
mov (%rdx), %eax
// Exception!!!
nop
mov (0), %r8
nop
nop
cmp $740, %rdx
// Load
lea addresses_WC+0x17408, %r8
nop
nop
nop
sub %rsi, %rsi
mov (%r8), %edx
nop
nop
cmp $34879, %r8
// Store
mov $0xf8, %r15
clflush (%r15)
nop
nop
nop
cmp $14511, %rdx
movb $0x51, (%r15)
nop
nop
nop
nop
nop
inc %rax
// Store
lea addresses_normal+0xbf8, %rax
nop
nop
nop
add $603, %rdx
movl $0x51525354, (%rax)
nop
nop
nop
nop
nop
cmp %rdx, %rdx
// Faulty Load
mov $0x3e8bb20000000378, %r8
nop
nop
nop
sub $41896, %rdx
mov (%r8), %eax
lea oracles, %r15
and $0xff, %rax
shlq $12, %rax
mov (%r15,%rax,1), %rax
pop %rsi
pop %rdx
pop %rbx
pop %rax
pop %r8
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_NC', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_P', 'same': False, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 4, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_NC', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 2, 'congruent': 1, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 4, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC_ht', 'same': True, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 1, 'congruent': 5, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'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
*/
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.