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 |
|---|---|---|---|---|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt6.adb | best08618/asylo | 7 | 13955 | -- PR rtl-optimization/45394
-- { dg-do compile }
-- { dg-options "-O2 -g" }
package body Opt6 is
function Current_Parameter (Iter : Command_Line_Iterator) return String is
begin
if Iter.Params = null
or else Iter.Current > Iter.Params'Last
or else Iter.Params (Iter.Current) = null
then
return "";
else
declare
P : constant String := Iter.Params (Iter.Current).all;
begin
-- Skip separator
return P (P'First + 1 .. P'Last);
end;
end if;
end Current_Parameter;
end Opt6;
|
programs/oeis/017/A017035.asm | neoneye/loda | 22 | 4968 | ; A017035: a(n) = (7*n + 4)^7.
; 16384,19487171,612220032,6103515625,34359738368,137231006679,435817657216,1174711139837,2799360000000,6060711605323,12151280273024,22876792454961,40867559636992,69833729609375,114868566764928,182803912081669,282621973446656,425927596977747,627485170000000,905824306333433,1283918464548864,1789940649848551,2458100350228352,3329565857578125,4453476124377088,5888046306640859,7701771143776896,9974730326005057,12800000000000000,16285174563412143,20554002898923904,25748143198497941,32029040528474112,39579931286171875,48607978698654848,59346543514314249,72057594037927936,87034259659851767,104603532030000000,125129118027271453,149014448675078144,176705848153633131,208695867059654272,245526784064140625,287794280118878208,336151289362331839,391312030875579776,454056225438947877,525233501440000000,605767994083541363,696663142054291584,799006685782884121,913975871465848832,1042842864990234375,1186980379913527168,1347867523649523629,1527095866010812416,1726375734258523387,1947542738810000000,2192564533755051873,2463547816331444224,2762745569510280911,3092564551841937792,3455573038713203125,3854508819166281728,4292287452430319619,4772010788316105856,5296975755624608297,5870683422720000000,6496848334417832983,7179408129339016064,7922533441880253501,8730638092951601152,9608389573631796875,10560719825892021888,11592836324538749809,12710233464526340096,13918704257790032607,15224352343750000000,16633604317637114693,18153222380791087104,19790317317081631891,21552361799603318912,23447204031794765625,25483081727132827648,27668636431552444199,30012928192742795136,32525450580470426317,35216146062080000000,38095421737323327003,41174165436667337344,44463762187231646081,47976111050506371072,51723642336000859375,55719335194973979008,59976735598396632789,64509974703297150976,69333787611640219427,74463532525890000000,79915210305408099913
mul $0,7
add $0,4
pow $0,7
|
src/giza-widget-tabs.adb | Fabien-Chouteau/Giza | 7 | 917 | ------------------------------------------------------------------------------
-- --
-- Giza --
-- --
-- Copyright (C) 2015 <NAME> (<EMAIL>) --
-- --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
package body Giza.Widget.Tabs is
---------------
-- Set_Dirty --
---------------
overriding
procedure Set_Dirty (This : in out Instance;
Dirty : Boolean := True)
is
begin
Set_Dirty (Parent (This), Dirty);
This.Root.Set_Dirty (Dirty);
end Set_Dirty;
----------
-- Draw --
----------
overriding
procedure Draw (This : in out Instance;
Ctx : in out Context.Class;
Force : Boolean := True) is
begin
This.Root.Draw (Ctx, Force);
end Draw;
-----------------------
-- On_Position_Event --
-----------------------
overriding
function On_Position_Event
(This : in out Instance;
Evt : Position_Event_Ref;
Pos : Point_T) return Boolean
is
begin
if This.Root.On_Position_Event (Evt, Pos) then
for Index in This.Tabs'Range loop
if Index /= This.Selected
and then
This.Tabs (Index).Btn.Active
then
This.Set_Selected (Index);
exit;
end if;
end loop;
This.Tabs (This.Selected).Btn.Set_Active;
return True;
else
return False;
end if;
end On_Position_Event;
--------------
-- On_Event --
--------------
overriding
function On_Event
(This : in out Instance;
Evt : Event_Not_Null_Ref) return Boolean
is
begin
return This.Root.On_Event (Evt);
end On_Event;
-------------
-- Set_Tab --
-------------
procedure Set_Tab
(This : in out Instance;
Index : Natural;
Title : String;
Child : not null Widget.Reference)
is
Tabs_H : constant Integer := This.Get_Size.H / 4;
begin
if not This.Init then
-- Initialization (This could/should be done only once...)
This.Root.Set_Size (This.Get_Size);
This.Tabs_Group.Set_Size ((This.Get_Size.W, Tabs_H));
This.Tabs_Group.Set_Background (This.Get_Foreground);
This.Root.Add_Child (This.Tabs_Group'Unchecked_Access, (0, 0));
This.Init := True;
end if;
if Index in This.Tabs'Range then
This.Tabs (Index).Widg := Child;
Child.Set_Size (This.Get_Size - (0, Tabs_H + 1));
Child.Set_Dirty;
This.Tabs (Index).Btn.Set_Text (Title);
This.Tabs (Index).Btn.Set_Foreground (This.Get_Foreground);
This.Tabs (Index).Btn.Set_Background (This.Get_Background);
This.Tabs (Index).Btn.Disable_Frame;
This.Tabs (Index).Btn.Set_Toggle (True);
This.Tabs_Group.Set_Child (Index,
This.Tabs (Index).Btn'Unchecked_Access);
This.Set_Selected (Index);
end if;
end Set_Tab;
--------------
-- Selected --
--------------
function Selected (This : Instance) return Natural is (This.Selected);
------------------
-- Set_Selected --
------------------
procedure Set_Selected (This : in out Instance; Selected : Natural) is
begin
if Selected in This.Tabs'Range
and then
This.Tabs (Selected).Widg /= null
then
This.Root.Remove_Child (This.Tabs (This.Selected).Widg);
This.Selected := Selected;
This.Tabs (This.Selected).Widg.Set_Dirty;
This.Root.Add_Child (This.Tabs (This.Selected).Widg,
(0, This.Tabs_Group.Get_Size.H + 1));
for Index in This.Tabs'Range loop
This.Tabs (Index).Btn.Set_Active (Index = Selected);
This.Tabs (Index).Btn.Set_Disabled (Index = Selected);
end loop;
end if;
end Set_Selected;
end Giza.Widget.Tabs;
|
oeis/310/A310520.asm | neoneye/loda-programs | 11 | 160525 | <filename>oeis/310/A310520.asm<gh_stars>10-100
; A310520: Coordination sequence Gal.6.331.1 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by <NAME>
; 1,4,10,16,22,26,32,36,42,48,54,58,62,68,74,80,84,90,94,100,106,112,116,120,126,132,138,142,148,152,158,164,170,174,178,184,190,196,200,206,210,216,222,228,232,236,242,248,254,258
mov $1,$0
seq $1,315186 ; Coordination sequence Gal.6.263.6 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
mov $2,$0
mul $0,7
sub $0,1
mod $0,$1
add $0,1
mul $2,3
add $0,$2
|
source/xml/sax/xml-sax-simple_readers-parser-actions.ads | svn2github/matreshka | 24 | 9250 | <reponame>svn2github/matreshka
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- XML Processor --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2014, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Ada_2012;
private package XML.SAX.Simple_Readers.Parser.Actions is
procedure On_Attribute_Default_Declaration
(Self : in out Simple_Reader'Class;
Default : Matreshka.Internals.Strings.Shared_String_Access);
-- Handles declaration of default value of the attribute.
procedure On_CDATA_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_CDATA_Open (Self : in out Simple_Reader'Class);
-- Process open of CDATA section.
procedure On_CDATA_Close (Self : in out Simple_Reader'Class);
-- Process close of CDATA section.
procedure On_Character_Data
(Self : in out Simple_Reader'Class;
Text : not null Matreshka.Internals.Strings.Shared_String_Access;
Is_Whitespace : Boolean);
-- Process segment of character data.
procedure On_Element_Attribute
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier;
Value : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Handles attribute of the element.
procedure On_Element_Attribute_Name
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Handles name of the attribute in the element. Now it olny switch scanner
-- into appopriate attribute value normalization mode.
procedure On_End_Of_Document (Self : in out Simple_Reader'Class);
-- Handles end of document.
procedure On_End_Of_Document_Type_Declaration
(Self : in out Simple_Reader'Class);
-- Handles end of document type declaration.
procedure On_End_Tag
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Handles end tag, rule [42].
procedure On_Empty_Element_Tag (Self : in out Simple_Reader'Class);
-- Process start tag, rule [44].
procedure On_Entity_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_Entities_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_Enumeration_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of enumeration type.
procedure On_Fixed_Attribute_Default_Declaration
(Self : in out Simple_Reader'Class;
Default : Matreshka.Internals.Strings.Shared_String_Access);
-- Handles declaration of fixed value of the attribute.
procedure On_General_Entity_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier;
Is_External : Boolean;
Value : League.Strings.Universal_String;
Notation : Matreshka.Internals.XML.Symbol_Identifier);
-- Process general entity declaration, rule [71].
procedure On_Id_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_IdRef_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_IdRefs_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_Implied_Attribute_Default_Declaration
(Self : in out Simple_Reader'Class);
-- Handles declaration of implied value of the attribute.
procedure On_Empty_Declaration
(Self : in out Simple_Reader'Class);
-- Handles declaration of empty of the element.
procedure On_Any_Declaration
(Self : in out Simple_Reader'Class);
-- Handles declaration of any of the element.
procedure On_Mixed_Content_Declaration
(Self : in out Simple_Reader'Class;
Is_Any : Boolean);
-- Handles declaration of mixed content of the element.
procedure On_Name_In_Mixed_Content_Declaration
(Self : in out Simple_Reader'Class);
-- Handles element name in the list of children element in mixed content
-- declration.
procedure On_NmToken_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_NmTokens_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of CDATA type.
procedure On_No_Document_Type_Declaration
(Self : in out Simple_Reader'Class);
-- Handles case when document type declaration is missing.
procedure On_Notation_Attribute_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Process attribute declaration of NOTATION type.
procedure On_Notation_Declaration
(Self : in out Simple_Reader'Class;
Name : Matreshka.Internals.XML.Symbol_Identifier;
Public_Id : not null Matreshka.Internals.Strings.Shared_String_Access;
System_Id : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Handles declaration of notation.
procedure On_Open_Of_Tag
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Handles open of element's tag. The only purpose now is to resolve
-- element and set identifier of the declaration of currently
-- processed element.
procedure On_Parameter_Entity_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier;
Is_External : Boolean;
Value : League.Strings.Universal_String);
-- Process parameter entity declaration, rule [72].
procedure On_Required_Attribute_Default_Declaration
(Self : in out Simple_Reader'Class);
-- Handles declaration of required value of the attribute.
procedure On_Start_Of_Attribute_List_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Handles start of attribute list declaration.
procedure On_Start_Of_Document
(Self : in out Simple_Reader'Class);
-- Handles start of document.
procedure On_Start_Of_Document_Type_Declaration
(Self : in out Simple_Reader'Class;
Name : Matreshka.Internals.XML.Symbol_Identifier;
External : Boolean);
-- Handles start of document type declaration.
procedure On_Start_Of_Element_Declaration
(Self : in out Simple_Reader'Class;
Symbol : Matreshka.Internals.XML.Symbol_Identifier);
-- Handles start of element declaration.
procedure On_Start_Tag (Self : in out Simple_Reader'Class);
-- Handles start tag of element.
procedure On_XML_Declaration
(Self : in out Simple_Reader'Class;
Version : not null Matreshka.Internals.Strings.Shared_String_Access;
Encoding : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Handles XML version information and entity's encoding by switching
-- scanner to the corresponding processing mode.
procedure On_Text_Declaration
(Self : in out Simple_Reader'Class;
Version : not null Matreshka.Internals.Strings.Shared_String_Access;
Encoding : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Handles XML version information and entity's encoding in external
-- entity.
procedure On_Standalone
(Self : in out Simple_Reader'Class;
Text : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Handles 'standalone' element of XML declaration.
procedure On_Processing_Instruction
(Self : in out Simple_Reader'Class;
Target : Matreshka.Internals.XML.Symbol_Identifier;
Data : not null Matreshka.Internals.Strings.Shared_String_Access);
-- Process processing instruction.
end XML.SAX.Simple_Readers.Parser.Actions;
|
Task/Spiral-matrix/AppleScript/spiral-matrix.applescript | mbirabhadra/RosettaCodeData | 1 | 2702 | <reponame>mbirabhadra/RosettaCodeData
-- SPIRAL MATRIX -------------------------------------------------------------
-- spiral :: Int -> Int -> Int -> [[Int]]
on spiral(lngRows, lngCols, nStart)
if lngRows > 0 then
{enumFromTo(nStart, (nStart + lngCols) - 1)} & ¬
map(my |reverse|, ¬
transpose(spiral(lngCols, lngRows - 1, nStart + lngCols)))
else
{{}}
end if
end spiral
-- TEST ----------------------------------------------------------------------
on run
set n to 5
set lstSpiral to spiral(n, n, 0)
-- {{0, 1, 2, 3, 4}, {15, 16, 17, 18, 5}, {14, 23, 24, 19, 6},
-- {13, 22, 21, 20, 7}, {12, 11, 10, 9, 8}}
wikiTable(lstSpiral, ¬
false, ¬
"text-align:center;width:12em;height:12em;table-layout:fixed;")
end run
-- WIKI TABLE FORMAT ---------------------------------------------------------
-- wikiTable :: [Text] -> Bool -> Text -> Text
on wikiTable(lstRows, blnHdr, strStyle)
script fWikiRows
on |λ|(lstRow, iRow)
set strDelim to cond(blnHdr and (iRow = 0), "!", "|")
set strDbl to strDelim & strDelim
linefeed & "|-" & linefeed & strDelim & space & ¬
intercalate(space & strDbl & space, lstRow)
end |λ|
end script
linefeed & "{| class=\"wikitable\" " & ¬
cond(strStyle ≠ "", "style=\"" & strStyle & "\"", "") & ¬
intercalate("", ¬
map(fWikiRows, lstRows)) & linefeed & "|}" & linefeed
end wikiTable
-- GENERIC FUNCTIONS ---------------------------------------------------------
-- cond :: Bool -> a -> a -> a
on cond(bool, x, y)
if bool then
x
else
y
end if
end cond
-- enumFromTo :: Int -> Int -> [Int]
on enumFromTo(m, n)
if m > n then
set d to -1
else
set d to 1
end if
set lst to {}
repeat with i from m to n by d
set end of lst to i
end repeat
return lst
end enumFromTo
-- Text -> [Text] -> Text
on intercalate(strText, lstText)
set {dlm, my text item delimiters} to {my text item delimiters, strText}
set strJoined to lstText as text
set my text item delimiters to dlm
return strJoined
end intercalate
-- 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
-- reverse :: [a] -> [a]
on |reverse|(xs)
if class of xs is text then
(reverse of characters of xs) as text
else
reverse of xs
end if
end |reverse|
-- transpose :: [[a]] -> [[a]]
on transpose(xss)
script column
on |λ|(_, iCol)
script row
on |λ|(xs)
item iCol of xs
end |λ|
end script
map(row, xss)
end |λ|
end script
map(column, item 1 of xss)
end transpose
|
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_10408_1227.asm | ljhsiun2/medusa | 9 | 170561 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0xba3e, %r10
nop
nop
nop
nop
xor %r9, %r9
movl $0x61626364, (%r10)
nop
sub %rax, %rax
lea addresses_WC_ht+0x6d96, %rsi
lea addresses_WC_ht+0xc5ae, %rdi
clflush (%rdi)
inc %r10
mov $110, %rcx
rep movsl
and $64901, %rax
lea addresses_normal_ht+0x274e, %rsi
lea addresses_normal_ht+0xd58e, %rdi
nop
nop
inc %rdx
mov $1, %rcx
rep movsb
nop
nop
sub $28900, %rbp
lea addresses_D_ht+0x18c1a, %rbp
nop
nop
nop
nop
dec %r9
mov (%rbp), %cx
dec %rdi
lea addresses_UC_ht+0x1ef4e, %rsi
lea addresses_UC_ht+0xf54e, %rdi
nop
and %r10, %r10
mov $9, %rcx
rep movsq
nop
nop
and $42405, %r9
lea addresses_WT_ht+0x6ace, %rax
nop
cmp $54750, %rbp
and $0xffffffffffffffc0, %rax
vmovntdqa (%rax), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %r9
nop
nop
nop
nop
inc %r10
lea addresses_D_ht+0x1b04e, %rdi
nop
xor %rdx, %rdx
vmovups (%rdi), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %rbp
nop
nop
add $65203, %rax
lea addresses_WT_ht+0x98ce, %r9
nop
nop
nop
nop
nop
cmp %r10, %r10
mov (%r9), %di
nop
dec %rsi
lea addresses_D_ht+0x974e, %rdi
nop
nop
nop
nop
sub $40433, %r10
movb $0x61, (%rdi)
nop
nop
nop
cmp %rax, %rax
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r14
push %r8
push %rax
push %rdi
// Store
lea addresses_PSE+0x14b4e, %rdi
nop
nop
nop
cmp %r10, %r10
mov $0x5152535455565758, %r11
movq %r11, %xmm3
movups %xmm3, (%rdi)
nop
xor %rdi, %rdi
// Faulty Load
lea addresses_A+0x874e, %r8
nop
nop
nop
inc %r14
movups (%r8), %xmm2
vpextrq $0, %xmm2, %rax
lea oracles, %rdi
and $0xff, %rax
shlq $12, %rax
mov (%rdi,%rax,1), %rax
pop %rdi
pop %rax
pop %r8
pop %r14
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'00': 10408}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
libsrc/_DEVELOPMENT/math/float/am9511/c/sccz80/cam32_sccz80_modf_callee.asm | ahjelm/z88dk | 640 | 102437 |
SECTION code_fp_am9511
PUBLIC cam32_sccz80_modf_callee
EXTERN _am9511_modf
; float modff(float x, float * y)
.cam32_sccz80_modf_callee
; Entry:
; Stack: float left, ptr right, ret
; Reverse the stack
pop af ;ret
pop bc ;ptr
pop hl ;float
pop de
push af ;ret
push bc ;ptr
push de ;float
push hl
call _am9511_modf
pop af
pop af
pop af
ret
|
oeis/222/A222940.asm | neoneye/loda-programs | 11 | 26046 | ; A222940: Number of n X 2 0..4 arrays with no element equal to another at a city block distance of exactly two, and new values 0..4 introduced in row major order.
; Submitted by <NAME>(s1)
; 2,7,33,273,2433,21873,196833,1771473,15943233,143489073,1291401633,11622614673,104603532033,941431788273,8472886094433,76255974849873,686303773648833,6176733962839473,55590605665555233,500315450989997073,4502839058909973633,40525551530189762673,364729963771707864033,3282569673945370776273,29543127065508336986433,265888143589575032877873,2392993292306175295900833,21536939630755577663107473,193832456676800198967967233,1744492110091201790711705073,15700428990820816116405345633
mul $0,2
mov $1,1
mov $2,1
lpb $0
sub $0,1
mov $1,$2
trn $1,4
add $1,$2
add $2,$1
add $1,$2
lpe
mov $0,$1
add $0,1
|
Takahashi.agda | iwilare/church-rosser | 5 | 5807 | <filename>Takahashi.agda
open import DeBruijn
infix 8 _*
_* : ∀ {n} → Term n → Term n
(# x) * = # x
(ƛ M) * = ƛ M *
((ƛ M) · N) * = M * [ N * ]
(L · N) * = L * · N *
|
Transynther/x86/_processed/AVXALIGN/_st_/i7-8650U_0xd2_notsx.log_21829_932.asm | ljhsiun2/medusa | 9 | 165101 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %r15
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1e278, %r11
clflush (%r11)
nop
add $58752, %rax
movl $0x61626364, (%r11)
nop
cmp %rax, %rax
lea addresses_normal_ht+0x198f4, %r10
clflush (%r10)
and $46953, %r15
mov (%r10), %r11d
nop
nop
add %r14, %r14
lea addresses_normal_ht+0x1c78, %rsi
lea addresses_normal_ht+0x11e78, %rdi
nop
nop
nop
nop
nop
add %rax, %rax
mov $6, %rcx
rep movsq
nop
dec %r15
lea addresses_D_ht+0x12bc, %rsi
lea addresses_UC_ht+0x126b8, %rdi
nop
nop
nop
xor $48442, %r15
mov $111, %rcx
rep movsq
nop
nop
nop
nop
nop
xor $53562, %rdi
lea addresses_WC_ht+0x12704, %rsi
lea addresses_WT_ht+0x8638, %rdi
nop
nop
nop
nop
nop
cmp $57825, %r11
mov $118, %rcx
rep movsb
nop
nop
nop
nop
nop
dec %rax
lea addresses_normal_ht+0x1b038, %rsi
lea addresses_normal_ht+0xcd38, %rdi
clflush (%rdi)
nop
nop
and $62947, %r10
mov $70, %rcx
rep movsb
add $48604, %r10
lea addresses_UC_ht+0x1cecc, %rsi
nop
nop
nop
nop
nop
and %r11, %r11
movb (%rsi), %al
nop
nop
nop
cmp %rax, %rax
lea addresses_D_ht+0x1bc78, %rsi
lea addresses_WC_ht+0x158f8, %rdi
xor %r15, %r15
mov $48, %rcx
rep movsq
cmp %rax, %rax
lea addresses_WC_ht+0x13e78, %rdi
nop
nop
dec %r15
mov (%rdi), %si
nop
nop
nop
nop
nop
and $15799, %rsi
lea addresses_WC_ht+0x19348, %rsi
lea addresses_normal_ht+0x1ba78, %rdi
nop
add $61763, %rax
mov $39, %rcx
rep movsw
nop
nop
nop
nop
mfence
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %rbp
push %rbx
push %rcx
// Faulty Load
lea addresses_A+0x12a78, %rbp
nop
nop
sub %r12, %r12
mov (%rbp), %bx
lea oracles, %r12
and $0xff, %rbx
shlq $12, %rbx
mov (%r12,%rbx,1), %rbx
pop %rcx
pop %rbx
pop %rbp
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 9, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c43004a.ada | best08618/asylo | 7 | 17250 | <reponame>best08618/asylo
-- C43004A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT CONSTRAINT_ERROR IS RAISED IF A VALUE FOR A
-- NON-DISCRIMINANT SCALAR COMPONENT OF AN AGGREGATE IS NOT
-- WITHIN THE RANGE OF THE COMPONENT'S SUBTYPE.
-- HISTORY:
-- BCB 01/22/88 CREATED ORIGINAL TEST.
-- RJW 06/27/90 CORRECTED CONSTRAINTS OF TYPE DFIX.
-- LDC 09/25/90 ADDED A BLOCK IN THE EXCEPTION HANDLER SO IT CAN
-- NOT OPTIMIZE IT AWAY, ALSO INITIALIZED EACH
-- OBJECT TO VALID DATA BEFORE DOING THE INVALID,
-- MADE 'IDENT_XXX' FUNCTIONS SO THE COMPILER CAN
-- NOT JUST EVALUATE THE ASSIGNMENT AND PUT IN CODE
-- FOR A CONSTRAINT ERROR IN IS PLACE.
-- JRL 06/07/96 Changed value in aggregate in subtest 4 to value
-- guaranteed to be in the base range of the type FIX.
-- Corrected typo.
WITH REPORT; USE REPORT;
PROCEDURE C43004A IS
TYPE INT IS RANGE 1 .. 8;
SUBTYPE SINT IS INT RANGE 2 .. 7;
TYPE ENUM IS (VINCE, JOHN, TOM, PHIL, ROSA, JODIE, BRIAN, DAVE);
SUBTYPE SENUM IS ENUM RANGE JOHN .. BRIAN;
TYPE FL IS DIGITS 5 RANGE 0.0 .. 10.0;
SUBTYPE SFL IS FL RANGE 1.0 .. 9.0;
TYPE FIX IS DELTA 0.25 RANGE 0.0 .. 8.0;
SUBTYPE SFIX IS FIX RANGE 1.0 .. 7.0;
TYPE DINT IS NEW INTEGER RANGE 1 .. 8;
SUBTYPE SDINT IS DINT RANGE 2 .. 7;
TYPE DENUM IS NEW ENUM RANGE VINCE .. DAVE;
SUBTYPE SDENUM IS DENUM RANGE JOHN .. BRIAN;
TYPE DFL IS NEW FLOAT RANGE 0.0 .. 10.0;
SUBTYPE SDFL IS DFL RANGE 1.0 .. 9.0;
TYPE DFIX IS NEW FIX RANGE 0.5 .. 7.5;
SUBTYPE SDFIX IS DFIX RANGE 1.0 .. 7.0;
TYPE REC1 IS RECORD
E1, E2, E3, E4, E5 : SENUM;
END RECORD;
TYPE REC2 IS RECORD
E1, E2, E3, E4, E5 : SFIX;
END RECORD;
TYPE REC3 IS RECORD
E1, E2, E3, E4, E5 : SDENUM;
END RECORD;
TYPE REC4 IS RECORD
E1, E2, E3, E4, E5 : SDFIX;
END RECORD;
ARRAY_OBJ : ARRAY(1..2) OF INTEGER;
A : ARRAY(1..5) OF SINT;
B : REC1;
C : ARRAY(1..5) OF SFL;
D : REC2;
E : ARRAY(1..5) OF SDINT;
F : REC3;
G : ARRAY(1..5) OF SDFL;
H : REC4;
GENERIC
TYPE GENERAL_PURPOSE IS PRIVATE;
FUNCTION GENEQUAL(ONE, TWO : GENERAL_PURPOSE) RETURN BOOLEAN;
FUNCTION GENEQUAL(ONE, TWO : GENERAL_PURPOSE) RETURN BOOLEAN IS
BEGIN
IF EQUAL(3,3) THEN
RETURN ONE = TWO;
ELSE
RETURN ONE /= TWO;
END IF;
END GENEQUAL;
FUNCTION EQUAL IS NEW GENEQUAL(SENUM);
FUNCTION EQUAL IS NEW GENEQUAL(SFL);
FUNCTION EQUAL IS NEW GENEQUAL(SFIX);
FUNCTION EQUAL IS NEW GENEQUAL(SDENUM);
FUNCTION EQUAL IS NEW GENEQUAL(SDFL);
FUNCTION EQUAL IS NEW GENEQUAL(SDFIX);
GENERIC
TYPE GENERAL_PURPOSE IS PRIVATE;
WITH FUNCTION EQUAL_GENERAL(ONE, TWO : GENERAL_PURPOSE)
RETURN BOOLEAN;
FUNCTION GEN_IDENT (X : GENERAL_PURPOSE) RETURN GENERAL_PURPOSE;
FUNCTION GEN_IDENT (X : GENERAL_PURPOSE) RETURN GENERAL_PURPOSE IS
BEGIN
IF EQUAL_GENERAL (X, X) THEN -- ALWAYS EQUAL.
RETURN X; -- ALWAYS EXECUTED.
END IF;
-- NEVER EXECUTED.
RETURN X;
END GEN_IDENT;
FUNCTION IDENT_FL IS NEW GEN_IDENT(FL, EQUAL);
FUNCTION IDENT_FIX IS NEW GEN_IDENT(FIX, EQUAL);
FUNCTION IDENT_DFL IS NEW GEN_IDENT(DFL, EQUAL);
FUNCTION IDENT_DFIX IS NEW GEN_IDENT(DFIX, EQUAL);
BEGIN
TEST ("C43004A", "CHECK THAT CONSTRAINT_ERROR IS RAISED IF A " &
"VALUE FOR A NON-DISCRIMINANT SCALAR COMPONENT " &
"OF AN AGGREGATE IS NOT WITHIN THE RANGE OF " &
"THE COMPONENT'S SUBTYPE");
ARRAY_OBJ := (1, 2);
BEGIN
A := (2,3,4,5,6); -- OK
IF EQUAL (INTEGER (A(IDENT_INT(1))),
INTEGER (A(IDENT_INT(2)))) THEN
COMMENT ("DON'T OPTIMIZE A");
END IF;
A := (SINT(IDENT_INT(1)),2,3,4,7);
-- CONSTRAINT_ERROR BY AGGREGATE
-- WITH INTEGER COMPONENTS.
FAILED ("CONSTRAINT_ERROR WAS NOT RAISED - 1");
IF EQUAL (INTEGER (A(IDENT_INT(1))),
INTEGER (A(IDENT_INT(1)))) THEN
COMMENT ("DON'T OPTIMIZE A");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
IF EQUAL (ARRAY_OBJ(IDENT_INT(1)),
ARRAY_OBJ(IDENT_INT(2))) THEN
COMMENT ("DON'T OPTIMIZE EXCEPTION HANDLER");
END IF;
WHEN OTHERS =>
FAILED ("AN EXCEPTION OTHER THAN CONSTRAINT_ERROR " &
"WAS RAISED - 1");
END;
BEGIN
B := (JOHN,TOM,PHIL,ROSA,JOHN); -- OK
IF EQUAL (B.E1, B.E2) THEN
COMMENT ("DON'T OPTIMIZE B");
END IF;
B := (ENUM'VAL(IDENT_INT(ENUM'POS(DAVE))), TOM, PHIL,
ROSA, JODIE);
-- CONSTRAINT_ERROR BY AGGREGATE
-- WITH COMPONENTS OF AN
-- ENUMERATION TYPE.
FAILED ("CONSTRAINT_ERROR WAS NOT RAISED - 2");
IF NOT EQUAL (B.E1, B.E1) THEN
COMMENT ("DON'T OPTIMIZE B");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
IF EQUAL (ARRAY_OBJ(IDENT_INT(1)),
ARRAY_OBJ(IDENT_INT(2))) THEN
COMMENT ("DON'T OPTIMIZE EXCEPTION HANDLER");
END IF;
WHEN OTHERS =>
FAILED ("AN EXCEPTION OTHER THAN CONSTRAINT_ERROR " &
"WAS RAISED - 2");
END;
BEGIN
C := (2.0,3.0,4.0,5.0,6.0); -- OK
IF EQUAL (C(IDENT_INT(1)), C(IDENT_INT(2))) THEN
COMMENT ("DON'T OPTIMIZE C");
END IF;
C := (IDENT_FL(1.0),2.0,3.0,4.0,IDENT_FL(10.0));
-- CONSTRAINT_ERROR BY AGGREGATE
-- WITH FLOATING POINT COMPONENTS.
FAILED ("CONSTRAINT_ERROR WAS NOT RAISED - 3");
IF NOT EQUAL (C(IDENT_INT(1)), C(IDENT_INT(1))) THEN
COMMENT ("DON'T OPTIMIZE C");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
IF EQUAL (ARRAY_OBJ(IDENT_INT(1)),
ARRAY_OBJ(IDENT_INT(2))) THEN
COMMENT ("DON'T OPTIMIZE EXCEPTION HANDLER");
END IF;
WHEN OTHERS =>
FAILED ("AN EXCEPTION OTHER THAN CONSTRAINT_ERROR " &
"WAS RAISED - 3");
END;
BEGIN
D := (2.2,3.3,4.4,5.5,6.6); -- OK
IF EQUAL (D.E1, D.E5) THEN
COMMENT ("DON'T OPTIMIZE D");
END IF;
D := (IDENT_FIX(1.0),2.1,3.3,4.4,IDENT_FIX(7.75));
-- CONSTRAINT_ERROR BY AGGREGATE
-- WITH FIXED POINT COMPONENTS.
FAILED ("CONSTRAINT_ERROR WAS NOT RAISED - 4");
IF NOT EQUAL (D.E5, D.E5) THEN
COMMENT ("DON'T OPTIMIZE D");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
IF EQUAL (ARRAY_OBJ(IDENT_INT(1)),
ARRAY_OBJ(IDENT_INT(2))) THEN
COMMENT ("DON'T OPTIMIZE EXCEPTION HANDLER");
END IF;
WHEN OTHERS =>
FAILED ("AN EXCEPTION OTHER THAN CONSTRAINT_ERROR " &
"WAS RAISED - 4");
END;
BEGIN
E := (2,3,4,5,6); -- OK
IF EQUAL (INTEGER (E(IDENT_INT(1))),
INTEGER (E(IDENT_INT(2)))) THEN
COMMENT ("DON'T OPTIMIZE E");
END IF;
E := (SDINT(IDENT_INT(1)),2,3,4,7);
-- CONSTRAINT_ERROR BY AGGREGATE
-- WITH DERIVED INTEGER COMPONENTS.
FAILED ("CONSTRAINT_ERROR WAS NOT RAISED - 5");
IF NOT EQUAL (INTEGER (E(IDENT_INT(1))),
INTEGER (E(IDENT_INT(1)))) THEN
COMMENT ("DON'T OPTIMIZE E");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
IF EQUAL (ARRAY_OBJ(IDENT_INT(1)),
ARRAY_OBJ(IDENT_INT(2))) THEN
COMMENT ("DON'T OPTIMIZE EXCEPTION HANDLER");
END IF;
WHEN OTHERS =>
FAILED ("AN EXCEPTION OTHER THAN CONSTRAINT_ERROR " &
"WAS RAISED - 5");
END;
BEGIN
F := (JOHN,TOM,PHIL,ROSA,JOHN); -- OK
IF EQUAL (F.E1, F.E2) THEN
COMMENT ("DON'T OPTIMIZE F");
END IF;
F := (DENUM'VAL(IDENT_INT(DENUM'POS(VINCE))), TOM, PHIL,
ROSA, JODIE);
-- CONSTRAINT_ERROR BY AGGREGATE
-- WITH COMPONENTS OF A DERIVED
-- ENUMERATION TYPE.
FAILED ("CONSTRAINT_ERROR WAS NOT RAISED - 6");
IF NOT EQUAL (F.E1, F.E1) THEN
COMMENT ("DON'T OPTIMIZE F");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
IF EQUAL (ARRAY_OBJ(IDENT_INT(1)),
ARRAY_OBJ(IDENT_INT(2))) THEN
COMMENT ("DON'T OPTIMIZE EXCEPTION HANDLER");
END IF;
WHEN OTHERS =>
FAILED ("AN EXCEPTION OTHER THAN CONSTRAINT_ERROR " &
"WAS RAISED - 6");
END;
BEGIN
G := (2.0,3.0,4.0,5.0,6.0); -- OK
IF EQUAL (G(IDENT_INT(1)), G(IDENT_INT(2))) THEN
COMMENT ("DON'T OPTIMIZE G");
END IF;
G := (IDENT_DFL(1.0),2.0,3.0,4.0,IDENT_DFL(10.0));
-- CONSTRAINT_ERROR BY AGGREGATE
-- WITH DERIVED FLOATING POINT
-- COMPONENTS.
FAILED ("CONSTRAINT_ERROR WAS NOT RAISED - 7");
IF NOT EQUAL (G(IDENT_INT(1)), G(IDENT_INT(1))) THEN
COMMENT ("DON'T OPTIMIZE G");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
IF EQUAL (ARRAY_OBJ(IDENT_INT(1)),
ARRAY_OBJ(IDENT_INT(2))) THEN
COMMENT ("DON'T OPTIMIZE EXCEPTION HANDLER");
END IF;
WHEN OTHERS =>
FAILED ("AN EXCEPTION OTHER THAN CONSTRAINT_ERROR " &
"WAS RAISED - 7");
END;
BEGIN
H := (2.2,3.3,4.4,5.5,6.6); -- OK
IF EQUAL (H.E1, H.E2) THEN
COMMENT ("DON'T OPTIMIZE H");
END IF;
H := (IDENT_DFIX(2.0),2.5,3.5,4.3,IDENT_DFIX(7.4));
-- CONSTRAINT_ERROR BY AGGREGATE
-- WITH DERIVED FIXED POINT
-- COMPONENTS.
FAILED ("CONSTRAINT_ERROR WAS NOT RAISED - 8");
IF EQUAL (H.E1, H.E5) THEN
COMMENT ("DON'T OPTIMIZE H");
END IF;
EXCEPTION
WHEN CONSTRAINT_ERROR =>
IF EQUAL (ARRAY_OBJ(IDENT_INT(1)),
ARRAY_OBJ(IDENT_INT(2))) THEN
COMMENT ("DON'T OPTIMIZE EXCEPTION HANDLER");
END IF;
WHEN OTHERS =>
FAILED ("AN EXCEPTION OTHER THAN CONSTRAINT_ERROR " &
"WAS RAISED - 8");
END;
RESULT;
END C43004A;
|
lib/tfLexer.g4 | siue-terraform/tf-parse | 0 | 2169 | lexer grammar tfLexer;
@lexer::members {
int nesting = 0;
String heredocId = "";
}
// HCL Native Syntax Specification
// https://github.com/hashicorp/hcl/blob/hcl2/hclsyntax/spec.md
/// Whitespace and newlines
//
// [1] = all EOL chars
// [2] = all WS chars
//
EOL : ('\r\n' | '\n' | '\r') -> channel(1) ;
WS : [ \t]+ -> channel(2) ;
//
// [3] = all Comments
//
LINECOMMENT : ('//'+ | '#'+) ~[\r\n]* -> channel(3) ;
INLINECOMMENT : '/*' .*? '*/' -> channel(3) ;
/// Keywords (also valid identifiers, in certain contexts, but not others?)
//
FOR : 'for' ;
IN : 'in' ;
IF : 'if' ;
BOOL : 'true' | 'false' ;
NULL : 'null' ;
//
TERRAFORM : 'terraform' ;
MODULE : 'module' ;
PROVIDER : 'provider' ;
RESOURCE : 'resource' ;
DATA : 'data' ;
LOCALS : 'locals' ;
VARIABLE : 'variable' ;
OUTPUT : 'output' ;
//// Operators
///
/// Arithmetic
//
PLUS : '+' ;
MINUS : '-' ;
STAR : '*' ;
DIVIDE : '/' ;
///
/// Comparison
//
LT : '<' ;
GT : '>' ;
LTE : '<=' ;
GTE : '>=' ;
DEQUAL : '==' ;
NEQUAL : '!=' ;
///
/// Logic
//
AND : '&&' ;
OR : '||' ;
NOT : '!' ;
///
/// Ternary
//
QUESTION : '?' ;
COLON : ':' ;
///
/// Assignments
//
EQUALS : '=' ;
ARROW : '=>' ;
///
/// Blocks
//
LCURL : '{' ;
RCURL : '~'? '}' {
if (nesting > 0) {
nesting--;
popMode();
}
};
///
/// Lists
//
LBRACKET : '[' ;
RBRACKET : ']' ;
///
//
LPAREN : '(' ;
RPAREN : ')' ;
///
/// Misc
//
DOTS : '...' ;
DOT : '.' ;
COMMA : ',' ;
/// Numbers
//
INTEGER : [0-9]+ ;
FLOAT : [0-9]+ ('.' [0-9]+) ;
EXPONENTIAL : [0-9]+ ('.' [0-9]+)? ('e' | 'E') ('+' | '-')? [0-9]+ ;
/// Identifiers
//
IDENTIFIER : [a-zA-Z_] ([a-zA-Z0-9_-])* ;
/// Heredocs
//
HEREDOC_INDENT : '<<-' IDENTIFIER {
heredocId = getText().substring(3);
pushMode(PARSE_HEREDOC);
} ;
HEREDOC : '<<' IDENTIFIER {
heredocId = getText().substring(2);
pushMode(PARSE_HEREDOC);
} ;
/// Interpolations
//
ESCAPE_INTERPO : '$${' ;
INTERPO_PUSH : '${' '~'? {
nesting++;
pushMode(DEFAULT_MODE);
};
/// Directives
//
ESCAPE_DIRECTIVE : '%%{' ;
DIRECTIVE_PUSH : '%{' '~'? {
nesting++;
pushMode(DEFAULT_MODE);
};
/// Specials
//
DOLLAR : '$' ;
MODULO : '%' ;
/// Strings
//
DQUOTE : '"' -> pushMode(PARSE_DQUOTEDTEMPLATE) ;
SQUOTE : '\''-> pushMode(PARSE_SQUOTEDTEMPLATE) ;
mode PARSE_DQUOTEDTEMPLATE ;
/// Text
//
STRING_TEXT : ~('$'|'%'|'\\'|'"')+ ;
/// Specials
//
// Bug : A string started with '"' could be ended with '\''
//
ESCAPE_CHAR : '\\' . ;
DOLLAR_ : '$' -> type(DOLLAR);
PERCENT_ : '%' -> type(MODULO);
DQUOTE_ : '"' -> type(DQUOTE), popMode ;
/// Interpolations
//
ESCAPE_INTERPO_ : '$${' -> type(ESCAPE_INTERPO);
INTERPO_PUSH_ : '${' '~'? {
nesting++;
pushMode(DEFAULT_MODE);
} -> type(INTERPO_PUSH);
/// Directives
//
ESCAPE_DIRECTIVE_ : '%%{' -> type(ESCAPE_DIRECTIVE);
DIRECTIVE_PUSH_ : '%{' '~'? {
nesting++;
pushMode(DEFAULT_MODE);
} -> type(DIRECTIVE_PUSH);
mode PARSE_SQUOTEDTEMPLATE ;
/// Text
//
STRING_TEXT_ : ~('$'|'%'|'\\'|'\'')+ ;
/// Specials
//
// Bug : A string started with '"' could be ended with '\''
//
ESCAPE_CHAR_ : '\\' . ;
DOLLAR__ : '$' -> type(DOLLAR);
PERCENT__ : '%' -> type(MODULO);
SQUOTE__ : '\'' -> type(SQUOTE), popMode ;
/// Interpolations
//
ESCAPE_INTERPO__ : '$${' -> type(ESCAPE_INTERPO);
INTERPO_PUSH__ : '${' '~'? {
nesting++;
pushMode(DEFAULT_MODE);
} -> type(INTERPO_PUSH);
/// Directives
//
ESCAPE_DIRECTIVE__ : '%%{' -> type(ESCAPE_DIRECTIVE);
DIRECTIVE_PUSH__ : '%{' '~'? {
nesting++;
pushMode(DEFAULT_MODE);
} -> type(DIRECTIVE_PUSH);
/// Heredocs actually contain expressions
//
// Right now I'm just parsing them as plaintext
//
mode PARSE_HEREDOC;
/// Heredoc Text
//
HEREDOC_TEXT : ~('\r'|'\n')+ ;
/// In Heredocs we read EOL in main channel
//
EOL_ : ('\r\n' | '\n' | '\r') -> type(EOL);
CLOSE_HEREDOC : EOL_+ [ \t]*? IDENTIFIER { getText().trim().equals(heredocId) }? {
popMode();
}; |
src/main/fragment/mos6502-common/pvom1=_deref_qvoc1_plus_vwuc2.asm | jbrandwood/kickc | 2 | 179246 | <filename>src/main/fragment/mos6502-common/pvom1=_deref_qvoc1_plus_vwuc2.asm
clc
lda {c1}
adc #<{c2}
sta {m1}
lda {c1}+1
adc #>{c2}
sta {m1}+1
|
programs/oeis/230/A230135.asm | karttu/loda | 1 | 105247 | <filename>programs/oeis/230/A230135.asm
; A230135: Triangle read by rows: T(n, k) = 1 if ((k mod 4 = 2) and (n mod 2 = 1)) or ((k mod 4 = 0) and (n mod 2 = 0)) else T(n, k) = 0.
; 1,0,0,1,0,0,0,0,1,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,0
cal $0,294317 ; Triangle read by rows: T(n, k) = 2*n-k, k <= n.
gcd $0,4
mov $1,$0
sub $1,2
div $1,2
|
src/Data/Word/Primitive.agda | ilya-fiveisky/agda-system-io | 2 | 17055 | <filename>src/Data/Word/Primitive.agda
module Data.Word.Primitive where
postulate
Word : Set
Word8 : Set
Word16 : Set
Word32 : Set
Word64 : Set
{-# IMPORT Data.Word #-}
{-# COMPILED_TYPE Word Data.Word.Word #-}
{-# COMPILED_TYPE Word8 Data.Word.Word8 #-}
{-# COMPILED_TYPE Word16 Data.Word.Word16 #-}
{-# COMPILED_TYPE Word32 Data.Word.Word32 #-}
{-# COMPILED_TYPE Word64 Data.Word.Word64 #-}
|
archive/agda-1/UnifyTerm.agda | m0davis/oscar | 0 | 1934 |
module UnifyTerm where
open import Data.Fin using (Fin; suc; zero)
open import Data.Nat using (ℕ; suc; zero)
open import Relation.Binary.PropositionalEquality using (_≡_; refl; cong₂; cong; sym; trans)
open import Function using (_∘_)
open import Relation.Nullary using (¬_; Dec; yes; no)
open import Data.Product using (∃; _,_; _×_)
open import Data.Empty using (⊥-elim)
data Term (n : ℕ) : Set where
i : (x : Fin n) -> Term n
leaf : Term n
_fork_ : (s t : Term n) -> Term n
_~>_ : (m n : ℕ) -> Set
m ~> n = Fin m -> Term n
▹ : ∀ {m n} -> (r : Fin m -> Fin n) -> Fin m -> Term n
▹ r = i ∘ r
_◃_ : ∀ {m n} -> (f : m ~> n) -> Term m -> Term n
f ◃ i x = f x
f ◃ leaf = leaf
f ◃ (s fork t) = (f ◃ s) fork (f ◃ t)
_≐_ : {m n : ℕ} -> (Fin m -> Term n) -> (Fin m -> Term n) -> Set
f ≐ g = ∀ x -> f x ≡ g x
◃ext : ∀ {m n} {f g : Fin m -> Term n} -> f ≐ g -> ∀ t -> f ◃ t ≡ g ◃ t
◃ext p (i x) = p x
◃ext p leaf = refl
◃ext p (s fork t) = cong₂ _fork_ (◃ext p s) (◃ext p t)
_◇_ : ∀ {l m n : ℕ } -> (f : Fin m -> Term n) (g : Fin l -> Term m) -> Fin l -> Term n
f ◇ g = (f ◃_) ∘ g
≐-cong : ∀ {m n o} {f : m ~> n} {g} (h : _ ~> o) -> f ≐ g -> (h ◇ f) ≐ (h ◇ g)
≐-cong h f≐g t = cong (h ◃_) (f≐g t)
≐-sym : ∀ {m n} {f : m ~> n} {g} -> f ≐ g -> g ≐ f
≐-sym f≐g = sym ∘ f≐g
module Sub where
fact1 : ∀ {n} -> (t : Term n) -> i ◃ t ≡ t
fact1 (i x) = refl
fact1 leaf = refl
fact1 (s fork t) = cong₂ _fork_ (fact1 s) (fact1 t)
fact2 : ∀ {l m n} -> (f : Fin m -> Term n) (g : _) (t : Term l)
-> (f ◇ g) ◃ t ≡ f ◃ (g ◃ t)
fact2 f g (i x) = refl
fact2 f g leaf = refl
fact2 f g (s fork t) = cong₂ _fork_ (fact2 f g s) (fact2 f g t)
fact3 : ∀ {l m n} (f : Fin m -> Term n) (r : Fin l -> Fin m) -> (f ◇ (▹ r)) ≡ (f ∘ r)
fact3 f r = refl -- ext (λ _ -> refl)
◃ext' : ∀ {m n o} {f : Fin m -> Term n}{g : Fin m -> Term o}{h} -> f ≐ (h ◇ g) -> ∀ t -> f ◃ t ≡ h ◃ (g ◃ t)
◃ext' p t = trans (◃ext p t) (Sub.fact2 _ _ t)
s : ℕ -> ℕ
s = suc
thin : ∀ {n} -> (x : Fin (s n)) (y : Fin n) -> Fin (s n)
thin zero y = suc y
thin (suc x) zero = zero
thin (suc x) (suc y) = suc (thin x y)
p : ∀ {n} -> Fin (suc (suc n)) -> Fin (suc n)
p (suc x) = x
p zero = zero
module Thin where
fact1 : ∀ {n} x y z -> thin {n} x y ≡ thin x z -> y ≡ z
fact1 zero y .y refl = refl
fact1 (suc x) zero zero r = refl
fact1 (suc x) zero (suc z) ()
fact1 (suc x) (suc y) zero ()
fact1 (suc x) (suc y) (suc z) r = cong suc (fact1 x y z (cong p r))
fact2 : ∀ {n} x y -> ¬ thin {n} x y ≡ x
fact2 zero y ()
fact2 (suc x) zero ()
fact2 (suc x) (suc y) r = fact2 x y (cong p r)
fact3 : ∀{n} x y -> ¬ x ≡ y -> ∃ λ y' -> thin {n} x y' ≡ y
fact3 zero zero ne = ⊥-elim (ne refl)
fact3 zero (suc y) _ = y , refl
fact3 {zero} (suc ()) _ _
fact3 {suc n} (suc x) zero ne = zero , refl
fact3 {suc n} (suc x) (suc y) ne with y | fact3 x y (ne ∘ cong suc)
... | .(thin x y') | y' , refl = suc y' , refl
open import Data.Maybe
open import Category.Functor
open import Category.Monad
import Level
open RawMonad (Data.Maybe.monad {Level.zero})
thick : ∀ {n} -> (x y : Fin (suc n)) -> Maybe (Fin n)
thick zero zero = nothing
thick zero (suc y) = just y
thick {zero} (suc ()) _
thick {suc _} (suc x) zero = just zero
thick {suc _} (suc x) (suc y) = suc <$> (thick x y)
open import Data.Sum
_≡Fin_ : ∀ {n} -> (x y : Fin n) -> Dec (x ≡ y)
zero ≡Fin zero = yes refl
zero ≡Fin suc y = no λ ()
suc x ≡Fin zero = no λ ()
suc {suc _} x ≡Fin suc y with x ≡Fin y
... | yes r = yes (cong suc r)
... | no r = no λ e -> r (cong p e)
suc {zero} () ≡Fin _
module Thick where
half1 : ∀ {n} (x : Fin (suc n)) -> thick x x ≡ nothing
half1 zero = refl
half1 {suc _} (suc x) = cong (_<$>_ suc) (half1 x)
half1 {zero} (suc ())
half2 : ∀ {n} (x : Fin (suc n)) y -> ∀ y' -> thin x y' ≡ y -> thick x y ≡ just y'
half2 zero zero y' ()
half2 zero (suc y) .y refl = refl
half2 {suc n} (suc x) zero zero refl = refl
half2 {suc _} (suc _) zero (suc _) ()
half2 {suc n} (suc x) (suc y) zero ()
half2 {suc n} (suc x) (suc .(thin x y')) (suc y') refl with thick x (thin x y') | half2 x (thin x y') y' refl
... | .(just y') | refl = refl
half2 {zero} (suc ()) _ _ _
fact1 : ∀ {n} (x : Fin (suc n)) y r
-> thick x y ≡ r
-> x ≡ y × r ≡ nothing ⊎ ∃ λ y' -> thin x y' ≡ y × r ≡ just y'
fact1 x y .(thick x y) refl with x ≡Fin y
fact1 x .x ._ refl | yes refl = inj₁ (refl , half1 x)
... | no el with Thin.fact3 x y el
... | y' , thinxy'=y = inj₂ (y' , ( thinxy'=y , half2 x y y' thinxy'=y ))
check : ∀{n} (x : Fin (suc n)) (t : Term (suc n)) -> Maybe (Term n)
check x (i y) = i <$> thick x y
check x leaf = just leaf
check x (s fork t) = _fork_ <$> check x s ⊛ check x t
_for_ : ∀ {n} (t' : Term n) (x : Fin (suc n)) -> Fin (suc n) -> Term n
(t' for x) y = maybe′ i t' (thick x y)
data AList : ℕ -> ℕ -> Set where
anil : ∀ {n} -> AList n n
_asnoc_/_ : ∀ {m n} (σ : AList m n) (t' : Term m) (x : Fin (suc m))
-> AList (suc m) n
sub : ∀ {m n} (σ : AList m n) -> Fin m -> Term n
sub anil = i
sub (σ asnoc t' / x) = sub σ ◇ (t' for x)
_++_ : ∀ {l m n} (ρ : AList m n) (σ : AList l m) -> AList l n
ρ ++ anil = ρ
ρ ++ (σ asnoc t' / x) = (ρ ++ σ) asnoc t' / x
++-assoc : ∀ {l m n o} (ρ : AList l m) (σ : AList n _) (τ : AList o _) -> ρ ++ (σ ++ τ) ≡ (ρ ++ σ) ++ τ
++-assoc ρ σ anil = refl
++-assoc ρ σ (τ asnoc t / x) = cong (λ s -> s asnoc t / x) (++-assoc ρ σ τ)
module SubList where
anil-id-l : ∀ {m n} (σ : AList m n) -> anil ++ σ ≡ σ
anil-id-l anil = refl
anil-id-l (σ asnoc t' / x) = cong (λ σ -> σ asnoc t' / x) (anil-id-l σ)
fact1 : ∀ {l m n} (ρ : AList m n) (σ : AList l m) -> sub (ρ ++ σ) ≐ (sub ρ ◇ sub σ)
fact1 ρ anil v = refl
fact1 {suc l} {m} {n} r (s asnoc t' / x) v = trans hyp-on-terms ◃-assoc
where
t = (t' for x) v
hyp-on-terms = ◃ext (fact1 r s) t
◃-assoc = Sub.fact2 (sub r) (sub s) t
_∃asnoc_/_ : ∀ {m} (a : ∃ (AList m)) (t' : Term m) (x : Fin (suc m))
-> ∃ (AList (suc m))
(n , σ) ∃asnoc t' / x = n , σ asnoc t' / x
flexFlex : ∀ {m} (x y : Fin m) -> ∃ (AList m)
flexFlex {suc m} x y with thick x y
... | just y' = m , anil asnoc i y' / x
... | nothing = suc m , anil
flexFlex {zero} () _
flexRigid : ∀ {m} (x : Fin m) (t : Term m) -> Maybe (∃(AList m))
flexRigid {suc m} x t with check x t
... | just t' = just (m , anil asnoc t' / x)
... | nothing = nothing
flexRigid {zero} () _
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/address_conversion.adb | best08618/asylo | 7 | 3041 | -- { dg-do run }
-- { dg-options "-O2" }
with System.Address_To_Access_Conversions;
procedure address_conversion is
type Integer_type1 is new Integer;
type Integer_type2 is new Integer;
package AA is new System.Address_To_Access_Conversions (Integer_type1);
K1 : Integer_type1;
K2 : Integer_type2;
begin
K1 := 1;
K2 := 2;
AA.To_Pointer(K2'Address).all := K1;
if K2 /= 1 then
raise Program_Error;
end if;
end;
|
programs/oeis/030/A030102.asm | jmorken/loda | 1 | 7393 | <filename>programs/oeis/030/A030102.asm
; A030102: Base-3 reversal of n (written in base 10).
; Coded manually 2021-03-02 by <NAME>, https://github.com/neoneye
; 0,1,2,1,4,7,2,5,8,1,10,19,4,13,22,7,16,25,2,11,20,5,14,23,8,17,26,1,28,55,10,37,64,19,46,73,4,31,58,13,40,67,22,49,76,7,34,61,16,43,70,25,52,79,2,29,56,11,38,65,20,47,74,5,32,59,14,41,68,23,50,77,8,35,62,17,44,71
mov $1,0
; $1 = result = 0
lpb $0
mov $2, $0
mod $2, 3
; $2 = last digit
mul $1, 3
add $1, $2
; $1 = (result * 3) + last digit
div $0, 3 ; $0 = divide by 3
; continue while $0 is greater than 0
lpe
|
test/src/test_tiles_window.ads | Fabien-Chouteau/Giza | 7 | 7488 | <filename>test/src/test_tiles_window.ads
with Giza.Widget.Tiles;
use Giza.Widget;
with Basic_Test_Window; use Basic_Test_Window;
package Test_Tiles_Window is
type Tiles_Window is new Test_Window with private;
type Tiles_Window_Ref is access all Tiles_Window;
overriding
procedure On_Init (This : in out Tiles_Window);
overriding
procedure On_Displayed (This : in out Tiles_Window);
overriding
procedure On_Hidden (This : in out Tiles_Window);
private
type Tiles_Window is new Test_Window with record
Tile_Top_Down : Tiles.Ref;
Tile_Bottom_Up : Tiles.Ref;
Tile_Right_Left : Tiles.Ref;
Tile_Left_Right : Tiles.Ref;
end record;
end Test_Tiles_Window;
|
src/babel-files.ads | stcarrez/babel | 1 | 2900 | -----------------------------------------------------------------------
-- bkp-files -- File and directories
-- Copyright (C) 2014 Stephane.Carrez
-- Written by Stephane.Carrez (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Calendar;
with Ada.Strings.Unbounded;
with Ada.Containers.Vectors;
with Ada.Containers.Hashed_Maps;
with Util.Strings;
with Util.Systems.Types;
with Util.Encoders.SHA1;
with ADO;
package Babel.Files is
NO_IDENTIFIER : constant ADO.Identifier := ADO.NO_IDENTIFIER;
subtype File_Identifier is ADO.Identifier;
subtype Directory_Identifier is ADO.Identifier;
subtype File_Size is Long_Long_Integer;
subtype File_Mode is Util.Systems.Types.mode_t;
-- type File_Mode is mod 2**16;
type File_Type is private;
type File_Type_Array is array (Positive range <>) of File_Type;
type File_Type_Array_Access is access all File_Type_Array;
type Directory_Type is private;
type Directory_Type_Array is array (Positive range <>) of Directory_Type;
type Directory_Type_Array_Access is access all Directory_Type_Array;
NO_DIRECTORY : constant Directory_Type;
NO_FILE : constant File_Type;
type Status_Type is mod 2**16;
-- The file was modified.
FILE_MODIFIED : constant Status_Type := 16#0001#;
-- There was some error while processing this file.
FILE_ERROR : constant Status_Type := 16#8000#;
-- The SHA1 signature for the file is known and valid.
FILE_HAS_SHA1 : constant Status_Type := 16#0002#;
-- Allocate a File_Type entry with the given name for the directory.
function Allocate (Name : in String;
Dir : in Directory_Type) return File_Type;
-- Allocate a Directory_Type entry with the given name for the directory.
function Allocate (Name : in String;
Dir : in Directory_Type) return Directory_Type;
type File (Len : Positive) is record
Id : File_Identifier := NO_IDENTIFIER;
Size : File_Size := 0;
Dir : Directory_Type := NO_DIRECTORY;
Mode : File_Mode := 8#644#;
User : Uid_Type := 0;
Group : Gid_Type := 0;
Status : Status_Type := 0;
Date : Ada.Calendar.Time;
SHA1 : Util.Encoders.SHA1.Hash_Array;
Name : aliased String (1 .. Len);
end record;
-- Compare two files on their name and directory.
function "<" (Left, Right : in File_Type) return Boolean;
-- Return true if the file was modified and need a backup.
function Is_Modified (Element : in File_Type) return Boolean;
-- Return true if the file is a new file.
function Is_New (Element : in File_Type) return Boolean;
-- Set the file as modified.
procedure Set_Modified (Element : in File_Type);
-- Set the SHA1 signature that was computed for this file.
-- If the computed signature is different from the current signature,
-- the FILE_MODIFIED flag is set on the file. The FILE_HAS_SHA1 flag
-- is set on the file.
procedure Set_Signature (Element : in File_Type;
Signature : in Util.Encoders.SHA1.Hash_Array);
-- Set the file size. If the new size is different, the FILE_MODIFIED
-- flag is set on the file.
procedure Set_Size (Element : in File_Type;
Size : in File_Size);
-- Set the owner and group of the file.
procedure Set_Owner (Element : in File_Type;
User : in Uid_Type;
Group : in Gid_Type);
-- Set the file modification date.
procedure Set_Date (Element : in File_Type;
Date : in Util.Systems.Types.Timespec);
procedure Set_Date (Element : in File_Type;
Date : in Ada.Calendar.Time);
-- Return the path for the file.
function Get_Path (Element : in File_Type) return String;
-- Return the path for the directory.
function Get_Path (Element : in Directory_Type) return String;
-- Return the SHA1 signature computed for the file.
function Get_SHA1 (Element : in File_Type) return String;
-- Return the file size.
function Get_Size (Element : in File_Type) return File_Size;
-- Return the file modification date.
function Get_Date (Element : in File_Type) return Ada.Calendar.Time;
-- Return the user uid.
function Get_User (Element : in File_Type) return Uid_Type;
-- Return the group gid.
function Get_Group (Element : in File_Type) return Gid_Type;
-- Return the file unix mode.
function Get_Mode (Element : in File_Type) return File_Mode;
type File_Container is limited interface;
-- Add the file with the given name in the container.
procedure Add_File (Into : in out File_Container;
Element : in File_Type) is abstract;
-- Add the directory with the given name in the container.
procedure Add_Directory (Into : in out File_Container;
Element : in Directory_Type) is abstract;
-- Create a new file instance with the given name in the container.
function Create (Into : in File_Container;
Name : in String) return File_Type is abstract;
-- Create a new directory instance with the given name in the container.
function Create (Into : in File_Container;
Name : in String) return Directory_Type is abstract;
-- Find the file with the given name in this file container.
-- Returns NO_FILE if the file was not found.
function Find (From : in File_Container;
Name : in String) return File_Type is abstract;
-- Find the directory with the given name in this file container.
-- Returns NO_DIRECTORY if the directory was not found.
function Find (From : in File_Container;
Name : in String) return Directory_Type is abstract;
-- Set the directory object associated with the container.
procedure Set_Directory (Into : in out File_Container;
Directory : in Directory_Type) is abstract;
-- Execute the Process procedure on each directory found in the container.
procedure Each_Directory (Container : in File_Container;
Process : not null access
procedure (Dir : in Directory_Type)) is abstract;
-- Execute the Process procedure on each file found in the container.
procedure Each_File (Container : in File_Container;
Process : not null access
procedure (F : in File_Type)) is abstract;
type Default_Container is new File_Container with private;
-- Add the file with the given name in the container.
overriding
procedure Add_File (Into : in out Default_Container;
Element : in File_Type);
-- Add the directory with the given name in the container.
overriding
procedure Add_Directory (Into : in out Default_Container;
Element : in Directory_Type);
-- Create a new file instance with the given name in the container.
overriding
function Create (Into : in Default_Container;
Name : in String) return File_Type;
-- Create a new directory instance with the given name in the container.
overriding
function Create (Into : in Default_Container;
Name : in String) return Directory_Type;
-- Find the file with the given name in this file container.
-- Returns NO_FILE if the file was not found.
overriding
function Find (From : in Default_Container;
Name : in String) return File_Type;
-- Find the directory with the given name in this file container.
-- Returns NO_DIRECTORY if the directory was not found.
overriding
function Find (From : in Default_Container;
Name : in String) return Directory_Type;
-- Set the directory object associated with the container.
overriding
procedure Set_Directory (Into : in out Default_Container;
Directory : in Directory_Type);
-- Execute the Process procedure on each directory found in the container.
overriding
procedure Each_Directory (Container : in Default_Container;
Process : not null access
procedure (Dir : in Directory_Type));
-- Execute the Process procedure on each file found in the container.
overriding
procedure Each_File (Container : in Default_Container;
Process : not null access
procedure (F : in File_Type));
private
type Directory;
type String_Access is access all String;
type File_Type is access all File;
type Directory_Type is access all Directory;
package File_Maps is new
Ada.Containers.Hashed_Maps (Key_Type => Util.Strings.Name_Access,
Element_Type => File_Type,
Hash => Util.Strings.Hash,
Equivalent_Keys => Util.Strings.Equivalent_Keys,
"=" => "=");
package Directory_Maps is new
Ada.Containers.Hashed_Maps (Key_Type => Util.Strings.Name_Access,
Element_Type => Directory_Type,
Hash => Util.Strings.Hash,
Equivalent_Keys => Util.Strings.Equivalent_Keys,
"=" => "=");
type Directory is record
Id : Directory_Identifier := NO_IDENTIFIER;
Parent : Directory_Type;
Mode : File_Mode := 8#755#;
User : Uid_Type := 0;
Group : Gid_Type := 0;
Files : File_Maps.Map;
Children : Directory_Maps.Map;
-- Children : Directory_Type_Array_Access;
Name_Pos : Natural := 0;
Name : String_Access;
end record;
package File_Vectors is new
Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => File_Type,
"=" => "=");
package Directory_Vectors is new
Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Directory_Type,
"=" => "=");
subtype Directory_Vector is Directory_Vectors.Vector;
type Default_Container is new Babel.Files.File_Container with record
Current : Directory_Type;
Files : File_Vectors.Vector;
Dirs : Directory_Vectors.Vector;
end record;
NO_DIRECTORY : constant Directory_Type := null;
NO_FILE : constant File_Type := null;
end Babel.Files;
|
programs/oeis/185/A185212.asm | karttu/loda | 1 | 97949 | ; A185212: a(n) = 12*n^2 - 8*n + 1.
; 1,5,33,85,161,261,385,533,705,901,1121,1365,1633,1925,2241,2581,2945,3333,3745,4181,4641,5125,5633,6165,6721,7301,7905,8533,9185,9861,10561,11285,12033,12805,13601,14421,15265,16133,17025,17941,18881,19845,20833,21845,22881,23941,25025,26133,27265,28421,29601,30805,32033,33285,34561,35861,37185,38533,39905,41301,42721,44165,45633,47125,48641,50181,51745,53333,54945,56581,58241,59925,61633,63365,65121,66901,68705,70533,72385,74261,76161,78085,80033,82005,84001,86021,88065,90133,92225,94341,96481,98645,100833,103045,105281,107541,109825,112133,114465,116821,119201,121605,124033,126485,128961,131461,133985,136533,139105,141701,144321,146965,149633,152325,155041,157781,160545,163333,166145,168981,171841,174725,177633,180565,183521,186501,189505,192533,195585,198661,201761,204885,208033,211205,214401,217621,220865,224133,227425,230741,234081,237445,240833,244245,247681,251141,254625,258133,261665,265221,268801,272405,276033,279685,283361,287061,290785,294533,298305,302101,305921,309765,313633,317525,321441,325381,329345,333333,337345,341381,345441,349525,353633,357765,361921,366101,370305,374533,378785,383061,387361,391685,396033,400405,404801,409221,413665,418133,422625,427141,431681,436245,440833,445445,450081,454741,459425,464133,468865,473621,478401,483205,488033,492885,497761,502661,507585,512533,517505,522501,527521,532565,537633,542725,547841,552981,558145,563333,568545,573781,579041,584325,589633,594965,600321,605701,611105,616533,621985,627461,632961,638485,644033,649605,655201,660821,666465,672133,677825,683541,689281,695045,700833,706645,712481,718341,724225,730133,736065,742021
mul $0,6
sub $0,2
pow $0,2
mov $1,$0
div $1,3
|
software/kernel/cpu.adb | TUM-EI-RCS/StratoX | 12 | 13716 |
-- todo: initialize in several functions: initGPIO, initI2C, use HAL
-- with Config; use Config;
with HIL.GPIO;
with HIL.SPI;
with HIL.Clock;
with HIL.UART;
with HIL.I2C;
with HIL.Random;
with Ada.Real_Time; use Ada.Real_Time;
package body CPU with SPARK_Mode is
-- configures hardware registers
procedure initialize is
startup_time : constant Ada.Real_Time.Time := Ada.Real_Time.Clock;
begin
-- Configure GPIO
HIL.Clock.configure;
HIL.Random.initialize;
HIL.UART.configure;
HIL.GPIO.configure;
HIL.SPI.configure;
delay until startup_time + Ada.Real_Time.Milliseconds (200);
HIL.I2C.initialize;
end initialize;
procedure sleep is -- ??
begin
null;
end sleep;
end CPU;
|
hookflash-core/webRTC/webRTC_ios/third_party/libvpx/asm_com_offsets.asm | ilin-in/OP | 1 | 84111 | @ This file was created from a .asm file
@ using the ads2gas_apple.pl script.
.set WIDE_REFERENCE, 0
.set ARCHITECTURE, 5
.set DO1STROUNDING, 0
.set yv12_buffer_config_y_width , 0
.set yv12_buffer_config_y_height , 4
.set yv12_buffer_config_y_stride , 8
.set yv12_buffer_config_uv_width , 12
.set yv12_buffer_config_uv_height , 16
.set yv12_buffer_config_uv_stride , 20
.set yv12_buffer_config_y_buffer , 24
.set yv12_buffer_config_u_buffer , 28
.set yv12_buffer_config_v_buffer , 32
.set yv12_buffer_config_border , 40
.set VP8BORDERINPIXELS_VAL , 32
|
+extras/external_libs/zlib/src/zlib-1.2.11/contrib/vstudio/vc14/x86/TestZlibDebug/Tmp/compress.asm | dkovari/ExtrasToolbox | 0 | 14382 | <filename>+extras/external_libs/zlib/src/zlib-1.2.11/contrib/vstudio/vc14/x86/TestZlibDebug/Tmp/compress.asm
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.14.26428.1
TITLE C:\Users\dkovari\Documents\GitHub\ExtrasToolbox\+extras\external_libs\zlib\src\zlib-1.2.11\compress.c
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
PUBLIC _compress@16
PUBLIC _compress2@20
PUBLIC _compressBound@4
EXTRN _deflate@8:PROC
EXTRN _deflateEnd@4:PROC
EXTRN _deflateInit_@16:PROC
_DATA SEGMENT
$SG92676 DB '1.2.11', 00H
_DATA ENDS
; Function compile flags: /Odtp
; File c:\users\dkovari\documents\github\extrastoolbox\+extras\external_libs\zlib\src\zlib-1.2.11\compress.c
_TEXT SEGMENT
_sourceLen$ = 8 ; size = 4
_compressBound@4 PROC
; 83 : {
push ebp
mov ebp, esp
; 84 : return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
mov eax, DWORD PTR _sourceLen$[ebp]
shr eax, 12 ; 0000000cH
add eax, DWORD PTR _sourceLen$[ebp]
mov ecx, DWORD PTR _sourceLen$[ebp]
shr ecx, 14 ; 0000000eH
add eax, ecx
mov edx, DWORD PTR _sourceLen$[ebp]
shr edx, 25 ; 00000019H
lea eax, DWORD PTR [eax+edx+13]
; 85 : (sourceLen >> 25) + 13;
; 86 : }
pop ebp
ret 4
_compressBound@4 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File c:\users\dkovari\documents\github\extrastoolbox\+extras\external_libs\zlib\src\zlib-1.2.11\compress.c
_TEXT SEGMENT
_stream$ = -84 ; size = 56
tv86 = -28 ; size = 4
tv80 = -24 ; size = 4
tv76 = -20 ; size = 4
tv72 = -16 ; size = 4
_max$ = -12 ; size = 4
_left$ = -8 ; size = 4
_err$ = -4 ; size = 4
_dest$ = 8 ; size = 4
_destLen$ = 12 ; size = 4
_source$ = 16 ; size = 4
_sourceLen$ = 20 ; size = 4
_level$ = 24 ; size = 4
_compress2@20 PROC
; 28 : {
push ebp
mov ebp, esp
sub esp, 84 ; 00000054H
; 29 : z_stream stream;
; 30 : int err;
; 31 : const uInt max = (uInt)-1;
mov DWORD PTR _max$[ebp], -1
; 32 : uLong left;
; 33 :
; 34 : left = *destLen;
mov eax, DWORD PTR _destLen$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR _left$[ebp], ecx
; 35 : *destLen = 0;
mov edx, DWORD PTR _destLen$[ebp]
mov DWORD PTR [edx], 0
; 36 :
; 37 : stream.zalloc = (alloc_func)0;
mov DWORD PTR _stream$[ebp+32], 0
; 38 : stream.zfree = (free_func)0;
mov DWORD PTR _stream$[ebp+36], 0
; 39 : stream.opaque = (voidpf)0;
mov DWORD PTR _stream$[ebp+40], 0
; 40 :
; 41 : err = deflateInit(&stream, level);
push 56 ; 00000038H
push OFFSET $SG92676
mov eax, DWORD PTR _level$[ebp]
push eax
lea ecx, DWORD PTR _stream$[ebp]
push ecx
call _deflateInit_@16
mov DWORD PTR _err$[ebp], eax
; 42 : if (err != Z_OK) return err;
cmp DWORD PTR _err$[ebp], 0
je SHORT $LN5@compress2
mov eax, DWORD PTR _err$[ebp]
jmp $LN1@compress2
$LN5@compress2:
; 43 :
; 44 : stream.next_out = dest;
mov edx, DWORD PTR _dest$[ebp]
mov DWORD PTR _stream$[ebp+12], edx
; 45 : stream.avail_out = 0;
mov DWORD PTR _stream$[ebp+16], 0
; 46 : stream.next_in = (z_const Bytef *)source;
mov eax, DWORD PTR _source$[ebp]
mov DWORD PTR _stream$[ebp], eax
; 47 : stream.avail_in = 0;
mov DWORD PTR _stream$[ebp+4], 0
$LN4@compress2:
; 48 :
; 49 : do {
; 50 : if (stream.avail_out == 0) {
cmp DWORD PTR _stream$[ebp+16], 0
jne SHORT $LN6@compress2
; 51 : stream.avail_out = left > (uLong)max ? max : (uInt)left;
mov ecx, DWORD PTR _left$[ebp]
cmp ecx, DWORD PTR _max$[ebp]
jbe SHORT $LN9@compress2
mov edx, DWORD PTR _max$[ebp]
mov DWORD PTR tv72[ebp], edx
jmp SHORT $LN10@compress2
$LN9@compress2:
mov eax, DWORD PTR _left$[ebp]
mov DWORD PTR tv72[ebp], eax
$LN10@compress2:
mov ecx, DWORD PTR tv72[ebp]
mov DWORD PTR _stream$[ebp+16], ecx
; 52 : left -= stream.avail_out;
mov edx, DWORD PTR _left$[ebp]
sub edx, DWORD PTR _stream$[ebp+16]
mov DWORD PTR _left$[ebp], edx
$LN6@compress2:
; 53 : }
; 54 : if (stream.avail_in == 0) {
cmp DWORD PTR _stream$[ebp+4], 0
jne SHORT $LN7@compress2
; 55 : stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen;
mov eax, DWORD PTR _sourceLen$[ebp]
cmp eax, DWORD PTR _max$[ebp]
jbe SHORT $LN11@compress2
mov ecx, DWORD PTR _max$[ebp]
mov DWORD PTR tv76[ebp], ecx
jmp SHORT $LN12@compress2
$LN11@compress2:
mov edx, DWORD PTR _sourceLen$[ebp]
mov DWORD PTR tv76[ebp], edx
$LN12@compress2:
mov eax, DWORD PTR tv76[ebp]
mov DWORD PTR _stream$[ebp+4], eax
; 56 : sourceLen -= stream.avail_in;
mov ecx, DWORD PTR _sourceLen$[ebp]
sub ecx, DWORD PTR _stream$[ebp+4]
mov DWORD PTR _sourceLen$[ebp], ecx
$LN7@compress2:
; 57 : }
; 58 : err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH);
cmp DWORD PTR _sourceLen$[ebp], 0
je SHORT $LN13@compress2
mov DWORD PTR tv80[ebp], 0
jmp SHORT $LN14@compress2
$LN13@compress2:
mov DWORD PTR tv80[ebp], 4
$LN14@compress2:
mov edx, DWORD PTR tv80[ebp]
push edx
lea eax, DWORD PTR _stream$[ebp]
push eax
call _deflate@8
mov DWORD PTR _err$[ebp], eax
; 59 : } while (err == Z_OK);
cmp DWORD PTR _err$[ebp], 0
je $LN4@compress2
; 60 :
; 61 : *destLen = stream.total_out;
mov ecx, DWORD PTR _destLen$[ebp]
mov edx, DWORD PTR _stream$[ebp+20]
mov DWORD PTR [ecx], edx
; 62 : deflateEnd(&stream);
lea eax, DWORD PTR _stream$[ebp]
push eax
call _deflateEnd@4
; 63 : return err == Z_STREAM_END ? Z_OK : err;
cmp DWORD PTR _err$[ebp], 1
jne SHORT $LN15@compress2
mov DWORD PTR tv86[ebp], 0
jmp SHORT $LN16@compress2
$LN15@compress2:
mov ecx, DWORD PTR _err$[ebp]
mov DWORD PTR tv86[ebp], ecx
$LN16@compress2:
mov eax, DWORD PTR tv86[ebp]
$LN1@compress2:
; 64 : }
mov esp, ebp
pop ebp
ret 20 ; 00000014H
_compress2@20 ENDP
_TEXT ENDS
; Function compile flags: /Odtp
; File c:\users\dkovari\documents\github\extrastoolbox\+extras\external_libs\zlib\src\zlib-1.2.11\compress.c
_TEXT SEGMENT
_dest$ = 8 ; size = 4
_destLen$ = 12 ; size = 4
_source$ = 16 ; size = 4
_sourceLen$ = 20 ; size = 4
_compress@16 PROC
; 73 : {
push ebp
mov ebp, esp
; 74 : return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
push -1
mov eax, DWORD PTR _sourceLen$[ebp]
push eax
mov ecx, DWORD PTR _source$[ebp]
push ecx
mov edx, DWORD PTR _destLen$[ebp]
push edx
mov eax, DWORD PTR _dest$[ebp]
push eax
call _compress2@20
; 75 : }
pop ebp
ret 16 ; 00000010H
_compress@16 ENDP
_TEXT ENDS
END
|
libsrc/target/zx-common/fcntl/esxdos/fdtell.asm | ahjelm/z88dk | 640 | 179458 |
MODULE esx_fdtell
SECTION code_esxdos
PUBLIC fdtell
PUBLIC _fdtell
EXTERN asm_esxdos_f_fgetpos
;long fdtell(int fd)
.fdtell
._fdtell
pop bc ;ret
pop hl ;fd
push hl
push bc
push ix ;callers
call asm_esxdos_f_fgetpos
pop ix
ret nc
ld hl,65535
ld d,h
ld e,l
ret
|
libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sccz80/ts_vmod.asm | Frodevan/z88dk | 640 | 23498 | ; void ts_vmod(unsigned char mode)
SECTION code_clib
SECTION code_arch
PUBLIC ts_vmod
EXTERN asm_ts_vmod
defc ts_vmod = asm_ts_vmod
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _ts_vmod
defc _ts_vmod = ts_vmod
ENDIF
|
src/boot/serial.asm | robey/funos | 5 | 243902 | ;
; try to use the serial port (COM1) to communicate.
;
%define module serial
%include "api.macro"
%include "io.macro"
%define SERIAL1_PORT 0x3f8
%define SERIAL1_IRQ 4
%define MODE_8N1 0x03
%define MODE_DIVISOR_LATCH 0x80
%define DIVISOR 115200
%define SPEED_9600 (DIVISOR / 9600)
%define SPEED_38400 (DIVISOR / 38400)
%define PORT_TX 0 ; w
%define PORT_RX 0 ; r
%define PORT_DIVISOR_LOW 0 ; rw latch
%define PORT_INT_ENABLE 1 ; rw
%define PORT_DIVISOR_HIGH 1 ; rw latch
%define PORT_INT_ID 2 ; r
%define PORT_FIFO_CONTROL 2 ; w
%define PORT_LINE_CONTROL 3 ; rw
%define PORT_MODEM_CONTROL 4 ; rw
%define PORT_LINE_STATUS 5 ; r
%define PORT_MODEM_STATUS 6 ; r
%define PORT_SCRATCH 7 ; rw
%define INT_TX (1 << 1)
%define INT_RX (1 << 0)
%define STATUS_INT (1 << 0)
%define STATUS_REASON (7 << 1)
%define STATUS_REASON_TX (1 << 1)
%define STATUS_REASON_RX (2 << 1)
%define LINE_STATUS_TX_READY (1 << 5)
section .text
; set serial port 1 to 38400, 8N1
global serial_init
serial_init:
push eax
push edx
outio SERIAL1_PORT + PORT_LINE_CONTROL, MODE_DIVISOR_LATCH | MODE_8N1
; in theory, there could be high bits set, but anything 1200bps or better
; won't use them.
outio SERIAL1_PORT + PORT_DIVISOR_HIGH, 0
outio SERIAL1_PORT + PORT_DIVISOR_LOW, SPEED_38400
outio SERIAL1_PORT + PORT_LINE_CONTROL, MODE_8N1
; turn on interrupt for receive
outio SERIAL1_PORT + PORT_INT_ENABLE, INT_RX
mov eax, 0x20 + SERIAL1_IRQ
mov edi, irq_handler
call irq_set_handler
mov eax, SERIAL1_IRQ
call irq_enable
pop edx
pop eax
ret
irq_handler:
push eax
push edx
inio SERIAL1_PORT + PORT_INT_ID
test al, STATUS_INT
jnz .out
and al, STATUS_REASON
cmp al, STATUS_REASON_RX
jne .out
xor eax, eax
inio SERIAL1_PORT + PORT_RX
push eax
call event_serial
pop eax
.out:
outio 0x20, 0x20
pop edx
pop eax
iret
; (external)
global serial_write
serial_write:
push ebp
mov ebp, esp
push edx
push eax
.loop:
inio SERIAL1_PORT + PORT_LINE_STATUS
test al, LINE_STATUS_TX_READY
jz .loop
mov eax, [ebp + 8]
outioa SERIAL1_PORT + PORT_TX
pop eax
pop edx
pop ebp
ret
|
oeis/311/A311613.asm | neoneye/loda-programs | 11 | 7173 | ; A311613: Coordination sequence Gal.6.231.1 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by <NAME>
; 1,4,8,12,18,22,28,32,38,42,46,50,54,58,62,68,72,78,82,88,92,96,100,104,108,112,118,122,128,132,138,142,146,150,154,158,162,168,172,178,182,188,192,196,200,204,208,212,218,222
mul $0,5
mov $1,1
mov $3,$0
lpb $0
mov $0,5
mul $0,$3
pow $3,7
mul $3,9
mov $2,$3
mod $2,11
add $0,$2
div $0,11
mov $1,$0
lpe
add $0,$1
|
oeis/017/A017175.asm | neoneye/loda-programs | 11 | 28300 | ; A017175: a(n) = (9*n + 1)^3.
; 1,1000,6859,21952,50653,97336,166375,262144,389017,551368,753571,1000000,1295029,1643032,2048383,2515456,3048625,3652264,4330747,5088448,5929741,6859000,7880599,8998912,10218313,11543176,12977875,14526784,16194277,17984728,19902511,21952000,24137569,26463592,28934443,31554496,34328125,37259704,40353607,43614208,47045881,50653000,54439939,58411072,62570773,66923416,71473375,76225024,81182737,86350888,91733851,97336000,103161709,109215352,115501303,122023936,128787625,135796744,143055667
mul $0,9
add $0,1
pow $0,3
|
oeis/308/A308823.asm | neoneye/loda-programs | 11 | 83401 | ; A308823: Sum of the smallest parts of the partitions of n into 5 parts.
; Submitted by <NAME>
; 0,0,0,0,0,1,1,2,3,5,8,11,15,21,28,38,48,62,78,98,122,149,181,219,262,314,370,436,510,595,691,797,916,1050,1198,1365,1545,1747,1968,2212,2480,2771,3089,3437,3814,4227,4669,5151,5670,6232,6838,7487,8185,8936
lpb $0
mov $2,$0
sub $0,5
seq $2,26811 ; Number of partitions of n in which the greatest part is 5.
add $1,$2
lpe
mov $0,$1
|
oeis/309/A309759.asm | neoneye/loda-programs | 11 | 9193 | <reponame>neoneye/loda-programs
; A309759: Numbers that are sums of consecutive powers of 4.
; Submitted by <NAME>
; 1,4,5,16,20,21,64,80,84,85,256,320,336,340,341,1024,1280,1344,1360,1364,1365,4096,5120,5376,5440,5456,5460,5461,16384,20480,21504,21760,21824,21840,21844,21845,65536,81920,86016,87040,87296,87360,87376,87380,87381,262144,327680,344064,348160,349184,349440,349504,349520,349524,349525,1048576,1310720,1376256,1392640,1396736,1397760,1398016,1398080,1398096,1398100,1398101,4194304,5242880,5505024,5570560,5586944,5591040,5592064,5592320,5592384,5592400,5592404,5592405,16777216,20971520,22020096
seq $0,224195 ; Ordered sequence of numbers of form (2^n - 1)*2^m + 1 where n >= 1, m >= 1.
seq $0,98871 ; Sums of distinct powers of 4 plus 1.
sub $0,6
div $0,4
add $0,1
|
boot/stage1/print.asm | wodOS/wodOS | 4 | 7026 | <reponame>wodOS/wodOS
;;
; wodOS Operating System
; Copyright © 2021-2022 wodOS Operating System Developers. All rights reserved.
;
; Use of this source code is governed by a BSD-style license that can be
; found in the LICENSE file.
;
; Contributor(s):
; - <NAME> <<EMAIL>>
;;
; prints a string to the screen
print:
push si
push ax
.loop:
lodsb
or al, al
jz .exit
mov ah, 0x0e
mov bh, 0
int 0x10
jmp .loop
.exit:
pop ax
pop si
ret |
org.alloytools.alloy.diff/misc/bank.als | jringert/alloy-diff | 1 | 3930 | <reponame>jringert/alloy-diff<gh_stars>1-10
module bank
sig Branch {}
sig Bank{
branches: set Branch
} {
#branches = 1
}
fact {
no Branch
}
pred a (X : set univ) {
#X = 0
}
pred b {
#Bank = 0
}
run {a[Branch] or b} for 7
|
demo/ctx/src/Demo.g4 | capybara1/CompilerDemo | 0 | 2961 | grammar Demo; // Combined grammar for lexer and parser
// Conventions:
// - parser rules start with lowe case
// - lexer reules start with upper case
//
// Program
//
program
: statement (NEWLINE statement)*
;
//
// Statements
//
statement
: assignment
| print
;
assignment
: IDENTIFIER ASSIGN expression
;
print
: 'print' value=expression #PrintStatement
;
//
// Expressions
//
// Order of rules implies order of precedence
expression
: '(' expression ')' #ParanthesisExpression
| op= (ADD | SUB) expression # UnaryOperationExpression
| lhs=expression MUL rhs=expression # MulOperationExpression
| lhs=expression DIV rhs=expression # DivOperationExpression
| lhs=expression ADD rhs=expression # AddOperationExpression
| lhs=expression SUB rhs=expression # SubOperationExpression
| name=IDENTIFIER # VariableExpression
| value=literal # LiteralExpression
;
//
// Operators
//
ASSIGN
: '='
;
ADD : '+'
;
SUB : '-'
;
MUL : '*'
;
DIV : '/'
;
//
// Literals
//
literal
: integerLiteral
| stringLiteral
;
integerLiteral
: NUMBER
;
stringLiteral
: STRING
;
STRING
: '"' CHAR* '"'
;
fragment
CHAR
: ~["\\\r\n]
| ESCAPE_SEQUENCE
;
fragment
ESCAPE_SEQUENCE
: SIMPLE_ESCAPE_SEQUENCE
| HEXADECIMAL_ESCAPE_SEQUENCE
;
fragment
SIMPLE_ESCAPE_SEQUENCE
: '\\' ["?abfnrtv\\]
;
fragment
HEXADECIMAL_ESCAPE_SEQUENCE
: '\\x' HEXADECIMAL_DIGIT+
;
NUMBER
: [0-9]+
;
fragment
HEXADECIMAL_DIGIT
: [0-9a-fA-F]
;
//
// Identifiers
//
IDENTIFIER
: LETTER LETTER_OR_DIGIT*
;
fragment
LETTER
: [a-zA-Z$_]
;
fragment
LETTER_OR_DIGIT
: [a-zA-Z0-9$_]
;
//
// Whitespace and comments
//
WS : [ \t\u000C]+ -> skip
;
NEWLINE
: '\r'? '\n'
;
COMMENT
: '/*' .*? '*/' -> skip
;
LINE_COMMENT
: '//' ~[\r\n]* -> skip
;
|
tarmi-environments.adb | DerickEddington/tarmi | 0 | 14987 | with System.Storage_Elements ;
package body Tarmi.Environments is
-- TODO: Make this hash function give a better distribution.
function Hash_Symbol (S : Symbol) return Hash_Type is
package SE renames System.Storage_Elements ;
--use type SE.Integer_Address ;
begin
--return Hash_Type (SE.To_Integer (S.all'Address) mod Hash_Type'Modulus) ;
return Hash_Type (SE.To_Integer (S.all'Address));
end Hash_Symbol;
function Make_Environment (Bindings : Bindings_Spec) return Environment is
E : Environment := new Environment_R ;
I : Positive := 1;
begin
while I < Bindings'Last loop
Bind (E, Bindings(I), Bindings(I+1));
I := I + 2;
end loop;
return E;
end Make_Environment;
-- TODO: Remove after development.
function Child_Environment (Env : Environment) return Environment is
begin
return new Environment_R'(Parent => Env , Bindings => <>);
end Child_Environment;
-- TODO: Not-found should not raise Ada exception.
-- It should signal a Kernel error.
function Lookup (Name : Symbol; Env : Environment) return Datum is
use Hashed_Maps;
C : Cursor := Find (Env.Bindings, Name);
begin
if C /= No_Element then
return Element (C);
else
if Env.Parent /= null then
return Lookup (Name, Environment (Env.Parent));
else
-- TODO: Instead, signal Kernel error
raise Program_Error ;
end if;
end if;
end Lookup;
procedure Bind (Env : Environment; Name : Datum; Val : Datum) is
begin
if Name /= Ignore then
Hashed_Maps.Include (Env.Bindings, Symbol (Name), Val);
end if ;
end Bind;
-- TODO: Acyclic and no-duplicates checking.
procedure Match_Bind (Env : Environment; Param_Tree : Datum; Obj : Datum) is
begin
if Param_Tree = Ignore then
return ;
elsif Param_Tree = Nil then
if Obj /= Nil then
-- TODO: Instead, signal Kernel error
raise Constraint_Error ;
end if;
elsif Param_Tree.all in Symbol_R then
Bind (Env, Param_Tree, Obj) ;
elsif Param_Tree.all in Pair_R then
if Obj.all in Pair_R then
Match_Bind (Env, Pair(Param_Tree).First, Pair(Obj).First) ;
Match_Bind (Env, Pair(Param_Tree).Second, Pair(Obj).Second) ;
else
-- TODO: Instead, signal Kernel error
raise Constraint_Error ;
end if ;
else
-- TODO: Instead, signal Kernel error
raise Constraint_Error ;
end if ;
end Match_Bind;
end Tarmi.Environments;
|
src/asis/asis-definitions.ads | My-Colaborations/dynamo | 15 | 5005 | <filename>src/asis/asis-definitions.ads
------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT INTERFACE COMPONENTS --
-- --
-- A S I S . D E F I N I T I O N S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2006-2011, Free Software Foundation, Inc. --
-- --
-- This specification is adapted from the Ada Semantic Interface --
-- Specification Standard (ISO/IEC 15291) for use with GNAT. In accordance --
-- with the copyright of that document, you can freely copy and modify this --
-- specification, provided that if you redistribute a modified version, any --
-- changes that you have made are clearly indicated. --
-- --
-- This specification also contains suggestions and discussion items --
-- related to revising the ASIS Standard according to the changes proposed --
-- for the new revision of the Ada standard. The copyright notice above, --
-- and the license provisions that follow apply solely to these suggestions --
-- and discussion items that are separated by the corresponding comment --
-- sentinels --
-- --
-- ASIS-for-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 --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY 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 ASIS-for-GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the --
-- Software Engineering Laboratory of the Swiss Federal Institute of --
-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the --
-- Scientific Research Computer Center of Moscow State University (SRCC --
-- MSU), Russia, with funding partially provided by grants from the Swiss --
-- National Science Foundation and the Swiss Academy of Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore --
-- (http://www.adacore.com). --
-- --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- 16 package Asis.Definitions
-- Suggestions related to changing this specification to accept new Ada
-- features as defined in incoming revision of the Ada Standard (ISO 8652)
-- are marked by following comment sentinels:
--
-- --|A2005 start
-- ... the suggestion goes here ...
-- --|A2005 end
--
-- and the discussion items are marked by the comment sentinels of teh form:
--
-- --|D2005 start
-- ... the discussion item goes here ...
-- --|D2005 end
------------------------------------------------------------------------------
------------------------------------------------------------------------------
package Asis.Definitions is
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Asis.Definitions encapsulates a set of queries that operate on A_Definition
-- and An_Association elements.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- 16.1 function Corresponding_Type_Operators
------------------------------------------------------------------------------
-- --|ER---------------------------------------------------------------------
-- --|ER A_Type_Definition - 3.2.1
------------------------------------------------------------------------------
function Corresponding_Type_Operators
(Type_Definition : Asis.Type_Definition)
return Asis.Declaration_List;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the type to query
--
-- Returns a list of operators. These include all predefined operators, and
-- all user-defined operator overloads, that have been implicitly or
-- explicitly declared for the type. (Reference Manual 7.3.1(2))
--
-- This list includes only operators appropriate for the type, from the set:
-- and or xor = /= < <= > >= + - & * / mod rem ** abs not
--
-- Returns a Nil_Element_List if there are no predefined or overloaded
-- operators for the type.
--
-- Returns a Nil_Element_List if the implementation does not provide
-- such implicit declarations.
--
-- The Enclosing_Element for each implicit declaration is the declaration
-- (type or object) that declared the type.
--
-- --|D2005 start
--
-- It seems that there are at least two serious problems with the definition
-- of this query
--
-- 1. Consider an Element representing an implicit inherited user-defined
-- operator function. According to the definition of this query, the
-- Enclosing_Element for this Element should be a type DECLARATION, but the
-- same (that is, Is_Equal) Element can be obtained as a result of applying
-- Implicit_Inherited_Subprograms to the type DEFINITION, and the
-- documentation of Implicit_Inherited_Subprograms says that the
-- Enclosing_Element for this operator function Element should be the
-- type DEFINITION. But for two Is_Equal Elements the corresponding results
-- of Enclosing_Element should also be Is_Equal!
--
-- 2. Should this query return ALL the operator function having the argument
-- type as a type of a parameter or result, or should it return only those
-- opeartor functions that are PRIMITIVE OPERATIONS of the type? The first
-- approach looks too expensive from the implementation viewpoint
--
-- --|D2005 end
--
-- For limited private types, if a user-defined equality operator has
-- been defined, an Ada implementation has two choices when dealing with an
-- instance of the "/=" operator. a) treat A/=B as NOT(A=B), b) implicitly
-- create a "/=" operator. Implementations that take the second alternative
-- will include this implicit inequality operation in their result.
-- Implementations that choose the first alternative are encouraged to hide
-- this choice beneath the ASIS interface and to "fake" an inequality
-- operation. Failing that, the function call, representing the NOT
-- operation, must have Is_Part_Of_Implicit = True so that an ASIS application
-- can tell the difference between a user-specified NOT(A=B) and an
-- implementation-specific A/=B transformation.
--
-- Appropriate Definition_Kinds:
-- A_Type_Definition
-- A_Formal_Type_Declaration
--
-- Returns Declaration_Kinds:
-- A_Function_Declaration
-- A_Function_Body_Declaration
-- A_Function_Body_Stub
-- A_Function_Renaming_Declaration
-- A_Function_Instantiation
-- A_Formal_Function_Declaration
--
-- --|IP Implementation Permissions:
-- --|IP
-- --|IP The result may or may not include language defined operators that
-- --|IP have been overridden by user-defined overloads. Operators that are
-- --|IP totally hidden, in all contexts, by user-defined operators may be
-- --|IP omitted from the list.
-- --|IP
-- --|IP Some implementations do not represent all forms of implicit
-- --|IP declarations such that elements representing them can be easily
-- --|IP provided. An implementation can choose whether or not to construct
-- --|IP and provide artificial declarations for implicitly declared elements.
-- --|IP
-- --|ER---------------------------------------------------------------------
-- --|ER A_Derived_Type_Definition - 3.4
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Parent_Subtype_Indication
-- --|ER---------------------------------------------------------------------
-- --|ER A_Derived_Record_Extension_Definition - 3.4
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Parent_Subtype_Indication
-- --|CR function Record_Definition
--
------------------------------------------------------------------------------
-- 16.2 function Parent_Subtype_Indication
------------------------------------------------------------------------------
function Parent_Subtype_Indication
(Type_Definition : Asis.Type_Definition)
return Asis.Subtype_Indication;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the derived_type_definition to query
--
-- Returns the parent_subtype_indication following the reserved word "new".
--
-- Appropriate Type_Kinds:
-- A_Derived_Type_Definition
-- A_Derived_Record_Extension_Definition
--
-- Returns Definition_Kinds:
-- A_Subtype_Indication
--
------------------------------------------------------------------------------
-- 16.3 function Record_Definition
------------------------------------------------------------------------------
function Record_Definition
(Type_Definition : Asis.Type_Definition)
return Asis.Definition;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the definition to query
--
-- Returns the record definition of the type_definition.
--
-- Appropriate Type_Kinds:
-- A_Derived_Record_Extension_Definition
-- A_Record_Type_Definition
-- A_Tagged_Record_Type_Definition
--
-- Returns Definition_Kinds:
-- A_Record_Definition
-- A_Null_Record_Definition
--
------------------------------------------------------------------------------
-- 16.4 function Implicit_Inherited_Declarations
------------------------------------------------------------------------------
function Implicit_Inherited_Declarations
(Definition : Asis.Definition)
return Asis.Declaration_List;
------------------------------------------------------------------------------
-- Definition - Specifies the derived type to query
--
-- Returns a list of Is_Part_Of_Implicit inherited enumeration literals,
-- discriminants, components, protected subprograms, or entries of a
-- derived_type_definition whose parent type is an enumeration type, or a
-- composite type other than an array type. See Reference Manual 3.4(10-14).
--
-- Returns a Nil_Element_List if the root type of derived_type_definition is
-- not an enumeration, record, task, or protected type.
--
-- Returns a Nil_Element_List if the implementation does not provide
-- such implicit declarations.
--
-- The Enclosing_Element for each of the implicit declarations is the
-- Declaration argument.
--
-- Appropriate Definition_Kinds:
-- A_Type_Definition
-- A_Private_Extension_Definition
-- A_Formal_Type_Definition
--
-- Appropriate Type_Kinds:
-- A_Derived_Type_Definition
-- A_Derived_Record_Extension_Definition
--
-- Appropriate Formal_Type_Kinds:
-- A_Formal_Derived_Type_Definition
--
-- Returns Declaration_Kinds:
--
-- An_Enumeration_Literal_Specification
-- A_Discriminant_Specification
-- A_Component_Declaration
-- A_Procedure_Declaration
-- A_Function_Declaration
-- An_Entry_Declaration
--
-- --|IP Implementation Permissions:
-- --|IP
-- --|IP Some implementations do not represent all forms of implicit
-- --|IP declarations such that elements representing them can be easily
-- --|IP provided. An implementation can choose whether or not to construct
-- --|IP and provide artificial declarations for implicitly declared elements.
-- --|IP
-- --|AN Application Note:
-- --|AN
-- --|AN This query returns only implicit inherited entry declarations for
-- --|AN derived task types. All representation clauses and pragmas associated
-- --|AN with the entries of the original task type (the root type of the
-- --|AN derived task type) apply to the inherited entries. Those are
-- --|AN available by examining the original type or by calling
-- --|AN Corresponding_Pragmas and Corresponding_Representation_Clauses.
-- --|AN These functions will return the pragmas and clauses from the original
-- --|AN type.
--
------------------------------------------------------------------------------
-- 16.5 function Implicit_Inherited_Subprograms
------------------------------------------------------------------------------
function Implicit_Inherited_Subprograms
(Definition : Asis.Definition)
return Asis.Declaration_List;
------------------------------------------------------------------------------
-- Definition - Specifies the derived type to query
--
-- Returns the list of user-defined inherited primitive subprograms that have
-- been implicitly declared for the derived_type_definition.
--
-- The list result does not include hidden inherited subprograms
-- (Reference Manual 8.3).
--
-- Returns a Nil_Element_List if there are no inherited subprograms for the
-- derived type.
--
-- Returns a Nil_Element_List if the implementation does not provide
-- such implicit declarations.
--
-- The Enclosing_Element for each of the subprogram declarations is the
-- Definition argument.
--
-- Appropriate Definition_Kinds:
-- A_Type_Definition
-- A_Private_Extension_Definition
-- A_Formal_Type_Definition
--
-- Appropriate Type_Kinds:
-- A_Derived_Type_Definition
-- A_Derived_Record_Extension_Definition
--
-- Appropriate Formal_Type_Kinds:
-- A_Formal_Derived_Type_Definition
--
-- Returns Declaration_Kinds:
-- A_Function_Declaration
-- A_Procedure_Declaration
--
-- --|IP Implementation Permissions:
-- --|IP
-- --|IP Some implementations do not represent all forms of implicit
-- --|IP declarations such that elements representing them can be easily
-- --|IP provided. An implementation can choose whether or not to construct
-- --|IP and provide artificial declarations for implicitly declared elements.
--
------------------------------------------------------------------------------
-- 16.6 function Corresponding_Parent_Subtype
------------------------------------------------------------------------------
function Corresponding_Parent_Subtype
(Type_Definition : Asis.Type_Definition)
return Asis.Declaration;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the derived_type_definition to query
--
-- Returns the parent subtype declaration of the derived_type_definition.
-- The parent subtype is defined by the parent_subtype_indication.
--
-- --|D2005 start
--
-- It is not clear what should be returned, if the argument type definition
-- contains an attribute reference as the subtype_mark in the
-- parent_subtype_indication (only 'Base attribute is possible in this
-- context):
--
-- type Derived_Type is new Parent_Type'Base;
--
-- We return Nil_Element in this case as an indication that this case needs
-- some special processing in the application code.
--
-- --|D2005 end
--
-- Appropriate Type_Kinds:
-- A_Derived_Type_Definition
-- A_Derived_Record_Extension_Definition
--
-- Returns Declaration_Kinds:
-- An_Ordinary_Type_Declaration
-- A_Task_Type_Declaration
-- A_Protected_Type_Declaration
-- A_Subtype_Declaration
-- A_Formal_Type_Declaration
-- An_Incomplete_Type_Declaration
-- A_Private_Type_Declaration
-- A_Private_Extension_Declaration
--
------------------------------------------------------------------------------
-- 16.7 function Corresponding_Root_Type
------------------------------------------------------------------------------
function Corresponding_Root_Type
(Type_Definition : Asis.Type_Definition)
return Asis.Declaration;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the derived_type_definition to query
--
-- This function recursively unwinds all type derivations and subtyping to
-- arrive at a full_type_declaration that is neither a derived type nor a
-- subtype.
--
-- In case of numeric types, this function always returns some user-defined
-- type, not an implicitly defined root type corresponding to
-- A_Root_Type_Definition. The only ways to get implicitly declared numeric
-- root or universal types are to ask for the type of a universal expression
-- or from the parameter and result profile of a predefined operation working
-- with numeric types.
--
-- Appropriate Type_Kinds:
-- A_Derived_Type_Definition
-- A_Derived_Record_Extension_Definition
--
-- Returns Declaration_Kinds:
-- An_Ordinary_Type_Declaration
-- A_Task_Type_Declaration
-- A_Protected_Type_Declaration
-- A_Formal_Type_Declaration
-- A_Private_Type_Declaration
-- A_Private_Extension_Declaration
--
------------------------------------------------------------------------------
-- 16.8 function Corresponding_Type_Structure
------------------------------------------------------------------------------
function Corresponding_Type_Structure
(Type_Definition : Asis.Type_Definition)
return Asis.Declaration;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the derived_type_definition to query
--
-- Returns the type structure from which the specified type definition has
-- been derived. This function will recursively unwind derivations and
-- subtyping until the type_declaration derives a change of representation or
-- is no longer derived. See Reference Manual 13.6.
--
-- Appropriate Type_Kinds:
-- A_Derived_Type_Definition
-- A_Derived_Record_Extension_Definition
--
-- Returns Declaration_Kinds:
-- An_Ordinary_Type_Declaration
-- A_Task_Type_Declaration
-- A_Protected_Type_Declaration
-- A_Formal_Type_Declaration
--
-- --|ER---------------------------------------------------------------------
-- --|ER An_Enumeration_Type_Definition - 3.5.1
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Enumeration_Literal_Declarations
--
------------------------------------------------------------------------------
-- 16.9 function Enumeration_Literal_Declarations
------------------------------------------------------------------------------
function Enumeration_Literal_Declarations
(Type_Definition : Asis.Type_Definition)
return Asis.Declaration_List;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the enumeration type definition to query
--
-- Returns a list of the literals declared in an enumeration_type_definition,
-- in their order of appearance.
--
-- Appropriate Type_Kinds:
-- An_Enumeration_Type_Definition
--
-- Returns Declaration_Kinds:
-- An_Enumeration_Literal_Specification
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Signed_Integer_Type_Definition - 3.5.4
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Integer_Constraint
--
------------------------------------------------------------------------------
-- 16.10 function Integer_Constraint
------------------------------------------------------------------------------
function Integer_Constraint
(Type_Definition : Asis.Type_Definition)
return Asis.Range_Constraint;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the signed_integer_type_definition to query
--
-- Returns the range_constraint of the signed_integer_type_definition.
--
-- Appropriate Type_Kinds:
-- A_Signed_Integer_Type_Definition
--
-- Returns Constraint_Kinds:
-- A_Simple_Expression_Range
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Modular_Type_Definition - 3.5.4
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Mod_Static_Expression
--
------------------------------------------------------------------------------
-- 16.11 function Mod_Static_Expression
------------------------------------------------------------------------------
function Mod_Static_Expression
(Type_Definition : Asis.Type_Definition)
return Asis.Expression;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the modular_type_definition to query
--
-- Returns the static_expression following the reserved word "mod".
--
-- Appropriate Type_Kinds:
-- A_Modular_Type_Definition
--
-- Returns Element_Kinds:
-- An_Expression
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Floating_Point_Definition - 3.5.7
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Digits_Expression
-- --|CR function Real_Range_Constraint
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Decimal_Fixed_Point_Definition - 3.5.9
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Digits_Expression
-- --|CR function Delta_Expression
-- --|CR function Real_Range_Constraint
--
------------------------------------------------------------------------------
-- 16.12 function Digits_Expression
------------------------------------------------------------------------------
function Digits_Expression
(Definition : Asis.Definition)
return Asis.Expression;
------------------------------------------------------------------------------
-- Definition - Specifies the definition to query
--
-- Returns the static_expression following the reserved word "digits".
--
-- Appropriate Definition_Kinds:
-- A_Floating_Point_Definition
-- A_Decimal_Fixed_Point_Definition
-- A_Constraint
-- Appropriate Constraint_Kinds:
-- A_Digits_Constraint
--
-- Returns Element_Kinds:
-- An_Expression
--
-- --|ER---------------------------------------------------------------------
-- --|ER An_Ordinary_Fixed_Point_Definition - 3.5.9
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Delta_Expression
--
------------------------------------------------------------------------------
-- 16.13 function Delta_Expression
------------------------------------------------------------------------------
function Delta_Expression
(Definition : Asis.Definition)
return Asis.Expression;
------------------------------------------------------------------------------
-- Definition - Specifies the definition to query
--
-- Returns the static_expression following the reserved word "delta".
--
-- Appropriate Definition_Kinds:
-- An_Ordinary_Fixed_Point_Definition
-- A_Decimal_Fixed_Point_Definition
-- A_Constraint
-- Appropriate Constraint_Kinds:
-- A_Delta_Constraint
--
-- Returns Element_Kinds:
-- An_Expression
--
------------------------------------------------------------------------------
-- 16.14 function Real_Range_Constraint
------------------------------------------------------------------------------
function Real_Range_Constraint
(Definition : Asis.Definition)
return Asis.Range_Constraint;
------------------------------------------------------------------------------
-- Definition - Specifies the definition to query
--
-- Returns the real_range_specification range_constraint of the definition.
--
-- Returns a Nil_Element if there is no explicit range_constraint.
--
-- Appropriate Definition_Kinds:
-- A_Floating_Point_Definition
-- An_Ordinary_Fixed_Point_Definition
-- A_Decimal_Fixed_Point_Definition
-- A_Constraint
-- Appropriate Constraint_Kinds:
-- A_Digits_Constraint
-- A_Delta_Constraint
--
-- Returns Constraint_Kinds:
-- Not_A_Constraint
-- A_Simple_Expression_Range
--
-- --|ER---------------------------------------------------------------------
-- --|ER An_Unconstrained_Array_Definition 3.6
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Index_Subtype_Definitions
-- --|CR function Array_Component_Definition
--
------------------------------------------------------------------------------
-- 16.15 function Index_Subtype_Definitions
------------------------------------------------------------------------------
function Index_Subtype_Definitions
(Type_Definition : Asis.Type_Definition)
return Asis.Expression_List;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the array_type_definition to query
--
-- Returns a list of the index_subtype_definition subtype mark names for
-- an unconstrained_array_definition, in their order of appearance.
--
-- Appropriate Type_Kinds:
-- An_Unconstrained_Array_Definition
--
-- Appropriate Formal_Type_Kinds:
-- A_Formal_Unconstrained_Array_Definition
--
-- Returns Expression_Kinds:
-- An_Identifier
-- A_Selected_Component
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Constrained_Array_Definition 3.6
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Discrete_Subtype_Definitions
-- --|CR function Array_Component_Definition
--
------------------------------------------------------------------------------
-- 16.16 function Discrete_Subtype_Definitions
------------------------------------------------------------------------------
function Discrete_Subtype_Definitions
(Type_Definition : Asis.Type_Definition)
return Asis.Definition_List;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the array_type_definition to query
--
-- Returns the list of Discrete_Subtype_Definition elements of a
-- constrained_array_definition, in their order of appearance.
--
-- Appropriate Type_Kinds:
-- A_Constrained_Array_Definition
--
-- Appropriate Formal_Type_Kinds:
-- A_Formal_Constrained_Array_Definition
--
-- Returns Definition_Kinds:
-- A_Discrete_Subtype_Definition
--
------------------------------------------------------------------------------
-- 16.17 function Array_Component_Definition
------------------------------------------------------------------------------
function Array_Component_Definition
(Type_Definition : Asis.Type_Definition)
return Asis.Component_Definition;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the array_type_definition to query
--
-- Returns the Component_Definition of the array_type_definition.
--
-- Appropriate Type_Kinds:
-- An_Unconstrained_Array_Definition
-- A_Constrained_Array_Definition
--
-- Appropriate Formal_Type_Kinds:
-- A_Formal_Unconstrained_Array_Definition
-- A_Formal_Constrained_Array_Definition
--
-- Returns Definition_Kinds:
-- A_Component_Definition
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Record_Type_Definition - 3.8
-- --|ER A_Tagged_Record_Type_Definition - 3.8
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Record_Definition
-- --|ER---------------------------------------------------------------------
-- --|ER An_Access_Type_Definition - 3.10
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Access_To_Object_Definition
-- --|CR function Access_To_Subprogram_Parameter_Profile
-- --|CR function Access_To_Function_Result_Profile
--
------------------------------------------------------------------------------
-- 16.18 function Access_To_Object_Definition
------------------------------------------------------------------------------
function Access_To_Object_Definition
(Type_Definition : Asis.Type_Definition)
return Asis.Subtype_Indication;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the Access_Type_Definition to query
--
-- Returns the subtype_indication following the reserved word "access".
--
-- Appropriate Type_Kinds:
-- An_Access_Type_Definition.
-- A_Formal_Access_Type_Definition
--
-- Appropriate Access_Type_Kinds:
-- A_Pool_Specific_Access_To_Variable
-- An_Access_To_Variable
-- An_Access_To_Constant
--
-- Returns Element_Kinds:
-- A_Subtype_Indication
--
------------------------------------------------------------------------------
-- --|A2005 start (implemented)
-- 16.N??? function Anonymous_Access_To_Object_Subtype_Mark
------------------------------------------------------------------------------
function Anonymous_Access_To_Object_Subtype_Mark
(Definition : Asis.Definition)
return Asis.Expression;
------------------------------------------------------------------------------
-- Definition - Specifies the anonymous access definition to query
--
-- Returns the subtype_mark following the reserved word(s) "access" or
-- "access constant".
--
-- Appropriate Definition_Kinds:
-- An_Access_Definition.
--
-- Appropriate Access_Definition_Kinds:
-- An_Anonymous_Access_To_Variable
-- An_Anonymous_Access_To_Constant
--
-- Returns Expression_Kinds:
-- An_Identifier
-- A_Selected_Component
-- An_Attribute_Reference
-- --|D2005 start
-- Another possibility could be to add this functionality to the
-- Access_To_Object_Definition query. What would be better?
-- --|D2005 end
-- --|A2005 end
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- 16.19 function Access_To_Subprogram_Parameter_Profile
------------------------------------------------------------------------------
function Access_To_Subprogram_Parameter_Profile
(Type_Definition : Asis.Type_Definition)
return Asis.Parameter_Specification_List;
------------------------------------------------------------------------------
-- --|A2005 start
-- Type_Definition - Specifies the access type definition to query. It may be
-- access_type_definition from type_declaration or access_definition
-- defining an anonymous access type
--
-- Returns a list of parameter_specification elements in the formal part of
-- the parameter_profile in the access type definition defining access to
-- subprogram.
-- --|A2005 end
--
-- Returns a Nil_Element_List if the parameter_profile has no formal part.
--
-- Results of this query may vary across ASIS implementations. Some
-- implementations normalize all multiple name parameter_specification
-- elements into an equivalent sequence of corresponding single name
-- parameter_specification elements. See Reference Manual 3.3.1(7).
--
-- --|A2005 start
-- Appropriate Definition_Kinds:
-- A_Type_Definition
-- An_Access_Definition
-- --|A2005 end
-- Appropriate Type_Kinds:
-- An_Access_Type_Definition.
-- A_Formal_Access_Type_Definition.
--
-- Appropriate Access_Type_Kinds:
-- An_Access_To_Procedure
-- An_Access_To_Protected_Procedure
-- An_Access_To_Function
-- An_Access_To_Protected_Function
--
-- --|A2005 start
-- Appropriate Access_Definition_Kinds: (implemented)
-- An_Anonymous_Access_To_Procedure
-- An_Anonymous_Access_To_Protected_Procedure
-- An_Anonymous_Access_To_Function
-- An_Anonymous_Access_To_Protected_Function
-- --|A2005 end
--
-- Returns Declaration_Kinds:
-- A_Parameter_Specification
--
------------------------------------------------------------------------------
-- 16.20 function Access_To_Function_Result_Profile
------------------------------------------------------------------------------
function Access_To_Function_Result_Profile
(Type_Definition : Asis.Type_Definition)
-- --|A2005 start
return Asis.Element;
-- --|A2005 end
------------------------------------------------------------------------------
-- --|A2005 start
-- Type_Definition - Specifies the access type definition to query. It may be
-- access_type_definition from type_declaration or access_definition
-- defining an anonymous access type
--
-- Returns the definition for the return type for the access function. It may
-- be subtype_mark expression or anonymous access_definition
-- --|A2005 end
--
-- --|A2005 start
-- Appropriate Definition_Kinds:
-- A_Type_Definition
-- An_Access_Definition
-- --|A2005 end
--
-- Appropriate Type_Kinds:
-- An_Access_Type_Definition
-- A_Formal_Access_Type_Definition
--
-- Appropriate Access_Type_Kinds:
-- An_Access_To_Function
-- An_Access_To_Protected_Function
--
-- --|A2005 start
-- Appropriate Access_Definition_Kinds: (implemented)
-- An_Anonymous_Access_To_Function
-- An_Anonymous_Access_To_Protected_Function
-- --|A2005 end
--
-- Returns Expression_Kinds:
-- An_Identifier
-- A_Selected_Component
--
-- --|A2005 start
-- Returns Definition_Kinds:
-- An_Access_Definition
-- --|A2005 end
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Root_Type_Definition - 3.5.4(9), 3.5.6(2) - No child elements
-- --|ER---------------------------------------------------------------------
-- --|ER
-- --|ER A_Subtype_Indication - 3.3.2
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Subtype_Mark
-- --|CR function Subtype_Constraint
--
------------------------------------------------------------------------------
-- 16.21 function Subtype_Mark
------------------------------------------------------------------------------
function Subtype_Mark
(Definition : Asis.Definition)
return Asis.Expression;
------------------------------------------------------------------------------
-- Definition - Specifies the definition to query
--
-- Returns the subtype_mark expression of the definition.
--
-- Appropriate Definition_Kinds:
-- A_Subtype_Indication
-- A_Discrete_Subtype_Definition
-- Appropriate Discrete_Range_Kinds:
-- A_Discrete_Subtype_Indication
-- A_Discrete_Range
-- Appropriate Discrete_Range_Kinds:
-- A_Discrete_Subtype_Indication
-- A_Formal_Derived_Type_Definition
--
-- Returns Expression_Kinds:
-- An_Identifier
-- A_Selected_Component
-- An_Attribute_Reference
--
------------------------------------------------------------------------------
-- 16.22 function Subtype_Constraint
------------------------------------------------------------------------------
function Subtype_Constraint
(Definition : Asis.Definition)
return Asis.Constraint;
------------------------------------------------------------------------------
-- Definition - Specifies the definition to query
--
-- Returns the constraint of the subtype_indication.
--
-- Returns a Nil_Element if no explicit constraint is present.
--
-- Appropriate Definition_Kinds:
-- A_Subtype_Indication
-- A_Discrete_Subtype_Definition
-- Appropriate Discrete_Range_Kinds:
-- A_Discrete_Subtype_Indication
-- A_Discrete_Range
-- Appropriate Discrete_Range_Kinds:
-- A_Discrete_Subtype_Indication
--
-- Returns Definition_Kinds:
-- Not_A_Definition
-- A_Constraint
--
-- --|AN Application Note:
-- --|AN
-- --|AN When an unconstrained subtype indication for a type having
-- --|AN discriminants with default values is used, a Nil_Element is
-- --|AN returned by this function. Use the queries Subtype_Mark, and
-- --|AN Corresponding_Name_Declaration [, and Corresponding_First_Subtype]
-- --|AN to obtain the declaration defining the defaults.
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Constraint - 3.2.2
-- --|ER
-- --|ER A_Simple_Expression_Range - 3.5
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Lower_Bound
-- --|CR function Upper_Bound
--
------------------------------------------------------------------------------
-- 16.23 function Lower_Bound
------------------------------------------------------------------------------
function Lower_Bound
(Constraint : Asis.Range_Constraint)
return Asis.Expression;
------------------------------------------------------------------------------
-- Constraint - Specifies the range_constraint or discrete_range to query
--
-- Returns the simple_expression for the lower bound of the range.
--
-- Appropriate Constraint_Kinds:
-- A_Simple_Expression_Range
--
-- Appropriate Discrete_Range_Kinds:
-- A_Discrete_Simple_Expression_Range
--
-- Returns Element_Kinds:
-- An_Expression
--
------------------------------------------------------------------------------
-- 16.24 function Upper_Bound
------------------------------------------------------------------------------
function Upper_Bound
(Constraint : Asis.Range_Constraint)
return Asis.Expression;
------------------------------------------------------------------------------
-- Constraint - Specifies the range_constraint or discrete_range to query
--
-- Returns the simple_expression for the upper bound of the range.
--
-- Appropriate Constraint_Kinds:
-- A_Simple_Expression_Range
--
-- Appropriate Discrete_Range_Kinds:
-- A_Discrete_Simple_Expression_Range
--
-- Returns Element_Kinds:
-- An_Expression
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Range_Attribute_Reference - 3.5
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Range_Attribute
--
------------------------------------------------------------------------------
-- 16.25 function Range_Attribute
------------------------------------------------------------------------------
function Range_Attribute
(Constraint : Asis.Range_Constraint)
return Asis.Expression;
------------------------------------------------------------------------------
-- Constraint - Specifies the range_attribute_reference or
-- discrete_range attribute_reference to query
--
-- Returns the range_attribute_reference expression of the range.
--
-- Appropriate Constraint_Kinds:
-- A_Range_Attribute_Reference
--
-- Appropriate Discrete_Range_Kinds:
-- A_Discrete_Range_Attribute_Reference
--
-- Returns Expression_Kinds:
-- An_Attribute_Reference
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Digits_Constraint - 3.5.9
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Digits_Expression
-- --|CR function Real_Range_Constraint
-- --|ER---------------------------------------------------------------------
-- --|ER A_Delta_Constraint - J.3
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Delta_Expression
-- --|CR function Real_Range_Constraint
-- --|CR---------------------------------------------------------------------
-- --|ER An_Index_Constraint - 3.6.1
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Discrete_Ranges
--
------------------------------------------------------------------------------
-- 16.26 function Discrete_Ranges
------------------------------------------------------------------------------
function Discrete_Ranges
(Constraint : Asis.Constraint)
return Asis.Discrete_Range_List;
------------------------------------------------------------------------------
-- Constraint - Specifies the array index_constraint to query
--
-- Returns the list of discrete_range components for an index_constraint,
-- in their order of appearance.
--
-- Appropriate Constraint_Kinds:
-- An_Index_Constraint
--
-- Returns Definition_Kinds:
-- A_Discrete_Range
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Discriminant_Constraint - 3.7.1
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Discriminant_Associations
--
------------------------------------------------------------------------------
-- 16.27 function Discriminant_Associations
------------------------------------------------------------------------------
function Discriminant_Associations
(Constraint : Asis.Constraint;
Normalized : Boolean := False)
return Asis.Discriminant_Association_List;
------------------------------------------------------------------------------
-- Constraint - Specifies the discriminant_constraint to query
-- Normalized - Specifies whether the normalized form is desired
--
-- Returns a list of the discriminant_association elements of the
-- discriminant_constraint.
--
-- Returns a Nil_Element_List if there are no discriminant_association
-- elements.
-- --|D2005 start
-- A_Discriminant_Constraint can never contain no discriminant_association!
-- Just check with the definition of the syntax of this construct in the Ada
-- Standard
-- --|D2005 end
--
-- An unnormalized list contains only explicit associations ordered as they
-- appear in the program text. Each unnormalized association has a list of
-- discriminant_selector_name elements and an explicit expression.
--
-- A normalized list contains artificial associations representing all
-- explicit associations. It has a length equal to the number of
-- discriminant_specification elements of the known_discriminant_part.
-- The order of normalized associations matches the order of
-- discriminant_specification elements.
--
-- Each normalized association represents a one on one mapping of a
-- discriminant_specification to the explicit expression. A normalized
-- association has one A_Defining_Name component that denotes the
-- discriminant_specification, and one An_Expression component that is the
-- explicit expression.
--
--
-- Appropriate Constraint_Kinds:
-- A_Discriminant_Constraint
--
-- Returns Association_Kinds:
-- A_Discriminant_Association
--
-- --|IR Implementation Requirements:
-- --|IR
-- --|IR Normalized associations are Is_Normalized and Is_Part_Of_Implicit.
-- --|IR Normalized associations are never Is_Equal to unnormalized
-- --|IR associations.
-- --|IR
-- --|IP Implementation Permissions:
-- --|IP
-- --|IP An implementation may choose to normalize its internal representation
-- --|IP to use the defining_identifier element instead of the
-- --|IP discriminant_selector_name element.
-- --|IP
-- --|IP If so, this query will return Is_Normalized associations even if
-- --|IP Normalized is False, and the query
-- --|IP Discriminant_Associations_Normalized will return True.
-- --|IP
-- --|AN Application Note:
-- --|AN
-- --|AN It is not possible to obtain either a normalized or unnormalized
-- --|AN Discriminant_Association list for an unconstrained record or derived
-- --|AN subtype_indication where the discriminant_association elements are
-- --|AN by default; there is no constraint to query, and a Nil_Element is
-- --|AN supplied returned from the query Subtype_Constraint.
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Component_Definition - 3.6
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Component_Subtype_Indication
--
------------------------------------------------------------------------------
-- 16.28 function Component_Subtype_Indication
------------------------------------------------------------------------------
function Component_Subtype_Indication
(Component_Definition : Asis.Component_Definition)
return Asis.Subtype_Indication;
------------------------------------------------------------------------------
-- Component_Definition - Specifies the Component_Definition to query
--
-- Returns the subtype_indication of the Component_Definition.
--
-- --|A2005 start
-- --|D2005 start
-- In ASIS 2005 this query is an obsolescent feature, it should not be used
-- for analyzing Ada 2005 code. We need a proper warning note in the ASIS
-- Standard. The problem here that the name of the query requires to return
-- namely a subtype indication, but in Ada 2005 we may also return
-- access_defintion. See proposal in next section.
-- This query should be kept as is because of upward compatibility reasons
-- --|D2005 end
-- --|A2005 end
-- Appropriate Definition_Kinds:
-- A_Component_Definition
--
-- Returns Definition_Kinds:
-- A_Subtype_Indication
--
-- --|A2005 start
------------------------------------------------------------------------------
-- 16.#??? function Component_Definition_View
------------------------------------------------------------------------------
function Component_Definition_View
(Component_Definition : Asis.Component_Definition)
return Asis.Definition;
-- --|D2005 start
-- Is it a good name for the query?
-- --|D2005 end
------------------------------------------------------------------------------
-- Component_Definition - Specifies the Component_Definition to query
--
-- Returns the subtype_indication or access_definition of the
-- Component_Definition.
--
-- Appropriate Definition_Kinds:
-- A_Component_Definition
--
-- Returns Definition_Kinds:
-- A_Subtype_Indication
-- An_Access_Definition
--
-- --|A2005 end
-- --|ER---------------------------------------------------------------------
-- --|ER A_Discrete_Subtype_Definition - 3.6
-- --|ER A_Discrete_Range - 3.6.1
-- --|ER
-- --|ER A_Discrete_Subtype_Indication
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Subtype_Mark
-- --|CR function Subtype_Constraint
-- --|CR
-- --|CR A_Discrete_Simple_Expression_Range
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Lower_Bound
-- --|CR function Upper_Bound
-- --|ER
-- --|ER---------------------------------------------------------------------
-- --|ER A_Discrete_Range_Attribute_Reference - 3.5
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Range_Attribute
-- --|ER---------------------------------------------------------------------
-- --|ER An_Unknown_Discriminant_Part - 3.7 - No child elements
-- --|ER---------------------------------------------------------------------
-- --|ER A_Known_Discriminant_Part - 3.7
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Discriminants
--
------------------------------------------------------------------------------
-- 16.29 function Discriminants
------------------------------------------------------------------------------
function Discriminants
(Definition : Asis.Definition)
return Asis.Discriminant_Specification_List;
------------------------------------------------------------------------------
-- Definition - Specifies the known_discriminant_part to query
--
-- Returns a list of discriminant_specification elements, in their order of
-- appearance.
--
-- Results of this query may vary across ASIS implementations. Some
-- implementations normalize all multi-name discriminant_specification
-- elements into an equivalent sequence of single name
-- discriminant_specification elements. See Reference Manual 3.3.1(7).
--
-- Appropriate Definition_Kinds:
-- A_Known_Discriminant_Part
--
-- Returns Declaration_Kinds:
-- A_Discriminant_Specification
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Record_Definition - 3.8
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Record_Components
-- --|CR function Implicit_Components
--
------------------------------------------------------------------------------
-- 16.30 function Record_Components
------------------------------------------------------------------------------
function Record_Components
(Definition : Asis.Definition;
Include_Pragmas : Boolean := False)
return Asis.Record_Component_List;
------------------------------------------------------------------------------
-- Definition - Specifies the record_definition or variant to query
-- Include_Pragmas - Specifies whether pragmas are to be returned
--
-- Returns a list of the components and pragmas of the record_definition or
-- variant, in their order of appearance.
--
-- Declarations are not returned for implementation-defined components of the
-- record_definition. See Reference Manual 13.5.1 (15). These components are
-- not normally visible to the ASIS application. However, they can be obtained
-- with the query Implicit_Components.
--
-- Appropriate Definition_Kinds:
-- A_Record_Definition
-- A_Variant
--
-- Returns Element_Kinds:
-- A_Pragma
-- A_Declaration
-- A_Definition
-- A_Clause
--
-- Returns Declaration_Kinds:
-- A_Component_Declaration
--
-- Returns Definition_Kinds:
-- A_Null_Component
-- A_Variant_Part
--
-- Returns Representation_Clause_Kinds:
-- An_Attribute_Definition_Clause
--
------------------------------------------------------------------------------
-- 16.31 function Implicit_Components
------------------------------------------------------------------------------
function Implicit_Components
(Definition : Asis.Definition)
return Asis.Record_Component_List;
------------------------------------------------------------------------------
-- Definition - Specifies the record_definition or variant to query
--
-- Returns a list of all implicit implementation-defined components of the
-- record_definition or variant. The Enclosing_Element of each component is
-- the Definition argument. Each component is Is_Part_Of_Implicit.
--
-- Returns a Nil_Element_List if there are no implicit implementation-defined
-- components or if the ASIS implementation does not support such
-- implicit declarations.
--
-- Appropriate Definition_Kinds:
-- A_Record_Definition
-- A_Variant
--
-- Returns Element_Kinds:
-- A_Declaration
--
-- Returns Declaration_Kinds:
-- A_Component_Declaration
--
-- --|IP Implementation Permissions:
-- --|IP
-- --|IP Some implementations do not represent all forms of implicit
-- --|IP declarations such that elements representing them can be easily
-- --|IP provided. An implementation can choose whether or not to construct
-- --|IP and provide artificial declarations for implicitly declared elements.
-- --|IP
-- --|IP Use the query Implicit_Components_Supported to determine if the
-- --|IP implementation provides implicit record components.
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Null_Record_Definition - 3.8 - No child elements
-- --|ER---------------------------------------------------------------------
-- --|ER A_Variant_Part - 3.8.1
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Discriminant_Direct_Name
-- --|CR function Variants
--
------------------------------------------------------------------------------
-- 16.32 function Discriminant_Direct_Name
------------------------------------------------------------------------------
function Discriminant_Direct_Name
(Variant_Part : Asis.Record_Component)
return Asis.Name;
------------------------------------------------------------------------------
-- Variant_Part - Specifies the variant_part to query
--
-- Returns the Discriminant_Direct_Name of the variant_part.
--
-- Appropriate Definition_Kinds:
-- A_Variant_Part
--
-- Returns Expression_Kinds:
-- An_Identifier
--
------------------------------------------------------------------------------
-- 16.33 function Variants
------------------------------------------------------------------------------
function Variants
(Variant_Part : Asis.Record_Component;
Include_Pragmas : Boolean := False)
return Asis.Variant_List;
------------------------------------------------------------------------------
-- Variant_Part - Specifies the variant_part to query
-- Include_Pragmas - Specifies whether pragmas are to be returned
--
-- Returns a list of variants that make up the record component, in their
-- order of appearance.
--
-- The only pragmas returned are those following the reserved word "is"
-- and preceding the reserved word "when" of first variant, and those between
-- following variants.
--
-- Appropriate Definition_Kinds:
-- A_Variant_Part
--
-- Returns Element_Kinds:
-- A_Pragma
-- A_Definition
--
-- Returns Definition_Kinds:
-- A_Variant
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Variant - 3.8.1
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Variant_Choices
-- --|CR function Record_Components
-- --|CR function Implicit_Components
--
------------------------------------------------------------------------------
-- 16.34 function Variant_Choices
------------------------------------------------------------------------------
function Variant_Choices
(Variant : Asis.Variant)
return Asis.Element_List;
------------------------------------------------------------------------------
-- Variant - Specifies the variant to query
--
-- Returns the discrete_choice_list elements, in their order of appearance.
-- Choices are either an expression, a discrete range, or an others choice.
--
-- Appropriate Definition_Kinds:
-- A_Variant
--
-- Returns Element_Kinds:
-- An_Expression
-- A_Definition
--
-- Returns Definition_Kinds:
-- A_Discrete_Range
-- An_Others_Choice
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Private_Type_Definition - 7.3 - No child elements
-- --|ER A_Tagged_Private_Type_Definition - 7.3 - No child elements
-- --|ER---------------------------------------------------------------------
-- --|ER A_Private_Extension_Definition - 7.3
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Ancestor_Subtype_Indication
--
------------------------------------------------------------------------------
-- --|A2005 start (implemented)
-- 16.#??? function Definition_Interface_List
------------------------------------------------------------------------------
function Definition_Interface_List
(Type_Definition : Asis.Definition)
return Asis.Expression_List;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the definition to query
--
-- Returns a list of subtype mark names making up the interface_list in the
-- argument definition, in their order of appearance.
--
-- Appropriate Definition_Kinds:
-- A_Private_Extension_Definition
--
-- Appropriate Type_Kinds:
-- A_Derived_Record_Extension_Definition
-- An_Interface_Type_Definition
--
-- Appropriate Formal_Type_Kinds:
-- A_Formal_Derived_Type_Definition
-- A_Formal_Interface_Type_Definition
--
-- Returns Expression_Kinds:
-- An_Identifier
-- A_Selected_Component
-- --|A2005 end
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- 16.35 function Ancestor_Subtype_Indication
------------------------------------------------------------------------------
function Ancestor_Subtype_Indication
(Definition : Asis.Definition)
return Asis.Subtype_Indication;
------------------------------------------------------------------------------
-- Definition - Specifies the definition to query
--
-- Returns the ancestor_subtype_indication following the reserved word "new"
-- in the private_extension_declaration.
--
-- Appropriate Definition_Kinds:
-- A_Private_Extension_Definition
--
-- Returns Definition_Kinds:
-- A_Subtype_Indication
-- --|ER---------------------------------------------------------------------
-- --|ER A_Task_Definition - 9.1
-- --|ER A_Protected_Definition - 9.4
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Visible_Part_Items
-- --|CR function Private_Part_Items
--
------------------------------------------------------------------------------
-- 16.36 function Visible_Part_Items
------------------------------------------------------------------------------
function Visible_Part_Items
(Definition : Asis.Definition;
Include_Pragmas : Boolean := False)
return Asis.Declarative_Item_List;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the type_definition to query
-- Include_Pragmas - Specifies whether pragmas are to be returned
--
-- Returns a list of declarations, representation clauses, and pragmas
-- in the visible part of the task or protected definition, in their order
-- of appearance. The list does not include discriminant_specification
-- elements of the known_discriminant_part, if any, of the protected type or
-- task type declaration.
--
-- Returns a Nil_Element_List if there are no items.
--
-- Appropriate Definition_Kinds:
-- A_Task_Definition
-- A_Protected_Definition
--
-- Returns Element_Kinds:
-- A_Pragma
-- A_Declaration
-- A_Clause
--
------------------------------------------------------------------------------
-- 16.37 function Private_Part_Items
------------------------------------------------------------------------------
function Private_Part_Items
(Definition : Asis.Definition;
Include_Pragmas : Boolean := False)
return Asis.Declarative_Item_List;
------------------------------------------------------------------------------
-- Type_Definition - Specifies the task type definition to query
-- Include_Pragmas - Specifies whether pragmas are to be returned
--
-- Returns a list of declarations, representation clauses, and pragmas in the
-- private part of the task or protected definition, in their order of
-- appearance.
--
-- Returns a Nil_Element_List if there are no items.
--
-- Appropriate Definition_Kinds:
-- A_Task_Definition
-- A_Protected_Definition
--
-- Returns Element_Kinds:
-- A_Pragma
-- A_Declaration
-- A_Clause
--
------------------------------------------------------------------------------
-- 16.38 function Is_Private_Present
------------------------------------------------------------------------------
function Is_Private_Present
(Definition : Asis.Definition)
return Boolean;
------------------------------------------------------------------------------
-- Definition - Specifies the definition to query
--
-- Returns True if the argument is a task_definition or a protected_definition
-- that has a reserved word "private" marking the beginning of a (possibly
-- empty) private part.
--
-- Returns False for any definition without a private part.
-- Returns False for any unexpected Element.
--
-- Expected Definition_Kinds:
-- A_Task_Definition
-- A_Protected_Definition
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Formal_Type_Definition - 12.5
-- --|ER
-- --|ER A_Formal_Private_Type_Definition - 12.5.1 - No child elements
-- --|ER A_Formal_Tagged_Private_Type_Definition - 12.5.1 - No child elements
-- --|ER
-- --|ER A_Formal_Derived_Type_Definition
-- --|CR Child elements returned by:
-- --|CR function Subtype_Mark
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Formal_Discrete_Type_Definition - 12.5.2 - No child elements
-- --|ER A_Formal_Signed_Integer_Type_Definition - 12.5.2 - No child elements
-- --|ER A_Formal_Modular_Type_Definition - 12.5.2 - No child elements
-- --|ER A_Formal_Floating_Point_Definition - 12.5.2 - No child elements
-- --|ER A_Formal_Ordinary_Fixed_Point_Definition - 12.5.2 - No child elements
-- --|ER A_Formal_Decimal_Fixed_Point_Definition - 12.5.2 - No child elements
-- --|ER---------------------------------------------------------------------
-- --|ER A_Formal_Unconstrained_Array_Definition - 12.5.3
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Index_Subtype_Definitions
-- --|CR function Array_Component_Definition
-- --|ER---------------------------------------------------------------------
-- --|ER A_Formal_Constrained_Array_Definition - 12.5.3
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Discrete_Subtype_Definitions
-- --|CR function Array_Component_Definition
-- --|ER---------------------------------------------------------------------
-- --|ER A_Formal_Access_Type_Definition - 12.5.4
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Access_To_Object_Definition
-- --|CR function Access_To_Subprogram_Parameter_Profile
-- --|CR function Access_To_Function_Result_Profile
--
------------------------------------------------------------------------------
-- --|ASIS2012 start
-- The stuff here should be reordered when the new language standard is
-- stabilized.
function Aspect_Mark
(Aspect_Specification : Asis.Element)
return Asis.Element;
------------------------------------------------------------------------------
-- Returns the aspect mark from the argument aspect specification
-- Element.
--
-- Appropriate Definition_Kinds:
-- An_Aspect_Specification
--
-- Returns Expression_Kinds:
-- An_Identifier
-- An_Attribute_Reference
function Aspect_Definition
(Aspect_Specification : Asis.Element)
return Asis.Element;
------------------------------------------------------------------------------
-- Returns the aspect definition expression from the argument aspect
-- specification
--
-- Appropriate Definition_Kinds:
--
-- An_Aspect_Specification
--
-- Returns Element_Kinds:
--
-- An_Expression
-- --|ASIS2012 end
end Asis.Definitions;
|
programs/oeis/004/A004379.asm | neoneye/loda | 22 | 22542 | ; A004379: Binomial coefficient C(7n,n-11).
; 1,84,4095,152096,4780230,134153712,3470108187,84431259000,1959267085776,43790762164380,949517708685546,20082459351180240,416047580521136200,8470484585302467168,169921950043809807675
mov $1,$0
add $0,11
mul $0,7
bin $0,$1
|
oeis/006/A006101.asm | neoneye/loda-programs | 11 | 242953 | ; A006101: Gaussian binomial coefficient [ n,3 ] for q=3.
; Submitted by <NAME>
; 1,40,1210,33880,925771,25095280,678468820,18326727760,494894285941,13362799477720,360801469802830,9741692640081640,263026177881648511,7101711092201899360,191746238094034963240,5177148775980218655520,139783020078437440101481,3774141570260554904072200,101901822650319679183070050,2751349213838193610644369400,74286428794147287946941452851,2005733577626621318719001068240,54154806597580576502824337003260,1462179778149631773653100087303280,39478854010174663761325712895430621
lpb $0
mov $2,$0
sub $0,1
seq $2,227524 ; Expansion of 1/((1-3x)(1-9x)(1-27x)).
add $3,$2
lpe
mov $0,$3
add $0,1
|
test/Bugs/MisspelledKeywordInRecord.agda | cruhland/agda | 1,989 | 14047 | -- Andreas, 2019-08-10
record R : Set₁ where
indutive
field A : Set
-- The error message is strange:
-- This declaration is illegal in a record before the last field
-- when scope checking the declaration
-- record R where
-- indutive
-- field A : Set
|
programs/oeis/070/A070719.asm | neoneye/loda | 22 | 95801 | <filename>programs/oeis/070/A070719.asm
; A070719: n^7 mod 38.
; 0,1,14,21,6,35,28,7,8,23,34,11,12,29,22,13,36,5,18,19,20,33,2,25,16,9,26,27,4,15,30,31,10,3,32,17,24,37,0,1,14,21,6,35,28,7,8,23,34,11,12,29,22,13,36,5,18,19,20,33,2,25,16,9,26,27,4,15,30,31,10,3,32,17,24,37
pow $0,7
mod $0,38
|
programs/oeis/210/A210535.asm | neoneye/loda | 22 | 177244 | <filename>programs/oeis/210/A210535.asm<gh_stars>10-100
; A210535: Second inverse function (numbers of columns) for pairing function A209293.
; 1,2,1,2,3,1,2,4,3,1,2,4,5,3,1,2,4,6,5,3,1,2,4,6,7,5,3,1,2,4,6,8,7,5,3,1,2,4,6,8,9,7,5,3,1,2,4,6,8,10,9,7,5,3,1,2,4,6,8,10,11,9,7,5,3,1,2,4,6,8,10,12,11,9,7,5,3,1,2,4,6,8,10,12,13,11,9,7,5,3,1,2,4,6,8,10,12,14,13,11
mul $0,2
add $0,1
seq $0,4739 ; Concatenation of sequences (1,2,2,...,n-1,n-1,n,n,n-1,n-1,...,2,2,1) for n >= 1.
|
oeis/203/A203423.asm | neoneye/loda-programs | 11 | 99331 | ; A203423: w(n+1)/(2*w(n)), where w=A203422.
; -3,24,-250,3240,-50421,917504,-19131876,450000000,-11789738455,340545503232,-10752962364222,368510430439424,-13623365478515625,540431955284459520,-22899384412078526344
add $0,1
mov $1,1
add $1,$0
mov $2,-1
sub $2,$1
pow $2,$0
mul $1,$2
mov $0,$1
div $0,2
|
Pi/Interp.agda | DreamLinuxer/popl21-artifact | 5 | 5711 | <filename>Pi/Interp.agda
module Pi.Interp where
open import Data.Unit
open import Data.Product
open import Data.Sum
open import Pi.Syntax
open import Pi.Opsem
-- Big-step intepreter
interp : {A B : 𝕌} → (A ↔ B) → ⟦ A ⟧ → ⟦ B ⟧
interp unite₊l (inj₂ v) = v
interp uniti₊l v = inj₂ v
interp swap₊ (inj₁ v) = inj₂ v
interp swap₊ (inj₂ v) = inj₁ v
interp assocl₊ (inj₁ v) = inj₁ (inj₁ v)
interp assocl₊ (inj₂ (inj₁ v)) = inj₁ (inj₂ v)
interp assocl₊ (inj₂ (inj₂ v)) = inj₂ v
interp assocr₊ (inj₁ (inj₁ v)) = inj₁ v
interp assocr₊ (inj₁ (inj₂ v)) = inj₂ (inj₁ v)
interp assocr₊ (inj₂ v) = inj₂ (inj₂ v)
interp unite⋆l (tt , v) = v
interp uniti⋆l v = (tt , v)
interp swap⋆ (v₁ , v₂) = (v₂ , v₁)
interp assocl⋆ (v₁ , (v₂ , v₃)) = ((v₁ , v₂) , v₃)
interp assocr⋆ ((v₁ , v₂) , v₃) = (v₁ , (v₂ , v₃))
interp dist (inj₁ v₁ , v₃) = inj₁ (v₁ , v₃)
interp dist (inj₂ v₂ , v₃) = inj₂ (v₂ , v₃)
interp factor (inj₁ (v₁ , v₃)) = (inj₁ v₁ , v₃)
interp factor (inj₂ (v₂ , v₃)) = (inj₂ v₂ , v₃)
interp id↔ v = v
interp (c₁ ⨾ c₂) v = interp c₂ (interp c₁ v)
interp (c₁ ⊕ c₂) (inj₁ v) = inj₁ (interp c₁ v)
interp (c₁ ⊕ c₂) (inj₂ v) = inj₂ (interp c₂ v)
interp (c₁ ⊗ c₂) (v₁ , v₂) = (interp c₁ v₁ , interp c₂ v₂)
|
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_21829_718.asm | ljhsiun2/medusa | 9 | 240473 | <filename>Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_21829_718.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r14
push %r15
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0xe7c4, %r14
nop
xor %r15, %r15
mov (%r14), %rsi
nop
nop
nop
nop
and $53982, %r10
lea addresses_D_ht+0x112fe, %r12
clflush (%r12)
nop
xor $48048, %rsi
mov (%r12), %rdi
nop
nop
nop
nop
nop
and $55064, %r10
lea addresses_WT_ht+0x90fe, %rsi
clflush (%rsi)
nop
cmp $64948, %r14
mov $0x6162636465666768, %r12
movq %r12, (%rsi)
nop
add %rsi, %rsi
lea addresses_UC_ht+0x9ac6, %r12
nop
nop
nop
dec %rdx
mov $0x6162636465666768, %r14
movq %r14, (%r12)
nop
nop
nop
cmp %rsi, %rsi
lea addresses_A_ht+0xbafe, %rdx
clflush (%rdx)
nop
nop
and $55250, %r10
movl $0x61626364, (%rdx)
nop
nop
nop
dec %rdx
lea addresses_WT_ht+0x1c0fe, %rdx
nop
nop
nop
nop
nop
xor %r12, %r12
mov (%rdx), %r15d
nop
nop
xor $64657, %rdi
lea addresses_WT_ht+0xb9aa, %r14
nop
nop
nop
nop
sub $47659, %rdi
movw $0x6162, (%r14)
nop
xor $42218, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %r15
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r8
push %r9
push %rdi
push %rsi
// Faulty Load
lea addresses_WC+0x188fe, %r9
nop
nop
nop
xor %rsi, %rsi
vmovups (%r9), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $0, %xmm7, %r14
lea oracles, %rsi
and $0xff, %r14
shlq $12, %r14
mov (%rsi,%r14,1), %r14
pop %rsi
pop %rdi
pop %r9
pop %r8
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': True, '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
*/
|
MSDOS/Virus.MSDOS.Unknown.tiny133.asm | fengjixuchui/Family | 3 | 29765 | VSize=085h
Code Segment
Assume CS:Code
org 0
db 4Dh
jmp Start
Org 600h
Bytes db 0CDh,20h,90h,90h
Start: mov si, 0100h
mov bx, offset Int21
mov cx, 0050h
mov di, si
add si, [si+2]
push di
movsw
movsw
mov es, cx
cmpsb
je StartFile
dec si
dec di
rep movsw
mov es, cx
xchg ax, bx
xchg ax, cx
Loop0: xchg ax, cx
xchg ax, word ptr es:[di-120h]
stosw
jcxz Loop0
xchg ax, bx
StartFile:
push ds
pop es
ret
Int21: cmp ax, 4B00h
jne End21
Exec: push ax
push bx
push dx
push ds
push es
mov ax, 3D02h
call DoInt21
jc EndExec
cbw ;Zero AH
cwd ;Zero DX
mov bx, si ;Move handle to BX
mov ds, ax ;Set DS and ES to 60h,
mov es, ax ;the virus data segment
mov ah, 3Fh ;Read first 4 bytes
int 69h
mov al, 4Dh
scasb ;Check for 4D5Ah or infected file mark
je Close ;.EXE or already infected
mov al, 2
call LSeek ;Seek to the end, SI now contains file size
mov cl, VSize ;Virus size in CX, prepare to write
int 69h ;AH is 40h, i.e. Write operation
mov ax, 0E94Dh ;Virus header in AX
stosw ;Store it
xchg ax, si ;Move file size in AX
stosw ;Complete JMP instruction
xchg ax, dx ;Zero AX
call LSeek ;Seek to the beginning
int 69h ;AH is 40h, write the virus header
Close: mov ah,3Eh ;Close the file
int 69h
EndExec: pop es
pop ds
pop dx
pop bx
pop ax
End21: jmp dword ptr cs:[69h * 4]
LSeek: mov ah, 42h ;Seek operation
cwd ;Zero DX
DoInt21: xor cx, cx ;External entry for Open, zero cx
int 69h
mov cl, 4 ;4 bytes will be read/written
xchg ax, si ;Store AX in SI
mov ax, 4060h ;Prepare AH for Write
xor di, di ;Zero DI
ret
VLen = $ - offset Bytes
Code EndS
End
|
src/Fragment/Algebra/Free/Base.agda | yallop/agda-fragment | 18 | 13683 | {-# OPTIONS --without-K --exact-split --safe #-}
open import Fragment.Algebra.Signature
module Fragment.Algebra.Free.Base (Σ : Signature) where
open import Fragment.Algebra.Algebra Σ
open import Fragment.Algebra.Free.Atoms public
open import Level using (Level; _⊔_)
open import Function using (_∘_)
open import Data.Empty using (⊥)
open import Data.Nat using (ℕ)
open import Data.Fin using (Fin)
open import Data.Vec using (Vec; []; _∷_)
open import Data.Vec.Relation.Binary.Pointwise.Inductive
using (Pointwise; []; _∷_)
open import Relation.Binary using (Setoid; IsEquivalence)
open import Relation.Binary.PropositionalEquality as PE using (_≡_)
private
variable
a ℓ : Level
module _ (A : Set a) where
data Term : Set a where
atom : A → Term
term : ∀ {arity} → (f : ops Σ arity) → Vec Term arity → Term
module _ (S : Setoid a ℓ) where
open Setoid S renaming (Carrier to A)
data _~_ : Term A → Term A → Set (a ⊔ ℓ) where
atom : ∀ {x y} → x ≈ y → atom x ~ atom y
term : ∀ {arity xs ys} {f : ops Σ arity}
→ Pointwise _~_ xs ys
→ term f xs ~ term f ys
private
mutual
map-~-refl : ∀ {n} {xs : Vec _ n} → Pointwise _~_ xs xs
map-~-refl {xs = []} = []
map-~-refl {xs = x ∷ xs} = ~-refl ∷ map-~-refl
~-refl : ∀ {x} → x ~ x
~-refl {atom _} = atom refl
~-refl {term _ _} = term map-~-refl
mutual
map-~-sym : ∀ {n} {xs ys : Vec _ n}
→ Pointwise _~_ xs ys
→ Pointwise _~_ ys xs
map-~-sym [] = []
map-~-sym (x≈y ∷ xs≈ys) =
~-sym x≈y ∷ map-~-sym xs≈ys
~-sym : ∀ {x y} → x ~ y → y ~ x
~-sym (atom x≈y) = atom (sym x≈y)
~-sym (term xs≈ys) = term (map-~-sym xs≈ys)
mutual
map-~-trans : ∀ {n} {xs ys zs : Vec _ n}
→ Pointwise _~_ xs ys
→ Pointwise _~_ ys zs
→ Pointwise _~_ xs zs
map-~-trans [] [] = []
map-~-trans (x≈y ∷ xs≈ys) (y≈z ∷ ys≈zs) =
~-trans x≈y y≈z ∷ map-~-trans xs≈ys ys≈zs
~-trans : ∀ {x y z} → x ~ y → y ~ z → x ~ z
~-trans (atom x≈y) (atom y≈z) =
atom (trans x≈y y≈z)
~-trans (term xs≈ys) (term ys≈zs) =
term (map-~-trans xs≈ys ys≈zs)
~-isEquivalence : IsEquivalence _~_
~-isEquivalence = record { refl = ~-refl
; sym = ~-sym
; trans = ~-trans
}
Herbrand : Setoid _ _
Herbrand = record { Carrier = Term A
; _≈_ = _~_
; isEquivalence = ~-isEquivalence
}
Free : Algebra
Free = record { ∥_∥/≈ = Herbrand
; ∥_∥/≈-isAlgebra = Free-isAlgebra
}
where term-cong : Congruence Herbrand term
term-cong f p = term p
Free-isAlgebra : IsAlgebra Herbrand
Free-isAlgebra = record { ⟦_⟧ = term
; ⟦⟧-cong = term-cong
}
F : ℕ → Algebra
F = Free ∘ Atoms (PE.setoid ⊥)
|
FileOperations/ReadFile/ReadFile.asm | Gra8-Git/assembler-xor-add-and-or- | 0 | 19840 | <filename>FileOperations/ReadFile/ReadFile.asm
; File: ReadFile.asm Modified
; Sergey.P
section .data ;section for constant values
filename db 'HelloWorld.txt' ;name of value with name of the File
section .bss ;section for input/output operations
file_in resb 10 ;name of value in/out put, and allocate memor$
fromfile resb 26 ;value to print constant value from file
section .text ;section for all operations inside programn
global main ;main global function
main: ;beginning of global function
mov eax, 5 ;system call set to reading sys_read()
mov ebx, filename ;file name from whare to read
mov ecx, 0 ;read only action
mov edx, 0777o ;kernel rwx 777 (Linux) set file attributes
int 0x80 ;syscall
;............................................$
mov [file_in], eax ;set as in/out put, operations from value
;............................................$
mov eax, 3 ;system call read from file sys_read()
mov ebx, [file_in] ;indexing address from whare to read
mov ecx, fromfile ;value to save information from file
mov edx, 26 ;langth of information
int 0x80 ;sys_call
;.............................................
mov eax, 4 ;syscall sys_write
mov ebx, 1 ;std_out()
mov ecx, fromfile ;print value
mov edx, 26 ;langth of the value
int 0x80 ;syscall
;.............................................
mov eax, 6 ;syscall close_file()
mov ebx, [file_in] ;close file desctiptor
;.............................................
mov eax, 1 ;syscall_exit()
int 0x80 ;syscall
|
external/source/shellcode/linux/ia32/stager_sock_reverse_icmp.asm | OsmanDere/metasploit-framework | 26,932 | 176072 | ;;
;
; Name: stager_sock_reverse_icmp
; Qualities: Can Have Nulls
; Platforms: Linux
; Authors: skape <mmiller [at] hick.org>
; vlad902 <vlad902 [at] gmail.com>
; Version: $Revision: 1417 $
; License:
;
; This file is part of the Metasploit Exploit Framework
; and is subject to the same licenses and copyrights as
; the rest of this package.
;
; Description:
;
; Implementation of a Linux reverse ICMP stager. This
; payload sends an ICMP echo request to a remote host
; and then waits for a response.
;
;;
BITS 32
GLOBAL _start
_start:
socket:
push byte 0x1
pop ebx
push ebx
push byte 0x3
push byte 0x2
push byte 0x66
pop eax
cdq
mov ecx, esp
int 0x80
xchg eax, ebx
sendto:
pop ecx
push dword 0x0100007f ; RHOST
push ecx
mov ecx, esp
push edx
push edx
push word 0xfff7
o16 push byte 0x8
mov edi, esp
push byte 0x10
push ecx
push edx
push byte 0x9
push edi
push ebx
mov ecx, esp
push byte 0xb
pop ebx
mov al, 0x66
int 0x80
read:
pop ebx
mov al, 0x3
mov dh, 0xc
int 0x80
push byte 0x1c
pop edx
add ecx, edx
jmp ecx
|
oeis/178/A178729.asm | neoneye/loda-programs | 11 | 100559 | <gh_stars>10-100
; A178729: a(n) = n XOR 3n, where XOR is bitwise XOR.
; Submitted by <NAME>
; 0,2,4,10,8,10,20,18,16,18,20,42,40,42,36,34,32,34,36,42,40,42,84,82,80,82,84,74,72,74,68,66,64,66,68,74,72,74,84,82,80,82,84,170,168,170,164,162,160,162,164,170,168,170,148,146,144,146,148,138,136,138,132,130,128,130,132,138,136,138,148,146,144,146,148,170,168,170,164,162,160,162,164,170,168,170,340,338,336,338,340,330,328,330,324,322,320,322,324,330
mov $5,$0
mul $5,3
mov $2,$5
mov $4,1
lpb $2
mov $2,$5
mov $3,$0
div $0,2
add $3,$5
mod $3,2
mul $3,$4
add $1,$3
sub $2,1
mul $4,2
div $5,2
lpe
mov $0,$1
|
src/Lemmachine/Default.agda | isabella232/Lemmachine | 56 | 12226 | module Lemmachine.Default where
open import Lemmachine
resource : Hooks
resource = []
main = runResolve (toApp resource)
|
src/spc_play.asm | PJBoy/alttp_sm_combo_randomizer_rom | 31 | 162085 | org $f57e00
incbin "data/spc-header.bin"
org $f57f00
incbin "data/spc-dmaregs.bin"
org $f60000
incbin "data/spc-lo.bin"
org $f70000
incbin "data/spc-hi.bin"
!AUDIO_R0 = $2140
!AUDIO_R1 = $2141
!AUDIO_R2 = $2142
!AUDIO_R3 = $2143
!XY_8BIT = $10
!A_8BIT = $20
!waitforaudio = "- : cmp !AUDIO_R0 : bne -"
!spcfreeaddr = $ff80
; Set up labels for use in code
org $f57e25
audiopc:
org $f57e27
audioa:
org $f57e28
audiox:
org $f57e29
audioy:
org $f57e2a
audiopsw:
org $f57e2b
audiosp:
org $f60000
musicdata1:
org $f70000
musicdata2:
org $f57f00
dspdata:
org $f50000
playmusic:
phx
phy
pha
php
phb
; Set bank to 80 for easier access to SMP registers
pea $8080
plb
plb
sep #$20
rep #$10
; Send $00 to SMP to stop music
;lda #$00
;sta $002140
; Send $ff to SMP to enter upload mode
;lda #$ff
;sta $002140
; Clear $12-14 for use later
rep #$30
lda #$0000
sta $12
sta $14
; Call SM's own APU upload code with our "hacked" data to break out of
; SM's own SMP code, turn on IPL ROM and jump to it and wait for further uploads
;jsl $80800a
;dl sm_spc_data
; Call our own SPC loading code that uploads the new SPC data and executes it
jsr loadspc
plb
plp
pla
ply
plx
rtl
loadspc:
; Turn off interrupts and NMI during SPC transfer
lda #$0000
sta $004200
sei
; Copy $02-ef to SPC RAM
; sendmusicblock $e0 $c002 $0002 $00ee
sep #!A_8BIT
lda #$f6 ; 1
sta $14
rep #!A_8BIT
lda #$0002 ; 2
sta $12
rep #!XY_8BIT
ldx #$0002 ; 3
ldy #$00ee ; 4
jsr copyblocktospc
; sendmusicblock $f6 $0100 $0100 $7f00
sep #!A_8BIT
lda #$f6 ; 1
sta $14
rep #!A_8BIT
lda #$0100 ; 2
sta $12
rep #!XY_8BIT
ldx #$0100 ; 3
ldy #$7f00 ; 4
jsr copyblocktospc
; sendmusicblock $f7 $0000 $8000 $7fc0
sep #!A_8BIT
lda #$f7 ; 1
sta $14
rep #!A_8BIT
lda #$0000 ; 2
sta $12
rep #!XY_8BIT
ldx #$8000 ; 3
ldy #$7fc0 ; 4
jsr copyblocktospc
; Create SPC init code that sets up registers
jsr makespcinitcode
; Copy init code to RAM
; sendmusicblock $7e $ff00 {spcfreeaddr} $003a
sep #!A_8BIT
lda #$7e ; 1
sta $14
rep #!A_8BIT
lda #$ff00 ; 2
sta $12
rep #!XY_8BIT
ldx #!spcfreeaddr ; 3
ldy #$003a ; 4
jsr copyblocktospc
; endmacro
; Initialize the DPS with values from the SPC
jsr initdsp
; Start execution of init code, first $f0-ff init and then registers and finally
; jump to the SPC entry point
rep #!XY_8BIT
ldx #!spcfreeaddr
jsr startspcexec
; Restore interrupts and NMI and exit
;cli
;sep #!A_8BIT
;lda #$80
;sta $004200
rts
copyblocktospc:
sep #!A_8BIT
lda #$aa
!waitforaudio
stx !AUDIO_R2
tyx
lda #$01
sta !AUDIO_R1
lda #$cc
sta !AUDIO_R0
!waitforaudio
ldy #$0000
.loop:
xba
lda [$12], y
xba
tya
rep #!A_8BIT
sta !AUDIO_R0
sep #!A_8BIT
!waitforaudio
iny
dex
bne .loop
ldx #$ffc9
stx !AUDIO_R2
xba
lda #$00
sta !AUDIO_R1
xba
clc
adc #$02
rep #!A_8BIT
sta !AUDIO_R0
sep #!A_8BIT
!waitforaudio
rts
startspcexec:
sep #!A_8BIT
lda #$aa
!waitforaudio
stx !AUDIO_R2
lda #$00
STA !AUDIO_R1
lda #$cc
STA !AUDIO_R0
!waitforaudio
rts
initdsp:
rep #!XY_8BIT
ldx #$0000
-
cpx #$006c
beq .skip
cpx #$007d
beq .skip
cpx #$004c
beq .skip
cpx #$005c
beq .skip
sep #!A_8BIT
txa
sta $7eff00
lda.l dspdata,x
sta $7eff01
phx
; sendmusicblock $7e $ff00 $00f2 $0002
sep #!A_8BIT
lda #$7e ; 1
sta $14
rep #!A_8BIT
lda #$ff00 ; 2
sta $12
rep #!XY_8BIT
ldx #$00f2 ; 3
ldy #$0002 ; 4
jsr copyblocktospc
; endmacro
rep #!XY_8BIT
plx
.skip:
inx
cpx #$0080
bne -
rts
makespcinitcode:
sep #!A_8BIT
lda $f60001
pha
lda $f60000
pha
lda #$8f
sta $7eff00
pla
sta $7eff01
lda #$00
sta $7eff02
lda #$8f
sta $7eff03
pla
sta $7eff04
lda #$01
sta $7eff05
lda #$cd
sta $7eff06
lda.l audiosp
sta $7eff07
lda #$bd
sta $7eff08
lda #$cd
sta $7eff09
lda.l audiopsw
sta $7eff0a
lda #$4d
sta $7eff0b
lda #$cd
sta $7eff0c
lda.l audiox
sta $7eff0d
lda #$8d
sta $7eff0e
lda.l audioy
sta $7eff0f
lda #$8f
sta $7eff10
lda.l musicdata1+$fc
sta $7eff11
lda #$fc
sta $7eff12
lda #$8f
sta $7eff13
lda.l musicdata1+$fb
sta $7eff14
lda #$fb
sta $7eff15
lda #$8f
sta $7eff16
lda.l musicdata1+$fa
sta $7eff17
lda #$fa
sta $7eff18
lda #$8f
sta $7eff19
lda.l musicdata1+$f1
sta $7eff1a
lda #$f1
sta $7eff1b
lda #$e4
sta $7eff1c
lda #$fd
sta $7eff1d
lda #$e4
sta $7eff1e
lda #$fe
sta $7eff1f
lda #$e4
sta $7eff20
lda #$ff
sta $7eff21
lda #$e8
sta $7eff22
lda.l audioa
sta $7eff23
lda #$8f
sta $7eff24
lda #$7d
sta $7eff25
lda #$f2
sta $7eff26
lda #$8f
sta $7eff27
lda.l dspdata+$7d
sta $7eff28
lda #$f3
sta $7eff29
lda #$8f
sta $7eff2a
lda #$6c
sta $7eff2b
lda #$f2
sta $7eff2c
lda #$8f
sta $7eff2d
lda.l dspdata+$6c
sta $7eff2e
lda #$f3
sta $7eff2f
lda #$8f
sta $7eff30
lda #$4c
sta $7eff31
lda #$f2
sta $7eff32
lda #$8f
sta $7eff33
lda.l dspdata+$4c
sta $7eff34
lda #$f3
sta $7eff35
lda #$8e
sta $7eff36
lda #$5f
sta $7eff37
rep #!A_8BIT
lda.l audiopc
sta $7eff38
sep #!A_8BIT
xba
sta $7eff39
rts
; Overwrite some code in the SM music engine that sets up the transfers
credits_sm_spc_data:
dw $002a, $15a0
db $8f, $6c, $f2
db $8f, $e0, $f3 ; Disable echo buffer writes and mute amplifier
db $8f, $7c, $f2
db $8f, $ff, $f3 ; ENDX
db $8f, $7d, $f2
db $8f, $00, $f3 ; Disable echo delay
db $8f, $4d, $f2
db $8f, $00, $f3 ; EON
db $8f, $5c, $f2
db $8f, $ff, $f3 ; KOFF
db $8f, $5c, $f2
db $8f, $00, $f3 ; KOFF
db $8f, $80, $f1 ; Enable IPL ROM
db $5f, $c0, $ff ; jmp $ffc0
dw $0000, $1500
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_1832.asm | ljhsiun2/medusa | 9 | 177965 | <filename>Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_1832.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x4382, %rsi
lea addresses_A_ht+0x17f2f, %rdi
nop
nop
nop
nop
nop
and $25747, %rax
mov $2, %rcx
rep movsq
nop
nop
nop
nop
nop
dec %r12
lea addresses_WT_ht+0x14db5, %rdx
nop
nop
nop
nop
xor $57205, %rbp
mov (%rdx), %eax
nop
nop
nop
xor %rax, %rax
lea addresses_normal_ht+0x1edef, %rsi
lea addresses_D_ht+0x722f, %rdi
nop
nop
nop
nop
and %r14, %r14
mov $37, %rcx
rep movsq
nop
nop
nop
nop
nop
and %rsi, %rsi
lea addresses_A_ht+0xc32f, %rsi
lea addresses_WC_ht+0x1152f, %rdi
nop
nop
nop
nop
add %r14, %r14
mov $102, %rcx
rep movsb
nop
nop
and $63267, %rax
lea addresses_WT_ht+0x85af, %rcx
nop
nop
nop
add %rsi, %rsi
movl $0x61626364, (%rcx)
nop
nop
nop
nop
inc %rcx
lea addresses_UC_ht+0x1232f, %rsi
lea addresses_WT_ht+0x9135, %rdi
nop
nop
nop
nop
nop
xor %r12, %r12
mov $41, %rcx
rep movsw
nop
nop
xor $11607, %r12
lea addresses_A_ht+0x1e23b, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
inc %rcx
mov (%rdi), %r12w
nop
nop
nop
nop
nop
xor $10958, %rdi
lea addresses_normal_ht+0x12f2f, %r12
nop
nop
nop
nop
nop
sub $45787, %rcx
movups (%r12), %xmm1
vpextrq $0, %xmm1, %rdi
nop
nop
nop
nop
nop
cmp $1985, %rdx
lea addresses_D_ht+0x179fa, %rsi
lea addresses_WT_ht+0x1cb2e, %rdi
clflush (%rdi)
nop
nop
nop
xor %rbp, %rbp
mov $58, %rcx
rep movsb
nop
nop
nop
nop
nop
sub %rdx, %rdx
lea addresses_UC_ht+0xa72f, %rax
add %rbp, %rbp
movb (%rax), %r14b
and %r14, %r14
lea addresses_A_ht+0x16b4b, %rsi
lea addresses_A_ht+0x1b92f, %rdi
nop
nop
nop
nop
add $31494, %r12
mov $57, %rcx
rep movsl
nop
nop
nop
nop
dec %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r9
push %rax
push %rbp
push %rdx
// Store
lea addresses_UC+0xc2cf, %r12
nop
nop
nop
and $2563, %r9
movw $0x5152, (%r12)
inc %rax
// Store
lea addresses_UC+0xdb2f, %r9
nop
nop
nop
nop
nop
and $16292, %r13
mov $0x5152535455565758, %r12
movq %r12, %xmm7
vmovups %ymm7, (%r9)
sub $7677, %r9
// Store
lea addresses_A+0x1a32f, %r13
nop
nop
nop
nop
nop
add $26702, %r12
movl $0x51525354, (%r13)
nop
xor %r13, %r13
// Load
lea addresses_normal+0xfeff, %rdx
clflush (%rdx)
nop
nop
add %r12, %r12
movb (%rdx), %r9b
nop
nop
xor $64453, %rax
// Faulty Load
lea addresses_UC+0xdb2f, %rax
nop
nop
xor $32689, %rbp
vmovups (%rax), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %r9
lea oracles, %rdx
and $0xff, %r9
shlq $12, %r9
mov (%rdx,%r9,1), %r9
pop %rdx
pop %rbp
pop %rax
pop %r9
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 11, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 4, 'size': 1, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': False, 'NT': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 8, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 10, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': True}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
icasrc/Light_Rotator.adb | bhayward93/Ada-Traffic-Light-Sim | 0 | 1327 | <filename>icasrc/Light_Rotator.adb
with HWIF;use HWIF;
--Use only north and east.
task Light_Rotator (dir : in Direction);
task body Light_Rotator is
if dir = North or dir = South then
task EastSwitch;
task body EastSwitch is
TrafficLightSwitcher(East);
end EastSwitch;
task WestSwitch;
task body WestSwitch is
TrafficLightSwitcher(West);
end WestSwitch;
elsif dir = East or dir = West then
task NorthSwitch;
task body NorthSwitch is
TrafficLightSwitcher(North);
end NorthSwitch;
task SouthSwitch;
task body SouthSwitch is
TrafficLightSwitcher(South);
end SouthSwitch;
end if;
|
src/fltk-widgets-menus-menu_bars.adb | micahwelf/FLTK-Ada | 1 | 21429 | <filename>src/fltk-widgets-menus-menu_bars.adb<gh_stars>1-10
with
Interfaces.C,
System;
use type
System.Address;
package body FLTK.Widgets.Menus.Menu_Bars is
procedure menu_bar_set_draw_hook
(W, D : in System.Address);
pragma Import (C, menu_bar_set_draw_hook, "menu_bar_set_draw_hook");
pragma Inline (menu_bar_set_draw_hook);
procedure menu_bar_set_handle_hook
(W, H : in System.Address);
pragma Import (C, menu_bar_set_handle_hook, "menu_bar_set_handle_hook");
pragma Inline (menu_bar_set_handle_hook);
function new_fl_menu_bar
(X, Y, W, H : in Interfaces.C.int;
Text : in Interfaces.C.char_array)
return System.Address;
pragma Import (C, new_fl_menu_bar, "new_fl_menu_bar");
pragma Inline (new_fl_menu_bar);
procedure free_fl_menu_bar
(M : in System.Address);
pragma Import (C, free_fl_menu_bar, "free_fl_menu_bar");
pragma Inline (free_fl_menu_bar);
procedure fl_menu_bar_draw
(W : in System.Address);
pragma Import (C, fl_menu_bar_draw, "fl_menu_bar_draw");
pragma Inline (fl_menu_bar_draw);
function fl_menu_bar_handle
(W : in System.Address;
E : in Interfaces.C.int)
return Interfaces.C.int;
pragma Import (C, fl_menu_bar_handle, "fl_menu_bar_handle");
pragma Inline (fl_menu_bar_handle);
procedure Finalize
(This : in out Menu_Bar) is
begin
if This.Void_Ptr /= System.Null_Address and then
This in Menu_Bar'Class
then
free_fl_menu_bar (This.Void_Ptr);
This.Void_Ptr := System.Null_Address;
end if;
Finalize (Menu (This));
end Finalize;
package body Forge is
function Create
(X, Y, W, H : in Integer;
Text : in String)
return Menu_Bar is
begin
return This : Menu_Bar do
This.Void_Ptr := new_fl_menu_bar
(Interfaces.C.int (X),
Interfaces.C.int (Y),
Interfaces.C.int (W),
Interfaces.C.int (H),
Interfaces.C.To_C (Text));
fl_widget_set_user_data
(This.Void_Ptr,
Widget_Convert.To_Address (This'Unchecked_Access));
menu_bar_set_draw_hook (This.Void_Ptr, Draw_Hook'Address);
menu_bar_set_handle_hook (This.Void_Ptr, Handle_Hook'Address);
end return;
end Create;
end Forge;
procedure Draw
(This : in out Menu_Bar) is
begin
fl_menu_bar_draw (This.Void_Ptr);
end Draw;
function Handle
(This : in out Menu_Bar;
Event : in Event_Kind)
return Event_Outcome is
begin
return Event_Outcome'Val
(fl_menu_bar_handle (This.Void_Ptr, Event_Kind'Pos (Event)));
end Handle;
end FLTK.Widgets.Menus.Menu_Bars;
|
src/support_utils/support_utils-developer_parameters.ads | spr93/whitakers-words | 204 | 26632 | <gh_stars>100-1000
-- WORDS, a Latin dictionary, by <NAME> (USAF, Retired)
--
-- Copyright <NAME> (1936–2010)
--
-- This is a free program, which means it is proper to copy it and pass
-- it on to your friends. Consider it a developmental item for which
-- there is no charge. However, just for form, it is Copyrighted
-- (c). Permission is hereby freely given for any and all use of program
-- and data. You can sell it as your own, but at least tell me.
--
-- This version is distributed without obligation, but the developer
-- would appreciate comments and suggestions.
--
-- All parts of the WORDS system, source code and data files, are made freely
-- available to anyone who wishes to use them, for whatever purpose.
with Ada.Text_IO;
package Support_Utils.Developer_Parameters is
-- This package defines a number of parameters that areused in the program
-- The default values are set in the body, so that they may be changed
-- easily
-- These files are used by the program if requested, but not necessary
-- They are all text files and human readable
-- DEVELOPER MODE_FILE is used by the program to remember values
Mdev_File : Ada.Text_IO.File_Type;
Mdev_Full_Name : constant String := "WORD.MDV";
-- Debug not currently in use
-- -- DBG collects debug Output for one entry at a time
-- DBG : TEXT_IO.FILE_TYPE;
-- DEBUG_FULL_NAME : constant STRING := "WORD.DBG";
-- STATS collects statistics on the program, stems used, inflections, etc.
Stats : Ada.Text_IO.File_Type;
Stats_Full_Name : constant String := "WORD.STA";
type Mdev_Type is (
-- HAVE_DEBUG_FILE, -- No longer in use
-- WRITE_DEBUG_FILE,
Have_Statistics_File,
Write_Statistics_File,
Show_Dictionary,
Show_Dictionary_Line,
Show_Dictionary_Codes,
Do_Pearse_Codes,
Do_Only_Initial_Word,
For_Word_List_Check,
Do_Only_Fixes,
Do_Fixes_Anyway,
Use_Prefixes,
Use_Suffixes,
Use_Tackons,
Do_Medieval_Tricks,
Do_Syncope,
Do_Two_Words,
Include_Unknown_Context,
No_Meanings,
Omit_Archaic,
Omit_Medieval,
Omit_Uncommon,
Do_I_For_J,
Do_U_For_V,
Pause_In_Screen_Output,
No_Screen_Activity,
Update_Local_Dictionary,
Update_Meanings,
Minimize_Output);
package Mdev_Type_Io is new Ada.Text_IO.Enumeration_IO (Mdev_Type);
type Mdev_Array is array (Mdev_Type) of Boolean;
Words_Mdev : Mdev_Array; -- Initialized in body
Start_File_Character : Character := '@';
Change_Developer_Modes_Character : Character := '!';
procedure Change_Developer_Modes;
procedure Update_Local_Dictionary_File;
procedure Initialize_Developer_Parameters;
end Support_Utils.Developer_Parameters;
|
libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_disk_filemap_callee.asm | jpoikela/z88dk | 640 | 10249 | <gh_stars>100-1000
; unsigned char esx_disk_filemap(uint8_t handle,struct esx_filemap *fmap)
SECTION code_esxdos
PUBLIC esx_disk_filemap_callee
EXTERN asm_esx_disk_filemap
esx_disk_filemap_callee:
pop af
pop hl
pop de
push af
ld a,e
jp asm_esx_disk_filemap
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _esx_disk_filemap_callee
defc _esx_disk_filemap_callee = esx_disk_filemap_callee
ENDIF
|
Ex1Sol.agda | clarkdm/CS410 | 0 | 14740 | module Ex1Sol where
----------------------------------------------------------------------------
-- EXERCISE 1 -- NUMBERS, LISTS, VECTORS (a driving lesson)
--
-- VALUE: 15%
-- DEADLINE: 5pm, Friday 2 October (week 2)
--
-- DON'T SUBMIT, COMMIT! Create your own private version of the CS410 repo,
-- hosted somewhere like BitBucket, and invite users "pigworker" and
-- "jmchapman" to collaborate with you on the project. The last version of
-- your repo committed before the deadline is the "official" version, for
-- marking purposes, but we're unlikely to penalise submission over the
-- weekend. You can trust us not to look until Monday!
--
-- The purpose of this exercise is to get you used to using Agda and its
-- emacs interface.
----------------------------------------------------------------------------
open import CS410-Prelude
-- HINT: your tasks are heralded with the eminently searchable tag, "???"
-- TIP: when you load this file, you should see 11 open goals, which is
-- too many to think about at once; use comments {- .. -} to switch off the
-- parts of the file you haven't reached yet.
----------------------------------------------------------------------------
-- "Nat" -- the type of unary natural numbers
----------------------------------------------------------------------------
data Nat : Set where
zero : Nat
suc : Nat -> Nat
{-# BUILTIN NATURAL Nat #-} -- means we can write 2 for suc (suc zero)
-- TERMINOLOGY Set and "type". By "type", I mean anything you can put to
-- the right of : to classify the thing to the left of :, so "Set" is a
-- type, as in Nat : Set, and Nat is a type, as in zero : Nat. Being a
-- Set is *one* way of being a type, but it is not the only way. In
-- particular, try uncommenting this (and then change your mind).
{-+}
mySet : Set
mySet = Set
{+-}
-- SPOT THE DIFFERENCE: in Haskell, we'd write
--
-- data Nat = Zero | Suc Nat
--
-- saying what the type is called and what is in it, and then we'd find
-- that Zero :: Nat and Suc :: Nat -> Nat. Also, constructors live in a
-- separate namespace, with capital initial letters.
--
-- In Agda, we say what type each thing belongs to. Everything lives in
-- the same namespace. Capitalisation is only a social convention. I tend
-- to use capitals for typey things and lower case for valuey things.
-- And we use just the one colon for typing, not two, because types are
-- more important than lists.
----------------------------------------------------------------------------
-- ??? 1.1 addition (score: ? / 1)
--
-- There are lots of ways to add two numbers together. Do you inspect the
-- first? Do you inspect the second? Make sure you get the correct numerical
-- answer, whatever you do. You may need to revisit this problem later, when
-- the way addition works has a significant impact on types.
----------------------------------------------------------------------------
_+N_ : Nat -> Nat -> Nat
zero +N n = n
suc m +N n = suc (m +N n)
infixr 3 _+N_
-- NOTATION: a name _+N_ with underscores in it serves double duty.
-- (1) it is a perfectly sensible PREFIX operator, so _+N_ 2 2 makes sense
-- (2) it describes the INFIX usage of the operator, with the underscores
-- showing where the arguments go, with EXTRA SPACING, so the infix
-- version of _+N_ 2 2 is 2 +N 2.
-- When you think you're done, uncomment these unit tests, e.g., by turning
-- {-+} to {-(-} and {+-} to {-)-}. They should typecheck ok.
{-+}
testPlus1 : 2 +N 2 == 4
testPlus1 = refl
testPlus2 : 0 +N 5 == 5
testPlus2 = refl
testPlus3 : 5 +N 0 == 5
testPlus3 = refl
{+-}
----------------------------------------------------------------------------
-- ??? 1.2 multiplication (score: ? / 1)
--
-- There's also a lot of choice in how to multiply, but they all rely on
-- repeated addition. Find a way to do it.
----------------------------------------------------------------------------
_*N_ : Nat -> Nat -> Nat
m *N n = {!!}
infixr 4 _*N_
-- unit tests
{-+}
testMult1 : 2 *N 2 == 4
testMult1 = refl
testMult2 : 0 *N 5 == 0
testMult2 = refl
testMult3 : 5 *N 0 == 0
testMult3 = refl
testMult4 : 1 *N 5 == 5
testMult4 = refl
testMult5 : 5 *N 1 == 5
testMult5 = refl
testMult6 : 2 *N 3 == 6
testMult6 = refl
{+-}
----------------------------------------------------------------------------
-- ??? 1.3 subtraction I (score: ? / 1)
--
-- Subtraction is a nuisance. How do you take a big number away from a
-- smaller one? Give the closest answer you can to the correct answer.
----------------------------------------------------------------------------
_-N1_ : Nat -> Nat -> Nat
m -N1 n = {!!}
-- unit tests
{-+}
testSubN1-1 : 4 -N1 2 == 2
testSubN1-1 = refl
testSubN1-2 : 42 -N1 37 == 5
testSubN1-2 = refl
{+-}
----------------------------------------------------------------------------
-- "Maybe" allows for the possibility of errors
----------------------------------------------------------------------------
data Maybe (X : Set) : Set where
yes : X -> Maybe X
no : Maybe X
-- SPOT THE DIFFERENCE: in Haskell, these are "Just" and "Nothing"
-- LATER, we'll revisit Maybe and define it in terms of more basic ideas.
----------------------------------------------------------------------------
-- ??? 1.4 subtraction II (score: ? / 1)
--
-- Implement subtraction with a type acknowledging that failure can happen.
----------------------------------------------------------------------------
_-N2_ : Nat -> Nat -> Maybe Nat
m -N2 n = {!!}
-- unit tests
{-+}
testSubN2-1 : 4 -N2 2 == yes 2
testSubN2-1 = refl
testSubN2-2 : 42 -N2 37 == yes 5
testSubN2-2 = refl
testSubN2-3 : 37 -N2 42 == no
testSubN2-3 = refl
{+-}
----------------------------------------------------------------------------
-- _N>=_ as a relation, not a test
----------------------------------------------------------------------------
_N>=_ : Nat -> Nat -> Set -- not Two (a.k.a. Bool), but Set
-- the set of "ways it can be true"
-- i.e., what counts as EVIDENCE
m N>= zero = One -- anything is at least zero in a boring way
zero N>= suc n = Zero -- no way is zero bigger than a successor
suc m N>= suc n = m N>= n -- the way to compare successors
-- What's funny is that it's just an ordinary program, computing by
-- pattern matching and recursion.
----------------------------------------------------------------------------
-- ??? 1.5 subtraction III (score: ? / 1)
--
-- Implement subtraction with explicit evidence that the inputs are
-- amenable to subtraction.
----------------------------------------------------------------------------
_-N3_-:_ : (m : Nat) -> (n : Nat) -> m N>= n -> Nat
m -N3 n -: p = {!!}
-- DON'T PANIC about the syntax (m : Nat) -> (n : Nat) ->
-- The type of both those arguments is Nat. However, when we write the
-- type this way, we can name those arguments for use further along in
-- the type, i.e. in the third argument. That's an example of a *dependent*
-- type. In fact, the regular syntax Nat -> is short for (_ : Nat) -> where
-- we don't bother naming the thing.
-- NOTICE that we can have fancy multi-place operators.
-- HINT: you will need to learn about the "absurd" pattern, written ().
-- unit tests
{-+}
testSubN3-1 : 4 -N3 2 -: <> == 2
testSubN3-1 = refl
testSubN3-2 : 42 -N3 37 -: <> == 5
testSubN3-2 = refl
{+-}
-- Uncomment this test and try to fill in the missing bits to make it work.
{-+}
testSubN3-3 : 37 -N3 42 -: {!!} == {!!}
testSubN3-3 = refl
{+-}
-- HAHA! YA CANNAE! So comment it out again.
-- EXTRA! You can
-- write (m : Nat) -> (n : Nat) ->
-- as (m : Nat)(n : Nat) -> -- omitting all but the last ->
-- or as (m n : Nat) -> -- two named args sharing a type.
-- NOTICE how the defining equations for _N>=_ play a crucial role in the
-- typechecking of the above.
-- NOTICE that attempts II and III take contrasting approaches to the
-- problem with I. II broadens the output to allow failure. III narrows the
-- input to ensure success.
-- LATER, we'll see how to make the proof-plumbing less explicit
-- SUSPICIOUS: why aren't they asking us to define division?
----------------------------------------------------------------------------
-- List -- the thing that was [ .. ] in Haskell
----------------------------------------------------------------------------
data List (X : Set) : Set where -- X scopes over the whole declaration...
[] : List X -- ...so you can use it here...
_::_ : X -> List X -> List X -- ...and here.
infixr 3 _::_
----------------------------------------------------------------------------
-- ??? 1.6 concatenation (score: ? / 1)
----------------------------------------------------------------------------
_+L_ : {X : Set} -> List X -> List X -> List X
[] +L ys = ys
(x :: xs) +L ys = x :: (xs +L ys)
infixr 3 _+L_
-- DON'T PANIC about the "curly braces" syntax. It's very similar to the
-- (m : Nat) -> syntax we saw, above. It describes an argument by giving
-- its type, Set, and a name X to allow dependency. All the braces do is
-- set the default usage convention that X is by default INVISIBLE. Any
-- time you use the function _+L_, Agda will try to figure out what is
-- the appropriate thing to put for the invisible argument, which is the
-- element type for the lists. She will usually succeed, because the types
-- of the lists you feed in will be a dead giveaway.
-- SPOT THE DIFFERENCE: back when you learned Haskell, you learned about
-- TWO ideas, FUNCTIONS and POLYMORPHISM. Now you can see that there was
-- only ONE IDEA, after all. This sort of collapse will keep happening.
-- The world is simpler, made of a smaller number of better articulated
-- parts.
-- unit test
{-+}
testConcL : (0 :: 1 :: 2 :: []) +L (3 :: 4 :: [])
== 0 :: 1 :: 2 :: 3 :: 4 :: []
testConcL = refl
{+-}
----------------------------------------------------------------------------
-- ??? 1.7 take I (score: ? / 1)
--
-- Given a number, n, and a list, xs, compute the first n elements of xs.
-- Of course, there will be a tiny little problem if the caller asks for
-- more elements than are available, hence the name of the function.
-- You must ensure that the list returned is indeed a prefix of the list
-- supplied, and that it has the requested length if possible, and at most
-- that length if not.
----------------------------------------------------------------------------
mis-take : {X : Set} -> Nat -> List X -> List X
mis-take n xs = {!!}
-- unit test
{-+}
testMisTake : mis-take 3 (0 :: 1 :: 2 :: 3 :: 4 :: [])
== 0 :: 1 :: 2 :: []
testMisTake = refl
{+-}
----------------------------------------------------------------------------
-- ??? 1.8 take II (score: ? / 2)
--
-- Fix mis-take by acknowledging the possibility of error. Ensure that your
-- function returns "yes" with a list of exactly the right length if
-- possible, or says "no". You may need to use the "with" construct to
-- inspect the result of the recursive call.
----------------------------------------------------------------------------
may-take : {X : Set} -> Nat -> List X -> Maybe (List X)
may-take n xs = {!!}
-- unit test
{-+}
testMayTake1 : may-take 3 (0 :: 1 :: 2 :: 3 :: 4 :: [])
== yes (0 :: 1 :: 2 :: [])
testMayTake1 = refl
testMayTake2 : may-take 6 (0 :: 1 :: 2 :: 3 :: 4 :: [])
== no
testMayTake2 = refl
testMayTake3 : may-take 5 (0 :: 1 :: 2 :: 3 :: 4 :: [])
== yes (0 :: 1 :: 2 :: 3 :: 4 :: [])
testMayTake3 = refl
{+-}
----------------------------------------------------------------------------
-- ??? 1.9 length (score: ? / 1)
----------------------------------------------------------------------------
-- Show how to compute the length of a list.
length : {X : Set} -> List X -> Nat
length xs = {!!}
-- unit test
{-+}
testLength : length (0 :: 1 :: 2 :: 3 :: 4 :: []) == 5
testLength = refl
{+-}
----------------------------------------------------------------------------
-- "Vectors" -- Lists indexed by length
----------------------------------------------------------------------------
-- We seem to be troubled by things fouling up when lists have the wrong
-- length. Here's a way to make list-like structures whose types let us
-- keep tabs on length: the "vectors".
data Vec (X : Set) : (n : Nat) -> Set where -- n's not in scope after "where"
[] : Vec X zero -- it's zero here,...
_::_ : {n : Nat} -> X -> Vec X n -> Vec X (suc n) -- ...successor, there
-- DON'T PANIC
-- Vec X is not a Set, but rather an INDEXED FAMILY of sets. For each n in
-- Nat, Vec X n is a Set. The index, n, is the length. The constructors are
-- just like those of List, except that their types also tell the truth
-- about length, via the index.
-- NOTICE that when we write a "cons", x :: xs, the length of the tail, xs,
-- is an invisible argument.
-- DON'T PANIC about the reuse of constructor names. We're usually starting
-- with types and working towards code, so it is almost always clear which
-- type's constructors we mean.
-- SUSPICION: we declared List, then wrote length, then invented Vec.
-- Perhaps there is some way to say "Vec is List indexed by length" and
-- have it invented for us.
----------------------------------------------------------------------------
-- ??? 1.10 concatenation (score: ? / 1)
----------------------------------------------------------------------------
-- When we concatenate vectors, we add their lengths.
_+V_ : {X : Set}{m n : Nat} -> Vec X m -> Vec X n -> Vec X (m +N n)
[] +V ys = ys
(x :: xs) +V ys = x :: (xs +V ys)
infixr 3 _+V_
-- NOTICE that even though m and n are numbers, not types, they can
-- still be invisible.
-- DON'T PANIC if this doesn't work out to be just as easy (or even easier)
-- than for lists. You may need to tinker with your definition of _+N_ to
-- make _+V_ typecheck smoothly. That's because the defining equations for
-- _+N_ are all the typechecker has to go on when seeing that your code
-- here fits together properly.
-- unit test
{-+}
testConcV : (0 :: 1 :: 2 :: []) +V (3 :: 4 :: [])
== 0 :: 1 :: 2 :: 3 :: 4 :: []
testConcV = refl
{+-}
----------------------------------------------------------------------------
-- ??? 1.11 take (score: ? / 2)
----------------------------------------------------------------------------
-- Now we know the lengths, we can give a PRECONDITION for taking.
take : {X : Set}{m : Nat}(n : Nat) -> m N>= n -> Vec X m -> Vec X n
take n p xs = {!!}
-- unit test
{-+}
testTake1 : take 3 <> (0 :: 1 :: 2 :: 3 :: 4 :: [])
== 0 :: 1 :: 2 :: []
testTake1 = refl
testTake3 : take 5 <> (0 :: 1 :: 2 :: 3 :: 4 :: [])
== 0 :: 1 :: 2 :: 3 :: 4 :: []
testTake3 = refl
{+-}
-- check you can't finish this
{-+}
testTake2 : take 6 {!!} (0 :: 1 :: 2 :: 3 :: 4 :: [])
== {!!}
testTake2 = refl
{+-}
----------------------------------------------------------------------------
-- Chopping: one last wild weird new thing
----------------------------------------------------------------------------
-- Here's a thing you'd struggle to do in Haskell. It's really about seeing.
-- A vector of length m +N n is "Choppable" if you can show how it is given
-- by concatenating a vector of length m and a vector of length n.
data Choppable {X : Set}(m n : Nat) : Vec X (m +N n) -> Set where
chopTo : (xs : Vec X m)(ys : Vec X n) -> Choppable m n (xs +V ys)
----------------------------------------------------------------------------
-- ??? 1.12 chop (score: ? / 2)
----------------------------------------------------------------------------
chop : {X : Set}(m n : Nat)(xs : Vec X (m +N n)) -> Choppable m n xs
chop zero n xs = chopTo [] xs
chop (suc m) n (x :: xs) with chop m n xs
chop (suc m) n (x :: .(xs +V ys)) | chopTo xs ys = chopTo (x :: xs) ys
-- DON'T PANIC if you can't pattern match on the vector right away, because
-- the fact is that without looking at WHERE TO CHOP, you don't know if you
-- need to.
-- HINT You can access vectors only from the "left end", which is a big
-- clue about which number you should inspect.
-- HINT Much like in -N2 and may-take, you will probably benefit from using
-- the "with" feature to allow you to match on the outcome of a recursive
-- call.
-- DON'T PANIC if dotty things appear spontaneously in your patterns. That's
-- knowledge for free: the pattern checker is saying "you don't need to ask,
-- because I know that the only thing which goes here is such-and-such".
-- unit test
{-+}
testChop : chop 3 2 (0 :: 1 :: 2 :: 3 :: 4 :: [])
== chopTo (0 :: 1 :: 2 :: []) (3 :: 4 :: [])
testChop = refl
{+-}
-- SUSPICION: unit tests may, in this case, be a little beside the point
-- TERMINOLOGY: we call this method "constructing a view" of vectors. The
-- datatype Choppable explains how we would like to be able to look at
-- vectors. The chop function *proves* that we always can. We get for free
-- that we can look at vectors as being made by [] and _::_, but now we
-- can PROGRAM new ways of looking: vectors as made by _+V_.
-- Welcome to the new programming.
|
programs/oeis/017/A017083.asm | neoneye/loda | 22 | 24354 | <reponame>neoneye/loda<gh_stars>10-100
; A017083: a(n) = (8*n + 1)^7.
; 1,4782969,410338673,6103515625,42618442977,194754273881,678223072849,1954897493193,4902227890625,11047398519097,22876792454961,44231334895529,80798284478113,140710042265625,235260548044817,379749833583241,594467302491009,905824306333433,1347646586640625,1962637152460137,2804020163098721,3937376385699289,5442680797299153,7416552901015625,9974730326005057,13254776280841401,17419031429960369,22657820762815273,29192926025390625,37281334283719577,47219273189051281,59346543514314249,74051159531521793,91774307799765625,113015634933443697,138338874920368361,168377826559400929,203842691587258713,245526784064140625,294313621587817417,351184408905832641,417225924495460409,493638820681066033,581746347858515625,683003513396280737,799006685782884121,931503654590332689,1082404156823183753,1253790880222890625,1447930954097073657,1667287938243362801,1914534320537457769,2192564533755051873,2504508502197265625,2853745728689236177,3243919932521508681,3678954248903875649,4163067000501310393,4700788051621640625,5296975755624608297,5956834506121961761,6685932902538226329,7490222540601799313,8376057438336015625,9350214108119830017,10419912285387762041,11592836324538749809,12877157272623558633,14281555631380390625,15815244818188341337,17487995336508349521,19310159666381286089,21292697885552828353,23447204031794765625,25785933216992382257,28321829503567564201,31068554553807275169,34040517062667048473,37252902984619140625,40721706565114992777,44463762187231646081,48496777044071757049,52839364647486858993,57511079183693515625,62532450726352012897,67925021317677235161,73711381928151371729,79915210305408099913,86561309722857890625,93675648638624082617,101285401275359371441,109418989131512359209,118106123434613811233,127377848547152265625,137266586335608641937,147806181513219494921,159031947967038559489,170980716079866232953,183690881057616640625,197202452272691930857
mul $0,8
add $0,1
pow $0,7
|
programs/oeis/278/A278620.asm | neoneye/loda | 22 | 20753 | <gh_stars>10-100
; A278620: Expansion of x/(1 - 99*x + 99*x^2 - x^3).
; 0,1,99,9702,950698,93158703,9128602197,894509856604,87652837344996,8589083549953005,841642535058049495,82472379352138897506,8081451533974553906094,791899777950154143899707,77598096787581131548265193,7603821585405000737586089208,745096917272902491151888477192,73011894071159039132147484675609,7154420522056312932459301609732491,701060199267447508341879410269108510
seq $0,138288 ; a(n) = A054320(n) - A001078(n).
pow $0,2
div $0,80
|
oeis/167/A167550.asm | neoneye/loda-programs | 11 | 89778 | ; A167550: The a(n,n+1) diagonal of the ED1 array A167546
; Submitted by <NAME>(s2)
; 1,7,62,762,12264,245640,5897520,165145680,5284782720,190253266560,7610141548800,334846347897600,16072626136089600,835776577757721600,46803488615967283200,2808209320881060096000,179725396599156215808000
mov $1,2
pow $1,$0
pow $1,2
mul $1,2
sub $1,1
mul $1,32
lpb $0
mul $1,$0
sub $0,1
lpe
div $1,32
mov $0,$1
|
alloy4fun_models/trashltl/models/7/tCzrXqKeRbXFWvdq6.als | Kaixi26/org.alloytools.alloy | 0 | 1576 | open main
pred idtCzrXqKeRbXFWvdq6_prop8 {
eventually (File.link in Trash)
}
pred __repair { idtCzrXqKeRbXFWvdq6_prop8 }
check __repair { idtCzrXqKeRbXFWvdq6_prop8 <=> prop8o } |
sdk/clients/ada/src/model/-models.ads | databuzzword/ai-api-marketplace | 0 | 18266 | <reponame>databuzzword/ai-api-marketplace
-- FastAPI
-- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
--
-- The version of the OpenAPI document: 0.1.0
--
--
-- NOTE: This package is auto generated by OpenAPI-Generator 4.0.0.
-- https://openapi-generator.tech
-- Do not edit the class manually.
with Swagger.Streams;
with Ada.Containers.Vectors;
package .Models is
-- ------------------------------
-- ValidationError
-- ------------------------------
type ValidationErrorType is
record
Loc : Swagger.UString_Vectors.Vector;
Msg : Swagger.UString;
P_Type : Swagger.UString;
end record;
package ValidationErrorType_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => ValidationErrorType);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in ValidationErrorType);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in ValidationErrorType_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out ValidationErrorType);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out ValidationErrorType_Vectors.Vector);
-- ------------------------------
-- HTTPValidationError
-- ------------------------------
type HTTPValidationErrorType is
record
Detail : .Models.ValidationErrorType_Vectors.Vector;
end record;
package HTTPValidationErrorType_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => HTTPValidationErrorType);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in HTTPValidationErrorType);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in HTTPValidationErrorType_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out HTTPValidationErrorType);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out HTTPValidationErrorType_Vectors.Vector);
end .Models;
|
src/risi_script-types-identifier.ads | OneWingedShark/Risi | 1 | 29674 | Pragma Ada_2012;
Pragma Wide_Character_Encoding( UTF8 );
with
Ada.Characters.Handling;
-- Ada.Containers.Indefinite_Vectors;
Package Risi_Script.Types.Identifier is
SubType Identifier is String
with Dynamic_Predicate => Is_Valid( Identifier )
or else raise Parse_Error with "Invalid identifier: """ & Identifier & '"';
Private
Function Is_Valid( Input: String ) return Boolean is
( Input'Length in Positive and then
Ada.Characters.Handling.Is_Letter(Input(Input'First)) and then
Ada.Characters.Handling.Is_Alphanumeric(Input(Input'Last)) and then
(for all Ch of Input => Ch = '_' or Ada.Characters.Handling.Is_Alphanumeric(Ch)) and then
(for all Index in Input'First..Positive'Pred(Input'Last) =>
(if Input(Index) = '_' then Input(Index+1) /= '_')
)
);
-- Type Scope is new Scope_Vector.Vector with null record;
End Risi_Script.Types.Identifier;
|
build/gnat/rts/common/adainclude/last_chance_handler.adb | Lucretia/bare_bones | 70 | 405 | -- -*- Mode: Ada -*-
-- Filename : last_chance_handler.adb
-- Description : Implementation of the exception handler for the kernel.
-- Author : <NAME>
-- Created On : Thu Jun 14 12:06:48 2012
-- Licence : See LICENCE in the root directory.
-- with Console; use Console;
procedure Last_Chance_Handler
(Source_Location : System.Address; Line : Integer) is
procedure Crash (Source_Location : System.Address; Line : Integer) with
Import => True,
Convention => Ada;
begin
-- TODO: Add in code to dump the info to serial/screen which
-- is obviously board specific.
-- Put ("Exception raised",
-- Screen_Width_Range'First,
-- Screen_Height_Range'Last);
Crash (Source_Location => Source_Location, Line => Line);
end Last_Chance_Handler;
|
formula/Dice.g4 | theshadow/dice | 0 | 503 | grammar Dice;
D : [dD] ;
SIGN : [\-+] ;
LPAREN : '(' ;
RPAREN : ')' ;
COMMA : ',' ;
SPACE : ' ' ;
WS : [\r\n\t] -> skip ;
Integer : [0-9]+ ;
Id : [a-zA-Z][A-Za-z0-9]+ ;
StringLiteral : '"' ~('\'' | '\\' | '\n' | '\r')+ '"' ;
formula : count? sides modifier? extensions ;
extensions : (SPACE funccall)* ;
count : Integer ;
sides : Id ;
modifier : SIGN Integer ;
parameter : Integer | StringLiteral ;
parameters : (parameter COMMA)* parameter ;
funcname : Id ;
funccall : funcname '(' parameters? ')' ; |
src/decls-dgenerals.ads | alvaromb/Compilemon | 1 | 2866 | <reponame>alvaromb/Compilemon
-- DECLS-DGENERALS.ads
-- Paquet de declaracions generals
package Decls.Dgenerals is
Max_Id : constant Integer := 1000;
Long_Num_Ident : constant Integer := 40;
Max_Var : constant Integer := 1000;
type Num_Var is new Natural
range 0 .. Max_Var;
Var_Nul : Num_Var := 0;
Max_Proc : constant Integer := 100;
type Num_Proc is new Natural
range 0 .. Max_Proc;
Proc_Nul : Num_Proc := 0;
Max_Etiquetes : constant Integer := 4000;
type Num_Etiq is new Integer
range 0 .. Max_Etiquetes;
Etiq_Nul : Num_Etiq := 0;
type Tipus_Etiq is
(Etiq_Num,
Etiq_Proc);
type valor is new Integer
range Integer'First..Integer'Last;
type tipus_atribut is
(Atom,
A_Ident,
A_Lit_C,
A_Lit_N,
A_Lit_S,
NodeArbre);
Esem : Boolean := False;
end Decls.Dgenerals;
|
programs/oeis/296/A296911.asm | karttu/loda | 1 | 170147 | <filename>programs/oeis/296/A296911.asm
; A296911: Partial sums of A296910.
; 1,5,11,25,39,61,83,113,143,181,219,265,311,365,419,481,543,613,683,761,839,925,1011,1105,1199,1301,1403,1513,1623,1741,1859,1985,2111,2245,2379,2521,2663,2813,2963,3121,3279,3445,3611,3785,3959,4141,4323,4513,4703,4901,5099,5305,5511,5725,5939,6161,6383,6613,6843,7081,7319,7565,7811,8065,8319,8581,8843,9113,9383,9661,9939,10225,10511,10805,11099,11401,11703,12013,12323,12641,12959,13285,13611,13945,14279,14621,14963,15313,15663,16021,16379,16745,17111,17485,17859,18241,18623,19013,19403,19801,20199,20605,21011,21425,21839,22261,22683,23113,23543,23981,24419,24865,25311,25765,26219,26681,27143,27613,28083,28561,29039,29525,30011,30505,30999,31501,32003,32513,33023,33541,34059,34585,35111,35645,36179,36721,37263,37813,38363,38921,39479,40045,40611,41185,41759,42341,42923,43513,44103,44701,45299,45905,46511,47125,47739,48361,48983,49613,50243,50881,51519,52165,52811,53465,54119,54781,55443,56113,56783,57461,58139,58825,59511,60205,60899,61601,62303,63013,63723,64441,65159,65885,66611,67345,68079,68821,69563,70313,71063,71821,72579,73345,74111,74885,75659,76441,77223,78013,78803,79601,80399,81205,82011,82825,83639,84461,85283,86113,86943,87781,88619,89465,90311,91165,92019,92881,93743,94613,95483,96361,97239,98125,99011,99905,100799,101701,102603,103513,104423,105341,106259,107185,108111,109045,109979,110921,111863,112813,113763,114721,115679,116645,117611,118585,119559,120541,121523,122513,123503,124501
mov $1,$0
sub $1,35
gcd $1,2
mov $2,$0
add $2,1
mul $2,$0
trn $2,1
add $2,2
add $1,$2
sub $1,3
mul $1,2
add $1,1
|
test/succeed/Issue700.agda | np/agda-git-experiment | 1 | 2299 | <reponame>np/agda-git-experiment
-- 2012-09-25 Andreas, reported by <NAME>
{-# OPTIONS --sized-types #-}
module Issue700 where
import Common.Level
open import Common.Size
postulate
Size< : Size → Set
{-# BUILTIN SIZELT Size< #-}
postulate
A : Set
data T (i : Size) : Set where
c : (j : Size< i) → T j → T _
bug : ∀ i → T i → A
bug i (c j x) = bug j x
{- WAS: de Bruijn index out of scope
Issue700.bug is projection like in argument 1 for type Issue700.T
Translated clause:
delta = (j : Size< @0) (x : T j)
perm = x0,x1 -> x0,x1
ps = [r(ConP Issue700.T.c Nothing [r(VarP "j"),r(VarP "x")])]
body = Bind (Abs "h1" Bind (Abs "h2" Body (Def Issue700.bug [r(Var 1 []),r(Var 0 [])])))
body = [h1 h2] bug h1 h2
-}
|
oeis/001/A001405.asm | neoneye/loda-programs | 11 | 8916 | ; A001405: a(n) = binomial(n, floor(n/2)).
; 1,1,2,3,6,10,20,35,70,126,252,462,924,1716,3432,6435,12870,24310,48620,92378,184756,352716,705432,1352078,2704156,5200300,10400600,20058300,40116600,77558760,155117520,300540195,601080390,1166803110,2333606220,4537567650,9075135300,17672631900,35345263800,68923264410,137846528820,269128937220,538257874440,1052049481860,2104098963720,4116715363800,8233430727600,16123801841550,32247603683100,63205303218876,126410606437752,247959266474052,495918532948104,973469712824056,1946939425648112
mov $1,$0
div $1,2
bin $0,$1
|
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0xca_notsx.log_21829_513.asm | ljhsiun2/medusa | 9 | 241309 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r15
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x189c4, %rcx
nop
inc %r11
mov $0x6162636465666768, %r8
movq %r8, %xmm2
vmovups %ymm2, (%rcx)
nop
nop
nop
nop
nop
and $16883, %rcx
lea addresses_UC_ht+0xd184, %rdi
nop
nop
nop
add $24996, %rax
mov $0x6162636465666768, %r15
movq %r15, %xmm0
vmovups %ymm0, (%rdi)
nop
nop
inc %r8
lea addresses_D_ht+0x624, %rcx
nop
nop
xor %r10, %r10
mov (%rcx), %r11w
nop
cmp $7576, %r10
lea addresses_UC_ht+0x19848, %rsi
lea addresses_WC_ht+0xc244, %rdi
nop
nop
and $43264, %r8
mov $25, %rcx
rep movsq
dec %r15
lea addresses_normal_ht+0xf244, %rsi
lea addresses_UC_ht+0x4c4, %rdi
clflush (%rdi)
nop
nop
and $49027, %r15
mov $17, %rcx
rep movsl
nop
nop
xor %rdi, %rdi
lea addresses_normal_ht+0x10e44, %r11
nop
nop
cmp $46977, %rsi
mov (%r11), %rax
sub %r11, %r11
lea addresses_UC_ht+0x10000, %r10
nop
nop
and %r15, %r15
movl $0x61626364, (%r10)
nop
nop
add $15985, %r15
lea addresses_D_ht+0xa96c, %rax
nop
nop
nop
nop
nop
cmp %r8, %r8
movw $0x6162, (%rax)
nop
and %r8, %r8
lea addresses_UC_ht+0x12484, %rsi
inc %rcx
mov $0x6162636465666768, %r15
movq %r15, %xmm0
movups %xmm0, (%rsi)
nop
nop
nop
nop
nop
sub $64953, %rsi
lea addresses_WC_ht+0x5844, %r10
nop
and $51304, %r8
mov (%r10), %rax
add %rax, %rax
lea addresses_A_ht+0x1b884, %r8
clflush (%r8)
nop
nop
sub %rsi, %rsi
mov (%r8), %r10d
nop
and $1666, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r15
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r8
push %r9
push %rax
push %rbp
push %rdi
push %rdx
// Store
lea addresses_normal+0x1c33c, %rbp
xor $53397, %r11
movb $0x51, (%rbp)
sub $13734, %rdx
// Load
lea addresses_A+0x3944, %r11
nop
nop
nop
nop
dec %rbp
mov (%r11), %ax
nop
and %rax, %rax
// Store
lea addresses_WC+0x75c4, %r9
nop
nop
nop
nop
xor %r8, %r8
movb $0x51, (%r9)
cmp $2141, %r8
// Store
lea addresses_D+0x77d4, %r11
nop
nop
nop
sub %rdi, %rdi
mov $0x5152535455565758, %r9
movq %r9, (%r11)
// Exception!!!
mov (0), %r9
nop
nop
nop
nop
cmp %r9, %r9
// Faulty Load
mov $0x682e30000000844, %rdx
nop
nop
and $51081, %rdi
vmovups (%rdx), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %r11
lea oracles, %r9
and $0xff, %r11
shlq $12, %r11
mov (%r9,%r11,1), %r11
pop %rdx
pop %rdi
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 6, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 9, 'same': True, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
Snippets/Get Name Of Active Application.applescript | rogues-gallery/applescript | 360 | 1939 | # this script will return the name of the active (frontmost) application
tell application "System Events"
get name of application processes whose frontmost is true
end tell |
src/ado-queries.ads | My-Colaborations/ada-ado | 0 | 24937 | -----------------------------------------------------------------------
-- ado-queries -- Database Queries
-- Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2017, 2018, 2019 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Strings;
with Util.Refs;
with ADO.SQL;
private with Interfaces;
private with ADO.Configs;
with Ada.Strings.Unbounded;
with Ada.Finalization;
-- == Named Queries ==
-- Ada Database Objects provides a small framework which helps in
-- using complex SQL queries in an application by using named queries.
-- The benefit of the framework are the following:
--
-- * The SQL query result are directly mapped in Ada records,
-- * It is easy to change or tune an SQL query without re-building the application,
-- * The SQL query can be easily tuned for a given database.
--
-- The database query framework uses an XML query file:
--
-- * The XML query file defines a mapping that represents the result of SQL queries,
-- * The XML mapping is used by Dynamo code generator to generate an Ada record,
-- * The XML query file also defines a set of SQL queries, each query being
-- identified by a unique name,
-- * The XML query file is read by the application to obtain the SQL query
-- associated with a query name,
-- * The application uses the `List` procedure generated by Dynamo.
--
-- === XML Query File ===
-- The XML query file uses the `query-mapping` root element. It should
-- define at most one `class` mapping and several `query` definitions.
-- The `class` definition should come first before any `query` definition.
--
-- <query-mapping>
-- <class>...</class>
-- <query>...</query>
-- </query-mapping>
--
-- === SQL Result Mapping ===
-- The XML query mapping is very close to the database XML table mapping.
-- The difference is that there is no need to specify any table name
-- nor any SQL type. The XML query mapping is used to build an Ada
-- record that correspond to query results. Unlike the database table mapping,
-- the Ada record will not be tagged and its definition will expose all the record
-- members directly.
--
-- The following XML query mapping:
--
-- <query-mapping>
-- <class name='Samples.Model.User_Info'>
-- <property name="name" type="String">
-- <comment>the user name</comment>
-- </property>
-- <property name="email" type="String">
-- <comment>the email address</comment>
-- </property>
-- </class>
-- </query-mapping>
--
-- will generate the following Ada record and it will instantiate the Ada container `Vectors`
-- generic to provide a support for vectors of the record:
--
-- package Samples.Model is
-- type User_Info is record
-- Name : Unbounded_String;
-- Email : Unbounded_String;
-- end record;
-- package User_Info_Vectors is
-- new Ada.Containers.Vectors (Index_Type => Natural,
-- Element_Type => User_Info,
-- "=" => "=");
-- subtype User_Info_Vector is User_Info_Vectors.Vector;
-- end Samples.Model;
--
-- A `List` operation is also generated and can be used to execute an SQL query and have
-- the result mapped in the record.
--
-- The same query mapping can be used by different queries.
--
-- After writing or updating a query mapping, it is necessary to launch the
-- Dynamo code generator to generate the corresponding Ada model.
--
-- === SQL Queries ===
-- The XML query file defines a list of SQL queries that the application
-- can use. Each query is associated with a unique name. The application
-- will use that name to identify the SQL query to execute. For each query,
-- the file also describes the SQL query pattern that must be used for
-- the query execution.
--
-- <query-mapping>
-- <query name='user-list' class='Samples.Model.User_Info'>
-- <sql driver='mysql'>
-- SELECT u.name, u.email FROM user AS u
-- </sql>
-- <sql driver='sqlite'>
-- ...
-- </sql>
-- <sql-count driver='mysql'>
-- SELECT COUNT(*) FROM user AS u
-- </sql-count>
-- </query>
-- </query-mapping>
--
-- The query contains basically two SQL patterns. The `sql` element represents
-- the main SQL pattern. This is the SQL that is used by the `List` operation.
-- In some cases, the result set returned by the query is limited to return only
-- a maximum number of rows. This is often use in paginated lists.
--
-- The `sql-count` element represents an SQL query to indicate the total number
-- of elements if the SQL query was not limited.
--
-- The `sql` and `sql-count` XML element can have an optional `driver` attribute.
-- When defined, the attribute indicates the database driver name that is specific
-- to the query. When empty or not defined, the SQL is not specific to a database driver.
--
-- For each query, the Dynamo code generator generates a query definition instance which
-- can be used in the Ada code to be able to use the query. Such instance is static and
-- readonly and serves as a reference when using the query. For the above query,
-- the Dynamo code generator generates:
--
-- package Samples.User.Model is
-- Query_User_List : constant ADO.Queries.Query_Definition_Access;
-- private
-- ...
-- end Samples.User.Model;
--
-- When a new query is added, the Dynamo code generator must be launched to update
-- the generated Ada code.
--
-- === Using Named Queries ===
-- In order to use a named query, it is necessary to create a query context instance
-- and initialize it. The query context holds the information about the query definition
-- as well as the parameters to execute the query. It provides a `Set_Query` and
-- `Set_Count_Query` operation that allows to configure the named query to be executed.
-- It also provides all the `Bind_Param` and `Add_Param` operations to allow giving the
-- query parameters.
--
-- with ADO.Sessions;
-- with ADO.Queries;
-- ...
-- Session : ADO.Sessions.Session := Factory.Get_Session;
-- Query : ADO.Queries.Context;
-- Users : Samples.User.Model.User_Info_Vector;
-- ...
-- Query.Set_Query (Samples.User.Model.Query_User_List);
-- Samples.User.Model.List (Users, Session, Query);
--
-- To use the `sql-count` part of the query, you will use the `Set_Count_Query`
-- with the same query definition. You will then create a query statement from the
-- named query context and run the query. Since the query is expected to contain exactly
-- one row, you can use the `Get_Result_Integer` to get the first row and column result.
-- For example:
--
-- Query.Set_Count_Query (Samples.User.Model.Query_User_List);
-- ...
-- Stmt : ADO.Statements.Query_Statement
-- := Session.Create_Statement (Query);
-- ...
-- Stmt.Execute;
-- ...
-- Count : Natural := Stmt.Get_Result_Integer;
--
-- You may also use the `ADO.Datasets.Get_Count` operation which simplifies these steps
-- in:
--
-- Query.Set_Count_Query (Samples.User.Model.Query_User_List);
-- ...
-- Count : Natural := ADO.Datasets.Get_Count (Session, Query);
--
package ADO.Queries is
-- Exception raised when a query does not exist or is empty.
Query_Error : exception;
type Query_Index is new Natural;
type File_Index is new Natural;
type Query_File is limited private;
type Query_File_Access is access all Query_File;
type Query_Definition is limited private;
type Query_Definition_Access is access all Query_Definition;
type Query_Manager is limited new Ada.Finalization.Limited_Controlled with private;
type Query_Manager_Access is access all Query_Manager;
-- ------------------------------
-- Query Context
-- ------------------------------
-- The <b>Context</b> type holds the necessary information to build and execute
-- a query whose SQL pattern is defined in an XML query file.
type Context is new ADO.SQL.Query with private;
-- Set the query definition which identifies the SQL query to execute.
-- The query is represented by the <tt>sql</tt> XML entry.
procedure Set_Query (Into : in out Context;
Query : in Query_Definition_Access);
-- Set the query count definition which identifies the SQL query to execute.
-- The query count is represented by the <tt>sql-count</tt> XML entry.
procedure Set_Count_Query (Into : in out Context;
Query : in Query_Definition_Access);
-- Set the query to execute as SQL statement.
procedure Set_SQL (Into : in out Context;
SQL : in String);
procedure Set_Query (Into : in out Context;
Name : in String);
-- Set the limit for the SQL query.
procedure Set_Limit (Into : in out Context;
First : in Natural;
Last : in Natural);
-- Get the first row index.
function Get_First_Row_Index (From : in Context) return Natural;
-- Get the last row index.
function Get_Last_Row_Index (From : in Context) return Natural;
-- Get the maximum number of rows that the SQL query can return.
-- This operation uses the <b>sql-count</b> query.
function Get_Max_Row_Count (From : in Context) return Natural;
-- Get the SQL query that correspond to the query context.
function Get_SQL (From : in Context;
Manager : in Query_Manager'Class) return String;
function Get_SQL (From : in Query_Definition_Access;
Manager : in Query_Manager;
Use_Count : in Boolean) return String;
private
subtype Driver_Index is ADO.Configs.Driver_Index;
-- ------------------------------
-- Query Definition
-- ------------------------------
-- The <b>Query_Definition</b> holds the SQL query pattern which is defined
-- in an XML query file. The query is identified by a name and a given XML
-- query file can contain several queries. The Dynamo generator generates
-- one instance of <b>Query_Definition</b> for each query defined in the XML
-- file. The XML file is loaded during application initialization (or later)
-- to get the SQL query pattern. Multi-thread concurrency is achieved by
-- the Query_Info_Ref atomic reference.
type Query_Definition is limited record
-- The query name.
Name : Util.Strings.Name_Access;
-- The query file in which the query is defined.
File : Query_File_Access;
-- The next query defined in the query file.
Next : Query_Definition_Access;
-- The SQL query pattern (initialized when reading the XML query file).
-- Query : Query_Info_Ref_Access;
Query : Query_Index := 0;
end record;
-- ------------------------------
-- Query File
-- ------------------------------
-- The <b>Query_File</b> describes the SQL queries associated and loaded from
-- a given XML query file. The Dynamo generator generates one instance of
-- <b>Query_File</b> for each XML query file that it has read. The Path,
-- Sha1_Map, Queries and Next are initialized statically by the generator (during
-- package elaboration).
type Query_File is limited record
-- Query relative path name
Name : Util.Strings.Name_Access;
-- The SHA1 hash of the query map section.
Sha1_Map : Util.Strings.Name_Access;
-- The first query defined for that file.
Queries : Query_Definition_Access;
-- The next XML query file registered in the application.
Next : Query_File_Access;
-- The unique file index.
File : File_Index := 0;
end record;
type Context is new ADO.SQL.Query with record
First : Natural := 0;
Last : Natural := 0;
Last_Index : Natural := 0;
Max_Row_Count : Natural := 0;
Query_Def : Query_Definition_Access := null;
Is_Count : Boolean := False;
end record;
use Ada.Strings.Unbounded;
-- SQL query pattern
type Query_Pattern is limited record
SQL : Ada.Strings.Unbounded.Unbounded_String;
end record;
type Query_Pattern_Array is array (Driver_Index) of Query_Pattern;
type Query_Info is new Util.Refs.Ref_Entity with record
Main_Query : Query_Pattern_Array;
Count_Query : Query_Pattern_Array;
end record;
type Query_Info_Access is access all Query_Info;
package Query_Info_Ref is new Util.Refs.References (Query_Info, Query_Info_Access);
package Atomic_Query_Info_Ref is new Query_Info_Ref.IR.Atomic;
type Query_Info_Ref_Access is access all Atomic_Query_Info_Ref.Atomic_Ref;
subtype Query_Index_Table is Query_Index range 1 .. Query_Index'Last;
subtype File_Index_Table is File_Index range 1 .. File_Index'Last;
type Query_File_Info is record
-- Query absolute path name (after path resolution).
Path : Ada.Strings.Unbounded.Unbounded_String;
-- File
File : Query_File_Access;
-- Stamp when the query file will be checked.
Next_Check : Interfaces.Unsigned_32;
-- Stamp identifying the modification date of the query file.
Last_Modified : Interfaces.Unsigned_32;
end record;
-- Find the query with the given name.
-- Returns the query definition that matches the name or null if there is none
function Find_Query (File : in Query_File_Info;
Name : in String) return Query_Definition_Access;
type Query_Table is array (Query_Index_Table range <>) of Query_Info_Ref.Ref;
type Query_Table_Access is access all Query_Table;
type File_Table is array (File_Index_Table range <>) of Query_File_Info;
type File_Table_Access is access all File_Table;
type Query_Manager is limited new Ada.Finalization.Limited_Controlled with record
Driver : Driver_Index := Driver_Index'First;
Queries : Query_Table_Access;
Files : File_Table_Access;
end record;
overriding
procedure Finalize (Manager : in out Query_Manager);
end ADO.Queries;
|
src/kernel/io.asm | JohanLi233/JAHA-OS | 2 | 9359 | <reponame>JohanLi233/JAHA-OS
[bits 32]
section .text
global inb
inb:
push ebp
mov ebp, esp ;保存帧
xor eax, eax
mov edx, [ebp + 8] ;port
in al, dx ;将端口号dx的8bit输入到ax
jmp $+2
jmp $+2
leave
ret
global outb
outb:
push ebp
mov ebp, esp ;保存帧
mov edx, [ebp + 8] ;port
mov eax, [ebp + 12] ;value
out dx, al ;将al中的8bit输出到端口号dx
jmp $+2
jmp $+2
leave
ret
global inw
inw:
push ebp
mov ebp, esp ;保存帧
xor eax, eax
mov edx, [ebp + 8] ;port
in ax, dx ;将端口号dx的16bit输入到ax
jmp $+2
jmp $+2
leave
ret
global outw
outw:
push ebp
mov ebp, esp ;保存帧
mov edx, [ebp + 8] ;port
mov eax, [ebp + 12] ;value
out dx, ax ;将al中的16bit输出到端口号dx
jmp $+2
jmp $+2
leave
ret
|
awa/plugins/awa-settings/regtests/awa-settings-modules-tests.ads | fuzzysloth/ada-awa | 81 | 27339 | -----------------------------------------------------------------------
-- awa-settings-modules-tests -- Unit tests for settings module
-- Copyright (C) 2013 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Tests;
with AWA.Tests;
package AWA.Settings.Modules.Tests is
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite);
type Test is new AWA.Tests.Test with null record;
-- Test getting a user setting.
procedure Test_Get_User_Setting (T : in out Test);
-- Test saving a user setting.
procedure Test_Set_User_Setting (T : in out Test);
-- Test performance on user setting.
procedure Test_Perf_User_Setting (T : in out Test);
end AWA.Settings.Modules.Tests;
|
programs/oeis/278/A278816.asm | karttu/loda | 1 | 11573 | <filename>programs/oeis/278/A278816.asm
; A278816: Numbers that can be produced from their own digits by applying one or more of the eight operations {+, -, *, /, sqrt(), ^, !, concat11()}, with no operation used more than once, where "concat11()" means the operation of concatenating two single digits.
; 0,1,2,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84
mov $1,2
bin $1,$0
cmp $1,0
mul $1,7
add $1,$0
|
arch/ARM/STM32/svd/stm32l4x3/stm32_svd-dac.ads | morbos/Ada_Drivers_Library | 2 | 1855 | -- This spec has been automatically generated from STM32L4x3.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.DAC is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype CR_TSEL1_Field is HAL.UInt3;
subtype CR_WAVE1_Field is HAL.UInt2;
subtype CR_MAMP1_Field is HAL.UInt4;
subtype CR_TSEL2_Field is HAL.UInt3;
subtype CR_WAVE2_Field is HAL.UInt2;
subtype CR_MAMP2_Field is HAL.UInt4;
-- control register
type CR_Register is record
-- DAC channel1 enable
EN1 : Boolean := False;
-- unspecified
Reserved_1_1 : HAL.Bit := 16#0#;
-- DAC channel1 trigger enable
TEN1 : Boolean := False;
-- DAC channel1 trigger selection
TSEL1 : CR_TSEL1_Field := 16#0#;
-- DAC channel1 noise/triangle wave generation enable
WAVE1 : CR_WAVE1_Field := 16#0#;
-- DAC channel1 mask/amplitude selector
MAMP1 : CR_MAMP1_Field := 16#0#;
-- DAC channel1 DMA enable
DMAEN1 : Boolean := False;
-- DAC channel1 DMA Underrun Interrupt enable
DMAUDRIE1 : Boolean := False;
-- DAC Channel 1 calibration enable
CEN1 : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- DAC channel2 enable
EN2 : Boolean := False;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- DAC channel2 trigger enable
TEN2 : Boolean := False;
-- DAC channel2 trigger selection
TSEL2 : CR_TSEL2_Field := 16#0#;
-- DAC channel2 noise/triangle wave generation enable
WAVE2 : CR_WAVE2_Field := 16#0#;
-- DAC channel2 mask/amplitude selector
MAMP2 : CR_MAMP2_Field := 16#0#;
-- DAC channel2 DMA enable
DMAEN2 : Boolean := False;
-- DAC channel2 DMA underrun interrupt enable
DMAUDRIE2 : Boolean := False;
-- DAC Channel 2 calibration enable
CEN2 : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
EN1 at 0 range 0 .. 0;
Reserved_1_1 at 0 range 1 .. 1;
TEN1 at 0 range 2 .. 2;
TSEL1 at 0 range 3 .. 5;
WAVE1 at 0 range 6 .. 7;
MAMP1 at 0 range 8 .. 11;
DMAEN1 at 0 range 12 .. 12;
DMAUDRIE1 at 0 range 13 .. 13;
CEN1 at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
EN2 at 0 range 16 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
TEN2 at 0 range 18 .. 18;
TSEL2 at 0 range 19 .. 21;
WAVE2 at 0 range 22 .. 23;
MAMP2 at 0 range 24 .. 27;
DMAEN2 at 0 range 28 .. 28;
DMAUDRIE2 at 0 range 29 .. 29;
CEN2 at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
-- SWTRIGR_SWTRIG array
type SWTRIGR_SWTRIG_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for SWTRIGR_SWTRIG
type SWTRIGR_SWTRIG_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SWTRIG as a value
Val : HAL.UInt2;
when True =>
-- SWTRIG as an array
Arr : SWTRIGR_SWTRIG_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for SWTRIGR_SWTRIG_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
-- software trigger register
type SWTRIGR_Register is record
-- Write-only. DAC channel1 software trigger
SWTRIG : SWTRIGR_SWTRIG_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_2_31 : HAL.UInt30 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SWTRIGR_Register use record
SWTRIG at 0 range 0 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
subtype DHR12R1_DACC1DHR_Field is HAL.UInt12;
-- channel1 12-bit right-aligned data holding register
type DHR12R1_Register is record
-- DAC channel1 12-bit right-aligned data
DACC1DHR : DHR12R1_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12R1_Register use record
DACC1DHR at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
subtype DHR12L1_DACC1DHR_Field is HAL.UInt12;
-- channel1 12-bit left-aligned data holding register
type DHR12L1_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4 := 16#0#;
-- DAC channel1 12-bit left-aligned data
DACC1DHR : DHR12L1_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12L1_Register use record
Reserved_0_3 at 0 range 0 .. 3;
DACC1DHR at 0 range 4 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DHR8R1_DACC1DHR_Field is HAL.UInt8;
-- channel1 8-bit right-aligned data holding register
type DHR8R1_Register is record
-- DAC channel1 8-bit right-aligned data
DACC1DHR : DHR8R1_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DHR8R1_Register use record
DACC1DHR at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype DHR12R2_DACC2DHR_Field is HAL.UInt12;
-- channel2 12-bit right aligned data holding register
type DHR12R2_Register is record
-- DAC channel2 12-bit right-aligned data
DACC2DHR : DHR12R2_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12R2_Register use record
DACC2DHR at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
subtype DHR12L2_DACC2DHR_Field is HAL.UInt12;
-- channel2 12-bit left aligned data holding register
type DHR12L2_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4 := 16#0#;
-- DAC channel2 12-bit left-aligned data
DACC2DHR : DHR12L2_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12L2_Register use record
Reserved_0_3 at 0 range 0 .. 3;
DACC2DHR at 0 range 4 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DHR8R2_DACC2DHR_Field is HAL.UInt8;
-- channel2 8-bit right-aligned data holding register
type DHR8R2_Register is record
-- DAC channel2 8-bit right-aligned data
DACC2DHR : DHR8R2_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DHR8R2_Register use record
DACC2DHR at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype DHR12RD_DACC1DHR_Field is HAL.UInt12;
subtype DHR12RD_DACC2DHR_Field is HAL.UInt12;
-- Dual DAC 12-bit right-aligned data holding register
type DHR12RD_Register is record
-- DAC channel1 12-bit right-aligned data
DACC1DHR : DHR12RD_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
-- DAC channel2 12-bit right-aligned data
DACC2DHR : DHR12RD_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12RD_Register use record
DACC1DHR at 0 range 0 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
DACC2DHR at 0 range 16 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
subtype DHR12LD_DACC1DHR_Field is HAL.UInt12;
subtype DHR12LD_DACC2DHR_Field is HAL.UInt12;
-- DUAL DAC 12-bit left aligned data holding register
type DHR12LD_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4 := 16#0#;
-- DAC channel1 12-bit left-aligned data
DACC1DHR : DHR12LD_DACC1DHR_Field := 16#0#;
-- unspecified
Reserved_16_19 : HAL.UInt4 := 16#0#;
-- DAC channel2 12-bit left-aligned data
DACC2DHR : DHR12LD_DACC2DHR_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DHR12LD_Register use record
Reserved_0_3 at 0 range 0 .. 3;
DACC1DHR at 0 range 4 .. 15;
Reserved_16_19 at 0 range 16 .. 19;
DACC2DHR at 0 range 20 .. 31;
end record;
subtype DHR8RD_DACC1DHR_Field is HAL.UInt8;
subtype DHR8RD_DACC2DHR_Field is HAL.UInt8;
-- DUAL DAC 8-bit right aligned data holding register
type DHR8RD_Register is record
-- DAC channel1 8-bit right-aligned data
DACC1DHR : DHR8RD_DACC1DHR_Field := 16#0#;
-- DAC channel2 8-bit right-aligned data
DACC2DHR : DHR8RD_DACC2DHR_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DHR8RD_Register use record
DACC1DHR at 0 range 0 .. 7;
DACC2DHR at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DOR1_DACC1DOR_Field is HAL.UInt12;
-- channel1 data output register
type DOR1_Register is record
-- Read-only. DAC channel1 data output
DACC1DOR : DOR1_DACC1DOR_Field;
-- unspecified
Reserved_12_31 : HAL.UInt20;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DOR1_Register use record
DACC1DOR at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
subtype DOR2_DACC2DOR_Field is HAL.UInt12;
-- channel2 data output register
type DOR2_Register is record
-- Read-only. DAC channel2 data output
DACC2DOR : DOR2_DACC2DOR_Field;
-- unspecified
Reserved_12_31 : HAL.UInt20;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DOR2_Register use record
DACC2DOR at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
-- status register
type SR_Register is record
-- unspecified
Reserved_0_12 : HAL.UInt13 := 16#0#;
-- DAC channel1 DMA underrun flag
DMAUDR1 : Boolean := False;
-- Read-only. DAC Channel 1 calibration offset status
CAL_FLAG1 : Boolean := False;
-- Read-only. DAC Channel 1 busy writing sample time flag
BWST1 : Boolean := False;
-- unspecified
Reserved_16_28 : HAL.UInt13 := 16#0#;
-- DAC channel2 DMA underrun flag
DMAUDR2 : Boolean := False;
-- Read-only. DAC Channel 2 calibration offset status
CAL_FLAG2 : Boolean := False;
-- Read-only. DAC Channel 2 busy writing sample time flag
BWST2 : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register use record
Reserved_0_12 at 0 range 0 .. 12;
DMAUDR1 at 0 range 13 .. 13;
CAL_FLAG1 at 0 range 14 .. 14;
BWST1 at 0 range 15 .. 15;
Reserved_16_28 at 0 range 16 .. 28;
DMAUDR2 at 0 range 29 .. 29;
CAL_FLAG2 at 0 range 30 .. 30;
BWST2 at 0 range 31 .. 31;
end record;
subtype CCR_OTRIM1_Field is HAL.UInt5;
subtype CCR_OTRIM2_Field is HAL.UInt5;
-- calibration control register
type CCR_Register is record
-- DAC Channel 1 offset trimming value
OTRIM1 : CCR_OTRIM1_Field := 16#0#;
-- unspecified
Reserved_5_15 : HAL.UInt11 := 16#0#;
-- DAC Channel 2 offset trimming value
OTRIM2 : CCR_OTRIM2_Field := 16#0#;
-- unspecified
Reserved_21_31 : HAL.UInt11 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CCR_Register use record
OTRIM1 at 0 range 0 .. 4;
Reserved_5_15 at 0 range 5 .. 15;
OTRIM2 at 0 range 16 .. 20;
Reserved_21_31 at 0 range 21 .. 31;
end record;
subtype MCR_MODE1_Field is HAL.UInt3;
subtype MCR_MODE2_Field is HAL.UInt3;
-- mode control register
type MCR_Register is record
-- DAC Channel 1 mode
MODE1 : MCR_MODE1_Field := 16#0#;
-- unspecified
Reserved_3_15 : HAL.UInt13 := 16#0#;
-- DAC Channel 2 mode
MODE2 : MCR_MODE2_Field := 16#0#;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MCR_Register use record
MODE1 at 0 range 0 .. 2;
Reserved_3_15 at 0 range 3 .. 15;
MODE2 at 0 range 16 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
subtype SHSR1_TSAMPLE1_Field is HAL.UInt10;
-- Sample and Hold sample time register 1
type SHSR1_Register is record
-- DAC Channel 1 sample Time
TSAMPLE1 : SHSR1_TSAMPLE1_Field := 16#0#;
-- unspecified
Reserved_10_31 : HAL.UInt22 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SHSR1_Register use record
TSAMPLE1 at 0 range 0 .. 9;
Reserved_10_31 at 0 range 10 .. 31;
end record;
subtype SHSR2_TSAMPLE2_Field is HAL.UInt10;
-- Sample and Hold sample time register 2
type SHSR2_Register is record
-- DAC Channel 2 sample Time
TSAMPLE2 : SHSR2_TSAMPLE2_Field := 16#0#;
-- unspecified
Reserved_10_31 : HAL.UInt22 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SHSR2_Register use record
TSAMPLE2 at 0 range 0 .. 9;
Reserved_10_31 at 0 range 10 .. 31;
end record;
subtype SHHR_THOLD1_Field is HAL.UInt10;
subtype SHHR_THOLD2_Field is HAL.UInt10;
-- Sample and Hold hold time register
type SHHR_Register is record
-- DAC Channel 1 hold Time
THOLD1 : SHHR_THOLD1_Field := 16#1#;
-- unspecified
Reserved_10_15 : HAL.UInt6 := 16#0#;
-- DAC Channel 2 hold time
THOLD2 : SHHR_THOLD2_Field := 16#1#;
-- unspecified
Reserved_26_31 : HAL.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SHHR_Register use record
THOLD1 at 0 range 0 .. 9;
Reserved_10_15 at 0 range 10 .. 15;
THOLD2 at 0 range 16 .. 25;
Reserved_26_31 at 0 range 26 .. 31;
end record;
subtype SHRR_TREFRESH1_Field is HAL.UInt8;
subtype SHRR_TREFRESH2_Field is HAL.UInt8;
-- Sample and Hold refresh time register
type SHRR_Register is record
-- DAC Channel 1 refresh Time
TREFRESH1 : SHRR_TREFRESH1_Field := 16#1#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- DAC Channel 2 refresh Time
TREFRESH2 : SHRR_TREFRESH2_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SHRR_Register use record
TREFRESH1 at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
TREFRESH2 at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Digital-to-analog converter
type DAC1_Peripheral is record
-- control register
CR : aliased CR_Register;
-- software trigger register
SWTRIGR : aliased SWTRIGR_Register;
-- channel1 12-bit right-aligned data holding register
DHR12R1 : aliased DHR12R1_Register;
-- channel1 12-bit left-aligned data holding register
DHR12L1 : aliased DHR12L1_Register;
-- channel1 8-bit right-aligned data holding register
DHR8R1 : aliased DHR8R1_Register;
-- channel2 12-bit right aligned data holding register
DHR12R2 : aliased DHR12R2_Register;
-- channel2 12-bit left aligned data holding register
DHR12L2 : aliased DHR12L2_Register;
-- channel2 8-bit right-aligned data holding register
DHR8R2 : aliased DHR8R2_Register;
-- Dual DAC 12-bit right-aligned data holding register
DHR12RD : aliased DHR12RD_Register;
-- DUAL DAC 12-bit left aligned data holding register
DHR12LD : aliased DHR12LD_Register;
-- DUAL DAC 8-bit right aligned data holding register
DHR8RD : aliased DHR8RD_Register;
-- channel1 data output register
DOR1 : aliased DOR1_Register;
-- channel2 data output register
DOR2 : aliased DOR2_Register;
-- status register
SR : aliased SR_Register;
-- calibration control register
CCR : aliased CCR_Register;
-- mode control register
MCR : aliased MCR_Register;
-- Sample and Hold sample time register 1
SHSR1 : aliased SHSR1_Register;
-- Sample and Hold sample time register 2
SHSR2 : aliased SHSR2_Register;
-- Sample and Hold hold time register
SHHR : aliased SHHR_Register;
-- Sample and Hold refresh time register
SHRR : aliased SHRR_Register;
end record
with Volatile;
for DAC1_Peripheral use record
CR at 16#0# range 0 .. 31;
SWTRIGR at 16#4# range 0 .. 31;
DHR12R1 at 16#8# range 0 .. 31;
DHR12L1 at 16#C# range 0 .. 31;
DHR8R1 at 16#10# range 0 .. 31;
DHR12R2 at 16#14# range 0 .. 31;
DHR12L2 at 16#18# range 0 .. 31;
DHR8R2 at 16#1C# range 0 .. 31;
DHR12RD at 16#20# range 0 .. 31;
DHR12LD at 16#24# range 0 .. 31;
DHR8RD at 16#28# range 0 .. 31;
DOR1 at 16#2C# range 0 .. 31;
DOR2 at 16#30# range 0 .. 31;
SR at 16#34# range 0 .. 31;
CCR at 16#38# range 0 .. 31;
MCR at 16#3C# range 0 .. 31;
SHSR1 at 16#40# range 0 .. 31;
SHSR2 at 16#44# range 0 .. 31;
SHHR at 16#48# range 0 .. 31;
SHRR at 16#4C# range 0 .. 31;
end record;
-- Digital-to-analog converter
DAC1_Periph : aliased DAC1_Peripheral
with Import, Address => DAC1_Base;
end STM32_SVD.DAC;
|
src/Haskell/Prelude.agda | LaudateCorpus1/bft-consensus-agda | 0 | 9180 | <reponame>LaudateCorpus1/bft-consensus-agda<filename>src/Haskell/Prelude.agda
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2020, 2021, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
module Haskell.Prelude where
open import Haskell.Modules.Either public
open import Haskell.Modules.Eq public
open import Haskell.Modules.FunctorApplicativeMonad public
open import Haskell.Modules.ToBool public
------------------------------------------------------------------------------
open import Level
renaming (suc to ℓ+1; zero to ℓ0; _⊔_ to _ℓ⊔_)
open import Data.Bool
hiding (not; _≟_; _<_; _<?_; _≤_; _≤?_)
public
open import Data.List
hiding (map; filter; lookup; tabulate; foldl; fromMaybe; [_])
public
import Data.Nat as DN
import Data.Nat.DivMod as DivMod
import Data.Nat.Properties as DNP
open import Data.Maybe
using (Maybe; just; nothing)
renaming (_>>=_ to _Maybe->>=_)
public
import Data.Product as DP
open import Data.Unit.NonEta
using (Unit; unit)
public
open import Function
using (_∘_; id; typeOf; flip; const; _$_)
public
import Relation.Binary.PropositionalEquality as PE
using (_≡_; refl)
import Relation.Binary.Definitions as BD
import Relation.Binary as RB
------------------------------------------------------------------------------
infixl 1 _&_
_&_ = Function._|>_
-- An approximation of Haskell's backtick notation for making infix operators.
-- In Agda, there must be spaces between f and backticks
flip' : _ -- Avoids warning about definition and syntax declaration being in different scopes.
flip' = flip
syntax flip' f = ` f `
------------------------------------------------------------------------------
-- Guard Syntax --
--
-- Example Usage:
--
-- > f : ℕ → ℕ
-- > f x = grd‖ x ≟ℕ 10 ≔ 12
-- > ‖ otherwise≔ 40 + 2
--
--
-- > g : ℕ ⊎ ℕ → ℕ
-- > g x = case x of λ
-- > { (inj₁ x) → grd‖ x ≤? 10 ≔ 2 * x
-- > ‖ otherwise≔ 42
-- > ; (inj₂ y) → y
-- > }
--
-- To type: ‖ --> \Vert
-- ≔ --> \:=
infix 3 _≔_
data GuardClause {a}{b}(A : Set a) : Set (a ℓ⊔ ℓ+1 b) where
_≔_ : {B : Set b}{{ bb : ToBool B }} → B → A → GuardClause A
infix 3 otherwise≔_
data Guards {a}{b}(A : Set a) : Set (a ℓ⊔ ℓ+1 b) where
otherwise≔_ : A → Guards A
clause : GuardClause{a}{b} A → Guards{a}{b} A → Guards A
infixr 2 _‖_
_‖_ : ∀{a}{b}{A : Set a} → GuardClause{a}{b} A → Guards A → Guards A
_‖_ = clause
infix 1 grd‖_
grd‖_ : ∀{a}{b}{A : Set a} → Guards{a}{b} A → A
grd‖_ (otherwise≔ a) = a
grd‖_ (clause (b ≔ a) g) = if toBool b then a else (grd‖ g)
------------------------------------------------------------------------------
-- List
infixl 9 _!?_
_!?_ : {A : Set} → List A → DN.ℕ → Maybe A
[] !? _ = nothing
(x ∷ _ ) !? 0 = just x
(_ ∷ xs) !? (DN.suc n) = xs !? n
find' : ∀ {A B : Set} → (A → Maybe B) → List A → Maybe B
find' f [] = nothing
find' f (a ∷ xs) = Data.Maybe.maybe′ f (find' f xs) (just a)
foldl' = Data.List.foldl
------------------------------------------------------------------------------
-- Maybe
maybe : ∀ {A B : Set} → B → (A → B) → Maybe A → B
maybe b a→b = Data.Maybe.maybe′ a→b b
------------------------------------------------------------------------------
-- Nat
div = DivMod._/_
data Ordering : Set where
LT EQ GT : Ordering
compare : DN.ℕ → DN.ℕ → Ordering
compare m n
with DNP.<-cmp m n
... | BD.tri< a ¬b ¬c = LT
... | BD.tri≈ ¬a b ¬c = EQ
... | BD.tri> ¬a ¬b c = GT
------------------------------------------------------------------------------
-- Product
fst = DP.proj₁
snd = DP.proj₂
------------------------------------------------------------------------------
-- Monad
foldlM : ∀ {ℓ₁ ℓ₂} {A B : Set ℓ₁} {M : Set ℓ₁ → Set ℓ₂} ⦃ _ : Monad M ⦄
→ (B → A → M B) → B → List A → M B
foldlM _ z [] = pure z
foldlM f z (x ∷ xs) = do
z' ← f z x
foldlM f z' xs
foldrM : ∀ {ℓ₁ ℓ₂} {A B : Set ℓ₁} {M : Set ℓ₁ → Set ℓ₂} ⦃ _ : Monad M ⦄
→ (A → B → M B) → B → List A → M B
foldrM _ b [] = return b
foldrM f b (a ∷ as) = foldrM f b as >>= f a
foldM = foldlM
foldM_ : {A B : Set} {M : Set → Set} ⦃ _ : Monad M ⦄ → (B → A → M B) → B → List A → M Unit
foldM_ f a xs = foldlM f a xs >> pure unit
fromMaybeM : ∀ {ℓ} {A : Set} {m : Set → Set ℓ} ⦃ _ : Monad m ⦄ → m A → m (Maybe A) → m A
fromMaybeM ma mma = do
mma >>= λ where
nothing → ma
(just a) → pure a
-- NOTE: because 'forM_' is defined above, it is necessary to
-- call 'forM' with parenthesis (e.g., recursive call in definition)
-- to disambiguate it for the Agda parser.
forM : ∀ {ℓ} {A B : Set} {M : Set → Set ℓ} ⦃ _ : Monad M ⦄ → List A → (A → M B) → M (List B)
forM [] _ = return []
forM (x ∷ xs) f = do
fx ← f x
fxs ← (forM) xs f
return (fx ∷ fxs)
forM_ : ∀ {ℓ} {A B : Set} {M : Set → Set ℓ} ⦃ _ : Monad M ⦄ → List A → (A → M B) → M Unit
forM_ [] _ = return unit
forM_ (x ∷ xs) f = f x >> forM_ xs f
|
SynergyApp/Scripts/getSongInfo.applescript | wincent/synergy | 12 | 1594 | -- getSongInfo.applescript
-- Synergy
-- Copyright 2002-present <NAME>. All rights reserved.
tell application "iTunes"
try
-- this will fail if iTunes has no current selection
set theTrack to get current track
on error
if player state is playing then
return {"error"}
else
-- could be paused, stopped, fast forwarding, rewinding
return {"not playing"}
end if
end try
-- iTunes has a current selection, extract the info
if the class of current track is not URL track then
return {player state:player state as string, current track:theTrack, name:name of theTrack, album:album of theTrack, artist:artist of theTrack, composer:composer of theTrack, time:time of theTrack, year:year of theTrack as Unicode text, rating:rating of theTrack as text, song repeat:song repeat of the container of theTrack as text, shuffle:shuffle of the container of theTrack as text, player position:player position}
else
-- for URL tracks, name = "current stream title" (usually includes track name and artist; artist = "name of current track" (usually the name of the radio station), player position = 0
return {player state:player state as string, current track:theTrack, name:current stream title, album:"Streaming Internet Radio", artist:name of theTrack, composer:"", time:"", year:"", rating:rating of theTrack as text, song repeat:song repeat of the container of theTrack as text, shuffle:shuffle of the container of theTrack as text, player position:player position}
end if
end tell
|
test/Succeed/Issue790.agda | shlevy/agda | 1,989 | 13803 | module Issue790 where
open import Common.Level renaming (lzero to zero; lsuc to suc)
open import Common.Prelude using (Bool; true; false; zero; suc) renaming (Nat to ℕ)
even? : ℕ -> Bool
even? 0 = true
even? (suc (suc n)) = even? n
even? _ = false
-- Name overlap between Level's suc and Nat's suc should not matter,
-- since only one is a constructor.
|
examples/generic_example.adb | AntonMeep/parse_args | 9 | 17818 | -- generic_example
-- An example of the use of parse_args with generic option types
-- Copyright (c) 2015, <NAME>
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
-- copyright notice and this permission notice appear in all copies.
--
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-- PERFORMANCE OF THIS SOFTWARE.
with Parse_Args;
use Parse_Args;
with Ada.Text_IO;
use Ada.Text_IO;
with Generic_Example_Options;
use Generic_Example_Options;
procedure Generic_Example is
AP : Argument_Parser;
begin
AP.Add_Option(Make_Boolean_Option(False), "help", 'h', Usage => "Display this help text");
AP.Add_Option(Compass_Option.Make_Option, "compass", 'c',
Usage => "A compass point (North (default), South, East or West)");
AP.Add_Option(Even_Option.Make_Option, "even", 'e',
Usage => "An even natural number (default 0)");
AP.Add_Option(Float_Option.Make_Option, "float", 'f',
Usage => "A floating-point number (default 0.0)");
AP.Add_Option(Float_Array_Option.Make_Option, "float-array", 'g',
Usage => "An array of floating-point numbers");
AP.Set_Prologue("A demonstration of the Parse_Args library with generic types.");
AP.Parse_Command_Line;
if AP.Parse_Success and then AP.Boolean_Value("help") then
AP.Usage;
elsif AP.Parse_Success then
Put_Line("Compass point specified: " & Compass'Image(Compass_Option.Value(AP, "compass")));
Put_Line("Even number specified: " & Natural'Image(Even_Option.Value(AP, "even")));
Put_Line("Floating-point number specified: " & Float'Image(Float_Option.Value(AP, "float")));
if Float_Array_Option.Value(AP, "float-array") /= null then
Put_Line("Floating-point number array: ");
for I of Float_Array_Option.Value(AP, "float-array").all loop
Put(Float'Image(I) & ", ");
end loop;
else
Put_Line("No floating-point array specified.");
end if;
else
Put_Line("Error while parsing command-line arguments: " & AP.Parse_Message);
end if;
end Generic_Example;
|
libsrc/_DEVELOPMENT/math/float/am9511/c/sdcc/cam32_sdcc_acosh.asm | dikdom/z88dk | 1 | 242166 |
SECTION code_fp_am9511
PUBLIC cam32_sdcc_acosh
EXTERN asm_sdcc_read1, _am9511_acosh
.cam32_sdcc_acosh
call asm_sdcc_read1
jp _am9511_acosh
|
src/applescript/system/getActiveApp.applescript | dnnsmnstrr/HydroTouch | 3 | 552 | on getActiveApp()
tell application "System Events" to set activeApp to first process where it is frontmost
return name of activeApp
end getActiveApp
|
src/fot/LTC-PCF/Data/Nat/Type.agda | asr/fotc | 11 | 15588 | <filename>src/fot/LTC-PCF/Data/Nat/Type.agda
------------------------------------------------------------------------------
-- The LTC-PCF natural numbers type
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module LTC-PCF.Data.Nat.Type where
open import LTC-PCF.Base
------------------------------------------------------------------------------
-- The inductive predicate 'N' represents the type of the natural
-- numbers. They are a subset of 'D'.
-- The LTC-PCF natural numbers type (inductive predicate for total
-- natural numbers).
data N : D → Set where
nzero : N zero
nsucc : ∀ {n} → N n → N (succ₁ n)
-- Induction principle for N (elimination rule).
N-ind : (A : D → Set) →
A zero →
(∀ {n} → A n → A (succ₁ n)) →
∀ {n} → N n → A n
N-ind A A0 h nzero = A0
N-ind A A0 h (nsucc Nn) = h (N-ind A A0 h Nn)
|
src/Tree.agda | UnofficialJuliaMirror/MemoryMutate.jl-a5f39ad1-fb6e-5f16-afbb-4d8233a49418 | 5 | 14879 | <filename>src/Tree.agda
module Tree where
open import Data.Vec
open import Data.Nat
data Head : Set where
H : Head
infixr 5 _⇒_
data Expr : Set where
S : Expr -- something
_⇒_ : Expr → Expr → Expr -- "->" expression
E : Head → ∀{n} → Vec Expr n → Expr -- arbitrary expression
-- the termination checker is very unhappy with this one
leftBalance : Expr → Expr
leftBalance S = S
leftBalance (e ⇒ S) = e ⇒ S
leftBalance (e ⇒ (f ⇒ g)) = leftBalance ((leftBalance (e ⇒ f)) ⇒ g)
leftBalance (e ⇒ E H []) = (e ⇒ E H [])
leftBalance (e ⇒ E H (a ∷ x)) = E H (leftBalance (leftBalance e ⇒ a) ∷ (map leftBalance x))
leftBalance (E H x) = E H (map leftBalance x)
-- leftBalance (e ⇒ E H (a ∷ x)) = E H ((leftBalance (e ⇒ a)) ∷ (map leftBalance x))
|
tests/devices/longptr/Issue144_disp_longptr.asm | fengjixuchui/sjasmplus | 220 | 18067 | ; same as Issue144 main test, but in --longptr mode, where the arguments outside of the $0000..$FFFF range are legal
org #4000
disp #10000-this+zac
zac
nop
this
ENT
org #4000+this-zac
disp #0000
nop
ENT
; valid in --longptr mode
ORG -1
long1
DISP -2
long2
nop
ENT
|
bootloader/load.asm | supercomputer7/nahmanboot2 | 3 | 27557 | section .boot
BITS 32
global boot
boot:
mov esp,kernel_stack_top
extern kmain
call kmain
cli
hlt
section .bss
align 4
kernel_stack_bottom: equ $
resb 16384 ; 16 KB
kernel_stack_top: |
P6/data_P6_2/ALUTest92.asm | alxzzhou/BUAA_CO_2020 | 1 | 85125 | nor $0,$3,$3
lh $4,10($0)
xor $5,$5,$3
lbu $3,1($0)
xori $3,$3,49119
addu $4,$5,$3
addu $4,$3,$3
sll $3,$3,1
sh $4,4($0)
xori $3,$4,7775
sh $5,0($0)
sll $6,$4,10
sllv $4,$4,$3
xori $3,$3,35586
srl $4,$3,12
srl $4,$4,7
lhu $1,8($0)
sra $5,$4,8
srlv $3,$3,$3
lhu $3,8($0)
ori $4,$4,62155
lbu $4,0($0)
xori $0,$5,35395
addiu $3,$3,-7891
sltu $3,$1,$3
and $1,$4,$3
sltiu $6,$1,-1264
srlv $1,$4,$3
nor $2,$2,$3
lbu $4,11($0)
sltu $3,$6,$3
sb $0,9($0)
sra $5,$1,0
srl $1,$4,23
xori $3,$5,24292
and $0,$3,$3
slt $4,$5,$3
nor $4,$4,$3
srlv $6,$3,$3
subu $3,$1,$3
srl $4,$1,20
sra $4,$4,14
or $3,$3,$3
lbu $1,8($0)
ori $1,$1,1798
sra $1,$4,24
addiu $3,$1,-7178
addiu $3,$6,-467
sltiu $6,$6,29269
srlv $3,$3,$3
sltiu $4,$4,25675
xor $0,$6,$3
or $5,$3,$3
sb $4,6($0)
sb $3,2($0)
slt $3,$6,$3
sltiu $4,$5,19359
and $3,$1,$3
subu $5,$0,$3
sllv $1,$3,$3
xori $0,$3,15464
srl $4,$3,16
sllv $5,$5,$3
nor $3,$4,$3
sb $4,3($0)
slti $3,$3,8457
sra $1,$3,16
sb $1,3($0)
addiu $5,$6,27293
sra $1,$1,12
addu $1,$1,$3
addiu $4,$4,-7070
andi $5,$4,13537
and $5,$6,$3
addiu $3,$3,30364
xor $4,$1,$3
and $5,$3,$3
sltiu $3,$3,9831
and $3,$3,$3
nor $4,$3,$3
subu $5,$5,$3
addiu $1,$6,-21601
lb $0,14($0)
lw $1,4($0)
and $1,$1,$3
sltiu $4,$5,24008
addiu $5,$4,26634
lbu $5,4($0)
sw $3,16($0)
ori $1,$1,35555
addu $6,$5,$3
xor $6,$5,$3
lbu $6,0($0)
lb $4,6($0)
sltiu $4,$4,28740
srav $5,$3,$3
lw $3,4($0)
slt $3,$1,$3
sll $4,$2,20
subu $5,$4,$3
lbu $4,4($0)
sltu $1,$3,$3
slt $4,$1,$3
lw $3,12($0)
srlv $1,$3,$3
addiu $3,$6,24352
or $4,$3,$3
or $4,$5,$3
sltu $3,$1,$3
lbu $3,0($0)
andi $0,$4,37649
sllv $1,$6,$3
sb $1,7($0)
lw $5,0($0)
addiu $1,$3,29869
xor $4,$2,$3
slti $5,$0,24429
ori $4,$4,15398
sllv $3,$4,$3
srav $3,$3,$3
subu $4,$5,$3
lhu $4,10($0)
sra $3,$3,14
andi $3,$5,4971
slti $3,$5,-23195
sltu $6,$2,$3
srlv $4,$5,$3
xor $3,$3,$3
sltu $5,$4,$3
lhu $1,8($0)
sltiu $3,$3,-25438
srl $4,$0,13
sltu $6,$6,$3
addiu $0,$0,30588
slti $0,$0,29603
sw $4,4($0)
addu $2,$2,$3
sltiu $1,$5,-21239
subu $1,$0,$3
srl $5,$0,7
lbu $3,8($0)
slt $1,$6,$3
ori $5,$4,47359
addiu $1,$3,-17260
addiu $5,$0,-28995
slt $5,$3,$3
slt $4,$4,$3
andi $4,$5,43748
lb $1,4($0)
subu $3,$3,$3
lw $1,16($0)
ori $5,$5,22882
sra $6,$6,3
sra $4,$4,1
xori $1,$3,30604
lw $4,0($0)
or $6,$1,$3
addiu $6,$0,19852
andi $4,$3,41910
sltiu $4,$3,7324
slti $3,$5,-6049
sh $0,14($0)
sb $4,3($0)
subu $4,$3,$3
ori $3,$3,32155
addu $6,$4,$3
sltu $4,$5,$3
lb $3,8($0)
nor $3,$3,$3
slti $4,$0,-27071
srl $4,$3,15
slt $3,$1,$3
and $3,$3,$3
lbu $5,15($0)
subu $3,$3,$3
lhu $6,8($0)
xori $3,$3,16712
sh $3,2($0)
addu $6,$4,$3
sw $1,0($0)
andi $4,$4,46312
sb $3,12($0)
srav $3,$4,$3
lh $0,6($0)
ori $4,$5,54190
sb $5,9($0)
addu $3,$4,$3
ori $3,$3,3860
sh $1,8($0)
ori $3,$1,10929
lb $5,10($0)
slt $3,$3,$3
addu $4,$4,$3
or $3,$5,$3
subu $4,$4,$3
addiu $0,$0,-22255
slti $4,$0,10211
srav $3,$4,$3
slti $6,$4,25238
subu $3,$3,$3
sw $3,12($0)
subu $3,$3,$3
or $5,$4,$3
lbu $6,7($0)
subu $3,$4,$3
sb $6,3($0)
addiu $4,$4,-4481
slti $4,$5,-5574
srlv $4,$4,$3
srl $6,$6,3
or $3,$0,$3
xori $3,$3,55188
lhu $1,4($0)
srl $6,$3,11
sb $0,5($0)
sllv $1,$5,$3
or $3,$1,$3
subu $4,$3,$3
sh $4,2($0)
addu $1,$4,$3
sll $1,$1,23
sb $5,9($0)
subu $3,$3,$3
addiu $4,$5,-14296
addu $3,$3,$3
sltu $5,$3,$3
or $3,$4,$3
lh $0,2($0)
addiu $5,$4,13469
lw $6,12($0)
sll $0,$1,16
addu $4,$3,$3
andi $3,$3,59193
sltiu $3,$4,-23206
lb $3,5($0)
slti $1,$1,12522
lhu $5,12($0)
and $1,$5,$3
xor $1,$3,$3
addu $4,$3,$3
and $0,$0,$3
addu $5,$5,$3
subu $3,$6,$3
srlv $3,$5,$3
srav $4,$3,$3
subu $5,$3,$3
addu $0,$0,$3
lw $3,8($0)
srlv $6,$0,$3
lbu $1,11($0)
srav $3,$4,$3
lhu $5,12($0)
sh $1,8($0)
sllv $4,$4,$3
sb $4,4($0)
lhu $4,6($0)
addiu $6,$6,22622
sltu $6,$3,$3
srav $4,$4,$3
srav $4,$0,$3
xor $5,$4,$3
srl $6,$6,14
lhu $1,8($0)
sb $1,3($0)
xori $1,$6,17514
ori $4,$5,41446
lb $5,13($0)
sh $1,0($0)
sllv $3,$3,$3
sb $0,6($0)
andi $4,$3,55510
slt $1,$1,$3
sw $3,12($0)
lbu $4,7($0)
sll $0,$0,14
slt $5,$3,$3
sltiu $0,$0,-873
sra $3,$4,1
subu $4,$4,$3
or $6,$6,$3
lw $3,0($0)
lhu $4,6($0)
sb $0,3($0)
subu $3,$3,$3
sra $3,$3,5
sw $3,8($0)
and $3,$4,$3
xor $1,$4,$3
slt $1,$2,$3
sh $5,14($0)
lbu $1,6($0)
sra $0,$3,9
srl $3,$3,25
srav $6,$4,$3
nor $5,$5,$3
srl $1,$0,3
lh $3,12($0)
slti $2,$2,-23194
slti $3,$4,-14814
srl $3,$0,27
lw $1,16($0)
lb $3,1($0)
xori $3,$4,35322
sllv $3,$3,$3
and $5,$4,$3
slt $1,$1,$3
lw $3,4($0)
lhu $1,8($0)
addiu $0,$5,27912
subu $0,$3,$3
lb $1,14($0)
srlv $3,$3,$3
srlv $1,$1,$3
addiu $3,$3,-6905
addu $3,$1,$3
srlv $4,$4,$3
nor $5,$5,$3
sb $4,0($0)
subu $3,$1,$3
sltu $1,$6,$3
srav $3,$1,$3
srav $5,$1,$3
sra $3,$5,21
andi $1,$5,63671
slti $0,$1,-18881
slti $1,$3,-32558
ori $3,$3,10995
ori $1,$4,22469
sltu $1,$3,$3
sh $5,4($0)
lhu $3,16($0)
and $3,$2,$3
sra $3,$3,15
or $3,$3,$3
lbu $4,3($0)
lhu $3,0($0)
srl $4,$1,21
xori $3,$4,23900
sw $3,0($0)
lh $3,16($0)
sltiu $4,$3,24331
addu $5,$4,$3
slt $4,$3,$3
sw $0,4($0)
sltiu $0,$0,13290
xor $4,$4,$3
andi $4,$3,21483
lw $1,12($0)
nor $5,$6,$3
addu $3,$1,$3
subu $4,$4,$3
sllv $0,$5,$3
lhu $3,12($0)
lh $6,6($0)
lh $6,12($0)
subu $1,$1,$3
nor $6,$6,$3
slti $4,$6,-5498
addu $4,$4,$3
andi $1,$1,28525
sb $6,14($0)
andi $4,$3,32581
srav $1,$5,$3
sltu $0,$0,$3
nor $3,$6,$3
xori $6,$4,61075
srl $3,$3,29
slti $3,$3,-15079
sw $3,0($0)
xori $4,$1,15716
addu $5,$4,$3
sllv $1,$1,$3
srlv $4,$3,$3
sllv $3,$3,$3
sltiu $4,$4,-27681
ori $0,$0,1036
or $5,$1,$3
subu $4,$6,$3
sll $5,$5,3
lh $4,10($0)
addu $4,$4,$3
addu $3,$1,$3
addiu $6,$6,-6962
subu $0,$4,$3
subu $4,$3,$3
sb $1,11($0)
addu $6,$6,$3
sb $3,8($0)
xor $3,$0,$3
slti $0,$0,27714
xori $1,$6,62271
srlv $1,$4,$3
slti $5,$4,23217
subu $4,$5,$3
and $6,$1,$3
ori $3,$3,16929
srlv $3,$5,$3
lw $5,4($0)
lhu $3,2($0)
lh $5,8($0)
andi $1,$3,11250
sltiu $4,$4,-22193
andi $3,$1,36001
subu $6,$1,$3
slti $0,$0,24880
sw $6,16($0)
sw $4,4($0)
nor $5,$3,$3
xor $3,$3,$3
and $3,$4,$3
subu $0,$3,$3
sw $5,0($0)
srl $4,$3,24
sltiu $3,$4,1943
and $6,$3,$3
lw $3,16($0)
subu $3,$0,$3
addu $1,$1,$3
lhu $4,16($0)
andi $5,$5,16847
srlv $0,$0,$3
sh $1,4($0)
lh $6,2($0)
lw $3,8($0)
srlv $4,$4,$3
slt $5,$3,$3
sllv $1,$3,$3
lw $3,12($0)
sw $5,8($0)
nor $0,$0,$3
slt $3,$3,$3
subu $3,$1,$3
xor $1,$1,$3
sb $4,8($0)
subu $1,$1,$3
sllv $3,$3,$3
lhu $3,8($0)
srl $3,$0,24
slt $3,$3,$3
subu $3,$4,$3
slti $3,$4,707
sw $1,8($0)
xori $6,$5,50945
sw $6,4($0)
srl $4,$1,16
subu $5,$3,$3
xor $1,$3,$3
lhu $3,0($0)
slt $4,$3,$3
lh $3,14($0)
sb $3,3($0)
subu $4,$1,$3
lw $1,0($0)
lw $3,12($0)
addiu $3,$4,21050
sllv $5,$5,$3
sra $1,$4,13
slt $4,$5,$3
sltu $3,$4,$3
xori $4,$4,13843
subu $3,$3,$3
addu $4,$1,$3
lh $4,8($0)
slti $0,$1,12531
sw $4,12($0)
addiu $3,$5,3597
xori $5,$3,25402
sw $5,4($0)
nor $3,$3,$3
sltu $5,$1,$3
sra $6,$3,8
sll $4,$1,15
sw $3,0($0)
subu $5,$5,$3
or $4,$3,$3
lb $5,9($0)
sltu $3,$3,$3
xori $1,$3,46994
sb $1,4($0)
lb $5,8($0)
sltiu $5,$4,27505
sltiu $3,$4,-19
srl $5,$0,1
ori $4,$1,7442
srav $5,$3,$3
andi $5,$4,24854
ori $6,$0,11196
srlv $4,$3,$3
sllv $4,$4,$3
subu $3,$3,$3
lb $4,16($0)
nor $4,$3,$3
addiu $5,$5,-12762
or $4,$4,$3
sllv $3,$3,$3
lbu $4,1($0)
sltu $4,$0,$3
sb $3,9($0)
lh $3,4($0)
srav $3,$1,$3
srl $1,$6,1
andi $5,$5,26811
ori $5,$3,28999
xori $0,$4,50955
sb $4,12($0)
sltiu $3,$4,-22657
and $4,$1,$3
lh $1,8($0)
sltiu $5,$5,-14457
nor $3,$4,$3
sllv $5,$3,$3
or $3,$4,$3
and $5,$5,$3
slti $1,$1,-14645
srav $5,$3,$3
sll $3,$4,9
addu $6,$6,$3
srl $3,$3,16
sh $4,0($0)
addiu $1,$1,-12048
subu $0,$1,$3
lhu $4,8($0)
subu $1,$1,$3
andi $3,$3,7884
lb $3,16($0)
slti $5,$3,13113
sw $0,12($0)
srav $4,$6,$3
addiu $0,$4,-28727
ori $4,$1,13982
slti $5,$5,-11583
sllv $4,$4,$3
andi $1,$4,45082
slti $1,$3,-16326
sltiu $1,$3,-27556
sra $4,$4,18
sw $4,8($0)
addu $3,$3,$3
and $4,$3,$3
nor $4,$4,$3
andi $3,$3,33606
sltiu $5,$3,-9892
sh $4,10($0)
addu $4,$4,$3
slti $0,$6,-25577
xor $4,$1,$3
xori $4,$3,57686
xor $1,$3,$3
sh $5,10($0)
sllv $3,$3,$3
sltu $5,$1,$3
sltiu $3,$5,6375
lw $4,12($0)
addiu $1,$1,27386
and $3,$3,$3
xori $1,$5,51272
nor $2,$2,$3
lw $1,4($0)
ori $1,$5,52734
or $1,$3,$3
sh $1,8($0)
sltu $1,$5,$3
lhu $3,8($0)
lw $4,12($0)
sllv $3,$6,$3
slt $1,$1,$3
lb $0,8($0)
sb $6,4($0)
ori $3,$3,33373
addu $0,$4,$3
sltu $5,$5,$3
sh $4,8($0)
sllv $3,$4,$3
andi $3,$6,60264
sll $4,$2,11
and $4,$4,$3
subu $3,$1,$3
subu $1,$5,$3
sllv $4,$1,$3
lb $5,14($0)
srl $1,$2,16
srav $5,$5,$3
addu $3,$3,$3
sb $3,11($0)
sw $4,4($0)
lhu $3,14($0)
lh $1,0($0)
srlv $3,$5,$3
addiu $3,$4,12148
andi $3,$0,17135
or $2,$2,$3
subu $6,$3,$3
sltiu $4,$4,30823
ori $1,$4,6346
sltu $5,$5,$3
xori $1,$3,61612
or $3,$3,$3
sw $5,0($0)
subu $3,$3,$3
lh $3,8($0)
sltu $6,$3,$3
lb $6,13($0)
slti $3,$3,5761
lw $6,16($0)
and $4,$0,$3
sltiu $3,$4,-8415
addiu $0,$3,-4522
and $4,$3,$3
addu $3,$3,$3
sll $3,$6,17
sra $5,$5,29
addiu $0,$3,-30709
subu $5,$3,$3
sll $2,$2,16
addu $0,$2,$3
lbu $3,0($0)
sw $6,0($0)
lhu $1,12($0)
subu $5,$5,$3
xori $3,$3,2517
sra $4,$5,25
srlv $1,$1,$3
srlv $4,$0,$3
slti $4,$3,29242
and $3,$6,$3
slt $0,$0,$3
subu $4,$4,$3
lbu $4,11($0)
lh $4,16($0)
xori $3,$3,24933
sltu $6,$6,$3
sh $0,4($0)
nor $4,$3,$3
sh $4,16($0)
lhu $3,8($0)
srlv $4,$1,$3
addiu $1,$1,11959
andi $3,$6,342
addiu $1,$3,-9784
sltu $3,$0,$3
addu $5,$5,$3
nor $1,$5,$3
xor $4,$3,$3
sllv $4,$4,$3
srlv $5,$5,$3
srlv $1,$5,$3
xor $3,$1,$3
lhu $5,16($0)
slt $3,$1,$3
sll $1,$4,16
and $3,$0,$3
srav $3,$5,$3
xori $0,$0,31037
addu $5,$1,$3
sltu $1,$4,$3
lb $2,0($0)
sw $3,12($0)
xori $4,$4,55510
xori $5,$4,31652
nor $4,$4,$3
nor $3,$3,$3
lh $4,6($0)
lh $1,16($0)
lh $4,8($0)
sb $5,11($0)
ori $5,$5,10157
sllv $5,$3,$3
nor $3,$3,$3
lw $1,0($0)
slt $1,$3,$3
slti $0,$1,5891
lw $5,0($0)
srav $0,$6,$3
xori $3,$3,35096
slti $3,$3,22964
xori $3,$3,59593
srav $3,$3,$3
sh $3,14($0)
sh $5,12($0)
srav $6,$6,$3
addu $3,$6,$3
lbu $5,10($0)
subu $1,$1,$3
addu $1,$2,$3
xori $4,$3,31067
sra $1,$3,12
srl $3,$5,30
sll $4,$5,6
sltiu $4,$1,30079
subu $3,$3,$3
xori $1,$3,60612
sw $4,8($0)
sltiu $4,$4,26580
srl $3,$3,2
lb $3,14($0)
or $5,$5,$3
sh $4,10($0)
andi $4,$3,19774
addiu $5,$4,-9330
lhu $5,16($0)
and $5,$4,$3
subu $3,$3,$3
sb $0,8($0)
sb $4,10($0)
xori $5,$5,8632
sltiu $1,$1,-1950
ori $5,$5,62296
andi $1,$1,32276
addiu $0,$1,-27391
xor $4,$4,$3
addiu $1,$1,-15504
srlv $1,$1,$3
srl $3,$4,2
nor $1,$1,$3
xor $6,$3,$3
sb $4,9($0)
sll $5,$4,18
sb $3,12($0)
addiu $6,$4,15394
lw $1,4($0)
lb $6,6($0)
sltu $1,$4,$3
slt $4,$3,$3
srav $4,$6,$3
sltu $3,$3,$3
srlv $1,$3,$3
sll $6,$1,0
srlv $4,$1,$3
subu $4,$1,$3
subu $3,$4,$3
slti $2,$2,19206
lbu $5,5($0)
slt $5,$2,$3
srl $3,$5,15
lbu $1,11($0)
subu $3,$3,$3
lhu $3,4($0)
sllv $3,$3,$3
sh $1,2($0)
sltiu $3,$3,-5726
xor $4,$5,$3
subu $0,$3,$3
sb $5,11($0)
sra $3,$4,30
srl $5,$3,7
xor $3,$3,$3
slt $3,$3,$3
lh $5,16($0)
subu $4,$1,$3
sw $1,4($0)
ori $3,$4,28734
srlv $6,$5,$3
lhu $6,4($0)
sllv $0,$0,$3
xor $6,$5,$3
slt $3,$0,$3
xor $4,$3,$3
lh $0,6($0)
addiu $4,$1,-25182
xor $5,$6,$3
addiu $3,$4,12467
sltiu $0,$0,19555
lw $5,0($0)
sh $1,14($0)
srl $5,$5,13
subu $4,$4,$3
sh $1,10($0)
subu $5,$5,$3
sltiu $3,$3,-10926
nor $5,$5,$3
subu $3,$3,$3
srav $0,$5,$3
srl $4,$4,31
addu $1,$4,$3
sltiu $4,$4,27759
sra $4,$4,27
sll $5,$3,5
sh $6,10($0)
srlv $3,$3,$3
subu $6,$6,$3
slt $3,$4,$3
slti $4,$4,24089
slti $6,$3,139
sb $4,9($0)
srav $0,$3,$3
sllv $3,$5,$3
addiu $5,$0,18266
sltu $0,$6,$3
sb $6,15($0)
slti $4,$2,27994
srl $6,$3,12
subu $3,$3,$3
lw $5,4($0)
lw $4,12($0)
andi $4,$1,13084
sra $6,$5,1
addu $3,$3,$3
sw $3,4($0)
subu $3,$0,$3
srlv $1,$3,$3
subu $0,$4,$3
lhu $3,10($0)
slti $3,$4,20179
addiu $4,$4,-25388
subu $5,$1,$3
andi $6,$1,36981
lbu $3,5($0)
subu $1,$1,$3
slt $6,$4,$3
srl $4,$3,25
xori $5,$6,13413
sh $3,6($0)
subu $3,$3,$3
lh $1,2($0)
lh $4,0($0)
lh $3,2($0)
slti $3,$1,27676
sw $3,12($0)
andi $1,$4,57439
lb $4,4($0)
sltu $5,$4,$3
sb $6,11($0)
addu $3,$4,$3
addiu $3,$5,-30159
ori $5,$5,20610
srl $4,$4,25
sra $3,$4,11
lhu $6,14($0)
addiu $5,$4,1414
addu $1,$1,$3
andi $4,$4,28870
ori $3,$3,58541
sb $3,5($0)
sra $4,$0,19
sra $2,$2,12
lhu $1,2($0)
lhu $1,6($0)
sltiu $0,$5,22426
addu $1,$4,$3
addu $6,$4,$3
lw $4,0($0)
sll $6,$6,28
lhu $4,16($0)
lb $1,5($0)
xor $6,$6,$3
srl $0,$4,27
srl $3,$4,18
xori $4,$4,3640
lh $1,6($0)
and $3,$3,$3
sllv $1,$3,$3
srl $5,$5,18
sw $3,0($0)
lb $5,11($0)
nor $2,$2,$3
lb $3,13($0)
and $1,$1,$3
nor $3,$3,$3
subu $0,$0,$3
srav $3,$0,$3
xori $4,$4,30305
nor $0,$5,$3
nor $3,$3,$3
sllv $0,$1,$3
lh $1,0($0)
subu $3,$3,$3
slti $1,$3,-12698
lw $6,16($0)
sw $5,12($0)
addu $5,$6,$3
addiu $3,$3,19478
addiu $3,$4,-13154
ori $1,$0,40919
ori $4,$3,8024
lbu $3,14($0)
sllv $1,$1,$3
lh $5,2($0)
srav $3,$3,$3
sltiu $5,$5,9631
ori $3,$0,24494
addiu $5,$5,4634
lhu $5,12($0)
srl $4,$4,26
slti $3,$5,-17035
lh $4,16($0)
sltu $0,$3,$3
nor $4,$4,$3
addu $1,$4,$3
|
getChildrenTest.asm | monamansouri/os2-1 | 0 | 95816 |
_getChildrenTest: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "types.h"
#include "fcntl.h"
#include "stat.h"
int main(int argc, char *argv[]){
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 57 push %edi
e: 56 push %esi
f: 53 push %ebx
10: 51 push %ecx
11: 83 ec 08 sub $0x8,%esp
int id;
int childrenID;
int fork1 = fork();
14: e8 f0 02 00 00 call 309 <fork>
19: 89 c7 mov %eax,%edi
int fork2 = fork();
1b: e8 e9 02 00 00 call 309 <fork>
20: 89 c6 mov %eax,%esi
//getting currnet process ID
id = getpid();
22: e8 6a 03 00 00 call 391 <getpid>
27: 89 c3 mov %eax,%ebx
if (fork1 < 0 ){
29: 85 ff test %edi,%edi
2b: 78 79 js a6 <main+0xa6>
printf(1,"fork1 unsuccessful");
}
else{
printf(1,"the current process ID is \n %d\n",getpid());
2d: e8 5f 03 00 00 call 391 <getpid>
32: 57 push %edi
33: 50 push %eax
34: 68 30 08 00 00 push $0x830
39: 6a 01 push $0x1
3b: e8 60 04 00 00 call 4a0 <printf>
printf(1,"the current process PID is \n %d\n",getppid());
40: e8 7c 03 00 00 call 3c1 <getppid>
45: 83 c4 0c add $0xc,%esp
48: 50 push %eax
49: 68 54 08 00 00 push $0x854
4e: 6a 01 push $0x1
50: e8 4b 04 00 00 call 4a0 <printf>
55: 83 c4 10 add $0x10,%esp
}
if (fork2 < 0 ){
58: 85 f6 test %esi,%esi
5a: 78 5d js b9 <main+0xb9>
printf(1,"fork2 unsuccessful");
}else{
printf(1,"the current process ID is \n %d\n",getpid());
5c: e8 30 03 00 00 call 391 <getpid>
61: 52 push %edx
62: 50 push %eax
63: 68 30 08 00 00 push $0x830
68: 6a 01 push $0x1
6a: e8 31 04 00 00 call 4a0 <printf>
printf(1,"the current process PID is \n %d\n",getppid());
6f: e8 4d 03 00 00 call 3c1 <getppid>
74: 83 c4 0c add $0xc,%esp
77: 50 push %eax
78: 68 54 08 00 00 push $0x854
7d: 6a 01 push $0x1
7f: e8 1c 04 00 00 call 4a0 <printf>
84: 83 c4 10 add $0x10,%esp
}
//test getChild system call
childrenID = getChild(id);
87: 83 ec 0c sub $0xc,%esp
8a: 53 push %ebx
8b: e8 21 03 00 00 call 3b1 <getChild>
printf(1,"parent is ** %d ** and his children are ** %d **\n",id,childrenID);
90: 50 push %eax
91: 53 push %ebx
92: 68 78 08 00 00 push $0x878
97: 6a 01 push $0x1
99: e8 02 04 00 00 call 4a0 <printf>
exit();
9e: 83 c4 20 add $0x20,%esp
a1: e8 6b 02 00 00 call 311 <exit>
printf(1,"fork1 unsuccessful");
a6: 50 push %eax
a7: 50 push %eax
a8: 68 08 08 00 00 push $0x808
ad: 6a 01 push $0x1
af: e8 ec 03 00 00 call 4a0 <printf>
b4: 83 c4 10 add $0x10,%esp
b7: eb 9f jmp 58 <main+0x58>
printf(1,"fork2 unsuccessful");
b9: 51 push %ecx
ba: 51 push %ecx
bb: 68 1b 08 00 00 push $0x81b
c0: 6a 01 push $0x1
c2: e8 d9 03 00 00 call 4a0 <printf>
c7: 83 c4 10 add $0x10,%esp
ca: eb bb jmp 87 <main+0x87>
cc: 66 90 xchg %ax,%ax
ce: 66 90 xchg %ax,%ax
000000d0 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
d0: 55 push %ebp
char *os;
os = s;
while((*s++ = *t++) != 0)
d1: 31 d2 xor %edx,%edx
{
d3: 89 e5 mov %esp,%ebp
d5: 53 push %ebx
d6: 8b 45 08 mov 0x8(%ebp),%eax
d9: 8b 5d 0c mov 0xc(%ebp),%ebx
dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
while((*s++ = *t++) != 0)
e0: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx
e4: 88 0c 10 mov %cl,(%eax,%edx,1)
e7: 83 c2 01 add $0x1,%edx
ea: 84 c9 test %cl,%cl
ec: 75 f2 jne e0 <strcpy+0x10>
;
return os;
}
ee: 5b pop %ebx
ef: 5d pop %ebp
f0: c3 ret
f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
f8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
ff: 90 nop
00000100 <strcmp>:
int
strcmp(const char *p, const char *q)
{
100: 55 push %ebp
101: 89 e5 mov %esp,%ebp
103: 56 push %esi
104: 53 push %ebx
105: 8b 5d 08 mov 0x8(%ebp),%ebx
108: 8b 75 0c mov 0xc(%ebp),%esi
while(*p && *p == *q)
10b: 0f b6 13 movzbl (%ebx),%edx
10e: 0f b6 0e movzbl (%esi),%ecx
111: 84 d2 test %dl,%dl
113: 74 1e je 133 <strcmp+0x33>
115: b8 01 00 00 00 mov $0x1,%eax
11a: 38 ca cmp %cl,%dl
11c: 74 09 je 127 <strcmp+0x27>
11e: eb 20 jmp 140 <strcmp+0x40>
120: 83 c0 01 add $0x1,%eax
123: 38 ca cmp %cl,%dl
125: 75 19 jne 140 <strcmp+0x40>
127: 0f b6 14 03 movzbl (%ebx,%eax,1),%edx
12b: 0f b6 0c 06 movzbl (%esi,%eax,1),%ecx
12f: 84 d2 test %dl,%dl
131: 75 ed jne 120 <strcmp+0x20>
133: 31 c0 xor %eax,%eax
p++, q++;
return (uchar)*p - (uchar)*q;
}
135: 5b pop %ebx
136: 5e pop %esi
return (uchar)*p - (uchar)*q;
137: 29 c8 sub %ecx,%eax
}
139: 5d pop %ebp
13a: c3 ret
13b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
13f: 90 nop
140: 0f b6 c2 movzbl %dl,%eax
143: 5b pop %ebx
144: 5e pop %esi
return (uchar)*p - (uchar)*q;
145: 29 c8 sub %ecx,%eax
}
147: 5d pop %ebp
148: c3 ret
149: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000150 <strlen>:
int
strlen(const char *s)
{
150: 55 push %ebp
int n;
for(n = 0; s[n]; n++)
151: 31 c0 xor %eax,%eax
{
153: 89 e5 mov %esp,%ebp
155: 8b 55 08 mov 0x8(%ebp),%edx
for(n = 0; s[n]; n++)
158: 80 3a 00 cmpb $0x0,(%edx)
15b: 74 0c je 169 <strlen+0x19>
15d: 8d 76 00 lea 0x0(%esi),%esi
160: 83 c0 01 add $0x1,%eax
163: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1)
167: 75 f7 jne 160 <strlen+0x10>
;
return n;
}
169: 5d pop %ebp
16a: c3 ret
16b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
16f: 90 nop
00000170 <memset>:
void*
memset(void *dst, int c, int n)
{
170: 55 push %ebp
171: 89 e5 mov %esp,%ebp
173: 57 push %edi
174: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
177: 8b 4d 10 mov 0x10(%ebp),%ecx
17a: 8b 45 0c mov 0xc(%ebp),%eax
17d: 89 d7 mov %edx,%edi
17f: fc cld
180: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
182: 89 d0 mov %edx,%eax
184: 5f pop %edi
185: 5d pop %ebp
186: c3 ret
187: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
18e: 66 90 xchg %ax,%ax
00000190 <strchr>:
char*
strchr(const char *s, char c)
{
190: 55 push %ebp
191: 89 e5 mov %esp,%ebp
193: 53 push %ebx
194: 8b 45 08 mov 0x8(%ebp),%eax
197: 8b 55 0c mov 0xc(%ebp),%edx
for(; *s; s++)
19a: 0f b6 18 movzbl (%eax),%ebx
19d: 84 db test %bl,%bl
19f: 74 1d je 1be <strchr+0x2e>
1a1: 89 d1 mov %edx,%ecx
if(*s == c)
1a3: 38 d3 cmp %dl,%bl
1a5: 75 0d jne 1b4 <strchr+0x24>
1a7: eb 17 jmp 1c0 <strchr+0x30>
1a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1b0: 38 ca cmp %cl,%dl
1b2: 74 0c je 1c0 <strchr+0x30>
for(; *s; s++)
1b4: 83 c0 01 add $0x1,%eax
1b7: 0f b6 10 movzbl (%eax),%edx
1ba: 84 d2 test %dl,%dl
1bc: 75 f2 jne 1b0 <strchr+0x20>
return (char*)s;
return 0;
1be: 31 c0 xor %eax,%eax
}
1c0: 5b pop %ebx
1c1: 5d pop %ebp
1c2: c3 ret
1c3: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
000001d0 <gets>:
char*
gets(char *buf, int max)
{
1d0: 55 push %ebp
1d1: 89 e5 mov %esp,%ebp
1d3: 57 push %edi
1d4: 56 push %esi
int i, cc;
char c;
for(i=0; i+1 < max; ){
1d5: 31 f6 xor %esi,%esi
{
1d7: 53 push %ebx
1d8: 89 f3 mov %esi,%ebx
1da: 83 ec 1c sub $0x1c,%esp
1dd: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
1e0: eb 2f jmp 211 <gets+0x41>
1e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
1e8: 83 ec 04 sub $0x4,%esp
1eb: 8d 45 e7 lea -0x19(%ebp),%eax
1ee: 6a 01 push $0x1
1f0: 50 push %eax
1f1: 6a 00 push $0x0
1f3: e8 31 01 00 00 call 329 <read>
if(cc < 1)
1f8: 83 c4 10 add $0x10,%esp
1fb: 85 c0 test %eax,%eax
1fd: 7e 1c jle 21b <gets+0x4b>
break;
buf[i++] = c;
1ff: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
203: 83 c7 01 add $0x1,%edi
206: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
209: 3c 0a cmp $0xa,%al
20b: 74 23 je 230 <gets+0x60>
20d: 3c 0d cmp $0xd,%al
20f: 74 1f je 230 <gets+0x60>
for(i=0; i+1 < max; ){
211: 83 c3 01 add $0x1,%ebx
214: 89 fe mov %edi,%esi
216: 3b 5d 0c cmp 0xc(%ebp),%ebx
219: 7c cd jl 1e8 <gets+0x18>
21b: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
21d: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
220: c6 03 00 movb $0x0,(%ebx)
}
223: 8d 65 f4 lea -0xc(%ebp),%esp
226: 5b pop %ebx
227: 5e pop %esi
228: 5f pop %edi
229: 5d pop %ebp
22a: c3 ret
22b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
22f: 90 nop
230: 8b 75 08 mov 0x8(%ebp),%esi
233: 8b 45 08 mov 0x8(%ebp),%eax
236: 01 de add %ebx,%esi
238: 89 f3 mov %esi,%ebx
buf[i] = '\0';
23a: c6 03 00 movb $0x0,(%ebx)
}
23d: 8d 65 f4 lea -0xc(%ebp),%esp
240: 5b pop %ebx
241: 5e pop %esi
242: 5f pop %edi
243: 5d pop %ebp
244: c3 ret
245: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
24c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000250 <stat>:
int
stat(const char *n, struct stat *st)
{
250: 55 push %ebp
251: 89 e5 mov %esp,%ebp
253: 56 push %esi
254: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
255: 83 ec 08 sub $0x8,%esp
258: 6a 00 push $0x0
25a: ff 75 08 pushl 0x8(%ebp)
25d: e8 ef 00 00 00 call 351 <open>
if(fd < 0)
262: 83 c4 10 add $0x10,%esp
265: 85 c0 test %eax,%eax
267: 78 27 js 290 <stat+0x40>
return -1;
r = fstat(fd, st);
269: 83 ec 08 sub $0x8,%esp
26c: ff 75 0c pushl 0xc(%ebp)
26f: 89 c3 mov %eax,%ebx
271: 50 push %eax
272: e8 f2 00 00 00 call 369 <fstat>
close(fd);
277: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
27a: 89 c6 mov %eax,%esi
close(fd);
27c: e8 b8 00 00 00 call 339 <close>
return r;
281: 83 c4 10 add $0x10,%esp
}
284: 8d 65 f8 lea -0x8(%ebp),%esp
287: 89 f0 mov %esi,%eax
289: 5b pop %ebx
28a: 5e pop %esi
28b: 5d pop %ebp
28c: c3 ret
28d: 8d 76 00 lea 0x0(%esi),%esi
return -1;
290: be ff ff ff ff mov $0xffffffff,%esi
295: eb ed jmp 284 <stat+0x34>
297: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
29e: 66 90 xchg %ax,%ax
000002a0 <atoi>:
int
atoi(const char *s)
{
2a0: 55 push %ebp
2a1: 89 e5 mov %esp,%ebp
2a3: 53 push %ebx
2a4: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
2a7: 0f be 11 movsbl (%ecx),%edx
2aa: 8d 42 d0 lea -0x30(%edx),%eax
2ad: 3c 09 cmp $0x9,%al
n = 0;
2af: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
2b4: 77 1f ja 2d5 <atoi+0x35>
2b6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
2bd: 8d 76 00 lea 0x0(%esi),%esi
n = n*10 + *s++ - '0';
2c0: 83 c1 01 add $0x1,%ecx
2c3: 8d 04 80 lea (%eax,%eax,4),%eax
2c6: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
2ca: 0f be 11 movsbl (%ecx),%edx
2cd: 8d 5a d0 lea -0x30(%edx),%ebx
2d0: 80 fb 09 cmp $0x9,%bl
2d3: 76 eb jbe 2c0 <atoi+0x20>
return n;
}
2d5: 5b pop %ebx
2d6: 5d pop %ebp
2d7: c3 ret
2d8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
2df: 90 nop
000002e0 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
2e0: 55 push %ebp
2e1: 89 e5 mov %esp,%ebp
2e3: 57 push %edi
2e4: 8b 55 10 mov 0x10(%ebp),%edx
2e7: 8b 45 08 mov 0x8(%ebp),%eax
2ea: 56 push %esi
2eb: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
2ee: 85 d2 test %edx,%edx
2f0: 7e 13 jle 305 <memmove+0x25>
2f2: 01 c2 add %eax,%edx
dst = vdst;
2f4: 89 c7 mov %eax,%edi
2f6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
2fd: 8d 76 00 lea 0x0(%esi),%esi
*dst++ = *src++;
300: a4 movsb %ds:(%esi),%es:(%edi)
while(n-- > 0)
301: 39 fa cmp %edi,%edx
303: 75 fb jne 300 <memmove+0x20>
return vdst;
}
305: 5e pop %esi
306: 5f pop %edi
307: 5d pop %ebp
308: c3 ret
00000309 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
309: b8 01 00 00 00 mov $0x1,%eax
30e: cd 40 int $0x40
310: c3 ret
00000311 <exit>:
SYSCALL(exit)
311: b8 02 00 00 00 mov $0x2,%eax
316: cd 40 int $0x40
318: c3 ret
00000319 <wait>:
SYSCALL(wait)
319: b8 03 00 00 00 mov $0x3,%eax
31e: cd 40 int $0x40
320: c3 ret
00000321 <pipe>:
SYSCALL(pipe)
321: b8 04 00 00 00 mov $0x4,%eax
326: cd 40 int $0x40
328: c3 ret
00000329 <read>:
SYSCALL(read)
329: b8 05 00 00 00 mov $0x5,%eax
32e: cd 40 int $0x40
330: c3 ret
00000331 <write>:
SYSCALL(write)
331: b8 10 00 00 00 mov $0x10,%eax
336: cd 40 int $0x40
338: c3 ret
00000339 <close>:
SYSCALL(close)
339: b8 15 00 00 00 mov $0x15,%eax
33e: cd 40 int $0x40
340: c3 ret
00000341 <kill>:
SYSCALL(kill)
341: b8 06 00 00 00 mov $0x6,%eax
346: cd 40 int $0x40
348: c3 ret
00000349 <exec>:
SYSCALL(exec)
349: b8 07 00 00 00 mov $0x7,%eax
34e: cd 40 int $0x40
350: c3 ret
00000351 <open>:
SYSCALL(open)
351: b8 0f 00 00 00 mov $0xf,%eax
356: cd 40 int $0x40
358: c3 ret
00000359 <mknod>:
SYSCALL(mknod)
359: b8 11 00 00 00 mov $0x11,%eax
35e: cd 40 int $0x40
360: c3 ret
00000361 <unlink>:
SYSCALL(unlink)
361: b8 12 00 00 00 mov $0x12,%eax
366: cd 40 int $0x40
368: c3 ret
00000369 <fstat>:
SYSCALL(fstat)
369: b8 08 00 00 00 mov $0x8,%eax
36e: cd 40 int $0x40
370: c3 ret
00000371 <link>:
SYSCALL(link)
371: b8 13 00 00 00 mov $0x13,%eax
376: cd 40 int $0x40
378: c3 ret
00000379 <mkdir>:
SYSCALL(mkdir)
379: b8 14 00 00 00 mov $0x14,%eax
37e: cd 40 int $0x40
380: c3 ret
00000381 <chdir>:
SYSCALL(chdir)
381: b8 09 00 00 00 mov $0x9,%eax
386: cd 40 int $0x40
388: c3 ret
00000389 <dup>:
SYSCALL(dup)
389: b8 0a 00 00 00 mov $0xa,%eax
38e: cd 40 int $0x40
390: c3 ret
00000391 <getpid>:
SYSCALL(getpid)
391: b8 0b 00 00 00 mov $0xb,%eax
396: cd 40 int $0x40
398: c3 ret
00000399 <sbrk>:
SYSCALL(sbrk)
399: b8 0c 00 00 00 mov $0xc,%eax
39e: cd 40 int $0x40
3a0: c3 ret
000003a1 <sleep>:
SYSCALL(sleep)
3a1: b8 0d 00 00 00 mov $0xd,%eax
3a6: cd 40 int $0x40
3a8: c3 ret
000003a9 <uptime>:
SYSCALL(uptime)
3a9: b8 0e 00 00 00 mov $0xe,%eax
3ae: cd 40 int $0x40
3b0: c3 ret
000003b1 <getChild>:
SYSCALL(getChild)
3b1: b8 16 00 00 00 mov $0x16,%eax
3b6: cd 40 int $0x40
3b8: c3 ret
000003b9 <getCount>:
SYSCALL(getCount)
3b9: b8 17 00 00 00 mov $0x17,%eax
3be: cd 40 int $0x40
3c0: c3 ret
000003c1 <getppid>:
SYSCALL(getppid)
3c1: b8 18 00 00 00 mov $0x18,%eax
3c6: cd 40 int $0x40
3c8: c3 ret
000003c9 <changePolicy>:
SYSCALL(changePolicy)
3c9: b8 19 00 00 00 mov $0x19,%eax
3ce: cd 40 int $0x40
3d0: c3 ret
3d1: 66 90 xchg %ax,%ax
3d3: 66 90 xchg %ax,%ax
3d5: 66 90 xchg %ax,%ax
3d7: 66 90 xchg %ax,%ax
3d9: 66 90 xchg %ax,%ax
3db: 66 90 xchg %ax,%ax
3dd: 66 90 xchg %ax,%ax
3df: 90 nop
000003e0 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
3e0: 55 push %ebp
3e1: 89 e5 mov %esp,%ebp
3e3: 57 push %edi
3e4: 56 push %esi
3e5: 53 push %ebx
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
3e6: 89 d3 mov %edx,%ebx
{
3e8: 83 ec 3c sub $0x3c,%esp
3eb: 89 45 bc mov %eax,-0x44(%ebp)
if(sgn && xx < 0){
3ee: 85 d2 test %edx,%edx
3f0: 0f 89 92 00 00 00 jns 488 <printint+0xa8>
3f6: f6 45 08 01 testb $0x1,0x8(%ebp)
3fa: 0f 84 88 00 00 00 je 488 <printint+0xa8>
neg = 1;
400: c7 45 c0 01 00 00 00 movl $0x1,-0x40(%ebp)
x = -xx;
407: f7 db neg %ebx
} else {
x = xx;
}
i = 0;
409: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
410: 8d 75 d7 lea -0x29(%ebp),%esi
413: eb 08 jmp 41d <printint+0x3d>
415: 8d 76 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
418: 89 7d c4 mov %edi,-0x3c(%ebp)
}while((x /= base) != 0);
41b: 89 c3 mov %eax,%ebx
buf[i++] = digits[x % base];
41d: 89 d8 mov %ebx,%eax
41f: 31 d2 xor %edx,%edx
421: 8b 7d c4 mov -0x3c(%ebp),%edi
424: f7 f1 div %ecx
426: 83 c7 01 add $0x1,%edi
429: 0f b6 92 b4 08 00 00 movzbl 0x8b4(%edx),%edx
430: 88 14 3e mov %dl,(%esi,%edi,1)
}while((x /= base) != 0);
433: 39 d9 cmp %ebx,%ecx
435: 76 e1 jbe 418 <printint+0x38>
if(neg)
437: 8b 45 c0 mov -0x40(%ebp),%eax
43a: 85 c0 test %eax,%eax
43c: 74 0d je 44b <printint+0x6b>
buf[i++] = '-';
43e: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1)
443: ba 2d 00 00 00 mov $0x2d,%edx
buf[i++] = digits[x % base];
448: 89 7d c4 mov %edi,-0x3c(%ebp)
44b: 8b 45 c4 mov -0x3c(%ebp),%eax
44e: 8b 7d bc mov -0x44(%ebp),%edi
451: 8d 5c 05 d7 lea -0x29(%ebp,%eax,1),%ebx
455: eb 0f jmp 466 <printint+0x86>
457: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
45e: 66 90 xchg %ax,%ax
460: 0f b6 13 movzbl (%ebx),%edx
463: 83 eb 01 sub $0x1,%ebx
write(fd, &c, 1);
466: 83 ec 04 sub $0x4,%esp
469: 88 55 d7 mov %dl,-0x29(%ebp)
46c: 6a 01 push $0x1
46e: 56 push %esi
46f: 57 push %edi
470: e8 bc fe ff ff call 331 <write>
while(--i >= 0)
475: 83 c4 10 add $0x10,%esp
478: 39 de cmp %ebx,%esi
47a: 75 e4 jne 460 <printint+0x80>
putc(fd, buf[i]);
}
47c: 8d 65 f4 lea -0xc(%ebp),%esp
47f: 5b pop %ebx
480: 5e pop %esi
481: 5f pop %edi
482: 5d pop %ebp
483: c3 ret
484: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
488: c7 45 c0 00 00 00 00 movl $0x0,-0x40(%ebp)
48f: e9 75 ff ff ff jmp 409 <printint+0x29>
494: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
49b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
49f: 90 nop
000004a0 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
4a0: 55 push %ebp
4a1: 89 e5 mov %esp,%ebp
4a3: 57 push %edi
4a4: 56 push %esi
4a5: 53 push %ebx
4a6: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
4a9: 8b 75 0c mov 0xc(%ebp),%esi
4ac: 0f b6 1e movzbl (%esi),%ebx
4af: 84 db test %bl,%bl
4b1: 0f 84 b9 00 00 00 je 570 <printf+0xd0>
ap = (uint*)(void*)&fmt + 1;
4b7: 8d 45 10 lea 0x10(%ebp),%eax
4ba: 83 c6 01 add $0x1,%esi
write(fd, &c, 1);
4bd: 8d 7d e7 lea -0x19(%ebp),%edi
state = 0;
4c0: 31 d2 xor %edx,%edx
ap = (uint*)(void*)&fmt + 1;
4c2: 89 45 d0 mov %eax,-0x30(%ebp)
4c5: eb 38 jmp 4ff <printf+0x5f>
4c7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
4ce: 66 90 xchg %ax,%ax
4d0: 89 55 d4 mov %edx,-0x2c(%ebp)
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
state = '%';
4d3: ba 25 00 00 00 mov $0x25,%edx
if(c == '%'){
4d8: 83 f8 25 cmp $0x25,%eax
4db: 74 17 je 4f4 <printf+0x54>
write(fd, &c, 1);
4dd: 83 ec 04 sub $0x4,%esp
4e0: 88 5d e7 mov %bl,-0x19(%ebp)
4e3: 6a 01 push $0x1
4e5: 57 push %edi
4e6: ff 75 08 pushl 0x8(%ebp)
4e9: e8 43 fe ff ff call 331 <write>
4ee: 8b 55 d4 mov -0x2c(%ebp),%edx
} else {
putc(fd, c);
4f1: 83 c4 10 add $0x10,%esp
4f4: 83 c6 01 add $0x1,%esi
for(i = 0; fmt[i]; i++){
4f7: 0f b6 5e ff movzbl -0x1(%esi),%ebx
4fb: 84 db test %bl,%bl
4fd: 74 71 je 570 <printf+0xd0>
c = fmt[i] & 0xff;
4ff: 0f be cb movsbl %bl,%ecx
502: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
505: 85 d2 test %edx,%edx
507: 74 c7 je 4d0 <printf+0x30>
}
} else if(state == '%'){
509: 83 fa 25 cmp $0x25,%edx
50c: 75 e6 jne 4f4 <printf+0x54>
if(c == 'd'){
50e: 83 f8 64 cmp $0x64,%eax
511: 0f 84 99 00 00 00 je 5b0 <printf+0x110>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
517: 81 e1 f7 00 00 00 and $0xf7,%ecx
51d: 83 f9 70 cmp $0x70,%ecx
520: 74 5e je 580 <printf+0xe0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
522: 83 f8 73 cmp $0x73,%eax
525: 0f 84 d5 00 00 00 je 600 <printf+0x160>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
52b: 83 f8 63 cmp $0x63,%eax
52e: 0f 84 8c 00 00 00 je 5c0 <printf+0x120>
putc(fd, *ap);
ap++;
} else if(c == '%'){
534: 83 f8 25 cmp $0x25,%eax
537: 0f 84 b3 00 00 00 je 5f0 <printf+0x150>
write(fd, &c, 1);
53d: 83 ec 04 sub $0x4,%esp
540: c6 45 e7 25 movb $0x25,-0x19(%ebp)
544: 6a 01 push $0x1
546: 57 push %edi
547: ff 75 08 pushl 0x8(%ebp)
54a: e8 e2 fd ff ff call 331 <write>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
54f: 88 5d e7 mov %bl,-0x19(%ebp)
write(fd, &c, 1);
552: 83 c4 0c add $0xc,%esp
555: 6a 01 push $0x1
557: 83 c6 01 add $0x1,%esi
55a: 57 push %edi
55b: ff 75 08 pushl 0x8(%ebp)
55e: e8 ce fd ff ff call 331 <write>
for(i = 0; fmt[i]; i++){
563: 0f b6 5e ff movzbl -0x1(%esi),%ebx
putc(fd, c);
567: 83 c4 10 add $0x10,%esp
}
state = 0;
56a: 31 d2 xor %edx,%edx
for(i = 0; fmt[i]; i++){
56c: 84 db test %bl,%bl
56e: 75 8f jne 4ff <printf+0x5f>
}
}
}
570: 8d 65 f4 lea -0xc(%ebp),%esp
573: 5b pop %ebx
574: 5e pop %esi
575: 5f pop %edi
576: 5d pop %ebp
577: c3 ret
578: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
57f: 90 nop
printint(fd, *ap, 16, 0);
580: 83 ec 0c sub $0xc,%esp
583: b9 10 00 00 00 mov $0x10,%ecx
588: 6a 00 push $0x0
58a: 8b 5d d0 mov -0x30(%ebp),%ebx
58d: 8b 45 08 mov 0x8(%ebp),%eax
590: 8b 13 mov (%ebx),%edx
592: e8 49 fe ff ff call 3e0 <printint>
ap++;
597: 89 d8 mov %ebx,%eax
599: 83 c4 10 add $0x10,%esp
state = 0;
59c: 31 d2 xor %edx,%edx
ap++;
59e: 83 c0 04 add $0x4,%eax
5a1: 89 45 d0 mov %eax,-0x30(%ebp)
5a4: e9 4b ff ff ff jmp 4f4 <printf+0x54>
5a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
printint(fd, *ap, 10, 1);
5b0: 83 ec 0c sub $0xc,%esp
5b3: b9 0a 00 00 00 mov $0xa,%ecx
5b8: 6a 01 push $0x1
5ba: eb ce jmp 58a <printf+0xea>
5bc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
putc(fd, *ap);
5c0: 8b 5d d0 mov -0x30(%ebp),%ebx
write(fd, &c, 1);
5c3: 83 ec 04 sub $0x4,%esp
putc(fd, *ap);
5c6: 8b 03 mov (%ebx),%eax
write(fd, &c, 1);
5c8: 6a 01 push $0x1
ap++;
5ca: 83 c3 04 add $0x4,%ebx
write(fd, &c, 1);
5cd: 57 push %edi
5ce: ff 75 08 pushl 0x8(%ebp)
putc(fd, *ap);
5d1: 88 45 e7 mov %al,-0x19(%ebp)
write(fd, &c, 1);
5d4: e8 58 fd ff ff call 331 <write>
ap++;
5d9: 89 5d d0 mov %ebx,-0x30(%ebp)
5dc: 83 c4 10 add $0x10,%esp
state = 0;
5df: 31 d2 xor %edx,%edx
5e1: e9 0e ff ff ff jmp 4f4 <printf+0x54>
5e6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
5ed: 8d 76 00 lea 0x0(%esi),%esi
putc(fd, c);
5f0: 88 5d e7 mov %bl,-0x19(%ebp)
write(fd, &c, 1);
5f3: 83 ec 04 sub $0x4,%esp
5f6: e9 5a ff ff ff jmp 555 <printf+0xb5>
5fb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
5ff: 90 nop
s = (char*)*ap;
600: 8b 45 d0 mov -0x30(%ebp),%eax
603: 8b 18 mov (%eax),%ebx
ap++;
605: 83 c0 04 add $0x4,%eax
608: 89 45 d0 mov %eax,-0x30(%ebp)
if(s == 0)
60b: 85 db test %ebx,%ebx
60d: 74 17 je 626 <printf+0x186>
while(*s != 0){
60f: 0f b6 03 movzbl (%ebx),%eax
state = 0;
612: 31 d2 xor %edx,%edx
while(*s != 0){
614: 84 c0 test %al,%al
616: 0f 84 d8 fe ff ff je 4f4 <printf+0x54>
61c: 89 75 d4 mov %esi,-0x2c(%ebp)
61f: 89 de mov %ebx,%esi
621: 8b 5d 08 mov 0x8(%ebp),%ebx
624: eb 1a jmp 640 <printf+0x1a0>
s = "(null)";
626: bb ac 08 00 00 mov $0x8ac,%ebx
while(*s != 0){
62b: 89 75 d4 mov %esi,-0x2c(%ebp)
62e: b8 28 00 00 00 mov $0x28,%eax
633: 89 de mov %ebx,%esi
635: 8b 5d 08 mov 0x8(%ebp),%ebx
638: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
63f: 90 nop
write(fd, &c, 1);
640: 83 ec 04 sub $0x4,%esp
s++;
643: 83 c6 01 add $0x1,%esi
646: 88 45 e7 mov %al,-0x19(%ebp)
write(fd, &c, 1);
649: 6a 01 push $0x1
64b: 57 push %edi
64c: 53 push %ebx
64d: e8 df fc ff ff call 331 <write>
while(*s != 0){
652: 0f b6 06 movzbl (%esi),%eax
655: 83 c4 10 add $0x10,%esp
658: 84 c0 test %al,%al
65a: 75 e4 jne 640 <printf+0x1a0>
65c: 8b 75 d4 mov -0x2c(%ebp),%esi
state = 0;
65f: 31 d2 xor %edx,%edx
661: e9 8e fe ff ff jmp 4f4 <printf+0x54>
666: 66 90 xchg %ax,%ax
668: 66 90 xchg %ax,%ax
66a: 66 90 xchg %ax,%ax
66c: 66 90 xchg %ax,%ax
66e: 66 90 xchg %ax,%ax
00000670 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
670: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
671: a1 60 0b 00 00 mov 0xb60,%eax
{
676: 89 e5 mov %esp,%ebp
678: 57 push %edi
679: 56 push %esi
67a: 53 push %ebx
67b: 8b 5d 08 mov 0x8(%ebp),%ebx
67e: 8b 10 mov (%eax),%edx
bp = (Header*)ap - 1;
680: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
683: 39 c8 cmp %ecx,%eax
685: 73 19 jae 6a0 <free+0x30>
687: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
68e: 66 90 xchg %ax,%ax
690: 39 d1 cmp %edx,%ecx
692: 72 14 jb 6a8 <free+0x38>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
694: 39 d0 cmp %edx,%eax
696: 73 10 jae 6a8 <free+0x38>
{
698: 89 d0 mov %edx,%eax
69a: 8b 10 mov (%eax),%edx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
69c: 39 c8 cmp %ecx,%eax
69e: 72 f0 jb 690 <free+0x20>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6a0: 39 d0 cmp %edx,%eax
6a2: 72 f4 jb 698 <free+0x28>
6a4: 39 d1 cmp %edx,%ecx
6a6: 73 f0 jae 698 <free+0x28>
break;
if(bp + bp->s.size == p->s.ptr){
6a8: 8b 73 fc mov -0x4(%ebx),%esi
6ab: 8d 3c f1 lea (%ecx,%esi,8),%edi
6ae: 39 fa cmp %edi,%edx
6b0: 74 1e je 6d0 <free+0x60>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
6b2: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
6b5: 8b 50 04 mov 0x4(%eax),%edx
6b8: 8d 34 d0 lea (%eax,%edx,8),%esi
6bb: 39 f1 cmp %esi,%ecx
6bd: 74 28 je 6e7 <free+0x77>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
6bf: 89 08 mov %ecx,(%eax)
freep = p;
}
6c1: 5b pop %ebx
freep = p;
6c2: a3 60 0b 00 00 mov %eax,0xb60
}
6c7: 5e pop %esi
6c8: 5f pop %edi
6c9: 5d pop %ebp
6ca: c3 ret
6cb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
6cf: 90 nop
bp->s.size += p->s.ptr->s.size;
6d0: 03 72 04 add 0x4(%edx),%esi
6d3: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
6d6: 8b 10 mov (%eax),%edx
6d8: 8b 12 mov (%edx),%edx
6da: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
6dd: 8b 50 04 mov 0x4(%eax),%edx
6e0: 8d 34 d0 lea (%eax,%edx,8),%esi
6e3: 39 f1 cmp %esi,%ecx
6e5: 75 d8 jne 6bf <free+0x4f>
p->s.size += bp->s.size;
6e7: 03 53 fc add -0x4(%ebx),%edx
freep = p;
6ea: a3 60 0b 00 00 mov %eax,0xb60
p->s.size += bp->s.size;
6ef: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
6f2: 8b 53 f8 mov -0x8(%ebx),%edx
6f5: 89 10 mov %edx,(%eax)
}
6f7: 5b pop %ebx
6f8: 5e pop %esi
6f9: 5f pop %edi
6fa: 5d pop %ebp
6fb: c3 ret
6fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000700 <malloc>:
return freep;
}
void*
malloc(int nbytes)
{
700: 55 push %ebp
701: 89 e5 mov %esp,%ebp
703: 57 push %edi
704: 56 push %esi
705: 53 push %ebx
706: 83 ec 1c sub $0x1c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
709: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
70c: 8b 3d 60 0b 00 00 mov 0xb60,%edi
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
712: 8d 70 07 lea 0x7(%eax),%esi
715: c1 ee 03 shr $0x3,%esi
718: 83 c6 01 add $0x1,%esi
if((prevp = freep) == 0){
71b: 85 ff test %edi,%edi
71d: 0f 84 ad 00 00 00 je 7d0 <malloc+0xd0>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
723: 8b 17 mov (%edi),%edx
if(p->s.size >= nunits){
725: 8b 4a 04 mov 0x4(%edx),%ecx
728: 39 f1 cmp %esi,%ecx
72a: 73 72 jae 79e <malloc+0x9e>
72c: 81 fe 00 10 00 00 cmp $0x1000,%esi
732: bb 00 10 00 00 mov $0x1000,%ebx
737: 0f 43 de cmovae %esi,%ebx
p = sbrk(nu * sizeof(Header));
73a: 8d 04 dd 00 00 00 00 lea 0x0(,%ebx,8),%eax
741: 89 45 e4 mov %eax,-0x1c(%ebp)
744: eb 1b jmp 761 <malloc+0x61>
746: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
74d: 8d 76 00 lea 0x0(%esi),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
750: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
752: 8b 48 04 mov 0x4(%eax),%ecx
755: 39 f1 cmp %esi,%ecx
757: 73 4f jae 7a8 <malloc+0xa8>
759: 8b 3d 60 0b 00 00 mov 0xb60,%edi
75f: 89 c2 mov %eax,%edx
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
761: 39 d7 cmp %edx,%edi
763: 75 eb jne 750 <malloc+0x50>
p = sbrk(nu * sizeof(Header));
765: 83 ec 0c sub $0xc,%esp
768: ff 75 e4 pushl -0x1c(%ebp)
76b: e8 29 fc ff ff call 399 <sbrk>
if(p == (char*)-1)
770: 83 c4 10 add $0x10,%esp
773: 83 f8 ff cmp $0xffffffff,%eax
776: 74 1c je 794 <malloc+0x94>
hp->s.size = nu;
778: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
77b: 83 ec 0c sub $0xc,%esp
77e: 83 c0 08 add $0x8,%eax
781: 50 push %eax
782: e8 e9 fe ff ff call 670 <free>
return freep;
787: 8b 15 60 0b 00 00 mov 0xb60,%edx
if((p = morecore(nunits)) == 0)
78d: 83 c4 10 add $0x10,%esp
790: 85 d2 test %edx,%edx
792: 75 bc jne 750 <malloc+0x50>
return 0;
}
}
794: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
797: 31 c0 xor %eax,%eax
}
799: 5b pop %ebx
79a: 5e pop %esi
79b: 5f pop %edi
79c: 5d pop %ebp
79d: c3 ret
if(p->s.size >= nunits){
79e: 89 d0 mov %edx,%eax
7a0: 89 fa mov %edi,%edx
7a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if(p->s.size == nunits)
7a8: 39 ce cmp %ecx,%esi
7aa: 74 54 je 800 <malloc+0x100>
p->s.size -= nunits;
7ac: 29 f1 sub %esi,%ecx
7ae: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
7b1: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
7b4: 89 70 04 mov %esi,0x4(%eax)
freep = prevp;
7b7: 89 15 60 0b 00 00 mov %edx,0xb60
}
7bd: 8d 65 f4 lea -0xc(%ebp),%esp
return (void*)(p + 1);
7c0: 83 c0 08 add $0x8,%eax
}
7c3: 5b pop %ebx
7c4: 5e pop %esi
7c5: 5f pop %edi
7c6: 5d pop %ebp
7c7: c3 ret
7c8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
7cf: 90 nop
base.s.ptr = freep = prevp = &base;
7d0: c7 05 60 0b 00 00 64 movl $0xb64,0xb60
7d7: 0b 00 00
base.s.size = 0;
7da: bf 64 0b 00 00 mov $0xb64,%edi
base.s.ptr = freep = prevp = &base;
7df: c7 05 64 0b 00 00 64 movl $0xb64,0xb64
7e6: 0b 00 00
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7e9: 89 fa mov %edi,%edx
base.s.size = 0;
7eb: c7 05 68 0b 00 00 00 movl $0x0,0xb68
7f2: 00 00 00
if(p->s.size >= nunits){
7f5: e9 32 ff ff ff jmp 72c <malloc+0x2c>
7fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
prevp->s.ptr = p->s.ptr;
800: 8b 08 mov (%eax),%ecx
802: 89 0a mov %ecx,(%edx)
804: eb b1 jmp 7b7 <malloc+0xb7>
|
Kernel/interruptions/interrupts.asm | ssandrini/Arqui_TPE | 0 | 84297 |
GLOBAL _cli
GLOBAL _sti
GLOBAL picMasterMask
GLOBAL picSlaveMask
GLOBAL haltcpu
GLOBAL _hlt
GLOBAL _irq00Handler
GLOBAL _irq01Handler
GLOBAL _irq02Handler
GLOBAL _irq03Handler
GLOBAL _irq04Handler
GLOBAL _irq05Handler
GLOBAL _exception0Handler
GLOBAL _exception6Handler
GLOBAL _int80Handler
GLOBAL _getKey
GLOBAL _keyPressed
GLOBAL _RTC
GLOBAL _cpuid
GLOBAL _cpuidSupport
EXTERN irqDispatcher
EXTERN exceptionDispatcher
EXTERN sysHandler
EXTERN getStackBase
SECTION .text
%macro pushState 0
push rax
push rbx
push rcx
push rdx
push rbp
push rdi
push rsi
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
%endmacro
%macro popState 0
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop rsi
pop rdi
pop rbp
pop rdx
pop rcx
pop rbx
pop rax
%endmacro
%macro irqHandlerMaster 1
pushState
mov rdi, %1 ; pasaje de parametro
call irqDispatcher
; signal pic EOI (End of Interrupt)
mov al, 20h
out 20h, al
popState
iretq
%endmacro
%macro exceptionHandler 1
pushState
mov rdi, %1 ; pasaje de parametro
mov rsi, rsp ; le paso el rsp para que tenga el stackframe
call exceptionDispatcher
popState
iretq
%endmacro
_hlt:
sti
hlt
ret
_cli:
cli
ret
_sti:
sti
ret
picMasterMask:
push rbp
mov rbp, rsp
mov ax, di
out 21h,al
pop rbp
retn
picSlaveMask:
push rbp
mov rbp, rsp
mov ax, di ; ax = mascara de 16 bits
out 0A1h,al
pop rbp
retn
;8254 Timer (Timer Tick)
_irq00Handler:
irqHandlerMaster 0
;Keyboard
_irq01Handler:
irqHandlerMaster 1
;Cascade pic never called
_irq02Handler:
irqHandlerMaster 2
;Serial Port 2 and 4
_irq03Handler:
irqHandlerMaster 3
;Serial Port 1 and 3
_irq04Handler:
irqHandlerMaster 4
;USB
_irq05Handler:
irqHandlerMaster 5
;Zero Division Exception
_exception0Handler:
exceptionHandler 0
;Invalid Instruction Exception
_exception6Handler:
exceptionHandler 6
haltcpu:
cli
hlt
ret
_keyPressed:
in al,64h
and al,0x01
ret
_getKey:
in al,60h
ret
_int80Handler:
pushState
mov r8, rsp
mov rcx, rdx
mov rdx, rsi
mov rsi, rdi
mov rdi, rax
call sysHandler
popState
iretq
_RTC:
push rbp
mov rbp, rsp
mov rax, rdi
out 70h, al
in al, 71h
mov rsp, rbp
pop rbp
ret
; devuelve 1 si el micro soporta la instruccion cpuid y 0 sino
_cpuidSupport:
push rbp
mov rbp, rsp
push rbx ; pusheo rbx porque desp lo voy a usar
pushfq ; pusheo el registro de flags
pop rax ; lo meto en rax
mov rbx, rax ; lo guardo en rbx
xor rax, 200000h ; seteo el ID flag en 1
push rax ; pusheo este registro
popfq ; popeo los flags
pushfq ; pusheo los flags
pop rax ; los popeo en rax
cmp rax, rbx ; los comparo con los flags viejos
jz .no_support
pop rbx
mov rax, 1
mov rsp, rbp
pop rbp
ret
.no_support:
pop rbx
mov rax, 0
mov rsp, rbp
pop rbp
ret
;int _cpuid(uint32_t * r1,uint32_t * r2, int * id);
; rdi rsi rdx
_cpuid:
push rcx
mov rax, [rdx]
mov rcx, 0
cpuid
cmp dword[rdx], 7h
je .special
mov dword[rdi], ecx
mov dword[rsi], edx
pop rcx
ret
.special:
mov dword[rdi], ecx
mov dword[rsi], ebx
pop rcx
ret
SECTION .bss
aux resq 1 |
test/Fail/Issue2402-2.agda | shlevy/agda | 1,989 | 1744 | <filename>test/Fail/Issue2402-2.agda
-- Andreas, 2017-01-13, issue #2402
-- Error message: incomplete pattern matching
open import Common.Bool
module _ (A B C D E F G H I J K L M O P Q R S T U V W X Y Z : Set) where
test2 : Bool → Bool
test2 x with true
test2 true | x = ?
-- WAS: Reports:
-- Incomplete pattern matching for .IncompletePattern.with-56.
-- Missing cases:
-- .IncompletePattern.with-56 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ false
-- when checking the definition of with-56
-- That's total bogus!
-- Expected:
-- Incomplete pattern matching for .Issue2402-2.with-56.
-- Missing cases:
-- test2 false | w
-- when checking the definition of with-56
|
oeis/168/A168046.asm | neoneye/loda-programs | 11 | 29466 | <reponame>neoneye/loda-programs
; A168046: Characteristic function of zerofree numbers in decimal representation.
; Submitted by <NAME>
; 0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1
seq $0,217096 ; Characteristic function of numbers that have a nonleading zero in their decimal representation (A011540). 0 itself is also included, so a(0) = 1.
add $0,1
mod $0,2
|
alloy4fun_models/trashltl/models/11/XSLWndYgpaqxKFSi7.als | Kaixi26/org.alloytools.alloy | 0 | 3976 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idXSLWndYgpaqxKFSi7_prop12 {
eventually all f:File | f in Trash implies f in Trash'
}
pred __repair { idXSLWndYgpaqxKFSi7_prop12 }
check __repair { idXSLWndYgpaqxKFSi7_prop12 <=> prop12o } |
Source/cutscenes.adb | XMoose25X/Advanced-Dungeon-Assault | 1 | 15451 | <gh_stars>1-10
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with display; use display;
with stats; use stats;
with player; use player;
package body Cutscenes is
procedure Display_Settings is
input : Character;
begin
ClearDisplay;
WipeScreen;
SetText(1,22,"Please take these following steps to fully enjoy the game:", colorGreen);
SetText(1,24," 1) Right click the PuTTY title bar" , colorDefault);
SetText(1,25," 2) Click 'Change Settings...'" , colorDefault);
SetText(1,26," 3) Select 'Appearance'" , colorDefault);
SetText(1,27," 4) Change the font to 'Terminal' with any size" , colorDefault);
SetText(1,28," 5) Go to 'Translation'" , colorDefault);
SetText(1,29," 6) Change the character set to 'use font encoding'" , colorDefault);
SetText(1,30," 7) Apply, then maximize the window" , colorDefault);
SetText(1,32,"After all is set, press any key to start the game." , colorGreenL);
refresh;
get_immediate(input);
ClearDisplay;
refresh;
end Display_Settings;
procedure Display_Opening is
input : Character;
begin
ClearDisplay;
WipeScreen;
SetText(1,23,"You awaken in a dark and slimy dungeon, anware of what happened to you.", colorBlackL);
SetText(1,24,"Your body buckles underneath your own weight. You collapse once more." , colorBlackL);
SetText(1,25,"Suddenly, you hear scratching in the distance..." , colorDefault);
SetText(1,26,"Your senses sharpen with each passing second." , colorDefault);
SetText(1,27,"Unfamiliar with your surroundings, your body begins to tremor in fear." , colorRed);
SetText(1,28,"You vow to scour this dungeon and find those responsible!" , colorRed);
Flush;
refresh;
get_immediate(input);
ClearDisplay;
refresh;
end Display_Opening;
procedure Display_Credits is
input : Character;
begin
ClearDisplay;
WipeScreen;
SetText(1,23,"You find a large set of keys in one of the fallen elders' robes.", colorRed);
SetText(1,24,"You push the key in the huge door behind the now vacant throne." , colorRed);
SetText(1,25,"The door swings open..." , colorDefault);
SetText(1,26,"And you are bathed in warm sunlight." , colorDefault);
SetText(1,27,"You have finally escaped the Dungeon..." , colorBlackL);
SetText(1,28,"You are free!" , colorBlackL);
Flush;
refresh;
get_immediate(input);
ClearDisplay;
refresh;
WipeScreen;
SetText(1,23,"Thank You for Playing!");
SetText(1,24," <NAME>");
SetText(1,25," <NAME>");
SetText(1,26," <NAME>");
Flush;
refresh;
get_immediate(input);
ClearDisplay;
refresh;
end Display_Credits;
end Cutscenes;
|
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0xca_notsx.log_21829_1896.asm | ljhsiun2/medusa | 9 | 28633 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r8
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x551d, %r8
clflush (%r8)
inc %r9
mov $0x6162636465666768, %r11
movq %r11, %xmm1
and $0xffffffffffffffc0, %r8
vmovntdq %ymm1, (%r8)
nop
nop
nop
cmp %r8, %r8
lea addresses_normal_ht+0x75f5, %rsi
lea addresses_UC_ht+0xa145, %rdi
nop
nop
nop
and %r14, %r14
mov $23, %rcx
rep movsb
nop
sub %r9, %r9
lea addresses_WT_ht+0xd5f5, %rcx
clflush (%rcx)
nop
nop
nop
and %rsi, %rsi
mov (%rcx), %r11d
nop
nop
nop
add %r9, %r9
lea addresses_D_ht+0xc16d, %rcx
nop
nop
nop
nop
nop
sub $15992, %r14
mov (%rcx), %r11
nop
cmp %r11, %r11
lea addresses_WC_ht+0xadf5, %r11
nop
nop
nop
nop
nop
cmp %r9, %r9
mov $0x6162636465666768, %rcx
movq %rcx, (%r11)
nop
nop
dec %r14
lea addresses_WC_ht+0x11c7d, %rsi
nop
xor $29273, %rdi
movb (%rsi), %r9b
and $45907, %rsi
lea addresses_D_ht+0x6035, %rsi
nop
nop
nop
nop
nop
cmp $10786, %rcx
movw $0x6162, (%rsi)
nop
nop
nop
xor %rsi, %rsi
lea addresses_WT_ht+0x14ff5, %rsi
lea addresses_normal_ht+0xbdf5, %rdi
add %r9, %r9
mov $61, %rcx
rep movsq
and %rdi, %rdi
lea addresses_UC_ht+0x44f5, %rsi
and $23283, %r11
movb $0x61, (%rsi)
sub $54275, %r9
lea addresses_normal_ht+0xb7f5, %r14
nop
nop
nop
nop
add $42351, %r8
mov $0x6162636465666768, %rdi
movq %rdi, (%r14)
nop
nop
nop
add %r11, %r11
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r15
push %rax
push %rbp
push %rcx
push %rsi
// Store
lea addresses_PSE+0x43f5, %r10
nop
nop
nop
nop
inc %r15
mov $0x5152535455565758, %rax
movq %rax, %xmm1
vmovups %ymm1, (%r10)
nop
nop
nop
nop
dec %rax
// Store
lea addresses_RW+0x103d5, %rcx
nop
nop
nop
nop
cmp %rbp, %rbp
mov $0x5152535455565758, %r14
movq %r14, %xmm6
movups %xmm6, (%rcx)
xor $22649, %r10
// Faulty Load
lea addresses_D+0x16ff5, %rbp
and $45683, %rcx
movb (%rbp), %r10b
lea oracles, %rbp
and $0xff, %r10
shlq $12, %r10
mov (%rbp,%r10,1), %r10
pop %rsi
pop %rcx
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_PSE', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_RW', 'size': 16, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': True, 'type': 'addresses_D', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': True, 'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_D_ht', 'size': 2, 'AVXalign': True}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
Borland/CBuilder5/Source/RTL/source/math/lrotr.asm | TrevorDArcyEvans/DivingMagpieSoftware | 1 | 24234 | <filename>Borland/CBuilder5/Source/RTL/source/math/lrotr.asm
;[]-----------------------------------------------------------------[]
;| LROTR.ASM -- right rotate of unsigned long |
;[]-----------------------------------------------------------------[]
;
; C/C++ Run Time Library - Version 10.0
;
; Copyright (c) 1991, 2000 by Inprise Corporation
; All Rights Reserved.
;
; $Revision: 9.0 $
include RULES.ASI
; Segments Definitions
Header@
;-----------------------------------------------------------------------
;
;Name _lrotr - rotates an unsigned long right
;
;Usage unsigned long _lrotr(unsigned long val, int rotate_count)
;
;Prototype in stdlib.h
;
;Description _lrotr rotates an unsigned long integer val right
; rotate_count bits.
;
;Return value the value after rotation
;
;-----------------------------------------------------------------------
Code_seg@
Func@ _lrotr, _EXPFUNC, _RTLENTRY, <long val>, <int rcount>
mov eax, [esp+4] ; get value
mov ecx, [esp+8] ; get rotate count
ror eax,cl ; rotate the value
Return@
EndFunc@ _lrotr
Code_EndS@
end
|
src/types.ads | Kurinkitos/Twizy-Security | 1 | 11051 | package types is
type FloatingNumber is digits 12;
subtype Speed is FloatingNumber range -80.0 .. 80.0;
-- unit is meters
subtype Distance is FloatingNumber range -100000000000000000.0 .. 10000000000000000000000.0;
subtype Cartesian_Coordinate is Distance;
-- angle from lidar (0 is straight forward)
subtype Angle is FloatingNumber range -360.0 .. 360.0;
subtype Steering_angle is Angle range -90.0 .. 90.0;
subtype Lidar_angle is Angle range -180.0 .. 180.0;
type DangerZone is
record
ScopeAngle : Lidar_Angle;
Radius: Distance;
SteeringAngleOffset : Lidar_Angle;
end record;
type Point is
record
X : Cartesian_Coordinate;
Y : Cartesian_Coordinate;
Z : Cartesian_Coordinate;
end record;
subtype LocalPoint is Point;
end types;
|
oeis/050/A050685.asm | neoneye/loda-programs | 11 | 100254 | ; A050685: Number of nonzero palindromes < 10^n and containing at least one digit '0'.
; 0,0,9,18,189,360,2799,5238,36189,67140,435699,804258,5021289,9238320,56191599,103144878,615724389,1128303900,6641519499,12154735098,70773675489,129392615880,746963079399,1364533542918,7822667714589,14280801886260,81404009431299,148527216976338,842636084881689,1536744952787040,8683724763935199,15830704575083358,89153522875416789,162476341175750220,912381705878751099,1662287070581751978,9311435352908759889,16960583635235767800,94802918176178838999,172645252717121910198,963226263585609550989
lpb $0
mov $2,$0
sub $0,1
seq $2,50720 ; Number of nonzero palindromes of length n containing the digit '0'.
add $3,$2
lpe
mov $0,$3
|
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/kart-init-j.asm | prismotizm/gigaleak | 0 | 87373 | <reponame>prismotizm/gigaleak
Name: kart-init-j.asm
Type: file
Size: 56517
Last-Modified: '1992-11-18T01:34:03Z'
SHA-1: E2702CB73BFEDED7B9E432261456C98AF12BE42D
Description: null
|
programs/oeis/277/A277178.asm | jmorken/loda | 1 | 93128 | <filename>programs/oeis/277/A277178.asm
; A277178: a(n) = Sum_{k=0..n} k*binomial(2*k,k)/2.
; 0,1,7,37,177,807,3579,15591,67071,285861,1209641,5089517,21314453,88918353,369734553,1533115953,6341759073,26177411943,107853629643,443633635743,1822098923943,7473806605563,30618895206483,125303348573883,512274592771083,2092407173242983,8539348101568335
mul $0,2
mov $1,4
lpb $0
mov $2,$0
cal $2,100071 ; a(n) = n * binomial(n-1, floor((n-1)/2)) = n * max_{i=0..n} binomial(n-1, i).
sub $0,1
add $1,$2
lpe
mul $1,5
sub $1,20
div $1,15
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.