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
libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sdcc_iy/bv_priority_queue_destroy_fastcall.asm
jpoikela/z88dk
640
18389
<reponame>jpoikela/z88dk ; void bv_priority_queue_destroy_fastcall(bv_priority_queue_t *q) SECTION code_clib SECTION code_adt_bv_priority_queue PUBLIC _bv_priority_queue_destroy_fastcall EXTERN asm_bv_priority_queue_destroy defc _bv_priority_queue_destroy_fastcall = asm_bv_priority_queue_destroy
test/Succeed/Issue1825.agda
redfish64/autonomic-agda
3
13191
<reponame>redfish64/autonomic-agda<gh_stars>1-10 -- Andreas, 2016-02-09, issue reported by <NAME> -- {-# OPTIONS -v tc.conv.infer:30 -v tc.deftype:30 #-} {-# OPTIONS --allow-unsolved-metas #-} data ⊥ : Set where data MaybeSet : Set₁ where nothing : MaybeSet just : Set → MaybeSet -- not injective FromJust : MaybeSet → Set FromJust nothing = ⊥ FromJust (just A) = A R0 : ⊥ → Set R0 () data C1 (A : Set) : Set where c1 : ⊥ → C1 A -- R1 is projection-like R1 : (A : Set) → C1 A → Set R1 A (c1 c) = R0 c -- R1 A (c1 ()) -- no int. err. record Iface : Set₁ where field Command : Set Response : Command → Set I1 : (A : Set) → Iface Iface.Command (I1 A) = C1 A Iface.Response (I1 A) = R1 A -- Iface.Response (I1 A) (c1 c) = R0 c -- no int.err. -- I1 A = record { Command = C1 A; Response = R1 A } -- no. int. err postulate IO : Iface → Set data C2 (s : MaybeSet) : Set₁ where c2 : (FromJust s → IO (I1 (FromJust s))) → C2 s data IOˢ : MaybeSet → Set₁ where do : {s : MaybeSet} (c : C2 s) → IOˢ s postulate bla : Set → ⊥ → IO (I1 ⊥) test : IOˢ nothing test = do (c2 (bla {!!}))
oeis/159/A159067.asm
loda-lang/loda-programs
11
23689
; A159067: A102370(n) modulo 9 . ; Submitted by <NAME>(w4) ; 0,3,6,5,4,6,1,0,8,2,5,4,1,5,0,8,7,1,4,3,2,4,8,7,6,0,3,7,8,3,7,6,5,8,2,1,0,2,6,5,4,7,1,0,6,1,5,4,3,6,0,8,7,0,4,3,2,5,0,3,4,8,3,2,1,4,7,6,5,7,2,1,0,3,6,5,2,6,1,0,8,2,5,4,3,5,0,8,7,1,4,8,0,4,8,7,6,0,3,2 mov $2,$0 add $0,1 mov $4,1 lpb $2 mul $4,2 mov $3,$4 mov $5,$0 add $0,1 mod $5,$4 cmp $5,0 mul $3,$5 add $1,$3 add $1,1 sub $2,1 lpe mov $0,$1 mod $0,9
programs/oeis/157/A157820.asm
jmorken/loda
1
25233
<filename>programs/oeis/157/A157820.asm ; A157820: 27225n^2 + 2n. ; 27227,108904,245031,435608,680635,980112,1334039,1742416,2205243,2722520,3294247,3920424,4601051,5336128,6125655,6969632,7868059,8820936,9828263,10890040,12006267,13176944,14402071,15681648,17015675,18404152,19847079,21344456,22896283,24502560,26163287,27878464,29648091,31472168,33350695,35283672,37271099,39312976,41409303,43560080,45765307,48024984,50339111,52707688,55130715,57608192,60140119,62726496,65367323,68062600,70812327,73616504,76475131,79388208,82355735,85377712,88454139,91585016,94770343,98010120,101304347,104653024,108056151,111513728,115025755,118592232,122213159,125888536,129618363,133402640,137241367,141134544,145082171,149084248,153140775,157251752,161417179,165637056,169911383,174240160,178623387,183061064,187553191,192099768,196700795,201356272,206066199,210830576,215649403,220522680,225450407,230432584,235469211,240560288,245705815,250905792,256160219,261469096,266832423,272250200,277722427,283249104,288830231,294465808,300155835,305900312,311699239,317552616,323460443,329422720,335439447,341510624,347636251,353816328,360050855,366339832,372683259,379081136,385533463,392040240,398601467,405217144,411887271,418611848,425390875,432224352,439112279,446054656,453051483,460102760,467208487,474368664,481583291,488852368,496175895,503553872,510986299,518473176,526014503,533610280,541260507,548965184,556724311,564537888,572405915,580328392,588305319,596336696,604422523,612562800,620757527,629006704,637310331,645668408,654080935,662547912,671069339,679645216,688275543,696960320,705699547,714493224,723341351,732243928,741200955,750212432,759278359,768398736,777573563,786802840,796086567,805424744,814817371,824264448,833765975,843321952,852932379,862597256,872316583,882090360,891918587,901801264,911738391,921729968,931775995,941876472,952031399,962240776,972504603,982822880,993195607,1003622784,1014104411,1024640488,1035231015,1045875992,1056575419,1067329296,1078137623,1089000400,1099917627,1110889304,1121915431,1132996008,1144131035,1155320512,1166564439,1177862816,1189215643,1200622920,1212084647,1223600824,1235171451,1246796528,1258476055,1270210032,1281998459,1293841336,1305738663,1317690440,1329696667,1341757344,1353872471,1366042048,1378266075,1390544552,1402877479,1415264856,1427706683,1440202960,1452753687,1465358864,1478018491,1490732568,1503501095,1516324072,1529201499,1542133376,1555119703,1568160480,1581255707,1594405384,1607609511,1620868088,1634181115,1647548592,1660970519,1674446896,1687977723,1701563000 mov $5,$0 add $5,3 mov $6,$0 mul $0,2 add $0,$5 lpb $0 mul $0,5 mov $3,$0 mov $0,1 mul $3,11 mov $4,1 mov $5,$3 lpe pow $5,2 mov $1,$5 add $1,$4 add $1,1 mov $2,$6 mul $2,2 add $1,$2
libsrc/target/tvc/sound/tvc_is_os_sound_playing.asm
dikdom/z88dk
0
247117
; Videoton TV Computer ASM stub ; <NAME> - 2022 ; ; Returns if OS is playing a sound or not ; SECTION code_clib PUBLIC tvc_is_os_sound_playing INCLUDE "target/tvc/def/tvc.def" ; ; Returns false (0) if no sound is being played, true (1) otherwise ; .tvc_is_os_sound_playing ._tvc_is_os_sound_playing ld h,0 ld l,h ld a,(SND_ACTIVE) or a ret z inc l ret
data/jpred4/jp_batch_1613899824__bujqmtH/jp_batch_1613899824__bujqmtH.als
jonriege/predict-protein-structure
0
2162
SILENT_MODE BLOCK_FILE jp_batch_1613899824__bujqmtH.concise.blc MAX_NSEQ 1002 MAX_INPUT_LEN 1004 OUTPUT_FILE jp_batch_1613899824__bujqmtH.concise.ps PORTRAIT POINTSIZE 8 IDENT_WIDTH 12 X_OFFSET 2 Y_OFFSET 2 DEFINE_FONT 0 Helvetica DEFAULT DEFINE_FONT 1 Helvetica REL 0.75 DEFINE_FONT 7 Helvetica REL 0.6 DEFINE_FONT 3 Helvetica-Bold DEFAULT DEFINE_FONT 4 Times-Bold DEFAULT DEFINE_FONT 5 Helvetica-BoldOblique DEFAULT # DEFINE_COLOUR 3 1 0.62 0.67 # Turquiose DEFINE_COLOUR 4 1 1 0 # Yellow DEFINE_COLOUR 5 1 0 0 # Red DEFINE_COLOUR 7 1 0 1 # Purple DEFINE_COLOUR 8 0 0 1 # Blue DEFINE_COLOUR 9 0 1 0 # Green DEFINE_COLOUR 10 0.41 0.64 1.00 # Pale blue DEFINE_COLOUR 11 0.41 0.82 0.67 # Pale green DEFINE_COLOUR 50 0.69 0.18 0.37 # Pink (helix) DEFINE_COLOUR 51 1.00 0.89 0.00 # Gold (strand) NUMBER_INT 10 SETUP # # Highlight specific residues. # Avoid highlighting Lupas 'C' predictions by # limiting the highlighting to the alignments Scol_CHARS C 1 1 83 991 4 Ccol_CHARS H ALL 5 Ccol_CHARS P ALL 8 SURROUND_CHARS LIV ALL # # Replace known structure types with whitespace SUB_CHARS 1 992 83 1001 H SPACE SUB_CHARS 1 992 83 1001 E SPACE SUB_CHARS 1 992 83 1001 - SPACE HELIX 5 995 16 COLOUR_TEXT_REGION 5 995 16 995 50 HELIX 45 995 53 COLOUR_TEXT_REGION 45 995 53 995 50 HELIX 70 995 81 COLOUR_TEXT_REGION 70 995 81 995 50 HELIX 4 1000 15 COLOUR_TEXT_REGION 4 1000 15 1000 50 HELIX 45 1000 51 COLOUR_TEXT_REGION 45 1000 51 1000 50 HELIX 70 1000 81 COLOUR_TEXT_REGION 70 1000 81 1000 50 STRAND 18 1001 19 COLOUR_TEXT_REGION 18 1001 19 1001 51 HELIX 7 1001 17 COLOUR_TEXT_REGION 7 1001 17 1001 50 HELIX 35 1001 41 COLOUR_TEXT_REGION 35 1001 41 1001 50 HELIX 45 1001 54 COLOUR_TEXT_REGION 45 1001 54 1001 50 HELIX 70 1001 81 COLOUR_TEXT_REGION 70 1001 81 1001 50
libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_ix/cm48_sdccix_fabs.asm
meesokim/z88dk
0
83806
; float fabs(float x) SECTION code_fp_math48 PUBLIC cm48_sdccix_fabs EXTERN cm48_sdccix_fabs_fastcall cm48_sdccix_fabs: pop af pop hl pop de push de push hl push af jp cm48_sdccix_fabs_fastcall
AssemblyExamples/using_gdb/debug.asm
jude-arokiam-uoit/csci-2050-assembly-examples
1
6479
extern printf global main section .text main: mov rdi, format ; argument #1 mov rsi, message ; argument #2 mov rax, 0 call printf ; call printf mov rax, 0 ret ; return 0 section .data message: db "Hello, world!", 0 format: db "%s", 0xa, 0 courseCode: dq 2050
programs/oeis/180/A180103.asm
karttu/loda
1
89749
<reponame>karttu/loda<gh_stars>1-10 ; A180103: Floor( 100*(n-1)/n ). ; 50,66,75,80,83,85,87,88,90,90,91,92,92,93,93,94,94,94,95,95,95,95,95,96,96,96,96,96,96,96,96,96,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,98,98,98,98,98,98,98,98,98,98,98,98,98,98,98 mov $1,$0 mul $0,5 mov $2,$1 mov $1,10 mul $1,$0 add $2,2 div $1,$2 add $1,50
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce3706c.ada
best08618/asylo
7
28104
-- CE3706C.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT INTEGER_IO PUT RAISES CONSTRAINT_ERROR IF: -- A) THE BASE IS OUTSIDE THE RANGE 2..16. -- B) THE VALUE OF WIDTH IS NEGATIVE OR GREATER THAN FIELD'LAST, -- WHEN FIELD'LAST < INTEGER'LAST. -- C) THE VALUE OF ITEM IS OUTSIDE THE RANGE OF THE INSTANTIATED -- TYPE. -- HISTORY: -- SPS 10/05/82 -- JBG 08/30/83 -- JLH 09/10/87 ADDED CASES FOR THE VALUE OF THE WIDTH BEING LESS -- THAN ZERO AND GREATER THAN FIELD'LAST AND CASES FOR -- THE VALUE OF ITEM OUTSIDE THE RANGE OF THE -- INSTANTIATED TYPE. -- JRL 06/07/96 Added call to Ident_Int in expressions involving -- Field'Last, to make the expressions non-static and -- prevent compile-time rejection. WITH REPORT; USE REPORT; WITH TEXT_IO; USE TEXT_IO; PROCEDURE CE3706C IS BEGIN TEST ("CE3706C", "CHECK THAT INTEGER_IO PUT RAISES CONSTRAINT " & "ERROR APPROPRIATELY"); DECLARE FT : FILE_TYPE; TYPE INT IS NEW INTEGER RANGE 1 .. 10; PACKAGE IIO IS NEW INTEGER_IO (INT); USE IIO; ST : STRING (1 .. 10); BEGIN BEGIN PUT (FT, 2, 6, 1); FAILED ("CONSTRAINT_ERROR NOT RAISED - FILE - 1"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - FILE - 1"); END; BEGIN PUT (3, 4, 17); FAILED ("CONSTRAINT_ERROR NOT RAISED - DEFAULT - 1"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - DEFAULT - 1"); END; BEGIN PUT (TO => ST, ITEM => 4, BASE => -3); FAILED ("CONSTRAINT_ERROR NOT RAISED - STRING - 1"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - STRING - 1"); END; BEGIN PUT (ST, 5, 17); FAILED ("CONSTRAINT_ERROR NOT RAISED - STRING - 2"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - STRING - 2"); END; BEGIN PUT (FT, 5, -1); FAILED ("CONSTRAINT_ERROR NOT RAISED - FILE - 2"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - FILE - 2"); END; BEGIN PUT (7, -3); FAILED ("CONSTRAINT_ERROR NOT RAISED - DEFAULT - " & "2"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED - DEFAULT - 2"); END; IF FIELD'LAST < INTEGER'LAST THEN BEGIN PUT (7, FIELD'LAST+Ident_Int(1)); FAILED ("CONSTRAINT_ERROR NOT RAISED FOR WIDTH " & "GREATER THAN FIELD'LAST"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED FOR WIDTH " & "GREATER THAN FIELD'LAST"); END; END IF; BEGIN PUT (FT, 11); FAILED ("CONSTRAINT_ERROR NOT RAISED FOR ITEM OUTSIDE " & "RANGE - FILE"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED FOR ITEM OUTSIDE " & "RANGE - FILE"); END; BEGIN PUT (11); FAILED ("CONSTRAINT_ERROR NOT RAISED FOR ITEM OUTSIDE " & "RANGE - DEFAULT"); EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION RAISED FOR ITEM OUTSIDE " & "RANGE - DEFAULT"); END; END; RESULT; END CE3706C;
libsrc/_DEVELOPMENT/threads/mutex/c/sccz80/call_once_callee.asm
jpoikela/z88dk
640
82109
; void call_once_callee(once_flag *flag, void (*func)(void)) SECTION code_clib SECTION code_threads_mutex PUBLIC call_once_callee EXTERN asm_call_once call_once_callee: pop hl pop de ex (sp),hl jp asm_call_once
deps/openssl/config/archs/VC-WIN64A/asm_avx2/crypto/bn/x86_64-mont5.asm
krithiva/node-http-demo1
0
174950
default rel %define XMMWORD %define YMMWORD %define ZMMWORD section .text code align=64 EXTERN OPENSSL_ia32cap_P global bn_mul_mont_gather5 ALIGN 64 bn_mul_mont_gather5: mov QWORD[8+rsp],rdi ;WIN64 prologue mov QWORD[16+rsp],rsi mov rax,rsp $L$SEH_begin_bn_mul_mont_gather5: mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 mov r8,QWORD[40+rsp] mov r9,QWORD[48+rsp] mov r9d,r9d mov rax,rsp test r9d,7 jnz NEAR $L$mul_enter mov r11d,DWORD[((OPENSSL_ia32cap_P+8))] jmp NEAR $L$mul4x_enter ALIGN 16 $L$mul_enter: movd xmm5,DWORD[56+rsp] push rbx push rbp push r12 push r13 push r14 push r15 neg r9 mov r11,rsp lea r10,[((-280))+r9*8+rsp] neg r9 and r10,-1024 sub r11,r10 and r11,-4096 lea rsp,[r11*1+r10] mov r11,QWORD[rsp] cmp rsp,r10 ja NEAR $L$mul_page_walk jmp NEAR $L$mul_page_walk_done $L$mul_page_walk: lea rsp,[((-4096))+rsp] mov r11,QWORD[rsp] cmp rsp,r10 ja NEAR $L$mul_page_walk $L$mul_page_walk_done: lea r10,[$L$inc] mov QWORD[8+r9*8+rsp],rax $L$mul_body: lea r12,[128+rdx] movdqa xmm0,XMMWORD[r10] movdqa xmm1,XMMWORD[16+r10] lea r10,[((24-112))+r9*8+rsp] and r10,-16 pshufd xmm5,xmm5,0 movdqa xmm4,xmm1 movdqa xmm2,xmm1 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 DB 0x67 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[112+r10],xmm0 movdqa xmm0,xmm4 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[128+r10],xmm1 movdqa xmm1,xmm4 paddd xmm0,xmm3 pcmpeqd xmm3,xmm5 movdqa XMMWORD[144+r10],xmm2 movdqa xmm2,xmm4 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa XMMWORD[160+r10],xmm3 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[176+r10],xmm0 movdqa xmm0,xmm4 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[192+r10],xmm1 movdqa xmm1,xmm4 paddd xmm0,xmm3 pcmpeqd xmm3,xmm5 movdqa XMMWORD[208+r10],xmm2 movdqa xmm2,xmm4 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa XMMWORD[224+r10],xmm3 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[240+r10],xmm0 movdqa xmm0,xmm4 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[256+r10],xmm1 movdqa xmm1,xmm4 paddd xmm0,xmm3 pcmpeqd xmm3,xmm5 movdqa XMMWORD[272+r10],xmm2 movdqa xmm2,xmm4 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa XMMWORD[288+r10],xmm3 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[304+r10],xmm0 paddd xmm3,xmm2 DB 0x67 pcmpeqd xmm2,xmm5 movdqa XMMWORD[320+r10],xmm1 pcmpeqd xmm3,xmm5 movdqa XMMWORD[336+r10],xmm2 pand xmm0,XMMWORD[64+r12] pand xmm1,XMMWORD[80+r12] pand xmm2,XMMWORD[96+r12] movdqa XMMWORD[352+r10],xmm3 pand xmm3,XMMWORD[112+r12] por xmm0,xmm2 por xmm1,xmm3 movdqa xmm4,XMMWORD[((-128))+r12] movdqa xmm5,XMMWORD[((-112))+r12] movdqa xmm2,XMMWORD[((-96))+r12] pand xmm4,XMMWORD[112+r10] movdqa xmm3,XMMWORD[((-80))+r12] pand xmm5,XMMWORD[128+r10] por xmm0,xmm4 pand xmm2,XMMWORD[144+r10] por xmm1,xmm5 pand xmm3,XMMWORD[160+r10] por xmm0,xmm2 por xmm1,xmm3 movdqa xmm4,XMMWORD[((-64))+r12] movdqa xmm5,XMMWORD[((-48))+r12] movdqa xmm2,XMMWORD[((-32))+r12] pand xmm4,XMMWORD[176+r10] movdqa xmm3,XMMWORD[((-16))+r12] pand xmm5,XMMWORD[192+r10] por xmm0,xmm4 pand xmm2,XMMWORD[208+r10] por xmm1,xmm5 pand xmm3,XMMWORD[224+r10] por xmm0,xmm2 por xmm1,xmm3 movdqa xmm4,XMMWORD[r12] movdqa xmm5,XMMWORD[16+r12] movdqa xmm2,XMMWORD[32+r12] pand xmm4,XMMWORD[240+r10] movdqa xmm3,XMMWORD[48+r12] pand xmm5,XMMWORD[256+r10] por xmm0,xmm4 pand xmm2,XMMWORD[272+r10] por xmm1,xmm5 pand xmm3,XMMWORD[288+r10] por xmm0,xmm2 por xmm1,xmm3 por xmm0,xmm1 pshufd xmm1,xmm0,0x4e por xmm0,xmm1 lea r12,[256+r12] DB 102,72,15,126,195 mov r8,QWORD[r8] mov rax,QWORD[rsi] xor r14,r14 xor r15,r15 mov rbp,r8 mul rbx mov r10,rax mov rax,QWORD[rcx] imul rbp,r10 mov r11,rdx mul rbp add r10,rax mov rax,QWORD[8+rsi] adc rdx,0 mov r13,rdx lea r15,[1+r15] jmp NEAR $L$1st_enter ALIGN 16 $L$1st: add r13,rax mov rax,QWORD[r15*8+rsi] adc rdx,0 add r13,r11 mov r11,r10 adc rdx,0 mov QWORD[((-16))+r15*8+rsp],r13 mov r13,rdx $L$1st_enter: mul rbx add r11,rax mov rax,QWORD[r15*8+rcx] adc rdx,0 lea r15,[1+r15] mov r10,rdx mul rbp cmp r15,r9 jne NEAR $L$1st add r13,rax adc rdx,0 add r13,r11 adc rdx,0 mov QWORD[((-16))+r9*8+rsp],r13 mov r13,rdx mov r11,r10 xor rdx,rdx add r13,r11 adc rdx,0 mov QWORD[((-8))+r9*8+rsp],r13 mov QWORD[r9*8+rsp],rdx lea r14,[1+r14] jmp NEAR $L$outer ALIGN 16 $L$outer: lea rdx,[((24+128))+r9*8+rsp] and rdx,-16 pxor xmm4,xmm4 pxor xmm5,xmm5 movdqa xmm0,XMMWORD[((-128))+r12] movdqa xmm1,XMMWORD[((-112))+r12] movdqa xmm2,XMMWORD[((-96))+r12] movdqa xmm3,XMMWORD[((-80))+r12] pand xmm0,XMMWORD[((-128))+rdx] pand xmm1,XMMWORD[((-112))+rdx] por xmm4,xmm0 pand xmm2,XMMWORD[((-96))+rdx] por xmm5,xmm1 pand xmm3,XMMWORD[((-80))+rdx] por xmm4,xmm2 por xmm5,xmm3 movdqa xmm0,XMMWORD[((-64))+r12] movdqa xmm1,XMMWORD[((-48))+r12] movdqa xmm2,XMMWORD[((-32))+r12] movdqa xmm3,XMMWORD[((-16))+r12] pand xmm0,XMMWORD[((-64))+rdx] pand xmm1,XMMWORD[((-48))+rdx] por xmm4,xmm0 pand xmm2,XMMWORD[((-32))+rdx] por xmm5,xmm1 pand xmm3,XMMWORD[((-16))+rdx] por xmm4,xmm2 por xmm5,xmm3 movdqa xmm0,XMMWORD[r12] movdqa xmm1,XMMWORD[16+r12] movdqa xmm2,XMMWORD[32+r12] movdqa xmm3,XMMWORD[48+r12] pand xmm0,XMMWORD[rdx] pand xmm1,XMMWORD[16+rdx] por xmm4,xmm0 pand xmm2,XMMWORD[32+rdx] por xmm5,xmm1 pand xmm3,XMMWORD[48+rdx] por xmm4,xmm2 por xmm5,xmm3 movdqa xmm0,XMMWORD[64+r12] movdqa xmm1,XMMWORD[80+r12] movdqa xmm2,XMMWORD[96+r12] movdqa xmm3,XMMWORD[112+r12] pand xmm0,XMMWORD[64+rdx] pand xmm1,XMMWORD[80+rdx] por xmm4,xmm0 pand xmm2,XMMWORD[96+rdx] por xmm5,xmm1 pand xmm3,XMMWORD[112+rdx] por xmm4,xmm2 por xmm5,xmm3 por xmm4,xmm5 pshufd xmm0,xmm4,0x4e por xmm0,xmm4 lea r12,[256+r12] mov rax,QWORD[rsi] DB 102,72,15,126,195 xor r15,r15 mov rbp,r8 mov r10,QWORD[rsp] mul rbx add r10,rax mov rax,QWORD[rcx] adc rdx,0 imul rbp,r10 mov r11,rdx mul rbp add r10,rax mov rax,QWORD[8+rsi] adc rdx,0 mov r10,QWORD[8+rsp] mov r13,rdx lea r15,[1+r15] jmp NEAR $L$inner_enter ALIGN 16 $L$inner: add r13,rax mov rax,QWORD[r15*8+rsi] adc rdx,0 add r13,r10 mov r10,QWORD[r15*8+rsp] adc rdx,0 mov QWORD[((-16))+r15*8+rsp],r13 mov r13,rdx $L$inner_enter: mul rbx add r11,rax mov rax,QWORD[r15*8+rcx] adc rdx,0 add r10,r11 mov r11,rdx adc r11,0 lea r15,[1+r15] mul rbp cmp r15,r9 jne NEAR $L$inner add r13,rax adc rdx,0 add r13,r10 mov r10,QWORD[r9*8+rsp] adc rdx,0 mov QWORD[((-16))+r9*8+rsp],r13 mov r13,rdx xor rdx,rdx add r13,r11 adc rdx,0 add r13,r10 adc rdx,0 mov QWORD[((-8))+r9*8+rsp],r13 mov QWORD[r9*8+rsp],rdx lea r14,[1+r14] cmp r14,r9 jb NEAR $L$outer xor r14,r14 mov rax,QWORD[rsp] lea rsi,[rsp] mov r15,r9 jmp NEAR $L$sub ALIGN 16 $L$sub: sbb rax,QWORD[r14*8+rcx] mov QWORD[r14*8+rdi],rax mov rax,QWORD[8+r14*8+rsi] lea r14,[1+r14] dec r15 jnz NEAR $L$sub sbb rax,0 mov rbx,-1 xor rbx,rax xor r14,r14 mov r15,r9 $L$copy: mov rcx,QWORD[r14*8+rdi] mov rdx,QWORD[r14*8+rsp] and rcx,rbx and rdx,rax mov QWORD[r14*8+rsp],r14 or rdx,rcx mov QWORD[r14*8+rdi],rdx lea r14,[1+r14] sub r15,1 jnz NEAR $L$copy mov rsi,QWORD[8+r9*8+rsp] mov rax,1 mov r15,QWORD[((-48))+rsi] mov r14,QWORD[((-40))+rsi] mov r13,QWORD[((-32))+rsi] mov r12,QWORD[((-24))+rsi] mov rbp,QWORD[((-16))+rsi] mov rbx,QWORD[((-8))+rsi] lea rsp,[rsi] $L$mul_epilogue: mov rdi,QWORD[8+rsp] ;WIN64 epilogue mov rsi,QWORD[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_bn_mul_mont_gather5: ALIGN 32 bn_mul4x_mont_gather5: mov QWORD[8+rsp],rdi ;WIN64 prologue mov QWORD[16+rsp],rsi mov rax,rsp $L$SEH_begin_bn_mul4x_mont_gather5: mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 mov r8,QWORD[40+rsp] mov r9,QWORD[48+rsp] DB 0x67 mov rax,rsp $L$mul4x_enter: and r11d,0x80108 cmp r11d,0x80108 je NEAR $L$mulx4x_enter push rbx push rbp push r12 push r13 push r14 push r15 $L$mul4x_prologue: DB 0x67 shl r9d,3 lea r10,[r9*2+r9] neg r9 lea r11,[((-320))+r9*2+rsp] mov rbp,rsp sub r11,rdi and r11,4095 cmp r10,r11 jb NEAR $L$mul4xsp_alt sub rbp,r11 lea rbp,[((-320))+r9*2+rbp] jmp NEAR $L$mul4xsp_done ALIGN 32 $L$mul4xsp_alt: lea r10,[((4096-320))+r9*2] lea rbp,[((-320))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 sub rbp,r11 $L$mul4xsp_done: and rbp,-64 mov r11,rsp sub r11,rbp and r11,-4096 lea rsp,[rbp*1+r11] mov r10,QWORD[rsp] cmp rsp,rbp ja NEAR $L$mul4x_page_walk jmp NEAR $L$mul4x_page_walk_done $L$mul4x_page_walk: lea rsp,[((-4096))+rsp] mov r10,QWORD[rsp] cmp rsp,rbp ja NEAR $L$mul4x_page_walk $L$mul4x_page_walk_done: neg r9 mov QWORD[40+rsp],rax $L$mul4x_body: call mul4x_internal mov rsi,QWORD[40+rsp] mov rax,1 mov r15,QWORD[((-48))+rsi] mov r14,QWORD[((-40))+rsi] mov r13,QWORD[((-32))+rsi] mov r12,QWORD[((-24))+rsi] mov rbp,QWORD[((-16))+rsi] mov rbx,QWORD[((-8))+rsi] lea rsp,[rsi] $L$mul4x_epilogue: mov rdi,QWORD[8+rsp] ;WIN64 epilogue mov rsi,QWORD[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_bn_mul4x_mont_gather5: ALIGN 32 mul4x_internal: shl r9,5 movd xmm5,DWORD[56+rax] lea rax,[$L$inc] lea r13,[128+r9*1+rdx] shr r9,5 movdqa xmm0,XMMWORD[rax] movdqa xmm1,XMMWORD[16+rax] lea r10,[((88-112))+r9*1+rsp] lea r12,[128+rdx] pshufd xmm5,xmm5,0 movdqa xmm4,xmm1 DB 0x67,0x67 movdqa xmm2,xmm1 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 DB 0x67 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[112+r10],xmm0 movdqa xmm0,xmm4 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[128+r10],xmm1 movdqa xmm1,xmm4 paddd xmm0,xmm3 pcmpeqd xmm3,xmm5 movdqa XMMWORD[144+r10],xmm2 movdqa xmm2,xmm4 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa XMMWORD[160+r10],xmm3 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[176+r10],xmm0 movdqa xmm0,xmm4 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[192+r10],xmm1 movdqa xmm1,xmm4 paddd xmm0,xmm3 pcmpeqd xmm3,xmm5 movdqa XMMWORD[208+r10],xmm2 movdqa xmm2,xmm4 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa XMMWORD[224+r10],xmm3 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[240+r10],xmm0 movdqa xmm0,xmm4 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[256+r10],xmm1 movdqa xmm1,xmm4 paddd xmm0,xmm3 pcmpeqd xmm3,xmm5 movdqa XMMWORD[272+r10],xmm2 movdqa xmm2,xmm4 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa XMMWORD[288+r10],xmm3 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[304+r10],xmm0 paddd xmm3,xmm2 DB 0x67 pcmpeqd xmm2,xmm5 movdqa XMMWORD[320+r10],xmm1 pcmpeqd xmm3,xmm5 movdqa XMMWORD[336+r10],xmm2 pand xmm0,XMMWORD[64+r12] pand xmm1,XMMWORD[80+r12] pand xmm2,XMMWORD[96+r12] movdqa XMMWORD[352+r10],xmm3 pand xmm3,XMMWORD[112+r12] por xmm0,xmm2 por xmm1,xmm3 movdqa xmm4,XMMWORD[((-128))+r12] movdqa xmm5,XMMWORD[((-112))+r12] movdqa xmm2,XMMWORD[((-96))+r12] pand xmm4,XMMWORD[112+r10] movdqa xmm3,XMMWORD[((-80))+r12] pand xmm5,XMMWORD[128+r10] por xmm0,xmm4 pand xmm2,XMMWORD[144+r10] por xmm1,xmm5 pand xmm3,XMMWORD[160+r10] por xmm0,xmm2 por xmm1,xmm3 movdqa xmm4,XMMWORD[((-64))+r12] movdqa xmm5,XMMWORD[((-48))+r12] movdqa xmm2,XMMWORD[((-32))+r12] pand xmm4,XMMWORD[176+r10] movdqa xmm3,XMMWORD[((-16))+r12] pand xmm5,XMMWORD[192+r10] por xmm0,xmm4 pand xmm2,XMMWORD[208+r10] por xmm1,xmm5 pand xmm3,XMMWORD[224+r10] por xmm0,xmm2 por xmm1,xmm3 movdqa xmm4,XMMWORD[r12] movdqa xmm5,XMMWORD[16+r12] movdqa xmm2,XMMWORD[32+r12] pand xmm4,XMMWORD[240+r10] movdqa xmm3,XMMWORD[48+r12] pand xmm5,XMMWORD[256+r10] por xmm0,xmm4 pand xmm2,XMMWORD[272+r10] por xmm1,xmm5 pand xmm3,XMMWORD[288+r10] por xmm0,xmm2 por xmm1,xmm3 por xmm0,xmm1 pshufd xmm1,xmm0,0x4e por xmm0,xmm1 lea r12,[256+r12] DB 102,72,15,126,195 mov QWORD[((16+8))+rsp],r13 mov QWORD[((56+8))+rsp],rdi mov r8,QWORD[r8] mov rax,QWORD[rsi] lea rsi,[r9*1+rsi] neg r9 mov rbp,r8 mul rbx mov r10,rax mov rax,QWORD[rcx] imul rbp,r10 lea r14,[((64+8))+rsp] mov r11,rdx mul rbp add r10,rax mov rax,QWORD[8+r9*1+rsi] adc rdx,0 mov rdi,rdx mul rbx add r11,rax mov rax,QWORD[8+rcx] adc rdx,0 mov r10,rdx mul rbp add rdi,rax mov rax,QWORD[16+r9*1+rsi] adc rdx,0 add rdi,r11 lea r15,[32+r9] lea rcx,[32+rcx] adc rdx,0 mov QWORD[r14],rdi mov r13,rdx jmp NEAR $L$1st4x ALIGN 32 $L$1st4x: mul rbx add r10,rax mov rax,QWORD[((-16))+rcx] lea r14,[32+r14] adc rdx,0 mov r11,rdx mul rbp add r13,rax mov rax,QWORD[((-8))+r15*1+rsi] adc rdx,0 add r13,r10 adc rdx,0 mov QWORD[((-24))+r14],r13 mov rdi,rdx mul rbx add r11,rax mov rax,QWORD[((-8))+rcx] adc rdx,0 mov r10,rdx mul rbp add rdi,rax mov rax,QWORD[r15*1+rsi] adc rdx,0 add rdi,r11 adc rdx,0 mov QWORD[((-16))+r14],rdi mov r13,rdx mul rbx add r10,rax mov rax,QWORD[rcx] adc rdx,0 mov r11,rdx mul rbp add r13,rax mov rax,QWORD[8+r15*1+rsi] adc rdx,0 add r13,r10 adc rdx,0 mov QWORD[((-8))+r14],r13 mov rdi,rdx mul rbx add r11,rax mov rax,QWORD[8+rcx] adc rdx,0 mov r10,rdx mul rbp add rdi,rax mov rax,QWORD[16+r15*1+rsi] adc rdx,0 add rdi,r11 lea rcx,[32+rcx] adc rdx,0 mov QWORD[r14],rdi mov r13,rdx add r15,32 jnz NEAR $L$1st4x mul rbx add r10,rax mov rax,QWORD[((-16))+rcx] lea r14,[32+r14] adc rdx,0 mov r11,rdx mul rbp add r13,rax mov rax,QWORD[((-8))+rsi] adc rdx,0 add r13,r10 adc rdx,0 mov QWORD[((-24))+r14],r13 mov rdi,rdx mul rbx add r11,rax mov rax,QWORD[((-8))+rcx] adc rdx,0 mov r10,rdx mul rbp add rdi,rax mov rax,QWORD[r9*1+rsi] adc rdx,0 add rdi,r11 adc rdx,0 mov QWORD[((-16))+r14],rdi mov r13,rdx lea rcx,[r9*1+rcx] xor rdi,rdi add r13,r10 adc rdi,0 mov QWORD[((-8))+r14],r13 jmp NEAR $L$outer4x ALIGN 32 $L$outer4x: lea rdx,[((16+128))+r14] pxor xmm4,xmm4 pxor xmm5,xmm5 movdqa xmm0,XMMWORD[((-128))+r12] movdqa xmm1,XMMWORD[((-112))+r12] movdqa xmm2,XMMWORD[((-96))+r12] movdqa xmm3,XMMWORD[((-80))+r12] pand xmm0,XMMWORD[((-128))+rdx] pand xmm1,XMMWORD[((-112))+rdx] por xmm4,xmm0 pand xmm2,XMMWORD[((-96))+rdx] por xmm5,xmm1 pand xmm3,XMMWORD[((-80))+rdx] por xmm4,xmm2 por xmm5,xmm3 movdqa xmm0,XMMWORD[((-64))+r12] movdqa xmm1,XMMWORD[((-48))+r12] movdqa xmm2,XMMWORD[((-32))+r12] movdqa xmm3,XMMWORD[((-16))+r12] pand xmm0,XMMWORD[((-64))+rdx] pand xmm1,XMMWORD[((-48))+rdx] por xmm4,xmm0 pand xmm2,XMMWORD[((-32))+rdx] por xmm5,xmm1 pand xmm3,XMMWORD[((-16))+rdx] por xmm4,xmm2 por xmm5,xmm3 movdqa xmm0,XMMWORD[r12] movdqa xmm1,XMMWORD[16+r12] movdqa xmm2,XMMWORD[32+r12] movdqa xmm3,XMMWORD[48+r12] pand xmm0,XMMWORD[rdx] pand xmm1,XMMWORD[16+rdx] por xmm4,xmm0 pand xmm2,XMMWORD[32+rdx] por xmm5,xmm1 pand xmm3,XMMWORD[48+rdx] por xmm4,xmm2 por xmm5,xmm3 movdqa xmm0,XMMWORD[64+r12] movdqa xmm1,XMMWORD[80+r12] movdqa xmm2,XMMWORD[96+r12] movdqa xmm3,XMMWORD[112+r12] pand xmm0,XMMWORD[64+rdx] pand xmm1,XMMWORD[80+rdx] por xmm4,xmm0 pand xmm2,XMMWORD[96+rdx] por xmm5,xmm1 pand xmm3,XMMWORD[112+rdx] por xmm4,xmm2 por xmm5,xmm3 por xmm4,xmm5 pshufd xmm0,xmm4,0x4e por xmm0,xmm4 lea r12,[256+r12] DB 102,72,15,126,195 mov r10,QWORD[r9*1+r14] mov rbp,r8 mul rbx add r10,rax mov rax,QWORD[rcx] adc rdx,0 imul rbp,r10 mov r11,rdx mov QWORD[r14],rdi lea r14,[r9*1+r14] mul rbp add r10,rax mov rax,QWORD[8+r9*1+rsi] adc rdx,0 mov rdi,rdx mul rbx add r11,rax mov rax,QWORD[8+rcx] adc rdx,0 add r11,QWORD[8+r14] adc rdx,0 mov r10,rdx mul rbp add rdi,rax mov rax,QWORD[16+r9*1+rsi] adc rdx,0 add rdi,r11 lea r15,[32+r9] lea rcx,[32+rcx] adc rdx,0 mov r13,rdx jmp NEAR $L$inner4x ALIGN 32 $L$inner4x: mul rbx add r10,rax mov rax,QWORD[((-16))+rcx] adc rdx,0 add r10,QWORD[16+r14] lea r14,[32+r14] adc rdx,0 mov r11,rdx mul rbp add r13,rax mov rax,QWORD[((-8))+r15*1+rsi] adc rdx,0 add r13,r10 adc rdx,0 mov QWORD[((-32))+r14],rdi mov rdi,rdx mul rbx add r11,rax mov rax,QWORD[((-8))+rcx] adc rdx,0 add r11,QWORD[((-8))+r14] adc rdx,0 mov r10,rdx mul rbp add rdi,rax mov rax,QWORD[r15*1+rsi] adc rdx,0 add rdi,r11 adc rdx,0 mov QWORD[((-24))+r14],r13 mov r13,rdx mul rbx add r10,rax mov rax,QWORD[rcx] adc rdx,0 add r10,QWORD[r14] adc rdx,0 mov r11,rdx mul rbp add r13,rax mov rax,QWORD[8+r15*1+rsi] adc rdx,0 add r13,r10 adc rdx,0 mov QWORD[((-16))+r14],rdi mov rdi,rdx mul rbx add r11,rax mov rax,QWORD[8+rcx] adc rdx,0 add r11,QWORD[8+r14] adc rdx,0 mov r10,rdx mul rbp add rdi,rax mov rax,QWORD[16+r15*1+rsi] adc rdx,0 add rdi,r11 lea rcx,[32+rcx] adc rdx,0 mov QWORD[((-8))+r14],r13 mov r13,rdx add r15,32 jnz NEAR $L$inner4x mul rbx add r10,rax mov rax,QWORD[((-16))+rcx] adc rdx,0 add r10,QWORD[16+r14] lea r14,[32+r14] adc rdx,0 mov r11,rdx mul rbp add r13,rax mov rax,QWORD[((-8))+rsi] adc rdx,0 add r13,r10 adc rdx,0 mov QWORD[((-32))+r14],rdi mov rdi,rdx mul rbx add r11,rax mov rax,rbp mov rbp,QWORD[((-8))+rcx] adc rdx,0 add r11,QWORD[((-8))+r14] adc rdx,0 mov r10,rdx mul rbp add rdi,rax mov rax,QWORD[r9*1+rsi] adc rdx,0 add rdi,r11 adc rdx,0 mov QWORD[((-24))+r14],r13 mov r13,rdx mov QWORD[((-16))+r14],rdi lea rcx,[r9*1+rcx] xor rdi,rdi add r13,r10 adc rdi,0 add r13,QWORD[r14] adc rdi,0 mov QWORD[((-8))+r14],r13 cmp r12,QWORD[((16+8))+rsp] jb NEAR $L$outer4x xor rax,rax sub rbp,r13 adc r15,r15 or rdi,r15 sub rax,rdi lea rbx,[r9*1+r14] mov r12,QWORD[rcx] lea rbp,[rcx] mov rcx,r9 sar rcx,3+2 mov rdi,QWORD[((56+8))+rsp] dec r12 xor r10,r10 mov r13,QWORD[8+rbp] mov r14,QWORD[16+rbp] mov r15,QWORD[24+rbp] jmp NEAR $L$sqr4x_sub_entry global bn_power5 ALIGN 32 bn_power5: mov QWORD[8+rsp],rdi ;WIN64 prologue mov QWORD[16+rsp],rsi mov rax,rsp $L$SEH_begin_bn_power5: mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 mov r8,QWORD[40+rsp] mov r9,QWORD[48+rsp] mov rax,rsp mov r11d,DWORD[((OPENSSL_ia32cap_P+8))] and r11d,0x80108 cmp r11d,0x80108 je NEAR $L$powerx5_enter push rbx push rbp push r12 push r13 push r14 push r15 $L$power5_prologue: shl r9d,3 lea r10d,[r9*2+r9] neg r9 mov r8,QWORD[r8] lea r11,[((-320))+r9*2+rsp] mov rbp,rsp sub r11,rdi and r11,4095 cmp r10,r11 jb NEAR $L$pwr_sp_alt sub rbp,r11 lea rbp,[((-320))+r9*2+rbp] jmp NEAR $L$pwr_sp_done ALIGN 32 $L$pwr_sp_alt: lea r10,[((4096-320))+r9*2] lea rbp,[((-320))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 sub rbp,r11 $L$pwr_sp_done: and rbp,-64 mov r11,rsp sub r11,rbp and r11,-4096 lea rsp,[rbp*1+r11] mov r10,QWORD[rsp] cmp rsp,rbp ja NEAR $L$pwr_page_walk jmp NEAR $L$pwr_page_walk_done $L$pwr_page_walk: lea rsp,[((-4096))+rsp] mov r10,QWORD[rsp] cmp rsp,rbp ja NEAR $L$pwr_page_walk $L$pwr_page_walk_done: mov r10,r9 neg r9 mov QWORD[32+rsp],r8 mov QWORD[40+rsp],rax $L$power5_body: DB 102,72,15,110,207 DB 102,72,15,110,209 DB 102,73,15,110,218 DB 102,72,15,110,226 call __bn_sqr8x_internal call __bn_post4x_internal call __bn_sqr8x_internal call __bn_post4x_internal call __bn_sqr8x_internal call __bn_post4x_internal call __bn_sqr8x_internal call __bn_post4x_internal call __bn_sqr8x_internal call __bn_post4x_internal DB 102,72,15,126,209 DB 102,72,15,126,226 mov rdi,rsi mov rax,QWORD[40+rsp] lea r8,[32+rsp] call mul4x_internal mov rsi,QWORD[40+rsp] mov rax,1 mov r15,QWORD[((-48))+rsi] mov r14,QWORD[((-40))+rsi] mov r13,QWORD[((-32))+rsi] mov r12,QWORD[((-24))+rsi] mov rbp,QWORD[((-16))+rsi] mov rbx,QWORD[((-8))+rsi] lea rsp,[rsi] $L$power5_epilogue: mov rdi,QWORD[8+rsp] ;WIN64 epilogue mov rsi,QWORD[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_bn_power5: global bn_sqr8x_internal ALIGN 32 bn_sqr8x_internal: __bn_sqr8x_internal: lea rbp,[32+r10] lea rsi,[r9*1+rsi] mov rcx,r9 mov r14,QWORD[((-32))+rbp*1+rsi] lea rdi,[((48+8))+r9*2+rsp] mov rax,QWORD[((-24))+rbp*1+rsi] lea rdi,[((-32))+rbp*1+rdi] mov rbx,QWORD[((-16))+rbp*1+rsi] mov r15,rax mul r14 mov r10,rax mov rax,rbx mov r11,rdx mov QWORD[((-24))+rbp*1+rdi],r10 mul r14 add r11,rax mov rax,rbx adc rdx,0 mov QWORD[((-16))+rbp*1+rdi],r11 mov r10,rdx mov rbx,QWORD[((-8))+rbp*1+rsi] mul r15 mov r12,rax mov rax,rbx mov r13,rdx lea rcx,[rbp] mul r14 add r10,rax mov rax,rbx mov r11,rdx adc r11,0 add r10,r12 adc r11,0 mov QWORD[((-8))+rcx*1+rdi],r10 jmp NEAR $L$sqr4x_1st ALIGN 32 $L$sqr4x_1st: mov rbx,QWORD[rcx*1+rsi] mul r15 add r13,rax mov rax,rbx mov r12,rdx adc r12,0 mul r14 add r11,rax mov rax,rbx mov rbx,QWORD[8+rcx*1+rsi] mov r10,rdx adc r10,0 add r11,r13 adc r10,0 mul r15 add r12,rax mov rax,rbx mov QWORD[rcx*1+rdi],r11 mov r13,rdx adc r13,0 mul r14 add r10,rax mov rax,rbx mov rbx,QWORD[16+rcx*1+rsi] mov r11,rdx adc r11,0 add r10,r12 adc r11,0 mul r15 add r13,rax mov rax,rbx mov QWORD[8+rcx*1+rdi],r10 mov r12,rdx adc r12,0 mul r14 add r11,rax mov rax,rbx mov rbx,QWORD[24+rcx*1+rsi] mov r10,rdx adc r10,0 add r11,r13 adc r10,0 mul r15 add r12,rax mov rax,rbx mov QWORD[16+rcx*1+rdi],r11 mov r13,rdx adc r13,0 lea rcx,[32+rcx] mul r14 add r10,rax mov rax,rbx mov r11,rdx adc r11,0 add r10,r12 adc r11,0 mov QWORD[((-8))+rcx*1+rdi],r10 cmp rcx,0 jne NEAR $L$sqr4x_1st mul r15 add r13,rax lea rbp,[16+rbp] adc rdx,0 add r13,r11 adc rdx,0 mov QWORD[rdi],r13 mov r12,rdx mov QWORD[8+rdi],rdx jmp NEAR $L$sqr4x_outer ALIGN 32 $L$sqr4x_outer: mov r14,QWORD[((-32))+rbp*1+rsi] lea rdi,[((48+8))+r9*2+rsp] mov rax,QWORD[((-24))+rbp*1+rsi] lea rdi,[((-32))+rbp*1+rdi] mov rbx,QWORD[((-16))+rbp*1+rsi] mov r15,rax mul r14 mov r10,QWORD[((-24))+rbp*1+rdi] add r10,rax mov rax,rbx adc rdx,0 mov QWORD[((-24))+rbp*1+rdi],r10 mov r11,rdx mul r14 add r11,rax mov rax,rbx adc rdx,0 add r11,QWORD[((-16))+rbp*1+rdi] mov r10,rdx adc r10,0 mov QWORD[((-16))+rbp*1+rdi],r11 xor r12,r12 mov rbx,QWORD[((-8))+rbp*1+rsi] mul r15 add r12,rax mov rax,rbx adc rdx,0 add r12,QWORD[((-8))+rbp*1+rdi] mov r13,rdx adc r13,0 mul r14 add r10,rax mov rax,rbx adc rdx,0 add r10,r12 mov r11,rdx adc r11,0 mov QWORD[((-8))+rbp*1+rdi],r10 lea rcx,[rbp] jmp NEAR $L$sqr4x_inner ALIGN 32 $L$sqr4x_inner: mov rbx,QWORD[rcx*1+rsi] mul r15 add r13,rax mov rax,rbx mov r12,rdx adc r12,0 add r13,QWORD[rcx*1+rdi] adc r12,0 DB 0x67 mul r14 add r11,rax mov rax,rbx mov rbx,QWORD[8+rcx*1+rsi] mov r10,rdx adc r10,0 add r11,r13 adc r10,0 mul r15 add r12,rax mov QWORD[rcx*1+rdi],r11 mov rax,rbx mov r13,rdx adc r13,0 add r12,QWORD[8+rcx*1+rdi] lea rcx,[16+rcx] adc r13,0 mul r14 add r10,rax mov rax,rbx adc rdx,0 add r10,r12 mov r11,rdx adc r11,0 mov QWORD[((-8))+rcx*1+rdi],r10 cmp rcx,0 jne NEAR $L$sqr4x_inner DB 0x67 mul r15 add r13,rax adc rdx,0 add r13,r11 adc rdx,0 mov QWORD[rdi],r13 mov r12,rdx mov QWORD[8+rdi],rdx add rbp,16 jnz NEAR $L$sqr4x_outer mov r14,QWORD[((-32))+rsi] lea rdi,[((48+8))+r9*2+rsp] mov rax,QWORD[((-24))+rsi] lea rdi,[((-32))+rbp*1+rdi] mov rbx,QWORD[((-16))+rsi] mov r15,rax mul r14 add r10,rax mov rax,rbx mov r11,rdx adc r11,0 mul r14 add r11,rax mov rax,rbx mov QWORD[((-24))+rdi],r10 mov r10,rdx adc r10,0 add r11,r13 mov rbx,QWORD[((-8))+rsi] adc r10,0 mul r15 add r12,rax mov rax,rbx mov QWORD[((-16))+rdi],r11 mov r13,rdx adc r13,0 mul r14 add r10,rax mov rax,rbx mov r11,rdx adc r11,0 add r10,r12 adc r11,0 mov QWORD[((-8))+rdi],r10 mul r15 add r13,rax mov rax,QWORD[((-16))+rsi] adc rdx,0 add r13,r11 adc rdx,0 mov QWORD[rdi],r13 mov r12,rdx mov QWORD[8+rdi],rdx mul rbx add rbp,16 xor r14,r14 sub rbp,r9 xor r15,r15 add rax,r12 adc rdx,0 mov QWORD[8+rdi],rax mov QWORD[16+rdi],rdx mov QWORD[24+rdi],r15 mov rax,QWORD[((-16))+rbp*1+rsi] lea rdi,[((48+8))+rsp] xor r10,r10 mov r11,QWORD[8+rdi] lea r12,[r10*2+r14] shr r10,63 lea r13,[r11*2+rcx] shr r11,63 or r13,r10 mov r10,QWORD[16+rdi] mov r14,r11 mul rax neg r15 mov r11,QWORD[24+rdi] adc r12,rax mov rax,QWORD[((-8))+rbp*1+rsi] mov QWORD[rdi],r12 adc r13,rdx lea rbx,[r10*2+r14] mov QWORD[8+rdi],r13 sbb r15,r15 shr r10,63 lea r8,[r11*2+rcx] shr r11,63 or r8,r10 mov r10,QWORD[32+rdi] mov r14,r11 mul rax neg r15 mov r11,QWORD[40+rdi] adc rbx,rax mov rax,QWORD[rbp*1+rsi] mov QWORD[16+rdi],rbx adc r8,rdx lea rbp,[16+rbp] mov QWORD[24+rdi],r8 sbb r15,r15 lea rdi,[64+rdi] jmp NEAR $L$sqr4x_shift_n_add ALIGN 32 $L$sqr4x_shift_n_add: lea r12,[r10*2+r14] shr r10,63 lea r13,[r11*2+rcx] shr r11,63 or r13,r10 mov r10,QWORD[((-16))+rdi] mov r14,r11 mul rax neg r15 mov r11,QWORD[((-8))+rdi] adc r12,rax mov rax,QWORD[((-8))+rbp*1+rsi] mov QWORD[((-32))+rdi],r12 adc r13,rdx lea rbx,[r10*2+r14] mov QWORD[((-24))+rdi],r13 sbb r15,r15 shr r10,63 lea r8,[r11*2+rcx] shr r11,63 or r8,r10 mov r10,QWORD[rdi] mov r14,r11 mul rax neg r15 mov r11,QWORD[8+rdi] adc rbx,rax mov rax,QWORD[rbp*1+rsi] mov QWORD[((-16))+rdi],rbx adc r8,rdx lea r12,[r10*2+r14] mov QWORD[((-8))+rdi],r8 sbb r15,r15 shr r10,63 lea r13,[r11*2+rcx] shr r11,63 or r13,r10 mov r10,QWORD[16+rdi] mov r14,r11 mul rax neg r15 mov r11,QWORD[24+rdi] adc r12,rax mov rax,QWORD[8+rbp*1+rsi] mov QWORD[rdi],r12 adc r13,rdx lea rbx,[r10*2+r14] mov QWORD[8+rdi],r13 sbb r15,r15 shr r10,63 lea r8,[r11*2+rcx] shr r11,63 or r8,r10 mov r10,QWORD[32+rdi] mov r14,r11 mul rax neg r15 mov r11,QWORD[40+rdi] adc rbx,rax mov rax,QWORD[16+rbp*1+rsi] mov QWORD[16+rdi],rbx adc r8,rdx mov QWORD[24+rdi],r8 sbb r15,r15 lea rdi,[64+rdi] add rbp,32 jnz NEAR $L$sqr4x_shift_n_add lea r12,[r10*2+r14] DB 0x67 shr r10,63 lea r13,[r11*2+rcx] shr r11,63 or r13,r10 mov r10,QWORD[((-16))+rdi] mov r14,r11 mul rax neg r15 mov r11,QWORD[((-8))+rdi] adc r12,rax mov rax,QWORD[((-8))+rsi] mov QWORD[((-32))+rdi],r12 adc r13,rdx lea rbx,[r10*2+r14] mov QWORD[((-24))+rdi],r13 sbb r15,r15 shr r10,63 lea r8,[r11*2+rcx] shr r11,63 or r8,r10 mul rax neg r15 adc rbx,rax adc r8,rdx mov QWORD[((-16))+rdi],rbx mov QWORD[((-8))+rdi],r8 DB 102,72,15,126,213 __bn_sqr8x_reduction: xor rax,rax lea rcx,[rbp*1+r9] lea rdx,[((48+8))+r9*2+rsp] mov QWORD[((0+8))+rsp],rcx lea rdi,[((48+8))+r9*1+rsp] mov QWORD[((8+8))+rsp],rdx neg r9 jmp NEAR $L$8x_reduction_loop ALIGN 32 $L$8x_reduction_loop: lea rdi,[r9*1+rdi] DB 0x66 mov rbx,QWORD[rdi] mov r9,QWORD[8+rdi] mov r10,QWORD[16+rdi] mov r11,QWORD[24+rdi] mov r12,QWORD[32+rdi] mov r13,QWORD[40+rdi] mov r14,QWORD[48+rdi] mov r15,QWORD[56+rdi] mov QWORD[rdx],rax lea rdi,[64+rdi] DB 0x67 mov r8,rbx imul rbx,QWORD[((32+8))+rsp] mov rax,QWORD[rbp] mov ecx,8 jmp NEAR $L$8x_reduce ALIGN 32 $L$8x_reduce: mul rbx mov rax,QWORD[8+rbp] neg r8 mov r8,rdx adc r8,0 mul rbx add r9,rax mov rax,QWORD[16+rbp] adc rdx,0 add r8,r9 mov QWORD[((48-8+8))+rcx*8+rsp],rbx mov r9,rdx adc r9,0 mul rbx add r10,rax mov rax,QWORD[24+rbp] adc rdx,0 add r9,r10 mov rsi,QWORD[((32+8))+rsp] mov r10,rdx adc r10,0 mul rbx add r11,rax mov rax,QWORD[32+rbp] adc rdx,0 imul rsi,r8 add r10,r11 mov r11,rdx adc r11,0 mul rbx add r12,rax mov rax,QWORD[40+rbp] adc rdx,0 add r11,r12 mov r12,rdx adc r12,0 mul rbx add r13,rax mov rax,QWORD[48+rbp] adc rdx,0 add r12,r13 mov r13,rdx adc r13,0 mul rbx add r14,rax mov rax,QWORD[56+rbp] adc rdx,0 add r13,r14 mov r14,rdx adc r14,0 mul rbx mov rbx,rsi add r15,rax mov rax,QWORD[rbp] adc rdx,0 add r14,r15 mov r15,rdx adc r15,0 dec ecx jnz NEAR $L$8x_reduce lea rbp,[64+rbp] xor rax,rax mov rdx,QWORD[((8+8))+rsp] cmp rbp,QWORD[((0+8))+rsp] jae NEAR $L$8x_no_tail DB 0x66 add r8,QWORD[rdi] adc r9,QWORD[8+rdi] adc r10,QWORD[16+rdi] adc r11,QWORD[24+rdi] adc r12,QWORD[32+rdi] adc r13,QWORD[40+rdi] adc r14,QWORD[48+rdi] adc r15,QWORD[56+rdi] sbb rsi,rsi mov rbx,QWORD[((48+56+8))+rsp] mov ecx,8 mov rax,QWORD[rbp] jmp NEAR $L$8x_tail ALIGN 32 $L$8x_tail: mul rbx add r8,rax mov rax,QWORD[8+rbp] mov QWORD[rdi],r8 mov r8,rdx adc r8,0 mul rbx add r9,rax mov rax,QWORD[16+rbp] adc rdx,0 add r8,r9 lea rdi,[8+rdi] mov r9,rdx adc r9,0 mul rbx add r10,rax mov rax,QWORD[24+rbp] adc rdx,0 add r9,r10 mov r10,rdx adc r10,0 mul rbx add r11,rax mov rax,QWORD[32+rbp] adc rdx,0 add r10,r11 mov r11,rdx adc r11,0 mul rbx add r12,rax mov rax,QWORD[40+rbp] adc rdx,0 add r11,r12 mov r12,rdx adc r12,0 mul rbx add r13,rax mov rax,QWORD[48+rbp] adc rdx,0 add r12,r13 mov r13,rdx adc r13,0 mul rbx add r14,rax mov rax,QWORD[56+rbp] adc rdx,0 add r13,r14 mov r14,rdx adc r14,0 mul rbx mov rbx,QWORD[((48-16+8))+rcx*8+rsp] add r15,rax adc rdx,0 add r14,r15 mov rax,QWORD[rbp] mov r15,rdx adc r15,0 dec ecx jnz NEAR $L$8x_tail lea rbp,[64+rbp] mov rdx,QWORD[((8+8))+rsp] cmp rbp,QWORD[((0+8))+rsp] jae NEAR $L$8x_tail_done mov rbx,QWORD[((48+56+8))+rsp] neg rsi mov rax,QWORD[rbp] adc r8,QWORD[rdi] adc r9,QWORD[8+rdi] adc r10,QWORD[16+rdi] adc r11,QWORD[24+rdi] adc r12,QWORD[32+rdi] adc r13,QWORD[40+rdi] adc r14,QWORD[48+rdi] adc r15,QWORD[56+rdi] sbb rsi,rsi mov ecx,8 jmp NEAR $L$8x_tail ALIGN 32 $L$8x_tail_done: xor rax,rax add r8,QWORD[rdx] adc r9,0 adc r10,0 adc r11,0 adc r12,0 adc r13,0 adc r14,0 adc r15,0 adc rax,0 neg rsi $L$8x_no_tail: adc r8,QWORD[rdi] adc r9,QWORD[8+rdi] adc r10,QWORD[16+rdi] adc r11,QWORD[24+rdi] adc r12,QWORD[32+rdi] adc r13,QWORD[40+rdi] adc r14,QWORD[48+rdi] adc r15,QWORD[56+rdi] adc rax,0 mov rcx,QWORD[((-8))+rbp] xor rsi,rsi DB 102,72,15,126,213 mov QWORD[rdi],r8 mov QWORD[8+rdi],r9 DB 102,73,15,126,217 mov QWORD[16+rdi],r10 mov QWORD[24+rdi],r11 mov QWORD[32+rdi],r12 mov QWORD[40+rdi],r13 mov QWORD[48+rdi],r14 mov QWORD[56+rdi],r15 lea rdi,[64+rdi] cmp rdi,rdx jb NEAR $L$8x_reduction_loop DB 0F3h,0C3h ;repret ALIGN 32 __bn_post4x_internal: mov r12,QWORD[rbp] lea rbx,[r9*1+rdi] mov rcx,r9 DB 102,72,15,126,207 neg rax DB 102,72,15,126,206 sar rcx,3+2 dec r12 xor r10,r10 mov r13,QWORD[8+rbp] mov r14,QWORD[16+rbp] mov r15,QWORD[24+rbp] jmp NEAR $L$sqr4x_sub_entry ALIGN 16 $L$sqr4x_sub: mov r12,QWORD[rbp] mov r13,QWORD[8+rbp] mov r14,QWORD[16+rbp] mov r15,QWORD[24+rbp] $L$sqr4x_sub_entry: lea rbp,[32+rbp] not r12 not r13 not r14 not r15 and r12,rax and r13,rax and r14,rax and r15,rax neg r10 adc r12,QWORD[rbx] adc r13,QWORD[8+rbx] adc r14,QWORD[16+rbx] adc r15,QWORD[24+rbx] mov QWORD[rdi],r12 lea rbx,[32+rbx] mov QWORD[8+rdi],r13 sbb r10,r10 mov QWORD[16+rdi],r14 mov QWORD[24+rdi],r15 lea rdi,[32+rdi] inc rcx jnz NEAR $L$sqr4x_sub mov r10,r9 neg r9 DB 0F3h,0C3h ;repret global bn_from_montgomery ALIGN 32 bn_from_montgomery: test DWORD[48+rsp],7 jz NEAR bn_from_mont8x xor eax,eax DB 0F3h,0C3h ;repret ALIGN 32 bn_from_mont8x: mov QWORD[8+rsp],rdi ;WIN64 prologue mov QWORD[16+rsp],rsi mov rax,rsp $L$SEH_begin_bn_from_mont8x: mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 mov r8,QWORD[40+rsp] mov r9,QWORD[48+rsp] DB 0x67 mov rax,rsp push rbx push rbp push r12 push r13 push r14 push r15 $L$from_prologue: shl r9d,3 lea r10,[r9*2+r9] neg r9 mov r8,QWORD[r8] lea r11,[((-320))+r9*2+rsp] mov rbp,rsp sub r11,rdi and r11,4095 cmp r10,r11 jb NEAR $L$from_sp_alt sub rbp,r11 lea rbp,[((-320))+r9*2+rbp] jmp NEAR $L$from_sp_done ALIGN 32 $L$from_sp_alt: lea r10,[((4096-320))+r9*2] lea rbp,[((-320))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 sub rbp,r11 $L$from_sp_done: and rbp,-64 mov r11,rsp sub r11,rbp and r11,-4096 lea rsp,[rbp*1+r11] mov r10,QWORD[rsp] cmp rsp,rbp ja NEAR $L$from_page_walk jmp NEAR $L$from_page_walk_done $L$from_page_walk: lea rsp,[((-4096))+rsp] mov r10,QWORD[rsp] cmp rsp,rbp ja NEAR $L$from_page_walk $L$from_page_walk_done: mov r10,r9 neg r9 mov QWORD[32+rsp],r8 mov QWORD[40+rsp],rax $L$from_body: mov r11,r9 lea rax,[48+rsp] pxor xmm0,xmm0 jmp NEAR $L$mul_by_1 ALIGN 32 $L$mul_by_1: movdqu xmm1,XMMWORD[rsi] movdqu xmm2,XMMWORD[16+rsi] movdqu xmm3,XMMWORD[32+rsi] movdqa XMMWORD[r9*1+rax],xmm0 movdqu xmm4,XMMWORD[48+rsi] movdqa XMMWORD[16+r9*1+rax],xmm0 DB 0x48,0x8d,0xb6,0x40,0x00,0x00,0x00 movdqa XMMWORD[rax],xmm1 movdqa XMMWORD[32+r9*1+rax],xmm0 movdqa XMMWORD[16+rax],xmm2 movdqa XMMWORD[48+r9*1+rax],xmm0 movdqa XMMWORD[32+rax],xmm3 movdqa XMMWORD[48+rax],xmm4 lea rax,[64+rax] sub r11,64 jnz NEAR $L$mul_by_1 DB 102,72,15,110,207 DB 102,72,15,110,209 DB 0x67 mov rbp,rcx DB 102,73,15,110,218 mov r11d,DWORD[((OPENSSL_ia32cap_P+8))] and r11d,0x80108 cmp r11d,0x80108 jne NEAR $L$from_mont_nox lea rdi,[r9*1+rax] call __bn_sqrx8x_reduction call __bn_postx4x_internal pxor xmm0,xmm0 lea rax,[48+rsp] jmp NEAR $L$from_mont_zero ALIGN 32 $L$from_mont_nox: call __bn_sqr8x_reduction call __bn_post4x_internal pxor xmm0,xmm0 lea rax,[48+rsp] jmp NEAR $L$from_mont_zero ALIGN 32 $L$from_mont_zero: mov rsi,QWORD[40+rsp] movdqa XMMWORD[rax],xmm0 movdqa XMMWORD[16+rax],xmm0 movdqa XMMWORD[32+rax],xmm0 movdqa XMMWORD[48+rax],xmm0 lea rax,[64+rax] sub r9,32 jnz NEAR $L$from_mont_zero mov rax,1 mov r15,QWORD[((-48))+rsi] mov r14,QWORD[((-40))+rsi] mov r13,QWORD[((-32))+rsi] mov r12,QWORD[((-24))+rsi] mov rbp,QWORD[((-16))+rsi] mov rbx,QWORD[((-8))+rsi] lea rsp,[rsi] $L$from_epilogue: mov rdi,QWORD[8+rsp] ;WIN64 epilogue mov rsi,QWORD[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_bn_from_mont8x: ALIGN 32 bn_mulx4x_mont_gather5: mov QWORD[8+rsp],rdi ;WIN64 prologue mov QWORD[16+rsp],rsi mov rax,rsp $L$SEH_begin_bn_mulx4x_mont_gather5: mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 mov r8,QWORD[40+rsp] mov r9,QWORD[48+rsp] mov rax,rsp $L$mulx4x_enter: push rbx push rbp push r12 push r13 push r14 push r15 $L$mulx4x_prologue: shl r9d,3 lea r10,[r9*2+r9] neg r9 mov r8,QWORD[r8] lea r11,[((-320))+r9*2+rsp] mov rbp,rsp sub r11,rdi and r11,4095 cmp r10,r11 jb NEAR $L$mulx4xsp_alt sub rbp,r11 lea rbp,[((-320))+r9*2+rbp] jmp NEAR $L$mulx4xsp_done $L$mulx4xsp_alt: lea r10,[((4096-320))+r9*2] lea rbp,[((-320))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 sub rbp,r11 $L$mulx4xsp_done: and rbp,-64 mov r11,rsp sub r11,rbp and r11,-4096 lea rsp,[rbp*1+r11] mov r10,QWORD[rsp] cmp rsp,rbp ja NEAR $L$mulx4x_page_walk jmp NEAR $L$mulx4x_page_walk_done $L$mulx4x_page_walk: lea rsp,[((-4096))+rsp] mov r10,QWORD[rsp] cmp rsp,rbp ja NEAR $L$mulx4x_page_walk $L$mulx4x_page_walk_done: mov QWORD[32+rsp],r8 mov QWORD[40+rsp],rax $L$mulx4x_body: call mulx4x_internal mov rsi,QWORD[40+rsp] mov rax,1 mov r15,QWORD[((-48))+rsi] mov r14,QWORD[((-40))+rsi] mov r13,QWORD[((-32))+rsi] mov r12,QWORD[((-24))+rsi] mov rbp,QWORD[((-16))+rsi] mov rbx,QWORD[((-8))+rsi] lea rsp,[rsi] $L$mulx4x_epilogue: mov rdi,QWORD[8+rsp] ;WIN64 epilogue mov rsi,QWORD[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_bn_mulx4x_mont_gather5: ALIGN 32 mulx4x_internal: mov QWORD[8+rsp],r9 mov r10,r9 neg r9 shl r9,5 neg r10 lea r13,[128+r9*1+rdx] shr r9,5+5 movd xmm5,DWORD[56+rax] sub r9,1 lea rax,[$L$inc] mov QWORD[((16+8))+rsp],r13 mov QWORD[((24+8))+rsp],r9 mov QWORD[((56+8))+rsp],rdi movdqa xmm0,XMMWORD[rax] movdqa xmm1,XMMWORD[16+rax] lea r10,[((88-112))+r10*1+rsp] lea rdi,[128+rdx] pshufd xmm5,xmm5,0 movdqa xmm4,xmm1 DB 0x67 movdqa xmm2,xmm1 DB 0x67 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[112+r10],xmm0 movdqa xmm0,xmm4 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[128+r10],xmm1 movdqa xmm1,xmm4 paddd xmm0,xmm3 pcmpeqd xmm3,xmm5 movdqa XMMWORD[144+r10],xmm2 movdqa xmm2,xmm4 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa XMMWORD[160+r10],xmm3 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[176+r10],xmm0 movdqa xmm0,xmm4 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[192+r10],xmm1 movdqa xmm1,xmm4 paddd xmm0,xmm3 pcmpeqd xmm3,xmm5 movdqa XMMWORD[208+r10],xmm2 movdqa xmm2,xmm4 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa XMMWORD[224+r10],xmm3 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[240+r10],xmm0 movdqa xmm0,xmm4 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[256+r10],xmm1 movdqa xmm1,xmm4 paddd xmm0,xmm3 pcmpeqd xmm3,xmm5 movdqa XMMWORD[272+r10],xmm2 movdqa xmm2,xmm4 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa XMMWORD[288+r10],xmm3 movdqa xmm3,xmm4 DB 0x67 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[304+r10],xmm0 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[320+r10],xmm1 pcmpeqd xmm3,xmm5 movdqa XMMWORD[336+r10],xmm2 pand xmm0,XMMWORD[64+rdi] pand xmm1,XMMWORD[80+rdi] pand xmm2,XMMWORD[96+rdi] movdqa XMMWORD[352+r10],xmm3 pand xmm3,XMMWORD[112+rdi] por xmm0,xmm2 por xmm1,xmm3 movdqa xmm4,XMMWORD[((-128))+rdi] movdqa xmm5,XMMWORD[((-112))+rdi] movdqa xmm2,XMMWORD[((-96))+rdi] pand xmm4,XMMWORD[112+r10] movdqa xmm3,XMMWORD[((-80))+rdi] pand xmm5,XMMWORD[128+r10] por xmm0,xmm4 pand xmm2,XMMWORD[144+r10] por xmm1,xmm5 pand xmm3,XMMWORD[160+r10] por xmm0,xmm2 por xmm1,xmm3 movdqa xmm4,XMMWORD[((-64))+rdi] movdqa xmm5,XMMWORD[((-48))+rdi] movdqa xmm2,XMMWORD[((-32))+rdi] pand xmm4,XMMWORD[176+r10] movdqa xmm3,XMMWORD[((-16))+rdi] pand xmm5,XMMWORD[192+r10] por xmm0,xmm4 pand xmm2,XMMWORD[208+r10] por xmm1,xmm5 pand xmm3,XMMWORD[224+r10] por xmm0,xmm2 por xmm1,xmm3 movdqa xmm4,XMMWORD[rdi] movdqa xmm5,XMMWORD[16+rdi] movdqa xmm2,XMMWORD[32+rdi] pand xmm4,XMMWORD[240+r10] movdqa xmm3,XMMWORD[48+rdi] pand xmm5,XMMWORD[256+r10] por xmm0,xmm4 pand xmm2,XMMWORD[272+r10] por xmm1,xmm5 pand xmm3,XMMWORD[288+r10] por xmm0,xmm2 por xmm1,xmm3 pxor xmm0,xmm1 pshufd xmm1,xmm0,0x4e por xmm0,xmm1 lea rdi,[256+rdi] DB 102,72,15,126,194 lea rbx,[((64+32+8))+rsp] mov r9,rdx mulx rax,r8,QWORD[rsi] mulx r12,r11,QWORD[8+rsi] add r11,rax mulx r13,rax,QWORD[16+rsi] adc r12,rax adc r13,0 mulx r14,rax,QWORD[24+rsi] mov r15,r8 imul r8,QWORD[((32+8))+rsp] xor rbp,rbp mov rdx,r8 mov QWORD[((8+8))+rsp],rdi lea rsi,[32+rsi] adcx r13,rax adcx r14,rbp mulx r10,rax,QWORD[rcx] adcx r15,rax adox r10,r11 mulx r11,rax,QWORD[8+rcx] adcx r10,rax adox r11,r12 mulx r12,rax,QWORD[16+rcx] mov rdi,QWORD[((24+8))+rsp] mov QWORD[((-32))+rbx],r10 adcx r11,rax adox r12,r13 mulx r15,rax,QWORD[24+rcx] mov rdx,r9 mov QWORD[((-24))+rbx],r11 adcx r12,rax adox r15,rbp lea rcx,[32+rcx] mov QWORD[((-16))+rbx],r12 jmp NEAR $L$mulx4x_1st ALIGN 32 $L$mulx4x_1st: adcx r15,rbp mulx rax,r10,QWORD[rsi] adcx r10,r14 mulx r14,r11,QWORD[8+rsi] adcx r11,rax mulx rax,r12,QWORD[16+rsi] adcx r12,r14 mulx r14,r13,QWORD[24+rsi] DB 0x67,0x67 mov rdx,r8 adcx r13,rax adcx r14,rbp lea rsi,[32+rsi] lea rbx,[32+rbx] adox r10,r15 mulx r15,rax,QWORD[rcx] adcx r10,rax adox r11,r15 mulx r15,rax,QWORD[8+rcx] adcx r11,rax adox r12,r15 mulx r15,rax,QWORD[16+rcx] mov QWORD[((-40))+rbx],r10 adcx r12,rax mov QWORD[((-32))+rbx],r11 adox r13,r15 mulx r15,rax,QWORD[24+rcx] mov rdx,r9 mov QWORD[((-24))+rbx],r12 adcx r13,rax adox r15,rbp lea rcx,[32+rcx] mov QWORD[((-16))+rbx],r13 dec rdi jnz NEAR $L$mulx4x_1st mov rax,QWORD[8+rsp] adc r15,rbp lea rsi,[rax*1+rsi] add r14,r15 mov rdi,QWORD[((8+8))+rsp] adc rbp,rbp mov QWORD[((-8))+rbx],r14 jmp NEAR $L$mulx4x_outer ALIGN 32 $L$mulx4x_outer: lea r10,[((16-256))+rbx] pxor xmm4,xmm4 DB 0x67,0x67 pxor xmm5,xmm5 movdqa xmm0,XMMWORD[((-128))+rdi] movdqa xmm1,XMMWORD[((-112))+rdi] movdqa xmm2,XMMWORD[((-96))+rdi] pand xmm0,XMMWORD[256+r10] movdqa xmm3,XMMWORD[((-80))+rdi] pand xmm1,XMMWORD[272+r10] por xmm4,xmm0 pand xmm2,XMMWORD[288+r10] por xmm5,xmm1 pand xmm3,XMMWORD[304+r10] por xmm4,xmm2 por xmm5,xmm3 movdqa xmm0,XMMWORD[((-64))+rdi] movdqa xmm1,XMMWORD[((-48))+rdi] movdqa xmm2,XMMWORD[((-32))+rdi] pand xmm0,XMMWORD[320+r10] movdqa xmm3,XMMWORD[((-16))+rdi] pand xmm1,XMMWORD[336+r10] por xmm4,xmm0 pand xmm2,XMMWORD[352+r10] por xmm5,xmm1 pand xmm3,XMMWORD[368+r10] por xmm4,xmm2 por xmm5,xmm3 movdqa xmm0,XMMWORD[rdi] movdqa xmm1,XMMWORD[16+rdi] movdqa xmm2,XMMWORD[32+rdi] pand xmm0,XMMWORD[384+r10] movdqa xmm3,XMMWORD[48+rdi] pand xmm1,XMMWORD[400+r10] por xmm4,xmm0 pand xmm2,XMMWORD[416+r10] por xmm5,xmm1 pand xmm3,XMMWORD[432+r10] por xmm4,xmm2 por xmm5,xmm3 movdqa xmm0,XMMWORD[64+rdi] movdqa xmm1,XMMWORD[80+rdi] movdqa xmm2,XMMWORD[96+rdi] pand xmm0,XMMWORD[448+r10] movdqa xmm3,XMMWORD[112+rdi] pand xmm1,XMMWORD[464+r10] por xmm4,xmm0 pand xmm2,XMMWORD[480+r10] por xmm5,xmm1 pand xmm3,XMMWORD[496+r10] por xmm4,xmm2 por xmm5,xmm3 por xmm4,xmm5 pshufd xmm0,xmm4,0x4e por xmm0,xmm4 lea rdi,[256+rdi] DB 102,72,15,126,194 mov QWORD[rbx],rbp lea rbx,[32+rax*1+rbx] mulx r11,r8,QWORD[rsi] xor rbp,rbp mov r9,rdx mulx r12,r14,QWORD[8+rsi] adox r8,QWORD[((-32))+rbx] adcx r11,r14 mulx r13,r15,QWORD[16+rsi] adox r11,QWORD[((-24))+rbx] adcx r12,r15 mulx r14,rdx,QWORD[24+rsi] adox r12,QWORD[((-16))+rbx] adcx r13,rdx lea rcx,[rax*1+rcx] lea rsi,[32+rsi] adox r13,QWORD[((-8))+rbx] adcx r14,rbp adox r14,rbp mov r15,r8 imul r8,QWORD[((32+8))+rsp] mov rdx,r8 xor rbp,rbp mov QWORD[((8+8))+rsp],rdi mulx r10,rax,QWORD[rcx] adcx r15,rax adox r10,r11 mulx r11,rax,QWORD[8+rcx] adcx r10,rax adox r11,r12 mulx r12,rax,QWORD[16+rcx] adcx r11,rax adox r12,r13 mulx r15,rax,QWORD[24+rcx] mov rdx,r9 mov rdi,QWORD[((24+8))+rsp] mov QWORD[((-32))+rbx],r10 adcx r12,rax mov QWORD[((-24))+rbx],r11 adox r15,rbp mov QWORD[((-16))+rbx],r12 lea rcx,[32+rcx] jmp NEAR $L$mulx4x_inner ALIGN 32 $L$mulx4x_inner: mulx rax,r10,QWORD[rsi] adcx r15,rbp adox r10,r14 mulx r14,r11,QWORD[8+rsi] adcx r10,QWORD[rbx] adox r11,rax mulx rax,r12,QWORD[16+rsi] adcx r11,QWORD[8+rbx] adox r12,r14 mulx r14,r13,QWORD[24+rsi] mov rdx,r8 adcx r12,QWORD[16+rbx] adox r13,rax adcx r13,QWORD[24+rbx] adox r14,rbp lea rsi,[32+rsi] lea rbx,[32+rbx] adcx r14,rbp adox r10,r15 mulx r15,rax,QWORD[rcx] adcx r10,rax adox r11,r15 mulx r15,rax,QWORD[8+rcx] adcx r11,rax adox r12,r15 mulx r15,rax,QWORD[16+rcx] mov QWORD[((-40))+rbx],r10 adcx r12,rax adox r13,r15 mov QWORD[((-32))+rbx],r11 mulx r15,rax,QWORD[24+rcx] mov rdx,r9 lea rcx,[32+rcx] mov QWORD[((-24))+rbx],r12 adcx r13,rax adox r15,rbp mov QWORD[((-16))+rbx],r13 dec rdi jnz NEAR $L$mulx4x_inner mov rax,QWORD[((0+8))+rsp] adc r15,rbp sub rdi,QWORD[rbx] mov rdi,QWORD[((8+8))+rsp] mov r10,QWORD[((16+8))+rsp] adc r14,r15 lea rsi,[rax*1+rsi] adc rbp,rbp mov QWORD[((-8))+rbx],r14 cmp rdi,r10 jb NEAR $L$mulx4x_outer mov r10,QWORD[((-8))+rcx] mov r8,rbp mov r12,QWORD[rax*1+rcx] lea rbp,[rax*1+rcx] mov rcx,rax lea rdi,[rax*1+rbx] xor eax,eax xor r15,r15 sub r10,r14 adc r15,r15 or r8,r15 sar rcx,3+2 sub rax,r8 mov rdx,QWORD[((56+8))+rsp] dec r12 mov r13,QWORD[8+rbp] xor r8,r8 mov r14,QWORD[16+rbp] mov r15,QWORD[24+rbp] jmp NEAR $L$sqrx4x_sub_entry ALIGN 32 bn_powerx5: mov QWORD[8+rsp],rdi ;WIN64 prologue mov QWORD[16+rsp],rsi mov rax,rsp $L$SEH_begin_bn_powerx5: mov rdi,rcx mov rsi,rdx mov rdx,r8 mov rcx,r9 mov r8,QWORD[40+rsp] mov r9,QWORD[48+rsp] mov rax,rsp $L$powerx5_enter: push rbx push rbp push r12 push r13 push r14 push r15 $L$powerx5_prologue: shl r9d,3 lea r10,[r9*2+r9] neg r9 mov r8,QWORD[r8] lea r11,[((-320))+r9*2+rsp] mov rbp,rsp sub r11,rdi and r11,4095 cmp r10,r11 jb NEAR $L$pwrx_sp_alt sub rbp,r11 lea rbp,[((-320))+r9*2+rbp] jmp NEAR $L$pwrx_sp_done ALIGN 32 $L$pwrx_sp_alt: lea r10,[((4096-320))+r9*2] lea rbp,[((-320))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 sub rbp,r11 $L$pwrx_sp_done: and rbp,-64 mov r11,rsp sub r11,rbp and r11,-4096 lea rsp,[rbp*1+r11] mov r10,QWORD[rsp] cmp rsp,rbp ja NEAR $L$pwrx_page_walk jmp NEAR $L$pwrx_page_walk_done $L$pwrx_page_walk: lea rsp,[((-4096))+rsp] mov r10,QWORD[rsp] cmp rsp,rbp ja NEAR $L$pwrx_page_walk $L$pwrx_page_walk_done: mov r10,r9 neg r9 pxor xmm0,xmm0 DB 102,72,15,110,207 DB 102,72,15,110,209 DB 102,73,15,110,218 DB 102,72,15,110,226 mov QWORD[32+rsp],r8 mov QWORD[40+rsp],rax $L$powerx5_body: call __bn_sqrx8x_internal call __bn_postx4x_internal call __bn_sqrx8x_internal call __bn_postx4x_internal call __bn_sqrx8x_internal call __bn_postx4x_internal call __bn_sqrx8x_internal call __bn_postx4x_internal call __bn_sqrx8x_internal call __bn_postx4x_internal mov r9,r10 mov rdi,rsi DB 102,72,15,126,209 DB 102,72,15,126,226 mov rax,QWORD[40+rsp] call mulx4x_internal mov rsi,QWORD[40+rsp] mov rax,1 mov r15,QWORD[((-48))+rsi] mov r14,QWORD[((-40))+rsi] mov r13,QWORD[((-32))+rsi] mov r12,QWORD[((-24))+rsi] mov rbp,QWORD[((-16))+rsi] mov rbx,QWORD[((-8))+rsi] lea rsp,[rsi] $L$powerx5_epilogue: mov rdi,QWORD[8+rsp] ;WIN64 epilogue mov rsi,QWORD[16+rsp] DB 0F3h,0C3h ;repret $L$SEH_end_bn_powerx5: global bn_sqrx8x_internal ALIGN 32 bn_sqrx8x_internal: __bn_sqrx8x_internal: lea rdi,[((48+8))+rsp] lea rbp,[r9*1+rsi] mov QWORD[((0+8))+rsp],r9 mov QWORD[((8+8))+rsp],rbp jmp NEAR $L$sqr8x_zero_start ALIGN 32 DB 0x66,0x66,0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00 $L$sqrx8x_zero: DB 0x3e movdqa XMMWORD[rdi],xmm0 movdqa XMMWORD[16+rdi],xmm0 movdqa XMMWORD[32+rdi],xmm0 movdqa XMMWORD[48+rdi],xmm0 $L$sqr8x_zero_start: movdqa XMMWORD[64+rdi],xmm0 movdqa XMMWORD[80+rdi],xmm0 movdqa XMMWORD[96+rdi],xmm0 movdqa XMMWORD[112+rdi],xmm0 lea rdi,[128+rdi] sub r9,64 jnz NEAR $L$sqrx8x_zero mov rdx,QWORD[rsi] xor r10,r10 xor r11,r11 xor r12,r12 xor r13,r13 xor r14,r14 xor r15,r15 lea rdi,[((48+8))+rsp] xor rbp,rbp jmp NEAR $L$sqrx8x_outer_loop ALIGN 32 $L$sqrx8x_outer_loop: mulx rax,r8,QWORD[8+rsi] adcx r8,r9 adox r10,rax mulx rax,r9,QWORD[16+rsi] adcx r9,r10 adox r11,rax DB 0xc4,0xe2,0xab,0xf6,0x86,0x18,0x00,0x00,0x00 adcx r10,r11 adox r12,rax DB 0xc4,0xe2,0xa3,0xf6,0x86,0x20,0x00,0x00,0x00 adcx r11,r12 adox r13,rax mulx rax,r12,QWORD[40+rsi] adcx r12,r13 adox r14,rax mulx rax,r13,QWORD[48+rsi] adcx r13,r14 adox rax,r15 mulx r15,r14,QWORD[56+rsi] mov rdx,QWORD[8+rsi] adcx r14,rax adox r15,rbp adc r15,QWORD[64+rdi] mov QWORD[8+rdi],r8 mov QWORD[16+rdi],r9 sbb rcx,rcx xor rbp,rbp mulx rbx,r8,QWORD[16+rsi] mulx rax,r9,QWORD[24+rsi] adcx r8,r10 adox r9,rbx mulx rbx,r10,QWORD[32+rsi] adcx r9,r11 adox r10,rax DB 0xc4,0xe2,0xa3,0xf6,0x86,0x28,0x00,0x00,0x00 adcx r10,r12 adox r11,rbx DB 0xc4,0xe2,0x9b,0xf6,0x9e,0x30,0x00,0x00,0x00 adcx r11,r13 adox r12,r14 DB 0xc4,0x62,0x93,0xf6,0xb6,0x38,0x00,0x00,0x00 mov rdx,QWORD[16+rsi] adcx r12,rax adox r13,rbx adcx r13,r15 adox r14,rbp adcx r14,rbp mov QWORD[24+rdi],r8 mov QWORD[32+rdi],r9 mulx rbx,r8,QWORD[24+rsi] mulx rax,r9,QWORD[32+rsi] adcx r8,r10 adox r9,rbx mulx rbx,r10,QWORD[40+rsi] adcx r9,r11 adox r10,rax DB 0xc4,0xe2,0xa3,0xf6,0x86,0x30,0x00,0x00,0x00 adcx r10,r12 adox r11,r13 DB 0xc4,0x62,0x9b,0xf6,0xae,0x38,0x00,0x00,0x00 DB 0x3e mov rdx,QWORD[24+rsi] adcx r11,rbx adox r12,rax adcx r12,r14 mov QWORD[40+rdi],r8 mov QWORD[48+rdi],r9 mulx rax,r8,QWORD[32+rsi] adox r13,rbp adcx r13,rbp mulx rbx,r9,QWORD[40+rsi] adcx r8,r10 adox r9,rax mulx rax,r10,QWORD[48+rsi] adcx r9,r11 adox r10,r12 mulx r12,r11,QWORD[56+rsi] mov rdx,QWORD[32+rsi] mov r14,QWORD[40+rsi] adcx r10,rbx adox r11,rax mov r15,QWORD[48+rsi] adcx r11,r13 adox r12,rbp adcx r12,rbp mov QWORD[56+rdi],r8 mov QWORD[64+rdi],r9 mulx rax,r9,r14 mov r8,QWORD[56+rsi] adcx r9,r10 mulx rbx,r10,r15 adox r10,rax adcx r10,r11 mulx rax,r11,r8 mov rdx,r14 adox r11,rbx adcx r11,r12 adcx rax,rbp mulx rbx,r14,r15 mulx r13,r12,r8 mov rdx,r15 lea rsi,[64+rsi] adcx r11,r14 adox r12,rbx adcx r12,rax adox r13,rbp DB 0x67,0x67 mulx r14,r8,r8 adcx r13,r8 adcx r14,rbp cmp rsi,QWORD[((8+8))+rsp] je NEAR $L$sqrx8x_outer_break neg rcx mov rcx,-8 mov r15,rbp mov r8,QWORD[64+rdi] adcx r9,QWORD[72+rdi] adcx r10,QWORD[80+rdi] adcx r11,QWORD[88+rdi] adc r12,QWORD[96+rdi] adc r13,QWORD[104+rdi] adc r14,QWORD[112+rdi] adc r15,QWORD[120+rdi] lea rbp,[rsi] lea rdi,[128+rdi] sbb rax,rax mov rdx,QWORD[((-64))+rsi] mov QWORD[((16+8))+rsp],rax mov QWORD[((24+8))+rsp],rdi xor eax,eax jmp NEAR $L$sqrx8x_loop ALIGN 32 $L$sqrx8x_loop: mov rbx,r8 mulx r8,rax,QWORD[rbp] adcx rbx,rax adox r8,r9 mulx r9,rax,QWORD[8+rbp] adcx r8,rax adox r9,r10 mulx r10,rax,QWORD[16+rbp] adcx r9,rax adox r10,r11 mulx r11,rax,QWORD[24+rbp] adcx r10,rax adox r11,r12 DB 0xc4,0x62,0xfb,0xf6,0xa5,0x20,0x00,0x00,0x00 adcx r11,rax adox r12,r13 mulx r13,rax,QWORD[40+rbp] adcx r12,rax adox r13,r14 mulx r14,rax,QWORD[48+rbp] mov QWORD[rcx*8+rdi],rbx mov ebx,0 adcx r13,rax adox r14,r15 DB 0xc4,0x62,0xfb,0xf6,0xbd,0x38,0x00,0x00,0x00 mov rdx,QWORD[8+rcx*8+rsi] adcx r14,rax adox r15,rbx adcx r15,rbx DB 0x67 inc rcx jnz NEAR $L$sqrx8x_loop lea rbp,[64+rbp] mov rcx,-8 cmp rbp,QWORD[((8+8))+rsp] je NEAR $L$sqrx8x_break sub rbx,QWORD[((16+8))+rsp] DB 0x66 mov rdx,QWORD[((-64))+rsi] adcx r8,QWORD[rdi] adcx r9,QWORD[8+rdi] adc r10,QWORD[16+rdi] adc r11,QWORD[24+rdi] adc r12,QWORD[32+rdi] adc r13,QWORD[40+rdi] adc r14,QWORD[48+rdi] adc r15,QWORD[56+rdi] lea rdi,[64+rdi] DB 0x67 sbb rax,rax xor ebx,ebx mov QWORD[((16+8))+rsp],rax jmp NEAR $L$sqrx8x_loop ALIGN 32 $L$sqrx8x_break: xor rbp,rbp sub rbx,QWORD[((16+8))+rsp] adcx r8,rbp mov rcx,QWORD[((24+8))+rsp] adcx r9,rbp mov rdx,QWORD[rsi] adc r10,0 mov QWORD[rdi],r8 adc r11,0 adc r12,0 adc r13,0 adc r14,0 adc r15,0 cmp rdi,rcx je NEAR $L$sqrx8x_outer_loop mov QWORD[8+rdi],r9 mov r9,QWORD[8+rcx] mov QWORD[16+rdi],r10 mov r10,QWORD[16+rcx] mov QWORD[24+rdi],r11 mov r11,QWORD[24+rcx] mov QWORD[32+rdi],r12 mov r12,QWORD[32+rcx] mov QWORD[40+rdi],r13 mov r13,QWORD[40+rcx] mov QWORD[48+rdi],r14 mov r14,QWORD[48+rcx] mov QWORD[56+rdi],r15 mov r15,QWORD[56+rcx] mov rdi,rcx jmp NEAR $L$sqrx8x_outer_loop ALIGN 32 $L$sqrx8x_outer_break: mov QWORD[72+rdi],r9 DB 102,72,15,126,217 mov QWORD[80+rdi],r10 mov QWORD[88+rdi],r11 mov QWORD[96+rdi],r12 mov QWORD[104+rdi],r13 mov QWORD[112+rdi],r14 lea rdi,[((48+8))+rsp] mov rdx,QWORD[rcx*1+rsi] mov r11,QWORD[8+rdi] xor r10,r10 mov r9,QWORD[((0+8))+rsp] adox r11,r11 mov r12,QWORD[16+rdi] mov r13,QWORD[24+rdi] ALIGN 32 $L$sqrx4x_shift_n_add: mulx rbx,rax,rdx adox r12,r12 adcx rax,r10 DB 0x48,0x8b,0x94,0x0e,0x08,0x00,0x00,0x00 DB 0x4c,0x8b,0x97,0x20,0x00,0x00,0x00 adox r13,r13 adcx rbx,r11 mov r11,QWORD[40+rdi] mov QWORD[rdi],rax mov QWORD[8+rdi],rbx mulx rbx,rax,rdx adox r10,r10 adcx rax,r12 mov rdx,QWORD[16+rcx*1+rsi] mov r12,QWORD[48+rdi] adox r11,r11 adcx rbx,r13 mov r13,QWORD[56+rdi] mov QWORD[16+rdi],rax mov QWORD[24+rdi],rbx mulx rbx,rax,rdx adox r12,r12 adcx rax,r10 mov rdx,QWORD[24+rcx*1+rsi] lea rcx,[32+rcx] mov r10,QWORD[64+rdi] adox r13,r13 adcx rbx,r11 mov r11,QWORD[72+rdi] mov QWORD[32+rdi],rax mov QWORD[40+rdi],rbx mulx rbx,rax,rdx adox r10,r10 adcx rax,r12 jrcxz $L$sqrx4x_shift_n_add_break DB 0x48,0x8b,0x94,0x0e,0x00,0x00,0x00,0x00 adox r11,r11 adcx rbx,r13 mov r12,QWORD[80+rdi] mov r13,QWORD[88+rdi] mov QWORD[48+rdi],rax mov QWORD[56+rdi],rbx lea rdi,[64+rdi] nop jmp NEAR $L$sqrx4x_shift_n_add ALIGN 32 $L$sqrx4x_shift_n_add_break: adcx rbx,r13 mov QWORD[48+rdi],rax mov QWORD[56+rdi],rbx lea rdi,[64+rdi] DB 102,72,15,126,213 __bn_sqrx8x_reduction: xor eax,eax mov rbx,QWORD[((32+8))+rsp] mov rdx,QWORD[((48+8))+rsp] lea rcx,[((-64))+r9*1+rbp] mov QWORD[((0+8))+rsp],rcx mov QWORD[((8+8))+rsp],rdi lea rdi,[((48+8))+rsp] jmp NEAR $L$sqrx8x_reduction_loop ALIGN 32 $L$sqrx8x_reduction_loop: mov r9,QWORD[8+rdi] mov r10,QWORD[16+rdi] mov r11,QWORD[24+rdi] mov r12,QWORD[32+rdi] mov r8,rdx imul rdx,rbx mov r13,QWORD[40+rdi] mov r14,QWORD[48+rdi] mov r15,QWORD[56+rdi] mov QWORD[((24+8))+rsp],rax lea rdi,[64+rdi] xor rsi,rsi mov rcx,-8 jmp NEAR $L$sqrx8x_reduce ALIGN 32 $L$sqrx8x_reduce: mov rbx,r8 mulx r8,rax,QWORD[rbp] adcx rax,rbx adox r8,r9 mulx r9,rbx,QWORD[8+rbp] adcx r8,rbx adox r9,r10 mulx r10,rbx,QWORD[16+rbp] adcx r9,rbx adox r10,r11 mulx r11,rbx,QWORD[24+rbp] adcx r10,rbx adox r11,r12 DB 0xc4,0x62,0xe3,0xf6,0xa5,0x20,0x00,0x00,0x00 mov rax,rdx mov rdx,r8 adcx r11,rbx adox r12,r13 mulx rdx,rbx,QWORD[((32+8))+rsp] mov rdx,rax mov QWORD[((64+48+8))+rcx*8+rsp],rax mulx r13,rax,QWORD[40+rbp] adcx r12,rax adox r13,r14 mulx r14,rax,QWORD[48+rbp] adcx r13,rax adox r14,r15 mulx r15,rax,QWORD[56+rbp] mov rdx,rbx adcx r14,rax adox r15,rsi adcx r15,rsi DB 0x67,0x67,0x67 inc rcx jnz NEAR $L$sqrx8x_reduce mov rax,rsi cmp rbp,QWORD[((0+8))+rsp] jae NEAR $L$sqrx8x_no_tail mov rdx,QWORD[((48+8))+rsp] add r8,QWORD[rdi] lea rbp,[64+rbp] mov rcx,-8 adcx r9,QWORD[8+rdi] adcx r10,QWORD[16+rdi] adc r11,QWORD[24+rdi] adc r12,QWORD[32+rdi] adc r13,QWORD[40+rdi] adc r14,QWORD[48+rdi] adc r15,QWORD[56+rdi] lea rdi,[64+rdi] sbb rax,rax xor rsi,rsi mov QWORD[((16+8))+rsp],rax jmp NEAR $L$sqrx8x_tail ALIGN 32 $L$sqrx8x_tail: mov rbx,r8 mulx r8,rax,QWORD[rbp] adcx rbx,rax adox r8,r9 mulx r9,rax,QWORD[8+rbp] adcx r8,rax adox r9,r10 mulx r10,rax,QWORD[16+rbp] adcx r9,rax adox r10,r11 mulx r11,rax,QWORD[24+rbp] adcx r10,rax adox r11,r12 DB 0xc4,0x62,0xfb,0xf6,0xa5,0x20,0x00,0x00,0x00 adcx r11,rax adox r12,r13 mulx r13,rax,QWORD[40+rbp] adcx r12,rax adox r13,r14 mulx r14,rax,QWORD[48+rbp] adcx r13,rax adox r14,r15 mulx r15,rax,QWORD[56+rbp] mov rdx,QWORD[((72+48+8))+rcx*8+rsp] adcx r14,rax adox r15,rsi mov QWORD[rcx*8+rdi],rbx mov rbx,r8 adcx r15,rsi inc rcx jnz NEAR $L$sqrx8x_tail cmp rbp,QWORD[((0+8))+rsp] jae NEAR $L$sqrx8x_tail_done sub rsi,QWORD[((16+8))+rsp] mov rdx,QWORD[((48+8))+rsp] lea rbp,[64+rbp] adc r8,QWORD[rdi] adc r9,QWORD[8+rdi] adc r10,QWORD[16+rdi] adc r11,QWORD[24+rdi] adc r12,QWORD[32+rdi] adc r13,QWORD[40+rdi] adc r14,QWORD[48+rdi] adc r15,QWORD[56+rdi] lea rdi,[64+rdi] sbb rax,rax sub rcx,8 xor rsi,rsi mov QWORD[((16+8))+rsp],rax jmp NEAR $L$sqrx8x_tail ALIGN 32 $L$sqrx8x_tail_done: xor rax,rax add r8,QWORD[((24+8))+rsp] adc r9,0 adc r10,0 adc r11,0 adc r12,0 adc r13,0 adc r14,0 adc r15,0 adc rax,0 sub rsi,QWORD[((16+8))+rsp] $L$sqrx8x_no_tail: adc r8,QWORD[rdi] DB 102,72,15,126,217 adc r9,QWORD[8+rdi] mov rsi,QWORD[56+rbp] DB 102,72,15,126,213 adc r10,QWORD[16+rdi] adc r11,QWORD[24+rdi] adc r12,QWORD[32+rdi] adc r13,QWORD[40+rdi] adc r14,QWORD[48+rdi] adc r15,QWORD[56+rdi] adc rax,0 mov rbx,QWORD[((32+8))+rsp] mov rdx,QWORD[64+rcx*1+rdi] mov QWORD[rdi],r8 lea r8,[64+rdi] mov QWORD[8+rdi],r9 mov QWORD[16+rdi],r10 mov QWORD[24+rdi],r11 mov QWORD[32+rdi],r12 mov QWORD[40+rdi],r13 mov QWORD[48+rdi],r14 mov QWORD[56+rdi],r15 lea rdi,[64+rcx*1+rdi] cmp r8,QWORD[((8+8))+rsp] jb NEAR $L$sqrx8x_reduction_loop DB 0F3h,0C3h ;repret ALIGN 32 __bn_postx4x_internal: mov r12,QWORD[rbp] mov r10,rcx mov r9,rcx neg rax sar rcx,3+2 DB 102,72,15,126,202 DB 102,72,15,126,206 dec r12 mov r13,QWORD[8+rbp] xor r8,r8 mov r14,QWORD[16+rbp] mov r15,QWORD[24+rbp] jmp NEAR $L$sqrx4x_sub_entry ALIGN 16 $L$sqrx4x_sub: mov r12,QWORD[rbp] mov r13,QWORD[8+rbp] mov r14,QWORD[16+rbp] mov r15,QWORD[24+rbp] $L$sqrx4x_sub_entry: andn r12,r12,rax lea rbp,[32+rbp] andn r13,r13,rax andn r14,r14,rax andn r15,r15,rax neg r8 adc r12,QWORD[rdi] adc r13,QWORD[8+rdi] adc r14,QWORD[16+rdi] adc r15,QWORD[24+rdi] mov QWORD[rdx],r12 lea rdi,[32+rdi] mov QWORD[8+rdx],r13 sbb r8,r8 mov QWORD[16+rdx],r14 mov QWORD[24+rdx],r15 lea rdx,[32+rdx] inc rcx jnz NEAR $L$sqrx4x_sub neg r9 DB 0F3h,0C3h ;repret global bn_get_bits5 ALIGN 16 bn_get_bits5: lea r10,[rcx] lea r11,[1+rcx] mov ecx,edx shr edx,4 and ecx,15 lea eax,[((-8))+rcx] cmp ecx,11 cmova r10,r11 cmova ecx,eax movzx eax,WORD[rdx*2+r10] shr eax,cl and eax,31 DB 0F3h,0C3h ;repret global bn_scatter5 ALIGN 16 bn_scatter5: cmp edx,0 jz NEAR $L$scatter_epilogue lea r8,[r9*8+r8] $L$scatter: mov rax,QWORD[rcx] lea rcx,[8+rcx] mov QWORD[r8],rax lea r8,[256+r8] sub edx,1 jnz NEAR $L$scatter $L$scatter_epilogue: DB 0F3h,0C3h ;repret global bn_gather5 ALIGN 32 bn_gather5: $L$SEH_begin_bn_gather5: DB 0x4c,0x8d,0x14,0x24 DB 0x48,0x81,0xec,0x08,0x01,0x00,0x00 lea rax,[$L$inc] and rsp,-16 movd xmm5,r9d movdqa xmm0,XMMWORD[rax] movdqa xmm1,XMMWORD[16+rax] lea r11,[128+r8] lea rax,[128+rsp] pshufd xmm5,xmm5,0 movdqa xmm4,xmm1 movdqa xmm2,xmm1 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[(-128)+rax],xmm0 movdqa xmm0,xmm4 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[(-112)+rax],xmm1 movdqa xmm1,xmm4 paddd xmm0,xmm3 pcmpeqd xmm3,xmm5 movdqa XMMWORD[(-96)+rax],xmm2 movdqa xmm2,xmm4 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa XMMWORD[(-80)+rax],xmm3 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[(-64)+rax],xmm0 movdqa xmm0,xmm4 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[(-48)+rax],xmm1 movdqa xmm1,xmm4 paddd xmm0,xmm3 pcmpeqd xmm3,xmm5 movdqa XMMWORD[(-32)+rax],xmm2 movdqa xmm2,xmm4 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa XMMWORD[(-16)+rax],xmm3 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[rax],xmm0 movdqa xmm0,xmm4 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[16+rax],xmm1 movdqa xmm1,xmm4 paddd xmm0,xmm3 pcmpeqd xmm3,xmm5 movdqa XMMWORD[32+rax],xmm2 movdqa xmm2,xmm4 paddd xmm1,xmm0 pcmpeqd xmm0,xmm5 movdqa XMMWORD[48+rax],xmm3 movdqa xmm3,xmm4 paddd xmm2,xmm1 pcmpeqd xmm1,xmm5 movdqa XMMWORD[64+rax],xmm0 movdqa xmm0,xmm4 paddd xmm3,xmm2 pcmpeqd xmm2,xmm5 movdqa XMMWORD[80+rax],xmm1 movdqa xmm1,xmm4 paddd xmm0,xmm3 pcmpeqd xmm3,xmm5 movdqa XMMWORD[96+rax],xmm2 movdqa xmm2,xmm4 movdqa XMMWORD[112+rax],xmm3 jmp NEAR $L$gather ALIGN 32 $L$gather: pxor xmm4,xmm4 pxor xmm5,xmm5 movdqa xmm0,XMMWORD[((-128))+r11] movdqa xmm1,XMMWORD[((-112))+r11] movdqa xmm2,XMMWORD[((-96))+r11] pand xmm0,XMMWORD[((-128))+rax] movdqa xmm3,XMMWORD[((-80))+r11] pand xmm1,XMMWORD[((-112))+rax] por xmm4,xmm0 pand xmm2,XMMWORD[((-96))+rax] por xmm5,xmm1 pand xmm3,XMMWORD[((-80))+rax] por xmm4,xmm2 por xmm5,xmm3 movdqa xmm0,XMMWORD[((-64))+r11] movdqa xmm1,XMMWORD[((-48))+r11] movdqa xmm2,XMMWORD[((-32))+r11] pand xmm0,XMMWORD[((-64))+rax] movdqa xmm3,XMMWORD[((-16))+r11] pand xmm1,XMMWORD[((-48))+rax] por xmm4,xmm0 pand xmm2,XMMWORD[((-32))+rax] por xmm5,xmm1 pand xmm3,XMMWORD[((-16))+rax] por xmm4,xmm2 por xmm5,xmm3 movdqa xmm0,XMMWORD[r11] movdqa xmm1,XMMWORD[16+r11] movdqa xmm2,XMMWORD[32+r11] pand xmm0,XMMWORD[rax] movdqa xmm3,XMMWORD[48+r11] pand xmm1,XMMWORD[16+rax] por xmm4,xmm0 pand xmm2,XMMWORD[32+rax] por xmm5,xmm1 pand xmm3,XMMWORD[48+rax] por xmm4,xmm2 por xmm5,xmm3 movdqa xmm0,XMMWORD[64+r11] movdqa xmm1,XMMWORD[80+r11] movdqa xmm2,XMMWORD[96+r11] pand xmm0,XMMWORD[64+rax] movdqa xmm3,XMMWORD[112+r11] pand xmm1,XMMWORD[80+rax] por xmm4,xmm0 pand xmm2,XMMWORD[96+rax] por xmm5,xmm1 pand xmm3,XMMWORD[112+rax] por xmm4,xmm2 por xmm5,xmm3 por xmm4,xmm5 lea r11,[256+r11] pshufd xmm0,xmm4,0x4e por xmm0,xmm4 movq QWORD[rcx],xmm0 lea rcx,[8+rcx] sub edx,1 jnz NEAR $L$gather lea rsp,[r10] DB 0F3h,0C3h ;repret $L$SEH_end_bn_gather5: ALIGN 64 $L$inc: DD 0,0,1,1 DD 2,2,2,2 DB 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105 DB 112,108,105,99,97,116,105,111,110,32,119,105,116,104,32,115 DB 99,97,116,116,101,114,47,103,97,116,104,101,114,32,102,111 DB 114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79 DB 71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111 DB 112,101,110,115,115,108,46,111,114,103,62,0 EXTERN __imp_RtlVirtualUnwind ALIGN 16 mul_handler: push rsi push rdi push rbx push rbp push r12 push r13 push r14 push r15 pushfq sub rsp,64 mov rax,QWORD[120+r8] mov rbx,QWORD[248+r8] mov rsi,QWORD[8+r9] mov r11,QWORD[56+r9] mov r10d,DWORD[r11] lea r10,[r10*1+rsi] cmp rbx,r10 jb NEAR $L$common_seh_tail mov r10d,DWORD[4+r11] lea r10,[r10*1+rsi] cmp rbx,r10 jb NEAR $L$common_pop_regs mov rax,QWORD[152+r8] mov r10d,DWORD[8+r11] lea r10,[r10*1+rsi] cmp rbx,r10 jae NEAR $L$common_seh_tail lea r10,[$L$mul_epilogue] cmp rbx,r10 ja NEAR $L$body_40 mov r10,QWORD[192+r8] mov rax,QWORD[8+r10*8+rax] jmp NEAR $L$common_pop_regs $L$body_40: mov rax,QWORD[40+rax] $L$common_pop_regs: mov rbx,QWORD[((-8))+rax] mov rbp,QWORD[((-16))+rax] mov r12,QWORD[((-24))+rax] mov r13,QWORD[((-32))+rax] mov r14,QWORD[((-40))+rax] mov r15,QWORD[((-48))+rax] mov QWORD[144+r8],rbx mov QWORD[160+r8],rbp mov QWORD[216+r8],r12 mov QWORD[224+r8],r13 mov QWORD[232+r8],r14 mov QWORD[240+r8],r15 $L$common_seh_tail: mov rdi,QWORD[8+rax] mov rsi,QWORD[16+rax] mov QWORD[152+r8],rax mov QWORD[168+r8],rsi mov QWORD[176+r8],rdi mov rdi,QWORD[40+r9] mov rsi,r8 mov ecx,154 DD 0xa548f3fc mov rsi,r9 xor rcx,rcx mov rdx,QWORD[8+rsi] mov r8,QWORD[rsi] mov r9,QWORD[16+rsi] mov r10,QWORD[40+rsi] lea r11,[56+rsi] lea r12,[24+rsi] mov QWORD[32+rsp],r10 mov QWORD[40+rsp],r11 mov QWORD[48+rsp],r12 mov QWORD[56+rsp],rcx call QWORD[__imp_RtlVirtualUnwind] mov eax,1 add rsp,64 popfq pop r15 pop r14 pop r13 pop r12 pop rbp pop rbx pop rdi pop rsi DB 0F3h,0C3h ;repret section .pdata rdata align=4 ALIGN 4 DD $L$SEH_begin_bn_mul_mont_gather5 wrt ..imagebase DD $L$SEH_end_bn_mul_mont_gather5 wrt ..imagebase DD $L$SEH_info_bn_mul_mont_gather5 wrt ..imagebase DD $L$SEH_begin_bn_mul4x_mont_gather5 wrt ..imagebase DD $L$SEH_end_bn_mul4x_mont_gather5 wrt ..imagebase DD $L$SEH_info_bn_mul4x_mont_gather5 wrt ..imagebase DD $L$SEH_begin_bn_power5 wrt ..imagebase DD $L$SEH_end_bn_power5 wrt ..imagebase DD $L$SEH_info_bn_power5 wrt ..imagebase DD $L$SEH_begin_bn_from_mont8x wrt ..imagebase DD $L$SEH_end_bn_from_mont8x wrt ..imagebase DD $L$SEH_info_bn_from_mont8x wrt ..imagebase DD $L$SEH_begin_bn_mulx4x_mont_gather5 wrt ..imagebase DD $L$SEH_end_bn_mulx4x_mont_gather5 wrt ..imagebase DD $L$SEH_info_bn_mulx4x_mont_gather5 wrt ..imagebase DD $L$SEH_begin_bn_powerx5 wrt ..imagebase DD $L$SEH_end_bn_powerx5 wrt ..imagebase DD $L$SEH_info_bn_powerx5 wrt ..imagebase DD $L$SEH_begin_bn_gather5 wrt ..imagebase DD $L$SEH_end_bn_gather5 wrt ..imagebase DD $L$SEH_info_bn_gather5 wrt ..imagebase section .xdata rdata align=8 ALIGN 8 $L$SEH_info_bn_mul_mont_gather5: DB 9,0,0,0 DD mul_handler wrt ..imagebase DD $L$mul_body wrt ..imagebase,$L$mul_body wrt ..imagebase,$L$mul_epilogue wrt ..imagebase ALIGN 8 $L$SEH_info_bn_mul4x_mont_gather5: DB 9,0,0,0 DD mul_handler wrt ..imagebase DD $L$mul4x_prologue wrt ..imagebase,$L$mul4x_body wrt ..imagebase,$L$mul4x_epilogue wrt ..imagebase ALIGN 8 $L$SEH_info_bn_power5: DB 9,0,0,0 DD mul_handler wrt ..imagebase DD $L$power5_prologue wrt ..imagebase,$L$power5_body wrt ..imagebase,$L$power5_epilogue wrt ..imagebase ALIGN 8 $L$SEH_info_bn_from_mont8x: DB 9,0,0,0 DD mul_handler wrt ..imagebase DD $L$from_prologue wrt ..imagebase,$L$from_body wrt ..imagebase,$L$from_epilogue wrt ..imagebase ALIGN 8 $L$SEH_info_bn_mulx4x_mont_gather5: DB 9,0,0,0 DD mul_handler wrt ..imagebase DD $L$mulx4x_prologue wrt ..imagebase,$L$mulx4x_body wrt ..imagebase,$L$mulx4x_epilogue wrt ..imagebase ALIGN 8 $L$SEH_info_bn_powerx5: DB 9,0,0,0 DD mul_handler wrt ..imagebase DD $L$powerx5_prologue wrt ..imagebase,$L$powerx5_body wrt ..imagebase,$L$powerx5_epilogue wrt ..imagebase ALIGN 8 $L$SEH_info_bn_gather5: DB 0x01,0x0b,0x03,0x0a DB 0x0b,0x01,0x21,0x00 DB 0x04,0xa3,0x00,0x00 ALIGN 8
programs/oeis/099/A099366.asm
neoneye/loda
22
176656
<gh_stars>10-100 ; A099366: Squares of A005668(n) (generalized Fibonacci). ; 0,1,36,1369,51984,1974025,74960964,2846542609,108093658176,4104712468081,155870980128900,5918992532430121,224765845252215696,8535183127051766329,324112192982714904804,12307728150216114616225 seq $0,5668 ; Denominators of continued fraction convergents to sqrt(10). pow $0,2
source/amf/mof/cmof/amf-cmof-multiplicity_elements.ads
svn2github/matreshka
24
2636
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ -- A multiplicity is a definition of an inclusive interval of non-negative -- integers beginning with a lower bound and ending with a (possibly -- infinite) upper bound. A multiplicity element embeds this information to -- specify the allowable cardinalities for an instantiation of this element. ------------------------------------------------------------------------------ with AMF.CMOF.Elements; package AMF.CMOF.Multiplicity_Elements is pragma Preelaborate; type CMOF_Multiplicity_Element is limited interface and AMF.CMOF.Elements.CMOF_Element; type CMOF_Multiplicity_Element_Access is access all CMOF_Multiplicity_Element'Class; for CMOF_Multiplicity_Element_Access'Storage_Size use 0; not overriding function Get_Is_Ordered (Self : not null access constant CMOF_Multiplicity_Element) return Boolean is abstract; -- Getter of MultiplicityElement::isOrdered. -- -- For a multivalued multiplicity, this attribute specifies whether the -- values in an instantiation of this element are sequentially ordered. not overriding procedure Set_Is_Ordered (Self : not null access CMOF_Multiplicity_Element; To : Boolean) is abstract; -- Setter of MultiplicityElement::isOrdered. -- -- For a multivalued multiplicity, this attribute specifies whether the -- values in an instantiation of this element are sequentially ordered. not overriding function Get_Is_Unique (Self : not null access constant CMOF_Multiplicity_Element) return Boolean is abstract; -- Getter of MultiplicityElement::isUnique. -- -- For a multivalued multiplicity, this attributes specifies whether the -- values in an instantiation of this element are unique. not overriding procedure Set_Is_Unique (Self : not null access CMOF_Multiplicity_Element; To : Boolean) is abstract; -- Setter of MultiplicityElement::isUnique. -- -- For a multivalued multiplicity, this attributes specifies whether the -- values in an instantiation of this element are unique. not overriding function Get_Lower (Self : not null access constant CMOF_Multiplicity_Element) return AMF.Optional_Integer is abstract; -- Getter of MultiplicityElement::lower. -- -- Specifies the lower bound of the multiplicity interval. not overriding procedure Set_Lower (Self : not null access CMOF_Multiplicity_Element; To : AMF.Optional_Integer) is abstract; -- Setter of MultiplicityElement::lower. -- -- Specifies the lower bound of the multiplicity interval. not overriding function Get_Upper (Self : not null access constant CMOF_Multiplicity_Element) return AMF.Optional_Unlimited_Natural is abstract; -- Getter of MultiplicityElement::upper. -- -- Specifies the upper bound of the multiplicity interval. not overriding procedure Set_Upper (Self : not null access CMOF_Multiplicity_Element; To : AMF.Optional_Unlimited_Natural) is abstract; -- Setter of MultiplicityElement::upper. -- -- Specifies the upper bound of the multiplicity interval. not overriding function Is_Multivalued (Self : not null access constant CMOF_Multiplicity_Element) return Boolean is abstract; -- Operation MultiplicityElement::isMultivalued. -- -- The query isMultivalued() checks whether this multiplicity has an upper -- bound greater than one. not overriding function Includes_Multiplicity (Self : not null access constant CMOF_Multiplicity_Element; M : AMF.CMOF.Multiplicity_Elements.CMOF_Multiplicity_Element_Access) return Boolean is abstract; -- Operation MultiplicityElement::includesMultiplicity. -- -- The query includesMultiplicity() checks whether this multiplicity -- includes all the cardinalities allowed by the specified multiplicity. not overriding function Includes_Cardinality (Self : not null access constant CMOF_Multiplicity_Element; C : Integer) return Boolean is abstract; -- Operation MultiplicityElement::includesCardinality. -- -- The query includesCardinality() checks whether the specified -- cardinality is valid for this multiplicity. not overriding function Lower_Bound (Self : not null access constant CMOF_Multiplicity_Element) return Integer is abstract; -- Operation MultiplicityElement::lowerBound. -- -- The query lowerBound() returns the lower bound of the multiplicity as -- an integer. not overriding function Upper_Bound (Self : not null access constant CMOF_Multiplicity_Element) return AMF.Unlimited_Natural is abstract; -- Operation MultiplicityElement::upperBound. -- -- The query upperBound() returns the upper bound of the multiplicity for -- a bounded multiplicity as an unlimited natural. end AMF.CMOF.Multiplicity_Elements;
src/support_utils/support_utils-word_parameters.adb
lenzomj/whitakers-words
204
17215
<reponame>lenzomj/whitakers-words<gh_stars>100-1000 -- WORDS, a Latin dictionary, by <NAME> (USAF, Retired) -- -- Copyright <NAME> (1936–2010) -- -- This is a free program, which means it is proper to copy it and pass -- it on to your friends. Consider it a developmental item for which -- there is no charge. However, just for form, it is Copyrighted -- (c). Permission is hereby freely given for any and all use of program -- and data. You can sell it as your own, but at least tell me. -- -- This version is distributed without obligation, but the developer -- would appreciate comments and suggestions. -- -- All parts of the WORDS system, source code and data files, are made freely -- available to anyone who wishes to use them, for whatever purpose. with Latin_Utils.Strings_Package; use Latin_Utils.Strings_Package; with Latin_Utils.Latin_File_Names; use Latin_Utils.Latin_File_Names; with Latin_Utils.Config; use Latin_Utils.Config; with Latin_Utils.Preface; use Latin_Utils; pragma Elaborate (Latin_Utils.Preface); package body Support_Utils.Word_Parameters is use Ada.Text_IO; type Help_Type is array (Natural range <>) of String (1 .. 70); Blank_Help_Line : constant String (1 .. 70) := (others => ' '); No_Help : constant Help_Type := (2 .. 1 => Blank_Help_Line); type Reply_Type is (N, Y); package Reply_Type_Io is new Ada.Text_IO.Enumeration_IO (Reply_Type); Reply : constant array (Boolean) of Reply_Type := (N, Y); Mode_Of_Reply : constant array (Reply_Type) of Boolean := (False, True); Blank_Input : exception; -- The default modes are set in the body so that they can be changed -- with only this being recompiled, not the rest of the with'ing system Default_Mode_Array : constant Mode_Array := ( Trim_Output => True, Have_Output_File => False, Write_Output_To_File => False, Do_Unknowns_Only => False, Write_Unknowns_To_File => False, Ignore_Unknown_Names => True, Ignore_Unknown_Caps => True, Do_Compounds => True, Do_Fixes => True, Do_Tricks => True, Do_Dictionary_Forms => True, Show_Age => False, Show_Frequency => False, Do_Examples => False, Do_Only_Meanings => False, Do_Stems_For_Unknown => False); Bad_Mode_File : exception; -- FIXME: this help text seems to duplicate what's in developer_parameters Trim_Output_Help : constant Help_Type := ( "This option instructs the program to remove from the Output list of ", "possible constructs those which are least likely. There is now a fair", "amount of trimming, killing LOC and VOC plus removing Uncommon and ", "non-classical (Archaic/Medieval) when more common results are found ", "and this action is requested (turn it off in MDV (!) parameters). ", "When a TRIM has been done, Output is usually followed by asterix (*). ", "The asterix may be missing depending on where the TRIM is done. ", "There certainly is no absolute assurence that the items removed are ", "not correct, just that they are statistically less likely. ", "Note that poets are likely to employ unusual words and inflections for", "various reasons. These may be trimmed out if this parameter in on. ", "When in English mode, trim just reduces the Output to the top six ", "results, if there are that many. Asterix means there are more. ", " The default is Y(es) "); Have_Output_File_Help : constant Help_Type := ( "This option instructs the program to Create a file which can hold the ", "Output for later study, otherwise the results are just displayed on ", "the screen. The Output file is named " & Output_Full_Name & (39 + Output_Full_Name'Length .. 70 => ' '), "This means that one run will necessarily overWrite a previous run, ", "unless the previous results are renamed or copied to a file of another", "name. This is available if the METHOD is INTERACTIVE, no parameters. ", "The default is N(o), since this prevents the program from overwriting ", "previous work unintentionally. Y(es) Creates the Output file. "); Write_Output_To_File_Help : constant Help_Type := ( "This option instructs the program, when HAVE_OUTPUT_FILE is on, to ", "Write results to the file " & Output_Full_Name & (27 + Output_Full_Name'Length .. 70 => ' '), "This option may be turned on and off during running of the program, ", "thereby capturing only certain desired results. If the option ", "HAVE_OUTPUT_FILE is off, the user will not be given a chance to turn ", "this one on. Only for INTERACTIVE running. Default is N(o). ", "This works in English mode, but Output in somewhat different so far. "); Do_Unknowns_Only_Help : constant Help_Type := ( "This option instructs the program to only Output those words that it ", "cannot resolve. Of course, it has to do processing on all words, but ", "those that are found (with prefix/suffix, if that option in on) will ", "be ignored. The purpose of this option is to allow a quick look to ", "determine if the dictionary and process is going to do an acceptable ", "job on the current text. It also allows the user to assemble a list ", "of unknown words to look up manually, and perhaps augment the system ", "dictionary. For those purposes, the system is usually run with the ", "MINIMIZE_OUTPUT option, just producing a list. Another use is to run ", "without MINIMIZE to an Output file. This gives a list of the Input ", "text with the unknown words, by line. This functions as a spelling ", "checker for Latin texts. The default is N(o). ", "This does not work in English mode, but may in the future. "); Write_Unknowns_To_File_Help : constant Help_Type := ( "This option instructs the program to Write all unresolved words to a ", "UNKNOWNS file named " & Unknowns_Full_Name & (21 + Unknowns_Full_Name'Length .. 70 => ' '), "With this option on, the file of unknowns is written, even though ", "the main Output contains both known and unknown (unresolved) words. ", "One may wish to save the unknowns for later analysis, testing, or to ", "form the basis for dictionary additions. When this option is turned ", "on, the UNKNOWNS file is written, destroying any file from a previous ", "run. However, the Write may be turned on and off during a single run ", "without destroying the information written in that run. ", "This option is for specialized use, so its default is N(o). ", "This does not work in English mode, but may in the future. "); Ignore_Unknown_Names_Help : constant Help_Type := ( "This option instructs the program to assume that any capitalized word ", "longer than three letters is a proper name. As no dictionary can be ", "expected to account for many proper names, many such occur that would ", "be called UNKNOWN. This contaminates the Output in most cases, and ", "it is often convenient to ignore these spurious UNKNOWN hits. This ", "option implements that mode, and calls such words proper names. ", "Any proper names that are in the dictionary are handled in the normal ", "manner. The default is Y(es). "); Ignore_Unknown_Caps_Help : constant Help_Type := ( "This option instructs the program to assume that any all caps word ", "is a proper name or similar designation. This convention is often ", "used to designate speakers in a discussion or play. No dictionary can", "claim to be exhaustive on proper names, so many such occur that would ", "be called UNKNOWN. This contaminates the Output in most cases, and ", "it is often convenient to ignore these spurious UNKNOWN hits. This ", "option implements that mode, and calls such words names. Any similar ", "designations that are in the dictionary are handled in the normal ", "manner, as are normal words in all caps. The default is Y(es). "); Do_Compounds_Help : constant Help_Type := ( "This option instructs the program to look ahead for the verb TO_BE (or", "iri) when it finds a verb participle, with the expectation of finding ", "a compound perfect tense or periphrastic. This option can also be a ", "trimming of the output, in that VPAR that do not fit (not NOM) will be", "excluded, possible interpretations are lost. Default choice is Y(es).", "This processing is turned off with the choice of N(o). "); Do_Fixes_Help : constant Help_Type := ( "This option instructs the program, when it is unable to find a proper ", "match in the dictionary, to attach various prefixes and suffixes and ", "try again. This effort is successful in about a quarter of the cases ", "which would otherwise give UNKNOWN results, or so it seems in limited ", "tests. For those cases in which a result is produced, about half give", "easily interpreted Output; many of the rest are etymologically True, ", "but not necessarily obvious; about a tenth give entirely spurious ", "derivations. The user must proceed with caution. ", "The default choice is Y(es), since the results are generally useful. ", "This processing can be turned off with the choice of N(o). "); Do_Tricks_Help : constant Help_Type := ( "This option instructs the program, when it is unable to find a proper ", "match in the dictionary, and after various prefixes and suffixes, to ", "try every dirty Latin trick it can think of, mainly common letter ", "replacements like cl -> cul, vul -> vol, ads -> ass, inp -> imp, etc. ", "Together these tricks are useful, but may give False Positives (>10%).", "They provide for recognized variants in classical spelling. Most of ", "the texts with which this program will be used have been well edited ", "and standardized in spelling. Now, moreover, the dictionary is being", "populated to such a state that the hit rate on tricks has fallen to a ", "low level. It is very seldom productive, and it is always expensive. ", "The only excuse for keeping it as default is that now the dictionary ", "is quite extensive and misses are rare. Default is now Y(es). "); Do_Dictionary_Forms_Help : constant Help_Type := ( "This option instructs the program to Output a line with the forms ", "normally associated with a dictionary entry (NOM and GEN of a noun, ", "the four principal parts of a verb, M-F-N NOM of an adjective, ...). ", "This occurs when there is other Output (i.e., not with UNKNOWNS_ONLY).", "The default choice is N(o), but it can be turned on with a Y(es). "); Show_Age_Help : constant Help_Type := ( "This option causes a flag, like '<Late>' to appear for inflection or ", "form in the Output. The AGE indicates when this word/inflection was ", "in use, at least from indications is dictionary citations. It is ", "just an indication, not controlling, useful when there are choices. ", "No indication means that it is common throughout all periods. ", "The default choice is Y(es), but it can be turned off with a N(o). "); Show_Frequency_Help : constant Help_Type := ( "This option causes a flag, like '<rare>' to appear for inflection or ", "form in the Output. The FREQ is indicates the relative usage of the ", "word or inflection, from indications is dictionary citations. It is ", "just an indication, not controlling, useful when there are choices. ", "No indication means that it is common throughout all periods. ", "The default choice is Y(es), but it can be turned off with a N(o). "); Do_Examples_Help : constant Help_Type := ( "This option instructs the program to provide examples of usage of the ", "cases/tenses/etc. that were constructed. The default choice is N(o). ", "This produces lengthy Output and is turned on with the choice Y(es). "); Do_Only_Meanings_Help : constant Help_Type := ( "This option instructs the program to only Output the MEANING for a ", "word, and omit the inflection details. This is primarily used in ", "analyzing new dictionary material, comparing with the existing. ", "However it may be of use for the translator who knows most all of ", "the words and just needs a little reminder for a few. ", "The default choice is N(o), but it can be turned on with a Y(es). "); Do_Stems_For_Unknown_Help : constant Help_Type := ( "This option instructs the program, when it is unable to find a proper ", "match in the dictionary, and after various prefixes and suffixes, to ", "list the dictionary entries around the unknown. This will likely ", "catch a substantive for which only the ADJ stem appears in dictionary,", "an ADJ for which there is only a N stem, etc. This option should ", "probably only be used with individual UNKNOWN words, and off-line ", "from full translations, therefore the default choice is N(o). ", "This processing can be turned on with the choice of Y(es). "); Save_Parameters_Help : constant Help_Type := ( "This option instructs the program, to save the current parameters, as ", "just established by the user, in a file WORD.MOD. If such a file ", "exists, the program will load those parameters at the start. If no ", "such file can be found in the current subdirectory, the program will ", "start with a default set of parameters. Since this parameter file is ", "human-readable ASCII, it may also be Created with a text editor. If ", "the file found has been improperly Created, is in the wrong format, or", "otherwise uninterpretable by the program, it will be ignored and the ", "default parameters used, until a proper parameter file in written by ", "the program. Since one may want to make temporary changes during a ", "run, but revert to the usual set, the default is N(o). "); procedure Put (Help : Help_Type) is begin New_Line; for I in Help'First .. Help'Last loop Put_Line (Help (I)); end loop; New_Line; end Put; procedure Put_Modes is use Mode_Type_Io; use Reply_Type_Io; begin if Is_Open (Mode_File) then Close (Mode_File); end if; Create (Mode_File, Out_File, Mode_Full_Name); for I in Words_Mode'Range loop Put (Mode_File, I); Set_Col (Mode_File, 35); Put (Mode_File, Reply (Words_Mode (I))); New_Line (Mode_File); end loop; Close (Mode_File); end Put_Modes; procedure Get_Modes is --(M : out MODE_ARRAY) is use Mode_Type_Io; use Reply_Type_Io; Mo : Mode_Type; Rep : Reply_Type; begin Open (Mode_File, In_File, Path (Mode_Full_Name)); while not End_Of_File (Mode_File) loop Get (Mode_File, Mo); Get (Mode_File, Rep); Words_Mode (Mo) := Mode_Of_Reply (Rep); end loop; Close (Mode_File); exception when Name_Error => raise; when others => raise Bad_Mode_File; end Get_Modes; procedure Inquire (Mo : Mode_Type; Help : in Help_Type := No_Help) is use Mode_Type_Io; use Reply_Type_Io; L1 : String (1 .. 100) := (others => ' '); Ll : Natural; R : Reply_Type; begin Put (Mo); Put (" ? "); Set_Col (45); Put ("(Currently "); Put (Reply (Words_Mode (Mo))); Put (" =>"); Get_Line (L1, Ll); if Ll /= 0 then if Trim (L1 (1 .. Ll)) = "" then Put_Line ("Blank Input, skipping the rest of CHANGE_PARAMETERS"); raise Blank_Input; elsif L1 (1) = '?' then Put (Help); Inquire (Mo, Help); else Get (L1 (1 .. Ll), R, Ll); Words_Mode (Mo) := Mode_Of_Reply (R); end if; end if; New_Line; end Inquire; procedure Change_Parameters is L1 : String (1 .. 100) := (others => ' '); Ll : Natural; R : Reply_Type; begin Put_Line ("To set/change parameters reply Y/y or N/n" & ". Return accepts current value."); Put_Line ("A '?' reply gives information/help on that parameter." & " A space skips the rest."); New_Line; -- Interactive mode - lets you do things on unknown words -- You can say it is a noun and then look at the endings -- Or look all the endings and guess what part of speech -- You can look at the dictionary items that are Close to the word -- There may be cases in which the stem is found but is not of right part -- So maybe the word list is deficient and that root goes also to a ADJ -- even if it is listed only for a N. -- One can also look for ADV here with ending 'e', etc. -- You can look up the word in a paper dictionary (with the help -- of ending) -- And then enter the word into DICT.LOC, so it will hit next time -- All unknowns could be recorded in a file for later reference -- A '?' gives information (help) about the item in question -- One can change the symbol that the main program uses for change -- and file -- One can save the new parameters or let them revert to previous -- There should be a basic set of parameters that one can always go to -- There should be moods of translation, maybe to switch dictionaries -- Maybe to turn on or off pre/suffix -- Maybe to allow the user to look at just all the prefixes that match Inquire (Trim_Output, Trim_Output_Help); Inquire (Have_Output_File, Have_Output_File_Help); if Is_Open (Output) and then not Words_Mode (Have_Output_File) then Close (Output); Words_Mode (Write_Output_To_File) := False; end if; if not Is_Open (Output) and then Words_Mode (Have_Output_File) then begin Create (Output, Out_File, Output_Full_Name); exception when others => Put_Line ("Cannot CREATE WORD.OUT - Check if it is in use elsewhere"); end; end if; if Words_Mode (Have_Output_File) then Inquire (Write_Output_To_File, Write_Output_To_File_Help); end if; Inquire (Do_Unknowns_Only, Do_Unknowns_Only_Help); Inquire (Write_Unknowns_To_File, Write_Unknowns_To_File_Help); -- If there is an Open file then OK -- If not Open and you now want to start writing to UNKNOWNS, the CREATE if not Is_Open (Unknowns) and then Words_Mode (Write_Unknowns_To_File) then begin Create (Unknowns, Out_File, Unknowns_Full_Name); exception when others => Put_Line ("Cannot CREATE WORD.UNK - Check if it is in use elsewhere"); end; end if; Inquire (Ignore_Unknown_Names, Ignore_Unknown_Names_Help); Inquire (Ignore_Unknown_Caps, Ignore_Unknown_Caps_Help); Inquire (Do_Compounds, Do_Compounds_Help); Inquire (Do_Fixes, Do_Fixes_Help); Inquire (Do_Tricks, Do_Tricks_Help); Inquire (Do_Dictionary_Forms, Do_Dictionary_Forms_Help); Inquire (Show_Age, Show_Age_Help); Inquire (Show_Frequency, Show_Frequency_Help); Inquire (Do_Examples, Do_Examples_Help); Inquire (Do_Only_Meanings, Do_Only_Meanings_Help); Inquire (Do_Stems_For_Unknown, Do_Stems_For_Unknown_Help); Put ("Do you wish to save this set of parameters? Y or N (Default) "); Put (" =>"); Get_Line (L1, Ll); if Ll /= 0 then if L1 (1) = '?' then Put (Save_Parameters_Help); Put ("Do you wish to save this set of parameters? Y or N (Default) "); Put (" =>"); Get_Line (L1, Ll); end if; Reply_Type_Io.Get (L1 (1 .. Ll), R, Ll); if Mode_Of_Reply (R) then Put_Modes; Put_Line ("MODE_ARRAY saved in file " & Mode_Full_Name); end if; end if; New_Line; exception when Blank_Input => null; when others => Put_Line ("Bad Input - terminating CHANGE_PARAMETERS"); end Change_Parameters; procedure Initialize_Word_Parameters is begin Words_Mode := Default_Mode_Array; --TEXT_IO.PUT_LINE ("Initializing WORD_PARAMETERS"); Do_Mode_File : begin -- Read the mode file Get_Modes; --(WORDS_MODE); Preface.Put_Line ("MODE_FILE found - Using those modes and parameters"); exception -- If there is any problem -- Put that the mode file is corrupted and the options are: -- to proceed with default parameters -- to set parameters with a CHANGE (SET) PARAMETERS and save -- to examine the mode file with a text editor and try to repair it when Name_Error => Words_Mode := Default_Mode_Array; when Bad_Mode_File => Put_Line ("MODE_FILE exists, but empty or corupted - Default modes used"); Put_Line ("You can set new parameters with CHANGE PARAMETERS and save."); Words_Mode := Default_Mode_Array; when others => Put_Line ("MODE_FILE others ERROR"); Words_Mode := Default_Mode_Array; end Do_Mode_File; if ((Method = Interactive) or (Method = Command_Line_Input)) and then (not Ada.Text_IO.Is_Open (Output)) and then (Words_Mode (Have_Output_File)) then Ada.Text_IO.Create (Output, Ada.Text_IO.Out_File, Output_Full_Name); --TEXT_IO.PUT_LINE ("WORD.OUT Created at Initialization"); Preface.Put_Line ("WORD.OUT Created at Initialization"); end if; if not Ada.Text_IO.Is_Open (Unknowns) and then Words_Mode (Write_Unknowns_To_File) then Ada.Text_IO.Create (Unknowns, Ada.Text_IO.Out_File, Unknowns_Full_Name); Preface.Put_Line ("WORD.UNK Created at Initialization"); end if; end Initialize_Word_Parameters; end Support_Utils.Word_Parameters;
data/pokemon/base_stats/haunter.asm
opiter09/ASM-Machina
1
16980
<gh_stars>1-10 db DEX_HAUNTER ; pokedex id db 45, 50, 45, 95, 115 ; hp atk def spd spc db GHOST, POISON ; type db 90 ; catch rate db 126 ; base exp INCBIN "gfx/pokemon/front/haunter.pic", 0, 1 ; sprite dimensions dw HaunterPicFront, HaunterPicBack db LICK, CONFUSE_RAY, NIGHT_SHADE, NO_MOVE ; level 1 learnset db GROWTH_MEDIUM_SLOW ; growth rate ; tm/hm learnset tmhm TOXIC, RAGE, MEGA_DRAIN, THUNDERBOLT, THUNDER, \ PSYCHIC_M, MIMIC, DOUBLE_TEAM, BIDE, SELFDESTRUCT, \ DREAM_EATER, REST, PSYWAVE, EXPLOSION, SUBSTITUTE, \ NIGHT_SHADE ; end db 0 ; padding
libsrc/spectrum/tape/tape_load_block_callee.asm
andydansby/z88dk-mk2
1
169984
; ; Tape load routine ; ; djm 16/10/2001 ; ; int __CALLEE__ tape_load_block_callee(void *addr, size_t len, unsigned char type) ; XLIB tape_load_block_callee XDEF ASMDISP_TAPE_LOAD_BLOCK_CALLEE XREF call_rom3 .tape_load_block_callee pop hl pop bc ld a,c pop de pop ix push hl .asmentry ; enter : ix = addr ; de = len ; a = type scf call call_rom3 defw 1366 ;call ROM3 load routine ld hl,-1 ret nc ;error inc hl ;okay ret DEFC ASMDISP_TAPE_LOAD_BLOCK_CALLEE = asmentry - tape_load_block_callee
ladder.asm
dsprenkels/curve13318
3
13800
<reponame>dsprenkels/curve13318 ; Ladder for shared secret point multiplication ; ; Author: <NAME> <<EMAIL>> %include "ge_add.mac" %include "ge_double.mac" %include "select.mac" global crypto_scalarmult_curve13318_ref12_ladder section .text crypto_scalarmult_curve13318_ref12_ladder: ; Double-and-add ladder for shared secret point multiplication ; ; Arguments: ; ge q: [rdi] ; uint8_t *windows: [rsi] ; ge ptable[16]: [rdx] ; %xdefine stack_size 6*384 + 192 + 768 ; prologue push rbp mov rbp, rsp and rsp, -32 sub rsp, stack_size mov qword [rsp - 8], r8 mov qword [rsp - 16], r9 mov qword [rsp - 24], r10 mov qword [rsp - 32], r11 mov qword [rsp - 40], rbx ; start loop xor rcx, rcx .ladderstep: xor rbx, rbx .ladderstep_double: ge_double rdi, rdi, rsp add rbx, 1 cmp rbx, 5 jl .ladderstep_double ; Our lookup table is one-based indexed. The neutral element is not stored ; in `ptable`, but written by `ge_neutral`. The mapping from `bits` to `idx` ; is defined by the following: ; ; compute_idx :: Word8 -> Word8 ; compute_idx bits ; | 0 <= bits < 16 = x - 1 // sign is (+) ; | 16 <= bits < 32 = ~x // sign is (-) movzx rax, byte [rsi + rcx] mov r8, rax shr r8b, 4 and r8b, 1 ; sign mov r9, r8 mov r11, r8 ; save for later neg r8b ; signmask sub r9b, 1 ; ~signmask mov r10, rax not r10b ; ~bits and r8b, r10b sub al, 1 ; bits - 1 and r9b, al or r8b, r9b and r8b, 0x1F ; force the result idx to be in [0, 0x1F] select r8b, rdx ; conditionally negate y if sign == 1 shl r11, 63 ; 0b100.. or 0b000.. vmovq xmm15, r11 vmovddup xmm15, xmm15 vinsertf128 ymm15, xmm15, 0b1 ; conditionally flip the sign bit vxorpd ymm3, ymm3, ymm15 vxorpd ymm4, ymm4, ymm15 vxorpd ymm5, ymm5, ymm15 ; save the point to the stack vmovapd [rsp + 5*384], ymm0 vmovapd [rsp + 5*384 + 1*32], ymm1 vmovapd [rsp + 5*384 + 2*32], ymm2 vmovapd [rsp + 5*384 + 3*32], ymm3 vmovapd [rsp + 5*384 + 4*32], ymm4 vmovapd [rsp + 5*384 + 5*32], ymm5 vmovapd [rsp + 5*384 + 6*32], ymm6 vmovapd [rsp + 5*384 + 7*32], ymm7 vmovapd [rsp + 5*384 + 8*32], ymm8 ; put p at [rsp + 5*384] = t5, will be overwritten but we don't care ; add q and p into q ge_add rdi, rdi, rsp + 5*384, rsp ; loop repeat add rcx, 1 cmp rcx, 51 jl .ladderstep ; epilogue mov rbx, qword [rsp - 40] mov r11, qword [rsp - 32] mov r10, qword [rsp - 24] mov r9, qword [rsp - 16] mov r8, qword [rsp - 8] mov rsp, rbp pop rbp ret section .rodata select_consts fe12x4_mul_consts fe12x4_squeeze_consts ge_double_consts ge_add_consts
target/cos_117/disasm/iop_overlay1/HSXGET.asm
jrrk2/cray-sim
49
28792
<filename>target/cos_117/disasm/iop_overlay1/HSXGET.asm 0x0000 (0x000000) 0x101D- f:00010 d: 29 | A = 29 (0x001D) 0x0001 (0x000002) 0x2929- f:00024 d: 297 | OR[297] = A 0x0002 (0x000004) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x0003 (0x000006) 0x292A- f:00024 d: 298 | OR[298] = A 0x0004 (0x000008) 0x1129- f:00010 d: 297 | A = 297 (0x0129) 0x0005 (0x00000A) 0x5800- f:00054 d: 0 | B = A 0x0006 (0x00000C) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0007 (0x00000E) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0008 (0x000010) 0x2006- f:00020 d: 6 | A = OR[6] 0x0009 (0x000012) 0x140C- f:00012 d: 12 | A = A + 12 (0x000C) 0x000A (0x000014) 0x2908- f:00024 d: 264 | OR[264] = A 0x000B (0x000016) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x000C (0x000018) 0x2922- f:00024 d: 290 | OR[290] = A 0x000D (0x00001A) 0x2006- f:00020 d: 6 | A = OR[6] 0x000E (0x00001C) 0x140D- f:00012 d: 13 | A = A + 13 (0x000D) 0x000F (0x00001E) 0x2908- f:00024 d: 264 | OR[264] = A 0x0010 (0x000020) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0011 (0x000022) 0x2923- f:00024 d: 291 | OR[291] = A 0x0012 (0x000024) 0x2006- f:00020 d: 6 | A = OR[6] 0x0013 (0x000026) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B) 0x0014 (0x000028) 0x2908- f:00024 d: 264 | OR[264] = A 0x0015 (0x00002A) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0016 (0x00002C) 0x8602- f:00103 d: 2 | P = P + 2 (0x0018), A # 0 0x0017 (0x00002E) 0x7007- f:00070 d: 7 | P = P + 7 (0x001E) 0x0018 (0x000030) 0x102A- f:00010 d: 42 | A = 42 (0x002A) 0x0019 (0x000032) 0x2929- f:00024 d: 297 | OR[297] = A 0x001A (0x000034) 0x1129- f:00010 d: 297 | A = 297 (0x0129) 0x001B (0x000036) 0x5800- f:00054 d: 0 | B = A 0x001C (0x000038) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x001D (0x00003A) 0x7C09- f:00076 d: 9 | R = OR[9] 0x001E (0x00003C) 0x2104- f:00020 d: 260 | A = OR[260] 0x001F (0x00003E) 0x290D- f:00024 d: 269 | OR[269] = A 0x0020 (0x000040) 0x2104- f:00020 d: 260 | A = OR[260] 0x0021 (0x000042) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003) 0x0022 (0x000044) 0x1A00-0xFFFC f:00015 d: 0 | A = A & 65532 (0xFFFC) 0x0024 (0x000048) 0x2904- f:00024 d: 260 | OR[260] = A 0x0025 (0x00004A) 0x2104- f:00020 d: 260 | A = OR[260] 0x0026 (0x00004C) 0x2924- f:00024 d: 292 | OR[292] = A 0x0027 (0x00004E) 0x1020- f:00010 d: 32 | A = 32 (0x0020) 0x0028 (0x000050) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004) 0x0029 (0x000052) 0x1414- f:00012 d: 20 | A = A + 20 (0x0014) 0x002A (0x000054) 0x2504- f:00022 d: 260 | A = A + OR[260] 0x002B (0x000056) 0x2904- f:00024 d: 260 | OR[260] = A 0x002C (0x000058) 0x2104- f:00020 d: 260 | A = OR[260] 0x002D (0x00005A) 0x2705- f:00023 d: 261 | A = A - OR[261] 0x002E (0x00005C) 0xB234- f:00131 d: 52 | R = OR[52], C = 1 0x002F (0x00005E) 0x000B- f:00000 d: 11 | PASS | **** non-standard encoding with D:0x000B **** 0x0030 (0x000060) 0x210D- f:00020 d: 269 | A = OR[269] 0x0031 (0x000062) 0x3904- f:00034 d: 260 | (OR[260]) = A 0x0032 (0x000064) 0x2D04- f:00026 d: 260 | OR[260] = OR[260] + 1 0x0033 (0x000066) 0x2124- f:00020 d: 292 | A = OR[292] 0x0034 (0x000068) 0x1414- f:00012 d: 20 | A = A + 20 (0x0014) 0x0035 (0x00006A) 0x2925- f:00024 d: 293 | OR[293] = A 0x0036 (0x00006C) 0x2125- f:00020 d: 293 | A = OR[293] 0x0037 (0x00006E) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004) 0x0038 (0x000070) 0x2920- f:00024 d: 288 | OR[288] = A 0x0039 (0x000072) 0x2120- f:00020 d: 288 | A = OR[288] 0x003A (0x000074) 0x1408- f:00012 d: 8 | A = A + 8 (0x0008) 0x003B (0x000076) 0x2908- f:00024 d: 264 | OR[264] = A 0x003C (0x000078) 0x2122- f:00020 d: 290 | A = OR[290] 0x003D (0x00007A) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x003E (0x00007C) 0x2120- f:00020 d: 288 | A = OR[288] 0x003F (0x00007E) 0x1409- f:00012 d: 9 | A = A + 9 (0x0009) 0x0040 (0x000080) 0x2908- f:00024 d: 264 | OR[264] = A 0x0041 (0x000082) 0x2123- f:00020 d: 291 | A = OR[291] 0x0042 (0x000084) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x0043 (0x000086) 0x2120- f:00020 d: 288 | A = OR[288] 0x0044 (0x000088) 0x140A- f:00012 d: 10 | A = A + 10 (0x000A) 0x0045 (0x00008A) 0x2908- f:00024 d: 264 | OR[264] = A 0x0046 (0x00008C) 0x1009- f:00010 d: 9 | A = 9 (0x0009) 0x0047 (0x00008E) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x0048 (0x000090) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0049 (0x000092) 0x2921- f:00024 d: 289 | OR[289] = A 0x004A (0x000094) 0x1800-0xBEBC f:00014 d: 0 | A = 48828 (0xBEBC) 0x004C (0x000098) 0x291C- f:00024 d: 284 | OR[284] = A 0x004D (0x00009A) 0x2124- f:00020 d: 292 | A = OR[292] 0x004E (0x00009C) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x004F (0x00009E) 0x2926- f:00024 d: 294 | OR[294] = A 0x0050 (0x0000A0) 0x2125- f:00020 d: 293 | A = OR[293] 0x0051 (0x0000A2) 0x1400- f:00012 d: 0 | A = A + 0 (0x0000) 0x0052 (0x0000A4) 0x2908- f:00024 d: 264 | OR[264] = A 0x0053 (0x0000A6) 0x2063- f:00020 d: 99 | A = OR[99] 0x0054 (0x0000A8) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x0055 (0x0000AA) 0x2125- f:00020 d: 293 | A = OR[293] 0x0056 (0x0000AC) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x0057 (0x0000AE) 0x2908- f:00024 d: 264 | OR[264] = A 0x0058 (0x0000B0) 0x2064- f:00020 d: 100 | A = OR[100] 0x0059 (0x0000B2) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x005A (0x0000B4) 0x2125- f:00020 d: 293 | A = OR[293] 0x005B (0x0000B6) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002) 0x005C (0x0000B8) 0x2908- f:00024 d: 264 | OR[264] = A 0x005D (0x0000BA) 0x2067- f:00020 d: 103 | A = OR[103] 0x005E (0x0000BC) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x005F (0x0000BE) 0x2125- f:00020 d: 293 | A = OR[293] 0x0060 (0x0000C0) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003) 0x0061 (0x0000C2) 0x2908- f:00024 d: 264 | OR[264] = A 0x0062 (0x0000C4) 0x2068- f:00020 d: 104 | A = OR[104] 0x0063 (0x0000C6) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x0064 (0x0000C8) 0x703A- f:00070 d: 58 | P = P + 58 (0x009E) 0x0065 (0x0000CA) 0x2D21- f:00026 d: 289 | OR[289] = OR[289] + 1 0x0066 (0x0000CC) 0x100D- f:00010 d: 13 | A = 13 (0x000D) 0x0067 (0x0000CE) 0x2929- f:00024 d: 297 | OR[297] = A 0x0068 (0x0000D0) 0x2121- f:00020 d: 289 | A = OR[289] 0x0069 (0x0000D2) 0x292A- f:00024 d: 298 | OR[298] = A 0x006A (0x0000D4) 0x1800-0x016D f:00014 d: 0 | A = 365 (0x016D) 0x006C (0x0000D8) 0x292B- f:00024 d: 299 | OR[299] = A 0x006D (0x0000DA) 0x1129- f:00010 d: 297 | A = 297 (0x0129) 0x006E (0x0000DC) 0x5800- f:00054 d: 0 | B = A 0x006F (0x0000DE) 0x1800-0x2318 f:00014 d: 0 | A = 8984 (0x2318) 0x0071 (0x0000E2) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0072 (0x0000E4) 0x2006- f:00020 d: 6 | A = OR[6] 0x0073 (0x0000E6) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B) 0x0074 (0x0000E8) 0x2908- f:00024 d: 264 | OR[264] = A 0x0075 (0x0000EA) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0076 (0x0000EC) 0x291F- f:00024 d: 287 | OR[287] = A 0x0077 (0x0000EE) 0x8402- f:00102 d: 2 | P = P + 2 (0x0079), A = 0 0x0078 (0x0000F0) 0x7005- f:00070 d: 5 | P = P + 5 (0x007D) 0x0079 (0x0000F2) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x007A (0x0000F4) 0x2927- f:00024 d: 295 | OR[295] = A 0x007B (0x0000F6) 0x2928- f:00024 d: 296 | OR[296] = A 0x007C (0x0000F8) 0x70A8- f:00070 d: 168 | P = P + 168 (0x0124) 0x007D (0x0000FA) 0x100E- f:00010 d: 14 | A = 14 (0x000E) 0x007E (0x0000FC) 0x2929- f:00024 d: 297 | OR[297] = A 0x007F (0x0000FE) 0x2121- f:00020 d: 289 | A = OR[289] 0x0080 (0x000100) 0x292A- f:00024 d: 298 | OR[298] = A 0x0081 (0x000102) 0x211F- f:00020 d: 287 | A = OR[287] 0x0082 (0x000104) 0x292B- f:00024 d: 299 | OR[299] = A 0x0083 (0x000106) 0x2120- f:00020 d: 288 | A = OR[288] 0x0084 (0x000108) 0x292C- f:00024 d: 300 | OR[300] = A 0x0085 (0x00010A) 0x1129- f:00010 d: 297 | A = 297 (0x0129) 0x0086 (0x00010C) 0x5800- f:00054 d: 0 | B = A 0x0087 (0x00010E) 0x1800-0x2318 f:00014 d: 0 | A = 8984 (0x2318) 0x0089 (0x000112) 0x7C09- f:00076 d: 9 | R = OR[9] 0x008A (0x000114) 0x2006- f:00020 d: 6 | A = OR[6] 0x008B (0x000116) 0x140B- f:00012 d: 11 | A = A + 11 (0x000B) 0x008C (0x000118) 0x2908- f:00024 d: 264 | OR[264] = A 0x008D (0x00011A) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x008E (0x00011C) 0x1026- f:00010 d: 38 | A = 38 (0x0026) 0x008F (0x00011E) 0x2929- f:00024 d: 297 | OR[297] = A 0x0090 (0x000120) 0x2122- f:00020 d: 290 | A = OR[290] 0x0091 (0x000122) 0x292A- f:00024 d: 298 | OR[298] = A 0x0092 (0x000124) 0x2123- f:00020 d: 291 | A = OR[291] 0x0093 (0x000126) 0x292B- f:00024 d: 299 | OR[299] = A 0x0094 (0x000128) 0x2125- f:00020 d: 293 | A = OR[293] 0x0095 (0x00012A) 0x292C- f:00024 d: 300 | OR[300] = A 0x0096 (0x00012C) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x0097 (0x00012E) 0x292D- f:00024 d: 301 | OR[301] = A 0x0098 (0x000130) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0099 (0x000132) 0x292E- f:00024 d: 302 | OR[302] = A 0x009A (0x000134) 0x1129- f:00010 d: 297 | A = 297 (0x0129) 0x009B (0x000136) 0x5800- f:00054 d: 0 | B = A 0x009C (0x000138) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x009D (0x00013A) 0x7C09- f:00076 d: 9 | R = OR[9] 0x009E (0x00013C) 0x2125- f:00020 d: 293 | A = OR[293] 0x009F (0x00013E) 0x1400- f:00012 d: 0 | A = A + 0 (0x0000) 0x00A0 (0x000140) 0x2908- f:00024 d: 264 | OR[264] = A 0x00A1 (0x000142) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x00A2 (0x000144) 0x291A- f:00024 d: 282 | OR[282] = A 0x00A3 (0x000146) 0x2125- f:00020 d: 293 | A = OR[293] 0x00A4 (0x000148) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x00A5 (0x00014A) 0x2908- f:00024 d: 264 | OR[264] = A 0x00A6 (0x00014C) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x00A7 (0x00014E) 0x291B- f:00024 d: 283 | OR[283] = A 0x00A8 (0x000150) 0x1010- f:00010 d: 16 | A = 16 (0x0010) 0x00A9 (0x000152) 0x1608- f:00013 d: 8 | A = A - 8 (0x0008) 0x00AA (0x000154) 0x5800- f:00054 d: 0 | B = A 0x00AB (0x000156) 0x211A- f:00020 d: 282 | A = OR[282] 0x00AC (0x000158) 0x4A00- f:00045 d: 0 | A = A < B 0x00AD (0x00015A) 0x290D- f:00024 d: 269 | OR[269] = A 0x00AE (0x00015C) 0x1008- f:00010 d: 8 | A = 8 (0x0008) 0x00AF (0x00015E) 0x5800- f:00054 d: 0 | B = A 0x00B0 (0x000160) 0x211A- f:00020 d: 282 | A = OR[282] 0x00B1 (0x000162) 0x4800- f:00044 d: 0 | A = A > B 0x00B2 (0x000164) 0x291A- f:00024 d: 282 | OR[282] = A 0x00B3 (0x000166) 0x211B- f:00020 d: 283 | A = OR[283] 0x00B4 (0x000168) 0x4800- f:00044 d: 0 | A = A > B 0x00B5 (0x00016A) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x00B6 (0x00016C) 0x291B- f:00024 d: 283 | OR[283] = A 0x00B7 (0x00016E) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x00B8 (0x000170) 0x2929- f:00024 d: 297 | OR[297] = A 0x00B9 (0x000172) 0x1800-0x0030 f:00014 d: 0 | A = 48 (0x0030) 0x00BB (0x000176) 0x292A- f:00024 d: 298 | OR[298] = A 0x00BC (0x000178) 0x211B- f:00020 d: 283 | A = OR[283] 0x00BD (0x00017A) 0x292B- f:00024 d: 299 | OR[299] = A 0x00BE (0x00017C) 0x1064- f:00010 d: 100 | A = 100 (0x0064) 0x00BF (0x00017E) 0x292C- f:00024 d: 300 | OR[300] = A 0x00C0 (0x000180) 0x1011- f:00010 d: 17 | A = 17 (0x0011) 0x00C1 (0x000182) 0x292D- f:00024 d: 301 | OR[301] = A 0x00C2 (0x000184) 0x1012- f:00010 d: 18 | A = 18 (0x0012) 0x00C3 (0x000186) 0x292E- f:00024 d: 302 | OR[302] = A 0x00C4 (0x000188) 0x1129- f:00010 d: 297 | A = 297 (0x0129) 0x00C5 (0x00018A) 0x5800- f:00054 d: 0 | B = A 0x00C6 (0x00018C) 0x1800-0x2318 f:00014 d: 0 | A = 8984 (0x2318) 0x00C8 (0x000190) 0x7C09- f:00076 d: 9 | R = OR[9] 0x00C9 (0x000192) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x00CA (0x000194) 0x2929- f:00024 d: 297 | OR[297] = A 0x00CB (0x000196) 0x1800-0x001B f:00014 d: 0 | A = 27 (0x001B) 0x00CD (0x00019A) 0x292A- f:00024 d: 298 | OR[298] = A 0x00CE (0x00019C) 0x211D- f:00020 d: 285 | A = OR[285] 0x00CF (0x00019E) 0x292B- f:00024 d: 299 | OR[299] = A 0x00D0 (0x0001A0) 0x211E- f:00020 d: 286 | A = OR[286] 0x00D1 (0x0001A2) 0x292C- f:00024 d: 300 | OR[300] = A 0x00D2 (0x0001A4) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00D3 (0x0001A6) 0x292D- f:00024 d: 301 | OR[301] = A 0x00D4 (0x0001A8) 0x211C- f:00020 d: 284 | A = OR[284] 0x00D5 (0x0001AA) 0x292E- f:00024 d: 302 | OR[302] = A 0x00D6 (0x0001AC) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x00D7 (0x0001AE) 0x292F- f:00024 d: 303 | OR[303] = A 0x00D8 (0x0001B0) 0x100F- f:00010 d: 15 | A = 15 (0x000F) 0x00D9 (0x0001B2) 0x2930- f:00024 d: 304 | OR[304] = A 0x00DA (0x0001B4) 0x101B- f:00010 d: 27 | A = 27 (0x001B) 0x00DB (0x0001B6) 0x2931- f:00024 d: 305 | OR[305] = A 0x00DC (0x0001B8) 0x1129- f:00010 d: 297 | A = 297 (0x0129) 0x00DD (0x0001BA) 0x5800- f:00054 d: 0 | B = A 0x00DE (0x0001BC) 0x1800-0x2318 f:00014 d: 0 | A = 8984 (0x2318) 0x00E0 (0x0001C0) 0x7C09- f:00076 d: 9 | R = OR[9] 0x00E1 (0x0001C2) 0x2125- f:00020 d: 293 | A = OR[293] 0x00E2 (0x0001C4) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002) 0x00E3 (0x0001C6) 0x2908- f:00024 d: 264 | OR[264] = A 0x00E4 (0x0001C8) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x00E5 (0x0001CA) 0x291A- f:00024 d: 282 | OR[282] = A 0x00E6 (0x0001CC) 0x2125- f:00020 d: 293 | A = OR[293] 0x00E7 (0x0001CE) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003) 0x00E8 (0x0001D0) 0x2908- f:00024 d: 264 | OR[264] = A 0x00E9 (0x0001D2) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x00EA (0x0001D4) 0x291B- f:00024 d: 283 | OR[283] = A 0x00EB (0x0001D6) 0x1010- f:00010 d: 16 | A = 16 (0x0010) 0x00EC (0x0001D8) 0x1608- f:00013 d: 8 | A = A - 8 (0x0008) 0x00ED (0x0001DA) 0x5800- f:00054 d: 0 | B = A 0x00EE (0x0001DC) 0x211A- f:00020 d: 282 | A = OR[282] 0x00EF (0x0001DE) 0x4A00- f:00045 d: 0 | A = A < B 0x00F0 (0x0001E0) 0x290D- f:00024 d: 269 | OR[269] = A 0x00F1 (0x0001E2) 0x1008- f:00010 d: 8 | A = 8 (0x0008) 0x00F2 (0x0001E4) 0x5800- f:00054 d: 0 | B = A 0x00F3 (0x0001E6) 0x211A- f:00020 d: 282 | A = OR[282] 0x00F4 (0x0001E8) 0x4800- f:00044 d: 0 | A = A > B 0x00F5 (0x0001EA) 0x291A- f:00024 d: 282 | OR[282] = A 0x00F6 (0x0001EC) 0x211B- f:00020 d: 283 | A = OR[283] 0x00F7 (0x0001EE) 0x4800- f:00044 d: 0 | A = A > B 0x00F8 (0x0001F0) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x00F9 (0x0001F2) 0x291B- f:00024 d: 283 | OR[283] = A 0x00FA (0x0001F4) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x00FB (0x0001F6) 0x2929- f:00024 d: 297 | OR[297] = A 0x00FC (0x0001F8) 0x1800-0x0030 f:00014 d: 0 | A = 48 (0x0030) 0x00FE (0x0001FC) 0x292A- f:00024 d: 298 | OR[298] = A 0x00FF (0x0001FE) 0x211B- f:00020 d: 283 | A = OR[283] 0x0100 (0x000200) 0x292B- f:00024 d: 299 | OR[299] = A 0x0101 (0x000202) 0x1064- f:00010 d: 100 | A = 100 (0x0064) 0x0102 (0x000204) 0x292C- f:00024 d: 300 | OR[300] = A 0x0103 (0x000206) 0x1011- f:00010 d: 17 | A = 17 (0x0011) 0x0104 (0x000208) 0x292D- f:00024 d: 301 | OR[301] = A 0x0105 (0x00020A) 0x1012- f:00010 d: 18 | A = 18 (0x0012) 0x0106 (0x00020C) 0x292E- f:00024 d: 302 | OR[302] = A 0x0107 (0x00020E) 0x1129- f:00010 d: 297 | A = 297 (0x0129) 0x0108 (0x000210) 0x5800- f:00054 d: 0 | B = A 0x0109 (0x000212) 0x1800-0x2318 f:00014 d: 0 | A = 8984 (0x2318) 0x010B (0x000216) 0x7C09- f:00076 d: 9 | R = OR[9] 0x010C (0x000218) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x010D (0x00021A) 0x2929- f:00024 d: 297 | OR[297] = A 0x010E (0x00021C) 0x1800-0x001B f:00014 d: 0 | A = 27 (0x001B) 0x0110 (0x000220) 0x292A- f:00024 d: 298 | OR[298] = A 0x0111 (0x000222) 0x211D- f:00020 d: 285 | A = OR[285] 0x0112 (0x000224) 0x292B- f:00024 d: 299 | OR[299] = A 0x0113 (0x000226) 0x211E- f:00020 d: 286 | A = OR[286] 0x0114 (0x000228) 0x292C- f:00024 d: 300 | OR[300] = A 0x0115 (0x00022A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0116 (0x00022C) 0x292D- f:00024 d: 301 | OR[301] = A 0x0117 (0x00022E) 0x211C- f:00020 d: 284 | A = OR[284] 0x0118 (0x000230) 0x292E- f:00024 d: 302 | OR[302] = A 0x0119 (0x000232) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x011A (0x000234) 0x292F- f:00024 d: 303 | OR[303] = A 0x011B (0x000236) 0x100F- f:00010 d: 15 | A = 15 (0x000F) 0x011C (0x000238) 0x2930- f:00024 d: 304 | OR[304] = A 0x011D (0x00023A) 0x101C- f:00010 d: 28 | A = 28 (0x001C) 0x011E (0x00023C) 0x2931- f:00024 d: 305 | OR[305] = A 0x011F (0x00023E) 0x1129- f:00010 d: 297 | A = 297 (0x0129) 0x0120 (0x000240) 0x5800- f:00054 d: 0 | B = A 0x0121 (0x000242) 0x1800-0x2318 f:00014 d: 0 | A = 8984 (0x2318) 0x0123 (0x000246) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0124 (0x000248) 0x2127- f:00020 d: 295 | A = OR[295] 0x0125 (0x00024A) 0x3926- f:00034 d: 294 | (OR[294]) = A 0x0126 (0x00024C) 0x2D26- f:00026 d: 294 | OR[294] = OR[294] + 1 0x0127 (0x00024E) 0x2128- f:00020 d: 296 | A = OR[296] 0x0128 (0x000250) 0x3926- f:00034 d: 294 | (OR[294]) = A 0x0129 (0x000252) 0x2D26- f:00026 d: 294 | OR[294] = OR[294] + 1 0x012A (0x000254) 0x2121- f:00020 d: 289 | A = OR[289] 0x012B (0x000256) 0x1603- f:00013 d: 3 | A = A - 3 (0x0003) 0x012C (0x000258) 0x88C7- f:00104 d: 199 | P = P - 199 (0x0065), C = 0 0x012D (0x00025A) 0x101E- f:00010 d: 30 | A = 30 (0x001E) 0x012E (0x00025C) 0x2929- f:00024 d: 297 | OR[297] = A 0x012F (0x00025E) 0x2122- f:00020 d: 290 | A = OR[290] 0x0130 (0x000260) 0x292A- f:00024 d: 298 | OR[298] = A 0x0131 (0x000262) 0x2123- f:00020 d: 291 | A = OR[291] 0x0132 (0x000264) 0x292B- f:00024 d: 299 | OR[299] = A 0x0133 (0x000266) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x0134 (0x000268) 0x292C- f:00024 d: 300 | OR[300] = A 0x0135 (0x00026A) 0x1129- f:00010 d: 297 | A = 297 (0x0129) 0x0136 (0x00026C) 0x5800- f:00054 d: 0 | B = A 0x0137 (0x00026E) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0138 (0x000270) 0x7C09- f:00076 d: 9 | R = OR[9] 0x0139 (0x000272) 0x2124- f:00020 d: 292 | A = OR[292] 0x013A (0x000274) 0x1400- f:00012 d: 0 | A = A + 0 (0x0000) 0x013B (0x000276) 0x2908- f:00024 d: 264 | OR[264] = A 0x013C (0x000278) 0x1009- f:00010 d: 9 | A = 9 (0x0009) 0x013D (0x00027A) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x013E (0x00027C) 0x1029- f:00010 d: 41 | A = 41 (0x0029) 0x013F (0x00027E) 0x2929- f:00024 d: 297 | OR[297] = A 0x0140 (0x000280) 0x1800-0x013B f:00014 d: 0 | A = 315 (0x013B) 0x0142 (0x000284) 0x292A- f:00024 d: 298 | OR[298] = A 0x0143 (0x000286) 0x2118- f:00020 d: 280 | A = OR[280] 0x0144 (0x000288) 0x292B- f:00024 d: 299 | OR[299] = A 0x0145 (0x00028A) 0x2119- f:00020 d: 281 | A = OR[281] 0x0146 (0x00028C) 0x292C- f:00024 d: 300 | OR[300] = A 0x0147 (0x00028E) 0x2124- f:00020 d: 292 | A = OR[292] 0x0148 (0x000290) 0x292D- f:00024 d: 301 | OR[301] = A 0x0149 (0x000292) 0x1129- f:00010 d: 297 | A = 297 (0x0129) 0x014A (0x000294) 0x5800- f:00054 d: 0 | B = A 0x014B (0x000296) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x014C (0x000298) 0x7C09- f:00076 d: 9 | R = OR[9] 0x014D (0x00029A) 0x0000- f:00000 d: 0 | PASS 0x014E (0x00029C) 0x0000- f:00000 d: 0 | PASS 0x014F (0x00029E) 0x0000- f:00000 d: 0 | PASS
programs/oeis/033/A033439.asm
karttu/loda
1
88285
; A033439: Number of edges in 7-partite Turán graph of order n. ; 0,0,1,3,6,10,15,21,27,34,42,51,61,72,84,96,109,123,138,154,171,189,207,226,246,267,289,312,336,360,385,411,438,466,495,525,555,586,618,651,685,720,756,792,829,867,906,946,987,1029,1071,1114,1158,1203,1249,1296,1344,1392,1441,1491,1542,1594,1647,1701,1755,1810,1866,1923,1981,2040,2100,2160,2221,2283,2346,2410,2475,2541,2607,2674,2742,2811,2881,2952,3024,3096,3169,3243,3318,3394,3471,3549,3627,3706,3786,3867,3949,4032,4116,4200,4285,4371,4458,4546,4635,4725,4815,4906,4998,5091,5185,5280,5376,5472,5569,5667,5766,5866,5967,6069,6171,6274,6378,6483,6589,6696,6804,6912,7021,7131,7242,7354,7467,7581,7695,7810,7926,8043,8161,8280,8400,8520,8641,8763,8886,9010,9135,9261,9387,9514,9642,9771,9901,10032,10164,10296,10429,10563,10698,10834,10971,11109,11247,11386,11526,11667,11809,11952,12096,12240,12385,12531,12678,12826,12975,13125,13275,13426,13578,13731,13885,14040,14196,14352,14509,14667,14826,14986,15147,15309,15471,15634,15798,15963,16129,16296,16464,16632,16801,16971,17142,17314,17487,17661,17835,18010,18186,18363,18541,18720,18900,19080,19261,19443,19626,19810,19995,20181,20367,20554,20742,20931,21121,21312,21504,21696,21889,22083,22278,22474,22671,22869,23067,23266,23466,23667,23869,24072,24276,24480,24685,24891,25098,25306,25515,25725,25935,26146,26358,26571 mov $1,$0 pow $1,2 mul $1,3 div $1,7
programs/oeis/126/A126284.asm
neoneye/loda
22
18029
<reponame>neoneye/loda ; A126284: a(n) = 5*2^n - 4*n - 5. ; 1,7,23,59,135,291,607,1243,2519,5075,10191,20427,40903,81859,163775,327611,655287,1310643,2621359,5242795,10485671,20971427,41942943,83885979,167772055,335544211,671088527,1342177163,2684354439,5368708995,10737418111,21474836347,42949672823,85899345779,171798691695,343597383531,687194767207,1374389534563,2748779069279,5497558138715,10995116277591,21990232555347,43980465110863,87960930221899,175921860443975,351843720888131,703687441776447,1407374883553083,2814749767106359,5629499534212915,11258999068426031,22517998136852267,45035996273704743,90071992547409699,180143985094819615,360287970189639451,720575940379279127,1441151880758558483,2882303761517117199,5764607523034234635,11529215046068469511,23058430092136939267,46116860184273878783,92233720368547757819,184467440737095515895,368934881474191032051,737869762948382064367,1475739525896764129003,2951479051793528258279,5902958103587056516835,11805916207174113033951,23611832414348226068187,47223664828696452136663,94447329657392904273619,188894659314785808547535,377789318629571617095371,755578637259143234191047,1511157274518286468382403,3022314549036572936765119,6044629098073145873530555,12089258196146291747061431,24178516392292583494123187,48357032784585166988246703,96714065569170333976493739,193428131138340667952987815,386856262276681335905975971,773712524553362671811952287,1547425049106725343623904923,3094850098213450687247810199,6189700196426901374495620755,12379400392853802748991241871,24758800785707605497982484107,49517601571415210995964968583,99035203142830421991929937539,198070406285660843983859875455,396140812571321687967719751291,792281625142643375935439502967,1584563250285286751870879006323,3169126500570573503741758013039,6338253001141147007483516026475 mov $1,$0 lpb $1 sub $1,1 add $2,5 add $0,$2 mul $2,2 lpe add $0,1
src/fot/LTC-PCF/Data/Nat/UnaryNumbers.agda
asr/fotc
11
2168
------------------------------------------------------------------------------ -- Unary naturales numbers ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module LTC-PCF.Data.Nat.UnaryNumbers where open import LTC-PCF.Base ------------------------------------------------------------------------------ [0] = zero [1] = succ₁ [0] [2] = succ₁ [1] [3] = succ₁ [2] [4] = succ₁ [3] [5] = succ₁ [4] [6] = succ₁ [5] [7] = succ₁ [6] [8] = succ₁ [7] [9] = succ₁ [8]
oeis/309/A309322.asm
neoneye/loda-programs
11
244966
<reponame>neoneye/loda-programs<gh_stars>10-100 ; A309322: Expansion of Sum_{k>=1} phi(k) * x^k/(1 - x^k)^3, where phi = Euler totient function (A000010). ; Submitted by <NAME> ; 1,4,8,15,19,35,34,56,63,86,76,141,103,157,182,212,169,294,208,355,335,359,298,556,405,490,522,657,463,865,526,816,773,812,856,1239,739,1003,1058,1424,901,1610,988,1525,1617,1445,1174,2188,1435,1960,1760,2091,1483,2529,1994,2660,2177,2258,1828,3689,1951,2569,3024,3184,2737,3760,2344,3487,3143,4163,2626,5040,2773,3622,4260,4317,3739,5165,3238,5668,4509,4424,3568,6915,4571,4855,4922,6236,4093,7896,5140,6241,5603,5777,5662,8640,4849,7042,7098,8455 add $0,1 mov $2,$0 mov $4,$0 lpb $0 lpb $4 mov $3,$2 gcd $3,$0 sub $4,1 lpe sub $0,1 add $1,$3 pow $3,2 add $1,$3 add $4,3 lpe mov $0,$1 div $0,2
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2802.asm
ljhsiun2/medusa
9
104646
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r15 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_WT_ht+0x473c, %r9 nop xor %rsi, %rsi movb $0x61, (%r9) nop cmp $38655, %r11 lea addresses_D_ht+0x6407, %rax nop nop xor %r11, %r11 mov (%rax), %r12d nop nop cmp %r9, %r9 lea addresses_normal_ht+0xd822, %r15 nop and $37655, %r13 movb $0x61, (%r15) xor $37655, %r15 lea addresses_WT_ht+0x18d56, %rsi lea addresses_WT_ht+0xb372, %rdi nop nop cmp $18224, %r15 mov $64, %rcx rep movsq nop nop nop cmp %rsi, %rsi lea addresses_normal_ht+0x1ce02, %rsi lea addresses_A_ht+0x19e57, %rdi nop nop nop nop and $64932, %r11 mov $127, %rcx rep movsw nop nop sub $20099, %rsi lea addresses_normal_ht+0x19fe2, %r12 xor %r9, %r9 mov $0x6162636465666768, %rax movq %rax, (%r12) nop nop nop nop nop xor %r9, %r9 lea addresses_normal_ht+0xcf02, %rdi clflush (%rdi) nop nop cmp $28133, %r12 mov $0x6162636465666768, %r11 movq %r11, (%rdi) nop nop add $58792, %rsi lea addresses_normal_ht+0x86e2, %rcx nop nop nop nop nop xor %rax, %rax mov $0x6162636465666768, %rdi movq %rdi, %xmm7 movups %xmm7, (%rcx) xor %r9, %r9 lea addresses_A_ht+0xfa62, %rdi nop nop nop and $52263, %rax mov (%rdi), %r11w nop nop nop nop nop add %rdi, %rdi lea addresses_normal_ht+0x1bba2, %r11 nop nop and $57760, %rcx mov (%r11), %r13w nop nop cmp %r11, %r11 lea addresses_D_ht+0x1d851, %r9 xor %rdi, %rdi mov (%r9), %rax nop nop nop nop nop cmp $35790, %rcx lea addresses_normal_ht+0xabe2, %rsi lea addresses_UC_ht+0xbfe2, %rdi nop nop add %r11, %r11 mov $102, %rcx rep movsl nop nop nop nop dec %r13 lea addresses_A_ht+0x110ce, %r12 nop nop nop nop and %r9, %r9 movups (%r12), %xmm1 vpextrq $1, %xmm1, %rsi nop and %rdi, %rdi pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r15 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r9 push %rax push %rbp push %rcx // Store lea addresses_RW+0x6a6, %r9 clflush (%r9) nop nop nop nop nop xor $17665, %rbp movb $0x51, (%r9) nop nop nop nop xor $16388, %rcx // Store lea addresses_A+0x160f2, %r10 nop nop inc %r9 mov $0x5152535455565758, %rax movq %rax, %xmm0 movups %xmm0, (%r10) cmp $19871, %r9 // Faulty Load lea addresses_PSE+0x5be2, %r9 clflush (%r9) nop nop nop nop nop and $20350, %r12 movups (%r9), %xmm1 vpextrq $0, %xmm1, %rbp lea oracles, %r12 and $0xff, %rbp shlq $12, %rbp mov (%r12,%rbp,1), %rbp pop %rcx pop %rbp pop %rax pop %r9 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_PSE', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_RW', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_PSE', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 1, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_A_ht', 'same': True, 'size': 2, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
src/stantext.adb
lkujaw/felix
0
12858
------------------------------------------------------------------------------ -- Copyright (c) 2021, <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 sell copies of the Software, and to permit persons to whom the -- Software is furnished to do so. -- -- 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. -- -- SPDX-License-Identifier: MIT-0 -- -- File: stantext.adb (Ada Package Body) -- Language: Ada (1995) [1] -- Author: <NAME> -- Description: Type-safe printf() emulation for string localization -- -- References: -- [1] Information technology - Programming languages - Ada, -- ISO/IEC 8652:1995(E), 15 Feb. 1995. ------------------------------------------------------------------------------ with Ada.Strings.Unbounded; with Ada.Unchecked_Conversion; with C_Standard_IO; package body Standard_Text is package CIO renames C_Standard_IO; package NLS renames Native_Language_System; Address_Octet_Size : constant := Standard'Address_Size / 8; type Address_Octets_T is new Octet_Array_T (1 .. Address_Octet_Size); for Address_Octets_T'Size use Standard'Address_Size; function Address_To_Octets is new Ada.Unchecked_Conversion (Source => System.Address, Target => Address_Octets_T); function Octets_To_Address is new Ada.Unchecked_Conversion (Source => Address_Octets_T, Target => System.Address); Long_Float_Octet_Size : constant := Long_Float'Size / 8; type Long_Float_Octets_T is new Octet_Array_T (1 .. Long_Float_Octet_Size); for Long_Float_Octets_T'Size use Long_Float'Size; function Long_Float_To_Octets is new Ada.Unchecked_Conversion (Source => Long_Float, Target => Long_Float_Octets_T); function Octets_To_Long_Float is new Ada.Unchecked_Conversion (Source => Long_Float_Octets_T, Target => Long_Float); Long_Long_Float_Octet_Size : constant := Long_Long_Float'Size / 8; type Long_Long_Float_Octets_T is new Octet_Array_T (1 .. Long_Long_Float_Octet_Size); for Long_Long_Float_Octets_T'Size use Long_Long_Float'Size; function Long_Long_Float_To_Octets is new Ada.Unchecked_Conversion (Source => Long_Long_Float, Target => Long_Long_Float_Octets_T); function Octets_To_Long_Long_Float is new Ada.Unchecked_Conversion (Source => Long_Long_Float_Octets_T, Target => Long_Long_Float); Integer_Octet_Size : constant := Integer'Size / 8; type Integer_Octets_T is new Octet_Array_T (1 .. Integer_Octet_Size); for Integer_Octets_T'Size use Integer'Size; function Integer_To_Octets is new Ada.Unchecked_Conversion (Source => Integer, Target => Integer_Octets_T); function Octets_To_Integer is new Ada.Unchecked_Conversion (Source => Integer_Octets_T, Target => Integer); Long_Integer_Octet_Size : constant := Long_Integer'Size / 8; type Long_Integer_Octets_T is new Octet_Array_T (1 .. Long_Integer_Octet_Size); for Long_Integer_Octets_T'Size use Long_Integer'Size; function Long_Integer_To_Octets is new Ada.Unchecked_Conversion (Source => Long_Integer, Target => Long_Integer_Octets_T); function Octets_To_Long_Integer is new Ada.Unchecked_Conversion (Source => Long_Integer_Octets_T, Target => Long_Integer); Flags_Unchanged : constant Settings_T := (others => Unchanged); procedure Append (The_String : in String; To_String : in out String; At_Index : in out Positive) is begin To_String (At_Index .. At_Index + (The_String'Length - 1)) := The_String; At_Index := At_Index + The_String'Length; end Append; function Trim (Source : in String) return String is begin for I in Source'Range loop if Source (I) /= ' ' then declare Normalized : constant String (1 .. Source'Last - (I - 1)) := Source (I .. Source'Last); begin return Normalized; end; end if; end loop; return ""; end Trim; function Integer_Image (Value : in Integer) return String is begin return Trim (Integer'Image (Value)); end Integer_Image; function Is_Digit (This : in Character) return Boolean is begin return This in '0' .. '9'; end Is_Digit; procedure Read_Integer (Source : in String; From : in Positive; Value : out Integer; Last : out Natural) is Result : Integer := 0; Index : Natural := From; begin loop if not Is_Digit (Source (Index)) then Index := Index - 1; exit; end if; Result := Result * 10 + Character'Pos (Source (Index)) - Character'Pos ('0'); exit when Index = Source'Last; Index := Index + 1; end loop; Value := Result; Last := Index; end Read_Integer; function Text return Text_T is begin return Text_T'(Index_Last => 0, Format_Last => 0, Argument_Last => 0, Attribute => Attributes_T'(Flag => (others => False), Precision => 0), Types => (others => Argument_T'First), Indices => (others => Positive'First), Format => (others => Character'First), Arguments => (others => Octet_T'First)); end Text; function Precision (Number_of_Digits : in Natural) return Modifier_T is Flags : Settings_T := Flags_Unchanged; begin Flags (Precision) := On; return Modifier_T'(Setting => Flags, Precision => Number_of_Digits); end Precision; function Positive_Sign return Modifier_T is Flags : Settings_T := Flags_Unchanged; begin Flags (Positive_Sign) := On; return Modifier_T'(Setting => Flags, Precision => 0); end Positive_Sign; function No_Positive_Sign return Modifier_T is Flags : Settings_T := Flags_Unchanged; begin Flags (Positive_Sign) := Off; return Modifier_T'(Setting => Flags, Precision => 0); end No_Positive_Sign; function Thousands_Grouping return Modifier_T is Flags : Settings_T := Flags_Unchanged; begin Flags (Thousands_Grouping) := On; return Modifier_T'(Setting => Flags, Precision => 0); end Thousands_Grouping; function No_Thousands_Grouping return Modifier_T is Flags : Settings_T := Flags_Unchanged; begin Flags (Thousands_Grouping) := Off; return Modifier_T'(Setting => Flags, Precision => 0); end No_Thousands_Grouping; function "&" (Left : in Text_T; Right : in Modifier_T) return Text_T is Combined : Text_T := Left; begin for J in Right.Setting'Range loop case Right.Setting (J) is when On => Combined.Attribute.Flag (J) := True; if J = Precision then Combined.Attribute.Precision := Right.Precision; end if; when Off => Combined.Attribute.Flag (J) := False; if J = Precision then Combined.Attribute.Precision := 0; end if; when Unchanged => null; end case; end loop; return Combined; end "&"; function "&" (Left : in Text_T; Right : in String) return Text_T is Escape : Natural := 0; begin for I in Positive range Right'Range loop if Right (I) = '%' then Escape := Escape + 1; end if; end loop; declare subtype Escape_Index_T is Positive range 1 .. Right'Length + Escape; Escaped : String (Escape_Index_T); Index : Natural := 0; begin for I in Positive range Right'Range loop Index := Index + 1; if Right (I) = '%' then Escaped (Index) := Right (I); Index := Index + 1; Escaped (Index) := Right (I); else Escaped (Index) := Right (I); end if; end loop; return Text_T' (Index_Last => Left.Index_Last, Format_Last => Left.Format_Last + Right'Length, Argument_Last => Left.Argument_Last, Attribute => Left.Attribute, Indices => Left.Indices, Types => Left.Types, Format => Left.Format & Escaped, Arguments => Left.Arguments); end; end "&"; function "&" (Left : in Text_T; Right : in Character) return Text_T is begin if Right = '%' then return Text_T' (Index_Last => Left.Index_Last, Format_Last => Left.Format_Last + 2, Argument_Last => Left.Argument_Last, Attribute => Left.Attribute, Indices => Left.Indices, Types => Left.Types, Format => Left.Format & Right & Right, Arguments => Left.Arguments); else return Text_T' (Index_Last => Left.Index_Last, Format_Last => Left.Format_Last + 1, Argument_Last => Left.Argument_Last, Attribute => Left.Attribute, Indices => Left.Indices, Types => Left.Types, Format => Left.Format & Right, Arguments => Left.Arguments); end if; end "&"; function "&" (Left : in Text_T; Right : in Integer) return Text_T is Octets : constant Integer_Octets_T := Integer_To_Octets (Right); begin return Left & Element_T'(Argument_Last => Octets'Last, Kind => Integer_Regular, Argument => Octet_Array_T (Octets)); end "&"; function "&" (Left : in Text_T; Right : in Long_Long_Float) return Text_T is Octets : constant Long_Long_Float_Octets_T := Long_Long_Float_To_Octets (Right); begin return Left & Element_T'(Argument_Last => Octets'Last, Kind => Float_Long_Long, Argument => Octet_Array_T (Octets)); end "&"; function "&" (Left : in Text_T; Right : in System.Address) return Text_T is Octets : constant Address_Octets_T := Address_To_Octets (Right); begin return Left & Element_T'(Argument_Last => Octets'Last, Kind => Address, Argument => Octet_Array_T (Octets)); end "&"; function Conversion_To_Format (Conversion : in Argument_T; Argument : in Positive; Attribute : in Attributes_T) return String is function Is_Numeric return Boolean is Result : Boolean; begin case Conversion is when Address => Result := False; when Float_Long => Result := True; when Float_Long_Long => Result := True; when Integer_Long => Result := True; when Integer_Regular => Result := True; when Raw_String => Result := False; end case; return Result; end Is_Numeric; subtype Format_Index_T is Positive range 1 .. 256; Format_String : String (Format_Index_T); Format_Index : Format_Index_T := Format_Index_T'First; begin -- Conversion_To_Format Append ('%' & Integer_Image (Argument) & '$', Format_String, Format_Index); if Is_Numeric then if Attribute.Flag (Precision) then Append ("." & Integer_Image (Attribute.Precision), Format_String, Format_Index); end if; if Attribute.Flag (Thousands_Grouping) then Append ("'", Format_String, Format_Index); end if; if Attribute.Flag (Positive_Sign) then Append ("+", Format_String, Format_Index); end if; end if; case Conversion is when Address => Append ("p", Format_String, Format_Index); when Float_Long => Append ("f", Format_String, Format_Index); when Float_Long_Long => Append ("Lf", Format_String, Format_Index); when Integer_Long => Append ("ld", Format_String, Format_Index); when Integer_Regular => Append ("d", Format_String, Format_Index); when Raw_String => Append ("s", Format_String, Format_Index); end case; return Format_String (Format_String'First .. Format_Index - 1); end Conversion_To_Format; function "&" (Left : in Text_T; Right : in Element_T) return Text_T is Format_String : constant String := Conversion_To_Format (Right.Kind, Left.Index_Last + 1, Left.Attribute); begin return Text_T' (Index_Last => Left.Index_Last + 1, Format_Last => Left.Format_Last + Format_String'Length, Argument_Last => Left.Argument_Last + Right.Argument'Length, Attribute => Left.Attribute, Indices => Left.Indices & (1 => Left.Argument_Last + 1), Types => Left.Types & (1 => Right.Kind), Format => Left.Format & Format_String, Arguments => Left.Arguments & Right.Argument); end "&"; function Float_L (Value : in Long_Float) return Element_T is Octets : constant Long_Float_Octets_T := Long_Float_To_Octets (Value); begin return Element_T'(Argument_Last => Octets'Last, Kind => Float_Long, Argument => Octet_Array_T (Octets)); end Float_L; function Integer_L (Value : in Long_Integer) return Element_T is Octets : constant Long_Integer_Octets_T := Long_Integer_To_Octets (Value); begin return Element_T'(Argument_Last => Octets'Last, Kind => Integer_Long, Argument => Octet_Array_T (Octets)); end Integer_L; function Raw (From_String : in String) return Element_T is subtype Octets_Index_T is Positive range 1 .. From_String'Length; Octets : Octet_Array_T (Octets_Index_T); for Octets'Address use From_String (From_String'First)'Address; begin return Element_T'(Argument_Last => Octets'Length, Kind => Raw_String, Argument => Octets); end Raw; function New_Line return String is begin return (1 => ASCII.LF); end New_Line; function Format_Of (The_Text : in Text_T) return String is begin return The_Text.Format; end Format_Of; function String_Of (The_Text : in Text_T; With_Format : in String) return String is Null_File : CIO.File_T; Conv_First : Positive; Argument_Type : Argument_T; Argument : Positive := The_Text.Indices'First; Positional : Boolean := False; Format_Index : Positive := With_Format'First; Output : Ada.Strings.Unbounded.Unbounded_String; procedure C_Print is C_Format_String : String := With_Format (Conv_First .. Format_Index - 1) & ASCII.NUL; begin -- We need to remove any remnant of the argument number. C_Format_String (C_Format_String'First) := '%'; case Argument_Type is when Address => Ada.Strings.Unbounded.Append (Output, CIO.Address_Image (Value => Octets_To_Address (Address_Octets_T (The_Text.Arguments (The_Text.Indices (Argument) .. The_Text.Indices (Argument) + Address_Octet_Size - 1))), Format => C_Format_String)); when Integer_Regular => Ada.Strings.Unbounded.Append (Output, CIO.Integer_Image (Value => Octets_To_Integer (Integer_Octets_T (The_Text.Arguments (The_Text.Indices (Argument) .. The_Text.Indices (Argument) + Integer_Octet_Size - 1))), Format => C_Format_String)); when Integer_Long => Ada.Strings.Unbounded.Append (Output, CIO.Long_Integer_Image (Value => Octets_To_Long_Integer (Long_Integer_Octets_T (The_Text.Arguments (The_Text.Indices (Argument) .. The_Text.Indices (Argument) + Long_Integer_Octet_Size - 1))), Format => C_Format_String)); when Float_Long => Ada.Strings.Unbounded.Append (Output, CIO.Long_Float_Image (Value => Octets_To_Long_Float (Long_Float_Octets_T (The_Text.Arguments (The_Text.Indices (Argument) .. The_Text.Indices (Argument) + Long_Float_Octet_Size - 1))), Format => C_Format_String)); when Float_Long_Long => Ada.Strings.Unbounded.Append (Output, CIO.Long_Long_Float_Image (Value => Octets_To_Long_Long_Float (Long_Long_Float_Octets_T (The_Text.Arguments (The_Text.Indices (Argument) .. The_Text.Indices (Argument) + Long_Long_Float_Octet_Size - 1))), Format => C_Format_String)); when Raw_String => raise Error; end case; end C_Print; function Argument_Length return Natural is Result : Natural; begin if Argument = The_Text.Index_Last then Result := The_Text.Argument_Last - (The_Text.Indices (Argument) - 1); else Result := The_Text.Indices (Argument + 1) - The_Text.Indices (Argument); end if; return Result; end Argument_Length; procedure Print is begin if Argument_Type = Raw_String then -- Handle strings directly declare String_View : String (1 .. Argument_Length); for String_View'Address use The_Text.Arguments (The_Text.Indices (Argument))'Address; begin Ada.Strings.Unbounded.Append (Output, String_View); end; else C_Print; end if; end Print; -- Page 213 of C435 (the Unix 95 standard) procedure Parse_Conversion_Specification is Argument_Number : Integer; Position : Natural; function Is_Flag (This : in Character) return Boolean is Result : Boolean; begin case This is when ''' => Result := True; when '+' => Result := True; when others => Result := False; end case; return Result; end Is_Flag; begin -- Parse_Conversion_Specification Read_Integer (With_Format, Format_Index, Argument_Number, Position); if Position >= Format_Index and then Argument_Number > 0 and then With_Format (Format_Index + 1) = '$' then Conv_First := Format_Index + 1; Positional := True; Argument := Argument_Number; Format_Index := Format_Index + 2; end if; -- Skip precision if With_Format (Format_Index) = '.' then Format_Index := Format_Index + 1; while Is_Digit (With_Format (Format_Index)) loop Format_Index := Format_Index + 1; end loop; end if; -- Skip flags while Is_Flag (With_Format (Format_Index)) loop Format_Index := Format_Index + 1; end loop; case With_Format (Format_Index) is when 'L' => Argument_Type := Float_Long_Long; Format_Index := Format_Index + 1; if With_Format (Format_Index) /= 'f' then raise Usage_Error; end if; when 'c' => Argument_Type := Integer_Regular; when 'd' | 'i' => Argument_Type := Integer_Regular; when 'l' => Argument_Type := Integer_Long; Format_Index := Format_Index + 1; if With_Format (Format_Index) /= 'd' then raise Usage_Error; end if; when 'o' => raise Usage_Error; when 'u' => raise Usage_Error; when 'x' | 'X' => raise Usage_Error; when 'f' => Argument_Type := Float_Long; when 'e' | 'E' => Argument_Type := Float_Long; when 'g' | 'G' => Argument_Type := Float_Long; when 's' => Argument_Type := Raw_String; when 'p' => Argument_Type := Address; when others => raise Usage_Error; end case; Format_Index := Format_Index + 1; end Parse_Conversion_Specification; procedure Verify_Type is begin if Argument_Type /= The_Text.Types (Argument) then raise Usage_Error; end if; end Verify_Type; begin -- String_Of CIO.Open_Null (Null_File); while Format_Index <= With_Format'Last loop if With_Format (Format_Index) = '%' then Conv_First := Format_Index; Format_Index := Format_Index + 1; if With_Format (Format_Index) = '%' then -- Escaped '%'. Ada.Strings.Unbounded.Append (Output, With_Format (Format_Index)); Format_Index := Format_Index + 1; else Parse_Conversion_Specification; Verify_Type; Print; if not Positional then Argument := Argument + 1; end if; end if; else Ada.Strings.Unbounded.Append (Output, With_Format (Format_Index)); Format_Index := Format_Index + 1; end if; end loop; CIO.Close_File (Null_File); return Ada.Strings.Unbounded.To_String (Output); exception when others => CIO.Close_File (Null_File); raise; end String_Of; function String_Of (The_Text : in Text_T) return String is begin return String_Of (The_Text => The_Text, With_Format => The_Text.Format); end String_Of; function Message (From_Catalog : in NLS.Catalog_T; Set_Number : in Positive; Message_Number : in Positive; Default_Message : in Text_T) return String is Localized_Format : constant String := NLS.Message (From_Catalog, Set_Number, Message_Number); begin -- Message if Localized_Format = "" then return String_Of (The_Text => Default_Message); else return String_Of (The_Text => Default_Message, With_Format => Localized_Format); end if; end Message; end Standard_Text;
alloy4fun_models/trainstlt/models/2/qgFEGnynbKmAhcmZq.als
Kaixi26/org.alloytools.alloy
0
1374
<gh_stars>0 open main pred idqgFEGnynbKmAhcmZq_prop3 { always( all t:Train | some t.pos implies after t.pos' = t.pos) } pred __repair { idqgFEGnynbKmAhcmZq_prop3 } check __repair { idqgFEGnynbKmAhcmZq_prop3 <=> prop3o }
Dark soft/Tinba/source/-RootKit/ZwHdFile.asm
ExaByt3s/hack_scripts
3
22218
<reponame>ExaByt3s/hack_scripts FILE_BOTH_DIRECTORY_INFORMATION struc NextEntryOffset dd ? Unknown dd ? CreationTime dq ? LastAccessTime dq ? LastWriteTime dq ? ChangeTime dq ? EndOfFile dq ? AllocationSize dq ? FileAttributes dd ? FileNameLength dd ? EaInformationLength dd ? AlternateNameLength db ? _DummyAlign db ? AlternateName dw 12 dup (?) FileName dw ? FILE_BOTH_DIRECTORY_INFORMATION ends .code ;; -------------------------------------------------------------------------------- ;; NewZwQueryDirectoryFile proc p1:dword, p2:dword, p3:dword, p4:dword, p5:dword, p6:dword, p7:dword, p8:dword, p9:dword, p10:dword, p11:dword local RealZwQueryDirectoryFile : dword mov RealZwQueryDirectoryFile, eax @NextQuery: push p11 ; RestartScan push p10 ; FileName push p9 ; ReturnSingleEntry push p8 ; FileInformationClass push p7 ; FileInformationLength push p6 ; FileInformation push p5 ; IoStatusBlock push p4 ; ApcContext push p3 ; ApcRoutine push p2 ; Event push p1 ; FileHandle call RealZwQueryDirectoryFile ; Real ZwQueryDirectoryFile .if eax!=STATUS_SUCCESS ret .endif ; Only FileBothDirectoryInformation .if p8!=3 ret .endif ; Only not empty struc .if p6==0 ret .endif pushad assume eax : ptr FILE_BOTH_DIRECTORY_INFORMATION, edx : ptr FILE_BOTH_DIRECTORY_INFORMATION mov eax, p6 @NextFname: ; Decision: to hide or not to hide lea ebx, [eax].FileName call IsHiddenFile .if ebx!=0 .if eax==p6 ; First record .if p9==TRUE popad jmp @NextQuery .elseif [eax].NextEntryOffset==0 ; Only 1 record popad mov eax, STATUS_NO_MORE_FILES ret .endif mov ebx, [eax].NextEntryOffset ; 1st record len mov edx, eax ; 2nd - add edx, ebx ; record addr mov ecx, [edx].NextEntryOffset ; 2nd record len .if ecx==0 mov ecx, sizeof FILE_BOTH_DIRECTORY_INFORMATION add ecx, [edx].FileNameLength .else add [edx].NextEntryOffset, ebx ; offset = len2 + len1 .endif mov esi, edx ; Source mov edi, eax ; Destination rep movsb mov edx, eax .elseif [eax].NextEntryOffset==0 ; Last record mov [edx].NextEntryOffset, 0 .else ; Other records mov ecx, [eax].NextEntryOffset add ecx, [edx].NextEntryOffset mov [edx].NextEntryOffset, ecx .endif .else mov edx, eax .endif ; Exit if no more records cmp [eax].NextEntryOffset, 0 je @End ; Check Next record add eax, [eax].NextEntryOffset jmp @NextFname @End: assume eax : nothing, edx : nothing popad ret NewZwQueryDirectoryFile endp
UP1/List1/ex3.asm
rubemfsv/Digital-Control-Systems
0
172132
<reponame>rubemfsv/Digital-Control-Systems ; Questão 3 da lista de exercícios #INCLUDE<P16F84A.INC> ESTADO EQU 0x20 ORG 0x00 GOTO INICIO ORG 0x04 GOTO INTER INICIO CLRW CLRF PORTB CLRF PORTA BSF STATUS,RP0 MOVLW 0 MOVWF TRISA MOVLW 1 MOVWF TRISB BCF STATUS,RP0 BSF INTCON,GIE ;Acionamento geral de interrupções BSF INTCON,INTE ; Acionamento específico por borda no pino b0 BSF ESTADO,0 ; Esse bit serve apenas para indicar a primeira vez que o botão será acionado MAIN GOTO MAIN INTER BTFSC ESTADO,0 GOTO ACIONA_ESTADO_0 BTFSS PORTA,3 GOTO ACIONA GOTO VOLTA ACIONA_ESTADO_0; Esse estado só é visitado na primeira vez que ocorre a interrupção BSF PORTA,0 ; Aciona o led A0 pela primeira vez BCF ESTADO,0 GOTO FIM VOLTA ;passagem do A3 para o A0 BCF PORTA,3 BSF PORTA,0 GOTO FIM ACIONA ;Apaga o led atual e acende o próximo MOVF PORTA,0 ADDWF PORTA,1 GOTO FIM FIM ; Finaliza a interrupção BCF INTCON,INTF RETFIE END
agda-stdlib/src/Algebra/Structures/Biased.agda
DreamLinuxer/popl21-artifact
5
5709
<filename>agda-stdlib/src/Algebra/Structures/Biased.agda ------------------------------------------------------------------------ -- The Agda standard library -- -- Ways to give instances of certain structures where some fields can -- be given in terms of others ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary using (Rel; Setoid; IsEquivalence) module Algebra.Structures.Biased {a ℓ} {A : Set a} -- The underlying set (_≈_ : Rel A ℓ) -- The underlying equality relation where open import Algebra.Core open import Algebra.Definitions _≈_ open import Algebra.Structures _≈_ import Algebra.Consequences.Setoid as Consequences open import Data.Product using (_,_; proj₁; proj₂) open import Level using (_⊔_) ------------------------------------------------------------------------ -- IsCommutativeMonoid record IsCommutativeMonoidˡ (∙ : Op₂ A) (ε : A) : Set (a ⊔ ℓ) where field isSemigroup : IsSemigroup ∙ identityˡ : LeftIdentity ε ∙ comm : Commutative ∙ open IsSemigroup isSemigroup private identityʳ : RightIdentity ε ∙ identityʳ = Consequences.comm+idˡ⇒idʳ setoid comm identityˡ identity : Identity ε ∙ identity = (identityˡ , identityʳ) isCommutativeMonoid : IsCommutativeMonoid ∙ ε isCommutativeMonoid = record { isMonoid = record { isSemigroup = isSemigroup ; identity = identity } ; comm = comm } open IsCommutativeMonoidˡ public using () renaming (isCommutativeMonoid to isCommutativeMonoidˡ) record IsCommutativeMonoidʳ (∙ : Op₂ A) (ε : A) : Set (a ⊔ ℓ) where field isSemigroup : IsSemigroup ∙ identityʳ : RightIdentity ε ∙ comm : Commutative ∙ open IsSemigroup isSemigroup private identityˡ : LeftIdentity ε ∙ identityˡ = Consequences.comm+idʳ⇒idˡ setoid comm identityʳ identity : Identity ε ∙ identity = (identityˡ , identityʳ) isCommutativeMonoid : IsCommutativeMonoid ∙ ε isCommutativeMonoid = record { isMonoid = record { isSemigroup = isSemigroup ; identity = identity } ; comm = comm } open IsCommutativeMonoidʳ public using () renaming (isCommutativeMonoid to isCommutativeMonoidʳ) ------------------------------------------------------------------------ -- IsCommutativeSemiring record IsCommutativeSemiringˡ (+ * : Op₂ A) (0# 1# : A) : Set (a ⊔ ℓ) where field +-isCommutativeMonoid : IsCommutativeMonoid + 0# *-isCommutativeMonoid : IsCommutativeMonoid * 1# distribʳ : * DistributesOverʳ + zeroˡ : LeftZero 0# * private module +-CM = IsCommutativeMonoid +-isCommutativeMonoid open module *-CM = IsCommutativeMonoid *-isCommutativeMonoid public using () renaming (comm to *-comm) distribˡ : * DistributesOverˡ + distribˡ = Consequences.comm+distrʳ⇒distrˡ +-CM.setoid +-CM.∙-cong *-comm distribʳ distrib : * DistributesOver + distrib = (distribˡ , distribʳ) zeroʳ : RightZero 0# * zeroʳ = Consequences.comm+zeˡ⇒zeʳ +-CM.setoid *-comm zeroˡ zero : Zero 0# * zero = (zeroˡ , zeroʳ) isCommutativeSemiring : IsCommutativeSemiring + * 0# 1# isCommutativeSemiring = record { isSemiring = record { isSemiringWithoutAnnihilatingZero = record { +-isCommutativeMonoid = +-isCommutativeMonoid ; *-isMonoid = *-CM.isMonoid ; distrib = distrib } ; zero = zero } ; *-comm = *-comm } open IsCommutativeSemiringˡ public using () renaming (isCommutativeSemiring to isCommutativeSemiringˡ) record IsCommutativeSemiringʳ (+ * : Op₂ A) (0# 1# : A) : Set (a ⊔ ℓ) where field +-isCommutativeMonoid : IsCommutativeMonoid + 0# *-isCommutativeMonoid : IsCommutativeMonoid * 1# distribˡ : * DistributesOverˡ + zeroʳ : RightZero 0# * private module +-CM = IsCommutativeMonoid +-isCommutativeMonoid open module *-CM = IsCommutativeMonoid *-isCommutativeMonoid public using () renaming (comm to *-comm) distribʳ : * DistributesOverʳ + distribʳ = Consequences.comm+distrˡ⇒distrʳ +-CM.setoid +-CM.∙-cong *-comm distribˡ distrib : * DistributesOver + distrib = (distribˡ , distribʳ) zeroˡ : LeftZero 0# * zeroˡ = Consequences.comm+zeʳ⇒zeˡ +-CM.setoid *-comm zeroʳ zero : Zero 0# * zero = (zeroˡ , zeroʳ) isCommutativeSemiring : IsCommutativeSemiring + * 0# 1# isCommutativeSemiring = record { isSemiring = record { isSemiringWithoutAnnihilatingZero = record { +-isCommutativeMonoid = +-isCommutativeMonoid ; *-isMonoid = *-CM.isMonoid ; distrib = distrib } ; zero = zero } ; *-comm = *-comm } open IsCommutativeSemiringʳ public using () renaming (isCommutativeSemiring to isCommutativeSemiringʳ) ------------------------------------------------------------------------ -- IsRing -- We can recover a ring without proving that 0# annihilates *. record IsRingWithoutAnnihilatingZero (+ * : Op₂ A) (-_ : Op₁ A) (0# 1# : A) : Set (a ⊔ ℓ) where field +-isAbelianGroup : IsAbelianGroup + 0# -_ *-isMonoid : IsMonoid * 1# distrib : * DistributesOver + private module + = IsAbelianGroup +-isAbelianGroup module * = IsMonoid *-isMonoid open + using (setoid) renaming (∙-cong to +-cong) open * using () renaming (∙-cong to *-cong) zeroˡ : LeftZero 0# * zeroˡ = Consequences.assoc+distribʳ+idʳ+invʳ⇒zeˡ setoid +-cong *-cong +.assoc (proj₂ distrib) +.identityʳ +.inverseʳ zeroʳ : RightZero 0# * zeroʳ = Consequences.assoc+distribˡ+idʳ+invʳ⇒zeʳ setoid +-cong *-cong +.assoc (proj₁ distrib) +.identityʳ +.inverseʳ zero : Zero 0# * zero = (zeroˡ , zeroʳ) isRing : IsRing + * -_ 0# 1# isRing = record { +-isAbelianGroup = +-isAbelianGroup ; *-isMonoid = *-isMonoid ; distrib = distrib ; zero = zero } open IsRingWithoutAnnihilatingZero public using () renaming (isRing to isRingWithoutAnnihilatingZero)
oeis/248/A248675.asm
neoneye/loda-programs
11
169650
<reponame>neoneye/loda-programs<filename>oeis/248/A248675.asm ; A248675: Decimal expansion of r = sum_{n >= 0} floor(n/2)!/n!. ; Submitted by <NAME>(s2) ; 2,7,7,6,8,8,9,6,0,9,4,0,7,9,7,9,7,2,6,9,8,1,2,4,5,1,6,3,6,1,7,1,8,8,0,6,1,8,5,3,8,4,9,8,3,6,6,5,0,9,6,1,3,1,1,3,2,7,0,5,7,5,0,9,5,9,6,1,1,0,3,8,8,4,9,9,5,2,2,6,7,1,0,8,1,7,3,3,0,5,4,7,2,5,2,2,8,3,1,2 mov $1,1 mov $2,1 mov $3,$0 mul $3,5 lpb $3 add $1,$2 mov $5,$3 mul $5,2 add $5,1 mul $2,$5 add $1,$2 mov $5,$0 add $5,$0 mov $4,$5 cmp $4,0 add $5,$4 div $1,$5 mov $4,$0 cmp $4,0 mov $5,$0 add $5,$4 div $2,$5 sub $3,1 lpe mov $6,10 pow $6,$0 div $2,$6 div $1,$2 add $1,$6 mov $0,$1 mod $0,10
ftm/love3.asm
zeta0134/bhop
4
6644
<filename>ftm/love3.asm ; Dn-FamiTracker exported music data: love_3_option.0cc ; ; Module header .word ft_song_list .word ft_instrument_list .word ft_sample_list .word ft_samples .word ft_groove_list .byte 4 ; flags .word 3840 ; NTSC speed .word 3840 ; PAL speed ; Instrument pointer list ft_instrument_list: .word ft_inst_0 .word ft_inst_1 .word ft_inst_2 .word ft_inst_3 ; Instruments ft_inst_0: .byte 0 .byte $00 ft_inst_1: .byte 0 .byte $01 .word ft_seq_2a03_0 ft_inst_2: .byte 0 .byte $05 .word ft_seq_2a03_5 .word ft_seq_2a03_7 ft_inst_3: .byte 0 .byte $05 .word ft_seq_2a03_10 .word ft_seq_2a03_2 ; Sequences ft_seq_2a03_0: .byte $09, $FF, $00, $00, $0A, $04, $05, $05, $02, $02, $02, $02, $00 ft_seq_2a03_2: .byte $02, $FF, $00, $00, $0F, $F1 ft_seq_2a03_5: .byte $09, $FF, $00, $00, $0F, $0D, $0B, $0A, $08, $07, $05, $03, $02 ft_seq_2a03_7: .byte $01, $FF, $00, $00, $FE ft_seq_2a03_10: .byte $02, $FF, $00, $00, $0F, $0C ; DPCM instrument list (pitch, sample index) ft_sample_list: .byte 15, 44, 0 .byte 15, 44, 3 ; DPCM samples list (location, size, bank) ft_samples: .byte <((ft_sample_0 - $C000) >> 6), 11, <.bank(ft_sample_0) .byte <((ft_sample_1 - $C000) >> 6), 39, <.bank(ft_sample_1) ; Groove list ft_groove_list: .byte $00 ; Grooves (size, terms) ; Song pointer list ft_song_list: .word ft_song_0 ; Song info ft_song_0: .word ft_s0_frames .byte 21 ; frame count .byte 64 ; pattern length .byte 3 ; speed .byte 160 ; tempo .byte 0 ; groove position .byte 0 ; initial bank ; ; Pattern and frame data for all songs below ; ; Bank 0 ft_s0_frames: .word ft_s0f0 .word ft_s0f1 .word ft_s0f2 .word ft_s0f3 .word ft_s0f4 .word ft_s0f5 .word ft_s0f6 .word ft_s0f7 .word ft_s0f8 .word ft_s0f9 .word ft_s0f10 .word ft_s0f11 .word ft_s0f12 .word ft_s0f13 .word ft_s0f14 .word ft_s0f15 .word ft_s0f16 .word ft_s0f17 .word ft_s0f18 .word ft_s0f19 .word ft_s0f20 ft_s0f0: .word ft_s0p0c0, ft_s0p0c0, ft_s0p0c2, ft_s0p0c0, ft_s0p2c4 ft_s0f1: .word ft_s0p0c0, ft_s0p0c0, ft_s0p0c2, ft_s0p0c3, ft_s0p0c4 ft_s0f2: .word ft_s0p1c0, ft_s0p1c1, ft_s0p1c2, ft_s0p1c3, ft_s0p1c4 ft_s0f3: .word ft_s0p1c0, ft_s0p1c1, ft_s0p1c2, ft_s0p1c3, ft_s0p3c4 ft_s0f4: .word ft_s0p2c0, ft_s0p2c1, ft_s0p3c2, ft_s0p1c3, ft_s0p1c4 ft_s0f5: .word ft_s0p3c0, ft_s0p3c1, ft_s0p3c2, ft_s0p1c3, ft_s0p3c4 ft_s0f6: .word ft_s0p12c0, ft_s0p4c1, ft_s0p4c2, ft_s0p1c3, ft_s0p1c4 ft_s0f7: .word ft_s0p12c0, ft_s0p0c0, ft_s0p4c2, ft_s0p1c3, ft_s0p1c4 ft_s0f8: .word ft_s0p5c0, ft_s0p5c1, ft_s0p5c2, ft_s0p1c3, ft_s0p1c4 ft_s0f9: .word ft_s0p4c0, ft_s0p6c1, ft_s0p6c2, ft_s0p1c3, ft_s0p1c4 ft_s0f10: .word ft_s0p5c0, ft_s0p5c1, ft_s0p5c2, ft_s0p1c3, ft_s0p1c4 ft_s0f11: .word ft_s0p4c0, ft_s0p6c1, ft_s0p6c2, ft_s0p1c3, ft_s0p1c4 ft_s0f12: .word ft_s0p6c0, ft_s0p1c1, ft_s0p1c2, ft_s0p1c3, ft_s0p1c4 ft_s0f13: .word ft_s0p6c0, ft_s0p1c1, ft_s0p1c2, ft_s0p1c3, ft_s0p3c4 ft_s0f14: .word ft_s0p7c0, ft_s0p2c1, ft_s0p3c2, ft_s0p1c3, ft_s0p1c4 ft_s0f15: .word ft_s0p8c0, ft_s0p3c1, ft_s0p3c2, ft_s0p1c3, ft_s0p4c4 ft_s0f16: .word ft_s0p9c0, ft_s0p9c1, ft_s0p3c2, ft_s0p1c3, ft_s0p1c4 ft_s0f17: .word ft_s0p8c0, ft_s0p3c1, ft_s0p3c2, ft_s0p1c3, ft_s0p3c4 ft_s0f18: .word ft_s0p10c0, ft_s0p4c1, ft_s0p4c2, ft_s0p1c3, ft_s0p1c4 ft_s0f19: .word ft_s0p12c0, ft_s0p7c1, ft_s0p4c2, ft_s0p1c3, ft_s0p1c4 ft_s0f20: .word ft_s0p11c0, ft_s0p8c1, ft_s0p0c2, ft_s0p0c0, ft_s0p0c0 ; Bank 0 ft_s0p0c0: .byte $00, $3F ; Bank 0 ft_s0p0c2: .byte $00, $04, $94, $01, $00, $07, $94, $01, $00, $07, $94, $01, $00, $07, $94, $01, $00, $22 ; Bank 0 ft_s0p0c3: .byte $E1, $FF, $1C, $07, $1C, $07, $1C, $07, $1C, $06, $87, $01, $00, $20 ; Bank 0 ft_s0p0c4: .byte $00, $14, $94, $01, $01, $02, $02, $02, $01, $01, $94, $01, $02, $22 ; Bank 0 ft_s0p1c0: .byte $E2, $93, $02, $FA, $25, $02, $2C, $01, $94, $01, $31, $02, $38, $02, $31, $01, $94, $01, $2C, $02 .byte $25, $02, $2C, $01, $94, $01, $31, $02, $38, $02, $2C, $01, $94, $01, $3D, $02, $21, $02, $2D, $01 .byte $94, $01, $34, $02, $21, $02, $2D, $01, $94, $01, $34, $02, $33, $02, $23, $01, $94, $01, $2F, $02 .byte $33, $02, $23, $01, $94, $01, $2F, $02 ; Bank 0 ft_s0p1c1: .byte $E3, $93, $01, $9A, $01, $8A, $FD, $35, $02, $FD, $31, $01, $94, $01, $FD, $33, $02, $93, $01, $FD .byte $35, $02, $FD, $36, $01, $94, $01, $FD, $36, $00, $E0, $8D, $14, $FA, $38, $09, $E3, $8A, $FD, $38 .byte $02, $FD, $35, $01, $94, $01, $FD, $31, $02, $FD, $34, $02, $FD, $2D, $01, $94, $01, $FD, $31, $02 .byte $FD, $33, $00, $E0, $8D, $0A, $FA, $34, $06, $E3, $8A, $FD, $33, $02, $FD, $2F, $01, $94, $01, $FD .byte $2A, $02, $FD, $31, $00, $E0, $8D, $14, $FA, $33, $06 ; Bank 0 ft_s0p1c2: .byte $E0, $9B, $08, $25, $02, $9B, $06, $19, $01, $94, $01, $9B, $08, $19, $02, $9B, $08, $31, $02, $9B .byte $06, $19, $01, $94, $01, $9B, $08, $19, $02, $9B, $08, $25, $02, $9B, $06, $19, $01, $94, $01, $9B .byte $08, $19, $02, $9B, $08, $31, $02, $9B, $06, $19, $01, $94, $01, $9B, $08, $2F, $02, $9B, $08, $2D .byte $02, $9B, $06, $21, $01, $94, $01, $9B, $08, $28, $02, $9B, $08, $2D, $02, $9B, $06, $21, $01, $94 .byte $01, $9B, $08, $28, $02, $9B, $08, $2F, $02, $9B, $06, $23, $01, $94, $01, $9B, $08, $2A, $02, $9B .byte $08, $2F, $02, $9B, $06, $23, $01, $94, $01, $9B, $08, $2A, $02 ; Bank 0 ft_s0p1c3: .byte $E1, $FF, $1C, $02, $F8, $1C, $01, $94, $01, $1C, $02, $FF, $1C, $02, $F8, $1C, $01, $94, $01, $1C .byte $02, $FF, $1C, $02, $F8, $1C, $01, $94, $01, $1C, $02, $FF, $1C, $02, $F8, $1C, $01, $94, $01, $1C .byte $02, $FF, $1C, $02, $F8, $1C, $01, $94, $01, $1C, $02, $FF, $1C, $02, $F8, $1C, $01, $94, $01, $1C .byte $02, $FF, $1C, $02, $F8, $1C, $01, $94, $01, $1C, $02, $FF, $1C, $02, $F8, $1C, $01, $94, $01, $1C .byte $02 ; Bank 0 ft_s0p1c4: .byte $01, $07, $02, $07, $01, $04, $94, $01, $01, $02, $02, $07, $01, $07, $02, $07, $01, $04, $94, $01 .byte $01, $02, $02, $07 ; Bank 0 ft_s0p2c0: .byte $E2, $93, $02, $FA, $2D, $02, $34, $01, $94, $01, $39, $02, $2D, $02, $34, $01, $94, $01, $39, $02 .byte $2D, $02, $31, $01, $94, $01, $34, $02, $31, $02, $34, $01, $94, $01, $39, $02, $36, $02, $2F, $01 .byte $94, $01, $36, $02, $3B, $02, $36, $01, $94, $01, $2F, $02, $36, $02, $34, $01, $94, $01, $33, $02 .byte $2F, $02, $7F, $01, $94, $01, $36, $02 ; Bank 0 ft_s0p2c1: .byte $E3, $93, $01, $9A, $01, $8A, $FD, $2D, $02, $FD, $28, $01, $94, $01, $FD, $2D, $02, $FD, $31, $02 .byte $FD, $2D, $01, $94, $01, $FD, $33, $00, $E0, $8D, $0A, $FA, $34, $06, $94, $01, $00, $02, $E3, $8A .byte $FD, $34, $02, $FD, $36, $01, $94, $01, $FD, $34, $02, $FD, $33, $02, $FD, $2F, $01, $94, $01, $FD .byte $33, $02, $FD, $35, $00, $E0, $8D, $0A, $FA, $36, $03, $94, $01, $00, $02, $E3, $8A, $FD, $33, $02 .byte $FD, $31, $01, $94, $01, $FD, $2F, $02, $FD, $2D, $00, $E0, $8D, $14, $FA, $2F, $03, $94, $01, $00 .byte $02 ; Bank 0 ft_s0p2c4: .byte $96, $38, $00, $02, $87, $01, $00, $3C ; Bank 0 ft_s0p3c0: .byte $E2, $93, $02, $FA, $2D, $02, $34, $01, $94, $01, $39, $02, $2D, $02, $34, $01, $94, $01, $39, $02 .byte $2D, $02, $31, $01, $94, $01, $34, $02, $31, $02, $34, $01, $94, $01, $39, $02, $36, $02, $2F, $01 .byte $94, $01, $36, $02, $3B, $02, $36, $01, $94, $01, $2F, $02, $36, $02, $34, $01, $94, $01, $33, $02 .byte $2F, $02, $33, $01, $94, $01, $36, $02 ; Bank 0 ft_s0p3c1: .byte $E3, $93, $01, $9A, $01, $8A, $FD, $2C, $00, $E0, $8D, $0A, $FA, $2D, $03, $94, $01, $00, $02, $E3 .byte $8A, $FD, $2F, $02, $FD, $31, $01, $94, $01, $FD, $33, $00, $E0, $8D, $0A, $FA, $34, $06, $94, $01 .byte $00, $02, $E3, $8A, $FD, $31, $02, $FD, $33, $01, $94, $01, $FD, $34, $02, $FD, $33, $02, $FD, $31 .byte $01, $94, $01, $FD, $2F, $02, $FD, $2D, $00, $E0, $8D, $14, $FA, $2F, $03, $94, $01, $00, $02, $E3 .byte $8A, $FD, $36, $02, $FD, $34, $01, $94, $01, $FD, $33, $02, $FD, $34, $00, $E0, $8D, $14, $FA, $36 .byte $03, $94, $01, $00, $02 ; Bank 0 ft_s0p3c2: .byte $E0, $9B, $08, $15, $02, $9B, $06, $21, $01, $94, $01, $9B, $08, $15, $02, $9B, $08, $28, $02, $9B .byte $06, $15, $01, $94, $01, $9B, $08, $21, $02, $9B, $08, $15, $02, $9B, $06, $21, $01, $94, $01, $9B .byte $08, $15, $02, $9B, $08, $28, $02, $9B, $06, $21, $01, $94, $01, $9B, $08, $15, $02, $9B, $08, $17 .byte $02, $9B, $06, $23, $01, $94, $01, $9B, $08, $17, $02, $9B, $08, $2A, $02, $9B, $06, $17, $01, $94 .byte $01, $9B, $08, $21, $02, $9B, $08, $17, $02, $9B, $06, $23, $01, $94, $01, $9B, $08, $17, $02, $9B .byte $08, $2A, $02, $9B, $06, $17, $01, $94, $01, $9B, $08, $2C, $02 ; Bank 0 ft_s0p3c4: .byte $01, $07, $02, $07, $01, $04, $94, $01, $01, $02, $02, $07, $01, $07, $02, $04, $94, $01, $02, $02 .byte $01, $04, $94, $01, $01, $02, $02, $02, $02, $01, $94, $01, $02, $02 ; Bank 0 ft_s0p4c0: .byte $E2, $93, $02, $8A, $FA, $25, $02, $2C, $01, $94, $01, $31, $02, $38, $02, $31, $01, $94, $01, $2C .byte $02, $25, $02, $2C, $01, $94, $01, $31, $02, $38, $02, $2C, $01, $94, $01, $3D, $02, $25, $02, $2C .byte $01, $94, $01, $31, $02, $38, $02, $31, $01, $94, $01, $2C, $02, $25, $02, $2C, $01, $94, $01, $31 .byte $02, $38, $02, $2C, $01, $94, $01, $3D, $02 ; Bank 0 ft_s0p4c1: .byte $E3, $93, $01, $9A, $00, $8A, $FD, $36, $00, $E0, $8D, $14, $FA, $38, $09, $E3, $93, $01, $8A, $F8 .byte $36, $00, $E0, $8D, $14, $F6, $38, $08, $94, $01, $E3, $93, $01, $8A, $F5, $36, $00, $94, $01, $E0 .byte $8D, $14, $F3, $38, $09, $E3, $93, $01, $8A, $F3, $36, $00, $E0, $8D, $14, $F2, $38, $08, $E3, $93 .byte $01, $8A, $F2, $36, $00, $E0, $8D, $14, $F1, $38, $09, $94, $01, $7F, $0A ; Bank 0 ft_s0p4c2: .byte $E0, $9B, $08, $25, $02, $9B, $06, $19, $01, $94, $01, $9B, $08, $19, $02, $9B, $08, $31, $02, $9B .byte $06, $19, $01, $94, $01, $9B, $08, $19, $02, $9B, $08, $25, $02, $9B, $06, $19, $01, $94, $01, $9B .byte $08, $19, $02, $9B, $08, $31, $02, $9B, $06, $19, $01, $94, $01, $9B, $08, $2F, $02, $9B, $08, $25 .byte $02, $9B, $06, $19, $01, $94, $01, $9B, $08, $19, $02, $9B, $08, $31, $02, $9B, $06, $19, $01, $94 .byte $01, $9B, $08, $19, $02, $9B, $08, $25, $02, $9B, $06, $19, $01, $94, $01, $9B, $08, $19, $02, $9B .byte $08, $31, $02, $9B, $06, $19, $01, $94, $01, $9B, $08, $2F, $02 ; Bank 0 ft_s0p4c4: .byte $01, $07, $02, $07, $01, $04, $94, $01, $01, $02, $02, $07, $01, $07, $02, $04, $94, $01, $02, $02 .byte $01, $04, $94, $01, $01, $02, $02, $02, $01, $01, $94, $01, $02, $02 ; Bank 0 ft_s0p5c0: .byte $E2, $93, $02, $FA, $23, $02, $2A, $01, $94, $01, $2F, $02, $36, $02, $2F, $01, $94, $01, $2A, $02 .byte $23, $02, $2A, $01, $94, $01, $2F, $02, $23, $02, $2A, $01, $94, $01, $2F, $02, $1E, $02, $25, $01 .byte $94, $01, $2A, $02, $1E, $02, $25, $01, $94, $01, $2A, $02, $2C, $02, $2E, $01, $94, $01, $25, $02 .byte $1E, $02, $2E, $01, $94, $01, $2A, $02 ; Bank 0 ft_s0p5c1: .byte $E0, $9A, $00, $93, $00, $8A, $FD, $2A, $02, $23, $01, $94, $01, $2A, $02, $2F, $02, $2A, $01, $94 .byte $01, $31, $02, $33, $01, $9A, $03, $00, $02, $94, $01, $9A, $00, $FD, $31, $01, $9A, $03, $00, $03 .byte $9A, $00, $FD, $2F, $01, $94, $01, $9A, $03, $00, $02, $9A, $00, $FD, $2C, $00, $8D, $14, $2E, $03 .byte $94, $01, $00, $00, $F4, $00, $01, $8A, $FD, $2C, $04, $94, $01, $00, $00, $F4, $00, $01, $FD, $2A .byte $04, $94, $01, $00, $00, $F4, $00, $01, $FD, $2C, $02, $2A, $01, $94, $01, $29, $02 ; Bank 0 ft_s0p5c2: .byte $E0, $9B, $08, $17, $02, $9B, $06, $17, $01, $94, $01, $9B, $08, $17, $02, $9B, $08, $23, $02, $9B .byte $06, $17, $01, $94, $01, $9B, $08, $1E, $02, $9B, $08, $17, $02, $9B, $06, $17, $01, $94, $01, $9B .byte $08, $17, $02, $9B, $08, $23, $02, $9B, $06, $17, $01, $94, $01, $9B, $08, $23, $02, $9B, $08, $12 .byte $02, $9B, $06, $12, $01, $94, $01, $9B, $08, $12, $02, $9B, $08, $1E, $02, $9B, $06, $12, $01, $94 .byte $01, $9B, $08, $2A, $02, $9B, $08, $12, $02, $9B, $06, $12, $01, $94, $01, $9B, $08, $12, $02, $9B .byte $08, $1E, $02, $9B, $06, $12, $01, $94, $01, $9B, $08, $2A, $02 ; Bank 0 ft_s0p6c0: .byte $E3, $93, $01, $9A, $01, $8A, $FD, $2C, $02, $FD, $29, $01, $94, $01, $FD, $2C, $02, $93, $01, $FD .byte $31, $02, $FD, $33, $01, $94, $01, $FD, $33, $00, $E0, $8D, $14, $FA, $35, $09, $E3, $8A, $FD, $35 .byte $02, $FD, $31, $01, $94, $01, $FD, $2C, $02, $FD, $2D, $02, $FD, $28, $01, $94, $01, $FD, $2D, $02 .byte $FD, $30, $00, $E0, $8D, $0A, $FA, $31, $06, $E3, $8A, $FD, $2F, $02, $FD, $2A, $01, $94, $01, $FD .byte $2F, $02, $FD, $2D, $00, $E0, $8D, $14, $FA, $2F, $06 ; Bank 0 ft_s0p6c1: .byte $E0, $9A, $00, $93, $00, $FD, $23, $00, $8D, $14, $25, $04, $F4, $00, $01, $8A, $FD, $23, $00, $8D .byte $14, $25, $09, $9A, $01, $F4, $00, $0C, $9A, $00, $8A, $FD, $33, $00, $8D, $14, $35, $04, $F4, $00 .byte $01, $8A, $FD, $2F, $00, $8D, $14, $31, $09, $9A, $01, $F4, $00, $0C ; Bank 0 ft_s0p6c2: .byte $E0, $9B, $08, $19, $02, $9B, $06, $19, $01, $94, $01, $9B, $08, $19, $02, $9B, $08, $25, $02, $9B .byte $06, $19, $01, $94, $01, $9B, $08, $23, $02, $9B, $08, $19, $02, $9B, $06, $19, $01, $94, $01, $9B .byte $08, $19, $02, $9B, $08, $25, $02, $9B, $06, $19, $01, $94, $01, $9B, $08, $29, $02, $9B, $08, $19 .byte $02, $9B, $06, $19, $01, $94, $01, $9B, $08, $19, $02, $9B, $08, $25, $02, $9B, $06, $19, $01, $94 .byte $01, $9B, $08, $22, $02, $9B, $08, $21, $02, $9B, $06, $19, $01, $94, $01, $9B, $08, $1E, $02, $9B .byte $08, $1D, $02, $9B, $06, $19, $01, $94, $01, $9B, $08, $25, $02 ; Bank 0 ft_s0p7c0: .byte $E3, $93, $01, $9A, $01, $8A, $FD, $28, $02, $FD, $25, $01, $94, $01, $FD, $28, $02, $FD, $2D, $02 .byte $FD, $28, $01, $94, $01, $FD, $2F, $00, $E0, $8D, $14, $FA, $31, $06, $94, $01, $00, $02, $E3, $8A .byte $FD, $31, $02, $FD, $33, $01, $94, $01, $FD, $31, $02, $FD, $2F, $02, $FD, $2A, $01, $94, $01, $FD .byte $2F, $02, $FD, $2D, $00, $E0, $8D, $0A, $FA, $2F, $03, $94, $01, $00, $02, $E3, $8A, $FD, $36, $02 .byte $FD, $34, $01, $94, $01, $FD, $33, $02, $FD, $34, $00, $E0, $8D, $14, $FA, $36, $03, $94, $01, $00 .byte $02 ; Bank 0 ft_s0p7c1: .byte $00, $3C, $94, $01, $E2, $93, $02, $8A, $F5, $38, $02 ; Bank 0 ft_s0p8c0: .byte $E3, $93, $01, $9A, $01, $8A, $FD, $33, $00, $E0, $8D, $0A, $FA, $34, $03, $94, $01, $00, $02, $E3 .byte $8A, $FD, $28, $02, $FD, $2D, $01, $94, $01, $FD, $2F, $00, $E0, $8D, $14, $FA, $31, $06, $94, $01 .byte $00, $02, $E3, $8A, $FD, $2D, $02, $FD, $2F, $01, $94, $01, $FD, $31, $02, $FD, $2F, $02, $FD, $2A .byte $01, $94, $01, $FD, $27, $02, $FD, $25, $00, $E0, $8D, $14, $FA, $27, $03, $94, $01, $00, $02, $E3 .byte $8A, $FD, $2F, $02, $FD, $2A, $01, $94, $01, $FD, $2F, $02, $FD, $31, $00, $E0, $8D, $14, $FA, $33 .byte $03, $94, $01, $00, $02 ; Bank 0 ft_s0p8c1: .byte $E2, $31, $02, $3D, $04, $F2, $38, $02, $31, $01, $94, $01, $3D, $09, $88, $00, $00, $28 ; Bank 0 ft_s0p9c0: .byte $E2, $93, $02, $8A, $9A, $00, $FA, $2D, $02, $34, $01, $94, $01, $39, $02, $2D, $02, $34, $01, $94 .byte $01, $39, $02, $2D, $02, $31, $01, $94, $01, $34, $02, $31, $02, $34, $01, $94, $01, $39, $02, $36 .byte $02, $2F, $01, $94, $01, $36, $02, $3B, $02, $36, $01, $94, $01, $2F, $02, $36, $02, $34, $01, $94 .byte $01, $33, $02, $2F, $02, $33, $01, $94, $01, $36, $02 ; Bank 0 ft_s0p9c1: .byte $E3, $93, $01, $9A, $01, $8A, $FD, $2D, $02, $FD, $28, $01, $94, $01, $FD, $2D, $02, $FD, $31, $02 .byte $FD, $2D, $01, $94, $01, $FD, $33, $00, $E0, $8D, $0A, $FA, $34, $06, $94, $01, $00, $02, $E3, $8A .byte $FD, $31, $02, $FD, $33, $01, $94, $01, $FD, $34, $02, $FD, $33, $02, $FD, $31, $01, $94, $01, $FD .byte $2F, $02, $FD, $2D, $00, $E0, $8D, $14, $FA, $2F, $03, $94, $01, $00, $02, $E3, $8A, $FD, $36, $02 .byte $FD, $34, $01, $94, $01, $FD, $33, $02, $FD, $35, $00, $E0, $8D, $0A, $FA, $36, $03, $94, $01, $00 .byte $02 ; Bank 0 ft_s0p10c0: .byte $E3, $93, $01, $9A, $00, $8A, $FD, $27, $00, $E0, $8D, $14, $FA, $29, $09, $E3, $93, $01, $8A, $F8 .byte $27, $00, $E0, $8D, $14, $F6, $29, $08, $94, $01, $E3, $93, $01, $8A, $F5, $27, $00, $94, $01, $E0 .byte $8D, $14, $F3, $29, $09, $E3, $93, $01, $8A, $F3, $27, $00, $E0, $8D, $14, $F2, $29, $08, $E3, $93 .byte $01, $8A, $F2, $27, $00, $E0, $8D, $14, $F1, $29, $09, $94, $01, $7F, $0A ; Bank 0 ft_s0p11c0: .byte $00, $02, $E2, $93, $02, $F3, $38, $01, $94, $01, $31, $02, $3D, $04, $94, $01, $F1, $38, $02, $31 .byte $02, $3D, $2C ; Bank 0 ft_s0p12c0: .byte $E2, $93, $02, $8A, $FA, $25, $02, $2C, $01, $94, $01, $31, $02, $38, $02, $31, $01, $94, $01, $2C .byte $02, $25, $02, $2C, $01, $94, $01, $31, $02, $38, $02, $31, $01, $94, $01, $3D, $02, $25, $02, $2C .byte $01, $94, $01, $31, $02, $38, $02, $31, $01, $94, $01, $2C, $02, $25, $02, $2C, $01, $94, $01, $31 .byte $02, $38, $02, $31, $01, $94, $01, $3D, $02 ; DPCM samples (located at DPCM segment) .segment "DPCM_0" ft_sample_0: ; <NAME> .byte $55, $00, $E0, $DB, $EF, $FD, $F7, $AF, $AA, $AA, $AA, $AA, $C2, $81, $86, $00, $41, $80, $40, $55 .byte $55, $55, $55, $55, $55, $55, $55, $55, $55, $55, $F5, $F3, $EF, $F7, $FD, $EF, $AA, $AA, $AA, $AA .byte $AA, $AA, $AA, $AA, $AA, $AA, $8A, $34, $0C, $19, $0C, $04, $04, $08, $55, $55, $55, $55, $55, $55 .byte $55, $55, $55, $55, $55, $F5, $D3, $F8, $F7, $E7, $FD, $F7, $F4, $AA, $AA, $B2, $E2, $74, $0A, $AF .byte $AA, $0A, $AC, $05, $04, $04, $04, $3E, $0A, $48, $D5, $9A, $52, $D5, $9C, $AA, $DA, $D2, $19, $3C .byte $8F, $B7, $8D, $35, $6F, $5F, $CE, $9B, $DC, $67, $9D, $37, $57, $AE, $2C, $E3, $9A, $AC, $32, $9B .byte $52, $97, $B2, $B2, $8A, $0C, $6D, $F3, $AC, $E2, $6C, $90, $F3, $42, $86, $2D, $B9, $C8, $C1, $D2 .byte $C0, $09, $4D, $1A, $24, $D3, $C8, $C1, $C0, $24, $4D, $55, $55, $55, $55, $55, $55, $55, $55, $55 .byte $55, $55, $55, $55, $55, $55, $AB, $F2, $FF, $FF, $9B, $55, $55, $55, $55, $55, $55 .align 64 ft_sample_1: ; <NAME> .byte $03, $00, $50, $55, $55, $55, $55, $55, $55, $55, $55, $FD, $EF, $FF, $3F, $CD, $83, $91, $0F, $1C .byte $E3, $40, $00, $00, $55, $55, $55, $D5, $F3, $0F, $7E, $D0, $FF, $FD, $FF, $79, $55, $45, $1C, $00 .byte $0E, $14, $00, $40, $55, $55, $D5, $FE, $FF, $F3, $E3, $FF, $73, $56, $55, $55, $95, $00, $10, $00 .byte $10, $50, $55, $55, $55, $55, $D5, $FF, $7F, $FF, $FF, $C9, $5A, $55, $55, $55, $01, $C2, $21, $08 .byte $00, $90, $0B, $55, $55, $55, $55, $D5, $FF, $BF, $FF, $F9, $5F, $55, $55, $55, $55, $C0, $0D, $02 .byte $02, $00, $88, $34, $55, $55, $55, $F5, $F1, $FF, $77, $7C, $5E, $FE, $F3, $69, $55, $78, $25, $07 .byte $01, $02, $80, $07, $08, $6C, $4A, $55, $55, $55, $DF, $EF, $FF, $CF, $3F, $7E, $55, $55, $55, $19 .byte $00, $1C, $0C, $18, $0E, $16, $03, $F0, $97, $F1, $6F, $7E, $E3, $F9, $F1, $E7, $C1, $1F, $BD, $B2 .byte $55, $E0, $20, $21, $10, $07, $03, $C7, $A0, $7D, $7E, $38, $72, $E3, $F3, $E7, $07, $1F, $FF, $68 .byte $F1, $10, $86, $18, $1C, $47, $0D, $07, $79, $00, $78, $A0, $FE, $F1, $F9, $B8, $3B, $C6, $B5, $E3 .byte $07, $3C, $9E, $8B, $23, $51, $C7, $C0, $4D, $48, $1E, $03, $87, $70, $C7, $39, $E3, $9F, $E3, $D7 .byte $3B, $F6, $C3, $70, $03, $1F, $82, $B1, $00, $F0, $88, $63, $FC, $78, $F0, $7C, $EE, $E3, $1D, $A7 .byte $8F, $83, $8F, $83, $35, $1C, $0F, $9C, $6A, $E0, $98, $30, $2F, $C7, $63, $F8, $4D, $C6, $43, $EE .byte $C4, $67, $55, $E7, $38, $F4, $E6, $C0, $E1, $03, $E0, $1E, $3C, $9E, $18, $79, $F0, $E8, $F1, $93 .byte $17, $C7, $1E, $75, $8E, $1B, $7C, $1C, $D9, $31, $59, $8C, $35, $55, $B1, $70, $6B, $C4, $38, $C3 .byte $B1, $C7, $C7, $1D, $3F, $8E, $71, $E2, $C7, $1C, $37, $38, $46, $E4, $30, $DE, $F0, $43, $E1, $15 .byte $DC, $61, $F8, $E0, $EB, $39, $8B, $8F, $0F, $7E, $86, $7C, $00, $76, $64, $C7, $51, $43, $0C, $7C .byte $EC, $B8, $C3, $CD, $71, $9A, $47, $78, $4E, $FC, $91, $DC, $83, $C7, $05, $4F, $C0, $D3, $31, $67 .byte $38, $1A, $37, $38, $8E, $E3, $1C, $5F, $47, $D5, $D1, $FC, $07, $1F, $B9, $71, $1C, $60, $04, $F0 .byte $01, $7E, $0C, $C8, $E1, $F3, $FB, $B1, $F7, $91, $DD, $8E, $E7, $71, $E1, $00, $46, $C1, $68, $C3 .byte $F1, $C1, $E5, $E0, $C3, $70, $E7, $F8, $71, $E5, $19, $C7, $A9, $1C, $CF, $63, $70, $94, $E3, $91 .byte $C7, $70, $E3, $C0, $CE, $71, $0C, $E4, $F4, $1C, $73, $C7, $93, $E3, $C7, $E9, $C3, $4E, $27, $71 .byte $18, $84, $F8, $C1, $06, $07, $61, $7B, $9C, $E7, $F1, $39, $0E, $D7, $1C, $C7, $5C, $C6, $E7, $C0 .byte $F9, $40, $86, $A5, $1C, $CB, $2C, $CE, $23, $37, $C4, $C7, $4E, $78, $CE, $71, $CD, $61, $2D, $CB .byte $07, $A7, $59, $3C, $71, $16, $33, $16, $83, $65, $19, $27, $8E, $E7, $F8, $5C, $C6, $39, $4E, $CD .byte $EC, $1C, $DC, $70, $38, $66, $59, $CC, $38, $0D, $87, $8F, $89, $9E, $38, $E3, $F8, $74, $E3, $E1 .byte $C6, $E1, $94, $73, $F3, $E0, $C4, $E1, $19, $C7, $07, $87, $55, $0D, $27, $C7, $71, $F0, $49, $8E .byte $E3, $74, $95, $55, $9C, $5D, $1C, $3B, $0C, $57, $59, $06, $1F, $67, $1C, $67, $42, $0F, $3D, $1E .byte $D7, $73, $E0, $34, $53, $F5, $C4, $97, $89, $71, $54, $F1, $54, $D5, $8C, $65, $89, $34, $7D, $30 .byte $7E, $9C, $65, $55, $81, $E3, $D3, $6D, $A3, $E7, $06, $5C, $4C, $F5, $11, $73, $8C, $E3, $24, $EC .byte $38, $F1, $34, $ED, $38, $D6, $58, $55, $55, $55, $55, $55, $55, $55, $55, $55, $65, $D5, $CE, $E5 .byte $55, $55, $55, $55, $55 .align 64
thirdparty/adasdl/thin/adasdl/AdaSDL/binding/sdl-cdrom.ads
Lucretia/old_nehe_ada95
0
21580
-- ----------------------------------------------------------------- -- -- AdaSDL -- -- Binding to Simple Direct Media Layer -- -- Copyright (C) 2001 A.M.F.Vargas -- -- <NAME> -- -- Ponta Delgada - Azores - Portugal -- -- http://www.adapower.net/~avargas -- -- E-mail: <EMAIL> -- -- ----------------------------------------------------------------- -- -- -- -- This library is free software; you can redistribute it and/or -- -- modify it under the terms of the GNU General Public -- -- License as published by the Free Software Foundation; either -- -- version 2 of the License, or (at your option) any later version. -- -- -- -- This 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 along with this library; if not, write to the -- -- Free Software Foundation, Inc., 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. -- -- ----------------------------------------------------------------- -- -- **************************************************************** -- -- This is an Ada binding to SDL ( Simple DirectMedia Layer from -- -- Sam Lantinga - www.libsld.org ) -- -- **************************************************************** -- -- In order to help the Ada programmer, the comments in this file -- -- are, in great extent, a direct copy of the original text in the -- -- SDL header files. -- -- **************************************************************** -- with Interfaces.C.Strings; with SDL.Types; use SDL.Types; package SDL.Cdrom is package CS renames Interfaces.C.Strings; -- The maximum number of CDROM tracks on a disk. MAX_TRACKS : constant := 99; -- the types of CD-ROM track possible AUDIO_TRACK : constant := 16#00#; DATA_TRACK : constant := 16#04#; type CDstatus is new C.int; -- The possible states which a CD-ROM drive can be TRAYEMPTY : constant := 0; STOPPED : constant := 1; PLAYING : constant := 2; PAUSED : constant := 3; ERROR : constant := -1; -- Given a status, returns true if there's a disk in the drive -- #define CD_INDRIVE(status) ((int)status > 0) function INDRIVE (status : CDstatus) return Boolean; pragma Inline (INDRIVE); type CDtrack is record id : Uint8; -- Track number the_type : Uint8; -- Data or audio track unused : Uint16; lenght : Uint32; -- Length, in frames, of this track offset : Uint32; -- Offset, in frames, from start of disk end record; pragma Convention (C, CDtrack); type track_Array is array (C.int range 0 .. MAX_TRACKS) of CDtrack; pragma Convention (C, track_Array); -- This structure is only current as of the last call to CDStatus type CD is record id : C.int; -- Private drive identifier status : CDstatus; -- Current drive status -- The rest of this structure is only valid if -- there's a CD in drive numtracks : C.int; -- Number of tracks on disk cur_track : C.int; -- Current track position cur_frame : C.int; -- Current frame offset within current track track : track_Array; end record; pragma Convention (C, CD); type CD_ptr is access CD; pragma Convention (C, CD_ptr); -- Conversion functions from frames to Minute/Second/Frames -- and vice versa CD_FPS : constant := 75; procedure FRAMES_TO_MSF ( frames : C.int; M : in out C.int; S : in out C.int; F : in out C.int); pragma Inline (FRAMES_TO_MSF); function MSF_TO_FRAMES ( M : C.int; S : C.int; F : C.int) return C.int; pragma Inline (MSF_TO_FRAMES); -- CD-audio API functions: -- Returns the number of CD-ROM drives on the system, or -1 if -- SDL.Init has not been called with the INIT_CDROM flag. function CDNumDrives return C.int; pragma Import (C, CDNumDrives, "SDL_CDNumDrives"); -- Returns a human-readable, system-dependent identifier for the CD-ROM. -- Example: -- "/dev/cdrom" -- "E:" -- "/dev/disk/ide/1/master" function CDName (drive : C.int) return CS.chars_ptr; pragma Import (C, CDName, "SDL_CDName"); -- Opens a CD-ROM drive for access. It returns a drive handle -- on success, or NULL if the drive was invalid or busy. This -- newly opened CD-ROM becomes the default CD used when other -- CD functions are passed a NULL CD-ROM handle. -- Drives are numbered starting with 0. Drive 0 is the system -- default CD-ROM. function CDOpen (drive : C.int) return CD_ptr; pragma Import (C, CDOpen, "SDL_CDOpen"); -- This function returns the current status of the given drive. -- If the drive has a CD in it, the table of contents of the CD -- and current play position of the CD will be stored in the -- SDL_CD structure. function SDL_CDStatus (cdrom : CD_ptr) return CDstatus; pragma Import (C, SDL_CDStatus, "SDL_CDStatus"); -- Play the given CD starting at 'start_track' and 'start_frame' -- for 'ntracks' tracks and 'nframes' frames. If both 'ntrack' -- and 'nframe' are 0, play until the end of the CD. This function -- will skip data tracks. This function should only be called after -- calling SDL_CDStatus() to get track information about the CD. -- For example: -- -- Play entire CD: -- if CD_INDRIVE(SDL_CDStatus(cdrom)) /= 0 then -- CDPlayTracks(cdrom, 0, 0, 0, 0); -- end if; -- -- Play last track: -- if CD_INDRIVE(SDL_CDStatus(cdrom)) /= 0 then -- CDPlayTracks(cdrom, cdrom.numtracks-1, 0, 0, 0); -- end if; -- -- Play first and second track and 10 seconds of third track: -- if CD_INDRIVE(SDL_CDStatus(cdrom)) /= 0 then -- CDPlayTracks(cdrom, 0, 0, 2, 10); -- end if; -- This function returns 0, or -1 if there was an error. function CDPlayTracks ( cdrom : CD_ptr; start_track : C.int; start_frame : C.int; ntracks : C.int; nframes : C.int) return C.int; pragma Import (C, CDPlayTracks, "SDL_CDPlayTracks"); -- Play the given CD starting at 'start' frame for 'length' -- frames. It returns 0, or -1 if there was an error. function CDPlay ( cdrom : CD_ptr; start : C.int; lenght : C.int) return C.int; pragma Import (C, CDPlay, "SDL_CDPlay"); -- Pause play -- returns 0, or -1 on error function CDPause (cdrom : CD_ptr) return C.int; pragma Import (C, CDPause, "SDL_CDPause"); -- Resume play -- returns 0, or -1 on error function CDResume (cdrom : CD_ptr) return C.int; pragma Import (C, CDResume, "SDL_CDResume"); -- Stop play -- returns 0, or -1 on error function CDStop (cdrom : CD_ptr) return C.int; pragma Import (C, CDStop, "SDL_CDStop"); -- Eject CD-ROM -- returns 0, or -1 on error function CDEject (cdrom : CD_ptr) return C.int; pragma Import (C, CDEject, "SDL_CDEject"); -- Closes the handle for the CD-ROM drive procedure CDClose (cdrom : CD_ptr); pragma Import (C, CDClose, "SDL_CDClose"); end SDL.Cdrom;
libsrc/_DEVELOPMENT/adt/ba_stack/c/sdcc_iy/ba_stack_top.asm
meesokim/z88dk
0
992
; int ba_stack_top(ba_stack_t *s) SECTION code_adt_ba_stack PUBLIC _ba_stack_top EXTERN _b_array_back defc _ba_stack_top = _b_array_back
oeis/001/A001106.asm
neoneye/loda-programs
11
81541
<gh_stars>10-100 ; A001106: 9-gonal (or enneagonal or nonagonal) numbers: a(n) = n*(7*n-5)/2. ; 0,1,9,24,46,75,111,154,204,261,325,396,474,559,651,750,856,969,1089,1216,1350,1491,1639,1794,1956,2125,2301,2484,2674,2871,3075,3286,3504,3729,3961,4200,4446,4699,4959,5226,5500,5781,6069,6364,6666,6975,7291,7614,7944,8281,8625,8976,9334,9699,10071,10450,10836,11229,11629,12036,12450,12871,13299,13734,14176,14625,15081,15544,16014,16491,16975,17466,17964,18469,18981,19500,20026,20559,21099,21646,22200,22761,23329,23904,24486,25075,25671,26274,26884,27501,28125,28756,29394,30039,30691,31350 mov $1,$0 bin $1,2 mul $1,7 add $0,$1
19.asm
AsadKhalil/Assembly_x86
0
22426
<filename>19.asm [org 0x0100] jmp start flag: db 0 ;single step interrupt service routine trapisr: ;for keeping a reference in stack push bp mov bp, sp ;saving all registers push ax push bx push cx push dx push si push di push es push ds push cs pop ds sti ;set interrupt flag push cs pop ds mov byte [flag], 0 pop ds pop es pop di pop si pop dx pop cx pop bx pop ax pop bp iret start: mov ax, 0 mov es, ax mov [es: 1 * 4], trapisr mov [es: 1* 4 + 2], cs
orka_plugin_atmosphere/src/orka-features-atmosphere-earth.adb
onox/orka
52
8084
<gh_stars>10-100 -- SPDX-License-Identifier: BSD-3-Clause -- -- Copyright (c) 2017 <NAME> -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions -- are met: -- 1. Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- 2. Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- 3. Neither the name of the copyright holders 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 OWNER 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. with Ada.Numerics.Generic_Elementary_Functions; package body Orka.Features.Atmosphere.Earth is Half_Precision : constant Boolean := True; Combined_Textures : constant Boolean := True; -- Values from "Reference Solar Spectral Irradiance: ASTM G-173", ETR column -- (see http://rredc.nrel.gov/solar/spectra/am1.5/ASTMG173/ASTMG173.html), -- summed and averaged in each bin (e.g. the value for 360nm is the average -- of the ASTM G-173 values for all wavelengths between 360 and 370 nm). -- Values in W.m^-2 Solar_Irradiances : constant GL.Types.Double_Array := (1.11776, 1.14259, 1.01249, 1.14716, 1.72765, 1.73054, 1.6887, 1.61253, 1.91198, 2.03474, 2.02042, 2.02212, 1.93377, 1.95809, 1.91686, 1.8298, 1.8685, 1.8931, 1.85149, 1.8504, 1.8341, 1.8345, 1.8147, 1.78158, 1.7533, 1.6965, 1.68194, 1.64654, 1.6048, 1.52143, 1.55622, 1.5113, 1.474, 1.4482, 1.41018, 1.36775, 1.34188, 1.31429, 1.28303, 1.26758, 1.2367, 1.2082, 1.18737, 1.14683, 1.12362, 1.1058, 1.07124, 1.04992); -- Values from http://www.iup.uni-bremen.de/gruppen/molspec/databases/ -- referencespectra/o3spectra2011/index.html for 233K, summed and averaged in -- each bin (e.g. the value for 360nm is the average of the original values -- for all wavelengths between 360 and 370nm). Values in m^2 Ozone_Cross_Section : constant GL.Types.Double_Array := (1.18e-27, 2.182e-28, 2.818e-28, 6.636e-28, 1.527e-27, 2.763e-27, 5.52e-27, 8.451e-27, 1.582e-26, 2.316e-26, 3.669e-26, 4.924e-26, 7.752e-26, 9.016e-26, 1.48e-25, 1.602e-25, 2.139e-25, 2.755e-25, 3.091e-25, 3.5e-25, 4.266e-25, 4.672e-25, 4.398e-25, 4.701e-25, 5.019e-25, 4.305e-25, 3.74e-25, 3.215e-25, 2.662e-25, 2.238e-25, 1.852e-25, 1.473e-25, 1.209e-25, 9.423e-26, 7.455e-26, 6.566e-26, 5.105e-26, 4.15e-26, 4.228e-26, 3.237e-26, 2.451e-26, 2.801e-26, 2.534e-26, 1.624e-26, 1.465e-26, 2.078e-26, 1.383e-26, 7.105e-27); K_Dobson_Unit : constant GL.Types.Double := 2.687e20; -- From https://en.wikipedia.org/wiki/Dobson_unit, in molecules.m^-2 K_Max_Ozone_Number_Density : constant GL.Types.Double := 300.0 * K_Dobson_Unit / 15000.0; -- Maximum number density of ozone molecules, in m^-3 (computed so at to get -- 300 Dobson units of ozone - for this we divide 300 DU by the integral of -- the ozone density profile defined below, which is equal to 15 km) K_Rayleigh : constant GL.Types.Double := 1.24062e-6; K_Rayleigh_Scale_Height : constant GL.Types.Double := 8000.0; K_Mie_Scale_Height : constant GL.Types.Double := 1200.0; K_Mie_Angstrom_Alpha : constant GL.Types.Double := 0.0; K_Mie_Angstrom_Beta : constant GL.Types.Double := 5.328e-3; K_Mie_Single_Scattering_Albedo : constant GL.Types.Double := 0.9; K_Mie_Phase_Function_G : constant GL.Types.Double := 0.8; K_Ground_Albedo : constant GL.Types.Double := 0.1; Rayleigh_Layer : constant Density_Profile_Layer := (0.0, 1.0, -1.0 / K_Rayleigh_Scale_Height, 0.0, 0.0); Mie_Layer : constant Density_Profile_Layer := (0.0, 1.0, -1.0 / K_Mie_Scale_Height, 0.0, 0.0); -- Density profile increasing linearly from 0 to 1 between 10 and 25 km, and -- decreasing linearly from 1 to 0 between 25 and 40 km. This is an approximate -- profile from http://www.kln.ac.lk/science/Chemistry/Teaching_Resources/ -- Documents/Introduction%20to%20atmospheric%20chemistry.pdf (page 10) Absorption_Layer_1 : constant Density_Profile_Layer := (25000.0, 0.0, 0.0, 1.0 / 15000.0, -2.0 / 3.0); Absorption_Layer_2 : constant Density_Profile_Layer := (0.0, 0.0, 0.0, -1.0 / 15000.0, 8.0 / 3.0); function Data (Luminance : Luminance_Type) return Model_Data is package EF is new Ada.Numerics.Generic_Elementary_Functions (GL.Types.Double); function To_Radians (Value : GL.Types.Double) return GL.Types.Double is (Value / 180.0 * Ada.Numerics.Pi); Wavelengths, Solar_Irradiance, Ground_Albedo : Double_Vectors.Vector; Rayleigh_Scattering, Mie_Scattering : Double_Vectors.Vector; Mie_Extinction, Absorption_Extinction : Double_Vectors.Vector; Absorption_Density, Rayleigh_Density, Mie_Density : Density_Vectors.Vector; D_Lambda : constant GL.Types.Double := 10.0; L : GL.Types.Double := K_Lambda_Min; begin while L <= K_Lambda_Max loop declare use EF; Lambda : constant GL.Types.Double := L * 1.0e-3; Mie : constant GL.Types.Double := K_Mie_Angstrom_Beta / K_Mie_Scale_Height * Lambda ** (-K_Mie_Angstrom_Alpha); Sample_Index : constant GL.Types.Size := GL.Types.Size (L - K_Lambda_Min) / 10; begin Wavelengths.Append (L); Solar_Irradiance.Append (Solar_Irradiances (Sample_Index)); Ground_Albedo.Append (K_Ground_Albedo); Rayleigh_Scattering.Append (K_Rayleigh * Lambda ** (-4.0)); Mie_Scattering.Append (Mie * K_Mie_Single_Scattering_Albedo); Mie_Extinction.Append (Mie); -- Ozone, 0.0 if no ozone Absorption_Extinction.Append (K_Max_Ozone_Number_Density * Ozone_Cross_Section (Sample_Index)); end; L := L + D_Lambda; end loop; Absorption_Density.Append (Absorption_Layer_1); Absorption_Density.Append (Absorption_Layer_2); Rayleigh_Density.Append (Rayleigh_Layer); Mie_Density.Append (Mie_Layer); return (Luminance => Luminance, Samples => Wavelengths.Length, Wavelengths => Wavelengths, Solar_Irradiance => Solar_Irradiance, Sun_Angular_Radius => 0.00935 / 2.0, Bottom_Radius => 6360000.0, Top_Radius => 6420000.0, Rayleigh_Density => Rayleigh_Density, Rayleigh_Scattering => Rayleigh_Scattering, Mie_Density => Mie_Density, Mie_Scattering => Mie_Scattering, Mie_Extinction => Mie_Extinction, Mie_Phase_Function_G => K_Mie_Phase_Function_G, Absorption_Density => Absorption_Density, Absorption_Extinction => Absorption_Extinction, Ground_Albedo => Ground_Albedo, Max_Sun_Zenith_Angle => To_Radians (if Half_Precision then 102.0 else 120.0), Length_Unit_In_Meters => 1000.0, Num_Precomputed_Wavelengths => (if Luminance = Precomputed then 15 else 3), Combine_Scattering_Textures => Combined_Textures, Half_Precision => Half_Precision); end Data; end Orka.Features.Atmosphere.Earth;
next_level/demosrc/s_wenowsaygoodbye.asm
viznut/demoscene
14
81519
;,; lyrics_wenowsaygoodbye .withinpagefrom=lyrics ;,; <- lyrics ; we now say goodbye to all flesh and bone !byte $26,$31 ; WE !byte $22,$4a,$06 ; NOW !byte $24,$33,$31 ; SAY !byte $19,$1c,$46,$19,$1d ; GOOD !byte $29,$1b,$4a,$41 ; BYE !byte $19,$1d,$46 ; TO !byte $00,$37 ; ALL !byte $25,$27,$63,$24 ; FLESH !byte $33,$02 ; AND !byte $29,$1b,$60,$66,$02 ; BONE !byte $0f ;,; deps_wenowsaygoodbye ;,; <- ibpcaablocks ;,; <- lyrics_wenowsaygoodbye ;,; SC62_000 ;,; <- deps_wenowsaygoodbye ;,; <- streamvars ;,; <- player_ivars !src "demosrc/smac.inc" +sAddr nextlyrictosing !byte $00,lyrics_wenowsaygoodbye-lyrics ; method 4 ( clrscr0 bytes ) -- 436 bytes (436 cumu) ; method 5 ( clrscr0 ibpc0 bytes ) -- 432 bytes (432 cumu) ; method 6 ( clrscr0 bytes ) -- 436 bytes (436 cumu) ; method 7 ( clrscr0 ibpc0 ibpcaa bytes ) -- 403 bytes (403 cumu) ; method 8 ( clrscr1 bytes ) -- 466 bytes (466 cumu) ; method 9 ( clrscr1 ibpc0 bytes ) -- 462 bytes (462 cumu) ; method 10 ( clrscr1 bytes ) -- 466 bytes (466 cumu) ; method 11 ( clrscr1 ibpc0 ibpcaa bytes ) -- 433 bytes (433 cumu) ; method 12 ( clrscr2 bytes ) -- 436 bytes (436 cumu) ; method 13 ( clrscr2 ibpc0 bytes ) -- 437 bytes (437 cumu) ; method 14 ( clrscr2 bytes ) -- 436 bytes (436 cumu) ; method 15 ( clrscr2 ibpc0 ibpcaa bytes ) -- 408 bytes (408 cumu) ; method 16 ( clrscr3 bytes ) -- 466 bytes (466 cumu) ; method 17 ( clrscr3 ibpc0 bytes ) -- 467 bytes (467 cumu) ; method 18 ( clrscr3 bytes ) -- 466 bytes (466 cumu) ; method 19 ( clrscr3 ibpc0 ibpcaa bytes ) -- 438 bytes (438 cumu) ; METHOD 7 CHOSEN !byte $e4,1,chFFFFFFFFFFFFFFFF ; clrscr ;,; <- chFFFFFFFFFFFFFFFF ; 220 ;,; <- chFFFFFFFFFFFF0000 ; 7 ;,; <- ch0000000000000000 ; 176 ;,; <- ch7F3F1F0F07030100 ; 6 ;,; <- ch3F3F3F3F3F3F3F3F ; 12 ;,; <- chFEFCF8F0E0C08000 ; 6 ;,; <- chFCFCFCFCFCFCFCFC ; 1 ;,; <- ch000018183C3C3C3C ; 1 ;,; <- ch3C7E7E7E7E7E0000 ; 1 ;,; <- chC6C6C6C6C6C6C6C6 ; 2 ;,; <- chFCFCE0C0C0C0C0C0 ; 10 ;,; <- chFCFCDCCCCCCCCCCC ; 13 ;,; <- ch0808181C1C1C0C00 ; 1 ;,; <- chD6D6D6D6D6F6FEFE ; 2 ;,; <- chFCFCE0C0C0E0FCFC ; 5 ;,; <- chCCCCCCCCCCCCCCCC ; 4 ;,; <- chCCCCCCCCCCECFCFC ; 9 ;,; <- chF0F8CCCCCCCCCCCC ; 3 ;,; <- ch000103070F1F3F7F ; 3 ;,; <- ch0000FFFFFFFFFFFF ; 3 ;,; <- chFCFC1C0C0C1CFCFC ; 2 ;,; <- ch3030303030303030 ; 4 ;,; <- chFCFCCCCCCCDCFCFC ; 2 ;,; <- ch00000F3F3F0F0000 ; 1 ;,; <- chFCFC303030303030 ; 2 ;,; <- chC0C0C0C0C0C0C0C0 ; 3 ;,; <- chC0C0C0C0C0E0FCFC ; 3 ;,; <- ch7C7C7C6C6C6C6C6C ; 1 ;,; <- chF0F0DEDECCCCFEFE ; 1 ; total unique chars in pic: 29 (worst case req 232 bytes) !byte $DA,$00 ;addr !byte $e2,1;mode4 !byte $00 ;data4 !byte $20 !byte $DA,$01 ;addr !byte $55,$02 ;fill !byte $00 ;data4 !byte $10 !byte $87 ;skip !byte $4C,$02 ;fill !byte $04 ;data4 !byte $10 !byte $11 !byte $33 !byte $33 !byte $13 !byte $4C,$02 ;fill !byte $00 ;data4 !byte $10 !byte $85 ;skip !byte $00 ;data4 !byte $13 !byte $4C,$02 ;fill !byte $04 ;data4 !byte $10 !byte $11 !byte $31 !byte $13 !byte $13 !byte $4C,$02 ;fill !byte $04 ;data4 !byte $10 !byte $11 !byte $31 !byte $13 !byte $13 !byte $4C,$02 ;fill !byte $04 ;data4 !byte $10 !byte $11 !byte $31 !byte $13 !byte $13 !byte $4C,$02 ;fill !byte $04 ;data4 !byte $10 !byte $11 !byte $31 !byte $13 !byte $13 !byte $4C,$02 ;fill !byte $04 ;data4 !byte $10 !byte $11 !byte $31 !byte $13 !byte $13 !byte $4C,$02 ;fill !byte $04 ;data4 !byte $10 !byte $11 !byte $31 !byte $13 !byte $13 !byte $4C,$02 ;fill !byte $04 ;data4 !byte $10 !byte $11 !byte $31 !byte $11 !byte $13 !byte $46,$02 ;fill !byte $07 ;data4 !byte $11 !byte $11 !byte $11 !byte $10 !byte $11 !byte $33 !byte $11 !byte $13 !byte $46,$02 ;fill !byte $07 ;data4 !byte $11 !byte $11 !byte $11 !byte $10 !byte $11 !byte $31 !byte $11 !byte $13 !byte $8D ;skip !byte $04 ;data4 !byte $10 !byte $11 !byte $31 !byte $11 !byte $13 !byte $8D ;skip !byte $04 ;data4 !byte $10 !byte $11 !byte $31 !byte $13 !byte $13 !byte $8D ;skip !byte $04 ;data4 !byte $10 !byte $11 !byte $33 !byte $13 !byte $13 !byte $8D ;skip !byte $04 ;data4 !byte $10 !byte $13 !byte $33 !byte $13 !byte $13 !byte $8D ;skip !byte $04 ;data4 !byte $10 !byte $11 !byte $33 !byte $13 !byte $13 !byte $8D ;skip !byte $04 ;data4 !byte $10 !byte $11 !byte $33 !byte $13 !byte $13 !byte $8D ;skip !byte $04 ;data4 !byte $10 !byte $11 !byte $33 !byte $13 !byte $13 !byte $8D ;skip !byte $04 ;data4 !byte $10 !byte $11 !byte $33 !byte $13 !byte $13 !byte $CE,$31 ;addr !byte $e2,$ff;mode1 !byte $38 ;data1 !byte $E0 !byte $00 !byte $00 !byte $F0 !byte $00 !byte $00 !byte $F8 !byte $00 !byte $00 !byte $F8 !byte $00 !byte $00 !byte $F8 !byte $00 !byte $30 !byte $F8 !byte $00 !byte $78 !byte $F8 !byte $00 !byte $FC !byte $E8 !byte $01 !byte $FE !byte $EC !byte $03 !byte $90 !byte $EC !byte $07 !byte $90 !byte $FC !byte $7F !byte $FE !byte $FC !byte $71 !byte $00 !byte $F0 !byte $71 !byte $00 !byte $C0 !byte $7F !byte $FE !byte $80 !byte $79 !byte $10 !byte $F0 !byte $79 !byte $10 !byte $F0 !byte $7F !byte $FE !byte $C0 !byte $60 !byte $A0 !byte $C0 !byte $60 !byte $A1 !byte $e3 ;run ibpcaa !byte $CE,$30 ;addr !byte $e2,0;mode8 !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $96 ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $96 ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $96 ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $96 ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $AE ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $96 ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $96 ;skip !byte $04 ;data8 !byte chFFFFFFFFFFFFFFFF !byte ch0000000000000000 !byte ch0000000000000000 !byte ch0000000000000000 !byte ch3C7E7E7E7E7E0000 !byte $8C ;skip !byte $0A ;data8 !byte chC6C6C6C6C6C6C6C6 !byte chFCFCE0C0C0C0C0C0 !byte ch0000000000000000 !byte chFCFCDCCCCCCCCCCC !byte chFCFCDCCCCCCCCCCC !byte chC6C6C6C6C6C6C6C6 !byte chFFFFFFFFFFFFFFFF !byte ch0000000000000000 !byte ch0000000000000000 !byte ch0000000000000000 !byte ch0808181C1C1C0C00 !byte $84 ;skip !byte $02 ;data8 !byte chFFFFFFFFFFFFFFFF !byte chFFFFFFFFFFFFFFFF !byte chFFFFFFFFFFFFFFFF !byte $84 ;skip !byte $06 ;data8 !byte chD6D6D6D6D6F6FEFE !byte chFCFCE0C0C0E0FCFC !byte ch0000000000000000 !byte chCCCCCCCCCCCCCCCC !byte chCCCCCCCCCCECFCFC !byte chD6D6D6D6D6F6FEFE !byte chFFFFFFFFFFFFFFFF !byte $87 ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $8D ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $87 ;skip !byte $0F ;data8 !byte chFFFFFFFFFFFFFFFF !byte ch0000000000000000 !byte ch0000000000000000 !byte ch0000000000000000 !byte chFCFCE0C0C0C0C0C0 !byte chFCFCDCCCCCCCCCCC !byte chCCCCCCCCCCECFCFC !byte ch0000000000000000 !byte chFCFCE0C0C0C0C0C0 !byte chFCFCDCCCCCCCCCCC !byte chFCFCDCCCCCCCCCCC !byte chF0F8CCCCCCCCCCCC !byte chF0F8CCCCCCCCCCCC !byte chCCCCCCCCCCECFCFC !byte chFCFCE0C0C0C0C0C0 !byte chFFFFFFFFFFFFFFFF !byte $87 ;skip !byte $07 ;data8 !byte chFFFFFFFFFFFFFFFF !byte ch0000000000000000 !byte ch0000000000000000 !byte ch0000000000000000 !byte chFCFC1C0C0C1CFCFC !byte chFCFCDCCCCCCCCCCC !byte ch3030303030303030 !byte ch0000000000000000 !byte $42,chCCCCCCCCCCECFCFC ;fill !byte $03 ;data8 !byte chFCFCCCCCCCDCFCFC !byte ch3030303030303030 !byte chFCFCE0C0C0E0FCFC !byte chFFFFFFFFFFFFFFFF !byte $87 ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $8D ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $87 ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $83 ;skip !byte $0A ;data8 !byte chFCFC303030303030 !byte chFCFCDCCCCCCCCCCC !byte ch0000000000000000 !byte chFCFCDCCCCCCCCCCC !byte chC0C0C0C0C0C0C0C0 !byte chC0C0C0C0C0C0C0C0 !byte ch0000000000000000 !byte chFCFC303030303030 !byte chCCCCCCCCCCCCCCCC !byte chFCFCE0C0C0C0C0C0 !byte chFFFFFFFFFFFFFFFF !byte $87 ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $83 ;skip !byte $0A ;data8 !byte ch3030303030303030 !byte chCCCCCCCCCCECFCFC !byte ch0000000000000000 !byte chFCFCDCCCCCCCCCCC !byte chC0C0C0C0C0E0FCFC !byte chC0C0C0C0C0E0FCFC !byte ch0000000000000000 !byte ch3030303030303030 !byte chFCFCDCCCCCCCCCCC !byte chFCFCE0C0C0E0FCFC !byte chFFFFFFFFFFFFFFFF !byte $87 ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $8D ;skip !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $87 ;skip !byte $12 ;data8 !byte chFFFFFFFFFFFFFFFF !byte ch0000000000000000 !byte ch0000000000000000 !byte chFCFCE0C0C0C0C0C0 !byte chC0C0C0C0C0C0C0C0 !byte chFCFCE0C0C0C0C0C0 !byte chFCFCE0C0C0C0C0C0 !byte chCCCCCCCCCCCCCCCC !byte ch0000000000000000 !byte ch7C7C7C6C6C6C6C6C !byte ch0000000000000000 !byte chF0F8CCCCCCCCCCCC !byte chFCFCDCCCCCCCCCCC !byte chFCFCDCCCCCCCCCCC !byte chFCFCE0C0C0C0C0C0 !byte chFFFFFFFFFFFFFFFF !byte ch0000000000000000 !byte ch0000000000000000 !byte ch3F3F3F3F3F3F3F3F !byte $87 ;skip !byte $0B ;data8 !byte chFCFCE0C0C0C0C0C0 !byte chC0C0C0C0C0E0FCFC !byte chFCFCE0C0C0E0FCFC !byte chFCFC1C0C0C1CFCFC !byte chFCFCDCCCCCCCCCCC !byte ch0000000000000000 !byte chF0F0DEDECCCCFEFE !byte ch0000000000000000 !byte chFCFCCCCCCCDCFCFC !byte chCCCCCCCCCCECFCFC !byte chCCCCCCCCCCCCCCCC !byte chFCFCE0C0C0E0FCFC !byte $e1,24 ;,; *_001 ;,; <- deps_wenowsaygoodbye ; method 0 ( bytes ) -- 4 bytes (407 cumu) ; method 1 ( ibpc0 bytes ) -- 4 bytes (407 cumu) ; method 2 ( bytes ) -- 4 bytes (407 cumu) ; method 3 ( ibpc0 ibpcaa bytes ) -- 90 bytes (493 cumu) ; method 4 ( clrscr0 bytes ) -- 436 bytes (839 cumu) ; method 5 ( clrscr0 ibpc0 bytes ) -- 432 bytes (835 cumu) ; method 6 ( clrscr0 bytes ) -- 436 bytes (839 cumu) ; method 7 ( clrscr0 ibpc0 ibpcaa bytes ) -- 403 bytes (806 cumu) ; method 8 ( clrscr1 bytes ) -- 466 bytes (869 cumu) ; method 9 ( clrscr1 ibpc0 bytes ) -- 462 bytes (865 cumu) ; method 10 ( clrscr1 bytes ) -- 466 bytes (869 cumu) ; method 11 ( clrscr1 ibpc0 ibpcaa bytes ) -- 433 bytes (836 cumu) ; method 12 ( clrscr2 bytes ) -- 436 bytes (839 cumu) ; method 13 ( clrscr2 ibpc0 bytes ) -- 437 bytes (840 cumu) ; method 14 ( clrscr2 bytes ) -- 436 bytes (839 cumu) ; method 15 ( clrscr2 ibpc0 ibpcaa bytes ) -- 408 bytes (811 cumu) ; method 16 ( clrscr3 bytes ) -- 466 bytes (869 cumu) ; method 17 ( clrscr3 ibpc0 bytes ) -- 467 bytes (870 cumu) ; method 18 ( clrscr3 bytes ) -- 466 bytes (869 cumu) ; method 19 ( clrscr3 ibpc0 ibpcaa bytes ) -- 438 bytes (841 cumu) ; METHOD 0 CHOSEN ;,; <- chFFFFFFFFFFFFFFFF ; 220 ;,; <- chFFFFFFFFFFFF0000 ; 7 ;,; <- ch0000000000000000 ; 176 ;,; <- ch7F3F1F0F07030100 ; 6 ;,; <- ch3F3F3F3F3F3F3F3F ; 12 ;,; <- chFEFCF8F0E0C08000 ; 6 ;,; <- chFCFCFCFCFCFCFCFC ; 1 ;,; <- ch000018183C3C3C3C ; 1 ;,; <- ch3C7E7E7E7E7E0000 ; 1 ;,; <- chC6C6C6C6C6C6C6C6 ; 2 ;,; <- chFCFCE0C0C0C0C0C0 ; 10 ;,; <- chFCFCDCCCCCCCCCCC ; 13 ;,; <- ch0800080C1C1C1C0C ; 1 ;,; <- chD6D6D6D6D6F6FEFE ; 2 ;,; <- chFCFCE0C0C0E0FCFC ; 5 ;,; <- chCCCCCCCCCCCCCCCC ; 4 ;,; <- chCCCCCCCCCCECFCFC ; 9 ;,; <- chF0F8CCCCCCCCCCCC ; 3 ;,; <- ch000103070F1F3F7F ; 3 ;,; <- ch0000FFFFFFFFFFFF ; 3 ;,; <- chFCFC1C0C0C1CFCFC ; 2 ;,; <- ch3030303030303030 ; 4 ;,; <- chFCFCCCCCCCDCFCFC ; 2 ;,; <- ch00000F3F3F0F0000 ; 1 ;,; <- chFCFC303030303030 ; 2 ;,; <- chC0C0C0C0C0C0C0C0 ; 3 ;,; <- chC0C0C0C0C0E0FCFC ; 3 ;,; <- ch7C7C7C6C6C6C6C6C ; 1 ;,; <- chF0F0DEDECCCCFEFE ; 1 ; total unique chars in pic: 29 (worst case req 232 bytes) !byte $CF,$0C ;addr !byte $00 ;data8 !byte ch0800080C1C1C1C0C !byte $e1,24 ;,; *_002 ;,; <- deps_wenowsaygoodbye ; method 0 ( bytes ) -- 15 bytes (422 cumu) ; method 1 ( ibpc0 bytes ) -- 15 bytes (422 cumu) ; method 2 ( bytes ) -- 15 bytes (422 cumu) ; method 3 ( ibpc0 ibpcaa bytes ) -- 102 bytes (509 cumu) ; method 4 ( clrscr0 bytes ) -- 439 bytes (846 cumu) ; method 5 ( clrscr0 ibpc0 bytes ) -- 435 bytes (842 cumu) ; method 6 ( clrscr0 bytes ) -- 439 bytes (846 cumu) ; method 7 ( clrscr0 ibpc0 ibpcaa bytes ) -- 407 bytes (814 cumu) ; method 8 ( clrscr1 bytes ) -- 469 bytes (876 cumu) ; method 9 ( clrscr1 ibpc0 bytes ) -- 465 bytes (872 cumu) ; method 10 ( clrscr1 bytes ) -- 469 bytes (876 cumu) ; method 11 ( clrscr1 ibpc0 ibpcaa bytes ) -- 437 bytes (844 cumu) ; method 12 ( clrscr2 bytes ) -- 440 bytes (847 cumu) ; method 13 ( clrscr2 ibpc0 bytes ) -- 440 bytes (847 cumu) ; method 14 ( clrscr2 bytes ) -- 440 bytes (847 cumu) ; method 15 ( clrscr2 ibpc0 ibpcaa bytes ) -- 412 bytes (819 cumu) ; method 16 ( clrscr3 bytes ) -- 470 bytes (877 cumu) ; method 17 ( clrscr3 ibpc0 bytes ) -- 470 bytes (877 cumu) ; method 18 ( clrscr3 bytes ) -- 470 bytes (877 cumu) ; method 19 ( clrscr3 ibpc0 ibpcaa bytes ) -- 442 bytes (849 cumu) ; METHOD 0 CHOSEN ;,; <- chFFFFFFFFFFFFFFFF ; 220 ;,; <- chFFFFFFFFFFFF0000 ; 7 ;,; <- ch0000000000000000 ; 175 ;,; <- ch7F3F1F0F07030100 ; 6 ;,; <- ch3F3F3F3F3F3F3F3F ; 12 ;,; <- chFEFCF8F0E0C08000 ; 6 ;,; <- chFCFCFCFCFCFCFCFC ; 1 ;,; <- ch000018183C3C3C3C ; 1 ;,; <- ch3C7E7E7E7E7E0000 ; 1 ;,; <- chC6C6C6C6C6C6C6C6 ; 2 ;,; <- chFCFCE0C0C0C0C0C0 ; 10 ;,; <- chFCFCDCCCCCCCCCCC ; 13 ;,; <- ch0808080008181C1C ; 1 ;,; <- chD6D6D6D6D6F6FEFE ; 2 ;,; <- chFCFCE0C0C0E0FCFC ; 5 ;,; <- chCCCCCCCCCCCCCCCC ; 4 ;,; <- chCCCCCCCCCCECFCFC ; 9 ;,; <- ch0C00000000000000 ; 1 ;,; <- chF0F8CCCCCCCCCCCC ; 3 ;,; <- ch000103070F1F3F7F ; 3 ;,; <- ch0000FFFFFFFFFFFF ; 3 ;,; <- chFCFC1C0C0C1CFCFC ; 2 ;,; <- ch3030303030303030 ; 4 ;,; <- chFCFCCCCCCCDCFCFC ; 2 ;,; <- ch00000F3F3F0F0000 ; 1 ;,; <- chFCFC303030303030 ; 2 ;,; <- chC0C0C0C0C0C0C0C0 ; 3 ;,; <- chC0C0C0C0C0E0FCFC ; 3 ;,; <- ch7C7C7C6C6C6C6C6C ; 1 ;,; <- chF0F0DEDECCCCFEFE ; 1 ; total unique chars in pic: 30 (worst case req 240 bytes) !byte $DB,$24 ;addr !byte $e2,1;mode4 !byte $00 ;data4 !byte $33 !byte $CF,$0C ;addr !byte $e2,0;mode8 !byte $00 ;data8 !byte ch0808080008181C1C !byte $96 ;skip !byte $00 ;data8 !byte ch0C00000000000000 !byte $e1,12 ;,; *_003 ;,; <- deps_wenowsaygoodbye ; method 0 ( bytes ) -- 7 bytes (429 cumu) ; method 1 ( ibpc0 bytes ) -- 7 bytes (429 cumu) ; method 2 ( bytes ) -- 7 bytes (429 cumu) ; method 3 ( ibpc0 ibpcaa bytes ) -- 94 bytes (516 cumu) ; method 4 ( clrscr0 bytes ) -- 439 bytes (861 cumu) ; method 5 ( clrscr0 ibpc0 bytes ) -- 435 bytes (857 cumu) ; method 6 ( clrscr0 bytes ) -- 439 bytes (861 cumu) ; method 7 ( clrscr0 ibpc0 ibpcaa bytes ) -- 407 bytes (829 cumu) ; method 8 ( clrscr1 bytes ) -- 469 bytes (891 cumu) ; method 9 ( clrscr1 ibpc0 bytes ) -- 465 bytes (887 cumu) ; method 10 ( clrscr1 bytes ) -- 469 bytes (891 cumu) ; method 11 ( clrscr1 ibpc0 ibpcaa bytes ) -- 437 bytes (859 cumu) ; method 12 ( clrscr2 bytes ) -- 440 bytes (862 cumu) ; method 13 ( clrscr2 ibpc0 bytes ) -- 440 bytes (862 cumu) ; method 14 ( clrscr2 bytes ) -- 440 bytes (862 cumu) ; method 15 ( clrscr2 ibpc0 ibpcaa bytes ) -- 412 bytes (834 cumu) ; method 16 ( clrscr3 bytes ) -- 470 bytes (892 cumu) ; method 17 ( clrscr3 ibpc0 bytes ) -- 470 bytes (892 cumu) ; method 18 ( clrscr3 bytes ) -- 470 bytes (892 cumu) ; method 19 ( clrscr3 ibpc0 ibpcaa bytes ) -- 442 bytes (864 cumu) ; METHOD 0 CHOSEN ;,; <- chFFFFFFFFFFFFFFFF ; 220 ;,; <- chFFFFFFFFFFFF0000 ; 7 ;,; <- ch0000000000000000 ; 175 ;,; <- ch7F3F1F0F07030100 ; 6 ;,; <- ch3F3F3F3F3F3F3F3F ; 12 ;,; <- chFEFCF8F0E0C08000 ; 6 ;,; <- chFCFCFCFCFCFCFCFC ; 1 ;,; <- ch000018183C3C3C3C ; 1 ;,; <- ch3C7E7E7E7E7E0000 ; 1 ;,; <- chC6C6C6C6C6C6C6C6 ; 2 ;,; <- chFCFCE0C0C0C0C0C0 ; 10 ;,; <- chFCFCDCCCCCCCCCCC ; 13 ;,; <- ch00080808080C0C1E ; 1 ;,; <- chD6D6D6D6D6F6FEFE ; 2 ;,; <- chFCFCE0C0C0E0FCFC ; 5 ;,; <- chCCCCCCCCCCCCCCCC ; 4 ;,; <- chCCCCCCCCCCECFCFC ; 9 ;,; <- ch1E1C0C0000000000 ; 1 ;,; <- chF0F8CCCCCCCCCCCC ; 3 ;,; <- ch000103070F1F3F7F ; 3 ;,; <- ch0000FFFFFFFFFFFF ; 3 ;,; <- chFCFC1C0C0C1CFCFC ; 2 ;,; <- ch3030303030303030 ; 4 ;,; <- chFCFCCCCCCCDCFCFC ; 2 ;,; <- ch00000F3F3F0F0000 ; 1 ;,; <- chFCFC303030303030 ; 2 ;,; <- chC0C0C0C0C0C0C0C0 ; 3 ;,; <- chC0C0C0C0C0E0FCFC ; 3 ;,; <- ch7C7C7C6C6C6C6C6C ; 1 ;,; <- chF0F0DEDECCCCFEFE ; 1 ; total unique chars in pic: 30 (worst case req 240 bytes) !byte $CF,$0C ;addr !byte $00 ;data8 !byte ch00080808080C0C1E !byte $96 ;skip !byte $00 ;data8 !byte ch1E1C0C0000000000 !byte $e1,12 ;,; *_004 ;,; <- deps_wenowsaygoodbye ; method 0 ( bytes ) -- 15 bytes (444 cumu) ; method 1 ( ibpc0 bytes ) -- 15 bytes (444 cumu) ; method 2 ( bytes ) -- 15 bytes (444 cumu) ; method 3 ( ibpc0 ibpcaa bytes ) -- 102 bytes (531 cumu) ; method 4 ( clrscr0 bytes ) -- 439 bytes (868 cumu) ; method 5 ( clrscr0 ibpc0 bytes ) -- 435 bytes (864 cumu) ; method 6 ( clrscr0 bytes ) -- 439 bytes (868 cumu) ; method 7 ( clrscr0 ibpc0 ibpcaa bytes ) -- 407 bytes (836 cumu) ; method 8 ( clrscr1 bytes ) -- 469 bytes (898 cumu) ; method 9 ( clrscr1 ibpc0 bytes ) -- 465 bytes (894 cumu) ; method 10 ( clrscr1 bytes ) -- 469 bytes (898 cumu) ; method 11 ( clrscr1 ibpc0 ibpcaa bytes ) -- 437 bytes (866 cumu) ; method 12 ( clrscr2 bytes ) -- 440 bytes (869 cumu) ; method 13 ( clrscr2 ibpc0 bytes ) -- 440 bytes (869 cumu) ; method 14 ( clrscr2 bytes ) -- 440 bytes (869 cumu) ; method 15 ( clrscr2 ibpc0 ibpcaa bytes ) -- 412 bytes (841 cumu) ; method 16 ( clrscr3 bytes ) -- 470 bytes (899 cumu) ; method 17 ( clrscr3 ibpc0 bytes ) -- 470 bytes (899 cumu) ; method 18 ( clrscr3 bytes ) -- 470 bytes (899 cumu) ; method 19 ( clrscr3 ibpc0 ibpcaa bytes ) -- 442 bytes (871 cumu) ; METHOD 0 CHOSEN ;,; <- chFFFFFFFFFFFFFFFF ; 220 ;,; <- chFFFFFFFFFFFF0000 ; 7 ;,; <- ch0000000000000000 ; 175 ;,; <- ch7F3F1F0F07030100 ; 6 ;,; <- ch3F3F3F3F3F3F3F3F ; 12 ;,; <- chFEFCF8F0E0C08000 ; 6 ;,; <- chFCFCFCFCFCFCFCFC ; 1 ;,; <- ch000018183C3C3C3C ; 1 ;,; <- ch3C7E7E7E7E7E0000 ; 1 ;,; <- chC6C6C6C6C6C6C6C6 ; 2 ;,; <- chFCFCE0C0C0C0C0C0 ; 10 ;,; <- chFCFCDCCCCCCCCCCC ; 13 ;,; <- ch0000000000080808 ; 1 ;,; <- chD6D6D6D6D6F6FEFE ; 2 ;,; <- chFCFCE0C0C0E0FCFC ; 5 ;,; <- chCCCCCCCCCCCCCCCC ; 4 ;,; <- chCCCCCCCCCCECFCFC ; 9 ;,; <- ch080C0C1E1E1C0C00 ; 1 ;,; <- chF0F8CCCCCCCCCCCC ; 3 ;,; <- ch000103070F1F3F7F ; 3 ;,; <- ch0000FFFFFFFFFFFF ; 3 ;,; <- chFCFC1C0C0C1CFCFC ; 2 ;,; <- ch3030303030303030 ; 4 ;,; <- chFCFCCCCCCCDCFCFC ; 2 ;,; <- ch00000F3F3F0F0000 ; 1 ;,; <- chFCFC303030303030 ; 2 ;,; <- chC0C0C0C0C0C0C0C0 ; 3 ;,; <- chC0C0C0C0C0E0FCFC ; 3 ;,; <- ch7C7C7C6C6C6C6C6C ; 1 ;,; <- chF0F0DEDECCCCFEFE ; 1 ; total unique chars in pic: 30 (worst case req 240 bytes) !byte $DB,$3C ;addr !byte $e2,1;mode4 !byte $00 ;data4 !byte $33 !byte $CF,$0C ;addr !byte $e2,0;mode8 !byte $00 ;data8 !byte ch0000000000080808 !byte $96 ;skip !byte $00 ;data8 !byte ch080C0C1E1E1C0C00 !byte $e1,12 ;,; *_005 ;,; <- deps_wenowsaygoodbye ; method 0 ( bytes ) -- 18 bytes (462 cumu) ; method 1 ( ibpc0 bytes ) -- 18 bytes (462 cumu) ; method 2 ( bytes ) -- 18 bytes (462 cumu) ; method 3 ( ibpc0 ibpcaa bytes ) -- 106 bytes (550 cumu) ; method 4 ( clrscr0 bytes ) -- 442 bytes (886 cumu) ; method 5 ( clrscr0 ibpc0 bytes ) -- 435 bytes (879 cumu) ; method 6 ( clrscr0 bytes ) -- 442 bytes (886 cumu) ; method 7 ( clrscr0 ibpc0 ibpcaa bytes ) -- 411 bytes (855 cumu) ; method 8 ( clrscr1 bytes ) -- 472 bytes (916 cumu) ; method 9 ( clrscr1 ibpc0 bytes ) -- 465 bytes (909 cumu) ; method 10 ( clrscr1 bytes ) -- 472 bytes (916 cumu) ; method 11 ( clrscr1 ibpc0 ibpcaa bytes ) -- 441 bytes (885 cumu) ; method 12 ( clrscr2 bytes ) -- 444 bytes (888 cumu) ; method 13 ( clrscr2 ibpc0 bytes ) -- 440 bytes (884 cumu) ; method 14 ( clrscr2 bytes ) -- 444 bytes (888 cumu) ; method 15 ( clrscr2 ibpc0 ibpcaa bytes ) -- 416 bytes (860 cumu) ; method 16 ( clrscr3 bytes ) -- 474 bytes (918 cumu) ; method 17 ( clrscr3 ibpc0 bytes ) -- 470 bytes (914 cumu) ; method 18 ( clrscr3 bytes ) -- 474 bytes (918 cumu) ; method 19 ( clrscr3 ibpc0 ibpcaa bytes ) -- 446 bytes (890 cumu) ; METHOD 0 CHOSEN ;,; <- chFFFFFFFFFFFFFFFF ; 221 ;,; <- chFFFFFFFFFFFF0000 ; 7 ;,; <- ch0000000000000000 ; 174 ;,; <- ch7F3F1F0F07030100 ; 6 ;,; <- ch3F3F3F3F3F3F3F3F ; 12 ;,; <- chFEFCF8F0E0C08000 ; 6 ;,; <- chFCFCFCFCFCFCFCFC ; 1 ;,; <- ch000018183C3C3C3C ; 1 ;,; <- ch3C7E7E7E7E7E0000 ; 1 ;,; <- chC6C6C6C6C6C6C6C6 ; 2 ;,; <- chFCFCE0C0C0C0C0C0 ; 10 ;,; <- chFCFCDCCCCCCCCCCC ; 13 ;,; <- chD6D6D6D6D6F6FEFE ; 2 ;,; <- chFCFCE0C0C0E0FCFC ; 5 ;,; <- chCCCCCCCCCCCCCCCC ; 4 ;,; <- chCCCCCCCCCCECFCFC ; 9 ;,; <- ch0000000000080808 ; 1 ;,; <- ch080C0C1E1E1C0C00 ; 1 ;,; <- chF0F8CCCCCCCCCCCC ; 3 ;,; <- ch000103070F1F3F7F ; 3 ;,; <- ch0000FFFFFFFFFFFF ; 3 ;,; <- chFCFC1C0C0C1CFCFC ; 2 ;,; <- ch3030303030303030 ; 4 ;,; <- chFCFCCCCCCCDCFCFC ; 2 ;,; <- ch00000F3F3F0F0000 ; 1 ;,; <- chFCFC303030303030 ; 2 ;,; <- chC0C0C0C0C0C0C0C0 ; 3 ;,; <- chC0C0C0C0C0E0FCFC ; 3 ;,; <- ch7C7C7C6C6C6C6C6C ; 1 ;,; <- chF0F0DEDECCCCFEFE ; 1 ; total unique chars in pic: 30 (worst case req 240 bytes) !byte $DB,$0C ;addr !byte $e2,1;mode4 !byte $00 ;data4 !byte $30 !byte $CF,$0C ;addr !byte $e2,0;mode8 !byte $00 ;data8 !byte chFFFFFFFFFFFFFFFF !byte $96 ;skip !byte $00 ;data8 !byte ch0000000000080808 !byte $96 ;skip !byte $00 ;data8 !byte ch080C0C1E1E1C0C00 !byte $e1,12 ;,; *_006 ;,; <- deps_wenowsaygoodbye ; method 0 ( bytes ) -- 25 bytes (487 cumu) ; method 1 ( ibpc0 bytes ) -- 27 bytes (489 cumu) ; method 2 ( bytes ) -- 25 bytes (487 cumu) ; method 3 ( ibpc0 ibpcaa bytes ) -- 115 bytes (577 cumu) ; method 4 ( clrscr0 bytes ) -- 437 bytes (899 cumu) ; method 5 ( clrscr0 ibpc0 bytes ) -- 433 bytes (895 cumu) ; method 6 ( clrscr0 bytes ) -- 437 bytes (899 cumu) ; method 7 ( clrscr0 ibpc0 ibpcaa bytes ) -- 413 bytes (875 cumu) ; method 8 ( clrscr1 bytes ) -- 467 bytes (929 cumu) ; method 9 ( clrscr1 ibpc0 bytes ) -- 463 bytes (925 cumu) ; method 10 ( clrscr1 bytes ) -- 467 bytes (929 cumu) ; method 11 ( clrscr1 ibpc0 ibpcaa bytes ) -- 443 bytes (905 cumu) ; method 12 ( clrscr2 bytes ) -- 438 bytes (900 cumu) ; method 13 ( clrscr2 ibpc0 bytes ) -- 438 bytes (900 cumu) ; method 14 ( clrscr2 bytes ) -- 438 bytes (900 cumu) ; method 15 ( clrscr2 ibpc0 ibpcaa bytes ) -- 418 bytes (880 cumu) ; method 16 ( clrscr3 bytes ) -- 468 bytes (930 cumu) ; method 17 ( clrscr3 ibpc0 bytes ) -- 468 bytes (930 cumu) ; method 18 ( clrscr3 bytes ) -- 468 bytes (930 cumu) ; method 19 ( clrscr3 ibpc0 ibpcaa bytes ) -- 448 bytes (910 cumu) ; METHOD 0 CHOSEN ;,; <- chFFFFFFFFFFFFFFFF ; 220 ;,; <- chFFFFFFFFFFFF0000 ; 7 ;,; <- ch0000000000000000 ; 175 ;,; <- ch7F3F1F0F07030100 ; 6 ;,; <- ch3F3F3F3F3F3F3F3F ; 12 ;,; <- chFEFCF8F0E0C08000 ; 6 ;,; <- chFCFCFCFCFCFCFCFC ; 1 ;,; <- ch000018183C3C3C3C ; 1 ;,; <- ch3C7E7E7E7E7E0000 ; 1 ;,; <- chC6C6C6C6C6C6C6C6 ; 2 ;,; <- chFCFCE0C0C0C0C0C0 ; 10 ;,; <- chFCFCDCCCCCCCCCCC ; 13 ;,; <- chD6D6D6D6D6F6FEFE ; 2 ;,; <- chFCFCE0C0C0E0FCFC ; 5 ;,; <- chCCCCCCCCCCCCCCCC ; 4 ;,; <- chCCCCCCCCCCECFCFC ; 9 ;,; <- ch00080808080C0C1E ; 1 ;,; <- chF0F8CCCCCCCCCCCC ; 3 ;,; <- ch1E1C0C0000000000 ; 1 ;,; <- ch000103070F1F3F7F ; 3 ;,; <- ch0000FFFFFFFFFFFF ; 3 ;,; <- chFCFC1C0C0C1CFCFC ; 2 ;,; <- ch3030303030303030 ; 4 ;,; <- chFCFCCCCCCCDCFCFC ; 2 ;,; <- ch00000F3F3F0F0000 ; 1 ;,; <- chFCFC303030303030 ; 2 ;,; <- chC0C0C0C0C0C0C0C0 ; 3 ;,; <- chC0C0C0C0C0E0FCFC ; 3 ;,; <- ch7C7C7C6C6C6C6C6C ; 1 ;,; <- chF0F0DEDECCCCFEFE ; 1 ; total unique chars in pic: 30 (worst case req 240 bytes) !byte $DB,$0C ;addr !byte $e2,1;mode4 !byte $00 ;data4 !byte $33 !byte $DB,$54 ;addr !byte $00 ;data4 !byte $33 !byte $CF,$0C ;addr !byte $e2,0;mode8 !byte $00 ;data8 !byte ch0000000000000000 !byte $96 ;skip !byte $00 ;data8 !byte ch0000000000000000 !byte $96 ;skip !byte $00 ;data8 !byte ch00080808080C0C1E !byte $96 ;skip !byte $00 ;data8 !byte ch1E1C0C0000000000 !byte $e1,12 ;,; *_007 ;,; <- deps_wenowsaygoodbye ; method 0 ( bytes ) -- 7 bytes (494 cumu) ; method 1 ( ibpc0 bytes ) -- 7 bytes (494 cumu) ; method 2 ( bytes ) -- 7 bytes (494 cumu) ; method 3 ( ibpc0 ibpcaa bytes ) -- 93 bytes (580 cumu) ; method 4 ( clrscr0 bytes ) -- 433 bytes (920 cumu) ; method 5 ( clrscr0 ibpc0 bytes ) -- 429 bytes (916 cumu) ; method 6 ( clrscr0 bytes ) -- 433 bytes (920 cumu) ; method 7 ( clrscr0 ibpc0 ibpcaa bytes ) -- 399 bytes (886 cumu) ; method 8 ( clrscr1 bytes ) -- 463 bytes (950 cumu) ; method 9 ( clrscr1 ibpc0 bytes ) -- 459 bytes (946 cumu) ; method 10 ( clrscr1 bytes ) -- 463 bytes (950 cumu) ; method 11 ( clrscr1 ibpc0 ibpcaa bytes ) -- 429 bytes (916 cumu) ; method 12 ( clrscr2 bytes ) -- 432 bytes (919 cumu) ; method 13 ( clrscr2 ibpc0 bytes ) -- 434 bytes (921 cumu) ; method 14 ( clrscr2 bytes ) -- 432 bytes (919 cumu) ; method 15 ( clrscr2 ibpc0 ibpcaa bytes ) -- 404 bytes (891 cumu) ; method 16 ( clrscr3 bytes ) -- 462 bytes (949 cumu) ; method 17 ( clrscr3 ibpc0 bytes ) -- 464 bytes (951 cumu) ; method 18 ( clrscr3 bytes ) -- 462 bytes (949 cumu) ; method 19 ( clrscr3 ibpc0 ibpcaa bytes ) -- 434 bytes (921 cumu) ; METHOD 0 CHOSEN ;,; <- chFFFFFFFFFFFFFFFF ; 220 ;,; <- chFFFFFFFFFFFF0000 ; 7 ;,; <- ch0000000000000000 ; 177 ;,; <- ch7F3F1F0F07030100 ; 6 ;,; <- ch3F3F3F3F3F3F3F3F ; 12 ;,; <- chFEFCF8F0E0C08000 ; 6 ;,; <- chFCFCFCFCFCFCFCFC ; 1 ;,; <- ch000018183C3C3C3C ; 1 ;,; <- ch3C7E7E7E7E7E0000 ; 1 ;,; <- chC6C6C6C6C6C6C6C6 ; 2 ;,; <- chFCFCE0C0C0C0C0C0 ; 10 ;,; <- chFCFCDCCCCCCCCCCC ; 13 ;,; <- chD6D6D6D6D6F6FEFE ; 2 ;,; <- chFCFCE0C0C0E0FCFC ; 5 ;,; <- chCCCCCCCCCCCCCCCC ; 4 ;,; <- chCCCCCCCCCCECFCFC ; 9 ;,; <- chF0F8CCCCCCCCCCCC ; 3 ;,; <- ch000103070F1F3F7F ; 3 ;,; <- ch0000FFFFFFFFFFFF ; 3 ;,; <- chFCFC1C0C0C1CFCFC ; 2 ;,; <- ch3030303030303030 ; 4 ;,; <- chFCFCCCCCCCDCFCFC ; 2 ;,; <- ch00000F3F3F0F0000 ; 1 ;,; <- chFCFC303030303030 ; 2 ;,; <- chC0C0C0C0C0C0C0C0 ; 3 ;,; <- chC0C0C0C0C0E0FCFC ; 3 ;,; <- ch7C7C7C6C6C6C6C6C ; 1 ;,; <- chF0F0DEDECCCCFEFE ; 1 ; total unique chars in pic: 28 (worst case req 224 bytes) !byte $CF,$3C ;addr !byte $00 ;data8 !byte ch0000000000000000 !byte $96 ;skip !byte $00 ;data8 !byte ch0000000000000000 !byte $e1,12+96-24 ; total compressed size 494 bytes
grammars/MOL2Parser.g4
Sylvan-Materials/cifio
0
7842
<gh_stars>0 parser grammar MOL2Parser; options { tokenVocab = MOL2Lexer; } mol2 : comment* tripos_molecule_record tripos_atom_record tripos_bond_record tripos_substructure_record; tripos_alt_type_record : TRIPOS_ALT_TYPE Eol ~(Eol)+ Eol; tripos_anchor_atom_record : TRIPOS_ANCHOR_ATOM ~(Eol)+ Eol; tripos_associated_annotation_record : TRIPOS_ASSOCIATED_ANNOTATION ~(Eol)+ Eol; tripos_atom_record : TRIPOS_ATOM Eol (atom_id atom_name x y z atom_type (atom_subst_id(atom_subst_name (charge (atom_status_bit)?)?)?)? Eol)+; atom_id : Number; atom_name : Literal|CAP; x : Number; y : Number; z : Number; atom_type : Literal(Period Literal|Number)?; atom_subst_id : Number; atom_subst_name : Literal; charge : Number; atom_status_bit : DSPMOD | TYPECOL | CAP | BACKBONE | DICT | ESSENTIAL | WATER |DIRECT; tripos_bond_record : TRIPOS_BOND Eol (bond_id origin_atom_id target_atom_id bond_type (bond_status_bits)? Eol)+; bond_id : Number; origin_atom_id : Number; target_atom_id : Number; bond_type : Literal|Number; bond_status_bits : TYPECOL | GROUP | CAP | BACKBONE | DICT | INTERRES; tripos_center_of_mass_record : TRIPOS_CENTER_OF_MASS ~(Eol)+ Eol; tripos_centroid_record : TRIPOS_CENTROID ~(Eol)+ Eol; tripos_comment_record : TRIPOS_COMMENT ~(Eol)+ Eol; tripos_crysin_record : TRIPOS_CRYSIN ~(Eol)+ Eol; tripos_dict_record : TRIPOS_DICT ~(Eol)+ Eol; tripos_data_file_record : TRIPOS_DATA_FILE ~(Eol)+ Eol; tripos_extension_point_record : TRIPOS_EXTENSION_POINT ~(Eol)+ Eol; tripos_ff_pbc_record : TRIPOS_FF_PBC ~(Eol)+ Eol; tripos_ffcon_angle_record : TRIPOS_FFCON_ANGLE ~(Eol)+ Eol; tripos_ffcon_dist_record : TRIPOS_FFCON_DIST ~(Eol)+ Eol; tripos_ffcon_multi_record : TRIPOS_FFCON_MULTI ~(Eol)+ Eol; tripos_ffcon_range_record : TRIPOS_FFCON_RANGE ~(Eol)+ Eol; tripos_ffcon_torsion_record : TRIPOS_FFCON_TORSION ~(Eol)+ Eol; tripos_line_record : TRIPOS_LINE ~(Eol)+ Eol; tripos_lsplane_record : TRIPOS_LSPLANE ~(Eol)+ Eol; tripos_molecule_record : TRIPOS_MOLECULE Eol mol_name Eol num_atoms (num_bonds (num_subst (num_feat(num_sets)?)?)?)? Eol mol_type Eol charge_type Eol status_bits Eol mol_comment Eol; mol_name : Literal; num_atoms : Number; num_bonds : Number; num_subst : Number; num_feat : Number; num_sets : Number; mol_type : SMALL | BIOPOLYMER | PROTEIN | NUCLEIC_ACID | SACCHARIDE; charge_type : NO_CHARGES | DEL_RE | GASTEIGER | GAST_HUCK | HUCKEL | PULLMAN | GAUSS80_CHARGES | AMPAC_CHARGES | MULLIKEN_CHARGES | DICT_CHARGES | MMFF94_CHARGES | USER_CHARGES; status_bits : (System | Invalid_charges | Analyzed | Substituted | Altered | Ref_angle)* ; mol_comment : ~(Eol)*; tripos_normal_record : TRIPOS_NORMAL ~(Eol)+ Eol; tripos_qsar_align_rule_record : TRIPOS_QSAR_ALIGN_RULE; tripos_ring_closure_record : TRIPOS_RING_CLOSURE ~(Eol)+ Eol; tripos_rotatable_bond_record : TRIPOS_ROTATABLE_BOND ~(Eol)+ Eol; tripos_search_dist_recor : TRIPOS_SEARCH_DIST ~(Eol)+ Eol; tripos_search_options_record : TRIPOS_SEARCH_OPTIONS ~(Eol)+ Eol; tripos_set_record : TRIPOS_SET ~(Eol)+ Eol; tripos_substructure_record : TRIPOS_SUBSTRUCTURE Eol (subst_id subst_name root_atom (subst_type (dict_type(chain (sub_type (inter_bonds (status (sub_comment)?)?)?)?)?)?)? Eol)+; subst_id : Number; subst_name : Literal; root_atom : Number; subst_type : Literal; dict_type : Number; chain : Literal|Star+; sub_type : Literal|Star+; inter_bonds : Number; status : LEAF | ROOT | TYPECOL | DICT |BACKWARD | BLOCK; sub_comment : Literal+; tripos_u_feat_record : TRIPOS_U_FEAT ~(Eol)+ Eol; tripos_unity_atom_attr_record : TRIPOS_UNITY_ATOM_ATTR ~(Eol)+ Eol; tripos_unity_bond_attr_record : TRIPOS_UNITY_BOND_ATTR ~(Eol)+ Eol; comment : Pound ~(Eol)+ Eol+;
test/epic/RunTests.agda
asr/agda-kanso
0
10154
<gh_stars>0 {-# OPTIONS --no-termination-check #-} module RunTests where open import Prelude.Bool open import Prelude.Char open import Prelude.Nat open import Prelude.List open import Prelude.IO open import Prelude.String open import Prelude.Unit open import Prelude.Product postulate Stream : Set popen : String -> String -> IO Stream pclose : Stream -> IO Unit readChar : Stream -> IO Char strLen : String -> Nat charAt : (s : String) -> Nat -> Char _`_`_ : {A B C : Set}(x : A)(f : A -> B -> C)(y : B) -> C x ` f ` y = f x y infixr 9 _∘_ _∘_ : {A : Set}{B : A -> Set}{C : (x : A) -> B x -> Set} (f : {a : A}(b : B a)-> C a b) (g : (a : A) -> B a)(x : A) -> C x (g x) f ∘ g = λ x -> f (g x) infixr 1 _$_ _$_ : {A : Set}{B : A -> Set}(f : (x : A) -> B x)(x : A) -> B x f $ x = f x {-# COMPILED_EPIC popen (s : String, m : String, u : Unit) -> Ptr = foreign Ptr "popen" (mkString(s) : String, mkString(m) : String) #-} {-# COMPILED_EPIC pclose (s : Ptr, u : Unit) -> Unit = foreign Int "pclose" (s : Ptr) ; u #-} {-# COMPILED_EPIC readChar (s : Ptr, u : Unit) -> Int = foreign Int "fgetc" (s : Ptr) #-} {-# COMPILED_EPIC strLen (s : Any) -> BigInt = foreign BigInt "intToBig" (foreign Int "strlen" (mkString(s) : String) : Int) #-} {-# COMPILED_EPIC charAt (s : Any, n : BigInt) -> Int = foreign Int "charAtBig" (mkString(s) : String, n : BigInt) #-} readStream : Stream -> IO (List Char) readStream stream = c <- readChar stream , if' charEq eof c then pclose stream ,, return [] else ( cs <- readStream stream , return (c :: cs)) system : String -> IO (List Char) system s = putStrLn $ "system " +S+ s ,, x <- popen s "r" , y <- readStream x , return y span : {A : Set} -> (p : A -> Bool) -> List A -> List A × List A span p [] = [] , [] span p (a :: as) with p a ... | false = [] , a :: as ... | true with span p as ... | xs , ys = (a :: xs) , ys groupBy : {A : Set} -> (A -> A -> Bool) -> List A -> List (List A) groupBy _ [] = [] groupBy eq (x :: xs) with span (eq x) xs ... | ys , zs = (x :: ys) :: groupBy eq zs comparing : {A B : Set} -> (A -> B) -> (B -> B -> Bool) -> A -> A -> Bool comparing f _==_ x y = f x == f y FilePath : Set FilePath = String and : List Bool -> Bool and [] = true and (true :: xs) = and xs and (false :: _) = false sequence : {A : Set} -> List (IO A) -> IO (List A) sequence [] = return [] sequence (x :: xs) = r <- x , rs <- sequence xs , return (r :: rs) mapM : {A B : Set} -> (A -> IO B) -> List A -> IO (List B) mapM f xs = sequence (map f xs) printList : List Char -> IO Unit printList xs = mapM printChar xs ,, printChar '\n' printResult : FilePath -> List Char -> List Char -> IO Unit printResult filename l1 l2 with l1 ` listEq charEq ` l2 ... | true = putStrLn (filename +S+ ": Success!") ... | false = putStrLn (filename +S+ ": Fail!") ,, putStrLn "Expected:" ,, printList l2 ,, putStrLn "Got:" ,, printList l1 compile : FilePath -> FilePath -> IO Unit compile dir file = system $ "agda --epic --compile-dir=" +S+ dir +S+ "bin/ " +S+ dir +S+ file ,, return unit readFile : FilePath -> IO (List Char) readFile file = system $ "cat " +S+ file -- This won't work because of a bug in Epic... {- validFile : List Char -> Bool validFile f with span (not ∘ charEq '.') f ... | _ , ('.' :: 'a' :: 'g' :: 'd' :: 'a' :: []) = true ... | _ , ('.' :: 'o' :: 'u' :: 't' :: []) = true ... | _ = false -} stripFileEnding : FilePath -> FilePath stripFileEnding fp = fromList $ fst $ span (not ∘ charEq '.') (fromString fp) testFile : FilePath -> FilePath -> FilePath -> IO Bool testFile outdir agdafile outfile = compile outdir (agdafile) ,, out <- system $ outdir +S+ "bin/" +S+ stripFileEnding agdafile , expected <- readFile (outdir +S+ outfile) , printResult agdafile out expected ,, return (out ` listEq charEq ` expected) testFile' : FilePath -> List (List Char) -> IO Bool testFile' outdir (agdafile :: outfile :: _) = testFile outdir (fromList agdafile) (fromList outfile) testFile' _ _ = return true isNewline : Char -> Bool isNewline '\n' = true isNewline _ = false lines : List Char -> List (List Char) lines list with span (not ∘ isNewline) list ... | l , [] = l :: [] ... | l , _ :: s' = l :: lines s' getFiles : FilePath -> IO (List (List Char)) getFiles dir = out <- system $ "ls " +S+ dir , putStrLn "getFiles after ls" ,, -- mapM (printList ∘ snd) $ map (span (not ∘ charEq '.')) $ lines out ,, return $ lines out -- filter validFile $ lines out isDot : Char -> Bool isDot '.' = true isDot _ = false testFiles : FilePath -> IO Bool testFiles dir = files <- getFiles dir , putStrLn "Found the following files in the tests directory:" ,, mapM printList files ,, res <- mapM (testFile' dir) (groupBy (comparing (fst ∘ span (not ∘ isDot)) (listEq charEq)) files) , return $ and res getCurrentDirectory : IO FilePath getCurrentDirectory = fromList <$> system "pwd" main : IO Unit main = dir' <- getCurrentDirectory , putStrLn (fromList (fromString dir')) ,, putStrLn "hello" ,, putStrLn (fromList (tail ('h' :: 'e' :: 'j' :: []))) ,, printList (fromString "hej igen") ,, putStrLn (fromList (tail (fromString "hello"))) ,, dir <- fromList ∘ init ∘ fromString <$> getCurrentDirectory , putStrLn dir ,, system ("rm " +S+ dir +S+ "/tests/*.agdai") ,, res <- testFiles (dir +S+ "/tests/") , (if res then putStrLn "All tests succeeded! " else putStrLn "Not all tests succeeded ")
TrabajoIntegrado/Prueba/prueba.asm
nicopassaglia/Simon_digitales
0
2369
<filename>TrabajoIntegrado/Prueba/prueba.asm list p = 16f887 include "p16f887.inc" __CONFIG _CONFIG1, _LVP_OFF & _FCMEN_ON & _IESO_OFF & _BOR_OFF & _CPD_OFF & _CP_OFF & _MCLRE_OFF & _PWRTE_OFF & _WDT_OFF & _XT_OSC __CONFIG _CONFIG2, _WRT_OFF & _BOR21V ;__CONFIG _XT_OSC & _PWRTE_OFF & _BOREN_OFF & _CP_OFF & _WDT_OFF & _DP_OFF & _CPC_OFF cblock 0x30 DELAY1 DELAY2 endc org 0x00 goto INICIO org 0x04 goto INT INT ANTIREBOTE_INT call delay_100ms PROBANDO_RB0 btfsc PORTB, 0 ;Testeo el bit RB0, si se dejo de pulsar el boton bajara a cero goto PROBANDO_RB0 call delay_100ms ;Una vez que se dejo de presionar el boton, hago un delay de 10 ms para que pase el rebote. banksel INTCON movlw b'00000010' xorwf PORTA, 1 bcf INTCON, INTF retfie INICIO ;banksel OSCCON ;movlw b'10101100' ;movwf OSCCON banksel TRISA bsf TRISB, 0 bcf TRISA, 1 banksel ANSEL clrf ANSEL clrf ANSELH banksel OPTION_REG movlw b'11000000' movwf OPTION_REG banksel INTCON bsf INTCON, GIE bsf INTCON, INTE bcf PORTA, 1 nop nop HOLA nop clrwdt goto HOLA delay_100ms ;{ movlw .200 movwf DELAY2 BUCLE2_100 movlw .124 movwf DELAY1 BUCLE1_100 clrwdt decfsz DELAY1, 1 goto BUCLE1_100 decfsz DELAY2, 1 goto BUCLE2_100 return ;La formula del delay es R=[(4X)+4]Y+1 donde X=124 e Y=20. ;} end
alloy4fun_models/trashltl/models/7/Ptqkd3XYBRLQxEeQA.als
Kaixi26/org.alloytools.alloy
0
1365
<reponame>Kaixi26/org.alloytools.alloy<filename>alloy4fun_models/trashltl/models/7/Ptqkd3XYBRLQxEeQA.als open main pred idPtqkd3XYBRLQxEeQA_prop8 { all f1, f2 : File | (f1 -> f2) in link implies eventually (f1 in Trash and f2 in Trash) } pred __repair { idPtqkd3XYBRLQxEeQA_prop8 } check __repair { idPtqkd3XYBRLQxEeQA_prop8 <=> prop8o }
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/日本_Ver3/asm/z00_bms1.asm
prismotizm/gigaleak
0
168319
<gh_stars>0 Name: z00_bms1.asm Type: file Size: 118839 Last-Modified: '2016-05-13T04:36:32Z' SHA-1: 26512FFBC2E496C6F8A66206A9E0502BFADC0313 Description: null
programs/oeis/024/A024004.asm
karttu/loda
1
9115
; A024004: a(n) = 1 - n^6. ; 1,0,-63,-728,-4095,-15624,-46655,-117648,-262143,-531440,-999999,-1771560,-2985983,-4826808,-7529535,-11390624,-16777215,-24137568,-34012223,-47045880,-63999999,-85766120,-113379903,-148035888,-191102975,-244140624,-308915775,-387420488,-481890303,-594823320,-728999999,-887503680,-1073741823,-1291467968,-1544804415,-1838265624,-2176782335,-2565726408,-3010936383,-3518743760,-4095999999,-4750104240,-5489031743,-6321363048,-7256313855,-8303765624,-9474296895,-10779215328,-12230590463,-13841287200,-15624999999,-17596287800,-19770609663,-22164361128,-24794911295,-27680640624,-30840979455,-34296447248,-38068692543,-42180533640,-46655999999,-51520374360,-56800235583,-62523502208,-68719476735,-75418890624,-82653950015,-90458382168,-98867482623,-107918163080,-117648999999,-128100283920,-139314069503,-151334226288,-164206490175,-177978515624,-192699928575,-208422380088,-225199600703,-243087455520,-262143999999,-282429536480,-304006671423,-326940373368,-351298031615,-377149515624,-404567235135,-433626201008,-464404086783,-496981290960,-531440999999,-567869252040,-606355001343,-646990183448,-689869781055,-735091890624,-782757789695,-832972004928,-885842380863,-941480149400,-999999999999,-1061520150600,-1126162419263,-1194052296528,-1265319018495,-1340095640624,-1418519112255,-1500730351848,-1586874322943,-1677100110840,-1771560999999,-1870414552160,-1973822685183,-2081951752608,-2194972623935,-2313060765624,-2436396322815,-2565164201768,-2699554153023,-2839760855280,-2985983999999,-3138428376720,-3297303959103,-3462825991688,-3635215077375,-3814697265624,-4001504141375,-4195872914688,-4398046511103,-4608273662720,-4826808999999,-5053913144280,-5289852801023,-5534900853768,-5789336458815,-6053445140624,-6327518887935,-6611856250608,-6906762437183,-7212549413160,-7529535999999,-7858047974840,-8198418170943,-8550986578848,-8916100448255,-9294114390624,-9685390482495,-10090298369528,-10509215371263,-10942526586600,-11390624999999,-11853911588400,-12332795428863,-12827693806928,-13339032325695,-13867245015624,-14412774445055,-14976071831448,-15557597153343,-16157819263040,-16777215999999,-17416274304960,-18075490334783,-18755369578008,-19456426971135,-20179187015624,-20924183895615,-21691961596368,-22483074023423,-23298085122480,-24137568999999,-25002110044520,-25892303048703,-26808753332088,-27752076864575,-28722900390624,-29721861554175,-30749609024288,-31806802621503,-32894113444920,-34012223999999,-35161828327080,-36343632130623,-37558352909168,-38806720086015,-40089475140624,-41407371740735,-42761175875208,-44151665987583,-45579633110360,-47045880999999,-48551226272640,-50096498540543,-51682540549248,-53310208315455,-54980371265624,-56693912375295,-58451728309128,-60254729561663,-62103840598800,-63999999999999,-65944160601200,-67937289638463,-69980368892328,-72074394832895,-74220378765624,-76419346977855,-78672340886048,-80980417183743,-83344647990240,-85766120999999,-88245939632760,-90785223184383,-93385106978408,-96046742518335,-98771297640624,-101559956668415,-104413920565968,-107334407093823,-110322650964680,-113379903999999,-116507435287320,-119706531338303,-122978496247488,-126324651851775,-129746337890624,-133244912166975,-136821750708888,-140478247931903,-144215816802120,-148035888999999,-151939915084880,-155929364660223,-160005726539568,-164170508913215,-168425239515624,-172771465793535,-177210755074808,-181744694737983,-186374892382560,-191102975999999,-195930594145440,-200859416110143,-205891132094648,-211027453382655,-216270112515624,-221620863468095,-227081481823728,-232653764952063,-238339532186000 pow $0,6 mov $1,1 sub $1,$0
ffight/lcs/weapon/86.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
6
13515
copyright zengfr site:http://github.com/zengfr/romhack 009ACA dbra D5, $9ac8 057A4A move.b #$5, ($86,A6) [weapon+84] 057A50 move.b #$1, ($4a,A6) [weapon+86] 057E14 bne $57e36 [weapon+86] 057E30 move.b #$7, ($2f,A6) [weapon+86] 0586A6 bne $586c8 [weapon+86] 0586C2 move.b #$7, ($2f,A6) [weapon+86] 058AF0 move.b #$5, ($86,A6) [weapon+84] 058AF6 clr.b ($88,A6) [weapon+86] 058F38 bne $58f5a [weapon+86] 058F54 move.b #$7, ($2f,A6) [weapon+86] copyright zengfr site:http://github.com/zengfr/romhack
src/QRest.Semantics.OData/Grammar/ODataGrammar.g4
pamidur/queryable-rest
4
2660
<gh_stars>1-10 grammar ODataGrammar; parse : queryOptions EOF | EOF ; queryOptions : queryOption ( AMPERSAND queryOption )*; queryOption : filter | select | count | orderby | top | skip ; filter : DOLLAR 'filter' EQPARAM filterexpr=expression ; lambda : fld=IDENTIFIER '/' lambdaName LPAREN lid=IDENTIFIER ':' laExpr=expression RPAREN ; select: DOLLAR 'select' EQPARAM selectItem ( COMMA selectItem )* ; selectItem : IDENTIFIER ; count : DOLLAR 'count' EQPARAM decexpr=bool ; orderby : DOLLAR 'orderby' EQPARAM orderbyItem ( COMMA orderbyItem ) * ; orderbyItem : IDENTIFIER order? ; order : 'asc' | 'desc' ; top : DOLLAR 'top' EQPARAM INT ; skip : DOLLAR 'skip' EQPARAM INT ; expression : LPAREN expression RPAREN #parenExpression | NOT expression #notExpression | lambda #lambdaCallExpression | left=expression op=comparator right=expression #comparatorExpression | left=expression op=binary right=expression #binaryExpression | GD #gdExpression | DATETIME #datetimeExpression | bool #boolExpression | (prefix=IDENTIFIER '/')? val=IDENTIFIER #identifierExpression | DECIMAL #decimalExpression | INT #intExpression | STRINGLITERAL #stringExpression | func=IDENTIFIER LPAREN functionParams RPAREN #funcCallExpression | NULL #nullExpression ; comparator : GT | GE | LT | LE | EQ | NE ; binary : AND | OR ; bool : TRUE | FALSE ; functionParams : expression (COMMA expression)* ; fragment BLOCK : [A-Fa-f0-9] [A-Fa-f0-9] [A-Fa-f0-9] [A-Fa-f0-9] ; lambdaName : 'any' | 'all' ; GD : BLOCK BLOCK '-' BLOCK '-' BLOCK '-' BLOCK '-' BLOCK BLOCK BLOCK ; DATETIME : DIGIT4 '-' DIGIT2 '-' DIGIT2 'T' DIGIT2 ':' DIGIT2 ':' DIGIT2 ('.' [0-9]+)? ( 'Z' | ('+'|'-') DIGIT2 ':' DIGIT2 ) ; EQPARAM : '=' ; DOLLAR : '$' ; AMPERSAND : '&' ; COMMA : ',' ; SQ : '\'' ; AND : 'AND' | 'and' ; OR : 'OR' | 'or' ; NOT : 'NOT' | '!' | '<>' | 'not' ; TRUE : 'TRUE' | 'true' ; FALSE : 'FALSE' | 'false' ; NULL : 'NULL' | 'null' ; GT : 'gt' | 'GT' ; GE : 'ge' | 'GE' ; LT : 'lt' | 'LT' ; LE : 'le' | 'LE' ; EQ : 'eq' | 'EQ' ; NE : 'ne' | 'NE' ; LPAREN : '(' ; RPAREN : ')' ; LQPAREN : '[' ; RQPAREN : ']' ; DECIMAL : INT '.' [0-9]+ ; INT : '-'? [0-9]+ ; DIGIT : [0-9] ; DIGIT2 : DIGIT DIGIT; DIGIT4 : DIGIT2 DIGIT2 ; IDENTIFIER : [a-zA-Z_] [a-zA-Z_0-9]* ; STRINGLITERAL : SQ .*? SQ ; WS : [ \r\t\u000C\n]+ -> skip;
libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_stat_callee.asm
jpoikela/z88dk
640
90085
<gh_stars>100-1000 ; unsigned char esx_f_stat(unsigned char *filename,struct esx_stat *es) SECTION code_esxdos PUBLIC esx_f_stat_callee EXTERN asm_esx_f_stat esx_f_stat_callee: pop hl pop de ex (sp),hl jp asm_esx_f_stat ; SDCC bridge for Classic IF __CLASSIC PUBLIC _esx_f_stat_callee defc _esx_f_stat_callee = esx_f_stat_callee ENDIF
src/Shaders/Sdk/Direct3D11/SubD11/SubD11_HS.asm
tgjones/slimshader-cpp
20
178688
// // Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.16384 // // /// // Buffer Definitions: // // cbuffer cbTangentStencilConstants // { // // float g_TanM[1024]; // Offset: 0 Size: 16372 [unused] // float g_fCi[16]; // Offset: 16384 Size: 244 // // } // // cbuffer cbPerFrame // { // // float4x4 g_mViewProjection; // Offset: 0 Size: 64 [unused] // float3 g_vCameraPosWorld; // Offset: 64 Size: 12 [unused] // float g_fTessellationFactor; // Offset: 76 Size: 4 // float g_fDisplacementHeight; // Offset: 80 Size: 4 [unused] // float3 g_vSolidColor; // Offset: 84 Size: 12 [unused] // // } // // cbuffer cbPerSubset // { // // int g_iPatchStartIndex; // Offset: 0 Size: 4 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // g_ValencePrefixBuffer texture uint4 buf 0 1 // cbTangentStencilConstants cbuffer NA NA 0 1 // cbPerFrame cbuffer NA NA 2 1 // cbPerSubset cbuffer NA NA 3 1 // // // // Patch Constant signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_TessFactor 0 x 0 QUADEDGE float x // SV_TessFactor 1 x 1 QUADEDGE float x // SV_TessFactor 2 x 2 QUADEDGE float x // SV_TessFactor 3 x 3 QUADEDGE float x // SV_InsideTessFactor 0 x 4 QUADINT float x // SV_InsideTessFactor 1 x 5 QUADINT float x // TANGENT 0 xyz 6 NONE float xyz // TANGENT 1 xyz 7 NONE float xyz // TANGENT 2 xyz 8 NONE float xyz // TANGENT 3 xyz 9 NONE float xyz // TEXCOORD 0 xy 10 NONE float xy // TEXCOORD 1 xy 11 NONE float xy // TEXCOORD 2 xy 12 NONE float xy // TEXCOORD 3 xy 13 NONE float xy // TANUCORNER 0 xyz 14 NONE float xyz // TANUCORNER 1 xyz 15 NONE float xyz // TANUCORNER 2 xyz 16 NONE float xyz // TANUCORNER 3 xyz 17 NONE float xyz // TANVCORNER 0 xyz 18 NONE float xyz // TANVCORNER 1 xyz 19 NONE float xyz // TANVCORNER 2 xyz 20 NONE float xyz // TANVCORNER 3 xyz 21 NONE float xyz // TANWEIGHTS 0 xyzw 22 NONE float xyzw // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // WORLDPOS 0 xyz 0 NONE float xyz // TEXCOORD 0 xy 1 NONE float xy // TANGENT 0 xyz 2 NONE float xyz // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // BEZIERPOS 0 xyz 0 NONE float xyz // // Tessellation Domain # of control points // -------------------- -------------------- // Quadrilateral 16 // // Tessellation Output Primitive Partitioning Type // ------------------------------ ------------------ // Clockwise Triangles Integer // hs_5_0 hs_decls dcl_input_control_point_count 32 dcl_output_control_point_count 16 dcl_tessellator_domain domain_quad dcl_tessellator_partitioning partitioning_integer dcl_tessellator_output_primitive output_triangle_cw dcl_globalFlags refactoringAllowed dcl_constantbuffer cb0[1040], dynamicIndexed dcl_constantbuffer cb2[5], immediateIndexed dcl_constantbuffer cb3[1], immediateIndexed dcl_resource_buffer (uint,uint,uint,uint) t0 hs_control_point_phase dcl_input vOutputControlPointID dcl_input vPrim dcl_input v[32][0].xyz dcl_output o0.xyz dcl_temps 7 iadd r0.x, vPrim, cb3[0].x ishl r0.y, r0.x, l(1) ld_indexable(buffer)(uint,uint,uint,uint) r1.xyzw, r0.yyyy, t0.xyzw bfi r0.x, l(31), l(1), r0.x, l(1) ld_indexable(buffer)(uint,uint,uint,uint) r0.xyzw, r0.xxxx, t0.xyzw switch vOutputControlPointID case l(5) utof r2.w, r1.x add r3.xyz, v[1][0].xyzx, v[1][0].xyzx mad r3.xyz, v[0][0].xyzx, r2.wwww, r3.xyzx add r3.xyz, r3.xyzx, v[2][0].xyzx mad r3.xyz, v[3][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r3.xyzx iadd r2.w, r1.x, l(5) utof r2.w, r2.w div r2.xyz, r3.xyzx, r2.wwww break case l(6) add r3.xyz, v[0][0].xyzx, v[0][0].xyzx utof r2.w, r1.y mad r3.xyz, v[1][0].xyzx, r2.wwww, r3.xyzx mad r3.xyz, v[2][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r3.xyzx add r3.xyz, r3.xyzx, v[3][0].xyzx iadd r2.w, r1.y, l(5) utof r2.w, r2.w div r2.xyz, r3.xyzx, r2.wwww break case l(10) mad r3.xyz, v[1][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), v[0][0].xyzx utof r2.w, r1.z mad r3.xyz, v[2][0].xyzx, r2.wwww, r3.xyzx mad r3.xyz, v[3][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r3.xyzx iadd r2.w, r1.z, l(5) utof r2.w, r2.w div r2.xyz, r3.xyzx, r2.wwww break case l(9) mad r3.xyz, v[0][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), v[1][0].xyzx mad r3.xyz, v[2][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r3.xyzx utof r2.w, r1.w mad r3.xyz, v[3][0].xyzx, r2.wwww, r3.xyzx iadd r2.w, r1.w, l(5) utof r2.w, r2.w div r2.xyz, r3.xyzx, r2.wwww break case l(0) imul null, r2.w, r1.x, r1.x utof r3.x, r2.w mul r3.yzw, l(0.000000, 4.000000, 4.000000, 4.000000), v[4][0].xxyz mad r3.xyz, r3.xxxx, v[0][0].xyzx, r3.yzwy iadd r4.xy, r0.xwxx, l(-1, -1, 0, 0) mov r5.xyz, r3.xyzx mov r3.w, l(4) loop uge r4.z, r3.w, r4.x breakc_nz r4.z add r6.xyz, r5.xyzx, v[r3.w + 1][0].xyzx iadd r4.z, r3.w, l(2) mad r5.xyz, v[r3.w + 2][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r6.xyzx mov r3.w, r4.z endloop add r3.xyz, r5.xyzx, v[r3.w + 1][0].xyzx add r3.xyz, r3.xyzx, v[r4.y + 0][0].xyzx mad r3.xyz, v[1][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r3.xyzx add r3.xyz, r3.xyzx, v[2][0].xyzx mad r3.xyz, v[3][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r3.xyzx imad r2.w, l(5), r1.x, r2.w utof r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r2.xyz, r2.wwww, r3.xyzx break case l(3) imul null, r2.w, r1.y, r1.y utof r3.x, r2.w mul r3.yzw, l(0.000000, 4.000000, 4.000000, 4.000000), v[r0.x + 0][0].xxyz mad r3.xyz, r3.xxxx, v[1][0].xyzx, r3.yzwy iadd r4.xy, r0.yxyy, l(-1, -1, 0, 0) mov r5.xyz, r3.xyzx mov r3.w, r0.x loop uge r4.z, r3.w, r4.x breakc_nz r4.z add r6.xyz, r5.xyzx, v[r3.w + 1][0].xyzx iadd r4.z, r3.w, l(2) mad r5.xyz, v[r3.w + 2][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r6.xyzx mov r3.w, r4.z endloop add r3.xyz, r5.xyzx, v[r3.w + 1][0].xyzx add r3.xyz, r3.xyzx, v[r4.y + 0][0].xyzx mad r3.xyz, v[2][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r3.xyzx add r3.xyz, r3.xyzx, v[3][0].xyzx mad r3.xyz, v[0][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r3.xyzx imad r2.w, l(5), r1.y, r2.w utof r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r2.xyz, r2.wwww, r3.xyzx break case l(15) imul null, r2.w, r1.z, r1.z utof r3.x, r2.w mul r3.yzw, l(0.000000, 4.000000, 4.000000, 4.000000), v[r0.y + 0][0].xxyz mad r3.xyz, r3.xxxx, v[2][0].xyzx, r3.yzwy iadd r4.xy, r0.zyzz, l(-1, -1, 0, 0) mov r5.xyz, r3.xyzx mov r3.w, r0.y loop uge r4.z, r3.w, r4.x breakc_nz r4.z add r6.xyz, r5.xyzx, v[r3.w + 1][0].xyzx iadd r4.z, r3.w, l(2) mad r5.xyz, v[r3.w + 2][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r6.xyzx mov r3.w, r4.z endloop add r3.xyz, r5.xyzx, v[r3.w + 1][0].xyzx add r3.xyz, r3.xyzx, v[r4.y + 0][0].xyzx mad r3.xyz, v[3][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r3.xyzx add r3.xyz, r3.xyzx, v[0][0].xyzx mad r3.xyz, v[1][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r3.xyzx imad r2.w, l(5), r1.z, r2.w utof r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r2.xyz, r2.wwww, r3.xyzx break case l(12) imul null, r2.w, r1.w, r1.w utof r3.x, r2.w mul r3.yzw, l(0.000000, 4.000000, 4.000000, 4.000000), v[r0.z + 0][0].xxyz mad r3.xyz, r3.xxxx, v[3][0].xyzx, r3.yzwy iadd r4.xy, r0.wzww, l(-1, -1, 0, 0) mov r5.xyz, r3.xyzx mov r3.w, r0.z loop uge r4.z, r3.w, r4.x breakc_nz r4.z add r6.xyz, r5.xyzx, v[r3.w + 1][0].xyzx iadd r4.z, r3.w, l(2) mad r5.xyz, v[r3.w + 2][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r6.xyzx mov r3.w, r4.z endloop add r3.xyz, r5.xyzx, v[4][0].xyzx add r3.xyz, r3.xyzx, v[r4.y + 0][0].xyzx mad r3.xyz, v[0][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r3.xyzx add r3.xyz, r3.xyzx, v[1][0].xyzx mad r3.xyz, v[2][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r3.xyzx imad r2.w, l(5), r1.w, r2.w utof r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r2.xyz, r2.wwww, r3.xyzx break case l(1) ishl r2.w, r1.x, l(1) iadd r3.x, r2.w, l(10) utof r3.x, r3.x utof r2.w, r2.w mul r3.yzw, l(0.000000, 4.000000, 4.000000, 4.000000), v[1][0].xxyz mad r3.yzw, r2.wwww, v[0][0].xxyz, r3.yyzw add r3.yzw, r3.yyzw, v[2][0].xxyz mad r3.yzw, v[3][0].xxyz, l(0.000000, 2.000000, 2.000000, 2.000000), r3.yyzw iadd r2.w, r0.x, l(-1) mad r3.yzw, v[r2.w + 0][0].xxyz, l(0.000000, 2.000000, 2.000000, 2.000000), r3.yyzw add r3.yzw, r3.yyzw, v[r0.x + 0][0].xxyz div r2.xyz, r3.yzwy, r3.xxxx break case l(2) ishl r2.w, r1.y, l(1) iadd r3.x, r2.w, l(10) utof r3.x, r3.x utof r2.w, r2.w mul r3.yzw, r2.wwww, v[1][0].xxyz mad r3.yzw, v[0][0].xxyz, l(0.000000, 4.000000, 4.000000, 4.000000), r3.yyzw mad r3.yzw, v[2][0].xxyz, l(0.000000, 2.000000, 2.000000, 2.000000), r3.yyzw add r3.yzw, r3.yyzw, v[3][0].xxyz iadd r2.w, r0.x, l(-1) add r3.yzw, r3.yyzw, v[r2.w + 0][0].xxyz mad r3.yzw, v[r0.x + 0][0].xxyz, l(0.000000, 2.000000, 2.000000, 2.000000), r3.yyzw div r2.xyz, r3.yzwy, r3.xxxx break case l(13) ishl r0.x, r1.w, l(1) iadd r0.x, r0.x, l(10) utof r0.x, r0.x mad r3.xyz, v[0][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), v[1][0].xyzx mad r3.xyz, v[2][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r3.xyzx add r4.xyz, v[3][0].xyzx, v[3][0].xyzx utof r2.w, r1.w mad r3.xyz, r4.xyzx, r2.wwww, r3.xyzx mad r3.xyz, v[r0.z + 0][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r3.xyzx iadd r2.w, r0.z, l(-1) add r3.xyz, r3.xyzx, v[r2.w + 0][0].xyzx div r2.xyz, r3.xyzx, r0.xxxx break case l(14) ishl r0.x, r1.z, l(1) iadd r2.w, r0.x, l(10) utof r2.w, r2.w mad r3.xyz, v[1][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), v[0][0].xyzx utof r0.x, r0.x mad r3.xyz, r0.xxxx, v[2][0].xyzx, r3.xyzx mad r3.xyz, v[3][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r3.xyzx add r3.xyz, r3.xyzx, v[r0.z + 0][0].xyzx iadd r0.x, r0.z, l(-1) mad r3.xyz, v[r0.x + 0][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r3.xyzx div r2.xyz, r3.xyzx, r2.wwww break case l(4) ishl r0.x, r1.x, l(1) iadd r0.z, r0.x, l(10) utof r0.xz, r0.xxzx add r3.xyz, v[1][0].xyzx, v[1][0].xyzx mad r3.xyz, r0.xxxx, v[0][0].xyzx, r3.xyzx add r3.xyz, r3.xyzx, v[2][0].xyzx mad r3.xyz, v[3][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), r3.xyzx mad r3.xyz, v[4][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r3.xyzx iadd r0.x, r0.w, l(-1) add r3.xyz, r3.xyzx, v[r0.x + 0][0].xyzx div r2.xyz, r3.xyzx, r0.zzzz break case l(8) ishl r0.x, r1.w, l(1) iadd r0.x, r0.x, l(10) utof r0.x, r0.x mad r3.xyz, v[0][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), v[1][0].xyzx mad r3.xyz, v[2][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r3.xyzx add r4.xyz, v[3][0].xyzx, v[3][0].xyzx utof r0.z, r1.w mad r3.xyz, r4.xyzx, r0.zzzz, r3.xyzx add r3.xyz, r3.xyzx, v[4][0].xyzx iadd r0.z, r0.w, l(-1) mad r3.xyz, v[r0.z + 0][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r3.xyzx div r2.xyz, r3.xyzx, r0.xxxx break case l(7) ishl r0.x, r1.y, l(1) iadd r0.z, r0.x, l(10) add r1.xyw, v[0][0].xyxz, v[0][0].xyxz utof r0.xz, r0.xxzx mad r1.xyw, r0.xxxx, v[1][0].xyxz, r1.xyxw mad r1.xyw, v[2][0].xyxz, l(4.000000, 4.000000, 0.000000, 4.000000), r1.xyxw add r1.xyw, r1.xyxw, v[3][0].xyxz iadd r0.x, r0.y, l(-1) mad r1.xyw, v[r0.x + 0][0].xyxz, l(2.000000, 2.000000, 0.000000, 2.000000), r1.xyxw add r1.xyw, r1.xyxw, v[r0.y + 0][0].xyxz div r2.xyz, r1.xywx, r0.zzzz break case l(11) ishl r0.x, r1.z, l(1) iadd r0.z, r0.x, l(10) mad r1.xyz, v[1][0].xyzx, l(4.000000, 4.000000, 4.000000, 0.000000), v[0][0].xyzx utof r0.xz, r0.xxzx mad r1.xyz, r0.xxxx, v[2][0].xyzx, r1.xyzx mad r1.xyz, v[3][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r1.xyzx iadd r0.x, r0.y, l(-1) add r1.xyz, r1.xyzx, v[r0.x + 0][0].xyzx mad r0.xyw, v[r0.y + 0][0].xyxz, l(2.000000, 2.000000, 0.000000, 2.000000), r1.xyxz div r2.xyz, r0.xywx, r0.zzzz break default mov r2.xyz, l(0,0,0,0) break endswitch mov o0.xyz, r2.xyzx ret hs_fork_phase dcl_hs_fork_phase_instance_count 4 dcl_input vForkInstanceID dcl_output_siv o0.x, finalQuadUeq0EdgeTessFactor dcl_output_siv o1.x, finalQuadVeq0EdgeTessFactor dcl_output_siv o2.x, finalQuadUeq1EdgeTessFactor dcl_output_siv o3.x, finalQuadVeq1EdgeTessFactor dcl_temps 1 dcl_indexrange o0.x 4 mov r0.x, vForkInstanceID.x mov o[r0.x + 0].x, cb2[4].w ret hs_fork_phase dcl_hs_fork_phase_instance_count 2 dcl_input vForkInstanceID dcl_output_siv o4.x, finalQuadUInsideTessFactor dcl_output_siv o5.x, finalQuadVInsideTessFactor dcl_temps 1 dcl_indexrange o4.x 2 mov r0.x, vForkInstanceID.x mov o[r0.x + 4].x, cb2[4].w ret hs_fork_phase dcl_hs_fork_phase_instance_count 8 dcl_input vForkInstanceID dcl_input vicp[32][0].x dcl_input vicp[32][1].x dcl_input vicp[32][2].x dcl_output o6.x dcl_output o7.x dcl_output o8.x dcl_output o9.x dcl_output o10.x dcl_output o11.x dcl_output o12.x dcl_output o13.x dcl_temps 1 dcl_indexrange o6.x 8 dcl_indexrange vicp[32][0].x 3 ult r0.x, vForkInstanceID.x, l(4) and r0.x, r0.x, l(1) and r0.y, vForkInstanceID.x, l(3) mov r0.z, vForkInstanceID.x mov o[r0.z + 6].x, vicp[r0.y + 0][r0.x + 1].x ret hs_fork_phase dcl_hs_fork_phase_instance_count 8 dcl_input vForkInstanceID dcl_input vicp[32][0].y dcl_input vicp[32][1].y dcl_input vicp[32][2].y dcl_output o6.y dcl_output o7.y dcl_output o8.y dcl_output o9.y dcl_output o10.y dcl_output o11.y dcl_output o12.y dcl_output o13.y dcl_temps 1 dcl_indexrange o6.y 8 dcl_indexrange vicp[32][0].y 3 ult r0.x, vForkInstanceID.x, l(4) and r0.x, r0.x, l(1) and r0.y, vForkInstanceID.x, l(3) mov r0.z, vForkInstanceID.x mov o[r0.z + 6].y, vicp[r0.y + 0][r0.x + 1].y ret hs_fork_phase dcl_hs_fork_phase_instance_count 4 dcl_input vForkInstanceID dcl_input vicp[32][2].z dcl_output o6.z dcl_output o7.z dcl_output o8.z dcl_output o9.z dcl_temps 1 dcl_indexrange o6.z 4 mov r0.x, vForkInstanceID.x mov o[r0.x + 6].z, vicp[r0.x + 0][2].z ret hs_fork_phase dcl_input vPrim dcl_input vicp[32][0].xyz dcl_output o14.xyz dcl_output o15.xyz dcl_output o16.xyz dcl_output o17.xyz dcl_output o18.xyz dcl_output o19.xyz dcl_output o20.xyz dcl_output o21.xyz dcl_temps 14 iadd r0.x, vPrim, cb3[0].x ishl r0.y, r0.x, l(1) ld_indexable(buffer)(uint,uint,uint,uint) r1.xyzw, r0.yyyy, t0.xyzw bfi r0.x, l(31), l(1), r0.x, l(1) ld_indexable(buffer)(uint,uint,uint,uint) r0.xyzw, r0.xxxx, t0.xyzw ishl r2.xyzw, r1.xyzw, l(6, 6, 6, 6) bfi r3.xyzw, l(26, 26, 26, 26), l(6, 6, 6, 6), r1.xyzw, l(4, 2, 4, 2) mul r4.xyz, cb0[r3.x + 0].xxxx, vicp[4][0].xyzx iadd r5.xyzw, r1.xxyy, l(1, -1, 2, 1) udiv null, r6.xyzw, r5.xyzw, r1.xxyy ishl r7.xyz, r6.xyzx, l(1, 1, 1, 0) iadd r7.xyz, r2.xxyx, r7.xyzx mul r8.xyz, cb0[r7.x + 0].xxxx, vicp[4][0].xyzx iadd r9.xyzw, r0.xwyz, l(-1, -1, -1, -1) mov r10.xyz, r4.xyzx mov r11.xyz, r8.xyzx mov r0.w, l(4) mov r3.x, l(2) loop uge r4.w, r0.w, r9.x breakc_nz r4.w bfi r4.w, l(31), l(1), r3.x, l(1) iadd r4.w, r2.x, r4.w mad r12.xyz, vicp[r0.w + 1][0].xyzx, cb0[r4.w + 0].xxxx, r10.xyzx iadd r4.w, r5.y, r3.x udiv null, r4.w, r4.w, r1.x bfi r4.w, l(31), l(1), r4.w, l(1) iadd r4.w, r2.x, r4.w mad r13.xyz, vicp[r0.w + 1][0].xyzx, cb0[r4.w + 0].xxxx, r11.xyzx iadd r3.x, r3.x, l(1) iadd r4.w, r0.w, l(2) udiv null, r5.x, r3.x, r1.x ishl r5.x, r5.x, l(1) iadd r5.x, r2.x, r5.x mad r10.xyz, vicp[r0.w + 2][0].xyzx, cb0[r5.x + 0].xxxx, r12.xyzx iadd r5.x, r5.y, r3.x udiv null, r5.x, r5.x, r1.x ishl r5.x, r5.x, l(1) iadd r5.x, r2.x, r5.x mad r11.xyz, vicp[r0.w + 2][0].xyzx, cb0[r5.x + 0].xxxx, r13.xyzx mov r0.w, r4.w endloop udiv null, r4.x, r3.x, r1.x bfi r4.x, l(31), l(1), r4.x, l(1) iadd r4.x, r2.x, r4.x mad r4.xyz, vicp[r0.w + 1][0].xyzx, cb0[r4.x + 0].xxxx, r10.xyzx iadd r3.x, r5.y, r3.x udiv null, r3.x, r3.x, r1.x bfi r3.x, l(31), l(1), r3.x, l(1) iadd r3.x, r2.x, r3.x mad r8.xyz, vicp[r0.w + 1][0].xyzx, cb0[r3.x + 0].xxxx, r11.xyzx udiv null, r10.xyzw, l(1, 0, 0, 1), r1.xxyz bfi r11.xyzw, l(31, 31, 31, 31), l(1, 1, 1, 1), r10.xyzw, l(1, 1, 1, 1) iadd r11.xyzw, r2.xxyz, r11.xyzw mad r4.xyz, vicp[r9.y + 0][0].xyzx, cb0[r11.x + 0].xxxx, r4.xyzx udiv null, r12.xyzw, r1.xyzw, r1.xyzw bfi r5.xz, l(31, 0, 31, 0), l(1, 0, 1, 0), r12.xxzx, l(1, 0, 1, 0) iadd r5.xz, r2.xxzx, r5.xxzx mad r8.xyz, vicp[r9.y + 0][0].xyzx, cb0[r5.x + 0].xxxx, r8.xyzx ishl r0.w, r10.y, l(1) iadd r0.w, r0.w, r2.x mad r4.xyz, vicp[1][0].xyzx, cb0[r0.w + 0].xxxx, r4.xyzx mad r7.xyw, vicp[1][0].xyxz, cb0[r7.y + 0].xxxx, r8.xyxz mad r4.xyz, vicp[2][0].xyzx, cb0[r11.y + 0].xxxx, r4.xyzx bfi r6.xy, l(31, 31, 0, 0), l(1, 1, 0, 0), r6.ywyy, l(1, 1, 0, 0) iadd r6.xy, r2.xyxx, r6.xyxx mad r6.xzw, vicp[2][0].xxyz, cb0[r6.x + 0].xxxx, r7.xxyw udiv null, r7.xy, r10.xwxx, r1.xzxx ishl r7.xy, r7.xyxx, l(1, 1, 0, 0) iadd r7.xy, r2.xzxx, r7.xyxx mad o14.xyz, vicp[3][0].xyzx, cb0[r7.x + 0].xxxx, r4.xyzx iadd r0.w, r5.y, r10.x udiv null, r0.w, r0.w, r1.x ishl r0.w, r0.w, l(1) iadd r0.w, r0.w, r2.x mad o18.xyz, vicp[3][0].xyzx, cb0[r0.w + 0].xxxx, r6.xzwx mul r4.xyz, cb0[r3.y + 0].xxxx, vicp[r0.x + 0][0].xyzx mul r6.xzw, cb0[r7.z + 0].xxxx, vicp[r0.x + 0][0].xxyz mov r7.xzw, r4.xxyz mov r8.xyz, r6.xzwx mov r0.w, r0.x mov r1.x, l(1) loop uge r2.x, r0.w, r9.z breakc_nz r2.x bfi r2.x, l(31), l(1), r1.x, l(1) iadd r2.x, r2.x, r2.y mad r10.xyz, vicp[r0.w + 1][0].xyzx, cb0[r2.x + 0].xxxx, r7.xzwx iadd r2.x, r5.w, r1.x udiv null, r2.x, r2.x, r1.y bfi r2.x, l(31), l(1), r2.x, l(1) iadd r2.x, r2.x, r2.y mad r13.xyz, vicp[r0.w + 1][0].xyzx, cb0[r2.x + 0].xxxx, r8.xyzx iadd r1.x, r1.x, l(1) iadd r2.x, r0.w, l(2) udiv null, r3.x, r1.x, r1.y ishl r3.x, r3.x, l(1) iadd r3.x, r2.y, r3.x mad r7.xzw, vicp[r0.w + 2][0].xxyz, cb0[r3.x + 0].xxxx, r10.xxyz iadd r3.x, r5.w, r1.x udiv null, r3.x, r3.x, r1.y ishl r3.x, r3.x, l(1) iadd r3.x, r2.y, r3.x mad r8.xyz, vicp[r0.w + 2][0].xyzx, cb0[r3.x + 0].xxxx, r13.xyzx mov r0.w, r2.x endloop udiv null, r0.x, r1.x, r1.y bfi r0.x, l(31), l(1), r0.x, l(1) iadd r0.x, r0.x, r2.y mad r4.xyz, vicp[r0.w + 1][0].xyzx, cb0[r0.x + 0].xxxx, r7.xzwx iadd r0.x, r5.w, r1.x udiv null, r0.x, r0.x, r1.y bfi r0.x, l(31), l(1), r0.x, l(1) iadd r0.x, r0.x, r2.y mad r6.xzw, vicp[r0.w + 1][0].xxyz, cb0[r0.x + 0].xxxx, r8.xxyz mad r4.xyz, vicp[r9.x + 0][0].xyzx, cb0[r11.z + 0].xxxx, r4.xyzx mad r6.xyz, vicp[r9.x + 0][0].xyzx, cb0[r6.y + 0].xxxx, r6.xzwx iadd r8.xyzw, r1.yzzw, l(-1, 1, -1, 1) udiv null, r13.xyzw, r8.xyzw, r1.yzzw ishl r7.xzw, r13.xxyz, l(1, 0, 1, 1) iadd r7.xzw, r2.yyzz, r7.xxzw mad r4.xyz, vicp[2][0].xyzx, cb0[r7.x + 0].xxxx, r4.xyzx iadd r0.x, r5.w, r8.x udiv null, r0.x, r0.x, r1.y ishl r0.w, r0.x, l(1) iadd r0.w, r0.w, r2.y mad r6.xyz, vicp[2][0].xyzx, cb0[r0.w + 0].xxxx, r6.xyzx bfi r10.xyz, l(31, 31, 31, 0), l(1, 1, 1, 0), r13.xzwx, l(1, 1, 1, 0) iadd r10.xyz, r2.yzwy, r10.xyzx mad r4.xyz, vicp[3][0].xyzx, cb0[r10.x + 0].xxxx, r4.xyzx bfi r0.x, l(31), l(1), r0.x, l(1) iadd r0.x, r0.x, r2.y mad r6.xyz, vicp[3][0].xyzx, cb0[r0.x + 0].xxxx, r6.xyzx udiv null, r0.xw, r12.yyyw, r1.yyyw ishl r0.xw, r0.xxxw, l(1, 0, 0, 1) iadd r0.xw, r0.xxxw, r2.yyyw mad r4.xyz, vicp[0][0].xyzx, cb0[r0.x + 0].xxxx, r4.xyzx iadd r0.x, r5.w, r12.y udiv null, r0.x, r0.x, r1.y ishl r0.x, r0.x, l(1) iadd r0.x, r0.x, r2.y mad o19.xyz, vicp[0][0].xyzx, cb0[r0.x + 0].xxxx, r6.xyzx mov o15.xyz, -r4.xyzx mul r3.xyz, cb0[r3.z + 0].xxxx, vicp[r0.y + 0][0].xyzx mul r4.xyz, cb0[r7.z + 0].xxxx, vicp[r0.y + 0][0].xyzx mov r5.xyw, r3.xyxz mov r6.xyz, r4.xyzx mov r0.x, r0.y mov r1.x, l(2) loop uge r1.y, r0.x, r9.w breakc_nz r1.y bfi r1.y, l(31), l(1), r1.x, l(1) iadd r1.y, r1.y, r2.z mad r11.xyz, vicp[r0.x + 1][0].xyzx, cb0[r1.y + 0].xxxx, r5.xywx iadd r1.y, r8.z, r1.x udiv null, r1.y, r1.y, r1.z bfi r1.y, l(31), l(1), r1.y, l(1) iadd r1.y, r1.y, r2.z mad r12.xyz, vicp[r0.x + 1][0].xyzx, cb0[r1.y + 0].xxxx, r6.xyzx iadd r1.x, r1.x, l(1) iadd r1.y, r0.x, l(2) udiv null, r2.x, r1.x, r1.z ishl r2.x, r2.x, l(1) iadd r2.x, r2.x, r2.z mad r5.xyw, vicp[r0.x + 2][0].xyxz, cb0[r2.x + 0].xxxx, r11.xyxz iadd r2.x, r8.z, r1.x udiv null, r2.x, r2.x, r1.z ishl r2.x, r2.x, l(1) iadd r2.x, r2.x, r2.z mad r6.xyz, vicp[r0.x + 2][0].xyzx, cb0[r2.x + 0].xxxx, r12.xyzx mov r0.x, r1.y endloop udiv null, r0.y, r1.x, r1.z bfi r0.y, l(31), l(1), r0.y, l(1) iadd r0.y, r0.y, r2.z mad r3.xyz, vicp[r0.x + 1][0].xyzx, cb0[r0.y + 0].xxxx, r5.xywx iadd r0.y, r8.z, r1.x udiv null, r0.y, r0.y, r1.z bfi r0.y, l(31), l(1), r0.y, l(1) iadd r0.y, r0.y, r2.z mad r4.xyz, vicp[r0.x + 1][0].xyzx, cb0[r0.y + 0].xxxx, r6.xyzx mad r3.xyz, vicp[r9.z + 0][0].xyzx, cb0[r11.w + 0].xxxx, r3.xyzx mad r4.xyz, vicp[r9.z + 0][0].xyzx, cb0[r5.z + 0].xxxx, r4.xyzx udiv null, r0.xy, l(0, 0, 0, 0), r1.zwzz ishl r1.x, r0.x, l(1) iadd r1.x, r1.x, r2.z mad r3.xyz, vicp[3][0].xyzx, cb0[r1.x + 0].xxxx, r3.xyzx mad r4.xyz, vicp[3][0].xyzx, cb0[r7.w + 0].xxxx, r4.xyzx bfi r0.xy, l(31, 31, 0, 0), l(1, 1, 0, 0), r0.xyxx, l(1, 1, 0, 0) iadd r0.xy, r0.xyxx, r2.zwzz mad r3.xyz, vicp[0][0].xyzx, cb0[r0.x + 0].xxxx, r3.xyzx mad r4.xyz, vicp[0][0].xyzx, cb0[r10.y + 0].xxxx, r4.xyzx mad r3.xyz, vicp[1][0].xyzx, cb0[r7.y + 0].xxxx, r3.xyzx iadd r0.x, r8.z, r10.w udiv null, r0.x, r0.x, r1.z ishl r0.x, r0.x, l(1) iadd r0.x, r0.x, r2.z mad r1.xyz, vicp[1][0].xyzx, cb0[r0.x + 0].xxxx, r4.xyzx mov o16.xyz, -r3.xyzx mov o20.xyz, -r1.xyzx mul r1.xyz, cb0[r3.w + 0].xxxx, vicp[r0.z + 0][0].xyzx iadd r2.xy, r1.wwww, l(2, -1, 0, 0) udiv null, r2.xz, r2.xxyx, r1.wwww ishl r3.xy, r2.xzxx, l(1, 1, 0, 0) iadd r3.xy, r2.wwww, r3.xyxx mul r3.xzw, cb0[r3.x + 0].xxxx, vicp[r0.z + 0][0].xxyz mov r4.xyz, r1.xyzx mov r5.xyz, r3.xzwx mov r0.x, r0.z mov r2.x, l(1) loop uge r4.w, r0.x, r9.y breakc_nz r4.w bfi r4.w, l(31), l(1), r2.x, l(1) iadd r4.w, r2.w, r4.w mad r6.xyz, vicp[r0.x + 1][0].xyzx, cb0[r4.w + 0].xxxx, r4.xyzx iadd r4.w, r8.w, r2.x udiv null, r4.w, r4.w, r1.w bfi r4.w, l(31), l(1), r4.w, l(1) iadd r4.w, r2.w, r4.w mad r7.xyz, vicp[r0.x + 1][0].xyzx, cb0[r4.w + 0].xxxx, r5.xyzx iadd r2.x, r2.x, l(1) iadd r4.w, r0.x, l(2) udiv null, r5.w, r2.x, r1.w ishl r5.w, r5.w, l(1) iadd r5.w, r2.w, r5.w mad r4.xyz, vicp[r0.x + 2][0].xyzx, cb0[r5.w + 0].xxxx, r6.xyzx iadd r5.w, r8.w, r2.x udiv null, r5.w, r5.w, r1.w ishl r5.w, r5.w, l(1) iadd r5.w, r2.w, r5.w mad r5.xyz, vicp[r0.x + 2][0].xyzx, cb0[r5.w + 0].xxxx, r7.xyzx mov r0.x, r4.w endloop udiv null, r0.x, r2.x, r1.w bfi r0.x, l(31), l(1), r0.x, l(1) iadd r0.x, r0.x, r2.w mad r1.xyz, vicp[4][0].xyzx, cb0[r0.x + 0].xxxx, r4.xyzx iadd r0.x, r8.w, r2.x udiv null, r0.x, r0.x, r1.w bfi r0.x, l(31), l(1), r0.x, l(1) iadd r0.x, r0.x, r2.w mad r3.xzw, vicp[4][0].xxyz, cb0[r0.x + 0].xxxx, r5.xxyz mad r0.xyz, vicp[r9.w + 0][0].xyzx, cb0[r0.y + 0].xxxx, r1.xyzx mad r1.xyz, vicp[r9.w + 0][0].xyzx, cb0[r10.z + 0].xxxx, r3.xzwx mad r0.xyz, vicp[0][0].xyzx, cb0[r3.y + 0].xxxx, r0.xyzx iadd r2.x, r8.w, r2.y udiv null, r2.x, r2.x, r1.w ishl r2.y, r2.x, l(1) iadd r2.y, r2.y, r2.w mad r1.xyz, vicp[0][0].xyzx, cb0[r2.y + 0].xxxx, r1.xyzx bfi r2.xy, l(31, 31, 0, 0), l(1, 1, 0, 0), r2.xzxx, l(1, 1, 0, 0) iadd r2.xy, r2.xyxx, r2.wwww mad r0.xyz, vicp[1][0].xyzx, cb0[r2.y + 0].xxxx, r0.xyzx mad r1.xyz, vicp[1][0].xyzx, cb0[r2.x + 0].xxxx, r1.xyzx mad o17.xyz, vicp[2][0].xyzx, cb0[r0.w + 0].xxxx, r0.xyzx iadd r0.x, r8.w, r12.w udiv null, r0.x, r0.x, r1.w ishl r0.x, r0.x, l(1) iadd r0.x, r0.x, r2.w mad r0.xyz, vicp[2][0].xyzx, cb0[r0.x + 0].xxxx, r1.xyzx mov o21.xyz, -r0.xyzx ret hs_fork_phase dcl_input vPrim dcl_output o22.x dcl_temps 1 iadd r0.x, vPrim, cb3[0].x ishl r0.x, r0.x, l(1) ld_indexable(buffer)(uint,uint,uint,uint) r0.x, r0.xxxx, t0.xyzw iadd r0.x, r0.x, l(-3) mov o22.x, cb0[r0.x + 1024].x ret hs_fork_phase dcl_input vPrim dcl_output o22.y dcl_temps 1 iadd r0.x, vPrim, cb3[0].x ishl r0.x, r0.x, l(1) ld_indexable(buffer)(uint,uint,uint,uint) r0.x, r0.xxxx, t0.yxzw iadd r0.x, r0.x, l(-3) mov o22.y, cb0[r0.x + 1024].x ret hs_fork_phase dcl_input vPrim dcl_output o22.z dcl_temps 1 iadd r0.x, vPrim, cb3[0].x ishl r0.x, r0.x, l(1) ld_indexable(buffer)(uint,uint,uint,uint) r0.x, r0.xxxx, t0.zxyw iadd r0.x, r0.x, l(-3) mov o22.z, cb0[r0.x + 1024].x ret hs_fork_phase dcl_input vPrim dcl_output o22.w dcl_temps 1 iadd r0.x, vPrim, cb3[0].x ishl r0.x, r0.x, l(1) ld_indexable(buffer)(uint,uint,uint,uint) r0.x, r0.xxxx, t0.wxyz iadd r0.x, r0.x, l(-3) mov o22.w, cb0[r0.x + 1024].x ret // Approximately 570 instruction slots used
src/counters/counters_spec.ads
jhumphry/auto_counters
5
11509
<filename>src/counters/counters_spec.ads -- counters_spec.ads -- Counters specification for use with smart_ptrs -- Copyright (c) 2016, <NAME> -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provided that the above -- copyright notice and this permission notice appear in all copies. -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -- PERFORMANCE OF THIS SOFTWARE. pragma Profile (No_Implementation_Extensions); generic type Counter(<>) is limited private; type Counter_Ptr is access Counter; with function Make_New_Counter return Counter_Ptr is <>; -- Make a new counter that points to the Element with procedure Deallocate_If_Unused (C : in out Counter_Ptr) is <>; -- Deallocate the Counter object if the Use_Count and Weak_Ptr_Count are -- both zero with function Use_Count (C : in Counter) return Natural is <>; -- Return the number of Smart_Ptr / Smart_Ref using the counter with procedure Check_Increment_Use_Count (C : in out Counter) is <>; -- Increment the Use_Count if the current use count is greater than zero, -- otherwise do nothing. These sematics help the Weak_Ptr.Lock code ensure -- that the target object does not get deallocated between the Weak_Ptr -- routine checking that it still exists (Use_Count > 0) and creating a -- new Smart_Ptr to it. with procedure Decrement_Use_Count (C : in out Counter) is <>; -- Decrement the Use_Count of the counter with function Weak_Ptr_Count (C : in Counter) return Natural is <>; -- Return the number of Weak_Ptr using the counter with procedure Increment_Weak_Ptr_Count (C : in out Counter) is <>; -- Increment the Weak_Ptr_Count of the counter, unconditionally. with procedure Decrement_Weak_Ptr_Count (C : in out Counter) is <>; -- Decrement the Weak_Ptr_Count of the counter package Counters_Spec is end Counters_Spec;
Task/Identity-matrix/AppleScript/identity-matrix.applescript
LaudateCorpus1/RosettaCodeData
1
871
<reponame>LaudateCorpus1/RosettaCodeData<filename>Task/Identity-matrix/AppleScript/identity-matrix.applescript<gh_stars>1-10 -- ID MATRIX ----------------------------------------------------------------- -- idMatrix :: Int -> [(0|1)] on idMatrix(n) set xs to enumFromTo(1, n) script row on |λ|(x) script on |λ|(i) if i = x then 1 else 0 end if end |λ| end script map(result, xs) end |λ| end script map(row, xs) end idMatrix -- TEST ---------------------------------------------------------------------- on run idMatrix(5) end run -- GENERIC FUNCTIONS --------------------------------------------------------- -- enumFromTo :: Int -> Int -> [Int] on enumFromTo(m, n) if n < m then set d to -1 else set d to 1 end if set lst to {} repeat with i from m to n by d set end of lst to i end repeat return lst end enumFromTo -- map :: (a -> b) -> [a] -> [b] on map(f, xs) tell mReturn(f) set lng to length of xs set lst to {} repeat with i from 1 to lng set end of lst to |λ|(item i of xs, i, xs) end repeat return lst end tell end map -- Lift 2nd class handler function into 1st class script wrapper -- mReturn :: Handler -> Script on mReturn(f) if class of f is script then f else script property |λ| : f end script end if end mReturn
Formula/src/main/antlr/FormulaScript.g4
kighie/formula
0
1943
/* * Copyright (c) 2012 <NAME> <EMAIL> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ grammar FormulaScript; options { language = Java; superClass = kr.simula.formula.core.antlr.FormulaHandlerParser; } import Formula; /* */ // use command line option : -package kr.simula.formula.antlr @parser::header { import kr.simula.formula.script.*; import kr.simula.formula.script.statement.*; import kr.simula.formula.util.*; } @parser::members { } @lexer::header { } /* ************************************* * Formula Script *************************************** */ formulaScript returns [Module module] : { $module = (Module)block(ScriptTokens.MODULE); } (importStatement )* (paramDef { $module.append($paramDef.result); })* blockContents[$module] EOF { endScope();} ; /* ************************************* * import *************************************** */ importStatement : 'importJava' qualifiedName END_OF_STMT { importJava($qualifiedName.result); } ; paramDef returns [Statement result] : 'paramdef' IDENT 'as' type END_OF_STMT { $result = statement(PARAM_DECL_STMT, declare(PARAM_DECL, $type.typeClz ,$IDENT.text) ); } ; /* ************************************* * declare variable *************************************** */ variableDecl returns [VariableDeclStatement stmt] : type IDENT { Ref varRef = declare(ScriptTokens.VAR_DECL, $type.typeClz ,$IDENT.text); $stmt = (VariableDeclStatement)statement(ScriptTokens.VAR_DECL, varRef); } ( '<-' formulaExpressionBase { $stmt.setValueNode($formulaExpressionBase.result); })? END_OF_STMT ; /* mapDecl returns [VariableDeclStatement stmt] : 'map' IDENT { Ref varRef = declare(VAR_DECL, java.util.Map.class ,$IDENT.text); $stmt = (VariableDeclStatement)statement(ScriptTokens.VAR_DECL, varRef); } ( map { $stmt.setValueNode($map.result); } ) END_OF_STMT ; */ /* ************************************* * declare function *************************************** */ functionDecl returns [BlockStatement fnBlock] : { List<Ref> args = new LinkedList<Ref>(); beginScope(); Class<?> typeClz = Object.class; } 'fndef' IDENT ( ( '(' ')' ) | ( '(' argsDecl[args] ')' ) ) ( (':' type { typeClz = $type.typeClz; } '{' ) | ( '{' ) ) { $fnBlock = declareFn(typeClz ,$IDENT.text, args); } (blockContents[$fnBlock]) (retrunStmt[$fnBlock])? '}' { endScope(); } ; argsDecl [List<Ref> args] : ( type IDENT { $args.add( declare(ScriptTokens.ARG_DECL, $type.typeClz ,$IDENT.text)); } ( ',' type IDENT { $args.add( declare(ScriptTokens.ARG_DECL, $type.typeClz ,$IDENT.text)); } )* ) ; retrunStmt [BlockStatement fnBlock] : { Node arg = null; } 'return' ( formulaExpressionBase { arg = $formulaExpressionBase.result; } )? { $fnBlock.append( statement( ScriptTokens.RETURN, fnBlock, arg ) ); } ';' ; /* typeDecl : 'typedef' typeName = IDENT '{' ( type fieldName = IDENT ( ':' ( ( formulaTerm { } ) | ( lambdaDecl ) ) )? ) (',' type IDENT ( ':' ( ( formulaTerm ) | ( lambdaDecl ) ) )? )* '}' END_OF_STMT? ; */ //{ settable = refer( $IDENT.text);} // { $stmt = statement(ScriptTokens.ASSIGN_STMT, settable, $formulaTerm.result); } //$formulaTerm.result; blockContents [Block stmtHolder] : ( ifStatement { $stmtHolder.append($ifStatement.ifstmt); } | foreachStatement { $stmtHolder.append($foreachStatement.foreachStmt); } | assignStatement { $stmtHolder.append($assignStatement.stmt); } | methodCallStatement { $stmtHolder.append($methodCallStatement.stmt); } | functionCallStatement { $stmtHolder.append($functionCallStatement.stmt); } | variableDecl { $stmtHolder.append($variableDecl.stmt); } | functionDecl { $stmtHolder.append($functionDecl.fnBlock); } )* ; /* ************************************* * statements *************************************** */ ifStatement returns [IfStatement ifstmt] : 'if' { beginScope(); } '(' logicalExpression ')' { $ifstmt = (IfStatement)statementBlock(ScriptTokens.IF, $logicalExpression.result); } '{' blockContents[$ifstmt] '}' ( 'elseif' '(' logicalExpression ')' { IfStatement.ElseIf elseIfStmt = $ifstmt.createElseIf($logicalExpression.result); } '{' blockContents[elseIfStmt] '}' )* ( 'else' { IfStatement.Else elseStmt = $ifstmt.checkOutElse(); } '{' blockContents[elseStmt] '}' )? { endScope(); } ; foreachStatement returns [BlockStatement foreachStmt] : 'foreach' { beginScope(); } '(' loopCondition ')' { $foreachStmt = statementBlock(ScriptTokens.FOREACH, $loopCondition.condition); } '{' blockContents[$foreachStmt] '}' ';'? { endScope(); } ; loopCondition returns [LoopConditionStatement condition] : type IDENT { Ref varRef = declare(ScriptTokens.VAR_DECL, $type.typeClz ,$IDENT.text); $condition = (LoopConditionStatement)statement(ScriptTokens.LOOP_COND_DECL, varRef); } 'in' ( iterableTerm { $condition.setIteratorRef($iterableTerm.result); } ) ; methodCallStatement returns [Statement stmt] : methodCallExp { $stmt = statement(ScriptTokens.MTHODE_CALL_STMT, $methodCallExp.result); } END_OF_STMT ; functionCallStatement returns [Statement stmt] : funcCallExp { $stmt = statement(ScriptTokens.FUNCTION_CALL_STMT, $funcCallExp.result); } END_OF_STMT ; /* * Override arguments */ arguments returns [List<Node> nodeList] : { $nodeList = new LinkedList<Node>(); } ( (arg2 = operatorExpression { $nodeList.add($arg2.result); }) ) (',' (arg2 = operatorExpression { $nodeList.add($arg2.result); }) )* ; /* * Override formulaTerm */ formulaTerm returns [Node result] : literalTerm { $result = $literalTerm.result; } | qualifiedName { $result = $qualifiedName.result; } | funcCallExp { $result = $funcCallExp.result; } | methodCallExp { $result = $methodCallExp.result; } | arrayRef { $result = $arrayRef.result; } | array { $result = $array.result; } | map { $result = $map.result; } | recordProto { $result = $recordProto.result; } | protoExtention { $result = $protoExtention.result; } | lambdaDecl { $result = $lambdaDecl.lambda; } ; /* Lambda Argument */ lambdaDecl returns [Lambda lambda] : { List<Ref> args = new LinkedList<Ref>(); beginScope(); Class<?> typeClz = Object.class; } 'fndef' ( ( '(' ')' ) | ( '(' argsDecl[args] ')' ) ) ( (':' type { typeClz = $type.typeClz; } '{' ) | ( '{' ) ) { $lambda = lambda( LAMBDA , args, typeClz); } (blockContents[$lambda]) (retrunStmt[$lambda])? '}' { endScope(); } ; recordProto returns [Gettable result] : (('R{') | ('r{')) { List<?> fieldList = new LinkedList(); beginScope(); } recordField[fieldList] (',' recordField[fieldList] )* { endScope(); $result = declareProto(RECORD, fieldList); } '}' ; recordField [List<?> fieldList] : ( type IDENT { protoField(RECORD, fieldList, $type.typeClz, $IDENT.text, null ); } ) | ( type IDENT ':' recordFieldValue { protoField(RECORD, fieldList, $type.typeClz, $IDENT.text, $recordFieldValue.result ); } ) ; recordFieldValue returns [Node result] : literalTerm { $result = $literalTerm.result; } | array { $result = $array.result; } | map { $result = $map.result; } | recordProto { $result = $recordProto.result; } | lambdaDecl { $result = $lambdaDecl.lambda; } ; protoExtention returns [Gettable result] : '#proto - to be implemented' ; type returns [Class<?> typeClz] : (IDENT { $typeClz = type($IDENT.text); }) | (qualifiedName { $typeClz = type($qualifiedName.text); }) ('[' ']' { $typeClz = arrayType($typeClz); })? ; /* ************************************* * assign *************************************** */ assignStatement returns [Statement stmt] : ( leftAssign { $stmt = $leftAssign.stmt ; } | rightAssign { $stmt = $rightAssign.stmt ; } ) ; leftAssign returns [Statement stmt] : { Ref settable = null; } ( IDENT { settable = refer( $IDENT.text);} | qualifiedName { settable = $qualifiedName.result;} | arrayRef { settable = $arrayRef.result;} ) '<-' formulaExpressionBase END_OF_STMT { $stmt = statement(ScriptTokens.ASSIGN_STMT, settable, $formulaExpressionBase.result); } ; rightAssign returns [Statement stmt] : { Ref settable = null; } formulaExpressionBase '->' ( IDENT { settable = refer( $IDENT.text);} | qualifiedName { settable = $qualifiedName.result;} | arrayRef { settable = $arrayRef.result;} ) END_OF_STMT { $stmt = statement(ScriptTokens.ASSIGN_STMT, settable, $formulaExpressionBase.result); } ; /* ********************************************* Lexer rules ********************************************* */ END_OF_STMT : ';' ;
data/mapHeaders/rockethideout3.asm
adhi-thirumala/EvoYellow
16
2991
RocketHideout3_h: db FACILITY ; tileset db ROCKET_HIDEOUT_3_HEIGHT, ROCKET_HIDEOUT_3_WIDTH ; dimensions (y, x) dw RocketHideout3Blocks, RocketHideout3TextPointers, RocketHideout3Script ; blocks, texts, scripts db $00 ; connections dw RocketHideout3Object ; objects
programs/oeis/092/A092412.asm
karttu/loda
0
28358
<filename>programs/oeis/092/A092412.asm ; A092412: Fixed point of the morphism 0->11, 1->12, 2->13, 3->10, starting from a(1) = 1. ; 1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,1,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,2,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,1,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,3,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,1,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,2,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,1,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,1,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,2,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,1,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,3,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,1,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,2,1,2,1,3,1,2,1,0,1,2,1,3,1,2,1,1,1,2,1,3,1,2,1,0,1,2 cal $0,90739 ; Exponent of 2 in 9^n - 1. add $$1,2 lpb $0,1 mod $0,4 lpe mov $1,$0
experiments/test-suite/mutation-based/10/1/other.als
kaiyuanw/AlloyFLCore
1
1614
<reponame>kaiyuanw/AlloyFLCore pred test9 { some disj Person0, Person1: Person {some disj peds0: peds {some disj peds0, Group0: Group {some disj seclab0: seclab {some disj seclab0, Room0, Room1: Room { Person = Person0 + Person1 member_of = Person0->peds0 + Person1->peds0 + Person1->Group0 no alas peds = peds0 Group = peds0 + Group0 seclab = seclab0 Room = seclab0 + Room0 + Room1 located_in = seclab0->peds0 + Room1->peds0 }}}}} } run test9 for 3 expect 0 pred test6 { some disj Person0: Person {some disj alas0: alas {some disj peds0: peds {some disj alas0, peds0: Group {some disj seclab0: seclab {some disj seclab0, Room0: Room { Person = Person0 member_of = Person0->alas0 + Person0->peds0 alas = alas0 peds = peds0 Group = alas0 + peds0 seclab = seclab0 Room = seclab0 + Room0 located_in = seclab0->alas0 + seclab0->peds0 + Room0->alas0 + Room0->peds0 }}}}}} } run test6 for 3 expect 1
source/xml/templates/xml-sax-html5_writers.adb
svn2github/matreshka
24
18992
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- XML Processor -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the <NAME>, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with League.Characters.Latin; package body XML.SAX.HTML5_Writers is use type League.Characters.Universal_Character; use type League.Strings.Universal_String; HTML_URI : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("http://www.w3.org/1999/xhtml"); MathML_URI : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("http://www.w3.org/1998/Math/MathML"); SVG_URI : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("http://www.w3.org/2000/svg"); XLink_URI : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("http://www.w3.org/1999/xlink"); XML_URI : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("http://www.w3.org/XML/1998/namespace"); XMLNS_URI : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("http://www.w3.org/2000/xmlns/"); A_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("a"); Address_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("address"); Area_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("area"); Article_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("article"); Aside_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("aside"); Base_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("base"); Blockquote_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("blockquote"); Body_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("body"); Br_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("br"); Col_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("col"); Colgroup_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("colgroup"); Dd_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("dd"); Dir_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("dir"); Div_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("div"); Dl_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("dl"); Dt_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("dt"); Embed_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("embed"); Fieldset_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("fieldset"); Footer_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("footer"); Form_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("form"); H1_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("h1"); H2_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("h2"); H3_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("h3"); H4_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("h4"); H5_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("h5"); H6_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("h6"); Head_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("head"); Header_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("header"); Hgroup_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("hgroup"); Hr_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("hr"); HTML_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("html"); Img_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("img"); Input_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("input"); Keygen_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("keygen"); Li_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("li"); Link_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("link"); Main_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("main"); Meta_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("meta"); Nav_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("nav"); Ol_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("ol"); Optgroup_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("optgroup"); Option_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("option"); P_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("p"); Param_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("param"); Pre_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("pre"); Rp_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("rp"); Rt_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("rt"); Script_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("script"); Section_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("section"); Source_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("source"); Style_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("style"); Table_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("table"); Tbody_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("tbody"); Td_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("td"); Textarea_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("textarea"); Tfoot_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("tfoot"); Th_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("th"); Thead_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("thead"); Title_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("title"); Tr_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("tr"); Track_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("track"); Ul_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("ul"); Wbr_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("wbr"); Actuate_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("actuate"); Arcrole_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("arcrole"); Async_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("async"); Autofocus_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("autofocus"); Autoplay_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("autoplay"); Base_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("base"); Checked_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("checked"); Controls_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("controls"); Default_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("default"); Defer_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("defer"); Disabled_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("disabled"); Formnovalidate_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("formnovalidate"); Hidden_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("hidden"); Href_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("href"); Ismap_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("ismap"); Lang_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("lang"); Loop_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("loop"); Multiple_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("multiple"); Muted_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("muted"); Novalidate_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("novalidate"); Open_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("open"); Readonly_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("readonly"); Required_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("required"); Reversed_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("reversed"); Role_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("role"); Scoped_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("scoped"); Seamless_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("seamless"); Selected_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("selected"); Show_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("show"); Space_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("space"); Title_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("title"); Type_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("type"); Typemustmatch_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("typemustmatch"); XLink_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink"); XLink_Actuate_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:actuate"); XLink_Arcrole_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:arcrole"); XLink_Href_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:href"); XLink_Role_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:role"); XLink_Show_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:show"); XLink_Title_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:title"); XLink_Type_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:type"); XML_Base_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xml:base"); XML_Lang_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xml:lang"); XML_Space_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xml:space"); XMLNS_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xmlns"); XMLNS_XLink_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xmlns:xlink"); type Attribute_Value_Syntax is (Empty, Unquoted, Single_Quoted, Double_Quoted); function Is_Space (Item : League.Strings.Universal_String) return Boolean; -- Returns True when specified string contains only space characters as -- defined by HTML5 specification. -- -- [HTML5] "The space characters, for the purposes of this specification, -- are U+0020 SPACE, "tab" (U+0009), "LF" (U+000A), "FF" (U+000C), and "CR" -- (U+000D)." procedure Write_DOCTYPE (Self : in out HTML5_Writer'Class); -- Outputs DOCTYPE declaration. procedure Write_Attributes (Self : in out HTML5_Writer'Class; Attributes : XML.SAX.Attributes.SAX_Attributes; Success : in out Boolean); -- Output attributes. function Is_Boolean_Attribute (Name : League.Strings.Universal_String) return Boolean; -- Returns True when attribute is boolean attribute in HTML5. function Is_Void_Element (Tag : League.Strings.Universal_String) return Boolean; -- Returns True when specified tag refernce to void element of HTML5. function Is_Raw_Text_Element (Tag : League.Strings.Universal_String) return Boolean; -- Returns True when specified tag refernce to raw text element of HTML5. function Is_Escapable_Raw_Text_Element (Tag : League.Strings.Universal_String) return Boolean; -- Returns True when specified tag refernce to escapable raw text element -- of HTML5. procedure Escape_Attribute_Value (Value : League.Strings.Universal_String; Text : out League.Strings.Universal_String; Syntax : out Attribute_Value_Syntax); -- Detects optimal attribute value syntax and escape attribute value. ---------------- -- Characters -- ---------------- overriding procedure Characters (Self : in out HTML5_Writer; Text : League.Strings.Universal_String; Success : in out Boolean) is Escaped_Text : League.Strings.Universal_String; C : League.Characters.Universal_Character; begin case Self.Omit is when None => null; when Foreign => Self.Output.Put ('>'); when HTML_Start_Tag => -- [HTML5] "An html element's start tag may be omitted if the -- first thing inside the html element is not a comment." null; when HTML_End_Tag => -- [HTML5] "An html element's end tag may be omitted if the html -- element is not immediately followed by a comment." null; when Head_Start_Tag => -- [HTML5] "A head element's start tag may be omitted if the -- element is empty, or if the first thing inside the head element -- is an element." Self.Output.Put ("<head>"); when Head_End_Tag => -- [HTML5] "A head element's end tag may be omitted if the head -- element is not immediately followed by a space character or a -- comment." if not Text.Is_Empty and then Is_Space (Text.Slice (1, 1)) then Self.Output.Put ("</head>"); end if; when Body_Start_Tag => -- [HTML5] "A body element's start tag may be omitted if the -- element is empty, or if the first thing inside the body element -- is not a space character or a comment, except if the first -- thing inside the body element is a script or style element." if not Text.Is_Empty and then Is_Space (Text.Slice (1, 1)) then Self.Output.Put ("<body>"); end if; when Body_End_Tag => -- [HTML5] "A body element's end tag may be omitted if the body -- element is not immediately followed by a comment." null; when Li_End_Tag => -- [HTML5] "An li element's end tag may be omitted if the li -- element is immediately followed by another li element or if -- there is no more content in the parent element." Self.Output.Put ("</li>"); when Dt_End_Tag => -- [HTML5] "A dt element's end tag may be omitted if the dt -- element is immediately followed by another dt element or a dd -- element." Self.Output.Put ("</dt>"); when Dd_End_Tag => -- [HTML5] "A dd element's end tag may be omitted if the dd -- element is immediately followed by another dd element or a dt -- element, or if there is no more content in the parent element." Self.Output.Put ("</dd>"); when Rt_End_Tag => -- [HTML5] "An rt element's end tag may be omitted if the rt -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." Self.Output.Put ("</rt>"); when Rp_End_Tag => -- [HTML5] "An rp element's end tag may be omitted if the rp -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." Self.Output.Put ("</rp>"); when Optgroup_End_Tag => -- [HTML5] "An optgroup element's end tag may be omitted if the -- optgroup element is immediately followed by another optgroup -- element, or if there is no more content in the parent element." Self.Output.Put ("</optgroup>"); when Option_End_Tag => -- [HTML5] "An option element's end tag may be omitted if the -- option element is immediately followed by another option -- element, or if it is immediately followed by an optgroup -- element, or if there is no more content in the parent element." Self.Output.Put ("</option>"); when Colgroup_Start_Tag => -- [HTML5] "A colgroup element's start tag may be omitted if the -- first thing inside the colgroup element is a col element, and -- if the element is not immediately preceded by another colgroup -- element whose end tag has been omitted. (It can't be omitted if -- the element is empty.)" Self.Output.Put ("<colgroup>"); when Colgroup_End_Tag => -- [HTML5] "A colgroup element's end tag may be omitted if the -- colgroup element is not immediately followed by a space -- character or a comment." if not Text.Is_Empty and then Is_Space (Text.Slice (1, 1)) then Self.Output.Put ("</colgroup>"); else Self.History := Colgroup_End_Tag; end if; when Thead_End_Tag => -- [HTML5] "A thead element's end tag may be omitted if the thead -- element is immediately followed by a tbody or tfoot element." Self.Output.Put ("</thead>"); when Tbody_Start_Tag => -- [HTML5] "A tbody element's start tag may be omitted if the -- first thing inside the tbody element is a tr element, and if -- the element is not immediately preceded by a tbody, thead, or -- tfoot element whose end tag has been omitted. (It can't be -- omitted if the element is empty.)" Self.Output.Put ("<tbody>"); when Tbody_End_Tag => -- [HTML5] "A tbody element's end tag may be omitted if the tbody -- element is immediately followed by a tbody or tfoot element, or -- if there is no more content in the parent element." Self.Output.Put ("</tbody>"); when Tfoot_End_Tag => -- [HTML5] "A tfoot element's end tag may be omitted if the tfoot -- element is immediately followed by a tbody element, or if there -- is no more content in the parent element." Self.Output.Put ("</tfoot>"); when Tr_End_Tag => -- [HTML5] "A tr element's end tag may be omitted if the tr -- element is immediately followed by another tr element, or if -- there is no more content in the parent element." Self.Output.Put ("</tr>"); when Td_End_Tag => -- [HTML5] "A td element's end tag may be omitted if the td -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." Self.Output.Put ("</td>"); when Th_End_Tag => -- [HTML5] "A th element's end tag may be omitted if the th -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." Self.Output.Put ("</th>"); when P_End_Tag => -- [HTML5] "A p element's end tag may be omitted if the p element -- is immediately followed by an address, article, aside, -- blockquote, dir, div, dl, fieldset, footer, form, h1, h2, h3, -- h4, h5, h6, header, hgroup, hr, main, nav, ol, p, pre, section, -- table, or ul, element, or if there is no more content in the -- parent element and the parent element is not an a element." Self.Output.Put ("</p>"); end case; Self.Omit := None; Self.History := None; if not Self.Document_Start or else not Is_Space (Text) then case Self.State.Element_Kind is when Void => -- [HTML5] "Void elements can't have any contents (since -- there's no end tag, no content can be put between the start -- tag and the end tag)." Self.Diagnosis := League.Strings.To_Universal_String ("void element can't have any contents"); Success := False; return; when Raw_Text => -- XXX Verification of the text content can be done here. -- -- [HTML5] "The text in raw text and escapable raw text -- elements must not contain any occurrences of the string "</" -- (U+003C LESS-THAN SIGN, U+002F SOLIDUS) followed by -- characters that case-insensitively match the tag name of the -- element followed by one of "tab" (U+0009), "LF" (U+000A), -- "FF" (U+000C), "CR" (U+000D), U+0020 SPACE, ">" (U+003E), or -- "/" (U+002F)." Self.Output.Put (Text); when Escapable_Raw_Text => for J in 1 .. Text.Length loop C := Text (J); if C = League.Characters.Latin.Less_Than_Sign and then J < Text.Length and then Text (J + 1) = League.Characters.Latin.Solidus then -- XXX This check can be even more improved: -- -- [HTML5] "The text in raw text and escapable raw text -- elements must not contain any occurrences of the -- string "</" (U+003C LESS-THAN SIGN, U+002F SOLIDUS) -- followed by characters that case-insensitively match -- the tag name of the element followed by one of "tab" -- (U+0009), "LF" (U+000A), "FF" (U+000C), "CR" (U+000D), -- U+0020 SPACE, ">" (U+003E), or "/" (U+002F)." Escaped_Text.Append ("&lt;"); elsif C = League.Characters.Latin.Ampersand then Escaped_Text.Append ("&amp;"); else Escaped_Text.Append (C); end if; end loop; Self.Output.Put (Escaped_Text); when Normal | Foreign => if Self.State.Element_Kind = Foreign and Self.CDATA_Mode then Self.Output.Put (Text); else for J in 1 .. Text.Length loop C := Text (J); if C = League.Characters.Latin.Less_Than_Sign then Escaped_Text.Append ("&lt;"); elsif C = League.Characters.Latin.Ampersand then Escaped_Text.Append ("&amp;"); else Escaped_Text.Append (C); end if; end loop; Self.Output.Put (Escaped_Text); end if; end case; end if; end Characters; ------------- -- Comment -- ------------- overriding procedure Comment (Self : in out HTML5_Writer; Text : League.Strings.Universal_String; Success : in out Boolean) is pragma Unreferenced (Success); begin -- XXX Content of Text must be checked here to be conformant to HTML5 -- definition of comment. -- -- [HTML5] "Comments must start with the four character sequence U+003C -- LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, U+002D -- HYPHEN-MINUS (<!--). Following this sequence, the comment may have -- text, with the additional restriction that the text must not start -- with a single ">" (U+003E) character, nor start with a "-" (U+002D) -- character followed by a ">" (U+003E) character, nor contain two -- consecutive U+002D HYPHEN-MINUS characters (--), nor end with a "-" -- (U+002D) character. Finally, the comment must be ended by the three -- character sequence U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E -- GREATER-THAN SIGN (-->)." case Self.Omit is when None => null; when Foreign => Self.Output.Put ('>'); when HTML_Start_Tag => -- [HTML5] "An html element's start tag may be omitted if the -- first thing inside the html element is not a comment." Self.Output.Put ("<html>"); if Self.Stack.Is_Empty then -- [HTML5] "It is suggested that newlines be inserted after -- the DOCTYPE, after any comments that are before the root -- element, after the html element's start tag (if it is not -- omitted), and after any comments that are inside the html -- element but before the head element." Self.Output.Put (League.Characters.Latin.Line_Feed); end if; when HTML_End_Tag => -- [HTML5] "An html element's end tag may be omitted if the -- html element is not immediately followed by a comment." Self.Output.Put ("</html>"); when Head_Start_Tag => -- [HTML5] "A head element's start tag may be omitted if the -- element is empty, or if the first thing inside the head -- element is an element." Self.Output.Put ("<head>"); when Head_End_Tag => -- [HTML5] "A head element's end tag may be omitted if the head -- element is not immediately followed by a space character or a -- comment." Self.Output.Put ("</head>"); when Body_Start_Tag => -- [HTML5] "A body element's start tag may be omitted if the -- element is empty, or if the first thing inside the body element -- is not a space character or a comment, except if the first -- thing inside the body element is a script or style element." Self.Output.Put ("<body>"); when Body_End_Tag => -- [HTML5] "A body element's end tag may be omitted if the body -- element is not immediately followed by a comment." Self.Output.Put ("</body>"); when Li_End_Tag => -- [HTML5] "An li element's end tag may be omitted if the li -- element is immediately followed by another li element or if -- there is no more content in the parent element." Self.Output.Put ("</li>"); when Dt_End_Tag => -- [HTML5] "A dt element's end tag may be omitted if the dt -- element is immediately followed by another dt element or a dd -- element." Self.Output.Put ("</dt>"); when Dd_End_Tag => -- [HTML5] "A dd element's end tag may be omitted if the dd -- element is immediately followed by another dd element or a dt -- element, or if there is no more content in the parent element." Self.Output.Put ("</dd>"); when Rt_End_Tag => -- [HTML5] "An rt element's end tag may be omitted if the rt -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." Self.Output.Put ("</rt>"); when Rp_End_Tag => -- [HTML5] "An rp element's end tag may be omitted if the rp -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." Self.Output.Put ("</rp>"); when Optgroup_End_Tag => -- [HTML5] "An optgroup element's end tag may be omitted if the -- optgroup element is immediately followed by another optgroup -- element, or if there is no more content in the parent element." Self.Output.Put ("</optgroup>"); when Option_End_Tag => -- [HTML5] "An option element's end tag may be omitted if the -- option element is immediately followed by another option -- element, or if it is immediately followed by an optgroup -- element, or if there is no more content in the parent element." Self.Output.Put ("</option>"); when Colgroup_Start_Tag => -- [HTML5] "A colgroup element's start tag may be omitted if the -- first thing inside the colgroup element is a col element, and -- if the element is not immediately preceded by another colgroup -- element whose end tag has been omitted. (It can't be omitted if -- the element is empty.)" Self.Output.Put ("<colgroup>"); when Colgroup_End_Tag => -- [HTML5] "A colgroup element's end tag may be omitted if the -- colgroup element is not immediately followed by a space -- character or a comment." Self.Output.Put ("</colgroup>"); when Thead_End_Tag => -- [HTML5] "A thead element's end tag may be omitted if the thead -- element is immediately followed by a tbody or tfoot element." Self.Output.Put ("</thead>"); when Tbody_Start_Tag => -- [HTML5] "A tbody element's start tag may be omitted if the -- first thing inside the tbody element is a tr element, and if -- the element is not immediately preceded by a tbody, thead, or -- tfoot element whose end tag has been omitted. (It can't be -- omitted if the element is empty.)" Self.Output.Put ("<tbody>"); when Tbody_End_Tag => -- [HTML5] "A tbody element's end tag may be omitted if the tbody -- element is immediately followed by a tbody or tfoot element, or -- if there is no more content in the parent element." Self.Output.Put ("</tbody>"); when Tfoot_End_Tag => -- [HTML5] "A tfoot element's end tag may be omitted if the tfoot -- element is immediately followed by a tbody element, or if there -- is no more content in the parent element." Self.Output.Put ("</tfoot>"); when Tr_End_Tag => -- [HTML5] "A tr element's end tag may be omitted if the tr -- element is immediately followed by another tr element, or if -- there is no more content in the parent element." Self.Output.Put ("</tr>"); when Td_End_Tag => -- [HTML5] "A td element's end tag may be omitted if the td -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." Self.Output.Put ("</td>"); when Th_End_Tag => -- [HTML5] "A th element's end tag may be omitted if the th -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." Self.Output.Put ("</th>"); when P_End_Tag => -- [HTML5] "A p element's end tag may be omitted if the p element -- is immediately followed by an address, article, aside, -- blockquote, dir, div, dl, fieldset, footer, form, h1, h2, h3, -- h4, h5, h6, header, hgroup, hr, main, nav, ol, p, pre, section, -- table, or ul, element, or if there is no more content in the -- parent element and the parent element is not an a element." Self.Output.Put ("</p>"); end case; Self.Omit := None; Self.History := None; Self.Output.Put ("<!--"); Self.Output.Put (Text); Self.Output.Put ("-->"); if Self.Document_Start then -- [HTML5] "It is suggested that newlines be inserted after the -- DOCTYPE, after any comments that are before the root element, -- after the html element's start tag (if it is not omitted), and -- after any comments that are inside the html element but before the -- head element." Self.Output.Put (League.Characters.Latin.Line_Feed); end if; end Comment; --------------- -- End_CDATA -- --------------- overriding procedure End_CDATA (Self : in out HTML5_Writer; Success : in out Boolean) is pragma Unreferenced (Success); begin Self.CDATA_Mode := False; if Self.State.Element_Kind = Foreign then -- [HTML5] "CDATA sections can only be used in foreign content -- (MathML or SVG)." Self.Output.Put ("]]>"); end if; end End_CDATA; ----------------- -- End_Element -- ----------------- overriding procedure End_Element (Self : in out HTML5_Writer; Namespace_URI : League.Strings.Universal_String; Local_Name : League.Strings.Universal_String; Qualified_Name : League.Strings.Universal_String; Success : in out Boolean) is pragma Unreferenced (Qualified_Name); pragma Unreferenced (Success); Foreign_Closed : Boolean := False; History : Omit_History_Kinds := None; begin case Self.Omit is when None => null; when Foreign => Self.Output.Put ("/>"); Foreign_Closed := True; when HTML_Start_Tag => -- [HTML5] "An html element's start tag may be omitted if the -- first thing inside the html element is not a comment." null; when HTML_End_Tag => -- [HTML5] "An html element's end tag may be omitted if the html -- element is not immediately followed by a comment." null; when Head_Start_Tag => -- [HTML5] "A head element's start tag may be omitted if the -- element is empty, or if the first thing inside the head element -- is an element." null; when Head_End_Tag => -- [HTML5] "A head element's end tag may be omitted if the head -- element is not immediately followed by a space character or a -- comment." null; when Body_Start_Tag => -- [HTML5] "A body element's start tag may be omitted if the -- element is empty, or if the first thing inside the body element -- is not a space character or a comment, except if the first -- thing inside the body element is a script or style element." null; when Body_End_Tag => -- [HTML5] "A body element's end tag may be omitted if the body -- element is not immediately followed by a comment." null; when Li_End_Tag => -- [HTML5] "An li element's end tag may be omitted if the li -- element is immediately followed by another li element or if -- there is no more content in the parent element." null; when Dt_End_Tag => -- [HTML5] "A dt element's end tag may be omitted if the dt -- element is immediately followed by another dt element or a dd -- element." Self.Output.Put ("</dt>"); when Dd_End_Tag => -- [HTML5] "A dd element's end tag may be omitted if the dd -- element is immediately followed by another dd element or a dt -- element, or if there is no more content in the parent element." null; when Rt_End_Tag => -- [HTML5] "An rt element's end tag may be omitted if the rt -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." null; when Rp_End_Tag => -- [HTML5] "An rp element's end tag may be omitted if the rp -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." null; when Optgroup_End_Tag => -- [HTML5] "An optgroup element's end tag may be omitted if the -- optgroup element is immediately followed by another optgroup -- element, or if there is no more content in the parent element." null; when Option_End_Tag => -- [HTML5] "An option element's end tag may be omitted if the -- option element is immediately followed by another option -- element, or if it is immediately followed by an optgroup -- element, or if there is no more content in the parent element." null; when Colgroup_Start_Tag => -- [HTML5] "A colgroup element's start tag may be omitted if the -- first thing inside the colgroup element is a col element, and -- if the element is not immediately preceded by another colgroup -- element whose end tag has been omitted. (It can't be omitted if -- the element is empty.)" Self.Output.Put ("<colgroup>"); when Colgroup_End_Tag => -- [HTML5] "A colgroup element's end tag may be omitted if the -- colgroup element is not immediately followed by a space -- character or a comment." History := Colgroup_End_Tag; when Thead_End_Tag => -- [HTML5] "A thead element's end tag may be omitted if the thead -- element is immediately followed by a tbody or tfoot element." Self.Output.Put ("</thead>"); when Tbody_Start_Tag => -- [HTML5] "A tbody element's start tag may be omitted if the -- first thing inside the tbody element is a tr element, and if -- the element is not immediately preceded by a tbody, thead, or -- tfoot element whose end tag has been omitted. (It can't be -- omitted if the element is empty.)" Self.Output.Put ("<tbody>"); when Tbody_End_Tag => -- [HTML5] "A tbody element's end tag may be omitted if the tbody -- element is immediately followed by a tbody or tfoot element, or -- if there is no more content in the parent element." History := Tbody_End_Tag; when Tfoot_End_Tag => -- [HTML5] "A tfoot element's end tag may be omitted if the tfoot -- element is immediately followed by a tbody element, or if there -- is no more content in the parent element." History := Tfoot_End_Tag; when Tr_End_Tag => -- [HTML5] "A tr element's end tag may be omitted if the tr -- element is immediately followed by another tr element, or if -- there is no more content in the parent element." null; when Td_End_Tag => -- [HTML5] "A td element's end tag may be omitted if the td -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." null; when Th_End_Tag => -- [HTML5] "A th element's end tag may be omitted if the th -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." null; when P_End_Tag => -- [HTML5] "A p element's end tag may be omitted if the p element -- is immediately followed by an address, article, aside, -- blockquote, dir, div, dl, fieldset, footer, form, h1, h2, h3, -- h4, h5, h6, header, hgroup, hr, main, nav, ol, p, pre, section, -- table, or ul, element, or if there is no more content in the -- parent element and the parent element is not an a element." if Namespace_URI = HTML_URI and Local_Name = A_Tag then Self.Output.Put ("</p>"); end if; end case; Self.Omit := None; Self.History := History; case Self.State.Element_Kind is when Normal | Raw_Text | Escapable_Raw_Text => if Local_Name = Body_Tag then Self.Omit := Body_End_Tag; elsif Local_Name = Dd_Tag then Self.Omit := Dd_End_Tag; elsif Local_Name = Dt_Tag then Self.Omit := Dt_End_Tag; elsif Local_Name = Head_Tag then Self.Omit := Head_End_Tag; elsif Local_Name = HTML_Tag then Self.Omit := HTML_End_Tag; elsif Local_Name = Li_Tag then Self.Omit := Li_End_Tag; elsif Local_Name = Optgroup_Tag then Self.Omit := Optgroup_End_Tag; elsif Local_Name = Option_Tag then Self.Omit := Option_End_Tag; elsif Local_Name = Rp_Tag then Self.Omit := Rp_End_Tag; elsif Local_Name = Rt_Tag then Self.Omit := Rt_End_Tag; elsif Local_Name = Colgroup_Tag then Self.Omit := Colgroup_End_Tag; elsif Local_Name = Thead_Tag then Self.Omit := Thead_End_Tag; elsif Local_Name = Tbody_Tag then Self.Omit := Tbody_End_Tag; elsif Local_Name = Tfoot_Tag then Self.Omit := Tfoot_End_Tag; elsif Local_Name = Tr_Tag then Self.Omit := Tr_End_Tag; elsif Local_Name = Td_Tag then Self.Omit := Td_End_Tag; elsif Local_Name = Th_Tag then Self.Omit := Th_End_Tag; elsif Local_Name = P_Tag then Self.Omit := P_End_Tag; else Self.Output.Put ("</"); Self.Output.Put (Local_Name); Self.Output.Put ('>'); end if; when Void => -- Don't generate close tag for void elements. -- -- [HTML5] "Then, if the element is one of the void elements, or -- if the element is a foreign element, then there may be a single -- U+002F SOLIDUS character (/). This character has no effect on -- void elements, but on foreign elements it marks the start tag -- as self-closing." null; when Foreign => if not Foreign_Closed then Self.Output.Put ("</"); Self.Output.Put (Local_Name); Self.Output.Put ('>'); end if; end case; Self.State := Self.Stack.Last_Element; Self.Stack.Delete_Last; end End_Element; ------------------ -- Error_String -- ------------------ overriding function Error_String (Self : HTML5_Writer) return League.Strings.Universal_String is begin return Self.Diagnosis; end Error_String; ---------------------------- -- Escape_Attribute_Value -- ---------------------------- procedure Escape_Attribute_Value (Value : League.Strings.Universal_String; Text : out League.Strings.Universal_String; Syntax : out Attribute_Value_Syntax) is C : League.Characters.Universal_Character; Unquoted_Syntax : Boolean := True; Apostrophes : Natural := 0; Quotation_Marks : Natural := 0; Aux : League.Strings.Universal_String; First : Positive := 1; Index : Natural; begin Text.Clear; if Value.Is_Empty then Syntax := Empty; else for J in 1 .. Value.Length loop C := Value (J); if C = League.Characters.Latin.Space or C = League.Characters.Latin.Character_Tabulation or C = League.Characters.Latin.Line_Feed or C = League.Characters.Latin.Form_Feed or C = League.Characters.Latin.Carriage_Return or C = League.Characters.Latin.Equals_Sign or C = League.Characters.Latin.Less_Than_Sign or C = League.Characters.Latin.Greater_Than_Sign or C = League.Characters.Latin.Grave_Accent then -- Space characters, '=', '<', '>', '`' are prohibited in -- unquoted attribute value syntax. Unquoted_Syntax := False; elsif C = League.Characters.Latin.Apostrophe then -- ''' is prohibited in unquoted attribute value syntax. Unquoted_Syntax := False; Apostrophes := Apostrophes + 1; elsif C = League.Characters.Latin.Quotation_Mark then -- '"' is prohibited in unquoted attribute value syntax. Unquoted_Syntax := False; Quotation_Marks := Quotation_Marks + 1; end if; if C = League.Characters.Latin.Ampersand then -- Replace '&' by character reference in result string. Text.Append ("&amp;"); else -- Copy other characters to result string. Text.Append (C); end if; end loop; if Unquoted_Syntax then -- Use unquoted attribute value syntax then actual attribute value -- doesn't violate its restrictions. Syntax := Unquoted; elsif Apostrophes <= Quotation_Marks then -- Number of apostrophes is less than number of quotation marks, -- use single-quoted attribute value syntax. Syntax := Single_Quoted; -- Escape ''' characters Aux := Text; Text.Clear; while First <= Aux.Length loop Index := Aux.Index (First, '''); if Index = 0 then Text.Append (Aux.Slice (First, Aux.Length)); First := Aux.Length + 1; else Text.Append (Aux.Slice (First, Index - 1)); Text.Append ("&apos;"); First := Index + 1; end if; end loop; else -- Number of apostrophes is greater than number of quotation -- marks, use single-quoted attribute value syntax. Syntax := Double_Quoted; -- Escape '"' characters Aux := Text; Text.Clear; while First <= Aux.Length loop Index := Aux.Index (First, '"'); if Index = 0 then Text.Append (Aux.Slice (First, Aux.Length)); First := Aux.Length + 1; else Text.Append (Aux.Slice (First, Index - 1)); Text.Append ("&quot;"); First := Index + 1; end if; end loop; end if; end if; end Escape_Attribute_Value; -------------------------- -- Is_Boolean_Attribute -- -------------------------- function Is_Boolean_Attribute (Name : League.Strings.Universal_String) return Boolean is begin return Name = Async_Attribute or Name = Autofocus_Attribute or Name = Autoplay_Attribute or Name = Checked_Attribute or Name = Controls_Attribute or Name = Default_Attribute or Name = Defer_Attribute or Name = Disabled_Attribute or Name = Formnovalidate_Attribute or Name = Hidden_Attribute or Name = Ismap_Attribute or Name = Loop_Attribute or Name = Multiple_Attribute or Name = Muted_Attribute or Name = Novalidate_Attribute or Name = Open_Attribute or Name = Readonly_Attribute or Name = Required_Attribute or Name = Reversed_Attribute or Name = Scoped_Attribute or Name = Seamless_Attribute or Name = Selected_Attribute or Name = Typemustmatch_Attribute; end Is_Boolean_Attribute; ----------------------------------- -- Is_Escapable_Raw_Text_Element -- ----------------------------------- function Is_Escapable_Raw_Text_Element (Tag : League.Strings.Universal_String) return Boolean is begin return Tag = Textarea_Tag or Tag = Title_Tag; end Is_Escapable_Raw_Text_Element; ------------------------- -- Is_Raw_Text_Element -- ------------------------- function Is_Raw_Text_Element (Tag : League.Strings.Universal_String) return Boolean is begin return Tag = Script_Tag or Tag = Style_Tag; end Is_Raw_Text_Element; -------------- -- Is_Space -- -------------- function Is_Space (Item : League.Strings.Universal_String) return Boolean is C : League.Characters.Universal_Character; begin -- [HTML5] "The space characters, for the purposes of this -- specification, are U+0020 SPACE, "tab" (U+0009), "LF" (U+000A), "FF" -- (U+000C), and "CR" (U+000D)." for J in 1 .. Item.Length loop C := Item (J); if C /= League.Characters.Latin.Space and C /= League.Characters.Latin.Character_Tabulation and C /= League.Characters.Latin.Line_Feed and C /= League.Characters.Latin.Form_Feed and C /= League.Characters.Latin.Carriage_Return then return False; end if; end loop; return True; end Is_Space; --------------------- -- Is_Void_Element -- --------------------- function Is_Void_Element (Tag : League.Strings.Universal_String) return Boolean is begin return Tag = Area_Tag or Tag = Base_Tag or Tag = Br_Tag or Tag = Col_Tag or Tag = Embed_Tag or Tag = Hr_Tag or Tag = Img_Tag or Tag = Input_Tag or Tag = Keygen_Tag or Tag = Link_Tag or Tag = Meta_Tag or Tag = Param_Tag or Tag = Source_Tag or Tag = Track_Tag or Tag = Wbr_Tag; end Is_Void_Element; ---------------------------- -- Set_Output_Destination -- ---------------------------- procedure Set_Output_Destination (Self : in out HTML5_Writer'Class; Output : not null SAX_Output_Destination_Access) is begin Self.Output := Output; end Set_Output_Destination; ----------------- -- Start_CDATA -- ----------------- overriding procedure Start_CDATA (Self : in out HTML5_Writer; Success : in out Boolean) is pragma Unreferenced (Success); begin if Self.Omit = Foreign then Self.Output.Put ('>'); Self.Omit := None; end if; Self.CDATA_Mode := True; if Self.State.Element_Kind = Foreign then -- [HTML5] "CDATA sections can only be used in foreign content -- (MathML or SVG)." Self.Output.Put ("<![CDATA["); end if; end Start_CDATA; -------------------- -- Start_Document -- -------------------- overriding procedure Start_Document (Self : in out HTML5_Writer; Success : in out Boolean) is pragma Unreferenced (Success); begin Self.Diagnosis.Clear; Self.State := (Element_Kind => Normal); Self.Omit := None; Self.History := None; Self.Stack.Clear; Self.DOCTYPE_Written := False; Self.Document_Start := True; Self.CDATA_Mode := False; end Start_Document; --------------- -- Start_DTD -- --------------- overriding procedure Start_DTD (Self : in out HTML5_Writer; Name : League.Strings.Universal_String; Public_Id : League.Strings.Universal_String; System_Id : League.Strings.Universal_String; Success : in out Boolean) is pragma Unreferenced (Name); pragma Unreferenced (Public_Id); pragma Unreferenced (System_Id); pragma Unreferenced (Success); begin Self.Write_DOCTYPE; end Start_DTD; ------------------- -- Start_Element -- ------------------- overriding procedure Start_Element (Self : in out HTML5_Writer; Namespace_URI : League.Strings.Universal_String; Local_Name : League.Strings.Universal_String; Qualified_Name : League.Strings.Universal_String; Attributes : XML.SAX.Attributes.SAX_Attributes; Success : in out Boolean) is pragma Unreferenced (Qualified_Name); History : Omit_History_Kinds := None; begin Self.Stack.Append (Self.State); if not Self.DOCTYPE_Written then -- DOCTYPE is required by HTML5 but it is optional in XHTML5. Self.Write_DOCTYPE; end if; case Self.Omit is when None => null; when Foreign => Self.Output.Put ('>'); when HTML_Start_Tag => -- [HTML5] "An html element's start tag may be omitted if the -- first thing inside the html element is not a comment." null; when HTML_End_Tag => -- [HTML5] "An html element's end tag may be omitted if the html -- element is not immediately followed by a comment." null; when Head_Start_Tag => -- [HTML5] "A head element's start tag may be omitted if the -- element is empty, or if the first thing inside the head element -- is an element." null; when Head_End_Tag => -- [HTML5] "A head element's end tag may be omitted if the head -- element is not immediately followed by a space character or a -- comment." null; when Body_Start_Tag => -- [HTML5] "A body element's start tag may be omitted if the -- element is empty, or if the first thing inside the body element -- is not a space character or a comment, except if the first -- thing inside the body element is a script or style element." if Namespace_URI = HTML_URI and (Local_Name = Script_Tag or Local_Name = Style_Tag) then Self.Output.Put ("<body>"); end if; when Body_End_Tag => -- [HTML5] "A body element's end tag may be omitted if the body -- element is not immediately followed by a comment." null; when Li_End_Tag => -- [HTML5] "An li element's end tag may be omitted if the li -- element is immediately followed by another li element or if -- there is no more content in the parent element." if Namespace_URI = HTML_URI and Local_Name /= Li_Tag then Self.Output.Put ("</li>"); end if; when Dt_End_Tag => -- [HTML5] "A dt element's end tag may be omitted if the dt -- element is immediately followed by another dt element or a dd -- element." if Namespace_URI /= HTML_URI or (Local_Name /= Dt_Tag and Local_Name /= Dd_Tag) then Self.Output.Put ("</dt>"); end if; when Dd_End_Tag => -- [HTML5] "A dd element's end tag may be omitted if the dd -- element is immediately followed by another dd element or a dt -- element, or if there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Dt_Tag and Local_Name /= Dd_Tag) then Self.Output.Put ("</dd>"); end if; when Rt_End_Tag => -- [HTML5] "An rt element's end tag may be omitted if the rt -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Rt_Tag and Local_Name /= Rp_Tag) then Self.Output.Put ("</rt>"); end if; when Rp_End_Tag => -- [HTML5] "An rp element's end tag may be omitted if the rp -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Rt_Tag and Local_Name /= Rp_Tag) then Self.Output.Put ("</rp>"); end if; when Optgroup_End_Tag => -- [HTML5] "An optgroup element's end tag may be omitted if the -- optgroup element is immediately followed by another optgroup -- element, or if there is no more content in the parent element." if Namespace_URI /= HTML_URI or Local_Name /= Optgroup_Tag then Self.Output.Put ("</optgroup>"); end if; when Option_End_Tag => -- [HTML5] "An option element's end tag may be omitted if the -- option element is immediately followed by another option -- element, or if it is immediately followed by an optgroup -- element, or if there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Option_Tag and Local_Name /= Optgroup_Tag) then Self.Output.Put ("</option>"); end if; when Colgroup_Start_Tag => -- [HTML5] "A colgroup element's start tag may be omitted if the -- first thing inside the colgroup element is a col element, and -- if the element is not immediately preceded by another colgroup -- element whose end tag has been omitted. (It can't be omitted if -- the element is empty.)" if Namespace_URI /= HTML_URI or Local_Name /= Col_Tag or Self.History = Colgroup_End_Tag then Self.Output.Put ("<colgroup>"); end if; when Colgroup_End_Tag => -- [HTML5] "A colgroup element's end tag may be omitted if the -- colgroup element is not immediately followed by a space -- character or a comment." History := Colgroup_End_Tag; when Thead_End_Tag => -- [HTML5] "A thead element's end tag may be omitted if the thead -- element is immediately followed by a tbody or tfoot element." if Namespace_URI /= HTML_URI or (Local_Name /= Tbody_Tag and Local_Name /= Tfoot_Tag) then Self.Output.Put ("</thead>"); else History := Thead_End_Tag; end if; when Tbody_Start_Tag => -- [HTML5] "A tbody element's start tag may be omitted if the -- first thing inside the tbody element is a tr element, and if -- the element is not immediately preceded by a tbody, thead, or -- tfoot element whose end tag has been omitted. (It can't be -- omitted if the element is empty.)" if Namespace_URI /= HTML_URI or Local_Name /= Tr_Tag or Self.History = Thead_End_Tag or Self.History = Tbody_End_Tag or Self.History = Tfoot_End_Tag then Self.Output.Put ("<tbody>"); end if; when Tbody_End_Tag => -- [HTML5] "A tbody element's end tag may be omitted if the tbody -- element is immediately followed by a tbody or tfoot element, or -- if there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Tbody_Tag and Local_Name /= Tfoot_Tag) then Self.Output.Put ("</tbody>"); else History := Tbody_End_Tag; end if; when Tfoot_End_Tag => -- [HTML5] "A tfoot element's end tag may be omitted if the tfoot -- element is immediately followed by a tbody element, or if there -- is no more content in the parent element." if Namespace_URI /= HTML_URI or Local_Name /= Tbody_Tag then Self.Output.Put ("</tfoot>"); else History := Tfoot_End_Tag; end if; when Tr_End_Tag => -- [HTML5] "A tr element's end tag may be omitted if the tr -- element is immediately followed by another tr element, or if -- there is no more content in the parent element." if Namespace_URI /= HTML_URI or Local_Name /= Tr_Tag then Self.Output.Put ("</tr>"); end if; when Td_End_Tag => -- [HTML5] "A td element's end tag may be omitted if the td -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Td_Tag and Local_Name /= Th_Tag) then Self.Output.Put ("</td>"); end if; when Th_End_Tag => -- [HTML5] "A th element's end tag may be omitted if the th -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Td_Tag and Local_Name /= Th_Tag) then Self.Output.Put ("</th>"); end if; when P_End_Tag => -- [HTML5] "A p element's end tag may be omitted if the p element -- is immediately followed by an address, article, aside, -- blockquote, dir, div, dl, fieldset, footer, form, h1, h2, h3, -- h4, h5, h6, header, hgroup, hr, main, nav, ol, p, pre, section, -- table, or ul, element, or if there is no more content in the -- parent element and the parent element is not an a element." if Namespace_URI /= HTML_URI or (Local_Name /= Address_Tag and Local_Name /= Article_Tag and Local_Name /= Aside_Tag and Local_Name /= Blockquote_Tag and Local_Name /= Dir_Tag and Local_Name /= Div_Tag and Local_Name /= Dl_Tag and Local_Name /= Fieldset_Tag and Local_Name /= Footer_Tag and Local_Name /= Form_Tag and Local_Name /= H1_Tag and Local_Name /= H2_Tag and Local_Name /= H3_Tag and Local_Name /= H4_Tag and Local_Name /= H5_Tag and Local_Name /= H6_Tag and Local_Name /= Header_Tag and Local_Name /= Hgroup_Tag and Local_Name /= Hr_Tag and Local_Name /= Main_Tag and Local_Name /= Nav_Tag and Local_Name /= Ol_Tag and Local_Name /= P_Tag and Local_Name /= Pre_Tag and Local_Name /= Section_Tag and Local_Name /= Table_Tag and Local_Name /= Ul_Tag) then Self.Output.Put ("</p>"); end if; end case; Self.Omit := None; Self.History := History; if Namespace_URI = HTML_URI then if Is_Void_Element (Local_Name) then Self.State.Element_Kind := Void; elsif Is_Raw_Text_Element (Local_Name) then Self.State.Element_Kind := Raw_Text; elsif Is_Escapable_Raw_Text_Element (Local_Name) then Self.State.Element_Kind := Escapable_Raw_Text; else Self.State.Element_Kind := Normal; end if; if Local_Name = Body_Tag then -- For convinience recognize <body> tag as start of the document's -- content. Self.Document_Start := False; if Attributes.Is_Empty then Self.Omit := Body_Start_Tag; end if; elsif Local_Name = Head_Tag then Self.Document_Start := False; if Attributes.Is_Empty then Self.Omit := Head_Start_Tag; end if; elsif Local_Name = HTML_Tag then if Attributes.Is_Empty then Self.Omit := HTML_Start_Tag; end if; elsif Local_Name = Colgroup_Tag then if Attributes.Is_Empty and Self.History /= Colgroup_End_Tag then Self.Omit := Colgroup_Start_Tag; end if; elsif Local_Name = Tbody_Tag then if Attributes.Is_Empty and (Self.History /= Tbody_End_Tag or Self.History /= Thead_End_Tag or Self.History /= Tfoot_End_Tag) then Self.Omit := Tbody_Start_Tag; end if; end if; if Self.Omit = None then Self.Output.Put ('<'); Self.Output.Put (Local_Name); Self.Write_Attributes (Attributes, Success); if not Success then return; end if; Self.Output.Put ('>'); if Local_Name = HTML_Tag then -- [HTML5] "It is suggested that newlines be inserted after the -- DOCTYPE, after any comments that are before the root -- element, after the html element's start tag (if it is not -- omitted), and after any comments that are inside the html -- element but before the head element." Self.Output.Put (League.Characters.Latin.Line_Feed); end if; end if; elsif Namespace_URI = MathML_URI or Namespace_URI = SVG_URI then Self.State.Element_Kind := Foreign; Self.Omit := Foreign; Self.Output.Put ('<'); Self.Output.Put (Local_Name); Self.Write_Attributes (Attributes, Success); if not Success then return; end if; else -- Other namespaces can't be used in HTML5. Success := False; Self.Diagnosis := League.Strings.To_Universal_String ("namespace is not supported by HTML5"); end if; end Start_Element; ---------------------- -- Write_Attributes -- ---------------------- procedure Write_Attributes (Self : in out HTML5_Writer'Class; Attributes : XML.SAX.Attributes.SAX_Attributes; Success : in out Boolean) is procedure Write_Attribute (Qualified_Name : League.Strings.Universal_String; Value : League.Strings.Universal_String); --------------------- -- Write_Attribute -- --------------------- procedure Write_Attribute (Qualified_Name : League.Strings.Universal_String; Value : League.Strings.Universal_String) is Escaped_Value : League.Strings.Universal_String; Syntax : Attribute_Value_Syntax; begin Escape_Attribute_Value (Value, Escaped_Value, Syntax); if Syntax = Empty or else (Self.State.Element_Kind /= Foreign and then Is_Boolean_Attribute (Qualified_Name)) then Self.Output.Put (' '); Self.Output.Put (Qualified_Name); elsif Syntax = Unquoted then Self.Output.Put (' '); Self.Output.Put (Qualified_Name); Self.Output.Put ('='); Self.Output.Put (Escaped_Value); elsif Syntax = Single_Quoted then Self.Output.Put (' '); Self.Output.Put (Qualified_Name); Self.Output.Put ('='); Self.Output.Put ('''); Self.Output.Put (Escaped_Value); Self.Output.Put ('''); else Self.Output.Put (' '); Self.Output.Put (Qualified_Name); Self.Output.Put ('='); Self.Output.Put ('"'); Self.Output.Put (Escaped_Value); Self.Output.Put ('"'); end if; end Write_Attribute; Namespace_URI : League.Strings.Universal_String; Local_Name : League.Strings.Universal_String; Qualified_Name : League.Strings.Universal_String; Value : League.Strings.Universal_String; begin for J in 1 .. Attributes.Length loop Namespace_URI := Attributes.Namespace_URI (J); Local_Name := Attributes.Local_Name (J); Qualified_Name := Attributes.Qualified_Name (J); Value := Attributes (J); if Namespace_URI.Is_Empty then Write_Attribute (Qualified_Name, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Actuate_Attribute then Write_Attribute (XLink_Actuate_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Arcrole_Attribute then Write_Attribute (XLink_Arcrole_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Href_Attribute then Write_Attribute (XLink_Href_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Role_Attribute then Write_Attribute (XLink_Role_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Show_Attribute then Write_Attribute (XLink_Show_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Title_Attribute then Write_Attribute (XLink_Title_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Type_Attribute then Write_Attribute (XLink_Type_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XML_URI and Local_Name = Base_Attribute then Write_Attribute (XML_Base_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XML_URI and Local_Name = Lang_Attribute then Write_Attribute (XML_Lang_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XML_URI and Local_Name = Space_Attribute then Write_Attribute (XML_Space_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XMLNS_URI and Local_Name = XMLNS_Attribute then Write_Attribute (XMLNS_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XMLNS_URI and Local_Name = XLink_Attribute then Write_Attribute (XMLNS_XLink_Attribute, Value); else -- Other namespaces can't be expressed in HTML5. Success := False; Self.Diagnosis := League.Strings.To_Universal_String ("namespaced attribute can't be expressed in HTML5"); return; end if; end loop; end Write_Attributes; ------------------- -- Write_DOCTYPE -- ------------------- procedure Write_DOCTYPE (Self : in out HTML5_Writer'Class) is begin Self.DOCTYPE_Written := True; Self.Output.Put ("<!DOCTYPE html>"); -- [HTML5] "It is suggested that newlines be inserted after the DOCTYPE, -- after any comments that are before the root element, after the html -- element's start tag (if it is not omitted), and after any comments -- that are inside the html element but before the head element." Self.Output.Put (League.Characters.Latin.Line_Feed); end Write_DOCTYPE; end XML.SAX.HTML5_Writers;
benchmark/monad/MonadPostulates.agda
KDr2/agda
0
0
------------------------------------------------------------------------ -- Parser monad ------------------------------------------------------------------------ open import Relation.Binary open import Relation.Binary.OrderMorphism open import Relation.Binary.PropositionalEquality hiding (poset) import Relation.Binary.Properties.StrictTotalOrder as STOProps open import Data.Product open import Level module MonadPostulates where postulate -- Input string positions. Position : Set _<P_ : Rel Position zero posOrdered : IsStrictTotalOrder _≡_ _<P_ -- Input strings. Input : Position -> Set -- In order to be able to store results in a memo table (and avoid -- having to lift the table code to Set1) the result types have to -- come from the following universe: Result : Set ⟦_⟧ : Result -> Set -- Memoisation keys. These keys must uniquely identify the -- computation that they are associated with, when paired up with -- the current input string position. Key : let PosPoset = STOProps.poset (record { Carrier = _ ; _≈_ = _; _<_ = _ ; isStrictTotalOrder = posOrdered }) MonoFun = PosPoset ⇒-Poset PosPoset in MonoFun -> Result -> Set _≈'_ _<_ : Rel (∃₂ Key) zero keyOrdered : IsStrictTotalOrder _≈'_ _<_ -- Furthermore the underlying equality needs to be strong enough. funsEqual : _≈'_ =[ proj₁ ]⇒ _≡_ resultsEqual : _≈'_ =[ (\rfk -> proj₁ (proj₂ rfk)) ]⇒ _≡_ -- where open _⇒-Poset_ open STOProps (record { Carrier = _ ; _≈_ = _; _<_ = _ ; isStrictTotalOrder = posOrdered }) import IndexedMap as Map -- renaming (Map to MemoTable) open import Effect.Monad open import Effect.Monad.State import Data.List as List; open List using (List) open import Data.Unit open import Function open import Data.Maybe open import Data.Product.Relation.Binary.Lex.Strict open import Data.Product.Relation.Binary.Pointwise.NonDependent import Relation.Binary.Construct.On as On ------------------------------------------------------------------------ -- Monotone functions MonoFun : Set MonoFun = poset ⇒-Poset poset ------------------------------------------------------------------------ -- Memo tables -- Indices and keys used by the memo table. Index : Set Index = Position × MonoFun × Result data MemoTableKey : Index -> Set where key : forall {f r} (key : Key f r) pos -> MemoTableKey (pos , f , r) -- Input strings of a certain maximum length. Input≤ : Position -> Set Input≤ pos = ∃ \pos′ -> pos′ ≤ pos × Input pos′ -- Memo table values. Value : Index -> Set Value (pos , f , r) = List (⟦ r ⟧ × Input≤ (fun f pos)) -- Shuffles the elements to simplify defining equality and order -- relations for the keys. shuffle : ∃ MemoTableKey -> Position × ∃₂ Key shuffle ((pos , f , r) , key k .pos) = (pos , f , r , k) -- Equality and order. Eq : Rel (∃ MemoTableKey) _ Eq = Pointwise _≡_ _≈'_ on shuffle Lt : Rel (∃ MemoTableKey) _ Lt = ×-Lex _≡_ _<P_ _<_ on shuffle isOrdered : IsStrictTotalOrder Eq Lt isOrdered = On.isStrictTotalOrder shuffle (×-isStrictTotalOrder posOrdered keyOrdered) indicesEqual′ : Eq =[ proj₁ ]⇒ _≡_ indicesEqual′ {((_ , _ , _) , key _ ._)} {((_ , _ , _) , key _ ._)} (eq₁ , eq₂) = cong₂ _,_ eq₁ (cong₂ _,_ (funsEqual eq₂) (resultsEqual eq₂)) open Map isOrdered (\{k₁} {k₂} -> indicesEqual′ {k₁} {k₂}) Value {- ------------------------------------------------------------------------ -- Parser monad -- The parser monad is built upon a list monad, for backtracking, and -- two state monads. One of the state monads stores a memo table, and -- is unaffected by backtracking. The other state monad, which /is/ -- affected by backtracking, stores the remaining input string. -- The memo table state monad. module MemoState = RawMonadState (StateMonadState MemoTable) -- The list monad. module List = RawMonadPlus List.ListMonadPlus -- The inner monad (memo table plus list). module IM where Inner : Set -> Set Inner R = State MemoTable (List R) InnerMonadPlus : RawMonadPlus Inner InnerMonadPlus = record { monadZero = record { monad = record { return = \x -> return (List.return x) ; _>>=_ = \m f -> List.concat <$> (List.mapM monad f =<< m) } ; ∅ = return List.∅ } ; _∣_ = \m₁ m₂ -> List._∣_ <$> m₁ ⊛ m₂ } where open MemoState InnerMonadState : RawMonadState MemoTable Inner InnerMonadState = record { monad = RawMonadPlus.monad InnerMonadPlus ; get = List.return <$> get ; put = \s -> List.return <$> put s } where open MemoState open RawMonadPlus InnerMonadPlus public open RawMonadState InnerMonadState public using (get; put; modify) -- The complete parser monad. module PM where P : MonoFun -> Set -> Set P f A = forall {n} -> Input n -> IM.Inner (A × Input≤ (fun f n)) -- Memoises the computation, assuming that the key is sufficiently -- unique. memoise : forall {f r} -> Key f r -> P f ⟦ r ⟧ -> P f ⟦ r ⟧ memoise k p {pos} xs = let open IM in helper =<< lookup k′ <$> get where i = (pos , _) k′ : MemoTableKey i k′ = key k pos helper : Maybe (Value i) -> State MemoTable (Value i) helper (just ris) = return ris where open MemoState helper nothing = p xs >>= \ris -> modify (insert k′ ris) >> return ris where open MemoState -- Other monadic operations. return : forall {A} -> A -> P idM A return a = \xs -> IM.return (a , _ , refl , xs) _>>=_ : forall {A B f g} -> P f A -> (A -> P g B) -> P (g ∘M f) B _>>=_ {g = g} m₁ m₂ xs = m₁ xs ⟨ IM._>>=_ ⟩ \ays -> let a = proj₁ ays le = proj₁ $ proj₂ $ proj₂ ays ys = proj₂ $ proj₂ $ proj₂ ays in fix le ⟨ IM._<$>_ ⟩ m₂ a ys where lemma : forall {i j k} -> j ≤ k -> i ≤ fun g j -> i ≤ fun g k lemma j≤k i≤gj = trans i≤gj (monotone g j≤k) fix : forall {A i j} -> i ≤ j -> A × Input≤ (fun g i) -> A × Input≤ (fun g j) fix le = map-× id (map-Σ id (map-× (lemma le) id)) ∅ : forall {A} -> P idM A ∅ = const IM.∅ _∣_ : forall {A f} -> P f A -> P f A -> P f A m₁ ∣ m₂ = \xs -> IM._∣_ (m₁ xs) (m₂ xs) put : forall {n} -> Input n -> P (constM n) ⊤ put xs = \_ -> IM.return (_ , _ , refl , xs) modify : forall {A f} -> (forall {n} -> Input n -> A × Input (fun f n)) -> P f A modify g xs = IM.return (proj₁ gxs , _ , refl , proj₂ gxs) where gxs = g xs -}
smsq/smsq/cache40c.asm
olifink/smsqe
0
90482
<reponame>olifink/smsqe ; SMSQ_CACHE Cache Handling Fiddles 68040 copyback V2.0  1994 <NAME> ; 2005-11-12 2.01 fix bugs in COPYBACK mode. (TG) ; This module is checked after the main SMSQ OS module has been loaded ; There is no permanent cade and the select routine always returns 0. ; As a side effect, however, it sets up the cache routines in the base area ; and, if required, moves the trap #0 to #3 entry points. section header xref smsq_end include 'dev8_mac_creg' include 'dev8_keys_68000' include 'dev8_keys_stella_bl' include 'dev8_smsq_smsq_base_keys' header_base dc.l cache_set-header_base ; length of header dc.l 0 ; module length unknown dc.l smsq_end-cache_set ; loaded length dc.l 0 ; checksum dc.l 0 ; always select dc.b 0 ; main level dc.b 0 dc.w smsq_name-* smsq_name dc.w 33,'SMSQ Copyback Cache Handling Code ' dc.l '2.01' dc.w $200a section base ; this version sets only 68040 caches for copyback cache_set lea cache_40c,a1 ; cache defs move.l a5,-(sp) lea sms.cinvd,a5 moveq #($10*7)/2-1,d1 ; copy seven lots of $10 bytes cache_copy move.w (a1)+,d0 ; data to write jsr sms.wbase ; write it dbra d1,cache_copy lea sms.cenab,a5 move.w #$4ef9,d0 jsr sms.wbase lea enable_caches,a1 move.l a1,d0 swap d0 jsr sms.wbase lea enable_caches,a1 move.l a1,d0 jsr sms.wbase lea sms.cenai,a5 move.w #$4ef9,d0 jsr sms.wbase lea enable_caches,a1 move.l a1,d0 swap d0 jsr sms.wbase lea enable_caches,a1 move.l a1,d0 jsr sms.wbase move.l (sp)+,a5 moveq #0,d0 ; nothing to load rts * Before we enable a cache, we must make sure that the data previously * stored in it is either saved (for the data cache, in the event it was * already enabled before the call) or invalidated. * * The previous versions of the routines didn't ensure for this and a call to * them while the data cache was already enabled resulted in invlidating data * that was not yet copied back (in copyback mode) ! Also, as there is no * distinction between instruction and data cache disabling (both are disabled * together), there should be none at enable time: the previous version of the * routine invalidated the instruction cache only when re-enabling it, but * didn't make sure that the data cache was enabled or invalidated ! enable_caches move.w sr,-(sp) ; save status register. ori.w #$0700,sr ; disable interrupts. gcreg cacr ; get cacr in d0. btst #31,d0 ; data cache enabled ? beq.s no_cpushd ; if no, skip... cpushd ; save our data ! no_cpushd cinva ; invalidate both caches. move.l #$a0c08000,d0 ; enable all caches, invalidate branch pcreg cacr move.w (sp)+,sr ; restore status register. rts cache_40c rts dc.w 0,0,0,0,0,0,0 ; pad to 16 bytes cpusha ; (push data and) invalidate inst cache rts dc.w 0,0,0,0,0,0 ; pad to 16 bytes moveq #0,d0 ; disable everything pcreg cacr cpusha ; then push rts dc.w 0,0,0 ; pad to 16 bytes moveq #0,d0 ; in copyback mode disable instruction pcreg cacr ; does not ensure that the instruction cpusha ; cache will be re-filled correctly rts ; so we must disable both dc.w 0,0,0 rts ; this will be replaced with a jmp dc.w 0,0,0,0,0,0,0 ; pad to 16 bytes. rts ; this will be replaced with a jmp dc.w 0,0,0,0,0,0,0 ; pad to 16 bytes. dc.w 0,0,0,0,0,0,0 ; no tricks on trap cpusha ; push data, invalidate instruction cache on load cache_end end
libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sccz80/bv_priority_queue_data.asm
teknoplop/z88dk
8
176553
<reponame>teknoplop/z88dk ; void *bv_priority_queue_data(bv_priority_queue_t *q) SECTION code_clib SECTION code_adt_bv_priority_queue PUBLIC bv_priority_queue_data EXTERN asm_bv_priority_queue_data defc bv_priority_queue_data = asm_bv_priority_queue_data
oeis/097/A097314.asm
neoneye/loda-programs
11
101175
; A097314: Pell equation solutions (3*a(n))^2 - 10*b(n)^2 = -1 with b(n) = A097315(n), n >= 0. ; Submitted by <NAME> ; 1,39,1481,56239,2135601,81096599,3079535161,116941239519,4440687566561,168629186289799,6403468391445801,243163169688650639,9233796979777278481,350641122061847931639,13315128841370444123801,505624254850015028772799,19200406555459200649242561,729109824852599609642444519,27686972937843325965763649161,1051375861813193787089376223599,39924595775963520583430532847601,1516083263624800588383270871985239,57571239421966458837980862602591481,2186191014771100635254889508026491039 mov $2,2 mov $3,1 lpb $0 sub $0,1 mov $1,$3 mul $1,36 add $2,$1 add $3,$2 lpe mov $0,$3
Data/Empty/Base.agda
oisdk/agda-playground
6
15284
<gh_stars>1-10 {-# OPTIONS --without-K --safe #-} module Data.Empty.Base where open import Level data ⊥ : Type where infix 4.5 ¬_ ¬_ : Type a → Type a ¬ A = A → ⊥ ⊥-elim : ⊥ → A ⊥-elim ()
oeis/226/A226939.asm
neoneye/loda-programs
11
17807
; A226939: A recursive variation of the Collatz-Fibonacci sequence: a(n) = 1 + min(a(C(n)),a(C(C(n)))) where C(n) = A006370(n), the Collatz map. ; Submitted by <NAME> ; 1,1,4,2,3,5,9,2,10,4,8,5,5,9,9,3,7,11,11,4,4,8,8,6,12,6,56,10,10,10,54,3,14,7,7,11,11,11,18,5,55,5,15,9,9,9,53,6,13,13,13,6,6,57,57,10,17,10,17,10,10,54,54,4,14,14,14,8,8,8,52,12,58,12,8,12,12,18,18,5,12,56,56,5,5,16,16,9,16,9,47,9,9,53,53,7,60,13,13,13 seq $0,6577 ; Number of halving and tripling steps to reach 1 in '3x+1' problem, or -1 if 1 is never reached. div $0,2 add $0,1
attic/asis/find_entities/adam-assist-query-find_entities-driver.ads
charlie5/aIDE
3
24683
procedure AdaM.Assist.Query.find_Entities.Driver;
maps/SandgemPokeMart.asm
AtmaBuster/pokecrystal16-493-plus
1
245809
<gh_stars>1-10 object_const_def ; object_event constants SandgemPokeMart_MapScripts: db 0 ; scene scripts db 0 ; callbacks SandgemPokeMart_MapEvents: db 0, 0 ; filler db 2 ; warp events warp_event 2, 7, SANDGEM_TOWN, 4 warp_event 3, 7, SANDGEM_TOWN, 4 db 0 ; coord events db 0 ; bg events db 0 ; object events
data/moves/effects_pointers.asm
AtmaBuster/pokeoctober
1
8949
MoveEffectsPointers: ; entries correspond to EFFECT_* constants dw NormalHit dw DoSleep dw PoisonHit dw LeechHit dw BurnHit dw FreezeHit dw ParalyzeHit dw Selfdestruct dw DreamEater dw MirrorMove dw AttackUp dw DefenseUp dw SpeedUp dw SpecialAttackUp dw SpecialDefenseUp dw AccuracyUp dw EvasionUp dw NormalHit dw AttackDown dw DefenseDown dw SpeedDown dw SpecialAttackDown dw SpecialDefenseDown dw AccuracyDown dw EvasionDown dw ResetStats dw Bide dw Rampage dw ForceSwitch dw MultiHit dw Conversion dw FlinchHit dw Heal dw Toxic dw PayDay dw LightScreen dw TriAttack dw NormalHit dw OHKOHit dw RazorWind dw SuperFang dw StaticDamage dw TrapTarget dw NormalHit dw MultiHit dw NormalHit dw Mist dw FocusEnergy dw RecoilHit dw DoConfuse dw AttackUp2 dw DefenseUp2 dw SpeedUp2 dw SpecialAttackUp2 dw SpecialDefenseUp2 dw AccuracyUp2 dw EvasionUp2 dw Transform dw AttackDown2 dw DefenseDown2 dw SpeedDown2 dw SpecialAttackDown2 dw SpecialDefenseDown2 dw AccuracyDown2 dw EvasionDown2 dw Reflect dw DoPoison dw DoParalyze dw AttackDownHit dw DefenseDownHit dw SpeedDownHit dw SpecialAttackDownHit dw SpecialDefenseDownHit dw AccuracyDownHit dw EvasionDownHit dw SkyAttack dw ConfuseHit dw PoisonMultiHit dw NormalHit dw Substitute dw HyperBeam dw Rage dw Mimic dw Metronome dw LeechSeed dw Splash dw Disable dw StaticDamage dw Psywave dw Counter dw Encore dw PainSplit dw Snore dw Conversion2 dw LockOn dw Sketch dw DefrostOpponent dw SleepTalk dw DestinyBond dw Reversal dw Spite dw FalseSwipe dw HealBell dw NormalHit dw TripleKick dw Thief dw MeanLook dw Nightmare dw FlameWheel dw Curse dw NormalHit dw Protect dw Spikes dw Foresight dw PerishSong dw Sandstorm dw Endure dw Rollout dw Swagger dw FuryCutter dw Attract dw Return dw Present dw Frustration dw Safeguard dw SacredFire dw Magnitude dw BatonPass dw Pursuit dw RapidSpin dw NormalHit dw NormalHit dw MorningSun dw Synthesis dw Moonlight dw HiddenPower dw RainDance dw SunnyDay dw DefenseUpHit dw AttackUpHit dw AllUpHit dw FakeOut dw BellyDrum dw PsychUp dw MirrorCoat dw SkullBash dw Twister dw Earthquake dw FutureSight dw Gust dw Stomp dw Solarbeam dw Thunder dw Teleport dw BeatUp dw Fly dw DefenseCurl dw CoinHurl dw Bounce
shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-parser/src/main/antlr4/imports/encrypt/RDLStatement.g4
novayoung/shardingsphere
1
859
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ grammar RDLStatement; import BaseRule; createEncryptRule : CREATE ENCRYPT RULE encryptRuleDefinition (COMMA encryptRuleDefinition)* ; alterEncryptRule : ALTER ENCRYPT RULE encryptRuleDefinition (COMMA encryptRuleDefinition)* ; dropEncryptRule : DROP ENCRYPT RULE tableName (COMMA tableName)* ; encryptRuleDefinition : tableName LP (RESOURCE EQ resourceName COMMA)? COLUMNS LP columnDefinition (COMMA columnDefinition)* RP (COMMA QUERY_WITH_CIPHER_COLUMN EQ queryWithCipherColumn)? RP ; resourceName : IDENTIFIER ; columnDefinition : LP NAME EQ columnName (COMMA PLAIN EQ plainColumnName)? COMMA CIPHER EQ cipherColumnName (COMMA ASSISTED_QUERY_COLUMN EQ assistedQueryColumnName)? COMMA algorithmDefinition RP ; columnName : IDENTIFIER ; plainColumnName : IDENTIFIER ; cipherColumnName : IDENTIFIER ; assistedQueryColumnName : IDENTIFIER ; algorithmDefinition : TYPE LP NAME EQ algorithmName (COMMA PROPERTIES LP algorithmProperties? RP)? RP ; algorithmName : IDENTIFIER ; algorithmProperties : algorithmProperty (COMMA algorithmProperty)* ; algorithmProperty : key=(IDENTIFIER | STRING) EQ value=(NUMBER | INT | STRING) ; queryWithCipherColumn : TRUE | FALSE ;
stdlib-exts/Data/Fin/Instance.agda
WhatisRT/meta-cedille
35
9046
<filename>stdlib-exts/Data/Fin/Instance.agda module Data.Fin.Instance where open import Class.Equality open import Class.Traversable open import Data.Fin renaming (_≟_ to _≟F_) open import Data.Fin.Map instance Eq-Fin : ∀ {n} -> Eq (Fin n) Eq-Fin = record { _≟_ = _≟F_ } Traversable-Fin-Map : ∀ {a} {n} -> Traversable {a} (FinMap n) Traversable-Fin-Map = record { sequence = sequenceDepFinMap }
source/pools/s-stpoun.adb
ytomino/drake
33
20629
<reponame>ytomino/drake package body System.Storage_Pools.Unbounded is overriding procedure Initialize (Object : in out Unbounded_Pool) is begin Unbounded_Allocators.Initialize (Object.Allocator); end Initialize; overriding procedure Finalize (Object : in out Unbounded_Pool) is begin Unbounded_Allocators.Finalize (Object.Allocator); end Finalize; overriding procedure Allocate ( Pool : in out Unbounded_Pool; Storage_Address : out Address; Size_In_Storage_Elements : Storage_Elements.Storage_Count; Alignment : Storage_Elements.Storage_Count) is begin Unbounded_Allocators.Allocate ( Pool.Allocator, Storage_Address => Storage_Address, Size_In_Storage_Elements => Size_In_Storage_Elements, Alignment => Alignment); end Allocate; overriding procedure Deallocate ( Pool : in out Unbounded_Pool; Storage_Address : Address; Size_In_Storage_Elements : Storage_Elements.Storage_Count; Alignment : Storage_Elements.Storage_Count) is begin Unbounded_Allocators.Deallocate ( Pool.Allocator, Storage_Address => Storage_Address, Size_In_Storage_Elements => Size_In_Storage_Elements, Alignment => Alignment); end Deallocate; end System.Storage_Pools.Unbounded;
alloy4fun_models/trashltl/models/13/L9vTdmif2pzw2S5YF.als
Kaixi26/org.alloytools.alloy
0
18
<gh_stars>0 open main pred idL9vTdmif2pzw2S5YF_prop14 { after (all f:Protected | f in Trash implies f not in Protected) } pred __repair { idL9vTdmif2pzw2S5YF_prop14 } check __repair { idL9vTdmif2pzw2S5YF_prop14 <=> prop14o }
archive/agda-2/Oscar/Category.agda
m0davis/oscar
0
13349
<reponame>m0davis/oscar module Oscar.Category where open import Oscar.Level open import Oscar.Function record Setoid {𝔬} (𝔒 : Ø 𝔬) 𝔮 : Ø 𝔬 ∙̂ ↑̂ 𝔮 where infix 4 _≋_ field _≋_ : 𝔒 → 𝔒 → Ø 𝔮 ≋-reflexivity : ∀ {x} → x ≋ x ≋-symmetry : ∀ {x y} → x ≋ y → y ≋ x ≋-transitivity : ∀ {x y} → x ≋ y → ∀ {z} → y ≋ z → x ≋ z record Semigroupoid {𝔬} {𝔒 : Ø 𝔬} {𝔪} (𝔐 : 𝔒 → 𝔒 → Ø 𝔪) {𝔮} (𝔐-setoid : ∀ {x y} → Setoid (𝔐 x y) 𝔮) : Ø 𝔬 ∙̂ 𝔪 ∙̂ 𝔮 where instance _ = λ {x y} → 𝔐-setoid {x} {y} open Setoid ⦃ … ⦄ using (_≋_) infixr 9 _∙_ field _∙_ : ∀ {y z} → 𝔐 y z → ∀ {x} → 𝔐 x y → 𝔐 x z ∙-extensionality : ∀ {x y} {f₁ f₂ : 𝔐 x y} → f₁ ≋ f₂ → ∀ {z} {g₁ g₂ : 𝔐 y z} → g₁ ≋ g₂ → g₁ ∙ f₁ ≋ g₂ ∙ f₂ ∙-associativity : ∀ {w x} (f : 𝔐 w x) {y} (g : 𝔐 x y) {z} (h : 𝔐 y z) → (h ∙ g) ∙ f ≋ h ∙ (g ∙ f) record Category {𝔬} {𝔒 : Ø 𝔬} {𝔪} {𝔐 : 𝔒 → 𝔒 → Ø 𝔪} {𝔮} {𝔐-setoid : ∀ {x y} → Setoid (𝔐 x y) 𝔮} (semigroupoid : Semigroupoid 𝔐 𝔐-setoid) : Ø 𝔬 ∙̂ 𝔪 ∙̂ 𝔮 where instance _ = λ {x y} → 𝔐-setoid {x} {y} open Setoid ⦃ … ⦄ using (_≋_) open Semigroupoid semigroupoid using (_∙_) field ε : ∀ {x} → 𝔐 x x ε-left-identity : ∀ {x y} {f : 𝔐 x y} → ε ∙ f ≋ f ε-right-identity : ∀ {x y} {f : 𝔐 x y} → f ∙ ε ≋ f record Semifunctor {𝔬₁} {𝔒₁ : Ø 𝔬₁} {𝔪₁} {𝔐₁ : 𝔒₁ → 𝔒₁ → Ø 𝔪₁} {𝔮₁} {𝔐₁-setoid : ∀ {x y} → Setoid (𝔐₁ x y) 𝔮₁} (semigroupoid₁ : Semigroupoid 𝔐₁ 𝔐₁-setoid) {𝔬₂} {𝔒₂ : Ø 𝔬₂} {𝔪₂} {𝔐₂ : 𝔒₂ → 𝔒₂ → Ø 𝔪₂} {𝔮₂} {𝔐₂-setoid : ∀ {x y} → Setoid (𝔐₂ x y) 𝔮₂} (semigroupoid₂ : Semigroupoid 𝔐₂ 𝔐₂-setoid) : Ø 𝔬₁ ∙̂ 𝔪₁ ∙̂ 𝔮₁ ∙̂ 𝔬₂ ∙̂ 𝔪₂ ∙̂ 𝔮₂ where instance _ = λ {x y} → 𝔐₁-setoid {x} {y} instance _ = λ {x y} → 𝔐₂-setoid {x} {y} open Setoid ⦃ … ⦄ using (_≋_) module ⒈ = Semigroupoid semigroupoid₁ module ⒉ = Semigroupoid semigroupoid₂ field {μ} : 𝔒₁ → 𝔒₂ 𝔣 : ∀ {x y} → 𝔐₁ x y → 𝔐₂ (μ x) (μ y) 𝔣-extensionality : ∀ {x y} → {f₁ f₂ : 𝔐₁ x y} → f₁ ≋ f₂ → 𝔣 f₁ ≋ 𝔣 f₂ 𝔣-commutativity : ∀ {x y} {f : 𝔐₁ x y} {z} {g : 𝔐₁ y z} → 𝔣 (g ⒈.∙ f) ≋ 𝔣 g ⒉.∙ 𝔣 f record Functor {𝔬₁} {𝔒₁ : Ø 𝔬₁} {𝔪₁} {𝔐₁ : 𝔒₁ → 𝔒₁ → Ø 𝔪₁} {𝔮₁} {𝔐₁-setoid : ∀ {x y} → Setoid (𝔐₁ x y) 𝔮₁} {semigroupoid₁ : Semigroupoid 𝔐₁ 𝔐₁-setoid} {𝔬₂} {𝔒₂ : Ø 𝔬₂} {𝔪₂} {𝔐₂ : 𝔒₂ → 𝔒₂ → Ø 𝔪₂} {𝔮₂} {𝔐₂-setoid : ∀ {x y} → Setoid (𝔐₂ x y) 𝔮₂} {semigroupoid₂ : Semigroupoid 𝔐₂ 𝔐₂-setoid} (semifunctor : Semifunctor semigroupoid₁ semigroupoid₂) (category₁ : Category semigroupoid₁) (category₂ : Category semigroupoid₂) : Ø 𝔬₁ ∙̂ 𝔪₁ ∙̂ 𝔮₁ ∙̂ 𝔬₂ ∙̂ 𝔪₂ ∙̂ 𝔮₂ where instance _ = λ {x y} → 𝔐₂-setoid {x} {y} open Setoid ⦃ … ⦄ using (_≋_) open Semifunctor semifunctor using (𝔣; μ) module ⒈ = Category category₁ module ⒉ = Category category₂ field 𝔣-identity : ∀ {x : 𝔒₁} → 𝔣 (⒈.ε {x = x}) ≋ (⒉.ε {x = μ x})
hoo/parser/grammar/Hoo.g4
benoybose/hoolang
0
2045
/* * Copyright 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. */ grammar Hoo; import Terminals; options { language=Cpp; } literalExpression : ByteLiteral | IntegerLiteral | DoubleLiteral | CharLiteral | BooleanLiteral ; stringExpression : StringLiteral ; identifierExpression : Identifier ; primaryExpression : literalExpression | stringExpression | identifierExpression ; expression : primaryExpression #simpleExpression | container=expression '[' accessIndex=expression ']' #arrayAccessExpression | receiver=expression '(' arguments=expressionList? ')' #invokeExpression | parent=expression '.' name=Identifier #nestedExpression | lvalue=expression opr=('|' | '&' | '^' | '~' | '<<' | '>>') rvalue=expression #binaryBitExpression | lvalue=expression opr=( '+' | '-' ) rvalue=expression #binaryAddExpression | lvalue=expression opr=( '*' | '/' | '%') rvalue=expression #binaryMultiplicateExpression | lvalue=expression opr=( '==' | '!=' | '>' | '<' | '>=' | '<=' ) rvalue=expression #binaryCompareExpression | lvalue=expression opr=( '&&' | '||' ) rvalue=expression #binaryLogicExpression | lvalue=expression opr=( '=' | '+=' | '-=' | '/=' | '*=' ) rvalue=expression #binaryAssignmentExpression | '(' expression ')' #groupedExpression | '(' typeSpecifier expression ')' #castExpression ; typeSpecifier : BasicDataType #basicDataTypeSpecifier | Identifier #identifierTypeSpecifier | typeSpecifier '.' Identifier #nestedTypeSpecifier | typeSpecifier '[' ']' #arrayTypeSpecifier ; expressionList : expression ( ',' expression )* ; statement : declarationStatement | operativeStatement | noOpStatement ; noOpStatement : ';' ; operativeStatement : compoundStatement | returnStatement | expressionStatement ; expressionStatement : expression ';' ; declarationStatement : variableDeclaration ';' | functionDeclaration ';' ; compoundStatement : '{' statement* '}' ; returnStatement : 'return' (returnValue=expression)? ';' ; classDefinition : 'class' className=Identifier ( ':' baseEntities=typeList )? classBody ; typeList : typeSpecifier ( ',' typeSpecifier)* ; classBody : '{' classBodyItem* '}' ; classBodyItem : defenition | declarationStatement ; functionDefinition : functionDeclaration function_body=operativeStatement ; functionDeclaration : Declarator? name=Identifier '(' paramList? ')' ( ':' returnType=typeSpecifier)? ; variableDeclaration : type=( 'let' | 'const' ) decl=storageItem ; storageItem : typedStorageItem | name=Identifier '=' init=primaryExpression ; typedStorageItem : name=Identifier ':' declared_type=typeSpecifier | name=Identifier ':' declared_type=typeSpecifier '=' init=expression ; paramList : typedStorageItem ( ',' typedStorageItem)+ ; Declarator : 'private' | 'public' | 'protected' | 'var' ; defenition : classDefinition | functionDefinition ; unitItem : defenition | statement ; unit : unitItem* EOF ; ExtraSymbolCharacters: ( '#' | '@' | '$' | '`' | '?' ) ;
Library/User/Help/helpC.asm
steakknife/pcgeos
504
166114
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1993 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: helpC.asm AUTHOR: <NAME>, Mar 2, 1993 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Gene 3/ 2/93 Initial revision DESCRIPTION: C routines for help $Id: helpC.asm,v 1.1 97/04/07 11:47:25 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HelpControlCode segment resource if FULL_EXECUTE_IN_PLACE HelpControlCode ends UserCStubXIP segment resource endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HELPSENDHELPNOTIFICATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Generate a help notification C FUNCTION: HelpSendHelpNotification() C DECLARATION extern void _far _pascal HelpSendHelpNotification(word HelpType, const char *contextname, const char *filename); Note:The fptrs *can* be pointing to the movable XIP code resource. KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 3/ 2/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ HELPSENDHELPNOTIFICATION proc far helpType:HelpType, contextname:fptr.char, filename:fptr.char uses ds, si, es, di .enter mov al, {byte}ss:helpType lds si, ss:contextname les di, ss:filename NOFXIP< call HelpSendHelpNotification > FXIP< call HelpSendHelpNotificationXIP > .leave ret HELPSENDHELPNOTIFICATION endp if FULL_EXECUTE_IN_PLACE UserCStubXIP ends HelpControlCode segment resource endif HelpControlCode ends
actions/Sleep.applescript
chrisiona/OSX-Actions
1
1677
<gh_stars>1-10 tell application "Finder" sleep end tell
books_and_notes/professional_courses/Security/sources/extra_books/Hacking:The Art of Exploitation (Second Edition)源代码/booksrc/helloworld.asm
gxw1/review_the_national_post-graduate_entrance_examination
640
241195
<reponame>gxw1/review_the_national_post-graduate_entrance_examination<gh_stars>100-1000 section .data ; data segment msg db "Hello, world!", 0x0a ; the string and newline char section .text ; text segment global _start ; Default entry point for ELF linking _start: ; SYSCALL: write(1, msg, 14) mov eax, 4 ; put 4 into eax, since write is syscall #4 mov ebx, 1 ; put 1 into ebx, since stdout is 1 mov ecx, msg ; put the address of the string into ecx mov edx, 14 ; put 14 into edx, since our string is 14 bytes int 0x80 ; Call the kernel to make the system call happen ; SYSCALL: exit(0) mov eax, 1 ; put 1 into eax, since exit is syscall #1 mov ebx, 0 ; exit with success int 0x80 ; do the syscall
disorderly/deviates_demo_1.adb
jscparker/math_packages
30
6592
-- Uses a giant array, so may need to set stacksize large at (eg) Linux -- prompt, as in: ulimit -s unlimited with Text_io; Use Text_io; with Ada.Numerics.Generic_Elementary_Functions; with Disorderly.Random; use Disorderly.Random; with Disorderly.Random.Clock_Entropy; with Disorderly.Random.Deviates; -- To use Random.Deviates, you need to "with" Disorderly.Random. -- which provides the random num generator (which you just ignore), -- and the essential Reset (Stream_x, Seeds ...) -- which allows you to create multiple independent streams -- of Random nums. -- -- Below we use the Clock version of Reset to get the initial state (Stream). -- The clock provides the Seeds. You can get all the streams you want: -- -- Disorderly.Random.Clock_Entropy.Reset (Stream_1); -- Disorderly.Random.Clock_Entropy.Reset (Stream_2); -- Disorderly.Random.Clock_Entropy.Reset (Stream_3); procedure deviates_demo_1 is type Integer64 is range -2**63+1..2**63-1; type Real is digits 15; package math is new Ada.Numerics.Generic_Elementary_Functions (Real); use math; package rio is new Float_IO(Real); use rio; package dev is new Disorderly.Random.Deviates (Real); use dev; Stream_1 : State; -- exported by Disorderly.Random Chosen_Distribution : Integer; Delta_X_stnd : constant Real := 0.004; -- If you change parameters in the distributions, may have make this much -- smaller. (For example, the Beta distribution becomes very sharply -- peaked if aa<1, or if aa>>1; same with bb. Same with Gamma distribution -- if you make s<1; etc. For example, with Beta distribution b = .9, needed -- Delta_X_stnd = 0.00004, and HalfBins = 4.0 / Delta_X_stnd) HalfBins : constant Integer64 := Integer64 (400.0 / Delta_X_stnd); -- need 400+ for Cauchy; much less for others, -- so use 400. Means that results are stored in a giant array. Delta_X : Real := Delta_X_stnd; -- Delta_X must be 1 for Poisson, Binomial, Neg_Binomial! -- For Chi-Squared: Degrees_of_Freedom : constant Real := 3.0; Chi_init : Chi_Initializer; -- For Cauchy: S_Cauchy : constant Real := 0.25; -- Narrows up Lorentzian (tails fall off slow) Pi : constant Real := 3.141_592_652_589_793_238; -- For Gamma: s : constant Real := 3.85; Gamma_init : Gamma_Initializer; -- For Beta: aa : constant Real := 3.3; bb : constant Real := 2.2; Beta_init : Beta_Initializer; -- For Student_t: Student_t_m : constant Positive := 8; -- degrees of freedom S_t_init : Student_t_Initializer; -- For Neg_Binomial: Neg_Binomial_r : constant Real := 10.4; Neg_Binomial_p : constant Real := 0.21; NB_Init : Neg_Binomial_Initializer; -- For Binomial: Binomial_n : constant Positive := 2000; Binomial_p : constant Real := 0.1; B_Init : Binomial_Initializer; -- For Poisson: Poisson_Mean : constant Real := 150.0; P_Init : Poisson_Initializer; -- For Exponential: Exponential_Mean : constant Real := 9.0; -- For Normal (Gaussian): Standard_Dev : constant Real := 6.0; Gaussian_Mean : constant Real := 24.0; N_Init : Normal_Initializer; -- For Log_Normal: Lognormal_Sigma : constant Real := 0.5; Lognormal_Mean : constant Real := 0.0; LN_Init : Log_Normal_Initializer; Sample_Size : Integer64; subtype Bin_Range is Integer64 range -HalfBins+1 .. HalfBins; type Data is array(Bin_Range) of Real; Histogram : Data := (others => 0.0); Distribution : Data := (others => 0.0); Choice : Real := 0.0; Norm, Sum : Real := 0.0; X, D, a : Real := 0.0; Observed_Bin_id : Integer64; IX : Integer; begin Disorderly.Random.Clock_Entropy.Reset (Stream_1); -- use Calendar to get initial state: Stream_1; new_line; put ("Choose A Distribution. Enter a number:"); new_line(2); put ("Uniform = 0, Normal = 1, Lorentzian = 2"); new_Line; put ("Rayleigh = 3, Student_t = 4, Exponential = 5"); new_Line; put ("Weibull = 6, Poisson = 7, Binomial = 8"); new_Line; put ("Beta = 9, Gamma = 10, Chi_Squared = 11"); new_line; put ("Neg_Binomial = 12, Log_Normal = 13"); new_line; get (Choice); Chosen_Distribution := Integer(Choice); new_line(2); put ("Presently calculating variance of distance between the observed"); new_line(1); put ("distribution of a sample of N random deviates, and the exact"); new_line(1); put ("distribution they are meant to obey:"); new_line(1); if Choice = 7.0 or Choice = 8.0 or Choice = 12.0 then Delta_X := 1.0; -- Poisson, Binomial else Delta_X := Delta_X_stnd; end if; Sample_Size := 2_000; -- initial sample size is 10x this. for Resized_Sample_Size in 1 .. 16 loop Histogram := (others => 0.0); Distribution := (others => 0.0); Sample_Size := Sample_Size * 10; new_line(2); put ("Using Sample size N = "); put (Integer64'Image (Sample_Size)); for i in Integer64 range 1 .. Sample_Size loop if Chosen_Distribution = 0 then -- Uniform Get_Random_Real (X, Stream_1); elsif Chosen_Distribution = 1 then -- Normal Get_Normal (Gaussian_Mean, Standard_Dev, N_Init, Stream_1, X); elsif Chosen_Distribution = 2 then -- Cauchy (Lorentzian) Get_Cauchy (S_Cauchy, Stream_1, X); elsif Chosen_Distribution = 3 then -- Rayleigh Get_Rayleigh (Stream_1, X); elsif Chosen_Distribution = 4 then -- Student_t Get_Student_t (Student_t_m, S_t_init, Stream_1, X); elsif Chosen_Distribution = 5 then -- Exponential Get_Exponential (Exponential_Mean, Stream_1, X); elsif Chosen_Distribution = 6 then -- Rayleigh really Get_Weibull (2.0, Stream_1, X); elsif Chosen_Distribution = 7 then -- Poisson Get_Poisson (Poisson_Mean, P_Init, Stream_1, X); elsif Chosen_Distribution = 8 then -- Binomial Get_Binomial (Binomial_n, Binomial_p, B_Init, Stream_1, X); elsif Chosen_Distribution = 9 then -- Beta Get_Beta (aa, bb, Beta_Init, Stream_1, X); elsif Chosen_Distribution = 10 then -- Gamma Get_Gamma (s, Gamma_Init, Stream_1, X); elsif Chosen_Distribution = 11 then -- Chi_Squared Get_Chi_Squared (Degrees_of_Freedom, Chi_Init, Stream_1, X); elsif Chosen_Distribution = 12 then -- Neg_Binomial Get_Neg_Binomial (Neg_Binomial_r, Neg_Binomial_p, NB_Init, Stream_1, X); elsif Chosen_Distribution = 13 then -- Log_Normal Get_Log_Normal (Lognormal_Mean, Lognormal_Sigma, LN_Init, Stream_1, X); end if; Observed_Bin_id := Integer64 (X / Delta_X + 0.5); if Observed_Bin_id in Bin_Range then Histogram(Observed_Bin_id) := Histogram(Observed_Bin_id) + 1.0; end if; end loop; -- Normalize the curves. (Normalize the curves -- the same way that the distribution curves generated below -- are normalized: integrate over X with dX.) Here -- dX is Delta_X, so multiply by Delta_X at the end. Norm := 0.0; for Bin_id in Bin_Range loop Norm := Norm + Histogram(Bin_id); end loop; Norm := Norm*Delta_X; for Bin_id in Bin_Range loop Histogram(Bin_id) := Histogram(Bin_id) / Norm; end loop; -- Next make normalized distribution: for Bin_id in Bin_Range loop X := Delta_X * (Real (Bin_id) - 0.5); D := 0.0; if Chosen_Distribution = 0 then -- Uniform of [0,1) if X >= 0.0 and then X < 1.0 then D := 1.0; else D := 0.0; end if; elsif Chosen_Distribution = 1 then -- Normal D := Normal_Probability (Gaussian_Mean, Standard_Dev, X); elsif Chosen_Distribution = 2 then -- Cauchy (Lorentzian) a := S_Cauchy; D := a / ((a*a + x*x) * Pi); elsif Chosen_Distribution = 3 then -- Rayleigh if X > 0.0 then D := 2.0 * x * Exp (-x*x); else D := 0.0; end if; elsif Chosen_Distribution = 4 then -- student_t D := Student_t_Probability (Student_t_m, X); elsif Chosen_Distribution = 5 then -- Exponential if X > 0.0 then D := Exp (-X / Exponential_Mean) / Exponential_Mean; else D := 0.0; end if; elsif Chosen_Distribution = 6 then -- Weibull if X > 0.0 then D := 2.0 * x * Exp (-x*x); else D := 0.0; end if; elsif Chosen_Distribution = 7 then -- Poisson IX := Integer (Bin_id) - 1; D := Poisson_Probability (Poisson_Mean, IX); elsif Chosen_Distribution = 8 then -- Binomial IX := Integer (Bin_id) - 1; D := Binomial_Probability (Binomial_n, IX, Binomial_p); elsif Chosen_Distribution = 9 then -- Beta if X > 0.0 and then X < 1.0 then D := Beta_Probability (aa, bb, X); else D := 0.0; end if; elsif Chosen_Distribution = 10 then -- Gamma if X > 0.0 then D := Gamma_Probability (s, X); else D := 0.0; end if; elsif Chosen_Distribution = 11 then -- Chi_Squared if X > 0.0 then D := Chi_Squared_Probability (Degrees_of_Freedom, X); else D := 0.0; end if; elsif Chosen_Distribution = 12 then -- Neg_Binomial IX := Integer (X - 0.5); -- Integer (Bin_id) - 1 D := Neg_Binomial_Probability (Neg_Binomial_r, IX, Neg_Binomial_p); elsif Chosen_Distribution = 13 then -- Log_Normal D := Log_Normal_Probability (Lognormal_Mean, Lognormal_Sigma, X); end if; Distribution (Bin_id) := D; --if bin_id >= 0 then --t := Abs (Poissonian(Bin_id-1) - D); --if t>0.0 then --put(Integer64'Image (bin_id-1)); put (Real'Image (t)); --end if; --end if; end loop; Sum := 0.0; for j in Bin_Range loop Sum := Sum + (Distribution(j) - Histogram(j))**2; end loop; Sum := Sum*Delta_X; new_line; put ("Variance (standard deviation squared) ="); put (" "); put (Real'Image (Sum)); new_line; put ("Stnd_Deviation**2 should go approximately as 1/N."); new_line; put ("The actual value of the variance will fluctuate statistically."); new_line; put ("Fluctuations are very large for Poisson, Binomial - run repeatedly."); new_line; put ("This will run as long as you let it. Control-c to escape"); new_line; end loop; end;
ASM/src/items_as_adult.asm
louist103/OoT-Randomizer
0
84056
stick_as_adult: la t2, SAVE_CONTEXT lw t2, 0x04(t2) ; Link age beqz t2, @@adult ; Load empty display list if adult nop lui t2, hi(0x06006CC0) ; Load child stick display list b @@return addiu t2, t2, lo(0x06006CC0) @@adult: la t2, empty_dlist @@return: jr ra nop masks_as_adult: la t7, SAVE_CONTEXT lw t7, 0x04(t7) ; Link age bnez t7, @@return ; Return if child nop la t6, empty_dlist ; Load empty display list if adult @@return: sw t6, 0x0004(v0) jr ra lb t7, 0x013F(s0)
programs/oeis/183/A183208.asm
karttu/loda
0
88236
<reponame>karttu/loda ; A183208: Iterates of f(x)=floor((3x-1)/2) from x=6. ; 6,8,11,16,23,34,50,74,110,164,245,367,550,824,1235,1852,2777,4165,6247,9370,14054,21080,31619,47428,71141,106711,160066,240098,360146,540218,810326,1215488,1823231,2734846,4102268,6153401,9230101,13845151 mov $1,5 mov $2,$0 lpb $2,1 mul $1,3 div $1,2 sub $2,1 lpe add $1,1
models/tests/test44.als
transclosure/Amalgam
4
5223
module tests/test --- example written by <NAME> - EYLIM -- Alloy version 3.0 - Author: <NAME> - EYLIM --________________________________________________________ // SPECIFCATIONS OF CONCEPTUAL MODELS //Purpose: Assess the correctness of the AMBERS CoDM structure // For further conceptual model integrity analyses ... // File concepts_State_Sim_v1.als simulate AMBERS concepts states. --________________________________________________________ --_______________FILES____________________________________ -- models/work/ambers/concepts/concepts_Ops_Sim_Test_Assn_v1 open util/ordering[Boundary] as UB -- introduces ordered Boundaries // Abstract classifiers as abstract signatures: abstract sig Transform{ entry: set Kind, -- an entry relates to any number of kinds exit: set Kind, -- an exit relates to any number of kinds body: set Function -- a body relates to any number of functions }{ no entry & exit #entry>1 -- Non empty set of entries #exit >1 -- Non empty set of exits #body>0 -- a Transform body has at least 1 Function } abstract sig Function{ entry: set Kind, -- an entry relates to any number of kinds exit: one Kind, -- an exit relates to exactly one kind body: lone Role -- a body relates to at most one role. }{ no entry & exit #entry>1 -- Non empty set of entries #exit >1 -- Non empty set of exits #body>0 -- a Function body has at least 1 Role } abstract sig Kind{ feature: set Attribute, -- relates to any number of attributes defcon: set Definition_Condition -- Constraints on Kinds }{ #feature>1 #defcon>0 } abstract sig Role{ operation: set Behaviour, -- relates to 0 or N behaviour only hdgcon: set Handling_Condition -- Constraints on Roles }{ #operation>0 #hdgcon>0 } abstract sig Port{ } abstract sig Type{ } --________________________________________________________ // Partitioning functions sig Attribute extends Kind{ var, par: Type one -> one State -- relate 1 type to 1 state -- glb, min, max, lub: one Boundary -- relates to 1 limit } { var != par -- Variables and Parameters are distinct -- lte(glb, min) -- Greater Lower Bound =< Min -- lte(min, max) -- Min =< Max -- lte(max, glb) -- Max =< Lower Upper Bound } sig Behaviour extends Role{ body: set State -> one State -- relates any number of states to 1 state } sig Discrete extends Port{ -- Discrete relates to any number of field-type -- signal: Boolean -- Event driving or driven/ reactive } sig Analog extends Port{ -- Analog relates to any number of field-type -- dataB: Boolean, -- State driving or driven as controlled data -- dataI: Integer, -- dataR: Real, -- dataC: Character, -- dataS: String } sig Hybrid extends Port{ -- Hybrid relates to any number of field-relations hyb: (Discrete -> Analog) } sig Boolean, Integer, Real, Character, Stringz extends Type{} // Standalone signatures for base entities sig Definition_Condition{ -- assume: one Proposition, -- guarantee: one Proposition, -- property: one ((assume -> guarantee) -> Proposition) } sig Handling_Condition{ -- assume: one Proposition, -- guarantee: one Proposition, -- property: one ((assume -> guarantee) -> Proposition) } sig State{ -- input: Port, -- Entry port consumption -- output: Port -- Exit port production } sig Proposition{ -- precond: ((Attribute -> Boundary) -> Boolean), -- postcond: ((Attribute -> Boundary) -> Boolean), -- invariant: ((Behaviour -> Boundary) -> Boolean) } sig Boundary{ -- valB: one (Boolean -> State), -- valI: one (Integer -> State), -- valR: one (Real -> State), -- valC: one (Character -> State), -- valS: one (String -> State) } --__________ASSERTIONS: OPERATIONS SIMULATION_________ --__________addEntryExitTranAssn operation: TRANSFORM SIGN assert addEntryExitTranAssn{ all en, ex: Kind, t, t': Transform | some Kind and t'.entry = t.entry + en and t'.exit = t.exit + ex and t'.entry & t.exit = none and t.entry & t'.exit = none } check addEntryExitTranAssn for 6 but 2 Transform, 3 Kind, 1 Function expect 0 --__________addEntryExitFunAssn operation: TRANSFORM SIGN assert addEntryExitFunAssn{ all en, ex: Kind, f, f': Function | some Kind and f'.entry = f.entry + en and f'.exit = f.exit + ex and f'.entry & f.exit = none and f.entry & f'.exit = none } check addEntryExitFunAssn for 6 but 2 Function, 3 Kind expect 0 --__________FACTS: STATES & OPERATIONS SIMULATION_______ --__________NoLoopedSig fact: KIND, ROLE SIGN fact NoLoopedSig { some Behaviour and no iden & operation and -- No behaviour loops back recursively no iden & feature -- No Attribute loops back recursively } pred showP () {} run showP for 5 expect 1 assert showA { no Definition_Condition } check showA for 5 but 2 Transform, 2 Function expect 1
projects/07/vmtranslator/StaticTest.asm
l-const/nand2tetris
0
95823
<gh_stars>0 //push constant 111 @111 D=A @SP A=M M=D @SP M=M+1 //push constant 333 @333 D=A @SP A=M M=D @SP M=M+1 //push constant 888 @888 D=A @SP A=M M=D @SP M=M+1 //pop static 8 @StaticTest.8 D=A @R13 M=D @SP AM=M-1 D=M @R13 A=M M=D //pop static 3 @StaticTest.3 D=A @R13 M=D @SP AM=M-1 D=M @R13 A=M M=D //pop static 1 @StaticTest.1 D=A @R13 M=D @SP AM=M-1 D=M @R13 A=M M=D //push static 3 @StaticTest.3 D=M @SP A=M M=D @SP M=M+1 //push static 1 @StaticTest.1 D=M @SP A=M M=D @SP M=M+1 //sub @SP AM=M-1 D=M A=A-1 M=M-D //push static 8 @StaticTest.8 D=M @SP A=M M=D @SP M=M+1 //add @SP AM=M-1 D=M A=A-1 M=M+D
Assignment 2.asm
Pikridas/Computer-Architecture-Basics
0
245612
<gh_stars>0 .data value: .word 0, 0, 0 message1: .asciiz "RESULT\n" message2: .asciiz "addition = " .text .globl main main: la $t0, value li $v0, 5 # Δώστε τον πρώτο αριθμό syscall sw $v0, 0($t0) li $v0, 5 # Δώστε τον δεύτερο αριθμό syscall sw $v0, 4($t0) lw $t1, 0($t0) lw $t2, 4($t0) add $t3, $t1, $t2 sw $t3, 8($t0) li $v0, 4 # Τύπωσε το message1 la $a0, message1 syscall li $v0, 4 # Τύπωσε το message2 la $a0, message2 syscall li $v0, 1 # Τύπωσε το αποτέλεσμα move $a0, $t3 syscall li $v0, 10 syscall # Έξοδος #ΑΡΧΙΚΑ ΟΡΙΖΟΥΜΕ 3 ΤΙΜΕΣ ΣΤΟ LABEL VALUE ΟΙ ΟΠΟΙΕΣ ΕΙΝΑΙ: 0, 0, 0. #ΕΠΕΙΤΑ Ο ΧΡΗΣΤΗΣ ΔΙΝΕΙ ΤΟΝ 1ο ΑΡΙΘΜΟ ΚΑΙ Η ΤΙΜΗ ΑΠΟΘΗΚΕΥΕΤΑΙ ΣΤΗΝ ΘΕΣΗ ΤΗΣ 1ης ΤΙΜΗ ΤΟΥ LABEL VALUE +0. #ΑΡΑ ΣΤΟ 1ο BYTE ΜΝΗΜΗΣ. #ΑΡΑ ΟΙ ΤΙΜΕΣ ΤΩΡΑ ΕΙΝΑΙ: 1η ΤΙΜΗ ΧΡΗΣΤΗ, 0, 0. #ΕΠΕΙΤΑ Ο ΧΡΗΣΤΗΣ ΔΙΝΕΙ ΤΟΝ 2ο ΑΡΙΘΜΟ ΚΑΙ Η ΤΙΜΗ ΑΠΟΘΗΚΕΥΕΤΑΙ ΣΤΗΝ ΘΕΣΗ ΤΗΣ 1ης ΤΙΜΗ ΤΟΥ LABEL VALUE +4 ΘΕΣΕΙΣ. #ΑΡΑ ΣΤΟ 2ο BYTE ΜΝΗΜΗΣ. #ΑΡΑ ΟΙ ΤΙΜΕΣ ΤΩΡΑ ΕΙΝΑΙ: 1η ΤΙΜΗ ΧΡΗΣΤΗ, 2η ΤΙΜΗ ΧΡΗΣΤΗ, 0. #ΕΠΕΙΤΑ ΓΙΝΕΤΑΙ Η ΠΡΟΣΘΕΣΗ ΤΩΝ ΤΙΜΩΝ ΚΑΙ ΤΟ ΑΠΟΤΕΛΕΣΜΑ ΑΠΟΘΗΚΕΥΕΤΑΙ ΣΤΗΝ 3η ΘΕΣΗ ΤΟΥ LABEL VALUE. (1η ΘΕΣΗ +8) #ΑΡΑ #ΑΡΑ ΟΙ ΤΙΜΕΣ ΤΩΡΑ ΕΙΝΑΙ: 1η ΤΙΜΗ ΧΡΗΣΤΗ, 2η ΤΙΜΗ ΧΡΗΣΤΗ, ΑΘΡΟΙΣΜΑ. #ΓΙΑ EXECUTE: # 00 = 0 # 0a = /n # 20 = (keno) # AN MOU ZITISEI POSO XWRO KATALAMVANEI ENA PROGRAMMA # KOITAW TO TEXT SEGMENT -> ADDRESS KAI KOITAW THN TIMH THS TELEYTAIAS DIEYTHINSIS. # STO SYGKEKRIMENO PROGRAMMA EINAI 0x00400060, ΑΡΑ ΚΑΤΑΛΑΜΒΑΝΕΙ 60 BYTES. # ΤΙΣ ΨΕΥΔΟΕΝΤΟΛΕΣ ΤΙΣ ΚΑΤΑΛΑΒΑΙΝΩ ΟΤΑΝ ΚΟΙΤΑΩ ΤΟ ΠΡΟΓΡΑΜΜΑ ΓΡΑΜΜΗ - ΓΡΑΜΜΗ # ΣΤΟ ΠΑΡΑΘΥΡΟ TEXT SEGMENT -> BASIC KAI SOURCE. # OI ΕΝΤΟΛΕΣ ΠΟΥ ΒΡΙΣΚΟΝΤΑΙ ΣΤΟ BASIC ΕΙΝΑΙ ΟΙ ΚΑΝΟΝΚΕΣ ΕΝΤΟΛΕΣ. # ΟΙ ΕΝΤΟΛΕΣ ΠΟΥ ΒΡΙΣΚΟΝΤΑΙ ΣΤO SOURCE ΑΛΛΑ ΟΧΙ ΣΤΟ BASIC EINAI OI ΨΕΥΔΟΕΝΤΟΛΕΣ.
libsrc/graphics/mc1000/clg.asm
Toysoft/z88dk
0
104516
; ; MC-1000 graphics library ; ; $Id: clg.asm $ ; ;----------- GFX init ------------- SECTION code_driver PUBLIC clg PUBLIC _clg PUBLIC ansi_cls PUBLIC _ansi_cls .clg ._clg .ansi_cls ._ansi_cls ld b,255 ld a,$9e out ($80),a ld hl,$8000 .clg1 ld (hl),b inc hl ld a,h cp $98 jp nz,clg1 ld a,$9f out ($80),a ld ($f5),a ; Instruct the BASIC about the current screen mode ; so the ROM won't mess with the video page when called ld hl,clgret ld ($f7),hl ; cursor flashing and positioning routine .clgret ret
oeis/142/A142320.asm
neoneye/loda-programs
11
95970
; A142320: Primes congruent to 16 mod 45. ; Submitted by <NAME>(s4) ; 61,151,241,331,421,601,691,1051,1231,1321,1861,1951,2131,2221,2311,2671,2851,3121,3301,3391,3571,3931,4021,4111,4201,4561,4651,4831,5011,5101,5281,5641,5821,6091,6271,6361,6451,6991,7351,7621,8161,8431,8521,8971,9151,9241,9421,9511,9601,9781,9871,10141,10321,10501,10771,10861,11131,11311,11491,11941,12211,12301,12391,12841,13291,13381,13831,13921,14011,14281,14461,14551,14731,14821,15091,15271,15361,15451,15541,15901,15991,16981,17341,17431,17791,17881,17971,18061,18691,19051,19141,19231,19501 mov $2,$0 pow $2,2 lpb $2 add $1,20 mov $3,$1 sub $1,6 mul $3,3 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,16 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 sub $2,1 lpe mov $0,$1 mul $0,3 add $0,61
2020/10/adapter_array_p2.asm
ped7g/adventofcode
2
80054
<filename>2020/10/adapter_array_p2.asm ; https://adventofcode.com/2020/day/10 (part 2) OPT listoff : DEVICE ZXSPECTRUMNEXT : MMU 0 7, 0, $0000 inputFile: ; load the input into virtual device memory for processing ; INCBIN "input_t.txt" ; INCBIN "input_t2.txt" INCBIN "input.txt" inputEnd: ds 5,0 ; some zeroed mem in case the algorithm reads way beyond input ALIGN 256,0 MAX_ADAPTER EQU 255 dd 0, 0, 0, 0, 0, 0 ; there's nothing below outlet at 0 jolts (0 ways) adapters: dd 1, 0 ; outlet itself at 0 jolts is available in 1 way ds MAX_ADAPTER*8,0 parseNumberVal = 0 MACRO PARSE_VALUE parseNumberVal = 0 WHILE '0' <= {b inPtr} && {b inPtr} <= '9' parseNumberVal = parseNumberVal * 10 + {b inPtr} - '0' inPtr = inPtr + 1 ENDW ENDM ; init variables inPtr = inputFile ; parse all adapters into memory WHILE inPtr < inputEnd && {b inPtr} PARSE_VALUE : ASSERT "\n" == {b inPtr} || inputEnd <= inPtr inPtr = inPtr + 1 ; skip newline char ORG adapters + parseNumberVal*8 : DD 1 ; mark adapter in table ENDW inPtr = adapters+8 ; start from adapter 1-jolt (if available) waysA1L = 0 waysA1H = 0 waysA2L = 0 waysA2H = 0 waysA3L = 0 waysA3H = 0 waysL = 0 waysH = 0 overflow = 0 DUP MAX_ADAPTER IF {inPtr} ; some adapter found, check how many options it has waysA1L = {inPtr-24}|({inPtr-22}<<16) waysA1H = {inPtr-20}|({inPtr-18}<<16) waysA2L = {inPtr-16}|({inPtr-14}<<16) waysA2H = {inPtr-12}|({inPtr-10}<<16) waysA3L = {inPtr-8}|({inPtr-6}<<16) waysA3H = {inPtr-4}|({inPtr-2}<<16) waysL = waysA1L + waysA2L + waysA3L overflow = ((waysA1L&$FFFF) + (waysA2L&$FFFF) + (waysA3L&$FFFF))>>>16 overflow = (overflow + (waysA1L>>>16) + (waysA2L>>>16) + (waysA3L>>>16))>>>16 waysH = waysA1H + waysA2H + waysA3H + overflow ORG inPtr : DD waysL, waysH DISPLAY "adapter ",/D,(inPtr-adapters)/8," has ",waysH,":",waysL," ways" ENDIF inPtr = inPtr + 8 EDUP DISPLAY "Possible ways: ",waysH,":",waysL
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_21829_14.asm
ljhsiun2/medusa
9
172522
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r14 push %r8 push %r9 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0x1a1e4, %r10 nop nop nop xor %rbx, %rbx movl $0x61626364, (%r10) nop nop nop nop nop sub %rax, %rax lea addresses_D_ht+0x12154, %r9 sub $27238, %r14 movw $0x6162, (%r9) nop cmp %rax, %rax lea addresses_WC_ht+0x4ae4, %r11 nop nop nop nop nop and $6278, %r9 vmovups (%r11), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %rbx nop nop nop nop nop xor $17206, %r14 lea addresses_WC_ht+0x3204, %r11 nop nop sub $46193, %r9 mov (%r11), %r10d nop nop nop nop nop mfence lea addresses_D_ht+0x13a84, %rbx nop nop nop nop xor %r9, %r9 mov (%rbx), %r11 nop nop nop nop inc %r10 lea addresses_A_ht+0x169e4, %rsi lea addresses_normal_ht+0xcc24, %rdi nop nop sub $48732, %r14 mov $76, %rcx rep movsb add $53033, %rdi lea addresses_D_ht+0xcd64, %rsi lea addresses_WC_ht+0x3fe4, %rdi nop nop nop nop nop sub $23380, %rax mov $83, %rcx rep movsq nop nop nop nop nop cmp $29687, %r10 lea addresses_normal_ht+0x162e4, %r9 and $49797, %rcx mov $0x6162636465666768, %rsi movq %rsi, %xmm2 and $0xffffffffffffffc0, %r9 movaps %xmm2, (%r9) nop nop nop dec %r10 lea addresses_UC_ht+0xb484, %rsi lea addresses_D_ht+0x5ce4, %rdi clflush (%rdi) nop nop nop nop sub $28843, %r9 mov $122, %rcx rep movsw nop nop nop nop nop add %r9, %r9 lea addresses_A_ht+0x82e4, %rsi lea addresses_UC_ht+0x166e4, %rdi dec %r11 mov $70, %rcx rep movsb nop nop and %rsi, %rsi lea addresses_WC_ht+0xf024, %rcx clflush (%rcx) nop nop nop xor $16713, %r14 mov (%rcx), %r11d nop nop add $23597, %rax lea addresses_UC_ht+0x54e4, %rsi lea addresses_normal_ht+0x211e, %rdi nop sub %r8, %r8 mov $37, %rcx rep movsb nop cmp %r14, %r14 lea addresses_normal_ht+0xb04, %rdi clflush (%rdi) nop nop nop nop add %r11, %r11 mov $0x6162636465666768, %r9 movq %r9, %xmm6 vmovups %ymm6, (%rdi) add %rdi, %rdi lea addresses_WT_ht+0x185b4, %rax clflush (%rax) nop nop nop nop add $20823, %r9 movw $0x6162, (%rax) and $20702, %rax pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r8 pop %r14 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r8 push %rax push %rbp push %rcx push %rdx push %rsi // Store lea addresses_US+0x174e4, %rax nop nop nop add $4026, %r8 mov $0x5152535455565758, %rbp movq %rbp, (%rax) nop nop nop nop cmp %rcx, %rcx // Load lea addresses_WC+0x17568, %rdx clflush (%rdx) nop cmp %r10, %r10 mov (%rdx), %eax nop nop nop nop nop xor $1604, %rsi // Faulty Load lea addresses_WT+0x152e4, %rax nop nop nop inc %r10 mov (%rax), %cx lea oracles, %r10 and $0xff, %rcx shlq $12, %rcx mov (%r10,%rcx,1), %rcx pop %rsi pop %rdx pop %rcx pop %rbp pop %rax pop %r8 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_US'}} {'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT_ht'}} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}} {'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 5, 'AVXalign': True, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 8, 'same': True, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}} {'src': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': True, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal_ht'}} {'src': {'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_D_ht'}} {'src': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
org.alloytools.alloy.diff/misc/transitiveClosure.als
jringert/alloy-diff
1
2
sig Node { left : lone Node } one sig A extends Node { a : set Node } one sig B { a : set Node } lone sig C { a : set Node } fact acyclic {no n: Node | n in n.^left} fact succ {all n: Node | lone n.^left} run {} for 10
oeis/099/A099459.asm
neoneye/loda-programs
11
81671
<filename>oeis/099/A099459.asm ; A099459: Expansion of 1/(1 - 7*x + 9*x^2). ; Submitted by <NAME>(s4) ; 1,7,40,217,1159,6160,32689,173383,919480,4875913,25856071,137109280,727060321,3855438727,20444528200,108412748857,574888488199,3048504677680,16165536349969,85722212350663,454565659304920 mul $0,2 lpb $0 sub $0,1 add $1,1 mov $2,$3 mul $2,3 add $3,$1 mov $1,$2 lpe mov $0,$3 mul $0,3 add $0,1
resources/scripts/api/recondev.ads
sahil-rawat/Amass
1
6637
<reponame>sahil-rawat/Amass -- Copyright 2017 <NAME>. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. local json = require("json") name = "ReconDev" type = "api" function start() setratelimit(5) end function check() local c local cfg = datasrc_config() if cfg ~= nil then c = cfg.credentials end if (c ~= nil and c.key ~= nil and c.key ~= "") then return true end return false end function vertical(ctx, domain) local c local cfg = datasrc_config() if cfg ~= nil then c = cfg.credentials end if (c == nil or c.key == nil or c.key == "") then return end local resp local u = buildurl(domain, c.key) -- Check if the response data is in the graph database if (cfg.ttl ~= nil and cfg.ttl > 0) then resp = obtain_response(domain, cfg.ttl) end if (resp == nil or resp == "") then local err resp, err = request(ctx, { url=u, headers={['Content-Type']="application/json"}, }) if (err ~= nil and err ~= "") then log(ctx, err .. ": " .. resp) return end if (cfg.ttl ~= nil and cfg.ttl > 0) then cache_response(domain, resp) end end local data = json.decode(resp) if (data == nil or #data == 0) then return end for i, set in pairs(data) do local domains = set["rawDomains"] if domains ~= nil and #domains > 0 then for j, name in pairs(domains) do sendnames(ctx, name) end end local addrs = set["rawIp"] if addr ~= nil then newaddr(ctx, domain, addr) end end end function buildurl(domain, key) return "https://recon.dev/api/search?key=" .. key .. "&domain=" .. domain end function sendnames(ctx, content) local names = find(content, subdomainre) if names == nil then return end local found = {} for i, v in pairs(names) do if found[v] == nil then newname(ctx, v) found[v] = true end end end
as/tests/t_cop4/t_cop4.asm
hansbonini/-SMD-Phantasy-Star-3
1
160063
cpu cop410 asc add aisc 12 clra comp nop rc sc xor jid jmp 0x123 jp 0x023 jp (.&0x3f)+7 jsrp 0x87 jsr 0x123 ret retsk camq ld 0 ld 1 ld 2 ld 3 lqid rmb 0 rmb 1 rmb 2 rmb 3 smb 0 smb 1 smb 2 smb 3 stii 4 x 0 x 1 x 2 x 3 xad 3,15 xds 0 xds 1 xds 2 xds 3 xis 0 xis 1 xis 2 xis 3 cab cba lbi 2,9 lei 12 skc ske skgz skgbz 0 skgbz 1 skgbz 2 skgbz 3 skmbz 0 skmbz 1 skmbz 2 skmbz 3 ing inl obd omg xas ; new instructions on COP420 cpu cop420 lbi 1,7 ; extended operand range adt casc inin inil cqma xabr skt ogi 3 ldd 1,15 xad 2,12 ; complete new cos
audio/headers/musicheaders2.asm
etdv-thevoid/pokemon-rgb-enhanced
9
161942
Music_GymLeaderBattle:: audio Music_GymLeaderBattle, Ch0, Ch1, Ch2 Music_TrainerBattle:: audio Music_TrainerBattle, Ch0, Ch1, Ch2 Music_WildBattle:: audio Music_WildBattle, Ch0, Ch1, Ch2 Music_FinalBattle:: audio Music_FinalBattle, Ch0, Ch1, Ch2 Music_DefeatedTrainer:: audio Music_DefeatedTrainer, Ch0, Ch1, Ch2 Music_DefeatedWildMon:: audio Music_DefeatedWildMon, Ch0, Ch1, Ch2 Music_DefeatedGymLeader:: audio Music_DefeatedGymLeader, Ch0, Ch1, Ch2
src/main.asm
mdsteele/gbfxr
2
178970
INCLUDE "src/consts.inc" INCLUDE "src/hardware.inc" INCLUDE "src/macros.inc" ;;;=========================================================================;;; ;;; Store the stack at the back of WRAM. SECTION "Stack", WRAM0[$DF00] DS $100 Ram_BottomOfStack: ;;;=========================================================================;;; SECTION "Main", ROM0[$0150] Main:: ;; Initialize the stack. ld sp, Ram_BottomOfStack ;; Set up the OAM DMA routine. call Func_InitDmaCode ;; Initialize RAM state. call Func_InitState ;; Initialize the shadow OAM. call Func_ClearOam ld a, 24 ld [Ram_Cursor_oama + OAMA_Y], a ld a, 15 ld [Ram_Cursor_oama + OAMA_X], a ld a, 1 ld [Ram_Cursor_oama + OAMA_TILEID], a ;; Turn off the LCD. .waitForVBlank ldh a, [rLY] if_ne SCRN_Y, jr, .waitForVBlank ld a, LCDCF_OFF ld [rLCDC], a ;; Write BG tiles into VRAM. ld hl, Vram_BgTiles + 16 * 33 ; dest ld de, Data_FontTiles_start ; src ld bc, Data_FontTiles_end - Data_FontTiles_start ; count call Func_MemCopy ;; Write obj tiles into VRAM. ld hl, Vram_ObjTiles + 16 * 1 ; dest ld de, Data_ObjTiles_start ; src ld bc, Data_ObjTiles_end - Data_ObjTiles_start ; count call Func_MemCopy ;; Initialize palettes. ld a, %11100100 ldh [rBGP], a ldh [rOBP0], a ldh [rOBP1], a ;; Initialize background map. ld hl, Vram_BgMap + 2 + 1 * SCRN_VX_B ; dest ld de, Data_ChannelLabel_str ; src call Func_StrCopy ld hl, Vram_BgMap + 2 + 2 * SCRN_VX_B ; dest ld de, Data_DutyLabel_str ; src call Func_StrCopy ld hl, Vram_BgMap + 2 + 3 * SCRN_VX_B ; dest ld de, Data_LengthLabel_str ; src call Func_StrCopy ld hl, Vram_BgMap + 2 + 4 * SCRN_VX_B ; dest ld de, Data_EnvStartLabel_str ; src call Func_StrCopy ld hl, Vram_BgMap + 2 + 5 * SCRN_VX_B ; dest ld de, Data_EnvSweepLabel_str ; src call Func_StrCopy ld hl, Vram_BgMap + 2 + 6 * SCRN_VX_B ; dest ld de, Data_FrequencyLabel_str ; src call Func_StrCopy ld hl, Vram_BgMap + 2 + 7 * SCRN_VX_B ; dest ld de, Data_SweepAmtLabel_str ; src call Func_StrCopy ld hl, Vram_BgMap + 2 + 8 * SCRN_VX_B ; dest ld de, Data_SweepLenLabel_str ; src call Func_StrCopy ld hl, Vram_BgMap + 2 + 12 * SCRN_VX_B ; dest ld de, Data_Reg0Label_str ; src call Func_StrCopy ld hl, Vram_BgMap + 2 + 13 * SCRN_VX_B ; dest ld de, Data_Reg1Label_str ; src call Func_StrCopy ld hl, Vram_BgMap + 2 + 14 * SCRN_VX_B ; dest ld de, Data_Reg2Label_str ; src call Func_StrCopy ld hl, Vram_BgMap + 2 + 15 * SCRN_VX_B ; dest ld de, Data_Reg3Label_str ; src call Func_StrCopy ld hl, Vram_BgMap + 2 + 16 * SCRN_VX_B ; dest ld de, Data_Reg4Label_str ; src call Func_StrCopy call Func_UpdateBgForCh1Duty call Func_UpdateBgForCh1EnvStart call Func_UpdateBgForCh1EnvSweep call Func_UpdateBgForCh1Frequency ;; Enable sound. ld a, AUDENA_ON ldh [rAUDENA], a ld a, $ff ldh [rAUDTERM], a ld a, $77 ldh [rAUDVOL], a ;; Turn on the LCD. ld a, LCDCF_ON | LCDCF_BGON | LCDCF_OBJON | LCDCF_WIN9C00 ldh [rLCDC], a ;; Enable VBlank interrupt. ld a, IEF_VBLANK ldh [rIE], a ei RunLoop: call Func_WaitForVblankAndPerformDma ld a, [Ram_ChangedChannel] or a jr z, .channelUnchanged call Func_UpdateBgForChannel jr RunLoop .channelUnchanged ld a, [Ram_ChangedCh1Duty] or a jr z, .ch1DutyUnchanged call Func_UpdateBgForCh1Duty .ch1DutyUnchanged ld a, [Ram_ChangedCh1EnvStart] or a jr z, .ch1EnvStartUnchanged call Func_UpdateBgForCh1EnvStart .ch1EnvStartUnchanged ld a, [Ram_ChangedCh1EnvSweep] or a jr z, .ch1EnvSweepUnchanged call Func_UpdateBgForCh1EnvSweep .ch1EnvSweepUnchanged ld a, [Ram_ChangedCh1Frequency] or a jr z, .ch1FrequencyUnchanged call Func_UpdateBgForCh1Frequency .ch1FrequencyUnchanged ReadButtons: call Func_GetButtonState_b ;; TODO: Turn off all sound when SELECT is pressed. bit PADB_START, b jr z, .startButtonNotHeld ld a, [Ram_HoldingStart] or a jr nz, .checkDpad ld a, 1 ld [Ram_HoldingStart], a call Func_PlaySound jr RunLoop .startButtonNotHeld xor a ld [Ram_HoldingStart], a .checkDpad ld a, b and PADF_UP | PADF_DOWN | PADF_LEFT | PADF_RIGHT jr nz, .dpadActive xor a ld [Ram_HoldingDpad], a jr RunLoop .dpadActive ld a, [Ram_HoldingDpad] inc a if_lt DPAD_REPEAT_DELAY + DPAD_REPEAT_PERIOD, jr, .noRepeat ld a, DPAD_REPEAT_DELAY .noRepeat ld [Ram_HoldingDpad], a if_eq 1, jr, MoveCursor if_eq DPAD_REPEAT_DELAY, jr, MoveCursor jp RunLoop MoveCursor: bit PADB_DOWN, b jp nz, MoveCursorDown bit PADB_UP, b jp nz, MoveCursorUp ld a, b and PADF_LEFT | PADF_RIGHT call nz, Func_ChangeRowValue jp RunLoop MoveCursorUp: call Func_GetNumMenuRows_b ld a, [Ram_MenuCursorRow] or a jr nz, .decrement ld a, b .decrement dec a jr SetCursorRowToA MoveCursorDown: call Func_GetNumMenuRows_b ld a, [Ram_MenuCursorRow] inc a if_lt b, jr, SetCursorRowToA xor a SetCursorRowToA: ld [Ram_MenuCursorRow], a swap a srl a add 24 ld [Ram_Cursor_oama + OAMA_Y], a jp RunLoop ;;;=========================================================================;;; ;;; Plays the sound for the current channel. Func_PlaySound: ld a, [Ram_Channel] if_eq 4, jr, .channel4 if_eq 3, jr, .channel3 if_eq 2, jr, .channel2 .channel1 call Func_GetNR10Value_a ldh [rNR10], a call Func_GetNR11Value_a ldh [rNR11], a call Func_GetNR12Value_a ldh [rNR12], a call Func_GetNR13Value_a ldh [rNR13], a call Func_GetNR14Value_a ldh [rNR14], a ret .channel2 call Func_GetNR21Value_a ldh [rNR21], a call Func_GetNR22Value_a ldh [rNR22], a call Func_GetNR23Value_a ldh [rNR23], a call Func_GetNR24Value_a ldh [rNR24], a ret .channel3 call Func_GetNR30Value_a ldh [rNR30], a call Func_GetNR31Value_a ldh [rNR31], a call Func_GetNR32Value_a ldh [rNR32], a call Func_GetNR33Value_a ldh [rNR33], a call Func_GetNR34Value_a ldh [rNR34], a ret .channel4 call Func_GetNR41Value_a ldh [rNR41], a call Func_GetNR42Value_a ldh [rNR42], a call Func_GetNR43Value_a ldh [rNR43], a call Func_GetNR44Value_a ldh [rNR44], a ret ;;; @return b The number of menu rows for the current channel. Func_GetNumMenuRows_b: ld a, [Ram_Channel] if_ge 3, jr, .check3 if_ne 1, jr, .is2 ld b, 8 ret .is2 ld b, 6 ret .check3 if_ne 3, jr, .is4 ld b, 5 ret .is4 ld b, 7 ret ;;;=========================================================================;;; ;;; Updates the BG map after the channel is changed, and sets ;;; Ram_ChangedChannel to zero. Func_UpdateBgForChannel: xor a ld [Ram_ChangedChannel], a ld a, [Ram_Channel] add "0" ld [Vram_BgMap + 13 + 1 * SCRN_VX_B], a ld [Vram_BgMap + 5 + 12 * SCRN_VX_B], a ld [Vram_BgMap + 5 + 13 * SCRN_VX_B], a ld [Vram_BgMap + 5 + 14 * SCRN_VX_B], a ld [Vram_BgMap + 5 + 15 * SCRN_VX_B], a ld [Vram_BgMap + 5 + 16 * SCRN_VX_B], a ret ;;; Updates the BG map after the ch1 duty is changed, and sets ;;; Ram_ChangedCh1Duty to zero. Func_UpdateBgForCh1Duty: xor a ld [Ram_ChangedCh1Duty], a ;; Update "Duty" row: ld a, [Ram_Ch1Duty] ld hl, Vram_BgMap + 13 + 2 * SCRN_VX_B ; dest ld e, a ; value call Func_Print1DigitU8 ;; Update "rNR11" row: call Func_GetNR11Value_a ld hl, Vram_BgMap + 10 + 13 * SCRN_VX_B ; dest ld e, a ; value call Func_PrintBinaryU8 ret ;;; Updates the BG map after the ch1 env start is changed, and sets ;;; Ram_ChangedCh1EnvStart to zero. Func_UpdateBgForCh1EnvStart: xor a ld [Ram_ChangedCh1EnvStart], a ;; Update "Env start" row: ld a, [Ram_Ch1EnvStart] ld hl, Vram_BgMap + 13 + 4 * SCRN_VX_B ; dest ld e, a ; value call Func_Print2DigitU8 ;; Update "rNR12" row: jp Func_UpdateBgForNR12 ;;; Updates the BG map after the ch1 env start is changed, and sets ;;; Ram_ChangedCh1EnvStart to zero. Func_UpdateBgForCh1EnvSweep: xor a ld [Ram_ChangedCh1EnvSweep], a ;; Update "Env start" row: ld a, [Ram_Ch1EnvSweep_i8] ld e, a ; value ld hl, Vram_BgMap + 13 + 5 * SCRN_VX_B ; dest call Func_Print1DigitI8 ;; Update "rNR12" row: jp Func_UpdateBgForNR12 ;;; Updates the BG map after the ch1 frequency is changed, and sets ;;; Ram_ChangedCh1Frequency to zero. Func_UpdateBgForCh1Frequency: xor a ld [Ram_ChangedCh1Frequency], a ;; Update "Frequency" row: ld a, [Ram_Ch1Frequency_u16] ld e, a ld a, [Ram_Ch1Frequency_u16 + 1] ld d, a ld hl, Vram_BgMap + 13 + 6 * SCRN_VX_B ; dest call Func_Print4DigitU16 ;; Update "rNR13" row: call Func_GetNR13Value_a ld hl, Vram_BgMap + 10 + 15 * SCRN_VX_B ; dest ld e, a ; value call Func_PrintBinaryU8 ;; Update "rNR14" row: call Func_GetNR14Value_a ld hl, Vram_BgMap + 10 + 16 * SCRN_VX_B ; dest ld e, a ; value call Func_PrintBinaryU8 ret ;;;=========================================================================;;; ;;; Updates the BG map with the current value of NR12. Func_UpdateBgForNR12: call Func_GetNR12Value_a ld hl, Vram_BgMap + 10 + 14 * SCRN_VX_B ; dest ld e, a ; value call Func_PrintBinaryU8 ret ;;;=========================================================================;;;
Univalence/Normalize.agda
JacquesCarette/pi-dual
14
15470
module Normalize where open import Data.List open import Data.Product open import PiLevel0 -- We are going to use all the coherence as follows; make the right -- hand side canonical and rewrite the left hand side to the right -- hand side. Brute force below cannot work! -- Use the same structure as -- https://agda.github.io/agda-stdlib/Algebra.Monoid-solver.html ?? {-# NO_TERMINATION_CHECK #-} normalize : {t₁ t₂ : U} → (t₁ ⟷ t₂) → (t₁ ⟷ t₂) normalize unite₊ = {!!} normalize uniti₊ = {!!} normalize swap₊ = {!!} normalize assocl₊ = {!!} normalize assocr₊ = {!!} normalize unite⋆ = {!!} normalize uniti⋆ = {!!} normalize swap⋆ = {!!} normalize assocl⋆ = {!!} normalize assocr⋆ = {!!} normalize absorbr = {!!} normalize absorbl = {!!} normalize factorzr = {!!} normalize factorzl = {!!} normalize dist = {!!} normalize factor = {!!} normalize id⟷ = {!!} normalize (c ◎ id⟷) = normalize c normalize (unite₊ ◎ c₁) = {!!} normalize (uniti₊ ◎ c₁) = {!!} normalize (swap₊ ◎ c₁) = {!!} normalize (assocl₊ ◎ c₁) = {!!} normalize (assocr₊ ◎ c₁) = {!!} normalize (unite⋆ ◎ c₁) = {!!} normalize (uniti⋆ ◎ c₁) = {!!} normalize (swap⋆ ◎ c₁) = {!!} normalize (assocl⋆ ◎ c₁) = {!!} normalize (assocr⋆ ◎ c₁) = {!!} normalize (absorbr ◎ c₁) = {!!} normalize (absorbl ◎ c₁) = {!!} normalize (factorzr ◎ c₁) = {!!} normalize (factorzl ◎ c₁) = {!!} normalize (dist ◎ c₁) = {!!} normalize (factor ◎ c₁) = {!!} normalize (id⟷ ◎ c₁) = normalize c₁ normalize ((c ◎ c₁) ◎ c₂) = normalize (c ◎ (c₁ ◎ c₂)) normalize ((c ⊕ c₁) ◎ c₂) = {!!} normalize ((c ⊗ c₁) ◎ c₂) = {!!} normalize (c ⊕ unite₊) = {!!} normalize (c ⊕ uniti₊) = {!!} normalize (c ⊕ swap₊) = {!!} normalize (c ⊕ assocl₊) = {!!} normalize (c ⊕ assocr₊) = {!!} normalize (c ⊕ unite⋆) = {!!} normalize (c ⊕ uniti⋆) = {!!} normalize (c ⊕ swap⋆) = {!!} normalize (c ⊕ assocl⋆) = {!!} normalize (c ⊕ assocr⋆) = {!!} normalize (c ⊕ absorbr) = {!!} normalize (c ⊕ absorbl) = {!!} normalize (c ⊕ factorzr) = {!!} normalize (c ⊕ factorzl) = {!!} normalize (c ⊕ dist) = {!!} normalize (c ⊕ factor) = {!!} normalize (c ⊕ id⟷) = {!!} normalize (c ⊕ c₁ ◎ c₂) = {!!} normalize (c ⊕ (c₁ ⊕ c₂)) = {!!} normalize (c ⊕ (c₁ ⊗ c₂)) = {!!} normalize (c ⊗ c₁) = {!!}
programs/oeis/288/A288625.asm
jmorken/loda
1
14543
; A288625: Positions of 0 in A288375; complement of A283794. ; 2,3,5,7,8,11,12,14,17,18,20,22,23,27,28,30,32,33,36,37,39,43,44,46,48,49,52,53,55,58,59,61,63,64,69,70,72,74,75,78,79,81,84,85,87,89,90,94,95,97,99,100,103,104,106,111,112,114,116,117,120,121,123,126,127,129,131,132,136,137,139,141,142,145,146,148,152,153,155,157,158,161,162,164,167,168,170,172,173,179,180,182,184,185,188,189,191,194,195,197,199,200,204,205,207,209,210,213,214,216,220,221,223,225,226,229,230,232,235,236,238,240,241,246,247,249,251,252,255,256,258,261,262,264,266,267,271,272,274,276,277,280,281,283,289,290,292,294,295,298,299,301,304,305,307,309,310,314,315,317,319,320,323,324,326,330,331,333,335,336,339,340,342,345,346,348,350,351,356,357,359,361,362,365,366,368,371,372,374,376,377,381,382,384,386,387,390,391,393,398,399,401,403,404,407,408,410,413,414,416,418,419,423,424,426,428,429,432,433,435,439,440,442,444,445,448,449,451,454,455,457,459,460,467,468,470,472,473,476,477,479,482,483,485,487,488,492,493,495,497 mov $3,$0 add $3,1 mov $9,$0 lpb $3 mov $0,$9 sub $3,1 sub $0,$3 mov $5,$0 mov $7,2 lpb $7 mov $0,$5 sub $7,1 add $0,$7 lpb $0 sub $0,1 mov $2,1 mov $4,$0 cal $4,219641 ; a(n) = n minus (number of 1's in Zeckendorf expansion of n). mov $0,0 add $2,$4 lpe mov $4,$2 mov $8,$7 lpb $8 mov $6,$4 sub $8,1 lpe lpe lpb $5 mov $5,0 sub $6,$4 lpe mov $4,$6 add $4,1 add $1,$4 lpe
examples/example1.adb
lkujaw/felix
0
10037
<filename>examples/example1.adb ------------------------------------------------------------------------------ -- Copyright (c) 2021, <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 sell copies of the Software, and to permit persons to whom the -- Software is furnished to do so. -- -- 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. -- -- SPDX-License-Identifier: MIT-0 -- -- File: example1.adb (Ada Subprogram Body) -- Language: Ada (1995) [1] -- Author: <NAME> -- Description: Executable example of Felix library usage -- -- References: -- [1] Information technology - Programming languages - Ada, -- ISO/IEC 8652:1995(E), 15 Feb. 1995. ------------------------------------------------------------------------------ -- -- To run this program within the examples directory on a UNIX system, -- execute: NLSPATH=./%N ./example1 with Ada.Numerics; with C_Standard_IO; with Native_Language_System; with Standard_Text; use Standard_Text; procedure Example1 is package CIO renames C_Standard_IO; package NLS renames Native_Language_System; type Messages_T is (Hello, String_Length, Untranslated); Pi : aliased constant Long_Float := 3.141593; Mir : constant String := "мир"; Catalog_Name : constant String := "hello.cat"; Catalog : NLS.Catalog_T; Previous_Locale : NLS.Locale_T; procedure Put (The_Message : in Messages_T; The_Text : in Text_T) is begin CIO.Put (Item => Message (Catalog, 1, Messages_T'Pos (The_Message) + 1, The_Text)); end Put; begin -- Example1 NLS.Set_Locale (NLS.LC_ALL, "", Previous_Locale); begin NLS.Open_Catalog (Catalog, Catalog_Name); exception when NLS.POSIX_Error => CIO.Put_Line (CIO.Standard_Error, "The " & Catalog_Name & " message catalog could not be opened;" & " is NLSPATH set? Exiting."); return; end; Put (Hello, Text & "Hello, world! π = " & Ada.Numerics.Pi & New_Line); -- Out-of-order arguments example adapted from the Gettext manual. Put (String_Length, Text & "The string " & Raw (Mir) & " has " & Mir'Length & " bytes." & New_Line); Put (Untranslated, Text & "Address of π: " & Pi'Address & New_Line); Put (Untranslated, Text & Raw ("Здравствуй, мир!") & New_Line); Put (Untranslated, Text & Thousands_Grouping & (-2145729980.0) & New_Line); Put (Untranslated, Text & Positive_Sign & Thousands_Grouping & Integer_L (102317123) & New_Line); Put (Untranslated, Text & "Ada.Numerics.e: " & Precision (60) & Ada.Numerics.e & New_Line); NLS.Swap_Locale (NLS.LC_ALL, Previous_Locale); NLS.Close_Catalog (Catalog); end Example1;
other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver2/sfc/ys_w63.asm
prismotizm/gigaleak
0
102535
<filename>other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver2/sfc/ys_w63.asm Name: ys_w63.asm Type: file Size: 13841 Last-Modified: '2016-05-13T04:51:45Z' SHA-1: 5BA411AB420B901DABB23DEC0DC32791E8A6DFA2 Description: null
include/bits_types_u_locale_t_h.ads
docandrew/troodon
5
26661
<reponame>docandrew/troodon pragma Ada_2012; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; package bits_types_u_locale_t_h is -- Definition of struct __locale_struct and __locale_t. -- Copyright (C) 1997-2021 Free Software Foundation, Inc. -- This file is part of the GNU C Library. -- Contributed by <NAME> <<EMAIL>>, 1997. -- The GNU C Library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of the License, or (at your option) any later version. -- The GNU C 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 -- Lesser General Public License for more details. -- You should have received a copy of the GNU Lesser General Public -- License along with the GNU C Library; if not, see -- <https://www.gnu.org/licenses/>. -- POSIX.1-2008: the locale_t type, representing a locale context -- (implementation-namespace version). This type should be treated -- as opaque by applications; some details are exposed for the sake of -- efficiency in e.g. ctype functions. -- Note: LC_ALL is not a valid index into this array. -- 13 = __LC_LAST. type uu_locale_data; type uu_locale_struct_array914 is array (0 .. 12) of access uu_locale_data; type uu_locale_struct_array919 is array (0 .. 12) of Interfaces.C.Strings.chars_ptr; type uu_locale_struct is record uu_locales : uu_locale_struct_array914; -- /usr/include/bits/types/__locale_t.h:31 uu_ctype_b : access unsigned_short; -- /usr/include/bits/types/__locale_t.h:34 uu_ctype_tolower : access int; -- /usr/include/bits/types/__locale_t.h:35 uu_ctype_toupper : access int; -- /usr/include/bits/types/__locale_t.h:36 uu_names : uu_locale_struct_array919; -- /usr/include/bits/types/__locale_t.h:39 end record with Convention => C_Pass_By_Copy; -- /usr/include/bits/types/__locale_t.h:28 type uu_locale_data is null record; -- incomplete struct -- To increase the speed of this solution we add some special members. -- Note: LC_ALL is not a valid index into this array. type uu_locale_t is access all uu_locale_struct; -- /usr/include/bits/types/__locale_t.h:42 end bits_types_u_locale_t_h;
kernel/asm/disk.asm
avdgrinten/echidnaOS
0
82155
<reponame>avdgrinten/echidnaOS extern real_routine global disk_load_sector global disk_write_sector global read_drive_parameters section .data %define disk_load_sector_size disk_load_sector_end - disk_load_sector_bin disk_load_sector_bin: incbin "blobs/disk_load_sector.bin" disk_load_sector_end: %define disk_write_sector_size disk_write_sector_end - disk_write_sector_bin disk_write_sector_bin: incbin "blobs/disk_write_sector.bin" disk_write_sector_end: %define read_drive_parameters_size read_drive_parameters_end - read_drive_parameters_bin read_drive_parameters_bin: incbin "blobs/read_drive_parameters.bin" read_drive_parameters_end: function_struct: .source_sector_low dd 0 .source_sector_high dd 0 .target_address dd 0 .drive db 0 section .text bits 32 disk_load_sector: ; void disk_load_sector(uint8_t drive, uint8_t* target_address, uint64_t source_sector); push ebx push esi push edi push ebp ; Prepare the struct mov eax, dword [esp+32] mov dword [function_struct.source_sector_high], eax mov eax, dword [esp+28] mov dword [function_struct.source_sector_low], eax mov eax, dword [esp+24] mov dword [function_struct.target_address], eax mov eax, dword [esp+20] mov byte [function_struct.drive], al ; Call real mode routine mov ebx, function_struct mov esi, disk_load_sector_bin mov ecx, disk_load_sector_size call real_routine pop ebp pop edi pop esi pop ebx ret disk_write_sector: ; void disk_load_sector(uint8_t drive, uint8_t* target_address, uint64_t source_sector); push ebx push esi push edi push ebp ; Prepare the struct mov eax, dword [esp+32] mov dword [function_struct.source_sector_high], eax mov eax, dword [esp+28] mov dword [function_struct.source_sector_low], eax mov eax, dword [esp+24] mov dword [function_struct.target_address], eax mov eax, dword [esp+20] mov byte [function_struct.drive], al ; Call real mode routine mov ebx, function_struct mov esi, disk_write_sector_bin mov ecx, disk_write_sector_size call real_routine pop ebp pop edi pop esi pop ebx ret read_drive_parameters: ; void read_drive_parameters(drive_parameters_t* struct); push ebx push esi push edi push ebp ; Call real mode routine mov ebx, dword [esp+20] mov esi, read_drive_parameters_bin mov ecx, read_drive_parameters_size call real_routine pop ebp pop edi pop esi pop ebx ret
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/loop_optimization11_pkg.ads
best08618/asylo
7
17593
package Loop_Optimization11_Pkg is function Img (X : Integer) return String; procedure Put_Line (Data : String); type Prot is (Execute, Execute_Read, Execute_Read_Write); type Mem is (Mem_Image, Mem_Mapped, Mem_Private, Unknown); end Loop_Optimization11_Pkg;
programs/oeis/168/A168278.asm
neoneye/loda
22
95395
; A168278: (10*n + 5*(-1)^n + 3)/4. ; 2,7,7,12,12,17,17,22,22,27,27,32,32,37,37,42,42,47,47,52,52,57,57,62,62,67,67,72,72,77,77,82,82,87,87,92,92,97,97,102,102,107,107,112,112,117,117,122,122,127,127,132,132,137,137,142,142,147,147,152,152,157,157,162,162,167,167,172,172,177,177,182,182,187,187,192,192,197,197,202,202,207,207,212,212,217,217,222,222,227,227,232,232,237,237,242,242,247,247,252 mov $1,1 add $1,$0 div $1,2 mul $1,5 add $1,2 mov $0,$1
src/implementation/cl_gl/cl-queueing-cl_gl.adb
flyx/OpenCLAda
8
7254
-------------------------------------------------------------------------------- -- Copyright (c) 2013, <NAME> <<EMAIL>> -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provided that the above -- copyright notice and this permission notice appear in all copies. -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- with CL.Helpers; with CL.Enumerations; with CL.API.CL_GL; package body CL.Queueing.CL_GL is function Raw_Object_List is new Helpers.Raw_List_From_Polymorphic (Element_T => Memory.Memory_Object, Element_List_T => Memory.CL_GL.Object_List); function Raw_Event_List is new Helpers.Raw_List_From_Polymorphic (Element_T => Events.Event, Element_List_T => Events.Event_List); function Acquire_GL_Objects (Target_Queue : Command_Queues.CL_GL.Queue'Class; Objects : Memory.CL_GL.Object_List; Wait_For : access Events.Event_List) return Events.Event is Raw_Objects : Address_List := Raw_Object_List (Objects); Error : Enumerations.Error_Code; Ret_Event : aliased System.Address; begin if Wait_For /= null and then Wait_For.all'Length > 0 then declare Raw_Events : Address_List := Raw_Event_List (Wait_For.all); begin Error := API.CL_GL.Enqueue_Acquire_GL_Objects (Command_Queue => CL_Object (Target_Queue).Location, Num_Objects => Raw_Objects'Length, Object_List => Raw_Objects (1)'Unchecked_Access, Num_Events => Raw_Events'Length, Event_List => Raw_Events (1)'Unchecked_Access, Event => Ret_Event'Unchecked_Access); end; else Error := API.CL_GL.Enqueue_Acquire_GL_Objects (Command_Queue => CL_Object (Target_Queue).Location, Num_Objects => Raw_Objects'Length, Object_List => Raw_Objects (1)'Unchecked_Access, Num_Events => 0, Event_List => null, Event => Ret_Event'Unchecked_Access); end if; Helpers.Error_Handler (Error); return Events.Event'(Ada.Finalization.Controlled with Location => Ret_Event); end Acquire_GL_Objects; function Release_GL_Objects (Target_Queue : Command_Queues.CL_GL.Queue'Class; Objects : Memory.CL_GL.Object_List; Wait_For : access Events.Event_List) return Events.Event is Raw_Objects : Address_List := Raw_Object_List (Objects); Error : Enumerations.Error_Code; Ret_Event : aliased System.Address; begin if Wait_For /= null and then Wait_For.all'Length > 0 then declare Raw_Events : Address_List := Raw_Event_List (Wait_For.all); begin Error := API.CL_GL.Enqueue_Release_GL_Objects (Command_Queue => CL_Object (Target_Queue).Location, Num_Objects => Raw_Objects'Length, Object_List => Raw_Objects (1)'Unchecked_Access, Num_Events => Raw_Events'Length, Event_List => Raw_Events (1)'Unchecked_Access, Event => Ret_Event'Unchecked_Access); end; else Error := API.CL_GL.Enqueue_Release_GL_Objects (Command_Queue => CL_Object (Target_Queue).Location, Num_Objects => Raw_Objects'Length, Object_List => Raw_Objects (1)'Unchecked_Access, Num_Events => 0, Event_List => null, Event => Ret_Event'Unchecked_Access); end if; Helpers.Error_Handler (Error); return Events.Event'(Ada.Finalization.Controlled with Location => Ret_Event); end Release_GL_Objects; end CL.Queueing.CL_GL;
src/dos/Batbox.asm
TheBATeam/Batbox-3.1-by-DarkBatcher
1
160880
<gh_stars>1-10 org 100h FOR_RED=$4 FOR_BLUE=$1 FOR_GREEN=$2 BACK_BLUE=$10 BACK_GREEN=$20 BACK_RED=$40 BLINK=$80 INTENSITY=$8 mov ah,FOR_BLUE call BatBox_ScreenInit mov ah,09 mov dx,lpEnter int 21h mov cx,30 Print: mov si,lpMsg2 mov [iAttr],cl call BatBox_Puts loop Print mov ch,10 Print1: mov si,lpMsg mov [iAttr],ch call BatBox_Puts loop Print1 mov ax,4C00h int 21h lpEnter db $0d,$0a, $0d,$0a, $0d,$0a, $0d,$0a, $0d,$0a, $0d,$0a, '$' lpMsg db "hello world!",$0d,0 lpMsg2 db "bye world!",$0d,0 ; args : ax -> text attribute BatBox_ScreenInit: mov [lpPointer],0h mov [iLine],0h mov [iAttr],ah mov ax,03h int 10h ret BatBox_Puts: push $b800 pop es mov di,[lpPointer] __Puts_Loop: cmp byte [ds:si],$0d jnz __Puts_Next inc [iLine] mov al,160 mul byte [iLine] mov di,ax inc si __Puts_Next: cmp byte [ds:si],$0 jz __Puts_Loop_End cmp di,25*80*2 jb __Puts_Not_Zero xor di,di __Puts_Not_Zero: movsb mov al,[iAttr] ; bgri bgr blink stosb jmp __Puts_Loop __Puts_Loop_End: mov [lpPointer],di ret BatBox_Cls: lpPointer dw ? iLine db ? iAttr db ?
programs/oeis/192/A192920.asm
jmorken/loda
1
102929
; A192920: Coefficient of x in the reduction by (x^2 -> x+1) of the polynomial F(n+4)*x^n, where F=A000045 (Fibonacci sequence). ; 0,5,8,26,63,170,440,1157,3024,7922,20735,54290,142128,372101,974168,2550410,6677055,17480762,45765224,119814917,313679520,821223650,2149991423,5628750626,14736260448,38580030725,101003831720,264431464442,692290561599,1812440220362,4745030099480,12422650078085,32522920134768,85146110326226,222915410843903,583600122205490,1527884955772560,4000054745112197 mov $5,$0 mov $7,2 lpb $7 clr $0,5 mov $0,$5 sub $7,1 add $0,$7 sub $0,1 max $0,0 cal $0,80143 ; a(n) = F(3)*F(n)*F(n+1) + F(4)*F(n+1)^2 - F(4) if n even, F(3)*F(n)*F(n+1) + F(4)*F(n+1)^2 if n odd, where F(n) is the n-th Fibonacci number (A000045). mov $1,$0 add $1,3 trn $1,8 mov $1,$0 mov $1,$0 add $3,2 mov $4,$0 sub $4,$0 trn $4,$3 mul $3,2 mov $8,$7 cmp $8,1 mul $8,$0 add $6,$8 lpe min $5,1 mul $5,$1 mov $1,$6 sub $1,$5
file_system/relativePosixPath.applescript
adriannier/applescript-functions
7
4707
(* Examines two posix paths and returns the relative path that leads from the first path to the second. *) relativePosixPath("/Library/Desktop Pictures/", "/Library/Application Support/") on relativePosixPath(origin, destination) -- Break paths into components set prvDlmt to text item delimiters set text item delimiters to "/" set originPathComponents to text items of origin set destinationPathComponents to text items of destination set text item delimiters to prvDlmt -- Compare components of both paths and determine at which point they differ repeat with i from 1 to count of originPathComponents try if item i of originPathComponents is not item i of destinationPathComponents then exit repeat on error exit repeat end try end repeat -- If necessary, create a path prefix to go up the hierarchy set pathPrefix to "" repeat ((count of originPathComponents) - i) times set pathPrefix to pathPrefix & "../" end repeat if i > (count of destinationPathComponents) then -- Make sure we’re not out of bounds set i to count of destinationPathComponents end if -- Combine components set prvDlmt to text item delimiters set text item delimiters to "/" set relativePath to items i thru -1 of destinationPathComponents as text set text item delimiters to prvDlmt -- Return relative path return pathPrefix & relativePath end relativePosixPath