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
audio.asm
genterz/pokecross
28
246860
INCLUDE "constants.asm" SECTION "Audio", ROMX INCLUDE "audio/engine.asm" INCLUDE "data/trainers/encounter_music.asm" INCLUDE "audio/music_pointers.asm" INCLUDE "audio/music/nothing.asm" INCLUDE "audio/cry_pointers.asm" INCLUDE "audio/sfx_pointers.asm" SECTION "Songs 1", ROMX INCLUDE "audio/music/route36.asm" INCLUDE "audio/music/rivalbattle.asm" INCLUDE "audio/music/rocketbattle.asm" INCLUDE "audio/music/elmslab.asm" INCLUDE "audio/music/darkcave.asm" INCLUDE "audio/music/johtogymbattle.asm" INCLUDE "audio/music/championbattle.asm" INCLUDE "audio/music/ssaqua.asm" INCLUDE "audio/music/newbarktown.asm" INCLUDE "audio/music/goldenrodcity.asm" INCLUDE "audio/music/vermilioncity.asm" INCLUDE "audio/music/titlescreen.asm" INCLUDE "audio/music/ruinsofalphinterior.asm" INCLUDE "audio/music/lookpokemaniac.asm" INCLUDE "audio/music/trainervictory.asm" SECTION "Songs 2", ROMX INCLUDE "audio/music/route1.asm" INCLUDE "audio/music/route3.asm" INCLUDE "audio/music/route12.asm" INCLUDE "audio/music/kantogymbattle.asm" INCLUDE "audio/music/kantotrainerbattle.asm" INCLUDE "audio/music/kantowildbattle.asm" INCLUDE "audio/music/pokemoncenter.asm" INCLUDE "audio/music/looklass.asm" INCLUDE "audio/music/lookofficer.asm" INCLUDE "audio/music/route2.asm" INCLUDE "audio/music/mtmoon.asm" INCLUDE "audio/music/showmearound.asm" INCLUDE "audio/music/gamecorner.asm" INCLUDE "audio/music/bicycle.asm" INCLUDE "audio/music/looksage.asm" INCLUDE "audio/music/pokemonchannel.asm" INCLUDE "audio/music/lighthouse.asm" INCLUDE "audio/music/lakeofrage.asm" INCLUDE "audio/music/indigoplateau.asm" INCLUDE "audio/music/route37.asm" INCLUDE "audio/music/rockethideout.asm" INCLUDE "audio/music/dragonsden.asm" INCLUDE "audio/music/ruinsofalphradio.asm" INCLUDE "audio/music/lookbeauty.asm" INCLUDE "audio/music/route26.asm" INCLUDE "audio/music/ecruteakcity.asm" INCLUDE "audio/music/lakeofragerocketradio.asm" INCLUDE "audio/music/magnettrain.asm" INCLUDE "audio/music/lavendertown.asm" INCLUDE "audio/music/dancinghall.asm" INCLUDE "audio/music/contestresults.asm" INCLUDE "audio/music/route30.asm" SECTION "Songs 3", ROMX INCLUDE "audio/music/violetcity.asm" INCLUDE "audio/music/route29.asm" INCLUDE "audio/music/halloffame.asm" INCLUDE "audio/music/healpokemon.asm" INCLUDE "audio/music/evolution.asm" INCLUDE "audio/music/printer.asm" SECTION "Songs 4", ROMX INCLUDE "audio/music/viridiancity.asm" INCLUDE "audio/music/celadoncity.asm" INCLUDE "audio/music/wildpokemonvictory.asm" INCLUDE "audio/music/successfulcapture.asm" INCLUDE "audio/music/gymleadervictory.asm" INCLUDE "audio/music/mtmoonsquare.asm" INCLUDE "audio/music/gym.asm" INCLUDE "audio/music/pallettown.asm" INCLUDE "audio/music/profoakspokemontalk.asm" INCLUDE "audio/music/profoak.asm" INCLUDE "audio/music/lookrival.asm" INCLUDE "audio/music/aftertherivalfight.asm" INCLUDE "audio/music/surf.asm" INCLUDE "audio/music/nationalpark.asm" INCLUDE "audio/music/azaleatown.asm" INCLUDE "audio/music/cherrygrovecity.asm" INCLUDE "audio/music/unioncave.asm" INCLUDE "audio/music/johtowildbattle.asm" INCLUDE "audio/music/johtowildbattlenight.asm" INCLUDE "audio/music/johtotrainerbattle.asm" INCLUDE "audio/music/lookyoungster.asm" INCLUDE "audio/music/tintower.asm" INCLUDE "audio/music/sprouttower.asm" INCLUDE "audio/music/burnedtower.asm" INCLUDE "audio/music/mom.asm" INCLUDE "audio/music/victoryroad.asm" INCLUDE "audio/music/pokemonlullaby.asm" INCLUDE "audio/music/pokemonmarch.asm" INCLUDE "audio/music/goldsilveropening.asm" INCLUDE "audio/music/goldsilveropening2.asm" INCLUDE "audio/music/lookhiker.asm" INCLUDE "audio/music/lookrocket.asm" INCLUDE "audio/music/rockettheme.asm" INCLUDE "audio/music/mainmenu.asm" INCLUDE "audio/music/lookkimonogirl.asm" INCLUDE "audio/music/pokeflutechannel.asm" INCLUDE "audio/music/bugcatchingcontest.asm" SECTION "Songs 5", ROMX INCLUDE "audio/music/mobileadaptermenu.asm" INCLUDE "audio/music/buenaspassword.asm" INCLUDE "audio/music/lookmysticalman.asm" INCLUDE "audio/music/crystalopening.asm" INCLUDE "audio/music/battletowertheme.asm" INCLUDE "audio/music/suicunebattle.asm" INCLUDE "audio/music/battletowerlobby.asm" INCLUDE "audio/music/mobilecenter.asm" SECTION "Extra Songs 1", ROMX INCLUDE "audio/music/credits.asm" INCLUDE "audio/music/clair.asm" INCLUDE "audio/music/mobileadapter.asm" SECTION "Extra Songs 2", ROMX INCLUDE "audio/music/postcredits.asm" SECTION "Sound Effects", ROMX INCLUDE "audio/sfx.asm" SECTION "Crystal Sound Effects", ROMX INCLUDE "audio/sfx_crystal.asm" SECTION "Cries", ROMX INCLUDE "data/pokemon/cries.asm" INCLUDE "audio/cries.asm"
programs/oeis/279/A279847.asm
neoneye/loda
22
241180
; A279847: a(n) = Sum_{k=1..n} k^2*(floor(n/k) - 1). ; 0,1,2,7,8,22,23,44,54,84,85,151,152,206,241,326,327,458,459,605,664,790,791,1065,1091,1265,1356,1622,1623,2023,2024,2365,2496,2790,2865,3480,3481,3847,4026,4636,4637,5373,5374,6000,6341,6875,6876,7982,8032,8787,9086,9952,9953,11137,11284 mov $2,$0 mov $3,$0 lpb $2 mov $0,$3 sub $2,1 sub $0,$2 seq $0,67558 ; Sum of squares of proper divisors of n. add $1,$0 lpe mov $0,$1
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48_notsx.log_5_1479.asm
ljhsiun2/medusa
9
170661
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r13 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_D_ht+0x4dd1, %rsi lea addresses_UC_ht+0x2c71, %rdi dec %r12 mov $96, %rcx rep movsw nop xor %rsi, %rsi lea addresses_A_ht+0xe82d, %rsi lea addresses_normal_ht+0x7769, %rdi clflush (%rdi) nop nop nop nop nop and %rax, %rax mov $99, %rcx rep movsb nop xor %rsi, %rsi lea addresses_A_ht+0x37f1, %rsi nop nop and $19822, %rbp movb $0x61, (%rsi) nop nop nop nop xor $3123, %r12 lea addresses_WT_ht+0xc4b1, %rsi lea addresses_A_ht+0x144b1, %rdi add $60762, %r13 mov $53, %rcx rep movsb nop nop nop nop dec %rsi lea addresses_WC_ht+0x22b1, %rdi nop sub $8875, %rsi vmovups (%rdi), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $0, %xmm4, %rbp nop nop add $7084, %r12 lea addresses_WC_ht+0x130ef, %r13 clflush (%r13) nop nop nop nop add %rax, %rax mov (%r13), %rsi nop dec %rbp lea addresses_WC_ht+0x1d8b1, %rsi nop nop nop nop inc %r13 movb $0x61, (%rsi) nop nop nop and $51521, %r13 lea addresses_A_ht+0x2e71, %rsi lea addresses_WT_ht+0x8bb1, %rdi nop nop add $27212, %r10 mov $15, %rcx rep movsl add $3700, %rsi lea addresses_WT_ht+0x13acd, %rsi lea addresses_normal_ht+0x110c9, %rdi nop nop nop nop xor $4937, %rax mov $60, %rcx rep movsb nop nop nop xor %rbp, %rbp lea addresses_UC_ht+0x5cb5, %rsi lea addresses_UC_ht+0xa259, %rdi nop nop nop nop sub %r13, %r13 mov $55, %rcx rep movsl nop dec %r10 lea addresses_A_ht+0x4335, %rsi lea addresses_UC_ht+0xdbb1, %rdi nop nop dec %r13 mov $24, %rcx rep movsl and $35432, %r10 lea addresses_D_ht+0x6507, %r12 add $35923, %rbp mov $0x6162636465666768, %rsi movq %rsi, %xmm0 and $0xffffffffffffffc0, %r12 vmovaps %ymm0, (%r12) nop nop nop add $44263, %rsi lea addresses_UC_ht+0x58b1, %rsi lea addresses_UC_ht+0x1bd31, %rdi nop nop nop dec %r13 mov $105, %rcx rep movsw nop nop nop add %rsi, %rsi lea addresses_WT_ht+0x104b1, %rsi lea addresses_normal_ht+0xf551, %rdi nop and $25328, %r10 mov $41, %rcx rep movsq xor $20741, %rcx lea addresses_D_ht+0x2eb1, %rsi nop nop nop add %rdi, %rdi movl $0x61626364, (%rsi) nop nop and %rbp, %rbp pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %rbp push %rbx push %rcx push %rdi push %rdx // Faulty Load lea addresses_US+0x1c8b1, %rdi nop nop xor %rdx, %rdx mov (%rdi), %rbx lea oracles, %rbp and $0xff, %rbx shlq $12, %rbx mov (%rbp,%rbx,1), %rbx pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_US', 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': True, 'size': 8, 'type': 'addresses_US', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}} {'dst': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A_ht', 'congruent': 1}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 10, 'type': 'addresses_WT_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WC_ht', 'congruent': 6}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC_ht', 'congruent': 1}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WC_ht', 'congruent': 10}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}} {'dst': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 1, 'type': 'addresses_WT_ht'}} {'dst': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}} {'dst': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 32, 'type': 'addresses_D_ht', 'congruent': 1}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}} {'dst': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_WT_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_D_ht', 'congruent': 9}, 'OP': 'STOR'} {'00': 5} 00 00 00 00 00 */
libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sdcc/tan.asm
ahjelm/z88dk
640
171893
SECTION code_fp_am9511 PUBLIC _tan EXTERN cam32_sdcc_tan defc _tan = cam32_sdcc_tan
Transynther/x86/_processed/NC/_zr_/i3-7100_9_0xca_notsx.log_230_755.asm
ljhsiun2/medusa
9
173450
.global s_prepare_buffers s_prepare_buffers: push %r14 push %r9 push %rcx push %rsi lea addresses_UC_ht+0x5ad8, %rcx nop nop nop nop add $42227, %r9 mov $0x6162636465666768, %r14 movq %r14, (%rcx) nop nop nop nop nop inc %rsi pop %rsi pop %rcx pop %r9 pop %r14 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r15 push %r9 push %rcx push %rsi // Faulty Load mov $0x10628d0000000048, %rcx clflush (%rcx) nop sub %rsi, %rsi vmovups (%rcx), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $0, %xmm0, %r11 lea oracles, %r9 and $0xff, %r11 shlq $12, %r11 mov (%r9,%r11,1), %r11 pop %rsi pop %rcx pop %r9 pop %r15 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False}} {'00': 230} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
MSDOS/Virus.MSDOS.Unknown.ambul3.asm
fengjixuchui/Family
3
171340
;NAME: AMBUL3.C-M ;FILE SIZE: 00330h - 816d ;START (CS:IP): 00100h ;CODE END: 00430h ;CODE ORIGIN: 00100h ;DATE: Sun Aug 16 15:45:06 1992 CODE SEGMENT BYTE PUBLIC 'CODE' ASSUME CS:CODE,DS:CODE,ES:NOTHING,SS:NOTHING P00100 PROC ORG 0100h H00100: JMP H00114 ;00100 E91100 ___ ;Will be overwritten with B4 09 BA-- MOV AH,09 and MOV DX ;--------------------------------------------------- OR [BX+DI],AX ;00103 0901 __ ;DX gets this, location of string. INT 21h ;Indef_INT:21h-AH ;00105 CD21 _! INT 20h ;B-TERM_norm:20h ;00107 CD20 _ ;--------------------------------------------------- DB "Infect me!$" ;00109 496E6665637420 ;--------------------------------------------------- H00114: CALL H00118 ; . . . . . . . . . ;00114 E80100 ___ ADD [BP-7Fh],BX ;00117 015E81 _^_ OUT DX,AL ;Port_OUT:DX ;0011A EE _ ADD AX,[BX+DI] ;0011B 0301 __ CALL H0013A ; . . . . . . . . . ;0011D E81A00 ___ CALL H0013A ; . . . . . . . . . ;00120 E81700 ___ CALL H002F8 ; . . . . . . . . . ;00123 E8D201 ___ LEA BX,[SI+0419h] ;00126 8D9C1904 ____ MOV DI,0100h ;0012A BF0001 ___ MOV AL,[BX] ;0012D 8A07 __ MOV [DI],AL ;0012F 8805 __ MOV AX,[BX+01h] ;00131 8B4701 _G_ MOV [DI+01h],AX ;00134 894501 _E_ JMP DI ;00137 FFE7 __ ;--------------------------------------------------- RET ;RET_Near ;00139 C3 _ ;--------------------------------------------------- H0013A: CALL H0021B ; . . . . . . . . . ;0013A E8DE00 ___ MOV AL,[SI+0428h] ;0013D 8A842804 __(_ OR AL,AL ;00141 0AC0 __ JZ H00139 ;00143 74F4 t_ LEA BX,[SI+040Fh] ;00145 8D9C0F04 ____ INC Word Ptr [BX] ;00149 FF07 __ LEA DX,[SI+0428h] ;0014B 8D942804 __(_ MOV AX,3D02h ;0014F B8023D __= INT 21h ;2-Open_Fl_Hdl ;00152 CD21 _! MOV [SI+0417h],AX ;00154 89841704 ____ MOV BX,[SI+0417h] ;00158 8B9C1704 ____ MOV CX,0003h ;0015C B90300 ___ LEA DX,[SI+0414h] ;0015F 8D941404 ____ MOV AH,3Fh ;00163 B43F _? INT 21h ;2-Rd_Fl_Hdl ;00165 CD21 _! MOV AL,[SI+0414h] ;00167 8A841404 ____ CMP AL,0E9h ;0016B 3CE9 <_ JNZ H001AE ;0016D 753F u? MOV DX,[SI+0415h] ;0016F 8B941504 ____ MOV BX,[SI+0417h] ;00173 8B9C1704 ____ ADD DX,+03h ;00177 83C203 ___ XOR CX,CX ;0017A 33C9 3_ MOV AX,4200h ;0017C B80042 __B INT 21h ;2-Mov_Fl_Hdl_Ptr ;0017F CD21 _! MOV BX,[SI+0417h] ;00181 8B9C1704 ____ MOV CX,0006h ;00185 B90600 ___ LEA DX,[SI+041Ch] ;00188 8D941C04 ____ MOV AH,3Fh ;0018C B43F _? INT 21h ;2-Rd_Fl_Hdl ;0018E CD21 _! MOV AX,[SI+041Ch] ;00190 8B841C04 ____ MOV BX,[SI+041Eh] ;00194 8B9C1E04 ____ MOV CX,[SI+0420h] ;00198 8B8C2004 __ _ CMP AX,[SI+0100h] ;0019C 3B840001 ;___ JNZ H001AE ;001A0 750C u_ CMP BX,[SI+0102h] ;001A2 3B9C0201 ;___ JNZ H001AE ;001A6 7506 u_ CMP CX,[SI+0104h] ;001A8 3B8C0401 ;___ JZ H00212 ;001AC 7464 td H001AE: MOV BX,[SI+0417h] ;001AE 8B9C1704 ____ XOR CX,CX ;001B2 33C9 3_ XOR DX,DX ;001B4 33D2 3_ MOV AX,4202h ;001B6 B80242 __B INT 21h ;2-Mov_Fl_Hdl_Ptr ;001B9 CD21 _! SUB AX,0003h ;001BB 2D0300 -__ MOV [SI+0412h],AX ;001BE 89841204 ____ MOV BX,[SI+0417h] ;001C2 8B9C1704 ____ MOV AX,5700h ;001C6 B80057 __W INT 21h ;2-Fl_Hdl_Date_Time ;001C9 CD21 _! PUSH CX ;001CB 51 Q PUSH DX ;001CC 52 R MOV BX,[SI+0417h] ;001CD 8B9C1704 ____ MOV CX,0319h ;001D1 B91903 ___ LEA DX,[SI+0100h] ;001D4 8D940001 ____ MOV AH,40h ;001D8 B440 _@ INT 21h ;2-Wr_Fl_Hdl ;001DA CD21 _! MOV BX,[SI+0417h] ;001DC 8B9C1704 ____ MOV CX,0003h ;001E0 B90300 ___ LEA DX,[SI+0414h] ;001E3 8D941404 ____ MOV AH,40h ;001E7 B440 _@ INT 21h ;2-Wr_Fl_Hdl ;001E9 CD21 _! MOV BX,[SI+0417h] ;001EB 8B9C1704 ____ XOR CX,CX ;001EF 33C9 3_ XOR DX,DX ;001F1 33D2 3_ MOV AX,4200h ;001F3 B80042 __B INT 21h ;2-Mov_Fl_Hdl_Ptr ;001F6 CD21 _! MOV BX,[SI+0417h] ;001F8 8B9C1704 ____ MOV CX,0003h ;001FC B90300 ___ LEA DX,[SI+0411h] ;001FF 8D941104 ____ MOV AH,40h ;00203 B440 _@ INT 21h ;2-Wr_Fl_Hdl ;00205 CD21 _! POP DX ;00207 5A Z POP CX ;00208 59 Y MOV BX,[SI+0417h] ;00209 8B9C1704 ____ MOV AX,5701h ;0020D B80157 __W INT 21h ;2-Fl_Hdl_Date_Time ;00210 CD21 _! H00212: MOV BX,[SI+0417h] ;00212 8B9C1704 ____ MOV AH,3Eh ;00216 B43E _> INT 21h ;2-Close_Fl_Hdl ;00218 CD21 _! RET ;RET_Near ;0021A C3 _ ;--------------------------------------------------- H0021B: MOV AX,DS:[002Ch] ;0021B A12C00 _,_ MOV ES,AX ;ES_Chg ;0021E 8EC0 __ PUSH DS ;00220 1E _ MOV AX,0040h ;00221 B84000 _@_ MOV DS,AX ;DS_Chg ;00224 8ED8 __ MOV BP,DS:[006Ch] ;00226 8B2E6C00 _.l_ POP DS ;0022A 1F _ TEST BP,0003h ;0022B F7C50300 ____ JZ H00248 ;0022F 7417 t_ XOR BX,BX ;00231 33DB 3_ MOV AX,ES:[BX] ;ES_Ovrd ;00233 268B07 &__ CMP AX,4150h ;00236 3D5041 =PA JNZ H00243 ;00239 7508 u_ CMP Word Ptr ES:[BX+02h],4854h ;ES_Ovrd ;0023B 26817F025448 &___TH JZ H0024E ;00241 740B t_ H00243: INC BX ;00243 43 C OR AX,AX ;00244 0BC0 __ JNZ H00233 ;00246 75EB u_ H00248: LEA DI,[SI+0428h] ;00248 8DBC2804 __(_ JMP Short H00280 ;0024C EB32 _2 ;--------------------------------------------------- H0024E: ADD BX,+05h ;0024E 83C305 ___ LEA DI,[SI+0428h] ;00251 8DBC2804 __(_ MOV AL,ES:[BX] ;ES_Ovrd ;00255 268A07 &__ INC BX ;00258 43 C OR AL,AL ;00259 0AC0 __ JZ H00276 ;0025B 7419 t_ CMP AL,3Bh ;0025D 3C3B <; JZ H00266 ;0025F 7405 t_ MOV [DI],AL ;00261 8805 __ INC DI ;00263 47 G JMP Short H00255 ;00264 EBEF __ ;--------------------------------------------------- H00266: CMP Byte Ptr ES:[BX],00h ;ES_Ovrd ;00266 26803F00 &_?_ JZ H00276 ;0026A 740A t_ SHR BP,1 ;0026C D1ED __ SHR BP,1 ;0026E D1ED __ TEST BP,0003h ;00270 F7C50300 ____ JNZ H00251 ;00274 75DB u_ H00276: CMP Byte Ptr [DI-01h],5Ch ;00276 807DFF5C _}_\ JZ H00280 ;0027A 7404 t_ MOV Byte Ptr [DI],5Ch ;0027C C6055C __\ INC DI ;0027F 47 G H00280: PUSH DS ;00280 1E _ POP ES ;00281 07 _ MOV [SI+0422h],DI ;00282 89BC2204 __"_ ;********* Put "*.COM" at ES:DI MOV AX,2E2Ah ;00286 B82A2E _*. STOSW ;00289 AB _ MOV AX,4F43h ;0028A B8434F _CO STOSW ;0028D AB _ MOV AX,004Dh ;0028E B84D00 _M_ STOSW ;00291 AB _ ;********** PUSH ES ;00292 06 _ MOV AH,2Fh ;00293 B42F _/ INT 21h ;2-Get_DTA ;00295 CD21 _! MOV AX,ES ;00297 8CC0 __ MOV [SI+0424h],AX ;00299 89842404 __$_ MOV [SI+0426h],BX ;0029D 899C2604 __&_ POP ES ;002A1 07 _ LEA DX,[SI+0478h] ;002A2 8D947804 __x_ MOV AH,1Ah ;002A6 B41A __ INT 21h ;1-Set_DTA ;002A8 CD21 _! LEA DX,[SI+0428h] ;002AA 8D942804 __(_ XOR CX,CX ;002AE 33C9 3_ MOV AH,4Eh ;002B0 B44E _N INT 21h ;2-Srch_1st_Fl_Hdl ;002B2 CD21 _! JNB H002BE ;002B4 7308 s_ XOR AX,AX ;002B6 33C0 3_ MOV [SI+0428h],AX ;002B8 89842804 __(_ JMP Short H002E7 ;002BC EB29 _) ;--------------------------------------------------- H002BE: PUSH DS ;002BE 1E _ MOV AX,0040h ;002BF B84000 _@_ MOV DS,AX ;DS_Chg ;002C2 8ED8 __ ROR BP,1 ;002C4 D1CD __ XOR BP,DS:[006Ch] ;002C6 332E6C00 3.l_ POP DS ;002CA 1F _ TEST BP,0007h ;002CB F7C50700 ____ JZ H002D7 ;002CF 7406 t_ MOV AH,4Fh ;002D1 B44F _O INT 21h ;2-Srch_Nxt_Fl_Hdl ;002D3 CD21 _! JNB H002BE ;002D5 73E7 s_ H002D7: MOV DI,[SI+0422h] ;002D7 8BBC2204 __"_ LEA BX,[SI+0496h] ;002DB 8D9C9604 ____ MOV AL,[BX] ;002DF 8A07 __ INC BX ;002E1 43 C STOSB ;002E2 AA _ OR AL,AL ;002E3 0AC0 __ JNZ H002DF ;002E5 75F8 u_ H002E7: MOV BX,[SI+0426h] ;002E7 8B9C2604 __&_ MOV AX,[SI+0424h] ;002EB 8B842404 __$_ PUSH DS ;002EF 1E _ MOV DS,AX ;DS_Chg ;002F0 8ED8 __ MOV AH,1Ah ;002F2 B41A __ INT 21h ;1-Set_DTA ;002F4 CD21 _! POP DS ;002F6 1F _ RET ;RET_Near ;002F7 C3 _ ;--------------------------------------------------- H002F8: PUSH ES ;002F8 06 _ MOV AX,[SI+040Fh] ;002F9 8B840F04 ____ AND AX,0007h ;002FD 250700 %__ CMP AX,0006h ;00300 3D0600 =__ JNZ H0031A ;00303 7515 u_ MOV AX,0040h ;00305 B84000 _@_ MOV ES,AX ;ES_Chg ;00308 8EC0 __ MOV AX,ES:[000Ch] ;ES_Ovrd ;0030A 26A10C00 &___ OR AX,AX ;0030E 0BC0 __ JNZ H0031A ;00310 7508 u_ INC Word Ptr ES:[000Ch] ;ES_Ovrd ;00312 26FF060C00 &____ CALL H0031C ; . . . . . . . . . ;00317 E80200 ___ H0031A: POP ES ;0031A 07 _ RET ;RET_Near ;0031B C3 _ ;--------------------------------------------------- H0031C: PUSH DS ;0031C 1E _ MOV DI,0B800h ;0031D BF00B8 ___ MOV AX,0040h ;00320 B84000 _@_ MOV DS,AX ;DS_Chg ;00323 8ED8 __ MOV AL,DS:[0049h] ;00325 A04900 _I_ CMP AL,07h ;00328 3C07 <_ JNZ H0032F ;0032A 7503 u_ MOV DI,0B000h ;0032C BF00B0 ___ H0032F: MOV ES,DI ;ES_Chg ;0032F 8EC7 __ POP DS ;00331 1F _ MOV BP,0FFF0h ;00332 BDF0FF ___ MOV DX,0000h ;00335 BA0000 ___ MOV CX,0010h ;00338 B91000 ___ CALL H0037D ; . . . . . . . . . ;0033B E83F00 _?_ INC DX ;0033E 42 B LOOP H0033B ;0033F E2FA __ CALL H0035A ; . . . . . . . . . ;00341 E81600 ___ CALL H003C2 ; . . . . . . . . . ;00344 E87B00 _{_ INC BP ;00347 45 E CMP BP,+50h ;00348 83FD50 __P JNZ H00335 ;0034B 75E8 u_ CALL SILENC ; . . . . . . . . . ;0034D E80300 ___ PUSH DS ;00350 1E _ POP ES ;00351 07 _ RET ;RET_Near ;00352 C3 _ ;--------------------------------------------------- ;********** Silence speaker SILENC: IN AL,61h ;Port_IN:61h ;00353 E461 _a AND AL,0FCh ;00355 24FC $_ OUT 61h,AL ;Port_OUT:61h ;00357 E661 _a RET ;RET_Near ;00359 C3 _ ;--------------------------------------------------- H0035A: MOV DX,07D0h ;0035A BAD007 ___ TEST BP,0004h ;0035D F7C50400 ____ JZ H00366 ;00361 7403 t_ MOV DX,0BB8h ;00363 BAB80B ___ H00366: IN AL,61h ;Port_IN:61h ;00366 E461 _a TEST AL,03h ;00368 A803 __ JNZ H00374 ;0036A 7508 u_ OR AL,03h ;0036C 0C03 __ OUT 61h,AL ;Port_OUT:61h ;0036E E661 _a MOV AL,0B6h ;00370 B0B6 __ OUT 43h,AL ;Port_OUT:43h ;00372 E643 _C H00374: MOV AX,DX ;00374 8BC2 __ OUT 42h,AL ;Port_OUT:42h ;00376 E642 _B MOV AL,AH ;00378 88E0 __ OUT 42h,AL ;Port_OUT:42h ;0037A E642 _B RET ;RET_Near ;0037C C3 _ ;--------------------------------------------------- H0037D: PUSH CX ;0037D 51 Q PUSH DX ;0037E 52 R LEA BX,[SI+03BFh] ;0037F 8D9CBF03 ____ ADD BX,DX ;00383 03DA __ ADD DX,BP ;00385 01EA __ OR DX,DX ;00387 0BD2 __ JS H003BF ;00389 7834 x4 CMP DX,+50h ;0038B 83FA50 __P JNB H003BF ;0038E 732F s/ MOV DI,0C80h ;00390 BF800C ___ ADD DI,DX ;00393 03FA __ ADD DI,DX ;00395 03FA __ SUB DX,BP ;00397 29EA )_ MOV CX,0005h ;00399 B90500 ___ MOV AH,07h ;0039C B407 __ MOV AL,[BX] ;0039E 8A07 __ SUB AL,07h ;003A0 2C07 ,_ ADD AL,CL ;003A2 02C1 __ SUB AL,DL ;003A4 28D0 (_ CMP CX,+05h ;003A6 83F905 ___ JNZ H003B5 ;003A9 750A u_ MOV AH,0Fh ;003AB B40F __ TEST BP,0003h ;003AD F7C50300 ____ JZ H003B5 ;003B1 7402 t_ MOV AL,20h ;003B3 B020 _ H003B5: STOSW ;003B5 AB _ ADD BX,+10h ;003B6 83C310 ___ ADD DI,009Eh ;003B9 81C79E00 ____ LOOP H0039C ;003BD E2DD __ H003BF: POP DX ;003BF 5A Z POP CX ;003C0 59 Y RET ;RET_Near ;003C1 C3 _ ;--------------------------------------------------- H003C2: PUSH DS ;003C2 1E _ MOV AX,0040h ;003C3 B84000 _@_ MOV DS,AX ;DS_Chg ;003C6 8ED8 __ MOV AX,DS:[006Ch] ;003C8 A16C00 _l_ CMP AX,DS:[006Ch] ;003CB 3B066C00 ;_l_ JZ H003CB ;003CF 74FA t_ POP DS ;003D1 1F _ RET ;RET_Near ;003D2 C3 _ ;--------------------------------------------------- DB '"' ;003D3 22 ;--------------------------------------------------- AND SP,[SI] ;SP_Chg ;003D4 2324 #$ AND AX,2726h ;003D6 252627 %&' SUB [BX+DI],CH ;003D9 2829 () DB 66h ;Indef_OP:66h ;003DB 66 f ;--------------------------------------------------- XCHG DI,[BP+DI] ;003DC 873B _; SUB AX,2F2Eh ;003DE 2D2E2F -./ XOR [BX+DI],DH ;003E1 3031 01 AND SP,AX ;SP_Chg ;003E3 23E0 #_ LOOPZ H003C9 ;003E5 E1E2 __ JCXZ H003CD ;003E7 E3E4 __ IN AX,0E6h ;Port_IN:E6h ;003E9 E5E6 __ OUT 0E7h,AX ;Port_OUT:E7h ;003EB E7E7 __ JMP H0EFDA ;003ED E9EAEB ___ ;--------------------------------------------------- XOR [BX+DI],DH ;003F0 3031 01 XOR AH,[SI] ;003F2 3224 2$ LOOPNZ H003D7 ;003F4 E0E1 __ LOOP H003DB ;003F6 E2E3 __ CALL H0EE25 ; . . . . . . . . . ;003F8 E82AEA _*_ OUT 0E8h,AX ;Port_OUT:E8h ;003FB E7E8 __ JMP H0342F ;003FD E92F30 _/0 ;--------------------------------------------------- DB 6Dh ;286_INSW ;00400 6D m ;--------------------------------------------------- XOR DH,[BP+DI] ;00401 3233 23 AND AX,0E2E1h ;00403 25E1E2 %__ JCXZ H003EC ;00406 E3E4 __ IN AX,0E7h ;Port_IN:E7h ;00408 E5E7 __ OUT 0E8h,AX ;Port_OUT:E8h ;0040A E7E8 __ JMP H0EFF9 ;0040C E9EAEB ___ ;--------------------------------------------------- IN AL,DX ;Port_IN:DX ;0040F EC _ IN AX,DX ;Port_IN:DX ;00410 ED _ OUT DX,AL ;Port_OUT:DX ;00411 EE _ OUT DX,AX ;Port_OUT:DX ;00412 EF _ OUT 0E7h,AL ;ES_Ovrd ;00413 26E6E7 &__ SUB [BX+DI+5Ah],BX ;00416 29595A )YZ SUB AL,0ECh ;00419 2CEC ,_ IN AX,DX ;Port_IN:DX ;0041B ED _ OUT DX,AL ;Port_OUT:DX ;0041C EE _ OUT DX,AX ;Port_OUT:DX ;0041D EF _ DB 0F0h ;LOCK:F0h ;0041E F0 _ XOR AH,[BP+SI+34] ;0041F 326234 2b4 ;--------------------------------------------------- HLT ;SYSTEM_HALT ;00422 F4 _ OR AL,[BX+SI] ;00423 0A00 __ JMP H00439 ;00425 E91100 ___ ;--------------------------------------------------- DB 0B4h, 09h, 0BAh ;First three bytes ;00428 DB 05,00 ;Dunno ;0042B DB 0B4h, 09h, 0BAh ;First three bytes ;0042D ;AGAIN! Wierd P00100 ENDP CODE ENDS END H00100 ;-------------------------------------------------------------------------------
uw2/movementKeys.asm
JohnGlassmyer/UltimaHacks
68
83833
%include "../UltimaPatcher.asm" %include "include/uw2.asm" defineAddress 37, 0x0202, considerShiftStates defineAddress 37, 0x024A, beginMovementKeyLoop defineAddress 37, 0x026A, interpretScancode defineAddress 37, 0x0344, nextMovementKey defineAddress 37, 0x034D, endOfProc %include "../uw1/movementKeys.asm"
src/arch/x86_64/long_mode_init.asm
analyst1001/snake_game
0
175697
;; Code has been used from Phil<NAME>permann's blog ;; @ https://os.phil-opp.com/ ;; Copyright (c) 2019 <NAME> global long_mode_start STRING_OKAY: equ 0x2f592f412f4b2f4f VGA_BUFFER_START: equ 0xb8000 section .text ; We should have enabled 64-bit long mode by now bits 64 long_mode_start: call reset_segment_registers ; 64 bits allow putting 8 bytes in one go! mov rax, STRING_OKAY mov [VGA_BUFFER_START], rax extern rust_main call rust_main ; Call Rust function now that we are in 64-bit long mode ; 64 bits allow putting 8 bytes in one go! mov rax, STRING_OKAY mov [VGA_BUFFER_START+8], rax hlt ; reset segment registers other than CS to prevent issue in future reset_segment_registers: mov ax, 0 mov ss, ax mov ds, ax mov es, ax mov fs, ax mov gs, ax ret
polynomial/clenshaw/chebychev_quadrature.adb
jscparker/math_packages
30
360
<filename>polynomial/clenshaw/chebychev_quadrature.adb ----------------------------------------------------------------------- -- package body Chebychev_Quadrature. Coefficients for Chebychev-Gaussian quadrature. -- Copyright (C) 2018 <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. --------------------------------------------------------------------------- package body Chebychev_Quadrature is Pii : constant := 3.14159_26535_89793_23846_26433_83279_50288_41971_694; Gauss_Root : Gauss_Values := (others => 0.0); Gauss_Weight : Gauss_Values := (others => 0.0); -- Arrays initialized after the "begin" below. --------------------------- -- Construct_Gauss_Roots -- --------------------------- procedure Construct_Gauss_Roots is Factor : constant Real := Pii / Real (Gauss_Index'Last); begin for i in Gauss_Index loop Gauss_Root (i) := -Cos (Factor * (Real (i) - 0.5)); end loop; end Construct_Gauss_Roots; ----------------------------- -- Construct_Gauss_Weights -- ----------------------------- procedure Construct_Gauss_Weights is Factor : constant Real := Pii / Real (Gauss_Index'Last); begin for i in Gauss_Index loop Gauss_Weight (i) := 0.5 * Factor * Abs (Sin (Factor * (Real (i) - 0.5))); end loop; end Construct_Gauss_Weights; ---------------------- -- Find_Gauss_Nodes -- ---------------------- procedure Find_Gauss_Nodes (X_Starting : in Real; X_Final : in Real; X_gauss : out Gauss_Values) is Half_Delta_X : constant Real := (X_Final - X_Starting) * 0.5; X_Center : constant Real := X_Starting + Half_Delta_X; begin for i in Gauss_Index loop X_gauss(i) := X_Center + Gauss_Root(i) * Half_Delta_X; end loop; end Find_Gauss_Nodes; ------------------ -- Get_Integral -- ------------------ procedure Get_Integral (F_val : in Function_Values; X_Starting : in Real; X_Final : in Real; Area : out Real) is Sum : Real; Delta_X : constant Real := (X_Final - X_Starting); begin Area := 0.0; Sum := 0.0; for i in Gauss_Index loop Sum := Sum + Gauss_Weight (i) * F_val (i); end loop; Area := Sum * Delta_X; end Get_Integral; begin Construct_Gauss_Roots; Construct_Gauss_Weights; end Chebychev_Quadrature;
bb-runtimes/examples/sam4s-xplained/tetris/tetris.ads
JCGobbi/Nucleo-STM32G474RE
0
24255
<gh_stars>0 ------------------------------------------------------------------------------ -- -- -- GNAT EXAMPLE -- -- -- -- Copyright (C) 2014-2015, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package Tetris with SPARK_Mode is -- possible content of the board cells type Cell is (Empty, I, O, J, L, S, T, Z); -- subset of cells that correspond to a shape subtype Shape is Cell range I .. Z; -- subset of shapes that fits in a 3 x 3 box, that is, all except I and O subtype Three_Shape is Cell range J .. Z; -- the board is a matrix of X_Size x Y_Size cells, where the origin (1,1) -- is at the top left corner X_Size : constant := 10; Y_Size : constant := 38; subtype X_Coord is Integer range 1 .. X_Size; subtype Y_Coord is Integer range 1 .. Y_Size; type Line is array (X_Coord) of Cell; type Board is array (Y_Coord) of Line; Cur_Board : Board; -- the current piece has a shape, a direction, and a coordinate for the -- top left corner of the square box enclosing the piece: -- a 2 x 2 box for shape O -- a 3 x 3 box for all shapes except I and O -- a 4 x 4 box for shape I subtype PX_Coord is Integer range -1 .. X_Size - 1; subtype PY_Coord is Integer range -1 .. Y_Size - 1; type Direction is (North, East, South, West); type Piece is record S : Shape; D : Direction; X : PX_Coord; Y : PY_Coord; end record; Cur_Piece : Piece; -- the game loops through the following states: -- . a piece is falling, in which case Cur_Piece is set to this piece -- . the piece Cur_Piece is blocked by previous fallen pieces in the -- board Cur_Board -- . the piece has been included in the board, which may contain complete -- lines that need to be deleted -- . complete lines have been deleted from the board type State is (Piece_Falling, Piece_Blocked, Board_Before_Clean, Board_After_Clean); Cur_State : State; -- orientations of shapes are taken from the Super Rotation System at -- http://tetris.wikia.com/wiki/SRS -- shape O has no orientation -- shape I has 4 orientations, which all fit in the 4 x 4 box -- shapes except I and O have 4 orientations, which all fit in the 3 x 3 box -- Note that Possible_I_Shapes and Possible_Three_Shapes should be accessed -- with Y component first, then X component, so that higher value for -- Direction correspond indeed to clockwise movement. subtype I_Delta is Integer range 0 .. 3; type Oriented_I_Shape is array (I_Delta, I_Delta) of Boolean; subtype Three_Delta is Integer range 0 .. 2; type Oriented_Three_Shape is array (Three_Delta, Three_Delta) of Boolean; -- orientations for I Possible_I_Shapes : constant array (Direction) of Oriented_I_Shape := (((False, False, False, False), (True, True, True, True), (False, False, False, False), (False, False, False, False)), ((False, False, True, False), (False, False, True, False), (False, False, True, False), (False, False, True, False)), ((False, False, False, False), (False, False, False, False), (True, True, True, True), (False, False, False, False)), ((False, True, False, False), (False, True, False, False), (False, True, False, False), (False, True, False, False))); Possible_Three_Shapes : constant array (Three_Shape, Direction) of Oriented_Three_Shape := (-- orientations for J (((True, False, False), (True, True, True), (False, False, False)), ((False, True, True), (False, True, False), (False, True, False)), ((False, False, False), (True, True, True), (False, False, True)), ((False, True, False), (False, True, False), (True, True, False))), -- orientations for L (((False, False, True), (True, True, True), (False, False, False)), ((False, True, False), (False, True, False), (False, True, True)), ((False, False, False), (True, True, True), (True, False, False)), ((True, True, False), (False, True, False), (False, True, False))), -- orientations for S (((False, True, True), (True, True, False), (False, False, False)), ((False, True, False), (False, True, True), (False, False, True)), ((False, False, False), (False, True, True), (True, True, False)), ((True, False, False), (True, True, False), (False, True, False))), -- orientations for T (((False, True, False), (True, True, True), (False, False, False)), ((False, True, False), (False, True, True), (False, True, False)), ((False, False, False), (True, True, True), (False, True, False)), ((False, True, False), (True, True, False), (False, True, False))), -- orientations for Z (((True, True, False), (False, True, True), (False, False, False)), ((False, False, True), (False, True, True), (False, True, False)), ((False, False, False), (True, True, False), (False, True, True)), ((False, True, False), (True, True, False), (True, False, False)))); -- the configuration of the board and piece should always be valid, meaning -- the piece and the board should not overlap, and the piece should fit in -- the board limits. function Is_Empty (B : Board; Y : Integer; X : Integer) return Boolean is (X in X_Coord and then Y in Y_Coord and then B(Y)(X) = Empty); function Is_Complete_Line (L : Line) return Boolean is (for all X in X_Coord => L(X) /= Empty); function Is_Empty_Line (L : Line) return Boolean is (for all X in X_Coord => L(X) = Empty); function No_Complete_Lines (B : Board) return Boolean is (for all Y in Y_Coord => not Is_Complete_Line (B(Y))); function No_Overlap (B : Board; P : Piece) return Boolean is (case P.S is when O => Is_Empty (B, P.Y, P.X) and then Is_Empty (B, P.Y, P.X + 1) and then Is_Empty (B, P.Y + 1, P.X) and then Is_Empty (B, P.Y + 1, P.X + 1), when I => (for all Y in I_Delta => (for all X in I_Delta => (if Possible_I_Shapes (P.D) (Y, X) then Is_Empty (B, P.Y + Y, P.X + X)))), when Three_Shape => (for all Y in Three_Delta => (for all X in Three_Delta => (if Possible_Three_Shapes (P.S, P.D) (Y, X) then Is_Empty (B, P.Y + Y, P.X + X))))); function Valid_Configuration return Boolean is (case Cur_State is when Piece_Falling | Piece_Blocked => No_Overlap (Cur_Board, Cur_Piece), when Board_Before_Clean => True, when Board_After_Clean => No_Complete_Lines (Cur_Board)); -- movements of the piece in the 3 possible directions type Action is (Move_Left, Move_Right, Move_Down, Turn_Counter_Clockwise, Turn_Clockwise); subtype Move_Action is Action range Move_Left .. Move_Right; subtype Turn_Action is Action range Turn_Counter_Clockwise .. Turn_Clockwise; function Turn_Direction (D : Direction; T : Turn_Action) return Direction is (case T is when Turn_Counter_Clockwise => (if D = Direction'First then Direction'Last else Direction'Pred (D)), when Turn_Clockwise => (if D = Direction'Last then Direction'First else Direction'Succ (D))); function Move_Is_Possible (P : Piece; A : Action) return Boolean is (case A is when Move_Left => P.X - 1 in PX_Coord, when Move_Right => P.X + 1 in PX_Coord, when Move_Down => P.Y + 1 in PY_Coord, when Turn_Action => True); function Move (P : Piece; A : Action) return Piece is (case A is when Move_Left => P'Update (X => P.X - 1), when Move_Right => P'Update (X => P.X + 1), when Move_Down => P'Update (Y => P.Y + 1), when Turn_Action => P'Update (D => Turn_Direction (P.D, A))) with Pre => Move_Is_Possible (P, A); procedure Do_Action (A : Action; Success : out Boolean) with Pre => Valid_Configuration, Post => Valid_Configuration; procedure Include_Piece_In_Board with Global => (Input => Cur_Piece, In_Out => (Cur_State, Cur_Board)), Pre => Cur_State = Piece_Blocked and then Valid_Configuration, Post => Cur_State = Board_Before_Clean and then Valid_Configuration; -- transition from state where a piece is falling to its integration in the -- board when it cannot fall anymore. procedure Delete_Complete_Lines with Global => (Proof_In => Cur_Piece, In_Out => (Cur_State, Cur_Board)), Pre => Cur_State = Board_Before_Clean and then Valid_Configuration, Post => Cur_State = Board_After_Clean and then Valid_Configuration; -- remove all complete lines from the board end Tetris;
libsrc/fcntl/spectrum/zxbasdrv/creat.asm
andydansby/z88dk-mk2
1
20232
; ; Create a file by the BASIC driver (open then close) ; ; Stefano - 5/7/2006 ; ; int creat(far char *name, mode_t mode); ; ; $Id: creat.asm,v 1.1 2006/07/18 21:02:54 stefano Exp $ XLIB creat LIB open LIB close .creat pop bc pop hl push hl push bc push bc push bc push hl call open pop bc pop bc pop bc ld a,h or l cp 255 ; -1 => error ? ret z push hl call close pop hl ld hl,0 ret
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_1079_1671.asm
ljhsiun2/medusa
9
8579
<filename>Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_1079_1671.asm .global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r13 push %r8 push %rbp push %rcx push %rdi push %rdx push %rsi // Store lea addresses_WT+0x1c706, %rbp nop nop nop nop nop sub %rdx, %rdx mov $0x5152535455565758, %rdi movq %rdi, %xmm3 and $0xffffffffffffffc0, %rbp movaps %xmm3, (%rbp) nop nop nop add %rsi, %rsi // Store lea addresses_RW+0x2166, %r8 xor $13152, %r13 movl $0x51525354, (%r8) nop nop and %rbp, %rbp // Faulty Load lea addresses_normal+0xf706, %r13 nop nop nop nop cmp %rbp, %rbp vmovups (%r13), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $0, %xmm5, %rcx lea oracles, %r13 and $0xff, %rcx shlq $12, %rcx mov (%r13,%rcx,1), %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r8 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_normal', 'size': 4, 'AVXalign': True}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': True}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_RW', 'size': 4, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_normal', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'34': 1079} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
kernel/x86/apic.asm
leonardoruilova/xos
1
241236
;; xOS32 ;; Copyright (C) 2016-2017 by <NAME>. use32 ; Note: If you're looking for the sources of multi-core task management -- ; -- see tasking/smp.asm instead. This file contains an I/O APIC driver and SMP initialization. IA32_MSR_APICBASE = 0x1B ; this MSR contains the base of the local apic, and also if it is enabled ; ACPI MADT types MADT_LOCAL_APIC = 0x00 MADT_IOAPIC = 0x01 MADT_OVERRIDE = 0x02 ; where the APICs will be mapped LOCAL_APIC = 0xFFE00000 IOAPIC = 0xFFC00000 IOAPIC_FIXED_DEST = 0x000 IOAPIC_LOW_DEST = 0x100 IOAPIC_LOGICAL_DEST = 0x800 IOAPIC_ACTIVE_HIGH = 0x2000 IOAPIC_LEVEL_TRIGGER = 0x8000 IOAPIC_MASK = 0x10000 MAXIMUM_CPUS = 16 ; up to 16 physical cpus madt_table dd 0 ; acpi madt address using_apic db 0 ; used to determine whether or not apic initialization was successful local_apic_phys dd 0 ioapic_phys dd 0 list_of_cpus: times MAXIMUM_CPUS+1 db 0xFF ; apic ids of the CPUs ; irq_mask: ; Masks an IRQ ; In\ AL = IRQ number ; Out\ Nothing irq_mask: call pic_mask ret ; irq_unmask: ; Unmasks an IRQ ; In\ AL = IRQ number ; Out\ Nothing irq_unmask: call pic_unmask ret ; apic_init: ; Detects and initializes local APIC and I/O APIC apic_init: ; find the madt table call acpi_enter mov eax, "APIC" ; madt signature call acpi_find_table cmp eax, -1 je .no_apic mov [madt_table], eax ; parse the madt, detect local apics and ioapics, re-enable paging ; map them in to the virtual address space, and then initialize them call apic_parse jmp $ .no_apic: call acpi_leave mov esi, .no_apic_msg call kprint ret .no_apic_msg db "ACPI MADT not present.",10,0 ; apic_parse: ; Parses the MADT table apic_parse: ; first grab the address of the local apic mov esi, [madt_table] add esi, ACPI_SDT_SIZE mov eax, [esi] mov [local_apic_phys], eax call lapic_enable ; enable the local apic if it not already enabled ; now detect the cpus and ioapic ;call apic_detect_cpu ;call apic_detect_ioapic ret ; lapic_enable: ; Enables the local APIC lapic_enable: mov ecx, IA32_MSR_APICBASE rdmsr ; only write to the register if we have to! test eax, 0x800 ; enabled? jz .write and eax, 0xFFFF0000 cmp eax, [local_apic_phys] jne .write cmp edx, 0 jne .write ret .write: mov eax, [local_apic_phys] or eax, 0x800 mov edx, 0 wrmsr ret
src/risi_script-types-internals.adb
OneWingedShark/Risi
1
6037
Package Body Risi_Script.Types.Internals is Default_Hash_Key : Constant String := "0"; ---------------------- -- GENERIC BODIES -- ---------------------- Function To_Array(Value : X) return Risi_Script.Types.Internals.List.Vector is Package List renames Risi_Script.Types.Internals.List; Begin return Result : List.Vector do Internals.List.Append( Container => Result, New_Item => Create(Value) ); end return; End To_Array; Function To_Hash( Value : X ) return Hash_Type is Begin return Result : Hash_Type do Result.Include( Key => Default_Hash_Key, New_Item => Create(Value) ); end return; End To_Hash; End Risi_Script.Types.Internals;
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1433.asm
ljhsiun2/medusa
9
160537
<filename>Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1433.asm .global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r14 push %r15 push %r9 push %rax push %rcx push %rdi push %rsi lea addresses_WC_ht+0x368a, %rcx nop nop xor $41477, %r9 vmovups (%rcx), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $0, %xmm6, %rax nop nop nop nop nop xor $17404, %r10 lea addresses_A_ht+0x1322a, %r11 nop nop nop nop nop and %r14, %r14 mov $0x6162636465666768, %r15 movq %r15, %xmm0 movups %xmm0, (%r11) nop nop nop sub %r14, %r14 lea addresses_normal_ht+0x88a, %rax nop nop nop sub %r15, %r15 vmovups (%rax), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $0, %xmm5, %r10 nop nop nop dec %rcx lea addresses_D_ht+0x814e, %r9 clflush (%r9) nop nop nop cmp %r15, %r15 movb (%r9), %al sub %r9, %r9 lea addresses_normal_ht+0x1d722, %r10 nop nop nop add %r14, %r14 mov (%r10), %r9w nop dec %rax lea addresses_normal_ht+0x98d0, %rsi lea addresses_normal_ht+0x3192, %rdi nop nop nop nop inc %rax mov $11, %rcx rep movsq cmp %r10, %r10 lea addresses_WT_ht+0x32, %rsi nop nop nop nop nop xor $1853, %r10 mov (%rsi), %r9w sub $5491, %rax lea addresses_A_ht+0x89b2, %rsi nop nop nop cmp %rax, %rax mov $0x6162636465666768, %r9 movq %r9, %xmm0 vmovups %ymm0, (%rsi) nop nop add $20568, %r11 lea addresses_WT_ht+0xc35e, %rsi lea addresses_A_ht+0x3bb2, %rdi nop nop nop xor %rax, %rax mov $49, %rcx rep movsl nop nop and $58175, %rax lea addresses_A_ht+0x232, %rsi lea addresses_D_ht+0x53b2, %rdi cmp %r11, %r11 mov $1, %rcx rep movsq nop nop nop sub $63875, %rcx lea addresses_normal_ht+0x5bb2, %rsi lea addresses_D_ht+0x15132, %rdi clflush (%rdi) nop nop nop nop nop xor $50041, %r11 mov $95, %rcx rep movsw nop nop add %rsi, %rsi lea addresses_A_ht+0x47b2, %r11 add $51690, %rcx mov (%r11), %rsi nop nop nop nop cmp %r10, %r10 pop %rsi pop %rdi pop %rcx pop %rax pop %r9 pop %r15 pop %r14 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r15 push %r9 push %rbp push %rbx push %rcx push %rsi // Store lea addresses_D+0x5232, %r11 add $11840, %rbp movw $0x5152, (%r11) nop nop nop nop nop dec %r11 // Store lea addresses_RW+0xf6b2, %rbx nop nop sub %r9, %r9 movw $0x5152, (%rbx) sub $9071, %rcx // Load lea addresses_A+0x18fb2, %rcx clflush (%rcx) nop nop inc %rbx movups (%rcx), %xmm0 vpextrq $0, %xmm0, %rbp nop nop nop nop xor %rsi, %rsi // Store lea addresses_WC+0x6bb2, %rsi clflush (%rsi) nop nop nop nop nop add $59321, %rbx mov $0x5152535455565758, %r11 movq %r11, %xmm5 vmovups %ymm5, (%rsi) // Exception!!! nop nop nop mov (0), %rbp nop nop nop sub $51552, %r11 // Faulty Load lea addresses_RW+0x7bb2, %r15 nop nop nop nop and %rsi, %rsi mov (%r15), %rbp lea oracles, %r15 and $0xff, %rbp shlq $12, %rbp mov (%r15,%rbp,1), %rbp pop %rsi pop %rcx pop %rbx pop %rbp pop %r9 pop %r15 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_D', 'size': 2, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_RW', 'size': 2, 'AVXalign': True}} {'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_A', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WC', 'size': 32, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False}} {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}} {'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 8, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}} {'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': True}} {'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': True}} {'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}} {'src': {'same': True, 'congruent': 10, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
screen_recording_end.applescript
jonleung/gist-screen
0
1482
on run filename activate application "QuickTime Player" delay 1 tell application "System Events" tell process "QuickTime Player" delay 1 # Exit "screen recording view by pressing the "ESC" key tell application "System Events" to key code 53 # escape key (ends the recording) delay 1 # Stop the screen recording by press the "SPACEBAR" key tell application "System Events" to key code 49 delay 1 # Click menu item "Save..." of menu "File" of menu bar 1 keystroke "s" using {command down} delay 2 # Navigate to `~/Desktop/screenshots` keystroke "g" using {command down, shift down} delay 1 keystroke "~/Desktop/screenshots/" delay 1 tell application "System Events" to key code 76 # enter key (selects the `/screenshots` folder) delay 2 # Name the movie keystroke filename delay 1 tell application "System Events" to key code 76 # enter key (saves the movie) delay 1 end tell end tell try tell application "QuickTime Player" to quit on error error_message number error_number if error_number is equal to -128 then --Keep Calm and Carry On else display dialog error_message end if end try end run
src/Lens/Non-dependent.agda
nad/dependent-lenses
3
13486
------------------------------------------------------------------------ -- Representation-independent results for non-dependent lenses ------------------------------------------------------------------------ import Equality.Path as P module Lens.Non-dependent {e⁺} (eq : ∀ {a p} → P.Equality-with-paths a p e⁺) where open P.Derived-definitions-and-properties eq open import Logical-equivalence using (_⇔_) open import Prelude open import Bijection equality-with-J as Bij using (module _↔_) open import Equality.Decision-procedures equality-with-J open import Equivalence equality-with-J using (_≃_) open import Erased.Cubical eq open import Function-universe equality-with-J as F hiding (_∘_) open import H-level equality-with-J as H-level open import H-level.Closure equality-with-J open import H-level.Truncation.Propositional eq as T using (∥_∥) open import Surjection equality-with-J using (_↠_) private variable a b c c₁ c₂ c₃ l : Level A B : Type a Lens₁ Lens₂ Lens₃ : Type a → Type b → Type c ------------------------------------------------------------------------ -- Some existence results -- There is, in general, no lens for the first projection from a -- Σ-type, assuming that lenses with contractible domains have -- contractible codomains. no-first-projection-lens : (Lens : Type → Type → Type a) → @0 (∀ {A B} → Lens A B → Contractible A → Contractible B) → ¬ Lens (∃ λ (b : Bool) → b ≡ true) Bool no-first-projection-lens _ contractible-to-contractible l = _↔_.to Erased-⊥↔⊥ [ $⟨ singleton-contractible _ ⟩ Contractible (Singleton true) ↝⟨ contractible-to-contractible l ⟩ Contractible Bool ↝⟨ mono₁ 0 ⟩ Is-proposition Bool ↝⟨ ¬-Bool-propositional ⟩□ ⊥ □ ] -- A variant of the previous result: If A is merely inhabited, and one -- can "project" out a boolean from a value of type A, but this -- boolean is necessarily true, then there is no lens corresponding to -- this projection (if the get-set law holds). no-singleton-projection-lens : {Lens : Type l} (get : Lens → A → Bool) (set : Lens → A → Bool → A) (get-set : ∀ l a b → get l (set l a b) ≡ b) → ∥ A ∥ → (bool : A → Bool) → (∀ x → bool x ≡ true) → ¬ ∃ λ (l : Lens) → ∀ x → get l x ≡ bool x no-singleton-projection-lens get set get-set x bool is-true (l , get≡bool) = _↔_.to Erased-⊥↔⊥ [ (flip (T.rec ⊥-propositional) x λ x → Bool.true≢false (true ≡⟨ sym $ is-true _ ⟩ bool (set l x false) ≡⟨ sym $ get≡bool _ ⟩ get l (set l x false) ≡⟨ get-set _ _ _ ⟩∎ false ∎)) ] ------------------------------------------------------------------------ -- Statements of preservation results, and some related lemmas -- Lens-like things with getters and setters. record Has-getter-and-setter (Lens : Type a → Type b → Type c) : Type (lsuc (a ⊔ b ⊔ c)) where field -- Getter. get : {A : Type a} {B : Type b} → Lens A B → A → B -- Typeter. set : {A : Type a} {B : Type b} → Lens A B → A → B → A -- A statement of what it means for two lenses to have the same getter -- and setter. Same-getter-and-setter : {Lens₁ : Type a → Type b → Type c₁} {Lens₂ : Type a → Type b → Type c₂} ⦃ L₁ : Has-getter-and-setter Lens₁ ⦄ ⦃ L₂ : Has-getter-and-setter Lens₂ ⦄ {A : Type a} {B : Type b} → Lens₁ A B → Lens₂ A B → Type (a ⊔ b) Same-getter-and-setter ⦃ L₁ = L₁ ⦄ ⦃ L₂ = L₂ ⦄ l₁ l₂ = get L₁ l₁ ≡ get L₂ l₂ × set L₁ l₁ ≡ set L₂ l₂ where open Has-getter-and-setter -- A statement of what it means for a function to preserve getters and -- setters for all inputs. Preserves-getters-and-setters-→ : {Lens₁ : Type a → Type b → Type c₁} {Lens₂ : Type a → Type b → Type c₂} ⦃ L₁ : Has-getter-and-setter Lens₁ ⦄ ⦃ L₂ : Has-getter-and-setter Lens₂ ⦄ (A : Type a) (B : Type b) → (Lens₁ A B → Lens₂ A B) → Type (a ⊔ b ⊔ c₁) Preserves-getters-and-setters-→ {Lens₁ = Lens₁} A B f = (l : Lens₁ A B) → Same-getter-and-setter (f l) l -- A statement of what it means for a logical equivalence to preserve -- getters and setters. Preserves-getters-and-setters-⇔ : {Lens₁ : Type a → Type b → Type c₁} {Lens₂ : Type a → Type b → Type c₂} ⦃ L₁ : Has-getter-and-setter Lens₁ ⦄ ⦃ L₂ : Has-getter-and-setter Lens₂ ⦄ (A : Type a) (B : Type b) → (Lens₁ A B ⇔ Lens₂ A B) → Type (a ⊔ b ⊔ c₁ ⊔ c₂) Preserves-getters-and-setters-⇔ A B eq = Preserves-getters-and-setters-→ A B (_⇔_.to eq) × Preserves-getters-and-setters-→ A B (_⇔_.from eq) -- Composition preserves Preserves-getters-and-setters-→. Preserves-getters-and-setters-→-∘ : ⦃ L₁ : Has-getter-and-setter Lens₁ ⦄ ⦃ L₂ : Has-getter-and-setter Lens₂ ⦄ ⦃ L₃ : Has-getter-and-setter Lens₃ ⦄ {f : Lens₂ A B → Lens₃ A B} {g : Lens₁ A B → Lens₂ A B} → Preserves-getters-and-setters-→ A B f → Preserves-getters-and-setters-→ A B g → Preserves-getters-and-setters-→ A B (f ∘ g) Preserves-getters-and-setters-→-∘ p-f p-g _ = trans (proj₁ (p-f _)) (proj₁ (p-g _)) , trans (proj₂ (p-f _)) (proj₂ (p-g _)) -- Composition preserves Preserves-getters-and-setters-⇔. Preserves-getters-and-setters-⇔-∘ : {Lens₁ : Type a → Type b → Type c₁} {Lens₂ : Type a → Type b → Type c₂} {Lens₃ : Type a → Type b → Type c₃} ⦃ L₁ : Has-getter-and-setter Lens₁ ⦄ ⦃ L₂ : Has-getter-and-setter Lens₂ ⦄ ⦃ L₃ : Has-getter-and-setter Lens₃ ⦄ {f : Lens₂ A B ⇔ Lens₃ A B} {g : Lens₁ A B ⇔ Lens₂ A B} → Preserves-getters-and-setters-⇔ A B f → Preserves-getters-and-setters-⇔ A B g → Preserves-getters-and-setters-⇔ A B (f F.∘ g) Preserves-getters-and-setters-⇔-∘ p-f p-g = Preserves-getters-and-setters-→-∘ (proj₁ p-f) (proj₁ p-g) , Preserves-getters-and-setters-→-∘ (proj₂ p-g) (proj₂ p-f) -- The function inverse preserves Preserves-getters-and-setters-⇔. Preserves-getters-and-setters-⇔-inverse : {Lens₁ : Type a → Type b → Type c₁} {Lens₂ : Type a → Type b → Type c₂} ⦃ L₁ : Has-getter-and-setter Lens₁ ⦄ ⦃ L₂ : Has-getter-and-setter Lens₂ ⦄ {f : Lens₁ A B ⇔ Lens₂ A B} → Preserves-getters-and-setters-⇔ A B f → Preserves-getters-and-setters-⇔ A B (inverse f) Preserves-getters-and-setters-⇔-inverse = swap -- If the forward direction of a split surjection preserves getters -- and setters, then both directions do. Preserves-getters-and-setters-→-↠-⇔ : {Lens₁ : Type a → Type b → Type c₁} {Lens₂ : Type a → Type b → Type c₂} ⦃ L₁ : Has-getter-and-setter Lens₁ ⦄ ⦃ L₂ : Has-getter-and-setter Lens₂ ⦄ (f : Lens₁ A B ↠ Lens₂ A B) → Preserves-getters-and-setters-→ A B (_↠_.to f) → Preserves-getters-and-setters-⇔ A B (_↠_.logical-equivalence f) Preserves-getters-and-setters-→-↠-⇔ ⦃ L₁ = L₁ ⦄ ⦃ L₂ = L₂ ⦄ f p = p , λ l → (get L₁ (_↠_.from f l) ≡⟨ sym $ proj₁ $ p (_↠_.from f l) ⟩ get L₂ (_↠_.to f (_↠_.from f l)) ≡⟨ cong (get L₂) $ _↠_.right-inverse-of f _ ⟩∎ get L₂ l ∎) , (set L₁ (_↠_.from f l) ≡⟨ sym $ proj₂ $ p (_↠_.from f l) ⟩ set L₂ (_↠_.to f (_↠_.from f l)) ≡⟨ cong (set L₂) $ _↠_.right-inverse-of f _ ⟩∎ set L₂ l ∎) where open Has-getter-and-setter
Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0x84_notsx.log_21829_201.asm
ljhsiun2/medusa
9
22918
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r15 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x2e42, %rsi and $45073, %r11 mov $0x6162636465666768, %rcx movq %rcx, %xmm1 vmovups %ymm1, (%rsi) sub $57322, %rdi lea addresses_A_ht+0x14802, %rcx nop nop and %r10, %r10 movl $0x61626364, (%rcx) and $53122, %rdi lea addresses_D_ht+0x1da16, %r11 nop nop nop nop nop inc %rdi mov (%r11), %rcx nop cmp %rsi, %rsi lea addresses_WC_ht+0xfc6a, %rsi lea addresses_WC_ht+0x66e8, %rdi clflush (%rdi) nop nop nop add $8677, %rbp mov $30, %rcx rep movsw nop nop nop nop nop xor %rsi, %rsi lea addresses_WT_ht+0x3f42, %rsi lea addresses_UC_ht+0x61c2, %rdi clflush (%rdi) nop nop and $47322, %r10 mov $58, %rcx rep movsl nop nop nop xor %r10, %r10 lea addresses_WT_ht+0x1a642, %rsi lea addresses_WC_ht+0x5642, %rdi and $63020, %r15 mov $106, %rcx rep movsw nop nop nop xor %rdi, %rdi lea addresses_D_ht+0x1c0fa, %rdi and $55002, %r11 mov $0x6162636465666768, %r10 movq %r10, %xmm0 and $0xffffffffffffffc0, %rdi vmovntdq %ymm0, (%rdi) nop nop nop nop nop and $16856, %r15 lea addresses_WT_ht+0x1be42, %rsi lea addresses_normal_ht+0x12c2, %rdi nop nop nop nop nop dec %r10 mov $62, %rcx rep movsw nop nop nop nop nop inc %rsi lea addresses_WC_ht+0x11d8a, %rcx sub %rdx, %rdx mov (%rcx), %r11d nop nop nop cmp $11694, %r10 lea addresses_WC_ht+0x2a42, %rsi lea addresses_normal_ht+0x10a42, %rdi clflush (%rdi) nop nop nop sub %rdx, %rdx mov $113, %rcx rep movsw nop xor %rdx, %rdx lea addresses_D_ht+0x76de, %rsi lea addresses_WT_ht+0x18c2, %rdi nop nop sub $36527, %rdx mov $40, %rcx rep movsq nop add %r11, %r11 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r15 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi // Store lea addresses_PSE+0xdba, %rsi nop nop nop and %rdi, %rdi movw $0x5152, (%rsi) nop nop nop and $52555, %rdx // REPMOV lea addresses_RW+0x8842, %rsi lea addresses_WC+0x9772, %rdi nop and %rbp, %rbp mov $106, %rcx rep movsl nop and $54180, %r11 // Store mov $0xc42, %rdx inc %r11 mov $0x5152535455565758, %rdi movq %rdi, (%rdx) nop nop nop dec %rsi // Faulty Load lea addresses_A+0x17e42, %rdi nop xor $32351, %r11 vmovups (%rdi), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $1, %xmm1, %rcx lea oracles, %r11 and $0xff, %rcx shlq $12, %rcx mov (%r11,%rcx,1), %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_A', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_PSE', 'same': False, 'size': 2, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_RW', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WC', 'congruent': 2, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 8, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_A', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': True}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 32, 'congruent': 3, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'} {'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 */
alloy4fun_models/trashltl/models/4/FFJQJnEEEKeBp6o8T.als
Kaixi26/org.alloytools.alloy
0
2261
<reponame>Kaixi26/org.alloytools.alloy<filename>alloy4fun_models/trashltl/models/4/FFJQJnEEEKeBp6o8T.als open main pred idFFJQJnEEEKeBp6o8T_prop5 { eventually no File' } pred __repair { idFFJQJnEEEKeBp6o8T_prop5 } check __repair { idFFJQJnEEEKeBp6o8T_prop5 <=> prop5o }
tools/open_browser.applescript
milkfarm/dotfiles
0
47
<reponame>milkfarm/dotfiles #!/usr/bin/osascript on openInSafari(_url) tell application "Safari" set URL of document 1 to _url end tell end openInSafari on run argv set _browser to item 1 of argv set _url to item 2 of argv if _browser = "safari" then openInSafari(_url) else set theDialogText to "Unknown browser value '" & _browser & "'." display dialog theDialogText buttons {"Cancel"} default button 1 end if end run
CTL/Modalities/AU.agda
Aerate/condatis
1
7573
<reponame>Aerate/condatis<filename>CTL/Modalities/AU.agda module CTL.Modalities.AU where open import CTL.Modalities.AN open import FStream.Core open import Library data _AU'_ {ℓ₁ ℓ₂} {C : Container ℓ₁} (props₁ props₂ : FStream' C (Set ℓ₂)) : Set (ℓ₁ ⊔ ℓ₂) where finallyA : head props₁ → props₁ AU' props₂ _untilA_ : head props₂ → AN'ₛ props₁ AU' AN'ₛ props₂ → props₁ AU' props₂ -- TODO Implement with Applicative AU : ∀ {ℓ₁ ℓ₂} {C : Container ℓ₁} → FStream C (Set ℓ₂) → FStream C (Set ℓ₂) → Set (ℓ₁ ⊔ ℓ₂) AU s₁ s₂ = {! !} mutual AUₛ' : ∀ {i : Size} {ℓ₁ ℓ₂} {C : Container ℓ₁} → FStream' C (Set ℓ₂) → FStream' C (Set ℓ₂) → FStream' {i} C (Set (ℓ₁ ⊔ ℓ₂)) AUₛ' = {! !} AUₛ : ∀ {i : Size} {ℓ₁ ℓ₂} {C : Container ℓ₁} → FStream C (Set ℓ₂) → FStream C (Set ℓ₂) → FStream {i} C (Set (ℓ₁ ⊔ ℓ₂)) AUₛ = {! !}
source/boot.asm
blastrock/flix
6
81688
; ; boot.s -- Kernel start location. Also defines multiboot header. ; Based on Bran's kernel development tutorial file start.asm ; MB2_HEADER_MAGIC equ 0xE85250D6 MB2_ARCHITECTURE equ 0 MB2_LENGTH equ MB2_HEADER_END - MB2_HEADER_START MB2_RESPONSE_MAGIC equ 0x36D76289 MB2_CHECKSUM equ -(MB2_HEADER_MAGIC + MB2_ARCHITECTURE + MB2_LENGTH) & 0xFFFFFFFF [BITS 32] [SECTION .mbhdr] [EXTERN _kernelBootstrapStart] [EXTERN _kernelBssStart] [EXTERN _kernelBssEnd] [EXTERN _kernelHeapStart] ALIGN 8 MB2_HEADER_START: dd MB2_HEADER_MAGIC dd MB2_ARCHITECTURE dd MB2_LENGTH dd MB2_CHECKSUM ; no need to specify sections and entry point, will be read from ELF file ; info request ; this part seems to be broken, it only works if 8 < size < 12. It seems to me ; that the correct value should be 12... ;ALIGN 8 ; dw 1, 0 ; not optional ; dd 12 ; size ; dd 1 ; request memory mapping ;; page align ;ALIGN 8 ; dw 6 ; dw 0 ; dd 8 ; end ALIGN 8 dw 0, 0 dd 8 MB2_HEADER_END: [SECTION .bootstrap] [GLOBAL start] [EXTERN Pml4] [EXTERN Pdpt] [EXTERN Pd] failure: hlt jmp failure start: cli cmp eax, $MB2_RESPONSE_MAGIC jne failure ; copy multiboot header at beginning of heap .LMBCopyF: mov ecx, DWORD [ebx] add ecx, ebx mov edx, _kernelHeapStart add edx, 8 ; heap block header size + align to 8 .LMBCopyFLoop: cmp ebx, ecx jge .LMBCopyEnd mov al, [ebx] mov [edx], al inc ebx inc edx jmp .LMBCopyFLoop .LMBCopyEnd: ; bss section isn't 0-filled with grub2, do it now mov eax, _kernelBssStart cmp eax, _kernelBssEnd jge .LfillBssEnd .LfillBssLoop: mov [eax], BYTE 0 inc eax cmp eax, _kernelBssEnd jl .LfillBssLoop .LfillBssEnd: ; setup 32 bit segmentation mov eax, .LGdtR lgdt [eax] mov eax, 0x10 mov ds, ax mov ss, ax jmp 0x08:.LenableLong .LenableLong: ; setup long mode pagination mov eax, Pdpt bts eax, 0 bts eax, 1 mov [Pml4], eax mov [Pml4 + 0xFF8], eax mov eax, Pd bts eax, 0 bts eax, 1 ; lower memory is identity mapped mov [Pdpt], eax ; map text, stack and heaps add eax, 0x1000 mov [Pdpt + 0xFF8], eax ; this is last level, 2MB pages ; identity map first 2MB mov dword [Pd ], 0x00000083 mov dword [Pd + 4], 0x0 ; map 2MB+ (the part after the bootstrap) to 0xffffffffc0000000 mov eax, 0x00200083 mov ebx, 0x1000 .LmapLoop: cmp eax, _kernelBssEnd jge .LendMap mov dword [Pd + ebx], eax mov dword [Pd + ebx + 4], 0x0 add eax, 0x200000 add ebx, 0x8 jmp .LmapLoop .LendMap: ; map stack to 0xffffffffd0000000 (and lower) mov dword [Pd + 0x13F8], eax mov dword [Pd + 0x13FC], 0x0 add eax, 0x200000 ; map heaps to 0xffffffffe0000000 and 0xfffffffff0000000 mov dword [Pd + 0x1800], eax mov dword [Pd + 0x1804], 0x0 add eax, 0x200000 mov dword [Pd + 0x1C00], eax mov dword [Pd + 0x1C04], 0x0 ; Load CR3 with PML4 mov eax, Pml4 mov cr3, eax ; Enable PAE mov eax, cr4 bts eax, 5 mov cr4, eax ; Enable Long Mode in the MSR mov ecx, 0xC0000080 rdmsr bts eax, 8 wrmsr ; Enable Paging and Write Protection mov eax, cr0 bts eax, 31 bts eax, 16 mov cr0, eax jmp 0x08:.LenableLongSeg .LenableLongSeg: mov eax, 0x28 mov ds, ax mov ss, ax jmp 0x20:.Lstart64 [BITS 64] .Lstart64: ; set up stack [EXTERN _stackBase] mov rsp, _stackBase ; ; do static initialization ;[EXTERN _initArrayBegin] ;[EXTERN _initArrayEnd] ; ; r14 and r15 are callee-saved (rsi and rdi are too, but they do not work ><) ; mov r14, _initArrayBegin ; mov r15, _initArrayEnd ;.LinitLoop: ; cmp r14, r15 ; je .LmainStart ; mov rax, QWORD [r14] ; call rax ; add r14, 8 ; jmp .LinitLoop .LmainStart: ; call kmain(multiboot) [EXTERN kmain] mov rdi, 0xfffffffff0000008 push QWORD 0x0 mov rax, kmain jmp rax cli .Lfailure64: hlt jmp .Lfailure64 .LGdt: dq 0x0000000000000000 dq 0x00CF9A000000FFFF dq 0x00CF92000000FFFF .LGdtLong: dq 0x0000000000000000 dq 0x0020980000000000 dq 0x0000920000000000 .LGdtEnd: .LGdtR: dw .LGdtEnd - .LGdt - 1 dd .LGdt
use_c_printf.asm
dev001hajipro/study_nasm
0
19866
<gh_stars>0 ; ; $ nasm -f elf64 pri.asm && gcc pri.o -o pri && ./pri ; PIC対応なのでprintfは以下のようにWRT ..pltを記述して呼び出す ; call printf WRT ..plt ; extern printf section .data fmt: db "x=%d", 0x0A, 0 section .text global main main: mov rdi, fmt mov rsi, 198 xor rax, rax call printf WRT ..plt ; sys_exit mov rax, 60 mov rdi, 1 syscall
src/kernel/kernel.string.asm
asmCcoder/dzOS
1
166041
;****************************************************************************** ; kernel.string.asm ; ; Kernel's String routines ; for dastaZ80's dzOS ; by <NAME> (May 2019) ; ; Version 1.0.0 ; Created on 08 May 2019 ; Last Modification 08 May 2019 ;****************************************************************************** ; CHANGELOG ; - ;****************************************************************************** ; --------------------------- LICENSE NOTICE ---------------------------------- ; This file is part of dzOS ; Copyright (C) 2017-2018 <NAME> ; dzOS is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; dzOS 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 dzOS. If not, see <http://www.gnu.org/licenses/>. ; ----------------------------------------------------------------------------- ;============================================================================== ; String Routines ;============================================================================== ;------------------------------------------------------------------------------ F_KRN_WRSTR: .EXPORT F_KRN_WRSTR ; Console output string ; Display a string of ASCII characters terminated with CR. ; HL = pointer to first character of the string ld a, (hl) ; Get character of the string or a ; is it 00h? (i.e. end of string) ret z ; if yes, then return on terminator call F_BIOS_CONOUT ; otherwise, print it inc hl ; pointer to next character of the string jr F_KRN_WRSTR ; continue (until 00h) ret ;------------------------------------------------------------------------------ F_KRN_RDCHARECHO: .EXPORT F_KRN_RDCHARECHO ; Read a character, with echo ; Read a character from Console and outputs to the Screen ; Read character is stored in register A call F_BIOS_CONIN call F_BIOS_CONOUT ; ToDo - Check for special characters ; - Allow backspace ret ;------------------------------------------------------------------------------ F_KRN_TOUPPER: .EXPORT F_KRN_TOUPPER ; Convert to Uppercase ; Converts character in register A to uppercase. ; IN <= character to convert ; OUT => uppercased character cp 'a' ; nothing to do if is not lower case ret c cp 'z' + 1 ; > 'z'? ret nc and 5Fh ; convert to upper case ret ;------------------------------------------------------------------------------ F_KRN_GET_BYTE_BIN_ECHO: .EXPORT F_KRN_GET_BYTE_BIN_ECHO ; Get Byte (with echo) and convert it to binary ; Gets a single hexadecimal byte from standard input ; converts it to binary ; and stores it in A ; IN <= None ; OUT => A received character push hl ; backup HL call F_KRN_RDCHARECHO ; get 1st char of byte ld h, a ; and store it in H call F_KRN_RDCHARECHO ; get 2nd char of byte ld l, a ; and store it in L call F_KRN_ASCII2HEX ; convert contents of HL to a binary number in A pop hl ; restore HL ret ;------------------------------------------------------------------------------ F_KRN_PRN_BYTES: .EXPORT F_KRN_PRN_BYTES ; Prints bytes ; Print n number of bytes as ASCII characters ; IN <= B = number of bytes to print ; HL = start memory address where the bytes are ; OUT => default output (e.g. screen, I/O) ld a, (hl) ; get memory content pointed by HL into A cp 0 ; is it null? jp z, prnbytesend ; yes, exit routine cp LF ; new line? jp nz, nonewline ; no, contine normally ld a, CR ; yes, print CR+LF call F_BIOS_CONOUT ld a, LF nonewline: call F_BIOS_CONOUT ; no, print character inc hl ; pointer to next character djnz F_KRN_PRN_BYTES ; all bytes printer? No, continue printing prnbytesend: ret ; yes, exit routine ;------------------------------------------------------------------------------ F_KRN_PRN_BYTE: .EXPORT F_KRN_PRN_BYTE ; Print Byte ; Prints a single byte in hexadecimal notation. ; IN <= A = the byte to be printed ; OUT => default output (e.g. screen, I/O) push bc ; convert high nibble ld b, a rrca ;move high nibble to low nibble rrca rrca rrca call F_KRN_PRN_NIBBLE ; prints high nibble ;convert low nibble ld a, b call F_KRN_PRN_NIBBLE ; prints low nibble pop bc ret ;------------------------------------------------------------------------------ F_KRN_PRN_NIBBLE: ; Print Nibble ; Prints a single hexadecimal nibble in hexadecimal notation. ; IN <= LSB of A ; OUT => default output (e.g. screen, I/O) and 0fh ; remove hight nibble cp 10 ; is it a digit? jr c, print_nibble ; yes, print it add a, 7 ; no, add offset for letters print_nibble: add a, 30h ; add offset for digits (30 to 39 in hex is 0 to 9 in dec) call F_BIOS_CONOUT ; print the nibble ret ;------------------------------------------------------------------------------ F_KRN_PRN_WORD: .EXPORT F_KRN_PRN_WORD ; Print Word ; Prints the 4 hexadecimal digits of a word in hexadecimal notation. ; IN <= HL (the word to be printed) ; OUT => default output (e.g. screen, I/O) ld a, h call F_KRN_PRN_BYTE ld a, l call F_KRN_PRN_BYTE ret ;------------------------------------------------------------------------------ F_KRN_PRINTABLE: .EXPORT F_KRN_PRINTABLE ; Checks if a character is a printable ASCII character ; IN <= A contains character to check ; OUT => C flag is set if character is printable. cp SPACE jr nc, is_printable ccf ret is_printable: cp 7fh ret ;------------------------------------------------------------------------------ F_KRN_EMPTYLINES: .EXPORT F_KRN_EMPTYLINES ; Output n empty lines ; IN <= B = number of empty lines to print out ; OUT => default output (e.g. screen, I/O) loop_emptylines: ld a, CR call F_BIOS_CONOUT ld a, LF call F_BIOS_CONOUT djnz loop_emptylines ret ;------------------------------------------------------------------------------ F_KRN_STRCMP: .EXPORT F_KRN_STRCMP ; Compare 2 zero terminated strings ; IN <= HL pointer to start of string 1 ; DE pointer to start of string 2 ; OUT => if str1 = str2, Z flag set and C flag not set ; if str1 != str2 and str1 longer than str2, Z flag not set and C flag not set ; if str1 != str2 and str1 shorter than str2, Z flag not set and C flag set ; ; Determine which is the shorter string ld a, (hl) ld (buffer_pgm), a ; length of string 1 ld a, (de) ld (buffer_pgm + 1), a ; length of string 2 cp (hl) ; compare length str2 to length str1 jr c, strcmp ; str2 shorter than str1? yes, jump ld a, (hl) ; no, str1 is shorter ; Compare string (through length of shorter) strcmp: or a ; test length of shorter string jr z, cmplen ; compare lengths ld b, a ; counter = length of shorter string (number of bytes to compare) ex de, hl ; DE = str1, HL = str2 strcmploop: inc hl ; pointer to next byte of str2 inc de ; pointer to next byte of str1 ld a, (de) ; byte from str1 cp (hl) ; is it same as in str2? ret nz ; no, return with flags set djnz strcmploop ; yes, continue comparing cmplen: ; compare lengths ld a, (buffer_pgm) ld hl, (buffer_pgm + 1) cp (hl) ret ; exit routine, with flags set or cleared ;------------------------------------------------------------------------------ F_KRN_STRCPY: .EXPORT F_KRN_STRCPY ; Copy n characters from string 1 to string 2 ; IN <= HL pointer to start of string 1 ; DE pointer to start of string 2 ; B number of characters to copy ld a, (de) ; 1 character from original string ld (hl), a ; copy it to destination string inc de ; pointer to next destination character inc hl ; pointer to next original character djnz F_KRN_STRCPY ; all characters copied (i.e. B=0)? No, continue copying ret ; yes, exit routine
sim/asm/fn62.asm
nanamake/avr_cpu
2
102172
;------------------- ; test for subi/sreg ;------------------- .equ sreg = 0x3f ;------------------- ldi r16,0x28 ldi r17,0x70 ldi r18,0xc0 ldi r19,0xd8 ldi r20,0x00 ldi r21,0x7f ldi r22,0x80 ldi r23,0xff ;------------------- mov r24,r16 subi r24,0x28 in r0 ,sreg mov r25,r17 subi r25,0x28 in r1 ,sreg mov r26,r16 subi r26,0x70 in r2 ,sreg sez mov r27,r20 subi r27,0xff in r3 ,sreg mov r28,r16 subi r28,0xd8 in r4 ,sreg mov r29,r17 subi r29,0xc0 in r5 ,sreg sez mov r30,r22 subi r30,0x7f in r6 ,sreg mov r31,r18 subi r31,0x70 in r7 ,sreg mov r24,r19 subi r24,0x28 in r8 ,sreg sez mov r25,r18 subi r25,0xc0 in r9 ,sreg mov r26,r19 subi r26,0xc0 in r10,sreg mov r27,r18 subi r27,0xd8 in r11,sreg ;------------------- clc mov r28,r16 sbci r28,0x28 in r12,sreg mov r29,r17 sbci r29,0x28 in r13,sreg mov r30,r16 sbci r30,0x70 in r14,sreg sez mov r31,r20 sbci r31,0xff in r15,sreg mov r24,r16 sbci r24,0xd8 in r24,sreg mov r25,r17 sbci r25,0xc0 in r25,sreg sez mov r26,r22 sbci r26,0x7f in r26,sreg mov r27,r18 sbci r27,0x70 in r27,sreg mov r28,r19 sbci r28,0x28 in r28,sreg sez mov r29,r18 sbci r29,0xc0 in r29,sreg mov r30,r19 sbci r30,0xc0 in r30,sreg mov r31,r18 sbci r31,0xd8 in r31,sreg ;------------------- sts 0x0100,r16 ; (ldi) 0x28 sts 0x0101,r16 ; (ldi) 0x28 sts 0x0102,r0 ; (subi) 0x28 0x28 (cf=0 zf=0) ----z- sts 0x0103,r12 ; (sbci) 0x28 0x28 (cf=0 zf=0) ------ sts 0x0104,r17 ; (ldi) 0x70 sts 0x0105,r16 ; (ldi) 0x28 sts 0x0106,r1 ; (subi) 0x70 0x28 (cf=0) h----- sts 0x0107,r13 ; (sbci) 0x70 0x28 (cf=0) h----- sts 0x0108,r16 ; (ldi) 0x28 sts 0x0109,r17 ; (ldi) 0x70 sts 0x010a,r2 ; (subi) 0x28 0x70 (cf=0) -s-n-c sts 0x010b,r14 ; (sbci) 0x28 0x70 (cf=0) -s-n-c ;------------------- sts 0x0110,r20 ; (ldi) 0x00 sts 0x0111,r23 ; (ldi) 0xff sts 0x0112,r3 ; (subi) 0x00 0xff (cf=1 zf=1) h----c sts 0x0113,r15 ; (sbci) 0x00 0xff (cf=1 zf=1) h---zc sts 0x0114,r16 ; (ldi) 0x28 sts 0x0115,r19 ; (ldi) 0xd8 sts 0x0116,r4 ; (subi) 0x28 0xd8 (cf=1) -----c sts 0x0117,r24 ; (sbci) 0x28 0xd8 (cf=1) h----c sts 0x0118,r17 ; (ldi) 0x70 sts 0x0119,r18 ; (ldi) 0xc0 sts 0x011a,r5 ; (subi) 0x70 0xc0 (cf=1) --vn-c sts 0x011b,r25 ; (sbci) 0x70 0xc0 (cf=1) h-vn-c ;------------------- sts 0x0120,r22 ; (ldi) 0x80 sts 0x0121,r21 ; (ldi) 0x7f sts 0x0122,r6 ; (subi) 0x80 0x7f (cf=1 zf=1) hsv--- sts 0x0123,r26 ; (sbci) 0x80 0x7f (cf=1 zf=1) hsv-z- sts 0x0124,r18 ; (ldi) 0xc0 sts 0x0125,r17 ; (ldi) 0x70 sts 0x0126,r7 ; (subi) 0xc0 0x70 (cf=0) -sv--- sts 0x0127,r27 ; (sbci) 0xc0 0x70 (cf=0) -sv--- sts 0x0128,r19 ; (ldi) 0xd8 sts 0x0129,r16 ; (ldi) 0x28 sts 0x012a,r8 ; (subi) 0xd8 0x28 (cf=0) -s-n-- sts 0x012b,r28 ; (sbci) 0xd8 0x28 (cf=0) -s-n-- ;------------------- sts 0x0130,r18 ; (ldi) 0xc0 sts 0x0131,r18 ; (ldi) 0xc0 sts 0x0132,r9 ; (subi) 0xc0 0xc0 (cf=0 zf=1) ----z- sts 0x0133,r29 ; (sbci) 0xc0 0xc0 (cf=0 zf=1) ----z- sts 0x0134,r19 ; (ldi) 0xd8 sts 0x0135,r18 ; (ldi) 0xc0 sts 0x0136,r10 ; (subi) 0xd8 0xc0 (cf=0) ------ sts 0x0137,r30 ; (sbci) 0xd8 0xc0 (cf=0) ------ sts 0x0138,r18 ; (ldi) 0xc0 sts 0x0139,r19 ; (ldi) 0xd8 sts 0x013a,r11 ; (subi) 0xc0 0xd8 (cf=0) hs-n-c sts 0x013b,r31 ; (sbci) 0xc0 0xd8 (cf=0) hs-n-c ;------------------- out sreg,r23 mov r30,r19 subi r30,0xc0 in r10,sreg out sreg,r23 mov r30,r19 sbci r30,0xc0 in r30,sreg sts 0x013c,r19 ; (ldi) 0xd8 sts 0x013d,r18 ; (ldi) 0xc0 sts 0x013e,r10 ; (subi) 0xd8 0xc0 (cf=1) it------ sts 0x013f,r30 ; (sbci) 0xd8 0xc0 (cf=1) it------ ;------------------- ldi r16,0xff sts 0xffff,r16 halt: rjmp halt
Task/Tree-traversal/Ada/tree-traversal.ada
LaudateCorpus1/RosettaCodeData
1
3663
<filename>Task/Tree-traversal/Ada/tree-traversal.ada with Ada.Text_Io; use Ada.Text_Io; with Ada.Unchecked_Deallocation; with Ada.Containers.Doubly_Linked_Lists; procedure Tree_Traversal is type Node; type Node_Access is access Node; type Node is record Left : Node_Access := null; Right : Node_Access := null; Data : Integer; end record; procedure Destroy_Tree(N : in out Node_Access) is procedure free is new Ada.Unchecked_Deallocation(Node, Node_Access); begin if N.Left /= null then Destroy_Tree(N.Left); end if; if N.Right /= null then Destroy_Tree(N.Right); end if; Free(N); end Destroy_Tree; function Tree(Value : Integer; Left : Node_Access; Right : Node_Access) return Node_Access is Temp : Node_Access := new Node; begin Temp.Data := Value; Temp.Left := Left; Temp.Right := Right; return Temp; end Tree; procedure Preorder(N : Node_Access) is begin Put(Integer'Image(N.Data)); if N.Left /= null then Preorder(N.Left); end if; if N.Right /= null then Preorder(N.Right); end if; end Preorder; procedure Inorder(N : Node_Access) is begin if N.Left /= null then Inorder(N.Left); end if; Put(Integer'Image(N.Data)); if N.Right /= null then Inorder(N.Right); end if; end Inorder; procedure Postorder(N : Node_Access) is begin if N.Left /= null then Postorder(N.Left); end if; if N.Right /= null then Postorder(N.Right); end if; Put(Integer'Image(N.Data)); end Postorder; procedure Levelorder(N : Node_Access) is package Queues is new Ada.Containers.Doubly_Linked_Lists(Node_Access); use Queues; Node_Queue : List; Next : Node_Access; begin Node_Queue.Append(N); while not Is_Empty(Node_Queue) loop Next := First_Element(Node_Queue); Delete_First(Node_Queue); Put(Integer'Image(Next.Data)); if Next.Left /= null then Node_Queue.Append(Next.Left); end if; if Next.Right /= null then Node_Queue.Append(Next.Right); end if; end loop; end Levelorder; N : Node_Access; begin N := Tree(1, Tree(2, Tree(4, Tree(7, null, null), null), Tree(5, null, null)), Tree(3, Tree(6, Tree(8, null, null), Tree(9, null, null)), null)); Put("preorder: "); Preorder(N); New_Line; Put("inorder: "); Inorder(N); New_Line; Put("postorder: "); Postorder(N); New_Line; Put("level order: "); Levelorder(N); New_Line; Destroy_Tree(N); end Tree_traversal;
cs383_CompOrgAndProc/hw/01asm/03.asm
joshgrib/2017F-coursework
0
99468
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Problem 3: ;; Write an assembly language program to take the next two numbers in memory ;; starting at data space 0x0100. Compare them and output the greater number ;; (if the numbers are equal, output that number). (Points 15) .include "m328Pdef.inc" init: ;; set up aliases .def num1=r16 .def num2=r17 .def val=r18 main: ser r19 ;; r19 = 0xff out DDRB, r19 ;; set PORTB for output lds num1, 0x0100 ;; read number from data space lds num2, 0x0100 ;; read number from data space cp num1, num2 ;; compare numbers bgre bigone ;; go to appropriate case jmp bigtwo bigone: ldi val, num1 ;; store number as the value to ouput jmp end bigtwo: ldi val, num2 ;; store number as the value to ouput jmp end end: out PORTB, val ;; output to port b ret
chapter_02/input_output_library/string_copy_too_long.asm
GeertArien/low-level-programming
0
94225
<reponame>GeertArien/low-level-programming section .rodata err_too_long_msg: db "string is too long", 10, 0 section .data arg1: db '', 0 arg2: times 0 db 66 section .text %include "lib.inc" global _start _start: mov rdi, -1 mov rsi, -1 mov rax, -1 mov rcx, -1 mov rdx, -1 mov r8, -1 mov r9, -1 mov r10, -1 mov r11, -1 push rbx push rbp push r12 push r13 push r14 push r15 mov rdi, arg1 mov rsi, arg2 mov rdx, 0 call string_copy test rax, rax jnz .good mov rdi, err_too_long_msg call print_string jmp exit .good: cmp r15, [rsp] jne .convention_error pop r15 cmp r14, [rsp] jne .convention_error pop r14 cmp r13, [rsp] jne .convention_error pop r13 cmp r12, [rsp] jne .convention_error pop r12 cmp rbp, [rsp] jne .convention_error pop rbp cmp rbx, [rsp] jne .convention_error pop rbx jmp continue .convention_error: mov rax, 1 mov rdi, 2 mov rsi, err_calling_convention mov rdx, err_calling_convention.end - err_calling_convention syscall mov rax, 60 mov rdi, -41 syscall section .data err_calling_convention: db "You did not respect the calling convention! Check that you handled caller-saved and callee-saved registers correctly", 10 .end: section .text continue: mov rdi, arg2 call print_string exit: mov rax, 60 xor rdi, rdi syscall
Definition/LogicalRelation/Substitution/Irrelevance.agda
loic-p/logrel-mltt
0
2901
<reponame>loic-p/logrel-mltt<gh_stars>0 {-# OPTIONS --without-K --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Substitution.Irrelevance {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped open import Definition.Typed open import Definition.LogicalRelation import Definition.LogicalRelation.Irrelevance as LR open import Definition.LogicalRelation.Substitution open import Tools.Product open import Tools.Unit import Tools.PropositionalEquality as PE -- Irrelevance of valid substitutions with different derivations of contexts irrelevanceSubst : ∀ {σ Γ Δ} ([Γ] [Γ]′ : ⊩ᵛ Γ) (⊢Δ ⊢Δ′ : ⊢ Δ) → Δ ⊩ˢ σ ∷ Γ / [Γ] / ⊢Δ → Δ ⊩ˢ σ ∷ Γ / [Γ]′ / ⊢Δ′ irrelevanceSubst ε′ ε′ ⊢Δ ⊢Δ′ [σ] = tt irrelevanceSubst ([Γ] ∙′ [A]) ([Γ]′ ∙′ [A]′) ⊢Δ ⊢Δ′ ([tailσ] , [headσ]) = let [tailσ]′ = irrelevanceSubst [Γ] [Γ]′ ⊢Δ ⊢Δ′ [tailσ] in [tailσ]′ , LR.irrelevanceTerm (proj₁ ([A] ⊢Δ [tailσ])) (proj₁ ([A]′ ⊢Δ′ [tailσ]′)) [headσ] -- Irrelevance of valid substitutions with different contexts -- that are propositionally equal irrelevanceSubst′ : ∀ {σ Γ Δ Δ′} (eq : Δ PE.≡ Δ′) ([Γ] [Γ]′ : ⊩ᵛ Γ) (⊢Δ : ⊢ Δ) (⊢Δ′ : ⊢ Δ′) → Δ ⊩ˢ σ ∷ Γ / [Γ] / ⊢Δ → Δ′ ⊩ˢ σ ∷ Γ / [Γ]′ / ⊢Δ′ irrelevanceSubst′ PE.refl [Γ] [Γ]′ ⊢Δ ⊢Δ′ [σ] = irrelevanceSubst [Γ] [Γ]′ ⊢Δ ⊢Δ′ [σ] -- Irrelevance of valid substitution equality -- with different derivations of contexts irrelevanceSubstEq : ∀ {σ σ′ Γ Δ} ([Γ] [Γ]′ : ⊩ᵛ Γ) (⊢Δ ⊢Δ′ : ⊢ Δ) ([σ] : Δ ⊩ˢ σ ∷ Γ / [Γ] / ⊢Δ) ([σ]′ : Δ ⊩ˢ σ ∷ Γ / [Γ]′ / ⊢Δ′) → Δ ⊩ˢ σ ≡ σ′ ∷ Γ / [Γ] / ⊢Δ / [σ] → Δ ⊩ˢ σ ≡ σ′ ∷ Γ / [Γ]′ / ⊢Δ′ / [σ]′ irrelevanceSubstEq ε′ ε′ ⊢Δ ⊢Δ′ [σ] [σ]′ [σ≡σ′] = tt irrelevanceSubstEq ([Γ] ∙′ [A]) ([Γ]′ ∙′ [A]′) ⊢Δ ⊢Δ′ [σ] [σ]′ [σ≡σ′] = irrelevanceSubstEq [Γ] [Γ]′ ⊢Δ ⊢Δ′ (proj₁ [σ]) (proj₁ [σ]′) (proj₁ [σ≡σ′]) , LR.irrelevanceEqTerm (proj₁ ([A] ⊢Δ (proj₁ [σ]))) (proj₁ ([A]′ ⊢Δ′ (proj₁ [σ]′))) (proj₂ [σ≡σ′]) -- Irrelevance of valid types with different derivations of contexts irrelevance : ∀ {l A Γ} ([Γ] [Γ]′ : ⊩ᵛ Γ) → Γ ⊩ᵛ⟨ l ⟩ A / [Γ] → Γ ⊩ᵛ⟨ l ⟩ A / [Γ]′ irrelevance [Γ] [Γ]′ [A] ⊢Δ [σ] = let [σ]′ = irrelevanceSubst [Γ]′ [Γ] ⊢Δ ⊢Δ [σ] in proj₁ ([A] ⊢Δ [σ]′) , λ [σ′] [σ≡σ′] → proj₂ ([A] ⊢Δ [σ]′) (irrelevanceSubst [Γ]′ [Γ] ⊢Δ ⊢Δ [σ′]) (irrelevanceSubstEq [Γ]′ [Γ] ⊢Δ ⊢Δ [σ] [σ]′ [σ≡σ′]) open import Definition.LogicalRelation.Properties -- Irrelevance of valid types with different derivations of contexts -- with lifting of eqaul types irrelevanceLift : ∀ {l A F H Γ} ([Γ] : ⊩ᵛ Γ) ([F] : Γ ⊩ᵛ⟨ l ⟩ F / [Γ]) ([H] : Γ ⊩ᵛ⟨ l ⟩ H / [Γ]) ([F≡H] : Γ ⊩ᵛ⟨ l ⟩ F ≡ H / [Γ] / [F]) → Γ ∙ F ⊩ᵛ⟨ l ⟩ A / (VPack _ _ (V∙ [Γ] [F])) → Γ ∙ H ⊩ᵛ⟨ l ⟩ A / (VPack _ _ (V∙ [Γ] [H])) irrelevanceLift [Γ] [F] [H] [F≡H] [A] ⊢Δ ([tailσ] , [headσ]) = let [σ]′ = [tailσ] , convTerm₂ (proj₁ ([F] ⊢Δ [tailσ])) (proj₁ ([H] ⊢Δ [tailσ])) ([F≡H] ⊢Δ [tailσ]) [headσ] in proj₁ ([A] ⊢Δ [σ]′) , (λ [σ′] x → let [σ′]′ = proj₁ [σ′] , convTerm₂ (proj₁ ([F] ⊢Δ (proj₁ [σ′]))) (proj₁ ([H] ⊢Δ (proj₁ [σ′]))) ([F≡H] ⊢Δ (proj₁ [σ′])) (proj₂ [σ′]) [tailσ′] = proj₁ [σ′] in proj₂ ([A] ⊢Δ [σ]′) [σ′]′ (proj₁ x , convEqTerm₂ (proj₁ ([F] ⊢Δ [tailσ])) (proj₁ ([H] ⊢Δ [tailσ])) ([F≡H] ⊢Δ [tailσ]) (proj₂ x))) -- Irrelevance of valid type equality with different derivations of -- contexts and types irrelevanceEq : ∀ {l l′ A B Γ} ([Γ] [Γ]′ : ⊩ᵛ Γ) ([A] : Γ ⊩ᵛ⟨ l ⟩ A / [Γ]) ([A]′ : Γ ⊩ᵛ⟨ l′ ⟩ A / [Γ]′) → Γ ⊩ᵛ⟨ l ⟩ A ≡ B / [Γ] / [A] → Γ ⊩ᵛ⟨ l′ ⟩ A ≡ B / [Γ]′ / [A]′ irrelevanceEq [Γ] [Γ]′ [A] [A]′ [A≡B] ⊢Δ [σ] = let [σ]′ = irrelevanceSubst [Γ]′ [Γ] ⊢Δ ⊢Δ [σ] in LR.irrelevanceEq (proj₁ ([A] ⊢Δ [σ]′)) (proj₁ ([A]′ ⊢Δ [σ])) ([A≡B] ⊢Δ [σ]′) -- Irrelevance of valid terms with different derivations of contexts and types irrelevanceTerm : ∀ {l l′ A t Γ} ([Γ] [Γ]′ : ⊩ᵛ Γ) ([A] : Γ ⊩ᵛ⟨ l ⟩ A / [Γ]) ([A]′ : Γ ⊩ᵛ⟨ l′ ⟩ A / [Γ]′) → Γ ⊩ᵛ⟨ l ⟩ t ∷ A / [Γ] / [A] → Γ ⊩ᵛ⟨ l′ ⟩ t ∷ A / [Γ]′ / [A]′ irrelevanceTerm [Γ] [Γ]′ [A] [A]′ [t] ⊢Δ [σ]′ = let [σ] = irrelevanceSubst [Γ]′ [Γ] ⊢Δ ⊢Δ [σ]′ [σA] = proj₁ ([A] ⊢Δ [σ]) [σA]′ = proj₁ ([A]′ ⊢Δ [σ]′) in LR.irrelevanceTerm [σA] [σA]′ (proj₁ ([t] ⊢Δ [σ])) , (λ [σ′] x → LR.irrelevanceEqTerm [σA] [σA]′ ((proj₂ ([t] ⊢Δ [σ])) (irrelevanceSubst [Γ]′ [Γ] ⊢Δ ⊢Δ [σ′]) (irrelevanceSubstEq [Γ]′ [Γ] ⊢Δ ⊢Δ [σ]′ [σ] x))) -- Irrelevance of valid terms with different derivations of -- contexts and types which are propositionally equal irrelevanceTerm′ : ∀ {l l′ A A′ t Γ} (eq : A PE.≡ A′) ([Γ] [Γ]′ : ⊩ᵛ Γ) ([A] : Γ ⊩ᵛ⟨ l ⟩ A / [Γ]) ([A′] : Γ ⊩ᵛ⟨ l′ ⟩ A′ / [Γ]′) → Γ ⊩ᵛ⟨ l ⟩ t ∷ A / [Γ] / [A] → Γ ⊩ᵛ⟨ l′ ⟩ t ∷ A′ / [Γ]′ / [A′] irrelevanceTerm′ {A = A} {t = t} PE.refl [Γ] [Γ]′ [A] [A]′ [t] = irrelevanceTerm {A = A} {t = t} [Γ] [Γ]′ [A] [A]′ [t] -- Irrelevance of valid terms with different derivations of -- contexts and types with a lifting of equal types irrelevanceTermLift : ∀ {l A F H t Γ} ([Γ] : ⊩ᵛ Γ) ([F] : Γ ⊩ᵛ⟨ l ⟩ F / [Γ]) ([H] : Γ ⊩ᵛ⟨ l ⟩ H / [Γ]) ([F≡H] : Γ ⊩ᵛ⟨ l ⟩ F ≡ H / [Γ] / [F]) ([A] : Γ ∙ F ⊩ᵛ⟨ l ⟩ A / (VPack _ _ (V∙ [Γ] [F]))) → Γ ∙ F ⊩ᵛ⟨ l ⟩ t ∷ A / (VPack _ _ (V∙ [Γ] [F])) / [A] → Γ ∙ H ⊩ᵛ⟨ l ⟩ t ∷ A / (VPack _ _ (V∙ [Γ] [H])) / irrelevanceLift {A = A} {F = F} {H = H} [Γ] [F] [H] [F≡H] [A] irrelevanceTermLift [Γ] [F] [H] [F≡H] [A] [t] ⊢Δ ([tailσ] , [headσ]) = let [σ]′ = [tailσ] , convTerm₂ (proj₁ ([F] ⊢Δ [tailσ])) (proj₁ ([H] ⊢Δ [tailσ])) ([F≡H] ⊢Δ [tailσ]) [headσ] in proj₁ ([t] ⊢Δ [σ]′) , (λ [σ′] x → let [σ′]′ = proj₁ [σ′] , convTerm₂ (proj₁ ([F] ⊢Δ (proj₁ [σ′]))) (proj₁ ([H] ⊢Δ (proj₁ [σ′]))) ([F≡H] ⊢Δ (proj₁ [σ′])) (proj₂ [σ′]) [tailσ′] = proj₁ [σ′] in proj₂ ([t] ⊢Δ [σ]′) [σ′]′ (proj₁ x , convEqTerm₂ (proj₁ ([F] ⊢Δ [tailσ])) (proj₁ ([H] ⊢Δ [tailσ])) ([F≡H] ⊢Δ [tailσ]) (proj₂ x))) -- Irrelevance of valid term equality with different derivations of -- contexts and types irrelevanceEqTerm : ∀ {l l′ A t u Γ} ([Γ] [Γ]′ : ⊩ᵛ Γ) ([A] : Γ ⊩ᵛ⟨ l ⟩ A / [Γ]) ([A]′ : Γ ⊩ᵛ⟨ l′ ⟩ A / [Γ]′) → Γ ⊩ᵛ⟨ l ⟩ t ≡ u ∷ A / [Γ] / [A] → Γ ⊩ᵛ⟨ l′ ⟩ t ≡ u ∷ A / [Γ]′ / [A]′ irrelevanceEqTerm {A = A} {t = t} {u = u} [Γ] [Γ]′ [A] [A]′ [t≡u] ⊢Δ [σ] = let [σ]′ = irrelevanceSubst [Γ]′ [Γ] ⊢Δ ⊢Δ [σ] in LR.irrelevanceEqTerm (proj₁ ([A] ⊢Δ [σ]′)) (proj₁ ([A]′ ⊢Δ [σ])) ([t≡u] ⊢Δ [σ]′)
programs/oeis/214/A214982.asm
karttu/loda
1
13059
; A214982: a(n) = (Fibonacci(5n)/Fibonacci(n) - 5)/50. ; 0,1,6,45,300,2080,14196,97461,667590,4576825,31367160,215001216,1473620616,10100397385,69229018950,474503107365,3252291758436,22291541752096,152788493829180,1047227932532925,7177806988136070 cal $0,127546 ; a(n) = F(n)^2 + F(n+1)^2 + F(n+2)^2, where F(n) denotes the n-th Fibonacci number. pow $0,2 mov $1,$0 div $1,32
programs/oeis/191/A191682.asm
jmorken/loda
1
20890
; A191682: Twice A113473. ; 2,4,4,6,6,6,6,8,8,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10 add $0,1 lpb $0,$0 div $0,2 add $2,2 lpe mov $1,$2 add $1,2
45/runtime/rt/dkinit.asm
minblock/msdos
0
162785
TITLE DKINIT.ASM - Disk I/O Initialization/Termination module ;*** ;DKINIT.ASM - Disk I/O initialization/termination module ; ; Copyright <C> 1987, Microsoft Corporation ; ;Purpose: ; This module contains Disk I/O initialization and termination ; support for the BASIC 3.0 runtime. Most of this initialization ; and termination is also necessary for programs which use device ; I/O without using disk I/O. This module will be present in a ; user's program when a program contains statements which need ; disk OR device I/O. ; ;****************************************************************************** INCLUDE switch.inc INCLUDE rmacros.inc ; ; Code Segments ; USESEG <INIT_CODE> ;Initialization USESEG <DV_TEXT> ;Device I/O USESEG <DK_TEXT> ;Disk I/O ; ; Data Segments ; USESEG <_BSS> ;runtime data (uninitialized) USESEG <_DATA> ;runtime data (initialized) USESEG <XIB> ; initializer start segment USESEG <XI> ;initializer segment USESEG <XIE> ; initializer end segment INCLUDE seg.inc INCLUDE baslibma.inc INCLUDE devdef.inc INCLUDE files.inc INCLUDE nhutil.inc INCLUDE rtps.inc INCLUDE compvect.inc ;component vectors INITIALIZER B$xDKINI ;put B$xDKINI in initializer list. SUBTTL Code Externals PAGE externFP B$PEOS sBegin DV_TEXT externNP B$NearRet ;for dispatch vectors in compvect.inc PUBLIC b$dkused ;This public is defined here and b$dkused equ 0 ; referenced in dkutil so that ; dkinit is pulled in when appropriate externNP B$CLOSF ;closes all open files externFP B$IOINI ;installs int handlers externNP B$IOCLOS ;resets int handlers externNP B$TEST_CLOSE ;test if in CLOSE at INT24 time sEnd DV_TEXT sBegin DK_TEXT externNP B$FLUSH sEnd DK_TEXT SUBTTL Runtime data definitions for BASIC Disk I/O PAGE sBegin _DATA ; ; external data ; externW b$run_disp ; RUN time initialization dispatch table externW b$clrt_disp ; CLEAR statement support dispatch table externW b$shli_disp ; Shell initialization dispatch table externW b$shlt_disp ; Shell termination dispatch table externW b$pTEST_CLOSE ; conditional vector to B$TEST_CLOSE externW b$end_disp ; END time termination dispatch table externW b$err_disp ; error dispatch table externW b$pFLUSH ; conditional vector to B$FLUSH externB b$FInput InpTTY = 0 ; possible values of b$FInput InpDsk = 1 InpDefault = 0FFh sEnd _DATA SUBTTL Runtime Disk I/O Initialization PAGE assumes CS,INIT_CODE sBegin INIT_CODE ;*** ;B$xDKINI - Disk I/O initializer ;PLM B$xDKINI() ; ;Purpose: ; Initializer for Disk I/O component. This routine is called ; by the Crt0 startup before _main is called. It will update the ; indirect dispatch tables for the Disk I/O routines. This ; insures that the only time that Disk I/O is accessed is when ; this module is linked into the user program. ; ;Entry: ; None. ; ;Exit: ; Appropriate dispatch vectors filled. ; ;Uses: ; None. ; ;Exceptions: ; None. ;**** cProc B$xDKINI,<FAR> cBegin ; ; update "RUN" time initialization dispatch address to B$CLOSF ; MOV WORD PTR [b$run_disp].DK_RVEC,DV_TEXTOFFSET B$CLOSF ; ; update CLEAR statement dispatch address to B$CLOSF ; MOV WORD PTR [b$clrt_disp].DK_CLTVEC,DV_TEXTOFFSET B$CLOSF ; ; update END statement dispatch address to B$CLOSF ; MOV WORD PTR [b$end_disp].DK_EVEC,DK_TEXTOFFSET B$CLOSF ; ; update SHELL statement initialization dispatch address to B$IOINI ; MOV WORD PTR [b$shli_disp].DK_SIVEC,DK_TEXTOFFSET B$IOINI ; ; update SHELL statement termination dispatch address to B$IOCLOS ; MOV WORD PTR [b$shlt_disp].DK_STVEC,DK_TEXTOFFSET B$IOCLOS ; ; update error dispatch address to B$DKERR ; MOV WORD PTR [b$err_disp].DK_ERVEC,DK_TEXTOFFSET B$DKERR ; initialize granularity dispatchers. MOV b$pFLUSH, DK_TEXTOFFSET B$FLUSH ; Set vector to point to ; real routine MOV b$pTEST_CLOSE, DK_TEXTOFFSET B$TEST_CLOSE ; Set vector to ; real routine cEnd sEnd INIT_CODE assumes CS,DK_TEXT sBegin DK_TEXT ;*** ;B$DKERR ;Purpose: ; Error processing for DK component. ; Added with [3]. ; ;Entry: ; ;Exit: ; ;Uses: ; ;Exceptions: ; ;**** cProc B$DKERR,<NEAR> cBegin or b$FInput,InpDsk ; keep B$PEOS from blowing away stack by ; mapping InpTTY to InpDsk. cCALL B$PEOS ;process print end-of-stmt cEnd sEnd DK_TEXT END
src/test/resources/test03.asm
jeffreybian/mochi8
0
8180
OPTION BINARY ; We want a binary file, not an HP48 one. ALIGN OFF ; And we don't want auto alignement, as some ; data can be made of bytes instead of words. ; Drawing a random maze like this one consists in drawing random diagonal ; lines. There are two possibilities: right-to-left line, and left-to-right ; line. Each line is composed of a 4*4 bitmap. As the lines must form non- ; circular angles, the two bitmaps won't be '/' and '\'. The first one ; (right line) will be a little bit modified. See at the end of this source. ; ; The maze is composed of 8 lines (as the bitmaps are 4 pixels high), each ; line consists of 16 bitmaps. ; Bitmaps are drawn in random mode. We choose a random value (0 or 1). ; If it is 1, we draw a left line bitmap. If it is 0, we draw a right one. ; Rsgister usage: ; ; V0: X-coordinate of the bitmap ; V1: Y-coordinate of the bitmap ; V2: Random number LD V0, 0 LD V1, 0 LOOP: LD I, LEFT ; We draw a left line by default, as the random number ; is 0 or 1. If we suppose that it will be 1, we keep ; drawing the left line. If it is 0, we change register ; I to draw a right line. RND V2, 1 ; Load in V2 a 0...1 random number SE V2, 1 ; It is 1 ? If yes, I still refers to the left line ; bitmap. LD I, RIGHT ; If not, we change I to make it refer the right line ; bitmap. DRW V0, V1, 4 ; And we draw the bitmap at V0, V1. ADD V0, 4 ; The next bitmap is 4 pixels right. So we update ; V0 to do so. SE V0, 64 ; If V0==64, we finished drawing a complete line, so we ; skip the jump to LOOP, as we have to update V1 too. JP LOOP ; We did not draw a complete line ? So we continue ! LD V0, 0 ; The first bitmap of each line is located 0, V1. ADD V1, 4 ; We update V1. The next line is located 4 pixels doan. SE V1, 32 ; Have we drawn all the lines ? If yes, V1==32. JP LOOP ; No ? So we continue ! FIN: JP FIN ; Infinite loop... RIGHT: ; 4*4 bitmap of the left line DB $1....... DB $.1...... DB $..1..... DB $...1.... LEFT: ; 4*4 bitmap of the right line ; And YES, it is like that... DB $..1..... DB $.1...... DB $1....... DB $...1....
src/asis/asis-statements.adb
My-Colaborations/dynamo
15
10858
<gh_stars>10-100 ------------------------------------------------------------------------------ -- -- -- ASIS-for-GNAT IMPLEMENTATION COMPONENTS -- -- -- -- A S I S . S T A T E M E N T S -- -- -- -- B o d y -- -- -- -- Copyright (C) 1995-2011, Free Software Foundation, Inc. -- -- -- -- ASIS-for-GNAT is free software; you can redistribute it and/or modify it -- -- under terms of the GNU General Public License as published by the Free -- -- Software Foundation; either version 2, or (at your option) any later -- -- version. ASIS-for-GNAT is distributed in the hope that it will be use- -- -- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- -- -- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- -- Public License for more details. You should have received a copy of the -- -- GNU General Public License distributed with ASIS-for-GNAT; see file -- -- COPYING. If not, write to the Free Software Foundation, 51 Franklin -- -- Street, Fifth Floor, Boston, MA 02110-1301, USA. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the -- -- Software Engineering Laboratory of the Swiss Federal Institute of -- -- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the -- -- Scientific Research Computer Center of Moscow State University (SRCC -- -- MSU), Russia, with funding partially provided by grants from the Swiss -- -- National Science Foundation and the Swiss Academy of Engineering -- -- Sciences. ASIS-for-GNAT is now maintained by AdaCore -- -- (http://www.adacore.com). -- -- -- ------------------------------------------------------------------------------ with Asis.Declarations; use Asis.Declarations; with Asis.Elements; use Asis.Elements; with Asis.Errors; use Asis.Errors; with Asis.Exceptions; use Asis.Exceptions; with Asis.Expressions; use Asis.Expressions; with Asis.Extensions; use Asis.Extensions; with Asis.Set_Get; use Asis.Set_Get; with A4G.A_Sem; use A4G.A_Sem; with A4G.A_Sinput; use A4G.A_Sinput; with A4G.Contt.UT; use A4G.Contt.UT; with A4G.Mapping; use A4G.Mapping; with A4G.Norm; use A4G.Norm; with A4G.Vcheck; use A4G.Vcheck; with A4G.Span_End; use A4G.Span_End; with Atree; use Atree; with Nlists; use Nlists; with Sinfo; use Sinfo; with Sinput; use Sinput; package body Asis.Statements is Package_Name : constant String := "Asis.Statements."; --------------------------- -- ASIS 2005 Draft stuff -- --------------------------- ------------------------ -- Associated_Message -- ------------------------ function Associated_Message (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); begin Check_Validity (Statement, Package_Name & "Associated_Message"); if not (Arg_Kind = A_Raise_Statement) then Raise_ASIS_Inappropriate_Element (Diagnosis => Package_Name & "Associated_Message", Wrong_Kind => Arg_Kind); end if; return Node_To_Element_New (Node => Sinfo.Expression (Node (Statement)), Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Associated_Message"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Associated_Message", Ex => Ex, Arg_Element => Statement); end Associated_Message; ---------------------------------------- -- Extended_Return_Exception_Handlers -- ---------------------------------------- function Extended_Return_Exception_Handlers (Statement : Asis.Statement; Include_Pragmas : Boolean := False) return Asis.Exception_Handler_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Resilt_List : List_Id := No_List; begin Check_Validity (Statement, Package_Name & "Extended_Return_Exception_Handlers"); if not (Arg_Kind = An_Extended_Return_Statement) then Raise_ASIS_Inappropriate_Element (Diagnosis => Package_Name & "Extended_Return_Exception_Handlers", Wrong_Kind => Arg_Kind); end if; if Present (Handled_Statement_Sequence (Node (Statement))) then Resilt_List := Exception_Handlers (Handled_Statement_Sequence (Node (Statement))); end if; return N_To_E_List_New (List => Resilt_List, Include_Pragmas => Include_Pragmas, Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Extended_Return_Exception_Handlers"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Extended_Return_Exception_Handlers", Ex => Ex, Arg_Element => Statement); end Extended_Return_Exception_Handlers; -------------------------------- -- Extended_Return_Statements -- -------------------------------- function Extended_Return_Statements (Statement : Asis.Statement; Include_Pragmas : Boolean := False) return Asis.Statement_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Result_List : List_Id := No_List; begin Check_Validity (Statement, Package_Name & "Extended_Return_Statements"); if not (Arg_Kind = An_Extended_Return_Statement) then Raise_ASIS_Inappropriate_Element (Diagnosis => Package_Name & "Extended_Return_Statements", Wrong_Kind => Arg_Kind); end if; if Present (Handled_Statement_Sequence (Node (Statement))) then Result_List := Sinfo.Statements (Handled_Statement_Sequence (Node (Statement))); end if; return N_To_E_List_New (List => Result_List, Include_Pragmas => Include_Pragmas, Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Extended_Return_Statements"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Extended_Return_Statements", Ex => Ex, Arg_Element => Statement); end Extended_Return_Statements; ------------------------------- -- Return_Object_Declaration -- ------------------------------- function Return_Object_Declaration (Statement : Asis.Statement) return Asis.Declaration is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Result_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Return_Object_Declaration"); if not (Arg_Kind = An_Extended_Return_Statement) then Raise_ASIS_Inappropriate_Element (Diagnosis => Package_Name & "Return_Object_Declaration", Wrong_Kind => Arg_Kind); end if; Result_Node := First (Return_Object_Declarations (Node (Statement))); while Nkind (Result_Node) /= N_Object_Declaration loop -- It may be some internal subtypes here Result_Node := Next (Result_Node); end loop; return Node_To_Element_New (Node => Result_Node, Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Return_Object_Declaration"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Return_Object_Declaration", Ex => Ex, Arg_Element => Statement); end Return_Object_Declaration; ------------------------------------------------------------------------------ ------------------- -- Aborted_Tasks -- ------------------- function Aborted_Tasks (Statement : Asis.Statement) return Asis.Expression_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Aborted_Tasks"); if not (Arg_Kind = An_Abort_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Aborted_Tasks", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); return N_To_E_List_New (List => Names (Arg_Node), Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Aborted_Tasks"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Aborted_Tasks", Ex => Ex, Arg_Element => Statement); end Aborted_Tasks; ------------------------------------ -- Accept_Body_Exception_Handlers -- ------------------------------------ function Accept_Body_Exception_Handlers (Statement : Asis.Statement; Include_Pragmas : Boolean := False) return Asis.Exception_Handler_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Resilt_List : List_Id := No_List; begin Check_Validity (Statement, Package_Name & "Accept_Body_Exception_Handlers"); if not (Arg_Kind = An_Accept_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Accept_Body_Exception_Handlers", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); if Present (Handled_Statement_Sequence (Arg_Node)) then Resilt_List := Exception_Handlers (Handled_Statement_Sequence (Arg_Node)); end if; return N_To_E_List_New (List => Resilt_List, Include_Pragmas => Include_Pragmas, Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Bool_Par => Include_Pragmas, Outer_Call => Package_Name & "Accept_Body_Exception_Handlers"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Accept_Body_Exception_Handlers", Ex => Ex, Arg_Element => Statement, Bool_Par_ON => Include_Pragmas); end Accept_Body_Exception_Handlers; ---------------------------- -- Accept_Body_Statements -- ---------------------------- function Accept_Body_Statements (Statement : Asis.Statement; Include_Pragmas : Boolean := False) return Asis.Statement_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Resilt_List : List_Id := No_List; begin Check_Validity (Statement, Package_Name & "Accept_Body_Statements"); if not (Arg_Kind = An_Accept_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Accept_Body_Statements", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); if Present (Handled_Statement_Sequence (Arg_Node)) then Resilt_List := Sinfo.Statements (Handled_Statement_Sequence (Arg_Node)); end if; return N_To_E_List_New (List => Resilt_List, Include_Pragmas => Include_Pragmas, Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Bool_Par => Include_Pragmas, Outer_Call => Package_Name & "Accept_Body_Statements"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Accept_Body_Statements", Ex => Ex, Arg_Element => Statement, Bool_Par_ON => Include_Pragmas); end Accept_Body_Statements; ------------------------------ -- Accept_Entry_Direct_Name -- ------------------------------ function Accept_Entry_Direct_Name (Statement : Asis.Statement) return Asis.Name is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Accept_Entry_Direct_Name"); if not (Arg_Kind = An_Accept_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Accept_Entry_Direct_Name", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); return Node_To_Element_New ( Node => Entry_Direct_Name (Arg_Node), Internal_Kind => An_Identifier, Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Accept_Entry_Direct_Name"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Accept_Entry_Direct_Name", Ex => Ex, Arg_Element => Statement); end Accept_Entry_Direct_Name; ------------------------ -- Accept_Entry_Index -- ------------------------ function Accept_Entry_Index (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Result_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Accept_Entry_Index"); if not (Arg_Kind = An_Accept_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Accept_Entry_Index", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); Result_Node := Entry_Index (Arg_Node); if No (Result_Node) then return Nil_Element; else return Node_To_Element_New (Node => Result_Node, Starting_Element => Statement); end if; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Accept_Entry_Index"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Accept_Entry_Index", Ex => Ex, Arg_Element => Statement); end Accept_Entry_Index; ----------------------- -- Accept_Parameters -- ----------------------- function Accept_Parameters (Statement : Asis.Statement) return Asis.Parameter_Specification_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Accept_Parameters"); if not (Arg_Kind = An_Accept_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Accept_Parameters", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); return N_To_E_List_New (List => Parameter_Specifications (Arg_Node), Starting_Element => Statement, Internal_Kind => A_Parameter_Specification); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Accept_Parameters"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Accept_Parameters", Ex => Ex, Arg_Element => Statement); end Accept_Parameters; --------------------------- -- Assignment_Expression -- --------------------------- function Assignment_Expression (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Assignment_Expression"); if not (Arg_Kind = An_Assignment_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Assignment_Expression", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); return Node_To_Element_New ( Node => Sinfo.Expression (Arg_Node), Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Assignment_Expression"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Assignment_Expression", Ex => Ex, Arg_Element => Statement); end Assignment_Expression; ------------------------------ -- Assignment_Variable_Name -- ------------------------------ function Assignment_Variable_Name (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Assignment_Variable_Name"); if not (Arg_Kind = An_Assignment_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Assignment_Variable_Name", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); return Node_To_Element_New ( Node => Sinfo.Name (Arg_Node), Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Assignment_Variable_Name"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Assignment_Variable_Name", Ex => Ex, Arg_Element => Statement); end Assignment_Variable_Name; ----------------------------- -- Block_Declarative_Items -- ----------------------------- function Block_Declarative_Items (Statement : Asis.Statement; Include_Pragmas : Boolean := False) return Asis.Declarative_Item_List is Arg_El : Asis.Element; Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Block_Declarative_Items"); if not (Arg_Kind = A_Block_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Block_Declarative_Items", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); Arg_El := Statement; if Special_Case (Arg_El) = A_Dummy_Block_Statement then Set_Special_Case (Arg_El, Not_A_Special_Case); end if; return N_To_E_List_New (List => Sinfo.Declarations (Arg_Node), Include_Pragmas => Include_Pragmas, Starting_Element => Arg_El); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Bool_Par => Include_Pragmas, Outer_Call => Package_Name & "Block_Declarative_Items"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Block_Declarative_Items", Ex => Ex, Arg_Element => Statement, Bool_Par_ON => Include_Pragmas); end Block_Declarative_Items; ------------------------------ -- Block_Exception_Handlers -- ------------------------------ function Block_Exception_Handlers (Statement : Asis.Statement; Include_Pragmas : Boolean := False) return Asis.Exception_Handler_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Arg_El : Asis.Element; begin Check_Validity (Statement, Package_Name & "Block_Exception_Handlers"); if not (Arg_Kind = A_Block_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Block_Exception_Handlers", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); if Special_Case (Statement) = A_Dummy_Block_Statement and then No (Handled_Statement_Sequence (Arg_Node)) then -- for the dummy block originated from the package_body_declaration -- having no handled_sequence_of_statements on its own. return Nil_Element_List; end if; Arg_El := Statement; if Special_Case (Arg_El) = A_Dummy_Block_Statement then Set_Special_Case (Arg_El, Not_A_Special_Case); end if; return N_To_E_List_New (List => Exception_Handlers (Handled_Statement_Sequence (Arg_Node)), Include_Pragmas => Include_Pragmas, Starting_Element => Arg_El); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Bool_Par => Include_Pragmas, Outer_Call => Package_Name & "Block_Exception_Handlers"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Block_Exception_Handlers", Ex => Ex, Arg_Element => Statement, Bool_Par_ON => Include_Pragmas); end Block_Exception_Handlers; ---------------------- -- Block_Statements -- ---------------------- function Block_Statements (Statement : Asis.Statement; Include_Pragmas : Boolean := False) return Asis.Statement_List is Arg_El : Asis.Element; Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Block_Statements"); if not (Arg_Kind = A_Block_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Block_Statements", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); Arg_El := Statement; if Special_Case (Arg_El) = A_Dummy_Block_Statement then Set_Special_Case (Arg_El, Not_A_Special_Case); end if; return N_To_E_List_New (List => Sinfo.Statements (Handled_Statement_Sequence (Arg_Node)), Include_Pragmas => Include_Pragmas, Starting_Element => Arg_El); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Bool_Par => Include_Pragmas, Outer_Call => Package_Name & "Block_Statements"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Block_Statements", Ex => Ex, Arg_Element => Statement, Bool_Par_ON => Include_Pragmas); end Block_Statements; ------------------------------- -- Call_Statement_Parameters -- ------------------------------- function Call_Statement_Parameters (Statement : Asis.Statement; Normalized : Boolean := False) return Asis.Association_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Res_Norm_Case : Normalization_Cases := Is_Not_Normalized; Res_Node_List : List_Id; begin Check_Validity (Statement, Package_Name & "Call_Statement_Parameters"); Arg_Node := Node (Statement); if (not (Arg_Kind = An_Entry_Call_Statement or else Arg_Kind = A_Procedure_Call_Statement)) or else (Normalized and then Nkind (Arg_Node) = N_Attribute_Reference) then Raise_ASIS_Inappropriate_Element (Package_Name & "Call_Statement_Parameters", Wrong_Kind => Arg_Kind); end if; if Is_Prefix_Notation (Statement) then Arg_Node := R_Node (Statement); end if; if Normalized then Res_Norm_Case := Is_Normalized; end if; if Normalized and then Nkind (Arg_Node) /= N_Attribute_Reference then if No (Parameter_Associations (Arg_Node)) or else Is_Nil (Corresponding_Called_Entity (Statement)) then return Nil_Element_List; else return Normalized_Param_Associations (Call_Elem => Statement); end if; else if Nkind (Arg_Node) = N_Attribute_Reference then -- call to 'Output, 'Read or 'Write Res_Node_List := Sinfo.Expressions (Arg_Node); else Res_Node_List := Parameter_Associations (Arg_Node); end if; return N_To_E_List_New (List => Res_Node_List, Internal_Kind => A_Parameter_Association, Norm_Case => Res_Norm_Case, Starting_Element => Statement); end if; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Bool_Par => Normalized, Outer_Call => Package_Name & "Call_Statement_Parameters"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Call_Statement_Parameters", Ex => Ex, Arg_Element => Statement, Bool_Par_ON => Normalized); end Call_Statement_Parameters; ----------------- -- Called_Name -- ----------------- function Called_Name (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; -- local variables needed for processing calls to 'Output, 'Read -- and 'Write: Result_Kind : Internal_Element_Kinds := Not_An_Element; Result_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Called_Name"); if not (Arg_Kind = An_Entry_Call_Statement or else Arg_Kind = A_Procedure_Call_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Called_Name", Wrong_Kind => Arg_Kind); end if; if Is_Prefix_Notation (Statement) then Arg_Node := R_Node (Statement); else Arg_Node := Node (Statement); end if; if Nkind (Arg_Node) = N_Attribute_Reference then -- calls like T'Output (...); T'Read (...) and T'Write (...) -- should be processed separately, and the result should -- be built on the same node as argument Result_Kind := Subprogram_Attribute_Kind (Arg_Node); Result_Node := Arg_Node; else Result_Node := Sinfo.Name (Arg_Node); end if; if Is_Rewrite_Substitution (Result_Node) and then Nkind (Result_Node) = N_Explicit_Dereference and then Nkind (Prefix (Result_Node)) = N_Function_Call then -- Needed to process cases like F (1), where F - parameterless -- function that returns access-to-subprogram result. Result_Node := Prefix (Result_Node); end if; return Node_To_Element_New ( Starting_Element => Statement, Node => Result_Node, Internal_Kind => Result_Kind); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Called_Name"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Called_Name", Ex => Ex, Arg_Element => Statement); end Called_Name; --------------------- -- Case_Expression -- --------------------- function Case_Expression (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Case_Expression"); if not (Arg_Kind = A_Case_Statement or else Arg_Kind = A_Case_Expression) then Raise_ASIS_Inappropriate_Element (Package_Name & "Case_Expression", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); return Node_To_Element_New (Node => Sinfo.Expression (Arg_Node), Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Case_Expression"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Case_Expression", Ex => Ex, Arg_Element => Statement); end Case_Expression; ---------------------------------------- -- Case_Statement_Alternative_Choices -- ---------------------------------------- function Case_Statement_Alternative_Choices (Path : Asis.Path) return Asis.Element_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Path); Arg_Node : Node_Id; begin Check_Validity (Path, Package_Name & "Case_Statement_Alternative_Choices"); if not (Arg_Kind = A_Case_Path) then Raise_ASIS_Inappropriate_Element (Package_Name & "Case_Statement_Alternative_Choices", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Path); return Discrete_Choice_Node_To_Element_List ( Choice_List => Discrete_Choices (Arg_Node), Starting_Element => Path); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Path, Outer_Call => Package_Name & "Case_Statement_Alternative_Choices"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Case_Statement_Alternative_Choices", Ex => Ex, Arg_Element => Path); end Case_Statement_Alternative_Choices; ----------------------------------- -- Choice_Parameter_Specification -- ------------------------------------- function Choice_Parameter_Specification (Handler : Asis.Exception_Handler) return Asis.Declaration is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Handler); Arg_Node : Node_Id; Result_Node : Node_Id; begin Check_Validity (Handler, Package_Name & "Choice_Parameter_Specification"); if not (Arg_Kind = An_Exception_Handler) then Raise_ASIS_Inappropriate_Element (Package_Name & "Choice_Parameter_Specification", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Handler); Result_Node := Choice_Parameter (Arg_Node); if No (Result_Node) then return Nil_Element; else return Node_To_Element_New ( Node => Result_Node, Internal_Kind => A_Choice_Parameter_Specification, Starting_Element => Handler); end if; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Handler, Outer_Call => Package_Name & "Choice_Parameter_Specification"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Choice_Parameter_Specification", Ex => Ex, Arg_Element => Handler); end Choice_Parameter_Specification; -------------------------- -- Condition_Expression -- -------------------------- function Condition_Expression (Path : Asis.Path) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Path); Res_Node : Node_Id := Empty; Arg_Node : Node_Id; begin Check_Validity (Path, Package_Name & "Condition_Expression"); if not (Arg_Kind = An_If_Path or else Arg_Kind = An_Elsif_Path or else Arg_Kind = An_If_Expression_Path or else Arg_Kind = An_Elsif_Expression_Path) then Raise_ASIS_Inappropriate_Element (Package_Name & "Condition_Expression", Wrong_Kind => Arg_Kind); end if; Arg_Node := R_Node (Path); case Arg_Kind is when An_If_Path | An_Elsif_Path => Res_Node := Condition (Arg_Node); when An_If_Expression_Path | An_Elsif_Expression_Path => Res_Node := Prev (Arg_Node); when others => null; end case; return Node_To_Element_New (Node => Res_Node, Starting_Element => Path); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Path, Outer_Call => Package_Name & "Condition_Expression"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Condition_Expression", Ex => Ex, Arg_Element => Path); end Condition_Expression; --------------------------------- -- Corresponding_Called_Entity -- --------------------------------- function Corresponding_Called_Entity (Statement : Asis.Statement) return Asis.Declaration is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); begin Check_Validity (Statement, Package_Name & "Corresponding_Called_Entity"); if not (Arg_Kind = An_Entry_Call_Statement or else Arg_Kind = A_Procedure_Call_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Corresponding_Called_Entity", Wrong_Kind => Arg_Kind); end if; return Get_Corr_Called_Entity (Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Corresponding_Called_Entity"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Corresponding_Called_Entity", Ex => Ex, Arg_Element => Statement); end Corresponding_Called_Entity; ----------------------------------------- -- Corresponding_Destination_Statement -- ----------------------------------------- function Corresponding_Destination_Statement (Statement : Asis.Statement) return Asis.Statement is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Res_Label : Node_Id; Res_Stmt : Node_Id; begin Check_Validity (Statement, Package_Name & "Corresponding_Destination_Statement"); if not (Arg_Kind = A_Goto_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Corresponding_Destination_Statement", Wrong_Kind => Arg_Kind); end if; Arg_Node := R_Node (Statement); if Is_Rewrite_Substitution (Arg_Node) and then Nkind (Arg_Node) = N_Loop_Statement and then Nkind (Original_Node (Arg_Node)) = N_Goto_Statement then -- goto statement is rewritten into infinite loop if not Is_Empty_List (Sinfo.Statements (Arg_Node)) then Res_Stmt := First (Sinfo.Statements (Arg_Node)); else -- Pathological case: -- -- <<Junk>> goto Junk; Res_Stmt := Arg_Node; end if; else Arg_Node := Node (Statement); Res_Label := Parent (Entity (Sinfo.Name (Arg_Node))); -- this is N_Implicit_Label_Declaration node representing the -- implicit declaration of the destination label Res_Stmt := Label_Construct (Res_Label); while not Is_Statement (Res_Stmt) loop Res_Stmt := Next (Res_Stmt); end loop; -- if we are in the tree corresponding to a successful compiler -- run, we shall for sure find a statement after any label! end if; return Node_To_Element_New (Node => Res_Stmt, Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Corresponding_Destination_Statement"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Corresponding_Destination_Statement", Ex => Ex, Arg_Element => Statement); end Corresponding_Destination_Statement; ------------------------- -- Corresponding_Entry -- ------------------------- function Corresponding_Entry (Statement : Asis.Statement) return Asis.Declaration is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Res_Entry_Dcl : Node_Id; Result_Unit : Compilation_Unit; begin Check_Validity (Statement, Package_Name & "Corresponding_Entry"); if not (Arg_Kind = An_Accept_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Corresponding_Entry", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); Res_Entry_Dcl := Parent (Entity (Entry_Direct_Name (Arg_Node))); Result_Unit := Enclosing_Unit (Encl_Cont_Id (Statement), Res_Entry_Dcl); return Node_To_Element_New (Node => Res_Entry_Dcl, In_Unit => Result_Unit); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Corresponding_Entry"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Corresponding_Entry", Ex => Ex, Arg_Element => Statement); end Corresponding_Entry; ------------------------------- -- Corresponding_Loop_Exited -- ------------------------------- function Corresponding_Loop_Exited (Statement : Asis.Statement) return Asis.Statement is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Res_Loop : Node_Id; Loop_Name : Node_Id; begin Check_Validity (Statement, Package_Name & "Corresponding_Loop_Exited"); if not (Arg_Kind = An_Exit_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Corresponding_Loop_Exited", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); Loop_Name := Sinfo.Name (Arg_Node); if Present (Loop_Name) then -- we simply jump to the result loop: Loop_Name := Parent (Entity (Loop_Name)); -- here we are in the implicit declaration of the loop name Res_Loop := Label_Construct (Loop_Name); else -- here we have to traverse the tree up to the first enclosing -- loop statement Res_Loop := Parent (Arg_Node); while Nkind (Res_Loop) /= N_Loop_Statement loop Res_Loop := Parent (Res_Loop); end loop; end if; return Node_To_Element_New (Node => Res_Loop, Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Corresponding_Loop_Exited"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Corresponding_Loop_Exited", Ex => Ex, Arg_Element => Statement); end Corresponding_Loop_Exited; ---------------------- -- Delay_Expression -- ---------------------- function Delay_Expression (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Delay_Expression"); if not (Arg_Kind = A_Delay_Until_Statement or else Arg_Kind = A_Delay_Relative_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Delay_Expression", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); return Node_To_Element_New (Node => Sinfo.Expression (Arg_Node), Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Delay_Expression"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Delay_Expression", Ex => Ex, Arg_Element => Statement); end Delay_Expression; ----------------------- -- Exception_Choices -- ----------------------- function Exception_Choices (Handler : Asis.Exception_Handler) return Asis.Element_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Handler); Arg_Node : Node_Id; begin Check_Validity (Handler, Package_Name & "Exception_Choices"); if not (Arg_Kind = An_Exception_Handler) then Raise_ASIS_Inappropriate_Element (Package_Name & "Exception_Choices", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Handler); return N_To_E_List_New (List => Exception_Choices (Arg_Node), Starting_Element => Handler); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Handler, Outer_Call => Package_Name & "Exception_Choices"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Exception_Choices", Ex => Ex, Arg_Element => Handler); end Exception_Choices; -------------------- -- Exit_Condition -- -------------------- function Exit_Condition (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Result_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Exit_Condition"); if not (Arg_Kind = An_Exit_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Exit_Loop_Name", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); Result_Node := Condition (Arg_Node); if No (Result_Node) then return Nil_Element; else return Node_To_Element_New (Node => Result_Node, Starting_Element => Statement); end if; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Exit_Condition"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Exit_Condition", Ex => Ex, Arg_Element => Statement); end Exit_Condition; -------------------- -- Exit_Loop_Name -- -------------------- function Exit_Loop_Name (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Result_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Exit_Loop_Name"); if not (Arg_Kind = An_Exit_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Exit_Loop_Name", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); Result_Node := Sinfo.Name (Arg_Node); if No (Result_Node) then return Nil_Element; else return Node_To_Element_New (Node => Result_Node, Starting_Element => Statement); end if; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Exit_Loop_Name"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Exit_Loop_Name", Ex => Ex, Arg_Element => Statement); end Exit_Loop_Name; -------------------------------------- -- For_Loop_Parameter_Specification -- -------------------------------------- function For_Loop_Parameter_Specification (Statement : Asis.Statement) return Asis.Declaration is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Res_Node : Node_Id; Res_Kind : Internal_Element_Kinds := Not_An_Element; begin Check_Validity (Statement, Package_Name & "For_Loop_Parameter_Specification"); if not (Arg_Kind = A_For_Loop_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "For_Loop_Parameter_Specification", Wrong_Kind => Arg_Kind); end if; Res_Node := Iteration_Scheme (Node (Statement)); if Present (Iterator_Specification (Res_Node)) then Res_Node := Iterator_Specification (Res_Node); if Of_Present (Res_Node) then Res_Kind := An_Element_Iterator_Specification; else Res_Kind := A_Generalized_Iterator_Specification; end if; elsif Present (Loop_Parameter_Specification (Res_Node)) then Res_Node := Loop_Parameter_Specification (Res_Node); Res_Kind := A_Loop_Parameter_Specification; else null; pragma Assert (False); end if; return Node_To_Element_New ( Node => Res_Node, Internal_Kind => Res_Kind, Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "For_Loop_Parameter_Specification"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "For_Loop_Parameter_Specification", Ex => Ex, Arg_Element => Statement); end For_Loop_Parameter_Specification; ---------------- -- Goto_Label -- ---------------- function Goto_Label (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Goto_Label"); if not (Arg_Kind = A_Goto_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Goto_Label", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); return Node_To_Element_New (Node => Sinfo.Name (Arg_Node), Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Goto_Label"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Goto_Label", Ex => Ex, Arg_Element => Statement); end Goto_Label; ----------- -- Guard -- ----------- function Guard (Path : Asis.Path) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Path); Arg_Node : Node_Id; Result_Node : Node_Id; begin Check_Validity (Path, Package_Name & "Guard"); if not (Arg_Kind = A_Select_Path or else Arg_Kind = An_Or_Path) then Raise_ASIS_Inappropriate_Element (Package_Name & "Guard", Wrong_Kind => Arg_Kind); end if; if not (Nkind (Parent (R_Node (Path))) = N_Selective_Accept) then return Nil_Element; end if; Arg_Node := Node (Path); Result_Node := Condition (Arg_Node); if No (Result_Node) then return Nil_Element; else return Node_To_Element_New (Node => Result_Node, Starting_Element => Path); end if; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Path, Outer_Call => Package_Name & "Guard"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Guard", Ex => Ex, Arg_Element => Path); end Guard; ------------------------ -- Handler_Statements -- ------------------------ function Handler_Statements (Handler : Asis.Exception_Handler; Include_Pragmas : Boolean := False) return Asis.Statement_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Handler); Arg_Node : Node_Id; begin Check_Validity (Handler, Package_Name & "Handler_Statements"); if not (Arg_Kind = An_Exception_Handler) then Raise_ASIS_Inappropriate_Element (Package_Name & "Handler_Statements", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Handler); return N_To_E_List_New (List => Sinfo.Statements (Arg_Node), Include_Pragmas => Include_Pragmas, Starting_Element => Handler); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Handler, Bool_Par => Include_Pragmas, Outer_Call => Package_Name & "Handler_Statements"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Handler_Statements", Ex => Ex, Arg_Element => Handler, Bool_Par_ON => Include_Pragmas); end Handler_Statements; -------------------------------------- -- Is_Call_On_Dispatching_Operation -- -------------------------------------- function Is_Call_On_Dispatching_Operation (Call : Asis.Element) return Boolean is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Call); Called_Entity : Asis.Element; begin -- Just the first version, should be tested more carefully! -- Is currently implemented as a secondary query based on -- some queries from Asis.Extensions. -- ??? !!! -- Still depends on partially implemented queries from -- Asis.Extensions Check_Validity (Call, Package_Name & "Is_Call_On_Dispatching_Operation"); if not (Arg_Kind = A_Function_Call or else Arg_Kind = A_Procedure_Call_Statement) then return False; end if; if Arg_Kind = A_Function_Call then Called_Entity := Corresponding_Called_Function (Call); else Called_Entity := Corresponding_Called_Entity (Call); end if; if Is_Nil (Called_Entity) or else (not Is_Dispatching_Operation (Called_Entity)) then return False; else return True; end if; -- Owning_Type := Primary_Owner (Called_Entity); -- Owning_Type := Type_Declaration_View (Owning_Type); -- Owning_Type_Kind := Int_Kind (Owning_Type); -- return -- (Owning_Type_Kind = A_Tagged_Private_Type_Definition or else -- Owning_Type_Kind = A_Private_Extension_Definition or else -- Owning_Type_Kind = A_Derived_Record_Extension_Definition or else -- Owning_Type_Kind = A_Tagged_Record_Type_Definition); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Call, Outer_Call => Package_Name & "Is_Call_On_Dispatching_Operation"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Is_Call_On_Dispatching_Operation", Ex => Ex, Arg_Element => Call); end Is_Call_On_Dispatching_Operation; ---------------------- -- Is_Declare_Block -- ---------------------- function Is_Declare_Block (Statement : Asis.Statement) return Boolean is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; First_Letter : Character; -- the first character of the statement, should be either -- B[egin] or D[eclare] begin -- If the argument represents the dummy block statement created by -- the Asis_Declarations.Body_Block_Statement (obsolescent!) -- function, the result will be True if and only if the -- corresponding body has any declarative item on its own. Check_Validity (Statement, Package_Name & "Is_Declare_Block"); if not (Arg_Kind = A_Block_Statement) then return False; end if; Arg_Node := Node (Statement); if Special_Case (Statement) = A_Dummy_Block_Statement then if Present (Sinfo.Declarations (Arg_Node)) then return True; else return False; end if; else -- a "normal" block statement: here we should be more accurate, and -- we cannot rely on "Present (Declarations (Arg_Node))" approach -- because of the implicit label declarations First_Letter := Source_Text (Get_Source_File_Index ( Sloc (Arg_Node))) -- the unit's text buffer (Sloc (Arg_Node)); case First_Letter is when 'b' | 'B' => return False; when 'd' | 'D' => return True; when others => -- Unexpected beginning of the block statement raise Internal_Implementation_Error; end case; end if; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Is_Declare_Block"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Is_Declare_Block", Ex => Ex, Arg_Element => Statement); end Is_Declare_Block; ------------------------- -- Is_Dispatching_Call -- ------------------------- function Is_Dispatching_Call (Call : Asis.Element) return Boolean is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Call); Arg_Node : Node_Id := R_Node (Call); begin Check_Validity (Call, Package_Name & "Is_Dispatching_Call"); if not (Arg_Kind = A_Function_Call or else Arg_Kind = A_Procedure_Call_Statement) then return False; end if; if Is_Prefix_Notation (Call) and then Nkind (Arg_Node) = N_Explicit_Dereference and then Is_Rewrite_Substitution (Arg_Node) and then Nkind (Original_Node (Arg_Node)) = N_Function_Call then Arg_Node := Prefix (Arg_Node); end if; if not (Nkind (Arg_Node) = N_Function_Call or else Nkind (Arg_Node) = N_Procedure_Call_Statement) then -- this may be possible as a result of tree rewriting, but if we -- have rewriting, we do not have a dispatching call, so: return False; else return Present (Controlling_Argument (Arg_Node)); end if; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Call, Outer_Call => Package_Name & "Is_Dispatching_Call"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Is_Dispatching_Call", Ex => Ex, Arg_Element => Call); end Is_Dispatching_Call; ---------------------- -- Is_Name_Repeated -- ---------------------- function Is_Name_Repeated (Statement : Asis.Statement) return Boolean is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Last_Comp : Asis.Element; S : Source_Ptr; Result : Boolean; begin Check_Validity (Statement, Package_Name & "Is_Name_Repeated"); if not (Arg_Kind = A_Loop_Statement or else Arg_Kind = A_While_Loop_Statement or else Arg_Kind = A_For_Loop_Statement or else Arg_Kind = A_Block_Statement or else Arg_Kind = An_Accept_Statement) then Result := False; end if; if Arg_Kind = A_Loop_Statement or else Arg_Kind = A_While_Loop_Statement or else Arg_Kind = A_For_Loop_Statement or else Arg_Kind = A_Block_Statement then Result := not Asis.Elements.Is_Nil (Statement_Identifier (Statement)); elsif Arg_Kind = An_Accept_Statement then if Is_Nil (Accept_Body_Statements (Statement, True)) then -- no statements - no "do .. end;" part - no "end" -- to repeat the name after Result := False; else Last_Comp := Get_Last_Component (Statement); S := Set_Image_End (Last_Comp); -- now S points to the last character (it for sure is ';') -- of the last component (a statement, an exception -- handler or pragma) in the accept statement. -- First, we reset S to point onto the first character -- after the final end of the accept statement: -- the final "end" lexically is an identifier, so: S := Next_Identifier (S); S := S + 3; -- the first character after "end" S := Rightmost_Non_Blank (S); -- and the final check - what follows the final "end" if Get_Character (S) = ';' then Result := False; else Result := True; end if; end if; end if; return Result; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Is_Name_Repeated"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Is_Name_Repeated", Ex => Ex, Arg_Element => Statement); end Is_Name_Repeated; ----------------- -- Label_Names -- ----------------- function Label_Names (Statement : Asis.Statement) return Asis.Defining_Name_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Parent_Node : Node_Id; Labels_Number : Nat := 0; -- how many labels the statement has Label_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Label_Names"); if not (Arg_Kind in Internal_Statement_Kinds) then Raise_ASIS_Inappropriate_Element (Package_Name & "Label_Names", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); -- First, process a special case when an infinite loop is programmed as -- -- <<Target>> Stmt; -- ... -- goto Target; -- -- If Stmt has exactly one label attached to it, the front-end rewrites -- this construct as a subtree headed by N_Loop_Statement node Parent_Node := Parent (R_Node (Statement)); if Nkind (Parent_Node) = N_Loop_Statement and then Is_Rewrite_Substitution (Parent_Node) and then Nkind (Original_Node (Parent_Node)) = N_Goto_Statement and then Arg_Node = First (Sinfo.Statements (Parent_Node)) then return (1 => Node_To_Element_New (Node => Sinfo.Identifier (Parent_Node), Internal_Kind => A_Defining_Identifier, Starting_Element => Statement)); elsif Nkind (Arg_Node) = N_Goto_Statement and then Nkind (R_Node (Statement)) = N_Loop_Statement and then Is_Empty_List (Sinfo.Statements (R_Node (Statement))) then -- This is a pathological case of -- -- <<Target>> goto Target; return (1 => Node_To_Element_New (Node => Sinfo.Identifier (R_Node (Statement)), Internal_Kind => A_Defining_Identifier, Starting_Element => Statement)); end if; if not Is_List_Member (Arg_Node) then -- the accept statement in accept alternative, it cannot -- have labels at all return Nil_Element_List; end if; Label_Node := Prev (Arg_Node); while Nkind (Label_Node) in N_Raise_xxx_Error loop -- See B920-A06 Label_Node := Prev (Label_Node); end loop; while Nkind (Label_Node) = N_Label loop Labels_Number := Labels_Number + 1; Label_Node := Prev (Label_Node); end loop; -- Label_Node is not the Node of N_Label kind now if Labels_Number = 0 then return Nil_Element_List; else declare Result_List : Asis.Element_List (1 .. ASIS_Integer (Labels_Number)); begin if Label_Node = Empty then -- special case: the first statement in the statement -- sequence is labeled Label_Node := First (List_Containing (Arg_Node)); else Label_Node := Next (Label_Node); end if; -- the first label attached to the statement and the number of -- attached labels are obtained for I in 1 .. ASIS_Integer (Labels_Number) loop -- the order of labels is important ! Result_List (I) := Node_To_Element_New ( Node => Label_Node, Internal_Kind => A_Defining_Identifier, Starting_Element => Statement); Label_Node := Next (Label_Node); end loop; return Result_List; end; end if; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Label_Names"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Label_Names", Ex => Ex, Arg_Element => Statement); end Label_Names; --------------------- -- Loop_Statements -- --------------------- function Loop_Statements (Statement : Asis.Statement; Include_Pragmas : Boolean := False) return Asis.Statement_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Loop_Statements"); if not (Arg_Kind = A_Loop_Statement or else Arg_Kind = A_While_Loop_Statement or else Arg_Kind = A_For_Loop_Statement) then Raise_ASIS_Inappropriate_Element ("Asis_Statement.Loop_Statements", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); return N_To_E_List_New (List => Sinfo.Statements (Arg_Node), Include_Pragmas => Include_Pragmas, Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Bool_Par => Include_Pragmas, Outer_Call => Package_Name & "Loop_Statements"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Loop_Statements", Ex => Ex, Arg_Element => Statement, Bool_Par_ON => Include_Pragmas); end Loop_Statements; -------------------------- -- Qualified_Expression -- -------------------------- function Qualified_Expression (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Qualified_Expression"); if not (Arg_Kind = A_Code_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Qualified_Expression", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); return Node_To_Element_New ( Node => Sinfo.Expression (Arg_Node), Internal_Kind => A_Qualified_Expression, Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Qualified_Expression"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Qualified_Expression", Ex => Ex, Arg_Element => Statement); end Qualified_Expression; ---------------------- -- Raised_Exception -- ---------------------- function Raised_Exception (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Result_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Raised_Exception"); if not (Arg_Kind = A_Raise_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Raised_Exception", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); Result_Node := Sinfo.Name (Arg_Node); if No (Result_Node) then return Nil_Element; else return Node_To_Element_New ( Node => Result_Node, Starting_Element => Statement); end if; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Raised_Exception"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Raised_Exception", Ex => Ex, Arg_Element => Statement); end Raised_Exception; ------------------------ -- Requeue_Entry_Name -- ------------------------ function Requeue_Entry_Name (Statement : Asis.Statement) return Asis.Name is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Requeue_Entry_Name"); if not (Arg_Kind = A_Requeue_Statement or else Arg_Kind = A_Requeue_Statement_With_Abort) then Raise_ASIS_Inappropriate_Element (Package_Name & "Requeue_Entry_Name", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); return Node_To_Element_New (Node => Sinfo.Name (Arg_Node), Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Requeue_Entry_Name"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Requeue_Entry_Name", Ex => Ex, Arg_Element => Statement); end Requeue_Entry_Name; ----------------------- -- Return_Expression -- ----------------------- function Return_Expression (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Result_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Return_Expression"); if not (Arg_Kind = A_Return_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Return_Expression", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); Result_Node := Sinfo.Expression (Arg_Node); if No (Result_Node) then return Nil_Element; else return Node_To_Element_New (Node => Result_Node, Starting_Element => Statement); end if; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Return_Expression"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Return_Expression", Ex => Ex, Arg_Element => Statement); end Return_Expression; ---------------------------- -- Sequence_Of_Statements -- ---------------------------- function Sequence_Of_Statements (Path : Asis.Path; Include_Pragmas : Boolean := False) return Asis.Statement_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Path); Arg_Node : Node_Id; Result_List : List_Id; -- for processing An_If_Path, An_Elsif_Path, An_Else_Path, A_Case_Path -- and A_Then_Abort_Path arguments; the node of such argument has -- regular structure -- local variables for processing A_Select_Path and An_Or_Path -- arguments; the node of such arguments has irregular structure Statement_List : List_Id; First_Element : Asis.Element := Nil_Element; Alternative_Node_Kind : Node_Kind; begin Check_Validity (Path, Package_Name & "Sequence_Of_Statements"); if not (Arg_Kind in Internal_Statement_Path_Kinds) then Raise_ASIS_Inappropriate_Element (Package_Name & "Sequence_Of_Statements", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Path); case Arg_Kind is when An_If_Path | An_Elsif_Path => Result_List := Then_Statements (Arg_Node); when An_Else_Path => Result_List := Else_Statements (Arg_Node); when A_Case_Path => Result_List := Sinfo.Statements (Arg_Node); when A_Then_Abort_Path => Result_List := Sinfo.Statements (Arg_Node); when A_Select_Path | An_Or_Path => Alternative_Node_Kind := Nkind (Arg_Node); if Alternative_Node_Kind = N_Terminate_Alternative then -- special case: result list contains only one dummy terminate -- statement; no tree traversing needed: the result is based -- on the same node as the argument return Asis.Statement_List'( 1 => Node_To_Element_New ( Node => Arg_Node, Internal_Kind => A_Terminate_Alternative_Statement, Starting_Element => Path)); else -- this alternative corresponds to the situation of -- N_Accept_Alternative, N_Delay_Alternative, -- N_Entry_Call_Alternative or N_Triggering_Alternative -- forming the first element of the element list to be -- returned: if Alternative_Node_Kind = N_Accept_Alternative then First_Element := Node_To_Element_New ( Node => Accept_Statement (Arg_Node), Internal_Kind => An_Accept_Statement, Starting_Element => Path); elsif Alternative_Node_Kind = N_Delay_Alternative then First_Element := Node_To_Element_New ( Node => Delay_Statement (Arg_Node), Starting_Element => Path); elsif Alternative_Node_Kind = N_Entry_Call_Alternative then First_Element := Node_To_Element_New ( Node => Entry_Call_Statement (Arg_Node), Starting_Element => Path); elsif Alternative_Node_Kind = N_Triggering_Alternative then First_Element := Node_To_Element_New ( Node => Triggering_Statement (Arg_Node), Starting_Element => Path); end if; -- the rest of the returned list: Statement_List := Sinfo.Statements (Arg_Node); return Asis.Statement_List'(1 => First_Element) & N_To_E_List_New (List => Statement_List, Include_Pragmas => Include_Pragmas, Starting_Element => Path); end if; when others => null; end case; return N_To_E_List_New (List => Result_List, Include_Pragmas => Include_Pragmas, Starting_Element => Path); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Path, Bool_Par => Include_Pragmas, Outer_Call => Package_Name & "Sequence_Of_Statements"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Sequence_Of_Statements", Ex => Ex, Arg_Element => Path, Bool_Par_ON => Include_Pragmas); end Sequence_Of_Statements; -------------------------- -- Statement_Identifier -- -------------------------- function Statement_Identifier (Statement : Asis.Statement) return Asis.Defining_Name is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "Statement_Identifier"); if not (Arg_Kind = A_Loop_Statement or else Arg_Kind = A_While_Loop_Statement or else Arg_Kind = A_For_Loop_Statement or else Arg_Kind = A_Block_Statement) then Raise_ASIS_Inappropriate_Element ("Asis_Statement.Statement_Identifier", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); if Special_Case (Statement) = A_Dummy_Block_Statement or else Has_Created_Identifier (Arg_Node) then return Nil_Element; else return Node_To_Element_New ( Node => Sinfo.Identifier (Arg_Node), Internal_Kind => A_Defining_Identifier, Starting_Element => Statement); end if; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "Statement_Identifier"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Statement_Identifier", Ex => Ex, Arg_Element => Statement); end Statement_Identifier; --------------------- -- Statement_Paths -- --------------------- function Statement_Paths (Statement : Asis.Statement; Include_Pragmas : Boolean := False) return Asis.Path_List is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; Path_List_Length : ASIS_Integer; -- Length of returned list Elsif_Or_Length : ASIS_Integer; -- Number of Elsif or Or paths Else_Present : Boolean; begin Check_Validity (Statement, Package_Name & "Statement_Paths"); if not (Arg_Kind = An_If_Statement or else Arg_Kind = A_Case_Statement or else Arg_Kind = A_Selective_Accept_Statement or else Arg_Kind = A_Timed_Entry_Call_Statement or else Arg_Kind = A_Conditional_Entry_Call_Statement or else Arg_Kind = An_Asynchronous_Select_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "Statement_Paths", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); case Arg_Kind is when An_If_Statement => Path_List_Length := 1; -- An_If_Path Else_Present := Present (Else_Statements (Arg_Node)); if Else_Present then Path_List_Length := Path_List_Length + 1; end if; if Present (Elsif_Parts (Arg_Node)) then Elsif_Or_Length := ASIS_Integer (List_Length (Elsif_Parts (Arg_Node))); else Elsif_Or_Length := 0; end if; Path_List_Length := Path_List_Length + Elsif_Or_Length; declare Path_List : Asis.Element_List (1 .. Path_List_Length); -- Element List to be returned by the function begin Path_List (1) := Node_To_Element_New (Node => Arg_Node, Internal_Kind => An_If_Path, Starting_Element => Statement); Path_List (2 .. Elsif_Or_Length + 1) := N_To_E_List_New (List => Elsif_Parts (Arg_Node), Internal_Kind => An_Elsif_Path, Starting_Element => Statement); if Else_Present then Path_List (Path_List_Length) := Node_To_Element_New (Node => Arg_Node, Internal_Kind => An_Else_Path, Starting_Element => Statement); end if; return Path_List; end; when A_Case_Statement => -- only here the value of Include_Pragmas is important return N_To_E_List_New (List => Alternatives (Arg_Node), Include_Pragmas => Include_Pragmas, Starting_Element => Statement); when A_Selective_Accept_Statement => Elsif_Or_Length := ASIS_Integer (List_Length (Select_Alternatives (Arg_Node))); Path_List_Length := Elsif_Or_Length; Else_Present := Present (Else_Statements (Arg_Node)); if Else_Present then Path_List_Length := Path_List_Length + 1; end if; declare Path_List : Asis.Element_List (1 .. Path_List_Length); -- Element List to be returned by the function begin Path_List (1 .. Elsif_Or_Length) := N_To_E_List_New (List => Select_Alternatives (Arg_Node), Starting_Element => Statement); if Else_Present then Path_List (Path_List_Length) := Node_To_Element_New (Node => Arg_Node, Internal_Kind => An_Else_Path, Starting_Element => Statement); end if; return Path_List; end; when A_Timed_Entry_Call_Statement => return Asis.Path_List'( 1 => Node_To_Element_New ( Node => Entry_Call_Alternative (Arg_Node), Internal_Kind => A_Select_Path, Starting_Element => Statement), 2 => Node_To_Element_New ( Node => Delay_Alternative (Arg_Node), Internal_Kind => An_Or_Path, Starting_Element => Statement)); when A_Conditional_Entry_Call_Statement => return Asis.Path_List'( 1 => Node_To_Element_New ( Node => Entry_Call_Alternative (Arg_Node), Internal_Kind => A_Select_Path, Starting_Element => Statement), 2 => Node_To_Element_New ( Node => Arg_Node, Internal_Kind => An_Else_Path, Starting_Element => Statement)); when An_Asynchronous_Select_Statement => return Asis.Path_List'( 1 => Node_To_Element_New ( Node => Triggering_Alternative (Arg_Node), Internal_Kind => A_Select_Path, Starting_Element => Statement), 2 => Node_To_Element_New ( Node => Abortable_Part (Arg_Node), Internal_Kind => A_Then_Abort_Path, Starting_Element => Statement)); when others => raise Internal_Implementation_Error; -- this choice can never be reached, see the condition -- for defining the appropriate element end case; exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Bool_Par => Include_Pragmas, Outer_Call => Package_Name & "Statement_Paths"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "Statement_Paths", Ex => Ex, Arg_Element => Statement, Bool_Par_ON => Include_Pragmas); end Statement_Paths; --------------------- -- While_Condition -- --------------------- function While_Condition (Statement : Asis.Statement) return Asis.Expression is Arg_Kind : constant Internal_Element_Kinds := Int_Kind (Statement); Arg_Node : Node_Id; begin Check_Validity (Statement, Package_Name & "While_Condition"); if not (Arg_Kind = A_While_Loop_Statement) then Raise_ASIS_Inappropriate_Element (Package_Name & "While_Condition", Wrong_Kind => Arg_Kind); end if; Arg_Node := Node (Statement); return Node_To_Element_New ( Node => Condition (Iteration_Scheme (Arg_Node)), Starting_Element => Statement); exception when ASIS_Inappropriate_Element => raise; when ASIS_Failed => if Status_Indicator = Unhandled_Exception_Error then Add_Call_Information (Argument => Statement, Outer_Call => Package_Name & "While_Condition"); end if; raise; when Ex : others => Report_ASIS_Bug (Query_Name => Package_Name & "While_Condition", Ex => Ex, Arg_Element => Statement); end While_Condition; end Asis.Statements;
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt33.adb
best08618/asylo
7
21697
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt33.adb -- { dg-do compile } -- { dg-options "-O" } with Ada.Containers.Ordered_Sets; with Ada.Strings.Unbounded; procedure Opt33 is type Rec is record Name : Ada.Strings.Unbounded.Unbounded_String; end record; function "<" (Left : Rec; Right : Rec) return Boolean; package My_Ordered_Sets is new Ada.Containers.Ordered_Sets (Rec); protected type Data is procedure Do_It; private Set : My_Ordered_Sets.Set; end Data; function "<" (Left : Rec; Right : Rec) return Boolean is begin return False; end "<"; protected body Data is procedure Do_It is procedure Dummy (Position : My_Ordered_Sets.Cursor) is begin null; end; begin Set.Iterate (Dummy'Access); end; end Data; begin null; end;
3-mid/impact/source/3d/collision/dispatch/impact-d3-collision-detector-discrete-sphere_triangle.adb
charlie5/lace
20
12099
<reponame>charlie5/lace with impact.d3.Transform; with impact.d3.Vector; with impact.d3.Scalar; package body impact.d3.collision.Detector.discrete.sphere_triangle is function to_sphere_triangle_Detector (sphere : access impact.d3.Shape.convex.internal.sphere .Item'Class; triangle : access impact.d3.Shape.convex.internal.polyhedral.triangle.Item'Class; contactBreakingThreshold : in math.Real ) return Item is Self : Item; begin Self.m_sphere := sphere; Self.m_triangle := triangle; Self.m_contactBreakingThreshold := contactBreakingThreshold; return Self; end to_sphere_triangle_Detector; overriding procedure getClosestPoints (Self : in out Item; input : in ClosestPointInput; output : in out Result'Class; swapResults : in Boolean := False) is use impact.d3.Transform, math.Vectors; use linear_Algebra_3d; transformA : Transform_3d renames input.m_transformA; transformB : Transform_3d renames input.m_transformB; point, normal : aliased math.Vector_3; timeOfImpact : aliased math.Real := 1.0; depth : aliased math.Real := 0.0; sphereInTr : Transform_3d; begin -- output.m_distance = impact.d3.Scalar(BT_LARGE_FLOAT); -- move sphere into triangle space -- sphereInTr := inverseTimes (transformB, transformA); if Self.collide (sphereInTr.Translation, point'Access, normal'Access, depth'Access, timeOfImpact'Access, Self.m_contactBreakingThreshold) then if swapResults then declare normalOnB : constant math.Vector_3 := transformB.Rotation * normal; normalOnA : constant math.Vector_3 := -normalOnB; pointOnA : constant math.Vector_3 := transformB * point + normalOnB*depth; begin output.addContactPoint (normalOnA, pointOnA, depth); end; else output.addContactPoint (transformB.Rotation * normal, transformB * point, depth); end if; end if; end getClosestPoints; -- See also geometrictools.com -- Basic idea: D = |p - (lo + t0*lv)| where t0 = lv . (p - lo) / lv . lv -- function SegmentSqrDistance (from, to, p : in math.Vector_3; nearest : access math.Vector_3) return math.Real is use impact.d3.Vector, math.Vectors; diff : math.Vector_3 := p - from; v : constant math.Vector_3 := to - from; t : math.Real := dot (v, diff); dotVV : math.Real; begin if t > 0.0 then dotVV := dot (v, v); if t < dotVV then t := t / dotVV; diff := diff - t*v; else t := 1.0; diff := diff - v; end if; else t := 0.0; end if; nearest.all := from + t*v; return dot (diff, diff); end SegmentSqrDistance; function collide (Self : in Item; sphereCenter : in math.Vector_3; point : access math.Vector_3; resultNormal : access math.Vector_3; depth : access math.Real; timeOfImpact : access math.Real; contactBreakingThreshold : in math.Real) return Boolean is pragma Unreferenced (timeOfImpact); use impact.d3.Scalar, impact.d3.Vector, math.Vectors; vertex_1 : math.Vector_3 renames Self.m_triangle.getVertexPtr (1).all; vertex_2 : math.Vector_3 renames Self.m_triangle.getVertexPtr (2).all; vertex_3 : math.Vector_3 renames Self.m_triangle.getVertexPtr (3).all; radius : math.Real := Self.m_sphere.getRadius; radiusWithThreshold : math.Real := radius + contactBreakingThreshold; normal : aliased math.Vector_3 := Normalized (cross (vertex_2 - vertex_1, vertex_3 - vertex_1)); p1ToCentre : constant math.Vector_3 := sphereCenter - vertex_1; distanceFromPlane : math.Real := dot (p1ToCentre, normal); isInsideContactPlane : Boolean := distanceFromPlane < radiusWithThreshold; hasContact : Boolean := False; contactPoint : math.Vector_3; begin if distanceFromPlane < 0.0 then -- triangle facing the other way distanceFromPlane := -distanceFromPlane; normal := -normal; end if; isInsideContactPlane := distanceFromPlane < radiusWithThreshold; -- Check for contact / intersection -- hasContact := False; if isInsideContactPlane then if Self.facecontains (sphereCenter, Vector_3_array (Self.m_triangle.m_vertices1), normal'Access) then -- Inside the contact wedge - touches a point on the shell plane hasContact := True; contactPoint := sphereCenter - normal * distanceFromPlane; else -- Could be inside one of the contact capsules declare contactCapsuleRadiusSqr : math.Real := radiusWithThreshold * radiusWithThreshold; nearestOnEdge : aliased math.Vector_3; begin for i in 1 .. Self.m_triangle.getNumEdges loop declare pa, pb : math.Vector_3; distanceSqr : math.Real; begin Self.m_triangle.getEdge (i, pa, pb); distanceSqr := SegmentSqrDistance (pa, pb, sphereCenter, nearestOnEdge'Access); if distanceSqr < contactCapsuleRadiusSqr then -- Yep, we're inside a capsule. hasContact := True; contactPoint := nearestOnEdge; end if; end; end loop; end; end if; end if; if hasContact then declare use math.Functions; contactToCentre : constant math.Vector_3 := sphereCenter - contactPoint; distanceSqr : constant math.Real := length2 (contactToCentre); distance : math.Real; begin if distanceSqr < radiusWithThreshold * radiusWithThreshold then if distanceSqr > SIMD_EPSILON then distance := sqRt (distanceSqr); resultNormal.all := contactToCentre; normalize (resultNormal.all); point.all := contactPoint; depth.all := -(radius - distance); else distance := 0.0; resultNormal.all := normal; point.all := contactPoint; depth.all := -radius; end if; return True; end if; end; end if; return False; end collide; function pointInTriangle (Self : in Item; vertices : in Vector_3_array; normal : in math.Vector_3; p : access math.Vector_3) return Boolean is pragma Unreferenced (Self); use impact.d3.Vector, math.Vectors; p1 : math.Vector_3 renames vertices (1); p2 : math.Vector_3 renames vertices (2); p3 : math.Vector_3 renames vertices (3); edge1 : constant math.Vector_3 := p2 - p1; edge2 : constant math.Vector_3 := p3 - p2; edge3 : constant math.Vector_3 := p1 - p3; p1_to_p : constant math.Vector_3 := p.all - p1; p2_to_p : constant math.Vector_3 := p.all - p2; p3_to_p : constant math.Vector_3 := p.all - p3; edge1_normal : constant math.Vector_3 := cross (edge1, normal); edge2_normal : constant math.Vector_3 := cross (edge2, normal); edge3_normal : constant math.Vector_3 := cross (edge3, normal); r1, r2, r3 : math.Real; begin r1 := dot (edge1_normal, p1_to_p); r2 := dot (edge2_normal, p2_to_p); r3 := dot (edge3_normal, p3_to_p); return (r1 > 0.0 and then r2 > 0.0 and then r3 > 0.0) or else (r1 <= 0.0 and then r2 <= 0.0 and then r3 <= 0.0); end pointInTriangle; function facecontains (Self : in Item; p : in math.Vector_3; vertices : in Vector_3_array; normal : access math.Vector_3) return Boolean is lp : aliased math.Vector_3 := p; lnormal : constant math.Vector_3 := normal.all; begin return Self.pointInTriangle (vertices, lnormal, lp'Access); end facecontains; end impact.d3.collision.Detector.discrete.sphere_triangle;
mc-sema/validator/x86/tests/CVTSI2SSrr.asm
randolphwong/mcsema
2
26417
<reponame>randolphwong/mcsema BITS 32 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS= ;TEST_FILE_META_END ; put 2 into ecx for future load into xmm0 mov ecx, 2 ;TEST_BEGIN_RECORDING cvtsi2ss xmm0, ecx ;TEST_END_RECORDING xor ecx, ecx cvtsi2ss xmm0, ecx
Lockon S3/LockOn Data.asm
NatsumiFox/AMPS-Sonic-3-Knuckles
5
88667
<gh_stars>1-10 LockOnROM_Start: binclude "Lockon S3/Header.bin" even SSMagic_TestLoc_200114 EQU LockOnROM_Start+$114 SSMagic_TestLoc_20011A EQU LockOnROM_Start+$11A LockonDate EQU LockOnROM_Start+$11C SSMagic_TestLoc_200150 EQU LockOnROM_Start+$150 LockonSerialNumber EQU LockOnROM_Start+$180 SSMagic_TestLoc_2001A4 EQU LockOnROM_Start+$1A4 Pal_Competition1: binclude "General/Competition Menu/Palettes/1.bin" even Map_CompetitionObject: include "General/Competition Menu/Map - Competition Objects.asm" MapUnc_CompetitionNumbers: binclude "General/Competition Menu/Uncompressed Map/Numbers.bin" even Pal_Competition2: binclude "General/Competition Menu/Palettes/2.bin" even Pal_Competition3: binclude "General/Competition Menu/Palettes/3.bin" even Pal_Competition4: binclude "General/Competition Menu/Palettes/4.bin" even Map_CompetitionSelect: include "General/Competition Menu/Map - Competition Select.asm" Pal_CompetitionResults: binclude "General/Competition Menu/Palettes/Results.bin" even MapEni_CompetitionResultsLED: binclude "General/Competition Menu/Enigma Map/Menu.bin" even MapUnc_CompetitionResultsLetters:binclude "General/Competition Menu/Uncompressed Map/Results Letters.bin" even MapUnc_CompetitionResultsDividers:binclude "General/Competition Menu/Uncompressed Map/Results Dividers.bin" even MapUnc_CompetitionResultsTOTAL: binclude "General/Competition Menu/Uncompressed Map/Results TOTAL.bin" even MapUnc_ResultsWin: binclude "General/Competition Menu/Uncompressed Map/Results Win.bin" even MapUnc_ResultsLose: binclude "General/Competition Menu/Uncompressed Map/Results Lose.bin" even MapUnc_ResultsTie: binclude "General/Competition Menu/Uncompressed Map/Results Tie.bin" even Pal_CompetitionTimeAttack: binclude "General/Competition Menu/Palettes/Time Attack.bin" even MapUnc_CompetitionLAPNum: binclude "General/Competition Menu/Uncompressed Map/LAP.bin" even MapUnc_CompetitionRECORDS: binclude "General/Competition Menu/Uncompressed Map/RECORDS.bin" even MapUnc_Competition1st2nd3rd: binclude "General/Competition Menu/Uncompressed Map/1ST 2ND 3RD.bin" even MapUnc_CompetitionAZURELAKE: binclude "General/Competition Menu/Uncompressed Map/AZURE LAKE.bin" even MapUnc_CompetitionBALLOONPARK: binclude "General/Competition Menu/Uncompressed Map/BALLOON PARK.bin" even MapUnc_CompetitionCHROMEGADGET: binclude "General/Competition Menu/Uncompressed Map/CHROME GADGET.bin" even MapUnc_CompetitionDESERTPALACE: binclude "General/Competition Menu/Uncompressed Map/DESERT PALACE.bin" even MapUnc_CompetitionENDLESSMINE: binclude "General/Competition Menu/Uncompressed Map/ENDLESS MINE.bin" even ArtKos_SaveScreenS3Zone: binclude "General/Save Menu/Kosinski Art/Zone Art.bin" even Map_AIZ1Tree: include "Levels/AIZ/Misc Object Data/Map - Act 1 Tree.asm" Map_AIZ1ZiplinePeg: include "Levels/AIZ/Misc Object Data/Map - Act 1 Zipline Peg.asm" Map_BreakableBar: include "Levels/HCZ/Misc Object Data/Map - Breakable Bar.asm" Map_HCZBlock: include "Levels/HCZ/Misc Object Data/Map - Block.asm" Map_AIZRock: include "Levels/AIZ/Misc Object Data/Map - Rock.asm" Map_AIZRock2: include "Levels/AIZ/Misc Object Data/Map - Rock 2.asm" Map_EMZRock: include "Levels/EMZ/Misc Object Data/Map - Rock.asm" Map_AIZCollapsingPlatform: include "Levels/AIZ/Misc Object Data/Map - Collapsing Platform.asm" Map_AIZCollapsingPlatform2: include "Levels/AIZ/Misc Object Data/Map - Collapsing Platform 2.asm" Map_LBZCollapsingBridge: include "Levels/LBZ/Misc Object Data/Map - Collapsing Bridge.asm" Map_LBZCollapsingLedge: include "Levels/LBZ/Misc Object Data/Map - Collapsing Ledge.asm" Map_HCZCollapsingBridge: include "Levels/HCZ/Misc Object Data/Map - Collapsing Bridge.asm" Map_MGZCollapsingBridge: include "Levels/MGZ/Misc Object Data/Map - Collapsing Bridge.asm" Map_ICZCollapsingBridge: include "Levels/ICZ/Misc Object Data/Map - Collapsing Bridge.asm" Map_AIZBreakableWall: include "Levels/AIZ/Misc Object Data/Map - Breakable Wall.asm" Map_MGZBreakableWall: include "Levels/MGZ/Misc Object Data/Map - Breakable Wall.asm" Map_HCZBreakableWall: include "Levels/HCZ/Misc Object Data/Map - Breakable Wall.asm" Map_LBZBreakableWall: include "Levels/LBZ/Misc Object Data/Map - Breakable Wall.asm" Map_AIZIntroWaves: include "Levels/AIZ/Misc Object Data/Map - Intro Waves.asm" Map_LBZUnusedElevator: include "Levels/LBZ/Misc Object Data/Map - Unused Elevator.asm" Map_LBZExplodingTrigger: include "Levels/LBZ/Misc Object Data/Map - Exploding Trigger.asm" Map_MGZDashTrigger: include "Levels/MGZ/Misc Object Data/Map - Dash Trigger.asm" Map_LBZTriggerBridge: include "Levels/LBZ/Misc Object Data/Map - Trigger Bridge.asm" Map_LBZPlayerLauncher: include "Levels/LBZ/Misc Object Data/Map - Player Launcher.asm" Map_LBZFlameThrower: include "Levels/LBZ/Misc Object Data/Map - Flame Thrower.asm" Map_LBZCupElevator: include "Levels/LBZ/Misc Object Data/Map - Cup Elevator.asm" Map_LBZUnusedUnknown: include "Levels/LBZ/Misc Object Data/Map - Unused Unknown.asm" Map_LBZPipePlug: include "Levels/LBZ/Misc Object Data/Map - PipePlug.asm" Map_LBZSpinLauncher: include "Levels/LBZ/Misc Object Data/Map - Spin Launcher.asm" Map_LBZLoweringGrapple: include "Levels/LBZ/Misc Object Data/Map - Lowering Grapple.asm" Map_LBZSmashingSpikes: include "Levels/LBZ/Misc Object Data/Map - Smashing Spikes.asm" Map_MGZSmashingPillar: include "Levels/MGZ/Misc Object Data/Map - Smashing Pillar.asm" Map_LBZGateLaser: include "Levels/LBZ/Misc Object Data/Map - Gate Laser.asm" Map_LBZTubeElevator: include "Levels/LBZ/Misc Object Data/Map - Tube Elevator.asm" Map_AIZDisappearingFloor: include "Levels/AIZ/Misc Object Data/Map - Disappearing Floor.asm" Map_AIZCorkFloor: include "Levels/AIZ/Misc Object Data/Map - Cork Floor.asm" Map_AIZCorkFloor2: include "Levels/AIZ/Misc Object Data/Map - Cork Floor 2.asm" Map_CNZCorkFloor: include "Levels/CNZ/Misc Object Data/Map - Cork Floor.asm" Map_ICZCorkFloor: include "Levels/ICZ/Misc Object Data/Map - Cork Floor.asm" Map_LBZCorkFloor: include "Levels/LBZ/Misc Object Data/Map - Cork Floor.asm" Map_AIZFlippingBridge: include "Levels/AIZ/Misc Object Data/Map - Flipping Bridge.asm" Map_AIZFallingLog2: include "Levels/AIZ/Misc Object Data/Map - Falling Log 2.asm" Map_AIZFallingLog: include "Levels/AIZ/Misc Object Data/Map - Falling Log.asm" Map_AIZFallingLogSplash2: include "Levels/AIZ/Misc Object Data/Map - Falling Log Splash 2.asm" Map_AIZFallingLogSplash: include "Levels/AIZ/Misc Object Data/Map - Falling Log Splash.asm" Map_AIZSpikedLog: include "Levels/AIZ/Misc Object Data/Map - Spiked Log.asm" Map_AIZForegroundPlant: include "Levels/AIZ/Misc Object Data/Map - Foreground Plant.asm" Map_Button2: include "General/Sprites/Buttons/Map - Button 2.asm" Map_CNZButton: include "Levels/CNZ/Misc Object Data/Map - Button.asm" Map_2PButton: include "General/2P Zone/Map - 2P Button.asm" Map_HCZWaterRush: include "Levels/HCZ/Misc Object Data/Map - Water Rush.asm" Map_HCZWaterRushBlock: include "Levels/HCZ/Misc Object Data/Map - Water Rush Block.asm" Map_HCZWaterWall: include "Levels/HCZ/Misc Object Data/Map - Waterfall.asm" Map_HCZWaterWallDebris: include "Levels/HCZ/Misc Object Data/Map - Water Wall Debris.asm" Map_HCZFan: include "Levels/HCZ/Misc Object Data/Map - Fan.asm" Map_HCZLargeFan: include "Levels/HCZ/Misc Object Data/Map - Large Fan.asm" Map_CGZFan: include "Levels/CGZ/Misc Object Data/Map - Fan.asm" Map_HCZHandLauncher: include "Levels/HCZ/Misc Object Data/Map - Hand Launcher.asm" Map_HCZConveyorSpike: include "Levels/HCZ/Misc Object Data/Map - Conveyor Spike.asm" Map_CNZBalloon: include "Levels/CNZ/Misc Object Data/Map - Balloon.asm" Map_CNZCannon: include "General/Sprites/CNZ Cannon/Map - CNZ Cannon.asm" Map_CNZRisingPlatform: include "Levels/CNZ/Misc Object Data/Map - Rising Platform.asm" Map_CNZTrapDoor: include "Levels/CNZ/Misc Object Data/Map - Trap Door.asm" Map_CNZLightBulb: include "Levels/CNZ/Misc Object Data/Map - Light Bulb.asm" Map_CNZHoverFan: include "Levels/CNZ/Misc Object Data/Map - Hover Fan.asm" Map_CNZCylinder: include "Levels/CNZ/Misc Object Data/Map - Cylinder.asm" Map_HCZSpinningColumn: include "Levels/HCZ/Misc Object Data/Map - Spinning Column.asm" Map_Bumper: include "General/Sprites/Level Misc/Map - Bumper.asm" Map_2PBumper: include "General/2P Zone/Map - 2P Bumper.asm" Map_MGZSwingingPlatform: include "Levels/MGZ/Misc Object Data/Map - Swinging Platform.asm" Map_MGZSwingingSpikeBall: include "Levels/MGZ/Misc Object Data/Map - Swinging Spike Ball.asm" Map_MGZHeadTrigger: include "Levels/MGZ/Misc Object Data/Map - Head Trigger.asm" Map_MGZTriggerPlatform: include "Levels/MGZ/Misc Object Data/Map - Trigger Platform.asm" Map_MGZMovingSpikePlatform: include "Levels/MGZ/Misc Object Data/Map - Moving Spike Platform.asm" Map_MGZPulley: include "Levels/MGZ/Misc Object Data/Map - Pulley.asm" Map_HCZWaterDrop: include "Levels/HCZ/Misc Object Data/Map - Water Drop.asm" Map_HCZWaterSplash: include "Levels/HCZ/Misc Object Data/Map - Water Splash.asm" Map_HCZWaterSplash2: include "Levels/HCZ/Misc Object Data/Map - Water Splash 2.asm" include "Lockon S3/Screen Events.asm" Map_S3EndingGraphics: include "General/Ending/Map - S3 Ending Graphics.asm" ArtNem_S3EndingGraphics: binclude "General/Ending/Nemesis Art/S3 Ending Graphics.bin" even SStageLayoutPtrs: dc.l SStage1_Layout dc.l SStage2_Layout dc.l SStage3_Layout dc.l SStage4_Layout dc.l SStage5_Layout dc.l SStage6_Layout dc.l SStage7_Layout dc.l SStage8_Layout SStage1_Layout: binclude "General/Special Stage/Layout/S3 1.bin" even SStage2_Layout: binclude "General/Special Stage/Layout/S3 2.bin" even SStage3_Layout: binclude "General/Special Stage/Layout/S3 3.bin" even SStage4_Layout: binclude "General/Special Stage/Layout/S3 4.bin" even SStage5_Layout: binclude "General/Special Stage/Layout/S3 5.bin" even SStage6_Layout: binclude "General/Special Stage/Layout/S3 6.bin" even SStage7_Layout: binclude "General/Special Stage/Layout/S3 7.bin" even SStage8_Layout: binclude "General/Special Stage/Layout/S3 8.bin" even HCZ_WaterlineScroll_Data: binclude "Levels/HCZ/Misc/HCZ Waterline Scroll Data.bin" even LBZ_WaterlineScroll_Data: binclude "Levels/LBZ/Misc/LBZ Waterline Scroll Data.bin" even Solid_AIZ1: binclude "Levels/AIZ/Collision/1.bin" even Solid_AIZ2: binclude "Levels/AIZ/Collision/2.bin" even Solid_HCZ1: binclude "Levels/HCZ/Collision/1.bin" even Solid_HCZ2: binclude "Levels/HCZ/Collision/2.bin" even Solid_MGZ1: binclude "Levels/MGZ/Collision/1.bin" even Solid_MGZ2: binclude "Levels/MGZ/Collision/2.bin" even Solid_CNZ: binclude "Levels/CNZ/Collision/1.bin" even Solid_ICZ1: binclude "Levels/ICZ/Collision/1.bin" even Solid_ICZ2: binclude "Levels/ICZ/Collision/2.bin" even Solid_LBZ1: binclude "Levels/LBZ/Collision/1.bin" even Solid_LBZ2: binclude "Levels/LBZ/Collision/2.bin" even Solid_ALZ: binclude "Levels/ALZ/Collision/1.bin" even Solid_BPZ: binclude "Levels/BPZ/Collision/1.bin" even Solid_DPZ: binclude "Levels/DPZ/Collision/1.bin" even Solid_CGZ: binclude "Levels/CGZ/Collision/1.bin" even Solid_EMZ: binclude "Levels/EMZ/Collision/1.bin" even Solid_Gumball_Special: binclude "Levels/Gumball/Collision/1.bin" even Layout_AIZ1: binclude "Levels/AIZ/Layout/1.bin" even Layout_AIZ2: binclude "Levels/AIZ/Layout/2.bin" even Layout_HCZ1: binclude "Levels/HCZ/Layout/1.bin" even Layout_HCZ2: binclude "Levels/HCZ/Layout/2.bin" even Layout_MGZ1: binclude "Levels/MGZ/Layout/1.bin" even Layout_MGZ2: binclude "Levels/MGZ/Layout/2.bin" even Layout_CNZ1: binclude "Levels/CNZ/Layout/1.bin" even Layout_CNZ2: binclude "Levels/CNZ/Layout/2.bin" even Layout_ICZ1: binclude "Levels/ICZ/Layout/1.bin" even Layout_ICZ2: binclude "Levels/ICZ/Layout/2.bin" even Layout_LBZ1: binclude "Levels/LBZ/Layout/1.bin" even Layout_LBZ2: binclude "Levels/LBZ/Layout/2.bin" even Layout_ALZ: binclude "Levels/ALZ/Layout/1.bin" even Layout_BPZ: binclude "Levels/BPZ/Layout/1.bin" even Layout_DPZ: binclude "Levels/DPZ/Layout/1.bin" even Layout_CGZ: binclude "Levels/CGZ/Layout/1.bin" even Layout_EMZ: binclude "Levels/EMZ/Layout/1.bin" even Layout_Gumball_Special: binclude "Levels/Gumball/Layout/1.bin" even ArtUnc_CNZCannon: binclude "General/Sprites/CNZ Cannon/CNZ Cannon.bin" even ArtUnc_SStageTails: binclude "General/Sprites/Tails/Art/SStage Tails.bin" even Map_SStageTails: include "General/Sprites/Tails/Map - SStage Tails.asm" ArtUnc_SStageTailstails: binclude "General/Sprites/Tails/Art/SStage Tails tails.bin" even Map_SStageTailstails: include "General/Sprites/Tails/Map - SStage Tails tails.asm" Map_Sonic2P: include "General/Sprites/Sonic/Map - Sonic 2P.asm" PLC_Sonic2P: include "General/Sprites/Sonic/DPLC - Sonic 2P.asm" Map_Tails2P: include "General/Sprites/Tails/Map - Tails 2P.asm" Map_Tails2P_Tail: include "General/Sprites/Tails/Map - Tails tail 2P.asm" PLC_Tails2P: include "General/Sprites/Tails/DPLC - Tails 2P.asm" DPLC_Tails2P_Tail: include "General/Sprites/Tails/DPLC - Tails tails 2P.asm" Map_Knuckles2P: include "General/Sprites/Knuckles/Map - Knuckles 2P.asm" PLC_Knuckles2P: include "General/Sprites/Knuckles/DPLC - Knuckles 2P.asm" align $20 ArtUnc_AniAIZ1_0: binclude "Levels/AIZ/Animated Tiles/Act1 0.bin" even ArtUnc_AniAIZ1_1: binclude "Levels/AIZ/Animated Tiles/Act1 1.bin" even ArtUnc_AniAIZ2_1: binclude "Levels/AIZ/Animated Tiles/Act2 1.bin" even ArtUnc_AniAIZ2_0: binclude "Levels/AIZ/Animated Tiles/Act2 0.bin" even ArtUnc_AniAIZ2_3: binclude "Levels/AIZ/Animated Tiles/Act2 3.bin" even ArtUnc_AniAIZ2_2: binclude "Levels/AIZ/Animated Tiles/Act2 2.bin" even ArtUnc_AniAIZ2_FirstTree: binclude "Levels/AIZ/Animated Tiles/Act2 First Tree.bin" even ArtUnc_AniHCZ1_0: binclude "Levels/HCZ/Animated Tiles/Act1 0.bin" even ArtUnc_AniHCZ1_WaterlineBelow: binclude "Levels/HCZ/Animated Tiles/Act1 Water Below 1.bin" even ArtUnc_FixHCZ1_UpperBG1: binclude "Levels/HCZ/Animated Tiles/Act1 Upper BG 1.bin" even ArtUnc_AniHCZ1_WaterlineAbove: binclude "Levels/HCZ/Animated Tiles/Act1 Water Above 1.bin" even ArtUnc_FixHCZ1_LowerBG1: binclude "Levels/HCZ/Animated Tiles/Act1 Lower BG 1.bin" even ArtUnc_AniHCZ1_WaterlineBelow2: binclude "Levels/HCZ/Animated Tiles/Act1 Water Below 2.bin" even ArtUnc_FixHCZ1_UpperBG2: binclude "Levels/HCZ/Animated Tiles/Act1 Upper BG 2.bin" even ArtUnc_AniHCZ1_WaterlineAbove2: binclude "Levels/HCZ/Animated Tiles/Act1 Water Above 2.bin" even ArtUnc_FixHCZ1_LowerBG2: binclude "Levels/HCZ/Animated Tiles/Act1 Lower BG 2.bin" even ArtUnc_AniHCZ__1: binclude "Levels/HCZ/Animated Tiles/0.bin" even ArtUnc_AniHCZ2_0: binclude "Levels/HCZ/Animated Tiles/Act2 0.bin" even ArtUnc_AniHCZ2_SmallBGLine: binclude "Levels/HCZ/Animated Tiles/Act2 1.bin" even ArtUnc_AniHCZ2_2: binclude "Levels/HCZ/Animated Tiles/Act2 2.bin" even ArtUnc_AniHCZ2_3: binclude "Levels/HCZ/Animated Tiles/Act2 3.bin" even ArtUnc_AniHCZ2_4: binclude "Levels/HCZ/Animated Tiles/Act2 4.bin" even ArtUnc_AniMGZ__0: binclude "Levels/MGZ/Animated Tiles/MGZ Animated 0.bin" even ArtUnc_AniMGZ__1: binclude "Levels/MGZ/Animated Tiles/MGZ Animated 1.bin" even ArtUnc_AniCNZ__0: binclude "Levels/CNZ/Animated Tiles/0.bin" even ArtUnc_AniCNZ__1: binclude "Levels/CNZ/Animated Tiles/1.bin" even ArtUnc_AniCNZ__2: binclude "Levels/CNZ/Animated Tiles/2.bin" even ArtUnc_AniCNZ__3: binclude "Levels/CNZ/Animated Tiles/3.bin" even ArtUnc_AniCNZ__4: binclude "Levels/CNZ/Animated Tiles/4.bin" even ArtUnc_AniCNZ__6: binclude "Levels/CNZ/Animated Tiles/6.bin" even ArtUnc_AniCNZ__5: binclude "Levels/CNZ/Animated Tiles/5.bin" even ArtUnc_AniICZ__1: binclude "Levels/ICZ/Animated Tiles/1.bin" even ArtUnc_AniICZ__2: binclude "Levels/ICZ/Animated Tiles/2.bin" even ArtUnc_AniICZ__3: binclude "Levels/ICZ/Animated Tiles/3.bin" even ArtUnc_AniICZ__4: binclude "Levels/ICZ/Animated Tiles/4.bin" even ArtUnc_AniICZ__5: binclude "Levels/ICZ/Animated Tiles/5.bin" even ArtUnc_AniICZ__0: binclude "Levels/ICZ/Animated Tiles/0.bin" even ArtUnc_AniLBZ1_0: binclude "Levels/LBZ/Animated Tiles/Act1 0.bin" even ArtUnc_AniLBZ1_1: binclude "Levels/LBZ/Animated Tiles/Act1 1.bin" even ArtUnc_AniLBZ1_2: binclude "Levels/LBZ/Animated Tiles/Act1 2.bin" even ArtUnc_AniLBZ2_2: binclude "Levels/LBZ/Animated Tiles/Act2 2.bin" even ArtUnc_AniLBZ2_WaterlineBelow: binclude "Levels/LBZ/Animated Tiles/Act2 Water Below.bin" even ArtUnc_AniLBZ2_LowerBG: binclude "Levels/LBZ/Animated Tiles/Act2 Lower BG.bin" even ArtUnc_AniLBZ2_WaterlineAbove: binclude "Levels/LBZ/Animated Tiles/Act2 Water Above.bin" even ArtUnc_AniLBZ2_UpperBG: binclude "Levels/LBZ/Animated Tiles/Act2 Upper BG.bin" even ArtUnc_AniLBZ__0: binclude "Levels/LBZ/Animated Tiles/0.bin" even ArtUnc_AniLBZ2_0: binclude "Levels/LBZ/Animated Tiles/Act2 0.bin" even ArtUnc_AniLBZ2_1: binclude "Levels/LBZ/Animated Tiles/Act2 1.bin" even ArtUnc_AniALZ: binclude "Levels/ALZ/Animated Tiles/0.bin" even ArtUnc_AniBPZ__0: binclude "Levels/BPZ/Animated Tiles/0.bin" even ArtUnc_AniBPZ__1: binclude "Levels/BPZ/Animated Tiles/1.bin" even ArtUnc_AniBPZ__2: binclude "Levels/BPZ/Animated Tiles/2.bin" even ArtUnc_AniBPZ__3: binclude "Levels/BPZ/Animated Tiles/3.bin" even ArtUnc_AniDPZ: binclude "Levels/DPZ/Animated Tiles/0.bin" even ArtUnc_AniDPZ__BG: binclude "Levels/DPZ/Animated Tiles/BG 0.bin" even ArtUnc_AniGumball: binclude "Levels/Gumball/Animated Tiles/0.bin" even ArtUnc_SplashDrown: binclude "General/Sprites/Dash Dust/Splash Drown.bin" even ArtNem_Title_SonicSprites: binclude "General/Title/Nemesis Art/S3 Sonic Sprites.bin" even DemoDat_AIZ: binclude "Levels/AIZ/Demodata/1.bin" even DemoDat_HCZ: binclude "Levels/HCZ/Demodata/1.bin" even DemoDat_MGZ: binclude "Levels/MGZ/Demodata/1.bin" even ArtUnc_Tails: binclude "General/Sprites/Tails/Art/Tails.bin" even ArtUnc_Tails_Tail: binclude "General/Sprites/Tails/Art/Tails tails.bin" even ArtUnc_Sonic2P: binclude "General/Sprites/Sonic/Art/Sonic 2P.bin" even ArtUnc_Tails2P: binclude "General/Sprites/Tails/Art/Tails 2P.bin" even ArtUnc_Tails2P_Tail: binclude "General/Sprites/Tails/Art/Tails tails 2P.bin" even ArtUnc_Knuckles2P: binclude "General/Sprites/Knuckles/Art/Knuckles 2P.bin" even Map_Tails_Tail: include "General/Sprites/Tails/Map - Tails tails.asm" PLC_Tails_Tail: include "General/Sprites/Tails/Tails tails pattern load cues.asm" ICZSnowboard_Slope1: binclude "Levels/ICZ/Misc/ICZ Snowboard Slope 1.bin" even ICZSnowboard_Slope2: binclude "Levels/ICZ/Misc/ICZ Snowboard Slope 2.bin" even ArtUnc_SonicSnowboard: binclude "General/Sprites/Sonic/Art/Sonic Snowboarding.bin" even ArtUnc_Snowboard: binclude "General/Sprites/Snowboard/Snowboard.bin" even Map_SonicSnowboard: include "General/Sprites/Sonic/Map - Sonic Snowboarding.asm" DPLC_SonicSnowboard: include "General/Sprites/Sonic/DPLC - Sonic Snowboarding.asm" Map_Snowboard: include "General/Sprites/Snowboard/Map - Snowboard.asm" DPLC_Snowboard: include "General/Sprites/Snowboard/DPLC - Snowboard.asm" ArtNem_AIZIntroSprites: binclude "Levels/AIZ/Nemesis Art/Intro Waves.bin" even ArtNem_2PDashdust: binclude "General/2P Zone/Nemesis Art/Spindash Dust.bin" even MapEni_S3TitleSonic1: binclude "General/Title/Enigma Map/S3 Sonic 1.bin" even MapEni_S3TitleSonic2: binclude "General/Title/Enigma Map/S3 Sonic 2.bin" even MapEni_S3TitleSonic3: binclude "General/Title/Enigma Map/S3 Sonic 3.bin" even MapEni_S3TitleSonic4: binclude "General/Title/Enigma Map/S3 Sonic 4.bin" even MapEni_S3TitleSonic5: binclude "General/Title/Enigma Map/S3 Sonic 5.bin" even MapEni_S3TitleSonic6: binclude "General/Title/Enigma Map/S3 Sonic 6.bin" even MapEni_S3TitleSonic7: binclude "General/Title/Enigma Map/S3 Sonic 7.bin" even MapEni_S3TitleSonic8: binclude "General/Title/Enigma Map/S3 Sonic 8.bin" even MapEni_S3TitleSonic9: binclude "General/Title/Enigma Map/S3 Sonic 9.bin" even MapEni_S3TitleSonicA: binclude "General/Title/Enigma Map/S3 Sonic A.bin" even MapEni_S3TitleSonicB: binclude "General/Title/Enigma Map/S3 Sonic B.bin" even MapEni_S3TitleSonicC: binclude "General/Title/Enigma Map/S3 Sonic C.bin" even MapEni_S3TitleSonicD: binclude "General/Title/Enigma Map/S3 Sonic D.bin" even MapEni_S3TitleBg: binclude "General/Title/Enigma Map/S3 BG.bin" even Map_S3TitleBanner: include "General/Title/Map - S3 Banner.asm" ArtNem_Title_S3Banner: binclude "General/Title/Nemesis Art/S3 Banner.bin" even ArtKos_S3TitleSonic1: binclude "General/Title/Kosinski Art/S3 Sonic 1.bin" even ArtKos_S3TitleSonic8: binclude "General/Title/Kosinski Art/S3 Sonic 8.bin" even ArtKos_S3TitleSonic9: binclude "General/Title/Kosinski Art/S3 Sonic 9.bin" even ArtKos_S3TitleSonicA: binclude "General/Title/Kosinski Art/S3 Sonic A.bin" even ArtKos_S3TitleSonicB: binclude "General/Title/Kosinski Art/S3 Sonic B.bin" even ArtKos_S3TitleSonicC: binclude "General/Title/Kosinski Art/S3 Sonic C.bin" even ArtKos_S3TitleSonicD: binclude "General/Title/Kosinski Art/S3 Sonic D.bin" even ArtNem_TailsLifeIcon: binclude "General/Sprites/HUD Icon/Tails Life Icon.bin" even Map_LBZMiniboss: include "Levels/LBZ/Misc Object Data/Map - Miniboss.asm" Map_LBZMinibossBox: include "Levels/LBZ/Misc Object Data/Map - Miniboss Box.asm" Map_SnaleBlaster: include "General/Sprites/Snail Blaster/Map - Snail Blaster.asm" Map_Orbinaut: include "General/Sprites/Orbinaut/Map - Orbinaut.asm" Map_Ribot: include "General/Sprites/Ribot/Map - Ribot.asm" Map_Corkey: include "General/Sprites/Corkey/Map - Corkey.asm" Map_Flybot767: include "General/Sprites/Flybot/Map - Flybot.asm" DPLC_Flybot: include "General/Sprites/Flybot/DPLC - Flybot.asm" Map_LBZEndBoss: include "Levels/LBZ/Misc Object Data/Map - End Boss.asm" Map_CNZEndBoss: include "Levels/CNZ/Misc Object Data/Map - End Boss.asm" CNZEndBossMagnet_AngleX: dc.b 0, 1, 2, 3, 4, 5, 6, 8, 9, $A, $B, $C, $D, $E, $F, $10 dc.b $11, $12, $13, $14, $15, $16, $17, $18, $18, $19, $1A, $1B, $1C, $1D, $1E, $1E dc.b $1F, $20, $21, $21, $22, $23, $23, $24, $25, $25, $26, $26, $27, $27, $28, $28 dc.b $29, $29, $29, $2A, $2A, $2A, $2B, $2B, $2B, $2B, $2C, $2C, $2C, $2C, $2C, $2C LBZFinalBoss2_CircleLookup: dc.b 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, $A, $B, $C, $D, $D, $E dc.b $F, $10, $11, $12, $13, $14, $15, $15, $16, $17, $18, $19, $19, $1A, $1B, $1C dc.b $1C, $1D, $1E, $1E, $1F, $20, $20, $21, $21, $22, $22, $23, $23, $24, $24, $25 dc.b $25, $25, $26, $26, $26, $27, $27, $27, $27, $27, $28, $28, $28, $28, $28, $28 Map_Blastoid: include "General/Sprites/Blastoid/Map - Blastoid.asm" Map_Poindexter: include "General/Sprites/Pointdexter/Map - Pointdexter.asm" Map_Buggernaut: include "General/Sprites/Buggernaut/Map - Buggernaut.asm" Map_MegaChomper: include "General/Sprites/Mega Chomper/Map - Mega Chomper.asm" Map_TurboSpiker: include "General/Sprites/Turbo Spiker/Map - Turbo Spiker.asm" Map_Jawz: include "General/Sprites/Jawz/Map - Jawz.asm" DPLC_RhinoBot: include "General/Sprites/Rhino/DPLC - RhinoBot.asm" Map_RhinoBot: include "General/Sprites/Rhino/Map - RhinoBot.asm" Map_AIZMinibossFlame: include "Levels/AIZ/Misc Object Data/Map - Miniboss Flame.asm" Map_Tulipon: include "General/Sprites/Tulipon/Map - Tulipon.asm" Map_MonkeyDude: include "General/Sprites/Monkey Dude/Map - Monkey Dude.asm" Map_MGZMiniBoss: include "Levels/MGZ/Misc Object Data/Map - Miniboss.asm" Map_CaterKillerJr: include "General/Sprites/Caterkiller Jr/Map - Caterkiller Jr.asm" DPLC_Clamer: include "General/Sprites/Clamer/DPLC - Clamer.asm" Map_Clamer: include "General/Sprites/Clamer/Map - Clamer.asm" Map_CNZBlastoid: include "Levels/CNZ/Misc Object Data/Map - Blastoid.asm" Map_Batbot: include "General/Sprites/Batbot/Map - Batbot.asm" DPLC_BubblesBadnik: include "General/Sprites/Bubbles Badnik/DPLC - Bubbles Badnik.asm" Map_BubblesBadnik: include "General/Sprites/Bubbles Badnik/Map - Bubbles Badnik.asm" Map_Spiker: include "General/Sprites/Spiker/Map - Spiker.asm" Map_Mantis: include "General/Sprites/Mantis/Map - Mantis.asm" DPLC_Penguinator: include "General/Sprites/Penguinator/DPLC - Penguinator.asm" Map_Penguinator: include "General/Sprites/Penguinator/Map - Penguinator.asm" Map_ICZSnowdust: include "Levels/ICZ/Misc Object Data/Map - Snowdust.asm" Map_StarPointer: include "General/Sprites/Star Pointer/Map - Star Pointer.asm" Map_AIZEndBoss: include "Levels/AIZ/Misc Object Data/Map - End Boss.asm" Map_AIZMiniboss: include "Levels/AIZ/Misc Object Data/Map - Miniboss.asm" Map_AIZMinibossSmall: include "Levels/AIZ/Misc Object Data/Map - Miniboss Small.asm" Map_MGZEndBoss: include "Levels/MGZ/Misc Object Data/Map - End Boss.asm" HCZMiniboss_RocketTwistLookup: dc.b $18, $18, $18, $18, $18, $18, $18, $18, $18, $17, $17, $17, $17, $17, $17, $16 dc.b $16, $16, $16, $15, $15, $15, $15, $14, $14, $14, $13, $13, $13, $12, $12, $11 dc.b $11, $11, $10, $10, $F, $F, $E, $E, $D, $D, $C, $C, $B, $B, $A, $A dc.b 9, 9, 8, 8, 7, 6, 6, 5, 5, 4, 4, 3, 2, 2, 1, 1 dc.b 0, $FF, $FF, $FE, $FE, $FD, $FC, $FC, $FB, $FB, $FA, $FA, $F9, $F8, $F8, $F7 dc.b $F7, $F6, $F6, $F5, $F5, $F4, $F4, $F3, $F3, $F2, $F2, $F1, $F1, $F0, $F0, $EF dc.b $EF, $EF, $EE, $EE, $ED, $ED, $ED, $EC, $EC, $EC, $EB, $EB, $EB, $EB, $EA, $EA dc.b $EA, $EA, $E9, $E9, $E9, $E9, $E9, $E9, $E8, $E8, $E8, $E8, $E8, $E8, $E8, $E8 LBZ2FinalBoss2_CircleLookup2: dc.b 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7 dc.b 8, 8, 9, 9, 9, $A, $A, $B, $B, $C, $C, $C, $D, $D, $D, $E dc.b $E, $E, $F, $F, $F, $10, $10, $10, $11, $11, $11, $11, $12, $12, $12, $12 dc.b $12, $13, $13, $13, $13, $13, $13, $14, $14, $14, $14, $14, $14, $14, $14, $14 Map_HCZMiniboss: include "Levels/HCZ/Misc Object Data/Map - Miniboss.asm" Map_HCZMinibossSplash: include "Levels/HCZ/Misc Object Data/Map - Miniboss Splash.asm" DPLC_HCZMinibossSplash: include "Levels/HCZ/Misc Object Data/DPLC - Miniboss Splash.asm" Map_ICZEndBoss: include "Levels/ICZ/Misc Object Data/Map - End Boss.asm" Map_CNZMiniboss: include "Levels/CNZ/Misc Object Data/Map - Miniboss.asm" ICZMiniboss_OrbAngleLookup: dc.b 0, 1, 2, 4, 5, 6, 7, 8, 9, $B, $C, $D, $E, $F, $10, $11 dc.b $12, $13, $15, $16, $17, $18, $19, $1A, $1B, $1C, $1D, $1E, $1E, $1F, $20, $21 dc.b $22, $23, $24, $24, $25, $26, $27, $27, $28, $29, $29, $2A, $2A, $2B, $2B, $2C dc.b $2C, $2D, $2D, $2E, $2E, $2E, $2F, $2F, $2F, $2F, $2F, $30, $30, $30, $30, $30 Map_ICZMiniboss: include "Levels/ICZ/Misc Object Data/Map - Miniboss.asm" Map_HCZEndBoss: include "Levels/HCZ/Misc Object Data/Map - End Boss.asm" Map_MGZEndBossDebris: include "Levels/MGZ/Misc Object Data/Map - End Boss Debris.asm" Map_ICZWallAndColumn: include "Levels/ICZ/Misc Object Data/Map - Wall and Column.asm" Map_ICZPlatforms: include "Levels/ICZ/Misc Object Data/Map - Platforms.asm" Map_LBZKnuxBomb: include "Levels/LBZ/Misc Object Data/Map - Knuckles Bomb.asm" Map_CutsceneKnux: include "General/Sprites/Knuckles/Cutscene/Map - Cutscene Knuckles.asm" DPLC_CutsceneKnux: include "General/Sprites/Knuckles/Cutscene/DPLC - Cutscene Knuckles.asm" Map_AIZIntroPlane: include "Levels/AIZ/Misc Object Data/Map - Intro Plane.asm" Map_AIZIntroEmeralds: include "Levels/AIZ/Misc Object Data/Map - Intro Emeralds.asm" Map_LBZFinalBoss1: include "Levels/LBZ/Misc Object Data/Map - Final Boss 1.asm" Map_LBZDeathEggSmall: include "Levels/LBZ/Misc Object Data/Map - Death Egg Small.asm" Pal_MGZFadeCNZ: binclude "Levels/Misc/Palettes/MGZ Fade to CNZ.bin" even Map_LBZFinalBoss2: include "Levels/LBZ/Misc Object Data/Map - Final Boss 2.asm" ArtNem_AIZMiniboss: binclude "Levels/AIZ/Nemesis Art/Miniboss.bin" even ArtKosM_AIZEndBoss: binclude "Levels/AIZ/KosinskiM Art/End Boss.bin" even ArtNem_AIZMinibossSmall: binclude "Levels/AIZ/Nemesis Art/Miniboss Small.bin" even ArtUnc_AIZRhino: binclude "General/Sprites/Rhino/Rhino.bin" even ArtKosM_AIZ_Tulipon: binclude "General/Sprites/Tulipon/Tulipon.bin" even ArtKosM_AIZ_MonkeyDude: binclude "General/Sprites/Monkey Dude/Monkey Dude.bin" even ArtKosM_AIZ_CaterkillerJr: binclude "General/Sprites/Caterkiller Jr/Caterkiller Jr.bin" even ArtNem_HCZMiniboss: binclude "Levels/HCZ/Nemesis Art/Miniboss.bin" even ArtNem_HCZEndBoss: binclude "Levels/HCZ/Nemesis Art/End Boss.bin" even ArtNem_HCZDragonfly: binclude "Levels/HCZ/Nemesis Art/Dragonfly.bin" even ArtKosM_Jawz: binclude "General/Sprites/Jawz/Jawz.bin" even ArtKosM_MegaChopper: binclude "General/Sprites/Mega Chopper/Mega Chopper.bin" even ArtKosM_Blastoid: binclude "General/Sprites/Blastoid/Blastoid.bin" even ArtKosM_TurboSpiker: binclude "General/Sprites/Turbo Spiker/Turbo Spiker.bin" even ArtKosM_Pointdexter: binclude "General/Sprites/Pointdexter/Pointdexter.bin" even ArtKosM_MGZMiniboss: binclude "Levels/MGZ/KosinskiM Art/Miniboss.bin" even ArtNem_MGZSpire: binclude "Levels/MGZ/Nemesis Art/Spire.bin" even ArtKosM_MGZEndBoss: binclude "Levels/MGZ/KosinskiM Art/End Boss.bin" even ArtScaled_MGZEndBoss: binclude "Levels/MGZ/Misc/MGZ End Boss Scaled.bin" even ArtKosM_MGZEndBossDebris: binclude "Levels/MGZ/KosinskiM Art/End Boss Debris.bin" even ArtUnc_BubblesBadnik: binclude "General/Sprites/Bubbles Badnik/Bubbles Badnik.bin" even ArtKosM_Spiker: binclude "General/Sprites/Spiker/Spiker.bin" even ArtKosM_Mantis: binclude "General/Sprites/Mantis/Mantis.bin" even ArtNem_CNZMiniboss: binclude "Levels/CNZ/Nemesis Art/Miniboss.bin" even ArtNem_CNZEndBoss: binclude "Levels/CNZ/Nemesis Art/End Boss.bin" even ArtUnc_Clamer: binclude "General/Sprites/Clamer/Clamer.bin" even ArtKosM_ClamerShot: binclude "General/Sprites/Clamer/Clamer Shot.bin" even ArtKosM_Sparkle: binclude "General/Sprites/Sparkle/Sparkle.bin" even ArtKosM_Batbot: binclude "General/Sprites/Batbot/Batbot.bin" even ArtKosM_CNZBalloon: binclude "Levels/CNZ/KosinskiM Art/Balloon.bin" even ArtNem_ICZMisc1: binclude "Levels/ICZ/Nemesis Art/Misc Art 1.bin" even ArtNem_ICZIntroSprites: binclude "Levels/ICZ/Nemesis Art/Intro Sprites.bin" even ArtNem_ICZMisc2: binclude "Levels/ICZ/Nemesis Art/Misc Art 2.bin" even ArtNem_ICZEndBoss: binclude "Levels/ICZ/Nemesis Art/End Boss.bin" even ArtNem_ICZMiniboss: binclude "Levels/ICZ/Nemesis Art/Miniboss.bin" even ArtUnc_Penguinator: binclude "General/Sprites/Penguinator/Penguinator.bin" even ArtKosM_ICZSnowdust: binclude "Levels/ICZ/KosinskiM Art/Snowdust.bin" even ArtKosM_StarPointer: binclude "General/Sprites/Star Pointer/Star Pointer.bin" even ArtKosM_LBZMiniboss: binclude "Levels/LBZ/KosinskiM Art/Miniboss.bin" even ArtKosM_LBZMinibossBox: binclude "Levels/LBZ/KosinskiM Art/Miniboss Box.bin" even ArtNem_LBZFinalBoss1: binclude "Levels/LBZ/Nemesis Art/Final Boss 1.bin" even ArtKosM_LBZEndBoss: binclude "Levels/LBZ/KosinskiM Art/End Boss.bin" even ArtKosM_LBZFinalBoss2: binclude "Levels/LBZ/KosinskiM Art/Final Boss 2.bin" even ArtKosM_SnailBlaster: binclude "General/Sprites/Snail Blaster/Snail Blaster.bin" even ArtKosM_Ribot: binclude "General/Sprites/Ribot/Ribot.bin" even ArtKosM_Orbinaut: binclude "General/Sprites/Orbinaut/Orbinaut.bin" even ArtKosM_Corkey: binclude "General/Sprites/Corkey/Corkey.bin" even ArtUnc_Flybot: binclude "General/Sprites/Flybot/Flybot.bin" even ArtNem_LBZKnuxBomb: binclude "Levels/LBZ/Nemesis Art/Knuckles Bomb.bin" even ArtKosM_LBZ2DeathEggSmall: binclude "Levels/LBZ/KosinskiM Art/Act 2 Death Egg Small.bin" even ArtKosM_LBZ2DeathEgg2_8x8: binclude "Levels/LBZ/Tiles/Act 2 Death Egg 2.bin" even ArtNem_AIZBossFire: binclude "Levels/AIZ/Nemesis Art/Miniboss Fire.bin" even ArtKosM_AIZIntroPlane: binclude "Levels/AIZ/KosinskiM Art/Intro Plane.bin" even ArtUnc_CutsceneKnux: binclude "General/Sprites/Knuckles/Cutscene/Cutscene Main.bin" even ArtKosM_AIZIntroEmeralds: binclude "Levels/AIZ/KosinskiM Art/Intro Emeralds.bin" even ArtKosM_TailsEndPose: binclude "General/Ending/KosinskiM Art/Tails Ending Pose.bin" even ArtNem_S38x16Font: binclude "General/Ending/Nemesis Art/S3 8x16 Font.bin" even ArtNem_AIZCorkFloor: binclude "Levels/AIZ/Nemesis Art/Cork Floor 1.bin" even ArtNem_AIZCorkFloor2: binclude "Levels/AIZ/Nemesis Art/Cork Floor 2.bin" even ArtNem_AIZSwingVine: binclude "Levels/AIZ/Nemesis Art/Swing Vine.bin" even ArtNem_AIZSlideRope: binclude "Levels/AIZ/Nemesis Art/Zip Vine.bin" even ArtNem_AIZBackgroundTree: binclude "Levels/AIZ/Nemesis Art/BG Tree.bin" even ArtNem_AIZMisc1: binclude "Levels/AIZ/Nemesis Art/Misc Art 1.bin" even ArtNem_AIZFallingLog: binclude "Levels/AIZ/Nemesis Art/Falling Log.bin" even ArtNem_AIZMisc2: binclude "Levels/AIZ/Nemesis Art/Misc Art 2.bin" even ArtNem_HCZSpikeBall: binclude "Levels/HCZ/Nemesis Art/Spike Ball.bin" even ArtNem_HCZWaveSplash: binclude "Levels/HCZ/Nemesis Art/Wave Splash.bin" even ArtNem_HCZButton: binclude "Levels/HCZ/Nemesis Art/Button.bin" even ArtNem_HCZMisc: binclude "Levels/HCZ/Nemesis Art/Misc Art.bin" even ArtNem_HCZWaterRush: binclude "Levels/HCZ/Nemesis Art/Water Rush.bin" even ArtKosM_HCZLargeFan: binclude "Levels/HCZ/KosinskiM Art/Large Fan.bin" even ArtKosM_HCZGeyserHorz: binclude "Levels/HCZ/KosinskiM Art/Geyser Horizontal.bin" even ArtKosM_HCZGeyserVert: binclude "Levels/HCZ/KosinskiM Art/Geyser Vertical.bin" even ArtNem_HCZ2Slide: binclude "Levels/HCZ/Nemesis Art/Act 2 Slide.bin" even ArtNem_HCZ2BlockPlat: binclude "Levels/HCZ/Nemesis Art/Act 2 Block Platform.bin" even ArtUnc_HCZWaterSplash2: binclude "Levels/HCZ/Animated Tiles/Water Splash 2.bin" even ArtUnc_HCZWaterSplash: binclude "Levels/HCZ/Animated Tiles/Water Splash.bin" even ArtNem_HCZ2KnuxWall: binclude "Levels/HCZ/Nemesis Art/Act 2 Knuckles Wall.bin" even ArtNem_MGZMisc1: binclude "Levels/MGZ/Nemesis Art/Misc Art 1.bin" even ArtNem_MGZMisc2: binclude "Levels/MGZ/Nemesis Art/Misc Art 2.bin" even ArtNem_MGZSigns: binclude "Levels/MGZ/Nemesis Art/Direction Signs.bin" even ArtNem_CNZMisc: binclude "Levels/CNZ/Nemesis Art/Misc Art.bin" even ArtNem_CNZPlatform: binclude "Levels/CNZ/Nemesis Art/Platform.bin" even ArtNem_LBZMisc: binclude "Levels/LBZ/Nemesis Art/Misc Art.bin" even ArtNem_LBZTubeTrans: binclude "Levels/LBZ/Nemesis Art/Tube Transport.bin" even ArtNem_LBZ2Misc: binclude "Levels/LBZ/Nemesis Art/Act 2 Misc Art.bin" even ArtNem_2PArt_1: binclude "General/2P Zone/Nemesis Art/Misc Art 1.bin" even ArtNem_2PArt_2: binclude "General/2P Zone/Nemesis Art/Misc Art 2.bin" even ArtNem_2PArt_3: binclude "General/2P Zone/Nemesis Art/Misc Art 3.bin" even ArtNem_2PStartPost: binclude "General/2P Zone/Nemesis Art/Start Post.bin" even ArtNem_2PTime: binclude "General/2P Zone/Nemesis Art/Time Display.bin" even ArtNem_2PLapNum: binclude "General/2P Zone/Nemesis Art/Lap Numbers.bin" even ArtNem_2PPosIcon: binclude "General/2P Zone/Nemesis Art/Position Icons.bin" even ArtNem_BPZMisc: binclude "Levels/BPZ/Nemesis Art/Misc Art.bin" even ArtNem_DPZMisc: binclude "Levels/DPZ/Nemesis Art/Misc Art.bin" even ArtNem_CGZMisc: binclude "Levels/CGZ/Nemesis Art/Platform.bin" even ArtNem_EMZMisc: binclude "Levels/EMZ/Nemesis Art/Misc Art.bin" even ArtKosM_AIZ2Bombership2_8x8: binclude "Levels/AIZ/Tiles/Act 2 Bombership 2.bin" even ArtKosM_ResultsMILES: binclude "General/Sprites/Results/Results MILES.bin" even ArtKosM_ResultsTAILS: binclude "General/Sprites/Results/Results TAILS.bin" even ArtKosM_AIZTitleCard: binclude "Levels/AIZ/KosinskiM Art/Title Card.bin" even ArtKosM_HCZTitleCard: binclude "Levels/HCZ/KosinskiM Art/Title Card.bin" even ArtKosM_MGZTitleCard: binclude "Levels/MGZ/KosinskiM Art/Title Card.bin" even ArtKosM_CNZTitleCard: binclude "Levels/CNZ/KosinskiM Art/Title Card.bin" even ArtKosM_ICZTitleCard: binclude "Levels/ICZ/KosinskiM Art/Title Card.bin" even ArtKosM_LBZTitleCard: binclude "Levels/LBZ/KosinskiM Art/Title Card.bin" even ArtKosM_ALZTitleCard: binclude "Levels/ALZ/KosinskiM Art/Title Card.bin" even ArtKosM_BPZTitleCard: binclude "Levels/BPZ/KosinskiM Art/Title Card.bin" even ArtKosM_CGZTitleCard: binclude "Levels/CGZ/KosinskiM Art/Title Card.bin" even ArtKosM_DPZTitleCard: binclude "Levels/DPZ/KosinskiM Art/Title Card.bin" even ArtKosM_EMZTitleCard: binclude "Levels/EMZ/KosinskiM Art/Title Card.bin" even Pal_SaveMenuBG: binclude "General/Save Menu/Palettes/BG.bin" even Pal_CompetitionMenuBG: binclude "General/Competition Menu/Palettes/BG.bin" even MapEni_S3MenuBG: binclude "General/Title/Enigma Map/S3 Menu BG.bin" even ArtKos_S3MenuBG: binclude "General/Save Menu/Kosinski Art/Menu BG.bin" even MapEni_CompetitionLevBorder: binclude "General/Competition Menu/Enigma Map/Level Border.bin" even MapUnc_CompetitionTimeBorder: binclude "General/Competition Menu/Uncompressed Map/Time Border.bin" even MapUnc_CompetitionBESTTIME: binclude "General/Competition Menu/Uncompressed Map/Time Text.bin" even MapEni_CompetitionLevImage: binclude "General/Competition Menu/Enigma Map/Level Images.bin" even MapEni_CompetitionLevName: binclude "General/Competition Menu/Enigma Map/Level Names.bin" even ArtKos_CompetitionMode: binclude "General/Competition Menu/Kosinski Art/Mode Select.bin" even ArtKos_CompetitionLevel: binclude "General/Competition Menu/Kosinski Art/Level Select.bin" even ArtKos_CompetitionResults: binclude "General/Competition Menu/Kosinski Art/Results.bin" even Map_CompetitionPlayerSprite: include "General/Competition Menu/Map - Competition Player Sprites.asm" ArtKos_CompetitionPlayer: binclude "General/Competition Menu/Kosinski Art/Player Sprites.bin" even MapEni_SaveScreen_Layout: binclude "General/Save Menu/Enigma Map/Save Screen Layout.bin" even MapUnc_SaveScreenNEW: binclude "General/Save Menu/Uncompressed Map/NEW.bin" even MapPtrs_SaveScreenStatic: dc.l MapUnc_SaveScreenStatic1 dc.l MapUnc_SaveScreenStatic2 dc.l MapUnc_SaveScreenStatic3 dc.l MapUnc_SaveScreenStatic4 MapUnc_SaveScreenStatic1: binclude "General/Save Menu/Uncompressed Map/Static 1.bin" even MapUnc_SaveScreenStatic2: binclude "General/Save Menu/Uncompressed Map/Static 2.bin" even MapUnc_SaveScreenStatic3: binclude "General/Save Menu/Uncompressed Map/Static 3.bin" even MapUnc_SaveScreenStatic4: binclude "General/Save Menu/Uncompressed Map/Static 4.bin" even ArtKos_SaveScreenMisc: binclude "General/Save Menu/Kosinski Art/Misc.bin" even AIZ1_16x16_Primary_Kos: binclude "Levels/AIZ/Blocks/Act 1 Primary.bin" even AIZ1_16x16_Secondary_Kos: binclude "Levels/AIZ/Blocks/Act 1 Secondary.bin" even AIZ1_16x16_MainLevel_Kos: binclude "Levels/AIZ/Blocks/Act 1 Main Level.bin" even AIZ1_8x8_Primary_KosM: binclude "Levels/AIZ/Tiles/Act 1 Primary.bin" even AIZ1_8x8_Secondary_KosM: binclude "Levels/AIZ/Tiles/Act 1 Secondary.bin" even AIZ1_8x8_MainLevel_KosM: binclude "Levels/AIZ/Tiles/Act 1 Main Level.bin" even AIZ1_128x128_Kos: binclude "Levels/AIZ/Chunks/Act 1.bin" even AIZ1_8x8_Flames_KosM: binclude "Levels/AIZ/Tiles/Act 1 Fire Overlay.bin" even AIZ2_16x16_Primary_Kos: binclude "Levels/AIZ/Blocks/Act 2 Primary.bin" even AIZ2_16x16_Secondary_Kos: binclude "Levels/AIZ/Blocks/Act 2 Secondary.bin" even AIZ2_16x16_BomberShip_Kos: binclude "Levels/AIZ/Blocks/Act 2 BomberShip.bin" even AIZ2_8x8_Primary_KosM: binclude "Levels/AIZ/Tiles/Act 2 Primary.bin" even AIZ2_8x8_Secondary_KosM: binclude "Levels/AIZ/Tiles/Act 2 Secondary.bin" even AIZ2_8x8_BomberShip_KosM: binclude "Levels/AIZ/Tiles/Act 2 Bombership.bin" even AIZ2_128x128_Kos: binclude "Levels/AIZ/Chunks/Act 2.bin" even HCZ_16x16_Primary_Kos: binclude "Levels/HCZ/Blocks/Primary.bin" even HCZ_8x8_Primary_KosM: binclude "Levels/HCZ/Tiles/Primary.bin" even HCZ_128x128_Primary_Kos: binclude "Levels/HCZ/Chunks/Primary.bin" even HCZ1_16x16_Secondary_Kos: binclude "Levels/HCZ/Blocks/Act 1 Secondary.bin" even HCZ1_8x8_Secondary_KosM: binclude "Levels/HCZ/Tiles/Act 1 Secondary.bin" even HCZ1_128x128_Secondary_Kos: binclude "Levels/HCZ/Chunks/Act 1 Secondary.bin" even HCZ2_16x16_Secondary_Kos: binclude "Levels/HCZ/Blocks/Act 2 Secondary.bin" even HCZ2_8x8_Secondary_KosM: binclude "Levels/HCZ/Tiles/Act 2 Secondary.bin" even HCZ2_128x128_Secondary_Kos: binclude "Levels/HCZ/Chunks/Act 2 Secondary.bin" even MGZ_16x16_Primary_Kos: binclude "Levels/MGZ/Blocks/Primary.bin" even MGZ_8x8_Primary_KosM: binclude "Levels/MGZ/Tiles/Primary.bin" even MGZ_128x128_Primary_Kos: binclude "Levels/MGZ/Chunks/Primary.bin" even MGZ1_16x16_Secondary_Kos: binclude "Levels/MGZ/Blocks/Act 1 Secondary.bin" even MGZ1_8x8_Secondary_KosM: binclude "Levels/MGZ/Tiles/Act 1 Secondary.bin" even MGZ1_128x128_Secondary_Kos: binclude "Levels/MGZ/Chunks/Act 1 Secondary.bin" even MGZ2_16x16_Secondary_Kos: binclude "Levels/MGZ/Blocks/Act 2 Secondary.bin" even MGZ2_8x8_Secondary_KosM: binclude "Levels/MGZ/Tiles/Act 2 Secondary.bin" even MGZ2_128x128_Secondary_Kos: binclude "Levels/MGZ/Chunks/Act 2 Secondary.bin" even MGZ2_QuakeChunks: binclude "Levels/MGZ/Misc/Act 2 Quake Chunks.bin" even CNZ_16x16_Kos: binclude "Levels/CNZ/Blocks/Primary.bin" even CNZ_8x8_KosM: binclude "Levels/CNZ/Tiles/Primary.bin" even CNZ_128x128_Kos: binclude "Levels/CNZ/Chunks/Primary.bin" even ICZ_16x16_Primary_Kos: binclude "Levels/ICZ/Blocks/Primary.bin" even ICZ_8x8_Primary_KosM: binclude "Levels/ICZ/Tiles/Primary.bin" even ICZ_128x128_Primary_Kos: binclude "Levels/ICZ/Chunks/Primary.bin" even ICZ1_16x16_Secondary_Kos: binclude "Levels/ICZ/Blocks/Act 1 Secondary.bin" even ICZ1_8x8_Secondary_KosM: binclude "Levels/ICZ/Tiles/Act 1 Secondary.bin" even ICZ1_128x128_Secondary_Kos: binclude "Levels/ICZ/Chunks/Act 1 Secondary.bin" even ICZ2_16x16_Secondary_Kos: binclude "Levels/ICZ/Blocks/Act 2 Secondary.bin" even ICZ2_8x8_Secondary_KosM: binclude "Levels/ICZ/Tiles/Act 2 Secondary.bin" even ICZ2_128x128_Secondary_Kos: binclude "Levels/ICZ/Chunks/Act 2 Secondary.bin" even LBZ_16x16_Primary_Kos: binclude "Levels/LBZ/Blocks/Primary.bin" even LBZ1_16x16_Secondary_Kos: binclude "Levels/LBZ/Blocks/Act 1 Secondary.bin" even LBZ_8x8_Primary_KosM: binclude "Levels/LBZ/Tiles/Primary.bin" even LBZ1_8x8_Secondary_KosM: binclude "Levels/LBZ/Tiles/Act 1 Secondary.bin" even LBZ1_128x128_Kos: binclude "Levels/LBZ/Chunks/Act 1.bin" even LBZ2_16x16_Secondary_Kos: binclude "Levels/LBZ/Blocks/Act 2 Secondary.bin" even LBZ2_16x16_DeathEgg_Kos: binclude "Levels/LBZ/Blocks/Act 2 Death Egg.bin" even LBZ2_8x8_Secondary_KosM: binclude "Levels/LBZ/Tiles/Act 2 Secondary.bin" even LBZ2_8x8_DeathEgg_KosM: binclude "Levels/LBZ/Tiles/Act 2 Death Egg.bin" even LBZ2_128x128_Kos: binclude "Levels/LBZ/Chunks/Act 2.bin" even LBZ2_128x128_DeathEgg_Kos: binclude "Levels/LBZ/Chunks/Act 2 Death Egg.bin" even ALZ_16x16_Kos: binclude "Levels/ALZ/Blocks/Primary.bin" even ALZ_8x8_KosM: binclude "Levels/ALZ/Tiles/Primary.bin" even ALZ_128x128_Kos: binclude "Levels/ALZ/Chunks/Primary.bin" even BPZ_16x16_Kos: binclude "Levels/BPZ/Blocks/Primary.bin" even BPZ_8x8_KosM: binclude "Levels/BPZ/Tiles/Primary.bin" even BPZ_128x128_Kos: binclude "Levels/BPZ/Chunks/Primary.bin" even DPZ_16x16_Kos: binclude "Levels/DPZ/Blocks/Primary.bin" even DPZ_8x8_KosM: binclude "Levels/DPZ/Tiles/Primary.bin" even DPZ_128x128_Kos: binclude "Levels/DPZ/Chunks/Primary.bin" even CGZ_16x16_Kos: binclude "Levels/CGZ/Blocks/Primary.bin" even CGZ_8x8_KosM: binclude "Levels/CGZ/Tiles/Primary.bin" even CGZ_128x128_Kos: binclude "Levels/CGZ/Chunks/Primary.bin" even EMZ_16x16_Kos: binclude "Levels/EMZ/Blocks/Primary.bin" even EMZ_8x8_KosM: binclude "Levels/EMZ/Tiles/Primary.bin" even EMZ_128x128_Kos: binclude "Levels/EMZ/Chunks/Primary.bin" even Gumball_16x16_Kos: binclude "Levels/Gumball/Blocks/Primary.bin" even Gumball_8x8_KosM: binclude "Levels/Gumball/Tiles/Gumball.bin" even Gumball_128x128_Kos: binclude "Levels/Gumball/Chunks/Primary.bin" even
AppleScripts/Examples/LoopSpeakingTest.applescript
KyleKing/My-Programming-Sketchbook
7
2729
-- Testing loops and verbal output --SCRIPT 1 set k to 0 repeat until k = 3 set k to k + 1 say k as string delay 1 end repeat -- --SCRIPT 2 -- set k to 0 -- repeat until k = 300 -- set k to k + 10 -- say k as string -- delay 1 -- end repeat
libsrc/graphics/gal/pixladdr_MODE1.asm
jpoikela/z88dk
640
23083
<filename>libsrc/graphics/gal/pixladdr_MODE1.asm ; ;----------- GFX paging ------------- SECTION code_clib PUBLIC pixeladdress_MODE1 INCLUDE "graphics/grafix.inc" ; Entry h = x ; l = y ; Exit: hl = address ; a = pixel number ; Uses: a, bc, de, hl .pixeladdress_MODE1 ; add y-times the nuber of bytes per line (32) ld e,h ld h,0 add hl,hl add hl,hl add hl,hl add hl,hl add hl,hl ld a,e srl e srl e srl e ld d,0 add hl,de ld de,($2a6a) add hl,de ld de,$20 add hl,de and 7 ret
user/uthread.asm
eric-qian-d/TCP
0
25146
user/_uthread: file format elf64-littleriscv Disassembly of section .text: 0000000000000000 <thread_init>: struct thread *current_thread; extern void thread_switch(uint64, uint64); void thread_init(void) { 0: 1141 addi sp,sp,-16 2: e422 sd s0,8(sp) 4: 0800 addi s0,sp,16 // main() is thread 0, which will make the first invocation to // thread_schedule(). it needs a stack so that the first thread_switch() can // save thread 0's state. thread_schedule() won't run the main thread ever // again, because its state is set to RUNNING, and thread_schedule() selects // a RUNNABLE thread. current_thread = &all_thread[0]; 6: 00001797 auipc a5,0x1 a: cca78793 addi a5,a5,-822 # cd0 <all_thread> e: 00001717 auipc a4,0x1 12: caf73923 sd a5,-846(a4) # cc0 <current_thread> current_thread->state = RUNNING; 16: 4785 li a5,1 18: 00003717 auipc a4,0x3 1c: caf72c23 sw a5,-840(a4) # 2cd0 <__global_pointer$+0x182f> } 20: 6422 ld s0,8(sp) 22: 0141 addi sp,sp,16 24: 8082 ret 0000000000000026 <thread_schedule>: { struct thread *t, *next_thread; /* Find another runnable thread. */ next_thread = 0; t = current_thread + 1; 26: 00001897 auipc a7,0x1 2a: c9a8b883 ld a7,-870(a7) # cc0 <current_thread> 2e: 6789 lui a5,0x2 30: 0791 addi a5,a5,4 32: 97c6 add a5,a5,a7 34: 4711 li a4,4 for(int i = 0; i < MAX_THREAD; i++){ if(t >= all_thread + MAX_THREAD) 36: 00009517 auipc a0,0x9 3a: caa50513 addi a0,a0,-854 # 8ce0 <base> t = all_thread; if(t->state == RUNNABLE) { 3e: 6609 lui a2,0x2 40: 4589 li a1,2 next_thread = t; break; } t = t + 1; 42: 00460813 addi a6,a2,4 # 2004 <__global_pointer$+0xb63> 46: a809 j 58 <thread_schedule+0x32> if(t->state == RUNNABLE) { 48: 00c786b3 add a3,a5,a2 4c: 4294 lw a3,0(a3) 4e: 02b68d63 beq a3,a1,88 <thread_schedule+0x62> t = t + 1; 52: 97c2 add a5,a5,a6 for(int i = 0; i < MAX_THREAD; i++){ 54: 377d addiw a4,a4,-1 56: cb01 beqz a4,66 <thread_schedule+0x40> if(t >= all_thread + MAX_THREAD) 58: fea7e8e3 bltu a5,a0,48 <thread_schedule+0x22> t = all_thread; 5c: 00001797 auipc a5,0x1 60: c7478793 addi a5,a5,-908 # cd0 <all_thread> 64: b7d5 j 48 <thread_schedule+0x22> { 66: 1141 addi sp,sp,-16 68: e406 sd ra,8(sp) 6a: e022 sd s0,0(sp) 6c: 0800 addi s0,sp,16 } if (next_thread == 0) { printf("thread_schedule: no runnable threads\n"); 6e: 00001517 auipc a0,0x1 72: b1a50513 addi a0,a0,-1254 # b88 <malloc+0xe4> 76: 00001097 auipc ra,0x1 7a: 970080e7 jalr -1680(ra) # 9e6 <printf> exit(-1); 7e: 557d li a0,-1 80: 00000097 auipc ra,0x0 84: 5de080e7 jalr 1502(ra) # 65e <exit> } if (current_thread != next_thread) { /* switch threads? */ 88: 00f88b63 beq a7,a5,9e <thread_schedule+0x78> next_thread->state = RUNNING; 8c: 6709 lui a4,0x2 8e: 973e add a4,a4,a5 90: 4685 li a3,1 92: c314 sw a3,0(a4) t = current_thread; current_thread = next_thread; 94: 00001717 auipc a4,0x1 98: c2f73623 sd a5,-980(a4) # cc0 <current_thread> * Invoke thread_switch to switch from t to next_thread: * thread_switch(??, ??); */ } else next_thread = 0; } 9c: 8082 ret 9e: 8082 ret 00000000000000a0 <thread_create>: void thread_create(void (*func)()) { a0: 1141 addi sp,sp,-16 a2: e422 sd s0,8(sp) a4: 0800 addi s0,sp,16 struct thread *t; for (t = all_thread; t < all_thread + MAX_THREAD; t++) { a6: 00001797 auipc a5,0x1 aa: c2a78793 addi a5,a5,-982 # cd0 <all_thread> if (t->state == FREE) break; ae: 6689 lui a3,0x2 for (t = all_thread; t < all_thread + MAX_THREAD; t++) { b0: 00468593 addi a1,a3,4 # 2004 <__global_pointer$+0xb63> b4: 00009617 auipc a2,0x9 b8: c2c60613 addi a2,a2,-980 # 8ce0 <base> if (t->state == FREE) break; bc: 00d78733 add a4,a5,a3 c0: 4318 lw a4,0(a4) c2: c701 beqz a4,ca <thread_create+0x2a> for (t = all_thread; t < all_thread + MAX_THREAD; t++) { c4: 97ae add a5,a5,a1 c6: fec79be3 bne a5,a2,bc <thread_create+0x1c> } t->state = RUNNABLE; ca: 6709 lui a4,0x2 cc: 97ba add a5,a5,a4 ce: 4709 li a4,2 d0: c398 sw a4,0(a5) // YOUR CODE HERE } d2: 6422 ld s0,8(sp) d4: 0141 addi sp,sp,16 d6: 8082 ret 00000000000000d8 <thread_yield>: void thread_yield(void) { d8: 1141 addi sp,sp,-16 da: e406 sd ra,8(sp) dc: e022 sd s0,0(sp) de: 0800 addi s0,sp,16 current_thread->state = RUNNABLE; e0: 00001797 auipc a5,0x1 e4: be07b783 ld a5,-1056(a5) # cc0 <current_thread> e8: 6709 lui a4,0x2 ea: 97ba add a5,a5,a4 ec: 4709 li a4,2 ee: c398 sw a4,0(a5) thread_schedule(); f0: 00000097 auipc ra,0x0 f4: f36080e7 jalr -202(ra) # 26 <thread_schedule> } f8: 60a2 ld ra,8(sp) fa: 6402 ld s0,0(sp) fc: 0141 addi sp,sp,16 fe: 8082 ret 0000000000000100 <thread_a>: volatile int a_started, b_started, c_started; volatile int a_n, b_n, c_n; void thread_a(void) { 100: 7179 addi sp,sp,-48 102: f406 sd ra,40(sp) 104: f022 sd s0,32(sp) 106: ec26 sd s1,24(sp) 108: e84a sd s2,16(sp) 10a: e44e sd s3,8(sp) 10c: e052 sd s4,0(sp) 10e: 1800 addi s0,sp,48 int i; printf("thread_a started\n"); 110: 00001517 auipc a0,0x1 114: aa050513 addi a0,a0,-1376 # bb0 <malloc+0x10c> 118: 00001097 auipc ra,0x1 11c: 8ce080e7 jalr -1842(ra) # 9e6 <printf> a_started = 1; 120: 4785 li a5,1 122: 00001717 auipc a4,0x1 126: b8f72d23 sw a5,-1126(a4) # cbc <a_started> while(b_started == 0 || c_started == 0) 12a: 00001497 auipc s1,0x1 12e: b8e48493 addi s1,s1,-1138 # cb8 <b_started> 132: 00001917 auipc s2,0x1 136: b8290913 addi s2,s2,-1150 # cb4 <c_started> 13a: a029 j 144 <thread_a+0x44> thread_yield(); 13c: 00000097 auipc ra,0x0 140: f9c080e7 jalr -100(ra) # d8 <thread_yield> while(b_started == 0 || c_started == 0) 144: 409c lw a5,0(s1) 146: 2781 sext.w a5,a5 148: dbf5 beqz a5,13c <thread_a+0x3c> 14a: 00092783 lw a5,0(s2) 14e: 2781 sext.w a5,a5 150: d7f5 beqz a5,13c <thread_a+0x3c> for (i = 0; i < 100; i++) { 152: 4481 li s1,0 printf("thread_a %d\n", i); 154: 00001a17 auipc s4,0x1 158: a74a0a13 addi s4,s4,-1420 # bc8 <malloc+0x124> a_n += 1; 15c: 00001917 auipc s2,0x1 160: b5490913 addi s2,s2,-1196 # cb0 <a_n> for (i = 0; i < 100; i++) { 164: 06400993 li s3,100 printf("thread_a %d\n", i); 168: 85a6 mv a1,s1 16a: 8552 mv a0,s4 16c: 00001097 auipc ra,0x1 170: 87a080e7 jalr -1926(ra) # 9e6 <printf> a_n += 1; 174: 00092783 lw a5,0(s2) 178: 2785 addiw a5,a5,1 17a: 00f92023 sw a5,0(s2) thread_yield(); 17e: 00000097 auipc ra,0x0 182: f5a080e7 jalr -166(ra) # d8 <thread_yield> for (i = 0; i < 100; i++) { 186: 2485 addiw s1,s1,1 188: ff3490e3 bne s1,s3,168 <thread_a+0x68> } printf("thread_a: exit after %d\n", a_n); 18c: 00001597 auipc a1,0x1 190: b245a583 lw a1,-1244(a1) # cb0 <a_n> 194: 00001517 auipc a0,0x1 198: a4450513 addi a0,a0,-1468 # bd8 <malloc+0x134> 19c: 00001097 auipc ra,0x1 1a0: 84a080e7 jalr -1974(ra) # 9e6 <printf> current_thread->state = FREE; 1a4: 00001797 auipc a5,0x1 1a8: b1c7b783 ld a5,-1252(a5) # cc0 <current_thread> 1ac: 6709 lui a4,0x2 1ae: 97ba add a5,a5,a4 1b0: 0007a023 sw zero,0(a5) thread_schedule(); 1b4: 00000097 auipc ra,0x0 1b8: e72080e7 jalr -398(ra) # 26 <thread_schedule> } 1bc: 70a2 ld ra,40(sp) 1be: 7402 ld s0,32(sp) 1c0: 64e2 ld s1,24(sp) 1c2: 6942 ld s2,16(sp) 1c4: 69a2 ld s3,8(sp) 1c6: 6a02 ld s4,0(sp) 1c8: 6145 addi sp,sp,48 1ca: 8082 ret 00000000000001cc <thread_b>: void thread_b(void) { 1cc: 7179 addi sp,sp,-48 1ce: f406 sd ra,40(sp) 1d0: f022 sd s0,32(sp) 1d2: ec26 sd s1,24(sp) 1d4: e84a sd s2,16(sp) 1d6: e44e sd s3,8(sp) 1d8: e052 sd s4,0(sp) 1da: 1800 addi s0,sp,48 int i; printf("thread_b started\n"); 1dc: 00001517 auipc a0,0x1 1e0: a1c50513 addi a0,a0,-1508 # bf8 <malloc+0x154> 1e4: 00001097 auipc ra,0x1 1e8: 802080e7 jalr -2046(ra) # 9e6 <printf> b_started = 1; 1ec: 4785 li a5,1 1ee: 00001717 auipc a4,0x1 1f2: acf72523 sw a5,-1334(a4) # cb8 <b_started> while(a_started == 0 || c_started == 0) 1f6: 00001497 auipc s1,0x1 1fa: ac648493 addi s1,s1,-1338 # cbc <a_started> 1fe: 00001917 auipc s2,0x1 202: ab690913 addi s2,s2,-1354 # cb4 <c_started> 206: a029 j 210 <thread_b+0x44> thread_yield(); 208: 00000097 auipc ra,0x0 20c: ed0080e7 jalr -304(ra) # d8 <thread_yield> while(a_started == 0 || c_started == 0) 210: 409c lw a5,0(s1) 212: 2781 sext.w a5,a5 214: dbf5 beqz a5,208 <thread_b+0x3c> 216: 00092783 lw a5,0(s2) 21a: 2781 sext.w a5,a5 21c: d7f5 beqz a5,208 <thread_b+0x3c> for (i = 0; i < 100; i++) { 21e: 4481 li s1,0 printf("thread_b %d\n", i); 220: 00001a17 auipc s4,0x1 224: 9f0a0a13 addi s4,s4,-1552 # c10 <malloc+0x16c> b_n += 1; 228: 00001917 auipc s2,0x1 22c: a8490913 addi s2,s2,-1404 # cac <b_n> for (i = 0; i < 100; i++) { 230: 06400993 li s3,100 printf("thread_b %d\n", i); 234: 85a6 mv a1,s1 236: 8552 mv a0,s4 238: 00000097 auipc ra,0x0 23c: 7ae080e7 jalr 1966(ra) # 9e6 <printf> b_n += 1; 240: 00092783 lw a5,0(s2) 244: 2785 addiw a5,a5,1 246: 00f92023 sw a5,0(s2) thread_yield(); 24a: 00000097 auipc ra,0x0 24e: e8e080e7 jalr -370(ra) # d8 <thread_yield> for (i = 0; i < 100; i++) { 252: 2485 addiw s1,s1,1 254: ff3490e3 bne s1,s3,234 <thread_b+0x68> } printf("thread_b: exit after %d\n", b_n); 258: 00001597 auipc a1,0x1 25c: a545a583 lw a1,-1452(a1) # cac <b_n> 260: 00001517 auipc a0,0x1 264: 9c050513 addi a0,a0,-1600 # c20 <malloc+0x17c> 268: 00000097 auipc ra,0x0 26c: 77e080e7 jalr 1918(ra) # 9e6 <printf> current_thread->state = FREE; 270: 00001797 auipc a5,0x1 274: a507b783 ld a5,-1456(a5) # cc0 <current_thread> 278: 6709 lui a4,0x2 27a: 97ba add a5,a5,a4 27c: 0007a023 sw zero,0(a5) thread_schedule(); 280: 00000097 auipc ra,0x0 284: da6080e7 jalr -602(ra) # 26 <thread_schedule> } 288: 70a2 ld ra,40(sp) 28a: 7402 ld s0,32(sp) 28c: 64e2 ld s1,24(sp) 28e: 6942 ld s2,16(sp) 290: 69a2 ld s3,8(sp) 292: 6a02 ld s4,0(sp) 294: 6145 addi sp,sp,48 296: 8082 ret 0000000000000298 <thread_c>: void thread_c(void) { 298: 7179 addi sp,sp,-48 29a: f406 sd ra,40(sp) 29c: f022 sd s0,32(sp) 29e: ec26 sd s1,24(sp) 2a0: e84a sd s2,16(sp) 2a2: e44e sd s3,8(sp) 2a4: e052 sd s4,0(sp) 2a6: 1800 addi s0,sp,48 int i; printf("thread_c started\n"); 2a8: 00001517 auipc a0,0x1 2ac: 99850513 addi a0,a0,-1640 # c40 <malloc+0x19c> 2b0: 00000097 auipc ra,0x0 2b4: 736080e7 jalr 1846(ra) # 9e6 <printf> c_started = 1; 2b8: 4785 li a5,1 2ba: 00001717 auipc a4,0x1 2be: 9ef72d23 sw a5,-1542(a4) # cb4 <c_started> while(a_started == 0 || b_started == 0) 2c2: 00001497 auipc s1,0x1 2c6: 9fa48493 addi s1,s1,-1542 # cbc <a_started> 2ca: 00001917 auipc s2,0x1 2ce: 9ee90913 addi s2,s2,-1554 # cb8 <b_started> 2d2: a029 j 2dc <thread_c+0x44> thread_yield(); 2d4: 00000097 auipc ra,0x0 2d8: e04080e7 jalr -508(ra) # d8 <thread_yield> while(a_started == 0 || b_started == 0) 2dc: 409c lw a5,0(s1) 2de: 2781 sext.w a5,a5 2e0: dbf5 beqz a5,2d4 <thread_c+0x3c> 2e2: 00092783 lw a5,0(s2) 2e6: 2781 sext.w a5,a5 2e8: d7f5 beqz a5,2d4 <thread_c+0x3c> for (i = 0; i < 100; i++) { 2ea: 4481 li s1,0 printf("thread_c %d\n", i); 2ec: 00001a17 auipc s4,0x1 2f0: 96ca0a13 addi s4,s4,-1684 # c58 <malloc+0x1b4> c_n += 1; 2f4: 00001917 auipc s2,0x1 2f8: 9b490913 addi s2,s2,-1612 # ca8 <c_n> for (i = 0; i < 100; i++) { 2fc: 06400993 li s3,100 printf("thread_c %d\n", i); 300: 85a6 mv a1,s1 302: 8552 mv a0,s4 304: 00000097 auipc ra,0x0 308: 6e2080e7 jalr 1762(ra) # 9e6 <printf> c_n += 1; 30c: 00092783 lw a5,0(s2) 310: 2785 addiw a5,a5,1 312: 00f92023 sw a5,0(s2) thread_yield(); 316: 00000097 auipc ra,0x0 31a: dc2080e7 jalr -574(ra) # d8 <thread_yield> for (i = 0; i < 100; i++) { 31e: 2485 addiw s1,s1,1 320: ff3490e3 bne s1,s3,300 <thread_c+0x68> } printf("thread_c: exit after %d\n", c_n); 324: 00001597 auipc a1,0x1 328: 9845a583 lw a1,-1660(a1) # ca8 <c_n> 32c: 00001517 auipc a0,0x1 330: 93c50513 addi a0,a0,-1732 # c68 <malloc+0x1c4> 334: 00000097 auipc ra,0x0 338: 6b2080e7 jalr 1714(ra) # 9e6 <printf> current_thread->state = FREE; 33c: 00001797 auipc a5,0x1 340: 9847b783 ld a5,-1660(a5) # cc0 <current_thread> 344: 6709 lui a4,0x2 346: 97ba add a5,a5,a4 348: 0007a023 sw zero,0(a5) thread_schedule(); 34c: 00000097 auipc ra,0x0 350: cda080e7 jalr -806(ra) # 26 <thread_schedule> } 354: 70a2 ld ra,40(sp) 356: 7402 ld s0,32(sp) 358: 64e2 ld s1,24(sp) 35a: 6942 ld s2,16(sp) 35c: 69a2 ld s3,8(sp) 35e: 6a02 ld s4,0(sp) 360: 6145 addi sp,sp,48 362: 8082 ret 0000000000000364 <main>: int main(int argc, char *argv[]) { 364: 1141 addi sp,sp,-16 366: e406 sd ra,8(sp) 368: e022 sd s0,0(sp) 36a: 0800 addi s0,sp,16 a_started = b_started = c_started = 0; 36c: 00001797 auipc a5,0x1 370: 9407a423 sw zero,-1720(a5) # cb4 <c_started> 374: 00001797 auipc a5,0x1 378: 9407a223 sw zero,-1724(a5) # cb8 <b_started> 37c: 00001797 auipc a5,0x1 380: 9407a023 sw zero,-1728(a5) # cbc <a_started> a_n = b_n = c_n = 0; 384: 00001797 auipc a5,0x1 388: 9207a223 sw zero,-1756(a5) # ca8 <c_n> 38c: 00001797 auipc a5,0x1 390: 9207a023 sw zero,-1760(a5) # cac <b_n> 394: 00001797 auipc a5,0x1 398: 9007ae23 sw zero,-1764(a5) # cb0 <a_n> thread_init(); 39c: 00000097 auipc ra,0x0 3a0: c64080e7 jalr -924(ra) # 0 <thread_init> thread_create(thread_a); 3a4: 00000517 auipc a0,0x0 3a8: d5c50513 addi a0,a0,-676 # 100 <thread_a> 3ac: 00000097 auipc ra,0x0 3b0: cf4080e7 jalr -780(ra) # a0 <thread_create> thread_create(thread_b); 3b4: 00000517 auipc a0,0x0 3b8: e1850513 addi a0,a0,-488 # 1cc <thread_b> 3bc: 00000097 auipc ra,0x0 3c0: ce4080e7 jalr -796(ra) # a0 <thread_create> thread_create(thread_c); 3c4: 00000517 auipc a0,0x0 3c8: ed450513 addi a0,a0,-300 # 298 <thread_c> 3cc: 00000097 auipc ra,0x0 3d0: cd4080e7 jalr -812(ra) # a0 <thread_create> thread_schedule(); 3d4: 00000097 auipc ra,0x0 3d8: c52080e7 jalr -942(ra) # 26 <thread_schedule> exit(0); 3dc: 4501 li a0,0 3de: 00000097 auipc ra,0x0 3e2: 280080e7 jalr 640(ra) # 65e <exit> 00000000000003e6 <thread_switch>: 3e6: 8082 ret 00000000000003e8 <strcpy>: #include "kernel/fcntl.h" #include "user/user.h" char* strcpy(char *s, const char *t) { 3e8: 1141 addi sp,sp,-16 3ea: e422 sd s0,8(sp) 3ec: 0800 addi s0,sp,16 char *os; os = s; while((*s++ = *t++) != 0) 3ee: 87aa mv a5,a0 3f0: 0585 addi a1,a1,1 3f2: 0785 addi a5,a5,1 3f4: fff5c703 lbu a4,-1(a1) 3f8: fee78fa3 sb a4,-1(a5) 3fc: fb75 bnez a4,3f0 <strcpy+0x8> ; return os; } 3fe: 6422 ld s0,8(sp) 400: 0141 addi sp,sp,16 402: 8082 ret 0000000000000404 <strcmp>: int strcmp(const char *p, const char *q) { 404: 1141 addi sp,sp,-16 406: e422 sd s0,8(sp) 408: 0800 addi s0,sp,16 while(*p && *p == *q) 40a: 00054783 lbu a5,0(a0) 40e: cb91 beqz a5,422 <strcmp+0x1e> 410: 0005c703 lbu a4,0(a1) 414: 00f71763 bne a4,a5,422 <strcmp+0x1e> p++, q++; 418: 0505 addi a0,a0,1 41a: 0585 addi a1,a1,1 while(*p && *p == *q) 41c: 00054783 lbu a5,0(a0) 420: fbe5 bnez a5,410 <strcmp+0xc> return (uchar)*p - (uchar)*q; 422: 0005c503 lbu a0,0(a1) } 426: 40a7853b subw a0,a5,a0 42a: 6422 ld s0,8(sp) 42c: 0141 addi sp,sp,16 42e: 8082 ret 0000000000000430 <strlen>: uint strlen(const char *s) { 430: 1141 addi sp,sp,-16 432: e422 sd s0,8(sp) 434: 0800 addi s0,sp,16 int n; for(n = 0; s[n]; n++) 436: 00054783 lbu a5,0(a0) 43a: cf91 beqz a5,456 <strlen+0x26> 43c: 0505 addi a0,a0,1 43e: 87aa mv a5,a0 440: 4685 li a3,1 442: 9e89 subw a3,a3,a0 444: 00f6853b addw a0,a3,a5 448: 0785 addi a5,a5,1 44a: fff7c703 lbu a4,-1(a5) 44e: fb7d bnez a4,444 <strlen+0x14> ; return n; } 450: 6422 ld s0,8(sp) 452: 0141 addi sp,sp,16 454: 8082 ret for(n = 0; s[n]; n++) 456: 4501 li a0,0 458: bfe5 j 450 <strlen+0x20> 000000000000045a <memset>: void* memset(void *dst, int c, uint n) { 45a: 1141 addi sp,sp,-16 45c: e422 sd s0,8(sp) 45e: 0800 addi s0,sp,16 char *cdst = (char *) dst; int i; for(i = 0; i < n; i++){ 460: ce09 beqz a2,47a <memset+0x20> 462: 87aa mv a5,a0 464: fff6071b addiw a4,a2,-1 468: 1702 slli a4,a4,0x20 46a: 9301 srli a4,a4,0x20 46c: 0705 addi a4,a4,1 46e: 972a add a4,a4,a0 cdst[i] = c; 470: 00b78023 sb a1,0(a5) for(i = 0; i < n; i++){ 474: 0785 addi a5,a5,1 476: fee79de3 bne a5,a4,470 <memset+0x16> } return dst; } 47a: 6422 ld s0,8(sp) 47c: 0141 addi sp,sp,16 47e: 8082 ret 0000000000000480 <strchr>: char* strchr(const char *s, char c) { 480: 1141 addi sp,sp,-16 482: e422 sd s0,8(sp) 484: 0800 addi s0,sp,16 for(; *s; s++) 486: 00054783 lbu a5,0(a0) 48a: cb99 beqz a5,4a0 <strchr+0x20> if(*s == c) 48c: 00f58763 beq a1,a5,49a <strchr+0x1a> for(; *s; s++) 490: 0505 addi a0,a0,1 492: 00054783 lbu a5,0(a0) 496: fbfd bnez a5,48c <strchr+0xc> return (char*)s; return 0; 498: 4501 li a0,0 } 49a: 6422 ld s0,8(sp) 49c: 0141 addi sp,sp,16 49e: 8082 ret return 0; 4a0: 4501 li a0,0 4a2: bfe5 j 49a <strchr+0x1a> 00000000000004a4 <gets>: char* gets(char *buf, int max) { 4a4: 711d addi sp,sp,-96 4a6: ec86 sd ra,88(sp) 4a8: e8a2 sd s0,80(sp) 4aa: e4a6 sd s1,72(sp) 4ac: e0ca sd s2,64(sp) 4ae: fc4e sd s3,56(sp) 4b0: f852 sd s4,48(sp) 4b2: f456 sd s5,40(sp) 4b4: f05a sd s6,32(sp) 4b6: ec5e sd s7,24(sp) 4b8: 1080 addi s0,sp,96 4ba: 8baa mv s7,a0 4bc: 8a2e mv s4,a1 int i, cc; char c; for(i=0; i+1 < max; ){ 4be: 892a mv s2,a0 4c0: 4481 li s1,0 cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; if(c == '\n' || c == '\r') 4c2: 4aa9 li s5,10 4c4: 4b35 li s6,13 for(i=0; i+1 < max; ){ 4c6: 89a6 mv s3,s1 4c8: 2485 addiw s1,s1,1 4ca: 0344d863 bge s1,s4,4fa <gets+0x56> cc = read(0, &c, 1); 4ce: 4605 li a2,1 4d0: faf40593 addi a1,s0,-81 4d4: 4501 li a0,0 4d6: 00000097 auipc ra,0x0 4da: 1a0080e7 jalr 416(ra) # 676 <read> if(cc < 1) 4de: 00a05e63 blez a0,4fa <gets+0x56> buf[i++] = c; 4e2: faf44783 lbu a5,-81(s0) 4e6: 00f90023 sb a5,0(s2) if(c == '\n' || c == '\r') 4ea: 01578763 beq a5,s5,4f8 <gets+0x54> 4ee: 0905 addi s2,s2,1 4f0: fd679be3 bne a5,s6,4c6 <gets+0x22> for(i=0; i+1 < max; ){ 4f4: 89a6 mv s3,s1 4f6: a011 j 4fa <gets+0x56> 4f8: 89a6 mv s3,s1 break; } buf[i] = '\0'; 4fa: 99de add s3,s3,s7 4fc: 00098023 sb zero,0(s3) return buf; } 500: 855e mv a0,s7 502: 60e6 ld ra,88(sp) 504: 6446 ld s0,80(sp) 506: 64a6 ld s1,72(sp) 508: 6906 ld s2,64(sp) 50a: 79e2 ld s3,56(sp) 50c: 7a42 ld s4,48(sp) 50e: 7aa2 ld s5,40(sp) 510: 7b02 ld s6,32(sp) 512: 6be2 ld s7,24(sp) 514: 6125 addi sp,sp,96 516: 8082 ret 0000000000000518 <stat>: int stat(const char *n, struct stat *st) { 518: 1101 addi sp,sp,-32 51a: ec06 sd ra,24(sp) 51c: e822 sd s0,16(sp) 51e: e426 sd s1,8(sp) 520: e04a sd s2,0(sp) 522: 1000 addi s0,sp,32 524: 892e mv s2,a1 int fd; int r; fd = open(n, O_RDONLY); 526: 4581 li a1,0 528: 00000097 auipc ra,0x0 52c: 176080e7 jalr 374(ra) # 69e <open> if(fd < 0) 530: 02054563 bltz a0,55a <stat+0x42> 534: 84aa mv s1,a0 return -1; r = fstat(fd, st); 536: 85ca mv a1,s2 538: 00000097 auipc ra,0x0 53c: 17e080e7 jalr 382(ra) # 6b6 <fstat> 540: 892a mv s2,a0 close(fd); 542: 8526 mv a0,s1 544: 00000097 auipc ra,0x0 548: 142080e7 jalr 322(ra) # 686 <close> return r; } 54c: 854a mv a0,s2 54e: 60e2 ld ra,24(sp) 550: 6442 ld s0,16(sp) 552: 64a2 ld s1,8(sp) 554: 6902 ld s2,0(sp) 556: 6105 addi sp,sp,32 558: 8082 ret return -1; 55a: 597d li s2,-1 55c: bfc5 j 54c <stat+0x34> 000000000000055e <atoi>: int atoi(const char *s) { 55e: 1141 addi sp,sp,-16 560: e422 sd s0,8(sp) 562: 0800 addi s0,sp,16 int n; n = 0; while('0' <= *s && *s <= '9') 564: 00054603 lbu a2,0(a0) 568: fd06079b addiw a5,a2,-48 56c: 0ff7f793 andi a5,a5,255 570: 4725 li a4,9 572: 02f76963 bltu a4,a5,5a4 <atoi+0x46> 576: 86aa mv a3,a0 n = 0; 578: 4501 li a0,0 while('0' <= *s && *s <= '9') 57a: 45a5 li a1,9 n = n*10 + *s++ - '0'; 57c: 0685 addi a3,a3,1 57e: 0025179b slliw a5,a0,0x2 582: 9fa9 addw a5,a5,a0 584: 0017979b slliw a5,a5,0x1 588: 9fb1 addw a5,a5,a2 58a: fd07851b addiw a0,a5,-48 while('0' <= *s && *s <= '9') 58e: 0006c603 lbu a2,0(a3) 592: fd06071b addiw a4,a2,-48 596: 0ff77713 andi a4,a4,255 59a: fee5f1e3 bgeu a1,a4,57c <atoi+0x1e> return n; } 59e: 6422 ld s0,8(sp) 5a0: 0141 addi sp,sp,16 5a2: 8082 ret n = 0; 5a4: 4501 li a0,0 5a6: bfe5 j 59e <atoi+0x40> 00000000000005a8 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 5a8: 1141 addi sp,sp,-16 5aa: e422 sd s0,8(sp) 5ac: 0800 addi s0,sp,16 char *dst; const char *src; dst = vdst; src = vsrc; if (src > dst) { 5ae: 02b57663 bgeu a0,a1,5da <memmove+0x32> while(n-- > 0) 5b2: 02c05163 blez a2,5d4 <memmove+0x2c> 5b6: fff6079b addiw a5,a2,-1 5ba: 1782 slli a5,a5,0x20 5bc: 9381 srli a5,a5,0x20 5be: 0785 addi a5,a5,1 5c0: 97aa add a5,a5,a0 dst = vdst; 5c2: 872a mv a4,a0 *dst++ = *src++; 5c4: 0585 addi a1,a1,1 5c6: 0705 addi a4,a4,1 5c8: fff5c683 lbu a3,-1(a1) 5cc: fed70fa3 sb a3,-1(a4) # 1fff <__global_pointer$+0xb5e> while(n-- > 0) 5d0: fee79ae3 bne a5,a4,5c4 <memmove+0x1c> src += n; while(n-- > 0) *--dst = *--src; } return vdst; } 5d4: 6422 ld s0,8(sp) 5d6: 0141 addi sp,sp,16 5d8: 8082 ret dst += n; 5da: 00c50733 add a4,a0,a2 src += n; 5de: 95b2 add a1,a1,a2 while(n-- > 0) 5e0: fec05ae3 blez a2,5d4 <memmove+0x2c> 5e4: fff6079b addiw a5,a2,-1 5e8: 1782 slli a5,a5,0x20 5ea: 9381 srli a5,a5,0x20 5ec: fff7c793 not a5,a5 5f0: 97ba add a5,a5,a4 *--dst = *--src; 5f2: 15fd addi a1,a1,-1 5f4: 177d addi a4,a4,-1 5f6: 0005c683 lbu a3,0(a1) 5fa: 00d70023 sb a3,0(a4) while(n-- > 0) 5fe: fee79ae3 bne a5,a4,5f2 <memmove+0x4a> 602: bfc9 j 5d4 <memmove+0x2c> 0000000000000604 <memcmp>: int memcmp(const void *s1, const void *s2, uint n) { 604: 1141 addi sp,sp,-16 606: e422 sd s0,8(sp) 608: 0800 addi s0,sp,16 const char *p1 = s1, *p2 = s2; while (n-- > 0) { 60a: ca05 beqz a2,63a <memcmp+0x36> 60c: fff6069b addiw a3,a2,-1 610: 1682 slli a3,a3,0x20 612: 9281 srli a3,a3,0x20 614: 0685 addi a3,a3,1 616: 96aa add a3,a3,a0 if (*p1 != *p2) { 618: 00054783 lbu a5,0(a0) 61c: 0005c703 lbu a4,0(a1) 620: 00e79863 bne a5,a4,630 <memcmp+0x2c> return *p1 - *p2; } p1++; 624: 0505 addi a0,a0,1 p2++; 626: 0585 addi a1,a1,1 while (n-- > 0) { 628: fed518e3 bne a0,a3,618 <memcmp+0x14> } return 0; 62c: 4501 li a0,0 62e: a019 j 634 <memcmp+0x30> return *p1 - *p2; 630: 40e7853b subw a0,a5,a4 } 634: 6422 ld s0,8(sp) 636: 0141 addi sp,sp,16 638: 8082 ret return 0; 63a: 4501 li a0,0 63c: bfe5 j 634 <memcmp+0x30> 000000000000063e <memcpy>: void * memcpy(void *dst, const void *src, uint n) { 63e: 1141 addi sp,sp,-16 640: e406 sd ra,8(sp) 642: e022 sd s0,0(sp) 644: 0800 addi s0,sp,16 return memmove(dst, src, n); 646: 00000097 auipc ra,0x0 64a: f62080e7 jalr -158(ra) # 5a8 <memmove> } 64e: 60a2 ld ra,8(sp) 650: 6402 ld s0,0(sp) 652: 0141 addi sp,sp,16 654: 8082 ret 0000000000000656 <fork>: # generated by usys.pl - do not edit #include "kernel/syscall.h" .global fork fork: li a7, SYS_fork 656: 4885 li a7,1 ecall 658: 00000073 ecall ret 65c: 8082 ret 000000000000065e <exit>: .global exit exit: li a7, SYS_exit 65e: 4889 li a7,2 ecall 660: 00000073 ecall ret 664: 8082 ret 0000000000000666 <wait>: .global wait wait: li a7, SYS_wait 666: 488d li a7,3 ecall 668: 00000073 ecall ret 66c: 8082 ret 000000000000066e <pipe>: .global pipe pipe: li a7, SYS_pipe 66e: 4891 li a7,4 ecall 670: 00000073 ecall ret 674: 8082 ret 0000000000000676 <read>: .global read read: li a7, SYS_read 676: 4895 li a7,5 ecall 678: 00000073 ecall ret 67c: 8082 ret 000000000000067e <write>: .global write write: li a7, SYS_write 67e: 48c1 li a7,16 ecall 680: 00000073 ecall ret 684: 8082 ret 0000000000000686 <close>: .global close close: li a7, SYS_close 686: 48d5 li a7,21 ecall 688: 00000073 ecall ret 68c: 8082 ret 000000000000068e <kill>: .global kill kill: li a7, SYS_kill 68e: 4899 li a7,6 ecall 690: 00000073 ecall ret 694: 8082 ret 0000000000000696 <exec>: .global exec exec: li a7, SYS_exec 696: 489d li a7,7 ecall 698: 00000073 ecall ret 69c: 8082 ret 000000000000069e <open>: .global open open: li a7, SYS_open 69e: 48bd li a7,15 ecall 6a0: 00000073 ecall ret 6a4: 8082 ret 00000000000006a6 <mknod>: .global mknod mknod: li a7, SYS_mknod 6a6: 48c5 li a7,17 ecall 6a8: 00000073 ecall ret 6ac: 8082 ret 00000000000006ae <unlink>: .global unlink unlink: li a7, SYS_unlink 6ae: 48c9 li a7,18 ecall 6b0: 00000073 ecall ret 6b4: 8082 ret 00000000000006b6 <fstat>: .global fstat fstat: li a7, SYS_fstat 6b6: 48a1 li a7,8 ecall 6b8: 00000073 ecall ret 6bc: 8082 ret 00000000000006be <link>: .global link link: li a7, SYS_link 6be: 48cd li a7,19 ecall 6c0: 00000073 ecall ret 6c4: 8082 ret 00000000000006c6 <mkdir>: .global mkdir mkdir: li a7, SYS_mkdir 6c6: 48d1 li a7,20 ecall 6c8: 00000073 ecall ret 6cc: 8082 ret 00000000000006ce <chdir>: .global chdir chdir: li a7, SYS_chdir 6ce: 48a5 li a7,9 ecall 6d0: 00000073 ecall ret 6d4: 8082 ret 00000000000006d6 <dup>: .global dup dup: li a7, SYS_dup 6d6: 48a9 li a7,10 ecall 6d8: 00000073 ecall ret 6dc: 8082 ret 00000000000006de <getpid>: .global getpid getpid: li a7, SYS_getpid 6de: 48ad li a7,11 ecall 6e0: 00000073 ecall ret 6e4: 8082 ret 00000000000006e6 <sbrk>: .global sbrk sbrk: li a7, SYS_sbrk 6e6: 48b1 li a7,12 ecall 6e8: 00000073 ecall ret 6ec: 8082 ret 00000000000006ee <sleep>: .global sleep sleep: li a7, SYS_sleep 6ee: 48b5 li a7,13 ecall 6f0: 00000073 ecall ret 6f4: 8082 ret 00000000000006f6 <uptime>: .global uptime uptime: li a7, SYS_uptime 6f6: 48b9 li a7,14 ecall 6f8: 00000073 ecall ret 6fc: 8082 ret 00000000000006fe <connect>: .global connect connect: li a7, SYS_connect 6fe: 48d9 li a7,22 ecall 700: 00000073 ecall ret 704: 8082 ret 0000000000000706 <ntas>: .global ntas ntas: li a7, SYS_ntas 706: 48dd li a7,23 ecall 708: 00000073 ecall ret 70c: 8082 ret 000000000000070e <putc>: static char digits[] = "0123456789ABCDEF"; static void putc(int fd, char c) { 70e: 1101 addi sp,sp,-32 710: ec06 sd ra,24(sp) 712: e822 sd s0,16(sp) 714: 1000 addi s0,sp,32 716: feb407a3 sb a1,-17(s0) write(fd, &c, 1); 71a: 4605 li a2,1 71c: fef40593 addi a1,s0,-17 720: 00000097 auipc ra,0x0 724: f5e080e7 jalr -162(ra) # 67e <write> } 728: 60e2 ld ra,24(sp) 72a: 6442 ld s0,16(sp) 72c: 6105 addi sp,sp,32 72e: 8082 ret 0000000000000730 <printint>: static void printint(int fd, int xx, int base, int sgn) { 730: 7139 addi sp,sp,-64 732: fc06 sd ra,56(sp) 734: f822 sd s0,48(sp) 736: f426 sd s1,40(sp) 738: f04a sd s2,32(sp) 73a: ec4e sd s3,24(sp) 73c: 0080 addi s0,sp,64 73e: 84aa mv s1,a0 char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 740: c299 beqz a3,746 <printint+0x16> 742: 0805c863 bltz a1,7d2 <printint+0xa2> neg = 1; x = -xx; } else { x = xx; 746: 2581 sext.w a1,a1 neg = 0; 748: 4881 li a7,0 74a: fc040693 addi a3,s0,-64 } i = 0; 74e: 4701 li a4,0 do{ buf[i++] = digits[x % base]; 750: 2601 sext.w a2,a2 752: 00000517 auipc a0,0x0 756: 53e50513 addi a0,a0,1342 # c90 <digits> 75a: 883a mv a6,a4 75c: 2705 addiw a4,a4,1 75e: 02c5f7bb remuw a5,a1,a2 762: 1782 slli a5,a5,0x20 764: 9381 srli a5,a5,0x20 766: 97aa add a5,a5,a0 768: 0007c783 lbu a5,0(a5) 76c: 00f68023 sb a5,0(a3) }while((x /= base) != 0); 770: 0005879b sext.w a5,a1 774: 02c5d5bb divuw a1,a1,a2 778: 0685 addi a3,a3,1 77a: fec7f0e3 bgeu a5,a2,75a <printint+0x2a> if(neg) 77e: 00088b63 beqz a7,794 <printint+0x64> buf[i++] = '-'; 782: fd040793 addi a5,s0,-48 786: 973e add a4,a4,a5 788: 02d00793 li a5,45 78c: fef70823 sb a5,-16(a4) 790: 0028071b addiw a4,a6,2 while(--i >= 0) 794: 02e05863 blez a4,7c4 <printint+0x94> 798: fc040793 addi a5,s0,-64 79c: 00e78933 add s2,a5,a4 7a0: fff78993 addi s3,a5,-1 7a4: 99ba add s3,s3,a4 7a6: 377d addiw a4,a4,-1 7a8: 1702 slli a4,a4,0x20 7aa: 9301 srli a4,a4,0x20 7ac: 40e989b3 sub s3,s3,a4 putc(fd, buf[i]); 7b0: fff94583 lbu a1,-1(s2) 7b4: 8526 mv a0,s1 7b6: 00000097 auipc ra,0x0 7ba: f58080e7 jalr -168(ra) # 70e <putc> while(--i >= 0) 7be: 197d addi s2,s2,-1 7c0: ff3918e3 bne s2,s3,7b0 <printint+0x80> } 7c4: 70e2 ld ra,56(sp) 7c6: 7442 ld s0,48(sp) 7c8: 74a2 ld s1,40(sp) 7ca: 7902 ld s2,32(sp) 7cc: 69e2 ld s3,24(sp) 7ce: 6121 addi sp,sp,64 7d0: 8082 ret x = -xx; 7d2: 40b005bb negw a1,a1 neg = 1; 7d6: 4885 li a7,1 x = -xx; 7d8: bf8d j 74a <printint+0x1a> 00000000000007da <vprintf>: } // Print to the given fd. Only understands %d, %x, %p, %s. void vprintf(int fd, const char *fmt, va_list ap) { 7da: 7119 addi sp,sp,-128 7dc: fc86 sd ra,120(sp) 7de: f8a2 sd s0,112(sp) 7e0: f4a6 sd s1,104(sp) 7e2: f0ca sd s2,96(sp) 7e4: ecce sd s3,88(sp) 7e6: e8d2 sd s4,80(sp) 7e8: e4d6 sd s5,72(sp) 7ea: e0da sd s6,64(sp) 7ec: fc5e sd s7,56(sp) 7ee: f862 sd s8,48(sp) 7f0: f466 sd s9,40(sp) 7f2: f06a sd s10,32(sp) 7f4: ec6e sd s11,24(sp) 7f6: 0100 addi s0,sp,128 char *s; int c, i, state; state = 0; for(i = 0; fmt[i]; i++){ 7f8: 0005c903 lbu s2,0(a1) 7fc: 18090f63 beqz s2,99a <vprintf+0x1c0> 800: 8aaa mv s5,a0 802: 8b32 mv s6,a2 804: 00158493 addi s1,a1,1 state = 0; 808: 4981 li s3,0 if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 80a: 02500a13 li s4,37 if(c == 'd'){ 80e: 06400c13 li s8,100 printint(fd, va_arg(ap, int), 10, 1); } else if(c == 'l') { 812: 06c00c93 li s9,108 printint(fd, va_arg(ap, uint64), 10, 0); } else if(c == 'x') { 816: 07800d13 li s10,120 printint(fd, va_arg(ap, int), 16, 0); } else if(c == 'p') { 81a: 07000d93 li s11,112 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 81e: 00000b97 auipc s7,0x0 822: 472b8b93 addi s7,s7,1138 # c90 <digits> 826: a839 j 844 <vprintf+0x6a> putc(fd, c); 828: 85ca mv a1,s2 82a: 8556 mv a0,s5 82c: 00000097 auipc ra,0x0 830: ee2080e7 jalr -286(ra) # 70e <putc> 834: a019 j 83a <vprintf+0x60> } else if(state == '%'){ 836: 01498f63 beq s3,s4,854 <vprintf+0x7a> for(i = 0; fmt[i]; i++){ 83a: 0485 addi s1,s1,1 83c: fff4c903 lbu s2,-1(s1) 840: 14090d63 beqz s2,99a <vprintf+0x1c0> c = fmt[i] & 0xff; 844: 0009079b sext.w a5,s2 if(state == 0){ 848: fe0997e3 bnez s3,836 <vprintf+0x5c> if(c == '%'){ 84c: fd479ee3 bne a5,s4,828 <vprintf+0x4e> state = '%'; 850: 89be mv s3,a5 852: b7e5 j 83a <vprintf+0x60> if(c == 'd'){ 854: 05878063 beq a5,s8,894 <vprintf+0xba> } else if(c == 'l') { 858: 05978c63 beq a5,s9,8b0 <vprintf+0xd6> } else if(c == 'x') { 85c: 07a78863 beq a5,s10,8cc <vprintf+0xf2> } else if(c == 'p') { 860: 09b78463 beq a5,s11,8e8 <vprintf+0x10e> printptr(fd, va_arg(ap, uint64)); } else if(c == 's'){ 864: 07300713 li a4,115 868: 0ce78663 beq a5,a4,934 <vprintf+0x15a> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 86c: 06300713 li a4,99 870: 0ee78e63 beq a5,a4,96c <vprintf+0x192> putc(fd, va_arg(ap, uint)); } else if(c == '%'){ 874: 11478863 beq a5,s4,984 <vprintf+0x1aa> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 878: 85d2 mv a1,s4 87a: 8556 mv a0,s5 87c: 00000097 auipc ra,0x0 880: e92080e7 jalr -366(ra) # 70e <putc> putc(fd, c); 884: 85ca mv a1,s2 886: 8556 mv a0,s5 888: 00000097 auipc ra,0x0 88c: e86080e7 jalr -378(ra) # 70e <putc> } state = 0; 890: 4981 li s3,0 892: b765 j 83a <vprintf+0x60> printint(fd, va_arg(ap, int), 10, 1); 894: 008b0913 addi s2,s6,8 898: 4685 li a3,1 89a: 4629 li a2,10 89c: 000b2583 lw a1,0(s6) 8a0: 8556 mv a0,s5 8a2: 00000097 auipc ra,0x0 8a6: e8e080e7 jalr -370(ra) # 730 <printint> 8aa: 8b4a mv s6,s2 state = 0; 8ac: 4981 li s3,0 8ae: b771 j 83a <vprintf+0x60> printint(fd, va_arg(ap, uint64), 10, 0); 8b0: 008b0913 addi s2,s6,8 8b4: 4681 li a3,0 8b6: 4629 li a2,10 8b8: 000b2583 lw a1,0(s6) 8bc: 8556 mv a0,s5 8be: 00000097 auipc ra,0x0 8c2: e72080e7 jalr -398(ra) # 730 <printint> 8c6: 8b4a mv s6,s2 state = 0; 8c8: 4981 li s3,0 8ca: bf85 j 83a <vprintf+0x60> printint(fd, va_arg(ap, int), 16, 0); 8cc: 008b0913 addi s2,s6,8 8d0: 4681 li a3,0 8d2: 4641 li a2,16 8d4: 000b2583 lw a1,0(s6) 8d8: 8556 mv a0,s5 8da: 00000097 auipc ra,0x0 8de: e56080e7 jalr -426(ra) # 730 <printint> 8e2: 8b4a mv s6,s2 state = 0; 8e4: 4981 li s3,0 8e6: bf91 j 83a <vprintf+0x60> printptr(fd, va_arg(ap, uint64)); 8e8: 008b0793 addi a5,s6,8 8ec: f8f43423 sd a5,-120(s0) 8f0: 000b3983 ld s3,0(s6) putc(fd, '0'); 8f4: 03000593 li a1,48 8f8: 8556 mv a0,s5 8fa: 00000097 auipc ra,0x0 8fe: e14080e7 jalr -492(ra) # 70e <putc> putc(fd, 'x'); 902: 85ea mv a1,s10 904: 8556 mv a0,s5 906: 00000097 auipc ra,0x0 90a: e08080e7 jalr -504(ra) # 70e <putc> 90e: 4941 li s2,16 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 910: 03c9d793 srli a5,s3,0x3c 914: 97de add a5,a5,s7 916: 0007c583 lbu a1,0(a5) 91a: 8556 mv a0,s5 91c: 00000097 auipc ra,0x0 920: df2080e7 jalr -526(ra) # 70e <putc> for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) 924: 0992 slli s3,s3,0x4 926: 397d addiw s2,s2,-1 928: fe0914e3 bnez s2,910 <vprintf+0x136> printptr(fd, va_arg(ap, uint64)); 92c: f8843b03 ld s6,-120(s0) state = 0; 930: 4981 li s3,0 932: b721 j 83a <vprintf+0x60> s = va_arg(ap, char*); 934: 008b0993 addi s3,s6,8 938: 000b3903 ld s2,0(s6) if(s == 0) 93c: 02090163 beqz s2,95e <vprintf+0x184> while(*s != 0){ 940: 00094583 lbu a1,0(s2) 944: c9a1 beqz a1,994 <vprintf+0x1ba> putc(fd, *s); 946: 8556 mv a0,s5 948: 00000097 auipc ra,0x0 94c: dc6080e7 jalr -570(ra) # 70e <putc> s++; 950: 0905 addi s2,s2,1 while(*s != 0){ 952: 00094583 lbu a1,0(s2) 956: f9e5 bnez a1,946 <vprintf+0x16c> s = va_arg(ap, char*); 958: 8b4e mv s6,s3 state = 0; 95a: 4981 li s3,0 95c: bdf9 j 83a <vprintf+0x60> s = "(null)"; 95e: 00000917 auipc s2,0x0 962: 32a90913 addi s2,s2,810 # c88 <malloc+0x1e4> while(*s != 0){ 966: 02800593 li a1,40 96a: bff1 j 946 <vprintf+0x16c> putc(fd, va_arg(ap, uint)); 96c: 008b0913 addi s2,s6,8 970: 000b4583 lbu a1,0(s6) 974: 8556 mv a0,s5 976: 00000097 auipc ra,0x0 97a: d98080e7 jalr -616(ra) # 70e <putc> 97e: 8b4a mv s6,s2 state = 0; 980: 4981 li s3,0 982: bd65 j 83a <vprintf+0x60> putc(fd, c); 984: 85d2 mv a1,s4 986: 8556 mv a0,s5 988: 00000097 auipc ra,0x0 98c: d86080e7 jalr -634(ra) # 70e <putc> state = 0; 990: 4981 li s3,0 992: b565 j 83a <vprintf+0x60> s = va_arg(ap, char*); 994: 8b4e mv s6,s3 state = 0; 996: 4981 li s3,0 998: b54d j 83a <vprintf+0x60> } } } 99a: 70e6 ld ra,120(sp) 99c: 7446 ld s0,112(sp) 99e: 74a6 ld s1,104(sp) 9a0: 7906 ld s2,96(sp) 9a2: 69e6 ld s3,88(sp) 9a4: 6a46 ld s4,80(sp) 9a6: 6aa6 ld s5,72(sp) 9a8: 6b06 ld s6,64(sp) 9aa: 7be2 ld s7,56(sp) 9ac: 7c42 ld s8,48(sp) 9ae: 7ca2 ld s9,40(sp) 9b0: 7d02 ld s10,32(sp) 9b2: 6de2 ld s11,24(sp) 9b4: 6109 addi sp,sp,128 9b6: 8082 ret 00000000000009b8 <fprintf>: void fprintf(int fd, const char *fmt, ...) { 9b8: 715d addi sp,sp,-80 9ba: ec06 sd ra,24(sp) 9bc: e822 sd s0,16(sp) 9be: 1000 addi s0,sp,32 9c0: e010 sd a2,0(s0) 9c2: e414 sd a3,8(s0) 9c4: e818 sd a4,16(s0) 9c6: ec1c sd a5,24(s0) 9c8: 03043023 sd a6,32(s0) 9cc: 03143423 sd a7,40(s0) va_list ap; va_start(ap, fmt); 9d0: fe843423 sd s0,-24(s0) vprintf(fd, fmt, ap); 9d4: 8622 mv a2,s0 9d6: 00000097 auipc ra,0x0 9da: e04080e7 jalr -508(ra) # 7da <vprintf> } 9de: 60e2 ld ra,24(sp) 9e0: 6442 ld s0,16(sp) 9e2: 6161 addi sp,sp,80 9e4: 8082 ret 00000000000009e6 <printf>: void printf(const char *fmt, ...) { 9e6: 711d addi sp,sp,-96 9e8: ec06 sd ra,24(sp) 9ea: e822 sd s0,16(sp) 9ec: 1000 addi s0,sp,32 9ee: e40c sd a1,8(s0) 9f0: e810 sd a2,16(s0) 9f2: ec14 sd a3,24(s0) 9f4: f018 sd a4,32(s0) 9f6: f41c sd a5,40(s0) 9f8: 03043823 sd a6,48(s0) 9fc: 03143c23 sd a7,56(s0) va_list ap; va_start(ap, fmt); a00: 00840613 addi a2,s0,8 a04: fec43423 sd a2,-24(s0) vprintf(1, fmt, ap); a08: 85aa mv a1,a0 a0a: 4505 li a0,1 a0c: 00000097 auipc ra,0x0 a10: dce080e7 jalr -562(ra) # 7da <vprintf> } a14: 60e2 ld ra,24(sp) a16: 6442 ld s0,16(sp) a18: 6125 addi sp,sp,96 a1a: 8082 ret 0000000000000a1c <free>: static Header base; static Header *freep; void free(void *ap) { a1c: 1141 addi sp,sp,-16 a1e: e422 sd s0,8(sp) a20: 0800 addi s0,sp,16 Header *bp, *p; bp = (Header*)ap - 1; a22: ff050693 addi a3,a0,-16 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) a26: 00000797 auipc a5,0x0 a2a: 2a27b783 ld a5,674(a5) # cc8 <freep> a2e: a805 j a5e <free+0x42> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ bp->s.size += p->s.ptr->s.size; a30: 4618 lw a4,8(a2) a32: 9db9 addw a1,a1,a4 a34: feb52c23 sw a1,-8(a0) bp->s.ptr = p->s.ptr->s.ptr; a38: 6398 ld a4,0(a5) a3a: 6318 ld a4,0(a4) a3c: fee53823 sd a4,-16(a0) a40: a091 j a84 <free+0x68> } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ p->s.size += bp->s.size; a42: ff852703 lw a4,-8(a0) a46: 9e39 addw a2,a2,a4 a48: c790 sw a2,8(a5) p->s.ptr = bp->s.ptr; a4a: ff053703 ld a4,-16(a0) a4e: e398 sd a4,0(a5) a50: a099 j a96 <free+0x7a> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) a52: 6398 ld a4,0(a5) a54: 00e7e463 bltu a5,a4,a5c <free+0x40> a58: 00e6ea63 bltu a3,a4,a6c <free+0x50> { a5c: 87ba mv a5,a4 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) a5e: fed7fae3 bgeu a5,a3,a52 <free+0x36> a62: 6398 ld a4,0(a5) a64: 00e6e463 bltu a3,a4,a6c <free+0x50> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) a68: fee7eae3 bltu a5,a4,a5c <free+0x40> if(bp + bp->s.size == p->s.ptr){ a6c: ff852583 lw a1,-8(a0) a70: 6390 ld a2,0(a5) a72: 02059713 slli a4,a1,0x20 a76: 9301 srli a4,a4,0x20 a78: 0712 slli a4,a4,0x4 a7a: 9736 add a4,a4,a3 a7c: fae60ae3 beq a2,a4,a30 <free+0x14> bp->s.ptr = p->s.ptr; a80: fec53823 sd a2,-16(a0) if(p + p->s.size == bp){ a84: 4790 lw a2,8(a5) a86: 02061713 slli a4,a2,0x20 a8a: 9301 srli a4,a4,0x20 a8c: 0712 slli a4,a4,0x4 a8e: 973e add a4,a4,a5 a90: fae689e3 beq a3,a4,a42 <free+0x26> } else p->s.ptr = bp; a94: e394 sd a3,0(a5) freep = p; a96: 00000717 auipc a4,0x0 a9a: 22f73923 sd a5,562(a4) # cc8 <freep> } a9e: 6422 ld s0,8(sp) aa0: 0141 addi sp,sp,16 aa2: 8082 ret 0000000000000aa4 <malloc>: return freep; } void* malloc(uint nbytes) { aa4: 7139 addi sp,sp,-64 aa6: fc06 sd ra,56(sp) aa8: f822 sd s0,48(sp) aaa: f426 sd s1,40(sp) aac: f04a sd s2,32(sp) aae: ec4e sd s3,24(sp) ab0: e852 sd s4,16(sp) ab2: e456 sd s5,8(sp) ab4: e05a sd s6,0(sp) ab6: 0080 addi s0,sp,64 Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; ab8: 02051493 slli s1,a0,0x20 abc: 9081 srli s1,s1,0x20 abe: 04bd addi s1,s1,15 ac0: 8091 srli s1,s1,0x4 ac2: 0014899b addiw s3,s1,1 ac6: 0485 addi s1,s1,1 if((prevp = freep) == 0){ ac8: 00000517 auipc a0,0x0 acc: 20053503 ld a0,512(a0) # cc8 <freep> ad0: c515 beqz a0,afc <malloc+0x58> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ ad2: 611c ld a5,0(a0) if(p->s.size >= nunits){ ad4: 4798 lw a4,8(a5) ad6: 02977f63 bgeu a4,s1,b14 <malloc+0x70> ada: 8a4e mv s4,s3 adc: 0009871b sext.w a4,s3 ae0: 6685 lui a3,0x1 ae2: 00d77363 bgeu a4,a3,ae8 <malloc+0x44> ae6: 6a05 lui s4,0x1 ae8: 000a0b1b sext.w s6,s4 p = sbrk(nu * sizeof(Header)); aec: 004a1a1b slliw s4,s4,0x4 p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) af0: 00000917 auipc s2,0x0 af4: 1d890913 addi s2,s2,472 # cc8 <freep> if(p == (char*)-1) af8: 5afd li s5,-1 afa: a88d j b6c <malloc+0xc8> base.s.ptr = freep = prevp = &base; afc: 00008797 auipc a5,0x8 b00: 1e478793 addi a5,a5,484 # 8ce0 <base> b04: 00000717 auipc a4,0x0 b08: 1cf73223 sd a5,452(a4) # cc8 <freep> b0c: e39c sd a5,0(a5) base.s.size = 0; b0e: 0007a423 sw zero,8(a5) if(p->s.size >= nunits){ b12: b7e1 j ada <malloc+0x36> if(p->s.size == nunits) b14: 02e48b63 beq s1,a4,b4a <malloc+0xa6> p->s.size -= nunits; b18: 4137073b subw a4,a4,s3 b1c: c798 sw a4,8(a5) p += p->s.size; b1e: 1702 slli a4,a4,0x20 b20: 9301 srli a4,a4,0x20 b22: 0712 slli a4,a4,0x4 b24: 97ba add a5,a5,a4 p->s.size = nunits; b26: 0137a423 sw s3,8(a5) freep = prevp; b2a: 00000717 auipc a4,0x0 b2e: 18a73f23 sd a0,414(a4) # cc8 <freep> return (void*)(p + 1); b32: 01078513 addi a0,a5,16 if((p = morecore(nunits)) == 0) return 0; } } b36: 70e2 ld ra,56(sp) b38: 7442 ld s0,48(sp) b3a: 74a2 ld s1,40(sp) b3c: 7902 ld s2,32(sp) b3e: 69e2 ld s3,24(sp) b40: 6a42 ld s4,16(sp) b42: 6aa2 ld s5,8(sp) b44: 6b02 ld s6,0(sp) b46: 6121 addi sp,sp,64 b48: 8082 ret prevp->s.ptr = p->s.ptr; b4a: 6398 ld a4,0(a5) b4c: e118 sd a4,0(a0) b4e: bff1 j b2a <malloc+0x86> hp->s.size = nu; b50: 01652423 sw s6,8(a0) free((void*)(hp + 1)); b54: 0541 addi a0,a0,16 b56: 00000097 auipc ra,0x0 b5a: ec6080e7 jalr -314(ra) # a1c <free> return freep; b5e: 00093503 ld a0,0(s2) if((p = morecore(nunits)) == 0) b62: d971 beqz a0,b36 <malloc+0x92> for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ b64: 611c ld a5,0(a0) if(p->s.size >= nunits){ b66: 4798 lw a4,8(a5) b68: fa9776e3 bgeu a4,s1,b14 <malloc+0x70> if(p == freep) b6c: 00093703 ld a4,0(s2) b70: 853e mv a0,a5 b72: fef719e3 bne a4,a5,b64 <malloc+0xc0> p = sbrk(nu * sizeof(Header)); b76: 8552 mv a0,s4 b78: 00000097 auipc ra,0x0 b7c: b6e080e7 jalr -1170(ra) # 6e6 <sbrk> if(p == (char*)-1) b80: fd5518e3 bne a0,s5,b50 <malloc+0xac> return 0; b84: 4501 li a0,0 b86: bf45 j b36 <malloc+0x92>
3rdParties/src/nasm/nasm-2.15.02/travis/test/nop.asm
blue3k/StormForge
1
23430
bits 64 nop o64 nop pause o64 pause xchg ax,ax xchg eax,eax xchg rax,rax rep xchg ax,ax rep xchg eax,eax rep xchg rax,rax
include/game-gaudio.ads
Holt59/Ada-SDL
0
16952
<gh_stars>0 -------------------------------------------- -- -- -- PACKAGE GAME - PARTIE ADA -- -- -- -- GAME-GAUDIO.ADS -- -- -- -- Gestion du son (musique et "chunk") -- -- -- -- Créateur : <NAME> -- -- Adresse : <EMAIL> -- -- -- -- Dernière modification : 14 / 06 / 2011 -- -- -- -------------------------------------------- with Interfaces.C; with Ada.Finalization; package Game.gAudio is -- Types servant à stocker des Musique ou des sons court type Music is limited private; type Chunk is limited private; Max_Volume : constant := 128; type Volume is range 0..Max_Volume; ---------------------------------------- -- FONCTIONS DE GESTION DE LA MUSIQUE -- ---------------------------------------- -- Format supporté (en théorie, si erreur merci de me contacter) : -- .wav -- .aiff -- .voc -- .mod .xm .s3m .669 .it .med -- .mid -- .ogg -- .mp3 -- Charge une musique procedure Load_Music (Mus : out Music; Name : in String); -- Joue la musique -- Une seule musique peut être joué à la fois procedure Play_Music(Mus : in Music; -- Musique à jouer Loops : in Boolean := True; -- En boucle ? Nb : in Positive := 1); -- Nombre de fois (si pas de boucle) -- Arrête la musique procedure Stop_Music; -- Met la musique en Pause si P vaut True, sinon enlève la pause procedure Pause_Music(P : in Boolean := True); -- Vérifie si la musique est en pause ou en train de joué function Music_Paused return Boolean; function Music_Playing return Boolean; -- Recommence la musique depuis le début procedure Restart_Music; -- Change le volume de la musique procedure Set_Music_Volume (V : in Volume); ------------------------------------------------- -- FONCTION DE GESTION DES SONS COURTS (CHUNK) -- ------------------------------------------------- -- Chaque son court est joué sur un canal (channel) différent -- Pour affecter un son court, vous devez affecter le canal sur -- lequel il est joué -- Format supporté (en théorie, si erreur merci de me contacter) : -- .wav -- .aiff -- .voc -- .riff -- .ogg -- Type Canal, vous pouvez avoir maximum 100 canaux (<=> sons) ouvert en même temps Last_Channel : constant := 100 ; type Channel is range 0 .. Last_Channel ; -- Charge un son court procedure Load_Chunk (Ch : out Chunk; Name : in String); -- Alloue Nb canaux procedure Allocate_Channel (Nb : in Positive); -- Joue le son Ch -- Premier canal libre utilisé dans le premier cas procedure Play_Channel(Ch : in Chunk; -- Chunk à joeur Nb : in Positive := 1; -- Nombre de fois que le chunk est joué Time : in Natural := 0); -- Temps du chunk (si 0, le chunk est joué en entier) procedure Play_Channel(Ch : in Chunk; -- Chunk à jouer Chan : in Channel; -- Canal sur lequel jouer le chunk Nb : in Positive := 1; -- Nombre de fois que le chunk est joué Time : in Natural := 0); -- Temps du chunk (si 0, le chunk est joué en entier) -- Stop le canal Ch, pareil qu'au dessus si aucun canal n'est spécifié procedure Stop_Channel; procedure Stop_Channel(Ch : in Channel); -- Met en pause le canal Ch, s'il n'est pas spécifié, met en pause tous les canaux procedure Pause_Channel(P : in Boolean := True); procedure Pause_Channel(Chan : in Channel; P : in Boolean := True); -- Test si le canal est en pause / en train de joué function Channel_Paused (Ch : in Channel) return Boolean; function Channel_Playing(Ch : in Channel) return Boolean; -- Retourne le nombre de canaux en pause / en train de joué function Nb_Chan_Paused return Natural; function Nb_Chan_Playing return Natural; -- Met le volume du canal C à V procedure Set_Channel_Volume(V : in Volume); procedure Set_Channel_Volume(C : in Channel; V : in Volume); private package AF renames Ada.Finalization; ----------- -- MUSIC -- ----------- type SDL_Music is access all Interfaces.C.Int; Null_SDL_Music : constant SDL_Music := null; procedure Close_Music (M : in out Music); type Music is new AF.Controlled with record Mus : SDL_Music := Null_SDL_Music; end record; procedure Initialize (M : in out Music); procedure Finalize (M : in out Music); ----------- -- CHUNK -- ----------- type SDL_Chunk is access all Interfaces.C.Int; Null_SDL_Chunk : constant SDL_Chunk := null; procedure Close_Chunk (C : in out Chunk); type Chunk is new AF.Controlled with record Chu : SDL_Chunk := Null_SDL_Chunk; end record; procedure Initialize (C : in out Chunk); procedure Finalize (C : in out Chunk); end Game.gAudio;
grammar/Math.g4
gress2/AST
0
7506
grammar Math; math : expr END; expr : OPEN_PAREN expr CLOSE_PAREN # parensExpr | op=(OP_ADD|OP_SUB) expr # unaryExpr | left=expr op=OP_EXP right=expr # infixExpr | left=expr op=(OP_MUL|OP_DIV) right=expr # infixExpr | left=expr op=(OP_ADD|OP_SUB) right=expr # infixExpr | func=ID OPEN_PAREN expr CLOSE_PAREN # funcExpr | OPEN_PAREN expr CLOSE_PAREN # parensExpr | OPEN_BRACK expr CLOSE_BRACK # bracketsExpr | value=NUM # numberExpr | id=ID # idExpr ; OPEN_PAREN: '('; CLOSE_PAREN: ')'; OPEN_BRACK: '['; CLOSE_BRACK: ']'; OP_ADD: '+'; OP_SUB: '-'; OP_MUL: '*'; OP_DIV: '/'; OP_EXP: '^'; ID: [_a-zA-Z]*[a-zA-Z][a-zA-Z0-9]*; NUM: [0-9]+ ('.' [0-9]+)? ([eE] [+-]? [0-9]+)?; WS: [ \t] -> channel(HIDDEN); END: [\r\n]+;
libsrc/stdlib/wpeek.asm
dex4er/deb-z88dk
1
241331
<reponame>dex4er/deb-z88dk ; uint __FASTCALL__ wpeek(void *addr) ; 11.2006 aralbrec XLIB wpeek .wpeek ld e,(hl) inc hl ld d,(hl) ex de,hl ret
programs/oeis/021/A021554.asm
karttu/loda
0
82065
<reponame>karttu/loda ; A021554: Decimal expansion of 1/550. ; 0,0,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1 lpb $0,1 mod $0,2 add $1,8 pow $1,$0 lpe
code/seagullbird/t11.asm
KongoHuster/assembly-exercise
1
2266
TITLE seagullbird_t11 .MODEL SMALL .DATA NUMBER DW 1234H .CODE MAIN PROC FAR ASSUME CS:_TEXT, DS:_DATA PUSH DS XOR AX, AX PUSH AX MOV AX, @DATA MOV DS, AX MOV AX, NUMBER MOV CL, 4 MOV BX, AX AND AX, 0FH ROR BX, CL MOV SI, BX AND BX, 0FH ROR SI, CL MOV DX, SI AND SI, 0FH ROR DX, CL AND DX, 0FH MOV CX, SI RET MAIN ENDP END MAIN
Ada/DataStructures/BinTree/int_binary_tree.adb
egustafson/sandbox
2
1204
<reponame>egustafson/sandbox with Ada.Text_IO, Ada.Integer_Text_IO, Ada.Unchecked_Deallocation; use Ada.Text_IO, Ada.Integer_Text_IO; package body Int_Binary_Tree is type Compare_Result_Type is ( Less_Than, Equal, Greater_Than ); type Traced_Node_Type is record Node : Tree_Node_Ptr; Parent : Tree_Node_Ptr; end record; ---------------------------------------------------------------------- procedure Free is new Ada.Unchecked_Deallocation( Tree_Node, Tree_Node_Ptr ); ---------------------------------------------------------------------- function Compare( Left, Right : in Integer ) return Compare_Result_Type is begin if Left < Right then return Less_Than; elsif Left > Right then return Greater_Than; else return Equal; end if; end Compare; ---------------------------------------------------------------------- function Find_Node( Tree: in T; Number: in Integer ) return Traced_Node_Type is T_Node : Traced_Node_Type := Traced_Node_Type'( Node => Tree.Root, Parent => null ); Node : Tree_Node_Ptr renames T_Node.Node; Parent : Tree_Node_Ptr renames T_Node.Parent; begin while Node /= null loop case Compare ( Number, Node.Data ) is when Equal => return T_Node; when Less_Than => Parent := Node; Node := Node.Left; when Greater_Than => Parent := Node; Node := Node.Right; end case; end loop; return T_Node; end Find_Node; ---------------------------------------------------------------------- function Is_In_Tree( Tree: in T; Number: in Integer ) return Boolean is T_Node : Traced_Node_Type := Find_Node( Tree, Number ); begin if T_Node.Node /= null then return True; else return False; end if; end Is_In_Tree; ---------------------------------------------------------------------- procedure Insert( Tree: in out T; Number: in Integer ) is T_Node : Traced_Node_Type := Find_Node( Tree, Number ); New_Node : Tree_Node_Ptr := new Tree_Node'( Data => Number, Left => null, Right => null ); begin if T_Node.Node /= null then return; elsif T_Node.Parent = null then Tree.Root := New_Node; else case Compare( Number, T_Node.Parent.Data ) is when Less_Than => T_Node.Parent.Left := New_Node; when Greater_Than => T_Node.Parent.Right := New_Node; when Equal => null; end case; end if; end Insert; ---------------------------------------------------------------------- procedure Remove( Tree: in out T; Number: in Integer ) is Remove_Node : Traced_Node_Type := Find_Node( Tree, Number ); Pivot_Node : Tree_Node_Ptr; Pivot_Node_Parent : Tree_Node_Ptr; procedure Graft( Tree: in out T; Old_Node, New_Node, Parent: in out Tree_Node_Ptr ) is begin if Parent /= null then if Parent.Left = Old_Node then Parent.Left := New_Node; else Parent.Right := New_Node; end if; else Tree.Root := New_Node; end if; end Graft; begin if Remove_Node.Node = null then return; end if; if Remove_Node.Node.Left = null then Graft( Tree, Remove_Node.Node, Remove_Node.Node.Right, Remove_Node.Parent ); Free( Remove_Node.Node ); elsif Remove_Node.Node.Right = null then Graft( Tree, Remove_Node.Node, Remove_Node.Node.Left, Remove_Node.Parent ); Free( Remove_Node.Node ); else Pivot_Node_Parent := Remove_Node.Node; Pivot_Node := Remove_Node.Node.Left; while Pivot_Node.Right /= null loop Pivot_Node_Parent := Pivot_Node; Pivot_Node := Pivot_Node.Right; end loop; if Pivot_Node_Parent = Remove_Node.Node then Pivot_Node.Right := Remove_Node.Node.Right; else Pivot_Node_Parent.Right := Pivot_Node.Left; Pivot_Node.Left := Remove_Node.Node.Left; Pivot_Node.Right := Remove_Node.Node.Right; end if; Graft( Tree, Remove_Node.Node, Pivot_Node, Remove_Node.Parent ); end if; end Remove; ---------------------------------------------------------------------- procedure Print( Tree: in T ) is procedure Print_Node( Node: in Tree_Node_Ptr ) is begin if Node.Left /= null then Print_Node( Node.Left ); end if; Put(Node.Data); New_Line; if Node.Right /= null then Print_Node( Node.Right ); end if; end; begin Print_Node( Tree.Root ); end Print; ---------------------------------------------------------------------- procedure Debug_Print( Tree: in T ) is procedure Print_Node( Node: in Tree_Node_Ptr ) is procedure Print_Branch( Node: in Tree_Node_Ptr ) is begin if Node = null then Put(" null"); else Put(Node.Data); end if; end Print_Branch; begin if Node.Left /= null then Print_Node( Node.Left ); end if; Put(Node.Data); Put(" Left: "); Print_Branch(Node.Left); Put(" Right:"); Print_Branch(Node.Right); New_Line; if Node.Right /= null then Print_Node( Node.Right ); end if; end Print_Node; begin Print_Node( Tree.Root ); end Debug_Print; end Int_Binary_Tree;
src/README.agda
asr/pts-agda
21
10096
------------------------------------------------------------------------ -- Experiments with Pure Type Systems (PTS) ------------------------------------------------------------------------ -- Author: <NAME> -- Copyright (c) 2015 EPFL -- The code in this directory contains a (partial) Agda formalization -- of Pure Type Systems (PTS). -- -- The code makes heavy use of the Agda standard library, which is -- freely available from -- -- https://github.com/agda/agda-stdlib/ -- -- The code has been tested using Agda 2.5.3 and version 0.14 of the -- Agda standard library. module README where ------------------------------------------------------------------------ -- Modules related to pure type systems (PTS) -- Syntax of (untyped) terms along with support for substitutions. open import Pts.Syntax -- Variants of β-reduction/equivalence and properties thereof. open import Pts.Reduction.Cbv open import Pts.Reduction.Full open import Pts.Reduction.Parallel -- Typing of terms, substitution lemmas and a proofs of type soundess -- (preservation/subject reduction and progress). open import Pts.Core open import Pts.Typing open import Pts.Typing.Progress ------------------------------------------------------------------------ -- Modules containing generic functionality -- Extra lemmas that are derivable in the substitution framework of -- the Agda standard library, as well as support for substitutions -- lifted to relations and typed substitutions. open import Data.Fin.Substitution.ExtraLemmas open import Data.Fin.Substitution.Relation open import Data.Fin.Substitution.Typed -- Symmetric and equivalence closures of binary relations. open import Relation.Binary.SymmetricClosure open import Relation.Binary.EquivalenceClosure -- Support for generic reduction relations. open import Relation.Binary.Reduction
programs/oeis/306/A306847.asm
neoneye/loda
22
20234
<filename>programs/oeis/306/A306847.asm ; A306847: a(n) = Sum_{k=0..floor(n/6)} binomial(n,6*k). ; 1,1,1,1,1,1,2,8,29,85,211,463,926,1730,3095,5461,9829,18565,37130,77540,164921,349525,728575,1486675,2973350,5858126,11450531,22369621,43942081,87087001,174174002,350739488,708653429,1431655765,2884834891,5791193143,11582386286,23100202490,46006694735,91625968981,182670807229,364760483725,729520967450,1460785327100,2926800830801,5864062014805,11743814559415,23503319648635,47006639297270,93966207005126,187791199242011,375299968947541,750176293590361,1499928942876001,2999857885752002,6000986704418168,12005786207578829,24019198012642645,48049834421512771,96111107239253023,192222214478506046,384410113768329650,768717281970611975,1537228672809129301,3074148508920116629,6147988181142091285,12295976362284182570,24592879234662791060,49188537999608859881,98382635059784275285,196773608710418383855,393555556011686600995,787111112023373201990,1574197208274196904126,3148319369230745308691,6296488643826193618261,12592752145699441737841,25185279149445937977001,50370558298891875954002,100741792023642588404048,201485610324861686296229,402975273204876391568725,805956625242482311601851,1611919329317694151668103,3223838658635388303336206,6447659080772588021279210,12895263452050610286378815,25790417485112089060398421,51580670841740480852258029,103161177554997264435977245,206322355109994528871954490,412645202605440149549525420,825291882367233574515900161,1650586719047173699865498965,3301177869563407225981545895,6602360170595874278213639755,13204720341191748556427279510,26409427387976317634102915126,52818814892731096831950898571,105637550019019116791391933781 mov $3,$0 lpb $0 sub $0,6 mov $2,$3 bin $2,$0 add $1,$2 lpe add $1,1 mov $0,$1
libsrc/_DEVELOPMENT/math/float/math16/c/sdcc/cm16_sdcc_frexp_callee.asm
Frodevan/z88dk
640
26444
<filename>libsrc/_DEVELOPMENT/math/float/math16/c/sdcc/cm16_sdcc_frexp_callee.asm<gh_stars>100-1000 SECTION code_fp_math16 PUBLIC cm16_sdcc_frexp_callee EXTERN asm_f16_frexp ; half_t frexp(half_t x, int8_t *pw2); ; Entry: ; Stack: ptr right, half_t left, ret .cm16_sdcc_frexp_callee pop de ;my return pop hl ;half_t pop bc ;ptr push de ;my return jp asm_f16_frexp
Transynther/x86/_processed/US/_st_zr_sm_/i7-7700_9_0x48.log_21829_1467.asm
ljhsiun2/medusa
9
164406
<reponame>ljhsiun2/medusa<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r14 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x4dd0, %r13 nop nop nop xor %r10, %r10 movb $0x61, (%r13) nop nop nop and %r14, %r14 lea addresses_normal_ht+0xa6f4, %r13 nop nop and $16565, %rbx movb $0x61, (%r13) nop nop dec %r14 lea addresses_normal_ht+0x108f4, %rsi lea addresses_WC_ht+0x1b6f4, %rdi clflush (%rsi) nop nop nop nop nop add $42862, %rax mov $71, %rcx rep movsw sub $31766, %rsi lea addresses_A_ht+0xa6f4, %r13 nop nop dec %rax mov $0x6162636465666768, %r14 movq %r14, %xmm7 movups %xmm7, (%r13) nop nop add %rsi, %rsi lea addresses_D_ht+0x5950, %rsi lea addresses_UC_ht+0x1af4, %rdi clflush (%rsi) nop nop nop inc %r13 mov $77, %rcx rep movsb nop nop nop nop nop add $1089, %r10 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r14 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r8 push %rax push %rbp push %rcx // Store lea addresses_US+0xeef4, %r8 nop nop nop nop dec %rbp movb $0x51, (%r8) and $11119, %r13 // Faulty Load lea addresses_US+0xeef4, %rbp nop xor %r8, %r8 vmovups (%rbp), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $0, %xmm2, %r14 lea oracles, %r8 and $0xff, %r14 shlq $12, %r14 mov (%r8,%r14,1), %r14 pop %rcx pop %rbp pop %rax pop %r8 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 16, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}} {'00': 72, '51': 21757} 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 00 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 00 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 */
tmp/643.asm
li7r/os
5
175663
<reponame>li7r/os nasm -fbin Main.asm -o LongModeDirectly ; The main file's name should be Main.asm qemu-system-x86_64 -hda LongModeDirectly ; The secondary file's name should be LongModeDirectly.asm and should be in the same directory
src/main/antlr4/GraphQL.g4
niw/antlr4-graphql-grammar
1
3220
grammar GraphQL; // Document Syntax // https://spec.graphql.org/October2021/#sec-Document-Syntax // Parser // Document // https://spec.graphql.org/October2021/#sec-Document document: definition+; definition: executableDefinition | typeSystemDefinitionOrExtension ; executableDocument: executableDefinition+; executableDefinition: operationDefinition | fragmentDefinition ; // Operations // https://spec.graphql.org/October2021/#sec-Language.Operations operationDefinition: operationType name? variableDefinitions? directives? selectionSet | selectionSet ; operationType: QUERY | MUTATION | SUBSCRIPTION ; // Selection Sets // https://spec.graphql.org/October2021/#sec-Selection-Sets selectionSet: '{' selection+ '}'; selection: field | fragmentSpread | inlineFragment ; // Fields // https://spec.graphql.org/October2021/#sec-Language.Fields field: alias? name arguments? directives? selectionSet?; // Arguments // https://spec.graphql.org/October2021/#sec-Language.Arguments arguments: '(' argument+ ')'; argument: name ':' value; // Field Alias // https://spec.graphql.org/October2021/#sec-Field-Alias alias: name ':'; // Fragments // https://spec.graphql.org/October2021/#sec-Language.Fragments fragmentSpread: '...' fragmentName directives?; fragmentDefinition: FRAGMENT fragmentName typeCondition directives? selectionSet; fragmentName: // Specification is Name but not `on` nameBase | TRUE | FALSE | NULL ; // Type Conditions // https://spec.graphql.org/October2021/#sec-Type-Conditions typeCondition: ON namedType; // Inline Fragments // https://spec.graphql.org/October2021/#sec-Inline-Fragments inlineFragment: '...' typeCondition? directives? selectionSet; // Input Values // https://spec.graphql.org/October2021/#sec-Input-Values value: variable | intValue | floatValue | stringValue | booleanValue | nullValue | enumValue | listValue | objectValue ; // Int Value // https://spec.graphql.org/October2021/#sec-Int-Value intValue: INT_VALUE; // Float Value // https://spec.graphql.org/October2021/#sec-Float-Value floatValue: FLOAT_VALUE; // Bloolean Value // https://spec.graphql.org/October2021/#sec-Boolean-Value booleanValue: TRUE | FALSE ; // String Value // https://spec.graphql.org/October2021/#sec-String-Value stringValue: STRING_VALUE; // Null Value // https://spec.graphql.org/October2021/#sec-Null-Value nullValue: NULL; // Enum Value // https://spec.graphql.org/October2021/#sec-Enum-Value enumValue: // Specification is Name but not `true` or `false` or `null` nameBase | ON; // List Value // https://spec.graphql.org/October2021/#sec-List-Value listValue: '[' ']' | '[' value+ ']' ; // Input Object Values // https://spec.graphql.org/October2021/#sec-Input-Object-Values objectValue: '{' '}' | '{' objectField+ '}' ; objectField: name ':' value; // Variables // https://spec.graphql.org/October2021/#sec-Language.Variables variable: '$' name; variableDefinitions: '(' variableDefinition+ ')'; variableDefinition: variable ':' typeReference defaultValue? directives?; defaultValue: '=' value; // Type References // https://spec.graphql.org/October2021/#sec-Type-References typeReference: namedType | listType | nonNullType ; namedType: name; listType: '[' typeReference ']'; nonNullType: namedType '!' | listType '!' ; // Directives // https://spec.graphql.org/October2021/#sec-Language.Directives directives: directive+; directive: '@' name arguments?; // Type System // https://spec.graphql.org/October2021/#sec-Type-System typeSystemDocument: typeSystemDefinition+; typeSystemDefinition: schemaDefinition | typeDefinition | directiveDefinition ; // Type System Extensions // https://spec.graphql.org/October2021/#sec-Type-System-Extensions typeSystemExtensionDocument: typeSystemDefinitionOrExtension+; typeSystemDefinitionOrExtension: typeSystemDefinition | typeSystemExtension ; typeSystemExtension: schemaExtension | typeExtension ; // Descriptions // https://spec.graphql.org/October2021/#sec-Descriptions description: stringValue; // Schema // https://spec.graphql.org/October2021/#sec-Schema schemaDefinition: description? SCHEMA directives? '{' rootOperationTypeDefinition+ '}'; rootOperationTypeDefinition: operationType ':' namedType; // Schema Extension // https://spec.graphql.org/October2021/#sec-Schema-Extension schemaExtension: EXTEND SCHEMA directives? '{' rootOperationTypeDefinition+ '}' | EXTEND SCHEMA directives ; // Types // https://spec.graphql.org/October2021/#sec-Types typeDefinition: scalarTypeDefinition | objectTypeDefinition | interfaceTypeDefinition | unionTypeDefinition | enumTypeDefinition | inputObjectTypeDefinition ; // Type Extensions // https://spec.graphql.org/October2021/#sec-Type-Extensions typeExtension: scalarTypeExtension | objectTypeExtension | interfaceTypeExtension | unionTypeExtension | enumTypeExtension | inputObjectTypeExtension ; // Scalars // https://spec.graphql.org/October2021/#sec-Scalars scalarTypeDefinition: description? SCALAR name directives?; // Scalar Extensions // https://spec.graphql.org/October2021/#sec-Scalar-Extensions scalarTypeExtension: EXTEND SCALAR name directives; // Objects // https://spec.graphql.org/October2021/#sec-Objects objectTypeDefinition: description? TYPE name implementsInterfaces? directives? fieldsDefinition?; implementsInterfaces: IMPLEMENTS '&'? namedType | implementsInterfaces '&' namedType ; fieldsDefinition: '{' fieldDefinition+ '}'; fieldDefinition: description? name argumentsDefinition? ':' typeReference directives?; // Field Arguments // https://spec.graphql.org/October2021/#sec-Field-Arguments argumentsDefinition: '(' inputValueDefinition+ ')'; inputValueDefinition: description? name ':' typeReference defaultValue? directives?; // Object Extensions // https://spec.graphql.org/October2021/#sec-Object-Extensions objectTypeExtension: EXTEND TYPE name implementsInterfaces? directives? fieldsDefinition | EXTEND TYPE name implementsInterfaces? directives | EXTEND TYPE name implementsInterfaces ; // Interfaces // https://spec.graphql.org/October2021/#sec-Interfaces interfaceTypeDefinition: description? INTERFACE name implementsInterfaces? directives? fieldsDefinition?; // Interface Extensions // https://spec.graphql.org/October2021/#sec-Interface-Extensions interfaceTypeExtension: EXTEND INTERFACE name implementsInterfaces? directives? fieldsDefinition | EXTEND INTERFACE name implementsInterfaces? directives | EXTEND INTERFACE name implementsInterfaces ; // Unions // https://spec.graphql.org/October2021/#sec-Unions unionTypeDefinition: description? UNION name directives? unionMemberTypes?; unionMemberTypes: '=' '|'? namedType | unionMemberTypes '|' namedType ; // Union Extensions // https://spec.graphql.org/October2021/#sec-Union-Extensions unionTypeExtension: EXTEND UNION name directives? unionMemberTypes | EXTEND UNION name directives ; // Enums // https://spec.graphql.org/October2021/#sec-Enums enumTypeDefinition: description? ENUM name directives? enumValuesDefinition?; enumValuesDefinition: '{' enumValueDefinition+ '}'; enumValueDefinition: description? enumValue directives?; // Enum Extensions // https://spec.graphql.org/October2021/#sec-Enum-Extensions enumTypeExtension: EXTEND ENUM name directives? enumValuesDefinition | EXTEND ENUM name directives ; // Input Objects // https://spec.graphql.org/October2021/#sec-Input-Objects inputObjectTypeDefinition: description? INPUT name directives? inputFieldsDefinition?; inputFieldsDefinition: '{' inputValueDefinition+ '}'; // Input Object Extensions // https://spec.graphql.org/October2021/#sec-Input-Object-Extensions inputObjectTypeExtension: EXTEND INPUT name directives? inputFieldsDefinition | EXTEND INPUT name directives ; // Directives // https://spec.graphql.org/October2021/#sec-Type-System.Directives directiveDefinition: description? DIRECTIVE '@' name argumentsDefinition? REPEATABLE? ON directiveLocations; directiveLocations: '|'? directiveLocation | directiveLocations '|' directiveLocation ; directiveLocation: executableDirectiveLocation | typeSystemDirectiveLocation ; executableDirectiveLocation: EXECUTABLE_DIRECTIVE_LOCATION; typeSystemDirectiveLocation: TYPE_SYSTEM_DIRECTIVE_LOCATION; // Names // https://spec.graphql.org/October2021/#Name name: nameBase | TRUE | FALSE | NULL | ON ; nameBase: NAME | QUERY | MUTATION | SUBSCRIPTION | FRAGMENT | EXTEND | SCHEMA | SCALAR | TYPE | IMPLEMENTS | INTERFACE | UNION | ENUM | INPUT | DIRECTIVE | REPEATABLE | EXECUTABLE_DIRECTIVE_LOCATION | TYPE_SYSTEM_DIRECTIVE_LOCATION ; // Lexer TRUE: 'true'; FALSE: 'false'; NULL: 'null'; ON: 'on'; QUERY: 'query'; MUTATION: 'mutation'; SUBSCRIPTION: 'subscription'; FRAGMENT: 'fragment'; EXTEND: 'extend'; SCHEMA: 'schema'; SCALAR: 'scalar'; TYPE: 'type'; IMPLEMENTS: 'implements'; INTERFACE: 'interface'; UNION: 'union'; ENUM: 'enum'; INPUT: 'input'; DIRECTIVE: 'directive'; REPEATABLE: 'repeatable'; EXECUTABLE_DIRECTIVE_LOCATION: 'QUERY' | 'MUTATION' | 'SUBSCRIPTION' | 'FIELD' | 'FRAGMENT_DEFINITION' | 'FRAGMENT_SPREAD' | 'INLINE_FRAGMENT' | 'VARIABLE_DEFINITION' ; TYPE_SYSTEM_DIRECTIVE_LOCATION: 'SCHEMA' | 'SCALAR' | 'OBJECT' | 'FIELD_DEFINITION' | 'ARGUMENT_DEFINITION' | 'INTERFACE' | 'UNION' | 'ENUM' | 'ENUM_VALUE' | 'INPUT_OBJECT' | 'INPUT_FIELD_DEFINITION' ; NAME: [_A-Za-z] [_0-9A-Za-z]*; // Int Value // https://spec.graphql.org/October2021/#sec-Int-Value INT_VALUE: INTEGER_PART; INTEGER_PART: NEGATIVE_SIGN? '0' | NEGATIVE_SIGN? NON_ZERO_DIGIT DIGIT* ; fragment NEGATIVE_SIGN: '-'; fragment DIGIT: [0-9]; fragment NON_ZERO_DIGIT: // Specification is Digit but not `0`. [1-9]; // Float Value // https://spec.graphql.org/October2021/#sec-Float-Value FLOAT_VALUE: INTEGER_PART FRACTIONAL_PART | INTEGER_PART EXPONENTIAL_PART | INTEGER_PART FRACTIONAL_PART EXPONENTIAL_PART ; fragment FRACTIONAL_PART: '.' DIGIT+; fragment EXPONENTIAL_PART: EXPONENT_INDICATOR SIGN? DIGIT+; fragment EXPONENT_INDICATOR: [eE]; fragment SIGN: [+-]; // String Value // https://spec.graphql.org/October2021/#sec-String-Value STRING_VALUE: '"' STRING_CHARACTER* '"' // Nongreedy subrules | '"""' BLOCK_STRING_CHARCTER*? '"""' ; fragment STRING_CHARACTER: // Specification is SourceCharacter but not `"` or `\` or LineTerminator. [\u0009\u0020\u0021\u0023-\u005b\u005d-\uFFFF] | '\\u' ESCAPED_UNICODE | '\\' ESCAPED_CHARACTER ; fragment ESCAPED_UNICODE: ESCAPED_UNICODE_CHARACTER ESCAPED_UNICODE_CHARACTER ESCAPED_UNICODE_CHARACTER ESCAPED_UNICODE_CHARACTER; fragment ESCAPED_UNICODE_CHARACTER: [0-9A-Fa-f]; fragment ESCAPED_CHARACTER: ["\\/bfnrt]; // Specification is // - SourceCharacter but not `"""` or `\"""` // - \""" // See `STRING_VALUE` also for this condition. fragment BLOCK_STRING_CHARCTER: // The order of token is matter. '\\"""' | SOURCE_CHARACTER ; // Source Text // https://spec.graphql.org/October2021/#sec-Language.Source-Text fragment SOURCE_CHARACTER: [\u0009\u000A\u000D\u0020-\uFFFF]; // Ignored Tokens // https://spec.graphql.org/October2021/#sec-Language.Source-Text.Ignored-Tokens UNICODE_BOM: '\uFEFF' -> skip; WHITE_SPACE: [\u0009\u0020] -> skip; LINE_TERMINATOR: // Specification is // - New Line (U+000A) // - Carrige Return (U+000D) [Lookahead != New Line (U+000A)] // - Carrige Return (U+000D) New Line (U+000A) [\u000A\u000D] -> skip; COMMENT: // Specification is SourceCharacter but not LineTerminator. '#' [\u0009\u0020-\uFFFF]* -> skip; COMMA: ',' -> skip;
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/abstract_with_anonymous_result.adb
best08618/asylo
7
18467
<reponame>best08618/asylo<gh_stars>1-10 -- { dg-do run } procedure Abstract_With_Anonymous_Result is package Pkg is type I is abstract tagged null record; type Acc_I_Class is access all I'Class; function Func (V : I) return access I'Class is abstract; procedure Proc (V : access I'Class); type New_I is new I with null record; function Func (V : New_I) return access I'Class; end Pkg; package body Pkg is X : aliased New_I; procedure Proc (V : access I'Class) is begin null; end Proc; function Func (V : New_I) return access I'Class is begin X := V; return X'Access; end Func; end Pkg; use Pkg; New_I_Obj : aliased New_I; procedure Proc2 (V : access I'Class) is begin Proc (Func (V.all)); -- Call to Func causes gigi abort 122 end Proc2; begin Proc2 (New_I_Obj'Access); end Abstract_With_Anonymous_Result;
oeis/162/A162959.asm
neoneye/loda-programs
11
2925
<gh_stars>10-100 ; A162959: The pairs (x,y) such that (x^2 + y^2)/(x*y + 1) is a perfect square, i.e., 4. ; 0,2,2,8,8,30,30,112,112,418,418,1560,1560,5822,5822,21728,21728,81090,81090,302632,302632,1129438,1129438,4215120,4215120,15731042,15731042,58709048,58709048,219105150,219105150,817711552,817711552,3051741058,3051741058,11389252680,11389252680,42505269662,42505269662,158631825968,158631825968,592022034210,592022034210,2209456310872,2209456310872,8245803209278,8245803209278,30773756526240,30773756526240,114849222895682,114849222895682,428623135056488,428623135056488,1599643317330270 lpb $0 trn $0,2 add $1,$2 add $1,2 add $2,$1 add $2,$1 lpe mov $0,$1
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1065.asm
ljhsiun2/medusa
9
173313
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r15 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0xebca, %rdx nop nop nop nop nop and $22953, %rbx mov $0x6162636465666768, %r13 movq %r13, (%rdx) nop nop nop nop inc %r13 lea addresses_WT_ht+0x153ca, %rbp nop and $20618, %r15 mov $0x6162636465666768, %r13 movq %r13, %xmm1 and $0xffffffffffffffc0, %rbp vmovntdq %ymm1, (%rbp) nop nop nop nop dec %rbx lea addresses_WT_ht+0x1a4ca, %r10 nop nop nop nop nop add %r13, %r13 movb $0x61, (%r10) nop nop lfence lea addresses_D_ht+0x16dca, %rsi lea addresses_A_ht+0x15f60, %rdi nop nop nop xor $9365, %r10 mov $56, %rcx rep movsl nop nop nop nop nop sub $63264, %rsi lea addresses_D_ht+0x12aa, %rdi nop nop nop nop cmp $23272, %rcx movb $0x61, (%rdi) nop nop nop nop add $30011, %r10 lea addresses_D_ht+0x854a, %rsi lea addresses_D_ht+0xa672, %rdi nop nop nop nop inc %r13 mov $22, %rcx rep movsl nop nop xor %rbx, %rbx lea addresses_A_ht+0xce4e, %r13 cmp $5821, %r10 mov $0x6162636465666768, %rbp movq %rbp, (%r13) nop sub %rsi, %rsi lea addresses_UC_ht+0x7854, %rdx nop nop nop dec %rbx vmovups (%rdx), %ymm0 vextracti128 $0, %ymm0, %xmm0 vpextrq $0, %xmm0, %rcx nop nop inc %rbx lea addresses_D_ht+0x14e2, %rcx nop nop nop nop nop and $5029, %r15 mov $0x6162636465666768, %r13 movq %r13, %xmm3 and $0xffffffffffffffc0, %rcx vmovntdq %ymm3, (%rcx) nop nop nop dec %r10 lea addresses_A_ht+0x16ca, %rsi lea addresses_D_ht+0x770a, %rdi add $42705, %r13 mov $18, %rcx rep movsq nop add %rdx, %rdx lea addresses_D_ht+0x1a84a, %r10 nop nop add %r15, %r15 mov $0x6162636465666768, %rbx movq %rbx, %xmm3 movups %xmm3, (%r10) nop nop nop nop and %rbx, %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r15 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r8 push %r9 push %rbp push %rbx push %rdx // Load lea addresses_WT+0xe182, %rdx nop nop nop nop nop add %r9, %r9 movups (%rdx), %xmm3 vpextrq $0, %xmm3, %rbx inc %rdx // Store lea addresses_PSE+0x19c4a, %r11 nop nop nop nop nop dec %r8 movl $0x51525354, (%r11) nop nop nop cmp %r8, %r8 // Faulty Load lea addresses_WC+0x1b3ca, %r13 nop nop nop nop cmp $14600, %rbp vmovups (%r13), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $0, %xmm3, %rdx lea oracles, %rbx and $0xff, %rdx shlq $12, %rdx mov (%rbx,%rdx,1), %rdx pop %rdx pop %rbx pop %rbp pop %r9 pop %r8 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_PSE', 'size': 4, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': True}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': True, 'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}} {'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 2, 'NT': False, 'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False}} {'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}} {'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 3, 'NT': True, 'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False}} {'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
llvm-gcc-4.2-2.9/gcc/ada/s-auxdec-vms_64.ads
vidkidz/crossbridge
1
25817
<filename>llvm-gcc-4.2-2.9/gcc/ada/s-auxdec-vms_64.ads ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . A U X _ D E C -- -- -- -- S p e c -- -- -- -- Copyright (C) 1996-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS For A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- 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. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package contains definitions that are designed to be compatible -- with the extra definitions in package System for DEC Ada implementations. -- These definitions can be used directly by withing this package, or merged -- with System using pragma Extend_System (Aux_DEC) -- This is the VMS 64 bit version. with Unchecked_Conversion; package System.Aux_DEC is pragma Preelaborate; type Short_Integer_Address is range -2 ** (32 - 1) .. +2 ** (32 - 1) - 1; -- Integer literals cannot appear naked in an address context, as a -- result the bounds of Short_Address cannot be given simply as 2^32 etc. subtype Short_Address is Address range Address (Short_Integer_Address'First) .. Address (Short_Integer_Address'Last); for Short_Address'Object_Size use 32; -- This subtype allows addresses to be converted from 64 bits to 32 bits -- with an appropriate range check. Note that since this is a subtype of -- type System.Address, the same limitations apply to this subtype. Namely -- there are no visible arithmetic operations, and integer literals are -- not available. Short_Memory_Size : constant := 2 ** 32; -- Defined for convenience of porting. type Integer_8 is range -2 ** (8 - 1) .. +2 ** (8 - 1) - 1; for Integer_8'Size use 8; type Integer_16 is range -2 ** (16 - 1) .. +2 ** (16 - 1) - 1; for Integer_16'Size use 16; type Integer_32 is range -2 ** (32 - 1) .. +2 ** (32 - 1) - 1; for Integer_32'Size use 32; type Integer_64 is range -2 ** (64 - 1) .. +2 ** (64 - 1) - 1; for Integer_64'Size use 64; type Largest_Integer is range Min_Int .. Max_Int; type AST_Handler is limited private; No_AST_Handler : constant AST_Handler; type Type_Class is (Type_Class_Enumeration, Type_Class_Integer, Type_Class_Fixed_Point, Type_Class_Floating_Point, Type_Class_Array, Type_Class_Record, Type_Class_Access, Type_Class_Task, -- also in Ada 95 protected Type_Class_Address); function "not" (Left : Largest_Integer) return Largest_Integer; function "and" (Left, Right : Largest_Integer) return Largest_Integer; function "or" (Left, Right : Largest_Integer) return Largest_Integer; function "xor" (Left, Right : Largest_Integer) return Largest_Integer; Address_Zero : constant Address; No_Addr : constant Address; Address_Size : constant := Standard'Address_Size; function "+" (Left : Address; Right : Integer) return Address; function "+" (Left : Integer; Right : Address) return Address; function "-" (Left : Address; Right : Address) return Integer; function "-" (Left : Address; Right : Integer) return Address; generic type Target is private; function Fetch_From_Address (A : Address) return Target; generic type Target is private; procedure Assign_To_Address (A : Address; T : Target); -- Floating point type declarations for VAX floating point data types pragma Warnings (Off); type F_Float is digits 6; pragma Float_Representation (VAX_Float, F_Float); type D_Float is digits 9; pragma Float_Representation (Vax_Float, D_Float); type G_Float is digits 15; pragma Float_Representation (Vax_Float, G_Float); -- Floating point type declarations for IEEE floating point data types type IEEE_Single_Float is digits 6; pragma Float_Representation (IEEE_Float, IEEE_Single_Float); type IEEE_Double_Float is digits 15; pragma Float_Representation (IEEE_Float, IEEE_Double_Float); pragma Warnings (On); Non_Ada_Error : exception; -- Hardware-oriented types and functions type Bit_Array is array (Integer range <>) of Boolean; pragma Pack (Bit_Array); subtype Bit_Array_8 is Bit_Array (0 .. 7); subtype Bit_Array_16 is Bit_Array (0 .. 15); subtype Bit_Array_32 is Bit_Array (0 .. 31); subtype Bit_Array_64 is Bit_Array (0 .. 63); type Unsigned_Byte is range 0 .. 255; for Unsigned_Byte'Size use 8; function "not" (Left : Unsigned_Byte) return Unsigned_Byte; function "and" (Left, Right : Unsigned_Byte) return Unsigned_Byte; function "or" (Left, Right : Unsigned_Byte) return Unsigned_Byte; function "xor" (Left, Right : Unsigned_Byte) return Unsigned_Byte; function To_Unsigned_Byte (X : Bit_Array_8) return Unsigned_Byte; function To_Bit_Array_8 (X : Unsigned_Byte) return Bit_Array_8; type Unsigned_Byte_Array is array (Integer range <>) of Unsigned_Byte; type Unsigned_Word is range 0 .. 65535; for Unsigned_Word'Size use 16; function "not" (Left : Unsigned_Word) return Unsigned_Word; function "and" (Left, Right : Unsigned_Word) return Unsigned_Word; function "or" (Left, Right : Unsigned_Word) return Unsigned_Word; function "xor" (Left, Right : Unsigned_Word) return Unsigned_Word; function To_Unsigned_Word (X : Bit_Array_16) return Unsigned_Word; function To_Bit_Array_16 (X : Unsigned_Word) return Bit_Array_16; type Unsigned_Word_Array is array (Integer range <>) of Unsigned_Word; type Unsigned_Longword is range -2_147_483_648 .. 2_147_483_647; for Unsigned_Longword'Size use 32; function "not" (Left : Unsigned_Longword) return Unsigned_Longword; function "and" (Left, Right : Unsigned_Longword) return Unsigned_Longword; function "or" (Left, Right : Unsigned_Longword) return Unsigned_Longword; function "xor" (Left, Right : Unsigned_Longword) return Unsigned_Longword; function To_Unsigned_Longword (X : Bit_Array_32) return Unsigned_Longword; function To_Bit_Array_32 (X : Unsigned_Longword) return Bit_Array_32; type Unsigned_Longword_Array is array (Integer range <>) of Unsigned_Longword; type Unsigned_32 is range 0 .. 4_294_967_295; for Unsigned_32'Size use 32; function "not" (Left : Unsigned_32) return Unsigned_32; function "and" (Left, Right : Unsigned_32) return Unsigned_32; function "or" (Left, Right : Unsigned_32) return Unsigned_32; function "xor" (Left, Right : Unsigned_32) return Unsigned_32; function To_Unsigned_32 (X : Bit_Array_32) return Unsigned_32; function To_Bit_Array_32 (X : Unsigned_32) return Bit_Array_32; type Unsigned_Quadword is record L0 : Unsigned_Longword; L1 : Unsigned_Longword; end record; for Unsigned_Quadword'Size use 64; for Unsigned_Quadword'Alignment use Integer'Min (8, Standard'Maximum_Alignment); function "not" (Left : Unsigned_Quadword) return Unsigned_Quadword; function "and" (Left, Right : Unsigned_Quadword) return Unsigned_Quadword; function "or" (Left, Right : Unsigned_Quadword) return Unsigned_Quadword; function "xor" (Left, Right : Unsigned_Quadword) return Unsigned_Quadword; function To_Unsigned_Quadword (X : Bit_Array_64) return Unsigned_Quadword; function To_Bit_Array_64 (X : Unsigned_Quadword) return Bit_Array_64; type Unsigned_Quadword_Array is array (Integer range <>) of Unsigned_Quadword; function To_Address (X : Integer) return Address; pragma Pure_Function (To_Address); function To_Address_Long (X : Unsigned_Longword) return Address; pragma Pure_Function (To_Address_Long); function To_Integer (X : Address) return Integer; function To_Unsigned_Longword (X : Address) return Unsigned_Longword; function To_Unsigned_Longword (X : AST_Handler) return Unsigned_Longword; -- Conventional names for static subtypes of type UNSIGNED_LONGWORD subtype Unsigned_1 is Unsigned_Longword range 0 .. 2** 1-1; subtype Unsigned_2 is Unsigned_Longword range 0 .. 2** 2-1; subtype Unsigned_3 is Unsigned_Longword range 0 .. 2** 3-1; subtype Unsigned_4 is Unsigned_Longword range 0 .. 2** 4-1; subtype Unsigned_5 is Unsigned_Longword range 0 .. 2** 5-1; subtype Unsigned_6 is Unsigned_Longword range 0 .. 2** 6-1; subtype Unsigned_7 is Unsigned_Longword range 0 .. 2** 7-1; subtype Unsigned_8 is Unsigned_Longword range 0 .. 2** 8-1; subtype Unsigned_9 is Unsigned_Longword range 0 .. 2** 9-1; subtype Unsigned_10 is Unsigned_Longword range 0 .. 2**10-1; subtype Unsigned_11 is Unsigned_Longword range 0 .. 2**11-1; subtype Unsigned_12 is Unsigned_Longword range 0 .. 2**12-1; subtype Unsigned_13 is Unsigned_Longword range 0 .. 2**13-1; subtype Unsigned_14 is Unsigned_Longword range 0 .. 2**14-1; subtype Unsigned_15 is Unsigned_Longword range 0 .. 2**15-1; subtype Unsigned_16 is Unsigned_Longword range 0 .. 2**16-1; subtype Unsigned_17 is Unsigned_Longword range 0 .. 2**17-1; subtype Unsigned_18 is Unsigned_Longword range 0 .. 2**18-1; subtype Unsigned_19 is Unsigned_Longword range 0 .. 2**19-1; subtype Unsigned_20 is Unsigned_Longword range 0 .. 2**20-1; subtype Unsigned_21 is Unsigned_Longword range 0 .. 2**21-1; subtype Unsigned_22 is Unsigned_Longword range 0 .. 2**22-1; subtype Unsigned_23 is Unsigned_Longword range 0 .. 2**23-1; subtype Unsigned_24 is Unsigned_Longword range 0 .. 2**24-1; subtype Unsigned_25 is Unsigned_Longword range 0 .. 2**25-1; subtype Unsigned_26 is Unsigned_Longword range 0 .. 2**26-1; subtype Unsigned_27 is Unsigned_Longword range 0 .. 2**27-1; subtype Unsigned_28 is Unsigned_Longword range 0 .. 2**28-1; subtype Unsigned_29 is Unsigned_Longword range 0 .. 2**29-1; subtype Unsigned_30 is Unsigned_Longword range 0 .. 2**30-1; subtype Unsigned_31 is Unsigned_Longword range 0 .. 2**31-1; -- Function for obtaining global symbol values function Import_Value (Symbol : String) return Unsigned_Longword; function Import_Address (Symbol : String) return Address; function Import_Largest_Value (Symbol : String) return Largest_Integer; pragma Import (Intrinsic, Import_Value); pragma Import (Intrinsic, Import_Address); pragma Import (Intrinsic, Import_Largest_Value); -- For the following declarations, note that the declaration without -- a Retry_Count parameter means to retry infinitely. A value of zero -- for the Retry_Count parameter means do not retry. -- Interlocked-instruction procedures procedure Clear_Interlocked (Bit : in out Boolean; Old_Value : out Boolean); procedure Set_Interlocked (Bit : in out Boolean; Old_Value : out Boolean); type Aligned_Word is record Value : Short_Integer; end record; for Aligned_Word'Alignment use Integer'Min (2, Standard'Maximum_Alignment); procedure Clear_Interlocked (Bit : in out Boolean; Old_Value : out Boolean; Retry_Count : in Natural; Success_Flag : out Boolean); procedure Set_Interlocked (Bit : in out Boolean; Old_Value : out Boolean; Retry_Count : in Natural; Success_Flag : out Boolean); procedure Add_Interlocked (Addend : in Short_Integer; Augend : in out Aligned_Word; Sign : out Integer); type Aligned_Integer is record Value : Integer; end record; for Aligned_Integer'Alignment use Integer'Min (4, Standard'Maximum_Alignment); type Aligned_Long_Integer is record Value : Long_Integer; end record; for Aligned_Long_Integer'Alignment use Integer'Min (8, Standard'Maximum_Alignment); -- For the following declarations, note that the declaration without -- a Retry_Count parameter mean to retry infinitely. A value of zero -- for the Retry_Count means do not retry. procedure Add_Atomic (To : in out Aligned_Integer; Amount : in Integer); procedure Add_Atomic (To : in out Aligned_Integer; Amount : in Integer; Retry_Count : in Natural; Old_Value : out Integer; Success_Flag : out Boolean); procedure Add_Atomic (To : in out Aligned_Long_Integer; Amount : in Long_Integer); procedure Add_Atomic (To : in out Aligned_Long_Integer; Amount : in Long_Integer; Retry_Count : in Natural; Old_Value : out Long_Integer; Success_Flag : out Boolean); procedure And_Atomic (To : in out Aligned_Integer; From : in Integer); procedure And_Atomic (To : in out Aligned_Integer; From : in Integer; Retry_Count : in Natural; Old_Value : out Integer; Success_Flag : out Boolean); procedure And_Atomic (To : in out Aligned_Long_Integer; From : in Long_Integer); procedure And_Atomic (To : in out Aligned_Long_Integer; From : in Long_Integer; Retry_Count : in Natural; Old_Value : out Long_Integer; Success_Flag : out Boolean); procedure Or_Atomic (To : in out Aligned_Integer; From : in Integer); procedure Or_Atomic (To : in out Aligned_Integer; From : in Integer; Retry_Count : in Natural; Old_Value : out Integer; Success_Flag : out Boolean); procedure Or_Atomic (To : in out Aligned_Long_Integer; From : in Long_Integer); procedure Or_Atomic (To : in out Aligned_Long_Integer; From : in Long_Integer; Retry_Count : in Natural; Old_Value : out Long_Integer; Success_Flag : out Boolean); type Insq_Status is (Fail_No_Lock, OK_Not_First, OK_First); for Insq_Status use (Fail_No_Lock => -1, OK_Not_First => 0, OK_First => +1); type Remq_Status is ( Fail_No_Lock, Fail_Was_Empty, OK_Not_Empty, OK_Empty); for Remq_Status use (Fail_No_Lock => -1, Fail_Was_Empty => 0, OK_Not_Empty => +1, OK_Empty => +2); procedure Insqhi (Item : in Address; Header : in Address; Status : out Insq_Status); procedure Remqhi (Header : in Address; Item : out Address; Status : out Remq_Status); procedure Insqti (Item : in Address; Header : in Address; Status : out Insq_Status); procedure Remqti (Header : in Address; Item : out Address; Status : out Remq_Status); private Address_Zero : constant Address := Null_Address; No_Addr : constant Address := Null_Address; -- An AST_Handler value is from a typing point of view simply a pointer -- to a procedure taking a single 64bit parameter. However, this -- is a bit misleading, because the data that this pointer references is -- highly stylized. See body of System.AST_Handling for full details. type AST_Handler is access procedure (Param : Long_Integer); No_AST_Handler : constant AST_Handler := null; -- Other operators have incorrect profiles. It would be nice to make -- them intrinsic, since the backend can handle them, but the front -- end is not prepared to deal with them, so at least inline them. pragma Inline_Always ("+"); pragma Inline_Always ("-"); pragma Inline_Always ("not"); pragma Inline_Always ("and"); pragma Inline_Always ("or"); pragma Inline_Always ("xor"); -- Other inlined subprograms pragma Inline_Always (Fetch_From_Address); pragma Inline_Always (Assign_To_Address); -- Synchronization related subprograms. These are declared to have -- convention C so that the critical parameters are passed by reference. -- Without this, the parameters are passed by copy, creating load/store -- race conditions. We also inline them, since this seems more in the -- spirit of the original (hardware intrinsic) routines. pragma Convention (C, Clear_Interlocked); pragma Inline_Always (Clear_Interlocked); pragma Convention (C, Set_Interlocked); pragma Inline_Always (Set_Interlocked); pragma Convention (C, Add_Interlocked); pragma Inline_Always (Add_Interlocked); pragma Convention (C, Add_Atomic); pragma Inline_Always (Add_Atomic); pragma Convention (C, And_Atomic); pragma Inline_Always (And_Atomic); pragma Convention (C, Or_Atomic); pragma Inline_Always (Or_Atomic); -- Provide proper unchecked conversion definitions for transfer -- functions. Note that we need this level of indirection because -- the formal parameter name is X and not Source (and this is indeed -- detectable by a program) function To_Unsigned_Byte_A is new Unchecked_Conversion (Bit_Array_8, Unsigned_Byte); function To_Unsigned_Byte (X : Bit_Array_8) return Unsigned_Byte renames To_Unsigned_Byte_A; function To_Bit_Array_8_A is new Unchecked_Conversion (Unsigned_Byte, Bit_Array_8); function To_Bit_Array_8 (X : Unsigned_Byte) return Bit_Array_8 renames To_Bit_Array_8_A; function To_Unsigned_Word_A is new Unchecked_Conversion (Bit_Array_16, Unsigned_Word); function To_Unsigned_Word (X : Bit_Array_16) return Unsigned_Word renames To_Unsigned_Word_A; function To_Bit_Array_16_A is new Unchecked_Conversion (Unsigned_Word, Bit_Array_16); function To_Bit_Array_16 (X : Unsigned_Word) return Bit_Array_16 renames To_Bit_Array_16_A; function To_Unsigned_Longword_A is new Unchecked_Conversion (Bit_Array_32, Unsigned_Longword); function To_Unsigned_Longword (X : Bit_Array_32) return Unsigned_Longword renames To_Unsigned_Longword_A; function To_Bit_Array_32_A is new Unchecked_Conversion (Unsigned_Longword, Bit_Array_32); function To_Bit_Array_32 (X : Unsigned_Longword) return Bit_Array_32 renames To_Bit_Array_32_A; function To_Unsigned_32_A is new Unchecked_Conversion (Bit_Array_32, Unsigned_32); function To_Unsigned_32 (X : Bit_Array_32) return Unsigned_32 renames To_Unsigned_32_A; function To_Bit_Array_32_A is new Unchecked_Conversion (Unsigned_32, Bit_Array_32); function To_Bit_Array_32 (X : Unsigned_32) return Bit_Array_32 renames To_Bit_Array_32_A; function To_Unsigned_Quadword_A is new Unchecked_Conversion (Bit_Array_64, Unsigned_Quadword); function To_Unsigned_Quadword (X : Bit_Array_64) return Unsigned_Quadword renames To_Unsigned_Quadword_A; function To_Bit_Array_64_A is new Unchecked_Conversion (Unsigned_Quadword, Bit_Array_64); function To_Bit_Array_64 (X : Unsigned_Quadword) return Bit_Array_64 renames To_Bit_Array_64_A; pragma Warnings (Off); -- Turn warnings off. This is needed for systems with 64-bit integers, -- where some of these operations are of dubious meaning, but we do not -- want warnings when we compile on such systems. function To_Address_A is new Unchecked_Conversion (Integer, Address); pragma Pure_Function (To_Address_A); function To_Address (X : Integer) return Address renames To_Address_A; pragma Pure_Function (To_Address); function To_Address_Long_A is new Unchecked_Conversion (Unsigned_Longword, Address); pragma Pure_Function (To_Address_Long_A); function To_Address_Long (X : Unsigned_Longword) return Address renames To_Address_Long_A; pragma Pure_Function (To_Address_Long); function To_Integer_A is new Unchecked_Conversion (Address, Integer); function To_Integer (X : Address) return Integer renames To_Integer_A; function To_Unsigned_Longword_A is new Unchecked_Conversion (Address, Unsigned_Longword); function To_Unsigned_Longword (X : Address) return Unsigned_Longword renames To_Unsigned_Longword_A; function To_Unsigned_Longword_A is new Unchecked_Conversion (AST_Handler, Unsigned_Longword); function To_Unsigned_Longword (X : AST_Handler) return Unsigned_Longword renames To_Unsigned_Longword_A; pragma Warnings (On); end System.Aux_DEC;
data/events/bug_contest_winners.asm
zavytar/pokecolorless
0
23191
BugContestantPointers: ; there are NUM_BUG_CONTESTANTS + 1 entries dw BugContestant_BugCatcherDon ; this reverts back to the player dw BugContestant_BugCatcherDon dw BugContestant_BugCatcherEd dw BugContestant_CooltrainerMNick dw BugContestant_PokefanMWilliam dw BugContestant_BugCatcherBenny dw BugContestant_CamperBarry dw BugContestant_PicnickerCindy dw BugContestant_BugCatcherJosh dw BugContestant_YoungsterSamuel dw BugContestant_SchoolboyKipp ; contestant format: ; db class, id ; dbw 1st-place mon, score ; dbw 2nd-place mon, score ; dbw 3rd-place mon, score BugContestant_BugCatcherDon: db BUG_CATCHER, BUG_CATCHER_COLTON dbw KAKUNA, 300 dbw METAPOD, 285 dbw CATERPIE, 226 BugContestant_BugCatcherEd: db BUG_CATCHER, BUG_CATCHER_JAMES dbw BUTTERFREE, 286 dbw BUTTERFREE, 251 dbw CATERPIE, 237 BugContestant_CooltrainerMNick: db COOLTRAINERM, NICK dbw SCYTHER, 357 dbw BUTTERFREE, 349 dbw PINSIR, 368 BugContestant_PokefanMWilliam: db POKEFANM, WILLIAM dbw PINSIR, 332 dbw BUTTERFREE, 324 dbw VENONAT, 321 BugContestant_BugCatcherBenny: db BUG_CATCHER, BUG_CATCHER_SAMMY dbw BUTTERFREE, 318 dbw WEEDLE, 295 dbw CATERPIE, 285 BugContestant_CamperBarry: db CAMPER, CAMPER_JERRY dbw PINSIR, 366 dbw VENONAT, 329 dbw KAKUNA, 314 BugContestant_PicnickerCindy: db PICNICKER, CINDY dbw BUTTERFREE, 341 dbw METAPOD, 301 dbw CATERPIE, 264 BugContestant_BugCatcherJosh: db TEACHER, TEACHER_COLETTE dbw SCYTHER, 326 dbw BUTTERFREE, 292 dbw METAPOD, 282 BugContestant_YoungsterSamuel: db YOUNGSTER, YOUNGSTER_BEN dbw WEEDLE, 270 dbw PINSIR, 282 dbw CATERPIE, 251 BugContestant_SchoolboyKipp: db SCHOOLBOY, KIPP dbw VENONAT, 267 dbw PARAS, 254 dbw KAKUNA, 259
regtests/util-events-channels-tests.adb
Letractively/ada-util
60
9153
----------------------------------------------------------------------- -- events.tests -- Unit tests for event channels -- Copyright (C) 2009, 2010, 2011 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Unchecked_Deallocation; with Util.Test_Caller; package body Util.Events.Channels.Tests is use Util.Tests; package Caller is new Util.Test_Caller (Test, "Events.Channels"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test Util.Events.Channels.Post_Event", Test_Post_Event'Access); end Add_Tests; procedure Receive_Event (Sub : in out Test; Item : in Event'Class) is pragma Unreferenced (Item); begin Sub.Count := Sub.Count + 1; end Receive_Event; procedure Test_Post_Event (T : in out Test) is procedure Free is new Ada.Unchecked_Deallocation (Object => Channel'Class, Name => Channel_Access); C : Channel_Access := Create ("test", "direct"); E : Event; T1 : aliased Test; T2 : aliased Test; begin C.Post (E); Assert_Equals (T, "test", C.Get_Name, "Invalid channel name"); C.Subscribe (T1'Unchecked_Access); C.Post (E); Assert_Equals (T, 1, T1.Count, "Invalid number of received events"); Assert_Equals (T, 0, T2.Count, "Invalid number of events"); C.Subscribe (T2'Unchecked_Access); C.Post (E); C.Unsubscribe (T1'Unchecked_Access); C.Post (E); Assert_Equals (T, 2, T1.Count, "Invalid number of received events"); Assert_Equals (T, 2, T2.Count, "Invalid number of events"); Free (C); end Test_Post_Event; end Util.Events.Channels.Tests;
Modules/PolynomialModule.agda
Smaug123/agdaproofs
4
3407
<filename>Modules/PolynomialModule.agda {-# OPTIONS --safe --warning=error --without-K #-} open import Sets.EquivalenceRelations open import LogicalFormulae open import Setoids.Setoids open import Rings.Definition open import Modules.Definition open import Numbers.Naturals.Semiring open import Numbers.Naturals.Order open import Lists.Lists open import Vectors open import Groups.Definition open import Orders.Total.Definition open import Groups.Homomorphisms.Definition open import Groups.Homomorphisms.Lemmas open import Rings.Homomorphisms.Definition module Modules.PolynomialModule {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_+_ _*_ : A → A → A} (R : Ring S _+_ _*_) where open Ring R open import Groups.Polynomials.Definition additiveGroup open import Groups.Polynomials.Group additiveGroup open import Rings.Polynomial.Multiplication R open import Rings.Polynomial.Evaluation R open import Rings.Polynomial.Ring R open import Rings.Lemmas polyRing polynomialRingModule : Module R abelianUnderlyingGroup (λ a b → _*P_ (polyInjection a) b) Module.dotWellDefined (polynomialRingModule) r=s t=u = Ring.*WellDefined polyRing (r=s ,, record {}) t=u Module.dotDistributesLeft (polynomialRingModule) {r} {s} {t} = Ring.*DistributesOver+ polyRing {polyInjection r} {s} {t} Module.dotDistributesRight (polynomialRingModule) {r} {s} {t} = Ring.*DistributesOver+' polyRing {polyInjection r} {polyInjection s} {t} Module.dotAssociative (polynomialRingModule) {r} {s} {t} = Equivalence.transitive (Setoid.eq naivePolySetoid) (Ring.*WellDefined polyRing m (Equivalence.reflexive (Setoid.eq naivePolySetoid) {t})) (Equivalence.symmetric (Setoid.eq naivePolySetoid) (Ring.*Associative polyRing {polyInjection r} {polyInjection s} {t})) where m : Setoid._∼_ naivePolySetoid ((r * s) :: []) ((r * s) :: (([] +P []) +P (0R :: []))) m = Equivalence.reflexive (Setoid.eq S) ,, (Equivalence.reflexive (Setoid.eq S) ,, record {}) Module.dotIdentity (polynomialRingModule) = Ring.identIsIdent polyRing open import Modules.Span polynomialRingModule polynomialBasis : ℕ → NaivePoly polynomialBasis zero = polyInjection 1R polynomialBasis (succ a) = 0R :: polynomialBasis a count : (n : ℕ) → Vec ℕ n count zero = [] count (succ n) = 0 ,- vecMap succ (count n) lemma : {d : _} {D : Set d} → (f : D → List A) → {n : ℕ} → (m : Vec D n) (r : Vec A n) → Setoid._∼_ naivePolySetoid (dot (vecMap (λ i → 0R :: f i) m) r) (0R :: dot (vecMap f m) r) lemma f [] [] = reflexive ,, record {} where open Setoid S open Equivalence eq lemma f (m ,- ms) (r ,- rs) rewrite refl {x = 0} = transitive (+WellDefined {(r * 0R) :: (((map (_*_ r) (f m)) +P []) +P (0R :: []))} {_} {(r * 0R) :: (((map (_*_ r) (f m)) +P []) +P (0R :: []))} (reflexive {(r * 0R) :: (((map (_*_ r) (f m)) +P []) +P (0R :: []))}) (lemma f ms rs)) (Equivalence.transitive (Setoid.eq S) (Group.identRight additiveGroup) (Ring.timesZero R) ,, +WellDefined {((map (_*_ r) (f m)) +P []) +P (0R :: [])} {dot (vecMap f ms) rs} {(r :: []) *P f m} {dot (vecMap f ms) rs} t (reflexive {dot (vecMap f ms) rs})) where open Setoid naivePolySetoid open Equivalence eq open Group polyGroup lemm : (v : List A) → polysEqual (map (_*_ r) v) ((r :: []) *P v) lemm [] = record {} lemm (x :: v) = Equivalence.reflexive (Setoid.eq S) ,, symmetric (transitive (+WellDefined {map (_*_ r) v +P []} {0R :: []} {_} {[]} reflexive (Equivalence.reflexive (Setoid.eq S) ,, record {})) (transitive (identRight {(map (_*_ r) v) +P []}) (identRight {map (_*_ r) v}))) t : ((map (_*_ r) (f m) +P []) +P (0R :: [])) ∼ ((r :: []) *P f m) t = transitive (+WellDefined {map (_*_ r) (f m) +P []} {0R :: []} {_} {[]} reflexive (Equivalence.reflexive (Setoid.eq S) ,, record {})) (transitive (identRight {map (_*_ r) (f m) +P []}) (transitive (identRight {map (_*_ r) (f m)}) (lemm (f m)))) identityMap : (v : List A) → Setoid._∼_ naivePolySetoid (dot (vecMap polynomialBasis (count (length v))) (listToVec v)) v identityMap [] = record {} identityMap (x :: v) rewrite vecMapCompose succ polynomialBasis (count (length v)) = transitive (+WellDefined {(x * 1R) :: Group.0G additiveGroup :: []} {dot (vecMap (λ i → Group.0G additiveGroup :: polynomialBasis i) (count (length v))) (listToVec v)} {(x * 1R) :: 0R :: []} {0R :: dot (vecMap polynomialBasis (count (length v))) (listToVec v)} (reflexive {(x * 1R) :: 0R :: []}) (lemma polynomialBasis (count (length v)) (listToVec v))) (Equivalence.transitive (Setoid.eq S) (Group.identRight additiveGroup) (Equivalence.transitive (Setoid.eq S) *Commutative identIsIdent) ,, transitive (+WellDefined {0R :: []} {dot (vecMap polynomialBasis (count (length v))) (listToVec v)} {[]} (Equivalence.reflexive (Setoid.eq S) ,, record {}) reflexive) (transitive identLeft (identityMap v))) where open Group polyGroup open Setoid naivePolySetoid open Equivalence eq polynomialBasisSpans : Spans polynomialBasis polynomialBasisSpans m = length m , ((count (length m) ,, listToVec m) , identityMap m) {- private indepWithZero : {n : ℕ} (rs : Vec ℕ n) (indicesDistinct : {a b : ℕ} → (a<n : a <N succ n) (b<n : b <N succ n) → vecIndex (0 ,- rs) a a<n ≡ vecIndex (0 ,- rs) b b<n → a ≡ b) (b : A) (bs : Vec A n) (dotZero : Setoid._∼_ naivePolySetoid (((b * 1R) :: 0R :: []) +P (dot (vecMap polynomialBasis rs) bs)) []) → (nonzero : {a : ℕ} → (a<n : a <N n) → 0 <N vecIndex rs a a<n) → Setoid._∼_ S 0R b && _=V_ additiveGroup (vecPure 0R) bs indepWithZero rs indicesDistinct b bs dotZero indicesNonzero = symmetric b=0 ,, {!!} where open Setoid S open Equivalence eq open Group additiveGroup t : (inducedFunction (((b * 1R) :: 0R :: []) +P (dot (vecMap polynomialBasis rs) bs)) 0R) ∼ 0R t = inducedFunctionWellDefined dotZero 0R u : ((inducedFunction ((b * 1R) :: 0R :: []) 0R) + inducedFunction (dot (vecMap polynomialBasis rs) bs) 0R) ∼ 0R u = transitive (symmetric (GroupHom.groupHom (RingHom.groupHom (inducedFunctionIsHom 0R)) {((b * 1R) :: 0R :: [])} {dot (vecMap polynomialBasis rs) bs})) t b=0 : b ∼ 0R b=0 = transitive (symmetric (transitive (+WellDefined (transitive (transitive (transitive (+WellDefined reflexive (transitive *Commutative timesZero)) identRight) *Commutative) identIsIdent) {!imageOfIdentityIsIdentity (RingHom.groupHom (inducedFunctionIsHom 0R))!}) (identRight {b}))) u polynomialBasisIndependent : Independent polynomialBasis polynomialBasisIndependent [] indicesDistinct [] dotZero = record {} polynomialBasisIndependent {succ n} (zero ,- rs) indicesDistinct (b ,- bs) dotZero = indepWithZero rs indicesDistinct b bs dotZero t where t : {a : ℕ} (a<n : a <N n) → 0 <N vecIndex rs a a<n t {a} a<n with TotalOrder.totality ℕTotalOrder 0 (vecIndex rs a a<n) t {a} a<n | inl (inl x) = x t {a} a<n | inr x with indicesDistinct {succ a} {0} (succPreservesInequality a<n) (succIsPositive n) (equalityCommutative x) ... | () polynomialBasisIndependent (succ r ,- rs) indicesDistinct (b ,- bs) dotZero = {!!} where rearr : {!!} rearr = {!!} -}
oeis/073/A073010.asm
neoneye/loda-programs
11
10822
; A073010: Decimal expansion of Pi/sqrt(27). ; Submitted by <NAME> ; 6,0,4,5,9,9,7,8,8,0,7,8,0,7,2,6,1,6,8,6,4,6,9,2,7,5,2,5,4,7,3,8,5,2,4,4,0,9,4,6,8,8,7,4,9,3,6,4,2,4,6,8,5,8,5,2,3,2,9,4,9,7,8,4,6,2,7,0,7,7,2,7,0,4,2,1,1,7,9,6,1,2,2,8,0,4,1,6,6,2,7,3,7,3,5,3,3,8,9,6 mov $1,1 mov $2,1 mov $3,$0 mul $3,5 lpb $3 mul $1,$3 mov $5,$3 mul $5,4 add $5,2 mul $2,$5 add $1,$2 div $5,$2 add $5,$0 div $1,$5 div $2,$5 sub $3,1 lpe mul $1,10 mov $4,10 pow $4,$0 div $2,$4 mul $2,2 div $1,$2 add $1,$4 mov $0,$1 mod $0,10
alloy4fun_models/trashltl/models/17/CpCCNcyeL5DXeRRkG.als
Kaixi26/org.alloytools.alloy
0
1535
open main pred idCpCCNcyeL5DXeRRkG_prop18 { all p:Protected | p in File - Protected implies p in Trash } pred __repair { idCpCCNcyeL5DXeRRkG_prop18 } check __repair { idCpCCNcyeL5DXeRRkG_prop18 <=> prop18o }
programs/oeis/246/A246767.asm
karttu/loda
1
172158
<gh_stars>1-10 ; A246767: n^4 - 2n. ; 0,-1,12,75,248,615,1284,2387,4080,6543,9980,14619,20712,28535,38388,50595,65504,83487,104940,130283,159960,194439,234212,279795,331728,390575,456924,531387,614600,707223,809940,923459,1048512,1185855,1336268,1500555,1679544,1874087,2085060 mov $1,$0 mul $0,2 pow $1,4 sub $1,$0
oeis/234/A234133.asm
neoneye/loda-programs
11
173574
; A234133: Number of (n+1) X (1+1) 0..3 arrays with every 2 X 2 subblock having the sum of the absolute values of all six edge and diagonal differences equal to 9. ; Submitted by <NAME> ; 32,80,192,512,1280,3584,9216,26624,69632,204800,540672,1605632,4259840,12713984,33816576,101187584,269484032,807403520,2151677952,6450839552,17196646400,51573161984,137506062336,412451078144,1099780063232,3299071754240,8797166764032,26390426550272,70373039144960,211114822467584,562967133290496,1688884220002304,4503668346847232,13510936321064960,36029071896870912,108086940812705792,288231475663339520,864693327478390784,2305847407260205056,6917537823734104064,18446761665895596032 mov $1,2 pow $1,$0 seq $0,96886 ; Expansion of (1+3*x)/(1-8*x^2). add $0,$1 mul $0,16
programs/oeis/140/A140724.asm
karttu/loda
0
165253
<gh_stars>0 ; A140724: Period 10: 1, 5, 9, 7, 7, 9, 5, 1, 3, 3 repeated. ; 1,5,9,7,7,9,5,1,3,3,1,5,9,7,7,9,5,1,3,3,1,5,9,7,7,9,5,1,3,3,1,5,9,7,7,9,5,1,3,3,1,5,9,7,7,9,5,1,3,3,1,5,9,7,7,9,5,1,3,3,1,5,9,7,7,9,5,1,3,3,1,5,9,7,7,9,5,1,3,3,1,5,9,7,7,9,5,1,3,3,1,5,9,7,7,9,5,1,3,3,1,5,9,7,7 add $0,1 mov $1,1 lpb $0,1 sub $0,1 mod $1,15 mov $2,$1 add $1,$0 mul $1,3 add $1,$2 lpe div $1,12 mul $1,2 add $1,1
src/SlimShader.Tests/Shaders/Sdk/Direct3D11/NBodyGravityCS11/NBodyGravityCS11.asm
tgjones/slimshader
125
100262
<reponame>tgjones/slimshader // // Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20714 // // /// // Buffer Definitions: // // cbuffer cbCS // { // // uint4 g_param; // Offset: 0 Size: 16 // float4 g_paramf; // Offset: 16 Size: 16 // // } // // Resource bind info for oldPosVelo // { // // struct // { // // float4 pos; // Offset: 0 // float4 velo; // Offset: 16 // // } $Element; // Offset: 0 Size: 32 // // } // // Resource bind info for newPosVelo // { // // struct // { // // float4 pos; // Offset: 0 // float4 velo; // Offset: 16 // // } $Element; // Offset: 0 Size: 32 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // oldPosVelo texture struct r/o 0 1 // newPosVelo UAV struct r/w 0 1 // cbCS cbuffer NA NA 0 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // no Input // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // no Output cs_4_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb0[2], immediateIndexed dcl_resource_structured t0, 32 dcl_uav_structured u0, 32 dcl_input vThreadIDInGroupFlattened dcl_input vThreadID.x dcl_temps 4 dcl_tgsm_structured g0, 16, 128 dcl_thread_group 128, 1, 1 ld_structured r0.xyzw, vThreadID.x, l(0), t0.xyzw mov r1.xyzw, l(0,0,0,0) loop uge r2.x, r1.w, cb0[0].y breakc_nz r2.x ishl r2.x, r1.w, l(7) iadd r2.x, r2.x, vThreadIDInGroupFlattened.x ld_structured r2.xyz, r2.x, l(0), t0.xyzx store_structured g0.xyz, vThreadIDInGroupFlattened.x, l(0), r2.xyzx sync_g_t ld_structured r2.xyz, l(0), l(0), g0.xyzx add r2.xyz, -r0.xyzx, r2.xyzx dp3 r2.w, r2.xyzx, r2.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.x, r2.w, r2.w mul r2.w, r2.w, r3.x mul r2.w, r2.w, l(66.730003) mad r2.xyz, r2.xyzx, r2.wwww, r1.xyzx ld_structured r3.xyz, l(1), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(2), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(3), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(4), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(5), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(6), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(7), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(8), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(9), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(10), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(11), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(12), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(13), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(14), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(15), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(16), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(17), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(18), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(19), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(20), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(21), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(22), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(23), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(24), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(25), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(26), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(27), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(28), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(29), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(30), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(31), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(32), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(33), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(34), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(35), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(36), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(37), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(38), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(39), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(40), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(41), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(42), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(43), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(44), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(45), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(46), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(47), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(48), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(49), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(50), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(51), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(52), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(53), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(54), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(55), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(56), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(57), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(58), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(59), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(60), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(61), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(62), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(63), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(64), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(65), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(66), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(67), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(68), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(69), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(70), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(71), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(72), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(73), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(74), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(75), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(76), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(77), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(78), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(79), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(80), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(81), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(82), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(83), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(84), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(85), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(86), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(87), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(88), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(89), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(90), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(91), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(92), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(93), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(94), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(95), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(96), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(97), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(98), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(99), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(100), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(101), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(102), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(103), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(104), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(105), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(106), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(107), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(108), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(109), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(110), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(111), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(112), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(113), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(114), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(115), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(116), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(117), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(118), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(119), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(120), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(121), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(122), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(123), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(124), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(125), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(126), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r2.xyz, r3.xyzx, r2.wwww, r2.xyzx ld_structured r3.xyz, l(127), l(0), g0.xyzx add r3.xyz, -r0.xyzx, r3.xyzx dp3 r2.w, r3.xyzx, r3.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.w, r2.w, r2.w mul r2.w, r2.w, r3.w mul r2.w, r2.w, l(66.730003) mad r1.xyz, r3.xyzx, r2.wwww, r2.xyzx sync_g_t iadd r1.w, r1.w, l(1) endloop ult r1.w, vThreadID.x, cb0[0].x if_nz r1.w ld_structured r2.xyz, vThreadID.x, l(16), t0.xyzx ishl r1.w, cb0[0].y, l(7) iadd r1.w, -r1.w, cb0[0].x dp3 r2.w, -r0.xyzx, -r0.xyzx add r2.w, r2.w, l(0.000002) sqrt r2.w, r2.w div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w mul r3.x, r2.w, r2.w mul r2.w, r2.w, r3.x mul r2.w, r2.w, l(66.730003) itof r1.w, r1.w mul r1.w, r1.w, r2.w mad r1.xyz, -r0.xyzx, r1.wwww, r1.xyzx mad r2.xyz, r1.xyzx, cb0[1].xxxx, r2.xyzx mul r2.xyz, r2.xyzx, cb0[1].yyyy mad r0.xyz, r2.xyzx, cb0[1].xxxx, r0.xyzx store_structured u0.xyzw, vThreadID.x, l(0), r0.xyzw dp3 r0.x, r1.xyzx, r1.xyzx sqrt r2.w, r0.x store_structured u0.xyzw, vThreadID.x, l(16), r2.xyzw endif ret // Approximately 1317 instruction slots used
programs/oeis/158/A158479.asm
neoneye/loda
22
81468
<gh_stars>10-100 ; A158479: 36n^2 + 6. ; 42,150,330,582,906,1302,1770,2310,2922,3606,4362,5190,6090,7062,8106,9222,10410,11670,13002,14406,15882,17430,19050,20742,22506,24342,26250,28230,30282,32406,34602,36870,39210,41622,44106,46662,49290,51990,54762,57606,60522,63510,66570,69702,72906,76182,79530,82950,86442,90006,93642,97350,101130,104982,108906,112902,116970,121110,125322,129606,133962,138390,142890,147462,152106,156822,161610,166470,171402,176406,181482,186630,191850,197142,202506,207942,213450,219030,224682,230406,236202,242070,248010,254022,260106,266262,272490,278790,285162,291606,298122,304710,311370,318102,324906,331782,338730,345750,352842,360006 mov $1,2 add $1,$0 mul $1,$0 mul $1,36 add $1,42 mov $0,$1
POSL.g4
jtejido/athena
0
5481
grammar POSL; // Currently a rulebase is defined as 0 or more clauses followed by an end of file charater // This will likely be expanded in the future to allow for modules rulebase: clause; // A clause is one atom (the head), optionally followed by the separator (:-) and a list // of one or more atoms for the body of a rule, followed by a period to end the clause. clause: atom (':-' atoms)? '.'; // Defines a list of 1 or more atom - this is 1 atom followed by 0 or more // repeats of a comma and atom. atoms: atom (',' atom) *; // This defines an atom - this is a relation name, followed by a "(", an optional oid // and an optional parameter list (positional/slotted combination) and a closing ")". atom: rel '(' ((oid)? |) (ps)? ')'; // This is the definition of a slotted/positional argument list combination. // There are several options that describe all valid combinations; the most // common forms would be the first option and the second option (with 2nd sub-case). ps: // In this case the parameter list starts with 1 or more positional terms // this can optionally be followed by a positional rest parameter, // slotted parameters (separated by a semi-colon (;)), and/or a // slotted rest parameter pos (prest)? (';' slots)? (srest)? // In this case the parameter list starts with 1 or more slotted parameters // there are two sub cases for this rule | slots ( // The first sub-case handles when there are no positional parameters; // there can optionally be a positional rest (and then optionally more // slotted parameters) followed by an optional slotted rest parameter. (prest (';' slots)?)? (srest)? // The second sub-case handles when tere are positional parameters; // first there is a semi-colon then one or more positional parameters, // optionally followed by a positional rest parameter, more slotted // parameters, and/or a slotted rest parameter | ';' pos (prest)? (';' slots)? (srest)? ) // In this case the parameter list starts witha positional rest parameter // It can optionally be followed by slotted parameters and a slotted rest | prest (';' slots)? (srest)? // The final case is having just a slotted rest parameter | srest ; // This is an oid; which is defined as a term followed by the (^) symbol. // This may be expanded in the future to allow for multiple oids. // While any term can be used, typically inds, variables, or skolems are used oid: term '^'; // This is a positional rest term - this is a (|) symbol followed by // a variable, or a plex that only has positional arguments prest: '|' (variable | posplex); // This is a slotted rest term - this is a (!) symbol by // a variable, or a plex that only has slotted arguments srest: '!' (variable | slotplex); // This is a sepcial version of plex that only allows positional terms (this is // used for the definition of a positional rest). posplex: '[' (pos)? (prest)? ']'; // This is a special version of plex that only allows slotted terms (this is used // for the definition of slotted rest). slotplex: '[' (slots)? (srest)? ']'; // Defines a list of 1 or more positional parameters - this is 1 term followed by 0 // or more repeats of a comma and term. pos: term (',' term) *; // Defines a list of 1 or more slotted parameters - this is 1 slot followed by 0 // or more repeats of a semi-colon and slot. slots: slot (';' slot) *; // A slot is defined as being a role name, followed by an (->) symbol // and any term slot: role '->' term; // A term can be either an ind, var, cterm, skolem, or plex term: ind | variable | cterm | skolem | plex ; cterm: ctor '[' (ps)? ']' (':' token_type)?; plex: '[' (ps)? ']'; ctor: symbol; rel: symbol; role: symbol; token_type: symbol; ind: (symbol (uri)? | uri) (':' token_type)?; skolem: '_' (symbol)? (':' token_type)?; variable: '?' (symbol)? (':' token_type)?; symbol: SYMBOL | QSYMBOL; uri: URI; URI: '<' ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|':'|'/'|'.'|'?'|'&'|'%'|'#'|'-')+ '>'; // this should be replaced with a better URI definition so that it meets the IETF // standards for URI naming SYMBOL: ('-')? ('a'..'z'|'A'..'Z'|'0'..'9'|'$') ('a'..'z'|'A'..'Z'|'0'..'9'|'_'|'.'|'$')*; QSYMBOL: '"' (~('"'))* '"'; // For single‑line comments COMMENT : '%' ~[\n\r]* ( [\n\r] | EOF) -> skip ; // Multi line comments follows Prolog, and thus, C-style comment delimiters /* .... */ MLCOMMENT : '/*' ( MLCOMMENT | . )*? ('*/' | EOF) -> skip ; WS : [ \t\r\n\u000C]+ -> skip ;
boards/stm32_common/dma2d/stm32-dma2d_bitmap.ads
rocher/Ada_Drivers_Library
192
25138
<reponame>rocher/Ada_Drivers_Library<gh_stars>100-1000 ------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-2016, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- Take advantage of the DMA2D to accelerate some graphical operations on -- bitmap surfaces with System; with HAL.Bitmap; use HAL.Bitmap; with STM32.DMA2D; with Memory_Mapped_Bitmap; use Memory_Mapped_Bitmap; package STM32.DMA2D_Bitmap is subtype Parent is Memory_Mapped_Bitmap_Buffer; type DMA2D_Bitmap_Buffer is new Parent with null record; type Any_DMA2D_Bitmap_Buffer is access all DMA2D_Bitmap_Buffer'Class; overriding procedure Set_Pixel (Buffer : in out DMA2D_Bitmap_Buffer; Pt : Point); overriding procedure Set_Pixel_Blend (Buffer : in out DMA2D_Bitmap_Buffer; Pt : Point); overriding function Pixel (Buffer : DMA2D_Bitmap_Buffer; Pt : Point) return Bitmap_Color; overriding procedure Fill (Buffer : in out DMA2D_Bitmap_Buffer); overriding procedure Fill_Rect (Buffer : in out DMA2D_Bitmap_Buffer; Area : Rect); overriding procedure Copy_Rect (Src_Buffer : HAL.Bitmap.Bitmap_Buffer'Class; Src_Pt : Point; Dst_Buffer : in out DMA2D_Bitmap_Buffer; Dst_Pt : Point; Bg_Buffer : HAL.Bitmap.Bitmap_Buffer'Class; Bg_Pt : Point; Width : Natural; Height : Natural; Synchronous : Boolean) with Pre => Dst_Buffer.Color_Mode in HAL.Bitmap.ARGB_8888 .. HAL.Bitmap.ARGB_4444; overriding procedure Copy_Rect (Src_Buffer : Bitmap_Buffer'Class; Src_Pt : Point; Dst_Buffer : in out DMA2D_Bitmap_Buffer; Dst_Pt : Point; Width : Natural; Height : Natural; Synchronous : Boolean) with Pre => Dst_Buffer.Color_Mode in HAL.Bitmap.ARGB_8888 .. HAL.Bitmap.ARGB_4444; procedure Wait_Transfer (Buffer : DMA2D_Bitmap_Buffer); -- Makes sure the DMA2D transfers are done Null_Buffer : constant DMA2D_Bitmap_Buffer := (Addr => System.Null_Address, Actual_Width => 0, Actual_Height => 0, Actual_Color_Mode => HAL.Bitmap.L_8, Currently_Swapped => False, Native_Source => 0); function To_DMA2D_Buffer (Buffer : HAL.Bitmap.Bitmap_Buffer'Class) return STM32.DMA2D.DMA2D_Buffer with Inline, Pre => Buffer.Mapped_In_RAM; end STM32.DMA2D_Bitmap;
mc-sema/validator/x86/tests/FPREM.asm
randolphwong/mcsema
2
100321
BITS 32 ;TEST_FILE_META_BEGIN ;TEST_TYPE=TEST_F ;TEST_IGNOREFLAGS= ;TEST_FILE_META_END ;TEST_BEGIN_RECORDING lea edi, [esp-0xc] mov word [edi], 0x2 FILD word [edi] mov word [edi], 0x5 FILD word [edi] ; get remainder of 5/2 FPREM mov edi, 0 ;TEST_END_RECORDING
orka/src/gl/implementation/gl-blending.adb
onox/orka
52
3877
<filename>orka/src/gl/implementation/gl-blending.adb -- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2013 <NAME> <<EMAIL>> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. with GL.API; with GL.Enums.Getter; package body GL.Blending is procedure Set_Blend_Func (Factors : Blend_Factors) is begin API.Blend_Func_Separate.Ref (Factors.Src_RGB, Factors.Dst_RGB, Factors.Src_Alpha, Factors.Dst_Alpha); end Set_Blend_Func; procedure Set_Blend_Func (Draw_Buffer : Buffers.Draw_Buffer_Index; Factors : Blend_Factors) is begin API.Blend_Func_Separate_I.Ref (Draw_Buffer, Factors.Src_RGB, Factors.Dst_RGB, Factors.Src_Alpha, Factors.Dst_Alpha); end Set_Blend_Func; function Blend_Func return Blend_Factors is Src_RGB, Src_Alpha : Blend_Factor := One; Dst_RGB, Dst_Alpha : Blend_Factor := Zero; begin API.Get_Blend_Factor.Ref (Enums.Getter.Blend_Src_RGB, Src_RGB); API.Get_Blend_Factor.Ref (Enums.Getter.Blend_Src_Alpha, Src_Alpha); API.Get_Blend_Factor.Ref (Enums.Getter.Blend_Dst_RGB, Dst_RGB); API.Get_Blend_Factor.Ref (Enums.Getter.Blend_Dst_Alpha, Dst_Alpha); return (Src_RGB, Dst_RGB, Src_Alpha, Dst_Alpha); end Blend_Func; procedure Set_Blend_Color (Value : Types.Colors.Color) is use Types.Colors; begin API.Blend_Color.Ref (Value (R), Value (G), Value (B), Value (A)); end Set_Blend_Color; function Blend_Color return Types.Colors.Color is Ret : Types.Colors.Color; begin API.Get_Color.Ref (Enums.Getter.Blend_Color, Ret); return Ret; end Blend_Color; procedure Set_Blend_Equation (Equations : Blend_Equations) is begin API.Blend_Equation_Separate.Ref (Equations.RGB, Equations.Alpha); end Set_Blend_Equation; procedure Set_Blend_Equation (Draw_Buffer : Buffers.Draw_Buffer_Index; Equations : Blend_Equations) is begin API.Blend_Equation_Separate_I.Ref (Draw_Buffer, Equations.RGB, Equations.Alpha); end Set_Blend_Equation; function Blend_Equation return Blend_Equations is RGB, Alpha : Equation := Equation'First; begin API.Get_Blend_Equation.Ref (Enums.Getter.Blend_Equation_RGB, RGB); API.Get_Blend_Equation.Ref (Enums.Getter.Blend_Equation_Alpha, Alpha); return (RGB, Alpha); end Blend_Equation; ----------------------------------------------------------------------------- procedure Set_Logic_Op_Mode (Value : Logic_Op) is begin API.Logic_Op.Ref (Value); end Set_Logic_Op_Mode; function Logic_Op_Mode return Logic_Op is Ret : Logic_Op := Logic_Op'First; begin API.Get_Logic_Op.Ref (Enums.Getter.Logic_Op_Mode, Ret); return Ret; end Logic_Op_Mode; end GL.Blending;
list-test.agda
rfindler/ial
29
5651
module list-test where open import bool open import list open import nat open import list-to-string open import bool-to-string open import eq test1 : 𝕃 𝔹 test1 = tt :: tt :: tt :: [] test2 : 𝕃 𝔹 test2 = ff :: ff :: [] test3 = test1 ++ test2 test-lem : test3 ≡ tt :: tt :: tt :: ff :: ff :: [] test-lem = refl test-lem2 : reverse test3 ≡ ff :: ff :: tt :: tt :: tt :: [] test-lem2 = refl test3-string = 𝕃-to-string 𝔹-to-string ", " test3 test4-even = filter is-even (1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: [])
llvm-gcc-4.2-2.9/gcc/ada/a-cgcaso.adb
vidkidz/crossbridge
1
13123
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- A D A . C O N T A I N E R S . -- -- G E N E R I C _ C O N S T R A I N E D _ A R R A Y _ S O R T -- -- -- -- B o d y -- -- -- -- Copyright (C) 2004-2006, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- This unit has originally being developed by <NAME>. -- ------------------------------------------------------------------------------ -- This algorithm was adapted from GNAT.Heap_Sort_G (see g-hesorg.ad[sb]). with System; procedure Ada.Containers.Generic_Constrained_Array_Sort (Container : in out Array_Type) is type T is range System.Min_Int .. System.Max_Int; function To_Index (J : T) return Index_Type; pragma Inline (To_Index); procedure Sift (S : T); A : Array_Type renames Container; -------------- -- To_Index -- -------------- function To_Index (J : T) return Index_Type is K : constant T'Base := Index_Type'Pos (A'First) + J - T'(1); begin return Index_Type'Val (K); end To_Index; Max : T := A'Length; Temp : Element_Type; ---------- -- Sift -- ---------- procedure Sift (S : T) is C : T := S; Son : T; begin loop Son := 2 * C; exit when Son > Max; declare Son_Index : Index_Type := To_Index (Son); begin if Son < Max then if A (Son_Index) < A (Index_Type'Succ (Son_Index)) then Son := Son + 1; Son_Index := Index_Type'Succ (Son_Index); end if; end if; A (To_Index (C)) := A (Son_Index); -- Move (Son, C); end; C := Son; end loop; while C /= S loop declare Father : constant T := C / 2; Father_Elem : Element_Type renames A (To_Index (Father)); begin if Father_Elem < Temp then -- Lt (Father, 0) A (To_Index (C)) := Father_Elem; -- Move (Father, C) C := Father; else exit; end if; end; end loop; A (To_Index (C)) := Temp; -- Move (0, C); end Sift; -- Start of processing for Generic_Constrained_Array_Sort begin for J in reverse 1 .. Max / 2 loop Temp := Container (To_Index (J)); -- Move (J, 0); Sift (J); end loop; while Max > 1 loop declare Max_Elem : Element_Type renames A (To_Index (Max)); begin Temp := Max_Elem; -- Move (Max, 0); Max_Elem := A (A'First); -- Move (1, Max); end; Max := Max - 1; Sift (1); end loop; end Ada.Containers.Generic_Constrained_Array_Sort;
test/Succeed/PostponedUnification.agda
redfish64/autonomic-agda
1
12918
<reponame>redfish64/autonomic-agda {- This example test that the order in which unification constraints are generated doesn't matter. The pattern matching in foo generates the unification problem [x, zero] = [n + m, n] with n and m flexible. The first equation can only be solved after the second one has been solved. For completeness we check that the other way around also works. -} module PostponedUnification where data Nat : Set where zero : Nat suc : Nat -> Nat _+_ : Nat -> Nat -> Nat zero + m = m suc n + m = suc (n + m) data T : Nat -> Nat -> Set where t : (x : Nat) -> T x zero foo : (n m : Nat) -> T (n + m) n -> Set foo ._ ._ (t x) = Nat data U : Nat -> Nat -> Set where u : (x : Nat) -> U zero x bar : (n m : Nat) -> U n (n + m) -> Set bar ._ ._ (u x) = Nat
Library/Mailbox/Outbox/outboxFeedbackGlyph.asm
steakknife/pcgeos
504
4240
<gh_stars>100-1000 COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1995 -- All Rights Reserved PROJECT: MODULE: FILE: outboxFeedbackGlyph.asm AUTHOR: <NAME>, Sep 5, 1995 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Adam 9/ 5/95 Initial revision DESCRIPTION: Implementation of OutboxFeedbackGlyph $Id: outboxFeedbackGlyph.asm,v 1.1 97/04/05 01:21:49 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ if _OUTBOX_FEEDBACK MailboxClassStructures segment OutboxFeedbackGlyphClass MailboxClassStructures ends OFG_FRAME_WIDTH equ 99 OFG_FRAME_HEIGHT equ 90 OFG_GLOBE_X equ 24 OFG_GLOBE_Y equ 33 OFG_FRAME_DELAY equ 10 OFGFrameDesc struct OFGFD_globe word OFGFD_letter word OFGFD_letterX word OFGFD_letterY word OFGFrameDesc ends OutboxUICode segment resource ofgFrames OFGFrameDesc \ <Globe10Bitmap, Letter1Bitmap, 21, 77>, <Globe9Bitmap, Letter1Bitmap, 2, 66>, <Globe8Bitmap, Letter2Bitmap, 0, 41>, <Globe7Bitmap, Letter2Bitmap, 15, 16>, <Globe6Bitmap, Letter2Bitmap, 43, 9>, <Globe5Bitmap, Letter2Bitmap, 69, 20>, <Globe4Bitmap, Letter1Bitmap, 85, 39>, <Globe3Bitmap, Letter1Bitmap, 80, 55>, <Globe2Bitmap, 0, 0, 0>, <Globe1Bitmap, 0, 0, 0> COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OFGVisRecalcSize %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Return how big we want to be CALLED BY: MSG_VIS_RECALC_SIZE PASS: *ds:si = OutboxFeedbackGlyph object ds:di = OutboxFeedbackGlyphInstance cx = RecalcSizeArgs for width dx = RecalcSizeArgs for height RETURN: cx = width dx = height DESTROYED: ax, bp SIDE EFFECTS: none PSEUDO CODE/STRATEGY: we are inflexible REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 9/ 5/95 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OFGVisRecalcSize method dynamic OutboxFeedbackGlyphClass, MSG_VIS_RECALC_SIZE .enter mov cx, OFG_FRAME_WIDTH mov dx, OFG_FRAME_HEIGHT .leave ret OFGVisRecalcSize endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OFGStartTimer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Start up the timer for the next frame CALLED BY: (INTERNAL) OFGVisOpen, OFGNextFrame PASS: *ds:si = OutboxFeedbackGlyph RETURN: ds:di = OutboxFeedbackGlyphInstance OFGI_timer, OFGI_timerID set DESTROYED: ax, bx, cx, dx SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 9/ 6/95 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OFGStartTimer proc near class OutboxFeedbackGlyphClass .enter mov bx, ds:[LMBH_handle] mov al, TIMER_EVENT_ONE_SHOT mov cx, OFG_FRAME_DELAY mov dx, MSG_OFG_NEXT_FRAME call TimerStart DerefDI OutboxFeedbackGlyph mov ds:[di].OFGI_timer, bx mov ds:[di].OFGI_timerID, ax .leave ret OFGStartTimer endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OFGVisOpen %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: If animated, begin animation. CALLED BY: MSG_VIS_OPEN PASS: *ds:si = OutboxFeedbackGlyph object ds:di = OutboxFeedbackGlyphInstance bp = 0 if top window, else window for object to open on RETURN: DESTROYED: SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 9/ 5/95 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OFGVisOpen method dynamic OutboxFeedbackGlyphClass, MSG_VIS_OPEN uses bp, ax .enter call OFGStartTimer mov ds:[di].OFGI_curFrame, 0 .leave mov di, offset OutboxFeedbackGlyphClass GOTO ObjCallSuperNoLock OFGVisOpen endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OFGVisClose %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Shut off the animation timer, if it's on CALLED BY: MSG_VIS_CLOSE PASS: *ds:si = OutboxFeedbackGlyph object ds:di = OutboxFeedbackGlyphInstance RETURN: nothing DESTROYED: ax, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 9/ 5/95 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OFGVisClose method dynamic OutboxFeedbackGlyphClass, MSG_VIS_CLOSE .enter push ax clr bx xchg bx, ds:[di].OFGI_timer mov ax, ds:[di].OFGI_timerID call TimerStop pop ax .leave mov di, offset OutboxFeedbackGlyphClass GOTO ObjCallSuperNoLock OFGVisClose endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OFGNextFrame %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Advance to the next frame. CALLED BY: MSG_OFG_NEXT_FRAME PASS: *ds:si = OutboxFeedbackGlyph object ds:di = OutboxFeedbackGlyphInstance RETURN: nothing DESTROYED: nothing SIDE EFFECTS: ax, cx, dx, bp PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 9/ 5/95 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OFGNextFrame method dynamic OutboxFeedbackGlyphClass, MSG_OFG_NEXT_FRAME mov cx, ds:[di].OFGI_curFrame inc cx cmp cl, length ofgFrames jb drawIt clr cx drawIt: clr bp ; generate your own gstate clr dl ; no special draw flags mov ax, MSG_OFG_DRAW_FRAME call ObjCallInstanceNoLock ; ; Start the timer if we're still open (which we can determine by ; checking if VIS_CLOSE has set OFGI_timer to 0) ; DerefDI OutboxFeedbackGlyph tst ds:[di].OFGI_timer jz done call OFGStartTimer done: ret OFGNextFrame endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OFGDrawFrame %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Draw the indicated frame, recording it as our current CALLED BY: MSG_OFG_DRAW_FRAME PASS: *ds:si = OutboxFeedbackGlyph object ds:di = OutboxFeedbackGlyphInstance cl = frame # to draw dl = DrawFlags bp = gstate to use, or 0 if should create one RETURN: nothing DESTROYED: ax, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 9/ 5/95 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OFGDrawFrame method dynamic OutboxFeedbackGlyphClass, MSG_OFG_DRAW_FRAME .enter push bp tst bp jnz haveState push cx, dx mov ax, MSG_VIS_VUP_CREATE_GSTATE call ObjCallInstanceNoLock pop cx, dx haveState: mov di, bp mov ax, C_WHITE call GrSetAreaColor push cx push dx mov ax, MSG_VIS_GET_BOUNDS call ObjCallInstanceNoLock pop bx ; bl <- DrawFlags test bl, mask DF_EXPOSED jz erasePrev ; ; When exposed, we wipe out the entire background. ; mov bx, bp call GrFillRect jmp drawNew erasePrev: ; ; Erase the letter in the previous frame; the globe we'll just ; draw over. ; ; ax = left ; bp = top ; di = gstate ; mov bx, ds:[si] add bx, ds:[bx].OutboxFeedbackGlyph_offset mov bx, ds:[bx].OFGI_curFrame CheckHack <type ofgFrames eq 8> shl bx shl bx shl bx ; ; Find the letter chunk and see if the letter was actually drawn. ; push ds, si, ax, bp mov si, cs:[ofgFrames][bx].OFGFD_letter tst si jz erasePrevDone ; => nothing to erase ; ; It was. Adjust the left & top to be the left & top of the letter. ; add ax, cs:[ofgFrames][bx].OFGFD_letterX add bp, cs:[ofgFrames][bx].OFGFD_letterY ; ; Find the right and bottom of the letter by adding in the width and ; height of the bitmap ; push ax mov bx, handle OutboxFeedbackData call MemLock mov ds, ax pop ax mov bx, bp mov si, ds:[si] mov cx, ax add cx, ds:[si].B_width mov dx, bx add dx, ds:[si].B_height call GrFillRect ; ; Release the bitmap block and recover various things. ; mov bx, ds:[LMBH_handle] call MemUnlock erasePrevDone: pop ds, si, ax, bx ; *ds:si <- object ; ax <- left, bx <- top drawNew: ; ; Record current frame and index into the frames array ; ; ax = left of frame ; bx = top of frame ; pop bp ; bp <- frame # mov si, ds:[si] add si, ds:[si].OutboxFeedbackGlyph_offset mov ds:[si].OFGI_curFrame, bp CheckHack <type ofgFrames eq 8> shl bp shl bp shl bp ; ; Lock down the block with the bitmaps in it. ; push bx, ax mov bx, handle OutboxFeedbackData call MemLock mov ds, ax pop bx, ax ; ; Draw the globe at the right place in the frame. ; mov si, cs:[ofgFrames][bp].OFGFD_globe mov si, ds:[si] push ax, bx add ax, OFG_GLOBE_X add bx, OFG_GLOBE_Y clr dx ; dx <- no callback call GrDrawBitmap pop ax, bx ; ; Draw the letter at the right place in the frame. ; mov si, cs:[ofgFrames][bp].OFGFD_letter tst si jz done mov si, ds:[si] add ax, cs:[ofgFrames][bp].OFGFD_letterX add bx, cs:[ofgFrames][bp].OFGFD_letterY call GrDrawBitmap done: ; ; Destroy the gstate if we created it. ; pop bp tst bp jnz exit call GrDestroyState exit: mov bx, handle OutboxFeedbackData call MemUnlock .leave ret OFGDrawFrame endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OFGVisDraw %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Draw the current frame again CALLED BY: MSG_VIS_DRAW PASS: *ds:si = OutboxFeedbackGlyph object ds:di = OutboxFeedbackGlyphInstance cl = DrawFlags bp = gstate to use RETURN: nothing DESTROYED: ax, cx, dx, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 9/ 5/95 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ OFGVisDraw method dynamic OutboxFeedbackGlyphClass, MSG_VIS_DRAW .enter mov dl, cl ; dl <- DrawFlags mov cx, ds:[di].OFGI_curFrame mov ax, MSG_OFG_DRAW_FRAME call ObjCallInstanceNoLock .leave ret OFGVisDraw endm OutboxUICode ends endif ; _OUTBOX_FEEDBACK
test/Compiler/simple/Issue1441.agda
cruhland/agda
1,989
4192
<reponame>cruhland/agda module Issue1441 where open import Common.Nat open import Common.Unit open import Common.IO data Sing : (n : Nat) → Set where sing : ∀ n → Sing n data D : Set → Set where c : ∀ n → D (Sing n) test : (A : Set) → D A → Nat test .(Sing n) (c n) = n main : IO Unit main = printNat (test (Sing 1) (c 1)) -- should succeed and print 1
src/nl/tvandijk/aoc/year2020/day14/Input.g4
trolando/aoc2020
1
4222
<filename>src/nl/tvandijk/aoc/year2020/day14/Input.g4 grammar Input; start : instruction+; instruction : 'mask' '=' XSTR # maskInstruction | 'mem[' loc=XSTR ']' '=' val=XSTR # memInstruction ; XSTR : [0123456789X]+ ; WS : [ \t\r,\n]+ -> skip ;
programs/oeis/072/A072057.asm
neoneye/loda
22
177863
<gh_stars>10-100 ; A072057: Sum of divisors of 2*prime(n)+1. ; 6,8,12,24,24,40,48,56,48,60,104,124,84,120,120,108,144,168,240,168,228,216,168,180,336,240,312,264,296,228,432,264,372,416,336,408,624,440,408,348,360,532,384,572,480,640,624,600,672,720,468,480,768,504,624,576,684,728,912,564,968,588,1008,720,960,768,1008,1240,840,936,816,720,1368,1092,1152,840,840,1296,888,1456,840,1128,864,1228,1176,888,960,1488,1008,1352,1296,1104,1736,984,1520,1080,1020,1200,1400,1524 seq $0,40 ; The prime numbers. mul $0,2 seq $0,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n).
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1692.asm
ljhsiun2/medusa
9
9724
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r8 push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0x1d6fe, %rsi lea addresses_D_ht+0x15dfe, %rdi nop nop xor $20371, %r12 mov $113, %rcx rep movsb nop nop dec %r12 lea addresses_WC_ht+0x18cfe, %rsi lea addresses_normal_ht+0x1a16e, %rdi nop nop nop nop nop xor $17700, %rbx mov $43, %rcx rep movsq and $51073, %r12 lea addresses_WT_ht+0x1505e, %rsi lea addresses_WT_ht+0xfebe, %rdi nop nop nop nop and %r8, %r8 mov $122, %rcx rep movsw nop add %rdi, %rdi lea addresses_A_ht+0xf1fe, %rsi lea addresses_A_ht+0x1dafe, %rdi nop nop nop nop inc %r11 mov $23, %rcx rep movsq nop nop and $11666, %r8 lea addresses_A_ht+0x1bafe, %r11 nop xor %r12, %r12 mov $0x6162636465666768, %rsi movq %rsi, %xmm0 movups %xmm0, (%r11) nop nop nop nop xor $48391, %rcx lea addresses_normal_ht+0x14cfe, %r8 nop nop inc %r12 and $0xffffffffffffffc0, %r8 movntdqa (%r8), %xmm3 vpextrq $1, %xmm3, %rcx nop nop nop nop nop add %r12, %r12 lea addresses_WC_ht+0x1ddbe, %r12 nop nop nop and $25545, %rcx mov $0x6162636465666768, %r8 movq %r8, %xmm2 vmovups %ymm2, (%r12) nop nop nop nop nop sub $53479, %r12 lea addresses_A_ht+0xa6de, %r11 nop nop nop nop nop add $40392, %r12 movb $0x61, (%r11) nop sub %r8, %r8 lea addresses_normal_ht+0x180ba, %r11 and %r8, %r8 movb $0x61, (%r11) add $6758, %rcx lea addresses_normal_ht+0x136fe, %r12 nop nop nop nop xor %rsi, %rsi movb $0x61, (%r12) nop nop nop nop sub %rbx, %rbx pop %rsi pop %rdi pop %rcx pop %rbx pop %r8 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r14 push %r8 push %r9 push %rdx // Store lea addresses_WT+0x5e3e, %r11 nop nop inc %rdx movw $0x5152, (%r11) nop nop add %r12, %r12 // Store lea addresses_PSE+0x16fe, %r8 nop nop xor %r14, %r14 movw $0x5152, (%r8) nop nop xor $54736, %r10 // Faulty Load lea addresses_UC+0x12fe, %rdx nop nop nop add %r11, %r11 mov (%rdx), %r14w lea oracles, %r12 and $0xff, %r14 shlq $12, %r14 mov (%r12,%r14,1), %r14 pop %rdx pop %r9 pop %r8 pop %r14 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}, 'dst': {'same': True, 'congruent': 8, 'type': 'addresses_D_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WT_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 9}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 2}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 7}} {'37': 21829} 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 */
LambdaIOT/boot/cpu_s.asm
straight-coding/LPC407x-NoOS-LWIP-MBEDTLS-HTTPD-KEIL
0
95895
<filename>LambdaIOT/boot/cpu_s.asm ;cpu_s.asm ;Author: <NAME><<EMAIL>> ;Date: Sept 01, 2020 ;******************************************************************************************************** ; PUBLIC FUNCTIONS ;******************************************************************************************************** EXPORT CPU_IntDis EXPORT CPU_IntEn EXPORT CPU_Nop EXPORT CPU_SR_Save EXPORT CPU_SR_Restore ;******************************************************************************************************** ; CODE GENERATION DIRECTIVES ;******************************************************************************************************** AREA |.text|, CODE, READONLY, ALIGN=2 THUMB REQUIRE8 PRESERVE8 ;******************************************************************************************************** ; FUNCTIONS ; void CPU_IntEn (void); ;******************************************************************************************************** CPU_IntDis CPSID I BX LR CPU_IntEn CPSIE I BX LR CPU_Nop NOP BX LR CPU_SR_Save MRS R0, PRIMASK CPSID I BX LR CPU_SR_Restore MSR PRIMASK, R0 BX LR END
programs/oeis/204/A204766.asm
neoneye/loda
22
13854
; A204766: a(n) = 167*(n-1)-a(n-1) with n>1, a(1)=13. ; 13,154,180,321,347,488,514,655,681,822,848,989,1015,1156,1182,1323,1349,1490,1516,1657,1683,1824,1850,1991,2017,2158,2184,2325,2351,2492,2518,2659,2685,2826,2852,2993,3019,3160,3186,3327,3353,3494,3520,3661,3687,3828,3854,3995,4021,4162,4188,4329,4355,4496,4522,4663,4689,4830,4856,4997,5023,5164,5190,5331,5357,5498,5524,5665,5691,5832,5858,5999,6025,6166,6192,6333,6359,6500,6526,6667,6693,6834,6860,7001,7027,7168,7194,7335,7361,7502,7528,7669,7695,7836,7862,8003,8029,8170,8196,8337 mov $3,$0 add $0,1 mov $1,4 mov $2,4 mov $4,2 lpb $0 div $0,2 mul $0,2 trn $0,1 add $1,$2 add $1,9 add $4,34 lpe sub $4,1 add $1,$4 mov $6,$4 sub $6,2 mul $6,2 add $1,$6 sub $1,105 mov $5,$3 mul $5,26 add $1,$5 mov $0,$1
systems/assembly/fibonacci/nasm/fib.asm
tradfursten/Hacktoberfest-2k18
29
86602
%include"io.mac" section .data ;messages to be printed input db "Enter the number",0 output db "th fibonocci number is ",0 section .bss ;variable declaration section number resd 1 temp resd 1 section .text ;main program starts here global _start _start: PutStr input GetLInt ecx mov [number],ecx mov eax,1 mov ebx,1 call fibo ;calls fibonocci number print: ;prints the nthfibonocci number PutLInt [number] PutStr output PutLInt eax nwln done: ;exits out of the program .EXIT fibo: ;comes here when the fibo label is called cmp ecx,2 ;compares if the number we needed reached or not jg fibo1 ret fibo1: ;Logic for fibonocci number mov [temp],eax add eax,ebx mov ebx,[temp] sub ecx,1 jmp fibo ;jumps back to fibonocci after the loop is executed
project/src/servo_controller.ads
Stykk-Gruppen/rts-project
2
18944
<filename>project/src/servo_controller.ads<gh_stars>1-10 with Arduino_Nano_33_Ble_Sense.IOs; with Servo; package Servo_Controller is type Direction is (Forward, Backward, Stop); type Servo_Half is record Pin : Arduino_Nano_33_Ble_Sense.IOs.Pin_Id; Angle : Servo.Angle_Range; end record; type Servo_Full is record Pin : Arduino_Nano_33_Ble_Sense.IOs.Pin_Id; Current_Direction : Direction; end record; Engine_Servo : Servo_Full := (Pin => 5, Current_Direction => Stop); task Engine with Priority => 4; end Servo_Controller;
programs/oeis/047/A047790.asm
karttu/loda
0
89252
; A047790: a(n) = Fibonacci(2*n)-2^n+1. ; 0,0,0,1,6,24,81,250,732,2073,5742,15664,42273,113202,301428,799273,2112774,5571816,14668209,38563882,101285580,265817145,697214430,1827923296,4790749761,12552714594,32884171236,86133353545,225582998262,590749858968,1546935014097,4050592054234,10605914890428,27769300100697,72706280378958,190358130970768,498385292402529,1304832105975186,3416179744999764,8943844567977577 mov $2,1 mov $3,1 lpb $0,1 sub $0,1 add $1,$2 add $2,$1 mov $4,$3 mul $3,2 add $3,1 lpe sub $1,$4
Task/Sierpinski-triangle/Ada/sierpinski-triangle-2.ada
LaudateCorpus1/RosettaCodeData
1
18554
<reponame>LaudateCorpus1/RosettaCodeData<filename>Task/Sierpinski-triangle/Ada/sierpinski-triangle-2.ada with Ada.Command_Line; with Ada.Text_IO; procedure Main is subtype Order is Natural range 1 .. 32; type Mod_Int is mod 2 ** Order'Last; procedure Sierpinski (N : Order) is begin for Line in Mod_Int range 0 .. 2 ** N - 1 loop for Col in Mod_Int range 0 .. 2 ** N - 1 loop if (Line and Col) = 0 then Ada.Text_IO.Put ('X'); else Ada.Text_IO.Put (' '); end if; end loop; Ada.Text_IO.New_Line; end loop; end Sierpinski; N : Order := 4; begin if Ada.Command_Line.Argument_Count = 1 then N := Order'Value (Ada.Command_Line.Argument (1)); end if; Sierpinski (N); end Main;
data/pokemon/dex_entries/roselia.asm
AtmaBuster/pokeplat-gen2
6
81347
<reponame>AtmaBuster/pokeplat-gen2 db "THORN@" ; species name db "ROSELIA that drink" next "nutritionally rich" next "springwater are" page "said to reveal" next "rare coloration" next "when they bloom.@"
audio/music/kantowildbattle.asm
Dev727/ancientplatinum
28
97675
Music_KantoWildBattle: musicheader 3, 1, Music_KantoWildBattle_Ch1 musicheader 1, 2, Music_KantoWildBattle_Ch2 musicheader 1, 3, Music_KantoWildBattle_Ch3 db $3 Music_KantoWildBattle_Ch1: tempo 112 volume $77 vibrato $12, $23 dutycycle $2 notetype $c, $b7 note __, 16 octave 4 note A#, 6 note A_, 1 note G#, 1 note A_, 1 note G#, 1 note G_, 1 note F#, 1 note G#, 1 note G_, 1 note F#, 1 note F_, 1 Music_KantoWildBattle_branch_ed091: notetype $c, $b7 callchannel Music_KantoWildBattle_branch_ed18a octave 4 note F_, 4 note C#, 4 octave 3 note B_, 8 callchannel Music_KantoWildBattle_branch_ed18a note __, 8 note G_, 1 note B_, 1 octave 4 note C#, 1 octave 3 note B_, 1 note G_, 1 note B_, 1 octave 4 note D_, 1 note D#, 1 intensity $b1 note E_, 6 note C_, 6 octave 3 note G_, 4 octave 4 note E_, 6 note C_, 6 note E_, 4 intensity $b7 note F_, 1 note C#, 1 octave 3 note G#, 1 octave 4 note C_, 1 note C#, 1 octave 3 note G#, 1 note F_, 1 note G_, 1 note G#, 4 note F#, 1 note G_, 1 note G#, 1 octave 4 note C_, 1 note C#, 4 octave 3 note F_, 1 note G#, 1 octave 4 note C#, 1 note E_, 1 note F_, 3 note G_, 1 note G#, 4 intensity $b1 octave 3 note G_, 6 note F_, 6 note E_, 4 note G#, 6 note G_, 6 note F_, 4 octave 4 note C_, 6 octave 3 note A#, 6 note G_, 4 notetype $8, $b7 octave 2 note G_, 2 octave 3 note C_, 2 note E_, 2 note C_, 2 note E_, 2 note G_, 2 note E_, 2 note G_, 2 octave 4 note C_, 2 octave 3 note G_, 2 octave 4 note C_, 2 note E_, 2 note F_, 2 note C#, 2 octave 3 note G#, 2 octave 4 note C#, 2 octave 3 note G#, 2 note F_, 2 note G#, 2 note F_, 2 note C#, 2 note F_, 2 note C#, 2 octave 2 note G#, 2 notetype $c, $b7 octave 3 note G#, 4 octave 4 note C#, 4 intensity $71 note F_, 1 note F_, 1 intensity $91 note F_, 1 note F_, 1 intensity $b1 note G#, 1 note G#, 1 intensity $d1 note G#, 1 note G#, 1 intensity $c7 note E_, 1 note D_, 1 note C#, 1 note D_, 1 note E_, 12 note E_, 8 intensity $b1 note E_, 1 note D_, 1 note C_, 1 octave 3 note A#, 1 note A_, 1 note G_, 1 note F_, 1 note E_, 1 intensity $b7 note D_, 8 note F_, 8 note A#, 8 octave 4 note D_, 8 octave 3 note G_, 8 octave 4 note C_, 8 note E_, 8 note G_, 8 note __, 8 octave 3 note D#, 8 note G#, 8 octave 4 note C_, 8 octave 3 note A#, 8 note __, 8 octave 4 note D_, 8 octave 3 note G#, 2 note F_, 2 note D_, 2 note F_, 2 octave 4 note C_, 4 note __, 6 note C_, 1 note __, 5 note C#, 2 note C_, 1 note __, 13 note C#, 4 note __, 6 note C#, 1 note __, 5 note F_, 2 note D#, 1 note __, 5 note C#, 8 Music_KantoWildBattle_branch_ed15b: intensity $b1 octave 3 note C_, 1 note D#, 1 note D_, 1 note C#, 1 loopchannel 8, Music_KantoWildBattle_branch_ed15b Music_KantoWildBattle_branch_ed166: note C#, 1 note F_, 1 note E_, 1 note D#, 1 loopchannel 8, Music_KantoWildBattle_branch_ed166 Music_KantoWildBattle_branch_ed16e: note C_, 1 note D#, 1 note D_, 1 note C#, 1 loopchannel 16, Music_KantoWildBattle_branch_ed16e Music_KantoWildBattle_branch_ed176: note C#, 1 note E_, 1 note D#, 1 note D_, 1 loopchannel 8, Music_KantoWildBattle_branch_ed176 Music_KantoWildBattle_branch_ed17e: note C_, 1 note D#, 1 note D_, 1 note C#, 1 loopchannel 8, Music_KantoWildBattle_branch_ed17e loopchannel 0, Music_KantoWildBattle_branch_ed091 Music_KantoWildBattle_branch_ed18a: octave 4 note C_, 1 note __, 5 octave 3 note B_, 1 note __, 5 note A#, 1 note __, 3 note __, 10 octave 4 note C_, 2 note __, 2 note D#, 2 note C#, 1 note __, 5 note C_, 1 note __, 5 octave 3 note B_, 1 note __, 3 endchannel Music_KantoWildBattle_Ch2: dutycycle $1 vibrato $12, $23 notetype $c, $b1 octave 4 note G_, 1 note F#, 1 note F_, 1 note E_, 1 note G_, 1 note F#, 1 note F_, 1 note E_, 1 note G_, 1 note F#, 1 note F_, 1 note E_, 1 note G_, 1 note F#, 1 note F_, 1 note E_, 1 note G_, 1 note F#, 1 note F_, 1 note E_, 1 note F#, 1 note F_, 1 note E_, 1 note D#, 1 note F_, 1 note E_, 1 note D#, 1 note D_, 1 note E_, 1 note D#, 1 note D_, 1 note C#, 1 Music_KantoWildBattle_branch_ed1c8: notetype $c, $b7 callchannel Music_KantoWildBattle_branch_ed2c6 octave 2 note F_, 2 octave 1 note B_, 1 note __, 1 octave 2 note G_, 2 callchannel Music_KantoWildBattle_branch_ed2c6 octave 2 note G_, 1 note __, 1 octave 1 note B_, 1 note __, 1 octave 2 note F_, 1 note F#, 1 notetype $6, $b7 callchannel Music_KantoWildBattle_branch_ed307 callchannel Music_KantoWildBattle_branch_ed307 pitchoffset 0, C# callchannel Music_KantoWildBattle_branch_ed307 callchannel Music_KantoWildBattle_branch_ed307 pitchoffset 0, C_ rept 4 callchannel Music_KantoWildBattle_branch_ed307 endr pitchoffset 0, C# callchannel Music_KantoWildBattle_branch_ed307 callchannel Music_KantoWildBattle_branch_ed307 pitchoffset 0, C_ callchannel Music_KantoWildBattle_branch_ed307 callchannel Music_KantoWildBattle_branch_ed307 note __, 16 octave 3 note A#, 16 octave 4 note D_, 16 note F_, 16 notetype $c, $b7 note E_, 16 note G_, 8 octave 5 note C_, 8 note __, 8 octave 3 note G#, 8 octave 4 note C_, 8 note D#, 8 note F_, 8 note F_, 1 octave 3 note A#, 1 note G#, 1 note A#, 1 octave 4 note F_, 1 octave 3 note A#, 1 note G#, 1 note A#, 1 octave 4 note G#, 8 note G#, 1 note F_, 1 note D_, 1 octave 3 note B_, 1 octave 4 note F_, 1 note D_, 1 octave 3 note B_, 1 note G#, 1 notetype $6, $b7 callchannel Music_KantoWildBattle_branch_ed31b pitchoffset 0, C# callchannel Music_KantoWildBattle_branch_ed31b pitchoffset 0, C_ callchannel Music_KantoWildBattle_branch_ed340 octave 2 note C_, 2 note __, 2 octave 3 note G_, 4 octave 2 note C_, 2 note __, 2 note C_, 2 note __, 2 octave 4 note C_, 4 octave 2 note C_, 2 note __, 2 octave 4 note D#, 4 octave 2 note C_, 2 note __, 2 octave 4 note C#, 4 octave 2 note C#, 2 note __, 2 note C#, 2 note __, 2 octave 4 note C#, 4 octave 2 note C#, 2 note __, 2 note C#, 2 note __, 2 octave 4 note C#, 4 octave 2 note C#, 2 note __, 2 note C#, 2 note __, 2 octave 4 note C#, 4 octave 2 note C#, 2 note __, 2 note C#, 2 note __, 2 octave 4 note C#, 4 octave 2 note C#, 2 note __, 2 octave 4 note F_, 4 octave 2 note C#, 2 note __, 2 callchannel Music_KantoWildBattle_branch_ed340 callchannel Music_KantoWildBattle_branch_ed354 callchannel Music_KantoWildBattle_branch_ed340 callchannel Music_KantoWildBattle_branch_ed354 pitchoffset 0, C# callchannel Music_KantoWildBattle_branch_ed340 pitchoffset 0, C_ note C#, 2 note __, 2 octave 3 note G#, 4 octave 2 note C#, 2 note __, 2 note C#, 2 note __, 2 octave 4 note C#, 4 octave 2 note C#, 2 note __, 2 octave 3 note A#, 4 octave 2 note C#, 2 note __, 2 callchannel Music_KantoWildBattle_branch_ed340 note C_, 2 note __, 2 octave 3 note G_, 4 octave 2 note C_, 2 note __, 2 note C_, 2 note __, 2 octave 4 note C_, 4 octave 2 note C_, 2 note __, 2 octave 3 note A#, 4 octave 2 note C_, 2 note __, 2 loopchannel 0, Music_KantoWildBattle_branch_ed1c8 Music_KantoWildBattle_branch_ed2c6: octave 2 note C_, 1 note __, 2 note C_, 1 octave 1 note G_, 1 note __, 1 octave 2 note C_, 1 note __, 1 octave 3 note C_, 2 octave 2 note C_, 1 note __, 1 octave 1 note G_, 1 note __, 2 note G_, 1 octave 2 note C_, 3 note C_, 1 octave 1 note G_, 2 octave 2 note C_, 2 octave 1 note G_, 2 octave 2 note F#, 2 octave 1 note G_, 2 octave 2 note G_, 2 note C#, 1 note __, 2 note C#, 1 octave 1 note G#, 1 note __, 1 octave 2 note C#, 1 note __, 1 octave 3 note C#, 1 note __, 1 octave 2 note C#, 2 octave 1 note G#, 1 note __, 2 note G#, 1 octave 2 note C#, 1 note __, 2 note C#, 1 octave 1 note G#, 1 note __, 1 octave 2 note C#, 1 note __, 1 octave 1 note G_, 2 endchannel Music_KantoWildBattle_branch_ed307: octave 2 note C_, 2 note __, 4 note C_, 1 note __, 1 note C_, 2 octave 3 note C_, 2 octave 2 note C_, 4 note __, 2 note C_, 2 note __, 2 note C_, 2 octave 3 note C_, 2 note __, 2 octave 2 note C_, 4 endchannel Music_KantoWildBattle_branch_ed31b: octave 2 note C_, 2 note __, 4 note C_, 2 note __, 4 octave 1 note G_, 1 note __, 1 note G_, 1 note __, 1 octave 2 note E_, 2 note __, 2 note E_, 2 note __, 2 note E_, 2 note C_, 6 note C_, 2 note __, 4 note C_, 2 octave 1 note G_, 2 octave 2 note E_, 2 note C_, 2 octave 1 note G_, 2 octave 2 note C_, 2 note __, 4 note C_, 2 note E_, 2 note G_, 2 note B_, 2 octave 3 note C_, 2 endchannel Music_KantoWildBattle_branch_ed340: octave 3 note G_, 4 octave 2 note C_, 2 note __, 2 note C_, 2 note __, 2 octave 3 note G_, 4 octave 2 note C_, 2 note __, 2 note C_, 2 note __, 2 octave 3 note G_, 4 octave 2 note C_, 2 note __, 2 endchannel Music_KantoWildBattle_branch_ed354: note C_, 2 note __, 2 octave 3 note G_, 4 octave 2 note C_, 2 note __, 2 note C_, 2 note __, 2 octave 3 note G_, 4 octave 2 note C_, 2 note __, 2 octave 3 note G_, 4 octave 2 note C_, 2 note __, 2 endchannel Music_KantoWildBattle_Ch3: vibrato $14, $23 notetype $c, $14 octave 3 note C_, 1 note __, 1 note C_, 1 octave 4 note C_, 1 octave 3 note C#, 1 note __, 1 note C#, 1 octave 4 note C#, 1 octave 3 note D_, 1 note __, 1 note D_, 1 octave 4 note D_, 1 octave 3 note D#, 1 note __, 1 note D#, 1 octave 4 note D#, 1 octave 3 note E_, 1 note __, 1 note E_, 1 octave 4 note E_, 1 octave 3 note F_, 1 note __, 1 note F_, 1 octave 4 note F_, 1 octave 3 note F#, 1 note __, 1 note F#, 1 octave 4 note F#, 1 octave 3 note G_, 1 note __, 1 note G_, 1 octave 4 note G_, 1 Music_KantoWildBattle_branch_ed39e: notetype $c, $14 octave 5 note G_, 1 note __, 2 octave 4 note G_, 1 note __, 2 octave 5 note G_, 1 note __, 3 octave 4 note G_, 1 note __, 1 octave 5 note G_, 1 note __, 2 octave 4 note G_, 1 octave 3 note G_, 1 note B_, 1 octave 4 note C_, 1 note D_, 1 note D#, 6 octave 5 note D#, 2 note __, 2 note G_, 2 note G#, 1 note __, 2 octave 4 note G#, 1 note __, 2 octave 5 note G#, 1 note __, 3 octave 4 note G#, 1 note __, 1 octave 5 note G#, 1 note __, 2 octave 4 note G#, 1 octave 6 note C#, 6 octave 5 note G#, 1 note F_, 1 note B_, 1 note G_, 1 note F_, 1 note D_, 1 note G_, 1 note F_, 1 note D_, 1 octave 4 note B_, 1 octave 5 note G_, 1 note __, 2 octave 4 note G_, 1 note __, 2 octave 5 note G_, 1 note __, 3 octave 4 note G_, 1 note __, 1 octave 5 note G_, 1 note __, 2 octave 4 note G_, 1 note C_, 1 note D_, 1 note D#, 1 note F_, 1 note G_, 6 octave 5 note D#, 2 note __, 2 note G_, 2 note G#, 1 note __, 2 octave 4 note G_, 1 note __, 2 octave 5 note G#, 1 note __, 3 octave 4 note G_, 1 note __, 1 octave 5 note G#, 1 note __, 2 octave 4 note G_, 1 note C#, 4 note G#, 4 octave 5 note F_, 7 note F#, 1 note G_, 2 intensity $24 note C_, 1 octave 4 note G_, 1 octave 5 note C_, 1 octave 4 note G_, 1 intensity $14 octave 5 note F#, 2 intensity $24 note C_, 1 octave 4 note G_, 1 octave 5 note C_, 1 octave 4 note G_, 1 intensity $14 octave 5 note E_, 2 intensity $24 note C_, 1 octave 4 note G_, 1 intensity $14 octave 5 note G_, 2 intensity $24 note C_, 1 octave 4 note G_, 1 octave 5 note C_, 1 octave 4 note G_, 1 intensity $14 octave 5 note A_, 2 intensity $24 note C_, 1 octave 4 note G_, 1 octave 5 note C_, 1 octave 4 note G_, 1 intensity $14 octave 5 note G_, 2 intensity $24 note C_, 1 octave 4 note G#, 1 intensity $14 octave 5 note G#, 12 note G_, 2 note F_, 2 note G#, 2 note G_, 2 note C#, 1 note F_, 1 note G#, 1 octave 6 note C_, 1 note C#, 8 octave 5 note C_, 2 intensity $24 octave 4 note E_, 1 note G_, 1 note E_, 1 note G_, 1 intensity $14 note A#, 2 intensity $24 note E_, 1 note G_, 1 note E_, 1 note G_, 1 intensity $14 note G#, 2 intensity $24 note E_, 1 note G_, 1 intensity $14 octave 5 note C#, 2 intensity $24 octave 4 note E_, 1 note G_, 1 note E_, 1 note G_, 1 intensity $14 octave 5 note C_, 2 intensity $24 octave 4 note E_, 1 note G_, 1 note E_, 1 note G_, 1 intensity $14 note A#, 2 intensity $24 note E_, 1 note G_, 1 intensity $14 octave 5 note F_, 2 intensity $24 octave 4 note G_, 1 octave 5 note C_, 1 octave 4 note G_, 1 octave 5 note C_, 1 intensity $14 note E_, 2 intensity $24 octave 4 note G_, 1 octave 5 note C_, 1 octave 4 note G_, 1 octave 5 note C_, 1 intensity $14 note D_, 2 intensity $24 octave 4 note G_, 1 octave 5 note C_, 1 intensity $14 octave 4 note A#, 4 octave 5 note C_, 4 note D_, 4 note F_, 4 note G#, 16 notetype $6, $14 note G#, 1 note __, 1 intensity $24 note G#, 1 note __, 1 intensity $34 note G#, 1 note __, 1 note G#, 1 note __, 1 note G#, 1 note __, 1 note G#, 1 note __, 1 intensity $24 note G#, 1 note __, 1 note G#, 1 note __, 1 note G#, 1 note __, 1 note G#, 1 note __, 1 intensity $14 note G#, 1 note __, 1 note G#, 1 note __, 1 octave 6 note C#, 1 note __, 1 note C#, 1 note __, 1 note C#, 1 note __, 1 note C#, 1 note __, 1 octave 5 note G_, 2 note F_, 2 note E_, 2 note F_, 2 notetype $c, $15 note G_, 12 note G_, 8 notetype $6, $15 note G_, 1 note __, 1 note G_, 1 note __, 1 note G_, 1 note __, 1 note G_, 1 note __, 1 intensity $24 note G_, 1 note __, 1 note G_, 1 note __, 1 intensity $14 note G_, 1 note __, 1 note G_, 1 note __, 1 notetype $c, $14 octave 2 note A#, 16 note A#, 1 note __, 2 note A#, 1 note __, 2 note A#, 1 note __, 1 octave 3 note A#, 1 note __, 2 note A#, 1 note __, 2 note A#, 1 note __, 1 note C_, 1 note __, 2 notetype $6, $15 note C_, 1 note __, 1 note C_, 2 octave 4 note C_, 2 octave 3 note C_, 4 note __, 2 note C_, 2 note __, 2 note C_, 2 octave 4 note C_, 2 note __, 2 octave 3 note C_, 4 note C_, 2 note __, 4 note C_, 1 note __, 1 note C_, 2 octave 4 note C_, 2 octave 3 note C_, 4 note __, 2 note C_, 2 note __, 2 note C_, 2 octave 2 note A#, 2 note __, 2 note A#, 2 note __, 2 notetype $c, $14 note G#, 16 note G#, 16 note A#, 2 note __, 2 note A#, 1 note __, 3 note A#, 1 note __, 1 octave 3 note A#, 1 note __, 1 octave 2 note A#, 1 note __, 1 octave 3 note A#, 1 note __, 1 note D_, 2 note __, 2 note D_, 1 note __, 3 note D_, 1 note __, 1 octave 4 note D_, 1 note __, 1 octave 2 note B_, 1 note __, 1 octave 3 note B_, 1 note __, 1 octave 5 note E_, 4 octave 4 note C_, 1 note E_, 1 note G_, 1 note B_, 1 octave 5 note C_, 1 note __, 1 note E_, 1 note __, 5 note F_, 2 note E_, 1 note __, 1 octave 4 note C_, 1 octave 3 note G_, 1 octave 4 note C_, 1 note E_, 1 note G_, 1 note E_, 1 note C_, 1 note E_, 1 note G_, 1 octave 5 note C_, 1 note E_, 1 note G_, 1 note F_, 4 octave 4 note C#, 1 note F_, 1 note G#, 1 octave 5 note C_, 1 note C#, 1 note __, 1 note F_, 1 note __, 5 note G#, 2 note G_, 1 note __, 5 note F_, 8 intensity $13 note G_, 6 note F#, 6 note E_, 2 note __, 2 note G_, 6 note A_, 6 note G_, 2 note __, 2 note G#, 12 note G_, 2 note F_, 2 note G#, 2 note G_, 2 note __, 4 octave 6 note C#, 8 octave 5 note C_, 6 octave 4 note A#, 6 note G#, 2 note __, 2 octave 5 note C#, 6 note C_, 6 octave 4 note A#, 2 note __, 2 octave 5 note F_, 6 note E_, 6 note D_, 2 note __, 2 octave 4 note A#, 4 octave 5 note C_, 4 note D_, 4 note F_, 4 note G#, 16 note G#, 16 note G_, 16 note G_, 16 loopchannel 0, Music_KantoWildBattle_branch_ed39e
core/lib/types/EilenbergMacLane1.agda
cmknapp/HoTT-Agda
0
14060
<reponame>cmknapp/HoTT-Agda {-# OPTIONS --without-K #-} open import lib.Basics open import lib.NType2 open import lib.Equivalences2 open import lib.NConnected open import lib.types.Nat open import lib.types.Pi open import lib.types.Sigma open import lib.types.TLevel open import lib.types.Truncation open import lib.types.Group open import lib.types.Pointed open import lib.types.LoopSpace open import lib.groups.Homomorphisms open import lib.groups.HomotopyGroup module lib.types.EilenbergMacLane1 where module EM₁ {i} (G : Group i) where module G = Group G private data #EM₁-aux : Type i where #embase : #EM₁-aux data #EM₁ : Type i where #em₁ : #EM₁-aux → (Unit → Unit) → #EM₁ EM₁ : Type i EM₁ = #EM₁ embase : EM₁ embase = #em₁ #embase _ ⊙EM₁ : Ptd i ⊙EM₁ = ⊙[ EM₁ , embase ] postulate -- HIT emlevel : has-level ⟨ 1 ⟩ EM₁ emloop : G.El → embase == embase emloop-ident : emloop G.ident == idp emloop-comp : ∀ g₁ g₂ → emloop (G.comp g₁ g₂) == emloop g₁ ∙ emloop g₂ module EM₁Rec {j} {C : Type j} (C-level : has-level ⟨ 1 ⟩ C) (embase* : C) (hom* : G →ᴳ (Ω^S-group 0 (C , embase*) C-level)) where f : EM₁ → C f (#em₁ #embase _) = embase* postulate -- HIT emloop-β : (g : G.El) → ap f (emloop g) == GroupHom.f hom* g open EM₁Rec public using () renaming (f to EM₁-rec) module EM₁Elim {j} {P : EM₁ → Type j} (P-level : (x : EM₁) → has-level ⟨ 1 ⟩ (P x)) (embase* : P embase) (emloop* : (g : G.El) → embase* == embase* [ P ↓ emloop g ]) (preserves-ident : emloop* G.ident == idp [ (λ p → embase* == embase* [ P ↓ p ]) ↓ emloop-ident ]) (preserves-comp : (g₁ g₂ : G.El) → emloop* (G.comp g₁ g₂) == emloop* g₁ ∙ᵈ emloop* g₂ [ (λ p → embase* == embase* [ P ↓ p ]) ↓ emloop-comp g₁ g₂ ]) where f : Π EM₁ P f (#em₁ #embase _) = embase* postulate -- HIT emloop-β : (g : G.El) → apd f (emloop g) == emloop* g open EM₁Elim public using () renaming (f to EM₁-elim) emloop-inv : ∀ g → emloop (G.inv g) == ! (emloop g) emloop-inv g = cancels-inverse _ _ lemma where cancels-inverse : ∀ {i} {A : Type i} {x y : A} (p : x == y) (q : y == x) → p ∙ q == idp → p == ! q cancels-inverse p idp r = ! (∙-unit-r p) ∙ r lemma : emloop (G.inv g) ∙ emloop g == idp lemma = ! (emloop-comp (G.inv g) g) ∙ ap emloop (G.invl g) ∙ emloop-ident module π₁ where comp-equiv : ∀ g → G.El ≃ G.El comp-equiv g = equiv (λ x → G.comp x g) (λ x → G.comp x (G.inv g)) (λ x → G.assoc x (G.inv g) g ∙ ap (G.comp x) (G.invl g) ∙ G.unitr x) (λ x → G.assoc x g (G.inv g) ∙ ap (G.comp x) (G.invr g) ∙ G.unitr x) comp-equiv-id : comp-equiv G.ident == ide G.El comp-equiv-id = pair= (λ= G.unitr) (prop-has-all-paths-↓ {B = is-equiv} (is-equiv-is-prop $ idf G.El)) comp-equiv-comp : (g₁ g₂ : G.El) → comp-equiv (G.comp g₁ g₂) == (comp-equiv g₂ ∘e comp-equiv g₁) comp-equiv-comp g₁ g₂ = pair= (λ= (λ x → ! (G.assoc x g₁ g₂))) (prop-has-all-paths-↓ {B = is-equiv} (is-equiv-is-prop _)) Ω-group : Group (lsucc i) Ω-group = group (G.El == G.El) (universe-=-level G.El-level G.El-level) (Ω^S-group-structure 0 (Type i , G.El)) 0-group : Group (lsucc i) 0-group = Ω^S-group 0 ((0 -Type i) , (G.El , G.El-level)) (0 -Type-level i) Codes-hom₁ : G →ᴳ Ω-group Codes-hom₁ = record { f = ua ∘ comp-equiv; pres-comp = λ g₁ g₂ → ua (comp-equiv (G.comp g₁ g₂)) =⟨ ap ua (comp-equiv-comp g₁ g₂) ⟩ ua (comp-equiv g₂ ∘e comp-equiv g₁) =⟨ ua-∘e (comp-equiv g₁) (comp-equiv g₂) ⟩ ua (comp-equiv g₁) ∙ ua (comp-equiv g₂) ∎} Codes-hom₂ : Ω-group →ᴳ 0-group Codes-hom₂ = record { f = λ p → pair= p (phap p); pres-comp = λ p₁ p₂ → pair= (p₁ ∙ p₂) (phap (p₁ ∙ p₂)) =⟨ prop-has-all-paths (↓-level (λ _ → raise-level _ has-level-is-prop)) _ _ |in-ctx (λ w → pair= (p₁ ∙ p₂) w) ⟩ pair= (p₁ ∙ p₂) (phap p₁ ∙ᵈ phap p₂) =⟨ ! (Σ-∙ (phap p₁) (phap p₂)) ⟩ pair= p₁ (phap p₁) ∙ pair= p₂ (phap p₂) ∎} where -- saving some space phap : (p : G.El == G.El) → G.El-level == G.El-level [ has-level 0 ↓ p ] phap p = prop-has-all-paths-↓ has-level-is-prop Codes-hom : G →ᴳ 0-group Codes-hom = Codes-hom₂ ∘ᴳ Codes-hom₁ Codes : EM₁ → 0 -Type i Codes = EM₁-rec {C = 0 -Type i} (0 -Type-level i) (G.El , G.El-level) Codes-hom abstract ↓-Codes-loop : ∀ g g' → g' == G.comp g' g [ fst ∘ Codes ↓ emloop g ] ↓-Codes-loop g g' = ↓-ap-out fst Codes (emloop g) $ ↓-ap-out (idf _) fst (ap Codes (emloop g)) $ transport (λ w → g' == G.comp g' g [ idf _ ↓ ap fst w ]) (! (EM₁Rec.emloop-β (0 -Type-level i) (G.El , G.El-level) Codes-hom g)) $ transport (λ w → g' == G.comp g' g [ idf _ ↓ w ]) (! (fst=-β (ua $ comp-equiv g) _)) $ ↓-idf-ua-in (comp-equiv g) idp encode : {x : EM₁} → embase == x → fst (Codes x) encode α = transport (fst ∘ Codes) α G.ident encode-emloop : ∀ g → encode (emloop g) == g encode-emloop g = to-transp $ transport (λ x → G.ident == x [ fst ∘ Codes ↓ emloop g ]) (G.unitl g) (↓-Codes-loop g G.ident) decode : {x : EM₁} → fst (Codes x) → embase == x decode {x} = EM₁-elim {P = λ x' → fst (Codes x') → embase == x'} (λ _ → Π-level (λ _ → =-preserves-level _ emlevel)) emloop loop' (prop-has-all-paths-↓ (Π-level (λ _ → emlevel _ _) _ _)) (λ _ _ → prop-has-all-paths-↓ (↓-level (λ _ → Π-level (λ _ → emlevel _ _)))) x where loop' : (g : G.El) → emloop == emloop [ (λ x' → fst (Codes x') → embase == x') ↓ emloop g ] loop' g = ↓-→-from-transp $ λ= $ λ y → transport (λ z → embase == z) (emloop g) (emloop y) =⟨ trans-pathfrom (emloop g) (emloop y) ⟩ emloop y ∙ emloop g =⟨ ! (emloop-comp y g) ⟩ emloop (G.comp y g) =⟨ ap emloop (! (to-transp (↓-Codes-loop g y))) ⟩ emloop (transport (λ z → fst (Codes z)) (emloop g) y) ∎ decode-encode : ∀ {x} (α : embase == x) → decode (encode α) == α decode-encode idp = emloop-ident abstract Ω¹-equiv : (embase == embase) ≃ G.El Ω¹-equiv = equiv encode emloop encode-emloop decode-encode abstract Ω¹-path : (embase == embase) == G.El Ω¹-path = ua Ω¹-equiv abstract π₁-path : Trunc 0 (embase == embase) == G.El π₁-path = ap (Trunc 0) Ω¹-path ∙ ua (unTrunc-equiv G.El G.El-level) abstract π₁-iso : πS 0 (EM₁ , embase) == G π₁-iso = ! $ group-ua (record { f = [_] ∘ emloop; pres-comp = λ g₁ g₂ → ap [_] (emloop-comp g₁ g₂) } , snd ((unTrunc-equiv (embase == embase) (emlevel _ _))⁻¹ ∘e (Ω¹-equiv ⁻¹))) {- EM₁ is 0-connected -} abstract EM₁-conn : is-connected 0 EM₁ EM₁-conn = ([ embase ] , Trunc-elim (λ _ → =-preserves-level _ Trunc-level) (EM₁-elim {P = λ x → [ embase ] == [ x ]} (λ _ → raise-level _ (=-preserves-level _ Trunc-level)) idp (λ _ → prop-has-all-paths-↓ (Trunc-level {n = 0} _ _)) (set-↓-has-all-paths-↓ (=-preserves-level _ Trunc-level)) (λ _ _ → set-↓-has-all-paths-↓ (=-preserves-level _ Trunc-level))))
tools/ayacc/src/rule_table.adb
svn2github/matreshka
24
11038
-- Copyright (c) 1990 Regents of the University of California. -- All rights reserved. -- -- The primary authors of ayacc were <NAME> and <NAME>. -- Enhancements were made by <NAME>. -- -- Send requests for ayacc information to <EMAIL> -- Send bug reports for ayacc to <EMAIL> -- -- Redistribution and use in source and binary forms are permitted -- provided that the above copyright notice and this paragraph are -- duplicated in all such forms and that any documentation, -- advertising materials, and other materials related to such -- distribution and use acknowledge that the software was developed -- by the University of California, Irvine. The name of the -- University may not be used to endorse or promote products derived -- from this software without specific prior written permission. -- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. -- Module : rule_table_body.ada -- Component of : ayacc -- Version : 1.2 -- Date : 11/21/86 12:34:28 -- SCCS File : disk21~/rschm/hasee/sccs/ayacc/sccs/sxrule_table_body.ada -- $Header: rule_table_body.a,v 0.1 86/04/01 15:11:44 ada Exp $ -- $Log: rule_table_body.a,v $ -- Revision 0.1 86/04/01 15:11:44 ada -- This version fixes some minor bugs with empty grammars -- and $$ expansion. It also uses vads5.1b enhancements -- such as pragma inline. -- -- -- Revision 0.0 86/02/19 18:41:08 ada -- -- These files comprise the initial version of Ayacc -- designed and implemented by <NAME> and <NAME>. -- Ayacc has been compiled and tested under the Verdix Ada compiler -- version 4.06 on a vax 11/750 running Unix 4.2BSD. -- package body Rule_Table is SCCS_ID : constant String := "@(#) rule_table_body.ada, Version 1.2"; Rcs_ID : constant String := "$Header: rule_table_body.a,v 0.1 86/04/01 15:11:44 ada Exp $"; -- Rules are implemented as an array of linked lists Number_of_Nested_Rules : Integer := 0; type RHS_Element; type RHS_Pointer is access RHS_Element; type RHS_Element is record RHS_Symbol: Grammar_Symbol; Next : RHS_Pointer; end record; type Rule_Entry is record LHS_Symbol : Grammar_Symbol; RHS : RHS_Pointer; Length : Natural; Null_Pos : Natural; Prec : Precedence; end record; Rule_List: array(Rule) of Rule_Entry; Next_Free_Rule: Rule := 0; function Get_Rule_Precedence(R : Rule) return Precedence is begin return Rule_List(R).Prec; end Get_Rule_Precedence; function Make_Rule(LHS: Grammar_Symbol) return Rule is R : Rule := Next_Free_Rule; begin Rule_List(R) := (LHS, RHS => null, Length => 0, Null_Pos => 0, Prec => 0); Next_Free_Rule := Next_Free_Rule + 1; return R; end Make_Rule; procedure Append_RHS(R: in Rule; RHS: in Grammar_Symbol) is Temp_Pointer: RHS_Pointer; begin if Is_Terminal(RHS) then Rule_List(R).Prec := Get_Precedence(RHS); end if; if Rule_List(R).RHS = null then Rule_List(R).RHS := new RHS_Element'(RHS, null); else Temp_Pointer := Rule_List(R).RHS; while Temp_Pointer.Next /= null loop Temp_Pointer := Temp_Pointer.Next; end loop; Temp_Pointer.Next := new RHS_Element'(RHS, null); end if; Rule_List(R).Length := Rule_List(R).Length + 1; end Append_RHS; function Get_LHS(R: Rule) return Grammar_Symbol is begin return Rule_List(R).LHS_Symbol; end Get_LHS; function Get_Null_Pos(R: Rule) return Natural is begin return Rule_List(R).Null_Pos; end Get_Null_Pos; procedure Set_Null_Pos(R : in Rule; Position: in Natural) is begin Rule_List(R).Null_Pos := Position; end Set_Null_Pos; function Get_RHS(R: Rule; Position: Positive) return Grammar_Symbol is Temp_Pointer: RHS_Pointer; begin Temp_Pointer := Rule_List(R).RHS; for I in 2..Position loop Temp_Pointer := Temp_Pointer.Next; end loop; return Temp_Pointer.RHS_Symbol; end Get_RHS; function Length_of(R: Rule) return Natural is begin return Rule_List(R).Length; end Length_of; function First_Rule return Rule is begin return 0; end First_Rule; function Last_Rule return Rule is begin return Next_Free_Rule - 1; end Last_Rule; function Number_of_Rules return Natural is begin return Natural(Next_Free_Rule) - 1; end Number_of_Rules; procedure Handle_Nested_Rule(Current_Rule : in out Rule) is Temp : Rule_Entry; LHS : Grammar_Symbol; New_Rule : Rule; begin -- Make a new rule prefixed by $$N Number_of_Nested_Rules := Number_of_Nested_Rules + 1; LHS := Insert_Identifier("$$" & Integer'Image(Number_of_Nested_Rules)); New_Rule := Make_Rule(LHS); Append_RHS(Current_Rule,LHS); -- Exchange the rule positions of the new rule and the current rule -- by swapping contents and exchanging the rule positions Temp := Rule_List(Current_Rule); Rule_List(Current_Rule) := Rule_List(New_Rule); Rule_List(New_Rule) := Temp; Current_Rule := New_Rule; end Handle_Nested_Rule; procedure Set_Rule_Precedence(R: in Rule; Prec: in Precedence) is begin Rule_List(R).Prec := Prec; end Set_Rule_Precedence; end Rule_Table;
programs/oeis/193/A193739.asm
neoneye/loda
22
82454
; A193739: Mirror of the triangle A193738. ; 1,1,1,2,2,1,3,3,2,1,4,4,3,2,1,5,5,4,3,2,1,6,6,5,4,3,2,1,7,7,6,5,4,3,2,1,8,8,7,6,5,4,3,2,1,9,9,8,7,6,5,4,3,2,1,10,10,9,8,7,6,5,4,3,2,1,11,11,10,9,8,7,6,5,4,3,2,1,12,12,11,10,9,8,7,6,5,4,3,2,1,13,13,12,11,10,9,8,7,6 mov $2,$0 lpb $0 add $1,1 sub $0,$1 cmp $2,$1 add $2,$0 lpe sub $1,$2 add $1,1 mov $0,$1
programs/oeis/080/A080342.asm
jmorken/loda
1
1773
; A080342: Number of weighings required to identify a single bad coin out of n coins, using a two-pan balance. ; 0,1,1,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6 lpb $0 div $0,3 add $1,1 lpe
coverage/IN_CTS/0577-COVERAGE-constant-folding-2531-2542/work/variant/1_spirv_asm/shader.frag.asm
asuonpaa/ShaderTests
0
163218
<filename>coverage/IN_CTS/0577-COVERAGE-constant-folding-2531-2542/work/variant/1_spirv_asm/shader.frag.asm ; SPIR-V ; Version: 1.0 ; Generator: Khronos Glslang Reference Front End; 10 ; Bound: 57 ; Schema: 0 OpCapability Shader %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %4 "main" %34 OpExecutionMode %4 OriginUpperLeft OpSource ESSL 320 OpName %4 "main" OpName %8 "a" OpName %11 "buf0" OpMemberName %11 0 "_GLF_uniform_uint_values" OpName %13 "" OpName %21 "ResType" OpName %34 "_GLF_color" OpName %36 "buf1" OpMemberName %36 0 "_GLF_uniform_int_values" OpName %38 "" OpDecorate %10 ArrayStride 16 OpMemberDecorate %11 0 Offset 0 OpDecorate %11 Block OpDecorate %13 DescriptorSet 0 OpDecorate %13 Binding 0 OpDecorate %34 Location 0 OpDecorate %35 ArrayStride 16 OpMemberDecorate %36 0 Offset 0 OpDecorate %36 Block OpDecorate %38 DescriptorSet 0 OpDecorate %38 Binding 1 %2 = OpTypeVoid %3 = OpTypeFunction %2 %6 = OpTypeInt 32 0 %7 = OpTypePointer Function %6 %9 = OpConstant %6 2 %10 = OpTypeArray %6 %9 %11 = OpTypeStruct %10 %12 = OpTypePointer Uniform %11 %13 = OpVariable %12 Uniform %14 = OpTypeInt 32 1 %15 = OpConstant %14 0 %16 = OpConstant %14 1 %17 = OpTypePointer Uniform %6 %20 = OpConstant %6 1 %21 = OpTypeStruct %6 %6 %27 = OpTypeBool %31 = OpTypeFloat 32 %32 = OpTypeVector %31 4 %33 = OpTypePointer Output %32 %34 = OpVariable %33 Output %35 = OpTypeArray %14 %9 %36 = OpTypeStruct %35 %37 = OpTypePointer Uniform %36 %38 = OpVariable %37 Uniform %39 = OpTypePointer Uniform %14 %4 = OpFunction %2 None %3 %5 = OpLabel %8 = OpVariable %7 Function %18 = OpAccessChain %17 %13 %15 %16 %19 = OpLoad %6 %18 OpStore %8 %19 %22 = OpIAddCarry %21 %20 %20 %23 = OpCompositeExtract %6 %22 1 OpStore %8 %23 %24 = OpCompositeExtract %6 %22 0 %25 = OpAccessChain %17 %13 %15 %15 %26 = OpLoad %6 %25 %28 = OpIEqual %27 %24 %26 OpSelectionMerge %30 None OpBranchConditional %28 %29 %52 %29 = OpLabel %40 = OpAccessChain %39 %38 %15 %15 %41 = OpLoad %14 %40 %42 = OpConvertSToF %31 %41 %43 = OpLoad %6 %8 %44 = OpConvertUToF %31 %43 %45 = OpAccessChain %39 %38 %15 %16 %46 = OpLoad %14 %45 %47 = OpConvertSToF %31 %46 %48 = OpAccessChain %39 %38 %15 %15 %49 = OpLoad %14 %48 %50 = OpConvertSToF %31 %49 %51 = OpCompositeConstruct %32 %42 %44 %47 %50 OpStore %34 %51 OpBranch %30 %52 = OpLabel %53 = OpAccessChain %39 %38 %15 %16 %54 = OpLoad %14 %53 %55 = OpConvertSToF %31 %54 %56 = OpCompositeConstruct %32 %55 %55 %55 %55 OpStore %34 %56 OpBranch %30 %30 = OpLabel OpReturn OpFunctionEnd
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_21829_159.asm
ljhsiun2/medusa
9
84588
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r8 push %rax push %rcx push %rsi lea addresses_A_ht+0x11a84, %r13 nop nop nop and %r11, %r11 vmovups (%r13), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $0, %xmm5, %rcx nop nop nop nop nop add %rax, %rax lea addresses_A_ht+0xe0c4, %rsi nop nop nop cmp %rax, %rax movb (%rsi), %r12b nop nop nop nop add %rax, %rax lea addresses_UC_ht+0x159c4, %rax nop nop and %rsi, %rsi and $0xffffffffffffffc0, %rax vmovaps (%rax), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $1, %xmm3, %r13 nop nop xor $46106, %rcx lea addresses_D_ht+0xfe14, %r13 nop nop nop nop nop cmp $41659, %r11 movl $0x61626364, (%r13) nop nop cmp $57998, %rcx lea addresses_D_ht+0xe3c4, %rsi nop nop cmp $57208, %r8 mov $0x6162636465666768, %rax movq %rax, %xmm3 vmovups %ymm3, (%rsi) nop nop nop nop dec %rcx lea addresses_normal_ht+0x13ed9, %r8 add $2928, %rsi mov $0x6162636465666768, %rax movq %rax, (%r8) nop nop nop nop nop and %rax, %rax pop %rsi pop %rcx pop %rax pop %r8 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r12 push %r15 push %r8 push %r9 push %rax push %rbp push %rdi // Store lea addresses_US+0x18dc4, %rax nop nop nop cmp %r9, %r9 movb $0x51, (%rax) nop nop nop cmp %rax, %rax // Store lea addresses_PSE+0xbfc4, %r15 nop nop and $42765, %rdi movw $0x5152, (%r15) nop sub $64243, %rax // Store lea addresses_normal+0x1b38, %r9 nop nop nop nop nop cmp %rdi, %rdi movw $0x5152, (%r9) xor %r12, %r12 // Store lea addresses_D+0xfc4, %r15 nop nop nop nop sub $37586, %rbp mov $0x5152535455565758, %r8 movq %r8, %xmm5 movups %xmm5, (%r15) nop nop nop nop and $15553, %rax // Faulty Load lea addresses_PSE+0x77c4, %r8 nop nop xor %r9, %r9 vmovups (%r8), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $0, %xmm7, %r12 lea oracles, %r15 and $0xff, %r12 shlq $12, %r12 mov (%r15,%r12,1), %r12 pop %rdi pop %rbp pop %rax pop %r9 pop %r8 pop %r15 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': True, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': True, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_US'}} {'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_PSE'}} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal'}} {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_D'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 7, 'AVXalign': True, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 8, 'AVXalign': True, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_normal_ht'}} {'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 */
test/Succeed/Issue1650.agda
cruhland/agda
1,989
2890
<reponame>cruhland/agda -- Andreas, 2015-09-18 Andreas, reported by Andrea -- {-# OPTIONS -v impossible:10 #-} -- {-# OPTIONS -v tc.cover.splittree:10 #-} -- {-# OPTIONS -v tc.cc:30 #-} open import Common.Bool open import Common.Product open import Common.Equality postulate A : Set a : A Works : A × A → Bool → A Works (x , y) true = y Works d false = a works : ∀{x y} → Works (x , y) false ≡ a works = refl Test : A × (A × A) → Bool → A Test (x , (y , z)) true = z Test d false = a test : ∀{x y z} → Test (x , (y , z)) false ≡ a test = refl -- ERROR WAS: -- An internal error has occurred. Please report this as a bug. -- Location of the error: src/full/Agda/TypeChecking/CompiledClause/Match.hs:189 -- Behavior of clause compiler WAS: -- splitting on 0 after expandCatchAlls True: -- (x,(y,z)) true -> z -- (_,_) false -> a -- _ false -> a -- splitting on 1 after expandCatchAlls False: -- d false -> a -- splitting on 1 after expandCatchAlls False: <== NOW: True -- x (y,z) true -> z -- _ (_,_) false -> a <== WAS MISSING -- _ _ false -> a -- splitting on 2 after expandCatchAlls False: -- _ _ false -> a -- splitting on 3 after expandCatchAlls False: -- x y z true -> z -- x y z false -> a <== WAS MISSING
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c9/c97201e.ada
best08618/asylo
7
7487
<reponame>best08618/asylo<gh_stars>1-10 -- C97201E.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT A RENDEZVOUS REQUESTED BY A CONDITIONAL_ENTRY_CALL -- IS PERFORMED ONLY IF IMMEDIATELY POSSIBLE. -- CASE E: THE BODY OF THE TASK CONTAINING THE CALLED ENTRY -- DOES NOT CONTAIN AN ACCEPT_STATEMENT FOR THAT ENTRY - -- AND THIS FACT CAN NOT BE DETERMINED STATICALLY. -- (THE ENTRY BELONGS TO AN ENTRY FAMILY; SOME FAMILY MEMBERS -- ARE "ACCEPTABLE", BUT NOT THE CALLED ONE.) -- RM 4/13/82 WITH REPORT; USE REPORT; PROCEDURE C97201E IS ELSE_BRANCH_TAKEN : BOOLEAN := FALSE ; BEGIN TEST ("C97201E", "CHECK THAT NO RENDEZVOUS REQUESTED BY" & " A CONDITIONAL_ENTRY_CALL CAN EVER OCCUR" & " IN THE ABSENCE OF A CORRESPONDING " & " ACCEPT_STATEMENT " ); DECLARE SUBTYPE SHORT IS INTEGER RANGE 10..20 ; KEEP_ALIVE : INTEGER := 15 ; TASK T IS ENTRY DO_IT_NOW_ORELSE ( SHORT ) ; END T ; TASK BODY T IS BEGIN -- NO ACCEPT_STATEMENT FOR THE ENTRY_CALL BEING TESTED ACCEPT DO_IT_NOW_ORELSE ( IDENT_INT(15) ); -- THIS ALSO PREVENTS THIS SERVER -- TASK FROM TERMINATING IF -- UPON ACTIVATION -- IT GETS TO RUN -- AHEAD OF THE CALLER (WHICH -- WOULD LEAD TO A SUBSEQUENT -- TASKING_ERROR AT THE TIME OF -- THE NO-WAIT CALL). END ; BEGIN SELECT T.DO_IT_NOW_ORELSE (10) ; -- ACCEPT_STATEMENT HAS 15 ELSE -- (I.E. CALLER ADOPTS A NO-WAIT POLICY) -- THEREFORE THIS BRANCH MUST BE CHOSEN ELSE_BRANCH_TAKEN := TRUE ; COMMENT( "ELSE_BRANCH TAKEN" ); END SELECT; T.DO_IT_NOW_ORELSE(KEEP_ALIVE) ;-- THIS ALSO UPDATES NONLOCALS END; -- END OF BLOCK CONTAINING THE ENTRY CALL -- BY NOW, THE TASK IS TERMINATED IF ELSE_BRANCH_TAKEN THEN NULL ; ELSE FAILED( "RENDEZVOUS ATTEMPTED?" ); END IF; RESULT; END C97201E ;
programs/oeis/048/A048896.asm
neoneye/loda
22
89371
<filename>programs/oeis/048/A048896.asm<gh_stars>10-100 ; A048896: a(n) = 2^(A000120(n+1) - 1), n >= 0. ; 1,1,2,1,2,2,4,1,2,2,4,2,4,4,8,1,2,2,4,2,4,4,8,2,4,4,8,4,8,8,16,1,2,2,4,2,4,4,8,2,4,4,8,4,8,8,16,2,4,4,8,4,8,8,16,4,8,8,16,8,16,16,32,1,2,2,4,2,4,4,8,2,4,4,8,4,8,8,16,2,4,4,8,4,8,8,16,4,8,8,16,8,16,16,32,2,4,4,8,4 seq $0,48881 ; a(n) = A000120(n+1) - 1 = wt(n+1) - 1. mov $1,2 pow $1,$0 mov $0,$1
alloy4fun_models/trainstlt/models/5/PXkMwy4ga2bas5JHH.als
Kaixi26/org.alloytools.alloy
0
4984
<gh_stars>0 open main pred idPXkMwy4ga2bas5JHH_prop6 { always (all s:Signal | always (s in Green) implies eventually (s not in Green ) or always s not in Green implies eventually (s in Green) ) } pred __repair { idPXkMwy4ga2bas5JHH_prop6 } check __repair { idPXkMwy4ga2bas5JHH_prop6 <=> prop6o }
oeis/234/A234506.asm
neoneye/loda-programs
11
9812
; A234506: a(n) = binomial(9*n+3, n)/(3*n+1). ; Submitted by <NAME> ; 1,3,30,406,6327,107019,1909908,35399520,674842149,13147742322,260626484118,5239783981320,106585537781775,2189670831627678,45366284782209600,946815917066740800,19887218367823853937,420076689292591271325,8917736795123409615060,190161017612160607167948,4071301730663135449185705,87482752526767915126257195,1886011700221578007853938800,40782473900593864388156581920,884301274289960703919665166545,19223300599505379918282598488684,418862439332284136629589229385692,9146499204655088751232186120719720 sub $1,$0 mul $0,8 add $0,2 sub $1,1 bin $1,$0 add $0,1 mul $1,3 div $1,$0 mov $0,$1
oeis/041/A041930.asm
neoneye/loda-programs
11
165313
<gh_stars>10-100 ; A041930: Numerators of continued fraction convergents to sqrt(488). ; Submitted by <NAME> ; 22,243,10714,118097,5206982,57394899,2530582538,27893802817,1229857906486,13556330774163,597708411969658,6588348862440401,290485058359347302,3201923990815260723,141175140654230819114,1556128471187354270977,68610827872897818742102,756275235073063360434099,33344721171087685677842458,367548208117037605816701137,16205465878320742341612692486,178627672869645203363556318483,7875823072142709690338090705738,86812681466439451797082554081601,3827633807595478588761970470296182 add $0,1 mov $3,1 lpb $0 sub $0,1 add $2,$3 mov $3,$1 mov $1,$2 dif $2,4 mul $2,22 add $3,$2 lpe mov $0,$3