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
docs/test_files/getc_test.asm
carlosebmachado/little-computer-3
0
18449
.orig 0x3000 GETC ; ascii val into R0 ADD R3 , R0 , x0 ADD R3 , R3 , #-16 ADD R3 , R3 , #-16 ADD R3 , R3 , #-16 halt .end
src/mobs.adb
thindil/steamsky
80
11199
-- Copyright 2017-2021 <NAME> -- -- This file is part of Steam Sky. -- -- Steam Sky is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- Steam Sky is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with Steam Sky. If not, see <http://www.gnu.org/licenses/>. with Ada.Characters.Handling; use Ada.Characters.Handling; with DOM.Core; use DOM.Core; with DOM.Core.Documents; with DOM.Core.Nodes; use DOM.Core.Nodes; with DOM.Core.Elements; use DOM.Core.Elements; with Items; use Items; with Log; use Log; with Utils; use Utils; package body Mobs is procedure LoadMobs(Reader: Tree_Reader) is MobsData: Document; NodesList, ChildNodes: Node_List; TempRecord: ProtoMobRecord (Amount_Of_Attributes => Attributes_Amount, Amount_Of_Skills => Skills_Amount); TempSkills: Skills_Container.Vector; TempInventory: MobInventory_Container.Vector; TempPriorities: constant Natural_Array(1 .. 12) := (others => 0); TempEquipment: constant Equipment_Array := (others => 0); OrdersNames: constant array(1 .. 11) of Unbounded_String := (To_Unbounded_String("Piloting"), To_Unbounded_String("Engineering"), To_Unbounded_String("Operating guns"), To_Unbounded_String("Repair ship"), To_Unbounded_String("Manufacturing"), To_Unbounded_String("Upgrading ship"), To_Unbounded_String("Talking in bases"), To_Unbounded_String("Healing wounded"), To_Unbounded_String("Cleaning ship"), To_Unbounded_String("Defend ship"), To_Unbounded_String("Board enemy ship")); EquipmentNames: constant array(1 .. 7) of Unbounded_String := (To_Unbounded_String("Weapon"), To_Unbounded_String("Shield"), To_Unbounded_String("Head"), To_Unbounded_String("Torso"), To_Unbounded_String("Arms"), To_Unbounded_String("Legs"), To_Unbounded_String("Tool")); Action, SubAction: Data_Action; MobNode, ChildNode: Node; ChildIndex: Natural; DeleteIndex: Positive; MobIndex, ItemIndex: Unbounded_String; begin MobsData := Get_Tree(Reader); NodesList := DOM.Core.Documents.Get_Elements_By_Tag_Name(MobsData, "mobile"); Load_Mobs_Loop : for I in 0 .. Length(NodesList) - 1 loop TempRecord := (Amount_Of_Attributes => Attributes_Amount, Amount_Of_Skills => Skills_Amount, Skills => TempSkills, Attributes => (others => <>), Order => Rest, Priorities => TempPriorities, Inventory => TempInventory, Equipment => TempEquipment); MobNode := Item(NodesList, I); MobIndex := To_Unbounded_String(Get_Attribute(MobNode, "index")); Action := (if Get_Attribute(MobNode, "action")'Length > 0 then Data_Action'Value(Get_Attribute(MobNode, "action")) else ADD); if Action in UPDATE | REMOVE then if not ProtoMobs_Container.Contains(ProtoMobs_List, MobIndex) then raise Data_Loading_Error with "Can't " & To_Lower(Data_Action'Image(Action)) & " mob '" & To_String(MobIndex) & "', there is no mob with that index."; end if; elsif ProtoMobs_Container.Contains(ProtoMobs_List, MobIndex) then raise Data_Loading_Error with "Can't add mob '" & To_String(MobIndex) & "', there is already a mob with that index."; end if; if Action /= REMOVE then if Action = UPDATE then TempRecord := ProtoMobs_List(MobIndex); end if; ChildNodes := DOM.Core.Elements.Get_Elements_By_Tag_Name(MobNode, "skill"); Load_Skills_Loop : for J in 0 .. Length(ChildNodes) - 1 loop ChildNode := Item(ChildNodes, J); ChildIndex := Find_Skill_Index(Get_Attribute(ChildNode, "name")); if Get_Attribute(ChildNode, "name") = "WeaponSkill" then ChildIndex := Natural(SkillsData_Container.Length(Skills_List)) + 1; end if; if ChildIndex = 0 then raise Data_Loading_Error with "Can't " & To_Lower(Data_Action'Image(Action)) & " mob '" & To_String(MobIndex) & "', there no skill named '" & Get_Attribute(ChildNode, "name") & "'."; end if; SubAction := (if Get_Attribute(ChildNode, "action")'Length > 0 then Data_Action'Value(Get_Attribute(ChildNode, "action")) else ADD); case SubAction is when ADD => if Get_Attribute(ChildNode, "level")'Length /= 0 then TempRecord.Skills.Append (New_Item => (ChildIndex, Integer'Value(Get_Attribute(ChildNode, "level")), 0)); else if Integer'Value (Get_Attribute(ChildNode, "minlevel")) > Integer'Value (Get_Attribute(ChildNode, "maxlevel")) then raise Data_Loading_Error with "Can't " & To_Lower(Data_Action'Image(Action)) & " mob '" & To_String(MobIndex) & " invalid range for skill '" & Get_Attribute(ChildNode, "name") & "'"; end if; TempRecord.Skills.Append (New_Item => (ChildIndex, Integer'Value (Get_Attribute(ChildNode, "minlevel")), Integer'Value (Get_Attribute(ChildNode, "maxlevel")))); end if; when UPDATE => for Skill of TempRecord.Skills loop if Skill.Index = ChildIndex then if Get_Attribute(ChildNode, "level")'Length /= 0 then Skill := (ChildIndex, Integer'Value (Get_Attribute(ChildNode, "level")), 0); else if Integer'Value (Get_Attribute(ChildNode, "minlevel")) > Integer'Value (Get_Attribute(ChildNode, "maxlevel")) then raise Data_Loading_Error with "Can't " & To_Lower(Data_Action'Image(Action)) & " mob '" & To_String(MobIndex) & " invalid range for skill '" & Get_Attribute(ChildNode, "name") & "'"; end if; Skill := (ChildIndex, Integer'Value (Get_Attribute(ChildNode, "minlevel")), Integer'Value (Get_Attribute(ChildNode, "maxlevel"))); end if; exit; end if; end loop; when REMOVE => Remove_Skill_Loop : for K in TempRecord.Skills.Iterate loop if TempRecord.Skills(K).Index = ChildIndex then DeleteIndex := Skills_Container.To_Index(K); exit Remove_Skill_Loop; end if; end loop Remove_Skill_Loop; TempRecord.Skills.Delete(Index => DeleteIndex); end case; end loop Load_Skills_Loop; ChildNodes := DOM.Core.Elements.Get_Elements_By_Tag_Name(MobNode, "attribute"); if Length(ChildNodes) > 0 and Action = UPDATE then TempRecord.Attributes := (others => <>); end if; Load_Attributes_Loop : for J in 0 .. Length(ChildNodes) - 1 loop ChildNode := Item(ChildNodes, J); if Get_Attribute(ChildNode, "level") /= "" then TempRecord.Attributes(J + 1) := (Integer'Value(Get_Attribute(ChildNode, "level")), 0); else if Integer'Value(Get_Attribute(ChildNode, "minlevel")) > Integer'Value(Get_Attribute(ChildNode, "maxlevel")) then raise Data_Loading_Error with "Can't " & To_Lower(Data_Action'Image(Action)) & " mob '" & To_String(MobIndex) & " invalid range for attribute."; end if; TempRecord.Attributes(J + 1) := (Integer'Value(Get_Attribute(ChildNode, "minlevel")), Integer'Value(Get_Attribute(ChildNode, "maxlevel"))); end if; exit Load_Attributes_Loop when J + 1 = Positive (AttributesData_Container.Length (Container => Attributes_List)); end loop Load_Attributes_Loop; ChildNodes := DOM.Core.Elements.Get_Elements_By_Tag_Name(MobNode, "priority"); Load_Orders_Loop : for J in 0 .. Length(ChildNodes) - 1 loop ChildNode := Item(ChildNodes, J); Set_Priorities_Loop : for K in OrdersNames'Range loop if OrdersNames(K) = To_Unbounded_String(Get_Attribute(ChildNode, "name")) then TempRecord.Priorities(K) := (if Get_Attribute(ChildNode, "value") = "Normal" then 1 else 2); exit Set_Priorities_Loop; end if; end loop Set_Priorities_Loop; end loop Load_Orders_Loop; if Get_Attribute(MobNode, "order")'Length > 0 then TempRecord.Order := Crew_Orders'Value(Get_Attribute(MobNode, "order")); end if; ChildNodes := DOM.Core.Elements.Get_Elements_By_Tag_Name(MobNode, "item"); Load_Items_Loop : for J in 0 .. Length(ChildNodes) - 1 loop ChildNode := Item(ChildNodes, J); ItemIndex := To_Unbounded_String(Get_Attribute(ChildNode, "index")); if not Objects_Container.Contains(Items_List, ItemIndex) then raise Data_Loading_Error with "Can't " & To_Lower(Data_Action'Image(Action)) & " mob '" & To_String(MobIndex) & "', there is no item with index '" & Get_Attribute(ChildNode, "index") & "'."; end if; SubAction := (if Get_Attribute(ChildNode, "action")'Length > 0 then Data_Action'Value(Get_Attribute(ChildNode, "action")) else ADD); case SubAction is when ADD => if Get_Attribute(ChildNode, "amount")'Length /= 0 then TempRecord.Inventory.Append (New_Item => (ItemIndex, Integer'Value (Get_Attribute(ChildNode, "amount")), 0)); else if Integer'Value (Get_Attribute(ChildNode, "minamount")) > Integer'Value (Get_Attribute(ChildNode, "maxamount")) then raise Data_Loading_Error with "Can't " & To_Lower(Data_Action'Image(Action)) & " mob '" & To_String(MobIndex) & " invalid range for amount of '" & Get_Attribute(ChildNode, "index") & "'."; end if; TempRecord.Inventory.Append (New_Item => (ItemIndex, Integer'Value (Get_Attribute(ChildNode, "minamount")), Integer'Value (Get_Attribute(ChildNode, "maxamount")))); end if; when UPDATE => Update_Items_Loop : for Item of TempRecord.Inventory loop if Item.ProtoIndex = ItemIndex then if Get_Attribute(ChildNode, "amount")'Length /= 0 then Item := (ItemIndex, Integer'Value (Get_Attribute(ChildNode, "amount")), 0); else if Integer'Value (Get_Attribute(ChildNode, "minamount")) > Integer'Value (Get_Attribute(ChildNode, "maxamount")) then raise Data_Loading_Error with "Can't " & To_Lower(Data_Action'Image(Action)) & " mob '" & To_String(MobIndex) & " invalid range for amount of '" & Get_Attribute(ChildNode, "index") & "'."; end if; Item := (ItemIndex, Integer'Value (Get_Attribute(ChildNode, "minamount")), Integer'Value (Get_Attribute(ChildNode, "maxamount"))); end if; exit Update_Items_Loop; end if; end loop Update_Items_Loop; when REMOVE => declare DeleteIndex: Natural := 0; begin Remove_Items_Loop : for K in TempRecord.Inventory.First_Index .. TempRecord.Inventory.Last_Index loop if TempRecord.Inventory(K).ProtoIndex = ItemIndex then DeleteIndex := K; exit Remove_Items_Loop; end if; end loop Remove_Items_Loop; if DeleteIndex > 0 then TempRecord.Inventory.Delete(DeleteIndex); end if; end; end case; end loop Load_Items_Loop; ChildNodes := DOM.Core.Elements.Get_Elements_By_Tag_Name(MobNode, "equipment"); Equipment_Loop : for J in 0 .. Length(ChildNodes) - 1 loop ChildNode := Item(ChildNodes, J); Update_Equipment_Loop : for K in EquipmentNames'Range loop if EquipmentNames(K) = To_Unbounded_String(Get_Attribute(ChildNode, "slot")) then TempRecord.Equipment(K) := Positive'Value(Get_Attribute(ChildNode, "index")); exit Update_Equipment_Loop; end if; end loop Update_Equipment_Loop; end loop Equipment_Loop; if Action /= UPDATE then ProtoMobs_Container.Include (ProtoMobs_List, MobIndex, TempRecord); Log_Message("Mob added: " & To_String(MobIndex), EVERYTHING); else ProtoMobs_List(MobIndex) := TempRecord; Log_Message("Mob updated: " & To_String(MobIndex), EVERYTHING); end if; else ProtoMobs_Container.Exclude(ProtoMobs_List, MobIndex); Log_Message("Mob removed: " & To_String(MobIndex), EVERYTHING); end if; end loop Load_Mobs_Loop; end LoadMobs; function GenerateMob (MobIndex, FactionIndex: Unbounded_String) return Member_Data is Mob: Member_Data (Amount_Of_Attributes => Attributes_Amount, Amount_Of_Skills => Skills_Amount); ProtoMob: constant ProtoMobRecord := ProtoMobs_List(MobIndex); Amount: Natural; HighestSkillLevel, WeaponSkillLevel: Skill_Range := 1; SkillIndex: Skills_Container.Extended_Index; begin Mob.Faction := (if Get_Random(1, 100) < 99 then FactionIndex else GetRandomFaction); Mob.Gender := 'M'; if not Factions_List(Mob.Faction).Flags.Contains (To_Unbounded_String("nogender")) and then Get_Random(1, 100) > 50 then Mob.Gender := 'F'; end if; Mob.Name := GenerateMemberName(Mob.Gender, Mob.Faction); Skills_Loop : for Skill of ProtoMob.Skills loop SkillIndex := (if Skill.Index = Skills_Amount + 1 then Factions_List(Mob.Faction).WeaponSkill else Skill.Index); if Skill.Experience = 0 then Mob.Skills.Append(New_Item => (SkillIndex, Skill.Level, 0)); else Mob.Skills.Append (New_Item => (SkillIndex, Get_Random(Skill.Level, Skill.Experience), 0)); end if; if SkillIndex = Factions_List(Mob.Faction).WeaponSkill then WeaponSkillLevel := Mob.Skills(Mob.Skills.Last_Index).Level; end if; if Mob.Skills(Mob.Skills.Last_Index).Level > HighestSkillLevel then HighestSkillLevel := Mob.Skills(Mob.Skills.Last_Index).Level; end if; end loop Skills_Loop; Attributes_Loop : for Attribute in ProtoMob.Attributes'Range loop if ProtoMob.Attributes(Attribute).Experience = 0 then Mob.Attributes(Attribute) := ProtoMob.Attributes(Attribute); else Mob.Attributes(Attribute) := (Get_Random (ProtoMob.Attributes(Attribute).Level, ProtoMob.Attributes(Attribute).Experience), 0); end if; end loop Attributes_Loop; Inventory_Loop : for I in ProtoMob.Inventory.Iterate loop Amount := (if ProtoMob.Inventory(I).MaxAmount > 0 then Get_Random (ProtoMob.Inventory(I).MinAmount, ProtoMob.Inventory(I).MaxAmount) else ProtoMob.Inventory(I).MinAmount); Mob.Inventory.Append (New_Item => (ProtoIndex => ProtoMob.Inventory(I).ProtoIndex, Amount => Amount, Name => Null_Unbounded_String, Durability => 100, Price => 0)); end loop Inventory_Loop; Mob.Equipment := ProtoMob.Equipment; declare ItemsList: UnboundedString_Container.Vector; ItemIndex: Unbounded_String; begin Equipment_Loop : for I in 1 .. 6 loop ItemsList := (case I is when 1 => Weapons_List, when 2 => Shields_List, when 3 => HeadArmors_List, when 4 => ChestArmors_List, when 5 => ArmsArmors_List, when 6 => LegsArmors_List); if Mob.Equipment(I) = 0 then ItemIndex := Null_Unbounded_String; if Get_Random(1, 100) < 95 then ItemIndex := GetRandomItem (ItemsList, I, HighestSkillLevel, WeaponSkillLevel, Mob.Faction); end if; if ItemIndex /= Null_Unbounded_String then Mob.Inventory.Append (New_Item => (ProtoIndex => ItemIndex, Amount => 1, Name => Null_Unbounded_String, Durability => 100, Price => 0)); Mob.Equipment(I) := Mob.Inventory.Last_Index; end if; end if; end loop Equipment_Loop; end; Mob.Orders := ProtoMob.Priorities; Mob.Order := ProtoMob.Order; Mob.OrderTime := 15; Mob.PreviousOrder := Rest; Mob.Health := 100; Mob.Tired := 0; Mob.Hunger := 0; Mob.Thirst := 0; Mob.Payment := (20, 0); Mob.ContractLength := -1; Mob.Morale := (50, 0); Mob.Loyalty := 100; Mob.HomeBase := 1; return Mob; end GenerateMob; function GetRandomItem (ItemsIndexes: UnboundedString_Container.Vector; EquipIndex, HighestLevel, WeaponSkillLevel: Positive; FactionIndex: Unbounded_String) return Unbounded_String is ItemIndex, MaxIndex: Positive; NewIndexes: UnboundedString_Container.Vector; Added: Boolean; begin if EquipIndex > 1 then Equipment_Item_Loop : for I in ItemsIndexes.First_Index .. ItemsIndexes.Last_Index loop Added := False; Add_Equipment_Item_Loop : for J in NewIndexes.First_Index .. NewIndexes.Last_Index loop if Items_List(ItemsIndexes(I)).Price < Items_List(NewIndexes(J)).Price then NewIndexes.Insert(J, ItemsIndexes(I)); Added := True; exit Add_Equipment_Item_Loop; end if; end loop Add_Equipment_Item_Loop; if not Added then NewIndexes.Append(ItemsIndexes(I)); end if; end loop Equipment_Item_Loop; MaxIndex := Positive ((Float(NewIndexes.Last_Index) * (Float(HighestLevel) / 100.0)) + 1.0); if MaxIndex > NewIndexes.Last_Index then MaxIndex := NewIndexes.Last_Index; end if; ItemIndex := Get_Random(NewIndexes.First_Index, MaxIndex); else Proto_Items_Loop : for I in ItemsIndexes.First_Index .. ItemsIndexes.Last_Index loop Added := False; Add_Proto_Item_Loop : for J in NewIndexes.First_Index .. NewIndexes.Last_Index loop if Items_List(ItemsIndexes(I)).Price < Items_List(NewIndexes(J)).Price and Items_List(ItemsIndexes(I)).Value(3) = Factions_List(FactionIndex).WeaponSkill then NewIndexes.Insert(J, ItemsIndexes(I)); Added := True; exit Add_Proto_Item_Loop; end if; end loop Add_Proto_Item_Loop; if not Added and Items_List(ItemsIndexes(I)).Value(3) = Factions_List(FactionIndex).WeaponSkill then NewIndexes.Append(ItemsIndexes(I)); end if; end loop Proto_Items_Loop; if NewIndexes.Length = 0 then return Null_Unbounded_String; end if; MaxIndex := Positive ((Float(NewIndexes.Last_Index) * (Float(WeaponSkillLevel) / 100.0)) + 1.0); if MaxIndex > NewIndexes.Last_Index then MaxIndex := NewIndexes.Last_Index; end if; Get_Weapon_Loop : loop ItemIndex := Get_Random(NewIndexes.First_Index, MaxIndex); exit Get_Weapon_Loop when Items_List(NewIndexes(ItemIndex)).Value (3) = Factions_List(FactionIndex).WeaponSkill; end loop Get_Weapon_Loop; end if; Get_Item_Index_Loop : for Index of ItemsIndexes loop if Index = NewIndexes(ItemIndex) then return Index; end if; end loop Get_Item_Index_Loop; return Null_Unbounded_String; end GetRandomItem; end Mobs;
oeis/344/A344346.asm
neoneye/loda-programs
11
161427
; A344346: Numbers k which have an odd number of trailing zeros in their binary reflected Gray code A014550(k). ; Submitted by <NAME> ; 3,4,11,12,15,16,19,20,27,28,35,36,43,44,47,48,51,52,59,60,63,64,67,68,75,76,79,80,83,84,91,92,99,100,107,108,111,112,115,116,123,124,131,132,139,140,143,144,147,148,155,156,163,164,171,172,175,176,179,180,187,188,191,192,195,196,203,204,207,208,211,212,219,220,227,228,235,236,239,240,243,244,251,252,255,256,259,260,267,268,271,272,275,276,283,284,291,292,299,300 mov $2,$0 div $0,2 seq $0,72939 ; Define a sequence c depending on n by: c(1)=1 and c(2)=n; c(k+2) = (c(k+1) + c(k))/2 if c(k+1) and c(k) have the same parity; otherwise c(k+2)=abs(c(k+1)-2*c(k)); sequence gives values of n such that lim k -> infinity c(k) = infinity. add $1,$0 mul $1,2 mod $2,2 add $1,$2 mov $0,$1 sub $0,3
src/main/antlr4/Horth.g4
mrh0/horth
1
5852
grammar Horth; BOOL: 'true' | 'false'; NAME: [_a-zA-Z][_a-zA-Z0-9]*; ATOM: ':'[a-zA-Z0-9][_a-zA-Z0-9]*; INT: '0'|'-'?[1-9][0-9]*; HEX: '0x'[0-9a-fA-F]*; BIN: '0b'[0-1]*; CHAR: '\''.'\'' | '\'\\'('n'|'r'|'t'|'\\'|'\''|'"'|'0')'\''; STRING: '"' .*? '"'; //MODULE_NAME: ([a-zA-Z][_a-zA-Z0-9]*)('.'[a-zA-Z][_a-zA-Z0-9])*; WHITESPACE: [ \t\r\n]+ -> skip; COMMENT: '//' ~[\r\n]* -> skip; BLOCKCOMMENT: '/*' .*? '*/' -> skip; identifier: NAME '@' | NAME ; integer: INT #integerInt | HEX #integerHex | BIN #integerBin ; dataType: nestedName=NAME '<' nested=dataType '>' #dataTypeNested //| 'ref<' dataType '>' #dataTypeRef //| 'arr<' dataType '>' #dataTypeArr //| 'any<' NAME '>' #dataTypeAny //replaced by function overloads | 'func' '<' (dataType)* ('->' (dataType)+)? '>' #dataTypeFunc //| dataType '*' staticExpr #dataTypeMany //| 'atom' '<' (ATOM '|')* ATOM '>' #dataTypeAtoms | NAME #dataTypeSimple ; userDefinedDataType: 'type' NAME 'as' (NAME dataType ',')* NAME dataType 'end' ; unop: 'not' | '!' | '~' ; binop: '+' | '-' | '*' | '/' | '%' | 'divmod' | '<' | '>' | '<=' | '>=' | '==' | '!=' | '&' | '|' | 'and' | 'or' | '<<' | '>>' | '=' ; keywords: 'dup' | 'dup2' | 'swap' | 'swap2' | 'drop' | 'drop2' | 'drop3' | 'next' | 'out' | 'log' 'error' | 'read' | 'write' | 'copy' | 'clone' //| 'exit' | 'halt' // | 'ret' //| 'terminate' | 'ret' | 'break' //brk? | 'here' | 'box' | 'void' ; /*typeConstructor: '{' integer '}' //| '{' typeConstructor+ '}' ; */ typeFunc: // _ used as skip type? 'sizeof' '(' dataType ')' #typeFuncSizeof | 'sizeof' dataType #typeFuncSizeof //| 'cast' '(' dataType ')' #typeFuncCast | 'as' dataType #typeFuncCast //| 'as' '(' (types+=dataType)* ')' #typeFuncCast //| 'unsafe' 'cast' '(' dataType ')' #typeFuncCastUnsafe | 'as' 'unsafe' dataType #typeFuncCastUnsafe | 'as' '!' dataType #typeFuncCastUnsafe //| 'as' '(' ('unsafe'? types+=dataType)* ')' #typeFuncCastUnsafe | 'is' '(' (types+=dataType)* ')' #typeFuncIs | 'is' types+=dataType #typeFuncIs | 'new' type=dataType #typeFuncNew ; infix: identifier #infixIdent | identifier? typeFunc #infixTypefunc //| identifier '.' prop=NAME #infixProps //| identifier '.' prop=NAME '@' #infixPropsAddr | ATOM #infixAtom | integer #infixInt | BOOL #infixBool | CHAR #infixChar | infix binop infix #infixBinOp | unop infix #infixUnOp | '(' infix ')' #infixInfix ; staticExpr: integer | ATOM | BOOL | STRING | CHAR | identifier //constants only | unop | binop | typeFunc ; switchCaseExpr: integer | ATOM | BOOL | CHAR ; general: ',' #genSeparator | unop #genUnop | binop #genBinOp | keywords #genKeyword | '.' prop=NAME #genProp | '.' prop=NAME '@' #genPropAddr | '[' accBlock=block ']' #genAccessor | '[' accBlock=block ']^' #genAccessorStrict //| '{' (staticExpr ',')* staticExpr? '}' #genArray | '(' infix ')' #genInfix //| 'assert' (message=STRING)? block 'end' #genAssert //| 'static' 'assert' (message=STRING)? staticExpr 'end' #genStaticAssert //| ('inline' | 'extern' | 'start')? 'func' NAME 'infer' 'in' block 'end' #genFuncInfer //| ('inline' | 'extern')? 'func' NAME 'let' (names+=NAME)+ 'as' // (dataType)* ('->' (dataType)+)? 'in' block 'end' #genFuncLet //| ('inline' | 'extern')? 'func' NAME (dataType)* ('->' (dataType)+)? 'end' #genFuncSignature //| ('inline' | 'extern')? 'func' IDENTIFIER 'infer' 'from' IDENTIFIER 'in' block 'end' #genFuncSignatureOf //| 'const' NAME 'alloc' dataType ('*' staticExpr)* 'end' #genAllocStatic | 'if' conds+=block 'do' doBlock+=block ('elif' conds+=block 'do' doBlock+=block)* ('else' elseBlock=block)? 'end' #genIf //| 'switch' inBlock=block 'in' //('case' cases=switchCaseExpr 'do' doBlock+=block)* //('default' 'case' defBlock=block) 'end' #genSwitch | 'while' cond=block 'do' doBlock=block ('else' elseBlock=block)? 'end' #genWhile //| 'for' block ';' block ';' block 'do' block 'end' #genFor //| 'for' 'each' NAME 'in' block 'do' block 'end' //| 'let' IDENTIFIER (TYPE | 'infer') ('pop')? #genLet //| 'let' ('.'IDENTIFIER)* (IDENTIFIER)* 'in' block 'end' #genLet | 'let' (names+=NAME)+ 'in' localBlock=block #genLet //| 'label' (IDENTIFIER)+ 'in' block 'end' #genLabel //| 'let' (names+=NAME)+ 'in' #genLetFuncScope //| 'with' NAME 'do' block 'end' #genWith //| 'const' NAME staticExpr 'end' #genConst //| 'try' NAME #genTry //| 'throw' block #genThrow //| 'try' NAME 'pass' passBlock=block 'catch' failBlock=block 'end' #genCatch //| 'try' NAME 'catch' failBlock=block 'pass' passBlock=block 'end' #genCatch | 'syscall' sysCallName=NAME #genSyscall //| 'export' NAME #genExport | typeFunc #genIntrfunc | ATOM #genAtom | integer #genInt | identifier #genIdentifier | STRING #genString | BOOL #genBool | CHAR #genChar ; mainBlock: funcPrefix=('inline' | 'extern' | 'start' | 'rec')? 'func' name=NAME (args+=dataType)* ('->' (rets+=dataType)+)? ('throws' thrown=dataType)? 'in' funcBody=block 'end' #mainFunc ; block: (contents+=general)* ; include: 'include' module ; module: NAME ('.'NAME)* ; program: ('module' moduleName=module)? (includes+=include)* main+=mainBlock* EOF ;
test/interaction/Debug.agda
cruhland/agda
1,989
17553
<reponame>cruhland/agda<gh_stars>1000+ {-# OPTIONS -v5 #-} module Debug where postulate Foo : Set
libsrc/stdio/ansi/x1/f_ansi_cls.asm
meesokim/z88dk
0
178315
<reponame>meesokim/z88dk<filename>libsrc/stdio/ansi/x1/f_ansi_cls.asm<gh_stars>0 ; ; ANSI Video handling for the Sharp X1 ; <NAME> (for X1s.org) - 24/10/2013 ; ; CLS - Clear the screen ; ; ; $Id: f_ansi_cls.asm,v 1.4 2015/01/19 01:33:19 pauloscustodio Exp $ ; PUBLIC ansi_cls EXTERN ATTR EXTERN text_cols ansi_cls: ld bc, $3000 ;ld hl, $200F ; ' ' char and attribute ld a,(text_cols) ld d, $20 clr2: ld e,a push af clr1: set 4, b ld a,32 out (c), a res 4, b ld a,(ATTR+1) out (c), a inc bc dec e jp nz, clr1 pop af dec d jp nz, clr2 ret
deps/dyncall/dyncallback/dyncall_callback_x86_masm.asm
unbornchikken/fastcall
220
87198
<reponame>unbornchikken/fastcall ; auto-generated by gen-masm.sh .386 .MODEL FLAT .CODE DCThunk_size = 16 DCArgs_size = 20 DCValue_size = 8 CTX_thunk = 0 CTX_phandler = 16 CTX_pargsvt = 20 CTX_stack_cleanup = 24 CTX_userdata = 28 frame_arg0 = 8 frame_ret = 4 frame_parent = 0 frame_CTX = -4 frame_DCArgs = -24 frame_DCValue = -32 _dcCallbackThunkEntry PROC OPTION PROLOGUE:NONE, EPILOGUE:NONE push EBP mov EBP,ESP push EAX push 0 push EDX push ECX lea ECX,dword ptr [EBP+frame_arg0] push ECX push dword ptr [EAX+CTX_pargsvt] mov ECX,ESP push 0 push 0 mov EDX,ESP and ESP,-16 push dword ptr [EAX+CTX_userdata] push EDX push ECX push EAX call dword ptr [EAX+CTX_phandler] mov ESP,EBP pop ECX pop ECX mov EDX,dword ptr [EBP+frame_CTX] add ESP,dword ptr [EDX+CTX_stack_cleanup] push ECX lea EDX,dword ptr [EBP+frame_DCValue] mov EBP,dword ptr [EBP+0] cmp AL,102 je return_f32 cmp AL,100 je return_f64 return_i64: mov EAX,dword ptr [EDX+0] mov EDX,dword ptr [EDX+4] ret return_f32: fld dword ptr [EDX+0] ret return_f64: fld qword ptr [EDX+0] return_void: ret _dcCallbackThunkEntry ENDP END
Transynther/x86/_processed/NC/_zr_/i3-7100_9_0xca_notsx.log_21829_144.asm
ljhsiun2/medusa
9
81800
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r8 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_UC_ht+0xca7, %rsi lea addresses_D_ht+0x1df27, %rdi nop nop nop add $8857, %r11 mov $47, %rcx rep movsq add %rcx, %rcx lea addresses_normal_ht+0x11953, %rsi lea addresses_WT_ht+0xf51d, %rdi nop inc %r13 mov $114, %rcx rep movsb nop nop nop nop nop sub $16328, %r13 lea addresses_normal_ht+0xfb27, %rax sub %r9, %r9 movb (%rax), %cl nop nop add %r9, %r9 lea addresses_WT_ht+0x3167, %rsi cmp %rdi, %rdi movb (%rsi), %al nop and %r13, %r13 lea addresses_A_ht+0xe28e, %rax nop nop cmp $18762, %r9 mov (%rax), %si nop nop sub %r9, %r9 lea addresses_D_ht+0xff27, %rsi lea addresses_WT_ht+0x2b27, %rdi clflush (%rsi) nop dec %r8 mov $118, %rcx rep movsq nop sub %rsi, %rsi lea addresses_D_ht+0x10447, %rsi inc %r9 movw $0x6162, (%rsi) nop nop nop xor $13820, %r11 lea addresses_UC_ht+0x17327, %r13 clflush (%r13) and %r8, %r8 movl $0x61626364, (%r13) nop nop nop inc %r9 lea addresses_WT_ht+0x1c067, %rsi lea addresses_WT_ht+0xe327, %rdi clflush (%rdi) nop xor $39559, %rax mov $80, %rcx rep movsq sub $27595, %r8 lea addresses_WC_ht+0x8587, %r11 nop nop add $18062, %rdi movw $0x6162, (%r11) nop nop add %rcx, %rcx lea addresses_A_ht+0x13627, %rsi lea addresses_normal_ht+0x14fa7, %rdi sub $59499, %r8 mov $33, %rcx rep movsb nop xor $55010, %r9 lea addresses_UC_ht+0x1ab27, %r9 nop nop nop nop inc %rsi movl $0x61626364, (%r9) nop nop nop nop add $56221, %rax lea addresses_WT_ht+0x1c3a8, %rsi lea addresses_A_ht+0x9b47, %rdi nop nop nop nop nop cmp $24329, %rax mov $65, %rcx rep movsq nop nop and %rdi, %rdi lea addresses_D_ht+0x7127, %r8 nop nop nop sub $63299, %r9 movb $0x61, (%r8) nop nop nop nop nop sub %rax, %rax lea addresses_WT_ht+0x12d27, %rsi lea addresses_A_ht+0x928f, %rdi nop nop nop nop cmp $23799, %r13 mov $38, %rcx rep movsq nop nop nop add $2994, %r9 pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r8 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r8 push %rbp push %rdi push %rsi // Load lea addresses_US+0x1316f, %r8 nop nop nop nop nop xor %rbp, %rbp movups (%r8), %xmm5 vpextrq $1, %xmm5, %r13 nop add $50772, %rbp // Faulty Load mov $0xea1200000000327, %rsi nop nop nop nop nop cmp %r11, %r11 mov (%rsi), %r8 lea oracles, %rbp and $0xff, %r8 shlq $12, %r8 mov (%rbp,%r8,1), %r8 pop %rsi pop %rdi pop %rbp pop %r8 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_US', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}} {'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}} {'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 4, 'NT': False, 'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False}} {'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False}} {'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 9, 'NT': False, 'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False}} {'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False}} {'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
test/Succeed/EmptyRenamingAndHiding.agda
cruhland/agda
1,989
11573
<filename>test/Succeed/EmptyRenamingAndHiding.agda module _ where module M where open M using () renaming () hiding () -- empty lists should not be errors here
fizzbuzz/fizz_buzz.asm
1fabunicorn/assembly-playground
0
14425
<filename>fizzbuzz/fizz_buzz.asm ; <NAME> ; My implentation of Fizz Buzz is NASM assembly ; Compile with: nasm -f elf fizz_buzz.asm ; Link with (64 bit systems require elf_i386 option): ld -m elf_i386 fizz_buzz.o -o fizz_buzz ; Run with: ./fizz_buzz %include 'functions.asm'; needed for printing output SECTION .data Fizz db 'Fizz', 0h Buzz db 'Buzz', 0h FizzBuzz db 'FizzBuzz', 0h SECTION .text global _start _start: mov eax, 1; eax will be our counter var call loop loop: ; check for fizzbuzz call div3 call div5 call print_results call check_if_done ; checks what the remainder of ecx / 3 ; if yes, ebx is 1 div3: push eax; push registers to the stack mov ecx, 3; divisor mov edx, 0; clear registor where result will live div ecx; call div function pop eax cmp edx, 0; see if remainder of counter / 3 = 0 JE is_div_3 JNE not_div_3 is_div_3: mov ebx, 1 ret not_div_3: mov ebx, 0 ret ; checks what the remainder of ecx / 5 ; if yes, edx is 1 ; otherwise its 0 div5: push eax; push registers to the stack that we use in the routine mov ecx, 5; diviser mov edx, 0; clear registor where result will live div ecx; call div function pop eax; put if div3 flag back into ebx cmp edx, 0 JE is_div_5 JNE not_div_5 is_div_5: mov edx, 1 ret not_div_5: mov edx, 0 ret ; checks the value of adx and abx ; if adx & abx = 1, print fizzbuzz ; if ebx = 1, Fizz ; if edx = 1, Buzz ; if both 0, print value in acx print_results: push ecx push eax mov ecx, 0; clear ecx add ecx, ebx add ecx, edx cmp ecx, 2; if true, fizzbuzz pop eax pop ecx JE is_fizz_buzz JNE not_fizz_buzz is_fizz_buzz: call fizzbuzz ret not_fizz_buzz: cmp ebx, 1; if true, fizz JE call_fizz JNE test_for_buzz call_fizz: call fizz ret test_for_buzz: cmp edx, 1; if true buzz JE call_buzz JNE call_print_num; if we gotten to this point, then we know number is not fizz, buzz, or fizzbuzz. just print the current loop number call_buzz: call buzz ret call_print_num: call printNum ret check_if_done: inc eax; add one to loop counter cmp eax, 100; see if loop var has gotten to 100, then exit JE quit; if equal, jump to quit JNE loop; otherwise jump to loop fizz: push eax; push counter var to stack mov eax, Fizz call sprintLF; eax is incremented by one here :) pop eax ret buzz: push eax mov eax, Buzz call sprintLF pop eax ret fizzbuzz: push eax mov eax, FizzBuzz call sprintLF pop eax ret printNum: call iprintLF ret
Cubical/HITs/Truncation/Properties.agda
shlevy/cubical
0
6578
<reponame>shlevy/cubical {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.HITs.Truncation.Properties where open import Cubical.Data.NatMinusOne open import Cubical.HITs.Truncation.Base open import Cubical.Foundations.Prelude open import Cubical.Foundations.Function open import Cubical.Foundations.Equiv open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.HLevels open import Cubical.Foundations.Univalence open import Cubical.Foundations.Equiv.HalfAdjoint open import Cubical.Foundations.Equiv.PathSplit open isPathSplitEquiv open import Cubical.Modalities.Modality open Modality open import Cubical.Data.Empty.Base as ⊥ renaming (rec to ⊥rec ; elim to ⊥elim) open import Cubical.Data.Nat hiding (elim) open import Cubical.Data.Sigma open import Cubical.Data.Bool open import Cubical.Data.Unit open import Cubical.HITs.Sn.Base open import Cubical.HITs.S1 open import Cubical.HITs.Susp open import Cubical.HITs.Nullification as Null hiding (rec; elim) open import Cubical.HITs.PropositionalTruncation as PropTrunc renaming (∥_∥ to ∥_∥₁; ∣_∣ to ∣_∣₁; squash to squash₁) using () open import Cubical.HITs.SetTruncation as SetTrunc using (∥_∥₂; ∣_∣₂; squash₂) open import Cubical.HITs.GroupoidTruncation as GpdTrunc using (∥_∥₃; ∣_∣₃; squash₃) open import Cubical.HITs.2GroupoidTruncation as 2GpdTrunc using (∥_∥₄; ∣_∣₄; squash₄) private variable ℓ ℓ' : Level A : Type ℓ B : Type ℓ' sphereFill : (n : ℕ) (f : S₊ n → A) → Type _ sphereFill {A = A} n f = Σ[ top ∈ A ] ((x : S₊ n) → top ≡ f x) isSphereFilled : ℕ → Type ℓ → Type ℓ isSphereFilled n A = (f : S₊ n → A) → sphereFill n f isSphereFilled∥∥ : {n : ℕ} → isSphereFilled n (HubAndSpoke A n) isSphereFilled∥∥ f = (hub f) , (spoke f) isSphereFilled→isOfHLevel : (n : ℕ) → isSphereFilled n A → isOfHLevel (suc n) A isSphereFilled→isOfHLevel {A = A} zero h x y = sym (snd (h f) true) ∙ snd (h f) false where f : Bool → A f true = x f false = y isSphereFilled→isOfHLevel {A = A} (suc zero) h x y = J (λ y q → (p : x ≡ y) → q ≡ p) (helper x) where helper : (x : A) (p : x ≡ x) → refl ≡ p helper x p i j = hcomp (λ k → λ { (i = i0) → h S¹→A .snd base k ; (i = i1) → p j ; (j = i0) → h S¹→A .snd base (i ∨ k) ; (j = i1) → h S¹→A .snd base (i ∨ k)}) (h S¹→A .snd (loop j) i) where S¹→A : S¹ → A S¹→A base = x S¹→A (loop i) = p i isSphereFilled→isOfHLevel {A = A} (suc (suc n)) h x y = isSphereFilled→isOfHLevel (suc n) (helper h x y) where helper : {n : ℕ} → isSphereFilled (suc (suc n)) A → (x y : A) → isSphereFilled (suc n) (x ≡ y) helper {n = n} h x y f = sym (snd (h f') north) ∙ (snd (h f') south) , r where f' : Susp (S₊ (suc n)) → A f' north = x f' south = y f' (merid u i) = f u i r : (s : S₊ (suc n)) → sym (snd (h f') north) ∙ (snd (h f') south) ≡ f s r s i j = hcomp (λ k → λ { (i = i1) → snd (h f') (merid s j) k ; (j = i0) → snd (h f') north (k ∨ (~ i)) ; (j = i1) → snd (h f') south k }) (snd (h f') north (~ i ∧ ~ j)) isOfHLevel→isSphereFilled : (n : ℕ) → isOfHLevel (suc n) A → isSphereFilled n A isOfHLevel→isSphereFilled zero h f = (f true) , (λ _ → h _ _) isOfHLevel→isSphereFilled {A = A} (suc zero) h f = (f base) , toPropElim (λ _ → h _ _) refl isOfHLevel→isSphereFilled {A = A} (suc (suc n)) h = helper λ x y → isOfHLevel→isSphereFilled (suc n) (h x y) where helper : {n : ℕ} → ((x y : A) → isSphereFilled (suc n) (x ≡ y)) → isSphereFilled (suc (suc n)) A helper {n = n} h f = f north , r where r : (x : S₊ (suc (suc n))) → f north ≡ f x r north = refl r south = h (f north) (f south) (λ x → cong f (merid x)) .fst r (merid x i) j = hcomp (λ k → λ { (i = i0) → f north ; (i = i1) → h (f north) (f south) (λ x → cong f (merid x)) .snd x (~ k) j ; (j = i0) → f north ; (j = i1) → f (merid x i) }) (f (merid x (i ∧ j))) isOfHLevelTrunc : (n : ℕ) → isOfHLevel n (∥ A ∥ n) isOfHLevelTrunc zero = isOfHLevelUnit* 0 isOfHLevelTrunc (suc n) = isSphereFilled→isOfHLevel n isSphereFilled∥∥ rec : {n : HLevel} {B : Type ℓ'} → isOfHLevel (suc n) B → (A → B) → hLevelTrunc (suc n) A → B rec h g ∣ x ∣ = g x rec {n = n} {B = B} hB g (hub f) = isOfHLevel→isSphereFilled n hB (λ x → rec hB g (f x)) .fst rec {n = n} hB g (spoke f x i) = isOfHLevel→isSphereFilled n hB (λ x → rec hB g (f x)) .snd x i elim : {n : ℕ} {B : ∥ A ∥ (suc n) → Type ℓ'} (hB : (x : ∥ A ∥ (suc n)) → isOfHLevel (suc n) (B x)) (g : (a : A) → B (∣ a ∣)) (x : ∥ A ∥ (suc n)) → B x elim hB g (∣ a ∣ ) = g a elim {B = B} hB g (hub f) = isOfHLevel→isSphereFilled _ (hB (hub f)) (λ x → subst B (sym (spoke f x)) (elim hB g (f x)) ) .fst elim {B = B} hB g (spoke f x i) = toPathP {A = λ i → B (spoke f x (~ i))} (sym (isOfHLevel→isSphereFilled _ (hB (hub f)) (λ x → subst B (sym (spoke f x)) (elim hB g (f x))) .snd x)) (~ i) elim2 : {n : ℕ} {B : ∥ A ∥ (suc n) → ∥ A ∥ (suc n) → Type ℓ'} (hB : ((x y : ∥ A ∥ (suc n)) → isOfHLevel (suc n) (B x y))) (g : (a b : A) → B ∣ a ∣ ∣ b ∣) (x y : ∥ A ∥ (suc n)) → B x y elim2 {n = n} hB g = elim (λ _ → isOfHLevelΠ (suc n) (λ _ → hB _ _)) λ a → elim (λ _ → hB _ _) (λ b → g a b) elim3 : {n : ℕ} {B : (x y z : ∥ A ∥ (suc n)) → Type ℓ'} (hB : ((x y z : ∥ A ∥ (suc n)) → isOfHLevel (suc n) (B x y z))) (g : (a b c : A) → B (∣ a ∣) ∣ b ∣ ∣ c ∣) (x y z : ∥ A ∥ (suc n)) → B x y z elim3 {n = n} hB g = elim2 (λ _ _ → isOfHLevelΠ (suc n) (hB _ _)) λ a b → elim (λ _ → hB _ _ _) (λ c → g a b c) isContr→isContr∥ : (n : ℕ) → isContr A → isContr (∥ A ∥ n) isContr→isContr∥ zero _ = tt* , (λ _ _ → tt*) isContr→isContr∥ (suc n) contr = ∣ fst contr ∣ , (elim (λ _ → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _) (λ a i → ∣ snd contr a i ∣)) isOfHLevelMin→isOfHLevel : {n m : ℕ} → isOfHLevel (min n m) A → isOfHLevel n A × isOfHLevel m A isOfHLevelMin→isOfHLevel {n = zero} {m = m} h = h , isContr→isOfHLevel m h isOfHLevelMin→isOfHLevel {n = suc n} {m = zero} h = (isContr→isOfHLevel (suc n) h) , h isOfHLevelMin→isOfHLevel {A = A} {n = suc n} {m = suc m} h = subst (λ x → isOfHLevel x A) (helper n m) (isOfHLevelPlus (suc n ∸ (suc (min n m))) h) , subst (λ x → isOfHLevel x A) ((λ i → m ∸ (minComm n m i) + suc (minComm n m i)) ∙ helper m n) (isOfHLevelPlus (suc m ∸ (suc (min n m))) h) where helper : (n m : ℕ) → n ∸ min n m + suc (min n m) ≡ suc n helper zero zero = refl helper zero (suc m) = refl helper (suc n) zero = cong suc (+-comm n 1) helper (suc n) (suc m) = +-suc _ _ ∙ cong suc (helper n m) ΣTruncElim : ∀ {ℓ ℓ' ℓ''} {A : Type ℓ} {n m : ℕ} {B : (x : ∥ A ∥ (suc n)) → Type ℓ'} {C : (Σ[ a ∈ (∥ A ∥ (suc n)) ] (∥ B a ∥ (suc m))) → Type ℓ''} → ((x : (Σ[ a ∈ (∥ A ∥ (suc n)) ] (∥ B a ∥ (suc m)))) → isOfHLevel (min (suc n) (suc m)) (C x)) → ((a : A) (b : B (∣ a ∣)) → C (∣ a ∣ , ∣ b ∣)) → (x : (Σ[ a ∈ (∥ A ∥ (suc n)) ] (∥ B a ∥ (suc m)))) → (C x) ΣTruncElim {n = n} {m = m} {B = B} {C = C} hB g (a , b) = elim {B = λ a → (b : (∥ B a ∥ (suc m))) → C (a , b)} (λ x → isOfHLevelΠ (suc n) λ b → isOfHLevelMin→isOfHLevel (hB (x , b)) .fst ) (λ a → elim (λ _ → isOfHLevelMin→isOfHLevel (hB (∣ a ∣ , _)) .snd) λ b → g a b) a b truncIdempotentIso : (n : ℕ) → isOfHLevel n A → Iso (∥ A ∥ n) A truncIdempotentIso zero hA = isContr→Iso (isOfHLevelUnit* 0) hA Iso.fun (truncIdempotentIso (suc n) hA) = rec hA λ a → a Iso.inv (truncIdempotentIso (suc n) hA) = ∣_∣ Iso.rightInv (truncIdempotentIso (suc n) hA) _ = refl Iso.leftInv (truncIdempotentIso (suc n) hA) = elim (λ _ → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _) λ _ → refl truncIdempotent≃ : (n : ℕ) → isOfHLevel n A → ∥ A ∥ n ≃ A truncIdempotent≃ n hA = isoToEquiv (truncIdempotentIso n hA) truncIdempotent : (n : ℕ) → isOfHLevel n A → ∥ A ∥ n ≡ A truncIdempotent n hA = ua (truncIdempotent≃ n hA) HLevelTruncModality : ∀ {ℓ} (n : HLevel) → Modality ℓ isModal (HLevelTruncModality n) = isOfHLevel n isModalIsProp (HLevelTruncModality n) = isPropIsOfHLevel n ◯ (HLevelTruncModality n) = hLevelTrunc n ◯-isModal (HLevelTruncModality n) = isOfHLevelTrunc n η (HLevelTruncModality zero) _ = tt* η (HLevelTruncModality (suc n)) = ∣_∣ ◯-elim (HLevelTruncModality zero) cB _ tt* = cB tt* .fst ◯-elim (HLevelTruncModality (suc n)) = elim ◯-elim-β (HLevelTruncModality zero) cB f a = cB tt* .snd (f a) ◯-elim-β (HLevelTruncModality (suc n)) = λ _ _ _ → refl ◯-=-isModal (HLevelTruncModality zero) x y = (isOfHLevelUnit* 1 x y) , (isOfHLevelUnit* 2 x y _) ◯-=-isModal (HLevelTruncModality (suc n)) = isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) -- universal property univTrunc : ∀ {ℓ} (n : HLevel) {B : TypeOfHLevel ℓ n} → Iso (hLevelTrunc n A → B .fst) (A → B .fst) univTrunc zero {B , lev} = isContr→Iso (isOfHLevelΠ 0 (λ _ → lev)) (isOfHLevelΠ 0 λ _ → lev) Iso.fun (univTrunc (suc n) {B , lev}) g a = g ∣ a ∣ Iso.inv (univTrunc (suc n) {B , lev}) = rec lev Iso.rightInv (univTrunc (suc n) {B , lev}) b = refl Iso.leftInv (univTrunc (suc n) {B , lev}) b = funExt (elim (λ x → isOfHLevelPath _ lev _ _) λ a → refl) -- functorial action map : {n : HLevel} {B : Type ℓ'} (g : A → B) → hLevelTrunc n A → hLevelTrunc n B map {n = zero} g = λ _ → tt* map {n = suc n} g = rec (isOfHLevelTrunc _) (λ a → ∣ g a ∣) mapCompIso : {n : HLevel} {B : Type ℓ'} → (Iso A B) → Iso (hLevelTrunc n A) (hLevelTrunc n B) mapCompIso {n = zero} {B} _ = isContr→Iso (isOfHLevelUnit* 0) (isOfHLevelUnit* 0) Iso.fun (mapCompIso {n = (suc n)} g) = map (Iso.fun g) Iso.inv (mapCompIso {n = (suc n)} g) = map (Iso.inv g) Iso.rightInv (mapCompIso {n = (suc n)} g) = elim (λ x → isOfHLevelPath _ (isOfHLevelTrunc _) _ _) λ b → cong ∣_∣ (Iso.rightInv g b) Iso.leftInv (mapCompIso {n = (suc n)} g) = elim (λ x → isOfHLevelPath _ (isOfHLevelTrunc _) _ _) λ a → cong ∣_∣ (Iso.leftInv g a) mapId : {n : HLevel} → ∀ t → map {n = n} (idfun A) t ≡ t mapId {n = 0} tt* = refl mapId {n = (suc n)} = elim (λ _ → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _) (λ _ → refl) -- equivalences to prop/set/groupoid truncations propTruncTrunc1Iso : Iso ∥ A ∥₁ (∥ A ∥ 1) Iso.fun propTruncTrunc1Iso = PropTrunc.rec (isOfHLevelTrunc 1) ∣_∣ Iso.inv propTruncTrunc1Iso = rec squash₁ ∣_∣₁ Iso.rightInv propTruncTrunc1Iso = elim (λ _ → isOfHLevelPath 1 (isOfHLevelTrunc 1) _ _) (λ _ → refl) Iso.leftInv propTruncTrunc1Iso = PropTrunc.elim (λ _ → isOfHLevelPath 1 squash₁ _ _) (λ _ → refl) propTrunc≃Trunc1 : ∥ A ∥₁ ≃ ∥ A ∥ 1 propTrunc≃Trunc1 = isoToEquiv propTruncTrunc1Iso propTrunc≡Trunc1 : ∥ A ∥₁ ≡ ∥ A ∥ 1 propTrunc≡Trunc1 = ua propTrunc≃Trunc1 setTruncTrunc2Iso : Iso ∥ A ∥₂ (∥ A ∥ 2) Iso.fun setTruncTrunc2Iso = SetTrunc.rec (isOfHLevelTrunc 2) ∣_∣ Iso.inv setTruncTrunc2Iso = rec squash₂ ∣_∣₂ Iso.rightInv setTruncTrunc2Iso = elim (λ _ → isOfHLevelPath 2 (isOfHLevelTrunc 2) _ _) (λ _ → refl) Iso.leftInv setTruncTrunc2Iso = SetTrunc.elim (λ _ → isOfHLevelPath 2 squash₂ _ _) (λ _ → refl) setTrunc≃Trunc2 : ∥ A ∥₂ ≃ ∥ A ∥ 2 setTrunc≃Trunc2 = isoToEquiv setTruncTrunc2Iso propTrunc≡Trunc2 : ∥ A ∥₂ ≡ ∥ A ∥ 2 propTrunc≡Trunc2 = ua setTrunc≃Trunc2 groupoidTruncTrunc3Iso : Iso ∥ A ∥₃ (∥ A ∥ 3) Iso.fun groupoidTruncTrunc3Iso = GpdTrunc.rec (isOfHLevelTrunc 3) ∣_∣ Iso.inv groupoidTruncTrunc3Iso = rec squash₃ ∣_∣₃ Iso.rightInv groupoidTruncTrunc3Iso = elim (λ _ → isOfHLevelPath 3 (isOfHLevelTrunc 3) _ _) (λ _ → refl) Iso.leftInv groupoidTruncTrunc3Iso = GpdTrunc.elim (λ _ → isOfHLevelPath 3 squash₃ _ _) (λ _ → refl) groupoidTrunc≃Trunc3 : ∥ A ∥₃ ≃ ∥ A ∥ 3 groupoidTrunc≃Trunc3 = isoToEquiv groupoidTruncTrunc3Iso groupoidTrunc≡Trunc3 : ∥ A ∥₃ ≡ ∥ A ∥ 3 groupoidTrunc≡Trunc3 = ua groupoidTrunc≃Trunc3 2GroupoidTruncTrunc4Iso : Iso ∥ A ∥₄ (∥ A ∥ 4) Iso.fun 2GroupoidTruncTrunc4Iso = 2GpdTrunc.rec (isOfHLevelTrunc 4) ∣_∣ Iso.inv 2GroupoidTruncTrunc4Iso = rec squash₄ ∣_∣₄ Iso.rightInv 2GroupoidTruncTrunc4Iso = elim (λ _ → isOfHLevelPath 4 (isOfHLevelTrunc 4) _ _) (λ _ → refl) Iso.leftInv 2GroupoidTruncTrunc4Iso = 2GpdTrunc.elim (λ _ → isOfHLevelPath 4 squash₄ _ _) (λ _ → refl) 2GroupoidTrunc≃Trunc4 : ∥ A ∥₄ ≃ ∥ A ∥ 4 2GroupoidTrunc≃Trunc4 = isoToEquiv 2GroupoidTruncTrunc4Iso 2GroupoidTrunc≡Trunc4 : ∥ A ∥₄ ≡ ∥ A ∥ 4 2GroupoidTrunc≡Trunc4 = ua 2GroupoidTrunc≃Trunc4 isContr→isContrTrunc : ∀ {ℓ} {A : Type ℓ} (n : ℕ) → isContr A → isContr (hLevelTrunc n A) isContr→isContrTrunc zero contr = isOfHLevelUnit* 0 isContr→isContrTrunc (suc n) contr = ∣ fst contr ∣ , (elim (λ _ → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _) λ a → cong ∣_∣ (snd contr a)) truncOfProdIso : (n : ℕ) → Iso (hLevelTrunc n (A × B)) (hLevelTrunc n A × hLevelTrunc n B) truncOfProdIso 0 = isContr→Iso (isOfHLevelUnit* 0) (isOfHLevel× 0 (isOfHLevelUnit* 0) (isOfHLevelUnit* 0)) Iso.fun (truncOfProdIso (suc n)) = rec (isOfHLevelΣ (suc n) (isOfHLevelTrunc (suc n)) (λ _ → isOfHLevelTrunc (suc n))) λ {(a , b) → ∣ a ∣ , ∣ b ∣} Iso.inv (truncOfProdIso (suc n)) (a , b) = rec (isOfHLevelTrunc (suc n)) (λ a → rec (isOfHLevelTrunc (suc n)) (λ b → ∣ a , b ∣) b) a Iso.rightInv (truncOfProdIso (suc n)) (a , b) = elim {B = λ a → Iso.fun (truncOfProdIso (suc n)) (Iso.inv (truncOfProdIso (suc n)) (a , b)) ≡ (a , b)} (λ _ → isOfHLevelPath (suc n) (isOfHLevelΣ (suc n) (isOfHLevelTrunc (suc n)) (λ _ → isOfHLevelTrunc (suc n))) _ _) (λ a → elim {B = λ b → Iso.fun (truncOfProdIso (suc n)) (Iso.inv (truncOfProdIso (suc n)) (∣ a ∣ , b)) ≡ (∣ a ∣ , b)} (λ _ → isOfHLevelPath (suc n) (isOfHLevelΣ (suc n) (isOfHLevelTrunc (suc n)) (λ _ → isOfHLevelTrunc (suc n))) _ _) (λ b → refl) b) a Iso.leftInv (truncOfProdIso (suc n)) = elim (λ _ → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _) λ a → refl ---- ∥ Ω A ∥ ₙ ≡ Ω ∥ A ∥ₙ₊₁ ---- {- Proofs of Theorem 7.3.12. and Corollary 7.3.13. in the HoTT book -} module ΩTrunc {X : Type ℓ} {n : HLevel} where {- We define the fibration P to show a more general result -} P : ∥ X ∥ (2 + n) → ∥ X ∥ (2 + n) → Type ℓ P x y = elim2 (λ _ _ → isOfHLevelTypeOfHLevel (suc n)) (λ a b → ∥ a ≡ b ∥ (suc n) , isOfHLevelTrunc (suc n)) x y .fst {- We will need P to be of hLevel n + 3 -} hLevelP : (a b : ∥ X ∥ (2 + n)) → isOfHLevel (2 + n) (P a b) hLevelP = elim2 (λ x y → isProp→isOfHLevelSuc (suc n) (isPropIsOfHLevel (2 + n))) (λ a b → isOfHLevelSuc (suc n) (isOfHLevelTrunc (suc n))) {- decode function from P x y to x ≡ y -} decode-fun : (x y : ∥ X ∥ (2 + n)) → P x y → x ≡ y decode-fun = elim2 (λ u v → isOfHLevelΠ (2 + n)(λ _ → isOfHLevelSuc (2 + n) (isOfHLevelTrunc (2 + n)) u v)) decode* where decode* : (u v : X) → P ∣ u ∣ ∣ v ∣ → Path (∥ X ∥ (2 + n)) ∣ u ∣ ∣ v ∣ decode* u v = rec (isOfHLevelTrunc (2 + n) ∣ u ∣ ∣ v ∣) (cong ∣_∣) {- auxiliary function r used to define encode -} r : (u : ∥ X ∥ (2 + n)) → P u u r = elim (λ x → hLevelP x x) (λ a → ∣ refl ∣) {- encode function from x ≡ y to P x y -} encode-fun : (x y : ∥ X ∥ (2 + n)) → x ≡ y → P x y encode-fun x y p = subst (P x) p (r x) {- We need the following two lemmas on the functions behaviour for refl -} dec-refl : (x : ∥ X ∥ (2 + n)) → decode-fun x x (r x) ≡ refl dec-refl = elim (λ x → isOfHLevelSuc (1 + n) (isOfHLevelSuc (1 + n) (isOfHLevelTrunc (2 + n) x x) (decode-fun x x (r x)) refl)) (λ _ → refl) enc-refl : (x : ∥ X ∥ (2 + n)) → encode-fun x x refl ≡ r x enc-refl x = transportRefl (r x) {- decode-fun is a right-inverse -} P-rinv : (u v : ∥ X ∥ (2 + n)) (x : Path (∥ X ∥ (2 + n)) u v) → decode-fun u v (encode-fun u v x) ≡ x P-rinv u v = J (λ y p → decode-fun u y (encode-fun u y p) ≡ p) (cong (decode-fun u u) (enc-refl u) ∙ dec-refl u) {- decode-fun is a left-inverse -} P-linv : (u v : ∥ X ∥ (2 + n)) (x : P u v) → encode-fun u v (decode-fun u v x) ≡ x P-linv = elim2 (λ x y → isOfHLevelΠ (2 + n) (λ z → isOfHLevelSuc (2 + n) (hLevelP x y) _ _)) helper where helper : (a b : X) (p : P ∣ a ∣ ∣ b ∣) → encode-fun _ _ (decode-fun ∣ a ∣ ∣ b ∣ p) ≡ p helper a b = elim (λ x → hLevelP ∣ a ∣ ∣ b ∣ _ _) (J (λ y p → encode-fun ∣ a ∣ ∣ y ∣ (decode-fun _ _ ∣ p ∣) ≡ ∣ p ∣) (enc-refl ∣ a ∣)) {- The final Iso established -} IsoFinal : (x y : ∥ X ∥ (2 + n)) → Iso (x ≡ y) (P x y) Iso.fun (IsoFinal x y) = encode-fun x y Iso.inv (IsoFinal x y) = decode-fun x y Iso.rightInv (IsoFinal x y) = P-linv x y Iso.leftInv (IsoFinal x y) = P-rinv x y PathIdTruncIso : {a b : A} (n : HLevel) → Iso (Path (∥ A ∥ (suc n)) ∣ a ∣ ∣ b ∣) (∥ a ≡ b ∥ n) PathIdTruncIso zero = isContr→Iso ((isOfHLevelTrunc 1 _ _) , isOfHLevelPath 1 (isOfHLevelTrunc 1) ∣ _ ∣ ∣ _ ∣ _) (isOfHLevelUnit* 0) PathIdTruncIso (suc n) = ΩTrunc.IsoFinal ∣ _ ∣ ∣ _ ∣ PathIdTrunc : {a b : A} (n : HLevel) → (Path (∥ A ∥ (suc n)) ∣ a ∣ ∣ b ∣) ≡ (∥ a ≡ b ∥ n) PathIdTrunc n = isoToPath (PathIdTruncIso n) PathΩ : {a : A} (n : HLevel) → (Path (∥ A ∥ (suc n)) ∣ a ∣ ∣ a ∣) ≡ (∥ a ≡ a ∥ n) PathΩ n = PathIdTrunc n {- Special case using direct defs of truncations -} PathIdTrunc₀Iso : {a b : A} → Iso (∣ a ∣₂ ≡ ∣ b ∣₂) ∥ a ≡ b ∥₁ PathIdTrunc₀Iso = compIso (congIso setTruncTrunc2Iso) (compIso (ΩTrunc.IsoFinal ∣ _ ∣ ∣ _ ∣) (invIso propTruncTrunc1Iso)) ------------------------- truncOfTruncIso : (n m : HLevel) → Iso (hLevelTrunc n A) (hLevelTrunc n (hLevelTrunc (m + n) A)) truncOfTruncIso zero m = isContr→Iso (isOfHLevelUnit* 0) (isOfHLevelUnit* 0) Iso.fun (truncOfTruncIso (suc n) zero) = rec (isOfHLevelTrunc (suc n)) λ a → ∣ ∣ a ∣ ∣ Iso.fun (truncOfTruncIso (suc n) (suc m)) = rec (isOfHLevelTrunc (suc n)) λ a → ∣ ∣ a ∣ ∣ Iso.inv (truncOfTruncIso (suc n) zero) = rec (isOfHLevelTrunc (suc n)) (rec (isOfHLevelTrunc (suc n)) λ a → ∣ a ∣) Iso.inv (truncOfTruncIso (suc n) (suc m)) = rec (isOfHLevelTrunc (suc n)) (rec (isOfHLevelPlus (suc m) (isOfHLevelTrunc (suc n))) λ a → ∣ a ∣) Iso.rightInv (truncOfTruncIso (suc n) zero) = elim (λ x → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _ ) (elim (λ x → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _ ) λ a → refl) Iso.rightInv (truncOfTruncIso (suc n) (suc m)) = elim (λ x → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _ ) (elim (λ x → isOfHLevelPath ((suc m) + (suc n)) (isOfHLevelPlus (suc m) (isOfHLevelTrunc (suc n))) _ _ ) λ a → refl) Iso.leftInv (truncOfTruncIso (suc n) zero) = elim (λ x → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _) λ a → refl Iso.leftInv (truncOfTruncIso (suc n) (suc m)) = elim (λ x → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _) λ a → refl truncOfTruncEq : (n m : ℕ) → (hLevelTrunc n A) ≃ (hLevelTrunc n (hLevelTrunc (m + n) A)) truncOfTruncEq n m = isoToEquiv (truncOfTruncIso n m) truncOfTruncIso2 : (n m : HLevel) → Iso (hLevelTrunc (m + n) (hLevelTrunc n A)) (hLevelTrunc n A) truncOfTruncIso2 n m = truncIdempotentIso (m + n) (isOfHLevelPlus m (isOfHLevelTrunc n)) truncOfΣIso : ∀ {ℓ ℓ'} (n : HLevel) {A : Type ℓ} {B : A → Type ℓ'} → Iso (hLevelTrunc n (Σ A B)) (hLevelTrunc n (Σ A λ x → hLevelTrunc n (B x))) truncOfΣIso zero = idIso Iso.fun (truncOfΣIso (suc n)) = map λ {(a , b) → a , ∣ b ∣} Iso.inv (truncOfΣIso (suc n)) = rec (isOfHLevelTrunc (suc n)) (uncurry λ a → rec (isOfHLevelTrunc (suc n)) λ b → ∣ a , b ∣) Iso.rightInv (truncOfΣIso (suc n)) = elim (λ _ → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _) (uncurry λ a → elim (λ _ → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _) λ b → refl) Iso.leftInv (truncOfΣIso (suc n)) = elim (λ _ → isOfHLevelPath (suc n) (isOfHLevelTrunc (suc n)) _ _) λ {(a , b) → refl}
src/llc/LLC.agda
kcaliban/ldlc
0
246
<filename>src/llc/LLC.agda -- simply-typed labelled λ-calculus w/ DeBruijn indices -- {-# OPTIONS --show-implicit #-} module LLC where open import Agda.Primitive open import Agda.Builtin.Bool open import Data.Bool.Properties hiding (≤-trans ; <-trans ; ≤-refl ; <-irrefl) open import Data.Empty open import Data.Nat renaming (_+_ to _+ᴺ_ ; _≤_ to _≤ᴺ_ ; _≥_ to _≥ᴺ_ ; _<_ to _<ᴺ_ ; _>_ to _>ᴺ_ ; _≟_ to _≟ᴺ_) open import Data.Nat.Properties renaming (_<?_ to _<ᴺ?_) open import Data.Integer renaming (_+_ to _+ᶻ_ ; _≤_ to _≤ᶻ_ ; _≥_ to _≥ᶻ_ ; _<_ to _<ᶻ_ ; _>_ to _>ᶻ_) open import Data.Integer.Properties using (⊖-≥ ; 0≤n⇒+∣n∣≡n ; +-monoˡ-≤) open import Data.List open import Data.List.Relation.Unary.All open import Relation.Unary using (Decidable) open import Data.Vec.Relation.Unary.Any open import Data.Vec.Base hiding (length ; _++_ ; foldr) open import Relation.Binary.PropositionalEquality renaming (trans to ≡-trans) open import Relation.Nullary open import Relation.Nullary.Decidable open import Relation.Nullary.Negation open import Data.Fin open import Data.Fin.Subset renaming (∣_∣ to ∣_∣ˢ) open import Data.Fin.Subset.Properties using (anySubset?) open import Data.Fin.Properties using (any?) open import Data.Product open import Data.Sum open import Function open import Extensionality open import Auxiliary module defs where data Exp {n : ℕ} : Set where Var : ℕ → Exp {n} Abs : Exp {n} → Exp {n} App : Exp {n} → Exp {n} → Exp {n} LabI : Fin n → Exp {n} LabE : {s : Subset n} → (f : ∀ l → l ∈ s → Exp {n}) → Exp {n} → Exp {n} data Ty {n : ℕ} : Set where Fun : Ty {n} → Ty {n} → Ty Label : Subset n → Ty -- shifting and substitution -- shifting, required to avoid variable-capturing in substitution -- see Pierce 2002, pg. 78/79 ↑ᴺ_,_[_] : ℤ → ℕ → ℕ → ℕ ↑ᴺ d , c [ x ] with (x <ᴺ? c) ... | yes p = x ... | no ¬p = ∣ ℤ.pos x +ᶻ d ∣ ↑_,_[_] : ∀ {n} → ℤ → ℕ → Exp {n} → Exp ↑ d , c [ Var x ] = Var (↑ᴺ d , c [ x ]) ↑ d , c [ Abs t ] = Abs (↑ d , (ℕ.suc c) [ t ]) ↑ d , c [ App t t₁ ] = App (↑ d , c [ t ]) (↑ d , c [ t₁ ]) ↑ d , c [ LabI x ] = LabI x ↑ d , c [ LabE f e ] = LabE (λ l x → ↑ d , c [ (f l x) ]) (↑ d , c [ e ]) -- shorthands ↑¹[_] : ∀ {n} → Exp {n} → Exp ↑¹[ e ] = ↑ (ℤ.pos 1) , 0 [ e ] ↑⁻¹[_] : ∀ {n} → Exp {n} → Exp ↑⁻¹[ e ] = ↑ (ℤ.negsuc 0) , 0 [ e ] -- substitution -- see Pierce 2002, pg. 80 [_↦_]_ : ∀ {n} → ℕ → Exp {n} → Exp → Exp [ k ↦ s ] Var x with (_≟ᴺ_ x k) ... | yes p = s ... | no ¬p = Var x [ k ↦ s ] Abs t = Abs ([ ℕ.suc k ↦ ↑¹[ s ] ] t) [ k ↦ s ] App t t₁ = App ([ k ↦ s ] t) ([ k ↦ s ] t₁) [ k ↦ s ] LabI ins = LabI ins [ k ↦ s ] LabE f e = LabE (λ l x → [ k ↦ s ] (f l x)) ([ k ↦ s ] e) -- variable in expression data _∈`_ {N : ℕ} : ℕ → Exp {N} → Set where in-Var : {n : ℕ} → n ∈` Var n in-Abs : {n : ℕ} {e : Exp} → (ℕ.suc n) ∈` e → n ∈` Abs e in-App : {n : ℕ} {e e' : Exp} → n ∈` e ⊎ n ∈` e' → n ∈` App e e' in-LabE : {n : ℕ} {s : Subset N} {f : (∀ l → l ∈ s → Exp {N})} {e : Exp {N}} → (∃₂ λ l i → n ∈` (f l i)) ⊎ n ∈` e → n ∈` LabE {N} {s} f e -- typing Env : {ℕ} → Set Env {n} = List (Ty {n}) data _∶_∈_ {n : ℕ} : ℕ → Ty {n} → Env {n} → Set where here : {T : Ty} {Γ : Env} → 0 ∶ T ∈ (T ∷ Γ) there : {n : ℕ} {T₁ T₂ : Ty} {Γ : Env} → n ∶ T₁ ∈ Γ → (ℕ.suc n) ∶ T₁ ∈ (T₂ ∷ Γ) data _⊢_∶_ {n : ℕ} : Env {n} → Exp {n} → Ty {n} → Set where TVar : {m : ℕ} {Γ : Env} {T : Ty} → m ∶ T ∈ Γ → Γ ⊢ (Var m) ∶ T TAbs : {Γ : Env} {T₁ T₂ : Ty} {e : Exp} → (T₁ ∷ Γ) ⊢ e ∶ T₂ → Γ ⊢ (Abs e) ∶ (Fun T₁ T₂) TApp : {Γ : Env} {T₁ T₂ : Ty} {e₁ e₂ : Exp} → Γ ⊢ e₁ ∶ (Fun T₁ T₂) → Γ ⊢ e₂ ∶ T₁ → Γ ⊢ (App e₁ e₂) ∶ T₂ TLabI : {Γ : Env} {x : Fin n} {s : Subset n} → (ins : x ∈ s) → Γ ⊢ LabI x ∶ Label {n} s TLabEl : {Γ : Env} {T : Ty} {s : Subset n} {x : Fin n} {ins : x ∈ s} {f : ∀ l → l ∈ s → Exp} {scopecheck : ∀ l i n → n ∈` (f l i) → n <ᴺ length Γ} → Γ ⊢ f x ins ∶ T → Γ ⊢ LabI {n} x ∶ Label {n} s → Γ ⊢ LabE {n} {s} f (LabI {n} x) ∶ T TLabEx : {Γ : Env} {T : Ty} {m : ℕ} {s : Subset n} {f : ∀ l → l ∈ s → Exp} → (f' : ∀ l i → (Γ ⊢ [ m ↦ (LabI l) ] (f l i) ∶ T)) → Γ ⊢ Var m ∶ Label {n} s → Γ ⊢ LabE {n} {s} f (Var m) ∶ T -- denotational semantics module denotational where open defs Val : {n : ℕ} → Ty {n} → Set Val (Fun Ty₁ Ty₂) = (Val Ty₁) → (Val Ty₂) Val {n} (Label s) = Σ (Fin n) (λ x → x ∈ s) access : {n m : ℕ} {Γ : Env {n}} {T : Ty {n}} → m ∶ T ∈ Γ → All Val Γ → Val T access here (V ∷ Γ) = V access (there J) (V ∷ Γ) = access J Γ eval : {n : ℕ} {Γ : Env {n}} {T : Ty {n}} {e : Exp {n}} → Γ ⊢ e ∶ T → All Val Γ → Val T eval (TVar c) Val-Γ = access c Val-Γ eval (TAbs TJ) Val-Γ = λ V → eval TJ (V ∷ Val-Γ) eval (TApp TJ TJ₁) Val-Γ = (eval TJ Val-Γ) (eval TJ₁ Val-Γ) eval (TLabI {x = x} ins) Val-Γ = x , ins eval (TLabEl {x = x}{ins = ins}{f = f} j j') Val-Γ = eval j Val-Γ eval (TLabEx {m = m}{s}{f} f' j) Val-Γ with eval j Val-Γ -- evaluate variable ... | x , ins = eval (f' x ins) Val-Γ -- operational semantics (call-by-value) module operational where open defs data Val {n : ℕ} : Exp {n} → Set where VFun : {e : Exp} → Val (Abs e) VLab : {x : Fin n} → Val (LabI x) -- reduction relation data _⇒_ {n : ℕ} : Exp {n} → Exp {n} → Set where ξ-App1 : {e₁ e₁' e₂ : Exp} → e₁ ⇒ e₁' → App e₁ e₂ ⇒ App e₁' e₂ ξ-App2 : {e e' v : Exp} → Val v → e ⇒ e' → App v e ⇒ App v e' β-App : {e v : Exp} → Val v → (App (Abs e) v) ⇒ (↑⁻¹[ ([ 0 ↦ ↑¹[ v ] ] e) ]) β-LabE : {s : Subset n} {f : ∀ l → l ∈ s → Exp} {x : Fin n} → (ins : x ∈ s) → LabE f (LabI x) ⇒ f x ins ---- properties & lemmas --- properties of shifting -- ∣ + x +ᶻ k ∣ +ᴺ m ≡ ∣ + (x +ᴺ m) +ᶻ k ∣ aux-calc-1 : {x m : ℕ} {k : ℤ} → k >ᶻ + 0 → ∣ + x +ᶻ k ∣ +ᴺ m ≡ ∣ + (x +ᴺ m) +ᶻ k ∣ aux-calc-1 {x} {m} {+_ n} ge rewrite (+-assoc x n m) | (+-comm n m) | (sym (+-assoc x m n)) = refl ↑ᴺk,l[x]+m≡↑ᴺk,l+m[x+m] : {k : ℤ} {l x m : ℕ} → k >ᶻ + 0 → ↑ᴺ k , l [ x ] +ᴺ m ≡ ↑ᴺ k , l +ᴺ m [ x +ᴺ m ] ↑ᴺk,l[x]+m≡↑ᴺk,l+m[x+m] {k} {l} {x} {m} ge with x <ᴺ? l ... | yes p with x +ᴺ m <ᴺ? l +ᴺ m ... | yes q = refl ... | no ¬q = contradiction (+-monoˡ-< m p) ¬q ↑ᴺk,l[x]+m≡↑ᴺk,l+m[x+m] {k} {l} {x} {m} ge | no ¬p with x +ᴺ m <ᴺ? l +ᴺ m ... | yes q = contradiction q (<⇒≱ (+-monoˡ-< m (≰⇒> ¬p))) ... | no ¬q = aux-calc-1 ge -- corollary for suc suc[↑ᴺk,l[x]]≡↑ᴺk,sucl[sucx] : {k : ℤ} {l x : ℕ} → k >ᶻ + 0 → ℕ.suc (↑ᴺ k , l [ x ]) ≡ ↑ᴺ k , ℕ.suc l [ ℕ.suc x ] suc[↑ᴺk,l[x]]≡↑ᴺk,sucl[sucx] {k} {l} {x} ge with (↑ᴺk,l[x]+m≡↑ᴺk,l+m[x+m] {k} {l} {x} {1} ge) ... | w rewrite (n+1≡sucn{↑ᴺ k , l [ x ]}) | (n+1≡sucn{x}) | (n+1≡sucn{l}) = w ↑-var-refl : {n : ℕ} {d : ℤ} {c : ℕ} {x : ℕ} {le : ℕ.suc x ≤ᴺ c} → ↑ d , c [ Var {n} x ] ≡ Var x ↑-var-refl {n} {d} {c} {x} {le} with (x <ᴺ? c) ... | no ¬p = contradiction le ¬p ... | yes p = refl ↑¹-var : {n x : ℕ} → ↑¹[ Var {n} x ] ≡ Var (ℕ.suc x) ↑¹-var {n} {zero} = refl ↑¹-var {n} {ℕ.suc x} rewrite (sym (n+1≡sucn{x +ᴺ 1})) | (sym (n+1≡sucn{x})) = cong ↑¹[_] (↑¹-var{n}{x}) ↑⁻¹ₖ[↑¹ₖ[s]]≡s : {n : ℕ} {e : Exp {n} } {k : ℕ} → ↑ -[1+ 0 ] , k [ ↑ + 1 , k [ e ] ] ≡ e ↑⁻¹ₖ[↑¹ₖ[s]]≡s {n} {Var x} {k} with (x <ᴺ? k) -- x < k -- => ↑⁻¹ₖ(↑¹ₖ(Var n)) = ↑⁻¹ₖ(Var n) = Var n ... | yes p = ↑-var-refl{n}{ -[1+ 0 ]}{k}{x}{p} -- x ≥ k -- => ↑⁻¹ₖ(↑¹ₖ(Var n)) = ↑⁻¹ₖ(Var |n + 1|) = Var (||n + 1| - 1|) = Var n ... | no ¬p with (¬[x≤k]⇒¬[sucx≤k] ¬p) ... | ¬p' with (x +ᴺ 1) <ᴺ? k ... | yes pp = contradiction pp ¬p' ... | no ¬pp rewrite (∣nℕ+1⊖1∣≡n{x}) = refl ↑⁻¹ₖ[↑¹ₖ[s]]≡s {n} {Abs e} {k} = cong Abs ↑⁻¹ₖ[↑¹ₖ[s]]≡s ↑⁻¹ₖ[↑¹ₖ[s]]≡s {n} {App e e₁} = cong₂ App ↑⁻¹ₖ[↑¹ₖ[s]]≡s ↑⁻¹ₖ[↑¹ₖ[s]]≡s ↑⁻¹ₖ[↑¹ₖ[s]]≡s {n} {LabI ins} = refl ↑⁻¹ₖ[↑¹ₖ[s]]≡s {n} {LabE f e} = cong₂ LabE (f-ext (λ x → f-ext (λ ins → ↑⁻¹ₖ[↑¹ₖ[s]]≡s))) ↑⁻¹ₖ[↑¹ₖ[s]]≡s ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] : {n : ℕ} {k l : ℤ} {c : ℕ} {s : Exp {n}} → l ≥ᶻ +0 → ↑ k , c [ ↑ l , c [ s ] ] ≡ ↑ (l +ᶻ k) , c [ s ] ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {n} {k} {l} {c} {Var x} ge with x <ᴺ? c ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {n} {k} {l} {c} {Var x} ge | no ¬p with ∣ + x +ᶻ l ∣ <ᴺ? c ... | yes q = contradiction q (<⇒≱ (n≤m⇒n<sucm (≤-trans (≮⇒≥ ¬p) (m≥0⇒∣n+m∣≥n ge)))) ... | no ¬q rewrite (0≤n⇒+∣n∣≡n{+ x +ᶻ l} (m≥0⇒n+m≥0 ge)) | (Data.Integer.Properties.+-assoc (+_ x) l k) = refl ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {n} {k} {l} {c} {Var x} ge | yes p with x <ᴺ? c ... | yes p' = refl ... | no ¬p' = contradiction p ¬p' ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {n} {k} {l} {c} {Abs s} le = cong Abs (↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s]{n}{k}{l}{ℕ.suc c}{s} le) ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {n} {k} {l} {c} {App s s₁} le = cong₂ App (↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s]{n}{k}{l}{c}{s} le) (↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s]{n}{k}{l}{c}{s₁} le) ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {n} {k} {l} {c} {LabI ins} le = refl ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {n} {k} {l} {c} {LabE f e} le = cong₂ LabE (f-ext (λ x → f-ext (λ ins → ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {n} {k} {l} {c} {f x ins} le))) ( ↑ᵏ[↑ˡ[s]]≡↑ᵏ⁺ˡ[s] {n} {k} {l} {c} {e} le) ↑k,q[↑l,c[s]]≡↑l+k,c[s] : {n : ℕ} {k l : ℤ} {q c : ℕ} {s : Exp {n}} → + q ≤ᶻ + c +ᶻ l → c ≤ᴺ q → ↑ k , q [ ↑ l , c [ s ] ] ≡ ↑ (l +ᶻ k) , c [ s ] ↑k,q[↑l,c[s]]≡↑l+k,c[s] {n} {k} {l} {q} {c} {Var x} ge₁ ge₂ with x <ᴺ? c ... | yes p with x <ᴺ? q ... | yes p' = refl ... | no ¬p' = contradiction (≤-trans p ge₂) ¬p' ↑k,q[↑l,c[s]]≡↑l+k,c[s] {n} {k} {l} {q} {c} {Var x} ge₁ ge₂ | no ¬p with ∣ + x +ᶻ l ∣ <ᴺ? q ... | yes p' = contradiction p' (≤⇒≯ (+a≤b⇒a≤∣b∣{q}{+ x +ᶻ l} (Data.Integer.Properties.≤-trans ge₁ ((Data.Integer.Properties.+-monoˡ-≤ l (+≤+ (≮⇒≥ ¬p))))))) ... | no ¬p' rewrite (0≤n⇒+∣n∣≡n{+ x +ᶻ l} (Data.Integer.Properties.≤-trans (+≤+ z≤n) ((Data.Integer.Properties.≤-trans ge₁ ((Data.Integer.Properties.+-monoˡ-≤ l (+≤+ (≮⇒≥ ¬p)))))))) | (Data.Integer.Properties.+-assoc (+_ x) l k) = refl ↑k,q[↑l,c[s]]≡↑l+k,c[s] {n} {k} {l} {q} {c} {Abs s} ge₁ ge₂ = cong Abs (↑k,q[↑l,c[s]]≡↑l+k,c[s] {n} {k} {l} {ℕ.suc q} {ℕ.suc c} {s} (+q≤+c+l⇒+1q≤+1c+l{q}{c}{l} ge₁) (s≤s ge₂)) ↑k,q[↑l,c[s]]≡↑l+k,c[s] {n} {k} {l} {q} {c} {App s s₁} ge₁ ge₂ = cong₂ App (↑k,q[↑l,c[s]]≡↑l+k,c[s] {n} {k} {l} {q} {c} {s} ge₁ ge₂) (↑k,q[↑l,c[s]]≡↑l+k,c[s]{n} {k} {l} {q} {c} {s₁} ge₁ ge₂) ↑k,q[↑l,c[s]]≡↑l+k,c[s] {n} {k} {l} {q} {c} {LabI e} ge₁ ge₂ = refl ↑k,q[↑l,c[s]]≡↑l+k,c[s] {n} {k} {l} {q} {c} {LabE f e} ge₁ ge₂ = cong₂ LabE (f-ext (λ x → f-ext (λ ins → ↑k,q[↑l,c[s]]≡↑l+k,c[s] {n} {k} {l} {q} {c} {f x ins} ge₁ ge₂))) (↑k,q[↑l,c[s]]≡↑l+k,c[s] {n} {k} {l} {q} {c} {e} ge₁ ge₂) aux-calc-2 : {x l : ℕ} {k : ℤ} → k >ᶻ + 0 → ∣ + (x +ᴺ l) +ᶻ k ∣ ≡ ∣ + x +ᶻ k ∣ +ᴺ l aux-calc-2 {x} {l} {+_ n} ge rewrite (+-assoc x l n) | (+-comm l n) | (+-assoc x n l) = refl ↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]] : {n : ℕ} {k : ℤ} {q c l : ℕ} {s : Exp {n}} → c ≤ᴺ q → + 0 <ᶻ k → ↑ k , q +ᴺ l [ ↑ + l , c [ s ] ] ≡ ↑ + l , c [ ↑ k , q [ s ] ] ↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]] {n} {k} {q} {c} {l} {Var x} le le' with x <ᴺ? q ... | yes p with x <ᴺ? c ... | yes p' with x <ᴺ? q +ᴺ l ... | yes p'' = refl ... | no ¬p'' = contradiction (≤-stepsʳ l p) ¬p'' ↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]] {n} {k} {q} {c} {l} {Var x} le le' | yes p | no ¬p' with x +ᴺ l <ᴺ? q +ᴺ l ... | yes p'' = refl ... | no ¬p'' = contradiction (Data.Nat.Properties.+-monoˡ-≤ l p) ¬p'' ↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]] {n} {k} {q} {c} {l} {Var x} le le' | no ¬p with x <ᴺ? c ... | yes p' = contradiction p' (<⇒≱ (a≤b<c⇒a<c le (≰⇒> ¬p))) ... | no ¬p' with x +ᴺ l <ᴺ? q +ᴺ l | ∣ + x +ᶻ k ∣ <ᴺ? c ... | _ | yes p''' = contradiction p''' (<⇒≱ (a≤b<c⇒a<c (≰⇒≥ ¬p') (s≤s (m>0⇒∣n+m∣>n {x} {k} le')))) ... | yes p'' | _ = contradiction p'' (<⇒≱ (+-monoˡ-< l (≰⇒> ¬p))) ... | no ¬p'' | no ¬p''' = cong Var (aux-calc-2 {x} {l} {k} le') ↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]] {n} {k} {q} {c} {l} {Abs s} le le' = cong Abs (↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]] {n} {k} {ℕ.suc q} {ℕ.suc c} {l} {s} (s≤s le) le') ↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]] {n} {k} {q} {c} {l} {App s s₁} le le' = cong₂ App (↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]] {n} {k} {q} {c} {l} {s} le le') (↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]] {n} {k} {q} {c} {l} {s₁} le le') ↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]] {n} {k} {q} {c} {l} {LabI x} le le' = refl ↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]] {n} {k} {q} {c} {l} {LabE f s} le le' = cong₂ LabE (f-ext (λ x → f-ext (λ ins → ↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]] {n} {k} {q} {c} {l} {f x ins} le le'))) (↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]] {n} {k} {q} {c} {l} {s} le le') -- corollary ↑k,sucq[↑1,c[s]]≡↑1,c[↑k,q[s]] : {n : ℕ} {k : ℤ} {q c : ℕ} {s : Exp {n}} → c ≤ᴺ q → + 0 <ᶻ k → ↑ k , ℕ.suc q [ ↑ + 1 , c [ s ] ] ≡ ↑ + 1 , c [ ↑ k , q [ s ] ] ↑k,sucq[↑1,c[s]]≡↑1,c[↑k,q[s]] {n} {k} {q} {c} {s} le le' rewrite (sym (n+1≡sucn{q})) = ↑k,q+l[↑l,c[s]]≡↑l,c[↑k,q[s]]{n}{k}{q}{c}{1}{s} le le' ↑Lab-triv : {n : ℕ} {l : Fin n} (k : ℤ) (q : ℕ) → LabI l ≡ ↑ k , q [ LabI l ] ↑Lab-triv {n} {l} k q = refl ↑ᴺ-triv : {m : ℤ} {n x : ℕ} → x ≥ᴺ n → ↑ᴺ m , n [ x ] ≡ ∣ + x +ᶻ m ∣ ↑ᴺ-triv {m} {n} {x} ge with x <ᴺ? n ... | yes p = contradiction p (≤⇒≯ ge) ... | no ¬p = refl ↑ᴺ⁰-refl : {n : ℕ} {c : ℕ} {x : ℕ} → ↑ᴺ + 0 , c [ x ] ≡ x ↑ᴺ⁰-refl {n} {c} {x} with x <ᴺ? c ... | yes p = refl ... | no ¬p = +-identityʳ x ↑⁰-refl : {n : ℕ} {c : ℕ} {e : Exp {n}} → ↑ + 0 , c [ e ] ≡ e ↑⁰-refl {n} {c} {Var x} = cong Var (↑ᴺ⁰-refl{n}{c}{x}) ↑⁰-refl {n} {c} {Abs e} = cong Abs (↑⁰-refl{n}{ℕ.suc c}{e}) ↑⁰-refl {n} {c} {App e e₁} = cong₂ App (↑⁰-refl{n}{c}{e}) (↑⁰-refl{n}{c}{e₁}) ↑⁰-refl {n} {c} {LabI x} = refl ↑⁰-refl {n} {c} {LabE x e} = cong₂ LabE (f-ext (λ l → f-ext λ i → ↑⁰-refl{n}{c}{x l i})) (↑⁰-refl{n}{c}{e}) --- properties of substitution subst-trivial : {n : ℕ} {x : ℕ} {s : Exp {n}} → [ x ↦ s ] Var x ≡ s subst-trivial {n} {x} {s} with x Data.Nat.≟ x ... | no ¬p = contradiction refl ¬p ... | yes p = refl var-subst-refl : {N n m : ℕ} {neq : n ≢ m} {e : Exp {N}} → [ n ↦ e ] (Var m) ≡ (Var m) var-subst-refl {N} {n} {m} {neq} {e} with _≟ᴺ_ n m | map′ (≡ᵇ⇒≡ m n) (≡⇒≡ᵇ m n) (Data.Bool.Properties.T? (m ≡ᵇ n)) ... | yes p | _ = contradiction p neq ... | no ¬p | yes q = contradiction q (≢-sym ¬p) ... | no ¬p | no ¬q = refl -- inversive lemma for variable in expression relation inv-in-var : {N n m : ℕ} → _∈`_ {N} n (Var m) → n ≡ m inv-in-var {N} {n} {.n} in-Var = refl inv-in-abs : {N n : ℕ} {e : Exp {N}} → _∈`_ {N} n (Abs e) → (ℕ.suc n) ∈` e inv-in-abs {N} {n} {e} (in-Abs i) = i inv-in-app : {N n : ℕ} {e e' : Exp {N}} → _∈`_ {N} n (App e e') → (_∈`_ n e ⊎ _∈`_ n e') inv-in-app {N} {n} {e} {e'} (in-App d) = d inv-in-labe : {N n : ℕ} {s : Subset N} {f : (∀ l → l ∈ s → Exp {N})} {e : Exp {N}} → _∈`_ {N} n (LabE {N} {s} f e) → (∃₂ λ l i → n ∈` (f l i)) ⊎ n ∈` e inv-in-labe {N} {n} {s} {f} {e} (in-LabE d) = d notin-shift : {N n k q : ℕ} {e : Exp {N}} → n ≥ᴺ q → ¬ n ∈` e → ¬ ((n +ᴺ k) ∈` ↑ + k , q [ e ]) notin-shift {N} {n} {k} {q} {Var x} geq j z with x <ᴺ? q ... | no ¬p with x ≟ᴺ n ... | yes p' rewrite p' = contradiction in-Var j ... | no ¬p' with cong (_∸ k) (inv-in-var z) ... | w rewrite (m+n∸n≡m n k) | (m+n∸n≡m x k) = contradiction (sym w) ¬p' notin-shift {N} {n} {k} {q} {Var .(n +ᴺ k)} geq j in-Var | yes p = contradiction geq (<⇒≱ (≤-trans (s≤s (m≤m+n n k)) p)) -- q ≤ n VS ℕ.suc (n + k) ≤ n notin-shift {N} {n} {k} {q} {Abs e} geq j (in-Abs x) = notin-shift (s≤s geq) (λ x₁ → contradiction (in-Abs x₁) j) x notin-shift {N} {n} {k} {q} {App e e₁} geq j z with dm2 (contraposition in-App j) | (inv-in-app z) ... | fst , snd | inj₁ x = notin-shift geq fst x ... | fst , snd | inj₂ y = notin-shift geq snd y notin-shift {N} {n} {k} {q} {LabI x} geq j () notin-shift {N} {n} {k} {q} {LabE f e} geq j z with dm2 (contraposition in-LabE j) | (inv-in-labe z) ... | fst , snd | inj₂ y = notin-shift geq snd y ... | fst , snd | inj₁ (fst₁ , fst₂ , snd₁) = notin-shift geq (¬∃⟶∀¬ (¬∃⟶∀¬ fst fst₁) fst₂) snd₁ -- corollary notin-shift-one : {N n : ℕ} {e : Exp{N}} → ¬ n ∈` e → ¬ (ℕ.suc n ∈` ↑¹[ e ]) notin-shift-one {N} {n} {e} nin rewrite (sym (n+1≡sucn{n})) = notin-shift{N}{n}{1} z≤n nin -- if n ∉ fv(e), then substitution of n does not do anything subst-refl-notin : {N n : ℕ} {e e' : Exp {N}} → ¬ n ∈` e → [ n ↦ e' ] e ≡ e subst-refl-notin {N} {n} {Var x} {e'} nin with x ≟ᴺ n ... | yes p rewrite p = contradiction in-Var nin ... | no ¬p = refl subst-refl-notin {N} {n} {Abs e} {e'} nin = cong Abs (subst-refl-notin (contraposition in-Abs nin)) subst-refl-notin {N} {n} {App e e₁} {e'} nin with dm2 (contraposition in-App nin) ... | fst , snd = cong₂ App (subst-refl-notin fst) (subst-refl-notin snd) subst-refl-notin {N} {n} {LabI x} {e'} nin = refl subst-refl-notin {N} {n} {LabE x e} {e'} nin with dm2 (contraposition in-LabE nin) ... | fst , snd = cong₂ LabE (f-ext (λ l → f-ext (λ x₁ → subst-refl-notin{e' = e'} (¬∃⟶∀¬ (¬∃⟶∀¬ (fst) l) x₁)))) (subst-refl-notin (snd)) notin-subst : {N n : ℕ} {e e' : Exp {N}} → ¬ n ∈` e' → ¬ (n ∈` ([ n ↦ e' ] e)) notin-subst {N} {n} {Var x} {e'} nin with x ≟ᴺ n ... | yes p = nin ... | no ¬p = λ x₁ → contradiction (inv-in-var x₁) (≢-sym ¬p) notin-subst {N} {n} {Abs e} {e'} nin with notin-shift{k = 1} z≤n nin ... | w rewrite (n+1≡sucn{n}) = λ x → notin-subst {n = ℕ.suc n} {e = e} {e' = ↑¹[ e' ]} w (inv-in-abs x) notin-subst {N} {n} {App e e₁} {e'} nin (in-App z) with z ... | inj₁ x = notin-subst{e = e} nin x ... | inj₂ y = notin-subst{e = e₁} nin y notin-subst {N} {n} {LabI x} {e'} nin = λ () notin-subst {N} {n} {LabE f e} {e'} nin (in-LabE z) with z ... | inj₁ (fst , fst₁ , snd) = notin-subst{e = f fst fst₁} nin snd ... | inj₂ y = notin-subst{e = e} nin y subst2-refl-notin : {N n : ℕ} {e e' s : Exp {N}} → ¬ n ∈` e' → [ n ↦ e ] ([ n ↦ e' ] s) ≡ [ n ↦ e' ] s subst2-refl-notin {N} {n} {e} {e'} {s} nin = subst-refl-notin (notin-subst{e = s} nin) -- if n ∈ [ m ↦ s ] e, n ∉ s, then n ≢ m subst-in-neq : {N n m : ℕ} {e s : Exp{N}} → ¬ n ∈` s → n ∈` ([ m ↦ s ] e) → n ≢ m subst-in-neq {N} {n} {m} {Var x} {s} nin ins with x ≟ᴺ m ... | yes p = contradiction ins nin subst-in-neq {N} {.x} {m} {Var x} {s} nin in-Var | no ¬p = ¬p subst-in-neq {N} {n} {m} {Abs e} {s} nin (in-Abs ins) = sucn≢sucm⇒n≢m (subst-in-neq{e = e} (notin-shift-one nin) ins) subst-in-neq {N} {n} {m} {App e e₁} {s} nin (in-App (inj₁ x)) = subst-in-neq{e = e} nin x subst-in-neq {N} {n} {m} {App e e₁} {s} nin (in-App (inj₂ y)) = subst-in-neq{e = e₁} nin y subst-in-neq {N} {n} {m} {LabE f e} {s} nin (in-LabE (inj₁ (fst , fst₁ , snd))) = subst-in-neq{e = f fst fst₁} nin snd subst-in-neq {N} {n} {m} {LabE f e} {s} nin (in-LabE (inj₂ y)) = subst-in-neq{e = e} nin y -- if n ≢ m, n ∈` e, then n ∈` [ m ↦ e' ] e subst-in : {N n m : ℕ} {e e' : Exp {N}} → n ≢ m → n ∈` e → n ∈` ([ m ↦ e' ] e) subst-in {N} {n} {m} {Var x} {e'} neq (in-Var) with n ≟ᴺ m ... | yes p = contradiction p neq ... | no ¬p = in-Var subst-in {N} {n} {m} {Abs e} {e'} neq (in-Abs j) = in-Abs (subst-in (n≢m⇒sucn≢sucm neq) j) subst-in {N} {n} {m} {App e e₁} {e'} neq (in-App z) with z ... | inj₁ x = in-App (inj₁ (subst-in neq x)) ... | inj₂ y = in-App (inj₂ (subst-in neq y)) subst-in {N} {n} {m} {LabE f e} {e'} neq (in-LabE z) with z ... | inj₁ (fst , fst₁ , snd) = in-LabE (inj₁ (fst , (fst₁ , (subst-in neq snd)))) ... | inj₂ y = in-LabE (inj₂ (subst-in neq y)) -- if n ≢ m, n ∉ e', n ∈ [ m ↦ e' ] e, then n ∈ e subst-in-reverse : {N n m : ℕ} {e e' : Exp {N}} → n ≢ m → ¬ (n ∈` e') → n ∈` ([ m ↦ e' ] e) → n ∈` e subst-in-reverse {N} {n} {m} {Var x} {e'} neq nin ins with x ≟ᴺ m ... | yes p = contradiction ins nin ... | no ¬p = ins subst-in-reverse {N} {n} {m} {Abs e} {e'} neq nin (in-Abs ins) = in-Abs (subst-in-reverse (n≢m⇒sucn≢sucm neq) (notin-shift-one{N}{n}{e'} nin) ins) subst-in-reverse {N} {n} {m} {App e e₁} {e'} neq nin (in-App (inj₁ x)) = in-App (inj₁ (subst-in-reverse neq nin x)) subst-in-reverse {N} {n} {m} {App e e₁} {e'} neq nin (in-App (inj₂ y)) = in-App (inj₂ (subst-in-reverse neq nin y)) subst-in-reverse {N} {n} {m} {LabE f e} {e'} neq nin (in-LabE (inj₁ (fst , fst₁ , snd))) = in-LabE (inj₁ (fst , (fst₁ , subst-in-reverse{e = f fst fst₁} neq nin snd))) subst-in-reverse {N} {n} {m} {LabE f e} {e'} neq nin (in-LabE (inj₂ y)) = in-LabE (inj₂ (subst-in-reverse neq nin y)) var-env-< : {N : ℕ} {Γ : Env {N}} {T : Ty} {n : ℕ} (j : n ∶ T ∈ Γ) → n <ᴺ (length Γ) var-env-< {N} {.(T ∷ _)} {T} {.0} here = s≤s z≤n var-env-< {N} {.(_ ∷ _)} {T} {.(ℕ.suc _)} (there j) = s≤s (var-env-< j) -- variables contained in a term are < length of env. free-vars-env-< : {N : ℕ} {e : Exp {N}} {Γ : Env} {T : Ty {N}} → Γ ⊢ e ∶ T → (∀ n → n ∈` e → n <ᴺ length Γ) free-vars-env-< {N} {.(Var n)} {Γ} {T} (TVar x) n in-Var = var-env-< x free-vars-env-< {N} {.(Abs _)} {Γ} {(Fun T₁ T₂)} (TAbs j) n (in-Abs ins) rewrite (length[A∷B]≡suc[length[B]] {lzero} {Ty} {T₁} {Γ}) = ≤-pred (free-vars-env-< j (ℕ.suc n) ins) free-vars-env-< {N} {App e e'} {Γ} {T} (TApp j j') n (in-App z) with z ... | inj₁ x = free-vars-env-< j n x ... | inj₂ y = free-vars-env-< j' n y -- free-vars-env-< {N} {LabE f (LabI l)} {Γ} {T} (TLabEl{scopecheck = s} j j') free-vars-env-< {N} {LabE f (LabI l)} {Γ} {T} (TLabEl{scopecheck = s} j j') n (in-LabE z) with z ... | inj₁ (fst , fst₁ , snd) = s fst fst₁ n snd ... | inj₂ () free-vars-env-< {N} {LabE f (Var m)} {Γ} {T} (TLabEx f' (TVar j)) n (in-LabE z) with n ≟ᴺ m ... | yes p rewrite p = var-env-< j ... | no ¬p with z ... | inj₁ (fst , fst₁ , snd) = free-vars-env-< (f' fst fst₁) n (subst-in ¬p snd) ... | inj₂ (in-Var) = var-env-< j -- closed expressions have no free variables closed-free-vars : {N : ℕ} {e : Exp {N}} {T : Ty {N}} → [] ⊢ e ∶ T → (∀ n → ¬ (n ∈` e)) closed-free-vars {N} {Var x} {T} (TVar ()) closed-free-vars {N} {LabI x} {T} j n () closed-free-vars {N} {Abs e} {.(Fun _ _)} (TAbs j) n (in-Abs x) = contradiction (free-vars-env-< j (ℕ.suc n) x) (≤⇒≯ (s≤s z≤n)) closed-free-vars {N} {e} {T} j n x = contradiction (free-vars-env-< j n x) (≤⇒≯ z≤n) -- App & LabE have the same proof -- shifting with a threshold above number of free variables has no effect shift-env-size : {n : ℕ} {k : ℤ} {q : ℕ} {e : Exp {n}} → (∀ n → n ∈` e → n <ᴺ q) → ↑ k , q [ e ] ≡ e shift-env-size {n} {k} {q} {Var x} lmap with x <ᴺ? q ... | yes p = refl ... | no ¬p = contradiction (lmap x in-Var) ¬p shift-env-size {n} {k} {q} {Abs e} lmap = cong Abs (shift-env-size (extr lmap)) where extr : (∀ n → n ∈` Abs e → n <ᴺ q) → (∀ n → n ∈` e → n <ᴺ ℕ.suc q) extr lmap zero ins = s≤s z≤n extr lmap (ℕ.suc n) ins = s≤s (lmap n (in-Abs ins)) shift-env-size {n} {k} {q} {App e e'} lmap = cong₂ App (shift-env-size (extr lmap)) (shift-env-size(extr' lmap)) where extr : (∀ n → n ∈` App e e' → n <ᴺ q) → (∀ n → n ∈` e → n <ᴺ q) extr lmap n ins = lmap n (in-App (inj₁ ins)) extr' : (∀ n → n ∈` App e e' → n <ᴺ q) → (∀ n → n ∈` e' → n <ᴺ q) extr' lmap n ins = lmap n (in-App (inj₂ ins)) shift-env-size {n} {k} {q} {LabI x} lmap = refl shift-env-size {n} {k} {q} {LabE{s = s} f e} lmap = cong₂ LabE (f-ext λ l' → (f-ext λ x → shift-env-size (extr lmap l' x))) (shift-env-size (extr' lmap)) where extr : (∀ n → n ∈` LabE f e → n <ᴺ q) → (l : Fin n) → (x : l ∈ s) → (∀ n → n ∈` f l x → n <ᴺ q) extr lmap l x n ins = lmap n (in-LabE (inj₁ (l , (x , ins)))) extr' : (∀ n → n ∈` LabE f e → n <ᴺ q) → (∀ n → n ∈` e → n <ᴺ q) extr' lmap n ins = lmap n (in-LabE (inj₂ ins)) -- shifting has no effect on closed terms (corollary of shift-env-size) closed-no-shift : {n : ℕ} {k : ℤ} {q : ℕ} {e : Exp {n}} {T : Ty {n}} → [] ⊢ e ∶ T → ↑ k , q [ e ] ≡ e closed-no-shift {n} {k} {zero} {e} {T} j = shift-env-size (free-vars-env-< j) closed-no-shift {n} {k} {ℕ.suc q} {e} {T} j = shift-env-size λ n i → <-trans (free-vars-env-< j n i) (s≤s z≤n) -- subst-change-in : {N n m : ℕ} {e s s' : Exp{N}} → ¬ (n ∈` s) × ¬ (n ∈` s') → n ∈` ([ m ↦ s ] e) → n ∈` ([ m ↦ s' ] e) subst-change-in {N} {n} {m} {Var x} {s} {s'} (fst , snd) ins with x ≟ᴺ m ... | yes eq = contradiction ins fst ... | no ¬eq = ins subst-change-in {N} {n} {m} {Abs e} {s} {s'} (fst , snd) (in-Abs ins) = in-Abs (subst-change-in{N}{ℕ.suc n}{ℕ.suc m}{e} (notin-shift-one{N}{n}{s} fst , notin-shift-one{N}{n}{s'} snd) ins) subst-change-in {N} {n} {m} {App e e₁} {s} {s'} p (in-App (inj₁ x)) = in-App (inj₁ (subst-change-in{N}{n}{m}{e} p x)) subst-change-in {N} {n} {m} {App e e₁} {s} {s'} p (in-App (inj₂ y)) = in-App (inj₂ (subst-change-in{N}{n}{m}{e₁} p y)) subst-change-in {N} {n} {m} {LabE f e} {s} {s'} p (in-LabE (inj₁ (fst , fst₁ , snd))) = in-LabE (inj₁ (fst , (fst₁ , (subst-change-in{N}{n}{m}{f fst fst₁}{s}{s'} p snd)))) subst-change-in {N} {n} {m} {LabE f e} {s} {s'} p (in-LabE (inj₂ y)) = in-LabE (inj₂ (subst-change-in {N} {n} {m} {e} p y)) -- swapping of substitutions A & B if variables of A are not free in substitution term of B and vice versa subst-subst-swap : {N n m : ℕ} {e e' s : Exp {N}} → n ≢ m → ¬ n ∈` e' → ¬ m ∈` e → [ n ↦ e ] ([ m ↦ e' ] s) ≡ [ m ↦ e' ] ([ n ↦ e ] s) subst-subst-swap {N} {n} {m} {e} {e'} {Var x} neq nin nin' with x ≟ᴺ m | x ≟ᴺ n ... | yes p | yes p' = contradiction (≡-trans (sym p') p) neq ... | yes p | no ¬p' with x ≟ᴺ m ... | yes p'' = subst-refl-notin nin ... | no ¬p'' = contradiction p ¬p'' subst-subst-swap {N} {n} {m} {e} {e'} {Var x} neq nin nin' | no ¬p | yes p' with x ≟ᴺ n ... | yes p'' = sym (subst-refl-notin nin') ... | no ¬p'' = contradiction p' ¬p'' subst-subst-swap {N} {n} {m} {e} {e'} {Var x} neq nin nin' | no ¬p | no ¬p' with x ≟ᴺ n | x ≟ᴺ m ... | yes p'' | _ = contradiction p'' ¬p' ... | _ | yes p''' = contradiction p''' ¬p ... | no p'' | no ¬p''' = refl subst-subst-swap {N} {n} {m} {e} {e'} {Abs s} neq nin nin' with (notin-shift{n = n}{1}{0} z≤n nin) | (notin-shift{n = m}{1}{0} z≤n nin') ... | w | w' rewrite (n+1≡sucn{n}) | (n+1≡sucn{m}) = cong Abs (subst-subst-swap{s = s} (n≢m⇒sucn≢sucm neq) w w') subst-subst-swap {N} {n} {m} {e} {e'} {App s s₁} neq nin nin' = cong₂ App (subst-subst-swap{s = s} neq nin nin') (subst-subst-swap{s = s₁} neq nin nin') subst-subst-swap {N} {n} {m} {e} {e'} {LabI x} neq nin nin' = refl subst-subst-swap {N} {n} {m} {e} {e'} {LabE f s} neq nin nin' = cong₂ LabE (f-ext (λ l → f-ext (λ x → subst-subst-swap{s = f l x} neq nin nin' ))) (subst-subst-swap{s = s} neq nin nin') -- this should be true for all k, but limiting to positive k makes the proof simpler aux-calc-3 : {m x : ℕ} {k : ℤ} → k >ᶻ + 0 → ∣ + m +ᶻ k ∣ ≡ ∣ + x +ᶻ k ∣ → m ≡ x aux-calc-3 {m} {x} {+_ n} gt eqv = +-cancelʳ-≡ m x eqv aux-calc-4 : {m x : ℕ} {k : ℤ} → k >ᶻ + 0 → m ≤ᴺ x → m <ᴺ ∣ + x +ᶻ k ∣ aux-calc-4 {m} {x} {+_ zero} (+<+ ()) aux-calc-4 {m} {x} {+[1+ n ]} (+<+ (s≤s z≤n)) leq = a≤b<c⇒a<c leq (m<m+n x {ℕ.suc n} (s≤s z≤n)) subst-shift-swap : {n : ℕ} {k : ℤ} {x q : ℕ} {s e : Exp {n}} → k >ᶻ + 0 → ↑ k , q [ [ x ↦ e ] s ] ≡ [ ↑ᴺ k , q [ x ] ↦ ↑ k , q [ e ] ] ↑ k , q [ s ] subst-shift-swap {n} {k} {x} {q} {Var m} {e} gt with m ≟ᴺ x ... | yes p with m <ᴺ? q | x <ᴺ? q ... | yes p' | yes p'' with m ≟ᴺ x ... | yes p''' = refl ... | no ¬p''' = contradiction p ¬p''' subst-shift-swap {n} {k} {x} {q} {Var m} {e} gt | yes p | yes p' | no ¬p'' rewrite (cong ℕ.suc p) = contradiction p' ¬p'' subst-shift-swap {n} {k} {x} {q} {Var m} {e} gt | yes p | no ¬p' | yes p'' rewrite (cong ℕ.suc p) = contradiction p'' ¬p' subst-shift-swap {n} {k} {x} {q} {Var m} {e} gt | yes p | no ¬p' | no ¬p'' with ∣ + m +ᶻ k ∣ ≟ᴺ ∣ + x +ᶻ k ∣ ... | yes p''' = refl ... | no ¬p''' rewrite p = contradiction refl ¬p''' subst-shift-swap {n} {k} {x} {q} {Var m} {e} gt | no ¬p with m <ᴺ? q | x <ᴺ? q ... | yes p' | yes p'' with m ≟ᴺ x ... | yes p''' = contradiction p''' ¬p ... | no ¬p''' = refl subst-shift-swap {n} {k} {x} {q} {Var m} {e} gt | no ¬p | yes p' | no ¬p'' with m ≟ᴺ ∣ + x +ᶻ k ∣ ... | yes p''' = contradiction p''' (<⇒≢ (aux-calc-4 gt (≤-pred (≤-trans p' (≰⇒≥ ¬p''))))) ... | no ¬p''' = refl subst-shift-swap {n} {k} {x} {q} {Var m} {e} gt | no ¬p | no ¬p' | yes p'' with ∣ + m +ᶻ k ∣ ≟ᴺ x ... | yes p''' = contradiction p''' (≢-sym (<⇒≢ (aux-calc-4{x}{m}{k} gt (≤-pred (≤-trans p'' (≰⇒≥ ¬p')))))) ... | no ¬p''' = refl subst-shift-swap {n} {k} {x} {q} {Var m} {e} gt | no ¬p | no ¬p' | no ¬p'' with ∣ + m +ᶻ k ∣ ≟ᴺ ∣ + x +ᶻ k ∣ ... | yes p''' = contradiction p''' (contraposition (aux-calc-3 gt) ¬p) ... | no ¬p''' = refl subst-shift-swap {n} {k} {x} {q} {Abs s} {e} gt with (subst-shift-swap{n}{k}{ℕ.suc x}{ℕ.suc q}{s}{↑¹[ e ]} gt) ... | w rewrite (↑k,sucq[↑1,c[s]]≡↑1,c[↑k,q[s]] {n} {k} {q} {0} {e} z≤n gt) | (suc[↑ᴺk,l[x]]≡↑ᴺk,sucl[sucx] {k} {q} {x} gt) = cong Abs w subst-shift-swap {n} {k} {x} {q} {App s₁ s₂} {e} gt = cong₂ App (subst-shift-swap {n} {k} {x} {q} {s₁} {e} gt) (subst-shift-swap {n} {k} {x} {q} {s₂} {e} gt) subst-shift-swap {n} {k} {x} {q} {LabI ins} {e} gt = refl subst-shift-swap {n} {k} {x} {q} {LabE f s} {e} gt = cong₂ LabE (f-ext (λ l → f-ext (λ ins → subst-shift-swap {n} {k} {x} {q} {f l ins} {e} gt))) (subst-shift-swap {n} {k} {x} {q} {s} {e} gt) --- properties and manipulation of environments -- type to determine whether var type judgement in env. (Δ ++ Γ) is in Δ or Γ data extract-env-or {n : ℕ} {Δ Γ : Env {n}} {T : Ty} {x : ℕ} : Set where in-Δ : x ∶ T ∈ Δ → extract-env-or -- x ≥ length Δ makes sure that x really is in Γ; e.g. -- x = 1, Δ = (S ∷ T), Γ = (T ∷ Γ'); here 1 ∶ T ∈ Δ as well as (1 ∸ 2) ≡ 0 ∶ T ∈ Γ in-Γ : (x ≥ᴺ length Δ) → (x ∸ length Δ) ∶ T ∈ Γ → extract-env-or extract : {n : ℕ} {Δ Γ : Env {n}} {T : Ty} {x : ℕ} (j : x ∶ T ∈ (Δ ++ Γ)) → extract-env-or{n}{Δ}{Γ}{T}{x} extract {n} {[]} {Γ} {T} {x} j = in-Γ z≤n j extract {n} {x₁ ∷ Δ} {Γ} {.x₁} {.0} here = in-Δ here extract {n} {x₁ ∷ Δ} {Γ} {T} {ℕ.suc x} (there j) with extract {n} {Δ} {Γ} {T} {x} j ... | in-Δ j' = in-Δ (there j') ... | in-Γ ge j'' = in-Γ (s≤s ge) j'' ext-behind : {n : ℕ} {Δ Γ : Env {n}} {T : Ty} {x : ℕ} → x ∶ T ∈ Δ → x ∶ T ∈ (Δ ++ Γ) ext-behind here = here ext-behind (there j) = there (ext-behind j) ext-front : {N n : ℕ} {Γ Δ : Env{N}} {S : Ty} → n ∶ S ∈ Γ → (n +ᴺ (length Δ)) ∶ S ∈ (Δ ++ Γ) ext-front {N} {n} {Γ} {[]} {S} j rewrite (n+length[]≡n{A = Ty {N}}{n = n}) = j ext-front {N} {n} {Γ} {T ∷ Δ} {S} j rewrite (+-suc n (foldr (λ _ → ℕ.suc) 0 Δ)) = there (ext-front j) swap-env-behind : {n : ℕ} {Γ Δ : Env {n}} {T : Ty} → 0 ∶ T ∈ (T ∷ Γ) → 0 ∶ T ∈ (T ∷ Δ) swap-env-behind {n}{Γ} {Δ} {T} j = here swap-type : {n : ℕ} {Δ ∇ Γ : Env {n}} {T : Ty} → (length Δ) ∶ T ∈ (Δ ++ T ∷ ∇ ++ Γ) → (length Δ +ᴺ length ∇) ∶ T ∈ (Δ ++ ∇ ++ T ∷ Γ) swap-type {n} {Δ} {∇} {Γ} {T} j with extract{n}{Δ}{T ∷ ∇ ++ Γ} j ... | in-Δ x = contradiction (var-env-< {n}{Δ} {T} x) (<-irrefl refl) ... | in-Γ le j' with extract{n}{T ∷ ∇}{Γ} j' ... | in-Δ j'' rewrite (n∸n≡0 (length Δ)) | (sym (length[A++B]≡length[A]+length[B]{lzero}{Ty}{Δ}{∇})) | (sym (++-assoc{lzero}{Ty}{Δ}{∇}{T ∷ Γ})) = ext-front{n}{0}{T ∷ Γ}{Δ ++ ∇}{T} (swap-env-behind{n}{∇}{Γ}{T} j'') ... | in-Γ le' j'' rewrite (length[A∷B]≡suc[length[B]]{lzero}{Ty}{T}{∇}) | (n∸n≡0 (length Δ)) = contradiction le' (<⇒≱ (s≤s z≤n)) env-pred : {n : ℕ} {Γ : Env {n}} {S T : Ty} {y : ℕ} {gt : y ≢ 0} → y ∶ T ∈ (S ∷ Γ) → ∣ y ⊖ 1 ∣ ∶ T ∈ Γ env-pred {n} {Γ} {S} {.S} {.0} {gt} here = contradiction refl gt env-pred {n} {Γ} {S} {T} {.(ℕ.suc _)} {gt} (there j) = j env-type-equiv-here : {n : ℕ} {Γ : Env {n}} {S T : Ty} → 0 ∶ T ∈ (S ∷ Γ) → T ≡ S env-type-equiv-here {n} {Γ} {S} {.S} here = refl env-type-uniq : {N n : ℕ} {Γ : Env {N}} {S T : Ty} → n ∶ T ∈ Γ → n ∶ S ∈ Γ → T ≡ S env-type-uniq {N} {.0} {.(S ∷ _)} {S} {.S} here here = refl env-type-uniq {N} {(ℕ.suc n)} {(A ∷ Γ)} {S} {T} (there j) (there j') = env-type-uniq {N} {n} {Γ} {S} {T} j j' env-type-equiv : {n : ℕ} {Δ ∇ : Env {n}} {S T : Ty} → length Δ ∶ T ∈ (Δ ++ S ∷ ∇) → T ≡ S env-type-equiv {n} {Δ} {∇} {S} {T} j with extract{n}{Δ}{S ∷ ∇} j ... | in-Δ x = contradiction (var-env-< x) (≤⇒≯ ≤-refl) ... | in-Γ x j' rewrite (n∸n≡0 (length Δ)) = env-type-equiv-here {n} {∇} {S} {T} j' env-type-equiv-j : {N : ℕ} {Γ : Env {N}} {S T : Ty} {n : ℕ} → T ≡ S → n ∶ T ∈ Γ → n ∶ S ∈ Γ env-type-equiv-j {N} {Γ} {S} {T} {n} eq j rewrite eq = j -- extension of environment -- lemma required for ∈` ext-∈` : {N m k q : ℕ} {e : Exp {N}} → (∀ n → n ∈` e → n <ᴺ m) → (∀ n → n ∈` ↑ + k , q [ e ] → n <ᴺ m +ᴺ k) ext-∈` {N} {m} {k} {q} {Var x} f n ins with x <ᴺ? q ... | yes p = ≤-trans (f n ins) (≤-stepsʳ{m}{m} k ≤-refl) ext-∈` {N} {m} {k} {q} {Var x} f .(x +ᴺ k) in-Var | no ¬p = Data.Nat.Properties.+-monoˡ-≤ k (f x in-Var) ext-∈` {N} {m} {k} {q} {Abs e} f n (in-Abs ins) = ≤-pred (ext-∈` {N} {ℕ.suc m} {k} {ℕ.suc q} {e = e} (extr f) (ℕ.suc n) ins) where extr : (∀ n → n ∈` Abs e → n <ᴺ m) → (∀ n → n ∈` e → n <ᴺ ℕ.suc m) extr f zero ins = s≤s z≤n extr f (ℕ.suc n) ins = s≤s (f n (in-Abs ins)) ext-∈` {N} {m} {k} {q} {App e e₁} f n (in-App (inj₁ x)) = ext-∈`{N}{m}{k}{q}{e} (extr f) n x where extr : (∀ n → n ∈` App e e₁ → n <ᴺ m) → (∀ n → n ∈` e → n <ᴺ m) extr f n ins = f n (in-App (inj₁ ins)) ext-∈` {N} {m} {k} {q} {App e e₁} f n (in-App (inj₂ y)) = ext-∈`{N}{m}{k}{q}{e₁} (extr f) n y where extr : (∀ n → n ∈` App e e₁ → n <ᴺ m) → (∀ n → n ∈` e₁ → n <ᴺ m) extr f n ins = f n (in-App (inj₂ ins)) ext-∈` {N} {m} {k} {q} {LabE f₁ e} f n (in-LabE (inj₁ (fst , fst₁ , snd))) = ext-∈`{N}{m}{k}{q}{f₁ fst fst₁} (extr f) n snd where extr : (∀ n → n ∈` LabE f₁ e → n <ᴺ m) → (∀ n → n ∈` f₁ fst fst₁ → n <ᴺ m) extr f n ins = f n (in-LabE (inj₁ (fst , (fst₁ , ins)))) ext-∈` {N} {m} {k} {q} {LabE f₁ e} f n (in-LabE (inj₂ y)) = ext-∈`{N}{m}{k}{q}{e} (extr f) n y where extr : (∀ n → n ∈` LabE f₁ e → n <ᴺ m) → (∀ n → n ∈` e → n <ᴺ m) extr f n ins = f n (in-LabE (inj₂ ins)) ext : {N : ℕ} {Γ Δ ∇ : Env {N}} {S : Ty} {s : Exp} → (∇ ++ Γ) ⊢ s ∶ S → (∇ ++ Δ ++ Γ) ⊢ ↑ (ℤ.pos (length Δ)) , length ∇ [ s ] ∶ S ext {N} {Γ} {Δ} {∇} (TVar {m = n} x) with extract{N}{∇}{Γ} x ... | in-Δ x₁ with n <ᴺ? length ∇ ... | yes p = TVar (ext-behind x₁) ... | no ¬p = contradiction (var-env-< x₁) ¬p ext {N} {Γ} {Δ} {∇} (TVar {m = n} x) | in-Γ x₁ x₂ with n <ᴺ? length ∇ ... | yes p = contradiction x₁ (<⇒≱ p) ... | no ¬p with (ext-front{N}{n ∸ length ∇}{Γ}{∇ ++ Δ} x₂) ... | w rewrite (length[A++B]≡length[A]+length[B]{lzero}{Ty}{∇}{Δ}) | (sym (+-assoc (n ∸ length ∇) (length ∇) (length Δ))) | (m∸n+n≡m{n}{length ∇} (≮⇒≥ ¬p)) | (++-assoc{lzero}{Ty}{∇}{Δ}{Γ}) = TVar w ext {N} {Γ} {Δ} {∇} {Fun T₁ T₂} {Abs e} (TAbs j) = TAbs (ext{N}{Γ}{Δ}{T₁ ∷ ∇} j) ext {N} {Γ} {Δ} {∇} {S} {App s₁ s₂} (TApp{T₁ = T₁} j₁ j₂) = TApp (ext{N}{Γ}{Δ}{∇}{Fun T₁ S} j₁) (ext{N}{Γ}{Δ}{∇}{T₁} j₂) ext {N} {Γ} {Δ} {∇} {S} {LabI l} (TLabI{x = x}{s} ins) = TLabI{x = x}{s} ins ext {N} {Γ} {Δ} {∇} {S} {LabE f e} (TLabEl{ins = ins}{f = .f}{scopecheck = s} j j') = TLabEl{ins = ins} {scopecheck = λ l i n x₁ → rw n (ext-∈`{N}{length (∇ ++ Γ)}{length Δ}{length ∇}{f l i} (s l i) n x₁)} (ext{N}{Γ}{Δ}{∇} j) (ext{N}{Γ}{Δ}{∇} j') where rw : ∀ n → n <ᴺ length (∇ ++ Γ) +ᴺ length Δ → n <ᴺ length (∇ ++ Δ ++ Γ) rw n a rewrite (length[A++B]≡length[A]+length[B]{lzero}{Ty}{∇}{Γ}) | (+-assoc (length ∇) (length Γ) (length Δ)) | (+-comm (length Γ) (length Δ)) | sym (length[A++B]≡length[A]+length[B]{lzero}{Ty}{Δ}{Γ}) | sym (length[A++B]≡length[A]+length[B]{lzero}{Ty}{∇}{Δ ++ Γ}) = a ext {N} {Γ} {[]} {∇} {S} {LabE f .(Var m)} (TLabEx {s = s} {f = .f} f' (TVar {m = m} x)) rewrite (↑ᴺ⁰-refl{N}{length ∇}{m}) | (f-ext (λ l → f-ext (λ i → ↑⁰-refl{N}{length ∇}{f l i}))) = TLabEx f' (TVar x) -- required lemma needs length Δ > 0, hence the case split ext {N} {Γ} {t ∷ Δ} {∇} {S} {LabE f .(Var m)} (TLabEx {s = s} {f = .f} f' (TVar {m = m} x)) with extract{N}{∇}{Γ} x ... | in-Δ x₁ with m <ᴺ? length ∇ ... | no ¬p = contradiction (var-env-< x₁) ¬p ... | yes p with (λ l i → ext{N}{Γ}{t ∷ Δ}{∇} (f' l i)) ... | w = TLabEx (rw w) (TVar (ext-behind x₁)) -- if m < k, [ m → ↑ₖ x ] (↑ₖ s) ≡ ↑ₖ ([ m ↦ x ] s) where rw : ((l : Fin N) → (i : l ∈ s) → (∇ ++ (t ∷ Δ) ++ Γ) ⊢ ↑ + length (t ∷ Δ) , length ∇ [ [ m ↦ LabI l ] (f l i) ] ∶ S) → ((l : Fin N) → (i : l ∈ s) → (∇ ++ (t ∷ Δ) ++ Γ) ⊢ [ m ↦ LabI l ] ↑ + length (t ∷ Δ) , length ∇ [ f l i ] ∶ S) rw q l i with q l i ... | w rewrite (subst-shift-swap{N}{+ length (t ∷ Δ)}{m}{length ∇}{f l i}{LabI l} (+<+ (s≤s z≤n))) with m <ᴺ? length ∇ ... | yes p = w ... | no ¬p = contradiction p ¬p ext {N} {Γ} {t ∷ Δ} {∇} {S} {LabE f .(Var _)} (TLabEx {s = s}{f = .f} f' (TVar{m = m} x)) | in-Γ x₁ x₂ with m <ᴺ? length ∇ ... | yes p = contradiction x₁ (<⇒≱ p) ... | no ¬p with (λ l i → (ext{N}{Γ}{t ∷ Δ}{∇} (f' l i))) | (ext-front{N}{m ∸ length ∇}{Γ}{∇ ++ (t ∷ Δ)} x₂) ... | w | w' rewrite (length[A++B]≡length[A]+length[B]{lzero}{Ty}{∇}{t ∷ Δ}) | (sym (+-assoc (m ∸ length ∇) (length ∇) (length (t ∷ Δ)))) | (m∸n+n≡m{m}{length ∇} (≮⇒≥ ¬p)) | (++-assoc{lzero}{Ty}{∇}{t ∷ Δ}{Γ}) = TLabEx (rw w) (TVar w') where rw : ((l : Fin N) → (i : l ∈ s) → ((∇ ++ (t ∷ Δ) ++ Γ) ⊢ ↑ + length (t ∷ Δ) , length ∇ [ [ m ↦ LabI l ] f l i ] ∶ S)) → ((l : Fin N) → (i : l ∈ s) → ((∇ ++ (t ∷ Δ) ++ Γ) ⊢ [ m +ᴺ length (t ∷ Δ) ↦ LabI l ] ↑ + length (t ∷ Δ) , length ∇ [ f l i ] ∶ S)) rw q l i with q l i ... | w rewrite (subst-shift-swap {N} {+ length (t ∷ Δ)} {m} {length ∇} {f l i} {LabI l} (+<+ (s≤s z≤n))) with m <ᴺ? length ∇ ... | yes p = contradiction x₁ (<⇒≱ p) ... | no ¬p = w ext-empty : {N : ℕ} {Γ : Env {N}} {T : Ty} {e : Exp} → [] ⊢ e ∶ T → Γ ⊢ e ∶ T ext-empty {N} {Γ} {T} {e} j with ext{N}{[]}{Γ}{[]} j ... | w rewrite (closed-no-shift{N}{+ length Γ}{0}{e}{T} j) | (A++[]≡A{lzero}{Ty}{Γ}) = w -- uniqueness of ∈ ∈-eq : {N : ℕ} {s : Subset N} {l : Fin N} → (ins : l ∈ s) → (ins' : l ∈ s) → ins ≡ ins' ∈-eq {ℕ.suc n} {.(true ∷ _)} {zero} here here = refl ∈-eq {ℕ.suc n} {(x ∷ s)} {Fin.suc l} (there j) (there j') = cong there (∈-eq j j') --- general typing properties subset-eq : {n : ℕ} {s s' : Subset n} → Label s ≡ Label s' → s ≡ s' subset-eq {n} {s} {.s} refl = refl ---- progress and preservation -- progress theorem, i.e. a well-typed closed expression is either a value -- or can be reduced further data Progress {n : ℕ} (e : Exp {n}) {T : Ty} {j : [] ⊢ e ∶ T} : Set where step : {e' : Exp{n}} → e ⇒ e' → Progress e value : Val e → Progress e progress : {n : ℕ} (e : Exp {n}) {T : Ty} {j : [] ⊢ e ∶ T} → Progress e {T} {j} progress (Var x) {T} {TVar ()} progress (Abs e) = value VFun progress (App e e₁) {T} {TApp{T₁ = T₁}{T₂ = .T} j j₁} with progress e {Fun T₁ T} {j} ... | step x = step (ξ-App1 x) ... | value VFun with progress e₁ {T₁} {j₁} ... | step x₁ = step (ξ-App2 VFun x₁) ... | value x₁ = step (β-App x₁) progress (LabI ins) {Label s} {TLabI l} = value VLab progress (LabE f (LabI l)) {T} {j = TLabEl{ins = ins} f' j} = step (β-LabE ins) progress {n} (LabE f (Var m)) {T} {TLabEx f' (TVar ())} --- preserve-subst' : {n : ℕ} {T S : Ty {n} } {Δ : Env {n}} {e s : Exp {n}} {v : Val s} (j : (Δ ++ S ∷ []) ⊢ e ∶ T) (j' : [] ⊢ s ∶ S) → Δ ⊢ [ length Δ ↦ s ] e ∶ T preserve-subst' {n} {T} {S} {Δ} {(Var m)} {s} {v} (TVar{m} x) j' with extract{n}{Δ}{S ∷ []}{T}{m} x ... | in-Δ x₁ with m ≟ᴺ length Δ ... | yes p = contradiction p (<⇒≢ (var-env-< x₁)) ... | no ¬p with m <ᴺ? length Δ ... | yes p' = TVar x₁ ... | no ¬p' = contradiction (var-env-< x₁) ¬p' preserve-subst' {n} {T} {S} {Δ} {(Var m)} {s} {v} (TVar{m} x) j' | in-Γ x₁ x₂ with m ≟ᴺ length Δ ... | yes p with ext{n}{[]}{Δ} j' ... | w rewrite p | (env-type-equiv x) | (closed-no-shift {n} {+ length Δ} {0} {s} j') | (A++[]≡A{lzero}{Ty}{Δ}) = w preserve-subst' {n} {T} {S} {Δ} {(Var m)} {s} {v} (TVar{m} x) j' | in-Γ x₁ x₂ | no ¬p with m <ᴺ? length Δ ... | yes p' = contradiction x₁ (<⇒≱ p') ... | no ¬p' with (<⇒≱ (≤∧≢⇒< (≤-step (≤∧≢⇒< (≮⇒≥ ¬p') (≢-sym ¬p))) (≢-sym (n≢m⇒sucn≢sucm ¬p)))) ... | w = contradiction (var-env-< x) (aux w) where aux : ¬ (ℕ.suc m ≤ᴺ ℕ.suc (length Δ)) → ¬ (ℕ.suc m ≤ᴺ length (Δ ++ S ∷ [])) aux t rewrite (length[A++B]≡length[A]+length[B]{A = Δ}{B = S ∷ []}) | (n+1≡sucn{length Δ}) = t preserve-subst' {n} {.(Fun _ _)} {S} {Δ} {(Abs e')} {s} {v} (TAbs{T₁ = T₁}{T₂} j) j' with preserve-subst'{n}{T₂}{S}{T₁ ∷ Δ}{e'}{s}{v} j j' ... | w rewrite (closed-no-shift {n} {+ 1} {0} {s} j') = TAbs w preserve-subst' {n} {T} {S} {Δ} {(App e e')} {s} {v} (TApp j j₁) j' = TApp (preserve-subst'{v = v} j j') (preserve-subst'{v = v} j₁ j') preserve-subst' {n} {T} {S} {Δ} {LabI x} {s} {v} (TLabI ins) j' = TLabI ins preserve-subst' {n} {T} {S} {Δ} {LabE{s = s'} f (LabI x)} {s} {v} (TLabEl{ins = ins}{scopecheck = sc} j j') j'' = TLabEl{ins = ins}{scopecheck = scopecheck} (preserve-subst'{v = v} j j'') (TLabI ins) where scopecheck : (l : Fin n) (i : l ∈ s') (n' : ℕ) → n' ∈` ([ length Δ ↦ s ] f l i) → n' <ᴺ length Δ scopecheck l i n' ins with subst-in-neq{n}{n'}{length Δ}{f l i}{s} (closed-free-vars j'' n') ins ... | w with (sc l i n' (subst-in-reverse{n}{n'}{length Δ}{e' = s} w (closed-free-vars j'' n') ins)) ... | w' rewrite (length[A++B∷[]]≡suc[length[A]]{lzero}{Ty}{Δ}{S}) = ≤∧≢⇒< (≤-pred w') w preserve-subst' {n} {T} {.(Fun _ _)} {Δ} {LabE f (Var m)} {Abs e} {VFun} (TLabEx f' (TVar{T = Label s} z)) (TAbs j') with m ≟ᴺ length Δ | preserve-subst'{v = VFun} (TVar z) (TAbs j') ... | yes p | _ rewrite p = contradiction (env-type-equiv z) λ () ... | no ¬p | w = TLabEx (rw (λ l i → preserve-subst'{v = VFun} (f' l i) (TAbs j'))) w where rw : ((l : Fin n) (i : l ∈ s) → Δ ⊢ [ length Δ ↦ Abs e ] ([ m ↦ LabI l ] f l i) ∶ T) → ((l : Fin n) (i : l ∈ s) → Δ ⊢ [ m ↦ LabI l ] ([ length Δ ↦ Abs e ] f l i) ∶ T) rw ρ l i with ρ l i ... | w rewrite sym (subst-subst-swap{n}{length Δ}{m}{Abs e}{LabI l}{f l i} (≢-sym ¬p) (λ ()) (closed-free-vars (TAbs j') m)) = w preserve-subst' {n} {T} {(Label s')} {Δ} {LabE f (Var m)} {LabI x} {VLab} (TLabEx f' (TVar{T = Label s} z)) (TLabI{s = s'} ins) with m ≟ᴺ length Δ | preserve-subst'{v = VLab} (TVar z) (TLabI ins) ... | yes p | w rewrite p | subset-eq (env-type-equiv z) = TLabEl{f = λ l i → [ length Δ ↦ LabI x ] (f l i)}{scopecheck } (rw{e = f x ins} (preserve-subst'{v = VLab} (f' x ins) (TLabI{s = s'} ins))) w where -- agda didn't let me rewrite this directly rw : {e : Exp} → (Δ ⊢ [ length Δ ↦ LabI x ] ([ length Δ ↦ LabI x ] e) ∶ T) → ( Δ ⊢ [ length Δ ↦ LabI x ] e ∶ T) rw {e} j rewrite sym (subst2-refl-notin{n}{length Δ}{LabI x}{LabI x}{e} (λ ())) = j -- if n ∈` [length Δ ↦ LabI x] (f l i), then also n ∈` [length Δ ↦ LabI l] (f l i), since both LabI l and LabI x are closed -- if n ∈` [length Δ ↦ LabI l] (f l i), then n < length (Δ ++ (S ∷ [])), we get this from f' ((Δ ++ S ∷ []) ⊢ [length Δ ↦ LabI l] (f l i) ∶ T) and free-vars-env-< -- if n ∈` [length Δ ↦ LabI l] (f l i), then also n ≢ (length Δ), since LabI closed -- hence n < length (Δ ++ (S ∷ [])) = length Δ + 1 ⇒ n ≤ length Δ, n ≤ length Δ and n ≢ length Δ implies n < length Δ scopecheck : (l : Fin n) (i : l ∈ s') (n' : ℕ) → n' ∈` ([ length Δ ↦ LabI x ] f l i) → n' <ᴺ length Δ scopecheck l i n' ins with (free-vars-env-< (f' l i) n' (subst-change-in{n}{n'}{length Δ}{f l i}{LabI x}{LabI l} ((λ ()) , (λ ())) ins)) ... | w rewrite (length[A++B∷[]]≡suc[length[A]]{lzero}{Ty}{Δ}{Label s'})= ≤∧≢⇒< (≤-pred w) (subst-in-neq{n}{n'}{length Δ}{f l i}{LabI x} (λ ()) ins) ... | no ¬p | w = TLabEx (rw λ l i → preserve-subst'{v = VLab} (f' l i) (TLabI ins)) w where rw : ((l : Fin n) (i : l ∈ s) → Δ ⊢ [ length Δ ↦ LabI x ] ([ m ↦ LabI l ] f l i) ∶ T) → ((l : Fin n) (i : l ∈ s) → Δ ⊢ [ m ↦ LabI l ] ([ length Δ ↦ LabI x ] f l i) ∶ T) rw ρ l i with ρ l i ... | w rewrite sym (subst-subst-swap{n}{length Δ}{m}{LabI x}{LabI l}{f l i} (≢-sym ¬p) (λ ()) (closed-free-vars (TLabI ins) m)) = w preserve' : {n : ℕ} {T : Ty {n}} (e e' : Exp) (j : [] ⊢ e ∶ T) (r : e ⇒ e') → [] ⊢ e' ∶ T preserve' {n} {T} .(App e₁ _) .(App e₁' _) (TApp j j') (ξ-App1 {e₁ = e₁} {e₁' = e₁'} r) = TApp (preserve' e₁ e₁' j r) j' preserve' {n} {T} .(App _ _) .(App _ _) (TApp j j') (ξ-App2{e = e}{e' = e'} x r) = TApp j (preserve' e e' j' r) preserve' {n} {T} (App (Abs e) s') .(↑ -[1+ 0 ] , 0 [ [ 0 ↦ ↑ + 1 , 0 [ s' ] ] e ]) (TApp (TAbs j) j₁) (β-App x) rewrite (closed-no-shift {n} {+ 1} {0} {s'} j₁) | (closed-no-shift {n} { -[1+ 0 ]} {0} {[ 0 ↦ s' ] e} (preserve-subst'{Δ = []}{v = x} j j₁)) = preserve-subst'{Δ = []}{v = x} j j₁ preserve' {n} {T} (LabE f (LabI l)) .(f x ins) (TLabEl{ins = ins'} j j') (β-LabE {x = x} ins) rewrite (∈-eq ins ins') = j
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_253.asm
ljhsiun2/medusa
9
102441
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r15 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0x1b3ea, %rsi lea addresses_UC_ht+0x181ea, %rdi clflush (%rsi) nop nop nop nop nop add %rbx, %rbx mov $78, %rcx rep movsb nop nop inc %rbp lea addresses_WT_ht+0xdbea, %rbx nop dec %r12 movb $0x61, (%rbx) nop nop lfence lea addresses_A_ht+0xe025, %rdi nop nop nop add $13367, %r11 mov $0x6162636465666768, %rbp movq %rbp, %xmm4 movups %xmm4, (%rdi) nop sub %rbp, %rbp lea addresses_WT_ht+0xa22a, %rbx nop nop nop nop nop and $36080, %r12 and $0xffffffffffffffc0, %rbx movntdqa (%rbx), %xmm1 vpextrq $1, %xmm1, %rdi nop nop nop nop add %rbx, %rbx lea addresses_A_ht+0xe7b6, %rsi nop nop nop nop add %rbx, %rbx mov $0x6162636465666768, %rdi movq %rdi, (%rsi) nop add %r12, %r12 lea addresses_WC_ht+0x1e9ea, %rsi lea addresses_UC_ht+0x111ea, %rdi nop add %r15, %r15 mov $55, %rcx rep movsw nop nop nop cmp $61175, %rcx lea addresses_WC_ht+0x18b1d, %r12 nop cmp $53327, %rcx mov (%r12), %r11w nop nop nop inc %rbx lea addresses_normal_ht+0x336a, %rsi lea addresses_WC_ht+0x100ea, %rdi nop cmp %r15, %r15 mov $112, %rcx rep movsq nop dec %r15 lea addresses_normal_ht+0x1978a, %rbx nop add %rcx, %rcx movw $0x6162, (%rbx) nop nop nop nop and $22384, %rbp lea addresses_UC_ht+0xaf2a, %rsi lea addresses_normal_ht+0x1c22a, %rdi nop nop nop sub %rbx, %rbx mov $80, %rcx rep movsl nop and %r12, %r12 lea addresses_WT_ht+0x71ea, %rcx cmp %rbp, %rbp vmovups (%rcx), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $1, %xmm0, %r12 nop cmp $60430, %r11 lea addresses_WT_ht+0x1cdea, %rsi lea addresses_WC_ht+0x925a, %rdi xor %rbx, %rbx mov $18, %rcx rep movsw nop nop nop nop inc %r11 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r15 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r8 push %r9 push %rbp push %rcx push %rdx // Load lea addresses_RW+0x15dea, %rcx nop nop add %rbp, %rbp movups (%rcx), %xmm5 vpextrq $1, %xmm5, %r10 xor %rdx, %rdx // Faulty Load lea addresses_UC+0x79ea, %rcx nop nop xor %r8, %r8 mov (%rcx), %rbp lea oracles, %r11 and $0xff, %rbp shlq $12, %rbp mov (%r11,%rbp,1), %rbp pop %rdx pop %rcx pop %rbp pop %r9 pop %r8 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 10, 'size': 16, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 9, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 1, 'size': 8, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 5, 'size': 2, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
tests/auto_counters_suite.adb
jhumphry/auto_counters
5
1471
<filename>tests/auto_counters_suite.adb -- Auto_Counters_Suite -- Unit tests for Auto_Counters packages -- Copyright (c) 2016, <NAME> - see LICENSE file for details with Smart_Ptrs_Tests; with Auto_Counters_Suite.Unique_Ptrs_Tests; with Auto_Counters_Suite.C_Resources_Tests; with Auto_Counters_Suite.Refcounted_Flyweights_Tests; with Auto_Counters_Suite.Refcounted_KVFlyweights_Tests; with Basic_Counters; with Protected_Counters; package body Auto_Counters_Suite is use AUnit.Test_Suites; package Basic_Smart_Ptrs_Tests is new Smart_Ptrs_Tests(Counters => Basic_Counters.Basic_Counters_Spec, Counter_Type_Name => "basic counters"); Test_Basic_Smart_Ptrs : aliased Basic_Smart_Ptrs_Tests.Smart_Ptrs_Test; package Protected_Smart_Ptrs_Tests is new Smart_Ptrs_Tests(Counters => Protected_Counters.Protected_Counters_Spec, Counter_Type_Name => "protected counters"); Test_Protected_Smart_Ptrs : aliased Protected_Smart_Ptrs_Tests.Smart_Ptrs_Test; Test_Unique_Ptrs : aliased Unique_Ptrs_Tests.Unique_Ptrs_Test; Test_C_Resources : aliased C_Resources_Tests.C_Resource_Test; Test_Refcounted_Flyweights : aliased Refcounted_Flyweights_Tests.Refcounted_Flyweights_Test; Test_Refcounted_KVFlyweights : aliased Refcounted_KVFlyweights_Tests.Refcounted_KVFlyweights_Test; Result : aliased Test_Suite; function Suite return AUnit.Test_Suites.Access_Test_Suite is begin Add_Test (Result'Access, Test_Basic_Smart_Ptrs'Access); Add_Test (Result'Access, Test_Protected_Smart_Ptrs'Access); Add_Test (Result'Access, Test_Unique_Ptrs'Access); Add_Test (Result'Access, Test_C_Resources'Access); Add_Test (Result'Access, Test_Refcounted_Flyweights'Access); Add_Test (Result'Access, Test_Refcounted_KVFlyweights'Access); return Result'Access; end Suite; end Auto_Counters_Suite;
os/osask/os-src/helloos1/helloos.asm
ASMlover/study
22
25221
; Copyright (c) 2013 ASMlover. 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 ofconditions and the following disclaimer. ; ; notice, this list of conditions and the following disclaimer in ; * Redistributions in binary form must reproduce the above copyright ; the documentation and/or other materialsprovided with the ; distribution. ; ; 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. DB 0xeb, 0x4e, 0x90, 0x48, 0x45, 0x4c, 0x4c, 0x4f DB 0x49, 0x50, 0x4c, 0x00, 0x02, 0x01, 0x01, 0x00 DB 0x02, 0xe0, 0x00, 0x40, 0x0b, 0xf0, 0x09, 0x00 DB 0x12, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 DB 0x40, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x29, 0xff DB 0xff, 0xff, 0xff, 0x48, 0x45, 0x4c, 0x4c, 0x4f DB 0x2d, 0x4f, 0x53, 0x20, 0x20, 0x20, 0x46, 0x41 DB 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x00, 0x00 RESB 16 DB 0xb8, 0x00, 0x00, 0x8e, 0xd0, 0xbc, 0x00, 0x7c DB 0x8e, 0xd8, 0x8e, 0xc0, 0xbe, 0x74, 0x7c, 0x8a DB 0x04, 0x83, 0xc6, 0x01, 0x3c, 0x00, 0x74, 0x09 DB 0xb4, 0x0e, 0xbb, 0x0f, 0x00, 0xcd, 0x10, 0xeb DB 0xee, 0xf4, 0xeb, 0xfd, 0x0a, 0x0a, 0x68, 0x65 DB 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x77, 0x6f, 0x72 DB 0x6c, 0x64, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00 RESB 368 DB 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa DB 0xf0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 RESB 4600 DB 0xf0, x0ff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 RESB 1469432
Data/ships/TransportType10.asm
ped7g/EliteNext
0
13593
TransportType10: DB $00, $09, $C4 DW TransportType10Edges DB TransportType10EdgesSize DB $30, $1A DB TransportType10VertSize DB TransportType10EdgesCnt DB $00, $00 DB TransportType10NormalsSize DB $10, $20, $0A DW TransportType10Normals DB $02, $00 DW TransportType10Vertices DB 0,0 ; Type and Tactics TransportType10Vertices: DB $00, $0A, $1A, $3F, $06, $77 DB $19, $04, $1A, $BF, $01, $77 DB $1C, $03, $1A, $FF, $01, $22 DB $19, $08, $1A, $FF, $02, $33 DB $1A, $08, $1A, $7F, $03, $44 DB $1D, $03, $1A, $7F, $04, $55 DB $1A, $04, $1A, $3F, $05, $66 DB $00, $06, $0C, $13, $FF, $FF DB $1E, $01, $0C, $DF, $17, $89 DB $21, $08, $0C, $DF, $12, $39 DB $21, $08, $0C, $5F, $34, $5A DB $1E, $01, $0C, $5F, $56, $AB DB $0B, $02, $1E, $DF, $89, $CD DB $0D, $08, $1E, $DF, $39, $DD DB $0E, $08, $1E, $5F, $3A, $DD DB $0B, $02, $1E, $5F, $AB, $CD DB $05, $06, $02, $87, $77, $77 DB $12, $03, $02, $87, $77, $77 DB $05, $07, $07, $A7, $77, $77 DB $12, $04, $07, $A7, $77, $77 DB $0B, $06, $0E, $A7, $77, $77 DB $0B, $05, $07, $A7, $77, $77 DB $05, $07, $0E, $27, $66, $66 DB $12, $04, $0E, $27, $66, $66 DB $0B, $05, $07, $27, $66, $66 DB $05, $06, $03, $27, $66, $66 DB $12, $03, $03, $27, $66, $66 DB $0B, $04, $08, $07, $66, $66 DB $0B, $05, $03, $27, $66, $66 DB $10, $08, $0D, $E6, $33, $33 DB $10, $08, $10, $C6, $33, $33 DB $11, $08, $0D, $66, $33, $33 DB $11, $08, $10, $46, $33, $33 DB $0D, $03, $1A, $E8, $00, $00 DB $0D, $03, $1A, $68, $00, $00 DB $09, $03, $1A, $25, $00, $00 DB $08, $03, $1A, $A5, $00, $00 TransportType10VertSize: equ $ - TransportType10Vertices TransportType10Edges: DB $1F, $07, $00, $04 DB $1F, $01, $04, $08 DB $1F, $02, $08, $0C DB $1F, $03, $0C, $10 DB $1F, $04, $10, $14 DB $1F, $05, $14, $18 DB $1F, $06, $00, $18 DB $10, $67, $00, $1C DB $1F, $17, $04, $20 DB $0B, $12, $08, $24 DB $1F, $23, $0C, $24 DB $1F, $34, $10, $28 DB $0B, $45, $14, $28 DB $1F, $56, $18, $2C DB $11, $78, $1C, $20 DB $11, $19, $20, $24 DB $11, $5A, $28, $2C DB $11, $6B, $1C, $2C DB $13, $BC, $1C, $3C DB $13, $8C, $1C, $30 DB $10, $89, $20, $30 DB $1F, $39, $24, $34 DB $1F, $3A, $28, $38 DB $10, $AB, $2C, $3C DB $1F, $9D, $30, $34 DB $1F, $3D, $34, $38 DB $1F, $AD, $38, $3C DB $1F, $CD, $30, $3C DB $07, $77, $40, $44 DB $07, $77, $48, $4C DB $07, $77, $4C, $50 DB $07, $77, $48, $50 DB $07, $77, $50, $54 DB $07, $66, $58, $5C DB $07, $66, $5C, $60 DB $07, $66, $60, $58 DB $07, $66, $64, $68 DB $07, $66, $68, $6C DB $07, $66, $64, $6C DB $07, $66, $6C, $70 DB $06, $33, $74, $78 DB $06, $33, $7C, $80 DB $08, $00, $84, $88 DB $05, $00, $88, $8C DB $05, $00, $8C, $90 DB $05, $00, $90, $84 TransportType10EdgesSize: equ $ - TransportType10Edges TransportType10EdgesCnt: equ TransportType10EdgesSize/4 TransportType10Normals: DB $3F, $00, $00, $67 DB $BF, $6F, $30, $07 DB $FF, $69, $3F, $15 DB $5F, $00, $22, $00 DB $7F, $69, $3F, $15 DB $3F, $6F, $30, $07 DB $1F, $08, $20, $03 DB $9F, $08, $20, $03 DB $93, $08, $22, $0B DB $9F, $4B, $20, $4F DB $1F, $4B, $20, $4F DB $13, $08, $22, $0B DB $1F, $00, $26, $11 DB $1F, $00, $00, $79 TransportType10NormalsSize: equ $ - TransportType10Normals TransportType10Len: equ $ - TransportType10
include/glxext.ads
docandrew/troodon
5
21756
<filename>include/glxext.ads pragma Ada_2012; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; limited with Xlib; with GLX; with GL; with System; limited with Xutil; with X11; with Interfaces.C.Strings; with glext; with bits_stdint_intn_h; package glxext is GLX_GLXEXT_VERSION : constant := 20190911; -- /usr/include/GL/glxext.h:37 GLX_ARB_context_flush_control : constant := 1; -- /usr/include/GL/glxext.h:160 GLX_CONTEXT_RELEASE_BEHAVIOR_ARB : constant := 16#2097#; -- /usr/include/GL/glxext.h:161 GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB : constant := 0; -- /usr/include/GL/glxext.h:162 GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB : constant := 16#2098#; -- /usr/include/GL/glxext.h:163 GLX_ARB_create_context : constant := 1; -- /usr/include/GL/glxext.h:167 GLX_CONTEXT_DEBUG_BIT_ARB : constant := 16#00000001#; -- /usr/include/GL/glxext.h:168 GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB : constant := 16#00000002#; -- /usr/include/GL/glxext.h:169 GLX_CONTEXT_MAJOR_VERSION_ARB : constant := 16#2091#; -- /usr/include/GL/glxext.h:170 GLX_CONTEXT_MINOR_VERSION_ARB : constant := 16#2092#; -- /usr/include/GL/glxext.h:171 GLX_CONTEXT_FLAGS_ARB : constant := 16#2094#; -- /usr/include/GL/glxext.h:172 GLX_ARB_create_context_no_error : constant := 1; -- /usr/include/GL/glxext.h:180 GLX_CONTEXT_OPENGL_NO_ERROR_ARB : constant := 16#31B3#; -- /usr/include/GL/glxext.h:181 GLX_ARB_create_context_profile : constant := 1; -- /usr/include/GL/glxext.h:185 GLX_CONTEXT_CORE_PROFILE_BIT_ARB : constant := 16#00000001#; -- /usr/include/GL/glxext.h:186 GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB : constant := 16#00000002#; -- /usr/include/GL/glxext.h:187 GLX_CONTEXT_PROFILE_MASK_ARB : constant := 16#9126#; -- /usr/include/GL/glxext.h:188 GLX_ARB_create_context_robustness : constant := 1; -- /usr/include/GL/glxext.h:192 GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB : constant := 16#00000004#; -- /usr/include/GL/glxext.h:193 GLX_LOSE_CONTEXT_ON_RESET_ARB : constant := 16#8252#; -- /usr/include/GL/glxext.h:194 GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB : constant := 16#8256#; -- /usr/include/GL/glxext.h:195 GLX_NO_RESET_NOTIFICATION_ARB : constant := 16#8261#; -- /usr/include/GL/glxext.h:196 GLX_ARB_fbconfig_float : constant := 1; -- /usr/include/GL/glxext.h:200 GLX_RGBA_FLOAT_TYPE_ARB : constant := 16#20B9#; -- /usr/include/GL/glxext.h:201 GLX_RGBA_FLOAT_BIT_ARB : constant := 16#00000004#; -- /usr/include/GL/glxext.h:202 GLX_ARB_framebuffer_sRGB : constant := 1; -- /usr/include/GL/glxext.h:206 GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB : constant := 16#20B2#; -- /usr/include/GL/glxext.h:207 GLX_ARB_multisample : constant := 1; -- /usr/include/GL/glxext.h:219 GLX_SAMPLE_BUFFERS_ARB : constant := 100000; -- /usr/include/GL/glxext.h:220 GLX_SAMPLES_ARB : constant := 100001; -- /usr/include/GL/glxext.h:221 GLX_ARB_robustness_application_isolation : constant := 1; -- /usr/include/GL/glxext.h:225 GLX_CONTEXT_RESET_ISOLATION_BIT_ARB : constant := 16#00000008#; -- /usr/include/GL/glxext.h:226 GLX_ARB_robustness_share_group_isolation : constant := 1; -- /usr/include/GL/glxext.h:230 GLX_ARB_vertex_buffer_object : constant := 1; -- /usr/include/GL/glxext.h:234 GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB : constant := 16#2095#; -- /usr/include/GL/glxext.h:235 GLX_3DFX_multisample : constant := 1; -- /usr/include/GL/glxext.h:239 GLX_SAMPLE_BUFFERS_3DFX : constant := 16#8050#; -- /usr/include/GL/glxext.h:240 GLX_SAMPLES_3DFX : constant := 16#8051#; -- /usr/include/GL/glxext.h:241 GLX_AMD_gpu_association : constant := 1; -- /usr/include/GL/glxext.h:245 GLX_GPU_VENDOR_AMD : constant := 16#1F00#; -- /usr/include/GL/glxext.h:246 GLX_GPU_RENDERER_STRING_AMD : constant := 16#1F01#; -- /usr/include/GL/glxext.h:247 GLX_GPU_OPENGL_VERSION_STRING_AMD : constant := 16#1F02#; -- /usr/include/GL/glxext.h:248 GLX_GPU_FASTEST_TARGET_GPUS_AMD : constant := 16#21A2#; -- /usr/include/GL/glxext.h:249 GLX_GPU_RAM_AMD : constant := 16#21A3#; -- /usr/include/GL/glxext.h:250 GLX_GPU_CLOCK_AMD : constant := 16#21A4#; -- /usr/include/GL/glxext.h:251 GLX_GPU_NUM_PIPES_AMD : constant := 16#21A5#; -- /usr/include/GL/glxext.h:252 GLX_GPU_NUM_SIMD_AMD : constant := 16#21A6#; -- /usr/include/GL/glxext.h:253 GLX_GPU_NUM_RB_AMD : constant := 16#21A7#; -- /usr/include/GL/glxext.h:254 GLX_GPU_NUM_SPI_AMD : constant := 16#21A8#; -- /usr/include/GL/glxext.h:255 GLX_EXT_buffer_age : constant := 1; -- /usr/include/GL/glxext.h:279 GLX_BACK_BUFFER_AGE_EXT : constant := 16#20F4#; -- /usr/include/GL/glxext.h:280 GLX_EXT_context_priority : constant := 1; -- /usr/include/GL/glxext.h:284 GLX_CONTEXT_PRIORITY_LEVEL_EXT : constant := 16#3100#; -- /usr/include/GL/glxext.h:285 GLX_CONTEXT_PRIORITY_HIGH_EXT : constant := 16#3101#; -- /usr/include/GL/glxext.h:286 GLX_CONTEXT_PRIORITY_MEDIUM_EXT : constant := 16#3102#; -- /usr/include/GL/glxext.h:287 GLX_CONTEXT_PRIORITY_LOW_EXT : constant := 16#3103#; -- /usr/include/GL/glxext.h:288 GLX_EXT_create_context_es2_profile : constant := 1; -- /usr/include/GL/glxext.h:292 GLX_CONTEXT_ES2_PROFILE_BIT_EXT : constant := 16#00000004#; -- /usr/include/GL/glxext.h:293 GLX_EXT_create_context_es_profile : constant := 1; -- /usr/include/GL/glxext.h:297 GLX_CONTEXT_ES_PROFILE_BIT_EXT : constant := 16#00000004#; -- /usr/include/GL/glxext.h:298 GLX_EXT_fbconfig_packed_float : constant := 1; -- /usr/include/GL/glxext.h:302 GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT : constant := 16#20B1#; -- /usr/include/GL/glxext.h:303 GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT : constant := 16#00000008#; -- /usr/include/GL/glxext.h:304 GLX_EXT_framebuffer_sRGB : constant := 1; -- /usr/include/GL/glxext.h:308 GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT : constant := 16#20B2#; -- /usr/include/GL/glxext.h:309 GLX_EXT_import_context : constant := 1; -- /usr/include/GL/glxext.h:313 GLX_SHARE_CONTEXT_EXT : constant := 16#800A#; -- /usr/include/GL/glxext.h:314 GLX_VISUAL_ID_EXT : constant := 16#800B#; -- /usr/include/GL/glxext.h:315 GLX_SCREEN_EXT : constant := 16#800C#; -- /usr/include/GL/glxext.h:316 GLX_EXT_libglvnd : constant := 1; -- /usr/include/GL/glxext.h:332 GLX_VENDOR_NAMES_EXT : constant := 16#20F6#; -- /usr/include/GL/glxext.h:333 GLX_EXT_no_config_context : constant := 1; -- /usr/include/GL/glxext.h:337 GLX_EXT_stereo_tree : constant := 1; -- /usr/include/GL/glxext.h:341 GLX_STEREO_TREE_EXT : constant := 16#20F5#; -- /usr/include/GL/glxext.h:352 GLX_STEREO_NOTIFY_MASK_EXT : constant := 16#00000001#; -- /usr/include/GL/glxext.h:353 GLX_STEREO_NOTIFY_EXT : constant := 16#00000000#; -- /usr/include/GL/glxext.h:354 GLX_EXT_swap_control : constant := 1; -- /usr/include/GL/glxext.h:358 GLX_SWAP_INTERVAL_EXT : constant := 16#20F1#; -- /usr/include/GL/glxext.h:359 GLX_MAX_SWAP_INTERVAL_EXT : constant := 16#20F2#; -- /usr/include/GL/glxext.h:360 GLX_EXT_swap_control_tear : constant := 1; -- /usr/include/GL/glxext.h:368 GLX_LATE_SWAPS_TEAR_EXT : constant := 16#20F3#; -- /usr/include/GL/glxext.h:369 GLX_EXT_texture_from_pixmap : constant := 1; -- /usr/include/GL/glxext.h:373 GLX_TEXTURE_1D_BIT_EXT : constant := 16#00000001#; -- /usr/include/GL/glxext.h:374 GLX_TEXTURE_2D_BIT_EXT : constant := 16#00000002#; -- /usr/include/GL/glxext.h:375 GLX_TEXTURE_RECTANGLE_BIT_EXT : constant := 16#00000004#; -- /usr/include/GL/glxext.h:376 GLX_BIND_TO_TEXTURE_RGB_EXT : constant := 16#20D0#; -- /usr/include/GL/glxext.h:377 GLX_BIND_TO_TEXTURE_RGBA_EXT : constant := 16#20D1#; -- /usr/include/GL/glxext.h:378 GLX_BIND_TO_MIPMAP_TEXTURE_EXT : constant := 16#20D2#; -- /usr/include/GL/glxext.h:379 GLX_BIND_TO_TEXTURE_TARGETS_EXT : constant := 16#20D3#; -- /usr/include/GL/glxext.h:380 GLX_Y_INVERTED_EXT : constant := 16#20D4#; -- /usr/include/GL/glxext.h:381 GLX_TEXTURE_FORMAT_EXT : constant := 16#20D5#; -- /usr/include/GL/glxext.h:382 GLX_TEXTURE_TARGET_EXT : constant := 16#20D6#; -- /usr/include/GL/glxext.h:383 GLX_MIPMAP_TEXTURE_EXT : constant := 16#20D7#; -- /usr/include/GL/glxext.h:384 GLX_TEXTURE_FORMAT_NONE_EXT : constant := 16#20D8#; -- /usr/include/GL/glxext.h:385 GLX_TEXTURE_FORMAT_RGB_EXT : constant := 16#20D9#; -- /usr/include/GL/glxext.h:386 GLX_TEXTURE_FORMAT_RGBA_EXT : constant := 16#20DA#; -- /usr/include/GL/glxext.h:387 GLX_TEXTURE_1D_EXT : constant := 16#20DB#; -- /usr/include/GL/glxext.h:388 GLX_TEXTURE_2D_EXT : constant := 16#20DC#; -- /usr/include/GL/glxext.h:389 GLX_TEXTURE_RECTANGLE_EXT : constant := 16#20DD#; -- /usr/include/GL/glxext.h:390 GLX_FRONT_LEFT_EXT : constant := 16#20DE#; -- /usr/include/GL/glxext.h:391 GLX_FRONT_RIGHT_EXT : constant := 16#20DF#; -- /usr/include/GL/glxext.h:392 GLX_BACK_LEFT_EXT : constant := 16#20E0#; -- /usr/include/GL/glxext.h:393 GLX_BACK_RIGHT_EXT : constant := 16#20E1#; -- /usr/include/GL/glxext.h:394 GLX_FRONT_EXT : constant := 16#20DE#; -- /usr/include/GL/glxext.h:395 GLX_BACK_EXT : constant := 16#20E0#; -- /usr/include/GL/glxext.h:396 GLX_AUX0_EXT : constant := 16#20E2#; -- /usr/include/GL/glxext.h:397 GLX_AUX1_EXT : constant := 16#20E3#; -- /usr/include/GL/glxext.h:398 GLX_AUX2_EXT : constant := 16#20E4#; -- /usr/include/GL/glxext.h:399 GLX_AUX3_EXT : constant := 16#20E5#; -- /usr/include/GL/glxext.h:400 GLX_AUX4_EXT : constant := 16#20E6#; -- /usr/include/GL/glxext.h:401 GLX_AUX5_EXT : constant := 16#20E7#; -- /usr/include/GL/glxext.h:402 GLX_AUX6_EXT : constant := 16#20E8#; -- /usr/include/GL/glxext.h:403 GLX_AUX7_EXT : constant := 16#20E9#; -- /usr/include/GL/glxext.h:404 GLX_AUX8_EXT : constant := 16#20EA#; -- /usr/include/GL/glxext.h:405 GLX_AUX9_EXT : constant := 16#20EB#; -- /usr/include/GL/glxext.h:406 GLX_EXT_visual_info : constant := 1; -- /usr/include/GL/glxext.h:416 GLX_X_VISUAL_TYPE_EXT : constant := 16#22#; -- /usr/include/GL/glxext.h:417 GLX_TRANSPARENT_TYPE_EXT : constant := 16#23#; -- /usr/include/GL/glxext.h:418 GLX_TRANSPARENT_INDEX_VALUE_EXT : constant := 16#24#; -- /usr/include/GL/glxext.h:419 GLX_TRANSPARENT_RED_VALUE_EXT : constant := 16#25#; -- /usr/include/GL/glxext.h:420 GLX_TRANSPARENT_GREEN_VALUE_EXT : constant := 16#26#; -- /usr/include/GL/glxext.h:421 GLX_TRANSPARENT_BLUE_VALUE_EXT : constant := 16#27#; -- /usr/include/GL/glxext.h:422 GLX_TRANSPARENT_ALPHA_VALUE_EXT : constant := 16#28#; -- /usr/include/GL/glxext.h:423 GLX_NONE_EXT : constant := 16#8000#; -- /usr/include/GL/glxext.h:424 GLX_TRUE_COLOR_EXT : constant := 16#8002#; -- /usr/include/GL/glxext.h:425 GLX_DIRECT_COLOR_EXT : constant := 16#8003#; -- /usr/include/GL/glxext.h:426 GLX_PSEUDO_COLOR_EXT : constant := 16#8004#; -- /usr/include/GL/glxext.h:427 GLX_STATIC_COLOR_EXT : constant := 16#8005#; -- /usr/include/GL/glxext.h:428 GLX_GRAY_SCALE_EXT : constant := 16#8006#; -- /usr/include/GL/glxext.h:429 GLX_STATIC_GRAY_EXT : constant := 16#8007#; -- /usr/include/GL/glxext.h:430 GLX_TRANSPARENT_RGB_EXT : constant := 16#8008#; -- /usr/include/GL/glxext.h:431 GLX_TRANSPARENT_INDEX_EXT : constant := 16#8009#; -- /usr/include/GL/glxext.h:432 GLX_EXT_visual_rating : constant := 1; -- /usr/include/GL/glxext.h:436 GLX_VISUAL_CAVEAT_EXT : constant := 16#20#; -- /usr/include/GL/glxext.h:437 GLX_SLOW_VISUAL_EXT : constant := 16#8001#; -- /usr/include/GL/glxext.h:438 GLX_NON_CONFORMANT_VISUAL_EXT : constant := 16#800D#; -- /usr/include/GL/glxext.h:439 GLX_INTEL_swap_event : constant := 1; -- /usr/include/GL/glxext.h:443 GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK : constant := 16#04000000#; -- /usr/include/GL/glxext.h:444 GLX_EXCHANGE_COMPLETE_INTEL : constant := 16#8180#; -- /usr/include/GL/glxext.h:445 GLX_COPY_COMPLETE_INTEL : constant := 16#8181#; -- /usr/include/GL/glxext.h:446 GLX_FLIP_COMPLETE_INTEL : constant := 16#8182#; -- /usr/include/GL/glxext.h:447 GLX_MESA_agp_offset : constant := 1; -- /usr/include/GL/glxext.h:451 GLX_MESA_copy_sub_buffer : constant := 1; -- /usr/include/GL/glxext.h:459 GLX_MESA_pixmap_colormap : constant := 1; -- /usr/include/GL/glxext.h:467 GLX_MESA_query_renderer : constant := 1; -- /usr/include/GL/glxext.h:475 GLX_RENDERER_VENDOR_ID_MESA : constant := 16#8183#; -- /usr/include/GL/glxext.h:476 GLX_RENDERER_DEVICE_ID_MESA : constant := 16#8184#; -- /usr/include/GL/glxext.h:477 GLX_RENDERER_VERSION_MESA : constant := 16#8185#; -- /usr/include/GL/glxext.h:478 GLX_RENDERER_ACCELERATED_MESA : constant := 16#8186#; -- /usr/include/GL/glxext.h:479 GLX_RENDERER_VIDEO_MEMORY_MESA : constant := 16#8187#; -- /usr/include/GL/glxext.h:480 GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA : constant := 16#8188#; -- /usr/include/GL/glxext.h:481 GLX_RENDERER_PREFERRED_PROFILE_MESA : constant := 16#8189#; -- /usr/include/GL/glxext.h:482 GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA : constant := 16#818A#; -- /usr/include/GL/glxext.h:483 GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA : constant := 16#818B#; -- /usr/include/GL/glxext.h:484 GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA : constant := 16#818C#; -- /usr/include/GL/glxext.h:485 GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA : constant := 16#818D#; -- /usr/include/GL/glxext.h:486 GLX_MESA_release_buffers : constant := 1; -- /usr/include/GL/glxext.h:500 GLX_MESA_set_3dfx_mode : constant := 1; -- /usr/include/GL/glxext.h:508 GLX_3DFX_WINDOW_MODE_MESA : constant := 16#1#; -- /usr/include/GL/glxext.h:509 GLX_3DFX_FULLSCREEN_MODE_MESA : constant := 16#2#; -- /usr/include/GL/glxext.h:510 GLX_MESA_swap_control : constant := 1; -- /usr/include/GL/glxext.h:518 GLX_NV_copy_buffer : constant := 1; -- /usr/include/GL/glxext.h:528 GLX_NV_copy_image : constant := 1; -- /usr/include/GL/glxext.h:538 GLX_NV_delay_before_swap : constant := 1; -- /usr/include/GL/glxext.h:546 GLX_NV_float_buffer : constant := 1; -- /usr/include/GL/glxext.h:554 GLX_FLOAT_COMPONENTS_NV : constant := 16#20B0#; -- /usr/include/GL/glxext.h:555 GLX_NV_multigpu_context : constant := 1; -- /usr/include/GL/glxext.h:559 GLX_CONTEXT_MULTIGPU_ATTRIB_NV : constant := 16#20AA#; -- /usr/include/GL/glxext.h:560 GLX_CONTEXT_MULTIGPU_ATTRIB_SINGLE_NV : constant := 16#20AB#; -- /usr/include/GL/glxext.h:561 GLX_CONTEXT_MULTIGPU_ATTRIB_AFR_NV : constant := 16#20AC#; -- /usr/include/GL/glxext.h:562 GLX_CONTEXT_MULTIGPU_ATTRIB_MULTICAST_NV : constant := 16#20AD#; -- /usr/include/GL/glxext.h:563 GLX_CONTEXT_MULTIGPU_ATTRIB_MULTI_DISPLAY_MULTICAST_NV : constant := 16#20AE#; -- /usr/include/GL/glxext.h:564 GLX_NV_multisample_coverage : constant := 1; -- /usr/include/GL/glxext.h:568 GLX_COVERAGE_SAMPLES_NV : constant := 100001; -- /usr/include/GL/glxext.h:569 GLX_COLOR_SAMPLES_NV : constant := 16#20B3#; -- /usr/include/GL/glxext.h:570 GLX_NV_present_video : constant := 1; -- /usr/include/GL/glxext.h:574 GLX_NUM_VIDEO_SLOTS_NV : constant := 16#20F0#; -- /usr/include/GL/glxext.h:575 GLX_NV_robustness_video_memory_purge : constant := 1; -- /usr/include/GL/glxext.h:585 GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV : constant := 16#20F7#; -- /usr/include/GL/glxext.h:586 GLX_NV_swap_group : constant := 1; -- /usr/include/GL/glxext.h:590 GLX_NV_video_capture : constant := 1; -- /usr/include/GL/glxext.h:608 GLX_DEVICE_ID_NV : constant := 16#20CD#; -- /usr/include/GL/glxext.h:610 GLX_UNIQUE_ID_NV : constant := 16#20CE#; -- /usr/include/GL/glxext.h:611 GLX_NUM_VIDEO_CAPTURE_SLOTS_NV : constant := 16#20CF#; -- /usr/include/GL/glxext.h:612 GLX_NV_video_out : constant := 1; -- /usr/include/GL/glxext.h:628 GLX_VIDEO_OUT_COLOR_NV : constant := 16#20C3#; -- /usr/include/GL/glxext.h:630 GLX_VIDEO_OUT_ALPHA_NV : constant := 16#20C4#; -- /usr/include/GL/glxext.h:631 GLX_VIDEO_OUT_DEPTH_NV : constant := 16#20C5#; -- /usr/include/GL/glxext.h:632 GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV : constant := 16#20C6#; -- /usr/include/GL/glxext.h:633 GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV : constant := 16#20C7#; -- /usr/include/GL/glxext.h:634 GLX_VIDEO_OUT_FRAME_NV : constant := 16#20C8#; -- /usr/include/GL/glxext.h:635 GLX_VIDEO_OUT_FIELD_1_NV : constant := 16#20C9#; -- /usr/include/GL/glxext.h:636 GLX_VIDEO_OUT_FIELD_2_NV : constant := 16#20CA#; -- /usr/include/GL/glxext.h:637 GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV : constant := 16#20CB#; -- /usr/include/GL/glxext.h:638 GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV : constant := 16#20CC#; -- /usr/include/GL/glxext.h:639 GLX_OML_swap_method : constant := 1; -- /usr/include/GL/glxext.h:657 GLX_SWAP_METHOD_OML : constant := 16#8060#; -- /usr/include/GL/glxext.h:658 GLX_SWAP_EXCHANGE_OML : constant := 16#8061#; -- /usr/include/GL/glxext.h:659 GLX_SWAP_COPY_OML : constant := 16#8062#; -- /usr/include/GL/glxext.h:660 GLX_SWAP_UNDEFINED_OML : constant := 16#8063#; -- /usr/include/GL/glxext.h:661 GLX_OML_sync_control : constant := 1; -- /usr/include/GL/glxext.h:665 GLX_SGIS_blended_overlay : constant := 1; -- /usr/include/GL/glxext.h:718 GLX_BLENDED_RGBA_SGIS : constant := 16#8025#; -- /usr/include/GL/glxext.h:719 GLX_SGIS_multisample : constant := 1; -- /usr/include/GL/glxext.h:723 GLX_SAMPLE_BUFFERS_SGIS : constant := 100000; -- /usr/include/GL/glxext.h:724 GLX_SAMPLES_SGIS : constant := 100001; -- /usr/include/GL/glxext.h:725 GLX_SGIS_shared_multisample : constant := 1; -- /usr/include/GL/glxext.h:729 GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS : constant := 16#8026#; -- /usr/include/GL/glxext.h:730 GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS : constant := 16#8027#; -- /usr/include/GL/glxext.h:731 GLX_SGIX_dmbuffer : constant := 1; -- /usr/include/GL/glxext.h:735 GLX_SGIX_fbconfig : constant := 1; -- /usr/include/GL/glxext.h:747 GLX_WINDOW_BIT_SGIX : constant := 16#00000001#; -- /usr/include/GL/glxext.h:749 GLX_PIXMAP_BIT_SGIX : constant := 16#00000002#; -- /usr/include/GL/glxext.h:750 GLX_RGBA_BIT_SGIX : constant := 16#00000001#; -- /usr/include/GL/glxext.h:751 GLX_COLOR_INDEX_BIT_SGIX : constant := 16#00000002#; -- /usr/include/GL/glxext.h:752 GLX_DRAWABLE_TYPE_SGIX : constant := 16#8010#; -- /usr/include/GL/glxext.h:753 GLX_RENDER_TYPE_SGIX : constant := 16#8011#; -- /usr/include/GL/glxext.h:754 GLX_X_RENDERABLE_SGIX : constant := 16#8012#; -- /usr/include/GL/glxext.h:755 GLX_FBCONFIG_ID_SGIX : constant := 16#8013#; -- /usr/include/GL/glxext.h:756 GLX_RGBA_TYPE_SGIX : constant := 16#8014#; -- /usr/include/GL/glxext.h:757 GLX_COLOR_INDEX_TYPE_SGIX : constant := 16#8015#; -- /usr/include/GL/glxext.h:758 GLX_SGIX_hyperpipe : constant := 1; -- /usr/include/GL/glxext.h:776 GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX : constant := 80; -- /usr/include/GL/glxext.h:796 GLX_BAD_HYPERPIPE_CONFIG_SGIX : constant := 91; -- /usr/include/GL/glxext.h:797 GLX_BAD_HYPERPIPE_SGIX : constant := 92; -- /usr/include/GL/glxext.h:798 GLX_HYPERPIPE_DISPLAY_PIPE_SGIX : constant := 16#00000001#; -- /usr/include/GL/glxext.h:799 GLX_HYPERPIPE_RENDER_PIPE_SGIX : constant := 16#00000002#; -- /usr/include/GL/glxext.h:800 GLX_PIPE_RECT_SGIX : constant := 16#00000001#; -- /usr/include/GL/glxext.h:801 GLX_PIPE_RECT_LIMITS_SGIX : constant := 16#00000002#; -- /usr/include/GL/glxext.h:802 GLX_HYPERPIPE_STEREO_SGIX : constant := 16#00000003#; -- /usr/include/GL/glxext.h:803 GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX : constant := 16#00000004#; -- /usr/include/GL/glxext.h:804 GLX_HYPERPIPE_ID_SGIX : constant := 16#8030#; -- /usr/include/GL/glxext.h:805 GLX_SGIX_pbuffer : constant := 1; -- /usr/include/GL/glxext.h:827 GLX_PBUFFER_BIT_SGIX : constant := 16#00000004#; -- /usr/include/GL/glxext.h:828 GLX_BUFFER_CLOBBER_MASK_SGIX : constant := 16#08000000#; -- /usr/include/GL/glxext.h:829 GLX_FRONT_LEFT_BUFFER_BIT_SGIX : constant := 16#00000001#; -- /usr/include/GL/glxext.h:830 GLX_FRONT_RIGHT_BUFFER_BIT_SGIX : constant := 16#00000002#; -- /usr/include/GL/glxext.h:831 GLX_BACK_LEFT_BUFFER_BIT_SGIX : constant := 16#00000004#; -- /usr/include/GL/glxext.h:832 GLX_BACK_RIGHT_BUFFER_BIT_SGIX : constant := 16#00000008#; -- /usr/include/GL/glxext.h:833 GLX_AUX_BUFFERS_BIT_SGIX : constant := 16#00000010#; -- /usr/include/GL/glxext.h:834 GLX_DEPTH_BUFFER_BIT_SGIX : constant := 16#00000020#; -- /usr/include/GL/glxext.h:835 GLX_STENCIL_BUFFER_BIT_SGIX : constant := 16#00000040#; -- /usr/include/GL/glxext.h:836 GLX_ACCUM_BUFFER_BIT_SGIX : constant := 16#00000080#; -- /usr/include/GL/glxext.h:837 GLX_SAMPLE_BUFFERS_BIT_SGIX : constant := 16#00000100#; -- /usr/include/GL/glxext.h:838 GLX_MAX_PBUFFER_WIDTH_SGIX : constant := 16#8016#; -- /usr/include/GL/glxext.h:839 GLX_MAX_PBUFFER_HEIGHT_SGIX : constant := 16#8017#; -- /usr/include/GL/glxext.h:840 GLX_MAX_PBUFFER_PIXELS_SGIX : constant := 16#8018#; -- /usr/include/GL/glxext.h:841 GLX_OPTIMAL_PBUFFER_WIDTH_SGIX : constant := 16#8019#; -- /usr/include/GL/glxext.h:842 GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX : constant := 16#801A#; -- /usr/include/GL/glxext.h:843 GLX_PRESERVED_CONTENTS_SGIX : constant := 16#801B#; -- /usr/include/GL/glxext.h:844 GLX_LARGEST_PBUFFER_SGIX : constant := 16#801C#; -- /usr/include/GL/glxext.h:845 GLX_WIDTH_SGIX : constant := 16#801D#; -- /usr/include/GL/glxext.h:846 GLX_HEIGHT_SGIX : constant := 16#801E#; -- /usr/include/GL/glxext.h:847 GLX_EVENT_MASK_SGIX : constant := 16#801F#; -- /usr/include/GL/glxext.h:848 GLX_DAMAGED_SGIX : constant := 16#8020#; -- /usr/include/GL/glxext.h:849 GLX_SAVED_SGIX : constant := 16#8021#; -- /usr/include/GL/glxext.h:850 GLX_WINDOW_SGIX : constant := 16#8022#; -- /usr/include/GL/glxext.h:851 GLX_PBUFFER_SGIX : constant := 16#8023#; -- /usr/include/GL/glxext.h:852 GLX_SGIX_swap_barrier : constant := 1; -- /usr/include/GL/glxext.h:868 GLX_SGIX_swap_group : constant := 1; -- /usr/include/GL/glxext.h:878 GLX_SGIX_video_resize : constant := 1; -- /usr/include/GL/glxext.h:886 GLX_SYNC_FRAME_SGIX : constant := 16#00000000#; -- /usr/include/GL/glxext.h:887 GLX_SYNC_SWAP_SGIX : constant := 16#00000001#; -- /usr/include/GL/glxext.h:888 GLX_SGIX_video_source : constant := 1; -- /usr/include/GL/glxext.h:904 GLX_SGIX_visual_select_group : constant := 1; -- /usr/include/GL/glxext.h:917 GLX_VISUAL_SELECT_GROUP_SGIX : constant := 16#8028#; -- /usr/include/GL/glxext.h:918 GLX_SGI_cushion : constant := 1; -- /usr/include/GL/glxext.h:922 GLX_SGI_make_current_read : constant := 1; -- /usr/include/GL/glxext.h:930 GLX_SGI_swap_control : constant := 1; -- /usr/include/GL/glxext.h:940 GLX_SGI_video_sync : constant := 1; -- /usr/include/GL/glxext.h:948 GLX_SUN_get_transparent_index : constant := 1; -- /usr/include/GL/glxext.h:958 --** Copyright (c) 2013-2018 The Khronos Group Inc. --** --** Permission is hereby granted, free of charge, to any person obtaining a --** copy of this software and/or associated documentation files (the --** "Materials"), to deal in the Materials without restriction, including --** without limitation the rights to use, copy, modify, merge, publish, --** distribute, sublicense, and/or sell copies of the Materials, and to --** permit persons to whom the Materials are furnished to do so, subject to --** the following conditions: --** --** The above copyright notice and this permission notice shall be included --** in all copies or substantial portions of the Materials. --** --** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, --** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY --** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, --** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE --** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -- --** This header is generated from the Khronos OpenGL / OpenGL ES XML --** API Registry. The current version of the Registry, generator scripts --** used to make the header, and the header can be found at --** https://github.com/KhronosGroup/OpenGL-Registry -- -- Generated C header for: -- * API: glx -- * Versions considered: .* -- * Versions emitted: 1\.[3-9] -- * Default extensions included: glx -- * Additional extensions included: _nomatch_^ -- * Extensions removed: _nomatch_^ -- type PFNGLXCREATECONTEXTATTRIBSARBPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXFBConfig; arg3 : GLX.GLXContext; arg4 : int; arg5 : access int) return GLX.GLXContext with Convention => C; -- /usr/include/GL/glxext.h:173 type PFNGLXGETGPUIDSAMDPROC is access function (arg1 : unsigned; arg2 : access unsigned) return unsigned with Convention => C; -- /usr/include/GL/glxext.h:256 type PFNGLXGETGPUINFOAMDPROC is access function (arg1 : unsigned; arg2 : int; arg3 : GL.GLenum; arg4 : unsigned; arg5 : System.Address) return int with Convention => C; -- /usr/include/GL/glxext.h:257 type PFNGLXGETCONTEXTGPUIDAMDPROC is access function (arg1 : GLX.GLXContext) return unsigned with Convention => C; -- /usr/include/GL/glxext.h:258 type PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC is access function (arg1 : unsigned; arg2 : GLX.GLXContext) return GLX.GLXContext with Convention => C; -- /usr/include/GL/glxext.h:259 type PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC is access function (arg1 : unsigned; arg2 : GLX.GLXContext; arg3 : access int) return GLX.GLXContext with Convention => C; -- /usr/include/GL/glxext.h:260 type PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC is access function (arg1 : GLX.GLXContext) return int with Convention => C; -- /usr/include/GL/glxext.h:261 type PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC is access function (arg1 : GLX.GLXContext) return int with Convention => C; -- /usr/include/GL/glxext.h:262 type PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC is access function return GLX.GLXContext with Convention => C; -- /usr/include/GL/glxext.h:263 type PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC is access procedure (arg1 : GLX.GLXContext; arg2 : GL.GLint; arg3 : GL.GLint; arg4 : GL.GLint; arg5 : GL.GLint; arg6 : GL.GLint; arg7 : GL.GLint; arg8 : GL.GLint; arg9 : GL.GLint; arg10 : GL.GLbitfield; arg11 : GL.GLenum) with Convention => C; -- /usr/include/GL/glxext.h:264 type PFNGLXGETCURRENTDISPLAYEXTPROC is access function return access Xlib.Display with Convention => C; -- /usr/include/GL/glxext.h:317 type PFNGLXQUERYCONTEXTINFOEXTPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXContext; arg3 : int; arg4 : access int) return int with Convention => C; -- /usr/include/GL/glxext.h:318 type PFNGLXGETCONTEXTIDEXTPROC is access function (arg1 : GLX.GLXContext) return GLX.GLXContextID with Convention => C; -- /usr/include/GL/glxext.h:319 type PFNGLXIMPORTCONTEXTEXTPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXContextID) return GLX.GLXContext with Convention => C; -- /usr/include/GL/glxext.h:320 type PFNGLXFREECONTEXTEXTPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLX.GLXContext) with Convention => C; -- /usr/include/GL/glxext.h:321 -- skipped anonymous struct anon_107 type GLXStereoNotifyEventEXT is record c_type : aliased int; -- /usr/include/GL/glxext.h:343 serial : aliased unsigned_long; -- /usr/include/GL/glxext.h:344 send_event : aliased int; -- /usr/include/GL/glxext.h:345 the_display : access Xlib.Display; -- /usr/include/GL/glxext.h:346 extension : aliased int; -- /usr/include/GL/glxext.h:347 evtype : aliased int; -- /usr/include/GL/glxext.h:348 window : aliased GLX.GLXDrawable; -- /usr/include/GL/glxext.h:349 stereo_tree : aliased int; -- /usr/include/GL/glxext.h:350 end record with Convention => C_Pass_By_Copy; -- /usr/include/GL/glxext.h:351 type PFNGLXSWAPINTERVALEXTPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : int) with Convention => C; -- /usr/include/GL/glxext.h:361 type PFNGLXBINDTEXIMAGEEXTPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : int; arg4 : access int) with Convention => C; -- /usr/include/GL/glxext.h:407 type PFNGLXRELEASETEXIMAGEEXTPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : int) with Convention => C; -- /usr/include/GL/glxext.h:408 type PFNGLXGETAGPOFFSETMESAPROC is access function (arg1 : System.Address) return unsigned with Convention => C; -- /usr/include/GL/glxext.h:452 type PFNGLXCOPYSUBBUFFERMESAPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : int; arg4 : int; arg5 : int; arg6 : int) with Convention => C; -- /usr/include/GL/glxext.h:460 type PFNGLXCREATEGLXPIXMAPMESAPROC is access function (arg1 : access Xlib.Display; arg2 : access Xutil.XVisualInfo; arg3 : X11.Pixmap; arg4 : X11.Colormap) return GLX.GLXPixmap with Convention => C; -- /usr/include/GL/glxext.h:468 type PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC is access function (arg1 : int; arg2 : access unsigned) return int with Convention => C; -- /usr/include/GL/glxext.h:487 type PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC is access function (arg1 : int) return Interfaces.C.Strings.chars_ptr with Convention => C; -- /usr/include/GL/glxext.h:488 type PFNGLXQUERYRENDERERINTEGERMESAPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : int; arg4 : int; arg5 : access unsigned) return int with Convention => C; -- /usr/include/GL/glxext.h:489 type PFNGLXQUERYRENDERERSTRINGMESAPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : int; arg4 : int) return Interfaces.C.Strings.chars_ptr with Convention => C; -- /usr/include/GL/glxext.h:490 type PFNGLXRELEASEBUFFERSMESAPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable) return int with Convention => C; -- /usr/include/GL/glxext.h:501 type PFNGLXSET3DFXMODEMESAPROC is access function (arg1 : GL.GLint) return GL.GLboolean with Convention => C; -- /usr/include/GL/glxext.h:511 type PFNGLXGETSWAPINTERVALMESAPROC is access function return int with Convention => C; -- /usr/include/GL/glxext.h:519 type PFNGLXSWAPINTERVALMESAPROC is access function (arg1 : unsigned) return int with Convention => C; -- /usr/include/GL/glxext.h:520 type PFNGLXCOPYBUFFERSUBDATANVPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLX.GLXContext; arg3 : GLX.GLXContext; arg4 : GL.GLenum; arg5 : GL.GLenum; arg6 : glext.GLintptr; arg7 : glext.GLintptr; arg8 : glext.GLsizeiptr) with Convention => C; -- /usr/include/GL/glxext.h:529 type PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLX.GLXContext; arg3 : GLX.GLXContext; arg4 : GL.GLuint; arg5 : GL.GLuint; arg6 : glext.GLintptr; arg7 : glext.GLintptr; arg8 : glext.GLsizeiptr) with Convention => C; -- /usr/include/GL/glxext.h:530 type PFNGLXCOPYIMAGESUBDATANVPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLX.GLXContext; arg3 : GL.GLuint; arg4 : GL.GLenum; arg5 : GL.GLint; arg6 : GL.GLint; arg7 : GL.GLint; arg8 : GL.GLint; arg9 : GLX.GLXContext; arg10 : GL.GLuint; arg11 : GL.GLenum; arg12 : GL.GLint; arg13 : GL.GLint; arg14 : GL.GLint; arg15 : GL.GLint; arg16 : GL.GLsizei; arg17 : GL.GLsizei; arg18 : GL.GLsizei) with Convention => C; -- /usr/include/GL/glxext.h:539 type PFNGLXDELAYBEFORESWAPNVPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : GL.GLfloat) return int with Convention => C; -- /usr/include/GL/glxext.h:547 type PFNGLXENUMERATEVIDEODEVICESNVPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : access int) return access unsigned with Convention => C; -- /usr/include/GL/glxext.h:576 type PFNGLXBINDVIDEODEVICENVPROC is access function (arg1 : access Xlib.Display; arg2 : unsigned; arg3 : unsigned; arg4 : access int) return int with Convention => C; -- /usr/include/GL/glxext.h:577 type PFNGLXJOINSWAPGROUPNVPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : GL.GLuint) return int with Convention => C; -- /usr/include/GL/glxext.h:591 type PFNGLXBINDSWAPBARRIERNVPROC is access function (arg1 : access Xlib.Display; arg2 : GL.GLuint; arg3 : GL.GLuint) return int with Convention => C; -- /usr/include/GL/glxext.h:592 type PFNGLXQUERYSWAPGROUPNVPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : access GL.GLuint; arg4 : access GL.GLuint) return int with Convention => C; -- /usr/include/GL/glxext.h:593 type PFNGLXQUERYMAXSWAPGROUPSNVPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : access GL.GLuint; arg4 : access GL.GLuint) return int with Convention => C; -- /usr/include/GL/glxext.h:594 type PFNGLXQUERYFRAMECOUNTNVPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : access GL.GLuint) return int with Convention => C; -- /usr/include/GL/glxext.h:595 type PFNGLXRESETFRAMECOUNTNVPROC is access function (arg1 : access Xlib.Display; arg2 : int) return int with Convention => C; -- /usr/include/GL/glxext.h:596 subtype GLXVideoCaptureDeviceNV is X11.XID; -- /usr/include/GL/glxext.h:609 type PFNGLXBINDVIDEOCAPTUREDEVICENVPROC is access function (arg1 : access Xlib.Display; arg2 : unsigned; arg3 : GLXVideoCaptureDeviceNV) return int with Convention => C; -- /usr/include/GL/glxext.h:613 type PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : access int) return access GLXVideoCaptureDeviceNV with Convention => C; -- /usr/include/GL/glxext.h:614 type PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLXVideoCaptureDeviceNV) with Convention => C; -- /usr/include/GL/glxext.h:615 type PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC is access function (arg1 : access Xlib.Display; arg2 : GLXVideoCaptureDeviceNV; arg3 : int; arg4 : access int) return int with Convention => C; -- /usr/include/GL/glxext.h:616 type PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLXVideoCaptureDeviceNV) with Convention => C; -- /usr/include/GL/glxext.h:617 subtype GLXVideoDeviceNV is unsigned; -- /usr/include/GL/glxext.h:629 type PFNGLXGETVIDEODEVICENVPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : int; arg4 : access GLXVideoDeviceNV) return int with Convention => C; -- /usr/include/GL/glxext.h:640 type PFNGLXRELEASEVIDEODEVICENVPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : GLXVideoDeviceNV) return int with Convention => C; -- /usr/include/GL/glxext.h:641 type PFNGLXBINDVIDEOIMAGENVPROC is access function (arg1 : access Xlib.Display; arg2 : GLXVideoDeviceNV; arg3 : GLX.GLXPbuffer; arg4 : int) return int with Convention => C; -- /usr/include/GL/glxext.h:642 type PFNGLXRELEASEVIDEOIMAGENVPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXPbuffer) return int with Convention => C; -- /usr/include/GL/glxext.h:643 type PFNGLXSENDPBUFFERTOVIDEONVPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXPbuffer; arg3 : int; arg4 : access unsigned_long; arg5 : GL.GLboolean) return int with Convention => C; -- /usr/include/GL/glxext.h:644 type PFNGLXGETVIDEOINFONVPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : GLXVideoDeviceNV; arg4 : access unsigned_long; arg5 : access unsigned_long) return int with Convention => C; -- /usr/include/GL/glxext.h:645 -- This code block is duplicated in glext.h, so must be protected -- Define int32_t, int64_t, and uint64_t types for UST/MSC -- (as used in the GLX_OML_sync_control extension). -- Fallback if nothing above works type PFNGLXGETSYNCVALUESOMLPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : access bits_stdint_intn_h.int64_t; arg4 : access bits_stdint_intn_h.int64_t; arg5 : access bits_stdint_intn_h.int64_t) return int with Convention => C; -- /usr/include/GL/glxext.h:703 type PFNGLXGETMSCRATEOMLPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : access bits_stdint_intn_h.int32_t; arg4 : access bits_stdint_intn_h.int32_t) return int with Convention => C; -- /usr/include/GL/glxext.h:704 type PFNGLXSWAPBUFFERSMSCOMLPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : bits_stdint_intn_h.int64_t; arg4 : bits_stdint_intn_h.int64_t; arg5 : bits_stdint_intn_h.int64_t) return bits_stdint_intn_h.int64_t with Convention => C; -- /usr/include/GL/glxext.h:705 type PFNGLXWAITFORMSCOMLPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : bits_stdint_intn_h.int64_t; arg4 : bits_stdint_intn_h.int64_t; arg5 : bits_stdint_intn_h.int64_t; arg6 : access bits_stdint_intn_h.int64_t; arg7 : access bits_stdint_intn_h.int64_t; arg8 : access bits_stdint_intn_h.int64_t) return int with Convention => C; -- /usr/include/GL/glxext.h:706 type PFNGLXWAITFORSBCOMLPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : bits_stdint_intn_h.int64_t; arg4 : access bits_stdint_intn_h.int64_t; arg5 : access bits_stdint_intn_h.int64_t; arg6 : access bits_stdint_intn_h.int64_t) return int with Convention => C; -- /usr/include/GL/glxext.h:707 subtype GLXPbufferSGIX is X11.XID; -- /usr/include/GL/glxext.h:736 type GLXFBConfigSGIX is access all GLX.uu_GLXFBConfigRec; -- /usr/include/GL/glxext.h:748 type PFNGLXGETFBCONFIGATTRIBSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : GLXFBConfigSGIX; arg3 : int; arg4 : access int) return int with Convention => C; -- /usr/include/GL/glxext.h:759 type PFNGLXCHOOSEFBCONFIGSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : access int; arg4 : access int) return System.Address with Convention => C; -- /usr/include/GL/glxext.h:760 type PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : GLXFBConfigSGIX; arg3 : X11.Pixmap) return GLX.GLXPixmap with Convention => C; -- /usr/include/GL/glxext.h:761 type PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : GLXFBConfigSGIX; arg3 : int; arg4 : GLX.GLXContext; arg5 : int) return GLX.GLXContext with Convention => C; -- /usr/include/GL/glxext.h:762 type PFNGLXGETVISUALFROMFBCONFIGSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : GLXFBConfigSGIX) return access Xutil.XVisualInfo with Convention => C; -- /usr/include/GL/glxext.h:763 type PFNGLXGETFBCONFIGFROMVISUALSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : access Xutil.XVisualInfo) return GLXFBConfigSGIX with Convention => C; -- /usr/include/GL/glxext.h:764 -- Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] -- skipped anonymous struct anon_109 subtype GLXHyperpipeNetworkSGIX_array8453 is Interfaces.C.char_array (0 .. 79); type GLXHyperpipeNetworkSGIX is record pipeName : aliased GLXHyperpipeNetworkSGIX_array8453; -- /usr/include/GL/glxext.h:778 networkId : aliased int; -- /usr/include/GL/glxext.h:779 end record with Convention => C_Pass_By_Copy; -- /usr/include/GL/glxext.h:780 -- Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] -- skipped anonymous struct anon_110 subtype GLXHyperpipeConfigSGIX_array8453 is Interfaces.C.char_array (0 .. 79); type GLXHyperpipeConfigSGIX is record pipeName : aliased GLXHyperpipeConfigSGIX_array8453; -- /usr/include/GL/glxext.h:782 channel : aliased int; -- /usr/include/GL/glxext.h:783 participationType : aliased unsigned; -- /usr/include/GL/glxext.h:784 timeSlice : aliased int; -- /usr/include/GL/glxext.h:785 end record with Convention => C_Pass_By_Copy; -- /usr/include/GL/glxext.h:786 -- Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] -- skipped anonymous struct anon_111 subtype GLXPipeRect_array8453 is Interfaces.C.char_array (0 .. 79); type GLXPipeRect is record pipeName : aliased GLXPipeRect_array8453; -- /usr/include/GL/glxext.h:788 srcXOrigin : aliased int; -- /usr/include/GL/glxext.h:789 srcYOrigin : aliased int; -- /usr/include/GL/glxext.h:789 srcWidth : aliased int; -- /usr/include/GL/glxext.h:789 srcHeight : aliased int; -- /usr/include/GL/glxext.h:789 destXOrigin : aliased int; -- /usr/include/GL/glxext.h:790 destYOrigin : aliased int; -- /usr/include/GL/glxext.h:790 destWidth : aliased int; -- /usr/include/GL/glxext.h:790 destHeight : aliased int; -- /usr/include/GL/glxext.h:790 end record with Convention => C_Pass_By_Copy; -- /usr/include/GL/glxext.h:791 -- Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] -- skipped anonymous struct anon_112 subtype GLXPipeRectLimits_array8453 is Interfaces.C.char_array (0 .. 79); type GLXPipeRectLimits is record pipeName : aliased GLXPipeRectLimits_array8453; -- /usr/include/GL/glxext.h:793 XOrigin : aliased int; -- /usr/include/GL/glxext.h:794 YOrigin : aliased int; -- /usr/include/GL/glxext.h:794 maxHeight : aliased int; -- /usr/include/GL/glxext.h:794 maxWidth : aliased int; -- /usr/include/GL/glxext.h:794 end record with Convention => C_Pass_By_Copy; -- /usr/include/GL/glxext.h:795 type PFNGLXQUERYHYPERPIPENETWORKSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : access int) return access GLXHyperpipeNetworkSGIX with Convention => C; -- /usr/include/GL/glxext.h:806 type PFNGLXHYPERPIPECONFIGSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : int; arg4 : access GLXHyperpipeConfigSGIX; arg5 : access int) return int with Convention => C; -- /usr/include/GL/glxext.h:807 type PFNGLXQUERYHYPERPIPECONFIGSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : access int) return access GLXHyperpipeConfigSGIX with Convention => C; -- /usr/include/GL/glxext.h:808 type PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int) return int with Convention => C; -- /usr/include/GL/glxext.h:809 type PFNGLXBINDHYPERPIPESGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int) return int with Convention => C; -- /usr/include/GL/glxext.h:810 type PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : int; arg4 : int; arg5 : System.Address; arg6 : System.Address) return int with Convention => C; -- /usr/include/GL/glxext.h:811 type PFNGLXHYPERPIPEATTRIBSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : int; arg4 : int; arg5 : System.Address) return int with Convention => C; -- /usr/include/GL/glxext.h:812 type PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : int; arg4 : int; arg5 : System.Address) return int with Convention => C; -- /usr/include/GL/glxext.h:813 type PFNGLXCREATEGLXPBUFFERSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : GLXFBConfigSGIX; arg3 : unsigned; arg4 : unsigned; arg5 : access int) return GLXPbufferSGIX with Convention => C; -- /usr/include/GL/glxext.h:853 type PFNGLXDESTROYGLXPBUFFERSGIXPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLXPbufferSGIX) with Convention => C; -- /usr/include/GL/glxext.h:854 type PFNGLXQUERYGLXPBUFFERSGIXPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLXPbufferSGIX; arg3 : int; arg4 : access unsigned) with Convention => C; -- /usr/include/GL/glxext.h:855 type PFNGLXSELECTEVENTSGIXPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : unsigned_long) with Convention => C; -- /usr/include/GL/glxext.h:856 type PFNGLXGETSELECTEDEVENTSGIXPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : access unsigned_long) with Convention => C; -- /usr/include/GL/glxext.h:857 type PFNGLXBINDSWAPBARRIERSGIXPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : int) with Convention => C; -- /usr/include/GL/glxext.h:869 type PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : access int) return int with Convention => C; -- /usr/include/GL/glxext.h:870 type PFNGLXJOINSWAPGROUPSGIXPROC is access procedure (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : GLX.GLXDrawable) with Convention => C; -- /usr/include/GL/glxext.h:879 type PFNGLXBINDCHANNELTOWINDOWSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : int; arg4 : X11.Window) return int with Convention => C; -- /usr/include/GL/glxext.h:889 type PFNGLXCHANNELRECTSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : int; arg4 : int; arg5 : int; arg6 : int; arg7 : int) return int with Convention => C; -- /usr/include/GL/glxext.h:890 type PFNGLXQUERYCHANNELRECTSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : int; arg4 : access int; arg5 : access int; arg6 : access int; arg7 : access int) return int with Convention => C; -- /usr/include/GL/glxext.h:891 type PFNGLXQUERYCHANNELDELTASSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : int; arg4 : access int; arg5 : access int; arg6 : access int; arg7 : access int) return int with Convention => C; -- /usr/include/GL/glxext.h:892 type PFNGLXCHANNELRECTSYNCSGIXPROC is access function (arg1 : access Xlib.Display; arg2 : int; arg3 : int; arg4 : GL.GLenum) return int with Convention => C; -- /usr/include/GL/glxext.h:893 subtype GLXVideoSourceSGIX is X11.XID; -- /usr/include/GL/glxext.h:905 type PFNGLXCUSHIONSGIPROC is access procedure (arg1 : access Xlib.Display; arg2 : X11.Window; arg3 : float) with Convention => C; -- /usr/include/GL/glxext.h:923 type PFNGLXMAKECURRENTREADSGIPROC is access function (arg1 : access Xlib.Display; arg2 : GLX.GLXDrawable; arg3 : GLX.GLXDrawable; arg4 : GLX.GLXContext) return int with Convention => C; -- /usr/include/GL/glxext.h:931 type PFNGLXGETCURRENTREADDRAWABLESGIPROC is access function return GLX.GLXDrawable with Convention => C; -- /usr/include/GL/glxext.h:932 type PFNGLXSWAPINTERVALSGIPROC is access function (arg1 : int) return int with Convention => C; -- /usr/include/GL/glxext.h:941 type PFNGLXGETVIDEOSYNCSGIPROC is access function (arg1 : access unsigned) return int with Convention => C; -- /usr/include/GL/glxext.h:949 type PFNGLXWAITVIDEOSYNCSGIPROC is access function (arg1 : int; arg2 : int; arg3 : access unsigned) return int with Convention => C; -- /usr/include/GL/glxext.h:950 type PFNGLXGETTRANSPARENTINDEXSUNPROC is access function (arg1 : access Xlib.Display; arg2 : X11.Window; arg3 : X11.Window; arg4 : access unsigned_long) return int with Convention => C; -- /usr/include/GL/glxext.h:959 end glxext;
oeis/163/A163066.asm
neoneye/loda-programs
11
91711
<gh_stars>10-100 ; A163066: a(n) = 12*a(n-1) - 31*a(n-2) for n > 1; a(0) = 2, a(1) = 17. ; Submitted by <NAME> ; 2,17,142,1177,9722,80177,660742,5443417,44838002,369310097,3041743102,25052304217,206333614442,1699381942577,13996241263222,115274054938777,949405180105442,7819366458163217,64400836914689902,530409682773219097,4368490248923242202,35979182821109114417,296326996136688864742,2440569286185883829977,20100694553993251152722,165550686776156615103377,1363486710140088595506142,11229769231620208077869017,92489142765099750473737802,761746867000970555270914097,6273798978293554398565097302 mov $1,6 mov $3,3 lpb $0 sub $0,1 mov $2,$3 mul $2,5 mul $3,6 add $3,$1 mul $1,6 add $1,$2 lpe mov $0,$1 div $0,3
oeis/190/A190119.asm
neoneye/loda-programs
11
166025
; A190119: a(n) = Sum_{k=1..n} lcm(k,k')/k, where k' is arithmetic derivative of k. ; Submitted by <NAME>(s1) ; 0,1,2,3,4,9,10,13,15,22,23,27,28,37,45,47,48,55,56,62,72,85,86,97,99,114,115,123,124,155,156,161,175,194,206,211,212,233,249,266,267,308,309,321,334,359,360,367,369,378,398,412,413,416,432,455,477,508,509,532,533,566,583,586,604,665,666,684,710,769,770,783,784,823,834,854,872,943,944,955,959,1002,1003,1034,1056,1101,1133,1168,1169,1210,1230,1254,1288,1337,1361,1378,1379,1390,1415,1422 mov $3,$0 mov $5,$0 lpb $5 mov $0,$3 sub $5,1 sub $0,$5 mov $1,1 add $1,$0 add $0,1 seq $0,3415 ; a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(mn) = m*a(n) + n*a(m). mov $2,$0 gcd $2,$1 mov $1,$0 div $1,$2 mul $1,3 sub $1,3 div $1,3 add $1,1 add $4,$1 lpe mov $0,$4
4-high/gel/applet/demo/skinning/human/human_model/launch_human_model.adb
charlie5/lace-alire
1
16464
with gel.Window.setup, gel.Applet.gui_world, gel.Camera; with gel.Sprite, openGL.Model.box.lit_colored_textured, openGL.Model.any, openGL.Model.sphere.lit_colored_textured, gel.Human, gel.Forge; with opengl.Palette, opengl.IO, float_Math, ada.Calendar, ada.Strings.fixed; with float_Math.algebra.linear.d3; use float_Math.algebra.linear.d3; -- with float_Math.algebra.linear.d4; use float_Math.algebra.linear.d4; with ada.Text_IO; with GEL.human_Types; with physics.Model; with ada.Exceptions; procedure launch_human_Model -- -- Drops an gel human model onto a simple box terrain. -- -- is use gel.Applet, openGL.Model.box, gel.Human, gel.human_Types, openGL, opengl.Palette, float_Math, ada.Calendar, ada.Strings, ada.Strings.fixed, ada.Text_IO, ada.Exceptions; use type math.Real, opengl.Real; the_Applet : constant gel.Applet.gui_World.view := gel.Forge.new_gui_Applet ("human Model", 1920, 1200); the_Ground : constant gel.Sprite.view := gel.Forge.new_box_Sprite (the_Applet.gui_World, mass => 0.0, size => (50.0, 1.0, 50.0)); -- the_human_graphics_Model : aliased gel.graphics_Model.open_gl.view -- := gel.graphics_Model.open_gl.forge.new_Model (scale => (1.0, 1.0, 1.0), -- -- model => gel.to_Asset ("assets/gel/model/gel-human.dae"), -- model => gel.to_Asset ("assets/gel/collada/mh-human-dae.dae"), -- -- model => gel.to_Asset ("assets/gel/collada/alfieri.dae"), -- texture => gel.null_Asset, -- gel.to_Asset ("assets/collada/gel-human-texture.tga"), -- Texture_is_lucid => False); -- the_human_physics_Model : constant gel.physics_Model.view -- := gel.physics_Model.Forge.new_physics_Model (shape_Info => (kind => gel.physics_Model.Cube, -- half_extents => 0.5 * (4.0, 1.0, 2.0)), -- mass => 1.0); -- -- the_human_physics_Model : constant gel.physics_Model.view -- -- := gel.physics_Model.Forge.new_physics_Model (shape_Info => (kind => gel.physics_Model.a_Sphere, -- -- sphere_radius => 0.2), -- -- mass => 0.5); my_Human : aliased gel.Human.item; Counter : Integer := 0; next_render_Time : ada.calendar.Time; begin the_Applet.gui_World.Gravity_is ((0.0, -1.0, 0.0)); the_Applet.gui_Camera.Site_is ((0.0, 0.0, 40.0)); -- Position the camera the_Applet.enable_simple_Dolly (1); -- Enable user camera control via keyboards the_Applet.enable_Mouse (detect_Motion => False); -- Enable mouse events. gel.Human.use_Model ("assets/gel/collada/mh-human-dae.dae"); -- gel.Human.use_Model ("assets/gel/collada/alfieri.dae"); my_Human.define (the_Applet.gui_World, null, -- the_human_graphics_Model, null, -- the_human_physics_Model, mass => 1.0); the_Applet.gui_World.add (my_Human.base_Sprite, and_Children => True); -- Add the human my_Human.base_Sprite.move ((0.0, 10.0, 0.0)); -- the_Applet.gui_World.add (the_Ground); -- Add the ground the_Ground.Site_is ((0.0, -10.0, 0.0)); -- my_Human.motion_Mode_is (gel.Human.Animation); -- the_Human.motion_Mode_is (gel.Human_v1.Physics); -- my_Human.enable_Graphics; -- my_Human.attach_program_Parameters_to_model_Faces; next_render_Time := ada.Calendar.clock; while the_Applet.is_open loop -- if Counter = 150 then -- my_Human.Sprite (Head).Speed_is ((5.0, 5.0, 0.0)); -- my_Human.Sprite (Head).Gyre_is ((0.0, 5.0, 0.0)); -- -- my_Human.Sprite (Hand_L).Speed_is ((5.0, 10.0, 0.0)); -- my_Human.Sprite (Hand_L).Gyre_is ((0.0, 5.0, 0.0)); -- -- my_Human.Sprite (upLeg_L).Speed_is ((-5.0, 10.0, 0.0)); -- my_Human.Sprite (upLeg_L).Gyre_is ((0.0, 5.0, 0.0)); -- -- my_Human.Sprite (Foot_L).Speed_is ((-5.0, 10.0, 0.0)); -- my_Human.Sprite (Foot_L).Gyre_is ((0.0, 5.0, 0.0)); -- -- Counter := 0; -- else -- Counter := Counter + 1; -- end if; the_Applet.gui_World.evolve; -- (by => 1.0/60.0); -- evolve the world -- my_Human .evolve; my_Human.animate (world_Age => the_Applet.World.Age); the_Applet.freshen; -- handle any new events and update the screen delay 0.5; next_render_Time := next_render_Time + 1.0/60.0; delay until next_render_Time; end loop; -- opengl.IO.stop_Capture; the_Applet.destroy; exception when E : others => put_Line (Exception_Information (E)); end launch_human_Model;
src/ada-libc/src/libc-fcntl.ads
mstewartgallus/linted
0
25157
<reponame>mstewartgallus/linted -- Copyright 2015 <NAME> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -- implied. See the License for the specific language governing -- permissions and limitations under the License. with Interfaces.C; with Interfaces.C.Strings; with Libc.Sys.Types; package Libc.Fcntl with Spark_Mode => Off is pragma Preelaborate; O_ACCMODE : constant := 8#3#; O_RDONLY : constant := 8#0#; O_WRONLY : constant := 8#1#; O_RDWR : constant := 8#2#; O_CREAT : constant := 8#100#; O_EXCL : constant := 8#200#; O_NOCTTY : constant := 8#400#; O_TRUNC : constant := 8#1000#; O_APPEND : constant := 8#2000#; O_NONBLOCK : constant := 8#4000#; O_NDELAY : constant := O_NONBLOCK; O_SYNC : constant := 8#4010000#; O_FSYNC : constant := O_SYNC; O_ASYNC : constant := 8#20000#; O_CLOEXEC : constant := 8#2000000#; F_GETLK : constant := 5; F_SETLK : constant := 6; F_SETLKW : constant := 7; F_GETLK64 : constant := 12; F_SETLK64 : constant := 13; F_SETLKW64 : constant := 14; F_DUPFD : constant := 0; F_GETFD : constant := 1; F_SETFD : constant := 2; F_GETFL : constant := 3; F_SETFL : constant := 4; FD_CLOEXEC : constant := 1; F_RDLCK : constant := 0; F_WRLCK : constant := 1; F_UNLCK : constant := 2; F_EXLCK : constant := 4; F_SHLCK : constant := 8; -- S_IFMT __S_IFMT -- S_IFDIR __S_IFDIR -- S_IFCHR __S_IFCHR -- S_IFBLK __S_IFBLK -- S_IFREG __S_IFREG -- S_IFIFO __S_IFIFO -- S_IFLNK __S_IFLNK -- S_IFSOCK __S_IFSOCK -- S_ISUID __S_ISUID -- S_ISGID __S_ISGID -- S_ISVTX __S_ISVTX -- S_IRUSR __S_IREAD -- S_IWUSR __S_IWRITE -- S_IXUSR __S_IEXEC -- S_IRWXU (__S_IREAD|__S_IWRITE|__S_IEXEC) -- S_IRGRP (S_IRUSR >> 3) -- S_IWGRP (S_IWUSR >> 3) -- S_IXGRP (S_IXUSR >> 3) -- S_IRWXG (S_IRWXU >> 3) -- S_IROTH (S_IRGRP >> 3) -- S_IWOTH (S_IWGRP >> 3) -- S_IXOTH (S_IXGRP >> 3) -- S_IRWXO (S_IRWXG >> 3) R_OK : constant := 4; W_OK : constant := 2; X_OK : constant := 1; F_OK : constant := 0; SEEK_SET : constant := 0; SEEK_CUR : constant := 1; SEEK_END : constant := 2; F_ULOCK : constant := 0; F_LOCK : constant := 1; F_TLOCK : constant := 2; F_TEST : constant := 3; function fcntl (fd : Interfaces.C.int; cmd : Interfaces.C.int -- , ... ) return Interfaces.C.int; -- /usr/include/fcntl.h:137 pragma Import (C_Variadic_2, fcntl, "fcntl"); function open (file : Interfaces.C.Strings.chars_ptr; oflag : Interfaces.C.int; mode : Libc.Sys.Types.mode_t) return Interfaces.C.int; -- /usr/include/fcntl.h:146 pragma Import (C, open, "open"); function open64 (file : Interfaces.C.Strings.chars_ptr; oflag : Interfaces.C.int; mode : Libc.Sys.Types.mode_t) return Interfaces.C.int; -- /usr/include/fcntl.h:156 pragma Import (C, open64, "open64"); function openat (fd : Interfaces.C.int; file : Interfaces.C.Strings.chars_ptr; oflag : Interfaces.C.int -- , ... ) return Interfaces.C.int; -- /usr/include/fcntl.h:170 pragma Import (C_Variadic_3, openat, "openat"); function openat64 (fd : Interfaces.C.int; file : Interfaces.C.Strings.chars_ptr; oflag : Interfaces.C.int -- , ... ) return Interfaces.C.int; -- /usr/include/fcntl.h:181 pragma Import (C_Variadic_3, openat64, "openat64"); function creat (file : Interfaces.C.Strings.chars_ptr; mode : Libc.Sys.Types.mode_t) return Interfaces.C.int; -- /usr/include/fcntl.h:192 pragma Import (C, creat, "creat"); function creat64 (file : Interfaces.C.Strings.chars_ptr; mode : Libc.Sys.Types.mode_t) return Interfaces.C.int; -- /usr/include/fcntl.h:202 pragma Import (C, creat64, "creat64"); function lockf (fd : Interfaces.C.int; cmd : Interfaces.C.int; len : Libc.Sys.Types.off_t) return Interfaces.C.int; -- /usr/include/fcntl.h:221 pragma Import (C, lockf, "lockf"); function lockf64 (fd : Interfaces.C.int; cmd : Interfaces.C.int; len : Libc.Sys.Types.off64_t) return Interfaces.C.int; -- /usr/include/fcntl.h:230 pragma Import (C, lockf64, "lockf64"); function posix_fadvise (fd : Interfaces.C.int; offset : Libc.Sys.Types.off_t; len : Libc.Sys.Types.off_t; advise : Interfaces.C.int) return Interfaces.C.int; -- /usr/include/fcntl.h:238 pragma Import (C, posix_fadvise, "posix_fadvise"); function posix_fadvise64 (fd : Interfaces.C.int; offset : Libc.Sys.Types.off64_t; len : Libc.Sys.Types.off64_t; advise : Interfaces.C.int) return Interfaces.C.int; -- /usr/include/fcntl.h:250 pragma Import (C, posix_fadvise64, "posix_fadvise64"); function posix_fallocate (fd : Interfaces.C.int; offset : Libc.Sys.Types.off_t; len : Libc.Sys.Types.off_t) return Interfaces.C.int; -- /usr/include/fcntl.h:260 pragma Import (C, posix_fallocate, "posix_fallocate"); function posix_fallocate64 (fd : Interfaces.C.int; offset : Libc.Sys.Types.off64_t; len : Libc.Sys.Types.off64_t) return Interfaces.C.int; -- /usr/include/fcntl.h:271 pragma Import (C, posix_fallocate64, "posix_fallocate64"); end Libc.Fcntl;
Definition/Typed/Consequences/Canonicity.agda
CoqHott/logrel-mltt
2
10381
<gh_stars>1-10 {-# OPTIONS --safe #-} module Definition.Typed.Consequences.Canonicity where open import Definition.Untyped open import Definition.Typed open import Definition.Typed.Weakening open import Definition.Typed.Properties open import Definition.Typed.EqRelInstance open import Definition.LogicalRelation open import Definition.LogicalRelation.Irrelevance open import Definition.LogicalRelation.ShapeView open import Definition.LogicalRelation.Fundamental.Reducibility open import Tools.Empty open import Tools.Nat open import Tools.Product -- Turns a natural number into its term representation sucᵏ : Nat → Term sucᵏ 0 = zero sucᵏ (1+ n) = suc (sucᵏ n) -- No neutral terms are well-formed in an empty context -- we need to postulate consistency -- as we have several uninhabited propositions, we build an predicate -- to characterize them -- Note that we could also have defined reductions to Empty of other -- forms of unihabited types data isFalse : Term → Set where isEmpty : ∀ {lEmpty} → isFalse (Empty lEmpty) isIdℕΠ : ∀ {r A rA B} → isFalse (Id (Univ r ⁰) ℕ (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° ⁰)) isIdΠℕ : ∀ {r A rA B} → isFalse (Id (Univ r ⁰) (Π A ^ rA ° ⁰ ▹ B ° ⁰ ° ⁰) ℕ) isIdΠΠ%! : ∀ {r A B A' B'} → isFalse (Id (Univ r ⁰) (Π A ^ % ° ⁰ ▹ B ° ⁰ ° ⁰) (Π A' ^ ! ° ⁰ ▹ B' ° ⁰ ° ⁰)) isIdΠΠ!% : ∀ {r A B A' B'} → isFalse (Id (Univ r ⁰) (Π A ^ ! ° ⁰ ▹ B ° ⁰ ° ⁰) (Π A' ^ % ° ⁰ ▹ B' ° ⁰ ° ⁰)) consistency = ∀ {t A l} → isFalse A → ε ⊢ t ∷ A ^ [ % , l ] → ⊥ noNe : ∀ {t A r} → consistency → ε ⊢ t ∷ A ^ r → Neutral t → ⊥ -- impossible cases thanks to consistency noNe consistency (Emptyrecⱼ A ⊢e) Emptyrecₙ = consistency isEmpty ⊢e noNe consistency (castⱼ [A] [A]₁ [A]₂ [A]₃) castℕΠₙ = consistency isIdℕΠ [A]₂ noNe consistency (castⱼ [A] [A]₁ [A]₂ [A]₃) castΠℕₙ = consistency isIdΠℕ [A]₂ noNe consistency (castⱼ [A] [A]₁ [A]₂ [A]₃) castΠΠ%!ₙ = consistency isIdΠΠ%! [A]₂ noNe consistency (castⱼ [A] [A]₁ [A]₂ [A]₃) castΠΠ!%ₙ = consistency isIdΠΠ!% [A]₂ -- possible cases proven by induction noNe consistency (⊢t ∘ⱼ ⊢t₁) (∘ₙ neT) = noNe consistency ⊢t neT noNe consistency (natrecⱼ x ⊢t ⊢t₁ ⊢t₂) (natrecₙ neT) = noNe consistency ⊢t₂ neT noNe consistency (var x₁ ()) (var x) noNe consistency (Idⱼ [A] [A]₁ [A]₂) (Idₙ neT) = noNe consistency [A] neT noNe consistency (Idⱼ [A] [A]₁ [A]₂) (Idℕₙ neT) = noNe consistency [A]₁ neT noNe consistency (Idⱼ [A] [A]₁ [A]₂) (Idℕ0ₙ neT) = noNe consistency [A]₂ neT noNe consistency (Idⱼ [A] [A]₁ [A]₂) (IdℕSₙ neT) = noNe consistency [A]₂ neT noNe consistency (Idⱼ [A] [A]₁ [A]₂) (IdUₙ neT) = noNe consistency [A]₁ neT noNe consistency (Idⱼ [A] [A]₁ [A]₂) (IdUℕₙ neT) = noNe consistency [A]₂ neT noNe consistency (Idⱼ [A] [A]₁ [A]₂) (IdUΠₙ neT) = noNe consistency [A]₂ neT noNe consistency (castⱼ [A] [A]₁ [A]₂ [A]₃) (castₙ neT) = noNe consistency [A] neT noNe consistency (castⱼ [A] [A]₁ [A]₂ [A]₃) (castℕₙ neT) = noNe consistency [A]₁ neT noNe consistency (castⱼ [A] [A]₁ [A]₂ [A]₃) (castΠₙ neT) = noNe consistency [A]₁ neT noNe consistency (castⱼ [A] [A]₁ [A]₂ [A]₃) (castℕℕₙ neT) = noNe consistency [A]₃ neT noNe consistency (conv ⊢t x) (var n) = noNe consistency ⊢t (var n) noNe consistency (conv ⊢t x) (∘ₙ neT) = noNe consistency ⊢t (∘ₙ neT) noNe consistency (conv ⊢t x) (natrecₙ neT) = noNe consistency ⊢t (natrecₙ neT) noNe consistency (conv ⊢t x) (Idₙ neT) = noNe consistency ⊢t (Idₙ neT) noNe consistency (conv ⊢t x) (Idℕₙ neT) = noNe consistency ⊢t (Idℕₙ neT) noNe consistency (conv ⊢t x) (Idℕ0ₙ neT) = noNe consistency ⊢t (Idℕ0ₙ neT) noNe consistency (conv ⊢t x) (IdℕSₙ neT) = noNe consistency ⊢t (IdℕSₙ neT) noNe consistency (conv ⊢t x) (IdUₙ neT) = noNe consistency ⊢t (IdUₙ neT) noNe consistency (conv ⊢t x) (IdUℕₙ neT) = noNe consistency ⊢t (IdUℕₙ neT) noNe consistency (conv ⊢t x) (IdUΠₙ neT) = noNe consistency ⊢t (IdUΠₙ neT) noNe consistency (conv ⊢t x) (castₙ neT) = noNe consistency ⊢t (castₙ neT) noNe consistency (conv ⊢t x) (castℕₙ neT) = noNe consistency ⊢t (castℕₙ neT) noNe consistency (conv ⊢t x) (castΠₙ neT) = noNe consistency ⊢t (castΠₙ neT) noNe consistency (conv ⊢t x) (castℕℕₙ neT) = noNe consistency ⊢t (castℕℕₙ neT) noNe consistency (conv ⊢t x) castℕΠₙ = noNe consistency ⊢t castℕΠₙ noNe consistency (conv ⊢t x) castΠℕₙ = noNe consistency ⊢t castΠℕₙ noNe consistency (conv ⊢t x) castΠΠ%!ₙ = noNe consistency ⊢t castΠΠ%!ₙ noNe consistency (conv ⊢t x) castΠΠ!%ₙ = noNe consistency ⊢t castΠΠ!%ₙ noNe consistency (conv ⊢t x) Emptyrecₙ = noNe consistency ⊢t Emptyrecₙ -- Helper function for canonicity for reducible natural properties canonicity″ : ∀ {t} → consistency → Natural-prop ε t → ∃ λ k → ε ⊢ t ≡ sucᵏ k ∷ ℕ ^ [ ! , ι ⁰ ] canonicity″ consistency (sucᵣ (ℕₜ n₁ d n≡n prop)) = let a , b = canonicity″ consistency prop in 1+ a , suc-cong (trans (subset*Term (redₜ d)) b) canonicity″ consistency zeroᵣ = 0 , refl (zeroⱼ ε) canonicity″ consistency (ne (neNfₜ neK ⊢k k≡k)) = ⊥-elim (noNe consistency ⊢k neK) -- Helper function for canonicity for specific reducible natural numbers canonicity′ : ∀ {t l} → consistency → ([ℕ] : ε ⊩⟨ l ⟩ℕ ℕ) → ε ⊩⟨ l ⟩ t ∷ ℕ ^ [ ! , ι ⁰ ] / ℕ-intr [ℕ] → ∃ λ k → ε ⊢ t ≡ sucᵏ k ∷ ℕ ^ [ ! , ι ⁰ ] canonicity′ consistency (noemb [ℕ]) (ℕₜ n d n≡n prop) = let a , b = canonicity″ consistency prop in a , trans (subset*Term (redₜ d)) b canonicity′ consistency (emb emb< [ℕ]) [t] = canonicity′ consistency [ℕ] [t] canonicity′ consistency (emb ∞< [ℕ]) [t] = canonicity′ consistency [ℕ] [t] -- Canonicity of natural numbers canonicity : ∀ {t} → consistency → ε ⊢ t ∷ ℕ ^ [ ! , ι ⁰ ] → ∃ λ k → ε ⊢ t ≡ sucᵏ k ∷ ℕ ^ [ ! , ι ⁰ ] canonicity consistency ⊢t with reducibleTerm ⊢t canonicity consistency ⊢t | [ℕ] , [t] = canonicity′ consistency (ℕ-elim [ℕ]) (irrelevanceTerm [ℕ] (ℕ-intr (ℕ-elim [ℕ])) [t])
examples/rfm69_sender/main.adb
ekoeppen/MSP430_Generic_Ada_Drivers
0
14621
<gh_stars>0 with MSP430_SVD; use MSP430_SVD; with MSPGD.Board; use MSPGD.Board; with MSPGD.Clock; use MSPGD.Clock; with MSPGD.Clock.Source; with MSPGD.GPIO; use MSPGD.GPIO; with MSPGD.GPIO.Pin; with Drivers.Text_IO; with Drivers.NTC; with Drivers.RFM69; with Interfaces; use Interfaces; procedure Main is pragma Preelaborate; package IRQ is new MSPGD.GPIO.Pin (Port => 2, Pin => 2); package Text_IO is new Drivers.Text_IO (USART => UART); package Radio is new Drivers.RFM69 (SPI => SPI, Chip_Select => SSEL, IRQ => IRQ, Packet_Size => 62, Frequency => 915_000_000); package Delay_Clock is new MSPGD.Clock.Source (Frequency => 3000, Input => VLO, Source => ACLK); package NTC is new Drivers.NTC; procedure Print_Registers is new Radio.Print_Registers(Put_Line => Text_IO.Put_Line); procedure TX_Test is TX_Data : Radio.Packet_Type; Input : String (1 .. 16); Len : Natural; Counter : Unsigned_8 := 0; Temperature, Voltage : Unsigned_32; Send_Temperature : Boolean := True; begin TX_Data (1) := 16#D8#; TX_Data (2) := 16#40#; TX_Data (3) := 16#1A#; loop -- Text_IO.Get_Line (Input, Len); Temperature := NTC.Value (Integer (Read_NTC)); Voltage := Unsigned_32 (Read_VCC); Text_IO.Put ("NTC value: "); Text_IO.Put_Hex (Temperature); Text_IO.Put (" Voltage: "); Text_IO.Put_Hex (Voltage); Text_IO.New_Line; if Send_Temperature then TX_Data (4) := Unsigned_8 ((Temperature / 2 ** 24) mod 2 ** 8); TX_Data (5) := Unsigned_8 ((Temperature / 2 ** 16) mod 2 ** 8); TX_Data (6) := Unsigned_8 ((Temperature / 2 ** 8) mod 2 ** 8); TX_Data (7) := Unsigned_8 (Temperature mod 2 ** 8); else TX_Data (4) := Unsigned_8 ((Voltage / 2 ** 24) mod 2 ** 8); TX_Data (5) := Unsigned_8 ((Voltage / 2 ** 16) mod 2 ** 8); TX_Data (6) := Unsigned_8 ((Voltage / 2 ** 8) mod 2 ** 8); TX_Data (7) := Unsigned_8 (Voltage mod 2 ** 8); end if; Send_Temperature := not Send_Temperature; Radio.TX (TX_Data); -- Print_Registers; Counter := Counter + 1; if Counter > 23 then Counter := 0; end if; Radio.Power_Down; Delay_Clock.Delay_Slow_Periods (1); end loop; end TX_Test; procedure Sleep_Test is begin Radio.Power_Down; while true loop Delay_Clock.Delay_Slow_Periods (1); end loop; end Sleep_Test; begin Init; Delay_Clock.Init; SPI.Init; SCLK.Init; MISO.Init; MOSI.Init; SSEL.Init; IRQ.Init; SSEL.Set; Text_IO.Put_Line ("RFM69 sender starting..."); Radio.Init; Text_IO.Put_Hex (Unsigned_32 (Read_NTC)); Text_IO.New_Line; Text_IO.Put_Hex (Unsigned_32 (Read_VCC)); Text_IO.New_Line; Print_Registers; TX_Test; -- Sleep_Test; end Main;
arch/ARM/STM32/svd/stm32wl5x_cm4/stm32_svd-tamp.ads
morbos/Ada_Drivers_Library
2
5795
-- This spec has been automatically generated from STM32WL5x_CM4.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package STM32_SVD.TAMP is pragma Preelaborate; --------------- -- Registers -- --------------- -- control register 1 type CR1_Register is record -- TAMP1E TAMP1E : Boolean := False; -- TAMP2E TAMP2E : Boolean := False; -- TAMP2E TAMP3E : Boolean := False; -- unspecified Reserved_3_17 : HAL.UInt15 := 16#6000#; -- ITAMP3E ITAMP3E : Boolean := True; -- unspecified Reserved_19_19 : HAL.Bit := 16#1#; -- ITAMP5E ITAMP5E : Boolean := True; -- ITAMP6E ITAMP6E : Boolean := True; -- unspecified Reserved_22_22 : HAL.Bit := 16#1#; -- ITAMP8E ITAMP8E : Boolean := True; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#FF#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CR1_Register use record TAMP1E at 0 range 0 .. 0; TAMP2E at 0 range 1 .. 1; TAMP3E at 0 range 2 .. 2; Reserved_3_17 at 0 range 3 .. 17; ITAMP3E at 0 range 18 .. 18; Reserved_19_19 at 0 range 19 .. 19; ITAMP5E at 0 range 20 .. 20; ITAMP6E at 0 range 21 .. 21; Reserved_22_22 at 0 range 22 .. 22; ITAMP8E at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- control register 2 type CR2_Register is record -- TAMP1NOER TAMP1NOER : Boolean := False; -- TAMP2NOER TAMP2NOER : Boolean := False; -- TAMP3NOER TAMP3NOER : Boolean := False; -- unspecified Reserved_3_15 : HAL.UInt13 := 16#0#; -- TAMP1MSK TAMP1MSK : Boolean := False; -- TAMP2MSK TAMP2MSK : Boolean := False; -- TAMP3MSK TAMP3MSK : Boolean := False; -- unspecified Reserved_19_22 : HAL.UInt4 := 16#0#; -- Backup registerserase BKERASE : Boolean := False; -- TAMP1TRG TAMP1TRG : Boolean := False; -- TAMP2TRG TAMP2TRG : Boolean := False; -- TAMP3TRG TAMP3TRG : Boolean := False; -- unspecified Reserved_27_31 : HAL.UInt5 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CR2_Register use record TAMP1NOER at 0 range 0 .. 0; TAMP2NOER at 0 range 1 .. 1; TAMP3NOER at 0 range 2 .. 2; Reserved_3_15 at 0 range 3 .. 15; TAMP1MSK at 0 range 16 .. 16; TAMP2MSK at 0 range 17 .. 17; TAMP3MSK at 0 range 18 .. 18; Reserved_19_22 at 0 range 19 .. 22; BKERASE at 0 range 23 .. 23; TAMP1TRG at 0 range 24 .. 24; TAMP2TRG at 0 range 25 .. 25; TAMP3TRG at 0 range 26 .. 26; Reserved_27_31 at 0 range 27 .. 31; end record; -- TAMP control register 3 type CR3_Register is record -- unspecified Reserved_0_1 : HAL.UInt2 := 16#0#; -- ITAMP3NOER ITAMP3NOER : Boolean := False; -- unspecified Reserved_3_3 : HAL.Bit := 16#0#; -- ITAMP5NOER ITAMP5NOER : Boolean := False; -- ITAMP6NOER ITAMP6NOER : Boolean := False; -- unspecified Reserved_6_6 : HAL.Bit := 16#0#; -- ITAMP8NOER ITAMP8NOER : Boolean := False; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CR3_Register use record Reserved_0_1 at 0 range 0 .. 1; ITAMP3NOER at 0 range 2 .. 2; Reserved_3_3 at 0 range 3 .. 3; ITAMP5NOER at 0 range 4 .. 4; ITAMP6NOER at 0 range 5 .. 5; Reserved_6_6 at 0 range 6 .. 6; ITAMP8NOER at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; subtype FLTCR_TAMPFREQ_Field is HAL.UInt3; subtype FLTCR_TAMPFLT_Field is HAL.UInt2; subtype FLTCR_TAMPPRCH_Field is HAL.UInt2; -- TAMP filter control register type FLTCR_Register is record -- TAMPFREQ TAMPFREQ : FLTCR_TAMPFREQ_Field := 16#0#; -- TAMPFLT TAMPFLT : FLTCR_TAMPFLT_Field := 16#0#; -- TAMPPRCH TAMPPRCH : FLTCR_TAMPPRCH_Field := 16#0#; -- TAMPPUDIS TAMPPUDIS : Boolean := False; -- unspecified Reserved_8_31 : HAL.UInt24 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for FLTCR_Register use record TAMPFREQ at 0 range 0 .. 2; TAMPFLT at 0 range 3 .. 4; TAMPPRCH at 0 range 5 .. 6; TAMPPUDIS at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; -- TAMP interrupt enable register type IER_Register is record -- TAMP1IE TAMP1IE : Boolean := False; -- TAMP2IE TAMP2IE : Boolean := False; -- TAMP3IE TAMP3IE : Boolean := False; -- unspecified Reserved_3_17 : HAL.UInt15 := 16#0#; -- ITAMP3IE ITAMP3IE : Boolean := False; -- unspecified Reserved_19_19 : HAL.Bit := 16#0#; -- ITAMP5IE ITAMP5IE : Boolean := False; -- ITAMP6IE ITAMP6IE : Boolean := False; -- unspecified Reserved_22_22 : HAL.Bit := 16#0#; -- ITAMP8IE ITAMP8IE : Boolean := False; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IER_Register use record TAMP1IE at 0 range 0 .. 0; TAMP2IE at 0 range 1 .. 1; TAMP3IE at 0 range 2 .. 2; Reserved_3_17 at 0 range 3 .. 17; ITAMP3IE at 0 range 18 .. 18; Reserved_19_19 at 0 range 19 .. 19; ITAMP5IE at 0 range 20 .. 20; ITAMP6IE at 0 range 21 .. 21; Reserved_22_22 at 0 range 22 .. 22; ITAMP8IE at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- TAMP status register type SR_Register is record -- Read-only. TAMP1F TAMP1F : Boolean; -- Read-only. TAMP2F TAMP2F : Boolean; -- Read-only. TAMP3F TAMP3F : Boolean; -- unspecified Reserved_3_17 : HAL.UInt15; -- Read-only. ITAMP3F ITAMP3F : Boolean; -- unspecified Reserved_19_19 : HAL.Bit; -- Read-only. ITAMP5F ITAMP5F : Boolean; -- Read-only. ITAMP6F ITAMP6F : Boolean; -- unspecified Reserved_22_22 : HAL.Bit; -- Read-only. ITAMP8F ITAMP8F : Boolean; -- unspecified Reserved_24_31 : HAL.UInt8; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SR_Register use record TAMP1F at 0 range 0 .. 0; TAMP2F at 0 range 1 .. 1; TAMP3F at 0 range 2 .. 2; Reserved_3_17 at 0 range 3 .. 17; ITAMP3F at 0 range 18 .. 18; Reserved_19_19 at 0 range 19 .. 19; ITAMP5F at 0 range 20 .. 20; ITAMP6F at 0 range 21 .. 21; Reserved_22_22 at 0 range 22 .. 22; ITAMP8F at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- TAMP masked interrupt status register type MISR_Register is record -- Read-only. TAMP1MF: TAMP1MF : Boolean; -- Read-only. TAMP2MF TAMP2MF : Boolean; -- Read-only. TAMP3MF TAMP3MF : Boolean; -- unspecified Reserved_3_17 : HAL.UInt15; -- Read-only. ITAMP3MF ITAMP3MF : Boolean; -- unspecified Reserved_19_19 : HAL.Bit; -- Read-only. ITAMP5MF ITAMP5MF : Boolean; -- Read-only. ITAMP6MF ITAMP6MF : Boolean; -- unspecified Reserved_22_22 : HAL.Bit; -- Read-only. ITAMP8MF ITAMP8MF : Boolean; -- unspecified Reserved_24_31 : HAL.UInt8; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for MISR_Register use record TAMP1MF at 0 range 0 .. 0; TAMP2MF at 0 range 1 .. 1; TAMP3MF at 0 range 2 .. 2; Reserved_3_17 at 0 range 3 .. 17; ITAMP3MF at 0 range 18 .. 18; Reserved_19_19 at 0 range 19 .. 19; ITAMP5MF at 0 range 20 .. 20; ITAMP6MF at 0 range 21 .. 21; Reserved_22_22 at 0 range 22 .. 22; ITAMP8MF at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; -- TAMP status clear register type SCR_Register is record -- Write-only. CTAMP1F CTAMP1F : Boolean := False; -- Write-only. CTAMP2F CTAMP2F : Boolean := False; -- Write-only. CTAMP3F CTAMP3F : Boolean := False; -- unspecified Reserved_3_17 : HAL.UInt15 := 16#0#; -- Write-only. CITAMP3F CITAMP3F : Boolean := False; -- unspecified Reserved_19_19 : HAL.Bit := 16#0#; -- Write-only. CITAMP5F CITAMP5F : Boolean := False; -- Write-only. CITAMP6F CITAMP6F : Boolean := False; -- unspecified Reserved_22_22 : HAL.Bit := 16#0#; -- Write-only. CITAMP8F CITAMP8F : Boolean := False; -- unspecified Reserved_24_31 : HAL.UInt8 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SCR_Register use record CTAMP1F at 0 range 0 .. 0; CTAMP2F at 0 range 1 .. 1; CTAMP3F at 0 range 2 .. 2; Reserved_3_17 at 0 range 3 .. 17; CITAMP3F at 0 range 18 .. 18; Reserved_19_19 at 0 range 19 .. 19; CITAMP5F at 0 range 20 .. 20; CITAMP6F at 0 range 21 .. 21; Reserved_22_22 at 0 range 22 .. 22; CITAMP8F at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Tamper and backup registers type TAMP_Peripheral is record -- control register 1 CR1 : aliased CR1_Register; -- control register 2 CR2 : aliased CR2_Register; -- TAMP control register 3 CR3 : aliased CR3_Register; -- TAMP filter control register FLTCR : aliased FLTCR_Register; -- TAMP interrupt enable register IER : aliased IER_Register; -- TAMP status register SR : aliased SR_Register; -- TAMP masked interrupt status register MISR : aliased MISR_Register; -- TAMP status clear register SCR : aliased SCR_Register; -- monotonic counter register COUNTR : aliased HAL.UInt32; -- TAMP backup register BKP0R : aliased HAL.UInt32; -- TAMP backup register BKP1R : aliased HAL.UInt32; -- TAMP backup register BKP2R : aliased HAL.UInt32; -- TAMP backup register BKP3R : aliased HAL.UInt32; -- TAMP backup register BKP4R : aliased HAL.UInt32; -- TAMP backup register BKP5R : aliased HAL.UInt32; -- TAMP backup register BKP6R : aliased HAL.UInt32; -- TAMP backup register BKP7R : aliased HAL.UInt32; -- TAMP backup register BKP8R : aliased HAL.UInt32; -- TAMP backup register BKP9R : aliased HAL.UInt32; -- TAMP backup register BKP10R : aliased HAL.UInt32; -- TAMP backup register BKP11R : aliased HAL.UInt32; -- TAMP backup register BKP12R : aliased HAL.UInt32; -- TAMP backup register BKP13R : aliased HAL.UInt32; -- TAMP backup register BKP14R : aliased HAL.UInt32; -- TAMP backup register BKP15R : aliased HAL.UInt32; -- TAMP backup register BKP16R : aliased HAL.UInt32; -- TAMP backup register BKP17R : aliased HAL.UInt32; -- TAMP backup register BKP18R : aliased HAL.UInt32; -- TAMP backup register BKP19R : aliased HAL.UInt32; end record with Volatile; for TAMP_Peripheral use record CR1 at 16#0# range 0 .. 31; CR2 at 16#4# range 0 .. 31; CR3 at 16#8# range 0 .. 31; FLTCR at 16#C# range 0 .. 31; IER at 16#2C# range 0 .. 31; SR at 16#30# range 0 .. 31; MISR at 16#34# range 0 .. 31; SCR at 16#3C# range 0 .. 31; COUNTR at 16#40# range 0 .. 31; BKP0R at 16#100# range 0 .. 31; BKP1R at 16#104# range 0 .. 31; BKP2R at 16#108# range 0 .. 31; BKP3R at 16#10C# range 0 .. 31; BKP4R at 16#110# range 0 .. 31; BKP5R at 16#114# range 0 .. 31; BKP6R at 16#118# range 0 .. 31; BKP7R at 16#11C# range 0 .. 31; BKP8R at 16#120# range 0 .. 31; BKP9R at 16#124# range 0 .. 31; BKP10R at 16#140# range 0 .. 31; BKP11R at 16#144# range 0 .. 31; BKP12R at 16#148# range 0 .. 31; BKP13R at 16#14C# range 0 .. 31; BKP14R at 16#150# range 0 .. 31; BKP15R at 16#154# range 0 .. 31; BKP16R at 16#158# range 0 .. 31; BKP17R at 16#15C# range 0 .. 31; BKP18R at 16#160# range 0 .. 31; BKP19R at 16#164# range 0 .. 31; end record; -- Tamper and backup registers TAMP_Periph : aliased TAMP_Peripheral with Import, Address => TAMP_Base; end STM32_SVD.TAMP;
programs/oeis/177/A177452.asm
karttu/loda
0
98209
; A177452: Partial sums of A002055. ; 1,10,66,366,1851,8858,40890,184098,813948,3549758,15317294,65537334,278489619,1176688494,4948173294,20723897214,86494746204,359915608314,1493718226314,6184858989714,25556291840484,105406847513658 lpb $0,1 mov $2,$0 cal $2,2055 ; Number of diagonal dissections of a convex n-gon into n-4 regions. sub $0,1 add $1,$2 lpe add $1,1
dependencies/agar/ada-core/agar-core-database.ads
amvb/GUCEF
5
1458
<reponame>amvb/GUCEF<filename>dependencies/agar/ada-core/agar-core-database.ads with Agar.Core.Thin; package Agar.Core.Database is subtype Database_Access_t is Thin.DB.DB_Access_t; subtype Database_Not_Null_Access_t is Thin.DB.DB_Not_Null_Access_t; type Type_t is new Thin.DB.Type_t; procedure New_Database (Database_Type : in Type_t; Database : out Database_Access_t); procedure Sync (Database : in Database_Not_Null_Access_t) renames Thin.DB.Sync; generic type Key_Type is private; type Key_Type_Access is access all Key_Type; type Data_Type is private; type Data_Type_Access is access all Data_Type; package Generic_Database is type Entry_t is record Key : Key_Type_Access; Key_Size : Natural; Data : Data_Type_Access; Data_Size : Natural; end record; Null_Entry : constant Entry_t := (Key => null, Key_Size => 0, Data => null, Data_Size => 0); function Exists (Database : in Database_Not_Null_Access_t; Key : in Key_Type) return Boolean; procedure Lookup (Database : in Database_Not_Null_Access_t; Key : in Key_Type; Database_Entry : out Entry_t; Found : out Boolean); function Delete (Database : in Database_Not_Null_Access_t; Key : in Key_Type) return Boolean; function Put (Database : in Database_Not_Null_Access_t; Key : in Key_Type_Access; Data : in Data_Type_Access) return Boolean; end Generic_Database; end Agar.Core.Database;
emulator/test.asm
paulscottrobson/experimental-computer-system
0
89226
<gh_stars>0 clra aisc 5 ; set current display value to %0101 lbi 0,14 save0: x 0 loop: lbi 0,15 ; B points vertical position. clra ; A(M) now points to table aisc 4 lqid ; load into Q lbi 0,14 ; point to value. ld 0 ; read value. rmb 3 ; clear bit 3 e.g. don't update G3. omg ; output to G0-2 x 0 ; write value back. ld 0 ; load it back. cab ; and to D obd cba ; put in A comp ; complement it xad 0,14 ; write out to give checkerboard pattern. ldd 0,15 ; point to vertical position. aisc 1 ; bump nop xad 0,15 it skt nop ldd 0,15 aisc 8 jp loop lbi 0,15 rmb 3 ; force into range 0-7 lbi 1,15 ; B is counters. nextcounter: ld 0 ; read into A aisc 1 ; bump, skip on overflow. jp save0 xis 0 ; write, inc, skip on overflow jp nextcounter ldd 0,14 aisc 1 nop xad 0,14 jp loop halt page byte $01 byte $02 byte $04 byte $08 byte $10 byte $20 byte $40 byte $80
libsrc/_DEVELOPMENT/target/yaz180/device/am9511a/am9511a_reset.asm
jpoikela/z88dk
640
7524
<reponame>jpoikela/z88dk<filename>libsrc/_DEVELOPMENT/target/yaz180/device/am9511a/am9511a_reset.asm<gh_stars>100-1000 ;------------------------------------------------------------------------------ ; Initialises the APU buffers ; INCLUDE "config_private.inc" SECTION code_driver PUBLIC asm_am9511a_reset EXTERN APUCMDBuf, APUPTRBuf EXTERN APUCMDInPtr, APUCMDOutPtr, APUPTRInPtr, APUPTROutPtr EXTERN APUCMDBufUsed, APUPTRBufUsed, APUStatus, APUError asm_am9511a_reset: push af push bc push de push hl ld hl,APUCMDBuf ; Initialise COMMAND Buffer ld (APUCMDInPtr),hl ld (APUCMDOutPtr),hl ld hl,APUPTRBuf ; Initialise OPERAND POINTER Buffer ld (APUPTRInPtr),hl ld (APUPTROutPtr),hl xor a ; clear A register to 0 ld (APUCMDBufUsed),a ; 0 both Buffer counts ld (APUPTRBufUsed),a ld (APUCMDBuf),a ; clear COMMAND Buffer ld hl,APUCMDBuf ld d,h ld e,l inc de ld bc,__APU_CMD_SIZE-1 ldir ld (APUPTRBuf),a ; clear OPERAND POINTER Buffer ld hl,APUPTRBuf ld d,h ld e,l inc de ld bc,__APU_PTR_SIZE-1 ldir ld (APUStatus),a ; set APU status to idle (NOP) ld (APUError),a ; clear APU errors am9511a_reset_loop: ld bc,__IO_APU_STATUS ; the address of the APU status port in bc in a,(c) ; read the APU and __IO_APU_STATUS_BUSY ; busy? jr NZ,am9511a_reset_loop pop hl pop de pop bc pop af ret
Erathostenes-III/src/main.adb
Maxelweb/concurrency-sandbox
0
18731
<filename>Erathostenes-III/src/main.adb with System; with SoE; with Ada.Text_IO, Ada.Integer_Text_IO; with Ada.Exceptions; procedure Main is use Ada.Text_IO, Ada.Integer_Text_IO; pragma Priority (System.Priority'First); User_Limit : Integer; begin -- process Odd is activated at this point --+ -- the main unit may take the range limit from user input -- and pass it on, by rendezvous, to Odd Put ("Insert range limit: "); Get (User_Limit); SoE.Odd.Set_Limit (User_Limit); -- at this point the main unit has nothing other to do -- than wait for its dependent processes (Odd and all instances of Sieve) -- to terminate exception when E : others => Put_Line ("Exception " & Ada.Exceptions.Exception_Name (E)); end Main;
programs/oeis/085/A085423.asm
karttu/loda
1
88028
<filename>programs/oeis/085/A085423.asm ; A085423: a(n) = floor(log_2(3n)). ; 1,2,3,3,3,4,4,4,4,4,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,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8 mul $0,3 add $0,3 log $0,2 mov $1,$0
src/protdata.asm
DosWorld/zrdx
12
89197
; This file is part of the ZRDX 0.50 project ; (C) 1998, <NAME> Segm IData16 Trap3Pos = 0 NTraps3 = 0 DefTrap3 MACRO Name, N, NParams DB (100h-N) and 0FFh DW Off&Name&TrapH and 0FFFFh DB NParams Off&Name&Trap3 = Trap3Pos*4 NTraps3 = NTraps3+1 Trap3Pos = Trap3Pos+N ENDM Traps3SetupTable label byte DefTrap3 DefInt 100h 0 DefTrap3 DefaultExc 16 8 DefTrap3 RetFromExc 1 6 DefTrap3 Iret2KernelAsinc 1 0 DefTrap3 PMCallbackIret 1 0 IFDEF VMM DefTrap3 Iret2KernelAsincL 1 0 DefTrap3 PMCallbackIretL 1 0 DefTrap3 PassupIretL 1 0 DefTrap3 IretPL 1 0 ENDIF DefTrap3 PassupIret 1 0 DefTrap3 PMRawSwitch 1 0 DefTrap3 PMSaveState 1 0 ;must be last! NTrapsP3 = Trap3Pos Eseg IData16 segm Data LByte Exception0DFlag DB 1 align 16 LDWord GDT Descr 0, 0, 0 ;dummy descriptor Descr 0, 0FFFFFh, 0CF93h ;Flat data descriptor Descr 0, 0FFFFFh, 0CFB3h ;Flat data(PL1) descriptor Descr 0, 0FFFFFh, 0CFF3h ;Flat data(PL3) descriptor Descr 0, 0FFFFFh, 0CF9Bh ;Flat code0 descriptor Descr 0, 0FFFFFh, 0CFBBh ;Flat code(PL1) descriptor Descr 0, 0FFFFFh, 0CFFBh ;Flat code(PL3) descriptor GDescr OffDPMIIntEntry, Code1Selector, <0E0h+SS_GATE_PROC3> Descr 400h, 0FFFFh, 0F3h ;data descriptor for 40h bios area LDWord VCPICallDesc GDescr OffVCPICallHandler, Code0Selector, <0A0h+SS_GATE_PROC3> GDescr OffVCPITrapHandler, Code0Selector, <0E0h+SS_GATE_PROC3> GDescr OffInvalidateTLBHandler, Code0Selector, <0E0h+SS_GATE_PROC3> GDescr OffPageMoveHandler, Code0Selector, <0E0h+SS_GATE_PROC3> GDescr OffLoadLDTHandler, Code0Selector, <0E0h+SS_GATE_PROC3> IFDEF VMM GDescr OffSwitchTo00, Code0Selector, <0A0h+SS_GATE_PROC3> ENDIF Descr OffFirstTrap3, NTrapsP3*4+2, 40FBh ;Trap3 descriptor DD 0, 0 ;Descr OffLockedStackStart, LockedStackSize-1, 40F3h ;Locked stack Descr OffTSS, <(size TSS_DEF+4)>, <(0080h+SS_FREE_TSS3)> ;TSS LWord LDTLimit Descr OffLDT, <(17+4)*8-1>, <0E0H+SS_LDT> ;LDT ;GDescr ROffL0234, VCPISelector+8, <0A0h+SS_GATE_PROC3> Descr 0, 0FFFFFh, 0CF9Bh ;Flat code0 descriptor for VCPI emulator Descr 0, 0FFFFh, 09Bh ;cs:16 bit descriptor RRT 2 Descr 0, 0FFFFh, 093h ;16 bit data descriptor RRT 2 DD NTraps3*2 dup(?) LLabel GDTEnd LDWord PassupIntMap DW 0FF00h,1000h,18h,0,0,0,0,0FFh,0,0,0,0,0,0,0,0 LDWord PassupIntPMap DW 00000h,1000h,18h,0,0,0,0,000h,0,0,0,0,0,0,0,0 ifndef Release LDWord Seed ;for test only DD 1 LDWord LogLine DD 8 endif LDWord VCPICall DD ? ;inittialized by RSetup LDword VCPICallHi DW VCPISelector LByte CPUType DB 0 LByte XMSBlockNotAllocated ;1 when XMS server is active and XMS block DB 0 ;not allocated LByte VCPIMemAvailable ;1 when VCPI server is active and DB 0 ;last page alloc call was succeful LByte NExtraRPages DB 0 IFDEF VMM LByte LockedMode DB 0,0 LDWord swap_file_handle DD 0 LDWord sw_pti DD OffClientPages shr 12 ELSE DB 0, 0 ;padding ENDIF LDWord TotalVCPIPages DD 0 LByte RootMCB, size MCBStruct MCBStruct <OffRootMCB, OffRootMCB, -400000h, OffClientPages> LastMappedPage equ RootMCB.MCB_StartOffset LDWord MemRover DD OffRootMCB LDWord nmemblocks DD 1 LDWord LDTBottom DD OffLDT+17*8+4*8 LDWord MCBVectorEnd DD OffMCBVector LDWord nEntriesInFplist ;nFreePagesOnDir DD 1023 eseg Data VSegm BSS IFDEF VMM DFD swap_file_size ;current size of the swap file DFD free_swap_cluster ;index of possible first free cluster in the swap file ENDIF DFD n_fplists DFD Exception0DStack DFD TotalPagesCount DFB FirstTrap3, NTrapsP3*4+8 ;area for default interrupts, exceptions, etc handlers DFB HIntHandlers, 32*7 DFD SavedRealVectors, 256 DFD LDTFree, 256 DFD LDTDOS, 256 DFD nFreePages ifndef Release DFD ExtraDW endif DFD FMemRover ;DFD VFreePagesCount DFW IDT, 1024 DFB TSS, 6Ch ;TSS without IO MAP DFD ClientIDT, 512 DFD ClientExc, 64 ;DFD FirstEIP ;DFD FirstCS ;DFD FirstFlags ;DFD FirstESP ;DFD FirstSS N000=size CBTStruct*nMaxCallbacks DFB CallbacksTable, N000 KernelStack1 EQU TSS.TSS_ESP1 DFD RIntFlags, 8 ;bit vector :1 - jump to saved real vector, else - to current DFD UserStackStart, 100 DFL UserStackEnd DFB KernelStack1Start, 512 DFL KernelStack1End DFB KernelStackStart, 200h DFL KernelStack IFDEF VMM DFD SavedPMStack, 2 DFB LockedStack, 1000h DFL LockedStackBottom ENDIF ifndef Release Vl = 500/10 DFD TVector, Vl ;for test only endif DFB Aborted DFB PrintToMem PageReserved1Count = 1000h - ((LC) and 0FFFh) ifndef Release ;DFD APages, 1024 endif DFB PageReserved1, PageReserved1Count ;all Traps3 must be in separate page, with read only attribute, ;in special 32-bit segment with nonzero base ;packed traps format: ; DB 0EA ;call far inst <- Current call ; DW PrevGateSelector <-I ; DB Reserved or Trap ID I Current IP - ignored by CPU ; DB 0EA ;next trap call far inst <-I ; DW CurGateSelector <- Current CS DFD PageDir, 1024 ;Directory page DFD Page2, 1024 ;Kernel page table page LockedStackSize = 1000h DFL FirstZeroInit ;DFB LockedStackStart, LockedStackSize ;DFL LockedStack DFD nEntriesInTable, 1024 IFDEF VMM DFD PageDirAlias, 1024 ;page table for direct access to all page tables DFD PageExtinfoTable, 1024 ;page table for page extinfo array ENDIF DFD LDT, (17+4)*2 DFL LastInit DFD LDTNext, 4000h-(17+4)*2 DFD Page0, 1024 ;VCPI page allocated in the dos memory and cannot be ;relocated DFD fplist, 1024 ;current list of free page entries PagesDir equ PageDir DFD PageTableWin, 1024 DFD FreePageWin, 1024 DFD SDir0Win, 1024 DFD SDir1Win, 1024 ;DFD PageDirAlias, 1024 ;DFD PageExtinfo_table, 1024 F = (800000h-LC) shr 2 IFDEF VMM F = F - 1024*32 ENDIF DFD MCBVector, F ;Must be Last ! IFDEF VMM DFD swap_file_bitmap, 1024*32 DFD PageTables, 1024*1024 DFD PageExtinfo, 1024*1024 ENDIF DFL ClientPages PageDirEntry = Page2[(OffPageDir-KernelBase) shr 10] Page0Entry = Page2[(OffPage0-KernelBase) shr 10] Page2Entry = Page2[(OffPage2-KernelBase) shr 10] FirstZeroInit_entry = Page2[(OffFirstZeroInit-KernelBase) shr 10] FpListEntry = Page2[(OffFpList-KernelBase) shr 10] PageTableEntry = Page2[(OffPageTableWin - KernelBase) shr 10] FreePageEntry = Page2[(OffFreePageWin-KernelBase) shr 10] Page2Index = (OffPage2-KernelBase) shr 12 SDir0Entry = Page2[(OffSDir0Win-KernelBase) shr 10] SDir1Entry = Page2[(OffSDir1Win-KernelBase) shr 10] FpListPte = Page2[(OffFpList-KernelBase) shr 10] ;fplist_entry IFDEF VMM PageDirAliasPte= Page2[(OffPageDirAlias-KernelBase) shr 10] ;fplist_entry PageExtinfoTablePte=Page2[(OffPageExtinfoTable-KernelBase) shr 10] ;fplist_entry ENDIF EVSeg BSS Segm Data SelectorNum=8 DefSelector MACRO Name, N, S IFNB <S> Name&Selector = SelectorNum+S else Name&Selector = SelectorNum ENDIF IFB <N> SelectorNum = SelectorNum+8 ELSE SelectorNum = SelectorNum+8*N ENDIF ENDM DefSelector Data0 DefSelector Data,,1 DefSelector Data3,,3 DefSelector Code0 DefSelector Code,,1 DefSelector Code3,,3 DefSelector DPMIEntryGate,,3 DefSelector BIOSData,,3 DefSelector VCPICallGate,,1 DefSelector VCPITrapGate,,3 DefSelector InvalidateTLBGate,,3 DefSelector PageMoveGate,,3 DefSelector LoadLDTGate,,1 IFDEF VMM DefSelector SwitchTo0Gate,,1 ENDIF DefSelector Trap3,,3 ;PL3 selector for traps DefSelector LockedStack,,3 ;not flat selector for client locked stack DefSelector TSS DefSelector LDT DefSelector VCPI, 3 ;for VCPI server DefSelector FirstGate, NTraps3 ;gates Code1Selector = CodeSelector Data1Selector = DataSelector eseg Data
util/thg/fthg.asm
olifink/smsqe
0
94832
* Free a Thing v0.00  Feb 1988 J.R.Oakley QJUMP * section thing * include 'dev8_mac_assert' include 'dev8_keys_err' include 'dev8_keys_sys' include 'dev8_keys_thg' * xref th_chkjb xref th_find xref th_remu xref th_exit * xdef th_fthg *+++ * Find a thing, given its name, and remove a usage block belonging to * the given job. * * Registers: * Entry Exit * D0 0, ITNF, IJOB * D1 Job ID or -1 Job ID * D2/D3 smashed * A0 name of thing (>=3 chars) preserved * A1-A3 smashed * A6 pointer to system variables preserved *--- th_fthg jsr th_find(pc) ; find the Thing bne.s thf_exit ; ...oops jsr th_chkjb(pc) ; does the job exist? bne.s thf_exit ; ...no jsr th_remu(pc) ; remove Job from usage list thf_exit jmp th_exit(pc) * end
programs/oeis/049/A049474.asm
jmorken/loda
1
24024
; A049474: a(n) = ceiling(n/sqrt(2)). ; 0,1,2,3,3,4,5,5,6,7,8,8,9,10,10,11,12,13,13,14,15,15,16,17,17,18,19,20,20,21,22,22,23,24,25,25,26,27,27,28,29,29,30,31,32,32,33,34,34,35,36,37,37,38,39,39,40,41,42,42,43,44,44,45,46,46,47,48,49,49,50,51,51,52,53,54,54,55,56,56,57,58,58,59,60,61,61,62,63,63,64,65,66,66,67,68,68,69,70,71,71,72,73,73,74,75,75,76,77,78,78,79,80,80,81,82,83,83,84,85,85,86,87,87,88,89,90,90,91,92,92,93,94,95,95,96,97,97,98,99,99,100,101,102,102,103,104,104,105,106,107,107,108,109,109,110,111,112,112,113,114,114,115,116,116,117,118,119,119,120,121,121,122,123,124,124,125,126,126,127,128,128,129,130,131,131,132,133,133,134,135,136,136,137,138,138,139,140,141,141,142,143,143,144,145,145,146,147,148,148,149,150,150,151,152,153,153,154,155,155,156,157,157,158,159,160,160,161,162,162,163,164,165,165,166,167,167,168,169,169,170,171,172,172,173,174,174,175,176,177 mov $2,$0 lpb $0 lpb $0 sub $0,1 add $4,$2 lpe lpb $4 add $1,4 add $3,1 add $4,2 trn $4,$1 lpe mov $1,$3 lpe
Plylet.agda
Kazark/plylet
0
10744
module Plylet where open import Data.String.Base open import Data.Char.Base open import Data.List.Base data Type : Set where -- The type of the unit value TUnit : Type -- The type constructor for functions → TFunc : Type -> Type -> Type -- A type loaded from the prelude TBuiltin : String -> Type data Term : Set where -- The value of unit VUnit : Term -- An well-typed application is a valid term VApp : Term → Term → Term -- A well-formed let expression is a valid term VLet : Char -> Term -> Term -> Term -- A function from the prelude VFunc : String -> Term data Judgment : Set where -- A typing judgment TypeJ : Term → Type → Judgment -- A coercion validity judgment CoerceJ : Type → Type → Judgment Gamma : Set Gamma = List Judgment baseEnv : Gamma baseEnv = TypeJ VUnit TUnit ∷ []
test/e2e/data/arm8.asm
matanlurey/armv4t.dart
8
18283
; expected result: 0x200 = 10, 0x204 = 83 mov r13, #0x200 mov r2, #83 mov r3, #10 cmp r2, r3 blt less str r3, [sp] str r2, [sp, #4] b exit less: str r2, [sp] str r3, [sp, #4] exit:
programs/oeis/131/A131793.asm
jmorken/loda
1
1006
; A131793: 3 odds, 3 evens. ; 1,3,5,2,4,6,7,9,11,8,10,12,13,15,17,14,16,18,19,21,23,20,22,24,25,27,29,26,28,30,31,33,35,32,34,36,37,39,41,38,40,42,43,45,47,44,46,48,49,51,53,50,52,54,55,57,59,56,58,60,61,63,65,62,64,66,67,69,71,68,70,72,73,75,77,74,76,78,79,81,83,80,82,84,85,87,89,86,88,90,91,93,95,92,94,96,97,99,101,98,100,102,103,105,107,104,106,108,109,111,113,110,112,114,115,117,119,116,118,120,121,123,125,122,124,126,127,129,131,128,130,132,133,135,137,134,136,138,139,141,143,140,142,144,145,147,149,146,148,150,151,153,155,152,154,156,157,159,161,158,160,162,163,165,167,164,166,168,169,171,173,170,172,174,175,177,179,176,178,180,181,183,185,182,184,186,187,189,191,188,190,192,193,195,197,194,196,198,199,201,203,200,202,204,205,207,209,206,208,210,211,213,215,212,214,216,217,219,221,218,220,222,223,225,227,224,226,228,229,231,233,230,232,234,235,237,239,236,238,240,241,243,245,242,244,246,247,249,251,248 mov $2,$0 mod $2,6 mov $3,$0 mov $0,$2 mov $1,2 add $3,1 mov $4,$3 sub $4,3 add $1,$4 add $1,$2 lpb $0 mov $0,2 sub $1,3 add $0,$1 sub $1,2 sub $0,$1 sub $0,2 lpe add $1,1
tests/tk-image-photo-photo_options_test_data-photo_options_tests.adb
thindil/tashy2
2
24087
-- This package has been generated automatically by GNATtest. -- You are allowed to add your code to the bodies of test routines. -- Such changes will be kept during further regeneration of this file. -- All code placed outside of test routine bodies will be lost. The -- code intended to set up and tear down the test environment should be -- placed into Tk.Image.Photo.Photo_Options_Test_Data. with AUnit.Assertions; use AUnit.Assertions; with System.Assertions; -- begin read only -- id:2.2/00/ -- -- This section can be used to add with clauses if necessary. -- -- end read only with Ada.Environment_Variables; use Ada.Environment_Variables; with GNAT.Directory_Operations; use GNAT.Directory_Operations; -- begin read only -- end read only package body Tk.Image.Photo.Photo_Options_Test_Data.Photo_Options_Tests is -- begin read only -- id:2.2/01/ -- -- This section can be used to add global variables and other elements. -- -- end read only -- begin read only -- end read only -- begin read only procedure Wrap_Test_Create_22037c_8377bb (Photo_Image: Tk_Image; Options: Photo_Options; Interpreter: Tcl_Interpreter := Get_Interpreter) is begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tk-image-photo.ads:0):Tests_Create_Photo test requirement violated"); end; GNATtest_Generated.GNATtest_Standard.Tk.Image.Photo.Create (Photo_Image, Options, Interpreter); begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tk-image-photo.ads:0:):Tests_Create_Photo test commitment violated"); end; end Wrap_Test_Create_22037c_8377bb; -- end read only -- begin read only procedure Test_1_Create_tests_create_photo (Gnattest_T: in out Test_Photo_Options); procedure Test_Create_22037c_8377bb (Gnattest_T: in out Test_Photo_Options) renames Test_1_Create_tests_create_photo; -- id:2.2/22037c1fbc7ae682/Create/1/0/tests_create_photo/ procedure Test_1_Create_tests_create_photo (Gnattest_T: in out Test_Photo_Options) is procedure Create (Photo_Image: Tk_Image; Options: Photo_Options; Interpreter: Tcl_Interpreter := Get_Interpreter) renames Wrap_Test_Create_22037c_8377bb; -- end read only pragma Unreferenced(Gnattest_T); begin if Value("DISPLAY", "")'Length = 0 then Assert(True, "No display, can't test"); return; end if; Create ("myphoto", (Format => To_Tcl_String("png"), File => To_Tcl_String(".." & Dir_Separator & "test.png"), others => <>)); Assert (Image_Type("myphoto") = "photo", "Failed to create a photo image with selected name from file."); -- begin read only end Test_1_Create_tests_create_photo; -- end read only -- begin read only function Wrap_Test_Create_fa334a_6f3d65 (Options: Photo_Options; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tk_Image is begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tk-image-photo.ads:0):Tests_Create2_Photo test requirement violated"); end; declare Test_Create_fa334a_6f3d65_Result: constant Tk_Image := GNATtest_Generated.GNATtest_Standard.Tk.Image.Photo.Create (Options, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tk-image-photo.ads:0:):Tests_Create2_Photo test commitment violated"); end; return Test_Create_fa334a_6f3d65_Result; end; end Wrap_Test_Create_fa334a_6f3d65; -- end read only -- begin read only procedure Test_2_Create_tests_create2_photo (Gnattest_T: in out Test_Photo_Options); procedure Test_Create_fa334a_6f3d65 (Gnattest_T: in out Test_Photo_Options) renames Test_2_Create_tests_create2_photo; -- id:2.2/fa334a87cdcf0776/Create/0/0/tests_create2_photo/ procedure Test_2_Create_tests_create2_photo (Gnattest_T: in out Test_Photo_Options) is function Create (Options: Photo_Options; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tk_Image renames Wrap_Test_Create_fa334a_6f3d65; -- end read only pragma Unreferenced(Gnattest_T); begin if Value("DISPLAY", "")'Length = 0 then Assert(True, "No display, can't test"); return; end if; declare Photo_Image: constant Tk_Image := Create((Format => To_Tcl_String("png"), others => <>)); begin Assert (Photo_Image'Length > 0, "Failed to create photo image with random name."); Delete(Photo_Image); end; -- begin read only end Test_2_Create_tests_create2_photo; -- end read only -- begin read only procedure Wrap_Test_Configure_6e2ac0_462460 (Photo_Image: Tk_Image; Options: Photo_Options; Interpreter: Tcl_Interpreter := Get_Interpreter) is begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tk-image-photo.ads:0):Tests_Configure_Photo test requirement violated"); end; GNATtest_Generated.GNATtest_Standard.Tk.Image.Photo.Configure (Photo_Image, Options, Interpreter); begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tk-image-photo.ads:0:):Tests_Configure_Photo test commitment violated"); end; end Wrap_Test_Configure_6e2ac0_462460; -- end read only -- begin read only procedure Test_Configure_tests_configure_photo (Gnattest_T: in out Test_Photo_Options); procedure Test_Configure_6e2ac0_462460 (Gnattest_T: in out Test_Photo_Options) renames Test_Configure_tests_configure_photo; -- id:2.2/6e2ac08c4cd9ce38/Configure/1/0/tests_configure_photo/ procedure Test_Configure_tests_configure_photo (Gnattest_T: in out Test_Photo_Options) is procedure Configure (Photo_Image: Tk_Image; Options: Photo_Options; Interpreter: Tcl_Interpreter := Get_Interpreter) renames Wrap_Test_Configure_6e2ac0_462460; -- end read only pragma Unreferenced(Gnattest_T); begin if Value("DISPLAY", "")'Length = 0 then Assert(True, "No display, can't test"); return; end if; Configure("myphoto", Photo_Options'(Height => 12, others => <>)); Assert (Get_Option("myphoto", "height") = "12", "Failed to set options for photo image."); Configure("myphoto", Photo_Options'(Height => 11, others => <>)); -- begin read only end Test_Configure_tests_configure_photo; -- end read only -- begin read only function Wrap_Test_Get_Options_5c7a9c_d39689 (Photo_Image: Tk_Image; Interpreter: Tcl_Interpreter := Get_Interpreter) return Photo_Options is begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "req_sloc(tk-image-photo.ads:0):Tests_Get_Options_Photo test requirement violated"); end; declare Test_Get_Options_5c7a9c_d39689_Result: constant Photo_Options := GNATtest_Generated.GNATtest_Standard.Tk.Image.Photo.Get_Options (Photo_Image, Interpreter); begin begin pragma Assert(True); null; exception when System.Assertions.Assert_Failure => AUnit.Assertions.Assert (False, "ens_sloc(tk-image-photo.ads:0:):Tests_Get_Options_Photo test commitment violated"); end; return Test_Get_Options_5c7a9c_d39689_Result; end; end Wrap_Test_Get_Options_5c7a9c_d39689; -- end read only -- begin read only procedure Test_Get_Options_tests_get_options_photo (Gnattest_T: in out Test_Photo_Options); procedure Test_Get_Options_5c7a9c_d39689 (Gnattest_T: in out Test_Photo_Options) renames Test_Get_Options_tests_get_options_photo; -- id:2.2/5c7a9c2ff87b2567/Get_Options/1/0/tests_get_options_photo/ procedure Test_Get_Options_tests_get_options_photo (Gnattest_T: in out Test_Photo_Options) is function Get_Options (Photo_Image: Tk_Image; Interpreter: Tcl_Interpreter := Get_Interpreter) return Photo_Options renames Wrap_Test_Get_Options_5c7a9c_d39689; -- end read only pragma Unreferenced(Gnattest_T); begin if Value("DISPLAY", "")'Length = 0 then Assert(True, "No display, can't test"); return; end if; Assert (Get_Options("myphoto").Format = "png", "Failed to get options for photo image."); -- begin read only end Test_Get_Options_tests_get_options_photo; -- end read only -- begin read only -- id:2.2/02/ -- -- This section can be used to add elaboration code for the global state. -- begin -- end read only null; -- begin read only -- end read only end Tk.Image.Photo.Photo_Options_Test_Data.Photo_Options_Tests;
libsrc/_DEVELOPMENT/string/c/sccz80/strlen.asm
teknoplop/z88dk
8
83251
<gh_stars>1-10 ; size_t strlen(const char *s) SECTION code_clib SECTION code_string PUBLIC strlen EXTERN asm_strlen defc strlen = asm_strlen
programs/oeis/338/A338544.asm
jmorken/loda
1
98020
<filename>programs/oeis/338/A338544.asm ; A338544: a(n) = (5*floor((n-1)/2)^2 + (4+(-1)^n)*floor((n-1)/2)) / 2. ; 0,0,0,4,5,13,15,27,30,46,50,70,75,99,105,133,140,172,180,216,225,265,275,319,330,378,390,442,455,511,525,585,600,664,680,748,765,837,855,931,950,1030,1050,1134,1155,1243,1265,1357,1380,1476,1500,1600,1625,1729,1755,1863 sub $0,1 mov $2,$0 add $0,1 mov $1,1 lpb $2 add $0,1 add $1,$0 sub $2,2 lpe sub $1,1
models/hol/sygus/sketch_benchmarks/tut2.als
johnwickerson/alloystar
2
3637
<filename>models/hol/sygus/sketch_benchmarks/tut2.als module sketch_tutorial2 open ../synth2[spec] one sig X1, X2 extends IntVar {} one sig Let1Y, Let1Z, Let2Y, Let2Z extends IntLit {} { val >= 0 } -------------------------------------------------------------------------------- -- Specification -- (https://github.com/rishabhs/sygus-comp14/blob/master/benchmarks/sketch-benchmarks/tutorial2.sl) -------------------------------------------------------------------------------- fun axpb1[x, y, z: Int]: Int { plus[mul[y, x], z] } fun axpb2[x, y, z: Int]: Int { plus[mul[y, x], z] } pred spec[root: Node, eval: Node -> Int] { let x1=eval[X1], x2=eval[X2], l1y=eval[Let1Y], l1z=eval[Let1Z], l2y=eval[Let2Y], l2z=eval[Let2Z] | // (?*x1 + ?) * (?*x2 + ?) = 2x1 * (x2 + 5) bveq[mul[axpb1[x1, l1y, l1z], axpb2[x2, l2y, l2z]], mul[plus[x1,x1], plus[x2, 5]]] } -------------------------------------------------------------------------------- -- Commands -------------------------------------------------------------------------------- run synthIntNodeI for 0 but 5 Int
ffight/lcs/container/3A.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
6
85595
<filename>ffight/lcs/container/3A.asm copyright zengfr site:http://github.com/zengfr/romhack 003A02 movem.l D0-D3, -(A6) 003A06 movem.l D0-D3, -(A6) 009ACA dbra D5, $9ac8 0522C6 move.l #$52410, ($38,A6) [container+ 2] 0522CE move.b ($36,A6), ($2e,A6) [container+38, container+3A] 052456 move.l #$5268e, ($38,A6) [container+ 2] 05245E move.b ($36,A6), ($2e,A6) [container+38, container+3A] 0526D4 move.l #$52926, ($38,A6) [container+ 2] 0526DC move.b ($36,A6), ($2e,A6) [container+38, container+3A] 05296E move.l #$52cd8, ($38,A6) [container+ 2, container+ 4] 052976 move.b ($36,A6), ($2e,A6) [container+38, container+3A] 052D1E move.l #$52f1e, ($38,A6) [container+ 2] 052D26 move.b ($36,A6), ($2e,A6) [container+38, container+3A] 054B30 move.l #$54d44, ($38,A6) [container+ E, container+10] 054B38 move.b #$b, ($1e,A6) [container+38, container+3A] copyright zengfr site:http://github.com/zengfr/romhack
programs/oeis/082/A082693.asm
karttu/loda
1
98452
<reponame>karttu/loda<filename>programs/oeis/082/A082693.asm ; A082693: Pyramidal sequence built with powers of 2. ; 1,2,1,2,4,2,1,2,4,8,4,2,1,2,4,8,16,8,4,2,1,2,4,8,16,32,16,8,4,2,1,2,4,8,16,32,64,32,16,8,4,2,1,2,4,8,16,32,64,128,64,32,16,8,4,2,1,2,4,8,16,32,64,128,256,128,64,32,16,8,4,2,1,2,4,8,16,32,64,128,256,512,256,128 cal $0,4738 ; Concatenation of sequences (1,2,...,n-1,n,n-1,...,2) for n >= 2. add $2,$0 mov $1,$2 cal $1,53208 ; Row sums of A053207. div $1,7 add $1,1
llvm-gcc-4.2-2.9/gcc/ada/a-rbtgso.adb
vidkidz/crossbridge
1
18538
<reponame>vidkidz/crossbridge ------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- A D A . C O N T A I N E R S . R E D _ B L A C K _ T R E E S . -- -- G E N E R I C _ S E T _ O P E R A T I O N S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2004-2005, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This unit was originally developed by <NAME>. -- ------------------------------------------------------------------------------ with System; use type System.Address; package body Ada.Containers.Red_Black_Trees.Generic_Set_Operations is ----------------------- -- Local Subprograms -- ----------------------- procedure Clear (Tree : in out Tree_Type); function Copy (Source : Tree_Type) return Tree_Type; ----------- -- Clear -- ----------- procedure Clear (Tree : in out Tree_Type) is pragma Assert (Tree.Busy = 0); pragma Assert (Tree.Lock = 0); Root : Node_Access := Tree.Root; begin Tree.Root := null; Tree.First := null; Tree.Last := null; Tree.Length := 0; Delete_Tree (Root); end Clear; ---------- -- Copy -- ---------- function Copy (Source : Tree_Type) return Tree_Type is Target : Tree_Type; begin if Source.Length = 0 then return Target; end if; Target.Root := Copy_Tree (Source.Root); Target.First := Tree_Operations.Min (Target.Root); Target.Last := Tree_Operations.Max (Target.Root); Target.Length := Source.Length; return Target; end Copy; ---------------- -- Difference -- ---------------- procedure Difference (Target : in out Tree_Type; Source : Tree_Type) is Tgt : Node_Access := Target.First; Src : Node_Access := Source.First; begin if Target'Address = Source'Address then if Target.Busy > 0 then raise Program_Error with "attempt to tamper with cursors (container is busy)"; end if; Clear (Target); return; end if; if Source.Length = 0 then return; end if; if Target.Busy > 0 then raise Program_Error with "attempt to tamper with cursors (container is busy)"; end if; loop if Tgt = null then return; end if; if Src = null then return; end if; if Is_Less (Tgt, Src) then Tgt := Tree_Operations.Next (Tgt); elsif Is_Less (Src, Tgt) then Src := Tree_Operations.Next (Src); else declare X : Node_Access := Tgt; begin Tgt := Tree_Operations.Next (Tgt); Tree_Operations.Delete_Node_Sans_Free (Target, X); Free (X); end; Src := Tree_Operations.Next (Src); end if; end loop; end Difference; function Difference (Left, Right : Tree_Type) return Tree_Type is Tree : Tree_Type; L_Node : Node_Access := Left.First; R_Node : Node_Access := Right.First; Dst_Node : Node_Access; begin if Left'Address = Right'Address then return Tree; -- Empty set end if; if Left.Length = 0 then return Tree; -- Empty set end if; if Right.Length = 0 then return Copy (Left); end if; loop if L_Node = null then return Tree; end if; if R_Node = null then while L_Node /= null loop Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => L_Node, Dst_Node => Dst_Node); L_Node := Tree_Operations.Next (L_Node); end loop; return Tree; end if; if Is_Less (L_Node, R_Node) then Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => L_Node, Dst_Node => Dst_Node); L_Node := Tree_Operations.Next (L_Node); elsif Is_Less (R_Node, L_Node) then R_Node := Tree_Operations.Next (R_Node); else L_Node := Tree_Operations.Next (L_Node); R_Node := Tree_Operations.Next (R_Node); end if; end loop; exception when others => Delete_Tree (Tree.Root); raise; end Difference; ------------------ -- Intersection -- ------------------ procedure Intersection (Target : in out Tree_Type; Source : Tree_Type) is Tgt : Node_Access := Target.First; Src : Node_Access := Source.First; begin if Target'Address = Source'Address then return; end if; if Target.Busy > 0 then raise Program_Error with "attempt to tamper with cursors (container is busy)"; end if; if Source.Length = 0 then Clear (Target); return; end if; while Tgt /= null and then Src /= null loop if Is_Less (Tgt, Src) then declare X : Node_Access := Tgt; begin Tgt := Tree_Operations.Next (Tgt); Tree_Operations.Delete_Node_Sans_Free (Target, X); Free (X); end; elsif Is_Less (Src, Tgt) then Src := Tree_Operations.Next (Src); else Tgt := Tree_Operations.Next (Tgt); Src := Tree_Operations.Next (Src); end if; end loop; while Tgt /= null loop declare X : Node_Access := Tgt; begin Tgt := Tree_Operations.Next (Tgt); Tree_Operations.Delete_Node_Sans_Free (Target, X); Free (X); end; end loop; end Intersection; function Intersection (Left, Right : Tree_Type) return Tree_Type is Tree : Tree_Type; L_Node : Node_Access := Left.First; R_Node : Node_Access := Right.First; Dst_Node : Node_Access; begin if Left'Address = Right'Address then return Copy (Left); end if; loop if L_Node = null then return Tree; end if; if R_Node = null then return Tree; end if; if Is_Less (L_Node, R_Node) then L_Node := Tree_Operations.Next (L_Node); elsif Is_Less (R_Node, L_Node) then R_Node := Tree_Operations.Next (R_Node); else Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => L_Node, Dst_Node => Dst_Node); L_Node := Tree_Operations.Next (L_Node); R_Node := Tree_Operations.Next (R_Node); end if; end loop; exception when others => Delete_Tree (Tree.Root); raise; end Intersection; --------------- -- Is_Subset -- --------------- function Is_Subset (Subset : Tree_Type; Of_Set : Tree_Type) return Boolean is begin if Subset'Address = Of_Set'Address then return True; end if; if Subset.Length > Of_Set.Length then return False; end if; declare Subset_Node : Node_Access := Subset.First; Set_Node : Node_Access := Of_Set.First; begin loop if Set_Node = null then return Subset_Node = null; end if; if Subset_Node = null then return True; end if; if Is_Less (Subset_Node, Set_Node) then return False; end if; if Is_Less (Set_Node, Subset_Node) then Set_Node := Tree_Operations.Next (Set_Node); else Set_Node := Tree_Operations.Next (Set_Node); Subset_Node := Tree_Operations.Next (Subset_Node); end if; end loop; end; end Is_Subset; ------------- -- Overlap -- ------------- function Overlap (Left, Right : Tree_Type) return Boolean is L_Node : Node_Access := Left.First; R_Node : Node_Access := Right.First; begin if Left'Address = Right'Address then return Left.Length /= 0; end if; loop if L_Node = null or else R_Node = null then return False; end if; if Is_Less (L_Node, R_Node) then L_Node := Tree_Operations.Next (L_Node); elsif Is_Less (R_Node, L_Node) then R_Node := Tree_Operations.Next (R_Node); else return True; end if; end loop; end Overlap; -------------------------- -- Symmetric_Difference -- -------------------------- procedure Symmetric_Difference (Target : in out Tree_Type; Source : Tree_Type) is Tgt : Node_Access := Target.First; Src : Node_Access := Source.First; New_Tgt_Node : Node_Access; begin if Target.Busy > 0 then raise Program_Error with "attempt to tamper with cursors (container is busy)"; end if; if Target'Address = Source'Address then Clear (Target); return; end if; loop if Tgt = null then while Src /= null loop Insert_With_Hint (Dst_Tree => Target, Dst_Hint => null, Src_Node => Src, Dst_Node => New_Tgt_Node); Src := Tree_Operations.Next (Src); end loop; return; end if; if Src = null then return; end if; if Is_Less (Tgt, Src) then Tgt := Tree_Operations.Next (Tgt); elsif Is_Less (Src, Tgt) then Insert_With_Hint (Dst_Tree => Target, Dst_Hint => Tgt, Src_Node => Src, Dst_Node => New_Tgt_Node); Src := Tree_Operations.Next (Src); else declare X : Node_Access := Tgt; begin Tgt := Tree_Operations.Next (Tgt); Tree_Operations.Delete_Node_Sans_Free (Target, X); Free (X); end; Src := Tree_Operations.Next (Src); end if; end loop; end Symmetric_Difference; function Symmetric_Difference (Left, Right : Tree_Type) return Tree_Type is Tree : Tree_Type; L_Node : Node_Access := Left.First; R_Node : Node_Access := Right.First; Dst_Node : Node_Access; begin if Left'Address = Right'Address then return Tree; -- Empty set end if; if Right.Length = 0 then return Copy (Left); end if; if Left.Length = 0 then return Copy (Right); end if; loop if L_Node = null then while R_Node /= null loop Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => R_Node, Dst_Node => Dst_Node); R_Node := Tree_Operations.Next (R_Node); end loop; return Tree; end if; if R_Node = null then while L_Node /= null loop Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => L_Node, Dst_Node => Dst_Node); L_Node := Tree_Operations.Next (L_Node); end loop; return Tree; end if; if Is_Less (L_Node, R_Node) then Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => L_Node, Dst_Node => Dst_Node); L_Node := Tree_Operations.Next (L_Node); elsif Is_Less (R_Node, L_Node) then Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => null, Src_Node => R_Node, Dst_Node => Dst_Node); R_Node := Tree_Operations.Next (R_Node); else L_Node := Tree_Operations.Next (L_Node); R_Node := Tree_Operations.Next (R_Node); end if; end loop; exception when others => Delete_Tree (Tree.Root); raise; end Symmetric_Difference; ----------- -- Union -- ----------- procedure Union (Target : in out Tree_Type; Source : Tree_Type) is Hint : Node_Access; procedure Process (Node : Node_Access); pragma Inline (Process); procedure Iterate is new Tree_Operations.Generic_Iteration (Process); ------------- -- Process -- ------------- procedure Process (Node : Node_Access) is begin Insert_With_Hint (Dst_Tree => Target, Dst_Hint => Hint, Src_Node => Node, Dst_Node => Hint); end Process; -- Start of processing for Union begin if Target'Address = Source'Address then return; end if; if Target.Busy > 0 then raise Program_Error with "attempt to tamper with cursors (container is busy)"; end if; Iterate (Source); end Union; function Union (Left, Right : Tree_Type) return Tree_Type is begin if Left'Address = Right'Address then return Copy (Left); end if; if Left.Length = 0 then return Copy (Right); end if; if Right.Length = 0 then return Copy (Left); end if; declare Tree : Tree_Type := Copy (Left); Hint : Node_Access; procedure Process (Node : Node_Access); pragma Inline (Process); procedure Iterate is new Tree_Operations.Generic_Iteration (Process); ------------- -- Process -- ------------- procedure Process (Node : Node_Access) is begin Insert_With_Hint (Dst_Tree => Tree, Dst_Hint => Hint, Src_Node => Node, Dst_Node => Hint); end Process; -- Start of processing for Union begin Iterate (Right); return Tree; exception when others => Delete_Tree (Tree.Root); raise; end; end Union; end Ada.Containers.Red_Black_Trees.Generic_Set_Operations;
software/modules/controller.ads
TUM-EI-RCS/StratoX
12
21144
<reponame>TUM-EI-RCS/StratoX -- Institution: Technische Universität München -- Department: Realtime Computer Systems (RCS) -- Project: StratoX -- Module: Controller -- -- Authors: <NAME> (<EMAIL>) -- -- Description: Controls all actuators, calls PID loop -- -- ToDo: -- [ ] Implementation with Units; use Units; with Units.Navigation; use Units.Navigation; package Controller with SPARK_Mode is subtype Elevator_Angle_Type is Angle_Type range -43.0 * Degree .. 43.0 * Degree; subtype Aileron_Angle_Type is Angle_Type range -43.0 * Degree .. 43.0 * Degree; subtype Elevon_Angle_Type is Angle_Type range -45.0 * Degree .. 45.0 * Degree; type Elevon_Index_Type is (LEFT, RIGHT); type Elevon_Angle_Array is array(Elevon_Index_Type) of Elevon_Angle_Type; -- init procedure initialize; procedure activate; procedure deactivate; procedure set_Target_Position(location : GPS_Loacation_Type); procedure set_Current_Position(location : GPS_Loacation_Type); procedure set_Current_Orientation (orientation : Orientation_Type); procedure log_Info; procedure runOneCycle; procedure set_hold; procedure set_detach; procedure bark; -- good boy! -- don't use this when time is critical. It will consume 400msec! procedure sync with Inline; function get_Elevons return Elevon_Angle_Array; private type Control_Priority_Type is (EQUAL, PITCH_FIRST, ROLL_FIRST); type Plane_Control_Type is record Elevator : Elevator_Angle_Type; Aileron : Aileron_Angle_Type; end record; procedure control_Roll; procedure control_Pitch; function Elevon_Angles( elevator : Elevator_Angle_Type; aileron : Aileron_Angle_Type; priority : Control_Priority_Type ) return Elevon_Angle_Array; end Controller;
Projects/Arbre_Genealogique/livrables/arbre_genealogique.adb
faicaltoubali/ENSEEIHT
0
9720
<reponame>faicaltoubali/ENSEEIHT with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; package body arbre_genealogique is procedure Creer_Minimal ( Abr : out T_Abr_Genea ; Racine : Integer ; Registre : out T_Registre_Genea; Nom : in unbounded_string ; Prenom : in unbounded_string ; Jour : Integer ; Mois : T_Mois_Gen ; Annee : in Integer ; Lieu_Naissance : unbounded_string) is Dico : T_Dictionnaire ; begin Dico := Creer_Dictionnaire ( Nom , Prenom , Jour , Mois , Annee , Lieu_Naissance ) ; Ajouter_Identifiant_Dictionnaire(Registre, Racine,Dico); Creer_Arbre(Abr,Racine); end Creer_Minimal ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function Taille_Genealogique ( Abr : in T_Abr_Genea ) return Integer is begin return Taille ( Abr ); end Taille_Genealogique ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- procedure Vider_Genealogique ( Abr : out T_Abr_Genea ) is begin Vider_Arbre ( Abr ); end Vider_Genealogique; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function Vide_Genealogique ( Abr : in T_Abr_Genea ) return boolean is begin return Vide(Abr); end Vide_Genealogique ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Procedure Ajouter_Pere (Abr : in out T_Abr_Genea ; Identifiant_Donnee : in Integer; Pere : in Integer ; Registre : out T_Registre_Genea; Nom : in unbounded_string ; Prenom : in unbounded_string ; Jour : Integer ; Mois : T_Mois_Gen ; Annee : in Integer ; Lieu_Naissance : unbounded_string) is Dico : T_Dictionnaire; begin Dico := Creer_Dictionnaire ( Nom , Prenom , Jour , Mois , Annee , Lieu_Naissance ) ; Ajouter_Identifiant_Dictionnaire(Registre, Pere,Dico); Ajouter_Fils_Droit ( Abr , Identifiant_Donnee , Pere); end Ajouter_Pere ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Procedure Ajouter_Mere (Abr : in out T_Abr_Genea ; Identifiant_Donnee : in Integer; Mere : in Integer; Registre : out T_Registre_Genea; Nom : in unbounded_string ; Prenom : in unbounded_string ; Jour : Integer ; Mois : T_Mois_Gen ; Annee : in Integer ; Lieu_Naissance : unbounded_string) is Dico : T_Dictionnaire ; begin Dico := Creer_Dictionnaire ( Nom , Prenom , Jour , Mois , Annee , Lieu_Naissance ) ; Ajouter_Identifiant_Dictionnaire(Registre, Mere ,Dico); Ajouter_Fils_Gauche ( Abr , Identifiant_Donnee , Mere); end Ajouter_Mere ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- procedure Supprimer_Genea ( Abr : in out T_Abr_Genea ; Identifiant : in Integer ) is begin Supprimer ( Abr , Identifiant ); end Supprimer_Genea ; ----------------------------------------------------------------------------- function Arbre_Cle_Genea ( Abr : in T_Abr_Genea ; Identifiant : in Integer ) return T_Abr_Genea is begin return Arbre_Cle ( Abr , Identifiant ) ; end Arbre_Cle_Genea ; --------------------------------------------------------------------- function Avoir_Cle_Arbre_Genea ( Abr : in T_Abr_Genea ) return Integer is begin return Avoir_Cle_Arbre ( Abr ) ; end Avoir_Cle_Arbre_Genea; ----------------------------------------------------------------- function Sous_Arbre_Gauche ( Abr :in T_Abr_Genea ) return T_Abr_Genea is begin return Avoir_Sous_Arbre_Gauche ( Abr ); end Sous_Arbre_Gauche ; ---------------------------------------------------------------------- function Sous_Arbre_Droit ( Abr : in T_Abr_Genea ) return T_Abr_Genea is begin return Avoir_Sous_Arbre_Droit ( Abr ); end Sous_Arbre_Droit ; ------------------------------------------------------------------------------------ function Nombre_Ancetre ( Abr : in T_Abr_Genea ; Identifiant_Donnee : in Integer ) return Integer is begin return Taille_Genealogique( Arbre_Cle_Genea ( Abr , Identifiant_Donnee )); end Nombre_Ancetre ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function Ancetres_Generation (Abr : in T_Abr_Genea ; Identifiant_Donnee : in Integer ; Nb_Generation : in Integer ) return T_Ensemble_Identifiant is T : T_Ensemble_Identifiant ; procedure Ajouter ( Abr : in T_Abr_Genea ; T: in out T_Ensemble_Identifiant ; i : in Integer ) is T1 : T_Ensemble_Identifiant ; begin if not Vide ( Abr ) then if i = 0 then T1 := new T_Cellule_Identifiant'( Avoir_Cle_Arbre_Genea ( Abr ) , Null ); T1.All.Suivant := T; T := T1 ; end if; if Not Vide ( Avoir_Sous_Arbre_Droit ( Abr ) ) and Not Vide ( Avoir_Sous_Arbre_Gauche ( Abr ) ) then Ajouter ( Avoir_Sous_Arbre_Droit ( Abr ) , T, i-1 ); Ajouter ( Avoir_Sous_Arbre_Gauche (Abr ) , T, i-1 ); elsif Not Vide ( Avoir_Sous_Arbre_Droit ( Abr ) ) and Vide ( Avoir_Sous_Arbre_Gauche ( Abr ) ) then Ajouter ( Avoir_Sous_Arbre_Droit ( Abr ) ,T, i-1 ); elsif Vide ( Avoir_Sous_Arbre_Droit ( Abr ) ) and Not Vide ( Avoir_Sous_Arbre_Gauche ( Abr ) ) then Ajouter ( Avoir_Sous_Arbre_Gauche ( Abr ) ,T, i-1 ); else null ; end if; else Null; end if; end Ajouter; begin Ajouter ( Arbre_Cle_Genea ( Abr, Identifiant_Donnee) ,T, Nb_Generation ); return T ; end Ancetres_Generation ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- procedure Afficher_Entier_Arbre ( entier : in Integer ) is begin put ( entier, width =>0) ; end Afficher_Entier_Arbre; procedure Afficher_Arbre_Noeud ( Abr : in T_Abr_Genea ; Noeud : in Integer ;n : in integer) is begin Afficher_Arbre_Binaire ( Arbre_Cle ( Abr , Noeud ), n ); end Afficher_Arbre_Noeud ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- procedure Supprimer_Noeud_Ancetres ( Abr : in out T_Abr_Genea ; Noeud : in Integer ) is begin Supprimer ( Abr , Noeud ); end Supprimer_Noeud_Ancetres ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function Un_Seul_Parent (Abr : in T_Abr_Genea) return T_Ensemble_Identifiant is T : T_Ensemble_Identifiant ; procedure Ajouter ( Abr : in T_Abr_Genea ; T : in out T_Ensemble_Identifiant ) is T1 : T_Ensemble_Identifiant; begin if not Vide (Abr) then if Vide ( Avoir_Sous_Arbre_Droit ( Abr ) ) xor Vide ( Avoir_Sous_Arbre_Gauche ( Abr )) then T1 := new T_Cellule_Identifiant'( Avoir_Cle_Arbre_Genea ( Abr ) , Null ); T1.All.Suivant := T; T := T1 ; end if; Ajouter ( Sous_Arbre_Droit(Abr) , T ); Ajouter ( Sous_Arbre_Gauche(Abr) , T ); else Null; end if; end Ajouter; begin Ajouter ( Abr , T); return T ; end Un_Seul_Parent ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function Deux_Parent ( Abr : in T_Abr_Genea ) return T_Ensemble_Identifiant is T : T_Ensemble_Identifiant; procedure Ajouter ( Abr : in T_Abr_Genea ; T : in out T_Ensemble_Identifiant ) is T1 : T_Ensemble_Identifiant ; begin if not Vide ( Abr ) then if not Vide ( Avoir_Sous_Arbre_Droit ( Abr ) ) and not Vide ( Avoir_Sous_Arbre_Gauche ( Abr )) then T1 := new T_Cellule_Identifiant'( Avoir_Cle_Arbre_Genea ( Abr ) , Null); T1.All.Suivant := T ; T := T1; end if; Ajouter ( Sous_Arbre_Droit(Abr) , T ); Ajouter ( Sous_Arbre_Gauche(Abr) , T ); else Null; end if; end Ajouter; begin Ajouter ( Abr , T ); return (T); end Deux_Parent ; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function Aucun_Parent ( Abr : in T_Abr_Genea ) return T_Ensemble_Identifiant is T : T_Ensemble_Identifiant ; procedure Ajouter ( Abr : in T_Abr_Genea ; T : in out T_Ensemble_Identifiant ) is T1 : T_Ensemble_Identifiant ; begin if not Vide (Abr) Then if Vide ( Avoir_Sous_Arbre_Droit ( Abr ) ) and Vide (Avoir_Sous_Arbre_Gauche ( Abr ) ) then T1 := new T_Cellule_Identifiant'( Avoir_Cle_Arbre_Genea ( Abr ) , Null ); T1.All.Suivant := T; T := T1 ; end if; Ajouter ( Sous_Arbre_Droit(Abr) , T ); Ajouter ( Sous_Arbre_Gauche(Abr) , T); else Null; end if; end Ajouter; begin Ajouter ( Abr , T); return T ; end Aucun_Parent ; ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function Ancetres_Plusieurs_Generation ( Abr : in T_Abr_Genea ; Identifiant_Donnee : in Integer ; n : in Integer ) return T_Ensemble_Identifiant is T : T_Ensemble_Identifiant ; procedure Ajouter ( Abr : in T_Abr_Genea ; T : in out T_Ensemble_Identifiant ; i : in Integer ) is T1 : T_Ensemble_Identifiant ; begin if i <= n then if Vide ( Abr ) then null; else T1 := new T_Cellule_Identifiant'( Avoir_Cle_Arbre ( Abr ) , Null ); T1.All.Suivant := T; T := T1 ; Ajouter ( Avoir_Sous_Arbre_Droit (Abr) , T , i+1 ); Ajouter ( Avoir_Sous_Arbre_Gauche (Abr) , T , i+1 ); end if; else null ; end if; end Ajouter ; begin Ajouter ( Arbre_Cle_Genea ( Abr , Identifiant_Donnee) , T , 0 ); return T; end Ancetres_Plusieurs_Generation ; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ function profondeur ( Abr : in T_Abr_Genea ) return Integer is a : Integer ; b : Integer ; begin if Vide ( Abr ) then return 0 ; else a := profondeur ( Avoir_Sous_Arbre_Droit( Abr ) ); b := profondeur ( Avoir_Sous_Arbre_Gauche( Abr ) ); if a >= b then return 1 + a ; else return 1 + b ; end if; end if ; end profondeur; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- function Verifier_Ancetres ( Abr : in T_Abr_Genea ; n : in Integer ; m : in Integer ) return Integer is T: T_Ensemble_Identifiant := Null; T1: T_Ensemble_Identifiant := Ancetres_Plusieurs_Generation ( Abr , n , profondeur ( Arbre_Cle_Genea ( Abr , n ) ) ); T2: T_Ensemble_Identifiant := Ancetres_Plusieurs_Generation ( Abr , m , profondeur ( Arbre_Cle_Genea ( Abr , m ) ) ); procedure Modifier ( T1 : out T_Ensemble_Identifiant ; T2 : out T_Ensemble_Identifiant ; T : out T_Ensemble_Identifiant ) is T3: T_Ensemble_Identifiant; begin while T1 /= Null loop while T2 /= Null loop if T1.All.Identifiant = T2.All.Identifiant then T3 := new T_Cellule_Identifiant'(T2.All.Identifiant, Null); T3.All.Suivant := T ; T := T3; end if; T2 := T2.All.Suivant ; end loop; T1 := T1.All.Suivant ; end loop; end Modifier; begin Modifier ( T1 , T2 , T ); if T = Null then return 0 ; else return 1 ; end if; end Verifier_Ancetres; ----------------------------------------------------------------------------------------------------------- function Existe_Noeud ( Abr : in T_Abr_Genea ; Identifiant_Donnee : in Integer ) return Boolean is begin return Existe ( Abr , Identifiant_Donnee ); end Existe_Noeud; ------------------------------------------------------------------------------------------------------------ function Avoir_Identifiant ( Liste : in T_Ensemble_Identifiant ) return Integer is begin return Liste.All.Identifiant ; end Avoir_Identifiant ; function Avoir_Suivant ( Liste : in T_Ensemble_Identifiant ) return T_Ensemble_Identifiant is begin return Liste.All.Suivant; end Avoir_Suivant ; end arbre_genealogique ;
data/mapHeaders/Route18Gate2F.asm
AmateurPanda92/pokemon-rby-dx
9
82089
Route18Gate2F_h: db GATE ; tileset db ROUTE_18_GATE_2F_HEIGHT, ROUTE_18_GATE_2F_WIDTH ; dimensions (y, x) dw Route18Gate2F_Blocks ; blocks dw Route18Gate2F_TextPointers ; texts dw Route18Gate2F_Script ; scripts db 0 ; connections dw Route18Gate2F_Object ; objects
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/limited_with4_pkg.ads
best08618/asylo
7
20513
with Limited_With4; package Limited_With4_Pkg is P1 : Limited_With4.Ptr1 := Limited_With4.Proc1'Access; P2 : Limited_With4.Ptr2 := Limited_With4.Proc2'Access; type Rec12 is record I : Integer; R : Limited_With4.Rec1; end record; type Rec22 is record I : Integer; R : Limited_With4.Rec2; end record; end Limited_With4_Pkg;
lib/AocIO.agda
Zalastax/adventofcode2017
0
14416
<reponame>Zalastax/adventofcode2017 module AocIO where open import IO.Primitive public open import Data.String as String open import Data.List as List postulate getLine : IO Costring getArgs : IO (List String) getProgName : IO String {-# COMPILE GHC getLine = getLine #-} {-# FOREIGN GHC import qualified Data.Text as Text #-} {-# FOREIGN GHC import qualified Data.Text.IO as Text #-} {-# FOREIGN GHC import System.Environment (getArgs, getProgName) #-} {-# COMPILE GHC getArgs = fmap (map Text.pack) getArgs #-} {-# COMPILE GHC getProgName = fmap Text.pack getProgName #-}
test/Succeed/Issue1409.agda
KDr2/agda
0
4391
-- Andreas, 2014-01-21, Issue 1209 reported by Andrea {-# OPTIONS --cubical-compatible #-} {-# OPTIONS --copatterns #-} {-# OPTIONS --sized-types #-} open import Common.Size record R (i : Size) : Set where coinductive field force : (j : Size< i) → R j postulate f : ∀ {i} → R i → R i t : (i : Size) → R i R.force (t i) j = f (t j) -- should termination check
include/xlib_xcb.ads
docandrew/troodon
5
10703
pragma Ada_2012; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; limited with Xlib; limited with xcb; package Xlib_xcb is -- Copyright (C) 2003-2006 <NAME>, <NAME> -- * This file is licensed under the MIT license. See the file COPYING. function XGetXCBConnection (dpy : access Xlib.Display) return access xcb.xcb_connection_t -- /usr/include/X11/Xlib-xcb.h:13 with Import => True, Convention => C, External_Name => "XGetXCBConnection"; type XEventQueueOwner is (XlibOwnsEventQueue, XCBOwnsEventQueue) with Convention => C; -- /usr/include/X11/Xlib-xcb.h:15 procedure XSetEventQueueOwner (dpy : access Xlib.Display; owner : XEventQueueOwner) -- /usr/include/X11/Xlib-xcb.h:16 with Import => True, Convention => C, External_Name => "XSetEventQueueOwner"; end Xlib_xcb;
programs/oeis/035/A035928.asm
jmorken/loda
1
13036
; A035928: Numbers n such that BCR(n) = n, where BCR = binary-complement-and-reverse = take one's complement then reverse bit order. ; 2,10,12,38,42,52,56,142,150,170,178,204,212,232,240,542,558,598,614,666,682,722,738,796,812,852,868,920,936,976,992,2110,2142,2222,2254,2358,2390,2470,2502,2618,2650,2730,2762,2866,2898,2978,3010,3132,3164,3244,3276,3380,3412,3492,3524,3640,3672,3752,3784,3888,3920,4000,4032,8318,8382,8542,8606,8814,8878,9038,9102,9334,9398,9558,9622,9830,9894,10054,10118,10362,10426,10586,10650,10858,10922,11082,11146,11378,11442,11602,11666,11874,11938,12098,12162,12412,12476,12636,12700,12908,12972,13132,13196,13428,13492,13652,13716,13924,13988,14148,14212,14456,14520,14680,14744,14952,15016,15176,15240,15472,15536,15696,15760,15968,16032,16192,16256,33022,33150,33470,33598,34014,34142,34462,34590,35054,35182,35502,35630,36046,36174,36494,36622,37110,37238,37558,37686,38102,38230,38550,38678,39142,39270,39590,39718,40134,40262,40582,40710,41210,41338,41658,41786,42202,42330,42650,42778,43242,43370,43690,43818,44234,44362,44682,44810,45298,45426,45746,45874,46290,46418,46738,46866,47330,47458,47778,47906,48322,48450,48770,48898,49404,49532,49852,49980,50396,50524,50844,50972,51436,51564,51884,52012,52428,52556,52876,53004,53492,53620,53940,54068,54484,54612,54932,55060,55524,55652,55972,56100,56516,56644,56964,57092,57592,57720,58040,58168,58584,58712,59032,59160,59624,59752,60072,60200,60616,60744,61064,61192,61680,61808,62128,62256,62672,62800,63120,63248,63712,63840,64160 mov $2,1 lpb $0 sub $0,1 mov $3,$2 mov $4,2 add $4,$0 div $0,2 add $4,$2 mov $5,1 add $5,$4 mov $2,$5 add $2,$3 add $2,$0 lpe mov $0,1 add $2,6 add $0,$2 mul $0,2 mov $1,$0 sub $1,15 div $1,2 mul $1,2 add $1,2
oeis/258/A258057.asm
neoneye/loda-programs
11
12222
; A258057: First differences of the arithmetic derivative sequence A003415. ; Submitted by <NAME> ; 0,1,0,3,-3,4,-4,11,-6,1,-6,15,-15,8,-1,24,-31,20,-20,23,-14,3,-12,43,-34,5,12,5,-31,30,-30,79,-66,5,-7,48,-59,20,-5,52,-67,40,-40,47,-9,-14,-24,111,-98,31,-25,36,-55,80,-65,76,-70,9,-30,91,-91,32,18,141,-174,43,-60,71,-46,33,-58,155,-155,38,16,25,-62,53,-70,175,-68,-65,-42,123,-102,23,-13,108,-139,122,-103,76,-62,15,-25,248,-271,76,-2,65 mov $2,$0 mov $3,$0 lpb $2 mov $0,$3 sub $2,1 sub $0,$2 add $0,1 seq $0,3415 ; a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(mn) = m*a(n) + n*a(m). mov $1,$0 sub $1,$4 mul $1,3 sub $1,3 div $1,3 add $1,1 add $4,$1 lpe mov $0,$1
test/Succeed/Issue2883b.agda
shlevy/agda
1,989
5830
record R : Set₁ where field X : Set data Δ (A : Set) : Set where _,_ : A → A → Δ A foo : (A : Set) → R → Δ A → Set foo A = λ { r (x , y) → let open R r in X } -- (y₁ : r) → Set !=< Set of type Set₁ -- when checking that the expression .Foo.X has type Set
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xa0_notsx.log_21829_654.asm
ljhsiun2/medusa
9
27099
.global s_prepare_buffers s_prepare_buffers: push %r15 push %r8 push %rax push %rcx push %rdi push %rsi lea addresses_D_ht+0x13b57, %rsi lea addresses_UC_ht+0x1cd3e, %rdi nop dec %rax mov $116, %rcx rep movsq nop nop nop nop nop dec %r15 lea addresses_WT_ht+0x1257, %r8 nop nop nop nop nop xor %rdi, %rdi movb $0x61, (%r8) nop nop nop nop nop cmp %rcx, %rcx pop %rsi pop %rdi pop %rcx pop %rax pop %r8 pop %r15 ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r9 push %rbp push %rcx push %rdi push %rsi // Store lea addresses_D+0x1ae57, %rcx nop nop nop nop nop add $22538, %rbp movb $0x51, (%rcx) nop add $47567, %r10 // Load lea addresses_WC+0x1a6d7, %r9 nop sub %rdi, %rdi mov (%r9), %rsi nop inc %rbp // Store lea addresses_UC+0x1fad7, %rbp clflush (%rbp) nop nop nop inc %r14 mov $0x5152535455565758, %r10 movq %r10, (%rbp) nop nop nop nop xor %r9, %r9 // Store lea addresses_D+0x1c9d7, %r14 nop nop nop nop nop add $11706, %rbp mov $0x5152535455565758, %rcx movq %rcx, %xmm4 movups %xmm4, (%r14) nop add %r9, %r9 // Store lea addresses_A+0x31d7, %r9 nop and $25132, %r14 movb $0x51, (%r9) add %r10, %r10 // Faulty Load lea addresses_A+0x31d7, %r9 nop nop nop sub $4339, %rcx mov (%r9), %r14 lea oracles, %rcx and $0xff, %r14 shlq $12, %r14 mov (%rcx,%r14,1), %r14 pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 5}} {'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 1, 'NT': True, 'same': True, 'congruent': 0}} [Faulty Load] {'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 7}} {'51': 21829} 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 */
Transynther/x86/_processed/US/_st_un_/i7-7700_9_0x48.log_21829_2136.asm
ljhsiun2/medusa
9
175138
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r11 push %r15 push %r9 push %rcx push %rdx push %rsi // Faulty Load lea addresses_US+0x1e77d, %rsi nop nop nop nop nop cmp %r15, %r15 mov (%rsi), %ecx lea oracles, %rsi and $0xff, %rcx shlq $12, %rcx mov (%rsi,%rcx,1), %rcx pop %rsi pop %rdx pop %rcx pop %r9 pop %r15 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': True, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}} <gen_prepare_buffer> {'3c': 3903, 'ff': 17926} ff 3c 3c 3c ff ff ff ff ff 3c 3c ff ff ff ff 3c ff ff 3c ff ff ff ff ff 3c ff 3c 3c ff 3c 3c 3c ff ff ff ff ff ff ff 3c 3c ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 3c ff 3c ff ff ff 3c ff 3c ff ff ff ff ff ff ff ff 3c ff ff ff ff ff ff 3c ff ff ff ff 3c ff 3c 3c ff ff 3c ff 3c 3c ff ff 3c ff 3c 3c ff ff ff 3c 3c 3c ff ff ff ff 3c 3c 3c 3c 3c ff ff ff 3c ff ff ff 3c 3c 3c ff 3c ff ff ff 3c 3c 3c 3c ff 3c 3c ff 3c 3c ff ff ff ff ff ff ff 3c 3c 3c 3c 3c ff ff ff ff 3c ff 3c 3c ff 3c ff ff ff ff 3c 3c ff ff 3c 3c ff ff ff ff ff ff ff ff 3c ff ff ff ff ff ff ff ff ff 3c 3c ff 3c ff ff ff ff 3c ff ff ff ff ff ff ff ff ff ff ff ff ff 3c ff ff ff ff ff ff ff ff ff 3c ff 3c ff 3c ff ff ff ff 3c ff ff ff ff 3c ff ff 3c ff ff ff ff 3c ff ff ff ff ff ff ff 3c ff ff ff ff ff ff ff 3c ff ff ff 3c ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 3c ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 3c ff ff ff 3c 3c ff ff ff ff ff ff ff ff ff ff ff ff 3c 3c 3c ff 3c ff ff ff ff 3c 3c ff ff 3c 3c ff 3c 3c 3c 3c 3c ff ff ff ff ff ff ff ff ff 3c ff ff ff ff ff ff ff ff 3c 3c ff 3c ff ff ff 3c ff ff ff ff ff 3c ff ff ff ff ff ff ff 3c ff ff 3c ff 3c ff ff ff 3c ff ff ff ff ff ff 3c 3c 3c ff ff 3c ff ff 3c 3c 3c 3c 3c ff ff 3c 3c ff 3c ff ff ff 3c 3c 3c ff ff ff 3c ff ff ff ff ff ff 3c 3c 3c ff ff 3c ff ff ff ff ff ff 3c 3c ff ff 3c ff ff ff ff ff 3c ff ff ff ff ff ff ff ff ff ff ff 3c ff ff ff ff ff ff ff ff ff ff ff ff ff 3c ff ff ff ff ff 3c ff ff ff ff ff 3c ff ff ff ff ff ff 3c ff ff ff ff ff 3c ff ff ff ff ff ff ff ff ff 3c ff ff ff 3c ff 3c ff ff 3c ff ff ff ff ff ff 3c ff 3c ff ff ff ff 3c 3c 3c 3c 3c 3c 3c ff ff ff ff ff ff ff 3c ff 3c ff ff 3c ff ff ff ff ff 3c ff ff ff ff ff 3c ff ff ff ff ff ff ff 3c ff ff ff ff ff ff ff ff ff ff ff ff 3c ff 3c ff ff ff ff 3c ff ff ff ff ff ff 3c ff ff ff 3c 3c ff ff ff 3c ff ff ff ff ff 3c ff ff ff ff ff 3c ff ff ff ff ff ff ff ff ff 3c ff ff ff ff ff ff ff 3c ff ff ff ff 3c 3c ff ff ff ff 3c ff 3c 3c ff ff ff ff 3c ff ff ff ff 3c 3c 3c ff 3c 3c ff ff ff ff 3c 3c ff ff ff ff 3c 3c ff ff ff ff ff ff ff 3c ff ff ff ff ff 3c 3c ff ff ff 3c 3c ff ff ff 3c 3c ff ff 3c ff ff ff ff ff 3c 3c 3c 3c 3c ff ff ff ff ff ff ff ff ff ff 3c 3c ff 3c ff ff ff ff 3c 3c 3c 3c ff 3c ff ff ff ff ff 3c ff ff ff ff ff ff ff ff ff 3c 3c ff ff 3c ff ff ff ff ff ff 3c 3c 3c ff ff ff ff ff ff ff ff ff ff ff 3c 3c ff 3c ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 3c ff ff ff ff 3c ff ff ff ff ff ff 3c ff ff ff 3c 3c 3c ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 3c 3c ff ff ff ff 3c ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 3c ff ff ff 3c ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 3c 3c ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 3c ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff */
programs/oeis/271/A271662.asm
neoneye/loda
22
163391
<filename>programs/oeis/271/A271662.asm ; A271662: Convolution of nonzero pentagonal numbers (A000326) with themselves. ; 1,10,49,164,434,980,1974,3648,6303,10318,16159,24388,35672,50792,70652,96288,128877,169746,220381,282436,357742,448316,556370,684320,834795,1010646,1214955,1451044,1722484,2033104,2387000,2788544,3242393,3753498,4327113,4968804,5684458,6480292,7362862,8339072,9416183,10601822,11903991,13331076,14891856,16595512,18451636,20470240,22661765,25037090,27607541,30384900,33381414,36609804,40083274,43815520,47820739,52113638,56709443,61623908,66873324,72474528,78444912,84802432,91565617,98753578,106386017,114483236,123066146,132156276,141775782,151947456,162694735,174041710,186013135,198634436,211931720,225931784,240662124,256150944,272427165,289520434,307461133,326280388,346010078,366682844,388332098,410992032,434697627,459484662,485389723,512450212,540704356,570191216,600950696,633023552,666451401,701276730,737542905,775294180 lpb $0 mov $2,$0 sub $0,1 seq $2,213830 ; Antidiagonal sums of the convolution array A213828. add $1,$2 lpe div $1,2 add $1,1 mov $0,$1
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_612.asm
ljhsiun2/medusa
9
93622
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r15 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_D_ht+0x1e3a8, %rsi lea addresses_WT_ht+0x1c128, %rdi nop nop and %r15, %r15 mov $22, %rcx rep movsb nop nop nop sub $22644, %r15 lea addresses_normal_ht+0x131ac, %r13 sub $52572, %rax mov (%r13), %ebp nop nop nop nop nop cmp %rbp, %rbp lea addresses_UC_ht+0x12ca8, %rsi nop nop nop nop xor $35678, %rdi mov $0x6162636465666768, %rax movq %rax, %xmm5 vmovups %ymm5, (%rsi) inc %r13 lea addresses_WT_ht+0x1c5a8, %rsi lea addresses_D_ht+0x20a7, %rdi nop nop cmp %r11, %r11 mov $56, %rcx rep movsq nop nop xor %r13, %r13 lea addresses_A_ht+0x3ba8, %rsi nop nop nop add $64941, %rdi mov $0x6162636465666768, %r13 movq %r13, %xmm1 vmovups %ymm1, (%rsi) nop nop xor %rdi, %rdi lea addresses_A_ht+0x159e8, %rsi lea addresses_A_ht+0x1ba8, %rdi sub %r13, %r13 mov $11, %rcx rep movsq nop nop nop xor %r11, %r11 pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r15 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r15 push %rdi // Faulty Load lea addresses_RW+0x8ba8, %r15 nop xor $23814, %r10 vmovups (%r15), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $0, %xmm2, %r11 lea oracles, %r12 and $0xff, %r11 shlq $12, %r11 mov (%r12,%r11,1), %r11 pop %rdi pop %r15 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_RW', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_RW', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}} {'src': {'NT': True, 'same': False, 'congruent': 1, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32}} {'src': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32}} {'src': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
alloy4fun_models/trainstlt/models/2/mR6xYeXhS5regdgpe.als
Kaixi26/org.alloytools.alloy
0
2458
open main pred idmR6xYeXhS5regdgpe_prop3 { all t : Train | always t.pos in Entry or t.pos in Exit } pred __repair { idmR6xYeXhS5regdgpe_prop3 } check __repair { idmR6xYeXhS5regdgpe_prop3 <=> prop3o }
strlen_lib.asm
brunator/alix-bios
0
23846
; Calculate string length ; Compile with: nasm -f elf strlem_lib.asm ; Linked with: gcc -m32 -Wall -g0 -O0 -o strlen_lib strlen_lib.o strlen_main.o section .text global strlen_asm strlen_asm: push ebp mov esp, ebp ; ESP - old EBP ; ESP + 4 - return address ; get string pointer lea eax, [ebp+8] ; move adress of string to EBX mov edx, eax check_char: cmp byte[eax], 0 ; compare the byte(char) pointed to by ECX at ; this address against zero je check_end inc eax jmp check_char check_end: sub eax, edx ; restore ESP mov ebp, esp pop ebp ; restore old EBP ret
Engine/Sound/Smps_S1.asm
wide-dot/thomson-to8-game-engine
11
175325
* --------------------------------------------------------------------------- * SMPS 6809 - Sample Music Playback System for 6809 (LWASM) * --------------------------------------------------------------------------- * by Bentoc June 2021, based on * Sonic the Hedgehog 2 disassembled Z80 sound driver * Disassembled by Xenowhirl for AS * Additional disassembly work by RAS Oct 2008 * RAS' work merged into SVN by Flamewing * * TODO * - Test real hardware wait time and adjust the code * --------------------------------------------------------------------------- ; SMPS Header SMPS_VOICE equ 0 SMPS_NB_FM equ 2 SMPS_NB_PSG equ 3 SMPS_TEMPO equ 4 SMPS_TEMPO_DELAY equ 4 SMPS_DELAY equ 5 SMPS_TRK_HEADER equ 6 SMPS_DAC_FLAG equ 8 ; SMPS Header (each track) SMPS_TRK_DATA_PTR equ 0 SMPS_TRK_TR_VOL_PTR equ 2 SMPS_TRK_ENV_PTR equ 5 SMPS_TRK_FM_HDR_LEN equ 4 SMPS_TRK_PSG_HDR_LEN equ 6 ; SMPS SFX Header SMPS_SFX_VOICE equ 0 SMPS_SFX_TEMPO equ 2 SMPS_SFX_TEMPO_NB_CH equ 2 SMPS_SFX_NB_CH equ 3 SMPS_SFX_HDR_LEN equ 4 ; SMPS SFX Header (each track) SMPS_SFX_TRK_CH equ 0 SMPS_SFX_TRK_DATA_PTR equ 2 SMPS_SFX_TRK_TR_VOL_PTR equ 4 SMPS_SFX_TRK_HDR_LEN equ 6 ; Hardware Addresses PSG equ $E7FF YM2413_A0 equ $E7FC YM2413_D0 equ $E7FD ****************************************************************************** Track STRUCT ; "playback control"; bits ; 1 (02h) seems to be "track is at rest" ; 2 (04h) SFX is overriding this track ; 3 (08h) modulation on ; 4 (10h) do not attack next note ; 7 (80h) track is playing PlaybackControl rmb 1 ; "voice control"; bits ; 0-3 (00h-0Fh) Channel number ; 7 (80h) PSG Track ; PSG Chn |a| |00000| ; Voice1 0x80 = 100 00000 ; Voice2 0xa0 = 101 00000 ; Voice3 0xc0 = 110 00000 ; Voice4 0xe0 = 111 00000 VoiceControl rmb 1 ; "note control"; bits ; 0-3 (00h-0Fh) Current Block(0-2) and FNum(8) ; 4 (10h) Key On ; 5 (20h) Sustain On NoteControl rmb 1 TempoDivider rmb 1 ; timing divisor; 1 = Normal, 2 = Half, 3 = Third... DataPointer rmb 2 ; Track's position Transpose rmb 1 ; Transpose (from coord flag E9) Volume rmb 1 ; Attenuation - (Dependency) Should follow Transpose VoiceIndex rmb 1 ; Current voice in use OR current PSG tone VolFlutter rmb 1 ; PSG flutter (dynamically effects PSG volume for decay effects) StackPointer rmb 1 ; "Gosub" stack position offset (starts at 2Ah, i.e. end of track, and each jump decrements by 2) DurationTimeout rmb 1 ; current duration timeout; counting down to zero SavedDuration rmb 1 ; last set duration (if a note follows a note, this is reapplied to 0Bh) ; 0Dh / 0Eh change a little depending on track -- essentially they hold data relevant to the next note to play NextData rmb 2 ; DAC Next drum to play - FM/PSG frequency NoteFillTimeout rmb 1 ; Currently set note fill; counts down to zero and then cuts off note NoteFillMaster rmb 1 ; Reset value for current note fill ModulationPtr rmb 2 ; address of current modulation setting ModulationWait rmb 1 ; Wait for ww period of time before modulation starts ModulationSpeed rmb 1 ; Modulation Speed ModulationDelta rmb 1 ; Modulation change per Mod. Step ModulationSteps rmb 1 ; Number of steps in modulation (divided by 2) ModulationVal rmb 2 ; Current modulation value Detune rmb 1 ; Set by detune coord flag E1; used to add directly to FM/PSG frequency VolTLMask rmb 1 ; zVolTLMaskTbl value set during voice setting (value based on algorithm indexing zGain table) PSGNoise rmb 1 ; PSG noise setting TLPtr rmb 2 ; where TL bytes of current voice begin (set during voice setting) InstrTranspose rmb 1 ; instrument transpose ; "InstrAndVolume"; bits ; FM Instr. Attnenuation ; FM 0000 xxxx ; FM 0001 xxxx ; ... ; PSG Chn |a| |1Fh| ; VOL1 0x90 = 100 1xxxx vol 4b xxxx = attenuation value ; VOL2 0xb0 = 101 1xxxx vol 4b ; VOL3 0xd0 = 110 1xxxx vol 4b ; VOL4 0xf0 = 111 1xxxx vol 4b InstrAndVolume rmb 1 ; current instrument and volume LoopCounters rmb $A ; Loop counter index 0 ; ... open ... ; start of next track, every two bytes below this is a coord flag "gosub" (F8h) return stack ; ; The bytes between +20h and +29h are "open"; starting at +20h and going up are possible loop counters ; (for coord flag F7) while +2Ah going down (never AT 2Ah though) are stacked return addresses going ; down after calling coord flag F8h. Of course, this does mean collisions are possible with either ; or other track memory if you're not careful with these! No range checking is performed! ; ; All tracks are 2Ah bytes long ENDSTRUCT ; Track STRUCT Constants PlaybackControl equ 0 VoiceControl equ 1 NoteControl equ 2 TempoDivider equ 3 DataPointer equ 4 TranspAndVolume equ 6 Transpose equ 6 Volume equ 7 VoiceIndex equ 8 VolFlutter equ 9 StackPointer equ 10 DurationTimeout equ 11 SavedDuration equ 12 NextData equ 13 NoteFillTimeout equ 15 NoteFillMaster equ 16 ModulationPtr equ 17 ModulationWait equ 19 ModulationSpeed equ 20 ModulationDelta equ 21 ModulationSteps equ 22 ModulationVal equ 23 Detune equ 25 VolTLMask equ 26 PSGNoise equ 27 TLPtr equ 28 InstrTranspose equ 30 InstrAndVolume equ 31 LoopCounters equ 32 GoSubStack equ 42 ****************************************************************************** SmpsVar STRUCT SFXPriorityVal rmb 1 TempoTimeout rmb 1 CurrentTempo rmb 1 ; Stores current tempo value here StopMusic rmb 1 ; Set to 7Fh to pause music, set to 80h to unpause. Otherwise 00h FadeOutCounter rmb 1 FadeOutDelay rmb 1 QueueToPlay rmb 1 ; if NOT set to 80h, means new index was requested by 68K SFXToPlay rmb 2 ; When Genesis wants to play "normal" sound, it writes it here VoiceTblPtr rmb 2 ; address of the voices SFXVoiceTblPtr rmb 2 ; address of the SFX voices FadeInFlag rmb 1 FadeInDelay rmb 1 FadeInCounter rmb 1 1upPlaying rmb 1 TempoMod rmb 1 TempoTurbo rmb 1 ; Stores the tempo if speed shoes are acquired (or 7Bh is played anywho) SpeedUpFlag rmb 1 DACEnabled rmb 1 60HzData rmb 1 ; 1: play 60hz track at 50hz, 0: do not skip frames ENDSTRUCT ****************************************************************************** StructStart Smps SmpsVar tracksStart ; This is the beginning of all BGM track memory SongDACFMStart SongDAC Track SongFMStart SongFM1 Track SongFM2 Track SongFM3 Track SongFM4 Track SongFM5 Track SongFM6 Track SongFM7 Track SongFM8 Track SongFM9 Track SongFMEnd SongDACFMEnd SongPSGStart SongPSG1 Track SongPSG2 Track SongPSG3 Track ;SongPSG4 Track SongPSGEnd tracksEnd tracksSFXStart SFXFMStart SFXFM3 Track SFXFM4 Track SFXFM5 Track SFXFMEnd SFXPSGStart SFXPSG1 Track SFXPSG2 Track SFXPSG3 Track SFXPSGEnd tracksSFXEnd StructEnd ; I want struct data to be in binary please ... ; VoiceControl is hardcoded org StructStart fill 0,sizeof{SmpsVar} fdb $0006 fill 0,sizeof{Track}-2 fdb $0000 fill 0,sizeof{Track}-2 fdb $0001 fill 0,sizeof{Track}-2 fdb $0002 fill 0,sizeof{Track}-2 fdb $0003 fill 0,sizeof{Track}-2 fdb $0004 fill 0,sizeof{Track}-2 fdb $0005 fill 0,sizeof{Track}-2 fdb $0006 fill 0,sizeof{Track}-2 fdb $0007 fill 0,sizeof{Track}-2 fdb $0008 fill 0,sizeof{Track}-2 fdb $0080 fill 0,sizeof{Track}-2 fdb $00A0 fill 0,sizeof{Track}-2 fdb $00C0 fill 0,sizeof{Track}-2 fdb $00E0 fill 0,sizeof{Track}-2 fdb $0003 fill 0,sizeof{Track}-2 fdb $0004 fill 0,sizeof{Track}-2 fdb $0005 fill 0,sizeof{Track}-2 fdb $0080 fill 0,sizeof{Track}-2 fdb $00A0 fill 0,sizeof{Track}-2 ;fdb $00C0 ;fill 0,sizeof{Track}-2 ****************************************************************************** PALUpdTick fcb 0 ; this counts from 0 to 5 to periodically "double update" for PAL systems (basically every 6 frames you need to update twice to keep up) DoSFXFlag fcb 0 ; flag to indicate we're updating SFX (and thus use custom voice table); set to FFh while doing SFX, 0 when not. Paused fcb 0 ; 0 = normal, -1 = pause all sound and music SongDelay fcb 0 ; song header delay MusicPage fcb 0 ; memory page of music data SoundPage fcb 0 ; memory page of sound data MusicData fdb 0 ; address of song data SoundData fdb 0 ; address of sound data MUSIC_TRACK_COUNT = (tracksEnd-tracksStart)/sizeof{Track} MUSIC_DAC_FM_TRACK_COUNT = (SongDACFMEnd-SongDACFMStart)/sizeof{Track} MUSIC_FM_TRACK_COUNT = (SongFMEnd-SongFMStart)/sizeof{Track} MUSIC_PSG_TRACK_COUNT = (SongPSGEnd-SongPSGStart)/sizeof{Track} SFX_TRACK_COUNT = (tracksSFXEnd-tracksSFXStart)/sizeof{Track} SFXFM_TRACK_COUNT = (SFXFMEnd-SFXFMStart)/sizeof{Track} SFXPSG_TRACK_COUNT = (SFXPSGEnd-SFXPSGStart)/sizeof{Track} ****************************************************************************** * writes to YM2413 with required waits ****************************************************************************** _WriteYM MACRO sta YM2413_A0 nop nop stb YM2413_D0 ENDM _YMBusyWait5 MACRO nop brn * ENDM _YMBusyWait9 MACRO nop nop nop brn * ENDM _YMBusyWait11 MACRO nop nop nop nop brn * ENDM _YMBusyWait19 MACRO exg a,b exg a,b brn * ENDM ****************************************************************************** * Setup YM2413 for Drum Mode * destroys A, B ****************************************************************************** YM2413_DrumModeOn pshs d,x ldx #@data @a ldd ,x++ bmi @end _WriteYM _YMBusyWait5 bra @a @end lda #$05 ; saves values for FMSilenceAll routine sta SongFM7.NoteControl lda #$05 sta SongFM8.NoteControl lda #$01 sta SongFM9.NoteControl puls d,x,pc @data fdb $0E20 fdb $1620 fdb $1750 ; recommended setting is $1750 and $2705 for snare but $1700 and $2700 gives better SD sound (noise), affects HH that will sound more like a cowbell fdb $18C0 fdb $2605 ; (dependency) if modified, change hardcoded value at DrumModeOn end label fdb $2705 ; (dependency) if modified, change hardcoded value at DrumModeOn end label fdb $2801 ; (dependency) if modified, change hardcoded value at DrumModeOn end label fdb $36F0 ; drum at max vol fdb $3700 ; drum at max vol fdb $3800 ; drum at max vol fcb $FF ****************************************************************************** * InitMusicPlayback * ****************************************************************************** InitMusicPlayback jsr FMSilenceAll jsr PSGSilenceAll rts ****************************************************************************** * FMSilenceAll * destroys A, B, Y ****************************************************************************** FMSilenceAll ldd #$200E stb YM2413_A0 ldy #SongFM1.NoteControl sta YM2413_D0 ; note off for all drums _YMBusyWait5 _YMBusyWait5 @a _YMBusyWait5 ; total wait btw two notes : 20 cycles ldb ,y ; (wait of 4 cycles) sta YM2413_A0 andb #$EF ; note off for each track inca stb YM2413_D0 leay sizeof{Track},y ; (wait of 5 cycles) cmpa #$29 ; (wait of 2 cycles) bne @a ; (wait of 3 cycles) rts ****************************************************************************** * PSGSilenceAll * destroys A ****************************************************************************** PSGSilenceAll lda #$9F sta PSG lda #$BF sta PSG lda #$DF sta PSG lda #$FF sta PSG rts ****************************************************************************** * PlayMusic - Load a new music and init all tracks * * receives in X the address of the song * destroys X ****************************************************************************** PlayMusic BGMLoad pshs d,y,u _GetCartPageA sta BGMLoad_end+1 ; backup data page lda ,x ; get memory page that contains track data sta MusicPage ldx 1,x ; get ptr to track data stx MusicData _SetCartPageA jsr InitMusicPlayback ldd SMPS_VOICE,x addd MusicData std Smps.VoiceTblPtr ldd SMPS_TEMPO_DELAY,x sta SongDelay stb Smps.TempoMod stb Smps.CurrentTempo stb Smps.TempoTimeout lda #$05 sta PALUpdTick lda SMPS_NB_FM,x sta @fm+1 leau SMPS_TRK_HEADER,x ldd SMPS_DAC_FLAG,x bne @fm ; no DRUM track found (should be $0000 to be DRUM) ldy #SongDAC jsr InitTrackFM ; DRUM mode use channel 6-8 dec @fm+1 ; DAC track is part of FM nb channel count @fm lda #$00 ; (dynamic) nb of FM tracks to init ldy #SongFM1 ; Init all FM tracks @fmlp dec @fm+1 bmi @psg jsr InitTrackFM bra @fmlp @psg lda #$C0 ; set back Tone channel for PSG3 (can be switched to noise by cfSetPSGNoise) sta SongPSG3.VoiceControl lda SMPS_NB_PSG,x sta >*+4 @dyn lda #$00 ; (dynamic) nb of PSG tracks to init ldy #SongPSG1 ; Init all PSG tracks @psglp dec @dyn+1 bmi BGMLoad_end jsr InitTrackPSG bra @psglp BGMLoad_end lda #0 ; (dynamic) set back data page _SetCartPageA puls d,y,u,pc InitTrackFM lda SongDelay sta TempoDivider,y ldd #$8201 sta PlaybackControl,y stb DurationTimeout,y ldb #GoSubStack stb StackPointer,y ldd SMPS_TRK_DATA_PTR,u addd MusicData std DataPointer,y ldd SMPS_TRK_TR_VOL_PTR,u std TranspAndVolume,y leau SMPS_TRK_FM_HDR_LEN,u leay sizeof{Track},y rts InitTrackPSG lda SongDelay sta TempoDivider,y ldd #$8201 sta PlaybackControl,y stb DurationTimeout,y ldb #GoSubStack stb StackPointer,y ldd SMPS_TRK_DATA_PTR,u addd MusicData std DataPointer,y ldd SMPS_TRK_TR_VOL_PTR,u std TranspAndVolume,y lda SMPS_TRK_ENV_PTR,u sta VoiceIndex,y leau SMPS_TRK_PSG_HDR_LEN,u leay sizeof{Track},y rts ****************************************************************************** * MusicFrame - processes a music frame (VInt) * * SMPS Song Data * -------------- * value in range [$00, $7F] : Duration value * value in range [$80] : Rest (counts as a note value) * value in range [$81, $DF] : Note value * value in range [$E0, $FF] : Coordination flag * * destroys A,B,X,Y ****************************************************************************** _UpdateTrack MACRO lda \1.PlaybackControl ; Is bit 7 (80h) set on playback control byte? (means "is playing") bpl a@ ldy #\1 jsr \2 ; If so, UpdateTrack a@ equ * ENDM MusicFrame ; simple sound fx implementation with no priority ; TODO upgrade to a queue system like original code ldx Smps.SFXToPlay ; get last requested sound effect to play beq @a ; 0 means no sound effect to play jsr PlaySound ldd #0 ; reset to be able to play another effect from now std Smps.SFXToPlay @a lda MusicPage ; page switch to the music lbeq UpdateSound ; no music to play _SetCartPageA clr DoSFXFlag UpdateEverything lda Smps.60HzData ; TODO use SMPS relocate to convert timings beq @a ; to play 60hz songs at 50hz at normal speed dec PALUpdTick ; this will allow to throw away this code bne @a lda #5 sta PALUpdTick jsr UpdateMusic ; play 2 frames in one to keep original speed @a jsr UpdateMusic ; play 2 frames in one to keep original speed bra UpdateSound UpdateMusic * jsr TempoWait ; optim : do not call TempoWait, instead skip update lda Smps.CurrentTempo ; tempo value adda Smps.TempoTimeout ; Adds previous value to sta Smps.TempoTimeout ; Store this as new bcc @rts ; skip update if tempo need more waits _UpdateTrack SongDAC,DACUpdateTrack _UpdateTrack SongFM1,FMUpdateTrack _UpdateTrack SongFM2,FMUpdateTrack _UpdateTrack SongFM3,FMUpdateTrack _UpdateTrack SongFM4,FMUpdateTrack _UpdateTrack SongFM5,FMUpdateTrack ;_UpdateTrack SongFM6,FMUpdateTrack ; uncomment to use this channel ;_UpdateTrack SongFM7,FMUpdateTrack ; uncomment to use tone channel instead of drum kit ;_UpdateTrack SongFM8,FMUpdateTrack ; uncomment to use tone channel instead of drum kit ;_UpdateTrack SongFM9,FMUpdateTrack ; uncomment to use tone channel instead of drum kit ;_UpdateTrack SongPSG4,PSGUpdateTrack ; uncomment to use noise channel as an independent channel from tone 3 _UpdateTrack SongPSG1,PSGUpdateTrack _UpdateTrack SongPSG2,PSGUpdateTrack _UpdateTrack SongPSG3,PSGUpdateTrack @rts rts UpdateSound lda SoundPage ; page switch to the sound bne @a rts @a _SetCartPageA lda #$80 sta DoSFXFlag ; Set zDoSFXFlag = 80h (updating sound effects) _UpdateTrack SFXFM3,FMUpdateTrack _UpdateTrack SFXFM4,FMUpdateTrack _UpdateTrack SFXFM5,FMUpdateTrack _UpdateTrack SFXPSG1,PSGUpdateTrack _UpdateTrack SFXPSG2,PSGUpdateTrack _UpdateTrack SFXPSG3,PSGUpdateTrack @rts rts * * ************************************************************************************ * * * TempoWait * ; Tempo works as divisions of the 60Hz clock (there is a fix supplied for * ; PAL that "kind of" keeps it on track.) Every time the internal music clock * ; overflows, it will update. So a tempo of 80h will update every other * ; frame, or 30 times a second. * lda Smps.CurrentTempo ; tempo value * adda Smps.TempoTimeout ; Adds previous value to * sta Smps.TempoTimeout ; Store this as new * bcc @a * rts ; If addition overflowed (answer greater than FFh), return * @a * ; So if adding tempo value did NOT overflow, then we add 1 to all durations * inc SongDAC.DurationTimeout * inc SongFM1.DurationTimeout * inc SongFM2.DurationTimeout * inc SongFM3.DurationTimeout * inc SongFM4.DurationTimeout * inc SongFM5.DurationTimeout * ;inc SongFM6.DurationTimeout * ;inc SongFM7.DurationTimeout * ;inc SongFM8.DurationTimeout * ;inc SongFM9.DurationTimeout * ;inc SongPSG4.DurationTimeout * inc SongPSG1.DurationTimeout * inc SongPSG2.DurationTimeout * inc SongPSG3.DurationTimeout * rts ****************************************************************************** * DACUpdateTrack * input Y (ptr to SONGDAC, is used by CoordFlag) * destroys A,B,X ****************************************************************************** DACUpdateTrack dec SongDAC.DurationTimeout beq @a rts @a ldd #$0E20 ; note has ended, so note off sta <YM2413_A0 ldx SongDAC.DataPointer stb <YM2413_D0 @b ldb ,x+ ; read DAC song data cmpb #$E0 blo @a ; test for >= E0h, which is a coordination flag jsr CoordFlag bra @b ; read all consecutive coordination flags @a bpl SetDuration ; test for 80h not set, which is a note duration stb SongDAC.NextData ; This is a note; store it here ldb ,x bpl SetDurationAndForward ; test for 80h not set, which is a note duration ldb SongDAC.SavedDuration bra DACAfterDur SetDurationAndForward leax 1,x SetDuration lda SongDAC.TempoDivider mul stb SongDAC.SavedDuration DACAfterDur stb SongDAC.DurationTimeout stx SongDAC.DataPointer ldb SongDAC.NextData cmpb #$80 bne @a rts ; if a rest, quit @a ldx #@data subb #$81 ; transform note into an index... lda #$0E sta <YM2413_A0 ldb b,x stb <YM2413_D0 rts @data fcb $30 ; $81 - Kick (BD+TOM) 34 fcb $28 ; $82 - Snare (SNARE noise+TOM) 2C fcb $21 ; $83 - Clap 21 fcb $22 ; $84 - Scratch 22 fcb $24 ; $85 - Timpani 22 fcb $24 ; $86 - Hi Tom fcb $24 ; $87 - Bongo fcb $24 ; $88 - Hi Timpani fcb $30 ; $89 - Mid Timpani fcb $30 ; $8A - Mid Low Timpani fcb $34 ; $8B - Low Timpani fcb $28 ; $8C - Mid Tom fcb $30 ; $8D - Low Tom fcb $34 ; $8E - Floor Tom fcb $24 ; $8F - Hi Bongo fcb $28 ; $90 - Mid Bongo fcb $30 ; $91 - Low Bongo ****************************************************************************** * FM Track Update ****************************************************************************** _FMNoteOff MACRO ; (dependency) should be preceded by A loaded with PlaybackControl,y and B with VoiceControl,y bita #$04 ; Is SFX overriding set? bne @skip ; if true skip note off, sfx is playing addb #$20 ; set Sus/Key/Block/FNum(MSB) Command stb <YM2413_A0 ldb NoteControl,y ; load current value (do not erase FNum MSB) andb #$EF ; clear bit 4 (10h) Key Off stb <YM2413_D0 ; send to YM stb NoteControl,y @skip equ * ENDM FMUpdateTrack dec DurationTimeout,y ; Decrement duration bne NoteFillUpdate ; If not time-out yet, go do updates only lda PlaybackControl,y anda #$EF sta PlaybackControl,y ; When duration over, clear "do not attack" bit 4 (0x10) of track's play control FMDoNext ldx DataPointer,y lda PlaybackControl,y ; Clear bit 1 (02h) "track is rest" from track anda #$FD sta PlaybackControl,y FMReadCoordFlag ldb ,x+ ; Read song data stb NoteDyn+1 cmpb #$E0 blo FMNoteOff ; Test for >= E0h, which is a coordination flag jsr CoordFlag bra FMReadCoordFlag ; Read all consecutive coordination flags FMNoteOff lda PlaybackControl,y anda #$14 ; Are bits 4 (no attack) or 2 (SFX overriding) set? bne NoteDyn ; If they are, skip ldb VoiceControl,y ; Otherwise, send a Key Off _FMNoteOff ; (dependency) should be preceded by A loaded with PlaybackControl,y and B with VoiceControl,y NoteDyn ldb #0 ; (dynamic) retore note value bpl FMSetDuration ; Test for 80h not set, which is a note duration FMSetFreq subb #$80 ; Test for a rest bne @a lda PlaybackControl,y ; Set bit 1 (track is at rest) ora #$02 sta PlaybackControl,y bra @b @a addb #$0B ; Add FMFrequencies offet for C0 Note, access lower notes with transpose addb Transpose,y ; Add current channel transpose (coord flag E9) addb InstrTranspose,y ; Add Instrument (Voice) offset (coord flag EF) cmpb #95 ; array bound check blo @c ldb #94 @c aslb ; Transform note into an index... ldu #FMFrequencies lda #0 ldd d,u std NextData,y ; Store Frequency @b ldb ,x ; Get next byte bpl FMSetDurationAndForward ; Test for 80h not set, which is a note duration ldb SavedDuration,y bra FinishTrackUpdate NoteFillUpdate lda NoteFillTimeout,y ; Get current note fill value lbeq DoModulation ; If zero, return! dec NoteFillTimeout,y ; Decrement note fill bne DoModulation ; If not zero, return lda PlaybackControl,y ora #$02 ; Set bit 1 (track is at rest) sta PlaybackControl,y ldb VoiceControl,y _FMNoteOff ; (dependency) should be preceded by A loaded with PlaybackControl,y and B with VoiceControl,y rts FMSetDurationAndForward leax 1,x FMSetDuration lda TempoDivider,y mul stb SavedDuration,y FinishTrackUpdate stb DurationTimeout,y ; Last set duration ... put into ticker stx DataPointer,y ; Stores to the track pointer memory lda PlaybackControl,y bita #$10 ; Is bit 4 (10h) "do not attack next note" set on playback? beq @a bra FMPrepareNote ; If so, quit @a ldb NoteFillMaster,y stb NoteFillTimeout,y ; Reset 0Fh "note fill" value to master bita #$08 ; Is bit 3 (08h) modulation turned on? bne @b bra FMPrepareNote ; if not, quit @b ldx ModulationPtr,y jsr SetModulation ; reload modulation settings for the new note FMPrepareNote lda PlaybackControl,y bita #$04 ; Is bit 2 (04h) Is SFX overriding this track? bne DoModulation ; If so skip freq update bita #$02 ; Is bit 1 (02h) "track is at rest" set on playback? beq FMUpdateFreqAndNoteOn rts ; If so, quit FMUpdateFreqAndNoteOn ldb Detune,y sex addd NextData,y ; Apply detune but don't update stored frequency sta @dyn+1 lda #$10 ; set LSB Frequency Command adda VoiceControl,y sta <YM2413_A0 adda #$10 ; set Sus/Key/Block/FNum(MSB) Command stb <YM2413_D0 _YMBusyWait9 ldb NoteControl,y ; load current value (do not erase FNum MSB) (and used as 5 cycles tempo) orb #$10 ; Set bit 4 (10h) Key On andb #$F0 ; Clear FNum MSB (and used as 2 cycles tempo) @dyn addb #0 ; (dynamic) Set Fnum MSB (and used as 2 cycles tempo) sta <YM2413_A0 stb NoteControl,y stb <YM2413_D0 DoModulation lda PlaybackControl,y bita #$02 ; Is bit 1 (02h) "track is at rest" set on playback? beq @a rts ; If so, quit @a bita #$08 ; Is bit 3 (08h) "modulation on" set on playback? bne @b rts ; If not, quit @b lda ModulationWait,y ; 'ww' period of time before modulation starts beq @c ; if zero, go to it! dec ModulationWait,y ; Otherwise, decrement timer rts ; return if decremented @c dec ModulationSpeed,y ; Decrement modulation speed counter beq @d rts ; Return if not yet zero @d ldx ModulationPtr,y lda 1,x sta ModulationSpeed,y lda ModulationSteps,y bne @e lda 3,x sta ModulationSteps,y neg ModulationDelta,y rts @e dec ModulationSteps,y ldb ModulationDelta,y sex addd ModulationVal,y std ModulationVal,y FMUpdateFreq lda PlaybackControl,y bita #$04 ; Is bit 2 (04h) Is SFX overriding this track? bne @rts ldb Detune,y sex std @dyna+1 ldd ModulationVal,y ; get modulation effect bmi @a _asrd ; modulation is divided by four _asrd ; used for better precision of delta bra @b @a _asrd ; modulation is divided by four _asrd ; used for better precision of delta addd #1 ; negative value need +1 when div @b addd NextData,y ; apply detune but don't update stored frequency @dyna addd #0 ; (dynamic) apply detune sta @dynb+1 lda #$10 ; set LSB Frequency Command adda VoiceControl,y ; get channel number sta <YM2413_A0 ; send Fnum update Command adda #$10 ; set Sus/Key/Block/FNum(MSB) Command stb <YM2413_D0 ; send FNum (b0-b7) _YMBusyWait11 ; total wait 20 cycles ldb NoteControl,y ; load current value (do not erase FNum MSB) (and used as 5 cycles tempo) andb #$F0 ; clear FNum MSB (and used as 2 cycles tempo) @dynb addb #0 ; (dynamic) Set Fnum MSB (and used as 2 cycles tempo) sta <YM2413_A0 ; send command stb NoteControl,y stb <YM2413_D0 ; send FNum (b8) and Block (b0-b2) @rts rts ; 95 notes (Note value $81=C0 $DF=A#7) with direct access ; Other notes can be accessed by transpose FMFrequencies fdb $0056,$005B,$0061,$0067,$006D,$0073,$007A,$0081,$0089,$0091,$009A,$00A2 ; C-1 - B-1 fdb $00AD,$00B7,$00C2,$00CD,$00DA,$00E6,$00F4,$0102,$0112,$0122,$0133,$0146 ; C0 - B0 fdb $0159,$016D,$0183,$019A,$01B3,$01CC,$01E8,$0302,$0312,$0322,$0333,$0346 ; C1 - B1 fdb $0359,$036D,$0383,$039A,$03B3,$03CC,$03E8,$0502,$0512,$0522,$0533,$0546 ; C2 - B2 fdb $0559,$056D,$0583,$059A,$05B3,$05CC,$05E8,$0702,$0712,$0722,$0733,$0746 ; C3 - B3 fdb $0759,$076D,$0783,$079A,$07B3,$07CC,$07E8,$0902,$0912,$0922,$0933,$0946 ; C4 - B4 fdb $0959,$096D,$0983,$099A,$09B3,$09CC,$09E8,$0B02,$0B12,$0B22,$0B33,$0B46 ; C5 - B5 fdb $0B59,$0B6D,$0B83,$0B9A,$0BB3,$0BCC,$0BE8,$0D02,$0D12,$0D22,$0D33,$0D46 ; C6 - B6 fdb $0D59,$0D6D,$0D83,$0D9A,$0DB3,$0DCC,$0DE8,$0F02,$0F12,$0F22,$0F33,$0F46 ; C7 - B7 fdb $0F59,$0F6D,$0F83,$0F9A,$0FB3,$0FCC,$0FE8,$0FE8,$0FE8,$0FE8,$0FE8,$0FE8 ; C8 - F#8 fdb $0FE8,$0FE8,$0FE8,$0FE8,$0FE8,$0FE8,$0FE8,$0FE8 ; F#8 ****************************************************************************** * PSG Update Track ****************************************************************************** _PSGNoteOff MACRO ; (dependency) should be preceded by A loaded with PlaybackControl,y and B with VoiceControl,y bita #$04 ; Is SFX overriding set? bne @skip ; if true skip note off, sfx is playing orb #$1F ; Volume Off stb <PSG @skip equ * ENDM PSGNoteFillUpdate lda NoteFillTimeout,y ; Get current note fill value lbeq PSGUpdateVolFX ; If zero, return! dec NoteFillTimeout,y ; Decrement note fill lbne PSGUpdateVolFX ; If not zero, return lda PlaybackControl,y ora #$02 ; Set bit 1 (track is at rest) sta PlaybackControl,y ldb VoiceControl,y ; Get "voice control" byte (loads upper bits which specify attenuation setting) _PSGNoteOff ; (dependency) should be preceded by A loaded with PlaybackControl,y and B with VoiceControl,y rts PSGUpdateTrack dec DurationTimeout,y ; Decrement duration bne PSGNoteFillUpdate ; If not time-out yet, go do updates only lda PlaybackControl,y anda #$EF sta PlaybackControl,y ; When duration over, clear "do not attack" bit 4 (0x10) of track's play control PSGDoNext ldx DataPointer,y lda PlaybackControl,y ; Clear bit 1 (02h) "track is rest" from track anda #$FD sta PlaybackControl,y PSGReadCoordFlag ldb ,x+ ; Read song data cmpb #$E0 blo @a ; Test for >= E0h, which is a coordination flag jsr CoordFlag bra PSGReadCoordFlag ; Read all consecutive coordination flags @a bpl PSGSetDuration ; Test for 80h not set, which is a note duration PSGSetFreq subb #$81 ; Test for a rest bcc @a ; If a note branch lda PlaybackControl,y ; If carry (only time that happens if 80h because of earlier logic) this is a rest! ora #$02 sta PlaybackControl,y ; Set bit 1 (track is at rest) ldb VoiceControl,y ; Get "voice control" byte (loads upper bits which specify attenuation setting) _PSGNoteOff ; (dependency) should be preceded by A loaded with PlaybackControl,y and B with VoiceControl,y bra @b @a addb #$03 ; Add Frequencies offet for C0 Note, access lower notes with transpose addb Transpose,y ; Add current channel transpose (coord flag E9) cmpb #70 ; array bound check blo @c ldb #69 @c aslb ; Transform note into an index... ldu #PSGFrequencies lda #0 ldd d,u std NextData,y ; Store Frequency @b ldb ,x ; Get next byte bpl PSGSetDurationAndForward ; Test for 80h not set, which is a note duration ldb SavedDuration,y bra PSGFinishTrackUpdate PSGSetDurationAndForward leax 1,x PSGSetDuration lda TempoDivider,y mul stb SavedDuration,y PSGFinishTrackUpdate stb DurationTimeout,y ; Last set duration ... put into ticker stx DataPointer,y ; Stores to the track pointer memory lda PlaybackControl,y bita #$10 ; Is bit 4 (10h) "do not attack next note" set on playback? beq @a bra PSGDoNoteOn ; If so, quit @a ldb NoteFillMaster,y stb NoteFillTimeout,y ; Reset 0Fh "note fill" value to master clr VolFlutter,y ; Reset PSG flutter byte bita #$08 ; Is bit 3 (08h) modulation turned on? bne @b bra PSGDoNoteOn ; if not, quit @b ldx ModulationPtr,y jsr SetModulation ; reload modulation settings for the new note PSGDoNoteOn lda PlaybackControl,y bita #$02 ; Is bit 1 (02h) "track is at rest" set on playback? beq PSGUpdateFreq rts ; If so, quit PSGUpdateFreq ldb Detune,y sex addd NextData,y ; Apply detune but don't update stored frequency std @dyn+1 andb #$0F ; Keep only lower four bits (first PSG reg write only applies d0-d3 of freq) lda VoiceControl,y cmpa #$E0 bne @a addb #$C0 bra @b @a addb VoiceControl,y ; Get "voice control" byte... @b stb <PSG @dyn ldd #0 _lsrd _lsrd _lsrd _lsrd stb <PSG bra PSGDoVolFX PSGUpdateVolFX lda VoiceIndex,y beq PSGDoModulation ldb Volume,y stb DynVol+1 bra PSGFlutter VolEnvHold lda VolFlutter,y ; This just decrements the flutter to keep it in place; no more volume changes in this list suba #2 ; Put index back (before final volume value) sta VolFlutter,y ; Loop back and update volume PSGDoVolFX ldb Volume,y stb DynVol+1 lda VoiceIndex,y beq PSGUpdateVol ; If tone is zero, jump to PSGUpdateVol PSGFlutter asla ldx #PSG_FlutterTbl ldx a,x lda VolFlutter,y inc VolFlutter,y lda a,x bpl @a cmpa #$80 beq VolEnvHold @a sta >*+4 addb #0 stb DynVol+1 PSGUpdateVol lda PlaybackControl,y bita #$02 ; Is bit 1 (02h) "track is at rest" set on playback? bne PSGDoModulation ; If so, branch bita #$10 ; Is bit 4 (10h) "do not attack next note" set on playback? bne @b ; If so, branch DynVol ldb #0 ; (dynamic) volume cmpb #$10 blo @a ldb #$0F @a addb VoiceControl,y orb #$10 stb <PSG bra PSGDoModulation @b lda NoteFillMaster,y ; If you get here, then "do not attack next note" was set... beq DynVol ; If it's zero, then just process normally lda NoteFillTimeout,y bne DynVol ; If it's not zero, then just process normally PSGDoModulation lda PlaybackControl,y bita #$02 ; Is bit 1 (02h) "track is at rest" set on playback? beq @a rts ; If so, quit @a bita #$08 ; Is bit 3 (08h) "modulation on" set on playback? bne @b rts ; If not, quit @b lda ModulationWait,y ; 'ww' period of time before modulation starts beq @c ; if zero, go to it! dec ModulationWait,y ; Otherwise, decrement timer rts ; return if decremented @c dec ModulationSpeed,y ; Decrement modulation speed counter beq @d rts ; Return if not yet zero @d ldx ModulationPtr,y lda 1,x sta ModulationSpeed,y lda ModulationSteps,y bne @e lda 3,x sta ModulationSteps,y neg ModulationDelta,y rts @e dec ModulationSteps,y ldb ModulationDelta,y sex addd ModulationVal,y std ModulationVal,y PSGUpdateFreq2 ldb Detune,y sex addd NextData,y ; apply detune but don't update stored frequency addd ModulationVal,y ; add modulation effect std @dyn+1 andb #$0F ; Keep only lower four bits (first PSG reg write only applies d0-d3 of freq) lda VoiceControl,y cmpa #$E0 bne @a addb #$C0 bra @b @a addb VoiceControl,y ; Get "voice control" byte... @b stb <PSG @dyn ldd #0 _lsrd _lsrd _lsrd _lsrd stb <PSG rts ; 70 notes (Note value $81=C3 $C7=G#8) with direct access ; (Note value $C8 is reserved for PSG3 to drive noise PSG4) ; Other notes can be accessed by transpose PSGFrequencies fdb $03F8,$03C0,$0388 fdb $356,$326,$2F9,$2CE,$2A5,$280,$25C,$23A fdb $21A,$1FB,$1DF,$1C4,$1AB,$193,$17D,$167 fdb $153,$140,$12E,$11D,$10D,$FE,$EF,$E2 fdb $D6,$C9,$BE,$B4,$A9,$A0,$97,$8F fdb $87,$7F,$78,$71,$6B,$65,$5F,$5A fdb $55,$50,$4B,$47,$43,$40,$3C,$39 fdb $36,$33,$30,$2D,$2B,$28,$26,$24 fdb $22,$20,$1F,$1D,$1B,$1A,$18,$17 fdb $16,$15,$13,$12,$11,1 ; (Last 3 values are also used for channel 3 when driving noise channel. $0000 doesn't work for real SN76489 chip, so was replaced by $0001 value) PSG_FlutterTbl ; Basically, for any tone 0-11, dynamic volume adjustments are applied to produce a pseudo-decay, ; or sometimes a ramp up for "soft" sounds, or really any other volume effect you might want! ; Remember on PSG that the higher the value, the quieter it gets (it's attenuation, not volume); ; 0 is thus loudest, and increasing values decay, until level $F (silent) fdb 0 ; saves a dec instruction in table lookup fdb Flutter1,Flutter2,Flutter3,Flutter4 fdb Flutter5,Flutter6,Flutter7,Flutter8 fdb Flutter9,Flutter10,Flutter11,Flutter12 fdb Flutter13 Flutter1 fcb 0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5 fcb 5,5,6,6,6,7,$80 Flutter2 fcb 0,2,4,6,8,$10,$80 Flutter3 fcb 0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,$80 Flutter4 fcb 0,0,2,3,4,4,5,5,5,6,$80 Flutter5 fcb 3,3,3,2,2,2,2,1,1,1,0,0,0,0,$80 Flutter6 fcb 0,0,0,0,0,0,0,0,0,0,1,1 fcb 1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2 fcb 2,2,2,2,3,3,3,3,3,3,3,3,4,$80 Flutter7 fcb 0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2 fcb 3,3,3,4,4,4,5,5,5,6,7,$80 Flutter8 fcb 0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,2 fcb 3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6 fcb 6,6,6,6,7,7,7,$80 Flutter9 fcb 0,1,2,3,4,5,6,7,8,9,$0A,$0B,$0C,$0D,$0E,$0F,$80 Flutter10 fcb 0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1 fcb 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 fcb 1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2 fcb 2,2,3,3,3,3,3,3,3,3,3,3,4,$80 Flutter11 fcb 4,4,4,3,3,3,2,2,2,1,1,1,1,1,1,1 fcb 2,2,2,2,2,3,3,3,3,3,4,$80 Flutter12 fcb 4,4,3,3,2,2,1,1,1,1,1,1,1,1,1,1 fcb 1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2 fcb 2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3 fcb 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 fcb 3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4 fcb 4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5 fcb 5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6 fcb 6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,$80 Flutter13 fcb $0E,$0D,$0C,$0B,$0A,9,8,7,6,5,4,3,2,1,0,$80 ; END of PSG_FlutterTbl --------------------------- ****************************************************************************** * PlaySound - Load and play a new sound effect * * receives in X the address of the sound * destroys X ****************************************************************************** SFXTrackOffs fdb SFXFM3 ; identified by Track id 8002 in smps sfx file (for Sonic 2 compatibility) fdb SFXFM3 ; identified by Track id 8003 in smps sfx file fdb SFXFM4 ; identified by Track id 8004 in smps sfx file fdb SFXFM5 ; identified by Track id 8005 in smps sfx file fdb SFXPSG1 ; identified by Track id 8080 in smps sfx file fdb SFXPSG2 ; identified by Track id 80A0 in smps sfx file fdb SFXPSG3 ; identified by Track id 80C0 in smps sfx file fdb SFXPSG3 ; identified by Track id 80E0 in smps sfx file MusicTrackOffs fdb SongFM3 fdb SongFM3 fdb SongFM4 fdb SongFM5 fdb SongPSG1 fdb SongPSG2 fdb SongPSG3 fdb SongPSG3 PlaySound pshs d,y,u _GetCartPageA sta PlaySound_end+1 ; backup data page lda ,x ; get memory page that contains track data sta SoundPage ldx 1,x ; get ptr to track data stx SoundData _SetCartPageA ldd SMPS_SFX_VOICE,x addd SoundData std Smps.SFXVoiceTblPtr ldd SMPS_SFX_TEMPO_NB_CH,x ; init process for each track sta @dyna+2 stb PS_cnt leax SMPS_SFX_HDR_LEN,x @a ldu #MusicTrackOffs ldd SMPS_SFX_TRK_CH,x ; read playbackcontrol and voice id std @dynb+1 tstb bmi @psg subb #2 ; this is an fm track aslb ; transform track ref to an index: $02,$04,$05 => 0,4,6 ldy b,u bra @c @psg cmpb #$C0 bne @b lda #$DF ; set silence on PSG3 sta <PSG lda #$FF sta <PSG @b lsrb ; this is a psg track lsrb lsrb lsrb ; transform track ref to an index: $80,$A0,$C0,$E0 => 8,10,12,14 ldy b,u @c lda PlaybackControl,y ; y (hl) ptr to Music Track ora #$04 ; Set "SFX is overriding this track!" bit sta PlaybackControl,y ldu #SFXTrackOffs ldu b,u ; u (ix) ptr to SFX Track ldd #0 ; clear SFX Track std ,u std 2,u std 4,u std 6,u std 8,u std 10,u std 12,u std 14,u std 16,u std 18,u std 20,u std 22,u std 24,u std 26,u std 28,u std 30,u std 32,u std 34,u std 36,u std 38,u std 40,u @dyna ldd #$0100 ; (dynamic) TempoDivider sta DurationTimeout,u ; current duration timeout to 1 (will expire immediately and thus update) stb TempoDivider,u @dynb ldd #0 ; (dynamic) sta PlaybackControl,u stb VoiceControl,u ldb #GoSubStack stb StackPointer,u ; Reset track "gosub" stack ldd SMPS_SFX_TRK_DATA_PTR,x addd SoundData std DataPointer,u ldd SMPS_SFX_TRK_TR_VOL_PTR,x std TranspAndVolume,u leax SMPS_SFX_TRK_HDR_LEN,x dec PS_cnt lbne @a PlaySound_end lda #0 _SetCartPageA puls d,y,u,pc PS_cnt fcb 0 ****************************************************************************** * CoordFlag ****************************************************************************** CoordFlag subb #$E0 aslb ldu #CoordFlagLookup jmp [b,u] CoordFlagLookup fdb cfSkip1 ; E0 -- unsupported (panning) fdb cfDetune ; E1 -- done fdb cfSkip1 ; E2 -- unsupported fdb cfJumpReturn ; E3 -- done fdb cfFadeInToPrevious ; E4 --todo fdb cfSetTempoDivider ; E5 -- done fdb cfChangeFMVolume ; E6 -- done fdb cfPreventAttack ; E7 -- done fdb cfNoteFill ; E8 -- done fdb cfChangeTransposition ; E9 -- done fdb cfSetTempo ; EA -- done fdb cfSetTempoMod ; EB -- done fdb cfChangePSGVolume ; EC -- done fdb cfNop ; ED -- unsupported fdb cfNop ; EE -- unsupported fdb cfSetVoice ; EF -- done fdb cfModulation ; F0 -- done fdb cfEnableModulation ; F1 -- done fdb cfStopTrack ; F2 -- done fdb cfSetPSGNoise ; F3 -- done fdb cfDisableModulation ; F4 -- done fdb cfSetPSGTone ; F5 -- done fdb cfJumpTo ; F6 -- done fdb cfRepeatAtPos ; F7 -- done fdb cfJumpToGosub ; F8 -- done fdb cfNop ; F9 -- unsupported fdb cfNop ; FA -- free fdb cfNop ; FB -- free fdb cfNop ; FC -- free fdb cfNop ; FD -- free fdb cfNop ; FE -- free fdb cfNop ; FF -- free ; (via Saxman's doc): Alter note values by xx ; More or less a pitch bend; this is applied to the frequency as a signed value ; cfDetune lda ,x+ ; this should be replaced by a conversion of the smps music file ; here to play sonic2 files only ldb VoiceControl,y ; read channel nb bmi @a ; Is voice control bit 7 (80h) a PSG track set? asra ; ratio freq btw YM2612 and YM2413 is 3.73, so tame a bit (/3) sta @dyna+1 asra sta @dynb+1 @dyna lda #0 @dynb suba #0 ; end of tmp code @a sta Detune,y rts ; Return (Sonic 1 & 2) ; cfJumpReturn lda StackPointer,y ; retrieve stack ptr ldx a,y ; load return address adda #2 sta StackPointer,y ; free stack position rts cfFadeInToPrevious rts ; Change tempo divider to xx ; cfSetTempoDivider lda ,x+ sta TempoDivider,y rts ; (via Saxman's doc): Change channel volume BY xx; xx is signed ; cfChangeFMVolume lda Volume,y ; apply volume attenuation change adda ,x+ sta Volume,y ldb PlaybackControl,y bitb #$04 ; Is bit 2 (04h) Is SFX overriding this track? bne @rts lsra ; volume attenuation is unsigned lsra lsra sta @dyn1+1 lda #$30 adda VoiceControl,y sta <YM2413_A0 ldb InstrAndVolume,y tfr b,a ora #$0F ; set maximum attenuation for compare sta @dyn2+1 @dyn1 addb #0 ; (dynamic) add global volume attenuation to actual voice @dyn2 cmpb #0 ; (dynamic) test if overflow of attenuation value blo @write ; attenuation < F and no overflow tfr a,b ; set maximum attenuation (F) @write stb <YM2413_D0 @rts rts cfPreventAttack lda PlaybackControl,y ora #$10 sta PlaybackControl,y ; Set bit 4 (10h) on playback control; do not attack next note rts ; (via Saxman's doc): set note fill amount to xx ; cfNoteFill lda ,x+ sta NoteFillTimeout,y sta NoteFillMaster,y rts ; (via Saxman's doc): add xx to channel key ; cfChangeTransposition lda Transpose,y adda ,x+ sta Transpose,y rts ; (via Saxman's doc): set music tempo to xx ; cfSetTempo lda ,x+ sta Smps.CurrentTempo rts ; (via Saxman's doc): Change Tempo Modifier to xx for ALL channels ; cfSetTempoMod lda ,x+ sta SongDAC.TempoDivider sta SongFM1.TempoDivider sta SongFM2.TempoDivider sta SongFM3.TempoDivider sta SongFM4.TempoDivider sta SongFM5.TempoDivider ;sta SongFM6.TempoDivider ;sta SongFM7.TempoDivider ;sta SongFM8.TempoDivider ;sta SongFM9.TempoDivider sta SongPSG1.TempoDivider sta SongPSG2.TempoDivider sta SongPSG3.TempoDivider ;sta SongPSG4.TempoDivider rts cfChangePSGVolume lda Volume,y adda ,x+ sta Volume,y rts ; (via Saxman's doc): set voice selection to xx ; cfSetVoice ldb ,x+ stb VoiceIndex,y ; save voice index to restore voice after sfx lda PlaybackControl,y bita #$04 ; Is bit 2 (04h) Is SFX overriding this track? bne @rts ; yes skip YM command lda DoSFXFlag bmi @a ldu Smps.VoiceTblPtr bra @b @a ldu Smps.SFXVoiceTblPtr @b lda VoiceControl,y ; read channel nb adda #$30 sta <YM2413_A0 aslb ldd b,u sta InstrAndVolume,y stb InstrTranspose,y ldb Volume,y ; apply current track attenuation to voice lsrb ; volume attenuation is unsigned lsrb lsrb stb @dyn1+1 ldb #$30 addb VoiceControl,y stb <YM2413_A0 tfr a,b orb #$0F ; set maximum attenuation for compare stb @dyn2+1 @dyn1 adda #0 ; (dynamic) add global volume attenuation @dyn2 cmpa #0 ; (dynamic) test if overflow of attenuation value blo @write ; attenuation < F and no overflow tfr b,a ; set maximum attenuation (F) @write sta <YM2413_D0 @rts rts ; (via Saxman's doc): F0wwxxyyzz - modulation ; o ww - Wait for ww period of time before modulation starts ; o xx - Modulation Speed ; o yy - Modulation change per Mod. Step ; o zz - Number of steps in modulation ; cfModulation lda PlaybackControl,y ora #$08 sta PlaybackControl,y ; Set bit 3 (08h) of "playback control" byte (modulation on) stx ModulationPtr,y ; Back up modulation setting address SetModulation ldd ,x++ ; also read ModulationSpeed std ModulationWait,y ; also write ModulationSpeed ldd ,x++ ; also read ModulationSteps sta ModulationDelta,y lsrb ; divide number of steps by 2 stb ModulationSteps,y lda PlaybackControl,y bita #$10 ; Is bit 4 "do not attack next note" (10h) set? bne @a ; If so, quit! ldd #0 std ModulationVal,y ; Clear modulation value @a rts ; (via Saxman's doc): Turn on modulation ; cfEnableModulation lda PlaybackControl,y ora #$08 sta PlaybackControl,y ; Set bit 3 (08h) of "playback control" byte (modulation on) rts ; (via Saxman's doc): stop the track ; cfStopTrack lda PlaybackControl,y anda #$6F ; clear playback byte bit 7 (80h) -- currently playing (not anymore) sta PlaybackControl,y ; clear playback byte bit 4 (10h) -- do not attack ldb VoiceControl,y ; read channel nb bmi @a ; Is voice control bit 7 (80h) a PSG track set? _FMNoteOff ; (dependency) should be preceded by A loaded with PlaybackControl,y and B with VoiceControl,y bra @b @a _PSGNoteOff ; (dependency) should be preceded by A loaded with PlaybackControl,y and B with VoiceControl,y @b lda DoSFXFlag bmi @d @rts puls u ; removing return address from stack; will not return to coord flag loop rts @d lda VoiceControl,y ; this is SFX Track lbmi @psgsfx ldu #MusicTrackOffs ; get back the overriden music track suba #2 asla ; transform track ref to an index: $02,$04,$05 => 0,4,6 ldu a,u ; U ptr to same FM track ID than SFX but for Music, Y still for FM SFX Track lda PlaybackControl,u bita #$04 ; Is bit 2 (04h) Is SFX overriding this track? beq @rts ; if not skip this part (i.e. if SFX was not overriding this track, then nothing to restore) anda #$FB ; Clear SFX is overriding this track from playback control ora #$02 ; Set bit 1 (track is at rest) sta PlaybackControl,u lda MusicPage _SetCartPageA ldx Smps.VoiceTblPtr ; Restore Voice to music channel (x can be erased because we are stopping track read) ldb VoiceIndex,u lda VoiceControl,u ; read channel nb adda #$30 sta <YM2413_A0 aslb ldd b,x sta InstrAndVolume,u stb InstrTranspose,u ldb Volume,u ; apply current track attenuation to voice lsrb ; volume attenuation is unsigned lsrb lsrb stb @dyn1+1 tfr a,b orb #$0F ; set maximum attenuation for compare stb @dyn2+1 @dyn1 adda #0 ; (dynamic) add global volume attenuation @dyn2 cmpa #0 ; (dynamic) test if overflow of attenuation value blo @write ; attenuation < F and no overflow tfr b,a ; set maximum attenuation (F) @write sta <YM2413_D0 lda SoundPage _SetCartPageA puls u ; removing return address from stack; will not return to coord flag loop rts @psgsfx ldu #MusicTrackOffs lsra ; this is a psg fx track lsra lsra lsra ; transform track ref to an index: $80,$A0,$C0,$E0 => 8,10,12,14 ldu a,u ; U ptr to same FM track ID than SFX but for Music, Y still for FM SFX Track lda PlaybackControl,u anda #$FB ; Clear SFX is overriding this track from playback control ora #$02 ; Set bit 1 (track is at rest) sta PlaybackControl,u lda VoiceControl,u ; read channel nb cmpa #$E0 ; Is this a PSG 3 noise (not tone) track? bne @c ; If it isn't, don't do next part (non-PSG Noise doesn't restore) lda PSGNoise,u ; Get PSG noise setting sta <PSG ; Write it to PSG @c puls u ; removing return address from stack; will not return to coord flag loop rts ; (via Saxman's doc): Change current PSG noise to xx (For noise channel, E0-E7) ; cfSetPSGNoise lda #$E0 sta VoiceControl,y lda ,x+ sta PSGNoise,y ldb PlaybackControl,y bitb #$04 ; Is bit 2 (04h) Is SFX overriding this track? bne @rts sta <PSG @rts rts cfDisableModulation lda PlaybackControl,y anda #$F7 sta PlaybackControl,y ; Clear bit 3 (08h) of "playback control" byte (modulation off) rts ; (via Saxman's doc): Change current PSG tone to xx ; cfSetPSGTone lda ,x+ sta VoiceIndex,y rts ; (via Saxman's doc): $F6zzzz - jump to position ; * zzzz - position to loop back to (negative offset) ; cfJumpTo ldd ,x leax d,x rts ; (via Saxman's doc): $F7xxyyzzzz - repeat section of music ; * xx - loop index, for loops within loops without confusing the engine. ; o EXAMPLE: Some notes, then a section that is looped twice, then some more notes, and finally the whole thing is looped three times. ; The "inner" loop (the section that is looped twice) would have an xx of 01, looking something along the lines of F70102zzzz, whereas the "outside" loop (the whole thing loop) would have an xx of 00, looking something like F70003zzzz. ; * yy - number of times to repeat ; o NOTE: This includes the initial encounter of the F7 flag, not number of times to repeat AFTER hitting the flag. ; * zzzz - position to loop back to (negative offset) ; cfRepeatAtPos ldd ,x++ ; Loop index is in 'a' adda #LoopCounters ; Add to make loop index offset leau a,y tst ,u bne @a stb ,u ; Otherwise, set it to the new number of repeats @a dec ,u ; One less loop beq @b ; If counted to zero, skip the rest of this (hence start loop count of 1 terminates the loop without ever looping) ldd ,x leax d,x ; loop back rts @b leax 2,x rts ; (via Saxman's doc): jump to position yyyy (keep previous position in memory for returning) cfJumpToGosub lda StackPointer,y suba #2 sta StackPointer,y ; move stack backward leau 2,x ; move x to return address stu a,y ; store return address to stack ldd ,x ; read sub address leax d,x ; gosub rts cfSkip1 leax 1,x cfNop rts * YM2413 Instrument presets * ------------------------- * * /* Order of array = { modulator, carrier } */ * typedef struct { * Bit8u tl; * Bit8u dc; * Bit8u dm; * Bit8u fb; * Bit8u am[2]; * Bit8u vib[2]; * Bit8u et[2]; * Bit8u ksr[2]; * Bit8u multi[2]; * Bit8u ksl[2]; * Bit8u ar[2]; * Bit8u dr[2]; * Bit8u sl[2]; * Bit8u rr[2]; * } opll_patch_t; * static const opll_patch_t patch_ds1001[opll_patch_max] = { * { 0x05, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x03, 0x01 },{ 0x00, 0x00 },{ 0x0e, 0x08 },{ 0x08, 0x01 },{ 0x04, 0x02 },{ 0x02, 0x07 } }, * 1 : Violin * { 0x14, 0x00, 0x01, 0x05,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x03, 0x01 },{ 0x00, 0x00 },{ 0x0d, 0x0f },{ 0x08, 0x06 },{ 0x02, 0x01 },{ 0x03, 0x02 } }, * 2 : Guitar * { 0x08, 0x00, 0x01, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0f, 0x0b },{ 0x0a, 0x02 },{ 0x02, 0x01 },{ 0x00, 0x02 } }, * 3 : Piano * { 0x0c, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x06 },{ 0x08, 0x04 },{ 0x06, 0x02 },{ 0x01, 0x07 } }, * 4 : Flute * { 0x1e, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x02, 0x01 },{ 0x00, 0x00 },{ 0x0e, 0x07 },{ 0x01, 0x06 },{ 0x00, 0x02 },{ 0x01, 0x08 } }, * 5 : Clarinet * { 0x06, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x02, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x0e },{ 0x03, 0x02 },{ 0x0f, 0x0f },{ 0x04, 0x04 } }, * 6 : Oboe * { 0x1d, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x08, 0x08 },{ 0x02, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x07 } }, * 7 : Trumpet * { 0x22, 0x01, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x03, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x07 },{ 0x02, 0x02 },{ 0x00, 0x01 },{ 0x01, 0x07 } }, * 8 : Organ * { 0x25, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x05, 0x01 },{ 0x00, 0x00 },{ 0x04, 0x07 },{ 0x00, 0x03 },{ 0x07, 0x00 },{ 0x02, 0x01 } }, * 9 : Horn * { 0x0f, 0x00, 0x01, 0x07,{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x00 },{ 0x05, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x0a },{ 0x08, 0x05 },{ 0x05, 0x00 },{ 0x01, 0x02 } }, * A : Synthesizer * { 0x24, 0x00, 0x00, 0x07,{ 0x00, 0x01 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x07, 0x01 },{ 0x00, 0x00 },{ 0x0f, 0x0f },{ 0x08, 0x08 },{ 0x02, 0x01 },{ 0x02, 0x02 } }, * B : Harpsichord * { 0x11, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x03 },{ 0x00, 0x00 },{ 0x06, 0x07 },{ 0x05, 0x04 },{ 0x01, 0x01 },{ 0x08, 0x06 } }, * C : Vibraphone * { 0x13, 0x00, 0x00, 0x05,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x02 },{ 0x03, 0x00 },{ 0x0c, 0x09 },{ 0x09, 0x05 },{ 0x00, 0x00 },{ 0x03, 0x02 } }, * D : Synthesizer Bass * { 0x0c, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x03 },{ 0x00, 0x00 },{ 0x09, 0x0c },{ 0x04, 0x00 },{ 0x03, 0x0f },{ 0x03, 0x06 } }, * E : Acoustic Bass * { 0x0d, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x01 },{ 0x01, 0x02 },{ 0x00, 0x00 },{ 0x0c, 0x0d },{ 0x01, 0x05 },{ 0x05, 0x00 },{ 0x06, 0x06 } }, * F : Electric Guitar * /* Rhythm Patches: rows 1 and 4 are bass drum, 2 and 5 are Snare Drum & Hi-Hat, 3 and 6 are Tom and Top Cymbal */ * { 0x18, 0x00, 0x01, 0x07,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0d, 0x00 },{ 0x0f, 0x00 },{ 0x06, 0x00 },{ 0x0a, 0x00 } }, * { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0c, 0x00 },{ 0x08, 0x00 },{ 0x0a, 0x00 },{ 0x07, 0x00 } }, * { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x05, 0x00 },{ 0x00, 0x00 },{ 0x0f, 0x00 },{ 0x08, 0x00 },{ 0x05, 0x00 },{ 0x09, 0x00 } }, * { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0f },{ 0x00, 0x08 },{ 0x00, 0x06 },{ 0x00, 0x0d } }, * { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0d },{ 0x00, 0x08 },{ 0x00, 0x06 },{ 0x00, 0x08 } }, * { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0a },{ 0x00, 0x0a },{ 0x00, 0x05 },{ 0x00, 0x05 } } * };
test/test1.asm
8bitgeek/run816
0
244257
; da65 V2.16 - Ubuntu 2.16-2 ; Created: 2020-09-18 13:53:51 ; Input file: ./test1 ; Page: 1 .setcpu "6502" L021D := $021D L0229 := $0229 L0253 := $0253 L0272 := $0272 L02B1 := $02B1 L02D0 := $02D0 L02DC := $02DC L02F2 := $02F2 L0336 := $0336 L033F := $033F L0355 := $0355 L03AB := $03AB L03B2 := $03B2 L03B6 := $03B6 L03BA := $03BA L03C1 := $03C1 L03C4 := $03C4 L03D7 := $03D7 L03E3 := $03E3 L03EE := $03EE L0400 := $0400 L040C := $040C L044A := $044A L0454 := $0454 L0462 := $0462 L046C := $046C L0477 := $0477 L048F := $048F L049C := $049C L04A9 := $04A9 L04DC := $04DC L0561 := $0561 L05AA := $05AA L05D1 := $05D1 L05D7 := $05D7 L06FB := $06FB L075B := $075B L0765 := $0765 L0772 := $0772 L0778 := $0778 L077F := $077F L0796 := $0796 L07A2 := $07A2 L07A9 := $07A9 L07B6 := $07B6 L07C3 := $07C3 L083E := $083E L0845 := $0845 L0853 := $0853 L0858 := $0858 L085D := $085D L0862 := $0862 L086D := $086D L087B := $087B L0892 := $0892 L08AE := $08AE L0905 := $0905 L0908 := $0908 L093C := $093C L0960 := $0960 L096D := $096D L09B4 := $09B4 L09BF := $09BF L09EC := $09EC L09FB := $09FB L0A2E := $0A2E L0A37 := $0A37 L0A4B := $0A4B L0A4D := $0A4D L0A65 := $0A65 L0A7F := $0A7F L0A97 := $0A97 L0AA0 := $0AA0 L0AB6 := $0AB6 L0AE0 := $0AE0 L0AEF := $0AEF L0B64 := $0B64 L0B8D := $0B8D L0CF5 := $0CF5 L0CFC := $0CFC ora ($D8,x) ldx #$FF txs lda #$F0 ldx #$FF sta $00 stx $01 jsr L0B8D jsr L021D jsr L077F pha jsr L0796 pla jmp LFFF1 ldy #$00 beq LF4FF lda #$29 ldx #$02 jmp L0CFC LF4FF: rts jsr L0A4D jmp L0253 LF506: ldy #$04 jsr L086D sta $04 stx $05 .byte $1A bne LF513 inx LF513: ldy #$03 jsr L0A97 lda $04 ldx $05 jsr L0A4D ldy #$04 ldx #$00 lda ($00),y ldy #$00 jsr L0A7F ldy #$01 jsr L086D sta $04 stx $05 jsr L07A2 ldy #$00 jsr L0A97 lda $04 ldx $05 stx $10 ora $10 bne LF506 jsr L0858 rts jsr L0A4D jmp L02B1 LF54F: ldy #$05 jsr L086D sta $04 stx $05 .byte $1A bne LF55C inx LF55C: ldy #$04 jsr L0A97 lda $04 ldx $05 jsr L0A4D ldy #$05 jsr L086D sta $04 stx $05 .byte $1A bne LF575 inx LF575: ldy #$04 jsr L0A97 lda $04 ldx $05 ldy #$00 jsr L0862 ldy #$00 jsr L0A7F ldy #$01 jsr L086D sta $04 stx $05 jsr L07A2 ldy #$00 jsr L0A97 lda $04 ldx $05 stx $10 ora $10 bne LF54F jsr L085D rts jsr L07A9 ldx #$00 lda #$00 ldy #$02 jsr L0A97 ldy #$03 jsr L086D cpx #$FF bne LF5BE cmp #$FF LF5BE: jsr L0960 beq LF5C6 jmp L02F2 LF5C6: jmp L0336 ldy #$03 jsr L086D ldy #$00 jsr L0A97 lda #$B0 ldx #$0B jsr L0A4D ldy #$03 jsr L086D jsr L0A4D ldy #$05 jsr L086D ldy #$00 jsr L0862 jsr L0A4D ldy #$06 jsr L09FB ldy #$03 jsr L086D sta $04 stx $05 .byte $1A bne LF601 inx LF601: ldy #$02 jsr L0A97 lda $04 ldx $05 jmp L02DC ldx #$00 lda #$00 ldy #$02 jsr L0A97 ldy #$03 jsr L086D cpx #$00 bne LF621 cmp #$FF LF621: jsr L0960 beq LF629 jmp L0355 LF629: jmp L03AB lda #$29 ldx #$0D jsr L0A4D lda #$AA jsr L0A37 ldx #$20 lda #$00 jsr L0229 lda #$29 ldx #$2D jsr L0A4D lda #$29 ldx #$0D jsr L0A4D ldx #$20 lda #$00 jsr L0272 lda #$29 ldx #$0D jsr L0A4D lda #$29 ldx #$2D jsr L0A4D ldx #$20 lda #$00 jsr L0272 ldy #$03 jsr L086D sta $04 stx $05 .byte $1A bne LF676 inx LF676: ldy #$02 jsr L0A97 lda $04 ldx $05 jmp L033F ldx #$00 lda #$00 jmp L03B2 jsr L0853 rts ldy #$00 lda ($16),y inc $16 bne LF697 inc $17 LF697: rts lda $4D34 sta $4D2F jsr L0462 lda #$2F ldx #$4D jsr L0A4D jsr L0A2E jmp L0CF5 lda $14 sec sbc #$02 sta $14 bcs LF6B9 dec $15 LF6B9: rts lda $4D39 bne LF6D0 jsr L0400 jmp L0778 lda $4D39 bne LF6D0 jsr L0400 jmp L0772 LF6D0: jsr L0400 sta $02 stx $03 jsr L03D7 ldy #$01 lda ($14),y tax dey lda ($14),y rts ldy #$00 sty $08 sty $09 LF6E9: lda ($16),y sec sbc #$30 bcc LF71C cmp #$0A bcs LF71C jsr L03BA pha lda $08 ldx $09 asl $08 rol $09 asl $08 rol $09 adc $08 sta $08 txa adc $09 sta $09 asl $08 rol $09 pla adc $08 sta $08 bcc LF6E9 inc $09 bcs LF6E9 LF71C: lda $08 ldx $09 rts ldy $4D3B inc $4D3B sta $4D3C,y rts lda #$3C ldx #$4D clc adc $4D3B bcc LF736 inx LF736: jmp L0A4D lda $18 ldx $19 jmp L0A4D LF740: jsr L03C1 inc $4D35 bne LF740 inc $4D36 bne LF740 rts jsr L0462 lda $4D50 ldx $4D51 jsr L0A4D lda $4D52 ldx $4D53 jsr L0A4D jmp L0CF5 sty $08 jsr L087B jsr L0454 lda $08 jmp L08AE sty $08 jsr L087B jsr L0454 lda $08 jmp L0905 pha ldy #$05 LF783: lda $14,y sta $4D29,y dey bpl LF783 pla sta $14 stx $15 jsr L083E sta $16 stx $17 jsr L083E sta $18 stx $19 lda #$00 tay sta ($18),y iny sta ($18),y iny lda ($18),y sta $0CF6 iny lda ($18),y sta $0CF7 lda $16 sta $08 lda $17 sta $09 ldy #$00 LF7BD: lda ($16),y beq LF7CC cmp #$25 beq LF7CC iny bne LF7BD inc $17 bne LF7BD LF7CC: tya clc adc $16 sta $16 bcc LF7D6 inc $17 LF7D6: sec sbc $08 sta $0A lda $17 sbc $09 sta $0B ora $0A beq LF80A jsr L07B6 ldy #$05 lda $19 sta ($00),y dey lda $18 sta ($00),y dey lda $09 sta ($00),y dey lda $08 sta ($00),y dey lda $0B sta ($00),y dey lda $0A sta ($00),y jsr L0CF5 LF80A: jsr L03B6 tax bne LF81B ldx #$05 LF812: lda $4D29,x sta $14,x dex bpl LF812 rts LF81B: cmp #$25 bne LF828 lda ($16),y cmp #$25 bne LF82E jsr L03BA LF828: jsr L03C4 jmp L04DC LF82E: lda #$00 ldx #$0B LF832: sta $4D30,x dex bpl LF832 lda ($16),y cmp #$2D bne LF843 stx $4D30 beq LF85C LF843: cmp #$2B bne LF84C stx $4D31 beq LF85C LF84C: cmp #$20 bne LF855 stx $4D32 beq LF85C LF855: cmp #$23 bne LF862 stx $4D33 LF85C: jsr L03BA jmp L0561 LF862: ldx #$20 cmp #$30 bne LF86E tax jsr L03BA lda ($16),y LF86E: stx $4D34 cmp #$2A bne LF87E jsr L03BA jsr L0400 jmp L05AA LF87E: jsr L040C sta $4D35 stx $4D36 sty $4D37 sty $4D38 lda ($16),y cmp #$2E bne LF8AE jsr L03BA lda ($16),y cmp #$2A bne LF8A5 jsr L03BA jsr L0400 jmp L05D1 LF8A5: jsr L040C sta $4D37 stx $4D38 LF8AE: lda ($16),y cmp #$7A beq LF8CD cmp #$68 beq LF8CD cmp #$74 beq LF8CD cmp #$6A beq LF8C8 cmp #$4C beq LF8C8 cmp #$6C bne LF8D3 LF8C8: lda #$FF sta $4D39 LF8CD: jsr L03BA jmp L05D7 LF8D3: sty $4D3B ldx #$3C stx $4D50 ldx #$4D stx $4D51 jsr L03BA cmp #$63 bne LF8F5 jsr L0400 sta $4D3C lda #$00 sta $4D3D jmp L06FB LF8F5: cmp #$64 beq LF8FD cmp #$69 bne LF92A LF8FD: ldx #$00 lda $4D32 beq LF906 ldx #$20 LF906: lda $4D31 beq LF90D ldx #$2B LF90D: stx $4D3A jsr L03EE ldy $03 bmi LF922 ldy $4D3A beq LF922 sty $4D3C inc $4D3B LF922: ldy #$0A jsr L048F jmp L06FB LF92A: cmp #$6E bne LF943 jsr L0400 sta $08 stx $09 ldy #$00 lda ($18),y sta ($08),y iny lda ($18),y sta ($08),y jmp L04DC LF943: cmp #$6F bne LF96E jsr L03EE ldy $4D33 beq LF966 pha stx $10 ora $10 ora $02 ora $03 ora $4D37 ora $4D38 beq LF966 lda #$30 jsr L044A pla LF966: ldy #$08 jsr L048F jmp L06FB LF96E: cmp #$70 bne LF97F ldx #$00 stx $4D39 inx stx $4D33 lda #$78 bne LF9A6 LF97F: cmp #$73 bne LF98F jsr L0400 sta $4D50 stx $4D51 jmp L06FB LF98F: cmp #$75 bne LF99E jsr L03E3 ldy #$0A jsr L049C jmp L06FB LF99E: cmp #$78 beq LF9A6 cmp #$58 bne LF9CF LF9A6: pha lda $4D33 beq LF9B6 lda #$30 jsr L044A lda #$58 jsr L044A LF9B6: jsr L03E3 ldy #$10 jsr L049C pla cmp #$78 bne LF9CC lda $4D50 ldx $4D51 jsr L0AB6 LF9CC: jmp L06FB LF9CF: jmp L04DC lda $4D50 ldx $4D51 jsr L0AA0 sta $4D52 stx $4D53 lda $4D37 ora $4D38 beq LF9FE ldx $4D37 cpx $4D52 lda $4D38 tay sbc $4D53 bcs LF9FE stx $4D52 sty $4D53 LF9FE: sec lda $4D35 sbc $4D52 tax lda $4D36 sbc $4D53 bcs LFA11 lda #$00 tax LFA11: eor #$FF sta $4D36 txa eor #$FF sta $4D35 lda $4D30 bne LFA24 jsr L046C LFA24: jsr L0477 lda $4D30 beq LFA2F jsr L046C LFA2F: jmp L04DC sta $4D54 lda #$00 sta $4D55 rts iny pha clc tya adc $00 sta $00 bcc LFA47 inc $01 LFA47: pla rts ldy #$FF cpx #$80 bcs LFA51 ldy #$00 LFA51: sty $02 sty $03 rts lda $0CF8 ldx $0CF9 jsr L0A4D lda $0CFA ldx $0CFB jsr L0A4D ldy #$04 jmp L02D0 ldy #$00 beq LFA78 lda #$D7 ldx #$0C jmp L0CFC LFA78: rts sec sbc #$01 bcs LFA7F dex LFA7F: rts lda $00 sec sbc #$04 sta $00 bcc LFA8A rts LFA8A: dec $01 rts lda $00 sec sbc #$06 sta $00 bcc LFA97 rts LFA97: dec $01 rts sta $4D56 sta $08 stx $4D57 stx $09 ldy #$01 lda ($08),y and #$01 bne LFAB5 LFAAC: lda #$10 jsr L075B tax jmp L085D LFAB5: lda ($08),y and #$04 bne LFAAC ldy #$00 lda ($08),y ldx #$00 jsr L0A4D ldy #$09 jsr L0A65 ldy #$07 jsr L0A65 ldy #$09 jsr L086D jsr L096D cpx #$00 bne LFAE8 cmp #$00 bne LFAE8 ldy #$05 jsr L086D ldy #$0A jmp L0765 LFAE8: jsr LFFF5 cpx #$FF bne LFB07 cmp #$FF bne LFB07 lda $4D56 sta $08 lda $4D57 sta $09 ldy #$01 lda ($08),y ora #$04 sta ($08),y bne LFAAC LFB07: jsr L0A4D ldy #$05 jsr L086D jsr L0AE0 jmp L085D ldy #$01 lda ($00),y tax .byte $B2 brk inc $00 beq LFB25 inc $00 beq LFB27 rts LFB25: inc $00 LFB27: inc $01 rts ldy #$04 jmp L0765 ldy #$05 jmp L0765 ldy #$06 jmp L0765 sta $08 stx $09 ldx #$00 lda ($08),y rts ldy #$01 lda ($00),y tax dey lda ($00),y rts lda #$00 tax .byte $64 .byte $02 .byte $64 .byte $03 pha jsr L07A9 ldy #$03 lda $03 sta ($00),y dey lda $02 sta ($00),y dey txa sta ($00),y pla .byte $92 brk rts sta $10 jsr L083E sta $08 stx $09 sta $02 stx $03 jsr L083E sta $0A stx $0B jsr L083E sta $0C stx $0D rts jsr L0892 ldx $0D ldy $10 cpy #$0A bne LFBDF lda $0C ora $0B ora $0A bne LFBA9 cpx #$80 bne LFBA9 ldy #$0B LFB9E: lda $0BCB,y sta ($08),y dey bpl LFB9E jmp L093C LFBA9: txa bpl LFBDF lda #$2D ldy #$00 sta ($08),y inc $08 bne LFBB8 inc $09 LFBB8: lda $0A eor #$FF clc adc #$01 sta $0A lda $0B eor #$FF adc #$00 sta $0B lda $0C eor #$FF adc #$00 sta $0C lda $0D eor #$FF adc #$00 sta $0D jmp L0908 jsr L0892 LFBDF: lda #$00 pha LFBE2: ldy #$20 lda #$00 LFBE6: asl $0A rol $0B rol $0C rol $0D rol a cmp $10 bcc LFBF7 sbc $10 inc $0A LFBF7: dey bne LFBE6 tay lda $0BBB,y pha lda $0A ora $0B ora $0C ora $0D bne LFBE2 ldy #$00 LFC0B: pla sta ($08),y beq LFC13 iny bne LFC0B LFC13: lda $02 ldx $03 rts bne LFC20 LFC1A: ldx #$00 txa rts bne LFC1A LFC20: ldx #$00 lda #$01 rts beq LFC20 bmi LFC20 ldx #$00 txa rts beq LFC31 bpl LFC20 LFC31: ldx #$00 txa rts beq LFC20 bcc LFC20 ldx #$00 txa rts beq LFC1A ldx #$00 txa rol a rts sta $0E txa beq LFC77 stx $0F jsr L09EC lda #$00 ldx $03 beq LFC7A sta $10 ldy #$10 lsr $0F ror $0E LFC5C: bcc LFC68 clc adc $02 pha txa adc $10 sta $10 pla LFC68: ror $10 ror a ror $0F ror $0E dey bne LFC5C lda $0E ldx $0F rts LFC77: jmp L09B4 LFC7A: ldy $02 ldx $0E stx $02 ldx $0F sty $0E ldy #$08 jmp L09BF sta $0E jsr L09EC lda #$00 ldy #$08 ldx $03 beq LFCB2 sta $0F lsr $0E LFC9A: bcc LFCA6 clc adc $02 pha txa adc $0F sta $0F pla LFCA6: ror $0F ror a ror $0E dey bne LFC9A tax lda $0E rts LFCB2: lsr $0E LFCB4: bcc LFCB9 clc adc $02 LFCB9: ror a ror $0E dey bne LFCB4 tax lda $0E rts pha ldy #$01 lda ($00),y sta $03 .byte $B2 brk sta $02 pla jmp L0845 sty $4D58 lda $0CF1 ldx $0CF2 jsr L0A4D lda $00 ldx $01 clc adc $4D58 bcc LFCE9 inx LFCE9: sta $08 stx $09 ldy #$01 lda ($08),y tax dey lda ($08),y jsr L0A4D lda $08 ldx $09 jsr L0B64 ldy $4D58 jmp L0765 lda #$01 jmp L0A4B ldy #$00 lda ($00),y ldy $00 beq LFD19 dec $00 ldy #$00 sta ($00),y rts LFD19: dec $01 dec $00 sta ($00),y rts lda #$00 ldx #$00 pha lda $00 sec sbc #$02 sta $00 bcs LFD30 dec $01 LFD30: ldy #$01 txa sta ($00),y pla dey sta ($00),y rts ldy #$03 lda $00 sec sbc #$02 sta $00 bcs LFD47 dec $01 LFD47: lda ($00),y tax dey lda ($00),y ldy #$00 sta ($00),y iny txa sta ($00),y rts pha sty $10 ldy #$01 lda ($00),y sta $09 dey lda ($00),y sta $08 ldy $10 pla sta ($08),y jmp L0845 ldy #$00 sta ($00),y iny pha txa sta ($00),y pla rts sta $08 stx $09 ldx #$00 ldy #$00 LFD7F: lda ($08),y beq LFD8B iny bne LFD7F inc $09 inx bne LFD7F LFD8B: tya rts sta $08 stx $09 sta $0A stx $0B ldy #$00 LFD97: lda ($08),y beq LFDB0 tax lda $0BD7,x and #$02 beq LFDA9 txa sec sbc #$E0 sta ($08),y LFDA9: iny bne LFD97 inc $09 bne LFD97 LFDB0: lda $0A ldx $0B rts ldx #$00 sta $0E stx $0F jsr L09EC jsr L0AEF lda $02 ldx $03 rts lda #$00 sta $09 ldy #$10 ldx $0F beq LFDEF LFDD0: asl $02 rol $03 rol a rol $09 pha cmp $0E lda $09 sbc $0F bcc LFDE8 sta $09 pla sbc $0E pha inc $02 LFDE8: pla dey bne LFDD0 sta $08 rts LFDEF: asl $02 rol $03 rol a bcs LFDFA cmp $0E bcc LFDFE LFDFA: sbc $0E inc $02 LFDFE: dey bne LFDEF sta $08 rts ldy #$05 jsr L0A65 jsr L0A2E ldy #$07 jsr L0A65 lda $0D25 ldx $0D26 jsr L07C3 sta $08 stx $09 ora $09 bne LFE28 .byte $3A sta $0D21 bne LFE35 LFE28: lda $08 clc adc $0D21 sta $0D21 txa adc $0D22 LFE35: sta $0D22 jmp L085D pha lda #$00 sta $0D21 sta $0D22 ldy #$02 lda ($00),y sta $0D25 lda #$21 sta ($00),y iny lda ($00),y sta $0D26 lda #$0D sta ($00),y pla jsr L04A9 lda $0D21 ldx $0D22 rts lda #$29 sta $08 lda #$0D sta $09 lda #$00 tay ldx #$40 beq LFE7D LFE73: sta ($08),y iny bne LFE73 inc $09 dex bne LFE73 LFE7D: cpy #$30 beq LFE86 sta ($08),y iny bne LFE7D LFE86: rts .byte $25 LFE88: bmi $FEBE cli .byte $3A and $30 .byte $32 cli asl a brk bmi LFEC5 .byte $32 .byte $33 .byte $34 and $36,x .byte $37 sec and $4241,y .byte $43 .byte $44 eor $46 and $3132 .byte $34 .byte $37 .byte $34 sec .byte $33 rol $34,x sec brk bpl LFEC0 bpl LFEC2 bpl LFEC4 bpl LFEC6 bpl LFE88 bvc LFF0A bvc LFF0C bpl LFECE bpl LFED0 LFEC0: bpl LFED2 LFEC2: bpl LFED4 LFEC4: .byte $10 LFEC5: .byte $10 LFEC6: bpl LFED8 bpl LFEDA bpl LFEDC bpl LFEDE LFECE: ldy #$00 LFED0: brk brk LFED2: brk brk LFED4: brk brk brk brk LFED8: brk brk LFEDA: brk brk LFEDC: brk brk LFEDE: .byte $0C .byte $0C .byte $0C .byte $0C .byte $0C .byte $0C .byte $0C .byte $0C .byte $0C .byte $0C brk brk brk brk brk brk brk asl a asl a asl a asl a asl a asl a .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 .byte $02 brk LFF0A: brk brk LFF0C: brk brk brk ora #$09 ora #$09 ora #$09 ora ($01,x) ora ($01,x) ora ($01,x) ora ($01,x) ora ($01,x) ora ($01,x) ora ($01,x) ora ($01,x) ora ($01,x) ora ($01,x) brk brk brk brk rti brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk ora ($00,x) ora ($01,x) brk .byte $02 ora ($00,x) brk brk brk brk brk brk brk brk brk brk brk brk brk brk brk .byte $D7 .byte $0C .byte $DA .byte $0C cmp $4C0C,x brk brk brk brk brk brk sta $0D0A stx $0D0B sta $0D11 stx $0D12 LFFDF: dey lda LFFFF,y sta $0D1B dey lda LFFFF,y sta $0D1A sty $0D1D .byte $20 LFFF1: .byte $FF .byte $FF ldy #$FF LFFF5: bne LFFDF rts brk brk and a:$0B brk brk LFFFF: brk
pwnlib/shellcraft/templates/thumb/trap.asm
DrKeineLust/pwntools
8,966
26574
<%docstring>A trap instruction.</%docstring> BKPT
Everything.agda
fangyi-zhou/mpst-in-agda
1
11261
import Common import Global import Local import Projection import Soundness import Completeness import Example
src/statements/adabase-statement-base-sqlite.ads
jrmarino/AdaBase
30
171
<gh_stars>10-100 -- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../../License.txt with AdaBase.Connection.Base.SQLite; with AdaBase.Bindings.SQLite; with Ada.Containers.Vectors; package AdaBase.Statement.Base.SQLite is package ACS renames AdaBase.Connection.Base.SQLite; package BND renames AdaBase.Bindings.SQLite; package AC renames Ada.Containers; type SQLite_statement (type_of_statement : Stmt_Type; log_handler : ALF.LogFacility_access; sqlite_conn : ACS.SQLite_Connection_Access; initial_sql : SQL_Access; con_error_mode : Error_Modes; con_case_mode : Case_Modes; con_max_blob : BLOB_Maximum) is new Base_Statement and AIS.iStatement with private; type SQLite_statement_access is access all SQLite_statement; overriding function column_count (Stmt : SQLite_statement) return Natural; overriding function last_insert_id (Stmt : SQLite_statement) return Trax_ID; overriding function last_sql_state (Stmt : SQLite_statement) return SQL_State; overriding function last_driver_code (Stmt : SQLite_statement) return Driver_Codes; overriding function last_driver_message (Stmt : SQLite_statement) return String; overriding procedure discard_rest (Stmt : out SQLite_statement); overriding function execute (Stmt : out SQLite_statement) return Boolean; overriding function execute (Stmt : out SQLite_statement; parameters : String; delimiter : Character := '|') return Boolean; overriding function rows_returned (Stmt : SQLite_statement) return Affected_Rows; overriding function column_name (Stmt : SQLite_statement; index : Positive) return String; overriding function column_table (Stmt : SQLite_statement; index : Positive) return String; overriding function column_native_type (Stmt : SQLite_statement; index : Positive) return field_types; overriding function fetch_next (Stmt : out SQLite_statement) return ARS.Datarow; overriding function fetch_all (Stmt : out SQLite_statement) return ARS.Datarow_Set; overriding function fetch_bound (Stmt : out SQLite_statement) return Boolean; overriding procedure fetch_next_set (Stmt : out SQLite_statement; data_present : out Boolean; data_fetched : out Boolean); private type column_info is record table : CT.Text; field_name : CT.Text; field_type : field_types; null_possible : Boolean; sqlite_type : BND.enum_field_types; end record; type sqlite_canvas is record buffer_binary : BND.ICS.char_array_access := null; buffer_text : BND.ICS.chars_ptr := BND.ICS.Null_Ptr; end record; type step_result_type is (unset, data_pulled, progam_complete, error_seen); package VColumns is new AC.Vectors (Index_Type => Positive, Element_Type => column_info); package VCanvas is new AC.Vectors (Index_Type => Positive, Element_Type => sqlite_canvas); type SQLite_statement (type_of_statement : Stmt_Type; log_handler : ALF.LogFacility_access; sqlite_conn : ACS.SQLite_Connection_Access; initial_sql : SQL_Access; con_error_mode : Error_Modes; con_case_mode : Case_Modes; con_max_blob : BLOB_Maximum) is new Base_Statement and AIS.iStatement with record stmt_handle : aliased BND.sqlite3_stmt_Access := null; step_result : step_result_type := unset; assign_counter : Natural := 0; num_columns : Natural := 0; column_info : VColumns.Vector; bind_canvas : VCanvas.Vector; sql_final : SQL_Access; end record; procedure log_problem (statement : SQLite_statement; category : Log_Category; message : String; pull_codes : Boolean := False; break : Boolean := False); procedure initialize (Object : in out SQLite_statement); procedure Adjust (Object : in out SQLite_statement); procedure finalize (Object : in out SQLite_statement); procedure scan_column_information (Stmt : out SQLite_statement); procedure reclaim_canvas (Stmt : out SQLite_statement); function seems_like_bit_string (candidate : CT.Text) return Boolean; function private_execute (Stmt : out SQLite_statement) return Boolean; function construct_bind_slot (Stmt : SQLite_statement; marker : Positive) return sqlite_canvas; procedure free_binary is new Ada.Unchecked_Deallocation (BND.IC.char_array, BND.ICS.char_array_access); end AdaBase.Statement.Base.SQLite;
src/shaders/h264/ildb/AVC_ILDB_Root_UV.asm
me176c-dev/android_hardware_intel-vaapi-driver
192
97176
<filename>src/shaders/h264/ildb/AVC_ILDB_Root_UV.asm<gh_stars>100-1000 /* * Copyright © <2010>, Intel Corporation. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * This file was originally licensed under the following license * * 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. * */ // Kernel name: AVC_ILDB_Root_UV.asm // // Root kernel serves as a scheduler for child threads // // $Revision: 1 $ // $Date: 10/19/06 5:06p $ // // ---------------------------------------------------- // AVC_ILDB_ROOT_UV // ---------------------------------------------------- #define AVC_ILDB .kernel AVC_ILDB_ROOT_UV #if defined(COMBINED_KERNEL) ILDB_LABEL(AVC_ILDB_ROOT_UV): #endif #include "SetupVPKernel.asm" #include "AVC_ILDB.inc" #if defined(_DEBUG) mov (1) EntrySignature:w 0xFF11:w #endif ///////////////////////////////////////////////////////////////////////////////////// #if defined(_DEBUG) // Init URB space for running on RTL. It satisfies reading an unwritten URB entries. // Will remove it for production release. mov (8) m1:ud 0x55555555:ud mov (8) m2:ud 0x66666666:ud mov (8) m3:ud 0x77777777:ud mov (8) m4:ud 0x88888888:ud mov (1) Temp1_W:w MBsCntY:w shl (1) Temp2_W:w MBsCntY:w 1:w ILDB_LABEL(ILDB_INIT_URB_UV): mul (1) URBOffset:uw Temp1_W:uw 4:w // Each thread uses 4 URB entries (1 r0 + 1 inline + 2 data) mov (1) URBWriteMsgDesc:ud MSG_LEN(4)+URBWMSGDSC:ud // Msg descriptor: URB write msg length = 5 #include "writeURB.asm" add (1) Temp1_W:w Temp1_W:w 1:w // Increase block count cmp.l.f0.0 (1) null Temp1_W:w Temp2_W:w // Check the block count limit (f0.0) jmpi ILDB_LABEL(ILDB_INIT_URB_UV) // Loop back mov (1) EntrySignature:w 0xFFF0:w #endif ///////////////////////////////////////////////////////////////////////////////////// // Set global variable mov (32) ChildParam:uw 0:uw // Reset local variables, 2 GRFs //mul (1) TotalBlocks:w MBsCntX:w MBsCntY:w // Total # of blocks //add (1) GatewayApertureE:w MBsCntY:w GatewayApertureB:w // Aperture End = aperture Head + BlockCntY // 4 URB entries for Y: // Entry 0 - Child thread R0Hdr // Entry 1 - input parameter to child kernel (child r1) // Entry 2 - Prev MB data UV 2x8 // Entry 3 - Unused #define URB_ENTRIES_PER_MB 4 // URB_ENTRIES_PER_MB in differnt form, the final desired format is (URB_ENTRIES_PER_MB-1) << 10 mov (1) URB_EntriesPerMB_2:w URB_ENTRIES_PER_MB-1:w shl (1) URB_EntriesPerMB_2:w URB_EntriesPerMB_2:w 10:w #define CHROMA_ROOT // Compiling flag for chroma only // URB base for UV kernels #if defined(DEV_CL) mov (1) URBOffsetUVBase:w 240:w #else mov (1) URBOffsetUVBase:w 320:w #endif mov (1) ChildThreadsID:uw 3:uw shr (1) ThreadLimit:w MaxThreads:w 1:w // Initial luma thread limit to 50% mul (1) TotalBlocks:w MBsCntX:w MBsCntY:w // MBs to be processed count down from TotalBlocks //***** Init CT_R0Hdr fields that are common to all threads ************************* mov (8) CT_R0Hdr.0:ud r0.0<8;8,1>:ud // Init to root R0 header mov (1) CT_R0Hdr.7:ud r0.6:ud // Copy Parent Thread Cnt; JJ did the change on 06/20/2006 mov (1) CT_R0Hdr.31:ub 0:w // Reset the highest byte mov (1) CT_R0Hdr.3:ud 0x00000000 mov (1) CT_R0Hdr.6:uw sr0.0:uw // sr0.0: state reg contains general thread states, e.g. EUID/TID. //***** Init ChildParam fields that are common to all threads *********************** mov (8) ChildParam<1>:ud RootParam<8;8,1>:ud // Copy all root parameters mov (4) CurCol<1>:w 0:w // Reset CurCol, CurRow, add (2) LastCol<1>:w MBsCntX<2;2,1>:w -1:w // Get LastCol and LastRow mov (1) URBWriteMsgDesc:ud MSG_LEN(2)+URBWMSGDSC:ud //=================================================================================== #include "AVC_ILDB_OpenGateway.asm" // Open gateway for receiving notification #include "AVC_ILDB_Dep_Check.asm" // Check dependency and spawn all luma child threads in parallel with chroma root //#include "AVC_ILDB_LumaThrdLimit.asm" // Update thread limit in luma root thread via gateway #include "AVC_ILDB_CloseGateway.asm" // Close root thread gateway // Chroma root EOT = child send EOT : Request type = 1 END_CHILD_THREAD #undef CHROMA_ROOT #if !defined(COMBINED_KERNEL) // For standalone kernel only .end_code .end_kernel #endif
Task/Five-weekends/AppleScript/five-weekends-2.applescript
LaudateCorpus1/RosettaCodeData
1
3745
-- TEST ----------------------------------------------------------------------- on run fiveWeekends(1900, 2100) end run -- FIVE WEEKENDS -------------------------------------------------------------- -- fiveWeekends :: Int -> Int -> Record on fiveWeekends(fromYear, toYear) set lstYears to enumFromTo(fromYear, toYear) -- yearMonthString :: (Int, Int) -> String script yearMonthString on |λ|(lstYearMonth) ((item 1 of lstYearMonth) as string) & " " & ¬ item (item 2 of lstYearMonth) of ¬ {"January", "", "March", "", "May", "", ¬ "July", "August", "", "October", "", "December"} end |λ| end script -- addLongMonthsOfYear :: [(Int, Int)] -> [(Int, Int)] script addLongMonthsOfYear on |λ|(lstYearMonth, intYear) -- yearMonth :: Int -> (Int, Int) script yearMonth on |λ|(intMonth) {intYear, intMonth} end |λ| end script lstYearMonth & ¬ map(yearMonth, my longMonthsStartingFriday(intYear)) end |λ| end script -- leanYear :: Int -> Bool script leanYear on |λ|(intYear) 0 = length of longMonthsStartingFriday(intYear) end |λ| end script set lstFullMonths to map(yearMonthString, ¬ foldl(addLongMonthsOfYear, {}, lstYears)) set lstLeanYears to filter(leanYear, lstYears) {{|number|:length of lstFullMonths}, ¬ {firstFive:(items 1 thru 5 of lstFullMonths)}, ¬ {lastFive:(items -5 thru -1 of lstFullMonths)}, ¬ {leanYearCount:length of lstLeanYears}, ¬ {leanYears:lstLeanYears}} end fiveWeekends -- longMonthsStartingFriday :: Int -> [Int] on longMonthsStartingFriday(intYear) -- startIsFriday :: Int -> Bool script startIsFriday on |λ|(iMonth) weekday of calendarDate(intYear, iMonth, 1) is Friday end |λ| end script filter(startIsFriday, [1, 3, 5, 7, 8, 10, 12]) end longMonthsStartingFriday -- calendarDate :: Int -> Int -> Int -> Date on calendarDate(intYear, intMonth, intDay) tell (current date) set {its year, its month, its day, its time} to ¬ {intYear, intMonth, intDay, 0} return it end tell end calendarDate -- GENERIC FUNCTIONS ---------------------------------------------------------- -- enumFromTo :: Enum a => a -> a -> [a] on enumFromTo(m, n) set {intM, intN} to {fromEnum(m), fromEnum(n)} if intM > intN then set d to -1 else set d to 1 end if set lst to {} if class of m is text then repeat with i from intM to intN by d set end of lst to chr(i) end repeat else repeat with i from intM to intN by d set end of lst to i end repeat end if return lst end enumFromTo -- fromEnum :: Enum a => a -> Int on fromEnum(x) set c to class of x if c is boolean then if x then 1 else 0 end if else if c is text then if x ≠ "" then id of x else missing value end if else x as integer end if end fromEnum -- filter :: (a -> Bool) -> [a] -> [a] on filter(f, xs) tell mReturn(f) set lst to {} set lng to length of xs repeat with i from 1 to lng set v to item i of xs if |λ|(v, i, xs) then set end of lst to v end repeat return lst end tell end filter -- foldl :: (a -> b -> a) -> a -> [b] -> a on foldl(f, startValue, xs) tell mReturn(f) set v to startValue set lng to length of xs repeat with i from 1 to lng set v to |λ|(v, item i of xs, i, xs) end repeat return v end tell end foldl -- map :: (a -> b) -> [a] -> [b] on map(f, xs) tell mReturn(f) set lng to length of xs set lst to {} repeat with i from 1 to lng set end of lst to |λ|(item i of xs, i, xs) end repeat return lst end tell end map -- Lift 2nd class handler function into 1st class script wrapper -- mReturn :: Handler -> Script on mReturn(f) if class of f is script then f else script property |λ| : f end script end if end mReturn
bb-runtimes/runtimes/ravenscar-full-stm32g474/gnat/s-valuei.adb
JCGobbi/Nucleo-STM32G474RE
0
24130
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . V A L U E _ I -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2021, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with System.Val_Util; use System.Val_Util; package body System.Value_I is ------------------ -- Scan_Integer -- ------------------ function Scan_Integer (Str : String; Ptr : not null access Integer; Max : Integer) return Int is Uval : Uns; -- Unsigned result Minus : Boolean := False; -- Set to True if minus sign is present, otherwise to False Start : Positive; -- Saves location of first non-blank (not used in this case) begin Scan_Sign (Str, Ptr, Max, Minus, Start); if Str (Ptr.all) not in '0' .. '9' then Ptr.all := Start; Bad_Value (Str); end if; Uval := Scan_Raw_Unsigned (Str, Ptr, Max); -- Deal with overflow cases, and also with largest negative number if Uval > Uns (Int'Last) then if Minus and then Uval = Uns (-(Int'First)) then return Int'First; else Bad_Value (Str); end if; -- Negative values elsif Minus then return -(Int (Uval)); -- Positive values else return Int (Uval); end if; end Scan_Integer; ------------------- -- Value_Integer -- ------------------- function Value_Integer (Str : String) return Int is begin -- We have to special case Str'Last = Positive'Last because the normal -- circuit ends up setting P to Str'Last + 1 which is out of bounds. We -- deal with this by converting to a subtype which fixes the bounds. if Str'Last = Positive'Last then declare subtype NT is String (1 .. Str'Length); begin return Value_Integer (NT (Str)); end; -- Normal case where Str'Last < Positive'Last else declare V : Int; P : aliased Integer := Str'First; begin V := Scan_Integer (Str, P'Access, Str'Last); Scan_Trailing_Blanks (Str, P); return V; end; end if; end Value_Integer; end System.Value_I;
Grammar/Abstract.agda
nad/pretty
0
16195
<filename>Grammar/Abstract.agda ------------------------------------------------------------------------ -- Abstract grammars ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Grammar.Abstract where open import Data.Bool open import Data.Char open import Data.Empty open import Data.List open import Data.Product open import Data.Sum open import Function open import Relation.Binary.PropositionalEquality using (_≡_) ------------------------------------------------------------------------ -- Grammars -- I use an abstract and general definition of grammars: a grammar is -- a predicate that relates strings with parse results. Grammar : Set → Set₁ Grammar A = A → List Char → Set ------------------------------------------------------------------------ -- Grammar combinators -- A grammar for no strings. fail : ∀ {A} → Grammar A fail = λ _ _ → ⊥ -- Symmetric choice. infixl 10 _∣_ _∣_ : ∀ {A} → Grammar A → Grammar A → Grammar A g₁ ∣ g₂ = λ x s → g₁ x s ⊎ g₂ x s -- Grammars for the empty string. return : ∀ {A} → A → Grammar A return x = λ y s → y ≡ x × s ≡ [] -- Map. infixl 20 _<$>_ _<$_ _<$>_ : ∀ {A B} → (A → B) → Grammar A → Grammar B f <$> g = λ x s → ∃ λ y → g y s × x ≡ f y _<$_ : ∀ {A B} → A → Grammar B → Grammar A x <$ g = const x <$> g -- A sequencing combinator for partially applied grammars. seq : (List Char → Set) → (List Char → Set) → (List Char → Set) seq p₁ p₂ = λ s → ∃₂ λ s₁ s₂ → p₁ s₁ × p₂ s₂ × s ≡ s₁ ++ s₂ -- Monadic bind. infixl 15 _>>=_ _>>_ _>>=_ : ∀ {A B} → Grammar A → (A → Grammar B) → Grammar B g₁ >>= g₂ = λ y s → ∃ λ x → seq (g₁ x) (g₂ x y) s _>>_ : ∀ {A B} → Grammar A → Grammar B → Grammar B g₁ >> g₂ = g₁ >>= λ _ → g₂ -- "Applicative" sequencing. infixl 20 _⊛_ _<⊛_ _⊛>_ _⊛_ : ∀ {A B} → Grammar (A → B) → Grammar A → Grammar B g₁ ⊛ g₂ = g₁ >>= λ f → f <$> g₂ _<⊛_ : ∀ {A B} → Grammar A → Grammar B → Grammar A g₁ <⊛ g₂ = λ x s → ∃ λ y → seq (g₁ x) (g₂ y) s _⊛>_ : ∀ {A B} → Grammar A → Grammar B → Grammar B _⊛>_ = _>>_ -- Kleene star. infix 30 _⋆ _+ _⋆ : ∀ {A} → Grammar A → Grammar (List A) (g ⋆) [] s = s ≡ [] (g ⋆) (x ∷ xs) s = seq (g x) ((g ⋆) xs) s _+ : ∀ {A} → Grammar A → Grammar (List A) (g +) [] s = ⊥ (g +) (x ∷ xs) s = (g ⋆) (x ∷ xs) s -- Elements separated by something. infixl 18 _sep-by_ _sep-by_ : ∀ {A B} → Grammar A → Grammar B → Grammar (List A) g sep-by sep = _∷_ <$> g ⊛ (sep >> g) ⋆ -- A grammar for an arbitrary token. token : Grammar Char token = λ c s → s ≡ [ c ] -- A grammar for a given token. tok : Char → Grammar Char tok c = λ c′ s → c′ ≡ c × token c′ s -- A grammar for tokens satisfying a given predicate. sat : (p : Char → Bool) → Grammar (∃ λ t → T (p t)) sat _ = λ { (c , _) s → token c s } -- A grammar for whitespace. whitespace : Grammar Char whitespace = tok ' ' ∣ tok '\n' -- A grammar for a given string. string : List Char → Grammar (List Char) string s = λ s′ s″ → s′ ≡ s × s″ ≡ s -- A grammar for the given string, possibly followed by some -- whitespace. symbol : List Char → Grammar (List Char) symbol s = string s <⊛ whitespace ⋆
macros2.asm
jsvalenzuela/EA3-ejercicio
1
8085
<gh_stars>1-10 ;macros2.asm ;These are macros for Assembly Language Programming ;<NAME> ;Dickinson State University ;4/5/99 ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ getString macro string ;read string from keyboard local label1, label2, label3, label4, label5, label6, label7, label8 pushad push di push si lea si, string mov bx, si label1: mov ah, 1 int 21h cmp al, 0Dh je label2 cmp al, 8 je label8 jmp label7 label8: dec si cmp si, bx jl label6 jmp label1 label6: mov si, bx jmp label1 label7: mov [si], al inc si jmp label1 label2: mov byte ptr [si], '$' pop si pop di popad endm ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ displayString macro string ;write string on screen push dx push ax lea dx, string mov ah, 9 int 21h pop ax pop dx endm ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ scrollup macro number ;scroll screen up pusha mov ah, 6 ;up mov al, number ;lines mov ch, 0 ;starting at 0,0 mov cl, 0 mov dh, 24 ;ending at 24, 79 mov dl, 79 mov bh, 15 ;black background, white fore int 10h popa endm ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ clearScreen macro scrollup 0 endm ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ newLine macro number ;line feed and carriage return local Repeat pusha ifnb <number> mov cx, number endif Repeat: mov al, 0Dh mov ah, 0Eh int 10h mov al, 0Ah mov ah, 0Eh int 10h ifnb <number> loop Repeat endif popa endm ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ getdate macro near ;get date mov ah, 2Ah Int 21h ;AL = day of week (0-7) ;CX = year (1980-2099) ;DL = month (1-12) ;DH = day (1-31) endm ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ gettime macro near ;get time mov ah, 2Ch Int 21h ;AL = hour (0-23) ;CX = minute (0-59) ;DL = second (0-59) ;DH = hundredth (0-99) endm ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ setCurPos macro row, column ;sets cursor position mov dl, row mov dh, column mov ah, 2 int 10h endm ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ beep macro ;beeps speaker pusha mov dl, 7 mov ah, 2 int 21h popa endm ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ STRCPY MACRO LOCAL @@OK STRLEN CMP BX, 31 JLE @@OK MOV BX, 31 @@OK: MOV CX, BX CLD REP MOVSB MOV AL, '$' MOV BYTE PTR[DI], AL ENDM ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ STRLEN MACRO LOCAL @@STRL01, @@STREND ;DEJA EN BX LA CANTIDAD DE CARACTERES DE UNA CADENA MOV BX, 0 @@STRL01: CMP BYTE PTR[SI + BX], '$' JE @@STREND INC BX JMP @@STRL01 @@STREND: NOP ENDM STRCAT MACRO LOCAL @@CONCATSIZEMAL, @@CONCATSIZEOK, @@CONCATSIGO PUSH DS PUSH SI STRLEN MOV DX, BX MOV SI, DI PUSH ES POP DS STRLEN ADD DI, BX ADD BX, DX CMP BX, 31 JG @@CONCATSIZEMAL @@CONCATSIZEOK: MOV CX, DX JMP @@CONCATSIGO @@CONCATSIZEMAL: SUB BX, 31 SUB DX, BX MOV CX, DX @@CONCATSIGO: PUSH DS POP ES POP SI POP DS CLD REP MOVSB MOV AL,'$' MOV BYTE PTR [DI], AL ENDM STRCMP MACRO LOCAL @@CICLO, @@NOTEQUAL, @@BYE DEC DI @@CICLO: INC DI ;DS:DI -> SIGUIENTE CHAR EN CAD2 LODSB ;CARGA AL CON EL SIGUIENTE CHAR DE CAD1 CMP [DI], AL ;COMPARA CHARS JNE @@NOTEQUAL ;SALTA DEL LOOP SI NO SON LOS MISMOS CMP AL, '$' ;SON LOS MISMOS, VERIFICA EOF JNE @@CICLO ;NO ES EOF, PASA A LOS SIGUIENTES MOV BL, 0 TEST BL, BL JMP @@BYE ;LOS STRING SON IGUALES (ZF = 1) @@NOTEQUAL: MOV BL, 1 ;LOS STRING NO SON IGUALES (ZF = 0) TEST BL, BL @@BYE: NOP ENDM
test/Fail/InjectiveTypeConstructors.agda
cruhland/agda
1,989
9420
-- Needs the --injective-type-constructors option enabled to type check. module InjectiveTypeConstructors where data D (A : Set) : Set where data _==_ (A : Set) : Set → Set where refl : A == A injD : ∀ {A B} → D A == D B → A == B injD refl = refl
oeis/183/A183228.asm
neoneye/loda-programs
11
245348
; A183228: a(n) is the base-5 digit sum of 10^n+1. ; 2,3,5,5,5,5,9,5,5,9,13,13,13,13,9,13,17,21,21,21,17,13,21,25,29,21,33,33,25,33,41,41,33,25,29,33,33,41,29,37,37,41,45,41,37,41,37,45,45,45,45,49,53,53,49,57,41,57,69,61,53,53,49,61,57,65,61,49,57,61,61,65,61,61,61,65,53,49,65,69,57,81,81,81,81,69,77,77,77,97,93,93,85,85,81,73,97,81,81,81 seq $0,79 ; Powers of 2: a(n) = 2^n. seq $0,53824 ; Sum of digits of (n written in base 5). add $0,1
Not optimised solns/13-Injection-Sites-2.asm
blueset/7bh-solutions
0
85214
<reponame>blueset/7bh-solutions<gh_stars>0 -- 7 Billion Humans -- -- 13: Injection Sites 2 -- -- Size: 18/10 -- -- Speed: 66/64 -- step s pickup c a: step s step s b: if c == datacube: step e if e == wall: jump c endif jump b endif jump d c: step s step s e: if c == datacube: step w if w == wall: jump a endif jump e endif d: drop
Transynther/x86/_processed/NC/_zr_/i7-8650U_0xd2.log_21829_1331.asm
ljhsiun2/medusa
9
168548
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r8 push %r9 push %rbp push %rbx lea addresses_UC_ht+0x1eb2b, %r9 nop dec %rbx vmovups (%r9), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $1, %xmm6, %rbp cmp $41893, %r8 lea addresses_normal_ht+0x12c92, %r9 nop xor %rbp, %rbp movb $0x61, (%r9) nop nop add $55014, %r8 pop %rbx pop %rbp pop %r9 pop %r8 pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r15 push %rax push %rdi // Faulty Load mov $0x1c0bed0000000401, %r14 nop nop nop nop dec %rax movups (%r14), %xmm0 vpextrq $0, %xmm0, %r11 lea oracles, %rdi and $0xff, %r11 shlq $12, %r11 mov (%rdi,%r11,1), %r11 pop %rdi pop %rax pop %r15 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
artwork/barbaro_espada_bloquea.asm
fjpena/sword-of-ianna-zx
67
6079
; ASM source file created by SevenuP v1.20 ; SevenuP (C) Copyright 2002-2006 by <NAME>, aka Metalbrain ;GRAPHIC DATA: ;Pixel Size: ( 24, 32) ;Char Size: ( 3, 4) ;Sort Priorities: X char, Char line, Y char ;Data Outputted: Gfx ;Interleave: Sprite ;Mask: No barbaro_espada_bloquea: DEFB 0, 0, 0, 0, 0, 3, 0, 0 DEFB 3, 0, 0, 3, 0, 7,195, 0 DEFB 8, 35, 0, 16, 19, 0, 34,150 DEFB 0, 3,214, 0,227,214, 1,241 DEFB 150, 1,250, 6, 1,238,198, 1 DEFB 246,204, 0,240, 12, 0,243,204 DEFB 0,109,140, 0,126, 30, 0, 31 DEFB 128, 0, 3,156, 0, 0, 24, 0 DEFB 0, 0, 0, 32, 64, 0,112,160 DEFB 0,121, 80, 0,120,168, 2, 56 DEFB 0, 7,188, 80, 7,156, 0, 6 DEFB 216,128, 2, 1, 80, 1,130,168
part6/buffer.asm
VARoDeK/realmode-assembly
42
21972
<filename>part6/buffer.asm<gh_stars>10-100 %ifndef CODE_BUFFER %define CODE_BUFFER ;set's graphic mode initGraphics: mov ah, 0 ;set display mode mov al, 13h ;13h = 320x200 int 0x10 ret ;resets screen to full black resetBuffer: pusha mov cx, 80*50/2 xor ax, ax mov di, [screenPos] rep stosw popa ret ;screen has size 320x200 but buffer only 80x50 copyBufferOver: pusha push es mov es, word [graphicMemory] xor di, di mov cx, 200 .loop: mov dx, cx mov cx, 320/4 .innerloop: mov si, 320 sub si, cx ;invert x-axis mov bx, 200 sub bx, dx ;invert y-axis shr bx, 2 imul bx, 80 add si, bx add si, [screenPos] lodsb ;read from buffer (ds:si) mov ah, al stosw ;write 4 pixel row to graphic memory (es:di) stosw loop .innerloop mov cx, dx loop .loop pop es popa ret ;si = position of image, ax = xpos, bx = ypos ;a bit messy because of all the error checks to not draw out of screen drawImage: pusha xor di, di imul di, bx, 80 ;add offset y-position add di, [screenPos] ;make it a pixel in buffer add di, ax ;add offset x-position xor ax, ax lodsb mov cx, ax ;x-size lodsb mov dx, ax ;y-size .for_y: mov bx, di add bx, cx ;bx = offsetOnScreen + xsize sub bx, word [screenPos] ;skip if line is out of top border screen jl .skip_x sub bx, cx sub bx, 80*50 jge .skip_x ;skip if line is out of bottom border screen xor bx, bx .for_x: mov al, byte [si+bx] test al, al ;skip 0bytes as transparent jz .skip cmp bx, 80 ;if pixel is right out of screen, skip it jge .skip cmp bx, 0 ;if pixel is left out of screen, skip it jl .skip mov byte [di+bx], al ;write byte to buffer .skip: inc bx cmp bx, cx jl .for_x .skip_x: add di, 80 ;next row within buffer add si, cx ;next row within image dec dx jnz .for_y ;repeat for y-length popa ret graphicMemory dw 0xA000 screenPos dw 0x0500 ;double buffer will be at this address %endif
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_254.asm
ljhsiun2/medusa
9
5572
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %rax push %rcx push %rdi push %rdx push %rsi // Store lea addresses_WC+0x14dd9, %r12 nop nop add $12857, %r11 mov $0x5152535455565758, %rsi movq %rsi, %xmm0 vmovups %ymm0, (%r12) nop add %rdi, %rdi // Faulty Load lea addresses_PSE+0x1d959, %r12 nop nop xor %rax, %rax movups (%r12), %xmm3 vpextrq $0, %xmm3, %rcx lea oracles, %r11 and $0xff, %rcx shlq $12, %rcx mov (%r11,%rcx,1), %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_PSE', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}} [Faulty Load] {'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
source/required/s-expuns.ads
ytomino/drake
33
20003
pragma License (Unrestricted); -- implementation unit required by compiler with System.Exponentiations; with System.Unsigned_Types; package System.Exp_Uns is pragma Pure; -- required for "**" by compiler (s-expuns.ads) -- Modular types do not raise the exceptions. function Exp_Unsigned is new Exponentiations.Generic_Exp_Unsigned ( Unsigned_Types.Unsigned, Shift_Left => Unsigned_Types.Shift_Left); end System.Exp_Uns;
alloy4fun_models/trashltl/models/4/yQFQAnD8SRa5ERwYP.als
Kaixi26/org.alloytools.alloy
0
4404
open main pred idyQFQAnD8SRa5ERwYP_prop5 { some f:File | eventually File' = File - f } pred __repair { idyQFQAnD8SRa5ERwYP_prop5 } check __repair { idyQFQAnD8SRa5ERwYP_prop5 <=> prop5o }
1571/64tass/utl.asm
silverdr/assembly
23
246001
;*************************** ;** ** ;** 1571 UTILITY ** ;** ** ;** * * * * * * * * * * * ** ;** U0 n S = int. dos ** ;** U0 n R = retries ** ;** U0 n T = signature ** ;** U0 n H = side ** ;** U0 n # = device ** ;** ** ;** n = ">" ascii ** ;** ** ;*************************** cmdsec lda cmdbuf+4 sta secinc rts cmdret lda cmdbuf+4 sta revcnt rts sign jmp signature ; finish up there sside .proc sei lda pota1 and #$20 ;**TODO** bne utlbad lda cmdbuf+4 cmp #'1' beq fst cmp #'0' bne utlbad lda pota1 and #$fb ;**TODO** sta pota1 cli bit switch bpl ht rts fst lda pota1 ora #4 ;**TODO** sta pota1 cli bit switch bmi + ht jmp initdr + rts .pend chgutl ldx cmdsiz ; chk cmd size cpx #4 bcc utlbad ; br, error no parameters lda cmdbuf+3 cmp #'S' ; sector interleave ? beq cmdsec cmp #'R' ; retry beq cmdret cmp #'T' ; test ROM beq sign cmp #'M' ; mode beq smode cmp #'H' beq sside jmp ptch61 rtch61 bcc utlbad cpy #31 bcs utlbad lda #$40 ; change device # sta tlkadr ; clear old lda #$20 sta lsnadr ; * tya clc adc tlkadr sta tlkadr ; new tya clc adc lsnadr sta lsnadr ; new rts utlbad lda #badcmd jmp cmderr smode sei lda cmdbuf+4 cmp #'1' beq + cmp #'0' bne utlbad lda pota1 and #$df ;**TODO** sta pota1 jsr jslowd jsr ptch10 lda lock ora #$80 sta lock cli bit switch bpl chn rts + lda pota1 ora #$20 ;**TODO** sta pota1 jsr jslowd lda #<jirq sta irqjmp lda #>jirq sta irqjmp+1 lda #$40 sta t1hl2 sta t1hc2 lda lock and #$7f sta lock lda #0 sta nxtst cli bit switch bmi + chn jmp initdr + rts
tpantlr2-code/code/reference/G3.g4
cgonul/antlr-poc
25
5561
<filename>tpantlr2-code/code/reference/G3.g4<gh_stars>10-100 grammar G3; r : B;
test/Fail/Issue390.agda
redfish64/autonomic-agda
1
7747
module Issue390 where data main : Set where
test/Succeed/OpenModuleShortHand.agda
shlevy/agda
1,989
11738
<filename>test/Succeed/OpenModuleShortHand.agda module OpenModuleShortHand where data Nat : Set where zero : Nat suc : Nat -> Nat module List (Elem : Set) where data List : Set where [] : List _::_ : Elem -> List -> List open List Nat {- This means open module _ = List Nat -} xs : List xs = zero :: (suc zero :: [])
1A/S5/PIM/tps/pr1/multiplications.adb
MOUDDENEHamza/ENSEEIHT
4
13990
-------------------------------------------------------------------------------- -- Fichier : multiplications.adb -- Auteur : <NAME> -- Objectif : Réviser les tables de multiplications -- Crée : Lundi Sept 23 2019 -------------------------------------------------------------------------------- with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Ada.Calendar; use Ada.Calendar; With Alea; -- Procédure qui sert à réaliser le programme principal. procedure Multiplications is package Mon_Alea is new Alea (1, 10); -- générateur de nombre dans l'intervalle [1, 10] use Mon_Alea; -- Définitions de toutes les variables -- n_table: Integer; -- Lu au clavier désigne la table à réviser. n_table_a_reviser: Integer; -- Un entier correspondant à la table -- qu'il faut réviser. nombre_alea: Integer; -- Le nombre aléatoire généré lors de la question. reponse: Integer; -- Contient la réponse de l'utilisateur. erreurs: Integer; -- Nombre d'erreurs commises par l'utilisateur. stop: Integer; -- Une variable qui sert à définir si l'utilisateur -- souhaite continuer si stop = 1 sinon elle reçoit 0. Debut: Time; -- Heure de début de l'opération. Fin: Time; -- Heure de fin de l'opération. Delai : Duration; -- Durée de l'opération. Max_Delai: Duration; -- Le temps maximal écoulé pour répondre -- une question. Total_Delai: Duration; -- Le temps total de toutes les -- les réponses. Moyen_Delai: Duration; -- Le temps moyen pour que -- L'utilisateur réponde à une -- questions plus une seconde. begin -- R1 : Comment "Réviser les tables de multiplications". -- -- R2 : Comment"Initialisation des variables". -- n_table_a_reviser := 0; Max_Delai := Duration(0); Total_Delai := Duration(0); Moyen_Delai := Duration(0); -- Afficher un message convivial au démarage du programme. put_Line("------------Bienvenue dans votre espace de travail-------------"); New_Line; Repeter : loop -- R2 : Comment "réviser une table de multiplications". -- -- R3 : Comment "Demander à l'utilisateur la table qu'il veut réviser". erreurs := 0; Repeter_1 : loop put("Table à réviser : "); -- Afficher un message avant la lecture. Get(n_table); -- Obtenir la table que l'utilisateur veut réviser. New_Line; if (n_table < 1 or n_table > 10) then Put_Line("Error : Faut entrer une table entre 1 et 10."); New_Line; end if; exit Repeter_1 when n_table >= 1 and n_table <= 10; end loop Repeter_1; -- Afficher le message permettant de signaler l'existance de -- l'option abondonner avant de commencer une table de multiplications. Put_Line("Si vous voulez abondonner, tapez 0 dans le résultat."); New_Line; for i in 1..10 loop -- R3 : Comment "Réviser une question de la table de multiplications". -- -- R4 : Comment "Poser une question de la table de multiplications" -- -- R5 : Comment "Génerer la question". -- -- Obtenir et stocker un nombre aléatoire dans nombre_alea entre 1 et 10. Get_Random_Number(nombre_alea); -- Affichage de la question. Put("(M" &Integer'Image(i) & ")" & Integer'Image(n_table) & " * " & Integer'Image(nombre_alea) & " ? "); -- R5 : Comment "Démarrer le chrono". -- Debut := Clock; -- Récupérer l'heure (heure de début). Get(reponse); -- Obtenir la réponse. -- R5 : Comment "possibilité d'abondonner la révision". -- if reponse = 0 then -- Si l'utilisateur souhaite abondonner le programme. New_Line; GOTO QUIT; -- Quitter le programme. end if; -- R5 : Comment "Arreter le chrono". -- Fin := Clock; -- Récupérer l'heure (heure de fin). Delai := Fin - Debut; -- Calculer la durée de l'opération. -- R5 : Comment "Calculer les délais". -- if Delai > Max_Delai then n_table_a_reviser := nombre_alea; Total_Delai := Total_Delai + Delai; Max_Delai := Delai; else Total_Delai := Moyen_Delai + Delai; end if; -- R4 : Comment "évaluer la réponse". -- if reponse = n_table * nombre_alea then Put_Line("Bravo !"); else erreurs := erreurs + 1; Put_Line("Mauvaise réponse."); end if; New_Line; end loop; -- R3 : Comment "évaluer la prestation de l'utilisateur". -- case erreurs is when 0 => Put_Line("Aucune erreur. Excellent!"); when 1 => Put_Line("Une seule erreur. Très bien."); when 2 | 3 => Put_Line(Integer'Image(erreurs) & " erreurs. Bien!"); when 10 => Put_Line("Tout est faux! Volontaire?"); when others => null; end case; New_Line; -- R4 : Comment "Incitation à réviser". -- if erreurs > 5 then Put_Line(Integer'Image(erreurs) & " erreurs. Il faut apprendre la table de " & Integer'Image(n_table) & "."); else Put_Line(Integer'Image(erreurs) & " erreurs. Il faut encore travailler la table de " & Integer'Image(n_table) & "."); end if; New_Line; -- R5 : Comment "Recommandations". -- Moyen_Delai := (Total_Delai / 10) + Duration(1); -- Calcul du delai moyen. Put_Line("Des hésitations sur la table de " & Integer'Image(n_table_a_reviser) & " : " & Duration'Image(Max_Delai) & " secondes contre " & Duration'Image(Moyen_Delai) & " secondes en moyenne."); New_Line; -- R3 : Comment "proposer de continuer la révision". -- Repeter_2 : loop Put_Line("Vous voulez continuer de réviser ?"); Put_Line("Si oui tapez 1, sinon tapez 0"); Put("Votre choix : "); get(stop); New_Line; exit Repeter_2 when stop = 1 or stop = 0; end loop Repeter_2; exit repeter when stop = 0; end loop repeter; <<QUIT>> -- Afficher un message convivial à la fin du programme. put_Line("--------------------------AU REVOIR----------------------------"); New_Line; end Multiplications;
programs/oeis/031/A031394.asm
neoneye/loda
22
10175
; A031394: a(n) = prime(7*n - 4). ; 5,29,59,89,127,163,197,239,277,317,367,409,449,491,547,593,631,673,727,769,823,863,919,971,1019,1061,1103,1163,1217,1277,1303,1373,1433,1481,1523,1571,1613,1667,1723,1783,1847,1889,1951,2003,2063,2111,2153,2237,2281,2339,2381,2423,2477,2551,2621,2677,2711,2753,2803,2861,2927,2999,3049,3119,3187,3251,3307,3347,3407,3467,3529,3571,3623,3677,3733,3797,3853,3917,3967,4021,4091,4139,4217,4259,4327,4391,4451,4513,4567,4639,4679,4751,4801,4889,4943,4993,5039,5101,5171,5233 mul $0,7 seq $0,215848 ; Primes > 3.
Eudora71/OpenSSL/crypto/ripemd/asm/rm_win32.asm
dusong7/eudora-win
10
16904
<reponame>dusong7/eudora-win ; Don't even think of reading this code ; It was automatically generated by rmd-586.pl ; Which is a perl program used to generate the x86 assember for ; any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris ; eric <<EMAIL>> ; TITLE rmd-586.asm .386 .model FLAT _TEXT SEGMENT PUBLIC _ripemd160_block_asm_host_order _ripemd160_block_asm_host_order PROC NEAR mov edx, DWORD PTR 4[esp] mov eax, DWORD PTR 8[esp] push esi mov ecx, DWORD PTR [edx] push edi mov esi, DWORD PTR 4[edx] push ebp mov edi, DWORD PTR 8[edx] push ebx sub esp, 108 $L000start: ; mov ebx, DWORD PTR [eax] mov ebp, DWORD PTR 4[eax] mov DWORD PTR [esp],ebx mov DWORD PTR 4[esp],ebp mov ebx, DWORD PTR 8[eax] mov ebp, DWORD PTR 12[eax] mov DWORD PTR 8[esp],ebx mov DWORD PTR 12[esp],ebp mov ebx, DWORD PTR 16[eax] mov ebp, DWORD PTR 20[eax] mov DWORD PTR 16[esp],ebx mov DWORD PTR 20[esp],ebp mov ebx, DWORD PTR 24[eax] mov ebp, DWORD PTR 28[eax] mov DWORD PTR 24[esp],ebx mov DWORD PTR 28[esp],ebp mov ebx, DWORD PTR 32[eax] mov ebp, DWORD PTR 36[eax] mov DWORD PTR 32[esp],ebx mov DWORD PTR 36[esp],ebp mov ebx, DWORD PTR 40[eax] mov ebp, DWORD PTR 44[eax] mov DWORD PTR 40[esp],ebx mov DWORD PTR 44[esp],ebp mov ebx, DWORD PTR 48[eax] mov ebp, DWORD PTR 52[eax] mov DWORD PTR 48[esp],ebx mov DWORD PTR 52[esp],ebp mov ebx, DWORD PTR 56[eax] mov ebp, DWORD PTR 60[eax] mov DWORD PTR 56[esp],ebx mov DWORD PTR 60[esp],ebp mov eax, edi mov ebx, DWORD PTR 12[edx] mov ebp, DWORD PTR 16[edx] ; 0 xor eax, ebx mov edx, DWORD PTR [esp] xor eax, esi add ecx, edx rol edi, 10 add ecx, eax mov eax, esi rol ecx, 11 add ecx, ebp ; 1 xor eax, edi mov edx, DWORD PTR 4[esp] xor eax, ecx add ebp, eax mov eax, ecx rol esi, 10 add ebp, edx xor eax, esi rol ebp, 14 add ebp, ebx ; 2 mov edx, DWORD PTR 8[esp] xor eax, ebp add ebx, edx rol ecx, 10 add ebx, eax mov eax, ebp rol ebx, 15 add ebx, edi ; 3 xor eax, ecx mov edx, DWORD PTR 12[esp] xor eax, ebx add edi, eax mov eax, ebx rol ebp, 10 add edi, edx xor eax, ebp rol edi, 12 add edi, esi ; 4 mov edx, DWORD PTR 16[esp] xor eax, edi add esi, edx rol ebx, 10 add esi, eax mov eax, edi rol esi, 5 add esi, ecx ; 5 xor eax, ebx mov edx, DWORD PTR 20[esp] xor eax, esi add ecx, eax mov eax, esi rol edi, 10 add ecx, edx xor eax, edi rol ecx, 8 add ecx, ebp ; 6 mov edx, DWORD PTR 24[esp] xor eax, ecx add ebp, edx rol esi, 10 add ebp, eax mov eax, ecx rol ebp, 7 add ebp, ebx ; 7 xor eax, esi mov edx, DWORD PTR 28[esp] xor eax, ebp add ebx, eax mov eax, ebp rol ecx, 10 add ebx, edx xor eax, ecx rol ebx, 9 add ebx, edi ; 8 mov edx, DWORD PTR 32[esp] xor eax, ebx add edi, edx rol ebp, 10 add edi, eax mov eax, ebx rol edi, 11 add edi, esi ; 9 xor eax, ebp mov edx, DWORD PTR 36[esp] xor eax, edi add esi, eax mov eax, edi rol ebx, 10 add esi, edx xor eax, ebx rol esi, 13 add esi, ecx ; 10 mov edx, DWORD PTR 40[esp] xor eax, esi add ecx, edx rol edi, 10 add ecx, eax mov eax, esi rol ecx, 14 add ecx, ebp ; 11 xor eax, edi mov edx, DWORD PTR 44[esp] xor eax, ecx add ebp, eax mov eax, ecx rol esi, 10 add ebp, edx xor eax, esi rol ebp, 15 add ebp, ebx ; 12 mov edx, DWORD PTR 48[esp] xor eax, ebp add ebx, edx rol ecx, 10 add ebx, eax mov eax, ebp rol ebx, 6 add ebx, edi ; 13 xor eax, ecx mov edx, DWORD PTR 52[esp] xor eax, ebx add edi, eax mov eax, ebx rol ebp, 10 add edi, edx xor eax, ebp rol edi, 7 add edi, esi ; 14 mov edx, DWORD PTR 56[esp] xor eax, edi add esi, edx rol ebx, 10 add esi, eax mov eax, edi rol esi, 9 add esi, ecx ; 15 xor eax, ebx mov edx, DWORD PTR 60[esp] xor eax, esi add ecx, eax mov eax, -1 rol edi, 10 add ecx, edx mov edx, DWORD PTR 28[esp] rol ecx, 8 add ecx, ebp ; 16 add ebp, edx mov edx, esi sub eax, ecx and edx, ecx and eax, edi or edx, eax mov eax, DWORD PTR 16[esp] rol esi, 10 lea ebp, DWORD PTR 1518500249[edx*1+ebp] mov edx, -1 rol ebp, 7 add ebp, ebx ; 17 add ebx, eax mov eax, ecx sub edx, ebp and eax, ebp and edx, esi or eax, edx mov edx, DWORD PTR 52[esp] rol ecx, 10 lea ebx, DWORD PTR 1518500249[eax*1+ebx] mov eax, -1 rol ebx, 6 add ebx, edi ; 18 add edi, edx mov edx, ebp sub eax, ebx and edx, ebx and eax, ecx or edx, eax mov eax, DWORD PTR 4[esp] rol ebp, 10 lea edi, DWORD PTR 1518500249[edx*1+edi] mov edx, -1 rol edi, 8 add edi, esi ; 19 add esi, eax mov eax, ebx sub edx, edi and eax, edi and edx, ebp or eax, edx mov edx, DWORD PTR 40[esp] rol ebx, 10 lea esi, DWORD PTR 1518500249[eax*1+esi] mov eax, -1 rol esi, 13 add esi, ecx ; 20 add ecx, edx mov edx, edi sub eax, esi and edx, esi and eax, ebx or edx, eax mov eax, DWORD PTR 24[esp] rol edi, 10 lea ecx, DWORD PTR 1518500249[edx*1+ecx] mov edx, -1 rol ecx, 11 add ecx, ebp ; 21 add ebp, eax mov eax, esi sub edx, ecx and eax, ecx and edx, edi or eax, edx mov edx, DWORD PTR 60[esp] rol esi, 10 lea ebp, DWORD PTR 1518500249[eax*1+ebp] mov eax, -1 rol ebp, 9 add ebp, ebx ; 22 add ebx, edx mov edx, ecx sub eax, ebp and edx, ebp and eax, esi or edx, eax mov eax, DWORD PTR 12[esp] rol ecx, 10 lea ebx, DWORD PTR 1518500249[edx*1+ebx] mov edx, -1 rol ebx, 7 add ebx, edi ; 23 add edi, eax mov eax, ebp sub edx, ebx and eax, ebx and edx, ecx or eax, edx mov edx, DWORD PTR 48[esp] rol ebp, 10 lea edi, DWORD PTR 1518500249[eax*1+edi] mov eax, -1 rol edi, 15 add edi, esi ; 24 add esi, edx mov edx, ebx sub eax, edi and edx, edi and eax, ebp or edx, eax mov eax, DWORD PTR [esp] rol ebx, 10 lea esi, DWORD PTR 1518500249[edx*1+esi] mov edx, -1 rol esi, 7 add esi, ecx ; 25 add ecx, eax mov eax, edi sub edx, esi and eax, esi and edx, ebx or eax, edx mov edx, DWORD PTR 36[esp] rol edi, 10 lea ecx, DWORD PTR 1518500249[eax*1+ecx] mov eax, -1 rol ecx, 12 add ecx, ebp ; 26 add ebp, edx mov edx, esi sub eax, ecx and edx, ecx and eax, edi or edx, eax mov eax, DWORD PTR 20[esp] rol esi, 10 lea ebp, DWORD PTR 1518500249[edx*1+ebp] mov edx, -1 rol ebp, 15 add ebp, ebx ; 27 add ebx, eax mov eax, ecx sub edx, ebp and eax, ebp and edx, esi or eax, edx mov edx, DWORD PTR 8[esp] rol ecx, 10 lea ebx, DWORD PTR 1518500249[eax*1+ebx] mov eax, -1 rol ebx, 9 add ebx, edi ; 28 add edi, edx mov edx, ebp sub eax, ebx and edx, ebx and eax, ecx or edx, eax mov eax, DWORD PTR 56[esp] rol ebp, 10 lea edi, DWORD PTR 1518500249[edx*1+edi] mov edx, -1 rol edi, 11 add edi, esi ; 29 add esi, eax mov eax, ebx sub edx, edi and eax, edi and edx, ebp or eax, edx mov edx, DWORD PTR 44[esp] rol ebx, 10 lea esi, DWORD PTR 1518500249[eax*1+esi] mov eax, -1 rol esi, 7 add esi, ecx ; 30 add ecx, edx mov edx, edi sub eax, esi and edx, esi and eax, ebx or edx, eax mov eax, DWORD PTR 32[esp] rol edi, 10 lea ecx, DWORD PTR 1518500249[edx*1+ecx] mov edx, -1 rol ecx, 13 add ecx, ebp ; 31 add ebp, eax mov eax, esi sub edx, ecx and eax, ecx and edx, edi or eax, edx mov edx, -1 rol esi, 10 lea ebp, DWORD PTR 1518500249[eax*1+ebp] sub edx, ecx rol ebp, 12 add ebp, ebx ; 32 mov eax, DWORD PTR 12[esp] or edx, ebp add ebx, eax xor edx, esi mov eax, -1 rol ecx, 10 lea ebx, DWORD PTR 1859775393[edx*1+ebx] sub eax, ebp rol ebx, 11 add ebx, edi ; 33 mov edx, DWORD PTR 40[esp] or eax, ebx add edi, edx xor eax, ecx mov edx, -1 rol ebp, 10 lea edi, DWORD PTR 1859775393[eax*1+edi] sub edx, ebx rol edi, 13 add edi, esi ; 34 mov eax, DWORD PTR 56[esp] or edx, edi add esi, eax xor edx, ebp mov eax, -1 rol ebx, 10 lea esi, DWORD PTR 1859775393[edx*1+esi] sub eax, edi rol esi, 6 add esi, ecx ; 35 mov edx, DWORD PTR 16[esp] or eax, esi add ecx, edx xor eax, ebx mov edx, -1 rol edi, 10 lea ecx, DWORD PTR 1859775393[eax*1+ecx] sub edx, esi rol ecx, 7 add ecx, ebp ; 36 mov eax, DWORD PTR 36[esp] or edx, ecx add ebp, eax xor edx, edi mov eax, -1 rol esi, 10 lea ebp, DWORD PTR 1859775393[edx*1+ebp] sub eax, ecx rol ebp, 14 add ebp, ebx ; 37 mov edx, DWORD PTR 60[esp] or eax, ebp add ebx, edx xor eax, esi mov edx, -1 rol ecx, 10 lea ebx, DWORD PTR 1859775393[eax*1+ebx] sub edx, ebp rol ebx, 9 add ebx, edi ; 38 mov eax, DWORD PTR 32[esp] or edx, ebx add edi, eax xor edx, ecx mov eax, -1 rol ebp, 10 lea edi, DWORD PTR 1859775393[edx*1+edi] sub eax, ebx rol edi, 13 add edi, esi ; 39 mov edx, DWORD PTR 4[esp] or eax, edi add esi, edx xor eax, ebp mov edx, -1 rol ebx, 10 lea esi, DWORD PTR 1859775393[eax*1+esi] sub edx, edi rol esi, 15 add esi, ecx ; 40 mov eax, DWORD PTR 8[esp] or edx, esi add ecx, eax xor edx, ebx mov eax, -1 rol edi, 10 lea ecx, DWORD PTR 1859775393[edx*1+ecx] sub eax, esi rol ecx, 14 add ecx, ebp ; 41 mov edx, DWORD PTR 28[esp] or eax, ecx add ebp, edx xor eax, edi mov edx, -1 rol esi, 10 lea ebp, DWORD PTR 1859775393[eax*1+ebp] sub edx, ecx rol ebp, 8 add ebp, ebx ; 42 mov eax, DWORD PTR [esp] or edx, ebp add ebx, eax xor edx, esi mov eax, -1 rol ecx, 10 lea ebx, DWORD PTR 1859775393[edx*1+ebx] sub eax, ebp rol ebx, 13 add ebx, edi ; 43 mov edx, DWORD PTR 24[esp] or eax, ebx add edi, edx xor eax, ecx mov edx, -1 rol ebp, 10 lea edi, DWORD PTR 1859775393[eax*1+edi] sub edx, ebx rol edi, 6 add edi, esi ; 44 mov eax, DWORD PTR 52[esp] or edx, edi add esi, eax xor edx, ebp mov eax, -1 rol ebx, 10 lea esi, DWORD PTR 1859775393[edx*1+esi] sub eax, edi rol esi, 5 add esi, ecx ; 45 mov edx, DWORD PTR 44[esp] or eax, esi add ecx, edx xor eax, ebx mov edx, -1 rol edi, 10 lea ecx, DWORD PTR 1859775393[eax*1+ecx] sub edx, esi rol ecx, 12 add ecx, ebp ; 46 mov eax, DWORD PTR 20[esp] or edx, ecx add ebp, eax xor edx, edi mov eax, -1 rol esi, 10 lea ebp, DWORD PTR 1859775393[edx*1+ebp] sub eax, ecx rol ebp, 7 add ebp, ebx ; 47 mov edx, DWORD PTR 48[esp] or eax, ebp add ebx, edx xor eax, esi mov edx, -1 rol ecx, 10 lea ebx, DWORD PTR 1859775393[eax*1+ebx] mov eax, ecx rol ebx, 5 add ebx, edi ; 48 sub edx, ecx and eax, ebx and edx, ebp or edx, eax mov eax, DWORD PTR 4[esp] rol ebp, 10 lea edi, DWORD PTR 2400959708[edx+edi] mov edx, -1 add edi, eax mov eax, ebp rol edi, 11 add edi, esi ; 49 sub edx, ebp and eax, edi and edx, ebx or edx, eax mov eax, DWORD PTR 36[esp] rol ebx, 10 lea esi, DWORD PTR 2400959708[edx+esi] mov edx, -1 add esi, eax mov eax, ebx rol esi, 12 add esi, ecx ; 50 sub edx, ebx and eax, esi and edx, edi or edx, eax mov eax, DWORD PTR 44[esp] rol edi, 10 lea ecx, DWORD PTR 2400959708[edx+ecx] mov edx, -1 add ecx, eax mov eax, edi rol ecx, 14 add ecx, ebp ; 51 sub edx, edi and eax, ecx and edx, esi or edx, eax mov eax, DWORD PTR 40[esp] rol esi, 10 lea ebp, DWORD PTR 2400959708[edx+ebp] mov edx, -1 add ebp, eax mov eax, esi rol ebp, 15 add ebp, ebx ; 52 sub edx, esi and eax, ebp and edx, ecx or edx, eax mov eax, DWORD PTR [esp] rol ecx, 10 lea ebx, DWORD PTR 2400959708[edx+ebx] mov edx, -1 add ebx, eax mov eax, ecx rol ebx, 14 add ebx, edi ; 53 sub edx, ecx and eax, ebx and edx, ebp or edx, eax mov eax, DWORD PTR 32[esp] rol ebp, 10 lea edi, DWORD PTR 2400959708[edx+edi] mov edx, -1 add edi, eax mov eax, ebp rol edi, 15 add edi, esi ; 54 sub edx, ebp and eax, edi and edx, ebx or edx, eax mov eax, DWORD PTR 48[esp] rol ebx, 10 lea esi, DWORD PTR 2400959708[edx+esi] mov edx, -1 add esi, eax mov eax, ebx rol esi, 9 add esi, ecx ; 55 sub edx, ebx and eax, esi and edx, edi or edx, eax mov eax, DWORD PTR 16[esp] rol edi, 10 lea ecx, DWORD PTR 2400959708[edx+ecx] mov edx, -1 add ecx, eax mov eax, edi rol ecx, 8 add ecx, ebp ; 56 sub edx, edi and eax, ecx and edx, esi or edx, eax mov eax, DWORD PTR 52[esp] rol esi, 10 lea ebp, DWORD PTR 2400959708[edx+ebp] mov edx, -1 add ebp, eax mov eax, esi rol ebp, 9 add ebp, ebx ; 57 sub edx, esi and eax, ebp and edx, ecx or edx, eax mov eax, DWORD PTR 12[esp] rol ecx, 10 lea ebx, DWORD PTR 2400959708[edx+ebx] mov edx, -1 add ebx, eax mov eax, ecx rol ebx, 14 add ebx, edi ; 58 sub edx, ecx and eax, ebx and edx, ebp or edx, eax mov eax, DWORD PTR 28[esp] rol ebp, 10 lea edi, DWORD PTR 2400959708[edx+edi] mov edx, -1 add edi, eax mov eax, ebp rol edi, 5 add edi, esi ; 59 sub edx, ebp and eax, edi and edx, ebx or edx, eax mov eax, DWORD PTR 60[esp] rol ebx, 10 lea esi, DWORD PTR 2400959708[edx+esi] mov edx, -1 add esi, eax mov eax, ebx rol esi, 6 add esi, ecx ; 60 sub edx, ebx and eax, esi and edx, edi or edx, eax mov eax, DWORD PTR 56[esp] rol edi, 10 lea ecx, DWORD PTR 2400959708[edx+ecx] mov edx, -1 add ecx, eax mov eax, edi rol ecx, 8 add ecx, ebp ; 61 sub edx, edi and eax, ecx and edx, esi or edx, eax mov eax, DWORD PTR 20[esp] rol esi, 10 lea ebp, DWORD PTR 2400959708[edx+ebp] mov edx, -1 add ebp, eax mov eax, esi rol ebp, 6 add ebp, ebx ; 62 sub edx, esi and eax, ebp and edx, ecx or edx, eax mov eax, DWORD PTR 24[esp] rol ecx, 10 lea ebx, DWORD PTR 2400959708[edx+ebx] mov edx, -1 add ebx, eax mov eax, ecx rol ebx, 5 add ebx, edi ; 63 sub edx, ecx and eax, ebx and edx, ebp or edx, eax mov eax, DWORD PTR 8[esp] rol ebp, 10 lea edi, DWORD PTR 2400959708[edx+edi] mov edx, -1 add edi, eax sub edx, ebp rol edi, 12 add edi, esi ; 64 mov eax, DWORD PTR 16[esp] or edx, ebx add esi, eax xor edx, edi mov eax, -1 rol ebx, 10 lea esi, DWORD PTR 2840853838[edx*1+esi] sub eax, ebx rol esi, 9 add esi, ecx ; 65 mov edx, DWORD PTR [esp] or eax, edi add ecx, edx xor eax, esi mov edx, -1 rol edi, 10 lea ecx, DWORD PTR 2840853838[eax*1+ecx] sub edx, edi rol ecx, 15 add ecx, ebp ; 66 mov eax, DWORD PTR 20[esp] or edx, esi add ebp, eax xor edx, ecx mov eax, -1 rol esi, 10 lea ebp, DWORD PTR 2840853838[edx*1+ebp] sub eax, esi rol ebp, 5 add ebp, ebx ; 67 mov edx, DWORD PTR 36[esp] or eax, ecx add ebx, edx xor eax, ebp mov edx, -1 rol ecx, 10 lea ebx, DWORD PTR 2840853838[eax*1+ebx] sub edx, ecx rol ebx, 11 add ebx, edi ; 68 mov eax, DWORD PTR 28[esp] or edx, ebp add edi, eax xor edx, ebx mov eax, -1 rol ebp, 10 lea edi, DWORD PTR 2840853838[edx*1+edi] sub eax, ebp rol edi, 6 add edi, esi ; 69 mov edx, DWORD PTR 48[esp] or eax, ebx add esi, edx xor eax, edi mov edx, -1 rol ebx, 10 lea esi, DWORD PTR 2840853838[eax*1+esi] sub edx, ebx rol esi, 8 add esi, ecx ; 70 mov eax, DWORD PTR 8[esp] or edx, edi add ecx, eax xor edx, esi mov eax, -1 rol edi, 10 lea ecx, DWORD PTR 2840853838[edx*1+ecx] sub eax, edi rol ecx, 13 add ecx, ebp ; 71 mov edx, DWORD PTR 40[esp] or eax, esi add ebp, edx xor eax, ecx mov edx, -1 rol esi, 10 lea ebp, DWORD PTR 2840853838[eax*1+ebp] sub edx, esi rol ebp, 12 add ebp, ebx ; 72 mov eax, DWORD PTR 56[esp] or edx, ecx add ebx, eax xor edx, ebp mov eax, -1 rol ecx, 10 lea ebx, DWORD PTR 2840853838[edx*1+ebx] sub eax, ecx rol ebx, 5 add ebx, edi ; 73 mov edx, DWORD PTR 4[esp] or eax, ebp add edi, edx xor eax, ebx mov edx, -1 rol ebp, 10 lea edi, DWORD PTR 2840853838[eax*1+edi] sub edx, ebp rol edi, 12 add edi, esi ; 74 mov eax, DWORD PTR 12[esp] or edx, ebx add esi, eax xor edx, edi mov eax, -1 rol ebx, 10 lea esi, DWORD PTR 2840853838[edx*1+esi] sub eax, ebx rol esi, 13 add esi, ecx ; 75 mov edx, DWORD PTR 32[esp] or eax, edi add ecx, edx xor eax, esi mov edx, -1 rol edi, 10 lea ecx, DWORD PTR 2840853838[eax*1+ecx] sub edx, edi rol ecx, 14 add ecx, ebp ; 76 mov eax, DWORD PTR 44[esp] or edx, esi add ebp, eax xor edx, ecx mov eax, -1 rol esi, 10 lea ebp, DWORD PTR 2840853838[edx*1+ebp] sub eax, esi rol ebp, 11 add ebp, ebx ; 77 mov edx, DWORD PTR 24[esp] or eax, ecx add ebx, edx xor eax, ebp mov edx, -1 rol ecx, 10 lea ebx, DWORD PTR 2840853838[eax*1+ebx] sub edx, ecx rol ebx, 8 add ebx, edi ; 78 mov eax, DWORD PTR 60[esp] or edx, ebp add edi, eax xor edx, ebx mov eax, -1 rol ebp, 10 lea edi, DWORD PTR 2840853838[edx*1+edi] sub eax, ebp rol edi, 5 add edi, esi ; 79 mov edx, DWORD PTR 52[esp] or eax, ebx add esi, edx xor eax, edi mov edx, DWORD PTR 128[esp] rol ebx, 10 lea esi, DWORD PTR 2840853838[eax*1+esi] mov DWORD PTR 64[esp],ecx rol esi, 6 add esi, ecx mov ecx, DWORD PTR [edx] mov DWORD PTR 68[esp],esi mov DWORD PTR 72[esp],edi mov esi, DWORD PTR 4[edx] mov DWORD PTR 76[esp],ebx mov edi, DWORD PTR 8[edx] mov DWORD PTR 80[esp],ebp mov ebx, DWORD PTR 12[edx] mov ebp, DWORD PTR 16[edx] ; 80 mov edx, -1 sub edx, ebx mov eax, DWORD PTR 20[esp] or edx, edi add ecx, eax xor edx, esi mov eax, -1 rol edi, 10 lea ecx, DWORD PTR 1352829926[edx*1+ecx] sub eax, edi rol ecx, 8 add ecx, ebp ; 81 mov edx, DWORD PTR 56[esp] or eax, esi add ebp, edx xor eax, ecx mov edx, -1 rol esi, 10 lea ebp, DWORD PTR 1352829926[eax*1+ebp] sub edx, esi rol ebp, 9 add ebp, ebx ; 82 mov eax, DWORD PTR 28[esp] or edx, ecx add ebx, eax xor edx, ebp mov eax, -1 rol ecx, 10 lea ebx, DWORD PTR 1352829926[edx*1+ebx] sub eax, ecx rol ebx, 9 add ebx, edi ; 83 mov edx, DWORD PTR [esp] or eax, ebp add edi, edx xor eax, ebx mov edx, -1 rol ebp, 10 lea edi, DWORD PTR 1352829926[eax*1+edi] sub edx, ebp rol edi, 11 add edi, esi ; 84 mov eax, DWORD PTR 36[esp] or edx, ebx add esi, eax xor edx, edi mov eax, -1 rol ebx, 10 lea esi, DWORD PTR 1352829926[edx*1+esi] sub eax, ebx rol esi, 13 add esi, ecx ; 85 mov edx, DWORD PTR 8[esp] or eax, edi add ecx, edx xor eax, esi mov edx, -1 rol edi, 10 lea ecx, DWORD PTR 1352829926[eax*1+ecx] sub edx, edi rol ecx, 15 add ecx, ebp ; 86 mov eax, DWORD PTR 44[esp] or edx, esi add ebp, eax xor edx, ecx mov eax, -1 rol esi, 10 lea ebp, DWORD PTR 1352829926[edx*1+ebp] sub eax, esi rol ebp, 15 add ebp, ebx ; 87 mov edx, DWORD PTR 16[esp] or eax, ecx add ebx, edx xor eax, ebp mov edx, -1 rol ecx, 10 lea ebx, DWORD PTR 1352829926[eax*1+ebx] sub edx, ecx rol ebx, 5 add ebx, edi ; 88 mov eax, DWORD PTR 52[esp] or edx, ebp add edi, eax xor edx, ebx mov eax, -1 rol ebp, 10 lea edi, DWORD PTR 1352829926[edx*1+edi] sub eax, ebp rol edi, 7 add edi, esi ; 89 mov edx, DWORD PTR 24[esp] or eax, ebx add esi, edx xor eax, edi mov edx, -1 rol ebx, 10 lea esi, DWORD PTR 1352829926[eax*1+esi] sub edx, ebx rol esi, 7 add esi, ecx ; 90 mov eax, DWORD PTR 60[esp] or edx, edi add ecx, eax xor edx, esi mov eax, -1 rol edi, 10 lea ecx, DWORD PTR 1352829926[edx*1+ecx] sub eax, edi rol ecx, 8 add ecx, ebp ; 91 mov edx, DWORD PTR 32[esp] or eax, esi add ebp, edx xor eax, ecx mov edx, -1 rol esi, 10 lea ebp, DWORD PTR 1352829926[eax*1+ebp] sub edx, esi rol ebp, 11 add ebp, ebx ; 92 mov eax, DWORD PTR 4[esp] or edx, ecx add ebx, eax xor edx, ebp mov eax, -1 rol ecx, 10 lea ebx, DWORD PTR 1352829926[edx*1+ebx] sub eax, ecx rol ebx, 14 add ebx, edi ; 93 mov edx, DWORD PTR 40[esp] or eax, ebp add edi, edx xor eax, ebx mov edx, -1 rol ebp, 10 lea edi, DWORD PTR 1352829926[eax*1+edi] sub edx, ebp rol edi, 14 add edi, esi ; 94 mov eax, DWORD PTR 12[esp] or edx, ebx add esi, eax xor edx, edi mov eax, -1 rol ebx, 10 lea esi, DWORD PTR 1352829926[edx*1+esi] sub eax, ebx rol esi, 12 add esi, ecx ; 95 mov edx, DWORD PTR 48[esp] or eax, edi add ecx, edx xor eax, esi mov edx, -1 rol edi, 10 lea ecx, DWORD PTR 1352829926[eax*1+ecx] mov eax, edi rol ecx, 6 add ecx, ebp ; 96 sub edx, edi and eax, ecx and edx, esi or edx, eax mov eax, DWORD PTR 24[esp] rol esi, 10 lea ebp, DWORD PTR 1548603684[edx+ebp] mov edx, -1 add ebp, eax mov eax, esi rol ebp, 9 add ebp, ebx ; 97 sub edx, esi and eax, ebp and edx, ecx or edx, eax mov eax, DWORD PTR 44[esp] rol ecx, 10 lea ebx, DWORD PTR 1548603684[edx+ebx] mov edx, -1 add ebx, eax mov eax, ecx rol ebx, 13 add ebx, edi ; 98 sub edx, ecx and eax, ebx and edx, ebp or edx, eax mov eax, DWORD PTR 12[esp] rol ebp, 10 lea edi, DWORD PTR 1548603684[edx+edi] mov edx, -1 add edi, eax mov eax, ebp rol edi, 15 add edi, esi ; 99 sub edx, ebp and eax, edi and edx, ebx or edx, eax mov eax, DWORD PTR 28[esp] rol ebx, 10 lea esi, DWORD PTR 1548603684[edx+esi] mov edx, -1 add esi, eax mov eax, ebx rol esi, 7 add esi, ecx ; 100 sub edx, ebx and eax, esi and edx, edi or edx, eax mov eax, DWORD PTR [esp] rol edi, 10 lea ecx, DWORD PTR 1548603684[edx+ecx] mov edx, -1 add ecx, eax mov eax, edi rol ecx, 12 add ecx, ebp ; 101 sub edx, edi and eax, ecx and edx, esi or edx, eax mov eax, DWORD PTR 52[esp] rol esi, 10 lea ebp, DWORD PTR 1548603684[edx+ebp] mov edx, -1 add ebp, eax mov eax, esi rol ebp, 8 add ebp, ebx ; 102 sub edx, esi and eax, ebp and edx, ecx or edx, eax mov eax, DWORD PTR 20[esp] rol ecx, 10 lea ebx, DWORD PTR 1548603684[edx+ebx] mov edx, -1 add ebx, eax mov eax, ecx rol ebx, 9 add ebx, edi ; 103 sub edx, ecx and eax, ebx and edx, ebp or edx, eax mov eax, DWORD PTR 40[esp] rol ebp, 10 lea edi, DWORD PTR 1548603684[edx+edi] mov edx, -1 add edi, eax mov eax, ebp rol edi, 11 add edi, esi ; 104 sub edx, ebp and eax, edi and edx, ebx or edx, eax mov eax, DWORD PTR 56[esp] rol ebx, 10 lea esi, DWORD PTR 1548603684[edx+esi] mov edx, -1 add esi, eax mov eax, ebx rol esi, 7 add esi, ecx ; 105 sub edx, ebx and eax, esi and edx, edi or edx, eax mov eax, DWORD PTR 60[esp] rol edi, 10 lea ecx, DWORD PTR 1548603684[edx+ecx] mov edx, -1 add ecx, eax mov eax, edi rol ecx, 7 add ecx, ebp ; 106 sub edx, edi and eax, ecx and edx, esi or edx, eax mov eax, DWORD PTR 32[esp] rol esi, 10 lea ebp, DWORD PTR 1548603684[edx+ebp] mov edx, -1 add ebp, eax mov eax, esi rol ebp, 12 add ebp, ebx ; 107 sub edx, esi and eax, ebp and edx, ecx or edx, eax mov eax, DWORD PTR 48[esp] rol ecx, 10 lea ebx, DWORD PTR 1548603684[edx+ebx] mov edx, -1 add ebx, eax mov eax, ecx rol ebx, 7 add ebx, edi ; 108 sub edx, ecx and eax, ebx and edx, ebp or edx, eax mov eax, DWORD PTR 16[esp] rol ebp, 10 lea edi, DWORD PTR 1548603684[edx+edi] mov edx, -1 add edi, eax mov eax, ebp rol edi, 6 add edi, esi ; 109 sub edx, ebp and eax, edi and edx, ebx or edx, eax mov eax, DWORD PTR 36[esp] rol ebx, 10 lea esi, DWORD PTR 1548603684[edx+esi] mov edx, -1 add esi, eax mov eax, ebx rol esi, 15 add esi, ecx ; 110 sub edx, ebx and eax, esi and edx, edi or edx, eax mov eax, DWORD PTR 4[esp] rol edi, 10 lea ecx, DWORD PTR 1548603684[edx+ecx] mov edx, -1 add ecx, eax mov eax, edi rol ecx, 13 add ecx, ebp ; 111 sub edx, edi and eax, ecx and edx, esi or edx, eax mov eax, DWORD PTR 8[esp] rol esi, 10 lea ebp, DWORD PTR 1548603684[edx+ebp] mov edx, -1 add ebp, eax sub edx, ecx rol ebp, 11 add ebp, ebx ; 112 mov eax, DWORD PTR 60[esp] or edx, ebp add ebx, eax xor edx, esi mov eax, -1 rol ecx, 10 lea ebx, DWORD PTR 1836072691[edx*1+ebx] sub eax, ebp rol ebx, 9 add ebx, edi ; 113 mov edx, DWORD PTR 20[esp] or eax, ebx add edi, edx xor eax, ecx mov edx, -1 rol ebp, 10 lea edi, DWORD PTR 1836072691[eax*1+edi] sub edx, ebx rol edi, 7 add edi, esi ; 114 mov eax, DWORD PTR 4[esp] or edx, edi add esi, eax xor edx, ebp mov eax, -1 rol ebx, 10 lea esi, DWORD PTR 1836072691[edx*1+esi] sub eax, edi rol esi, 15 add esi, ecx ; 115 mov edx, DWORD PTR 12[esp] or eax, esi add ecx, edx xor eax, ebx mov edx, -1 rol edi, 10 lea ecx, DWORD PTR 1836072691[eax*1+ecx] sub edx, esi rol ecx, 11 add ecx, ebp ; 116 mov eax, DWORD PTR 28[esp] or edx, ecx add ebp, eax xor edx, edi mov eax, -1 rol esi, 10 lea ebp, DWORD PTR 1836072691[edx*1+ebp] sub eax, ecx rol ebp, 8 add ebp, ebx ; 117 mov edx, DWORD PTR 56[esp] or eax, ebp add ebx, edx xor eax, esi mov edx, -1 rol ecx, 10 lea ebx, DWORD PTR 1836072691[eax*1+ebx] sub edx, ebp rol ebx, 6 add ebx, edi ; 118 mov eax, DWORD PTR 24[esp] or edx, ebx add edi, eax xor edx, ecx mov eax, -1 rol ebp, 10 lea edi, DWORD PTR 1836072691[edx*1+edi] sub eax, ebx rol edi, 6 add edi, esi ; 119 mov edx, DWORD PTR 36[esp] or eax, edi add esi, edx xor eax, ebp mov edx, -1 rol ebx, 10 lea esi, DWORD PTR 1836072691[eax*1+esi] sub edx, edi rol esi, 14 add esi, ecx ; 120 mov eax, DWORD PTR 44[esp] or edx, esi add ecx, eax xor edx, ebx mov eax, -1 rol edi, 10 lea ecx, DWORD PTR 1836072691[edx*1+ecx] sub eax, esi rol ecx, 12 add ecx, ebp ; 121 mov edx, DWORD PTR 32[esp] or eax, ecx add ebp, edx xor eax, edi mov edx, -1 rol esi, 10 lea ebp, DWORD PTR 1836072691[eax*1+ebp] sub edx, ecx rol ebp, 13 add ebp, ebx ; 122 mov eax, DWORD PTR 48[esp] or edx, ebp add ebx, eax xor edx, esi mov eax, -1 rol ecx, 10 lea ebx, DWORD PTR 1836072691[edx*1+ebx] sub eax, ebp rol ebx, 5 add ebx, edi ; 123 mov edx, DWORD PTR 8[esp] or eax, ebx add edi, edx xor eax, ecx mov edx, -1 rol ebp, 10 lea edi, DWORD PTR 1836072691[eax*1+edi] sub edx, ebx rol edi, 14 add edi, esi ; 124 mov eax, DWORD PTR 40[esp] or edx, edi add esi, eax xor edx, ebp mov eax, -1 rol ebx, 10 lea esi, DWORD PTR 1836072691[edx*1+esi] sub eax, edi rol esi, 13 add esi, ecx ; 125 mov edx, DWORD PTR [esp] or eax, esi add ecx, edx xor eax, ebx mov edx, -1 rol edi, 10 lea ecx, DWORD PTR 1836072691[eax*1+ecx] sub edx, esi rol ecx, 13 add ecx, ebp ; 126 mov eax, DWORD PTR 16[esp] or edx, ecx add ebp, eax xor edx, edi mov eax, -1 rol esi, 10 lea ebp, DWORD PTR 1836072691[edx*1+ebp] sub eax, ecx rol ebp, 7 add ebp, ebx ; 127 mov edx, DWORD PTR 52[esp] or eax, ebp add ebx, edx xor eax, esi mov edx, DWORD PTR 32[esp] rol ecx, 10 lea ebx, DWORD PTR 1836072691[eax*1+ebx] mov eax, -1 rol ebx, 5 add ebx, edi ; 128 add edi, edx mov edx, ebp sub eax, ebx and edx, ebx and eax, ecx or edx, eax mov eax, DWORD PTR 24[esp] rol ebp, 10 lea edi, DWORD PTR 2053994217[edx*1+edi] mov edx, -1 rol edi, 15 add edi, esi ; 129 add esi, eax mov eax, ebx sub edx, edi and eax, edi and edx, ebp or eax, edx mov edx, DWORD PTR 16[esp] rol ebx, 10 lea esi, DWORD PTR 2053994217[eax*1+esi] mov eax, -1 rol esi, 5 add esi, ecx ; 130 add ecx, edx mov edx, edi sub eax, esi and edx, esi and eax, ebx or edx, eax mov eax, DWORD PTR 4[esp] rol edi, 10 lea ecx, DWORD PTR 2053994217[edx*1+ecx] mov edx, -1 rol ecx, 8 add ecx, ebp ; 131 add ebp, eax mov eax, esi sub edx, ecx and eax, ecx and edx, edi or eax, edx mov edx, DWORD PTR 12[esp] rol esi, 10 lea ebp, DWORD PTR 2053994217[eax*1+ebp] mov eax, -1 rol ebp, 11 add ebp, ebx ; 132 add ebx, edx mov edx, ecx sub eax, ebp and edx, ebp and eax, esi or edx, eax mov eax, DWORD PTR 44[esp] rol ecx, 10 lea ebx, DWORD PTR 2053994217[edx*1+ebx] mov edx, -1 rol ebx, 14 add ebx, edi ; 133 add edi, eax mov eax, ebp sub edx, ebx and eax, ebx and edx, ecx or eax, edx mov edx, DWORD PTR 60[esp] rol ebp, 10 lea edi, DWORD PTR 2053994217[eax*1+edi] mov eax, -1 rol edi, 14 add edi, esi ; 134 add esi, edx mov edx, ebx sub eax, edi and edx, edi and eax, ebp or edx, eax mov eax, DWORD PTR [esp] rol ebx, 10 lea esi, DWORD PTR 2053994217[edx*1+esi] mov edx, -1 rol esi, 6 add esi, ecx ; 135 add ecx, eax mov eax, edi sub edx, esi and eax, esi and edx, ebx or eax, edx mov edx, DWORD PTR 20[esp] rol edi, 10 lea ecx, DWORD PTR 2053994217[eax*1+ecx] mov eax, -1 rol ecx, 14 add ecx, ebp ; 136 add ebp, edx mov edx, esi sub eax, ecx and edx, ecx and eax, edi or edx, eax mov eax, DWORD PTR 48[esp] rol esi, 10 lea ebp, DWORD PTR 2053994217[edx*1+ebp] mov edx, -1 rol ebp, 6 add ebp, ebx ; 137 add ebx, eax mov eax, ecx sub edx, ebp and eax, ebp and edx, esi or eax, edx mov edx, DWORD PTR 8[esp] rol ecx, 10 lea ebx, DWORD PTR 2053994217[eax*1+ebx] mov eax, -1 rol ebx, 9 add ebx, edi ; 138 add edi, edx mov edx, ebp sub eax, ebx and edx, ebx and eax, ecx or edx, eax mov eax, DWORD PTR 52[esp] rol ebp, 10 lea edi, DWORD PTR 2053994217[edx*1+edi] mov edx, -1 rol edi, 12 add edi, esi ; 139 add esi, eax mov eax, ebx sub edx, edi and eax, edi and edx, ebp or eax, edx mov edx, DWORD PTR 36[esp] rol ebx, 10 lea esi, DWORD PTR 2053994217[eax*1+esi] mov eax, -1 rol esi, 9 add esi, ecx ; 140 add ecx, edx mov edx, edi sub eax, esi and edx, esi and eax, ebx or edx, eax mov eax, DWORD PTR 28[esp] rol edi, 10 lea ecx, DWORD PTR 2053994217[edx*1+ecx] mov edx, -1 rol ecx, 12 add ecx, ebp ; 141 add ebp, eax mov eax, esi sub edx, ecx and eax, ecx and edx, edi or eax, edx mov edx, DWORD PTR 40[esp] rol esi, 10 lea ebp, DWORD PTR 2053994217[eax*1+ebp] mov eax, -1 rol ebp, 5 add ebp, ebx ; 142 add ebx, edx mov edx, ecx sub eax, ebp and edx, ebp and eax, esi or edx, eax mov eax, DWORD PTR 56[esp] rol ecx, 10 lea ebx, DWORD PTR 2053994217[edx*1+ebx] mov edx, -1 rol ebx, 15 add ebx, edi ; 143 add edi, eax mov eax, ebp sub edx, ebx and eax, ebx and edx, ecx or edx, eax mov eax, ebx rol ebp, 10 lea edi, DWORD PTR 2053994217[edx*1+edi] xor eax, ebp rol edi, 8 add edi, esi ; 144 mov edx, DWORD PTR 48[esp] xor eax, edi add esi, edx rol ebx, 10 add esi, eax mov eax, edi rol esi, 8 add esi, ecx ; 145 xor eax, ebx mov edx, DWORD PTR 60[esp] xor eax, esi add ecx, eax mov eax, esi rol edi, 10 add ecx, edx xor eax, edi rol ecx, 5 add ecx, ebp ; 146 mov edx, DWORD PTR 40[esp] xor eax, ecx add ebp, edx rol esi, 10 add ebp, eax mov eax, ecx rol ebp, 12 add ebp, ebx ; 147 xor eax, esi mov edx, DWORD PTR 16[esp] xor eax, ebp add ebx, eax mov eax, ebp rol ecx, 10 add ebx, edx xor eax, ecx rol ebx, 9 add ebx, edi ; 148 mov edx, DWORD PTR 4[esp] xor eax, ebx add edi, edx rol ebp, 10 add edi, eax mov eax, ebx rol edi, 12 add edi, esi ; 149 xor eax, ebp mov edx, DWORD PTR 20[esp] xor eax, edi add esi, eax mov eax, edi rol ebx, 10 add esi, edx xor eax, ebx rol esi, 5 add esi, ecx ; 150 mov edx, DWORD PTR 32[esp] xor eax, esi add ecx, edx rol edi, 10 add ecx, eax mov eax, esi rol ecx, 14 add ecx, ebp ; 151 xor eax, edi mov edx, DWORD PTR 28[esp] xor eax, ecx add ebp, eax mov eax, ecx rol esi, 10 add ebp, edx xor eax, esi rol ebp, 6 add ebp, ebx ; 152 mov edx, DWORD PTR 24[esp] xor eax, ebp add ebx, edx rol ecx, 10 add ebx, eax mov eax, ebp rol ebx, 8 add ebx, edi ; 153 xor eax, ecx mov edx, DWORD PTR 8[esp] xor eax, ebx add edi, eax mov eax, ebx rol ebp, 10 add edi, edx xor eax, ebp rol edi, 13 add edi, esi ; 154 mov edx, DWORD PTR 52[esp] xor eax, edi add esi, edx rol ebx, 10 add esi, eax mov eax, edi rol esi, 6 add esi, ecx ; 155 xor eax, ebx mov edx, DWORD PTR 56[esp] xor eax, esi add ecx, eax mov eax, esi rol edi, 10 add ecx, edx xor eax, edi rol ecx, 5 add ecx, ebp ; 156 mov edx, DWORD PTR [esp] xor eax, ecx add ebp, edx rol esi, 10 add ebp, eax mov eax, ecx rol ebp, 15 add ebp, ebx ; 157 xor eax, esi mov edx, DWORD PTR 12[esp] xor eax, ebp add ebx, eax mov eax, ebp rol ecx, 10 add ebx, edx xor eax, ecx rol ebx, 13 add ebx, edi ; 158 mov edx, DWORD PTR 36[esp] xor eax, ebx add edi, edx rol ebp, 10 add edi, eax mov eax, ebx rol edi, 11 add edi, esi ; 159 xor eax, ebp mov edx, DWORD PTR 44[esp] xor eax, edi add esi, eax rol ebx, 10 add esi, edx mov edx, DWORD PTR 128[esp] rol esi, 11 add esi, ecx mov eax, DWORD PTR 4[edx] add ebx, eax mov eax, DWORD PTR 72[esp] add ebx, eax mov eax, DWORD PTR 8[edx] add ebp, eax mov eax, DWORD PTR 76[esp] add ebp, eax mov eax, DWORD PTR 12[edx] add ecx, eax mov eax, DWORD PTR 80[esp] add ecx, eax mov eax, DWORD PTR 16[edx] add esi, eax mov eax, DWORD PTR 64[esp] add esi, eax mov eax, DWORD PTR [edx] add edi, eax mov eax, DWORD PTR 68[esp] add edi, eax mov eax, DWORD PTR 136[esp] mov DWORD PTR [edx],ebx mov DWORD PTR 4[edx],ebp mov DWORD PTR 8[edx],ecx sub eax, 1 mov DWORD PTR 12[edx],esi mov DWORD PTR 16[edx],edi jle $L001get_out mov DWORD PTR 136[esp],eax mov edi, ecx mov eax, DWORD PTR 132[esp] mov ecx, ebx add eax, 64 mov esi, ebp mov DWORD PTR 132[esp],eax jmp $L000start $L001get_out: add esp, 108 pop ebx pop ebp pop edi pop esi ret _ripemd160_block_asm_host_order ENDP _TEXT ENDS END
ch10/HelloNew.asm
William0Friend/my_masm
0
19607
; Macro Functions (HelloNew.asm) ; Shows how to use macros to configure ; a program to run on multiple platforms. INCLUDE Macros.inc IF IsDefined( RealMode ) INCLUDE Irvine16.inc ELSE INCLUDE Irvine32.inc ENDIF .code main PROC Startup mWrite <"This program can be assembled to run ",0dh,0ah> mWrite <"in both Real mode and Protected mode.",0dh,0ah> exit main ENDP END main
source/image/required/s-valllu.ads
ytomino/drake
33
3008
<filename>source/image/required/s-valllu.ads pragma License (Unrestricted); -- implementation unit required by compiler with System.Unsigned_Types; package System.Val_LLU is pragma Pure; -- required for Modular'Value by compiler (s-valllu.ads) function Value_Long_Long_Unsigned (Str : String) return Unsigned_Types.Long_Long_Unsigned; end System.Val_LLU;
Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca_notsx.log_14_666.asm
ljhsiun2/medusa
9
94651
<filename>Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca_notsx.log_14_666.asm .global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r14 push %r9 push %rbx push %rcx push %rdx lea addresses_A_ht+0x1ac0b, %r9 nop sub $17629, %rcx mov (%r9), %rdx nop nop nop cmp %r14, %r14 lea addresses_A_ht+0x1280b, %r9 nop nop nop nop nop and $28278, %r10 vmovups (%r9), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $0, %xmm2, %rbx nop dec %rdx lea addresses_normal_ht+0x500b, %r10 nop nop nop nop nop sub %r13, %r13 movb $0x61, (%r10) nop nop nop add %r9, %r9 lea addresses_WC_ht+0xb, %rbx nop nop add $12612, %r13 mov (%rbx), %r9w nop nop nop nop nop and $22152, %r14 lea addresses_UC_ht+0x1dc6b, %r10 nop nop nop add $34678, %rbx movb $0x61, (%r10) nop nop nop nop nop sub %r9, %r9 pop %rdx pop %rcx pop %rbx pop %r9 pop %r14 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r9 push %rbp push %rcx push %rdi push %rdx push %rsi // Store lea addresses_WC+0x1f30b, %rcx clflush (%rcx) nop nop nop nop nop dec %rsi mov $0x5152535455565758, %rdx movq %rdx, (%rcx) nop nop nop sub $5332, %rdx // Store lea addresses_UC+0xd40b, %rbp nop nop nop add $3826, %r11 mov $0x5152535455565758, %rsi movq %rsi, %xmm4 vmovups %ymm4, (%rbp) add $45025, %rdi // Faulty Load lea addresses_US+0x1d40b, %rsi nop nop nop and $31822, %rdx vmovups (%rsi), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $1, %xmm4, %r11 lea oracles, %r9 and $0xff, %r11 shlq $12, %r11 mov (%r9,%r11,1), %r11 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r9 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 8, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 10, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'} {'00': 14} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
attic2/toySQL.g4
mooseman/toySQL
4
692
// This grammar is released to the public domain. // "Share and enjoy...." :) grammar toySQL; import toySQL_Tokens; stmt : SELECT what_to_select FROM table_stmt (where_stmt) Semi ; SELECT : 'select' ; FROM : 'from' ; AS : 'as' ; what_to_select : Star | (other_stmt)* ; Star : '*' ; other_stmt : field_stmt | value_stmt | other_stmt Comma ( field_stmt | value_stmt ) ; field_stmt : field | field AS alias ; value_stmt : value AS alias ; field : Identifier ; alias : Identifier ; value : Number | String_Literal ; table_stmt : Identifier ; where_stmt : WHERE compare_stmt ; compare_stmt : ( field | value ) RelOp ( field | value ) | compare_stmt OR compare_stmt | compare_stmt AND compare_stmt ;
programs/oeis/126/A126867.asm
neoneye/loda
22
85428
<reponame>neoneye/loda ; A126867: Largest even semiprime <= n^2. ; 4,6,14,22,34,46,62,74,94,118,142,166,194,218,254,278,314,358,398,422,482,526,566,622,674,718,778,838,898,958,1018,1082,1154,1214,1294,1366,1438,1514,1594,1678,1762,1838,1934,2018,2102,2206,2302,2386,2498,2594,2654,2798,2906,3022,3134,3242,3338,3466,3578,3694,3826,3958,4078,4222,4322,4486,4622,4754,4894,5006,5182,5326,5462,5606,5774,5926,6082,6238,6382,6542,6722,6866,7054,7214,7394,7558,7726,7894,8098,8278,8462,8594,8818,9014,9206,9406,9602,9778,9998,10198 add $0,2 pow $0,2 div $0,4 mul $0,2 seq $0,136548 ; a(n) = max {k >= 1 | sigma(k) <= n}. mul $0,2
Definition/LogicalRelation/Weakening.agda
loic-p/logrel-mltt
0
7474
{-# OPTIONS --without-K --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Weakening {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped as U hiding (wk) open import Definition.Untyped.Properties open import Definition.Typed open import Definition.Typed.Weakening as T hiding (wk; wkEq; wkTerm; wkEqTerm) open import Definition.LogicalRelation open import Definition.LogicalRelation.Irrelevance open import Tools.Embedding open import Tools.Product import Tools.PropositionalEquality as PE -- Weakening of neutrals in WHNF wkTermNe : ∀ {ρ Γ Δ k A} → ρ ∷ Δ ⊆ Γ → (⊢Δ : ⊢ Δ) → Γ ⊩neNf k ∷ A → Δ ⊩neNf U.wk ρ k ∷ U.wk ρ A wkTermNe {ρ} [ρ] ⊢Δ (neNfₜ neK ⊢k k≡k) = neNfₜ (wkNeutral ρ neK) (T.wkTerm [ρ] ⊢Δ ⊢k) (~-wk [ρ] ⊢Δ k≡k) wkEqTermNe : ∀ {ρ Γ Δ k k′ A} → ρ ∷ Δ ⊆ Γ → (⊢Δ : ⊢ Δ) → Γ ⊩neNf k ≡ k′ ∷ A → Δ ⊩neNf U.wk ρ k ≡ U.wk ρ k′ ∷ U.wk ρ A wkEqTermNe {ρ} [ρ] ⊢Δ (neNfₜ₌ neK neM k≡m) = neNfₜ₌ (wkNeutral ρ neK) (wkNeutral ρ neM) (~-wk [ρ] ⊢Δ k≡m) -- Weakening of reducible natural numbers mutual wkTermℕ : ∀ {ρ Γ Δ n} → ρ ∷ Δ ⊆ Γ → (⊢Δ : ⊢ Δ) → _⊩ℕ_∷ℕ Γ n → _⊩ℕ_∷ℕ Δ (U.wk ρ n) wkTermℕ {ρ} [ρ] ⊢Δ (ℕₜ n d n≡n prop) = ℕₜ (U.wk ρ n) (wkRed:*:Term [ρ] ⊢Δ d) (≅ₜ-wk [ρ] ⊢Δ n≡n) (wkNatural-prop [ρ] ⊢Δ prop) wkNatural-prop : ∀ {ρ Γ Δ n} → ρ ∷ Δ ⊆ Γ → (⊢Δ : ⊢ Δ) → Natural-prop Γ n → Natural-prop Δ (U.wk ρ n) wkNatural-prop ρ ⊢Δ (sucᵣ n) = sucᵣ (wkTermℕ ρ ⊢Δ n) wkNatural-prop ρ ⊢Δ zeroᵣ = zeroᵣ wkNatural-prop ρ ⊢Δ (ne nf) = ne (wkTermNe ρ ⊢Δ nf) mutual wkEqTermℕ : ∀ {ρ Γ Δ t u} → ρ ∷ Δ ⊆ Γ → (⊢Δ : ⊢ Δ) → _⊩ℕ_≡_∷ℕ Γ t u → _⊩ℕ_≡_∷ℕ Δ (U.wk ρ t) (U.wk ρ u) wkEqTermℕ {ρ} [ρ] ⊢Δ (ℕₜ₌ k k′ d d′ t≡u prop) = ℕₜ₌ (U.wk ρ k) (U.wk ρ k′) (wkRed:*:Term [ρ] ⊢Δ d) (wkRed:*:Term [ρ] ⊢Δ d′) (≅ₜ-wk [ρ] ⊢Δ t≡u) (wk[Natural]-prop [ρ] ⊢Δ prop) wk[Natural]-prop : ∀ {ρ Γ Δ n n′} → ρ ∷ Δ ⊆ Γ → (⊢Δ : ⊢ Δ) → [Natural]-prop Γ n n′ → [Natural]-prop Δ (U.wk ρ n) (U.wk ρ n′) wk[Natural]-prop ρ ⊢Δ (sucᵣ [n≡n′]) = sucᵣ (wkEqTermℕ ρ ⊢Δ [n≡n′]) wk[Natural]-prop ρ ⊢Δ zeroᵣ = zeroᵣ wk[Natural]-prop ρ ⊢Δ (ne x) = ne (wkEqTermNe ρ ⊢Δ x) -- Weakening of the logical relation wk : ∀ {ρ Γ Δ A l} → ρ ∷ Δ ⊆ Γ → ⊢ Δ → Γ ⊩⟨ l ⟩ A → Δ ⊩⟨ l ⟩ U.wk ρ A wk ρ ⊢Δ (Uᵣ′ l′ l< ⊢Γ) = Uᵣ′ l′ l< ⊢Δ wk ρ ⊢Δ (ℕᵣ D) = ℕᵣ (wkRed:*: ρ ⊢Δ D) wk {ρ} [ρ] ⊢Δ (ne′ K D neK K≡K) = ne′ (U.wk ρ K) (wkRed:*: [ρ] ⊢Δ D) (wkNeutral ρ neK) (~-wk [ρ] ⊢Δ K≡K) wk {ρ} {Γ} {Δ} {A} {l} [ρ] ⊢Δ (Πᵣ′ F G D ⊢F ⊢G A≡A [F] [G] G-ext) = let ⊢ρF = T.wk [ρ] ⊢Δ ⊢F [F]′ : ∀ {ρ ρ′ E} ([ρ] : ρ ∷ E ⊆ Δ) ([ρ′] : ρ′ ∷ Δ ⊆ Γ) (⊢E : ⊢ E) → E ⊩⟨ l ⟩ U.wk ρ (U.wk ρ′ F) [F]′ {ρ} {ρ′} [ρ] [ρ′] ⊢E = irrelevance′ (PE.sym (wk-comp ρ ρ′ F)) ([F] ([ρ] •ₜ [ρ′]) ⊢E) [a]′ : ∀ {ρ ρ′ E a} ([ρ] : ρ ∷ E ⊆ Δ) ([ρ′] : ρ′ ∷ Δ ⊆ Γ) (⊢E : ⊢ E) ([a] : E ⊩⟨ l ⟩ a ∷ U.wk ρ (U.wk ρ′ F) / [F]′ [ρ] [ρ′] ⊢E) → E ⊩⟨ l ⟩ a ∷ U.wk (ρ • ρ′) F / [F] ([ρ] •ₜ [ρ′]) ⊢E [a]′ {ρ} {ρ′} [ρ] [ρ′] ⊢E [a] = irrelevanceTerm′ (wk-comp ρ ρ′ F) ([F]′ [ρ] [ρ′] ⊢E) ([F] ([ρ] •ₜ [ρ′]) ⊢E) [a] [G]′ : ∀ {ρ ρ′ E a} ([ρ] : ρ ∷ E ⊆ Δ) ([ρ′] : ρ′ ∷ Δ ⊆ Γ) (⊢E : ⊢ E) ([a] : E ⊩⟨ l ⟩ a ∷ U.wk ρ (U.wk ρ′ F) / [F]′ [ρ] [ρ′] ⊢E) → E ⊩⟨ l ⟩ U.wk (lift (ρ • ρ′)) G [ a ] [G]′ η η′ ⊢E [a] = [G] (η •ₜ η′) ⊢E ([a]′ η η′ ⊢E [a]) in Πᵣ′ (U.wk ρ F) (U.wk (lift ρ) G) (T.wkRed:*: [ρ] ⊢Δ D) ⊢ρF (T.wk (lift [ρ]) (⊢Δ ∙ ⊢ρF) ⊢G) (≅-wk [ρ] ⊢Δ A≡A) (λ {ρ₁} [ρ₁] ⊢Δ₁ → irrelevance′ (PE.sym (wk-comp ρ₁ ρ F)) ([F] ([ρ₁] •ₜ [ρ]) ⊢Δ₁)) (λ {ρ₁} [ρ₁] ⊢Δ₁ [a] → irrelevance′ (wk-comp-subst ρ₁ ρ G) ([G]′ [ρ₁] [ρ] ⊢Δ₁ [a])) (λ {ρ₁} [ρ₁] ⊢Δ₁ [a] [b] [a≡b] → let [a≡b]′ = irrelevanceEqTerm′ (wk-comp ρ₁ ρ F) ([F]′ [ρ₁] [ρ] ⊢Δ₁) ([F] ([ρ₁] •ₜ [ρ]) ⊢Δ₁) [a≡b] in irrelevanceEq″ (wk-comp-subst ρ₁ ρ G) (wk-comp-subst ρ₁ ρ G) ([G]′ [ρ₁] [ρ] ⊢Δ₁ [a]) (irrelevance′ (wk-comp-subst ρ₁ ρ G) ([G]′ [ρ₁] [ρ] ⊢Δ₁ [a])) (G-ext ([ρ₁] •ₜ [ρ]) ⊢Δ₁ ([a]′ [ρ₁] [ρ] ⊢Δ₁ [a]) ([a]′ [ρ₁] [ρ] ⊢Δ₁ [b]) [a≡b]′)) wk ρ ⊢Δ (emb′ 0<1 x) = emb′ 0<1 (wk ρ ⊢Δ x) wkEq : ∀ {ρ Γ Δ A B l} → ([ρ] : ρ ∷ Δ ⊆ Γ) (⊢Δ : ⊢ Δ) ([A] : Γ ⊩⟨ l ⟩ A) → Γ ⊩⟨ l ⟩ A ≡ B / [A] → Δ ⊩⟨ l ⟩ U.wk ρ A ≡ U.wk ρ B / wk [ρ] ⊢Δ [A] wkEq ρ ⊢Δ (Uᵣ′ _ _ _) (U₌ PE.refl) = (U₌ PE.refl) wkEq ρ ⊢Δ (ℕᵣ D) (ιx (ℕ₌ A≡B)) = ιx (ℕ₌ (wkRed* ρ ⊢Δ A≡B)) wkEq {ρ} [ρ] ⊢Δ (ne′ _ _ _ _) (ιx (ne₌ M D′ neM K≡M)) = ιx (ne₌ (U.wk ρ M) (wkRed:*: [ρ] ⊢Δ D′) (wkNeutral ρ neM) (~-wk [ρ] ⊢Δ K≡M)) wkEq {ρ} [ρ] ⊢Δ (Πᵣ′ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Π₌ F′ G′ D′ A≡B [F≡F′] [G≡G′]) = Π₌ (U.wk ρ F′) (U.wk (lift ρ) G′) (T.wkRed* [ρ] ⊢Δ D′) (≅-wk [ρ] ⊢Δ A≡B) (λ {ρ₁} [ρ₁] ⊢Δ₁ → irrelevanceEq″ (PE.sym (wk-comp ρ₁ ρ F)) (PE.sym (wk-comp ρ₁ ρ F′)) ([F] ([ρ₁] •ₜ [ρ]) ⊢Δ₁) (irrelevance′ (PE.sym (wk-comp ρ₁ ρ F)) ([F] ([ρ₁] •ₜ [ρ]) ⊢Δ₁)) ([F≡F′] ([ρ₁] •ₜ [ρ]) ⊢Δ₁)) (λ {ρ₁} [ρ₁] ⊢Δ₁ [a] → let [a]′ = irrelevanceTerm′ (wk-comp ρ₁ ρ F) (irrelevance′ (PE.sym (wk-comp ρ₁ ρ F)) ([F] ([ρ₁] •ₜ [ρ]) ⊢Δ₁)) ([F] ([ρ₁] •ₜ [ρ]) ⊢Δ₁) [a] in irrelevanceEq″ (wk-comp-subst ρ₁ ρ G) (wk-comp-subst ρ₁ ρ G′) ([G] ([ρ₁] •ₜ [ρ]) ⊢Δ₁ [a]′) (irrelevance′ (wk-comp-subst ρ₁ ρ G) ([G] ([ρ₁] •ₜ [ρ]) ⊢Δ₁ [a]′)) ([G≡G′] ([ρ₁] •ₜ [ρ]) ⊢Δ₁ [a]′)) wkEq ρ ⊢Δ (emb′ 0<1 x) (ιx A≡B) = ιx (wkEq ρ ⊢Δ x A≡B) wkTerm : ∀ {ρ Γ Δ A t l} ([ρ] : ρ ∷ Δ ⊆ Γ) (⊢Δ : ⊢ Δ) ([A] : Γ ⊩⟨ l ⟩ A) → Γ ⊩⟨ l ⟩ t ∷ A / [A] → Δ ⊩⟨ l ⟩ U.wk ρ t ∷ U.wk ρ A / wk [ρ] ⊢Δ [A] wkTerm {ρ} [ρ] ⊢Δ (Uᵣ′ .⁰ 0<1 ⊢Γ) (Uₜ A d typeA A≡A [t]) = Uₜ (U.wk ρ A) (wkRed:*:Term [ρ] ⊢Δ d) (wkType ρ typeA) (≅ₜ-wk [ρ] ⊢Δ A≡A) (wk [ρ] ⊢Δ [t]) wkTerm ρ ⊢Δ (ℕᵣ D) (ιx [t]) = ιx (wkTermℕ ρ ⊢Δ [t]) -- wkTerm {ρ} [ρ] ⊢Δ (ne′ K D neK K≡K) (ιx (neₜ k d nf)) = ιx (neₜ (U.wk ρ k) (wkRed:*:Term [ρ] ⊢Δ d) (wkTermNe [ρ] ⊢Δ nf)) wkTerm {ρ} [ρ] ⊢Δ (Πᵣ′ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Πₜ f d funcF f≡f [f] [f]₁) = Πₜ (U.wk ρ f) (wkRed:*:Term [ρ] ⊢Δ d) (wkFunction ρ funcF) (≅ₜ-wk [ρ] ⊢Δ f≡f) (λ {ρ₁} [ρ₁] ⊢Δ₁ [a] [b] [a≡b] → let F-compEq = wk-comp ρ₁ ρ F G-compEq = wk-comp-subst ρ₁ ρ G [F]₁ = [F] ([ρ₁] •ₜ [ρ]) ⊢Δ₁ [F]₂ = irrelevance′ (PE.sym (wk-comp ρ₁ ρ F)) [F]₁ [a]′ = irrelevanceTerm′ F-compEq [F]₂ [F]₁ [a] [b]′ = irrelevanceTerm′ F-compEq [F]₂ [F]₁ [b] [G]₁ = [G] ([ρ₁] •ₜ [ρ]) ⊢Δ₁ [a]′ [G]₂ = irrelevance′ G-compEq [G]₁ [a≡b]′ = irrelevanceEqTerm′ F-compEq [F]₂ [F]₁ [a≡b] in irrelevanceEqTerm″ (PE.cong (λ x → x ∘ _) (PE.sym (wk-comp ρ₁ ρ _))) (PE.cong (λ x → x ∘ _) (PE.sym (wk-comp ρ₁ ρ _))) G-compEq [G]₁ [G]₂ ([f] ([ρ₁] •ₜ [ρ]) ⊢Δ₁ [a]′ [b]′ [a≡b]′)) (λ {ρ₁} [ρ₁] ⊢Δ₁ [a] → let [F]₁ = [F] ([ρ₁] •ₜ [ρ]) ⊢Δ₁ [F]₂ = irrelevance′ (PE.sym (wk-comp ρ₁ ρ F)) [F]₁ [a]′ = irrelevanceTerm′ (wk-comp ρ₁ ρ F) [F]₂ [F]₁ [a] [G]₁ = [G] ([ρ₁] •ₜ [ρ]) ⊢Δ₁ [a]′ [G]₂ = irrelevance′ (wk-comp-subst ρ₁ ρ G) [G]₁ in irrelevanceTerm″ (wk-comp-subst ρ₁ ρ G) (PE.cong (λ x → x ∘ _) (PE.sym (wk-comp ρ₁ ρ _))) [G]₁ [G]₂ ([f]₁ ([ρ₁] •ₜ [ρ]) ⊢Δ₁ [a]′)) wkTerm ρ ⊢Δ (emb′ 0<1 x) (ιx t) = ιx (wkTerm ρ ⊢Δ x t) wkEqTerm : ∀ {ρ Γ Δ A t u l} ([ρ] : ρ ∷ Δ ⊆ Γ) (⊢Δ : ⊢ Δ) ([A] : Γ ⊩⟨ l ⟩ A) → Γ ⊩⟨ l ⟩ t ≡ u ∷ A / [A] → Δ ⊩⟨ l ⟩ U.wk ρ t ≡ U.wk ρ u ∷ U.wk ρ A / wk [ρ] ⊢Δ [A] wkEqTerm {ρ} [ρ] ⊢Δ (Uᵣ′ .⁰ 0<1 ⊢Γ) (Uₜ₌ A B d d′ typeA typeB A≡B [t] [u] [t≡u]) = Uₜ₌ (U.wk ρ A) (U.wk ρ B) (wkRed:*:Term [ρ] ⊢Δ d) (wkRed:*:Term [ρ] ⊢Δ d′) (wkType ρ typeA) (wkType ρ typeB) (≅ₜ-wk [ρ] ⊢Δ A≡B) (wk [ρ] ⊢Δ [t]) (wk [ρ] ⊢Δ [u]) (wkEq [ρ] ⊢Δ [t] [t≡u]) wkEqTerm ρ ⊢Δ (ℕᵣ D) (ιx [t≡u]) = ιx (wkEqTermℕ ρ ⊢Δ [t≡u]) wkEqTerm {ρ} [ρ] ⊢Δ (ne′ K D neK K≡K) (ιx (neₜ₌ k m d d′ nf)) = ιx (neₜ₌ (U.wk ρ k) (U.wk ρ m) (wkRed:*:Term [ρ] ⊢Δ d) (wkRed:*:Term [ρ] ⊢Δ d′) (wkEqTermNe [ρ] ⊢Δ nf)) wkEqTerm {ρ} [ρ] ⊢Δ (Πᵣ′ F G D ⊢F ⊢G A≡A [F] [G] G-ext) (Πₜ₌ f g d d′ funcF funcG f≡g [t] [u] [f≡g]) = let [A] = Πᵣ′ F G D ⊢F ⊢G A≡A [F] [G] G-ext in Πₜ₌ (U.wk ρ f) (U.wk ρ g) (wkRed:*:Term [ρ] ⊢Δ d) (wkRed:*:Term [ρ] ⊢Δ d′) (wkFunction ρ funcF) (wkFunction ρ funcG) (≅ₜ-wk [ρ] ⊢Δ f≡g) (wkTerm [ρ] ⊢Δ [A] [t]) (wkTerm [ρ] ⊢Δ [A] [u]) (λ {ρ₁} [ρ₁] ⊢Δ₁ [a] → let [F]₁ = [F] ([ρ₁] •ₜ [ρ]) ⊢Δ₁ [F]₂ = irrelevance′ (PE.sym (wk-comp ρ₁ ρ F)) [F]₁ [a]′ = irrelevanceTerm′ (wk-comp ρ₁ ρ F) [F]₂ [F]₁ [a] [G]₁ = [G] ([ρ₁] •ₜ [ρ]) ⊢Δ₁ [a]′ [G]₂ = irrelevance′ (wk-comp-subst ρ₁ ρ G) [G]₁ in irrelevanceEqTerm″ (PE.cong (λ y → y ∘ _) (PE.sym (wk-comp ρ₁ ρ _))) (PE.cong (λ y → y ∘ _) (PE.sym (wk-comp ρ₁ ρ _))) (wk-comp-subst ρ₁ ρ G) [G]₁ [G]₂ ([f≡g] ([ρ₁] •ₜ [ρ]) ⊢Δ₁ [a]′)) wkEqTerm ρ ⊢Δ (emb′ 0<1 x) (ιx t≡u) = ιx (wkEqTerm ρ ⊢Δ x t≡u)
test/Succeed/RewritingEmptyPragma.agda
shlevy/agda
1,989
4990
-- Andreas, 2016-10-10, AIM XXIV {-# REWRITE #-} -- This should yield a warning.
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_20804_1726.asm
ljhsiun2/medusa
9
85435
<filename>Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_20804_1726.asm<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r8 push %rbp push %rcx push %rdi push %rsi lea addresses_A_ht+0x42de, %rcx nop nop inc %r8 vmovups (%rcx), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $1, %xmm4, %r12 nop nop nop and $1849, %rdi lea addresses_UC_ht+0x1cafe, %rdi nop nop inc %r10 movw $0x6162, (%rdi) nop nop nop nop nop and $19868, %r8 lea addresses_WT_ht+0x1c8de, %rsi lea addresses_WC_ht+0x1c8de, %rdi clflush (%rdi) nop nop nop add %r10, %r10 mov $86, %rcx rep movsl nop nop nop nop nop sub $35412, %r10 lea addresses_A_ht+0xe59e, %rbp nop nop nop nop nop sub %rdi, %rdi movl $0x61626364, (%rbp) cmp $45622, %r8 pop %rsi pop %rdi pop %rcx pop %rbp pop %r8 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r9 push %rbp push %rbx push %rcx push %rdi push %rsi // Store lea addresses_A+0x30de, %rsi xor $41089, %rbx mov $0x5152535455565758, %rbp movq %rbp, (%rsi) nop nop nop nop add $38069, %rbp // Store lea addresses_WT+0xe71e, %rcx nop nop and $26466, %rbx mov $0x5152535455565758, %rsi movq %rsi, %xmm0 movups %xmm0, (%rcx) nop nop add %rbx, %rbx // Faulty Load lea addresses_UC+0x38de, %rbx nop add $46524, %rdi movb (%rbx), %r10b lea oracles, %r9 and $0xff, %r10 shlq $12, %r10 mov (%r9,%r10,1), %r10 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 16, 'AVXalign': True, 'NT': True, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'37': 20804} 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 */
src/password_manager.ads
wiremoons/apass
3
30322
------------------------------------------------------------------------------- -- BUILD FILE : apass -- -- Description : A CLI password generator written in Ada. -- -- Author : <NAME> <<EMAIL>> -- -- License : MIT Open Source. -- ------------------------------------------------------------------------------- package Password_Manager is function Basic_Password (Number_Of_Words : Positive := 3) return String; -- obtain all lowercase password string of Number_Of_Words in length from Words_List_Array function Capitilised_Password (Number_Of_Words : Positive := 3) return String; -- obtain capitalised per word password string of Number_Of_Words in length from Words_List_Array function Get_Random_Number return String; -- obtain a random number in range Random_Num_Int as a trimmed string function Get_Random_Mark return String; -- obtain string (single punctuation character) from Marks_List_Array function Total_Words return String; -- obtain the total number of words in the Words_List_Array as trimmed string procedure Print_Password (Final_Password : String); -- outputs the provided password string string colour text if supported function Title_Case_String (Input_Str : String) return String; private --------------------------------------------------------------------------------------------------------------------- -- Mark_List_Array used to construct passwords into a randomly generated string. Private to ensure it is only -- -- accessed via functions in the Password_Manager package. -- --------------------------------------------------------------------------------------------------------------------- subtype Mark is String (1 .. 1); type Marks_List is array (Positive range <>) of Mark; Marks_List_Array : constant Marks_List := ("#", ".", ";", "@", "%", ":", "!", ">", "-", "<"); --------------------------------------------------------------------------------------------------------------------- -- Words_List_Array used to construct passwords into a randomly generated string. Private to ensure it is only -- -- accessed via functions in the Password_Manager package. -- --------------------------------------------------------------------------------------------------------------------- subtype Word is String (1 .. 3); type Word_List is array (Positive range <>) of Word; --!pp off -- disable gnatpp formatting of array block below Words_List_Array : constant Word_List := ("aah", "aal", "aas", "aba", "abb", "abo", "abs", "aby", "ace", "ach", "act", "add", "ado", "ads", "adz", "aff", "aft", "aga", "age", "ago", "ags", "aha", "ahi", "ahs", "aia", "aid", "ail", "aim", "ain", "air", "ais", "ait", "aka", "ake", "ala", "alb", "ale", "alf", "all", "alp", "als", "alt", "alu", "ama", "ame", "ami", "amp", "amu", "ana", "and", "ane", "ani", "ann", "ans", "ant", "any", "ape", "apo", "app", "apt", "arb", "arc", "ard", "are", "arf", "ark", "arm", "ars", "art", "ary", "ash", "ask", "asp", "ass", "ate", "ats", "att", "aua", "aue", "auf", "auk", "ava", "ave", "avo", "awa", "awe", "awk", "awl", "awn", "axe", "aye", "ays", "ayu", "azo", "baa", "bac", "bad", "bag", "bah", "bal", "bam", "ban", "bap", "bar", "bas", "bat", "bay", "bed", "bee", "beg", "bel", "ben", "bes", "bet", "bey", "bez", "bib", "bid", "big", "bin", "bio", "bis", "bit", "biz", "boa", "bob", "bod", "bog", "boh", "boi", "bok", "bon", "boo", "bop", "bor", "bos", "bot", "bow", "box", "boy", "bra", "bro", "brr", "bru", "bub", "bud", "bug", "bum", "bun", "bur", "bus", "but", "buy", "bye", "bys", "caa", "cab", "cad", "cag", "cam", "can", "cap", "car", "cat", "caw", "cay", "caz", "cee", "cel", "cep", "cha", "che", "chi", "cid", "cig", "cis", "cit", "cly", "cob", "cod", "cog", "col", "con", "coo", "cop", "cor", "cos", "cot", "cow", "cox", "coy", "coz", "cru", "cry", "cub", "cud", "cue", "cum", "cup", "cur", "cut", "cuz", "cwm", "dab", "dad", "dae", "dag", "dah", "dak", "dal", "dam", "dan", "dap", "das", "daw", "day", "deb", "dee", "def", "deg", "dei", "del", "den", "dev", "dew", "dex", "dey", "dib", "did", "die", "dif", "dig", "dim", "din", "dip", "dis", "dit", "div", "dob", "doc", "dod", "doe", "dof", "dog", "doh", "dol", "dom", "don", "doo", "dop", "dor", "dos", "dot", "dow", "doy", "dry", "dso", "dub", "dud", "due", "dug", "duh", "dui", "dun", "duo", "dup", "dux", "dye", "dzo", "ean", "ear", "eas", "eat", "eau", "ebb", "ech", "eco", "ecu", "edh", "eds", "eek", "eel", "een", "eff", "efs", "eft", "egg", "ego", "ehs", "eik", "eke", "eld", "elf", "elk", "ell", "elm", "els", "elt", "eme", "emo", "ems", "emu", "end", "ene", "eng", "ens", "eon", "era", "ere", "erf", "erg", "erk", "erm", "ern", "err", "ers", "ess", "est", "eta", "eth", "euk", "eve", "evo", "ewe", "ewk", "ewt", "exo", "eye", "faa", "fab", "fad", "fae", "fag", "fah", "fan", "fap", "far", "fas", "fat", "faw", "fax", "fay", "fed", "fee", "feg", "feh", "fem", "fen", "fer", "fes", "fet", "feu", "few", "fey", "fez", "fib", "fid", "fie", "fig", "fil", "fin", "fir", "fit", "fix", "fiz", "flu", "fly", "fob", "foe", "fog", "foh", "fon", "fop", "for", "fou", "fox", "foy", "fra", "fro", "fry", "fub", "fud", "fug", "fum", "fun", "fur", "gab", "gad", "gae", "gag", "gak", "gal", "gam", "gan", "gap", "gar", "gas", "gat", "gau", "gaw", "gay", "ged", "gee", "gel", "gem", "gen", "geo", "ger", "get", "gey", "ghi", "gib", "gid", "gie", "gif", "gig", "gin", "gio", "gip", "gis", "git", "gju", "gnu", "goa", "gob", "god", "goe", "gon", "goo", "gor", "gos", "got", "gov", "gox", "goy", "gub", "gue", "gul", "gum", "gun", "gup", "gur", "gus", "gut", "guv", "guy", "gym", "gyp", "had", "hae", "hag", "hah", "haj", "ham", "han", "hao", "hap", "has", "hat", "haw", "hay", "heh", "hem", "hen", "hep", "her", "hes", "het", "hew", "hex", "hey", "hic", "hid", "hie", "him", "hin", "hip", "his", "hit", "hmm", "hoa", "hob", "hoc", "hod", "hoe", "hog", "hoh", "hoi", "hom", "hon", "hoo", "hop", "hos", "hot", "how", "hox", "hoy", "hub", "hue", "hug", "huh", "hui", "hum", "hun", "hup", "hut", "hye", "hyp", "ice", "ich", "ick", "icy", "ide", "ids", "iff", "ifs", "igg", "ilk", "ill", "imp", "ing", "ink", "inn", "ins", "ion", "ios", "ire", "irk", "ish", "ism", "iso", "ita", "its", "ivy", "iwi", "jab", "jag", "jai", "jak", "jam", "jap", "jar", "jaw", "jay", "jee", "jet", "jeu", "jew", "jib", "jig", "jin", "jiz", "job", "joe", "jog", "jol", "jor", "jot", "jow", "joy", "jud", "jug", "jun", "jus", "jut", "kab", "kae", "kaf", "kai", "kak", "kam", "kas", "kat", "kaw", "kay", "kea", "keb", "ked", "kef", "keg", "ken", "kep", "ket", "kex", "key", "khi", "kid", "kif", "kin", "kip", "kir", "kis", "kit", "koa", "kob", "koi", "kon", "kop", "kor", "kos", "kow", "kue", "kye", "kyu", "lab", "lac", "lad", "lag", "lah", "lam", "lap", "lar", "las", "lat", "lav", "law", "lax", "lay", "lea", "led", "lee", "leg", "lei", "lek", "lep", "les", "let", "leu", "lev", "lew", "lex", "ley", "lez", "lib", "lid", "lie", "lig", "lin", "lip", "lis", "lit", "lob", "lod", "log", "loo", "lop", "lor", "los", "lot", "lou", "low", "lox", "loy", "lud", "lug", "lum", "lur", "luv", "lux", "luz", "lye", "lym", "maa", "mac", "mad", "mae", "mag", "mak", "mal", "mam", "man", "map", "mar", "mas", "mat", "maw", "max", "may", "med", "mee", "meg", "meh", "mel", "mem", "men", "mes", "met", "meu", "mew", "mho", "mib", "mic", "mid", "mig", "mil", "mim", "mir", "mis", "mix", "miz", "mna", "moa", "mob", "moc", "mod", "moe", "mog", "moi", "mol", "mom", "mon", "wit", "moo", "mop", "mor", "mos", "mot", "mou", "mow", "moy", "moz", "mud", "mug", "mum", "mun", "mus", "mut", "mux", "myc", "nab", "nae", "nag", "nah", "nam", "nan", "nap", "nas", "nat", "naw", "nay", "neb", "ned", "nee", "nef", "neg", "nek", "nep", "net", "new", "nib", "nid", "nie", "nil", "nim", "nip", "nis", "nit", "nix", "nob", "nod", "nog", "noh", "nom", "non", "noo", "nor", "nos", "not", "now", "nox", "noy", "nth", "nub", "nun", "nur", "nus", "nut", "nye", "nys", "oaf", "oak", "oar", "oat", "oba", "obe", "obi", "obo", "obs", "oca", "och", "oda", "odd", "ode", "ods", "oes", "off", "oft", "ohm", "oho", "ohs", "oik", "oil", "ois", "oka", "oke", "old", "ole", "olm", "oms", "one", "ono", "ons", "ony", "oof", "ooh", "oom", "oon", "oop", "oor", "oos", "oot", "ope", "ops", "opt", "ora", "orb", "orc", "ord", "ore", "orf", "ors", "ort", "ose", "oud", "ouk", "oup", "our", "ous", "out", "ova", "owe", "owl", "own", "owt", "oxo", "oxy", "oye", "oys", "pac", "pad", "pah", "pal", "pam", "pan", "pap", "par", "pas", "pat", "pav", "paw", "pax", "pay", "pea", "pec", "ped", "pee", "peg", "peh", "pel", "pen", "pep", "per", "pes", "pet", "pew", "phi", "pho", "pht", "pia", "pic", "pie", "pig", "pin", "pip", "pir", "pis", "pit", "piu", "pix", "plu", "ply", "poa", "pod", "poh", "poi", "pol", "pom", "poo", "pop", "pos", "pot", "pow", "pox", "poz", "pre", "pro", "pry", "psi", "pst", "pub", "pud", "pug", "puh", "pul", "pun", "pup", "pur", "pus", "put", "puy", "pya", "pye", "pyx", "qat", "qis", "qua", "qin", "rad", "rag", "rah", "rai", "raj", "ram", "ran", "rap", "ras", "rat", "rav", "raw", "rax", "ray", "reb", "rec", "red", "ree", "ref", "reg", "reh", "rei", "rem", "ren", "reo", "rep", "res", "ret", "rev", "rew", "rex", "rez", "rho", "rhy", "ria", "rib", "rid", "rif", "rig", "rim", "rin", "rip", "rit", "riz", "rob", "roc", "rod", "roe", "rok", "rom", "roo", "rot", "row", "rub", "ruc", "rud", "rue", "rug", "rum", "run", "rut", "rya", "rye", "sab", "sac", "sad", "sae", "sag", "sai", "sal", "sam", "san", "sap", "sar", "sat", "sau", "sav", "saw", "sax", "say", "SAY", "saz", "sea", "sec", "sed", "see", "seg", "sei", "sel", "sen", "ser", "set", "sew", "sex", "sey", "sez", "sha", "she", "shh", "shy", "sib", "sic", "sif", "sik", "sim", "sin", "sip", "sir", "sis", "sit", "six", "ska", "ski", "sky", "sly", "sma", "sny", "sob", "soc", "sod", "sog", "soh", "sol", "som", "son", "sop", "sos", "sot", "sou", "sov", "sow", "sox", "soy", "soz", "spa", "spy", "sri", "sty", "sub", "sud", "sue", "sug", "sui", "suk", "sum", "sun", "sup", "suq", "sur", "sus", "swy", "sye", "syn", "tab", "tad", "tae", "tag", "tai", "taj", "tak", "tam", "tan", "tao", "tap", "tar", "tas", "tat", "tau", "tav", "taw", "tax", "tay", "tea", "tec", "ted", "tee", "tef", "teg", "tel", "ten", "tes", "tet", "tew", "tex", "the", "tho", "thy", "tic", "tid", "tie", "tig", "tik", "til", "tin", "tip", "tis", "tit", "tix", "toc", "tod", "toe", "tog", "tom", "ton", "too", "top", "tor", "tot", "tow", "toy", "try", "tsk", "tub", "tug", "tui", "tum", "tun", "tup", "tut", "tux", "twa", "two", "twp", "tye", "tyg", "udo", "uds", "uey", "ufo", "ugh", "ugs", "uke", "ule", "ulu", "umm", "ump", "ums", "umu", "uni", "uns", "upo", "ups", "urb", "urd", "ure", "urn", "urp", "use", "uta", "ute", "uts", "utu", "uva", "vac", "vae", "vag", "van", "var", "vas", "vat", "vau", "vav", "vaw", "vee", "veg", "vet", "vex", "via", "vid", "vie", "vig", "vim", "vin", "vis", "vly", "voe", "vol", "vor", "vow", "vox", "vug", "vum", "wab", "wad", "wae", "wag", "wai", "wan", "wap", "war", "was", "wat", "waw", "wax", "way", "web", "wed", "wee", "wem", "wen", "wet", "wex", "wey", "wha", "who", "why", "wig", "win", "wis", "wit", "wiz", "woe", "wof", "wog", "wok", "won", "woo", "wop", "wos", "wot", "wow", "wox", "wry", "wud", "wus", "wye", "wyn", "xis", "yad", "yae", "yag", "yah", "yak", "yam", "yap", "yar", "yaw", "yay", "yea", "yeh", "yen", "yep", "yes", "yet", "yew", "yex", "ygo", "yid", "yin", "yip", "yob", "yod", "yok", "yom", "yon", "you", "yow", "yug", "yuk", "yum", "yup", "yus", "zag", "zap", "zas", "zax", "zea", "zed", "zee", "zek", "zel", "zep", "zex", "zho", "zig", "zin", "zip", "zit", "ziz", "zoa", "zol", "zoo", "zos", "zuz", "zzz"); --!pp on -- re-enable gnatpp formatting end Password_Manager;
oeis/138/A138112.asm
neoneye/loda-programs
11
89915
<reponame>neoneye/loda-programs<gh_stars>10-100 ; A138112: a(n)=3a(n-1)-4a(n-2)+2a(n-3)-a(n-4), a(0)=a(1)=a(2)=0, a(3)=1, a(4)=3. ; Submitted by <NAME> ; 0,0,0,1,3,5,5,0,-13,-34,-55,-55,0,144,377,610,610,0,-1597,-4181,-6765,-6765,0,17711,46368,75025,75025,0,-196418,-514229,-832040,-832040,0,2178309,5702887,9227465,9227465,0,-24157817,-63245986,-102334155,-102334155 sub $0,1 mov $3,5 lpb $0 sub $0,1 add $2,$3 sub $4,$3 sub $3,$1 add $1,$3 add $4,$2 add $1,$4 sub $1,5 lpe mov $0,$1 div $0,5
alloy4fun_models/trashltl/models/11/NLHyjuvkJAL8pmxhL.als
Kaixi26/org.alloytools.alloy
0
3011
<filename>alloy4fun_models/trashltl/models/11/NLHyjuvkJAL8pmxhL.als<gh_stars>0 open main pred idNLHyjuvkJAL8pmxhL_prop12 { eventually always all f : File | f not in Trash implies f in Trash' } pred __repair { idNLHyjuvkJAL8pmxhL_prop12 } check __repair { idNLHyjuvkJAL8pmxhL_prop12 <=> prop12o }
l6_syscalls/solutions/my_echo.asm
leonnicolas/computer_architecture_exercises
0
100035
global _start extern my_strlen section .data lf db `\n` section .text _start: mov rdi, [rsp ] lea rsi, [rsp+8]; argv main: dec rdi je end mov r8, 1 loop: push rdi ; get len of str push r9 push r8 push rsi mov rdi, [rsi + 8*r8 ] call my_strlen pop rsi pop r8 push rsi ; prepare for syscall write push r8 mov rdx, rax ; pass return value from strlen mov rax, 1 ; systemcall for write mov rdi, 1 ; for stdout mov rsi,[rsi + 8*r8] syscall mov rax, 1; ; prepare for syscall write to print \n mov rdi,1 mov rdx, 1 mov rsi, lf syscall pop r8 pop rsi pop r9 pop rdi dec rdi je end inc r8 jmp loop end: mov rdi, 0 ; exit mov rax, 60 syscall
libsrc/target/z9001/graphics/getmaxx.asm
dikdom/z88dk
1
27849
INCLUDE "graphics/grafix.inc" SECTION code_clib PUBLIC getmaxx PUBLIC _getmaxx EXTERN __z9001_mode EXTERN CONSOLE_COLUMNS .getmaxx ._getmaxx ld a,(__z9001_mode) and a ld hl, +(CONSOLE_COLUMNS * 2) - 1 ret z ld hl, 319 ret
test/Succeed/Issue3306.agda
cruhland/agda
1,989
12098
postulate A : Set variable {xx} : A record R : Set₁ where field P : A → Set a : P xx b : P xx c : P xx d : P xx e : P xx f : P xx g : P xx h : P xx i : P xx j : P xx k : P xx l : P xx m : P xx n : P xx o : P xx p : P xx q : P xx r : P xx s : P xx t : P xx u : P xx v : P xx w : P xx x : P xx y : P xx z : P xx
oeis/070/A070293.asm
neoneye/loda-programs
11
1565
<filename>oeis/070/A070293.asm ; A070293: a(n) = lcm(30,n)/gcd(30,n). ; Submitted by <NAME> ; 30,15,10,30,6,5,210,60,30,3,330,10,390,105,2,120,510,15,570,6,70,165,690,20,30,195,90,210,870,1,930,240,110,255,42,30,1110,285,130,12,1230,35,1290,330,6,345,1410,40,1470,15 mov $1,1 add $1,$0 mov $0,1 seq $0,118616 ; Start with 1 and repeatedly reverse the digits and add 29 to get the next term. mov $2,$0 mul $0,91 gcd $2,$1 mul $1,$0 pow $2,2 div $1,$2 mov $0,$1 div $0,91