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 |
|---|---|---|---|---|
programs/oeis/274/A274601.asm | karttu/loda | 1 | 160753 | <reponame>karttu/loda
; A274601: a(n) = 2*3^(s-1) - n, where s is the number of trits of n in balanced ternary form.
; 1,4,3,2,13,12,11,10,9,8,7,6,5,40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,121,120,119,118,117,116,115,114,113,112,111,110,109,108,107,106,105,104,103,102,101,100,99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64,63,62,61,60,59,58,57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,364,363,362,361,360,359,358,357,356,355,354,353,352,351,350,349,348,347,346,345,344,343,342,341,340,339,338,337,336,335,334,333,332,331,330,329,328,327,326,325,324,323,322,321,320,319,318,317,316,315,314,313,312,311,310,309,308,307,306,305,304,303,302,301,300,299,298,297,296,295,294,293,292,291,290,289,288,287,286,285,284,283,282,281,280,279,278,277,276,275,274,273,272,271,270,269,268,267,266,265,264,263,262,261,260,259,258,257,256,255,254,253,252,251,250,249,248,247,246,245,244,243,242,241,240,239,238,237,236
sub $3,$0
cal $0,132171 ; 3^n repeated 3^n times.
mov $1,1
mov $2,$0
sub $2,1
mul $2,2
add $2,1
add $3,3
add $3,$2
mul $1,$3
sub $1,3
|
src/vms_basic/parser/BasicParser.g4 | GitMensch/vms-ide | 5 | 726 | <filename>src/vms_basic/parser/BasicParser.g4
parser grammar BasicParser;
options
{ tokenVocab = BasicLexer; }
identifier
: IDENTIFIER
;
number
: NUMBER
;
newline
: NL
;
comName
: identifier
;
fileSpec
: STRING_LITERAL
| stringVariableName
| strExp
;
targetName
: identifier
| NUMBER //line number
;
variableName
: identifier
;
variableChildName
: identifier
;
handlerName
: identifier
;
mapName
: identifier
;
routineName
: identifier
;
pictureName
: identifier
;
recName
: identifier
;
recNameEnd
: identifier
;
groupName
: identifier
;
groupNameEnd
: identifier
;
stringVariableName
: identifier
;
unqStr
: identifier
;
numericVariableName
: identifier
;
arrayVariableName
: identifier
;
constName
: identifier
;
constExp
: variableName
| expression
;
recExp
: expression
;
rfaExp
: expression
;
intConst
: NUMBER
| variableName
;
strConst
: STRING_LITERAL
;
repCnt
: NUMBER
;
intExp
: NUMBER
| variableName
| expressionInt
;
realExp
: NUMBER_REAL
| variableName
| expression
;
numExp
: NUMBER | NUMBER_REAL
| variableName
| expression
;
strExp
: STRING_LITERAL
| variableName
| expressionStr
;
chnlExp
: factorInt
| NUMBER
;
condExp
: expression
;
lexVar
: PERCENT identifier
;
lexExp
: expressionLex
;
eol
: COMMENT? newline
| BACKSLASH
;
equalsExpn
: ASSIGN expression
;
label
: identifier COLON
| NUMBER
;
program
: eol? (label? programUnit)+ EOF
;
programUnit
: mainProgram eol
| subprogramDeclaration eol
| directive eol
| declaration eol
| eol
;
mainProgram
: programStatement declarationOrStatement+ endProgramStatement
;
programStatement
: PROGRAM identifier eol
;
endProgramStatement
: (END | EXIT) PROGRAM
;
declarationOrStatement
: label? declaration eol
| label? statement eol
| label? directive eol
| eol
;
directive
: titleDirective
| includeDirective
| allDirective
;
titleDirective
: P_TITLE STRING_LITERAL
| P_SBTTL STRING_LITERAL
| P_IDENT STRING_LITERAL
;
includeDirective
: P_INCLUDE STRING_LITERAL
| P_INCLUDE STRING_LITERAL P_FROM P_LIBRARY (STRING_LITERAL)?
| P_INCLUDE P_FROM P_CDD STRING_LITERAL
;
allDirective
: P_ABORT STRING_LITERAL
| P_CROSS
| P_DECLARED LPAREN lexVar RPAREN
| P_DEFINE identifier (dataType | STRING_LITERAL | identifier)
| pIfDirective//%IF-%THEN-%ELSE-%END %IF
| P_LET lexVar ASSIGN lexExp//%LET %lex-var = lex-exp
| P_LIST
| P_NOCROSS
| P_NOLIST
| P_PAGE
| P_PRINT STRING_LITERAL
| P_REPORT P_DEPENDENCY STRING_LITERAL (STRING_LITERAL)?
| P_SBTTL STRING_LITERAL
| P_UNDEFINE identifier
| P_VARIANT
;
pIfDirective
: P_IF lexExp eol? P_THEN eol
subScope
(P_ELSE subScope)?
P_END P_IF
;
declaration
: variableDeclaration
| subprogramDeclaration
| constantDeclaration
| declareSubprogramDeclaration
| recordDeclaration
| externVarConstDeclaration
| externSubprogramDeclaration
| externPictureDeclaration
| defFunctionMultyDeclaration
| defFunctionSingleDeclaration
| mapDeclaration
| mapDynDeclaration
| commonDeclaration
| dimensionDeclaration
| matDeclaration
| matArithmeticDeclaration
;
recordDeclaration
: RECORD recName eol
recComponent+
END RECORD recNameEnd?
;
recComponent
: dataType recItem (COMMA recItem)* eol
| groupClause eol
| variantClause eol
| eol
;
recItem
: variableDescription initialValue?
| FILL (LPAREN intConst RPAREN)? (ASSIGN intConst)?
;
groupClause
: GROUP groupName (LPAREN (groupExpn (COMMA groupExpn)*)? RPAREN)? eol
recComponent+
END GROUP groupNameEnd?
;
groupExpn
: intConst (TO intConst)?
;
variantClause
: VARIANT eol
caseClause+
END VARIANT
;
caseClause
: CASE eol
recComponent*
;
dataType
: BYTE
| WORD
| INTEGER
| LONG
| QUAD
| SINGLE
| DOUBLE
| REAL
| RFA
| STRING
| GFLOAT
| SFLOAT
| TFLOAT
| XFLOAT
| DECIMAL (LPAREN NUMBER COMMA NUMBER RPAREN)?
| CHARACTER
| identifier
;
variableDeclaration
: DECLARE variableDescriptionPart (COMMA variableDescriptionPart)*
;
variableDescriptionPart
: dataType? variableDescription
;
variableDescription
: arrayDescription
| singleVarDescription
;
singleVarDescription
: variableName
;
initialValue
: ASSIGN expression// intExp
;
arrayDescription
: arrayVariableName LPAREN (subscriptExpn (COMMA subscriptExpn)*)? RPAREN
;
subscriptExpn
: expression toExpn?
;
constantDeclaration
: DECLARE dataType CONSTANT (constantDescription (COMMA constantDescription)*)
;
constantDescription
: constName ASSIGN constExp
;
declareSubprogramDeclaration
: DECLARE dataType FUNCTION routineName declareArgumentDescription?
;
declareArgumentDescription
: LPAREN (dataType (COMMA dataType)*)? RPAREN
;
subprogramDeclaration
: functionDeclaration
| subroutineDeclaration
;
functionDeclaration
: functionHeader eol
subScope
functionEnd
;
functionHeader
: FUNCTION dataType routineName byrefOrByval? subprogramArgumentDescription?
;
functionEnd
: (END FUNCTION | FUNCTIONEND) expression?
;
subroutineDeclaration
: subroutineHeader eol
subScope
subroutineEnd
;
subroutineHeader
: SUB routineName byrefOrByval? subprogramArgumentDescription?
;
subroutineEnd
: (END SUB | SUBEND)
;
subScope
: declarationOrStatement+
;
subprogramArgumentDescription
: LPAREN (subprogramArgument (COMMA subprogramArgument)*)? RPAREN
;
subprogramArgument
: OPTIONAL? variableDescriptionPart equalsExpn? byrefOrByval?
;
byrefOrByval
: BY REF | BY VALUE | BY DESC
;
externVarConstDeclaration
: EXTERNAL dataType (variableName (COMMA variableName)*)
| EXTERNAL dataType CONSTANT (constName (COMMA constName)*)
;
externSubprogramDeclaration
: EXTERNAL dataType FUNCTION (externSubprogramDescript (COMMA externSubprogramDescript)*)
| EXTERNAL SUB (externSubprogramDescript (COMMA externSubprogramDescript)*)
;
externSubprogramDescript
: routineName byrefOrByval? externSubprogramArgumentDescription?
;
externSubprogramArgumentDescription
: LPAREN (externSubprogramArgument (COMMA externSubprogramArgument)*)? RPAREN
;
externSubprogramArgument
: OPTIONAL? dataType (DIM LPAREN COMMA* RPAREN)? (ASSIGN intConst)? byrefOrByval?
;
externPictureDeclaration
: EXTERNAL PICTURE pictureName externSubprogramArgumentDescription?
;
defFunctionSingleDeclaration
: defFunctionHeader ASSIGN expression
;
defFunctionMultyDeclaration
: defFunctionHeader eol?
(statement? eol)+//subScope
(END DEF | FNEND) expression?
;
defFunctionHeader
: (DEF | DEF_S) dataType routineName subprogramArgumentDescription?
;
mapDeclaration
: MAP LPAREN mapName RPAREN mapItem (COMMA mapItem)*
;
mapItem
: mapDescriptionPart
| dataType? FILL (LPAREN repCnt RPAREN)? (ASSIGN intConst)?
| dataType? FILL_P (LPAREN repCnt RPAREN)?
| dataType? FILL_D (LPAREN repCnt RPAREN)? (ASSIGN intConst)?
;
mapDynDeclaration
: MAP DYNAMIC LPAREN mapName RPAREN mapDescriptionPart (COMMA mapDescriptionPart)*
;
mapDescriptionPart
: dataType? mapVariableItem
;
mapVariableItem
: variableDescription (ASSIGN intConst)?
;
commonDeclaration
: (COMMON | COM) (LPAREN comName RPAREN)? mapItem (COMMA mapItem)*
;
dimensionDeclaration
: (DIM | DIMENSION) (SHARP chnlExp COMMA)? dimensionItem (COMMA dimensionItem)*
;
dimensionItem
: dataType? dimensionArray (ASSIGN intConst)?
;
dimensionArray
: arrayVariableName LPAREN (dimensionExpn (COMMA dimensionExpn)*)? RPAREN
;
dimensionExpn
: intConst (TO intConst)?
| variableName (TO variableName)?
| intConst
;
matDeclaration
: MAT arrayVariableName ASSIGN matClause LPAREN intExp (COMMA intExp)? RPAREN
;
matClause
: CON
| IDN
| ZER
| NUL_D
;
matArithmeticDeclaration
: MAT arrayVariableName ASSIGN arrayVariableName (matOp arrayVariableName)?
| MAT arrayVariableName ASSIGN arrayVariableName STAR arrayVariableName (STAR arrayVariableName)*
| MAT arrayVariableName ASSIGN numExp STAR arrayVariableName
| MAT arrayVariableName ASSIGN (TRN | INV) arrayVariableName
;
matOp
: PLUS
| MINUS
| STAR
;
variable
: variableName (LPAREN expression (COMMA expression)* RPAREN | COLON COLON variableChildName)*
;
expression
: simpleExpression (relationaloperator expression)?
;
relationaloperator
: EQUAL | NOT_EQUAL
| LESS_EQUAL | MORE_EQUAL | ASSIGN | MORE_ | LESS
| NOT | XOR | EQV | IMP | OR | AND
;
simpleExpression
: term (additiveoperator simpleExpression)?
;
additiveoperator
: PLUS
| MINUS
| NOT
| OR
;
term
: signedFactor (multiplicativeoperator term)?
;
multiplicativeoperator
: STAR
| DIV
| AND
;
signedFactor
: (PLUS | MINUS)? factor
;
factor
: variable
| LPAREN expression RPAREN
| functionDesignatorReal
| functionDesignatorInt
| functionDesignatorSrt
| unsignedConstant
| set
| NOT factor
;
unsignedConstant
: STRING_LITERAL
| number
| NUMBER_REAL
| DEC_NUMBER
| BIN_NUMBER
| HEX_NUMBER
| OCT_NUMBER
| CH_NUMBER
| NUL | BEL | BS | HT | LF | VT | FF | CR | SO | SI ESC | SP | DEL | PI
;
variableInt
: variableName (LPAREN expressionInt (COMMA expressionInt)* RPAREN | COLON COLON variableChildName)*
;
expressionInt
: simpleExpressionInt (relationaloperator expressionInt)?
;
simpleExpressionInt
: termInt (additiveoperator simpleExpressionInt)?
;
termInt
: signedFactorInt (multiplicativeoperator termInt)?
;
signedFactorInt
: (PLUS | MINUS)? factorInt
;
factorInt
: variableInt
| LPAREN expressionInt RPAREN
| functionDesignatorInt
| unsignedConstantInt
| set//???
| NOT factorInt
;
unsignedConstantInt
: number
| DEC_NUMBER
| BIN_NUMBER
| HEX_NUMBER
| OCT_NUMBER
;
variableStr
: variableName (LPAREN expressionStr (COMMA expressionStr)* RPAREN | COLON COLON variableChildName)*
;
expressionStr
: simpleExpressionStr (relationaloperator expressionStr)?
;
simpleExpressionStr
: termStr (additiveoperator simpleExpressionStr)?
;
termStr
: signedFactorStr (multiplicativeoperator termStr)?
;
signedFactorStr
: (PLUS | MINUS)? factorStr
;
factorStr
: variableStr
| LPAREN expressionStr RPAREN
| functionDesignatorSrt
| unsignedConstantStr
| set//???
| NOT factorStr
;
unsignedConstantStr
: STRING_LITERAL
| CH_NUMBER
| NUL | BEL | BS | HT | LF | VT | FF | CR | SO | SI ESC | SP | DEL | PI
;
functionDesignatorReal
: (ABS | ATN | COS | CVTF_D | EXP | FIX | INT | LOG | LOG10 | SGN | SIN | SQR | SQRT | TAN) LPAREN realExp RPAREN
| (CVT_DF | VAL) LPAREN strExp RPAREN
| (RND)
| DECIMAL LPAREN expression (COMMA intConst COMMA intConst)? RPAREN
| MAG LPAREN expression RPAREN
| (MAX | MIN) LPAREN numExp COMMA numExp (COMMA numExp)* RPAREN
| (MOD) LPAREN numExp COMMA numExp RPAREN
| REAL LPAREN expression (COMMA (SINGLE | DOUBLE | GFLOAT | HFLOAT | SFLOAT | TFLOAT | XFLOAT))? RPAREN
| routineName (LPAREN parameterList RPAREN)?
;
functionDesignatorInt
: (ABS_P | CHR_D | CVT_P_D | DATE_D | DATE4_D | ERT_D | RAD_D | SPACE_D | SWAP_P | TAB | TIME | TIME_D) LPAREN intExp RPAREN
| (ASC | ASCII | CVT_D_P | LEN | VAL_P) LPAREN strExp RPAREN
| (BUFSIZ | CCPOS | ECHO | MAR | MAR_P | NOECHO | RCTRLO) LPAREN chnlExp RPAREN
| (COMP_P) LPAREN strExp COMMA strExp RPAREN
| (CTRLC | ERL | ERR | NUM | NUM2 | RCTRLC | RECOUNT | STATUS | VMSSTATUS)
| (INSTR) LPAREN intExp COMMA strExp COMMA strExp RPAREN
| INTEGER LPAREN expression (COMMA (BYTE | WORD | LONG | QUAD))? RPAREN
| (LBOUND | UBOUND) LPAREN arrayVariableName (COMMA intExp)? RPAREN
| LOC LPAREN (variableName | routineName) RPAREN
| MAGTAPE LPAREN expression COMMA variableName COMMA chnlExp RPAREN
| (POS) LPAREN strExp COMMA strExp COMMA intExp RPAREN
| RMSSTATUS LPAREN chnlExp (COMMA (STATUS | VALUE))? RPAREN
| routineName (LPAREN parameterList RPAREN)?
;
functionDesignatorSrt
: (TRM_D) LPAREN strExp RPAREN
| (FSP_D | GETRFA) LPAREN chnlExp RPAREN
| (DIF_D | SUM_D | XLATE | XLATE_D) LPAREN strExp COMMA strExp RPAREN
| (CVT_D_D | EDIT_D | LEFT | LEFT_D | PLACE_D | RIGHT | RIGHT_D) LPAREN strExp COMMA intExp RPAREN
| (ERN_D)
| (FORMAT_D) LPAREN expression COMMA strExp RPAREN
| INKEY_D LPAREN chnlExp (COMMA WAIT intExp?)? RPAREN
| (MID | MID_D | SEG_D) LPAREN strExp COMMA intExp COMMA intExp RPAREN
| (NUM_D | NUM1_D | STR_D) LPAREN numExp RPAREN
| (PROD_D | QUO_D) LPAREN strExp COMMA strExp COMMA intExp RPAREN
| STRING_D LPAREN intExp COMMA intExp RPAREN
| routineName (LPAREN parameterList RPAREN)?
;
parameterList
: actualParameter? (COMMA actualParameter?)*
;
set
: LPAREN elementList RPAREN
;
elementList
: element (COMMA element)*
|
;
element
: expression (TO expression)?
;
actualParameter
: expression byrefOrByval?
;
variableLex
: lexVar (LPAREN expressionLex (COMMA expressionLex)* RPAREN | COLON COLON lexVar)*
;
expressionLex
: simpleExpressionLex (relationaloperator expressionLex)?
;
simpleExpressionLex
: termLex (additiveoperator simpleExpressionLex)?
;
termLex
: signedFactorLex (multiplicativeoperator termLex)?
;
signedFactorLex
: (PLUS | MINUS)? factorLex
;
factorLex
: variableLex
| directive
| LPAREN expressionLex RPAREN
//| functionDesignator
| unsignedConstantLex
| set
| NOT factorLex
;
unsignedConstantLex
: number
| DEC_NUMBER
| BIN_NUMBER
| HEX_NUMBER
| OCT_NUMBER
| CH_NUMBER
| NUL | BEL | BS | HT | LF | VT | FF | CR | SO | SI ESC | SP | DEL | PI
;
setLex
: LPAREN elementListLex RPAREN
;
elementListLex
: elementLex (COMMA elementLex)*
|
;
elementLex
: expressionLex (TO expressionLex)?
;
//% Statements
statement
: label
| assignmentStatement
| callStatement
| causeErrorStatement
| chainStatement
| changeStatement
| closeStatement
| continueStatement
| dataStatement
| deleteStatement
| exitStatement
| fieldStatement
| findStatement
| freeStatement
| goSubStatement
| gotoStatement
| inputStatement
| inputLineStatement
| iterateStatement
| killStatement
| lsetStatement
| marginStatement
| matInputStatement
| matPrintStatement
| matReadStatement
| midStatement
| moveStatement
| nameAsStatement
| nomarginStatement
| onErrorGoBackStatement
| onErrorGoToBackStatement
| onGoSubToBackStatement
| openStatement
| optionStatement
| printStatement
| putStatement
| randomStatement
| remapStatement
| resetStatement
| restoreStatement
| resumeStatement
| retryStatement
| returnStatement
| rsetStatement
| scratchStatement
| setPromptStatement
| selectCaseStatement
| sleepStatement
| stopStatement
| unlockStatement
| updateStatement
| waitStatement
| whenErrorInStatement
| whenErrorUseStatement
| handlerUseStatement
| ifStatement
| forUnconditionalStatement
| forConditionalStatement
| untilStatement
| whileStatement
| statement ifCondition
| statement forUnconditionalHeader
| statement forConditionalStatementHeader
| statement UNLESS condExp
| statement UNTIL condExp
| statement WHILE condExp
;
remapStatement
: REMAP LPAREN mapName RPAREN remapItem (COMMA remapItem)*
;
remapItem
: variableDescriptionStatement (ASSIGN intExp)?
| FILL (LPAREN repCnt RPAREN)? (ASSIGN intExp)?
| dataType? FILL_P (LPAREN repCnt RPAREN)?
| FILL_D (LPAREN repCnt RPAREN)? (ASSIGN intExp)?
;
assignmentStatement
: LET? (variable (COMMA variable)*) ASSIGN expression
;
callStatement
: CALL routineName byrefOrByval? subroutineParams?
;
subroutineParams
: LPAREN actualParameter (COMMA actualParameter)* RPAREN
;
causeErrorStatement
: CAUSE ERROR NUMBER
;
chainStatement
: CHAIN strExp
;
changeStatement
: CHANGE (arrayVariableName | strExp) TO (stringVariableName | arrayVariableName)
;
closeStatement
: CLOSE SHARP? chnlExp (COMMA chnlExp)*
;
continueStatement
: CONTINUE targetName?
;
dataStatement
: DATA ((NUMBER | STRING_LITERAL | unqStr) (COMMA (NUMBER | STRING_LITERAL | unqStr))*)
;
deleteStatement
: DELETE SHARP chnlExp
;
exitStatement
: EXIT FUNCTION expression
| EXIT SUB
| EXIT DEF expression
| EXIT PROGRAM intExp
| EXIT HANDLER
| EXIT PICTURE
| EXIT targetName
| FUNCTIONEXIT expression
| SUBEXIT
| FNEXIT expression
;
fieldStatement
: FIELD SHARP chnlExp COMMA (intExp AS stringVariableName (COMMA intExp AS stringVariableName)*)
;
findStatement
: (FIND | GET) SHARP chnlExp (COMMA positionClause)? (COMMA lockClause)?
;
positionClause
: RFA rfaExp
| RECORD recExp
| KEY SHARP keyClause
;
lockClause
: ALLOW allowClause (COMMA WAIT intExp?)?
| WAIT intExp?
| REGARDLESS
;
allowClause
: NONE
| READ
| MODIFY
;
keyClause
: intExp relOp expression
;
relOp
: EQ
| GE
| NXEQ
| GT
| NX
;
freeStatement
: FREE SHARP chnlExp
;
goSubStatement
: (GOSUB | GO SUB) targetName
;
gotoStatement
: (GOTO | GO TO) targetName
;
inputStatement
: (INPUT | LINPUT) (SHARP chnlExp COMMA)? (inputArgs ((COMMA | SEMICOLON) inputArgs)*)
;
inputLineStatement
: INPUT LINE (SHARP chnlExp COMMA)? (inputArgs ((COMMA | SEMICOLON) inputArgs)*)
;
inputArgs
: (strConst (COMMA | SEMICOLON))? variableName// | stringVariableName
;
iterateStatement
: ITERATE targetName?
;
killStatement
: KILL fileSpec
;
lsetStatement
: LSET stringVariableName ASSIGN strExp
;
marginStatement
: MARGIN (SHARP chnlExp COMMA)? intExp
;
matInputStatement
: MAT (INPUT | LINPUT) (SHARP chnlExp COMMA)? matInputArray (COMMA matInputArray)* //[ #chnl-exp , ] { array [ ( int-exp1 [, int-exp2 ] ) ] },...
;
matInputArray
: arrayVariableName (LPAREN intExp (COMMA intExp)? RPAREN)?
;
matPrintStatement
: MAT PRINT (SHARP chnlExp COMMA)? matInputArray ((COMMA | SEMICOLON) matInputArray)*
;
matReadStatement
: MAT READ matInputArray (COMMA matInputArray)*
;
midStatement
: (MID | MID_D) LPAREN stringVariableName COMMA intExp (COMMA intExp)? RPAREN ASSIGN strExp //MID[$] ( str-var, int-exp1 [ , int-exp2 ] ) = str-exp
;
moveStatement
: MOVE (TO | FROM) SHARP chnlExp COMMA moveItem (COMMA moveItem)*
;
moveItem
: variableDescriptionStatement (ASSIGN intExp)?
| dataType? FILL (LPAREN repCnt RPAREN)? (ASSIGN intConst)?
| FILL_P (LPAREN repCnt RPAREN)?
| FILL_D (LPAREN repCnt RPAREN)? (ASSIGN intExp)?
;
variableDescriptionStatement
: arrayDescription
| singleVarDescription
;
nameAsStatement
: NAME fileSpec AS fileSpec //file-spec1 AS file-spec2
;
nomarginStatement
: NOMARGIN (SHARP chnlExp)?
;
onErrorGoBackStatement
: (ON ERROR | ONERROR) GO BACK
;
onErrorGoToBackStatement
: (ON ERROR | ONERROR) (GO TO | GOTO) targetName
;
onGoSubToBackStatement
: ON intExp (GOSUB | GO | TO GOTO) targetName (COMMA targetName)* (OTHERWISE targetName)? //ON int-exp GOSUB target ,... [ OTHERWISE target ]
;
openStatement
: OPEN fileSpec (FOR (INPUT | OUTPUT))? AS FILE? SHARP? chnlExp (COMMA openClause)*
;
openClause
: accessSpec
| allowSpec
| BUFFER intExp
| CONTIGUOUS
| DEFAULTNAME fileSpec
| EXTENDSIZE intExp
| FILESIZE intExp
| MAP mapName
| orgSpec
| RECORDSIZE intExp
| recSpec
| TEMPORARY
| UNLOCK EXPLICIT
| USEROPEN routineName//functionName
| WINDOWSIZE intExp
| BLOCKSIZE intExp
| NOREWIND
| NOSPAN
| SPAN
| BUCKETSIZE intExp
| CONNECT chnlExp
| (ALTERNATE | PRIMARY) KEY? keyOpenClause DUPLICATES? CHANGES? (ASCENDING | DESCENDING)?
;
accessSpec
: ACCESS accessMode
;
accessMode
: APPEND| READ | WRITE | MODIFY | SCRATCH
;
allowSpec
: ALLOW allowMode
;
allowMode
: NONE| READ | WRITE | MODIFY
;
orgSpec
: ORGANIZATION? orgMode orgMode2?
;
orgMode
: INDEXED | RELATIVE | SEQUENTIAL | UNDEFINED | VIRTUAL
;
orgMode2
: STREAM | VARIABLE | FIXED
;
recSpec
: RECORDTYPE recMode
;
recMode
: LIST | FORTRAN | NONE | ANY
;
keyOpenClause
: variableName
| LPAREN variableName (COMMA variableName)* RPAREN
;
optionStatement
: OPTION optionClause (COMMA optionClause)*
;
optionClause
: ANGLE ASSIGN angleClause
| HANDLE ASSIGN handleClause
| CONSTANT TYPE ASSIGN constTypeClause
| OLD VERSION ASSIGN CDD
| TYPE ASSIGN typeClause
| SIZE ASSIGN sizeClause
| SCALE ASSIGN intConst
| ACTIVE ASSIGN activeClause
| INACTIVE ASSIGN activeClause
;
angleClause
: DEGREES
| RADIANS
;
handleClause
: BASIC
| SEVERE
| ERROR
| WARNING
| INFORMATIONAL
;
constTypeClause
: INTEGER
| REAL
| DECIMAL
;
typeClause
: INTEGER
| REAL
| EXPLICIT
| DECIMAL
;
sizeClause
: sizItem
| LPAREN sizItem (COMMA sizItem)* RPAREN
;
sizItem
: INTEGER intClause
| REAL realClause
| DECIMAL LPAREN NUMBER COMMA NUMBER RPAREN
;
intClause
: BYTE
| WORD
| LONG
| QUAD
;
realClause
: SINGLE
| DOUBLE
| GFLOAT
| HFLOAT
| SFLOAT
| TFLOAT
| XFLOAT
;
activeClause
: activeItem
| LPAREN activeItem (COMMA activeItem)* RPAREN
;
activeItem
: INTEGER OVERFLOW
| DECIMAL OVERFLOW
| SETUP
| DECIMAL ROUNDING
| SUBSCRIPT CHECKING
;
printStatement
: PRINT (SHARP chnlExp COMMA)? (USING strExp (COMMA | SEMICOLON))? expression? ((COMMA | SEMICOLON) expression?)*
;
putStatement
: PUT SHARP chnlExp (COMMA RECORD recExp)? (COMMA COUNT intExp)?
;
randomStatement
: RANDOMIZE | RANDOM
;
readStatement
: READ variableDescriptionStatement (COMMA variableDescriptionStatement)*
;
resetStatement
: RESET (SHARP chnlExp (COMMA KEY SHARP intExp)?)?
;
restoreStatement
: RESTORE (SHARP chnlExp (COMMA KEY SHARP intExp)?)?
;
resumeStatement
: RESUME targetName?
;
retryStatement
: RETRY
;
returnStatement
: RETURN
;
rsetStatement
: RSET stringVariableName (COMMA stringVariableName)* ASSIGN strExp
;
scratchStatement
: SCRATCH SHARP chnlExp
;
setPromptStatement
: SET NO? PROMPT
;
sleepStatement
: SLEEP intExp
;
stopStatement
: STOP
;
unlockStatement
: UNLOCK SHARP chnlExp
;
updateStatement
: UPDATE SHARP chnlExp (COMMA COUNT intExp)?
;
waitStatement
: WAIT intExp
;
whenErrorInStatement
: WHEN ERROR IN eol
(statement? eol)+
USE eol
(statement? eol)+
END WHEN
;
whenErrorUseStatement
: WHEN ERROR USE handlerName eol
(statement? eol)+
END WHEN
;
handlerUseStatement
: HANDLER handlerName eol
(statement? eol)+
END HANDLER
;
ifStatement
: ifCondition eol? THEN eol
subScope
elsifClause*
elseClause?
END IF
;
ifCondition
: IF condExp
;
ifStatementModifier
: statement ifCondition
;
elsifClause
: ELSE ifCondition eol? THEN eol
subScope
;
elseClause
: ELSE eol
subScope
;
forUnconditionalStatement
: forUnconditionalHeader eol
subScope
NEXT variableName
;
forConditionalStatement
: forConditionalStatementHeader eol
subScope
NEXT variableName
;
forUnconditionalHeader
: FOR variableName ASSIGN numExp TO numExp stepClause?
;
forConditionalStatementHeader
: FOR variableName ASSIGN numExp stepClause? (WHILE | UNTIL) condExp
;
stepClause
: STEP numExp
;
selectCaseStatement
: SELECT expression eol
caseAlternative*
lastCaseAlternative?
END SELECT
;
caseAlternative
: eol*
CASE (caseExpn (COMMA caseExpn)*) eol
subScope?
;
caseExpn
: relationaloperator? expression
| expression toExpn (COMMA expression toExpn)*
;
toExpn
: TO expression
;
lastCaseAlternative
: eol*
CASE ELSE eol
subScope
;
untilStatement
: UNTIL condExp eol
subScope?
NEXT
;
whileStatement
: WHILE condExp eol
subScope?
NEXT
;
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_851.asm | ljhsiun2/medusa | 9 | 22560 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r14
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x14f3a, %rax
and $15776, %r10
movb $0x61, (%rax)
nop
nop
nop
nop
nop
dec %r13
lea addresses_WT_ht+0x1aa3a, %rsi
lea addresses_A_ht+0x150b2, %rdi
nop
xor $59795, %r14
mov $78, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp $58520, %r13
lea addresses_UC_ht+0x1c8ba, %rsi
lea addresses_UC_ht+0x1c33a, %rdi
nop
nop
nop
nop
inc %r13
mov $62, %rcx
rep movsq
nop
nop
add $63958, %r14
lea addresses_WT_ht+0x1961a, %r10
nop
nop
nop
nop
xor $1959, %rcx
movl $0x61626364, (%r10)
cmp $31364, %rdi
lea addresses_UC_ht+0x1b3a, %r14
and %rax, %rax
movups (%r14), %xmm2
vpextrq $0, %xmm2, %rsi
nop
sub $33771, %rsi
lea addresses_D_ht+0xff3a, %rsi
lea addresses_UC_ht+0x1673a, %rdi
nop
and %rbx, %rbx
mov $83, %rcx
rep movsw
add $53667, %rdi
lea addresses_D_ht+0x973a, %rsi
lea addresses_WC_ht+0x1cb3a, %rdi
and $25455, %r13
mov $54, %rcx
rep movsl
nop
sub $61191, %rcx
lea addresses_normal_ht+0xb93a, %rsi
lea addresses_WT_ht+0x1eefa, %rdi
nop
inc %r13
mov $60, %rcx
rep movsb
cmp %rsi, %rsi
lea addresses_UC_ht+0x1673a, %rsi
nop
nop
nop
nop
nop
add $37221, %r10
movb (%rsi), %r14b
add %rax, %rax
lea addresses_UC_ht+0xb91a, %rsi
lea addresses_UC_ht+0x1573a, %rdi
clflush (%rdi)
sub $11742, %r13
mov $122, %rcx
rep movsl
nop
nop
cmp %rdi, %rdi
lea addresses_D_ht+0x1679a, %rbx
nop
nop
nop
nop
xor %r14, %r14
movups (%rbx), %xmm6
vpextrq $0, %xmm6, %r10
nop
and %r13, %r13
lea addresses_normal_ht+0x8b3a, %rsi
lea addresses_normal_ht+0x1d13a, %rdi
clflush (%rsi)
clflush (%rdi)
nop
xor $10180, %rbx
mov $108, %rcx
rep movsw
nop
nop
nop
xor $24316, %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r9
push %rax
push %rdx
push %rsi
// Load
mov $0x9ca, %r14
and %r13, %r13
mov (%r14), %r12w
nop
sub $59267, %r9
// Store
lea addresses_normal+0x1f3a, %rdx
nop
cmp $59939, %r9
movw $0x5152, (%rdx)
nop
nop
nop
add $38080, %rsi
// Store
mov $0x5cb41a000000033a, %r9
clflush (%r9)
nop
nop
nop
nop
inc %rax
mov $0x5152535455565758, %r14
movq %r14, %xmm3
movups %xmm3, (%r9)
nop
nop
nop
sub %r14, %r14
// Store
lea addresses_A+0x1ed40, %rax
nop
and $20017, %r12
movb $0x51, (%rax)
nop
nop
nop
nop
dec %r13
// Load
lea addresses_RW+0xc23a, %r14
nop
nop
nop
nop
nop
dec %r13
mov (%r14), %r9d
nop
nop
nop
sub %r9, %r9
// Store
mov $0xb0c, %rax
add $61022, %r9
movl $0x51525354, (%rax)
inc %r13
// Faulty Load
lea addresses_UC+0x1b3a, %rdx
add %r13, %r13
mov (%rdx), %si
lea oracles, %rax
and $0xff, %rsi
shlq $12, %rsi
mov (%rax,%rsi,1), %rsi
pop %rsi
pop %rdx
pop %rax
pop %r9
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_P'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_NC'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A'}}
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_P'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 4, 'same': True, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': True, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
source/league/matreshka-internals-strings-handlers-portable__32.adb | svn2github/matreshka | 24 | 845 | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2011, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Interfaces;
with Matreshka.Internals.Strings.Constants;
package body Matreshka.Internals.Strings.Handlers.Portable is
use Interfaces;
use Matreshka.Internals.Unicode;
use Matreshka.Internals.Utf16;
type Unsigned_32_Unrestricted_Array is
array (Utf16_String_Index) of Unsigned_32;
--------------------------
-- Fill_Null_Terminator --
--------------------------
overriding procedure Fill_Null_Terminator
(Self : Portable_String_Handler;
Item : not null Shared_String_Access)
is
pragma Unreferenced (Self);
use Matreshka.Internals.Strings.Constants;
pragma Suppress (Access_Check);
-- Suppress not null check of Self which is generated by compiler; but
-- not needed actually.
pragma Suppress (Alignment_Check);
-- Suppress alignment check of Value below which is generated because of
-- bug in the GNAT GPL 2010 compiler.
SV : Unsigned_32_Unrestricted_Array;
for SV'Address use Item.Value'Address;
Index : constant Utf16_String_Index := Item.Unused / 2;
Offset : constant Utf16_String_Index := Item.Unused mod 2;
begin
SV (Index) := SV (Index) and Terminator_Mask_32 (Offset);
end Fill_Null_Terminator;
--------------
-- Is_Equal --
--------------
overriding function Is_Equal
(Self : Portable_String_Handler;
Left : not null Shared_String_Access;
Right : not null Shared_String_Access) return Boolean
is
pragma Unreferenced (Self);
pragma Suppress (Access_Check);
pragma Suppress (Alignment_Check);
begin
if Left = Right then
return True;
end if;
if Left.Unused /= Right.Unused then
return False;
end if;
declare
LV : Unsigned_32_Unrestricted_Array;
for LV'Address use Left.Value'Address;
RV : Unsigned_32_Unrestricted_Array;
for RV'Address use Right.Value'Address;
Last : constant Utf16_String_Index := Left.Unused / 2;
begin
for J in 0 .. Last loop
if LV (J) /= RV (J) then
return False;
end if;
end loop;
end;
return True;
end Is_Equal;
----------------
-- Is_Greater --
----------------
overriding function Is_Greater
(Self : Portable_String_Handler;
Left : not null Shared_String_Access;
Right : not null Shared_String_Access) return Boolean
is
pragma Unreferenced (Self);
pragma Suppress (Access_Check);
pragma Suppress (Alignment_Check);
pragma Suppress (Index_Check);
begin
if Left = Right then
return False;
end if;
declare
Last : constant Utf16_String_Index
:= Utf16_String_Index'Min (Left.Unused, Right.Unused) / 2;
LV : Unsigned_32_Unrestricted_Array;
for LV'Address use Left.Value'Address;
RV : Unsigned_32_Unrestricted_Array;
for RV'Address use Right.Value'Address;
begin
for J in 0 .. Last loop
if LV (J) /= RV (J) then
if Left.Value (J * 2) /= Right.Value (J * 2) then
return Is_Greater (Left.Value (J * 2), Right.Value (J * 2));
else
return
Is_Greater
(Left.Value (J * 2 + 1), Right.Value (J * 2 + 1));
end if;
end if;
end loop;
end;
return Left.Unused > Right.Unused;
end Is_Greater;
-------------------------
-- Is_Greater_Or_Equal --
-------------------------
overriding function Is_Greater_Or_Equal
(Self : Portable_String_Handler;
Left : not null Shared_String_Access;
Right : not null Shared_String_Access) return Boolean
is
pragma Unreferenced (Self);
pragma Suppress (Access_Check);
pragma Suppress (Alignment_Check);
pragma Suppress (Index_Check);
begin
if Left = Right then
return True;
end if;
declare
Last : constant Utf16_String_Index
:= Utf16_String_Index'Min (Left.Unused, Right.Unused) / 2;
LV : Unsigned_32_Unrestricted_Array;
for LV'Address use Left.Value'Address;
RV : Unsigned_32_Unrestricted_Array;
for RV'Address use Right.Value'Address;
begin
for J in 0 .. Last loop
if LV (J) /= RV (J) then
if Left.Value (J * 2) /= Right.Value (J * 2) then
return Is_Greater (Left.Value (J * 2), Right.Value (J * 2));
else
return
Is_Greater
(Left.Value (J * 2 + 1), Right.Value (J * 2 + 1));
end if;
end if;
end loop;
end;
return Left.Unused >= Right.Unused;
end Is_Greater_Or_Equal;
-------------
-- Is_Less --
-------------
overriding function Is_Less
(Self : Portable_String_Handler;
Left : not null Shared_String_Access;
Right : not null Shared_String_Access) return Boolean
is
pragma Unreferenced (Self);
pragma Suppress (Access_Check);
pragma Suppress (Alignment_Check);
pragma Suppress (Index_Check);
begin
if Left = Right then
return False;
end if;
declare
Last : constant Utf16_String_Index
:= Utf16_String_Index'Min (Left.Unused, Right.Unused) / 2;
LV : Unsigned_32_Unrestricted_Array;
for LV'Address use Left.Value'Address;
RV : Unsigned_32_Unrestricted_Array;
for RV'Address use Right.Value'Address;
begin
for J in 0 .. Last loop
if LV (J) /= RV (J) then
if Left.Value (J * 2) /= Right.Value (J * 2) then
return Is_Less (Left.Value (J * 2), Right.Value (J * 2));
else
return
Is_Less (Left.Value (J * 2 + 1), Right.Value (J * 2 + 1));
end if;
end if;
end loop;
end;
return Left.Unused < Right.Unused;
end Is_Less;
----------------------
-- Is_Less_Or_Equal --
----------------------
overriding function Is_Less_Or_Equal
(Self : Portable_String_Handler;
Left : not null Shared_String_Access;
Right : not null Shared_String_Access) return Boolean
is
pragma Unreferenced (Self);
pragma Suppress (Access_Check);
pragma Suppress (Alignment_Check);
pragma Suppress (Index_Check);
begin
if Left = Right then
return True;
end if;
declare
Last : constant Utf16_String_Index
:= Utf16_String_Index'Min (Left.Unused, Right.Unused) / 2;
LV : Unsigned_32_Unrestricted_Array;
for LV'Address use Left.Value'Address;
RV : Unsigned_32_Unrestricted_Array;
for RV'Address use Right.Value'Address;
begin
for J in 0 .. Last loop
if LV (J) /= RV (J) then
if Left.Value (J * 2) /= Right.Value (J * 2) then
return Is_Less (Left.Value (J * 2), Right.Value (J * 2));
else
return
Is_Less (Left.Value (J * 2 + 1), Right.Value (J * 2 + 1));
end if;
end if;
end loop;
end;
return Left.Unused <= Right.Unused;
end Is_Less_Or_Equal;
end Matreshka.Internals.Strings.Handlers.Portable;
|
asm_patches/includes/skip_intro.asm | robertkirkman/WW_Hacking_API | 5 | 170151 |
; nop out a couple lines so the long intro movie is skipped.
.open "sys/main.dol"
.org 0x80232C78
nop
.org 0x80232C88
nop
.close
|
agda-stdlib/src/Algebra/Properties/Group.agda | DreamLinuxer/popl21-artifact | 5 | 12402 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- Some derivable properties
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Algebra.Bundles
module Algebra.Properties.Group {g₁ g₂} (G : Group g₁ g₂) where
open Group G
open import Algebra.Definitions _≈_
open import Relation.Binary.Reasoning.Setoid setoid
open import Function
open import Data.Product
ε⁻¹≈ε : ε ⁻¹ ≈ ε
ε⁻¹≈ε = begin
ε ⁻¹ ≈⟨ sym $ identityʳ (ε ⁻¹) ⟩
ε ⁻¹ ∙ ε ≈⟨ inverseˡ ε ⟩
ε ∎
private
left-helper : ∀ x y → x ≈ (x ∙ y) ∙ y ⁻¹
left-helper x y = begin
x ≈⟨ sym (identityʳ x) ⟩
x ∙ ε ≈⟨ ∙-congˡ $ sym (inverseʳ y) ⟩
x ∙ (y ∙ y ⁻¹) ≈⟨ sym (assoc x y (y ⁻¹)) ⟩
(x ∙ y) ∙ y ⁻¹ ∎
right-helper : ∀ x y → y ≈ x ⁻¹ ∙ (x ∙ y)
right-helper x y = begin
y ≈⟨ sym (identityˡ y) ⟩
ε ∙ y ≈⟨ ∙-congʳ $ sym (inverseˡ x) ⟩
(x ⁻¹ ∙ x) ∙ y ≈⟨ assoc (x ⁻¹) x y ⟩
x ⁻¹ ∙ (x ∙ y) ∎
∙-cancelˡ : LeftCancellative _∙_
∙-cancelˡ x {y} {z} eq = begin
y ≈⟨ right-helper x y ⟩
x ⁻¹ ∙ (x ∙ y) ≈⟨ ∙-congˡ eq ⟩
x ⁻¹ ∙ (x ∙ z) ≈˘⟨ right-helper x z ⟩
z ∎
∙-cancelʳ : RightCancellative _∙_
∙-cancelʳ {x} y z eq = begin
y ≈⟨ left-helper y x ⟩
y ∙ x ∙ x ⁻¹ ≈⟨ ∙-congʳ eq ⟩
z ∙ x ∙ x ⁻¹ ≈˘⟨ left-helper z x ⟩
z ∎
∙-cancel : Cancellative _∙_
∙-cancel = ∙-cancelˡ , ∙-cancelʳ
⁻¹-involutive : ∀ x → x ⁻¹ ⁻¹ ≈ x
⁻¹-involutive x = begin
x ⁻¹ ⁻¹ ≈˘⟨ identityʳ _ ⟩
x ⁻¹ ⁻¹ ∙ ε ≈˘⟨ ∙-congˡ $ inverseˡ _ ⟩
x ⁻¹ ⁻¹ ∙ (x ⁻¹ ∙ x) ≈˘⟨ right-helper (x ⁻¹) x ⟩
x ∎
⁻¹-injective : ∀ {x y} → x ⁻¹ ≈ y ⁻¹ → x ≈ y
⁻¹-injective {x} {y} eq = ∙-cancelʳ x y ( begin
x ∙ x ⁻¹ ≈⟨ inverseʳ x ⟩
ε ≈˘⟨ inverseʳ y ⟩
y ∙ y ⁻¹ ≈˘⟨ ∙-congˡ eq ⟩
y ∙ x ⁻¹ ∎ )
⁻¹-anti-homo-∙ : ∀ x y → (x ∙ y) ⁻¹ ≈ y ⁻¹ ∙ x ⁻¹
⁻¹-anti-homo-∙ x y = ∙-cancelˡ _ ( begin
x ∙ y ∙ (x ∙ y) ⁻¹ ≈⟨ inverseʳ _ ⟩
ε ≈˘⟨ inverseʳ _ ⟩
x ∙ x ⁻¹ ≈⟨ ∙-congʳ (left-helper x y) ⟩
(x ∙ y) ∙ y ⁻¹ ∙ x ⁻¹ ≈⟨ assoc (x ∙ y) (y ⁻¹) (x ⁻¹) ⟩
x ∙ y ∙ (y ⁻¹ ∙ x ⁻¹) ∎ )
identityˡ-unique : ∀ x y → x ∙ y ≈ y → x ≈ ε
identityˡ-unique x y eq = begin
x ≈⟨ left-helper x y ⟩
(x ∙ y) ∙ y ⁻¹ ≈⟨ ∙-congʳ eq ⟩
y ∙ y ⁻¹ ≈⟨ inverseʳ y ⟩
ε ∎
identityʳ-unique : ∀ x y → x ∙ y ≈ x → y ≈ ε
identityʳ-unique x y eq = begin
y ≈⟨ right-helper x y ⟩
x ⁻¹ ∙ (x ∙ y) ≈⟨ refl ⟨ ∙-cong ⟩ eq ⟩
x ⁻¹ ∙ x ≈⟨ inverseˡ x ⟩
ε ∎
identity-unique : ∀ {x} → Identity x _∙_ → x ≈ ε
identity-unique {x} id = identityˡ-unique x x (proj₂ id x)
inverseˡ-unique : ∀ x y → x ∙ y ≈ ε → x ≈ y ⁻¹
inverseˡ-unique x y eq = begin
x ≈⟨ left-helper x y ⟩
(x ∙ y) ∙ y ⁻¹ ≈⟨ ∙-congʳ eq ⟩
ε ∙ y ⁻¹ ≈⟨ identityˡ (y ⁻¹) ⟩
y ⁻¹ ∎
inverseʳ-unique : ∀ x y → x ∙ y ≈ ε → y ≈ x ⁻¹
inverseʳ-unique x y eq = begin
y ≈⟨ sym (⁻¹-involutive y) ⟩
y ⁻¹ ⁻¹ ≈⟨ ⁻¹-cong (sym (inverseˡ-unique x y eq)) ⟩
x ⁻¹ ∎
------------------------------------------------------------------------
-- DEPRECATED NAMES
------------------------------------------------------------------------
-- Please use the new names as continuing support for the old names is
-- not guaranteed.
-- Version 1.1
left-identity-unique = identityˡ-unique
{-# WARNING_ON_USAGE left-identity-unique
"Warning: left-identity-unique was deprecated in v1.1.
Please use identityˡ-unique instead."
#-}
right-identity-unique = identityʳ-unique
{-# WARNING_ON_USAGE right-identity-unique
"Warning: right-identity-unique was deprecated in v1.1.
Please use identityʳ-unique instead."
#-}
left-inverse-unique = inverseˡ-unique
{-# WARNING_ON_USAGE left-inverse-unique
"Warning: left-inverse-unique was deprecated in v1.1.
Please use inverseˡ-unique instead."
#-}
right-inverse-unique = inverseʳ-unique
{-# WARNING_ON_USAGE right-inverse-unique
"Warning: right-inverse-unique was deprecated in v1.1.
Please use inverseʳ-unique instead."
#-}
|
third_party/virtualbox/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSendCmdWithU32.asm | Fimbure/icebox-1 | 521 | 81774 | <filename>third_party/virtualbox/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TestSendCmdWithU32.asm
; $Id: bs3-cmn-TestSendCmdWithU32.asm $
;; @file
; BS3Kit - bs3TestSendCmdWithU32.
;
;
; Copyright (C) 2007-2017 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; The contents of this file may alternatively be used under the terms
; of the Common Development and Distribution License Version 1.0
; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
; VirtualBox OSE distribution, in which case the provisions of the
; CDDL are applicable instead of those of the GPL.
;
; You may elect to license modified versions of this file under the
; terms and conditions of either the GPL or the CDDL or both.
;
%include "bs3kit-template-header.mac"
%include "VBox/VMMDevTesting.mac"
BS3_EXTERN_DATA16 g_fbBs3VMMDevTesting
TMPL_BEGIN_TEXT
;;
; @cproto BS3_DECL(void) bs3TestSendCmdWithU32_c16(uint32_t uCmd, uint32_t uValue);
;
BS3_PROC_BEGIN_CMN bs3TestSendCmdWithU32, BS3_PBC_HYBRID
BS3_CALL_CONV_PROLOG 2
push xBP
mov xBP, xSP
push xAX
push xDX
push xSI
cmp byte [BS3_DATA16_WRT(g_fbBs3VMMDevTesting)], 0
je .no_vmmdev
; The command (uCmd) -
mov dx, VMMDEV_TESTING_IOPORT_CMD
%if TMPL_BITS == 16
mov ax, [xBP + xCB + cbCurRetAddr] ; We ignore the top bits in 16-bit mode.
out dx, ax
%else
mov eax, [xBP + xCB*2]
out dx, eax
%endif
; The value (uValue).
mov dx, VMMDEV_TESTING_IOPORT_DATA
%if TMPL_BITS == 16
mov ax, [xBP + xCB + cbCurRetAddr + sCB]
out dx, ax
mov ax, [xBP + xCB + cbCurRetAddr + sCB + 2]
out dx, ax
%else
mov eax, [xBP + xCB*2 + sCB]
out dx, eax
%endif
.no_vmmdev:
pop xSI
pop xDX
pop xAX
pop xBP
BS3_CALL_CONV_EPILOG 2
BS3_HYBRID_RET
BS3_PROC_END_CMN bs3TestSendCmdWithU32
|
oeis/256/A256971.asm | neoneye/loda-programs | 11 | 103178 | <reponame>neoneye/loda-programs
; A256971: Partial sums of A256970.
; Submitted by <NAME>(s3)
; 5,22,59,64,165,170,367,624,629,1030,1035,1612,2289,2294,2311,2316,2329,3626,3631,5232,5237,5250,5279,5284,5325,5330,8247,11384,11389,11402,11407,11424,15781,15786,15799,15804,21281,21334,21339,21376,21381,28438,28451,28456,36557,36562,45399,45412,45417,45490,45495,45524,45541,45546,57647,57652,57693,71150,71155,85556,85561,100938,116815,116820,133721,133726,151683,151736,151741,151758,151763,151852,173169,173174,195675,195680,195717,220054,220059,245660,245665,245678,245695,245700,274601,274606
mov $2,$0
mov $4,$0
lpb $2
mov $0,$4
sub $2,1
sub $0,$2
seq $0,256970 ; Smallest prime divisor of 4*n^2+1.
mov $5,$0
add $5,$0
mov $0,$5
sub $0,10
div $0,2
add $0,5
add $3,$0
lpe
mov $0,$3
add $0,5
|
src/firmware/Platform/Lcd/Registers.asm | pete-restall/Cluck2Sesame-Prototype | 1 | 97813 | <filename>src/firmware/Platform/Lcd/Registers.asm
#include "Platform.inc"
radix decimal
LcdRam udata
global lcdContrast
global enableLcdCount
global lcdFlags
global lcdWorkingRegister
global lcdState
global lcdStateParameter0
global lcdStateParameter1
global lcdNextState
global flashPointerMsb
global flashPointerLsb
global numberOfCharactersRemaining
global characters
lcdContrast res 1
enableLcdCount res 1
lcdFlags res 1
lcdWorkingRegister res 1
lcdState res 1
lcdStateParameter0 res 1
lcdStateParameter1 res 1
lcdNextState res 1
flashPointerMsb res 1
flashPointerLsb res 1
numberOfCharactersRemaining res 1
characters res 2
end
|
Assembler/AssemblyCode/TTL/JZ1.asm | KPU-RISC/KPU | 8 | 246381 | :START
MOV E, 10110111b
MOV D, 01001001b
ADD E, D
; Conditional Jump if the Zero-Flag from the ALU is 1
JMP :START |
test/error_missing_data_section.asm | yurirocha15/sbTradutor | 0 | 174381 | SECTION TEXT
; Erro por não ter declarado SECTION DATA |
src/applescript/sleep.applescript | slashjs/screenmate | 4 | 1256 | <filename>src/applescript/sleep.applescript<gh_stars>1-10
tell application "Finder" to sleep
|
Lab1/code/bochs/boot.asm | Software-Knowledge/2020-OS-Lab | 0 | 88826 | <gh_stars>0
org 07c00h
mov ax, cs
mov ds, ax
mov es, ax
call DispStr
jmp $
DispStr:
mov ax, BootMessage
mov bp, ax
mov cx, 16
mov ax, 01301h
mov bx, 000ch
mov dl, 0
int 10h
ret
BootMessage: db "Hello OS"
times 510 - ($-$$) db 0
dw 0xaa55
|
Transynther/x86/_processed/NC/_zr_un_/i3-7100_9_0x84_notsx.log_55_2529.asm | ljhsiun2/medusa | 9 | 241199 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r15
push %r9
push %rdi
lea addresses_normal_ht+0x8ec7, %r15
nop
nop
nop
inc %r9
mov (%r15), %edi
nop
nop
nop
cmp $55308, %r13
pop %rdi
pop %r9
pop %r15
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r15
push %rax
push %rcx
push %rdi
// Faulty Load
mov $0x7825ef0000000423, %r13
dec %rax
vmovups (%r13), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rdi
lea oracles, %r10
and $0xff, %rdi
shlq $12, %rdi
mov (%r10,%rdi,1), %rdi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_NC', 'same': False, 'size': 1, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_NC', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'60': 23, '00': 8, '96': 23, '06': 1}
06 00 00 96 96 60 60 60 96 96 96 60 60 96 00 00 60 60 60 60 60 96 96 96 60 60 00 60 96 96 60 96 60 60 96 60 96 60 60 96 96 00 00 96 96 60 96 60 96 96 96 00 60 96 60
*/
|
Data/Tuple/Category.agda | Lolirofle/stuff-in-agda | 6 | 6089 | module Data.Tuple.Category where
import Lvl
open import Data.Tuple as Tuple using (_⨯_ ; _,_)
open import Data.Tuple.Equivalence
import Functional as Fn
open import Logic.Propositional
open import Logic.Predicate
open import Structure.Category
open import Structure.Category.Functor
open import Structure.Category.Functor.Functors
open import Structure.Categorical.Properties
open import Structure.Function
open import Structure.Operator
open import Structure.Relator.Equivalence
open import Structure.Relator.Properties
open import Structure.Setoid
open import Syntax.Transitivity
open import Type
private variable ℓ ℓₒ ℓₘ ℓₑ ℓₒ₁ ℓₘ₁ ℓₑ₁ ℓₒ₂ ℓₘ₂ ℓₑ₂ : Lvl.Level
private variable Obj Obj₁ Obj₂ Obj₁ₗ Obj₁ᵣ Obj₂ₗ Obj₂ᵣ : Type{ℓ}
private variable Morphism Morphism₁ Morphism₂ Morphism₁ₗ Morphism₂ₗ Morphism₁ᵣ Morphism₂ᵣ : Obj → Obj → Type{ℓ}
private variable ⦃ morphism-equiv morphism-equiv₁ morphism-equiv₂ morphism-equiv₁ₗ morphism-equiv₂ₗ morphism-equiv₁ᵣ morphism-equiv₂ᵣ ⦄ : ∀{x y : Obj} → Equiv{ℓₑ}(Morphism x y)
private variable F F₁ F₂ : Obj₁ → Obj₂
private variable C Cₗ Cᵣ C₁ₗ C₁ᵣ C₂ₗ C₂ᵣ C₁ C₂ C₃ : CategoryObject{ℓₒ}{ℓₘ}{ℓₑ}
module _
(cat₁ : Category{Obj = Obj₁} (Morphism₁) ⦃ \{x y} → morphism-equiv₁{x}{y} ⦄)
(cat₂ : Category{Obj = Obj₂} (Morphism₂) ⦃ \{x y} → morphism-equiv₂{x}{y} ⦄)
where
open Category ⦃ … ⦄
private instance _ = cat₁
private instance _ = cat₂
productCategory : Category{Obj = Obj₁ ⨯ Obj₂} (\{(x₁ , x₂) (y₁ , y₂) → (Morphism₁ x₁ y₁) ⨯ (Morphism₂ x₂ y₂)})
Category._∘_ productCategory (f₁ , f₂) (g₁ , g₂) = ((f₁ ∘ g₁) , (f₂ ∘ g₂))
Category.id productCategory = (id , id)
_⨯_.left (BinaryOperator.congruence (Category.binaryOperator productCategory) (p₁l , p₁r) (p₂l , p₂r)) = congruence₂(_∘_) p₁l p₂l
_⨯_.right (BinaryOperator.congruence (Category.binaryOperator productCategory) (p₁l , p₁r) (p₂l , p₂r)) = congruence₂(_∘_) p₁r p₂r
_⨯_.left (Morphism.Associativity.proof (Category.associativity productCategory)) = Morphism.associativity(_∘_)
_⨯_.right (Morphism.Associativity.proof (Category.associativity productCategory)) = Morphism.associativity(_∘_)
_⨯_.left (Morphism.Identityₗ.proof (_⨯_.left (Category.identity productCategory))) = Morphism.identityₗ(_∘_)(id)
_⨯_.right (Morphism.Identityₗ.proof (_⨯_.left (Category.identity productCategory))) = Morphism.identityₗ(_∘_)(id)
_⨯_.left (Morphism.Identityᵣ.proof (_⨯_.right (Category.identity productCategory))) = Morphism.identityᵣ(_∘_)(id)
_⨯_.right (Morphism.Identityᵣ.proof (_⨯_.right (Category.identity productCategory))) = Morphism.identityᵣ(_∘_)(id)
_⨯ᶜᵃᵗ_ : CategoryObject{ℓₒ₁}{ℓₘ₁}{ℓₑ₁} → CategoryObject{ℓₒ₂}{ℓₘ₂}{ℓₑ₂} → CategoryObject
(intro C₁) ⨯ᶜᵃᵗ (intro C₂) = intro (productCategory C₁ C₂)
module Tupleᶜᵃᵗ where
open CategoryObject ⦃ … ⦄
open Functor ⦃ … ⦄ renaming (map to fmap)
private open module CategoryObjectEquiv {ℓₒ ℓₘ ℓₑ} ⦃ C : CategoryObject{ℓₒ}{ℓₘ}{ℓₑ} ⦄ {x}{y} = Equivalence (Equiv-equivalence ⦃ CategoryObject.morphism-equiv(C){x}{y} ⦄) using ()
private open module CategoryObjectCategory {ℓₒ ℓₘ ℓₑ} ⦃ C : CategoryObject{ℓₒ}{ℓₘ}{ℓₑ} ⦄ = Category(category ⦃ C ⦄)
open Structure.Category.Functor.Functors.Wrapped
map : (C₁ₗ →ᶠᵘⁿᶜᵗᵒʳ C₁ᵣ) → (C₂ₗ →ᶠᵘⁿᶜᵗᵒʳ C₂ᵣ) → ((C₁ₗ ⨯ᶜᵃᵗ C₂ₗ) →ᶠᵘⁿᶜᵗᵒʳ (C₁ᵣ ⨯ᶜᵃᵗ C₂ᵣ))
map {C₁ₗ = C₁ₗ} {C₁ᵣ = C₁ᵣ} {C₂ₗ = C₂ₗ} {C₂ᵣ = C₂ᵣ} ([∃]-intro F₁ ⦃ functor₁ ⦄) ([∃]-intro F₂ ⦃ functor₂ ⦄) = [∃]-intro _ ⦃ productMapFunctor ⦄ where
instance _ = C₁ₗ ; instance _ = C₁ᵣ ; instance _ = C₂ₗ ; instance _ = C₂ᵣ
instance _ = C₁ₗ ⨯ᶜᵃᵗ C₂ₗ ; instance _ = C₁ᵣ ⨯ᶜᵃᵗ C₂ᵣ
productMapFunctor : Functor(productCategory (category ⦃ C₁ₗ ⦄) (category ⦃ C₂ₗ ⦄))(productCategory (category ⦃ C₁ᵣ ⦄) (category ⦃ C₂ᵣ ⦄)) (Tuple.map F₁ F₂)
Functor.map productMapFunctor = Tuple.map fmap fmap
Tuple.left (Functor.op-preserving productMapFunctor) = op-preserving
Tuple.right (Functor.op-preserving productMapFunctor) = op-preserving
Tuple.left (Functor.id-preserving productMapFunctor) = id-preserving
Tuple.right (Functor.id-preserving productMapFunctor) = id-preserving
mapLeft : (C₁ₗ →ᶠᵘⁿᶜᵗᵒʳ C₁ᵣ) → ((C₁ₗ ⨯ᶜᵃᵗ C₂) →ᶠᵘⁿᶜᵗᵒʳ (C₁ᵣ ⨯ᶜᵃᵗ C₂))
mapLeft F = map F idᶠᵘⁿᶜᵗᵒʳ
mapRight : (C₂ₗ →ᶠᵘⁿᶜᵗᵒʳ C₂ᵣ) → ((C₁ ⨯ᶜᵃᵗ C₂ₗ) →ᶠᵘⁿᶜᵗᵒʳ (C₁ ⨯ᶜᵃᵗ C₂ᵣ))
mapRight F = map idᶠᵘⁿᶜᵗᵒʳ F
left : ((Cₗ ⨯ᶜᵃᵗ Cᵣ) →ᶠᵘⁿᶜᵗᵒʳ Cₗ)
∃.witness left = Tuple.left
Functor.map (∃.proof left) = Tuple.left
Functor.op-preserving (∃.proof (left {Cₗ = Cₗ} {Cᵣ = Cᵣ})) {f = (fₗ , fᵣ)} {g = (gₗ , gᵣ)} =
Tuple.left ((fₗ , fᵣ) ∘ (gₗ , gᵣ)) 🝖[ _≡_ ]-[]
Tuple.left ((fₗ ∘ gₗ) , (fᵣ ∘ gᵣ)) 🝖[ _≡_ ]-[]
fₗ ∘ gₗ 🝖[ _≡_ ]-[]
Tuple.left(fₗ , fᵣ) ∘ Tuple.left(gₗ , gᵣ) 🝖-end
where instance _ = Cₗ ; instance _ = Cᵣ ; instance _ = Cₗ ⨯ᶜᵃᵗ Cᵣ
Functor.id-preserving (∃.proof (left {Cₗ = Cₗ} {Cᵣ = Cᵣ})) {x , y} =
Tuple.left (id ⦃ Cₗ ⨯ᶜᵃᵗ Cᵣ ⦄ {x , y}) 🝖[ _≡_ ]-[]
Tuple.left (id ⦃ Cₗ ⦄ {x} , id ⦃ Cᵣ ⦄ {y}) 🝖[ _≡_ ]-[]
id ⦃ Cₗ ⦄ {x} 🝖-end
where instance _ = Cₗ ; instance _ = Cᵣ ; instance _ = Cₗ ⨯ᶜᵃᵗ Cᵣ
right : ((Cₗ ⨯ᶜᵃᵗ Cᵣ) →ᶠᵘⁿᶜᵗᵒʳ Cᵣ)
∃.witness right = Tuple.right
Functor.map (∃.proof right) = Tuple.right
Functor.op-preserving (∃.proof (right {Cₗ = Cₗ} {Cᵣ = Cᵣ})) {f = (fₗ , fᵣ)} {g = (gₗ , gᵣ)} =
Tuple.right ((fₗ , fᵣ) ∘ (gₗ , gᵣ)) 🝖[ _≡_ ]-[]
Tuple.right ((fₗ ∘ gₗ) , (fᵣ ∘ gᵣ)) 🝖[ _≡_ ]-[]
fᵣ ∘ gᵣ 🝖[ _≡_ ]-[]
Tuple.right(fₗ , fᵣ) ∘ Tuple.right(gₗ , gᵣ) 🝖-end
where instance _ = Cₗ ; instance _ = Cᵣ ; instance _ = Cₗ ⨯ᶜᵃᵗ Cᵣ
Functor.id-preserving (∃.proof (right {Cₗ = Cₗ} {Cᵣ = Cᵣ})) {x , y} =
Tuple.right (id ⦃ Cₗ ⨯ᶜᵃᵗ Cᵣ ⦄ {x , y}) 🝖[ _≡_ ]-[]
Tuple.right (id ⦃ Cₗ ⦄ {x} , id ⦃ Cᵣ ⦄ {y}) 🝖[ _≡_ ]-[]
id ⦃ Cᵣ ⦄ {y} 🝖-end
where instance _ = Cₗ ; instance _ = Cᵣ ; instance _ = Cₗ ⨯ᶜᵃᵗ Cᵣ
repeat : (C →ᶠᵘⁿᶜᵗᵒʳ (C ⨯ᶜᵃᵗ C))
∃.witness repeat = Tuple.repeat
Functor.map (∃.proof repeat) = Tuple.repeat
Functor.op-preserving (∃.proof (repeat {C = C})) {f = f} {g = g} =
Tuple.repeat(f ∘ g) 🝖[ _≡_ ]-[]
Tuple.repeat(f) ∘ Tuple.repeat(g) 🝖-end
where instance _ = C ; instance _ = C ⨯ᶜᵃᵗ C
(Functor.id-preserving (∃.proof (repeat {C = C})) {x}) =
Tuple.repeat(id{x = x}) 🝖[ _≡_ ]-[]
id{x = (x , x)} 🝖-end
where instance _ = C ; instance _ = C ⨯ᶜᵃᵗ C
constₗ : CategoryObject.Object(Cₗ) → (Cᵣ →ᶠᵘⁿᶜᵗᵒʳ (Cₗ ⨯ᶜᵃᵗ Cᵣ))
constₗ c = mapLeft (constᶠᵘⁿᶜᵗᵒʳ c) ∘ᶠᵘⁿᶜᵗᵒʳ repeat
constᵣ : CategoryObject.Object(Cᵣ) → (Cₗ →ᶠᵘⁿᶜᵗᵒʳ (Cₗ ⨯ᶜᵃᵗ Cᵣ))
constᵣ c = mapRight (constᶠᵘⁿᶜᵗᵒʳ c) ∘ᶠᵘⁿᶜᵗᵒʳ repeat
associateLeft : (C₁ ⨯ᶜᵃᵗ (C₂ ⨯ᶜᵃᵗ C₃)) →ᶠᵘⁿᶜᵗᵒʳ ((C₁ ⨯ᶜᵃᵗ C₂) ⨯ᶜᵃᵗ C₃)
∃.witness associateLeft = Tuple.associateLeft
Functor.map (∃.proof associateLeft) = Tuple.associateLeft
Functor.op-preserving (∃.proof (associateLeft {C₁ = C₁}{C₂ = C₂}{C₃ = C₃})) {f = f}{g = g} =
Tuple.associateLeft(f ∘ g) 🝖[ _≡_ ]-[]
Tuple.associateLeft f ∘ Tuple.associateLeft g 🝖-end
where
instance _ = C₁ ; instance _ = C₂ ; instance _ = C₃
instance _ = C₁ ⨯ᶜᵃᵗ C₂ ; instance _ = C₂ ⨯ᶜᵃᵗ C₃
instance _ = C₁ ⨯ᶜᵃᵗ (C₂ ⨯ᶜᵃᵗ C₃) ; instance _ = (C₁ ⨯ᶜᵃᵗ C₂) ⨯ᶜᵃᵗ C₃
Functor.id-preserving (∃.proof (associateLeft {C₁ = C₁}{C₂ = C₂}{C₃ = C₃})) =
Tuple.associateLeft(id) 🝖[ _≡_ ]-[]
id 🝖-end
where
instance _ = C₁ ; instance _ = C₂ ; instance _ = C₃
instance _ = C₁ ⨯ᶜᵃᵗ C₂ ; instance _ = C₂ ⨯ᶜᵃᵗ C₃
instance _ = C₁ ⨯ᶜᵃᵗ (C₂ ⨯ᶜᵃᵗ C₃) ; instance _ = (C₁ ⨯ᶜᵃᵗ C₂) ⨯ᶜᵃᵗ C₃
associateRight : ((C₁ ⨯ᶜᵃᵗ C₂) ⨯ᶜᵃᵗ C₃) →ᶠᵘⁿᶜᵗᵒʳ (C₁ ⨯ᶜᵃᵗ (C₂ ⨯ᶜᵃᵗ C₃))
∃.witness associateRight = Tuple.associateRight
Functor.map (∃.proof associateRight) = Tuple.associateRight
Functor.op-preserving (∃.proof (associateRight {C₁ = C₁}{C₂ = C₂}{C₃ = C₃})) {f = f}{g = g} =
Tuple.associateRight(f ∘ g) 🝖[ _≡_ ]-[]
Tuple.associateRight f ∘ Tuple.associateRight g 🝖-end
where
instance _ = C₁ ; instance _ = C₂ ; instance _ = C₃
instance _ = C₁ ⨯ᶜᵃᵗ C₂ ; instance _ = C₂ ⨯ᶜᵃᵗ C₃
instance _ = C₁ ⨯ᶜᵃᵗ (C₂ ⨯ᶜᵃᵗ C₃) ; instance _ = (C₁ ⨯ᶜᵃᵗ C₂) ⨯ᶜᵃᵗ C₃
Functor.id-preserving (∃.proof (associateRight {C₁ = C₁}{C₂ = C₂}{C₃ = C₃})) =
Tuple.associateRight(id) 🝖[ _≡_ ]-[]
id 🝖-end
where
instance _ = C₁ ; instance _ = C₂ ; instance _ = C₃
instance _ = C₁ ⨯ᶜᵃᵗ C₂ ; instance _ = C₂ ⨯ᶜᵃᵗ C₃
instance _ = C₁ ⨯ᶜᵃᵗ (C₂ ⨯ᶜᵃᵗ C₃) ; instance _ = (C₁ ⨯ᶜᵃᵗ C₂) ⨯ᶜᵃᵗ C₃
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_446_451.asm | ljhsiun2/medusa | 9 | 102674 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x19a23, %r9
dec %r8
mov $0x6162636465666768, %rcx
movq %rcx, %xmm4
and $0xffffffffffffffc0, %r9
vmovaps %ymm4, (%r9)
nop
nop
nop
nop
nop
add %r14, %r14
lea addresses_A_ht+0x11ec1, %rsi
lea addresses_normal_ht+0x8fc1, %rdi
dec %rax
mov $43, %rcx
rep movsq
nop
nop
nop
nop
nop
xor $18321, %r9
lea addresses_UC_ht+0x28c1, %rdi
nop
sub %rsi, %rsi
mov (%rdi), %eax
nop
add $43487, %rcx
lea addresses_A_ht+0x17941, %rsi
lea addresses_normal_ht+0x90c1, %rdi
cmp %r13, %r13
mov $59, %rcx
rep movsb
nop
nop
nop
nop
nop
sub $42204, %r9
lea addresses_UC_ht+0xd8e9, %rdi
nop
inc %rsi
movups (%rdi), %xmm0
vpextrq $0, %xmm0, %r13
nop
nop
and %rdi, %rdi
lea addresses_A_ht+0xc0d5, %rcx
clflush (%rcx)
nop
nop
nop
add %r14, %r14
mov $0x6162636465666768, %r8
movq %r8, (%rcx)
nop
nop
cmp $1747, %r8
lea addresses_D_ht+0x461b, %rsi
nop
nop
nop
nop
nop
xor %rdi, %rdi
mov (%rsi), %r9d
nop
inc %r8
lea addresses_A_ht+0x8231, %rsi
lea addresses_WT_ht+0x56c1, %rdi
nop
nop
nop
cmp $31786, %r9
mov $18, %rcx
rep movsb
nop
nop
nop
nop
dec %rsi
lea addresses_D_ht+0x12c39, %rdi
nop
cmp %r14, %r14
movw $0x6162, (%rdi)
nop
dec %rsi
lea addresses_WC_ht+0x196c1, %r8
nop
nop
nop
nop
nop
dec %rdi
mov (%r8), %ax
nop
nop
nop
nop
sub %rsi, %rsi
lea addresses_WC_ht+0x98a1, %rsi
lea addresses_A_ht+0xb6c2, %rdi
nop
nop
nop
nop
sub $44809, %rax
mov $104, %rcx
rep movsw
nop
inc %r8
lea addresses_WC_ht+0x1bce1, %rsi
lea addresses_UC_ht+0x124c1, %rdi
clflush (%rsi)
cmp $48921, %r14
mov $103, %rcx
rep movsl
nop
nop
nop
add $39474, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r8
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
// Store
lea addresses_WT+0x63c1, %r14
nop
nop
and %r10, %r10
mov $0x5152535455565758, %rbp
movq %rbp, (%r14)
nop
nop
nop
nop
nop
and %r12, %r12
// REPMOV
lea addresses_normal+0x2f21, %rsi
lea addresses_UC+0x1d1c1, %rdi
clflush (%rdi)
nop
nop
add $43110, %r10
mov $13, %rcx
rep movsw
cmp %rcx, %rcx
// Load
lea addresses_PSE+0x1d081, %r12
nop
and %r14, %r14
vmovntdqa (%r12), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $0, %xmm6, %rbx
sub %r14, %r14
// Store
lea addresses_D+0x14037, %r10
nop
nop
cmp $53772, %rcx
mov $0x5152535455565758, %r14
movq %r14, (%r10)
nop
nop
nop
nop
nop
sub %r10, %r10
// Faulty Load
lea addresses_PSE+0x1e2c1, %rbp
cmp $21288, %r12
movups (%rbp), %xmm7
vpextrq $1, %xmm7, %r10
lea oracles, %r14
and $0xff, %r10
shlq $12, %r10
mov (%r14,%r10,1), %r10
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 8, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_normal'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_UC'}, 'OP': 'REPM'}
{'src': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 6, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'dst': {'NT': True, 'AVXalign': True, 'size': 2, 'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'33': 446}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
alloy4fun_models/trashltl/models/5/TBryZJS7rDSECEErp.als | Kaixi26/org.alloytools.alloy | 0 | 2451 | <filename>alloy4fun_models/trashltl/models/5/TBryZJS7rDSECEErp.als<gh_stars>0
open main
pred idTBryZJS7rDSECEErp_prop6 {
always ((some File) implies (always File in File'))
}
pred __repair { idTBryZJS7rDSECEErp_prop6 }
check __repair { idTBryZJS7rDSECEErp_prop6 <=> prop6o } |
oeis/041/A041143.asm | neoneye/loda-programs | 11 | 175236 | <reponame>neoneye/loda-programs
; A041143: Denominators of continued fraction convergents to sqrt(80).
; 1,1,17,18,305,323,5473,5796,98209,104005,1762289,1866294,31622993,33489287,567451585,600940872,10182505537,10783446409,182717648081,193501094490,3278735159921,3472236254411,58834515230497,62306751484908,1055742538989025,1118049290473933,18944531186571953,20062580477045886,339945818819306129,360008399296352015,6100080207560938369,6460088606857290384,109461497917277584513,115921586524134874897,1964206882303435582865,2080128468827570457762,35246262383544562907057,37326390852372133364819
add $0,1
seq $0,1076 ; Denominators of continued fraction convergents to sqrt(5).
dif $0,4
|
libsrc/genmath/pack2.asm | dex4er/deb-z88dk | 1 | 168673 | ;
; Z88dk Generic Floating Point Math Library
;
;
; $Id: pack2.asm,v 1.1 2002/01/21 20:35:22 dom Exp $:
XLIB pack2
LIB ldfabc
LIB incr
XREF fa
.PACK2 LD HL,FA+5 ;round c ix de b to 40 bits
OR A
CALL M,INCR
LD B,(HL) ;load exponent
INC HL
LD A,(HL) ;recover sign
AND $80 ;mask out all but sign
XOR C ;add to high
LD C,A ; order byte
JP LDFABC ;place answer in FA
|
programs/oeis/014/A014391.asm | neoneye/loda | 22 | 87838 | ; A014391: Final digit of 8^n.
; 1,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2,6,8,4,2
mov $1,-2
pow $1,$0
mov $0,$1
mod $0,10
add $0,10
mod $0,10
|
testcases/query_select/query_select.adb | jrmarino/AdaBase | 30 | 8547 | with AdaBase;
with Connect;
with CommonText;
with Ada.Text_IO;
with AdaBase.Results.Sets;
procedure Query_Select is
package CON renames Connect;
package TIO renames Ada.Text_IO;
package ARS renames AdaBase.Results.Sets;
package AR renames AdaBase.Results;
package CT renames CommonText;
begin
CON.connect_database;
CON.DR.set_trait_column_case (AdaBase.upper_case);
declare
stmt : CON.Stmt_Type := CON.DR.query_select
(tables => "nhl_schedule as S " &
"JOIN nhl_teams T1 ON S.home_team = T1.team_id " &
"JOIN nhl_teams T2 ON S.away_team = T2.team_id",
columns => "S.event_code, " &
"T1.city as home_city, " &
"T1.mascot as home_mascot, " &
"T1.abbreviation as home_short, " &
"S.home_score, " &
"T2.city as away_city, " &
"T2.mascot as away_mascot, " &
"T2.abbreviation as away_short, " &
"S.away_score",
conditions => "S.yyyswww < 1085011",
order => "S.yyyswww ASC",
limit => 10,
offset => 20);
begin
if not stmt.successful then
TIO.Put_Line (" Driver message: " & stmt.last_driver_message);
TIO.Put_Line (" Driver code: " & stmt.last_driver_code'Img);
TIO.Put_Line (" SQL State: " & stmt.last_sql_state);
else
for c in Natural range 1 .. stmt.column_count loop
TIO.Put_Line ("Column" & c'Img & " heading: " &
stmt.column_name (c));
end loop;
TIO.Put_Line ("");
end if;
-- Demonstrate bind/fetch_bound
declare
event_code : aliased AR.NByte2;
home_town, home_mascot : aliased AR.Textual;
away_town, away_mascot : aliased AR.Textual;
home_score, away_score : aliased AR.NByte1;
begin
stmt.bind (1, event_code'Unchecked_Access);
stmt.bind ("HOME_CITY", home_town'Unchecked_Access);
stmt.bind ("AWAY_CITY", away_town'Unchecked_Access);
stmt.bind (3, home_mascot'Unchecked_Access);
stmt.bind ("AWAY_MASCOT", away_mascot'Unchecked_Access);
stmt.bind ("HOME_SCORE", home_score'Unchecked_Access);
stmt.bind ("AWAY_SCORE", away_score'Unchecked_Access);
loop
exit when not stmt.fetch_bound;
TIO.Put ("In event" & event_code'Img & ", the " &
CT.USS (away_town) & " " & CT.USS (away_mascot) &
" visited the " &
CT.USS (home_town) & " " & CT.USS (home_mascot) &
" and ");
if Integer (away_score) > Integer (home_score) then
TIO.Put ("won");
elsif Integer (away_score) < Integer (home_score) then
TIO.Put ("lost");
else
TIO.Put ("tied");
end if;
TIO.Put_Line (away_score'Img & " to" & home_score'Img);
end loop;
TIO.Put_Line ("");
end;
end;
declare
-- demonstrate fetch_all
stmt : CON.Stmt_Type := CON.DR.query_select
(tables => "fruits",
columns => "fruit, calories, color",
conditions => "calories > 50",
order => "calories",
limit => 10);
rowset : ARS.Datarow_Set := stmt.fetch_all;
begin
for row in Natural range 1 .. rowset'Length loop
TIO.Put_Line (rowset (row).column (1).as_string & ":" &
rowset (row).column ("calories").as_nbyte2'Img &
" calories, " & rowset (row).column (3).as_string);
end loop;
end;
CON.DR.disconnect;
end Query_Select;
|
oeis/037/A037504.asm | neoneye/loda-programs | 11 | 164034 | <reponame>neoneye/loda-programs
; A037504: Base-3 digits are, in order, the first n terms of the periodic sequence with initial period 1,2,0.
; Submitted by <NAME>
; 1,5,15,46,140,420,1261,3785,11355,34066,102200,306600,919801,2759405,8278215,24834646,74503940,223511820,670535461,2011606385,6034819155,18104457466,54313372400,162940117200,488820351601,1466461054805,4399383164415,13198149493246,39594448479740,118783345439220,356350036317661,1069050108952985,3207150326858955,9621450980576866,28864352941730600,86593058825191800,259779176475575401,779337529426726205,2338012588280178615,7014037764840535846,21042113294521607540,63126339883564822620
mov $2,1
lpb $0
sub $0,1
add $1,$2
mul $1,3
add $2,22
mod $2,3
lpe
add $1,$2
mov $0,$1
|
Logic/Names.agda | Lolirofle/stuff-in-agda | 6 | 3220 | <gh_stars>1-10
module Logic.Names where
open import Functional
import Lvl
open import Logic
open import Logic.Predicate
open import Logic.Propositional
module _ {ℓ} where
ExcludedMiddleOn : Stmt{ℓ} → Stmt
ExcludedMiddleOn(X) = (X ∨ (¬ X))
ExcludedMiddle = ∀ₗ(ExcludedMiddleOn)
WeakExcludedMiddleOn = ExcludedMiddleOn ∘ (¬_)
WeakExcludedMiddle = ∀ₗ(WeakExcludedMiddleOn)
NonContradictionOn : Stmt{ℓ} → Stmt
NonContradictionOn(X) = ¬(X ∧ (¬ X))
NonContradiction = ∀ₗ(NonContradictionOn)
DoubleNegationOn : Stmt{ℓ} → Stmt
DoubleNegationOn(X) = (¬(¬ X)) → X
DoubleNegation = ∀ₗ(DoubleNegationOn)
module _ where
private variable ℓ₁ ℓ₂ : Lvl.Level
TopOrBottom : (Stmt{ℓ₁} → Stmt{Lvl.𝟎} → Stmt{ℓ₂}) → Stmt{ℓ₁} → Stmt
TopOrBottom(_≡_)(P) = (P ≡ ⊤) ∨ (P ≡ ⊥)
module _ {ℓ₁ ℓ₂} where
CallCCOn : Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt
CallCCOn(X)(Y) = (((X → Y) → X) → X)
CallCC = ∀²(CallCCOn)
ContrapositiveOn : Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt
ContrapositiveOn(X)(Y) = (X → Y) → ((¬ Y) → (¬ X))
Contrapositive = ∀²(ContrapositiveOn)
DisjunctiveSyllogismₗOn : Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt
DisjunctiveSyllogismₗOn(X)(Y) = ((X ∨ Y) ∧ (¬ Y)) → X
DisjunctiveSyllogismₗ = ∀²(DisjunctiveSyllogismₗOn)
DisjunctiveSyllogismᵣOn : Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt
DisjunctiveSyllogismᵣOn(X)(Y) = ((X ∨ Y) ∧ (¬ X)) → Y
DisjunctiveSyllogismᵣ = ∀²(DisjunctiveSyllogismᵣOn)
MaterialImplicationOn : Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt
MaterialImplicationOn(X)(Y) = (X → Y) ↔ ((¬ X) ∨ Y)
MaterialImplication = ∀²(MaterialImplicationOn)
module _ {ℓ₁ ℓ₂ ℓ₃ ℓ₄} where
ConstructiveDilemmaOn : Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt{ℓ₃} → Stmt{ℓ₄} → Stmt
ConstructiveDilemmaOn(X₁)(X₂)(Y₁)(Y₂) = ((X₁ → X₂) ∧ (Y₁ → Y₂) ∧ (X₁ ∨ Y₁)) → (X₂ ∨ Y₂)
ConstructiveDilemma = ∀⁴(ConstructiveDilemmaOn)
-- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- Classical names
module _ {ℓ₁ ℓ₂} where
ModusTollensOn : Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt
ModusTollensOn(X)(Y) = ((X → Y) ∧ (¬ Y)) → (¬ X)
ModusTollens = ∀²(ModusTollensOn)
ModusPonensOn : Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt
ModusPonensOn(X)(Y) = ((X → Y) ∧ X) → Y
ModusPonens = ∀²(ModusPonensOn)
ReductioAdAbsurdumOn : Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt
ReductioAdAbsurdumOn(X)(Y) = ((X → Y) ∧ (X → (¬ Y))) → (¬ X)
ReductioAdAbsurdum = ∀²(ReductioAdAbsurdumOn)
ReductioAdAbsurdumNegatedOn : Stmt{ℓ₁} → Stmt{ℓ₂} → Stmt
ReductioAdAbsurdumNegatedOn(X)(Y) = (((¬ X) → Y) ∧ ((¬ X) → (¬ Y))) → (¬ X)
ReductioAdAbsurdumNegated = ∀²(ReductioAdAbsurdumNegatedOn)
|
src/vm/arm/patchedcode.asm | elinor-fung/coreclr | 159 | 163608 | <reponame>elinor-fung/coreclr
; Licensed to the .NET Foundation under one or more agreements.
; The .NET Foundation licenses this file to you under the MIT license.
; See the LICENSE file in the project root for more information.
;; ==++==
;;
;;
;; ==--==
#include "ksarm.h"
#include "asmconstants.h"
#include "asmmacros.h"
TEXTAREA
; ------------------------------------------------------------------
; Start of the writeable code region
LEAF_ENTRY JIT_PatchedCodeStart
bx lr
LEAF_END
; ------------------------------------------------------------------
; GC write barrier support.
;
; GC Write barriers are defined in asmhelpers.asm. The following functions are used to define
; patchable location where the write-barriers are copied over at runtime
LEAF_ENTRY JIT_PatchedWriteBarrierStart
; Cannot be empty function to prevent LNK1223
bx lr
LEAF_END
; These write barriers are overwritten on the fly
; See ValidateWriteBarriers on how the sizes of these should be calculated
ALIGN 4
LEAF_ENTRY JIT_WriteBarrier
SPACE (0x84)
LEAF_END_MARKED JIT_WriteBarrier
ALIGN 4
LEAF_ENTRY JIT_CheckedWriteBarrier
SPACE (0x9C)
LEAF_END_MARKED JIT_CheckedWriteBarrier
ALIGN 4
LEAF_ENTRY JIT_ByRefWriteBarrier
SPACE (0xA0)
LEAF_END_MARKED JIT_ByRefWriteBarrier
LEAF_ENTRY JIT_PatchedWriteBarrierLast
; Cannot be empty function to prevent LNK1223
bx lr
LEAF_END
; ------------------------------------------------------------------
; End of the writeable code region
LEAF_ENTRY JIT_PatchedCodeLast
bx lr
LEAF_END
; Must be at very end of file
END
|
Source/ROMHeader.asm | AbePralle/GameBoySoundManipulator | 0 | 83784 | ;===============================================================================
; RomHeader.asm - Standard ROM-image header
;===============================================================================
SECTION "Startup", ROM0[0]
RST_00: jp Main
DS 5
RST_08: jp Main
DS 5
RST_10: jp Main
DS 5
RST_18: jp Main
DS 5
RST_20: jp Main
DS 5
RST_28: jp Main
DS 5
RST_30: jp Main
DS 5
RST_38: jp Main
DS 5
;Vblank interrupt instructions
jp OnVBlank
DS 5
;Hblank interrupt instructions
reti
DS 7
;Timer interrupt instructions
reti
DS 7
;Serial interrupt instructions
reti
DS 7
;HiLo interrupt instructions
reti
DS 7
DS $100-$68
nop
jp Main
DB $CE,$ED,$66,$66,$CC,$0D,$00,$0B,$03,$73,$00,$83,$00,$0C,$00,$0D
DB $00,$08,$11,$1F,$88,$89,$00,$0E,$DC,$CC,$6E,$E6,$DD,$DD,$D9,$99
DB $BB,$BB,$67,$63,$6E,$0E,$EC,$CC,$DD,$DC,$99,$9F,$BB,$B9,$33,$3E
;0123456789ABCDEF
DB "SOUND TEST ",$c0
DB 0,0,0 ;SuperGameboy
DB 0 ;CARTTYPE
;--------
;0 - ROM ONLY
;1 - ROM+MBC1
;2 - ROM+MBC1+RAM
;3 - ROM+MBC1+RAM+BATTERY
;5 - ROM+MBC2
;6 - ROM+MBC2+BATTERY
DB 0 ;ROMSIZE
;-------
;0 - 256 kBit ( 32 kByte, 2 banks)
;1 - 512 kBit ( 64 kByte, 4 banks)
;2 - 1 MBit (128 kByte, 8 banks)
;3 - 2 MBit (256 kByte, 16 banks)
;3 - 4 MBit (512 kByte, 32 banks)
DB 0 ;RAMSIZE
;-------
;0 - NONE
;1 - 16 kBit ( 2 kByte, 1 bank )
;2 - 64 kBit ( 8 kByte, 1 bank )
;3 - 256 kBit (32 kByte, 4 banks)
DW $0000 ;Manufacturer
DB 0 ;Version
DB 0 ;Complement check
DW 0 ;Checksum
; --
; -- Initialize the Gameboy
; --
Main::
; disable interrupts
di
; we want a stack
ld hl,StackTop
ld sp,hl
; no interrupts to begin with
xor a
ld [$ff0f],a ;interrupt flags
ld [$ffff],a ;interrupt control
ei ;enable interrupts
jp UserMain ;in home memory
; -- Variables
SECTION "StartupVars",WRAM0[$CE00]
Stack: DS $200
StackTop:
|
src/main/java/de/s42/jara/loaders/objloader/ObjParser.g4 | bschiller81/jara | 8 | 4073 | /*
* The MIT License
*
* Copyright 2020 Studio 42 GmbH (https://www.s42m.de).
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
grammar ObjParser;
meshes : ( command )* EOF ;
command : ( mtllib | object | position | normal | textureposition | group | usematerial | smooth | face )? NEWLINE ;
mtllib : KEYWORD_MTLLIB SYMBOL ;
object : KEYWORD_OBJECT SYMBOL ;
position : KEYWORD_POSITION vector3 ;
normal : KEYWORD_NORMAL vector3;
textureposition : KEYWORD_TEXTUREPOSITION vector2;
group : KEYWORD_GROUP SYMBOL ;
usematerial : KEYWORD_USEMATERIAL SYMBOL ;
smooth : KEYWORD_SMOOTH (KEYWORD_OFF | INTEGER | FLOAT );
face : KEYWORD_FACE vertex vertex vertex;
vector2 : FLOAT FLOAT;
vector3 : FLOAT FLOAT FLOAT;
vertex : positionIndex SLASH textureIndex SLASH normalIndex;
positionIndex : INTEGER;
textureIndex : INTEGER;
normalIndex : INTEGER;
KEYWORD_MTLLIB : 'mtllib' ;
KEYWORD_OBJECT : 'o' ;
KEYWORD_GROUP : 'g' ;
KEYWORD_POSITION : 'v' ;
KEYWORD_NORMAL : 'vn' ;
KEYWORD_TEXTUREPOSITION : 'vt' ;
KEYWORD_USEMATERIAL : 'usemtl' ;
KEYWORD_SMOOTH : 's' ;
KEYWORD_FACE : 'f' ;
KEYWORD_OFF : 'off' ;
SLASH : '/';
INTEGER : [-]? [0-9]+ ;
FLOAT : [-]? [0-9]+ '.' [0-9]+ ;
SYMBOL : [a-zA-Z0-9] [a-zA-Z0-9_\-.]* ;
COMMENT : '#' ~[\n]+ NEWLINE -> skip ;
NEWLINE : [\n] ;
WS : [ \t\r]+ -> skip ; |
src/Script Libraries/fmDatabase.applescript | NYHTC/HTC_sous-dev-applescript | 0 | 997 | <reponame>NYHTC/HTC_sous-dev-applescript
-- HTC sous-dev, FM database library
-- 2017-11-02, <NAME>, NYHTC
(*
2017-11-02 ( eshagdar ): created.
*)
property name : "database"
property id : "org.nyhtc.sous-dev.database"
property version : "0.1"
on promptTableName(prefs)
-- prompt for a table name
-- returns a record of a table name.
-- 2017-11-07 ( eshagdar ): moved out of creating new table handler. returns a table name.
try
set defaultPrefs to {msg:null, defaultAnswer:null}
set prefs to prefs & defaultPrefs
-- pick up global values from main script
global htcBasic
-- get name of table
set tableDlg to htcBasic's promptUserWithDefaultAnswer({msg:msg of prefs, defaultAnswer:defaultAnswer of prefs})
set tableName to text returned of tableDlg
if tableName is "" then error "You must specify the name of a table" number -1024
return {tableName:tableName}
on error errMsg number errNum
error "unable to promptTableName - " & errMsg number errNum
end try
end promptTableName
on ensureTableNames(prefs)
-- ensures a source and effect table name
-- 2017-11-10 ( eshagdar ): get table names if empty or null.
-- 2017-11-07 ( eshagdar ): moved out of creating new table handler. each table name is tested for empty ( in addition to previously being tested for null ). tables are called 'source' and 'effect' instead of 'new' and 'similar'.
try
set defaultPrefs to {sourceTable:null, effectTable:null, sourceMessage:null, effectMessage:null}
set prefs to prefs & defaultPrefs
set sourceTable to sourceTable of prefs
set effectTable to effectTable of prefs
set sourceMessage to sourceMessage of prefs
set effectMessage to effectMessage of prefs
-- get db name ( if we have a blank message )
if sourceMessage is null or effectMessage is null then tell application "htcLib" to set dbName to databaseNameOfFrontWindow({fmAppType:"Adv"})
-- get name of the EFFECT table ( table being created/modified, etc )
if effectMessage is null then set effectMessage to "Enter the name of the table to CHANGE the security in '" & dbName & "' database:"
if effectTable is equal to "" or effectTable is equal to null then set effectTable to tableName of promptTableName({msg:effectMessage, defaultAnswer:effectTable})
tell application "htcLib" to set effectTable to textUpper({str:effectTable})
-- get name of SOURCE table ( table whose security is being copied from )
if sourceMessage is null then set sourceMessage to "Enter the name of the SOURCE table in '" & dbName & "' database:"
if sourceTable is equal to "" or sourceTable is equal to null then set sourceTable to tableName of promptTableName({msg:sourceMessage, defaultAnswer:sourceTable})
return {sourceTable:sourceTable, effectTable:effectTable}
on error errMsg number errNum
error "unable to ensureTableNames - " & errMsg number errNum
end try
end ensureTableNames
on copyPrivSetSettingsForOneTable(prefs)
-- ensures table names are specified, then updates the effect table for each privSet
-- 2017-11-07 ( eshagdar ): created.
try
set defaultPrefs to {sourceTable:null, effectTable:null, sourceMessage:null, effectMessage:null}
set prefs to prefs & defaultPrefs
-- pick up global values from main script
global fullAccessCredentials
set promptTableInfo to ensureTableNames(prefs)
set sourceTable to sourceTable of promptTableInfo
set effectTable to effectTable of promptTableInfo
tell application "htcLib" to fmGUI_ManageSecurity_CopyTableForAllPrivSets({sourceTable:sourceTable, effectTable:effectTable} & fullAccessCredentials)
return true
on error errMsg number errNum
error "unable to copyPrivSetSettingsForOneTable - " & errMsg number errNum
end try
end copyPrivSetSettingsForOneTable
on newTable(prefs)
-- create a new table in the current file. also append the name of created TO with 'basic'. update the security to match the source table.
-- 2017-11-01 ( eshagdar ): created
try
set defaultPrefs to {dbName:null, newTableName:null, similarTableName:null, primaryKeyName:null}
set prefs to prefs & defaultPrefs
set dbName to dbName of prefs
set newTableName to newTableName of prefs
set similarTableName to similarTableName of prefs
set primaryKeyName to primaryKeyName of prefs
-- pick up global values from main script
global appPath
global newTableAndFields
global fmObjTrans
global htcBasic
-- get db nam )
if dbName is null then tell application "htcLib" to set dbName to databaseNameOfFrontWindow({fmAppType:"Adv"})
set effectMessage to "Enter the name of the table to create in '" & dbName & "' database:"
set sourceMessage to "Enter the name of the table that the new table should have the security copied from:"
set promptTableInfo to ensureTableNames({sourceTable:similarTableName, effectTable:newTableName, sourceMessage:sourceMessage, effectMessage:effectMessage})
set newTableName to effectTable of promptTableInfo
set similarTableName to sourceTable of promptTableInfo
-- prompt for primary key field name
set primaryKeyName to primaryKeyName of prefs
if primaryKeyName is null then
set pkFieldDlg to htcBasic's promptUser("Enter the name of the primary key of '" & newTableName & "' table in '" & dbName & "' database:")
set primaryKeyName to text returned of pkFieldDlg
end if
-- confirm similar table exists
tell application "htcLib" to set existingTableNames to fmGUI_ManageDb_ListOfTableNames({stayOpen:true})
if similarTableName is not in existingTableNames then error "specified table '" & similarTableName & "' does not exist in '" & dbName & "' database" number -1024
-- get XML of table/fields
set pathXMLDir to appPath & "Contents:Resources:XML:"
set path_XML to pathXMLDir & newTableAndFields
set XMLtext to read file path_XML
-- update placeholders and set to clipboard
tell application "htcLib"
set XMLtext to replaceSimple({sourceTEXT:XMLtext, oldChars:"||FULL_TABLE_NAME||", newChars:newTableName})
if length of primaryKeyName is greater than 0 then set XMLtext to replaceSimple({sourceTEXT:XMLtext, oldChars:"||__pk__||", newChars:primaryKeyName})
end tell
set the clipboard to XMLtext
-- convert XML to FM object
clipboardConvertToFMObjects({}) of fmObjTrans
-- paste XML and save changes
tell application "htcLib"
fmGUI_ManageDb_TableListFocus({})
fmGUI_PasteFromClipboard()
fmGUI_ManageDB_Save({})
end tell
-- layouts
tell application "htcLib"
fmGUI_ManageLayouts_Edit({layoutName:newTableName & " Basic", layoutOldName:newTableName})
fmGUI_ManageLayouts_Close({})
end tell
-- security
copyPrivSetSettingsForOneTable({dbName:dbName, effectTable:newTableName, sourceTable:similarTableName})
-- prompt to go to table
return true
on error errMsg number errNum
error "unable to newTable - " & errMsg number errNum
end try
end newTable
|
src/splash/splash_pixel_data.asm | 1888games/golf | 1 | 13420 | ; Top-hole Golf
; Copyright 2020-2021 <NAME>
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,250,251,251,251,255,255
!byte 255,234,186,234,250,254,254,234
!byte 191,255,190,187,250,250,235,170
!byte 255,250,253,234,235,235,235,171
!byte 255,255,255,191,191,175,174,170
!byte 170,187,171,255,255,250,175,255
!byte 255,254,250,239,255,253,253,246
!byte 219,166,239,159,191,127,239,255
!byte 90,170,185,253,255,255,255,187
!byte 255,191,191,191,255,255,255,247
!byte 171,254,253,253,255,251,251,235
!byte 191,255,255,254,191,190,254,235
!byte 191,255,255,255,191,239,255,255
!byte 231,189,90,122,254,126,126,191
!byte 175,255,255,255,255,191,190,190
!byte 255,255,251,251,251,218,251,250
!byte 255,255,255,255,255,191,191,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,254,249,249,234,234,170
!byte 255,255,87,229,250,191,191,175
!byte 255,255,255,255,191,175,170,234
!byte 255,255,255,255,255,255,175,170
!byte 182,189,253,255,191,175,190,250
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,254,254
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,239,239
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 235,239,255,255,255,255,255,255
!byte 251,251,251,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,250,250,250,251,253,253,253
!byte 249,235,235,175,159,191,127,255
!byte 251,250,250,255,255,255,255,255
!byte 102,102,239,255,255,255,255,255
!byte 251,251,251,251,251,251,251,123
!byte 239,235,234,254,254,254,255,255
!byte 255,255,251,231,233,233,233,233
!byte 101,187,187,251,254,250,251,239
!byte 127,127,255,254,254,254,255,255
!byte 239,125,123,107,235,239,239,127
!byte 191,191,191,191,187,111,111,111
!byte 191,191,191,191,175,239,239,239
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,127,191,191,175,170,170
!byte 175,175,175,175,191,255,255,255
!byte 159,175,175,175,159,191,189,190
!byte 154,191,127,255,255,255,255,255
!byte 191,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 254,254,254,254,250,250,251,251
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 239,239,239,239,175,159,191,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,254
!byte 249,249,251,231,239,159,191,127
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 123,123,123,123,123,123,123,123
!byte 255,255,255,255,255,255,255,255
!byte 122,250,251,251,239,255,255,255
!byte 94,122,254,239,239,175,255,255
!byte 171,171,171,251,235,239,239,239
!byte 169,170,186,122,254,255,255,255
!byte 159,159,159,159,167,167,167,167
!byte 255,255,255,255,255,255,255,159
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,253,254,246
!byte 235,103,175,175,175,175,159,191
!byte 254,246,219,235,175,175,175,175
!byte 106,218,219,251,251,251,251,251
!byte 182,253,237,239,175,175,175,175
!byte 255,255,255,255,254,249,231,255
!byte 251,250,249,251,187,251,251,219
!byte 218,246,182,190,190,190,190,254
!byte 254,246,219,235,175,175,175,175
!byte 127,159,159,175,175,175,174,174
!byte 191,191,191,191,191,191,191,255
!byte 253,247,223,239,175,174,170,175
!byte 127,159,159,175,175,191,255,239
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 254,254,249,251,231,231,239,159
!byte 191,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 123,123,123,123,123,107,111,111
!byte 255,255,255,254,254,254,254,250
!byte 255,255,255,255,254,254,254,254
!byte 175,183,191,181,181,167,165,189
!byte 182,182,250,235,251,251,251,251
!byte 189,190,190,254,190,254,254,253
!byte 126,94,254,254,254,254,254,254
!byte 122,122,118,118,246,246,246,246
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,253,170,255,255,255,255
!byte 250,218,170,170,255,255,255,255
!byte 191,191,175,170,255,255,255,255
!byte 175,175,174,234,255,255,255,255
!byte 158,190,126,250,250,250,251,251
!byte 233,235,231,159,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 235,239,239,239,255,255,255,255
!byte 175,175,175,175,255,255,255,255
!byte 175,175,174,234,255,255,255,255
!byte 109,126,190,255,255,255,255,255
!byte 251,247,167,175,255,255,255,255
!byte 175,174,105,235,255,255,255,255
!byte 111,191,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,254,254,254,249,251,231,239
!byte 127,191,191,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 107,111,111,107,123,123,123,123
!byte 250,250,249,249,250,250,254,254
!byte 254,254,254,254,254,254,254,254
!byte 191,191,191,191,191,191,191,191
!byte 250,234,255,251,251,251,251,250
!byte 253,253,254,254,254,254,254,254
!byte 126,126,126,126,126,126,126,126
!byte 249,249,249,249,249,217,233,233
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,253,250,231,219,159,111
!byte 250,170,127,255,253,254,254,255
!byte 246,254,189,255,255,255,255,255
!byte 255,255,255,255,191,191,127,127
!byte 251,251,251,251,251,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,253,250
!byte 255,255,255,255,255,255,255,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,254,254,249,249,251
!byte 159,159,191,127,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 123,123,127,127,111,111,106,107
!byte 254,254,250,250,250,250,250,250
!byte 254,254,254,254,254,254,254,254
!byte 126,254,254,254,254,254,254,254
!byte 250,250,250,254,255,254,254,254
!byte 254,251,255,191,191,191,191,191
!byte 233,233,231,231,159,159,159,159
!byte 111,111,111,107,107,111,111,174
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 253,254,246,250,249,251,219,235
!byte 191,127,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 170,170,235,255,255,255,255,255
!byte 191,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,239,239,239,239,239,239
!byte 251,251,251,219,239,239,239,239
!byte 191,159,239,239,239,255,255,255
!byte 255,255,255,255,255,253,250,250
!byte 255,255,255,255,155,102,154,106
!byte 255,255,255,255,255,255,191,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,254,255
!byte 255,255,255,255,255,235,233,229
!byte 255,255,255,255,255,191,155,167
!byte 255,255,255,255,255,255,239,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,254,254,254,249
!byte 231,239,159,191,127,127,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 151,159,191,191,159,159,159,159
!byte 254,254,254,254,254,254,253,253
!byte 254,255,255,251,251,251,251,250
!byte 190,190,190,190,190,190,191,191
!byte 254,254,254,126,126,254,254,250
!byte 191,185,185,187,187,187,251,255
!byte 167,231,231,231,231,231,231,231
!byte 174,190,254,254,254,223,223,219
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 235,235,235,235,235,217,250,250
!byte 255,255,255,255,255,254,250,250
!byte 255,255,255,255,254,170,170,190
!byte 255,247,233,233,170,171,255,255
!byte 255,255,255,255,254,246,219,235
!byte 255,255,255,255,127,159,159,175
!byte 175,159,191,191,191,186,191,191
!byte 239,239,239,110,169,191,191,191
!byte 255,255,175,175,255,255,255,255
!byte 191,191,191,191,191,191,191,175
!byte 223,127,126,126,122,122,234,170
!byte 255,175,175,111,107,91,91,91
!byte 255,255,253,250,234,169,165,229
!byte 255,255,191,171,106,85,85,166
!byte 255,255,255,255,255,191,111,159
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 254,255,253,234,250,234,102,85
!byte 171,255,175,175,255,255,255,255
!byte 249,250,250,250,251,239,255,223
!byte 255,255,255,255,255,255,254,254
!byte 255,255,255,255,233,165,165,165
!byte 251,235,171,171,111,111,111,95
!byte 255,255,255,255,255,175,107,91
!byte 255,255,255,255,255,255,255,254
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,239
!byte 159,159,191,191,191,159,159,191
!byte 254,254,254,254,254,254,254,253
!byte 251,250,250,251,251,251,250,254
!byte 191,191,191,191,191,191,190,190
!byte 250,250,250,251,251,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 219,219,219,219,219,219,238,238
!byte 219,251,187,187,235,235,235,235
!byte 255,255,255,255,255,255,255,254
!byte 255,255,255,255,255,255,171,170
!byte 250,250,254,254,254,255,255,255
!byte 111,235,235,218,250,246,191,171
!byte 235,111,174,174,189,191,127,255
!byte 255,255,255,255,255,127,191,171
!byte 250,250,250,250,250,250,251,191
!byte 175,175,174,174,158,189,125,255
!byte 191,191,191,255,251,247,167,175
!byte 191,191,191,191,191,191,191,191
!byte 255,255,255,255,255,255,255,255
!byte 250,249,253,253,255,255,255,255
!byte 255,253,245,255,191,175,171,169
!byte 254,254,254,254,251,254,250,170
!byte 190,238,254,122,122,250,254,255
!byte 255,255,255,255,255,255,171,90
!byte 254,255,255,255,255,255,255,255
!byte 170,170,250,245,245,245,245,245
!byte 169,169,169,255,255,255,255,255
!byte 170,170,170,170,255,255,255,255
!byte 170,170,170,175,255,255,255,255
!byte 170,170,170,255,255,255,255,253
!byte 87,95,127,255,254,250,234,170
!byte 191,191,255,255,255,255,255,255
!byte 250,250,250,250,250,250,250,250
!byte 249,249,253,254,238,254,254,254
!byte 171,175,175,175,175,191,255,255
!byte 170,234,235,219,222,223,247,245
!byte 170,186,170,175,239,255,255,255
!byte 255,255,255,231,229,165,166,170
!byte 255,255,255,250,250,90,90,90
!byte 186,190,190,191,255,255,255,255
!byte 126,110,111,175,175,175,175,175
!byte 254,254,254,254,254,254,254,254
!byte 254,254,254,254,250,254,254,254
!byte 235,231,235,235,235,235,235,235
!byte 255,255,251,251,251,251,251,251
!byte 255,255,255,253,253,254,254,254
!byte 111,111,111,111,111,111,111,111
!byte 235,239,175,175,175,175,175,175
!byte 254,246,250,250,250,250,246,253
!byte 255,255,255,255,255,255,255,254
!byte 85,95,159,191,191,255,254,234
!byte 255,255,255,255,250,170,159,255
!byte 255,255,255,255,255,171,250,255
!byte 253,255,255,255,255,255,191,235
!byte 170,234,255,255,255,255,255,255
!byte 170,170,254,255,255,255,253,213
!byte 170,169,169,245,247,223,127,255
!byte 106,106,106,239,254,255,255,255
!byte 255,255,255,238,187,238,187,174
!byte 255,255,187,238,187,238,185,237
!byte 111,175,191,191,255,255,255,254
!byte 95,95,255,255,255,254,170,170
!byte 255,255,255,255,255,255,191,171
!byte 253,255,255,255,238,254,238,174
!byte 85,169,169,187,251,251,251,251
!byte 95,127,126,126,126,250,234,234
!byte 170,251,255,255,255,255,255,255
!byte 186,255,255,255,255,251,255,251
!byte 175,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,249,169
!byte 255,255,255,221,234,170,170,170
!byte 170,170,166,95,255,255,255,255
!byte 191,191,255,255,255,223,255,255
!byte 250,251,127,251,251,251,254,175
!byte 239,255,185,255,191,159,255,255
!byte 251,250,255,255,254,254,254,255
!byte 191,127,191,251,255,255,251,255
!byte 255,255,255,255,255,255,251,255
!byte 171,171,251,255,255,190,222,255
!byte 255,239,239,255,255,255,251,123
!byte 239,239,175,175,239,223,223,223
!byte 254,254,254,254,254,254,254,254
!byte 254,254,254,254,126,127,255,254
!byte 190,190,250,251,191,185,189,189
!byte 247,255,254,222,222,218,106,154
!byte 254,246,250,250,233,121,249,125
!byte 239,239,239,235,235,239,238,238
!byte 175,175,175,191,191,191,191,255
!byte 175,191,191,255,255,255,255,255
!byte 191,170,234,255,255,255,255,255
!byte 167,175,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 254,255,255,255,255,255,255,255
!byte 170,255,255,255,255,255,255,255
!byte 167,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 254,255,255,255,255,255,255,255
!byte 223,118,254,254,254,255,255,255
!byte 171,175,175,175,191,239,251,126
!byte 255,255,255,255,255,255,175,175
!byte 255,255,255,255,255,255,255,255
!byte 251,191,191,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 191,191,191,191,191,191,190,106
!byte 255,255,255,255,255,250,106,170
!byte 105,166,165,171,191,255,255,255
!byte 170,171,191,255,255,255,253,255
!byte 127,255,255,255,255,171,255,191
!byte 255,247,255,255,255,255,254,239
!byte 255,254,250,251,187,191,190,191
!byte 255,255,127,239,239,174,171,171
!byte 190,255,255,223,254,190,255,255
!byte 255,255,255,255,255,239,239,255
!byte 123,255,255,255,255,255,255,255
!byte 255,255,255,254,255,254,254,249
!byte 255,255,255,255,127,191,191,255
!byte 249,233,253,255,255,255,254,239
!byte 239,255,189,254,239,238,165,85
!byte 239,239,239,239,239,111,187,187
!byte 254,254,253,253,253,254,255,255
!byte 254,191,191,190,174,173,181,181
!byte 169,166,191,191,175,175,171,255
!byte 239,223,255,255,255,255,255,255
!byte 251,235,191,255,255,255,255,255
!byte 123,123,123,123,123,123,123,123
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,234,234
!byte 255,255,255,255,255,170,170,170
!byte 255,255,255,255,235,170,170,170
!byte 255,255,255,255,255,170,170,170
!byte 255,255,255,255,255,171,170,170
!byte 255,255,255,255,255,255,170,170
!byte 255,255,255,255,255,170,170,170
!byte 255,255,255,255,255,175,170,170
!byte 255,255,255,255,255,255,170,170
!byte 255,255,255,255,255,255,170,170
!byte 255,255,255,255,255,255,170,170
!byte 255,255,255,255,255,255,170,170
!byte 245,253,255,255,255,255,175,171
!byte 255,255,255,253,191,189,175,175
!byte 95,170,255,255,255,255,127,127
!byte 250,170,255,255,255,255,255,255
!byte 186,170,234,251,251,255,255,255
!byte 127,191,191,111,159,111,175,107
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,254,170
!byte 170,154,154,86,111,191,255,255
!byte 170,170,171,175,255,255,255,255
!byte 170,191,255,255,255,255,255,255
!byte 170,250,255,255,255,255,255,255
!byte 170,255,255,255,255,255,255,255
!byte 170,255,255,255,255,255,255,255
!byte 191,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 234,254,255,255,255,255,255,255
!byte 170,171,255,255,255,255,255,255
!byte 175,255,255,255,255,255,255,255
!byte 254,254,254,254,255,255,255,255
!byte 191,175,191,191,191,191,191,191
!byte 255,255,255,255,255,255,255,255
!byte 223,213,255,255,191,191,191,191
!byte 251,247,229,245,222,254,254,234
!byte 171,186,250,254,86,95,119,95
!byte 171,171,250,234,239,239,229,125
!byte 247,231,231,231,231,231,239,239
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 250,254,254,254,254,254,254,255
!byte 254,254,255,255,255,255,255,255
!byte 255,255,255,191,175,171,171,171
!byte 255,255,255,255,255,255,255,255
!byte 233,250,234,250,250,254,254,251
!byte 255,255,255,255,255,191,191,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 251,251,251,255,255,255,239,239
!byte 255,255,255,255,251,251,249,249
!byte 255,191,191,191,187,187,255,239
!byte 255,255,255,255,255,255,255,255
!byte 183,183,157,149,159,175,167,175
!byte 250,251,239,255,251,170,171,187
!byte 187,191,187,255,254,170,174,250
!byte 239,175,189,173,189,253,253,237
!byte 155,187,187,155,155,91,95,127
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,254,246,246
!byte 255,255,255,255,255,255,255,175
!byte 254,254,254,254,254,254,234,170
!byte 255,255,255,255,255,255,254,254
!byte 171,175,171,171,175,175,255,255
!byte 127,255,255,255,255,255,255,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 223,213,255,255,254,254,239,239
!byte 255,255,255,255,254,186,165,86
!byte 126,126,251,251,238,186,187,251
!byte 191,191,255,191,191,255,127,125
!byte 255,255,254,255,255,254,126,250
!byte 250,250,191,191,183,190,214,218
!byte 255,255,255,191,191,127,255,247
!byte 254,255,255,187,170,238,234,169
!byte 175,175,175,175,191,189,189,189
!byte 127,123,123,123,123,251,238,238
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 246,246,250,250,250,250,250,250
!byte 255,255,255,255,255,255,255,255
!byte 245,255,191,191,191,191,171,251
!byte 250,250,254,254,254,251,251,251
!byte 255,255,255,255,255,255,255,255
!byte 191,191,191,191,191,191,191,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 219,251,251,221,239,239,255,255
!byte 159,191,255,255,255,255,255,255
!byte 170,251,186,254,255,255,255,255
!byte 150,191,191,191,255,255,255,255
!byte 155,254,251,251,255,255,255,255
!byte 165,237,237,251,255,255,255,255
!byte 191,255,255,255,255,255,255,255
!byte 254,254,254,254,254,254,254,250
!byte 245,246,246,246,230,231,230,230
!byte 191,175,175,191,191,175,239,239
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 254,254,254,254,254,254,254,254
!byte 255,254,255,255,255,255,255,255
!byte 239,175,175,175,239,255,187,251
!byte 251,255,255,254,254,254,254,255
!byte 255,255,255,255,255,255,255,255
!byte 191,191,191,191,191,191,191,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,254
!byte 175,175,175,189,189,253,245,245
!byte 119,126,123,235,235,235,235,174
!byte 175,175,239,175,255,254,239,171
!byte 255,255,175,239,255,191,191,253
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 254,254,254,254,254,254,254,250
!byte 255,255,255,255,255,255,255,255
!byte 251,187,175,175,175,191,191,255
!byte 251,251,255,255,254,238,238,254
!byte 255,255,255,255,239,235,235,235
!byte 191,191,127,127,191,191,191,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,239,251,250,250,250,234
!byte 255,251,250,254,254,191,175,213
!byte 255,255,255,255,255,254,254,253
!byte 186,250,250,255,86,119,255,127
!byte 175,175,189,191,255,255,255,255
!byte 219,235,255,255,255,255,255,255
!byte 213,255,254,255,255,234,250,254
!byte 251,255,239,127,255,255,255,255
!byte 255,255,250,254,250,250,235,235
!byte 254,251,251,250,235,235,233,235
!byte 255,255,247,191,255,191,255,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 175,175,175,191,191,191,191,191
!byte 255,254,254,254,255,250,250,251
!byte 255,191,191,191,189,189,191,255
!byte 175,239,255,191,191,189,189,189
!byte 238,111,111,111,111,110,110,110
!byte 127,127,191,191,191,191,191,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 254,255,254,239,253,255,255,255
!byte 255,251,255,234,175,253,253,249
!byte 255,255,255,255,169,174,191,191
!byte 255,254,250,169,151,95,255,255
!byte 247,215,245,255,187,170,170,187
!byte 149,101,170,171,174,254,255,255
!byte 166,154,218,121,233,245,255,255
!byte 85,90,170,174,255,255,255,255
!byte 170,169,190,254,234,255,255,255
!byte 170,90,214,254,255,255,255,255
!byte 126,190,186,185,186,187,247,251
!byte 127,255,255,127,255,191,191,239
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 191,191,191,191,191,189,191,191
!byte 174,186,171,239,239,239,239,239
!byte 170,171,175,175,191,191,191,255
!byte 151,159,159,191,191,191,191,191
!byte 126,127,255,254,254,254,254,254
!byte 191,191,191,191,191,191,191,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,254,255,255,255
!byte 255,191,191,191,255,255,255,255
!byte 255,255,254,254,254,254,254,255
!byte 250,246,254,126,118,222,94,122
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 234,254,255,255,255,255,255,255
!byte 122,186,255,255,255,255,255,255
!byte 127,175,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 251,251,254,254,254,254,254,251
!byte 175,239,255,255,254,254,255,255
!byte 255,255,255,175,255,255,191,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,254,254,250,250,250,234
!byte 255,255,255,255,255,255,255,250
!byte 223,223,126,126,126,122,122,250
!byte 255,255,255,255,255,255,255,255
!byte 191,191,191,191,191,191,191,189
!byte 250,254,254,254,254,254,190,190
!byte 191,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 251,255,255,251,171,235,235,234
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 127,255,255,255,255,255,239,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 251,234,235,251,255,238,238,238
!byte 170,234,234,250,251,255,255,251
!byte 235,239,239,239,239,239,235,250
!byte 255,255,239,239,239,255,239,191
!byte 255,255,255,191,191,235,235,187
!byte 255,255,255,255,255,255,239,187
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,254,250,250,218,234,234
!byte 127,255,255,255,255,254,254,250
!byte 95,127,127,255,255,254,250,250
!byte 175,191,191,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 233,233,249,249,250,250,250,250
!byte 190,190,191,191,191,191,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,239,239,239
!byte 250,250,255,127,235,239,239,239
!byte 251,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,251
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 191,191,191,191,191,239,239,239
!byte 247,255,251,239,239,239,239,175
!byte 235,239,254,254,254,190,191,255
!byte 191,255,254,250,250,234,230,170
!byte 191,191,255,255,255,255,191,170
!byte 190,255,255,255,255,255,191,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,253,254,250,250,250
!byte 191,255,255,255,255,255,255,255
!byte 175,191,191,255,255,255,255,253
!byte 191,191,191,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 250,250,250,250,250,250,250,250
!byte 254,254,254,254,253,253,253,253
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,251,249,233,233,233
!byte 231,191,191,190,254,254,251,245
!byte 186,250,234,239,239,239,254,250
!byte 255,255,191,191,255,255,255,255
!byte 255,254,251,239,239,239,191,191
!byte 191,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,238
!byte 255,255,255,255,255,255,191,191
!byte 255,255,255,255,255,255,251,238
!byte 255,255,255,255,255,255,251,238
!byte 255,255,255,255,255,255,255,255
!byte 223,223,254,254,254,254,254,250
!byte 175,191,191,175,171,171,89,93
!byte 239,187,251,255,255,255,255,255
!byte 255,191,191,175,127,191,255,251
!byte 255,251,251,251,255,255,255,255
!byte 191,191,191,191,191,191,254,254
!byte 255,255,250,235,191,191,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,254,254,254
!byte 175,191,191,255,255,255,255,253
!byte 255,254,250,250,250,233,233,233
!byte 171,171,175,175,175,191,191,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 175,175,175,175,175,175,159,159
!byte 254,254,254,254,254,254,254,250
!byte 255,255,255,255,255,255,254,255
!byte 238,255,249,237,181,238,251,187
!byte 121,217,235,173,175,223,119,222
!byte 183,151,159,127,126,126,250,170
!byte 191,191,191,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,250,239,239
!byte 255,255,255,255,255,191,239,239
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 254,254,254,255,255,255,255,255
!byte 239,239,239,191,190,255,255,255
!byte 191,191,191,190,174,255,255,255
!byte 238,238,238,238,251,255,255,255
!byte 254,251,239,239,234,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 175,175,103,230,254,254,254,190
!byte 223,222,222,255,255,254,255,239
!byte 251,255,251,255,253,255,183,254
!byte 255,255,255,255,255,126,255,254
!byte 255,255,254,223,255,247,254,191
!byte 159,158,181,122,254,239,254,250
!byte 255,255,191,191,255,255,127,123
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 253,253,254,250,250,250,250,250
!byte 255,255,253,253,245,149,170,170
!byte 127,255,254,254,250,170,187,170
!byte 255,255,254,255,187,255,238,187
!byte 255,255,255,255,255,239,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 107,107,107,106,234,254,255,255
!byte 254,254,254,254,254,250,250,109
!byte 254,251,254,251,254,175,165,165
!byte 238,187,238,187,238,251,238,123
!byte 182,222,183,215,186,239,186,235
!byte 253,239,255,239,255,255,255,255
!byte 191,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 191,190,187,187,187,187,187,186
!byte 251,187,187,251,251,251,187,251
!byte 255,239,187,251,239,191,191,171
!byte 255,239,187,187,187,187,187,239
!byte 255,239,187,251,239,191,191,171
!byte 255,239,187,187,187,187,187,239
!byte 255,255,254,254,254,254,254,254
!byte 255,175,175,175,175,239,238,238
!byte 255,250,238,239,239,239,238,235
!byte 255,239,239,239,239,239,238,235
!byte 255,255,250,238,254,234,238,235
!byte 255,255,250,238,239,239,239,239
!byte 255,239,239,238,235,238,238,238
!byte 255,255,250,238,234,239,238,235
!byte 255,255,255,255,255,255,255,255
!byte 254,250,250,255,255,255,215,255
!byte 234,251,250,171,190,186,255,255
!byte 237,175,249,254,254,191,254,169
!byte 85,174,159,191,255,255,246,233
!byte 191,191,251,223,254,254,111,85
!byte 246,253,255,174,154,235,253,255
!byte 234,238,190,255,255,190,190,170
!byte 255,255,255,191,255,191,255,255
!byte 255,255,255,255,255,255,255,255
!byte 249,250,250,254,254,255,255,255
!byte 255,95,127,127,123,234,170,234
!byte 254,251,238,251,238,123,94,95
!byte 239,187,238,187,238,187,239,191
!byte 187,255,255,191,255,239,255,191
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 170,166,86,255,255,255,255,255
!byte 255,255,255,247,229,170,170,170
!byte 106,106,106,165,85,255,255,255
!byte 94,175,174,175,191,255,255,255
!byte 239,187,255,255,255,255,255,255
!byte 191,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 191,239,239,250,255,255,255,255
!byte 251,239,239,191,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
!byte 255,255,255,255,255,255,255,255
|
src/test/resources/InterpreterTestSpecificationFactoryParser.g4 | google/polymorphicDSL | 3 | 1749 | parser grammar InterpreterTestSpecificationFactoryParser;
options {tokenVocab=AllGrammarsLexer; }
allInputs : ALL_INPUTS;
|
arch/ARM/RP/svd/rp2040/rp_svd-pads_qspi.ads | morbos/Ada_Drivers_Library | 2 | 26173 | -- Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
--
-- SPDX-License-Identifier: BSD-3-Clause
-- This spec has been automatically generated from rp2040.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package RP_SVD.PADS_QSPI is
pragma Preelaborate;
---------------
-- Registers --
---------------
type VOLTAGE_SELECT_VOLTAGE_SELECT_Field is
(-- Set voltage to 3.3V (DVDD >= 2V5)
Val_3V3,
-- Set voltage to 1.8V (DVDD <= 1V8)
Val_1V8)
with Size => 1;
for VOLTAGE_SELECT_VOLTAGE_SELECT_Field use
(Val_3V3 => 0,
Val_1V8 => 1);
-- Voltage select. Per bank control
type VOLTAGE_SELECT_Register is record
VOLTAGE_SELECT : VOLTAGE_SELECT_VOLTAGE_SELECT_Field :=
RP_SVD.PADS_QSPI.Val_3V3;
-- unspecified
Reserved_1_31 : HAL.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for VOLTAGE_SELECT_Register use record
VOLTAGE_SELECT at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-- Drive strength.
type GPIO_QSPI_SCLK_DRIVE_Field is
(Val_2MA,
Val_4MA,
Val_8MA,
Val_12MA)
with Size => 2;
for GPIO_QSPI_SCLK_DRIVE_Field use
(Val_2MA => 0,
Val_4MA => 1,
Val_8MA => 2,
Val_12MA => 3);
-- Pad control register
type GPIO_QSPI_SCLK_Register is record
-- Slew rate control. 1 = Fast, 0 = Slow
SLEWFAST : Boolean := False;
-- Enable schmitt trigger
SCHMITT : Boolean := True;
-- Pull down enable
PDE : Boolean := True;
-- Pull up enable
PUE : Boolean := False;
-- Drive strength.
DRIVE : GPIO_QSPI_SCLK_DRIVE_Field := RP_SVD.PADS_QSPI.Val_4MA;
-- Input enable
IE : Boolean := True;
-- Output disable. Has priority over output enable from peripherals
OD : Boolean := False;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for GPIO_QSPI_SCLK_Register use record
SLEWFAST at 0 range 0 .. 0;
SCHMITT at 0 range 1 .. 1;
PDE at 0 range 2 .. 2;
PUE at 0 range 3 .. 3;
DRIVE at 0 range 4 .. 5;
IE at 0 range 6 .. 6;
OD at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-- Drive strength.
type GPIO_QSPI_SD0_DRIVE_Field is
(Val_2MA,
Val_4MA,
Val_8MA,
Val_12MA)
with Size => 2;
for GPIO_QSPI_SD0_DRIVE_Field use
(Val_2MA => 0,
Val_4MA => 1,
Val_8MA => 2,
Val_12MA => 3);
-- Pad control register
type GPIO_QSPI_SD_Register is record
-- Slew rate control. 1 = Fast, 0 = Slow
SLEWFAST : Boolean := False;
-- Enable schmitt trigger
SCHMITT : Boolean := True;
-- Pull down enable
PDE : Boolean := False;
-- Pull up enable
PUE : Boolean := False;
-- Drive strength.
DRIVE : GPIO_QSPI_SD0_DRIVE_Field := RP_SVD.PADS_QSPI.Val_4MA;
-- Input enable
IE : Boolean := True;
-- Output disable. Has priority over output enable from peripherals
OD : Boolean := False;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for GPIO_QSPI_SD_Register use record
SLEWFAST at 0 range 0 .. 0;
SCHMITT at 0 range 1 .. 1;
PDE at 0 range 2 .. 2;
PUE at 0 range 3 .. 3;
DRIVE at 0 range 4 .. 5;
IE at 0 range 6 .. 6;
OD at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-- Drive strength.
type GPIO_QSPI_SS_DRIVE_Field is
(Val_2MA,
Val_4MA,
Val_8MA,
Val_12MA)
with Size => 2;
for GPIO_QSPI_SS_DRIVE_Field use
(Val_2MA => 0,
Val_4MA => 1,
Val_8MA => 2,
Val_12MA => 3);
-- Pad control register
type GPIO_QSPI_SS_Register is record
-- Slew rate control. 1 = Fast, 0 = Slow
SLEWFAST : Boolean := False;
-- Enable schmitt trigger
SCHMITT : Boolean := True;
-- Pull down enable
PDE : Boolean := False;
-- Pull up enable
PUE : Boolean := True;
-- Drive strength.
DRIVE : GPIO_QSPI_SS_DRIVE_Field := RP_SVD.PADS_QSPI.Val_4MA;
-- Input enable
IE : Boolean := True;
-- Output disable. Has priority over output enable from peripherals
OD : Boolean := False;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for GPIO_QSPI_SS_Register use record
SLEWFAST at 0 range 0 .. 0;
SCHMITT at 0 range 1 .. 1;
PDE at 0 range 2 .. 2;
PUE at 0 range 3 .. 3;
DRIVE at 0 range 4 .. 5;
IE at 0 range 6 .. 6;
OD at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
type PADS_QSPI_Peripheral is record
-- Voltage select. Per bank control
VOLTAGE_SELECT : aliased VOLTAGE_SELECT_Register;
-- Pad control register
GPIO_QSPI_SCLK : aliased GPIO_QSPI_SCLK_Register;
-- Pad control register
GPIO_QSPI_SD0 : aliased GPIO_QSPI_SD_Register;
-- Pad control register
GPIO_QSPI_SD1 : aliased GPIO_QSPI_SD_Register;
-- Pad control register
GPIO_QSPI_SD2 : aliased GPIO_QSPI_SD_Register;
-- Pad control register
GPIO_QSPI_SD3 : aliased GPIO_QSPI_SD_Register;
-- Pad control register
GPIO_QSPI_SS : aliased GPIO_QSPI_SS_Register;
end record
with Volatile;
for PADS_QSPI_Peripheral use record
VOLTAGE_SELECT at 16#0# range 0 .. 31;
GPIO_QSPI_SCLK at 16#4# range 0 .. 31;
GPIO_QSPI_SD0 at 16#8# range 0 .. 31;
GPIO_QSPI_SD1 at 16#C# range 0 .. 31;
GPIO_QSPI_SD2 at 16#10# range 0 .. 31;
GPIO_QSPI_SD3 at 16#14# range 0 .. 31;
GPIO_QSPI_SS at 16#18# range 0 .. 31;
end record;
PADS_QSPI_Periph : aliased PADS_QSPI_Peripheral
with Import, Address => PADS_QSPI_Base;
end RP_SVD.PADS_QSPI;
|
examples/delegate.adb | ytomino/drake | 33 | 25187 | with Ada.Strings.Unbounded;
with Ada.Tags.Delegating;
procedure delegate is
package I is
type Intf is limited interface;
procedure Method (Object : Intf) is abstract;
end I;
package A is
type Aggregated_Object (Message : access String) is new I.Intf with null record;
procedure Dummy (Object : Aggregated_Object);
overriding procedure Method (Object : Aggregated_Object);
end A;
package body A is
procedure Dummy (Object : Aggregated_Object) is
begin
null;
end Dummy;
overriding procedure Method (Object : Aggregated_Object) is
begin
Ada.Debug.Put (Object.Message.all);
end Method;
end A;
package C is
type String_Access is access String;
type Container (Message : String_Access) is tagged limited record
Field : aliased A.Aggregated_Object (Message);
end record;
function Get (Object : not null access Container'Class) return access I.Intf'Class;
end C;
package body C is
function Get (Object : not null access Container'Class) return access I.Intf'Class is
begin
return I.Intf'Class (Object.Field)'Access;
end Get;
procedure Impl is new Ada.Tags.Delegating.Implements (Container, I.Intf, Get);
begin
Impl;
end C;
package D is
type Container (Additional : C.String_Access) is
new C.Container (Additional) with
record
Controlled_Field : Ada.Strings.Unbounded.Unbounded_String;
end record;
end D;
begin
declare
Obj : aliased C.Container (new String'("Hello."));
X : Boolean := C.Container'Class (Obj) in I.Intf'Class;
Intf : access I.Intf'Class := I.Intf'Class (C.Container'Class (Obj))'Access;
begin
if X then
Ada.Debug.Put ("membership test is ok.");
end if;
Ada.Debug.Put (Ada.Tags.Expanded_Name (Intf'Tag));
I.Method (Intf.all);
end;
declare
Obj : aliased D.Container (new String'("Hello, derived."));
X : Boolean := D.Container'Class (Obj) in I.Intf'Class;
Intf : access I.Intf'Class := I.Intf'Class (D.Container'Class (Obj))'Access;
begin
if X then
Ada.Debug.Put ("membership test for derived type is ok.");
end if;
Ada.Debug.Put (Ada.Tags.Expanded_Name (Intf'Tag));
I.Method (Intf.all);
end;
end delegate;
|
Transynther/x86/_processed/NONE/_st_zr_un_/i7-8650U_0xd2.log_109_1440.asm | ljhsiun2/medusa | 9 | 7737 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x15e49, %rax
nop
xor $41326, %r13
movb (%rax), %dl
nop
inc %rdx
lea addresses_D_ht+0xff49, %rbx
cmp $42525, %r9
mov (%rbx), %si
nop
nop
nop
nop
cmp %rbx, %rbx
lea addresses_D_ht+0x18439, %rsi
lea addresses_WC_ht+0x1425d, %rdi
clflush (%rdi)
nop
nop
nop
mfence
mov $3, %rcx
rep movsw
nop
nop
nop
nop
add %rax, %rax
lea addresses_WT_ht+0xa975, %rsi
lea addresses_WC_ht+0xfcc9, %rdi
nop
nop
add $64626, %rax
mov $110, %rcx
rep movsb
nop
nop
nop
nop
add $56813, %rdi
lea addresses_normal_ht+0x16849, %rsi
lea addresses_UC_ht+0xdf49, %rdi
clflush (%rsi)
nop
cmp %rdx, %rdx
mov $42, %rcx
rep movsw
sub $43909, %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r8
push %r9
push %rbp
push %rdi
push %rdx
push %rsi
// Store
lea addresses_normal+0xf4a9, %rsi
nop
nop
cmp $7137, %rdi
mov $0x5152535455565758, %r10
movq %r10, %xmm4
vmovaps %ymm4, (%rsi)
nop
nop
nop
nop
xor %r10, %r10
// Store
lea addresses_D+0x7609, %r8
nop
nop
nop
inc %r9
movw $0x5152, (%r8)
nop
nop
nop
and $37005, %rdx
// Store
lea addresses_WC+0x2f49, %rbp
clflush (%rbp)
inc %r10
mov $0x5152535455565758, %rdi
movq %rdi, (%rbp)
nop
nop
nop
nop
cmp %rbp, %rbp
// Faulty Load
lea addresses_UC+0xef49, %rdi
nop
nop
cmp %r10, %r10
mov (%rdi), %r9w
lea oracles, %r10
and $0xff, %r9
shlq $12, %r9
mov (%r10,%r9,1), %r9
pop %rsi
pop %rdx
pop %rdi
pop %rbp
pop %r9
pop %r8
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 32, 'AVXalign': True, 'NT': True, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 11, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}}
{'58': 74, '30': 1, '06': 5, '00': 4, '16': 1, '10': 1, '08': 1, '20': 1, '18': 2, '0e': 2, '26': 4, '38': 3, '0c': 2, '92': 1, '1e': 1, '14': 1, '0a': 1, '1a': 1, '28': 3}
58 58 58 30 58 58 58 58 58 58 58 58 06 58 58 00 16 58 10 58 58 58 08 58 58 20 58 00 06 58 58 18 58 58 0e 58 58 26 26 58 38 0c 58 58 58 0c 26 58 58 58 92 58 58 1e 06 58 58 58 58 58 58 58 58 58 58 58 00 06 58 58 58 58 58 14 58 0a 26 58 38 58 58 1a 58 58 58 58 06 28 38 58 58 18 58 58 58 28 58 58 58 58 58 00 28 58 58 58 58 0e 58
*/
|
test/asset/agda-stdlib-1.0/Data/Maybe.agda | omega12345/agda-mode | 0 | 11485 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- The Maybe type
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Maybe where
open import Data.Unit using (⊤)
open import Data.Empty using (⊥)
open import Data.Bool.Base using (T)
open import Data.Maybe.Relation.Unary.All
open import Data.Maybe.Relation.Unary.Any
------------------------------------------------------------------------
-- The base type and some operations
open import Data.Maybe.Base public
------------------------------------------------------------------------
-- Using Any and All to define Is-just and Is-nothing
Is-just : ∀ {a} {A : Set a} → Maybe A → Set a
Is-just = Any (λ _ → ⊤)
Is-nothing : ∀ {a} {A : Set a} → Maybe A → Set a
Is-nothing = All (λ _ → ⊥)
to-witness : ∀ {p} {P : Set p} {m : Maybe P} → Is-just m → P
to-witness (just {x = p} _) = p
to-witness-T : ∀ {p} {P : Set p} (m : Maybe P) → T (is-just m) → P
to-witness-T (just p) _ = p
to-witness-T nothing ()
|
src/lib/pce/loadtiles.asm | freem/freem_pong | 1 | 88527 | <reponame>freem/freem_pong
; PCE VRAM tile loading routines
;==============================================================================;
; pce_LoadTilesBG
; Loads 4BPP BG tiles into the PCE VRAM.
; (Params)
; tmp00,tmp01 - tile source
; tmp02,tmp03 - vram destination
; tmp04 - number of tiles to copy
.proc pce_LoadTilesBG
; set VRAM address for write
st0 #VDCREG_MAWR
lda tmp02
sta a:VDC_DATA_LO
lda tmp03
sta a:VDC_DATA_HI
; prepare write mode
st0 #VDCREG_VRWD
;-- prepare quickTIA --;
; source address
ldx tmp00
ldy tmp01
stx pce_quickTIA+1
sty pce_quickTIA+2
; destination address
ldx #<VDC_DATA_LO
ldy #>VDC_DATA_LO
stx pce_quickTIA+3
sty pce_quickTIA+4
; length (one tile = 32 bytes, so numtiles << 5)
stz tmp05 ; used for upper bits
clc ; clear carry to prevent dirty bits
.repeat 5
rol tmp04
rol tmp05
.endrep
ldx tmp04
ldy tmp05
stx pce_quickTIA+5
sty pce_quickTIA+6
; ugly hack to jump to real zero page location
jmp pce_quickTIA+__PCE_ZP_START__
.endproc
;==============================================================================;
; pce_LoadTilesSPR
; Loads 4BPP Sprite tiles into the PCE VRAM.
; (Params)
; tmp00,tmp01 - tile source
; tmp02,tmp03 - vram destination
; tmp04 - number of tiles to copy
.proc pce_LoadTilesSPR
; set VRAM address for write
st0 #VDCREG_MAWR
lda tmp02
sta a:VDC_DATA_LO
lda tmp03
sta a:VDC_DATA_HI
; prepare write mode
st0 #VDCREG_VRWD
;-- prepare quickTIA --;
; source address
ldx tmp00
ldy tmp01
stx pce_quickTIA+1
sty pce_quickTIA+2
; destination address
ldx #<VDC_DATA_LO
ldy #>VDC_DATA_LO
stx pce_quickTIA+3
sty pce_quickTIA+4
; length (one tile = 128 bytes, so numtiles << 7)
stz tmp05 ; used for upper bits
clc ; clear carry to prevent dirty bits
.repeat 7
rol tmp04
rol tmp05
.endrep
ldx tmp04
ldy tmp05
stx pce_quickTIA+5
sty pce_quickTIA+6
; ugly hack to jump to real zero page location
jmp pce_quickTIA+__PCE_ZP_START__
.endproc
|
src/01.simple.asm | myyrakle/os | 0 | 23474 | ; NASM Assembly
; 마지막 2바이트를 제외한 510번을 빈 값으로 채움
; times는 뒤에 숫자만큼 반복해주는 명령
; $=현재 주소. $$=세그먼트 시작주소
; 510-($-$$)은 지금부터 510번째까지.
times 510-($-$$) db 0x00
; 부트로더 식별 단어 2바이트 삽입
dw 0xaa55
|
programs/oeis/027/A027927.asm | karttu/loda | 1 | 4630 | ; A027927: Number of plane regions after drawing (in general position) a convex n-gon and all its diagonals.
; 1,2,5,12,26,51,92,155,247,376,551,782,1080,1457,1926,2501,3197,4030,5017,6176,7526,9087,10880,12927,15251,17876,20827,24130,27812,31901,36426,41417,46905,52922,59501,66676,74482,82955,92132,102051,112751,124272,136655,149942,164176,179401,195662,213005,231477,251126,272001,294152,317630,342487,368776,396551,425867,456780,489347,523626,559676,597557,637330,679057,722801,768626,816597,866780,919242,974051,1031276,1090987,1153255,1218152,1285751,1356126,1429352,1505505,1584662,1666901,1752301,1840942,1932905,2028272,2127126,2229551,2335632,2445455,2559107,2676676,2798251,2923922,3053780,3187917,3326426,3469401,3616937,3769130,3926077,4087876,4254626,4426427,4603380,4785587,4973151,5166176,5364767,5569030,5779072,5995001,6216926,6444957,6679205,6919782,7166801,7420376,7680622,7947655,8221592,8502551,8790651,9086012,9388755,9699002,10016876,10342501,10676002,11017505,11367137,11725026,12091301,12466092,12849530,13241747,13642876,14053051,14472407,14901080,15339207,15786926,16244376,16711697,17189030,17676517,18174301,18682526,19201337,19730880,20271302,20822751,21385376,21959327,22544755,23141812,23750651,24371426,25004292,25649405,26306922,26977001,27659801,28355482,29064205,29786132,30521426,31270251,32032772,32809155,33599567,34404176,35223151,36056662,36904880,37767977,38646126,39539501,40448277,41372630,42312737,43268776,44240926,45229367,46234280,47255847,48294251,49349676,50422307,51512330,52619932,53745301,54888626,56050097,57229905,58428242,59645301,60881276,62136362,63410755,64704652,66018251,67351751,68705352,70079255,71473662,72888776,74324801,75781942,77260405,78760397,80282126,81825801,83391632,84979830,86590607,88224176,89880751,91560547,93263780,94990667,96741426,98516276,100315437,102139130,103987577,105861001,107759626,109683677,111633380,113608962,115610651,117638676,119693267,121774655,123883072,126018751,128181926,130372832,132591705,134838782,137114301,139418501,141751622,144113905,146505592,148926926,151378151,153859512,156371255,158913627,161486876
add $0,1
bin $0,2
add $0,3
bin $0,2
mov $1,$0
div $1,3
|
other.7z/SFC.7z/SFC/ソースデータ/MarioKart/edit_1.asm | prismotizm/gigaleak | 0 | 20386 | <filename>other.7z/SFC.7z/SFC/ソースデータ/MarioKart/edit_1.asm<gh_stars>0
Name: edit_1.asm
Type: file
Size: 4413
Last-Modified: '1992-06-02T15:00:00Z'
SHA-1: 8AD5ED432E2F6DD6AEA058844E2FA70ECCC9D071
Description: null
|
src/main/resources/LogicExpr.g4 | wangxinxx/jhi-ant-vue | 4 | 6458 | //LogicExpr.g4文件
grammar LogicExpr;
stat:
expr EOF
;
expr: expr AND expr # and
| expr OR expr # or
| '(' expr ')' # group
| VAR # var
;
AND: 'and' ;
OR: 'or' ;
VAR: [a-zA-Z0-9_]+ ;
WS: [ \t\r\n]+ -> skip ;
|
MASM_Practice/54_Struct_Macro.asm | TuringGu/RELearning | 0 | 179873 | <reponame>TuringGu/RELearning
.586
.MODEL flat,stdcall
option casemap:none
include windows.inc
include user32.inc
include kernel32.inc
include msvcrt.inc
includelib user32.lib
includelib kernel32.lib
includelib msvcrt.lib
;struct
myStruct struct
sd01 dword ?
sd02 dword ?
myStruct ends
;macro
myMacro MACRO char
mov eax,char
ENDM
.data
myStruct01 myStruct <>
.code
main PROC
mov myStruct01.sd01,1
mov eax,myStruct01.sd01
myMacro 10
mov eax,eax
main ENDP
END main |
Cubical/Algebra/CommRing/Instances/Polynomials/MultivariatePoly-notationZ.agda | thomas-lamiaux/cubical | 0 | 13276 | {-# OPTIONS --safe --experimental-lossy-unification #-}
module Cubical.Algebra.CommRing.Instances.Polynomials.MultivariatePoly-notationZ where
open import Cubical.Foundations.Prelude
open import Cubical.Data.Nat
open import Cubical.Data.FinData
open import Cubical.Relation.Nullary
open import Cubical.Algebra.Ring
open import Cubical.Algebra.CommRing
open import Cubical.Algebra.CommRing.FGIdeal
open import Cubical.Algebra.CommRing.QuotientRing
open import Cubical.Algebra.CommRing.Instances.Int
open import Cubical.Algebra.CommRing.Instances.Polynomials.MultivariatePoly
renaming (PolyCommRing to A[X1,···,Xn] ; Poly to A[x1,···,xn])
open import Cubical.Algebra.CommRing.Instances.Polynomials.MultivariatePoly-Quotient
-- Notations for ℤ polynomial rings
ℤ[X] : CommRing ℓ-zero
ℤ[X] = A[X1,···,Xn] ℤCommRing 1
ℤ[x] : Type ℓ-zero
ℤ[x] = fst ℤ[X]
ℤ[X,Y] : CommRing ℓ-zero
ℤ[X,Y] = A[X1,···,Xn] ℤCommRing 2
ℤ[x,y] : Type ℓ-zero
ℤ[x,y] = fst ℤ[X,Y]
ℤ[X,Y,Z] : CommRing ℓ-zero
ℤ[X,Y,Z] = A[X1,···,Xn] ℤCommRing 3
ℤ[x,y,z] : Type ℓ-zero
ℤ[x,y,z] = fst ℤ[X,Y,Z]
ℤ[X1,···,Xn] : (n : ℕ) → CommRing ℓ-zero
ℤ[X1,···,Xn] n = A[X1,···,Xn] ℤCommRing n
ℤ[x1,···,xn] : (n : ℕ) → Type ℓ-zero
ℤ[x1,···,xn] n = fst (ℤ[X1,···,Xn] n)
-- Notation for quotiented ℤ polynomial ring
<X> : FinVec ℤ[x] 1
<X> = <Xkʲ> ℤCommRing 1 0 1
<X²> : FinVec ℤ[x] 1
<X²> = <Xkʲ> ℤCommRing 1 0 2
<X³> : FinVec ℤ[x] 1
<X³> = <Xkʲ> ℤCommRing 1 0 3
<Xᵏ> : (k : ℕ) → FinVec ℤ[x] 1
<Xᵏ> k = <Xkʲ> ℤCommRing 1 0 k
ℤ[X]/X : CommRing ℓ-zero
ℤ[X]/X = A[X1,···,Xn]/<Xkʲ> ℤCommRing 1 0 1
ℤ[x]/x : Type ℓ-zero
ℤ[x]/x = fst ℤ[X]/X
ℤ[X]/X² : CommRing ℓ-zero
ℤ[X]/X² = A[X1,···,Xn]/<Xkʲ> ℤCommRing 1 0 2
ℤ[x]/x² : Type ℓ-zero
ℤ[x]/x² = fst ℤ[X]/X²
ℤ[X]/X³ : CommRing ℓ-zero
ℤ[X]/X³ = A[X1,···,Xn]/<Xkʲ> ℤCommRing 1 0 3
ℤ[x]/x³ : Type ℓ-zero
ℤ[x]/x³ = fst ℤ[X]/X³
ℤ[X1,···,Xn]/<X1,···,Xn> : (n : ℕ) → CommRing ℓ-zero
ℤ[X1,···,Xn]/<X1,···,Xn> n = A[X1,···,Xn]/<X1,···,Xn> ℤCommRing n
ℤ[x1,···,xn]/<x1,···,xn> : (n : ℕ) → Type ℓ-zero
ℤ[x1,···,xn]/<x1,···,xn> n = fst (ℤ[X1,···,Xn]/<X1,···,Xn> n)
-- Warning there is two possible definitions of ℤ[X]
-- they only holds up to a path
ℤ'[X]/X : CommRing ℓ-zero
ℤ'[X]/X = A[X1,···,Xn]/<X1,···,Xn> ℤCommRing 1
-- there is a unification problem that keep pop in up everytime I modify something
-- equivℤ[X] : ℤ'[X]/X ≡ ℤ[X]/X
-- equivℤ[X] = cong₂ _/_ refl (cong (λ X → genIdeal (A[X1,···,Xn] ℤCommRing {!!}) X) {!!})
|
case-studies/performance/synthesis/alloy/model/test.als | uwplse/memsynth | 19 | 850 | <reponame>uwplse/memsynth<gh_stars>10-100
module test
open program
sig Test {
Events: set MemoryEvent,
Reads: set MemoryEvent,
Writes: set MemoryEvent,
Syncs: set MemoryEvent,
Lwsyncs: set MemoryEvent,
proc: MemoryEvent->lone Processor,
loc: MemoryEvent->lone Location,
data: MemoryEvent->lone Value,
po: MemoryEvent->set MemoryEvent,
dp: MemoryEvent->set MemoryEvent,
finalValue: Location->lone Value
}
|
tests/src/test.adb | onox/emojis | 7 | 19693 | with Ada.Text_IO;
with Ada.Strings.Fixed;
with Emojis;
procedure Test is
use Emojis;
use Ada.Text_IO;
package SF renames Ada.Strings.Fixed;
begin
Put_Line ("Text emojis:");
for Pair of Emojis.Text_Emojis loop
Put_Line
(SF.Tail (+Pair.Text, 3) & " = " & Emojis.Replace (":" & (+Pair.Label) & ":"));
end loop;
Put_Line ("");
Put_Line ("Labels and text emojis:");
Put_Line ("'" & Emojis.Replace
("Ada is :heart_eyes: :sparkles:" & ", " &
"Rust is :crab::church::rocket::military_helmet:" & ", " &
"C++ is :woozy_face:" & ", " &
"C is :boom:" & ", " &
"Perl is XO= :p") & "'");
Put_Line ("");
Put_Line ("Input completions:");
Put_Line ("'" & Emojis.Replace
("XD :o :p", Completions => Emojis.Lower_Case_Text_Emojis) & "'");
Put_Line ("");
Put_Line ("1 codepoint:");
Put_Line ("'" & Emojis.Replace (":foot: :sparkles: :face_with_monocle:") & "'");
Put_Line ("'" & Emojis.Replace
(":bagel: :duck: :dango: :bacon: :crab: :sushi: :fried_shrimp:") & "'");
Put_Line ("'" & Emojis.Replace
(":fish_cake: :owl: :tumbler_glass: :unicorn_face: :pancakes:") & "'");
Put_Line ("'" & Emojis.Replace
(":lollipop: :mate_drink: :waffle: :ice_cube: :sandwich:") & "'");
Put_Line ("'" & Emojis.Replace (":telescope: :checkered_flag: :yum:") & "'");
Put_Line ("");
Put_Line ("2 codepoints:");
Put_Line ("'" & Emojis.Replace (":radioactive_sign: :alembic:") & "'");
Put_Line ("'" & Emojis.Replace
(":desktop_computer: :joystick: :ballot_box_with_ballot: :shield:") & "'");
Put_Line ("");
Put_Line ("3 codepoints:");
Put_Line ("'" &
Emojis.Replace (":female-scientist: :face_with_spiral_eyes: :male-astronaut:") & "'");
end Test;
|
programs/oeis/111/A111955.asm | jmorken/loda | 1 | 81484 | <gh_stars>1-10
; A111955: a(n) = A078343(n) + (-1)^n.
; 0,1,4,7,20,45,112,267,648,1561,3772,9103,21980,53061,128104,309267,746640,1802545,4351732,10506007,25363748,61233501,147830752,356895003,861620760,2080136521,5021893804,12123924127,29269742060,70663408245
mov $27,$0
mov $29,2
lpb $29
mov $0,$27
sub $29,1
add $0,$29
sub $0,1
mov $2,$0
mod $2,2
mul $2,2
clr $3,2
cal $0,48655 ; Generalized Pellian with second term equal to 5.
sub $2,$0
sub $3,$2
div $3,2
mov $1,$3
mov $30,$29
lpb $30
mov $28,$1
sub $30,1
lpe
lpe
lpb $27
mov $27,0
sub $28,$1
lpe
mov $1,$28
|
cards/bn4/ModCards/134-A029 PET Screen Color Pink (0F).asm | RockmanEXEZone/MMBN-Mod-Card-Kit | 10 | 246576 | <reponame>RockmanEXEZone/MMBN-Mod-Card-Kit
.include "defaults_mod.asm"
table_file_jp equ "exe4-utf8.tbl"
table_file_en equ "bn4-utf8.tbl"
game_code_len equ 3
game_code equ 0x4234574A // B4WJ
game_code_2 equ 0x42345745 // B4WE
game_code_3 equ 0x42345750 // B4WP
card_type equ 1
card_id equ 29
card_no equ "029"
card_sub equ "Mod Card 029"
card_sub_x equ 64
card_desc_len equ 3
card_desc_1 equ "Address 0F"
card_desc_2 equ "PET Screen Color:"
card_desc_3 equ "Pink"
card_name_jp_full equ "PET画面カラー:ピンク"
card_name_jp_game equ "PET画面カラー:ピンク"
card_name_en_full equ "PET Screen Color: Pink"
card_name_en_game equ "PET Scrn Color: Pink"
card_address equ "0F"
card_address_id equ 5
card_bug equ 0
card_wrote_en equ "PET Scrn Color: Pink"
card_wrote_jp equ "PET画面カラー:ピンク" |
asm/6502/test/modes/mode_0.asm | rampa069/clc88 | 1 | 29229 | <gh_stars>1-10
icl '../../os/symbols.asm'
org BOOTADDR
lda #0
ldy #0
ldx #OS_SET_VIDEO_MODE
jsr OS_CALL
lda VSTATUS
and #(255 - VSTATUS_EN_INTS)
sta VSTATUS
mwa #vblank VBLANK_VECTOR_USER
mwa #dli HBLANK_VECTOR_USER
lda #1
sta VLINEINT
lda VSTATUS
ora #VSTATUS_EN_INTS
sta VSTATUS
mwa DISPLAY_START VRAM_TO_RAM
jsr lib_vram_to_ram
ldy #0
copy:
lda message, y
cmp #255
beq rainbow
sta (RAM_TO_VRAM), y
iny
bne copy
ldx #0
rainbow:
clc
lda VCOUNT
adc FRAMECOUNT
sta WSYNC
sta VCOLOR0
jmp rainbow
dli:
pha
lda #$66
sta WSYNC
sta VCOLOR0
pla
rts
vblank:
pha
lda #$BF
sta VCOLOR0
pla
rts
message:
.by "Hello world!!!!", 96, 255
icl '../../os/stdlib.asm'
|
assembly/08/digitsum2.asm | mahzoun/programs | 0 | 24648 | section .data
number dw 1234
section .text
global _start
addeven:
add r12, rdx
jmp do
_start:
mov ax, [number]
xor r8, r8 ;result will be in r8
xor r9, r9
xor r12, r12
mov cx, 10
do:
inc r9
xor rdx, rdx
div cx ; smallest digit is in cx
and r9, 1
cmp r9, 0
je addeven
add r8, rdx
cmp ax, 0
jne do
fin:
mov rax, r8
mov rbx, r12
jmp exit
exit:
mov ebx, 0
mov eax, 1
int 80h
|
audio/sfx/cut_1.asm | adhi-thirumala/EvoYellow | 16 | 170624 | <filename>audio/sfx/cut_1.asm
SFX_Cut_1_Ch1:
unknownnoise0x20 2, 247, 36
unknownnoise0x20 2, 247, 52
unknownnoise0x20 4, 247, 68
unknownnoise0x20 8, 244, 85
unknownnoise0x20 8, 241, 68
endchannel
|
programs/oeis/092/A092266.asm | neoneye/loda | 22 | 91174 | <filename>programs/oeis/092/A092266.asm
; A092266: Expansion of (1+4x)/AGM(1+4x,1-4x) where AGM denotes the arithmetic-geometric mean.
; 1,4,4,16,36,144,400,1600,4900,19600,63504,254016,853776,3415104,11778624,47114496,165636900,662547600,2363904400,9455617600,34134779536,136539118144,497634306624,1990537226496,7312459672336
seq $0,63886 ; Number of n-step walks on a line starting from the origin but not returning to it.
pow $0,2
|
home/init.asm | Dev727/ancientplatinum | 1 | 28893 | Reset::
di
call MapSetup_Sound_Off
xor a
ldh [hMapAnims], a
call ClearPalettes
xor a
ldh [rIF], a
ld a, 1 << VBLANK
ldh [rIE], a
ei
ld hl, wcfbe
set 7, [hl]
ld c, 32
call DelayFrames
jr Init
_Start::
cp $11
jr z, .cgb
xor a
jr .load
.cgb
ld a, $1
.load
ldh [hCGB], a
ld a, $1
ldh [hSystemBooted], a
Init::
di
xor a
ldh [rIF], a
ldh [rIE], a
ldh [rRP], a
ldh [rSCX], a
ldh [rSCY], a
ldh [rSB], a
ldh [rSC], a
ldh [rWX], a
ldh [rWY], a
ldh [rBGP], a
ldh [rOBP0], a
ldh [rOBP1], a
ldh [rTMA], a
ldh [rTAC], a
ld [WRAM1_Begin], a
ld a, %100 ; Start timer at 4096Hz
ldh [rTAC], a
.wait
ldh a, [rLY]
cp LY_VBLANK + 1
jr nz, .wait
xor a
ldh [rLCDC], a
; Clear WRAM bank 0
ld hl, WRAM0_Begin
ld bc, WRAM0_End - WRAM0_Begin
.ByteFill:
ld [hl], 0
inc hl
dec bc
ld a, b
or c
jr nz, .ByteFill
ld sp, wStack
; Clear HRAM
ldh a, [hCGB]
push af
ldh a, [hSystemBooted]
push af
xor a
ld hl, HRAM_Begin
ld bc, HRAM_End - HRAM_Begin
call ByteFill
pop af
ldh [hSystemBooted], a
pop af
ldh [hCGB], a
ld a, -1
ldh [hSRAMBank], a
call ClearWRAM
ld a, 1
ldh [rSVBK], a
call ClearVRAM
call ClearSprites
call ClearsScratch
ld a, BANK(GameInit) ; aka BANK(WriteOAMDMACodeToHRAM)
rst Bankswitch
call WriteOAMDMACodeToHRAM
xor a
ldh [hMapAnims], a
ldh [hSCX], a
ldh [hSCY], a
ldh [rJOYP], a
ld a, $8 ; HBlank int enable
ldh [rSTAT], a
ld a, $90
ldh [hWY], a
ldh [rWY], a
ld a, 7
ldh [hWX], a
ldh [rWX], a
ld a, LCDC_DEFAULT ; %11100011
; LCD on
; Win tilemap 1
; Win on
; BG/Win tiledata 0
; BG Tilemap 0
; OBJ 8x8
; OBJ on
; BG on
ldh [rLCDC], a
ld a, CONNECTION_NOT_ESTABLISHED
ldh [hSerialConnectionStatus], a
farcall InitCGBPals
ld a, HIGH(vBGMap1)
ldh [hBGMapAddress + 1], a
xor a ; LOW(vBGMap1)
ldh [hBGMapAddress], a
farcall StartClock
xor a
ld [MBC3LatchClock], a
ld [MBC3SRamEnable], a
ldh a, [hCGB]
and a
jr z, .no_double_speed
call NormalSpeed
.no_double_speed
xor a
ldh [rIF], a
ld a, IE_DEFAULT
ldh [rIE], a
ei
call DelayFrame
predef InitSGBBorder ; SGB init
call MapSetup_Sound_Off
xor a
ld [wMapMusic], a
jp GameInit
ClearVRAM::
; Wipe VRAM banks 0 and 1
ld a, 1
ldh [rVBK], a
call .clear
xor a ; 0
ldh [rVBK], a
.clear
ld hl, VRAM_Begin
ld bc, VRAM_End - VRAM_Begin
xor a
call ByteFill
ret
ClearWRAM::
; Wipe swappable WRAM banks (1-7)
; Assumes CGB or AGB
ld a, 1
.bank_loop
push af
ldh [rSVBK], a
xor a
ld hl, WRAM1_Begin
ld bc, WRAM1_End - WRAM1_Begin
call ByteFill
pop af
inc a
cp 8
jr c, .bank_loop
ret
ClearsScratch::
; Wipe the first 32 bytes of sScratch
ld a, BANK(sScratch)
call GetSRAMBank
ld hl, sScratch
ld bc, $20
xor a
call ByteFill
call CloseSRAM
ret
|
src/frontend/fleetadmiral/src/components/datagrid/grid_formula/grid_formula.g4 | giorgiozoppi/fleetadmiral | 0 | 4934 | <filename>src/frontend/fleetadmiral/src/components/datagrid/grid_formula/grid_formula.g4
grammar grid_formula;
formulas
: formula EOF
;
formula
: '(' formula op formula ')' | NUMBER
;
op
: '/' | '+' | '*' | '-' | '%'
;
NUMBER
: [0-9]+
; |
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0x48.log_21829_2155.asm | ljhsiun2/medusa | 9 | 242824 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0x48.log_21829_2155.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r15
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x1dfdf, %rsi
lea addresses_A_ht+0x3d51, %rdi
nop
nop
nop
add %r15, %r15
mov $124, %rcx
rep movsl
nop
nop
nop
nop
nop
add %rax, %rax
lea addresses_D_ht+0xc8df, %rdx
nop
nop
nop
inc %rax
movl $0x61626364, (%rdx)
add %rax, %rax
lea addresses_A_ht+0x1c05f, %rdx
clflush (%rdx)
nop
nop
dec %r13
mov (%rdx), %esi
nop
and %rdi, %rdi
lea addresses_WC_ht+0x1dd5f, %rdi
nop
nop
nop
and %rdx, %rdx
movb (%rdi), %r13b
dec %r15
lea addresses_D_ht+0xdd67, %rax
add %r13, %r13
vmovups (%rax), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rsi
nop
nop
nop
nop
nop
sub $56624, %rsi
lea addresses_WC_ht+0x15c2f, %rsi
lea addresses_A_ht+0x1b6df, %rdi
nop
xor $64701, %rbp
mov $7, %rcx
rep movsw
nop
cmp $58237, %rdx
lea addresses_normal_ht+0xecdf, %rdx
nop
inc %rcx
movl $0x61626364, (%rdx)
nop
and $15770, %rdi
lea addresses_WC_ht+0x7df, %rsi
nop
nop
nop
nop
nop
cmp %rdx, %rdx
mov (%rsi), %r13w
nop
xor %rax, %rax
lea addresses_WT_ht+0x103df, %rax
clflush (%rax)
nop
sub %rsi, %rsi
movw $0x6162, (%rax)
nop
nop
nop
nop
and %r15, %r15
lea addresses_WC_ht+0x150df, %rsi
lea addresses_WT_ht+0x1937f, %rdi
nop
nop
nop
nop
nop
xor %rax, %rax
mov $15, %rcx
rep movsb
nop
nop
nop
nop
nop
cmp %rax, %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r15
push %rcx
push %rdi
// Faulty Load
lea addresses_RW+0x98df, %rcx
lfence
movb (%rcx), %r14b
lea oracles, %r13
and $0xff, %r14
shlq $12, %r14
mov (%r13,%r14,1), %r14
pop %rdi
pop %rcx
pop %r15
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': True, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': True, 'congruent': 0, 'size': 1, 'same': True, 'NT': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 11, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 7, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 7, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
src/main/java/org/ballerinalang/plugins/idea/grammar/BallerinaParser.g4 | Shan1024/ballerina-idea-plugin | 0 | 3567 | /*
* NOTE - Do not modify.
*/
parser grammar BallerinaParser;
options {
language = Java;
tokenVocab = BallerinaLexer;
}
//todo revisit blockStatement
// starting point for parsing a bal file
compilationUnit
: (importDeclaration | namespaceDeclaration)*
(documentationAttachment? deprecatedAttachment? annotationAttachment* definition)*
EOF
;
packageName
: Identifier (DOT Identifier)* version?
;
version
: (VERSION Identifier)
;
importDeclaration
: IMPORT (orgName DIV)? packageName (AS Identifier)? SEMICOLON
;
orgName
: Identifier
;
definition
: serviceDefinition
| functionDefinition
| typeDefinition
| annotationDefinition
| globalVariableDefinition
| globalEndpointDefinition
;
serviceDefinition
: SERVICE (LT nameReference GT)? Identifier serviceEndpointAttachments? serviceBody
;
serviceEndpointAttachments
: BIND nameReference (COMMA nameReference)*
| BIND recordLiteral
;
serviceBody
: LEFT_BRACE endpointDeclaration* (variableDefinitionStatement | namespaceDeclarationStatement)* resourceDefinition* RIGHT_BRACE
;
resourceDefinition
: annotationAttachment* documentationAttachment? deprecatedAttachment? Identifier LEFT_PARENTHESIS resourceParameterList? RIGHT_PARENTHESIS callableUnitBody
;
resourceParameterList
: ENDPOINT Identifier (COMMA parameterList)?
| parameterList
;
callableUnitBody
: LEFT_BRACE endpointDeclaration* statement* RIGHT_BRACE
| LEFT_BRACE endpointDeclaration* workerDeclaration+ RIGHT_BRACE
;
functionDefinition
: (PUBLIC)? (NATIVE)? FUNCTION (LT parameter GT)? callableUnitSignature (callableUnitBody | SEMICOLON)
| (PUBLIC)? (NATIVE)? FUNCTION Identifier DOUBLE_COLON callableUnitSignature callableUnitBody
;
lambdaFunction
: LEFT_PARENTHESIS formalParameterList? RIGHT_PARENTHESIS EQUAL_GT lambdaReturnParameter? callableUnitBody
;
callableUnitSignature
: anyIdentifierName LEFT_PARENTHESIS formalParameterList? RIGHT_PARENTHESIS returnParameter?
;
typeDefinition
: (PUBLIC)? TYPE Identifier finiteType SEMICOLON
;
objectBody
: publicObjectFields? privateObjectFields? objectInitializer? objectFunctions?
;
publicObjectFields
: PUBLIC LEFT_BRACE fieldDefinition* RIGHT_BRACE
;
privateObjectFields
: PRIVATE LEFT_BRACE fieldDefinition* RIGHT_BRACE
;
objectInitializer
: annotationAttachment* documentationAttachment? (PUBLIC)? NEW objectInitializerParameterList callableUnitBody
;
objectInitializerParameterList
: LEFT_PARENTHESIS objectParameterList? RIGHT_PARENTHESIS
;
objectFunctions
: (annotationAttachment* documentationAttachment? deprecatedAttachment? objectFunctionDefinition)+
;
// TODO merge with fieldDefinition later
fieldDefinition
: annotationAttachment* typeName Identifier (ASSIGN expression)? (COMMA | SEMICOLON)
;
// TODO try to merge with formalParameterList later
objectParameterList
: (objectParameter | objectDefaultableParameter) (COMMA (objectParameter | objectDefaultableParameter))* (COMMA restParameter)?
| restParameter
;
// TODO try to merge with parameter later
objectParameter
: annotationAttachment* typeName? Identifier
;
// TODO try to merge with defaultableParameter later
objectDefaultableParameter
: objectParameter ASSIGN expression
;
// TODO merge with functionDefinition later
objectFunctionDefinition
: (PUBLIC)? (NATIVE)? FUNCTION objectCallableUnitSignature (callableUnitBody | SEMICOLON)
;
//TODO merge with callableUnitSignature later
objectCallableUnitSignature
: anyIdentifierName LEFT_PARENTHESIS formalParameterList? RIGHT_PARENTHESIS returnParameter?
;
annotationDefinition
: (PUBLIC)? ANNOTATION (LT attachmentPoint (COMMA attachmentPoint)* GT)? Identifier userDefineTypeName? SEMICOLON
;
globalVariableDefinition
: (PUBLIC)? typeName Identifier (ASSIGN expression )? SEMICOLON
;
attachmentPoint
: SERVICE
| RESOURCE
| FUNCTION
| OBJECT
| TYPE
| ENDPOINT
| PARAMETER
| ANNOTATION
;
workerDeclaration
: workerDefinition LEFT_BRACE statement* RIGHT_BRACE
;
workerDefinition
: WORKER Identifier
;
globalEndpointDefinition
: PUBLIC? endpointDeclaration
;
endpointDeclaration
: annotationAttachment* ENDPOINT endpointType Identifier endpointInitlization? SEMICOLON
;
endpointType
: nameReference
;
endpointInitlization
: recordLiteral
| ASSIGN variableReference
;
finiteType
: finiteTypeUnit (PIPE finiteTypeUnit)*
;
finiteTypeUnit
: simpleLiteral
| typeName
;
typeName
: simpleTypeName # simpleTypeNameLabel
| typeName (LEFT_BRACKET RIGHT_BRACKET)+ # arrayTypeNameLabel
| typeName (PIPE typeName)+ # unionTypeNameLabel
| typeName QUESTION_MARK # nullableTypeNameLabel
| LEFT_PARENTHESIS typeName RIGHT_PARENTHESIS # groupTypeNameLabel
| LEFT_PARENTHESIS typeName (COMMA typeName)* RIGHT_PARENTHESIS # tupleTypeNameLabel
| OBJECT LEFT_BRACE objectBody RIGHT_BRACE # objectTypeNameLabel
| LEFT_BRACE fieldDefinitionList RIGHT_BRACE # recordTypeNameLabel
;
fieldDefinitionList
: fieldDefinition*
;
// Temporary production rule name
simpleTypeName
: TYPE_ANY
| TYPE_DESC
| valueTypeName
| referenceTypeName
| emptyTupleLiteral // nil type name ()
;
referenceTypeName
: builtInReferenceTypeName
| userDefineTypeName
;
userDefineTypeName
: nameReference
;
valueTypeName
: TYPE_BOOL
| TYPE_INT
| TYPE_FLOAT
| TYPE_STRING
| TYPE_BLOB
;
builtInReferenceTypeName
: TYPE_MAP (LT typeName GT)?
| TYPE_FUTURE (LT typeName GT)?
| TYPE_XML (LT (LEFT_BRACE xmlNamespaceName RIGHT_BRACE)? xmlLocalName GT)?
| TYPE_JSON (LT nameReference GT)?
| TYPE_TABLE (LT nameReference GT)?
| TYPE_STREAM (LT typeName GT)?
| functionTypeName
;
functionTypeName
: FUNCTION LEFT_PARENTHESIS (parameterList | parameterTypeNameList)? RIGHT_PARENTHESIS returnParameter?
;
xmlNamespaceName
: QuotedStringLiteral
;
xmlLocalName
: Identifier
;
annotationAttachment
: AT nameReference recordLiteral?
;
//============================================================================================================
// STATEMENTS / BLOCKS
statement
: variableDefinitionStatement
| assignmentStatement
| tupleDestructuringStatement
| compoundAssignmentStatement
| postIncrementStatement
| ifElseStatement
| matchStatement
| foreachStatement
| whileStatement
| nextStatement
| breakStatement
| forkJoinStatement
| tryCatchStatement
| throwStatement
| returnStatement
| workerInteractionStatement
| expressionStmt
| transactionStatement
| abortStatement
| retryStatement
| lockStatement
| namespaceDeclarationStatement
| foreverStatement
| streamingQueryStatement
| doneStatement
;
variableDefinitionStatement
: typeName Identifier (ASSIGN expression)? SEMICOLON
;
recordLiteral
: LEFT_BRACE (recordKeyValue (COMMA recordKeyValue)*)? RIGHT_BRACE
;
recordKeyValue
: recordKey COLON expression
;
recordKey
: Identifier
| expression
;
tableLiteral
: TYPE_TABLE tableInitialization
;
tableInitialization
: recordLiteral
;
arrayLiteral
: LEFT_BRACKET expressionList? RIGHT_BRACKET
;
typeInitExpr
: NEW (LEFT_PARENTHESIS invocationArgList? RIGHT_PARENTHESIS)?
| NEW userDefineTypeName LEFT_PARENTHESIS invocationArgList? RIGHT_PARENTHESIS
;
assignmentStatement
: (VAR)? variableReference ASSIGN expression SEMICOLON
;
tupleDestructuringStatement
: VAR? LEFT_PARENTHESIS variableReferenceList RIGHT_PARENTHESIS ASSIGN expression SEMICOLON
| LEFT_PARENTHESIS parameterList RIGHT_PARENTHESIS ASSIGN expression SEMICOLON
;
compoundAssignmentStatement
: variableReference compoundOperator expression SEMICOLON
;
compoundOperator
: COMPOUND_ADD
| COMPOUND_SUB
| COMPOUND_MUL
| COMPOUND_DIV
;
postIncrementStatement
: variableReference postArithmeticOperator SEMICOLON
;
postArithmeticOperator
: INCREMENT
| DECREMENT
;
variableReferenceList
: variableReference (COMMA variableReference)*
;
ifElseStatement
: ifClause elseIfClause* elseClause?
;
ifClause
: IF LEFT_PARENTHESIS expression RIGHT_PARENTHESIS LEFT_BRACE statement* RIGHT_BRACE
;
elseIfClause
: ELSE IF LEFT_PARENTHESIS expression RIGHT_PARENTHESIS LEFT_BRACE statement* RIGHT_BRACE
;
elseClause
: ELSE LEFT_BRACE statement*RIGHT_BRACE
;
matchStatement
: MATCH expression LEFT_BRACE matchPatternClause+ RIGHT_BRACE
;
matchPatternClause
: typeName EQUAL_GT (statement | (LEFT_BRACE statement* RIGHT_BRACE))
| typeName Identifier EQUAL_GT (statement | (LEFT_BRACE statement* RIGHT_BRACE))
;
foreachStatement
: FOREACH LEFT_PARENTHESIS? variableReferenceList IN (expression | intRangeExpression) RIGHT_PARENTHESIS? LEFT_BRACE statement* RIGHT_BRACE
;
intRangeExpression
: (LEFT_BRACKET|LEFT_PARENTHESIS) expression RANGE expression? (RIGHT_BRACKET|RIGHT_PARENTHESIS)
;
whileStatement
: WHILE LEFT_PARENTHESIS expression RIGHT_PARENTHESIS LEFT_BRACE statement* RIGHT_BRACE
;
nextStatement
: NEXT SEMICOLON
;
breakStatement
: BREAK SEMICOLON
;
// typeName is only message
forkJoinStatement
: FORK LEFT_BRACE workerDeclaration* RIGHT_BRACE joinClause? timeoutClause?
;
// below typeName is only 'message[]'
joinClause
: JOIN (LEFT_PARENTHESIS joinConditions RIGHT_PARENTHESIS)? LEFT_PARENTHESIS typeName Identifier RIGHT_PARENTHESIS LEFT_BRACE statement* RIGHT_BRACE
;
joinConditions
: SOME integerLiteral (Identifier (COMMA Identifier)*)? # anyJoinCondition
| ALL (Identifier (COMMA Identifier)*)? # allJoinCondition
;
// below typeName is only 'message[]'
timeoutClause
: TIMEOUT LEFT_PARENTHESIS expression RIGHT_PARENTHESIS LEFT_PARENTHESIS typeName Identifier RIGHT_PARENTHESIS LEFT_BRACE statement* RIGHT_BRACE
;
tryCatchStatement
: TRY LEFT_BRACE statement* RIGHT_BRACE catchClauses
;
catchClauses
: catchClause+ finallyClause?
| finallyClause
;
catchClause
: CATCH LEFT_PARENTHESIS typeName Identifier RIGHT_PARENTHESIS LEFT_BRACE statement* RIGHT_BRACE
;
finallyClause
: FINALLY LEFT_BRACE statement* RIGHT_BRACE
;
throwStatement
: THROW expression SEMICOLON
;
returnStatement
: RETURN expression? SEMICOLON
;
workerInteractionStatement
: triggerWorker
| workerReply
;
// below left Identifier is of type TYPE_MESSAGE and the right Identifier is of type WORKER
triggerWorker
: expression RARROW Identifier SEMICOLON #invokeWorker
| expression RARROW FORK SEMICOLON #invokeFork
;
// below left Identifier is of type WORKER and the right Identifier is of type message
workerReply
: expression LARROW Identifier SEMICOLON
;
variableReference
: nameReference # simpleVariableReference
| functionInvocation # functionInvocationReference
| variableReference index # mapArrayVariableReference
| variableReference field # fieldVariableReference
| variableReference xmlAttrib # xmlAttribVariableReference
| variableReference invocation # invocationReference
;
field
: (DOT | NOT) (Identifier | MUL)
;
index
: LEFT_BRACKET expression RIGHT_BRACKET
;
xmlAttrib
: AT (LEFT_BRACKET expression RIGHT_BRACKET)?
;
functionInvocation
: functionNameReference LEFT_PARENTHESIS invocationArgList? RIGHT_PARENTHESIS
;
invocation
: (DOT | NOT) anyIdentifierName LEFT_PARENTHESIS invocationArgList? RIGHT_PARENTHESIS
;
invocationArgList
: invocationArg (COMMA invocationArg)*
;
invocationArg
: expression // required args
| namedArgs // named args
| restArgs // rest args
;
actionInvocation
: START? nameReference RARROW functionInvocation
;
expressionList
: expression (COMMA expression)*
;
expressionStmt
: expression SEMICOLON
;
transactionStatement
: transactionClause onretryClause?
;
transactionClause
: TRANSACTION (WITH transactionPropertyInitStatementList)? LEFT_BRACE statement* RIGHT_BRACE
;
transactionPropertyInitStatement
: retriesStatement
| oncommitStatement
| onabortStatement
;
transactionPropertyInitStatementList
: transactionPropertyInitStatement (COMMA transactionPropertyInitStatement)*
;
lockStatement
: LOCK LEFT_BRACE statement* RIGHT_BRACE
;
onretryClause
: ONRETRY LEFT_BRACE statement* RIGHT_BRACE
;
abortStatement
: ABORT SEMICOLON
;
retryStatement
: RETRY SEMICOLON
;
retriesStatement
: RETRIES ASSIGN expression
;
oncommitStatement
: ONCOMMIT ASSIGN expression
;
onabortStatement
: ONABORT ASSIGN expression
;
namespaceDeclarationStatement
: namespaceDeclaration
;
namespaceDeclaration
: XMLNS QuotedStringLiteral (AS Identifier)? SEMICOLON
;
expression
: simpleLiteral # simpleLiteralExpression
| arrayLiteral # arrayLiteralExpression
| recordLiteral # recordLiteralExpression
| xmlLiteral # xmlLiteralExpression
| tableLiteral # tableLiteralExpression
| stringTemplateLiteral # stringTemplateLiteralExpression
| START? variableReference # variableReferenceExpression
| actionInvocation # actionInvocationExpression
| lambdaFunction # lambdaFunctionExpression
| typeInitExpr # typeInitExpression
| tableQuery # tableQueryExpression
| LT typeName (COMMA functionInvocation)? GT expression # typeConversionExpression
| (ADD | SUB | NOT | LENGTHOF | UNTAINT) expression # unaryExpression
| LEFT_PARENTHESIS expression (COMMA expression)* RIGHT_PARENTHESIS # bracedOrTupleExpression
| expression POW expression # binaryPowExpression
| expression (DIV | MUL | MOD) expression # binaryDivMulModExpression
| expression (ADD | SUB) expression # binaryAddSubExpression
| expression (LT_EQUAL | GT_EQUAL | GT | LT) expression # binaryCompareExpression
| expression (EQUAL | NOT_EQUAL) expression # binaryEqualExpression
| expression AND expression # binaryAndExpression
| expression OR expression # binaryOrExpression
| expression QUESTION_MARK expression COLON expression # ternaryExpression
| awaitExpression # awaitExprExpression
| expression matchExpression # matchExprExpression
| CHECK expression # checkedExpression
| expression ELVIS expression # elvisExpression
| typeName # typeAccessExpression
;
awaitExpression
: AWAIT expression # awaitExpr
;
matchExpression
: BUT LEFT_BRACE matchExpressionPatternClause (COMMA matchExpressionPatternClause)* RIGHT_BRACE
;
matchExpressionPatternClause
: typeName Identifier? EQUAL_GT expression
;
//reusable productions
nameReference
: (Identifier COLON)? Identifier
;
functionNameReference
: (Identifier COLON)? anyIdentifierName
;
returnParameter
: RETURNS annotationAttachment* typeName
;
lambdaReturnParameter
: annotationAttachment* typeName
;
parameterTypeNameList
: parameterTypeName (COMMA parameterTypeName)*
;
parameterTypeName
: typeName
;
parameterList
: parameter (COMMA parameter)*
;
parameter
: annotationAttachment* typeName Identifier #simpleParameter
| annotationAttachment* LEFT_PARENTHESIS typeName Identifier (COMMA typeName Identifier)* RIGHT_PARENTHESIS #tupleParameter
;
defaultableParameter
: parameter ASSIGN expression
;
restParameter
: annotationAttachment* typeName ELLIPSIS Identifier
;
formalParameterList
: (parameter | defaultableParameter) (COMMA (parameter | defaultableParameter))* (COMMA restParameter)?
| restParameter
;
simpleLiteral
: (SUB)? integerLiteral
| (SUB)? FloatingPointLiteral
| QuotedStringLiteral
| BooleanLiteral
| emptyTupleLiteral
| NullLiteral
;
// §3.10.1 Integer Literals
integerLiteral
: DecimalIntegerLiteral
| HexIntegerLiteral
| OctalIntegerLiteral
| BinaryIntegerLiteral
;
emptyTupleLiteral
: LEFT_PARENTHESIS RIGHT_PARENTHESIS
;
namedArgs
: Identifier ASSIGN expression
;
restArgs
: ELLIPSIS expression
;
// XML parsing
xmlLiteral
: XMLLiteralStart xmlItem XMLLiteralEnd
;
xmlItem
: element
| procIns
| comment
| text
| CDATA
;
content
: text? ((element | CDATA | procIns | comment) text?)*
;
comment
: XML_COMMENT_START (XMLCommentTemplateText expression ExpressionEnd)* XMLCommentText
;
element
: startTag content closeTag
| emptyTag
;
startTag
: XML_TAG_OPEN xmlQualifiedName attribute* XML_TAG_CLOSE
;
closeTag
: XML_TAG_OPEN_SLASH xmlQualifiedName XML_TAG_CLOSE
;
emptyTag
: XML_TAG_OPEN xmlQualifiedName attribute* XML_TAG_SLASH_CLOSE
;
procIns
: XML_TAG_SPECIAL_OPEN (XMLPITemplateText expression ExpressionEnd)* XMLPIText
;
attribute
: xmlQualifiedName EQUALS xmlQuotedString;
text
: (XMLTemplateText expression ExpressionEnd)+ XMLText?
| XMLText
;
xmlQuotedString
: xmlSingleQuotedString
| xmlDoubleQuotedString
;
xmlSingleQuotedString
: SINGLE_QUOTE (XMLSingleQuotedTemplateString expression ExpressionEnd)* XMLSingleQuotedString? SINGLE_QUOTE_END
;
xmlDoubleQuotedString
: DOUBLE_QUOTE (XMLDoubleQuotedTemplateString expression ExpressionEnd)* XMLDoubleQuotedString? DOUBLE_QUOTE_END
;
xmlQualifiedName
: (XMLQName QNAME_SEPARATOR)? XMLQName
| XMLTagExpressionStart expression ExpressionEnd
;
stringTemplateLiteral
: StringTemplateLiteralStart stringTemplateContent? StringTemplateLiteralEnd
;
stringTemplateContent
: (StringTemplateExpressionStart expression ExpressionEnd)+ StringTemplateText?
| StringTemplateText
;
anyIdentifierName
: Identifier
| reservedWord
;
reservedWord
: FOREACH
| TYPE_MAP
| START
;
//Siddhi Streams and Tables related
tableQuery
: FROM streamingInput joinStreamingInput?
selectClause?
orderByClause?
limitClause?
;
foreverStatement
: FOREVER LEFT_BRACE streamingQueryStatement+ RIGHT_BRACE
;
doneStatement
: DONE SEMICOLON
;
streamingQueryStatement
: FROM (streamingInput (joinStreamingInput)? | patternClause)
selectClause?
orderByClause?
outputRateLimit?
streamingAction
;
patternClause
: EVERY? patternStreamingInput withinClause?
;
withinClause
: WITHIN expression
;
orderByClause
: ORDER BY orderByVariable (COMMA orderByVariable)*
;
orderByVariable
: variableReference orderByType?
;
limitClause
: LIMIT DecimalIntegerLiteral
;
selectClause
: SELECT (MUL| selectExpressionList )
groupByClause?
havingClause?
;
selectExpressionList
: selectExpression (COMMA selectExpression)*
;
selectExpression
: expression (AS Identifier)?
;
groupByClause
: GROUP BY variableReferenceList
;
havingClause
: HAVING expression
;
streamingAction
: EQUAL_GT LEFT_PARENTHESIS formalParameterList? RIGHT_PARENTHESIS LEFT_BRACE statement* RIGHT_BRACE
;
setClause
: SET setAssignmentClause (COMMA setAssignmentClause)*
;
setAssignmentClause
: variableReference ASSIGN expression
;
streamingInput
: variableReference whereClause? windowClause? whereClause? (AS alias=Identifier)?
;
joinStreamingInput
: (UNIDIRECTIONAL joinType | joinType UNIDIRECTIONAL | joinType) streamingInput ON expression
;
outputRateLimit
: OUTPUT (ALL | LAST | FIRST) EVERY ( DecimalIntegerLiteral timeScale | DecimalIntegerLiteral EVENTS )
| OUTPUT SNAPSHOT EVERY DecimalIntegerLiteral timeScale
;
patternStreamingInput
: patternStreamingEdgeInput ( FOLLOWED BY | COMMA ) patternStreamingInput
| LEFT_PARENTHESIS patternStreamingInput RIGHT_PARENTHESIS
| NOT patternStreamingEdgeInput (AND patternStreamingEdgeInput | FOR simpleLiteral)
| patternStreamingEdgeInput (AND | OR ) patternStreamingEdgeInput
| patternStreamingEdgeInput
;
patternStreamingEdgeInput
: variableReference whereClause? intRangeExpression? (AS alias=Identifier)?
;
whereClause
: WHERE expression
;
windowClause
: WINDOW functionInvocation
;
orderByType
: ASCENDING | DESCENDING
;
joinType
: LEFT OUTER JOIN
| RIGHT OUTER JOIN
| FULL OUTER JOIN
| OUTER JOIN
| INNER? JOIN
;
timeScale
: SECOND | SECONDS
| MINUTE | MINUTES
| HOUR | HOURS
| DAY | DAYS
| MONTH | MONTHS
| YEAR | YEARS
;
// Deprecated parsing.
deprecatedAttachment
: DeprecatedTemplateStart deprecatedText? DeprecatedTemplateEnd
;
deprecatedText
: deprecatedTemplateInlineCode (DeprecatedTemplateText | deprecatedTemplateInlineCode)*
| DeprecatedTemplateText (DeprecatedTemplateText | deprecatedTemplateInlineCode)*
;
deprecatedTemplateInlineCode
: singleBackTickDeprecatedInlineCode
| doubleBackTickDeprecatedInlineCode
| tripleBackTickDeprecatedInlineCode
;
singleBackTickDeprecatedInlineCode
: SBDeprecatedInlineCodeStart SingleBackTickInlineCode? SingleBackTickInlineCodeEnd
;
doubleBackTickDeprecatedInlineCode
: DBDeprecatedInlineCodeStart DoubleBackTickInlineCode? DoubleBackTickInlineCodeEnd
;
tripleBackTickDeprecatedInlineCode
: TBDeprecatedInlineCodeStart TripleBackTickInlineCode? TripleBackTickInlineCodeEnd
;
// Documentation parsing.
documentationAttachment
: DocumentationTemplateStart documentationTemplateContent? DocumentationTemplateEnd
;
documentationTemplateContent
: docText? documentationTemplateAttributeDescription+
| docText
;
documentationTemplateAttributeDescription
: DocumentationTemplateAttributeStart Identifier? DocumentationTemplateAttributeEnd docText?
;
docText
: documentationTemplateInlineCode (DocumentationTemplateText | documentationTemplateInlineCode)*
| DocumentationTemplateText (DocumentationTemplateText | documentationTemplateInlineCode)*
;
documentationTemplateInlineCode
: singleBackTickDocInlineCode
| doubleBackTickDocInlineCode
| tripleBackTickDocInlineCode
;
singleBackTickDocInlineCode
: SBDocInlineCodeStart SingleBackTickInlineCode? SingleBackTickInlineCodeEnd
;
doubleBackTickDocInlineCode
: DBDocInlineCodeStart DoubleBackTickInlineCode? DoubleBackTickInlineCodeEnd
;
tripleBackTickDocInlineCode
: TBDocInlineCodeStart TripleBackTickInlineCode? TripleBackTickInlineCodeEnd
;
|
Benchmark/fib1.asm | DW0RKiN/M4_FORTH | 2 | 161452 | ORG 32768
; === b e g i n ===
ld (Stop+1), SP ; 4:20 not need
ld L, 0x1A ; 2:7 Upper screen
call 0x1605 ; 3:17 Open channel
ld HL, 35000 ; 3:10 Init Return address stack
exx ; 1:4
call fib1_bench ; 3:17 scall
Stop:
ld SP, 0x0000 ; 3:10 not need
ld HL, 0x2758 ; 3:10
exx ; 1:4
ret ; 1:10
; ===== e n d =====
; --- the beginning of a recursive function ---
fib1: ; ( a -- b )
exx ; 1:4 : rcolon
pop DE ; 1:10 : rcolon ret
dec HL ; 1:6 : rcolon
ld (HL),D ; 1:7 : rcolon
dec L ; 1:4 : rcolon
ld (HL),E ; 1:7 : rcolon (HL') = ret
exx ; 1:4 : rcolon R:( -- ret )
ld A, H ; 1:4 dup 2 < if
add A, A ; 1:4 dup 2 < if
jr c, $+11 ; 2:7/12 dup 2 < if negative HL < positive constant ---> true
ld A, L ; 1:4 dup 2 < if HL<2 --> HL-2<0 --> carry if true
sub low 2 ; 2:7 dup 2 < if HL<2 --> HL-2<0 --> carry if true
ld A, H ; 1:4 dup 2 < if HL<2 --> HL-2<0 --> carry if true
sbc A, high 2 ; 2:7 dup 2 < if HL<2 --> HL-2<0 --> carry if true
jp nc, else101 ; 3:10 dup 2 < if
ld HL, 1 ; 3:10 drop 1
jp fib1_end ; 3:10 rexit
else101 EQU $ ; = endif
endif101:
push DE ; 1:11 dup
ld D, H ; 1:4 dup
ld E, L ; 1:4 dup ( a -- a a )
dec HL ; 1:6 1-
call fib1 ; 3:17 rcall
ex DE, HL ; 1:4 rcall
exx ; 1:4 rcall R:( ret -- )
ex DE, HL ; 1:4 swap ( b a -- a b )
dec HL ; 1:6 2-
dec HL ; 1:6 2-
call fib1 ; 3:17 rcall
ex DE, HL ; 1:4 rcall
exx ; 1:4 rcall R:( ret -- )
add HL, DE ; 1:11 +
pop DE ; 1:10 +
fib1_end:
exx ; 1:4 ; rsemicilon
ld E,(HL) ; 1:7 ; rsemicilon
inc L ; 1:4 ; rsemicilon
ld D,(HL) ; 1:7 ; rsemicilon DE = ret
inc HL ; 1:6 ; rsemicilon
ex DE, HL ; 1:4 ; rsemicilon
jp (HL) ; 1:4 ; rsemicilon
; --------- end of recursive function ---------
; --- the beginning of a data stack function ---
fib1_bench: ; ( -- )
push DE ; 1:11 push(999)
ex DE, HL ; 1:4 push(999)
ld HL, 999 ; 3:10 push(999)
sfor101: ; sfor 101 ( index -- index )
push DE ; 1:11 push(19)
ex DE, HL ; 1:4 push(19)
ld HL, 19 ; 3:10 push(19)
sfor102: ; sfor 102 ( index -- index )
push DE ; 1:11 dup
ld D, H ; 1:4 dup
ld E, L ; 1:4 dup ( a -- a a )
call fib1 ; 3:17 rcall
ex DE, HL ; 1:4 rcall
exx ; 1:4 rcall R:( ret -- )
ex DE, HL ; 1:4 drop
pop DE ; 1:10 drop ( a -- )
ld A, H ; 1:4 snext 102
or L ; 1:4 snext 102
dec HL ; 1:6 snext 102 index--
jp nz, sfor102 ; 3:10 snext 102
snext102: ; snext 102
ex DE, HL ; 1:4 sfor unloop 102
pop DE ; 1:10 sfor unloop 102
ld A, H ; 1:4 snext 101
or L ; 1:4 snext 101
dec HL ; 1:6 snext 101 index--
jp nz, sfor101 ; 3:10 snext 101
snext101: ; snext 101
ex DE, HL ; 1:4 sfor unloop 101
pop DE ; 1:10 sfor unloop 101
fib1_bench_end:
ret ; 1:10 s;
; --------- end of data stack function ---------
VARIABLE_SECTION:
STRING_SECTION:
|
regression/symtab2gb/multiple_symtabs/entry_point.adb | tobireinhard/cbmc | 412 | 28730 | with User;
with Library;
procedure Entry_Point is
begin
User;
Library (-5);
end Entry_Point;
|
book-01/Assembly/asm/avx-2/packed/avx2_p_unpack_u32_u64.asm | gfurtadoalmeida/study-assembly-x64 | 2 | 179590 | <reponame>gfurtadoalmeida/study-assembly-x64
.code
; YmmValAB AVX2_Packed_Unpack_U32_U64_(const YmmVal & a, const YmmVal & b)
AVX2_Packed_Unpack_U32_U64_ proc
; rcx is used by Visual C++ compiler to insert the
; pointer to the memory allocated to the return value.
vmovdqa ymm0, ymmword ptr [rdx]
vmovdqa ymm1, ymmword ptr [r8]
; 255 127 0
; ---------------------------------
; ymm0 = | H | G | F | E | D | C | B | A |
; ymm1 = | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
;
; 255 0
; ---------------------------------
; ymm2 = | 5F | 4E | 1B | 0A |
; ymm3 = | 7H | 6G | 3D | 2C |
vpunpckldq ymm2, ymm0, ymm1
vpunpckhdq ymm3, ymm0, ymm1
vmovdqa ymmword ptr [rcx], ymm2
vmovdqa ymmword ptr [rcx+type ymmword], ymm3
mov rax, rcx
vzeroupper
ret
AVX2_Packed_Unpack_U32_U64_ endp
end |
oeis/079/A079253.asm | neoneye/loda-programs | 11 | 5669 | ; A079253: a(n) is taken to be the smallest positive integer greater than a(n-1) which is consistent with the condition "n is a member of the sequence if and only if a(n) is even".
; Submitted by <NAME>
; 0,3,5,6,7,8,10,12,14,15,16,17,18,19,20,22,24,26,28,30,32,33,34,35,36,37,38,39,40,41,42,43,44,46,48,50,52,54,56,58,60,62,64,66,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,94,96
lpb $0
mov $2,$0
sub $0,1
trn $2,1
seq $2,79948 ; First differences of A079000.
add $3,$2
lpe
mov $0,$3
|
oeis/135/A135541.asm | neoneye/loda-programs | 11 | 19808 | ; A135541: a(n) = 2*a(n-1) - a(n-2) + 2*a(n-3), with a(0) = 2, a(1) = 2.
; Submitted by <NAME>
; 0,2,7,12,21,44,91,180,357,716,1435,2868,5733,11468,22939,45876,91749,183500,367003,734004,1468005,2936012,5872027,11744052,23488101,46976204,93952411,187904820,375809637,751619276,1503238555,3006477108,6012954213,12025908428,24051816859,48103633716,96207267429,192414534860,384829069723,769658139444,1539316278885,3078632557772,6157265115547,12314530231092,24629060462181,49258120924364,98516241848731,197032483697460,394064967394917,788129934789836,1576259869579675,3152519739159348
mov $3,1
lpb $0
sub $0,1
add $2,2
add $4,$3
mov $3,$2
mov $2,$1
add $4,1
add $1,$4
mul $3,2
lpe
mov $0,$4
|
memory/video_strb.asm | jsmolka/gba-suite | 31 | 19693 | video_strb:
; Tests for video memory byte stores
t050:
; Ignore OAM byte stores
mov r0, 1
mov r1, MEM_OAM
strb r0, [r1, 0x10]
ldr r0, [r1, 0x10]
cmp r0, 1
beq f050
b t051
f050:
m_exit 50
t051:
; Ignore VRAM byte stores in bitmap modes
mov r0, MEM_IO
add r0, REG_DISPCNT
ldrh r1, [r0]
orr r2, r1, 3
strh r2, [r0]
mov r3, 2
mov r4, MEM_VRAM
add r4, 0x14000
strb r3, [r4, 0x10]
ldr r3, [r4, 0x10]
cmp r3, 2
beq f051
strh r1, [r0]
b t052
f051:
strh r1, [r0]
m_exit 51
t052:
; Ignore VRAM byte stores in non-bitmap modes
; Switch mode to tiled
mov r0, MEM_IO
add r0, REG_DISPCNT
ldrh r1, [r0]
bic r2, r1, 3
strh r2, [r0]
mov r3, 2
mov r4, MEM_VRAM
add r4, 0x10000
strb r3, [r4, 0x10]
ldr r3, [r4, 0x10]
cmp r3, 2
; Switch mode to bitmap
strh r1, [r0]
beq f052
b t053
f052:
strh r1, [r0]
m_exit 52
t053:
; VRAM byte store as halfword
mov r0, 2
mov r1, MEM_VRAM
strb r0, [r1, 0x10]
ldrh r0, [r1, 0x10]
m_half r1, 0x0202
cmp r1, r0
bne f053
b t054
f053:
m_exit 53
t054:
; Palette byte store as halfword
mov r0, 1
mov r1, MEM_PALETTE
strb r0, [r1, 0x20]
ldrh r0, [r1, 0x20]
m_half r1, 0x0101
cmp r1, r0
bne f054
b video_strb_passed
f054:
m_exit 54
video_strb_passed:
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_222.asm | ljhsiun2/medusa | 9 | 89108 | <reponame>ljhsiun2/medusa<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r15
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0xaa4e, %rdx
xor $25435, %r8
movups (%rdx), %xmm6
vpextrq $0, %xmm6, %rsi
inc %r13
lea addresses_UC_ht+0x5e, %rsi
lea addresses_WC_ht+0x3cbe, %rdi
clflush (%rsi)
nop
nop
nop
nop
inc %r13
mov $4, %rcx
rep movsw
nop
nop
sub %rdi, %rdi
lea addresses_D_ht+0x9ace, %rsi
lea addresses_WC_ht+0x64ce, %rdi
clflush (%rdi)
nop
nop
nop
xor $29100, %r13
mov $91, %rcx
rep movsq
nop
nop
nop
cmp %rcx, %rcx
lea addresses_D_ht+0xe9ce, %rcx
nop
nop
nop
and %r15, %r15
mov (%rcx), %r13w
sub %rsi, %rsi
lea addresses_D_ht+0x14f4e, %rcx
nop
nop
nop
nop
cmp $32337, %rdi
mov $0x6162636465666768, %r8
movq %r8, %xmm6
and $0xffffffffffffffc0, %rcx
movntdq %xmm6, (%rcx)
nop
nop
nop
cmp %rcx, %rcx
lea addresses_D_ht+0x2e2e, %rdi
and $2730, %rsi
and $0xffffffffffffffc0, %rdi
movaps (%rdi), %xmm2
vpextrq $0, %xmm2, %rdx
nop
nop
nop
nop
nop
sub $65226, %rsi
lea addresses_normal_ht+0x7f19, %rsi
lea addresses_D_ht+0xb183, %rdi
nop
and %rdx, %rdx
mov $69, %rcx
rep movsb
nop
nop
nop
nop
sub %rdi, %rdi
lea addresses_WC_ht+0x156ce, %rcx
nop
nop
nop
nop
nop
sub %r13, %r13
movups (%rcx), %xmm5
vpextrq $1, %xmm5, %r8
nop
nop
and $19590, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %r8
push %r9
push %rax
push %rbp
// Faulty Load
lea addresses_D+0x1f2ce, %r12
nop
xor %rbp, %rbp
movb (%r12), %al
lea oracles, %r12
and $0xff, %rax
shlq $12, %rax
mov (%r12,%rax,1), %rax
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_D', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 6}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': True, 'type': 'addresses_D_ht', 'same': True, 'AVXalign': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': True, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': True, 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'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
*/
|
demo/adainclude/s-bbbosu.adb | e3l6/SSMDev | 0 | 13877 | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . B B . P E R I P H E R A L S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1999-2002 Universidad Politecnica de Madrid --
-- Copyright (C) 2003-2005 The European Space Agency --
-- Copyright (C) 2003-2013, 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. --
-- --
-- --
-- --
-- --
-- --
-- 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 System.Machine_Code;
with System.BB.Parameters; use System.BB.Parameters;
package body System.BB.Board_Support is
use CPU_Primitives, Interrupts, Machine_Code;
Sys_Tick_Vector : constant Vector_Id := 14;
Interrupt_Request_Vector : constant Vector_Id := 15;
First_IRQ : constant Interrupt_ID := 2;
-- WWDG_Interrupt
Alarm_Time : Timer_Interval;
pragma Volatile (Alarm_Time);
pragma Export (C, Alarm_Time, "__gnat_alarm_time");
---------------------------
-- System control and ID --
---------------------------
ICSR : Word with Volatile, Address => 16#E000_ED04#;
-- Interrupt Control State
ICSR_Pend_ST_Set : constant := 2**26; -- Set pending Sys_Tick (RW)
ICSR_Pend_ST_Clr : constant := 2**25; -- Clear pending Sys_Tick (W)
-----------------------
-- Sys_Tick Handling --
-----------------------
-- We use the Sys_Tick timer as a periodic timer with 1 kHz rate. This
-- is a trade-off between accurate delays, limited overhead and maximum
-- time that interrupts may be disabled.
Tick_Period : constant Timer_Interval := Clock_Frequency / 1000;
type Sys_Tick_Registers is record
SYST_CSR : Word;
SYST_RVR : Word;
SYST_CVR : Word;
SYST_CALIB : Word;
end record;
CSR_Count_Flag : constant := 2**16;
CSR_Clk_Source : constant := 2**2;
CSR_Tick_Int : constant := 2**1;
CSR_Enable : constant := 2**0;
RVR_Last : constant := 2**24 - 1;
pragma Assert (Tick_Period <= RVR_Last + 1);
SYST : Sys_Tick_Registers with Volatile, Address => 16#E000_E010#;
Next_Tick_Time : Timer_Interval with Volatile;
-- Time when systick will expire. This gives the high digits of the time
----------------------------------------------
-- New Vectored Interrupt Controller (NVIC) --
----------------------------------------------
NVIC_Base : constant Address := 16#E000_E000#;
NVIC_ISER0 : constant Address := NVIC_Base + 16#100#;
-- Writing a bit mask to this register enables the corresponding interrupts
type PRI is mod 2**8;
-- Type for ARMv7-M interrupt priorities. Note that 0 is the highest
-- priority, which is reserved for the kernel and has no corresponding
-- Interrupt_Priority value, and 255 is the lowest. We assume the PRIGROUP
-- setting is such that the 4 most significant bits determine the priority
-- group used for preemption. However, if less bits are implemented, this
-- should still work.
function To_PRI (P : Any_Priority) return PRI is
(if P not in Interrupt_Priority then 0
else PRI (Interrupt_Priority'Last - P + 1) * 16);
-- Return the BASEPRI mask for the given Ada priority. Note that the zero
-- value here means no mask, so no interrupts are masked.
function To_Priority (P : PRI) return Interrupt_Priority is
(if P = 0 then Interrupt_Priority'Last
else (Interrupt_Priority'Last - Any_Priority'Base (P / 16) + 1));
-- Given an ARM interrupt priority (PRI value), determine the Ada priority
-- While the value 0 is reserved for the kernel and has no Ada priority
-- that represents it, Interrupt_Priority'Last is closest.
IP : array (Interrupt_ID) of PRI with Volatile, Address => 16#E000_E400#;
-- Local utility functions
procedure Enable_Interrupt_Request
(Interrupt : Interrupt_ID;
Prio : Interrupt_Priority);
-- Enable interrupt requests for the given interrupt
----------------------
-- Initialize_Board --
----------------------
procedure Initialize_Board is
begin
-- Mask interrupts
Disable_Interrupts;
-- Because we operate the SysTick clock as a periodic timer, and 24 bits
-- at 168 MHz is sufficient for that, use the unscaled system clock.
-- To initialize the Sys_Tick timer, first disable the clock, then
-- program it and finally enable it. This way an accidentally
-- misconfigured timer will not cause pending interrupt while
-- reprogramming.
SYST.SYST_CSR := CSR_Clk_Source; -- disable clock
SYST.SYST_RVR := Word (Tick_Period - 1);
SYST.SYST_CVR := 0;
SYST.SYST_CSR := CSR_Clk_Source or CSR_Enable;
Next_Tick_Time := Tick_Period;
Set_Alarm (Timer_Interval'Last);
Clear_Alarm_Interrupt;
Enable_Interrupts (Priority'Last);
end Initialize_Board;
------------------------
-- Max_Timer_Interval --
------------------------
function Max_Timer_Interval return Timer_Interval is (2**32 - 1);
----------------
-- Read_Clock --
----------------
function Read_Clock return Timer_Interval is
PRIMASK : Word;
begin
-- As several registers and variables need to be read or modified, do
-- it atomically.
Asm ("mrs %0, PRIMASK",
Outputs => Word'Asm_Output ("=&r", PRIMASK),
Volatile => True);
Asm ("msr PRIMASK, %0",
Inputs => Word'Asm_Input ("r", 1),
Volatile => True);
declare
Flag : constant Boolean := (SYST.SYST_CSR and CSR_Count_Flag) /= 0;
-- This flag is set when the counter has reached zero. Next_Tick_Time
-- has to be incremented. This will trigger an interrupt very soon
-- (or has just triggered the interrupt) so count is either zero or
-- not far from Tick_Period.
Count : constant Timer_Interval := Timer_Interval (SYST.SYST_CVR);
Res : Timer_Interval := Next_Tick_Time;
begin
if Flag then
-- Systick counter has just reached zero, pretend it is still zero
Next_Tick_Time := Res + Tick_Period;
else
-- The counter is decremented, so compute the actual time
Res := Res - Count;
end if;
-- Restore interrupt mask
Asm ("msr PRIMASK, %0",
Inputs => Word'Asm_Input ("r", PRIMASK),
Volatile => True);
return Res;
end;
end Read_Clock;
----------------------
-- Ticks_Per_Second --
----------------------
function Ticks_Per_Second return Natural is (Clock_Frequency);
---------------------------
-- Clear_Alarm_Interrupt --
---------------------------
procedure Clear_Alarm_Interrupt is
begin
ICSR := ICSR_Pend_ST_Clr;
end Clear_Alarm_Interrupt;
--------------------------
-- Clear_Poke_Interrupt --
--------------------------
procedure Clear_Poke_Interrupt is
begin
null;
end Clear_Poke_Interrupt;
---------------
-- Set_Alarm --
---------------
procedure Set_Alarm (Ticks : Timer_Interval) is
Now : constant Timer_Interval := Read_Clock;
begin
-- As we will have periodic interrupts for alarms regardless, the only
-- thing to do is force an interrupt if the alarm has already expired.
Alarm_Time := Now + Timer_Interval'Min (Timer_Interval'Last / 2, Ticks);
if Ticks = 0 then
ICSR := ICSR_Pend_ST_Set;
end if;
end Set_Alarm;
------------------------
-- Alarm_Interrupt_ID --
------------------------
function Alarm_Interrupt_ID return Interrupt_ID is (1);
-- Return the interrupt level to use for the alarm clock handler. Note that
-- we use a "fake" Interrupt_ID for the alarm interrupt, as it is handled
-- specially (not through the NVIC).
-----------------------
-- Poke_Interrupt_ID --
-----------------------
function Poke_Interrupt_ID return Interrupt_ID is (No_Interrupt);
---------------------------
-- Get_Interrupt_Request --
---------------------------
function Get_Interrupt_Request
(Vector : Vector_Id) return Interrupt_ID
is
Res : Word;
begin
if Vector = Sys_Tick_Vector then
return Alarm_Interrupt_ID;
end if;
Asm ("mrs %0, ipsr",
Word'Asm_Output ("=r", Res),
Volatile => True);
Res := Res and 16#FF#;
return Interrupt_ID'Base (Res) - 16 + First_IRQ;
end Get_Interrupt_Request;
------------------------------
-- Enable_Interrupt_Request --
------------------------------
procedure Enable_Interrupt_Request
(Interrupt : Interrupt_ID;
Prio : Interrupt_Priority)
is
begin
if Interrupt = Alarm_Interrupt_ID then
-- Consistency check with Priority_Of_Interrupt
pragma Assert (Prio = Interrupt_Priority'Last);
Clear_Alarm_Interrupt;
SYST.SYST_CSR := SYST.SYST_CSR or CSR_Tick_Int;
else
declare
pragma Assert (Interrupt >= First_IRQ);
IRQ : constant Natural := Interrupt - First_IRQ;
Regofs : constant Natural := IRQ / 32;
Regbit : constant Word := 2** (IRQ mod 32);
NVIC_ISER : array (0 .. 15) of Word
with Volatile, Address => NVIC_ISER0;
-- Many NVIC registers use 16 words of 32 bits each to serve as a
-- bitmap for all interrupt channels. Regofs indicates register
-- offset (0 .. 15), and Regbit indicates the mask required for
-- addressing the bit.
begin
NVIC_ISER (Regofs) := Regbit;
end;
end if;
end Enable_Interrupt_Request;
-------------------------------
-- Install_Interrupt_Handler --
-------------------------------
procedure Install_Interrupt_Handler
(Handler : Address;
Interrupt : Interrupts.Interrupt_ID;
Prio : Interrupt_Priority)
is
begin
if Interrupt = Alarm_Interrupt_ID then
Install_Trap_Handler (Handler, Sys_Tick_Vector);
else
IP (Interrupt - First_IRQ) := To_PRI (Prio);
Install_Trap_Handler (Handler, Interrupt_Request_Vector);
end if;
Enable_Interrupt_Request (Interrupt, Prio);
end Install_Interrupt_Handler;
---------------------------
-- Priority_Of_Interrupt --
---------------------------
function Priority_Of_Interrupt
(Interrupt : Interrupt_ID) return Any_Priority
is
-- Interrupt 2 .. 83 correspond to IRQ0 .. IRQ81
(if Interrupt = Alarm_Interrupt_ID then Interrupt_Priority'Last
else To_Priority (IP (Interrupt - First_IRQ)));
-----------------------------
-- Clear_Interrupt_Request --
-----------------------------
procedure Clear_Interrupt_Request (Interrupt : Interrupts.Interrupt_ID)
is null;
--------------------------
-- Set_Current_Priority --
--------------------------
procedure Set_Current_Priority (Priority : Any_Priority) is
begin
-- Writing a 0 to BASEPRI disables interrupt masking, while values
-- 15 .. 1 correspond to interrupt priorities 255 .. 241 in that order.
Asm ("msr BASEPRI, %0",
Inputs => PRI'Asm_Input ("r", To_PRI (Priority)),
Volatile => True);
end Set_Current_Priority;
end System.BB.Board_Support;
|
src/Generic/Function/Elim.agda | turion/Generic | 30 | 16010 | module Generic.Function.Elim where
open import Generic.Core
AllAny : ∀ {ι α β γ δ} {I : Set ι} {A : Set α} {C : I -> Set γ}
-> (B : I -> A -> Set β)
-> (∀ x -> (∀ {j} -> B j x -> C j) -> Set δ)
-> (xs : List A)
-> (∀ {j} -> Any (B j) xs -> C j)
-> Set δ
AllAny B D [] k = ⊤
AllAny B D (x ∷ []) k = D x k
AllAny B D (x ∷ y ∷ xs) k = D x (k ∘ inj₁) × AllAny B D (y ∷ xs) (k ∘ inj₂)
data VarView {ι β} {I : Set ι} : Desc I β -> Set where
yes-var : ∀ {i} -> VarView (var i)
no-var : ∀ {D} -> VarView D
varView : ∀ {ι β} {I : Set ι} -> (D : Desc I β) -> VarView D
varView (var i) = yes-var
varView D = no-var
mutual
Hyp : ∀ {ι β γ} {I : Set ι} {B}
-> (∀ {i} -> B i -> Set γ) -> (D : Desc I β) -> ⟦ D ⟧ B -> Set (β ⊔ γ)
Hyp {β = β} C (var i) y = Lift β (C y)
Hyp C (π i q D) f = Hypᵇ i C D f
Hyp C (D ⊛ E) (x , y) = Hyp C D x × Hyp C E y
Hypᵇ : ∀ {ι α β γ δ q q′} {I : Set ι} {B} i
-> (∀ {i} -> B i -> Set γ) -> (D : Binder α β δ i q′ I) -> ⟦ i / D ⟧ᵇ q B -> Set (β ⊔ γ)
Hypᵇ {γ = γ} {q = q} i C (coerce (A , D)) f =
Coerce′ (cong (γ ⊔_) q) $ Pi i A λ x -> Hyp C (D x) (appPi i (uncoerce′ q f) x)
mutual
Elim : ∀ {ι β γ} {I : Set ι} {B}
-> (∀ {i} -> B i -> Set γ)
-> (D : Desc I β)
-> (∀ {j} -> Extend D B j -> B j)
-> Set (β ⊔ γ)
Elim {β = β} C (var i) k = Lift β (C (k lrefl))
Elim C (π i q D) k = Elimᵇ i C D k
Elim C (D ⊛ E) k with varView D
... | yes-var = ∀ {x} -> C x -> Elim C E (k ∘ _,_ x)
... | no-var = ∀ {x} -> Hyp C D x -> Elim C E (k ∘ _,_ x)
Elimᵇ : ∀ {ι α β γ δ q q′} {I : Set ι} {B} i
-> (∀ {i} -> B i -> Set γ)
-> (D : Binder α β δ i q′ I)
-> (∀ {j} -> Extendᵇ i D q B j -> B j)
-> Set (β ⊔ γ)
Elimᵇ {γ = γ} {q = q} i C (coerce (A , D)) k =
Coerce′ (cong (γ ⊔_) q) $ Pi i A λ x -> Elim C (D x) (k ∘ coerce′ q ∘ _,_ x)
module _ {ι β γ} {I : Set ι} {D₀ : Data (Desc I β)} (C : ∀ {j} -> μ D₀ j -> Set γ) where
K : Name -> Type -> Type -> (Ds : List (Desc I β)) -> All (const Name) Ds -> Set (ι ⊔ β)
K d a b Ds ns = ∀ {j} -> Node D₀ (packData d a b Ds ns) j -> μ D₀ j
Elims : ∀ d a b (Ds : List (Desc I β)) ns -> K d a b Ds ns -> Set (β ⊔ γ)
Elims d a b Ds ns = AllAny (λ j D -> Extend D (μ D₀) j) (Elim C) Ds
module _ (hs : Elims (dataName D₀)
(parsTele D₀)
(indsTele D₀)
(consTypes D₀)
(consNames D₀)
node) where
{-# TERMINATING #-}
mutual
elimHyp : (D : Desc I β) -> (d : ⟦ D ⟧ (μ D₀)) -> Hyp C D d
elimHyp (var i) d = lift (elim d)
elimHyp (π i q D) f = elimHypᵇ i D f
elimHyp (D ⊛ E) (x , y) = elimHyp D x , elimHyp E y
elimHypᵇ : ∀ {α δ q q′} i
-> (D : Binder α β δ i q′ I)
-> (f : ⟦ i / D ⟧ᵇ q (μ D₀))
-> Hypᵇ i C D f
elimHypᵇ {q = q} i (coerce (A , D)) f =
coerce′ (cong (_⊔_ γ) q) (lamPi i λ x -> elimHyp (D x) (appPi i (uncoerce′ q f) x))
elimExtend : ∀ {j}
-> (D : Desc I β) {k : ∀ {j} -> Extend D (μ D₀) j -> μ D₀ j}
-> Elim C D k
-> (e : Extend D (μ D₀) j)
-> C (k e)
elimExtend (var i) z lrefl = lower z
elimExtend (π i q D) h p = elimExtendᵇ i D h p
elimExtend (D ⊛ E) h (d , e) with varView D
... | yes-var = elimExtend E (h (elim d)) e
... | no-var = elimExtend E (h (elimHyp D d)) e
elimExtendᵇ : ∀ {α δ q q′ j} i
-> (D : Binder α β δ i q′ I) {k : ∀ {j} -> Extendᵇ i D q (μ D₀) j -> μ D₀ j}
-> Elimᵇ i C D k
-> (p : Extendᵇ i D q (μ D₀) j)
-> C (k p)
elimExtendᵇ {q = q} i (coerce (A , D)) h p with p | inspectUncoerce′ q p
... | _ | (x , e) , refl = elimExtend (D x) (appPi i (uncoerce′ (cong (γ ⊔_) q) h) x) e
elimAny : ∀ {j} (Ds : List (Desc I β)) d a b ns {k : K d a b Ds ns}
-> Elims d a b Ds ns k -> (a : Node D₀ (packData d a b Ds ns) j) -> C (k a)
elimAny [] d a b tt tt ()
elimAny (D ∷ []) d a b (n , ns) h e = elimExtend D h e
elimAny (D ∷ E ∷ Ds) d a b (n , ns) (h , hs) (inj₁ e) = elimExtend D h e
elimAny (D ∷ E ∷ Ds) d a b (n , ns) (h , hs) (inj₂ r) = elimAny (E ∷ Ds) d a b ns hs r
elim : ∀ {j} -> (d : μ D₀ j) -> C d
elim (node e) = elimAny (consTypes D₀)
(dataName D₀)
(parsTele D₀)
(indsTele D₀)
(consNames D₀)
hs
e
|
oeis/024/A024212.asm | neoneye/loda-programs | 11 | 23097 | <reponame>neoneye/loda-programs
; A024212: 2nd elementary symmetric function of first n+1 positive integers congruent to 1 mod 3.
; 4,39,159,445,1005,1974,3514,5814,9090,13585,19569,27339,37219,49560,64740,83164,105264,131499,162355,198345,240009,287914,342654,404850,475150,554229,642789,741559,851295,972780,1106824,1254264,1415964,1592815,1785735,1995669,2223589,2470494,2737410,3025390,3335514,3668889,4026649,4409955,4819995,5257984,5725164,6222804,6752200,7314675,7911579,8544289,9214209,9922770,10671430,11461674,12295014,13172989,14097165,15069135,16090519,17162964,18288144,19467760,20703540,21997239,23350639,24765549
mul $0,3
add $0,5
bin $0,2
sub $0,1
bin $0,2
div $0,9
|
a51test/(B5)CJNE_A_d_o.a51 | Aimini/51cpu | 0 | 26299 | MOV 0x00,#0x00
MOV 0x01,#0x01
MOV 0x02,#0x02
MOV 0x03,#0x03
MOV 0x04,#0x04
MOV 0x05,#0x05
MOV 0x06,#0x06
MOV 0x07,#0x07
MOV 0x08,#0x08
MOV 0x09,#0x09
MOV 0x0A,#0x0A
MOV 0x0B,#0x0B
MOV 0x0C,#0x0C
MOV 0x0D,#0x0D
MOV 0x0E,#0x0E
MOV 0x0F,#0x0F
MOV 0x10,#0x10
MOV 0x11,#0x11
MOV 0x12,#0x12
MOV 0x13,#0x13
MOV 0x14,#0x14
MOV 0x15,#0x15
MOV 0x16,#0x16
MOV 0x17,#0x17
MOV 0x18,#0x18
MOV 0x19,#0x19
MOV 0x1A,#0x1A
MOV 0x1B,#0x1B
MOV 0x1C,#0x1C
MOV 0x1D,#0x1D
MOV 0x1E,#0x1E
MOV 0x1F,#0x1F
MOV A,#0
LJMP STATE_31
STATE_0:
CJNE A,0x00,FINAL
LJMP TEST_2
STATE_1: CJNE A,0x01,STATE_0
STATE_2: CJNE A,0x02,STATE_1
STATE_3: CJNE A,0x03,STATE_2
STATE_4: CJNE A,0x04,STATE_3
STATE_5: CJNE A,0x05,STATE_4
STATE_6: CJNE A,0x06,STATE_5
STATE_7: CJNE A,0x07,STATE_6
STATE_8: CJNE A,0x08,STATE_7
STATE_9: CJNE A,0x09,STATE_8
STATE_10: CJNE A,0x0A,STATE_9
STATE_11: CJNE A,0x0B,STATE_10
STATE_12: CJNE A,0x0C,STATE_11
STATE_13: CJNE A,0x0D,STATE_12
STATE_14: CJNE A,0x0E,STATE_13
STATE_15: CJNE A,0x0F,STATE_14
STATE_16: CJNE A,0x10,STATE_15
STATE_17: CJNE A,0x11,STATE_16
STATE_18: CJNE A,0x12,STATE_17
STATE_19: CJNE A,0x13,STATE_18
STATE_20: CJNE A,0x14,STATE_19
STATE_21: CJNE A,0x15,STATE_20
STATE_22: CJNE A,0x16,STATE_21
STATE_23: CJNE A,0x17,STATE_22
STATE_24: CJNE A,0x18,STATE_23
STATE_25: CJNE A,0x19,STATE_24
STATE_26: CJNE A,0x1A,STATE_25
STATE_27: CJNE A,0x1B,STATE_26
STATE_28: CJNE A,0x1C,STATE_27
STATE_29: CJNE A,0x1D,STATE_28
STATE_30: CJNE A,0x1E,STATE_29
STATE_31: CJNE A,0x1F,STATE_30
TEST_2:
MOV A,#0x10
MOV 0xF0, #0x10
MOV 0x80, #0xF0
MOV 0xD0, #0x0F
SJMP CH_3
CH_1: CJNE A,0xF0,FINAL
SJMP DNOTHING
CH_2: CJNE A,0xD0,CH_1
CH_3: CJNE A,0x80,CH_2
FINAL:
MOV A,0xFF
DNOTHING:
NOP
|
models/tests/test36.als | transclosure/Amalgam | 4 | 3034 | <reponame>transclosure/Amalgam<gh_stars>1-10
module tests/test
abstract sig A {}
one sig X,Y extends A {}
check { X->X-X->X in A -> A } for 2 expect 0
check { X->X-X->X in A ->some A } for 2 expect 1
check { X->X-X->X in A ->lone A } for 2 expect 0
check { X->X-X->X in A ->one A } for 2 expect 1
check { X->X-X->X in A some-> A } for 2 expect 1
check { X->X-X->X in A some->some A } for 2 expect 1
check { X->X-X->X in A some->lone A } for 2 expect 1
check { X->X-X->X in A some->one A } for 2 expect 1
check { X->X-X->X in A lone-> A } for 2 expect 0
check { X->X-X->X in A lone->some A } for 2 expect 1
check { X->X-X->X in A lone->lone A } for 2 expect 0
check { X->X-X->X in A lone->one A } for 2 expect 1
check { X->X-X->X in A one-> A } for 2 expect 1
check { X->X-X->X in A one->some A } for 2 expect 1
check { X->X-X->X in A one->lone A } for 2 expect 1
check { X->X-X->X in A one->one A } for 2 expect 1
check { X->X in A -> A } for 2 expect 0
check { X->X in A ->some A } for 2 expect 1
check { X->X in A ->lone A } for 2 expect 0
check { X->X in A ->one A } for 2 expect 1
check { X->X in A some-> A } for 2 expect 1
check { X->X in A some->some A } for 2 expect 1
check { X->X in A some->lone A } for 2 expect 1
check { X->X in A some->one A } for 2 expect 1
check { X->X in A lone-> A } for 2 expect 0
check { X->X in A lone->some A } for 2 expect 1
check { X->X in A lone->lone A } for 2 expect 0
check { X->X in A lone->one A } for 2 expect 1
check { X->X in A one-> A } for 2 expect 1
check { X->X in A one->some A } for 2 expect 1
check { X->X in A one->lone A } for 2 expect 1
check { X->X in A one->one A } for 2 expect 1
check { X->Y in A -> A } for 2 expect 0
check { X->Y in A ->some A } for 2 expect 1
check { X->Y in A ->lone A } for 2 expect 0
check { X->Y in A ->one A } for 2 expect 1
check { X->Y in A some-> A } for 2 expect 1
check { X->Y in A some->some A } for 2 expect 1
check { X->Y in A some->lone A } for 2 expect 1
check { X->Y in A some->one A } for 2 expect 1
check { X->Y in A lone-> A } for 2 expect 0
check { X->Y in A lone->some A } for 2 expect 1
check { X->Y in A lone->lone A } for 2 expect 0
check { X->Y in A lone->one A } for 2 expect 1
check { X->Y in A one-> A } for 2 expect 1
check { X->Y in A one->some A } for 2 expect 1
check { X->Y in A one->lone A } for 2 expect 1
check { X->Y in A one->one A } for 2 expect 1
check { X->Y+X->X in A -> A } for 2 expect 0
check { X->Y+X->X in A ->some A } for 2 expect 1
check { X->Y+X->X in A ->lone A } for 2 expect 1
check { X->Y+X->X in A ->one A } for 2 expect 1
check { X->Y+X->X in A some-> A } for 2 expect 0
check { X->Y+X->X in A some->some A } for 2 expect 1
check { X->Y+X->X in A some->lone A } for 2 expect 1
check { X->Y+X->X in A some->one A } for 2 expect 1
check { X->Y+X->X in A lone-> A } for 2 expect 0
check { X->Y+X->X in A lone->some A } for 2 expect 1
check { X->Y+X->X in A lone->lone A } for 2 expect 1
check { X->Y+X->X in A lone->one A } for 2 expect 1
check { X->Y+X->X in A one-> A } for 2 expect 0
check { X->Y+X->X in A one->some A } for 2 expect 1
check { X->Y+X->X in A one->lone A } for 2 expect 1
check { X->Y+X->X in A one->one A } for 2 expect 1
check { Y->X in A -> A } for 2 expect 0
check { Y->X in A ->some A } for 2 expect 1
check { Y->X in A ->lone A } for 2 expect 0
check { Y->X in A ->one A } for 2 expect 1
check { Y->X in A some-> A } for 2 expect 1
check { Y->X in A some->some A } for 2 expect 1
check { Y->X in A some->lone A } for 2 expect 1
check { Y->X in A some->one A } for 2 expect 1
check { Y->X in A lone-> A } for 2 expect 0
check { Y->X in A lone->some A } for 2 expect 1
check { Y->X in A lone->lone A } for 2 expect 0
check { Y->X in A lone->one A } for 2 expect 1
check { Y->X in A one-> A } for 2 expect 1
check { Y->X in A one->some A } for 2 expect 1
check { Y->X in A one->lone A } for 2 expect 1
check { Y->X in A one->one A } for 2 expect 1
check { Y->X+X->X in A -> A } for 2 expect 0
check { Y->X+X->X in A ->some A } for 2 expect 0
check { Y->X+X->X in A ->lone A } for 2 expect 0
check { Y->X+X->X in A ->one A } for 2 expect 0
check { Y->X+X->X in A some-> A } for 2 expect 1
check { Y->X+X->X in A some->some A } for 2 expect 1
check { Y->X+X->X in A some->lone A } for 2 expect 1
check { Y->X+X->X in A some->one A } for 2 expect 1
check { Y->X+X->X in A lone-> A } for 2 expect 1
check { Y->X+X->X in A lone->some A } for 2 expect 1
check { Y->X+X->X in A lone->lone A } for 2 expect 1
check { Y->X+X->X in A lone->one A } for 2 expect 1
check { Y->X+X->X in A one-> A } for 2 expect 1
check { Y->X+X->X in A one->some A } for 2 expect 1
check { Y->X+X->X in A one->lone A } for 2 expect 1
check { Y->X+X->X in A one->one A } for 2 expect 1
check { Y->X+X->Y in A -> A } for 2 expect 0
check { Y->X+X->Y in A ->some A } for 2 expect 0
check { Y->X+X->Y in A ->lone A } for 2 expect 0
check { Y->X+X->Y in A ->one A } for 2 expect 0
check { Y->X+X->Y in A some-> A } for 2 expect 0
check { Y->X+X->Y in A some->some A } for 2 expect 0
check { Y->X+X->Y in A some->lone A } for 2 expect 0
check { Y->X+X->Y in A some->one A } for 2 expect 0
check { Y->X+X->Y in A lone-> A } for 2 expect 0
check { Y->X+X->Y in A lone->some A } for 2 expect 0
check { Y->X+X->Y in A lone->lone A } for 2 expect 0
check { Y->X+X->Y in A lone->one A } for 2 expect 0
check { Y->X+X->Y in A one-> A } for 2 expect 0
check { Y->X+X->Y in A one->some A } for 2 expect 0
check { Y->X+X->Y in A one->lone A } for 2 expect 0
check { Y->X+X->Y in A one->one A } for 2 expect 0
check { Y->X+X->Y+X->X in A -> A } for 2 expect 0
check { Y->X+X->Y+X->X in A ->some A } for 2 expect 0
check { Y->X+X->Y+X->X in A ->lone A } for 2 expect 1
check { Y->X+X->Y+X->X in A ->one A } for 2 expect 1
check { Y->X+X->Y+X->X in A some-> A } for 2 expect 0
check { Y->X+X->Y+X->X in A some->some A } for 2 expect 0
check { Y->X+X->Y+X->X in A some->lone A } for 2 expect 1
check { Y->X+X->Y+X->X in A some->one A } for 2 expect 1
check { Y->X+X->Y+X->X in A lone-> A } for 2 expect 1
check { Y->X+X->Y+X->X in A lone->some A } for 2 expect 1
check { Y->X+X->Y+X->X in A lone->lone A } for 2 expect 1
check { Y->X+X->Y+X->X in A lone->one A } for 2 expect 1
check { Y->X+X->Y+X->X in A one-> A } for 2 expect 1
check { Y->X+X->Y+X->X in A one->some A } for 2 expect 1
check { Y->X+X->Y+X->X in A one->lone A } for 2 expect 1
check { Y->X+X->Y+X->X in A one->one A } for 2 expect 1
check { Y->Y in A -> A } for 2 expect 0
check { Y->Y in A ->some A } for 2 expect 1
check { Y->Y in A ->lone A } for 2 expect 0
check { Y->Y in A ->one A } for 2 expect 1
check { Y->Y in A some-> A } for 2 expect 1
check { Y->Y in A some->some A } for 2 expect 1
check { Y->Y in A some->lone A } for 2 expect 1
check { Y->Y in A some->one A } for 2 expect 1
check { Y->Y in A lone-> A } for 2 expect 0
check { Y->Y in A lone->some A } for 2 expect 1
check { Y->Y in A lone->lone A } for 2 expect 0
check { Y->Y in A lone->one A } for 2 expect 1
check { Y->Y in A one-> A } for 2 expect 1
check { Y->Y in A one->some A } for 2 expect 1
check { Y->Y in A one->lone A } for 2 expect 1
check { Y->Y in A one->one A } for 2 expect 1
check { Y->Y+X->X in A -> A } for 2 expect 0
check { Y->Y+X->X in A ->some A } for 2 expect 0
check { Y->Y+X->X in A ->lone A } for 2 expect 0
check { Y->Y+X->X in A ->one A } for 2 expect 0
check { Y->Y+X->X in A some-> A } for 2 expect 0
check { Y->Y+X->X in A some->some A } for 2 expect 0
check { Y->Y+X->X in A some->lone A } for 2 expect 0
check { Y->Y+X->X in A some->one A } for 2 expect 0
check { Y->Y+X->X in A lone-> A } for 2 expect 0
check { Y->Y+X->X in A lone->some A } for 2 expect 0
check { Y->Y+X->X in A lone->lone A } for 2 expect 0
check { Y->Y+X->X in A lone->one A } for 2 expect 0
check { Y->Y+X->X in A one-> A } for 2 expect 0
check { Y->Y+X->X in A one->some A } for 2 expect 0
check { Y->Y+X->X in A one->lone A } for 2 expect 0
check { Y->Y+X->X in A one->one A } for 2 expect 0
check { Y->Y+X->Y in A -> A } for 2 expect 0
check { Y->Y+X->Y in A ->some A } for 2 expect 0
check { Y->Y+X->Y in A ->lone A } for 2 expect 0
check { Y->Y+X->Y in A ->one A } for 2 expect 0
check { Y->Y+X->Y in A some-> A } for 2 expect 1
check { Y->Y+X->Y in A some->some A } for 2 expect 1
check { Y->Y+X->Y in A some->lone A } for 2 expect 1
check { Y->Y+X->Y in A some->one A } for 2 expect 1
check { Y->Y+X->Y in A lone-> A } for 2 expect 1
check { Y->Y+X->Y in A lone->some A } for 2 expect 1
check { Y->Y+X->Y in A lone->lone A } for 2 expect 1
check { Y->Y+X->Y in A lone->one A } for 2 expect 1
check { Y->Y+X->Y in A one-> A } for 2 expect 1
check { Y->Y+X->Y in A one->some A } for 2 expect 1
check { Y->Y+X->Y in A one->lone A } for 2 expect 1
check { Y->Y+X->Y in A one->one A } for 2 expect 1
check { Y->Y+X->Y+X->X in A -> A } for 2 expect 0
check { Y->Y+X->Y+X->X in A ->some A } for 2 expect 0
check { Y->Y+X->Y+X->X in A ->lone A } for 2 expect 1
check { Y->Y+X->Y+X->X in A ->one A } for 2 expect 1
check { Y->Y+X->Y+X->X in A some-> A } for 2 expect 0
check { Y->Y+X->Y+X->X in A some->some A } for 2 expect 0
check { Y->Y+X->Y+X->X in A some->lone A } for 2 expect 1
check { Y->Y+X->Y+X->X in A some->one A } for 2 expect 1
check { Y->Y+X->Y+X->X in A lone-> A } for 2 expect 1
check { Y->Y+X->Y+X->X in A lone->some A } for 2 expect 1
check { Y->Y+X->Y+X->X in A lone->lone A } for 2 expect 1
check { Y->Y+X->Y+X->X in A lone->one A } for 2 expect 1
check { Y->Y+X->Y+X->X in A one-> A } for 2 expect 1
check { Y->Y+X->Y+X->X in A one->some A } for 2 expect 1
check { Y->Y+X->Y+X->X in A one->lone A } for 2 expect 1
check { Y->Y+X->Y+X->X in A one->one A } for 2 expect 1
check { Y->Y+Y->X in A -> A } for 2 expect 0
check { Y->Y+Y->X in A ->some A } for 2 expect 1
check { Y->Y+Y->X in A ->lone A } for 2 expect 1
check { Y->Y+Y->X in A ->one A } for 2 expect 1
check { Y->Y+Y->X in A some-> A } for 2 expect 0
check { Y->Y+Y->X in A some->some A } for 2 expect 1
check { Y->Y+Y->X in A some->lone A } for 2 expect 1
check { Y->Y+Y->X in A some->one A } for 2 expect 1
check { Y->Y+Y->X in A lone-> A } for 2 expect 0
check { Y->Y+Y->X in A lone->some A } for 2 expect 1
check { Y->Y+Y->X in A lone->lone A } for 2 expect 1
check { Y->Y+Y->X in A lone->one A } for 2 expect 1
check { Y->Y+Y->X in A one-> A } for 2 expect 0
check { Y->Y+Y->X in A one->some A } for 2 expect 1
check { Y->Y+Y->X in A one->lone A } for 2 expect 1
check { Y->Y+Y->X in A one->one A } for 2 expect 1
check { Y->Y+Y->X+X->X in A -> A } for 2 expect 0
check { Y->Y+Y->X+X->X in A ->some A } for 2 expect 0
check { Y->Y+Y->X+X->X in A ->lone A } for 2 expect 1
check { Y->Y+Y->X+X->X in A ->one A } for 2 expect 1
check { Y->Y+Y->X+X->X in A some-> A } for 2 expect 0
check { Y->Y+Y->X+X->X in A some->some A } for 2 expect 0
check { Y->Y+Y->X+X->X in A some->lone A } for 2 expect 1
check { Y->Y+Y->X+X->X in A some->one A } for 2 expect 1
check { Y->Y+Y->X+X->X in A lone-> A } for 2 expect 1
check { Y->Y+Y->X+X->X in A lone->some A } for 2 expect 1
check { Y->Y+Y->X+X->X in A lone->lone A } for 2 expect 1
check { Y->Y+Y->X+X->X in A lone->one A } for 2 expect 1
check { Y->Y+Y->X+X->X in A one-> A } for 2 expect 1
check { Y->Y+Y->X+X->X in A one->some A } for 2 expect 1
check { Y->Y+Y->X+X->X in A one->lone A } for 2 expect 1
check { Y->Y+Y->X+X->X in A one->one A } for 2 expect 1
check { Y->Y+Y->X+X->Y in A -> A } for 2 expect 0
check { Y->Y+Y->X+X->Y in A ->some A } for 2 expect 0
check { Y->Y+Y->X+X->Y in A ->lone A } for 2 expect 1
check { Y->Y+Y->X+X->Y in A ->one A } for 2 expect 1
check { Y->Y+Y->X+X->Y in A some-> A } for 2 expect 0
check { Y->Y+Y->X+X->Y in A some->some A } for 2 expect 0
check { Y->Y+Y->X+X->Y in A some->lone A } for 2 expect 1
check { Y->Y+Y->X+X->Y in A some->one A } for 2 expect 1
check { Y->Y+Y->X+X->Y in A lone-> A } for 2 expect 1
check { Y->Y+Y->X+X->Y in A lone->some A } for 2 expect 1
check { Y->Y+Y->X+X->Y in A lone->lone A } for 2 expect 1
check { Y->Y+Y->X+X->Y in A lone->one A } for 2 expect 1
check { Y->Y+Y->X+X->Y in A one-> A } for 2 expect 1
check { Y->Y+Y->X+X->Y in A one->some A } for 2 expect 1
check { Y->Y+Y->X+X->Y in A one->lone A } for 2 expect 1
check { Y->Y+Y->X+X->Y in A one->one A } for 2 expect 1
check { Y->Y+Y->X+X->Y+X->X in A -> A } for 2 expect 0
check { Y->Y+Y->X+X->Y+X->X in A ->some A } for 2 expect 0
check { Y->Y+Y->X+X->Y+X->X in A ->lone A } for 2 expect 1
check { Y->Y+Y->X+X->Y+X->X in A ->one A } for 2 expect 1
check { Y->Y+Y->X+X->Y+X->X in A some-> A } for 2 expect 0
check { Y->Y+Y->X+X->Y+X->X in A some->some A } for 2 expect 0
check { Y->Y+Y->X+X->Y+X->X in A some->lone A } for 2 expect 1
check { Y->Y+Y->X+X->Y+X->X in A some->one A } for 2 expect 1
check { Y->Y+Y->X+X->Y+X->X in A lone-> A } for 2 expect 1
check { Y->Y+Y->X+X->Y+X->X in A lone->some A } for 2 expect 1
check { Y->Y+Y->X+X->Y+X->X in A lone->lone A } for 2 expect 1
check { Y->Y+Y->X+X->Y+X->X in A lone->one A } for 2 expect 1
check { Y->Y+Y->X+X->Y+X->X in A one-> A } for 2 expect 1
check { Y->Y+Y->X+X->Y+X->X in A one->some A } for 2 expect 1
check { Y->Y+Y->X+X->Y+X->X in A one->lone A } for 2 expect 1
check { Y->Y+Y->X+X->Y+X->X in A one->one A } for 2 expect 1
|
stl/grammar/stl.g4 | pieter-hendriks/STL-monitoring | 0 | 3644 | <reponame>pieter-hendriks/STL-monitoring
grammar stl;
content
: formula EOF
;
formula
: OPEN_BRACKET signalExpression (LARGER_THAN|SMALLER_THAN|EQUALS|UNEQUALS|LARGER_THAN_OR_EQUAL|SMALLER_THAN_OR_EQUAL) (expression|signalExpression) CLOSE_BRACKET #booleanFilter
| (NEGATE|MINUS) formula #negation
| (SMALLER_THAN LARGER_THAN|DIAMOND) OPEN_CURLY constant COMMA constant CLOSE_CURLY formula #timedEventually
| (OPEN_SQUARE CLOSE_SQUARE|SQUARE) OPEN_CURLY constant COMMA constant CLOSE_CURLY formula #timedAlways
| (SMALLER_THAN LARGER_THAN|DIAMOND) formula #untimedEventually
| (OPEN_SQUARE CLOSE_SQUARE|SQUARE) formula #untimedAlways
| formula UNTIL OPEN_CURLY constant COMMA constant CLOSE_CURLY formula #timedUntil
| formula UNTIL formula #untimedUntil
| formula AND formula #and
| OPEN_BRACKET formula CLOSE_BRACKET #scope
| signalExpression #quantitativeSignal
| formula (OR|PIPELINE) formula #or
| formula (ARROW|SIGNLE_ARROW|DOUBLE_ARROW) formula #implication
;
// To make sure there is a signal on the left of the filter
signalExpression
: OPEN_BRACKET signalExpression CLOSE_BRACKET #signalExpressionScope
| expression (STAR|FORWARD_SLASH) signalExpression #signalProduct
| signalExpression (STAR|FORWARD_SLASH) expression #signalProduct
| expression (PLUS|MINUS) signalExpression #signalSum
| signalExpression (PLUS|MINUS) expression #signalSum
| PIPELINE signalExpression PIPELINE #signalAbsolute
| SIGNAL #signalSignal
;
expression
: OPEN_BRACKET expression CLOSE_BRACKET #expressionScope
| expression (STAR|FORWARD_SLASH) expression #product
| expression (PLUS|MINUS) expression #sum
| PIPELINE expression PIPELINE #absolute
| constant #value
| SIGNAL #signal
;
constant
: intValue
| floatValue
;
intValue
: MINUS? DIGIT
;
floatValue
: MINUS? DIGIT DOT DIGIT
;
OPEN_BRACKET : '(';
CLOSE_BRACKET: ')';
OPEN_CURLY : '{';
CLOSE_CURLY: '}';
OPEN_SQUARE : '[';
CLOSE_SQUARE : ']';
PIPELINE : '|';
MINUS : '-';
PLUS : '+';
STAR : '*';
FORWARD_SLASH : '/';
DOT : '.';
LARGER_THAN : '>';
LARGER_THAN_OR_EQUAL : '>=';
SMALLER_THAN : '<';
SMALLER_THAN_OR_EQUAL : '<=';
EQUALS : '=';
UNEQUALS : '!=';
//INFINITE : 'infty';
DIAMOND : '◊';
SQUARE : '□';
UNTIL : 'U';
AND : [∧^&];
OR : [∨V]; // Or the pipeline
NEGATE : [¬-];
ARROW : '→';
SIGNLE_ARROW : '->';
DOUBLE_ARROW : '=>';
DIGIT : [0-9]+;
WHITE_SPACE : [ \n\r\t]+ -> skip;
SIGNAL : [a-zA-Z_][0-9a-zA-Z]*;
COMMA: ',';
//SEMICOLON: ';';
//AMPERSAND: '&';
//SINGLE_QUOTE : '\'';
//DOUBLE_QUOTE : '"';
//ASCII_CHARACTER : SINGLE_QUOTE [ -~] SINGLE_QUOTE;
//STRING : DOUBLE_QUOTE [ -~]* DOUBLE_QUOTE;
|
TestSource/IHTest.asm | davidov541/MiniC | 0 | 245998 | //IHvoid: funcdecl 0, ,
IHvoid:// Words: 0
addi $sp, 11
// Words: 1
move $sp, $rr
// Words: 2
addi $0, -2
// Words: 3
sdw $ra, $sp, $rr
// Words: 4
addi $rr, -2
// Words: 5
sdw $fp, $sp, $rr
// Words: 6
move $fp, $sp
// Words: 7
addi $rr, -1
// Words: 8
// Words: 9
ldi $k2, 0
// Words: 10
swn $k2, $fp, $rr
// Words: 11
addi $rr, -2
// Words: 12
sdw $s0, $fp, $rr
// Words: 13
addi $rr, -2
// Words: 14
sdw $s1, $fp, $rr
//: loadi *tmp, , -1
// Words: 15
// Words: 16
ldi $k0, -1
//: store c, 0, *tmp
// Words: 17
// Words: 18
ldi $k2, -11
// Words: 19
sdw $k0, $fp, $k2
//: load *tmp, 0, c
// Words: 20
// Words: 21
ldi $k2, -11
// Words: 22
ldw $k0, $fp, $k2
//: param *tmp, ,
// Words: 23
sdw $k0, $sp, $0
//: funccall , 1, putcharint
// Words: 24
addi $sp, 2
// Words: 25
move $a, $sp
// Words: 26
move $sp, $rr
// Words: 27
// Words: 28
// Words: 29
// Words: 30
// Words: 31
// Words: 32
// Words: 33
la $k2, putcharint
// Words: 34
jalr $k2
// Words: 35
addi $sp, -2
// Words: 36
move $sp, $rr
//: funcend , ,
// Words: 37
addi $0, -2
// Words: 38
ldw $ra, $fp, $rr
// Words: 39
addi $rr, -5
// Words: 40
ldw $s0, $fp, $rr
// Words: 41
addi $rr, -2
// Words: 42
ldw $s1, $fp, $rr
// Words: 43
addi $fp, -11
// Words: 44
move $sp, $rr
// Words: 45
// Words: 46
ldi $k0, -4
// Words: 47
ldw $fp, $fp, $k0
// Words: 48
jr $ra
//mainint: funcdecl 1, ,
mainint:// Words: 49
addi $sp, 4
// Words: 50
move $gp, $rr
// Words: 51
move $sp, $rr
//: loadi *tmp, , -6
global:// Words: 52
// Words: 53
ldi $k0, -6
//: store currx, 0, *tmp
// Words: 54
addi $gp, -2
// Words: 55
sdw $k0, $0, $rr
//: loadi *tmp, , 0
// Words: 56
// Words: 57
ldi $k0, 0
//: store curry, 0, *tmp
// Words: 58
addi $gp, -4
// Words: 59
sdw $k0, $0, $rr
//: loadi *tmp, , 0
L2:// Words: 60
// Words: 61
ldi $k0, 0
//: store i, 0, *tmp
// Words: 62
// Words: 63
ldi $k2, -11
// Words: 64
sdw $k0, $fp, $k2
//: jump , ,
// Words: 65
// Words: 66
// Words: 67
// Words: 68
// Words: 69
// Words: 70
// Words: 71
la $k2, L2
// Words: 72
jr $k2
//: loadi *tmp, , 0
L3:// Words: 73
// Words: 74
ldi $k0, 0
//: jr , *tmp,
// Words: 75
move $v, $k0
// Words: 76
addi $0, -2
// Words: 77
ldw $ra, $fp, $rr
// Words: 78
addi $rr, -3
// Words: 79
addi $rr, -2
// Words: 80
ldw $s0, $fp, $rr
// Words: 81
addi $rr, -2
// Words: 82
ldw $s1, $fp, $rr
// Words: 83
addi $fp, -11
// Words: 84
move $sp, $rr
// Words: 85
// Words: 86
ldi $k0, -4
// Words: 87
ldw $fp, $fp, $k0
// Words: 88
jr $ra
//putcharint: funcdecl 1, ,
putcharint:// Words: 89
addi $sp, 13
// Words: 90
move $sp, $rr
// Words: 91
addi $0, -2
// Words: 92
sdw $ra, $sp, $rr
// Words: 93
addi $rr, -2
// Words: 94
sdw $fp, $sp, $rr
// Words: 95
move $fp, $sp
// Words: 96
addi $rr, -1
// Words: 97
// Words: 98
ldi $k2, 1
// Words: 99
swn $k2, $fp, $rr
// Words: 100
addi $rr, -2
// Words: 101
sdw $s0, $fp, $rr
// Words: 102
addi $rr, -2
// Words: 103
sdw $s1, $fp, $rr
//: formal c, ,
// Words: 104
ldw $k2, $a, $0
// Words: 105
addi $0, -11
// Words: 106
sdw $k2, $fp, $rr
//: loadi *tmp, , 6
// Words: 107
// Words: 108
ldi $k0, 6
//: store intervalx, 0, *tmp
// Words: 109
// Words: 110
ldi $k2, -13
// Words: 111
sdw $k0, $fp, $k2
//: load *tmp, 0, currx
// Words: 112
addi $gp, -2
// Words: 113
ldw $k0, $0, $rr
//: push , , *tmp
// Words: 114
addi $sp, 2
// Words: 115
sdw $k0, $sp, $0
// Words: 116
move $sp, $rr
//: loadi *tmp, , 255
// Words: 117
// Words: 118
ldi $k0, 255
//: push , , *tmp
// Words: 119
addi $sp, 2
// Words: 120
sdw $k0, $sp, $0
// Words: 121
move $sp, $rr
//: load *tmp, 0, intervalx
// Words: 122
// Words: 123
ldi $k2, -13
// Words: 124
ldw $k0, $fp, $k2
//: loadi *tmp2, , 1
// Words: 125
// Words: 126
ldi $k1, 1
//: << *tmp2, *tmp2, *tmp
// Words: 127
sll $k0, $k1
// Words: 128
move $k1, $rr
//: pop *tmp, ,
// Words: 129
addi $sp, -2
// Words: 130
move $sp, $rr
// Words: 131
ldw $k0, $sp, $0
//: - *tmp2, *tmp2, *tmp
// Words: 132
sub $k0, $k1
// Words: 133
move $k1, $rr
//: pop *tmp, ,
// Words: 134
addi $sp, -2
// Words: 135
move $sp, $rr
// Words: 136
ldw $k0, $sp, $0
//: > *tmp, *tmp2, *tmp
// Words: 137
// Words: 138
// Words: 139
// Words: 140
// Words: 141
// Words: 142
// Words: 143
la $k2, L12
// Words: 144
bgt $k0, $k1, $k2
// Words: 145
// Words: 146
ldi $k0, 0
// Words: 147
// Words: 148
// Words: 149
// Words: 150
// Words: 151
// Words: 152
// Words: 153
la $k2, L13
// Words: 154
jr $k2
// Words: 155
// Words: 156
L12:ldi $k0, 1
L13:
//: push , , *tmp
// Words: 157
addi $sp, 2
// Words: 158
sdw $k0, $sp, $0
// Words: 159
move $sp, $rr
//: load *tmp, 0, c
// Words: 160
// Words: 161
ldi $k2, -11
// Words: 162
ldw $k0, $fp, $k2
//: loadi *tmp2, , 10
// Words: 163
// Words: 164
ldi $k1, 10
//: == *tmp2, *tmp2, *tmp
// Words: 165
// Words: 166
// Words: 167
// Words: 168
// Words: 169
// Words: 170
// Words: 171
la $k2, L14
// Words: 172
beq $k0, $k1, $k2
// Words: 173
// Words: 174
ldi $k1, 0
// Words: 175
// Words: 176
// Words: 177
// Words: 178
// Words: 179
// Words: 180
// Words: 181
la $k2, L15
// Words: 182
jr $k2
// Words: 183
// Words: 184
L14:ldi $k1, 1
L15:
//: pop *tmp, ,
// Words: 185
addi $sp, -2
// Words: 186
move $sp, $rr
// Words: 187
ldw $k0, $sp, $0
//: || *tmp, *tmp2, *tmp
// Words: 188
// Words: 189
// Words: 190
// Words: 191
// Words: 192
// Words: 193
// Words: 194
la $k2, L16
// Words: 195
bne $0, $k0, $k2
// Words: 196
bne $0, $k1, $k2
// Words: 197
move $k0, $0
// Words: 198
// Words: 199
// Words: 200
// Words: 201
// Words: 202
// Words: 203
// Words: 204
la $k2, L17
// Words: 205
jr $k2
// Words: 206
// Words: 207
L16: ldi $k0, 1
// Words: 208
L17: nop
//: if *tmp, ,
// Words: 209
// Words: 210
// Words: 211
// Words: 212
// Words: 213
// Words: 214
// Words: 215
la $k2, L6
// Words: 216
beq $k0, $0, $k2
//: loadi *tmp, , 0
L5:// Words: 217
// Words: 218
ldi $k0, 0
//: store currx, 0, *tmp
// Words: 219
addi $gp, -2
// Words: 220
sdw $k0, $0, $rr
//: load *tmp, 0, curry
// Words: 221
addi $gp, -4
// Words: 222
ldw $k0, $0, $rr
//: loadi *tmp2, , 10
// Words: 223
// Words: 224
ldi $k1, 10
//: + *tmp, *tmp2, *tmp
// Words: 225
add $k0, $k1
// Words: 226
move $k0, $rr
//: store curry, 0, *tmp
// Words: 227
addi $gp, -4
// Words: 228
sdw $k0, $0, $rr
// Words: 229
// Words: 230
// Words: 231
// Words: 232
// Words: 233
// Words: 234
// Words: 235
la $k2, L7
// Words: 236
jr $k2
//: load *tmp, 0, currx
L6:// Words: 237
addi $gp, -2
// Words: 238
ldw $k0, $0, $rr
//: load *tmp2, 0, intervalx
// Words: 239
// Words: 240
ldi $k2, -13
// Words: 241
ldw $k1, $fp, $k2
//: + *tmp, *tmp2, *tmp
// Words: 242
add $k0, $k1
// Words: 243
move $k0, $rr
//: store currx, 0, *tmp
// Words: 244
addi $gp, -2
// Words: 245
sdw $k0, $0, $rr
//: load *tmp, 0, c
L7:// Words: 246
// Words: 247
ldi $k2, -11
// Words: 248
ldw $k0, $fp, $k2
//: loadi *tmp2, , 10
// Words: 249
// Words: 250
ldi $k1, 10
//: beq , *tmp2, *tmp
// Words: 251
// Words: 252
// Words: 253
// Words: 254
// Words: 255
// Words: 256
// Words: 257
la $k2, L11
// Words: 258
beq $k0, $k1, $k2
//: assembly rp $v, 3, ,
L8:// Words: 259
rp $v, 3
//: move *tmp, , *v
// Words: 260
move $k0, $v
//: loadi *tmp2, , 0
// Words: 261
// Words: 262
ldi $k1, 0
//: blte , *tmp2, *tmp
// Words: 263
// Words: 264
// Words: 265
// Words: 266
// Words: 267
// Words: 268
// Words: 269
la $k2, L10
// Words: 270
blt $k0, $k1, $k2
// Words: 271
beq $k0, $k1, $k2
//: jump , ,
L9:// Words: 272
// Words: 273
// Words: 274
// Words: 275
// Words: 276
// Words: 277
// Words: 278
la $k2, L8
// Words: 279
jr $k2
//: assembly ldi $k0, 512;add $k0, $s1;wp $rr, 3;ldi $k0, 1024;add $k0, $s0;wp $rr, 3;ldi $k0, 1543;wp $k0, 3;, ,
L10:// Words: 280
addi $gp, -2
// Words: 281
ldw $s1, $0, $rr
// Words: 282
addi $gp, -4
// Words: 283
ldw $s0, $0, $rr
// Words: 284
ldi $k0, 512
// Words: 285
add $k0, $s1
// Words: 286
wp $rr, 3
// Words: 287
ldi $k0, 1024
// Words: 288
add $k0, $s0
// Words: 289
wp $rr, 3
// Words: 290
ldi $k0, 1543
// Words: 291
wp $k0, 3
//: move *tmp, , *v
// Words: 292
move $k0, $v
//: assembly ldi $s0, 2048;add $s0, $s1;wp $rr, 3, ,
// Words: 293
// Words: 294
ldi $k2, -11
// Words: 295
ldw $s1, $fp, $k2
// Words: 296
ldi $s0, 2048
// Words: 297
add $s0, $s1
// Words: 298
wp $rr, 3
//: move *tmp, , *v
// Words: 299
move $k0, $v
//: load *tmp, 0, c
L11:// Words: 300
// Words: 301
ldi $k2, -11
// Words: 302
ldw $k0, $fp, $k2
//: jr , *tmp,
// Words: 303
move $v, $k0
// Words: 304
addi $0, -2
// Words: 305
ldw $ra, $fp, $rr
// Words: 306
addi $rr, -3
// Words: 307
addi $rr, -2
// Words: 308
ldw $s0, $fp, $rr
// Words: 309
addi $rr, -2
// Words: 310
ldw $s1, $fp, $rr
// Words: 311
addi $fp, -13
// Words: 312
move $sp, $rr
// Words: 313
// Words: 314
ldi $k0, -4
// Words: 315
ldw $fp, $fp, $k0
// Words: 316
jr $ra
|
kernel/handlers.asm | udos-project/UDOS | 7 | 93805 | <reponame>udos-project/UDOS
COPY PDPTOP
PRINT GEN
YREGS
*
AIF ('&ZSYS' EQ 'S370').AMB24A
AMBIT EQU X'80000000'
AGO .AMB24B
.AMB24A ANOP
AMBIT EQU X'00000000'
.AMB24B ANOP
*
* AIF ('&ZAM64' NE 'YES').AMZB24A
*AM64BIT EQU X'00000001'
* AGO .AMZB24B
*.AMZB24A ANOP
*AM64BIT EQU X'00000000'
*.AMZB24B ANOP
*
CSECT
* Register save areas
FLCGRSAV EQU 384 A(X'180')
FLCCRSAV EQU 448 A(X'1C0')
* New PSWs
FLCPNPSW EQU 104 A(X'68')
* Old PSWs
FLCEOPSW EQU 24 A(X'18')
FLCSOPSW EQU 32 A(X'20')
FLCPOPSW EQU 40 A(X'28')
FLCMOPSW EQU 48 A(X'30')
FLCIOPSW EQU 56 A(X'38')
* Service call handler
*
EXTRN @ZHSVC
ENTRY @ASVCHDL
@ASVCHDL DS 0H
STM R0,R15,FLCGRSAV
LM R0,R15,FLCCRSAV
BALR R12,R0
USING *,12
L R13,=A(@FLSTACK)
LA R5,180(R13)
ST R5,76(R13)
*
L R15,=V(@ZHSVC)
BALR R14,R15
*
LM R0,R15,FLCGRSAV
LPSW FLCSOPSW
LTORG
DROP 12
* Program check handler
*
EXTRN @ZHPC
ENTRY @APCHDL
@APCHDL DS 0H
STM R0,R15,FLCGRSAV
LM R0,R15,FLCCRSAV
BALR R12,R0
USING *,12
L R13,=A(@FLSTACK)
LA R5,180(R13)
ST R5,76(R13)
*
L R15,=V(@ZHPC)
BALR R14,R15
*
LM R0,R15,FLCGRSAV
LPSW FLCPOPSW
LTORG
DROP 12
* External interruption handler
*
EXTRN @ZHEXT
ENTRY @AEXTHDL
@AEXTHDL DS 0H
STM R0,R15,FLCGRSAV
LM R0,R15,FLCCRSAV
BALR R12,R0
USING *,12
L R13,=A(@FLSTACK)
LA R5,180(R13)
ST R5,76(R13)
*
L R15,=V(@ZHEXT)
BALR R14,R15
*
LM R0,R15,FLCGRSAV
LPSW FLCEOPSW
LTORG
DROP 12
* Machine check handler
*
EXTRN @ZHMC
ENTRY @AMCHDL
@AMCHDL DS 0H
STM R0,R15,FLCGRSAV
LM R0,R15,FLCCRSAV
BALR R12,R0
USING *,12
L R13,=A(@FLSTACK)
LA R5,180(R13)
ST R5,76(R13)
*
L R15,=V(@ZHMC)
BALR R14,R15
*
LM R0,R15,FLCGRSAV
LPSW FLCMOPSW
LTORG
DROP 12
* I/O interruption handler
*
EXTRN @ZHIO
ENTRY @AIOHDL
@AIOHDL DS 0H
STM R0,R15,FLCGRSAV
LM R0,R15,FLCCRSAV
BALR R12,R0
USING *,12
L R13,=A(@FLSTACK)
LA R5,180(R13)
ST R5,76(R13)
*
L R15,=V(@ZHIO)
BALR R14,R15
*
LM R0,R15,FLCGRSAV
LPSW FLCIOPSW
LTORG
DROP 12
*
* HwGetScratchContextFrame
* OUT:
* current cpuid
*
ENTRY @ZHWSCTX
@ZHWSCTX DS 0H
SAVE (14,12),,@ZHWSCTX
LR R12,R15
USING @ZHWSCTX,12
LR R11,R1
* Return the address to FLCGRSAV
L R0,0
LA R15,FLCGRSAV(0)
RETURN (14,12),RC=(15)
LTORG
DROP 12
* HwCheckAddress
* IN:
* pointer to address to probe
*
ENTRY @ZHWCHKA
@ZHWCHKA DS 0H
SAVE (14,12),,@ZHWCHKA
LR R12,R15
USING @ZHWCHKA,12
LR R11,R1
* CATCHPSW address on R1
L R1,=A(CATCHPSW)
* Save address of TMPSAVE on R2
L R2,=A(TMPSAVE)
* And FLCPNPSW on R3
L R3,FLCPNPSW
*
MVC 0(8,R2),0(R3)
* ... use a new PSW to catch the exceptions
MVC 0(8,R3),0(R1)
* Probe the address, if it raises a PC exception then
* we will simply catch it and return 1
L R1,0(R11)
L R15,0(R1)
* rc = 0
MVC 0(8,R3),0(R2)
L R15,=F'0'
RETURN (14,12),RC=(15)
CATCHPCR DS 0H
* rc = 1
MVC 0(8,R3),0(R2)
L R15,=F'1'
RETURN (14,12),RC=(15)
LTORG
DROP 12
*
CATCHPSW DS 0D
DC X'020E0000'
DC A(AMBIT+CATCHPCR)
TMPSAVE DS 1D
*
@FLSTACK DS 1024F
*
END |
programs/oeis/134/A134227.asm | neoneye/loda | 22 | 25383 | <filename>programs/oeis/134/A134227.asm<gh_stars>10-100
; A134227: Row sums of triangle A134226.
; 1,4,9,15,22,30,39,49,60,72,85,99,114,130,147,165,184,204,225,247,270,294,319,345,372,400,429,459,490,522,555,589,624,660,697,735,774,814,855,897,940,984,1029,1075,1122,1170,1219,1269,1320,1372,1425,1479,1534,1590,1647,1705,1764,1824,1885,1947,2010,2074,2139,2205,2272,2340,2409,2479,2550,2622,2695,2769,2844,2920,2997,3075,3154,3234,3315,3397,3480,3564,3649,3735,3822,3910,3999,4089,4180,4272,4365,4459,4554,4650,4747,4845,4944,5044,5145,5247
add $0,4
bin $0,2
trn $0,7
add $0,1
|
oeis/343/A343752.asm | neoneye/loda-programs | 11 | 91957 | ; A343752: a(1) = 1; for n > 1, a(n) = n if a(n-1) is divisible by n, otherwise a(n) = a(n-1)+n.
; Submitted by <NAME>
; 1,3,3,7,12,6,13,21,30,10,21,33,46,60,15,31,48,66,85,105,21,43,66,90,115,141,168,28,57,87,118,150,183,217,252,36,73,111,150,190,231,273,316,360,45,91,138,186,235,285,336,388,441,495,55,111,168,226,285,345,406,468,531,595,660,66,133,201,270,340,411,483,556,630,705,781,858,78,157,237,318,400,483,567,652,738,825,913,1002,1092,91,183,276,370,465,561,658,756,855,955
add $0,1
mov $2,$0
lpb $2
sub $1,1
add $2,$1
lpe
bin $1,2
add $1,$0
add $2,1
mul $2,$1
mov $0,$2
div $0,2
|
libsrc/_DEVELOPMENT/stdio/c/sccz80/vprintf_unlocked_callee.asm | jpoikela/z88dk | 640 | 89435 |
; int vprintf_unlocked(const char *format, void *arg)
SECTION code_clib
SECTION code_stdio
PUBLIC vprintf_unlocked_callee
EXTERN asm_vprintf_unlocked
vprintf_unlocked_callee:
pop af
pop bc
pop de
push af
jp asm_vprintf_unlocked
|
programs/oeis/016/A016998.asm | neoneye/loda | 22 | 172443 | <filename>programs/oeis/016/A016998.asm
; A016998: a(n) = (7*n + 1)^6.
; 1,262144,11390625,113379904,594823321,2176782336,6321363049,15625000000,34296447249,68719476736,128100283921,225199600704,377149515625,606355001344,941480149401,1418519112256,2081951752609,2985984000000,4195872914689,5789336458816,7858047974841,10509215371264,13867245015625,18075490334784,23298085122481,29721861554176,37558352909169,47045881000000,58451728309129,72074394832896,88245939632761,107334407093824,129746337890625,155929364660224,186374892382561,221620863468096,262254607552729,308915776000000,362299361110569,423158800038976,492309163417681,570630428688384,659070838140625,758650341657664,870464124169641,995686217814016,1135573198803289,1291467969000000,1464803622199009,1657107395117056,1870004703089601,2105223260474944,2364597285765625,2650071791407104,2963706958323721,3307682595151936,3684302682180849,4096000000000000,4545340842854449,5035029816707136,5567914722008521,6146991521173504,6775409390765625,7456475858388544,8193662024284801,8990607867641856,9851127637605409,10779215329000000,11779050242756889,12855002631049216,14011639427134441,15253730059904064,16586252353140625,18014398509481984,19543581179092881,21179439613043776,22927845901396969,24794911296000000,26786992617986329,28910698749983296,31172897213027361,33580720828186624,36141574462890625,38863141861967424,41753392563387961,44820588898717696,48073293078275529,51520374361000000,55171016309022769,59034724126949376,63121332085847281,67441011031941184,72004275980015625,76821993791524864,81905390937410041,87266061345623616,92915974333361089,98867482624000000,105133330448746209,111726661732987456
mul $0,7
add $0,1
pow $0,6
|
test/Fail/DuplicateConstructors.agda | cruhland/agda | 1,989 | 16359 | <filename>test/Fail/DuplicateConstructors.agda
module DuplicateConstructors where
data D : Set where
c : D
c : D
f : D -> D
f c = c
|
programs/oeis/138/A138886.asm | jmorken/loda | 1 | 9673 | ; A138886: n-th run has length n-th nonprime number A018252, with digits 0 and 1 only, starting with 0.
; 0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
mul $0,2
lpb $0
sub $0,6
mov $1,5
add $2,2
mov $3,2
mov $4,$2
add $2,1
trn $0,$2
gcd $3,$4
mul $1,$3
log $1,3
lpe
add $1,1
trn $1,2
|
programs/oeis/168/A168409.asm | neoneye/loda | 22 | 97740 | <reponame>neoneye/loda
; A168409: a(n) = 8 + 9*floor((n-1)/2).
; 8,8,17,17,26,26,35,35,44,44,53,53,62,62,71,71,80,80,89,89,98,98,107,107,116,116,125,125,134,134,143,143,152,152,161,161,170,170,179,179,188,188,197,197,206,206,215,215,224,224,233,233,242,242,251,251,260,260,269,269,278,278,287,287,296,296,305,305,314,314,323,323,332,332,341,341,350,350,359,359,368,368,377,377,386,386,395,395,404,404,413,413,422,422,431,431,440,440,449,449
div $0,2
mul $0,9
add $0,8
|
unittests/32Bit_ASM/Primary/Primary_61_2.asm | cobalt2727/FEX | 628 | 170839 | %ifdef CONFIG
{
"RegData": {
"RAX": "0x6",
"RCX": "0x5",
"RDX": "0x4",
"RSP": "0xE0000020",
"RBX": "0x3",
"RBP": "0x2",
"RSI": "0x1",
"RDI": "0x0"
},
"Mode": "32BIT"
}
%endif
mov esp, 0xe0000020
mov eax, 0xFF
mov ecx, 0xFF
mov edx, 0xFF
mov ebx, 0xFF
mov ebp, 0xFF
mov esi, 0xFF
mov edi, 0xFF
push word 0x6
push word 0x5
push word 0x4
push word 0x3
push word 0x4142 ; Skipped
push word 0x2
push word 0x1
push word 0x0
o16 popa
hlt
|
Core/DolphinVM/ExternalBytes.asm | roscoe/Dolphin | 63 | 174769 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Dolphin Smalltalk
; External Buffer Primitive routines and helpers in Assembler for IX86
;
; See also flotprim.cpp, as the floating point buffer accessing primitives
; (rarely used by anybody except Mr Bower [and therefore unimportant, tee hee])
; are still coded in dead slow C++
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
INCLUDE IstAsm.Inc
.CODE FFIPRIM_SEG
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Imports
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MACROS
IndirectAtPreamble MACRO ;; Set up EAX/EDX ready to access value
mov ecx, [_SP-OOPSIZE] ;; Load receiver
ASSUME ecx:PTR OTE
mov edx, [_SP] ;; Load the byte offset
mov eax, [ecx].m_location ;; Get ptr to receiver into eax
ASSUME eax:PTR ExternalAddress
sar edx, 1 ;; Convert byte offset from SmallInteger (at the same time testing bottom bit)
mov eax, [eax].m_pointer ;; Load pointer out of object (immediately after header)
jnc localPrimitiveFailure0 ;; Arg not a SmallInteger, fail the primitive
ASSUME eax:NOTHING
ASSUME ecx:NOTHING
ENDM
IndirectAtPutPreamble MACRO ;; Set up EAX/EDX ready to access value
mov ecx, [_SP-OOPSIZE*2] ;; Load receiver
ASSUME ecx:PTR OTE
mov edx, [_SP-OOPSIZE] ;; Load the byte offset
mov eax, [ecx].m_location ;; Get ptr to receiver into eax
ASSUME eax:PTR ExternalAddress
sar edx, 1 ;; Convert byte offset from SmallInteger (at the same time testing bottom bit)
mov eax, [eax].m_pointer ;; Load pointer out of object (immediately after header)
jnc localPrimitiveFailure0 ;; Arg not a SmallInteger, fail the primitive
ASSUME eax:NOTHING
ASSUME ecx:NOTHING
ENDM
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Procedures
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; BOOL __fastcall Interpreter::primitiveAddressOf()
;
; Answer the address of the contents of the receiving byte object
; as an Integer. Notice that this is a very fast and simple primitive
;
BEGINPRIMITIVE primitiveAddressOf
mov ecx, [_SP] ; Load receiver at stack top
CANTBEINTEGEROBJECT <ecx>
mov eax, [ecx].m_location ; Load address of object
mov ecx, eax ; Save DWORD value in case of overflow
add eax, eax ; Will it fit into a SmallInteger?
jo largePositiveRequired ; No, its a 32-bit value
js largePositiveRequired ; Won't be positive SmallInteger (31 bit value)
or eax, 1 ; Yes, add SmallInteger flag
mov [_SP], eax ; Store new SmallInteger at stack top
mov eax, _SP ; primitiveSuccess(0)
ret
largePositiveRequired:
call LINEWUNSIGNED32 ; Returns new object to our caller in eax
mov [_SP], eax ; Overwrite receiver with new object
AddToZctNoSP <a>
mov eax, _SP ; primitiveSuccess(0)
ret
ENDPRIMITIVE primitiveAddressOf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; External buffer/structure primitives.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
BEGINPRIMITIVE primitiveWORDAt
mov edx, [_SP] ; Load the byte offset
mov ecx, [_SP-OOPSIZE] ; Access receiver at stack top
ASSUME ecx:PTR OTE
sar edx, 1 ; Convert byte offset from SmallInteger (at the same time testing bottom bit)
mov eax, [ecx].m_location ; EAX is pointer to receiver
jnc localPrimitiveFailure0 ; Arg not a SmallInteger, fail the primitive
js localPrimitiveFailure1 ; Negative offset not valid
; Receiver is a normal byte object
mov ecx, [ecx].m_size
add edx, SIZEOF WORD ; Adjust offset to be last byte ref'd
and ecx, 7fffffffh ; Ignore immutability bit
cmp edx, ecx ; Off end of object?
jg localPrimitiveFailure1 ; Yes, offset too large
movzx ecx, WORD PTR[eax+edx-SIZEOF WORD] ; No, load WORD from object[offset]
lea eax, [_SP-OOPSIZE] ; primitiveSuccess(1)
lea ecx, [ecx+ecx+1] ; Convert to SmallInteger
mov [_SP-OOPSIZE], ecx ; Overwrite receiver
ret
LocalPrimitiveFailure 0
LocalPrimitiveFailure 1
ENDPRIMITIVE primitiveWORDAt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This primitive is exactly the same as primitiveWORDAt, except that it uses MOVSX
;; instead of MOVZX in order to sign extend the SWORD value
BEGINPRIMITIVE primitiveSWORDAt
mov ecx, [_SP-OOPSIZE] ; Access receiver below arg
ASSUME ecx:PTR OTE
mov edx, [_SP] ; Load the byte offset
sar edx, 1 ; Convert byte offset from SmallInteger (at the same time testing bottom bit)
mov eax, [ecx].m_location ; EAX is pointer to receiver
jnc localPrimitiveFailure0 ; Arg not a SmallInteger, fail the primitive
js localPrimitiveFailure1 ; Negative offset not valid
; Receiver is a normal byte object
mov ecx, [ecx].m_size
add edx, SIZEOF WORD ; Adjust offset to be last byte ref'd
and ecx, 7fffffffh ; Ignore immutability bit
cmp edx, ecx ; Off end of object?
jg localPrimitiveFailure1 ; Yes, offset too large
movsx ecx, WORD PTR[eax+edx-SIZEOF WORD] ; No, load WORD from object[offset]
lea eax, [_SP-OOPSIZE] ; primitiveSuccess(1)
lea ecx, [ecx+ecx+1] ; Convert to SmallInteger
mov [_SP-OOPSIZE], ecx ; Overwrite receiver
ret
LocalPrimitiveFailure 0
LocalPrimitiveFailure 1
ENDPRIMITIVE primitiveSWORDAt
primitiveFailure0:
PrimitiveFailureCode 0
primitiveFailure1:
PrimitiveFailureCode 1
primitiveFailure2:
PrimitiveFailureCode 2
; static BOOL __fastcall Interpreter::primitiveDWORDAt()
;
; Extract a 4-byte unsigned integer from the receiver (which must be a byte
; addressable object) and answer either a SmallInteger, or a
; LargePositiveInteger if 30-bits or more are required
;
; Can only succeed if the argument is a SmallInteger
;
BEGINPRIMITIVE primitiveDWORDAt
mov ecx, [_SP-OOPSIZE] ; Access receiver below arg
ASSUME ecx:PTR OTE
mov edx, [_SP] ; Load the byte offset
sar edx, 1 ; Convert byte offset from SmallInteger
mov eax, [ecx].m_location ; EAX is pointer to receiver
jnc localPrimitiveFailure0 ; Not a SmallInteger, fail the primitive
js localPrimitiveFailure1 ; Negative offset not valid
;; Receiver is a normal byte object
mov ecx, [ecx].m_size
add edx, SIZEOF DWORD ; Adjust offset to be last byte ref'd
and ecx, 7fffffffh ; Ignore immutability bit
cmp edx, ecx ; Off end of object?
jg localPrimitiveFailure1 ; Yes, offset too large
mov eax, [eax+edx-SIZEOF DWORD] ; No, load DWORD from object[offset]
mov ecx, eax ; Save DWORD value
add eax, eax ; Will it fit into a SmallInteger?
jo largePositiveRequired ; No, its a 32-bit value
js largePositiveRequired ; Won't be positive SmallInteger (31 bit value)
or eax, 1 ; Yes, add SmallInteger flag
mov [_SP-OOPSIZE], eax ; Store new SmallInteger at stack top
lea eax, [_SP-OOPSIZE] ; primitiveSuccess(0)
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Replace the object at stack top (assuming no count down necessary, or already done)
;; with a new LargePositiveInteger whose value is half that in ECX/Carry Flag
largePositiveRequired: ; eax contains left shifted value
call LINEWUNSIGNED32 ; Returns new object to our caller in eax
mov [_SP-OOPSIZE], eax ; Overwrite receiver with new object
AddToZct <a>
lea eax, [_SP-OOPSIZE] ; primitiveSuccess(1)
ret
LocalPrimitiveFailure 0
LocalPrimitiveFailure 1
ENDPRIMITIVE primitiveDWORDAt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; As above, but receiver is indirection object
;; Optimise for storing SmallInteger, since this most frequent op
BEGINPRIMITIVE primitiveIndirectDWORDAt
IndirectAtPreamble
mov eax, [eax+edx] ; Load DWORD from *(address+offset)
mov ecx, eax ; Save DWORD value in case of overflow
add eax, eax ; Will it fit into a SmallInteger?
jo largePositiveRequired ; No, its a 32-bit value
js largePositiveRequired ; Won't be positive SmallInteger (31 bit value)
or eax, 1 ; Yes, add SmallInteger flag
mov [_SP-OOPSIZE], eax ; Store new SmallInteger at stack top
lea eax, [_SP-OOPSIZE] ; primitiveSuccess(1)
ret
largePositiveRequired:
call LINEWUNSIGNED32 ; Returns new object to our caller in eax
mov [_SP-OOPSIZE], eax ; Overwrite receiver with new object
AddToZct <a>
lea eax, [_SP-OOPSIZE] ; primitiveSuccess(1)
ret
LocalPrimitiveFailure 0
ENDPRIMITIVE primitiveIndirectDWORDAt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; int __fastcall Interpreter::primitiveSDWORDAt()
;
; Extract a 4-byte signed integer from the receiver (which must be a byte
; addressable object) and answer either a SmallInteger, or a
; LargeInteger if 31-bits or more are required
;
BEGINPRIMITIVE primitiveSDWORDAt
mov ecx, [_SP-OOPSIZE] ; Access receiver at stack top
ASSUME ecx:PTR OTE
mov edx, [_SP] ; Load the byte offset
sar edx, 1 ; Convert byte offset from SmallInteger
mov eax, [ecx].m_location ; EAX is pointer to receiver
ASSUME eax:PTR Object
jnc localPrimitiveFailure0 ; Not a SmallInteger, fail the primitive
js localPrimitiveFailure1 ; Negative offset not valid
;; Receiver is a normal byte object
mov ecx, [ecx].m_size
add edx, SIZEOF DWORD ; Adjust offset to be last byte ref'd
and ecx, 7fffffffh ; Ignore immutability bit
cmp edx, ecx ; Off end of object?
jg localPrimitiveFailure1 ; Yes, offset too large
mov eax, [eax+edx-SIZEOF DWORD] ; No, load SDWORD from object[offset]
ASSUME eax:SDWORD
mov ecx, eax ; Restore SDWORD value into ECX
add ecx, eax ; Will it fit into a SmallInteger
jo @F ; No, its at 32-bit number
or ecx, 1 ; Yes, add SmallInteger flag
lea eax, [_SP-OOPSIZE] ; primitiveSuccess(1)
mov [_SP-OOPSIZE], ecx ; Store new SmallInteger at stack top
ret
@@:
mov ecx, eax ; Revert to non-shifted value
call LINEWSIGNED ; Create new LI with 32-bit signed value in ECX
mov [_SP-OOPSIZE], eax ; Overwrite receiver with new object
AddToZct <a>
lea eax, [_SP-OOPSIZE] ; primitiveSuccess(1)
ret
LocalPrimitiveFailure 0
LocalPrimitiveFailure 1
ENDPRIMITIVE primitiveSDWORDAt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Optimise for storing SmallInteger, since this most frequent op
BEGINPRIMITIVE primitiveSDWORDAtPut
mov ecx, [_SP-OOPSIZE*2] ; Access receiver
ASSUME ecx:PTR OTE
mov edx, [_SP-OOPSIZE] ; Load the byte offset
sar edx, 1 ; Convert byte offset from SmallInteger
mov eax, [ecx].m_location ; EAX is pointer to receiver
ASSUME eax:PTR Object
js primitiveFailure1 ; Negative offset invalid
jnc primitiveFailure0 ; Offset, not a SmallInteger, fail the primitive
;; Receiver is a normal byte object
add edx, SIZEOF DWORD ; Adjust offset to be last byte ref'd
cmp edx, [ecx].m_size ; Off end of object? N.B. Don't mask out immutable bit
lea eax, [eax+edx-SIZEOF DWORD] ; Calculate destination address
ASSUME eax:PTR SDWORD ; EAX now points at slot to update
jg primitiveFailure1 ; Yes, offset too large
;; Deliberately drop through into the common backend
ENDPRIMITIVE primitiveSDWORDAtPut
;; Common backend for xxxxxSDWORDAtPut primitives
sdwordAtPut PROC
mov edx, [_SP]
test dl, 1 ; SmallInteger value?
jz @F ; No
; Store down smallInteger value
mov ecx, edx
sar edx, 1 ; Convert from SmallInteger value
mov [eax], edx ; Store down value into object
; Don't adjust stack until memory has been accessed in case it is inaccessible and causes an access violation
mov [_SP-OOPSIZE*2], ecx ; Overwrite receiver
lea eax, [_SP-OOPSIZE*2] ; primitiveSuccess(2)
ret
@@:
ASSUME edx:PTR OTE
; Non-SmallInteger value
test [edx].m_flags, MASK m_pointer
mov ecx, [edx].m_size
jnz primitiveFailure2 ; Can't assign pointer object
and ecx, 7fffffffh ; Mask out the immutability bit (can assign const object)
cmp ecx, SIZEOF DWORD
mov edx, [edx].m_location ; Get pointer to arg2 into ecx
ASSUME edx:PTR LargeInteger
jne primitiveFailure2
; So now we know it's a 4-byte object, let's see if its a negative large integer
mov edx, [edx].m_digits[0] ; Load the 32-bit value
ASSUME edx:DWORD
mov [eax], edx ; Store down 32-bit value
mov edx, [_SP] ; Reload arg
mov [_SP-OOPSIZE*2], edx ; Overwrite receiver
lea eax, [_SP-OOPSIZE*2] ; primitiveSuccess(2)
ret
sdwordAtPut ENDP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; An exact copy of the above, but omits LargePositiveInteger range check
BEGINPRIMITIVE primitiveDWORDAtPut
mov ecx, [_SP-OOPSIZE*2] ; Access receiver
ASSUME ecx:PTR OTE
mov edx, [_SP-OOPSIZE] ; Load the byte offset
sar edx, 1 ; Convert byte offset from SmallInteger
mov eax, [ecx].m_location ; EAX is pointer to receiver
jnc primitiveFailure0 ; Offset, not a SmallInteger, fail the primitive
js primitiveFailure1 ; Negative offset invalid
;; Receiver is a normal byte object
add edx, SIZEOF DWORD ; Adjust offset to be last byte ref'd
cmp edx, [ecx].m_size ; Off end of object? N.B. Don't mask out immutable bit
lea eax, [eax+edx-SIZEOF DWORD] ; Calculate destination address
jg primitiveFailure1 ; Yes, offset too large
; DELIBERATELY DROP THROUGH into dwordAtPut
ENDPRIMITIVE primitiveDWORDAtPut
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Helper backed to primitiveDWORDAtPut and primitiveIndirectDWORDAtPut
dwordAtPut PROC
; EAX is pointer to destination for DWORD value
; ECX, EDX not used for input
; Adjusts stack to remove args if succeeds.
; May fail the primitive
mov edx, [_SP]
test dl, 1 ; SmallInteger value?
jz @F ; No
; Store down smallInteger value
mov ecx, edx
sar edx, 1 ; Convert from SmallInteger value
mov [eax], edx ; Store down value into object
; Past failing so adjust stack (returns the argument)
mov [_SP-OOPSIZE*2], ecx ; Overwrite receiver
lea eax, [_SP-OOPSIZE*2] ; primitiveSuccess(2)
ret
@@:
ASSUME edx:PTR OTE
; Non-SmallInteger value
test [edx].m_flags, MASK m_pointer
jnz primitiveFailure2 ; Can't assign pointer object
mov ecx, [edx].m_size
and ecx, 7fffffffh ; Mask out the immutable bit on the assigned value
cmp ecx, SIZEOF DWORD
mov edx, [edx].m_location ; Get pointer to arg2 into ecx
ASSUME edx:PTR Object
je @F ; 4 bytes, can store down
cmp ecx, SIZEOF QWORD
jne primitiveFailure2
; It's an 8 byte object, may be able to store if top byte zero (e.g. positive LargeIntegers >= 16r80000000)
ASSUME edx:PTR QWORDBytes
cmp [edx].m_highPart, 0
jne primitiveFailure2 ; Top dword not zero, so disallow it
@@:
ASSUME edx:PTR DWORDBytes
mov edx, [edx].m_value ; Load the 32-bit value
mov [eax], edx ; Store down 32-bit value
mov edx, [_SP] ; Reload arg
mov [_SP-OOPSIZE*2], edx ; Overwrite receiver with arg for answer
lea eax, [_SP-OOPSIZE*2] ; primitiveSuccess(2)
ret
ASSUME edx:NOTHING
dwordAtPut ENDP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
BEGINPRIMITIVE primitiveIndirectSDWORDAtPut
mov ecx, [_SP-OOPSIZE*2] ; Access receiver
ASSUME ecx:PTR OTE
mov edx, [_SP-OOPSIZE] ; Load the byte offset
sar edx, 1 ; Convert byte offset from SmallInteger
mov eax, [ecx].m_location ; EAX is pointer to receiver
jnc primitiveFailure0 ; Offset, not a SmallInteger, fail the primitive
;js primitiveFailure1 ; Negative offset ARE valid
; Receiver is an ExternalAddress
mov eax, (ExternalAddress PTR[eax]).m_pointer; Load pointer out of object (immediately after header)
add eax, edx ; Calculate destination address
jmp sdwordAtPut ; Pass control to the common backend
ENDPRIMITIVE primitiveIndirectSDWORDAtPut
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; As above, but receiver is indirection object
BEGINPRIMITIVE primitiveIndirectDWORDAtPut
mov ecx, [_SP-OOPSIZE*2] ; Access receiver
ASSUME ecx:PTR OTE
mov edx, [_SP-OOPSIZE] ; Load the byte offset
sar edx, 1 ; Convert byte offset from SmallInteger
mov eax, [ecx].m_location ; EAX is pointer to receiver
jnc primitiveFailure0 ; Offset, not a SmallInteger, fail the primitive
; Receiver is an ExternalAddress
mov eax, (ExternalAddress PTR[eax]).m_pointer; Load pointer out of object (immediately after header)
add eax, edx ; Calculate destination address
jmp dwordAtPut ; Pass control to the common backend with primitiveDWORDAtPut
ENDPRIMITIVE primitiveIndirectDWORDAtPut
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
BEGINPRIMITIVE primitiveIndirectSDWORDAt
IndirectAtPreamble
mov eax, DWORD PTR[eax+edx] ; Save SDWORD from *(address+offset)
;; Its not going to fail, so prepare Smalltalk stack
mov ecx, eax ; Restore SDWORD value into ECX
add eax, eax ; Will it fit into a SmallInteger
jo overflow ; No, its at 32-bit number
or eax, 1 ; Yes, add SmallInteger flag
mov [_SP-OOPSIZE], eax ; Store new SmallInteger at stack top
lea eax, [_SP-OOPSIZE] ; primitiveSuccess(0)
ret
overflow:
call LINEWSIGNED ; Create new LI with 32-bit signed value in ECX
mov [_SP-OOPSIZE], eax ; Overwrite receiver with new object
AddToZct <a>
lea eax, [_SP-OOPSIZE] ; primitiveSuccess(1)
ret
LocalPrimitiveFailure 0
ENDPRIMITIVE primitiveIndirectSDWORDAt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
BEGINPRIMITIVE primitiveIndirectSWORDAt
IndirectAtPreamble
movsx ecx, WORD PTR[eax+edx] ; Sign extend WORD from *(address+offset) into EAX
lea ecx, [ecx+ecx+1] ; Convert to SmallInteger
lea eax, [_SP-OOPSIZE] ; primitiveSuccess(1)
mov [_SP-OOPSIZE], ecx ; Overwrite receiver
ret
LocalPrimitiveFailure 0
ENDPRIMITIVE primitiveIndirectSWORDAt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
BEGINPRIMITIVE primitiveIndirectWORDAt
IndirectAtPreamble
movzx ecx, WORD PTR[eax+edx] ; Zero extend WORD from *(address+offset) into EAX
lea ecx, [ecx+ecx+1] ; Convert to SmallInteger
lea eax, [_SP-OOPSIZE] ; primitiveSuccess(1)
mov [_SP-OOPSIZE], ecx ; Overwrite receiver
ret
LocalPrimitiveFailure 0
ENDPRIMITIVE primitiveIndirectWORDAt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
; int __fastcall Interpreter::primitiveByteAtAddress()
;
; Treat the contents of the receiver (which must be a byte object) at
; offsets 0..3 as an address and answer the byte at that address plus
; the offset specified as an argument.
;
BEGINPRIMITIVE primitiveByteAtAddress
IndirectAtPreamble
movzx ecx, BYTE PTR[eax+edx] ; Load the desired byte into cl
lea eax, [_SP-OOPSIZE] ; primitiveSuccess(1)
lea ecx, [ecx+ecx+1] ; Convert to SmallInteger
mov [_SP-OOPSIZE], ecx ; Store new SmallInteger at stack top
ret
LocalPrimitiveFailure 0
ENDPRIMITIVE primitiveByteAtAddress
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; int __fastcall Interpreter::primitiveByteAtAddressPut()
;
; Treat the contents of the receiver (which must be a byte object) at
; offsets 0..3 as an address and ovewrite the byte at that address plus
; the offset specified as an argument with the argument.
;
BEGINPRIMITIVE primitiveByteAtAddressPut
mov ecx, [_SP-OOPSIZE*2] ; Access receiver underneath arguments
ASSUME ecx:PTR OTE
mov edx, [_SP-OOPSIZE] ; Load the byte offset
sar edx, 1 ; Convert byte offset from SmallInteger
mov eax, [_SP] ; Load the value argument
mov ecx, [ecx].m_location ; Load address of object into EAX
ASSUME ecx:PTR ExternalAddress
jnc localPrimitiveFailure0 ; Offset not a SmallInteger, fail the primitive
mov ecx, [ecx].m_pointer ; Load the base address from the object
ASSUME ecx:PTR BYTE
add ecx, edx
ASSUME edx:NOTHING ; EDX is now free
mov edx, eax ; Load value into EDX
sar edx, 1 ; Convert byte value from SmallInteger
jnc localPrimitiveFailure2 ; Not a SmallInteger, fail the primitive
cmp edx, 0FFh ; Is it in range?
ja localPrimitiveFailure3 ; No, too big (N.B. unsigned comparison)
mov [ecx], dl ; Store byte at the specified offset
mov [_SP-OOPSIZE*2], eax ; SmallInteger answer (same as value arg)
lea eax, [_SP-OOPSIZE*2] ; primitiveSuccess(2)
ret
LocalPrimitiveFailure 0
LocalPrimitiveFailure 2
LocalPrimitiveFailure 3
ENDPRIMITIVE primitiveByteAtAddressPut
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; int __fastcall Interpreter::primitiveWORDAtPut()
;
BEGINPRIMITIVE primitiveWORDAtPut
mov ecx, [_SP-OOPSIZE*2] ; Access receiver underneath arguments
ASSUME ecx:PTR OTE
mov edx, [_SP-OOPSIZE] ; Load the byte offset
sar edx, 1 ; Convert byte offset from SmallInteger
mov eax, [ecx].m_location ; Load address of object
jnc localPrimitiveFailure0 ; Not a SmallInteger, fail the primitive
js localPrimitiveFailure1 ; Negative offsets not valid
add edx, SIZEOF WORD ; Adjust offset to be last byte ref'd
cmp edx, [ecx].m_size ; Off end of object? N.B. Ignore the immutable bit so fails if receiver constant
jg localPrimitiveFailure1 ; Yes, offset too large, fail it
mov ecx, [_SP] ; Load the value argument
sar ecx, 1 ; Convert byte value from SmallInteger
jnc localPrimitiveFailure2 ; Not a SmallInteger, fail the primitive
cmp ecx, 0FFFFh ; Is it in range?
ja localPrimitiveFailure3 ; No, too big (N.B. unsigned comparison)
mov WORD PTR[eax+edx-SIZEOF WORD], cx ; No, Store down the 16-bit value
mov eax, [_SP] ; and value
mov [_SP-OOPSIZE*2], eax ; SmallInteger answer (same as value arg)
lea eax, [_SP-OOPSIZE*2] ; primitiveSuccess(2)
ret
LocalPrimitiveFailure 0
LocalPrimitiveFailure 1
LocalPrimitiveFailure 2
LocalPrimitiveFailure 3
ENDPRIMITIVE primitiveWORDAtPut
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; int __fastcall Interpreter::primitiveIndirectWORDAtPut()
;
BEGINPRIMITIVE primitiveIndirectWORDAtPut
IndirectAtPutPreamble
mov ecx, [_SP] ; Load the value argument
sar ecx, 1 ; Convert byte value from SmallInteger
jnc localPrimitiveFailure2 ; Not a SmallInteger, fail the primitive
cmp ecx, 0FFFFh ; Is it in range?
ja localPrimitiveFailure3 ; No, too big (N.B. unsigned comparison)
mov WORD PTR[eax+edx], cx ; Store down the 16-bit value
mov ecx, [_SP] ; and value
lea eax, [_SP-OOPSIZE*2] ; primitiveSuccess(2)
mov [_SP-OOPSIZE*2], ecx ; SmallInteger answer (same as value arg)
ret
LocalPrimitiveFailure 0
LocalPrimitiveFailure 2
LocalPrimitiveFailure 3
ENDPRIMITIVE primitiveIndirectWORDAtPut
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Store a signed word into a buffer. The offset must be in bounds, and the
; value must be a SmallInteger in the range -32768..32767
;
BEGINPRIMITIVE primitiveSWORDAtPut
mov ecx, [_SP-OOPSIZE*2] ; Access receiver underneath arguments
ASSUME ecx:PTR OTE
mov edx, [_SP-OOPSIZE] ; Load the byte offset
sar edx, 1 ; Convert byte offset from SmallInteger
mov eax, [ecx].m_location ; Load address of object
jnc localPrimitiveFailure0 ; Not a SmallInteger, fail the primitive
js localPrimitiveFailure1 ; Negative offsets not valid
add edx, SIZEOF WORD ; Adjust offset to be last byte ref'd
cmp edx, [ecx].m_size ; Off end of object? N.B. Ignore the immutable bit so fails if receiver constant
jg localPrimitiveFailure1 ; Yes, offset too large, fail it
mov ecx, [_SP] ; Load the value argument
sar ecx, 1 ; Convert byte value from SmallInteger
jnc localPrimitiveFailure2 ; Not a SmallInteger, fail the primitive
cmp ecx, 08000h ; Is it in range?
jge localPrimitiveFailure3 ; No, too large positive
cmp ecx, -08000h
jl localPrimitiveFailure3 ; No, too large negative
mov WORD PTR[eax+edx-SIZEOF WORD], cx ; No, Store down the 16-bit value
mov ecx, [_SP] ; and value
lea eax, [_SP-OOPSIZE*2] ; primitiveSuccess(2)
mov [_SP-OOPSIZE*2], ecx ; SmallInteger answer (same as value arg)
ret
LocalPrimitiveFailure 0
LocalPrimitiveFailure 1
LocalPrimitiveFailure 2
LocalPrimitiveFailure 3
ENDPRIMITIVE primitiveSWORDAtPut
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Store a signed word into a buffer pointed at by the receiver. The
; value must be a SmallInteger in the range -32768..32767. If the receiver's
; address value + the offset is not a writeable address, then a non-fatal GP
; fault will occur.
;
BEGINPRIMITIVE primitiveIndirectSWORDAtPut
IndirectAtPutPreamble
mov ecx, [_SP] ; Load the value argument
sar ecx, 1 ; Convert byte value from SmallInteger
jnc localPrimitiveFailure2 ; Not a SmallInteger, fail the primitive
cmp ecx, 08000h ; Is it in range?
jge localPrimitiveFailure3 ; No, too large positive
cmp ecx, -08000h
jl localPrimitiveFailure3 ; No, too large negative
mov WORD PTR[eax+edx], cx ; Store down the 16-bit value
mov ecx, [_SP] ; and value
lea eax, [_SP-OOPSIZE*2] ; primitiveSuccess(2)
mov [_SP-OOPSIZE*2], ecx ; SmallInteger answer (same as value arg)
ret
LocalPrimitiveFailure 0
LocalPrimitiveFailure 2
LocalPrimitiveFailure 3
ENDPRIMITIVE primitiveIndirectSWORDAtPut
END
|
prog2.asm | pbhandari9541/COSC-2329 | 0 | 176674 | ;<NAME>
;Program: 2
;Title: Conversion of letter to uppercase and lowercase
;
org 100h
section .data
msg1 DB '<NAME> $'
msg2 DB 0Ah,0Dh,'Enter a letter to convert: $'
msg3 DB 0Ah,0Dh,'The converted character is: $'
CHAR DB ' ','$'
exCode DB 0
section .text
start: mov dx, msg1 ;get message1
mov ah,09h ;display string function
int 21h ;Display message1
mov ah,09h ;display string function
mov dx, msg2 ;get message2
int 21h ;Display message2
;read a character
mov ah,1h ;read char fcn
int 21h ;read it into al
;if
cmp al,41h ;compare al> 'A'
jl exit ;Jump to exit if less than"A"
cmp al,5Ah ;Compare al>'Z'
jle then ; jump if less or eual to 'Z'
cmp al,61h ;compare al>'a'
jl exit ;jump exit if less
cmp al,7Ah ;compare al>'z'
jle else ;jump if less or equal'z'
then: add al,20h ; subtract 32 from al register
mov [CHAR],al ; transfer content of al to CHAR memory location
jmp endif ; jump to endif
else: sub al,20h ; add 32 to the al register
mov [CHAR],al ; transfer content of al to CHAR memory location
jmp endif ;jump to endif
endif: mov ah,09h ;display string function
mov dx, msg3 ;get message3
int 21h ;Display message3
mov ah,2 ;display char fcn
mov dl,[CHAR]
int 21h ;display it
exit: mov ah,4Ch ;DOS function: exit program
mov al,[exCode] ;Return exit code value
int 21h ;call DOS. Terminte Program
|
test/succeed/Issue596.agda | larrytheliquid/agda | 1 | 15358 | <reponame>larrytheliquid/agda<gh_stars>1-10
-- Andreas, 2012-04-03, reported by pumpkingod
module Issue596 where
import Common.Irrelevance
open import Common.Level
open import Common.Equality
open import Common.Prelude renaming (Nat to ℕ)
infixl 7 _*_
_*_ : ℕ → ℕ → ℕ
zero * n = zero
suc m * n = n + (m * n)
-- inlined from Data.Product
record Σ {a b} (A : Set a) (B : A → Set b) : Set (a ⊔ b) where
constructor _,_
field
proj₁ : A
proj₂ : B proj₁
open Σ public
syntax Σ A (λ x → B) = Σ[ x ∶ A ] B
∃ : ∀ {a b} {A : Set a} → (A → Set b) → Set (a ⊔ b)
∃ = Σ _
infixr 2 _×_
_×_ : ∀ {a b} (A : Set a) (B : Set b) → Set (a ⊔ b)
A × B = Σ[ x ∶ A ] B
-- inlined from Data.Nat.Divisibility and Data.Nat.Coprimality
infix 4 _∣_
data _∣_ : ℕ → ℕ → Set where
divides : {m n : ℕ} (q : ℕ) (eq : n ≡ q * m) → m ∣ n
Coprime : (m n : ℕ) → Set
Coprime m n = ∀ {i} → i ∣ m × i ∣ n → i ≡ 1
record ℚ⁺ : Set where
constructor rat⁺
field
numerator : ℕ
denominator-1 : ℕ
denominator : ℕ
denominator = suc denominator-1
field
.coprime : Coprime numerator denominator
-- inlined from Data.Nat.LCM
record LCM (i j lcm : ℕ) : Set where
constructor is -- Andreas, 2012-04-02 added constructor
field
-- The lcm is a common multiple.
commonMultiple : i ∣ lcm × j ∣ lcm
-- The lcm divides all common multiples, i.e. the lcm is the least
-- common multiple according to the partial order _∣_.
least : ∀ {m} → i ∣ m × j ∣ m → lcm ∣ m
postulate
lcm : (i j : ℕ) → ∃ λ d → LCM i j d
undefined : ∀ {a}{A : Set a} → A
0#⁺ : ℚ⁺
0#⁺ = rat⁺ 0 0 undefined -- (∣1⇒≡1 ∘ proj₂)
_+⁺_ : ℚ⁺ → ℚ⁺ → ℚ⁺
_+⁺_ = undefined
-- the offending with-clause
+⁺-idˡ : ∀ q → 0#⁺ +⁺ q ≡ q
+⁺-idˡ (rat⁺ n d c) with lcm (suc zero) (suc d)
... | q = undefined
-- should succeed
|
boards/host/startup.ads | ekoeppen/STM32_Generic_Ada_Drivers | 1 | 7657 | package Startup is
pragma Pure;
end Startup;
|
oeis/005/A005773.asm | neoneye/loda-programs | 11 | 14436 | <reponame>neoneye/loda-programs<gh_stars>10-100
; A005773: Number of directed animals of size n (or directed n-ominoes in standard position).
; Submitted by <NAME>
; 1,1,2,5,13,35,96,267,750,2123,6046,17303,49721,143365,414584,1201917,3492117,10165779,29643870,86574831,253188111,741365049,2173243128,6377181825,18730782252,55062586341,161995031226,476941691177,1405155255055,4142457992363,12219350698880,36064309311811,106495542464222,314626865716275,929947027802118,2749838618630271,8134527149366543,24072650378629801,71264483181775040,211043432825804129,625190642719667122,1852627179112970417,5491513337424989754,16282402094173127445,48290501472790543731
sub $0,1
mov $1,2
mov $3,$0
lpb $3
mul $1,$3
cmp $2,0
add $5,$2
div $1,$5
sub $3,1
add $4,$1
lpe
mov $0,$4
div $0,2
add $0,1
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1617.asm | ljhsiun2/medusa | 9 | 6632 | <filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1617.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %rbp
push %rdi
push %rsi
lea addresses_normal_ht+0x12e53, %rbp
nop
nop
nop
nop
dec %rsi
movw $0x6162, (%rbp)
nop
nop
nop
nop
and %rdi, %rdi
pop %rsi
pop %rdi
pop %rbp
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_UC+0x1c1d, %rsi
lea addresses_UC+0x1269d, %rdi
clflush (%rdi)
cmp %rdx, %rdx
mov $69, %rcx
rep movsw
nop
nop
nop
nop
nop
xor %rdi, %rdi
// Faulty Load
lea addresses_normal+0x421d, %r9
nop
nop
nop
nop
nop
sub %r14, %r14
vmovups (%r9), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $1, %xmm5, %rsi
lea oracles, %r14
and $0xff, %rsi
shlq $12, %rsi
mov (%r14,%rsi,1), %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_normal', 'congruent': 0}}
{'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_UC'}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_normal', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_normal_ht', 'congruent': 1}, 'OP': 'STOR'}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/constants.ads | ouankou/rose | 488 | 13504 | package Constants is
Max_Entries : constant Integer := 400; -- constant
Avogadros_Number : constant := 6.022137 * 10**23; -- named number
Bytes_Per_Page : constant := 512;
Pages_Per_Buffer : constant := 10;
Buffer_Size : constant := Pages_Per_Buffer * Bytes_Per_Page;
Buffer_Size10 : constant := 5_120;
New_Character : constant Character :='$';
--~ Author : constant := "<NAME>";
end Constants;
|
Transynther/x86/_processed/NONE/_st_/i7-7700_9_0x48.log_21829_842.asm | ljhsiun2/medusa | 9 | 97930 | <filename>Transynther/x86/_processed/NONE/_st_/i7-7700_9_0x48.log_21829_842.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x13e4e, %r14
nop
nop
nop
dec %rbx
mov (%r14), %esi
nop
nop
nop
nop
cmp $27854, %r14
lea addresses_UC_ht+0x1186, %rsi
lea addresses_D_ht+0x14d86, %rdi
nop
nop
nop
nop
nop
mfence
mov $43, %rcx
rep movsq
nop
nop
xor $12483, %r9
lea addresses_D_ht+0x1b3f6, %rbx
nop
nop
nop
nop
dec %rdi
vmovups (%rbx), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $1, %xmm1, %rsi
and %rsi, %rsi
lea addresses_D_ht+0x1a872, %rbx
nop
nop
xor %rax, %rax
vmovups (%rbx), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %r9
nop
nop
sub $54255, %rbx
lea addresses_normal_ht+0x15186, %rsi
lea addresses_D_ht+0x13c86, %rdi
nop
nop
nop
nop
add %r9, %r9
mov $115, %rcx
rep movsw
add %rcx, %rcx
lea addresses_WT_ht+0x46c6, %rsi
lea addresses_A_ht+0xcc86, %rdi
add %r14, %r14
mov $125, %rcx
rep movsl
nop
nop
nop
inc %rax
lea addresses_A_ht+0x4c16, %rsi
lea addresses_UC_ht+0xc69c, %rdi
nop
nop
inc %r15
mov $64, %rcx
rep movsq
nop
nop
nop
nop
nop
inc %rdi
lea addresses_A_ht+0xdd86, %rdi
clflush (%rdi)
nop
nop
cmp %rax, %rax
mov (%rdi), %cx
nop
sub $56282, %r14
lea addresses_WT_ht+0x718a, %r9
nop
nop
nop
nop
dec %rcx
movb $0x61, (%r9)
nop
nop
nop
sub $18779, %rdi
lea addresses_WC_ht+0x1aba8, %rsi
nop
nop
sub %rcx, %rcx
mov $0x6162636465666768, %rbx
movq %rbx, %xmm3
movups %xmm3, (%rsi)
and %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r8
push %rax
push %rdi
push %rsi
// Store
lea addresses_RW+0x1bd86, %r10
nop
nop
nop
nop
nop
inc %r8
mov $0x5152535455565758, %rsi
movq %rsi, (%r10)
add $56719, %r13
// Store
lea addresses_D+0x1d586, %r11
nop
nop
and %rsi, %rsi
mov $0x5152535455565758, %rax
movq %rax, %xmm2
vmovups %ymm2, (%r11)
nop
nop
nop
nop
nop
sub $53797, %r11
// Store
lea addresses_normal+0x19c86, %r10
nop
nop
xor %r11, %r11
movl $0x51525354, (%r10)
nop
nop
nop
sub $52378, %r13
// Store
lea addresses_A+0x1e91d, %r10
nop
nop
nop
nop
nop
xor %rsi, %rsi
mov $0x5152535455565758, %r8
movq %r8, (%r10)
nop
nop
nop
nop
sub $47509, %rax
// Load
lea addresses_UC+0x13c6, %r13
nop
nop
nop
add %rdi, %rdi
movb (%r13), %r10b
nop
nop
nop
cmp %rsi, %rsi
// Store
lea addresses_RW+0x1bb26, %r13
nop
nop
xor $38238, %r10
movl $0x51525354, (%r13)
sub %r13, %r13
// Store
lea addresses_US+0x1cb86, %r10
sub %rax, %rax
mov $0x5152535455565758, %rdi
movq %rdi, %xmm2
vmovups %ymm2, (%r10)
nop
nop
nop
nop
nop
cmp $33542, %rdi
// Faulty Load
lea addresses_WC+0xdd86, %rax
nop
nop
nop
dec %rdi
mov (%rax), %si
lea oracles, %r11
and $0xff, %rsi
shlq $12, %rsi
mov (%r11,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rax
pop %r8
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 10, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 11, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 8, 'size': 4, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': True, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 2, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 9, 'size': 32, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 2, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 4, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 32, 'same': True, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 8, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': True}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': False, 'NT': False}}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
setoid-cats/Category/Preorder.agda | heades/AUGL | 0 | 4294 | <filename>setoid-cats/Category/Preorder.agda
------------------------------------------------------------------------
-- This file contains the definition of a preorder as a category with --
-- additional properties. --
------------------------------------------------------------------------
module Category.Preorder where
open import Level renaming (suc to lsuc)
open import Data.Empty
open import Setoid.Total
open import Category.Category
open import Equality.Eq
record PO {l : Level} : Set (lsuc l) where
field
-- The underlying category.
ℙ : Cat {l}
-- The preorder axiom.
POax : ∀{A B}{f g : el (Hom ℙ A B)} → ⟨ Hom ℙ A B ⟩[ f ≡ g ]
open PO public renaming (ℙ to po-cat)
-- A PO with 4 objects.
module 4PO where
-- The objects.
data 4Obj {l : Level} : Set l where
i₁ : 4Obj
i₂ : 4Obj
i₃ : 4Obj
i₄ : 4Obj
-- The PreHom.
data 4PHom {l : Level} : 4Obj {l} → 4Obj {l} → Set l where
id₁ : 4PHom i₁ i₁
f₁ : 4PHom i₁ i₂
f₂ : 4PHom i₁ i₃
id₂ : 4PHom i₂ i₂
f₃ : 4PHom i₂ i₄
id₃ : 4PHom i₃ i₃
f₄ : 4PHom i₃ i₄
f₅ : 4PHom i₁ i₄
id₄ : 4PHom i₄ i₄
-- The Hom.
4Hom : {l : Level} → 4Obj {l} → 4Obj {l} → Setoid {l}
4Hom i₁ i₁ = record { el = 4PHom i₁ i₁; eq = λ a b → a ≅ b; eqRpf = isEqRel }
4Hom i₁ i₂ = record { el = 4PHom i₁ i₂; eq = λ a b → a ≅ b; eqRpf = isEqRel }
4Hom i₁ i₃ = record { el = 4PHom i₁ i₃; eq = λ a b → a ≅ b; eqRpf = isEqRel }
4Hom i₁ i₄ = record { el = 4PHom i₁ i₄; eq = λ a b → a ≅ b; eqRpf = isEqRel }
4Hom i₂ i₂ = record { el = 4PHom i₂ i₂; eq = λ a b → a ≅ b; eqRpf = isEqRel }
4Hom i₂ i₄ = record { el = 4PHom i₂ i₄; eq = λ a b → a ≅ b; eqRpf = isEqRel }
4Hom i₃ i₃ = record { el = 4PHom i₃ i₃; eq = λ a b → a ≅ b; eqRpf = isEqRel }
4Hom i₃ i₄ = record { el = 4PHom i₃ i₄; eq = λ a b → a ≅ b; eqRpf = isEqRel }
4Hom i₄ i₄ = record { el = 4PHom i₄ i₄; eq = λ a b → a ≅ b; eqRpf = isEqRel }
4Hom _ _ = EmptySetoid
4Comp : {l : Level}{a b c : 4Obj {l}} → BinSetoidFun (4Hom a b) (4Hom b c) (4Hom a c)
4Comp {_} {i₁} {i₂} {i₁} = record { appT = λ x → record { appT = λ x₁ → id₁; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₂} {i₁} {i₁} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₂} {i₁} {i₂} = record { appT = λ x → record { appT = λ x₁ → id₂; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₂} {i₁} {i₃} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₂} {i₁} {i₄} = record { appT = λ x → record { appT = λ x₁ → f₃; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₃} {i₁} {i₁} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₃} {i₂} {i₁} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₃} {i₁} {i₂} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₃} {i₁} {i₃} = record { appT = λ x → record { appT = λ x₁ → id₃; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₃} {i₁} {i₄} = record { appT = λ x → record { appT = λ x₁ → f₄; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₄} {i₁} {i₁} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₄} {i₂} {i₁} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₄} {i₁} {i₂} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₄} {i₁} {i₃} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₄} {i₃} {i₃} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₄} {i₁} {i₄} = record { appT = λ x → record { appT = λ x₁ → ⊥-poly-elim x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₄} {i₄} {i₃} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₄} {i₄} {i₂} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₄} {i₄} {i₁} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₄} {i₃} {i₄} = record { appT = λ x → record { appT = λ x₁ → id₄; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₄} {i₃} {i₂} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₄} {i₃} {i₁} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₄} {i₂} {i₄} = record { appT = λ x → record { appT = λ x₁ → id₄; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₄} {i₂} {i₃} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₄} {i₂} {i₂} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₃} {i₄} {i₃} = record { appT = λ x → record { appT = λ x₁ → id₃; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₃} {i₄} {i₂} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₃} {i₄} {i₁} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₃} {i₃} {i₄} = record { appT = λ x → record { appT = λ x₁ → f₄; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₃} {i₃} {i₂} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₃} {i₃} {i₁} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₃} {i₂} {i₄} = record { appT = λ x → record { appT = λ x₁ → f₄; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₃} {i₂} {i₃} = record { appT = λ x → record { appT = λ x₁ → id₃; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₃} {i₂} {i₂} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₃} {i₄} {i₄} = record { appT = λ x → record { appT = λ x₁ → f₄; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₂} {i₄} {i₃} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₂} {i₄} {i₂} = record { appT = λ x → record { appT = λ x₁ → id₂; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₂} {i₄} {i₁} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₂} {i₃} {i₄} = record { appT = λ x → record { appT = λ x₁ → f₃; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₂} {i₃} {i₂} = record { appT = λ x → record { appT = λ x₁ → id₂; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₂} {i₃} {i₁} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₂} {i₂} {i₄} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₂} {i₂} {i₃} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₂} {i₂} {i₂} = record { appT = λ x → record { appT = λ x₁ → id₂; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₂} {i₃} {i₃} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₂} {i₄} {i₄} = record { appT = λ x → record { appT = λ x₁ → x; extT = λ x₂ → refl }; extT = λ x₁ x₂ → x₁ }
4Comp {_} {i₁} {i₄} {i₃} = record { appT = λ x → record { appT = λ x₁ → f₂; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₁} {i₄} {i₂} = record { appT = λ x → record { appT = λ x₁ → f₁; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₁} {i₄} {i₁} = record { appT = λ x → record { appT = λ x₁ → id₁; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₁} {i₃} {i₄} = record { appT = λ x → record { appT = λ x₁ → f₅; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₁} {i₃} {i₂} = record { appT = λ x → record { appT = λ x₁ → f₁; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₁} {i₃} {i₁} = record { appT = λ x → record { appT = λ x₁ → id₁; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₁} {i₂} {i₄} = record { appT = λ x → record { appT = λ x₁ → f₅; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₁} {i₂} {i₃} = record { appT = λ x → record { appT = λ x₁ → f₂; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₁} {i₂} {i₂} = record { appT = λ x → record { appT = λ x₁ → f₁; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₁} {i₃} {i₃} = record { appT = λ x → record { appT = λ x₁ → f₂; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {_} {i₁} {i₄} {i₄} = record { appT = λ x → record { appT = λ x₁ → f₅; extT = λ x₂ → refl }; extT = λ x₁ x₂ → refl }
4Comp {l} {i₁} {i₁} {c} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refPf (eqRpf (4Hom i₁ c)) {x₂} }
4Comp {l} {i₂} {i₂} {c} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refPf (eqRpf (4Hom i₂ c)) {x₂} }
4Comp {l} {i₃} {i₃} {c} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refPf (eqRpf (4Hom i₃ c)) {x₂} }
4Comp {l} {i₄} {i₄} {c} = record { appT = λ x → record { appT = λ x₁ → x₁; extT = λ x₂ → x₂ }; extT = λ x₁ x₂ → refPf (eqRpf (4Hom i₄ c)) {x₂} }
4Id : {l : Level}{A : 4Obj {l}} → el (4Hom A A)
4Id {_}{i₁} = id₁
4Id {_}{i₂} = id₂
4Id {_}{i₃} = id₃
4Id {_}{i₄} = id₄
4PO-ax : ∀{l}{A B : 4Obj {l}}{f g : el (4Hom A B)} → eq (4Hom A B) f g
4PO-ax {A = i₁} {i₁} {id₁} {id₁} = refl
4PO-ax {A = i₁} {i₂} {f₁} {f₁} = refl
4PO-ax {A = i₁} {i₃} {f₂} {f₂} = refl
4PO-ax {A = i₁} {i₄} {f₅} {f₅} = refl
4PO-ax {A = i₂} {i₂} {id₂} {id₂} = refl
4PO-ax {A = i₂} {i₄} {f₃} {f₃} = refl
4PO-ax {A = i₃} {i₃} {id₃} {id₃} = refl
4PO-ax {A = i₃} {i₄} {f₄} {f₄} = refl
4PO-ax {A = i₄} {i₄} {id₄} {id₄} = refl
4PO-ax {A = i₂} {i₁} {f} = ⊥-poly-elim f
4PO-ax {A = i₃} {i₁} {f} = ⊥-poly-elim f
4PO-ax {A = i₄} {i₁} {f} = ⊥-poly-elim f
4PO-ax {A = i₃} {i₂} {f} = ⊥-poly-elim f
4PO-ax {A = i₄} {i₂} {f} = ⊥-poly-elim f
4PO-ax {A = i₂} {i₃} {f} = ⊥-poly-elim f
4PO-ax {A = i₄} {i₃} {f} = ⊥-poly-elim f
4AssocPf : ∀{l}{A B C D : 4Obj {l}} {f : el (4Hom A B)} {g : el (4Hom B C)}{h : el (4Hom C D)}
→ ⟨ 4Hom A D ⟩[ f ○[ 4Comp {l} {A}{B}{D} ] (g ○[ 4Comp {l}{B}{C}{D} ] h) ≡ (f ○[ 4Comp {l} {A}{B}{C} ] g) ○[ 4Comp {l}{A}{C}{D} ] h ]
4AssocPf {l}{A}{B}{C}{D} {f}{g} = 4PO-ax {l} {A} {D}
4IdPF : {l : Level}{A B : 4Obj {l}} {f : el (4Hom A B)}
→ ⟨ 4Hom A B ⟩[ (4Id {l}{A}) ○[ 4Comp {l}{A}{A}{B} ] f ≡ f ○[ 4Comp {l}{A}{B}{B} ] (4Id {l}{B}) ]
4IdPF {l}{A}{B}{f} = 4PO-ax {l} {A} {B}
-- We have a category.
4cat : {l : Level} → Cat {l}
4cat {l} = record { Obj = 4Obj {l};
Hom = 4Hom;
comp = λ {A} {B} {C} → 4Comp {l} {A}{B}{C};
id = λ {A} → 4Id {l}{A};
assocPf = λ {A} {B} {C} {D} {f} {g} {h} → 4AssocPf {l}{A}{B}{C}{D}{f}{g}{h};
idPfCom = λ {A} {B} {f} → 4IdPF {l}{A}{B}{f};
idPf = λ {A} {B} {f} → 4PO-ax {l} {A} {B}}
-- We have a preorder.
4po : {l : Level} → PO {l}
4po {l} = record { ℙ = 4cat;
POax = λ {A} {B} {f} {g} → 4PO-ax {l} {A} {B} {f} {g} }
|
text/item_names.asm | longlostsoul/EvoYellow | 16 | 28933 | ItemNames:
db "Master Ball@"
db "Ultra Ball@"
db "Great Ball@"
db "Poké Ball@"
db "TOWN MAP@"
db "SADDLE@"
db "?????@"
db "SAFARI BALL@"
db "PokéDEX@"
db "Moon Stone@"
db "<NAME>@"
db "BRN Berry@"
db "ICEberry@"
db "Chesto Berry@"
db "Cheri Berry@"
db "Full Restore@"
db "Leftovers @"
db "Hyper Potion@"
db "Moomoo Milk@"
db "Salve@"
db "BOULDERBADGE@"
db "CASCADEBADGE@"
db "THUNDERBADGE@"
db "RAINBOWBADGE@"
db "SOULBADGE@"
db "MARSHBADGE@"
db "VOLCANOBADGE@"
db "EARTHBADGE@"
db "Escape Rope@"
db "Repel@"
db "OLD AMBER@"
db "Fire Stone@"
db "Thunderstone@"
db "Water Stone@"
db "HP UP@"
db "PROTEIN@"
db "IRON@"
db "CARBOS@"
db "CALCIUM@"
db "Rare Candy@"
db "D<NAME>@"
db "Helix Fossil@"
db "Secret Key@"
db "SnagB@"
db "VOUCHER@"
db "X ACCURACY@"
db "Leaf Stone@"
db "CARD KEY@"
db "Nugget@"
db "NO UP@"
db "Poké Doll@"
db "Lum Berry@";full heal
db "Revive@"
db "MAX Revive@"
db "GUARD Spec.@"
db "SUPER Repel@"
db "MAX Repel@"
db "DIRE Hit@"
db "COIN@"
db "Fresh Water@"
db "Soda Pop@"
db "Lemonade@"
db "S.S.TICKET@"
db "GOLD TEETH@"
db "X ATTACK@"
db "X DEFEND@"
db "X SPEED@"
db "X SPECIAL@"
db "COIN CASE@"
db "OAK's PARCEL@"
db "ITEMFINDER@"
db "SILPH SCOPE@"
db "Poké Flute@"
db "LIFT KEY@"
db "EXP.ALL@"
db "OLD ROD@"
db "GOOD ROD@"
db "SUPER ROD@"
db "PP UP@"
db "ETHER@"
db "MAX ETHER@"
db "ELIXER@"
db "MAX ELIXER@"
db "B2F@"
db "B1F@"
db "1F@"
db "2F@"
db "3F@"
db "4F@"
db "5F@"
db "6F@"
db "7F@"
db "8F@"
db "9F@"
db "10F@"
db "11F@"
db "B4F@"
db "Sun Stone@"
db "Frost Stone@"
db "Love Stone@"
db "Shiny Stone@";most of this and below not currently in use
db "King's Rock@"
db "Steel Coat@"
db "Quick Claw@"
db "Evolite@"
; db "Lucky Egg@";
db "Sitrus Berry@";except berries~
db "Oran Berry@" |
Irvine/Examples/ch12/MixedMode.asm | alieonsido/ASM_TESTING | 0 | 1266 | ; Mixed-Mode FPU Arithmetic (MixedMode.asm)
; This program demonstrates mixed-mode arithmetic using
; reals and integers. Also, it demonstrates the multiplication
; and division of reals, as well as the SQRT instruction.
INCLUDE Irvine32.inc
.code
main PROC
; ------------- Mixed-mode arithmetic ---------------
; Implement the following expression: Z = (int) (N + X)
.data
N SDWORD 20
X REAL8 3.5
Z SDWORD ?
ctrlWord WORD ?
.code
finit ; initialize FPU
; Demonstrates rounding upward.
fild N ; load integer into ST(0)
fadd X ; add mem to ST(0)
fist Z ; store ST(0) to mem int
mov eax,Z ; sum: 24
; Demonstrates truncation.
fstcw ctrlWord ; store control word
or ctrlWord, 110000000000b ; set the RC field to truncate
fldcw ctrlWord ; load control word
fild N ; load integer into ST(0)
fadd X ; add mem to ST(0)
fist Z ; store ST(0) to mem int
fstcw ctrlWord ; store control word
and ctrlWord, 001111111111b ; reset rounding to default
fldcw ctrlWord ; load control word
mov eax,Z ; sum: 23
; ------------ Divide two reals ------------------
.data
dblOne REAL8 1234.56
dblTwo REAL8 10.0
dblQuot REAL8 ?
.code
fld dblOne ; load into ST(0)
fdiv dblTwo ; divide ST(0) by mem
fstp dblQuot ; store ST(0) to mem
; ------------- Expression (mult, divide)
; valD = -valA + (valB * valC)
.data
valA REAL8 1.5
valB REAL8 2.5
valC REAL8 3.0
valD REAL8 ? ; +6.0
.code
fld valA ; load valA into ST(0)
fchs ; change its sign
fld valB ; load valB into ST(0)
fmul valC ; multiply by valC
fadd ; add ST(1) to ST(0)
fstp valD ; store ST(0) to valD
; ---------- Calculate the sum of three reals ----------
.data
sngArray REAL4 1.5, 3.4, 6.6
sum REAL4 ?
.code
fld sngArray ; load mem into ST(0)
fadd [sngArray+4] ; add mem to ST(0)
fadd [sngArray+8] ; add mem to ST(0)
fstp sum ; store ST(0) to mem
; ---------- Calculate a Square Root ----------------
.data
sngVal1 REAL4 25.0
sngResult REAL4 ?
.code
fld sngVal1 ; load into ST(0)
fsqrt ; ST(0) = square root
fstp sngResult ; store ST(0) to mem
exit
main ENDP
END main |
.config/alfred/Alfred.alfredpreferences/workflows/user.workflow.D27B6AD4-C1F8-4105-8C0B-0E52489E70FE/reminder_apps.applescript | kuanger/dotfiles | 1 | 76 | <reponame>kuanger/dotfiles<filename>.config/alfred/Alfred.alfredpreferences/workflows/user.workflow.D27B6AD4-C1F8-4105-8C0B-0E52489E70FE/reminder_apps.applescript
on reminderFromApplication(theApplication)
set workflowFolder to do shell script "pwd"
set theText to ""
set theBody to ""
if theApplication is "Google Chrome.app" then
set applib to load script POSIX file (workflowFolder & "/app_GoogleChrome.scpt")
else if theApplication is "Chromium.app" then
set applib to load script POSIX file (workflowFolder & "/app_Chromium.scpt")
else if theApplication is "Google Chrome Canary.app" then
set applib to load script POSIX file (workflowFolder & "/app_GoogleChromeCanary.scpt")
else if theApplication is "Safari.app" then
set applib to load script POSIX file (workflowFolder & "/app_Safari.scpt")
else if theApplication is "Webkit.app" then
set applib to load script POSIX file (workflowFolder & "/app_Webkit.scpt")
else if theApplication is "Mail.app" then
set applib to load script POSIX file (workflowFolder & "/app_Mail.scpt")
else if theApplication is "Address Book.app" or theApplication is "Contacts.app" then
set applib to load script POSIX file (workflowFolder & "/app_Contacts.scpt")
else if theApplication is "Finder.app" then
set applib to load script POSIX file (workflowFolder & "/app_Finder.scpt")
else if theApplication is "TextEdit.app" then
set applib to load script POSIX file (workflowFolder & "/app_TextEdit.scpt")
else if theApplication is "TextMate.app" then
set applib to load script POSIX file (workflowFolder & "/app_TextMate.scpt")
else if theApplication is "Vienna.app" then
set applib to load script POSIX file (workflowFolder & "/app_Vienna.scpt")
else if theApplication is "Omnifocus.app" then
set applib to load script POSIX file (workflowFolder & "/app_OmniFocus.scpt")
else if theApplication is "FoldingText.app" then
set applib to load script POSIX file (workflowFolder & "/app_FoldingText.scpt")
else if theApplication is "Microsoft OneNote.app" then
set applib to load script POSIX file (workflowFolder & "/app_OneNote.scpt")
else if theApplication is "Microsoft Word.app" then
set applib to load script POSIX file (workflowFolder & "/app_MSWord.scpt")
else if theApplication is "Microsoft PowerPoint.app" then
set applib to load script POSIX file (workflowFolder & "/app_PowerPoint.scpt")
else if theApplication is "Adobe Acrobat.app" then
set applib to load script POSIX file (workflowFolder & "/app_AcrobatPro.scpt")
end if
set theText to applib's getTitle()
set theBody to applib's getBody()
return {theText:theText, theBody:theBody}
end reminderFromApplication
|
oeis/256/A256506.asm | neoneye/loda-programs | 11 | 97855 | <filename>oeis/256/A256506.asm<gh_stars>10-100
; A256506: a(n) = (2*n+3)*a(n-1) + a(n-2), a(0)=0, a(1)=1.
; Submitted by <NAME>
; 0,1,7,64,711,9307,140316,2394679,45639217,960818236,22144458645,554572284361,14995596136392,435426860239729,13513228263567991,446371959557983432,15636531812792988111,578998049032898543539,22596560444095836186132,927037976256962182174951,39885229539493469669709025,1795762367253463097319081076,84440716490452259043666519597,4139390870399414156236978541329,211193375106860574227129572127376,11197388271534009848194104301292257,616067548309477402224902866143201511
mul $0,2
mov $1,1
lpb $0
sub $0,2
add $1,$2
mov $3,$2
mov $2,$1
mov $1,$0
add $1,4
mul $1,$2
add $1,$3
lpe
mov $0,$2
|
base/mvdm/dpmi/dxintr.asm | npocmaka/Windows-Server-2003 | 17 | 246355 | PAGE ,132
TITLE DXINTR.ASM -- Dos Extender Interrupt Reflector
; Copyright (c) Microsoft Corporation 1988-1991. All Rights Reserved.
;****************************************************************
;* *
;* DXINTR.ASM - Dos Extender Interrupt Reflector *
;* *
;****************************************************************
;* *
;* Revision History: *
;* *
;* *
;* 09/13/90 earleh Fault handlers Ring 0 *
;* 09/06/90 earleh Fault handlers DPMI compliant *
;* PIC remapping no longer required *
;* 08/08/90 earleh DOSX and client privilege ring determined *
;* by equate in pmdefs.inc *
;* 05/09/90 jimmat Started VCPI changes. *
;* 04/02/90 jimmat Added PM Int 70h handler. *
;* 01/08/90 jimmat Don't allow nested PS/2 mouse interrupts *
;* (later removed!) *
;* 09/15/89 jimmat Support for 'Classic' HP Vectras which *
;* have 3 8259 interrupt controllers *
;* 07/28/89 jimmat Save A20 state when reflecting an int to *
;* protected mode, removed Int 30h handler *
;* that did code patch-ups, point debugger *
;* to faulting instruction, not Int 3. *
;* 07/13/89 jimmat Improved termination due to faults when *
;* not running under a debugger--also ifdef'd *
;* out code to dynamically fixup code seg *
;* references on GP faults *
;* 06/05/89 jimmat Ints 0h-1Fh are now vectored through a 2nd *
;* table. This allows Wdeb386 interaction *
;* more like Windows/386. *
;* 05/23/89 jimmat Added wParam & lParam to interrupt frame. *
;* 05/07/89 jimmat Added XMScontrol function to map protected *
;* mode XMS requests to real mode driver. *
;* 05/02/89 jimmat 8259 interrupt mask saved around changing *
;* of hardware interrupt base *
;* 04/24/89 jimmat Added support for PS/2 Int 15h/C2h/07 Set *
;* Pointing Device Handler Address function *
;* 04/12/89 jimmat Added PMIntr24 routine to support PM *
;* Critical Error Handlers *
;* 03/15/89 jimmat Added INT 31h LDT/heap interface a la *
;* Windows/386 *
;* 03/14/89 jimmat Changes to run child in ring 1 with LDT *
;* 02/24/89 (GeneA): fixed problem in IntEntryVideo and *
;* IntExitVideo for processing function 10h subfunction *
;* for reading and writing the VGA palette. *
;* 02/22/89 (GeneA): added handlers for Int 10h, Int 15h, and *
;* Int 33h. Added support for more general mechanism for *
;* handling interrupts require special servicing and *
;* allowing nesting of these interrupts. Allocation and *
;* deallocation of stack frames is supported to allow *
;* nested paths through the interrupt reflection code to *
;* a depth of 8. *
;* There is still a problem that if an interrupt handler *
;* is using a static buffer to transfer data, another *
;* interrupt that uses the same static buffer could come *
;* in and trash it. Solving the problem in a completely *
;* general way would require having a buffer allocation *
;* deallocation scheme for doing the transfers between *
;* real mode memory and protected mode memory. *
;* 02/14/89 (GeneA): added code in TrapGP to print error msg *
;* and quit when running a non-debugging version. *
;* 02/10/89 (GeneA): changed Dos Extender from small model to *
;* medium model. Added function LoaderTrap to handle *
;* loader interrupts when the program contains overlays. *
;* 11/20/88 (GeneA): changed both RM and PM interrupt reflector*
;* routines to pass the flags returned by the ISR back to *
;* the originator of the interrupt, rather than returning *
;* the original flags. *
;* 10/28/88 (GeneA): created *
; 18-Dec-1992 sudeepb Changed cli/sti to faster FCLI/FSTI
;* *
;****************************************************************
.286p
.287
; -------------------------------------------------------
; INCLUDE FILE DEFINITIONS
; -------------------------------------------------------
.xlist
.sall
include segdefs.inc
include gendefs.inc
include pmdefs.inc
include interupt.inc
ifdef WOW_x86
include vdmtib.inc
endif
.list
include intmac.inc
include stackchk.inc
include bop.inc
include dpmi.inc
; -------------------------------------------------------
; GENERAL SYMBOL DEFINITIONS
; -------------------------------------------------------
; -------------------------------------------------------
; EXTERNAL SYMBOL DEFINITIONS
; -------------------------------------------------------
extrn EnterRealMode:NEAR
extrn EnterProtectedMode:NEAR
extrn ParaToLinear:NEAR
externFP NSetSegmentDscr
ifdef NEC_98
extrn GetSegmentAddress:NEAR
endif ;NEC_98
extrn ParaToLDTSelector:NEAR
; -------------------------------------------------------
; DATA SEGMENT DEFINITIONS
; -------------------------------------------------------
DXDATA segment
extrn pmusrss:WORD
extrn pmusrsp:WORD
extrn npXfrBuf1:WORD
extrn rgbXfrBuf0:BYTE
extrn rgbXfrBuf1:BYTE
extrn lpfnXMSFunc:DWORD
extrn Int28Filter:WORD
extrn DpmiFlags:WORD
IFDEF WOW_x86
extrn FastBop:fword
ENDIF
;
; Variables used to store register values while mode switching.
public regUserSS, regUserSP, regUserFL, regUserAX, regUserDS
public regUserES
regUserSS dw ?
regUserSP dw ?
regUserCS dw ?
regUserIP dw ?
regUserFL dw ?
regUserAX dw ?
regUserDS dw ?
regUserES dw ?
pfnReturnAddr dw ?
Int28Count dw -1 ;Count of idle Int 28h's not reflected to RM
;
; Far pointer to the user's mouse callback function.
public lpfnUserMouseHandler
lpfnUserMouseHandler dd 0 ;Entry point to the users mouse handler
cbMouseState dw 0 ;size of mouse state buffer in bytes
; Far pointer to PS/2 Pointing device handler address
public lpfnUserPointingHandler
lpfnUserPointingHandler dd 0 ;Sel:Off to user's handler
align 2
if DEBUG
extrn StackGuard:WORD
endif
extrn pbReflStack:WORD
extrn bReflStack:WORD
;
; This buffer contains the original real mode interrupt vectors.
ifdef NEC_98
public rglpfnRmISR
endif ;NEC_98
align 2
rglpfnRmISR dd 256 dup (?)
; PMFaultVector is a table of selector:offsets for routines to process
; protected mode processor faults/traps/exceptions. If we don't handle
; the exception as an exception, we vector it through PMReservedEntryVector.
FltRtn macro off
dw DXPMCODE:off
dw 0
dw SEL_DXPMCODE or STD_RING
dw 0
endm
public PMFaultVector
align 4
PMFaultVector label DWORD
FltRtn PMFaultEntryVector+5*0h ; int 0
FltRtn PMFaultEntryVector+5*1h ; int 1
FltRtn PMFaultEntryVector+5*2h ; int 2
FltRtn PMFaultEntryVector+5*3h ; int 3
FltRtn PMFaultEntryVector+5*4h ; int 4
FltRtn PMFaultEntryVector+5*5h ; int 5
FltRtn PMFaultEntryVector+5*6h ; int 6
FltRtn PMFaultEntryVector+5*7h ; int 7
FltRtn PMFaultEntryVector+5*8h ; int 8
FltRtn PMFaultEntryVector+5*9h ; int 9
FltRtn PMFaultEntryVector+5*0Ah ; int a
FltRtn PMFaultEntryVector+5*0Bh ; int b
FltRtn PMFaultEntryVector+5*0Ch ; int c
FltRtn PMFaultEntryVector+5*0Dh ; int d
FltRtn PMFaultEntryVector+5*0Eh ; int e
FltRtn PMFaultEntryVector+5*0Fh ; int f
FltRtn PMFaultEntryVector+5*10h ; int 10h
FltRtn PMFaultEntryVector+5*11h ; int 11h
FltRtn PMFaultEntryVector+5*12h ; int 12h
FltRtn PMFaultEntryVector+5*13h ; int 13h
FltRtn PMFaultEntryVector+5*14h ; int 14h
FltRtn PMFaultEntryVector+5*15h ; int 15h
FltRtn PMFaultEntryVector+5*16h ; int 16h
FltRtn PMFaultEntryVector+5*17h ; int 17h
FltRtn PMFaultEntryVector+5*18h ; int 18h
FltRtn PMFaultEntryVector+5*19h ; int 19h
FltRtn PMFaultEntryVector+5*1Ah ; int 1ah
FltRtn PMFaultEntryVector+5*1Bh ; int 1bh
FltRtn PMFaultEntryVector+5*1Ch ; int 1ch
FltRtn PMFaultEntryVector+5*1Dh ; int 1Dh
FltRtn PMFaultEntryVector+5*1Eh ; int 1Eh
FltRtn PMFaultEntryVector+5*1Fh ; int 1Fh
extrn npEHStackLimit:word
extrn npEHStacklet:word
ifdef NEC_98
extrn fPCH98:BYTE
endif ;NEC_98
IFDEF WOW
public Wow16BitHandlers
Wow16BitHandlers dw 256 dup (0,0)
ENDIF
DXDATA ends
DXSTACK segment
public rgw0Stack, rgw2FStack
dw 64 dup (?) ; INT 2Fh handler stack
rgw2FStack label word
dw 64 dup (?) ; DOSX Ring -> Ring 0 transition stack
;
; Interrupts in the range 0-1fh cause a ring transition and leave
; an outer ring IRET frame right here.
;
Ring0_EH_DS dw ? ; place to put user DS
Ring0_EH_AX dw ? ; place to put user AX
Ring0_EH_BX dw ? ; place to put user BX
Ring0_EH_CX dw ? ; place to put user CX
Ring0_EH_BP dw ? ; place to put user BP
Ring0_EH_PEC dw ? ; lsw of error code for 386 page fault
; also near return to PMFaultEntryVector
Ring0_EH_EC dw ? ; error code passed to EH
Ring0_EH_IP dw ? ; interrupted code IP
Ring0_EH_EIP dw ? ; high half eip
Ring0_EH_CS dw ? ; interrupted code CS
dw ? ; high half of cs
Ring0_EH_Flags dw ? ; interrupted code flags
Ring0_EH_EFlags dw ? ; high half of flags
Ring0_EH_SP dw ? ; interrupted code SP
Rin0_EH_ESP dw ? ; high half of esp
Ring0_EH_SS dw ? ; interrupted code SS
dw ? ; high half of ss
rgw0Stack label word
dw 64 dup (?) ; stack for switching to ring0
public ResetStack
ResetStack label word
ifdef WOW_x86
dw 64 dup (?) ; wow stack for initial int field
public rgwWowStack
rgwWowStack label word
endif
DXSTACK ends
; -------------------------------------------------------
; CODE SEGMENT VARIABLES
; -------------------------------------------------------
DXCODE segment
extrn selDgroup:WORD
DXCODE ends
DXPMCODE segment
extrn selDgroupPM:WORD
extrn segDXCodePM:WORD
extrn RZCall:NEAR
extrn segDXDataPM:WORD
DXPMCODE ends
; -------------------------------------------------------
page
subttl Protected Mode Interrupt Reflector
; -------------------------------------------------------
; PROTECTED MODE INTERRUPT REFLECTOR
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; PMIntrEntryVector -- This table contains a vector of
; near jump instructions to the protected mode interrupt
; reflector. The protected mode interrupt descriptor
; table is initialized so that all interrupts jump to
; locations in this table, which transfers control to
; the interrupt reflection code for reflecting the
; interrupt to real mode.
StartBopTable macro
?intr = 0
endm
PMIntrBop macro
DPMIBOP ReflectIntrToV86
db ?intr
?intr = ?intr+1
endm
public PMIntrEntryVector
PMIntrEntryVector:
StartBopTable
rept 256
PMIntrBop
endm
FaultBop macro
DPMIBOP DpmiUnhandledException
db ?intr
?intr = ?intr+1
endm
public PMFaultEntryVector
; -------------------------------------------------------
; PMFaultEntryVector -- This table contains a vector of
; near jump instructions to the protected mode fault
; analyzer.
;
PMFaultEntryVector:
StartBopTable
rept 32
FaultBop
endm
assume ds:nothing,es:nothing,ss:nothing
public PMFaultHandlerIRET
PMFaultHandlerIRET:
DPMIBOP FaultHandlerIret
public PMFaultHandlerIRETD
PMFaultHandlerIRETD:
DPMIBOP FaultHandlerIretd
public PMIntHandlerIRET
PMIntHandlerIRET:
DPMIBOP IntHandlerIret
public PMIntHandlerIRETD
PMIntHandlerIRETD:
DPMIBOP IntHandlerIretd
public PMDosxIret
PMDosxIret:
iret
public PMDosxIretd
PMDosxIretd:
db 66h
iret
public HungAppExit
HungAppExit:
mov ax,4CFFh
int 21h
; -------------------------------------------------------
DXPMCODE ends
; -------------------------------------------------------
subttl Real Mode Interrupt Reflector
page
; -------------------------------------------------------
; REAL MODE INTERRUPT REFLECTOR
; -------------------------------------------------------
DXCODE segment
assume cs:DXCODE
; -------------------------------------------------------
; RMIntrEntryVector -- This table contains a vector of
; near jump instructions to the real mode interrupt
; reflector. Real mode interrupts that have been hooked
; by the protected mode application have their vector
; set to entry the real mode reflector through this table.
public RMtoPMReflector
RMtoPMReflector:
DPMIBOP ReflectIntrToPM
public RMCallBackBop
RMCallBackBop proc far
DPMIBOP RMCallBackCall
ret ;finished!
RMCallBackBop endp
DXCODE ends
; -------------------------------------------------------
subttl INT 24h Critical Error Mapper
page
; -------------------------------------------------------
; DOS CRITICAL ERROR MAPPER
; -------------------------------------------------------
DXCODE segment
; -------------------------------------------------------
; RMDefaultInt24Handler -- Default action for a DOS critical
; error is to fail the call.
;
public RMDefaultInt24Handler
RMDefaultInt24Handler proc far
mov al,3
iret
RMDefaultInt24Handler endp
DXCODE ends
; -------------------------------------------------------
subttl INT 28h Idle Handler
page
; -------------------------------------------------------
; INT 28H IDLE HANDLER
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; PMIntr28 -- Protected mode handler for Idle Int 28h calls.
; The purpose of this routine is simply to cut down on the
; number of protected mode to real mode switches by ignoring
; many of the Int 28h idle calls made by the Windows PM
; kernel.
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntr28
PMIntr28 proc near
cld
push ds ;address our DGROUP
mov ds,selDgroupPM
assume ds:DGROUP
cmp Int28Filter,0 ;are we passing any through?
jz @f
inc Int28Count ;should this one be reflected?
jz i28_reflect
@@:
pop ds
iret ; no, just ignore it
i28_reflect: ; yes, reset count and
push ax ; reflecto to real mode
mov ax,Int28Filter
neg ax
mov Int28Count,ax
pop ax
pop ds
assume ds:NOTHING
jmp PMIntrEntryVector + 5*28h
PMIntr28 endp
; -------------------------------------------------------
; PMIntr31 -- Service routine for the Protect Mode INT 31h
; services. These functions duplicate the
; Windows/386 VMM INT 31h services for protected
; mode applications. They were implemented to
; support a protect mode version of Windows/286.
;
; Input: Various registers
; Output: Various registers
; Errors:
; Uses: All registers preserved, other than return values
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntr31
PMIntr31 proc near
push ds
push ax
mov ax,SEL_DXDATA OR STD_RING
mov ds,ax
assume ds:DGROUP
pop ax
FBOP BOP_DPMI,Int31Entry,FastBop
int 3
; This BOP does an implicit IRET
PMIntr31 endp
; -------------------------------------------------------
subttl Ignore Interrupt Handlers
page
; -------------------------------------------------------
; IGNORE INTERRUPT HANDLER
; -------------------------------------------------------
; PMIntrIgnore -- Service routine for protected mode interrupts
; that should be ignored, and not reflected to real mode.
; Currently used for:
;
; Int 30h - used to be Win/386 Virtualize I/O, now
; unused but no int handler in real mode
; Int 41h - Wdeb386 interface, no int handler in
; real mode
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrIgnore
PMIntrIgnore proc near
iret
PMIntrIgnore endp
; -------------------------------------------------------
public PMIntr19
PMIntr19 proc near
push offset DXPMCODE:Reboot
call RZCall
bpRebootIDT df 0
Reboot:
mov ax,40h
mov es,ax
mov word ptr es:[0072h],1234h
lidt bpRebootIDT
int 3
PMIntr19 endp
DXPMCODE ends
; -------------------------------------------------------
subttl XMS Driver Interface
page
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; XMScontrol - This function implements a protected mode
; interface to a real mode XMS driver. Unlike other
; routines in this module, this routine is called by
; the user, not invoked via an INT instruction.
;
; Input: User's regs for XMS driver
; Output: regs from XMS driver
; Uses: none
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public XMScontrol
XMScontrol proc far
jmp short XMSentry ;'standard' XMS control function
nop ; just to be consistant
nop
nop
XMSentry:
; Modify the stack so it looks like we got here via an INT (except that
; we may still have interrupts enabled)
pushf
cld
push bp
mov bp,sp ;bp -> [BP] [FL] [IP] [CS]
push ax
push bx
mov ax,[bp+4]
mov bx,[bp+6]
xchg ax,[bp+2]
mov [bp+4],bx
mov [bp+6],ax ;bp -> [BP] [IP] [CS] [FL]
pop bx
pop ax
pop bp
; We don't support XMS function 0Bh (Move Extended Memory Block) because
; it requires mapping of data between hi/low memory. Maybe someday...
cmp ah,0Bh
jnz xms_2
xms_deny:
xor ax,ax ;if function 0Bh, return failure
mov bl,80h ; (ax = 0, bl = 80h-not implemented)
jmp short XMSret
xms_2:
; We are not really an Int handler, but close enough...
call EnterIntHandler ;build an interrupt stack frame
assume ds:DGROUP,es:DGROUP ; also sets up addressability
SwitchToRealMode
pop es ;load regs for driver
pop ds
assume ds:NOTHING,es:NOTHING,ss:DGROUP
popa
npopf
call lpfnXMSFunc ;call real mode driver
pushf ;rebuild stack frame
FCLI
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
call LeaveIntHandler
assume ds:NOTHING,es:NOTHING,ss:NOTHING
XMSret:
riret
XMScontrol endp
; -------------------------------------------------------
DXPMCODE ends
; -------------------------------------------------------
subttl Special Interrupt Handler Routines
page
; -------------------------------------------------------
;
; The following sets of routines handle interrupts that
; are function call interfaces and require special servicing
; by the Dos Extender. These interrupts are such things as
; the mouse driver function call interrupt, various PC BIOS
; function call interrupts, etc. Note that INT 21h (the Dos
; function call interrupt) is not handled here. These
; interrupts typically require that register values be modified
; and parameter data be copied between real mode memory and
; extended memory. The following conventions are used for these
; interrupt function handler routines.
;
; A stack is allocated from the interrupt reflector stack for these
; routines to use. This allows nested servicing of interrupts.
; A stack frame is built in the allocated stack which contains the
; following information:
; original caller's stack address
; caller's original flags and general registers (in pusha form)
; caller's original segment registers (DS & ES)
; flags and general registers to be passed to interrupt routine
; (initially the same as caller's original values)
; segment registers (DS & ES) to be passed to interrupt routine
; (initially set to the Dos Extender data segment address)
; This stack frame is built by the routine EnterIntHandler, and its
; format is defined by the structure INTRSTACK. The stack frame is
; destroyed and the processor registers set up for return to the user
; by the function LeaveIntHandler.
;
; For each interrupt, there is an entry function and an exit function.
; The entry function performs any modifications to parameter values and
; data buffering necessary before the interrupt service routine is called.
; The exit function performs any data buffering and register value
; modifications after return from the interrupt service routine.
;
; There are two sets of general registers and two sets of segment
; registers (DS & ES) on the stack frame. One set of register values
; has member names of the form intUserXX. The values in these stack
; frame members will be passed to the interrupt service routine when
; it is called, and will be loaded with the register values returned
; by the interrupt service routine. The other set of registers values
; has member names of the form pmUserXX. These stack frame members
; contain the original values in the registers on entry from the
; user program that called the interrupt.
;
; When we return to the original caller, we want to pass back the
; general registers as returned by the interrupt routine (and possibly
; modified by the exit handler), and the same segment registers as
; on entry, unless the interrupt routine returns a value in a segment
; register. (in this case, there must be some code in the exit routine
; to handle this). This means that when we return to the caller, we
; return the general register values from the intUserXX set of stack
; frame members, but we return the segment registers from the pmUserXX
; set of frame members. By doing it this way, we don't have to do
; any work for the case where the interrupt subfuntion doesn't require
; any parameter manipulation. NOTE however, this means that when
; manipulating register values to be returned to the user, the segment
; registers are treated opposite to the way the general registers are
; treated. For general registers, to return a value to the user,
; store it in a intUserXX stack frame member. To return a segment
; value to the user, store it in a pmUserXX stack frame member.
;
; -------------------------------------------------------
subttl BIOS Video Interrupt (Int 10h) Service Routine
page
; -------------------------------------------------------
; BIOS VIDEO INTERRUPT (INT 10h) SERVICE ROUTINE
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; PMIntrVideo - Entry point into interrupt reflector code
; for IBM PC Bios video (int 10h) calls.
;
; Input: normal registers for Bios calls
; Output: normal register returns for Bios calls
; Errors: normal Bios errors
; Uses: as per Bios calls
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrVideo
PMIntrVideo:
ifdef NEC_98
cmp ah,40h
jb CRT_bios
cmp ah,4Fh ;4Bh-4Fh = Reserve
ja CRT_bios
jmp PMIntrGBIO
CRT_bios:
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryVideo
@@:
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*18h] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
;; test fPCH98,0FFh
;; jz NotNPCVideoExit ;for PC-H98 modelxx
;; call IntExitVideoNPC ; "
;; jmp @f ; "
;;NotNPCVideoExit: ; "
call IntExitVideo
@@:
;
; And return to the original caller.
call LeaveIntHandler
iret
;/////////////////////////////////////////////////////////////////////////
; Nmode GRAPH BIOS
;/////////////////////////////////////////////////////////////////////////
; -------------------------------------------------------
; PMIntrGBIO
;--------------------------------------------------------
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrGBIO
PMIntrGBIO:
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
push ax
mov ax,[bp].pmUserDS
call GetSegmentAddress
shr dx,4
shl bx,12
or bx,dx ;bx now = seg of parent psp
mov [bp].intUserDS,bx
pop ax
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*18h] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov ax,ss
mov ds,ax
mov es,ax
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
push ax
mov ax,[bp].pmUserDS
mov [bp].intUserDS,ax
pop ax
;
; And return to the original caller.
call LeaveIntHandler
iret
else ;!NEC_98
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryVideo
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
sub sp,8 ; make room for stack frame
push bp
mov bp,sp
push es
push ax
xor ax,ax
mov es,ax
mov [bp + 8],cs
mov word ptr [bp + 6],offset piv_10
mov ax,es:[10h*4]
mov [bp + 2],ax
mov ax,es:[10h*4 + 2]
mov [bp + 4],ax
pop ax
pop es
pop bp
retf
piv_10: pushf
FCLI
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
call IntExitVideo
;
; And return to the original caller.
call LeaveIntHandler
riret
endif ;!NEC_98
; -------------------------------------------------------
; IntEntryVideo -- This routine performs any register
; fixups and data copying needed on entry to the
; PC BIOS video interrupt (Int 10h)
;
; Input: register values on stack frame
; Output: register values on stack frame
; Errors: none
; Uses: any registers modified,
; possibly modifies buffers rgbXfrBuf0 or rgbXfrBuf1
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntryVideo
IntEntryVideo:
ifdef NEC_98
;video mode
cmp ah,0Fh
jnz ienv10
mov cx,16
jmp ienv70
ienv10:
cmp ah,14h
jnz ienv20
jmp ienv80
ienv20:
cmp ah,1Fh
jnz ienv30
jmp ienv110
ienv30:
cmp ah,1Ah
jnz ienv40
test fPCH98,0FFh
jnz H98_FontWrite_N
mov cx,34
jmp ienv70
ienv40:
cmp ah,20h
jnz ienv90
test fPCH98,0FFh
jnz @f
mov cx,72
jmp ienv100
@@:
jmp H98_FontWrite_H
ienv70:
push ds
mov si,[bp].pmUserCX ;offset address
mov ds,[bp].pmUserBX ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
ienv80:
push ax
mov ax,segDXDataPM
mov [bp].intUserBX,ax ;segment address
pop ax
mov [bp].intUserCX,offset DGROUP:rgbXfrBuf1
ienv90:
ret
ienv100:
push ds
mov si,[bp].pmUserBX ;offset address
mov ds,[bp].pmUserDS ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
ienv110:
push ax
mov ax,segDXDataPM
mov [bp].intUserDS,ax ;segment address
pop ax
mov [bp].intUserBX,offset DGROUP:rgbXfrBuf1
ienv120:
ret
H98_FontWrite_N:
cmp dx,7601h
jb @f
cmp dx,767Fh
jna WUSKZEN
cmp dx,7701h
jb @f
cmp dx,777Fh
jna WUSKZEN
cmp dx,7801h
jb @f
cmp dx,783Fh
;;;;;;;; ja ienv35
jna WUSKZEN
jmp ienv35
WUSKZEN:
mov cx,34
jmp ienv70
@@:
jmp ienv40
ienv35:
cmp dx,7840h
jb @b
cmp dx,787Fh
jna WUSKHAN
cmp dx,7D01h
jb @b
cmp dx,7D7Fh
jna WUSKHAN
cmp dx,7E01h
jb @b
cmp dx,7E7Fh
;;;;;;;; ja @b
jna WUSKHAN
jmp @b
WUSKHAN:
mov cx,18
jmp ienv70
H98_FontWrite_H:
cmp dx,7601h
jb @f
cmp dx,767Fh
jna HWUSKZEN
cmp dx,7701h
jb @f
cmp dx,777Fh
jna HWUSKZEN
cmp dx,7801h
jb @f
cmp dx,783Fh
;;;;;;;; ja @f
jna HWUSKZEN
jmp ienv45
HWUSKZEN:
;;;;;;;; mov cx,74
mov cx,72
jmp ienv100
@@:
jmp ienv90
ienv45:
cmp dx,7840h
jb @f
cmp dx,787Fh
jna HWUSKHAN
cmp dx,7D01h
jb @f
cmp dx,7D7Fh
jna HWUSKHAN
cmp dx,7E01h
jb @f
cmp dx,7E7Fh
;;;;;;;; ja @f
jna HWUSKHAN
jmp @f
HWUSKHAN:
;;;;;;;; mov cx,50
mov cx,48
jmp ienv100
@@:
ret
else ;!NEC_98
cmp ah,10h
jnz ienv20
;
; Video palette control function. Check for subfunctions that require
; special actions.
ienv10: cmp al,2 ;update all palette registers?
jnz @F
mov cx,17 ;palette data is 17 bytes long
jmp short ienv70 ;go copy the data
;
@@: cmp al,9 ;read all palette registers
jz ienv72
;
cmp al,12h ;update video DAC color registers
jnz @F
mov cx,[bp].pmUserCX ;count of table entries is in caller CX
add cx,cx ;each entry is 3 bytes long
add cx,[bp].pmUserCX
jmp short ienv70 ;go copy the data down
@@: cmp al,17h ;read a block of video DAC registers
jz ienv72
;
jmp short ienv90
;
;
ienv20: cmp ah,11h
jnz ienv30
;
; Character generator interface function.
; NOTE: a number of subfunctions of function 11h need to have munging
; and data buffering performed. However, function 30h is the only
; one used by Codeview, so this is the only one currently implemented.
; For this one, nothing needs to be done on entry, only on exit.
jmp short ienv90
;
;
ienv30: cmp ah,1Bh
jnz ienv40
;
; Video BIOS functionality/state information.
; On entry, we need to fix up ES:DI to point to our buffer.
mov [bp].intUserDI,offset DGROUP:rgbXfrBuf0
jmp short ienv90
;
;
ienv40:
jmp short ienv90
;
; Copy the buffer from the user ES:DX to our transfer buffer and set
; the value to DX passed to the interrupt routine to point to our buffer.
ienv70: cld
jcxz ienv90
push ds
mov si,[bp].pmUserDX
mov ds,[bp].pmUserES
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
;
ienv72: mov [bp].intUserDX,offset DGROUP:rgbXfrBuf1
jmp short ienv90
;
; All done
ienv90:
ret
endif ;!NEC_98
; -------------------------------------------------------
; IntExitVideo: This routine performs any register
; fixups and data copying needed on exit from the
; PC BIOS video interrupt (Int 10h).
;
; Input: register values on stack frame
; Output: register values on stack frame
; Errors: none
; Uses: any registers modified
; possibly modifies buffers rgbXfrBuf0 or rgbXfrBuf1
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitVideo
IntExitVideo:
ifdef NEC_98
;video mode
cmp ah,0Fh
jnz iexv10
jmp iexv80
iexv10:
cmp ah,14h
jnz iexv20
cmp dh,00h
jnz iexv11
mov cx,10
jmp iexv70
iexv11:
cmp dh,80h ;ANK(7*13)
jnz iexv12
mov cx,18
jmp iexv70
iexv12:
test fPCH98,0FFh
jnz @f
cmp dx,2920h
jb iexv13
cmp dx,297dh
ja iexvhan1
mov cx,18
jmp iexv70
iexvhan1:
cmp dx,2a20h
jb iexv13
cmp dx,2a5fh
ja iexv13
mov cx,18
jmp iexv70
@@:
jmp H98_FontRead_N
iexv13:
mov cx,34
jmp iexv70
iexv20:
cmp ah,1Fh
jnz iexv30
cmp dh,00h
jnz iexv21
mov cx,48
jmp iexv100
iexv21:
test fPCH98,0FFh
jnz @f
cmp dx,2920h
jb Hmode_han1
cmp dx,297dh
ja Hmode_han1
mov cx,48
jmp iexv100
Hmode_han1:
cmp dx,2a20h
jb iexv22
cmp dx,2a5fh
ja iexv22
mov cx,48
jmp iexv100
@@:
jmp H98_FontRead_H
iexv22:
mov cx,72
jmp iexv100
iexv30:
cmp ah,1Ah
jnz iexv40
jmp iexv80
iexv40:
cmp ah,20h
jnz iexv90
jmp iexv110
iexv70:
cld
push es
mov di,[bp].pmUserCX
mov es,[bp].pmUserBX
mov si,offset DGROUP:rgbXfrBuf1
rep movsb
pop es
;
; Restore the caller's CX
iexv80:
push ax
mov ax,[bp].pmUserBX ;BX regster restor
mov [bp].intUserBX,ax
;------------------------------------------------------------
mov ax,[bp].pmUserCX
mov [bp].intUserCX,ax
pop ax
iexv90:
ret
iexv100:
cld
push es
mov di,[bp].pmUserBX
mov es,[bp].pmUserDS
mov si,offset DGROUP:rgbXfrBuf1
rep movsb
pop es
;
; Restore the caller's CX
iexv110:
push ax
mov ax,[bp].pmUserDS ;BX regster restor
mov [bp].intUserDS,ax
;------------------------------------------------------------
mov ax,[bp].pmUserBX
mov [bp].intUserBX,ax
pop ax
iexv120:
ret
H98_FontRead_N:
cmp dx,2920h
jb iexvN15
cmp dx,297fh
jna iexvNhan
cmp dx,2a20h
jb iexvN15
cmp dx,2a7fh
jna iexvNhan
cmp dx,2b20h
jb iexvN15
cmp dx,2b7fh
jna iexvNhan
cmp dx,7840h
jb iexvN15
cmp dx,787fh
jna iexvNhan
cmp dx,7d01h
jb iexvN15
cmp dx,7d7fh
jna iexvNhan
cmp dx,7e01h
jb iexvN15
cmp dx,7e7fh
ja iexvN15
iexvNhan:
mov cx,18 ;16byte+2=18 ; jmp iexv70
iexvN15:
mov cx,34 ;32byte+2=34
jmp iexv70
H98_FontRead_H:
cmp dx,2920h
jb iexvN25
cmp dx,297fh
jna HiexvNhan
cmp dx,2a20h
jb iexvN25
cmp dx,2a7fh
jna HiexvNhan
cmp dx,2b20h
jb iexvN25
cmp dx,2b7fh
jna HiexvNhan
cmp dx,7840h
jb iexvN25
cmp dx,787fh
jna HiexvNhan
cmp dx,7d01h
jb iexvN25
cmp dx,7d7fh
jna HiexvNhan
cmp dx,7e01h
jb iexvN25
cmp dx,7e7fh
ja iexvN25
HiexvNhan:
;;;;;;;; mov cx,50 ;48byte+2=50
mov cx,48 ;48byte
;;;;;;;; jmp iexv70
jmp iexv100
iexvN25:
;;;;;;;; mov cx,74 ;72byte+2=74
mov cx,72 ;72byte
;;;;;;;; jmp iexv70
jmp iexv100
else ;!NEC_98
cmp ah,10h
jnz iexv20
;
; Palette control function.
cmp al,9 ;read palette data function
jnz @F
mov cx,17
jmp short iexv70
;
@@: cmp al,17h ;read video DAC registers
jnz @F
mov cx,[bp].pmUserCX ;each entry in table is 3 bytes long
add cx,cx
add cx,[bp].pmUserCX
jmp short iexv70
;
@@: jmp short iexv72
;
;
iexv20: cmp ah,11h
jnz iexv30
;
; Character generator interface function.
; NOTE: a number of subfunctions of function 11h need to have munging
; and data buffering performed. However, function 30h is the only
; one used by Codeview, so this is the only one currently implemented
cmp al,30h
jnz @F
mov ax,[bp].intUserES ;get the paragraph address returned by BIOS
mov bx,STD_DATA
call ParaToLDTSelector ;get a selector for that address
mov [bp].pmUserES,ax ;store the selector so that it will be
; returned to the caller
@@: jmp short iexv90
;
;
iexv30: cmp ah,1Bh
jnz iexv40
;
; Video BIOS functionality/state information.
; On exit, we need to fix up the pointer at the beginning of the
; data put in our buffer by the BIOS, and then transfer the buffer up
; to the user.
mov ax,word ptr rgbXfrBuf0[2] ;get segment of pointer to
; 'static functionallity table'
mov bx,STD_DATA
call ParaToLDTSelector ;convert paragraph to selector
mov word ptr rgbXfrBuf0[2],ax ;store back into table
push es
mov si,offset rgbXfrBuf0 ;pointer to our copy of the table
mov di,[bp].pmUserDI ;where the user wants it
mov [bp].intUserDi,di ;restore the DI returned to the user
mov es,[bp].pmUserES
mov cx,64 ;the table is 64 bytes long
cld
rep movsb ;copy the table to the user's buffer
pop es
jmp short iexv90
;
;
iexv40:
jmp short iexv90
;
; Copy data from our buffer to the caller's buffer pointed to by ES:DX
iexv70: cld
push es
mov di,[bp].pmUserDX
mov es,[bp].pmUserES
mov si,offset DGROUP:rgbXfrBuf1
rep movsb
pop es
;
; Restore the caller's DX
iexv72: mov ax,[bp].pmUserDX
mov [bp].intUserDX,ax
;
; All done
iexv90:
ret
endif ;!NEC_98
; -------------------------------------------------------
DXPMCODE ends
; -------------------------------------------------------
subttl BIOS Misc. Interrupt (Int 15h) Service Routine
page
; -------------------------------------------------------
; BIOS MISC. INTERRUPT (INT 15h) SERVICE ROUTINE
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; PMIntrMisc -- Entry point into the interrupt processing code
; for the BIOS misc functions interrupt (INT 15h).
;
; Input: normal registers for Bios calls
; Output: normal register returns for Bios calls
; Errors: normal Bios errors
; Uses: as per Bios calls
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrMisc
PMIntrMisc:
;
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryMisc
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
sub sp,8 ; make room for stack frame
push bp
mov bp,sp
push es
push ax
xor ax,ax
mov es,ax
mov [bp + 8],cs
mov word ptr [bp + 6],offset pim_10
mov ax,es:[15h*4]
mov [bp + 2],ax
mov ax,es:[15h*4 + 2]
mov [bp + 4],ax
pop ax
pop es
pop bp
retf
pim_10: pushf
FCLI
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
call IntExitMisc
;
; And return to the original caller.
call LeaveIntHandler
riret
; -------------------------------------------------------
; MISC INTERRUPT SUPPORT ROUTINES
; -------------------------------------------------------
;
; IntEntryMisc -- This function performs data transfer
; and register translation on entry to the BIOS Misc.
; functions interrupt. (INT 15h).
;
; Input: AX - BIOS function being performed
; Output:
; Errors:
; Uses: All registers preserved
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntryMisc
IntEntryMisc:
ifdef NEC_98
push cx
cmp ah,90h ;SYSTEM BIOS BLOCK MOVE
jnz iemDMA1 ;yes = jmp
jmp iem70
iemDMA1:
cmp ah,0D5h ;DMA BIOS DMA
jnz iemDMA2 ;yes = jmp
mov cx,8 ;DMA_CBIOS
jmp iem70
iemDMA2:
cmp ah,0D6h ;DMA BIOS DMA
jnz iemROM1 ;yes = jmp
jmp iem80 ;Read JMP
iemROM1:
cmp ah,0D8h ;ROM
jnz iemROM2 ;yes = jmp
mov cx,4
jmp iem70
iemROM2:
cmp ah,0D9h ;ROM
jnz iem90 ;yes = jmp
mov cx,8 ;ROM BIOS
iem70:
push ds
mov si,[bp].pmUserBX ;offset address
mov ds,[bp].pmUserES ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
iem80:
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
mov [bp].intUserBX,offset DGROUP:rgbXfrBuf1
iem90:
pop cx
ret
else ;!NEC_98
; Map requests to set the PS/2 Pointing Device Handler Address
cmp ax,0C207h ;PS/2 Set Pointing Device Handler adr?
jnz iem90
mov ax,[bp].pmUserBX ;User's ES:BX -> handler
mov word ptr lpfnUserPointingHandler,ax
mov ax,[bp].pmUserES
mov word ptr [lpfnUserPointingHandler+2],ax
mov ax,segDXCodePM ;pass BIOS address of our handler
mov [bp].intUserES,ax
mov ax,offset PointDeviceHandler
mov [bp].intUserBX,ax
iem90:
ret
endif ;!NEC_98
; -------------------------------------------------------
; IntExitMisc -- This function performs data transfer
; and register translation on exit from the BIOS Misc.
; Functions interrupt (INT 15h).
;
; Input: AX - BIOS function being performed
; Output:
; Errors:
; Uses: All registers preserved
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitMisc
IntExitMisc:
ifdef NEC_98
push cx
cmp ah,90h ;SYSTEM BIOS BLOCK MOVE
jnz ixmDMA1 ;yes = jmp
jmp ixm70
ixmDMA1:
cmp ah,0D5h ;DMA BIOS
jnz ixmDMA2 ;yes = jmp
jmp ixm70
ixmDMA2:
cmp ah,0D6h ;DMA BIOS DMA
jnz ixmROM1 ;yes = jmp
mov cx,16
jmp ixm80
ixmROM1:
cmp ah,0D8h ; ROM
jnz ixmROM2 ;yes = jmp
jmp ixm70
ixmROM2:
cmp ah,0D9h ; ROM
jnz ixm90
ixm70:
cld
push es
mov di,[bp].pmUserBX
mov es,[bp].pmUserES
mov si,offset DGROUP:rgbXfrBuf1
rep movsb
pop es
;
; Restore the caller's ES,BX
ixm80:
push ax
mov ax,[bp].pmUserES
mov [bp].intUserES,ax
mov ax,[bp].pmUserBX
mov [bp].intUserBX,ax
pop ax
ixm90:
pop cx
ret
else ;!NEC_98
push ax
push bx
push cx
push dx
;
; Check for function 0C0h - Return System Configuration Parameters
cmp ah,0C0h
jnz ixmi30
test [bp].intUserFL,1 ;check if the bios call returned an error
jnz ixmi90 ;(carry flag set in returned flags)
;
; The BIOS call succeeded. This means that ES:BX points to a configuration
; vector. We need to fix up the segment to be a selector.
mov dx,[bp].intUserES
cmp dx,0F000h ;does it point to normal BIOS segment
jnz ixmi22
mov ax,SEL_BIOSCODE or STD_RING
jmp short ixmi24
ixmi22: call ParaToLinear
mov cx,0FFFFh
mov ax,SEL_USERSCR or STD_TBL_RING
cCall NSetSegmentDscr,<ax,bx,dx,0,cx,STD_DATA>
ixmi24: mov [bp].pmUserES,ax
jmp short ixmi90
; Chack for function 0C207h - PS/2 Set Pointing Device Handler Address
ixmi30:
cmp ax,0C207h
jne ixmi90
mov ax,[bp].pmUserBX ;restore user's BX
mov [bp].intUserBX,ax
; All done
ixmi90:
pop dx
pop cx
pop bx
pop ax
ret
endif ;!NEC_98
; -------------------------------------------------------
DXPMCODE ends
; -------------------------------------------------------
subttl Mouse Function Interrupt (Int 33h) Service Routine
page
; -------------------------------------------------------
; MOUSE FUNCTION INTERRUPT (INT 33h) SERVICE ROUTINE
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; PMIntrMouse - Entry point into interrupt reflector code
; for mouse driver (int 33h) calls.
;
; Input: normal registers for mouse calls
; Output: normal register returns for mouse calls
; Errors: normal mouse errors
; Uses: as per mouse calls
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrMouse
PMIntrMouse:
;
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryMouse
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
sub sp,8 ; make room for stack frame
push bp
mov bp,sp
push es
push ax
xor ax,ax
mov es,ax
mov [bp + 8],cs
mov word ptr [bp + 6],offset pimo_10
mov ax,es:[33h*4]
mov [bp + 2],ax
mov ax,es:[33h*4 + 2]
mov [bp + 4],ax
pop ax
pop es
pop bp
retf
pimo_10: pushf
FCLI
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
call IntExitMouse
;
; And return to the original caller.
call LeaveIntHandler
riret
; -------------------------------------------------------
; MOUSE SUPPORT ROUTINES
; -------------------------------------------------------
; IntEntryMouse -- This function performs data transfer and
; register translation on entry to mouse driver functions.
; (INT 33h)
;
; Input: AX - mouse function being performed
; Output:
; Errors:
; Uses: NOTHING
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntryMouse
IntEntryMouse:
cld
push ax
push cx
push si
push di
;
cmp al,9 ;Set graphics cursor block?
jnz ment10
;
; The user is setting a graphics cursor. We need to copy the masks
; down to low memory so that the mouse driver can get at them and then
; fix up the pointer in DX.
mov cx,32
jmp short ment92
;
; Mouse interrupt handler establishment
ment10: cmp al,12 ;Set user defined interrupt subroutine ?
jnz ment20
;
; This command has the effect of causing a call to the address es:ds
; Whenever an event of one of the types specified by the mask in cx.
; The address es:dx must be saved in lpfnUserMouseHandler and the
; real mode address of MouseInterruptHandler substituted.
mov ax,[bp].pmUserDX ; Load users handler offset
mov word ptr lpfnUserMouseHandler,ax ; Store for future use
mov ax,[bp].pmUserES ; Load users handler segment value
mov word ptr lpfnUserMouseHandler + 2,ax ; Store for future use
mov ax,segDXCodePM ; Load real mode code segment value
mov [bp].intUserES,ax ; Store in real mode es register image
mov ax,offset MouseInterruptHandler ; Load handler offset
mov [bp].intUserDX,ax ; Store in real mode dx register image
jmp short ment99 ;Return
;
ment20: cmp al,20
jc ment99
jnz ment30
;
; This is the swap interrupt subroutine function. Not currently implemented
jmp short ment99
;
ment30: cmp al,22 ;Save mouse driver state?
jnz ment40
;
; This is the save mouse driver state function. We need to pass a pointer
; to the transer buffer down to the mouse driver.
mov ax,npXfrBuf1
mov [bp].intUserDX,ax
jmp short ment99
ment40: cmp al,23 ;Restore mouse driver state?
jnz ment99
;
; This is the restore mouse driver state function. We need to copy the
; mouse state buffer from the pm user location to the transfer buffer,
; and then pass the pointer to the transfer buffer on to the mouse driver.
mov cx,cbMouseState
jcxz ment99
;
; Transfer the data pointed to by the user ES:DX to the scratch buffer, and
; fix up the pointer that is passed on to the mouse driver.
ment92: mov si,[bp].pmUserDX
mov di,npXfrBuf1
mov [bp].intUserDX,di
push ds
mov ds,[bp].pmUserES
cld
rep movs word ptr [di],word ptr [si]
pop ds
;
ment99: pop di
pop si
pop cx
pop ax
ret
; -------------------------------------------------------
; IntExitMouse -- This function performs data transfer and
; register translation on exit from mouse driver functions.
; (INT 33h)
;
; Input: AX - mouse function being performed
; Output:
; Errors:
; Uses:
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitMouse
IntExitMouse:
cld
cmp al,21 ;get state buffer size?
jnz mxit20
;
; We need to remember the state buffer size, so that later we will know
; how many bytes to transfer when we do the save/restore state fucntions.
mov ax,[bp].intUserBX
mov cbMouseState,ax
return
;
mxit20: cmp al,22 ;Save mouse driver state?
jnz mxit30
;
; We need to restore the original values of ES:DX and transfer the mouse
; state data from the real mode buffer to the user's protected mode buffer.
mov cx,cbMouseState
jcxz mxit28
push es
mov si,npXfrBuf1
mov di,[bp].pmUserDX
mov [bp].intUserDX,di
mov es,[bp].pmUserES
rep movs byte ptr [di],byte ptr [si]
pop es
mxit28: return
;
mxit30: cmp al,23 ;Restore mouse driver state?
jnz mxit99
mov ax,[bp].pmUserDX
mov [bp].intUserDX,ax
;
mxit99: ret
; -------------------------------------------------------
DXPMCODE ends
; -------------------------------------------------------
subttl PM Interrupt Support Routines
page
; -------------------------------------------------------
; PM INTERRUPT SUPPORT ROUTINES
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; EnterIntHandler -- This routine will allocate a stack
; frame on the interrupt reflector stack and make
; a copy of the registers on the allocated stack.
;
; Note: This routine expects the current stack to contain a near
; return address and a normal [IP] [CS] [FL] interrupt stack
; frame. Don't have anything else on the stack before calling
; this routine!
;
; Note: This routine disables interrupts, and leaves them disabled.
; Most callers already have them disabled, so it doesn't
; really make a difference, except that this routine
; requires that they be disabled.
;
; Input: none
; Output: stack frame set up
; Errors: none
; Uses: all registers preserved
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public EnterIntHandler
EnterIntHandler proc near
FCLI ;we really want int's disabled (and
; XMScontrol doesn't do that)
push ds
mov ds,selDgroupPM ;save user's DS and address our DGROUP
assume ds:DGROUP
pop regUserDS
push bp
mov bp,sp ;bp -> [BP] [IP] [IP] [CS] [FL]
push word ptr [bp+8]
pop regUserFL ;user's flags before doing INT
pop bp
pop pfnReturnAddr ;near return to our immediate caller
mov regUserSS,ss ;save caller's stack address
mov regUserSP,sp
ASSERT_REFLSTK_OK
mov ss,selDgroupPM ;switch to interrupt reflector stack
mov sp,pbReflStack
sub pbReflStack,CB_STKFRAME ;adjust pointer to next stack frame
FIX_STACK
; Build the stack frame. The stack frame contains the following:
; dword & word parameter locations
; original caller's stack address
; caller's original flags and general registers (in pusha form)
; caller's original segment registers (DS & ES)
; flags and general registers to be passed to interrupt routine
; (initially the same as caller's original values)
; segment registers (DS & ES) to be passed to interrupt routine
; (initially set to the Dos Extender data segment address)
;
; The parameter words and then the caller's original register values go on top.
sub sp,8 ;space for a dd & 2 dw's
push regUserSP
push regUserSS
push regUserFL
pusha
push regUserDS
push es
; Now, put all of the general registers, and values for the segment
; registers to be passed to the interrupt service routine. We pass
; the Dos Extender data segment address to the interrupt routine.
push regUserFL
pusha
push segDXDataPM
push segDXDataPM
; And we are done.
mov bp,sp ;set up frame pointer
mov es,selDgroupPM
jmp pfnReturnAddr ;return to the caller.
EnterIntHandler endp
; -------------------------------------------------------
; LeaveIntHandler -- This routine will restore the user registers,
; release the stack frame, and restore the original user's stack
; for exit from an interrupt reflector routine.
;
; Note: Interrupts must be off when this routine is called.
;
; Input: none
; Output: none
; Errors: none
; Uses: All registers modified
assume ds:DGROUP,es:NOTHING,ss:NOTHING
public LeaveIntHandler
LeaveIntHandler proc near
FCLI
pop pfnReturnAddr
; The copy of the register values returned from the interrupt routine
; (and then possibly modified by the exit handler for the particular
; interrupt) are what gets returned to the caller. We discard the original
; register values saved on entry. (They were there so that the exit
; routine could refer to them if necessary)
add sp,4 ;skip over interrupt service routine's
; segment register values
popa ;restore general register values
pop regUserFL ;flags returned by interrupt routine
pop es ;get segment registers from pmUserES
pop regUserDS ; and pmUserDS
add sp,18 ;skip over the original user registers
; and flags
pop regUserSS ;original interrupted routine's stack
pop regUserSP
mov regUserAX,ax
; Switch back to the original user's stack.
ASSERT_REFLSTK_OK
ASSERT_CLI
CHECK_STACK
mov ss,regUserSS
mov sp,regUserSP
add pbReflStack,CB_STKFRAME
ASSERT_REFLSTK_OK
; We need to replace the image of the flags in the original int return
; address on the user's stack with the new flags returned from the interrupt
; service routine.
push bp
mov bp,sp ;stack -> BP IP CS FL
mov ax,regUserFL ;flags returned by interrupt service routine
and ax,0BFFFh ;clear the nested task flag
and [bp+6],0300h ;clear all but the interrupt and trace flags
; in the caller's original flags
or [bp+6],ax ;combine in the flags returned by the
; interrupt service routine. This will cause
; us to return to the original routine with
; interrupts on if they were on when the
; interrupt occured, or if the ISR returned
; with them on.
pop bp
; And now, return to the caller.
push pfnReturnAddr
mov ax,regUserAX
mov ds,regUserDS
assume ds:NOTHING
ret
LeaveIntHandler endp
; -------------------------------------------------------
DXPMCODE ends
; -------------------------------------------------------
subttl Mouse Interrupt Callback Function Handler
page
; -------------------------------------------------------
; MOUSE INTERRUPT CALLBACK FUNCTION HANDLER
; -------------------------------------------------------
DXCODE segment
assume cs:DXCODE
; -------------------------------------------------------
; MouseInterruptHandler -- This routine is the entry point for
; user requested mouse event interrupts. It switches the
; processor to protected mode and transfers control to the
; user protected mode mouse handling routine. When that
; completes, it switches back to real mode and returns control
; to the mouse driver.
; Entry to this routine will have been requested by an
; INT 33H code 12 with the real address of this routine
; substituted for the users entry point.
; The address of the user specified mouse handler as specified
; in the original INT 33H is stored in the variable
; lpfnUserMouseHandler.
;
; Input: none
; Output: none
; Errors: none
; Uses: The segment registers are explicitly preserved by
; this routine. Other registers are as preserved or
; modified by the users mouse handler.
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public MouseInterruptHandler
MouseInterruptHandler proc far
;
; On entry, the stack layout is:
; [2] CS - System mouse handler code segment
; [0] IP - System mouse handler return offset
;
push es
push ds
pushf
FCLI
cld
mov ds,selDgroup
assume ds:DGROUP
pop regUserFL
;
; Allocate a new stack frame, and then switch to the local stack
; frame.
mov regUserSP,sp ;save entry stack pointer so we can restore it
mov regUSerSS,ss ;save segment too
mov ss,selDgroup ;switch to our own stack frame
ASSERT_REFLSTK_OK
mov sp,pbReflStack
sub pbReflStack,CB_STKFRAME ;adjust pointer to next stack frame
FIX_STACK
;
; We are now running on our own stack, so we can switch into protected mode.
push ax ;preserve caller's AX
SwitchToProtectedMode
pop ax
;
; Build a far return frame on the stack so that the user's
; routine will return to us when it is finished.
push regUserSS ; save system mouse handler stack address
push regUserSP ; so we can restore it later
push ds
push cs
push offset mih50
;
; Build an IRET frame on the stack to use to transfer control to the
; user's protected mode routine
push regUserFL
push word ptr lpfnUserMouseHandler+2 ;push segment of user routine
push word ptr lpfnUserMouseHandler ;push offset of user routine
;
; At this point the interrupt reflector stack looks like this:
;
; [14] stack segment of original stack
; [12] stack pointer of original stack
; [10] real mode dos extender data segment
; [8] segment of return address back to here
; [6] offset of return address back here
; [4] Users flags
; [2] segment of user routine
; [0] offset of user routine
;
; Execute the users mouse handler
iret
;
; The users handler will return here after it is finsished.
mih50: FCLI
cld
pop ds
pop regUserSP
pop regUserSS
;
; Switch back to real mode.
push ax ;preserve AX
SwitchToRealMode
pop ax
CHECK_STACK
;
; Switch back to the original stack.
mov ss,regUserSS
mov sp,regUserSP
ASSERT_REFLSTK_OK
;
; Deallocate the stack frame that we are using.
add pbReflStack,CB_STKFRAME
ASSERT_REFLSTK_OK
;
; And return to the original interrupted program.
pop ds
pop es
ret
MouseInterruptHandler endp
; -------------------------------------------------------
DXCODE ends
; -------------------------------------------------------
subttl PS/2 Pointing Device Handler
page
; -------------------------------------------------------
; PS/2 POINTING DEVICE HANDLER
; -------------------------------------------------------
DXCODE segment
assume cs:DXCODE
ifndef NEC_98
; -------------------------------------------------------
; PointDeviceHandler -- This routine is the entry point for
; the PS/2 Pointing Device Handler. It switches the
; processor to protected mode and transfers control to the
; user pointing device handler. When that completes,
; it switches back to real mode and returns control to
; the PS/2 BIOS.
;
; Note: The BIOS calls us with interrutps enabled!
; Input: none
; Output: none
; Errors: none
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PointDeviceHandler
PointDeviceHandler proc far
; On entry, the stack layout is:
;
; [10] status
; [8] X coordinate
; [6] Y coordinate
; [4] Z coordinate
; [2] CS - PS/2 BIOS code segment
; [0] IP - PS/2 BIOS return offset
cld
push es ;save PS/2 BIOS ds/es on it's stack
push ds
mov ds,selDgroup ;addressability to DOSX DGROUP
push ds
pop es
assume ds:DGROUP,es:DGROUP
FCLI ;protect global regUserXX vars
; Allocate a new stack frame, and then switch to the local stack
; frame.
mov regUserSP,sp ;save entry stack pointer so we can restore it
mov regUSerSS,ss ;save segment too
ASSERT_REFLSTK_OK
mov ss,selDgroup ;switch to our own stack frame
mov sp,pbReflStack
sub pbReflStack,CB_STKFRAME ;adjust pointer to next stack frame
FIX_STACK
push regUserSS ;save PS/2 BIOS stack address
push regUserSP ; so we can restore it later
push SEL_DXDATA or STD_RING ;DOSX DS to be poped in PM
sub sp,4*2 ;temp save the general regs further down the
pusha ; stack, they'll get poped in a little while
; Copy PS/2 pointing device stack info to our (soon to be) protected mode stack
mov si,regUserSP ;PS/2 stack pointer
mov ds,regUserSS ;PS/2 stack segment
assume ds:NOTHING
FSTI ;no more references to global regUserXX vars
add si,4*2 ;skip over es,ds,cs,ip
mov di,sp ;loc for pointing device
add di,8*2 ; data on our stack
mov cx,4
cld
rep movsw
push es ;restore ds = DGROUP
pop ds
assume ds:DGROUP
; We are now running on our own stack, so we can switch into protected mode.
SwitchToProtectedMode ;disables interrupts again
FSTI ; but we don't want them disabled
popa ;restore general registers
; At this point the stack looks like this:
;
; [12] stack segment of original stack
; [10] stack pointer of original stack
; [8] protect mode dos extender data segment
; [6] status
; [4] X coordinate
; [2] Y coordinate
; [0] Z coordinate
; Execute the user's pointing device handler
call [lpfnUserPointingHandler]
; The users handler will return here after it is finsished.
pdh50:
cld
add sp,4*2 ;discard pointing device info
pop ds
FCLI ;protect global regUserXX vars
pop regUserSP
pop regUserSS
; Switch back to real mode.
push ax ;preserve AX
SwitchToRealMode
pop ax
; Switch back to the original stack.
CHECK_STACK
mov ss,regUserSS
mov sp,regUserSP
; Deallocate the stack frame that we are using.
ASSERT_REFLSTK_OK
add pbReflStack,CB_STKFRAME
ASSERT_REFLSTK_OK
; And return to the PS/2 BIOS
FSTI ;we came in with ints enabled
pop ds
pop es
ret
PointDeviceHandler endp
; -------------------------------------------------------
endif ;!NEC_98
;
; -------------------------------------------------------
subttl Utility Function Definitions
page
; -------------------------------------------------------
; UTILITY FUNCTION DEFINITIONS
; -------------------------------------------------------
;
; SaveRMIntrVectors -- This routine copies the current
; real mode interrupt vector table to the shadow
; vector table used by the interrupt reflector.
;
; Input: none
; Output: none
; Errors: none
; Uses; all registers preserved
;
; NOTE: This routine can only be called in REAL MODE.
assume ds:DGROUP,es:NOTHING,ss:NOTHING
public SaveRMIntrVectors
SaveRMIntrVectors:
push cx
push si
push di
push ds
push es
;
cld
push ds
pop es
xor cx,cx
mov si,cx
mov ds,cx
mov di,offset DGROUP:rglpfnRmISR
mov cx,2*256
rep movs word ptr [di],word ptr [si]
;
pop es
pop ds
pop di
pop si
pop cx
ret
; -------------------------------------------------------
; RestoreRMIntrVectors -- This routine copies the
; interrupt vectors from the real mode interrupt
; vector shadow table back down to the real interrupt
; vectors.
;
; Input: none
; Output: none
; Errors: none
; Uses; all registers preserved
;
; NOTE: This routine can only be called in REAL MODE.
assume ds:DGROUP,es:NOTHING,ss:NOTHING
public RestoreRMIntrVectors
RestoreRMIntrVectors:
push cx
push si
push di
push ds
push es
;
FCLI
cld
xor cx,cx
mov di,cx
mov es,cx
mov si,offset DGROUP:rglpfnRmISR
mov cx,2*256
rep movs word ptr [di],word ptr [si]
FSTI
;
pop es
pop ds
pop di
pop si
pop cx
ret
; -------------------------------------------------------
DXCODE ends
ifdef NEC_98
;
; -------------------------------------------------------
subttl INT D2h SOUND BIOS HANDRER
page
; -------------------------------------------------------
; PMIntrSound
;--------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrSound
PMIntrSound:
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntrySD
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*0D2h] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
call IntExitSD
;
; And return to the original caller.
call LeaveIntHandler
iret
;--------------------------------------------------------
; IntEntrySD
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntrySD
IntEntrySD:
cmp ah,0 ;BIOS(INITIALIZE)
jnz ienSD10
mov bx,0 ;BIOS
mov si,bx
mov cx,2FFh ;(256) (512)
jmp ienSD50
ienSD10:
cmp ah,1 ;(PLAY)
jnz ienSD20
mov si,[bp].pmUserBX
mov cx,28
jmp ienSD50
ienSD20:
cmp ah,16h ;(SET PARA BLOCK)
jnz ienSD90
mov si,[bp].pmUserBX
cmp dl,0 ;00=WORD/01=BYTE?
jnz ienSD21 ;not 0 = JMP
mov cx,100 ;100
jmp ienSD50
ienSD21:
mov cx,51 ;51
ienSD50:
push ds
;;;; mov si,[bp].pmUserBX ;
mov ds,[bp].pmUserES ;
mov di,offset DGROUP:rgbXfrBuf1
rep movsb
pop ds
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
;------------------------------------------------------------
mov [bp].intUserBX,offset DGROUP:rgbXfrBuf1
ienSD90:
ret
;--------------------------------------------------------
; IntExitSD
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitSD
IntExitSD:
cmp ah,0 ;BIOS (INITIALIZE)
jnz iexSD10
jmp iexSD50
iexSD10:
cmp ah,1 ;(PLAY)
jnz iexSD20
jmp iexSD50
iexSD20:
cmp ah,16h ;(SET PARA BLOCK)
jnz iexSD90
iexSD50:
push ax
mov ax,[bp].pmUserES
mov [bp].intUserES,ax
;------------------------------------------------------------
mov ax,[bp].pmUserBX
mov [bp].intUserBX,ax
pop ax
iexSD90:
ret
DXPMCODE ends
; -------------------------------------------------------
subttl INT 1Ah PRINTER BIOS HANDRER
page
; 30h( ) 2K
; -------------------------------------------------------
; PMIntrPrinter
;--------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrPrinter
PMIntrPrinter:
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryPR
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*1Ah] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
call IntExitPR
;
; And return to the original caller.
call LeaveIntHandler
iret
;--------------------------------------------------------
; IntEntryPR
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntryPR
IntEntryPR:
cmp ah,30h ;
jnz ienPR20 ;90/08/24
mov cx,[bp].pmUserCX ;
cmp cx,2048 ;2K
jbe ienPR10 ;NO = jmp
mov cx,2048
mov [bp].intUserCX,cx
ienPR10:
push ds
mov si,[bp].pmUserBX ;offset address
mov ds,[bp].pmUserES ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
;------------------------------------------------------------
mov [bp].intUserBX,offset DGROUP:rgbXfrBuf1
ienPR20:
ret
;--------------------------------------------------------
; IntExitPR
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitPR
IntExitPR:
cmp ah,30h
jnz iexPR20
mov cx,[bp].pmUserCX
cmp cx,2048
ja iexPR10 ;YES = jmp
push ax
mov ax,[bp].pmUserES
mov [bp].intUserES,ax
;------------------------------------------------------------
mov ax,[bp].pmUserBX ;offset address
mov [bp].intUserBX,ax
pop ax
ret
iexPR10:
push ax
mov ax,[bp].pmUserES
mov [bp].intUserES,ax
;------------------------------------------------------------
mov cx,2048
sub [bp].pmUserCX,cx
mov ax,[bp].pmUserCX
mov [bp].intUserCX,ax
pop ax
push bx
add [bp].pmUserBX,cx
mov bx,[bp].pmUserBX
mov [bp].intUserBX,bx
pop bx
iexPR20:
ret
;////////////////////////////////////////////////////////////
if 0
;////////////////////////////////////////////////////////////
IntEntryPR:
cmp ah,30h
jnz ienPR10
mov cx,[bp].pmUserCX
cmp cx,2048
ja ienPR10 ;YES = jmp
push ds
mov si,[bp].pmUserBX ;offset address
mov ds,[bp].pmUserES ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
;------------------------------------------------------------
mov [bp].intUserBX,offset DGROUP:rgbXfrBuf1
ret
ienPR10:
push ds
mov si,[bp].pmUserBX ;offset address
mov ds,[bp].pmUserES ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
;------------------------------------------------------------
push bx
mov bx,offset DGROUP:rgbXfrBuf1 ;
add bx,cx ;DGROUP:rgbXfrBuf1
mov [bp].intUserBX,bx ;
pop bx
ret
; push ds
; mov [bp].intUserES,ds ;segment address
; pop ds
;;------------------------------------------------------------
; mov bx,offset DGROUP:rgbXfrBuf1 ;
; add bx,cx ;
; mov [bp].intUserBX,bx ;
; ret
;
;--------------------------------------------------------
; IntExitPR
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitPR
IntExitPR:
cmp ah,30h
jnz iexPR10
mov ax,[bp].pmUserES
mov [bp].intUserES,ax
;------------------------------------------------------------
mov ax,[bp].pmUserBX ;
mov [bp].intUserBX,ax
iexPR10:
ret
;////////////////////////////////////////////////////////////
endif
;////////////////////////////////////////////////////////////
DXPMCODE ends
; -------------------------------------------------------
subttl INT 1Ch CALENDER/TIMER HANDRER
page
; -------------------------------------------------------
; PMIntrCalTi
;--------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrCalTi
PMIntrCalTi:
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryCT
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*1Ch] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
call IntExitCT
;
; And return to the original caller.
call LeaveIntHandler
iret
;--------------------------------------------------------
; IntEntryCT
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntryCT
IntEntryCT:
cmp ah,0 ;
jnz ienCT10
jmp ienCT80
ienCT10:
cmp ah,1 ;
jnz ienCT20
mov cx,6 ;
jmp ienCT70
ienCT20:
ienCT50:
push es
push ax
mov ax,40h
mov es,ax
; test byte ptr es:[501h],8h ;if Hmode
test byte ptr es:[101h],8h ;if Hmode
jz ienCT90
;; test fNHmode,0FFh
;; jz ienCT90 ;0=Nmode --->jmp
;--------------------- Hmode ----------------------
cmp ah,3
jnz ienCT30
mov cx,4
jmp ienCT70
ienCT30:
cmp ah,4
jnz ienCT40
mov cx,12
jmp ienCT70
ienCT40:
cmp ah,5
jnz ienCT90
mov cx,12
;--------------------- Hmode ----------------------
ienCT70:
push ds
mov si,[bp].pmUserBX ;offset address
mov ds,[bp].pmUserES ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
ienCT80:
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
;------------------------------------------------------------
mov [bp].intUserBX,offset DGROUP:rgbXfrBuf1
ienCT90:
ret
;--------------------------------------------------------
; IntExitCT
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitCT
IntExitCT:
cmp ah,0
jnz iexCT10
mov cx,6
jmp iexCT70
iexCT10:
cmp ah,1
jnz iexCT20
jmp iexCT80
iexCT20:
iexCT50:
push es
push ax
mov ax,40h
mov es,ax
; test byte ptr es:[501h],8h ;if Hmode
test byte ptr es:[101h],8h ;if Hmode
jz iexCT90
;; test fNHmode,0FFh
;; jz iexCT90 ;0=Nmode --->jmp
;--------------------- Hmode ----------------------
cmp ah,3
jnz iexCT30
jmp iexCT80
iexCT30:
cmp ah,4
jnz iexCT40
jmp iexCT80
iexCT40:
cmp ah,5
jnz iexCT90
jmp iexCT80
;--------------------- Hmode ----------------------
iexCT70:
push es
mov di,[bp].pmUserBX ;offset address
mov es,[bp].pmUserES ;segment address
mov si,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop es
iexCT80:
push ax
mov ax,[bp].pmUserES
mov [bp].intUserES,ax
;------------------------------------------------------------
mov ax,[bp].pmUserBX
mov [bp].intUserBX,ax
pop ax
iexCT90:
ret
DXPMCODE ends
; -------------------------------------------------------
subttl INT DCh extended DOS HANDRER
page
; -------------------------------------------------------
; PMIntrExDos
;--------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrExDos
PMIntrExDos:
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryED
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*0DCh] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
; mov ax,[bp].pmUserAX ;get original function code
mov cx,[bp].pmUserCX ;get original function code
call IntExitED
;
; And return to the original caller.
call LeaveIntHandler
iret
;--------------------------------------------------------
; IntEntryED
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntryED
IntEntryED:
cmp cl,0Ch
jnz ienED10
jmp ienED80
ienED10:
;;; push cx
cmp cl,0Dh
jz ienED
jmp ienED20
ienED:
push cx
cmp ax,0
jnz ienED11
mov cx,386 ;386byte
jmp ienED70
ienED11:
cmp ax,0FFh
jnz ienED12
mov cx,786 ;786byte
jmp ienED70
ienED12:
cmp ax,1
jb ienED13
cmp ax,0Ah
ja ienED13
mov cx,160 ;16*10=160byte
jmp ienED70
ienED13:
cmp ax,0Bh
jb ienED14
cmp ax,14h
ja ienED14
mov cx,160 ;16*10=160byte
jmp ienED70
ienED14:
cmp ax,15h
jb ienED15
cmp ax,1Fh
ja ienED15
mov cx,66 ;6*11=66byte
jmp ienED70
ienED15:
cmp ax,20h
jb ienED16
cmp ax,24h
ja ienED16
mov cx,80 ;16*5=80byte
jmp ienED70
ienED16:
cmp ax,25h
jb ienED17
cmp ax,29h
ja ienED17
mov cx,80 ;16*5=80byte
jmp ienED70
ienED17:
cmp ax,2Ah
jb ienED18
cmp ax,38h
ja ienED18
mov cx,240 ;16*15=240byte
jmp ienED70
ienED18:
cmp ax,100h
jnz ienED20
mov cx,514 ;2+512=514byte
jmp ienED70
ienED20:
cmp cl,10h
jnz ienED90
cmp ah,1
jnz ienED90
moji_out:
mov si,dx
cmp byte ptr ds:[si],'$'
;;;;;;;; cmp byte ptr ds:[dx],'$'
jz ienED90
push ds
mov si,[bp].pmUserDX ;offset address
mov ds,[bp].pmUserDS ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
movsb
pop ds
jmp moji_out
ienED70:
push ds
mov si,[bp].pmUserDX ;offset address
mov ds,[bp].pmUserDS ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
pop cx
ienED80:
;-----------
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
;------------------------------------------------------------
mov [bp].intUserDX,offset DGROUP:rgbXfrBuf1
ienED90:
ret
;--------------------------------------------------------
; IntExitED
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitED
IntExitED:
cmp cl,0Ch
jz iexED
jmp iexED10
iexED:
push cx
cmp ax,0
jnz iexED1
mov cx,386 ;386byte
jmp iexED70
iexED1:
cmp ax,0FFh
jnz iexED2
mov cx,786 ;786byte
jmp iexED70
iexED2:
cmp ax,1
jb iexED3
cmp ax,0Ah
ja iexED3
mov cx,160 ;16*10=160byte
jmp iexED70
iexED3:
cmp ax,0Bh
jb iexED4
cmp ax,14h
ja iexED4
mov cx,160 ;16*10=160byte
jmp iexED70
iexED4:
cmp ax,15h
jb iexED5
cmp ax,1Fh
ja iexED5
mov cx,66 ;6*11=66byte
jmp iexED70
iexED5:
cmp ax,20h
jb iexED6
cmp ax,24h
ja iexED6
mov cx,80 ;16*5=80byte
jmp iexED70
iexED6:
cmp ax,25h
jb iexED7
cmp ax,29h
ja iexED7
mov cx,80 ;16*5=80byte
jmp iexED70
iexED7:
cmp ax,2Ah
jb iexED8
cmp ax,38h
ja iexED8
mov cx,240 ;16*15=240byte
jmp iexED70
iexED8:
cmp ax,100h
jnz iexED10
mov cx,514 ;2+512=514byte
jmp iexED70
iexED10:
cmp cl,0Dh
jnz iexED20
jmp iexED80
iexED20:
cmp cl,10h
jnz iexED90
cmp ah,1
jnz iexED90
jmp iexED80
iexED70:
push ds
mov si,[bp].pmUserDX ;offset address
mov ds,[bp].pmUserDS ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
pop cx
iexED80:
push ax
;-----------
mov ax,[bp].pmUserDS
mov [bp].intUserDS,ax
;------------------------------------------------------------
mov ax,[bp].pmUserDX
mov [bp].intUserDX,ax
pop ax
iexED90:
ret
DXPMCODE ends
;/////////////////////////////////////////////////////////////////////////
; Hmode no GRAPH ha INT 1Dh(Graph BIOS) niyori byouga sareru.
; DOSX deha,
;/////////////////////////////////////////////////////////////////////////
; -------------------------------------------------------
; PMIntr GRAPH BIOS
;--------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrGraph
;///////////////////////////////////////////////////////////////////////
;; extrn fNHmode:BYTE ;NHmode
;///////////////////////////////////////////////////////////////////////
PMIntrGraph:
;; test fNHmode,0FFh
;; jz GBios_Nmode
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
push ax
mov ax,[bp].pmUserDS
call GetSegmentAddress
shr dx,4
shl bx,12
or bx,dx ;bx now = seg of parent psp
mov [bp].intUserDS,bx
pop ax
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*1Dh] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov ax,ss
mov ds,ax
mov es,ax
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
;/////////////
push ax
mov ax,[bp].pmUserDS
mov [bp].intUserDS,ax
pop ax
;/////////////
;
; And return to the original caller.
call LeaveIntHandler
iret
DXPMCODE ends
DXPMCODE segment
assume cs:DXPMCODE
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntr11dummy
PMIntr11dummy proc near
and ax,0FFFDh
iret
PMIntr11dummy endp
DXPMCODE ends
endif ;NEC_98
DXPMCODE segment
assume cs:DXPMCODE
IFDEF WOW
public Wow32IntrRefl
Wow32IntrRefl label word
??intnum = 0
rept 256
push word ptr ??intnum
jmp Wow32Intr16Reflector
??intnum = ??intnum + 1
endm
;--------------------------------------------------------
;
; Wow32Intr16Reflector -- This routine reflects a 32 bit
; interrupt to a 16 bit handler. It switches to the
; dos extender stack to do so.
;
; Inputs: none
; Outputs: none
;
assume ds:nothing,es:nothing,ss:nothing
public Wow32Intr16Reflector
Wow32Intr16Reflector proc
.386p
push ebp
mov ebp,esp
push ds
push eax
push ebx
push edi
mov ax,ss
movzx eax,ax
lar eax,eax
test eax,(AB_BIG SHL 8)
jnz w32i16r10
movzx ebp,bp
w32i16r10:
;
; Get a frame on the dosx stack.
;
mov ax,selDgroupPM
mov ds,ax
assume ds:DGROUP
movzx ebx,pbReflStack
sub pbReflStack,CB_STKFRAME
;
; Build a frame on the stack
;
sub bx,30
mov eax, [ebp+6] ; eip
mov [bx+20], eax
mov eax, [ebp+10] ; cs
mov [bx+24], eax
mov [bx + 18],ss ; ss for stack switch back
mov eax,ebp
add eax,6 ; ebp, int number
mov [bx + 14],eax ; esp for stack switch back
mov ax,[ebp + 14] ; get flags
mov [bx + 12],ax
mov ax,cs
mov [bx + 10],ax
mov [bx + 8],offset DXPMCODE:w3216r30
mov eax,[ebp]
mov [bx],eax ; put ebp on other stack for pop
;
; Get handler
;
mov di,[ebp + 4] ; int number
shl di,2 ; al * 4
add di,offset DGROUP:Wow16BitHandlers
mov ax,[di]
mov [bx + 4],ax ; handler ip
mov ax,[di + 2]
mov [bx + 6],ax ; handler cs
;
; Set up for stack switch
;
push ds
push ebx
;
; Restore registers
;
mov ax,[ebp - 2]
mov ds,ax
mov eax,[ebp - 6]
mov ebx,[ebp - 10]
mov edi,[ebp - 14]
;
; Switch stacks, restore ebp, and call handler
;
lss esp,[ebp - 20]
pop ebp
retf
;
; N.B. i31_RMCall looks on the stack to get the original user stack pointer.
; if you change the stack frame the is passed to the 16 bit int
; handlers, that WILL break.
;
w3216r30:
;
; Switch stacks, deallocate frame from dosx stack and return
;
push ebx
push eax
push ds
lds ebx,[esp+10] ;get ss:esp
mov eax,[esp+16]
mov [ebx],eax ;eip
mov eax,[esp+20]
mov [ebx+4],eax ;cs
pop ds
pop eax
pop ebx
lss esp,[esp]
push ebx
pushfd
push eax
mov ax,ss
movzx eax,ax
lar eax,eax
test eax,(AB_BIG SHL 8) ; is the stack big?
jnz w32i16r40 ; jif yes, use 32bit operations
pop eax ; restore regs
popfd
rpushfd ; save flags, set virtual int bit
pop ebx
push ebp
movzx ebp, sp
mov [ebp + 16],ebx ; put flags on iret frame
pop ebp
push ds
mov bx,selDgroupPM
mov ds,bx
add pbReflStack,CB_STKFRAME
pop ds
pop ebx
riretd
w32i16r40: ; stack is big
pop eax ; restore regs
popfd
rpushfd32
pop ebx
mov [esp + 12],ebx
push ds
mov bx,selDgroupPM
mov ds,bx
add pbReflStack,CB_STKFRAME
pop ds
pop ebx
riretd32
.286p
Wow32Intr16Reflector endp
ENDIF
DXPMCODE ends
;
;****************************************************************
end
|
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DDLStatement.g4 | angelbi/shardingsphere | 0 | 6585 | <filename>shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DDLStatement.g4
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
grammar DDLStatement;
import BaseRule, DMLStatement, DCLStatement;
createTable
: createTableClause | createTableAsSelectClause
;
createTableClause
: CREATE TABLE tableName fileTableClause createDefinitionClause
;
createIndex
: CREATE createIndexSpecification INDEX indexName ON tableName columnNamesWithSort createIndexClause
;
createDatabase
: CREATE DATABASE databaseName createDatabaseClause
;
createFunction
: CREATE (OR ALTER)? FUNCTION functionName funcParameters funcReturns
;
createProcedure
: CREATE (OR ALTER)? (PROC | PROCEDURE) procedureName procParameters createOrAlterProcClause
;
createView
: CREATE (OR ALTER)? VIEW viewName createOrAlterViewClause
;
createTrigger
: CREATE (OR ALTER)? TRIGGER triggerName ON triggerTarget createTriggerClause
;
createSequence
: CREATE SEQUENCE sequenceName createOrAlterSequenceClause*
;
createService
: CREATE SERVICE serviceName (AUTHORIZATION STRING_)? ON QUEUE queueName createServiceClause?
;
createSchema
: CREATE SCHEMA schemaNameClause schemaElement*
;
alterTable
: ALTER TABLE tableName alterDefinitionClause (COMMA_ alterDefinitionClause)*
;
alterIndex
: ALTER INDEX (indexName | ALL) ON tableName alterIndexClause
;
alterDatabase
: ALTER DATABASE (databaseName | CURRENT) alterDatabaseClause*
;
alterProcedure
: ALTER (PROC | PROCEDURE) procedureName procParameters createOrAlterProcClause
;
alterFunction
: ALTER FUNCTION functionName funcParameters funcReturns
;
alterView
: ALTER VIEW viewName createOrAlterViewClause
;
alterTrigger
: ALTER TRIGGER triggerName ON triggerTarget createTriggerClause
;
alterSequence
: ALTER SEQUENCE sequenceName createOrAlterSequenceClause*
;
alterService
: ALTER SERVICE serviceName (ON QUEUE queueName)? alterServiceClause?
;
alterSchema
: ALTER SCHEMA schemaName TRANSFER class_? ignoredIdentifier
;
dropTable
: DROP TABLE ifExist? tableNames
;
dropIndex
: DROP INDEX ifExist? indexName ON tableName
;
dropDatabase
: DROP DATABASE ifExist? databaseName (COMMA_ databaseName)*
;
dropFunction
: DROP FUNCTION ifExist? functionName (COMMA_ functionName)*
;
dropProcedure
: DROP (PROC | PROCEDURE) ifExist? procedureName (COMMA_ procedureName)*
;
dropView
: DROP VIEW ifExist? viewName (COMMA_ viewName)*
;
dropTrigger
: DROP TRIGGER ifExist? triggerName (COMMA_ triggerName)* (ON (DATABASE | ALL SERVER))?
;
dropSequence
: DROP SEQUENCE ifExist? sequenceName (COMMA_ sequenceName)*
;
dropService
: DROP SERVICE serviceName
;
dropSchema
: DROP SCHEMA (IF EXISTS)? schemaName
;
truncateTable
: TRUNCATE TABLE tableName
;
fileTableClause
: (AS FILETABLE)?
;
createDefinitionClause
: createTableDefinitions partitionScheme fileGroup
;
createTableDefinitions
: LP_ createTableDefinition (COMMA_ createTableDefinition)* (COMMA_ periodClause)? RP_
;
createTableDefinition
: columnDefinition | computedColumnDefinition | columnSetDefinition | tableConstraint | tableIndex
;
columnDefinition
: columnName dataType columnDefinitionOption* columnConstraints columnIndex?
;
columnDefinitionOption
: FILESTREAM
| COLLATE collationName
| SPARSE
| MASKED WITH LP_ FUNCTION EQ_ STRING_ RP_
| (CONSTRAINT ignoredIdentifier)? DEFAULT expr
| IDENTITY (LP_ NUMBER_ COMMA_ NUMBER_ RP_)?
| NOT FOR REPLICATION
| GENERATED ALWAYS AS ROW (START | END) HIDDEN_?
| NOT? NULL
| ROWGUIDCOL
| ENCRYPTED WITH encryptedOptions
| columnConstraint (COMMA_ columnConstraint)*
| columnIndex
;
encryptedOptions
: LP_ COLUMN_ENCRYPTION_KEY EQ_ ignoredIdentifier COMMA_ ENCRYPTION_TYPE EQ_ (DETERMINISTIC | RANDOMIZED) COMMA_ ALGORITHM EQ_ STRING_ RP_
;
columnConstraint
: (CONSTRAINT constraintName)? (primaryKeyConstraint | columnForeignKeyConstraint | checkConstraint)
;
computedColumnConstraint
: (CONSTRAINT constraintName)? (primaryKeyConstraint | computedColumnForeignKeyConstraint | checkConstraint)
;
computedColumnForeignKeyConstraint
: (FOREIGN KEY)? tableName (LP_ columnName RP_)? computedColumnForeignKeyOnAction*
;
computedColumnForeignKeyOnAction
: ON DELETE (NO ACTION | CASCADE) | ON UPDATE NO ACTION | NOT FOR REPLICATION
;
primaryKeyConstraint
: (primaryKey | UNIQUE) (diskTablePrimaryKeyConstraintOption | memoryTablePrimaryKeyConstraintOption)
;
diskTablePrimaryKeyConstraintOption
: clusterOption? primaryKeyWithClause? primaryKeyOnClause?
;
clusterOption
: CLUSTERED | NONCLUSTERED
;
primaryKeyWithClause
: WITH (FILLFACTOR EQ_ NUMBER_ | LP_ indexOption (COMMA_ indexOption)* RP_)
;
primaryKeyOnClause
: onSchemaColumn | onFileGroup | onString
;
onSchemaColumn
: ON schemaName LP_ columnName RP_
;
onFileGroup
: ON ignoredIdentifier
;
onString
: ON STRING_
;
memoryTablePrimaryKeyConstraintOption
: NONCLUSTERED
| NONCLUSTERED HASH withBucket?
;
withBucket
: WITH LP_ BUCKET_COUNT EQ_ NUMBER_ RP_
;
columnForeignKeyConstraint
: (FOREIGN KEY)? REFERENCES tableName (LP_ columnName RP_)? foreignKeyOnAction*
;
foreignKeyOnAction
: ON (DELETE | UPDATE) foreignKeyOn | NOT FOR REPLICATION
;
foreignKeyOn
: NO ACTION | CASCADE | SET (NULL | DEFAULT)
;
checkConstraint
: CHECK(NOT FOR REPLICATION)? LP_ expr RP_
;
columnIndex
: INDEX indexName clusterOption? withIndexOption? indexOnClause? fileStreamOn?
;
withIndexOption
: WITH LP_ indexOption (COMMA_ indexOption)* RP_
;
indexOnClause
: onSchemaColumn | onFileGroup | onDefault
;
onDefault
: ON DEFAULT
;
fileStreamOn
: FILESTREAM_ON (ignoredIdentifier | schemaName | STRING_)
;
columnConstraints
: (columnConstraint(COMMA_ columnConstraint)*)?
;
computedColumnDefinition
: columnName AS expr (PERSISTED(NOT NULL)?)? computedColumnConstraint?
;
columnSetDefinition
: ignoredIdentifier IDENTIFIER_ COLUMN_SET FOR ALL_SPARSE_COLUMNS
;
tableConstraint
: (CONSTRAINT constraintName)? (tablePrimaryConstraint | tableForeignKeyConstraint | checkConstraint)
;
tablePrimaryConstraint
: primaryKeyUnique (diskTablePrimaryConstraintOption | memoryTablePrimaryConstraintOption)
;
primaryKeyUnique
: primaryKey | UNIQUE
;
diskTablePrimaryConstraintOption
: clusterOption? columnNames primaryKeyWithClause? primaryKeyOnClause?
;
memoryTablePrimaryConstraintOption
: NONCLUSTERED (columnNames | hashWithBucket)
;
hashWithBucket
: HASH columnNames withBucket
;
tableForeignKeyConstraint
: (FOREIGN KEY)? columnNames REFERENCES tableName columnNames foreignKeyOnAction*
;
tableIndex
: INDEX indexName indexNameOption (WITH indexOptions)? indexOnClause? fileStreamOn?
;
indexNameOption
: clusterOption? columnNames | CLUSTERED COLUMNSTORE | NONCLUSTERED? COLUMNSTORE columnNames
;
indexOptions
: LP_ indexOption (COMMA_ indexOption)* RP_
;
periodClause
: PERIOD FOR SYSTEM_TIME LP_ columnName COMMA_ columnName RP_
;
partitionScheme
: (ON (schemaName LP_ columnName RP_ | ignoredIdentifier | STRING_))?
;
fileGroup
: (TEXTIMAGE_ON (ignoredIdentifier | STRING_))? ((FILESTREAM_ON (schemaName) | ignoredIdentifier STRING_))? (WITH tableOptions)?
;
tableOptions
: LP_ tableOption (COMMA_ tableOption)* RP_
;
tableOption
: DATA_COMPRESSION EQ_ (NONE | ROW | PAGE) (ON PARTITIONS LP_ partitionExpressions RP_)?
| FILETABLE_DIRECTORY EQ_ ignoredIdentifier
| FILETABLE_COLLATE_FILENAME EQ_ (collationName | DATABASE_DEAULT)
| FILETABLE_PRIMARY_KEY_CONSTRAINT_NAME EQ_ ignoredIdentifier
| FILETABLE_STREAMID_UNIQUE_CONSTRAINT_NAME EQ_ ignoredIdentifier
| FILETABLE_FULLPATH_UNIQUE_CONSTRAINT_NAME EQ_ ignoredIdentifier
| SYSTEM_VERSIONING EQ_ ON onHistoryTableClause?
| REMOTE_DATA_ARCHIVE EQ_ (ON tableStretchOptions? | OFF migrationState_)
| tableOperationOption
| distributionOption
| dataWareHouseTableOption
| dataDelectionOption
| dataWareHousePartitionOption
;
dataDelectionOption
: DATA_DELETION EQ_ ON (LP_ FILTER_COLUMN EQ_ columnName COMMA_ RETENTION_PERIOD EQ_ historyRetentionPeriod)
;
tableStretchOptions
: LP_ tableStretchOption (COMMA_ tableStretchOption)* RP_
;
tableStretchOption
: (FILTER_PREDICATE EQ_ (NULL | functionCall) COMMA_)? MIGRATION_STATE EQ_ (OUTBOUND | INBOUND | PAUSED)
;
migrationState_
: LP_ MIGRATION_STATE EQ_ PAUSED RP_
;
tableOperationOption
: (MEMORY_OPTIMIZED EQ_ ON) | (DURABILITY EQ_ (SCHEMA_ONLY | SCHEMA_AND_DATA)) | (SYSTEM_VERSIONING EQ_ ON onHistoryTableClause?)
;
distributionOption
: DISTRIBUTION EQ_ (HASH LP_ columnName RP_ | ROUND_ROBIN | REPLICATE)
;
dataWareHouseTableOption
: CLUSTERED COLUMNSTORE INDEX | CLUSTERED COLUMNSTORE INDEX ORDER columnNames | HEAP | CLUSTERED INDEX LP_ (columnName (ASC | DESC)?) (COMMA_ (columnName (ASC | DESC)?))* RP_
;
dataWareHousePartitionOption
: (PARTITION LP_ columnName RANGE (LEFT | RIGHT)? FOR VALUES LP_ simpleExpr (COMMA_ simpleExpr)* RP_ RP_)
;
createIndexSpecification
: UNIQUE? clusterOption?
;
alterDefinitionClause
: addColumnSpecification | modifyColumnSpecification | alterDrop | alterCheckConstraint | alterTableTrigger | alterSwitch | alterSet | alterTableOption | REBUILD
;
addColumnSpecification
: (WITH (CHECK | NOCHECK))? ADD (alterColumnAddOptions | generatedColumnNamesClause)
;
modifyColumnSpecification
: alterColumnOperation dataType (COLLATE collationName)? (NULL | NOT NULL)? SPARSE?
;
alterColumnOperation
: ALTER COLUMN columnName
;
alterColumnAddOptions
: alterColumnAddOption (COMMA_ alterColumnAddOption)*
;
alterColumnAddOption
: columnDefinition
| computedColumnDefinition
| columnSetDefinition
| tableConstraint
| alterTableTableIndex
| constraintForColumn
;
constraintForColumn
: (CONSTRAINT constraintName)? DEFAULT simpleExpr FOR columnName
;
generatedColumnNamesClause
: generatedColumnNameClause COMMA_ periodClause | periodClause COMMA_ generatedColumnNameClause
;
generatedColumnNameClause
: generatedColumnName DEFAULT simpleExpr (WITH VALUES)? COMMA_ generatedColumnName
;
generatedColumnName
: columnName dataTypeName GENERATED ALWAYS AS ROW (START | END)? HIDDEN_? (NOT NULL)? (CONSTRAINT ignoredIdentifier)?
;
alterDrop
: DROP (alterTableDropConstraint | dropColumnSpecification | dropIndexSpecification | PERIOD FOR SYSTEM_TIME)
;
alterTableDropConstraint
: CONSTRAINT? ifExist? dropConstraintName (COMMA_ dropConstraintName)*
;
dropConstraintName
: constraintName dropConstraintWithClause?
;
dropConstraintWithClause
: WITH LP_ dropConstraintOption (COMMA_ dropConstraintOption)* RP_
;
dropConstraintOption
: (MAXDOP EQ_ NUMBER_ | ONLINE EQ_ onOffOption | MOVE TO (schemaName LP_ columnName RP_ | ignoredIdentifier | STRING_))
;
onOffOption
: ON | OFF
;
dropColumnSpecification
: COLUMN ifExist? columnName (COMMA_ columnName)*
;
dropIndexSpecification
: INDEX ifExist? indexName (COMMA_ indexName)*
;
alterCheckConstraint
: WITH? (CHECK | NOCHECK) CONSTRAINT (ALL | constraintName)
;
alterTableTrigger
: (ENABLE| DISABLE) TRIGGER (ALL | ignoredIdentifiers)
;
alterSwitch
: SWITCH (PARTITION expr)? TO tableName (PARTITION expr)? (WITH LP_ lowPriorityLockWait RP_)?
;
alterSet
: SET LP_ (setFileStreamClause | setSystemVersionClause) RP_
;
setFileStreamClause
: FILESTREAM_ON EQ_ (schemaName | ignoredIdentifier | STRING_)
;
setSystemVersionClause
: SYSTEM_VERSIONING EQ_ (OFF | ON alterSetOnClause?)
;
alterSetOnClause
: LP_ (HISTORY_TABLE EQ_ tableName)? dataConsistencyCheckClause? historyRetentionPeriodClause? RP_
;
dataConsistencyCheckClause
: COMMA_? DATA_CONSISTENCY_CHECK EQ_ onOffOption
;
historyRetentionPeriodClause
: COMMA_? HISTORY_RETENTION_PERIOD EQ_ historyRetentionPeriod
;
historyRetentionPeriod
: INFINITE | (NUMBER_ (DAY | DAYS | WEEK | WEEKS | MONTH | MONTHS | YEAR | YEARS))
;
alterTableTableIndex
: indexWithName (indexNonClusterClause | indexClusterClause)
;
indexWithName
: INDEX indexName
;
indexNonClusterClause
: NONCLUSTERED (hashWithBucket | columnNamesWithSort alterTableIndexOnClause?)
;
alterTableIndexOnClause
: ON ignoredIdentifier | DEFAULT
;
indexClusterClause
: CLUSTERED COLUMNSTORE (WITH COMPRESSION_DELAY EQ_ NUMBER_ MINUTES?)? indexOnClause?
;
alterTableOption
: SET LP_ LOCK_ESCALATION EQ_ (AUTO | TABLE | DISABLE) RP_
| MEMORY_OPTIMIZED EQ_ ON
| DURABILITY EQ_ (SCHEMA_ONLY | SCHEMA_AND_DATA)
| SYSTEM_VERSIONING EQ_ ON onHistoryTableClause?
;
onHistoryTableClause
: LP_ HISTORY_TABLE EQ_ tableName (COMMA_ DATA_CONSISTENCY_CHECK EQ_ onOffOption)? RP_
;
ifExist
: IF EXISTS
;
createDatabaseClause
: (CONTAINMENT EQ_ (NONE | PARTIAL))? fileDefinitionClause? (COLLATE ignoredIdentifier)? (WITH databaseOption (COMMA_ databaseOption)*)?
;
fileDefinitionClause
: ON PRIMARY? fileSpec (COMMA_ fileSpec)* (COMMA_ databaseFileGroup)* databaseLogOns
;
databaseOption
: FILESTREAM fileStreamOption (COMMA_ fileStreamOption)*
| DEFAULT_FULLTEXT_LANGUAGE EQ_ ignoredIdentifier
| DEFAULT_LANGUAGE EQ_ ignoredIdentifier
| NESTED_TRIGGERS EQ_ (OFF | ON)
| TRANSFORM_NOISE_WORDS EQ_ (OFF | ON)
| TWO_DIGIT_YEAR_CUTOFF EQ_ ignoredIdentifier
| DB_CHAINING (OFF | ON)
| TRUSTWORTHY (OFF | ON)
| PERSISTENT_LOG_BUFFER EQ_ ON (DIRECTORY_NAME EQ_ ignoredIdentifier)
;
fileStreamOption
: NON_TRANSACTED_ACCESS EQ_ ( OFF | READ_ONLY | FULL )
| DIRECTORY_NAME EQ_ ignoredIdentifier
;
fileSpec
: LP_ NAME EQ_ ignoredIdentifier COMMA_ FILENAME EQ_ STRING_ databaseFileSpecOption RP_
;
databaseFileSpecOption
: (COMMA_ SIZE EQ_ numberLiterals (KB | MB | GB | TB)?)?
(COMMA_ MAXSIZE EQ_ (numberLiterals (KB | MB | GB | TB)? | UNLIMITED))?
(COMMA_ FILEGROWTH EQ_ numberLiterals (KB | MB | GB | TB | MOD_)?)?
;
databaseFileGroup
: FILEGROUP ignoredIdentifier databaseFileGroupContains? fileSpec (COMMA_ fileSpec)*
;
databaseFileGroupContains
: (CONTAINS FILESTREAM)? DEFAULT? | CONTAINS MEMORY_OPTIMIZED_DATA
;
databaseLogOns
: (LOG ON fileSpec (COMMA_ fileSpec)*)?
;
declareVariable
: DECLARE (variable (COMMA_ variable)* | tableVariable)
;
variable
: variableName AS? dataType (EQ_ simpleExpr)?
| variableName CURSOR
;
tableVariable
: variableName AS? variTableTypeDefinition
;
variTableTypeDefinition
: TABLE LP_ tableVariableClause (COMMA_ tableVariableClause)* RP_
;
tableVariableClause
: variableTableColumnDefinition | variableTableConstraint
;
variableTableColumnDefinition
: columnName (dataTypeName | AS expr) (COLLATE collationName)? ((DEFAULT expr)? | IDENTITY (LP_ NUMBER_ COMMA_ NUMBER_ RP_)?) ROWGUIDCOL? variableTableColumnConstraint
;
variableTableColumnConstraint
: (NULL | NOT NULL)?
| (PRIMARY KEY | UNIQUE)?
| CHECK LP_ expr RP_
| WITH indexOption
;
variableTableConstraint
: (PRIMARY KEY | UNIQUE) LP_ columnName (COMMA_ columnName)* RP_
| CHECK expr
;
setVariable
: SET variableName setVariableClause
;
setVariableClause
: (DOT_ identifier)? EQ_ (expr | identifier DOT_ identifier | NCHAR_TEXT)
| compoundOperation expr
| EQ_ cursorVariable
| EQ_ LP_ select RP_
;
cursorVariable
: variableName
| CURSOR cursorClause FOR select (FOR (READ_ONLY | UPDATE (OF name (COMMA_ name)*)))
;
cursorClause
: (FORWARD_ONLY | SCROLL)? (STATIC | KEYSET | DYNAMIC | FAST_FORWARD)? (READ_ONLY | SCROLL_LOCKS | OPTIMISTIC)? (TYPE_WARNING)?
;
compoundOperation
: PLUS_ EQ_
| MINUS_ EQ_
| ASTERISK_ EQ_
| SLASH_ EQ_
| MOD_ EQ_
| AMPERSAND_ EQ_
| CARET_ EQ_
| VERTICAL_BAR_ EQ_
;
funcParameters
: LP_ (variableName AS? (owner DOT_)? dataType (EQ_ ignoredIdentifier)? READONLY?)* RP_
;
funcReturns
: funcScalarReturn | funcInlineReturn | funcMutiReturn
;
funcMutiReturn
: RETURNS variableName TABLE createTableDefinitions (WITH functionOption (COMMA_ functionOption)*)? AS? BEGIN compoundStatement RETURN END
;
funcInlineReturn
: RETURNS TABLE (WITH functionOption (COMMA_ functionOption)*)? AS? RETURN LP_? select RP_?
;
funcScalarReturn
: RETURNS dataType (WITH functionOption (COMMA_ functionOption)*)? AS? BEGIN compoundStatement RETURN expr
;
tableTypeDefinition
: (columnDefinition columnConstraint | computedColumnDefinition) tableConstraint*
;
compoundStatement
: validStatement*
;
functionOption
: ENCRYPTION?
| SCHEMABINDING?
| (RETURNS NULL ON NULL INPUT | CALLED ON NULL INPUT)?
| executeAsClause?
| (INLINE EQ_ ( ON | OFF ))?
;
validStatement
: (createTable | alterTable | dropTable | truncateTable | insert
| update | delete | select | setVariable | declareVariable) SEMI_?
;
procParameters
: (procParameter (COMMA_ procParameter)*)?
;
procParameter
: variable VARYING? (EQ_ literals)? (OUT | OUTPUT | READONLY)?
;
createOrAlterProcClause
: withCreateProcOption? (FOR REPLICATION)? AS procAsClause
;
withCreateProcOption
: WITH (procOption (COMMA_ procOption)*)?
;
procOption
: ENCRYPTION
| RECOMPILE
| executeAsClause
| NATIVE_COMPILATION
| SCHEMABINDING
;
procAsClause
: BEGIN? compoundStatement END?
| EXTERNAL NAME (owner DOT_)? (owner DOT_)? name
| BEGIN ATOMIC WITH procSetOption (COMMA_ procSetOption)* compoundStatement END?
;
procSetOption
: LANGUAGE EQ_ stringLiterals
| TRANSACTION ISOLATION LEVEL EQ_ ( SNAPSHOT | REPEATABLE READ | SERIALIZABLE )
| DATEFIRST EQ_ numberLiterals
| DATEFORMAT EQ_ stringLiterals
| DELAYED_DURABILITY EQ_ (OFF | ON )
;
createOrAlterViewClause
: (WITH viewAttribute (COMMA_ viewAttribute)*)? AS withCommonTableExpr? select (WITH CHECK OPTION)?
;
viewAttribute
: ENCRYPTION
| SCHEMABINDING
| VIEW_METADATA
;
withCommonTableExpr
: WITH commonTableExpr (COMMA_ commonTableExpr)*
;
commonTableExpr
: name (LP_ columnName (COMMA_ columnName)* RP_)? AS LP_ select RP_
;
createTriggerClause
: (WITH dmlTriggerOption COMMA_ dmlTriggerOption)? (FOR | AFTER | INSTEAD OF)
INSERT? COMMA_? UPDATE? COMMA_? DELETE? COMMA_? (WITH APPEND)? (NOT FOR REPLICATION)?
AS (compoundStatement | EXTERNAL NAME methodSpecifier)
;
dmlTriggerOption
: ENCRYPTION | executeAsClause | NATIVE_COMPILATION | SCHEMABINDING |
;
methodSpecifier
: name DOT_ name DOT_ name
;
triggerTarget
: tableName | viewName | ALL SERVER | DATABASE
;
createOrAlterSequenceClause
: AS dataType
| (START | RESTART) WITH expr
| INCREMENT BY expr
| MINVALUE expr? | NO MINVALUE
| MAXVALUE expr? | NO MAXVALUE
| CACHE expr | NO CACHE
| NO? CYCLE
;
createIndexClause
: (INCLUDE columnNamesWithSort)? (WHERE filterPredicate)? (WITH LP_ relationalIndexOption (COMMA_ relationalIndexOption)* RP_)?
(ON (schemaName LP_ columnName RP_ | name))? (FILESTREAM_ON (name | stringLiterals))?
;
filterPredicate
: conjunct (AND conjunct)*
;
conjunct
: columnName IN LP_ expr (COMMA_ expr)* RP_
| columnName comparisonOperator expr
;
alterIndexClause
: REBUILD (PARTITION EQ_ (ALL | expr))? (WITH LP_ relationalIndexOption (COMMA_ relationalIndexOption)* RP_)?
| DISABLE
| REORGANIZE (PARTITION EQ_ expr)? (WITH LP_ reorganizeOption RP_)?
| SET LP_ setIndexOption (COMMA_ setIndexOption) RP_
| RESUME (WITH LP_ resumableIndexOptions (COMMA_ resumableIndexOptions)* RP_)?
| PAUSE
| ABORT
;
relationalIndexOption
: PAD_INDEX EQ_ (ON | OFF)
| FILLFACTOR EQ_ expr
| SORT_IN_TEMPDB EQ_ (ON | OFF)
| IGNORE_DUP_KEY EQ_ (ON | OFF)
| STATISTICS_NORECOMPUTE EQ_ (ON | OFF)
| STATISTICS_INCREMENTAL EQ_ (ON | OFF)
| DROP_EXISTING EQ_ (ON | OFF)
| ONLINE EQ_ (ON lowPriorityLockWait? | OFF)
| RESUMABLE EQ_ (ON | OFF)
| MAX_DURATION EQ_ expr MINUTES?
| ALLOW_ROW_LOCKS EQ_ (ON | OFF)
| ALLOW_PAGE_LOCKS EQ_ (ON | OFF)
| OPTIMIZE_FOR_SEQUENTIAL_KEY EQ_ (ON | OFF)
| MAXDOP EQ_ expr
| DATA_COMPRESSION EQ_ (NONE | ROW | PAGE | COLUMNSTORE | COLUMNSTORE_ARCHIVE) (ON PARTITIONS LP_ partitionNumberRange (COMMA_ partitionNumberRange)*)?
;
partitionNumberRange
: expr (TO expr)?
;
reorganizeOption
: LOB_COMPACTION EQ_ (ON | OFF)
| COMPRESS_ALL_ROW_GROUPS EQ_ (ON | OFF)
;
setIndexOption
: ALLOW_ROW_LOCKS EQ_ (ON | OFF)
| ALLOW_PAGE_LOCKS EQ_ (ON | OFF)
| OPTIMIZE_FOR_SEQUENTIAL_KEY EQ_ (ON | OFF)
| IGNORE_DUP_KEY EQ_ (ON | OFF)
| STATISTICS_NORECOMPUTE EQ_ (ON | OFF)
| COMPRESSION_DELAY EQ_ (expr MINUTES?)
;
resumableIndexOptions
: MAXDOP EQ_ expr
| MAX_DURATION EQ_ expr MINUTES?
| lowPriorityLockWait
;
alterDatabaseClause
: MODIFY NAME EQ_ databaseName
| COLLATE ignoredIdentifier
| fileAndFilegroupOptions
| SET alterDatabaseOptionSpec (COMMA_ alterDatabaseOptionSpec)* (WITH termination)?
| MODIFY LP_ editionOptions (COMMA_ editionOptions)* RP_
| MODIFY BACKUP_STORAGE_REDUNDANCY EQ_ STRING_
| ADD SECONDARY ON SERVER ignoredIdentifier (WITH addSecondaryOption (COMMA_ addSecondaryOption)*)?
| FAILOVER
| FORCE_FAILOVER_ALLOW_DATA_LOSS
;
addSecondaryOption
: ALLOW_CONNECTIONS EQ_ (ALL | NO)
| SERVICE_OBJECTIVE EQ_ (serviceObjective | DATABASE_NAME EQ_ databaseName | SECONDARY_TYPE = (GEO | NAMED))
;
editionOptions
: MAXSIZE EQ_ NUMBER_ (MB | GB)
| EDITION EQ_ STRING_
| SERVICE_OBJECTIVE EQ_ (STRING_ | serviceObjective)
;
serviceObjective
: STRING_ | ELASTIC_POOL LP_ ignoredIdentifier EQ_ STRING_ RP_
;
alterDatabaseOptionSpec
: acceleratedDatabaseRecovery
| autoOption
| automaticTuningOption
| changeTrackingOption
| CONTAINMENT EQ_ (NONE | PARTIAL)
| cursorOption
| DATE_CORRELATION_OPTIMIZATION (ON | OFF)
| ENCRYPTION (ON | OFF | SUSPEND | RESUME)
| (ONLINE | OFFLINE | EMERGENCY)
| (READ_ONLY | READ_WRITE)
| (SINGLE_USER | RESTRICTED_USER | MULTI_USER)
| DELAYED_DURABILITY EQ_ (DISABLED | ALLOWED | FORCED)
| externalAccessOption
| FILESTREAM LP_ fileStreamOption RP_
| ALTER DATABASE SET HADR
| MIXED_PAGE_ALLOCATION (OFF | ON)
| PARAMETERIZATION (SIMPLE | FORCED)
| queryStoreOptions
| recoveryOption
| serviceBrokerOption
| snapshotOption
| sqlOption
| targetRecoveryTimeOption
| termination
| TEMPORAL_HISTORY_RETENTION (ON | OFF)
| DATA_RETENTION (ON | OFF)
;
fileAndFilegroupOptions
: addOrModifyFiles
| fileSpec
| addOrModifyFilegroups
| filegroupUpdatabilityOption
;
addOrModifyFilegroups
: ADD FILEGROUP ignoredIdentifier (CONTAINS FILESTREAM | CONTAINS MEMORY_OPTIMIZED_DATA)?
| REMOVE FILEGROUP ignoredIdentifier
| MODIFY FILEGROUP ignoredIdentifier filegroupUpdatabilityOption
| DEFAULT
| NAME EQ_ ignoredIdentifier
| (AUTOGROW_SINGLE_FILE | AUTOGROW_ALL_FILES)
;
filegroupUpdatabilityOption
: (READONLY | READWRITE) | (READ_ONLY | READ_WRITE)
;
addOrModifyFiles
: ADD FILE fileSpec (COMMA_ fileSpec)* (TO FILEGROUP ignoredIdentifier)?
| ADD LOG FILE fileSpec (COMMA_ fileSpec)*
| REMOVE FILE STRING_
| MODIFY FILE fileSpec
;
acceleratedDatabaseRecovery
: ACCELERATED_DATABASE_RECOVERY EQ_ (ON | OFF) (LP_ PERSISTENT_VERSION_STORE_FILEGROUP EQ_ ignoredIdentifier RP_)?
;
autoOption
: AUTO_CLOSE (ON | OFF)
| AUTO_CREATE_STATISTICS (OFF | ON (LP_ INCREMENTAL EQ_ (ON | OFF) RP_ )?)
| AUTO_SHRINK (ON | OFF)
| AUTO_UPDATE_STATISTICS (ON | OFF)
| AUTO_UPDATE_STATISTICS_ASYNC (ON | OFF)
;
automaticTuningOption
: AUTOMATIC_TUNING LP_ FORCE_LAST_GOOD_PLAN EQ_ (ON | OFF) RP_
;
changeTrackingOption
: CHANGE_TRACKING (EQ_ OFF | (EQ_ ON)? (LP_ changeTrackingOptionList (COMMA_ changeTrackingOptionList)* RP_)?)
;
changeTrackingOptionList
: AUTO_CLEANUP EQ_ (ON | OFF)
| CHANGE_RETENTION EQ_ NUMBER_ (DAYS | HOURS | MINUTES)
;
cursorOption
: CURSOR_CLOSE_ON_COMMIT (ON | OFF)
| CURSOR_DEFAULT (LOCAL | GLOBAL)
;
externalAccessOption
: DB_CHAINING (ON | OFF)
| TRUSTWORTHY (ON | OFF)
| DEFAULT_FULLTEXT_LANGUAGE EQ_ STRING_
| DEFAULT_LANGUAGE EQ_ STRING_
| NESTED_TRIGGERS EQ_ (OFF | ON)
| TRANSFORM_NOISE_WORDS EQ_ (OFF | ON)
| TWO_DIGIT_YEAR_CUTOFF EQ_ NUMBER_
;
queryStoreOptions
: QUERY_STORE (EQ_ OFF | (EQ_ ON)? (LP_ queryStoreOptionList (COMMA_ queryStoreOptionList)* RP_)?)
;
queryStoreOptionList
: OPERATION_MODE EQ_ (READ_WRITE | READ_ONLY)
| CLEANUP_POLICY EQ_ LP_ STALE_QUERY_THRESHOLD_DAYS EQ_ NUMBER_ RP_
| DATA_FLUSH_INTERVAL_SECONDS EQ_ NUMBER_
| MAX_STORAGE_SIZE_MB EQ_ NUMBER_
| INTERVAL_LENGTH_MINUTES EQ_ NUMBER_
| SIZE_BASED_CLEANUP_MODE EQ_ (AUTO | OFF)
| QUERY_CAPTURE_MODE EQ_ (ALL | AUTO | CUSTOM | NONE)
| MAX_PLANS_PER_QUERY EQ_ NUMBER_
| WAIT_STATS_CAPTURE_MODE EQ_ (ON | OFF)
| QUERY_CAPTURE_POLICY EQ_ LP_ queryCapturePolicyOptionList (COMMA_ queryCapturePolicyOptionList)* RP_
;
queryCapturePolicyOptionList
: STALE_CAPTURE_POLICY_THRESHOLD EQ_ NUMBER_ (DAYS | HOURS)
| EXECUTION_COUNT EQ_ NUMBER_
| TOTAL_COMPILE_CPU_TIME_MS EQ_ NUMBER_
| TOTAL_EXECUTION_CPU_TIME_MS EQ_ NUMBER_
;
recoveryOption
: RECOVERY (FULL | BULK_LOGGED | SIMPLE)
| TORN_PAGE_DETECTION (ON | OFF)
| PAGE_VERIFY (CHECKSUM | TORN_PAGE_DETECTION | NONE)
;
sqlOption
: ANSI_NULL_DEFAULT (ON | OFF)
| ANSI_NULLS (ON | OFF)
| ANSI_PADDING (ON | OFF)
| ANSI_WARNINGS (ON | OFF)
| ARITHABORT (ON | OFF)
| COMPATIBILITY_LEVEL EQ_ NUMBER_
| CONCAT_NULL_YIELDS_NULL (ON | OFF)
| NUMERIC_ROUNDABORT (ON | OFF)
| QUOTED_IDENTIFIER (ON | OFF)
| RECURSIVE_TRIGGERS (ON | OFF)
;
snapshotOption
: ALLOW_SNAPSHOT_ISOLATION (ON | OFF)
| READ_COMMITTED_SNAPSHOT (ON | OFF)
| MEMORY_OPTIMIZED_ELEVATE_TO_SNAPSHOT EQ_ (ON | OFF)
;
serviceBrokerOption
: ENABLE_BROKER
| DISABLE_BROKER
| NEW_BROKER
| ERROR_BROKER_CONVERSATIONS
| HONOR_BROKER_PRIORITY (ON | OFF)
;
targetRecoveryTimeOption
: TARGET_RECOVERY_TIME EQ_ NUMBER_ (SECONDS | MINUTES)
;
termination
: ROLLBACK AFTER NUMBER_ SECONDS?
| ROLLBACK IMMEDIATE
| NO_WAIT
;
createServiceClause
: LP_ contractName (COMMA_ contractName)* RP_
;
alterServiceClause
: LP_ alterServiceOptArg (COMMA_ alterServiceOptArg)* RP_
;
alterServiceOptArg
: ADD CONTRACT contractName
| DROP CONTRACT contractName
;
schemaNameClause
: schemaName
| AUTHORIZATION ignoredIdentifier
| schemaName AUTHORIZATION ignoredIdentifier
;
schemaElement
: createTable | createView | grant | revoke | deny
;
createTableAsSelectClause
: createTableAsSelect | createRemoteTableAsSelect
;
createTableAsSelect
: CREATE TABLE tableName columnNames? withDistributionOption AS select optionQueryHintClause
;
createRemoteTableAsSelect
: CREATE REMOTE TABLE tableName AT LP_ stringLiterals RP_ (WITH LP_ BATCH_SIZE EQ_ INT_NUM_ RP_)? AS select
;
withDistributionOption
: WITH LP_ distributionOption (COMMA_ tableOption (COMMA_ tableOption)*)? RP_
;
optionQueryHintClause
: (OPTION LP_ queryHint (COMMA_ queryHint)* RP_)?
;
|
oeis/022/A022925.asm | neoneye/loda-programs | 11 | 104194 | <reponame>neoneye/loda-programs
; A022925: Number of 5^m between 2^n and 2^(n+1).
; Submitted by <NAME>
; 0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1
add $0,1
mov $4,10
pow $4,$0
mov $5,1
lpb $4
mov $3,$4
cmp $3,0
add $4,$3
div $2,$4
cmp $5,0
cmp $5,0
add $2,$5
div $4,5
lpe
mov $0,$2
sub $0,1
|
test/annotation/test_null_annotation.ads | skill-lang/skillAdaTestSuite | 1 | 22089 | <gh_stars>1-10
package Test_Null_Annotation is
end Test_Null_Annotation;
|
test/Succeed/Issue4638-Cubical.agda | cagix/agda | 1,989 | 677 | {-# OPTIONS --cubical --safe #-}
open import Agda.Builtin.Cubical.Path
open import Agda.Primitive
private
variable
a : Level
A B : Set a
Is-proposition : Set a → Set a
Is-proposition A = (x y : A) → x ≡ y
data ∥_∥ (A : Set a) : Set a where
∣_∣ : A → ∥ A ∥
@0 trivial : Is-proposition ∥ A ∥
rec : @0 Is-proposition B → (A → B) → ∥ A ∥ → B
rec p f ∣ x ∣ = f x
rec p f (trivial x y i) = p (rec p f x) (rec p f y) i
|
Data/Proofs.agda | Lolirofle/stuff-in-agda | 6 | 8366 | <reponame>Lolirofle/stuff-in-agda
module Data.Proofs where
import Lvl
open import Data
open import Logic
open import Logic.Propositional
open import Structure.Setoid renaming (_≡_ to _≡ₛ_)
open import Structure.Function
open import Structure.Function.Domain
open import Structure.Function.Domain.Proofs
open import Structure.Relator.Equivalence
open import Structure.Relator.Properties
open import Type
open import Type.Properties.Empty
open import Type.Properties.Singleton
private variable ℓ ℓₑ ℓₑ₁ ℓₑ₂ ℓ₁ ℓ₂ : Lvl.Level
private variable T : Type{ℓ}
module General where
module _ {_▫_ : Empty{ℓ} → Empty{ℓ} → Stmt{ℓₑ}} where
Empty-equiv : Equiv(Empty)
Equiv._≡_ Empty-equiv = _▫_
Reflexivity.proof (Equivalence.reflexivity (Equiv.equivalence Empty-equiv)) {}
Symmetry.proof (Equivalence.symmetry (Equiv.equivalence Empty-equiv)) {}
Transitivity.proof (Equivalence.transitivity (Equiv.equivalence Empty-equiv)) {}
-- Any binary relation on Unit is an equivalence given that it is reflexive.
module _ {_▫_ : Unit{ℓ} → Unit{ℓ} → Stmt{ℓ}} ⦃ proof : (<> ▫ <>) ⦄ where
Unit-equiv : Equiv(Unit)
Equiv._≡_ Unit-equiv = (_▫_)
Reflexivity.proof (Equivalence.reflexivity (Equiv.equivalence Unit-equiv)) = proof
Symmetry.proof (Equivalence.symmetry (Equiv.equivalence Unit-equiv)) _ = proof
Transitivity.proof (Equivalence.transitivity (Equiv.equivalence Unit-equiv)) _ _ = proof
module _ where
open import Relator.Equals
instance
Empty-equiv : Equiv(Empty{ℓ})
Empty-equiv = General.Empty-equiv {_▫_ = _≡_}
instance
Unit-equiv : Equiv(Unit{ℓ})
Unit-equiv = General.Unit-equiv ⦃ [≡]-intro {x = <>} ⦄
{- TODO: So, why is this unprovable but Unit-IsUnit is? UIP? What is the difference?
module _ where
open import Relator.Equals.Proofs.Equiv
testee : ∀{T : Type{ℓ}}{a : T} → IsUnit{ℓ}(a ≡ a)
IsUnit.unit testee = [≡]-intro
IsUnit.uniqueness testee {x} = {!!}
-}
instance
-- `Unit` is an unit type.
Unit-IsUnit : ⦃ equiv : Equiv{ℓₑ}(Unit) ⦄ → IsUnit{ℓ}(Unit)
IsUnit.unit Unit-IsUnit = <>
IsUnit.uniqueness Unit-IsUnit = reflexivity(_≡ₛ_)
instance
-- `Empty` is an empty type.
Empty-IsEmpty : IsEmpty{ℓ}(Empty)
Empty-IsEmpty = intro(empty)
module _ ⦃ _ : Equiv{ℓₑ₁}(T) ⦄ ⦃ empty-equiv : Equiv{ℓₑ₂}(Empty{ℓ₂}) ⦄ where
instance
empty-injective : Injective ⦃ empty-equiv ⦄(empty{T = T})
Injective.proof(empty-injective) {}
instance
empty-function : Function ⦃ empty-equiv ⦄(empty{T = T})
Function.congruence empty-function {()}
module _ ⦃ equiv : Equiv{ℓₑ}(T) ⦄ where -- TODO: Duplicated in Type.Properties.Singleton.Proofs
Unit-fn-unique-value : ∀{f : Unit{ℓ} → T} → (∀{x y} → (f(x) ≡ₛ f(y)))
Unit-fn-unique-value {x = <>} {y = <>} = reflexivity(_≡ₛ_)
module _ ⦃ equiv : Equiv{ℓₑ}(Unit{ℓ₁}) ⦄ where
Unit-fn-unique-fn : ∀{f g : T → Unit{ℓ₁}} → (∀{x y} → (_≡ₛ_ ⦃ equiv ⦄ (f(x)) (g(y))))
Unit-fn-unique-fn {f = f}{g = g}{x = x}{y = y} with f(x) | g(y)
... | <> | <> = reflexivity(_≡ₛ_ ⦃ equiv ⦄)
|
Borland/CBuilder5/Source/RTL/source/math/atan2l.asm | TrevorDArcyEvans/DivingMagpieSoftware | 1 | 29879 | ;[]-----------------------------------------------------------------[]
;| ATAN2L.ASM -- trigonometric function |
;[]-----------------------------------------------------------------[]
;
; C/C++ Run Time Library - Version 10.0
;
; Copyright (c) 1991, 2000 by Inprise Corporation
; All Rights Reserved.
;
; $Revision: 9.0 $
include RULES.ASI
include _MATH.INC
; Segments Definitions
Header@
Data_Seg@
piBy2 dw 0C235H, 02168H, 0DAA2H, 0C90FH, 03FFFH
NANINVTRIG dw 00000H, 00000H, 00000H, 0C022H, 07FFFH
Data_EndS@
;--------------------------------------------------------------------------
;
;Name atan2l - trigonometric function
;
;Usage long double atan2l(long double y, long double x);
;
;Prototype in math.h
;
;Description atan2l returns the arc tangent of y/x and will produce
; correct results even when resulting is near pi/2 or -pi/2
; (x near 0).
;
;Return value atan2l returns a value in the range -pi to pi.
; If a ratio of 0/0 is supplied then _RANGE_VAL is returned
; and errno is set to:
; EDOM Domain error
;
;Caution: atan2l(+0,-1) = +pi but atan2l(-0,-1) = -pi.
;
;---------------------------------------------------------------------------
Code_Seg@
Func@ atan2l, _EXPFUNC, _RTLENTRY, <longdouble y>, <longdouble x>
Link@ ebx
FLD x.longdouble
mov ax, x [8] ; select MSW of x ..
mov bx, y [8] ; .. and of y
shl bx, 1 ; discard sign
FLD y.longdouble
jz at2_yIsZero
shl ax, 1 ; discard sign
jz at2_xIsZero
cmp ax, 0FFFEh
jnb at2_xIsInf
cmp bx, 0FFFEh
jnb at2_yIsInf
FDIVRP ST(1), ST(0)
f87 ArcTan
; convert the simple answer to a four quadrant answer.
at2_setQuad:
test BY0 (x [9]), 80h ; the sign bit
jz at2_end
FLDPI
test BY0 (y [9]), 80h
jz at2_2ndQuad
at2_3rdQuad:
FSUBP ST(1), ST
jmp short jmp_at2_end
at2_2ndQuad:
FADDP ST(1), ST
jmp short jmp_at2_end
; Special cases.
at2_yIsZero:
rcl cx, 1 ; save sign of y = 0
shl ax, 1
jz at2_indeterminate ; if both are zero
jc at2_retPi ; x<0, return Pi
fstp_st1 ; else y is result
jmp short at2_end
at2_retPi: ; y = 0, x < 0
FSTP ST(0) ; discard x and y
FSTP ST(0)
FLDPI ; and return PI
shr cx, 1 ; was y +0 or -0 ?
jnc at2_end
FCHS
jmp_at2_end:
jmp short at2_end
at2_xIsZero: ; and y is not zero
; or
at2_yIsInf: ; and x is finite
FSTP ST(0) ; discard x and y
FSTP ST(0)
FLD tbyte ptr (piBy2)
test BY0 (y [9]), 80h ; check sign of Y
jz at2_HPi ; positive - return PI/2
FCHS ; negative - return -PI/2
at2_HPi:
jmp short at2_end
at2_xIsInf:
cmp bx, 0FFFEh
jnb at2_indeterminate ; if both are infinite
FSTP ST(0) ; discard x and y
FSTP ST(0)
FLDZ
jmp short at2_setQuad
; There are two cases considered irresolvable: both operands zero, or
; both operands infinite.
at2_indeterminate: ; either equal or both infinite
FSTP ST(0) ; discard x and y
FSTP ST(0)
; return __matherrl (DOMAIN, "atan2l", &x, &y, *((long double *) NANINVTRIG));
matherrl DOMAIN, atan2l, x, y, NANINVTRIG
at2_end:
Unlink@ ebx
Return@
EndFunc@ atan2l
Code_Ends@
end
|
Task/Queue-Definition/Ada/queue-definition-11.ada | LaudateCorpus1/RosettaCodeData | 1 | 13814 | <reponame>LaudateCorpus1/RosettaCodeData
package body Asynchronous_Fifo is
----------
-- Fifo --
----------
protected body Fifo is
----------
-- Push --
----------
procedure Push (Item : Element_Type) is
begin
Value := Item;
Valid := True;
end Push;
---------
-- Pop --
---------
entry Pop (Item : out Element_Type) when Valid is
begin
Item := Value;
end Pop;
end Fifo;
end Asynchronous_Fifo;
|
Ada/src/fakelib/fakedsp-data_streams-wave.ads | fintatarta/fakedsp | 0 | 10498 | <filename>Ada/src/fakelib/fakedsp-data_streams-wave.ads
with Ada.Streams.Stream_IO;
use Ada;
package Fakedsp.Data_Streams.Wave is
type Wave_Source is limited new Data_Source with private;
type Wave_Source_Access is access Wave_Source;
function Open (Filename : String) return Wave_Source_Access;
procedure Read (Src : in out Wave_Source;
Sample : out Sample_Type;
End_Of_Stream : out Boolean;
Channel : Channel_Index := Channel_Index'First);
procedure Read (Src : in out Wave_Source;
Sample : out float;
End_Of_Stream : out Boolean;
Channel : Channel_Index := Channel_Index'First);
function Sampling_Frequency (Src : Wave_Source)
return Frequency_Hz;
function Max_Channel (Src : Wave_Source)
return Channel_Index;
procedure Close (src : in out Wave_Source);
type Wave_Destination is limited new Data_Destination with private;
type Wave_Destination_Access is access Wave_Destination;
function Open (Filename : String;
Sampling : Frequency_Hz;
Last_Channel : Channel_Index := 1)
return Wave_Destination_Access;
procedure Write (Dst : Wave_Destination;
Sample : Sample_Type;
Channel : Channel_Index := Channel_Index'First);
procedure Write (Dst : Wave_Destination;
Sample : Float;
Channel : Channel_Index := Channel_Index'First);
procedure Close (Dst : in out Wave_Destination);
function Max_Channel (Src : Wave_Destination) return Channel_Index;
Bad_Format : exception;
Unimplemented_Format: exception;
private
type Wave_Source is limited new Data_Source
with
record
File : Streams.Stream_IO.File_Type;
Top_Channel : Channel_Index;
Frequency : Frequency_Hz;
end record;
function Sampling_Frequency (Src : Wave_Source) return Frequency_Hz
is (Src.Frequency);
function Max_Channel (Src : Wave_Source) return Channel_Index
is (Src.Top_Channel);
type Wave_Destination is limited new Data_Destination with
record
File : Streams.Stream_IO.File_Type;
Top_Channel : Channel_Index;
Frequency : Frequency_Hz;
end record;
function Max_Channel (Src : Wave_Destination) return Channel_Index
is (Src.Top_Channel);
end Fakedsp.Data_Streams.Wave;
|
Rings/Divisible/Definition.agda | Smaug123/agdaproofs | 4 | 3306 | <reponame>Smaug123/agdaproofs<gh_stars>1-10
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Setoids.Setoids
open import Functions.Definition
open import Sets.EquivalenceRelations
open import Rings.Definition
module Rings.Divisible.Definition {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_+_ _*_ : A → A → A} (R : Ring S _+_ _*_) where
open Setoid S
open Equivalence eq
open Ring R
_∣_ : Rel A
a ∣ b = Sg A (λ c → (a * c) ∼ b)
divisibleWellDefined : {x y a b : A} → (x ∼ y) → (a ∼ b) → x ∣ a → y ∣ b
divisibleWellDefined x=y a=b (c , xc=a) = c , transitive (*WellDefined (symmetric x=y) reflexive) (transitive xc=a a=b)
|
dimension/cell/io/ui/kb/lang/english/english.asm | ekscrypto/Unununium | 7 | 10338 | ;; $Header:
;;
;; Keycode->UTF-8 english keyboard cell
;; By EKS - <NAME> (<EMAIL>)
;; Distributed under the BSD License
;;
;; This cell provides a kbd.set_unicode_client function and uses originally the
;; 'dragon' cell's kbd.set_keycode_client function to receives notification of
;; keycodes coming in.
;;
;; The unicode client hooked to this cell will be called with the following
;; paramters:
;;
;; AL = UTF-8 byte
;; EBX = modifiers
;; bit 0: left shift
;; bit 1: right shift
;; bit 2: capslock
;; bit 3: left alt
;; bit 4: right alt
;; bit 5: left ctrl
;; bit 6: right ctrl
;; bit 7: numlock
;;
;; If a unicode value longer than 1 character needs to be sent, successive
;; calls will be made to the client will be made.
;;
;; Initialization specifics:
;;--------------------------
;; Make sure that the 'dragon' cell or a compatible cell is loaded in memory
;; prior to loading this cell.
section .text
%define mod_lshift 0x01
%define mod_rshift 0x02
%define mod_lalt 0x04
%define mod_ralt 0x08
%define mod_lctrl 0x10
%define mod_rctrl 0x20
%define mod_capslock 0x40
%define mod_numlock 0x80
section .c_info
db 1,0,0,"a"
dd str_title
dd str_author
dd str_copyrights
str_title:
db "Dragon-Language/English",0
str_author:
db "eks",0
str_copyrights:
db "BSD Licsensed",0
section .c_init
global _start
_start:
mov esi, _keycode_client
externfunc kbd.set_keycode_client
retn
section .data
keyboard:
.selector: dd .keycodes
.modifiers: dd 0
.client: dd null_client
.keycodes:
db 0 ; keycode 00: nil
db 0x1B ; keycode 01: escape
db 0x80 ; keycode 02: F1 [escape sequence: ^[[11~ ]
db 0x81 ; keycode 03: F2 [escape sequence: ^[[12~ ]
db 0x82 ; keycode 04: F3 [escape sequence: ^[[13~ ]
db 0x83 ; keycode 05: F4 [escape sequence: ^[[14~ ]
db 0x84 ; keycode 06: F5 [escape sequence: ^[[15~ ]
db 0x85 ; keycode 07: F6 [escape sequence: ^[[17~ ]
db 0x86 ; keycode 08: F7 [escape sequence: ^[[18~ ]
db 0x87 ; keycode 09: F8 [escape sequence: ^[[19~ ]
db 0x88 ; keycode 0A: F9 [escape sequence: ^[[20~ ]
db 0x89 ; keycode 0B: F10 [escape sequence: ^[[21~ ]
db 0x8A ; keycode 0C: F11 [escape sequence: ^[[23~ ]
db 0x8B ; keycode 0D: F12 [escape sequence: ^[[24~ ]
db 0x60 ; keycode 0E: `
db 0x31 ; keycode 0F: 1
db 0x32 ; keycode 10: 2
db 0x33 ; keycode 11: 3
db 0x34 ; keycode 12: 4
db 0x35 ; keycode 13: 5
db 0x36 ; keycode 14: 6
db 0x37 ; keycode 15: 7
db 0x38 ; keycode 16: 8
db 0x39 ; keycode 17: 9
db 0x30 ; keycode 18: 0
db 0x2D ; keycode 19: -
db 0x3D ; keycode 1A: =
db 0x08 ; keycode 1B: BackSpace
db 0x09 ; keycode 1C: HorizontalTab
db 0x71 ; keycode 1D: q
db 0x77 ; keycode 1E: w
db 0x65 ; keycode 1F: e
db 0x72 ; keycode 20: r
db 0x74 ; keycode 21: t
db 0x79 ; keycode 22: y
db 0x75 ; keycode 23: u
db 0x69 ; keycode 24: i
db 0x6F ; keycode 25: o
db 0x70 ; keycode 26: p
db 0x5B ; keycode 27: [
db 0x5D ; keycode 28: ]
db 0x5C ; keycode 29: \
db 0xE6 ; keycode 2A: CapsLock [modifier]
db 0 ; *** NO CLUE WHY WE NEED THIS, BUT IT WORKS**
db 0x61 ; keycode 2B: a
db 0x73 ; keycode 2C: s
db 0x64 ; keycode 2D: d
db 0x66 ; keycode 2E: f
db 0x67 ; keycode 2F: g
db 0x68 ; keycode 30: h
db 0x6A ; keycode 31: j
db 0x6B ; keycode 32: k
db 0x6C ; keycode 33: l
db 0x3B ; keycode 34: ;
db 0x27 ; keycode 35: '
db 0x0A ; keycode 36: Enter (LineFeed)
db 0xE0 ; keycode 37: LeftShift [modifier]
db 0x7A ; keycode 38: z
db 0x78 ; keycode 39: x
db 0x63 ; keycode 3A: c
db 0x76 ; keycode 3B: v
db 0x62 ; keycode 3C: b
db 0x6E ; keycode 3D: n
db 0x6D ; keycode 3E: m
db 0x2C ; keycode 3F: ,
db 0x2E ; keycode 40: .
db 0x2F ; keycode 41: /
db 0xE1 ; keycode 42: RightShift [modifier]
db 0xE4 ; keycode 43: LeftCTRL [modifier]
db 0x8C ; keycode 44: Left 'System' key [escape sequence: ^[[3S ]
db 0xE2 ; keycode 45: LeftALT [modifier]
db 0x20 ; keycode 46: Space
db 0xE3 ; keycode 47: RightALT [modifier]
db 0x8D ; keycode 48: 'Menu' key [escape sequence: ^[[4S ]
db 0x8E ; keycode 49: Right 'System' key [escape sequence: ^[[5S ]
db 0xE5 ; keycode 4A: RightCTRL [modifier]
db 0 ; keycode 4B: unassigned
db 0 ; keycode 4C: unassigned
db 0 ; keycode 4D: unassigned
db 0 ; keycode 4E: unassigned
db 0 ; keycode 4F: unassigned
db 0 ; keycode 50: unassigned
db 0xE7 ; keycode 51: NumLock [modifier]
db 0xD5 ; keycode 52: Keypad / :: ^[Oo
db 0xD0 ; keycode 53: keypad * :: ^[Oj
db 0xD3 ; keycode 54: keypad - :: ^[Om
db 0xDD ; keycode 55: keypad 7 :: ^[Ow
db 0xDE ; keycode 56: keypad 8 :: ^[Ox
db 0xDF ; keycode 57: keypad 9 :: ^[Oy
db 0xDA ; keycode 58: keypad 4 :: ^[Ot
db 0xDB ; keycode 59: keypad 5 :: ^[Ou
db 0xDC ; keycode 5A: keypad 6 :: ^[Ov
db 0xD1 ; keycode 5B: keypad + :: ^[Ok
db 0xD7 ; keycode 5C: keypad 1 :: ^[Oq
db 0xD8 ; keycode 5D: keypad 2 :: ^[Or
db 0xD9 ; keycode 5E: keypad 3 :: ^[Os
db 0xD6 ; keycode 5F: keypad 0 :: ^[Op
db 0xD4 ; keycode 60: keypad . :: ^[On
db 0xD2 ; keycode 61: keypad Enter :: ^[OM
db 0x8F ; keycode 62: Insert [escape sequence: ^[[2~ ]
db 0x90 ; keycode 63: Delete [escape sequence: ^[[3~ ]
db 0x91 ; keycode 64: Home [escape sequence: ^[[4~ ]
db 0x92 ; keycode 65: End [escape sequence: ^[[5~ ]
db 0x93 ; keycode 66: PageUp [escape sequence: ^[[6~ ]
db 0x94 ; keycode 67: PageDn [escape sequence: ^[[7~ ]
db 0x95 ; keycode 68: UpArrow [escape sequence: ^[[A ]
db 0x96 ; keycode 69: LeftArrow [escape sequence: ^[[D ]
db 0x97 ; keycode 6A: DownArrow [escape sequence: ^[[B ]
db 0x98 ; keycode 6B: RightArrow [escape sequence: ^[[C ]
db 0x99 ; keycode 6C: PrintScreen [escape sequence: ^[[0S ]
db 0x9A ; keycode 6D: ScrollLock [escape sequence: ^[[1S ]
db 0x9B ; keycode 6E: Pause [escape sequence: ^[[2S ]
.keycode_size equ $- .keycodes
.shift:
db 0 ; keycode 00: nil
db 0x1B ; keycode 01: escape
db 0x8A ; keycode 02: F11 [escape sequence: ^[[23~ ]
db 0x8B ; keycode 03: F12 [escape sequence: ^[[24~ ]
db 0x9C ; keycode 04: F13 [escape sequence: ^[[25~ ]
db 0x9D ; keycode 05: F14 [escape sequence: ^[[26~ ]
db 0x9E ; keycode 06: F15 [escape sequence: ^[[28~ ]
db 0x9F ; keycode 07: F16 [escape sequence: ^[[29~ ]
db 0xA0 ; keycode 08: F17 [escape sequence: ^[[31~ ]
db 0xA1 ; keycode 09: F18 [escape sequence: ^[[32~ ]
db 0xA2 ; keycode 0A: F19 [escape sequence: ^[[33~ ]
db 0xA3 ; keycode 0B: F20 [escape sequence: ^[[34~ ]
db 0xA4 ; keycode 0C: F21 [escape sequence: ^[[23$ ]
db 0xA5 ; keycode 0D: F22 [escape sequence: ^[[24$ ]
db 0x7E ; keycode 0E: ~
db 0x21 ; keycode 0F: !
db 0x40 ; keycode 10: @
db 0x23 ; keycode 11: #
db 0x24 ; keycode 12: $
db 0x25 ; keycode 13: %
db 0x5E ; keycode 14: ^
db 0x26 ; keycode 15: &
db 0x2A ; keycode 16: *
db 0x28 ; keycode 17: (
db 0x29 ; keycode 18: )
db 0x5F ; keycode 19: _
db 0x2B ; keycode 1A: +
db 0x08 ; keycode 1B: BackSpace
db 0x09 ; keycode 1C: HorizontalTab
db 0x51 ; keycode 1D: Q
db 0x57 ; keycode 1E: W
db 0x45 ; keycode 1F: E
db 0x52 ; keycode 20: R
db 0x54 ; keycode 21: T
db 0x59 ; keycode 22: Y
db 0x55 ; keycode 23: U
db 0x49 ; keycode 24: I
db 0x4F ; keycode 25: O
db 0x50 ; keycode 26: P
db 0x7B ; keycode 27: {
db 0x7D ; keycode 28: }
db 0x7C ; keycode 29: |
db 0xE6 ; keycode 2A: CapsLock [modifier]
db 0x41 ; keycode 2B: A
db 0x53 ; keycode 2C: S
db 0x44 ; keycode 2D: D
db 0x46 ; keycode 2E: F
db 0x47 ; keycode 2F: G
db 0x48 ; keycode 30: H
db 0x4A ; keycode 31: J
db 0x4B ; keycode 32: K
db 0x4C ; keycode 33: L
db 0x3A ; keycode 34: :
db 0x22 ; keycode 35: "
db 0x0A ; keycode 36: Enter (LineFeed)
db 0xE0 ; keycode 37: LeftShift [modifier]
db 0x5A ; keycode 38: Z
db 0x58 ; keycode 39: X
db 0x43 ; keycode 3A: C
db 0x56 ; keycode 3B: V
db 0x42 ; keycode 3C: B
db 0x4E ; keycode 3D: N
db 0x4D ; keycode 3E: M
db 0x3C ; keycode 3F: <
db 0x3E ; keycode 40: >
db 0x3F ; keycode 41: ?
db 0xE1 ; keycode 42: RightShift [modifier]
db 0xE4 ; keycode 43: LeftCTRL [modifier]
db 0x8C ; keycode 44: Left 'System' key [escape sequence: ^[[3S ]
db 0xE2 ; keycode 45: LeftALT [modifier]
db 0x20 ; keycode 46: Space
db 0xE3 ; keycode 47: RightALT [modifier]
db 0x8D ; keycode 48: 'Menu' key [escape sequence: ^[[4S ]
db 0x8E ; keycode 49: Right 'System' key [escape sequence: ^[[5S ]
db 0xE5 ; keycode 4A: RightCTRL [modifier]
db 0 ; keycode 4B: unassigned
db 0 ; keycode 4C: unassigned
db 0 ; keycode 4D: unassigned
db 0 ; keycode 4E: unassigned
db 0 ; keycode 4F: unassigned
db 0 ; keycode 50: unassigned
db 0xE7 ; keycode 51: NumLock [modifier]
db 0xD5 ; keycode 52: Keypad / :: ^[Oo
db 0xD0 ; keycode 53: keypad * :: ^[Oj
db 0xD3 ; keycode 54: keypad - :: ^[Om
db 0xDD ; keycode 55: keypad 7 :: ^[Ow
db 0xDE ; keycode 56: keypad 8 :: ^[Ox
db 0xDF ; keycode 57: keypad 9 :: ^[Oy
db 0xDA ; keycode 58: keypad 4 :: ^[Ot
db 0xDB ; keycode 59: keypad 5 :: ^[Ou
db 0xDC ; keycode 5A: keypad 6 :: ^[Ov
db 0xD1 ; keycode 5B: keypad + :: ^[Ok
db 0xD7 ; keycode 5C: keypad 1 :: ^[Oq
db 0xD8 ; keycode 5D: keypad 2 :: ^[Or
db 0xD9 ; keycode 5E: keypad 3 :: ^[Os
db 0xD6 ; keycode 5F: keypad 0 :: ^[Op
db 0xD4 ; keycode 60: keypad . :: ^[On
db 0xD2 ; keycode 61: keypad Enter :: ^[OM
db 0xA6 ; keycode 62: Insert [escape sequence: ^[[2$ ]
db 0xA7 ; keycode 63: Delete [escape sequence: ^[[3$ ]
db 0xA8 ; keycode 64: Home [escape sequence: ^[[7$ ]
db 0xA9 ; keycode 65: End [escape sequence: ^[[8$ ]
db 0xAA ; keycode 66: PageUp [escape sequence: ^[[5$ ]
db 0xAB ; keycode 67: PageDn [escape sequence: ^[[6$ ]
db 0xAC ; keycode 68: UpArrow [escape sequence: ^[[a ]
db 0xAD ; keycode 69: LeftArrow [escape sequence: ^[[d ]
db 0xAE ; keycode 6A: DownArrow [escape sequence: ^[[b ]
db 0xAF ; keycode 6B: RightArrow [escape sequence: ^[[c ]
db 0x99 ; keycode 6C: PrintScreen [escape sequence: ^[[0S ]
db 0x9A ; keycode 6D: ScrollLock [escape sequence: ^[[1S ]
db 0x9B ; keycode 6E: Pause [escape sequence: ^[[2S ]
;----
.numlock_off_keys:
db 0xB0 ; * -> ^[Oj
db 0xB1 ; + -> ^[Ok
db 0xBF ; Enter -> ^[OM
db 0xB2 ; - -> ^[Om
db 0xB3 ; . -> ^[On
db 0xB4 ; / -> ^[Oo
db 0xB5 ; 0 -> ^[Op
db 0xB6 ; 1 -> ^[Oq
db 0xB7 ; 2 -> ^[Or
db 0xB8 ; 3 -> ^[Os
db 0xB9 ; 4 -> ^[Ot
db 0xBA ; 5 -> ^[Ou
db 0xBB ; 6 -> ^[Ov
db 0xBC ; 7 -> ^[Ow
db 0xBD ; 8 -> ^[Ox
db 0xBE ; 9 -> ^[Oy
align 4, db 0
.escape_sequences:
dd 0x31315B1B,0x0000007E ; 80: ^[[11~
dd 0x32315B1B,0x0000007E ; 81: ^[[12~
dd 0x33315B1B,0x0000007E ; 82: ^[[13~
dd 0x34315B1B,0x0000007E ; 83: ^[[14~
dd 0x35315B1B,0x0000007E ; 84: ^[[15~
dd 0x37315B1B,0x0000007E ; 85: ^[[17~
dd 0x38315B1B,0x0000007E ; 86: ^[[18~
dd 0x39315B1B,0x0000007E ; 87: ^[[19~
dd 0x30325B1B,0x0000007E ; 88: ^[[20~
dd 0x31325B1B,0x0000007E ; 89: ^[[21~
dd 0x33325B1B,0x0000007E ; 8A: ^[[23~
dd 0x34325B1B,0x0000007E ; 8B: ^[[24~
dd 0x33305B1B,0x00000053 ; 8C: ^[[03S
dd 0x34305B1B,0x00000053 ; 8D: ^[[04S
dd 0x35305B1B,0x00000053 ; 8E: ^[[05S
dd 0x7E325B1B,0x00000000 ; 8F: ^[[2~
dd 0x7E335B1B,0x00000000 ; 90: ^[[3~
dd 0x7E345B1B,0x00000000 ; 91: ^[[4~
dd 0x7E355B1B,0x00000000 ; 92: ^[[5~
dd 0x7E365B1B,0x00000000 ; 93: ^[[6~
dd 0x7E375B1B,0x00000000 ; 94: ^[[7~
dd 0x00415B1B,0x00000000 ; 95: ^[[A
dd 0x00445B1B,0x00000000 ; 96: ^[[D
dd 0x00425B1B,0x00000000 ; 97: ^[[B
dd 0x00435B1B,0x00000000 ; 98: ^[[C
dd 0x30305B1B,0x00000053 ; 99: ^[[00S
dd 0x31305B1B,0x00000053 ; 9A: ^[[01S
dd 0x32305B1B,0x00000053 ; 9B: ^[[02S
dd 0x35325B1B,0x0000007E ; 9C: ^[[25~
dd 0x36325B1B,0x0000007E ; 9D: ^[[26~
dd 0x38325B1B,0x0000007E ; 9E: ^[[28~
dd 0x39325B1B,0x0000007E ; 9F: ^[[29~
dd 0x31335B1B,0x0000007E ; A0: ^[[31~
dd 0x32335B1B,0x0000007E ; A1: ^[[32~
dd 0x33335B1B,0x0000007E ; A2: ^[[33~
dd 0x34335B1B,0x0000007E ; A3: ^[[34~
dd 0x33325B1B,0x00000024 ; A4: ^[[23$
dd 0x34325B1B,0x00000024 ; A5: ^[[24$
dd 0x24325B1B,0x00000000 ; A6: ^[[2$
dd 0x24335B1B,0x00000000 ; A7: ^[[3$
dd 0x24375B1B,0x00000000 ; A8: ^[[7$
dd 0x24385B1B,0x00000000 ; A9: ^[[8$
dd 0x24355B1B,0x00000000 ; AA: ^[[5$
dd 0x24365B1B,0x00000000 ; AB: ^[[6$
dd 0x00615B1B,0x00000000 ; AC: ^[[a
dd 0x00645B1B,0x00000000 ; AD: ^[[d
dd 0x00625B1B,0x00000000 ; AE: ^[[b
dd 0x00635B1B,0x00000000 ; AF: ^[[c
dd 0x006A4F1B,0x00000000 ; B0: ^[Oj
dd 0x006B4F1B,0x00000000 ; B1: ^[Ok
dd 0x006D4F1B,0x00000000 ; B2: ^[Om
dd 0x006E4F1B,0x00000000 ; B3: ^[On
dd 0x006F4F1B,0x00000000 ; B4: ^[Oo
dd 0x00704F1B,0x00000000 ; B5: ^[Op
dd 0x00714F1B,0x00000000 ; B6: ^[Oq
dd 0x00724F1B,0x00000000 ; B7: ^[Or
dd 0x00734F1B,0x00000000 ; B8: ^[Os
dd 0x00744F1B,0x00000000 ; B9: ^[Ot
dd 0x00754F1B,0x00000000 ; BA: ^[Ou
dd 0x00764F1B,0x00000000 ; BB: ^[Ov
dd 0x00774F1B,0x00000000 ; BC: ^[Ow
dd 0x00784F1B,0x00000000 ; BD: ^[Ox
dd 0x00794F1B,0x00000000 ; BE: ^[Oy
dd 0x004D4F1B,0x00000000 ; BF: ^[OM
section .text
release_keycode:
neg eax
cmp eax, byte keyboard.keycode_size
mov ebx, [keyboard.selector]
jnb short .exit
mov al, byte [eax + ebx]
sub al, 0xE0
jb short .exit
push ecx
mov cl, al
mov eax, 0xFFFFFFFE
rol eax, cl
cmp cl, 6
pop ecx
jnb short .exit
mov ebx, [keyboard.modifiers]
and ebx, eax
mov eax, ebx
jmp near _keycode_client.select_keymap
.exit:
retn
_keycode_client:
test eax, eax
js short release_keycode
cmp eax, byte keyboard.keycode_size
mov ebx, [keyboard.selector]
jnb short release_keycode.exit
mov al, byte [eax + ebx]
.analyze_key:
test al, al
js short .special_make_code
mov ebx, [keyboard.modifiers]
test bl, byte mod_lalt + mod_ralt
jz short .send_single_unicode
; prefix with ^[
push eax
mov al, 0x1B
push ebx
call [keyboard.client]
pop ebx
pop eax
.send_single_unicode:
test bl, mod_lctrl + mod_rctrl
jz short .send_to_client
call convert_control
.send_to_client:
jmp [keyboard.client]
.special_make_code:
cmp al, 0xD0
jb short .escape_sequence
sub al, 0xE0
jb near .keypad_keys
; modifiers
push ecx
mov cl, al
mov eax, 1
rol eax, cl
cmp cl, 6
pop ecx
jnb short .locked_modifiers
or eax, [keyboard.modifiers]
.select_keymap:
mov ebx, keyboard.shift
test al, mod_rshift + mod_lshift
jz short .unshifted_map_test
test al, mod_capslock
jz short .map_selected
.unshifted_map:
mov ebx, keyboard.keycodes
jmp short .map_selected
.unshifted_map_test:
test al, mod_capslock
jz short .unshifted_map
.map_selected:
mov [keyboard.selector], ebx
.modifiers_update:
mov [keyboard.modifiers], eax
.exit2:
retn
.locked_modifiers:
xor eax, [keyboard.modifiers]
jmp short .modifiers_update
.escape_sequence:
test [keyboard.modifiers], byte mod_lalt + mod_ralt
jz short .send_escape_sequence
; prefix with ^[
push eax
mov ebx, [keyboard.modifiers]
mov al, 0x1B
call [keyboard.client]
pop eax
.send_escape_sequence:
sub al, 0x80
movzx eax, al
lea ebx, [keyboard.escape_sequences + eax*8]
.processing_escape_sequence:
mov al, [ebx]
test al, al
jz short .exit2
push ebx
mov ebx, [keyboard.modifiers]
test bl, mod_lctrl + mod_rctrl
jz short .send_sequence_char
cmp al, '$'
jnz short .test_for_tilt
mov al, '@'
jmp short .send_sequence_char
.test_for_tilt:
cmp al, '~'
jnz short .send_sequence_char
mov al, '$'
.send_sequence_char:
call [keyboard.client]
pop ebx
inc ebx
jmp short .processing_escape_sequence
.keypad_keys:
test byte [keyboard.modifiers], byte mod_numlock
jz short .numlock_off
test byte [keyboard.modifiers], byte mod_lshift+mod_rshift
jnz short .keypad_forced_off
.keypad_forced_on:
add al, 0xE0-(0xD6-0x30)
jmp near .analyze_key
.numlock_off:
test byte [keyboard.modifiers], byte mod_lshift+mod_rshift
jnz short .keypad_forced_on
.keypad_forced_off:
add al, 0x10
movzx eax, al
mov al, [keyboard.numlock_off_keys + eax]
jmp near .analyze_key
convert_control:
cmp al, '@'
jb short .converted
cmp al, '_'
jbe short .convert_it
cmp al, 'z'
ja short .converted
sub al, 0x20
.convert_it:
sub al, 0x40
.converted:
null_client:
retn
globalfunc kbd.set_unicode_client
;------------------------------------------------------------------------------
;>
;; Allows to set the keyboard unicode (UTF-8) client
;;
;; parameters:
;;------------
;; esi = client's address (-1 to disconnect)
;;
;; returned value:
;;----------------
;; none, always successful
;<
;------------------------------------------------------------------------------
inc esi
jnz short .set_client
mov esi, null_client + 1
.set_client:
dec esi
mov [keyboard.client], esi
retn
;------------------------------------------------------------------------------
|
Code/VKDebug/Src/hexdump.asm | CherryDT/FbEditMOD | 11 | 12033 | <gh_stars>10-100
;-----------------------------------------------------------------------------
;HexDump2 function is written by NaN.
;-----------------------------------------------------------------------------
.386
.model flat, stdcall
option casemap: none
include VKDebug.inc
includelib kernel32.lib
includelib user32.lib
includelib masm32.lib
DebugProc proto :dword
.data?
dbbuf byte 128 dup (?)
.data
szFormat byte "%0.8X : %0.2X %0.2X %0.2X %0.2X - %0.2X %0.2X %0.2X %0.2X - %0.2X %0.2X %0.2X %0.2X - %0.2X %0.2X %0.2X %0.2X",0
szFormat2 byte "%0.8d : BYTES TOTAL",0
.code
HexDump2 proc lpData:DWORD, nLen:DWORD
LOCAL lns :DWORD
LOCAL Rmd :DWORD
mov eax, nLen
.if( eax ) ; If a valid sting length
shr eax, 4 ; Get divisions of 16
mov lns, eax ; Save it into Lns
mov eax, nLen
and eax, 0Fh ; Get the Remainder
mov Rmd, eax ; Save the Remainder
xor ebx, ebx ; Set EBX = 0
mov esi, lpData ; Get the data pointer
.while( ebx < lns ) ; While there is more to display
add esi, 15 ; Go to last byte
xor ecx, ecx ; ECX == NULL
xor eax, eax ; EAX == NULL
.while (ecx < 16) ; Get 16 Bytes!
mov al, [esi] ; Get byte
push eax ; Push DWORD
inc ecx ; Next count
dec esi ; back one byte
.endw
inc esi
push esi ; Push line address
push offset szFormat ; Push a format string
push offset dbbuf ; Push the buffer
call wsprintf ; call wsprintf to make it!
add esp, 04ch ; update the stack!
invoke DebugPrint, addr dbbuf ; Print the formated text
inc ebx ; Next Line
add esi, 16 ; Next 16 Bytes!
.endw
.if( Rmd )
dec esi
xor eax, eax ; eAX == NULL
mov ecx, 16 ; ECX = 16
sub ecx, Rmd ; ECX = 16 - Remainder (diff)
.while (ecx > 0) ; Loop thru difference
push eax ; Push NULL
dec ecx ; next
.endw
xor ecx, ecx ; ECX == NULL
add esi, Rmd ; Goto Last data byte
.while( ecx < Rmd ) ; Do last line (under 16)
mov al, [esi] ; Get byte
push eax ; push dword
inc ecx ; next count
dec esi ; back one byte
.endw
inc esi
push esi ; Push line address
push offset szFormat ; Push a format string
push offset dbbuf ; Push the buffer
call wsprintf ; call wsprintf to make it!
add esp, 04ch ; update the stack
invoke DebugPrint, addr dbbuf ; Print the formated text
.endif
invoke wsprintf, addr dbbuf, addr szFormat2, nLen
invoke DebugPrint, addr dbbuf
.endif
ret
HexDump2 endp
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.