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/074/A074523.asm | neoneye/loda | 22 | 5367 | <reponame>neoneye/loda
; A074523: a(n) = 1^n + 7^n + 8^n.
; 3,16,114,856,6498,49576,379794,2920696,22542018,174571336,1356217074,10567261336,82560763938,646644824296,5076269583954,39931933598776,314707907280258,2484430327672456,19642812107392434,155514083261229016
mov $1,7
pow $1,$0
mov $2,8
pow $2,$0
add $1,$2
mov $0,$1
add $0,1
|
source/resolver/program-resolve_standard.ads | reznikmm/gela | 0 | 563 | -- SPDX-FileCopyrightText: 2019-2021 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with System.Storage_Pools.Subpools;
with Program.Compilation_Units;
with Program.Cross_Reference_Updaters;
with Program.Library_Environments;
with Program.Visibility;
private
procedure Program.Resolve_Standard
(Unit : not null Program.Compilation_Units.Compilation_Unit_Access;
Context : aliased in out Program.Visibility.Context;
Library : in out Program.Library_Environments.Library_Environment;
Subpool : not null System.Storage_Pools.Subpools.Subpool_Handle;
Setter : not null
Program.Cross_Reference_Updaters.Cross_Reference_Updater_Access);
-- Resolve names in predefined Standard package.
-- This is simplified version of resolver that creates and polulates
-- name table for Standard package. It uses some implementation defined
-- tricks, because Standard package can't be expressed in Ada.
pragma Preelaborate (Program.Resolve_Standard);
|
programs/oeis/306/A306696.asm | karttu/loda | 0 | 161490 | ; A306696: Lexicographically earliest sequence of nonnegative terms such that for any n > 0 and k > 0, if a(n) >= a(n+k), then a(n+2*k) <> a(n+k).
; 0,0,1,0,1,1,2,0,2,1,3,1,2,2,3,0,3,2,4,1,3,3,4,1,4,2,5,2,4,3,5,0,5,3,6,2,4,4,6,1,5,3,7,3,5,4,6,1,6,4,7,2,5,5,7,2,6,4,8,3,6,5,7,0,7,5,8,3,6,6,8,2,7,4,9,4,7,6,8,1,8,5,9,3,7,7,9,3,8,5,10,4,8,6,9,1,9,6,10,4,8,7,10,2,9,5,11,5,9,7,10,2,10,6,11,4,8,8,11,3,10,6,12,5,9,7,11,0,11,7,12,5,9,8,12,3,10,6,13,6,10,8,12,2,11,7,13,4,9,9,13,4,11,7,14,6,10,8,12,1,12,8,14,5,10,9,13,3,11,7,15,7,11,9,13,3,12,8,14,5,10,10,14,4,12,8,15,6,11,9,13,1,13,9,15,6,11,10,14,4,12,8,16,7,12,10,14,2,13,9,15,5,11,11,15,5,13,9,16,7,12,10,14,2,14,10,16,6,12,11,15,4,13,8,17,8,13,11,15,3,14,10,16,6,12,12,16,5,14,9
mov $1,$0
mov $2,$0
lpb $2,1
mov $0,$2
lpb $0,1
trn $0,2
sub $1,1
lpe
sub $2,$1
trn $2,1
lpe
|
tools/scitools/conf/understand/ada/ada95/a-decima.ads | brucegua/moocos | 1 | 4670 | ------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- A D A . D E C I M A L --
-- --
-- S p e c --
-- --
-- $Revision: 2 $ --
-- --
-- This specification is adapted from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely --
-- copy and modify this specification, provided that if you redistribute a --
-- modified version, any changes that you have made are clearly indicated. --
-- --
------------------------------------------------------------------------------
package Ada.Decimal is
pragma Pure (Decimal);
-- The compiled makes a number of assumptions based on the following five
-- constants (e.g. there is an assumption that decimal values can always
-- be represented in 64-bit signed binary form), so code modifications are
-- required to increase these constants.
Max_Scale : constant := +18;
Min_Scale : constant := -18;
Min_Delta : constant := 1.0E-18;
Max_Delta : constant := 1.0E+18;
Max_Decimal_Digits : constant := 18;
generic
type Dividend_Type is delta <> digits <>;
type Divisor_Type is delta <> digits <>;
type Quotient_Type is delta <> digits <>;
type Remainder_Type is delta <> digits <>;
procedure Divide
(Dividend : in Dividend_Type;
Divisor : in Divisor_Type;
Quotient : out Quotient_Type;
Remainder : out Remainder_Type);
private
pragma Inline (Divide);
end Ada.Decimal;
|
maps/Route29.asm | Karkino/KarkCrystal16 | 0 | 94280 | <filename>maps/Route29.asm<gh_stars>0
object_const_def ; object_event constants
const ROUTE29_COOLTRAINER_M1
const ROUTE29_YOUNGSTER
const ROUTE29_TEACHER1
const ROUTE29_FRUIT_TREE
const ROUTE29_FISHER
const ROUTE29_COOLTRAINER_M2
const ROUTE29_TUSCANY
const ROUTE29_POKE_BALL
Route29_MapScripts:
db 2 ; scene scripts
scene_script .DummyScene0 ; SCENE_ROUTE29_NOTHING
scene_script .DummyScene1 ; SCENE_ROUTE29_CATCH_TUTORIAL
db 1 ; callbacks
callback MAPCALLBACK_OBJECTS, .Tuscany
.DummyScene0:
end
.DummyScene1:
end
.Tuscany:
checkflag ENGINE_ZEPHYRBADGE
iftrue .DoesTuscanyAppear
.TuscanyDisappears:
disappear ROUTE29_TUSCANY
return
.DoesTuscanyAppear:
readvar VAR_WEEKDAY
ifnotequal TUESDAY, .TuscanyDisappears
appear ROUTE29_TUSCANY
return
Route29Tutorial1:
turnobject ROUTE29_COOLTRAINER_M1, UP
showemote EMOTE_SHOCK, ROUTE29_COOLTRAINER_M1, 15
applymovement ROUTE29_COOLTRAINER_M1, DudeMovementData1a
turnobject PLAYER, LEFT
setevent EVENT_DUDE_TALKED_TO_YOU
opentext
writetext CatchingTutorialIntroText
yesorno
iffalse Script_RefusedTutorial1
closetext
follow ROUTE29_COOLTRAINER_M1, PLAYER
applymovement ROUTE29_COOLTRAINER_M1, DudeMovementData1b
stopfollow
loadwildmon RATTATA, 5
catchtutorial BATTLETYPE_TUTORIAL
turnobject ROUTE29_COOLTRAINER_M1, UP
opentext
writetext CatchingTutorialDebriefText
waitbutton
closetext
setscene SCENE_ROUTE29_NOTHING
setevent EVENT_LEARNED_TO_CATCH_POKEMON
end
Route29Tutorial2:
turnobject ROUTE29_COOLTRAINER_M1, UP
showemote EMOTE_SHOCK, ROUTE29_COOLTRAINER_M1, 15
applymovement ROUTE29_COOLTRAINER_M1, DudeMovementData2a
turnobject PLAYER, LEFT
setevent EVENT_DUDE_TALKED_TO_YOU
opentext
writetext CatchingTutorialIntroText
yesorno
iffalse Script_RefusedTutorial2
closetext
follow ROUTE29_COOLTRAINER_M1, PLAYER
applymovement ROUTE29_COOLTRAINER_M1, DudeMovementData2b
stopfollow
loadwildmon RATTATA, 5
catchtutorial BATTLETYPE_TUTORIAL
turnobject ROUTE29_COOLTRAINER_M1, UP
opentext
writetext CatchingTutorialDebriefText
waitbutton
closetext
setscene SCENE_ROUTE29_NOTHING
setevent EVENT_LEARNED_TO_CATCH_POKEMON
end
Script_RefusedTutorial1:
writetext CatchingTutorialDeclinedText
waitbutton
closetext
applymovement ROUTE29_COOLTRAINER_M1, DudeMovementData1b
setscene SCENE_ROUTE29_NOTHING
end
Script_RefusedTutorial2:
writetext CatchingTutorialDeclinedText
waitbutton
closetext
applymovement ROUTE29_COOLTRAINER_M1, DudeMovementData2b
setscene SCENE_ROUTE29_NOTHING
end
CatchingTutorialDudeScript:
faceplayer
opentext
readvar VAR_BOXSPACE
ifequal 0, .BoxFull
checkevent EVENT_LEARNED_TO_CATCH_POKEMON
iftrue .BoxFull
checkevent EVENT_GAVE_MYSTERY_EGG_TO_ELM
iffalse .BoxFull
writetext CatchingTutorialRepeatText
yesorno
iffalse .Declined
closetext
loadwildmon RATTATA, 5
catchtutorial BATTLETYPE_TUTORIAL
opentext
writetext CatchingTutorialDebriefText
waitbutton
closetext
setevent EVENT_LEARNED_TO_CATCH_POKEMON
end
.BoxFull:
writetext CatchingTutorialBoxFullText
waitbutton
closetext
end
.Declined:
writetext CatchingTutorialDeclinedText
waitbutton
closetext
end
Route29YoungsterScript:
jumptextfaceplayer Route29YoungsterText
Route29TeacherScript:
jumptextfaceplayer Route29TeacherText
Route29FisherScript:
jumptextfaceplayer Route29FisherText
Route29CooltrainerMScript:
faceplayer
opentext
checktime DAY
iftrue .day_morn
checktime NITE
iftrue .nite
.day_morn
writetext Route29CooltrainerMText_WaitingForNight
waitbutton
closetext
end
.nite
writetext Route29CooltrainerMText_WaitingForMorning
waitbutton
closetext
end
TuscanyScript:
faceplayer
opentext
checkevent EVENT_GOT_PINK_BOW_FROM_TUSCANY
iftrue TuscanyTuesdayScript
readvar VAR_WEEKDAY
ifnotequal TUESDAY, TuscanyNotTuesdayScript
checkevent EVENT_MET_TUSCANY_OF_TUESDAY
iftrue .MetTuscany
writetext MeetTuscanyText
buttonsound
setevent EVENT_MET_TUSCANY_OF_TUESDAY
.MetTuscany:
writetext TuscanyGivesGiftText
buttonsound
verbosegiveitem PINK_BOW
iffalse TuscanyDoneScript
setevent EVENT_GOT_PINK_BOW_FROM_TUSCANY
writetext TuscanyGaveGiftText
waitbutton
closetext
end
TuscanyTuesdayScript:
writetext TuscanyTuesdayText
waitbutton
TuscanyDoneScript:
closetext
end
TuscanyNotTuesdayScript:
writetext TuscanyNotTuesdayText
waitbutton
closetext
end
Route29Sign1:
jumptext Route29Sign1Text
Route29Sign2:
jumptext Route29Sign2Text
Route29FruitTree:
fruittree FRUITTREE_ROUTE_29
Route29Potion:
itemball POTION
DudeMovementData1a:
step UP
step UP
step UP
step UP
step RIGHT
step RIGHT
step_end
DudeMovementData2a:
step UP
step UP
step UP
step RIGHT
step RIGHT
step_end
DudeMovementData1b:
step LEFT
step LEFT
step DOWN
step DOWN
step DOWN
step DOWN
step_end
DudeMovementData2b:
step LEFT
step LEFT
step DOWN
step DOWN
step DOWN
step_end
CatchingTutorialBoxFullText:
text "#MON hide in"
line "the grass. Who"
para "knows when they'll"
line "pop out…"
done
CatchingTutorialIntroText:
text "I've seen you a"
line "couple times. How"
para "many #MON have"
line "you caught?"
para "Would you like me"
line "to show you how to"
cont "catch #MON?"
done
CatchingTutorialDebriefText:
text "That's how you do"
line "it."
para "If you weaken them"
line "first, #MON are"
cont "easier to catch."
done
CatchingTutorialDeclinedText:
text "Oh. Fine, then."
para "Anyway, if you"
line "want to catch"
para "#MON, you have"
line "to walk a lot."
done
CatchingTutorialRepeatText:
text "Huh? You want me"
line "to show you how to"
cont "catch #MON?"
done
Route29YoungsterText:
text "Yo. How are your"
line "#MON?"
para "If they're weak"
line "and not ready for"
para "battle, keep out"
line "of the grass."
done
Route29TeacherText:
text "See those ledges?"
line "It's scary to jump"
cont "off them."
para "But you can go to"
line "NEW BARK without"
para "walking through"
line "the grass."
done
Route29FisherText:
text "I wanted to take a"
line "break, so I saved"
para "to record my"
line "progress."
done
; unused
Text_WaitingForDay:
text "I'm waiting for"
line "#MON that"
para "appear only in the"
line "daytime."
done
Route29CooltrainerMText_WaitingForNight:
text "I'm waiting for"
line "#MON that"
para "appear only at"
line "night."
done
Route29CooltrainerMText_WaitingForMorning:
text "I'm waiting for"
line "#MON that"
para "appear only in the"
line "morning."
done
MeetTuscanyText:
text "TUSCANY: I do be-"
line "lieve that this is"
para "the first time"
line "we've met?"
para "Please allow me to"
line "introduce myself."
para "I am TUSCANY of"
line "Tuesday."
done
TuscanyGivesGiftText:
text "By way of intro-"
line "duction, please"
para "accept this gift,"
line "a PINK BOW."
done
TuscanyGaveGiftText:
text "TUSCANY: Wouldn't"
line "you agree that it"
cont "is most adorable?"
para "It strengthens"
line "normal-type moves."
para "I am certain it"
line "will be of use."
done
TuscanyTuesdayText:
text "TUSCANY: Have you"
line "met MONICA, my"
cont "older sister?"
para "Or my younger"
line "brother, WESLEY?"
para "I am the second of"
line "seven children."
done
TuscanyNotTuesdayText:
text "TUSCANY: Today is"
line "not Tuesday. That"
cont "is unfortunate…"
done
Route29Sign1Text:
text "ROUTE 29"
para "CHERRYGROVE CITY -"
line "NEW BARK TOWN"
done
Route29Sign2Text:
text "ROUTE 29"
para "CHERRYGROVE CITY -"
line "NEW BARK TOWN"
done
Route29_MapEvents:
db 0, 0 ; filler
db 1 ; warp events
warp_event 27, 1, ROUTE_29_ROUTE_46_GATE, 3
db 2 ; coord events
coord_event 53, 8, SCENE_ROUTE29_CATCH_TUTORIAL, Route29Tutorial1
coord_event 53, 9, SCENE_ROUTE29_CATCH_TUTORIAL, Route29Tutorial2
db 2 ; bg events
bg_event 51, 7, BGEVENT_READ, Route29Sign1
bg_event 3, 5, BGEVENT_READ, Route29Sign2
db 8 ; object events
object_event 50, 12, SPRITE_COOLTRAINER_M, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, CatchingTutorialDudeScript, -1
object_event 45, 10, SPRITE_YOUNGSTER, SPRITEMOVEDATA_WALK_UP_DOWN, 0, 1, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, Route29YoungsterScript, -1
object_event 18, 3, SPRITE_TEACHER, SPRITEMOVEDATA_WALK_LEFT_RIGHT, 1, 0, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, Route29TeacherScript, -1
object_event 20, 3, SPRITE_FRUIT_TREE, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Route29FruitTree, -1
object_event 25, 3, SPRITE_FISHER, SPRITEMOVEDATA_STANDING_UP, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT, 0, Route29FisherScript, -1
object_event 7, 13, SPRITE_COOLTRAINER_M, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, Route29CooltrainerMScript, -1
object_event 7, 7, SPRITE_TEACHER, SPRITEMOVEDATA_SPINRANDOM_SLOW, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, TuscanyScript, EVENT_ROUTE_29_TUSCANY_OF_TUESDAY
object_event 23, 13, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, Route29Potion, EVENT_ROUTE_29_POTION
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c2/c26006a.ada | best08618/asylo | 7 | 23113 | -- C26006A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT ALL ASCII CHARACTERS CAN APPEAR IN THE MIDDLE OF A STRING
-- (I.E., NONE ARE USED IN THE INTERNAL REPRESENTATION TO TERMINATE THE
-- STRING).
-- JRK 12/12/79
WITH REPORT;
PROCEDURE C26006A IS
USE REPORT;
S1 : STRING (1..3) := "A 1";
S2 : STRING (1..3) := "A 2";
BEGIN
TEST ("C26006A", "ALL ASCII CHARACTERS CAN APPEAR IN MIDDLE " &
"OF STRINGS");
FOR C IN CHARACTER'FIRST .. CHARACTER'LAST LOOP
S1 (2) := C;
S2 (2) := C;
IF S1 = S2 THEN
FAILED (CHARACTER'IMAGE(C) & " TERMINATED A " &
"STRING = COMPARISON");
END IF;
END LOOP;
RESULT;
END C26006A;
|
PQL2.g4 | mixedrays/pql-editor | 0 | 2918 | grammar PQL2;
/*============= Parser =============*/
query
: (csvBoolean)? EOF
;
csvBoolean
: infixBoolean (',' infixBoolean)* #csvBooleanExpression
;
infixBoolean
: operator=NOT infixBoolean #unaryBooleanExpression
| infixBoolean operator=AND infixBoolean #infixBooleanExpression
| infixBoolean operator=OR infixBoolean #infixBooleanExpression
| infixBoolean operator=NOT infixBoolean #infixBooleanExpression
| field=fieldRule '=' presense=(YES|NO|ALL) #presenceExpression
| infixProximity #infixProximityLink
;
infixProximity
: infixProximity operator=OperatorInfixSlopWord infixProximity #infixProximityExpression
| infixProximity operator=OperatorInfixSlopSentence infixProximity #infixOutlineProximityExpression
| infixProximity operator=OperatorInfixNotSentence infixProximity #infixProximityExpression
| infixProximity operator=OperatorInfixSlopParagraph infixProximity #infixOutlineProximityExpression
| infixProximity operator=OperatorInfixNotParagraph infixProximity #infixProximityExpression
| infixProximity operator=OperatorInfixField infixProximity #infixOutlineProximityExpression
| infixProximity operator=OperatorInfixNotFieldORParagraph infixProximity #infixProximityExpression
| infixProximity operator=OperatorInfixNOV infixProximity #infixProximityExpression
| implicitInfixProximity #implicitInfixProximityLink
;
implicitInfixProximity
: synonymOr (synonymOr)* #implicitInfixOutlineProximityExpression
;
synonymOr
: prefixOrRelational (operator=OperatorSynonymOR prefixOrRelational)+ #synonymBooleanOrExpression
| prefixOrRelational #prefixOrRelationalLink
;
prefixOrRelational
: expressionFraming #framingExpression
| expressionNoCapFraming #noCapFramingExpression
| prefixOrRelational (selector)+ #selectorExpression
| prefixOrRelational weight #weightExpression
| field=fieldRule operator=('>' | '>='| '<' | '<='| '=') term #equalityExpression
| prefixOrRelational operator=OperatorRelational term #relationalExpression
| operator=OperatorNoCap expressionPar #noCapExpression
| expressionPar #parenthesisExpression
| term #termExpression
| selector #likeSelectorExpression
;
expressionFraming: operator=OperatorFraming expressionList ')';
expressionNoCapFraming: operator=OperatorNoCapFraming expressionList ')' ;
expressionPar: '(' csvBoolean ')';
expressionList: infixBoolean (',' infixBoolean)+;
term
: TermWithExclusion
| FieldOrTerm
;
selector
: Selector
;
weight
: Weight
;
fieldRule
: FieldOrTerm
;
/*============= Lexer =============*/
OR: O R;
AND: A N D;
NOT: N O T;
YES: Y E S;
NO: N O;
ALL: A L L;
OperatorSynonymOR: '|';
OperatorNoCapFraming
: (OperatorNoCap WS*) OperatorFraming
;
OperatorFraming
: ('-')* Slop? (ORDERED_GROUP|UNORDERED_GROUP) WS* '('
;
OperatorInfixSlopWord
: ('!'|'-')* Slop? (WORD|DISTANCE)
;
OperatorInfixSlopSentence
: Slop? (SENTENCE)
;
OperatorInfixNotSentence
: ('!'|'-')* Slop? (SENTENCE)
| NOT_IN_SENTENCE
;
OperatorInfixSlopParagraph
: Slop? (PARAGRAPH|PARAGRAPH2)
;
OperatorInfixNotParagraph
: ('!'|'-')+ Slop? (PARAGRAPH|PARAGRAPH2)
| (NOT_IN_PARAGRAPH | NOT_IN_PARAGRAPH2)
;
OperatorInfixField
: FIELD
;
OperatorInfixNotFieldORParagraph
: '!' FIELD
| NOT_IN_FIELD
;
OperatorInfixNOV
: NO_OVERLAPPING
;
OperatorRelational: WS IN WS;
OperatorNoCap: '&';
Selector: ('/' | ':') FieldOrTerm;
Weight: '^' (Digit)+ ('.' Digit+)?;
FieldOrTerm
: Term
;
TermWithExclusion
: Term (WS* '!' WS*'(' WS* TermsList WS* ')')?
;
fragment
Term
: (OperatorNoCap WS*)? TermBlockCompound+
/*| ('~' | '$' | '*') Term*/
| '~' Term
;
fragment
TermsList
: Term (WS* ',' WS* Term)*
;
fragment
TermBlockCompound
: TermBlock+
| '[' WS* (TermWithExclusion)? (WS* ',' WS* (TermWithExclusion)?)* WS* ']'
;
fragment
TermBlock
: LetterTerm
| DateTerm
| NumericTerm
| QuotedTerm
| IntervalLetterTerm
| IntervalDigitTerm
| RangeNaturalNumberTerm
| RangeNumberTerm
| WildcardTerm
;
fragment
LetterTerm: Letter+;
fragment
NumericTerm: RealNumber;
fragment
DateTerm: Year ('-' Month ('-' Day)?)?;
fragment
Year
: '1' ('8'..'9') Digit Digit
| '2' Digit Digit Digit
;
fragment
Month
: '0' ('1'..'9')
| '1' ('1'..'2')
;
fragment
Day
: '0' ('1'..'9')
| '1'..'2' ('0'..'9')
| '3' ('0'..'1')
;
fragment
QuotedTerm: '"' ~('"')* '"';
fragment
IntervalLetterTerm: Letter '-' Letter;
fragment
IntervalDigitTerm: Digit '-' Digit;
fragment
RangeNumberTerm: RealNumber WS* ':' WS* RealNumber;
fragment
RangeNaturalNumberTerm: NaturalNumber WS* '-' WS* NaturalNumber;
fragment
WildcardTerm: '?' | '+' | '#';
fragment
NaturalNumber: Digit+;
fragment
RealNumber: ('-')? (Digit)+ ('.' Digit+)?;
fragment
Digit: '0'..'9';
fragment
Slop
: '0'
| ('1'..'9') Digit*
;
fragment
Letter: ~[,!()[\]{}"| \t\r\n=<>?+#0123456789^];
fragment A:('a'|'A');
fragment B:('b'|'B');
fragment C:('c'|'C');
fragment D:('d'|'D');
fragment E:('e'|'E');
fragment F:('f'|'F');
fragment G:('g'|'G');
fragment H:('h'|'H');
fragment I:('i'|'I');
fragment J:('j'|'J');
fragment K:('k'|'K');
fragment L:('l'|'L');
fragment M:('m'|'M');
fragment N:('n'|'N');
fragment O:('o'|'O');
fragment P:('p'|'P');
fragment Q:('q'|'Q');
fragment R:('r'|'R');
fragment S:('s'|'S');
fragment T:('t'|'T');
fragment U:('u'|'U');
fragment V:('v'|'V');
fragment W:('w'|'W');
fragment X:('x'|'X');
fragment Y:('y'|'Y');
fragment Z:('z'|'Z');
ORDERED_GROUP: O G;
UNORDERED_GROUP: U G;
WORD: W;
DISTANCE: D;
SENTENCE: S;
PARAGRAPH: P;
PARAGRAPH2: L;
FIELD: F;
NOT_IN_SENTENCE: N O T S;
NOT_IN_PARAGRAPH: N O T P;
NOT_IN_PARAGRAPH2: N O T L;
NOT_IN_FIELD: N O T F;
NO_OVERLAPPING: N O V;
IN: I N;
WS: [ \t\r\n] -> skip;
COMMENT : '{' (COMMENT | ~[{}])* '}' -> skip;
|
experiments/models/dijkstra.als | kaiyuanw/MuAlloy | 6 | 4576 | module dijkstra
open util/ordering [State] as so
open util/ordering [Mutex] as mo
sig Process {}
sig Mutex {}
sig State { holds, waits: Process -> Mutex }
pred Initial [s: State] { no s.holds + s.waits }
pred IsFree [s: State, m: Mutex] {
no m.~(s.holds)
}
pred IsStalled [s: State, p: Process] { some p.(s.waits) }
pred GrabMutex [s: State, p: Process, m: Mutex, s': State] {
!s.IsStalled[p]
m !in p.(s.holds)
all m': p.(s.holds) | mo/lt[m',m]
s.IsFree[m] => {
p.(s'.holds) = p.(s.holds) + m
no p.(s'.waits)
} else {
p.(s'.holds) = p.(s.holds)
p.(s'.waits) = m
}
all otherProc: Process - p | {
otherProc.(s'.holds) = otherProc.(s.holds)
otherProc.(s'.waits) = otherProc.(s.waits)
}
}
pred ReleaseMutex [s: State, p: Process, m: Mutex, s': State] {
!s.IsStalled[p]
m in p.(s.holds)
p.(s'.holds) = p.(s.holds) - m
no p.(s'.waits)
no m.~(s.waits) => {
no m.~(s'.holds)
no m.~(s'.waits)
} else {
some lucky: m.~(s.waits) | {
m.~(s'.waits) = m.~(s.waits) - lucky
m.~(s'.holds) = lucky
}
}
all mu: Mutex - m {
mu.~(s'.waits) = mu.~(s.waits)
mu.~(s'.holds)= mu.~(s.holds)
}
}
pred GrabOrRelease {
Initial[so/first] &&
(
all pre: State - so/last | let post = so/next [pre] |
(post.holds = pre.holds && post.waits = pre.waits)
||
(some p: Process, m: Mutex | pre.GrabMutex [p, m, post])
||
(some p: Process, m: Mutex | pre.ReleaseMutex [p, m, post])
)
}
pred Deadlock {
some Process
some s: State | all p: Process | some p.(s.waits)
}
assert DijkstraPreventsDeadlocks {
GrabOrRelease => ! Deadlock
}
pred ShowDijkstra {
GrabOrRelease && Deadlock
some waits
}
run Deadlock for 3 expect 1
run ShowDijkstra for 5 State, 2 Process, 2 Mutex expect 1
check DijkstraPreventsDeadlocks for 5 State, 5 Process, 4 Mutex expect 0
|
ssu-sys-programming/src/lab2/task1.asm | Imperat/SSU-Information-Security-Course | 0 | 18926 | <reponame>Imperat/SSU-Information-Security-Course
.model small
.stack 100h
.data
D_ONE dw 04h
D_TWO dw 03h
SPACE db 20h
.code
printd proc
mov bh, al
mov ah, 02h
int 21h
mov al, bh
ret
printd endp
start: mov ax, @data
mov ds, ax
;Запись цифр в регистры
mov ax, D_ONE
add ax, 30h
mov bx, D_TWO
add bx, 30h
;Вывод первой цифры
mov dl, al
call printd
;Вывод пробела
mov dl, SPACE
mov ah, 02h
int 21h
;Вывод второй
mov dl, bl
call printd
mov dx, 13
int 21h
mov ah, 02h
mov dx, 10
int 21h
mov ax, 4c00h
int 21h
end start |
src/run_basic.asm | I8087/libm | 13 | 173967 | global _run_basic
_run_basic:
push bp
mov bp, sp
sub sp, 4
mov [bp-2], bx
mov [bp-4], si
mov ax, word [bp+4]
mov bx, word [bp+6]
mov si, word [bp+8]
call os_run_basic
mov si, word [bp-4]
mov bx, word [bp-2]
mov sp, bp
pop bp
ret
|
Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2.log_18045_119.asm | ljhsiun2/medusa | 9 | 13188 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r14
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x2d80, %r12
nop
nop
nop
dec %rcx
movw $0x6162, (%r12)
nop
sub %r12, %r12
lea addresses_normal_ht+0xa580, %rsi
lea addresses_WC_ht+0x5102, %rdi
nop
nop
dec %r14
mov $25, %rcx
rep movsb
nop
nop
nop
nop
nop
dec %r14
lea addresses_D_ht+0x12d80, %rdi
nop
nop
nop
nop
nop
inc %r14
movl $0x61626364, (%rdi)
nop
nop
nop
nop
add %r10, %r10
lea addresses_UC_ht+0x15b80, %r14
nop
nop
nop
sub %rbx, %rbx
mov $0x6162636465666768, %r12
movq %r12, %xmm5
vmovups %ymm5, (%r14)
nop
nop
nop
and %rdi, %rdi
lea addresses_WT_ht+0xff20, %rsi
nop
nop
nop
dec %rbx
mov $0x6162636465666768, %r10
movq %r10, %xmm0
vmovups %ymm0, (%rsi)
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_WC_ht+0xdde4, %rsi
lea addresses_A_ht+0xcca0, %rdi
nop
cmp %r10, %r10
mov $82, %rcx
rep movsb
nop
nop
inc %rdi
lea addresses_WT_ht+0xd0a8, %rdi
nop
nop
nop
nop
sub $64156, %rsi
mov (%rdi), %r12w
nop
xor $41722, %rsi
lea addresses_UC_ht+0x4080, %r10
sub $62167, %rcx
movw $0x6162, (%r10)
nop
nop
sub $20638, %rdi
lea addresses_normal_ht+0x9b40, %rbx
nop
nop
nop
nop
lfence
movb (%rbx), %r12b
nop
nop
cmp $3109, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r8
push %r9
push %rbx
push %rdi
// Store
lea addresses_A+0x154c8, %r9
nop
nop
nop
nop
nop
sub %r10, %r10
movl $0x51525354, (%r9)
nop
dec %rbx
// Store
lea addresses_US+0x2668, %r11
nop
nop
nop
nop
nop
add %r8, %r8
mov $0x5152535455565758, %rdi
movq %rdi, %xmm7
movaps %xmm7, (%r11)
nop
nop
nop
nop
sub %r11, %r11
// Store
lea addresses_normal+0x1125e, %r8
clflush (%r8)
nop
nop
nop
nop
add %r14, %r14
movw $0x5152, (%r8)
nop
nop
and $12147, %r11
// Faulty Load
lea addresses_US+0x17580, %r10
clflush (%r10)
nop
nop
nop
nop
dec %r11
mov (%r10), %edi
lea oracles, %r14
and $0xff, %rdi
shlq $12, %rdi
mov (%r14,%rdi,1), %rdi
pop %rdi
pop %rbx
pop %r9
pop %r8
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 16, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'00': 18045}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
grammar/ObjectPath.g4 | zakjan/object-path-parser | 12 | 3547 | grammar ObjectPath;
// parser rules
start : expression? EOF ;
expression : '(' expression ')' # Parentheses
// access expressions
| '$' # RootObject
| '@' # CurrentObject
| IDENTIFIER # DotAccess // shorthand for expr1 = @
| expr1=expression '.' IDENTIFIER # DotAccess
| '[' expr2=expression ']' # BracketAccess // shorthand for expr1 = @
| expr1=expression '[' expr2=expression ']' # BracketAccess
| 'find(' expr2=expression ')' # ArrayFilter // shorthand for expr1 = @
| expr1=expression '.' 'find(' expr2=expression ')' # ArrayFind
| 'filter(' expr2=expression ')' # ArrayFilter // shorthand for expr1 = @
| expr1=expression '.' 'filter(' expr2=expression ')' # ArrayFilter
| 'map(' expr2=expression ')' # ArrayMap // shorthand for expr1 = @
| expr1=expression '.' 'map(' expr2=expression ')' # ArrayMap
// functions
| IDENTIFIER '(' ((expression ',')* expression)? ')' # Function
// operators
| op=('+'|'-') expression # Unary
| '!' expression # UnaryLogicalNot
| expression op=('*'|'/') expression # Multiplicative
| expression op=('+'|'-') expression # Additive
| expression op=('<'|'>'|'<='|'>=') expression # Relational
| expression op=('=='|'!=') expression # Equality
| expression '??' expression # NullishCoalescing
| expression '&&' expression # LogicalAnd
| expression '||' expression # LogicalOr
| <assoc=right> expression '?' expression ':' expression # Conditional
// primitives
| STRING # String
| NUMBER # Number
| BOOLEAN # Boolean
| NULL # Null
;
// lexer rules
STRING : '\'' ~'\''* '\'' ;
NUMBER : ('0' | [1-9] [0-9]*) ;
BOOLEAN : 'true' | 'false' ;
NULL : 'null' ;
IDENTIFIER : [a-zA-Z_$] [a-zA-Z0-9_$]* ;
WHITESPACE : ' ' -> skip ;
|
src/lab-code/calendar_package/src/main.adb | hannesb0/rtpl18 | 0 | 23238 | with Ada.Text_IO;
use Ada.Text_IO;
with mycalendar;
use mycalendar;
procedure main is
--variables
today_weekday : weekday;
today_monthnum : monthnum;
today_daynum : daynum;
begin
-- GET DAY
Put ("What weekday is today (");
for w in weekday'Range loop
Put(weekday'Image(w)); Put("/");
end loop;
Put (")? ");
today_weekday := weekday'value(ada.Text_IO.Get_Line);
-- GET MONTH
Put("What month is today (");
for w in monthnum'Range loop
Put(monthnum'Image(w)); Put("/");
end loop;
Put (")? ");
today_monthnum := monthnum'value(ada.Text_IO.get_line);
-- GET DAY OF MONTH
Put("What day of the month is today (");
for w in daynum'Range loop
Put(daynum'Image(w)); Put("/");
end loop;
Put (")? ");
today_daynum := daynum'value(ada.Text_IO.get_line);
Put_Line("----------------------");
Put_Line(" => Today is " & weekday'Image(today_weekday) & ", " & monthname'Image(monthname'val(today_monthnum - 1)) & " " & daynum'Image(today_daynum));
Put_Line("----------------------"); new_line;
mycalendar.makecal(w => today_weekday, m => today_monthnum, d => today_daynum); -- named parameters
end main;
|
coverage/PENDING_SUBMIT/amdvlk/0609-COVERAGE-instruction-simplify-4452/work/variant/2_spirv_opt_asm/shader.frag.asm | asuonpaa/ShaderTests | 0 | 80684 | <filename>coverage/PENDING_SUBMIT/amdvlk/0609-COVERAGE-instruction-simplify-4452/work/variant/2_spirv_opt_asm/shader.frag.asm
; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 102
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main" %56
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 320
OpName %4 "main"
OpName %8 "func("
OpName %11 "i"
OpName %15 "buf0"
OpMemberName %15 0 "_GLF_uniform_int_values"
OpName %17 ""
OpName %33 "S0"
OpMemberName %33 0 "a"
OpName %36 "S1"
OpMemberName %36 0 "data0"
OpMemberName %36 1 "data1"
OpName %56 "_GLF_color"
OpDecorate %14 ArrayStride 16
OpMemberDecorate %15 0 Offset 0
OpDecorate %15 Block
OpDecorate %17 DescriptorSet 0
OpDecorate %17 Binding 0
OpDecorate %56 Location 0
%2 = OpTypeVoid
%3 = OpTypeFunction %2
%6 = OpTypeInt 32 1
%7 = OpTypeFunction %6
%10 = OpTypePointer Function %6
%12 = OpTypeInt 32 0
%13 = OpConstant %12 3
%14 = OpTypeArray %6 %13
%15 = OpTypeStruct %14
%16 = OpTypePointer Uniform %15
%17 = OpVariable %16 Uniform
%18 = OpConstant %6 0
%19 = OpConstant %6 2
%20 = OpTypePointer Uniform %6
%31 = OpTypeBool
%33 = OpTypeStruct %6
%34 = OpTypeFloat 32
%35 = OpTypeVector %34 4
%36 = OpTypeStruct %33 %35
%37 = OpTypePointer Function %36
%39 = OpConstant %6 1
%55 = OpTypePointer Output %35
%56 = OpVariable %55 Output
%78 = OpTypePointer Function %33
%80 = OpTypePointer Function %35
%99 = OpUndef %35
%101 = OpUndef %6
%4 = OpFunction %2 None %3
%5 = OpLabel
%49 = OpFunctionCall %6 %8
%50 = OpAccessChain %20 %17 %18 %39
%51 = OpLoad %6 %50
%52 = OpIEqual %31 %49 %51
OpSelectionMerge %54 None
OpBranchConditional %52 %53 %70
%53 = OpLabel
%59 = OpConvertSToF %34 %51
%60 = OpAccessChain %20 %17 %18 %19
%61 = OpLoad %6 %60
%62 = OpConvertSToF %34 %61
%69 = OpCompositeConstruct %35 %59 %62 %62 %59
OpStore %56 %69
OpBranch %54
%70 = OpLabel
%71 = OpAccessChain %20 %17 %18 %19
%72 = OpLoad %6 %71
%73 = OpConvertSToF %34 %72
%74 = OpCompositeConstruct %35 %73 %73 %73 %73
OpStore %56 %74
OpBranch %54
%54 = OpLabel
OpReturn
OpFunctionEnd
%8 = OpFunction %6 None %7
%9 = OpLabel
%91 = OpVariable %10 Function
%81 = OpVariable %80 Function
%11 = OpVariable %10 Function
%21 = OpAccessChain %20 %17 %18 %19
%22 = OpLoad %6 %21
OpStore %11 %22
OpBranch %23
%23 = OpLabel
%100 = OpPhi %6 %101 %9 %94 %24
%98 = OpPhi %35 %99 %9 %98 %24
%97 = OpPhi %6 %22 %9 %44 %24
%29 = OpAccessChain %20 %17 %18 %18
%30 = OpLoad %6 %29
%32 = OpSLessThan %31 %97 %30
OpLoopMerge %25 %24 None
OpBranchConditional %32 %24 %25
%24 = OpLabel
%40 = OpAccessChain %20 %17 %18 %39
%41 = OpLoad %6 %40
%93 = OpCompositeConstruct %33 %100
%85 = OpCompositeConstruct %36 %93 %98
%76 = OpCompositeInsert %36 %41 %85 0 0
%86 = OpCompositeExtract %33 %76 0
%94 = OpCompositeExtract %6 %86 0
OpStore %91 %94
OpStore %81 %98
%44 = OpIAdd %6 %97 %39
OpStore %11 %44
OpBranch %23
%25 = OpLabel
%96 = OpCompositeConstruct %33 %100
%90 = OpCompositeConstruct %36 %96 %98
OpReturnValue %100
OpFunctionEnd
|
src/util-serialize-mappers-record_mapper.adb | Letractively/ada-util | 60 | 7461 | <filename>src/util-serialize-mappers-record_mapper.adb
-----------------------------------------------------------------------
-- Util.Serialize.Mappers.Record_Mapper -- Mapper for record types
-- Copyright (C) 2010, 2011 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Util.Serialize.Contexts;
with Util.Strings.Transforms;
with Util.Log.Loggers;
package body Util.Serialize.Mappers.Record_Mapper is
use Util.Log;
Key : Util.Serialize.Contexts.Data_Key;
-- The logger
Log : constant Loggers.Logger := Loggers.Create ("Util.Serialize.Mappers.Record_Mapper",
Util.Log.WARN_LEVEL);
-- -----------------------
-- Get the element object.
-- -----------------------
function Get_Element (Data : in Element_Data) return Element_Type_Access is
begin
return Data.Element;
end Get_Element;
-- -----------------------
-- Set the element object. When <b>Release</b> is set, the element <b>Element</b>
-- will be freed when the reader context is deleted (by <b>Finalize</b>).
-- -----------------------
procedure Set_Element (Data : in out Element_Data;
Element : in Element_Type_Access;
Release : in Boolean := False) is
begin
Data.Element := Element;
Data.Release := Release;
end Set_Element;
-- -----------------------
-- Finalize the object when it is removed from the reader context.
-- If the
-- -----------------------
overriding
procedure Finalize (Data : in out Element_Data) is
procedure Free is
new Ada.Unchecked_Deallocation (Object => Element_Type,
Name => Element_Type_Access);
begin
if Data.Release then
Free (Data.Element);
end if;
end Finalize;
-- -----------------------
-- Execute the mapping operation on the object associated with the current context.
-- The object is extracted from the context and the <b>Execute</b> operation is called.
-- -----------------------
procedure Execute (Handler : in Mapper;
Map : in Mapping'Class;
Ctx : in out Util.Serialize.Contexts.Context'Class;
Value : in Util.Beans.Objects.Object) is
D : constant Contexts.Data_Access := Ctx.Get_Data (Key);
begin
if not (D.all in Element_Data'Class) then
raise Util.Serialize.Contexts.No_Data;
end if;
declare
DE : constant Element_Data_Access := Element_Data'Class (D.all)'Access;
begin
if DE.Element = null then
raise Util.Serialize.Contexts.No_Data;
end if;
Handler.Execute (Map, DE.Element.all, Value);
end;
end Execute;
-- -----------------------
-- Add a mapping for setting a member. When the attribute rule defined by <b>Path</b>
-- is matched, the <b>Set_Member</b> procedure will be called with the value and the
-- <b>Field</b> identification.
-- -----------------------
procedure Add_Mapping (Into : in out Mapper;
Path : in String;
Field : in Fields) is
Map : constant Attribute_Mapping_Access := new Attribute_Mapping;
begin
Map.Index := Field;
Into.Add_Mapping (Path, Map.all'Unchecked_Access);
end Add_Mapping;
-- -----------------------
-- Add a mapping associated with the path and described by a mapper object.
-- The <b>Proxy</b> procedure is in charge of giving access to the target
-- object used by the <b>Map</b> mapper.
-- -----------------------
procedure Add_Mapping (Into : in out Mapper;
Path : in String;
Map : in Util.Serialize.Mappers.Mapper_Access;
Proxy : in Proxy_Object) is
M : constant Proxy_Mapper_Access := new Proxy_Mapper;
begin
M.Mapper := Map;
M.Execute := Proxy;
M.Is_Proxy_Mapper := True;
Into.Add_Mapping (Path, M.all'Unchecked_Access);
end Add_Mapping;
--
procedure Bind (Into : in out Mapper;
Getter : in Get_Member_Access) is
begin
Into.Get_Member := Getter;
end Bind;
procedure Bind (Into : in out Mapper;
From : in Mapper_Access) is
begin
Into.Get_Member := From.Get_Member;
end Bind;
function Get_Getter (From : in Mapper) return Get_Member_Access is
begin
return From.Get_Member;
end Get_Getter;
procedure Set_Member (Attr : in Attribute_Mapping;
Element : in out Element_Type;
Value : in Util.Beans.Objects.Object) is
begin
Set_Member (Element, Attr.Index, Value);
end Set_Member;
-- -----------------------
-- Set the attribute member described by the <b>Attr</b> mapping
-- into the value passed in <b>Element</b>. This operation will call
-- the package parameter function of the same name.
-- -----------------------
procedure Set_Member (Attr : in Mapping'Class;
Element : in out Element_Type;
Value : in Util.Beans.Objects.Object) is
begin
if not (Attr in Attribute_Mapping) then
Log.Error ("Mapping is not an Attribute_Mapping");
raise Mapping_Error;
end if;
Attribute_Mapping (Attr).Set_Member (Element, Value);
end Set_Member;
-- -----------------------
-- Set the element in the context. When <b>Release</b> is set, the element <b>Element</b>
-- will be freed when the reader context is deleted (by <b>Finalize</b>).
-- -----------------------
procedure Set_Context (Ctx : in out Util.Serialize.Contexts.Context'Class;
Element : in Element_Type_Access;
Release : in Boolean := False) is
Data_Context : constant Element_Data_Access := new Element_Data;
begin
Data_Context.Element := Element;
Data_Context.Release := Release;
Ctx.Set_Data (Key => Key, Content => Data_Context.all'Unchecked_Access);
end Set_Context;
-- -----------------------
-- Find the mapper associated with the given name.
-- Returns null if there is no mapper.
-- -----------------------
overriding
function Find_Mapper (Controller : in Proxy_Mapper;
Name : in String;
Attribute : in Boolean := False) return Mappers.Mapper_Access is
Result : constant Mappers.Mapper_Access := Controller.Mapper.Find_Mapper (Name, Attribute);
begin
if Result /= null then
return Result;
else
return Util.Serialize.Mappers.Mapper (Controller).Find_Mapper (Name, Attribute);
end if;
end Find_Mapper;
-- -----------------------
-- Build a default mapping based on the <b>Fields</b> enumeration.
-- The enumeration name is used for the mapping name with the optional <b>FIELD_</b>
-- prefix stripped.
-- -----------------------
procedure Add_Default_Mapping (Into : in out Mapper) is
use Util.Strings.Transforms;
begin
for Field in Fields'Range loop
declare
Name : constant String := To_Lower_Case (Fields'Image (Field));
begin
if Name (Name'First .. Name'First + 5) = "field_" then
Into.Add_Mapping (Name (Name'First + 6 .. Name'Last), Field);
else
Into.Add_Mapping (Name, Field);
end if;
end;
end loop;
end Add_Default_Mapping;
-- -----------------------
-- Write the element on the stream using the mapper description.
-- -----------------------
procedure Write (Handler : in Mapper;
Stream : in out Util.Serialize.IO.Output_Stream'Class;
Element : in Element_Type) is
begin
if Handler.Get_Member = null then
Log.Error ("The mapper has a null Get_Member function");
raise Mapping_Error with "The mapper has a null Get_Member function";
end if;
Write (Handler, Handler.Get_Member, Stream, Element);
end Write;
-- -----------------------
-- Write the element on the stream using the mapper description.
-- -----------------------
procedure Write (Handler : in Util.Serialize.Mappers.Mapper'Class;
Getter : in Get_Member_Access;
Stream : in out Util.Serialize.IO.Output_Stream'Class;
Element : in Element_Type) is
use Ada.Strings.Unbounded;
procedure Write (Map : in Util.Serialize.Mappers.Mapper'Class);
procedure Write (Map : in Util.Serialize.Mappers.Mapper'Class) is
Name : constant String := To_String (Map.Name);
begin
if Map.Mapping /= null then
declare
M : constant Attribute_Mapping_Access
:= Attribute_Mapping'Class (Map.Mapping.all)'Access;
Val : constant Util.Beans.Objects.Object := Getter (Element, M.Index);
begin
if M.Is_Attribute then
Stream.Write_Attribute (Name => Name, Value => Val);
else
Stream.Write_Entity (Name => Name, Value => Val);
end if;
end;
else
Stream.Start_Entity (Name);
Map.Iterate (Write'Access);
Stream.End_Entity (Name);
end if;
end Write;
begin
Handler.Iterate (Write'Access);
end Write;
-- -----------------------
-- Clone the <b>Handler</b> instance and get a copy of that single object.
-- -----------------------
function Clone (Handler : in Mapper) return Util.Serialize.Mappers.Mapper_Access is
Result : constant Mapper_Access := new Mapper;
begin
Result.Name := Handler.Name;
Result.Mapper := Handler.Mapper;
Result.Mapping := Handler.Mapping;
Result.Is_Proxy_Mapper := Handler.Is_Proxy_Mapper;
Result.Is_Wildcard := Handler.Is_Wildcard;
Result.Is_Deep_Wildcard := Handler.Is_Deep_Wildcard;
Result.Get_Member := Handler.Get_Member;
Result.Execute := Handler.Execute;
return Result.all'Unchecked_Access;
end Clone;
begin
-- Allocate the unique data key.
Util.Serialize.Contexts.Allocate (Key);
end Util.Serialize.Mappers.Record_Mapper; |
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_662.asm | ljhsiun2/medusa | 9 | 96830 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r15
push %r9
push %rax
push %rcx
lea addresses_WT_ht+0x10530, %rcx
nop
nop
add %r9, %r9
and $0xffffffffffffffc0, %rcx
vmovaps (%rcx), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %rax
nop
nop
nop
sub $17881, %rcx
lea addresses_normal_ht+0x1d7d0, %r15
nop
nop
xor $37891, %r11
movw $0x6162, (%r15)
nop
nop
nop
nop
cmp %r11, %r11
pop %rcx
pop %rax
pop %r9
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %r15
push %r9
push %rbx
push %rdi
push %rsi
// Store
lea addresses_UC+0x16b20, %r11
and $31825, %r15
movb $0x51, (%r11)
nop
nop
nop
nop
nop
xor %r9, %r9
// Faulty Load
lea addresses_WC+0xc930, %rbx
nop
nop
nop
nop
nop
add %r14, %r14
movb (%rbx), %r9b
lea oracles, %rbx
and $0xff, %r9
shlq $12, %r9
mov (%rbx,%r9,1), %r9
pop %rsi
pop %rdi
pop %rbx
pop %r9
pop %r15
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 4}}
[Faulty Load]
{'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WT_ht', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 10}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 4}}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
|
chapter_16/sepia_filter/sse.asm | GeertArien/low-level-programming | 0 | 105403 | <gh_stars>0
section .text
global sse
; rdi = x, rsi = y
sse:
movdqa xmm0, [rdi]
movdqa xmm1, [rdi + 16]
movdqa xmm2, [rdi + 32]
mulps xmm0, [rsi]
mulps xmm1, [rsi + 16]
mulps xmm2, [rsi + 32]
addps xmm0, xmm1
addps xmm0, xmm2
movdqa [rdi], xmm0
ret
|
libsrc/_DEVELOPMENT/adt/wv_priority_queue/c/sdcc_iy/wv_priority_queue_capacity.asm | jpoikela/z88dk | 640 | 96057 |
; size_t wv_priority_queue_capacity(wv_priority_queue_t *q)
SECTION code_clib
SECTION code_adt_wv_priority_queue
PUBLIC _wv_priority_queue_capacity
EXTERN _wa_priority_queue_capacity
defc _wv_priority_queue_capacity = _wa_priority_queue_capacity
|
oeis/004/A004593.asm | neoneye/loda-programs | 11 | 166563 | <reponame>neoneye/loda-programs
; A004593: Expansion of e in base 2.
; Submitted by <NAME>(s3)
; 1,0,1,0,1,1,0,1,1,1,1,1,1,0,0,0,0,1,0,1,0,1,0,0,0,1,0,1,1,0,0,0,1,0,1,0,0,0,1,0,1,0,1,1,1,0,1,1,0,1,0,0,1,0,1,0,1,0,0,1,1,0,1,0,1,0,1,0,1,1,1,1,1,1,0,1,1,1,0,0,0,1,0,1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,1,0
seq $0,293337 ; Least integer k such that k/2^n > e.
add $0,3
mul $0,2
lpb $0
div $0,4
mov $2,$0
mov $0,$3
lpe
mov $0,$2
mod $0,2
|
Quiz1/1/checkGreater.asm | 100RABHpy/CSE231-Operating-System | 0 | 160755 | global _s, checkGreater
section .text
_s:
mov rdi,10 ;x
mov rsi,20 ;y
call checkGreater ;calling checkGreater
checkGreater:
cmp rdi, rsi ; comparing x and y
jg _greater ;jumpt to _greater if x>y
jng _else ;else jmp to _else
_greater:
mov rax, 1 ;code for write syscall
mov rdi, 1
mov rsi, ifGreater ;printing 1
mov rdx, leng
syscall
mov rax, 60 ; exit(
mov rdi, 0 ; EXIT_SUCCESS
syscall ; );
_else:
mov rax, 1
mov rdi, 1
mov rsi, else1 ;printing 0
mov rdx, leni
syscall
mov rax, 60 ; exit(
mov rdi, 0 ; EXIT_SUCCESS
syscall ; );
section .rodata
ifGreater: db "1",10
leng: equ $-ifGreater
else1: db "0",10
leni: equ $-else1
|
src/asf-components-html-panels.ads | jquorning/ada-asf | 12 | 27165 | -----------------------------------------------------------------------
-- html.panels -- Layout panels
-- Copyright (C) 2009, 2010, 2011 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package ASF.Components.Html.Panels is
type UIPanelGroup is new UIHtmlComponent with private;
function Get_Layout (UI : UIPanelGroup;
Context : in Faces_Context'Class) return String;
procedure Encode_Begin (UI : in UIPanelGroup;
Context : in out Faces_Context'Class);
procedure Encode_End (UI : in UIPanelGroup;
Context : in out Faces_Context'Class);
private
type UIPanelGroup is new UIHtmlComponent with null record;
end ASF.Components.Html.Panels;
|
oeis/164/A164603.asm | neoneye/loda-programs | 11 | 28120 | ; A164603: a(n) = ((1+4*sqrt(2))*(2+2*sqrt(2))^n + (1-4*sqrt(2))*(2-2*sqrt(2))^n)/2.
; Submitted by <NAME>(s4)
; 1,18,76,376,1808,8736,42176,203648,983296,4747776,22924288,110688256,534450176,2580553728,12460015616,60162277376,290489171968,1402605797376,6772379877376,32699942699008,157889290305536,762356932018176,3680984889294848,17773367285252096,85817408698187776,414363103933759488,2000722050527789056,9660340617846194176,46644250673495932928,225218365165368508416,1087450463355457765376,5250675314083305095168,25352503109755051442176,122412713695353426149376,591060867220433910366208
mov $1,14
mov $3,1
lpb $0
sub $0,1
mov $2,$3
mul $2,4
mul $3,4
add $3,$1
mov $1,$2
lpe
mov $0,$3
|
libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_updateSpritePosition.asm | jpoikela/z88dk | 640 | 15327 | <reponame>jpoikela/z88dk
; void SMS_updateSpritePosition(signed char sprite, unsigned char x, unsigned char y)
SECTION code_clib
SECTION code_SMSlib
PUBLIC _SMS_updateSpritePosition
EXTERN asm_SMSlib_updateSpritePosition
_SMS_updateSpritePosition:
pop af
pop de
pop hl
push hl
push de
push af
ld c,d
ld a,l
jp asm_SMSlib_updateSpritePosition
|
oeis/085/A085283.asm | neoneye/loda-programs | 11 | 179279 | <reponame>neoneye/loda-programs
; A085283: a(n) = n*n^n - (n-1)(n-1)^n.
; Submitted by <NAME>
; 1,1,7,65,781,11529,201811,4085185,93864121,2413042577,68618940391,2138428376721,72470493235141,2653457921150425,104382202543721467,4390455017903519489,196621779843659466481,9340717969198079777313
mov $2,$0
add $0,1
mov $1,$0
sub $0,2
pow $0,$1
pow $2,$1
sub $2,$0
mov $0,$2
|
src/test/resources/testData/parse/live_samples/new_event.scpt | stigger/AppleScript-IDEA | 18 | 3559 | <reponame>stigger/AppleScript-IDEA
use AppleScript version "2.5"
use scripting additions
use framework "Foundation"
use framework "EventKit"
get afp URL
-- lazy way to specify calender
tell application "Calendar"
set calId to uid of calendar 1 whose name is "Work"
beep day view
get day view
end tell
set timeNow to current date
set timeInAnHour to timeNow + 3600
set eventId to my createEventStartingAt:timeNow endingAt:timeInAnHour allDay:false theSummary:"Test event" calendarID:calId inLocation:"Backyard" withDescription:"Some notes here"
on createEventStartingAt:startDate endingAt:endDate allDay:allDayFlag theSummary:theTitle calendarID:calId inLocation:theLocation withDescription:theNotes
-- create event store and get the OK to access Calendars
set theEKEventStore to current application's EKEventStore's alloc()'s init()
theEKEventStore's requestAccessToEntityType:0 completion:(missing value)
-- check if app has access; this will still occur the first time you OK authorization
set authorizationStatus to current application's EKEventStore's authorizationStatusForEntityType:0
if authorizationStatus is not 3 then
display dialog "Access must be given in System Preferences" & linefeed & "-> Security & Privacy first." buttons {"OK"} default button 1
tell application "System Preferences"
activate
tell pane id "com.apple.preference.security" to reveal anchor "Privacy"
end tell
error number -128
end if
-- get calendar
set theCal to theEKEventStore's calendarWithIdentifier:calId
-- make new event
set newEvent to current application's EKEvent's eventWithEventStore:theEKEventStore
newEvent's setTitle:theTitle
newEvent's setAllDay:allDayFlag
newEvent's setLocation:theLocation
newEvent's setNotes:theNotes
newEvent's setStartDate:startDate
newEvent's setEndDate:endDate
newEvent's setCalendar:theCal
-- save event
set {theResult, theError} to theEKEventStore's saveEvent:newEvent span:0 commit:true |error|:(reference)
if not theResult as boolean then error (theError's localizedDescription() as text)
-- return the Calendar.app AS id
return newEvent's calendarItemExternalIdentifier() as string
end createEventStartingAt:endingAt:allDay:theSummary:calendarID:inLocation:withDescription:
use scripting additions
use framework "Foundation"
use framework "EventKit"
set theID to "374F621E-8B76-4082-8ED8-C8CECD5C6E5B"
set calTitle to "Home"
--its deletEventWithID:theID inCalName:calTitle --todo its -> it's
it's deletEventWithID:theID inCalName:calTitle
on deletEventWithID:theID inCalName:calTitle
-- create event store and get the OK to access Calendars
set theEKEventStore to current application's EKEventStore's alloc()'s init()
theEKEventStore's requestAccessToEntityType:0 completion:(missing value)
-- check if app has access; this will still occur the first time you OK authorization
set authorizationStatus to current application's EKEventStore's authorizationStatusForEntityType:0 -- work around enum bug
if authorizationStatus is not 3 then
display dialog "Access must be given in System Preferences" & linefeed & "-> Security & Privacy first." buttons {"OK"} default button 1
tell application "System Preferences"
activate
tell pane id "com.apple.preference.security" to reveal anchor "Privacy"
end tell
error number -128
end if
-- get events matching ID
set theEvents to (theEKEventStore's calendarItemsWithExternalIdentifier:theID)
-- Calendars.app uses non-uique IDs, so there may be more than one; in this case filter by calendar
if (count of theEvents) > 1 then
set theNSPredicate to current application's NSPredicate's predicateWithFormat_("calendar.title == %@", calTitle)
set theEvents to theEvents's filteredArrayUsingPredicate:theNSPredicate
end if
-- do the deletion(s)
repeat with anEvent in theEvents
(theEKEventStore's removeEvent:anEvent span:1 commit:true |error|:(missing value))
end repeat
end deletEventWithID:inCalName:
|
src/LibraBFT/Abstract/Properties.agda | LaudateCorpus1/bft-consensus-agda | 0 | 10068 | <filename>src/LibraBFT/Abstract/Properties.agda
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2020, 2021, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
open import LibraBFT.Abstract.Types
open import LibraBFT.Abstract.Types.EpochConfig
open import Util.Lemmas
open import Util.Prelude
open WithAbsVote
-- For each desired property (VotesOnce and PreferredRoundRule), we have a
-- module containing a Type that defines a property that an implementation
-- should prove, and a proof that it implies the corresponding rule used by
-- the abstract proofs. Then, we use those proofs to instantiate thmS5,
-- and the use thmS5 to prove a number of correctness conditions.
--
-- TODO-1: refactor this file to separate the definitions and proofs of
-- VotesOnce and PreferredRoundRule from their use in proving the correctness
-- properties.
module LibraBFT.Abstract.Properties
(UID : Set)
(_≟UID_ : (u₀ u₁ : UID) → Dec (u₀ ≡ u₁))
(NodeId : Set)
(𝓔 : EpochConfig UID NodeId)
(𝓥 : VoteEvidence UID NodeId 𝓔)
where
open import LibraBFT.Abstract.Records UID _≟UID_ NodeId 𝓔 𝓥
open import LibraBFT.Abstract.Records.Extends UID _≟UID_ NodeId 𝓔 𝓥
open import LibraBFT.Abstract.RecordChain UID _≟UID_ NodeId 𝓔 𝓥
open import LibraBFT.Abstract.RecordChain.Assumptions UID _≟UID_ NodeId 𝓔 𝓥
open import LibraBFT.Abstract.System UID _≟UID_ NodeId 𝓔 𝓥
open import LibraBFT.Abstract.RecordChain.Properties UID _≟UID_ NodeId 𝓔 𝓥
open EpochConfig 𝓔
module WithAssumptions {ℓ}
(InSys : Record → Set ℓ)
(no-collisions-InSys : NoCollisions InSys)
(votes-once : VotesOnlyOnceRule InSys)
(preferred-round : PreferredRoundRule InSys)
where
open All-InSys-props InSys
CommitsDoNotConflict : ∀{q q'}
→ {rc : RecordChain (Q q)} → All-InSys rc
→ {rc' : RecordChain (Q q')} → All-InSys rc'
→ {b b' : Block}
→ CommitRule rc b
→ CommitRule rc' b'
→ (B b) ∈RC rc' ⊎ (B b') ∈RC rc
CommitsDoNotConflict ais ais' cr cr'
with WithInvariants.thmS5 InSys votes-once preferred-round ais ais' cr cr'
-- We use the implementation-provided evidence that Block ids are injective among
-- Block actually in the system to dismiss the first possibility
...| inj₁ ((_ , neq , h≡) , (is1 , is2)) = ⊥-elim (neq (no-collisions-InSys is1 is2 h≡))
...| inj₂ corr = corr
-- When we are dealing with a /Complete/ InSys predicate, we can go a few steps
-- further and prove that commits do not conflict even if we have only partial
-- knowledge about Records represented in the system.
module _ (∈QC⇒AllSent : Complete InSys) where
-- For a /complete/ system (i.e., one in which peers vote for a Block only if
-- they know of a RecordChain up to that Block whose Records are all InSys), we
-- can prove that CommitRules based on RecordChainFroms similarly do not
-- conflict, provided all of the Records in the RecordChainFroms are InSys.
-- This enables peers not participating in consensus to confirm commits even if
-- they are sent only a "commit certificate" that contains enough of a
-- RecordChain to confirm the CommitRule. Note that it is this "sending" that
-- justfies the assumption that the RecordChainFroms on which the CommitRules
-- are based are All-InSys.
CommitsDoNotConflict'
: ∀{o o' q q'}
→ {rcf : RecordChainFrom o (Q q)} → All-InSys rcf
→ {rcf' : RecordChainFrom o' (Q q')} → All-InSys rcf'
→ {b b' : Block}
→ CommitRuleFrom rcf b
→ CommitRuleFrom rcf' b'
→ Σ (RecordChain (Q q')) ((B b) ∈RC_)
⊎ Σ (RecordChain (Q q)) ((B b') ∈RC_)
CommitsDoNotConflict' {cb} {q = q} {q'} {rcf} rcfAll∈sys {rcf'} rcf'All∈sys crf crf'
with bft-property (qVotes-C1 q) (qVotes-C1 q')
...| α , α∈qmem , α∈q'mem , hα
with Any-sym (Any-map⁻ α∈qmem) | Any-sym (Any-map⁻ α∈q'mem)
...| α∈q | α∈q'
with ∈QC⇒AllSent {q = q} hα α∈q (rcfAll∈sys here) | ∈QC⇒AllSent {q = q'} hα α∈q' (rcf'All∈sys here)
...| ab , (arc , ais) , ab←q | ab' , (arc' , ais') , ab←q'
with crf⇒cr rcf (step arc ab←q) crf | crf⇒cr rcf' (step arc' ab←q') crf'
...| inj₁ ((_ , neq , h≡) , (is1 , is2)) | _ = ⊥-elim (neq (no-collisions-InSys (rcfAll∈sys is1) (ais (∈RC-simple-¬here arc ab←q (λ ()) is2)) h≡))
...| inj₂ _ | inj₁ ((_ , neq , h≡) , (is1 , is2)) = ⊥-elim (neq (no-collisions-InSys (rcf'All∈sys is1) (ais' (∈RC-simple-¬here arc' ab←q' (λ ()) is2)) h≡))
...| inj₂ cr | inj₂ cr'
with CommitsDoNotConflict (All-InSys-step ais ab←q (rcfAll∈sys here)) (All-InSys-step ais' ab←q' (rcf'All∈sys here)) cr cr'
...| inj₁ b∈arc' = inj₁ (step arc' ab←q' , b∈arc')
...| inj₂ b'∈arc = inj₂ (step arc ab←q , b'∈arc)
|
Prelude.agda | ivoysey/agda-tfp16 | 2 | 4581 | <gh_stars>1-10
module Prelude where
open import Agda.Primitive using (Level; lzero; lsuc) renaming (_⊔_ to lmax)
-- empty type
data ⊥ : Set where
-- from false, derive whatever
abort : ∀ {C : Set} → ⊥ → C
abort ()
-- unit
data ⊤ : Set where
<> : ⊤
-- sums
data _+_ (A B : Set) : Set where
Inl : A → A + B
Inr : B → A + B
-- pairs
infixr 1 _,_
record Σ {l1 l2 : Level} (A : Set l1) (B : A → Set l2) : Set (lmax l1 l2) where
constructor _,_
field
π1 : A
π2 : B π1
open Σ public
syntax Σ A (\ x -> B) = Σ[ x ∈ A ] B
_×_ : {l1 : Level} {l2 : Level} → (Set l1) → (Set l2) → Set (lmax l1 l2)
A × B = Σ A λ _ → B
infixr 1 _×_
-- equality
data _==_ {l : Level} {A : Set l} (M : A) : A → Set l where
refl : M == M
infixr 9 _==_
{-# BUILTIN EQUALITY _==_ #-}
{-# BUILTIN REFL refl #-}
_·_ : {l : Level} {α : Set l} {x y z : α} → x == y → y == z → x == z
refl · refl = refl
-- β: ! (refl m) == refl m
! : {l : Level} {α : Set l} {x y : α} → x == y → y == x
! refl = refl
-- β: (ap f (refl m)) == refl (f m)
ap1 : {l1 l2 : Level} {α : Set l1} {β : Set l2} {x y : α} (F : α → β)
→ x == y → F x == F y
ap1 F refl = refl
-- β? : tr β (refl x) y == y
tr : {l1 l2 : Level} {α : Set l1} {x y : α}
(B : α → Set l2)
→ x == y
→ B x
→ B y
tr B refl x₁ = x₁
ap2 : {l1 l2 l3 : Level}
{A : Set l1} {B : Set l2} {C : Set l3}
{M N : A} {M' N' : B}
(f : A -> B -> C) -> M == N -> M' == N' -> (f M M') == (f N N')
ap2 f refl refl = refl
infix 2 _■
infixr 2 _=<_>_
_=<_>_ : {l : Level} {A : Set l} (x : A) {y z : A} → x == y → y == z → x == z
_ =< p1 > p2 = p1 · p2
_■ : {l : Level} {A : Set l} (x : A) → x == x
_■ _ = refl
-- options
data Maybe (A : Set) : Set where
Some : A → Maybe A
None : Maybe A
-- the some constructor is injective. perhaps unsurprisingly.
someinj : {A : Set} {x y : A} → Some x == Some y → x == y
someinj refl = refl
-- order
data Order : Set where
Less : Order
Equal : Order
Greater : Order
-- function extensionality
postulate
funext : {A : Set} {B : A → Set} {f g : (x : A) → (B x)} →
((x : A) → f x == g x) → f == g
|
programs/oeis/002/A002696.asm | neoneye/loda | 22 | 100051 | ; A002696: Binomial coefficients C(2n,n-3).
; 1,8,45,220,1001,4368,18564,77520,319770,1307504,5311735,21474180,86493225,347373600,1391975640,5567902560,22239974430,88732378800,353697121050,1408831480056,5608233007146,22314239266528,88749815264600,352870329957600,1402659561581460,5574440580220512,22150361247847371,88004802264174740,349615716557887465,1388818294740297792,5516694892996182896,21912870037044995008,87038784768854708790,345720487753213109040,1373222113855042069878,5454610487089714145160,21666924990384142298830,86068488962431036661600,341906042875877359752600,1358272895117160656521440,5396181990927415434332460,21439112258713177252334880,85182187099351463190080550,338464770002738704236997800,1344935917892700796563561258,5344581948227203165429053888,21239797658799244686692552784,84413487283064039501507937600,335504531631992953296502613100,1333552706063787946460903892960,5300872006603557087182092974516,21072197078882251702606214796528,83771764912399932995440489194420,333051033383740315637772997014720,1324186238286834180878330786278896,5265169722428127562717416598795968,20936328683134426592994427869521064,83255576049891287036469069890493120,331093430400995468543199463826362995
mov $1,6
add $1,$0
add $1,$0
bin $1,$0
mov $0,$1
|
_anim/obj4A.asm | vladjester2020/Sonic1TMR | 0 | 99641 | ; ---------------------------------------------------------------------------
; Animation script - special stage entry effect from beta
; ---------------------------------------------------------------------------
dc.w byte_14458-Ani_obj4A
byte_14458: dc.b 5, 0, 1, 0, 1, 0, 7, 1, 7, 2, 7, 3, 7, 4, 7, 5, 7, 6, 7, $FC
even |
kernel.asm | Tymeade/lama-os | 0 | 162143 | <reponame>Tymeade/lama-os
;;kernel.asm
bits 32
section .text
align 4
dd 0x1BADB002
dd 0x00
dd - (0x1BADB002 + 0x00)
global start
extern kmain
start:
cli
mov esp, stack_space
call kmain
hlt
section .bss
resb 8192
stack_space:
|
testsuite/amf/TN-231/test_231.adb | svn2github/matreshka | 24 | 8098 | <filename>testsuite/amf/TN-231/test_231.adb
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Testsuite Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2013, <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$
------------------------------------------------------------------------------
-- Check whether UML::Operation::bodyCondition attribute is serialized as
-- XML attribute, but not as XML element.
------------------------------------------------------------------------------
with Ada.Characters.Wide_Wide_Latin_1;
with Ada.Wide_Wide_Text_IO;
with AMF.Facility;
with AMF.Factories.UML_Factories;
with AMF.UML.Classes;
with AMF.UML.Constraints.Collections;
with AMF.UML.Operations.Collections;
with AMF.UML.Packageable_Elements.Collections;
with AMF.UML.Packages;
with AMF.URI_Stores;
with League.Strings;
with XMI.Writer;
with AMF.Internals.Modules.UML_Module;
procedure Test_231 is
use type League.Strings.Universal_String;
function "+"
(Item : Wide_Wide_String) return League.Strings.Universal_String
renames League.Strings.To_Universal_String;
LF : Wide_Wide_Character
renames Ada.Characters.Wide_Wide_Latin_1.LF;
Expected : constant League.Strings.Universal_String
:= +("<?xml version='1.0'?>" & LF
& "<xmi:XMI xmlns:uml='http://www.omg.org/spec/UML/20100901' xmlns:xmi='http://www.omg.org/spec/XMI/20100901' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" & LF
& " <uml:Package xmi:type='uml:Package' xmi:id='33554433' name='Package'>" & LF
& " <URI xsi:nil='true'/>" & LF
& " <packagedElement xmi:type='uml:Class' xmi:id='33554434' name='Class'>" & LF
& " <ownedOperation xmi:type='uml:Operation' xmi:id='33554436' bodyCondition='33554435' name='operation'>" & LF
& " <ownedRule xmi:type='uml:Constraint' xmi:id='33554435'>" & LF
& " <name xsi:nil='true'/>" & LF
& " </ownedRule>" & LF
& " <visibility xsi:nil='true'/>" & LF
& " </ownedOperation>" & LF
& " </packagedElement>" & LF
& " </uml:Package>" & LF
& "</xmi:XMI>");
UML_URI : constant League.Strings.Universal_String
:= +"http://www.omg.org/spec/UML/20100901";
UML_Factory : AMF.Factories.UML_Factories.UML_Factory_Access;
Store : AMF.URI_Stores.URI_Store_Access;
begin
-- Initialize facility.
AMF.Facility.Initialize;
-- Create store.
Store := AMF.Facility.Create_URI_Store (+"local:///test");
-- Lookup for factory.
UML_Factory :=
AMF.Factories.UML_Factories.UML_Factory_Access
(Store.Get_Factory (UML_URI));
-- Create elements of model.
declare
The_Package : constant AMF.UML.Packages.UML_Package_Access
:= UML_Factory.Create_Package;
The_Class : constant AMF.UML.Classes.UML_Class_Access
:= UML_Factory.Create_Class;
The_Constraint : constant AMF.UML.Constraints.UML_Constraint_Access
:= UML_Factory.Create_Constraint;
The_Operation : constant AMF.UML.Operations.UML_Operation_Access
:= UML_Factory.Create_Operation;
Packaged_Element :
AMF.UML.Packageable_Elements.Collections.Set_Of_UML_Packageable_Element;
Owned_Operation :
AMF.UML.Operations.Collections.Ordered_Set_Of_UML_Operation;
Owned_Rule :
AMF.UML.Constraints.Collections.Set_Of_UML_Constraint;
begin
-- Set some attributes.
The_Package.Set_Name ((False, +"Package"));
The_Class.Set_Name ((False, +"Class"));
The_Operation.Set_Name ((False, +"operation"));
-- Connect elements.
Packaged_Element := The_Package.Get_Packaged_Element;
Packaged_Element.Add (The_Class);
Owned_Operation := The_Class.Get_Owned_Operation;
Owned_Operation.Add (The_Operation);
Owned_Rule := The_Operation.Get_Owned_Rule;
Owned_Rule.Add (The_Constraint);
The_Operation.Set_Body_Condition (The_Constraint);
end;
-- Serialize model into XMI and check result.
if XMI.Writer (Store) /= Expected then
Ada.Wide_Wide_Text_IO.Put_Line (XMI.Writer (Store).To_Wide_Wide_String);
raise Program_Error;
end if;
end Test_231;
|
libsrc/z80_crt0s/8080/sccz80/l_long_ucmp.asm | jpoikela/z88dk | 0 | 5015 | ; Z88 Small C+ Run Time Library
; Long support functions
; "8080" mode
; Stefano - 30/4/2002
; $Id: l_long_ucmp.asm,v 1.2 2016-06-16 20:31:05 dom Exp $
;
SECTION code_crt0_sccz80
PUBLIC l_long_ucmp
EXTERN __retloc
EXTERN __retloc2
; Unsigned compare of dehl (stack) and dehl (registers)
;
; Entry: primary = (under two return addresses on stack)
; secondary= dehl
;
; Exit: z = numbers the same
; nz = numbers different
; c/nc = sign of difference [set if secondary > primary]
;
; Code takes secondary from primary
.l_long_ucmp
ex (sp),hl
ld (__retloc),hl ;first return
pop bc ;low word
pop hl ;second return value
ld (__retloc2),hl
ld hl,0
add hl,sp ;points to hl on stack
ld a,(hl)
sub c
ld c,a
inc hl
ld a,(hl)
sbc a,b
ld b,a
inc hl
ld a,(hl)
sbc a,e
ld e,a
inc hl
ld a,(hl)
sbc a,d
ld d,a
inc hl
ld sp,hl
; ATP we have done the comparision and are left with dehl = result of
; primary - secondary, if we have a carry then secondary > primary
jp c,l_long_ucmp1 ;
; Primary was larger, return nc
ld a,c
or b
or d
or e
ld hl,1 ; Saves some mem in comparison functions
scf ; Replace with and a?
ccf
jp retloc
; Secondary was larger, return c
.l_long_ucmp1
ld a,c
or b
or d
or e
scf
ld hl,1 ; Saves some mem in comparision unfunctions
.retloc ex de,hl
ld hl,(__retloc2)
push hl
ld hl,(__retloc)
push hl
ex de,hl
ret
|
Source/Levels/L0413.asm | AbePralle/FGB | 0 | 247851 | ; L0413.asm
; Generated 04.22.2001 by mlevel
; Modified 04.22.2001 by <NAME>
INCLUDE "Source/Defs.inc"
INCLUDE "Source/Levels.inc"
;---------------------------------------------------------------------
SECTION "Level0413Section",ROMX
;---------------------------------------------------------------------
L0413_Contents::
DW L0413_Load
DW L0413_Init
DW L0413_Check
DW L0413_Map
;---------------------------------------------------------------------
; Load
;---------------------------------------------------------------------
L0413_Load:
DW ((L0413_LoadFinished - L0413_Load2)) ;size
L0413_Load2:
ret
L0413_LoadFinished:
;---------------------------------------------------------------------
; Map
;---------------------------------------------------------------------
L0413_Map:
;---------------------------------------------------------------------
; Init
;---------------------------------------------------------------------
L0413_Init:
DW ((L0413_InitFinished - L0413_Init2)) ;size
L0413_Init2:
ret
L0413_InitFinished:
;---------------------------------------------------------------------
; Check
;---------------------------------------------------------------------
L0413_Check:
DW ((L0413_CheckFinished - L0413_Check2)) ;size
L0413_Check2:
ret
L0413_CheckFinished:
PRINT "0413 Script Sizes (Load/Init/Check) (of $500): "
PRINT (L0413_LoadFinished - L0413_Load2)
PRINT " / "
PRINT (L0413_InitFinished - L0413_Init2)
PRINT " / "
PRINT (L0413_CheckFinished - L0413_Check2)
PRINT "\n"
|
PRACT0/SO1HPUB/asm/ajustusr.asm | so1h/SO1H | 0 | 244132 | <gh_stars>0
bits 16
; glb _start : (void) void
; glb __start__ : (void) void
; glb main : (void) void
; glb finProceso : (void) void
; glb finThread : (void) void
; glb __start__ : (void) void
section .text
global ___start__
___start__:
push ebp
movzx ebp, sp
;sub sp, 0
; RPN'ized expression: "( main ) "
; Expanded expression: " main ()0 "
; Fused expression: "( main )0 "
db 0x9A
section .relot
dd L3
section .text
L3:
dd _main
L1:
db 0x66
leave
retf
L4:
section .fxnsz noalloc
dd L4 - ___start__
extern _main
; Syntax/declaration table/stack:
; Bytes used: 230/40960
; Macro table:
; Macro __SMALLER_C__ = `0x0100`
; Macro __SMALLER_C_32__ = ``
; Macro __HUGE__ = ``
; Macro __SMALLER_C_SCHAR__ = ``
; Bytes used: 74/5120
; Identifier table:
; Ident __floatsisf
; Ident __floatunsisf
; Ident __fixsfsi
; Ident __fixunssfsi
; Ident __addsf3
; Ident __subsf3
; Ident __negsf2
; Ident __mulsf3
; Ident __divsf3
; Ident __lesf2
; Ident __gesf2
; Ident _start
; Ident <something>
; Ident __start__
; Ident main
; Ident finProceso
; Ident finThread
; Bytes used: 182/16384
; Next label number: 5
; Compilation succeeded.
|
Task/Higher-order-functions/AppleScript/higher-order-functions-1.applescript | LaudateCorpus1/RosettaCodeData | 1 | 805 | <filename>Task/Higher-order-functions/AppleScript/higher-order-functions-1.applescript
-- This handler takes a script object (singer)
-- with another handler (call).
on sing about topic by singer
call of singer for "Of " & topic & " I sing"
end sing
-- Define a handler in a script object,
-- then pass the script object.
script cellos
on call for what
say what using "Cellos"
end call
end script
sing about "functional programming" by cellos
-- Pass a different handler. This one is a closure
-- that uses a variable (voice) from its context.
on hire for voice
script
on call for what
say what using voice
end call
end script
end hire
sing about "closures" by (hire for "Pipe Organ")
|
source/exceptions.adb | jquorning/Gauss | 4 | 15569 | <reponame>jquorning/Gauss<gh_stars>1-10
--
-- The author disclaims copyright to this source code. In place of
-- a legal notice, here is a blessing:
--
-- May you do good and not evil.
-- May you find forgiveness for yourself and forgive others.
-- May you share freely, not taking more than you give.
--
with Ada.Text_IO;
package body Exceptions is
procedure Put
(Occurrence : Ada.Exceptions.Exception_Occurrence)
is
use Ada.Exceptions;
use Ada.Text_IO;
Occ : Exception_Occurrence renames Occurrence;
begin
Put_Line (Exception_Name (Occ));
New_Line;
Put_Line (Exception_Message (Occ));
New_Line;
end Put;
end Exceptions;
|
oeis/105/A105671.asm | neoneye/loda-programs | 11 | 9239 | <reponame>neoneye/loda-programs
; A105671: a(2n) = Lucas(2n+3)^2, a(2n+1) = Lucas(2n+1)^2.
; Submitted by <NAME>
; 16,1,121,16,841,121,5776,841,39601,5776,271441,39601,1860496,271441,12752041,1860496,87403801,12752041,599074576,87403801,4106118241,599074576,28143753121,4106118241,192900153616,28143753121,1322157322201,192900153616,9062201101801,1322157322201,62113250390416,9062201101801,425730551631121,62113250390416,2918000611027441,425730551631121,20000273725560976,2918000611027441,137083915467899401,20000273725560976,939587134549734841,137083915467899401,6440026026380244496,939587134549734841
add $0,1
seq $0,87123 ; a(n) = Fibonacci(n+1) - (-1)^n*Fibonacci(n).
pow $0,2
mul $0,5
sub $0,4
|
dd/nd/qxl_phys.asm | olifink/smsqe | 0 | 174485 | * Network physical layer - QXL (20 MHz) 1984 & 1993 <NAME>
*
section nd
*
xdef nd_qxlc network access code
xdef nd_qxle
xdef nd_send send a packet
xdef nd_send0 send a packet (server protocol)
xdef nd_read read a packet
xdef nd_read0 read a packet (server protocol)
xdef nd_bcast read a broadcast
*
xref nd_break read break keys
*
include dev8_dd_nd_keys
include dev8_mac_assert
include dev8_smsq_qxl_keys
include dev8_smsq_smsq_base_keys
include dev8_keys_sys
; The lines ;----------- in this code represent line (16 byte) boundaries
; The code is copied to address qxl_netc ($1f000) to ensure line alignment
; The first two enties are to enable the scout and send byte timing to be
; adjusted.
; The timer constants are in the linkage block (a3)
nd_qxlc
bra.s ndi_sscout ; remember to set d1,d3,a3,a4,a5
bra.s ndi_sbytes ; remember to set d2,a1,a3,a4,a5
nop
nop
nop
nop
***********************************
* wait for active / inactive timers - 28.2 cycles / 1.41 us
*
ndt_wact equ *-nd_qxlc+qxl_netc
move.w (a3,d0.w),d0 ; set up timer
;-------------------------------------------
ndt_walp
tst.b (a2) ; wait for active
dbne d0,ndt_walp
rts
dc.w 0,0
ndt_wina equ *-nd_qxlc+qxl_netc
move.w (a3,d0.w),d0
;-------------------------------------------
ndt_wilp
tst.b (a2) ; wait for inactive
dbeq d0,ndt_wilp
rts
dc.w 0,0
ndt_wait equ *-nd_qxlc+qxl_netc
move.w (a3,d0.w),d0
;-------------------------------------------
ndt_wtlp
tst.b (a2) ; wait, ignoring active/inactive
dbra d0,ndt_wtlp
rts
******************************************
* Send Scout: d1 bits in d3 msbytes
*
nd_sscout equ *-nd_qxlc+qxl_netc
ndi_sscout
move.w ndt_tsct(a3),d2 timer constant
lsl.l #8,d3 next bit is lsb
not.l d3
nds_sscbit
;-----------------------------------------
move.w d2,d0
clr.w d3
lsr.l #1,d3
dc.w $50f5,$3200 ; st (a5,d3.w*2)
nop
tst.w d3
bpl.s nds_sact ... net is active
;-----------------------------------------
nds_tact
tst.b (a2)
dbne d0,nds_tact 31us in loop
bra.s nds_nxts
dc.w 0,0,0,0
;-----------------------------------------
nds_sact
tst.b (a2)
dbra d0,nds_sact 31us in loop
moveq #0,d0
*
nds_nxts
dbne d1,nds_sscbit 32us loop gives scout 480 us +
rts
dc.w 0
;----------------------------------------
dc.w 0,0,0
********************************
* Send d2 bytes (a1)
*
nd_sbytes equ *-nd_qxlc+qxl_netc
ndi_sbytes
moveq #ndt_paus,d0 pause 140 us
jsr ndt_wait
moveq #0,d3 preset send byte to 1s
;----------------------------------------
nds_byloop
move.b (a1)+,d3 get byte
not.b d3
add.w d3,d3 shift left
addq.b #1,d3
lsl.w #2,d3 preceded by two stop bits
swap d3 in msword
moveq #12,d1 send 13 bits altogether
*
nds_bit_loop
asr.l #1,d3 get next bit
;----------------------------------------
dc.w $50f5,$3200 ; st (a5,d3.w*2)
nop
move.w ndt_send(a3),d0
subq.w #4,d0 ; go down in counts of 4
bge.s *-2
roxr.w #2,d0 ; v clear ls bits in carry and sign
;----------------------------------------
bcs.s nds_eb23
bpl.s nds_eb0
dc.w $59fc ; trapvs
bra.s nds_eb1
nds_eb23
bpl.s nds_eb2
bra.s nds_eb3
moveq #0,d0
moveq #0,d0
;----------------------------------------
nds_eb3
bra.s nds_ebit
dc.w $59fc ; trapvs
nds_eb0
dc.w $59fc ; trapvs
nds_eb1
nds_eb2
dc.w $59fc ; trapvs
nds_ebit
clr.w d3
dbra d1,nds_bit_loop hopefully about 224 cycles
subq.w #1,d2 next byte
;----------------------------------------
bne.s nds_byloop
*
st (a4) inactive
rts
******************************************************
* Read bytes (byte count d2, checksum d4, address a1)
*
nd_rbytes equ *-nd_qxlc+qxl_netc
move.l nd_rpnt(a0),a1 read multiple bytes into data buffer
nd_r1byte equ *-nd_qxlc+qxl_netc
moveq #0,d4 checksum
moveq #ndt_rtmo,d0 initial timeout
ndr_byloop
moveq #8,d1 eight bits per byte (plus start bit)
;----------------------------------------
jsr ndt_wact wait for net to go active
beq.s ndr_nc ... oops, loss of comms
*
ndr_start
tst.b (a2) wait for start bit
dbeq d0,ndr_start
bne.s ndr_nc ... oops, loss of comms
;----------------------------------------
move.w ndt_rdly(a3),d0 set up start bit timer
bra.s ndr_bwait
ndr_bit_loop
move.w ndt_rbit(a3),d0
ndr_bwait
subq.w #4,d0 ; go down in counts of 4
bge.s *-2
roxr.w #2,d0 ; v clear ls bits in carry and sign
;----------------------------------------
bcs.s ndr_eb23
bpl.s ndr_eb0
dc.w $59fc ; trapvs
bra.s ndr_eb1
ndr_eb23
bpl.s ndr_eb2
bra.s ndr_eb3
moveq #0,d0
moveq #0,d0
;----------------------------------------
ndr_eb3
bra.s ndr_rbit
dc.w $59fc ; trapvs
ndr_eb0
dc.w $59fc ; trapvs
ndr_eb1
ndr_eb2
dc.w $59fc ; trapvs
;----------------------------------------
ndr_rbit
move.b (a2),d3 next data bit
ror.w #1,d3
dbra d1,ndr_bit_loop
lsr.w #8,d3 get byte into low end
move.b d3,(a1)+ put into buffer
add.w d3,d4 and add to checksum
moveq #ndt_rbto,d0 subsequent byte timeout = about 7 bits
subq.w #1,d2 next byte
bne.s ndr_byloop
rts
ndr_nc
moveq #err.nc,d0
rts
nd_qxle
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*******************************************
* Set Buffer Pointers
*
nd_sbuf
bsr.s nd_srpnt get pointer to data block
move.l a1,nd_epnt(a0) set end pointer
rts
nd_srpnt
lea nd_data(a0),a1 get pointer to data block
move.l a1,nd_rpnt(a0) set running pointer
rts
page
*******************************************
* Network read packet
*
nd_read0
clr.w nd_blkl(a0) clear block number
nd_read
bsr.l nd_setup setup registers etc.
bsr.s nd_sbuf set buffer pointers
*
* check there's a gap at least 200us long
*
moveq #ndt_wgap,d0 test 200us
jsr ndt_wact
bne.s nd_e2_nc
*
* Gap found, look for scout for 20ms (50us active),
*
and.w #$f8ff,sr reenable interrupts
moveq #ndt_lsct,d0 wait 20ms
jsr ndt_wact
beq.s nd_e3_nc ... no
or.w #$0700,sr disable interrupts
moveq #ndt_csct,d0 test 40us
jsr ndt_wina
nd_e3_nc
beq.s nd_e1_nc not a scout
*
moveq #ndt_esct,d0
jsr ndt_wait wait 490us until end of scout
*
* Scout found and skipped, read header
*
bsr.l ndr_headr read header
nd_e2_nc
bne.s nd_e1_nc ... oops
move.b (a1)+,d0 get destination from packet header
cmp.b nd_self(a0),d0 is it for me?
bne.s nd_e1_nc ... no
move.b (a1)+,d1 get source from packet header
cmp.b nd_dest(a0),d1 is from my preferred source?
beq.s ndr_for_me ... yes
cmp.b nd_dest(a0),d0 will I accept an offer from anybody?
bne.s nd_e1_nc ... no
move.b d1,nd_dest(a0) ... yes, from now on I talk to you only!!
*
ndr_for_me
move.w (a1)+,d5 get block/byte (or checksum)
sub.w nd_blkl(a0),d5 and compare against required
*
move.l (a1),nd_type(a0) set type, number of bytes and checksum
moveq #0,d4 set number of bytes to read
move.b nd_nbyt(a0),d4
addq.b #-nf.sblk,(a1) is it send large block?
bne.s ndr_ackh ... no
lsl.w #2,d4 ... yes, get 4* as many
*
ndr_ackh
bsr.l nds_ack acknowledge header
move.w d4,d2 and set number of bytes to read
jsr nd_rbytes
bne.s nd_bad_block ... oops
cmp.b nd_dchk(a0),d4 was checksum ok?
bne.s nd_bad_block
tst.b nd_dest(a0) was it file server transaction?
blt.s ndr_wchk ... yes
tst.b nd_self(a0)
bge.s ndr_ack ... no, acknowledge
ndr_wchk
cmp.w d5,d4 ... yes, check whole checksum
bne.s nd_bad_block ... ... oops
clr.w d5
ndr_ack
bsr.l nds_ack send acknowledge
*
tst.w d5 was this the right block?
bne.s nd_e1_nc ... no, leave eof flag
move.l a1,nd_epnt(a0) ... yes, set end pointer
bsr.s nd_nextb move to next block
bra.l nd_ex_ok done
*
nd_bad_block
sf nd_type(a0) clear type
nd_e1_nc
bra.l nd_ex_nc not complete
*
* move to next block
*
nd_nextb
addq.b #1,nd_blkl(a0) move block low on one
bcc.s nd_nx_rts
addq.b #1,nd_blkh(a0) carry, so move block high on
nd_nx_rts
rts
page
******************************************************
* Network send packet
*
* Create checksum
*
nd_csum
moveq #0,d4 clear checksum
moveq #0,d2
nd_csloop
move.b (a1)+,d2 get byte
add.w d2,d4 add byte
subq.w #1,d1 next byte
bne.s nd_csloop
rts
*
* Send a packet - if net busy, give up
*
nd_send0
nd_send
bsr.l nd_setup set net mode and registers
*
* Now do all the checksum rubbish so we can go straight on from the scout
*
moveq #0,d5 length of data block
move.b nd_nbyt(a0),d5
cmp.b #nf.sblk,nd_type(a0) is it remote file block?
bne.s nds_cdata ... no, create data checksum
lsl.w #2,d5 ... yes, 4* as many bytes
nds_cdata
move.w d5,d1 create checksum
lea nd_data(a0),a1 of data
bsr.s nd_csum
move.b d4,nd_dchk(a0) in data checksum loc
tst.b nd_self(a0) is it server
blt.s nds_wchk ... yes
tst.b nd_dest(a0)
bge.s nds_chead ... no, just create header checksum
nds_wchk
move.w d4,nd_blkl(a0) ... yes, set word checksum in block number
nds_chead
moveq #7,d1 create checksum
lea nd_hedr(a0),a1 of header
bsr.s nd_csum
move.b d4,(a1) in header checksum loc at end of header
*
subq.l #7,a1 backspace to start of header
*
* Now send a scout, checking if anyone else is
*
moveq #-1,d3 preset 1s
move.w nd_dest(a0),d3 get destination and self
lsl.b #3,d3 11111111.11111111.000ddddd.sssss000
addq.b #3,d3 11111111.11111111.000ddddd.sssss011
lsl.w #2,d3 11111111.11111111.0dddddss.sss01100
lsl.l #6,d3 11111111.110ddddd.sssss011.00000000
moveq #14,d1 send 15 bits 110xxxxxxxxxxxx01
*
* Wait at least 3 ms for any other scout
*
moveq #ndt_wsct,d0 3ms
jsr ndt_wact ... wait for active
bne.s nd_unset ... net active return +ve
*
jsr nd_sscout
bne.s nd_ex_nc ; busy
tst.b nd_dest(a0) was it broadcast?
bne.s nds_header ... no, send header
moveq #ndt_xsct,d0 ... yes, wait = 5ms
jsr ndt_wait with net active
*
nds_header
moveq #8,d2 send eight bytes from header
bsr.l nds_half (half a packets worth)
bne.s nd_ex_nc ... oops
*
move.w d5,d2 length of data block
bsr.s nds_half (the other half of the packet)
bne.s nd_ex_nc ... oops
*
tst.b nd_dest(a0) was it broadcast?
bne.s nds_done ... no, done
*
moveq #ndt_back,d0 wait 500us
jsr ndt_wact looking for active
beq.s nd_ex_nc ... no acknowledge
moveq #ndt_bace,d0 for 20ms
jsr ndt_wina look for inactive
*
moveq #ndt_back,d0 wait 500us
jsr ndt_wact looking for active
bne.s nd_ex_nc ... nack
nds_done
bsr.l nd_nextb
page
*
* Exits
*
nd_ex_ok
moveq #0,d0 OK
bra.s nd_unset
nd_ex_nc
moveq #err.nc,d0 not complete - quite normal
nd_unset
nd_exit
move.l d0,d1
move.w (sp)+,sys_castt(a6)
bne.s ndex_rest ; no cache or suppressed
jsr sms.cenab ; enable both
bra.s ndex_rest
ndex_ninst
jsr sms.cenab ; enable both
jsr sms.cdisi ; disable instruction
ndex_rest
move.l d1,d0
movem.l (sp)+,d1-d7/a1/a2/a4/a5 pop regs
and.w #$f8ff,sr reenable interrupts
rts
*
* setup network, save regs, set cache etc
*
* a2 r neti
* a4 r netl
* a5 r neth
*
nd_setup
move.l (sp)+,d0 pop return address
movem.l d1-d7/a1/a2/a4/a5,-(sp) save regs
move.l d0,a1 ... return is jmp (a1)
lea qxl_neti,a2
lea qxl_netl,a4
lea qxl_neth,a5 net low is a5 -$8000-$8000
or.w #$0700,sr no interrupts
move.w sys_castt(a6),-(sp) save cache status
st sys_castt(a6) kill cache
jsr sms.cdisb disable both caches
jmp (a1)
page
*
* Send procedures
*
* Send half a packet (byte count d2, address a1)
*
nds_half
jsr nd_sbytes send bytes
tst.b nd_dest(a0) is it b/cast?
beq.s nds_rts ... yes, done
moveq #1,d2 receive one byte reply
lea nd_data-1(a0),a1 put into header checksum
jsr nd_r1byte
subq.b #1,d4 result should be 1
nds_rts
rts
*
* Send acknowledge
*
nds_ack
moveq #1,d2 send one byte
move.l a1,-(sp)
move.b d2,-(sp)
move.l sp,a1
jsr nd_sbytes
addq.w #2,sp
move.l (sp)+,a1
rts
page
*
* Read procedures
*
* Read header
*
ndr_headr
moveq #8,d2 read eight bytes
jsr nd_rbytes
bne.s ndrh_rts ... oops
sub.b -(a1),d4 take last byte away from checksum
sub.b (a1),d4 is it ok?
subq.l #7,a1 and backspace pointer
ndrh_rts
rts
* d6 c p size of buffer extension
* d7 p direct input bit number
* a0 c p channel definition / $20(a0) header / $28(a0) data block
*
* Network Broadcast
*
nd_bcast
bsr.l nd_sbuf set buffer pointers
add.l d6,nd_epnt(a0) and extend the buffer
bsr.s nd_setup setup registers etc.
ndb_check
move.l nd_rpnt(a0),a1 get running pointer
cmp.l nd_epnt(a0),a1 check for end of buffer
bgt.s ndb_abort
*
* Wait for continuous activity for minimum 500 us
*
ndb_start
bsr.l nd_break check for break
beq.s ndb_wscout not pressed, look for scout
*
ndb_abort
move.b #1,nd_type(a0) ... set eof
bra.s ndb_eof
*
ndb_wscout
moveq #ndt_bsct,d0 500 us of continuous activity
jsr ndt_wina wait for inactive
beq.s ndb_start ... yes, restart
*
bsr.s ndr_headr read bytes
bne.s ndb_nack ... oops
tst.b (a1) was it broadcast?
bne.s ndb_nack ... it must have been!!!
*
addq.l #2,a1 look at block/byte
move.b (a1)+,d5
lsl.w #8,d5
move.b (a1)+,d5
sub.w nd_blkl(a0),d5 and compare against required
*
move.b (a1)+,nd_type(a0) set type
move.b (a1)+,d2 number of bytes
move.b (a1)+,nd_dchk(a0) ... and checksum
*
jsr nd_rbytes
bne.s ndb_nack ... oops
cmp.b nd_dchk(a0),d4 was checksum OK?
bne.s ndb_nack
*
bsr.s ndb_active send acknowledgement
*
tst.w d5 was it the correct block?
bne.s ndb_eof
bsr.l nd_nextb move to next block
move.l a1,nd_rpnt(a0)
ndb_eof
tst.b nd_type(a0) was it eof?
beq.s ndb_check ... no, check if buffer full and continue
*
move.l a1,nd_epnt(a0) ... yes, set end pointer
bsr.l nd_srpnt ... and reset running pointer
bra.l nd_ex_ok
*
ndb_nack
moveq #ndt_wgap,d0 wait for 200us inactive
jsr ndt_wact
beq.s ndb_start network is idle - restart
*
ndb_nact
moveq #ndt_back,d0 check for 500us active
jsr ndt_wina
beq.s ndb_nack not BACK, try again
move.w ndt_bnak(a3),d0 wait 200 us
jsr ndt_wait
*
bsr.s ndb_active
bra.l ndb_start and restart
*
ndb_active
st (a5) set active
moveq #ndt_xack,d0 5000us active
jsr ndt_wait
st (a4) set inactive
rts
end
|
HdGfxLib/libgfxinit/common/hw-gfx-edid.ads | jam3st/edk2 | 1 | 23840 | <gh_stars>1-10
--
-- Copyright (C) 2016 secunet Security Networks AG
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
package HW.GFX.EDID
is
use type Word8;
use type Word16;
subtype Raw_EDID_Index is Natural range 0 .. 127;
subtype Raw_EDID_Data is Buffer (Raw_EDID_Index);
function Valid (Raw_EDID : Raw_EDID_Data) return Boolean;
procedure Sanitize (Raw_EDID : in out Raw_EDID_Data; Success : out Boolean)
with
Post => (if Success then Valid (Raw_EDID));
DESCRIPTOR_1 : constant := 54;
function Read_LE16
(Raw_EDID : Raw_EDID_Data;
Offset : Raw_EDID_Index)
return Word16
with
Pre => Offset < Raw_EDID_Index'Last;
function Compatible_Display
(Raw_EDID : Raw_EDID_Data;
Display : Display_Type)
return Boolean
with
Pre => Valid (Raw_EDID);
function Has_Preferred_Mode (Raw_EDID : Raw_EDID_Data) return Boolean
with
Pre => Valid (Raw_EDID),
Post =>
(Has_Preferred_Mode'Result =
(Int64 (Read_LE16 (Raw_EDID, DESCRIPTOR_1)) * 10_000
in Frequency_Type and
( Raw_EDID (DESCRIPTOR_1 + 2) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 4) and 16#f0#) /= 0) and
( Raw_EDID (DESCRIPTOR_1 + 8) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 11) and 16#c0#) /= 0) and
( Raw_EDID (DESCRIPTOR_1 + 9) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 11) and 16#30#) /= 0) and
( Raw_EDID (DESCRIPTOR_1 + 3) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 4) and 16#0f#) /= 0) and
( Raw_EDID (DESCRIPTOR_1 + 5) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 7) and 16#f0#) /= 0) and
((Raw_EDID (DESCRIPTOR_1 + 10) and 16#f0#) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 11) and 16#0c#) /= 0) and
((Raw_EDID (DESCRIPTOR_1 + 10) and 16#0f#) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 11) and 16#03#) /= 0) and
( Raw_EDID (DESCRIPTOR_1 + 6) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 7) and 16#0f#) /= 0)));
function Preferred_Mode (Raw_EDID : Raw_EDID_Data) return Mode_Type
with
Pre =>
Int64 (Read_LE16 (Raw_EDID, DESCRIPTOR_1)) * 10_000
in Frequency_Type and
( Raw_EDID (DESCRIPTOR_1 + 2) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 4) and 16#f0#) /= 0) and
( Raw_EDID (DESCRIPTOR_1 + 8) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 11) and 16#c0#) /= 0) and
( Raw_EDID (DESCRIPTOR_1 + 9) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 11) and 16#30#) /= 0) and
( Raw_EDID (DESCRIPTOR_1 + 3) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 4) and 16#0f#) /= 0) and
( Raw_EDID (DESCRIPTOR_1 + 5) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 7) and 16#f0#) /= 0) and
((Raw_EDID (DESCRIPTOR_1 + 10) and 16#f0#) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 11) and 16#0c#) /= 0) and
((Raw_EDID (DESCRIPTOR_1 + 10) and 16#0f#) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 11) and 16#03#) /= 0) and
( Raw_EDID (DESCRIPTOR_1 + 6) /= 0 or
(Raw_EDID (DESCRIPTOR_1 + 7) and 16#0f#) /= 0);
end HW.GFX.EDID;
|
src/isa/avx/masm/vrs4_powf.asm | jepler/aocl-libm-ose | 66 | 87013 | ;
; Copyright (C) 2008-2020 Advanced Micro Devices, Inc. All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification,
; are permitted provided that the following conditions are met:
; 1. Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
; 3. Neither the name of the copyright holder nor the names of its contributors
; may be used to endorse or promote products derived from this software without
; specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
; IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
; OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
;
; vrs4powf.asm
;
; A vector implementation of the powf libm function.
;
; Prototype:
;
; __m128 __vrs4_powf(__m128 x,__m128 y);
; float fastpowf(float x, float y);
;
; Computes x raised to the y power. Returns proper C99 values.
; Uses new tuned fastlogf/fastexpf.
;
;
include fm.inc
FN_PROTOTYPE vrs4_powf
fname_exp TEXTEQU <__amd_internal_vrd4_exp>
fname_log TEXTEQU <__amd_internal_vrd4_log>
EXTRN fname_exp:NEAR
EXTRN fname_log:NEAR
CONST SEGMENT
__np_ln_table:
dq 0000000000000000h ; 0
dq 3F8FC0A8B0FC03E4h ;0.015504186535965254
dq 3F9F829B0E783300h ;0.030771658666753687
dq 3FA77458F632DCFCh ;0.045809536031294201
dq 3FAF0A30C01162A6h ; 0.06062462181643484
dq 3FB341D7961BD1D1h ;0.075223421237587532
dq 3FB6F0D28AE56B4Ch ;0.089612158689687138
dq 3FBA926D3A4AD563h ; 0.10379679368164356
dq 3FBE27076E2AF2E6h ; 0.11778303565638346
dq 3FC0D77E7CD08E59h ; 0.13157635778871926
dq 3FC29552F81FF523h ; 0.14518200984449789
dq 3FC44D2B6CCB7D1Eh ; 0.15860503017663857
dq 3FC5FF3070A793D4h ; 0.17185025692665923
dq 3FC7AB890210D909h ; 0.18492233849401199
dq 3FC9525A9CF456B4h ; 0.19782574332991987
dq 3FCAF3C94E80BFF3h ; 0.21056476910734964
dq 3FCC8FF7C79A9A22h ; 0.22314355131420976
dq 3FCE27076E2AF2E6h ; 0.23556607131276691
dq 3FCFB9186D5E3E2Bh ; 0.24783616390458127
dq 3FD0A324E27390E3h ; 0.25995752443692605
dq 3FD1675CABABA60Eh ; 0.27193371548364176
dq 3FD22941FBCF7966h ; 0.28376817313064462
dq 3FD2E8E2BAE11D31h ; 0.2954642128938359
dq 3FD3A64C556945EAh ; 0.30702503529491187
dq 3FD4618BC21C5EC2h ; 0.31845373111853459
dq 3FD51AAD872DF82Dh ; 0.32975328637246798
dq 3FD5D1BDBF5809CAh ; 0.34092658697059319
dq 3FD686C81E9B14AFh ; 0.3519764231571782
dq 3FD739D7F6BBD007h ; 0.36290549368936847
dq 3FD7EAF83B82AFC3h ; 0.37371640979358406
dq 3FD89A3386C1425Bh ; 0.38441169891033206
dq 3FD947941C2116FBh ; 0.39499380824086899
dq 3FD9F323ECBF984Ch ; 0.40546510810816438
dq 3FDA9CEC9A9A084Ah ; 0.41582789514371099
dq 3FDB44F77BCC8F63h ; 0.42608439531090009
dq 3FDBEB4D9DA71B7Ch ; 0.43623676677491807
dq 3FDC8FF7C79A9A22h ; 0.44628710262841953
dq 3FDD32FE7E00EBD5h ; 0.45623743348158757
dq 3FDDD46A04C1C4A1h ; 0.46608972992459924
dq 3FDE744261D68788h ; 0.47584590486996392
dq 3FDF128F5FAF06EDh ; 0.48550781578170082
dq 3FDFAF588F78F31Fh ; 0.49507726679785152
dq 3FE02552A5A5D0FFh ; 0.50455601075239531
dq 3FE0723E5C1CDF40h ; 0.51394575110223428
dq 3FE0BE72E4252A83h ; 0.52324814376454787
dq 3FE109F39E2D4C97h ; 0.53246479886947184
dq 3FE154C3D2F4D5EAh ; 0.54159728243274441
dq 3FE19EE6B467C96Fh ; 0.5506471179526623
dq 3FE1E85F5E7040D0h ; 0.55961578793542266
dq 3FE23130D7BEBF43h ; 0.56850473535266877
dq 3FE2795E1289B11Bh ; 0.57731536503482361
dq 3FE2C0E9ED448E8Ch ; 0.58604904500357824
dq 3FE307D7334F10BEh ; 0.59470710774669278
dq 3FE34E289D9CE1D3h ; 0.60329085143808425
dq 3FE393E0D3562A1Ah ; 0.61180154110599294
dq 3FE3D9026A7156FBh ; 0.62024040975185757
dq 3FE41D8FE84672AEh ; 0.62860865942237409
dq 3FE4618BC21C5EC2h ; 0.63690746223706918
dq 3FE4A4F85DB03EBBh ; 0.6451379613735847
dq 3FE4E7D811B75BB1h ; 0.65330127201274568
dq 3FE52A2D265BC5ABh ; 0.66139848224536502
dq 3FE56BF9D5B3F399h ; 0.66943065394262924
dq 3FE5AD404C359F2Dh ; 0.67739882359180614
dq 3FE5EE02A9241675h ; 0.68530400309891937
dq 3FE62E42FEFA39EFh ; 0.69314718055994529
dq 0 ; for alignment
__two_to_jby32_table label qword
DQ 03FF0000000000000h ; 1
DQ 03FF059B0D3158574h ; 1.0219
DQ 03FF0B5586CF9890Fh ; 1.04427
DQ 03FF11301D0125B51h ; 1.06714
DQ 03FF172B83C7D517Bh ; 1.09051
DQ 03FF1D4873168B9AAh ; 1.11439
DQ 03FF2387A6E756238h ; 1.13879
DQ 03FF29E9DF51FDEE1h ; 1.16372
DQ 03FF306FE0A31B715h ; 1.18921
DQ 03FF371A7373AA9CBh ; 1.21525
DQ 03FF3DEA64C123422h ; 1.24186
DQ 03FF44E086061892Dh ; 1.26905
DQ 03FF4BFDAD5362A27h ; 1.29684
DQ 03FF5342B569D4F82h ; 1.32524
DQ 03FF5AB07DD485429h ; 1.35426
DQ 03FF6247EB03A5585h ; 1.38391
DQ 03FF6A09E667F3BCDh ; 1.41421
DQ 03FF71F75E8EC5F74h ; 1.44518
DQ 03FF7A11473EB0187h ; 1.47683
DQ 03FF82589994CCE13h ; 1.50916
DQ 03FF8ACE5422AA0DBh ; 1.54221
DQ 03FF93737B0CDC5E5h ; 1.57598
DQ 03FF9C49182A3F090h ; 1.61049
DQ 03FFA5503B23E255Dh ; 1.64576
DQ 03FFAE89F995AD3ADh ; 1.68179
DQ 03FFB7F76F2FB5E47h ; 1.71862
DQ 03FFC199BDD85529Ch ; 1.75625
DQ 03FFCB720DCEF9069h ; 1.79471
DQ 03FFD5818DCFBA487h ; 1.83401
DQ 03FFDFC97337B9B5Fh ; 1.87417
DQ 03FFEA4AFA2A490DAh ; 1.91521
DQ 03FFF50765B6E4540h ; 1.95714
__real_3f80000000000000 DQ 03f80000000000000h ; /* 0.0078125 = 1/128 */
dq 0
__real_3FA5555555545D4E DQ 03FA5555555545D4Eh ; 4.16666666662260795726e-02 used in splitexp
dq 0
__real_3FC5555555548F7C DQ 03FC5555555548F7Ch ; 1.66666666665260878863e-01 used in splitexp
dq 0
__real_one DQ 03ff0000000000000h ; 1.0
dq 0 ; for alignment
__real_two DQ 04000000000000000h ; 1.0
dq 0
__real_ca1 DQ 03fb55555555554e6h ; 8.33333333333317923934e-02
dq 0 ; for alignment
__real_ca2 DQ 03f89999999bac6d4h ; 1.25000000037717509602e-02
dq 0 ; for alignment
; from Maple:
;Digits :=40;
;minimax(2*ln(1+v/2), v=0..1/256, 7,1 ,'maxerror');
__real_cb1 DQ 03fb555555555552ch ; 0.08333333333333275459088388736767942281572 from maple
dq 0 ; for alignment
__real_cb2 DQ 03F8999998EAB53DBh ; 0.01249999968187325554473232707489405493533
dq 0 ; for alignment
__real_log2 DQ 03FE62E42FEFA39EFh ; log2_lead 6.9314718055994530941723e-01
dq 0 ; for alignment
__real_half DQ 03fe0000000000000h ; 1/2
dq 0 ; for alignment
__real_infinity DQ 07ff0000000000000h ;
dq 0 ; for alignment
__real_thirtytwo_by_log2 DQ 040471547652b82feh ; thirtytwo_by_log2
dq 0
__real_log2_by_32 DQ 03F962E42FEFA39EFh ; log2_by_32
dq 0
__mask_sign DQ 08000000080000000h ; a sign bit mask
dq 08000000080000000h
__mask_nsign DQ 07FFFFFFF7FFFFFFFh ; a not sign bit mask
dq 07FFFFFFF7FFFFFFFh
; used by inty
__mask_127 DQ 00000007F0000007Fh ; EXPBIAS_SP32
dq 00000007F0000007Fh
__mask_mant DQ 0007FFFFF007FFFFFh ; mantissa bit mask
dq 0007FFFFF007FFFFFh
__mask_1 DQ 00000000100000001h ; 1
dq 00000000100000001h
__mask_2 DQ 00000000200000002h ; 2
dq 00000000200000002h
__mask_24 DQ 00000001800000018h ; 24
dq 00000001800000018h
__mask_23 DQ 00000001700000017h ; 23
dq 00000001700000017h
; used by special case checking
__float_one DQ 03f8000003f800000h ; one
dq 03f8000003f800000h
__mask_inf DQ 07f8000007F800000h ; inifinity
dq 07f8000007F800000h
__mask_ninf DQ 0ff800000fF800000h ; -inifinity
dq 0ff800000fF800000h
__mask_NaN DQ 07fC000007FC00000h ; NaN
dq 07fC000007FC00000h
__mask_sigbit DQ 00040000000400000h ; QNaN bit
dq 00040000000400000h
__mask_impbit DQ 00080000000800000h ; implicit bit
dq 00080000000800000h
__mask_ly DQ 04f0000004f000000h ; large y
dq 04f0000004f000000h
CONST ENDS
; define local variable storage offsets
p_temp equ 00h ; xmmword
p_negateres equ 10h ; qword
p_xexp equ 20h ; qword
save_rbx equ 030h ;qword
save_rsi equ 038h ;qword
p_xptr equ 040h ; ptr to x values
p_yptr equ 048h ; ptr to y values
p_ax equ 050h ; absolute x
p_sx equ 060h ; sign of x's
p_ay equ 070h ; absolute y
p_yexp equ 080h ; unbiased exponent of y
p_inty equ 090h ; integer y indicators
stack_size equ 0A8h ; allocate 40h more than
; we need to avoid bank conflicts
TEXT SEGMENT page 'CODE'
PUBLIC fname
fname proc frame
sub rsp,stack_size
.ALLOCSTACK stack_size
; movd edx,xmm0 ; edx is ux
mov QWORD PTR [rsp+save_rbx],rbx ; save rbx
.SAVEREG rbx, save_rbx
mov QWORD PTR [rsp+save_rsi],rsi ; save rsi
.SAVEREG rsi, save_rsi
.ENDPROLOG
movups xmm0, XMMWORD PTR [rcx]
movups xmm1, XMMWORD PTR [rdx]
mov QWORD PTR p_xptr[rsp],rcx ; save pointer to x
mov QWORD PTR p_yptr[rsp],rdx ; save pointer to y
movaps xmm2,xmm0
andps xmm0,XMMWORD PTR __mask_nsign ; get abs x
andps xmm2,XMMWORD PTR __mask_sign ; mask for the sign bits
movaps XMMWORD PTR p_ax[rsp],xmm0 ; save them
movaps XMMWORD PTR p_sx[rsp],xmm2 ; save them
; convert all four x's to double
cvtps2pd xmm0,QWORD PTR p_ax[rsp]
cvtps2pd xmm1,QWORD PTR p_ax+8[rsp]
;
; classify y
; vector 32 bit integer method 25 cycles to here
; /* See whether y is an integer.
; inty = 0 means not an integer.
; inty = 1 means odd integer.
; inty = 2 means even integer.
; */
movdqa xmm4,XMMWORD PTR [rdx]
pxor xmm3,xmm3
pand xmm4,XMMWORD PTR __mask_nsign ; get abs y in integer format
movdqa XMMWORD PTR p_ay[rsp],xmm4 ; save it
; see if the number is less than 1.0
psrld xmm4,23 ;>> EXPSHIFTBITS_SP32
psubd xmm4,XMMWORD PTR __mask_127 ; yexp, unbiased exponent
movdqa XMMWORD PTR p_yexp[rsp],xmm4 ; save it
paddd xmm4,XMMWORD PTR __mask_1 ; yexp+1
pcmpgtd xmm4,xmm3 ; 0 if exp less than 126 (2^0) (y < 1.0), else FFs
; xmm4 is ffs if abs(y) >=1.0, else 0
; see if the mantissa has fractional bits
;build mask for mantissa
movdqa xmm2,XMMWORD PTR __mask_23
psubd xmm2,XMMWORD PTR p_yexp[rsp] ; 24-yexp
pmaxsw xmm2,xmm3 ; no shift counts less than 0
movdqa XMMWORD PTR p_temp[rsp],xmm2 ; save the shift counts
; create mask for all four values
; SSE can't individual shifts so have to do each one seperately
mov rcx,QWORD PTR p_temp[rsp]
mov rbx,1
shl ebx,cl ;1 << (24 - yexp)
shr rcx,32
mov eax,1
shl eax,cl ;1 << (24 - yexp)
shl rax,32
add rbx,rax
mov QWORD PTR p_temp+[rsp],rbx
mov rcx,QWORD PTR p_temp+8[rsp]
mov rbx,1
shl ebx,cl ;1 << (24 - yexp)
shr rcx,32
mov eax,1
shl eax,cl ;1 << (24 - yexp)
shl rax,32
add rax,rbx
mov QWORD PTR p_temp+8[rsp],rax
movdqa xmm5,XMMWORD PTR p_temp[rsp]
psubd xmm5,XMMWORD PTR __mask_1 ;= mask = (1 << (24 - yexp)) - 1
; now use the mask to see if there are any fractional bits
movdqa xmm2,XMMWORD PTR [rdx] ; get uy
pand xmm2,xmm5 ; uy & mask
pcmpeqd xmm2,xmm3 ; 0 if not zero (y has fractional mantissa bits), else FFs
pand xmm2,xmm4 ; either 0s or ff
; xmm2 now accounts for y< 1.0 or y>=1.0 and y has fractional mantissa bits,
; it has the value 0 if we know it's non-integer or ff if integer.
; now see if it's even or odd.
; if yexp > 24, then it has to be even
movdqa xmm4,XMMWORD PTR __mask_24
psubd xmm4,XMMWORD PTR p_yexp[rsp] ; 24-yexp
paddd xmm5,XMMWORD PTR __mask_1 ; mask+1 = least significant integer bit
pcmpgtd xmm4,xmm3 ; if 0, then must be even, else ff's
pand xmm5,xmm4 ; set the integer bit mask to zero if yexp>24
paddd xmm4,XMMWORD PTR __mask_2
por xmm4,XMMWORD PTR __mask_2
pand xmm4,xmm2 ; result can be 0, 2, or 3
; now for integer numbers, see if odd or even
pand xmm5,XMMWORD PTR __mask_mant ; mask out exponent bits
movdqa xmm2,XMMWORD PTR __float_one
pand xmm5,XMMWORD PTR [rdx] ; & uy -> even or odd
pcmpeqd xmm2,XMMWORD PTR p_ay[rsp] ; is ay equal to 1, ff's if so, then it's odd
pand xmm2,XMMWORD PTR __mask_nsign ; strip the sign bit so the gt comparison works.
por xmm5,xmm2
pcmpgtd xmm5,xmm3 ; if odd then ff's, else 0's for even
paddd xmm5,XMMWORD PTR __mask_2 ; gives us 2 for even, 1 for odd
pand xmm4,xmm5
movdqa XMMWORD PTR p_inty[rsp],xmm4 ; save inty
;
; do more x special case checking
;
movdqa xmm5,xmm4
pcmpeqd xmm5,xmm3 ; is not an integer? ff's if so
pand xmm5,XMMWORD PTR __mask_NaN ; these values will be NaNs, if x<0
movdqa xmm2,xmm4
pcmpeqd xmm2,XMMWORD PTR __mask_1 ; is it odd? ff's if so
pand xmm2,XMMWORD PTR __mask_sign ; these values will get their sign bit set
por xmm5,xmm2
pcmpeqd xmm3,XMMWORD PTR p_sx[rsp] ; if the signs are set
pandn xmm3,xmm5 ; then negateres gets the values as shown below
movdqa XMMWORD PTR p_negateres[rsp],xmm3 ; save negateres
; /* p_negateres now means the following.
; 7FC00000 means x<0, y not an integer, return NaN.
; 80000000 means x<0, y is odd integer, so set the sign bit.
; 0 means even integer, and/or x>=0.
; */
; **** Here starts the main calculations ****
; The algorithm used is x**y = exp(y*log(x))
; Extra precision is required in intermediate steps to meet the 1ulp requirement
;
; log(x) calculation
call fname_log ; get the double precision log value
; for all four x's
; y* logx
; convert all four y's to double
mov rdx,QWORD PTR p_yptr[rsp] ; get pointer to y
cvtps2pd xmm2,QWORD PTR [rdx]
cvtps2pd xmm3,QWORD PTR 8[rdx]
; /* just multiply by y */
mulpd xmm0,xmm2
mulpd xmm1,xmm3
; /* The following code computes r = exp(w) */
call fname_exp ; get the double exp value
; for all four y*log(x)'s
;
; convert all four results to double
cvtpd2ps xmm0,xmm0
cvtpd2ps xmm1,xmm1
movlhps xmm0,xmm1
; perform special case and error checking on input values
; special case checking is done first in the scalar version since
; it allows for early fast returns. But for vectors, we consider them
; to be rare, so early returns are not necessary. So we first compute
; the x**y values, and then check for special cases.
; we do some of the checking in reverse order of the scalar version.
mov rdx,QWORD PTR p_yptr[rsp] ; get pointer to y
; apply the negate result flags
orps xmm0,XMMWORD PTR p_negateres[rsp] ; get negateres
; if y is infinite or so large that the result would overflow or underflow
movdqa xmm4,XMMWORD PTR p_ay[rsp]
cmpps xmm4,XMMWORD PTR __mask_ly,5 ; y not less than large value, ffs if so.
movmskps edx,xmm4
test edx,0fh
jnz y_large
rnsx3:
; if x is infinite
movdqa xmm4,XMMWORD PTR p_ax[rsp]
cmpps xmm4,XMMWORD PTR __mask_inf,0 ; equal to infinity, ffs if so.
movmskps edx,xmm4
test edx,0fh
jnz x_infinite
rnsx1:
; if x is zero
xorps xmm4,xmm4
cmpps xmm4,XMMWORD PTR p_ax[rsp],0 ; equal to zero, ffs if so.
movmskps edx,xmm4
test edx,0fh
jnz x_zero
rnsx2:
; if y is NAN
mov rdx,QWORD PTR p_yptr[rsp] ; get pointer to y
movdqa xmm4,XMMWORD PTR [rdx] ; get y
cmpps xmm4,xmm4,4 ; a compare not equal of y to itself should
; be false, unless y is a NaN. ff's if NaN.
movmskps ecx,xmm4
test ecx,0fh
jnz y_NaN
rnsx4:
; if x is NAN
mov rdx,QWORD PTR p_xptr[rsp] ; get pointer to x
movdqa xmm4,XMMWORD PTR [rdx] ; get x
cmpps xmm4,xmm4,4 ; a compare not equal of x to itself should
; be false, unless x is a NaN. ff's if NaN.
movmskps ecx,xmm4
test ecx,0fh
jnz x_NaN
rnsx5:
; if |y| == 0 then return 1
movdqa xmm3,XMMWORD PTR __float_one ; one
xorps xmm2,xmm2
cmpps xmm2,XMMWORD PTR p_ay[rsp],4 ; not equal to 0.0?, ffs if not equal.
andps xmm0,xmm2 ; keep the others
andnps xmm2,xmm3 ; mask for ones
orps xmm0,xmm2
; if x == +1, return +1 for all x
mov rdx,QWORD PTR p_xptr[rsp] ; get pointer to y
movdqa xmm2,xmm3
cmpps xmm2,XMMWORD PTR [rdx],4 ; not equal to +1.0?, ffs if not equal.
andps xmm0,xmm2 ; keep the others
andnps xmm2,xmm3 ; mask for ones
orps xmm0,xmm2
__powf_cleanup2:
mov rbx,[rsp+save_rbx] ; restore rbx
mov rsi,[rsp+save_rsi] ; restore rsi
add rsp,stack_size
ret
align 16
; /* y is a NaN.
y_nan:
mov rdx,QWORD PTR p_yptr[rsp] ; get pointer to y
movdqa xmm4,XMMWORD PTR [rdx] ; get y
movdqa xmm3,xmm4
movdqa xmm5,xmm4
movdqa xmm2,XMMWORD PTR __mask_sigbit ; get the signalling bits
cmpps xmm4,xmm4,0 ; a compare equal of y to itself should
; be true, unless y is a NaN. 0's if NaN.
cmpps xmm3,xmm3,4 ; compare not equal, ff's if NaN.
andps xmm0,xmm4 ; keep the other results
andps xmm2,xmm3 ; get just the right signalling bits
andps xmm3,xmm5 ; mask for the NaNs
orps xmm3,xmm2 ; convert to QNaNs
orps xmm0,xmm3 ; combine
jmp rnsx4
; /* y is a NaN.
x_nan:
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
movdqa xmm4,XMMWORD PTR [rcx] ; get x
movdqa xmm3,xmm4
movdqa xmm5,xmm4
movdqa xmm2,XMMWORD PTR __mask_sigbit ; get the signalling bits
cmpps xmm4,xmm4,0 ; a compare equal of x to itself should
; be true, unless x is a NaN. 0's if NaN.
cmpps xmm3,xmm3,4 ; compare not equal, ff's if NaN.
andps xmm0,xmm4 ; keep the other results
andps xmm2,xmm3 ; get just the right signalling bits
andps xmm3,xmm5 ; mask for the NaNs
orps xmm3,xmm2 ; convert to QNaNs
orps xmm0,xmm3 ; combine
jmp rnsx5
; /* y is infinite or so large that the result would
; overflow or underflow.
y_large:
movdqa XMMWORD PTR p_temp[rsp],xmm0
test edx,1
jz ylrga
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR [rcx]
mov ebx,DWORD PTR [rbx]
mov ecx,DWORD PTR p_inty[rsp]
sub rsp,8
call np_special6 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp[rsp],eax
ylrga:
test edx,2
jz ylrgb
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 4[rcx]
mov ebx,DWORD PTR 4[rbx]
mov ecx,DWORD PTR p_inty+4[rsp]
sub rsp,8
call np_special6 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+4[rsp],eax
ylrgb:
test edx,4
jz ylrgc
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 8[rcx]
mov ebx,DWORD PTR 8[rbx]
mov ecx,DWORD PTR p_inty+8[rsp]
sub rsp,8
call np_special6 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+8[rsp],eax
ylrgc:
test edx,8
jz ylrgd
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 12[rcx]
mov ebx,DWORD PTR 12[rbx]
mov ecx,DWORD PTR p_inty+12[rsp]
sub rsp,8
call np_special6 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+12[rsp],eax
ylrgd:
movdqa xmm0,XMMWORD PTR p_temp[rsp]
jmp rnsx3
; a subroutine to treat an individual x,y pair when y is large or infinity
; assumes x in eax, y in ebx.
; returns result in eax
np_special6:
; handle |x|==1 cases first
mov r8d,07FFFFFFFh
and r8d,eax
cmp r8d,03f800000h ; jump if |x| !=1
jnz nps6
mov eax,03f800000h ; return 1 for all |x|==1
jmp npx64
; cases where |x| !=1
nps6:
mov ecx,07f800000h
xor eax,eax ; assume 0 return
test ebx,080000000h
jnz nps62 ; jump if y negative
; y = +inf
cmp r8d,03f800000h
cmovg eax,ecx ; return inf if |x| < 1
jmp npx64
nps62:
; y = -inf
cmp r8d,03f800000h
cmovl eax,ecx ; return inf if |x| < 1
jmp npx64
npx64:
ret
; handle cases where x is +/- infinity. edx is the mask
align 16
x_infinite:
movdqa XMMWORD PTR p_temp[rsp],xmm0
test edx,1
jz xinfa
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR [rcx]
mov ebx,DWORD PTR [rbx]
mov ecx,DWORD PTR p_inty[rsp]
sub rsp,8
call np_special_x1 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp[rsp],eax
xinfa:
test edx,2
jz xinfb
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 4[rcx]
mov ebx,DWORD PTR 4[rbx]
mov ecx,DWORD PTR p_inty+4[rsp]
sub rsp,8
call np_special_x1 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+4[rsp],eax
xinfb:
test edx,4
jz xinfc
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 8[rcx]
mov ebx,DWORD PTR 8[rbx]
mov ecx,DWORD PTR p_inty+8[rsp]
sub rsp,8
call np_special_x1 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+8[rsp],eax
xinfc:
test edx,8
jz xinfd
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 12[rcx]
mov ebx,DWORD PTR 12[rbx]
mov ecx,DWORD PTR p_inty+12[rsp]
sub rsp,8
call np_special_x1 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+12[rsp],eax
xinfd:
movdqa xmm0,XMMWORD PTR p_temp[rsp]
jmp rnsx1
; a subroutine to treat an individual x,y pair when x is +/-infinity
; assumes x in eax,y in ebx, inty in ecx.
; returns result in eax
np_special_x1: ; x is infinite
test eax,080000000h ; is x positive
jnz nsx11 ; jump if not
test ebx,080000000h ; is y positive
jz nsx13 ; just return if so
xor eax,eax ; else return 0
jmp nsx13
nsx11:
cmp ecx,1 ; if inty ==1
jnz nsx12 ; jump if not
test ebx,080000000h ; is y positive
jz nsx13 ; just return if so
mov eax,080000000h ; else return -0
jmp nsx13
nsx12: ; inty <>1
and eax,07FFFFFFFh ; return -x (|x|) if y<0
test ebx,080000000h ; is y positive
jz nsx13 ;
xor eax,eax ; return 0 if y >=0
nsx13:
ret
; handle cases where x is +/- zero. edx is the mask of x,y pairs with |x|=0
align 16
x_zero:
movdqa XMMWORD PTR p_temp[rsp],xmm0
test edx,1
jz xzera
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR [rcx]
mov ebx,DWORD PTR [rbx]
mov ecx,DWORD PTR p_inty[rsp]
sub rsp,8
call np_special_x2 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp[rsp],eax
xzera:
test edx,2
jz xzerb
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 4[rcx]
mov ebx,DWORD PTR 4[rbx]
mov ecx,DWORD PTR p_inty+4[rsp]
sub rsp,8
call np_special_x2 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+4[rsp],eax
xzerb:
test edx,4
jz xzerc
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 8[rcx]
mov ebx,DWORD PTR 8[rbx]
mov ecx,DWORD PTR p_inty+8[rsp]
sub rsp,8
call np_special_x2 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+8[rsp],eax
xzerc:
test edx,8
jz xzerd
mov rcx,QWORD PTR p_xptr[rsp] ; get pointer to x
mov rbx,QWORD PTR p_yptr[rsp] ; get pointer to y
mov eax,DWORD PTR 12[rcx]
mov ebx,DWORD PTR 12[rbx]
mov ecx,DWORD PTR p_inty+12[rsp]
sub rsp,8
call np_special_x2 ; call the handler for one value
add rsp,8
mov DWORD PTR p_temp+12[rsp],eax
xzerd:
movdqa xmm0,XMMWORD PTR p_temp[rsp]
jmp rnsx2
; a subroutine to treat an individual x,y pair when x is +/-0
; assumes x in eax,y in ebx, inty in ecx.
; returns result in eax
align 16
np_special_x2:
cmp ecx,1 ; if inty ==1
jz nsx21 ; jump if so
; handle cases of x=+/-0, y not integer
xor eax,eax
mov ecx,07f800000h
test ebx,080000000h ; is ypos
cmovnz eax,ecx
jmp nsx23
; y is an integer
nsx21:
xor r8d,r8d
mov ecx,07f800000h
test ebx,080000000h ; is ypos
cmovnz r8d,ecx ; set to infinity if not
and eax,080000000h ; pickup the sign of x
or eax,r8d ; and include it in the result
nsx23:
ret
fname endp
TEXT ENDS
END
|
OTPDecode/otpdecode.asm | officialhory/uni_masm | 0 | 247133 | Code Segment
assume CS:Code, DS:Data, SS:Stack
Start:
MOV AX, Code
MOV DS, AX
MOV AX, 0003h
INT 10h
MOV DI, offset secret
MOV SI, offset key
MOV AH, 02
MOV CX, 11
DECODE:
MOV DX, [SI]
XOR DX, [DI]
INC DI
INC SI
INT 21h
LOOP DECODE
END_OF_PROGRAM:
MOV AX, 4c00h
INT 21h
secret db "- 91g.r2#85"
key db "AIRTGORPLKF"
Code Ends
Data Segment
Data Ends
Stack Segment
Stack Ends
End Start
|
source/modules/basic/expressions/logical.asm | paulscottrobson/mega-basic | 3 | 90183 | ; *******************************************************************************************
; *******************************************************************************************
;
; Name : logical.asm
; Purpose : Binary Logical Operators
; Date : 21st August 2019
; Review : 1st September 2019
; Author : <NAME> (<EMAIL>)
;
; *******************************************************************************************
; *******************************************************************************************
; *******************************************************************************************
;
; Logical Binary Operators
;
; *******************************************************************************************
BinaryOp_And: ;; and
jsr BinaryMakeBothInteger
;
lda XS_Mantissa+0,x
and XS2_Mantissa+0,x
sta XS_Mantissa+0,x
lda XS_Mantissa+1,x
and XS2_Mantissa+1,x
sta XS_Mantissa+1,x
lda XS_Mantissa+2,x
and XS2_Mantissa+2,x
sta XS_Mantissa+2,x
lda XS_Mantissa+3,x
and XS2_Mantissa+3,x
sta XS_Mantissa+3,x
rts
BinaryOp_Or: ;; or
jsr BinaryMakeBothInteger
;
lda XS_Mantissa+0,x
ora XS2_Mantissa+0,x
sta XS_Mantissa+0,x
lda XS_Mantissa+1,x
ora XS2_Mantissa+1,x
sta XS_Mantissa+1,x
lda XS_Mantissa+2,x
ora XS2_Mantissa+2,x
sta XS_Mantissa+2,x
lda XS_Mantissa+3,x
ora XS2_Mantissa+3,x
sta XS_Mantissa+3,x
rts
;
; So I'll be kind to 6502 orientated developers ;-)
;
BinaryOp_Eor: ;; eor
BinaryOp_Xor: ;; xor
jsr BinaryMakeBothInteger
;
lda XS_Mantissa+0,x
eor XS2_Mantissa+0,x
sta XS_Mantissa+0,x
lda XS_Mantissa+1,x
eor XS2_Mantissa+1,x
sta XS_Mantissa+1,x
lda XS_Mantissa+2,x
eor XS2_Mantissa+2,x
sta XS_Mantissa+2,x
lda XS_Mantissa+3,x
eor XS2_Mantissa+3,x
sta XS_Mantissa+3,x
rts
; *******************************************************************************************
;
; Routine to convert both types to integer
;
; *******************************************************************************************
BinaryMakeBothInteger:
phx ; save X
inx6 ; go to next
jsr BinaryMakeInteger ; convert to integer.
plx ; restore X and fall through.
BinaryMakeInteger:
lda XS_Type,x ; get type byte.
and #15 ; check type zero
beq _BMIConvert ; if float convert to integer.
lsr a ; if bit 0 clear it's not an integer
bcc _BMIError
rts
;
_BMIConvert:
.if hasFloat==1
jmp FPUToInteger ; convert to integer
.endif
_BMIError:
jmp TypeError
|
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/NES_Ver2/us_scr/zel_endz.asm | prismotizm/gigaleak | 0 | 13518 | <filename>other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/NES_Ver2/us_scr/zel_endz.asm
Name: zel_endz.asm
Type: file
Size: 25
Last-Modified: '2016-05-13T04:27:09Z'
SHA-1: E758FE70B96333E454AD956E7FFFE3AED717464F
Description: null
|
programs/oeis/157/A157364.asm | neoneye/loda | 22 | 89405 | ; A157364: a(n) = 4802*n^2 - 196*n + 1.
; 4607,18817,42631,76049,119071,171697,233927,305761,387199,478241,578887,689137,808991,938449,1077511,1226177,1384447,1552321,1729799,1916881,2113567,2319857,2535751,2761249,2996351,3241057,3495367,3759281,4032799,4315921,4608647,4910977,5222911,5544449,5875591,6216337,6566687,6926641,7296199,7675361,8064127,8462497,8870471,9288049,9715231,10152017,10598407,11054401,11519999,11995201,12480007,12974417,13478431,13992049,14515271,15048097,15590527,16142561,16704199,17275441,17856287,18446737,19046791,19656449,20275711,20904577,21543047,22191121,22848799,23516081,24192967,24879457,25575551,26281249,26996551,27721457,28455967,29200081,29953799,30717121,31490047,32272577,33064711,33866449,34677791,35498737,36329287,37169441,38019199,38878561,39747527,40626097,41514271,42412049,43319431,44236417,45163007,46099201,47044999,48000401
mov $1,$0
add $0,1
mul $0,7
pow $0,2
mul $1,2
sub $0,$1
sub $0,49
mul $0,98
add $0,4607
|
x86-64-assembly/leap/leap.asm | arlm/exercism | 0 | 176027 | section .text
global leap_year
leap_year:
; Provide your implementation here
ret
|
hydra/grammar/Override.g4 | kychow/hydra | 0 | 5959 | // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
// Regenerate parser by running 'python setup.py antlr' at project root.
// If you make changes here be sure to update the documentation (and update the grammar in command_line_syntax.md)
grammar Override;
override: (
key '=' value? // key=value
| '~' key ('=' value?)? // ~key | ~key=value
| '+' key '=' value? // +key= | +key=value
) EOF;
key :
packageOrGroup // key
| packageOrGroup '@' package (':' package)? // group@pkg | group@pkg1:pkg2
| packageOrGroup '@:' package // group@:pkg2
;
packageOrGroup: package | ID ('/' ID)+; // db, hydra/launcher
package: (ID | DOT_PATH); // db, hydra.launcher
value: element | choiceSweep;
element:
primitive
| listValue
| dictValue
;
choiceSweep: element (',' element)+; // value1,value2,value3
primitive:
WS? (QUOTED_VALUE | // 'hello world', "hello world"
( ID // foo_10
| NULL // null, NULL
| INT // 0, 10, -20, 1_000_000
| FLOAT // 3.14, -20.0, 1e-1, -10e3
| BOOL // true, TrUe, false, False
| DOT_PATH // foo.bar
| INTERPOLATION // ${foo.bar}, ${env:USER,me}
| '/' | ':' | '-' | '\\'
| '+' | '.' | '$' | '*'
)+
)
WS?;
listValue: '[' (element(',' element)*)? ']'; // [], [1,2,3], [a,b,[1,2]]
dictValue: '{' // {}, {a:10,b:20}
(id_ws ':' element (',' id_ws ':' element)*)?
'}';
id_ws: WS? ID WS?;
// Types
fragment DIGIT: [0-9_];
fragment NZ_DIGIT: [1-9];
fragment INT_PART: DIGIT+;
fragment FRACTION: '.' DIGIT+;
fragment POINT_FLOAT: INT_PART? FRACTION | INT_PART '.';
fragment EXPONENT: [eE] [+-]? DIGIT+;
fragment EXPONENT_FLOAT: ( INT_PART | POINT_FLOAT) EXPONENT;
FLOAT: [-]?(POINT_FLOAT | EXPONENT_FLOAT | [Ii][Nn][Ff] | [Nn][Aa][Nn]);
INT: [-]? ('0' | (NZ_DIGIT DIGIT*));
BOOL:
[Tt][Rr][Uu][Ee] // TRUE
| [Ff][Aa][Ll][Ss][Ee]; // FALSE
NULL: [Nn][Uu][Ll][Ll];
fragment CHAR: [a-zA-Z];
ID : (CHAR|'_') (CHAR|DIGIT|'_')*;
fragment LIST_INDEX: '0' | [1-9][0-9]*;
DOT_PATH: (ID | LIST_INDEX) ('.' (ID | LIST_INDEX))+;
WS: (' ' | '\t')+;
QUOTED_VALUE:
'\'' ('\\\''|.)*? '\'' // Single quoted string. can contain escaped single quote : /'
| '"' ('\\"'|.)*? '"' ; // Double quoted string. can contain escaped double quote : /"
INTERPOLATION:
'${' (
// interpolation
(ID | DOT_PATH)
// custom interpolation
| ID ':' (ID | QUOTED_VALUE) (',' (ID | QUOTED_VALUE))*
) '}';
|
prototyping/Luau/Heap.agda | Tr4shh/Roblox-Luau | 0 | 17384 | <reponame>Tr4shh/Roblox-Luau<gh_stars>0
module Luau.Heap where
open import Agda.Builtin.Equality using (_≡_)
open import FFI.Data.Maybe using (Maybe; just)
open import FFI.Data.Vector using (Vector; length; snoc; empty)
open import Luau.Addr using (Addr)
open import Luau.Var using (Var)
open import Luau.Syntax using (Block; Expr; Annotated; FunDec; nil; addr; function_is_end)
data HeapValue (a : Annotated) : Set where
function_is_end : FunDec a → Block a → HeapValue a
Heap : Annotated → Set
Heap a = Vector (HeapValue a)
data _≡_⊕_↦_ {a} : Heap a → Heap a → Addr → HeapValue a → Set where
defn : ∀ {H val} →
-----------------------------------
(snoc H val) ≡ H ⊕ (length H) ↦ val
_[_] : ∀ {a} → Heap a → Addr → Maybe (HeapValue a)
_[_] = FFI.Data.Vector.lookup
∅ : ∀ {a} → Heap a
∅ = empty
data AllocResult a (H : Heap a) (V : HeapValue a) : Set where
ok : ∀ b H′ → (H′ ≡ H ⊕ b ↦ V) → AllocResult a H V
alloc : ∀ {a} H V → AllocResult a H V
alloc H V = ok (length H) (snoc H V) defn
next : ∀ {a} → Heap a → Addr
next = length
allocated : ∀ {a} → Heap a → HeapValue a → Heap a
allocated = snoc
-- next-emp : (length ∅ ≡ 0)
next-emp = FFI.Data.Vector.length-empty
-- lookup-next : ∀ V H → (lookup (allocated H V) (next H) ≡ just V)
lookup-next = FFI.Data.Vector.lookup-snoc
-- lookup-next-emp : ∀ V → (lookup (allocated emp V) 0 ≡ just V)
lookup-next-emp = FFI.Data.Vector.lookup-snoc-empty
|
programs/oeis/179/A179058.asm | neoneye/loda | 22 | 178701 | ; A179058: Number of non-attacking placements of 3 rooks on an n X n board.
; 0,0,6,96,600,2400,7350,18816,42336,86400,163350,290400,490776,794976,1242150,1881600,2774400,3995136,5633766,7797600,10613400,14229600,18818646,24579456,31740000,40560000,51333750,64393056,80110296,98901600,121230150,147609600,178607616,214849536,257022150,305877600,362237400,426996576,501127926,585686400,681813600,790742400,913801686,1052421216,1208136600,1382594400,1577557350,1794909696,2036662656,2304960000,2602083750,2930460000,3292664856,3691430496,4129651350,4610390400,5136885600,5712556416,6341010486,7026050400,7771680600,8582114400,9461781126,10415333376,11447654400,12563865600,13769334150,15069680736,16470787416,17978805600,19600164150,21341577600,23210054496,25212905856,27357753750,29652540000,32105535000,34725346656,37520929446,40501593600,43677014400,47057241600,50652708966,54474243936,58533077400,62840853600,67409640150,72251938176,77380692576,82809302400,88551631350,94622018400,101035288536,107806763616,114952273350,122488166400,130431321600,138799159296,147609652806,156881340000
add $0,1
bin $0,3
pow $0,2
mul $0,6
|
samples/list_user.adb | My-Colaborations/ada-ado | 0 | 12807 | -----------------------------------------------------------------------
-- List_User -- Example of queries
-- Copyright (C) 2010, 2011, 2018 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Samples.User.Model;
with ADO;
with ADO.Drivers;
with ADO.Configs;
with ADO.Queries;
with ADO.Sessions;
with ADO.Connections;
with ADO.Sessions.Factory;
with Util.Log.Loggers;
with Ada.Text_IO;
with Ada.Exceptions;
with Ada.Strings.Unbounded;
procedure List_User is
use Ada.Strings.Unbounded;
use Samples.User.Model;
Factory : ADO.Sessions.Factory.Session_Factory;
begin
Util.Log.Loggers.Initialize ("samples.properties");
-- Initialize the database drivers.
ADO.Drivers.Initialize ("samples.properties");
-- Initialize the session factory to connect to the
-- database defined by 'ado.database' property.
Factory.Create (ADO.Configs.Get_Config ("ado.database"));
declare
DB : ADO.Sessions.Session := Factory.Get_Session;
Context : ADO.Queries.Context;
Users : Samples.User.Model.User_Info_Vector;
begin
-- Execute the 'Query_User_List' query (db/samples/user-list.xml, query 'user-list').
Context.Set_Query (Samples.User.Model.Query_User_List);
List (Object => Users, Session => DB, Context => Context);
-- Print the list
if Users.Is_Empty then
Ada.Text_IO.Put_Line ("User info list is empty.");
Ada.Text_IO.Put_Line ("Use the 'add_user' to add users in the table.");
else
declare
Iter : Samples.User.Model.User_Info_Vectors.Cursor := Users.First;
User : Samples.User.Model.User_Info;
begin
while Samples.User.Model.User_Info_Vectors.Has_Element (Iter) loop
User := Samples.User.Model.User_Info_Vectors.Element (Iter);
Ada.Text_IO.Put (ADO.Identifier'Image (User.Id));
Ada.Text_IO.Set_Col (10);
Ada.Text_IO.Put (To_String (User.Name));
Ada.Text_IO.Set_Col (60);
Ada.Text_IO.Put_Line (To_String (User.Email));
Samples.User.Model.User_Info_Vectors.Next (Iter);
end loop;
end;
end if;
end;
exception
when E : ADO.Connections.Database_Error | ADO.Sessions.Connection_Error =>
Ada.Text_IO.Put_Line ("Cannot connect to database: "
& Ada.Exceptions.Exception_Message (E));
end List_User;
|
Codes/Chapter10/P03/P10-03.asm | ar-ekt/Dandamudi-Assembly-Solutions | 8 | 245795 | global _start
extern ExitProcess
%INCLUDE "lib.h"
%macro puti 1
i2a DWORD %1, buffer
puts buffer
%endmacro
section .data
MAX_STRING_SIZE EQU 100
NULL EQU 0
NEWLINE db 10, NULL
MSG_STRING_INPUT db "Enter string: ", NULL
MSG_OUTPUT db "Result: ", NULL
section .bss
buffer resb MAX_STRING_SIZE
string resb MAX_STRING_SIZE
section .code
_start:
puts MSG_STRING_INPUT
fgets string, MAX_STRING_SIZE
push string
call is_palindrome
puts MSG_OUTPUT
puti EAX
puts NEWLINE
_end:
push DWORD 0
call ExitProcess
;--------------------proc is_palindrome---------------------;
; Receives a string pointer. If not a string, CF is set ;
; otherwise, returns 1 in EAX if the string is a palindrome ;
; otherwise, it returns 0 with CF = 0. ;
;-----------------------------------------------------------;
is_palindrome:
%define string DWORD [EBP+8]
enter 0, 0
push string
call str_len ; called to check string
jc is_palindrome_no_string
push string
call str_cln ; remove blanks punctuation marks and converts all uppercase characters to lowercase
push string
push buffer
call str_rev ; puts reversed of string into buffer
push string
push buffer
call str_cmp ; compare string and buffer
cmp EAX, 0
je is_palindrome_true
jmp is_palindrome_false
is_palindrome_true:
mov EAX, 1 ; EAX = 1 => string is palindrome
clc ; clear carry to indicate no error
jmp SHORT is_palindrome_done
is_palindrome_false:
xor EAX, EAX ; EAX = 1 => string is not palindrome
clc ; clear carry to indicate no error
jmp SHORT is_palindrome_done
is_palindrome_no_string:
stc
is_palindrome_done:
leave
ret 4 ; clear stack and return
;-----------------------proc str_cln-----------------------;
; Receives a string pointer If not a string, CF is set ;
; otherwise, remove blanks, punctuation marks and converts ;
; all uppercase characters to lowercase with CF = 0. ;
;----------------------------------------------------------;
str_cln:
%define string DWORD [EBP+8]
enter 0,0
push EAX
push EDI
push ESI
mov EDI, buffer ; copy buffer pointer to EDI
mov ESI, string ; copy string pointer to ESI
dec ESI
clean_loop: ; iterate string while pointing character is not NULL
inc ESI
cmp [ESI], BYTE NULL
je clean_loop_done
lower_check: ; check if the character is a lowercase alphabet
cmp [ESI], BYTE 'a'
jl digit_check
cmp [ESI], BYTE 'z'
jg digit_check
mov EAX, [ESI]
mov [EDI], EAX
inc EDI
jmp clean_loop
digit_check: ; check if the character is a digit
cmp [ESI], BYTE '0'
jl upper_check
cmp [ESI], BYTE '9'
jg upper_check
mov EAX, [ESI]
mov [EDI], EAX
inc EDI
jmp clean_loop
upper_check: ; check if the character is a uppercase alphabet
cmp [ESI], BYTE 'A'
jl clean_loop
cmp [ESI], BYTE 'Z'
jg clean_loop
mov EAX, [ESI]
add EAX, 32 ; convert to lowercase
mov [EDI], EAX
inc EDI
jmp clean_loop
clean_loop_done:
mov [EDI], BYTE NULL ; set NULL to end of buffer
push string
push buffer
call str_cpy ; copy buffer to string
str_cln_done:
pop ESI
pop EDI
pop EAX
leave
ret 4 ; clear stack and return
;-----------------------proc str_cmp------------------------;
; Receives two string pointers. If string2 is not a string, ;
; CF is set otherwise, string1 and string2 are compared and ;
; returns a value in EAX with CF = 0 as shown below: ;
; EAX = negative value if string1 < string2 ;
; EAX = zero if string1 = string2 ;
; EAX = positive value if string1 > string2 ;
;-----------------------------------------------------------;
str_cmp:
%define string2 DWORD [EBP+8]
%define string1 DWORD [EBP+12]
enter 0, 0
push ECX
push EDI
push ESI
mov EDI, string1 ; copy string1 pointer to EDI
mov ESI, string2 ; copy string2 pointer to ESI
push ESI
call str_len ; string2 length
jc str_cmp_no_string
mov ECX, EAX ; string2 length in ECX
inc ECX ; add 1 to include NULL
cld ; forward direction
repe cmpsb ; compare first ECX characters of string2 and string1
je same
ja above
jmp below
below:
mov EAX, -1 ; EAX = -1 => string1 < string2
clc ; clear carry to indicate no error
jmp SHORT str_cmp_done
same:
xor EAX, EAX ; EAX = 0 => string match
clc ; clear carry to indicate no error
jmp SHORT str_cmp_done
above:
mov EAX, 1 ; EAX = 1 => string1 > string2
clc ; clear carry to indicate no error
jmp SHORT str_cmp_done
str_cmp_no_string:
stc ; carry set => no string
str_cmp_done:
pop ESI
pop EDI
pop ECX
leave
ret 8 ; clear stack and return
;--------------------proc str_cpy-------------------;
; Receives two string pointers. If string2 is not a ;
; string, CF is set otherwise, string2 is copied to ;
; string1 and the offeset of string1 is returned in ;
; EAX with CF = 0. ;
;---------------------------------------------------;
str_cpy:
%define string2 DWORD [EBP+8]
%define string1 DWORD [EBP+12]
enter 0, 0
push EAX
push ECX
push EDI
push ESI
mov EDI, string1 ; copy string1 pointer to EDI
mov ESI, string2 ; copy string2 pointer to ESI
push ESI
call str_len ; string2 length
jc str_cpy_no_string
mov ECX, EAX ; string2 length in ECX
inc ECX
cld ; forward direction
rep movsb ; move first ECX characters from string2 to string1
mov EAX, string1
clc ; clear carry to indicate no error
jmp SHORT str_cpy_done
str_cpy_no_string:
stc ; carry set => no string
str_cpy_done:
pop ESI
pop EDI
pop ECX
pop EAX
leave
ret 8 ; clear stack and return
;-----------------------proc str_rev------------------------;
; Receives two string pointer If not a string, CF is set ;
; otherwise, copy first string to second string in reverse. ;
;-----------------------------------------------------------;
str_rev:
%define string2 DWORD [EBP+8]
%define string1 DWORD [EBP+12]
enter 0, 0
push ECX
push EAX
push EDI
push ESI
mov EDI, string1 ; copy string1 pointer to EDI
mov ESI, string2 ; copy string2 pointer to ESI
push ESI
call str_len ; string2 length
jc str_rev_no_string
mov ECX, EAX ; set loop counter
add ESI, EAX ; point to the end of the string2
dec ESI
str_rev_loop: ; loop to copy string2 to string1 in reverse
mov EAX, [ESI]
mov [EDI], EAX
inc EDI
dec ESI
loop str_rev_loop
mov [EDI], BYTE NULL ; set NULL to end of string1
clc ; clear carry to indicate no error
str_rev_no_string:
stc ; carry set => no string
str_rev_done:
pop ESI
pop EDI
pop EAX
pop ECX
leave
ret 8 ; clear stack and return
;-----------------------proc str_len-----------------------;
; Receives a string pointer. If not a string, CF is set ;
; otherwise, string length is returned in EAX with CF = 0. ;
;----------------------------------------------------------;
str_len:
%define string1 DWORD [EBP+8]
enter 0, 0
push ECX
push EDI
mov EDI, string1 ; copy string pointer to EDI
mov ECX, MAX_STRING_SIZE ; need to terminate loop if EDI is not pointing to a string
cld ; forward search
mov AL, NULL ; NULL character
repne scasb
jcxz str_len_no_string ; if ECX = 0, not a string
dec EDI ; back up to point to NULL
mov EAX, EDI
sub EAX, string1 ; string length in EAX
clc ; clear carry to indicate no error
jmp SHORT str_len_done
str_len_no_string:
stc ; carry set => no string
str_len_done:
pop EDI
pop ECX
leave
ret 4 ; clear stack and return |
.emacs.d/elpa/wisi-3.1.3/wisitoken-bnf-output_ada.adb | caqg/linux-home | 0 | 18216 | <reponame>caqg/linux-home
-- Abstract :
--
-- Output Ada code implementing the grammar defined by input
-- parameters, and a parser for that grammar. The grammar parser
-- actions must be Ada.
--
-- Copyright (C) 2017 - 2020 Free Software Foundation, Inc.
--
-- The WisiToken package is free software; you can redistribute it
-- and/or modify it under terms of the GNU General Public License as
-- published by the Free Software Foundation; either version 3, or
-- (at your option) any later version. This library is distributed in
-- the hope that it will be useful, but WITHOUT ANY WARRANTY; without
-- even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-- PARTICULAR PURPOSE.
--
-- As a special exception under Section 7 of GPL version 3, you are granted
-- additional permissions described in the GCC Runtime Library Exception,
-- version 3.1, as published by the Free Software Foundation.
pragma License (Modified_GPL);
with Ada.Strings.Fixed;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Regexp;
with WisiToken.BNF.Generate_Packrat;
with WisiToken.BNF.Generate_Utils;
with WisiToken.BNF.Output_Ada_Common; use WisiToken.BNF.Output_Ada_Common;
with WisiToken.Generate.Packrat;
with WisiToken_Grammar_Runtime;
procedure WisiToken.BNF.Output_Ada
(Input_Data : in WisiToken_Grammar_Runtime.User_Data_Type;
Output_File_Name_Root : in String;
Generate_Data : aliased in WisiToken.BNF.Generate_Utils.Generate_Data;
Packrat_Data : in WisiToken.Generate.Packrat.Data;
Tuple : in Generate_Tuple;
Test_Main : in Boolean;
Multiple_Tuples : in Boolean)
is
Common_Data : Output_Ada_Common.Common_Data := WisiToken.BNF.Output_Ada_Common.Initialize
(Input_Data, Tuple, Output_File_Name_Root, Check_Interface => False);
Gen_Alg_Name : constant String :=
(if Test_Main or Multiple_Tuples
then "_" & Generate_Algorithm_Image (Common_Data.Generate_Algorithm).all
else "");
function Symbol_Regexp (Item : in String) return String
is begin
-- Return a regular expression string that matches Item as a symbol;
-- it must be preceded and followed by non-symbol characters.
--
-- GNAT.Regexp does not have a char for 'end of string', so we hope
-- that doesn't occur. Sigh.
return ".*[ (\.]" & Item & "[ );\.,].*";
end Symbol_Regexp;
procedure Create_Ada_Actions_Body
(Action_Names : not null access WisiToken.Names_Array_Array;
Check_Names : not null access WisiToken.Names_Array_Array;
Label_Count : in Ada.Containers.Count_Type;
Package_Name : in String)
is
use all type Ada.Containers.Count_Type;
use GNAT.Regexp;
use Generate_Utils;
use WisiToken.Generate;
File_Name : constant String := Output_File_Name_Root & "_actions.adb";
User_Data_Regexp : constant Regexp := Compile (Symbol_Regexp ("User_Data"), Case_Sensitive => False);
Tree_Regexp : constant Regexp := Compile (Symbol_Regexp ("Tree"), Case_Sensitive => False);
Nonterm_Regexp : constant Regexp := Compile (Symbol_Regexp ("Nonterm"), Case_Sensitive => False);
Tokens_Regexp : constant Regexp := Compile (Symbol_Regexp ("Tokens"), Case_Sensitive => False);
Body_File : File_Type;
begin
Create (Body_File, Out_File, File_Name);
Set_Output (Body_File);
Indent := 1;
Put_File_Header (Ada_Comment, Use_Tuple => True, Tuple => Tuple);
Put_Raw_Code (Ada_Comment, Input_Data.Raw_Code (Copyright_License));
Put_Raw_Code (Ada_Comment, Input_Data.Raw_Code (Actions_Body_Context));
New_Line;
if Label_Count > 0 then
Put_Line ("with SAL;");
end if;
Put_Line ("package body " & Package_Name & " is");
Indent := Indent + 3;
New_Line;
if Input_Data.Check_Count > 0 then
Indent_Line ("use WisiToken.Semantic_Checks;");
New_Line;
end if;
Put_Raw_Code (Ada_Comment, Input_Data.Raw_Code (Actions_Body_Pre));
-- generate Action and Check subprograms.
for Rule of Input_Data.Tokens.Rules loop
-- No need for a Token_Cursor here, since we only need the
-- nonterminals.
declare
use Ada.Strings.Unbounded;
LHS_ID : constant WisiToken.Token_ID := Find_Token_ID (Generate_Data, -Rule.Left_Hand_Side);
RHS_Index : Integer := 0;
function Is_Elisp (Action : in Unbounded_String) return Boolean
is begin
return Length (Action) >= 6 and then
(Slice (Action, 1, 6) = "(progn" or
Slice (Action, 1, 5) = "wisi-");
end Is_Elisp;
procedure Put_Labels (RHS : in RHS_Type; Line : in String)
is
Output : array (Rule.Labels.First_Index .. Rule.Labels.Last_Index) of Boolean := (others => False);
procedure Update_Output (Label : in String)
is begin
for I in Rule.Labels.First_Index .. Rule.Labels.Last_Index loop
if Label = Rule.Labels (I) then
Output (I) := True;
end if;
end loop;
end Update_Output;
begin
for I in RHS.Tokens.First_Index .. RHS.Tokens.Last_Index loop
if Length (RHS.Tokens (I).Label) > 0 then
declare
Label : constant String := -RHS.Tokens (I).Label;
begin
if Match (Line, Compile (Symbol_Regexp (Label), Case_Sensitive => False)) then
Indent_Line
(Label & " : constant SAL.Peek_Type :=" & SAL.Peek_Type'Image (I) & ";");
Update_Output (Label);
end if;
end;
end if;
end loop;
for I in Rule.Labels.First_Index .. Rule.Labels.Last_Index loop
if not Output (I) and
Match (Line, Compile (Symbol_Regexp (-Rule.Labels (I)), Case_Sensitive => False))
then
Indent_Line (-Rule.Labels (I) & " : constant SAL.Base_Peek_Type := SAL.Base_Peek_Type'First;");
end if;
end loop;
end Put_Labels;
begin
for RHS of Rule.Right_Hand_Sides loop
if Length (RHS.Action) > 0 and then not Is_Elisp (RHS.Action) then
declare
Line : constant String := -RHS.Action;
-- Actually multiple lines; we assume the formatting is adequate.
Name : constant String := Action_Names (LHS_ID)(RHS_Index).all;
Unref_User_Data : Boolean := True;
Unref_Tree : Boolean := True;
Unref_Nonterm : Boolean := True;
Unref_Tokens : Boolean := True;
Need_Comma : Boolean := False;
procedure Check_Unref (Line : in String)
is begin
if Match (Line, User_Data_Regexp) then
Unref_User_Data := False;
end if;
if Match (Line, Tree_Regexp) then
Unref_Tree := False;
end if;
if Match (Line, Nonterm_Regexp) then
Unref_Nonterm := False;
end if;
if Match (Line, Tokens_Regexp) then
Unref_Tokens := False;
end if;
end Check_Unref;
begin
Check_Unref (Line);
Indent_Line ("procedure " & Name);
Indent_Line (" (User_Data : in out WisiToken.Syntax_Trees.User_Data_Type'Class;");
Indent_Line (" Tree : in out WisiToken.Syntax_Trees.Tree;");
Indent_Line (" Nonterm : in WisiToken.Valid_Node_Index;");
Indent_Line (" Tokens : in WisiToken.Valid_Node_Index_Array)");
Indent_Line ("is");
Indent := Indent + 3;
if Unref_User_Data or Unref_Tree or Unref_Nonterm or Unref_Tokens then
Indent_Start ("pragma Unreferenced (");
if Unref_User_Data then
Put ("User_Data");
Need_Comma := True;
end if;
if Unref_Tree then
Put ((if Need_Comma then ", " else "") & "Tree");
Need_Comma := True;
end if;
if Unref_Nonterm then
Put ((if Need_Comma then ", " else "") & "Nonterm");
Need_Comma := True;
end if;
if Unref_Tokens then
Put ((if Need_Comma then ", " else "") & "Tokens");
Need_Comma := True;
end if;
Put_Line (");");
end if;
Put_Labels (RHS, Line);
Indent := Indent - 3;
Indent_Line ("begin");
Indent := Indent + 3;
Indent_Line (Line);
Indent := Indent - 3;
Indent_Line ("end " & Name & ";");
New_Line;
end;
end if;
if Length (RHS.Check) > 0 and then not Is_Elisp (RHS.Check) then
declare
use Ada.Strings.Fixed;
Line : constant String := -RHS.Check;
Name : constant String := Check_Names (LHS_ID)(RHS_Index).all;
Unref_Lexer : constant Boolean := 0 = Index (Line, "Lexer");
Unref_Nonterm : constant Boolean := 0 = Index (Line, "Nonterm");
Unref_Tokens : constant Boolean := 0 = Index (Line, "Tokens");
Unref_Recover : constant Boolean := 0 = Index (Line, "Recover_Active");
Need_Comma : Boolean := False;
begin
Indent_Line ("function " & Name);
Indent_Line (" (Lexer : access constant WisiToken.Lexer.Instance'Class;");
Indent_Line (" Nonterm : in out WisiToken.Recover_Token;");
Indent_Line (" Tokens : in WisiToken.Recover_Token_Array;");
Indent_Line (" Recover_Active : in Boolean)");
Indent_Line (" return WisiToken.Semantic_Checks.Check_Status");
Indent_Line ("is");
Indent := Indent + 3;
if Unref_Lexer or Unref_Nonterm or Unref_Tokens or Unref_Recover then
Indent_Start ("pragma Unreferenced (");
if Unref_Lexer then
Put ("Lexer");
Need_Comma := True;
end if;
if Unref_Nonterm then
Put ((if Need_Comma then ", " else "") & "Nonterm");
Need_Comma := True;
end if;
if Unref_Tokens then
Put ((if Need_Comma then ", " else "") & "Tokens");
Need_Comma := True;
end if;
if Unref_Recover then
Put ((if Need_Comma then ", " else "") & "Recover_Active");
Need_Comma := True;
end if;
Put_Line (");");
end if;
Put_Labels (RHS, Line);
Indent := Indent - 3;
Indent_Line ("begin");
Indent := Indent + 3;
Indent_Line (Line);
Indent := Indent - 3;
Indent_Line ("end " & Name & ";");
New_Line;
end;
end if;
RHS_Index := RHS_Index + 1;
end loop;
end;
end loop;
Put_Raw_Code (Ada_Comment, Input_Data.Raw_Code (Actions_Body_Post));
Put_Line ("end " & Package_Name & ";");
Close (Body_File);
Set_Output (Standard_Output);
end Create_Ada_Actions_Body;
procedure Create_Ada_Main_Body
(Actions_Package_Name : in String;
Main_Package_Name : in String)
is
use WisiToken.Generate;
File_Name : constant String := To_Lower (Main_Package_Name) & ".adb";
re2c_Package_Name : constant String := -Common_Data.Lower_File_Name_Root & "_re2c_c";
Body_File : File_Type;
begin
Create (Body_File, Out_File, File_Name);
Set_Output (Body_File);
Indent := 1;
Put_File_Header (Ada_Comment, Use_Tuple => True, Tuple => Tuple);
Put_Raw_Code (Ada_Comment, Input_Data.Raw_Code (Copyright_License));
New_Line;
if (case Common_Data.Generate_Algorithm is
when LR_Generate_Algorithm => Input_Data.Action_Count > 0 or Input_Data.Check_Count > 0,
when Packrat_Generate_Algorithm | External => Input_Data.Action_Count > 0)
then
Put_Line ("with " & Actions_Package_Name & "; use " & Actions_Package_Name & ";");
end if;
case Common_Data.Lexer is
when None | Elisp_Lexer =>
null;
when re2c_Lexer =>
Put_Line ("with WisiToken.Lexer.re2c;");
Put_Line ("with " & re2c_Package_Name & ";");
end case;
case Common_Data.Generate_Algorithm is
when LR_Generate_Algorithm =>
null;
when Packrat_Gen =>
Put_Line ("with WisiToken.Parse.Packrat.Generated;");
when Packrat_Proc =>
Put_Line ("with WisiToken.Parse.Packrat.Procedural;");
Put_Line ("with WisiToken.Productions;");
when External =>
null;
end case;
Put_Line ("package body " & Main_Package_Name & " is");
Indent := Indent + 3;
New_Line;
case Common_Data.Lexer is
when None | Elisp_Lexer =>
null;
when re2c_Lexer =>
Indent_Line ("package Lexer is new WisiToken.Lexer.re2c");
Indent_Line (" (" & re2c_Package_Name & ".New_Lexer,");
Indent_Line (" " & re2c_Package_Name & ".Free_Lexer,");
Indent_Line (" " & re2c_Package_Name & ".Reset_Lexer,");
Indent_Line (" " & re2c_Package_Name & ".Next_Token);");
New_Line;
end case;
case Common_Data.Generate_Algorithm is
when LR_Generate_Algorithm =>
LR_Create_Create_Parser (Input_Data, Common_Data, Generate_Data);
when Packrat_Gen =>
WisiToken.BNF.Generate_Packrat (Packrat_Data, Generate_Data);
Packrat_Create_Create_Parser (Common_Data, Generate_Data, Packrat_Data);
when Packrat_Proc =>
Packrat_Create_Create_Parser (Common_Data, Generate_Data, Packrat_Data);
when External =>
External_Create_Create_Grammar (Generate_Data);
end case;
Put_Line ("end " & Main_Package_Name & ";");
Close (Body_File);
Set_Output (Standard_Output);
end Create_Ada_Main_Body;
procedure Create_Ada_Test_Main
(Actions_Package_Name : in String;
Main_Package_Name : in String)
is
use WisiToken.Generate;
Generic_Package_Name : constant String :=
(case Common_Data.Generate_Algorithm is
when LR_Generate_Algorithm =>
(if Input_Data.Language_Params.Error_Recover then
(if Common_Data.Text_Rep
then "Gen_LR_Text_Rep_Parser_Run"
else "Gen_LR_Parser_Run")
else
(if Common_Data.Text_Rep
then "Gen_LR_Text_Rep_Parser_No_Recover_Run"
else "Gen_LR_Parser_No_Recover_Run")),
when Packrat_Generate_Algorithm => "Gen_Packrat_Parser_Run",
when External => raise SAL.Programmer_Error);
Unit_Name : constant String := File_Name_To_Ada (Output_File_Name_Root) &
"_" & Generate_Algorithm'Image (Common_Data.Generate_Algorithm) & "_Run";
Default_Language_Runtime_Package : constant String := "WisiToken.Parse.LR.McKenzie_Recover." & File_Name_To_Ada
(Output_File_Name_Root);
File_Name : constant String := To_Lower (Unit_Name) & ".ads";
File : File_Type;
begin
Create (File, Out_File, File_Name);
Set_Output (File);
Indent := 1;
Put_File_Header (Ada_Comment, Use_Tuple => True, Tuple => Tuple);
-- no Copyright_License; just a test file
New_Line;
Put_Line ("with " & Generic_Package_Name & ";");
Put_Line ("with " & Actions_Package_Name & ";");
Put_Line ("with " & Main_Package_Name & ";");
if Input_Data.Language_Params.Error_Recover and
Input_Data.Language_Params.Use_Language_Runtime
then
declare
Pkg : constant String :=
(if -Input_Data.Language_Params.Language_Runtime_Name = ""
then Default_Language_Runtime_Package
else -Input_Data.Language_Params.Language_Runtime_Name);
begin
-- For language-specific names in actions, checks.
Put_Line ("with " & Pkg & ";");
Put_Line ("use " & Pkg & ";");
end;
end if;
Put_Line ("procedure " & Unit_Name & " is new " & Generic_Package_Name);
Put_Line (" (" & Actions_Package_Name & ".Descriptor,");
if Common_Data.Text_Rep then
Put_Line (" """ & Output_File_Name_Root & "_" &
To_Lower (Generate_Algorithm_Image (Tuple.Gen_Alg).all) &
"_parse_table.txt"",");
end if;
if Input_Data.Language_Params.Error_Recover then
if Input_Data.Language_Params.Use_Language_Runtime then
Put_Line ("Fixes'Access, Matching_Begin_Tokens'Access, String_ID_Set'Access,");
else
Put_Line ("null, null, null,");
end if;
end if;
Put_Line (Main_Package_Name & ".Create_Parser);");
Close (File);
Set_Output (Standard_Output);
end Create_Ada_Test_Main;
begin
case Common_Data.Lexer is
when None | re2c_Lexer =>
null;
when Elisp_Lexer =>
raise User_Error with WisiToken.Generate.Error_Message
(Input_Data.Grammar_Lexer.File_Name, 1, "Ada output language does not support " & Lexer_Image
(Common_Data.Lexer).all & " lexer");
end case;
case Tuple.Interface_Kind is
when None =>
null;
when Module | Process =>
raise User_Error with WisiToken.Generate.Error_Message
(Input_Data.Grammar_Lexer.File_Name, 1, "Ada output language does not support setting Interface");
end case;
declare
Main_Package_Name : constant String := File_Name_To_Ada (Output_File_Name_Root & Gen_Alg_Name) & "_Main";
Actions_Package_Name : constant String := File_Name_To_Ada (Output_File_Name_Root) & "_Actions";
begin
if Input_Data.Action_Count > 0 or Input_Data.Check_Count > 0 then
-- Some WisiToken tests have no actions or checks.
Create_Ada_Actions_Body
(Generate_Data.Action_Names, Generate_Data.Check_Names, Input_Data.Label_Count, Actions_Package_Name);
end if;
Create_Ada_Actions_Spec
(Output_File_Name_Root & "_actions.ads", Actions_Package_Name, Input_Data, Common_Data, Generate_Data);
if Tuple.Gen_Alg = External then
Create_External_Main_Spec (Main_Package_Name, Tuple, Input_Data);
Create_Ada_Main_Body (Actions_Package_Name, Main_Package_Name);
else
Create_Ada_Main_Body (Actions_Package_Name, Main_Package_Name);
Create_Ada_Main_Spec (To_Lower (Main_Package_Name) & ".ads", Main_Package_Name, Input_Data, Common_Data);
if Test_Main then
Create_Ada_Test_Main (Actions_Package_Name, Main_Package_Name);
end if;
end if;
end;
exception
when others =>
Set_Output (Standard_Output);
raise;
end WisiToken.BNF.Output_Ada;
|
assembler/tests/t_900addr/t_900addr.asm | paulscottrobson/RCA-Cosmac-VIP-III | 0 | 246678 | cpu 96c141
page 0
maxmode on
; ordinary case with dest=reg and src=mem:
; operand & default autoinc/dec amount is given by register
; 8 bit:
LD A,(XBC+) ; hex = C5 E4 21
LD A,(XBC+:1)
LD A,(XBC++1)
LD A,(XBC+:2) ; disassembler 1 : hex = C5 E5 21
LD A,(XBC++2) ; disassembler 2 : hex = C5 E5 21
LD A,(XBC+:4) ; hex = C5 E6 21
LD A,(XBC++4) ; hex = C5 E6 21
LD A,(-XBC) ; equal to 1--
LD A,(-XBC:1)
LD A,(1--XBC)
LD A,(-XBC:2)
LD A,(2--XBC)
LD A,(-XBC:4)
LD A,(4--XBC)
; 16 bit:
LD WA,(XBC+) ; equal to ++2
LD WA,(XBC+:1)
LD WA,(XBC++1)
LD WA,(XBC+:2)
LD WA,(XBC++2)
LD WA,(XBC+:4)
LD WA,(XBC++4)
LD WA,(-XBC) ; equal to 2--
LD WA,(-XBC:1)
LD WA,(1--XBC)
LD WA,(-XBC:2)
LD WA,(2--XBC)
LD WA,(-XBC:4)
LD WA,(4--XBC)
; 32 bit:
LD XWA,(XBC+) ; equal to ++4
LD XWA,(XBC+:1)
LD XWA,(XBC++1)
LD XWA,(XBC+:2)
LD XWA,(XBC++2)
LD XWA,(XBC+:4)
LD XWA,(XBC++4)
LD XWA,(-XBC) ; equal to 4--
LD XWA,(-XBC:1)
LD XWA,(1--XBC)
LD XWA,(-XBC:2)
LD XWA,(2--XBC)
LD XWA,(-XBC:4)
LD XWA,(4--XBC)
; reverse case dest=mem and src=reg:
; operand size & autoinc/dec default amount is given by src register
; if inc/dec amount no specified explicitly, fixed up later after
; src register has been parsed
; 8 bit:
LD (XBC+),A
LD (XBC+:1),A
LD (XBC++1),A
LD (XBC+:2),A
LD (XBC++2),A
LD (XBC+:4),A
LD (XBC++4),A
LD (-XBC),A
LD (-XBC:1),A
LD (1--XBC),A
LD (-XBC:2),A
LD (2--XBC),A
LD (-XBC:4),A
LD (4--XBC),A
; 16 bit:
LD (XBC+),WA
LD (XBC+:1),WA
LD (XBC++1),WA
LD (XBC+:2),WA
LD (XBC++2),WA
LD (XBC+:4),WA
LD (XBC++4),WA
LD (-XBC),WA
LD (-XBC:1),WA
LD (1--XBC),WA
LD (-XBC:2),WA
LD (2--XBC),WA
LD (-XBC:4),WA
LD (4--XBC),WA
; 32 bit:
LD (XBC+),XWA
LD (XBC+:1),XWA
LD (XBC++1),XWA
LD (XBC+:2),XWA
LD (XBC++2),XWA
LD (XBC+:4),XWA
LD (XBC++4),XWA
LD (-XBC),XWA
LD (-XBC:1),XWA
LD (1--XBC),XWA
LD (-XBC:2),XWA
LD (2--XBC),XWA
LD (-XBC:4),XWA
LD (4--XBC),XWA
; LDA case: in principle, the "operand size" is unknown, since
; no actual data transfer takes place. However, we assume 16/32 bits,
; deduced from the 16/32 bit destination register taking the effective address
LDA XWA,XSP
LDA XWA,(XSP)
LDA XIX,XIY+33h
LDA XIX,(XIY+33h)
LDA XIX,XIY+
LDA XIX,(XIY+)
LDA XIX,XIY+:1
LDA XIX,(XIY+:1)
LDA XIX,XIY++1
LDA XIX,(XIY++1)
LDA XIX,XIY+:2
LDA XIX,(XIY+:2)
LDA XIX,XIY++2
LDA XIX,(XIY++2)
LDA XIX,XIY+:4
LDA XIX,(XIY+:4)
LDA XIX,XIY++4
LDA XIX,(XIY++4)
LDA XIX,-XIY
LDA XIX,(-XIY)
LDA XIX,-XIY:1
LDA XIX,(-XIY:1)
LDA XIX,1--XIY
LDA XIX,(1--XIY)
LDA XIX,-XIY:2
LDA XIX,(-XIY:2)
LDA XIX,2--XIY
LDA XIX,(2--XIY)
LDA XIX,-XIY:4
LDA XIX,(-XIY:4)
LDA XIX,4--XIY
LDA XIX,(4--XIY)
|
Syntax/Type.agda | Lolirofle/stuff-in-agda | 6 | 9729 | <reponame>Lolirofle/stuff-in-agda<filename>Syntax/Type.agda
module Syntax.Type where
open import Type
-- Assures that a value has a certain type
type-ascript : ∀{ℓ} → (T : Type{ℓ}) → T → T
type-ascript T x = x
{-# INLINE type-ascript #-}
_:-[_] = type-ascript
infixr 0.98 _:-[_]
{-# INLINE _:-[_] #-}
infixl 10 type-ascript
syntax type-ascript T x = x :of: T
|
2-low/neural/source/private/neural-privvy.adb | charlie5/lace | 20 | 3461 | <reponame>charlie5/lace<filename>2-low/neural/source/private/neural-privvy.adb<gh_stars>10-100
package body Neural.Privvy is
procedure dummy is begin null; end dummy; -- placeholder for future subprograms.
end Neural.Privvy;
|
source/encodings-utility-generic_sequence_buffers.ads | Vovanium/Encodings | 0 | 21099 | generic
type Character_Type is (<>);
type String_Type is array(Positive range <>) of Character_Type;
Max_Length: Positive;
package Encodings.Utility.Generic_Sequence_Buffers is
function Remaining_Length(
Data: String_Type;
Last: Natural
) return Natural is (
if Last >= Data'Last then 0 else Data'Last - Last
) with
Pre => Last >= Data'First - 1,
Post => Remaining_Length'Result in 0 .. Data'Length;
type Sequence_Buffer is record
Data: String_Type(1 .. Max_Length);
First: Positive := 1; -- first position of buffered sequence
Last: Natural := 0; -- last position of buffered sequence
end record;
function Is_Empty(
Buffer: in Sequence_Buffer
) return Boolean is (
Buffer.Last < Buffer.First
);
function Length(
Buffer: in Sequence_Buffer
) return Natural is (
if Is_Empty(Buffer) then 0 else Buffer.Last - Buffer.First + 1
) with
Post => Length'Result in 0 .. Max_Length;
procedure Write_Buffered(
Buffer: in out Sequence_Buffer;
Target: in out String_Type;
Target_Last: in out Natural
);
procedure Set_Buffer(
Buffer: in out Sequence_Buffer;
Source: in String_Type
) with
Pre => Is_Empty(Buffer),
Post => Length(Buffer) = Source'Length;
procedure Write(
Buffer: in out Sequence_Buffer;
Source: in String_Type;
Target: in out String_Type;
Target_Last: in out Natural
) with
Pre => Is_Empty(Buffer);
end Encodings.Utility.Generic_Sequence_Buffers; |
source/nodes/program-nodes-discriminant_associations.adb | reznikmm/gela | 0 | 18614 | -- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
package body Program.Nodes.Discriminant_Associations is
function Create
(Selector_Names : Program.Elements.Identifiers
.Identifier_Vector_Access;
Arrow_Token : Program.Lexical_Elements.Lexical_Element_Access;
Discriminant_Value : not null Program.Elements.Expressions
.Expression_Access)
return Discriminant_Association is
begin
return Result : Discriminant_Association :=
(Selector_Names => Selector_Names, Arrow_Token => Arrow_Token,
Discriminant_Value => Discriminant_Value, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Selector_Names : Program.Elements.Identifiers
.Identifier_Vector_Access;
Discriminant_Value : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Discriminant_Association is
begin
return Result : Implicit_Discriminant_Association :=
(Selector_Names => Selector_Names,
Discriminant_Value => Discriminant_Value,
Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Selector_Names
(Self : Base_Discriminant_Association)
return Program.Elements.Identifiers.Identifier_Vector_Access is
begin
return Self.Selector_Names;
end Selector_Names;
overriding function Discriminant_Value
(Self : Base_Discriminant_Association)
return not null Program.Elements.Expressions.Expression_Access is
begin
return Self.Discriminant_Value;
end Discriminant_Value;
overriding function Arrow_Token
(Self : Discriminant_Association)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Arrow_Token;
end Arrow_Token;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Discriminant_Association)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Discriminant_Association)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Discriminant_Association)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
procedure Initialize (Self : in out Base_Discriminant_Association'Class) is
begin
for Item in Self.Selector_Names.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
Set_Enclosing_Element (Self.Discriminant_Value, Self'Unchecked_Access);
null;
end Initialize;
overriding function Is_Discriminant_Association
(Self : Base_Discriminant_Association)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Discriminant_Association;
overriding function Is_Association
(Self : Base_Discriminant_Association)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Association;
overriding procedure Visit
(Self : not null access Base_Discriminant_Association;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Discriminant_Association (Self);
end Visit;
overriding function To_Discriminant_Association_Text
(Self : in out Discriminant_Association)
return Program.Elements.Discriminant_Associations
.Discriminant_Association_Text_Access is
begin
return Self'Unchecked_Access;
end To_Discriminant_Association_Text;
overriding function To_Discriminant_Association_Text
(Self : in out Implicit_Discriminant_Association)
return Program.Elements.Discriminant_Associations
.Discriminant_Association_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Discriminant_Association_Text;
end Program.Nodes.Discriminant_Associations;
|
test/Succeed/Issue2229Reexport2.agda | shlevy/agda | 1,989 | 945 | <reponame>shlevy/agda<filename>test/Succeed/Issue2229Reexport2.agda
module Issue2229Reexport2 where
open import Issue2229Base public
|
libsrc/stdio_new/file/fgets.asm | meesokim/z88dk | 8 | 178191 | <filename>libsrc/stdio_new/file/fgets.asm
; wrapper for function pointers
PUBLIC fgets
EXTERN fgets_callee
EXTERN ASMDISP_FGETS_CALLEE
.fgets
pop de
pop ix
pop bc
pop hl
push hl
push bc
push hl
push de
jp fgets_callee + ASMDISP_FGETS_CALLEE
|
Uninstall Cordova.applescript | SpiderOak/incubator-cordova-ios | 1 | 4156 | <gh_stars>1-10
-- 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.
set question to display dialog "Uninstall Cordova?" buttons {"Yes", "No"} default button 2 with icon caution
set answer to button returned of question
if answer is equal to "Yes" then
tell application "Finder" to set home_path to home as text
tell application "Finder" to set startup_hd to startup disk as string
-- delete Xcode 3 Template
set source to (home_path & "Library:Application Support:Developer:Shared:Xcode:Project Templates:Cordova")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete Xcode 4 Template
set source to (home_path & "Library:Developer:Xcode:Templates:Project Templates:Application:Cordova-based Application.xctemplate")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete CordovaLib (used by Xcode 3 Template, and generating Cordova.framework if need be)
set source to (home_path & "Documents:CordovaLib")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete Cordova.framework (used by Xcode 4 Template) and its parent directories
set source to (startup_hd & "Users:Shared:Cordova")
tell application "Finder"
if exists folder source then
delete source
end if
end tell
-- delete symlink to Cordova.framework
set source to (home_path & "Library:Frameworks:Cordova.framework")
tell application "Finder"
if exists file source then
delete source
end if
end tell
-- end
display dialog "Cordova uninstalled." buttons {"Goodbye ☹"} with icon note
else
display dialog "Phew!" buttons {"That was close ☺"} with icon note
end if
|
src/test/resources/data/potests/test59.asm | cpcitor/mdlz80optimizer | 36 | 4316 | <reponame>cpcitor/mdlz80optimizer
; Test: corner case found by Bengalack
ld hl,variable ; this block should be optimized
ld c,(hl)
inc hl
ld b,(hl)
ld a,(bc)
ld (variable3),a
ld hl,(variable) ; this block should not be optimized
ld c,(hl)
inc hl
ld b,(hl)
ld a,(bc)
ld (variable3),a
loop:
jr loop
variable: db #00
variable2: dw #0000
variable3: db #00 |
paging/kernel_setup.asm | ilya101010/asm_studies | 1 | 83633 | format ELF
include 'macro.inc'
include 'paging.inc'
include 'procedures.inc'
public kernel_setup
extrn init_paging
section '.text' executable ; align 1000h
Use32
kernel_setup:
ccall print, string, 1, 0x0a
jmp init_paging
jmp $
dd 0x42,0x42,0x42
string: db "kernel_setup",0
; http://wiki.osdev.org/User:Mduft/HigherHalf_Kernel_with_32-bit_Paging#Welcome |
Task/Tree-traversal/AppleScript/tree-traversal.applescript | LaudateCorpus1/RosettaCodeData | 1 | 1673 | <reponame>LaudateCorpus1/RosettaCodeData
-- foldTree :: (a -> [b] -> b) -> Tree a -> b
on foldTree(f)
script
on |λ|(tree)
script go
property g : mReturn(f)'s |λ|
on |λ|(oNode)
g(root of oNode, |λ|(nest of oNode) ¬
of map(go))
end |λ|
end script
|λ|(tree) of go
end |λ|
end script
end foldTree
-- preorder :: a -> [[a]] -> [a]
on preorder(x, xs)
{x} & concat(xs)
end preorder
-- inorder :: a -> [[a]] -> [a]
on inorder(x, xs)
if {} ≠ xs then
item 1 of xs & x & concat(rest of xs)
else
{x}
end if
end inorder
-- postorder :: a -> [[a]] -> [a]
on postorder(x, xs)
concat(xs) & {x}
end postorder
-- levelOrder :: Tree a -> [a]
on levelOrder(tree)
script notNull
on |λ|(x)
0 < length of x
end |λ|
end script
script concatMapNest
on |λ|(xs)
|λ|(xs) of concatMap(my nest)
end |λ|
end script
|λ|(takeWhile(notNull, iterate(concatMapNest, {tree}))) ¬
of concatMap(map(my root))
end levelOrder
---------------------------TEST----------------------------
on run
set tree to Node(1, ¬
{Node(2, ¬
{Node(4, {Node(7, {})}), ¬
Node(5, {})}), ¬
Node(3, ¬
{Node(6, {Node(8, {}), ¬
Node(9, {})})})})
-- Output of AppleScript code at Rosetta Code task
-- 'Visualize a Tree':
set strTree to unlines({¬
" ┌ 4 ─ 7", ¬
" ┌ 2 ┤", ¬
" │ └ 5", ¬
" 1 ┤", ¬
" │ ┌ 8", ¬
" └ 3 ─ 6 ┤", ¬
" └ 9"})
script tabulate
on |λ|(s, xs)
justifyRight(14, space, s & ": ") & unwords(xs)
end |λ|
end script
set strResult to strTree & linefeed & unlines(zipWith(tabulate, ¬
["preorder", "inorder", "postorder", "level-order"], ¬
apList([¬
foldTree(preorder), ¬
foldTree(inorder), ¬
foldTree(postorder), ¬
levelOrder], [tree])))
set the clipboard to strResult
return strResult
end run
--------------------------GENERIC--------------------------
-- Node :: a -> [Tree a] -> Tree a
on Node(v, xs)
{type:"Node", root:v, nest:xs}
end Node
-- e.g. [(*2),(/2), sqrt] <*> [1,2,3]
-- --> ap([dbl, hlf, root], [1, 2, 3])
-- --> [2,4,6,0.5,1,1.5,1,1.4142135623730951,1.7320508075688772]
-- Each member of a list of functions applied to
-- each of a list of arguments, deriving a list of new values
-- apList (<*>) :: [(a -> b)] -> [a] -> [b]
on apList(fs, xs)
set lst to {}
repeat with f in fs
tell mReturn(contents of f)
repeat with x in xs
set end of lst to |λ|(contents of x)
end repeat
end tell
end repeat
return lst
end apList
-- concat :: [[a]] -> [a]
-- concat :: [String] -> String
on concat(xs)
set lng to length of xs
if 0 < lng and string is class of (item 1 of xs) then
set acc to ""
else
set acc to {}
end if
repeat with i from 1 to lng
set acc to acc & item i of xs
end repeat
acc
end concat
-- concatMap :: (a -> [b]) -> [a] -> [b]
on concatMap(f)
script
on |λ|(xs)
set lng to length of xs
set acc to {}
tell mReturn(f)
repeat with i from 1 to lng
set acc to acc & (|λ|(item i of xs, i, xs))
end repeat
end tell
return acc
end |λ|
end script
end concatMap
-- iterate :: (a -> a) -> a -> Gen [a]
on iterate(f, x)
script
property v : missing value
property g : mReturn(f)'s |λ|
on |λ|()
if missing value is v then
set v to x
else
set v to g(v)
end if
return v
end |λ|
end script
end iterate
-- justifyRight :: Int -> Char -> String -> String
on justifyRight(n, cFiller, strText)
if n > length of strText then
text -n thru -1 of ((replicate(n, cFiller) as text) & strText)
else
strText
end if
end justifyRight
-- length :: [a] -> Int
on |length|(xs)
set c to class of xs
if list is c or string is c then
length of xs
else
(2 ^ 29 - 1) -- (maxInt - simple proxy for non-finite)
end if
end |length|
-- mReturn :: First-class m => (a -> b) -> m (a -> b)
on mReturn(f)
-- 2nd class handler function lifted into 1st class script wrapper.
if script is class of f then
f
else
script
property |λ| : f
end script
end if
end mReturn
-- map :: (a -> b) -> [a] -> [b]
on map(f)
-- The list obtained by applying f
-- to each element of xs.
script
on |λ|(xs)
tell mReturn(f)
set lng to length of xs
set lst to {}
repeat with i from 1 to lng
set end of lst to |λ|(item i of xs, i, xs)
end repeat
return lst
end tell
end |λ|
end script
end map
-- min :: Ord a => a -> a -> a
on min(x, y)
if y < x then
y
else
x
end if
end min
-- nest :: Tree a -> [a]
on nest(oTree)
nest of oTree
end nest
-- Egyptian multiplication - progressively doubling a list, appending
-- stages of doubling to an accumulator where needed for binary
-- assembly of a target length
-- replicate :: Int -> a -> [a]
on replicate(n, a)
set out to {}
if 1 > n then return out
set dbl to {a}
repeat while (1 < n)
if 0 < (n mod 2) then set out to out & dbl
set n to (n div 2)
set dbl to (dbl & dbl)
end repeat
return out & dbl
end replicate
-- root :: Tree a -> a
on root(oTree)
root of oTree
end root
-- take :: Int -> [a] -> [a]
-- take :: Int -> String -> String
on take(n, xs)
set c to class of xs
if list is c then
if 0 < n then
items 1 thru min(n, length of xs) of xs
else
{}
end if
else if string is c then
if 0 < n then
text 1 thru min(n, length of xs) of xs
else
""
end if
else if script is c then
set ys to {}
repeat with i from 1 to n
set v to |λ|() of xs
if missing value is v then
return ys
else
set end of ys to v
end if
end repeat
return ys
else
missing value
end if
end take
-- takeWhile :: (a -> Bool) -> Gen [a] -> [a]
on takeWhile(p, xs)
set ys to {}
set v to |λ|() of xs
tell mReturn(p)
repeat while (|λ|(v))
set end of ys to v
set v to xs's |λ|()
end repeat
end tell
return ys
end takeWhile
-- unlines :: [String] -> String
on unlines(xs)
-- A single string formed by the intercalation
-- of a list of strings with the newline character.
set {dlm, my text item delimiters} to ¬
{my text item delimiters, linefeed}
set str to xs as text
set my text item delimiters to dlm
str
end unlines
-- unwords :: [String] -> String
on unwords(xs)
set {dlm, my text item delimiters} to ¬
{my text item delimiters, space}
set s to xs as text
set my text item delimiters to dlm
return s
end unwords
-- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
on zipWith(f, xs, ys)
set lng to min(|length|(xs), |length|(ys))
if 1 > lng then return {}
set xs_ to take(lng, xs) -- Allow for non-finite
set ys_ to take(lng, ys) -- generators like cycle etc
set lst to {}
tell mReturn(f)
repeat with i from 1 to lng
set end of lst to |λ|(item i of xs_, item i of ys_)
end repeat
return lst
end tell
end zipWith
|
programs/oeis/090/A090199.asm | neoneye/loda | 22 | 173850 | <reponame>neoneye/loda<filename>programs/oeis/090/A090199.asm
; A090199: a(n) = N(6,n), where N(6,x) is the 6th Narayana polynomial.
; 1,132,903,3304,8925,20076,39907,72528,123129,198100,305151,453432,653653,918204,1261275,1698976,2249457,2933028,3772279,4792200,6020301,7486732,9224403,11269104,13659625,16437876,19649007,23341528,27567429,32382300,37845451,44020032,50973153,58776004,67503975,77236776,88058557,100058028,113328579,127968400,144080601,161773332,181159903,202358904,225494325,250695676,278098107,307842528,340075729,374950500,412625751,453266632,497044653,544137804,594730675,649014576,707187657,769455028,836028879,907128600,982980901,1063819932,1149887403,1241432704,1338713025,1441993476,1551547207,1667655528,1790608029,1920702700,2058246051,2203553232,2356948153,2518763604,2689341375,2869032376,3058196757,3257204028,3466433179,3686272800,3917121201,4159386532,4413486903,4679850504,4958915725,5251131276,5556956307,5876860528,6211324329,6560838900,6925906351,7307039832,7704763653,8119613404,8552136075,9002890176,9472445857,9961385028,10470301479,10999801000
mov $1,1
mov $2,15
mov $5,$0
mov $6,$0
lpb $2
add $1,$5
sub $2,1
lpe
mov $3,$6
lpb $3
sub $3,1
add $4,$5
lpe
mov $2,50
mov $5,$4
lpb $2
add $1,$5
sub $2,1
lpe
mov $3,$6
mov $4,0
lpb $3
sub $3,1
add $4,$5
lpe
mov $2,50
mov $5,$4
lpb $2
add $1,$5
sub $2,1
lpe
mov $3,$6
mov $4,0
lpb $3
sub $3,1
add $4,$5
lpe
mov $2,15
mov $5,$4
lpb $2
add $1,$5
sub $2,1
lpe
mov $3,$6
mov $4,0
lpb $3
sub $3,1
add $4,$5
lpe
mov $2,1
mov $5,$4
lpb $2
add $1,$5
sub $2,1
lpe
mov $0,$1
|
src/system/file-delete.asm | Pentium1080Ti/x86-assembly | 0 | 93575 | <filename>src/system/file-delete.asm
%include 'src/include/functions.asm'
SECTION .data
filename db 'readme.md', 0h
SECTION .text
global _start
_start:
mov ebx, filename
mov eax, 10 ; sys_unlink opcode
int 80h
call quit |
alloy4fun_models/trashltl/models/5/n3vECZX3FoYB79eJC.als | Kaixi26/org.alloytools.alloy | 0 | 2865 | <gh_stars>0
open main
pred idn3vECZX3FoYB79eJC_prop6 {
all f: File | f in Trash implies always f in Trash
}
pred __repair { idn3vECZX3FoYB79eJC_prop6 }
check __repair { idn3vECZX3FoYB79eJC_prop6 <=> prop6o } |
addition_ds_final.asm | Invisible-Luna/8086emu_program | 1 | 167973 | <filename>addition_ds_final.asm
;<NAME>
;119EC0013
;ADDITION OF 5 NUMBERS USING DATA SEGMENT USING CONSTANT OFFSET.
.data
MOV ds:1000h, 25h
MOV ds:1001h, 12h
MOV ds:1002h, 15h
MOV ds:1003h, 1Fh
MOV ds:1004h, 2Bh
.code
MOV AL, 00h
MOV BX,1000h
ADD AL, ds:[BX]
INC BX
ADD AL, ds:[BX]
INC BX
ADD AL, ds:[BX]
INC BX
ADD AL, ds:[BX]
INC BX
ADD AL, ds:[BX]
ret |
test/asset/agda-stdlib-1.0/Data/Vec/Relation/Unary/All.agda | omega12345/agda-mode | 0 | 5259 | <reponame>omega12345/agda-mode
------------------------------------------------------------------------
-- The Agda standard library
--
-- Vectors where all elements satisfy a given property
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Vec.Relation.Unary.All where
open import Data.Nat using (zero; suc)
open import Data.Fin using (Fin; zero; suc)
open import Data.Product as Prod using (_,_)
open import Data.Vec as Vec using (Vec; []; _∷_)
open import Function using (_∘_)
open import Level using (_⊔_)
open import Relation.Nullary
import Relation.Nullary.Decidable as Dec
open import Relation.Unary
open import Relation.Binary.PropositionalEquality as P using (subst)
------------------------------------------------------------------------
-- All P xs means that all elements in xs satisfy P.
infixr 5 _∷_
data All {a p} {A : Set a}
(P : A → Set p) : ∀ {k} → Vec A k → Set (p ⊔ a) where
[] : All P []
_∷_ : ∀ {k x} {xs : Vec A k} (px : P x) (pxs : All P xs) → All P (x ∷ xs)
------------------------------------------------------------------------
-- Operations on All
head : ∀ {a p} {A : Set a} {P : A → Set p} {k x} {xs : Vec A k} →
All P (x ∷ xs) → P x
head (px ∷ pxs) = px
tail : ∀ {a p} {A : Set a} {P : A → Set p} {k x} {xs : Vec A k} →
All P (x ∷ xs) → All P xs
tail (px ∷ pxs) = pxs
lookup : ∀ {a p} {A : Set a} {P : A → Set p} {k} {xs : Vec A k} →
(i : Fin k) → All P xs → P (Vec.lookup xs i)
lookup () []
lookup zero (px ∷ pxs) = px
lookup (suc i) (px ∷ pxs) = lookup i pxs
tabulate : ∀ {a p} {A : Set a} {P : A → Set p} {k xs} →
(∀ i → P (Vec.lookup xs i)) → All P {k} xs
tabulate {xs = []} pxs = []
tabulate {xs = _ ∷ _} pxs = pxs zero ∷ tabulate (pxs ∘ suc)
map : ∀ {a p q} {A : Set a} {P : A → Set p} {Q : A → Set q} {k} →
P ⊆ Q → All P {k} ⊆ All Q {k}
map g [] = []
map g (px ∷ pxs) = g px ∷ map g pxs
zipWith : ∀ {a b c p q r} {A : Set a} {B : Set b} {C : Set c} {_⊕_ : A → B → C}
{P : A → Set p} {Q : B → Set q} {R : C → Set r} →
(∀ {x y} → P x → Q y → R (x ⊕ y)) →
∀ {k xs ys} → All P {k} xs → All Q {k} ys →
All R {k} (Vec.zipWith _⊕_ xs ys)
zipWith _⊕_ {xs = []} {[]} [] [] = []
zipWith _⊕_ {xs = x ∷ xs} {y ∷ ys} (px ∷ pxs) (qy ∷ qys) =
px ⊕ qy ∷ zipWith _⊕_ pxs qys
zip : ∀ {a p q k} {A : Set a} {P : A → Set p} {Q : A → Set q} →
All P ∩ All Q ⊆ All (P ∩ Q) {k}
zip ([] , []) = []
zip (px ∷ pxs , qx ∷ qxs) = (px , qx) ∷ zip (pxs , qxs)
unzip : ∀ {a p q k} {A : Set a} {P : A → Set p} {Q : A → Set q} →
All (P ∩ Q) {k} ⊆ All P ∩ All Q
unzip [] = [] , []
unzip (pqx ∷ pqxs) = Prod.zip _∷_ _∷_ pqx (unzip pqxs)
------------------------------------------------------------------------
-- Properties of predicates preserved by All
module _ {a p} {A : Set a} {P : A → Set p} where
all : ∀ {k} → Decidable P → Decidable (All P {k})
all P? [] = yes []
all P? (x ∷ xs) with P? x
... | yes px = Dec.map′ (px ∷_) tail (all P? xs)
... | no ¬px = no (¬px ∘ head)
universal : Universal P → ∀ {k} → Universal (All P {k})
universal u [] = []
universal u (x ∷ xs) = u x ∷ universal u xs
irrelevant : Irrelevant P → ∀ {k} → Irrelevant (All P {k})
irrelevant irr [] [] = P.refl
irrelevant irr (px₁ ∷ pxs₁) (px₂ ∷ pxs₂) =
P.cong₂ _∷_ (irr px₁ px₂) (irrelevant irr pxs₁ pxs₂)
satisfiable : Satisfiable P → ∀ {k} → Satisfiable (All P {k})
satisfiable (x , p) {zero} = [] , []
satisfiable (x , p) {suc k} = Prod.map (x ∷_) (p ∷_) (satisfiable (x , p))
|
programs/oeis/301/A301709.asm | neoneye/loda | 22 | 80338 | <gh_stars>10-100
; A301709: Partial sums of A301708.
; 1,7,18,34,56,84,117,155,199,249,304,364,430,502,579,661,749,843,942,1046,1156,1272,1393,1519,1651,1789,1932,2080,2234,2394,2559,2729,2905,3087,3274,3466,3664,3868,4077,4291,4511,4737,4968,5204,5446,5694,5947,6205,6469,6739,7014,7294,7580,7872,8169,8471
mov $1,$0
add $0,1
mul $0,$1
mov $2,$0
add $0,2
mul $0,3
div $2,4
sub $0,$2
sub $0,5
|
Data/List.agda | Lolirofle/stuff-in-agda | 6 | 12605 | module Data.List where
import Lvl
open import Type
private variable ℓ : Lvl.Level
private variable T : Type{ℓ}
infixr 1000 _⊰_
-- A list is a container/collection of elements.
-- • The elements are in a linear order.
-- • The container allows multiples (non-uniqueness of elements in the container).
data List (T : Type{ℓ}) : Type{ℓ} where
∅ : List(T) -- An empty list
_⊰_ : T → List(T) → List(T) -- Cons
{-# BUILTIN LIST List #-}
private variable l : List(T)
private variable P : List(T) → Type{ℓ}
elim : P(∅) → (∀(x : T)(l : List(T)) → P(l) → P(x ⊰ l)) → ((l : List(T)) → P(l))
elim base next ∅ = base
elim base next (x ⊰ l) = next(x)(l)(elim base next l)
|
source/index.asm | svkampen/mangela_c64_demo | 0 | 9843 | <reponame>svkampen/mangela_c64_demo
music_addr=$7000
sid_init = $7000
sid_play = $7003
*=music_addr
!bin "source/fallen_down.sid",,$7e
ctr=$4000
clr=$4004
sprite_location=$2000
*=sprite_location
!source "graphics/sprite1.gpx"
!source "graphics/sprites2.asm"
code_addr=$c000
*=code_addr
!source "source/main.asm"
!source "source/rand.asm"
!source "source/sprites.asm"
|
oeis/317/A317975.asm | neoneye/loda-programs | 11 | 92731 | ; A317975: a(n) = 2*(a(n-1)+a(n-2)+a(n-3))-a(n-4) for n >= 4, with initial terms 0, 1, 1, 0.
; Submitted by <NAME>
; 0,1,1,0,4,9,25,76,216,625,1809,5224,15100,43641,126121,364500,1053424,3044449,8798625,25428496,73489716,212389225,613816249,1773961884,5126845000,14816857041,42821511601,123756465400,357662823084,1033664743129,2987346551625,8633591770276,24951543306976,72111298514625,208405520632129,602303133137184,1740688361260900,5030682731545801,14538942931255641,42018324914987500,121435212794316984,350954278549574449,1014276689586502225,2931314036945799816,8471654797369435996,24483536769253901625
mov $1,1
lpb $0
sub $0,1
add $2,$1
sub $3,1
add $4,$3
add $3,$4
add $1,$3
add $4,$2
add $3,$4
sub $4,$3
sub $3,3
add $3,$4
add $3,2
add $3,$2
add $2,1
sub $3,1
lpe
mov $0,$4
div $0,2
|
hide-dock.scpt | tom-james-watson/osx-automation | 1 | 1833 | tell application "System Events"
tell dock preferences to set autohide to true
end tell
|
unit.agda | heades/AUGL | 0 | 9509 | module unit where
open import level
open import eq
data ⊤ {ℓ : Level} : Set ℓ where
triv : ⊤
{-# COMPILE GHC ⊤ = data () (()) #-}
single-range : ∀{ℓ}{U : Set ℓ}{g : U → ⊤ {ℓ}} → ∀{u : U} → g u ≡ triv
single-range {_}{U}{g}{u} with g u
... | triv = refl
|
oeis/157/A157884.asm | neoneye/loda-programs | 11 | 174798 | ; A157884: For each positive integer m there exist at least one prime Q=Q(m) and at least one prime P=P(m) such that (2m-1)^2 < Q < (2m)^2 - (2m-1) <= P < (2m)^2. Sequence lists pairs P(m), Q(m) for m >= 1. If more than one prime for P or Q exists, we take the smallest.
; 2,3,11,13,29,31,53,59,83,97,127,137,173,191,227,241,293,307,367,383,443,463,541,557,631,653,733,757,853,877,967,997,1091,1123,1229,1277,1373,1409,1523,1567,1693,1723,1861,1901,2027,2081,2213,2267,2411,2459
mov $3,$0
mul $0,2
div $3,2
add $3,1
mul $3,$0
mov $2,$3
cmp $2,0
add $3,$2
seq $3,159477 ; a(n) = smallest prime >= n, if 1 is counted as a prime.
mov $0,$3
|
src/src/c/borlandc/dpmi32/delay.asm | amindlost/wdosx | 7 | 2449 | .386
.model flat,C
PUBLIC delay
.code
delay proc near
mov edx,[esp+4]
shl edx,10
shld ecx,edx,16
mov ah,86h
int 15h
ret
delay endp
end
|
src/main/java/org/cidarlab/phoenix/failuremode/ReverseStrandTerminators.g4 | CIDARLAB/alphaPhoenix | 0 | 3597 | grammar ReverseStrandTerminators;
@lexer::header{
package org.cidarlab.phoenix.failuremode;
}
@parser::header{
package org.cidarlab.phoenix.failuremode;
}
root
: module
;
module
: ((reverse_strand_terminators)+ (wildcard)*)+
| ((wildcard)* (reverse_strand_terminators)+)+
| ((wildcard)* (reverse_strand_terminators)+ (wildcard)*)+
| (wildcard)+
;
reverse_strand_terminators
: ((FORWARD_PROMOTER)+ (wildcard_type1)* (REVERSE_TERMINATOR))+
| ((FORWARD_TERMINATOR) (wildcard_type2)* (REVERSE_PROMOTER)+)+
;
wildcard_type1
: (FORWARD_RBS|FORWARD_CDS|REVERSE_CDS|REVERSE_RBS|REVERSE_PROMOTER)+
;
wildcard_type2
: (REVERSE_CDS|REVERSE_RBS|FORWARD_CDS|FORWARD_RBS|FORWARD_PROMOTER)+
;
wildcard
: (FORWARD_PROMOTER|FORWARD_RBS|FORWARD_CDS|FORWARD_TERMINATOR|REVERSE_PROMOTER|REVERSE_RBS|REVERSE_CDS|REVERSE_TERMINATOR)+
;
REVERSE_PROMOTER
: '<p'
;
FORWARD_PROMOTER
: 'p'
;
REVERSE_RBS
: '<r'
;
FORWARD_RBS
: 'r'
;
REVERSE_CDS
: '<c'
| '<f'
;
FORWARD_CDS
: 'c'
| 'f'
;
REVERSE_TERMINATOR
: '<t'
;
FORWARD_TERMINATOR
: 't'
;
WS : [ \t\r\n]+ -> skip ; |
bios_fdc_30/serial_8256.asm | ncb85/NCB85V2-BIOS | 4 | 85508 | <filename>bios_fdc_30/serial_8256.asm
; minimalistic BIOS serial routines
; using UART port of 8256 MUART
;------------------------------------------------------------------------------
; * CONST - Console status
; Key press (if any) is stored in front
; I: -
; O: Z=0, A=255 - key press
; Z=1, A=0 - no key press
; M: HL, AF
QueueRdAdr:
CONST: in MUART_ADDR+0Fh ; 8256 status
ani 40h ; char received?
rz
mvi a,255 ; key pressed
ret
;
;------------------------------------------------------------------------------
; * CONIN - Console input - wait for keypress
; I: -
; O: A=key code
; M: HL, BC, AF
CONIN: in MUART_ADDR+0Fh ; 8256 status
ani 40h ; char received?
jz CONIN ; no wait
in MUART_ADDR+07 ; get the char
ret
;
;------------------------------------------------------------------------------
; * CONOUT - Console output
; I: A or C=char to output
; O: -
; M: AF
ConsoleOutputA: mov c,a
ConsoleOutputC:
CONOUT: in MUART_ADDR+0Fh ; 8256 status
ani 20h ; out buffer free ?
jz ConsoleOutputC ; no wait
mov a,c ; char to A
out MUART_ADDR+07 ; send
ret
|
Musics/Othersongs/source/luca_ending.asm | kosmonautdnb/TheLandsOfZador | 0 | 29094 | <gh_stars>0
kp_song
kp_reloc
dc.w kp_song_registers
dc.w kp_speed
dc.w kp_grooveboxpos
dc.w kp_grooveboxlen
dc.w kp_groovebox
dc.w kp_patternlen
dc.w kp_patternmap_lo
dc.w kp_patternmap_hi
dc.w kp_insmap_lo
dc.w kp_insmap_hi
dc.w kp_volmap_lo
dc.w kp_volmap_hi
dc.w kp_sequence
kp_song_registers
kp_speed
dc.b $02
kp_grooveboxpos
dc.b $00
kp_grooveboxlen
dc.b $02
kp_groovebox
dc.b $02
dc.b $03
dc.b $03
dc.b $04
dc.b $05
dc.b $04
dc.b $06
dc.b $04
kp_patternlen
dc.b $1F
kp_patternmap_lo
dc.b #<patnil
dc.b #<pat1
dc.b #<pat2
dc.b #<pat3
dc.b #<pat4
dc.b #<pat5
dc.b #<pat6
dc.b #<pat7
dc.b #<pat8
dc.b #<pat9
dc.b #<pat10
dc.b #<pat11
dc.b #<pat12
dc.b #<pat13
dc.b #<pat14
dc.b #<pat15
dc.b #<pat16
dc.b #<pat17
dc.b #<pat18
dc.b #<pat19
dc.b #<pat20
dc.b #<pat21
dc.b #<pat22
dc.b #<pat23
dc.b #<pat24
dc.b #<pat25
dc.b #<pat26
dc.b #<pat27
dc.b #<pat28
dc.b #<pat29
dc.b #<pat30
dc.b #<pat31
dc.b #<pat32
dc.b #<pat33
dc.b #<pat34
dc.b #<pat35
dc.b #<pat36
dc.b #<pat37
dc.b #<pat38
dc.b #<pat39
dc.b #<pat40
dc.b #<pat41
dc.b #<pat42
dc.b #<pat43
dc.b #<pat44
dc.b #<pat45
dc.b #<pat46
dc.b #<pat47
dc.b #<pat48
dc.b #<pat49
dc.b #<pat50
dc.b #<pat51
dc.b #<pat52
dc.b #<pat53
dc.b #<pat54
dc.b #<pat55
dc.b #<pat56
dc.b #<pat57
dc.b #<pat58
dc.b #<pat59
dc.b #<pat60
dc.b #<pat61
dc.b #<pat62
dc.b #<pat63
dc.b #<pat64
dc.b #<pat65
dc.b #<pat66
dc.b #<pat67
kp_patternmap_hi
dc.b #>patnil
dc.b #>pat1
dc.b #>pat2
dc.b #>pat3
dc.b #>pat4
dc.b #>pat5
dc.b #>pat6
dc.b #>pat7
dc.b #>pat8
dc.b #>pat9
dc.b #>pat10
dc.b #>pat11
dc.b #>pat12
dc.b #>pat13
dc.b #>pat14
dc.b #>pat15
dc.b #>pat16
dc.b #>pat17
dc.b #>pat18
dc.b #>pat19
dc.b #>pat20
dc.b #>pat21
dc.b #>pat22
dc.b #>pat23
dc.b #>pat24
dc.b #>pat25
dc.b #>pat26
dc.b #>pat27
dc.b #>pat28
dc.b #>pat29
dc.b #>pat30
dc.b #>pat31
dc.b #>pat32
dc.b #>pat33
dc.b #>pat34
dc.b #>pat35
dc.b #>pat36
dc.b #>pat37
dc.b #>pat38
dc.b #>pat39
dc.b #>pat40
dc.b #>pat41
dc.b #>pat42
dc.b #>pat43
dc.b #>pat44
dc.b #>pat45
dc.b #>pat46
dc.b #>pat47
dc.b #>pat48
dc.b #>pat49
dc.b #>pat50
dc.b #>pat51
dc.b #>pat52
dc.b #>pat53
dc.b #>pat54
dc.b #>pat55
dc.b #>pat56
dc.b #>pat57
dc.b #>pat58
dc.b #>pat59
dc.b #>pat60
dc.b #>pat61
dc.b #>pat62
dc.b #>pat63
dc.b #>pat64
dc.b #>pat65
dc.b #>pat66
dc.b #>pat67
patnil
kp_setinstrument 8,0
kp_settrackregister 0,16
kp_rewind $00
pat1
pat1loop
kp_settrackregister $01,$00
kp_settrackregister $03,$06
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_rewind [pat1loop-pat1]
pat2
pat2loop
kp_settrackregister $01,$00
kp_settrackregister $03,$07
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_rewind [pat2loop-pat2]
pat3
pat3loop
kp_settrackregister $01,$00
kp_settrackregister $03,$08
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_rewind [pat3loop-pat3]
pat4
pat4loop
kp_settrackregister $01,$00
kp_settrackregister $03,$09
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_rewind [pat4loop-pat4]
pat5
pat5loop
kp_settrackregister $01,$00
kp_settrackregister $03,$0A
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_settrackregister $03,$0B
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_settrackregister $01,$30
kp_setinstrument $04,$02
kp_settrackregister $01,$00
kp_setinstrument $04,$01
kp_rewind [pat5loop-pat5]
pat6
pat6loop
kp_settrackregister $01,$54
kp_settrackregister $03,$07
kp_setinstrument $01,$03
kp_settrackregister $01,$55
kp_settrackregister $00,$01
kp_settrackregister $01,$56
kp_settrackregister $00,$01
kp_settrackregister $01,$57
kp_settrackregister $00,$01
kp_settrackregister $01,$58
kp_settrackregister $00,$01
kp_settrackregister $01,$59
kp_settrackregister $00,$01
kp_settrackregister $01,$5A
kp_settrackregister $00,$01
kp_settrackregister $01,$5B
kp_settrackregister $00,$01
kp_settrackregister $01,$5C
kp_settrackregister $00,$01
kp_settrackregister $01,$5D
kp_settrackregister $00,$01
kp_settrackregister $01,$5E
kp_settrackregister $00,$01
kp_settrackregister $01,$5F
kp_settrackregister $00,$01
kp_settrackregister $01,$60
kp_settrackregister $00,$01
kp_settrackregister $01,$61
kp_settrackregister $00,$01
kp_settrackregister $01,$62
kp_settrackregister $00,$01
kp_settrackregister $01,$63
kp_settrackregister $00,$01
kp_settrackregister $01,$64
kp_settrackregister $03,$08
kp_settrackregister $00,$01
kp_settrackregister $01,$65
kp_settrackregister $00,$01
kp_settrackregister $01,$66
kp_settrackregister $00,$01
kp_settrackregister $01,$67
kp_settrackregister $00,$01
kp_settrackregister $01,$68
kp_settrackregister $00,$01
kp_settrackregister $01,$69
kp_settrackregister $00,$01
kp_settrackregister $01,$6A
kp_settrackregister $00,$01
kp_settrackregister $01,$6B
kp_settrackregister $00,$01
kp_settrackregister $01,$6C
kp_settrackregister $00,$01
kp_settrackregister $01,$6D
kp_settrackregister $00,$01
kp_settrackregister $01,$6E
kp_settrackregister $00,$01
kp_settrackregister $01,$6F
kp_settrackregister $00,$01
kp_settrackregister $01,$70
kp_settrackregister $00,$01
kp_settrackregister $01,$71
kp_settrackregister $00,$01
kp_settrackregister $01,$72
kp_settrackregister $00,$01
kp_settrackregister $01,$73
kp_settrackregister $00,$01
kp_rewind [pat6loop-pat6]
pat7
pat7loop
kp_settrackregister $01,$00
kp_settrackregister $03,$0C
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_settrackregister $03,$0D
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_settrackregister $01,$30
kp_setinstrument $04,$02
kp_settrackregister $01,$00
kp_setinstrument $04,$01
kp_rewind [pat7loop-pat7]
pat8
pat8loop
kp_settrackregister $01,$74
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $01,$75
kp_settrackregister $00,$01
kp_settrackregister $01,$76
kp_settrackregister $00,$01
kp_settrackregister $01,$77
kp_settrackregister $00,$01
kp_settrackregister $01,$78
kp_settrackregister $00,$01
kp_settrackregister $01,$79
kp_settrackregister $00,$01
kp_settrackregister $01,$7A
kp_settrackregister $00,$01
kp_settrackregister $01,$7B
kp_settrackregister $00,$01
kp_settrackregister $01,$7C
kp_settrackregister $00,$01
kp_settrackregister $01,$7D
kp_settrackregister $00,$01
kp_settrackregister $01,$7E
kp_settrackregister $00,$01
kp_settrackregister $01,$7F
kp_settrackregister $00,$01
kp_settrackregister $01,$80
kp_settrackregister $00,$01
kp_settrackregister $01,$81
kp_settrackregister $00,$01
kp_settrackregister $01,$82
kp_settrackregister $00,$01
kp_settrackregister $01,$83
kp_settrackregister $00,$01
kp_settrackregister $01,$84
kp_settrackregister $03,$0A
kp_settrackregister $00,$01
kp_settrackregister $01,$85
kp_settrackregister $00,$01
kp_settrackregister $01,$86
kp_settrackregister $00,$01
kp_settrackregister $01,$87
kp_settrackregister $00,$01
kp_settrackregister $01,$88
kp_settrackregister $00,$01
kp_settrackregister $01,$89
kp_settrackregister $00,$01
kp_settrackregister $01,$8A
kp_settrackregister $00,$01
kp_settrackregister $01,$8B
kp_settrackregister $00,$01
kp_settrackregister $01,$8C
kp_settrackregister $00,$01
kp_settrackregister $01,$8D
kp_settrackregister $00,$01
kp_settrackregister $01,$8E
kp_settrackregister $00,$01
kp_settrackregister $01,$8F
kp_settrackregister $00,$01
kp_settrackregister $01,$90
kp_settrackregister $00,$01
kp_settrackregister $01,$91
kp_settrackregister $00,$01
kp_settrackregister $01,$92
kp_settrackregister $00,$01
kp_settrackregister $01,$93
kp_settrackregister $00,$01
kp_rewind [pat8loop-pat8]
pat9
pat9loop
kp_settrackregister $01,$00
kp_settrackregister $03,$0E
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_settrackregister $01,$30
kp_setinstrument $04,$02
kp_settrackregister $01,$00
kp_setinstrument $04,$01
kp_settrackregister $03,$0F
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_settrackregister $01,$30
kp_setinstrument $04,$02
kp_settrackregister $01,$00
kp_setinstrument $04,$01
kp_rewind [pat9loop-pat9]
pat10
pat10loop
kp_settrackregister $01,$94
kp_settrackregister $03,$0B
kp_settrackregister $00,$01
kp_settrackregister $01,$95
kp_settrackregister $00,$01
kp_settrackregister $01,$96
kp_settrackregister $00,$01
kp_settrackregister $01,$97
kp_settrackregister $00,$01
kp_settrackregister $01,$98
kp_settrackregister $00,$01
kp_settrackregister $01,$99
kp_settrackregister $00,$01
kp_settrackregister $01,$9A
kp_settrackregister $00,$01
kp_settrackregister $01,$9B
kp_settrackregister $00,$01
kp_settrackregister $01,$9C
kp_settrackregister $00,$01
kp_settrackregister $01,$9D
kp_settrackregister $00,$01
kp_settrackregister $01,$9E
kp_settrackregister $00,$01
kp_settrackregister $01,$9F
kp_settrackregister $00,$01
kp_settrackregister $01,$A0
kp_settrackregister $00,$01
kp_settrackregister $01,$A1
kp_settrackregister $00,$01
kp_settrackregister $01,$A2
kp_settrackregister $00,$01
kp_settrackregister $01,$A3
kp_settrackregister $00,$01
kp_settrackregister $01,$A4
kp_settrackregister $03,$0C
kp_settrackregister $00,$01
kp_settrackregister $01,$A5
kp_settrackregister $00,$01
kp_settrackregister $01,$A6
kp_settrackregister $00,$01
kp_settrackregister $01,$A7
kp_settrackregister $00,$01
kp_settrackregister $01,$A8
kp_settrackregister $00,$01
kp_settrackregister $01,$A9
kp_settrackregister $00,$01
kp_settrackregister $01,$AA
kp_settrackregister $00,$01
kp_settrackregister $01,$AB
kp_settrackregister $00,$01
kp_settrackregister $01,$AC
kp_settrackregister $00,$01
kp_settrackregister $01,$AD
kp_settrackregister $00,$01
kp_settrackregister $01,$AE
kp_settrackregister $00,$01
kp_settrackregister $01,$AF
kp_settrackregister $00,$01
kp_settrackregister $01,$B0
kp_settrackregister $00,$01
kp_settrackregister $01,$B1
kp_settrackregister $00,$01
kp_settrackregister $01,$B2
kp_settrackregister $00,$01
kp_settrackregister $01,$B3
kp_settrackregister $00,$01
kp_rewind [pat10loop-pat10]
pat11
pat11loop
kp_settrackregister $01,$00
kp_setinstrument $04,$01
kp_setinstrument $04,$01
kp_settrackregister $01,$30
kp_setinstrument $04,$02
kp_settrackregister $01,$00
kp_setinstrument $04,$01
kp_setinstrument $02,$01
kp_settrackregister $01,$30
kp_setinstrument $02,$04
kp_settrackregister $01,$00
kp_setinstrument $02,$01
kp_settrackregister $01,$20
kp_setinstrument $02,$04
kp_settrackregister $01,$30
kp_setinstrument $02,$02
kp_settrackregister $01,$10
kp_setinstrument $02,$04
kp_settrackregister $01,$00
kp_setinstrument $02,$01
kp_setinstrument $02,$04
kp_rewind [pat11loop-pat11]
pat12
pat12loop
kp_settrackregister $01,$B4
kp_settrackregister $00,$01
kp_settrackregister $01,$B5
kp_settrackregister $00,$01
kp_settrackregister $01,$B6
kp_settrackregister $00,$01
kp_settrackregister $01,$B7
kp_settrackregister $00,$01
kp_settrackregister $01,$B8
kp_settrackregister $00,$01
kp_settrackregister $01,$B9
kp_settrackregister $00,$01
kp_settrackregister $01,$BA
kp_settrackregister $00,$01
kp_settrackregister $01,$BB
kp_settrackregister $00,$01
kp_settrackregister $01,$BC
kp_settrackregister $00,$01
kp_settrackregister $01,$BD
kp_settrackregister $00,$01
kp_settrackregister $01,$BE
kp_settrackregister $00,$01
kp_settrackregister $01,$BF
kp_settrackregister $00,$01
kp_settrackregister $01,$C0
kp_settrackregister $00,$01
kp_settrackregister $01,$C1
kp_settrackregister $00,$01
kp_settrackregister $01,$C2
kp_settrackregister $00,$01
kp_settrackregister $01,$C3
kp_settrackregister $00,$01
kp_settrackregister $01,$C4
kp_settrackregister $00,$01
kp_settrackregister $01,$C5
kp_settrackregister $00,$01
kp_settrackregister $01,$C6
kp_settrackregister $00,$01
kp_settrackregister $01,$C7
kp_settrackregister $00,$01
kp_settrackregister $01,$C8
kp_settrackregister $00,$01
kp_settrackregister $01,$C9
kp_settrackregister $00,$01
kp_settrackregister $01,$CA
kp_settrackregister $00,$01
kp_settrackregister $01,$CB
kp_settrackregister $00,$01
kp_settrackregister $01,$CC
kp_settrackregister $00,$01
kp_settrackregister $01,$CD
kp_settrackregister $00,$01
kp_settrackregister $01,$CE
kp_settrackregister $00,$01
kp_settrackregister $01,$CF
kp_settrackregister $00,$01
kp_settrackregister $01,$D0
kp_settrackregister $00,$01
kp_settrackregister $01,$D1
kp_settrackregister $00,$01
kp_settrackregister $01,$D2
kp_settrackregister $00,$01
kp_settrackregister $01,$D3
kp_settrackregister $00,$01
kp_rewind [pat12loop-pat12]
pat13
pat13loop
kp_settrackregister $01,$1C
kp_setinstrument $20,$05
kp_rewind [pat13loop-pat13]
pat14
pat14loop
kp_settrackregister $01,$00
kp_setinstrument $04,$06
kp_setinstrument $04,$06
kp_setinstrument $04,$07
kp_setinstrument $08,$06
kp_settrackregister $01,$30
kp_setinstrument $04,$08
kp_setinstrument $04,$07
kp_settrackregister $01,$00
kp_setinstrument $04,$06
kp_rewind [pat14loop-pat14]
pat15
pat15loop
kp_settrackregister $00,$20
kp_rewind [pat15loop-pat15]
pat16
pat16loop
kp_settrackregister $01,$24
kp_settrackregister $00,$20
kp_rewind [pat16loop-pat16]
pat17
pat17loop
kp_settrackregister $01,$28
kp_settrackregister $00,$20
kp_rewind [pat17loop-pat17]
pat18
pat18loop
kp_settrackregister $01,$30
kp_settrackregister $00,$20
kp_rewind [pat18loop-pat18]
pat19
pat19loop
kp_settrackregister $01,$A0
kp_setinstrument $08,$09
kp_settrackregister $01,$90
kp_setinstrument $08,$0A
kp_settrackregister $01,$8C
kp_setinstrument $08,$09
kp_settrackregister $01,$7C
kp_setinstrument $08,$0B
kp_rewind [pat19loop-pat19]
pat20
pat20loop
kp_settrackregister $01,$84
kp_setinstrument $08,$0C
kp_settrackregister $01,$70
kp_setinstrument $08,$09
kp_settrackregister $01,$68
kp_setinstrument $08,$0D
kp_settrackregister $01,$60
kp_setinstrument $08,$0E
kp_rewind [pat20loop-pat20]
pat21
pat21loop
kp_settrackregister $01,$10
kp_setinstrument $04,$0F
kp_setinstrument $04,$0F
kp_setinstrument $04,$07
kp_setinstrument $08,$08
kp_settrackregister $01,$30
kp_setinstrument $04,$08
kp_setinstrument $04,$07
kp_settrackregister $01,$10
kp_setinstrument $04,$0F
kp_rewind [pat21loop-pat21]
pat22
pat22loop
kp_settrackregister $01,$10
kp_setinstrument $04,$0F
kp_setinstrument $04,$0F
kp_setinstrument $04,$07
kp_setinstrument $08,$08
kp_settrackregister $01,$24
kp_setinstrument $04,$08
kp_setinstrument $04,$07
kp_settrackregister $01,$10
kp_setinstrument $04,$0F
kp_rewind [pat22loop-pat22]
pat23
pat23loop
kp_settrackregister $01,$74
kp_setinstrument $02,$10
kp_settrackregister $01,$84
kp_setinstrument $02,$11
kp_settrackregister $01,$60
kp_setinstrument $02,$10
kp_settrackregister $01,$74
kp_setinstrument $02,$11
kp_settrackregister $01,$54
kp_setinstrument $02,$10
kp_settrackregister $01,$60
kp_setinstrument $02,$11
kp_settrackregister $01,$4C
kp_setinstrument $02,$10
kp_settrackregister $01,$54
kp_setinstrument $02,$11
kp_settrackregister $01,$44
kp_setinstrument $02,$10
kp_settrackregister $01,$4C
kp_setinstrument $02,$11
kp_setinstrument $02,$10
kp_settrackregister $01,$44
kp_setinstrument $02,$11
kp_settrackregister $01,$54
kp_setinstrument $02,$10
kp_settrackregister $01,$4C
kp_setinstrument $02,$11
kp_settrackregister $01,$60
kp_setinstrument $02,$10
kp_settrackregister $01,$54
kp_setinstrument $02,$11
kp_rewind [pat23loop-pat23]
pat24
pat24loop
kp_settrackregister $01,$14
kp_setinstrument $04,$0F
kp_setinstrument $04,$0F
kp_setinstrument $04,$07
kp_setinstrument $08,$08
kp_setinstrument $04,$08
kp_setinstrument $04,$07
kp_setinstrument $04,$0F
kp_rewind [pat24loop-pat24]
pat25
pat25loop
kp_settrackregister $01,$78
kp_setinstrument $02,$10
kp_settrackregister $01,$88
kp_setinstrument $02,$11
kp_settrackregister $01,$64
kp_setinstrument $02,$10
kp_settrackregister $01,$78
kp_setinstrument $02,$11
kp_settrackregister $01,$58
kp_setinstrument $02,$10
kp_settrackregister $01,$64
kp_setinstrument $02,$11
kp_settrackregister $01,$50
kp_setinstrument $02,$10
kp_settrackregister $01,$58
kp_setinstrument $02,$11
kp_settrackregister $01,$48
kp_setinstrument $02,$10
kp_settrackregister $01,$50
kp_setinstrument $02,$11
kp_setinstrument $02,$10
kp_settrackregister $01,$48
kp_setinstrument $02,$11
kp_settrackregister $01,$58
kp_setinstrument $02,$10
kp_settrackregister $01,$50
kp_setinstrument $02,$11
kp_settrackregister $01,$64
kp_setinstrument $02,$10
kp_settrackregister $01,$58
kp_setinstrument $02,$11
kp_rewind [pat25loop-pat25]
pat26
pat26loop
kp_settrackregister $01,$18
kp_setinstrument $04,$0F
kp_setinstrument $04,$0F
kp_setinstrument $04,$07
kp_setinstrument $08,$08
kp_setinstrument $04,$08
kp_setinstrument $04,$07
kp_setinstrument $04,$0F
kp_rewind [pat26loop-pat26]
pat27
pat27loop
kp_settrackregister $01,$7C
kp_setinstrument $02,$10
kp_settrackregister $01,$5C
kp_setinstrument $02,$11
kp_settrackregister $01,$68
kp_setinstrument $02,$10
kp_settrackregister $01,$7C
kp_setinstrument $02,$11
kp_settrackregister $01,$5C
kp_setinstrument $02,$10
kp_settrackregister $01,$68
kp_setinstrument $02,$11
kp_settrackregister $01,$54
kp_setinstrument $02,$10
kp_settrackregister $01,$5C
kp_setinstrument $02,$11
kp_settrackregister $01,$4C
kp_setinstrument $02,$10
kp_settrackregister $01,$54
kp_setinstrument $02,$11
kp_setinstrument $02,$10
kp_settrackregister $01,$4C
kp_setinstrument $02,$11
kp_settrackregister $01,$5C
kp_setinstrument $02,$10
kp_settrackregister $01,$54
kp_setinstrument $02,$11
kp_settrackregister $01,$68
kp_setinstrument $02,$10
kp_settrackregister $01,$5C
kp_setinstrument $02,$11
kp_rewind [pat27loop-pat27]
pat28
pat28loop
kp_settrackregister $01,$1C
kp_setinstrument $04,$0F
kp_setinstrument $04,$0F
kp_setinstrument $04,$07
kp_setinstrument $08,$08
kp_setinstrument $04,$08
kp_setinstrument $04,$08
kp_setinstrument $04,$0F
kp_rewind [pat28loop-pat28]
pat29
pat29loop
kp_settrackregister $01,$4C
kp_setinstrument $04,$12
kp_settrackregister $01,$38
kp_setinstrument $04,$12
kp_settrackregister $01,$2C
kp_setinstrument $04,$12
kp_settrackregister $01,$24
kp_setinstrument $04,$12
kp_settrackregister $01,$1C
kp_setinstrument $04,$12
kp_settrackregister $01,$54
kp_setinstrument $04,$12
kp_settrackregister $01,$5C
kp_setinstrument $04,$12
kp_settrackregister $01,$68
kp_setinstrument $04,$12
kp_rewind [pat29loop-pat29]
pat30
pat30loop
kp_settrackregister $01,$1C
kp_setinstrument $04,$0F
kp_setinstrument $04,$0F
kp_setinstrument $04,$07
kp_setinstrument $08,$08
kp_setinstrument $04,$08
kp_setinstrument $04,$13
kp_setinstrument $04,$04
kp_rewind [pat30loop-pat30]
pat31
pat31loop
kp_settrackregister $01,$90
kp_setinstrument $10,$14
kp_settrackregister $01,$80
kp_setinstrument $04,$15
kp_settrackregister $01,$90
kp_setinstrument $04,$15
kp_settrackregister $01,$9C
kp_setinstrument $04,$15
kp_settrackregister $01,$98
kp_setinstrument $04,$14
kp_rewind [pat31loop-pat31]
pat32
pat32loop
kp_settrackregister $01,$20
kp_settrackregister $03,$0F
kp_setinstrument $08,$0F
kp_settrackregister $01,$0C
kp_setinstrument $04,$08
kp_settrackregister $01,$20
kp_setinstrument $08,$0F
kp_setinstrument $04,$0F
kp_setinstrument $04,$07
kp_settrackregister $01,$0C
kp_setinstrument $04,$0F
kp_rewind [pat32loop-pat32]
pat33
pat33loop
kp_settrackregister $00,$10
kp_settrackregister $01,$88
kp_setinstrument $04,$15
kp_settrackregister $01,$98
kp_setinstrument $04,$15
kp_settrackregister $01,$A4
kp_setinstrument $08,$14
kp_rewind [pat33loop-pat33]
pat34
pat34loop
kp_settrackregister $01,$28
kp_setinstrument $08,$0F
kp_settrackregister $01,$14
kp_setinstrument $04,$08
kp_settrackregister $01,$28
kp_setinstrument $08,$0F
kp_setinstrument $04,$0F
kp_setinstrument $04,$07
kp_settrackregister $01,$14
kp_setinstrument $04,$08
kp_rewind [pat34loop-pat34]
pat35
pat35loop
kp_settrackregister $01,$A0
kp_setinstrument $08,$14
kp_settrackregister $01,$A4
kp_setinstrument $04,$15
kp_settrackregister $01,$AC
kp_setinstrument $14,$14
kp_rewind [pat35loop-pat35]
pat36
pat36loop
kp_settrackregister $01,$30
kp_setinstrument $08,$0F
kp_settrackregister $01,$1C
kp_setinstrument $04,$08
kp_settrackregister $01,$30
kp_setinstrument $08,$0F
kp_settrackregister $01,$38
kp_setinstrument $04,$0F
kp_setinstrument $04,$07
kp_setinstrument $04,$0F
kp_rewind [pat36loop-pat36]
pat37
pat37loop
kp_settrackregister $00,$04
kp_settrackregister $01,$4C
kp_setinstrument $04,$12
kp_settrackregister $01,$44
kp_setinstrument $04,$12
kp_settrackregister $01,$40
kp_setinstrument $04,$12
kp_settrackregister $01,$30
kp_setinstrument $04,$12
kp_settrackregister $01,$1C
kp_setinstrument $04,$12
kp_settrackregister $01,$14
kp_setinstrument $04,$12
kp_settrackregister $01,$10
kp_setinstrument $04,$12
kp_rewind [pat37loop-pat37]
pat38
pat38loop
kp_settrackregister $01,$40
kp_setinstrument $04,$0F
kp_settrackregister $01,$1C
kp_settrackregister $00,$04
kp_settrackregister $01,$38
kp_setinstrument $04,$0F
kp_settrackregister $01,$10
kp_settrackregister $00,$04
kp_settrackregister $01,$30
kp_setinstrument $04,$08
kp_setinstrument $04,$07
kp_settrackregister $01,$28
kp_setinstrument $04,$08
kp_setinstrument $04,$07
kp_rewind [pat38loop-pat38]
pat39
pat39loop
kp_settrackregister $01,$AC
kp_setinstrument $10,$16
kp_settrackregister $01,$E4
kp_setinstrument $10,$17
kp_rewind [pat39loop-pat39]
pat40
pat40loop
kp_settrackregister $01,$2C
kp_setinstrument $08,$0F
kp_settrackregister $01,$1C
kp_setinstrument $04,$08
kp_settrackregister $01,$2C
kp_setinstrument $08,$0F
kp_setinstrument $04,$0F
kp_setinstrument $04,$07
kp_settrackregister $01,$30
kp_setinstrument $04,$08
kp_rewind [pat40loop-pat40]
pat41
pat41loop
kp_settrackregister $01,$EC
kp_settrackregister $00,$18
kp_settrackregister $01,$70
kp_setinstrument $04,$18
kp_settrackregister $01,$74
kp_setinstrument $04,$19
kp_rewind [pat41loop-pat41]
pat42
pat42loop
kp_settrackregister $01,$38
kp_setinstrument $04,$0F
kp_setinstrument $02,$07
kp_setinstrument $02,$07
kp_settrackregister $01,$30
kp_setinstrument $04,$08
kp_setinstrument $02,$07
kp_setinstrument $02,$07
kp_settrackregister $01,$2C
kp_setinstrument $04,$0F
kp_setinstrument $02,$07
kp_setinstrument $02,$07
kp_setinstrument $04,$13
kp_setinstrument $04,$13
kp_rewind [pat42loop-pat42]
pat43
pat43loop
kp_settrackregister $01,$7C
kp_setinstrument $04,$1A
kp_settrackregister $01,$70
kp_setinstrument $04,$18
kp_settrackregister $01,$7C
kp_setinstrument $04,$1A
kp_settrackregister $01,$90
kp_setinstrument $08,$0A
kp_settrackregister $01,$70
kp_setinstrument $04,$18
kp_settrackregister $01,$74
kp_setinstrument $04,$19
kp_settrackregister $01,$7C
kp_setinstrument $04,$0A
kp_rewind [pat43loop-pat43]
pat44
pat44loop
kp_settrackregister $01,$30
kp_setinstrument $04,$0F
kp_setinstrument $04,$0F
kp_settrackregister $01,$60
kp_setinstrument $04,$1B
kp_settrackregister $01,$30
kp_setinstrument $08,$08
kp_settrackregister $01,$00
kp_setinstrument $04,$06
kp_setinstrument $04,$07
kp_settrackregister $01,$28
kp_setinstrument $04,$0F
kp_rewind [pat44loop-pat44]
pat45
pat45loop
kp_settrackregister $00,$04
kp_settrackregister $01,$60
kp_setinstrument $04,$19
kp_settrackregister $01,$70
kp_setinstrument $04,$18
kp_settrackregister $01,$7C
kp_setinstrument $04,$1A
kp_settrackregister $01,$90
kp_setinstrument $04,$19
kp_settrackregister $01,$70
kp_setinstrument $04,$18
kp_settrackregister $01,$74
kp_setinstrument $08,$0A
kp_rewind [pat45loop-pat45]
pat46
pat46loop
kp_settrackregister $00,$04
kp_setinstrument $04,$0F
kp_settrackregister $01,$58
kp_setinstrument $04,$1C
kp_settrackregister $01,$28
kp_setinstrument $04,$0F
kp_setinstrument $08,$08
kp_setinstrument $02,$07
kp_setinstrument $02,$07
kp_setinstrument $04,$0F
kp_rewind [pat46loop-pat46]
pat47
pat47loop
kp_settrackregister $01,$7C
kp_setinstrument $0C,$1D
kp_settrackregister $01,$5C
kp_setinstrument $04,$18
kp_settrackregister $01,$60
kp_setinstrument $04,$19
kp_settrackregister $01,$70
kp_setinstrument $04,$18
kp_settrackregister $01,$7C
kp_setinstrument $04,$1A
kp_settrackregister $01,$90
kp_setinstrument $04,$1E
kp_rewind [pat47loop-pat47]
pat48
pat48loop
kp_settrackregister $01,$14
kp_setinstrument $04,$0F
kp_setinstrument $04,$0F
kp_settrackregister $01,$44
kp_setinstrument $04,$1B
kp_settrackregister $01,$14
kp_setinstrument $08,$08
kp_settrackregister $01,$00
kp_setinstrument $04,$06
kp_setinstrument $04,$07
kp_settrackregister $01,$20
kp_setinstrument $04,$0F
kp_rewind [pat48loop-pat48]
pat49
pat49loop
kp_settrackregister $00,$08
kp_settrackregister $01,$88
kp_setinstrument $08,$0A
kp_settrackregister $01,$7C
kp_setinstrument $08,$0A
kp_settrackregister $01,$70
kp_setinstrument $04,$18
kp_settrackregister $01,$74
kp_setinstrument $04,$19
kp_rewind [pat49loop-pat49]
pat50
pat50loop
kp_settrackregister $00,$04
kp_setinstrument $04,$0F
kp_settrackregister $01,$4C
kp_setinstrument $04,$1B
kp_settrackregister $01,$20
kp_setinstrument $04,$0F
kp_settrackregister $01,$1C
kp_setinstrument $08,$08
kp_setinstrument $08,$13
kp_rewind [pat50loop-pat50]
pat51
pat51loop
kp_settrackregister $01,$7C
kp_setinstrument $0C,$1D
kp_setinstrument $04,$1A
kp_settrackregister $01,$90
kp_setinstrument $04,$19
kp_settrackregister $01,$98
kp_setinstrument $04,$1A
kp_settrackregister $01,$A0
kp_setinstrument $04,$18
kp_settrackregister $01,$A4
kp_setinstrument $04,$0A
kp_rewind [pat51loop-pat51]
pat52
pat52loop
kp_settrackregister $01,$24
kp_setinstrument $04,$0F
kp_setinstrument $04,$0F
kp_settrackregister $01,$44
kp_setinstrument $04,$1B
kp_settrackregister $01,$24
kp_setinstrument $08,$08
kp_settrackregister $01,$00
kp_setinstrument $04,$0F
kp_setinstrument $04,$07
kp_settrackregister $01,$20
kp_setinstrument $04,$0F
kp_rewind [pat52loop-pat52]
pat53
pat53loop
kp_settrackregister $00,$04
kp_settrackregister $01,$9C
kp_setinstrument $04,$1A
kp_settrackregister $01,$98
kp_setinstrument $04,$18
kp_settrackregister $01,$90
kp_setinstrument $0C,$09
kp_settrackregister $01,$70
kp_setinstrument $04,$18
kp_settrackregister $01,$74
kp_setinstrument $04,$19
kp_rewind [pat53loop-pat53]
pat54
pat54loop
kp_settrackregister $00,$04
kp_setinstrument $04,$0F
kp_settrackregister $01,$4C
kp_setinstrument $04,$1B
kp_settrackregister $01,$20
kp_setinstrument $04,$0F
kp_settrackregister $01,$28
kp_setinstrument $08,$08
kp_setinstrument $08,$13
kp_rewind [pat54loop-pat54]
pat55
pat55loop
kp_settrackregister $00,$04
kp_settrackregister $01,$9C
kp_setinstrument $04,$1A
kp_settrackregister $01,$98
kp_setinstrument $04,$18
kp_settrackregister $01,$90
kp_setinstrument $10,$1F
kp_settrackregister $01,$60
kp_setinstrument $02,$15
kp_settrackregister $01,$68
kp_setinstrument $02,$15
kp_rewind [pat55loop-pat55]
pat56
pat56loop
kp_settrackregister $01,$70
kp_setinstrument $08,$20
kp_settrackregister $01,$68
kp_setinstrument $04,$15
kp_settrackregister $01,$70
kp_setinstrument $14,$20
kp_rewind [pat56loop-pat56]
pat57
pat57loop
kp_settrackregister $01,$14
kp_setinstrument $04,$0F
kp_setinstrument $04,$0F
kp_setinstrument $04,$08
kp_setinstrument $04,$0F
kp_setinstrument $04,$0F
kp_setinstrument $04,$0F
kp_setinstrument $04,$08
kp_setinstrument $04,$0F
kp_rewind [pat57loop-pat57]
pat58
pat58loop
kp_settrackregister $00,$0C
kp_settrackregister $01,$60
kp_setinstrument $01,$15
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $01,$5C
kp_settrackregister $03,$0F
kp_setinstrument $01,$15
kp_settrackregister $03,$09
kp_settrackregister $00,$01
kp_settrackregister $01,$54
kp_settrackregister $03,$0F
kp_setinstrument $04,$15
kp_settrackregister $01,$60
kp_setinstrument $06,$20
kp_settrackregister $01,$70
kp_setinstrument $06,$20
kp_rewind [pat58loop-pat58]
pat59
pat59loop
kp_setinstrument $04,$0F
kp_setinstrument $04,$0F
kp_setinstrument $08,$08
kp_setinstrument $08,$08
kp_setinstrument $04,$08
kp_setinstrument $02,$07
kp_setinstrument $02,$07
kp_rewind [pat59loop-pat59]
pat60
pat60loop
kp_settrackregister $01,$7C
kp_setinstrument $08,$20
kp_settrackregister $01,$74
kp_setinstrument $06,$20
kp_settrackregister $01,$7C
kp_setinstrument $12,$20
kp_rewind [pat60loop-pat60]
pat61
pat61loop
kp_settrackregister $01,$00
kp_setinstrument $20,$21
kp_rewind [pat61loop-pat61]
pat62
pat62loop
kp_settrackregister $01,$02
kp_settrackregister $00,$01
kp_settrackregister $01,$04
kp_settrackregister $00,$01
kp_settrackregister $01,$06
kp_settrackregister $00,$01
kp_settrackregister $01,$08
kp_settrackregister $00,$01
kp_settrackregister $01,$0A
kp_settrackregister $00,$01
kp_settrackregister $01,$0C
kp_settrackregister $00,$01
kp_settrackregister $01,$0E
kp_settrackregister $00,$01
kp_settrackregister $01,$10
kp_settrackregister $00,$01
kp_settrackregister $01,$12
kp_settrackregister $00,$01
kp_settrackregister $01,$16
kp_settrackregister $00,$01
kp_settrackregister $01,$18
kp_settrackregister $00,$01
kp_settrackregister $01,$1A
kp_settrackregister $00,$01
kp_settrackregister $01,$1C
kp_settrackregister $00,$01
kp_settrackregister $01,$1E
kp_settrackregister $00,$01
kp_settrackregister $01,$20
kp_settrackregister $00,$01
kp_settrackregister $01,$22
kp_settrackregister $00,$01
kp_settrackregister $01,$24
kp_settrackregister $00,$01
kp_settrackregister $01,$26
kp_settrackregister $00,$01
kp_settrackregister $01,$28
kp_settrackregister $00,$01
kp_settrackregister $01,$2A
kp_settrackregister $00,$01
kp_settrackregister $01,$2C
kp_settrackregister $00,$01
kp_settrackregister $01,$2E
kp_settrackregister $00,$01
kp_settrackregister $01,$30
kp_settrackregister $00,$01
kp_settrackregister $01,$32
kp_settrackregister $00,$01
kp_settrackregister $01,$34
kp_settrackregister $00,$01
kp_settrackregister $01,$36
kp_settrackregister $00,$01
kp_settrackregister $01,$38
kp_settrackregister $00,$01
kp_settrackregister $01,$3A
kp_settrackregister $00,$01
kp_settrackregister $01,$3C
kp_settrackregister $00,$01
kp_settrackregister $01,$3E
kp_settrackregister $00,$01
kp_settrackregister $01,$40
kp_settrackregister $00,$01
kp_settrackregister $01,$42
kp_settrackregister $00,$01
kp_rewind [pat62loop-pat62]
pat63
pat63loop
kp_settrackregister $01,$84
kp_setinstrument $20,$16
kp_rewind [pat63loop-pat63]
pat64
pat64loop
kp_settrackregister $01,$14
kp_setinstrument $20,$05
kp_rewind [pat64loop-pat64]
pat65
pat65loop
kp_settrackregister $00,$02
kp_settrackregister $01,$86
kp_settrackregister $00,$01
kp_settrackregister $01,$88
kp_settrackregister $00,$01
kp_settrackregister $01,$8A
kp_settrackregister $00,$01
kp_settrackregister $01,$8C
kp_settrackregister $00,$1B
kp_rewind [pat65loop-pat65]
pat66
pat66loop
kp_settrackregister $00,$04
kp_settrackregister $01,$2C
kp_settrackregister $00,$1C
kp_rewind [pat66loop-pat66]
pat67
pat67loop
kp_settrackregister $03,$0E
kp_settrackregister $00,$02
kp_settrackregister $03,$0D
kp_settrackregister $00,$02
kp_settrackregister $03,$0C
kp_settrackregister $00,$02
kp_settrackregister $03,$0B
kp_settrackregister $00,$02
kp_settrackregister $03,$0A
kp_settrackregister $00,$02
kp_settrackregister $03,$09
kp_settrackregister $00,$02
kp_settrackregister $03,$08
kp_settrackregister $00,$02
kp_settrackregister $03,$07
kp_settrackregister $00,$02
kp_settrackregister $03,$06
kp_settrackregister $00,$02
kp_settrackregister $03,$05
kp_settrackregister $00,$02
kp_settrackregister $03,$04
kp_settrackregister $00,$02
kp_settrackregister $03,$03
kp_settrackregister $00,$02
kp_settrackregister $03,$02
kp_settrackregister $00,$02
kp_settrackregister $03,$01
kp_settrackregister $00,$02
kp_settrackregister $03,$00
kp_settrackregister $00,$02
kp_setinstrument $02,$22
kp_rewind [pat67loop-pat67]
kp_insmap_lo
dc.b #<insnil
dc.b #<ins1
dc.b #<ins2
dc.b #<ins3
dc.b #<ins4
dc.b #<ins5
dc.b #<ins6
dc.b #<ins7
dc.b #<ins8
dc.b #<ins9
dc.b #<ins10
dc.b #<ins11
dc.b #<ins12
dc.b #<ins13
dc.b #<ins14
dc.b #<ins15
dc.b #<ins16
dc.b #<ins17
dc.b #<ins18
dc.b #<ins19
dc.b #<ins20
dc.b #<ins21
dc.b #<ins22
dc.b #<ins23
dc.b #<ins24
dc.b #<ins25
dc.b #<ins26
dc.b #<ins27
dc.b #<ins28
dc.b #<ins29
dc.b #<ins30
dc.b #<ins31
dc.b #<ins32
dc.b #<ins33
dc.b #<ins34
kp_insmap_hi
dc.b #>insnil
dc.b #>ins1
dc.b #>ins2
dc.b #>ins3
dc.b #>ins4
dc.b #>ins5
dc.b #>ins6
dc.b #>ins7
dc.b #>ins8
dc.b #>ins9
dc.b #>ins10
dc.b #>ins11
dc.b #>ins12
dc.b #>ins13
dc.b #>ins14
dc.b #>ins15
dc.b #>ins16
dc.b #>ins17
dc.b #>ins18
dc.b #>ins19
dc.b #>ins20
dc.b #>ins21
dc.b #>ins22
dc.b #>ins23
dc.b #>ins24
dc.b #>ins25
dc.b #>ins26
dc.b #>ins27
dc.b #>ins28
dc.b #>ins29
dc.b #>ins30
dc.b #>ins31
dc.b #>ins32
dc.b #>ins33
dc.b #>ins34
kp_volmap_lo
dc.b #<volnil
dc.b #<vol1
dc.b #<vol2
dc.b #<vol3
dc.b #<vol4
dc.b #<vol5
dc.b #<vol6
dc.b #<vol7
dc.b #<vol8
dc.b #<vol9
dc.b #<vol10
dc.b #<vol11
dc.b #<vol12
dc.b #<vol13
dc.b #<vol14
dc.b #<vol15
dc.b #<vol16
dc.b #<vol17
dc.b #<vol18
dc.b #<vol19
dc.b #<vol20
dc.b #<vol21
dc.b #<vol22
dc.b #<vol23
dc.b #<vol24
dc.b #<vol25
dc.b #<vol26
dc.b #<vol27
dc.b #<vol28
dc.b #<vol29
dc.b #<vol30
dc.b #<vol31
dc.b #<vol32
dc.b #<vol33
dc.b #<vol34
kp_volmap_hi
dc.b #>volnil
dc.b #>vol1
dc.b #>vol2
dc.b #>vol3
dc.b #>vol4
dc.b #>vol5
dc.b #>vol6
dc.b #>vol7
dc.b #>vol8
dc.b #>vol9
dc.b #>vol10
dc.b #>vol11
dc.b #>vol12
dc.b #>vol13
dc.b #>vol14
dc.b #>vol15
dc.b #>vol16
dc.b #>vol17
dc.b #>vol18
dc.b #>vol19
dc.b #>vol20
dc.b #>vol21
dc.b #>vol22
dc.b #>vol23
dc.b #>vol24
dc.b #>vol25
dc.b #>vol26
dc.b #>vol27
dc.b #>vol28
dc.b #>vol29
dc.b #>vol30
dc.b #>vol31
dc.b #>vol32
dc.b #>vol33
dc.b #>vol34
insnil
KP_OSCV 0,0,0,0,15
KP_OSCJ 0
volnil
KP_VOLV 0,15
KP_VOLJ 0
ins1
KP_OSCV $02,0,1,1,$00
KP_OSCV $00,0,1,1,$02
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$01
ins1loop
KP_OSCV $00,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $02,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$05
KP_OSCJ [ins1loop-ins1]
vol1
KP_VOLV $0F,$05
KP_VOLV $0E,$00
KP_VOLV $0D,$00
KP_VOLV $0C,$00
KP_VOLV $0B,$00
KP_VOLV $0A,$00
KP_VOLV $09,$00
vol1loop
KP_VOLV $08,$00
KP_VOLJ [vol1loop-vol1]
ins2
KP_OSCV $02,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $FE,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $FF,0,1,1,$00
ins2loop
KP_OSCV $00,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $02,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$01
KP_OSCV $FF,0,1,1,$00
KP_OSCV $FE,0,1,1,$00
KP_OSCV $FF,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCJ [ins2loop-ins2]
vol2
KP_VOLV $0F,$05
KP_VOLV $0E,$00
KP_VOLV $0D,$00
KP_VOLV $0C,$00
KP_VOLV $0B,$00
KP_VOLV $0A,$00
KP_VOLV $09,$00
vol2loop
KP_VOLV $08,$00
KP_VOLJ [vol2loop-vol2]
ins3
ins3loop
KP_OSCV $00,0,1,1,$00
KP_OSCV $30,1,0,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $14,0,1,1,$00
KP_OSCV $40,1,0,1,$00
KP_OSCV $14,0,1,1,$00
KP_OSCJ [ins3loop-ins3]
vol3
vol3loop
KP_VOLV $0F,$00
KP_VOLJ [vol3loop-vol3]
ins4
KP_OSCV $1C,0,1,1,$00
KP_OSCV $16,0,1,1,$00
KP_OSCV $11,0,1,1,$00
KP_OSCV $0D,0,1,1,$00
KP_OSCV $0B,0,1,1,$00
KP_OSCV $09,0,1,1,$00
KP_OSCV $07,0,1,1,$00
KP_OSCV $05,0,1,1,$00
KP_OSCV $04,0,1,1,$00
KP_OSCV $03,0,1,1,$00
KP_OSCV $02,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$00
ins4loop
KP_OSCV $00,0,0,0,$00
KP_OSCJ [ins4loop-ins4]
vol4
KP_VOLV $0F,$05
KP_VOLV $0D,$00
KP_VOLV $0C,$00
KP_VOLV $0B,$00
KP_VOLV $0A,$00
KP_VOLV $08,$00
KP_VOLV $05,$00
vol4loop
KP_VOLV $03,$00
KP_VOLJ [vol4loop-vol4]
ins5
ins5loop
KP_OSCV $54,0,1,1,$00
KP_OSCV $30,0,1,1,$00
KP_OSCV $60,0,1,1,$00
KP_OSCV $44,0,1,1,$00
KP_OSCV $74,0,1,1,$00
KP_OSCV $84,0,1,1,$00
KP_OSCV $24,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $30,0,1,1,$00
KP_OSCV $14,0,1,1,$00
KP_OSCV $44,0,1,1,$00
KP_OSCV $54,0,1,1,$00
KP_OSCJ [ins5loop-ins5]
vol5
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
vol5loop
KP_VOLV $0F,$00
KP_VOLJ [vol5loop-vol5]
ins6
KP_OSCV $38,0,1,0,$00
KP_OSCV $34,0,1,0,$00
KP_OSCV $02,0,1,1,$00
KP_OSCV $00,0,1,1,$02
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$01
ins6loop
KP_OSCV $00,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $02,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$05
KP_OSCJ [ins6loop-ins6]
vol6
KP_VOLV $0F,$00
KP_VOLV $0C,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$04
KP_VOLV $0E,$02
KP_VOLV $0D,$02
KP_VOLV $0C,$02
KP_VOLV $0B,$02
KP_VOLV $0A,$02
KP_VOLV $09,$01
KP_VOLV $08,$00
vol6loop
KP_VOLV $07,$00
KP_VOLJ [vol6loop-vol6]
ins7
KP_OSCV $EE,1,0,0,$00
KP_OSCV $10,1,0,0,$00
ins7loop
KP_OSCV $52,0,1,0,$00
KP_OSCV $4E,0,1,0,$00
KP_OSCJ [ins7loop-ins7]
vol7
KP_VOLV $09,$00
KP_VOLV $0C,$00
KP_VOLV $0F,$03
KP_VOLV $0E,$00
KP_VOLV $0D,$00
KP_VOLV $0C,$00
KP_VOLV $0B,$00
KP_VOLV $0A,$00
KP_VOLV $09,$00
KP_VOLV $08,$00
KP_VOLV $07,$00
KP_VOLV $06,$00
KP_VOLV $05,$00
vol7loop
KP_VOLV $04,$00
KP_VOLJ [vol7loop-vol7]
ins8
KP_OSCV $A2,1,0,0,$00
KP_OSCV $EE,1,0,0,$00
KP_OSCV $02,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $FE,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $FF,0,1,1,$00
ins8loop
KP_OSCV $00,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $02,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$01
KP_OSCV $FF,0,1,1,$00
KP_OSCV $FE,0,1,1,$00
KP_OSCV $FF,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCJ [ins8loop-ins8]
vol8
KP_VOLV $0F,$00
KP_VOLV $0C,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$04
KP_VOLV $0E,$02
KP_VOLV $0D,$02
KP_VOLV $0C,$02
KP_VOLV $0B,$02
KP_VOLV $0A,$02
KP_VOLV $09,$01
KP_VOLV $08,$00
vol8loop
KP_VOLV $07,$00
KP_VOLJ [vol8loop-vol8]
ins9
ins9loop
KP_OSCV $20,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $0C,0,1,1,$02
KP_OSCV $20,0,1,1,$00
KP_OSCJ [ins9loop-ins9]
vol9
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0E,$00
KP_VOLV $0D,$00
KP_VOLV $0C,$00
KP_VOLV $0B,$00
KP_VOLV $0A,$00
KP_VOLV $09,$00
vol9loop
KP_VOLV $08,$00
KP_VOLJ [vol9loop-vol9]
ins10
ins10loop
KP_OSCV $1C,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $10,0,1,1,$02
KP_OSCV $1C,0,1,1,$00
KP_OSCJ [ins10loop-ins10]
vol10
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0E,$00
KP_VOLV $0D,$00
KP_VOLV $0C,$00
KP_VOLV $0B,$00
KP_VOLV $0A,$00
KP_VOLV $09,$00
vol10loop
KP_VOLV $08,$00
KP_VOLJ [vol10loop-vol10]
ins11
ins11loop
KP_OSCV $24,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $14,0,1,1,$02
KP_OSCV $24,0,1,1,$00
KP_OSCJ [ins11loop-ins11]
vol11
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$05
KP_VOLV $0E,$07
KP_VOLV $0E,$07
KP_VOLV $0E,$07
KP_VOLV $0D,$07
KP_VOLV $0D,$07
KP_VOLV $0D,$07
vol11loop
KP_VOLV $0C,$00
KP_VOLJ [vol11loop-vol11]
ins12
ins12loop
KP_OSCV $1C,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $0C,0,1,1,$02
KP_OSCV $1C,0,1,1,$00
KP_OSCJ [ins12loop-ins12]
vol12
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0E,$00
KP_VOLV $0D,$00
KP_VOLV $0C,$00
KP_VOLV $0B,$00
KP_VOLV $0A,$00
KP_VOLV $09,$00
vol12loop
KP_VOLV $08,$00
KP_VOLJ [vol12loop-vol12]
ins13
ins13loop
KP_OSCV $24,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $14,0,1,1,$02
KP_OSCV $24,0,1,1,$00
KP_OSCJ [ins13loop-ins13]
vol13
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0E,$00
KP_VOLV $0D,$00
KP_VOLV $0C,$00
KP_VOLV $0B,$00
KP_VOLV $0A,$00
KP_VOLV $09,$00
vol13loop
KP_VOLV $08,$00
KP_VOLJ [vol13loop-vol13]
ins14
ins14loop
KP_OSCV $1C,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $10,0,1,1,$02
KP_OSCV $1C,0,1,1,$00
KP_OSCJ [ins14loop-ins14]
vol14
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$05
KP_VOLV $0E,$07
KP_VOLV $0E,$07
KP_VOLV $0E,$07
KP_VOLV $0D,$07
KP_VOLV $0D,$07
KP_VOLV $0D,$07
vol14loop
KP_VOLV $0C,$00
KP_VOLJ [vol14loop-vol14]
ins15
KP_OSCV $38,0,1,0,$00
KP_OSCV $34,0,1,0,$00
KP_OSCV $02,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $FE,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $FF,0,1,1,$00
ins15loop
KP_OSCV $00,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $02,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$01
KP_OSCV $FF,0,1,1,$00
KP_OSCV $FE,0,1,1,$00
KP_OSCV $FF,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCJ [ins15loop-ins15]
vol15
KP_VOLV $0F,$00
KP_VOLV $0C,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$04
KP_VOLV $0E,$02
KP_VOLV $0D,$02
KP_VOLV $0C,$02
KP_VOLV $0B,$02
KP_VOLV $0A,$02
KP_VOLV $09,$01
KP_VOLV $08,$00
vol15loop
KP_VOLV $07,$00
KP_VOLJ [vol15loop-vol15]
ins16
ins16loop
KP_OSCV $02,0,1,1,$00
KP_OSCV $FF,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $FE,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $FF,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCJ [ins16loop-ins16]
vol16
KP_VOLV $0F,$03
KP_VOLV $0E,$00
KP_VOLV $0C,$00
KP_VOLV $09,$00
vol16loop
KP_VOLV $05,$00
KP_VOLJ [vol16loop-vol16]
ins17
ins17loop
KP_OSCV $00,0,1,1,$00
KP_OSCV $02,0,1,1,$00
KP_OSCV $FF,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $FE,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $FF,0,1,1,$00
KP_OSCJ [ins17loop-ins17]
vol17
vol17loop
KP_VOLV $04,$00
KP_VOLJ [vol17loop-vol17]
ins18
KP_OSCV $61,0,1,1,$00
KP_OSCV $62,0,1,1,$00
KP_OSCV $60,0,1,1,$00
KP_OSCV $5F,0,1,1,$00
KP_OSCV $5E,0,1,1,$00
KP_OSCV $60,0,1,1,$00
KP_OSCV $31,0,1,1,$00
KP_OSCV $32,0,1,1,$00
KP_OSCV $30,0,1,1,$00
KP_OSCV $2F,0,1,1,$00
KP_OSCV $2E,0,1,1,$00
KP_OSCV $30,0,1,1,$00
ins18loop
KP_OSCV $01,0,1,1,$00
KP_OSCV $02,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCV $FF,0,1,1,$00
KP_OSCV $FE,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCJ [ins18loop-ins18]
vol18
KP_VOLV $0F,$00
KP_VOLV $0E,$00
KP_VOLV $0D,$00
KP_VOLV $0C,$00
KP_VOLV $0A,$00
KP_VOLV $08,$00
KP_VOLV $0D,$00
KP_VOLV $0C,$00
KP_VOLV $0B,$00
KP_VOLV $0A,$00
KP_VOLV $08,$00
KP_VOLV $06,$00
KP_VOLV $0B,$00
KP_VOLV $0A,$00
KP_VOLV $09,$00
KP_VOLV $08,$00
KP_VOLV $07,$00
KP_VOLV $05,$00
vol18loop
KP_VOLV $09,$00
KP_VOLV $08,$00
KP_VOLV $07,$00
KP_VOLV $06,$00
KP_VOLV $05,$00
KP_VOLV $04,$00
KP_VOLJ [vol18loop-vol18]
ins19
KP_OSCV $08,0,1,0,$00
KP_OSCV $78,1,0,0,$00
ins19loop
KP_OSCV $F2,1,0,0,$00
KP_OSCV $EE,1,0,0,$00
KP_OSCV $FA,1,0,0,$00
KP_OSCV $E8,1,0,0,$00
KP_OSCJ [ins19loop-ins19]
vol19
KP_VOLV $0F,$03
KP_VOLV $0E,$02
KP_VOLV $0D,$01
KP_VOLV $0C,$01
KP_VOLV $0B,$01
KP_VOLV $0A,$01
KP_VOLV $09,$00
KP_VOLV $08,$00
KP_VOLV $06,$00
vol19loop
KP_VOLV $04,$00
KP_VOLJ [vol19loop-vol19]
ins20
KP_OSCV $F8,0,1,1,$00
KP_OSCV $FC,0,1,1,$00
ins20loop
KP_OSCV $00,0,1,1,$00
KP_OSCV $01,0,1,1,$00
KP_OSCV $02,0,1,1,$01
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$01
KP_OSCV $FF,0,1,1,$00
KP_OSCV $FE,0,1,1,$01
KP_OSCV $FF,0,1,1,$00
KP_OSCV $00,0,1,1,$00
KP_OSCJ [ins20loop-ins20]
vol20
KP_VOLV $09,$00
KP_VOLV $0A,$00
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$06
KP_VOLV $0E,$07
KP_VOLV $0E,$03
KP_VOLV $0D,$07
KP_VOLV $0D,$03
KP_VOLV $0C,$07
KP_VOLV $0C,$03
KP_VOLV $0B,$07
KP_VOLV $0B,$03
KP_VOLV $0A,$07
KP_VOLV $0A,$03
KP_VOLV $09,$07
KP_VOLV $09,$03
vol20loop
KP_VOLV $08,$00
KP_VOLJ [vol20loop-vol20]
ins21
ins21loop
KP_OSCV $01,0,1,1,$00
KP_OSCV $02,0,1,1,$01
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$01
KP_OSCV $FF,0,1,1,$00
KP_OSCV $FE,0,1,1,$01
KP_OSCV $FF,0,1,1,$00
KP_OSCV $00,0,1,1,$01
KP_OSCJ [ins21loop-ins21]
vol21
KP_VOLV $09,$00
KP_VOLV $0A,$00
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$06
KP_VOLV $0E,$00
KP_VOLV $0D,$00
KP_VOLV $0C,$00
KP_VOLV $0B,$00
KP_VOLV $0A,$00
vol21loop
KP_VOLV $09,$00
KP_VOLJ [vol21loop-vol21]
ins22
ins22loop
KP_OSCV $01,0,1,1,$00
KP_OSCV $02,0,1,1,$01
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$01
KP_OSCV $FF,0,1,1,$00
KP_OSCV $FE,0,1,1,$01
KP_OSCV $FF,0,1,1,$00
KP_OSCV $00,0,1,1,$01
KP_OSCJ [ins22loop-ins22]
vol22
KP_VOLV $09,$00
KP_VOLV $0A,$00
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
vol22loop
KP_VOLV $0F,$00
KP_VOLJ [vol22loop-vol22]
ins23
ins23loop
KP_OSCV $AC,0,1,0,$00
KP_OSCV $AD,0,1,0,$00
KP_OSCV $AC,0,1,1,$00
KP_OSCV $AF,0,1,0,$00
KP_OSCV $B0,0,1,0,$00
KP_OSCV $AF,0,1,0,$00
KP_OSCV $AC,0,1,1,$00
KP_OSCV $AD,0,1,0,$00
KP_OSCV $AC,0,1,0,$00
KP_OSCV $AB,0,1,0,$00
KP_OSCV $AC,0,1,1,$00
KP_OSCV $A9,0,1,0,$00
KP_OSCV $A8,0,1,0,$00
KP_OSCV $A9,0,1,0,$00
KP_OSCV $AC,0,1,1,$00
KP_OSCV $AB,0,1,0,$00
KP_OSCJ [ins23loop-ins23]
vol23
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$05
KP_VOLV $0E,$07
KP_VOLV $0E,$07
KP_VOLV $0E,$07
KP_VOLV $0E,$02
KP_VOLV $0D,$07
KP_VOLV $0D,$07
KP_VOLV $0D,$07
KP_VOLV $0D,$07
KP_VOLV $0D,$06
KP_VOLV $0C,$07
KP_VOLV $0C,$07
KP_VOLV $0C,$07
KP_VOLV $0C,$02
vol23loop
KP_VOLV $0B,$00
KP_VOLJ [vol23loop-vol23]
ins24
ins24loop
KP_OSCV $20,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $0C,0,1,1,$02
KP_OSCV $20,0,1,1,$00
KP_OSCJ [ins24loop-ins24]
vol24
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0E,$00
KP_VOLV $0C,$00
KP_VOLV $0A,$00
vol24loop
KP_VOLV $08,$00
KP_VOLJ [vol24loop-vol24]
ins25
ins25loop
KP_OSCV $1C,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $10,0,1,1,$02
KP_OSCV $1C,0,1,1,$00
KP_OSCJ [ins25loop-ins25]
vol25
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0E,$00
KP_VOLV $0C,$00
KP_VOLV $0A,$00
vol25loop
KP_VOLV $08,$00
KP_VOLJ [vol25loop-vol25]
ins26
ins26loop
KP_OSCV $24,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $14,0,1,1,$02
KP_OSCV $24,0,1,1,$00
KP_OSCJ [ins26loop-ins26]
vol26
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0E,$00
KP_VOLV $0C,$00
KP_VOLV $0A,$00
vol26loop
KP_VOLV $08,$00
KP_VOLJ [vol26loop-vol26]
ins27
ins27loop
KP_OSCV $1C,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $10,0,1,1,$01
KP_OSCV $40,0,1,1,$00
KP_OSCV $4C,0,1,1,$00
KP_OSCJ [ins27loop-ins27]
vol27
KP_VOLV $0F,$05
KP_VOLV $0E,$01
KP_VOLV $0D,$01
KP_VOLV $0C,$01
KP_VOLV $0B,$02
KP_VOLV $0A,$02
vol27loop
KP_VOLV $09,$00
KP_VOLJ [vol27loop-vol27]
ins28
ins28loop
KP_OSCV $24,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $10,0,1,1,$01
KP_OSCV $40,0,1,1,$00
KP_OSCV $54,0,1,1,$00
KP_OSCJ [ins28loop-ins28]
vol28
KP_VOLV $0F,$05
KP_VOLV $0E,$01
KP_VOLV $0D,$01
KP_VOLV $0C,$01
KP_VOLV $0B,$02
KP_VOLV $0A,$02
vol28loop
KP_VOLV $09,$00
KP_VOLJ [vol28loop-vol28]
ins29
ins29loop
KP_OSCV $24,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $14,0,1,1,$02
KP_OSCV $24,0,1,1,$00
KP_OSCJ [ins29loop-ins29]
vol29
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$03
KP_VOLV $0E,$00
KP_VOLV $0D,$00
KP_VOLV $0C,$00
KP_VOLV $0B,$00
KP_VOLV $0A,$00
KP_VOLV $09,$00
vol29loop
KP_VOLV $08,$00
KP_VOLJ [vol29loop-vol29]
ins30
ins30loop
KP_OSCV $1C,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $10,0,1,1,$02
KP_OSCV $1C,0,1,1,$00
KP_OSCJ [ins30loop-ins30]
vol30
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$03
KP_VOLV $0E,$00
KP_VOLV $0D,$00
KP_VOLV $0C,$00
KP_VOLV $0B,$00
KP_VOLV $0A,$00
KP_VOLV $09,$00
vol30loop
KP_VOLV $08,$00
KP_VOLJ [vol30loop-vol30]
ins31
ins31loop
KP_OSCV $20,0,1,1,$01
KP_OSCV $00,0,1,1,$01
KP_OSCV $30,0,1,1,$01
KP_OSCV $0C,0,1,1,$02
KP_OSCV $20,0,1,1,$00
KP_OSCJ [ins31loop-ins31]
vol31
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$03
KP_VOLV $0E,$00
KP_VOLV $0D,$00
KP_VOLV $0C,$00
vol31loop
KP_VOLV $0B,$00
KP_VOLJ [vol31loop-vol31]
ins32
ins32loop
KP_OSCV $01,0,1,1,$00
KP_OSCV $02,0,1,1,$01
KP_OSCV $01,0,1,1,$00
KP_OSCV $00,0,1,1,$01
KP_OSCV $FF,0,1,1,$00
KP_OSCV $FE,0,1,1,$01
KP_OSCV $FF,0,1,1,$00
KP_OSCV $00,0,1,1,$01
KP_OSCJ [ins32loop-ins32]
vol32
KP_VOLV $09,$00
KP_VOLV $0A,$00
KP_VOLV $0B,$00
KP_VOLV $0C,$00
KP_VOLV $0D,$00
KP_VOLV $0E,$00
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$07
KP_VOLV $0F,$05
KP_VOLV $0E,$07
KP_VOLV $0E,$07
KP_VOLV $0E,$07
KP_VOLV $0D,$07
KP_VOLV $0D,$07
KP_VOLV $0D,$07
KP_VOLV $0C,$07
KP_VOLV $0C,$07
KP_VOLV $0C,$07
KP_VOLV $0B,$07
KP_VOLV $0B,$07
KP_VOLV $0B,$07
KP_VOLV $0A,$07
KP_VOLV $0A,$07
KP_VOLV $0A,$07
KP_VOLV $09,$07
KP_VOLV $09,$07
KP_VOLV $09,$07
vol32loop
KP_VOLV $08,$00
KP_VOLJ [vol32loop-vol32]
ins33
ins33loop
KP_OSCV $28,0,1,0,$00
KP_OSCV $29,0,1,0,$00
KP_OSCV $28,0,1,1,$00
KP_OSCV $2B,0,1,0,$00
KP_OSCV $2C,0,1,0,$00
KP_OSCV $2B,0,1,0,$00
KP_OSCV $28,0,1,1,$00
KP_OSCV $29,0,1,0,$00
KP_OSCV $28,0,1,0,$00
KP_OSCV $27,0,1,0,$00
KP_OSCV $28,0,1,1,$00
KP_OSCV $25,0,1,0,$00
KP_OSCV $24,0,1,0,$00
KP_OSCV $25,0,1,0,$00
KP_OSCV $28,0,1,1,$00
KP_OSCV $27,0,1,0,$00
KP_OSCJ [ins33loop-ins33]
vol33
vol33loop
KP_VOLV $0F,$00
KP_VOLJ [vol33loop-vol33]
ins34
ins34loop
KP_OSCV $00,0,0,0,$00
KP_OSCJ [ins34loop-ins34]
vol34
vol34loop
KP_VOLV $00,$00
KP_VOLJ [vol34loop-vol34]
kp_sequence
dc.b $00,$01,$00,$00
dc.b $00,$02,$00,$00
dc.b $00,$03,$00,$00
dc.b $00,$04,$00,$00
dc.b $00,$05,$06,$00
dc.b $00,$07,$08,$00
dc.b $00,$09,$0A,$00
dc.b $00,$0B,$0C,$00
dc.b $00,$0D,$0E,$00
dc.b $00,$0F,$0E,$00
dc.b $00,$10,$0E,$00
dc.b $00,$0F,$0E,$00
dc.b $00,$11,$0E,$00
dc.b $00,$0F,$0E,$00
dc.b $00,$12,$0E,$00
dc.b $00,$0F,$0E,$00
dc.b $00,$13,$0E,$00
dc.b $00,$0F,$0E,$00
dc.b $00,$14,$15,$00
dc.b $00,$0F,$16,$00
dc.b $00,$17,$18,$00
dc.b $00,$19,$1A,$00
dc.b $00,$1B,$1C,$00
dc.b $00,$1D,$1E,$00
dc.b $00,$1F,$20,$00
dc.b $00,$21,$22,$00
dc.b $00,$23,$24,$00
dc.b $00,$25,$26,$00
dc.b $00,$1F,$20,$00
dc.b $00,$21,$22,$00
dc.b $00,$27,$28,$00
dc.b $00,$29,$2A,$00
dc.b $00,$2B,$2C,$00
dc.b $00,$2D,$2E,$00
dc.b $00,$2F,$30,$00
dc.b $00,$31,$32,$00
dc.b $00,$2B,$2C,$00
dc.b $00,$2D,$2E,$00
dc.b $00,$33,$34,$00
dc.b $00,$35,$36,$00
dc.b $00,$2B,$2C,$00
dc.b $00,$2D,$2E,$00
dc.b $00,$2F,$30,$00
dc.b $00,$31,$32,$00
dc.b $00,$2B,$2C,$00
dc.b $00,$2D,$2E,$00
dc.b $00,$33,$34,$00
dc.b $00,$37,$36,$00
dc.b $00,$38,$39,$00
dc.b $00,$3A,$3B,$00
dc.b $00,$3C,$3D,$00
dc.b $00,$0F,$3E,$00
dc.b $00,$3F,$40,$00
dc.b $00,$41,$42,$00
dc.b $00,$0F,$0F,$00
dc.b $00,$43,$43,$00
dc.b $ff
dc.w $0004
|
oeis/216/A216244.asm | neoneye/loda-programs | 11 | 240278 | <reponame>neoneye/loda-programs
; A216244: a(n) = (prime(n)^2 - 1)/2 for n >= 2.
; Submitted by <NAME>
; 4,12,24,60,84,144,180,264,420,480,684,840,924,1104,1404,1740,1860,2244,2520,2664,3120,3444,3960,4704,5100,5304,5724,5940,6384,8064,8580,9384,9660,11100,11400,12324,13284,13944,14964,16020,16380,18240,18624,19404,19800,22260,24864,25764,26220,27144,28560,29040,31500,33024,34584,36180,36720,38364,39480,40044,42924,47124,48360,48984,50244,54780,56784,60204,60900,62304,64440,67344,69564,71820,73344,75660,78804,80400,83640,87780,88620,92880,93744,96360,98124,100800,104424,106260,107184,109044,114720
seq $0,65091 ; Odd primes.
pow $0,2
div $0,2
|
theorems/cw/cohomology/GridLongExactSequence.agda | mikeshulman/HoTT-Agda | 0 | 14669 | <gh_stars>0
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import cohomology.Theory
open import groups.ExactSequence
open import groups.HomSequence
module cw.cohomology.GridLongExactSequence {i} (CT : CohomologyTheory i)
{X Y Z : Ptd i} (n : ℤ) (f : X ⊙→ Y) (g : Y ⊙→ Z) where
open CohomologyTheory CT
open import cohomology.PtdMapSequence CT
open import cw.cohomology.CofiberGrid (fst f) (fst g)
open import cw.cohomology.GridPtdMap f g
{-
X --> Y ----> Z
| |
v v
Y/X --> Z/X
| this |
v one v
1 ---> Z/Y
-}
private
⊙D-span : ⊙Span
⊙D-span = ⊙span Y/X Z Y (⊙cfcod' f) g
⊙D : Ptd i
⊙D = ⊙Pushout ⊙D-span
Y/X-to-D : Y/X ⊙→ ⊙D
Y/X-to-D = B/A-to-D , idp
open import cohomology.LongExactSequence CT n Y/X-to-D
⊙E : Ptd i
⊙E = ⊙Cofiber (⊙left ⊙D-span)
Z/Y-to-E : Z/Y ⊙→ ⊙E
Z/Y-to-E = C/B-to-E , idp
Z/X-to-D : Z/X ⊙→ ⊙D
Z/X-to-D = C/A-to-D , idp
grid-co∂ : C n Y/X →ᴳ C (succ n) Z/Y
grid-co∂ = record {f = CEl-fmap (succ n) Z/Y-to-E ∘ GroupHom.f co∂ ; pres-comp = lemma} where
abstract lemma = ∘-pres-comp (C-fmap (succ n) Z/Y-to-E) co∂
C-grid-cofiber-seq : HomSequence (C n Z/X) (C (succ n) Y/X)
C-grid-cofiber-seq =
C n Z/X →⟨ C-fmap n Y/X-to-Z/X ⟩ᴳ
C n Y/X →⟨ grid-co∂ ⟩ᴳ
C (succ n) Z/Y →⟨ C-fmap (succ n) Z/X-to-Z/Y ⟩ᴳ
C (succ n) Z/X →⟨ C-fmap (succ n) Y/X-to-Z/X ⟩ᴳ
C (succ n) Y/X ⊣|ᴳ
private
C-cofiber-seq-to-C-grid-cofiber-seq :
HomSeqMap C-cofiber-seq C-grid-cofiber-seq
(C-fmap n Z/X-to-D) (idhom _)
C-cofiber-seq-to-C-grid-cofiber-seq =
C-fmap n Z/X-to-D ↓⟨ comm-sqrᴳ (λ d → ! (C-fmap-idf n _)
∙ (C-comm-square n B/A-to-C/A-comm-square □$ᴳ d)) ⟩ᴳ
idhom _ ↓⟨ comm-sqrᴳ (λ _ → idp) ⟩ᴳ
C-fmap (succ n) Z/Y-to-E ↓⟨ C-comm-square (succ n) C/A-to-C/B-comm-square ⟩ᴳ
C-fmap (succ n) Z/X-to-D ↓⟨ comm-sqrᴳ (λ d → ! (C-fmap-idf (succ n) _)
∙ (C-comm-square (succ n) B/A-to-C/A-comm-square □$ᴳ d)) ⟩ᴳ
idhom _ ↓|ᴳ
C-cofiber-seq-equiv-C-grid-cofiber-seq :
HomSeqEquiv C-cofiber-seq C-grid-cofiber-seq
(C-fmap n Z/X-to-D) (idhom _)
C-cofiber-seq-equiv-C-grid-cofiber-seq =
C-cofiber-seq-to-C-grid-cofiber-seq ,
CEl-isemap n Z/X-to-D C/A-to-D-is-equiv ,
idf-is-equiv _ ,
CEl-isemap (succ n) Z/Y-to-E C/B-to-E-is-equiv ,
CEl-isemap (succ n) Z/X-to-D C/A-to-D-is-equiv ,
idf-is-equiv _
abstract
C-grid-cofiber-seq-is-exact : is-exact-seq C-grid-cofiber-seq
C-grid-cofiber-seq-is-exact = seq-equiv-preserves-exact
C-cofiber-seq-equiv-C-grid-cofiber-seq C-cofiber-seq-is-exact
C-grid-cofiber-exact-seq : ExactSequence (C n Z/X) (C (succ n) Y/X)
C-grid-cofiber-exact-seq = C-grid-cofiber-seq , C-grid-cofiber-seq-is-exact
|
Aurora/Aurora/x64/Debug/svga_screen_util.asm | manaskamal/aurora-xeneva | 8 | 179403 | ; Listing generated by Microsoft (R) Optimizing Compiler Version 17.00.50727.1
include listing.inc
INCLUDELIB LIBCMT
INCLUDELIB OLDNAMES
PUBLIC ?g_screen@@3U_screen_console_@@A ; g_screen
_BSS SEGMENT
?g_screen@@3U_screen_console_@@A DB 048H DUP (?) ; g_screen
_BSS ENDS
CONST SEGMENT
$SG5619 DB 'GMR Pages -> %x', 0aH, 00H
ORG $+7
$SG5622 DB 'Tile buffer -> %x', 0aH, 00H
ORG $+5
$SG5655 DB 'Drawing rect', 0aH, 00H
CONST ENDS
PUBLIC ?svga_screen_console_init@@YAXI@Z ; svga_screen_console_init
PUBLIC ?svga_screen_console_set@@YAXIHH@Z ; svga_screen_console_set
PUBLIC ?svga_screen_console_rect@@YAXHHHHI@Z ; svga_screen_console_rect
PUBLIC ?svga_draw_tile_rect@@YAXHHHH@Z ; svga_draw_tile_rect
EXTRN ?svga_sync_to_fence@@YAXI@Z:PROC ; svga_sync_to_fence
EXTRN ?svga_insert_fence@@YAIXZ:PROC ; svga_insert_fence
EXTRN ?memset@@YAXPEAXEI@Z:PROC ; memset
EXTRN ?printf@@YAXPEBDZZ:PROC ; printf
EXTRN ?gmr_define_contiguous@@YAIII@Z:PROC ; gmr_define_contiguous
EXTRN ?svga_screen_define_gmrfb@@YAXUSVGAGuestPtr@@IUSVGAGMRImageFormat@@@Z:PROC ; svga_screen_define_gmrfb
EXTRN ?svga_screen_blit_from_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z:PROC ; svga_screen_blit_from_gmrfb
EXTRN ?svga_screen_annotate_fill@@YAXUSVGAColorBGRX@@@Z:PROC ; svga_screen_annotate_fill
pdata SEGMENT
$pdata$?svga_screen_console_init@@YAXI@Z DD imagerel $LN3
DD imagerel $LN3+113
DD imagerel $unwind$?svga_screen_console_init@@YAXI@Z
$pdata$?svga_screen_console_rect@@YAXHHHHI@Z DD imagerel $LN5
DD imagerel $LN5+137
DD imagerel $unwind$?svga_screen_console_rect@@YAXHHHHI@Z
$pdata$?svga_draw_tile_rect@@YAXHHHH@Z DD imagerel $LN14
DD imagerel $LN14+271
DD imagerel $unwind$?svga_draw_tile_rect@@YAXHHHH@Z
pdata ENDS
; COMDAT ?src_origin@?1??svga_draw_tile_rect@@YAXHHHH@Z@4USVGASignedPoint@@B
CONST SEGMENT
?src_origin@?1??svga_draw_tile_rect@@YAXHHHH@Z@4USVGASignedPoint@@B DD 00H ; `svga_draw_tile_rect'::`2'::src_origin
DD 00H
CONST ENDS
; COMDAT ?format@?1??svga_draw_tile_rect@@YAXHHHH@Z@4USVGAGMRImageFormat@@B
CONST SEGMENT
?format@?1??svga_draw_tile_rect@@YAXHHHH@Z@4USVGAGMRImageFormat@@B DD 01820H ; `svga_draw_tile_rect'::`2'::format
CONST ENDS
xdata SEGMENT
$unwind$?svga_screen_console_init@@YAXI@Z DD 010801H
DD 06208H
$unwind$?svga_screen_console_rect@@YAXHHHHI@Z DD 011601H
DD 04216H
$unwind$?svga_draw_tile_rect@@YAXHHHH@Z DD 011601H
DD 08216H
xdata ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen_util.cpp
_TEXT SEGMENT
tv72 = 32
tv78 = 36
color$1 = 40
dest_rect$ = 48
left$ = 80
top$ = 88
right$ = 96
bottom$ = 104
?svga_draw_tile_rect@@YAXHHHH@Z PROC ; svga_draw_tile_rect
; 38 : void svga_draw_tile_rect (int left, int top, int right, int bottom) {
$LN14:
mov DWORD PTR [rsp+32], r9d
mov DWORD PTR [rsp+24], r8d
mov DWORD PTR [rsp+16], edx
mov DWORD PTR [rsp+8], ecx
sub rsp, 72 ; 00000048H
; 39 :
; 40 : static const SVGAGMRImageFormat format = {{{32, 24}}};
; 41 : svga_screen_define_gmrfb(g_screen.tile_ptr, TILE_SIZE * sizeof(uint32_t), format);
mov r8d, DWORD PTR ?format@?1??svga_draw_tile_rect@@YAXHHHH@Z@4USVGAGMRImageFormat@@B
mov edx, 256 ; 00000100H
mov rcx, QWORD PTR ?g_screen@@3U_screen_console_@@A+20
call ?svga_screen_define_gmrfb@@YAXUSVGAGuestPtr@@IUSVGAGMRImageFormat@@@Z ; svga_screen_define_gmrfb
; 42 :
; 43 : static const SVGASignedPoint src_origin = {0, 0};
; 44 : SVGASignedRect dest_rect;
; 45 :
; 46 : for (dest_rect.top = top; dest_rect.top < bottom; dest_rect.top += TILE_SIZE) {
mov eax, DWORD PTR top$[rsp]
mov DWORD PTR dest_rect$[rsp+4], eax
jmp SHORT $LN7@svga_draw_
$LN6@svga_draw_:
mov eax, DWORD PTR dest_rect$[rsp+4]
add eax, 64 ; 00000040H
mov DWORD PTR dest_rect$[rsp+4], eax
$LN7@svga_draw_:
mov eax, DWORD PTR bottom$[rsp]
cmp DWORD PTR dest_rect$[rsp+4], eax
jge $LN5@svga_draw_
; 47 : dest_rect.bottom = MIN (bottom, dest_rect.top + TILE_SIZE);
mov eax, DWORD PTR dest_rect$[rsp+4]
add eax, 64 ; 00000040H
cmp DWORD PTR bottom$[rsp], eax
jge SHORT $LN10@svga_draw_
mov eax, DWORD PTR bottom$[rsp]
mov DWORD PTR tv72[rsp], eax
jmp SHORT $LN11@svga_draw_
$LN10@svga_draw_:
mov eax, DWORD PTR dest_rect$[rsp+4]
add eax, 64 ; 00000040H
mov DWORD PTR tv72[rsp], eax
$LN11@svga_draw_:
mov eax, DWORD PTR tv72[rsp]
mov DWORD PTR dest_rect$[rsp+12], eax
; 48 :
; 49 : for (dest_rect.left = left; dest_rect.left < right; dest_rect.left += TILE_SIZE) {
mov eax, DWORD PTR left$[rsp]
mov DWORD PTR dest_rect$[rsp], eax
jmp SHORT $LN4@svga_draw_
$LN3@svga_draw_:
mov eax, DWORD PTR dest_rect$[rsp]
add eax, 64 ; 00000040H
mov DWORD PTR dest_rect$[rsp], eax
$LN4@svga_draw_:
mov eax, DWORD PTR right$[rsp]
cmp DWORD PTR dest_rect$[rsp], eax
jge SHORT $LN2@svga_draw_
; 50 : dest_rect.right = MIN (right, dest_rect.left + TILE_SIZE);
mov eax, DWORD PTR dest_rect$[rsp]
add eax, 64 ; 00000040H
cmp DWORD PTR right$[rsp], eax
jge SHORT $LN12@svga_draw_
mov eax, DWORD PTR right$[rsp]
mov DWORD PTR tv78[rsp], eax
jmp SHORT $LN13@svga_draw_
$LN12@svga_draw_:
mov eax, DWORD PTR dest_rect$[rsp]
add eax, 64 ; 00000040H
mov DWORD PTR tv78[rsp], eax
$LN13@svga_draw_:
mov eax, DWORD PTR tv78[rsp]
mov DWORD PTR dest_rect$[rsp+8], eax
; 51 :
; 52 : if (g_screen.tile_usage.type == TILE_FILL) {
cmp DWORD PTR ?g_screen@@3U_screen_console_@@A+60, 1
jne SHORT $LN1@svga_draw_
; 53 : SVGAColorBGRX color;
; 54 : color.value = g_screen.tile_usage.color;
mov eax, DWORD PTR ?g_screen@@3U_screen_console_@@A+64
mov DWORD PTR color$1[rsp], eax
; 55 : svga_screen_annotate_fill (color);
mov ecx, DWORD PTR color$1[rsp]
call ?svga_screen_annotate_fill@@YAXUSVGAColorBGRX@@@Z ; svga_screen_annotate_fill
$LN1@svga_draw_:
; 56 : }
; 57 :
; 58 : svga_screen_blit_from_gmrfb (&src_origin, &dest_rect, g_screen.screen_id);
mov r8d, DWORD PTR ?g_screen@@3U_screen_console_@@A+8
lea rdx, QWORD PTR dest_rect$[rsp]
lea rcx, OFFSET FLAT:?src_origin@?1??svga_draw_tile_rect@@YAXHHHH@Z@4USVGASignedPoint@@B
call ?svga_screen_blit_from_gmrfb@@YAXPEBUSVGASignedPoint@@PEBUSVGASignedRect@@I@Z ; svga_screen_blit_from_gmrfb
; 59 : }
jmp SHORT $LN3@svga_draw_
$LN2@svga_draw_:
; 60 : }
jmp $LN6@svga_draw_
$LN5@svga_draw_:
; 61 :
; 62 : g_screen.tile_fence = svga_insert_fence();
call ?svga_insert_fence@@YAIXZ ; svga_insert_fence
mov DWORD PTR ?g_screen@@3U_screen_console_@@A+56, eax
; 63 : }
add rsp, 72 ; 00000048H
ret 0
?svga_draw_tile_rect@@YAXHHHH@Z ENDP ; svga_draw_tile_rect
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen_util.cpp
_TEXT SEGMENT
left$ = 48
top$ = 56
right$ = 64
bottom$ = 72
color$ = 80
?svga_screen_console_rect@@YAXHHHHI@Z PROC ; svga_screen_console_rect
; 67 : int right, int bottom, uint32_t color) {
$LN5:
mov DWORD PTR [rsp+32], r9d
mov DWORD PTR [rsp+24], r8d
mov DWORD PTR [rsp+16], edx
mov DWORD PTR [rsp+8], ecx
sub rsp, 40 ; 00000028H
; 68 :
; 69 : printf ("Drawing rect\n");
lea rcx, OFFSET FLAT:$SG5655
call ?printf@@YAXPEBDZZ ; printf
; 70 : if (g_screen.tile_usage.type != TILE_FILL || g_screen.tile_usage.color != color) {
cmp DWORD PTR ?g_screen@@3U_screen_console_@@A+60, 1
jne SHORT $LN1@svga_scree
mov eax, DWORD PTR color$[rsp]
cmp DWORD PTR ?g_screen@@3U_screen_console_@@A+64, eax
je SHORT $LN2@svga_scree
$LN1@svga_scree:
; 71 : svga_sync_to_fence (g_screen.tile_fence);
mov ecx, DWORD PTR ?g_screen@@3U_screen_console_@@A+56
call ?svga_sync_to_fence@@YAXI@Z ; svga_sync_to_fence
; 72 : g_screen.tile_usage.type = TILE_FILL;
mov DWORD PTR ?g_screen@@3U_screen_console_@@A+60, 1
; 73 : g_screen.tile_usage.color = color;
mov eax, DWORD PTR color$[rsp]
mov DWORD PTR ?g_screen@@3U_screen_console_@@A+64, eax
; 74 : memset (g_screen.tile_buffer, color, TILE_BUFFER_PIXELS);
mov r8d, 4096 ; 00001000H
movzx edx, BYTE PTR color$[rsp]
mov rcx, QWORD PTR ?g_screen@@3U_screen_console_@@A+32
call ?memset@@YAXPEAXEI@Z ; memset
$LN2@svga_scree:
; 75 : }
; 76 :
; 77 : svga_draw_tile_rect (left, top, right, bottom);
mov r9d, DWORD PTR bottom$[rsp]
mov r8d, DWORD PTR right$[rsp]
mov edx, DWORD PTR top$[rsp]
mov ecx, DWORD PTR left$[rsp]
call ?svga_draw_tile_rect@@YAXHHHH@Z ; svga_draw_tile_rect
; 78 : }
add rsp, 40 ; 00000028H
ret 0
?svga_screen_console_rect@@YAXHHHHI@Z ENDP ; svga_screen_console_rect
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen_util.cpp
_TEXT SEGMENT
screen_id$ = 8
width$ = 16
height$ = 24
?svga_screen_console_set@@YAXIHH@Z PROC ; svga_screen_console_set
; 31 : void svga_screen_console_set (uint32_t screen_id, int width, int height) {
mov DWORD PTR [rsp+24], r8d
mov DWORD PTR [rsp+16], edx
mov DWORD PTR [rsp+8], ecx
; 32 : g_screen.screen_id = screen_id;
mov eax, DWORD PTR screen_id$[rsp]
mov DWORD PTR ?g_screen@@3U_screen_console_@@A+8, eax
; 33 : g_screen.screen_width = width;
mov eax, DWORD PTR width$[rsp]
mov DWORD PTR ?g_screen@@3U_screen_console_@@A+12, eax
; 34 : g_screen.screen_height = height;
mov eax, DWORD PTR height$[rsp]
mov DWORD PTR ?g_screen@@3U_screen_console_@@A+16, eax
; 35 : }
ret 0
?svga_screen_console_set@@YAXIHH@Z ENDP ; svga_screen_console_set
_TEXT ENDS
; Function compile flags: /Odtpy
; File e:\xeneva project\xeneva\aurora\aurora\drivers\svga\svga_screen_util.cpp
_TEXT SEGMENT
gmr_pages$ = 32
gmr_size$ = 36
gmr_id$ = 64
?svga_screen_console_init@@YAXI@Z PROC ; svga_screen_console_init
; 20 : void svga_screen_console_init (uint32_t gmr_id) {
$LN3:
mov DWORD PTR [rsp+8], ecx
sub rsp, 56 ; 00000038H
; 21 :
; 22 : const uint32_t gmr_size = TILE_BUFFER_BYTES + MAX_FONT_SIZE;
mov DWORD PTR gmr_size$[rsp], 216384 ; 00034d40H
; 23 : ppn gmr_pages = gmr_define_contiguous (gmr_id, (gmr_size + PAGE_MASK) / PAGE_SIZE);
mov edx, 53 ; 00000035H
mov ecx, DWORD PTR gmr_id$[rsp]
call ?gmr_define_contiguous@@YAIII@Z ; gmr_define_contiguous
mov DWORD PTR gmr_pages$[rsp], eax
; 24 : printf ("GMR Pages -> %x\n", gmr_pages);
mov edx, DWORD PTR gmr_pages$[rsp]
lea rcx, OFFSET FLAT:$SG5619
call ?printf@@YAXPEBDZZ ; printf
; 25 : g_screen.tile_ptr.gmrId = gmr_id;
mov eax, DWORD PTR gmr_id$[rsp]
mov DWORD PTR ?g_screen@@3U_screen_console_@@A+20, eax
; 26 : g_screen.tile_ptr.offset = 0;
mov DWORD PTR ?g_screen@@3U_screen_console_@@A+24, 0
; 27 : g_screen.tile_buffer = (uint32_t*)PPN_POINTER(gmr_pages);
mov eax, DWORD PTR gmr_pages$[rsp]
imul eax, 4096 ; 00001000H
mov eax, eax
mov QWORD PTR ?g_screen@@3U_screen_console_@@A+32, rax
; 28 : printf ("Tile buffer -> %x\n", g_screen.tile_buffer);
mov rdx, QWORD PTR ?g_screen@@3U_screen_console_@@A+32
lea rcx, OFFSET FLAT:$SG5622
call ?printf@@YAXPEBDZZ ; printf
; 29 : }
add rsp, 56 ; 00000038H
ret 0
?svga_screen_console_init@@YAXI@Z ENDP ; svga_screen_console_init
_TEXT ENDS
END
|
env/zx/common/serialLnBC.asm | pjshumphreys/querycsv | 18 | 88084 | <reponame>pjshumphreys/querycsv
serialLnBC:
push af
push hl
push bc
push de
ld hl, bc
jr serialLn2
serialLnHL:
push af
push hl
push bc
push de
serialLn2:
ld de, numstr
; Get the number in hl as text in de
ld bc, -10000
call one
ld bc, -1000
call one
ld bc, -100
call one
ld bc, -10
call one
ld c, -1
call one
ld de, numstr
jp loop5
serialLn:
push af
push hl
push bc
push de
loop5:
di
push ix
push de
pop ix
ld bc, 0
loop6:
ld a, (de)
or a
jr z, exit5
inc bc
inc de
jr loop6
exit5:
push bc
pop de
ld a, 255
scf
call call_rom3
defw 0x04c6
pop ix
ei
pop de
pop bc
pop hl
pop af
ret
one:
ld a, $2f
two:
inc a
add hl, bc
jr c, two
sbc hl, bc
ld (de), a
inc de
ret
numstr:
defb $30, $30, $30, $30, $30, $0a, $00
|
oeis/172/A172060.asm | neoneye/loda-programs | 11 | 240346 | ; A172060: The number of returns to the origin in all possible one-dimensional walks of length 2n.
; Submitted by <NAME>
; 0,2,14,76,374,1748,7916,35096,153254,661636,2831300,12030632,50826684,213707336,894945944,3734901296,15540685574,64496348516,267060529364,1103587381256,4552196053844,18747042089816,77092267322984,316602500019536,1298657603761244
mov $2,1
lpb $0
mul $2,2
mov $3,$0
sub $0,1
add $3,$0
bin $3,$0
mul $3,$2
add $1,$3
mul $2,2
lpe
mov $0,$1
|
oeis/107/A107458.asm | neoneye/loda-programs | 11 | 168897 | <reponame>neoneye/loda-programs
; A107458: Expansion of g.f.: (1-x^2-x^3)/( (1+x)*(1-x-x^3) ).
; 1,0,0,0,1,0,1,1,2,2,4,5,8,11,17,24,36,52,77,112,165,241,354,518,760,1113,1632,2391,3505,5136,7528,11032,16169,23696,34729,50897,74594,109322,160220,234813,344136,504355,739169,1083304,1587660,2326828,3410133,4997792,7324621,10734753,15732546,23057166,33791920,49524465,72581632,106373551,155898017,228479648,334853200,490751216,719230865,1054084064,1544835281,2264066145,3318150210,4862985490,7127051636,10445201845,15308187336,22435238971,32880440817,48188628152,70623867124,103504307940
mov $3,2
mov $4,$0
lpb $3
mov $0,$4
sub $3,1
add $0,$3
trn $0,1
seq $0,306276 ; a(0) = a(1) = a(2) = a(3) = 1; thereafter a(n) = a(n-2) + a(n-3) + a(n-4).
mov $5,$0
add $5,$0
mov $0,$5
add $0,2
mov $2,$3
mul $2,$0
add $1,$2
lpe
min $4,1
mul $4,$5
sub $1,$4
div $1,4
mov $0,$1
|
Library/Impex/Main/mainC.asm | steakknife/pcgeos | 504 | 3492 | <reponame>steakknife/pcgeos
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1992 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Impex
FILE: mainC.asm
AUTHOR: <NAME>, Jul 30, 1992
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
MS 7/30/92 Initial revision
DESCRIPTION:
Contains C stubs for Impex routines
$Id: mainC.asm,v 1.1 97/04/04 23:49:54 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetGeosConvention
ImpexCode segment resource
COMMENT @--------------------------------------------------------------------
C FUNCTION: ImpexCreateTempFile
C DECLARATION: extern TransErrorInfo
ImpexCreateTempFile(char *buffer, word fileType,
FileHandle *file)
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
maryann 7/30 Initial version
jenny 10/30/92 Changed to return TransErrorInfo type
-----------------------------------------------------------------------------@
IMPEXCREATETEMPFILE proc far buffer:fptr, fileType:word, file:fptr
uses di, bp, es
.enter
les di, buffer ; ES:DI <- filename buffer
mov ax, fileType ; AX <- IMPEX_TEMP_VM_FILE or
; IMPEX_TEMP_NATIVE_FILE
push bp ; save to access local variables
call ImpexCreateTempFile ; returns AX = TransError
mov cx, bp ; CX <- file handle
pop bp ; restore to access locals
les di, file
mov es:[di], cx ; return file handle
mov dx, bx ; DX <- handle of error
; message, if any
.leave
ret
IMPEXCREATETEMPFILE endp
COMMENT @--------------------------------------------------------------------
C FUNCTION: ImpexDeleteTempFile
C DECLARATION: extern TransErrorInfo
ImpexDeleteTempFile(char *buffer, FileHandle metafile,
word fileType)
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
maryann 7/30 Initial version
jenny 10/30/92 Changed to return TransErrorInfo type
-----------------------------------------------------------------------------@
IMPEXDELETETEMPFILE proc far buffer:fptr, metafile:hptr,
fileType:word
uses di, ds
.enter
lds dx, buffer ; DS:DX <- filename buffer
mov bx, metafile ; BX <- handle of file to delete
mov ax, fileType ; AX <- IMPEX_TEMP_VM( or NATIVE )_FILE
call ImpexDeleteTempFile ; return AX <- TransError
mov dx, bx ; DX <- handle of error
; message, if any
.leave
ret
IMPEXDELETETEMPFILE endp
COMMENT @--------------------------------------------------------------------
C FUNCTION: ImpexImportFromMetafile
C DECLARATION: extern TransErrorInfo
ImpexImportFromMetafile(Handle xlatLib,word routine,
VMFileHandle xferFile, FileHandle metafile,
dword *xferFormat, word arg1, word arg2)
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
maryann 7/30 Initial version
jenny 10/30/92 Changed to return TransErrorInfo type
-----------------------------------------------------------------------------@
IMPEXIMPORTFROMMETAFILE proc far xlatLib:hptr, routine:word,
xferFile:hptr, metafile:hptr,
xferFormat:fptr, arg1:word, arg2:word
uses si, di, bp, ds
.enter
push bp ; save to access locals
mov ax, routine ; AX <- entry point number of routine
mov di, xferFile ; DI <- VMFile to hold xfer Format
mov bx, metafile ; BX <- handle of metafile
mov ds, arg1 ; extra args??
mov si, arg2
mov bp, xlatLib ; BP <- handle xlatLib
call ImpexImportFromMetafile ; returns AX <- TransError
; DX:CX <- transfer format
pop bp ; restore BP to access locals
lds si, xferFormat
movdw ds:[si], dxcx ; return transfer format
mov dx, bx ; DX <- handle of error
; message, if any
.leave
ret
IMPEXIMPORTFROMMETAFILE endp
COMMENT @--------------------------------------------------------------------
C FUNCTION: ImpexExportToMetafile
C DECLARATION: extern TransErrorInfo
ImpexExportToMetafile(Handle xlatLib,word routine,
VMFileHandle xferFile, FileHandle metafile,
dword xferFormat, word arg1, word arg2)
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
maryann 7/30 Initial version
jenny 10/30/92 Changed to return TransErrorInfo type
-----------------------------------------------------------------------------@
IMPEXEXPORTTOMETAFILE proc far xlatLib:hptr, routine:word,
xferFile:hptr, metafile:hptr,xferFormat:dword,
arg1:word, arg2:word
uses si, di, bp, ds
.enter
push bp ; save BP to access locals
mov bx, xlatLib ; BX <- handle xlatLib
mov ax, routine ; AX <- entry point number if routine
movdw dxcx, xferFormat ; DXCX <- VMFile for transfer Format
mov di, xferFile ; DI <- handle of transferFile
mov ds, arg1 ; extra args??
mov si, arg2
mov bp, metafile ; BP <- metafile Handle
call ImpexExportToMetafile ; returns AX <- TransError
pop bp ; restore BP to access locals
mov dx, bx ; DX <- handle of error
; message, if any
.leave
ret
IMPEXEXPORTTOMETAFILE endp
COMMENT @--------------------------------------------------------------------
C FUNCTION: ImpexUpdateImportExportStatus
C DECLARATION: extern Boolean
ImpexUpdateImportExportStatus(fptr *message,
word *percent)
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
maryann 7/30 Initial version
jenny 10/30/92 Changed to return TransErrorInfo type
-----------------------------------------------------------------------------@
IMPEXUPDATEIMPORTEXPORTSTATUS proc far message:fptr, percent:word
uses ds
.enter
movdw dxsi, message
mov ds, dx ; message => DS:SI
mov ax, percent
call ImpexUpdateImportExportStatus
.leave
ret
IMPEXUPDATEIMPORTEXPORTSTATUS endp
ImpexCode ends
SetDefaultConvention
|
basic_associations/one_to_one.als | nowavailable/alloy_als_study | 0 | 2564 | <gh_stars>0
module one_to_one
sig Dad {
son: lone Son
}
sig Son {
dad: one Dad
}
fact RelDadSon {
// 相互的な参照には必須
// 「"父を持つ子"の、親子関係を反転させると、それは"子を持つ父"に等しい」
Dad <: son = ~(Son <: dad)
}
run {} //for 5
|
Arquitetura de Computadores/Atividade 02/ex03.asm | antuniooh/ExercisesFEI | 1 | 244156 | <reponame>antuniooh/ExercisesFEI<filename>Arquitetura de Computadores/Atividade 02/ex03.asm
MOV A, R
MOV B, R0
DIV AB
MOV R5, A
MOV R4, B
|
AdaToolsTests/krunchpa.ads | gitter-badger/Ada-tools | 0 | 27442 | package KrunchPackage is
--@description Tests the krunch behavior
end KrunchPackage; |
oeis/144/A144601.asm | neoneye/loda-programs | 11 | 96316 | <filename>oeis/144/A144601.asm
; A144601: Christoffel word of slope 3/11.
; Submitted by <NAME>(s3)
; 0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0
mul $0,2
mov $1,3
mul $1,$0
div $1,7
bin $1,3
mov $0,$1
mod $0,2
|
ram.asm | jorgicor/altair | 0 | 161629 | ; ----------------------------------------------------------------------------
; Altair, CIDLESA's 1981 arcade game remade for the ZX Spectrum and
; Amstrad CPC.
; ----------------------------------------------------------------------------
; ----------------------------------------------------------------------------
; RAM Area, not saved on tape, so we save space there.
; ----------------------------------------------------------------------------
LIB_RAM_START .equ endp
#ifdef ZX
#include "r_lib_zx.asm"
#endif
#ifdef CPC
#include "r_lib_cpc.asm"
#endif
; Sprite and object tables.
sprtab .equ LIB_RAM_END
SPRTABSZ .equ NSPRS*SPRSZ
objtab .equ sprtab+SPRTABSZ
OBJTABSZ .equ NOBJS*OBJSZ
; End of RAM used by game.
eofram .equ objtab+OBJTABSZ
; Direct addresses to some objects.
ship_ob .equ objtab+(OBJSZ*SHIP_OB_SLOT)
house_ob .equ objtab+(OBJSZ*HOUSE_OB_SLOT)
alien_ob .equ objtab+(OBJSZ*ALIEN_OB_SLOT)
post_ob .equ objtab+(OBJSZ*POST_OB_SLOT)
bird_ob .equ objtab+(OBJSZ*BIRD_OB_SLOT)
; Direct addresses to some sprites.
house_sp_0 .equ sprtab+(SPRSZ*HOUSE_SP_SLOT)
house_sp_1 .equ house_sp_0+SPRSZ
bird_sp .equ sprtab+(SPRSZ*BIRD_SP_SLOT)
bird_lshield_sp .equ sprtab+(SPRSZ*BIRD_LSHIELD_SP_SLOT)
bird_rshield_sp .equ sprtab+(SPRSZ*BIRD_RSHIELD_SP_SLOT)
ship_sp .equ sprtab+(SPRSZ*SHIP_SP_SLOT)
cnon_sp .equ sprtab+(SPRSZ*(SHIP_SP_SLOT+1))
lwng_sp .equ sprtab+(SPRSZ*(SHIP_SP_SLOT+2))
rwng_sp .equ sprtab+(SPRSZ*(SHIP_SP_SLOT+3))
fire_sp .equ sprtab+(SPRSZ*(SHIP_SP_SLOT+4))
mine_sp .equ sprtab+(SPRSZ*MINE_SP_SLOT)
|
programs/oeis/266/A266977.asm | karttu/loda | 1 | 177491 | <reponame>karttu/loda<filename>programs/oeis/266/A266977.asm
; A266977: Number of ON (black) cells in the n-th iteration of the "Rule 78" elementary cellular automaton starting with a single ON (black) cell.
; 1,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57,58,58,59,59,60,60,61,61,62,62,63,63,64,64,65,65,66,66,67,67,68,68,69,69,70,70,71,71,72,72,73,73,74,74,75,75,76,76,77,77,78,78,79,79,80,80,81,81,82,82,83,83,84,84,85,85,86,86,87,87,88,88,89,89,90,90,91,91,92,92,93,93,94,94,95,95,96,96,97,97,98,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105,106,106,107,107,108,108,109,109,110,110,111,111,112,112,113,113,114,114,115,115,116,116,117,117,118,118,119,119,120,120,121,121,122,122,123,123,124,124,125,125,126,126
pow $2,$0
div $0,2
pow $1,$2
add $1,$0
add $1,1
|
test/p42.asm | slcz/hummingbird | 0 | 98079 | <filename>test/p42.asm
#include "hi.asm"
li(1)
st 0
jmp 1f
.=0x100
1:
li(0xc5)
st 0x10
li(0x5c)
xchg 0
ld(0x10)
hlt
|
src/main/antlr4/org/jabref/search/Search.g4 | BortoBoy/jabref2 | 0 | 5688 | /**
* This is the antlr v4 grammar for defining search expressions.
*
* These search expressions are used for searching the bibtex library. They are heavily used for search groups.
*/
grammar Search;
WS: [ \t] -> skip; // whitespace is ignored/skipped
LPAREN:'(';
RPAREN:')';
EQUAL:'='; // semantically the same as CONTAINS
EEQUAL:'=='; // semantically the same as MATCHES
NEQUAL:'!=';
AND:[aA][nN][dD]; // 'and' case insensitive
OR:[oO][rR]; // 'or' case insensitive
CONTAINS:[cC][oO][nN][tT][aA][iI][nN][sS]; // 'contains' case insensitive
MATCHES:[mM][aA][tT][cC][hH][eE][sS]; // 'matches' case insensitive
NOT:[nN][oO][tT]; // 'not' case insensitive
STRING:QUOTE (~'"')* QUOTE;
QUOTE:'"';
FIELDTYPE:LETTER+;
// fragments are not accessible from the code, they are only for describing the grammar better
fragment LETTER : ~[ \t"()=!];
start:
expression EOF;
// labels are used to refer to parts of the rules in the generated code later on
// label=actualThingy
expression:
LPAREN expression RPAREN #parenExpression // example: (author=miller)
| left=expression operator=(AND | OR) right=expression #binaryExpression // example: author = miller and title = test
| NOT expression #unaryExpression // example: not author = miller
| comparison #atomExpression
;
comparison:
left=name operator=(CONTAINS | MATCHES | EQUAL | EEQUAL | NEQUAL) right=name // example: author != miller
| right=name // example: miller (search all fields)
;
name:
STRING // example: "miller"
| FIELDTYPE // example: author
;
|
src/grammar/mips.g4 | PAN-Ziyue/MIPSino | 4 | 7171 | grammar mips;
prog: stat+;
stat:
inst NEWLINE
| inst
| label inst NEWLINE
| label inst
| label NEWLINE
| label
| NEWLINE
| COMMENT;
inst: r_type | i_type | j_type | pseudo | directive;
directive:
op = '.byte' data = unsigned_imm
| op = '.half' data = unsigned_imm
| op = '.word' data = unsigned_imm
| op = '.data'
| op = '.text';
pseudo:
op = 'move' rt = reg ',' rs = reg
| op = 'bgt' rs = reg ',' rt = reg ',' tag = IDEN
| op = 'blt' rs = reg ',' rt = reg ',' tag = IDEN
| op = 'bge' rs = reg ',' rt = reg ',' tag = IDEN
| op = 'ble' rs = reg ',' rt = reg ',' tag = IDEN;
r_type:
op = 'add' rd = reg ',' rs = reg ',' rt = reg
| op = 'addu' rd = reg ',' rs = reg ',' rt = reg
| op = 'and' rd = reg ',' rs = reg ',' rt = reg
| op = 'sub' rd = reg ',' rs = reg ',' rt = reg
| op = 'subu' rd = reg ',' rs = reg ',' rt = reg
| op = 'or' rd = reg ',' rs = reg ',' rt = reg
| op = 'nor' rd = reg ',' rs = reg ',' rt = reg
| op = 'xor' rd = reg ',' rs = reg ',' rt = reg
| op = 'slt' rd = reg ',' rs = reg ',' rt = reg
| op = 'sll' rd = reg ',' rt = reg ',' sa = unsigned_imm
| op = 'srl' rd = reg ',' rt = reg ',' sa = unsigned_imm
| op = 'sra' rd = reg ',' rt = reg ',' sa = unsigned_imm;
i_type:
op = 'addi' rt = reg ',' rs = reg ',' simm = signed_imm
| op = 'addiu' rt = reg ',' rs = reg ',' uimm = unsigned_imm
| op = 'andi' rt = reg ',' rs = reg ',' uimm = unsigned_imm
| op = 'slti' rt = reg ',' rs = reg ',' simm = signed_imm
| op = 'sltiu' rt = reg ',' rs = reg ',' uimm = unsigned_imm
| op = 'lui' rt = reg ',' uimm = unsigned_imm
| op = 'ori' rt = reg ',' rs = reg ',' uimm = unsigned_imm
| op = 'xori' rt = reg ',' rs = reg ',' uimm = unsigned_imm
| op = 'lw' rt = reg ',' offset = signed_imm '(' base = reg ')'
| op = 'lh' rt = reg ',' offset = signed_imm '(' base = reg ')'
| op = 'lb' rt = reg ',' offset = signed_imm '(' base = reg ')'
| op = 'sw' rt = reg ',' offset = signed_imm '(' base = reg ')'
| op = 'sh' rt = reg ',' offset = signed_imm '(' base = reg ')'
| op = 'sb' rt = reg ',' offset = signed_imm '(' base = reg ')'
| op = 'beq' rs = reg ',' rt = reg ',' tag = IDEN
| op = 'bne' rs = reg ',' rt = reg ',' tag = IDEN;
j_type:
op = 'jalr' rs = reg
| op = 'jr' rs = reg
| op = 'j' tag = IDEN
| op = 'jal' tag = IDEN;
COMMENT: '#' .*? NEWLINE -> skip;
NEWLINE: [\r\n]+;
label: IDEN ':';
IDEN: LETTER ( LETTER | DIGIT )* ;
DIGIT: [0-9];
LETTER: [a-zA-Z_];
WS: [ \t]+ -> skip;
NUM: '0' | [1-9][0-9]*;
HEX_NUM: '0' [xX][a-fA-F0-9]+;
ALPHA: [a-zA-Z]+;
unsigned_imm: NUM | HEX_NUM;
signed_imm: '-' unsigned_imm | unsigned_imm;
reg:
'$zero'
| '$at'
| '$v0'
| '$v1'
| '$a0'
| '$a1'
| '$a2'
| '$a3'
| '$t0'
| '$t1'
| '$t2'
| '$t3'
| '$t4'
| '$t5'
| '$t6'
| '$t7'
| '$s0'
| '$s1'
| '$s2'
| '$s3'
| '$s4'
| '$s5'
| '$s6'
| '$s7'
| '$t8'
| '$t9'
| '$gp'
| '$sp'
| '$fp'
| '$ra'
| '$0';
|
original/IntelliKeys/MacOSX/IKUSB_Build_Scripts/BuildRB.applescript | ATMakersBill/OpenIKeys | 11 | 2413 | do shell script "open /ClassroomSuite/IntelliKeys/MacOSX/ControlPanel/IntelliKeys\\ USB.rbp"
delay 30
tell application "System Events"
keystroke "b" using {command down}
#delay 3
#keystroke tab
#delay 3
#keystroke return
end tell
delay 15
tell application "Xojo" to quit
do shell script "cp -R " & quoted form of "/ClassroomSuite/IntelliKeys/MacOSX/ControlPanel/IntelliKeys USB.app" & space & quoted form of "/ClassroomSuite/IntelliKeys/MacOSX/Staging"
#do shell script "cp -R " & quoted form of "/ClassroomSuite/IntelliKeys/MacOSX/ControlPanel/Builds - #IntelliKeys USB.rbp/Mac OS X (Intel)/IntelliKeys USB.app" & space & quoted form of "/ClassroomSuite/IntelliKeys/MacOSX/Staging"
|
grammars/verilogPreprocParserPy.g4 | the-moog/hdlConvertor | 0 | 1864 | parser grammar verilogPreprocParserPy;
options { tokenVocab=verilogPreprocLexerPy;}
@parser::header {
from hdl_language_enum import HDLLanguageEnum
class hdlConvertor:
Language = HDLLanguageEnum()
}
file: text* EOF;
text:
preprocess_directive
| LINE_COMMENT
| CODE
| NEW_LINE
| NUM
| ID
| STR
| NEW_LINE
| COMMENT
;
preprocess_directive:
define
| conditional
| macro_call
| resetall
| undef
| include
| celldefine
| endcelldefine
| unconnected_drive
| nounconnected_drive
| default_nettype
| line_directive
| timing_spec
| protected_block
| {self.language_version >= hdlConvertor.Language.SV2009}? undefineall
| {self.language_version >= hdlConvertor.Language.VERILOG2005}? (
keywords_directive
| endkeywords_directive
| pragma
)
;
define:
DEFINE macro_id ( LP (define_args)? RP )? WS* replacement? (LINE_COMMENT | NEW_LINE | EOF)
;
define_args:
{ self.language_version >= hdlConvertor.Language.SV2009 }? define_args_with_def_val
| { self.language_version < hdlConvertor.Language.SV2009 }? define_args_basic
;
define_args_with_def_val:
param_with_def_val ( COMMA param_with_def_val )*
;
param_with_def_val:
var_id (EQUAL default_text?) ?
;
define_args_basic:
var_id ( COMMA var_id )*
;
replacement: CODE+;
default_text: CODE+;
conditional:
ifdef_directive
| ifndef_directive
;
ifdef_directive:
IFDEF cond_id group_of_lines
( ELSIF cond_id group_of_lines )*
( ELSE else_group_of_lines )?
ENDIF
;
ifndef_directive:
IFNDEF cond_id group_of_lines
( ELSIF cond_id group_of_lines )*
( ELSE else_group_of_lines )?
ENDIF
;
else_group_of_lines: group_of_lines;
group_of_lines: text*;
macro_call:
OTHER_MACRO_CALL_NO_ARGS
| OTHER_MACRO_CALL_WITH_ARGS value? (COMMA value? )* RP
;
value: text+;
macro_id: ID;
var_id: COMMENT* ID COMMENT*;
cond_id: ID;
undef: UNDEF ID (WS | NEW_LINE | EOF);
celldefine: CELLDEFINE;
endcelldefine: ENDCELLDEFINE;
unconnected_drive: UNCONNECTED_DRIVE;
nounconnected_drive: NOUNCONNECTED_DRIVE;
default_nettype:
DEFAULT_NETTYPE default_nettype_value
;
default_nettype_value
: WIRE
| TRI
| TRI0
| TRI1
| WAND
| TRIAND
| WOR
| TRIOR
| TRIREG
| UWIRE
| NONE
| {self.language_version >= hdlConvertor.Language.VERILOG2005}? UWIRE
;
line_directive:
LINE NUM STR NUM
;
timing_spec:
TIMESCALE Time_Identifier TIMING_SPEC_MODE_SLASH Time_Identifier
;
protected_block:
PROTECTED PROTECTED_LINE* ENDPROTECTED
;
resetall: RESETALL;
undefineall: UNDEFINEALL;
keywords_directive:
BEGIN_KEYWORDS version_specifier
;
version_specifier:
STR
// {self.language_version >= hdlConvertor::Language::SV2017}? V18002017
// | {self.language_version >= hdlConvertor::Language::SV2012}? V18002012
// | {self.language_version >= hdlConvertor::Language::SV2009}? V18002009
// | {self.language_version >= hdlConvertor::Language::SV2005}? V18002005
// | {self.language_version >= hdlConvertor::Language::VERILOG2005}? V13642005
// | {self.language_version >= hdlConvertor::Language::VERILOG2001}? V13642001
// | {self.language_version >= hdlConvertor::Language::VERILOG2001_NOCONFIG }? V13642001noconfig
// | V13641995
;
endkeywords_directive: END_KEYWORDS;
include: INCLUDE (
STR
| {self.language_version >= hdlConvertor.Language.SV2005}? macro_call
);
pragma:
PRAGMA pragma_name ( pragma_expression ( COMMA pragma_expression )* )? (NEW_LINE | EOF)
;
pragma_name : ID;
pragma_expression:
pragma_keyword
| pragma_keyword EQUAL pragma_value
| pragma_value
;
pragma_value :
LP pragma_expression ( COMMA pragma_expression )* RP
| NUM
| STR
| ID
;
pragma_keyword : ID;
|
alloy4fun_models/trashltl/models/4/77hSRQzai6sZRd4kf.als | Kaixi26/org.alloytools.alloy | 0 | 2734 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred id77hSRQzai6sZRd4kf_prop5 {
always some f : File | eventually f not in File
}
pred __repair { id77hSRQzai6sZRd4kf_prop5 }
check __repair { id77hSRQzai6sZRd4kf_prop5 <=> prop5o } |
programs/oeis/084/A084516.asm | jmorken/loda | 1 | 18826 | ; A084516: The length of each successively larger, indecomposable 3-ball ground-state site swap given in A084511, i.e., the number of digits in each term of A084512.
; 1,2,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6
mul $0,2
mov $1,1
mov $2,1
lpb $0
sub $0,$2
trn $0,1
add $1,1
mul $2,2
sub $2,$1
add $2,3
mul $2,2
lpe
|
test/interaction/Issue3080.agda | cruhland/agda | 1,989 | 17462 |
module Issue3080 where
open import Agda.Builtin.Nat
open import Agda.Builtin.Equality
data Fin (m : Nat) : Set where
fzero' : (n : Nat) (p : m ≡ suc n) → Fin m
fsuc' : (n : Nat) (p : m ≡ suc n) (i : Fin n) → Fin m
lift : (m : Nat) (i : Fin m) → Fin (suc m)
lift m (fzero' n p) = {!p!}
lift m (fsuc' n p i) = {!p!} -- Split on p here
module PatternSynonyms where
pattern fzero n = fzero' n refl
pattern fsuc n i = fsuc' n refl i
-- Splitting produces
--
-- lift .(suc n) (.Issue3080.PatternSynonyms.fsuc n i) = ?
--
-- which fails to parse.
|
src/skill-string_pools.ads | skill-lang/adaCommon | 0 | 24861 | <filename>src/skill-string_pools.ads
-- ___ _ ___ _ _ --
-- / __| |/ (_) | | Common SKilL implementation --
-- \__ \ ' <| | | |__ string pool management --
-- |___/_|\_\_|_|____| by: <NAME> --
-- --
pragma Ada_2012;
with Ada.Containers.Hashed_Sets;
with Interfaces;
with Skill.Equals;
with Skill.Hashes;
with Skill.Streams.Reader;
with Skill.Streams.Writer;
with Skill.Types;
with Skill.Containers.Vectors;
with Skill.Synchronization;
with Ada.Exceptions;
with Ada.Characters.Latin_1;
with Ada.Containers.Vectors;
limited with Skill.Field_Types.Builtin.String_Type_P;
package Skill.String_Pools is
type Pool_T is tagged limited private;
type Pool is not null access Pool_T;
-- internal use only
function Create (Input : Skill.Streams.Reader.Input_Stream) return Pool;
procedure Free (This : access Pool_T);
function Size (This : access Pool_T) return Integer;
-- internal use only
procedure AddPosition
(This : access Pool_T;
Pos : Types.v64;
Len : Types.i32);
function Get
(This : access Pool_T;
Index : Types.v64) return Skill.Types.String_Access;
-- adds a string to the pool
procedure Add (This : access Pool_T; S : Types.String_Access);
-- adds a string to the pool
function Add (This : access Pool_T; S : String) return Types.String_Access;
-- internal use only
function InvalidPoolIndexException
(Idx : Natural;
Size : Natural;
Type_Name : String;
Cause : Ada.Exceptions.Exception_Occurrence) return String is
("Invalid index " &
Natural'Image (Idx) &
" into pool " &
Type_Name &
" of size " &
Natural'Image (Size) &
". Caused by: " &
Ada.Characters.Latin_1.LF &
Ada.Exceptions.Exception_Information (Cause));
-- internal use only
procedure Prepare_And_Write
(This : access Pool_T;
Output : Skill.Streams.Writer.Output_Stream;
Serialization_IDs : Skill.Field_Types.Builtin.String_Type_P.ID_Map);
-- internal use only
procedure Prepare_And_Append
(This : access Pool_T;
Output : Skill.Streams.Writer.Output_Stream;
Serialization_IDs : Skill.Field_Types.Builtin.String_Type_P.ID_Map);
private
use type Skill.Types.String_Access;
package A1 is new Ada.Containers.Hashed_Sets
(Skill.Types.String_Access,
Skill.Hashes.Hash,
Skill.Equals.Equals);
use type Interfaces.Integer_32;
use type Interfaces.Integer_64;
type Position is record
AbsoluteOffset : Types.v64 := -1;
Length : Types.i32 := -1;
end record;
package A2 is new Skill.Containers.Vectors (Natural, Position);
package A3 is new Skill.Containers.Vectors
(Natural,
Skill.Types.String_Access);
type Pool_T is tagged limited record
Input : Skill.Streams.Reader.Input_Stream;
New_Strings : A1.Set;
String_Positions : A2.Vector;
Id_Map : A3.Vector;
Mutex : Skill.Synchronization.Mutex;
end record;
end Skill.String_Pools;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.