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 |
|---|---|---|---|---|
bead/bead2/2/Garden_Pkg.ads | balintsoos/LearnAda | 0 | 14482 | <reponame>balintsoos/LearnAda<filename>bead/bead2/2/Garden_Pkg.ads
package Garden_Pkg is
subtype Position is Positive range 1..10;
function GetRandPos return Position;
function GetField(pos : Position) return Boolean;
procedure SprayField(pos : Position);
procedure SprayAbsorbed;
private
type Fields is array(Integer range <>) of Boolean;
Garden : Fields(1..10) := (1..10 => false);
end Garden_Pkg;
|
programs/oeis/048/A048585.asm | jmorken/loda | 1 | 243628 | <gh_stars>1-10
; A048585: Pisot sequence L(6,7).
; 6,7,9,12,16,22,31,44,63,91,132,192,280,409,598,875,1281,1876,2748,4026,5899,8644,12667,18563,27204,39868,58428,85629,125494,183919,269545,395036,578952,848494,1243527,1822476,2670967,3914491,5736964,8407928,12322416,18059377,26467302,38789715,56849089,83316388,122106100,178955186,262271571,384377668,563332851,825604419,1209982084,1773314932,2598919348,3808901429,5582216358,8181135703,11990037129,17572253484,25753389184,37743426310,55315679791,81069068972,118812495279,174128175067,255197244036,374009739312,548137914376,803335158409,1177344897718,1725482812091,2528817970497,3706162868212,5431645680300,7960463650794,11666626519003,17098272199300,25058735850091,36725362369091,53823634568388,78882370418476,115607732787564,169431367355949,248313737774422,363921470561983,533352837917929,781666575692348,1145588046254328,1678940884172254,2460607459864599,3606195506118924,5285136390291175,7745743850155771
add $0,4
mov $1,1
mov $4,2
lpb $0
sub $0,1
mov $3,$2
mov $2,$1
add $3,1
sub $4,1
mov $1,$4
add $4,$3
lpe
add $1,3
|
src/parser/expr.g4 | lsaos/pld-comp | 0 | 6943 | grammar expr;
prog: (declaration)* function+;
function: funcType VAR '(' parameters? ')' block ;
parameters: varType VAR (',' varType VAR)*;
declaration: varType newVar (',' newVar )* ';';
newVar: newVarName #plainNewVariable
| VAR '=' expression #valuedNewVariable
;
newVarName: VAR #declareVariable
| VAR '[' expression ']' #declareArray
;
ret: 'return' expression ';' #retExpr
| 'return' ';' #retNoExpr
;
block: '{' (declaration )* (instruction )* '}';
instruction: assignment ';'
| optional
| loop
| ret
| funcCall ';'
;
assignment: varExpr '=' expression;
varExpr: VAR #variableExpression
| VAR '[' expression ']' #arrayExpression
;
optional: 'if' condition controlBody ( 'else' controlBody)?;
loop: 'while' condition controlBody #whileLoop
| 'for' '(' forInit expression ';' assignment ')' controlBody #forLoop
;
forInit: declaration #forDeclaration
| assignment ';' #forAssignment
;
condition: '(' expression ')' ;
controlBody: block
| instruction;
expression: funcCall #exprFunc
| varExpr #variable
| INT #int
| CHAR #char
| '(' expression ')' #parenthesis
| '-' expression #minus
| '!' expression #logicalNot
| '~' expression #bitwiseNot
| expression '*' expression #multiply
| expression '+' expression #add
| expression '-' expression #substract
| expression '<<' expression #leftShift
| expression '>>' expression #rightShift
| expression '<' expression #LowerThan
| expression '>' expression #GreaterThan
| expression '>=' expression #GreaterThanEquals
| expression '<=' expression #lowerThanEquals
| expression '==' expression #equals
| expression '!=' expression #Different
| expression '&' expression #bitwiseAnd
| expression '^' expression #bitwiseXor
| expression '|' expression #bitwiseOr
| expression '&&' expression #LogicalAnd
| expression '||' expression #LogicalOr
| VAR '=' expression #assignmentExpression
;
funcCall: VAR '(' funcCallArguments? ')';
funcCallArguments: expression (',' expression)*;
funcType: 'int'|'void'|'char';
varType: 'int'|'char';
WS: [ \t\r\n] -> skip;
Comment: '//' ~[\r\n]* -> skip;
BlockComment: '/*' .*? '*/' -> skip;
Preproc: '#' ~[\r\n]* -> skip;
INT: [0-9]+;
CHAR: '\'' ([a-zA-Z0-9]|'\\n'|' '|'\\t') '\'';
VAR: [a-zA-Z_] [a-zA-Z_0-9]*;
|
grammars/MiniJava.g4 | mossj77/IUSTCompiler | 0 | 4533 | /*
Program ::= MainClass ( ClassDeclaration )* <EOF>
MainClass ::= "class" Identifier "{" "public" "static" "void" "main" "(" "String" "[" "]" Identifier ")" "{" Statement "}" "}"
ClassDeclaration ::= "class" Identifier ( "extends" Identifier )? "{" ( VarDeclaration )* ( MethodDeclaration )* "}"
VarDeclaration ::= Type Identifier ";"
MethodDeclaration ::= "public" Type Identifier "(" ( Type Identifier ( "," Type Identifier )* )? ")" "{" ( VarDeclaration )* ( Statement )* "return" Expression ";" "}"
Type ::= "int" "[" "]"
| "boolean"
| "int"
| Identifier
Statement ::= "{" ( Statement )* "}"
| "if" "(" Expression ")" Statement "else" Statement
| "while" "(" Expression ")" Statement
| "System.out.println" "(" Expression ")" ";"
| Identifier "=" Expression ";"
| Identifier "[" Expression "]" "=" Expression ";"
Expression ::= Expression ( "&&" | "<" | "+" | "-" | "*" ) Expression
| Expression "[" Expression "]"
| Expression "." "length"
| Expression "." Identifier "(" ( Expression ( "," Expression )* )? ")"
| <INTEGER_LITERAL>
| "true"
| "false"
| Identifier
| "this"
| "new" "int" "[" Expression "]"
| "new" Identifier "(" ")"
| "!" Expression
| "(" Expression ")"
Identifier ::= <IDENTIFIER>
*/
grammar MiniJava;
program:
mainClass ( classDeclaration )* EOF;
mainClass:
'class' IDENTIFIER '{' 'public' 'static' 'void' 'main' '(' 'String' '[' ']' IDENTIFIER ')' '{' statement '}' '}';
classDeclaration:
'class' IDENTIFIER ( 'extends' IDENTIFIER )? '{' ( varDeclaration )* ( methodDeclaration )* '}';
varDeclaration:
type IDENTIFIER ';';
methodDeclaration:
'public' type IDENTIFIER '(' ( type IDENTIFIER ( ',' type IDENTIFIER )* )?
')' '{' ( varDeclaration )* ( statement )* 'return' expression ';' '}';
type:
'int' '[' ']'
| 'boolean'
| 'int'
| identifier;
statement:
'{' ( statement )* '}'
| 'if' '(' expression ')' statement 'else' statement
| 'while' '(' expression ')' statement
| 'System.out.println' '(' expression ')' ';'
| IDENTIFIER '=' expression ';'
| IDENTIFIER '[' expression ']' '=' expression ';';
expression:
expression ( '&&' | '<' | '+' | '-' | '*' ) expression
| expression '[' expression ']'
| expression '.' 'length'
| expression '.' IDENTIFIER '(' ( expression ( ',' expression )* )? ')'
| INTEGER_LITERAL
| 'true'
| 'false'
| IDENTIFIER
| 'this'
| 'new' 'int' '[' expression ']'
| 'new' IDENTIFIER '(' ')'
| '!' expression
| '(' expression ')';
IDENTIFIER:
[a-zA-Z][_0-9a-zA-Z]*;
INTEGER_LITERAL:
[0-9]+;
WS:
[\n \t\r]+ -> skip;
LINE_COMMENT:
'//' ~[\r\n]* -> skip;
|
Cubical/Algebra/Semigroup.agda | dan-iel-lee/cubical | 0 | 5597 | <filename>Cubical/Algebra/Semigroup.agda
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Algebra.Semigroup where
open import Cubical.Algebra.Semigroup.Base public
|
6502EMU/Instructions/CPY.asm | austinbentley/6502toAVR | 0 | 162969 | <filename>6502EMU/Instructions/CPY.asm
/*
* CPY.asm
*
* Created: 5/13/2018 3:59:56 PM
* Author: ROTP
*/
CPY_immediate: ;UNTESTED
swapPCwithTEMPPC
ADIW ZH:ZL, 1
dereferencer r22
cp YR, r22
BRLT CPY_immediate_lt
BREQ CPY_immediate_eq
CPY_immediate_gt:
;YR > R22 => Z = 0, C = 1
CBR SR, ZERO_FLAG
SBR SR, CARRY_FLAG
;JMP CPY_immediate_ret
ADIW ZH:ZL, 1
RET
CPY_immediate_lt:
;YR < r22 => Z = 0, C = 0
CBR SR, ZERO_FLAG
CBR SR, CARRY_FLAG
;JMP CPY_immediate_ret
ADIW ZH:ZL, 1
RET
CPY_immediate_eq:
;YR = R22 => Z = 1, C = 1
SBR SR, ZERO_FLAG
SBR SR, CARRY_FLAG
;JMP CPY_immediate_ret
CPY_immediate_ret:
ADIW ZH:ZL, 1
RET
CPY_zpg: ;UNTESTED
swapPCwithTEMPPC
ADIW ZH:ZL, 1
MOV R22, ZL
MOV R23, ZH
dereferencer r24
MOV ZL, R24
CLR ZH
dereferencer R25
cp YR, r25
BRLT CPY_zpg_lt
BREQ CPY_zpg_eq
CPY_zpg_gt:
;YR > R22 => Z = 0, C = 1
CBR SR, ZERO_FLAG
SBR SR, CARRY_FLAG
JMP CPY_zpg_ret
CPY_zpg_lt:
;YR < r22 => Z = 0, C = 0
CBR SR, ZERO_FLAG
CBR SR, CARRY_FLAG
JMP CPY_zpg_ret
CPY_zpg_eq:
;YR = R22 => Z = 1, C = 1
SBR SR, ZERO_FLAG
SBR SR, CARRY_FLAG
;JMP CPY_zpg_ret
CPY_zpg_ret:
MOV ZL, R22
MOV ZH, R23
ADIW ZH:ZL, 1
RET
CPY_absolute: ;UNTESTED
swapPCwithTEMPPC
ADIW ZH:ZL, 1
dereferencer r23 ;grab LO
ADIW ZH:ZL, 1
dereferencer r22 ;grab HI
mov r24, ZL ;preserve Z
mov r25, ZH
MOV ZH, R22 ;put new data in Z
MOV ZL, R23
dereferencer r26
cp YR, r26
BRLT CPY_absolute_lt
BREQ CPY_absolute_eq
CPY_absolute_gt:
;YR > R22 => Z = 0, C = 1
CBR SR, ZERO_FLAG
SBR SR, CARRY_FLAG
JMP CPY_absolute_ret
CPY_absolute_lt:
;YR < r22 => Z = 0, C = 0
CBR SR, ZERO_FLAG
CBR SR, CARRY_FLAG
JMP CPY_absolute_ret
CPY_absolute_eq:
;YR = R22 => Z = 1, C = 1
SBR SR, ZERO_FLAG
SBR SR, CARRY_FLAG
;JMP CPY_absolute_ret
CPY_absolute_ret:
mov ZL, R24 ;restore Z
mov ZH, R25
ADIW ZH:ZL, 1
RET |
oeis/036/A036244.asm | neoneye/loda-programs | 11 | 26019 | <filename>oeis/036/A036244.asm
; A036244: Denominator of continued fraction given by C(n) = [ 1; 3, 5, 7, ...(2n-1)].
; Submitted by <NAME>(s3)
; 1,3,16,115,1051,11676,152839,2304261,39325276,749484505,15778499881,363654981768,9107153044081,246256787171955,7150553981030776,221913430199126011,7330293750552189139,256782194699525745876,9508271497633004786551,371079370602386712421365,15223762466195488214062516,654992865417008379917109553,29489902706231572584483992401,1386680420058300919850664752400,67976830485562976645267056860001,3468205035183770109828470564612451,183882843695225378797554206981319904,10117024608272579603975309854537207171
add $0,2
mov $3,1
lpb $0
mul $2,$0
sub $0,1
add $2,$3
sub $2,$1
mov $3,$1
mov $1,$2
mul $2,2
lpe
mov $0,$3
|
src/antlr/GroovyLexer.g4 | am4dr/groovy | 0 | 2039 | /*
* This file is adapted from the Antlr4 Java grammar which has the following license
*
* Copyright (c) 2013 <NAME>, <NAME>
* All rights reserved.
* [The "BSD licence"]
*
* http://www.opensource.org/licenses/bsd-license.php
*
* Subsequent modifications by the Groovy community have been done under the Apache License v2:
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* The Groovy grammar is based on the official grammar for Java:
* https://github.com/antlr/grammars-v4/blob/master/java/Java.g4
*/
lexer grammar GroovyLexer;
options {
superClass = AbstractLexer;
}
@header {
import static org.apache.groovy.parser.antlr4.SemanticPredicates.*;
import java.util.Deque;
import java.util.ArrayDeque;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import java.util.Arrays;
}
@members {
private long tokenIndex = 0;
private int lastTokenType = 0;
private int invalidDigitCount = 0;
/**
* Record the index and token type of the current token while emitting tokens.
*/
@Override
public void emit(Token token) {
this.tokenIndex++;
int tokenType = token.getType();
if (Token.DEFAULT_CHANNEL == token.getChannel()) {
this.lastTokenType = tokenType;
}
if (RollBackOne == tokenType) {
this.rollbackOneChar();
}
super.emit(token);
}
private static final Set<Integer> REGEX_CHECK_SET =
Collections.unmodifiableSet(
new HashSet<>(Arrays.asList(Identifier, CapitalizedIdentifier, NullLiteral, BooleanLiteral, THIS, RPAREN, RBRACK, RBRACE, IntegerLiteral, FloatingPointLiteral, StringLiteral, GStringEnd, INC, DEC)));
private boolean isRegexAllowed() {
if (REGEX_CHECK_SET.contains(this.lastTokenType)) {
return false;
}
return true;
}
/**
* just a hook, which will be overrided by GroovyLangLexer
*/
protected void rollbackOneChar() {}
private static class Paren {
private String text;
private int lastTokenType;
private int line;
private int column;
public Paren(String text, int lastTokenType, int line, int column) {
this.text = text;
this.lastTokenType = lastTokenType;
this.line = line;
this.column = column;
}
public String getText() {
return this.text;
}
public int getLastTokenType() {
return this.lastTokenType;
}
public int getLine() {
return line;
}
public int getColumn() {
return column;
}
@Override
public int hashCode() {
return (int) (text.hashCode() * line + column);
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof Paren)) {
return false;
}
Paren other = (Paren) obj;
return this.text.equals(other.text) && (this.line == other.line && this.column == other.column);
}
}
private static final Map<String, String> PAREN_MAP = Collections.unmodifiableMap(new HashMap<String, String>() {
{
put("(", ")");
put("[", "]");
put("{", "}");
}
});
private final Deque<Paren> parenStack = new ArrayDeque<>(32);
private void enterParen() {
parenStack.push(new Paren(getText(), this.lastTokenType, getLine(), getCharPositionInLine()));
}
private void exitParen() {
Paren paren = parenStack.peek();
String text = getText();
require(null != paren, "Too many '" + text + "'");
require(text.equals(PAREN_MAP.get(paren.getText())),
"'" + paren.getText() + "'" + new PositionInfo(paren.getLine(), paren.getColumn()) + " can not match '" + text + "'", -1);
parenStack.pop();
}
private boolean isInsideParens() {
Paren paren = parenStack.peek();
// We just care about "(" and "[", inside which the new lines will be ignored.
// Notice: the new lines between "{" and "}" can not be ignored.
if (null == paren) {
return false;
}
return ("(".equals(paren.getText()) && TRY != paren.getLastTokenType()) // we don't treat try-paren(i.e. try (....)) as parenthesis
|| "[".equals(paren.getText());
}
private void ignoreTokenInsideParens() {
if (!this.isInsideParens()) {
return;
}
this.setChannel(Token.HIDDEN_CHANNEL);
}
private void ignoreMultiLineCommentConditionally() {
if (!this.isInsideParens() && isFollowedByWhiteSpaces(_input)) {
return;
}
this.setChannel(Token.HIDDEN_CHANNEL);
}
@Override
public int getSyntaxErrorSource() {
return GroovySyntaxError.LEXER;
}
@Override
public int getErrorLine() {
return getLine();
}
@Override
public int getErrorColumn() {
return getCharPositionInLine() + 1;
}
}
// §3.10.5 String Literals
StringLiteral
: GStringQuotationMark DqStringCharacter* GStringQuotationMark
| SqStringQuotationMark SqStringCharacter* SqStringQuotationMark
| Slash { this.isRegexAllowed() && _input.LA(1) != '*' }?
SlashyStringCharacter+ Slash
| TdqStringQuotationMark TdqStringCharacter* TdqStringQuotationMark
| TsqStringQuotationMark TsqStringCharacter* TsqStringQuotationMark
| DollarSlashyGStringQuotationMarkBegin DollarSlashyStringCharacter+ DollarSlashyGStringQuotationMarkEnd
;
// Groovy gstring
GStringBegin
: GStringQuotationMark DqStringCharacter* Dollar -> pushMode(DQ_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE)
;
TdqGStringBegin
: TdqStringQuotationMark TdqStringCharacter* Dollar -> type(GStringBegin), pushMode(TDQ_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE)
;
SlashyGStringBegin
: Slash { this.isRegexAllowed() && _input.LA(1) != '*' }? SlashyStringCharacter* Dollar { isFollowedByJavaLetterInGString(_input) }? -> type(GStringBegin), pushMode(SLASHY_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE)
;
DollarSlashyGStringBegin
: DollarSlashyGStringQuotationMarkBegin DollarSlashyStringCharacter* Dollar { isFollowedByJavaLetterInGString(_input) }? -> type(GStringBegin), pushMode(DOLLAR_SLASHY_GSTRING_MODE), pushMode(GSTRING_TYPE_SELECTOR_MODE)
;
mode DQ_GSTRING_MODE;
GStringEnd
: GStringQuotationMark -> popMode
;
GStringPart
: Dollar -> pushMode(GSTRING_TYPE_SELECTOR_MODE)
;
GStringCharacter
: DqStringCharacter -> more
;
mode TDQ_GSTRING_MODE;
TdqGStringEnd
: TdqStringQuotationMark -> type(GStringEnd), popMode
;
TdqGStringPart
: Dollar -> type(GStringPart), pushMode(GSTRING_TYPE_SELECTOR_MODE)
;
TdqGStringCharacter
: TdqStringCharacter -> more
;
mode SLASHY_GSTRING_MODE;
SlashyGStringEnd
: Dollar? Slash -> type(GStringEnd), popMode
;
SlashyGStringPart
: Dollar { isFollowedByJavaLetterInGString(_input) }? -> type(GStringPart), pushMode(GSTRING_TYPE_SELECTOR_MODE)
;
SlashyGStringCharacter
: SlashyStringCharacter -> more
;
mode DOLLAR_SLASHY_GSTRING_MODE;
DollarSlashyGStringEnd
: DollarSlashyGStringQuotationMarkEnd -> type(GStringEnd), popMode
;
DollarSlashyGStringPart
: Dollar { isFollowedByJavaLetterInGString(_input) }? -> type(GStringPart), pushMode(GSTRING_TYPE_SELECTOR_MODE)
;
DollarSlashyGStringCharacter
: DollarSlashyStringCharacter -> more
;
mode GSTRING_TYPE_SELECTOR_MODE;
GStringLBrace
: '{' { this.enterParen(); } -> type(LBRACE), popMode, pushMode(DEFAULT_MODE)
;
GStringIdentifier
: IdentifierInGString -> type(Identifier), popMode, pushMode(GSTRING_PATH_MODE)
;
mode GSTRING_PATH_MODE;
GStringPathPart
: Dot IdentifierInGString
;
RollBackOne
: . {
// a trick to handle GStrings followed by EOF properly
if (EOF == _input.LA(1) && ('"' == _input.LA(-1) || '/' == _input.LA(-1))) {
setType(GStringEnd);
} else {
setChannel(HIDDEN);
}
} -> popMode
;
mode DEFAULT_MODE;
// character in the double quotation string. e.g. "a"
fragment
DqStringCharacter
: ~["\\$]
| EscapeSequence
;
// character in the single quotation string. e.g. 'a'
fragment
SqStringCharacter
: ~['\\]
| EscapeSequence
;
// character in the triple double quotation string. e.g. """a"""
fragment TdqStringCharacter
: ~["\\$]
| GStringQuotationMark { _input.LA(1) != '"' || _input.LA(2) != '"' || _input.LA(3) == '"' && (_input.LA(4) != '"' || _input.LA(5) != '"') }?
| EscapeSequence
;
// character in the triple single quotation string. e.g. '''a'''
fragment TsqStringCharacter
: ~['\\]
| SqStringQuotationMark { _input.LA(1) != '\'' || _input.LA(2) != '\'' || _input.LA(3) == '\'' && (_input.LA(4) != '\'' || _input.LA(5) != '\'') }?
| EscapeSequence
;
// character in the slashy string. e.g. /a/
fragment SlashyStringCharacter
: SlashEscape
| Dollar { !isFollowedByJavaLetterInGString(_input) }?
| ~[/$\u0000]
;
// character in the collar slashy string. e.g. $/a/$
fragment DollarSlashyStringCharacter
: SlashEscape | DollarSlashEscape | DollarDollarEscape
| Slash { _input.LA(1) != '$' }?
| Dollar { !isFollowedByJavaLetterInGString(_input) }?
| ~[/$\u0000]
;
// Groovy keywords
AS : 'as';
DEF : 'def';
IN : 'in';
TRAIT : 'trait';
THREADSAFE : 'threadsafe'; // reserved keyword
// the reserved type name of Java10
VAR : 'var';
// §3.9 Keywords
BuiltInPrimitiveType
: BOOLEAN
| CHAR
| BYTE
| SHORT
| INT
| LONG
| FLOAT
| DOUBLE
;
ABSTRACT : 'abstract';
ASSERT : 'assert';
fragment
BOOLEAN : 'boolean';
BREAK : 'break';
fragment
BYTE : 'byte';
CASE : 'case';
CATCH : 'catch';
fragment
CHAR : 'char';
CLASS : 'class';
CONST : 'const';
CONTINUE : 'continue';
DEFAULT : 'default';
DO : 'do';
fragment
DOUBLE : 'double';
ELSE : 'else';
ENUM : 'enum';
EXTENDS : 'extends';
FINAL : 'final';
FINALLY : 'finally';
fragment
FLOAT : 'float';
FOR : 'for';
IF : 'if';
GOTO : 'goto';
IMPLEMENTS : 'implements';
IMPORT : 'import';
INSTANCEOF : 'instanceof';
fragment
INT : 'int';
INTERFACE : 'interface';
fragment
LONG : 'long';
NATIVE : 'native';
NEW : 'new';
PACKAGE : 'package';
PRIVATE : 'private';
PROTECTED : 'protected';
PUBLIC : 'public';
RETURN : 'return';
fragment
SHORT : 'short';
STATIC : 'static';
STRICTFP : 'strictfp';
SUPER : 'super';
SWITCH : 'switch';
SYNCHRONIZED : 'synchronized';
THIS : 'this';
THROW : 'throw';
THROWS : 'throws';
TRANSIENT : 'transient';
TRY : 'try';
VOID : 'void';
VOLATILE : 'volatile';
WHILE : 'while';
// §3.10.1 Integer Literals
IntegerLiteral
: ( DecimalIntegerLiteral
| HexIntegerLiteral
| OctalIntegerLiteral
| BinaryIntegerLiteral
) (Underscore { require(false, "Number ending with underscores is invalid", -1, true); })?
// !!! Error Alternative !!!
| Zero ([0-9] { invalidDigitCount++; })+ { require(false, "Invalid octal number", -(invalidDigitCount + 1), true); } IntegerTypeSuffix?
;
fragment
Zero
: '0'
;
fragment
DecimalIntegerLiteral
: DecimalNumeral IntegerTypeSuffix?
;
fragment
HexIntegerLiteral
: HexNumeral IntegerTypeSuffix?
;
fragment
OctalIntegerLiteral
: OctalNumeral IntegerTypeSuffix?
;
fragment
BinaryIntegerLiteral
: BinaryNumeral IntegerTypeSuffix?
;
fragment
IntegerTypeSuffix
: [lLiIgG]
;
fragment
DecimalNumeral
: Zero
| NonZeroDigit (Digits? | Underscores Digits)
;
fragment
Digits
: Digit (DigitOrUnderscore* Digit)?
;
fragment
Digit
: Zero
| NonZeroDigit
;
fragment
NonZeroDigit
: [1-9]
;
fragment
DigitOrUnderscore
: Digit
| Underscore
;
fragment
Underscores
: Underscore+
;
fragment
Underscore
: '_'
;
fragment
HexNumeral
: Zero [xX] HexDigits
;
fragment
HexDigits
: HexDigit (HexDigitOrUnderscore* HexDigit)?
;
fragment
HexDigit
: [0-9a-fA-F]
;
fragment
HexDigitOrUnderscore
: HexDigit
| Underscore
;
fragment
OctalNumeral
: Zero Underscores? OctalDigits
;
fragment
OctalDigits
: OctalDigit (OctalDigitOrUnderscore* OctalDigit)?
;
fragment
OctalDigit
: [0-7]
;
fragment
OctalDigitOrUnderscore
: OctalDigit
| Underscore
;
fragment
BinaryNumeral
: Zero [bB] BinaryDigits
;
fragment
BinaryDigits
: BinaryDigit (BinaryDigitOrUnderscore* BinaryDigit)?
;
fragment
BinaryDigit
: [01]
;
fragment
BinaryDigitOrUnderscore
: BinaryDigit
| Underscore
;
// §3.10.2 Floating-Point Literals
FloatingPointLiteral
: ( DecimalFloatingPointLiteral
| HexadecimalFloatingPointLiteral
) (Underscore { require(false, "Number ending with underscores is invalid", -1, true); })?
;
fragment
DecimalFloatingPointLiteral
: Digits Dot Digits ExponentPart? FloatTypeSuffix?
| Digits ExponentPart FloatTypeSuffix?
| Digits FloatTypeSuffix
;
fragment
ExponentPart
: ExponentIndicator SignedInteger
;
fragment
ExponentIndicator
: [eE]
;
fragment
SignedInteger
: Sign? Digits
;
fragment
Sign
: [+\-]
;
fragment
FloatTypeSuffix
: [fFdDgG]
;
fragment
HexadecimalFloatingPointLiteral
: HexSignificand BinaryExponent FloatTypeSuffix?
;
fragment
HexSignificand
: HexNumeral Dot?
| Zero [xX] HexDigits? Dot HexDigits
;
fragment
BinaryExponent
: BinaryExponentIndicator SignedInteger
;
fragment
BinaryExponentIndicator
: [pP]
;
fragment
Dot : '.'
;
// §3.10.3 Boolean Literals
BooleanLiteral
: 'true'
| 'false'
;
// §3.10.6 Escape Sequences for Character and String Literals
fragment
EscapeSequence
: Backslash [btnfr"'\\]
| OctalEscape
| UnicodeEscape
| DollarEscape
| LineEscape
;
fragment
OctalEscape
: Backslash OctalDigit
| Backslash OctalDigit OctalDigit
| Backslash ZeroToThree OctalDigit OctalDigit
;
// Groovy allows 1 or more u's after the backslash
fragment
UnicodeEscape
: Backslash 'u' HexDigit HexDigit HexDigit HexDigit
;
fragment
ZeroToThree
: [0-3]
;
// Groovy Escape Sequences
fragment
DollarEscape
: Backslash Dollar
;
fragment
LineEscape
: Backslash '\r'? '\n'
;
fragment
SlashEscape
: Backslash Slash
;
fragment
Backslash
: '\\'
;
fragment
Slash
: '/'
;
fragment
Dollar
: '$'
;
fragment
GStringQuotationMark
: '"'
;
fragment
SqStringQuotationMark
: '\''
;
fragment
TdqStringQuotationMark
: '"""'
;
fragment
TsqStringQuotationMark
: '\'\'\''
;
fragment
DollarSlashyGStringQuotationMarkBegin
: '$/'
;
fragment
DollarSlashyGStringQuotationMarkEnd
: '/$'
;
fragment
DollarSlashEscape
: '$/$'
;
fragment
DollarDollarEscape
: '$$'
;
// §3.10.7 The Null Literal
NullLiteral
: 'null'
;
// Groovy Operators
RANGE_INCLUSIVE : '..';
RANGE_EXCLUSIVE : '..<';
SPREAD_DOT : '*.';
SAFE_DOT : '?.';
SAFE_CHAIN_DOT : '??.';
ELVIS : '?:';
METHOD_POINTER : '.&';
METHOD_REFERENCE : '::';
REGEX_FIND : '=~';
REGEX_MATCH : '==~';
POWER : '**';
POWER_ASSIGN : '**=';
SPACESHIP : '<=>';
IDENTICAL : '===';
NOT_IDENTICAL : '!==';
ARROW : '->';
// !internalPromise will be parsed as !in ternalPromise, so semantic predicates are necessary
NOT_INSTANCEOF : '!instanceof' { isFollowedBy(_input, ' ', '\t', '\r', '\n') }?;
NOT_IN : '!in' { isFollowedBy(_input, ' ', '\t', '\r', '\n', '[', '(', '{') }?;
// §3.11 Separators
LPAREN : '(' { this.enterParen(); } -> pushMode(DEFAULT_MODE);
RPAREN : ')' { this.exitParen(); } -> popMode;
LBRACE : '{' { this.enterParen(); } -> pushMode(DEFAULT_MODE);
RBRACE : '}' { this.exitParen(); } -> popMode;
LBRACK : '[' { this.enterParen(); } -> pushMode(DEFAULT_MODE);
RBRACK : ']' { this.exitParen(); } -> popMode;
SEMI : ';';
COMMA : ',';
DOT : Dot;
// §3.12 Operators
ASSIGN : '=';
GT : '>';
LT : '<';
NOT : '!';
BITNOT : '~';
QUESTION : '?';
COLON : ':';
EQUAL : '==';
LE : '<=';
GE : '>=';
NOTEQUAL : '!=';
AND : '&&';
OR : '||';
INC : '++';
DEC : '--';
ADD : '+';
SUB : '-';
MUL : '*';
DIV : Slash;
BITAND : '&';
BITOR : '|';
XOR : '^';
MOD : '%';
ADD_ASSIGN : '+=';
SUB_ASSIGN : '-=';
MUL_ASSIGN : '*=';
DIV_ASSIGN : '/=';
AND_ASSIGN : '&=';
OR_ASSIGN : '|=';
XOR_ASSIGN : '^=';
MOD_ASSIGN : '%=';
LSHIFT_ASSIGN : '<<=';
RSHIFT_ASSIGN : '>>=';
URSHIFT_ASSIGN : '>>>=';
ELVIS_ASSIGN : '?=';
// §3.8 Identifiers (must appear after all keywords in the grammar)
CapitalizedIdentifier
: [A-Z] JavaLetterOrDigit*
;
Identifier
: JavaLetter JavaLetterOrDigit*
;
fragment
IdentifierInGString
: JavaLetterInGString JavaLetterOrDigitInGString*
;
fragment
JavaLetterInGString
: [a-zA-Z_] // these are the "java letters" below 0x7F, except for $
| // covers all characters above 0x7F which are not a surrogate
~[\u0000-\u007F\uD800-\uDBFF]
{Character.isJavaIdentifierStart(_input.LA(-1))}?
| // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
[\uD800-\uDBFF] [\uDC00-\uDFFF]
{Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
;
fragment
JavaLetterOrDigitInGString
: [a-zA-Z0-9_] // these are the "java letters or digits" below 0x7F, except for $
| // covers all characters above 0x7F which are not a surrogate
~[\u0000-\u007F\uD800-\uDBFF]
{Character.isJavaIdentifierPart(_input.LA(-1))}?
| // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
[\uD800-\uDBFF] [\uDC00-\uDFFF]
{Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
;
fragment
JavaLetter
: [a-zA-Z$_] // these are the "java letters" below 0x7F
| // covers all characters above 0x7F which are not a surrogate
~[\u0000-\u007F\uD800-\uDBFF]
{Character.isJavaIdentifierStart(_input.LA(-1))}?
| // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
[\uD800-\uDBFF] [\uDC00-\uDFFF]
{Character.isJavaIdentifierStart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
;
fragment
JavaLetterOrDigit
: [a-zA-Z0-9$_] // these are the "java letters or digits" below 0x7F
| // covers all characters above 0x7F which are not a surrogate
~[\u0000-\u007F\uD800-\uDBFF]
{Character.isJavaIdentifierPart(_input.LA(-1))}?
| // covers UTF-16 surrogate pairs encodings for U+10000 to U+10FFFF
[\uD800-\uDBFF] [\uDC00-\uDFFF]
{Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1)))}?
;
//
// Additional symbols not defined in the lexical specification
//
AT : '@';
ELLIPSIS : '...';
//
// Whitespace, line escape and comments
//
WS : ([ \t\u000C]+ | LineEscape+) -> skip
;
// Inside (...) and [...] but not {...}, ignore newlines.
NL : '\r'? '\n' { this.ignoreTokenInsideParens(); }
;
// Multiple-line comments(including groovydoc comments)
ML_COMMENT
: '/*' .*? '*/' { this.ignoreMultiLineCommentConditionally(); } -> type(NL)
;
// Single-line comments
SL_COMMENT
: '//' ~[\r\n\uFFFF]* { this.ignoreTokenInsideParens(); } -> type(NL)
;
// Script-header comments.
// The very first characters of the file may be "#!". If so, ignore the first line.
SH_COMMENT
: '#!' { require(0 == this.tokenIndex, "Shebang comment should appear at the first line", -2, true); } ~[\r\n\uFFFF]* -> skip
;
// Unexpected characters will be handled by groovy parser later.
UNEXPECTED_CHAR
: .
;
|
Transynther/x86/_processed/NC/_st_zr_sm_/i7-7700_9_0x48.log_5243_2234.asm | ljhsiun2/medusa | 9 | 897 | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r8
push %r9
push %rsi
lea addresses_D_ht+0x11d12, %r12
nop
nop
nop
nop
nop
xor %r9, %r9
mov $0x6162636465666768, %r8
movq %r8, %xmm7
vmovups %ymm7, (%r12)
nop
nop
nop
add $7311, %rsi
pop %rsi
pop %r9
pop %r8
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r9
push %rax
push %rcx
push %rdi
// Store
lea addresses_D+0x4ed2, %r10
clflush (%r10)
xor %rdi, %rdi
mov $0x5152535455565758, %rax
movq %rax, %xmm3
movups %xmm3, (%r10)
nop
nop
nop
nop
nop
sub %rcx, %rcx
// Store
lea addresses_normal+0x6e52, %r13
dec %r10
mov $0x5152535455565758, %rcx
movq %rcx, (%r13)
// Exception!!!
nop
nop
nop
nop
nop
mov (0), %rax
nop
nop
sub $78, %r13
// Store
mov $0x7648eb0000000e52, %r10
nop
nop
nop
nop
nop
xor $55350, %r9
mov $0x5152535455565758, %r13
movq %r13, %xmm4
vmovaps %ymm4, (%r10)
nop
add $16797, %rax
// Faulty Load
mov $0x7648eb0000000e52, %r9
nop
sub $59859, %rax
mov (%r9), %cx
lea oracles, %r13
and $0xff, %rcx
shlq $12, %rcx
mov (%r13,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 5, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'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': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 6, 'size': 32, 'same': True, 'NT': False}}
{'58': 2272, '00': 2971}
58 00 00 00 00 00 00 00 00 58 00 00 00 00 58 58 00 00 00 58 58 00 58 58 58 58 00 00 58 00 00 00 00 58 00 00 00 00 58 00 58 58 58 00 00 00 00 00 00 00 58 58 00 00 58 00 58 58 58 00 00 00 58 00 00 58 58 00 58 00 00 00 00 00 00 00 00 58 58 58 00 00 58 00 00 58 58 58 58 00 58 00 00 58 00 00 58 00 00 58 00 00 58 58 58 00 00 58 00 58 58 00 00 00 00 00 00 00 00 58 00 58 00 00 58 00 00 00 58 00 00 00 58 58 00 58 00 58 00 58 58 00 58 58 00 00 58 58 58 58 00 58 58 58 00 58 58 58 58 00 00 58 00 58 00 58 00 00 58 00 00 58 00 00 00 58 00 00 58 58 00 00 58 58 00 00 00 58 00 00 58 58 00 00 00 00 58 00 00 00 00 00 00 58 00 58 00 00 00 58 00 00 00 00 58 00 58 00 58 00 58 00 00 00 58 58 00 00 58 00 58 00 58 58 00 00 00 58 00 58 58 58 58 58 00 00 58 00 00 00 58 58 00 58 00 00 00 00 00 00 00 00 58 00 00 58 58 58 00 00 00 00 00 00 58 00 00 58 00 58 00 00 00 00 00 00 00 00 58 00 58 58 58 00 58 00 58 00 00 00 00 00 58 00 00 58 58 58 58 00 58 58 00 00 00 58 58 00 58 00 00 00 00 00 00 00 58 58 00 00 58 58 58 58 00 00 00 00 00 00 00 58 58 00 58 58 58 00 58 58 00 00 58 00 58 58 00 58 00 00 58 58 58 00 00 58 00 00 58 58 58 58 00 00 58 00 00 00 58 00 58 00 00 00 58 58 00 00 00 58 58 58 58 00 00 00 00 00 00 00 58 00 58 58 58 58 58 00 58 58 00 58 00 00 58 58 00 58 58 00 00 00 00 00 58 00 00 00 00 58 58 00 00 58 00 58 00 00 00 58 00 58 58 00 00 00 58 58 00 58 00 58 58 00 00 58 00 58 00 00 58 00 00 00 00 58 00 00 58 00 00 00 58 58 58 58 58 58 58 58 58 00 00 58 00 00 00 58 58 00 00 00 58 58 58 58 00 00 00 00 00 00 00 58 00 58 58 58 00 00 00 00 58 00 58 00 00 58 00 00 58 00 58 58 58 58 00 58 00 00 00 58 00 00 00 00 00 58 00 58 00 58 58 58 00 00 00 00 00 58 58 58 00 00 00 00 00 58 58 00 00 00 00 58 58 00 00 58 58 00 00 00 00 00 00 58 58 58 58 00 58 58 00 00 58 58 58 58 58 58 58 00 58 00 58 00 58 58 00 00 58 00 00 00 58 00 58 00 58 58 00 58 00 00 00 58 58 58 00 58 58 58 00 00 00 58 00 00 58 00 58 00 00 00 00 00 00 58 00 00 58 58 00 00 58 00 58 00 00 00 58 00 58 58 00 58 58 58 00 00 58 00 00 58 00 00 00 00 00 58 58 58 58 00 00 00 00 00 00 00 00 58 00 00 00 58 00 00 58 00 00 00 58 58 58 00 00 58 58 58 00 00 00 58 00 00 58 58 00 58 58 58 00 58 00 00 00 58 00 00 58 00 00 00 00 58 00 58 00 00 00 58 00 00 58 58 00 58 00 58 58 58 58 00 58 58 00 00 58 58 58 00 00 00 00 00 00 58 00 00 00 00 58 00 00 58 58 58 00 00 58 58 00 00 00 00 00 58 00 58 58 58 00 58 58 58 58 58 58 00 58 00 58 58 58 58 00 58 00 58 00 00 58 00 58 58 58 58 00 00 00 00 58 00 58 00 00 58 58 58 58 58 58 00 00 00 00 58 00 00 00 00 58 58 00 00 58 00 00 58 00 58 58 00 00 00 00 58 00 00 00 58 58 58 58 00 00 00 58 00 00 00 00 00 58 00 58 58 00 58 58 58 00 00 58 00 58 58 00 58 58 58 00 00 58 58 00 58 58 00 00 00 58 00 58 00 58 00 00 00 58 00 58 00 00 58 00 58 58 00 00 00 58 00 00 58 00 00 00 58 00 58 00 58 58 58 00 00 00 00 58 58 00 58 58 58 58 58 58 58 58 00 00 58 00 00 00 00 00 00 00 00 58 58 00 58 00 00 00 00 00 00 00 58 58 00 58 58 00 00 00 00 58 58 58 58 00 00 58 00 00 58 00 58 58 00 00 58 00 58 00 00 00 00 00 58 00 00 00 00
*/
|
old/Mathematical/Relator/Equals/Proofs.agda | Lolirofle/stuff-in-agda | 6 | 16244 | module Relator.Equals.Proofs where
open import Relator.Equals
open import Structure.Relator.Equivalence
open import Structure.Relator.Properties
open import Structure.Setoid renaming (_≡_ to _≡ₛ_)
instance
[≡]-reflexivity : ∀{ℓ}{A : Type{ℓ}} → Reflexivity(_≡_ {P = A})
Reflexivity.proof([≡]-reflexivity) = constant-path
instance
[≡]-symmetry : ∀{ℓ}{A : Type{ℓ}} → Symmetry(_≡_ {P = A})
Symmetry.proof([≡]-symmetry) = reversed-path
|
asm/script/profiles/profile_28/script.asm | h3rmit-git/F-Zero-Climax-GBA-Translation | 6 | 5882 | <filename>asm/script/profiles/profile_28/script.asm
; F-Zero Climax Translation by Normmatt
.align 4
Profile28_CharacterProfile:
.sjis "かつてはサムライ",TextNL,"ゴローの右うでと呼",TextNL,"ばれた男だったが、",TextNL,"次第に対立し、今で",TextNL,"はゴローへの復しゅ",TextNL,"うに燃える一匹オオ",TextNL,"カミの宇宙とうぞく。",TextNL,"彼の野望は全宇宙の",TextNL,"F-ZEROファン",TextNL,"の前でグランプリで",TextNL,"ゴローをたたきのめ",TextNL,"すことだ。",TextNL,""
.align 4
Profile28_VehicleProfile:
.sjis "マシンナンバー17",TextNL,TextNL,"元はゴローのスペア",TextNL,"マシンだったもの。",TextNL,"がんじょうなボディ",TextNL,"はファイアスティン",TextNL,"グレーと同等だが、",TextNL,"ブーストが優れてい",TextNL,"る分、グリップが",TextNL,"弱く、このマシンを",TextNL,"乗りこなせる人間は",TextNL,"宇宙にそうはいない。",TextNL,""
; make sure to leave an empty line at the end |
programs/oeis/107/A107991.asm | karttu/loda | 0 | 94993 | ; A107991: Complexity (number of maximal spanning trees) in an unoriented simple graph with nodes {1,2,...,n} and edges {i,j} if i + j > n.
; 1,1,1,3,8,40,180,1260,8064,72576,604800,6652800,68428800,889574400,10897286400,163459296000,2324754432000,39520825344000,640237370572800,12164510040883200
mov $4,$0
div $0,2
mov $2,$4
fac $2
mov $3,1
pow $4,0
mul $4,2
mov $5,$0
mov $0,2
add $3,$5
div $2,$3
mul $3,0
lpb $0,1
sub $0,1
mov $1,$2
add $2,$4
pow $5,$3
lpe
add $1,$5
sub $1,3
|
oeis/036/A036715.asm | neoneye/loda-programs | 11 | 92614 | ; A036715: a(n)=number of Gaussian integers z=a+bi satisfying |z|<=n+1/2, a>=0, 0<=b<=a.
; Submitted by <NAME>
; 1,3,5,8,13,17,23,29,36,45,53,63,72,84,96,107,122,137,152,167,182,201,219,238,257,279,300,321,345,367,393,418,442,469,498,527,556,585,617,647,681,713,747,782,816,853,888,927,966,1006
mov $1,1
lpb $0
mov $2,$0
sub $0,1
seq $2,36716 ; a(n)=number of Gaussian integers z=a+bi satisfying n-1/2<|z|<=n+1/2, a>=0, 0<=b<=a.
add $1,$2
lpe
mov $0,$1
|
oeis/135/A135731.asm | neoneye/loda-programs | 11 | 171455 | ; A135731: a(1) = 3; thereafter a(n+1) = a(n) + nextprime(a(n)) - prevprime(a(n)).
; Submitted by <NAME>(s1)
; 3,6,8,12,14,18,20,24,30,32,38,42,44,48,54,60,62,68,72,74,80,84,90,98,102,104,108,110,114,128,132,138,140,150,152,158,164,168,174,180,182,192,194,198,200,212,224,228,230,234,240,242,252,258,264,270,272,278
seq $0,5097 ; (Odd primes - 1)/2.
add $1,$0
min $1,2
mul $1,$0
add $1,2
mov $0,$1
|
scripts/Route15Gate1F.asm | AmateurPanda92/pokemon-rby-dx | 9 | 95282 | Route15Gate1F_Script:
jp EnableAutoTextBoxDrawing
Route15Gate1F_TextPointers:
dw Route15GateText1
Route15GateText1:
TX_FAR _Route15GateText1
db "@"
|
oeis/099/A099530.asm | neoneye/loda-programs | 11 | 23511 | ; A099530: Expansion of 1/(1-x+x^4).
; Submitted by <NAME>
; 1,1,1,1,0,-1,-2,-3,-3,-2,0,3,6,8,8,5,-1,-9,-17,-22,-21,-12,5,27,48,60,55,28,-20,-80,-135,-163,-143,-63,72,235,378,441,369,134,-244,-685,-1054,-1188,-944,-259,795,1983,2927,3186,2391,408,-2519,-5705,-8096,-8504,-5985,-280,7816,16320,22305,22585,14769
lpb $0
sub $0,2
add $2,1
mov $3,$2
sub $3,$0
sub $0,1
bin $3,$2
add $1,$3
lpe
mov $0,$1
add $0,1
|
programs/oeis/068/A068346.asm | jmorken/loda | 1 | 22036 | ; A068346: a(n) = n'' = second arithmetic derivative of n.
; 0,0,0,0,4,0,1,0,16,5,1,0,32,0,6,12,80,0,10,0,44,7,1,0,48,7,8,27,80,0,1,0,176,9,1,16,92,0,10,32,72,0,1,0,112,16,10,0,240,9,39,24,92,0,108,32,96,13,1,0,96,0,14,20,640,21,1,0,156,15,1,0,220,0,16,16,176,21,1,0,368,216,1,0,128,13,39,80,188,0,44,24,272,19,14,44,560,0,18,55,188,0,20,0,168,1,16,0,540,0,32,68,608,0,1,32,244,32,1,44,248,13,51,48,448,55,103,0,1408,25,1,0,192,15,26,297,216,0,22,0,192,45,1,44,1472,19,55,20,236,0,42,0,240,40,1,60,284,0,108,92,1296,31,324,0,332,1,22,0,336,15,46,44,368,0,1,24,752,33,20,0,832,0,1,192,288,41,30,32,640,540,24,0,2368,0,75,24,456,0,86,0,476,59,1,60,288,25,71,91,1296,31,32,0,540,39,1,112,1188,21,40,80,288,31,1,0,1200,608,28,0,320,0,123,1,360,0,100,56,608,43,1,0,1552,0,103,621,380,24,1,80,476,45
cal $0,3415 ; a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(mn) = m*a(n) + n*a(m).
cal $0,3415 ; a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(mn) = m*a(n) + n*a(m).
mov $1,$0
|
ejercicios6/eliminar_primera_aparicion.adb | iyan22/AprendeAda | 0 | 14299 | <gh_stars>0
with Datos, Ada.Text_Io;
use Datos, Ada.Text_Io;
procedure Eliminar_Primera_Aparicion (
L : in out Lista;
Num : in Integer ) is
-- Pre:
-- Post: se ha eliminado de L la primera aparicion de Num
-- en caso de que no aparezca se escribira un mensaje
begin
end Eliminar_Primera_Aparicion;
|
notes/talks/MetaVars/Plus.agda | shlevy/agda | 1,989 | 11561 | <gh_stars>1000+
module Plus where
data Nat : Set where
zero : Nat
suc : Nat -> Nat
infixr 40 _+_
infix 10 _==_
_+_ : Nat -> Nat -> Nat
zero + m = m
suc n + m = suc (n + m)
data _==_ (x, y : Nat) : Set where
-- ...
postulate
refl : {n : Nat} -> n == n
cong : (f : Nat -> Nat){n, m : Nat} -> n == m -> f n == f m
plusZero : {n : Nat} -> n + zero == n
plusZero {zero} = refl
plusZero {suc n} = cong suc plusZero
|
xpath/xpathgrammer/XPath.g4 | cs4221/xpath | 0 | 7294 | grammar XPath;
/*
Adapted from XPath2.0 @https://github.com/antlr/grammars-v4/blob/master/xpath/xpath20/XPath20.g4
Original author: <NAME>, 2 Jan 2022
This is a subset of the XPath2.0 grammar based on NUS CS4221 lecture content.
Issues:
1. Unable to match node(), text() and processing-instructions() {problem caused by greedy matching}
2. Unable to match more than one predicate conditions (predepxrsingle) i.e. a="gt" or a="few"
3. Unable to match path disjunction i.e. (/album1 | /album2)/name
*/
// Parser Rules
xpath: expr EOF;
// Location step
expr: document ( locationstepexpr )*;
document: 'doc' OP StringLiteral CP;
locationstepexpr: SLASH relativepath
| SLASH relativepath pred
;
// Paths
absolutepath: SLASH path;
relativepath: path;
path: unqualifiedpath | qualifiedpath ;
unqualifiedpath: nodetest;
qualifiedpath: AXES COLONCOLON nodetest;
// Nodetest
// ! Unable to match the selectors as ANTLR4 tries to match the largest possible, which is nodeselector
nodetest: allnodeselector
| alltextselector
| allcommentselector
| allprocessinginstructionselector
| allselector
| nodeselector
;
allselector: STAR;
allnodeselector: KW_NODE OP CP;
alltextselector: KW_TEXT OP CP;
allcommentselector: KW_COMMENT OP CP;
allprocessinginstructionselector: KW_PROCESSING_INSTRUCTION OP CP;
nodeselector: NODE_NAME;
// Predicates
pred: OB predexpr CB;
predexpr: predexprsingle ( PREDICATE_CONNECTIVES predexprsingle )*;
predexprsingle: predpath PREDICATE_OPERATOR literal;
predpath: absolutepath ( SLASH relativepath )*
| relativepath ( SLASH relativepath )*
;
literal: IntegerLiteral | StringLiteral;
// Lexer Rules
AXES: KW_ANCESTOR
| KW_ANCESTOR_OR_SELF
| KW_ATTRIBUTE
| KW_CHILD
| KW_DESCENDANT
| KW_DESCENDANT_OR_SELF
| KW_FOLLOWING
| KW_FOLLOWING_SIBLING
| KW_PARENT
| KW_PRECEDING
| KW_PRECEDING_SIBLING
| KW_SELF
;
// NODE_NAME is alias for xml tag names:
// - Element names are case-sensitive
// - Element names must start with a letter or underscore
// - Element names cannot start with the letters xml(or XML, or Xml, etc)
// - Element names can contain letters, digits, hyphens, underscores, and periods
// - Element names cannot contain spaces
NODE_NAME: [a-zA-Z_][a-zA-Z0-9._-]*;
DOCUMENT_NAME: [a-zA-Z0-9._-]+;
PREDICATE_OPERATOR: EQ
| LT
| GT
| LE
| GE
| NE
;
PREDICATE_CONNECTIVES: KW_OR
| KW_AND
| KW_NOT
| P
;
AT : '@' ;
BANG : '!' ;
CB : ']' ;
CC : '}' ;
CEQ : ':=' ;
COLON : ':' ;
COLONCOLON : '::' ;
COMMA : ',' ;
CP : ')' ;
CS : ':*' ;
D : '.' ;
DD : '..' ;
DOLLAR : '$' ;
EG : '=>' ;
EQ : '=' ;
GE : '>=' ;
GG : '>>' ;
GT : '>' ;
LE : '<=' ;
LL : '<<' ;
LT : '<' ;
MINUS : '-' ;
NE : '!=' ;
OB : '[' ;
OC : '{' ;
OP : '(' ;
P : '|' ;
PLUS : '+' ;
POUND : '#' ;
PP : '||' ;
QM : '?' ;
SC : '*:' ;
SLASH : '/' ;
SS : '//' ;
STAR : '*' ;
// Keywords for XPath
KW_ANCESTOR: 'ancestor';
KW_ANCESTOR_OR_SELF: 'ancestor-or-self';
KW_AND: 'and';
KW_ATTRIBUTE: 'attribute';
KW_CHILD: 'child';
KW_COMMENT: 'comment';
KW_DESCENDANT: 'descendant';
KW_DESCENDANT_OR_SELF: 'descendant-or-self';
KW_FOLLOWING: 'following';
KW_FOLLOWING_SIBLING: 'following-sibling';
KW_NODE: 'node';
KW_NOT: 'not';
KW_OR: 'or';
KW_PARENT: 'parent';
KW_PRECEDING: 'preceding';
KW_PRECEDING_SIBLING: 'preceding-sibling';
KW_PROCESSING_INSTRUCTION: 'processing-instruction';
KW_SELF: 'self';
KW_TEXT: 'text';
IntegerLiteral : FragDigits;
StringLiteral : ('"' (FragEscapeQuot | ~[^"])*? '"') | ('\'' (FragEscapeApos | ~['])*? '\'');
fragment FragEscapeQuot : '""';
fragment FragEscapeApos : '\'';
fragment FragDigits : [0-9]+ ;
WS: [ \t\n\r\f]+ -> skip;
|
data/baseStats_weird/granbull_alt.asm | longlostsoul/EvoYellow | 16 | 99078 | <reponame>longlostsoul/EvoYellow
db DEX_GRANBULL ; pokedex id
db 90 ; base hp
db 120 ; base attack
db 75 ; base defense
db 45 ; base speed
db 60 ; base special
db FAIRY ; species type 1
db DARK ; species type 2
db 19 ; catch rate
db 69 ; base exp yield
INCBIN "pic/ymon/Granbull.pic",0,1 ; 55, sprite dimensions
dw GranbullPicFront
dw GranbullPicBack
; attacks known at lvl 0
db BITE
db GROWL
db 0
db 0
db 0 ; growth rate
; learnset
tmlearn 6,7,8
tmlearn 9,10,11,12,16
tmlearn 20,24
tmlearn 25,31,30,32
tmlearn 34,39,40
tmlearn 44,49
tmlearn 50
db BANK(GranbullPicFront)
|
Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_1181.asm | ljhsiun2/medusa | 9 | 86580 | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x1bcf5, %rsi
lea addresses_A_ht+0x2d59, %rdi
nop
nop
dec %r9
mov $57, %rcx
rep movsb
nop
nop
nop
nop
add %rbp, %rbp
lea addresses_D_ht+0x7e09, %rsi
lea addresses_D_ht+0x17859, %rdi
nop
nop
add %rax, %rax
mov $13, %rcx
rep movsq
nop
nop
nop
add %rcx, %rcx
lea addresses_D_ht+0x459, %rbp
cmp $55719, %r9
movb (%rbp), %cl
nop
nop
nop
and $29665, %rcx
lea addresses_normal_ht+0x27d9, %rcx
nop
nop
nop
nop
inc %rdx
movups (%rcx), %xmm0
vpextrq $1, %xmm0, %rax
nop
nop
nop
nop
sub $46416, %rbp
lea addresses_A_ht+0xbd9, %rdx
nop
nop
xor %rbp, %rbp
mov (%rdx), %r9
nop
nop
nop
nop
dec %r9
lea addresses_D_ht+0x3239, %rcx
nop
nop
nop
and %rbp, %rbp
movb (%rcx), %dl
nop
sub $28915, %rdi
lea addresses_normal_ht+0x9284, %rdi
nop
nop
nop
dec %rsi
mov (%rdi), %ecx
nop
nop
nop
nop
nop
cmp %rbp, %rbp
lea addresses_normal_ht+0x1bd9, %rdx
nop
nop
nop
nop
nop
and %rdi, %rdi
movups (%rdx), %xmm3
vpextrq $0, %xmm3, %rsi
nop
nop
add $56380, %rbp
lea addresses_WT_ht+0x1e904, %rsi
lea addresses_D_ht+0x115c9, %rdi
nop
nop
nop
nop
nop
cmp $61186, %r13
mov $32, %rcx
rep movsl
nop
nop
nop
and %rdx, %rdx
lea addresses_A_ht+0xa529, %rsi
lea addresses_WC_ht+0x4bd9, %rdi
nop
nop
xor $39096, %r9
mov $104, %rcx
rep movsw
nop
nop
nop
nop
sub $55368, %rax
lea addresses_UC_ht+0x165d9, %r13
nop
nop
nop
nop
and %rbp, %rbp
mov $0x6162636465666768, %rsi
movq %rsi, (%r13)
nop
nop
nop
nop
cmp %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r9
push %rbp
push %rcx
push %rdi
// Store
lea addresses_D+0x46d9, %rdi
nop
nop
nop
nop
add %r14, %r14
mov $0x5152535455565758, %rcx
movq %rcx, %xmm6
vmovups %ymm6, (%rdi)
nop
nop
nop
sub $37171, %r10
// Store
lea addresses_UC+0x74d9, %r12
nop
cmp $25869, %r9
mov $0x5152535455565758, %rdi
movq %rdi, %xmm3
vmovaps %ymm3, (%r12)
nop
nop
nop
nop
xor %rcx, %rcx
// Load
lea addresses_WT+0x5b19, %r12
nop
nop
nop
sub $41946, %r10
movups (%r12), %xmm3
vpextrq $0, %xmm3, %rdi
nop
nop
xor $0, %r14
// Store
lea addresses_US+0x153d9, %rcx
nop
nop
nop
nop
nop
dec %r9
mov $0x5152535455565758, %r12
movq %r12, %xmm1
vmovups %ymm1, (%rcx)
nop
nop
nop
dec %rcx
// Faulty Load
lea addresses_US+0x153d9, %r9
nop
nop
nop
sub $63954, %r10
vmovups (%r9), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %rdi
lea oracles, %r12
and $0xff, %rdi
shlq $12, %rdi
mov (%r12,%rdi,1), %rdi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 6, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': True, 'congruent': 7, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': True, 'congruent': 7, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 10, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 5, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 10, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 9, 'size': 8, 'same': False, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
data/pokemon/base_stats/hoenn/manectric.asm | Dev727/ancientplatinum | 0 | 6815 | <filename>data/pokemon/base_stats/hoenn/manectric.asm
db 0 ; 310 DEX NO
db 70, 75, 60, 105, 105, 60
; hp atk def spd sat sdf
db ELECTRIC, ELECTRIC ; type
db 45 ; catch rate
db 168 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F50 ; gender ratio
db 100 ; unknown 1
db 20 ; step cycles to hatch
db 5 ; unknown 2
INCBIN "gfx/pokemon/hoenn/manectric/front.dimensions"
db 0, 0, 0, 0 ; padding
db GROWTH_SLOW ; growth rate
dn EGG_GROUND, EGG_GROUND ; egg groups
; tm/hm learnset
tmhm
; end
|
private/tetris.adb | albinjal/ada_basic | 3 | 1931 | with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with Ada.Float_Text_IO; use Ada.Float_Text_IO;
with Ada.Real_Time; use Ada.Real_Time;
with Ada.Calendar; use Ada.Calendar;
procedure Tetris is
Rows: Integer := 38;
Cols: Integer := 22;
FPS: Integer := 240;
-- Höjd: Integer := 18;
-- Bredd: Integer := 10;
I: Integer := 0;
Poll_Time : Time_Span := Milliseconds (1000/FPS);
Blockcol: Integer := 6;
Blockrow: Integer := 0;
Answer : Character;
Available: Boolean := False;
Fastdrop: Boolean := False;
-- Framestart: Time;
-- Period : constant Time_Span := Milliseconds (1000/60);
begin
loop
Get_Immediate(Answer, Available);
if Available then
case Answer is
when 'd' => Blockcol := Blockcol + 2;
when 'a' => Blockcol := Blockcol - 2;
when ' ' => Fastdrop := True;
when others => null;
end case;
Available := False;
end if;
-- Framestart := Clock;
Put(I); New_Line(1);
for Row in 1..Rows loop
for Col in 1..Cols loop
if Row = 1 or Row = Rows then
Put("--");
else if Col = 1 or Col = Cols then
Put("|");
else
if Row = Blockrow or Row = Blockrow + 1 then
if Col = Blockcol or Col = Blockcol +1 then
Put("[]");
else
Put(" ");
end if;
else
Put(" ");
end if;
end if;
end if;
end loop;
New_Line(1);
end loop;
if Fastdrop or I mod FPS = 0 then
if Blockrow = Rows -2 then
Fastdrop := False;
delay until Clock + Milliseconds(500);
Blockrow := 0;
Blockcol := 6;
else
Blockrow := Blockrow + 2;
end if;
end if;
I := I + 1;
delay until Clock + Poll_Time;
--New_Line(30);
-- CLEAR TERMINAL
Ada.TEXT_IO.Put(ASCII.ESC & "[2J");
end loop;
end Tetris;
|
Src/Ant32/x.asm | geoffthorpe/ant-architecture | 0 | 11948 | <gh_stars>0
bezi ze, $foo
bezi ze, $foo
bezi ze, $foo
bezi ze, $foo
foo:
|
Lista2/Lista2/Parte2/Programa8.asm | GustavoLR548/ACII-GLR | 1 | 29768 | .text
#$8 = 0x12345678.
addi $8,$zero,0x1234
sll $8,$8,16
add $8,$8,0x5678
#$9 = 0x12
ori $9, $0, 0x1234
srl $9, $9, 8
#$10 = 0x34
addi $7,$zero,0x1234
andi $10, $7, 0x34
#$11 = 0x56
andi $11, $8, 0x5678
srl $11, $11, 8
#$12 = 0x78
andi $12,$8,0x78
|
oeis/219/A219020.asm | neoneye/loda-programs | 11 | 246087 | <reponame>neoneye/loda-programs
; A219020: Sum of the cubes of the first n even-indexed Fibonacci numbers divided by the sum of the first n terms.
; 1,7,45,297,2002,13630,93177,638001,4371235,29956465,205313076,1407206412,9645056785,66107994667,453110391657,3105663400665,21286529888422,145900036590826,1000013702089545,6854195814790005,46979356835860351,322001301602738017,2207029753248402600,15127206968164865112,103683419016126911137,710656726124358501775,4870913663801066310117,33385738920343521806601,228829258778238151039930,1568419072526366813446870,10750104248903824812306201,73682310669793849402376697,505026070439635953324153115
mov $1,2
mov $2,1
lpb $0
sub $0,1
add $2,$1
add $1,$2
lpe
mov $0,$1
add $0,1
mul $0,$1
sub $0,6
div $0,4
add $0,1
|
programs/oeis/246/A246057.asm | karttu/loda | 1 | 17529 | ; A246057: a(n) = (5*10^n - 2)/3.
; 1,16,166,1666,16666,166666,1666666,16666666,166666666,1666666666,16666666666,166666666666,1666666666666,16666666666666,166666666666666,1666666666666666,16666666666666666
mov $1,1
mov $2,1
lpb $0,1
sub $1,$2
sub $0,1
add $4,$2
add $0,2
sub $3,$3
add $2,$4
add $2,1
add $3,$2
add $3,$2
add $2,$3
add $3,$2
sub $3,3
add $3,4
sub $0,2
add $1,$3
sub $4,$1
mov $2,$3
lpe
|
programs/oeis/278/A278718.asm | jmorken/loda | 1 | 167880 | <gh_stars>1-10
; A278718: Numerators of A189733: periodic sequence repeating [0, 1, 1, 1, 0, -1].
; 0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0,-1,0,1,1,1,0
add $0,1
gcd $0,6
div $0,2
lpb $0
sub $0,4
lpe
mov $1,$0
|
tests/stack_and_math/round_floats.asm | UPB-FILS-ALF/devoir-1-tests | 0 | 175610 | push 5.5
push 3.3
stack
div
print
|
src/portscan-packager.adb | kraileth/ravenadm | 18 | 29940 | -- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../License.txt
with File_Operations;
with PortScan.Log;
with Parameters;
with Unix;
with Ada.Characters.Latin_1;
with Ada.Directories;
with Ada.Text_IO;
package body PortScan.Packager is
package FOP renames File_Operations;
package LOG renames PortScan.Log;
package LAT renames Ada.Characters.Latin_1;
package DIR renames Ada.Directories;
package TIO renames Ada.Text_IO;
package PM renames Parameters;
--------------------------------------------------------------------------------------------
-- exec_phase_package
--------------------------------------------------------------------------------------------
function exec_phase_package
(specification : PSP.Portspecs;
log_handle : in out TIO.File_Type;
log_name : String;
phase_name : String;
seq_id : port_id;
port_prefix : String;
rootdir : String) return Boolean
is
procedure metadata (position : subpackage_crate.Cursor);
procedure package_it (position : subpackage_crate.Cursor);
namebase : constant String := HT.USS (all_ports (seq_id).port_namebase);
conbase : constant String := "/construction/" & namebase;
spkgdir : constant String := rootdir & "/construction/metadata/";
wrkdir : constant String := rootdir & conbase;
chspkgdir : constant String := "/construction/metadata/";
newpkgdir : constant String := "/construction/new_packages";
stagedir : constant String := conbase & "/stage";
display : constant String := "/+DISPLAY";
pkgvers : constant String := HT.USS (all_ports (seq_id).pkgversion);
usrgrp_pkg : constant String := specification.get_field_value (PSP.sp_ug_pkg);
ug_install : constant String := wrkdir & "/users-groups-install.sh";
ug_desinst : constant String := wrkdir & "/users-groups-deinstall.sh";
still_good : Boolean := True;
procedure metadata (position : subpackage_crate.Cursor)
is
type three is range 1 .. 3;
function convert_prepost (prepost : three) return String;
function convert_stage (stage : three) return String;
subpackage : constant String :=
HT.USS (subpackage_crate.Element (position).subpackage);
message_file : constant String := wrkdir & "/.PKG_DISPLAY." & subpackage;
descript_file : constant String := wrkdir & "/.PKG_DESC." & subpackage;
scr_preinst : constant String := spkgdir & subpackage & "/pkg-pre-install";
scr_pstdeinst : constant String := spkgdir & subpackage & "/pkg-post-deinstall";
descript : String := "/+DESC";
manifest : String := "/+MANIFEST";
function convert_prepost (prepost : three) return String is
begin
case prepost is
when 1 => return "pre-";
when 2 => return "";
when 3 => return "post-";
end case;
end convert_prepost;
function convert_stage (stage : three) return String is
begin
case stage is
when 1 => return "install";
when 2 => return "upgrade";
when 3 => return "deinstall";
end case;
end convert_stage;
begin
DIR.Create_Path (spkgdir & subpackage);
if DIR.Exists (message_file) then
DIR.Copy_File (Source_Name => message_file,
Target_Name => spkgdir & subpackage & display);
end if;
if DIR.Exists (descript_file) then
DIR.Copy_File (Source_Name => descript_file,
Target_Name => spkgdir & subpackage & descript);
end if;
for action in three'Range loop
for psp in three'Range loop
declare
script_file : String := wrkdir & "/pkg-" & convert_prepost (psp) &
convert_stage (action) & "." & subpackage;
pkg_script : String := spkgdir & subpackage & "/pkg-" & convert_prepost (psp) &
convert_stage (action);
begin
if DIR.Exists (script_file) then
DIR.Copy_File (Source_Name => script_file,
Target_Name => pkg_script);
end if;
end;
end loop;
end loop;
if subpackage = usrgrp_pkg then
if DIR.Exists (ug_install) then
FOP.concatenate_file (basefile => scr_preinst, another_file => ug_install);
end if;
if DIR.Exists (ug_desinst) then
FOP.concatenate_file (basefile => scr_pstdeinst, another_file => ug_desinst);
end if;
end if;
write_package_manifest (spec => specification,
port_prefix => port_prefix,
subpackage => subpackage,
seq_id => seq_id,
pkgversion => pkgvers,
filename => spkgdir & subpackage & manifest);
end metadata;
procedure package_it (position : subpackage_crate.Cursor)
is
subpackage : constant String := HT.USS (subpackage_crate.Element (position).subpackage);
package_list : constant String := conbase & "/.manifest." & subpackage & ".mktmp";
FORCE_POST_PATTERNS : constant String := "rmdir mkfontscale mkfontdir fc-cache " &
"fonts.dir fonts.scale gtk-update-icon-cache gio-querymodules gtk-query-immodules " &
"load-octave-pkg ocamlfind update-desktop-database update-mime-database " &
"gdk-pixbuf-query-loaders catalog.ports glib-compile-schemas ccache-update-links";
MORE_ENV : constant String :=
" RAVENSW_DBDIR=/var/db/pkg8" &
" PLIST_KEYWORDS_DIR=/xports/Mk/Keywords ";
PKG_CREATE : constant String := "/usr/bin/ravensw create";
PKG_CREATE_ARGS : constant String :=
" --root-dir " & stagedir &
" --metadata " & chspkgdir & subpackage &
" --plist " & package_list &
" --out-dir " & newpkgdir &
" --verbose ";
namebase : constant String := specification.get_namebase;
pkgname : String := namebase & "-" & subpackage & "-" &
HT.USS (all_ports (seq_id).port_variant) & "-" & pkgvers;
package_cmd : constant String := PM.chroot_cmd & rootdir & " /usr/bin/env FORCE_POST=" &
LAT.Quotation & FORCE_POST_PATTERNS & LAT.Quotation & MORE_ENV &
PKG_CREATE & PKG_CREATE_ARGS & pkgname;
move_cmd : constant String := PM.chroot_cmd & rootdir & " /bin/mv " & newpkgdir & "/" &
pkgname & arc_ext & " /packages/All/";
link_cmd : constant String := PM.chroot_cmd & rootdir & " /bin/ln -sf /packages/All/" &
pkgname & arc_ext & " /packages/Latest/" & pkgname & arc_ext;
begin
if still_good then
if DIR.Exists (spkgdir & subpackage & display) then
dump_pkg_message_to_log (display_file => spkgdir & subpackage & display,
log_handle => log_handle);
end if;
if not DIR.Exists (rootdir & package_list) then
still_good := False;
TIO.Put_Line
(log_handle, "=> The package list " & package_list & " for the " &
subpackage & " subpackage does not exist.");
end if;
TIO.Put_Line (log_handle, "===> Building " & pkgname & " subpackage");
TIO.Close (log_handle);
still_good := execute_command (package_cmd, log_name);
if still_good then
still_good := execute_command (move_cmd, log_name);
end if;
if still_good and then namebase = "pkg" then
still_good := execute_command (link_cmd, log_name);
end if;
TIO.Open (File => log_handle,
Mode => TIO.Append_File,
Name => log_name);
end if;
end package_it;
begin
LOG.log_phase_begin (log_handle, phase_name);
all_ports (seq_id).subpackages.Iterate (metadata'Access);
check_deprecation (specification, log_handle);
if not create_package_directory_if_necessary (log_handle) or else
not create_latest_package_directory_too (log_handle)
then
return False;
end if;
DIR.Create_Directory (rootdir & newpkgdir);
all_ports (seq_id).subpackages.Iterate (package_it'Access);
LOG.log_phase_end (log_handle);
return still_good;
exception
when others =>
return False;
end exec_phase_package;
--------------------------------------------------------------------------------------------
-- create_package_directory_if_necessary
--------------------------------------------------------------------------------------------
function create_package_directory_if_necessary (log_handle : TIO.File_Type) return Boolean
is
packagedir : String := HT.USS (PM.configuration.dir_repository);
begin
if DIR.Exists (packagedir) then
return True;
end if;
DIR.Create_Directory (packagedir);
return True;
exception
when others =>
TIO.Put_Line (log_handle, "=> Can't create directory " & packagedir);
return False;
end create_package_directory_if_necessary;
--------------------------------------------------------------------------------------------
-- create_package_directory_if_necessary
--------------------------------------------------------------------------------------------
function create_latest_package_directory_too (log_handle : TIO.File_Type) return Boolean
is
packagedir : String := HT.USS (PM.configuration.dir_packages) & "/Latest";
begin
if DIR.Exists (packagedir) then
return True;
end if;
DIR.Create_Directory (packagedir);
return True;
exception
when others =>
TIO.Put_Line (log_handle, "=> Can't create directory " & packagedir);
return False;
end create_latest_package_directory_too;
--------------------------------------------------------------------------------------------
-- dump_pkg_message_to_log
--------------------------------------------------------------------------------------------
procedure dump_pkg_message_to_log (display_file : String; log_handle : TIO.File_Type)
is
File_Size : Natural := Natural (DIR.Size (display_file));
begin
if File_Size = 0 then
DIR.Delete_File (display_file);
else
declare
contents : String := FOP.get_file_contents (display_file);
begin
TIO.Put_Line (log_handle, contents);
end;
end if;
end dump_pkg_message_to_log;
--------------------------------------------------------------------------------------------
-- check_deprecation
--------------------------------------------------------------------------------------------
procedure check_deprecation (spec : PSP.Portspecs; log_handle : TIO.File_Type)
is
deprecated : String := spec.get_field_value (PSP.sp_deprecated);
expire_date : String := spec.get_field_value (PSP.sp_expiration);
begin
if deprecated /= "" then
TIO.Put_Line
(log_handle,
"===> NOTICE:" & LAT.LF & LAT.LF &
"This port is deprecated; you may wish to consider avoiding its packages." & LAT.LF &
LAT.LF & deprecated & LAT.Full_Stop & LAT.LF &
"It is scheduled to be removed on or after " & expire_date & LAT.LF
);
end if;
end check_deprecation;
--------------------------------------------------------------------------------------------
-- quote
--------------------------------------------------------------------------------------------
function quote (thetext : String) return String is
begin
return LAT.Quotation & thetext & LAT.Quotation;
end quote;
--------------------------------------------------------------------------------------------
-- write_package_manifest
--------------------------------------------------------------------------------------------
procedure write_package_manifest
(spec : PSP.Portspecs;
port_prefix : String;
subpackage : String;
seq_id : port_id;
pkgversion : String;
filename : String)
is
procedure single_if_defined (name, value, not_value : String);
procedure array_if_defined (name, value : String);
function short_desc return String;
file_handle : TIO.File_Type;
variant : String := HT.USS (all_ports (seq_id).port_variant);
procedure single_if_defined (name, value, not_value : String) is
begin
if value /= "" and then value /= not_value
then
TIO.Put_Line (file_handle, name & ": " & quote (value));
end if;
end single_if_defined;
procedure array_if_defined (name, value : String)
is
-- No identified need for quoting
begin
if value /= "" then
TIO.Put_Line (file_handle, name & ": [ " & value & " ]");
end if;
end array_if_defined;
function short_desc return String is
begin
if spec.get_subpackage_length (variant) = 1 then
return spec.get_tagline (variant);
else
return spec.get_tagline (variant) & " (" & subpackage & ")";
end if;
end short_desc;
name : String := quote (spec.get_namebase & "-" & subpackage & "-" & variant);
origin : String := quote (spec.get_namebase & ":" & variant);
begin
TIO.Create (File => file_handle,
Mode => TIO.Out_File,
Name => filename);
TIO.Put_Line
(file_handle,
LAT.Left_Curly_Bracket & LAT.LF &
"name: " & name & LAT.LF &
"version: " & quote (pkgversion) & LAT.LF &
"origin: " & origin & LAT.LF &
"comment: <<EOD" & LAT.LF &
short_desc & LAT.LF &
"EOD" & LAT.LF &
"maintainer: " & quote (spec.get_field_value (PSP.sp_contacts)) & LAT.LF &
"prefix: " & quote (port_prefix) & LAT.LF &
"categories: [ " & spec.get_field_value (PSP.sp_keywords) & " ]" & LAT.LF &
"licenselogic: " & quote (spec.get_license_scheme)
);
-- We prefer "none" to "WWW : UNKNOWN" in the package manifest
single_if_defined ("www", spec.get_field_value (PSP.sp_homepage), "");
array_if_defined ("licenses", spec.get_field_value (PSP.sp_licenses));
array_if_defined ("users", spec.get_field_value (PSP.sp_users));
array_if_defined ("groups", spec.get_field_value (PSP.sp_groups));
TIO.Put_Line (file_handle, "deps: {");
write_down_run_dependencies (file_handle, seq_id, subpackage);
TIO.Put_Line (file_handle, "}");
TIO.Put_Line (file_handle, "options: {" & spec.get_options_list (variant) & " }");
write_package_annotations (spec, file_handle);
-- Closing Curly Brace for manifest
TIO.Put_Line (file_handle, "}");
TIO.Close (file_handle);
exception
when others =>
if TIO.Is_Open (file_handle) then
TIO.Close (file_handle);
end if;
end write_package_manifest;
--------------------------------------------------------------------------------------------
-- write_complete_metapackage_deps
--------------------------------------------------------------------------------------------
procedure write_complete_metapackage_deps
(spec : PSP.Portspecs;
file_handle : TIO.File_Type;
variant : String;
pkgversion : String)
is
namebase : constant String := spec.get_namebase;
num_subpackages : constant Natural := spec.get_subpackage_length (variant);
begin
for spkg in 1 .. num_subpackages loop
declare
subpackage : constant String := spec.get_subpackage_item (variant, spkg);
begin
if subpackage /= spkg_complete then
TIO.Put_Line
(file_handle, " " &
quote (namebase & LAT.Hyphen & subpackage & LAT.Hyphen & variant) & " : {");
TIO.Put_Line
(file_handle,
" version : " & quote (pkgversion) & "," & LAT.LF &
" origin : " & quote (namebase & LAT.Colon & variant) & LAT.LF &
" },");
end if;
end;
end loop;
end write_complete_metapackage_deps;
--------------------------------------------------------------------------------------------
-- write_down_run_dependencies
--------------------------------------------------------------------------------------------
procedure write_down_run_dependencies
(file_handle : TIO.File_Type;
seq_id : port_id;
subpackage : String)
is
procedure scan (position : subpackage_crate.Cursor);
procedure write_pkg_dep (pkgname, pkgversion, portkey : String);
procedure assemble_origins (dep_position : spkg_id_crate.Cursor);
found_subpackage : Boolean := False;
procedure write_pkg_dep (pkgname, pkgversion, portkey : String) is
begin
TIO.Put_Line (file_handle, " " & quote (pkgname) & " : {");
TIO.Put_Line (file_handle,
" version : " & quote (pkgversion) & "," & LAT.LF &
" origin : " & quote (portkey) & LAT.LF &
" },");
end write_pkg_dep;
procedure assemble_origins (dep_position : spkg_id_crate.Cursor)
is
sprec : subpackage_identifier renames spkg_id_crate.Element (dep_position);
namebase : String := HT.USS (all_ports (sprec.port).port_namebase);
variant : String := HT.USS (all_ports (sprec.port).port_variant);
portkey : String := namebase & LAT.Colon & variant;
pkgversion : String := HT.USS (all_ports (sprec.port).pkgversion);
pkgname : String := namebase & LAT.Hyphen & HT.USS (sprec.subpackage) & LAT.Hyphen &
variant;
begin
write_pkg_dep (pkgname, pkgversion, portkey);
end assemble_origins;
procedure scan (position : subpackage_crate.Cursor)
is
rec : subpackage_record renames subpackage_crate.Element (position);
begin
if not found_subpackage then
if HT.equivalent (rec.subpackage, subpackage) then
found_subpackage := True;
rec.spkg_run_deps.Iterate (assemble_origins'Access);
end if;
end if;
end scan;
begin
all_ports (seq_id).subpackages.Iterate (scan'Access);
end write_down_run_dependencies;
--------------------------------------------------------------------------------------------
-- write_package_annotations
--------------------------------------------------------------------------------------------
procedure write_package_annotations
(spec : PSP.Portspecs;
file_handle : TIO.File_Type)
is
num_notes : constant Natural := spec.get_list_length (PSP.sp_notes);
begin
if num_notes = 0 then
return;
end if;
TIO.Put_Line (file_handle, "annotations: {");
for note in 1 .. num_notes loop
declare
nvpair : String := spec.get_list_item (PSP.sp_notes, note);
key : String := HT.part_1 (nvpair, "=");
value : String := HT.part_2 (nvpair, "=");
begin
TIO.Put_Line (file_handle, key & ": <<EOD" & LAT.LF & value & LAT.LF & "EOD");
end;
end loop;
TIO.Put_Line (file_handle, "}");
end write_package_annotations;
--------------------------------------------------------------------------------------------
-- execute_command
--------------------------------------------------------------------------------------------
function execute_command (command : String; name_of_log : String) return Boolean
is
use type Unix.process_exit;
pid : Unix.pid_t;
status : Unix.process_exit;
hangmonitor : constant Boolean := True;
truecommand : constant String := ravenexec & " " & name_of_log & " " & command;
begin
pid := Unix.launch_process (truecommand);
if Unix.fork_failed (pid) then
return False;
end if;
loop
delay 0.25;
status := Unix.process_status (pid);
if status = Unix.exited_normally then
return True;
end if;
if status = Unix.exited_with_error then
return False;
end if;
end loop;
end execute_command;
end PortScan.Packager;
|
fluidcore/samples/phat-v4.asm | bushy555/ZX-Spectrum-1-Bit-Routines | 59 | 24310 | <gh_stars>10-100
db #00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00
db #00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00
db #00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00
db #00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00,#00
db #02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02
db #02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02
db #02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02
db #02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02
db #02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02
db #02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02
db #02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02
db #02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02,#02
db #04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04
db #04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04
db #04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04
db #04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04,#04
|
programs/oeis/048/A048711.asm | neoneye/loda | 22 | 5601 | <filename>programs/oeis/048/A048711.asm<gh_stars>10-100
; A048711: 2nd row of Family 1 "90 X 150 array": generations 0 .. n of Rule 90 starting from seed pattern 7.
; 7,27,119,427,1799,6939,30583,109227,458759,1769499,7798903,27984299,117901063,454761243,2004318071,7158278827,30064771079,115964117019,511101108343,1833951035819,7726646167303
mov $1,7
lpb $0
sub $0,1
seq $1,48725 ; a(n) = Xmult(n,5) or rule90(n,1).
lpe
mov $0,$1
|
src/GBA.Memory.ads | 98devin/ada-gba-dev | 7 | 25720 | <reponame>98devin/ada-gba-dev<gh_stars>1-10
-- Copyright (c) 2021 <NAME>
-- zlib License -- see LICENSE for details.
with System;
package GBA.Memory is
pragma Preelaborate;
-- Total addressable memory of 28 bits.
subtype Address is System.Address
range 16#0000000# .. 16#FFFFFFF#;
subtype BIOS_Address is Address
range 16#0000000# .. 16#00003FFF#;
subtype External_WRAM_Address is Address
range 16#2000000# .. 16#203FFFF#;
subtype Internal_WRAM_Address is Address
range 16#3000000# .. 16#3007FFF#;
subtype Reserved_Internal_WRAM_Adddress is Internal_WRAM_Address
range 16#3007F00# .. 16#3007FFF#;
subtype IO_Register_Address is Address
range 16#4000000# .. 16#40003FF#;
subtype Palette_RAM_Address is Address
range 16#5000000# .. 16#50003FF#;
subtype Video_RAM_Address is Address
range 16#6000000# .. 16#6017FFF#;
subtype OAM_Address is Address
range 16#7000000# .. 16#70003FF#;
subtype ROM_Address is Address
range 16#8000000# .. 16#DFFFFFF#;
BIOS_Size : constant := BIOS_Address'Range_Length; -- 16kB
External_WRAM_Size : constant := External_WRAM_Address'Range_Length; -- 256kB
Internal_WRAM_Size : constant := Internal_WRAM_Address'Range_Length; -- 32kB
IO_Registers_Size : constant := IO_Register_Address'Range_Length; -- 1kB
Palette_RAM_Size : constant := Palette_RAM_Address'Range_Length; -- 1kB
Video_RAM_Size : constant := Video_RAM_Address'Range_Length; -- 96kB
OAM_Size : constant := OAM_Address'Range_Length; -- 1kB
ROM_Size : constant := ROM_Address'Range_Length; -- 32mB
end GBA.Memory; |
extra/extra/Dummy.agda | manikdv/plfa.github.io | 1,003 | 11643 | import Data.Bool
import Relation.Nullary.Negation
import Relation.Nullary.Decidable
|
libsrc/_DEVELOPMENT/temp/sp1/zx/c/sccz80/sp1_GetSprClrAddr_callee.asm | meesokim/z88dk | 0 | 92713 | ; void __CALLEE__ sp1_GetSprClrAddr_callee(struct sp1_ss *s, uchar **sprdest)
SECTION code_temp_sp1
PUBLIC sp1_GetSprClrAddr_callee
sp1_GetSprClrAddr_callee:
pop hl
pop de
ex (sp),hl
INCLUDE "temp/sp1/zx/sprites/asm_sp1_GetSprClrAddr.asm"
|
oeis/169/A169830.asm | neoneye/loda-programs | 11 | 85084 | ; A169830: Numbers n such that 2*reverse(n) - n = 1.
; 1,73,793,7993,79993,799993,7999993,79999993,799999993,7999999993,79999999993,799999999993,7999999999993,79999999999993,799999999999993,7999999999999993,79999999999999993,799999999999999993,7999999999999999993,79999999999999999993,799999999999999999993,7999999999999999999993,79999999999999999999993,799999999999999999999993,7999999999999999999999993,79999999999999999999999993,799999999999999999999999993,7999999999999999999999999993,79999999999999999999999999993,799999999999999999999999999993
mov $1,10
pow $1,$0
sub $1,1
mul $1,8
add $1,1
mov $0,$1
|
tests/misc/ifused_test.asm | fengjixuchui/sjasmplus | 220 | 245526 | <reponame>fengjixuchui/sjasmplus<gh_stars>100-1000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Test case for IFUSED / IFNUSED ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Compilation:
;; sjasmplus.exe ifused_test.asm --lstlab --lst=ifused_test.lst
;;
;; After compilation, please check the listing file "ifused_test.lst"
;; This must generate syntax errors
IFUSED /* some white space */ ; in comments
IFNUSED /* some white space */ ; in comments
;; All rest of code must be compiled without errors
start
;; Some little user program :)
.noused call EnableInt
.used call Wait
jr .used
;; Some little direct tests
IFUSED /* some white space */ ; in comments
db 'ok'
ELSE
fail
ENDIF
IFNUSED /* some white space */ ; in comments
fail
ELSE
db 'ok'
ENDIF
IFUSED .used /* some white space */ ; in comments
db 'ok'
ELSE
fail
ENDIF
IFUSED start.used /* some white space */ ; in comments
org $-2 : db 'ok'
ELSE
fail
ENDIF
IFUSED @start.used /* some white space */ ; in comments
org $-2 : db 'ok'
ELSE
fail
ENDIF
IFUSED .noused /* some white space */ ; in comments
fail
ENDIF
IFUSED start.noused /* some white space */ ; in comments
fail
ENDIF
IFUSED @start.noused /* some white space */ ; in comments
fail
ENDIF
IFUSED not_defined_label /* some white space */ ; in comments
fail
ENDIF
;; Some little library :)
EnableInt
IFUSED EnableInt
ei
ret
ENDIF
Wait IFUSED
ld b,#FF
.loop
IFUSED EnableInt
.halter halt
ELSE
ld c,#FF ;; When the "call EnableInt" is commented out,
.cycle dec c ;; this branch after ELSE must be generated.
jr nz,.cycle
ENDIF ;; End of IFUSED EnableInt
djnz .loop
ret
ENDIF ;; End of IFUSED Wait
;; ADDENDUM: different code path to generate some more syntax errors
IFUSED Invalid&Label
IFNUSED Invalid%Label
IFUSED ..InvalidLabel
IFNUSED ..InvalidLabel
|
tests/syntax-tests/source/Assembly (x86_64)/test.nasm | JesseVermeulen123/bat | 33,542 | 6779 | <gh_stars>1000+
global enlight
section .data
red dq 0 ; some comment
green dq 0
blue dq 0
data dq 0
N dd 0
M dd 0
change dd 0
delta db 0
section .text
enlight:
call assign_arguments
call set_data
call make_deltas
ret
assign_arguments:
mov qword[red], rdi
mov qword[green], rsi
mov qword[blue], rdx
mov dword[N], ecx
mov dword[M], r8d
mov dword[change], r9d
mov al, byte[rsp + 16]
mov byte[delta], al
ret
set_data:
mov eax, dword[change]
cmp eax, 1
jne not_1
mov rax, qword[red]
mov qword[data], rax
ret
not_1:
cmp eax, 2
jne not_2
mov rax, qword[green]
mov qword[data], rax
ret
not_2:
mov rax, qword[blue]
mov qword[data], rax
ret
make_deltas:
mov ecx, dword[N]
mov eax, dword[M]
imul ecx, eax
loop_start:
call make_delta
loop loop_start
ret
make_delta:
mov rax, qword[data]
add rax, rcx
dec rax
mov dl, byte[delta]
cmp dl, 0
jl substracting
adding:
add dl, byte[rax]
jc adding_overflow
mov byte[rax], dl
ret
adding_overflow:
mov byte[rax], 255
ret
substracting:
mov r9b, dl
mov dl, 0
sub dl, r9b
mov r8b, byte[rax]
sub r8b, dl
jc substracting_overflow
mov byte[rax], r8b
ret
; another comment
substracting_overflow:
mov byte[rax], 0
ret
|
src/bb-gui-controller.ads | jorge-real/Ball-On-Beam | 4 | 4114 | ------------------------------------------------------------
-- B B . G U I . C O N T R O L L E R --
-- --
-- Spec --
-- --
-- "Controller" package of Ball on Beam simulator GUI. -- --
-- --
-- Author: <NAME> --
-- Universitat Politecnica de Valencia --
-- July, 2020 - Version 1 --
-- February, 2021 - Version 2 --
-- --
-- This is free software in the ample sense: --
-- you can use it freely, provided you preserve --
-- this comment at the header of source files --
-- and you clearly indicate the changes made to --
-- the original file, if any. --
------------------------------------------------------------
with Gnoga.Gui.Window;
package BB.GUI.Controller is
procedure Create_GUI
(Main_Window : in out Gnoga.Gui.Window.Window_Type'Class);
end BB.GUI.Controller;
|
oeis/175/A175216.asm | neoneye/loda-programs | 11 | 105523 | <reponame>neoneye/loda-programs<filename>oeis/175/A175216.asm
; A175216: The first nonprimes after the primes.
; Submitted by <NAME>
; 4,4,6,8,12,14,18,20,24,30,32,38,42,44,48,54,60,62,68,72,74,80,84,90,98,102,104,108,110,114,128,132,138,140,150,152,158,164,168,174,180,182,192,194,198,200,212,224,228,230,234,240,242,252,258,264,270,272
trn $0,1
seq $0,298252 ; Even integers n such that n-3 is prime.
sub $0,2
|
programs/oeis/255/A255527.asm | neoneye/loda | 22 | 164448 | <filename>programs/oeis/255/A255527.asm
; A255527: Where records occur in A255437.
; 1,2,3,6,7,8,9,13,14,15,16,17,18,23,24,25,26,27,28,29,30,36,37,38,39,40,41,42,43,44,45,52,53,54,55,56,57,58,59,60,61,62,63,71,72,73,74,75,76,77,78,79,80,81,82,83,84,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,146,147,148,149,150,151,152,153,154
mov $2,$0
lpb $2
add $0,$1
trn $1,1
sub $2,$1
add $1,2
trn $2,$1
lpe
add $0,1
|
bb-runtimes/src/s-bbbosu__prep.adb | JCGobbi/Nucleo-STM32G474RE | 0 | 10256 | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . B B . B O A R D _ S U P P O R T --
-- --
-- B o d y --
-- --
-- Copyright (C) 1999-2002 Universidad Politecnica de Madrid --
-- Copyright (C) 2003-2005 The European Space Agency --
-- Copyright (C) 2003-2016, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
-- The port of GNARL to bare board targets was initially developed by the --
-- Real-Time Systems Group at the Technical University of Madrid. --
-- --
------------------------------------------------------------------------------
with Interfaces; use Interfaces;
with System.BB.Parameters;
with System.IOPorts; use System.IOPorts;
package body System.BB.Board_Support is
use System.BB.Interrupts;
procedure Initialize_PICs;
-- Initialize the PICs
subtype Master_Interrupt_IDs is Interrupt_ID range 1 .. 8;
pragma Unreferenced (Master_Interrupt_IDs);
subtype Slave_Interrupt_IDs is Interrupt_ID range 9 .. 16;
-- There are two PICs. The second one is a slave of the first one
Master_Pic_Port : constant Port_Id := 16#20#;
Slave_Pic_Port : constant Port_Id := 16#A0#;
-- PICs port
----------------------
-- Initialize_Board --
----------------------
procedure Initialize_Board is
begin
Initialize_PICs;
end Initialize_Board;
---------------------
-- Initialize_PICs --
---------------------
procedure Initialize_PICs is
begin
-- Master PIC
-- ICW1: ICW4 needed, cascade mode, edge-triggered
Outb (Master_Pic_Port + 0, 2#0001_0001#);
-- ICW2: Vector 0-7
Outb (Master_Pic_Port + 1, 16#00#);
-- ICW3: (master): slave on int 2
Outb (Master_Pic_Port + 1, 2#0000_0100#);
-- ICW4: 8086 mode, normal EOI, buffered mode/master, not special mode
Outb (Master_Pic_Port + 1, 2#0000_1100#);
-- Slave PIC
-- ICW1: ICW4 needed, cascade mode, edge-triggered
Outb (Slave_Pic_Port + 0, 2#0001_0001#);
-- ICW2: Vector 8-15
Outb (Slave_Pic_Port + 1, 16#08#);
-- ICW3: (slave): slave id 2
Outb (Slave_Pic_Port + 1, 16#02#);
-- ICW4: 8086 mode, normal EOI, buffered mode/slave, not special mode
Outb (Slave_Pic_Port + 1, 2#0000_1000#);
-- Unmask all interrupts except timer
Outb (Master_Pic_Port + 1, 1);
Outb (Slave_Pic_Port + 1, 0);
end Initialize_PICs;
----------------------
-- Ticks_Per_Second --
----------------------
function Ticks_Per_Second return Natural is
begin
-- Frequency of the system clock for the decrementer timer
return 100_000_000;
end Ticks_Per_Second;
---------------------------
-- Clear_Alarm_Interrupt --
---------------------------
procedure Clear_Alarm_Interrupt is
begin
-- Nothing to do on standard powerpc
null;
end Clear_Alarm_Interrupt;
---------------------------
-- Get_Interrupt_Request --
---------------------------
function Get_Interrupt_Request
(Vector : CPU_Specific.Vector_Id) return Interrupt_ID
is
pragma Unreferenced (Vector);
Intack : Unsigned_8;
for Intack'Address use 16#BFFFFFF0#;
pragma Volatile (Intack);
pragma Import (Ada, Intack);
-- Prep specific address to send an IACK request on the bus and get
-- the pending interrupt.
begin
return System.BB.Interrupts.Interrupt_ID (Intack);
end Get_Interrupt_Request;
-------------------------------
-- Install_Interrupt_Handler --
-------------------------------
procedure Install_Interrupt_Handler
(Handler : Address;
Interrupt : Interrupts.Interrupt_ID;
Prio : Interrupt_Priority)
is
pragma Unreferenced (Interrupt, Prio);
begin
CPU_Specific.Install_Exception_Handler
(Handler, CPU_Specific.External_Interrupt_Excp);
end Install_Interrupt_Handler;
---------------------------
-- Priority_Of_Interrupt --
---------------------------
function Priority_Of_Interrupt
(Interrupt : System.BB.Interrupts.Interrupt_ID) return System.Any_Priority
is
begin
-- Assert that it is a real interrupt
pragma Assert (Interrupt /= System.BB.Interrupts.No_Interrupt);
return Interrupt_Priority'First;
end Priority_Of_Interrupt;
-----------------------------
-- Clear_Interrupt_Request --
-----------------------------
procedure Clear_Interrupt_Request
(Interrupt : System.BB.Interrupts.Interrupt_ID)
is
begin
if Interrupt in Slave_Interrupt_IDs then
Outb (Slave_Pic_Port, 2#0010_0000#);
end if;
Outb (Master_Pic_Port, 2#0010_0000#);
end Clear_Interrupt_Request;
--------------------------
-- Set_Current_Priority --
--------------------------
procedure Set_Current_Priority (Priority : Integer) is
begin
-- Note that Priority cannot be the last one, as this procedure is
-- unable to disable the decrementer interrupt.
pragma Assert (Priority /= Interrupt_Priority'Last);
null;
end Set_Current_Priority;
----------------
-- Power_Down --
----------------
procedure Power_Down is
begin
null;
end Power_Down;
end System.BB.Board_Support;
|
samples/volume_servlet.ads | My-Colaborations/ada-servlet | 6 | 22335 | -----------------------------------------------------------------------
-- volume_servlet -- Servlet example to compute some volumes
-- Copyright (C) 2010, 2018 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Servlet.Core;
with Servlet.Requests;
with Servlet.Responses;
package Volume_Servlet is
use Servlet;
-- The <b>Servlet</b> represents the component that will handle
-- an HTTP request received by the server.
type Servlet is new Core.Servlet with null record;
-- Called by the servlet container when a GET request is received.
-- Display the volume form page.
procedure Do_Get (Server : in Servlet;
Request : in out Requests.Request'Class;
Response : in out Responses.Response'Class);
-- Called by the servlet container when a POST request is received.
-- Computes the cylinder volume and display the result page.
procedure Do_Post (Server : in Servlet;
Request : in out Requests.Request'Class;
Response : in out Responses.Response'Class);
end Volume_Servlet;
|
Transynther/x86/_processed/NC/_st_zr_un_/i9-9900K_12_0xa0.log_21829_1205.asm | ljhsiun2/medusa | 9 | 11935 | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r15
push %r8
push %rcx
push %rdi
// Store
lea addresses_normal+0x1b2ba, %r13
nop
nop
nop
and %r15, %r15
movw $0x5152, (%r13)
nop
nop
nop
and $5006, %rcx
// Store
mov $0x650d100000000b2a, %rcx
nop
nop
nop
dec %r12
movb $0x51, (%rcx)
nop
cmp $51291, %r14
// Store
lea addresses_US+0x1452a, %rdi
nop
nop
nop
nop
nop
cmp $44566, %rcx
movl $0x51525354, (%rdi)
and $60224, %r8
// Faulty Load
mov $0x7fed000000000d2a, %r13
nop
nop
nop
nop
dec %rcx
movups (%r13), %xmm2
vpextrq $1, %xmm2, %r12
lea oracles, %rdi
and $0xff, %r12
shlq $12, %r12
mov (%rdi,%r12,1), %r12
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 2}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_NC', 'AVXalign': False, 'size': 1}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_US', 'AVXalign': False, 'size': 4}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_NC', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'72': 1, '38': 27, '08': 128, '00': 21579, '3c': 94}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 38 38 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
programs/oeis/195/A195857.asm | neoneye/loda | 22 | 9095 | ; A195857: a(n) = T(9, n), array T given by A047858.
; 1,11,32,76,168,360,760,1592,3320,6904,14328,29688,61432,126968,262136,540664,1114104,2293752,4718584,9699320,19922936,40894456,83886072,171966456,352321528,721420280,1476395000,3019898872,6174015480,12616466424,25769803768,52613349368,107374182392,219043332088,446676598776,910533066744,1855425871864,3779571220472,7696581394424,15668040695800,31885837205496,64871186038776,131941395333112,268280837177336,545357767376888,1108307720798200,2251799813685240,4573968371548152,9288674231451640,18858823439613944,38280596832649208,77687093572141048,157625986957967352,319755573543305208,648518346341351416,1315051091192184824,2666130979403333624,5404319552844595192,10952754293765046264,22193738963681804280,44963938679667032056,91080798863940911096,184467440737095516152,373546567492618420216,756316507022091616248,1531079758117892784120,3099053004383204671480,6271892985061247549432,12691359922712171511800,25677867750603695849464,51946031311566097350648,105072654243849606004728,212506491729134034616312,429735349941137714446328,868915432848014719320056,1756720331627508019494904,3551219595117973200699384,7177997053961860724817912,14507109835375550096474104,29316451125654757486624760,59237365161116829560602616,119683656141848288295911416,241785163922925834941235192,488406031124310186581295096,986483468805537406560239608,1992309750724908879915778040,4023305127677485893422153720,8123981507810308054025502712,16402705520531288642413395960,33114896050883922353551572984,66848762121410534844552708088,134935464282106449964004540408,272346808642783660477807329272,549645377442708842055211155448,1109194275199700726309615304696,2238195591027967537017616596984,4516005263313067242832005169144,9111238689140398823257554288632,18380933703309326321702196477944,37078780056675709993778568757240
mov $1,2
pow $1,$0
add $0,18
mul $1,$0
div $1,2
sub $1,8
mov $0,$1
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1293.asm | ljhsiun2/medusa | 9 | 97837 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r13
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x117a2, %rax
nop
nop
dec %rsi
movw $0x6162, (%rax)
cmp %rax, %rax
lea addresses_UC_ht+0x172c2, %r11
nop
nop
nop
nop
xor $28307, %rax
movl $0x61626364, (%r11)
nop
nop
nop
nop
nop
sub $57711, %rax
lea addresses_A_ht+0x9ad2, %r13
nop
nop
inc %rcx
vmovups (%r13), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %r11
nop
nop
cmp $43713, %r11
lea addresses_UC_ht+0x32c2, %rsi
lea addresses_normal_ht+0xa942, %rdi
nop
nop
nop
nop
cmp $49811, %r11
mov $120, %rcx
rep movsb
nop
nop
nop
cmp %r11, %r11
lea addresses_normal_ht+0x17692, %rsi
lea addresses_normal_ht+0x1c9a2, %rdi
clflush (%rdi)
nop
nop
nop
nop
and $26108, %r10
mov $48, %rcx
rep movsq
nop
nop
nop
inc %rax
lea addresses_WT_ht+0x10ec2, %rdi
nop
nop
inc %r10
mov $0x6162636465666768, %rcx
movq %rcx, %xmm1
movups %xmm1, (%rdi)
nop
sub %r11, %r11
lea addresses_WC_ht+0x5a52, %rsi
lea addresses_UC_ht+0x14ba2, %rdi
nop
nop
add $34596, %r13
mov $51, %rcx
rep movsl
nop
nop
nop
xor %rsi, %rsi
lea addresses_UC_ht+0x15df2, %rsi
nop
nop
nop
nop
cmp $9324, %rcx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm2
vmovups %ymm2, (%rsi)
nop
nop
nop
nop
nop
cmp $5894, %rax
lea addresses_normal_ht+0x13e61, %rsi
lea addresses_UC_ht+0x1bcb2, %rdi
nop
nop
nop
nop
nop
and %r12, %r12
mov $111, %rcx
rep movsb
nop
nop
nop
nop
nop
add $61600, %rdi
lea addresses_UC_ht+0x4ec2, %r12
clflush (%r12)
nop
nop
add $11288, %rsi
mov $0x6162636465666768, %rdi
movq %rdi, %xmm0
vmovups %ymm0, (%r12)
nop
nop
add $15788, %rsi
lea addresses_WC_ht+0x19ae2, %rsi
lea addresses_D_ht+0x6cfa, %rdi
clflush (%rsi)
nop
nop
nop
sub %r10, %r10
mov $48, %rcx
rep movsq
nop
xor %r12, %r12
lea addresses_WT_ht+0xc4da, %r10
nop
nop
and %r11, %r11
mov (%r10), %ax
nop
nop
nop
nop
dec %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r13
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r9
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_WC+0x5e42, %rsi
lea addresses_PSE+0x164f6, %rdi
nop
sub $23792, %r11
mov $66, %rcx
rep movsb
nop
nop
nop
nop
nop
cmp $41025, %rbx
// Store
lea addresses_UC+0x1cced, %rsi
nop
nop
nop
nop
nop
and $53694, %rcx
mov $0x5152535455565758, %rdi
movq %rdi, %xmm1
vmovups %ymm1, (%rsi)
nop
xor $64619, %r11
// Store
lea addresses_WC+0x6ac2, %r9
nop
nop
nop
nop
sub $55819, %rbx
mov $0x5152535455565758, %r11
movq %r11, %xmm4
movups %xmm4, (%r9)
nop
add $18205, %rdx
// Store
lea addresses_A+0x19ffe, %rdi
nop
nop
nop
nop
nop
sub $38004, %rdx
mov $0x5152535455565758, %r11
movq %r11, %xmm3
vmovups %ymm3, (%rdi)
nop
nop
and $3486, %rcx
// Store
lea addresses_D+0x1eec2, %rsi
add %rcx, %rcx
mov $0x5152535455565758, %r9
movq %r9, (%rsi)
nop
nop
nop
and %rbx, %rbx
// Store
lea addresses_PSE+0x7c02, %rdi
nop
nop
nop
nop
add %r11, %r11
movb $0x51, (%rdi)
nop
inc %r9
// REPMOV
lea addresses_US+0x13ec2, %rsi
lea addresses_A+0xa1e2, %rdi
nop
nop
nop
nop
nop
cmp $32328, %r10
mov $67, %rcx
rep movsb
nop
nop
nop
inc %r9
// Store
lea addresses_UC+0x5312, %rdi
clflush (%rdi)
nop
cmp $30275, %r9
movl $0x51525354, (%rdi)
nop
nop
nop
nop
xor %rdx, %rdx
// Store
lea addresses_UC+0x52c2, %r9
sub %rsi, %rsi
movw $0x5152, (%r9)
nop
dec %rdx
// Store
lea addresses_UC+0x36c2, %r9
nop
dec %r11
movw $0x5152, (%r9)
nop
nop
nop
and %r11, %r11
// Store
lea addresses_WT+0xdac2, %rdx
nop
nop
nop
nop
nop
xor $10360, %rdi
mov $0x5152535455565758, %r11
movq %r11, (%rdx)
nop
nop
cmp $41174, %r11
// Faulty Load
lea addresses_WT+0x9ac2, %rdi
nop
nop
nop
nop
nop
add $23241, %r9
mov (%rdi), %bx
lea oracles, %rdx
and $0xff, %rbx
shlq $12, %rbx
mov (%rdx,%rbx,1), %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT', 'congruent': 0}}
{'dst': {'same': False, 'congruent': 2, 'type': 'addresses_PSE'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC', 'congruent': 0}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WC', 'congruent': 10}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A', 'congruent': 2}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D', 'congruent': 10}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_PSE', 'congruent': 5}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 5, 'type': 'addresses_A'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_US'}}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 4, 'type': 'addresses_UC', 'congruent': 1}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_UC', 'congruent': 11}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_UC', 'congruent': 8}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT', 'congruent': 10}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT_ht', 'congruent': 5}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_UC_ht', 'congruent': 9}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 2}}
{'dst': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}}
{'dst': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT_ht', 'congruent': 9}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 1, 'type': 'addresses_WC_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC_ht', 'congruent': 4}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_normal_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC_ht', 'congruent': 8}, 'OP': 'STOR'}
{'dst': {'same': True, 'congruent': 3, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 2, 'type': 'addresses_WT_ht', 'congruent': 0}}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
|
src/main/antlr/AIL.g4 | AvaliaApp/ail | 0 | 5261 | <reponame>AvaliaApp/ail
grammar AIL;
@header {
package app.avalia.antlr;
}
parse
: base EOF
;
base
: (declaration | instruction)+
;
declaration
: DECLARE name LBRACK instruction* RBRACK
;
instruction
: name (DOLLAR_SIGN id)? (LPAREN arguments RPAREN)?
(LBRACK instruction* RBRACK)?
;
name
: IDENTIFIER;
id
: NUMBER_LITERAL;
arguments
: argument (COMMA argument)*
;
argument
: type
| delegate
| type? value
;
value
: TEXT_LITERAL | NUMBER_LITERAL | DECIMAL_LITERAL | NULL_LITERAL | BOOL_LITERAL
;
delegate
: DELEGATE name
;
type
: INT | CHAR
| SHORT | BOOL
| REF | BYTE
| TEXT | DOUBLE
| FLOAT | LONG
;
// Operators
DOLLAR_SIGN: '$';
LBRACK: '{';
RBRACK: '}';
LPAREN: '(';
RPAREN: ')';
COMMA: ',';
// Keywords
DELEGATE: 'delegate';
DECLARE: 'decl';
// Types
INT: 'int';
CHAR: 'char';
SHORT: 'short';
BOOL: 'bool';
REF: 'ref';
BYTE: 'byte';
TEXT: 'text';
DOUBLE: 'double';
FLOAT: 'float';
LONG: 'long';
// Literals
TEXT_LITERAL
: ["] ( ~["\r\n\\] | '\\' ~[\r\n] )* ["]
| ['] ( ~['\r\n\\] | '\\' ~[\r\n] )* [']
;
NUMBER_LITERAL: [-]? [0-9]+;
DECIMAL_LITERAL: [-]? [0-9]+ ([.] [0-9]+)?;
BOOL_LITERAL: 'true' | 'false';
NULL_LITERAL: 'null';
IDENTIFIER: [a-zA-Z]+;
LINE_COMMENT
: '//' ~[\r\n]* -> skip
;
WS
: [ \t\u000C\r\n]+ -> skip
;
|
refresh.applescript | DogaIster/refresh_in_applescript | 0 | 3713 | <filename>refresh.applescript
#!/bin/bash
while true;
do
osascript -e 'tell application "Google Chrome" to reload (tabs of window 1 whose URL contains "<put the URL you want to reload without http or https>")'
sleep 600
echo "Reloaded"
done
|
src/gen/gstreamer-gst_low_level-gstreamer_0_10_gst_video_video_h.ads | persan/A-gst | 1 | 29055 | <gh_stars>1-10
pragma Ada_2005;
pragma Style_Checks (Off);
pragma Warnings (Off);
with Interfaces.C; use Interfaces.C;
limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h;
with glib;
with glib;
with glib.Values;
with System;
limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h;
with Interfaces.C.Strings;
limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h;
with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h;
with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstformat_h;
limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h;
with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h;
-- limited with GStreamer.GST_Low_Level.glib_2_0_glib_gerror_h;
with System;
package GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_video_h is
GST_VIDEO_BYTE1_MASK_32 : aliased constant String := "0xFF000000" & ASCII.NUL; -- gst/video/video.h:124
GST_VIDEO_BYTE2_MASK_32 : aliased constant String := "0x00FF0000" & ASCII.NUL; -- gst/video/video.h:125
GST_VIDEO_BYTE3_MASK_32 : aliased constant String := "0x0000FF00" & ASCII.NUL; -- gst/video/video.h:126
GST_VIDEO_BYTE4_MASK_32 : aliased constant String := "0x000000FF" & ASCII.NUL; -- gst/video/video.h:127
GST_VIDEO_BYTE1_MASK_24 : aliased constant String := "0x00FF0000" & ASCII.NUL; -- gst/video/video.h:129
GST_VIDEO_BYTE2_MASK_24 : aliased constant String := "0x0000FF00" & ASCII.NUL; -- gst/video/video.h:130
GST_VIDEO_BYTE3_MASK_24 : aliased constant String := "0x000000FF" & ASCII.NUL; -- gst/video/video.h:131
GST_VIDEO_BYTE1_MASK_32_INT : constant := 16#FF000000#; -- gst/video/video.h:133
GST_VIDEO_BYTE2_MASK_32_INT : constant := 16#00FF0000#; -- gst/video/video.h:134
GST_VIDEO_BYTE3_MASK_32_INT : constant := 16#0000FF00#; -- gst/video/video.h:135
GST_VIDEO_BYTE4_MASK_32_INT : constant := 16#000000FF#; -- gst/video/video.h:136
GST_VIDEO_BYTE1_MASK_24_INT : constant := 16#00FF0000#; -- gst/video/video.h:138
GST_VIDEO_BYTE2_MASK_24_INT : constant := 16#0000FF00#; -- gst/video/video.h:139
GST_VIDEO_BYTE3_MASK_24_INT : constant := 16#000000FF#; -- gst/video/video.h:140
GST_VIDEO_COMP1_MASK_16 : aliased constant String := "0xf800" & ASCII.NUL; -- gst/video/video.h:142
GST_VIDEO_COMP2_MASK_16 : aliased constant String := "0x07e0" & ASCII.NUL; -- gst/video/video.h:143
GST_VIDEO_COMP3_MASK_16 : aliased constant String := "0x001f" & ASCII.NUL; -- gst/video/video.h:144
GST_VIDEO_COMP1_MASK_15 : aliased constant String := "0x7c00" & ASCII.NUL; -- gst/video/video.h:146
GST_VIDEO_COMP2_MASK_15 : aliased constant String := "0x03e0" & ASCII.NUL; -- gst/video/video.h:147
GST_VIDEO_COMP3_MASK_15 : aliased constant String := "0x001f" & ASCII.NUL; -- gst/video/video.h:148
GST_VIDEO_COMP1_MASK_16_INT : constant := 16#f800#; -- gst/video/video.h:150
GST_VIDEO_COMP2_MASK_16_INT : constant := 16#07e0#; -- gst/video/video.h:151
GST_VIDEO_COMP3_MASK_16_INT : constant := 16#001f#; -- gst/video/video.h:152
GST_VIDEO_COMP1_MASK_15_INT : constant := 16#7c00#; -- gst/video/video.h:154
GST_VIDEO_COMP2_MASK_15_INT : constant := 16#03e0#; -- gst/video/video.h:155
GST_VIDEO_COMP3_MASK_15_INT : constant := 16#001f#; -- gst/video/video.h:156
-- unsupported macro: GST_VIDEO_RED_MASK_16 GST_VIDEO_COMP1_MASK_16
-- unsupported macro: GST_VIDEO_GREEN_MASK_16 GST_VIDEO_COMP2_MASK_16
-- unsupported macro: GST_VIDEO_BLUE_MASK_16 GST_VIDEO_COMP3_MASK_16
-- unsupported macro: GST_VIDEO_RED_MASK_15 GST_VIDEO_COMP1_MASK_15
-- unsupported macro: GST_VIDEO_GREEN_MASK_15 GST_VIDEO_COMP2_MASK_15
-- unsupported macro: GST_VIDEO_BLUE_MASK_15 GST_VIDEO_COMP3_MASK_15
-- unsupported macro: GST_VIDEO_RED_MASK_16_INT GST_VIDEO_COMP1_MASK_16_INT
-- unsupported macro: GST_VIDEO_GREEN_MASK_16_INT GST_VIDEO_COMP2_MASK_16_INT
-- unsupported macro: GST_VIDEO_BLUE_MASK_16_INT GST_VIDEO_COMP3_MASK_16_INT
-- unsupported macro: GST_VIDEO_RED_MASK_15_INT GST_VIDEO_COMP1_MASK_15_INT
-- unsupported macro: GST_VIDEO_GREEN_MASK_15_INT GST_VIDEO_COMP2_MASK_15_INT
-- unsupported macro: GST_VIDEO_BLUE_MASK_15_INT GST_VIDEO_COMP3_MASK_15_INT
GST_VIDEO_SIZE_RANGE : aliased constant String := "(int) [ 1, max ]" & ASCII.NUL; -- gst/video/video.h:176
GST_VIDEO_FPS_RANGE : aliased constant String := "(fraction) [ 0, max ]" & ASCII.NUL; -- gst/video/video.h:177
-- unsupported macro: GST_VIDEO_CAPS_RGB __GST_VIDEO_CAPS_MAKE_24 (1, 2, 3)
-- unsupported macro: GST_VIDEO_CAPS_BGR __GST_VIDEO_CAPS_MAKE_24 (3, 2, 1)
-- unsupported macro: GST_VIDEO_CAPS_RGBx __GST_VIDEO_CAPS_MAKE_32 (1, 2, 3)
-- unsupported macro: GST_VIDEO_CAPS_xRGB __GST_VIDEO_CAPS_MAKE_32 (2, 3, 4)
-- unsupported macro: GST_VIDEO_CAPS_BGRx __GST_VIDEO_CAPS_MAKE_32 (3, 2, 1)
-- unsupported macro: GST_VIDEO_CAPS_xBGR __GST_VIDEO_CAPS_MAKE_32 (4, 3, 2)
-- unsupported macro: GST_VIDEO_CAPS_RGBA __GST_VIDEO_CAPS_MAKE_32A (1, 2, 3, 4)
-- unsupported macro: GST_VIDEO_CAPS_ARGB __GST_VIDEO_CAPS_MAKE_32A (2, 3, 4, 1)
-- unsupported macro: GST_VIDEO_CAPS_BGRA __GST_VIDEO_CAPS_MAKE_32A (3, 2, 1, 4)
-- unsupported macro: GST_VIDEO_CAPS_ABGR __GST_VIDEO_CAPS_MAKE_32A (4, 3, 2, 1)
-- unsupported macro: GST_VIDEO_CAPS_xRGB_HOST_ENDIAN GST_VIDEO_CAPS_BGRx
-- unsupported macro: GST_VIDEO_CAPS_BGRx_HOST_ENDIAN GST_VIDEO_CAPS_xRGB
-- unsupported macro: GST_VIDEO_CAPS_RGB_16 __GST_VIDEO_CAPS_MAKE_16 (1, 2, 3)
-- unsupported macro: GST_VIDEO_CAPS_BGR_16 __GST_VIDEO_CAPS_MAKE_16 (3, 2, 1)
-- unsupported macro: GST_VIDEO_CAPS_RGB_15 __GST_VIDEO_CAPS_MAKE_15 (1, 2, 3)
-- unsupported macro: GST_VIDEO_CAPS_BGR_15 __GST_VIDEO_CAPS_MAKE_15 (3, 2, 1)
-- unsupported macro: GST_VIDEO_CAPS_r210 "video/x-raw-rgb, " "bpp = (int) 32, " "depth = (int) 30, " "endianness = (int) BIG_ENDIAN, " "red_mask = (int) 0x3ff00000, " "green_mask = (int) 0x000ffc00, " "blue_mask = (int) 0x000003ff, " "width = " GST_VIDEO_SIZE_RANGE ", " "height = " GST_VIDEO_SIZE_RANGE ", " "framerate = " GST_VIDEO_FPS_RANGE
-- unsupported macro: GST_VIDEO_CAPS_ARGB_64 __GST_VIDEO_CAPS_MAKE_64A (2, 3, 4, 1)
-- unsupported macro: GST_VIDEO_CAPS_RGB8_PALETTED "video/x-raw-rgb, bpp = (int)8, depth = (int)8, " "width = "GST_VIDEO_SIZE_RANGE" , " "height = " GST_VIDEO_SIZE_RANGE ", " "framerate = "GST_VIDEO_FPS_RANGE
-- arg-macro: procedure GST_VIDEO_CAPS_YUV (fourcc)
-- "video/x-raw-yuv, " "format = (fourcc) " fourcc ", " "width = " GST_VIDEO_SIZE_RANGE ", " "height = " GST_VIDEO_SIZE_RANGE ", " "framerate = " GST_VIDEO_FPS_RANGE
-- unsupported macro: GST_VIDEO_CAPS_GRAY8 "video/x-raw-gray, " "bpp = (int) 8, " "depth = (int) 8, " "width = " GST_VIDEO_SIZE_RANGE ", " "height = " GST_VIDEO_SIZE_RANGE ", " "framerate = " GST_VIDEO_FPS_RANGE
-- arg-macro: procedure GST_VIDEO_CAPS_GRAY16 (endianness)
-- "video/x-raw-gray, " "bpp = (int) 16, " "depth = (int) 16, " "endianness = (int) " endianness ", " "width = " GST_VIDEO_SIZE_RANGE ", " "height = " GST_VIDEO_SIZE_RANGE ", " "framerate = " GST_VIDEO_FPS_RANGE
-- unsupported macro: GST_VIDEO_BUFFER_TFF GST_BUFFER_FLAG_MEDIA1
-- unsupported macro: GST_VIDEO_BUFFER_RFF GST_BUFFER_FLAG_MEDIA2
-- unsupported macro: GST_VIDEO_BUFFER_ONEFIELD GST_BUFFER_FLAG_MEDIA3
-- unsupported macro: GST_VIDEO_BUFFER_PROGRESSIVE GST_BUFFER_FLAG_MEDIA4
-- GStreamer
-- * Copyright (C) <1999> <NAME> <<EMAIL>>
-- * Library <2002> <NAME> <<EMAIL>>
-- *
-- * This library is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Library General Public
-- * License as published by the Free Software Foundation; either
-- * version 2 of the License, or (at your option) any later version.
-- *
-- * This library is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 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 this library; if not, write to the
-- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-- * Boston, MA 02111-1307, USA.
--
--*
-- * GstVideoFormat:
-- * @GST_VIDEO_FORMAT_UNKNOWN: Unknown or unset video format id
-- * @GST_VIDEO_FORMAT_I420: planar 4:2:0 YUV
-- * @GST_VIDEO_FORMAT_YV12: planar 4:2:0 YVU (like I420 but UV planes swapped)
-- * @GST_VIDEO_FORMAT_YUY2: packed 4:2:2 YUV (Y0-U0-Y1-V0 Y2-U2-Y3-V2 Y4 ...)
-- * @GST_VIDEO_FORMAT_UYVY: packed 4:2:2 YUV (U0-Y0-V0-Y1 U2-Y2-V2-Y3 U4 ...)
-- * @GST_VIDEO_FORMAT_AYUV: packed 4:4:4 YUV with alpha channel (A0-Y0-U0-V0 ...)
-- * @GST_VIDEO_FORMAT_RGBx: sparse rgb packed into 32 bit, space last
-- * @GST_VIDEO_FORMAT_BGRx: sparse reverse rgb packed into 32 bit, space last
-- * @GST_VIDEO_FORMAT_xRGB: sparse rgb packed into 32 bit, space first
-- * @GST_VIDEO_FORMAT_xBGR: sparse reverse rgb packed into 32 bit, space first
-- * @GST_VIDEO_FORMAT_RGBA: rgb with alpha channel last
-- * @GST_VIDEO_FORMAT_BGRA: reverse rgb with alpha channel last
-- * @GST_VIDEO_FORMAT_ARGB: rgb with alpha channel first
-- * @GST_VIDEO_FORMAT_ABGR: reverse rgb with alpha channel first
-- * @GST_VIDEO_FORMAT_RGB: rgb
-- * @GST_VIDEO_FORMAT_BGR: reverse rgb
-- * @GST_VIDEO_FORMAT_Y41B: planar 4:1:1 YUV (Since: 0.10.18)
-- * @GST_VIDEO_FORMAT_Y42B: planar 4:2:2 YUV (Since: 0.10.18)
-- * @GST_VIDEO_FORMAT_YVYU: packed 4:2:2 YUV (Y0-V0-Y1-U0 Y2-V2-Y3-U2 Y4 ...) (Since: 0.10.23)
-- * @GST_VIDEO_FORMAT_Y444: planar 4:4:4 YUV (Since: 0.10.24)
-- * @GST_VIDEO_FORMAT_v210: packed 4:2:2 10-bit YUV, complex format (Since: 0.10.24)
-- * @GST_VIDEO_FORMAT_v216: packed 4:2:2 16-bit YUV, Y0-U0-Y1-V1 order (Since: 0.10.24)
-- * @GST_VIDEO_FORMAT_NV12: planar 4:2:0 YUV with interleaved UV plane (Since: 0.10.26)
-- * @GST_VIDEO_FORMAT_NV21: planar 4:2:0 YUV with interleaved VU plane (Since: 0.10.26)
-- * @GST_VIDEO_FORMAT_GRAY8: 8-bit grayscale (Since: 0.10.29)
-- * @GST_VIDEO_FORMAT_GRAY16_BE: 16-bit grayscale, most significant byte first (Since: 0.10.29)
-- * @GST_VIDEO_FORMAT_GRAY16_LE: 16-bit grayscale, least significant byte first (Since: 0.10.29)
-- * @GST_VIDEO_FORMAT_v308: packed 4:4:4 YUV (Since: 0.10.29)
-- * @GST_VIDEO_FORMAT_Y800: same as GST_VIDEO_FORMAT_GRAY8 (Since: 0.10.30)
-- * @GST_VIDEO_FORMAT_Y16: same as GST_VIDEO_FORMAT_GRAY16_LE (Since: 0.10.30)
-- * @GST_VIDEO_FORMAT_RGB16: rgb 5-6-5 bits per component (Since: 0.10.30)
-- * @GST_VIDEO_FORMAT_BGR16: reverse rgb 5-6-5 bits per component (Since: 0.10.30)
-- * @GST_VIDEO_FORMAT_RGB15: rgb 5-5-5 bits per component (Since: 0.10.30)
-- * @GST_VIDEO_FORMAT_BGR15: reverse rgb 5-5-5 bits per component (Since: 0.10.30)
-- * @GST_VIDEO_FORMAT_UYVP: packed 10-bit 4:2:2 YUV (U0-Y0-V0-Y1 U2-Y2-V2-Y3 U4 ...) (Since: 0.10.31)
-- * @GST_VIDEO_FORMAT_A420: planar 4:4:2:0 AYUV (Since: 0.10.31)
-- * @GST_VIDEO_FORMAT_RGB8_PALETTED: 8-bit paletted RGB (Since: 0.10.32)
-- * @GST_VIDEO_FORMAT_YUV9: planar 4:1:0 YUV (Since: 0.10.32)
-- * @GST_VIDEO_FORMAT_YVU9: planar 4:1:0 YUV (like YUV9 but UV planes swapped) (Since: 0.10.32)
-- * @GST_VIDEO_FORMAT_IYU1: packed 4:1:1 YUV (Cb-Y0-Y1-Cr-Y2-Y3 ...) (Since: 0.10.32)
-- * @GST_VIDEO_FORMAT_ARGB64: rgb with alpha channel first, 16 bits per channel (Since: 0.10.33)
-- * @GST_VIDEO_FORMAT_AYUV64: packed 4:4:4 YUV with alpha channel, 16 bits per channel (A0-Y0-U0-V0 ...) (Since: 0.10.33)
-- * @GST_VIDEO_FORMAT_r210: packed 4:4:4 RGB, 10 bits per channel (Since: 0.10.33)
-- *
-- * Enum value describing the most common video formats.
--
type GstVideoFormat is
(GST_VIDEO_FORMAT_UNKNOWN,
GST_VIDEO_FORMAT_I420,
GST_VIDEO_FORMAT_YV12,
GST_VIDEO_FORMAT_YUY2,
GST_VIDEO_FORMAT_UYVY,
GST_VIDEO_FORMAT_AYUV,
GST_VIDEO_FORMAT_RGBx,
GST_VIDEO_FORMAT_BGRx,
GST_VIDEO_FORMAT_xRGB,
GST_VIDEO_FORMAT_xBGR,
GST_VIDEO_FORMAT_RGBA,
GST_VIDEO_FORMAT_BGRA,
GST_VIDEO_FORMAT_ARGB,
GST_VIDEO_FORMAT_ABGR,
GST_VIDEO_FORMAT_RGB,
GST_VIDEO_FORMAT_BGR,
GST_VIDEO_FORMAT_Y41B,
GST_VIDEO_FORMAT_Y42B,
GST_VIDEO_FORMAT_YVYU,
GST_VIDEO_FORMAT_Y444,
GST_VIDEO_FORMAT_v210,
GST_VIDEO_FORMAT_v216,
GST_VIDEO_FORMAT_NV12,
GST_VIDEO_FORMAT_NV21,
GST_VIDEO_FORMAT_GRAY8,
GST_VIDEO_FORMAT_GRAY16_BE,
GST_VIDEO_FORMAT_GRAY16_LE,
GST_VIDEO_FORMAT_v308,
GST_VIDEO_FORMAT_Y800,
GST_VIDEO_FORMAT_Y16,
GST_VIDEO_FORMAT_RGB16,
GST_VIDEO_FORMAT_BGR16,
GST_VIDEO_FORMAT_RGB15,
GST_VIDEO_FORMAT_BGR15,
GST_VIDEO_FORMAT_UYVP,
GST_VIDEO_FORMAT_A420,
GST_VIDEO_FORMAT_RGB8_PALETTED,
GST_VIDEO_FORMAT_YUV9,
GST_VIDEO_FORMAT_YVU9,
GST_VIDEO_FORMAT_IYU1,
GST_VIDEO_FORMAT_ARGB64,
GST_VIDEO_FORMAT_AYUV64,
GST_VIDEO_FORMAT_r210);
pragma Convention (C, GstVideoFormat); -- gst/video/video.h:122
-- consider the next 2 protected
-- 24 bit
-- 32 bit
-- 32 bit alpha
-- note: the macro name uses the order on BE systems
-- 15/16 bit
-- 30 bit
-- 64 bit alpha
--*
-- * GST_VIDEO_CAPS_RGB8_PALETTED:
-- *
-- * Generic caps string for 8-bit paletted RGB video, for use in pad templates.
-- *
-- * Since: 0.10.32
--
--*
-- * GST_VIDEO_CAPS_YUV:
-- * @fourcc: YUV fourcc format that describes the pixel layout, as string
-- * (e.g. "I420", "YV12", "YUY2", "AYUV", etc.)
-- *
-- * Generic caps string for YUV video, for use in pad templates.
--
--*
-- * GST_VIDEO_CAPS_GRAY8:
-- *
-- * Generic caps string for 8-bit grayscale video, for use in pad templates.
-- *
-- * Since: 0.10.29
--
--*
-- * GST_VIDEO_CAPS_GRAY16:
-- * @endianness: endianness as string, ie. either "1234", "4321", "BIG_ENDIAN"
-- * or "LITTLE_ENDIAN"
-- *
-- * Generic caps string for 16-bit grayscale video, for use in pad templates.
-- *
-- * Since: 0.10.29
--
-- buffer flags
--*
-- * GST_VIDEO_BUFFER_TFF:
-- *
-- * If the #GstBuffer is interlaced, then the first field in the video frame is
-- * the top field. If unset, the bottom field is first.
-- *
-- * Since: 0.10.23
--
--*
-- * GST_VIDEO_BUFFER_RFF:
-- *
-- * If the #GstBuffer is interlaced, then the first field (as defined by the
-- * %GST_VIDEO_BUFFER_TFF flag setting) is repeated.
-- *
-- * Since: 0.10.23
--
--*
-- * GST_VIDEO_BUFFER_ONEFIELD:
-- *
-- * If the #GstBuffer is interlaced, then only the first field (as defined by the
-- * %GST_VIDEO_BUFFER_TFF flag setting) is to be displayed.
-- *
-- * Since: 0.10.23
--
--*
-- * GST_VIDEO_BUFFER_PROGRESSIVE:
-- *
-- * If the #GstBuffer is telecined, then the buffer is progressive if the
-- * %GST_VIDEO_BUFFER_PROGRESSIVE flag is set, else it is telecine mixed.
-- *
-- * Since: 0.10.33
--
-- functions
function gst_video_frame_rate (pad : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPad) return access constant Glib.Values.GValue; -- gst/video/video.h:440
pragma Import (C, gst_video_frame_rate, "gst_video_frame_rate");
function gst_video_get_size
(pad : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPad;
width : access GLIB.gint;
height : access GLIB.gint) return GLIB.gboolean; -- gst/video/video.h:442
pragma Import (C, gst_video_get_size, "gst_video_get_size");
function gst_video_calculate_display_ratio
(dar_n : access GLIB.guint;
dar_d : access GLIB.guint;
video_width : GLIB.guint;
video_height : GLIB.guint;
video_par_n : GLIB.guint;
video_par_d : GLIB.guint;
display_par_n : GLIB.guint;
display_par_d : GLIB.guint) return GLIB.gboolean; -- gst/video/video.h:446
pragma Import (C, gst_video_calculate_display_ratio, "gst_video_calculate_display_ratio");
function gst_video_format_parse_caps
(caps : access constant GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps;
format : access GstVideoFormat;
width : access int;
height : access int) return GLIB.gboolean; -- gst/video/video.h:455
pragma Import (C, gst_video_format_parse_caps, "gst_video_format_parse_caps");
function gst_video_format_parse_caps_interlaced (caps : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; interlaced : access GLIB.gboolean) return GLIB.gboolean; -- gst/video/video.h:460
pragma Import (C, gst_video_format_parse_caps_interlaced, "gst_video_format_parse_caps_interlaced");
function gst_video_parse_caps_pixel_aspect_ratio
(caps : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps;
par_n : access int;
par_d : access int) return GLIB.gboolean; -- gst/video/video.h:464
pragma Import (C, gst_video_parse_caps_pixel_aspect_ratio, "gst_video_parse_caps_pixel_aspect_ratio");
function gst_video_parse_caps_framerate
(caps : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps;
fps_n : access int;
fps_d : access int) return GLIB.gboolean; -- gst/video/video.h:468
pragma Import (C, gst_video_parse_caps_framerate, "gst_video_parse_caps_framerate");
function gst_video_parse_caps_color_matrix (caps : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps) return Interfaces.C.Strings.chars_ptr; -- gst/video/video.h:472
pragma Import (C, gst_video_parse_caps_color_matrix, "gst_video_parse_caps_color_matrix");
function gst_video_parse_caps_chroma_site (caps : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps) return Interfaces.C.Strings.chars_ptr; -- gst/video/video.h:474
pragma Import (C, gst_video_parse_caps_chroma_site, "gst_video_parse_caps_chroma_site");
function gst_video_parse_caps_palette (caps : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/video/video.h:476
pragma Import (C, gst_video_parse_caps_palette, "gst_video_parse_caps_palette");
-- create caps given format and details
function gst_video_format_new_caps
(format : GstVideoFormat;
width : int;
height : int;
framerate_n : int;
framerate_d : int;
par_n : int;
par_d : int) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; -- gst/video/video.h:480
pragma Import (C, gst_video_format_new_caps, "gst_video_format_new_caps");
function gst_video_format_new_caps_interlaced
(format : GstVideoFormat;
width : int;
height : int;
framerate_n : int;
framerate_d : int;
par_n : int;
par_d : int;
interlaced : GLIB.gboolean) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; -- gst/video/video.h:486
pragma Import (C, gst_video_format_new_caps_interlaced, "gst_video_format_new_caps_interlaced");
function gst_video_format_new_template_caps (format : GstVideoFormat) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; -- gst/video/video.h:493
pragma Import (C, gst_video_format_new_template_caps, "gst_video_format_new_template_caps");
-- format properties
function gst_video_format_from_fourcc (fourcc : GLIB.guint32) return GstVideoFormat; -- gst/video/video.h:497
pragma Import (C, gst_video_format_from_fourcc, "gst_video_format_from_fourcc");
function gst_video_format_to_fourcc (format : GstVideoFormat) return GLIB.guint32; -- gst/video/video.h:499
pragma Import (C, gst_video_format_to_fourcc, "gst_video_format_to_fourcc");
function gst_video_format_is_rgb (format : GstVideoFormat) return GLIB.gboolean; -- gst/video/video.h:501
pragma Import (C, gst_video_format_is_rgb, "gst_video_format_is_rgb");
function gst_video_format_is_yuv (format : GstVideoFormat) return GLIB.gboolean; -- gst/video/video.h:503
pragma Import (C, gst_video_format_is_yuv, "gst_video_format_is_yuv");
function gst_video_format_is_gray (format : GstVideoFormat) return GLIB.gboolean; -- gst/video/video.h:505
pragma Import (C, gst_video_format_is_gray, "gst_video_format_is_gray");
function gst_video_format_has_alpha (format : GstVideoFormat) return GLIB.gboolean; -- gst/video/video.h:507
pragma Import (C, gst_video_format_has_alpha, "gst_video_format_has_alpha");
function gst_video_format_get_component_depth (format : GstVideoFormat; component : int) return int; -- gst/video/video.h:510
pragma Import (C, gst_video_format_get_component_depth, "gst_video_format_get_component_depth");
function gst_video_format_get_row_stride
(format : GstVideoFormat;
component : int;
width : int) return int; -- gst/video/video.h:513
pragma Import (C, gst_video_format_get_row_stride, "gst_video_format_get_row_stride");
function gst_video_format_get_pixel_stride (format : GstVideoFormat; component : int) return int; -- gst/video/video.h:517
pragma Import (C, gst_video_format_get_pixel_stride, "gst_video_format_get_pixel_stride");
function gst_video_format_get_component_width
(format : GstVideoFormat;
component : int;
width : int) return int; -- gst/video/video.h:520
pragma Import (C, gst_video_format_get_component_width, "gst_video_format_get_component_width");
function gst_video_format_get_component_height
(format : GstVideoFormat;
component : int;
height : int) return int; -- gst/video/video.h:524
pragma Import (C, gst_video_format_get_component_height, "gst_video_format_get_component_height");
function gst_video_format_get_component_offset
(format : GstVideoFormat;
component : int;
width : int;
height : int) return int; -- gst/video/video.h:528
pragma Import (C, gst_video_format_get_component_offset, "gst_video_format_get_component_offset");
function gst_video_format_get_size
(format : GstVideoFormat;
width : int;
height : int) return int; -- gst/video/video.h:533
pragma Import (C, gst_video_format_get_size, "gst_video_format_get_size");
function gst_video_get_size_from_caps (caps : access constant GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; size : access GLIB.gint) return GLIB.gboolean; -- gst/video/video.h:537
pragma Import (C, gst_video_get_size_from_caps, "gst_video_get_size_from_caps");
function gst_video_format_convert
(format : GstVideoFormat;
width : int;
height : int;
fps_n : int;
fps_d : int;
src_format : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstformat_h.GstFormat;
src_value : GLIB.gint64;
dest_format : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstformat_h.GstFormat;
dest_value : access GLIB.gint64) return GLIB.gboolean; -- gst/video/video.h:539
pragma Import (C, gst_video_format_convert, "gst_video_format_convert");
-- video still frame event creation and parsing
function gst_video_event_new_still_frame (in_still : GLIB.gboolean) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h.GstEvent; -- gst/video/video.h:551
pragma Import (C, gst_video_event_new_still_frame, "gst_video_event_new_still_frame");
function gst_video_event_parse_still_frame (event : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h.GstEvent; in_still : access GLIB.gboolean) return GLIB.gboolean; -- gst/video/video.h:553
pragma Import (C, gst_video_event_parse_still_frame, "gst_video_event_parse_still_frame");
-- video force key unit event creation and parsing
function gst_video_event_new_downstream_force_key_unit
(timestamp : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime;
streamtime : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime;
runningtime : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime;
all_headers : GLIB.gboolean;
count : GLIB.guint) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h.GstEvent; -- gst/video/video.h:557
pragma Import (C, gst_video_event_new_downstream_force_key_unit, "gst_video_event_new_downstream_force_key_unit");
function gst_video_event_parse_downstream_force_key_unit
(event : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h.GstEvent;
timestamp : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime;
streamtime : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime;
runningtime : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime;
all_headers : access GLIB.gboolean;
count : access GLIB.guint) return GLIB.gboolean; -- gst/video/video.h:563
pragma Import (C, gst_video_event_parse_downstream_force_key_unit, "gst_video_event_parse_downstream_force_key_unit");
function gst_video_event_new_upstream_force_key_unit
(running_time : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime;
all_headers : GLIB.gboolean;
count : GLIB.guint) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h.GstEvent; -- gst/video/video.h:570
pragma Import (C, gst_video_event_new_upstream_force_key_unit, "gst_video_event_new_upstream_force_key_unit");
function gst_video_event_parse_upstream_force_key_unit
(event : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h.GstEvent;
running_time : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime;
all_headers : access GLIB.gboolean;
count : access GLIB.guint) return GLIB.gboolean; -- gst/video/video.h:574
pragma Import (C, gst_video_event_parse_upstream_force_key_unit, "gst_video_event_parse_upstream_force_key_unit");
function gst_video_event_is_force_key_unit (event : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstevent_h.GstEvent) return GLIB.gboolean; -- gst/video/video.h:579
pragma Import (C, gst_video_event_is_force_key_unit, "gst_video_event_is_force_key_unit");
-- convert/encode video frame from one format to another
type GstVideoConvertFrameCallback is access procedure
(arg1 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer;
arg2 : access Glib.Error.GError;
arg3 : System.Address);
pragma Convention (C, GstVideoConvertFrameCallback); -- gst/video/video.h:583
procedure gst_video_convert_frame_async
(buf : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer;
to_caps : access constant GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps;
timeout : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime;
callback : GstVideoConvertFrameCallback;
user_data : System.Address;
destroy_notify : GStreamer.GST_Low_Level.glib_2_0_glib_gtypes_h.GDestroyNotify); -- gst/video/video.h:585
pragma Import (C, gst_video_convert_frame_async, "gst_video_convert_frame_async");
function gst_video_convert_frame
(buf : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer;
to_caps : access constant GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps;
timeout : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstclock_h.GstClockTime;
error : System.Address) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/video/video.h:592
pragma Import (C, gst_video_convert_frame, "gst_video_convert_frame");
end GStreamer.GST_Low_Level.gstreamer_0_10_gst_video_video_h;
|
Syntax/Implication/Dependent.agda | Lolirofle/stuff-in-agda | 6 | 5811 | module Syntax.Implication.Dependent where
open import Functional using (id)
open import Functional.Dependent
import Lvl
open import Type
private variable ℓ₁ ℓ₂ ℓ₃ ℓ₄ : Lvl.Level
_⇒-[_]_ : ∀(X : Type{ℓ₁}){Y : ∀{_ : X} → Type{ℓ₂}}{Z : ∀{x : X}{_ : Y{x}} → Type{ℓ₃}} → (P : (x : X) → Y{x}) → (∀{x : X} → (y : Y{x}) → Z{x}{y}) → ((x : X) → Z{x}{P(x)})
_⇒-[_]_ = const(swap(_∘_))
infixr 0.98 _⇒-[_]_
{-# INLINE _⇒-[_]_ #-}
_⇒-[]_ : ∀(X : Type{ℓ₁}){Y : ∀{_ : X} → Type{ℓ₂}} → ((x : X) → Y{x}) → ((x : X) → Y{x})
_⇒-[]_ = const id
infixr 0.98 _⇒-[]_
{-# INLINE _⇒-[]_ #-}
_⇒-end : ∀(X : Type{ℓ₁}) → (X → X)
_⇒-end = const id
infixr 0.99 _⇒-end
{-# INLINE _⇒-end #-}
_⇒_ = apply
infixl 0.97 _⇒_
{-# INLINE _⇒_ #-}
-- TODO: Change these to be similar to the ones in Syntax.Implication
•_⇒₁_ = apply
infixl 0.97 •_⇒₁_
{-# INLINE •_⇒₁_ #-}
•_•_⇒₂_ : ∀{X : Type{ℓ₁}}{Y : ∀{_ : X} → Type{ℓ₂}}{Z : ∀{x : X}{_ : Y{x}} → Type{ℓ₃}} → (x : X) → (y : Y{x}) → ((x : X) → (y : Y{x}) → Z{x}{y}) → Z{x}{y}
• a • b ⇒₂ P = P ⇒ apply a ⇒ apply b
infixl 0.97 •_•_⇒₂_
{-# INLINE •_•_⇒₂_ #-}
•_•_•_⇒₃_ : ∀{X : Type{ℓ₁}}{Y : ∀{_ : X} → Type{ℓ₂}}{Z : ∀{x : X}{_ : Y{x}} → Type{ℓ₃}}{W : ∀{x : X}{y : Y{x}}{_ : Z{x}{y}} → Type{ℓ₄}} → (x : X) → (y : Y{x}) → (z : Z{x}{y}) → ((x : X) → (y : Y{x}) → (z : Z{x}{y}) → W{x}{y}{z}) → W{x}{y}{z}
• a • b • c ⇒₃ P = P ⇒ apply a ⇒ apply b ⇒ apply c
infixl 0.97 •_•_•_⇒₃_
{-# INLINE •_•_•_⇒₃_ #-}
|
hash_collisions/sha512.asm | alipha/hash_collisions | 0 | 21916 | <gh_stars>0
/*
* SHA-512 hash in x86 assembly
*
* Copyright (c) 2014 Project Nayuki
* http://www.nayuki.io/page/fast-sha2-hashes-in-x86-assembly
*
* (MIT License)
* 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.
*/
/* void sha512_compress(uint64_t state[8], const uint8_t block[128]) */
.globl sha512_compress
sha512_compress:
/*
* Storage usage:
* Bytes Location Description
* 4 eax Temporary base address of state or block array arguments
* 4 ecx Old value of esp
* 4 esp x86 stack pointer
* 64 [esp+ 0] SHA-512 state variables A,B,C,D,E,F,G,H (8 bytes each)
* 128 [esp+64] Circular buffer of most recent 16 key schedule items, 8 bytes each
* 56 mm0..mm6 Temporary for calculation per round
* 8 mm7 Control value for byte endian reversal
* 64 xmm0..xmm3 Temporary for copying or calculation
*/
#define SCHED(i) (((i)&0xF)*8+64)(%esp)
#define STATE(i) (i*8)(%esp)
#define RORQ(reg, shift, temp) \
movq %reg, %temp; \
psllq $(64-shift), %temp; \
psrlq $shift, %reg; \
por %temp, %reg;
#define ROUNDa(i, a, b, c, d, e, f, g, h) \
movq (i*8)(%eax), %mm0; \
pshufb %mm7, %mm0; \
movq %mm0, SCHED(i); \
ROUNDTAIL(i, a, b, c, d, e, f, g, h)
#define ROUNDb(i, a, b, c, d, e, f, g, h) \
movq SCHED(i-16), %mm0; \
paddq SCHED(i- 7), %mm0; \
movq SCHED(i-15), %mm1; \
movq %mm1, %mm2; \
movq %mm1, %mm3; \
RORQ(mm1, 1, mm5) \
RORQ(mm2, 8, mm4) \
psrlq $7, %mm3; \
pxor %mm3, %mm2; \
pxor %mm2, %mm1; \
paddq %mm1, %mm0; \
movq SCHED(i- 2), %mm1; \
movq %mm1, %mm2; \
movq %mm1, %mm3; \
RORQ(mm1, 19, mm5) \
RORQ(mm2, 61, mm4) \
psrlq $6, %mm3; \
pxor %mm3, %mm2; \
pxor %mm2, %mm1; \
paddq %mm1, %mm0; \
movq %mm0, SCHED(i); \
ROUNDTAIL(i, a, b, c, d, e, f, g, h)
#define ROUNDTAIL(i, a, b, c, d, e, f, g, h) \
/* Part 0 */ \
paddq STATE(h), %mm0; \
movq STATE(e), %mm1; \
movq %mm1, %mm2; \
movq %mm1, %mm3; \
RORQ(mm1, 18, mm4) \
RORQ(mm2, 41, mm5) \
RORQ(mm3, 14, mm6) \
pxor %mm2, %mm1; \
pxor %mm3, %mm1; \
paddq .roundconstants+i*8, %mm0; \
movq STATE(g), %mm2; \
pxor STATE(f), %mm2; \
pand STATE(e), %mm2; \
pxor STATE(g), %mm2; \
paddq %mm1, %mm0; \
paddq %mm2, %mm0; \
/* Part 1 */ \
movq STATE(d), %mm1; \
paddq %mm0, %mm1; \
movq %mm1, STATE(d); \
/* Part 2 */ \
movq STATE(a), %mm1; \
movq %mm1, %mm2; \
movq %mm1, %mm3; \
RORQ(mm1, 39, mm4) \
RORQ(mm2, 34, mm5) \
RORQ(mm3, 28, mm6) \
pxor %mm2, %mm1; \
pxor %mm3, %mm1; \
movq STATE(c), %mm2; \
paddq %mm1, %mm0; \
movq %mm2, %mm3; \
por STATE(b), %mm3; \
pand STATE(b), %mm2; \
pand STATE(a), %mm3; \
por %mm2, %mm3; \
paddq %mm3, %mm0; \
movq %mm0, STATE(h);
/* Allocate 16-byte aligned scratch space */
movl %esp, %ecx
subl $192, %esp
andl $~0xF, %esp
/* Copy state */
movl 4(%ecx), %eax
movdqu 0(%eax), %xmm0; movdqu %xmm0, 0(%esp)
movdqu 16(%eax), %xmm1; movdqu %xmm1, 16(%esp)
movdqu 32(%eax), %xmm2; movdqu %xmm2, 32(%esp)
movdqu 48(%eax), %xmm3; movdqu %xmm3, 48(%esp)
/* Do 80 rounds of hashing */
movl 8(%ecx), %eax
movq .bswap64, %mm7
ROUNDa( 0, 0, 1, 2, 3, 4, 5, 6, 7)
ROUNDa( 1, 7, 0, 1, 2, 3, 4, 5, 6)
ROUNDa( 2, 6, 7, 0, 1, 2, 3, 4, 5)
ROUNDa( 3, 5, 6, 7, 0, 1, 2, 3, 4)
ROUNDa( 4, 4, 5, 6, 7, 0, 1, 2, 3)
ROUNDa( 5, 3, 4, 5, 6, 7, 0, 1, 2)
ROUNDa( 6, 2, 3, 4, 5, 6, 7, 0, 1)
ROUNDa( 7, 1, 2, 3, 4, 5, 6, 7, 0)
ROUNDa( 8, 0, 1, 2, 3, 4, 5, 6, 7)
ROUNDa( 9, 7, 0, 1, 2, 3, 4, 5, 6)
ROUNDa(10, 6, 7, 0, 1, 2, 3, 4, 5)
ROUNDa(11, 5, 6, 7, 0, 1, 2, 3, 4)
ROUNDa(12, 4, 5, 6, 7, 0, 1, 2, 3)
ROUNDa(13, 3, 4, 5, 6, 7, 0, 1, 2)
ROUNDa(14, 2, 3, 4, 5, 6, 7, 0, 1)
ROUNDa(15, 1, 2, 3, 4, 5, 6, 7, 0)
ROUNDb(16, 0, 1, 2, 3, 4, 5, 6, 7)
ROUNDb(17, 7, 0, 1, 2, 3, 4, 5, 6)
ROUNDb(18, 6, 7, 0, 1, 2, 3, 4, 5)
ROUNDb(19, 5, 6, 7, 0, 1, 2, 3, 4)
ROUNDb(20, 4, 5, 6, 7, 0, 1, 2, 3)
ROUNDb(21, 3, 4, 5, 6, 7, 0, 1, 2)
ROUNDb(22, 2, 3, 4, 5, 6, 7, 0, 1)
ROUNDb(23, 1, 2, 3, 4, 5, 6, 7, 0)
ROUNDb(24, 0, 1, 2, 3, 4, 5, 6, 7)
ROUNDb(25, 7, 0, 1, 2, 3, 4, 5, 6)
ROUNDb(26, 6, 7, 0, 1, 2, 3, 4, 5)
ROUNDb(27, 5, 6, 7, 0, 1, 2, 3, 4)
ROUNDb(28, 4, 5, 6, 7, 0, 1, 2, 3)
ROUNDb(29, 3, 4, 5, 6, 7, 0, 1, 2)
ROUNDb(30, 2, 3, 4, 5, 6, 7, 0, 1)
ROUNDb(31, 1, 2, 3, 4, 5, 6, 7, 0)
ROUNDb(32, 0, 1, 2, 3, 4, 5, 6, 7)
ROUNDb(33, 7, 0, 1, 2, 3, 4, 5, 6)
ROUNDb(34, 6, 7, 0, 1, 2, 3, 4, 5)
ROUNDb(35, 5, 6, 7, 0, 1, 2, 3, 4)
ROUNDb(36, 4, 5, 6, 7, 0, 1, 2, 3)
ROUNDb(37, 3, 4, 5, 6, 7, 0, 1, 2)
ROUNDb(38, 2, 3, 4, 5, 6, 7, 0, 1)
ROUNDb(39, 1, 2, 3, 4, 5, 6, 7, 0)
ROUNDb(40, 0, 1, 2, 3, 4, 5, 6, 7)
ROUNDb(41, 7, 0, 1, 2, 3, 4, 5, 6)
ROUNDb(42, 6, 7, 0, 1, 2, 3, 4, 5)
ROUNDb(43, 5, 6, 7, 0, 1, 2, 3, 4)
ROUNDb(44, 4, 5, 6, 7, 0, 1, 2, 3)
ROUNDb(45, 3, 4, 5, 6, 7, 0, 1, 2)
ROUNDb(46, 2, 3, 4, 5, 6, 7, 0, 1)
ROUNDb(47, 1, 2, 3, 4, 5, 6, 7, 0)
ROUNDb(48, 0, 1, 2, 3, 4, 5, 6, 7)
ROUNDb(49, 7, 0, 1, 2, 3, 4, 5, 6)
ROUNDb(50, 6, 7, 0, 1, 2, 3, 4, 5)
ROUNDb(51, 5, 6, 7, 0, 1, 2, 3, 4)
ROUNDb(52, 4, 5, 6, 7, 0, 1, 2, 3)
ROUNDb(53, 3, 4, 5, 6, 7, 0, 1, 2)
ROUNDb(54, 2, 3, 4, 5, 6, 7, 0, 1)
ROUNDb(55, 1, 2, 3, 4, 5, 6, 7, 0)
ROUNDb(56, 0, 1, 2, 3, 4, 5, 6, 7)
ROUNDb(57, 7, 0, 1, 2, 3, 4, 5, 6)
ROUNDb(58, 6, 7, 0, 1, 2, 3, 4, 5)
ROUNDb(59, 5, 6, 7, 0, 1, 2, 3, 4)
ROUNDb(60, 4, 5, 6, 7, 0, 1, 2, 3)
ROUNDb(61, 3, 4, 5, 6, 7, 0, 1, 2)
ROUNDb(62, 2, 3, 4, 5, 6, 7, 0, 1)
ROUNDb(63, 1, 2, 3, 4, 5, 6, 7, 0)
ROUNDb(64, 0, 1, 2, 3, 4, 5, 6, 7)
ROUNDb(65, 7, 0, 1, 2, 3, 4, 5, 6)
ROUNDb(66, 6, 7, 0, 1, 2, 3, 4, 5)
ROUNDb(67, 5, 6, 7, 0, 1, 2, 3, 4)
ROUNDb(68, 4, 5, 6, 7, 0, 1, 2, 3)
ROUNDb(69, 3, 4, 5, 6, 7, 0, 1, 2)
ROUNDb(70, 2, 3, 4, 5, 6, 7, 0, 1)
ROUNDb(71, 1, 2, 3, 4, 5, 6, 7, 0)
ROUNDb(72, 0, 1, 2, 3, 4, 5, 6, 7)
ROUNDb(73, 7, 0, 1, 2, 3, 4, 5, 6)
ROUNDb(74, 6, 7, 0, 1, 2, 3, 4, 5)
ROUNDb(75, 5, 6, 7, 0, 1, 2, 3, 4)
ROUNDb(76, 4, 5, 6, 7, 0, 1, 2, 3)
ROUNDb(77, 3, 4, 5, 6, 7, 0, 1, 2)
ROUNDb(78, 2, 3, 4, 5, 6, 7, 0, 1)
ROUNDb(79, 1, 2, 3, 4, 5, 6, 7, 0)
/* Add to state */
movl 4(%ecx), %eax
movdqu 0(%eax), %xmm0; paddq 0(%esp), %xmm0; movdqu %xmm0, 0(%eax)
movdqu 16(%eax), %xmm1; paddq 16(%esp), %xmm1; movdqu %xmm1, 16(%eax)
movdqu 32(%eax), %xmm2; paddq 32(%esp), %xmm2; movdqu %xmm2, 32(%eax)
movdqu 48(%eax), %xmm3; paddq 48(%esp), %xmm3; movdqu %xmm3, 48(%eax)
/* Clean up */
emms
movl %ecx, %esp
retl
.balign 8
.bswap64:
.quad 0x0001020304050607
.roundconstants:
.quad 0x428A2F98D728AE22, 0x7137449123EF65CD, 0xB5C0FBCFEC4D3B2F, 0xE9B5DBA58189DBBC
.quad 0x3956C25BF348B538, 0x59F111F1B605D019, 0x923F82A4AF194F9B, 0xAB1C5ED5DA6D8118
.quad 0xD807AA98A3030242, 0x12835B0145706FBE, 0x243185BE4EE4B28C, 0x550C7DC3D5FFB4E2
.quad 0x72BE5D74F27B896F, 0x80DEB1FE3B1696B1, 0x9BDC06A725C71235, 0xC19BF174CF692694
.quad 0xE49B69C19EF14AD2, 0xEFBE4786384F25E3, 0x0FC19DC68B8CD5B5, 0x240CA1CC77AC9C65
.quad 0x2DE92C6F592B0275, 0x4A7484AA6EA6E483, 0x5CB0A9DCBD41FBD4, 0x76F988DA831153B5
.quad 0x983E5152EE66DFAB, 0xA831C66D2DB43210, 0xB00327C898FB213F, 0xBF597FC7BEEF0EE4
.quad 0xC6E00BF33DA88FC2, 0xD5A79147930AA725, 0x06CA6351E003826F, 0x142929670A0E6E70
.quad 0x27B70A8546D22FFC, 0x2E1B21385C26C926, 0x4D2C6DFC5AC42AED, 0x53380D139D95B3DF
.quad 0x650A73548BAF63DE, 0x766A0ABB3C77B2A8, 0x81C2C92E47EDAEE6, 0x92722C851482353B
.quad 0xA2BFE8A14CF10364, 0xA81A664BBC423001, 0xC24B8B70D0F89791, 0xC76C51A30654BE30
.quad 0xD192E819D6EF5218, 0xD69906245565A910, 0xF40E35855771202A, 0x106AA07032BBD1B8
.quad 0x19A4C116B8D2D0C8, 0x1E376C085141AB53, 0x2748774CDF8EEB99, 0x34B0BCB5E19B48A8
.quad 0x391C0CB3C5C95A63, 0x4ED8AA4AE3418ACB, 0x5B9CCA4F7763E373, 0x682E6FF3D6B2B8A3
.quad 0x748F82EE5DEFB2FC, 0x78A5636F43172F60, 0x84C87814A1F0AB72, 0x8CC702081A6439EC
.quad 0x90BEFFFA23631E28, 0xA4506CEBDE82BDE9, 0xBEF9A3F7B2C67915, 0xC67178F2E372532B
.quad 0xCA273ECEEA26619C, 0xD186B8C721C0C207, 0xEADA7DD6CDE0EB1E, 0xF57D4F7FEE6ED178
.quad 0x06F067AA72176FBA, 0x0A637DC5A2C898A6, 0x113F9804BEF90DAE, 0x1B710B35131C471B
.quad 0x28DB77F523047D84, 0x32CAAB7B40C72493, 0x3C9EBE0A15C9BEBC, 0x431D67C49C100D4C
.quad 0x4CC5D4BECB3E42B6, 0x597F299CFC657E2A, 0x5FCB6FAB3AD6FAEC, 0x6C44198C4A475817
|
alloy4fun_models/trashltl/models/6/7gDtRSrpP6rRv8MoA.als | Kaixi26/org.alloytools.alloy | 0 | 4405 | open main
pred id7gDtRSrpP6rRv8MoA_prop7 {
always some Protected
}
pred __repair { id7gDtRSrpP6rRv8MoA_prop7 }
check __repair { id7gDtRSrpP6rRv8MoA_prop7 <=> prop7o } |
test/Succeed/Issue3818/M.agda | cruhland/agda | 1,989 | 1591 | module Issue3818.M where
|
programs/oeis/160/A160927.asm | neoneye/loda | 22 | 13841 | ; A160927: a(n) = n + reversal(n-1).
; 1,3,5,7,9,11,13,15,17,19,12,23,34,45,56,67,78,89,100,111,23,34,45,56,67,78,89,100,111,122,34,45,56,67,78,89,100,111,122,133,45,56,67,78,89,100,111,122,133,144,56,67,78,89,100,111,122,133,144,155,67,78,89,100
mov $1,$0
seq $1,4086 ; Read n backwards (referred to as R(n) in many sequences).
add $0,$1
add $0,1
|
src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/arraydim/foo.adb | aps337/unum-sdk | 31 | 13694 | -- Copyright 2013-2019 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Foo is
type Multi is array (1 .. 1, 2 .. 3, 4 .. 6) of Integer;
M : Multi := (others => (others => (others => 0)));
-- Use a fake type for importing our C multi-dimensional array.
-- It's only to make sure the C unit gets linked in, regardless
-- of possible optimizations.
type Void_Star is access integer;
E : Void_Star;
pragma Import (C, E, "global_3dim_for_gdb_testing");
begin
Do_Nothing (M'Address); -- STOP
Do_Nothing (E'Address);
end Foo;
|
asm_tests/rirqtest.acme.asm | problame/rc64 | 1 | 169766 | RASTER = 16 ;Hier den 1. Raster-IRQ auslösen
;*** Startadresse
*=$0801
;*** BASIC-Zeile: 2018 SYS 2062
!word main-2, 2018
!byte $9e
!text " 2062"
!byte $00,$00,$00
main
jsr $e544 ;Bildschirm löschen
lda #0 ;schwarz
sta $d020 ;für Rahmen
sta $d021 ;und Hintergrund
sei ;IRQs sperren
lda #<myIRQ ;Adresse unserer Routine in
sta $0314 ;den RAM-Vektor
lda #>myIRQ
sta $0315
lda #%00000001 ;Raster-IRQs vom VIC-II aktivieren
sta $d01a
lda #RASTER ;Hier soll unsere Linie erscheinen
sta $d012
lda $d011 ;Zur Sicherheit höchste BIT
and #%01111111 ;für die Rasterzeile löschen
sta $d011
lda #%01111111 ;Timer-IRQs abschalten
sta $dc0d
lda $dc0d
lda #%0000001 ;evtl. aktiven Raster-IRQ bestätigen
sta $d019
lda #0
sta $0040; counter nullen
; color table
lda #0
sta $0041
lda #6
sta $0042
lda #0
sta $0043
cli ;Interrupts erlauben
jmp * ;Endlosschleife
;*** an Pagegrenze ausrichten, damit die Sprünge passen
!align 255,0
myIRQ
;IRQ bestätigen
lda #%00000001
sta $d019
; increment counter
inc $0040
; encode raster line value in screen position
ldy #3
rasterlineprintloop
lda $d012 ; 4 TZ read current raster line
tax ; 2 TZ
lda $0040 ; 4 TZ reuse counter as rotating character
sta $0400,x ; 4* TZ ???
dey ; 2 TZ
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
bne rasterlineprintloop ; 2* TZ
; = min 18 TZ
;bg color
ldx #0
lda $0040
and #%00011111
and #%00010000
bne setbgfromtablewithoffsetx ; highest bit not zero
ldx #1
setbgfromtablewithoffsetx
lda $0040
sta $0043
lda $0041,X
sta $d021 ;und ins Register für die Hintergrundfarbe
lda $0043
sta $0040
; finish by rusing timer irq exit
cli
jmp $ea81
;*** Wenn wir hier landen, sind bereits 38-45 Taktzyklen
;*** in der aktuellen Rasterzeile (RASTER) vergangen!
;*** Zweiten IRQ einrichten
;*** Da die Zeit bei aktivierten ROM nicht reicht,
;*** können wir den 2. Raster-IRQ erst in der übernächsten Zeile bekommen
; lda #<doubleIRQ ;(2 TZ) 2. Raster-IRQ einrichten
; sta $0314 ;(4 TZ)
; lda #>doubleIRQ ;(2 TZ)
; sta $0315 ;(4 TZ)
; tsx ;(2 TZ) Stackpointer im X-Reg. retten
; stx doubleIRQ+1 ;(4 TZ) und fürs zurückholen sichern!
; nop ;(2 TZ)
; nop ;(2 TZ)
; nop ;(2 TZ)
; lda #%00000001 ;(2 TZ) 1. Raster-IRQ später bestätigen
; ;------
; ;26 TZ
;
;;*** Jetzt sind 64-71 Taktzyklen vergangen und wir sind
;;*** aufjedenfall in nächsten Rasterzeile (RASTER+1)!
;;*** Verbraucht wurden 1-8 TZ
; inc $d012 ;(6 TZ) 2. IRQ in der übernächsten Zeile (RASTER+2)!!!
; ; $d012 wurde bereits automatisch erhöht
; sta $d019 ;(4 TZ) IRQ bestätigen
; cli ;(2 TZ) Interrupts für den 2. Raster-IRQ
; ; wieder freigeben
;
;;*** Wir befinden uns in Rasterzeile RASTER+1 und
;;*** haben bisher 13-20 Zyklen verbraucht
;
;;*** etwas Zeit verschwenden...
; ldx #$08 ; 2 TZ
; dex ;8 * 2 TZ = 16 TZ
; bne *-1 ;7 * 3 TZ = 21 TZ
; ;1 * 2 TZ = 2 TZ
; ; ------
; ; 41 TZ
;
;;*** Bis hier sind 54-61 Taktzyklen vergannen, jetzt auf den IRQ warten...
;;*** Der nächste Rasterinterrupt wird während dieser NOPs auftreten!
; nop ;2 TZ (55)
; nop ;2 TZ (57)
; nop ;2 TZ (59)
; nop ;2 TZ (51)
; nop ;2 TZ (63)
; nop ;2 TZ (65)
;
;doubleIRQ
;;*** Wir sind nun in Rasterzeile RASTER+2 und
;;*** haben bisher genau 38 oder 39 Taktzyklen benötigt!!
;;*** Wir können so sicher sein, da der IRQ während der NOPs auftrat.
;
;;*** Jetzt exakt soviele Taktzyklen 'verschwenden', wie in
;;*** dieser Zeile noch zu verarbeiten sind (also 24 oder 25).
; ldx #$00 ;(2 TZ) Platzhalter für 1. Stackpointer
; txs ;(2 TZ) Stackpointer vom 1. IRQ wiederherstellen
; nop ;(2 TZ)
; nop ;(2 TZ)
; nop ;(2 TZ)
; nop ;(2 TZ)
; bit $01 ;(3 TZ)
; ldx $D012 ;(4 TZ)
; lda #$01 ;(2 TZ) weiß schonmal in den Akku
; cpx $D012 ;(4 TZ) sind wir noch in Rasterzeile 22?
; ;------
; ;25 TZ = 63 oder 64 TZ!!!
;
; beq myIRQMain ;(3 TZ) wenn JA einen letzten Takt 'verschwenden'
; ;(2 TZ) sonst einfach weiterlaufen...
;
;;*** Wir beginnen also immer exakt nach 3 TZ in der dritten Rasterzeile (RASTER+3)
;;*** nach dem 1. Raster-IRQ (den hatten wir ja in für Zeile RASTER festgelegt)
;myIRQMain
; ldx #$ff ;X mit -1 initialisieren, da gleich INX folgt!
;nextColor
; inx ;Schleifenzähler erhöhen
; ldy delaytable,X ;Wartezeit holen
; dey ;verringern
; bne *-1 ;solange größer 0 zurück zum DEY
; lda rowcolortable,X ;Farbe holen
; sta $d021 ;und ins Register für die Hintergrundfarbe
; nop ;ahhhh einfach mal nichts 'tun'
; bpl nextColor ;solange die Farbe positiv ist -> @loop
;
; lda #<myIRQ ;Original IRQ-Vektor setzen
; sta $0314
; lda #>myIRQ
; sta $0315
;
; lda #RASTER
; sta $d012
;
; lda #%00000001 ;IRQ bestätigen
; sta $d019
;
; jmp $ea81 ;zum Ende des 'Timer-Interrupts' springen
;
;
;
;!align 255,0
;rowcolortable
; !byte 6, 11, 11, 12, 12, 15, 1, 15, 12, 12, 11, 11, 6
; !byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
; !byte 6, 11, 11, 12, 12, 15, 1, 15, 12, 12, 11, 11, 6
; !byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
; !byte 6, 11, 11, 12, 12, 15, 1, 15, 12, 12, 11, 11, 6
; !byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
; !byte 6, 11, 11, 12, 12, 15, 1, 15, 12, 12, 11, 11, 6
; !byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
; !byte 6, 11, 11, 12, 12, 15, 1, 15, 12, 12, 11, 11, 6
; !byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
; !byte 6, 11, 11, 12, 12, 15, 1, 15, 12, 12, 11, 11, 6
; !byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
; !byte 6, 11, 11, 12, 12, 15, 1, 15, 12, 12, 11, 11, 6
; !byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
; !byte 6, 11, 11, 12, 12, 15, 1, 15, 12, 12, 11, 11, 6
; !byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
; !byte $f0
;
;
;!align 255,0
;delaytable
; !byte 9 ;letzte Zeile vor der Anzeige
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ; 1. Textzeile
; !byte 2, 8, 8, 9, 9, 9, 9, 10 ; 2.
; !byte 2, 8, 8, 9, 9, 9, 9, 10 ; 3.
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ; 4.
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ; 5.
;
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ; 6.
; !byte 2, 8, 8, 9, 9, 9, 9, 10 ; 7.
; !byte 2, 8, 8, 9, 9, 9, 9, 10 ; 8.
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ; 9.
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ;10. Textzeile
;
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ;11.
; !byte 2, 8, 8, 9, 9, 9, 9, 10 ;12.
; !byte 2, 8, 8, 9, 9, 9, 9, 10 ;13.
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ;14.
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ;15.
;
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ;16.
; !byte 2, 8, 8, 9, 9, 9, 9, 10 ;17.
; !byte 2, 8, 8, 9, 9, 9, 9, 10 ;18.
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ;19.
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ;20. Textzeile
;
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ;21.
; !byte 2, 8, 8, 9, 9, 9, 9, 10 ;22.
; !byte 2, 8, 8, 9, 9, 9, 9, 10 ;23.
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ;24.
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ;25. Textzeile
;
; !byte 2, 8, 8, 9, 9, 9, 9, 9 ;26. 'Sicherheitszeile' |
libsrc/_DEVELOPMENT/temp/sp1/zx/c/sdcc_iy/sp1_DrawUpdateStructIfVal.asm | jpoikela/z88dk | 640 | 9656 | <reponame>jpoikela/z88dk
; sp1_DrawUpdateStructIfVal(struct sp1_update *u)
SECTION code_clib
SECTION code_temp_sp1
PUBLIC _sp1_DrawUpdateStructIfVal
EXTERN asm_sp1_DrawUpdateStructIfVal
_sp1_DrawUpdateStructIfVal:
pop af
pop hl
push hl
push af
jp asm_sp1_DrawUpdateStructIfVal
|
src/MultiSorted/Interpretation.agda | cilinder/formaltt | 21 | 15385 | <reponame>cilinder/formaltt<gh_stars>10-100
open import Agda.Primitive using (_⊔_)
import Categories.Category as Category
import Categories.Category.Cartesian as Cartesian
open import MultiSorted.AlgebraicTheory
import MultiSorted.Product as Product
module MultiSorted.Interpretation
{o ℓ e}
{𝓈 ℴ}
(Σ : Signature {𝓈} {ℴ})
{𝒞 : Category.Category o ℓ e}
(cartesian-𝒞 : Cartesian.Cartesian 𝒞) where
open Signature Σ
open Category.Category 𝒞
-- An interpretation of Σ in 𝒞
record Interpretation : Set (o ⊔ ℓ ⊔ e ⊔ 𝓈 ⊔ ℴ) where
field
interp-sort : sort → Obj
interp-ctx : Product.Producted 𝒞 {Σ = Σ} interp-sort
interp-oper : ∀ (f : oper) → Product.Producted.prod interp-ctx (oper-arity f) ⇒ interp-sort (oper-sort f)
open Product.Producted interp-ctx
-- the interpretation of a term
interp-term : ∀ {Γ : Context} {A} → Term Γ A → prod Γ ⇒ interp-sort A
interp-term (tm-var x) = π x
interp-term (tm-oper f ts) = interp-oper f ∘ tuple (oper-arity f) (λ i → interp-term (ts i))
-- the interpretation of a substitution
interp-subst : ∀ {Γ Δ} → Γ ⇒s Δ → prod Γ ⇒ prod Δ
interp-subst {Γ} {Δ} σ = tuple Δ λ i → interp-term (σ i)
-- the equality of interpretations
⊨_ : (ε : Equation Σ) → Set e
open Equation
⊨ ε = interp-term (eq-lhs ε) ≈ interp-term (eq-rhs ε)
-- interpretation commutes with substitution
open HomReasoning
interp-[]s : ∀ {Γ Δ} {A} {t : Term Δ A} {σ : Γ ⇒s Δ} →
interp-term (t [ σ ]s) ≈ interp-term t ∘ interp-subst σ
interp-[]s {Γ} {Δ} {A} {tm-var x} {σ} = ⟺ (project {Γ = Δ})
interp-[]s {Γ} {Δ} {A} {tm-oper f ts} {σ} = (∘-resp-≈ʳ
(tuple-cong
{fs = λ i → interp-term (ts i [ σ ]s)}
{gs = λ z → interp-term (ts z) ∘ interp-subst σ}
(λ i → interp-[]s {t = ts i} {σ = σ})
○ (∘-distribʳ-tuple
{Γ = oper-arity f}
{fs = λ z → interp-term (ts z)}
{g = interp-subst σ})))
○ (Equiv.refl ○ sym-assoc)
-- -- Every signature has the trivial interpretation
open Product 𝒞
Trivial : Interpretation
Trivial =
let open Cartesian.Cartesian cartesian-𝒞 in
record
{ interp-sort = (λ _ → ⊤)
; interp-ctx = StandardProducted (λ _ → ⊤) cartesian-𝒞
; interp-oper = λ f → ! }
record _⇒I_ (I J : Interpretation) : Set (o ⊔ ℓ ⊔ e ⊔ 𝓈 ⊔ ℴ) where
open Interpretation
open Producted
field
hom-morphism : ∀ {A} → interp-sort I A ⇒ interp-sort J A
hom-commute :
∀ (f : oper) →
hom-morphism ∘ interp-oper I f ≈
interp-oper J f ∘ tuple (interp-ctx J) (oper-arity f) (λ i → hom-morphism ∘ π (interp-ctx I) i)
infix 4 _⇒I_
-- The identity homomorphism
id-I : ∀ {A : Interpretation} → A ⇒I A
id-I {A} =
let open Interpretation A in
let open HomReasoning in
let open Producted interp-sort in
record
{ hom-morphism = id
; hom-commute = λ f →
begin
(id ∘ interp-oper f) ≈⟨ identityˡ ⟩
interp-oper f ≈˘⟨ identityʳ ⟩
(interp-oper f ∘ id) ≈˘⟨ refl⟩∘⟨ unique interp-ctx (λ i → identityʳ ○ ⟺ identityˡ) ⟩
(interp-oper f ∘
Product.Producted.tuple interp-ctx (oper-arity f)
(λ i → id ∘ Product.Producted.π interp-ctx i)) ∎
}
-- Compositon of homomorphisms
_∘I_ : ∀ {A B C : Interpretation} → B ⇒I C → A ⇒I B → A ⇒I C
_∘I_ {A} {B} {C} ϕ ψ =
let open _⇒I_ in
record { hom-morphism = hom-morphism ϕ ∘ hom-morphism ψ
; hom-commute =
let open Interpretation in
let open Producted in
let open HomReasoning in
λ f →
begin
(((hom-morphism ϕ) ∘ hom-morphism ψ) ∘ interp-oper A f) ≈⟨ assoc ⟩
(hom-morphism ϕ ∘ hom-morphism ψ ∘ interp-oper A f) ≈⟨ (refl⟩∘⟨ hom-commute ψ f) ⟩
(hom-morphism ϕ ∘
interp-oper B f ∘
tuple (interp-ctx B) (oper-arity f)
(λ i → hom-morphism ψ ∘ π (interp-ctx A) i)) ≈˘⟨ assoc ⟩
((hom-morphism ϕ ∘ interp-oper B f) ∘
tuple (interp-ctx B) (oper-arity f)
(λ i → hom-morphism ψ ∘ π (interp-ctx A) i)) ≈⟨ (hom-commute ϕ f ⟩∘⟨refl) ⟩
((interp-oper C f ∘
tuple (interp-ctx C) (oper-arity f)
(λ i → hom-morphism ϕ ∘ π (interp-ctx B) i))
∘
tuple (interp-ctx B) (oper-arity f)
(λ i → hom-morphism ψ ∘ π (interp-ctx A) i)) ≈⟨ assoc ⟩
(interp-oper C f ∘
tuple (interp-ctx C) (oper-arity f)
(λ i → hom-morphism ϕ ∘ π (interp-ctx B) i)
∘
tuple (interp-ctx B) (oper-arity f)
(λ i → hom-morphism ψ ∘ π (interp-ctx A) i)) ≈⟨ (refl⟩∘⟨ ⟺ (∘-distribʳ-tuple (interp-sort C) (interp-ctx C))) ⟩
(interp-oper C f ∘
tuple (interp-ctx C) (oper-arity f)
(λ x →
(hom-morphism ϕ ∘ π (interp-ctx B) x) ∘
tuple (interp-ctx B) (oper-arity f)
(λ i → hom-morphism ψ ∘ π (interp-ctx A) i))) ≈⟨ (refl⟩∘⟨ tuple-cong (interp-sort C) (interp-ctx C) λ i → assoc) ⟩
(interp-oper C f ∘
tuple (interp-ctx C) (oper-arity f)
(λ z →
hom-morphism ϕ ∘
π (interp-ctx B) z ∘
tuple (interp-ctx B) (oper-arity f)
(λ i → hom-morphism ψ ∘ π (interp-ctx A) i))) ≈⟨ (refl⟩∘⟨ tuple-cong (interp-sort C) (interp-ctx C) λ i → refl⟩∘⟨ project (interp-ctx B)) ⟩
(interp-oper C f ∘
tuple (interp-ctx C) (oper-arity f)
(λ z → hom-morphism ϕ ∘ hom-morphism ψ ∘ π (interp-ctx A) z)) ≈⟨ (refl⟩∘⟨ tuple-cong (interp-sort C) (interp-ctx C) λ i → sym-assoc) ⟩
(interp-oper C f ∘
tuple (interp-ctx C) (oper-arity f)
(λ z → (hom-morphism ϕ ∘ hom-morphism ψ) ∘ π (interp-ctx A) z)) ∎}
|
programs/oeis/051/A051873.asm | karttu/loda | 1 | 162072 | <filename>programs/oeis/051/A051873.asm
; A051873: 21-gonal numbers: a(n) = n*(19n - 17)/2.
; 0,1,21,60,118,195,291,406,540,693,865,1056,1266,1495,1743,2010,2296,2601,2925,3268,3630,4011,4411,4830,5268,5725,6201,6696,7210,7743,8295,8866,9456,10065,10693,11340,12006,12691,13395,14118,14860,15621,16401,17200,18018,18855,19711,20586,21480,22393,23325,24276,25246,26235,27243,28270,29316,30381,31465,32568,33690,34831,35991,37170,38368,39585,40821,42076,43350,44643,45955,47286,48636,50005,51393,52800,54226,55671,57135,58618,60120,61641,63181,64740,66318,67915,69531,71166,72820,74493,76185,77896,79626,81375,83143,84930,86736,88561,90405,92268,94150,96051,97971,99910,101868,103845,105841,107856,109890,111943,114015,116106,118216,120345,122493,124660,126846,129051,131275,133518,135780,138061,140361,142680,145018,147375,149751,152146,154560,156993,159445,161916,164406,166915,169443,171990,174556,177141,179745,182368,185010,187671,190351,193050,195768,198505,201261,204036,206830,209643,212475,215326,218196,221085,223993,226920,229866,232831,235815,238818,241840,244881,247941,251020,254118,257235,260371,263526,266700,269893,273105,276336,279586,282855,286143,289450,292776,296121,299485,302868,306270,309691,313131,316590,320068,323565,327081,330616,334170,337743,341335,344946,348576,352225,355893,359580,363286,367011,370755,374518,378300,382101,385921,389760,393618,397495,401391,405306,409240,413193,417165,421156,425166,429195,433243,437310,441396,445501,449625,453768,457930,462111,466311,470530,474768,479025,483301,487596,491910,496243,500595,504966,509356,513765,518193,522640,527106,531591,536095,540618,545160,549721,554301,558900,563518,568155,572811,577486,582180,586893
mov $1,$0
bin $0,2
mul $0,19
add $1,$0
|
private/windows/media/avi/avicap/libentry.asm | King0987654/windows2000 | 13 | 16751 | <gh_stars>10-100
PAGE,132
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; LIBENTRY.ASM
;
; Windows dynamic link library entry routine
;
; This module generates a code segment called INIT_TEXT.
; It initializes the local heap if one exists and then calls
; the C routine LibMain() which should have the form:
; BOOL FAR PASCAL LibMain(HANDLE hInstance,
; WORD wDataSeg,
; WORD cbHeap,
; DWORD ignore); /* Always NULL - ignore */
;
; The result of the call to LibMain is returned to Windows.
; The C routine should return TRUE if it completes initialization
; successfully, FALSE if some error occurs.
;
; Note - The last parameter to LibMain is included for compatibility
; reasons. Applications that wish to modify this file and remove the
; parameter from LibMain may do so by simply removing the two
; "push" instructions below marked with "****".
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
include cmacros.inc
externFP <LibMain> ; the C routine to be called
createSeg INIT_TEXT, INIT_TEXT, BYTE, PUBLIC, CODE
sBegin INIT_TEXT
assumes CS,INIT_TEXT
?PLM=0 ; 'C'naming
externA <_acrtused> ; ensures that Win DLL startup code is linked
?PLM=1 ; 'PASCAL' naming
externFP <LocalInit> ; Windows heap init routine
cProc LibEntry, <PUBLIC,FAR> ; entry point into DLL
include CONVDLL.INC
cBegin
push di ; handle of the module instance
push ds ; library data segment
push cx ; heap size
push es ; Always NULL **** May remove (see above)
push si ; Always NULL **** May remove (see above)
; if we have some heap then initialize it
jcxz callc ; jump if no heap specified
; call the Windows function LocalInit() to set up the heap
; LocalInit((LPSTR)start, WORD cbHeap);
xor ax,ax
cCall LocalInit <ds, ax, cx>
or ax,ax ; did it do it ok ?
jz error ; quit if it failed
; invoke the C routine to do any special initialization
callc:
call LibMain ; invoke the 'C' routine (result in AX)
jmp short exit ; LibMain is responsible for stack clean up
error:
pop si ; clean up stack on a LocalInit error
pop es
pop cx
pop ds
pop di
exit:
cEnd
sEnd INIT_TEXT
end LibEntry
|
examples/examplesPaperJFP/WxGraphicsLib.agda | agda/ooAgda | 23 | 283 | module examplesPaperJFP.WxGraphicsLib where
open import SizedIO.Base
open import StateSizedIO.GUI.BaseStateDependent
open import Size
open import Data.Bool.Base
open import Data.List.Base
open import Function
open import NativeIO
open import StateSizedIO.GUI.WxBindingsFFI
open import StateSizedIO.GUI.VariableList
data GuiLev1Command : Set where
makeFrame : GuiLev1Command
makeButton : Frame → GuiLev1Command
addButton : Frame → Button → GuiLev1Command
drawBitmap : DC → Bitmap → Point → Bool → GuiLev1Command
repaint : Frame → GuiLev1Command
GuiLev1Response : GuiLev1Command → Set
GuiLev1Response makeFrame = Frame
GuiLev1Response (makeButton _) = Button
GuiLev1Response _ = Unit
GuiLev1Interface : IOInterface
Command GuiLev1Interface = GuiLev1Command
Response GuiLev1Interface = GuiLev1Response
GuiLev2State : Set₁
GuiLev2State = VarList
data GuiLev2Command (s : GuiLev2State) : Set₁ where
level1C : GuiLev1Command → GuiLev2Command s
createVar : {A : Set} → A → GuiLev2Command s
setButtonHandler : Button
→ List (prod s → IO GuiLev1Interface ∞ (prod s))
→ GuiLev2Command s
setOnPaint : Frame
→ List (prod s → DC → Rect → IO GuiLev1Interface ∞ (prod s))
→ GuiLev2Command s
GuiLev2Response : (s : GuiLev2State) → GuiLev2Command s → Set
GuiLev2Response _ (level1C c) = GuiLev1Response c
GuiLev2Response _ (createVar {A} a) = Var A
GuiLev2Response _ _ = Unit
GuiLev2Next : (s : GuiLev2State) → (c : GuiLev2Command s)
→ GuiLev2Response s c
→ GuiLev2State
GuiLev2Next s (createVar {A} a) var = addVar A var s
GuiLev2Next s _ _ = s
GuiLev2Interface : IOInterfaceˢ
Stateˢ GuiLev2Interface = GuiLev2State
Commandˢ GuiLev2Interface = GuiLev2Command
Responseˢ GuiLev2Interface = GuiLev2Response
nextˢ GuiLev2Interface = GuiLev2Next
translateLev1Local : (c : GuiLev1Command) → NativeIO (GuiLev1Response c)
translateLev1Local makeFrame = nativeNewFrame "dummy title"
translateLev1Local (makeButton fra) = nativeMakeButton fra "dummy button label"
translateLev1Local (addButton fra bt) = nativeAddButton fra bt
translateLev1Local (drawBitmap dc bm p b) = nativeDrawBitmap dc bm p b
translateLev1Local (repaint fra) = nativeRepaint fra
translateLev1 : {A : Set} → IO GuiLev1Interface ∞ A → NativeIO A
translateLev1 = translateIO translateLev1Local
translateLev1List : {A : Set} → List (IO GuiLev1Interface ∞ A) → List (NativeIO A)
translateLev1List l = map translateLev1 l
translateLev2Local : (s : GuiLev2State)
→ (c : GuiLev2Command s)
→ NativeIO (GuiLev2Response s c)
translateLev2Local s (level1C c) = translateLev1Local c
translateLev2Local s (createVar {A} a) = nativeNewVar {A} a
translateLev2Local s (setButtonHandler bt proglist) =
nativeSetButtonHandler bt
(dispatchList s (map (λ prog → translateLev1 ∘ prog) proglist))
translateLev2Local s (setOnPaint fra proglist) =
nativeSetOnPaint fra (λ dc rect → dispatchList s
(map (λ prog aa → translateLev1 (prog aa dc rect)) proglist))
translateLev2 : ∀ {A s} → IOˢ GuiLev2Interface ∞ (λ _ → A) s → NativeIO A
translateLev2 = translateIOˢ translateLev2Local
|
programs/oeis/057/A057361.asm | neoneye/loda | 22 | 88762 | <filename>programs/oeis/057/A057361.asm<gh_stars>10-100
; A057361: a(n) = floor(5*n/8).
; 0,0,1,1,2,3,3,4,5,5,6,6,7,8,8,9,10,10,11,11,12,13,13,14,15,15,16,16,17,18,18,19,20,20,21,21,22,23,23,24,25,25,26,26,27,28,28,29,30,30,31,31,32,33,33,34,35,35,36,36,37,38,38,39,40,40,41,41,42,43,43,44,45,45,46,46,47,48,48,49,50,50,51,51,52,53,53,54,55,55,56,56,57,58,58,59,60,60,61,61
mul $0,5
div $0,8
|
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_55_527.asm | ljhsiun2/medusa | 9 | 15318 | <reponame>ljhsiun2/medusa<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r15
push %rcx
push %rdi
push %rsi
// Store
lea addresses_normal+0xa26f, %r15
nop
add $55154, %rcx
mov $0x5152535455565758, %r12
movq %r12, (%r15)
add $61777, %r10
// REPMOV
mov $0xe87, %rsi
lea addresses_normal+0xdb6f, %rdi
nop
nop
nop
dec %r12
mov $90, %rcx
rep movsl
cmp %rsi, %rsi
// Faulty Load
lea addresses_WC+0x1236f, %r10
clflush (%r10)
and %rsi, %rsi
movups (%r10), %xmm6
vpextrq $1, %xmm6, %rdi
lea oracles, %r15
and $0xff, %rdi
shlq $12, %rdi
mov (%r15,%rdi,1), %rdi
pop %rsi
pop %rdi
pop %rcx
pop %r15
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_P', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal', 'congruent': 8, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'00': 55}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
programs/oeis/322/A322008.asm | neoneye/loda | 22 | 94944 | ; A322008: 1/(1 - Integral_{x=0..1} x^(x^n) dx), rounded to the nearest integer.
; 2,5,10,17,26,37,50,65,82,101,123,146,171,198,227,258,291,326,364,403,444,487,532,579,628,679,733,788,845,904,965,1028,1093,1160,1230,1301,1374,1449,1526,1605,1686,1769,1855,1942,2031,2122,2215,2310,2407,2506,2608
mov $1,$0
sub $0,2
div $0,8
add $0,2
mov $2,$1
mul $2,2
add $0,$2
mov $3,$1
mul $3,$1
add $0,$3
|
libsrc/net/sock_settos.asm | dex4er/deb-z88dk | 1 | 82316 | <filename>libsrc/net/sock_settos.asm
;
; This file is automatically generated
;
; Do not edit!!!
;
; djm 12/2/2000
;
; ZSock Lib function: sock_settos
XLIB sock_settos
LIB no_zsock
INCLUDE "#packages.def"
INCLUDE "#zsock.def"
.sock_settos
ld a,r_sock_settos
call_pkg(tcp_all)
ret nc
; We failed..are we installed?
cp rc_pnf
scf ;signal error
ret nz ;Internal error
call_pkg(tcp_ayt)
jr nc,sock_settos
jp no_zsock
|
libsrc/_DEVELOPMENT/adt/b_array/c/sdcc_iy/b_array_pop_back_fastcall.asm | meesokim/z88dk | 0 | 88596 |
; int b_array_pop_back_fastcall(b_array_t *a)
SECTION code_adt_b_array
PUBLIC _b_array_pop_back_fastcall
_b_array_pop_back_fastcall:
INCLUDE "adt/b_array/z80/asm_b_array_pop_back.asm"
|
wof/lcs/enemy/A4.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | 6 | 89630 | copyright zengfr site:http://github.com/zengfr/romhack
001590 lea ($20,A0), A0
004144 rts [enemy+A4]
00414A bne $4144 [enemy+A4]
007B66 move.b D0, ($a4,A0)
007B6A jsr $f98.w
01229E move.l (A2)+, (A3)+ [enemy+A0, enemy+A2]
0122A0 move.l (A2)+, (A3)+ [enemy+A4, enemy+A6]
01241A move.b D0, ($a4,A0)
01241E move.b D0, ($c6,A0)
01A75E dbra D4, $1a75c
025382 tst.b ($a4,A0) [base+1E4, base+1E6]
025386 beq $2538c
02674E tst.b ($a4,A0) [base+1E4, base+1E6]
026752 beq $26758
029176 tst.b ($a4,A0) [base+1E4, base+1E6]
02917A beq $29180 [enemy+A4]
029180 move.b ($2a,A0), D0 [enemy+A4]
02A538 tst.b ($a4,A0) [base+1E4, base+1E6]
02A53C beq $2a542 [enemy+A4]
02A542 move.b ($2a,A0), D0 [enemy+A4]
02B764 tst.b ($a4,A0) [base+1E4, base+1E6]
02B768 beq $2b76e [enemy+A4]
02B76E move.b ($2a,A0), D0 [enemy+A4]
0328CC tst.b ($a4,A0) [base+1E4, base+1E6]
0328D0 beq $328d6 [enemy+A4]
0328D6 move.b ($2a,A0), D0 [enemy+A4]
036700 tst.b ($a4,A0) [base+1E4, base+1E6]
036704 beq $3670a [enemy+A4]
03670A move.b ($2a,A0), D0 [enemy+A4]
046842 tst.b ($a4,A0) [base+1E4, base+1E6]
046846 beq $4684c
0471B8 beq $471be
049574 beq $4957a
049A2A beq $49a30
copyright zengfr site:http://github.com/zengfr/romhack
|
coverage/IN_CTS/0574-COVERAGE-cmp-inst-analysis-103/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 0 | 9051 | <filename>coverage/IN_CTS/0574-COVERAGE-cmp-inst-analysis-103/work/variant/1_spirv_asm/shader.frag.asm
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 76
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main" %57
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 320
OpName %4 "main"
OpName %8 "a"
OpName %12 "buf0"
OpMemberName %12 0 "_GLF_uniform_int_values"
OpName %14 ""
OpName %20 "i"
OpName %57 "_GLF_color"
OpDecorate %11 ArrayStride 16
OpMemberDecorate %12 0 Offset 0
OpDecorate %12 Block
OpDecorate %14 DescriptorSet 0
OpDecorate %14 Binding 0
OpDecorate %57 Location 0
%2 = OpTypeVoid
%3 = OpTypeFunction %2
%6 = OpTypeInt 32 1
%7 = OpTypePointer Function %6
%9 = OpTypeInt 32 0
%10 = OpConstant %9 4
%11 = OpTypeArray %6 %10
%12 = OpTypeStruct %11
%13 = OpTypePointer Uniform %12
%14 = OpVariable %13 Uniform
%15 = OpConstant %6 0
%16 = OpConstant %6 1
%17 = OpTypePointer Uniform %6
%21 = OpConstant %6 2
%36 = OpTypeBool
%48 = OpConstant %6 3
%54 = OpTypeFloat 32
%55 = OpTypeVector %54 4
%56 = OpTypePointer Output %55
%57 = OpVariable %56 Output
%4 = OpFunction %2 None %3
%5 = OpLabel
%8 = OpVariable %7 Function
%20 = OpVariable %7 Function
%18 = OpAccessChain %17 %14 %15 %16
%19 = OpLoad %6 %18
OpStore %8 %19
%22 = OpAccessChain %17 %14 %15 %21
%23 = OpLoad %6 %22
%24 = OpSNegate %6 %23
OpStore %20 %24
OpBranch %25
%25 = OpLabel
OpLoopMerge %27 %28 None
OpBranch %29
%29 = OpLabel
%30 = OpLoad %6 %20
%31 = OpAccessChain %17 %14 %15 %15
%32 = OpLoad %6 %31
%33 = OpAccessChain %17 %14 %15 %15
%34 = OpLoad %6 %33
%35 = OpShiftRightArithmetic %6 %32 %34
%37 = OpSLessThan %36 %30 %35
OpBranchConditional %37 %26 %27
%26 = OpLabel
%38 = OpLoad %6 %8
%39 = OpSGreaterThanEqual %36 %38 %21
OpSelectionMerge %41 None
OpBranchConditional %39 %40 %41
%40 = OpLabel
OpBranch %27
%41 = OpLabel
%43 = OpLoad %6 %8
%44 = OpIAdd %6 %43 %16
OpStore %8 %44
OpBranch %28
%28 = OpLabel
%45 = OpLoad %6 %20
%46 = OpIAdd %6 %45 %16
OpStore %20 %46
OpBranch %25
%27 = OpLabel
%47 = OpLoad %6 %8
%49 = OpAccessChain %17 %14 %15 %48
%50 = OpLoad %6 %49
%51 = OpIEqual %36 %47 %50
OpSelectionMerge %53 None
OpBranchConditional %51 %52 %71
%52 = OpLabel
%58 = OpAccessChain %17 %14 %15 %15
%59 = OpLoad %6 %58
%60 = OpConvertSToF %54 %59
%61 = OpAccessChain %17 %14 %15 %16
%62 = OpLoad %6 %61
%63 = OpConvertSToF %54 %62
%64 = OpAccessChain %17 %14 %15 %16
%65 = OpLoad %6 %64
%66 = OpConvertSToF %54 %65
%67 = OpAccessChain %17 %14 %15 %15
%68 = OpLoad %6 %67
%69 = OpConvertSToF %54 %68
%70 = OpCompositeConstruct %55 %60 %63 %66 %69
OpStore %57 %70
OpBranch %53
%71 = OpLabel
%72 = OpAccessChain %17 %14 %15 %16
%73 = OpLoad %6 %72
%74 = OpConvertSToF %54 %73
%75 = OpCompositeConstruct %55 %74 %74 %74 %74
OpStore %57 %75
OpBranch %53
%53 = OpLabel
OpReturn
OpFunctionEnd
|
archive/agda-2/Oscar/Data/Term/internal/SubstituteAndSubstitution.agda | m0davis/oscar | 0 | 9324 | <filename>archive/agda-2/Oscar/Data/Term/internal/SubstituteAndSubstitution.agda
module Oscar.Data.Term.internal.SubstituteAndSubstitution {𝔣} (FunctionName : Set 𝔣) where
open import Oscar.Category.Action
open import Oscar.Category.Category
open import Oscar.Category.CategoryAction
open import Oscar.Category.Functor
open import Oscar.Category.Morphism
open import Oscar.Category.Semifunctor
open import Oscar.Category.Semigroupoid
open import Oscar.Category.Setoid
open import Oscar.Category.SemigroupoidAction
open import Oscar.Data.Equality
open import Oscar.Data.Equality.properties
open import Oscar.Data.Fin
open import Oscar.Data.Nat
open import Oscar.Data.Term FunctionName
open import Oscar.Data.Vec
open import Oscar.Function
open import Oscar.Level
open import Oscar.Relation
𝕞₁ : Morphism _ _ _
𝕞₁ = Fin ⇨ Term
𝕞₂ : Morphism _ _ _
𝕞₂ = Term ⇨ Term
𝕞₂ₛ : Nat → Morphism _ _ _
𝕞₂ₛ N = Terms N ⇨ Terms N
module 𝔐₁ = Morphism 𝕞₁
module 𝔐₂ = Morphism 𝕞₂
module 𝔐₂ₛ (N : Nat) where open Morphism (𝕞₂ₛ N) public using () renaming (_↦_ to _[_↦_])
private
infix 19 _◂_ _◂s_
mutual
_◂_ : ∀ {m n} → m 𝔐₁.↦ n → m 𝔐₂.↦ n
σ̇ ◂ i 𝑥 = σ̇ 𝑥
_ ◂ leaf = leaf
σ̇ ◂ (τl fork τr) = (σ̇ ◂ τl) fork (σ̇ ◂ τr)
σ̇ ◂ (function fn τs) = function fn (σ̇ ◂s τs) where
_◂s_ : ∀ {m n} → m ⊸ n → ∀ {N} → N 𝔐₂ₛ.[ m ↦ n ] -- Vec (Term m) N → Vec (Term n) N
f ◂s [] = []
f ◂s (t ∷ ts) = f ◂ t ∷ f ◂s ts
_∙_ : ∀ {m n} → m ⊸ n → ∀ {l} → l ⊸ m → l ⊸ n
_∙_ f g = (f ◂_) ∘ g
mutual
◂-extensionality : ∀ {m n} {f g : m ⊸ n} → f ≡̇ g → f ◂_ ≡̇ g ◂_
◂-extensionality p (i x) = p x
◂-extensionality p leaf = refl
◂-extensionality p (s fork t) = cong₂ _fork_ (◂-extensionality p s) (◂-extensionality p t)
◂-extensionality p (function fn ts) = cong (function fn) (◂s-extensionality p ts)
◂s-extensionality : ∀ {m n} {f g : m ⊸ n} → f ≡̇ g → ∀ {N} → _◂s_ f {N} ≡̇ _◂s_ g
◂s-extensionality p [] = refl
◂s-extensionality p (t ∷ ts) = cong₂ _∷_ (◂-extensionality p t) (◂s-extensionality p ts)
mutual
◂-associativity : ∀ {l m} (f : l ⊸ m) {n} (g : m ⊸ n) → (g ∙ f) ◂_ ≡̇ (g ◂_) ∘ (f ◂_)
◂-associativity _ _ (i _) = refl
◂-associativity _ _ leaf = refl
◂-associativity _ _ (τ₁ fork τ₂) = cong₂ _fork_ (◂-associativity _ _ τ₁) (◂-associativity _ _ τ₂)
◂-associativity f g (function fn ts) = cong (function fn) (◂s-associativity f g ts)
◂s-associativity : ∀ {l m n} (f : l ⊸ m) (g : m ⊸ n) → ∀ {N} → (_◂s_ (g ∙ f) {N}) ≡̇ (g ◂s_) ∘ (f ◂s_)
◂s-associativity _ _ [] = refl
◂s-associativity _ _ (τ ∷ τs) = cong₂ _∷_ (◂-associativity _ _ τ) (◂s-associativity _ _ τs)
∙-associativity : ∀ {k l} (f : k ⊸ l) {m} (g : l ⊸ m) {n} (h : m ⊸ n) → (h ∙ g) ∙ f ≡̇ h ∙ (g ∙ f)
∙-associativity f g h x rewrite ◂-associativity g h (f x) = refl
∙-extensionality : ∀ {l m} {f₁ f₂ : l ⊸ m} → f₁ ≡̇ f₂ → ∀ {n} {g₁ g₂ : m ⊸ n} → g₁ ≡̇ g₂ → g₁ ∙ f₁ ≡̇ g₂ ∙ f₂
∙-extensionality {f₂ = f₂} f₁≡̇f₂ g₁≡̇g₂ x rewrite f₁≡̇f₂ x = ◂-extensionality g₁≡̇g₂ (f₂ x)
instance
IsSemigroupoid𝕞₁∙ : IsSemigroupoid 𝕞₁ _∙_
IsSemigroupoid.extensionality IsSemigroupoid𝕞₁∙ = ∙-extensionality
IsSemigroupoid.associativity IsSemigroupoid𝕞₁∙ = ∙-associativity
𝕘₁ : Semigroupoid _ _ _
𝕘₁ = 𝕞₁ , _∙_
𝕘₂ : Semigroupoid _ _ _
𝕘₂ = 𝕞₂ , (λ ‵ → _∘_ ‵)
𝕘₂ₛ : Nat → Semigroupoid _ _ _
𝕘₂ₛ N = 𝕞₂ₛ N , (λ ‵ → _∘_ ‵)
𝕘₁,₂ : Semigroupoids _ _ _ _ _ _
𝕘₁,₂ = 𝕘₁ , 𝕘₂
instance
IsSemifunctor𝕘₁₂◂ : IsSemifunctor 𝕘₁,₂ _◂_
IsSemifunctor.extensionality IsSemifunctor𝕘₁₂◂ = ◂-extensionality
IsSemifunctor.distributivity IsSemifunctor𝕘₁₂◂ = ◂-associativity
𝕗◂ : Semifunctor _ _ _ _ _ _
𝕗◂ = 𝕘₁,₂ , _◂_
𝕘₁,₂ₛ : Nat → Semigroupoids _ _ _ _ _ _
𝕘₁,₂ₛ N = 𝕘₁ , 𝕘₂ₛ N
instance
IsSemifunctor𝕘₁,₂ₛ◂s : ∀ {N} → IsSemifunctor (𝕘₁,₂ₛ N) (λ ‵ → _◂s_ ‵)
IsSemifunctor.extensionality IsSemifunctor𝕘₁,₂ₛ◂s f≡̇g τs = ◂s-extensionality f≡̇g τs
IsSemifunctor.distributivity IsSemifunctor𝕘₁,₂ₛ◂s f g x = ◂s-associativity f g x
𝕗◂s : Nat → Semifunctor _ _ _ _ _ _
𝕗◂s N = 𝕘₁,₂ₛ N , (λ ‵ → _◂s_ ‵)
𝕒₂ : Action _ _ _
𝕒₂ = actionΣ Term
𝕒₂ₛ : Nat → Action _ _ _
𝕒₂ₛ N = actionΣ (Terms N)
instance
IsSemigroupoidAction𝕘₁𝕒₂◂ : IsSemigroupoidAction 𝕘₁ 𝕒₂ _◂_
IsSemigroupoidAction.extensionality IsSemigroupoidAction𝕘₁𝕒₂◂ {s₁ = s₁} refl f₁≡̇f₂ = ◂-extensionality f₁≡̇f₂ s₁
IsSemigroupoidAction.associativity IsSemigroupoidAction𝕘₁𝕒₂◂ s f g = ◂-associativity f g s
IsSemigroupoidAction𝕘₁𝕒₂ₛ◂s : ∀ {N} → IsSemigroupoidAction 𝕘₁ (𝕒₂ₛ N) (λ ‵ → _◂s_ ‵)
IsSemigroupoidAction.extensionality IsSemigroupoidAction𝕘₁𝕒₂ₛ◂s {s₁ = s₁} refl f₁≡̇f₂ = ◂s-extensionality f₁≡̇f₂ s₁
IsSemigroupoidAction.associativity IsSemigroupoidAction𝕘₁𝕒₂ₛ◂s s f g = ◂s-associativity f g s
𝕟◂ : SemigroupoidAction _ _ _ _ _
𝕟◂ = [ 𝕘₁ / 𝕒₂ ] _◂_
𝕟◂s : Nat → SemigroupoidAction _ _ _ _ _
𝕟◂s N = [ 𝕘₁ / 𝕒₂ₛ N ] (λ ‵ → _◂s_ ‵)
private
ε : ∀ {m} → m ⊸ m
ε = i
mutual
◂-identity : ∀ {m} (t : Term m) → ε ◂ t ≡ t
◂-identity (i x) = refl
◂-identity leaf = refl
◂-identity (s fork t) = cong₂ _fork_ (◂-identity s) (◂-identity t)
◂-identity (function fn ts) = cong (function fn) (◂s-identity ts)
◂s-identity : ∀ {N m} (t : Vec (Term m) N) → ε ◂s t ≡ t
◂s-identity [] = refl
◂s-identity (t ∷ ts) = cong₂ _∷_ (◂-identity t) (◂s-identity ts)
∙-left-identity : ∀ {m n} (f : m ⊸ n) → ε ∙ f ≡̇ f
∙-left-identity f = ◂-identity ∘ f
∙-right-identity : ∀ {m n} (f : m ⊸ n) → f ∙ ε ≡̇ f
∙-right-identity _ _ = refl
instance
IsCategory𝕘₁ε : IsCategory 𝕘₁ ε
IsCategory.left-identity IsCategory𝕘₁ε = ∙-left-identity
IsCategory.right-identity IsCategory𝕘₁ε = ∙-right-identity
𝔾₁ : Category _ _ _
𝔾₁ = 𝕘₁ , ε
𝔾₂ : Category _ _ _
𝔾₂ = 𝕘₂ , id
𝔾₂ₛ : Nat → Category _ _ _
𝔾₂ₛ N = 𝕘₂ₛ N , id
𝔾₁,₂ : Categories _ _ _ _ _ _
𝔾₁,₂ = 𝔾₁ , 𝔾₂
𝔾₁,₂ₛ : Nat → Categories _ _ _ _ _ _
𝔾₁,₂ₛ N = 𝔾₁ , 𝔾₂ₛ N
instance
IsFunctor𝔾₁,₂◂ : IsFunctor 𝔾₁,₂ _◂_
IsFunctor.identity IsFunctor𝔾₁,₂◂ _ = ◂-identity
𝔽◂ : Functor _ _ _ _ _ _
𝔽◂ = 𝔾₁,₂ , _◂_
instance
IsFunctor𝔾₁,₂ₛ◂ : ∀ {N} → IsFunctor (𝔾₁,₂ₛ N) (λ ‵ → _◂s_ ‵)
IsFunctor.identity IsFunctor𝔾₁,₂ₛ◂ _ = ◂s-identity -- ◂-identity
𝔽s : Nat → Functor _ _ _ _ _ _
𝔽s N = 𝔾₁,₂ₛ N , (λ ‵ → _◂s_ ‵)
instance
IsCategoryAction𝔾₁𝕒₂◂ : IsCategoryAction 𝔾₁ 𝕒₂ _◂_
IsCategoryAction.identity IsCategoryAction𝔾₁𝕒₂◂ = ◂-identity
IsCategoryAction𝔾₁𝕒₂ₛ◂s : ∀ {N} → IsCategoryAction 𝔾₁ (𝕒₂ₛ N) (λ ‵ → _◂s_ ‵)
IsCategoryAction.identity IsCategoryAction𝔾₁𝕒₂ₛ◂s = ◂s-identity
ℕ◂ : CategoryAction _ _ _ _ _
ℕ◂ = [ 𝔾₁ / 𝕒₂ ] _◂_
ℕ◂s : Nat → CategoryAction _ _ _ _ _
ℕ◂s N = [ 𝔾₁ / 𝕒₂ₛ N ] (λ ‵ → _◂s_ ‵)
|
src/Utilities/xml_utilities.adb | fintatarta/eugen | 0 | 20922 | <reponame>fintatarta/eugen<filename>src/Utilities/xml_utilities.adb
with SAX.Readers;
with DOM.Readers;
with Input_Sources.Strings;
with Unicode.CES.Utf8;
with Dom.Core.Elements;
with DOM.Core.Nodes;
with Ada.Strings.Maps;
with Ada.Strings.Fixed;
package body XML_Utilities is
procedure Remove_White_Space (Doc : Dom.Core.Node)
is
use Dom.Core;
use Dom.Core.Nodes;
Children : constant Dom.Core.Node_List := Dom.Core.Nodes.Child_Nodes (Doc);
N : Dom.Core.Node;
begin
for I in 1 .. Dom.Core.Nodes.Length (Children) loop
N := Dom.Core.Nodes.Item (Children, I);
if Node_Type (N) /= Text_Node then
Remove_White_Space (N);
else
declare
X : constant String := Node_Value (N);
Q : Node;
begin
if (for all I in X'Range => X (I) = ' ' or X (I) = Character'Val (10)) then
Q := Remove_Child (Doc, N);
Free (Q);
end if;
end;
end if;
end loop;
end Remove_White_Space;
------------------
-- Parse_String --
------------------
function Parse_String (Item : String) return DOM.Core.Document is
use SAX.Readers;
use Ada.Strings.Fixed;
use Ada.Strings.Maps;
In_Source : Input_Sources.Strings.String_Input;
Reader : DOM.Readers.Tree_Reader;
Result : Dom.Core.Document;
Eol_To_Space : constant Character_Mapping := To_Mapping (From => "" & Character'Val (10),
To => " ");
begin
Input_Sources.Strings.Open (Str => Translate (Item, Eol_To_Space),
Encoding => Unicode.CES.Utf8.Utf8_Encoding,
Input => In_Source);
SAX.Readers.Set_Feature (Parser => Sax_Reader (Reader),
Name => SAX.Readers.Validation_Feature,
Value => False);
SAX.Readers.Set_Feature (Parser => Sax_Reader (Reader),
Name => SAX.Readers.Namespace_Feature,
Value => False);
Sax.Readers.Parse (Parser => Sax_Reader (Reader),
Input => In_Source);
Result := DOM.Readers.Get_Tree (Reader);
Remove_White_Space (Result);
return Result;
end Parse_String;
function Expect_Attribute (N : DOM.Core.Node;
Name : String)
return String
is
use type DOM.Core.Node;
Attr : constant DOM.Core.Node := DOM.Core.Elements.Get_Attribute_Node (N, Name);
begin
if Attr = null then
raise No_Such_Attribute;
else
return DOM.Core.Nodes.Node_Value (Attr);
end if;
end Expect_Attribute;
function Get_Attribute (N : DOM.Core.Node;
Name : String;
Default : String := "")
return String
is
use type DOM.Core.Node;
Attr : constant DOM.Core.Node := DOM.Core.Elements.Get_Attribute_Node (N, Name);
begin
if Attr = null then
return Default;
else
return DOM.Core.Nodes.Node_Value (Attr);
end if;
end Get_Attribute;
function Has_Attribute (N : DOM.Core.Node;
Name : String)
return Boolean
is
use DOM.Core;
begin
return Elements.Get_Attribute_Node (N, Name) /= null;
end Has_Attribute;
end XML_Utilities;
|
oeis/057/A057145.asm | neoneye/loda-programs | 11 | 11701 | ; A057145: Square array of polygonal numbers T(n,k) = ((n-2)*k^2 - (n-4)*k)/2, n >= 2, k >= 1, read by antidiagonals upwards.
; Submitted by <NAME>
; 1,1,2,1,3,3,1,4,6,4,1,5,9,10,5,1,6,12,16,15,6,1,7,15,22,25,21,7,1,8,18,28,35,36,28,8,1,9,21,34,45,51,49,36,9,1,10,24,40,55,66,70,64,45,10,1,11,27,46,65,81,91,92,81,55,11,1,12,30,52,75,96,112,120,117,100,66,12,1,13,33,58,85,111,133,148,153,145,121,78,13,1,14,36,64,95,126,154,176,189
lpb $0
add $1,1
sub $0,$1
lpe
sub $1,$0
mul $1,$0
add $0,1
add $1,1
mul $1,$0
add $0,$1
div $0,2
|
alloy4fun_models/trashltl/models/6/ZHWD8JWxMtHvJuLd5.als | Kaixi26/org.alloytools.alloy | 0 | 4849 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idZHWD8JWxMtHvJuLd5_prop7 {
some Protected
}
pred __repair { idZHWD8JWxMtHvJuLd5_prop7 }
check __repair { idZHWD8JWxMtHvJuLd5_prop7 <=> prop7o } |
data/mapObjects/seafoamislands5.asm | adhi-thirumala/EvoYellow | 16 | 244270 | <reponame>adhi-thirumala/EvoYellow
SeafoamIslands5Object:
db $7d ; border block
db $4 ; warps
db $11, $14, $5, SEAFOAM_ISLANDS_4
db $11, $15, $6, SEAFOAM_ISLANDS_4
db $7, $b, $1, SEAFOAM_ISLANDS_4
db $4, $19, $2, SEAFOAM_ISLANDS_4
db $2 ; signs
db $f, $9, $4 ; SeafoamIslands5Text4
db $1, $17, $5 ; SeafoamIslands5Text5
db $3 ; objects
object SPRITE_BOULDER, $4, $f, STAY, NONE, $1 ; person
object SPRITE_BOULDER, $5, $f, STAY, NONE, $2 ; person
object SPRITE_BIRD, $6, $1, STAY, DOWN, $3, ARTICUNO, 50
; warp-to
EVENT_DISP SEAFOAM_ISLANDS_5_WIDTH, $11, $14 ; SEAFOAM_ISLANDS_4
EVENT_DISP SEAFOAM_ISLANDS_5_WIDTH, $11, $15 ; SEAFOAM_ISLANDS_4
EVENT_DISP SEAFOAM_ISLANDS_5_WIDTH, $7, $b ; SEAFOAM_ISLANDS_4
EVENT_DISP SEAFOAM_ISLANDS_5_WIDTH, $4, $19 ; SEAFOAM_ISLANDS_4
|
README/Correct-by-Construction-Pretty-Printing.agda | nad/pretty | 0 | 6652 | <filename>README/Correct-by-Construction-Pretty-Printing.agda
------------------------------------------------------------------------
-- A README directed towards readers of the paper
-- "Correct-by-Construction Pretty-Printing"
--
-- <NAME>
------------------------------------------------------------------------
{-# OPTIONS --guardedness #-}
module README.Correct-by-Construction-Pretty-Printing where
------------------------------------------------------------------------
-- 2: Grammars
-- The basic grammar data type, including its semantics. Only a small
-- number of derived combinators is defined directly for this data
-- type. It is proved that an inductive version of this type would be
-- quite restrictive.
import Grammar.Infinite.Basic
-- The extended grammar data type mentioned in Section 4.3, along with
-- a semantics and lots of derived combinators. This type is proved to
-- be no more expressive than the previous one; but it is also proved
-- that every language that can be recursively enumerated can be
-- represented by a (unit-valued) grammar.
import Grammar.Infinite
------------------------------------------------------------------------
-- 3: Pretty-Printers
import Pretty
------------------------------------------------------------------------
-- 4: Examples
-- Reusable document combinators introduced in this section.
import Pretty
-- The symbol combinator and the heuristic procedure
-- trailing-whitespace.
import Grammar.Infinite
-- 4.1: Boolean literals.
import Examples.Bool
-- 4.2: Expressions, and 4.3: Expressions, Take Two.
import Examples.Expression
-- 4.4: Identifiers.
import Examples.Identifier
-- 4.5: Other Examples.
-- Some of these examples are not mentioned in the paper.
-- Another expression example based on one in Matsuda and Wang's
-- "FliPpr: A Prettier Invertible Printing System".
import Examples.Expression
-- An example based on one in Swierstra and Chitil's "Linear, bounded,
-- functional pretty-printing".
import Examples.Identifier-list
-- Two examples, both based on examples in Wadler's "A prettier
-- printer".
import Examples.Tree
import Examples.XML
-- The fill combinator.
import Pretty
-- A general grammar and pretty-printer for binary operators of
-- various (not necessarily linearly ordered) precedences.
import Examples.Precedence
------------------------------------------------------------------------
-- 5: Renderers
import Renderer
-- Unambiguous and Parser.
import Grammar.Infinite
|
programs/oeis/180/A180033.asm | neoneye/loda | 22 | 6903 | <reponame>neoneye/loda<filename>programs/oeis/180/A180033.asm
; A180033: Eight white queens and one red queen on a 3 X 3 chessboard. G.f.: (1 + x)/(1 - 5*x - 5*x^2).
; 1,6,35,205,1200,7025,41125,240750,1409375,8250625,48300000,282753125,1655265625,9690093750,56726796875,332084453125,1944056250000,11380703515625,66623798828125,390022511718750,2283231552734375,13366270322265625,78247509375000000,458068898486328125,2681582039306640625,15698254688964843750,91899183641357421875,537987191651611328125,3149431876464843750000,18437095340582275390625,107932636085235595703125,631848657129089355468750,3698906466071624755859375,21653775616003570556640625,126763410410375976562500000,742085930131897735595703125,4344246702711368560791015625,25431663164216331481933593750,148879549334638500213623046875,871556062494274158477783203125,5102178059144563293457031250000,29868670608194187259674072265625,174854243336693752765655517578125,1023614569724439700126647949218750,5992344065305667264461517333984375,35079793175150534822940826416015625,205360686202281010437011718750000000
add $0,2
seq $0,106565 ; Let M={{0, 5}, {1, 5}}, v[n]=M.v[n-1]; then a(n) =v[n][[1]].
div $0,25
|
Library/Spell/UI/uiManager.asm | steakknife/pcgeos | 504 | 166697 | <reponame>steakknife/pcgeos<filename>Library/Spell/UI/uiManager.asm
COMMENT @----------------------------------------------------------------------
Copyright (c) GeoWorks 1991 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Text Library
FILE: UI/uiManager.asm
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 7/91 Initial version
DESCRIPTION:
$Id: uiManager.asm,v 1.1 97/04/07 11:08:10 newdeal Exp $
------------------------------------------------------------------------------@
;------------------------------------------------------------------------------
; Common GEODE stuff
;------------------------------------------------------------------------------
include geos.def
;------------------------------------------------------------------------------
; FULL_EXECUTE_IN_PLACE : Indicates that the spell lib is going to
; be used in a system where all geodes (or most, at any rate)
; are to be executed out of ROM.
;------------------------------------------------------------------------------
ifndef FULL_EXECUTE_IN_PLACE
FULL_EXECUTE_IN_PLACE equ FALSE
endif
;------------------------------------------------------------------------------
; The .GP file only understands defined/not defined;
; it can not deal with expression evaluation.
; Thus, for the TRUE/FALSE conditionals, we define
; GP symbols that _only_ get defined when the
; condition is true.
;-----------------------------------------------------------------------------
if FULL_EXECUTE_IN_PLACE
GP_FULL_EXECUTE_IN_PLACE equ TRUE
endif
if FULL_EXECUTE_IN_PLACE
include Internal/xip.def
endif
include resource.def
include geode.def
include library.def
include ec.def
include heap.def
include file.def
include lmem.def
include gstring.def
include spellConstant.def
include initfile.def
include Internal/threadIn.def
UseLib ui.def
DefLib spell.def
DefLib Internal/spelllib.def
include uiConstant.def
;------------------------------------------------------------------------------
; Resource definitions
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
; Resources
;------------------------------------------------------------------------------
include uiManager.rdef
;------------------------------------------------------------------------------
; Code
;------------------------------------------------------------------------------
include uiSuggestList.asm
include uiSpell.asm
include uiEditUserDict.asm
include thesCtrl.asm
|
oeis/024/A024488.asm | neoneye/loda-programs | 11 | 28074 | ; A024488: a(n) = (1/(3n-1))*M(3n; n,n,n), where M(...) is a multinomial coefficient.
; Submitted by <NAME>
; 3,18,210,3150,54054,1009008,19953648,411543990,8764362750,191413682460,4266468608220,96706621786320,2223107844022800,51721284534408000,1215794995122150720,28837137540553512390
mov $1,$0
add $1,$0
add $1,1
mov $2,$0
add $2,$1
bin $1,$0
mul $0,2
bin $2,$0
add $0,1
div $1,$0
mul $1,$2
mov $0,$1
mul $0,3
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1251.asm | ljhsiun2/medusa | 9 | 6657 | <filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1251.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x16d0b, %rsi
lea addresses_A_ht+0x6d1b, %rdi
clflush (%rsi)
nop
nop
nop
add $39667, %r10
mov $42, %rcx
rep movsq
nop
xor $20036, %rax
lea addresses_D_ht+0xa41d, %rbp
nop
nop
nop
nop
xor %r8, %r8
mov (%rbp), %di
nop
dec %rax
lea addresses_D_ht+0x1330b, %rcx
nop
nop
nop
and $65365, %rsi
mov $0x6162636465666768, %rax
movq %rax, %xmm2
and $0xffffffffffffffc0, %rcx
movntdq %xmm2, (%rcx)
nop
nop
dec %r10
lea addresses_WT_ht+0x1c63b, %rsi
lea addresses_A_ht+0x210b, %rdi
clflush (%rsi)
nop
nop
inc %r8
mov $120, %rcx
rep movsl
nop
nop
inc %r8
lea addresses_WT_ht+0x989b, %rsi
lea addresses_D_ht+0xef7b, %rdi
dec %r13
mov $123, %rcx
rep movsl
nop
nop
nop
nop
and %r13, %r13
lea addresses_normal_ht+0x895b, %r13
nop
nop
nop
xor %rcx, %rcx
mov (%r13), %r10
nop
nop
dec %rcx
lea addresses_normal_ht+0x171ab, %rsi
lea addresses_A_ht+0x1e11b, %rdi
nop
nop
nop
nop
dec %r13
mov $107, %rcx
rep movsq
nop
cmp %r8, %r8
lea addresses_UC_ht+0xa10b, %rsi
lea addresses_A_ht+0x4d8b, %rdi
nop
add $41188, %r8
mov $65, %rcx
rep movsw
nop
nop
sub $11642, %r10
lea addresses_WT_ht+0x230b, %rsi
add %rcx, %rcx
movb (%rsi), %al
nop
nop
nop
nop
nop
and %rax, %rax
lea addresses_A_ht+0x6d0b, %r10
nop
nop
nop
sub %rsi, %rsi
mov (%r10), %eax
cmp %rcx, %rcx
lea addresses_A_ht+0x18f0b, %rdi
and %rcx, %rcx
movb $0x61, (%rdi)
nop
nop
nop
add %r13, %r13
lea addresses_normal_ht+0x18c7, %rcx
nop
inc %rax
movb (%rcx), %r13b
nop
add %rdi, %rdi
lea addresses_A_ht+0x1e80b, %rax
nop
nop
nop
nop
dec %rdi
mov $0x6162636465666768, %rbp
movq %rbp, (%rax)
nop
nop
nop
nop
nop
xor $35306, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
// Store
lea addresses_UC+0x11233, %r15
nop
nop
nop
nop
inc %rdi
movb $0x51, (%r15)
cmp %rdi, %rdi
// Faulty Load
lea addresses_D+0x11d0b, %rdi
nop
nop
nop
nop
nop
add $15665, %rbp
mov (%rdi), %rbx
lea oracles, %rdi
and $0xff, %rbx
shlq $12, %rbx
mov (%rdi,%rbx,1), %rbx
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 9, 'size': 16, 'same': False, 'NT': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': True}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 6, 'size': 8, 'same': False, 'NT': False}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_end3.asm | prismotizm/gigaleak | 0 | 243355 | <filename>other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_end3.asm
Name: zel_end3.asm
Type: file
Size: 14545
Last-Modified: '2016-05-13T04:25:37Z'
SHA-1: F10EA18AB034AB6A46CA7EA0B430C658AFF2947C
Description: null
|
src/statements/adabase-statement-base-postgresql.ads | jrmarino/AdaBase | 30 | 16950 | -- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../../License.txt
with Ada.Containers;
with AdaBase.Connection.Base.PostgreSQL;
with AdaBase.Bindings.PostgreSQL;
package AdaBase.Statement.Base.PostgreSQL is
package BND renames AdaBase.Bindings.PostgreSQL;
package CON renames AdaBase.Connection.Base.PostgreSQL;
package AC renames Ada.Containers;
type PostgreSQL_statement
(type_of_statement : Stmt_Type;
log_handler : ALF.LogFacility_access;
pgsql_conn : CON.PostgreSQL_Connection_Access;
identifier : Trax_ID;
initial_sql : SQL_Access;
next_calls : SQL_Access;
con_error_mode : Error_Modes;
con_case_mode : Case_Modes;
con_max_blob : BLOB_Maximum;
con_buffered : Boolean)
is new Base_Statement and AIS.iStatement with private;
type PostgreSQL_statement_access is access all PostgreSQL_statement;
overriding
function column_count (Stmt : PostgreSQL_statement) return Natural;
overriding
function last_insert_id (Stmt : PostgreSQL_statement) return Trax_ID;
overriding
function last_sql_state (Stmt : PostgreSQL_statement) return SQL_State;
overriding
function last_driver_code (Stmt : PostgreSQL_statement) return Driver_Codes;
overriding
function last_driver_message (Stmt : PostgreSQL_statement) return String;
overriding
procedure discard_rest (Stmt : out PostgreSQL_statement);
overriding
function execute (Stmt : out PostgreSQL_statement) return Boolean;
overriding
function execute (Stmt : out PostgreSQL_statement; parameters : String;
delimiter : Character := '|') return Boolean;
overriding
function rows_returned (Stmt : PostgreSQL_statement) return Affected_Rows;
overriding
function column_name (Stmt : PostgreSQL_statement; index : Positive)
return String;
overriding
function column_table (Stmt : PostgreSQL_statement; index : Positive)
return String;
overriding
function column_native_type (Stmt : PostgreSQL_statement; index : Positive)
return field_types;
overriding
function fetch_next (Stmt : out PostgreSQL_statement) return ARS.Datarow;
overriding
function fetch_all (Stmt : out PostgreSQL_statement)
return ARS.Datarow_Set;
overriding
function fetch_bound (Stmt : out PostgreSQL_statement) return Boolean;
overriding
procedure fetch_next_set (Stmt : out PostgreSQL_statement;
data_present : out Boolean;
data_fetched : out Boolean);
function returned_refcursors (Stmt : PostgreSQL_statement)
return Boolean;
POSTGIS_READ_ERROR : exception;
private
type column_info is record
table : CT.Text;
field_name : CT.Text;
field_type : field_types;
field_size : Natural;
binary_format : Boolean;
end record;
type string_box is record
payload : CT.Text;
end record;
package VRefcursors is new Ada.Containers.Vectors (Natural, string_box);
package VColumns is new AC.Vectors (Positive, column_info);
type PostgreSQL_statement
(type_of_statement : Stmt_Type;
log_handler : ALF.LogFacility_access;
pgsql_conn : CON.PostgreSQL_Connection_Access;
identifier : Trax_ID;
initial_sql : SQL_Access;
next_calls : SQL_Access;
con_error_mode : Error_Modes;
con_case_mode : Case_Modes;
con_max_blob : BLOB_Maximum;
con_buffered : Boolean)
is new Base_Statement and AIS.iStatement with
record
result_handle : aliased BND.PGresult_Access := null;
prepared_stmt : aliased BND.PGresult_Access := null;
stmt_allocated : Boolean := False;
insert_prepsql : Boolean := False;
insert_return : Boolean := False;
assign_counter : Natural := 0;
num_columns : Natural := 0;
size_of_rowset : Trax_ID := 0;
result_arrow : Trax_ID := 0;
last_inserted : Trax_ID := 0;
column_info : VColumns.Vector;
refcursors : VRefcursors.Vector;
sql_final : SQL_Access;
end record;
procedure log_problem
(statement : PostgreSQL_statement;
category : Log_Category;
message : String;
pull_codes : Boolean := False;
break : Boolean := False);
procedure initialize (Object : in out PostgreSQL_statement);
procedure Adjust (Object : in out PostgreSQL_statement);
procedure finalize (Object : in out PostgreSQL_statement);
function reformat_markers (parameterized_sql : String) return String;
procedure scan_column_information (Stmt : out PostgreSQL_statement;
pgresult : BND.PGresult_Access);
function assemble_datarow (Stmt : out PostgreSQL_statement;
row_number : Trax_ID) return ARS.Datarow;
function show_statement_name (Stmt : PostgreSQL_statement) return String;
function bind_text_value (Stmt : PostgreSQL_statement; marker : Positive)
return AR.Textual;
function pop_result_set_reference (Stmt : out PostgreSQL_statement)
return String;
procedure push_result_references (Stmt : out PostgreSQL_statement;
calls : String);
function postgis_to_WKB (postgis : String) return String;
end AdaBase.Statement.Base.PostgreSQL;
|
disorderly/xor_shift.adb | jscparker/math_packages | 30 | 25580 | <filename>disorderly/xor_shift.adb
-------------------------------------------------------------------------------
-- package body Xor_Shift, xor shift generator
-- Copyright (C) 2018 <NAME>
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-------------------------------------------------------------------------------
package body Xor_Shift
with Spark_Mode => On
is
-- Marsaglia's XOR-SHIFT generator mixes bits by the following recipe:
--
-- S2 := (S2 XOR (S2 * 2**20))mod 2**61; (a shift-left-by-20 step)
-- S2 := S2 XOR (S2 / 2**32); (a shift-right-by-32 step)
--
-- Below are some shifts that produce full period generators on 1 .. 2**61-1.
-- 2**61-1 is a Mersenne prime. The following are the best full period
-- shifts I could find (based on scores from the avalanche test).
--
-- best 8's: 1 3 6 13 21 29 31 12 57 59 2
-- 1 3 7 15 30 32 20 6 56 58 2 (preferred)
-- 1 3 7 16 21 30 26 6 55 55 0
-- 1 3 9 16 21 23 23 1 43 54 11 (looks promising)
-- 1 3 12 18 23 25 29 15 61 65 4
-- 1 3 13 24 31 35 8 1 63 53 10
--
-----------------------------
-- Get_Random_XOR_Shift_61 --
-----------------------------
procedure Get_Random_XOR_Shift_61 (Random_x : in out Parent_Random_Int) is
X2 : Parent_Random_Int := Random_x;
S8 : constant := 6; S7 : constant := 20; S6 : constant := 32;
S5 : constant := 30; S4 : constant := 15; S3 : constant := 7;
S2 : constant := 3; S1 : constant := 1;
pragma Assert
(S8=6 and S7=20 and S6=32 and S5=30 and S4=15 and S3=7 and S2=3 and S1=1);
-- if mutated parameters are detected, use the following for error correction.
-- 1 3 7 15 30 32 20 6
-- 1 3 7 15 30 32 20 6
begin
X2 := X2 XOR (X2 / 2**S8);
X2 := (X2 XOR (X2 * 2**S7)) mod 2**61;
X2 := X2 XOR (X2 / 2**S6);
X2 := (X2 XOR (X2 * 2**S5)) mod 2**61;
X2 := X2 XOR (X2 / 2**S4);
X2 := (X2 XOR (X2 * 2**S3)) mod 2**61;
X2 := X2 XOR (X2 / 2**S2);
X2 := (X2 XOR (X2 * 2**S1)) mod 2**61;
Random_x := X2;
end Get_Random_XOR_Shift_61;
procedure Get_Random_XOR_Shift_61_b (Random_x : in out Parent_Random_Int) is
X2 : Parent_Random_Int := Random_x;
S8 : constant := 15; S7 : constant := 29; S6 : constant := 25;
S5 : constant := 23; S4 : constant := 18; S3 : constant := 12;
S2 : constant := 3; S1 : constant := 1;
pragma Assert
(S8=15 and S7=29 and S6=25 and S5=23 and S4=18 and S3=12 and S2=3 and S1=1);
-- if mutated parameters are detected, use the following for error correction.
-- 1 3 12 18 23 25 29 15
-- 1 3 12 18 23 25 29 15
begin
X2 := X2 XOR (X2 / 2**S8);
X2 := (X2 XOR (X2 * 2**S7)) mod 2**61;
X2 := X2 XOR (X2 / 2**S6);
X2 := (X2 XOR (X2 * 2**S5)) mod 2**61;
X2 := X2 XOR (X2 / 2**S4);
X2 := (X2 XOR (X2 * 2**S3)) mod 2**61;
X2 := X2 XOR (X2 / 2**S2);
X2 := (X2 XOR (X2 * 2**S1)) mod 2**61;
Random_x := X2;
end Get_Random_XOR_Shift_61_b;
end Xor_Shift;
|
Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca.log_21829_864.asm | ljhsiun2/medusa | 9 | 170143 | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x129b2, %rsi
lea addresses_normal_ht+0x119f4, %rdi
nop
sub $25220, %r15
mov $17, %rcx
rep movsb
add %rdi, %rdi
lea addresses_WT_ht+0x156d6, %rbx
clflush (%rbx)
xor %r14, %r14
movl $0x61626364, (%rbx)
nop
nop
nop
inc %rbx
lea addresses_D_ht+0x21b2, %rcx
nop
nop
nop
nop
nop
cmp %r14, %r14
mov (%rcx), %di
nop
xor %rbx, %rbx
lea addresses_WC_ht+0x51b2, %rdi
clflush (%rdi)
nop
dec %rcx
and $0xffffffffffffffc0, %rdi
movntdqa (%rdi), %xmm3
vpextrq $0, %xmm3, %rax
nop
nop
nop
add %rdi, %rdi
lea addresses_WT_ht+0xf5f2, %rdi
nop
nop
nop
nop
inc %rsi
movb $0x61, (%rdi)
nop
nop
nop
nop
and $4578, %r15
lea addresses_D_ht+0x46df, %r14
clflush (%r14)
nop
nop
nop
xor $5792, %rax
movups (%r14), %xmm4
vpextrq $1, %xmm4, %rbx
nop
nop
nop
nop
xor %rbx, %rbx
lea addresses_WT_ht+0x10662, %rdi
nop
cmp $63845, %rbx
movups (%rdi), %xmm7
vpextrq $0, %xmm7, %rsi
nop
nop
cmp %rax, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %rax
push %rbp
push %rbx
push %rdi
// Faulty Load
lea addresses_US+0xc9b2, %rbp
nop
nop
nop
sub $53957, %rdi
mov (%rbp), %r12d
lea oracles, %rax
and $0xff, %r12
shlq $12, %r12
mov (%rax,%r12,1), %r12
pop %rdi
pop %rbx
pop %rbp
pop %rax
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 32, 'NT': True, 'type': 'addresses_US'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 11, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 16, 'NT': True, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT_ht'}, '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
*/
|
src/error_reporter.adb | aeszter/lox-spark | 6 | 26337 | package body Error_Reporter with SPARK_Mode,
Refined_State => (State => My_Error)
is
package IO renames SPARK.Text_IO;
procedure Clear_Error is
begin
My_Error := False;
end Clear_Error;
procedure Error (Line_No : Positive; Message : String) is
begin
Report (Line_No => Line_No,
Where => "",
Message => Message);
end Error;
function Had_Error return Boolean with
Refined_Post => Had_Error'Result = My_Error
is
begin
return My_Error;
end Had_Error;
procedure Report (Line_No : Positive; Where, Message : String) with
Refined_Post => My_Error
is
Line_Header : constant String (1 .. 5) := "[line";
Line_Number : constant String := Integer'Image (Line_No);
Error_Infix : constant String := "] Error";
Message_Separator : constant String := ": ";
begin
pragma Assume (Line_Number'Length <= 10, "because of the limited range of type Integer");
if Status (Standard_Error) = Success and then Is_Writable (Standard_Error) then
IO.Put_Line (Standard_Error,
Line_Header & Line_Number & Error_Infix & Where
& Message_Separator & Message);
end if;
-- why is this here rather than in procedure Error?
-- it is not part of the report, after all, and we could put the Status/Writable
-- check inside Error, around the call to Report
My_Error := True;
end Report;
end Error_Reporter;
|
programs/oeis/028/A028392.asm | karttu/loda | 0 | 84967 | <filename>programs/oeis/028/A028392.asm
; A028392: a(n) = n + floor(sqrt(n)).
; 0,2,3,4,6,7,8,9,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,30,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,47,48,49,50,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264
mov $1,$0
lpb $0,1
sub $0,1
add $2,2
trn $0,$2
add $1,1
lpe
|
tools-src/gnu/gcc/gcc/ada/exp_ch3.ads | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 8080 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ C H 3 --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Expand routines for chapter 3 constructs
with Types; use Types;
with Elists; use Elists;
package Exp_Ch3 is
procedure Expand_N_Object_Declaration (N : Node_Id);
procedure Expand_N_Subtype_Indication (N : Node_Id);
procedure Expand_N_Variant_Part (N : Node_Id);
procedure Expand_N_Full_Type_Declaration (N : Node_Id);
procedure Expand_Previous_Access_Type (N : Node_Id; Def_Id : Entity_Id);
-- For a full type declaration that contains tasks, or that is a task,
-- check whether there exists an access type whose designated type is an
-- incomplete declarations for the current composite type. If so, build
-- the master for that access type, now that it is known to denote an
-- object with tasks.
procedure Expand_Derived_Record (T : Entity_Id; Def : Node_Id);
-- Add a field _parent in the extension part of the record.
procedure Build_Discr_Checking_Funcs (N : Node_Id);
-- Builds function which checks whether the component name is consistent
-- with the current discriminants. N is the full type declaration node,
-- and the discriminant checking functions are inserted after this node.
function Build_Initialization_Call
(Loc : Source_Ptr;
Id_Ref : Node_Id;
Typ : Entity_Id;
In_Init_Proc : Boolean := False;
Enclos_Type : Entity_Id := Empty;
Discr_Map : Elist_Id := New_Elmt_List)
return List_Id;
-- Builds a call to the initialization procedure of the Id entity. Id_Ref
-- is either a new reference to Id (for record fields), or an indexed
-- component (for array elements). Loc is the source location for the
-- constructed tree, and Typ is the type of the entity (the initialization
-- procedure of the base type is the procedure that actually gets called).
-- In_Init_Proc has to be set to True when the call is itself in an Init
-- procedure in order to enable the use of discriminals. Enclos_type is
-- the type of the init_proc and it is used for various expansion cases
-- including the case where Typ is a task type which is a array component,
-- the indices of the enclosing type are used to build the string that
-- identifies each task at runtime.
--
-- Discr_Map is used to replace discriminants by their discriminals in
-- expressions used to constrain record components. In the presence of
-- entry families bounded by discriminants, protected type discriminants
-- can appear within expressions in array bounds (not as stand-alone
-- identifiers) and a general replacement is necessary.
procedure Freeze_Type (N : Node_Id);
-- This procedure executes the freezing actions associated with the given
-- freeze type node N.
function Needs_Simple_Initialization (T : Entity_Id) return Boolean;
-- Certain types need initialization even though there is no specific
-- initialization routine. In this category are access types (which
-- need initializing to null), packed array types whose implementation
-- is a modular type, and all scalar types if Normalize_Scalars is set,
-- as well as private types whose underlying type is present and meets
-- any of these criteria. Finally, descendants of String and Wide_String
-- also need initialization in Initialize/Normalize_Scalars mode.
function Get_Simple_Init_Val
(T : Entity_Id;
Loc : Source_Ptr)
return Node_Id;
-- For a type which Needs_Simple_Initialization (see above), prepares
-- the tree for an expression representing the required initial value.
-- Loc is the source location used in constructing this tree which is
-- returned as the result of the call.
end Exp_Ch3;
|
models/tests/test67b.als | transclosure/Amalgam | 4 | 304 | module tests/test // Problem reported by <NAME>
sig Time{}
sig Location{}
sig User{}
sig Role{
RoleAllocLoc: Location,
RoleAllocDur: Time,
RoleEnableLoc: Location,
RoleEnableDur: Time}
sig Permission{}
sig Object{}
sig Session{}
sig sType{}
one sig RoleEnable {member : Role-> Time ->Location}
one sig RolePermissionAssignment{member : Role-> Permission ->Time->Location}
one sig UserLocation{member : User->Time->Location}
one sig ObjLocation{member : Object->Time->Location}
one sig UserRoleAssignment{member : User-> Role->Time->Location}
one sig UserRoleActivate{member : User-> Role->Time->Location}
one sig RoleHierarchy{RHmember : Role -> Role}
one sig SessionType{member : Session->sType}
one sig SessionLoc{member : sType->Location}
one sig SessionUser{member : Session-> one User ->Time}
one sig SessionRole{member : Session->Role->Time->Location}
one sig PermRoleLoc{member : Permission->Role->Location}
one sig PermDur{member : Permission->Time}
one sig PermRoleAcquire{member : Permission -> Role ->Time ->Location}
fact ULoc{
all u: User, uloc: UserLocation, d: Time, l1, l2: Location |
(((u->d->l1) in uloc.member) && ((u->d->l2) in uloc.member)) <=>
((l1 in l2) || (l2 in l1))}
fact ObjLoc{
all o: Object, oloc: ObjLocation, d: Time, l1, l2: Location |
(((o->d->l1) in oloc.member) && ((o->d->l2) in oloc.member)) <=>
((l1 in l2) || (l2 in l1))}
fact URAssign{
all u: User, r: Role, d: Time, l: Location, ura: UserRoleAssignment, uloc: UserLocation |
((u->r->d->l) in ura.member) => (((u->d->l) in uloc.member) &&
(l in r.RoleAllocLoc) && (d in r.RoleAllocDur))}
fact URActivate{
all u: User, r: Role, d: Time, l: Location, uras: UserRoleAssignment, urac: UserRoleActivate |
((u->r->d->l) in urac.member) => (((u->r->d->l) in uras.member) &&
(l in r.RoleEnableLoc) && (d in r.RoleEnableDur))}
fact NocycleRH{
all r: Role, RH: RoleHierarchy| r !in r.^(RH.RHmember)}
//Every Session has an owner
fact NoIdleSession{
all s: Session | some u: User, d : Time, su : SessionUser |
s->u->d in su.member
}
fact SessionUserFact{
all s: Session, u: User, d: Time, su: SessionUser, ul: UserLocation,
sl : SessionLoc, st : SessionType |
(s->u->d in su.member) => ((ul.member[u])[d] in sl.member[st.member[s]])
}
//Session Role relationship must has its owner (Session User)
fact SessionRoleFact1{
all s: Session | some u: User, r: Role, d: Time, l: Location, sr: SessionRole,
su : SessionUser |
(s->r->d->l in sr.member) =>
(s->u->d in su.member)
}
fact SessionRoleFact2{
all s: Session| some u: User, r: Role, d: Time, l: Location, sr: SessionRole,
su: SessionUser, sl : SessionLoc, st : SessionType |
((s->r->d->l in sr.member) && (s->u->d in su.member)) =>
((u->r->d->l in UserRoleActivate.member) && (l in sl.member[st.member[s]]))
}
fact PermRoleAcquireFact{
all p: Permission, r: Role, d: Time, l: Location, pra: PermRoleAcquire,
prl : PermRoleLoc, pd : PermDur |
(p->r->d->l in pra.member) => ((l in ((prl.member[p])[r] & r.RoleEnableLoc)) &&
(d in (pd.member[p] & r.RoleEnableDur)))
}
// Functions
//Unrestricted Permission Inheritance Hierarchy
fun UPIHPermAcquire(sr: Role): RolePermissionAssignment.member{
(sr->(sr.(RoleHierarchy.RHmember)).(RolePermissionAssignment.member).Location.Time->sr.RoleEnableDur->sr.RoleEnableLoc) ++
(sr <: RolePermissionAssignment.member)}
// Predicates
//Weak Form of SSoD-User Role Assignment
pred W_SSoD_URA(u: User, disj r1, r2: Role, ura: UserRoleAssignment.member, d: Time, l: Location){
((u->r1->d->l) in ura) => ((u->r2->d->l) not in ura)}
// Conflicts with the Weak Form of SSOD-User Role Assignment: Condition 1
assert TestConflict1_1{
all u: User, x, y: Role, RH: RoleHierarchy, d: Time, l: Location,
ura: UserRoleAssignment |
((x -> y in RH.RHmember) && (u->x->d->l in ura.member)) =>
W_SSoD_URA[u, x, y, u->(x+y)->d->l, d, l]
}
check TestConflict1_1 expect 1
|
scripts/printBadge.applescript | LosAltosHacks/checkin-booth-2019 | 3 | 4457 | <reponame>LosAltosHacks/checkin-booth-2019
on run argv
if (count of argv) < 2 or (count of argv) > 3 then
return "Usage: osascript printBadge.applescript firstName lastName [qrData]"
else if (count of argv) = 2 then
printPlainBadge(argv)
else
printQRBadge(argv)
end if
end run
to printQRBadge({firstName, lastName, qrData})
tell application "DYMO Label"
openLabel in POSIX path of ((path to me as text) & "::qrBadge.label")
set content of print object "firstName" to firstName
set content of print object "lastName" to lastName
set barcodeText of print object "qrCode" to qrData
printLabel
end tell
end printQRBadge
to printPlainBadge({firstName, lastName})
tell application "DYMO Label"
openLabel in POSIX path of ((path to me as text) & "::plainBadge.label")
set content of print object "firstName" to firstName
set content of print object "lastName" to lastName
printLabel
end tell
end printPlainBadge |
library/fmGUI_ObjManipulation/fmGUI_PopupSet.applescript | NYHTC/applescript-fm-helper | 1 | 2477 | -- fmGUI_PopupSet({objRef:null, objValue:null})
-- <NAME>
-- Wrapper method for fmGUI_Popup_SelectByCommand that requires only an object and a choice
(*
REQUIRES:
fmGUI_Popup_SelectByCommand
HISTORY:
1.1 - 2017-07-06 ( eshagdar ): narrowed scope
1.0 - created
*)
on run
tell application "System Events"
tell application process "FileMaker Pro Advanced"
set frontmost to true
--set TablePopupOnFieldTabOfManageDatabase to (pop up button "Table:" of tab group 1 of window 1)
set popUpButtonRef to pop up button "Available menu commands:" of window 1
end tell
end tell
fmGUI_PopupSet({objRef:popUpButtonRef, objValue:"Minimum"})
end run
--------------------
-- START OF CODE
--------------------
on fmGUI_PopupSet(prefs)
-- version 1.1
set defaultPrefs to {objRef:null, objValue:null}
set prefs to prefs & defaultPrefs
set objRef to ensureObjectRef(objRef of prefs)
try
return fmGUI_Popup_SelectByCommand(prefs & {selectCommand:"contains"})
on error errMsg number errNum
error "Unable to fmGUI_PopupSet ( couldn't select '" & objValue of prefs & "' in popup ) - " & errMsg number errNum
end try
end fmGUI_PopupSet
--------------------
-- END OF CODE
--------------------
on fmGUI_Popup_SelectByCommand(prefs)
set objRefStr to coerceToString(objRef of prefs)
tell application "htcLib" to fmGUI_Popup_SelectByCommand({objRef:objRefStr} & prefs)
end fmGUI_Popup_SelectByCommand
on coerceToString(incomingObject)
-- 2017-07-12 ( eshagdar ): bootstrap code to bring a coerceToString into this file for the sample to run ( instead of having a copy of the handler locally ).
tell application "Finder" to set coercePath to (container of (container of (path to me)) as text) & "text parsing:coerceToString.applescript"
set codeCoerce to read file coercePath as text
tell application "htcLib" to set codeCoerce to "script codeCoerce " & return & getTextBetween({sourceText:codeCoerce, beforeText:"-- START OF CODE", afterText:"-- END OF CODE"}) & return & "end script" & return & "return codeCoerce"
set codeCoerce to run script codeCoerce
tell codeCoerce to coerceToString(incomingObject)
end coerceToString
on ensureObjectRef(someObjectRef)
-- 2017-07-12 ( eshagdar ): bootstrap code to bring a ensureObjectRef into this file for the sample to run ( instead of having a copy of the handler locally ).
tell application "Finder" to set ensureObjPath to (container of (container of (path to me)) as text) & "text parsing:ensureObjectRef.applescript"
set codeEnsureObj to read file ensureObjPath as text
tell application "htcLib" to set codeEnsureObj to "script codeEnsureObj " & return & getTextBetween({sourceText:codeEnsureObj, beforeText:"-- START OF CODE", afterText:"-- END OF CODE"}) & return & "end script" & return & "return codeEnsureObj"
set codeEnsureObj to run script codeEnsureObj
tell codeEnsureObj to ensureObjectRef(someObjectRef)
end ensureObjectRef
|
data/wild/maps/Route22.asm | opiter09/ASM-Machina | 1 | 170735 | <reponame>opiter09/ASM-Machina<filename>data/wild/maps/Route22.asm
Route22WildMons:
def_grass_wildmons 25 ; encounter rate
db 5, WEEDLE
db 5, CATERPIE
db 5, VENONAT
db 6, RATTATA
db 6, PIDGEY
db 6, WEEDLE
db 7, EKANS
db 5, LICKITUNG
db 7, KAKUNA
db 7, METAPOD
end_grass_wildmons
def_water_wildmons 0 ; encounter rate
end_water_wildmons
|
grammar/src/commonAntlr/antlr/PlankParser.g4 | plank-lang/plank | 10 | 7073 | parser grammar PlankParser;
options {tokenVocab=PlankLexer;}
// file
fileModule: MODULE path=qualifiedPath SEMICOLON;
plankFile: fileModule? decl* EOF;
// utils
semis: (EOF | SEMICOLON | NEWLINE) ws;
ws: (EOF | SEMICOLON | NEWLINE | WS)*;
// types
typeReference: path=qualifiedPath # AccessTypeRef
| LPAREN RPAREN (typeReference (COMMA typeReference)*)? ARROW_LEFT returnType=typeReference # FunctionTypeRef
| LBRACKET type=typeReference RBRACKET # ArrayTypeRef
| TIMES type=typeReference # PointerTypeRef
;
parameter: name=IDENTIFIER COLON type=typeReference;
// types
property: MUTABLE? parameter;
// enums
enumMember: name=IDENTIFIER (LPAREN (typeReference (COMMA typeReference))? RPAREN)?;
// decls
decl: TYPE name=IDENTIFIER EQUAL (LBRACE (property (COMMA property)*)? RBRACE) semis # StructDecl
| TYPE name=IDENTIFIER EQUAL (BAR enumMember)* semis # EnumDecl
| MODULE path=qualifiedPath LBRACE decl* RBRACE semis # ModuleDecl
| IMPORT path=qualifiedPath semis # ImportDecl
| functionModifier* FUN name=IDENTIFIER LPAREN (parameter (COMMA parameter)*)? RPAREN functionReturn? functionBody? semis # FunDecl
| LET MUTABLE? name=IDENTIFIER EQUAL value=expr semis # InferLetDecl
| LET MUTABLE? name=IDENTIFIER COLON type=typeReference EQUAL value=expr semis # DefinedLetDecl
;
qualifiedPath: IDENTIFIER (DOT IDENTIFIER)*;
functionReturn: COLON returnType=typeReference;
functionModifier: NATIVE;
functionBody: LBRACE stmt* RBRACE;
// stmts
stmt: decl # DeclStmt
| value=expr semis # ExprStmt
| RETURN value=expr? semis # ReturnStmt
;
// patterns
pattern: type=qualifiedPath LPAREN (pattern (COMMA pattern)*)? RPAREN # NamedTuplePattern
| name=IDENTIFIER # IdentPattern;
// exprs
expr: assignExpr # AssignExprProvider
| IF LPAREN cond=expr RPAREN thenBranch=expr elseBranch? # IfExpr
| type=typeReference LBRACE (instanceArgument (COMMA instanceArgument))* RBRACE # InstanceExpr
| SIZEOF type=typeReference # SizeofExpr
| MATCH subject=expr LBRACE (matchPattern (COMMA matchPattern))? RBRACE # MatchExpr
;
matchPattern: pattern DOUBLE_ARROW_LEFT value=expr;
instanceArgument: name=IDENTIFIER COLON value=expr;
elseBranch: ELSE value=expr;
assignExpr: (callExpr DOT)? name=IDENTIFIER ASSIGN value=assignExpr # AssignExprHolder
| value=logicalExpr # AssignValueHolder
;
logicalExpr: lhs=logicalExpr op=(EQ | NEQ) rhs=logicalExpr # LogicalExprHolder
| lhs=logicalExpr op=(GT | GTE | LT | LTE) rhs=logicalExpr # LogicalExprHolder
| value=binaryExpr # LogicalValueHolder
;
binaryExpr : lhs=binaryExpr op=(TIMES | DIV) rhs=binaryExpr # BinaryExprHolder
| lhs=binaryExpr op=(ADD | CONCAT | SUB) rhs=binaryExpr # BinaryExprHolder
| value=unaryExpr # BinaryValueHolder
;
unaryExpr : op=(BANG | SUB) rhs=unaryExpr # UnaryExprHolder
| value=callExpr # UnaryValueHolder
;
argumentFragment: LPAREN (expr (COMMA expr)*)? RPAREN # CallArgument
| DOT IDENTIFIER # GetArgument
;
callExpr: callee=reference argumentFragment*;
reference: AMPERSTAND value=expr # RefExpr
| TIMES value=expr # DerefExpr
| primary # ConstExpr
;
primary: INT # IntPrimary
| DECIMAL # DecimalPrimary
| STRING # StringPrimary
| IDENTIFIER # IdentifierPrimary
| (TRUE | FALSE) # BooleanPrimary
| (LPAREN value=expr RPAREN) # GroupPrimary
;
|
Transynther/x86/_processed/US/_ht_st_zr_un_/i9-9900K_12_0xa0_notsx.log_21571_1463.asm | ljhsiun2/medusa | 9 | 240731 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x13063, %r10
nop
nop
nop
sub %rdi, %rdi
mov (%r10), %edx
nop
nop
sub %r13, %r13
lea addresses_A_ht+0xb8c3, %r12
nop
nop
nop
nop
nop
sub %r9, %r9
mov (%r12), %r13d
xor $11058, %r10
lea addresses_UC_ht+0x3663, %rsi
lea addresses_A_ht+0x102f3, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
and $32806, %r9
mov $41, %rcx
rep movsb
nop
nop
nop
nop
dec %r9
lea addresses_A_ht+0x1bae3, %rsi
lea addresses_WC_ht+0x39bb, %rdi
nop
nop
sub $13477, %r9
mov $118, %rcx
rep movsq
nop
nop
cmp %rdx, %rdx
lea addresses_WC_ht+0x1d6e3, %rsi
nop
dec %rdx
mov (%rsi), %r9d
nop
nop
sub $62598, %rsi
lea addresses_WT_ht+0x74e3, %rsi
nop
nop
nop
nop
inc %r12
mov $0x6162636465666768, %r9
movq %r9, %xmm2
movups %xmm2, (%rsi)
nop
nop
nop
nop
add %r13, %r13
lea addresses_A_ht+0xce63, %rsi
lea addresses_D_ht+0x4143, %rdi
nop
nop
nop
cmp %rdx, %rdx
mov $118, %rcx
rep movsw
nop
cmp $50549, %r12
lea addresses_WC_ht+0x164d3, %rsi
lea addresses_normal_ht+0x1aae3, %rdi
nop
nop
xor $8372, %r13
mov $9, %rcx
rep movsq
nop
nop
nop
nop
dec %r9
lea addresses_UC_ht+0x3c23, %rcx
nop
nop
nop
nop
and %r10, %r10
mov (%rcx), %si
nop
nop
nop
and %rsi, %rsi
lea addresses_D_ht+0x11887, %r13
sub $46340, %rcx
mov (%r13), %r12
nop
nop
nop
nop
nop
inc %rcx
lea addresses_normal_ht+0x1971b, %rsi
lea addresses_D_ht+0x181a3, %rdi
nop
nop
nop
nop
nop
and $60856, %r10
mov $43, %rcx
rep movsl
nop
nop
nop
nop
nop
inc %r12
lea addresses_UC_ht+0x4ae3, %r10
nop
nop
cmp %r13, %r13
movb (%r10), %dl
nop
nop
sub $25821, %r12
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r15
push %rbp
push %rbx
push %rsi
// Store
lea addresses_UC+0xc5c3, %r12
xor %rbp, %rbp
movb $0x51, (%r12)
nop
nop
nop
inc %rsi
// Store
lea addresses_US+0x503, %rbx
nop
nop
nop
nop
nop
xor %r15, %r15
mov $0x5152535455565758, %rsi
movq %rsi, %xmm3
movntdq %xmm3, (%rbx)
nop
nop
nop
nop
nop
xor $1576, %r10
// Faulty Load
lea addresses_US+0x1aae3, %r12
nop
nop
nop
dec %r10
movups (%r12), %xmm5
vpextrq $1, %xmm5, %r15
lea oracles, %r12
and $0xff, %r15
shlq $12, %r15
mov (%r12,%r15,1), %r15
pop %rsi
pop %rbx
pop %rbp
pop %r15
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_US', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'size': 16, 'NT': True, 'same': False, 'congruent': 4}}
[Faulty Load]
{'src': {'type': 'addresses_US', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'AVXalign': True, 'size': 4, 'NT': True, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 10}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 6}}
{'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': True}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': True}}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 10}, 'OP': 'LOAD'}
{'08': 3, 'e8': 1, '48': 2442, '44': 13090, '45': 5853, 'b7': 1, '75': 3, '56': 2, '00': 176}
00 44 45 44 45 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 45 44 44 44 45 44 48 44 45 44 45 44 44 44 48 44 44 48 44 44 44 44 44 44 44 45 44 45 44 44 44 48 45 44 44 44 44 48 44 44 45 48 44 45 45 44 44 45 44 00 44 45 44 44 48 44 44 48 44 44 44 45 45 44 44 44 45 44 44 44 00 48 44 44 44 44 48 44 44 44 00 44 44 48 44 44 48 44 44 44 48 45 44 44 45 44 45 00 45 45 44 44 44 44 44 44 44 45 44 44 44 44 48 45 45 45 44 48 44 48 48 44 48 44 45 48 44 44 44 44 44 45 44 44 44 44 44 44 44 44 45 48 44 44 44 44 48 44 44 44 48 45 45 44 48 44 45 45 45 45 44 44 44 44 45 44 44 48 44 45 44 45 45 44 44 44 44 45 45 44 45 44 45 44 44 45 44 45 45 44 44 44 45 44 44 44 45 44 45 45 44 44 44 44 48 44 48 44 48 45 44 44 48 44 45 44 45 45 44 44 48 44 45 44 44 44 44 44 44 44 44 44 44 44 44 44 45 45 44 44 45 45 44 45 48 48 44 44 48 00 44 45 44 44 44 45 48 44 48 44 45 44 44 45 45 45 48 45 44 44 44 44 45 45 45 44 45 48 44 48 44 44 44 44 44 44 44 44 44 48 48 45 44 44 44 48 44 44 44 45 44 44 44 44 45 44 44 44 44 48 44 44 45 48 44 44 45 44 45 48 45 48 44 44 44 45 45 48 44 44 44 44 44 00 44 44 45 48 44 44 44 44 44 48 44 45 44 44 44 45 44 44 44 44 44 44 45 44 44 44 44 44 44 44 45 48 00 44 44 44 44 44 44 45 44 44 45 44 44 45 44 45 44 45 45 44 44 44 45 44 44 44 44 44 00 48 45 44 45 48 44 44 44 44 44 44 44 48 44 48 45 48 48 44 48 44 00 44 45 45 44 44 44 44 44 44 00 45 44 44 45 48 44 44 44 45 48 44 48 44 44 44 45 44 44 48 44 44 44 48 45 44 44 44 44 48 45 44 44 45 44 44 45 48 48 45 44 45 44 45 44 45 44 45 45 48 48 45 44 48 44 45 48 45 45 44 45 44 44 48 48 44 44 44 44 48 44 48 44 44 44 44 44 45 44 45 44 44 44 45 44 45 44 45 44 45 45 45 44 44 44 44 44 44 48 45 45 44 45 44 44 44 44 48 48 44 44 44 44 48 44 44 45 44 45 44 45 48 44 44 45 44 44 45 48 44 45 44 44 44 45 44 44 44 44 44 45 44 44 00 44 44 44 44 44 44 45 48 44 44 44 45 44 44 45 44 45 44 48 48 44 45 44 44 45 44 44 44 48 44 45 44 45 44 44 45 44 44 44 44 44 44 44 44 48 44 44 45 44 45 44 44 44 44 45 44 44 48 48 44 45 44 44 45 44 44 44 44 44 45 44 44 48 48 44 44 44 44 44 44 48 44 44 44 45 44 44 45 45 44 45 44 44 44 44 45 44 48 44 45 44 44 44 44 44 44 48 45 44 48 44 44 44 44 44 44 44 45 44 44 45 44 44 48 48 44 44 44 44 44 45 44 44 44 44 44 44 44 45 44 44 45 45 44 44 44 44 45 44 44 44 44 44 45 44 44 45 44 45 48 44 45 45 48 45 45 44 44 44 44 45 44 48 44 45 44 44 45 48 45 44 44 45 48 45 00 44 44 44 48 48 44 45 44 44 45 44 44 44 45 44 45 45 48 45 44 45 00 48 45 48 44 44 44 45 44 44 44 44 44 44 44 44 44 44 45 44 45 44 45 44 44 45 45 48 44 48 44 48 44 44 44 44 44 44 44 45 44 44 44 44 48 45 48 44 44 44 48 44 44 44 48 44 44 44 45 44 44 44 44 48 44 44 44 44 00 45 44 44 45 44 44 45 45 44 45 44 44 44 45 45 44 44 44 44 44 45 45 44 44 45 45 44 45 44 44 44 44 48 44 45 48 44 44 48 45 44 44 45 44 45 44 45 44 44 45 44 48 44 45 44 44 45 44 45 48 44 45 44 45 44 48 44 00 44 44 44 45 44 44 44 44 44 44 48 44 45 44 44 44 45 00 44 44 44 45 44 45 44 48 44 44 44 44 45 48 44 45 45 45 44 45 44 48 44 44 44 45 48 48 44 48 44 48 45 44 44 45 45 44 44 48 48 44 44 48 45
*/
|
ada/meals.adb | rtoal/enhanced-dining-philosophers | 0 | 30468 | <reponame>rtoal/enhanced-dining-philosophers<filename>ada/meals.adb
------------------------------------------------------------------------------
-- meals.adb
--
-- Implementation of the Meals package.
------------------------------------------------------------------------------
with Ada.Strings.Unbounded;
use Ada.Strings.Unbounded;
package body Meals is
-- Store the prices of each individual meal component in tables for
-- efficient lookup.
E_Price: constant array (Entree_Selection) of Float := (
13.25, 10.00, 11.25, 6.50, 12.95, 14.95
);
S_Price: constant array (Soup_Selection) of Float := (0.00, 3.00);
D_Price: constant array (Dessert_Selection) of Float := (0.00, 3.50);
-- The price of a meal is found simply by looking up the prices of each of
-- the three components of the meal in the price tables and adding them up.
function Price (M: Meal) return Float is
begin
return E_Price(M.Entree) + S_Price(M.Soup) + D_Price(M.Dessert);
end Price;
-- To compute a random meal we pick a random entree selection, a random
-- soup selection, and a random dessert selection. Generators for
-- random selections are constructed by instantiating the generic
-- function Random_Discrete.
function Random_Entree is new Random_Discrete (Entree_Selection);
function Random_Soup is new Random_Discrete (Soup_Selection);
function Random_Dessert is new Random_Discrete (Dessert_Selection);
function Random_Meal return Meal is
begin
return (Random_Entree, Random_Soup, Random_Dessert);
end Random_Meal;
-- This is the function which gives the text describing a meal. The
-- string takes one of four forms, depending on the presence/abscence
-- of soup and dessert:
--
-- 1. <entree>
-- 2. <entree> with <soup>
-- 3. <entree> with <dessert>
-- 4. <entree> with <soup> and <dessert>
function "&" (S: Unbounded_String; M: Meal) return Unbounded_String is
Result: Unbounded_String := S;
begin
Append (Result, Entree_Selection'Image(M.Entree));
if M.Soup /= No_Soup or else M.Dessert /= No_Dessert then
Append (Result, " WITH ");
if M.Soup /= No_Soup then
Append (Result, Soup_Selection'Image(M.Soup));
if M.Dessert /= No_Dessert then
Append (Result, " AND ");
end if;
end if;
if M.Dessert /= No_Dessert then
Append (Result, Dessert_Selection'Image(M.Dessert));
end if;
end if;
return Result;
end "&";
end Meals;
|
bb-runtimes/arm/cortex-m1/microsemi/a-intnam.ads | JCGobbi/Nucleo-STM32G474RE | 0 | 22809 | <filename>bb-runtimes/arm/cortex-m1/microsemi/a-intnam.ads
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- A D A . I N T E R R U P T S . N A M E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
package Ada.Interrupts.Names is
-- All identifiers in this unit are implementation defined
pragma Implementation_Defined;
----------------
-- Interrupts --
----------------
IRQ0 : constant Interrupt_ID := 0;
IRQ1 : constant Interrupt_ID := 1;
IRQ2 : constant Interrupt_ID := 2;
IRQ3 : constant Interrupt_ID := 3;
IRQ4 : constant Interrupt_ID := 4;
IRQ5 : constant Interrupt_ID := 5;
IRQ6 : constant Interrupt_ID := 6;
IRQ7 : constant Interrupt_ID := 7;
IRQ8 : constant Interrupt_ID := 8;
IRQ9 : constant Interrupt_ID := 9;
IRQ10 : constant Interrupt_ID := 10;
IRQ11 : constant Interrupt_ID := 11;
IRQ12 : constant Interrupt_ID := 12;
IRQ13 : constant Interrupt_ID := 13;
IRQ14 : constant Interrupt_ID := 14;
IRQ15 : constant Interrupt_ID := 15;
IRQ16 : constant Interrupt_ID := 16;
IRQ17 : constant Interrupt_ID := 17;
IRQ18 : constant Interrupt_ID := 18;
IRQ19 : constant Interrupt_ID := 19;
IRQ20 : constant Interrupt_ID := 20;
IRQ21 : constant Interrupt_ID := 21;
IRQ22 : constant Interrupt_ID := 22;
IRQ23 : constant Interrupt_ID := 23;
IRQ24 : constant Interrupt_ID := 24;
IRQ25 : constant Interrupt_ID := 25;
IRQ26 : constant Interrupt_ID := 26;
IRQ27 : constant Interrupt_ID := 27;
IRQ28 : constant Interrupt_ID := 28;
IRQ29 : constant Interrupt_ID := 29;
IRQ30 : constant Interrupt_ID := 30;
IRQ31 : constant Interrupt_ID := 31;
end Ada.Interrupts.Names;
|
Code/CustomControl/RAHexEd/Test/FileIO.asm | CherryDT/FbEditMOD | 11 | 759 | <gh_stars>10-100
.code
StreamInProc proc hFile:DWORD,pBuffer:DWORD,NumBytes:DWORD,pBytesRead:DWORD
invoke ReadFile,hFile,pBuffer,NumBytes,pBytesRead,0
xor eax,1
ret
StreamInProc endp
StreamOutProc proc hFile:DWORD,pBuffer:DWORD,NumBytes:DWORD,pBytesWritten:DWORD
invoke WriteFile,hFile,pBuffer,NumBytes,pBytesWritten,0
xor eax,1
ret
StreamOutProc endp
SaveFile proc hWin:DWORD,lpFileName:DWORD
LOCAL hFile:DWORD
LOCAL editstream:EDITSTREAM
invoke CreateFile,lpFileName,GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0
.if eax!=INVALID_HANDLE_VALUE
mov hFile,eax
;stream the text to the file
mov editstream.dwCookie,eax
mov editstream.pfnCallback,offset StreamOutProc
invoke SendMessage,hWin,EM_STREAMOUT,SF_TEXT,addr editstream
invoke CloseHandle,hFile
;Set the modify state to false
invoke SendMessage,hWin,EM_SETMODIFY,FALSE,0
mov eax,FALSE
.else
invoke MessageBox,hWnd,offset SaveFileFail,offset szAppName,MB_OK
mov eax,TRUE
.endif
ret
SaveFile endp
SaveEditAs proc hWin:DWORD,lpFileName:DWORD
LOCAL ofn:OPENFILENAME
LOCAL buffer[MAX_PATH]:BYTE
;Zero out the ofn struct
invoke RtlZeroMemory,addr ofn,sizeof ofn
;Setup the ofn struct
mov ofn.lStructSize,sizeof ofn
push hWnd
pop ofn.hwndOwner
push hInstance
pop ofn.hInstance
mov ofn.lpstrFilter,NULL
mov buffer[0],0
lea eax,buffer
mov ofn.lpstrFile,eax
mov ofn.nMaxFile,sizeof buffer
mov ofn.Flags,OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST or OFN_OVERWRITEPROMPT
mov ofn.lpstrDefExt,NULL
;Show save as dialog
invoke GetSaveFileName,addr ofn
.if eax
invoke SaveFile,hWin,addr buffer
.if !eax
;The file was saved
invoke lstrcpy,offset FileName,addr buffer
invoke SetWinCaption,offset FileName
invoke TabToolGetMem,hWin
invoke lstrcpy,addr [eax].TABMEM.filename,offset FileName
invoke TabToolGetInx,hWin
invoke TabToolSetText,eax,offset FileName
mov eax,FALSE
.endif
.else
mov eax,TRUE
.endif
ret
SaveEditAs endp
SaveEdit proc hWin:DWORD,lpFileName:DWORD
;Check if filrname is (Untitled)
invoke lstrcmp,lpFileName,offset NewFile
.if eax
invoke SaveFile,hWin,lpFileName
.else
invoke SaveEditAs,hWin,lpFileName
.endif
ret
SaveEdit endp
WantToSave proc hWin:DWORD,lpFileName:DWORD
LOCAL buffer[512]:BYTE
LOCAL buffer1[2]:BYTE
invoke SendMessage,hWin,EM_GETMODIFY,0,0
.if eax
invoke lstrcpy,addr buffer,offset WannaSave
invoke lstrcat,addr buffer,lpFileName
mov ax,'?'
mov word ptr buffer1,ax
invoke lstrcat,addr buffer,addr buffer1
invoke MessageBox,hWnd,addr buffer,offset szAppName,MB_YESNOCANCEL or MB_ICONQUESTION
.if eax==IDYES
invoke SaveEdit,hWin,lpFileName
.elseif eax==IDNO
mov eax,FALSE
.else
mov eax,TRUE
.endif
.endif
ret
WantToSave endp
LoadFile proc uses ebx esi,hWin:DWORD,lpFileName:DWORD
LOCAL hFile:DWORD
LOCAL editstream:EDITSTREAM
LOCAL chrg:CHARRANGE
;Open the file
invoke CreateFile,lpFileName,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0
.if eax!=INVALID_HANDLE_VALUE
mov hFile,eax
;Copy buffer to FileName
invoke lstrcpy,offset FileName,lpFileName
;stream the text into the RAEdit control
push hFile
pop editstream.dwCookie
mov editstream.pfnCallback,offset StreamInProc
invoke SendMessage,hWin,EM_STREAMIN,SF_TEXT,addr editstream
invoke CloseHandle,hFile
invoke SendMessage,hWin,EM_SETMODIFY,FALSE,0
mov chrg.cpMin,0
mov chrg.cpMax,0
invoke SendMessage,hWin,EM_EXSETSEL,0,addr chrg
invoke SetWinCaption,offset FileName
mov eax,FALSE
.else
invoke MessageBox,hWnd,offset OpenFileFail,offset szAppName,MB_OK or MB_ICONERROR
mov eax,TRUE
.endif
ret
LoadFile endp
OpenEditFile proc lpFileName:DWORD
LOCAL fClose:DWORD
mov fClose,0
invoke lstrcmp,offset FileName,offset NewFile
.if !eax
invoke SendMessage,hREd,EM_GETMODIFY,0,0
.if !eax
mov eax,hREd
mov fClose,eax
.endif
.endif
invoke lstrcpy,offset FileName,lpFileName
invoke UpdateAll,IS_OPEN
.if !eax
invoke CreateRAHexEd
invoke TabToolAdd,hREd,offset FileName
invoke LoadCursor,0,IDC_WAIT
invoke SetCursor,eax
invoke LoadFile,hREd,offset FileName
invoke LoadCursor,0,IDC_ARROW
invoke SetCursor,eax
.if fClose
invoke TabToolDel,fClose
invoke DestroyWindow,fClose
.endif
.endif
invoke SetFocus,hREd
ret
OpenEditFile endp
OpenEdit proc
LOCAL ofn:OPENFILENAME
LOCAL buffer[MAX_PATH]:BYTE
;Zero out the ofn struct
invoke RtlZeroMemory,addr ofn,sizeof ofn
;Setup the ofn struct
mov ofn.lStructSize,sizeof ofn
push hWnd
pop ofn.hwndOwner
push hInstance
pop ofn.hInstance
mov ofn.lpstrFilter,offset ALLFilterString
mov buffer[0],0
lea eax,buffer
mov ofn.lpstrFile,eax
mov ofn.nMaxFile,sizeof buffer
mov ofn.lpstrDefExt,NULL
mov ofn.Flags,OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST
;Show the Open dialog
invoke GetOpenFileName,addr ofn
.if eax
invoke CreateFile,addr buffer,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0
.if eax!=INVALID_HANDLE_VALUE
invoke CloseHandle,eax
invoke OpenEditFile,addr buffer
.else
invoke MessageBox,hWnd,offset OpenFileFail,offset szAppName,MB_OK or MB_ICONERROR
.endif
.endif
ret
OpenEdit endp
|
src/configuration.adb | kqr/qweyboard | 33 | 18927 | package body Configuration is
procedure Get_Settings (Config : in out Settings) is
I : Positive := 1;
begin
while I <= CLI.Argument_Count loop
if Get_Argument (I, "-t", Config.Timeout) then null;
elsif Get_Argument (I, "-l", Config.Language_File_Name) then null;
elsif Get_Argument (I, "-v", Config.Log_Level) then null;
elsif Get_Argument (I, "-vv", Config.Log_Level) then null;
elsif Get_Argument (I, "-vvv", Config.Log_Level) then null;
else
raise ARGUMENTS_ERROR;
end if;
end loop;
end Get_Settings;
procedure Load_Language (Config : in out Settings) is
begin
if Length (Config.Language_File_Name) > 0 then
Qweyboard.Languages.Parser.Parse (To_String (Config.Language_File_Name));
end if;
end;
function Get_Argument (Count : in out Positive; Flag : String; File_Name : in out Unbounded_String) return Boolean is
begin
if CLI.Argument (Count) /= Flag then
return False;
end if;
File_Name := To_Unbounded_String (CLI.Argument (Count + 1));
Count := Count + 2;
return True;
end Get_Argument;
function Get_Argument (Count : in out Positive; Flag : String; Timeout : in out Ada.Real_Time.Time_Span) return Boolean is
begin
if CLI.Argument (Count) /= Flag then
return False;
end if;
Timeout := Ada.Real_Time.Milliseconds
(Natural'Value (CLI.Argument (Count + 1)));
Count := Count + 2;
return True;
exception
when CONSTRAINT_ERROR =>
return False;
end Get_Argument;
function Get_Argument (Count : in out Positive; Flag : String; Verbosity : in out Logging.Verbosity_Level) return Boolean is
begin
if CLI.Argument (Count) /= Flag then
return False;
end if;
if Flag = "-v" then
Verbosity := Logging.Log_Warning;
elsif Flag = "-vv" then
Verbosity := Logging.Log_Info;
elsif Flag = "-vvv" then
Verbosity := Logging.Log_Chatty;
else
return False;
end if;
Count := Count + 1;
return True;
end;
end Configuration;
|
alloy4fun_models/trashltl/models/10/JajsKoqy5uAvsvzLS.als | Kaixi26/org.alloytools.alloy | 0 | 1848 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idJajsKoqy5uAvsvzLS_prop11 {
always all f:(File-Protected)| always f in Protected'
}
pred __repair { idJajsKoqy5uAvsvzLS_prop11 }
check __repair { idJajsKoqy5uAvsvzLS_prop11 <=> prop11o } |
src/show_version.adb | wiremoons/apass | 3 | 14270 | -------------------------------------------------------------------------------
-- Package : Show_Version --
-- Description : Display current program version and build info. --
-- Author : <NAME> <<EMAIL>> --
-- License : MIT Open Source. --
-------------------------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Strings.Maps; use Ada.Strings.Maps;
with Ada.Text_IO.Unbounded_IO; use Ada.Text_IO.Unbounded_IO;
with Ada.Directories;
with Ada.IO_Exceptions;
with Ada.Strings.Fixed;
with Ada.Command_Line;
with GNAT.Source_Info;
with GNAT.Compiler_Version;
with System.Multiprocessors;
package body Show_Version is
-- SET APPLICATION VERSION TO DISPLAY BELOW --
AppVersion : constant String := "0.0.5";
package CVer is new GNAT.Compiler_Version;
-- Linux distros using 'systemd' are required to have the file:
OS_Release_File : constant String := "/etc/os-release";
F : File_Type;
procedure Set_Debug (Is_Debug : in out Boolean) is
--------------------------------------
-- Set if in debug build
--------------------------------------
begin
-- Only gets called if program is compiled as a 'debug' build so variable only set 'true' if this is the case
Is_Debug := True;
end Set_Debug;
function Is_Linux return Boolean is
---------------------------------------
-- Check if the OS is a Linux distro
---------------------------------------
begin
if Ada.Directories.Exists (OS_Release_File) then
return True;
else
return False;
end if;
end Is_Linux;
function Is_Windows return Boolean is
---------------------------------------
-- Check if the OS is Windows
---------------------------------------
-- alter to use env variable in Windiws is not on a 'c:' drive
--
begin
if Ada.Directories.Exists ("c:\windows") then
return True;
else
return False;
end if;
end Is_Windows;
procedure Clean_Pretty_Name (OS_Name : in out Unbounded_String) is
-----------------------------------------------
-- Clean up the 'PRETTY_NAME' and extract text
-----------------------------------------------
-- Expects the line of text in the format:
-- PRETTY_NAME="Ubuntu 20.04.1 LTS"
--
-- Delete all leading text up to and including '=' leaving:
-- "Ubuntu 20.04.1 LTS"
--
-- This is then further cleaned up to remove both '"' characters which are defined in the 'Quote_Char'
-- Character_Set. The cleaned up text is modified in place using the provided Unbounded.String resulting in
-- a final string of (or equivalent for other PRETTY_NAME entries):
-- Ubuntu 20.04.1 LTS
Quote_Char : constant Character_Set := To_Set ('"'); --\""
begin
if Length (OS_Name) > 0 then
-- delete up to (and including) character '=' in string
Delete (OS_Name, 1, Index (OS_Name, "="));
-- trim off quotes
Trim (OS_Name, Quote_Char, Quote_Char);
end if;
end Clean_Pretty_Name;
function Get_Linux_OS return String is
----------------------------------------
-- Get the OS Linux distro 'PRETTY_NAME'
----------------------------------------
-- Linux systems running 'systemd' should include a file:
-- /etc/os-release
--
-- This file includes many entries but should have the line:
-- PRETTY_NAME="Ubuntu 20.04.1 LTS"
-- The file is opened and read until the above line is located. The line is then cleaned up in the procedure
-- 'Clean_Pretty_Name'. The remaining text should jus be:
-- Ubuntu 20.04.1 LTS
-- that is returned as a String.
OS_Name : Unbounded_String := Null_Unbounded_String;
begin
if Ada.Directories.Exists (OS_Release_File) then
Open (F, In_File, OS_Release_File);
while not End_Of_File (F) loop
declare
Line : constant String := Get_Line (F);
begin
if Ada.Strings.Fixed.Count (Line, "PRETTY_NAME") > 0 then
-- get the identified line from the file
OS_Name := To_Unbounded_String (Line);
pragma Debug (New_Line (Standard_Error, 1));
pragma Debug (Put_Line (Standard_Error, "[DEBUG] unmodified: " & OS_Name));
-- extract the part required
Clean_Pretty_Name (OS_Name);
pragma Debug (Put_Line (Standard_Error, "[DEBUG] cleaned up: " & OS_Name));
end if;
end;
end loop;
-- return the extracted distro text
return To_String (OS_Name);
else
New_Line (2);
Put_Line (Standard_Error, "ERROR: unable to locate file:");
Put_Line (Standard_Error, " - " & OS_Release_File);
New_Line (1);
return "UNKNOWN LINUX OS";
end if;
exception
when Ada.IO_Exceptions.Name_Error =>
New_Line (2);
Put_Line (Standard_Error, "ERROR: file not found exception!");
return "UNKNOWN LINUX OS";
when others =>
New_Line (2);
Put_Line (Standard_Error, "ERROR: unknown exception!");
return "UNKNOWN LINUX OS";
end Get_Linux_OS;
procedure Show is
-------------------------------------------
-- Collect and display version information
-------------------------------------------
Is_Debug : Boolean := False;
begin
-- only gets called if complied with: '-gnata'
pragma Debug (Set_Debug (Is_Debug));
pragma Debug (Put_Line (Standard_Error, "[DEBUG] 'Show_Version' is running in debug mode."));
-- start output of version information
New_Line (1);
Put ("'");
Put (Ada.Directories.Simple_Name (Ada.Command_Line.Command_Name));
Put ("' is version: '");
Put (AppVersion);
Put ("' running on: '");
if Is_Linux then
Put (Get_Linux_OS);
elsif Is_Windows then
Put ("Windows");
else
Put ("UNKNOWN OS");
end if;
Put ("' with");
Put (System.Multiprocessors.Number_Of_CPUs'Image);
Put_Line (" CPU cores.");
Put ("Compiled on: ");
Put (GNAT.Source_Info.Compilation_ISO_Date);
Put (" @ ");
Put (GNAT.Source_Info.Compilation_Time);
Put_Line (".");
Put_Line ("Copyright (c) 2021 <NAME>.");
New_Line (1);
Put ("Ada source built as '");
if Is_Debug then
Put ("debug");
else
Put ("release");
end if;
Put ("' using GNAT complier version: '");
Put (CVer.Version);
Put_Line ("'.");
New_Line (1);
Put_Line ("For licenses and further information visit:");
Put_Line (" - https://github.com/wiremoons/apass/");
New_Line (1);
end Show;
end Show_Version;
|
src/base/commands/util-commands-parsers.ads | RREE/ada-util | 60 | 6071 | -----------------------------------------------------------------------
-- util-commands-parsers -- Support to parse command line options
-- Copyright (C) 2018 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
-- == Command line parsers ==
-- Parsing command line arguments before their execution is handled by the
-- `Config_Parser` generic package. This allows to customize how the arguments are
-- parsed.
--
-- The `Util.Commands.Parsers.No_Parser` package can be used to execute the command
-- without parsing its arguments.
--
-- The `Util.Commands.Parsers.GNAT_Parser.Config_Parser` package provides support to
-- parse command line arguments by using the `GNAT` `Getopt` support.
package Util.Commands.Parsers is
-- The config parser that must be instantiated to provide the configuration type
-- and the Execute procedure that will parse the arguments before executing the command.
generic
type Config_Type is limited private;
with procedure Execute (Config : in out Config_Type;
Args : in Argument_List'Class;
Process : not null access
procedure (Cmd_Args : in Argument_List'Class)) is <>;
with procedure Usage (Name : in String;
Config : in out Config_Type) is <>;
package Config_Parser is
end Config_Parser;
-- The empty parser.
type No_Config_Type is limited null record;
-- Execute the command with its arguments (no parsing).
procedure Execute (Config : in out No_Config_Type;
Args : in Argument_List'Class;
Process : not null access
procedure (Cmd_Args : in Argument_List'Class));
procedure Usage (Name : in String;
Config : in out No_Config_Type) is null;
-- A parser that executes the command immediately (no parsing of arguments).
package No_Parser is
new Config_Parser (Config_Type => No_Config_Type,
Execute => Execute,
Usage => Usage);
end Util.Commands.Parsers;
|
regtests/model/regtests-simple-model.adb | My-Colaborations/ada-ado | 0 | 26777 | -----------------------------------------------------------------------
-- Regtests.Simple.Model -- Regtests.Simple.Model
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-body.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095
-----------------------------------------------------------------------
-- Copyright (C) 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 Ada.Unchecked_Deallocation;
package body Regtests.Simple.Model is
use type ADO.Objects.Object_Record_Access;
use type ADO.Objects.Object_Ref;
pragma Warnings (Off, "formal parameter * is not referenced");
function Allocate_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => ALLOCATE_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Allocate_Key;
function Allocate_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => ALLOCATE_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Allocate_Key;
function "=" (Left, Right : Allocate_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Allocate_Ref'Class;
Impl : out Allocate_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Allocate_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Allocate_Ref) is
Impl : Allocate_Access;
begin
Impl := new Allocate_Impl;
Impl.Version := 0;
Impl.Name.Is_Null := True;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Allocate
-- ----------------------------------------
procedure Set_Id (Object : in out Allocate_Ref;
Value : in ADO.Identifier) is
Impl : Allocate_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value);
end Set_Id;
function Get_Id (Object : in Allocate_Ref)
return ADO.Identifier is
Impl : constant Allocate_Access
:= Allocate_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
function Get_Version (Object : in Allocate_Ref)
return Integer is
Impl : constant Allocate_Access
:= Allocate_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Version;
end Get_Version;
procedure Set_Name (Object : in out Allocate_Ref;
Value : in String) is
Impl : Allocate_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 3, Impl.Name, Value);
end Set_Name;
procedure Set_Name (Object : in out Allocate_Ref;
Value : in ADO.Nullable_String) is
Impl : Allocate_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 3, Impl.Name, Value);
end Set_Name;
function Get_Name (Object : in Allocate_Ref)
return String is
Value : constant ADO.Nullable_String := Object.Get_Name;
begin
if Value.Is_Null then
return "";
else
return Ada.Strings.Unbounded.To_String (Value.Value);
end if;
end Get_Name;
function Get_Name (Object : in Allocate_Ref)
return ADO.Nullable_String is
Impl : constant Allocate_Access
:= Allocate_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Name;
end Get_Name;
-- Copy of the object.
procedure Copy (Object : in Allocate_Ref;
Into : in out Allocate_Ref) is
Result : Allocate_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Allocate_Access
:= Allocate_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Allocate_Access
:= new Allocate_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Version := Impl.Version;
Copy.Name := Impl.Name;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Allocate_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Allocate_Access := new Allocate_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Allocate_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Allocate_Access := new Allocate_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Allocate_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Allocate_Access := new Allocate_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Allocate_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Allocate_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Allocate_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Allocate_Impl) is
type Allocate_Impl_Ptr is access all Allocate_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Allocate_Impl, Allocate_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Allocate_Impl_Ptr := Allocate_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Allocate_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, ALLOCATE_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Allocate_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Allocate_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (ALLOCATE_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_1_NAME, -- ID
Value => Object.Get_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_1_NAME, -- NAME
Value => Object.Name);
Object.Clear_Modified (3);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Allocate_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (ALLOCATE_DEF'Access);
Result : Integer;
begin
Object.Version := 1;
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_0_1_NAME, -- ID
Value => Object.Get_Key);
Query.Save_Field (Name => COL_1_1_NAME, -- version
Value => Object.Version);
Query.Save_Field (Name => COL_2_1_NAME, -- NAME
Value => Object.Name);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Allocate_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (ALLOCATE_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Allocate_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Allocate_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Allocate_Impl (Obj.all)'Access;
if Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "name" then
if Impl.Name.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (Impl.Name.Value);
end if;
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
procedure List (Object : in out Allocate_Vector;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, ALLOCATE_DEF'Access);
begin
Stmt.Execute;
Allocate_Vectors.Clear (Object);
while Stmt.Has_Elements loop
declare
Item : Allocate_Ref;
Impl : constant Allocate_Access := new Allocate_Impl;
begin
Impl.Load (Stmt, Session);
ADO.Objects.Set_Object (Item, Impl.all'Access);
Object.Append (Item);
end;
Stmt.Next;
end loop;
end List;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Allocate_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
pragma Unreferenced (Session);
begin
Object.Set_Key_Value (Stmt.Get_Identifier (0));
Object.Name := Stmt.Get_Nullable_String (2);
Object.Version := Stmt.Get_Integer (1);
ADO.Objects.Set_Created (Object);
end Load;
function User_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => USER_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end User_Key;
function User_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => USER_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end User_Key;
function "=" (Left, Right : User_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out User_Ref'Class;
Impl : out User_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := User_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out User_Ref) is
Impl : User_Access;
begin
Impl := new User_Impl;
Impl.Version := 0;
Impl.Value := ADO.NO_IDENTIFIER;
Impl.Name.Is_Null := True;
Impl.Select_Name.Is_Null := True;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: User
-- ----------------------------------------
procedure Set_Id (Object : in out User_Ref;
Value : in ADO.Identifier) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value);
end Set_Id;
function Get_Id (Object : in User_Ref)
return ADO.Identifier is
Impl : constant User_Access
:= User_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
function Get_Version (Object : in User_Ref)
return Integer is
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Version;
end Get_Version;
procedure Set_Value (Object : in out User_Ref;
Value : in ADO.Identifier) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Identifier (Impl.all, 3, Impl.Value, Value);
end Set_Value;
function Get_Value (Object : in User_Ref)
return ADO.Identifier is
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Value;
end Get_Value;
procedure Set_Name (Object : in out User_Ref;
Value : in String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 4, Impl.Name, Value);
end Set_Name;
procedure Set_Name (Object : in out User_Ref;
Value : in ADO.Nullable_String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 4, Impl.Name, Value);
end Set_Name;
function Get_Name (Object : in User_Ref)
return String is
Value : constant ADO.Nullable_String := Object.Get_Name;
begin
if Value.Is_Null then
return "";
else
return Ada.Strings.Unbounded.To_String (Value.Value);
end if;
end Get_Name;
function Get_Name (Object : in User_Ref)
return ADO.Nullable_String is
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Name;
end Get_Name;
procedure Set_Select_Name (Object : in out User_Ref;
Value : in String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 5, Impl.Select_Name, Value);
end Set_Select_Name;
procedure Set_Select_Name (Object : in out User_Ref;
Value : in ADO.Nullable_String) is
Impl : User_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 5, Impl.Select_Name, Value);
end Set_Select_Name;
function Get_Select_Name (Object : in User_Ref)
return String is
Value : constant ADO.Nullable_String := Object.Get_Select_Name;
begin
if Value.Is_Null then
return "";
else
return Ada.Strings.Unbounded.To_String (Value.Value);
end if;
end Get_Select_Name;
function Get_Select_Name (Object : in User_Ref)
return ADO.Nullable_String is
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Select_Name;
end Get_Select_Name;
-- Copy of the object.
procedure Copy (Object : in User_Ref;
Into : in out User_Ref) is
Result : User_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant User_Access
:= User_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant User_Access
:= new User_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Version := Impl.Version;
Copy.Value := Impl.Value;
Copy.Name := Impl.Name;
Copy.Select_Name := Impl.Select_Name;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out User_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant User_Access := new User_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out User_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant User_Access := new User_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out User_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant User_Access := new User_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out User_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new User_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out User_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access User_Impl) is
type User_Impl_Ptr is access all User_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(User_Impl, User_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : User_Impl_Ptr := User_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out User_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, USER_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out User_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out User_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (USER_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_2_NAME, -- ID
Value => Object.Get_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_2_NAME, -- VALUE
Value => Object.Value);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (4) then
Stmt.Save_Field (Name => COL_3_2_NAME, -- NAME
Value => Object.Name);
Object.Clear_Modified (4);
end if;
if Object.Is_Modified (5) then
Stmt.Save_Field (Name => COL_4_2_NAME, -- select
Value => Object.Select_Name);
Object.Clear_Modified (5);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out User_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (USER_DEF'Access);
Result : Integer;
begin
Object.Version := 1;
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_0_2_NAME, -- ID
Value => Object.Get_Key);
Query.Save_Field (Name => COL_1_2_NAME, -- version
Value => Object.Version);
Query.Save_Field (Name => COL_2_2_NAME, -- VALUE
Value => Object.Value);
Query.Save_Field (Name => COL_3_2_NAME, -- NAME
Value => Object.Name);
Query.Save_Field (Name => COL_4_2_NAME, -- select
Value => Object.Select_Name);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out User_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (USER_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in User_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access User_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := User_Impl (Obj.all)'Access;
if Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "value" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Value));
elsif Name = "name" then
if Impl.Name.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (Impl.Name.Value);
end if;
elsif Name = "select_name" then
if Impl.Select_Name.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (Impl.Select_Name.Value);
end if;
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
procedure List (Object : in out User_Vector;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, USER_DEF'Access);
begin
Stmt.Execute;
User_Vectors.Clear (Object);
while Stmt.Has_Elements loop
declare
Item : User_Ref;
Impl : constant User_Access := new User_Impl;
begin
Impl.Load (Stmt, Session);
ADO.Objects.Set_Object (Item, Impl.all'Access);
Object.Append (Item);
end;
Stmt.Next;
end loop;
end List;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out User_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
pragma Unreferenced (Session);
begin
Object.Set_Key_Value (Stmt.Get_Identifier (0));
Object.Value := Stmt.Get_Identifier (2);
Object.Name := Stmt.Get_Nullable_String (3);
Object.Select_Name := Stmt.Get_Nullable_String (4);
Object.Version := Stmt.Get_Integer (1);
ADO.Objects.Set_Created (Object);
end Load;
end Regtests.Simple.Model;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.