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
wof/lcs/123p/A8.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
6
28123
copyright zengfr site:http://github.com/zengfr/romhack 01A74C dbra D7, $1a74a 01A75E dbra D4, $1a75c 01AA8E tst.b ($a8,A0) [123p+ 78] 01AA92 beq $1aa98 0214AA bne $214f0 copyright zengfr site:http://github.com/zengfr/romhack
fastmodel-parser/src/main/antlr4/imports/QueryParser.g4
alibaba/fast-modeling-language
9
382
<reponame>alibaba/fast-modeling-language parser grammar QueryParser; queryOrInsertStatements: query | insertInto | delete ; query : with? queryNoWith ; insertInto : KW_INSERT (KW_INTO | KW_OVERWRITE) tableName partitionSpec? columnParenthesesList? query ; delete: KW_DELETE deleteType? KW_FROM qualifiedName KW_WHERE expression ; deleteType : KW_TABLE | indicatorType? KW_INDICATOR ; with : KW_WITH KW_RECURSIVE? namedQuery (COMMA namedQuery)* ; queryNoWith: queryTerm (KW_ORDER KW_BY sortItem (COMMA sortItem)*)? (KW_OFFSET offset=rowCount (KW_ROW | KW_ROWS)?)? ((KW_LIMIT limit=limitRowCount) | (KW_FETCH (KW_FIRST | KW_NEXT) (fetchFirst=rowCount)? (KW_ROW | KW_ROWS) (KW_ONLY | KW_WITH KW_TIES)))? ; limitRowCount : KW_ALL | rowCount ; rowCount : INTEGER_VALUE | '?' ; queryTerm : queryPrimary #queryTermDefault | left=queryTerm operator=KW_INTERSECT setQuantifier? right=queryTerm #setOperation | left=queryTerm operator=(KW_UNION | KW_EXCEPT) setQuantifier? right=queryTerm #setOperation ; queryPrimary : querySpecification #queryPrimaryDefault | KW_TABLE qualifiedName #table | KW_VALUES expression (COMMA expression)* #inlineTable | LPAREN queryNoWith RPAREN #subquery ; sortItem : expression ordering=(KW_ASC | KW_DESC)? (KW_NULLS nullOrdering=(KW_FIRST | KW_LAST))? ; querySpecification : KW_SELECT (hints=hint)? setQuantifier? selectItem (',' selectItem)* (KW_FROM relation (COMMA relation)*)? (KW_WHERE where=expression)? (KW_GROUP KW_BY groupBy)? (KW_HAVING having=expression)? ; hint : HINT_START hintStatements+=hintStatement (COMMA? hintStatements+=hintStatement)* HINT_END ; hintStatement : hintName=identifier | hintName=identifier LPAREN parameters+=expression (COMMA parameters+=expression)* RPAREN ; groupBy : setQuantifier? groupingElement (COMMA groupingElement)* ; groupingElement : groupingSet #singleGroupingSet | KW_ROLLUP LPAREN (expression (COMMA expression)*)? RPAREN #rollup | KW_CUBE LPAREN (expression (COMMA expression)*)? RPAREN #cube | KW_GROUPING KW_SETS LPAREN groupingSet (COMMA groupingSet)* RPAREN #multipleGroupingSets ; groupingSet : LPAREN (expression (COMMA expression)*)? RPAREN | expression ; namedQuery : name=identifier (columnAliases)? KW_AS LPAREN query RPAREN ; setQuantifier : KW_DISTINCT | KW_ALL ; selectItem : expression (KW_AS? identifier)? #selectSingle | atomExpression DOT STAR (KW_AS columnAliases)? #selectAll | STAR #selectAll ; relation : left=relation ( KW_CROSS KW_JOIN right=sampledRelation | joinType KW_JOIN rightRelation=relation joinCriteria | KW_NATURAL joinType KW_JOIN right=sampledRelation ) #joinRelation | sampledRelation #relationDefault ; joinType : KW_INNER? | KW_LEFT KW_OUTER? | KW_RIGHT KW_OUTER? | KW_FULL KW_OUTER? ; joinCriteria : KW_ON expression | KW_USING LPAREN identifier (COMMA identifier)* RPAREN ; sampledRelation : aliasedRelation ( KW_TABLESAMPLE sampleType LPAREN percentage=expression RPAREN )? ; sampleType : KW_BERNOULLI | KW_SYSTEM ; aliasedRelation : relationPrimary (KW_AS? identifierWithoutSql11 columnAliases?)? ; columnAliases : LPAREN identifier (COMMA identifier)* RPAREN ; relationPrimary : qualifiedName #tableQualifiedName | LPAREN query RPAREN #subqueryRelation | KW_UNNEST LPAREN expression (COMMA expression)* RPAREN (KW_WITH KW_ORDINALITY)? #unnest | KW_LATERAL LPAREN query RPAREN #lateral | LPAREN relation RPAREN #parenthesizedRelation ;
programs/oeis/153/A153388.asm
karttu/loda
0
1446
; A153388: Second bisection of A153382. ; 8,18,48,128,338,888,2328,6098,15968,41808,109458,286568,750248,1964178,5142288,13462688,35245778,92274648,241578168,632459858,1655801408,4334944368,11349031698,29712150728,77787420488,203650110738,533162911728,1395838624448,3654352961618,9567220260408,25047307819608,65574703198418,171676801775648,449455702128528,1176690304609938,3080615211701288,8065155330493928 mov $1,10 lpb $0,1 sub $0,1 add $2,$1 add $1,$2 lpe sub $1,2
Alfred.alfredpreferences/workflows/user.workflow.57AC4A4C-4014-4999-9DE4-B0A065844E60/Helper.applescript
maxrothman/config
0
67
property WHITE_SPACES : { character id 9, character id 10, character id 11, character id 12, ¬ character id 13, character id 32, character id 133, character id 160 } on strip(s) if s is equal to "" then return s end if repeat while first character of s is in WHITE_SPACES try set s to text 2 through -1 of s on error return "" end try end repeat repeat while last character of s is in WHITE_SPACES set s to text 1 through -2 of s end repeat return s end strip on replace(str, oldsubstr, newsubstr) # разбиваем set old_delimiter to text item delimiters of AppleScript set text item delimiters of AppleScript to oldsubstr set parts to every text item of str # собираем set text item delimiters of AppleScript to newsubstr set str to parts as text set text item delimiters of AppleScript to old_delimiter return str end on create_xmloutput() script XMLOutput property item_tags : {} on create_item(attributes) script XMLItemTag property attributes : {} property title_tag : missing value property subtitle_tags : {} property icon_tag : missing value property text_tags : {} on create_title(value) script XMLTitleTag property value : missing value on is_empty() return length of value is 0 end is_empty on build_xml(indent) return indent & "<title>" & escape_text_value(my value) & "</title>\n" end build_xml end script set XMLTitleTag's value to (value as text) set my title_tag to XMLTitleTag return XMLTitleTag end create_title on create_subtitle(value, modifier) script XMLSubtitleTag property value : missing value property modifier : missing value on is_empty() return length of value is 0 end is_empty on build_xml(indent) set opening_tag to "<subtitle" if my modifier is not missing value then set opening_tag to opening_tag & " mod=\"" & my modifier & "\"" end if set opening_tag to opening_tag & ">" set closing_tag to "</subtitle>\n" return indent & opening_tag & escape_text_value(my value) & closing_tag end build_xml end script set XMLSubtitleTag's value to (value as text) if modifier is not missing value then set modifier to modifier as text if modifier is in { "shift", "fn", "ctrl", "alt", "cmd" } then set XMLSubtitleTag's modifier to modifier else error "Incorrect subtitle modifier value" number 13 end if end if set end of my subtitle_tags to XMLSubtitleTag return XMLSubtitleTag end on create_icon(value, type) script XMLIconTag property value : missing value property type : missing value on build_xml(indent) set opening_tag to "<icon" if my type is not missing value then set opening_tag to opening_tag & " type=\"" & my type & "\"" end if set opening_tag to opening_tag & ">" set closing_tag to "</icon>\n" return indent & opening_tag & escape_text_value(my value) & closing_tag end build_xml end script set XMLIconTag's value to (value as text) if type is not missing value then set type to (type as text) if type is in { "fileicon", "filetype" } then set XMLIconTag's type to type else error "Incorrect icon type value" number 13 end if end if set my icon_tag to XMLIconTag return XMLIconTag end create_icon on create_text(value, type) script XMLTextTag property value : missing value property type : missing value on build_xml(indent) set opening_tag to "<text" if my type is not missing value then set opening_tag to opening_tag & " type=\"" & my type & "\"" end if set opening_tag to opening_tag & ">" set closing_tag to "</text>\n" return indent & opening_tag & escape_text_value(my value) & closing_tag end build_xml end script set XMLTextTag's value to (value as text) set type to (type as text) if type is not in { "copy", "largetype" } then error "Incorrect text type value" number 13 end if set XMLTextTag's type to type set end of my text_tags to XMLTextTag return XMLTextTag end create_text on create_bothtype_text(value) return { my create_text(value, "copy"), ¬ my create_text(value, "largetype") } end create_bothtype_text on build_xml(indent) set opening_tag to indent & "<item" repeat with attribute in my attributes set opening_tag to opening_tag & " " & ¬ name of attribute & "=\"" & ¬ escape_attribute_value(value of attribute) & "\" " end repeat set opening_tag to opening_tag & ">\n" set next_indent to indent & (first character of indent) if my title_tag is not missing value then set inner_xml to (my title_tag)'s build_xml(next_indent) else error "Item tag should have title tag" number 13 end if repeat with subtitle_tag in my subtitle_tags set inner_xml to inner_xml & subtitle_tag's build_xml(next_indent) end repeat if my icon_tag is not missing value then set inner_xml to inner_xml & (my icon_tag)'s build_xml(next_indent) end if repeat with text_tag in my text_tags set inner_xml to inner_xml & text_tag's build_xml(next_indent) end repeat set closing_tag to indent & "</item>\n" return opening_tag & inner_xml & closing_tag end build_xml end script try set uid to (uid of attributes) as text set end of XMLItemTag's attributes to { name: "uid", value: uid } on error msg number n if n is not in { -1728, -1700 } then error msn number n end if end try set arg to (arg of attributes) as text set end of XMLItemTag's attributes to { name: "arg", value: arg} on error msg number n if n is not in { -1728, -1700 } then error msn number n end if end try set valid to valid of attributes if (class of valid is boolean and valid is true) or valid is "YES" then set end of XMLItemTag's attributes to { name: "valid", value: "YES" } else if (class of valid is boolean and valid is false) or valid is "NO" then set end of XMLItemTag's attributes to { name: "valid", value: "NO" } else error "Incorrect value in valid attribute" number 13 end if on error number -1728 end try set autocomplete to (autocomplete of attributes) as text set end of XMLItemTag's attributes to { name: "autocomplete", value: autocomplete } on error msg number n if n is not in { -1728, -1700 } then error msn number n end if end try set type to (type of attributes) as text if type is in { "default" , "file", "file:skipcheck" } then set end of XMLItemTag's attributes to { name: "type", value: type} end if on error msg number n if n is not in { -1728, -1700 } then error msn number n end if end set end of my item_tags to XMLItemTag return XMLItemTag end on escape_text_value(value) set value to replace(value, "<", "&lt;") set value to replace(value, ">", "&gt;") set value to replace(value, "&", "&amp;") return value end escape_text_value on escape_attribute_value(value) set value to escape_text_value(value) set value to replace(value, "'", "&apos;") set value to replace(value, "\"", "&quot;") return value end escape_attribute_value on total_item_count() return length of (my item_tags) end total_item_count on visible_item_count() set item_count to 0 repeat with item_tag in (my item_tags) set subtitle_without_mod to missing value repeat with subtitle_tag in reverse of (subtitle_tags of item_tag) if (modifier of subtitle_tag is missing value) then set subtitle_without_mod to subtitle_tag exit repeat end if end repeat if (title_tag of item_tag is not missing value) and ¬ not (title_tag of item_tag)'s is_empty() or ¬ (subtitle_without_mod is not missing value) and ¬ not subtitle_without_mod's is_empty() then set item_count to item_count + 1 end if end repeat return item_count end visible_item_count on build_xml() set xml to "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<items>\n" repeat with item_tag in my item_tags set xml to xml & item_tag's build_xml("\t") end repeat set xml to xml & "</items>\n" return xml end build_xml end script end create_xmloutput
programs/oeis/196/A196226.asm
jmorken/loda
1
9832
; A196226: m such that A054024(m) (sum of divisors of m reduced modulo m) is 3 + m/2. ; 8,10,14,22,26,34,38,46,58,62,74,82,86,94,106,118,122,134,142,146,158,166,178,194,202,206,214,218,226,254,262,274,278,298,302,314,326,334,346,358,362,382,386,394,398,422,446,454,458,466,478,482,502,514 add $0,1 cal $0,140777 ; a(n) = 2*prime(n) - 4. mov $1,-1 mov $2,$0 sub $2,1 div $2,2 add $1,$2 add $1,1 trn $1,1 mul $1,2 add $1,8
lib/crt/classic/crt_section.asm
Toysoft/z88dk
0
245791
; Memory map and section setup ; ; Contains the generic variables + features ; ; crt_model = 0 ; everything in RAM ; crt_model = 1 ; ROM model, data section copied ; crt_model = 2 ; ROM model, data section compressed SECTION CODE SECTION code_crt_init crt0_init_bss: EXTERN __BSS_head EXTERN __BSS_END_tail IF CRT_INITIALIZE_BSS = 1 ld hl,__BSS_head ld de,__BSS_head + 1 ld bc,__BSS_END_tail - __BSS_head - 1 xor a ld (hl),a ldir ELSE xor a ENDIF ; a = 0 - reset exitcount ld (exitcount),a IF CRT_ENABLE_STDIO = 1 ; Setup std* streams ld hl,__sgoioblk+2 ld (hl),19 ;stdin ld hl,__sgoioblk+12 ld (hl),21 ;stdout ld hl,__sgoioblk+22 ld (hl),21 ;stderr ENDIF IF DEFINED_USING_amalloc ld hl,__BSS_END_tail ld (_heap),hl ENDIF IF ( __crt_model & 1 ) ; Just copy the DATA section EXTERN __ROMABLE_END_tail EXTERN __DATA_head EXTERN __DATA_END_tail ld hl,__ROMABLE_END_tail ld de,__DATA_head ld bc,__DATA_END_tail - __DATA_head ldir ENDIF IF ( __crt_model & 2 ) ; Decompress the DATA section EXTERN __ROMABLE_END_tail EXTERN __DATA_head EXTERN asm_dzx7_standard ld hl,__ROMABLE_END_tail ld de,__DATA_head call asm_dzx7_standard ENDIF ; SDCC initialiation code gets placed here SECTION code_crt_exit ret SECTION code_driver SECTION code_compiler SECTION code_clib SECTION code_crt0_sccz80 SECTION code_l SECTION code_l_sdcc SECTION code_l_sccz80 SECTION code_compress_zx7 SECTION code_ctype SECTION code_esxdos SECTION code_fp SECTION code_fp_math48 SECTION code_math SECTION code_error SECTION code_stdlib SECTION code_string SECTION code_adt_b_array SECTION code_adt_b_vector SECTION code_adt_ba_priority_queue SECTION code_adt_ba_stack SECTION code_adt_bv_priority_queue SECTION code_adt_bv_stack SECTION code_adt_p_forward_list SECTION code_adt_p_forward_list_alt SECTION code_adt_p_list SECTION code_adt_p_queue SECTION code_adt_p_stack SECTION code_adt_w_array SECTION code_adt_w_vector SECTION code_adt_wa_priority_queue SECTION code_adt_wa_stack SECTION code_adt_wv_priority_queue SECTION code_adt_wv_stack SECTION code_alloc_balloc SECTION code_alloc_obstack SECTION code_arch SECTION code_font SECTION code_font_fzx SECTION code_z80 SECTION code_user SECTION rodata_fp SECTION rodata_compiler SECTION rodata_clib SECTION rodata_user SECTION rodata_font SECTION rodata_font_fzx SECTION rodata_font_4x8 SECTION rodata_font_8x8 SECTION ROMABLE_END IF !__crt_model SECTION DATA SECTION smc_clib SECTION smc_user SECTION data_clib SECTION data_stdlib SECTION data_crt SECTION data_compiler SECTION data_user SECTION data_alloc_balloc SECTION DATA_END ENDIF SECTION BSS IF __crt_org_bss org __crt_org_bss defb 0 ; control name of bss binary ENDIF SECTION bss_fp SECTION bss_error SECTION bss_crt IF CRT_ENABLE_STDIO = 1 IF !DEFINED_CLIB_FOPEN_MAX DEFC CLIB_FOPEN_MAX = 10 ENDIF PUBLIC __sgoioblk PUBLIC __sgoioblk_end PUBLIC __FOPEN_MAX defc __FOPEN_MAX = CLIB_FOPEN_MAX __sgoioblk: defs CLIB_FOPEN_MAX * 10 ;stdio control block __sgoioblk_end: ;end of stdio control block ENDIF PUBLIC base_graphics PUBLIC exitsp PUBLIC exitcount IF !DEFINED_basegraphics base_graphics: defw 0 ;Address of graphics map ENDIF exitsp: defw 0 ;atexit() stack exitcount: defb 0 ;Number of atexit() routines IF DEFINED_USING_amalloc PUBLIC _heap ; The heap pointer will be wiped at startup, ; but first its value (based on __tail) ; will be kept for sbrk() to setup the malloc area _heap: defw 0 ; Initialised by code_crt_init - location of the last program byte defw 0 ENDIF SECTION bss_fardata IF __crt_org_bss_fardata_start org __crt_org_bss_fardata_start ENDIF SECTION bss_compiler IF __crt_org_bss_compiler_start org __crt_org_bss_compiler_start ENDIF SECTION bss_clib SECTION bss_string SECTION bss_alloc_balloc SECTION bss_user IF __crt_model > 0 SECTION DATA org -1 defb 0 ; control name of data binary SECTION smc_clib SECTION smc_user SECTION data_clib SECTION data_crt SECTION data_stdlib SECTION data_compiler SECTION data_user SECTION data_alloc_balloc SECTION DATA_END ENDIF SECTION BSS_END IF CLIB_BALLOC_TABLE_SIZE > 0 ; create balloc table SECTION data_clib SECTION data_alloc_balloc PUBLIC __balloc_array __balloc_array: defw __balloc_table SECTION bss_clib SECTION bss_alloc_balloc __balloc_table: defs CLIB_BALLOC_TABLE_SIZE * 2 ENDIF IF CRT_APPEND_MMAP INCLUDE "./mmap.inc" ENDIF
programs/oeis/179/A179645.asm
neoneye/loda
22
24421
<filename>programs/oeis/179/A179645.asm ; A179645: a(n) = prime(n)^8. ; 256,6561,390625,5764801,214358881,815730721,6975757441,16983563041,78310985281,500246412961,852891037441,3512479453921,7984925229121,11688200277601,23811286661761,62259690411361,146830437604321,191707312997281,406067677556641,645753531245761,806460091894081,1517108809906561,2252292232139041,3936588805702081,7837433594376961,10828567056280801,12667700813876161,17181861798319201,19925626416901921,26584441929064321,67675234241018881,86730203469006241,124097929967680321,139353667211683681,242935032749128801,270281038127131201,369145194573386401,498311414318121121,604967116961135041,802359178476091681,1053960288888713761,1151936657823500641,1771197285652216321,1925122952918976001,2268453123948987361,2459374191553118401,3928797478390152481,6115597639891380481,7050287992278341281,7562821648920027361,8686550888106661441,10645920227784266881,11379844838561358721,15753961211814252001,19031147999601100801,22890010290541014721,27416893182581291041,29090710405024191361,34660765693554192481,38873223852623509441,41142576392052822241,54317648809320741601,78905450517641748001,87515123947429289281,92120163556986851521,101970394089246452641,144086718355753023841,166356282569519253121,210201493946988852961,220091573675539927201,241100240228887100161,275902470085864489921,329100478707380211841,374688750722402006881,425709831200577608161,463009808974713123841,524320466699664691681,617055253404346928161,668582463235588483201,783044537099820227521,949975016173736007841,986862773243512270561,1190743340458931072641,1235671900522439264641,1379482393624495913281,1483302776945927340001,1651850457757840166401,1902521619229098849601,2039893072616309544481,2111776380545833921921,2262221077832419710241,2771303608864315695361,3163965138861484662721,3377940044732998170721,3844185754368006996001,4097735106081111754561,4505492371457261922721,5428774300687024023361,5597750158724835773281,7338006985513707753121 seq $0,6005 ; The odd prime numbers together with 1. max $0,2 pow $0,8
test/Succeed/Issue5565.agda
cagix/agda
1,989
10304
variable ℓ : _ A : Set ℓ
libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sccz80/tshc_cls_wc_pix.asm
Frodevan/z88dk
640
86225
; void tshc_cls_wc_pix(struct r_Rect8 *r, uchar pix) SECTION code_clib SECTION code_arch PUBLIC tshc_cls_wc_pix EXTERN asm_tshc_cls_wc_pix tshc_cls_wc_pix: pop af pop hl pop ix push hl push hl push af jp asm_tshc_cls_wc_pix ; SDCC bridge for Classic IF __CLASSIC PUBLIC _tshc_cls_wc_pix defc _tshc_cls_wc_pix = tshc_cls_wc_pix ENDIF
programs/oeis/017/A017524.asm
neoneye/loda
22
6570
; A017524: (12n)^4. ; 0,20736,331776,1679616,5308416,12960000,26873856,49787136,84934656,136048896,207360000,303595776,429981696,592240896,796594176,1049760000,1358954496,1731891456,2176782336 pow $0,4 mul $0,20736
programs/oeis/145/A145027.asm
neoneye/loda
22
173813
<reponame>neoneye/loda<gh_stars>10-100 ; A145027: a(n) = a(n-1) + a(n-2) + a(n-3) with a(1) = 2, a(2) = 3, a(3) = 4. ; 2,3,4,9,16,29,54,99,182,335,616,1133,2084,3833,7050,12967,23850,43867,80684,148401,272952,502037,923390,1698379,3123806,5745575,10567760,19437141,35750476,65755377,120942994,222448847,409147218,752539059,1384135124,2545821401,4682495584,8612452109,15840769094,29135716787,53588937990,98565423871,181290078648,333444440509,613299943028,1128034462185,2074778845722,3816113250935,7018926558842,12909818655499,23744858465276,43673603679617,80328280800392,147746742945285,271748627425294,499823651170971,919319021541550,1690891300137815,3110033972850336,5720244294529701,10521169567517852,19351447834897889,35592861696945442,65465479099361183,120409788631204514,221468129427511139,407343397158076836,749221315216792489,1378032841802380464,2534597554177249789,4661851711196422742,8574482107176052995,15770931372549725526,29007265190922201263,53352678670647979784,98130875234119906573,180490819095690087620,331974373000457973977,610596067330267968170,1123061259426416029767,2065631699757141971914,3799289026513825969851,6987981985697383971532,12852902711968351913297,23640173724179561854680,43481058421845297739509,79974134857993211507486,147095367004018071101675,270550560283856580348670,497620062145867862957831,915265989433742514408176,1683436611863466957714677,3096322663443077335080684,5695025264740286807203537,10474784540046831099998898,19266132468230195242283119,35435942273017313149485554,65176859281294339491767571,119878934022541847883536244,220491735576853500524789369 lpb $0 mov $2,$0 sub $0,1 seq $2,141523 ; Expansion of (3-2*x-3*x^2)/(1-x-x^2-x^3). add $1,$2 lpe add $1,2 mov $0,$1
Assembly/Microprocessor/CombinedPattern_02-All.asm
TashreefMuhammad/University_Miscellaneous_Codes
3
91868
<gh_stars>1-10 CODE SEGMENT ASSUME CS:CODE,DS:CODE,ES:CODE,SS:CODE PPIC_C EQU 1EH PPIC EQU 1CH PPIB EQU 1AH PPIA EQU 18H PPIC_C1 EQU 1FH PPIC1 EQU 1DH PPIB1 EQU 1BH PPIA1 EQU 19H ORG 1000H MOV AL,10000000B OUT PPIC_C,AL OUT PPIC_C1,AL MOV AL, 11111111B OUT PPIC,AL OUT PPIB,AL OUT PPIA1,AL MOV AL,11110000B OUT PPIB1,AL MOV AL,00000000B OUT PPIC1,AL START: MOV BL,11111110B MOV DL,11110001B MOV SI,OFFSET DATA L2: MOV AL,BL OUT PPIA,Al CALL TIMER STC ROL BL,1 JC Le2 JMP L1 L1: MOV BL,11111110B JMP Le2 Le2: MOV AL,DL OUT PPIB1,al CALL TIMER SHL DL,1 TEST DL,00010000B JNZ Le1 OR DL,11110000B JMP Lf1 Le1: MOV DL,11110001B JMP Lf1 Lf1: MOV BH,BYTE PTR CS:[SI] CMP BH,10010000B JE Lf2 MOV AH,BH OUT PPIA1,AL CALL TIMER INC SI JMP L2 Lf2: MOV AL,BH OUT PPIA1,AL MOV SI,OFFSET DATA JMP L2 INT 3 TIMER: MOV CX,0FFFFH TIMER1: NOP NOP NOP NOP NOP NOP LOOP TIMER1 RET DATA: DB 11000000B DB 11111001B DB 10100100B DB 10110000B DB 10011001B DB 10010010B DB 10000010B DB 11111000B DB 10000000B DB 10010000B DB 00000000B CODE ENDS END
src/main/kotlin/convergence/command.g4
moomoomoo309/convergenceBot
1
6450
grammar command; // Parser Rules command: commandName Whitespace* (argument (Whitespace+ | EOF))* EOF; argument: quoteArgument | nonQuoteArgument; nonQuoteArgument: (Alnum | RegularEscape | UnicodeEscape | OctalEscape | InvalidEscape | NotWhitespaceOrQuote)+; quoteArgument: Quote notQuote* Quote; notQuote: RegularEscape | UnicodeEscape | OctalEscape | InvalidEscape | Alnum | Whitespace | NotWhitespaceOrQuote; commandName: Alnum+; // Lexer Rules RegularEscape: Backslash [tbnrf'"\\]; UnicodeEscape: Backslash U UnicodeDigit UnicodeDigit UnicodeDigit UnicodeDigit; OctalEscape: Backslash (ThreeHundredAndOver | TwoHundredOrLess); fragment ThreeHundredAndOver: THREE (SEVEN ZeroToSeven | ZeroToSix Number); fragment TwoHundredOrLess: ZeroToTwo Number Number | OneToNine Number | Number; InvalidEscape: Backslash (InvalidRegularEscape | InvalidUnicodeEscape | InvalidOctalEscape)?; fragment InvalidRegularEscape: ~[tbnrf'"\\u0-9]; fragment InvalidUnicodeEscape: U UnicodeDigit? UnicodeDigit? UnicodeDigit? NotUnicodeDigit | U UnicodeDigit UnicodeDigit? UnicodeDigit?; fragment InvalidOctalEscape: FourToNine Number Number | THREE EightOrNine Number | THREE SEVEN EightOrNine; Alnum: [a-zA-Z0-9]+; Whitespace: [\p{White_Space}]+; NotWhitespaceOrQuote: ~[\p{White_Space}"]+?; Quote: '"'; fragment THREE: '3'; fragment SEVEN: '7'; fragment ZeroToTwo: [0-2]; fragment ZeroToSix: [0-6]; fragment ZeroToSeven: [0-7]; fragment FourToNine: [4-9]; fragment EightOrNine: [89]; fragment OneToNine: [1-9]; fragment Number: [0-9]; fragment Backslash: '\\'; fragment U: 'u'; fragment UnicodeDigit: [0-9a-fA-F]; fragment NotUnicodeDigit: ~[0-9a-fA-F];
programs/oeis/000/A000210.asm
karttu/loda
0
175418
; A000210: A Beatty sequence: floor(n*(e-1)). ; 1,3,5,6,8,10,12,13,15,17,18,20,22,24,25,27,29,30,32,34,36,37,39,41,42,44,46,48,49,51,53,54,56,58,60,61,63,65,67,68,70,72,73,75,77,79,80,82,84,85,87,89,91,92,94,96,97,99,101,103,104,106,108,109,111,113,115,116,118,120,121,123,125,127,128,130,132,134,135,137,139,140,142,144,146,147,149,151,152,154,156,158,159,161,163,164,166,168,170,171,173,175,176,178,180,182,183,185,187,189,190,192,194,195,197,199,201,202,204,206,207,209,211,213,214,216,218,219,221,223,225,226,228,230,231,233,235,237,238,240,242,243,245,247,249,250,252,254,256,257,259,261,262,264,266,268,269,271,273,274,276,278,280,281,283,285,286,288,290,292,293,295,297,298,300,302,304,305,307,309,311,312,314,316,317,319,321,323,324,326,328,329,331,333,335,336,338,340,341,343,345,347,348,350,352,353,355,357,359,360,362,364,365,367,369,371,372,374,376,378,379,381,383,384,386,388,390,391,393,395,396,398,400,402,403,405,407,408,410,412,414,415,417,419,420,422,424,426,427,429 mov $5,$0 mov $6,$0 mul $6,2 add $6,1 add $0,$6 add $0,2 mov $3,2 mov $4,$0 mul $4,16 add $0,$4 mov $2,70 lpb $0,1 sub $0,1 sub $3,1 add $2,$3 div $0,$2 mov $1,1 mul $1,$0 mov $0,1 add $1,4 lpe sub $1,3 add $1,$5
programs/oeis/189/A189316.asm
neoneye/loda
22
22993
; A189316: Expansion of 5*(1-x-x^2)/((1+x)*(1-3*x+x^2)) ; 5,5,15,35,95,245,645,1685,4415,11555,30255,79205,207365,542885,1421295,3720995,9741695,25504085,66770565,174807605,457652255,1198149155,3136795215,8212236485,21499914245,56287506245,147362604495,385800307235,1010038317215 trn $0,1 seq $0,127546 ; a(n) = F(n)^2 + F(n+1)^2 + F(n+2)^2, where F(n) denotes the n-th Fibonacci number. div $0,2 mul $0,5
macscripts/App-Load.scpt
danielscholl/dotfiles
1
3324
tell application "Terminal" -- this will close terminals if already opened try quit end try delay 1 activate -- initial prompt display dialog "Installation Started... Do not close Terminals. Press OK to continue" -- sudo for initial authentication, if user does not have admin rights do script "sudo echo Document Scripting Installation Started" in front window display dialog "Enter System Password" default answer "" with hidden answer set the adminpass to the text returned of the result do script adminpass in front window do script "curl -s -O https://github-media-downloads.s3.amazonaws.com/osx/git-credential-osxkeychain" in front window repeat until busy of front window is false delay 1 end repeat do script "chmod u+x git-credential-osxkeychain" in front window repeat until busy of front window is false delay 1 end repeat do script "sudo mkdir /usr/local/bin" in front window repeat until busy of front window is false delay 1 end repeat do script "sudo chown $USER /usr/local/bin" in front window repeat until busy of front window is false delay 1 end repeat do script "mv git-credential-osxkeychain '/usr/local/bin/git-credential-osxkeychain'" in front window delay 4 do script "y" in front window repeat until busy of front window is false delay 1 end repeat display dialog "Enter Your EmailId" default answer "" set email_id to text returned of result repeat until busy of front window is false delay 1 end repeat do script "git config --global user.email" & " " & (get email_id) in front window repeat until busy of front window is false delay 1 end repeat display dialog "Enter Your FirstName" default answer "" set fname to text returned of result display dialog "Enter Your LastName" default answer "" set lname to text returned of result repeat until busy of front window is false delay 1 end repeat do script "git config --global user.name" & " '" & (get fname) & " " & (get lname) & "'" in front window repeat until busy of front window is false delay 1 end repeat do script "git config --global credential.helper osxkeychain" in front window repeat until busy of front window is false delay 1 end repeat do script "curl -sSL https://get.rvm.io | bash -s stable" in front window repeat until busy of front window is false delay 1 end repeat do script "source ~/.profile" in front window repeat until busy of front window is false delay 1 end repeat do script "rvm requirements" in front window delay 4 do script "" in front window delay 4 do script "" in front window delay 3 do script "rvm install ruby-stable" in front window repeat until busy of front window is false delay 1 end repeat do script "source ~/.bashrc" in front window repeat until busy of front window is false delay 1 end repeat do script "gem install bundle" in front window repeat until busy of front window is false delay 1 end repeat do script "mkdir -p ~/source" in front window repeat until busy of front window is false delay 1 end repeat do script "cd ~/source" in front window repeat until busy of front window is false delay 1 end repeat do script "git clone https://github.com/degnome/dotfiles.git" in front window repeat until busy of front window is false delay 1 end repeat do script "./dotfiles/bootstrap.sh" in front window delay 4 do script "y" in front window repeat until busy of front window is false delay 1 end repeat do script "exec bash" in front window delay 4 do script "gem install bundle" in front window repeat until busy of front window is false delay 1 end repeat do script "bundle install" in front window repeat until busy of front window is false delay 1 end repeat do script "cd ~" in front window repeat until busy of front window is false delay 1 end repeat do script "./brew.sh" in front window repeat until busy of front window is false delay 1 end repeat do script "./brewcask.sh" in front window repeat until busy of front window is false delay 1 end repeat do script "./.osx" in front window repeat until busy of front window is false delay 1 end repeat do script "exec bash" in front window delay 4 do script "curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash" in front window repeat until busy of front window is false delay 1 end repeat do script "nvm install stable" in front window repeat until busy of front window is false delay 1 end repeat do script "exec bash" in front window delay 4 do script "./nodemodules.sh" in front window repeat until busy of front window is false delay 1 end repeat do script "nvm ls" in front window repeat until busy of front window is false delay 1 end repeat do script "nvm install 6.9.1 -g" in front window repeat until busy of front window is false delay 1 end repeat do script "nvm ls" in front window repeat until busy of front window is false delay 1 end repeat do script "node -v" in front window repeat until busy of front window is false delay 1 end repeat display dialog "Installation Completed. Please verify terminal stack for installation. Press OK" quit end tell
alloy4fun_models/trashltl/models/15/qJPBWpRT8PtatjuTm.als
Kaixi26/org.alloytools.alloy
0
4364
<filename>alloy4fun_models/trashltl/models/15/qJPBWpRT8PtatjuTm.als open main pred idqJPBWpRT8PtatjuTm_prop16 { always all f:File | f in Protected implies always f in Protected } pred __repair { idqJPBWpRT8PtatjuTm_prop16 } check __repair { idqJPBWpRT8PtatjuTm_prop16 <=> prop16o }
Applications/Finder/set visible/run.applescript
looking-for-a-job/applescript-examples
1
1972
#!/usr/bin/osascript tell application "Finder" set visible of every process to false end tell tell application "Finder" set visible of every process ¬ whose visible is true and name is not "Finder" to false end tell delay 1 --repeat for sure tell application "Finder" set visible of every process ¬ whose visible is true and name is not "Finder" to false end tell tell application "Reminders" activate end tell
Task/Fork/Ada/fork.ada
LaudateCorpus1/RosettaCodeData
1
30064
with Ada.Text_IO, POSIX.Process_Identification, POSIX.Unsafe_Process_Primitives; procedure Fork is use Ada.Text_IO, POSIX.Process_Identification, POSIX.Unsafe_Process_Primitives; begin if Fork = Null_Process_ID then Put_Line ("This is the new process."); else Put_Line ("This is the original process."); end if; exception when others => Put_Line ("Something went wrong."); end Fork;
libsrc/_DEVELOPMENT/adt/b_vector/c/sccz80/b_vector_append_callee.asm
jpoikela/z88dk
640
83606
<reponame>jpoikela/z88dk ; size_t b_vector_append(b_vector_t *v, int c) SECTION code_clib SECTION code_adt_b_vector PUBLIC b_vector_append_callee EXTERN asm_b_vector_append b_vector_append_callee: pop hl pop bc ex (sp),hl jp asm_b_vector_append ; SDCC bridge for Classic IF __CLASSIC PUBLIC _b_vector_append_callee defc _b_vector_append_callee = b_vector_append_callee ENDIF
Assignments/Assignment3/assn3.asm
ptr2578/CS61
1
6221
;================================================= ; Name: <NAME> ; Email: <EMAIL> ; ; Assignment name: Assignment 3 ; Lab section: B21 ; ; I hereby certify that I have not received assistance on this assignment, ; or used code, from ANY outside source other than the instruction team. ; ;================================================= .ORIG x3000 ; Program begins here ;------------- ;Instructions ;------------- LD R6, Value_addr ; R6 <-- pointer to value to be displayed as binary LDR R1, R6, #0 ; R1 <-- value to be displayed as binary ;------------------------------- ;INSERT CODE STARTING FROM HERE ;------------------------------- ADD R2, R2, #1 ; R2 holds number 1 for comparison purpose ADD R3, R3, #0 ; R3 is OuterLoop counter OuterLoop ; OuterLoop Begins ADD R3, R3, #1 ; Increment loop counter by 1 every loop AND R0, R0, #0 ; Clear R0 for next use ADD R0, R1, #0 ; Compare MSB with 1 BRn isOne ; If MSB is 1, go to branch isOne isZero ; BRANCH isZero AND R0, R0, #0 ; Clear R0 for next use LD R0, PrintZero ; Load R0 with 0 OUT ; Prints zero ADD R1, R1, R1 ; Shift bits left BR InnerLoop ; Skip to InnerLoop isOne ; BRANCH isOne AND R0, R0, #0 ; Clear R0 for next use LD R0, PrintOne ; Load R0 with 1 OUT ; Prints one ADD R1, R1, R1 ; Shift bits left InnerLoop ; BRANCH InnerLoop AND R4, R4, #0 ; Clear R4 for next use ADD R4, R3, #-4 ; Check to see if the loop is 4th count BRz isSpace ; Go to BRANCH isSpace if the sum is 0 ADD R4, R3, #-8 ; Check to see if the loop is 8th cotunt BRz isSpace ; Go to BRANCH isSpace if the sum is 0 ADD R4, R3, #-12 ; Check to see if the loop is 12th count BRz isSpace ; Go to BRANCH isSpace if the sum is 0 BR LoopCheck ; Skip to BRANCH LoopCheck isSpace ; BRANCH isSpace AND R0, R0, #0 ; Clear R0 for next use LD R0, PrintSpace ; Load space character in R0 OUT ; Prints space LoopCheck ; BRANCH LoopCheck AND R0, R0, #0 ; Clear R0 for next use ADD R0, R3, #-16 ; Loop continues until counter becomes zero BRz LoopEnd ; Out the loop, if zero. BR OuterLoop ; Back to the top of the loop LoopEnd ; BRANCH LoopEnd AND R0, R0, #0 ; Clear R0 for next use LEA R0, NEWLINE ; Load new line in R0 PUTS ; Prints new line HALT ;--------------- ;Data ;--------------- Value_addr .FILL xD100 ; The address of where to find the data PrintZero .FILL x0030 ; ASCII value 0 PrintOne .FILL x0031 ; ASCII value 1 PrintSpace .FILL x0020 ; Space NEWLINE .STRINGZ "\n" ; New line .ORIG xD100 ; Remote data Value .FILL x4000 ; <----!!!NUMBER TO BE CONVERTED TO BINARY!!! Note: label is redundant. ;--------------- ;END of PROGRAM ;--------------- .END
Transynther/x86/_processed/NC/_st_zr_un_sm_/i7-7700_9_0x48.log_21829_1442.asm
ljhsiun2/medusa
9
2215
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r15 push %r8 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_WC_ht+0x1a09b, %r8 nop nop nop cmp %r13, %r13 mov (%r8), %rcx nop nop and $53009, %r15 lea addresses_A_ht+0x17b57, %r8 nop nop nop nop nop cmp $28771, %r11 movb (%r8), %bl nop sub %r11, %r11 lea addresses_A_ht+0x695b, %r15 nop nop dec %r9 mov (%r15), %ecx nop nop nop nop cmp %rbx, %rbx lea addresses_WC_ht+0x7553, %r9 nop dec %r8 mov $0x6162636465666768, %r13 movq %r13, %xmm7 vmovups %ymm7, (%r9) lfence lea addresses_WC_ht+0x1609b, %r8 nop nop nop dec %rbx mov (%r8), %r15d nop nop xor $52841, %r8 lea addresses_UC_ht+0xb69b, %rcx nop sub %r13, %r13 movw $0x6162, (%rcx) nop nop nop dec %r8 lea addresses_A_ht+0x86d5, %r13 nop cmp $12773, %r11 mov (%r13), %r8w nop nop and %r13, %r13 lea addresses_WT_ht+0xd9fb, %rsi lea addresses_D_ht+0x188db, %rdi nop nop nop nop xor %r13, %r13 mov $22, %rcx rep movsq and $9735, %r13 lea addresses_UC_ht+0xf293, %r15 add %rsi, %rsi mov (%r15), %r13d nop nop add %rsi, %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r8 pop %r15 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r15 push %r9 push %rax push %rbx push %rcx push %rdx // Store mov $0x37d4af000000089b, %r9 cmp $49196, %rax mov $0x5152535455565758, %r15 movq %r15, %xmm3 vmovups %ymm3, (%r9) nop nop nop nop nop xor $39195, %r10 // Faulty Load mov $0x37d4af000000089b, %r10 nop nop nop nop nop add %rcx, %rcx mov (%r10), %rdx lea oracles, %rbx and $0xff, %rdx shlq $12, %rdx mov (%rbx,%rdx,1), %rdx pop %rdx pop %rcx pop %rbx pop %rax pop %r9 pop %r15 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': True, 'congruent': 0, 'size': 8, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': True, 'congruent': 11, 'size': 8, 'same': False, 'NT': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': True, 'congruent': 11, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 9, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 1, 'size': 4, 'same': False, 'NT': False}} {'58': 6025, '5f': 15713, '00': 91} 5f 58 58 58 5f 58 5f 5f 58 5f 5f 5f 58 5f 5f 5f 5f 5f 58 5f 5f 58 5f 5f 5f 5f 5f 5f 58 5f 58 58 5f 58 58 5f 5f 5f 5f 5f 5f 58 5f 58 58 5f 5f 5f 58 5f 58 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 58 58 58 58 5f 58 5f 58 58 5f 58 5f 5f 58 58 5f 58 58 5f 5f 58 58 5f 5f 5f 5f 5f 58 58 58 58 58 58 58 58 58 5f 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 58 5f 58 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 58 5f 5f 58 5f 5f 58 5f 58 5f 5f 5f 58 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 58 5f 5f 5f 5f 5f 5f 58 58 5f 5f 5f 5f 58 5f 5f 5f 5f 58 5f 5f 5f 58 58 5f 5f 58 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 58 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 58 5f 58 5f 58 5f 5f 58 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 58 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 58 58 58 5f 5f 5f 58 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 58 58 5f 5f 5f 58 5f 58 5f 58 58 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 58 58 5f 5f 58 58 58 5f 5f 58 58 5f 5f 58 5f 5f 58 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 58 58 5f 58 5f 58 5f 5f 5f 5f 5f 5f 5f 58 5f 58 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 58 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 58 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 58 58 5f 5f 5f 58 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 58 5f 58 5f 5f 5f 5f 5f 58 5f 5f 5f 58 58 5f 58 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 58 58 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 58 5f 5f 5f 58 5f 5f 58 5f 58 58 5f 5f 58 5f 58 5f 5f 58 5f 5f 58 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 58 58 5f 5f 58 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 58 58 5f 5f 58 5f 58 58 5f 5f 5f 58 58 5f 58 5f 5f 58 58 5f 5f 5f 58 58 5f 5f 58 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 5f 58 5f 58 5f 5f 58 58 5f 58 58 58 58 5f 5f 58 5f 5f 5f 58 58 5f 58 58 5f 5f 58 5f 5f 58 5f 5f 5f 5f 5f 58 58 58 58 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 58 5f 5f 5f 58 5f 5f 58 58 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 58 5f 58 5f 5f 5f 58 5f 5f 5f 58 5f 5f 5f 58 5f 5f 58 5f 58 5f 58 5f 5f 5f 5f 5f 58 58 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 00 58 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 58 5f 58 58 5f 58 5f 58 5f 58 5f 5f 58 5f 5f 5f 5f 5f 5f 58 58 58 5f 5f 5f 58 5f 58 5f 5f 5f 5f 58 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 58 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 58 5f 58 5f 5f 58 5f 58 5f 5f 5f 5f 5f 5f 5f 58 5f 58 58 5f 5f 5f 58 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 58 58 5f 58 58 5f 5f 5f 5f 5f 5f 58 5f 5f 58 5f 5f 58 5f 58 5f 58 5f 58 58 5f 58 5f 5f 5f 5f 5f 5f 58 58 5f 5f 5f 58 58 5f 5f 5f 5f 5f 5f 58 5f 58 5f 5f 5f 5f 58 58 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 58 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 58 58 58 58 58 5f 5f 58 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 58 58 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 58 5f 5f 58 5f 58 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 5f 58 58 58 58 5f 58 5f 5f 5f 5f 5f 58 5f 5f 5f 5f 58 5f 5f 58 5f 58 58 5f 5f 5f 5f 5f 5f 5f 5f 5f 58 5f */
mips/example20.asm
ping58972/Computer-Organization-Architecture
0
176398
<filename>mips/example20.asm ## addIntArray.asm ## ## Sum all integers, the positive integers, ## and the negative integers in an array. ## Registers: ## $8 -- count ## $9 -- pointer to the array entry ## $10 -- current array entry ## $11 -- sum of all integers ## $12 -- sum of negative integers ## $13 -- sum of positive integers ## $14 -- pos. or neg. flag ## $15 -- length of the array .data size: .word 4 array: .word 1, 2, -2, -1 .text .globl main # Initialize main: ori $8,$0,0 # count = 0 ori $11,$0,0 # sum = 0 ori $12,$0,0 # neg = 0 ori $13,$0,0 # pos = 0 lui $9,0x1001 # point at SIZE lw $15,0($9) # get SIZE addiu $9,$9,4 # point to first entry # while count < SIZE do loop: beq $8,$15,done sll $0,$0,0 # branch delay # get entry, add to sum lw $10,0($9) # get entry sll $0,$0,0 # load delay addu $11,$11,$10 # add to sum # test neg. or pos. slti $14,$10,0x0 # set $14 if entry is neg bne $14,$0,neg # branch if negative sll $0,$0,0 # branch delay addu $13,$13,$10 # positive: add to PLUS j ifend sll $0,$0,0 # branch delay neg: addu $12,$12,$10 # negative: add to NEG ifend: addiu $8,$8,1 # count++ addiu $9,$9,4 # point at next entry j loop sll $0,$0,0 # branch delay # finish done: sll $0,$0,0 # target for branch
programs/oeis/193/A193008.asm
jmorken/loda
1
178959
; A193008: Constant term of the reduction by x^2->x+1 of the polynomial p(n,x) defined at Comments. ; 1,2,10,31,78,170,339,636,1144,1997,3412,5740,9549,15758,25854,42243,68818,111878,181615,294520,477276,773057,1251720,2026296,3279673,5307770,8589394,13899271,22490934,36392642,58886187,95281620,154170784 mov $12,$0 mov $14,$0 add $14,1 lpb $14 clr $0,12 mov $0,$12 sub $14,1 sub $0,$14 mov $9,$0 mov $11,$0 add $11,1 lpb $11 mov $0,$9 sub $11,1 sub $0,$11 mov $3,7 mov $8,1 lpb $0 sub $0,1 mov $4,$8 add $8,$3 mov $3,5 add $3,$4 lpe mov $1,840 mov $8,$3 mov $3,$0 add $0,1 add $3,9 add $1,$3 sub $8,$0 mul $8,2 add $1,$8 sub $1,859 div $1,2 add $10,$1 lpe add $13,$10 lpe mov $1,$13
data/pokemon/base_stats/tyrogue.asm
Karkino/KarkCrystal16
0
101635
db 0 ; species ID placeholder db 35, 35, 35, 35, 35, 35 ; hp atk def spd sat sdf db FIGHTING, FIGHTING ; type db 75 ; catch rate db 91 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F0 ; gender ratio db 100 ; unknown 1 db 25 ; step cycles to hatch db 5 ; unknown 2 INCBIN "gfx/pokemon/tyrogue/front.dimensions" db 0, 0, 0, 0 ; padding db GROWTH_MEDIUM_FAST ; growth rate dn EGG_NONE, EGG_NONE ; egg groups ; tm/hm learnset tmhm HEADBUTT, CURSE, TOXIC, ROCK_SMASH, SUNNY_DAY, SNORE, PROTECT, RETURN, DOUBLE_TEAM, SWAGGER, SLEEP_TALK, SWIFT, PURSUIT, REST, ATTRACT, THIEF, STRENGTH ; end
src/main/antlr4/com/api/jsonata4java/expressions/path/generated/PathExpressionLexer.g4
markmelville/JSONata4Java
1
5823
/** * (c) Copyright 2018, 2019 IBM Corporation * 1 New Orchard Road, * Armonk, New York, 10504-1722 * United States * +1 914 499 1900 * support: <NAME> <EMAIL> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /* Grammar defining the subset of JSONata we support on the LHS of mapping expressions */ lexer grammar PathExpressionLexer; WS: [ \t\n]+ -> skip ; // ignore whitespace NON_BACK_QUOTED_ID : [a-zA-Z] [a-zA-Z0-9_]*; BACK_QUOTED_ID : BACK_QUOTE -> pushMode(MODE_BACK_QUOTE); ARR_OPEN : '['; ARR_CLOSE : ']'; PATH_DELIM : '.'; // positive integer indexes-only supported for now NUMBER : INT // 3, 45 ; mode MODE_BACK_QUOTE; BACK_QUOTE_CONTENT: NOT_BACK_QUOTE+; BACK_QUOTE_EXIT: BACK_QUOTE -> popMode; fragment INT : '0' | [1-9] [0-9]* ; // no leading zeros fragment BACK_QUOTE : '`'; fragment NOT_BACK_QUOTE : ~['`'];
tlsf/src/proof/test/relation/tlsf-proof-test-relation.ads
vasil-sd/ada-tlsf
3
18199
package TLSF.Proof.Test.Relation with SPARK_Mode is procedure Test_Find; end TLSF.Proof.Test.Relation;
source/amf/uml/amf-internals-holders-uml_holders.adb
svn2github/matreshka
24
8561
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with AMF.Elements; with AMF.Holders.Elements; package body AMF.Internals.Holders.UML_Holders is --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Abstractions.UML_Abstraction_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Accept_Event_Actions.UML_Accept_Event_Action_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Actions.UML_Action_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Activities.UML_Activity_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Activity_Groups.UML_Activity_Group_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Activity_Nodes.UML_Activity_Node_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Activity_Partitions.UML_Activity_Partition_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Artifacts.UML_Artifact_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Associations.UML_Association_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Association_Classes.UML_Association_Class_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Behavioral_Features.UML_Behavioral_Feature_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Behaviored_Classifiers.UML_Behaviored_Classifier_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Behaviors.UML_Behavior_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Call_Operation_Actions.UML_Call_Operation_Action_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Classifier_Template_Parameters.UML_Classifier_Template_Parameter_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Classifiers.UML_Classifier_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Classes.UML_Class_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Collaboration_Uses.UML_Collaboration_Use_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Collaborations.UML_Collaboration_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Combined_Fragments.UML_Combined_Fragment_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Components.UML_Component_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Connectable_Element_Template_Parameters.UML_Connectable_Element_Template_Parameter_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Connectable_Elements.UML_Connectable_Element_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Connectors.UML_Connector_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Constraints.UML_Constraint_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Data_Types.UML_Data_Type_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Dependencies.UML_Dependency_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Deployment_Targets.UML_Deployment_Target_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Deployments.UML_Deployment_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Duration_Intervals.UML_Duration_Interval_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Durations.UML_Duration_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Elements.UML_Element_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Enumeration_Literals.UML_Enumeration_Literal_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Enumerations.UML_Enumeration_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Events.UML_Event_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Executable_Nodes.UML_Executable_Node_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Execution_Specifications.UML_Execution_Specification_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Expansion_Regions.UML_Expansion_Region_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Extension_Ends.UML_Extension_End_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Input_Pins.UML_Input_Pin_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Instance_Specifications.UML_Instance_Specification_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Interaction_Constraints.UML_Interaction_Constraint_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Interaction_Operands.UML_Interaction_Operand_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Interactions.UML_Interaction_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Interfaces.UML_Interface_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Interruptible_Activity_Regions.UML_Interruptible_Activity_Region_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Intervals.UML_Interval_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Invocation_Actions.UML_Invocation_Action_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Lifelines.UML_Lifeline_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Literal_Specifications.UML_Literal_Specification_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Message_Ends.UML_Message_End_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Messages.UML_Message_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Models.UML_Model_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Named_Elements.UML_Named_Element_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Namespaces.UML_Namespace_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Object_Flows.UML_Object_Flow_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Object_Nodes.UML_Object_Node_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Occurrence_Specifications.UML_Occurrence_Specification_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Opaque_Actions.UML_Opaque_Action_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Opaque_Expressions.UML_Opaque_Expression_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Operation_Template_Parameters.UML_Operation_Template_Parameter_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Operations.UML_Operation_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Output_Pins.UML_Output_Pin_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Packageable_Elements.UML_Packageable_Element_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Packages.UML_Package_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Part_Decompositions.UML_Part_Decomposition_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Parameters.UML_Parameter_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Ports.UML_Port_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Profiles.UML_Profile_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Properties.UML_Property_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Protocol_State_Machines.UML_Protocol_State_Machine_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Read_Structural_Feature_Actions.UML_Read_Structural_Feature_Action_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Regions.UML_Region_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Send_Object_Actions.UML_Send_Object_Action_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Send_Signal_Actions.UML_Send_Signal_Action_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Signals.UML_Signal_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.State_Machines.UML_State_Machine_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.States.UML_State_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Stereotypes.UML_Stereotype_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.String_Expressions.UML_String_Expression_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Structured_Classifiers.UML_Structured_Classifier_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Structural_Features.UML_Structural_Feature_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Template_Bindings.UML_Template_Binding_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Template_Signatures.UML_Template_Signature_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Templateable_Elements.UML_Templateable_Element_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Time_Intervals.UML_Time_Interval_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Time_Events.UML_Time_Event_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Time_Expressions.UML_Time_Expression_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Transitions.UML_Transition_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Triggers.UML_Trigger_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Types.UML_Type_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Usages.UML_Usage_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Use_Cases.UML_Use_Case_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Value_Specifications.UML_Value_Specification_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Variables.UML_Variable_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Vertexs.UML_Vertex_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; --------------- -- To_Holder -- --------------- function To_Holder (Item : AMF.UML.Write_Structural_Feature_Actions.UML_Write_Structural_Feature_Action_Access) return League.Holders.Holder is begin return AMF.Holders.Elements.To_Holder (AMF.Elements.Element_Access (Item)); end To_Holder; end AMF.Internals.Holders.UML_Holders;
Transynther/x86/_processed/AVXALIGN/_st_zr_/i7-7700_9_0x48.log_21829_953.asm
ljhsiun2/medusa
9
14556
<filename>Transynther/x86/_processed/AVXALIGN/_st_zr_/i7-7700_9_0x48.log_21829_953.asm<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r15 push %rdi lea addresses_D_ht+0x15aa6, %r11 nop nop nop nop and %r13, %r13 mov (%r11), %r15d nop nop nop dec %rdi pop %rdi pop %r15 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %rax push %rbx push %rcx push %rdi push %rsi // Store lea addresses_UC+0xdd8e, %rbx and $59878, %r14 movl $0x51525354, (%rbx) cmp $25267, %r14 // Store lea addresses_A+0x17efc, %r12 nop nop nop nop xor $10443, %rcx mov $0x5152535455565758, %rdi movq %rdi, %xmm4 movups %xmm4, (%r12) cmp %rax, %rax // Store lea addresses_RW+0x1b98e, %rdi clflush (%rdi) nop sub $47803, %rbx mov $0x5152535455565758, %r14 movq %r14, (%rdi) nop nop nop nop nop and %rax, %rax // Store lea addresses_UC+0xe8c6, %rdi nop nop add $21031, %rsi movw $0x5152, (%rdi) nop nop nop nop xor $31717, %r14 // Store mov $0x6dc9e0000000018e, %r12 nop nop nop sub $42326, %rdi mov $0x5152535455565758, %rax movq %rax, %xmm4 movntdq %xmm4, (%r12) and %r12, %r12 // Faulty Load mov $0x61704d000000098e, %r12 and $16088, %rdi mov (%r12), %r14d lea oracles, %r12 and $0xff, %r14 shlq $12, %r14 mov (%r12,%r14,1), %r14 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': True, 'congruent': 9, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 9, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 10, 'size': 16, 'same': False, 'NT': True}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 4, 'same': False, 'NT': True}} {'58': 21802, '00': 27} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
programs/oeis/046/A046951.asm
neoneye/loda
22
73
; A046951: a(n) is the number of squares dividing n. ; 1,1,1,2,1,1,1,2,2,1,1,2,1,1,1,3,1,2,1,2,1,1,1,2,2,1,2,2,1,1,1,3,1,1,1,4,1,1,1,2,1,1,1,2,2,1,1,3,2,2,1,2,1,2,1,2,1,1,1,2,1,1,2,4,1,1,1,2,1,1,1,4,1,1,2,2,1,1,1,3,3,1,1,2,1,1,1,2,1,2,1,2,1,1,1,3,1,2,2,4 seq $0,57918 ; Number of pairs of numbers (a,b) each less than n where (a,b,n) is in geometric progression. seq $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
external/mp/base/6502/cpu6502_shortint.asm
polluks/effectus
7
82907
<filename>external/mp/base/6502/cpu6502_shortint.asm /* mulSHORTINT divmulSHORTINT */ .proc mulSHORTINT jsr imulBYTE lda :STACKORIGIN-1,x bpl @+ sec lda eax+1 sbc :STACKORIGIN,x sta eax+1 @ lda :STACKORIGIN,x bpl @+ sec lda eax+1 sbc :STACKORIGIN-1,x sta eax+1 @ jmp movaBX_EAX .endp .proc divmulSHORTINT MOD mva #{jsr} _mod lda :STACKORIGIN,x ; divisor sign spl jsr negBYTE DIV ldy <idivBYTE lda >idivBYTE skp sty addr sta addr+1 ldy #0 lda :STACKORIGIN-1,x ; dividend sign bpl @+ jsr negBYTE1 iny @ lda :STACKORIGIN,x ; divisor sign bpl @+ jsr negBYTE iny @ tya and #1 pha jsr $ffff ; idiv ecx addr equ *-2 jsr movaBX_EAX _mod bit movZTMP_aBX ; mod mva #{bit} _mod pla seq jmp negCARD1 rts .endp
oeis/041/A041401.asm
neoneye/loda-programs
11
28520
; A041401: Denominators of continued fraction convergents to sqrt(215). ; Submitted by <NAME> ; 1,1,2,3,86,89,175,264,7567,7831,15398,23229,665810,689039,1354849,2043888,58583713,60627601,119211314,179838915,5154700934,5334539849,10489240783,15823780632,453555098479,469378879111,922933977590,1392312856701,39907693965218,41300006821919,81207700787137,122507707609056,3511423513840705,3633931221449761,7145354735290466,10779285956740227,308965361524016822,319744647480757049,628710009004773871,948454656485530920,27185440390599639631,28133895047085170551,55319335437684810182 add $0,1 mov $3,1 lpb $0 sub $0,1 add $2,$3 mov $3,$1 mov $1,$2 dif $2,3 mod $2,$1 mul $2,81 add $3,$2 mov $2,$1 lpe mov $0,$1
old/Metalogic/OLD_Propositional.agda
Lolirofle/stuff-in-agda
6
10112
<filename>old/Metalogic/OLD_Propositional.agda module Logic.Classical.Propositional where open import Boolean open import Data open import Functional import Lvl -- Propositional logic. Working with propositions and their truth (whether they are true or false). module ProofSystems {ℓ₁} {ℓ₂} {Proposition : Set(ℓ₁)} {Formula : Set(ℓ₁) → Set(ℓ₂)} (symbols : Syntax.Symbols Proposition Formula) where open Syntax.Symbols(symbols) module TruthTables where -- The "proofs" that results by these postulates are very much alike the classical notation of natural deduction proofs in written as trees. -- A function that has the type (Node(A) → Node(B)) is a proof of (A ⊢ B) (A is the assumption, B is the single conclusion) -- A function that has the type (Node(A₁) → Node(A₂) → Node(A₃) → .. → Node(B)) is a proof of ({A₁,A₂,A₃,..} ⊢ B) (Aᵢ is the assumptions, B is the single result) -- A function's function body is the "tree proof" -- • The inner most (deepest) expression is at the top of a normal tree -- • The outer most (shallow) expression is at the bottom of a normal tree that should result in a construction of the conclusion -- One difference is that one cannot introduce assumptions however one wants. There are however rules that allows one to to this by using a function, and can be written as a lambda abstraction if one want it to look similar to the tree proofs. module NaturalDeduction where -- Intro rules are like constructors of formulas -- Elimination rules are like deconstructors of formulas record Rules : Set(Lvl.𝐒(ℓ₁ Lvl.⊔ ℓ₂)) where field {Node} : Formula(Proposition) → Set(ℓ₁ Lvl.⊔ ℓ₂) field [⊤]-intro : Node(⊤) [⊥]-intro : ∀{φ : Formula(Proposition)} → Node(φ) → Node(¬ φ) → Node(⊥) [¬]-intro : ∀{φ : Formula(Proposition)} → (Node(φ) → Node(⊥)) → Node(¬ φ) [¬]-elim : ∀{φ : Formula(Proposition)} → (Node(¬ φ) → Node(⊥)) → Node(φ) [∧]-intro : ∀{φ₁ φ₂ : Formula(Proposition)} → Node(φ₁) → Node(φ₂) → Node(φ₁ ∧ φ₂) [∧]-elimₗ : ∀{φ₁ φ₂ : Formula(Proposition)} → Node(φ₁ ∧ φ₂) → Node(φ₁) [∧]-elimᵣ : ∀{φ₁ φ₂ : Formula(Proposition)} → Node(φ₁ ∧ φ₂) → Node(φ₂) [∨]-introₗ : ∀{φ₁ φ₂ : Formula(Proposition)} → Node(φ₁) → Node(φ₁ ∨ φ₂) [∨]-introᵣ : ∀{φ₁ φ₂ : Formula(Proposition)} → Node(φ₂) → Node(φ₁ ∨ φ₂) [∨]-elim : ∀{φ₁ φ₂ φ₃ : Formula(Proposition)} → (Node(φ₁) → Node(φ₃)) → (Node(φ₂) → Node(φ₃)) → Node(φ₁ ∨ φ₂) → Node(φ₃) [⇒]-intro : ∀{φ₁ φ₂ : Formula(Proposition)} → (Node(φ₁) → Node(φ₂)) → Node(φ₁ ⇒ φ₂) [⇒]-elim : ∀{φ₁ φ₂ : Formula(Proposition)} → Node(φ₁ ⇒ φ₂) → Node(φ₁) → Node(φ₂) [⇐]-intro : ∀{φ₁ φ₂ : Formula(Proposition)} → (Node(φ₂) → Node(φ₁)) → Node(φ₁ ⇐ φ₂) [⇐]-elim : ∀{φ₁ φ₂ : Formula(Proposition)} → Node(φ₁ ⇐ φ₂) → Node(φ₂) → Node(φ₁) [⇔]-intro : ∀{φ₁ φ₂ : Formula(Proposition)} → (Node(φ₂) → Node(φ₁)) → (Node(φ₁) → Node(φ₂)) → Node(φ₁ ⇔ φ₂) [⇔]-elimₗ : ∀{φ₁ φ₂ : Formula(Proposition)} → Node(φ₁ ⇔ φ₂) → Node(φ₂) → Node(φ₁) [⇔]-elimᵣ : ∀{φ₁ φ₂ : Formula(Proposition)} → Node(φ₁ ⇔ φ₂) → Node(φ₁) → Node(φ₂) -- Double negated proposition is positive [¬¬]-elim : ∀{φ : Formula(Proposition)} → Node(¬ (¬ φ)) → Node(φ) [¬¬]-elim nna = [¬]-elim(na ↦ [⊥]-intro na nna) [⊥]-elim : ∀{φ : Formula(Proposition)} → Node(⊥) → Node(φ) [⊥]-elim bottom = [¬]-elim(_ ↦ bottom) module Meta(rules : Rules) (meta-symbols : Syntax.Symbols (Set(ℓ₁ Lvl.⊔ ℓ₂)) id) where open import Data.List open Rules(rules) open Syntax.Symbols(meta-symbols) renaming ( •_ to ◦_ ; ⊤ to ⊤ₘ ; ⊥ to ⊥ₘ ; ¬_ to ¬ₘ_ ; _∧_ to _∧ₘ_ ; _∨_ to _∨ₘ_ ; _⇒_ to _⇒ₘ_ ) module Theorems where open import Data.List.Proofs{ℓ₁}{ℓ₂} import List.Theorems open Data.List.Relation.Membership open Data.List.Relation.Membership.Relators open import Relator.Equals{ℓ₁}{ℓ₂} open import Relator.Equals.Proofs{ℓ₁}{ℓ₂} -- [⊢]-subset : (Γ₁ ⊆ Γ₂) → (Γ₁ ⊢ φ) → (Γ₂ ⊢ φ) -- [⊢]-subset proof = -- [⊢]-subset : ∀{T}{L₁ L₂ : List(Stmt)} → (L₁ ⊆ L₂) → ∀{X} → (f(L₁) → X) → (f(L₂) → X) [⊢]-id : ∀{φ} → ([ φ ] ⊢ φ) [⊢]-id = id -- [⊢]-lhs-commutativity : ∀{Γ₁ Γ₂}{φ} → ((Γ₁ ++ Γ₂) ⊢ φ) → ((Γ₂ ++ Γ₁) ⊢ φ) -- [⊢]-lhs-commutativity = id -- [⊢]-test : ∀{φ₁ φ₂ φ₃} → ([ φ₁ ⊰ φ₂ ⊰ φ₃ ] ⊢ φ₁) → (Node(φ₁) ⨯ (Node(φ₂) ⨯ Node(φ₃)) → Node(φ₁)) -- [⊢]-test = id [⊢]-weakening : ∀{Γ}{φ₁} → (Γ ⊢ φ₁) → ∀{φ₂} → ((φ₂ ⊰ Γ) ⊢ φ₁) [⊢]-weakening {∅} (⊢φ₁) (φ₂) = (⊢φ₁) [⊢]-weakening {_ ⊰ _} (Γ⊢φ₁) (φ₂ , Γ) = (Γ⊢φ₁) (Γ) -- [⊢]-weakening₂ : ∀{Γ₁}{φ₁} → (Γ₁ ⊢ φ₁) → ∀{Γ₂} → ((Γ₁ ++ Γ₂) ⊢ φ₁) -- [⊢]-weakening₂ {Γ₁}{φ₁} (Γ⊢φ₁) {∅} = [≡]-elimᵣ {_}{_}{_} [++]-identityₗ {expr ↦ (expr ⊢ φ₁)} Γ⊢φ₁ -- [⊢]-weakening₂ {Γ₁}{φ₁} (Γ₁⊢φ₁) {φ₂ ⊰ Γ₂} = [⊢]-weakening₂ {Γ₁}{φ₁} ([⊢]-weakening{Γ₁}{φ₁} (Γ₁⊢φ₁) {φ₂}) {Γ₂} [⊢]-compose : ∀{Γ}{φ₁ φ₂} → (Γ ⊢ φ₁) → ([ φ₁ ] ⊢ φ₂) → (Γ ⊢ φ₂) [⊢]-compose {∅} (φ₁) (φ₁⊢φ₂) = (φ₁⊢φ₂) (φ₁) [⊢]-compose {_ ⊰ _} (Γ⊢φ₁) (φ₁⊢φ₂) (Γ) = (φ₁⊢φ₂) ((Γ⊢φ₁) (Γ)) [⊢]-compose₂ : ∀{Γ}{φ₁ φ₂} → (Γ ⊢ φ₁) → ((φ₁ ⊰ Γ) ⊢ φ₂) → (Γ ⊢ φ₂) [⊢]-compose₂ {∅} (φ₁) (φ₁⊢φ₂) = (φ₁⊢φ₂)(φ₁) [⊢]-compose₂ {_ ⊰ _} (Γ⊢φ₁) (φ₁Γ⊢φ₂) (Γ) = (φ₁Γ⊢φ₂) ((Γ⊢φ₁) (Γ) , (Γ)) -- [⊢]-test : ∀{φ₁ φ₂ γ₁ γ₂} → ([ γ₁ ⊰ γ₂ ] ⊢ φ₁) → ([ φ₁ ⊰ γ₁ ⊰ γ₂ ] ⊢ φ₂) → ([ γ₁ ⊰ γ₂ ] ⊢ φ₂) -- [⊢]-test (Γ⊢φ₁) (φ₁Γ⊢φ₂) (Γ) = (φ₁Γ⊢φ₂) ((Γ⊢φ₁) (Γ) , (Γ)) -- [⊢]-compose₃ : ∀{Γ₁ Γ₂}{φ₁ φ₂} → (Γ₁ ⊢ φ₁) → ((φ₁ ⊰ Γ₂) ⊢ φ₂) → ((Γ₁ ++ Γ₂) ⊢ φ₂) -- [⊢]-compose₃ {∅} {∅} (φ₁) (φ₁⊢φ₂) = (φ₁⊢φ₂) (φ₁) -- [⊢]-compose₃ {_ ⊰ _}{∅} = [⊢]-compose -- [⊢]-compose₃ {∅}{∅} (φ₁) (φ₁⊢φ₂) = (φ₁⊢φ₂) (φ₁) -- [⊢]-compose₃ {Γ}{∅} = [≡]-elimᵣ [++]-identityₗ [⊢]-compose{Γ} -- [⊢]-compose₃ {∅}{Γ} = [⊢]-compose₂{Γ} -- [⊢]-compose₃ {_ ⊰ _}{_ ⊰ _} = [⊢]-compose₂ -- olt-9-17 : ∀{Γ}{φ} → (Γ ⊢ φ) → ((φ ⊰ Γ) ⊢ ⊥) → (inconsistent Γ) -- olt-9-17 Γ⊢φ Γφ⊢⊥ = (Γ ↦ [⊥]-intro (Γ⊢φ Γ) ([⊥]-elim(Γφ⊢⊥ Γ))) module Theorems(rules : Rules) where open Rules(rules) -- Ensures that a certain proof is a certain proposition -- (Like type ascription, ensures that a certain expression has a certain type) -- Example: -- (A :with: a) where a : Node(A) -- ((A ∧ B) :with: [∧]-intro a b) where a : Node(A), b : Node(B) _:with:_ : ∀(φ : Formula(Proposition)) → Node(φ) → Node(φ) _:with:_ _ x = x infixl 100 _:with:_ -- The ability to derive anything from a contradiction ex-falso-quodlibet : ∀{A : Formula(Proposition)} → Node(⊥) → Node(A) ex-falso-quodlibet = [⊥]-elim [∧]-symmetry : ∀{A B : Formula(Proposition)} → Node(A ∧ B) → Node(B ∧ A) [∧]-symmetry {A} {B} A∧B = ((B ∧ A) :with: [∧]-intro (B :with: [∧]-elimᵣ(A∧B)) (A :with: [∧]-elimₗ(A∧B)) ) [∨]-symmetry : ∀{A B : Formula(Proposition)} → Node(A ∨ B) → Node(B ∨ A) [∨]-symmetry {A} {B} A∨B = ((B ∨ A) :with: [∨]-elim [∨]-introᵣ [∨]-introₗ A∨B ) contrapositive : ∀{A B : Formula(Proposition)} → Node(A ⇒ B) → Node((¬ B) ⇒ (¬ A)) contrapositive {A} {B} A→B = ((¬ B) ⇒ (¬ A)) :with: [⇒]-intro(nb ↦ (¬ A) :with: [¬]-intro(a ↦ ⊥ :with: [⊥]-intro (B :with: [⇒]-elim (A→B) a) ((¬ B) :with: nb) ) ) [⇒]-syllogism : ∀{A B C : Formula(Proposition)} → Node(A ⇒ B) → Node(B ⇒ C) → Node(A ⇒ C) [⇒]-syllogism {A} {B} {C} A→B B→C = ([⇒]-intro(a ↦ ([⇒]-elim B→C ([⇒]-elim A→B a) ) )) [∨]-syllogism : ∀{A B : Formula(Proposition)} → Node(A ∨ B) → Node((¬ A) ⇒ B) [∨]-syllogism {A} {B} A∨B = ([∨]-elim (a ↦ ((¬ A) ⇒ B) :with: [⇒]-syllogism (((¬ A) ⇒ (¬ (¬ B))) :with: contrapositive (((¬ B) ⇒ A) :with: [⇒]-intro(_ ↦ a)) ) (((¬ (¬ B)) ⇒ B) :with: [⇒]-intro [¬¬]-elim) ) (b ↦ ((¬ A) ⇒ B) :with: [⇒]-intro(_ ↦ b)) A∨B ) -- Currying [∧]→[⇒]-in-assumption : {X Y Z : Formula(Proposition)} → Node((X ∧ Y) ⇒ Z) → Node(X ⇒ (Y ⇒ Z)) [∧]→[⇒]-in-assumption x∧y→z = ([⇒]-intro(x ↦ ([⇒]-intro(y ↦ ([⇒]-elim (x∧y→z) ([∧]-intro x y) ) )) )) -- Uncurrying [∧]←[⇒]-in-assumption : {X Y Z : Formula(Proposition)} → Node(X ⇒ (Y ⇒ Z)) → Node((X ∧ Y) ⇒ Z) [∧]←[⇒]-in-assumption x→y→z = ([⇒]-intro(x∧y ↦ ([⇒]-elim ([⇒]-elim (x→y→z) ([∧]-elimₗ x∧y) ) ([∧]-elimᵣ x∧y) ) )) -- It is either that a proposition is true or its negation is true. -- A proposition is either true or false. -- There is no other truth values than true and false. excluded-middle : ∀{A : Formula(Proposition)} → Node(A ∨ (¬ A)) excluded-middle {A} = ([¬]-elim(¬[a∨¬a] ↦ (⊥ :with: [⊥]-intro ((A ∨ (¬ A)) :with: [∨]-introᵣ ((¬ A) :with: [¬]-intro(a ↦ (⊥ :with: [⊥]-intro ((A ∨ (¬ A)) :with: [∨]-introₗ(a)) ((¬(A ∨ (¬ A))) :with: ¬[a∨¬a]) ) )) ) (¬[a∨¬a]) ) )) -- It cannot be that a proposition is true and its negation is true at the same time. -- A proposition cannot be true and false at the same time. non-contradiction : ∀{A : Formula(Proposition)} → Node(¬ (A ∧ (¬ A))) non-contradiction {A} = ([¬]-intro(a∧¬a ↦ (⊥ :with: [⊥]-intro (A :with: [∧]-elimₗ a∧¬a) ((¬ A) :with: [∧]-elimᵣ a∧¬a) ) )) -- TODO: Mix of excluded middle and non-contradiction: (A ⊕ (¬ A)) -- The standard proof technic: Assume the opposite of the conclusion and prove that it leads to a contradiction proof-by-contradiction : ∀{A B : Formula(Proposition)} → (Node(¬ A) → Node(B)) → (Node(¬ A) → Node(¬ B)) → Node(A) proof-by-contradiction {A} {B} ¬a→b ¬a→¬b = (A :with: [¬]-elim(¬a ↦ (⊥ :with: [⊥]-intro (B :with: ¬a→b(¬a)) ((¬ B) :with: ¬a→¬b(¬a)) ) )) peirce : ∀{A B : Formula(Proposition)} → Node((A ⇒ B) ⇒ A) → Node(A) peirce {A} {B} [A→B]→A = (A :with: [¬]-elim(¬a ↦ ([⊥]-intro (A :with: [⇒]-elim [A→B]→A ((A ⇒ B) :with: [⇒]-intro(a ↦ (B :with: [⊥]-elim ([⊥]-intro a ¬a ) ) )) ) ((¬ A) :with: ¬a) ) )) skip-[⇒]-assumption : ∀{A B : Formula(Proposition)} → (Node(A ⇒ B) → Node(A)) → Node(A) skip-[⇒]-assumption A⇒B→A = (peirce ([⇒]-intro (A⇒B→A) ) ) {- data □ : Formula(Proposition) → Set where Initial : ∀{φ} → □(φ) [∧]-intro : ∀{φ₁ φ₂} → □(φ₁) → □(φ₂) → □(φ₁ ∧ φ₂) [∧]-elimₗ : ∀{φ₁ φ₂} → □(φ₁ ∧ φ₂) → □(φ₁) [∧]-elimᵣ : ∀{φ₁ φ₂} → □(φ₁ ∧ φ₂) → □(φ₂) [∨]-introₗ : ∀{φ₁ φ₂} → □(φ₁) → □(φ₁ ∨ φ₂) [∨]-introᵣ : ∀{φ₁ φ₂} → □(φ₁) → □(φ₁ ∨ φ₂) [∨]-elim : ∀{φ₁ φ₂ φ₃} → (□(φ₁) → □(φ₃)) → (□(φ₂) → □(φ₃)) → □(φ₃) [⇒]-intro : ∀{φ₁ φ₂} → (□(φ₁) → □(φ₂)) → □(φ₁ ⇒ φ₂) [⇒]-elim : ∀{φ₁ φ₂} → □(φ₁ ⇒ φ₂) → □(φ₁) → □(φ₂) [¬]-intro : ∀{φ} → (□(φ) → □(⊥)) → □(¬ φ) [¬]-elim : ∀{φ} → (□(¬ φ) → □(⊥)) → □(φ) data □ : Formula(Proposition) → Set where Initial : ∀{φ} → □(φ) [∧]-intro : ∀{φ₁ φ₂} → □(φ₁) → □(φ₂) → □(φ₁ ∧ φ₂) [∧]-elimₗ : ∀{φ₁ φ₂} → □(φ₁ ∧ φ₂) → □(φ₁) [∧]-elimᵣ : ∀{φ₁ φ₂} → □(φ₁ ∧ φ₂) → □(φ₂) [∨]-introₗ : ∀{φ₁ φ₂} → □(φ₁) → □(φ₁ ∨ φ₂) [∨]-introᵣ : ∀{φ₁ φ₂} → □(φ₁) → □(φ₁ ∨ φ₂) [∨]-elim : ∀{φ₁ φ₂ φ₃} → (□(φ₁) → □(φ₃)) → (□(φ₂) → □(φ₃)) → □(φ₃) [⇒]-intro : ∀{φ₁ φ₂} → (□(φ₁) → □(φ₂)) → □(φ₁ ⇒ φ₂) [⇒]-elim : ∀{φ₁ φ₂} → □(φ₁ ⇒ φ₂) → □(φ₁) → □(φ₂) [¬]-intro : ∀{φ} → (□(φ) → □(⊥)) → □(¬ φ) [¬¬]-elim : ∀{φ} → □(¬(¬ φ)) → □(φ) -}
exercises/exercise12/test12-2.asm
Dark15/assembly
1
176592
hello_sector equ 100 mov si, 0x7c0 mov ds, si xor si, si mov dx, 0x1f2 mov al, 1 out dx, al inc dx mov al, hello_sector out dx, al inc dx xor al, al out dx, al inc dx out dx, al inc dx mov al, 0xe0 out dx, al inc dx mov al, 0x30 out dx, al waits: in al, dx and al, 0b1000_1000 cmp al, 0x08 jnz waits mov cx, 256 mov dx, 0x1f0 mov si,text writew: mov ax, [si] out dx, ax add si, 2 loop writew jmp $ text db 'world' times 510-($-$$) db 0 dw 0xAA55
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_484.asm
ljhsiun2/medusa
9
86484
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r12 push %r8 push %rax push %rcx push %rdi push %rsi lea addresses_A_ht+0x5779, %r12 nop nop cmp %r11, %r11 movb (%r12), %cl and $25694, %rax lea addresses_UC_ht+0x2d61, %r8 add %r12, %r12 movb (%r8), %r11b nop nop nop nop dec %rcx lea addresses_UC_ht+0x18099, %rsi lea addresses_WT_ht+0x162f9, %rdi clflush (%rsi) dec %r10 mov $119, %rcx rep movsq and $59300, %rsi lea addresses_UC_ht+0x1674e, %rcx nop add $54560, %r12 mov $0x6162636465666768, %rdi movq %rdi, %xmm2 movups %xmm2, (%rcx) nop nop nop xor $57206, %rax lea addresses_WC_ht+0xf50c, %r12 nop nop inc %r10 mov (%r12), %rax nop nop nop nop and %r12, %r12 lea addresses_normal_ht+0x17821, %r11 clflush (%r11) nop add %r12, %r12 movl $0x61626364, (%r11) nop dec %r8 lea addresses_WT_ht+0xa149, %rsi lea addresses_WT_ht+0x1ded9, %rdi nop nop inc %r12 mov $103, %rcx rep movsb xor $20143, %r10 lea addresses_normal_ht+0x18459, %r12 add $24244, %r8 mov $0x6162636465666768, %rcx movq %rcx, (%r12) nop nop nop add %rax, %rax lea addresses_normal_ht+0x3e19, %r12 clflush (%r12) nop nop nop nop cmp $26560, %r10 mov $0x6162636465666768, %r11 movq %r11, %xmm2 vmovups %ymm2, (%r12) nop cmp $2583, %rcx lea addresses_WC_ht+0x1c389, %rcx nop nop nop nop nop inc %r10 mov (%rcx), %r12d dec %rax lea addresses_D_ht+0x10619, %rax nop nop nop nop lfence mov $0x6162636465666768, %rdi movq %rdi, (%rax) nop nop nop and %r10, %r10 lea addresses_WC_ht+0xb7c9, %r10 nop nop nop nop nop dec %rsi movl $0x61626364, (%r10) nop nop sub %r10, %r10 pop %rsi pop %rdi pop %rcx pop %rax pop %r8 pop %r12 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r14 push %r15 push %r8 push %rdx push %rsi // Store lea addresses_D+0x10fb9, %r12 nop nop dec %rsi mov $0x5152535455565758, %rdx movq %rdx, (%r12) nop xor %rsi, %rsi // Store lea addresses_normal+0x1219, %rdx xor $21451, %r12 movl $0x51525354, (%rdx) cmp $12198, %r10 // Store lea addresses_PSE+0xef19, %r14 clflush (%r14) nop nop nop nop nop and $46769, %r8 movb $0x51, (%r14) nop nop nop nop nop add $32126, %r14 // Faulty Load lea addresses_UC+0xa619, %r8 nop nop nop nop inc %r12 movups (%r8), %xmm6 vpextrq $0, %xmm6, %r15 lea oracles, %rdx and $0xff, %r15 shlq $12, %r15 mov (%rdx,%r15,1), %r15 pop %rsi pop %rdx pop %r8 pop %r15 pop %r14 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 1}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 10}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 8}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 4}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 3}} {'OP': 'REPM', 'src': {'same': True, 'congruent': 6, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WT_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 6}} {'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 3}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}} {'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 */
programs/oeis/025/A025810.asm
karttu/loda
1
94224
; A025810: Expansion of 1/((1-x^2)(1-x^5)(1-x^10)) in powers of x. ; 1,0,1,0,1,1,1,1,1,1,3,1,3,1,3,3,3,3,3,3,6,3,6,3,6,6,6,6,6,6,10,6,10,6,10,10,10,10,10,10,15,10,15,10,15,15,15,15,15,15,21,15,21,15,21,21,21,21,21,21,28,21,28,21,28,28,28,28,28,28,36,28,36,28,36,36,36,36,36,36 mul $0,2 cal $0,165190 ; G.f.: 1/((1-x^4)*(1-x^5)). mov $1,$0 add $1,1 bin $1,2
arch/z80/src/ez80/ez80f91_init.asm
davids5/incubator-nuttx
1
84544
;************************************************************************** ; arch/z80/src/ez80/ez80f91_init.asm ; ; Copyright (C) 2008 <NAME>. All rights reserved. ; Author: <NAME> <<EMAIL>> ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in ; the documentation and/or other materials provided with the ; distribution. ; 3. Neither the name NuttX nor the names of its contributors may be ; used to endorse or promote products derived from this software ; without specific prior written permission. ; ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ; COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, ; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS ; OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED ; AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ; ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ; POSSIBILITY OF SUCH DAMAGE. ; ;************************************************************************** ;************************************************************************** ; Included Files ;************************************************************************** include "ez80F91.inc" ;************************************************************************** ; Constants ;************************************************************************** ;PLL_DIV_L EQU %5C ;PLL_DIV_H EQU %5D ;PLL_CTL0 EQU %5E ;PLL_CTL1 EQU %5F OSC EQU 0 PLL EQU 1 RTC EQU 2 CLK_MUX_OSC EQU %00 CLK_MUX_PLL EQU %01 CLK_MUX_RTC EQU %02 CHRP_CTL_0 EQU %00 CHRP_CTL_1 EQU %40 CHRP_CTL_2 EQU %80 CHRP_CTL_3 EQU %C0 LDS_CTL_0 EQU %00 LDS_CTL_1 EQU %04 LDS_CTL_2 EQU %08 LDS_CTL_3 EQU %0C LCK_STATUS EQU %20 INT_LOCK EQU %10 INT_UNLOCK EQU %08 INT_LOCK_EN EQU %04 INT_UNLOCK_EN EQU %02 PLL_ENABLE EQU %01 ;************************************************************************** ; Global symbols used ;************************************************************************** ; Exported symbols xdef _ez80_init xdef _ez80_initsysclk ; Imported symbols xref __CS0_LBR_INIT_PARAM xref __CS0_UBR_INIT_PARAM xref __CS0_CTL_INIT_PARAM xref __CS1_LBR_INIT_PARAM xref __CS1_UBR_INIT_PARAM xref __CS1_CTL_INIT_PARAM xref __CS2_LBR_INIT_PARAM xref __CS2_UBR_INIT_PARAM xref __CS2_CTL_INIT_PARAM xref __CS3_LBR_INIT_PARAM xref __CS3_UBR_INIT_PARAM xref __CS3_CTL_INIT_PARAM xref __CS0_BMC_INIT_PARAM xref __CS1_BMC_INIT_PARAM xref __CS2_BMC_INIT_PARAM xref __CS3_BMC_INIT_PARAM xref __FLASH_CTL_INIT_PARAM xref __FLASH_ADDR_U_INIT_PARAM xref __RAM_CTL_INIT_PARAM xref __RAM_ADDR_U_INIT_PARAM xref _SYS_CLK_SRC xref _SYS_CLK_FREQ xref _OSC_FREQ xref _OSC_FREQ_MULT xref __PLL_CTL0_INIT_PARAM ;************************************************************************** ; Chip-specific initialization logic ;************************************************************************** ; Minimum default initialization for eZ80F91 define .STARTUP, space = ROM segment .STARTUP .assume ADL = 1 _ez80_init: ; Disable internal peripheral interrupt sources ld a, %ff out0 (PA_DDR), a ; GPIO out0 (PB_DDR), a out0 (PC_DDR), a out0 (PD_DDR), a ld a, %00 out0 (PA_ALT1), a out0 (PB_ALT1), a out0 (PC_ALT1), a out0 (PD_ALT1), a out0 (PA_ALT2), a out0 (PB_ALT2), a out0 (PC_ALT2), a out0 (PD_ALT2), a out0 (PLL_CTL1), a ; PLL out0 (TMR0_IER), a ; timers out0 (TMR1_IER), a out0 (TMR2_IER), a out0 (TMR3_IER), a out0 (UART0_IER), a ; UARTs out0 (UART1_IER), a out0 (I2C_CTL), a ; I2C out0 (EMAC_IEN), a ; EMAC out0 (FLASH_IRQ), a ; Flash ld a, %04 out0 (SPI_CTL), a ; SPI in0 a, (RTC_CTRL) ; RTC, and a, %be out0 (RTC_CTRL), a ; Configure external memory/io ld a, __CS0_LBR_INIT_PARAM out0 (CS0_LBR), a ld a, __CS0_UBR_INIT_PARAM out0 (CS0_UBR), a ld a, __CS0_BMC_INIT_PARAM out0 (CS0_BMC), a ld a, __CS0_CTL_INIT_PARAM out0 (CS0_CTL), a ld a, __CS1_LBR_INIT_PARAM out0 (CS1_LBR), a ld a, __CS1_UBR_INIT_PARAM out0 (CS1_UBR), a ld a, __CS1_BMC_INIT_PARAM out0 (CS1_BMC), a ld a, __CS1_CTL_INIT_PARAM out0 (CS1_CTL), a ld a, __CS2_LBR_INIT_PARAM out0 (CS2_LBR), a ld a, __CS2_UBR_INIT_PARAM out0 (CS2_UBR), a ld a, __CS2_BMC_INIT_PARAM out0 (CS2_BMC), a ld a, __CS2_CTL_INIT_PARAM out0 (CS2_CTL), a ld a, __CS3_LBR_INIT_PARAM out0 (CS3_LBR), a ld a, __CS3_UBR_INIT_PARAM out0 (CS3_UBR), a ld a, __CS3_BMC_INIT_PARAM out0 (CS3_BMC), a ld a, __CS3_CTL_INIT_PARAM out0 (CS3_CTL), a ret ;***************************************************************************** ; eZ80F91 System Clock Initialization ;***************************************************************************** _ez80_initsysclk: ; check if the PLL should be used ld a, (_ez80_sysclksrc) cp a, PLL jr nz, _ez80_initsysclkdone ; Load PLL divider ld a, (_ez80_oscfreqmult) ;CR 6202 out0 (PLL_DIV_L), a ld a, (_ez80_oscfreqmult+1) out0 (PLL_DIV_H), a ; Set charge pump and lock criteria ld a, __PLL_CTL0_INIT_PARAM and a, %CC ; mask off reserved and clock source bits out0 (PLL_CTL0), a ; Enable PLL in0 a, (PLL_CTL1) set 0, a out0 (PLL_CTL1), a ; Wait for PLL to lock _ez80_initsysclkwait: in0 a, (PLL_CTL1) and a, LCK_STATUS cp a, LCK_STATUS jr nz, _ez80_initsysclkwait ; Select PLL as system clock source ld a, __PLL_CTL0_INIT_PARAM set 0, a out0 (PLL_CTL0), a _ez80_initsysclkdone: ret ;_ez80_oscfreq: ; dl _OSC_FREQ _ez80_oscfreqmult: dw _OSC_FREQ_MULT ;_ez80_sysclkfreq: ; dl _SYS_CLK_FREQ _ez80_sysclksrc: db _SYS_CLK_SRC end
llvm-gcc-4.2-2.9/gcc/ada/bcheck.adb
vidkidz/crossbridge
1
9031
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- B C H E C K -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with ALI; use ALI; with ALI.Util; use ALI.Util; with Binderr; use Binderr; with Butil; use Butil; with Casing; use Casing; with Fname; use Fname; with Namet; use Namet; with Opt; use Opt; with Osint; with Output; use Output; with Rident; use Rident; with Types; use Types; package body Bcheck is ----------------------- -- Local Subprograms -- ----------------------- -- The following checking subprograms make up the parts of the -- configuration consistency check. procedure Check_Consistent_Dynamic_Elaboration_Checking; procedure Check_Consistent_Floating_Point_Format; procedure Check_Consistent_Interrupt_States; procedure Check_Consistent_Locking_Policy; procedure Check_Consistent_Normalize_Scalars; procedure Check_Consistent_Queuing_Policy; procedure Check_Consistent_Restrictions; procedure Check_Consistent_Zero_Cost_Exception_Handling; procedure Consistency_Error_Msg (Msg : String); -- Produce an error or a warning message, depending on whether an -- inconsistent configuration is permitted or not. function Same_Unit (U1 : Name_Id; U2 : Name_Id) return Boolean; -- Used to compare two unit names for No_Dependence checks. U1 is in -- standard unit name format, and U2 is in literal form with periods. ------------------------------------ -- Check_Consistent_Configuration -- ------------------------------------ procedure Check_Configuration_Consistency is begin if Float_Format_Specified /= ' ' then Check_Consistent_Floating_Point_Format; end if; if Queuing_Policy_Specified /= ' ' then Check_Consistent_Queuing_Policy; end if; if Locking_Policy_Specified /= ' ' then Check_Consistent_Locking_Policy; end if; if Zero_Cost_Exceptions_Specified then Check_Consistent_Zero_Cost_Exception_Handling; end if; Check_Consistent_Normalize_Scalars; Check_Consistent_Dynamic_Elaboration_Checking; Check_Consistent_Restrictions; Check_Consistent_Interrupt_States; end Check_Configuration_Consistency; --------------------------------------------------- -- Check_Consistent_Dynamic_Elaboration_Checking -- --------------------------------------------------- -- The rule here is that if a unit has dynamic elaboration checks, -- then any unit it withs must meeting one of the following criteria: -- 1. There is a pragma Elaborate_All for the with'ed unit -- 2. The with'ed unit was compiled with dynamic elaboration checks -- 3. The with'ed unit has pragma Preelaborate or Pure -- 4. It is an internal GNAT unit (including children of GNAT) procedure Check_Consistent_Dynamic_Elaboration_Checking is begin if Dynamic_Elaboration_Checks_Specified then for U in First_Unit_Entry .. Units.Last loop declare UR : Unit_Record renames Units.Table (U); begin if UR.Dynamic_Elab then for W in UR.First_With .. UR.Last_With loop declare WR : With_Record renames Withs.Table (W); begin if Get_Name_Table_Info (WR.Uname) /= 0 then declare WU : Unit_Record renames Units.Table (Unit_Id (Get_Name_Table_Info (WR.Uname))); begin -- Case 1. Elaborate_All for with'ed unit if WR.Elaborate_All then null; -- Case 2. With'ed unit has dynamic elab checks elsif WU.Dynamic_Elab then null; -- Case 3. With'ed unit is Preelaborate or Pure elsif WU.Preelab or WU.Pure then null; -- Case 4. With'ed unit is internal file elsif Is_Internal_File_Name (WU.Sfile) then null; -- Issue warning, not one of the safe cases else Error_Msg_Name_1 := UR.Sfile; Error_Msg ("?% has dynamic elaboration checks " & "and with's"); Error_Msg_Name_1 := WU.Sfile; Error_Msg ("? % which has static elaboration " & "checks"); Warnings_Detected := Warnings_Detected - 1; end if; end; end if; end; end loop; end if; end; end loop; end if; end Check_Consistent_Dynamic_Elaboration_Checking; -------------------------------------------- -- Check_Consistent_Floating_Point_Format -- -------------------------------------------- -- The rule is that all files must be compiled with the same setting -- for the floating-point format. procedure Check_Consistent_Floating_Point_Format is begin -- First search for a unit specifying a floating-point format and then -- check all remaining units against it. Find_Format : for A1 in ALIs.First .. ALIs.Last loop if ALIs.Table (A1).Float_Format /= ' ' then Check_Format : declare Format : constant Character := ALIs.Table (A1).Float_Format; begin for A2 in A1 + 1 .. ALIs.Last loop if ALIs.Table (A2).Float_Format /= Format then Error_Msg_Name_1 := ALIs.Table (A1).Sfile; Error_Msg_Name_2 := ALIs.Table (A2).Sfile; Consistency_Error_Msg ("% and % compiled with different " & "floating-point representations"); exit Find_Format; end if; end loop; end Check_Format; exit Find_Format; end if; end loop Find_Format; end Check_Consistent_Floating_Point_Format; --------------------------------------- -- Check_Consistent_Interrupt_States -- --------------------------------------- -- The rule is that if the state of a given interrupt is specified -- in more than one unit, it must be specified with a consistent state. procedure Check_Consistent_Interrupt_States is Max_Intrup : Nat; begin -- If no Interrupt_State entries, nothing to do if Interrupt_States.Last < Interrupt_States.First then return; end if; -- First find out the maximum interrupt value Max_Intrup := 0; for J in Interrupt_States.First .. Interrupt_States.Last loop if Interrupt_States.Table (J).Interrupt_Id > Max_Intrup then Max_Intrup := Interrupt_States.Table (J).Interrupt_Id; end if; end loop; -- Now establish tables to be used for consistency checking declare Istate : array (0 .. Max_Intrup) of Character := (others => 'n'); -- Interrupt state entries, 'u'/'s'/'r' or 'n' to indicate an -- entry that has not been set. Afile : array (0 .. Max_Intrup) of ALI_Id; -- ALI file that generated Istate entry for consistency message Loc : array (0 .. Max_Intrup) of Nat; -- Line numbers from IS pragma generating Istate entry Inum : Nat; -- Interrupt number from entry being tested Stat : Character; -- Interrupt state from entry being tested Lnum : Nat; -- Line number from entry being tested begin for F in ALIs.First .. ALIs.Last loop for K in ALIs.Table (F).First_Interrupt_State .. ALIs.Table (F).Last_Interrupt_State loop Inum := Interrupt_States.Table (K).Interrupt_Id; Stat := Interrupt_States.Table (K).Interrupt_State; Lnum := Interrupt_States.Table (K).IS_Pragma_Line; if Istate (Inum) = 'n' then Istate (Inum) := Stat; Afile (Inum) := F; Loc (Inum) := Lnum; elsif Istate (Inum) /= Stat then Error_Msg_Name_1 := ALIs.Table (Afile (Inum)).Sfile; Error_Msg_Name_2 := ALIs.Table (F).Sfile; Error_Msg_Nat_1 := Loc (Inum); Error_Msg_Nat_2 := Lnum; Consistency_Error_Msg ("inconsistent interrupt states at %:# and %:#"); end if; end loop; end loop; end; end Check_Consistent_Interrupt_States; ------------------------------------- -- Check_Consistent_Locking_Policy -- ------------------------------------- -- The rule is that all files for which the locking policy is -- significant must be compiled with the same setting. procedure Check_Consistent_Locking_Policy is begin -- First search for a unit specifying a policy and then -- check all remaining units against it. Find_Policy : for A1 in ALIs.First .. ALIs.Last loop if ALIs.Table (A1).Locking_Policy /= ' ' then Check_Policy : declare Policy : constant Character := ALIs.Table (A1).Locking_Policy; begin for A2 in A1 + 1 .. ALIs.Last loop if ALIs.Table (A2).Locking_Policy /= ' ' and ALIs.Table (A2).Locking_Policy /= Policy then Error_Msg_Name_1 := ALIs.Table (A1).Sfile; Error_Msg_Name_2 := ALIs.Table (A2).Sfile; Consistency_Error_Msg ("% and % compiled with different locking policies"); exit Find_Policy; end if; end loop; end Check_Policy; exit Find_Policy; end if; end loop Find_Policy; end Check_Consistent_Locking_Policy; ---------------------------------------- -- Check_Consistent_Normalize_Scalars -- ---------------------------------------- -- The rule is that if any unit is compiled with Normalized_Scalars, -- then all other units in the partition must also be compiled with -- Normalized_Scalars in effect. -- There is some issue as to whether this consistency check is -- desirable, it is certainly required at the moment by the RM. -- We should keep a watch on the ARG and HRG deliberations here. -- GNAT no longer depends on this consistency (it used to do so, -- but that has been corrected in the latest version, since the -- Initialize_Scalars pragma does not require consistency. procedure Check_Consistent_Normalize_Scalars is begin if Normalize_Scalars_Specified and No_Normalize_Scalars_Specified then Consistency_Error_Msg ("some but not all files compiled with Normalize_Scalars"); Write_Eol; Write_Str ("files compiled with Normalize_Scalars"); Write_Eol; for A1 in ALIs.First .. ALIs.Last loop if ALIs.Table (A1).Normalize_Scalars then Write_Str (" "); Write_Name (ALIs.Table (A1).Sfile); Write_Eol; end if; end loop; Write_Eol; Write_Str ("files compiled without Normalize_Scalars"); Write_Eol; for A1 in ALIs.First .. ALIs.Last loop if not ALIs.Table (A1).Normalize_Scalars then Write_Str (" "); Write_Name (ALIs.Table (A1).Sfile); Write_Eol; end if; end loop; end if; end Check_Consistent_Normalize_Scalars; ------------------------------------- -- Check_Consistent_Queuing_Policy -- ------------------------------------- -- The rule is that all files for which the queuing policy is -- significant must be compiled with the same setting. procedure Check_Consistent_Queuing_Policy is begin -- First search for a unit specifying a policy and then -- check all remaining units against it. Find_Policy : for A1 in ALIs.First .. ALIs.Last loop if ALIs.Table (A1).Queuing_Policy /= ' ' then Check_Policy : declare Policy : constant Character := ALIs.Table (A1).Queuing_Policy; begin for A2 in A1 + 1 .. ALIs.Last loop if ALIs.Table (A2).Queuing_Policy /= ' ' and then ALIs.Table (A2).Queuing_Policy /= Policy then Error_Msg_Name_1 := ALIs.Table (A1).Sfile; Error_Msg_Name_2 := ALIs.Table (A2).Sfile; Consistency_Error_Msg ("% and % compiled with different queuing policies"); exit Find_Policy; end if; end loop; end Check_Policy; exit Find_Policy; end if; end loop Find_Policy; end Check_Consistent_Queuing_Policy; ----------------------------------- -- Check_Consistent_Restrictions -- ----------------------------------- -- The rule is that if a restriction is specified in any unit, -- then all units must obey the restriction. The check applies -- only to restrictions which require partition wide consistency, -- and not to internal units. procedure Check_Consistent_Restrictions is Restriction_File_Output : Boolean; -- Shows if we have output header messages for restriction violation procedure Print_Restriction_File (R : All_Restrictions); -- Print header line for R if not printed yet ---------------------------- -- Print_Restriction_File -- ---------------------------- procedure Print_Restriction_File (R : All_Restrictions) is begin if not Restriction_File_Output then Restriction_File_Output := True; -- Find an ali file specifying the restriction for A in ALIs.First .. ALIs.Last loop if ALIs.Table (A).Restrictions.Set (R) and then (R in All_Boolean_Restrictions or else ALIs.Table (A).Restrictions.Value (R) = Cumulative_Restrictions.Value (R)) then -- We have found that ALI file A specifies the restriction -- that is being violated (the minimum value is specified -- in the case of a parameter restriction). declare M1 : constant String := "% has restriction "; S : constant String := Restriction_Id'Image (R); M2 : String (1 .. 200); -- big enough! P : Integer; begin Name_Buffer (1 .. S'Length) := S; Name_Len := S'Length; Set_Casing (Mixed_Case); M2 (M1'Range) := M1; P := M1'Length + 1; M2 (P .. P + S'Length - 1) := Name_Buffer (1 .. S'Length); P := P + S'Length; if R in All_Parameter_Restrictions then M2 (P .. P + 4) := " => #"; Error_Msg_Nat_1 := Int (Cumulative_Restrictions.Value (R)); P := P + 5; end if; Error_Msg_Name_1 := ALIs.Table (A).Sfile; Consistency_Error_Msg (M2 (1 .. P - 1)); Consistency_Error_Msg ("but the following files violate this restriction:"); return; end; end if; end loop; end if; end Print_Restriction_File; -- Start of processing for Check_Consistent_Restrictions begin -- Loop through all restriction violations for R in All_Restrictions loop -- Check for violation of this restriction if Cumulative_Restrictions.Set (R) and then Cumulative_Restrictions.Violated (R) and then (R in Partition_Boolean_Restrictions or else (R in All_Parameter_Restrictions and then Cumulative_Restrictions.Count (R) > Cumulative_Restrictions.Value (R))) then Restriction_File_Output := False; -- Loop through files looking for violators for A2 in ALIs.First .. ALIs.Last loop declare T : ALIs_Record renames ALIs.Table (A2); begin if T.Restrictions.Violated (R) then -- We exclude predefined files from the list of -- violators. This should be rethought. It is not -- clear that this is the right thing to do, that -- is particularly the case for restricted runtimes. if not Is_Internal_File_Name (T.Sfile) then -- Case of Boolean restriction, just print file name if R in All_Boolean_Restrictions then Print_Restriction_File (R); Error_Msg_Name_1 := T.Sfile; Consistency_Error_Msg (" %"); -- Case of Parameter restriction where violation -- count exceeds restriction value, print file -- name and count, adding "at least" if the -- exact count is not known. elsif R in Checked_Add_Parameter_Restrictions or else T.Restrictions.Count (R) > Cumulative_Restrictions.Value (R) then Print_Restriction_File (R); Error_Msg_Name_1 := T.Sfile; Error_Msg_Nat_1 := Int (T.Restrictions.Count (R)); if T.Restrictions.Unknown (R) then Consistency_Error_Msg (" % (count = at least #)"); else Consistency_Error_Msg (" % (count = #)"); end if; end if; end if; end if; end; end loop; end if; end loop; -- Now deal with No_Dependence indications. Note that we put the loop -- through entries in the no dependency table first, since this loop -- is most often empty (no such pragma Restrictions in use). for ND in No_Deps.First .. No_Deps.Last loop declare ND_Unit : constant Name_Id := No_Deps.Table (ND).No_Dep_Unit; begin for J in ALIs.First .. ALIs.Last loop declare A : ALIs_Record renames ALIs.Table (J); begin for K in A.First_Unit .. A.Last_Unit loop declare U : Unit_Record renames Units.Table (K); begin for L in U.First_With .. U.Last_With loop if Same_Unit (Withs.Table (L).Uname, ND_Unit) then Error_Msg_Name_1 := U.Uname; Error_Msg_Name_2 := ND_Unit; Consistency_Error_Msg ("unit & violates restriction " & "No_Dependence => %"); end if; end loop; end; end loop; end; end loop; end; end loop; end Check_Consistent_Restrictions; --------------- -- Same_Unit -- --------------- function Same_Unit (U1 : Name_Id; U2 : Name_Id) return Boolean is begin -- Note, the string U1 has a terminating %s or %b, U2 does not if Length_Of_Name (U1) - 2 = Length_Of_Name (U2) then Get_Name_String (U1); declare U1_Str : constant String := Name_Buffer (1 .. Name_Len - 2); begin Get_Name_String (U2); return U1_Str = Name_Buffer (1 .. Name_Len); end; else return False; end if; end Same_Unit; --------------------------------------------------- -- Check_Consistent_Zero_Cost_Exception_Handling -- --------------------------------------------------- -- Check consistent zero cost exception handling. The rule is that -- all units must have the same exception handling mechanism. procedure Check_Consistent_Zero_Cost_Exception_Handling is begin Check_Mechanism : for A1 in ALIs.First + 1 .. ALIs.Last loop if ALIs.Table (A1).Zero_Cost_Exceptions /= ALIs.Table (ALIs.First).Zero_Cost_Exceptions then Error_Msg_Name_1 := ALIs.Table (A1).Sfile; Error_Msg_Name_2 := ALIs.Table (ALIs.First).Sfile; Consistency_Error_Msg ("% and % compiled with different " & "exception handling mechanisms"); end if; end loop Check_Mechanism; end Check_Consistent_Zero_Cost_Exception_Handling; ----------------------- -- Check_Consistency -- ----------------------- procedure Check_Consistency is Src : Source_Id; -- Source file Id for this Sdep entry ALI_Path_Id : Name_Id; begin -- First, we go through the source table to see if there are any cases -- in which we should go after source files and compute checksums of -- the source files. We need to do this for any file for which we have -- mismatching time stamps and (so far) matching checksums. for S in Source.First .. Source.Last loop -- If all time stamps for a file match, then there is nothing to -- do, since we will not be checking checksums in that case anyway if Source.Table (S).All_Timestamps_Match then null; -- If we did not find the source file, then we can't compute its -- checksum anyway. Note that when we have a time stamp mismatch, -- we try to find the source file unconditionally (i.e. if -- Check_Source_Files is False). elsif not Source.Table (S).Source_Found then null; -- If we already have non-matching or missing checksums, then no -- need to try going after source file, since we won't trust the -- checksums in any case. elsif not Source.Table (S).All_Checksums_Match then null; -- Now we have the case where we have time stamp mismatches, and -- the source file is around, but so far all checksums match. This -- is the case where we need to compute the checksum from the source -- file, since otherwise we would ignore the time stamp mismatches, -- and that is wrong if the checksum of the source does not agree -- with the checksums in the ALI files. elsif Check_Source_Files then if not Checksums_Match (Source.Table (S).Checksum, Get_File_Checksum (Source.Table (S).Sfile)) then Source.Table (S).All_Checksums_Match := False; end if; end if; end loop; -- Loop through ALI files ALIs_Loop : for A in ALIs.First .. ALIs.Last loop -- Loop through Sdep entries in one ALI file Sdep_Loop : for D in ALIs.Table (A).First_Sdep .. ALIs.Table (A).Last_Sdep loop if Sdep.Table (D).Dummy_Entry then goto Continue; end if; Src := Source_Id (Get_Name_Table_Info (Sdep.Table (D).Sfile)); -- If the time stamps match, or all checksums match, then we -- are OK, otherwise we have a definite error. if Sdep.Table (D).Stamp /= Source.Table (Src).Stamp and then not Source.Table (Src).All_Checksums_Match then Error_Msg_Name_1 := ALIs.Table (A).Sfile; Error_Msg_Name_2 := Sdep.Table (D).Sfile; -- Two styles of message, depending on whether or not -- the updated file is the one that must be recompiled if Error_Msg_Name_1 = Error_Msg_Name_2 then if Tolerate_Consistency_Errors then Error_Msg ("?% has been modified and should be recompiled"); else Error_Msg ("% has been modified and must be recompiled"); end if; else ALI_Path_Id := Osint.Find_File ((ALIs.Table (A).Afile), Osint.Library); if Osint.Is_Readonly_Library (ALI_Path_Id) then if Tolerate_Consistency_Errors then Error_Msg ("?% should be recompiled"); Error_Msg_Name_1 := ALI_Path_Id; Error_Msg ("?(% is obsolete and read-only)"); else Error_Msg ("% must be compiled"); Error_Msg_Name_1 := ALI_Path_Id; Error_Msg ("(% is obsolete and read-only)"); end if; elsif Tolerate_Consistency_Errors then Error_Msg ("?% should be recompiled (% has been modified)"); else Error_Msg ("% must be recompiled (% has been modified)"); end if; end if; if (not Tolerate_Consistency_Errors) and Verbose_Mode then declare Msg : constant String := "% time stamp "; Buf : String (1 .. Msg'Length + Time_Stamp_Length); begin Buf (1 .. Msg'Length) := Msg; Buf (Msg'Length + 1 .. Buf'Length) := String (Source.Table (Src).Stamp); Error_Msg_Name_1 := Sdep.Table (D).Sfile; Error_Msg (Buf); end; declare Msg : constant String := " conflicts with % timestamp "; Buf : String (1 .. Msg'Length + Time_Stamp_Length); begin Buf (1 .. Msg'Length) := Msg; Buf (Msg'Length + 1 .. Buf'Length) := String (Sdep.Table (D).Stamp); Error_Msg_Name_1 := Sdep.Table (D).Sfile; Error_Msg (Buf); end; end if; -- Exit from the loop through Sdep entries once we find one -- that does not match. exit Sdep_Loop; end if; <<Continue>> null; end loop Sdep_Loop; end loop ALIs_Loop; end Check_Consistency; ------------------------------- -- Check_Duplicated_Subunits -- ------------------------------- procedure Check_Duplicated_Subunits is begin for J in Sdep.First .. Sdep.Last loop if Sdep.Table (J).Subunit_Name /= No_Name then Get_Decoded_Name_String (Sdep.Table (J).Subunit_Name); Name_Len := Name_Len + 2; Name_Buffer (Name_Len - 1) := '%'; -- See if there is a body or spec with the same name for K in Boolean loop if K then Name_Buffer (Name_Len) := 'b'; else Name_Buffer (Name_Len) := 's'; end if; declare Info : constant Int := Get_Name_Table_Info (Name_Find); begin if Info /= 0 then Set_Standard_Error; Write_Str ("error: subunit """); Write_Name_Decoded (Sdep.Table (J).Subunit_Name); Write_Str (""" in file """); Write_Name_Decoded (Sdep.Table (J).Sfile); Write_Char ('"'); Write_Eol; Write_Str (" has same name as unit """); Write_Unit_Name (Units.Table (Unit_Id (Info)).Uname); Write_Str (""" found in file """); Write_Name_Decoded (Units.Table (Unit_Id (Info)).Sfile); Write_Char ('"'); Write_Eol; Write_Str (" this is not allowed within a single " & "partition (RM 10.2(19))"); Write_Eol; Osint.Exit_Program (Osint.E_Fatal); end if; end; end loop; end if; end loop; end Check_Duplicated_Subunits; -------------------- -- Check_Versions -- -------------------- procedure Check_Versions is VL : constant Natural := ALIs.Table (ALIs.First).Ver_Len; begin for A in ALIs.First .. ALIs.Last loop if ALIs.Table (A).Ver_Len /= VL or else ALIs.Table (A).Ver (1 .. VL) /= ALIs.Table (ALIs.First).Ver (1 .. VL) then Error_Msg_Name_1 := ALIs.Table (A).Sfile; Error_Msg_Name_2 := ALIs.Table (ALIs.First).Sfile; Consistency_Error_Msg ("% and % compiled with different GNAT versions"); end if; end loop; end Check_Versions; --------------------------- -- Consistency_Error_Msg -- --------------------------- procedure Consistency_Error_Msg (Msg : String) is begin if Tolerate_Consistency_Errors then -- If consistency errors are tolerated, -- output the message as a warning. declare Warning_Msg : String (1 .. Msg'Length + 1); begin Warning_Msg (1) := '?'; Warning_Msg (2 .. Warning_Msg'Last) := Msg; Error_Msg (Warning_Msg); end; -- Otherwise the consistency error is a true error else Error_Msg (Msg); end if; end Consistency_Error_Msg; end Bcheck;
programs/oeis/119/A119281.asm
neoneye/loda
22
168933
<reponame>neoneye/loda ; A119281: Number of counting rods to represent n in the ancient Chinese rod numeral system. ; 0,1,2,3,4,5,2,3,4,5,1,2,3,4,5,6,3,4,5,6,2,3,4,5,6,7,4,5,6,7,3,4,5,6,7,8,5,6,7,8,4,5,6,7,8,9,6,7,8,9,5,6,7,8,9,10,7,8,9,10,2,3,4,5,6,7,4,5,6,7,3,4,5,6,7,8,5,6,7,8,4,5,6,7,8,9,6,7,8,9,5,6,7,8,9,10,7,8,9,10 lpb $0 mov $2,$0 mod $2,10 lpb $2 add $1,1 sub $2,1 dif $2,5 lpe div $0,10 lpe mov $0,$1
src/covidsim.adb
mgrojo/COVID-19_Simulator
6
14726
with Qt; use Qt; with Qt.QApplication; use Qt.QApplication; with Qt.QWidget; use Qt.QWidget; with CovidSimForm; use CovidSimForm; procedure covidsim is begin covidsim_form_init; QWidget_show(covidsim_form); QApplication_invoke; end;
Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_1457.asm
ljhsiun2/medusa
9
4922
<reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_1457.asm .global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r9 push %rax push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0xaf94, %rsi lea addresses_WT_ht+0x19fd4, %rdi nop nop nop nop nop inc %r13 mov $3, %rcx rep movsl nop nop inc %rax lea addresses_UC_ht+0x881c, %rsi lea addresses_UC_ht+0x1db94, %rdi nop nop xor %r9, %r9 mov $73, %rcx rep movsw nop nop inc %r9 lea addresses_WT_ht+0xa394, %rdi nop sub %r9, %r9 mov $0x6162636465666768, %rcx movq %rcx, %xmm6 movups %xmm6, (%rdi) nop nop nop nop nop and $64406, %rdi lea addresses_normal_ht+0x1823c, %rdi nop inc %r10 mov (%rdi), %rsi inc %rdi lea addresses_WT_ht+0x12094, %rsi lea addresses_WC_ht+0x1df94, %rdi clflush (%rdi) nop cmp %rdx, %rdx mov $121, %rcx rep movsb xor %rdx, %rdx lea addresses_A_ht+0x1448c, %r13 nop nop nop nop nop cmp $60161, %rsi mov (%r13), %di nop nop nop dec %r13 lea addresses_UC_ht+0x16994, %rsi lea addresses_normal_ht+0x1e154, %rdi nop nop xor %rax, %rax mov $26, %rcx rep movsl nop nop cmp %rdx, %rdx lea addresses_WT_ht+0x16e94, %rsi lea addresses_WC_ht+0xce94, %rdi nop nop nop nop sub %rdx, %rdx mov $124, %rcx rep movsw nop cmp %rdx, %rdx lea addresses_normal_ht+0x3f94, %r9 nop nop nop nop nop and %rsi, %rsi movw $0x6162, (%r9) nop nop nop nop sub %rax, %rax lea addresses_WC_ht+0x1c0c9, %rax nop nop nop add %r9, %r9 movl $0x61626364, (%rax) and $12861, %r9 lea addresses_UC_ht+0x73ea, %rax and %r10, %r10 mov (%rax), %dx nop nop nop sub %rdi, %rdi lea addresses_WT_ht+0x1f94, %rdx clflush (%rdx) nop nop nop xor $15434, %r13 mov $0x6162636465666768, %rax movq %rax, %xmm6 vmovups %ymm6, (%rdx) nop nop sub %rdx, %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r8 push %r9 push %rax push %rcx push %rdi // Load lea addresses_PSE+0x1ff94, %r14 nop dec %rdi mov (%r14), %rcx add $38920, %r8 // Faulty Load lea addresses_US+0xc794, %r13 clflush (%r13) nop xor $29081, %r9 vmovups (%r13), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $0, %xmm2, %r14 lea oracles, %r9 and $0xff, %r14 shlq $12, %r14 mov (%r9,%r14,1), %r14 pop %rdi pop %rcx pop %rax pop %r9 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': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': False, 'NT': True}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 10, 'size': 16, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 2, 'size': 8, 'same': False, 'NT': True}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 1, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 8, 'size': 32, 'same': False, 'NT': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
source/function/rmouse.asm
mega65dev/rom-assembler
0
101670
<gh_stars>0 ; ******************************************************************************************** ; ******************************************************************************************** ; ; Name : rmouse.asm ; Purpose : .. ; Created : 15th Nov 1991 ; Updated : 4th Jan 2021 ; Authors : <NAME> ; ; ******************************************************************************************** ; ******************************************************************************************** ;************************************************************************ ;* RMOUSE Returns in variable list current status of mouse * ;* * ;* Syntax: RMOUSE [Xposition [,Yposition [, Buttons] ]] * ;* * ;* Where: X,Yposition = current position of mouse pointer sprite * ;* Button = current status of mouse buttons * ;* * ;* 0 = no button * ;* 1 = right button * ;* 128 = left button * ;* 129 = both buttons * ;* * ;* If a mouse is not installed, "-1" is returned for all vars. * ;* If both ports are enabled, buttons from each port are merged. * ;************************************************************************ rmouse lda #0 ; Init sta count ; variable count = 0 dec ldx #6-1 l260_1 sta grapnt,x ; positions/buttons = -1 dex bpl l260_1 lda _mouse_enable ; Is there a mouse in the house? and #%11000000 beq l260_5 ; no, exit pha ; yes, save port assigns for later sei ldy _mouse_pointer ; Where is it? Get pointer to sprite lda vic,y ; Get X position ???vic_save sta grapnt ; lsb lda sbits,y and vic+16 ; msb ???vic_save beq l260_2 lda #1 ; convert to 0 or 1 l260_2 sta grapnt+1 iny ; Get Y position lda vic,y ; lsb ???vic_save sta grapnt+2 lda #0 ; msb (fake it) sta grapnt+3 sta grapnt+4 ; Init button status sta grapnt+5 ldz d1pra ; Set up port & read buttons lda #$ff ; save kybd output lines (IRQ already disabled) sta d1pra ; set to not read any kybd inputs ldy #0 ; which port? plx ; recall port assignments l260_3 txa asl ; .c=1 if this one tax bcc l260_4 ; not this one lda d1pra,y ; read it (logical port is opposite physical port) and #%00010001 ; want left, right buttons only eor #%00010001 ; (invert, since low means button down) tsb grapnt+4 and #%00010000 ; shift left button to msb beq l260_4 smb7 grapnt+4 l260_4 iny ; next port cpy #2 bcc l260_3 lda #%01111110 ; clean up trb grapnt+4 ; fix button register stz d1pra ; restore port for Kernel cli ; At this point, we have snapshot the current mouse status. ; Now pass requested info along in a manner very similar to RREG... l260_5 jsr chrgot ; Get a variable name from variable list beq l260_8 ; eol- exit cmp #',' ; beq l260_7 ; null- skip this arg jsr ptrget ; Get pointer to target variable sta forpnt ; set up so we can share LET code sty forpnt+1 lda valtyp ; what kind of variable name did ptrget find? +lbne chkerr ; string- type mismatch error l260_6 ldx count ; Make assignment ldy grapnt,x ; low byte lda grapnt+1,x ; high byte jsr givayf ; float it lda intflg ; set flags for type of var (int/float) jsr qintgr ; use part of LET to do the work l260_7 inc count ; Next assignment inc count ldx count cpx #6 ; there are 3 possible bcs l260_8 ; done all 3, exit jsr chrgot ; check terminator beq l260_8 ; eol- exit jsr chkcom ; check delimiter bra l260_5 ; loop until done l260_8 rts ;.end ; ******************************************************************************************** ; ; Date Changes ; ==== ======= ; ; ********************************************************************************************
src/main/antlr/LightJass.g4
Cokemonkey11/wc3libs
22
7586
<filename>src/main/antlr/LightJass.g4<gh_stars>10-100 // Define a grammar called Jass grammar LightJass; options { language = Java; } @header { package net.moonlightflower.wc3libs.antlr; } BOOL_LITERAL: 'true' | 'false' ; int_literal: ID_INT_LITERAL | DEC_INT_LITERAL | OCT_INT_LITERAL | HEX_INT_LITERAL ; DEC_INT_LITERAL: [1-9] [0-9]* | [0-9] ; OCT_INT_LITERAL: '0' [0-7]* ; HEX_INT_LITERAL: (('0' [xX]) | '$') [0-9a-fA-F]+ ; ID_INT_LITERAL: '\'' ([\u0000-\u0026\u0028-\u00FF]+) '\'' ; REAL_LITERAL: ([0-9]+ '.' [0-9]*) | ('.' [0-9]+) ; STRING_LITERAL: '"' ( EscapeSequence | ~('\\'|'"'|'\r'|'\n') | NEW_LINES )* '"'; NULL_LITERAL: 'null'; COMMENT_SINGLE: '//' (~('\n'|'\r'))*; COMMENT_BLOCK: '/*' (~('*') | ('*' + ~('/')))* '*/'; fragment EscapeSequence: '\\' [abfnrtvz"'\\]; CURLY_L: '{' ; CURLY_R: '}' ; COMMA: ',' ; NEW_LINES: ('\r\n' | '\n' | '\r')+ ; PARENS_L: '('; PARENS_R: ')'; BRACKET_L: '['; BRACKET_R: ']'; LOCAL: 'local'; ARRAY_DECL: 'array'; CONST_DECL: 'constant'; BOOL_OP_CONJUNCT: 'and'; BOOL_OP_DISJUNCT: 'or' ; BOOL_OP_NEG: 'not' ; GLOBALS_START: 'globals'; GLOBALS_END: 'endglobals'; DEBUG: 'debug'; FUNCTION: 'function'; ENDFUNCTION: 'endfunction'; TAKES: 'takes'; RETURNS: 'returns'; RETURN: 'return'; NOTHING: 'nothing'; ASSIGN_OP: '='; TYPE_DECL: 'type'; TYPE_EXTENDS: 'extends'; NATIVE: 'native'; CALL: 'call'; SET: 'set'; IF: 'if'; THEN: 'then'; ELSE: 'else'; ELSEIF: 'elseif'; ENDIF: 'endif'; LOOP: 'loop'; ENDLOOP: 'endloop'; EXITWHEN: 'exitwhen'; WS: (' ' | '\t')+ -> skip ; ID: ID_START (ID_TAIL)* ; fragment ID_START: [A-Za-z] ; fragment ID_TAIL: [A-Z] | [a-z] | [0-9] | '_' ; ADD: '+'; SUB: '-'; MULT: '*'; DIV: '/'; MOD: '%'; LESS: '<'; LESS_EQUAL: '<='; EQUAL: '=='; UNEQUAL: '!='; GREATER: '>'; GREATER_EQUAL: '>='; root: NEW_LINES? (top_decl (NEW_LINES top_decl)*)? NEW_LINES?; top_decl: type_decl | native_decl | globals_block | func_impl ; globals_block: GLOBALS_START NEW_LINES (global_decl NEW_LINES)* NEW_LINES? GLOBALS_END ; var_name: ID; func_name: ID; type_name: ID; var_ref: ID; func_ref: ID; type_ref: ID; global_decl: type_ref ARRAY_DECL var_name | CONST_DECL? type_ref var_name (ASSIGN_OP val=expr)? ; expr: expr_prim | PARENS_L expr PARENS_R | BOOL_OP_NEG expr | ADD expr | SUB expr | expr (MULT | DIV | MOD) expr | expr (ADD | SUB) expr | expr (LESS | LESS_EQUAL | GREATER | GREATER_EQUAL) expr | expr (EQUAL | UNEQUAL) expr | expr BOOL_OP_CONJUNCT expr | expr BOOL_OP_DISJUNCT expr ; expr_prim: array_read | var_ref | func_call | literal ; literal: NULL_LITERAL | FUNCTION func_ref | BOOL_LITERAL | OCT_INT_LITERAL | DEC_INT_LITERAL | HEX_INT_LITERAL | ID_INT_LITERAL | REAL_LITERAL | STRING_LITERAL ; func_call: func_ref PARENS_L arg_list PARENS_R; arg_list: (expr (COMMA expr)*)? ; array_read: var_ref BRACKET_L expr BRACKET_R; local_var_decl: LOCAL ( ( type_ref ARRAY_DECL var_name ) | ( type_ref var_name (ASSIGN_OP expr)? ) ) ; local_var_decl_list: local_var_decl (NEW_LINES local_var_decl)* ; statement: call | set_var | selection | loop | exitwhen | rule_return | debug ; statement_list: statement (NEW_LINES statement)* ; call: CALL func_call ; set_var: SET var_ref (BRACKET_L index=expr BRACKET_R)? ASSIGN_OP val=expr ; condition: expr ; selection_elseif_branch: ELSEIF condition THEN NEW_LINES statement_list? NEW_LINES? ; selection_else_branch: ELSE NEW_LINES statement_list? NEW_LINES? ; selection: IF condition THEN NEW_LINES thenStatements=statement_list? NEW_LINES? elseif_branches+=selection_elseif_branch* else_branch=selection_else_branch? ENDIF ; loop: LOOP NEW_LINES (loop_body NEW_LINES)? NEW_LINES? ENDLOOP ; exitwhen: EXITWHEN condition ; loop_body: loop_body_line (NEW_LINES loop_body_line)*; loop_body_line: statement_list ; rule_return: RETURN expr? ; debug: DEBUG (call | set_var | selection | loop) ; func_decl: CONST_DECL? FUNCTION func_name TAKES params=func_param_list RETURNS returnType=func_return_type ; func_impl: func_decl NEW_LINES (body=func_body NEW_LINES)? ENDFUNCTION ; func_return_type: NOTHING | type_ref ; func_param_list: NOTHING | (params=func_param (COMMA func_param)*) ; func_param: type_ref var_name ; func_body: local_var_decl_list | statement_list | local_var_decl_list NEW_LINES statement_list ; type_decl: TYPE_DECL type_name TYPE_EXTENDS type_ref ; native_decl: CONST_DECL? NATIVE func_name TAKES params=func_param_list RETURNS returnType=func_return_type ;
extern/game_support/stm32f4/src/numerics.ads
AdaCore/training_material
15
21343
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . N U M E R I C S -- -- -- -- S p e c -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ package Numerics is pragma Pure; Argument_Error : exception; Pi : constant := 3.14159_26535_89793_23846_26433_83279_50288_41971_69399_37511; ["03C0"] : constant := Pi; -- This is the Greek letter Pi (for Ada 2005 AI-388). Note that it is -- conforming to have this constant present even in Ada 95 mode, as there -- is no way for a normal mode Ada 95 program to reference this identifier. e : constant := 2.71828_18284_59045_23536_02874_71352_66249_77572_47093_69996; end Numerics;
src/Quasigroup.agda
Akshobhya1234/agda-NonAssociativeAlgebra
2
2670
<reponame>Akshobhya1234/agda-NonAssociativeAlgebra {-# OPTIONS --without-K --safe #-} module Quasigroup where open import Quasigroup.Bundles public open import Quasigroup.Definitions public open import Quasigroup.Structures public
programs/oeis/273/A273782.asm
neoneye/loda
22
16232
; A273782: First differences of number of active (ON,black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 929", based on the 5-celled von Neumann neighborhood. ; 3,17,27,33,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152,160,168,176,184,192,200,208,216,224,232,240,248,256,264,272,280,288,296,304,312,320,328,336,344,352,360,368,376,384,392,400,408,416,424,432,440,448,456,464,472,480,488,496,504,512,520,528,536,544,552,560,568,576,584,592,600,608,616,624,632,640,648,656,664,672,680,688,696,704,712,720,728,736,744,752,760,768,776,784,792,800 mov $2,$0 mov $4,$0 mov $5,$0 trn $5,2 mov $3,$5 lpb $0 mov $0,$3 add $1,5 sub $4,$3 trn $4,$3 lpe add $1,$4 mov $5,$1 trn $1,6 add $1,$5 lpb $2 add $1,8 sub $2,1 lpe add $1,3 mov $0,$1
Transynther/x86/_processed/NONE/_st_zr_/i9-9900K_12_0xa0_notsx.log_3009_929.asm
ljhsiun2/medusa
9
9159
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r8 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x1e6ec, %r10 nop xor $35071, %r9 mov (%r10), %r14d nop nop nop cmp %rbx, %rbx lea addresses_D_ht+0x9ec, %rsi lea addresses_WT_ht+0xef2c, %rdi nop nop nop nop sub $5364, %rbx mov $35, %rcx rep movsl nop nop nop nop add $55163, %rdi lea addresses_UC_ht+0x46ec, %rdi nop nop nop add %rbx, %rbx mov (%rdi), %r14w nop nop cmp $17899, %rbx lea addresses_WC_ht+0x3fec, %r9 add $44856, %rcx movups (%r9), %xmm2 vpextrq $1, %xmm2, %rsi nop nop add %rsi, %rsi lea addresses_D_ht+0x134ec, %r14 nop and $28680, %rbx mov $0x6162636465666768, %rsi movq %rsi, (%r14) cmp %r10, %r10 lea addresses_WT_ht+0x17e52, %rsi nop nop nop add %rbx, %rbx mov (%rsi), %rcx nop xor $49952, %rbx lea addresses_A_ht+0x1b3ec, %rsi dec %rdi movw $0x6162, (%rsi) nop nop sub %rdi, %rdi lea addresses_A_ht+0xd16c, %rsi nop nop nop nop inc %rcx movups (%rsi), %xmm0 vpextrq $0, %xmm0, %r9 and %r14, %r14 lea addresses_WC_ht+0x3fec, %r10 nop nop nop nop xor $32890, %r9 mov (%r10), %ebx nop nop nop nop dec %r9 lea addresses_UC_ht+0x1afac, %rsi lea addresses_WC_ht+0x499c, %rdi and %r8, %r8 mov $122, %rcx rep movsw nop nop and $28949, %r9 lea addresses_WC_ht+0x1b940, %rdi xor $53458, %r10 mov $0x6162636465666768, %rbx movq %rbx, %xmm0 vmovups %ymm0, (%rdi) nop dec %r10 lea addresses_WC_ht+0x153ec, %rsi lea addresses_WC_ht+0xabec, %rdi nop nop nop nop and %r9, %r9 mov $102, %rcx rep movsb nop nop nop nop cmp $10820, %r10 lea addresses_WT_ht+0x64a2, %r9 clflush (%r9) nop nop nop inc %rdi mov $0x6162636465666768, %r8 movq %r8, (%r9) nop sub $58693, %r8 pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r8 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r8 push %r9 push %rbp push %rcx push %rdi push %rsi // Store lea addresses_D+0x91ec, %r8 clflush (%r8) nop nop cmp $61041, %r9 mov $0x5152535455565758, %r13 movq %r13, %xmm5 vmovups %ymm5, (%r8) dec %rcx // Store lea addresses_A+0x53ec, %r10 nop inc %r11 mov $0x5152535455565758, %r8 movq %r8, %xmm7 movups %xmm7, (%r10) xor %rbp, %rbp // Load lea addresses_normal+0x1e9ec, %rbp nop nop nop nop nop cmp $61324, %r9 mov (%rbp), %ecx nop nop nop nop add %rbp, %rbp // REPMOV lea addresses_PSE+0x1b7d4, %rsi lea addresses_RW+0x15946, %rdi nop inc %r9 mov $89, %rcx rep movsw nop nop nop nop nop and %rsi, %rsi // Faulty Load lea addresses_A+0x1efec, %r13 nop xor %rsi, %rsi movups (%r13), %xmm3 vpextrq $1, %xmm3, %r8 lea oracles, %rdi and $0xff, %r8 shlq $12, %r8 mov (%rdi,%r8,1), %r8 pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r8 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 10}} {'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'} {'src': {'type': 'addresses_PSE', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_RW', 'congruent': 1, 'same': False}} [Faulty Load] {'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}} {'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2, 'NT': True, 'same': False, 'congruent': 8}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': True, 'size': 8, 'NT': False, 'same': False, 'congruent': 7}} {'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8, 'NT': True, 'same': False, 'congruent': 1}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': True, 'size': 2, 'NT': False, 'same': False, 'congruent': 10}} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 1}} {'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': True, 'size': 8, 'NT': False, 'same': False, 'congruent': 1}} {'00': 4, '33': 3005} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 00 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
source/nls/a-envenc.ads
ytomino/drake
33
11016
pragma License (Unrestricted); -- extended unit with Ada.IO_Exceptions; with Ada.Streams; private with Ada.Finalization; private with System.Native_Environment_Encoding; package Ada.Environment_Encoding is -- Platform-depended text encoding. pragma Preelaborate; -- encoding identifier type Encoding_Id is private; function Image (Encoding : Encoding_Id) return String; pragma Inline (Image); -- renamed function Default_Substitute (Encoding : Encoding_Id) return Streams.Stream_Element_Array; pragma Inline (Default_Substitute); -- renamed function Min_Size_In_Stream_Elements (Encoding : Encoding_Id) return Streams.Stream_Element_Offset; pragma Inline (Min_Size_In_Stream_Elements); -- renamed UTF_8 : constant Encoding_Id; UTF_16 : constant Encoding_Id; UTF_32 : constant Encoding_Id; function Current_Encoding return Encoding_Id; pragma Inline (Current_Encoding); -- renamed -- subsidiary types to converter type Subsequence_Status_Type is ( Finished, Success, Overflow, -- the output buffer is not large enough Illegal_Sequence, -- a input character could not be mapped to the output Truncated); -- the input buffer is broken off at a multi-byte character type Continuing_Status_Type is new Subsequence_Status_Type range Success .. Subsequence_Status_Type'Last; type Finishing_Status_Type is new Subsequence_Status_Type range Finished .. Overflow; type Status_Type is new Subsequence_Status_Type range Finished .. Illegal_Sequence; type Substituting_Status_Type is new Status_Type range Finished .. Overflow; subtype True_Only is Boolean range True .. True; -- converter type Converter is limited private; -- subtype Open_Converter is Converter -- with -- Dynamic_Predicate => Is_Open (Converter), -- Predicate_Failure => raise Status_Error; function Is_Open (Object : Converter) return Boolean; pragma Inline (Is_Open); function Min_Size_In_From_Stream_Elements ( Object : Converter) -- Open_Converter return Streams.Stream_Element_Offset; pragma Inline (Min_Size_In_From_Stream_Elements); function Substitute ( Object : Converter) -- Open_Converter return Streams.Stream_Element_Array; pragma Inline (Substitute); procedure Set_Substitute ( Object : in out Converter; -- Open_Converter Substitute : Streams.Stream_Element_Array); -- convert subsequence procedure Convert ( Object : Converter; -- Open_Converter Item : Streams.Stream_Element_Array; Last : out Streams.Stream_Element_Offset; Out_Item : out Streams.Stream_Element_Array; Out_Last : out Streams.Stream_Element_Offset; Finish : Boolean; Status : out Subsequence_Status_Type); procedure Convert ( Object : Converter; -- Open_Converter Item : Streams.Stream_Element_Array; Last : out Streams.Stream_Element_Offset; Out_Item : out Streams.Stream_Element_Array; Out_Last : out Streams.Stream_Element_Offset; Status : out Continuing_Status_Type); procedure Convert ( Object : Converter; -- Open_Converter Out_Item : out Streams.Stream_Element_Array; Out_Last : out Streams.Stream_Element_Offset; Finish : True_Only; Status : out Finishing_Status_Type); -- convert all character sequence procedure Convert ( Object : Converter; -- Open_Converter Item : Streams.Stream_Element_Array; Last : out Streams.Stream_Element_Offset; Out_Item : out Streams.Stream_Element_Array; Out_Last : out Streams.Stream_Element_Offset; Finish : True_Only; Status : out Status_Type); -- convert all character sequence with substitute procedure Convert ( Object : Converter; -- Open_Converter Item : Streams.Stream_Element_Array; Last : out Streams.Stream_Element_Offset; Out_Item : out Streams.Stream_Element_Array; Out_Last : out Streams.Stream_Element_Offset; Finish : True_Only; Status : out Substituting_Status_Type); -- exceptions Status_Error : exception renames IO_Exceptions.Status_Error; Name_Error : exception renames IO_Exceptions.Name_Error; Use_Error : exception renames IO_Exceptions.Use_Error; private -- max length of one multi-byte character Max_Substitute_Length : constant := System.Native_Environment_Encoding.Max_Substitute_Length; -- encoding identifier type Encoding_Id is new System.Native_Environment_Encoding.Encoding_Id; function Image (Encoding : Encoding_Id) return String renames Get_Image; function Default_Substitute (Encoding : Encoding_Id) return Streams.Stream_Element_Array renames Get_Default_Substitute; function Min_Size_In_Stream_Elements (Encoding : Encoding_Id) return Streams.Stream_Element_Offset renames Get_Min_Size_In_Stream_Elements; UTF_8 : constant Encoding_Id := Encoding_Id (System.Native_Environment_Encoding.UTF_8); UTF_16 : constant Encoding_Id := Encoding_Id (System.Native_Environment_Encoding.UTF_16); UTF_32 : constant Encoding_Id := Encoding_Id (System.Native_Environment_Encoding.UTF_32); function Current_Encoding return Encoding_Id renames Get_Current_Encoding; -- converter package Controlled is type Converter is limited private; function Reference (Object : Environment_Encoding.Converter) return not null access System.Native_Environment_Encoding.Converter; function Open (From, To : Encoding_Id) return Environment_Encoding.Converter; -- [gcc-7] strange error if this function is placed outside of -- the package Controlled, and Disable_Controlled => True private type Converter is limited new Finalization.Limited_Controlled with record Data : aliased System.Native_Environment_Encoding.Converter := (others => <>); end record with Disable_Controlled => System.Native_Environment_Encoding.Disable_Controlled; overriding procedure Finalize (Object : in out Converter); end Controlled; type Converter is new Controlled.Converter; end Ada.Environment_Encoding;
level.agda
rfindler/ial
29
2867
<filename>level.agda -- mostly adapted from Agda stdlib module level where import Agda.Primitive open Agda.Primitive public using (Level ; _⊔_ ; lsuc ; lzero) level = Level lone : level lone = lsuc lzero record Lift {a ℓ} (A : Set a) : Set (a ⊔ ℓ) where constructor lift field lower : A open Lift public
alloy4fun_models/trashltl/models/4/psnnLqWssMDi2RzLs.als
Kaixi26/org.alloytools.alloy
0
5022
open main pred idpsnnLqWssMDi2RzLs_prop5 { no Trash and eventually some Trash } pred __repair { idpsnnLqWssMDi2RzLs_prop5 } check __repair { idpsnnLqWssMDi2RzLs_prop5 <=> prop5o }
oeis/227/A227234.asm
neoneye/loda-programs
11
170970
; A227234: G.f.: Sum_{n>=1} x^n * (1+x)^prime(n). ; Submitted by <NAME> ; 1,3,5,9,19,43,109,297,793,2059,5382,14319,38897,110525,335225,1067923,3449922,11058922,35087589,110642516,346605981,1072833978,3270252617,9869924183,29933522269,92890564700,298225920323,987831491085,3330591758612,11254395868044,37691422431130,124450270430236 mov $2,$0 add $2,1 mov $3,$0 lpb $2 mov $0,$3 sub $2,1 sub $0,$2 seq $0,40 ; The prime numbers. bin $0,$2 add $1,$0 lpe mov $0,$1
src/main/fragment/mos6502-common/vwum1_gt_vbuyy_then_la1.asm
jbrandwood/kickc
2
7126
lda {m1}+1 bne {la1} cpy {m1} bcc {la1}
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c35502c.ada
best08618/asylo
7
13007
-- C35502C.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 THE ATTRIBUTES 'IMAGE' AND 'VALUE' YIELD THE CORRECT -- RESULTS WHEN THE PREFIX IS AN ENUMERATION TYPE OTHER THAN A BOOLEAN -- OR A CHARACTER TYPE. -- SUBTESTS ARE: -- PART (A). TESTS FOR IMAGE. -- PART (B). TESTS FOR VALUE. -- RJW 5/07/86 WITH REPORT; USE REPORT; PROCEDURE C35502C IS TYPE ENUM IS (A, BC, ABC, A_B_C, abcd); SUBTYPE SUBENUM IS ENUM RANGE A .. BC; TYPE NEWENUM IS NEW ENUM; FUNCTION IDENT (X : ENUM) RETURN ENUM IS BEGIN IF EQUAL (ENUM'POS (X), ENUM'POS(X)) THEN RETURN X; END IF; RETURN ENUM'FIRST; END IDENT; BEGIN TEST( "C35502C" , "CHECK THAT THE ATTRIBUTES 'IMAGE' AND " & "'VALUE' YIELD THE CORRECT RESULTS " & "WHEN THE PREFIX IS AN ENUMERATION TYPE " & "OTHER THAN A BOOLEAN OR A CHARACTER TYPE" ); -- PART (A). BEGIN IF ENUM'IMAGE ( IDENT(ABC) ) /= "ABC" THEN FAILED ( "INCORRECT ENUM'IMAGE FOR ABC" ); END IF; IF ENUM'IMAGE ( IDENT(ABC) )'FIRST /= 1 THEN FAILED ( "INCORRECT LOWER BOUND FOR ABC IN ENUM" ); END IF; IF ENUM'IMAGE ( IDENT(A_B_C) ) /= "A_B_C" THEN FAILED ( "INCORRECT ENUM'IMAGE FOR A_B_C" ); END IF; IF ENUM'IMAGE ( IDENT(A_B_C) )'FIRST /= 1 THEN FAILED ( "INCORRECT LOWER BOUND FOR A_B_C IN ENUM" ); END IF; IF SUBENUM'IMAGE ( IDENT(A_B_C) ) /= "A_B_C" THEN FAILED ( "INCORRECT SUBENUM'IMAGE FOR A_B_C" ); END IF; IF SUBENUM'IMAGE ( IDENT(ABC) )'FIRST /= 1 THEN FAILED ( "INCORRECT LOWER BOUND FOR ABC " & "IN SUBENUM" ); END IF; IF NEWENUM'IMAGE ( ABC ) /= IDENT_STR("ABC") THEN FAILED ( "INCORRECT NEWENUM'IMAGE FOR ABC" ); END IF; IF NEWENUM'IMAGE ( ABC )'FIRST /= IDENT_INT(1) THEN FAILED ( "INCORRECT LOWER BOUND FOR ABC" & "IN NEWENUM" ); END IF; IF ENUM'IMAGE ( IDENT(abcd) ) /= "ABCD" THEN FAILED ( "INCORRECT ENUM'IMAGE FOR abcd" ); END IF; IF ENUM'IMAGE ( IDENT(abcd) )'FIRST /= 1 THEN FAILED ( "INCORRECT LOWER BOUND FOR abcd IN ENUM" ); END IF; END; ----------------------------------------------------------------------- -- PART (B). BEGIN IF ENUM'VALUE (IDENT_STR("ABC")) /= ABC THEN FAILED ( "INCORRECT VALUE FOR ""ABC""" ); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED - VALUE FOR ""ABC""" ); END; BEGIN IF ENUM'VALUE (IDENT_STR("abc")) /= abc THEN FAILED ( "INCORRECT VALUE FOR ""abc""" ); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED - VALUE FOR ""abc""" ); END; BEGIN IF ENUM'VALUE ("ABC") /= ABC THEN FAILED ( "INCORRECT VALUE FOR ABC" ); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED - VALUE FOR ABC" ); END; BEGIN IF NEWENUM'VALUE (IDENT_STR("abcd")) /= abcd THEN FAILED ( "INCORRECT VALUE FOR ""abcd""" ); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED - VALUE FOR ""abcd""" ); END; BEGIN IF NEWENUM'VALUE (IDENT_STR("ABCD")) /= abcd THEN FAILED ( "INCORRECT VALUE FOR ""ABCD""" ); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED - VALUE FOR ""ABCD""" ); END; BEGIN IF NEWENUM'VALUE ("abcd") /= abcd THEN FAILED ( "INCORRECT VALUE FOR abcd" ); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED - VALUE FOR abcd" ); END; BEGIN IF SUBENUM'VALUE (IDENT_STR("A_B_C")) /= A_B_C THEN FAILED ( "INCORRECT VALUE FOR ""A_B_C""" ); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED - VALUE FOR ""A_B_C""" ); END; BEGIN IF ENUM'VALUE (IDENT_STR("ABC ")) /= ABC THEN FAILED ( "INCORRECT VALUE WITH TRAILING BLANKS" ); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED - VALUE WITH " & "TRAILING BLANKS" ); END; BEGIN IF NEWENUM'VALUE (IDENT_STR(" A_B_C")) /= A_B_C THEN FAILED ( "INCORRECT VALUE WITH LEADING BLANKS" ); END IF; EXCEPTION WHEN OTHERS => FAILED ( "EXCEPTION RAISED - VALUE WITH LEADING " & "BLANKS" ); END; BEGIN IF ENUM'VALUE (IDENT_STR("A_BC")) /= ABC THEN FAILED ( "NO EXCEPTION RAISED - ""A_BC"" - 1" ); ELSE FAILED ( "NO EXCEPTION RAISED - ""A_BC"" - 2" ); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - ""A_BC""" ); END; BEGIN IF ENUM'VALUE (IDENT_STR("A BC")) /= ABC THEN FAILED ( "NO EXCEPTION RAISED - ""A BC"" - 1" ); ELSE FAILED ( "NO EXCEPTION RAISED - ""A BC"" - 2" ); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - ""A BC""" ); END; BEGIN IF ENUM'VALUE (IDENT_STR("A&BC")) /= ABC THEN FAILED ( "NO EXCEPTION RAISED - ""A&BC"" - 1" ); ELSE FAILED ( "NO EXCEPTION RAISED - ""A&BC"" - 2" ); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - ""A&BC""" ); END; BEGIN IF ENUM'VALUE (IDENT_CHAR(ASCII.HT) & "BC") /= BC THEN FAILED ( "NO EXCEPTION RAISED - LEADING 'HT' - 1" ); ELSE FAILED ( "NO EXCEPTION RAISED - LEADING 'HT' - 2" ); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - LEADING 'HT'" ); END; BEGIN IF NEWENUM'VALUE ("A" & (IDENT_CHAR(ASCII.HT))) /= A THEN FAILED ( "NO EXCEPTION RAISED - TRAILING 'HT' - 1" ); ELSE FAILED ( "NO EXCEPTION RAISED - TRAILING 'HT' - 2" ); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - TRAILING 'HT'" ); END; BEGIN IF ENUM'VALUE (IDENT_STR("B__C")) /= BC THEN FAILED ( "NO EXCEPTION RAISED - " & "CONSECUTIVE UNDERSCORES - 1" ); ELSE FAILED ( "NO EXCEPTION RAISED - " & "CONSECUTIVE UNDERSCORES - 2" ); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - " & "CONSECUTIVE UNDERSCORES" ); END; BEGIN IF NEWENUM'VALUE (IDENT_STR("BC_")) /= BC THEN FAILED ( "NO EXCEPTION RAISED - " & "TRAILING UNDERSCORE - 1" ); ELSE FAILED ( "NO EXCEPTION RAISED - " & "TRAILING UNDERSCORE - 2" ); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - " & "TRAILING UNDERSCORE" ); END; BEGIN IF SUBENUM'VALUE (IDENT_STR("_BC")) /= BC THEN FAILED ( "NO EXCEPTION RAISED - " & "LEADING UNDERSCORE - 1" ); ELSE FAILED ( "NO EXCEPTION RAISED - " & "LEADING UNDERSCORE - 2" ); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - " & "LEADING UNDERSCORE" ); END; BEGIN IF SUBENUM'VALUE (IDENT_STR("0BC")) /= BC THEN FAILED ( "NO EXCEPTION RAISED - " & "FIRST CHARACTER IS A DIGIT - 1" ); ELSE FAILED ( "NO EXCEPTION RAISED - " & "FIRST CHARACTER IS A DIGIT - 2" ); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED - " & "FIRST CHARACTER IS A DIGIT" ); END; RESULT; END C35502C;
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0xca_notsx.log_21829_477.asm
ljhsiun2/medusa
9
103207
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r14 push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x81e6, %rsi nop add %r11, %r11 mov $0x6162636465666768, %r12 movq %r12, (%rsi) nop nop nop nop cmp %rcx, %rcx lea addresses_A_ht+0xafe, %rsi lea addresses_WT_ht+0xdc06, %rdi nop nop nop sub %r14, %r14 mov $28, %rcx rep movsl nop nop nop nop nop inc %rcx lea addresses_WT_ht+0xc86c, %rsi lea addresses_A_ht+0xc086, %rdi and %r14, %r14 mov $69, %rcx rep movsw nop nop nop nop mfence lea addresses_UC_ht+0x1eb3a, %r12 nop and %rdx, %rdx mov (%r12), %r14 nop nop nop sub $45497, %r12 lea addresses_WT_ht+0x14662, %r12 nop nop nop nop nop sub %rsi, %rsi movw $0x6162, (%r12) nop nop nop nop nop sub %r11, %r11 lea addresses_A_ht+0xe806, %r11 nop nop nop nop inc %rcx movl $0x61626364, (%r11) nop nop sub %r14, %r14 lea addresses_UC_ht+0x14b98, %r12 and %rsi, %rsi mov (%r12), %rcx nop sub %rdx, %rdx lea addresses_normal_ht+0x15c06, %rsi lea addresses_normal_ht+0x8006, %rdi clflush (%rsi) nop nop nop nop add $53167, %r12 mov $17, %rcx rep movsw nop nop nop nop nop cmp %r14, %r14 pop %rsi pop %rdx pop %rdi pop %rcx pop %r14 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r8 push %rax push %rbp push %rsi // Faulty Load mov $0x7dcb0c0000000406, %rax nop nop nop nop dec %rbp mov (%rax), %r11 lea oracles, %r8 and $0xff, %r11 shlq $12, %r11 mov (%r8,%r11,1), %r11 pop %rsi pop %rbp pop %rax pop %r8 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_NC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'src': {'congruent': 3, 'same': True, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'} {'src': {'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 2, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 2, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}, '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 */
app/predicate-parser/Predicates.g4
killer-nyasha/verifiable-tests
0
5146
grammar Predicates; predicate : NEGATION? (TRUE | FALSE) # bool_const_expr | NEGATION? '(' predicate ')' # paret_predicate | NEGATION? shorthand # shorthand_pred | int_expr comparison_op int_expr # comparison_expr | vector_equality # vector_eq_pred | ascending_chain_cmp # asc_chain_pred | descending_chain_cmp # desc_chain_pred | predicate '&&' predicate # and_expr | predicate '||' predicate # or_expr | predicate '=>' predicate # implies_expr | predicate '<=>' predicate # iff_expr | '(' (FORALL | EXISTS) name ':' predicate ':' predicate ')' # quantifier_pred ; vector_equality : int_expr '=' int_expr # vector_eq_base | int_expr ',' vector_equality ',' int_expr # vector_eq_rec ; shorthand : name '(' (/*no args*/ | int_expr (',' int_expr)*) ')' ; ascending_chain_cmp : int_expr (LESS | LESS_EQ) int_expr # asc_chain_cmp_base | ascending_chain_cmp (LESS | LESS_EQ) int_expr # asc_chain_cmp_rec ; descending_chain_cmp : int_expr (GREATER | GREATER_EQ) int_expr # desc_chain_cmp_base | descending_chain_cmp (GREATER | GREATER_EQ) int_expr # desc_chain_cmp_rec ; int_expr : MINUS? INT # int_const_expr | MINUS? variable # variable_expr | MINUS? '(' int_expr ')' # paret_int_expr | MINUS? shorthand # shorthand_expr | MINUS? '(' (SUM | PROD) name ':' predicate ':' int_expr ')' # sum_prod_quantifier | MINUS? '(' NUM name ':' predicate ':' predicate ')' # quantity_quantifier | int_expr '*' int_expr # mult_expr | int_expr (PLUS | MINUS) int_expr # add_expr ; comparison_op : '<' # lt | '>' # gt | '<=' # leq | '>=' # geq | '=' # eq | '<>' # neq ; variable : name selectors? ; selectors : selector+ ; selector : '[' int_expr ']' ; // Allows for creating variables with some keyword names. // TRUE and FALSE are intentionally not used. // They actually might be, as the variables will only be used in place // of integer expressions, not booleans, but I think this would be too unnatural. name : EXISTS | FORALL | SUM | PROD | NUM | NAME ; LESS : '<' ; LESS_EQ : '<=' ; GREATER : '>' ; GREATER_EQ : '>=' ; FORALL : 'A' ; EXISTS : 'E' ; SUM : 'SUM' ; PROD : 'PROD' ; NUM : 'N' ; NEGATION : '~' ; MINUS : '-' ; PLUS : '+' ; TRUE : 'T' ; FALSE : 'F' ; NAME : [a-zA-Z] [0-9a-zA-Z_]* ; INT : '0' | [1-9] [0-9]* ; WS : [ \t\r\n] + -> skip ; // Skipping all the whitespaces.
oeis/158/A158735.asm
neoneye/loda-programs
11
85111
; A158735: a(n) = 1225*n^2 - 35. ; 1190,4865,10990,19565,30590,44065,59990,78365,99190,122465,148190,176365,206990,240065,275590,313565,353990,396865,442190,489965,540190,592865,647990,705565,765590,828065,892990,960365,1030190,1102465,1177190,1254365,1333990,1416065,1500590,1587565,1676990,1768865,1863190,1959965,2059190,2160865,2264990,2371565,2480590,2592065,2705990,2822365,2941190,3062465,3186190,3312365,3440990,3572065,3705590,3841565,3979990,4120865,4264190,4409965,4558190,4708865,4861990,5017565,5175590,5336065,5498990 mov $1,2 add $1,$0 mul $1,$0 mul $1,1225 add $1,1190 mov $0,$1
oeis/042/A042748.asm
neoneye/loda-programs
11
89095
<filename>oeis/042/A042748.asm ; A042748: Numerators of continued fraction convergents to sqrt(905). ; Submitted by <NAME> ; 30,361,21690,260641,15660150,188182441,11306606610,135867461761,8163354312270,98096119209001,5893930506852330,70825262201436961,4255409662593069990,51135741213318276841,3072399882461689680450,36919934330753594442241,2218268459727677356214910,26656141451062881869021161,1601586755523500589497484570,19245697207733069955838836001,1156343419219507697939827644630,13895366727841825445233770571561,834878347089729034411966061938290,10032435531804590238388826513831041,602781010255365143337741556891800750 add $0,1 mov $3,1 lpb $0 sub $0,1 add $2,$3 mov $3,$1 mov $1,$2 dif $2,5 mul $2,60 lpe add $2,$3 add $3,$2 mov $0,$3 div $0,2
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_928.asm
ljhsiun2/medusa
9
24609
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r8 push %r9 push %rax push %rbp push %rcx push %rdi push %rsi lea addresses_normal_ht+0x10e4, %r10 nop nop add $10430, %r8 mov $0x6162636465666768, %rax movq %rax, %xmm1 vmovups %ymm1, (%r10) nop nop nop dec %r9 lea addresses_D_ht+0x17a32, %rcx nop nop and %rbp, %rbp mov $0x6162636465666768, %r12 movq %r12, %xmm3 vmovups %ymm3, (%rcx) nop nop nop cmp %r9, %r9 lea addresses_UC_ht+0x14ef2, %rcx nop sub $48583, %rbp movb $0x61, (%rcx) nop cmp $13617, %rbp lea addresses_UC_ht+0x5ef2, %r10 nop nop and $42247, %r12 movw $0x6162, (%r10) nop nop nop sub $20, %rbp lea addresses_UC_ht+0x1d3f2, %rbp and %r8, %r8 mov (%rbp), %rcx nop nop nop add %rcx, %rcx lea addresses_WT_ht+0x1eef2, %rsi lea addresses_A_ht+0x160f2, %rdi clflush (%rdi) nop nop nop nop nop cmp %rbp, %rbp mov $32, %rcx rep movsb nop nop xor $49880, %r9 lea addresses_WT_ht+0xe2f2, %rsi lea addresses_UC_ht+0x102f2, %rdi nop sub %rax, %rax mov $92, %rcx rep movsl nop nop nop add %rdi, %rdi pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r9 pop %r8 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r15 push %rdx // Faulty Load lea addresses_UC+0x146f2, %r15 nop nop nop nop nop sub $34393, %r12 movb (%r15), %r11b lea oracles, %r10 and $0xff, %r11 shlq $12, %r11 mov (%r10,%r11,1), %r11 pop %rdx pop %r15 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': True, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 6, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': True, 'congruent': 8, 'size': 8, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
projects/batfish/src/main/antlr4/org/batfish/grammar/cumulus_frr/CumulusFrr_ip_prefix_list.g4
nickgian/batfish
0
4845
parser grammar CumulusFrr_ip_prefix_list; import CumulusFrr_common; options { tokenVocab = CumulusFrrLexer; } ip_prefix_list : PREFIX_LIST name = ip_prefix_list_name pl_line ; pl_line : SEQ num = ip_prefix_list_line_number action = line_action ip_prefix = prefix (GE ge = ip_prefix_list_line_prefix_length)? (LE le = ip_prefix_list_line_prefix_length)? NEWLINE ; ip_prefix_list_line_number : // 1-4294967294 UINT8 | UINT16 | UINT32 ; ip_prefix_list_line_prefix_length : // 1-32 UINT8 ;
programs/oeis/126/A126184.asm
jmorken/loda
1
26516
; A126184: Number of hex trees with n edges and having no nonroot nodes of outdegree 2. ; 1,3,10,33,108,351,1134,3645,11664,37179,118098,373977,1180980,3720087,11691702,36669429,114791256,358722675,1119214746,3486784401,10847773692,33705582543,104603532030,324270949293,1004193907488 mov $1,1 mov $3,2 mov $4,$0 lpb $0 sub $0,1 mov $2,$4 add $2,2 add $3,3 add $3,$4 add $3,1 trn $1,$3 add $1,$2 mov $4,$3 mul $3,2 lpe
programs/oeis/155/A155096.asm
neoneye/loda
22
14990
<gh_stars>10-100 ; A155096: Numbers k such that k^2 == -1 (mod 29). ; 12,17,41,46,70,75,99,104,128,133,157,162,186,191,215,220,244,249,273,278,302,307,331,336,360,365,389,394,418,423,447,452,476,481,505,510,534,539,563,568,592,597,621,626,650,655,679,684,708,713,737,742,766,771,795,800,824,829,853,858,882,887,911,916,940,945,969,974,998,1003,1027,1032,1056,1061,1085,1090,1114,1119,1143,1148,1172,1177,1201,1206,1230,1235,1259,1264,1288,1293,1317,1322,1346,1351,1375,1380,1404,1409,1433,1438 mov $2,$0 add $0,1 lpb $0 sub $0,1 trn $0,1 add $1,7 add $3,2 mov $4,4 add $4,$3 add $4,4 add $1,$4 mov $3,2 lpe add $1,2 lpb $2 add $1,5 sub $2,1 lpe sub $1,7 mov $0,$1
game/logic/game_states/character_selection_screen.asm
sgadrat/super-tilt-bro
91
92456
init_character_selection_screen: .( ; Initialize C stack jsr reinit_c_stack ; Call C init routine SWITCH_BANK(#CHAR_SELECT_SCREEN_EXTRA_BANK_NUMBER) jmp init_character_selection_screen_extra ;rts ; useless, jump to subroutine .) character_selection_screen_tick: .( ; Call C tick routine SWITCH_BANK(#CHAR_SELECT_SCREEN_EXTRA_BANK_NUMBER) jmp character_selection_screen_tick_extra ;rts ; useless, jump to subroutine .) character_selection_tick_char_anims: .( ldx #0 stx player_number ldy config_requested_player_a_character SWITCH_BANK(characters_bank_number COMMA y) lda #<character_selection_player_a_char_anim sta tmpfield11 lda #>character_selection_player_a_char_anim jsr tick_it ldx #1 stx player_number ldy config_requested_player_b_character SWITCH_BANK(characters_bank_number COMMA y) lda #<character_selection_player_b_char_anim sta tmpfield11 lda #>character_selection_player_b_char_anim jsr tick_it SWITCH_BANK(#CHAR_SELECT_SCREEN_EXTRA_BANK_NUMBER) rts tick_it: .( sta tmpfield12 lda #0 sta tmpfield13 sta tmpfield14 sta tmpfield15 sta tmpfield16 jsr animation_draw jmp animation_tick ;rts ; useless, jump to subroutine .) .) character_selection_get_char_property: .( char_num = tmpfield1 property_offset = tmpfield2 prop_addr_lsb = tmpfield3 prop_addr_msb = tmpfield4 prop_value_lsb = tmpfield5 prop_value_msb = tmpfield6 ldy char_num SWITCH_BANK(characters_bank_number COMMA y) lda characters_properties_lsb, y sta prop_addr_lsb lda characters_properties_msb, y sta prop_addr_msb ldy property_offset lda (prop_addr_lsb), y sta prop_value_lsb iny lda (prop_addr_lsb), y sta prop_value_msb SWITCH_BANK(#CHAR_SELECT_SCREEN_EXTRA_BANK_NUMBER) rts .) character_selection_construct_char_nt_buffer: .( ;tmpfields 1 to 4 passed to construct_nt_buffer char_num = tmpfield5 ldy char_num SWITCH_BANK(characters_bank_number COMMA y) jsr construct_nt_buffer SWITCH_BANK(#CHAR_SELECT_SCREEN_EXTRA_BANK_NUMBER) rts .) ; Change global game state, without trigerring any transition code ; Never returns, jumps to main loop ; Hardcoded destination state to stage selection menu character_selection_change_global_game_state_lite: .( ; Save previous game state and set the global_game_state variable lda global_game_state sta previous_global_game_state lda #GAME_STATE_STAGE_SELECTION sta global_game_state ; Move all sprites offscreen ldx #$00 lda #$fe clr_sprites: sta oam_mirror, x ;move all sprites off screen inx inx inx inx bne clr_sprites ; Call the appropriate initialization routine jsr init_stage_selection_screen ; Clear stack ldx #$ff txs ; Go straight to the main loop jmp forever .) character_selection_reset_music: .( SWITCH_BANK(#DATA_BANK_NUMBER) jsr audio_music_weak SWITCH_BANK(#CHAR_SELECT_SCREEN_EXTRA_BANK_NUMBER) rts .)
Sec2.agda
amal029/agda-tutorial-dybjer
1
11411
<reponame>amal029/agda-tutorial-dybjer module Sec2 where open import Sec4 data Bool : Set where T : Bool F : Bool _∣∣_ : Bool → Bool → Bool _ ∣∣ F = F _ ∣∣ T = T _&_ : Bool → Bool → Bool _ & F = F F & T = F T & T = T _==>_ : Bool → Bool → Bool F ==> _ = T T ==> F = F T ==> T = T not : Bool -> Bool not T = F not F = T data ℕ : Set where Z : ℕ S : ℕ → ℕ _+_ : ∀ (m : ℕ) → ∀ (n : ℕ) → ℕ Z + m = m (S n) + m = S (n + m) _*_ : ℕ → ℕ → ℕ Z * m = Z (S n) * m = (n * m) + m {-# BUILTIN NATURAL ℕ #-} {-# BUILTIN BOOL Bool #-} _≤_ : ℕ → ℕ → Bool Z ≤ _ = T (S n) ≤ Z = F (S n) ≤ (S m) = n ≤ m _<_ : ℕ → ℕ → Bool Z < (S _) = T Z < Z = F (S n) < (S m) = n < m (S n) < Z = F _≥_ : ℕ → ℕ → Bool m ≥ n = n ≤ m _>_ : ℕ → ℕ → Bool m > n = n < m -- XXX: == on Nat _==_ : ℕ → ℕ → Bool x == y = (x ≥ y) & (x ≤ y) _-_ : ℕ → ℕ → ℕ Z - _ = Z (S n) - Z = (S n) (S n) - (S m) = n - m K : {A B : Set} → A → B → A K x _ = x SC : {A B C : Set} → (A → B → C) → (A → B) → A → C SC f g x = f x (g x) -- XXX: The list type data List (A : Set) : Set where [] : List A _∷_ : A → List A → List A length : {A : Set} → List A → ℕ length [] = Z length (x ∷ m) = 1 + length m test : List ℕ test = 2 ∷ (3 ∷ []) test1 : ℕ test1 = length test data So : Bool → Set where ok : So T private head : {A : Set} → (x : List A) → So ((length x) ≥ 1) → A head [] () head (x ∷ x₁) _ = x private tail : {A : Set} → (x : List A) → So ((length x) ≥ 1) → List A tail [] () tail (x ∷ x₁) _ = x₁ if_then_else_ : {A : Set} → Bool → A → A → A if T then x else _ = x if F then _ else y = y private filter : {A : Set} → (A → Bool) → List A → List A filter cmp [] = [] filter cmp (x ∷ x₁) = if (cmp x) then x ∷ (filter cmp x₁) else filter cmp x₁ _++_ : {A : Set} → List A → List A → List A [] ++ r = r (x ∷ l) ++ r = x ∷ (l ++ r) insert : (a : ℕ) → (List ℕ) → (List ℕ) insert a [] = (a ∷ []) insert a (x ∷ l) = if (a ≤ x) then (a ∷ (x ∷ l)) else (x ∷ (insert a l)) tt2 : List ℕ tt2 = insert 9 (0 ∷ (8 ∷ [])) private foldl : {A : Set} → (A → A → A) → List A → A → A foldl _ [] y = y foldl f (x ∷ x₁) y = foldl f x₁ (f x y) -- XXX: injective tuple data _+′_ (A B : Set) : Set where inl : (x : A) → A +′ B inr : (x : B) → A +′ B case : {A B C : Set} → (A +′ B) → (f₁ : (A → C)) → (f₂ : (B → C)) → C case (inl x) f₁ _ = f₁ x case (inr x) _ f₂ = f₂ x -- XXX: Proof of transitivity of > T> : (a b c : ℕ) → So (a > b) → So (b > c) → So (a > c) T> Z Z Z () y T> Z Z (S c) () y T> Z (S b) c () y T> (S a) Z Z ok () T> (S a) Z (S c) ok () T> (S a) (S b) Z x y = ok T> (S a) (S b) (S c) x y = T> a b c x y -- XXX: Tuple type data _Π_ (A B : Set) : Set where <_,_> : (x : A) → (y : B) → A Π B private zip : {A B : Set} → (xs : List A) → (ys : List B) → So ((length xs) == (length ys)) → List (A Π B) zip [] [] k = [] zip [] (x ∷ ys) () zip (x ∷ xs) [] () zip (x ∷ xs) (y ∷ ys) k = < x , y > ∷ zip xs ys k -- TODO: Write unzip later on -- unzip : {A B : Set} → List (A Π B) → (List A Π List B) -- unzip xs = {!!} test5 : List (ℕ Π ℕ) test5 = zip ((1 ∷ [])) (2 ∷ []) ok infix 4 _≡_ data _≡_ {a} {A : Set a} (x : A) : A → Set a where refl : x ≡ x {-# BUILTIN EQUALITY _≡_ #-} {-# BUILTIN REFL refl #-} -- XXX: Transitivity of ℕ ℕ-trans : ∀ {x y z : ℕ} → (x ≡ y) → (y ≡ z) → (x ≡ z) ℕ-trans refl refl = refl -- XXX: Symmetry of ℕ sym : ∀ {x y : ℕ} → (x ≡ y) → (y ≡ x) sym refl = refl -- XXX: Congruence of ℕ cong : ∀ {x y : ℕ} → (x ≡ y) → (1 + x) ≡ (1 + y) cong refl = refl plus-z : ∀ (y : ℕ) → ((y + Z) ≡ y) plus-z Z = refl plus-z (S y) = cong (plus-z y) assoc-+ : ∀ (a b c : ℕ) → ((a + b) + c) ≡ (a + (b + c)) assoc-+ Z y z = refl assoc-+ (S x) y z = cong (assoc-+ x y z) t1 : ∀ (x y : ℕ) → (x + S y) ≡ S (x + y) t1 Z y = refl t1 (S x) y = cong (t1 x y) -- See this: https://github.com/dvanhorn/play/blob/master/agda/Rewrite.agda -- for examples of rewrite. -- Also read: http://agda.readthedocs.io/en/latest/language/with-abstraction.html#generalisation commute-+ : ∀ (x y : ℕ) → ((x + y) ≡ (y + x)) commute-+ Z y rewrite plus-z y = refl commute-+ (S x) y rewrite t1 y x = cong (commute-+ x y) mult-z : ∀ (y : ℕ) → ((y * Z) ≡ Z) mult-z Z = refl mult-z (S y) rewrite plus-z (y * Z) = mult-z y lemma-1 : ∀ {a b : ℕ} → ∀ (n : ℕ) → (a ≡ b) → (n + a ≡ n + b) lemma-1 _ refl = refl c-* : ∀ (m n : ℕ) → (m * S n) ≡ (m * n) + m c-* Z n rewrite commute-+ (n * Z) Z | mult-z n = refl c-* (S m) n rewrite commute-+ (m * S n) (S n) | commute-+ ((m * n) + n) (S m) | commute-+ m ((m * n) + n) | assoc-+ (m * n) n m | commute-+ (m * n) (n + m) | assoc-+ n m (m * n) | commute-+ m (m * n) = cong (lemma-1 n (c-* m n)) commute-* : ∀ (m n : ℕ) → (m * n) ≡ (n * m) commute-* m Z = mult-z m commute-* m (S n) rewrite c-* m n | commute-+ (m * n) m | commute-+ (n * m) m = lemma-1 m (commute-* m n) lemma-2 : ∀ (m n x : ℕ) → (m + n) * x ≡ ((m * x) + (n * x)) lemma-2 m n Z rewrite mult-z (m + n) | mult-z m | mult-z n = refl lemma-2 m n (S x) rewrite c-* (m + n) x | c-* m x | c-* n x | assoc-+ (m * x) m ((n * x) + n) | commute-+ m ((n * x) + n) | assoc-+ (n * x) n m | commute-+ n m | commute-+ (n * x) (m + n) | commute-+ (m * x) ((m + n) + (n * x)) | assoc-+ (m + n) (n * x) (m * x) | commute-+ (m + n) ((n * x) + (m * x)) | commute-+ (n * x) (m * x) | commute-+ ((m * x) + (n * x)) (m + n) | commute-+ ((m + n) * x) (m + n) = lemma-1 (m + n) (lemma-2 m n x) assoc-* : ∀ (a b c : ℕ) → ((a * b) * c) ≡ (a * (b * c)) assoc-* Z b c = refl assoc-* (S a) b c rewrite lemma-2 (a * b) b c | commute-+ ((a * b) * c) (b * c) | commute-+ (a * (b * c)) (b * c) = lemma-1 (b * c) (assoc-* a b c) distributivity-+-* : ∀ (a b c : ℕ) → (a * (b + c)) ≡ ((a * b) + (a * c)) distributivity-+-* a b c rewrite commute-* a (b + c) | commute-* a b | commute-* a c | lemma-2 b c a = refl -- XXX: factorial function on naturals fact : ∀ (x : ℕ) → ℕ fact Z = (S Z) fact (S Z) = (S Z) fact (S x) = x * (fact x) -- TODO: Relation on ℕ and > _>⋆_ : ℕ → ℕ → Prop Z >⋆ Z = ⊥ S x >⋆ Z = ⊤ Z >⋆ S y = ⊥ S x >⋆ S y = x >⋆ y lem : (m n : ℕ) → (p : n >⋆ Z) → (m + n) >⋆ 0 lem Z n p = p lem (S m) n p = ⋆ -- XXX: Theorem; factorial of any natural number is > 0 -- XXX: page-124, problem 4.35, Type Theory and functional programming thm : ∀ (x : ℕ) → (fact x) >⋆ Z thm Z = ⋆ thm (S Z) = ⋆ thm (S (S x)) = lem (x * fact (S x)) (fact (S x)) (thm (S x)) _<=_ : ∀ (m n : ℕ) → Prop Z <= n = ⊤ S m <= Z = ⊥ S m <= S n = m <= n -- symm : ∀ (m n : ℕ) → (p : m <= n) → (n <= m) -- symm Z Z p = ⋆ -- symm Z (S n) p = {!!} -- symm (S m) Z p = ⋆ -- symm (S m) (S n) p = symm m n p transm : ∀ (m n p : ℕ) → (m <= n) → (n <= p) → (m <= p) transm Z n p p1 p2 = ⋆ transm (S m) Z Z p1 p2 = p1 transm (S m) (S n) Z p1 p2 = p2 transm (S m) Z (S p) () p2 transm (S m) (S n) (S p) p1 p2 = transm m n p p1 p2 -- Show that 2 + 3 ≡ 3 + 2 eqq : 2 + 3 ≡ 3 + 2 eqq = refl
tools/scitools/conf/understand/ada/ada12/a-crbtgo.ads
brucegua/moocos
1
16705
<gh_stars>1-10 ------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.CONTAINERS.RED_BLACK_TREES.GENERIC_OPERATIONS -- -- -- -- S p e c -- -- -- -- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- This unit was originally developed by <NAME>. -- ------------------------------------------------------------------------------ -- Tree_Type is used to implement the ordered containers. This package -- declares the tree operations that do not depend on keys. with Ada.Streams; use Ada.Streams; generic with package Tree_Types is new Generic_Tree_Types (<>); use Tree_Types; with function Parent (Node : Node_Access) return Node_Access is <>; with procedure Set_Parent (Node : Node_Access; Parent : Node_Access) is <>; with function Left (Node : Node_Access) return Node_Access is <>; with procedure Set_Left (Node : Node_Access; Left : Node_Access) is <>; with function Right (Node : Node_Access) return Node_Access is <>; with procedure Set_Right (Node : Node_Access; Right : Node_Access) is <>; with function Color (Node : Node_Access) return Color_Type is <>; with procedure Set_Color (Node : Node_Access; Color : Color_Type) is <>; package Ada.Containers.Red_Black_Trees.Generic_Operations is pragma Pure; function Min (Node : Node_Access) return Node_Access; -- Returns the smallest-valued node of the subtree rooted at Node function Max (Node : Node_Access) return Node_Access; -- Returns the largest-valued node of the subtree rooted at Node -- NOTE: The Check_Invariant operation was used during early -- development of the red-black tree. Now that the tree type -- implementation has matured, we don't really need Check_Invariant -- anymore. -- procedure Check_Invariant (Tree : Tree_Type); function Vet (Tree : Tree_Type; Node : Node_Access) return Boolean; -- Inspects Node to determine (to the extent possible) whether -- the node is valid; used to detect if the node is dangling. function Next (Node : Node_Access) return Node_Access; -- Returns the smallest node greater than Node function Previous (Node : Node_Access) return Node_Access; -- Returns the largest node less than Node generic with function Is_Equal (L, R : Node_Access) return Boolean; function Generic_Equal (Left, Right : Tree_Type) return Boolean; -- Uses Is_Equal to perform a node-by-node comparison of the -- Left and Right trees; processing stops as soon as the first -- non-equal node is found. procedure Delete_Node_Sans_Free (Tree : in out Tree_Type; Node : Node_Access); -- Removes Node from Tree without deallocating the node. If Tree -- is busy then Program_Error is raised. generic with procedure Free (X : in out Node_Access); procedure Generic_Delete_Tree (X : in out Node_Access); -- Deallocates the tree rooted at X, calling Free on each node generic with function Copy_Node (Source : Node_Access) return Node_Access; with procedure Delete_Tree (X : in out Node_Access); function Generic_Copy_Tree (Source_Root : Node_Access) return Node_Access; -- Copies the tree rooted at Source_Root, using Copy_Node to copy each -- node of the source tree. If Copy_Node propagates an exception -- (e.g. Storage_Error), then Delete_Tree is first used to deallocate -- the target tree, and then the exception is propagated. generic with function Copy_Tree (Root : Node_Access) return Node_Access; procedure Generic_Adjust (Tree : in out Tree_Type); -- Used to implement controlled Adjust. On input to Generic_Adjust, Tree -- holds a bitwise (shallow) copy of the source tree (as would be the case -- when controlled Adjust is called). On output, Tree holds its own (deep) -- copy of the source tree, which is constructed by calling Copy_Tree. generic with procedure Delete_Tree (X : in out Node_Access); procedure Generic_Clear (Tree : in out Tree_Type); -- Clears Tree by deallocating all of its nodes. If Tree is busy then -- Program_Error is raised. generic with procedure Clear (Tree : in out Tree_Type); procedure Generic_Move (Target, Source : in out Tree_Type); -- Moves the tree belonging to Source onto Target. If Source is busy then -- Program_Error is raised. Otherwise Target is first cleared (by calling -- Clear, to deallocate its existing tree), then given the Source tree, and -- then finally Source is cleared (by setting its pointers to null). generic with procedure Process (Node : Node_Access) is <>; procedure Generic_Iteration (Tree : Tree_Type); -- Calls Process for each node in Tree, in order from smallest-valued -- node to largest-valued node. generic with procedure Process (Node : Node_Access) is <>; procedure Generic_Reverse_Iteration (Tree : Tree_Type); -- Calls Process for each node in Tree, in order from largest-valued -- node to smallest-valued node. generic with procedure Write_Node (Stream : not null access Root_Stream_Type'Class; Node : Node_Access); procedure Generic_Write (Stream : not null access Root_Stream_Type'Class; Tree : Tree_Type); -- Used to implement stream attribute T'Write. Generic_Write -- first writes the number of nodes into Stream, then calls -- Write_Node for each node in Tree. generic with procedure Clear (Tree : in out Tree_Type); with function Read_Node (Stream : not null access Root_Stream_Type'Class) return Node_Access; procedure Generic_Read (Stream : not null access Root_Stream_Type'Class; Tree : in out Tree_Type); -- Used to implement stream attribute T'Read. Generic_Read -- first clears Tree. It then reads the number of nodes out of -- Stream, and calls Read_Node for each node in Stream. procedure Rebalance_For_Insert (Tree : in out Tree_Type; Node : Node_Access); -- This rebalances Tree to complete the insertion of Node (which -- must already be linked in at its proper insertion position). end Ada.Containers.Red_Black_Trees.Generic_Operations;
oeis/037/A037624.asm
neoneye/loda-programs
11
25914
; A037624: Decimal expansion of a(n) is given by the first n terms of the periodic sequence with initial period 2,0,3. ; Submitted by <NAME> ; 2,20,203,2032,20320,203203,2032032,20320320,203203203,2032032032,20320320320,203203203203,2032032032032,20320320320320,203203203203203,2032032032032032,20320320320320320,203203203203203203,2032032032032032032,20320320320320320320,203203203203203203203,2032032032032032032032,20320320320320320320320,203203203203203203203203,2032032032032032032032032,20320320320320320320320320,203203203203203203203203203,2032032032032032032032032032,20320320320320320320320320320,203203203203203203203203203203 mov $2,2 lpb $0 sub $0,1 add $1,$2 mul $1,10 dif $2,2 add $2,3 mod $2,4 lpe add $1,$2 mov $0,$1
BetaCode/CodeExamples/BNO055 example code/MPU_IMU_I2C.asm
dbazor/BB_Slug
3
160440
<filename>BetaCode/CodeExamples/BNO055 example code/MPU_IMU_I2C.asm _MPU_I2C_Write: ;MPU_IMU_I2C.c,3 :: void MPU_I2C_Write(unsigned char s_addr, unsigned char r_addr, unsigned char len, unsigned char *dat) { ADDIU SP, SP, -12 SW RA, 0(SP) ;MPU_IMU_I2C.c,6 :: I2C2_Start(); // issue I2C start signal SW R25, 4(SP) JAL _I2C2_Start+0 NOP ;MPU_IMU_I2C.c,7 :: I2C2_Write(s_addr & 0xFE); // send byte via I2C (device address + W(&0xFE)) ANDI R2, R25, 254 ANDI R25, R2, 255 JAL _I2C2_Write+0 NOP ;MPU_IMU_I2C.c,8 :: I2C2_Write(r_addr); // send byte (address of EEPROM location) ANDI R25, R26, 255 JAL _I2C2_Write+0 NOP ;MPU_IMU_I2C.c,9 :: for (i = 0 ; i < len ; i++){ ; i start address is: 16 (R4) MOVZ R4, R0, R0 ; i end address is: 16 (R4) L_MPU_I2C_Write0: ; i start address is: 16 (R4) ANDI R3, R4, 65535 ANDI R2, R27, 255 SLTU R2, R3, R2 BNE R2, R0, L__MPU_I2C_Write12 NOP J L_MPU_I2C_Write1 NOP L__MPU_I2C_Write12: ;MPU_IMU_I2C.c,10 :: I2C2_Write(*dat++); // send data (data to be written) SB R25, 8(SP) LBU R25, 0(R28) JAL _I2C2_Write+0 NOP LBU R25, 8(SP) ADDIU R2, R28, 1 MOVZ R28, R2, R0 ;MPU_IMU_I2C.c,9 :: for (i = 0 ; i < len ; i++){ ADDIU R2, R4, 1 ANDI R4, R2, 65535 ;MPU_IMU_I2C.c,11 :: } ; i end address is: 16 (R4) J L_MPU_I2C_Write0 NOP L_MPU_I2C_Write1: ;MPU_IMU_I2C.c,12 :: I2C2_Stop(); // issue I2C stop signal JAL _I2C2_Stop+0 NOP ;MPU_IMU_I2C.c,13 :: } L_end_MPU_I2C_Write: LW R25, 4(SP) LW RA, 0(SP) ADDIU SP, SP, 12 JR RA NOP ; end of _MPU_I2C_Write _MPU_I2C_Read: ;MPU_IMU_I2C.c,17 :: void MPU_I2C_Read(unsigned char s_addr, unsigned char r_addr, unsigned char len, unsigned char *dat) { ADDIU SP, SP, -12 SW RA, 0(SP) ;MPU_IMU_I2C.c,19 :: I2C2_Start(); // issue I2C start signal SW R25, 4(SP) JAL _I2C2_Start+0 NOP ;MPU_IMU_I2C.c,20 :: I2C2_Write(s_addr & 0xFE); // send byte via I2C (device address + W(&0xFE)) ANDI R2, R25, 254 SB R25, 8(SP) ANDI R25, R2, 255 JAL _I2C2_Write+0 NOP ;MPU_IMU_I2C.c,21 :: I2C2_Write(r_addr); // send byte (data address) ANDI R25, R26, 255 JAL _I2C2_Write+0 NOP LBU R25, 8(SP) ;MPU_IMU_I2C.c,22 :: I2C2_Restart(); // issue I2C signal repeated start JAL _I2C2_Restart+0 NOP ;MPU_IMU_I2C.c,23 :: I2C2_Write(s_addr | 0x01); // send byte (device address + R(|0x01)) ORI R2, R25, 1 ANDI R25, R2, 255 JAL _I2C2_Write+0 NOP ;MPU_IMU_I2C.c,24 :: for (i = 0; i < (len-1); i++){ ; i start address is: 16 (R4) MOVZ R4, R0, R0 ; i end address is: 16 (R4) L_MPU_I2C_Read3: ; i start address is: 16 (R4) ANDI R2, R27, 255 ADDIU R2, R2, -1 ANDI R3, R4, 65535 SEH R2, R2 SLTU R2, R3, R2 BNE R2, R0, L__MPU_I2C_Read14 NOP J L_MPU_I2C_Read4 NOP L__MPU_I2C_Read14: ;MPU_IMU_I2C.c,25 :: *dat++ = I2C2_Read(_I2C_ACK); // Read the data (acknowledge) SB R25, 8(SP) MOVZ R25, R0, R0 JAL _I2C2_Read+0 NOP LBU R25, 8(SP) SB R2, 0(R28) ADDIU R2, R28, 1 MOVZ R28, R2, R0 ;MPU_IMU_I2C.c,24 :: for (i = 0; i < (len-1); i++){ ADDIU R2, R4, 1 ANDI R4, R2, 65535 ;MPU_IMU_I2C.c,26 :: } ; i end address is: 16 (R4) J L_MPU_I2C_Read3 NOP L_MPU_I2C_Read4: ;MPU_IMU_I2C.c,27 :: *dat = I2C2_Read(_I2C_NACK); // Read the data (NO acknowledge) SB R25, 8(SP) ORI R25, R0, 1 JAL _I2C2_Read+0 NOP LBU R25, 8(SP) SB R2, 0(R28) ;MPU_IMU_I2C.c,28 :: I2C2_Stop(); // issue I2C stop signal JAL _I2C2_Stop+0 NOP ;MPU_IMU_I2C.c,29 :: } L_end_MPU_I2C_Read: LW R25, 4(SP) LW RA, 0(SP) ADDIU SP, SP, 12 JR RA NOP ; end of _MPU_I2C_Read _MPU_I2C_Read_Int: ;MPU_IMU_I2C.c,31 :: void MPU_I2C_Read_Int(unsigned char s_addr, unsigned char r_addr, unsigned char len, unsigned char *dat) { ADDIU SP, SP, -20 SW RA, 0(SP) ;MPU_IMU_I2C.c,34 :: I2C2_Start(); // issue I2C start signal SW R25, 4(SP) JAL _I2C2_Start+0 NOP ;MPU_IMU_I2C.c,35 :: I2C2_Write(s_addr & 0xFE); // send byte via I2C (device address + W(&0xFE)) ANDI R2, R25, 254 SB R25, 8(SP) ANDI R25, R2, 255 JAL _I2C2_Write+0 NOP ;MPU_IMU_I2C.c,36 :: I2C2_Write(r_addr); // send byte (data address) ANDI R25, R26, 255 JAL _I2C2_Write+0 NOP LBU R25, 8(SP) ;MPU_IMU_I2C.c,37 :: I2C2_Restart(); // issue I2C signal repeated start JAL _I2C2_Restart+0 NOP ;MPU_IMU_I2C.c,38 :: I2C2_Write(s_addr | 0x01); // send byte (device address + R(|0x01)) ORI R2, R25, 1 ANDI R25, R2, 255 JAL _I2C2_Write+0 NOP ;MPU_IMU_I2C.c,39 :: for (i = 0 ; i < ((len << 1)-1) ; i++){ ; i start address is: 16 (R4) MOVZ R4, R0, R0 ; i end address is: 16 (R4) L_MPU_I2C_Read_Int6: ; i start address is: 16 (R4) ANDI R2, R27, 255 SLL R2, R2, 1 ADDIU R2, R2, -1 ANDI R3, R4, 65535 ANDI R2, R2, 65535 SLTU R2, R3, R2 BNE R2, R0, L__MPU_I2C_Read_Int16 NOP J L_MPU_I2C_Read_Int7 NOP L__MPU_I2C_Read_Int16: ;MPU_IMU_I2C.c,40 :: if (i%2) { ANDI R2, R4, 1 BNE R2, R0, L__MPU_I2C_Read_Int18 NOP J L_MPU_I2C_Read_Int9 NOP L__MPU_I2C_Read_Int18: ;MPU_IMU_I2C.c,41 :: pt = pt - 1; LW R2, 12(SP) ADDIU R2, R2, -1 SW R2, 12(SP) ;MPU_IMU_I2C.c,42 :: } J L_MPU_I2C_Read_Int10 NOP L_MPU_I2C_Read_Int9: ;MPU_IMU_I2C.c,44 :: pt = dat + i + 1; ANDI R2, R4, 65535 ADDU R2, R28, R2 ADDIU R2, R2, 1 SW R2, 12(SP) ;MPU_IMU_I2C.c,45 :: } L_MPU_I2C_Read_Int10: ;MPU_IMU_I2C.c,46 :: *pt = I2C2_Read(_I2C_ACK); // Read the data (acknowledge) SB R25, 8(SP) MOVZ R25, R0, R0 JAL _I2C2_Read+0 NOP LBU R25, 8(SP) LW R3, 12(SP) SB R2, 0(R3) ;MPU_IMU_I2C.c,39 :: for (i = 0 ; i < ((len << 1)-1) ; i++){ ADDIU R2, R4, 1 ANDI R4, R2, 65535 ;MPU_IMU_I2C.c,47 :: } ; i end address is: 16 (R4) J L_MPU_I2C_Read_Int6 NOP L_MPU_I2C_Read_Int7: ;MPU_IMU_I2C.c,48 :: *(pt - 1) = I2C2_Read(_I2C_NACK); // Read the data (NO acknowledge) LW R2, 12(SP) ADDIU R2, R2, -1 SW R2, 16(SP) SB R25, 8(SP) ORI R25, R0, 1 JAL _I2C2_Read+0 NOP LBU R25, 8(SP) LW R3, 16(SP) SB R2, 0(R3) ;MPU_IMU_I2C.c,49 :: I2C2_Stop(); // issue I2C stop signal JAL _I2C2_Stop+0 NOP ;MPU_IMU_I2C.c,50 :: } L_end_MPU_I2C_Read_Int: LW R25, 4(SP) LW RA, 0(SP) ADDIU SP, SP, 20 JR RA NOP ; end of _MPU_I2C_Read_Int
mat/regtests/mat-testsuite.adb
stcarrez/mat
7
14714
----------------------------------------------------------------------- -- mat-testsuite - MAT Testsuite -- Copyright (C) 2014 <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 MAT.Readers.Tests; with MAT.Targets.Tests; with MAT.Frames.Tests; with MAT.Memory.Tests; with MAT.Expressions.Tests; package body MAT.Testsuite is Tests : aliased Util.Tests.Test_Suite; function Suite return Util.Tests.Access_Test_Suite is Result : constant Util.Tests.Access_Test_Suite := Tests'Access; begin MAT.Expressions.Tests.Add_Tests (Result); MAT.Frames.Tests.Add_Tests (Result); MAT.Memory.Tests.Add_Tests (Result); MAT.Readers.Tests.Add_Tests (Result); MAT.Targets.Tests.Add_Tests (Result); return Result; end Suite; end MAT.Testsuite;
src/pp/block1/cc/antlr/Musical.g4
Pieterjaninfo/PP
0
6475
lexer grammar Musical; LA: La; LALA: La La; LALALALI: La La La Li; fragment La: 'L' 'a'+ ' '*; fragment Li: 'Li' ' '*;
ioctl/IokSetHotKey.asm
osfree-project/FamilyAPI
1
161588
<reponame>osfree-project/FamilyAPI ;-------------------------------------------------------- ; Category 4 Function 56H Set Session Manager Hot Key ;-------------------------------------------------------- ; ; ; IOKSETHOTKEY PROC NEAR RET IOKSETHOTKEY ENDP
lab07/src/dataoperations.ads
evgenijaZ/PP-labs
0
15456
generic N : in Natural; package DataOperations is subtype Index is Positive range 1 .. N; type Vector is array (Index) of Integer; type Matrix is array (Index) of Vector; procedure Input (a : out Integer); procedure Generate (a : out Integer); procedure FillWithOne (a : out Integer); procedure Input (A : out Vector); procedure Generate (A : out Vector); procedure FillWithOne (A : out Vector); procedure Input (MA : out Matrix); procedure Generate (MA : out Matrix); procedure FillWithOne (MA : out Matrix); procedure Output (V : in Vector); procedure Output (MA : in Matrix); function Multiple (A : in Integer; MB : in Matrix; From : Integer; To : Integer) return Matrix; function Multiple (Left : in Matrix; Right : in Matrix; From : Integer; To : Integer) return Matrix; function Amount (MA : in Matrix; MB : in Matrix; From : Integer; To : Integer) return Matrix; end DataOperations;
x86_64/FloatingPointArithmetic/FloatingPointArithmetic_.asm
brucexia1/x86assembly
1
176856
<reponame>brucexia1/x86assembly ;======================================================================================== ; --Register-----|--Callee Save--|----------------------------Description---------------- ; | %rax | | 函数返回值寄存器;也用于idiv and imul指令 ; | %rbx | yes | ; | %rcx | | 函数第4个入参 ; | %rdx | | 函数第3个入参;也用于idiv and imul指令 ; | %rsp | | stack pointer,通常指向栈顶位置, pop和push操作会改变%rsp的值 ; | %rbp | yes | frame pointer ; | %rsi | | 函数第2个入参 ; | %rdi | | 函数第1个入参 ; | %r8 | | 函数第5个入参 ; | %r9 | | 函数第6个入参 ; | %r10 | | ; | %r11 | | ; | %r12-%r15 | yes | ; "Caller Save"即寄存器的值是由"调用者(父函数)保存",父函数必须push保存好Caller Save register ; 后再调用子函数 ; "Callee Save"即寄存器的值是由"被调用者(子函数)保存",父函数无需保存这些寄存器值由子函数先push ; 返回时再pop这些寄存器、子函数push和pop之间可以使用这些寄存器 ;======================================================================================== section .text ;======================================================================================== ; extern double CalcSum_(float a, double b, float c, double d, float e, double f); ; code is intel风格的汇编代码 global CalcSum_ CalcSum_: cvtss2sd xmm0,xmm0 ;promote a to DPFP addsd xmm0,xmm1 ;xmm0 = a + b cvtss2sd xmm2,xmm2 ;promote c to DPFP addsd xmm0,xmm2 ;xmm0 = a + b + c addsd xmm0,xmm3 ;xmm0 = a + b + c + d cvtss2sd xmm4,xmm4 ;promote c to DPFP addsd xmm0,xmm4 ;xmm0 = a + b + c + d + e addsd xmm0,xmm5 ;xmm0 = a + b + c + d + e + f ret ;======================================================================================== ;extern double CalcDist_(int x1, double x2, long long y1, double y2, float z1, short z2); ; edi <- x1 ; xmm0 <- x2 ; rsi <- y1 ; xmm1 <- y2 ; xmm2 <- z1 ; edx <- z2 ; code is intel风格的汇编代码 global CalcDist_ CalcDist_: ; Calculate xd = (x2 - x1) * (x2 - x1) cvtsi2sd xmm3,edi ;convert x1 to DPFP subsd xmm0,xmm3 ;xmm1 = x2 - x1 mulsd xmm0,xmm0 ;xmm1 = xd ; Calculate yd = (y2 - y1) * (y2 - y1) cvtsi2sd xmm3,rsi ;convert y1 to DPFP subsd xmm1,xmm3 ;xmm3 = y2 - y1 mulsd xmm1,xmm1 ;xmm3 = yd addsd xmm0,xmm1 ; Calculate zd = (z2 - z1) * (z2 - z1) cvtsi2sd xmm3,edx ;xmm=0 = z1 cvtss2sd xmm2,xmm2 ;convert z1 to DPFP subsd xmm3,xmm2 ;xmm4 = z2 - z1 mulsd xmm3,xmm3 ;xmm4 = zd ; Calculate final distance sqrt(xd + yd + zd) addsd xmm0,xmm3 ;xmm4 = xd + yd + zd sqrtsd xmm0,xmm0 ;xmm0 = sqrt(xd + yd + zd) ret ;========================================================================================
theorems/stash/modalities/Reflective.agda
timjb/HoTT-Agda
294
1123
{-# OPTIONS --without-K --rewriting #-} open import HoTT module Reflective where record ReflectiveSubuniverse {ℓ} : Type (lsucc ℓ) where field P : Type ℓ → Type ℓ R : Type ℓ → Type ℓ η : (A : Type ℓ) → A → R A -- replete : (A B : Type ℓ) → P A → A ≃ B → P B
programs/oeis/033/A033292.asm
karttu/loda
0
178861
; A033292: A Connell-like sequence: take 1 number = 1 (mod Q), 2 numbers = 2 (mod Q), 3 numbers = 3 (mod Q), etc., where Q = 3. ; 1,2,5,6,9,12,13,16,19,22,23,26,29,32,35,36,39,42,45,48,51,52,55,58,61,64,67,70,71,74,77,80,83,86,89,92,93,96,99,102,105,108,111,114,117,118,121,124,127,130,133,136,139,142,145,146,149,152,155,158,161,164,167,170,173,176,177,180,183,186,189,192,195,198,201,204,207,210,211,214,217,220,223,226,229,232,235,238,241,244,247,248,251,254,257,260,263,266,269,272,275,278,281,284,287,288,291,294,297,300,303,306,309,312,315,318,321,324,327,330,331,334,337,340,343,346,349,352,355,358,361,364,367,370,373,376,377,380,383,386,389,392,395,398,401,404,407,410,413,416,419,422,425,426,429,432,435,438,441,444,447,450,453,456,459,462,465,468,471,474,477,478,481,484,487,490,493,496,499,502,505,508,511,514,517,520,523,526,529,532,533,536,539,542,545,548,551,554,557,560,563,566,569,572,575,578,581,584,587,590,591,594,597,600,603,606,609,612,615,618,621,624,627,630,633,636,639,642,645,648,651,652,655,658,661,664,667,670,673,676,679,682,685,688,691,694,697,700,703,706 mov $1,1 mov $2,$0 lpb $2,1 lpb $1,1 mov $1,$2 add $3,2 lpe sub $2,1 add $3,1 add $1,$3 lpe
source/amf/uml/amf-internals-tables-umldi_metamodel.adb
svn2github/matreshka
24
16192
<reponame>svn2github/matreshka<gh_stars>10-100 ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ package body AMF.Internals.Tables.UMLDI_Metamodel is -------------------- -- MM_UMLDI_UMLDI -- -------------------- function MM_UMLDI_UMLDI return AMF.Internals.CMOF_Element is begin return Base + 96; end MM_UMLDI_UMLDI; -------------------------------------------------------------- -- MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind -- -------------------------------------------------------------- function MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind return AMF.Internals.CMOF_Element is begin return Base + 272; end MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind; ---------------------------------------------- -- MC_UMLDI_UML_Inherited_State_Border_Kind -- ---------------------------------------------- function MC_UMLDI_UML_Inherited_State_Border_Kind return AMF.Internals.CMOF_Element is begin return Base + 275; end MC_UMLDI_UML_Inherited_State_Border_Kind; ------------------------------------------- -- MC_UMLDI_UML_Interaction_Diagram_Kind -- ------------------------------------------- function MC_UMLDI_UML_Interaction_Diagram_Kind return AMF.Internals.CMOF_Element is begin return Base + 281; end MC_UMLDI_UML_Interaction_Diagram_Kind; ----------------------------------------------- -- MC_UMLDI_UML_Interaction_Table_Label_Kind -- ----------------------------------------------- function MC_UMLDI_UML_Interaction_Table_Label_Kind return AMF.Internals.CMOF_Element is begin return Base + 293; end MC_UMLDI_UML_Interaction_Table_Label_Kind; --------------------------------------------- -- MC_UMLDI_UML_Navigability_Notation_Kind -- --------------------------------------------- function MC_UMLDI_UML_Navigability_Notation_Kind return AMF.Internals.CMOF_Element is begin return Base + 309; end MC_UMLDI_UML_Navigability_Notation_Kind; ----------------------------------- -- MC_UMLDI_UML_Activity_Diagram -- ----------------------------------- function MC_UMLDI_UML_Activity_Diagram return AMF.Internals.CMOF_Element is begin return Base + 1; end MC_UMLDI_UML_Activity_Diagram; ---------------------------------------- -- MC_UMLDI_UML_Association_End_Label -- ---------------------------------------- function MC_UMLDI_UML_Association_End_Label return AMF.Internals.CMOF_Element is begin return Base + 2; end MC_UMLDI_UML_Association_End_Label; --------------------------------------------------------- -- MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape -- --------------------------------------------------------- function MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape return AMF.Internals.CMOF_Element is begin return Base + 3; end MC_UMLDI_UML_Association_Or_Connector_Or_Link_Shape; ----------------------------------- -- MC_UMLDI_UML_Behavior_Diagram -- ----------------------------------- function MC_UMLDI_UML_Behavior_Diagram return AMF.Internals.CMOF_Element is begin return Base + 4; end MC_UMLDI_UML_Behavior_Diagram; -------------------------------- -- MC_UMLDI_UML_Class_Diagram -- -------------------------------- function MC_UMLDI_UML_Class_Diagram return AMF.Internals.CMOF_Element is begin return Base + 5; end MC_UMLDI_UML_Class_Diagram; ------------------------------------------------------- -- MC_UMLDI_UML_Class_Or_Composite_Structure_Diagram -- ------------------------------------------------------- function MC_UMLDI_UML_Class_Or_Composite_Structure_Diagram return AMF.Internals.CMOF_Element is begin return Base + 6; end MC_UMLDI_UML_Class_Or_Composite_Structure_Diagram; ----------------------------------- -- MC_UMLDI_UML_Classifier_Shape -- ----------------------------------- function MC_UMLDI_UML_Classifier_Shape return AMF.Internals.CMOF_Element is begin return Base + 7; end MC_UMLDI_UML_Classifier_Shape; ------------------------------ -- MC_UMLDI_UML_Compartment -- ------------------------------ function MC_UMLDI_UML_Compartment return AMF.Internals.CMOF_Element is begin return Base + 8; end MC_UMLDI_UML_Compartment; ---------------------------------------- -- MC_UMLDI_UML_Compartmentable_Shape -- ---------------------------------------- function MC_UMLDI_UML_Compartmentable_Shape return AMF.Internals.CMOF_Element is begin return Base + 9; end MC_UMLDI_UML_Compartmentable_Shape; ------------------------------------ -- MC_UMLDI_UML_Component_Diagram -- ------------------------------------ function MC_UMLDI_UML_Component_Diagram return AMF.Internals.CMOF_Element is begin return Base + 10; end MC_UMLDI_UML_Component_Diagram; ---------------------------------------------- -- MC_UMLDI_UML_Composite_Structure_Diagram -- ---------------------------------------------- function MC_UMLDI_UML_Composite_Structure_Diagram return AMF.Internals.CMOF_Element is begin return Base + 11; end MC_UMLDI_UML_Composite_Structure_Diagram; ------------------------------------- -- MC_UMLDI_UML_Deployment_Diagram -- ------------------------------------- function MC_UMLDI_UML_Deployment_Diagram return AMF.Internals.CMOF_Element is begin return Base + 12; end MC_UMLDI_UML_Deployment_Diagram; -------------------------- -- MC_UMLDI_UML_Diagram -- -------------------------- function MC_UMLDI_UML_Diagram return AMF.Internals.CMOF_Element is begin return Base + 13; end MC_UMLDI_UML_Diagram; ---------------------------------- -- MC_UMLDI_UML_Diagram_Element -- ---------------------------------- function MC_UMLDI_UML_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 14; end MC_UMLDI_UML_Diagram_Element; ----------------------- -- MC_UMLDI_UML_Edge -- ----------------------- function MC_UMLDI_UML_Edge return AMF.Internals.CMOF_Element is begin return Base + 15; end MC_UMLDI_UML_Edge; -------------------------------------- -- MC_UMLDI_UML_Interaction_Diagram -- -------------------------------------- function MC_UMLDI_UML_Interaction_Diagram return AMF.Internals.CMOF_Element is begin return Base + 16; end MC_UMLDI_UML_Interaction_Diagram; ------------------------------------------ -- MC_UMLDI_UML_Interaction_Table_Label -- ------------------------------------------ function MC_UMLDI_UML_Interaction_Table_Label return AMF.Internals.CMOF_Element is begin return Base + 17; end MC_UMLDI_UML_Interaction_Table_Label; -------------------------------- -- MC_UMLDI_UML_Keyword_Label -- -------------------------------- function MC_UMLDI_UML_Keyword_Label return AMF.Internals.CMOF_Element is begin return Base + 18; end MC_UMLDI_UML_Keyword_Label; ------------------------ -- MC_UMLDI_UML_Label -- ------------------------ function MC_UMLDI_UML_Label return AMF.Internals.CMOF_Element is begin return Base + 19; end MC_UMLDI_UML_Label; ------------------------------------- -- MC_UMLDI_UML_Multiplicity_Label -- ------------------------------------- function MC_UMLDI_UML_Multiplicity_Label return AMF.Internals.CMOF_Element is begin return Base + 20; end MC_UMLDI_UML_Multiplicity_Label; ----------------------------- -- MC_UMLDI_UML_Name_Label -- ----------------------------- function MC_UMLDI_UML_Name_Label return AMF.Internals.CMOF_Element is begin return Base + 21; end MC_UMLDI_UML_Name_Label; --------------------------------- -- MC_UMLDI_UML_Object_Diagram -- --------------------------------- function MC_UMLDI_UML_Object_Diagram return AMF.Internals.CMOF_Element is begin return Base + 22; end MC_UMLDI_UML_Object_Diagram; ---------------------------------- -- MC_UMLDI_UML_Package_Diagram -- ---------------------------------- function MC_UMLDI_UML_Package_Diagram return AMF.Internals.CMOF_Element is begin return Base + 23; end MC_UMLDI_UML_Package_Diagram; ---------------------------------- -- MC_UMLDI_UML_Profile_Diagram -- ---------------------------------- function MC_UMLDI_UML_Profile_Diagram return AMF.Internals.CMOF_Element is begin return Base + 24; end MC_UMLDI_UML_Profile_Diagram; ---------------------------------- -- MC_UMLDI_UML_Redefines_Label -- ---------------------------------- function MC_UMLDI_UML_Redefines_Label return AMF.Internals.CMOF_Element is begin return Base + 25; end MC_UMLDI_UML_Redefines_Label; ------------------------ -- MC_UMLDI_UML_Shape -- ------------------------ function MC_UMLDI_UML_Shape return AMF.Internals.CMOF_Element is begin return Base + 26; end MC_UMLDI_UML_Shape; ---------------------------------------- -- MC_UMLDI_UML_State_Machine_Diagram -- ---------------------------------------- function MC_UMLDI_UML_State_Machine_Diagram return AMF.Internals.CMOF_Element is begin return Base + 27; end MC_UMLDI_UML_State_Machine_Diagram; ------------------------------ -- MC_UMLDI_UML_State_Shape -- ------------------------------ function MC_UMLDI_UML_State_Shape return AMF.Internals.CMOF_Element is begin return Base + 28; end MC_UMLDI_UML_State_Shape; -------------------------------------------------- -- MC_UMLDI_UML_Stereotype_Property_Value_Label -- -------------------------------------------------- function MC_UMLDI_UML_Stereotype_Property_Value_Label return AMF.Internals.CMOF_Element is begin return Base + 29; end MC_UMLDI_UML_Stereotype_Property_Value_Label; ------------------------------------ -- MC_UMLDI_UML_Structure_Diagram -- ------------------------------------ function MC_UMLDI_UML_Structure_Diagram return AMF.Internals.CMOF_Element is begin return Base + 30; end MC_UMLDI_UML_Structure_Diagram; ------------------------ -- MC_UMLDI_UML_Style -- ------------------------ function MC_UMLDI_UML_Style return AMF.Internals.CMOF_Element is begin return Base + 31; end MC_UMLDI_UML_Style; -------------------------------------- -- MC_UMLDI_UML_Typed_Element_Label -- -------------------------------------- function MC_UMLDI_UML_Typed_Element_Label return AMF.Internals.CMOF_Element is begin return Base + 32; end MC_UMLDI_UML_Typed_Element_Label; ----------------------------------- -- MC_UMLDI_UML_Use_Case_Diagram -- ----------------------------------- function MC_UMLDI_UML_Use_Case_Diagram return AMF.Internals.CMOF_Element is begin return Base + 33; end MC_UMLDI_UML_Use_Case_Diagram; ----------------------------------------------------- -- MP_UMLDI_UML_Activity_Diagram_Is_Activity_Frame -- ----------------------------------------------------- function MP_UMLDI_UML_Activity_Diagram_Is_Activity_Frame return AMF.Internals.CMOF_Element is begin return Base + 39; end MP_UMLDI_UML_Activity_Diagram_Is_Activity_Frame; ----------------------------------------------------------------------- -- MP_UMLDI_UML_Activity_Diagram_Model_Element_A_Uml_Diagram_Element -- ----------------------------------------------------------------------- function MP_UMLDI_UML_Activity_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 40; end MP_UMLDI_UML_Activity_Diagram_Model_Element_A_Uml_Diagram_Element; ---------------------------------------------------------------------------- -- MP_UMLDI_UML_Association_End_Label_Model_Element_A_Uml_Diagram_Element -- ---------------------------------------------------------------------------- function MP_UMLDI_UML_Association_End_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 41; end MP_UMLDI_UML_Association_End_Label_Model_Element_A_Uml_Diagram_Element; -------------------------------------------------------------- -- MP_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind -- -------------------------------------------------------------- function MP_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind return AMF.Internals.CMOF_Element is begin return Base + 42; end MP_UMLDI_UML_Association_Or_Connector_Or_Link_Shape_Kind; ----------------------------------------------------------------------- -- MP_UMLDI_UML_Behavior_Diagram_Model_Element_A_Uml_Diagram_Element -- ----------------------------------------------------------------------- function MP_UMLDI_UML_Behavior_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 43; end MP_UMLDI_UML_Behavior_Diagram_Model_Element_A_Uml_Diagram_Element; -------------------------------------------------------------------------------- -- MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Is_Association_Dot_Shown -- -------------------------------------------------------------------------------- function MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Is_Association_Dot_Shown return AMF.Internals.CMOF_Element is begin return Base + 44; end MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Is_Association_Dot_Shown; ----------------------------------------------------------------------------- -- MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Navigability_Notation -- ----------------------------------------------------------------------------- function MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Navigability_Notation return AMF.Internals.CMOF_Element is begin return Base + 45; end MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Navigability_Notation; --------------------------------------------------------------------------------- -- MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Non_Navigability_Notation -- --------------------------------------------------------------------------------- function MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Non_Navigability_Notation return AMF.Internals.CMOF_Element is begin return Base + 46; end MP_UMLDI_UML_Class_Or_Composite_Structure_Diagram_Non_Navigability_Notation; --------------------------------------------------- -- MP_UMLDI_UML_Classifier_Shape_Is_Double_Sided -- --------------------------------------------------- function MP_UMLDI_UML_Classifier_Shape_Is_Double_Sided return AMF.Internals.CMOF_Element is begin return Base + 47; end MP_UMLDI_UML_Classifier_Shape_Is_Double_Sided; ------------------------------------------------------------ -- MP_UMLDI_UML_Classifier_Shape_Is_Indent_For_Visibility -- ------------------------------------------------------------ function MP_UMLDI_UML_Classifier_Shape_Is_Indent_For_Visibility return AMF.Internals.CMOF_Element is begin return Base + 48; end MP_UMLDI_UML_Classifier_Shape_Is_Indent_For_Visibility; ----------------------------------------------------------------------- -- MP_UMLDI_UML_Classifier_Shape_Model_Element_A_Uml_Diagram_Element -- ----------------------------------------------------------------------- function MP_UMLDI_UML_Classifier_Shape_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 49; end MP_UMLDI_UML_Classifier_Shape_Model_Element_A_Uml_Diagram_Element; -------------------------------------------------------------------------- -- MP_UMLDI_UML_Compartment_Element_In_Compartment_A_Owning_Compartment -- -------------------------------------------------------------------------- function MP_UMLDI_UML_Compartment_Element_In_Compartment_A_Owning_Compartment return AMF.Internals.CMOF_Element is begin return Base + 34; end MP_UMLDI_UML_Compartment_Element_In_Compartment_A_Owning_Compartment; -------------------------------------------------------------------------- -- MP_UMLDI_UML_Compartmentable_Shape_Compartment_A_Compartmented_Shape -- -------------------------------------------------------------------------- function MP_UMLDI_UML_Compartmentable_Shape_Compartment_A_Compartmented_Shape return AMF.Internals.CMOF_Element is begin return Base + 35; end MP_UMLDI_UML_Compartmentable_Shape_Compartment_A_Compartmented_Shape; --------------------------------------------------- -- MP_UMLDI_UML_Diagram_Heading_A_Headed_Diagram -- --------------------------------------------------- function MP_UMLDI_UML_Diagram_Heading_A_Headed_Diagram return AMF.Internals.CMOF_Element is begin return Base + 50; end MP_UMLDI_UML_Diagram_Heading_A_Headed_Diagram; ----------------------------------- -- MP_UMLDI_UML_Diagram_Is_Frame -- ----------------------------------- function MP_UMLDI_UML_Diagram_Is_Frame return AMF.Internals.CMOF_Element is begin return Base + 51; end MP_UMLDI_UML_Diagram_Is_Frame; --------------------------------- -- MP_UMLDI_UML_Diagram_Is_Iso -- --------------------------------- function MP_UMLDI_UML_Diagram_Is_Iso return AMF.Internals.CMOF_Element is begin return Base + 52; end MP_UMLDI_UML_Diagram_Is_Iso; ------------------------------------------ -- MP_UMLDI_UML_Diagram_Element_Is_Icon -- ------------------------------------------ function MP_UMLDI_UML_Diagram_Element_Is_Icon return AMF.Internals.CMOF_Element is begin return Base + 53; end MP_UMLDI_UML_Diagram_Element_Is_Icon; --------------------------------------------------------------- -- MP_UMLDI_UML_Diagram_Element_Local_Style_A_Styled_Element -- --------------------------------------------------------------- function MP_UMLDI_UML_Diagram_Element_Local_Style_A_Styled_Element return AMF.Internals.CMOF_Element is begin return Base + 54; end MP_UMLDI_UML_Diagram_Element_Local_Style_A_Styled_Element; ---------------------------------------------------------------------- -- MP_UMLDI_UML_Diagram_Element_Model_Element_A_Uml_Diagram_Element -- ---------------------------------------------------------------------- function MP_UMLDI_UML_Diagram_Element_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 36; end MP_UMLDI_UML_Diagram_Element_Model_Element_A_Uml_Diagram_Element; ----------------------------------------------------------------------------------- -- MP_UMLDI_UML_Diagram_Element_Owned_Element_UML_Diagram_Element_Owning_Element -- ----------------------------------------------------------------------------------- function MP_UMLDI_UML_Diagram_Element_Owned_Element_UML_Diagram_Element_Owning_Element return AMF.Internals.CMOF_Element is begin return Base + 37; end MP_UMLDI_UML_Diagram_Element_Owned_Element_UML_Diagram_Element_Owning_Element; ----------------------------------------------------------------------------------- -- MP_UMLDI_UML_Diagram_Element_Owning_Element_UML_Diagram_Element_Owned_Element -- ----------------------------------------------------------------------------------- function MP_UMLDI_UML_Diagram_Element_Owning_Element_UML_Diagram_Element_Owned_Element return AMF.Internals.CMOF_Element is begin return Base + 55; end MP_UMLDI_UML_Diagram_Element_Owning_Element_UML_Diagram_Element_Owned_Element; ---------------------------------------------------------------- -- MP_UMLDI_UML_Diagram_Element_Shared_Style_A_Styled_Element -- ---------------------------------------------------------------- function MP_UMLDI_UML_Diagram_Element_Shared_Style_A_Styled_Element return AMF.Internals.CMOF_Element is begin return Base + 56; end MP_UMLDI_UML_Diagram_Element_Shared_Style_A_Styled_Element; -------------------------------------------- -- MP_UMLDI_UML_Edge_Source_A_Source_Edge -- -------------------------------------------- function MP_UMLDI_UML_Edge_Source_A_Source_Edge return AMF.Internals.CMOF_Element is begin return Base + 57; end MP_UMLDI_UML_Edge_Source_A_Source_Edge; -------------------------------------------- -- MP_UMLDI_UML_Edge_Target_A_Target_Edge -- -------------------------------------------- function MP_UMLDI_UML_Edge_Target_A_Target_Edge return AMF.Internals.CMOF_Element is begin return Base + 58; end MP_UMLDI_UML_Edge_Target_A_Target_Edge; ------------------------------------------- -- MP_UMLDI_UML_Interaction_Diagram_Kind -- ------------------------------------------- function MP_UMLDI_UML_Interaction_Diagram_Kind return AMF.Internals.CMOF_Element is begin return Base + 59; end MP_UMLDI_UML_Interaction_Diagram_Kind; -------------------------------------------------------------------------- -- MP_UMLDI_UML_Interaction_Diagram_Model_Element_A_Uml_Diagram_Element -- -------------------------------------------------------------------------- function MP_UMLDI_UML_Interaction_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 60; end MP_UMLDI_UML_Interaction_Diagram_Model_Element_A_Uml_Diagram_Element; ----------------------------------------------- -- MP_UMLDI_UML_Interaction_Table_Label_Kind -- ----------------------------------------------- function MP_UMLDI_UML_Interaction_Table_Label_Kind return AMF.Internals.CMOF_Element is begin return Base + 61; end MP_UMLDI_UML_Interaction_Table_Label_Kind; ----------------------------- -- MP_UMLDI_UML_Label_Text -- ----------------------------- function MP_UMLDI_UML_Label_Text return AMF.Internals.CMOF_Element is begin return Base + 62; end MP_UMLDI_UML_Label_Text; ------------------------------------------------------------------------- -- MP_UMLDI_UML_Multiplicity_Label_Model_Element_A_Uml_Diagram_Element -- ------------------------------------------------------------------------- function MP_UMLDI_UML_Multiplicity_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 63; end MP_UMLDI_UML_Multiplicity_Label_Model_Element_A_Uml_Diagram_Element; ---------------------------------------------------------------- -- MP_UMLDI_UML_Name_Label_Mode_Element_A_Uml_Diagram_Element -- ---------------------------------------------------------------- function MP_UMLDI_UML_Name_Label_Mode_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 64; end MP_UMLDI_UML_Name_Label_Mode_Element_A_Uml_Diagram_Element; ---------------------------------------------------------------------- -- MP_UMLDI_UML_Redefines_Label_Model_Element_A_Uml_Diagram_Element -- ---------------------------------------------------------------------- function MP_UMLDI_UML_Redefines_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 65; end MP_UMLDI_UML_Redefines_Label_Model_Element_A_Uml_Diagram_Element; --------------------------------------------------------------- -- MP_UMLDI_UML_State_Machine_Diagram_Inherited_State_Border -- --------------------------------------------------------------- function MP_UMLDI_UML_State_Machine_Diagram_Inherited_State_Border return AMF.Internals.CMOF_Element is begin return Base + 66; end MP_UMLDI_UML_State_Machine_Diagram_Inherited_State_Border; --------------------------------------------------------------- -- MP_UMLDI_UML_State_Machine_Diagram_Is_Collapse_State_Icon -- --------------------------------------------------------------- function MP_UMLDI_UML_State_Machine_Diagram_Is_Collapse_State_Icon return AMF.Internals.CMOF_Element is begin return Base + 67; end MP_UMLDI_UML_State_Machine_Diagram_Is_Collapse_State_Icon; --------------------------------------------------------------- -- MP_UMLDI_UML_State_Machine_Diagram_Is_Transition_Oriented -- --------------------------------------------------------------- function MP_UMLDI_UML_State_Machine_Diagram_Is_Transition_Oriented return AMF.Internals.CMOF_Element is begin return Base + 68; end MP_UMLDI_UML_State_Machine_Diagram_Is_Transition_Oriented; ---------------------------------------------------------------------------- -- MP_UMLDI_UML_State_Machine_Diagram_Model_Element_A_Uml_Diagram_Element -- ---------------------------------------------------------------------------- function MP_UMLDI_UML_State_Machine_Diagram_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 69; end MP_UMLDI_UML_State_Machine_Diagram_Model_Element_A_Uml_Diagram_Element; ---------------------------------------- -- MP_UMLDI_UML_State_Shape_Is_Tabbed -- ---------------------------------------- function MP_UMLDI_UML_State_Shape_Is_Tabbed return AMF.Internals.CMOF_Element is begin return Base + 70; end MP_UMLDI_UML_State_Shape_Is_Tabbed; ------------------------------------------------------------------ -- MP_UMLDI_UML_State_Shape_Model_Element_A_Uml_Diagram_Element -- ------------------------------------------------------------------ function MP_UMLDI_UML_State_Shape_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 38; end MP_UMLDI_UML_State_Shape_Model_Element_A_Uml_Diagram_Element; -------------------------------------------------------------------------------------- -- MP_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_A_Uml_Diagram_Element -- -------------------------------------------------------------------------------------- function MP_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_A_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 71; end MP_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_A_Uml_Diagram_Element; ------------------------------------------------------------------------------------------------------- -- MP_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_A_Label_Showing_Stereotype_Value -- ------------------------------------------------------------------------------------------------------- function MP_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_A_Label_Showing_Stereotype_Value return AMF.Internals.CMOF_Element is begin return Base + 72; end MP_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_A_Label_Showing_Stereotype_Value; ---------------------------------- -- MP_UMLDI_UML_Style_Font_Name -- ---------------------------------- function MP_UMLDI_UML_Style_Font_Name return AMF.Internals.CMOF_Element is begin return Base + 73; end MP_UMLDI_UML_Style_Font_Name; ---------------------------------- -- MP_UMLDI_UML_Style_Font_Size -- ---------------------------------- function MP_UMLDI_UML_Style_Font_Size return AMF.Internals.CMOF_Element is begin return Base + 74; end MP_UMLDI_UML_Style_Font_Size; ----------------------------------------------------------------------- -- MP_UMLDI_A_Uml_Diagram_Element_UML_Activity_Diagram_Model_Element -- ----------------------------------------------------------------------- function MP_UMLDI_A_Uml_Diagram_Element_UML_Activity_Diagram_Model_Element return AMF.Internals.CMOF_Element is begin return Base + 97; end MP_UMLDI_A_Uml_Diagram_Element_UML_Activity_Diagram_Model_Element; ---------------------------------------------------------------------------- -- MP_UMLDI_A_Uml_Diagram_Element_UML_Association_End_Label_Model_Element -- ---------------------------------------------------------------------------- function MP_UMLDI_A_Uml_Diagram_Element_UML_Association_End_Label_Model_Element return AMF.Internals.CMOF_Element is begin return Base + 98; end MP_UMLDI_A_Uml_Diagram_Element_UML_Association_End_Label_Model_Element; ----------------------------------------------------------------------- -- MP_UMLDI_A_Uml_Diagram_Element_UML_Behavior_Diagram_Model_Element -- ----------------------------------------------------------------------- function MP_UMLDI_A_Uml_Diagram_Element_UML_Behavior_Diagram_Model_Element return AMF.Internals.CMOF_Element is begin return Base + 99; end MP_UMLDI_A_Uml_Diagram_Element_UML_Behavior_Diagram_Model_Element; ----------------------------------------------------------------------- -- MP_UMLDI_A_Uml_Diagram_Element_UML_Classifier_Shape_Model_Element -- ----------------------------------------------------------------------- function MP_UMLDI_A_Uml_Diagram_Element_UML_Classifier_Shape_Model_Element return AMF.Internals.CMOF_Element is begin return Base + 100; end MP_UMLDI_A_Uml_Diagram_Element_UML_Classifier_Shape_Model_Element; -------------------------------------------------------------------------- -- MP_UMLDI_A_Owning_Compartment_UML_Compartment_Element_In_Compartment -- -------------------------------------------------------------------------- function MP_UMLDI_A_Owning_Compartment_UML_Compartment_Element_In_Compartment return AMF.Internals.CMOF_Element is begin return Base + 101; end MP_UMLDI_A_Owning_Compartment_UML_Compartment_Element_In_Compartment; -------------------------------------------------------------------------- -- MP_UMLDI_A_Compartmented_Shape_UML_Compartmentable_Shape_Compartment -- -------------------------------------------------------------------------- function MP_UMLDI_A_Compartmented_Shape_UML_Compartmentable_Shape_Compartment return AMF.Internals.CMOF_Element is begin return Base + 103; end MP_UMLDI_A_Compartmented_Shape_UML_Compartmentable_Shape_Compartment; --------------------------------------------------------------- -- MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Local_Style -- --------------------------------------------------------------- function MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Local_Style return AMF.Internals.CMOF_Element is begin return Base + 104; end MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Local_Style; ---------------------------------------------------------------------- -- MP_UMLDI_A_Uml_Diagram_Element_UML_Diagram_Element_Model_Element -- ---------------------------------------------------------------------- function MP_UMLDI_A_Uml_Diagram_Element_UML_Diagram_Element_Model_Element return AMF.Internals.CMOF_Element is begin return Base + 105; end MP_UMLDI_A_Uml_Diagram_Element_UML_Diagram_Element_Model_Element; ---------------------------------------------------------------- -- MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Shared_Style -- ---------------------------------------------------------------- function MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Shared_Style return AMF.Internals.CMOF_Element is begin return Base + 106; end MP_UMLDI_A_Styled_Element_UML_Diagram_Element_Shared_Style; --------------------------------------------------- -- MP_UMLDI_A_Headed_Diagram_UML_Diagram_Heading -- --------------------------------------------------- function MP_UMLDI_A_Headed_Diagram_UML_Diagram_Heading return AMF.Internals.CMOF_Element is begin return Base + 107; end MP_UMLDI_A_Headed_Diagram_UML_Diagram_Heading; -------------------------------------------- -- MP_UMLDI_A_Source_Edge_UML_Edge_Source -- -------------------------------------------- function MP_UMLDI_A_Source_Edge_UML_Edge_Source return AMF.Internals.CMOF_Element is begin return Base + 108; end MP_UMLDI_A_Source_Edge_UML_Edge_Source; -------------------------------------------- -- MP_UMLDI_A_Target_Edge_UML_Edge_Target -- -------------------------------------------- function MP_UMLDI_A_Target_Edge_UML_Edge_Target return AMF.Internals.CMOF_Element is begin return Base + 109; end MP_UMLDI_A_Target_Edge_UML_Edge_Target; -------------------------------------------------------------------------- -- MP_UMLDI_A_Uml_Diagram_Element_UML_Interaction_Diagram_Model_Element -- -------------------------------------------------------------------------- function MP_UMLDI_A_Uml_Diagram_Element_UML_Interaction_Diagram_Model_Element return AMF.Internals.CMOF_Element is begin return Base + 110; end MP_UMLDI_A_Uml_Diagram_Element_UML_Interaction_Diagram_Model_Element; ------------------------------------------------------------------------- -- MP_UMLDI_A_Uml_Diagram_Element_UML_Multiplicity_Label_Model_Element -- ------------------------------------------------------------------------- function MP_UMLDI_A_Uml_Diagram_Element_UML_Multiplicity_Label_Model_Element return AMF.Internals.CMOF_Element is begin return Base + 111; end MP_UMLDI_A_Uml_Diagram_Element_UML_Multiplicity_Label_Model_Element; ---------------------------------------------------------------- -- MP_UMLDI_A_Uml_Diagram_Element_UML_Name_Label_Mode_Element -- ---------------------------------------------------------------- function MP_UMLDI_A_Uml_Diagram_Element_UML_Name_Label_Mode_Element return AMF.Internals.CMOF_Element is begin return Base + 112; end MP_UMLDI_A_Uml_Diagram_Element_UML_Name_Label_Mode_Element; ---------------------------------------------------------------------- -- MP_UMLDI_A_Uml_Diagram_Element_UML_Redefines_Label_Model_Element -- ---------------------------------------------------------------------- function MP_UMLDI_A_Uml_Diagram_Element_UML_Redefines_Label_Model_Element return AMF.Internals.CMOF_Element is begin return Base + 113; end MP_UMLDI_A_Uml_Diagram_Element_UML_Redefines_Label_Model_Element; ---------------------------------------------------------------------------- -- MP_UMLDI_A_Uml_Diagram_Element_UML_State_Machine_Diagram_Model_Element -- ---------------------------------------------------------------------------- function MP_UMLDI_A_Uml_Diagram_Element_UML_State_Machine_Diagram_Model_Element return AMF.Internals.CMOF_Element is begin return Base + 114; end MP_UMLDI_A_Uml_Diagram_Element_UML_State_Machine_Diagram_Model_Element; ------------------------------------------------------------------ -- MP_UMLDI_A_Uml_Diagram_Element_UML_State_Shape_Model_Element -- ------------------------------------------------------------------ function MP_UMLDI_A_Uml_Diagram_Element_UML_State_Shape_Model_Element return AMF.Internals.CMOF_Element is begin return Base + 115; end MP_UMLDI_A_Uml_Diagram_Element_UML_State_Shape_Model_Element; -------------------------------------------------------------------------------------- -- MP_UMLDI_A_Uml_Diagram_Element_UML_Stereotype_Property_Value_Label_Model_Element -- -------------------------------------------------------------------------------------- function MP_UMLDI_A_Uml_Diagram_Element_UML_Stereotype_Property_Value_Label_Model_Element return AMF.Internals.CMOF_Element is begin return Base + 116; end MP_UMLDI_A_Uml_Diagram_Element_UML_Stereotype_Property_Value_Label_Model_Element; ------------------------------------------------------------------------------------------------------- -- MP_UMLDI_A_Label_Showing_Stereotype_Value_UML_Stereotype_Property_Value_Label_Stereotyped_Element -- ------------------------------------------------------------------------------------------------------- function MP_UMLDI_A_Label_Showing_Stereotype_Value_UML_Stereotype_Property_Value_Label_Stereotyped_Element return AMF.Internals.CMOF_Element is begin return Base + 117; end MP_UMLDI_A_Label_Showing_Stereotype_Value_UML_Stereotype_Property_Value_Label_Stereotyped_Element; --------------------------------------------------------------------- -- MA_UMLDI_UML_Activity_Diagram_Model_Element_Uml_Diagram_Element -- --------------------------------------------------------------------- function MA_UMLDI_UML_Activity_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 75; end MA_UMLDI_UML_Activity_Diagram_Model_Element_Uml_Diagram_Element; -------------------------------------------------------------------------- -- MA_UMLDI_UML_Association_End_Label_Model_Element_Uml_Diagram_Element -- -------------------------------------------------------------------------- function MA_UMLDI_UML_Association_End_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 76; end MA_UMLDI_UML_Association_End_Label_Model_Element_Uml_Diagram_Element; --------------------------------------------------------------------- -- MA_UMLDI_UML_Behavior_Diagram_Model_Element_Uml_Diagram_Element -- --------------------------------------------------------------------- function MA_UMLDI_UML_Behavior_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 77; end MA_UMLDI_UML_Behavior_Diagram_Model_Element_Uml_Diagram_Element; --------------------------------------------------------------------- -- MA_UMLDI_UML_Classifier_Shape_Model_Element_Uml_Diagram_Element -- --------------------------------------------------------------------- function MA_UMLDI_UML_Classifier_Shape_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 78; end MA_UMLDI_UML_Classifier_Shape_Model_Element_Uml_Diagram_Element; ------------------------------------------------------------------------ -- MA_UMLDI_UML_Compartment_Element_In_Compartment_Owning_Compartment -- ------------------------------------------------------------------------ function MA_UMLDI_UML_Compartment_Element_In_Compartment_Owning_Compartment return AMF.Internals.CMOF_Element is begin return Base + 79; end MA_UMLDI_UML_Compartment_Element_In_Compartment_Owning_Compartment; ------------------------------------------------------------------------ -- MA_UMLDI_UML_Compartmentable_Shape_Compartment_Compartmented_Shape -- ------------------------------------------------------------------------ function MA_UMLDI_UML_Compartmentable_Shape_Compartment_Compartmented_Shape return AMF.Internals.CMOF_Element is begin return Base + 80; end MA_UMLDI_UML_Compartmentable_Shape_Compartment_Compartmented_Shape; ------------------------------------------------------------- -- MA_UMLDI_UML_Diagram_Element_Local_Style_Styled_Element -- ------------------------------------------------------------- function MA_UMLDI_UML_Diagram_Element_Local_Style_Styled_Element return AMF.Internals.CMOF_Element is begin return Base + 81; end MA_UMLDI_UML_Diagram_Element_Local_Style_Styled_Element; -------------------------------------------------------------------- -- MA_UMLDI_UML_Diagram_Element_Model_Element_Uml_Diagram_Element -- -------------------------------------------------------------------- function MA_UMLDI_UML_Diagram_Element_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 82; end MA_UMLDI_UML_Diagram_Element_Model_Element_Uml_Diagram_Element; --------------------------------------------------------------- -- MA_UMLDI_UML_Diagram_Element_Owned_Element_Owning_Element -- --------------------------------------------------------------- function MA_UMLDI_UML_Diagram_Element_Owned_Element_Owning_Element return AMF.Internals.CMOF_Element is begin return Base + 83; end MA_UMLDI_UML_Diagram_Element_Owned_Element_Owning_Element; -------------------------------------------------------------- -- MA_UMLDI_UML_Diagram_Element_Shared_Style_Styled_Element -- -------------------------------------------------------------- function MA_UMLDI_UML_Diagram_Element_Shared_Style_Styled_Element return AMF.Internals.CMOF_Element is begin return Base + 84; end MA_UMLDI_UML_Diagram_Element_Shared_Style_Styled_Element; ------------------------------------------------- -- MA_UMLDI_UML_Diagram_Heading_Headed_Diagram -- ------------------------------------------------- function MA_UMLDI_UML_Diagram_Heading_Headed_Diagram return AMF.Internals.CMOF_Element is begin return Base + 85; end MA_UMLDI_UML_Diagram_Heading_Headed_Diagram; ------------------------------------------ -- MA_UMLDI_UML_Edge_Source_Source_Edge -- ------------------------------------------ function MA_UMLDI_UML_Edge_Source_Source_Edge return AMF.Internals.CMOF_Element is begin return Base + 86; end MA_UMLDI_UML_Edge_Source_Source_Edge; ------------------------------------------ -- MA_UMLDI_UML_Edge_Target_Target_Edge -- ------------------------------------------ function MA_UMLDI_UML_Edge_Target_Target_Edge return AMF.Internals.CMOF_Element is begin return Base + 87; end MA_UMLDI_UML_Edge_Target_Target_Edge; ------------------------------------------------------------------------ -- MA_UMLDI_UML_Interaction_Diagram_Model_Element_Uml_Diagram_Element -- ------------------------------------------------------------------------ function MA_UMLDI_UML_Interaction_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 88; end MA_UMLDI_UML_Interaction_Diagram_Model_Element_Uml_Diagram_Element; ----------------------------------------------------------------------- -- MA_UMLDI_UML_Multiplicity_Label_Model_Element_Uml_Diagram_Element -- ----------------------------------------------------------------------- function MA_UMLDI_UML_Multiplicity_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 89; end MA_UMLDI_UML_Multiplicity_Label_Model_Element_Uml_Diagram_Element; -------------------------------------------------------------- -- MA_UMLDI_UML_Name_Label_Mode_Element_Uml_Diagram_Element -- -------------------------------------------------------------- function MA_UMLDI_UML_Name_Label_Mode_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 90; end MA_UMLDI_UML_Name_Label_Mode_Element_Uml_Diagram_Element; -------------------------------------------------------------------- -- MA_UMLDI_UML_Redefines_Label_Model_Element_Uml_Diagram_Element -- -------------------------------------------------------------------- function MA_UMLDI_UML_Redefines_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 91; end MA_UMLDI_UML_Redefines_Label_Model_Element_Uml_Diagram_Element; -------------------------------------------------------------------------- -- MA_UMLDI_UML_State_Machine_Diagram_Model_Element_Uml_Diagram_Element -- -------------------------------------------------------------------------- function MA_UMLDI_UML_State_Machine_Diagram_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 92; end MA_UMLDI_UML_State_Machine_Diagram_Model_Element_Uml_Diagram_Element; ---------------------------------------------------------------- -- MA_UMLDI_UML_State_Shape_Model_Element_Uml_Diagram_Element -- ---------------------------------------------------------------- function MA_UMLDI_UML_State_Shape_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 93; end MA_UMLDI_UML_State_Shape_Model_Element_Uml_Diagram_Element; ------------------------------------------------------------------------------------ -- MA_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_Uml_Diagram_Element -- ------------------------------------------------------------------------------------ function MA_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_Uml_Diagram_Element return AMF.Internals.CMOF_Element is begin return Base + 94; end MA_UMLDI_UML_Stereotype_Property_Value_Label_Model_Element_Uml_Diagram_Element; ----------------------------------------------------------------------------------------------------- -- MA_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_Label_Showing_Stereotype_Value -- ----------------------------------------------------------------------------------------------------- function MA_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_Label_Showing_Stereotype_Value return AMF.Internals.CMOF_Element is begin return Base + 95; end MA_UMLDI_UML_Stereotype_Property_Value_Label_Stereotyped_Element_Label_Showing_Stereotype_Value; -------------- -- MB_UMLDI -- -------------- function MB_UMLDI return AMF.Internals.AMF_Element is begin return Base; end MB_UMLDI; -------------- -- MB_UMLDI -- -------------- function ML_UMLDI return AMF.Internals.AMF_Element is begin return Base + 319; end ML_UMLDI; end AMF.Internals.Tables.UMLDI_Metamodel;
tools-src/gnu/gcc/gcc/ada/5qparame.ads
enfoTek/tomato.linksys.e2000.nvram-mod
80
11880
<reponame>enfoTek/tomato.linksys.e2000.nvram-mod ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . P A R A M E T E R S -- -- -- -- S p e c -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-2001 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, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This is the RT-GNU/Linux version. -- Blank line intentional so that it lines up exactly with default. -- This package defines some system dependent parameters for GNAT. These -- are values that are referenced by the runtime library and are therefore -- relevant to the target machine. -- The parameters whose value is defined in the spec are not generally -- expected to be changed. If they are changed, it will be necessary to -- recompile the run-time library. -- The parameters which are defined by functions can be changed by modifying -- the body of System.Parameters in file s-parame.adb. A change to this body -- requires only rebinding and relinking of the application. -- Note: do not introduce any pragma Inline statements into this unit, since -- otherwise the relinking and rebinding capability would be deactivated. package System.Parameters is pragma Pure (Parameters); --------------------------------------- -- Task And Stack Allocation Control -- --------------------------------------- type Task_Storage_Size is new Integer; -- Type used in tasking units for task storage size type Size_Type is new Task_Storage_Size; -- Type used to provide task storage size to runtime Unspecified_Size : constant Size_Type := Size_Type'First; -- Value used to indicate that no size type is set subtype Ratio is Size_Type range -1 .. 100; Dynamic : constant Size_Type := 10; -- The secondary stack ratio is a constant between 0 and 100 which -- determines the percentage of the allocated task stack that is -- used by the secondary stack (the rest being the primary stack). -- The special value of minus one indicates that the secondary -- stack is to be allocated from the heap instead. Sec_Stack_Ratio : constant Ratio := Dynamic; -- This constant defines the handling of the secondary stack Sec_Stack_Dynamic : constant Boolean := Sec_Stack_Ratio = Dynamic; -- Convenient Boolean for testing for dynamic secondary stack function Default_Stack_Size return Size_Type; -- Default task stack size used if none is specified function Minimum_Stack_Size return Size_Type; -- Minimum task stack size permitted function Adjust_Storage_Size (Size : Size_Type) return Size_Type; -- Given the storage size stored in the TCB, return the Storage_Size -- value required by the RM for the Storage_Size attribute. The -- required adjustment is as follows: -- -- when Size = Unspecified_Size, return Default_Stack_Size -- when Size < Minimum_Stack_Size, return Minimum_Stack_Size -- otherwise return given Size Stack_Grows_Down : constant Boolean := True; -- This constant indicates whether the stack grows up (False) or -- down (True) in memory as functions are called. It is used for -- proper implementation of the stack overflow check. ---------------------------------------------- -- Characteristics of types in Interfaces.C -- ---------------------------------------------- long_bits : constant := Long_Integer'Size; -- Number of bits in type long and unsigned_long. The normal convention -- is that this is the same as type Long_Integer, but this is not true -- of all targets. For example, in OpenVMS long /= Long_Integer. ---------------------------------------------- -- Behavior of Pragma Finalize_Storage_Only -- ---------------------------------------------- -- Garbage_Collected is a Boolean constant whose value indicates the -- effect of the pragma Finalize_Storage_Entry on a controlled type. -- Garbage_Collected = False -- The system releases all storage on program termination only, -- but not other garbage collection occurs, so finalization calls -- are ommitted only for outer level onjects can be omitted if -- pragma Finalize_Storage_Only is used. -- Garbage_Collected = True -- The system provides full garbage collection, so it is never -- necessary to release storage for controlled objects for which -- a pragma Finalize_Storage_Only is used. Garbage_Collected : constant Boolean := False; -- The storage mode for this system (release on program exit) end System.Parameters;
lab5/loadknl.asm
wkcn/OSLabs
73
246738
<filename>lab5/loadknl.asm<gh_stars>10-100 ;汇编程序源代码(bootOS.asm) ;%define _BOOT_DEBUG_ ;用于生成.COM文件易于调试 %ifdef _BOOT_DEBUG_ org 100h ; 调试状态,做成 .COM 文件, 可调试 %else org 7c00h ; BIOS将把引导扇区加载到0:7C00处,并开始执行 %endif ;============================================================== %ifdef _BOOT_DEBUG_ BaseOfStack equ 100h ; 堆栈基地址(栈底, 从这个位置向低地址生长) %else BaseOfStack equ 7c00h ; 堆栈基地址(栈底, 从这个位置向低地址生长) %endif BaseOfkernal equ 0000h ; kernal.BIN 被加载到的位置 ---- 段地址 OffsetOfkernal equ 7e00h ; kernal.BIN 被加载到的位置 ---- 偏移地址 FATSegment equ 8000h ; 存放FAT的临时位置 -- 段 RootDirSectors equ 14 ; 根目录占用的扇区数 SectorNoOfRootDirectory equ 19 ; 根目录区的首扇区号 SectorNoOfFAT1 equ 1 ; FAT#1的首扇区号 = BPB_RsvdSecCnt DeltaSectorNo equ 17 ; DeltaSectorNo = BPB_RsvdSecCnt + ; (BPB_NumFATs * FATSz) - 2 = 1 + (2*9) -2 = 17 ; 文件的开始扇区号 = 目录条目中的开始扇区号 ; + 根目录占用扇区数目 + DeltaSectorNo ; 用户数据空间的第一个簇编号为002 ;============================================================== jmp short LABEL_START ; 引导开始,跳转指令 nop ; 这个 nop 不可少,无操作,占字节位 ; 下面是 FAT12 磁盘引导扇区的BPB和EBPB结构区51字节 BS_OEMName DB 'MiraiOS ' ; OEM串,必须8个字节,不足补空格 BPB_BytsPerSec DW 512 ; 每扇区字节数 BPB_SecPerClus DB 1 ; 每簇扇区数 BPB_RsvdSecCnt DW 1 ; Boot记录占用扇区数 BPB_NumFATs DB 2 ; FAT表数 BPB_RootEntCnt DW 224 ; 根目录文件数最大值 BPB_TotSec16 DW 2880 ; 逻辑扇区总数 BPB_Media DB 0F0h ; 介质描述符 BPB_FATSz16 DW 9 ; 每FAT扇区数 BPB_SecPerTrk DW 18 ; 每磁道扇区数 BPB_NumHeads DW 2 ; 磁头数(面数) BPB_HiddSec DD 0 ; 隐藏扇区数 BPB_TotSec32 DD 0 ; BPB_TotSec16为0时由此值记录扇区总数 BS_DrvNum DB 0 ; 中断 13 的驱动器号(软盘) BS_Reserved1 DB 0 ; 未使用 BS_BootSig DB 29h ; 扩展引导标记 (29h) BS_VolID DD 0 ; 卷序列号 BS_VolLab DB 'MiraiOS '; 卷标,必须11个字节,不足补空格 BS_FileSysType DB 'FAT12 ' ; 文件系统类型,必须8个字节,不足补空格 LABEL_START: mov ax, cs ; 置其他段寄存器值与CS相同 mov ds, ax ; 数据段 mov es, ax ; 附加段 mov ss, ax ; 堆栈段 mov sp, BaseOfStack ; 堆栈基址 ; 清屏 mov ax, 3h int 10h ; 显示服务BIOS调用 mov dh, 0 ; "Booting " call DispStr ; 显示字符串 ; 软驱复位 xor ah, ah ; 功能号ah=0(复位磁盘驱动器) xor dl, dl ; dl=0(软驱,硬盘和U盘为80h) int 13h ; 磁盘服务BIOS调用 ; 下面在A盘根目录中寻找 kernal.BIN mov word [wSectorNo], SectorNoOfRootDirectory ; 给表示当前扇区号的 ; 变量wSectorNo赋初值为根目录区的首扇区号(=19) LABEL_SEARCH_IN_ROOT_DIR_BEGIN: cmp word [wRootDirSizeForLoop], 0 ; 判断根目录区是否已读完 jz LABEL_NO_kernalBIN ;若读完则表示未找到kernal.BIN dec word [wRootDirSizeForLoop] ; 递减变量wRootDirSizeForLoop的值 ; 调用读扇区函数读入一个根目录扇区到装载区 mov ax, BaseOfkernal mov es, ax ; ES <- BaseOf kernal(9000h) mov bx, OffsetOfkernal; BX <- OffsetOf kernal(100h) mov ax, [wSectorNo] ; AX <- 根目录中的当前扇区号 mov cl, 1 ; 只读一个扇区 call ReadSector ; 调用读扇区函数 mov si, kernalFileName ; DS:SI -> " kernal BIN" mov di, OffsetOfkernal ; ES:DI -> BaseOfkernal :0100 cld ; 清除DF标志位 ; 置比较字符串时的方向为左/上[索引增加] mov dx, 10h ; 循环次数=16(每个扇区有16个文件条目:512/32=16) LABEL_SEARCH_FOR_kernalBIN: cmp dx, 0 ; 循环次数控制 jz LABEL_GOTO_NEXT_SECTOR_IN_ROOT_DIR ; 若已读完一扇区 dec dx ; 递减循环次数值 就跳到下一扇区 mov cx, 11 ; 初始循环次数为11 LABEL_CMP_FILENAME: cmp cx, 0 jz LABEL_FILENAME_FOUND ; 如果比较了11个字符都相等,表示找到 dec cx ; 递减循环次数值 lodsb ; DS:SI -> AL(装入字符串字节) cmp al, byte [es:di] ; 比较字符串的当前字符 jz LABEL_GO_ON jmp LABEL_DIFFERENT ; 只要发现不一样的字符就表明本DirectoryEntry ; 不是我们要找的kernal.BIN LABEL_GO_ON: inc di ; 递增DI jmp LABEL_CMP_FILENAME ; 继续循环 LABEL_DIFFERENT: and di, 0FFE0h ; DI &= E0为了让它指向本条目开头(低5位清零) ; FFE0h = 1111111111100000(低5位=32=目录条目大小) add di, 20h ; DI += 20h 下一个目录条目 mov si, kernalFileName ; SI指向装载文件名串的起始地址 jmp LABEL_SEARCH_FOR_kernalBIN; 转到循环开始处 LABEL_GOTO_NEXT_SECTOR_IN_ROOT_DIR: add word [wSectorNo], 1 ; 递增当前扇区号 jmp LABEL_SEARCH_IN_ROOT_DIR_BEGIN LABEL_NO_kernalBIN: mov dh, 2 ; "No kernal " call DispStr ; 显示字符串 %ifdef _BOOT_DEBUG_ ; 没有找到kernal.BIN就回到 DOS mov ax, 4c00h ; AH=4Ch(功能号,终止进程)、AL=0(返回代码) int 21h ; DOS软中断 %else jmp $ ; 没有找到 kernal.BIN,在这里进入死循环 %endif LABEL_FILENAME_FOUND: ; 找到 kernal.BIN 后便来到这里继续 ; 计算文件的起始扇区号 mov ax, RootDirSectors ; AX=根目录占用的扇区数 and di, 0FFE0h ; DI -> 当前条目的开始地址 add di, 1Ah ; DI -> 文件的首扇区号在条目中的偏移地址 mov cx, word [es:di] ; CX=文件的首扇区号 push cx ; 保存此扇区在FAT中的序号 add cx, ax ; CX=文件的相对起始扇区号+根目录占用的扇区数 add cx, DeltaSectorNo ; CL <- LOADER.BIN的起始扇区号(0-based) mov ax, BaseOfkernal mov es, ax ; ES <- BaseOf kernal(装载程序基址=9000h) mov bx, OffsetOfkernal; BX <- OffsetOf kernal(装载程序偏移地址=100h) mov ax, cx ; AX <- 起始扇区号 LABEL_GOON_LOADING_FILE: push bx ; 保存装载程序偏移地址 mov cl, 1 ; 1个扇区 call ReadSector ; 读扇区 ; 每读一个扇区就在 "Booting " 后面打一个点, 形成这样的效果:Booting ...... mov ah, 0Eh ; 功能号(以电传方式显示单个字符) mov al, '.' ; 要显示的字符 mov bl, 0Fh ; 黑底白字 int 10h ; 显示服务BIOS调用 ; 计算文件的下一扇区号 pop bx ; 取出装载程序偏移地址 pop ax ; 取出此扇区在FAT中的序号 call GetFATEntry ; 获取FAT项中的下一簇号 cmp ax, 0FF8h ; 是否是文件最后簇 jae LABEL_FILE_LOADED ; ≥FF8h时跳转,否则读下一个簇 push ax ; 保存扇区在FAT中的序号 mov dx, RootDirSectors ; DX = 根目录扇区数 = 14 add ax, dx ; 扇区序号 + 根目录扇区数 add ax, DeltaSectorNo ; AX = 要读的数据扇区地址 add bx, [BPB_BytsPerSec] ; BX+512指向装载程序区的下一个扇区地址 jmp LABEL_GOON_LOADING_FILE LABEL_FILE_LOADED: mov dh, 1 ; "Ready." call DispStr ; 显示字符串 ; ********************************************************************** jmp BaseOfkernal:OffsetOfkernal ; 这一句正式跳转到已加载到内 ; 存中的 kernal.BIN 的开始处, ; 开始执行 kernal.BIN 的代码。 ; Boot Sector 的使命到此结束 ; ********************************************************************** ;============================================================== ;变量 wRootDirSizeForLoop dw RootDirSectors ; 根目录区剩余扇区数 ; 初始化为14,在循环中会递减至零 wSectorNo dw 0 ; 当前扇区号,初始化为0,在循环中会递增 bOdd db 0 ; 奇数还是偶数FAT项 ;字符串 kernalFileName db "KERNEL BIN", 0 ; kernal.BIN之文件名 ; 为简化代码,下面每个字符串的长度均为MessageLength(=9),似串数组 MessageLength equ 9 BootMessage: db "Booting " ; 9字节,不够则用空格补齐。序号0 Message1 db "Ready. " ; 9字节,不够则用空格补齐。序号1 Message2 db "No kernal" ; 9字节,不够则用空格补齐。序号2 ;============================================================== ;---------------------------------------------------------------------------- ; 函数名:DispStr ;---------------------------------------------------------------------------- ; 作用:显示一个字符串,函数开始时DH中须为串序号(0-based) DispStr: mov ax, MessageLength ; 串长->AX(即AL=9) mul dh ; AL*DH(串序号)->AX(=当前串的相对地址) add ax, BootMessage ; AX+串数组的起始地址 mov bp, ax ; BP=当前串的偏移地址 mov ax, ds ; ES:BP = 串地址 mov es, ax ; 置ES=DS mov cx, MessageLength ; CX = 串长(=9) mov ax, 1301h ; AH = 13h(功能号)、AL = 01h(光标置于串尾) mov bx, 0007h ; 页号为0(BH = 0) 黑底白字(BL = 07h) mov dl, 0 ; 列号=0 int 10h ; 显示服务BIOS调用 ret ; 函数返回 ;---------------------------------------------------------------------------- ;---------------------------------------------------------------------------- ; 函数名:ReadSector ;---------------------------------------------------------------------------- ; 作用:从第 AX个扇区开始,将CL个扇区读入ES:BX中 ReadSector: ; ----------------------------------------------------------------------- ; 怎样由扇区号求扇区在磁盘中的位置 (扇区号->柱面号、起始扇区、磁头号) ; ----------------------------------------------------------------------- ; 设扇区号为 x ; ┌ 柱面号 = y >> 1 ; x ┌ 商 y ┤ ; -------------- => ┤ └ 磁头号 = y & 1 ; 每磁道扇区数 │ ; └ 余 z => 起始扇区号 = z + 1 push bp ; 保存BP mov bp, sp ; 让BP=SP sub sp, 2 ; 辟出两个字节的堆栈区域保存要读的扇区数: byte [bp-2] mov byte [bp-2], cl ; 压CL入栈(保存表示读入扇区数的传递参数) push bx ; 保存BX mov bl, [BPB_SecPerTrk] ; BL=18(磁道扇区数)为除数 div bl ; AX/BL,商y在AL中、余数z在AH中 inc ah ; z ++(因磁盘的起始扇区号为1) mov cl, ah ; CL <- 起始扇区号 mov dh, al ; DH <- y shr al, 1 ; y >> 1 (等价于y/BPB_NumHeads,软盘有2个磁头) mov ch, al ; CH <- 柱面号 and dh, 1 ; DH & 1 = 磁头号 pop bx ; 恢复BX ; 至此,"柱面号、起始扇区、磁头号"已全部得到 mov dl, [BS_DrvNum] ; 驱动器号(0表示软盘A) .GoOnReading: ; 使用磁盘中断读入扇区 mov ah, 2 ; 功能号(读扇区) mov al, byte [bp-2] ; 读AL个扇区 int 13h ; 磁盘服务BIOS调用 jc .GoOnReading ; 如果读取错误,CF会被置为1, ; 这时就不停地读,直到正确为止 add sp, 2 ; 栈指针+2 pop bp ; 恢复BP ret ;---------------------------------------------------------------------------- ;---------------------------------------------------------------------------- ; 函数名:GetFATEntry ;---------------------------------------------------------------------------- ; 作用:找到序号为AX的扇区在FAT中的条目,结果放在AX中。需要注意的 ; 是,中间需要读FAT的扇区到ES:BX处,所以函数一开始保存了ES和BX GetFATEntry: push es ; 保存ES、BX和AX(入栈) push bx push ax ; 设置读入的FAT扇区写入的基地址 ;mov ax,BaseOfkernal ;BaseOfKernal=9000h ;sub ax, 1000h ; 在BaseOfKernal后面留出4K空间用于存放FAT mov ax, FATSegment mov es, ax ; ES=8000h ; 判断FAT项的奇偶 pop ax ; 取出FAT项序号(出栈) mov byte [bOdd], 0; 初始化奇偶变量值为0(偶) mov bx, 3 ; AX*1.5 = (AX*3)/2 mul bx ; DX:AX = AX * 3(AX*BX 的结果值放入DX:AX中) mov bx, 2 ; BX = 2(除数) xor dx, dx ; DX=0 div bx ; DX:AX / 2 => AX <- 商、DX <- 余数 cmp dx, 0 ; 余数 = 0(偶数)? jz LABEL_EVEN ; 偶数跳转 mov byte [bOdd], 1 ; 奇数 LABEL_EVEN: ; 偶数 ; 现在AX中是FAT项在FAT中的偏移量,下面来 ; 计算FAT项在哪个扇区中(FAT占用不止一个扇区) xor dx, dx ; DX=0 mov bx, [BPB_BytsPerSec] ; BX=512 div bx ; DX:AX / 512 ; AX <- 商 (FAT项所在的扇区相对于FAT的扇区号) ; DX <- 余数 (FAT项在扇区内的偏移) push dx ; 保存余数(入栈) mov bx, 0 ; BX <- 0 于是,ES:BX = 8000h:0 add ax, SectorNoOfFAT1 ; 此句之后的AX就是FAT项所在的扇区号 mov cl, 2 ; 读取FAT项所在的扇区,一次读两个,避免在边界 call ReadSector ; 发生错误, 因为一个 FAT项可能跨越两个扇区 pop dx ; DX= FAT项在扇区内的偏移(出栈) add bx, dx ; BX= FAT项在扇区内的偏移 mov ax, [es:bx] ; AX= FAT项值 cmp byte [bOdd], 1 ; 是否为奇数项? jnz LABEL_EVEN_2 ; 偶数跳转 shr ax, 4 ; 奇数:右移4位(取高12位) LABEL_EVEN_2: ; 偶数 and ax, 0FFFh ; 取低12位 LABEL_GET_FAT_ENRY_OK: pop bx ; 恢复ES、BX(出栈) pop es ret ;---------------------------------------------------------------------------- times 510-($-$$) db 0 ; 用0填充引导扇区剩下的空间 db 55h, 0aah ; 引导扇区结束标志
libsrc/_DEVELOPMENT/adt/bv_priority_queue/z80/asm_bv_priority_queue_push.asm
meesokim/z88dk
0
28005
; =============================================================== ; Mar 2014 ; =============================================================== ; ; int bv_priority_queue_push(bv_priority_queue_t *q, int c) ; ; Push item into the priority queue. ; ; =============================================================== SECTION code_adt_bv_priority_queue PUBLIC asm_bv_priority_queue_push EXTERN asm_b_vector_append, asm0_ba_priority_queue_push, error_mc asm_bv_priority_queue_push: ; enter : hl = priority_queue * ; bc = int c ; ; exit : success ; ; hl = 0 ; carry reset ; ; fail if max_size exceeded ; ; hl = -1 ; carry set ; ; fail if insufficient memory or lock not acquired ; ; hl = -1 ; carry set ; ; uses : af, bc, de, hl, ix push hl ; save queue * inc hl inc hl ; hl = & queue.b_vector call asm_b_vector_append ; append char jp nc, asm0_ba_priority_queue_push jp error_mc - 1 ; if vector could not be grown
linear_algebra/banded_lu.adb
jscparker/math_packages
30
25061
--------------------------------------------------------------------------------- -- package body Banded_LU, LU decomposition, equation solving for banded matrices -- Copyright (C) 1995-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. --------------------------------------------------------------------------------- with Text_IO; package body Banded_LU is ------------- -- Product -- ------------- -- Matrix Vector multiplication function Product (A : in Banded_Matrix; X : in Column; Final_Index : in Index := Index'Last; Starting_Index : in Index := Index'First) return Column is Result : Column := (others => Zero); Sum : Real; Col_First, Col_Last : Integer; begin for Row in Starting_Index .. Final_Index loop Sum := Zero; Col_First := Integer'Max (Row - No_Of_Off_Diagonals, Starting_Index); Col_Last := Integer'Min (Row + No_Of_Off_Diagonals, Final_Index); for Col in Col_First .. Col_Last loop Sum := Sum + A (Row)(Col - Row) * X (Col); end loop; Result(Row) := Sum; end loop; return Result; end Product; --------------------- -- Refine_Solution -- --------------------- -- if No_Of_Iterations=0 then usual solution is returned. -- if No_Of_Iterations=1 then solution is refined iteratively once. -- -- Not necessarily much use if error is due to ill-conditioning of Matrix A. -- -- Iterative refinement of the solution returned by LU_decompose() and -- Solve(). Uses the Newton-like iteration for the solution of A*X = b, -- -- X_{k+1} = X_k + A_Inverse_Approximate * (b - A*X_k). -- -- Here A_Inverse_Approximate (we will call it V below) represents the -- solution returned by LU_decompose() followed by Solve(). -- -- if y = exact error in 1st iteration: y = X_inf - X_1, then y is the -- exact solution of A*y = d_1 where d_1 = b - A*X_1. -- Let V denote approximate inverse of A. Iterate for y using -- -- Delta_Y_{k+1} == Y_{k+1} - Y_k = V*(d_1 - A*Y_k). -- -- Remember Y = exact error in 1st iteration = SUM (Delta_Y_k's). -- Here's the actual method: -- -- Let d_1 = b - A*X_1 (the standard Residual: 1st estimate of error in A*X = b) -- Delta_Y_1 = V*d_1 -- Let d_2 = d_1 - A*Delta_Y_1 -- Delta_Y_2 = V*(d_1 - A*Delta_Y_1) = V*d_2 -- Let d_3 = d_2 - A*Delta_Y_2 -- Delta_Y_3 = V*(d_1 - A*Delta_Y_1 - A*Delta_Y_2) = V*d_3 -- -- so: d_k = d_{k-1} - A*Delta_Y_{k-1}; Delta_Y_k = V*d_k -- -- Sum the Delta_Y_k's to get the correction to X_1: Y = SUM (Delta_Y_k's). -- procedure Refine_Solution (X : out Column; B : in Column; A_LU : in Banded_Matrix; Diag_Inverse : in Column; A : in Banded_Matrix; No_Of_Iterations : in Natural := 1; Final_Index : in Index := Index'Last; Starting_Index : in Index := Index'First) is Delta_Y, X_1, A_Y : Column := (others => 0.0); D_k : Column := (others => 0.0); Y_f : Column := (others => 0.0); begin -- Get X_1 as defined above. Solve (X_1, B, A_LU, Diag_Inverse, Final_Index, Starting_Index); if No_Of_Iterations > 0 then A_Y := Product(A, X_1, Final_Index, Starting_Index); -- D_1: for I in Starting_Index .. Final_Index loop D_k(I) := B(I) - A_Y(I); end loop; Solve (Delta_Y, D_k, A_LU, Diag_Inverse, Final_Index, Starting_Index); -- Y_f is Sum of all the iterated Delta_Y's. Initialize it: Y_f := Delta_Y; for Iteration in 1..No_Of_Iterations-1 loop -- get d_k = d_k - A*Delta_Y_k A_Y := Product (A, Delta_Y, Final_Index, Starting_Index); for I in Starting_Index .. Final_Index loop D_k(I) := D_k(I) - A_Y(I); end loop; -- get Delta_Y = V*D_k: Solve (Delta_Y, D_k, A_LU, Diag_Inverse, Final_Index, Starting_Index); -- Accumulate Y_f: the full correction to X_1: for I in Starting_Index .. Final_Index loop Y_f(I) := Y_f(I) + Delta_Y(I); end loop; end loop; end if; for I in Starting_Index..Final_Index loop X(I) := Y_f(I) + X_1(I); end loop; end Refine_Solution; ---------------- -- Matrix_Val -- ---------------- -- Translates (Row, Col) to (I, Diagonal_id) using -- the formula I = Row, and Diagonal_id = Col - Row. -- -- Banded Matrices are by definition 0 everywhere except on the -- diagonal bands. So 0 is returned if (Row, Col) is not in the -- banded region. function Matrix_Val (A : Banded_Matrix; Row : Index; Col : Index) return Real is Diag_ID : constant Integer := (Col - Row); Result : Real; begin if Abs Diag_ID > No_Of_Off_Diagonals then Result := 0.0; else Result := A(Row)(Diag_ID); end if; return Result; end; ------------------ -- LU_Decompose -- ------------------ -- Translates from (Row, Col) indices to (I, Diagonal) -- with the formula I = Row, and Diagonal = Col - Row. procedure LU_Decompose (A : in out Banded_Matrix; Diag_Inverse : out Column; Final_Index : in Index := Index'Last; Starting_Index : in Index := Index'First) is Stage : Index; Sum : Real; Col_First, Row_Last : Integer; Min_Allowed_Pivot_Ratio, Min_Allowed_Pivot_Val : Real; Reciprocal_Pivot_Val, Pivot_Val, Abs_Pivot_Val : Real; Max_Pivot_Val : Real := Min_Allowed_Real; Min_Pivot_Ratio : constant Real := 2.0**(-Real'Machine_Mantissa) * 1.0E-3; begin Diag_Inverse := (Others => 0.0); if Final_Index - Starting_Index + 1 < No_Of_Off_Diagonals + 1 then text_io.put ("Matrix Size must be >= No_Of_Off_Diagonals+1."); raise Constraint_Error; end if; Min_Allowed_Pivot_Ratio := Min_Pivot_Ratio; -- Step 0. 1 X 1 matrices: They can't exist because of above. -- Step 1. The outer loop. -- At each stage we calculate row "stage" of the Upper matrix U -- and Column "Stage" of the Lower matrix L. -- The matrix A is overwritten with these, because the elements -- of A in those places are never needed in future stages. -- However, the elements of L ARE needed in those places, -- so to get those elements we will be accessing A (which stores them). for Stage in Starting_Index..Final_Index-1 loop Row_Last := Integer'Min (Stage + No_Of_Off_Diagonals, Final_Index); if Stage > Starting_Index then for J in Stage .. Row_Last loop Sum := 0.0; --for K in Starting_Index .. Stage-1 loop -- --Sum := Sum + L(J)(K)*U(K)(Stage); -- Sum := Sum + A(J)(K)*A(K)(Stage); --end loop; Col_First := Integer'Max (J - No_Of_Off_Diagonals, Starting_Index); for K in Col_First..Stage-1 loop Sum := Sum + A(J)(K-J)*A(K)(Stage-K); end loop; --L(J)(Stage) := L(J)(Stage) - Sum; --L(J)(Stage-J) := L(J)(Stage-J) - Sum; A(J)(Stage-J) := A(J)(Stage-J) - Sum; end loop; end if; -- Step 2: Get row "stage" of U and -- column "stage" of L. Notice these formulas update -- only (Stage+1..Last) elements of the respective row -- and column, and depend on only (1..Stage) elements -- of U and L, which were calculated previously, and stored in A. Pivot_Val := A(Stage)(0); Abs_Pivot_Val := Abs (Pivot_Val); if Abs_Pivot_Val > Max_Pivot_Val then Max_Pivot_Val := Abs_Pivot_Val; end if; Min_Allowed_Pivot_Val := Max_Pivot_Val*Min_Allowed_Pivot_Ratio + Min_Allowed_Real; if (Abs_Pivot_Val < Min_Allowed_Pivot_Val) then Min_Allowed_Pivot_Val := Real'Copy_Sign (Min_Allowed_Pivot_Val, Pivot_Val); Reciprocal_Pivot_Val := 1.0 / Min_Allowed_Pivot_Val; else Reciprocal_Pivot_Val := 1.0 / Pivot_Val; end if; if (Abs_Pivot_Val < Min_Allowed_Real) then Reciprocal_Pivot_Val := 0.0; end if; Diag_Inverse(Stage) := Reciprocal_Pivot_Val; for J in Stage+1..Row_Last loop Sum := 0.0; if Stage > Starting_Index then --for K in Starting_Index .. Stage-1 loop -- --Sum := Sum + L(Stage)(K)*U(K)(J); -- Sum := Sum + A(Stage)(K)*A(K)(J); --end loop; Col_First := Integer'Max (Starting_Index, J - No_Of_Off_Diagonals); for K in Col_First..Stage-1 loop Sum := Sum + A(Stage)(K-Stage) * A(K)(J-K); end loop; end if; --U(Stage)(J) := (A(Stage)(J) - Sum) * Scale_Factor; A(Stage)(J-Stage) := (A(Stage)(J-Stage) - Sum) * Reciprocal_Pivot_Val; end loop; end loop; -- Step 3: Get final row and column. Stage := Final_Index; Sum := 0.0; --for K in Starting_Index .. Stage-1 loop -- --Sum := Sum + L(Stage)(K)*U(K)(Stage); -- Sum := Sum + A(Stage)(K)*A(K)(Stage); --end loop; Col_First := Integer'Max(Starting_Index, Integer(Stage)-No_Of_Off_Diagonals); for K in Col_First..Stage-1 loop Sum := Sum + A(Stage)(K-Stage)*A(K)(Stage-K); end loop; A(Stage)(0) := A(Stage)(0) - Sum; Pivot_Val := A(Stage)(0); Abs_Pivot_Val := Abs (Pivot_Val); if Abs_Pivot_Val > Max_Pivot_Val then Max_Pivot_Val := Abs_Pivot_Val; end if; Min_Allowed_Pivot_Val := Max_Pivot_Val*Min_Allowed_Pivot_Ratio + Min_Allowed_Real; if Abs_Pivot_Val < Min_Allowed_Pivot_Val then Min_Allowed_Pivot_Val := Real'Copy_Sign (Min_Allowed_Pivot_Val, Pivot_Val); Reciprocal_Pivot_Val := 1.0 / Min_Allowed_Pivot_Val; else Reciprocal_Pivot_Val := 1.0 / Pivot_Val; end if; if Abs_Pivot_Val < Min_Allowed_Real then Reciprocal_Pivot_Val := 0.0; end if; Diag_Inverse(Stage) := Reciprocal_Pivot_Val; end LU_Decompose; ----------- -- Solve -- ----------- procedure Solve (X : out Column; B : in Column; A_LU : in Banded_Matrix; Diag_Inverse : in Column; Final_Index : in Index := Index'Last; Starting_Index : in Index := Index'First) is Z : Column; ID_of_1st_non_0 : Index := Starting_Index; Sum : Real; Col_First : Index; Col_Last : Index; begin for Row in Index loop X(Row) := 0.0; end loop; -- An optimization to make matrix inversion efficient. -- in Banded_Matrix inversion, the input vector B is -- is a unit vector: it is all zeros except for a 1.0. Need to -- to find 1st non-zero element of B: for I in Starting_Index..Final_Index loop if Abs (B(I)) > 0.0 then ID_of_1st_non_0 := I; exit; end if; end loop; -- In solving for Z in the equation L Z = B, the Z's will -- all be zero up to the 1st non-zero element of B. if ID_of_1st_non_0 > Index'First then for I in Starting_Index..ID_of_1st_non_0-1 loop Z(I) := 0.0; end loop; end if; -- The matrix equation is in the form L * U * X = B. -- First assume U * X is Z, and -- solve for Z in the equation L Z = B. Z(ID_of_1st_non_0) := B(ID_of_1st_non_0) * Diag_Inverse(ID_of_1st_non_0); if ID_of_1st_non_0 < Final_Index then for Row in ID_of_1st_non_0+1..Final_Index loop Sum := 0.0; Col_First := Integer'Max (Starting_Index, Row - No_Of_Off_Diagonals); for Col in Col_First .. Row-1 loop Sum := Sum + A_LU(Row)(Col-Row) * Z(Col); end loop; Z(Row) := (B(Row) - Sum) * Diag_Inverse(Row); end loop; end if; -- Solve for X in the equation U X = Z. X(Final_Index) := Z(Final_Index); if Final_Index > Starting_Index then for Row in reverse Starting_Index..Final_Index-1 loop Sum := 0.0; Col_Last := Integer'Min (Final_Index, Row + No_Of_Off_Diagonals); for Col in Row+1 .. Col_Last loop Sum := Sum + A_LU(Row)(Col-Row) * X(Col); end loop; X(Row) := (Z(Row) - Sum); end loop; end if; end Solve; end Banded_LU;
source/strings/a-secain.ads
ytomino/drake
33
19783
pragma License (Unrestricted); -- Ada 2012 with Ada.Characters.Conversions; with Ada.Strings.Generic_Equal_Case_Insensitive; function Ada.Strings.Equal_Case_Insensitive is new Generic_Equal_Case_Insensitive ( Character, String, Characters.Conversions.Get); -- pragma Pure (Ada.Strings.Equal_Case_Insensitive); pragma Preelaborate (Ada.Strings.Equal_Case_Insensitive); -- use maps
src/ini-section_vector.ads
SSOCsoft/Log_Reporter
0
17891
<gh_stars>0 With NSO.Types; -- Section_Vector returns the names of the sections; empty-name excluded. Function INI.Section_Vector( Object : in Instance ) return NSO.Types.String_Vector.Vector;
oeis/021/A021838.asm
neoneye/loda-programs
11
247482
; A021838: Decimal expansion of 1/834. ; Submitted by Jon Maiga ; 0,0,1,1,9,9,0,4,0,7,6,7,3,8,6,0,9,1,1,2,7,0,9,8,3,2,1,3,4,2,9,2,5,6,5,9,4,7,2,4,2,2,0,6,2,3,5,0,1,1,9,9,0,4,0,7,6,7,3,8,6,0,9,1,1,2,7,0,9,8,3,2,1,3,4,2,9,2,5,6,5,9,4,7,2,4,2,2,0,6,2,3,5,0,1,1,9,9,0 seq $0,199685 ; a(n) = 5*10^n+1. div $0,417 mod $0,10
bb-runtimes/src/a-intnam__x86_64.ads
JCGobbi/Nucleo-STM32G474RE
0
8411
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- A D A . I N T E R R U P T S . N A M E S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- 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/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This package version is specific to the x86-64 pragma Restrictions (No_Elaboration_Code); package Ada.Interrupts.Names is -- All identifiers in this unit are implementation defined pragma Implementation_Defined; -- On x86-64 the interrupt vector number encodes the priority of the -- interrupt. There are 16 interrupt priority classes, each containing 16 -- interrupt vectors. The interrupt priority of the protected object -- containing the protected handler must match the priority class of the -- interrupt. -- Note: Interrupt vectors used for the runtime are commented and marked as -- such. -- Note: Interrupt Priorties 240 and 242 are missing as they map to -- CPU exception vectors. IRQ_32_47_Interrupt_Priority : constant System.Interrupt_Priority := 242; -- IRQ_32 -> Runtime: Spurious interrupt IRQ_33 : constant Interrupt_ID := 33; IRQ_34 : constant Interrupt_ID := 34; IRQ_35 : constant Interrupt_ID := 35; IRQ_36 : constant Interrupt_ID := 36; IRQ_37 : constant Interrupt_ID := 37; IRQ_38 : constant Interrupt_ID := 38; IRQ_39 : constant Interrupt_ID := 39; IRQ_40 : constant Interrupt_ID := 40; IRQ_41 : constant Interrupt_ID := 41; IRQ_42 : constant Interrupt_ID := 42; IRQ_43 : constant Interrupt_ID := 43; IRQ_44 : constant Interrupt_ID := 44; IRQ_45 : constant Interrupt_ID := 45; IRQ_46 : constant Interrupt_ID := 46; IRQ_47 : constant Interrupt_ID := 47; IRQ_48_63_Interrupt_Priority : constant System.Interrupt_Priority := 243; IRQ_48 : constant Interrupt_ID := 48; IRQ_49 : constant Interrupt_ID := 49; IRQ_50 : constant Interrupt_ID := 50; IRQ_51 : constant Interrupt_ID := 51; IRQ_52 : constant Interrupt_ID := 52; IRQ_53 : constant Interrupt_ID := 53; IRQ_54 : constant Interrupt_ID := 54; IRQ_55 : constant Interrupt_ID := 55; IRQ_56 : constant Interrupt_ID := 56; IRQ_57 : constant Interrupt_ID := 57; IRQ_58 : constant Interrupt_ID := 58; IRQ_59 : constant Interrupt_ID := 59; IRQ_60 : constant Interrupt_ID := 60; IRQ_61 : constant Interrupt_ID := 61; IRQ_62 : constant Interrupt_ID := 62; IRQ_63 : constant Interrupt_ID := 63; IRQ_64_79_Interrupt_Priority : constant System.Interrupt_Priority := 244; IRQ_64 : constant Interrupt_ID := 64; IRQ_65 : constant Interrupt_ID := 65; IRQ_66 : constant Interrupt_ID := 66; IRQ_67 : constant Interrupt_ID := 67; IRQ_68 : constant Interrupt_ID := 68; IRQ_69 : constant Interrupt_ID := 69; IRQ_70 : constant Interrupt_ID := 70; IRQ_71 : constant Interrupt_ID := 71; IRQ_72 : constant Interrupt_ID := 72; IRQ_73 : constant Interrupt_ID := 73; IRQ_74 : constant Interrupt_ID := 74; IRQ_75 : constant Interrupt_ID := 75; IRQ_76 : constant Interrupt_ID := 76; IRQ_77 : constant Interrupt_ID := 77; IRQ_78 : constant Interrupt_ID := 78; IRQ_79 : constant Interrupt_ID := 79; IRQ_80_95_Interrupt_Priority : constant System.Interrupt_Priority := 245; IRQ_80 : constant Interrupt_ID := 80; IRQ_81 : constant Interrupt_ID := 81; IRQ_82 : constant Interrupt_ID := 82; IRQ_83 : constant Interrupt_ID := 83; IRQ_84 : constant Interrupt_ID := 84; IRQ_85 : constant Interrupt_ID := 85; IRQ_86 : constant Interrupt_ID := 86; IRQ_87 : constant Interrupt_ID := 87; IRQ_88 : constant Interrupt_ID := 88; IRQ_89 : constant Interrupt_ID := 89; IRQ_90 : constant Interrupt_ID := 90; IRQ_91 : constant Interrupt_ID := 91; IRQ_92 : constant Interrupt_ID := 92; IRQ_93 : constant Interrupt_ID := 93; IRQ_94 : constant Interrupt_ID := 94; IRQ_95 : constant Interrupt_ID := 95; IRQ_96_111_Interrupt_Priority : constant System.Interrupt_Priority := 246; IRQ_96 : constant Interrupt_ID := 96; IRQ_97 : constant Interrupt_ID := 97; IRQ_98 : constant Interrupt_ID := 98; IRQ_99 : constant Interrupt_ID := 99; IRQ_100 : constant Interrupt_ID := 100; IRQ_101 : constant Interrupt_ID := 101; IRQ_102 : constant Interrupt_ID := 102; IRQ_103 : constant Interrupt_ID := 103; IRQ_104 : constant Interrupt_ID := 104; IRQ_105 : constant Interrupt_ID := 105; IRQ_106 : constant Interrupt_ID := 106; IRQ_107 : constant Interrupt_ID := 107; IRQ_108 : constant Interrupt_ID := 108; IRQ_109 : constant Interrupt_ID := 109; IRQ_110 : constant Interrupt_ID := 110; IRQ_111 : constant Interrupt_ID := 111; IRQ_112_127_Interrupt_Priority : constant System.Interrupt_Priority := 247; IRQ_112 : constant Interrupt_ID := 112; IRQ_113 : constant Interrupt_ID := 113; IRQ_114 : constant Interrupt_ID := 114; IRQ_115 : constant Interrupt_ID := 115; IRQ_116 : constant Interrupt_ID := 116; IRQ_117 : constant Interrupt_ID := 117; IRQ_118 : constant Interrupt_ID := 118; IRQ_119 : constant Interrupt_ID := 119; IRQ_120 : constant Interrupt_ID := 120; IRQ_121 : constant Interrupt_ID := 121; IRQ_122 : constant Interrupt_ID := 122; IRQ_123 : constant Interrupt_ID := 123; IRQ_124 : constant Interrupt_ID := 124; IRQ_125 : constant Interrupt_ID := 125; IRQ_126 : constant Interrupt_ID := 126; IRQ_127 : constant Interrupt_ID := 127; IRQ_128_143_Interrupt_Priority : constant System.Interrupt_Priority := 248; IRQ_128 : constant Interrupt_ID := 128; IRQ_129 : constant Interrupt_ID := 129; IRQ_130 : constant Interrupt_ID := 130; IRQ_131 : constant Interrupt_ID := 131; IRQ_132 : constant Interrupt_ID := 132; IRQ_133 : constant Interrupt_ID := 133; IRQ_134 : constant Interrupt_ID := 134; IRQ_135 : constant Interrupt_ID := 135; IRQ_136 : constant Interrupt_ID := 136; IRQ_137 : constant Interrupt_ID := 137; IRQ_138 : constant Interrupt_ID := 138; IRQ_139 : constant Interrupt_ID := 139; IRQ_140 : constant Interrupt_ID := 140; IRQ_141 : constant Interrupt_ID := 141; IRQ_142 : constant Interrupt_ID := 142; IRQ_143 : constant Interrupt_ID := 143; IRQ_144_159_Interrupt_Priority : constant System.Interrupt_Priority := 249; IRQ_144 : constant Interrupt_ID := 144; IRQ_145 : constant Interrupt_ID := 145; IRQ_146 : constant Interrupt_ID := 146; IRQ_147 : constant Interrupt_ID := 147; IRQ_148 : constant Interrupt_ID := 148; IRQ_149 : constant Interrupt_ID := 149; IRQ_150 : constant Interrupt_ID := 150; IRQ_151 : constant Interrupt_ID := 151; IRQ_152 : constant Interrupt_ID := 152; IRQ_153 : constant Interrupt_ID := 153; IRQ_154 : constant Interrupt_ID := 154; IRQ_155 : constant Interrupt_ID := 155; IRQ_156 : constant Interrupt_ID := 156; IRQ_157 : constant Interrupt_ID := 157; IRQ_158 : constant Interrupt_ID := 158; IRQ_159 : constant Interrupt_ID := 159; IRQ_160_175_Interrupt_Priority : constant System.Interrupt_Priority := 250; IRQ_160 : constant Interrupt_ID := 160; IRQ_161 : constant Interrupt_ID := 161; IRQ_162 : constant Interrupt_ID := 162; IRQ_163 : constant Interrupt_ID := 163; IRQ_164 : constant Interrupt_ID := 164; IRQ_165 : constant Interrupt_ID := 165; IRQ_166 : constant Interrupt_ID := 166; IRQ_167 : constant Interrupt_ID := 167; IRQ_168 : constant Interrupt_ID := 168; IRQ_169 : constant Interrupt_ID := 169; IRQ_170 : constant Interrupt_ID := 170; IRQ_171 : constant Interrupt_ID := 171; IRQ_172 : constant Interrupt_ID := 172; IRQ_173 : constant Interrupt_ID := 173; IRQ_174 : constant Interrupt_ID := 174; IRQ_175 : constant Interrupt_ID := 175; IRQ_176_191_Interrupt_Priority : constant System.Interrupt_Priority := 251; IRQ_176 : constant Interrupt_ID := 176; IRQ_177 : constant Interrupt_ID := 177; IRQ_178 : constant Interrupt_ID := 178; IRQ_179 : constant Interrupt_ID := 179; IRQ_180 : constant Interrupt_ID := 180; IRQ_181 : constant Interrupt_ID := 181; IRQ_182 : constant Interrupt_ID := 182; IRQ_183 : constant Interrupt_ID := 183; IRQ_184 : constant Interrupt_ID := 184; IRQ_185 : constant Interrupt_ID := 185; IRQ_186 : constant Interrupt_ID := 186; IRQ_187 : constant Interrupt_ID := 187; IRQ_188 : constant Interrupt_ID := 188; IRQ_189 : constant Interrupt_ID := 189; IRQ_190 : constant Interrupt_ID := 190; IRQ_191 : constant Interrupt_ID := 191; IRQ_192_207_Interrupt_Priority : constant System.Interrupt_Priority := 252; IRQ_192 : constant Interrupt_ID := 192; IRQ_193 : constant Interrupt_ID := 193; IRQ_194 : constant Interrupt_ID := 194; IRQ_195 : constant Interrupt_ID := 195; IRQ_196 : constant Interrupt_ID := 196; IRQ_197 : constant Interrupt_ID := 197; IRQ_198 : constant Interrupt_ID := 198; IRQ_199 : constant Interrupt_ID := 199; IRQ_200 : constant Interrupt_ID := 200; IRQ_201 : constant Interrupt_ID := 201; IRQ_202 : constant Interrupt_ID := 202; IRQ_203 : constant Interrupt_ID := 203; IRQ_204 : constant Interrupt_ID := 204; IRQ_205 : constant Interrupt_ID := 205; IRQ_206 : constant Interrupt_ID := 206; IRQ_207 : constant Interrupt_ID := 207; IRQ_208_223_Interrupt_Priority : constant System.Interrupt_Priority := 253; IRQ_208 : constant Interrupt_ID := 208; IRQ_209 : constant Interrupt_ID := 209; IRQ_210 : constant Interrupt_ID := 210; IRQ_211 : constant Interrupt_ID := 211; IRQ_212 : constant Interrupt_ID := 212; IRQ_213 : constant Interrupt_ID := 213; IRQ_214 : constant Interrupt_ID := 214; IRQ_215 : constant Interrupt_ID := 215; IRQ_216 : constant Interrupt_ID := 216; IRQ_217 : constant Interrupt_ID := 217; IRQ_218 : constant Interrupt_ID := 218; IRQ_219 : constant Interrupt_ID := 219; IRQ_220 : constant Interrupt_ID := 220; IRQ_221 : constant Interrupt_ID := 221; IRQ_222 : constant Interrupt_ID := 222; IRQ_223 : constant Interrupt_ID := 223; IRQ_224_239_Interrupt_Priority : constant System.Interrupt_Priority := 254; IRQ_224 : constant Interrupt_ID := 224; IRQ_225 : constant Interrupt_ID := 225; IRQ_226 : constant Interrupt_ID := 226; IRQ_227 : constant Interrupt_ID := 227; IRQ_228 : constant Interrupt_ID := 228; IRQ_229 : constant Interrupt_ID := 229; IRQ_230 : constant Interrupt_ID := 230; IRQ_231 : constant Interrupt_ID := 231; IRQ_232 : constant Interrupt_ID := 232; IRQ_233 : constant Interrupt_ID := 233; IRQ_234 : constant Interrupt_ID := 234; IRQ_235 : constant Interrupt_ID := 235; IRQ_236 : constant Interrupt_ID := 236; IRQ_237 : constant Interrupt_ID := 237; IRQ_238 : constant Interrupt_ID := 238; IRQ_239 : constant Interrupt_ID := 239; IRQ_240_255_Interrupt_Priority : constant System.Interrupt_Priority := 255; IRQ_240 : constant Interrupt_ID := 240; IRQ_241 : constant Interrupt_ID := 241; IRQ_242 : constant Interrupt_ID := 242; IRQ_243 : constant Interrupt_ID := 243; IRQ_244 : constant Interrupt_ID := 244; IRQ_245 : constant Interrupt_ID := 245; IRQ_246 : constant Interrupt_ID := 246; IRQ_247 : constant Interrupt_ID := 247; IRQ_248 : constant Interrupt_ID := 248; IRQ_249 : constant Interrupt_ID := 249; IRQ_250 : constant Interrupt_ID := 250; IRQ_251 : constant Interrupt_ID := 251; IRQ_252 : constant Interrupt_ID := 252; IRQ_253 : constant Interrupt_ID := 253; IRQ_254 : constant Interrupt_ID := 254; -- IRQ_255 -> Runtime: APIC Timer end Ada.Interrupts.Names;
src/geste-text.ads
Fabien-Chouteau/GESTE
13
30403
------------------------------------------------------------------------------ -- -- -- GESTE -- -- -- -- Copyright (C) 2018 <NAME> -- -- -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ with GESTE_Fonts; package GESTE.Text is subtype Parent is Layer.Instance; type Instance (Da_Font : not null GESTE_Fonts.Bitmap_Font_Ref; Number_Of_Columns : Positive; Number_Of_Lines : Positive; Foreground : Output_Color; Background : Output_Color) is new Parent with private; subtype Class is Instance'Class; type Ref is access all Class; type Const_Ref is access constant Class; procedure Clear (This : in out Instance); -- Erase all text and set the cursor to (1, 1) procedure Cursor (This : in out Instance; X, Y : Positive); procedure Put (This : in out Instance; C : Character); procedure Put (This : in out Instance; Str : String); function Char (This : in out Instance; X, Y : Positive) return Character; procedure Set_Colors (This : in out Instance; X, Y : Positive; Foreground : Output_Color; Background : Output_Color); procedure Set_Colors_All (This : in out Instance; Foreground : Output_Color; Background : Output_Color); procedure Invert (This : in out Instance; X, Y : Positive; Inverted : Boolean := True); procedure Invert_All (This : in out Instance; Inverted : Boolean := True); private type Char_Property is record C : Character; Inverted : Boolean; FG : Output_Color; BG : Output_Color; end record; type Char_Matrix is array (Positive range <>, Positive range <>) of Char_Property; type Instance (Da_Font : not null GESTE_Fonts.Bitmap_Font_Ref; Number_Of_Columns : Positive; Number_Of_Lines : Positive; Foreground : Output_Color; Background : Output_Color) is new Parent with record Matrix : Char_Matrix (1 .. Number_Of_Columns, 1 .. Number_Of_Lines) := (others => (others => (' ', False, Foreground, Background))); CX : Positive := 1; CY : Positive := 1; end record; function Text_Bitmap_Set (This : Instance; X, Y : Integer; C : out Char_Property) return Boolean; overriding procedure Update_Size (This : in out Instance); overriding function Pix (This : Instance; X, Y : Integer) return Output_Color with Pre => X in 0 .. This.Width - 1 and then Y in 0 .. This.Height - 1; overriding function Collides (This : Instance; X, Y : Integer) return Boolean; end GESTE.Text;
libsrc/_DEVELOPMENT/arch/zx/display/c/sdcc_iy/zx_aaddr2cy_fastcall.asm
meesokim/z88dk
0
91809
<filename>libsrc/_DEVELOPMENT/arch/zx/display/c/sdcc_iy/zx_aaddr2cy_fastcall.asm ; uint zx_aaddr2cy_fastcall(void *attraddr) SECTION code_arch PUBLIC _zx_aaddr2cy_fastcall _zx_aaddr2cy_fastcall: INCLUDE "arch/zx/display/z80/asm_zx_aaddr2cy.asm"
Sources/Swarm/swarm_control.adb
ForYouEyesOnly/Space-Convoy
1
22159
<filename>Sources/Swarm/swarm_control.adb -- -- Jan & <NAME>, Australia, 2013 -- with Ada.Containers; use Ada.Containers; with Ada.Numerics; use Ada.Numerics; with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random; with Ada.Real_Time; use Ada.Real_Time; with Ada.Text_IO; use Ada.Text_IO; with Graphics_Configuration; use Graphics_Configuration; with Rotations; use Rotations; with Swarm_Data; use Swarm_Data; with Vectors_Conversions; use Vectors_Conversions; with Vectors_3D_LF; use Vectors_3D_LF; with Vehicle_Message_Type; use Vehicle_Message_Type; with Vehicle_Task_Type; use Vehicle_Task_Type; package body Swarm_Control is use Real_Elementary_Functions; use Swarm_Vectors; protected body Swarm_Monitor is function Id_Task return Swarm_Element_Index is begin for Element_Index in First_Index (Swarm_State) .. Last_Index (Swarm_State) loop if Element (Swarm_State, Element_Index).Process_Id = Current_Task then return (Element_Index); end if; end loop; raise No_Such_Task; end Id_Task; function Id_Task (Id : Task_Id) return Swarm_Element_Index is begin for Element_Index in First_Index (Swarm_State) .. Last_Index (Swarm_State) loop if Element (Swarm_State, Element_Index).Process_Id = Id then return (Element_Index); end if; end loop; raise No_Such_Task; end Id_Task; function Position (Id : Task_Id) return Protected_Point_3D.Monitor_Ptr is (Element (Swarm_State, Swarm_Monitor.Id_Task (Current_Task)).Position); function Velocity (Id : Task_Id) return Protected_Vector_3D.Monitor_Ptr is (Element (Swarm_State, Swarm_Monitor.Id_Task (Current_Task)).Velocity); function Acceleration (Id : Task_Id) return Protected_Vector_3D.Monitor_Ptr is (Element (Swarm_State, Swarm_Monitor.Id_Task (Current_Task)).Acceleration); function Controls (Id : Task_Id) return Vehicle_Controls_P is (Element (Swarm_State, Swarm_Monitor.Id_Task (Current_Task)).Controls); function Comms (Id : Task_Id) return Vehicle_Comms_P is (Element (Swarm_State, Swarm_Monitor.Id_Task (Current_Task)).Comms); function Charge (Id : Task_Id) return Charge_Info is (Element (Swarm_State, Swarm_Monitor.Id_Task (Current_Task)).Charge); function Process_abort return Barrier_Ptr is (Element (Swarm_State, Swarm_Monitor.Id_Task).Process_abort); -- -- -- procedure Append_Random_Swarm (No_Of_Swarm_Elements : Positive := Initial_No_of_Elements; Centre : Positions := Initial_Swarm_Position; Volume_Edge_Length : Real := Initual_Edge_Length) is Random_Float : Generator; begin Reset (Random_Float); Reserve_Capacity (Swarm_State, Length (Swarm_State) + Count_Type (No_Of_Swarm_Elements)); for i in 1 .. No_Of_Swarm_Elements loop select pragma Warnings (Off, "potentially blocking operation in protected operation"); delay Tolerated_Vehicle_Activation_Delay; pragma Warnings (On, "potentially blocking operation in protected operation"); raise Vehicle_could_not_be_created; then abort declare New_Element : Swarm_Element_State := (Position => Protected_Point_3D.Allocate ((Centre (x) + (Real (Random (Random_Float)) * Volume_Edge_Length) - Volume_Edge_Length / 2.0, Centre (y) + (Real (Random (Random_Float)) * Volume_Edge_Length) - Volume_Edge_Length / 2.0, Centre (z) + (Real (Random (Random_Float)) * Volume_Edge_Length) - Volume_Edge_Length / 2.0)), Rotation => Protected_Rotation.Allocate (Zero_Rotation), Velocity => Protected_Vector_3D.Allocate (Zero_Vector_3D), Acceleration => Protected_Vector_3D.Allocate (Zero_Vector_3D), Charge => (Level => Full_Charge, Charge_Time => Protected_Time.Allocate (Clock), Charge_No => 0, Globes_Touched => No_Globes_Touched), Neighbours => new Distance_Vectors.Vector, Controls => new Vehicle_Controls, Comms => new Vehicle_Comms, Process => new Vehicle_Task, Process_abort => new Barrier, Process_Id => Null_Task_Id, Vehicle_Id => Natural'Succ (Last_Vehicle_Id), Last_Update => Clock); begin Last_Vehicle_Id := New_Element.Vehicle_Id; pragma Warnings (Off, "potentially blocking operation in protected operation"); -- Freshly created vehicle tasks need to respond to this call. select New_Element.Process.all.Identify (New_Element.Vehicle_Id, New_Element.Process_Id); or delay Tolerated_Identify_Call_Delay; raise Task_did_not_repond_to_Identfiy_Call; end select; pragma Warnings (On, "potentially blocking operation in protected operation"); Append (Swarm_State, New_Element); end; end select; end loop; end Append_Random_Swarm; -- -- -- procedure Remove_Vehicle (Element_Ix : Swarm_Element_Index) is begin if Length (Swarm_State) > 1 and then Element_Ix >= First_Index (Swarm_State) and then Element_Ix <= Last_Index (Swarm_State) then declare This_Element : Swarm_Element_State := Element (Swarm_State, Element_Ix); begin Free_Process (This_Element.Process); Free (This_Element.Process_abort); Free_Neighbours (This_Element.Neighbours); Free_Comms (This_Element.Comms); Free_Controls (This_Element.Controls); Protected_Time.Free (This_Element.Charge.Charge_Time); Protected_Point_3D.Free (This_Element.Position); Protected_Rotation.Free (This_Element.Rotation); Protected_Vector_3D.Free (This_Element.Velocity); Protected_Vector_3D.Free (This_Element.Acceleration); Delete (Swarm_State, Element_Ix); end; end if; end Remove_Vehicle; -- -- -- function Centre_Of_Gravity return Vector_3D is Acc_Positions : Vector_3D_LF := Zero_Vector_3D_LF; begin for Element_Index in First_Index (Swarm_State) .. Last_Index (Swarm_State) loop Acc_Positions := Acc_Positions + To_Vector_3D_LF (Element (Swarm_State, Element_Index).Position.all.Read); end loop; return To_Vector_3D ((1.0 / Long_Float (Length (Swarm_State))) * Acc_Positions); end Centre_Of_Gravity; -- -- -- function Mean_Velocity return Vector_3D is Acc_Velocity : Vector_3D_LF := Zero_Vector_3D_LF; begin for Element_Index in First_Index (Swarm_State) .. Last_Index (Swarm_State) loop Acc_Velocity := Acc_Velocity + To_Vector_3D_LF (Element (Swarm_State, Element_Index).Velocity.all.Read); end loop; return To_Vector_3D ((1.0 / Long_Float (Length (Swarm_State))) * Acc_Velocity); end Mean_Velocity; -- -- -- function Mean_Velocity return Real is Acc_Velocity : Real := 0.0; begin for Element_Index in First_Index (Swarm_State) .. Last_Index (Swarm_State) loop Acc_Velocity := Acc_Velocity + Real (abs (To_Vector_3D_LF (Element (Swarm_State, Element_Index).Velocity.all.Read))); end loop; return Real (Acc_Velocity / Real (Length (Swarm_State))); end Mean_Velocity; -- -- -- function Maximal_Radius return Real is CoG : constant Vector_3D := Centre_Of_Gravity; Radius : Real := 0.0; begin for Element_Index in First_Index (Swarm_State) .. Last_Index (Swarm_State) loop declare Distance_from_CoG : constant Real := abs (CoG - Element (Swarm_State, Element_Index).Position.all.Read); begin Radius := Real'Max (Radius, Distance_from_CoG); end; end loop; return Radius; end Maximal_Radius; -- -- -- function Mean_Radius return Real is CoG : constant Vector_3D := Centre_Of_Gravity; Acc_Radius : Real := 0.0; begin for Element_Index in First_Index (Swarm_State) .. Last_Index (Swarm_State) loop declare Distance_from_CoG : constant Real := abs (CoG - Element (Swarm_State, Element_Index).Position.all.Read); begin Acc_Radius := Acc_Radius + Distance_from_CoG; end; end loop; return Real (Acc_Radius / Real (Length (Swarm_State))); end Mean_Radius; -- -- -- function Mean_Closest_Distance return Real is Acc_Distance : Real := 0.0; begin for Element_Index in First_Index (Swarm_State) .. Last_Index (Swarm_State) loop declare This_Element : constant Swarm_Element_State := Element (Swarm_State, Element_Index); Neighbours : constant Distance_Vectors.Vector := This_Element.Neighbours.all; begin if Distance_Vectors.Length (Neighbours) > 0 then declare Closest_Distance : constant Real := Distance_Vectors.Element (Neighbours, Distance_Vectors.First_Index (Neighbours)).Distance; begin Acc_Distance := Acc_Distance + Closest_Distance; end; end if; end; end loop; return Real (Acc_Distance / Real (Length (Swarm_State))); end Mean_Closest_Distance; -- end Swarm_Monitor; -- -- -- procedure Remove_Vehicle_in_Stages (Element_Ix : Swarm_Element_Index) is Tolerated_Termination_Time : constant Duration := To_Duration (Milliseconds (100)); begin Element (Swarm_State, Element_Ix).Process_abort.all.Open; select delay Tolerated_Termination_Time; Put_Line (Current_Error, "Warning: Vehicle task termination request ignored - attempting task abort now"); select delay Tolerated_Termination_Time; Put_Line (Current_Error, "Error: Vehicle task stuck in non-abortable code region - task abort failed"); then abort Abort_Task (Element (Swarm_State, Element_Ix).Process_Id); loop exit when Is_Terminated (Element (Swarm_State, Element_Ix).Process_Id); delay 0.0; end loop; end select; then abort loop exit when Is_Terminated (Element (Swarm_State, Element_Ix).Process_Id); delay 0.0; end loop; end select; Swarm_Monitor.Remove_Vehicle (Element_Ix); end Remove_Vehicle_in_Stages; procedure Remove_Vehicles (No_Of_Swarm_Elements : Positive := 1) is begin if Natural (Length (Swarm_State)) >= No_Of_Swarm_Elements then for Element_Index in Last_Index (Swarm_State) - No_Of_Swarm_Elements + 1 .. Last_Index (Swarm_State) loop Remove_Vehicle_in_Stages (Element_Index); end loop; end if; end Remove_Vehicles; -- -- -- procedure Sorted_Close_Distances (Close_Dist : in out Distance_Vectors.Vector; Element_Index : Swarm_Element_Index; Max_Distance : Distances) is This_Element : constant Swarm_Element_State := Element (Swarm_State, Element_Index); This_Position : constant Positions := This_Element.Position.all.Read; begin Distance_Vectors.Clear (Close_Dist); Distance_Vectors.Reserve_Capacity (Close_Dist, Length (Swarm_State) - 1); for Scan_Index in First_Index (Swarm_State) .. Last_Index (Swarm_State) loop if Element_Index /= Scan_Index then declare Test_Element : constant Swarm_Element_State := Element (Swarm_State, Scan_Index); Test_Position : constant Positions := Test_Element.Position.all.Read; Test_Direction : constant Vector_3D := This_Position - Test_Position; Test_Distance : constant Distances := abs (Test_Direction); begin if Test_Distance <= Max_Distance then Distance_Vectors.Append (Close_Dist, (Index => Scan_Index, Distance => Test_Distance, Position_Diff => Test_Direction, Velocity_Diff => This_Element.Velocity.all.Read - Test_Element.Velocity.all.Read)); end if; end; end if; end loop; Sort_Distances.Sort (Close_Dist); end Sorted_Close_Distances; -- -- -- procedure Set_Acceleration (Element_Index : Swarm_Element_Index) is This_Element : constant Swarm_Element_State := Element (Swarm_State, Element_Index); Acceleration : Accelerations := Zero_Vector_3D; begin Sorted_Close_Distances (This_Element.Neighbours.all, Element_Index, Detection_Range); for Distance_Index in Distance_Vectors.First_Index (This_Element.Neighbours.all) .. Distance_Vectors.Last_Index (This_Element.Neighbours.all) loop declare Distance_Entry : constant Distance_Entries := Distance_Vectors.Element (This_Element.Neighbours.all, Distance_Index); begin -- Uncontrolled vehicles if This_Element.Controls.all.Read_Throttle = 0.0 then -- Attraction and repulsion forces between vehicles Acceleration := Acceleration + Inter_Swarm_Acceleration (Distance_Entry.Distance) * Norm (Distance_Entry.Position_Diff); -- Alignment forces if Distance_Entry.Distance <= Velocity_Matching_Range then Acceleration := Acceleration + Velocity_Matching (This_Element.Velocity.all.Read, Distance_Entry.Velocity_Diff); end if; -- Controlled vehicles elsif Distance_Entry.Distance <= Unconditional_Repulse_Dist then -- Unconditional repulsion for controlled vehicles Acceleration := Acceleration + Inter_Swarm_Repulsion (Distance_Entry.Distance) * Norm (Distance_Entry.Position_Diff); end if; end; end loop; -- Controlled vehicles if This_Element.Controls.all.Read_Throttle /= 0.0 then -- Approach the set target declare Target_Vector : constant Vector_3D := This_Element.Controls.all.Read_Steering - This_Element.Position.all.Read; Norm_Target_Vector : constant Vector_3D := Norm (Target_Vector); Abs_Target_Vector : constant Real := abs (Target_Vector); Abs_Velocity : constant Real := abs (This_Element.Velocity.all.Read); Angle_Between_Target_and_Velocity : constant Real := Angle_Between (Target_Vector, This_Element.Velocity.all.Read); begin if Abs_Target_Vector < Target_Fetch_Range then -- Target reached, switch to idle throttle This_Element.Controls.all.Set_Throttle (Idle_Throttle); else -- Accelerate to constant speed towards target, dampen lateral velocities Acceleration := Acceleration + (This_Element.Controls.all.Read_Throttle * Approach_Acceleration (Abs_Velocity * Cos (Angle_Between_Target_and_Velocity)) * Norm_Target_Vector) - Norm (This_Element.Velocity.all.Read) * (Intented_Framerate / 5.0) * Abs_Velocity * Sin (Angle_Between_Target_and_Velocity); end if; end; end if; -- Friction This_Element.Acceleration.all.Write (Acceleration - Norm (This_Element.Velocity.all.Read) * (abs (This_Element.Velocity.all.Read) * Friction)**2); Replace_Element (Swarm_State, Element_Index, This_Element); end Set_Acceleration; -- -- -- procedure Set_All_Accelerations is begin for Element_Index in First_Index (Swarm_State) .. Last_Index (Swarm_State) loop Set_Acceleration (Element_Index); end loop; end Set_All_Accelerations; -- -- -- procedure Forward_Messages (Element_Index : Swarm_Element_Index) is This_Element : constant Swarm_Element_State := Element (Swarm_State, Element_Index); Message_To_Be_Distributed : Inter_Vehicle_Messages; begin while This_Element.Comms.all.Has_Outgoing_Messages loop This_Element.Comms.all.Fetch_Message (Message_To_Be_Distributed); Check_Neighbours : for Distance_Index in Distance_Vectors.First_Index (This_Element.Neighbours.all) .. Distance_Vectors.Last_Index (This_Element.Neighbours.all) loop declare Distance_Entry : constant Distance_Entries := Distance_Vectors.Element (This_Element.Neighbours.all, Distance_Index); begin if Distance_Entry.Distance <= Comms_Range then Element (Swarm_State, Distance_Entry.Index).Comms.all.Push_Message (Message_To_Be_Distributed); else exit Check_Neighbours; end if; end; end loop Check_Neighbours; end loop; end Forward_Messages; -- -- -- procedure Forward_All_Messages is begin for Element_Index in First_Index (Swarm_State) .. Last_Index (Swarm_State) loop Forward_Messages (Element_Index); end loop; end Forward_All_Messages; -- -- -- procedure Move_Element (Element_Index : Swarm_Element_Index) is This_Element : Swarm_Element_State := Element (Swarm_State, Element_Index); Interval : constant Real := Real'Min (Real (To_Duration (Clock - This_Element.Last_Update)), Max_Update_Interval); begin This_Element.Velocity.all.Write (This_Element.Velocity.all.Read + (Interval * This_Element.Acceleration.all.Read)); declare Move_Start : constant Positions := This_Element.Position.all.Read; Move_End : constant Positions := Move_Start + (Interval * This_Element.Velocity.all.Read); begin This_Element.Position.all.Write (Move_End); This_Element.Charge.Level := Vehicle_Charges (Real'Max (Real (Empty_Charge), Real'Min (Real (Full_Charge), Real (This_Element.Charge.Level) - (Interval * (Charging_Setup.Constant_Discharge_Rate_Per_Sec + Charging_Setup.Propulsion_Discharge_Rate_Per_Sec * abs (This_Element.Acceleration.all.Read)))))); for Globe_Ix in Globes'Range loop declare Globe_Pos : constant Positions := Globes (Globe_Ix).Position.all.Read; Interratio : constant Real := (Globe_Pos - Move_Start) * ((Move_End - Move_Start) / (abs (Move_End - Move_Start))); Intersection : constant Positions := Move_Start + Interratio * (Move_End - Move_Start); Touching : constant Boolean := abs (Intersection - Globe_Pos) <= Energy_Globe_Detection and then Interratio >= 0.0 and then Interratio <= 1.0; Slot_Passed : constant Boolean := Clock - This_Element.Charge.Charge_Time.all.Read > Charging_Setup.Max_Globe_Interval; begin if (not This_Element.Charge.Globes_Touched (Globe_Ix) or else Slot_Passed) and then Touching then if Slot_Passed then This_Element.Charge.Globes_Touched := No_Globes_Touched; This_Element.Charge.Charge_No := 0; end if; This_Element.Charge.Charge_No := This_Element.Charge.Charge_No + 1; This_Element.Charge.Globes_Touched (Globe_Ix) := True; This_Element.Charge.Charge_Time.all.Write (Clock); if This_Element.Charge.Charge_No = Charging_Setup.Globes_Required then This_Element.Charge.Level := Full_Charge; This_Element.Charge.Charge_No := 0; This_Element.Charge.Globes_Touched := No_Globes_Touched; end if; end if; end; end loop; end; This_Element.Last_Update := Clock; Replace_Element (Swarm_State, Element_Index, This_Element); end Move_Element; -- -- -- procedure Move_All_Elements is begin for Element_Index in First_Index (Swarm_State) .. Last_Index (Swarm_State) loop Move_Element (Element_Index); end loop; end Move_All_Elements; -- -- -- procedure Update_Rotation (Element_Index : Swarm_Element_Index) is function Vector_Yaw (In_Vector : Vector_3D) return Real is (if In_Vector (x) = 0.0 and then In_Vector (z) = 0.0 then 0.0 else Arctan (In_Vector (x), In_Vector (z))); function Vector_Pitch (In_Vector : Vector_3D) return Real is ((Pi / 2.0) - Angle_Between (In_Vector, (0.0, 1.0, 0.0))); This_Element : constant Swarm_Element_State := Element (Swarm_State, Element_Index); Velocity : constant Vector_3D := This_Element.Velocity.all.Read; Element_Yaw : constant Real := Vector_Yaw (Velocity); Element_Pitch : constant Real := Vector_Pitch (Velocity); Rotation : constant Quaternion_Rotation := To_Rotation (0.0, -Element_Pitch, Element_Yaw + Pi); Norm_Acc : constant Vector_3D := Rotate (This_Element.Acceleration.all.Read, Rotation); Lateral_Acc : constant Real := Norm_Acc (x) * abs (Velocity); Element_Roll : constant Real := Real'Max (-Pi / 2.0, Real'Min (Pi / 2.0, Lateral_Acc * (Pi / 2.0) / Max_Assumed_Acceleration)); begin This_Element.Rotation.all.Write (To_Rotation (Element_Roll, -Element_Pitch, -Element_Yaw + Pi)); Replace_Element (Swarm_State, Element_Index, This_Element); end Update_Rotation; --- --- --- procedure Update_All_Rotations is begin for Element_Index in First_Index (Swarm_State) .. Last_Index (Swarm_State) loop Update_Rotation (Element_Index); end loop; end Update_All_Rotations; -- -- -- procedure Remove_Empties is begin if Length (Swarm_State) > 1 then declare Element_Index : Swarm_Element_Index := First_Index (Swarm_State); begin while Element_Index <= Last_Index (Swarm_State) and then Length (Swarm_State) > 1 loop if Element (Swarm_State, Element_Index).Charge.Level = Empty_Charge then Remove_Vehicle_in_Stages (Element_Index); else Element_Index := Element_Index + 1; end if; end loop; end; end if; end Remove_Empties; end Swarm_Control;
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_21829_1652.asm
ljhsiun2/medusa
9
87642
<filename>Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0xca_notsx.log_21829_1652.asm .global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %rax push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x19ca6, %rbp nop nop nop dec %rsi movl $0x61626364, (%rbp) nop nop nop nop nop and %rax, %rax lea addresses_WT_ht+0x10a6, %r11 nop nop nop cmp $35778, %rax movb (%r11), %dl nop sub %rax, %rax lea addresses_WT_ht+0x1a6a6, %rsi lea addresses_WT_ht+0xd5f4, %rdi nop nop add $48004, %r11 mov $108, %rcx rep movsl nop nop add %rsi, %rsi lea addresses_WC_ht+0x1bf46, %r13 nop inc %rax movb (%r13), %dl nop add $55987, %rdi lea addresses_WC_ht+0x1d246, %rsi lea addresses_WT_ht+0x46a6, %rdi clflush (%rdi) nop nop nop and $7552, %r13 mov $95, %rcx rep movsl nop nop mfence lea addresses_WC_ht+0x19ca6, %rdi clflush (%rdi) nop nop dec %rdx movb $0x61, (%rdi) nop nop nop nop nop inc %rsi lea addresses_normal_ht+0x158a6, %r11 clflush (%r11) nop nop nop nop dec %rsi movb $0x61, (%r11) nop nop nop and $65219, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %rax pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %rax push %rbx push %rcx push %rdi push %rsi // Store lea addresses_WT+0x18056, %r13 nop nop nop and $23686, %rax movb $0x51, (%r13) nop nop xor %r10, %r10 // Store lea addresses_WT+0xe5f2, %rcx nop nop nop nop nop dec %rbx movl $0x51525354, (%rcx) nop nop nop nop nop and $41441, %r10 // REPMOV lea addresses_WC+0x178ce, %rsi lea addresses_PSE+0x15945, %rdi nop nop nop nop sub $35252, %rbx mov $93, %rcx rep movsb nop nop cmp $56719, %rdi // Load mov $0x187490000000026, %rcx nop nop nop and %rax, %rax mov (%rcx), %rsi sub $54433, %rdi // Store lea addresses_normal+0xd4a6, %rax nop sub $22679, %rsi mov $0x5152535455565758, %r13 movq %r13, %xmm7 vmovups %ymm7, (%rax) sub $27931, %r11 // Store lea addresses_PSE+0x170a6, %r10 clflush (%r10) xor $32046, %r11 movl $0x51525354, (%r10) nop nop nop dec %rdi // Store lea addresses_PSE+0xdba6, %rbx nop nop nop nop nop add %rcx, %rcx mov $0x5152535455565758, %rax movq %rax, %xmm1 vmovups %ymm1, (%rbx) nop nop add %r10, %r10 // Faulty Load lea addresses_normal+0xd4a6, %rax nop nop and $45469, %rbx mov (%rax), %rdi lea oracles, %rcx and $0xff, %rdi shlq $12, %rdi mov (%rcx,%rdi,1), %rdi pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 1, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'} {'src': {'congruent': 2, 'same': False, 'type': 'addresses_WC'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7, 'same': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_normal'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 5, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 5, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'} {'58': 21829} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/specs/fe_inlining_helper.adb
best08618/asylo
7
24363
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/specs/fe_inlining_helper.adb procedure FE_Inlining_Helper is begin null; end FE_Inlining_Helper;
src/Bisimilarity/CCS.agda
nad/up-to
0
13887
------------------------------------------------------------------------ -- Lemmas related to bisimilarity and CCS, implemented using the -- coinductive definition of bisimilarity ------------------------------------------------------------------------ {-# OPTIONS --sized-types #-} open import Prelude module Bisimilarity.CCS {ℓ} {Name : Type ℓ} where open import Equality.Propositional open import Prelude.Size import Bisimilarity.Equational-reasoning-instances import Bisimilarity.CCS.General open import Equational-reasoning open import Labelled-transition-system.CCS Name open import Bisimilarity CCS import Labelled-transition-system.Equational-reasoning-instances CCS as Dummy ------------------------------------------------------------------------ -- Congruence lemmas -- Some lemmas used to prove the congruence results below as well as -- similar results in Similarity.CCS. module Cong-lemmas ({R} R′ : Proc ∞ → Proc ∞ → Type ℓ) ⦃ _ : Convertible R R′ ⦄ ⦃ _ : Convertible R′ R′ ⦄ ⦃ _ : Convertible _∼_ R′ ⦄ ⦃ _ : Transitive R′ R′ ⦄ (left-to-right : ∀ {P Q} → R P Q → ∀ {P′ μ} → P [ μ ]⟶ P′ → ∃ λ Q′ → Q [ μ ]⟶ Q′ × R′ P′ Q′) where private infix -2 R′:_ R′:_ : ∀ {P Q} → R′ P Q → R′ P Q R′:_ = id infix -3 lr-result lr-result : ∀ {P′ Q Q′} μ → R′ P′ Q′ → Q [ μ ]⟶ Q′ → ∃ λ Q′ → Q [ μ ]⟶ Q′ × R′ P′ Q′ lr-result _ P′∼′Q′ Q⟶Q′ = _ , Q⟶Q′ , P′∼′Q′ syntax lr-result μ P′∼′Q′ Q⟶Q′ = P′∼′Q′ [ μ ]⟵ Q⟶Q′ ∣-cong : (∀ {P P′ Q Q′} → R′ P P′ → R′ Q Q′ → R′ (P ∣ Q) (P′ ∣ Q′)) → ∀ {P₁ P₂ Q₁ Q₂ S₁ μ} → R P₁ P₂ → R Q₁ Q₂ → P₁ ∣ Q₁ [ μ ]⟶ S₁ → ∃ λ S₂ → P₂ ∣ Q₂ [ μ ]⟶ S₂ × R′ S₁ S₂ ∣-cong _∣-cong′_ P₁∼P₂ Q₁∼Q₂ = λ where (par-left tr) → Σ-map (_∣ _) (Σ-map par-left (_∣-cong′ convert Q₁∼Q₂)) (left-to-right P₁∼P₂ tr) (par-right tr) → Σ-map (_ ∣_) (Σ-map par-right (convert P₁∼P₂ ∣-cong′_)) (left-to-right Q₁∼Q₂ tr) (par-τ tr₁ tr₂) → Σ-zip _∣_ (Σ-zip par-τ _∣-cong′_) (left-to-right P₁∼P₂ tr₁) (left-to-right Q₁∼Q₂ tr₂) ⊕-cong : ∀ {P₁ P₁′ P₂ P₂′ S μ} → R P₁ P₁′ → R P₂ P₂′ → P₁ ⊕ P₂ [ μ ]⟶ S → ∃ λ S′ → P₁′ ⊕ P₂′ [ μ ]⟶ S′ × R′ S S′ ⊕-cong {P₁} {P₁′} {P₂} {P₂′} {S} {μ} P₁∼P₁′ P₂∼P₂′ = λ where (sum-left P₁⟶S) → case left-to-right P₁∼P₁′ P₁⟶S of λ where (S′ , P₁′⟶S′ , S∼′S′) → S ∼⟨ S∼′S′ ⟩■ S′ [ μ ]⟵ ←⟨ ⟶: sum-left P₁′⟶S′ ⟩■ P₁′ ⊕ P₂′ (sum-right P₂⟶S) → case left-to-right P₂∼P₂′ P₂⟶S of λ where (S′ , P₂′⟶S′ , S∼′S′) → S ∼⟨ S∼′S′ ⟩■ S′ [ μ ]⟵ ←⟨ ⟶: sum-right P₂′⟶S′ ⟩■ P₁′ ⊕ P₂′ ·-cong : ∀ {P₁ P₂ Q₁ μ μ′} → R′ (force P₁) (force P₂) → μ · P₁ [ μ′ ]⟶ Q₁ → ∃ λ Q₂ → μ · P₂ [ μ′ ]⟶ Q₂ × R′ Q₁ Q₂ ·-cong {P₁} {P₂} {μ = μ} P₁∼P₂ action = force P₁ ∼⟨ P₁∼P₂ ⟩■ force P₂ [ μ ]⟵ ←⟨ ⟶: action ⟩■ μ · P₂ ⟨ν⟩-cong : (∀ {a P P′} → R′ P P′ → R′ (⟨ν a ⟩ P) (⟨ν a ⟩ P′)) → ∀ {a μ P P′ Q} → R P P′ → ⟨ν a ⟩ P [ μ ]⟶ Q → ∃ λ Q′ → ⟨ν a ⟩ P′ [ μ ]⟶ Q′ × R′ Q Q′ ⟨ν⟩-cong ⟨ν⟩-cong′ {a} {μ} {P′ = P′} P∼P′ (restriction {P′ = Q} a∉μ P⟶Q) = case left-to-right P∼P′ P⟶Q of λ where (Q′ , P′⟶Q′ , Q∼′Q′) → ⟨ν a ⟩ Q ∼⟨ ⟨ν⟩-cong′ Q∼′Q′ ⟩■ ⟨ν a ⟩ Q′ [ μ ]⟵ ←⟨ ⟶: restriction a∉μ P′⟶Q′ ⟩■ ⟨ν a ⟩ P′ !-cong : (∀ {μ P P₀} → ! P [ μ ]⟶ P₀ → (∃ λ P′ → P [ μ ]⟶ P′ × P₀ ∼ ! P ∣ P′) ⊎ (μ ≡ τ × ∃ λ P′ → ∃ λ P″ → ∃ λ a → P [ name a ]⟶ P′ × P [ name (co a) ]⟶ P″ × P₀ ∼ (! P ∣ P′) ∣ P″)) → (∀ {P P′ Q Q′} → R′ P P′ → R′ Q Q′ → R′ (P ∣ Q) (P′ ∣ Q′)) → (∀ {P P′} → R′ P P′ → R′ (! P) (! P′)) → ∀ {P P′ Q μ} → R P P′ → ! P [ μ ]⟶ Q → ∃ λ Q′ → ! P′ [ μ ]⟶ Q′ × R′ Q Q′ !-cong 6-1-3-2 _∣-cong′_ !-cong′_ {P} {P′} {Q} {μ} P∼P′ !P⟶Q = case 6-1-3-2 !P⟶Q of λ where (inj₁ (P″ , P⟶P″ , Q∼!P∣P″)) → let Q′ , P′⟶Q′ , P″∼′Q′ = left-to-right P∼P′ P⟶P″ in Q ∼⟨ R′: convert Q∼!P∣P″ ⟩ ! P ∣ P″ ∼⟨ (!-cong′ convert P∼P′) ∣-cong′ P″∼′Q′ ⟩■ ! P′ ∣ Q′ [ μ ]⟵ ←⟨ ⟶: replication (par-right P′⟶Q′) ⟩■ ! P′ (inj₂ (refl , P″ , P‴ , a , P⟶P″ , P⟶P‴ , Q∼!P∣P″∣P‴)) → let Q′ , P′⟶Q′ , P″∼′Q′ = left-to-right P∼P′ P⟶P″ Q″ , P′⟶Q″ , P‴∼′Q″ = left-to-right P∼P′ P⟶P‴ in Q ∼⟨ R′: convert Q∼!P∣P″∣P‴ ⟩ (! P ∣ P″) ∣ P‴ ∼⟨ ((!-cong′ convert P∼P′) ∣-cong′ P″∼′Q′) ∣-cong′ P‴∼′Q″ ⟩■ (! P′ ∣ Q′) ∣ Q″ [ τ ]⟵ ←⟨ ⟶: replication (par-τ (replication (par-right P′⟶Q′)) P′⟶Q″) ⟩■ ! P′ private module CL {i} = Cong-lemmas [ i ]_∼′_ left-to-right ------------------------------------------------------------------------ -- Various lemmas related to _∣_ mutual -- _∣_ is commutative. ∣-comm : ∀ {P Q i} → [ i ] P ∣ Q ∼ Q ∣ P ∣-comm {i = i} = ⟨ lr , Σ-map id (Σ-map id symmetric) ∘ lr ⟩ where lr : ∀ {P P′ Q μ} → P ∣ Q [ μ ]⟶ P′ → ∃ λ Q′ → Q ∣ P [ μ ]⟶ Q′ × [ i ] P′ ∼′ Q′ lr (par-left tr) = _ , par-right tr , ∣-comm′ lr (par-right tr) = _ , par-left tr , ∣-comm′ lr (par-τ tr₁ tr₂) = _ , par-τ tr₂ (subst (λ a → _ [ name a ]⟶ _) (sym $ co-involutive _) tr₁) , ∣-comm′ ∣-comm′ : ∀ {P Q i} → [ i ] P ∣ Q ∼′ Q ∣ P force ∣-comm′ = ∣-comm mutual -- _∣_ is associative. ∣-assoc : ∀ {P Q R i} → [ i ] P ∣ (Q ∣ R) ∼ (P ∣ Q) ∣ R ∣-assoc {i = i} = ⟨ lr , rl ⟩ where lr : ∀ {P Q R P′ μ} → P ∣ (Q ∣ R) [ μ ]⟶ P′ → ∃ λ Q′ → (P ∣ Q) ∣ R [ μ ]⟶ Q′ × [ i ] P′ ∼′ Q′ lr (par-left tr) = _ , par-left (par-left tr) , ∣-assoc′ lr (par-right (par-left tr)) = _ , par-left (par-right tr) , ∣-assoc′ lr (par-right (par-right tr)) = _ , par-right tr , ∣-assoc′ lr (par-right (par-τ tr₁ tr₂)) = _ , par-τ (par-right tr₁) tr₂ , ∣-assoc′ lr (par-τ tr₁ (par-left tr₂)) = _ , par-left (par-τ tr₁ tr₂) , ∣-assoc′ lr (par-τ tr₁ (par-right tr₂)) = _ , par-τ (par-left tr₁) tr₂ , ∣-assoc′ rl : ∀ {P Q R Q′ μ} → (P ∣ Q) ∣ R [ μ ]⟶ Q′ → ∃ λ P′ → P ∣ (Q ∣ R) [ μ ]⟶ P′ × [ i ] P′ ∼′ Q′ rl (par-left (par-left tr)) = _ , par-left tr , ∣-assoc′ rl (par-left (par-right tr)) = _ , par-right (par-left tr) , ∣-assoc′ rl (par-left (par-τ tr₁ tr₂)) = _ , par-τ tr₁ (par-left tr₂) , ∣-assoc′ rl (par-right tr) = _ , par-right (par-right tr) , ∣-assoc′ rl (par-τ (par-left tr₁) tr₂) = _ , par-τ tr₁ (par-right tr₂) , ∣-assoc′ rl (par-τ (par-right tr₁) tr₂) = _ , par-right (par-τ tr₁ tr₂) , ∣-assoc′ ∣-assoc′ : ∀ {P Q R i} → [ i ] P ∣ (Q ∣ R) ∼′ (P ∣ Q) ∣ R force ∣-assoc′ = ∣-assoc -- ∅ is a left identity of _∣_. ∣-left-identity : ∀ {i P} → [ i ] ∅ ∣ P ∼ P ∣-left-identity = ⟨ (λ { (par-right tr) → (_ , tr , λ { .force → ∣-left-identity }) ; (par-left ()) ; (par-τ () _) }) , (λ tr → (_ , par-right tr , λ { .force → ∣-left-identity })) ⟩ ∣-left-identity′ : ∀ {P i} → [ i ] ∅ ∣ P ∼′ P force ∣-left-identity′ = ∣-left-identity -- ∅ is a right identity of _∣_. ∣-right-identity : ∀ {P} → P ∣ ∅ ∼ P ∣-right-identity {P} = P ∣ ∅ ∼⟨ ∣-comm ⟩ ∅ ∣ P ∼⟨ ∣-left-identity ⟩■ P mutual -- _∣_ preserves bisimilarity. infix 6 _∣-cong_ _∣-cong′_ _∣-cong_ : ∀ {i P P′ Q Q′} → [ i ] P ∼ Q → [ i ] P′ ∼ Q′ → [ i ] P ∣ P′ ∼ Q ∣ Q′ P∼Q ∣-cong P′∼Q′ = ⟨ lr P∼Q P′∼Q′ , Σ-map id (Σ-map id symmetric) ∘ lr (symmetric P∼Q) (symmetric P′∼Q′) ⟩ where lr = CL.∣-cong _∣-cong′_ _∣-cong′_ : ∀ {i P P′ Q Q′} → [ i ] P ∼′ Q → [ i ] P′ ∼′ Q′ → [ i ] P ∣ P′ ∼′ Q ∣ Q′ force (P∼P′ ∣-cong′ Q∼Q′) = force P∼P′ ∣-cong force Q∼Q′ -- An alternative proof that is closer to the one in the paper. infix 6 _∣-congP_ _∣-congP_ : ∀ {i P P′ Q Q′} → [ i ] P ∼ Q → [ i ] P′ ∼ Q′ → [ i ] P ∣ P′ ∼ Q ∣ Q′ _∣-congP_ {i} = λ p q → ⟨ lr p q , Σ-map id (Σ-map id symmetric) ∘ lr (symmetric p) (symmetric q) ⟩ where lr : ∀ {P P′ P″ Q Q′ μ} → [ i ] P ∼ Q → [ i ] P′ ∼ Q′ → P ∣ P′ [ μ ]⟶ P″ → ∃ λ Q″ → Q ∣ Q′ [ μ ]⟶ Q″ × [ i ] P″ ∼′ Q″ lr p q (par-left tr) = let (_ , tr′ , p′) = left-to-right p tr in (_ , par-left tr′ , λ { .force → force p′ ∣-congP q }) lr p q (par-right tr) = let (_ , tr′ , q′) = left-to-right q tr in (_ , par-right tr′ , λ { .force → p ∣-congP force q′ }) lr p q (par-τ tr₁ tr₂) = let (_ , tr₁′ , p′) = left-to-right p tr₁ (_ , tr₂′ , q′) = left-to-right q tr₂ in (_ , par-τ tr₁′ tr₂′ , λ { .force → force p′ ∣-congP force q′ }) ------------------------------------------------------------------------ -- Exercise 6.1.2 from "Enhancements of the bisimulation proof method" -- by Pous and Sangiorgi private -- A compact proof. 6-1-2-compact : ∀ {P i} → [ i ] ! P ∣ P ∼ ! P 6-1-2-compact = ⟨ (λ tr → _ , replication tr , reflexive) , (λ { (replication tr) → _ , tr , reflexive }) ⟩ -- A less compact proof. 6-1-2 : ∀ {P i} → [ i ] ! P ∣ P ∼ ! P 6-1-2 {P} = ⟨ (λ {P′} {μ} tr → P′ ∼⟨ ∼′: reflexive ⟩■ P′ [ μ ]⟵⟨ replication tr ⟩ ! P) , (λ { {q′ = P′} {μ = μ} (replication tr) → ! P ∣ P [ μ ]⟶⟨ tr ⟩ʳˡ P′ ∼⟨ ∼′: reflexive ⟩■ P′ }) ⟩ ------------------------------------------------------------------------ -- Exercise 6.1.3 (2) from "Enhancements of the bisimulation proof -- method" by Pous and Sangiorgi, plus some rearrangement lemmas private module 6-1-3-2 = Bisimilarity.CCS.General.6-1-3-2 (record { _∼_ = _∼_ ; step-∼ = step-∼ ; finally-∼ = Equational-reasoning.finally₂ ; reflexive = reflexive ; symmetric = symmetric ; ∣-comm = ∣-comm ; ∣-assoc = ∣-assoc ; _∣-cong_ = _∣-cong_ ; 6-1-2 = 6-1-2 }) 6-1-3-2 : ∀ {P μ R} → ! P [ μ ]⟶ R → (∃ λ P′ → P [ μ ]⟶ P′ × R ∼ ! P ∣ P′) ⊎ (μ ≡ τ × ∃ λ P′ → ∃ λ P″ → ∃ λ a → P [ name a ]⟶ P′ × P [ name (co a) ]⟶ P″ × R ∼ (! P ∣ P′) ∣ P″) 6-1-3-2 = 6-1-3-2.6-1-3-2 swap-rightmost : ∀ {P Q R} → (P ∣ Q) ∣ R ∼ (P ∣ R) ∣ Q swap-rightmost = 6-1-3-2.swap-rightmost swap-in-the-middle : ∀ {P Q R S} → (P ∣ Q) ∣ (R ∣ S) ∼ (P ∣ R) ∣ (Q ∣ S) swap-in-the-middle {P} {Q} {R} {S} = (P ∣ Q) ∣ (R ∣ S) ∼⟨ swap-rightmost ⟩ (P ∣ (R ∣ S)) ∣ Q ∼⟨ ∣-assoc ∣-cong reflexive ⟩ ((P ∣ R) ∣ S) ∣ Q ∼⟨ symmetric ∣-assoc ⟩ (P ∣ R) ∣ (S ∣ Q) ∼⟨ reflexive ∣-cong ∣-comm ⟩■ (P ∣ R) ∣ (Q ∣ S) ------------------------------------------------------------------------ -- More preservation lemmas -- _⊕_ preserves bisimilarity. infix 8 _⊕-cong_ _⊕-cong′_ _⊕-cong_ : ∀ {i P P′ Q Q′} → [ i ] P ∼ P′ → [ i ] Q ∼ Q′ → [ i ] P ⊕ Q ∼ P′ ⊕ Q′ _⊕-cong_ {i} P∼P′ Q∼Q′ = ⟨ CL.⊕-cong P∼P′ Q∼Q′ , Σ-map id (Σ-map id symmetric) ∘ CL.⊕-cong {i = i} (symmetric P∼P′) (symmetric Q∼Q′) ⟩ _⊕-cong′_ : ∀ {i P P′ Q Q′} → [ i ] P ∼′ P′ → [ i ] Q ∼′ Q′ → [ i ] P ⊕ Q ∼′ P′ ⊕ Q′ force (P∼P′ ⊕-cong′ Q∼Q′) = force P∼P′ ⊕-cong force Q∼Q′ -- _·_ preserves bisimilarity. infix 12 _·-cong_ _·-cong′_ _·-cong_ : ∀ {i μ μ′ P P′} → μ ≡ μ′ → [ i ] force P ∼′ force P′ → [ i ] μ · P ∼ μ′ · P′ refl ·-cong P∼P′ = ⟨ CL.·-cong P∼P′ , Σ-map id (Σ-map id symmetric) ∘ CL.·-cong (symmetric P∼P′) ⟩ _·-cong′_ : ∀ {i μ μ′ P P′} → μ ≡ μ′ → [ i ] force P ∼′ force P′ → [ i ] μ · P ∼′ μ′ · P′ force (μ≡μ′ ·-cong′ P∼P′) = μ≡μ′ ·-cong P∼P′ -- An alternative proof that is closer to the one in the paper. ·-congP : ∀ {i μ P Q} → [ i ] force P ∼′ force Q → [ i ] μ · P ∼ μ · Q ·-congP p = ⟨ (λ { action → _ , action , p }) , (λ { action → _ , action , p }) ⟩ -- _∙_ preserves bisimilarity. infix 12 _∙-cong_ _∙-cong′_ _∙-cong_ : ∀ {i μ μ′ P P′} → μ ≡ μ′ → [ i ] P ∼ P′ → [ i ] μ ∙ P ∼ μ′ ∙ P′ refl ∙-cong P∼P′ = refl ·-cong convert {a = ℓ} P∼P′ _∙-cong′_ : ∀ {i μ μ′ P P′} → μ ≡ μ′ → [ i ] P ∼′ P′ → [ i ] μ ∙ P ∼′ μ′ ∙ P′ force (μ≡μ′ ∙-cong′ P∼P′) = μ≡μ′ ∙-cong force P∼P′ -- _∙ turns equality into bisimilarity. infix 12 _∙-cong _∙-cong′ _∙-cong : ∀ {μ μ′} → μ ≡ μ′ → μ ∙ ∼ μ′ ∙ refl ∙-cong = reflexive _∙-cong′ : ∀ {μ μ′} → μ ≡ μ′ → μ ∙ ∼′ μ′ ∙ refl ∙-cong′ = reflexive mutual -- !_ preserves bisimilarity. infix 10 !-cong_ !-cong′_ !-cong_ : ∀ {i P P′} → [ i ] P ∼ P′ → [ i ] ! P ∼ ! P′ !-cong P∼P′ = ⟨ lr P∼P′ , Σ-map id (Σ-map id symmetric) ∘ lr (symmetric P∼P′) ⟩ where lr = CL.!-cong 6-1-3-2 _∣-cong′_ !-cong′_ !-cong′_ : ∀ {i P P′} → [ i ] P ∼′ P′ → [ i ] ! P ∼′ ! P′ force (!-cong′ P∼P′) = !-cong force P∼P′ -- An alternative proof that is closer to the one in the paper. !-congP : ∀ {i P Q} → [ i ] P ∼ Q → [ i ] ! P ∼ ! Q !-congP {i} = λ p → ⟨ lr p , Σ-map id (Σ-map id symmetric) ∘ lr (symmetric p) ⟩ where lr : ∀ {P Q R μ} → [ i ] P ∼ Q → ! P [ μ ]⟶ R → ∃ λ S → ! Q [ μ ]⟶ S × [ i ] R ∼′ S lr {P} {Q} {R} P∼Q !P⟶R with 6-1-3-2 !P⟶R ... | inj₁ (P′ , P⟶P′ , R∼!P∣P′) = let (Q′ , Q⟶Q′ , P′∼′Q′) = left-to-right P∼Q P⟶P′ in ( ! Q ∣ Q′ , replication (par-right Q⟶Q′) , (R ∼⟨ R∼!P∣P′ ⟩ ! P ∣ P′ ∼⟨ (λ { .force → !-congP P∼Q }) ∣-cong′ P′∼′Q′ ⟩ ! Q ∣ Q′ ■ ) ) ... | inj₂ (refl , P′ , P″ , a , P⟶P′ , P⟶P″ , R∼!P∣P′∣P″) = let (Q′ , Q⟶Q′ , P′∼′Q′) = left-to-right P∼Q P⟶P′ (Q″ , Q⟶Q″ , P″∼′Q″) = left-to-right P∼Q P⟶P″ in ( (! Q ∣ Q′) ∣ Q″ , replication (par-τ (replication (par-right Q⟶Q′)) Q⟶Q″) , (R ∼⟨ R∼!P∣P′∣P″ ⟩ (! P ∣ P′) ∣ P″ ∼⟨ ((λ { .force → !-congP P∼Q }) ∣-cong′ P′∼′Q′) ∣-cong′ P″∼′Q″ ⟩ (! Q ∣ Q′) ∣ Q″ ■ ) ) mutual -- ⟨ν_⟩ preserves bisimilarity. ⟨ν_⟩-cong : ∀ {i a a′ P P′} → a ≡ a′ → [ i ] P ∼ P′ → [ i ] ⟨ν a ⟩ P ∼ ⟨ν a′ ⟩ P′ ⟨ν refl ⟩-cong = λ P∼P′ → ⟨ lr P∼P′ , Σ-map id (Σ-map id symmetric) ∘ lr (symmetric P∼P′) ⟩ where lr = CL.⟨ν⟩-cong ⟨ν refl ⟩-cong′ ⟨ν_⟩-cong′ : ∀ {i a a′ P P′} → a ≡ a′ → [ i ] P ∼′ P′ → [ i ] ⟨ν a ⟩ P ∼′ ⟨ν a′ ⟩ P′ force (⟨ν a≡a′ ⟩-cong′ P∼P′) = ⟨ν a≡a′ ⟩-cong (force P∼P′) -- _[_] preserves bisimilarity. (This result is related to Exercise -- 6.2.10 in "Enhancements of the bisimulation proof method" -- by Pous and Sangiorgi.) infix 5 _[_]-cong _[_]-cong′ _[_]-cong : ∀ {i n Ps Qs} (C : Context ∞ n) → (∀ x → [ i ] Ps x ∼ Qs x) → [ i ] C [ Ps ] ∼ C [ Qs ] hole x [ Ps∼Qs ]-cong = Ps∼Qs x ∅ [ Ps∼Qs ]-cong = reflexive C₁ ∣ C₂ [ Ps∼Qs ]-cong = (C₁ [ Ps∼Qs ]-cong) ∣-cong (C₂ [ Ps∼Qs ]-cong) C₁ ⊕ C₂ [ Ps∼Qs ]-cong = (C₁ [ Ps∼Qs ]-cong) ⊕-cong (C₂ [ Ps∼Qs ]-cong) μ · C [ Ps∼Qs ]-cong = refl ·-cong λ { .force → force C [ Ps∼Qs ]-cong } ⟨ν a ⟩ C [ Ps∼Qs ]-cong = ⟨ν refl ⟩-cong (C [ Ps∼Qs ]-cong) ! C [ Ps∼Qs ]-cong = !-cong (C [ Ps∼Qs ]-cong) _[_]-cong′ : ∀ {i n Ps Qs} (C : Context ∞ n) → (∀ x → [ i ] Ps x ∼′ Qs x) → [ i ] C [ Ps ] ∼′ C [ Qs ] force (C [ Ps∼Qs ]-cong′) = C [ (λ x → force (Ps∼Qs x)) ]-cong -- The proof of _[_]-cong uses 6-1-3-2 (in !-cong_). The following -- direct proof does not use 6-1-3-2 (but it does use -- extensionality). module _ (ext : Proc-extensionality) where mutual infix 5 _[_]-cong₂ _[_]-cong₂′ _[_]-cong₂ : ∀ {i n Ps Qs} (C : Context ∞ n) → (∀ x → [ i ] Ps x ∼ Qs x) → [ i ] C [ Ps ] ∼ C [ Qs ] _[_]-cong₂ {i} C Ps∼Qs = ⟨ lr C Ps∼Qs , Σ-map id (Σ-map id symmetric) ∘ lr C (symmetric ∘ Ps∼Qs) ⟩ where infix 5 _[_][_]-cong₁ _[_][_]-cong₂ _[_][_]-cong₁ : ∀ {n P Q Ps Qs} → (C : Context ∞ (suc n)) → [ i ] P ∼′ Q → (∀ x → [ i ] Ps x ∼ Qs x) → [ i ] C [ [ const P , Ps ] ] ∼′ C [ [ const Q , Qs ] ] force (C [ P∼′Q ][ Ps∼Qs ]-cong₁) = C [ [ const (force P∼′Q) , Ps∼Qs ] ]-cong₂ _[_][_]-cong₂ : ∀ {P Q R S} → (C : Context ∞ 2) → [ i ] P ∼′ Q → [ i ] R ∼′ S → [ i ] C [ [ const P , [ const R , (λ ()) ] ] ] ∼′ C [ [ const Q , [ const S , (λ ()) ] ] ] force (C [ P∼′Q ][ R∼′S ]-cong₂) = C [ [ const (force P∼′Q) , [ const (force R∼′S) , (λ ()) ] ] ]-cong₂ lr : ∀ {n Ps Qs P′ μ} (C : Context ∞ n) → (∀ x → [ i ] Ps x ∼ Qs x) → C [ Ps ] [ μ ]⟶ P′ → ∃ λ Q′ → C [ Qs ] [ μ ]⟶ Q′ × [ i ] P′ ∼′ Q′ lr (hole x) Ps∼Qs tr = left-to-right (Ps∼Qs x) tr lr ∅ Ps∼Qs () lr (C₁ ∣ C₂) Ps∼Qs (par-left tr) = Σ-map (_∣ _) (Σ-map par-left (λ b → subst (λ P → [ i ] _ ∼′ _ ∣ P) (ext $ weaken-[] C₂) $ subst (λ P → [ i ] _ ∣ P ∼′ _) (ext $ weaken-[] C₂) $ hole fzero ∣ weaken C₂ [ b ][ Ps∼Qs ]-cong₁)) (lr C₁ Ps∼Qs tr) lr (C₁ ∣ C₂) Ps∼Qs (par-right tr) = Σ-map (_ ∣_) (Σ-map par-right (λ b → subst (λ P → [ i ] _ ∼′ P ∣ _) (ext $ weaken-[] C₁) $ subst (λ P → [ i ] P ∣ _ ∼′ _) (ext $ weaken-[] C₁) $ weaken C₁ ∣ hole fzero [ b ][ Ps∼Qs ]-cong₁)) (lr C₂ Ps∼Qs tr) lr (C₁ ∣ C₂) Ps∼Qs (par-τ tr₁ tr₂) = Σ-zip _∣_ (Σ-zip par-τ (λ b₁ b₂ → hole fzero ∣ hole (fsuc fzero) [ b₁ ][ b₂ ]-cong₂)) (lr C₁ Ps∼Qs tr₁) (lr C₂ Ps∼Qs tr₂) lr (C₁ ⊕ C₂) Ps∼Qs (sum-left tr) = Σ-map id (Σ-map sum-left id) (lr C₁ Ps∼Qs tr) lr (C₁ ⊕ C₂) Ps∼Qs (sum-right tr) = Σ-map id (Σ-map sum-right id) (lr C₂ Ps∼Qs tr) lr (μ · C) Ps∼Qs action = _ , action , λ { .force → force C [ Ps∼Qs ]-cong₂ } lr (⟨ν a ⟩ C) Ps∼Qs (restriction a∉ tr) = Σ-map ⟨ν a ⟩ (Σ-map (restriction a∉) (λ b → ⟨ν a ⟩ (hole fzero) [ b ][ Ps∼Qs ]-cong₁)) (lr C Ps∼Qs tr) lr (! C) Ps∼Qs (replication tr) = Σ-map id (Σ-map replication id) (lr (! C ∣ C) Ps∼Qs tr) _[_]-cong₂′ : ∀ {i n Ps Qs} (C : Context ∞ n) → (∀ x → [ i ] Ps x ∼′ Qs x) → [ i ] C [ Ps ] ∼′ C [ Qs ] force (C [ Ps∼′Qs ]-cong₂′) = C [ (λ x → force (Ps∼′Qs x)) ]-cong₂ -- A variant of _[_]-cong for weakly guarded contexts. -- -- Note that the input uses the primed variant of bisimilarity. -- -- I got the idea for this lemma from Lemma 23 in Schäfer and Smolka's -- "Tower Induction and Up-to Techniques for CCS with Fixed Points". infix 5 _[_]-cong-w _[_]-cong-w : ∀ {i n Ps Qs} {C : Context ∞ n} → Weakly-guarded C → (∀ x → [ i ] Ps x ∼′ Qs x) → [ i ] C [ Ps ] ∼ C [ Qs ] ∅ [ Ps∼Qs ]-cong-w = reflexive W₁ ∣ W₂ [ Ps∼Qs ]-cong-w = (W₁ [ Ps∼Qs ]-cong-w) ∣-cong (W₂ [ Ps∼Qs ]-cong-w) action {C = C} [ Ps∼Qs ]-cong-w = refl ·-cong (force C [ Ps∼Qs ]-cong′) ⟨ν⟩ W [ Ps∼Qs ]-cong-w = ⟨ν refl ⟩-cong (W [ Ps∼Qs ]-cong-w) ! W [ Ps∼Qs ]-cong-w = !-cong (W [ Ps∼Qs ]-cong-w) W₁ ⊕ W₂ [ Ps∼Qs ]-cong-w = (W₁ [ Ps∼Qs ]-cong-w) ⊕-cong (W₂ [ Ps∼Qs ]-cong-w) -- Very strong bisimilarity is contained in bisimilarity. mutual ≡→∼ : ∀ {i P Q} → Equal i P Q → [ i ] P ∼ Q ≡→∼ ∅ = reflexive ≡→∼ (eq₁ ∣ eq₂) = ≡→∼ eq₁ ∣-cong ≡→∼ eq₂ ≡→∼ (eq₁ ⊕ eq₂) = ≡→∼ eq₁ ⊕-cong ≡→∼ eq₂ ≡→∼ (refl · eq) = refl ·-cong ≡→∼′ eq ≡→∼ (⟨ν refl ⟩ eq) = ⟨ν refl ⟩-cong (≡→∼ eq) ≡→∼ (! eq) = !-cong ≡→∼ eq ≡→∼′ : ∀ {i P Q} → Equal′ i P Q → [ i ] P ∼′ Q force (≡→∼′ eq) = ≡→∼ (force eq) ------------------------------------------------------------------------ -- Unique solutions -- If the set of equations corresponding (in a certain sense) to a -- family of weakly guarded contexts has two families of solutions, -- then those solutions are pairwise bisimilar. -- -- This result is very similar to a proposition in Milner's -- "Communication and Concurrency". mutual unique-solutions : ∀ {i n} {Ps Qs : Fin n → Proc ∞} {C : Fin n → Context ∞ n} → (∀ x → Weakly-guarded (C x)) → (∀ x → [ i ] Ps x ∼ C x [ Ps ]) → (∀ x → [ i ] Qs x ∼ C x [ Qs ]) → ∀ x → [ i ] Ps x ∼ Qs x unique-solutions {i} {Ps = Ps} {Qs} {C} w ∼C[Ps] ∼C[Qs] x = Ps x ∼⟨ ∼C[Ps] x ⟩ C x [ Ps ] ∼⟨ ∼: ⟨ lr ∼C[Ps] ∼C[Qs] , Σ-map id (Σ-map id symmetric) ∘ lr ∼C[Qs] ∼C[Ps] ⟩ ⟩ C x [ Qs ] ∼⟨ symmetric (∼C[Qs] x) ⟩■ Qs x where lr : ∀ {Ps Qs μ P} → (∀ x → [ i ] Ps x ∼ C x [ Ps ]) → (∀ x → [ i ] Qs x ∼ C x [ Qs ]) → C x [ Ps ] [ μ ]⟶ P → ∃ λ Q → C x [ Qs ] [ μ ]⟶ Q × [ i ] P ∼′ Q lr {Ps} {Qs} {μ} ∼C[Ps] ∼C[Qs] ⟶P = case 6-2-15 (C x) (w x) ⟶P of λ where (C′ , refl , trs) → C′ [ Ps ] ∼⟨ C′ [ unique-solutions′ w ∼C[Ps] ∼C[Qs] ]-cong′ ⟩■ C′ [ Qs ] [ μ ]⟵⟨ trs Qs ⟩ C x [ Qs ] unique-solutions′ : ∀ {i n} {Ps Qs : Fin n → Proc ∞} {C : Fin n → Context ∞ n} → (∀ x → Weakly-guarded (C x)) → (∀ x → [ i ] Ps x ∼ C x [ Ps ]) → (∀ x → [ i ] Qs x ∼ C x [ Qs ]) → ∀ x → [ i ] Ps x ∼′ Qs x force (unique-solutions′ w ∼C[Ps] ∼C[Qs] x) = unique-solutions w ∼C[Ps] ∼C[Qs] x -- For every family of weakly guarded contexts there is a family of -- processes that satisfies the corresponding equations. solutions-exist : ∀ {n} {C : Fin n → Context ∞ n} → (∀ x → Weakly-guarded (C x)) → ∃ λ Ps → ∀ x → Ps x ∼ C x [ Ps ] solutions-exist {n} {C} w = Ps , Ps∼ where mutual Ps : ∀ {i} → Fin n → Proc i Ps x = P₁ (w x) P₁ : ∀ {i} {C : Context ∞ n} → Weakly-guarded C → Proc i P₁ ∅ = ∅ P₁ (w₁ ∣ w₂) = P₁ w₁ ∣ P₁ w₂ P₁ (w₁ ⊕ w₂) = P₁ w₁ ⊕ P₁ w₂ P₁ (action {μ = μ} {C = C}) = μ · λ { .force → P₂ (force C) } P₁ (⟨ν⟩ {a = a} w) = ⟨ν a ⟩ (P₁ w) P₁ (! w) = ! P₁ w P₂ : ∀ {i} → Context ∞ n → Proc i P₂ (hole x) = Ps x P₂ ∅ = ∅ P₂ (C₁ ∣ C₂) = P₂ C₁ ∣ P₂ C₂ P₂ (C₁ ⊕ C₂) = P₂ C₁ ⊕ P₂ C₂ P₂ (μ · C) = μ · λ { .force → P₂ (force C) } P₂ (⟨ν a ⟩ C) = ⟨ν a ⟩ (P₂ C) P₂ (! C) = ! P₂ C P₂∼ : ∀ {i} (C : Context ∞ n) → [ i ] P₂ C ∼ C [ Ps ] P₂∼ (hole x) = reflexive P₂∼ ∅ = reflexive P₂∼ (C₁ ∣ C₂) = P₂∼ C₁ ∣-cong P₂∼ C₂ P₂∼ (C₁ ⊕ C₂) = P₂∼ C₁ ⊕-cong P₂∼ C₂ P₂∼ (μ · C) = refl ·-cong λ { .force → P₂∼ (force C) } P₂∼ (⟨ν a ⟩ C) = ⟨ν refl ⟩-cong (P₂∼ C) P₂∼ (! C) = !-cong P₂∼ C P₁∼ : {C : Context ∞ n} (w : Weakly-guarded C) → P₁ w ∼ C [ Ps ] P₁∼ ∅ = reflexive P₁∼ (w₁ ∣ w₂) = P₁∼ w₁ ∣-cong P₁∼ w₂ P₁∼ (w₁ ⊕ w₂) = P₁∼ w₁ ⊕-cong P₁∼ w₂ P₁∼ (action {C = C}) = refl ·-cong λ { .force → P₂∼ (force C) } P₁∼ (⟨ν⟩ {a = a} w) = ⟨ν refl ⟩-cong (P₁∼ w) P₁∼ (! w) = !-cong P₁∼ w Ps∼ : ∀ x → Ps x ∼ C x [ Ps ] Ps∼ x = P₁∼ (w x) ------------------------------------------------------------------------ -- Some lemmas related to _⊕_ -- _⊕_ is idempotent. ⊕-idempotent : ∀ {P} → P ⊕ P ∼ P ⊕-idempotent {P} = ⟨ lr , (λ {R} P⟶R → P ⊕ P ⟶⟨ sum-left P⟶R ⟩ʳˡ R ∼⟨ ∼′: reflexive ⟩■ R) ⟩ where lr : ∀ {Q μ} → P ⊕ P [ μ ]⟶ Q → ∃ λ R → P [ μ ]⟶ R × Q ∼′ R lr {Q} (sum-left P⟶Q) = Q ∼⟨ ∼′: reflexive ⟩■ Q ⟵⟨ P⟶Q ⟩ P lr {Q} (sum-right P⟶Q) = Q ∼⟨ ∼′: reflexive ⟩■ Q ⟵⟨ P⟶Q ⟩ P ⊕-idempotent′ : ∀ {P} → P ⊕ P ∼′ P force ⊕-idempotent′ = ⊕-idempotent -- _⊕_ is commutative. ⊕-comm : ∀ {P Q} → P ⊕ Q ∼ Q ⊕ P ⊕-comm = ⟨ lr , Σ-map id (Σ-map id symmetric) ∘ lr ⟩ where lr : ∀ {P Q R μ} → P ⊕ Q [ μ ]⟶ R → ∃ λ R′ → Q ⊕ P [ μ ]⟶ R′ × R ∼′ R′ lr {P} {Q} {R} = λ where (sum-left P⟶R) → R ■ ⟵⟨ sum-right P⟶R ⟩ Q ⊕ P (sum-right Q⟶R) → R ■ ⟵⟨ sum-left Q⟶R ⟩ Q ⊕ P
1-base/lace/source/events/interface/lace-response.ads
charlie5/lace
20
29256
<reponame>charlie5/lace with lace.Event; package lace.Response -- -- Provides a base class for all derived event 'response' classes. -- is pragma remote_Types; type Item is abstract tagged limited private; type View is access all Item'class; -- Attributes -- function Name (Self : in Item) return String; -- Operations -- procedure respond (Self : in out Item; to_Event : in Event.item'Class) is abstract; private type Item is abstract tagged limited null record; end lace.Response;
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt4.adb
best08618/asylo
7
24841
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/opt4.adb -- { dg-do run } -- { dg-options "-O2" } procedure Opt4 is type Rec (D : Natural) is record S : String (1..D); end record; procedure Test (R : Rec) is begin if R.D /= 9 then raise Program_Error; end if; end; R : Rec(9); begin R := (9, "123456789"); Test (R); end;
Delay.agda
jmchapman/Relative-Monads
21
1100
{-# OPTIONS --copatterns --sized-types #-} -- {-# OPTIONS --show-implicit #-} -- {-# OPTIONS -v tc.conv:10 -v tc.conv.size:15 #-} module Delay where --open import Library open import Size open import Category.Monad open import Level renaming (zero to lzero; suc to lsuc) open import Relation.Binary public import Relation.Binary.PreorderReasoning module Pre = Relation.Binary.PreorderReasoning open import Data.Product -- Coinductive delay monad. mutual data Delay (A : Set) (i : Size) : Set where now : A → Delay A i later : ∞Delay A i → Delay A i record ∞Delay (A : Set) (i : Size) : Set where coinductive constructor delay field force : {j : Size< i} → Delay A j open ∞Delay public -- Smart constructor. later! : ∀ {A i} → Delay A i → Delay A (↑ i) later! x = later (delay x) -- Monad instance. module Bind where mutual _>>=_ : ∀ {i A B} → Delay A i → (A → Delay B i) → Delay B i now x >>= f = f x later x >>= f = later (x ∞>>= f) _∞>>=_ : ∀ {i A B} → ∞Delay A i → (A → Delay B i) → ∞Delay B i force (x ∞>>= f) = force x >>= f delayMonad : ∀ {i} → RawMonad {f = lzero} (λ A → Delay A i) delayMonad {i} = record { return = now ; _>>=_ = _>>=_ {i} } where open Bind module _ {i : Size} where open module DelayMonad = RawMonad (delayMonad {i = i}) public renaming (_⊛_ to _<*>_) open Bind public using (_∞>>=_) -- Map for ∞Delay _∞<$>_ : ∀ {i A B} (f : A → B) (∞a : ∞Delay A i) → ∞Delay B i f ∞<$> ∞a = ∞a ∞>>= λ a → return (f a) -- force (f ∞<$> ∞a) = f <$> force ∞a -- Double bind _=<<2_,_ : ∀ {i A B C} → (A → B → Delay C i) → Delay A i → Delay B i → Delay C i f =<<2 x , y = x >>= λ a → y >>= λ b → f a b -- Strong bisimilarity mutual data _~_ {i : Size} {A : Set} : (a? b? : Delay A ∞) → Set where ~now : ∀ a → now a ~ now a ~later : ∀ {a∞ b∞} (eq : _∞~_ {i} a∞ b∞) → later a∞ ~ later b∞ record _∞~_ {i : Size} {A : Set} (a∞ b∞ : ∞Delay A ∞) : Set where coinductive constructor ~delay field ~force : {j : Size< i} → _~_ {j} (force a∞) (force b∞) open _∞~_ public -- Reflexivity mutual ~refl : ∀ {i A} (a? : Delay A ∞) → _~_ {i} a? a? ~refl (now a) = ~now a ~refl (later a∞) = ~later (∞~refl a∞) ∞~refl : ∀ {i A} (a∞ : ∞Delay A ∞) → _∞~_ {i} a∞ a∞ ~force (∞~refl a∞) = ~refl (force a∞) -- Symmetry mutual ~sym : ∀ {i A} {a? b? : Delay A ∞} → _~_ {i} a? b? → _~_ {i} b? a? ~sym (~now a) = ~now a ~sym (~later eq) = ~later (∞~sym eq) ∞~sym : ∀ {i A} {a? b? : ∞Delay A ∞} → _∞~_ {i} a? b? → _∞~_ {i} b? a? ~force (∞~sym eq) = ~sym (~force eq) -- Transitivity mutual ~trans : ∀ {i A} {a? b? c? : Delay A ∞} (eq : _~_ {i} a? b?) (eq' : _~_ {i} b? c?) → _~_ {i} a? c? ~trans (~now a) (~now .a) = ~now a ~trans (~later eq) (~later eq') = ~later (∞~trans eq eq') ∞~trans : ∀ {i A} {a∞ b∞ c∞ : ∞Delay A ∞} (eq : _∞~_ {i} a∞ b∞) (eq' : _∞~_ {i} b∞ c∞) → _∞~_ {i} a∞ c∞ ~force (∞~trans eq eq') = ~trans (~force eq) (~force eq') -- Equality reasoning ~setoid : (i : Size) (A : Set) → Setoid lzero lzero ~setoid i A = record { Carrier = Delay A ∞ ; _≈_ = _~_ {i} ; isEquivalence = record { refl = λ {a?} → ~refl a? ; sym = ~sym ; trans = ~trans } } module ~-Reasoning {i : Size} {A : Set} where open Pre (Setoid.preorder (~setoid i A)) public -- using (begin_; _∎) (_≈⟨⟩_ to _~⟨⟩_; _≈⟨_⟩_ to _~⟨_⟩_) renaming (_≈⟨⟩_ to _≡⟨⟩_; _≈⟨_⟩_ to _≡⟨_⟩_; _∼⟨_⟩_ to _~⟨_⟩_; begin_ to proof_) ∞~setoid : (i : Size) (A : Set) → Setoid lzero lzero ∞~setoid i A = record { Carrier = ∞Delay A ∞ ; _≈_ = _∞~_ {i} ; isEquivalence = record { refl = λ {a?} → ∞~refl a? ; sym = ∞~sym ; trans = ∞~trans } } module ∞~-Reasoning {i : Size} {A : Set} where open Pre (Setoid.preorder (∞~setoid i A)) public -- using (begin_; _∎) (_≈⟨⟩_ to _~⟨⟩_; _≈⟨_⟩_ to _~⟨_⟩_) renaming (_≈⟨⟩_ to _≡⟨⟩_; _≈⟨_⟩_ to _≡⟨_⟩_; _∼⟨_⟩_ to _∞~⟨_⟩_; begin_ to proof_) -- Congruence laws. mutual bind-cong-l : ∀ {i A B} {a? b? : Delay A ∞} (eq : _~_ {i} a? b?) (k : A → Delay B ∞) → _~_ {i} (a? >>= k) (b? >>= k) bind-cong-l (~now a) k = ~refl _ bind-cong-l (~later eq) k = ~later (∞bind-cong-l eq k) ∞bind-cong-l : ∀ {i A B} {a∞ b∞ : ∞Delay A ∞} (eq : _∞~_ {i} a∞ b∞) → (k : A → Delay B ∞) → _∞~_ {i} (a∞ ∞>>= k) (b∞ ∞>>= k) ~force (∞bind-cong-l eq k) = bind-cong-l (~force eq) k _>>=l_ = bind-cong-l mutual bind-cong-r : ∀ {i A B} (a? : Delay A ∞) {k l : A → Delay B ∞} → (h : ∀ a → _~_ {i} (k a) (l a)) → _~_ {i} (a? >>= k) (a? >>= l) bind-cong-r (now a) h = h a bind-cong-r (later a∞) h = ~later (∞bind-cong-r a∞ h) ∞bind-cong-r : ∀ {i A B} (a∞ : ∞Delay A ∞) {k l : A → Delay B ∞} → (h : ∀ a → _~_ {i} (k a) (l a)) → _∞~_ {i} (a∞ ∞>>= k) (a∞ ∞>>= l) ~force (∞bind-cong-r a∞ h) = bind-cong-r (force a∞) h _>>=r_ = bind-cong-r mutual bind-cong : ∀ {i A B} {a? b? : Delay A ∞} (eq : _~_ {i} a? b?) {k l : A → Delay B ∞} (h : ∀ a → _~_ {i} (k a) (l a)) → _~_ {i} (a? >>= k) (b? >>= l) bind-cong (~now a) h = h a bind-cong (~later eq) h = ~later (∞bind-cong eq h) ∞bind-cong : ∀ {i A B} {a∞ b∞ : ∞Delay A ∞} (eq : _∞~_ {i} a∞ b∞) {k l : A → Delay B ∞} (h : ∀ a → _~_ {i} (k a) (l a)) → _∞~_ {i} (a∞ ∞>>= k) (b∞ ∞>>= l) ~force (∞bind-cong eq h) = bind-cong (~force eq) h _~>>=_ = bind-cong -- Monad laws. mutual bind-assoc : ∀{i A B C}(m : Delay A ∞) {k : A → Delay B ∞}{l : B → Delay C ∞} → _~_ {i} ((m >>= k) >>= l) (m >>= λ a → k a >>= l) bind-assoc (now a) = ~refl _ bind-assoc (later a∞) = ~later (∞bind-assoc a∞) ∞bind-assoc : ∀{i A B C}(a∞ : ∞Delay A ∞) {k : A → Delay B ∞}{l : B → Delay C ∞} → _∞~_ {i} ((a∞ ∞>>= λ a → k a) ∞>>= l) (a∞ ∞>>= λ a → k a >>= l) ~force (∞bind-assoc a∞) = bind-assoc (force a∞) -- Termination/Convergence. Makes sense only for Delay A ∞. data _⇓_ {A : Set} : (a? : Delay A ∞) (a : A) → Set where now⇓ : ∀ {a} → now a ⇓ a later⇓ : ∀ {a} {a∞ : ∞Delay A ∞} → force a∞ ⇓ a → later a∞ ⇓ a _⇓ : {A : Set} (x : Delay A ∞) → Set x ⇓ = ∃ λ a → x ⇓ a -- Monotonicity. map⇓ : ∀ {A B} {a : A} {a? : Delay A ∞} (f : A → B) (a⇓ : a? ⇓ a) → (f <$> a?) ⇓ f a map⇓ f now⇓ = now⇓ map⇓ f (later⇓ a⇓) = later⇓ (map⇓ f a⇓) -- some lemmas about convergence subst~⇓ : ∀{A}{t t' : Delay A ∞}{n : A} → t ⇓ n → t ~ t' → t' ⇓ n subst~⇓ now⇓ (~now a) = now⇓ subst~⇓ (later⇓ p) (~later eq) = later⇓ (subst~⇓ p (~force eq)) -- this should also hold for weak bisimularity right? {- subst≈⇓ : ∀{A}{t t' : Delay A ∞}{n : A} → t ⇓ n → t ≈ t' → t' ⇓ n subst≈⇓ = ? -} ⇓>>= : ∀{A B}(f : A → Delay B ∞) {?a : Delay A ∞}{a : A} → ?a ⇓ a → {b : B} → (?a >>= f) ⇓ b → f a ⇓ b ⇓>>= f now⇓ q = q ⇓>>= f (later⇓ p) (later⇓ q) = ⇓>>= f p q >>=⇓ : ∀{A B}(f : A → Delay B ∞) {?a : Delay A ∞}{a : A} → ?a ⇓ a → {b : B} → f a ⇓ b → (?a >>= f) ⇓ b >>=⇓ f now⇓ q = q >>=⇓ f (later⇓ p) q = later⇓ (>>=⇓ f p q) -- handy when you can't pattern match like in a let definition unlater : ∀{A}{∞a : ∞Delay A ∞}{a : A} → later ∞a ⇓ a → force ∞a ⇓ a unlater (later⇓ p) = p {- mutual _⇓_ : {A : Set} {i : Size} (x : Delay A i) (a : A) → Set x ⇓ a = Terminates a x data Terminates {A : Set} {i : Size} (a : A) : Delay A i → Set where now : now a ⇓ a later : ∀ {x : ∞Delay A i} → (force x {j = ?}) ⇓ a → later x ⇓ a mutual cast : ∀ {A i} → Delay A i → (j : Size< ↑ i) → Delay A j cast (now x) j = now x cast (later x) j = {!later (∞cast x j)!} ∞cast : ∀ {A i} → ∞Delay A i → (j : Size< ↑ i) → ∞Delay A j ♭ (∞cast x j) {k} = cast {i = j} (♭ x) k -}
test.asm
jedbrooke/RISCV-CPU
0
18530
<reponame>jedbrooke/RISCV-CPU addi x9, x0, 0 addi x10, x0, 800 addi x11, x0, 1600 addi x1, x0, 100 beq x1, x0, 44 lw x2, 0(x9) lw x3, 0(x10) addi x9, x9, 8 addi x10, x10, 8 add x4, x2, x3 slli x4, x4, 4 sw x4,0(x11) addi x11, x11, 8 addi x1, x1, -1 jal x0, -40 addi x20, x0, 100
sh.asm
tphan022/CS153assn2_p1
0
90643
_sh: file format elf32-i386 Disassembly of section .text: 00000000 <runcmd>: struct cmd *parsecmd(char*); // Execute cmd. Never returns. void runcmd(struct cmd *cmd) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 38 sub $0x38,%esp struct execcmd *ecmd; struct listcmd *lcmd; struct pipecmd *pcmd; struct redircmd *rcmd; if(cmd == 0) 6: 83 7d 08 00 cmpl $0x0,0x8(%ebp) a: 75 05 jne 11 <runcmd+0x11> exit(); c: e8 4b 0f 00 00 call f5c <exit> switch(cmd->type){ 11: 8b 45 08 mov 0x8(%ebp),%eax 14: 8b 00 mov (%eax),%eax 16: 83 f8 05 cmp $0x5,%eax 19: 77 09 ja 24 <runcmd+0x24> 1b: 8b 04 85 5c 17 00 00 mov 0x175c(,%eax,4),%eax 22: ff e0 jmp *%eax default: panic("runcmd"); 24: c7 04 24 30 17 00 00 movl $0x1730,(%esp) 2b: e8 29 03 00 00 call 359 <panic> case EXEC: ecmd = (struct execcmd*)cmd; 30: 8b 45 08 mov 0x8(%ebp),%eax 33: 89 45 e8 mov %eax,-0x18(%ebp) if(ecmd->argv[0] == 0) 36: 8b 45 e8 mov -0x18(%ebp),%eax 39: 8b 40 04 mov 0x4(%eax),%eax 3c: 85 c0 test %eax,%eax 3e: 75 05 jne 45 <runcmd+0x45> exit(); 40: e8 17 0f 00 00 call f5c <exit> exec(ecmd->argv[0], ecmd->argv); 45: 8b 45 e8 mov -0x18(%ebp),%eax 48: 8d 50 04 lea 0x4(%eax),%edx 4b: 8b 45 e8 mov -0x18(%ebp),%eax 4e: 8b 40 04 mov 0x4(%eax),%eax 51: 89 54 24 04 mov %edx,0x4(%esp) 55: 89 04 24 mov %eax,(%esp) 58: e8 37 0f 00 00 call f94 <exec> printf(2, "exec %s failed\n", ecmd->argv[0]); 5d: 8b 45 e8 mov -0x18(%ebp),%eax 60: 8b 40 04 mov 0x4(%eax),%eax 63: 89 44 24 08 mov %eax,0x8(%esp) 67: c7 44 24 04 37 17 00 movl $0x1737,0x4(%esp) 6e: 00 6f: c7 04 24 02 00 00 00 movl $0x2,(%esp) 76: e8 7a 10 00 00 call 10f5 <printf> break; 7b: e9 83 01 00 00 jmp 203 <runcmd+0x203> case REDIR: rcmd = (struct redircmd*)cmd; 80: 8b 45 08 mov 0x8(%ebp),%eax 83: 89 45 f4 mov %eax,-0xc(%ebp) close(rcmd->fd); 86: 8b 45 f4 mov -0xc(%ebp),%eax 89: 8b 40 14 mov 0x14(%eax),%eax 8c: 89 04 24 mov %eax,(%esp) 8f: e8 f0 0e 00 00 call f84 <close> if(open(rcmd->file, rcmd->mode) < 0){ 94: 8b 45 f4 mov -0xc(%ebp),%eax 97: 8b 50 10 mov 0x10(%eax),%edx 9a: 8b 45 f4 mov -0xc(%ebp),%eax 9d: 8b 40 08 mov 0x8(%eax),%eax a0: 89 54 24 04 mov %edx,0x4(%esp) a4: 89 04 24 mov %eax,(%esp) a7: e8 f0 0e 00 00 call f9c <open> ac: 85 c0 test %eax,%eax ae: 79 23 jns d3 <runcmd+0xd3> printf(2, "open %s failed\n", rcmd->file); b0: 8b 45 f4 mov -0xc(%ebp),%eax b3: 8b 40 08 mov 0x8(%eax),%eax b6: 89 44 24 08 mov %eax,0x8(%esp) ba: c7 44 24 04 47 17 00 movl $0x1747,0x4(%esp) c1: 00 c2: c7 04 24 02 00 00 00 movl $0x2,(%esp) c9: e8 27 10 00 00 call 10f5 <printf> exit(); ce: e8 89 0e 00 00 call f5c <exit> } runcmd(rcmd->cmd); d3: 8b 45 f4 mov -0xc(%ebp),%eax d6: 8b 40 04 mov 0x4(%eax),%eax d9: 89 04 24 mov %eax,(%esp) dc: e8 1f ff ff ff call 0 <runcmd> break; e1: e9 1d 01 00 00 jmp 203 <runcmd+0x203> case LIST: lcmd = (struct listcmd*)cmd; e6: 8b 45 08 mov 0x8(%ebp),%eax e9: 89 45 ec mov %eax,-0x14(%ebp) if(fork1() == 0) ec: e8 8e 02 00 00 call 37f <fork1> f1: 85 c0 test %eax,%eax f3: 75 0e jne 103 <runcmd+0x103> runcmd(lcmd->left); f5: 8b 45 ec mov -0x14(%ebp),%eax f8: 8b 40 04 mov 0x4(%eax),%eax fb: 89 04 24 mov %eax,(%esp) fe: e8 fd fe ff ff call 0 <runcmd> wait(); 103: e8 5c 0e 00 00 call f64 <wait> runcmd(lcmd->right); 108: 8b 45 ec mov -0x14(%ebp),%eax 10b: 8b 40 08 mov 0x8(%eax),%eax 10e: 89 04 24 mov %eax,(%esp) 111: e8 ea fe ff ff call 0 <runcmd> break; 116: e9 e8 00 00 00 jmp 203 <runcmd+0x203> case PIPE: pcmd = (struct pipecmd*)cmd; 11b: 8b 45 08 mov 0x8(%ebp),%eax 11e: 89 45 f0 mov %eax,-0x10(%ebp) if(pipe(p) < 0) 121: 8d 45 dc lea -0x24(%ebp),%eax 124: 89 04 24 mov %eax,(%esp) 127: e8 40 0e 00 00 call f6c <pipe> 12c: 85 c0 test %eax,%eax 12e: 79 0c jns 13c <runcmd+0x13c> panic("pipe"); 130: c7 04 24 57 17 00 00 movl $0x1757,(%esp) 137: e8 1d 02 00 00 call 359 <panic> if(fork1() == 0){ 13c: e8 3e 02 00 00 call 37f <fork1> 141: 85 c0 test %eax,%eax 143: 75 3b jne 180 <runcmd+0x180> close(1); 145: c7 04 24 01 00 00 00 movl $0x1,(%esp) 14c: e8 33 0e 00 00 call f84 <close> dup(p[1]); 151: 8b 45 e0 mov -0x20(%ebp),%eax 154: 89 04 24 mov %eax,(%esp) 157: e8 78 0e 00 00 call fd4 <dup> close(p[0]); 15c: 8b 45 dc mov -0x24(%ebp),%eax 15f: 89 04 24 mov %eax,(%esp) 162: e8 1d 0e 00 00 call f84 <close> close(p[1]); 167: 8b 45 e0 mov -0x20(%ebp),%eax 16a: 89 04 24 mov %eax,(%esp) 16d: e8 12 0e 00 00 call f84 <close> runcmd(pcmd->left); 172: 8b 45 f0 mov -0x10(%ebp),%eax 175: 8b 40 04 mov 0x4(%eax),%eax 178: 89 04 24 mov %eax,(%esp) 17b: e8 80 fe ff ff call 0 <runcmd> } if(fork1() == 0){ 180: e8 fa 01 00 00 call 37f <fork1> 185: 85 c0 test %eax,%eax 187: 75 3b jne 1c4 <runcmd+0x1c4> close(0); 189: c7 04 24 00 00 00 00 movl $0x0,(%esp) 190: e8 ef 0d 00 00 call f84 <close> dup(p[0]); 195: 8b 45 dc mov -0x24(%ebp),%eax 198: 89 04 24 mov %eax,(%esp) 19b: e8 34 0e 00 00 call fd4 <dup> close(p[0]); 1a0: 8b 45 dc mov -0x24(%ebp),%eax 1a3: 89 04 24 mov %eax,(%esp) 1a6: e8 d9 0d 00 00 call f84 <close> close(p[1]); 1ab: 8b 45 e0 mov -0x20(%ebp),%eax 1ae: 89 04 24 mov %eax,(%esp) 1b1: e8 ce 0d 00 00 call f84 <close> runcmd(pcmd->right); 1b6: 8b 45 f0 mov -0x10(%ebp),%eax 1b9: 8b 40 08 mov 0x8(%eax),%eax 1bc: 89 04 24 mov %eax,(%esp) 1bf: e8 3c fe ff ff call 0 <runcmd> } close(p[0]); 1c4: 8b 45 dc mov -0x24(%ebp),%eax 1c7: 89 04 24 mov %eax,(%esp) 1ca: e8 b5 0d 00 00 call f84 <close> close(p[1]); 1cf: 8b 45 e0 mov -0x20(%ebp),%eax 1d2: 89 04 24 mov %eax,(%esp) 1d5: e8 aa 0d 00 00 call f84 <close> wait(); 1da: e8 85 0d 00 00 call f64 <wait> wait(); 1df: e8 80 0d 00 00 call f64 <wait> break; 1e4: eb 1d jmp 203 <runcmd+0x203> case BACK: bcmd = (struct backcmd*)cmd; 1e6: 8b 45 08 mov 0x8(%ebp),%eax 1e9: 89 45 e4 mov %eax,-0x1c(%ebp) if(fork1() == 0) 1ec: e8 8e 01 00 00 call 37f <fork1> 1f1: 85 c0 test %eax,%eax 1f3: 75 0e jne 203 <runcmd+0x203> runcmd(bcmd->cmd); 1f5: 8b 45 e4 mov -0x1c(%ebp),%eax 1f8: 8b 40 04 mov 0x4(%eax),%eax 1fb: 89 04 24 mov %eax,(%esp) 1fe: e8 fd fd ff ff call 0 <runcmd> break; } exit(); 203: e8 54 0d 00 00 call f5c <exit> 00000208 <getcmd>: } int getcmd(char *buf, int nbuf) { 208: 55 push %ebp 209: 89 e5 mov %esp,%ebp 20b: 83 ec 18 sub $0x18,%esp printf(2, "$ "); 20e: c7 44 24 04 74 17 00 movl $0x1774,0x4(%esp) 215: 00 216: c7 04 24 02 00 00 00 movl $0x2,(%esp) 21d: e8 d3 0e 00 00 call 10f5 <printf> memset(buf, 0, nbuf); 222: 8b 45 0c mov 0xc(%ebp),%eax 225: 89 44 24 08 mov %eax,0x8(%esp) 229: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 230: 00 231: 8b 45 08 mov 0x8(%ebp),%eax 234: 89 04 24 mov %eax,(%esp) 237: e8 7a 0b 00 00 call db6 <memset> gets(buf, nbuf); 23c: 8b 45 0c mov 0xc(%ebp),%eax 23f: 89 44 24 04 mov %eax,0x4(%esp) 243: 8b 45 08 mov 0x8(%ebp),%eax 246: 89 04 24 mov %eax,(%esp) 249: e8 bf 0b 00 00 call e0d <gets> if(buf[0] == 0) // EOF 24e: 8b 45 08 mov 0x8(%ebp),%eax 251: 0f b6 00 movzbl (%eax),%eax 254: 84 c0 test %al,%al 256: 75 07 jne 25f <getcmd+0x57> return -1; 258: b8 ff ff ff ff mov $0xffffffff,%eax 25d: eb 05 jmp 264 <getcmd+0x5c> return 0; 25f: b8 00 00 00 00 mov $0x0,%eax } 264: c9 leave 265: c3 ret 00000266 <main>: int main(void) { 266: 55 push %ebp 267: 89 e5 mov %esp,%ebp 269: 83 e4 f0 and $0xfffffff0,%esp 26c: 83 ec 20 sub $0x20,%esp static char buf[100]; int fd; // Assumes three file descriptors open. while((fd = open("console", O_RDWR)) >= 0){ 26f: eb 19 jmp 28a <main+0x24> if(fd >= 3){ 271: 83 7c 24 1c 02 cmpl $0x2,0x1c(%esp) 276: 7e 12 jle 28a <main+0x24> close(fd); 278: 8b 44 24 1c mov 0x1c(%esp),%eax 27c: 89 04 24 mov %eax,(%esp) 27f: e8 00 0d 00 00 call f84 <close> break; 284: 90 nop } } // Read and run input commands. while(getcmd(buf, sizeof(buf)) >= 0){ 285: e9 ae 00 00 00 jmp 338 <main+0xd2> { static char buf[100]; int fd; // Assumes three file descriptors open. while((fd = open("console", O_RDWR)) >= 0){ 28a: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp) 291: 00 292: c7 04 24 77 17 00 00 movl $0x1777,(%esp) 299: e8 fe 0c 00 00 call f9c <open> 29e: 89 44 24 1c mov %eax,0x1c(%esp) 2a2: 83 7c 24 1c 00 cmpl $0x0,0x1c(%esp) 2a7: 79 c8 jns 271 <main+0xb> break; } } // Read and run input commands. while(getcmd(buf, sizeof(buf)) >= 0){ 2a9: e9 8a 00 00 00 jmp 338 <main+0xd2> if(buf[0] == 'c' && buf[1] == 'd' && buf[2] == ' '){ 2ae: 0f b6 05 80 18 00 00 movzbl 0x1880,%eax 2b5: 3c 63 cmp $0x63,%al 2b7: 75 5a jne 313 <main+0xad> 2b9: 0f b6 05 81 18 00 00 movzbl 0x1881,%eax 2c0: 3c 64 cmp $0x64,%al 2c2: 75 4f jne 313 <main+0xad> 2c4: 0f b6 05 82 18 00 00 movzbl 0x1882,%eax 2cb: 3c 20 cmp $0x20,%al 2cd: 75 44 jne 313 <main+0xad> // Clumsy but will have to do for now. // Chdir has no effect on the parent if run in the child. buf[strlen(buf)-1] = 0; // chop \n 2cf: c7 04 24 80 18 00 00 movl $0x1880,(%esp) 2d6: e8 b6 0a 00 00 call d91 <strlen> 2db: 83 e8 01 sub $0x1,%eax 2de: c6 80 80 18 00 00 00 movb $0x0,0x1880(%eax) if(chdir(buf+3) < 0) 2e5: c7 04 24 83 18 00 00 movl $0x1883,(%esp) 2ec: e8 db 0c 00 00 call fcc <chdir> 2f1: 85 c0 test %eax,%eax 2f3: 79 42 jns 337 <main+0xd1> printf(2, "cannot cd %s\n", buf+3); 2f5: c7 44 24 08 83 18 00 movl $0x1883,0x8(%esp) 2fc: 00 2fd: c7 44 24 04 7f 17 00 movl $0x177f,0x4(%esp) 304: 00 305: c7 04 24 02 00 00 00 movl $0x2,(%esp) 30c: e8 e4 0d 00 00 call 10f5 <printf> continue; 311: eb 25 jmp 338 <main+0xd2> } if(fork1() == 0) 313: e8 67 00 00 00 call 37f <fork1> 318: 85 c0 test %eax,%eax 31a: 75 14 jne 330 <main+0xca> runcmd(parsecmd(buf)); 31c: c7 04 24 80 18 00 00 movl $0x1880,(%esp) 323: e8 c6 03 00 00 call 6ee <parsecmd> 328: 89 04 24 mov %eax,(%esp) 32b: e8 d0 fc ff ff call 0 <runcmd> wait(); 330: e8 2f 0c 00 00 call f64 <wait> 335: eb 01 jmp 338 <main+0xd2> // Clumsy but will have to do for now. // Chdir has no effect on the parent if run in the child. buf[strlen(buf)-1] = 0; // chop \n if(chdir(buf+3) < 0) printf(2, "cannot cd %s\n", buf+3); continue; 337: 90 nop break; } } // Read and run input commands. while(getcmd(buf, sizeof(buf)) >= 0){ 338: c7 44 24 04 64 00 00 movl $0x64,0x4(%esp) 33f: 00 340: c7 04 24 80 18 00 00 movl $0x1880,(%esp) 347: e8 bc fe ff ff call 208 <getcmd> 34c: 85 c0 test %eax,%eax 34e: 0f 89 5a ff ff ff jns 2ae <main+0x48> } if(fork1() == 0) runcmd(parsecmd(buf)); wait(); } exit(); 354: e8 03 0c 00 00 call f5c <exit> 00000359 <panic>: } void panic(char *s) { 359: 55 push %ebp 35a: 89 e5 mov %esp,%ebp 35c: 83 ec 18 sub $0x18,%esp printf(2, "%s\n", s); 35f: 8b 45 08 mov 0x8(%ebp),%eax 362: 89 44 24 08 mov %eax,0x8(%esp) 366: c7 44 24 04 8d 17 00 movl $0x178d,0x4(%esp) 36d: 00 36e: c7 04 24 02 00 00 00 movl $0x2,(%esp) 375: e8 7b 0d 00 00 call 10f5 <printf> exit(); 37a: e8 dd 0b 00 00 call f5c <exit> 0000037f <fork1>: } int fork1(void) { 37f: 55 push %ebp 380: 89 e5 mov %esp,%ebp 382: 83 ec 28 sub $0x28,%esp int pid; pid = fork(); 385: e8 ca 0b 00 00 call f54 <fork> 38a: 89 45 f4 mov %eax,-0xc(%ebp) if(pid == -1) 38d: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 391: 75 0c jne 39f <fork1+0x20> panic("fork"); 393: c7 04 24 91 17 00 00 movl $0x1791,(%esp) 39a: e8 ba ff ff ff call 359 <panic> return pid; 39f: 8b 45 f4 mov -0xc(%ebp),%eax } 3a2: c9 leave 3a3: c3 ret 000003a4 <execcmd>: //PAGEBREAK! // Constructors struct cmd* execcmd(void) { 3a4: 55 push %ebp 3a5: 89 e5 mov %esp,%ebp 3a7: 83 ec 28 sub $0x28,%esp struct execcmd *cmd; cmd = malloc(sizeof(*cmd)); 3aa: c7 04 24 54 00 00 00 movl $0x54,(%esp) 3b1: e8 25 10 00 00 call 13db <malloc> 3b6: 89 45 f4 mov %eax,-0xc(%ebp) memset(cmd, 0, sizeof(*cmd)); 3b9: c7 44 24 08 54 00 00 movl $0x54,0x8(%esp) 3c0: 00 3c1: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 3c8: 00 3c9: 8b 45 f4 mov -0xc(%ebp),%eax 3cc: 89 04 24 mov %eax,(%esp) 3cf: e8 e2 09 00 00 call db6 <memset> cmd->type = EXEC; 3d4: 8b 45 f4 mov -0xc(%ebp),%eax 3d7: c7 00 01 00 00 00 movl $0x1,(%eax) return (struct cmd*)cmd; 3dd: 8b 45 f4 mov -0xc(%ebp),%eax } 3e0: c9 leave 3e1: c3 ret 000003e2 <redircmd>: struct cmd* redircmd(struct cmd *subcmd, char *file, char *efile, int mode, int fd) { 3e2: 55 push %ebp 3e3: 89 e5 mov %esp,%ebp 3e5: 83 ec 28 sub $0x28,%esp struct redircmd *cmd; cmd = malloc(sizeof(*cmd)); 3e8: c7 04 24 18 00 00 00 movl $0x18,(%esp) 3ef: e8 e7 0f 00 00 call 13db <malloc> 3f4: 89 45 f4 mov %eax,-0xc(%ebp) memset(cmd, 0, sizeof(*cmd)); 3f7: c7 44 24 08 18 00 00 movl $0x18,0x8(%esp) 3fe: 00 3ff: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 406: 00 407: 8b 45 f4 mov -0xc(%ebp),%eax 40a: 89 04 24 mov %eax,(%esp) 40d: e8 a4 09 00 00 call db6 <memset> cmd->type = REDIR; 412: 8b 45 f4 mov -0xc(%ebp),%eax 415: c7 00 02 00 00 00 movl $0x2,(%eax) cmd->cmd = subcmd; 41b: 8b 45 f4 mov -0xc(%ebp),%eax 41e: 8b 55 08 mov 0x8(%ebp),%edx 421: 89 50 04 mov %edx,0x4(%eax) cmd->file = file; 424: 8b 45 f4 mov -0xc(%ebp),%eax 427: 8b 55 0c mov 0xc(%ebp),%edx 42a: 89 50 08 mov %edx,0x8(%eax) cmd->efile = efile; 42d: 8b 45 f4 mov -0xc(%ebp),%eax 430: 8b 55 10 mov 0x10(%ebp),%edx 433: 89 50 0c mov %edx,0xc(%eax) cmd->mode = mode; 436: 8b 45 f4 mov -0xc(%ebp),%eax 439: 8b 55 14 mov 0x14(%ebp),%edx 43c: 89 50 10 mov %edx,0x10(%eax) cmd->fd = fd; 43f: 8b 45 f4 mov -0xc(%ebp),%eax 442: 8b 55 18 mov 0x18(%ebp),%edx 445: 89 50 14 mov %edx,0x14(%eax) return (struct cmd*)cmd; 448: 8b 45 f4 mov -0xc(%ebp),%eax } 44b: c9 leave 44c: c3 ret 0000044d <pipecmd>: struct cmd* pipecmd(struct cmd *left, struct cmd *right) { 44d: 55 push %ebp 44e: 89 e5 mov %esp,%ebp 450: 83 ec 28 sub $0x28,%esp struct pipecmd *cmd; cmd = malloc(sizeof(*cmd)); 453: c7 04 24 0c 00 00 00 movl $0xc,(%esp) 45a: e8 7c 0f 00 00 call 13db <malloc> 45f: 89 45 f4 mov %eax,-0xc(%ebp) memset(cmd, 0, sizeof(*cmd)); 462: c7 44 24 08 0c 00 00 movl $0xc,0x8(%esp) 469: 00 46a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 471: 00 472: 8b 45 f4 mov -0xc(%ebp),%eax 475: 89 04 24 mov %eax,(%esp) 478: e8 39 09 00 00 call db6 <memset> cmd->type = PIPE; 47d: 8b 45 f4 mov -0xc(%ebp),%eax 480: c7 00 03 00 00 00 movl $0x3,(%eax) cmd->left = left; 486: 8b 45 f4 mov -0xc(%ebp),%eax 489: 8b 55 08 mov 0x8(%ebp),%edx 48c: 89 50 04 mov %edx,0x4(%eax) cmd->right = right; 48f: 8b 45 f4 mov -0xc(%ebp),%eax 492: 8b 55 0c mov 0xc(%ebp),%edx 495: 89 50 08 mov %edx,0x8(%eax) return (struct cmd*)cmd; 498: 8b 45 f4 mov -0xc(%ebp),%eax } 49b: c9 leave 49c: c3 ret 0000049d <listcmd>: struct cmd* listcmd(struct cmd *left, struct cmd *right) { 49d: 55 push %ebp 49e: 89 e5 mov %esp,%ebp 4a0: 83 ec 28 sub $0x28,%esp struct listcmd *cmd; cmd = malloc(sizeof(*cmd)); 4a3: c7 04 24 0c 00 00 00 movl $0xc,(%esp) 4aa: e8 2c 0f 00 00 call 13db <malloc> 4af: 89 45 f4 mov %eax,-0xc(%ebp) memset(cmd, 0, sizeof(*cmd)); 4b2: c7 44 24 08 0c 00 00 movl $0xc,0x8(%esp) 4b9: 00 4ba: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 4c1: 00 4c2: 8b 45 f4 mov -0xc(%ebp),%eax 4c5: 89 04 24 mov %eax,(%esp) 4c8: e8 e9 08 00 00 call db6 <memset> cmd->type = LIST; 4cd: 8b 45 f4 mov -0xc(%ebp),%eax 4d0: c7 00 04 00 00 00 movl $0x4,(%eax) cmd->left = left; 4d6: 8b 45 f4 mov -0xc(%ebp),%eax 4d9: 8b 55 08 mov 0x8(%ebp),%edx 4dc: 89 50 04 mov %edx,0x4(%eax) cmd->right = right; 4df: 8b 45 f4 mov -0xc(%ebp),%eax 4e2: 8b 55 0c mov 0xc(%ebp),%edx 4e5: 89 50 08 mov %edx,0x8(%eax) return (struct cmd*)cmd; 4e8: 8b 45 f4 mov -0xc(%ebp),%eax } 4eb: c9 leave 4ec: c3 ret 000004ed <backcmd>: struct cmd* backcmd(struct cmd *subcmd) { 4ed: 55 push %ebp 4ee: 89 e5 mov %esp,%ebp 4f0: 83 ec 28 sub $0x28,%esp struct backcmd *cmd; cmd = malloc(sizeof(*cmd)); 4f3: c7 04 24 08 00 00 00 movl $0x8,(%esp) 4fa: e8 dc 0e 00 00 call 13db <malloc> 4ff: 89 45 f4 mov %eax,-0xc(%ebp) memset(cmd, 0, sizeof(*cmd)); 502: c7 44 24 08 08 00 00 movl $0x8,0x8(%esp) 509: 00 50a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 511: 00 512: 8b 45 f4 mov -0xc(%ebp),%eax 515: 89 04 24 mov %eax,(%esp) 518: e8 99 08 00 00 call db6 <memset> cmd->type = BACK; 51d: 8b 45 f4 mov -0xc(%ebp),%eax 520: c7 00 05 00 00 00 movl $0x5,(%eax) cmd->cmd = subcmd; 526: 8b 45 f4 mov -0xc(%ebp),%eax 529: 8b 55 08 mov 0x8(%ebp),%edx 52c: 89 50 04 mov %edx,0x4(%eax) return (struct cmd*)cmd; 52f: 8b 45 f4 mov -0xc(%ebp),%eax } 532: c9 leave 533: c3 ret 00000534 <gettoken>: char whitespace[] = " \t\r\n\v"; char symbols[] = "<|>&;()"; int gettoken(char **ps, char *es, char **q, char **eq) { 534: 55 push %ebp 535: 89 e5 mov %esp,%ebp 537: 83 ec 28 sub $0x28,%esp char *s; int ret; s = *ps; 53a: 8b 45 08 mov 0x8(%ebp),%eax 53d: 8b 00 mov (%eax),%eax 53f: 89 45 f0 mov %eax,-0x10(%ebp) while(s < es && strchr(whitespace, *s)) 542: eb 04 jmp 548 <gettoken+0x14> s++; 544: 83 45 f0 01 addl $0x1,-0x10(%ebp) { char *s; int ret; s = *ps; while(s < es && strchr(whitespace, *s)) 548: 8b 45 f0 mov -0x10(%ebp),%eax 54b: 3b 45 0c cmp 0xc(%ebp),%eax 54e: 73 1d jae 56d <gettoken+0x39> 550: 8b 45 f0 mov -0x10(%ebp),%eax 553: 0f b6 00 movzbl (%eax),%eax 556: 0f be c0 movsbl %al,%eax 559: 89 44 24 04 mov %eax,0x4(%esp) 55d: c7 04 24 54 18 00 00 movl $0x1854,(%esp) 564: e8 71 08 00 00 call dda <strchr> 569: 85 c0 test %eax,%eax 56b: 75 d7 jne 544 <gettoken+0x10> s++; if(q) 56d: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 571: 74 08 je 57b <gettoken+0x47> *q = s; 573: 8b 45 10 mov 0x10(%ebp),%eax 576: 8b 55 f0 mov -0x10(%ebp),%edx 579: 89 10 mov %edx,(%eax) ret = *s; 57b: 8b 45 f0 mov -0x10(%ebp),%eax 57e: 0f b6 00 movzbl (%eax),%eax 581: 0f be c0 movsbl %al,%eax 584: 89 45 f4 mov %eax,-0xc(%ebp) switch(*s){ 587: 8b 45 f0 mov -0x10(%ebp),%eax 58a: 0f b6 00 movzbl (%eax),%eax 58d: 0f be c0 movsbl %al,%eax 590: 83 f8 3c cmp $0x3c,%eax 593: 7f 1e jg 5b3 <gettoken+0x7f> 595: 83 f8 3b cmp $0x3b,%eax 598: 7d 23 jge 5bd <gettoken+0x89> 59a: 83 f8 29 cmp $0x29,%eax 59d: 7f 3f jg 5de <gettoken+0xaa> 59f: 83 f8 28 cmp $0x28,%eax 5a2: 7d 19 jge 5bd <gettoken+0x89> 5a4: 85 c0 test %eax,%eax 5a6: 0f 84 83 00 00 00 je 62f <gettoken+0xfb> 5ac: 83 f8 26 cmp $0x26,%eax 5af: 74 0c je 5bd <gettoken+0x89> 5b1: eb 2b jmp 5de <gettoken+0xaa> 5b3: 83 f8 3e cmp $0x3e,%eax 5b6: 74 0b je 5c3 <gettoken+0x8f> 5b8: 83 f8 7c cmp $0x7c,%eax 5bb: 75 21 jne 5de <gettoken+0xaa> case '(': case ')': case ';': case '&': case '<': s++; 5bd: 83 45 f0 01 addl $0x1,-0x10(%ebp) break; 5c1: eb 70 jmp 633 <gettoken+0xff> case '>': s++; 5c3: 83 45 f0 01 addl $0x1,-0x10(%ebp) if(*s == '>'){ 5c7: 8b 45 f0 mov -0x10(%ebp),%eax 5ca: 0f b6 00 movzbl (%eax),%eax 5cd: 3c 3e cmp $0x3e,%al 5cf: 75 61 jne 632 <gettoken+0xfe> ret = '+'; 5d1: c7 45 f4 2b 00 00 00 movl $0x2b,-0xc(%ebp) s++; 5d8: 83 45 f0 01 addl $0x1,-0x10(%ebp) } break; 5dc: eb 55 jmp 633 <gettoken+0xff> default: ret = 'a'; 5de: c7 45 f4 61 00 00 00 movl $0x61,-0xc(%ebp) while(s < es && !strchr(whitespace, *s) && !strchr(symbols, *s)) 5e5: eb 04 jmp 5eb <gettoken+0xb7> s++; 5e7: 83 45 f0 01 addl $0x1,-0x10(%ebp) s++; } break; default: ret = 'a'; while(s < es && !strchr(whitespace, *s) && !strchr(symbols, *s)) 5eb: 8b 45 f0 mov -0x10(%ebp),%eax 5ee: 3b 45 0c cmp 0xc(%ebp),%eax 5f1: 73 40 jae 633 <gettoken+0xff> 5f3: 8b 45 f0 mov -0x10(%ebp),%eax 5f6: 0f b6 00 movzbl (%eax),%eax 5f9: 0f be c0 movsbl %al,%eax 5fc: 89 44 24 04 mov %eax,0x4(%esp) 600: c7 04 24 54 18 00 00 movl $0x1854,(%esp) 607: e8 ce 07 00 00 call dda <strchr> 60c: 85 c0 test %eax,%eax 60e: 75 23 jne 633 <gettoken+0xff> 610: 8b 45 f0 mov -0x10(%ebp),%eax 613: 0f b6 00 movzbl (%eax),%eax 616: 0f be c0 movsbl %al,%eax 619: 89 44 24 04 mov %eax,0x4(%esp) 61d: c7 04 24 5a 18 00 00 movl $0x185a,(%esp) 624: e8 b1 07 00 00 call dda <strchr> 629: 85 c0 test %eax,%eax 62b: 74 ba je 5e7 <gettoken+0xb3> 62d: eb 04 jmp 633 <gettoken+0xff> if(q) *q = s; ret = *s; switch(*s){ case 0: break; 62f: 90 nop 630: eb 01 jmp 633 <gettoken+0xff> s++; if(*s == '>'){ ret = '+'; s++; } break; 632: 90 nop ret = 'a'; while(s < es && !strchr(whitespace, *s) && !strchr(symbols, *s)) s++; break; } if(eq) 633: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 637: 74 0e je 647 <gettoken+0x113> *eq = s; 639: 8b 45 14 mov 0x14(%ebp),%eax 63c: 8b 55 f0 mov -0x10(%ebp),%edx 63f: 89 10 mov %edx,(%eax) while(s < es && strchr(whitespace, *s)) 641: eb 04 jmp 647 <gettoken+0x113> s++; 643: 83 45 f0 01 addl $0x1,-0x10(%ebp) break; } if(eq) *eq = s; while(s < es && strchr(whitespace, *s)) 647: 8b 45 f0 mov -0x10(%ebp),%eax 64a: 3b 45 0c cmp 0xc(%ebp),%eax 64d: 73 1d jae 66c <gettoken+0x138> 64f: 8b 45 f0 mov -0x10(%ebp),%eax 652: 0f b6 00 movzbl (%eax),%eax 655: 0f be c0 movsbl %al,%eax 658: 89 44 24 04 mov %eax,0x4(%esp) 65c: c7 04 24 54 18 00 00 movl $0x1854,(%esp) 663: e8 72 07 00 00 call dda <strchr> 668: 85 c0 test %eax,%eax 66a: 75 d7 jne 643 <gettoken+0x10f> s++; *ps = s; 66c: 8b 45 08 mov 0x8(%ebp),%eax 66f: 8b 55 f0 mov -0x10(%ebp),%edx 672: 89 10 mov %edx,(%eax) return ret; 674: 8b 45 f4 mov -0xc(%ebp),%eax } 677: c9 leave 678: c3 ret 00000679 <peek>: int peek(char **ps, char *es, char *toks) { 679: 55 push %ebp 67a: 89 e5 mov %esp,%ebp 67c: 83 ec 28 sub $0x28,%esp char *s; s = *ps; 67f: 8b 45 08 mov 0x8(%ebp),%eax 682: 8b 00 mov (%eax),%eax 684: 89 45 f4 mov %eax,-0xc(%ebp) while(s < es && strchr(whitespace, *s)) 687: eb 04 jmp 68d <peek+0x14> s++; 689: 83 45 f4 01 addl $0x1,-0xc(%ebp) peek(char **ps, char *es, char *toks) { char *s; s = *ps; while(s < es && strchr(whitespace, *s)) 68d: 8b 45 f4 mov -0xc(%ebp),%eax 690: 3b 45 0c cmp 0xc(%ebp),%eax 693: 73 1d jae 6b2 <peek+0x39> 695: 8b 45 f4 mov -0xc(%ebp),%eax 698: 0f b6 00 movzbl (%eax),%eax 69b: 0f be c0 movsbl %al,%eax 69e: 89 44 24 04 mov %eax,0x4(%esp) 6a2: c7 04 24 54 18 00 00 movl $0x1854,(%esp) 6a9: e8 2c 07 00 00 call dda <strchr> 6ae: 85 c0 test %eax,%eax 6b0: 75 d7 jne 689 <peek+0x10> s++; *ps = s; 6b2: 8b 45 08 mov 0x8(%ebp),%eax 6b5: 8b 55 f4 mov -0xc(%ebp),%edx 6b8: 89 10 mov %edx,(%eax) return *s && strchr(toks, *s); 6ba: 8b 45 f4 mov -0xc(%ebp),%eax 6bd: 0f b6 00 movzbl (%eax),%eax 6c0: 84 c0 test %al,%al 6c2: 74 23 je 6e7 <peek+0x6e> 6c4: 8b 45 f4 mov -0xc(%ebp),%eax 6c7: 0f b6 00 movzbl (%eax),%eax 6ca: 0f be c0 movsbl %al,%eax 6cd: 89 44 24 04 mov %eax,0x4(%esp) 6d1: 8b 45 10 mov 0x10(%ebp),%eax 6d4: 89 04 24 mov %eax,(%esp) 6d7: e8 fe 06 00 00 call dda <strchr> 6dc: 85 c0 test %eax,%eax 6de: 74 07 je 6e7 <peek+0x6e> 6e0: b8 01 00 00 00 mov $0x1,%eax 6e5: eb 05 jmp 6ec <peek+0x73> 6e7: b8 00 00 00 00 mov $0x0,%eax } 6ec: c9 leave 6ed: c3 ret 000006ee <parsecmd>: struct cmd *parseexec(char**, char*); struct cmd *nulterminate(struct cmd*); struct cmd* parsecmd(char *s) { 6ee: 55 push %ebp 6ef: 89 e5 mov %esp,%ebp 6f1: 53 push %ebx 6f2: 83 ec 24 sub $0x24,%esp char *es; struct cmd *cmd; es = s + strlen(s); 6f5: 8b 5d 08 mov 0x8(%ebp),%ebx 6f8: 8b 45 08 mov 0x8(%ebp),%eax 6fb: 89 04 24 mov %eax,(%esp) 6fe: e8 8e 06 00 00 call d91 <strlen> 703: 8d 04 03 lea (%ebx,%eax,1),%eax 706: 89 45 f0 mov %eax,-0x10(%ebp) cmd = parseline(&s, es); 709: 8b 45 f0 mov -0x10(%ebp),%eax 70c: 89 44 24 04 mov %eax,0x4(%esp) 710: 8d 45 08 lea 0x8(%ebp),%eax 713: 89 04 24 mov %eax,(%esp) 716: e8 60 00 00 00 call 77b <parseline> 71b: 89 45 f4 mov %eax,-0xc(%ebp) peek(&s, es, ""); 71e: c7 44 24 08 96 17 00 movl $0x1796,0x8(%esp) 725: 00 726: 8b 45 f0 mov -0x10(%ebp),%eax 729: 89 44 24 04 mov %eax,0x4(%esp) 72d: 8d 45 08 lea 0x8(%ebp),%eax 730: 89 04 24 mov %eax,(%esp) 733: e8 41 ff ff ff call 679 <peek> if(s != es){ 738: 8b 45 08 mov 0x8(%ebp),%eax 73b: 3b 45 f0 cmp -0x10(%ebp),%eax 73e: 74 27 je 767 <parsecmd+0x79> printf(2, "leftovers: %s\n", s); 740: 8b 45 08 mov 0x8(%ebp),%eax 743: 89 44 24 08 mov %eax,0x8(%esp) 747: c7 44 24 04 97 17 00 movl $0x1797,0x4(%esp) 74e: 00 74f: c7 04 24 02 00 00 00 movl $0x2,(%esp) 756: e8 9a 09 00 00 call 10f5 <printf> panic("syntax"); 75b: c7 04 24 a6 17 00 00 movl $0x17a6,(%esp) 762: e8 f2 fb ff ff call 359 <panic> } nulterminate(cmd); 767: 8b 45 f4 mov -0xc(%ebp),%eax 76a: 89 04 24 mov %eax,(%esp) 76d: e8 a4 04 00 00 call c16 <nulterminate> return cmd; 772: 8b 45 f4 mov -0xc(%ebp),%eax } 775: 83 c4 24 add $0x24,%esp 778: 5b pop %ebx 779: 5d pop %ebp 77a: c3 ret 0000077b <parseline>: struct cmd* parseline(char **ps, char *es) { 77b: 55 push %ebp 77c: 89 e5 mov %esp,%ebp 77e: 83 ec 28 sub $0x28,%esp struct cmd *cmd; cmd = parsepipe(ps, es); 781: 8b 45 0c mov 0xc(%ebp),%eax 784: 89 44 24 04 mov %eax,0x4(%esp) 788: 8b 45 08 mov 0x8(%ebp),%eax 78b: 89 04 24 mov %eax,(%esp) 78e: e8 bc 00 00 00 call 84f <parsepipe> 793: 89 45 f4 mov %eax,-0xc(%ebp) while(peek(ps, es, "&")){ 796: eb 30 jmp 7c8 <parseline+0x4d> gettoken(ps, es, 0, 0); 798: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 79f: 00 7a0: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) 7a7: 00 7a8: 8b 45 0c mov 0xc(%ebp),%eax 7ab: 89 44 24 04 mov %eax,0x4(%esp) 7af: 8b 45 08 mov 0x8(%ebp),%eax 7b2: 89 04 24 mov %eax,(%esp) 7b5: e8 7a fd ff ff call 534 <gettoken> cmd = backcmd(cmd); 7ba: 8b 45 f4 mov -0xc(%ebp),%eax 7bd: 89 04 24 mov %eax,(%esp) 7c0: e8 28 fd ff ff call 4ed <backcmd> 7c5: 89 45 f4 mov %eax,-0xc(%ebp) parseline(char **ps, char *es) { struct cmd *cmd; cmd = parsepipe(ps, es); while(peek(ps, es, "&")){ 7c8: c7 44 24 08 ad 17 00 movl $0x17ad,0x8(%esp) 7cf: 00 7d0: 8b 45 0c mov 0xc(%ebp),%eax 7d3: 89 44 24 04 mov %eax,0x4(%esp) 7d7: 8b 45 08 mov 0x8(%ebp),%eax 7da: 89 04 24 mov %eax,(%esp) 7dd: e8 97 fe ff ff call 679 <peek> 7e2: 85 c0 test %eax,%eax 7e4: 75 b2 jne 798 <parseline+0x1d> gettoken(ps, es, 0, 0); cmd = backcmd(cmd); } if(peek(ps, es, ";")){ 7e6: c7 44 24 08 af 17 00 movl $0x17af,0x8(%esp) 7ed: 00 7ee: 8b 45 0c mov 0xc(%ebp),%eax 7f1: 89 44 24 04 mov %eax,0x4(%esp) 7f5: 8b 45 08 mov 0x8(%ebp),%eax 7f8: 89 04 24 mov %eax,(%esp) 7fb: e8 79 fe ff ff call 679 <peek> 800: 85 c0 test %eax,%eax 802: 74 46 je 84a <parseline+0xcf> gettoken(ps, es, 0, 0); 804: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 80b: 00 80c: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) 813: 00 814: 8b 45 0c mov 0xc(%ebp),%eax 817: 89 44 24 04 mov %eax,0x4(%esp) 81b: 8b 45 08 mov 0x8(%ebp),%eax 81e: 89 04 24 mov %eax,(%esp) 821: e8 0e fd ff ff call 534 <gettoken> cmd = listcmd(cmd, parseline(ps, es)); 826: 8b 45 0c mov 0xc(%ebp),%eax 829: 89 44 24 04 mov %eax,0x4(%esp) 82d: 8b 45 08 mov 0x8(%ebp),%eax 830: 89 04 24 mov %eax,(%esp) 833: e8 43 ff ff ff call 77b <parseline> 838: 89 44 24 04 mov %eax,0x4(%esp) 83c: 8b 45 f4 mov -0xc(%ebp),%eax 83f: 89 04 24 mov %eax,(%esp) 842: e8 56 fc ff ff call 49d <listcmd> 847: 89 45 f4 mov %eax,-0xc(%ebp) } return cmd; 84a: 8b 45 f4 mov -0xc(%ebp),%eax } 84d: c9 leave 84e: c3 ret 0000084f <parsepipe>: struct cmd* parsepipe(char **ps, char *es) { 84f: 55 push %ebp 850: 89 e5 mov %esp,%ebp 852: 83 ec 28 sub $0x28,%esp struct cmd *cmd; cmd = parseexec(ps, es); 855: 8b 45 0c mov 0xc(%ebp),%eax 858: 89 44 24 04 mov %eax,0x4(%esp) 85c: 8b 45 08 mov 0x8(%ebp),%eax 85f: 89 04 24 mov %eax,(%esp) 862: e8 67 02 00 00 call ace <parseexec> 867: 89 45 f4 mov %eax,-0xc(%ebp) if(peek(ps, es, "|")){ 86a: c7 44 24 08 b1 17 00 movl $0x17b1,0x8(%esp) 871: 00 872: 8b 45 0c mov 0xc(%ebp),%eax 875: 89 44 24 04 mov %eax,0x4(%esp) 879: 8b 45 08 mov 0x8(%ebp),%eax 87c: 89 04 24 mov %eax,(%esp) 87f: e8 f5 fd ff ff call 679 <peek> 884: 85 c0 test %eax,%eax 886: 74 46 je 8ce <parsepipe+0x7f> gettoken(ps, es, 0, 0); 888: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 88f: 00 890: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) 897: 00 898: 8b 45 0c mov 0xc(%ebp),%eax 89b: 89 44 24 04 mov %eax,0x4(%esp) 89f: 8b 45 08 mov 0x8(%ebp),%eax 8a2: 89 04 24 mov %eax,(%esp) 8a5: e8 8a fc ff ff call 534 <gettoken> cmd = pipecmd(cmd, parsepipe(ps, es)); 8aa: 8b 45 0c mov 0xc(%ebp),%eax 8ad: 89 44 24 04 mov %eax,0x4(%esp) 8b1: 8b 45 08 mov 0x8(%ebp),%eax 8b4: 89 04 24 mov %eax,(%esp) 8b7: e8 93 ff ff ff call 84f <parsepipe> 8bc: 89 44 24 04 mov %eax,0x4(%esp) 8c0: 8b 45 f4 mov -0xc(%ebp),%eax 8c3: 89 04 24 mov %eax,(%esp) 8c6: e8 82 fb ff ff call 44d <pipecmd> 8cb: 89 45 f4 mov %eax,-0xc(%ebp) } return cmd; 8ce: 8b 45 f4 mov -0xc(%ebp),%eax } 8d1: c9 leave 8d2: c3 ret 000008d3 <parseredirs>: struct cmd* parseredirs(struct cmd *cmd, char **ps, char *es) { 8d3: 55 push %ebp 8d4: 89 e5 mov %esp,%ebp 8d6: 83 ec 38 sub $0x38,%esp int tok; char *q, *eq; while(peek(ps, es, "<>")){ 8d9: e9 f5 00 00 00 jmp 9d3 <parseredirs+0x100> tok = gettoken(ps, es, 0, 0); 8de: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 8e5: 00 8e6: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) 8ed: 00 8ee: 8b 45 10 mov 0x10(%ebp),%eax 8f1: 89 44 24 04 mov %eax,0x4(%esp) 8f5: 8b 45 0c mov 0xc(%ebp),%eax 8f8: 89 04 24 mov %eax,(%esp) 8fb: e8 34 fc ff ff call 534 <gettoken> 900: 89 45 f4 mov %eax,-0xc(%ebp) if(gettoken(ps, es, &q, &eq) != 'a') 903: 8d 45 ec lea -0x14(%ebp),%eax 906: 89 44 24 0c mov %eax,0xc(%esp) 90a: 8d 45 f0 lea -0x10(%ebp),%eax 90d: 89 44 24 08 mov %eax,0x8(%esp) 911: 8b 45 10 mov 0x10(%ebp),%eax 914: 89 44 24 04 mov %eax,0x4(%esp) 918: 8b 45 0c mov 0xc(%ebp),%eax 91b: 89 04 24 mov %eax,(%esp) 91e: e8 11 fc ff ff call 534 <gettoken> 923: 83 f8 61 cmp $0x61,%eax 926: 74 0c je 934 <parseredirs+0x61> panic("missing file for redirection"); 928: c7 04 24 b3 17 00 00 movl $0x17b3,(%esp) 92f: e8 25 fa ff ff call 359 <panic> switch(tok){ 934: 8b 45 f4 mov -0xc(%ebp),%eax 937: 83 f8 3c cmp $0x3c,%eax 93a: 74 0f je 94b <parseredirs+0x78> 93c: 83 f8 3e cmp $0x3e,%eax 93f: 74 38 je 979 <parseredirs+0xa6> 941: 83 f8 2b cmp $0x2b,%eax 944: 74 61 je 9a7 <parseredirs+0xd4> 946: e9 88 00 00 00 jmp 9d3 <parseredirs+0x100> case '<': cmd = redircmd(cmd, q, eq, O_RDONLY, 0); 94b: 8b 55 ec mov -0x14(%ebp),%edx 94e: 8b 45 f0 mov -0x10(%ebp),%eax 951: c7 44 24 10 00 00 00 movl $0x0,0x10(%esp) 958: 00 959: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 960: 00 961: 89 54 24 08 mov %edx,0x8(%esp) 965: 89 44 24 04 mov %eax,0x4(%esp) 969: 8b 45 08 mov 0x8(%ebp),%eax 96c: 89 04 24 mov %eax,(%esp) 96f: e8 6e fa ff ff call 3e2 <redircmd> 974: 89 45 08 mov %eax,0x8(%ebp) break; 977: eb 5a jmp 9d3 <parseredirs+0x100> case '>': cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1); 979: 8b 55 ec mov -0x14(%ebp),%edx 97c: 8b 45 f0 mov -0x10(%ebp),%eax 97f: c7 44 24 10 01 00 00 movl $0x1,0x10(%esp) 986: 00 987: c7 44 24 0c 01 02 00 movl $0x201,0xc(%esp) 98e: 00 98f: 89 54 24 08 mov %edx,0x8(%esp) 993: 89 44 24 04 mov %eax,0x4(%esp) 997: 8b 45 08 mov 0x8(%ebp),%eax 99a: 89 04 24 mov %eax,(%esp) 99d: e8 40 fa ff ff call 3e2 <redircmd> 9a2: 89 45 08 mov %eax,0x8(%ebp) break; 9a5: eb 2c jmp 9d3 <parseredirs+0x100> case '+': // >> cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1); 9a7: 8b 55 ec mov -0x14(%ebp),%edx 9aa: 8b 45 f0 mov -0x10(%ebp),%eax 9ad: c7 44 24 10 01 00 00 movl $0x1,0x10(%esp) 9b4: 00 9b5: c7 44 24 0c 01 02 00 movl $0x201,0xc(%esp) 9bc: 00 9bd: 89 54 24 08 mov %edx,0x8(%esp) 9c1: 89 44 24 04 mov %eax,0x4(%esp) 9c5: 8b 45 08 mov 0x8(%ebp),%eax 9c8: 89 04 24 mov %eax,(%esp) 9cb: e8 12 fa ff ff call 3e2 <redircmd> 9d0: 89 45 08 mov %eax,0x8(%ebp) parseredirs(struct cmd *cmd, char **ps, char *es) { int tok; char *q, *eq; while(peek(ps, es, "<>")){ 9d3: c7 44 24 08 d0 17 00 movl $0x17d0,0x8(%esp) 9da: 00 9db: 8b 45 10 mov 0x10(%ebp),%eax 9de: 89 44 24 04 mov %eax,0x4(%esp) 9e2: 8b 45 0c mov 0xc(%ebp),%eax 9e5: 89 04 24 mov %eax,(%esp) 9e8: e8 8c fc ff ff call 679 <peek> 9ed: 85 c0 test %eax,%eax 9ef: 0f 85 e9 fe ff ff jne 8de <parseredirs+0xb> case '+': // >> cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1); break; } } return cmd; 9f5: 8b 45 08 mov 0x8(%ebp),%eax } 9f8: c9 leave 9f9: c3 ret 000009fa <parseblock>: struct cmd* parseblock(char **ps, char *es) { 9fa: 55 push %ebp 9fb: 89 e5 mov %esp,%ebp 9fd: 83 ec 28 sub $0x28,%esp struct cmd *cmd; if(!peek(ps, es, "(")) a00: c7 44 24 08 d3 17 00 movl $0x17d3,0x8(%esp) a07: 00 a08: 8b 45 0c mov 0xc(%ebp),%eax a0b: 89 44 24 04 mov %eax,0x4(%esp) a0f: 8b 45 08 mov 0x8(%ebp),%eax a12: 89 04 24 mov %eax,(%esp) a15: e8 5f fc ff ff call 679 <peek> a1a: 85 c0 test %eax,%eax a1c: 75 0c jne a2a <parseblock+0x30> panic("parseblock"); a1e: c7 04 24 d5 17 00 00 movl $0x17d5,(%esp) a25: e8 2f f9 ff ff call 359 <panic> gettoken(ps, es, 0, 0); a2a: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) a31: 00 a32: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) a39: 00 a3a: 8b 45 0c mov 0xc(%ebp),%eax a3d: 89 44 24 04 mov %eax,0x4(%esp) a41: 8b 45 08 mov 0x8(%ebp),%eax a44: 89 04 24 mov %eax,(%esp) a47: e8 e8 fa ff ff call 534 <gettoken> cmd = parseline(ps, es); a4c: 8b 45 0c mov 0xc(%ebp),%eax a4f: 89 44 24 04 mov %eax,0x4(%esp) a53: 8b 45 08 mov 0x8(%ebp),%eax a56: 89 04 24 mov %eax,(%esp) a59: e8 1d fd ff ff call 77b <parseline> a5e: 89 45 f4 mov %eax,-0xc(%ebp) if(!peek(ps, es, ")")) a61: c7 44 24 08 e0 17 00 movl $0x17e0,0x8(%esp) a68: 00 a69: 8b 45 0c mov 0xc(%ebp),%eax a6c: 89 44 24 04 mov %eax,0x4(%esp) a70: 8b 45 08 mov 0x8(%ebp),%eax a73: 89 04 24 mov %eax,(%esp) a76: e8 fe fb ff ff call 679 <peek> a7b: 85 c0 test %eax,%eax a7d: 75 0c jne a8b <parseblock+0x91> panic("syntax - missing )"); a7f: c7 04 24 e2 17 00 00 movl $0x17e2,(%esp) a86: e8 ce f8 ff ff call 359 <panic> gettoken(ps, es, 0, 0); a8b: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) a92: 00 a93: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) a9a: 00 a9b: 8b 45 0c mov 0xc(%ebp),%eax a9e: 89 44 24 04 mov %eax,0x4(%esp) aa2: 8b 45 08 mov 0x8(%ebp),%eax aa5: 89 04 24 mov %eax,(%esp) aa8: e8 87 fa ff ff call 534 <gettoken> cmd = parseredirs(cmd, ps, es); aad: 8b 45 0c mov 0xc(%ebp),%eax ab0: 89 44 24 08 mov %eax,0x8(%esp) ab4: 8b 45 08 mov 0x8(%ebp),%eax ab7: 89 44 24 04 mov %eax,0x4(%esp) abb: 8b 45 f4 mov -0xc(%ebp),%eax abe: 89 04 24 mov %eax,(%esp) ac1: e8 0d fe ff ff call 8d3 <parseredirs> ac6: 89 45 f4 mov %eax,-0xc(%ebp) return cmd; ac9: 8b 45 f4 mov -0xc(%ebp),%eax } acc: c9 leave acd: c3 ret 00000ace <parseexec>: struct cmd* parseexec(char **ps, char *es) { ace: 55 push %ebp acf: 89 e5 mov %esp,%ebp ad1: 83 ec 38 sub $0x38,%esp char *q, *eq; int tok, argc; struct execcmd *cmd; struct cmd *ret; if(peek(ps, es, "(")) ad4: c7 44 24 08 d3 17 00 movl $0x17d3,0x8(%esp) adb: 00 adc: 8b 45 0c mov 0xc(%ebp),%eax adf: 89 44 24 04 mov %eax,0x4(%esp) ae3: 8b 45 08 mov 0x8(%ebp),%eax ae6: 89 04 24 mov %eax,(%esp) ae9: e8 8b fb ff ff call 679 <peek> aee: 85 c0 test %eax,%eax af0: 74 17 je b09 <parseexec+0x3b> return parseblock(ps, es); af2: 8b 45 0c mov 0xc(%ebp),%eax af5: 89 44 24 04 mov %eax,0x4(%esp) af9: 8b 45 08 mov 0x8(%ebp),%eax afc: 89 04 24 mov %eax,(%esp) aff: e8 f6 fe ff ff call 9fa <parseblock> b04: e9 0b 01 00 00 jmp c14 <parseexec+0x146> ret = execcmd(); b09: e8 96 f8 ff ff call 3a4 <execcmd> b0e: 89 45 f4 mov %eax,-0xc(%ebp) cmd = (struct execcmd*)ret; b11: 8b 45 f4 mov -0xc(%ebp),%eax b14: 89 45 f0 mov %eax,-0x10(%ebp) argc = 0; b17: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ret = parseredirs(ret, ps, es); b1e: 8b 45 0c mov 0xc(%ebp),%eax b21: 89 44 24 08 mov %eax,0x8(%esp) b25: 8b 45 08 mov 0x8(%ebp),%eax b28: 89 44 24 04 mov %eax,0x4(%esp) b2c: 8b 45 f4 mov -0xc(%ebp),%eax b2f: 89 04 24 mov %eax,(%esp) b32: e8 9c fd ff ff call 8d3 <parseredirs> b37: 89 45 f4 mov %eax,-0xc(%ebp) while(!peek(ps, es, "|)&;")){ b3a: e9 8e 00 00 00 jmp bcd <parseexec+0xff> if((tok=gettoken(ps, es, &q, &eq)) == 0) b3f: 8d 45 e0 lea -0x20(%ebp),%eax b42: 89 44 24 0c mov %eax,0xc(%esp) b46: 8d 45 e4 lea -0x1c(%ebp),%eax b49: 89 44 24 08 mov %eax,0x8(%esp) b4d: 8b 45 0c mov 0xc(%ebp),%eax b50: 89 44 24 04 mov %eax,0x4(%esp) b54: 8b 45 08 mov 0x8(%ebp),%eax b57: 89 04 24 mov %eax,(%esp) b5a: e8 d5 f9 ff ff call 534 <gettoken> b5f: 89 45 e8 mov %eax,-0x18(%ebp) b62: 83 7d e8 00 cmpl $0x0,-0x18(%ebp) b66: 0f 84 85 00 00 00 je bf1 <parseexec+0x123> break; if(tok != 'a') b6c: 83 7d e8 61 cmpl $0x61,-0x18(%ebp) b70: 74 0c je b7e <parseexec+0xb0> panic("syntax"); b72: c7 04 24 a6 17 00 00 movl $0x17a6,(%esp) b79: e8 db f7 ff ff call 359 <panic> cmd->argv[argc] = q; b7e: 8b 55 ec mov -0x14(%ebp),%edx b81: 8b 4d e4 mov -0x1c(%ebp),%ecx b84: 8b 45 f0 mov -0x10(%ebp),%eax b87: 89 4c 90 04 mov %ecx,0x4(%eax,%edx,4) cmd->eargv[argc] = eq; b8b: 8b 4d ec mov -0x14(%ebp),%ecx b8e: 8b 55 e0 mov -0x20(%ebp),%edx b91: 8b 45 f0 mov -0x10(%ebp),%eax b94: 83 c1 08 add $0x8,%ecx b97: 89 54 88 0c mov %edx,0xc(%eax,%ecx,4) argc++; b9b: 83 45 ec 01 addl $0x1,-0x14(%ebp) if(argc >= MAXARGS) b9f: 83 7d ec 09 cmpl $0x9,-0x14(%ebp) ba3: 7e 0c jle bb1 <parseexec+0xe3> panic("too many args"); ba5: c7 04 24 f5 17 00 00 movl $0x17f5,(%esp) bac: e8 a8 f7 ff ff call 359 <panic> ret = parseredirs(ret, ps, es); bb1: 8b 45 0c mov 0xc(%ebp),%eax bb4: 89 44 24 08 mov %eax,0x8(%esp) bb8: 8b 45 08 mov 0x8(%ebp),%eax bbb: 89 44 24 04 mov %eax,0x4(%esp) bbf: 8b 45 f4 mov -0xc(%ebp),%eax bc2: 89 04 24 mov %eax,(%esp) bc5: e8 09 fd ff ff call 8d3 <parseredirs> bca: 89 45 f4 mov %eax,-0xc(%ebp) ret = execcmd(); cmd = (struct execcmd*)ret; argc = 0; ret = parseredirs(ret, ps, es); while(!peek(ps, es, "|)&;")){ bcd: c7 44 24 08 03 18 00 movl $0x1803,0x8(%esp) bd4: 00 bd5: 8b 45 0c mov 0xc(%ebp),%eax bd8: 89 44 24 04 mov %eax,0x4(%esp) bdc: 8b 45 08 mov 0x8(%ebp),%eax bdf: 89 04 24 mov %eax,(%esp) be2: e8 92 fa ff ff call 679 <peek> be7: 85 c0 test %eax,%eax be9: 0f 84 50 ff ff ff je b3f <parseexec+0x71> bef: eb 01 jmp bf2 <parseexec+0x124> if((tok=gettoken(ps, es, &q, &eq)) == 0) break; bf1: 90 nop argc++; if(argc >= MAXARGS) panic("too many args"); ret = parseredirs(ret, ps, es); } cmd->argv[argc] = 0; bf2: 8b 55 ec mov -0x14(%ebp),%edx bf5: 8b 45 f0 mov -0x10(%ebp),%eax bf8: c7 44 90 04 00 00 00 movl $0x0,0x4(%eax,%edx,4) bff: 00 cmd->eargv[argc] = 0; c00: 8b 55 ec mov -0x14(%ebp),%edx c03: 8b 45 f0 mov -0x10(%ebp),%eax c06: 83 c2 08 add $0x8,%edx c09: c7 44 90 0c 00 00 00 movl $0x0,0xc(%eax,%edx,4) c10: 00 return ret; c11: 8b 45 f4 mov -0xc(%ebp),%eax } c14: c9 leave c15: c3 ret 00000c16 <nulterminate>: // NUL-terminate all the counted strings. struct cmd* nulterminate(struct cmd *cmd) { c16: 55 push %ebp c17: 89 e5 mov %esp,%ebp c19: 83 ec 38 sub $0x38,%esp struct execcmd *ecmd; struct listcmd *lcmd; struct pipecmd *pcmd; struct redircmd *rcmd; if(cmd == 0) c1c: 83 7d 08 00 cmpl $0x0,0x8(%ebp) c20: 75 0a jne c2c <nulterminate+0x16> return 0; c22: b8 00 00 00 00 mov $0x0,%eax c27: e9 c8 00 00 00 jmp cf4 <nulterminate+0xde> switch(cmd->type){ c2c: 8b 45 08 mov 0x8(%ebp),%eax c2f: 8b 00 mov (%eax),%eax c31: 83 f8 05 cmp $0x5,%eax c34: 0f 87 b7 00 00 00 ja cf1 <nulterminate+0xdb> c3a: 8b 04 85 08 18 00 00 mov 0x1808(,%eax,4),%eax c41: ff e0 jmp *%eax case EXEC: ecmd = (struct execcmd*)cmd; c43: 8b 45 08 mov 0x8(%ebp),%eax c46: 89 45 e8 mov %eax,-0x18(%ebp) for(i=0; ecmd->argv[i]; i++) c49: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) c50: eb 14 jmp c66 <nulterminate+0x50> *ecmd->eargv[i] = 0; c52: 8b 55 e0 mov -0x20(%ebp),%edx c55: 8b 45 e8 mov -0x18(%ebp),%eax c58: 83 c2 08 add $0x8,%edx c5b: 8b 44 90 0c mov 0xc(%eax,%edx,4),%eax c5f: c6 00 00 movb $0x0,(%eax) return 0; switch(cmd->type){ case EXEC: ecmd = (struct execcmd*)cmd; for(i=0; ecmd->argv[i]; i++) c62: 83 45 e0 01 addl $0x1,-0x20(%ebp) c66: 8b 55 e0 mov -0x20(%ebp),%edx c69: 8b 45 e8 mov -0x18(%ebp),%eax c6c: 8b 44 90 04 mov 0x4(%eax,%edx,4),%eax c70: 85 c0 test %eax,%eax c72: 75 de jne c52 <nulterminate+0x3c> *ecmd->eargv[i] = 0; break; c74: eb 7b jmp cf1 <nulterminate+0xdb> case REDIR: rcmd = (struct redircmd*)cmd; c76: 8b 45 08 mov 0x8(%ebp),%eax c79: 89 45 f4 mov %eax,-0xc(%ebp) nulterminate(rcmd->cmd); c7c: 8b 45 f4 mov -0xc(%ebp),%eax c7f: 8b 40 04 mov 0x4(%eax),%eax c82: 89 04 24 mov %eax,(%esp) c85: e8 8c ff ff ff call c16 <nulterminate> *rcmd->efile = 0; c8a: 8b 45 f4 mov -0xc(%ebp),%eax c8d: 8b 40 0c mov 0xc(%eax),%eax c90: c6 00 00 movb $0x0,(%eax) break; c93: eb 5c jmp cf1 <nulterminate+0xdb> case PIPE: pcmd = (struct pipecmd*)cmd; c95: 8b 45 08 mov 0x8(%ebp),%eax c98: 89 45 f0 mov %eax,-0x10(%ebp) nulterminate(pcmd->left); c9b: 8b 45 f0 mov -0x10(%ebp),%eax c9e: 8b 40 04 mov 0x4(%eax),%eax ca1: 89 04 24 mov %eax,(%esp) ca4: e8 6d ff ff ff call c16 <nulterminate> nulterminate(pcmd->right); ca9: 8b 45 f0 mov -0x10(%ebp),%eax cac: 8b 40 08 mov 0x8(%eax),%eax caf: 89 04 24 mov %eax,(%esp) cb2: e8 5f ff ff ff call c16 <nulterminate> break; cb7: eb 38 jmp cf1 <nulterminate+0xdb> case LIST: lcmd = (struct listcmd*)cmd; cb9: 8b 45 08 mov 0x8(%ebp),%eax cbc: 89 45 ec mov %eax,-0x14(%ebp) nulterminate(lcmd->left); cbf: 8b 45 ec mov -0x14(%ebp),%eax cc2: 8b 40 04 mov 0x4(%eax),%eax cc5: 89 04 24 mov %eax,(%esp) cc8: e8 49 ff ff ff call c16 <nulterminate> nulterminate(lcmd->right); ccd: 8b 45 ec mov -0x14(%ebp),%eax cd0: 8b 40 08 mov 0x8(%eax),%eax cd3: 89 04 24 mov %eax,(%esp) cd6: e8 3b ff ff ff call c16 <nulterminate> break; cdb: eb 14 jmp cf1 <nulterminate+0xdb> case BACK: bcmd = (struct backcmd*)cmd; cdd: 8b 45 08 mov 0x8(%ebp),%eax ce0: 89 45 e4 mov %eax,-0x1c(%ebp) nulterminate(bcmd->cmd); ce3: 8b 45 e4 mov -0x1c(%ebp),%eax ce6: 8b 40 04 mov 0x4(%eax),%eax ce9: 89 04 24 mov %eax,(%esp) cec: e8 25 ff ff ff call c16 <nulterminate> break; } return cmd; cf1: 8b 45 08 mov 0x8(%ebp),%eax } cf4: c9 leave cf5: c3 ret cf6: 90 nop cf7: 90 nop 00000cf8 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { cf8: 55 push %ebp cf9: 89 e5 mov %esp,%ebp cfb: 57 push %edi cfc: 53 push %ebx asm volatile("cld; rep stosb" : cfd: 8b 4d 08 mov 0x8(%ebp),%ecx d00: 8b 55 10 mov 0x10(%ebp),%edx d03: 8b 45 0c mov 0xc(%ebp),%eax d06: 89 cb mov %ecx,%ebx d08: 89 df mov %ebx,%edi d0a: 89 d1 mov %edx,%ecx d0c: fc cld d0d: f3 aa rep stos %al,%es:(%edi) d0f: 89 ca mov %ecx,%edx d11: 89 fb mov %edi,%ebx d13: 89 5d 08 mov %ebx,0x8(%ebp) d16: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } d19: 5b pop %ebx d1a: 5f pop %edi d1b: 5d pop %ebp d1c: c3 ret 00000d1d <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { d1d: 55 push %ebp d1e: 89 e5 mov %esp,%ebp d20: 83 ec 10 sub $0x10,%esp char *os; os = s; d23: 8b 45 08 mov 0x8(%ebp),%eax d26: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) d29: 8b 45 0c mov 0xc(%ebp),%eax d2c: 0f b6 10 movzbl (%eax),%edx d2f: 8b 45 08 mov 0x8(%ebp),%eax d32: 88 10 mov %dl,(%eax) d34: 8b 45 08 mov 0x8(%ebp),%eax d37: 0f b6 00 movzbl (%eax),%eax d3a: 84 c0 test %al,%al d3c: 0f 95 c0 setne %al d3f: 83 45 08 01 addl $0x1,0x8(%ebp) d43: 83 45 0c 01 addl $0x1,0xc(%ebp) d47: 84 c0 test %al,%al d49: 75 de jne d29 <strcpy+0xc> ; return os; d4b: 8b 45 fc mov -0x4(%ebp),%eax } d4e: c9 leave d4f: c3 ret 00000d50 <strcmp>: int strcmp(const char *p, const char *q) { d50: 55 push %ebp d51: 89 e5 mov %esp,%ebp while(*p && *p == *q) d53: eb 08 jmp d5d <strcmp+0xd> p++, q++; d55: 83 45 08 01 addl $0x1,0x8(%ebp) d59: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) d5d: 8b 45 08 mov 0x8(%ebp),%eax d60: 0f b6 00 movzbl (%eax),%eax d63: 84 c0 test %al,%al d65: 74 10 je d77 <strcmp+0x27> d67: 8b 45 08 mov 0x8(%ebp),%eax d6a: 0f b6 10 movzbl (%eax),%edx d6d: 8b 45 0c mov 0xc(%ebp),%eax d70: 0f b6 00 movzbl (%eax),%eax d73: 38 c2 cmp %al,%dl d75: 74 de je d55 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; d77: 8b 45 08 mov 0x8(%ebp),%eax d7a: 0f b6 00 movzbl (%eax),%eax d7d: 0f b6 d0 movzbl %al,%edx d80: 8b 45 0c mov 0xc(%ebp),%eax d83: 0f b6 00 movzbl (%eax),%eax d86: 0f b6 c0 movzbl %al,%eax d89: 89 d1 mov %edx,%ecx d8b: 29 c1 sub %eax,%ecx d8d: 89 c8 mov %ecx,%eax } d8f: 5d pop %ebp d90: c3 ret 00000d91 <strlen>: uint strlen(char *s) { d91: 55 push %ebp d92: 89 e5 mov %esp,%ebp d94: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) d97: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) d9e: eb 04 jmp da4 <strlen+0x13> da0: 83 45 fc 01 addl $0x1,-0x4(%ebp) da4: 8b 45 fc mov -0x4(%ebp),%eax da7: 03 45 08 add 0x8(%ebp),%eax daa: 0f b6 00 movzbl (%eax),%eax dad: 84 c0 test %al,%al daf: 75 ef jne da0 <strlen+0xf> ; return n; db1: 8b 45 fc mov -0x4(%ebp),%eax } db4: c9 leave db5: c3 ret 00000db6 <memset>: void* memset(void *dst, int c, uint n) { db6: 55 push %ebp db7: 89 e5 mov %esp,%ebp db9: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); dbc: 8b 45 10 mov 0x10(%ebp),%eax dbf: 89 44 24 08 mov %eax,0x8(%esp) dc3: 8b 45 0c mov 0xc(%ebp),%eax dc6: 89 44 24 04 mov %eax,0x4(%esp) dca: 8b 45 08 mov 0x8(%ebp),%eax dcd: 89 04 24 mov %eax,(%esp) dd0: e8 23 ff ff ff call cf8 <stosb> return dst; dd5: 8b 45 08 mov 0x8(%ebp),%eax } dd8: c9 leave dd9: c3 ret 00000dda <strchr>: char* strchr(const char *s, char c) { dda: 55 push %ebp ddb: 89 e5 mov %esp,%ebp ddd: 83 ec 04 sub $0x4,%esp de0: 8b 45 0c mov 0xc(%ebp),%eax de3: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) de6: eb 14 jmp dfc <strchr+0x22> if(*s == c) de8: 8b 45 08 mov 0x8(%ebp),%eax deb: 0f b6 00 movzbl (%eax),%eax dee: 3a 45 fc cmp -0x4(%ebp),%al df1: 75 05 jne df8 <strchr+0x1e> return (char*)s; df3: 8b 45 08 mov 0x8(%ebp),%eax df6: eb 13 jmp e0b <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) df8: 83 45 08 01 addl $0x1,0x8(%ebp) dfc: 8b 45 08 mov 0x8(%ebp),%eax dff: 0f b6 00 movzbl (%eax),%eax e02: 84 c0 test %al,%al e04: 75 e2 jne de8 <strchr+0xe> if(*s == c) return (char*)s; return 0; e06: b8 00 00 00 00 mov $0x0,%eax } e0b: c9 leave e0c: c3 ret 00000e0d <gets>: char* gets(char *buf, int max) { e0d: 55 push %ebp e0e: 89 e5 mov %esp,%ebp e10: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ e13: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) e1a: eb 44 jmp e60 <gets+0x53> cc = read(0, &c, 1); e1c: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) e23: 00 e24: 8d 45 ef lea -0x11(%ebp),%eax e27: 89 44 24 04 mov %eax,0x4(%esp) e2b: c7 04 24 00 00 00 00 movl $0x0,(%esp) e32: e8 3d 01 00 00 call f74 <read> e37: 89 45 f4 mov %eax,-0xc(%ebp) if(cc < 1) e3a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) e3e: 7e 2d jle e6d <gets+0x60> break; buf[i++] = c; e40: 8b 45 f0 mov -0x10(%ebp),%eax e43: 03 45 08 add 0x8(%ebp),%eax e46: 0f b6 55 ef movzbl -0x11(%ebp),%edx e4a: 88 10 mov %dl,(%eax) e4c: 83 45 f0 01 addl $0x1,-0x10(%ebp) if(c == '\n' || c == '\r') e50: 0f b6 45 ef movzbl -0x11(%ebp),%eax e54: 3c 0a cmp $0xa,%al e56: 74 16 je e6e <gets+0x61> e58: 0f b6 45 ef movzbl -0x11(%ebp),%eax e5c: 3c 0d cmp $0xd,%al e5e: 74 0e je e6e <gets+0x61> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ e60: 8b 45 f0 mov -0x10(%ebp),%eax e63: 83 c0 01 add $0x1,%eax e66: 3b 45 0c cmp 0xc(%ebp),%eax e69: 7c b1 jl e1c <gets+0xf> e6b: eb 01 jmp e6e <gets+0x61> cc = read(0, &c, 1); if(cc < 1) break; e6d: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; e6e: 8b 45 f0 mov -0x10(%ebp),%eax e71: 03 45 08 add 0x8(%ebp),%eax e74: c6 00 00 movb $0x0,(%eax) return buf; e77: 8b 45 08 mov 0x8(%ebp),%eax } e7a: c9 leave e7b: c3 ret 00000e7c <stat>: int stat(char *n, struct stat *st) { e7c: 55 push %ebp e7d: 89 e5 mov %esp,%ebp e7f: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); e82: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) e89: 00 e8a: 8b 45 08 mov 0x8(%ebp),%eax e8d: 89 04 24 mov %eax,(%esp) e90: e8 07 01 00 00 call f9c <open> e95: 89 45 f0 mov %eax,-0x10(%ebp) if(fd < 0) e98: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) e9c: 79 07 jns ea5 <stat+0x29> return -1; e9e: b8 ff ff ff ff mov $0xffffffff,%eax ea3: eb 23 jmp ec8 <stat+0x4c> r = fstat(fd, st); ea5: 8b 45 0c mov 0xc(%ebp),%eax ea8: 89 44 24 04 mov %eax,0x4(%esp) eac: 8b 45 f0 mov -0x10(%ebp),%eax eaf: 89 04 24 mov %eax,(%esp) eb2: e8 fd 00 00 00 call fb4 <fstat> eb7: 89 45 f4 mov %eax,-0xc(%ebp) close(fd); eba: 8b 45 f0 mov -0x10(%ebp),%eax ebd: 89 04 24 mov %eax,(%esp) ec0: e8 bf 00 00 00 call f84 <close> return r; ec5: 8b 45 f4 mov -0xc(%ebp),%eax } ec8: c9 leave ec9: c3 ret 00000eca <atoi>: int atoi(const char *s) { eca: 55 push %ebp ecb: 89 e5 mov %esp,%ebp ecd: 83 ec 10 sub $0x10,%esp int n; n = 0; ed0: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') ed7: eb 24 jmp efd <atoi+0x33> n = n*10 + *s++ - '0'; ed9: 8b 55 fc mov -0x4(%ebp),%edx edc: 89 d0 mov %edx,%eax ede: c1 e0 02 shl $0x2,%eax ee1: 01 d0 add %edx,%eax ee3: 01 c0 add %eax,%eax ee5: 89 c2 mov %eax,%edx ee7: 8b 45 08 mov 0x8(%ebp),%eax eea: 0f b6 00 movzbl (%eax),%eax eed: 0f be c0 movsbl %al,%eax ef0: 8d 04 02 lea (%edx,%eax,1),%eax ef3: 83 e8 30 sub $0x30,%eax ef6: 89 45 fc mov %eax,-0x4(%ebp) ef9: 83 45 08 01 addl $0x1,0x8(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') efd: 8b 45 08 mov 0x8(%ebp),%eax f00: 0f b6 00 movzbl (%eax),%eax f03: 3c 2f cmp $0x2f,%al f05: 7e 0a jle f11 <atoi+0x47> f07: 8b 45 08 mov 0x8(%ebp),%eax f0a: 0f b6 00 movzbl (%eax),%eax f0d: 3c 39 cmp $0x39,%al f0f: 7e c8 jle ed9 <atoi+0xf> n = n*10 + *s++ - '0'; return n; f11: 8b 45 fc mov -0x4(%ebp),%eax } f14: c9 leave f15: c3 ret 00000f16 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { f16: 55 push %ebp f17: 89 e5 mov %esp,%ebp f19: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; f1c: 8b 45 08 mov 0x8(%ebp),%eax f1f: 89 45 f8 mov %eax,-0x8(%ebp) src = vsrc; f22: 8b 45 0c mov 0xc(%ebp),%eax f25: 89 45 fc mov %eax,-0x4(%ebp) while(n-- > 0) f28: eb 13 jmp f3d <memmove+0x27> *dst++ = *src++; f2a: 8b 45 fc mov -0x4(%ebp),%eax f2d: 0f b6 10 movzbl (%eax),%edx f30: 8b 45 f8 mov -0x8(%ebp),%eax f33: 88 10 mov %dl,(%eax) f35: 83 45 f8 01 addl $0x1,-0x8(%ebp) f39: 83 45 fc 01 addl $0x1,-0x4(%ebp) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) f3d: 83 7d 10 00 cmpl $0x0,0x10(%ebp) f41: 0f 9f c0 setg %al f44: 83 6d 10 01 subl $0x1,0x10(%ebp) f48: 84 c0 test %al,%al f4a: 75 de jne f2a <memmove+0x14> *dst++ = *src++; return vdst; f4c: 8b 45 08 mov 0x8(%ebp),%eax } f4f: c9 leave f50: c3 ret f51: 90 nop f52: 90 nop f53: 90 nop 00000f54 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) f54: b8 01 00 00 00 mov $0x1,%eax f59: cd 40 int $0x40 f5b: c3 ret 00000f5c <exit>: SYSCALL(exit) f5c: b8 02 00 00 00 mov $0x2,%eax f61: cd 40 int $0x40 f63: c3 ret 00000f64 <wait>: SYSCALL(wait) f64: b8 03 00 00 00 mov $0x3,%eax f69: cd 40 int $0x40 f6b: c3 ret 00000f6c <pipe>: SYSCALL(pipe) f6c: b8 04 00 00 00 mov $0x4,%eax f71: cd 40 int $0x40 f73: c3 ret 00000f74 <read>: SYSCALL(read) f74: b8 05 00 00 00 mov $0x5,%eax f79: cd 40 int $0x40 f7b: c3 ret 00000f7c <write>: SYSCALL(write) f7c: b8 10 00 00 00 mov $0x10,%eax f81: cd 40 int $0x40 f83: c3 ret 00000f84 <close>: SYSCALL(close) f84: b8 15 00 00 00 mov $0x15,%eax f89: cd 40 int $0x40 f8b: c3 ret 00000f8c <kill>: SYSCALL(kill) f8c: b8 06 00 00 00 mov $0x6,%eax f91: cd 40 int $0x40 f93: c3 ret 00000f94 <exec>: SYSCALL(exec) f94: b8 07 00 00 00 mov $0x7,%eax f99: cd 40 int $0x40 f9b: c3 ret 00000f9c <open>: SYSCALL(open) f9c: b8 0f 00 00 00 mov $0xf,%eax fa1: cd 40 int $0x40 fa3: c3 ret 00000fa4 <mknod>: SYSCALL(mknod) fa4: b8 11 00 00 00 mov $0x11,%eax fa9: cd 40 int $0x40 fab: c3 ret 00000fac <unlink>: SYSCALL(unlink) fac: b8 12 00 00 00 mov $0x12,%eax fb1: cd 40 int $0x40 fb3: c3 ret 00000fb4 <fstat>: SYSCALL(fstat) fb4: b8 08 00 00 00 mov $0x8,%eax fb9: cd 40 int $0x40 fbb: c3 ret 00000fbc <link>: SYSCALL(link) fbc: b8 13 00 00 00 mov $0x13,%eax fc1: cd 40 int $0x40 fc3: c3 ret 00000fc4 <mkdir>: SYSCALL(mkdir) fc4: b8 14 00 00 00 mov $0x14,%eax fc9: cd 40 int $0x40 fcb: c3 ret 00000fcc <chdir>: SYSCALL(chdir) fcc: b8 09 00 00 00 mov $0x9,%eax fd1: cd 40 int $0x40 fd3: c3 ret 00000fd4 <dup>: SYSCALL(dup) fd4: b8 0a 00 00 00 mov $0xa,%eax fd9: cd 40 int $0x40 fdb: c3 ret 00000fdc <getpid>: SYSCALL(getpid) fdc: b8 0b 00 00 00 mov $0xb,%eax fe1: cd 40 int $0x40 fe3: c3 ret 00000fe4 <sbrk>: SYSCALL(sbrk) fe4: b8 0c 00 00 00 mov $0xc,%eax fe9: cd 40 int $0x40 feb: c3 ret 00000fec <sleep>: SYSCALL(sleep) fec: b8 0d 00 00 00 mov $0xd,%eax ff1: cd 40 int $0x40 ff3: c3 ret 00000ff4 <uptime>: SYSCALL(uptime) ff4: b8 0e 00 00 00 mov $0xe,%eax ff9: cd 40 int $0x40 ffb: c3 ret 00000ffc <clone>: SYSCALL(clone) ffc: b8 16 00 00 00 mov $0x16,%eax 1001: cd 40 int $0x40 1003: c3 ret 00001004 <texit>: SYSCALL(texit) 1004: b8 17 00 00 00 mov $0x17,%eax 1009: cd 40 int $0x40 100b: c3 ret 0000100c <tsleep>: SYSCALL(tsleep) 100c: b8 18 00 00 00 mov $0x18,%eax 1011: cd 40 int $0x40 1013: c3 ret 00001014 <twakeup>: SYSCALL(twakeup) 1014: b8 19 00 00 00 mov $0x19,%eax 1019: cd 40 int $0x40 101b: c3 ret 0000101c <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 101c: 55 push %ebp 101d: 89 e5 mov %esp,%ebp 101f: 83 ec 28 sub $0x28,%esp 1022: 8b 45 0c mov 0xc(%ebp),%eax 1025: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 1028: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 102f: 00 1030: 8d 45 f4 lea -0xc(%ebp),%eax 1033: 89 44 24 04 mov %eax,0x4(%esp) 1037: 8b 45 08 mov 0x8(%ebp),%eax 103a: 89 04 24 mov %eax,(%esp) 103d: e8 3a ff ff ff call f7c <write> } 1042: c9 leave 1043: c3 ret 00001044 <printint>: static void printint(int fd, int xx, int base, int sgn) { 1044: 55 push %ebp 1045: 89 e5 mov %esp,%ebp 1047: 53 push %ebx 1048: 83 ec 44 sub $0x44,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 104b: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 1052: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 1056: 74 17 je 106f <printint+0x2b> 1058: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 105c: 79 11 jns 106f <printint+0x2b> neg = 1; 105e: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 1065: 8b 45 0c mov 0xc(%ebp),%eax 1068: f7 d8 neg %eax 106a: 89 45 f4 mov %eax,-0xc(%ebp) char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 106d: eb 06 jmp 1075 <printint+0x31> neg = 1; x = -xx; } else { x = xx; 106f: 8b 45 0c mov 0xc(%ebp),%eax 1072: 89 45 f4 mov %eax,-0xc(%ebp) } i = 0; 1075: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) do{ buf[i++] = digits[x % base]; 107c: 8b 4d ec mov -0x14(%ebp),%ecx 107f: 8b 5d 10 mov 0x10(%ebp),%ebx 1082: 8b 45 f4 mov -0xc(%ebp),%eax 1085: ba 00 00 00 00 mov $0x0,%edx 108a: f7 f3 div %ebx 108c: 89 d0 mov %edx,%eax 108e: 0f b6 80 64 18 00 00 movzbl 0x1864(%eax),%eax 1095: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) 1099: 83 45 ec 01 addl $0x1,-0x14(%ebp) }while((x /= base) != 0); 109d: 8b 45 10 mov 0x10(%ebp),%eax 10a0: 89 45 d4 mov %eax,-0x2c(%ebp) 10a3: 8b 45 f4 mov -0xc(%ebp),%eax 10a6: ba 00 00 00 00 mov $0x0,%edx 10ab: f7 75 d4 divl -0x2c(%ebp) 10ae: 89 45 f4 mov %eax,-0xc(%ebp) 10b1: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10b5: 75 c5 jne 107c <printint+0x38> if(neg) 10b7: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 10bb: 74 28 je 10e5 <printint+0xa1> buf[i++] = '-'; 10bd: 8b 45 ec mov -0x14(%ebp),%eax 10c0: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) 10c5: 83 45 ec 01 addl $0x1,-0x14(%ebp) while(--i >= 0) 10c9: eb 1a jmp 10e5 <printint+0xa1> putc(fd, buf[i]); 10cb: 8b 45 ec mov -0x14(%ebp),%eax 10ce: 0f b6 44 05 dc movzbl -0x24(%ebp,%eax,1),%eax 10d3: 0f be c0 movsbl %al,%eax 10d6: 89 44 24 04 mov %eax,0x4(%esp) 10da: 8b 45 08 mov 0x8(%ebp),%eax 10dd: 89 04 24 mov %eax,(%esp) 10e0: e8 37 ff ff ff call 101c <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 10e5: 83 6d ec 01 subl $0x1,-0x14(%ebp) 10e9: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 10ed: 79 dc jns 10cb <printint+0x87> putc(fd, buf[i]); } 10ef: 83 c4 44 add $0x44,%esp 10f2: 5b pop %ebx 10f3: 5d pop %ebp 10f4: c3 ret 000010f5 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 10f5: 55 push %ebp 10f6: 89 e5 mov %esp,%ebp 10f8: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 10fb: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) ap = (uint*)(void*)&fmt + 1; 1102: 8d 45 0c lea 0xc(%ebp),%eax 1105: 83 c0 04 add $0x4,%eax 1108: 89 45 f4 mov %eax,-0xc(%ebp) for(i = 0; fmt[i]; i++){ 110b: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) 1112: e9 7e 01 00 00 jmp 1295 <printf+0x1a0> c = fmt[i] & 0xff; 1117: 8b 55 0c mov 0xc(%ebp),%edx 111a: 8b 45 ec mov -0x14(%ebp),%eax 111d: 8d 04 02 lea (%edx,%eax,1),%eax 1120: 0f b6 00 movzbl (%eax),%eax 1123: 0f be c0 movsbl %al,%eax 1126: 25 ff 00 00 00 and $0xff,%eax 112b: 89 45 e8 mov %eax,-0x18(%ebp) if(state == 0){ 112e: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 1132: 75 2c jne 1160 <printf+0x6b> if(c == '%'){ 1134: 83 7d e8 25 cmpl $0x25,-0x18(%ebp) 1138: 75 0c jne 1146 <printf+0x51> state = '%'; 113a: c7 45 f0 25 00 00 00 movl $0x25,-0x10(%ebp) 1141: e9 4b 01 00 00 jmp 1291 <printf+0x19c> } else { putc(fd, c); 1146: 8b 45 e8 mov -0x18(%ebp),%eax 1149: 0f be c0 movsbl %al,%eax 114c: 89 44 24 04 mov %eax,0x4(%esp) 1150: 8b 45 08 mov 0x8(%ebp),%eax 1153: 89 04 24 mov %eax,(%esp) 1156: e8 c1 fe ff ff call 101c <putc> 115b: e9 31 01 00 00 jmp 1291 <printf+0x19c> } } else if(state == '%'){ 1160: 83 7d f0 25 cmpl $0x25,-0x10(%ebp) 1164: 0f 85 27 01 00 00 jne 1291 <printf+0x19c> if(c == 'd'){ 116a: 83 7d e8 64 cmpl $0x64,-0x18(%ebp) 116e: 75 2d jne 119d <printf+0xa8> printint(fd, *ap, 10, 1); 1170: 8b 45 f4 mov -0xc(%ebp),%eax 1173: 8b 00 mov (%eax),%eax 1175: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 117c: 00 117d: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 1184: 00 1185: 89 44 24 04 mov %eax,0x4(%esp) 1189: 8b 45 08 mov 0x8(%ebp),%eax 118c: 89 04 24 mov %eax,(%esp) 118f: e8 b0 fe ff ff call 1044 <printint> ap++; 1194: 83 45 f4 04 addl $0x4,-0xc(%ebp) 1198: e9 ed 00 00 00 jmp 128a <printf+0x195> } else if(c == 'x' || c == 'p'){ 119d: 83 7d e8 78 cmpl $0x78,-0x18(%ebp) 11a1: 74 06 je 11a9 <printf+0xb4> 11a3: 83 7d e8 70 cmpl $0x70,-0x18(%ebp) 11a7: 75 2d jne 11d6 <printf+0xe1> printint(fd, *ap, 16, 0); 11a9: 8b 45 f4 mov -0xc(%ebp),%eax 11ac: 8b 00 mov (%eax),%eax 11ae: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 11b5: 00 11b6: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 11bd: 00 11be: 89 44 24 04 mov %eax,0x4(%esp) 11c2: 8b 45 08 mov 0x8(%ebp),%eax 11c5: 89 04 24 mov %eax,(%esp) 11c8: e8 77 fe ff ff call 1044 <printint> ap++; 11cd: 83 45 f4 04 addl $0x4,-0xc(%ebp) } } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 11d1: e9 b4 00 00 00 jmp 128a <printf+0x195> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 11d6: 83 7d e8 73 cmpl $0x73,-0x18(%ebp) 11da: 75 46 jne 1222 <printf+0x12d> s = (char*)*ap; 11dc: 8b 45 f4 mov -0xc(%ebp),%eax 11df: 8b 00 mov (%eax),%eax 11e1: 89 45 e4 mov %eax,-0x1c(%ebp) ap++; 11e4: 83 45 f4 04 addl $0x4,-0xc(%ebp) if(s == 0) 11e8: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 11ec: 75 27 jne 1215 <printf+0x120> s = "(null)"; 11ee: c7 45 e4 20 18 00 00 movl $0x1820,-0x1c(%ebp) while(*s != 0){ 11f5: eb 1f jmp 1216 <printf+0x121> putc(fd, *s); 11f7: 8b 45 e4 mov -0x1c(%ebp),%eax 11fa: 0f b6 00 movzbl (%eax),%eax 11fd: 0f be c0 movsbl %al,%eax 1200: 89 44 24 04 mov %eax,0x4(%esp) 1204: 8b 45 08 mov 0x8(%ebp),%eax 1207: 89 04 24 mov %eax,(%esp) 120a: e8 0d fe ff ff call 101c <putc> s++; 120f: 83 45 e4 01 addl $0x1,-0x1c(%ebp) 1213: eb 01 jmp 1216 <printf+0x121> } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 1215: 90 nop 1216: 8b 45 e4 mov -0x1c(%ebp),%eax 1219: 0f b6 00 movzbl (%eax),%eax 121c: 84 c0 test %al,%al 121e: 75 d7 jne 11f7 <printf+0x102> 1220: eb 68 jmp 128a <printf+0x195> putc(fd, *s); s++; } } else if(c == 'c'){ 1222: 83 7d e8 63 cmpl $0x63,-0x18(%ebp) 1226: 75 1d jne 1245 <printf+0x150> putc(fd, *ap); 1228: 8b 45 f4 mov -0xc(%ebp),%eax 122b: 8b 00 mov (%eax),%eax 122d: 0f be c0 movsbl %al,%eax 1230: 89 44 24 04 mov %eax,0x4(%esp) 1234: 8b 45 08 mov 0x8(%ebp),%eax 1237: 89 04 24 mov %eax,(%esp) 123a: e8 dd fd ff ff call 101c <putc> ap++; 123f: 83 45 f4 04 addl $0x4,-0xc(%ebp) 1243: eb 45 jmp 128a <printf+0x195> } else if(c == '%'){ 1245: 83 7d e8 25 cmpl $0x25,-0x18(%ebp) 1249: 75 17 jne 1262 <printf+0x16d> putc(fd, c); 124b: 8b 45 e8 mov -0x18(%ebp),%eax 124e: 0f be c0 movsbl %al,%eax 1251: 89 44 24 04 mov %eax,0x4(%esp) 1255: 8b 45 08 mov 0x8(%ebp),%eax 1258: 89 04 24 mov %eax,(%esp) 125b: e8 bc fd ff ff call 101c <putc> 1260: eb 28 jmp 128a <printf+0x195> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 1262: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) 1269: 00 126a: 8b 45 08 mov 0x8(%ebp),%eax 126d: 89 04 24 mov %eax,(%esp) 1270: e8 a7 fd ff ff call 101c <putc> putc(fd, c); 1275: 8b 45 e8 mov -0x18(%ebp),%eax 1278: 0f be c0 movsbl %al,%eax 127b: 89 44 24 04 mov %eax,0x4(%esp) 127f: 8b 45 08 mov 0x8(%ebp),%eax 1282: 89 04 24 mov %eax,(%esp) 1285: e8 92 fd ff ff call 101c <putc> } state = 0; 128a: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 1291: 83 45 ec 01 addl $0x1,-0x14(%ebp) 1295: 8b 55 0c mov 0xc(%ebp),%edx 1298: 8b 45 ec mov -0x14(%ebp),%eax 129b: 8d 04 02 lea (%edx,%eax,1),%eax 129e: 0f b6 00 movzbl (%eax),%eax 12a1: 84 c0 test %al,%al 12a3: 0f 85 6e fe ff ff jne 1117 <printf+0x22> putc(fd, c); } state = 0; } } } 12a9: c9 leave 12aa: c3 ret 12ab: 90 nop 000012ac <free>: static Header base; static Header *freep; void free(void *ap) { 12ac: 55 push %ebp 12ad: 89 e5 mov %esp,%ebp 12af: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 12b2: 8b 45 08 mov 0x8(%ebp),%eax 12b5: 83 e8 08 sub $0x8,%eax 12b8: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 12bb: a1 ec 18 00 00 mov 0x18ec,%eax 12c0: 89 45 fc mov %eax,-0x4(%ebp) 12c3: eb 24 jmp 12e9 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 12c5: 8b 45 fc mov -0x4(%ebp),%eax 12c8: 8b 00 mov (%eax),%eax 12ca: 3b 45 fc cmp -0x4(%ebp),%eax 12cd: 77 12 ja 12e1 <free+0x35> 12cf: 8b 45 f8 mov -0x8(%ebp),%eax 12d2: 3b 45 fc cmp -0x4(%ebp),%eax 12d5: 77 24 ja 12fb <free+0x4f> 12d7: 8b 45 fc mov -0x4(%ebp),%eax 12da: 8b 00 mov (%eax),%eax 12dc: 3b 45 f8 cmp -0x8(%ebp),%eax 12df: 77 1a ja 12fb <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 12e1: 8b 45 fc mov -0x4(%ebp),%eax 12e4: 8b 00 mov (%eax),%eax 12e6: 89 45 fc mov %eax,-0x4(%ebp) 12e9: 8b 45 f8 mov -0x8(%ebp),%eax 12ec: 3b 45 fc cmp -0x4(%ebp),%eax 12ef: 76 d4 jbe 12c5 <free+0x19> 12f1: 8b 45 fc mov -0x4(%ebp),%eax 12f4: 8b 00 mov (%eax),%eax 12f6: 3b 45 f8 cmp -0x8(%ebp),%eax 12f9: 76 ca jbe 12c5 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 12fb: 8b 45 f8 mov -0x8(%ebp),%eax 12fe: 8b 40 04 mov 0x4(%eax),%eax 1301: c1 e0 03 shl $0x3,%eax 1304: 89 c2 mov %eax,%edx 1306: 03 55 f8 add -0x8(%ebp),%edx 1309: 8b 45 fc mov -0x4(%ebp),%eax 130c: 8b 00 mov (%eax),%eax 130e: 39 c2 cmp %eax,%edx 1310: 75 24 jne 1336 <free+0x8a> bp->s.size += p->s.ptr->s.size; 1312: 8b 45 f8 mov -0x8(%ebp),%eax 1315: 8b 50 04 mov 0x4(%eax),%edx 1318: 8b 45 fc mov -0x4(%ebp),%eax 131b: 8b 00 mov (%eax),%eax 131d: 8b 40 04 mov 0x4(%eax),%eax 1320: 01 c2 add %eax,%edx 1322: 8b 45 f8 mov -0x8(%ebp),%eax 1325: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 1328: 8b 45 fc mov -0x4(%ebp),%eax 132b: 8b 00 mov (%eax),%eax 132d: 8b 10 mov (%eax),%edx 132f: 8b 45 f8 mov -0x8(%ebp),%eax 1332: 89 10 mov %edx,(%eax) 1334: eb 0a jmp 1340 <free+0x94> } else bp->s.ptr = p->s.ptr; 1336: 8b 45 fc mov -0x4(%ebp),%eax 1339: 8b 10 mov (%eax),%edx 133b: 8b 45 f8 mov -0x8(%ebp),%eax 133e: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 1340: 8b 45 fc mov -0x4(%ebp),%eax 1343: 8b 40 04 mov 0x4(%eax),%eax 1346: c1 e0 03 shl $0x3,%eax 1349: 03 45 fc add -0x4(%ebp),%eax 134c: 3b 45 f8 cmp -0x8(%ebp),%eax 134f: 75 20 jne 1371 <free+0xc5> p->s.size += bp->s.size; 1351: 8b 45 fc mov -0x4(%ebp),%eax 1354: 8b 50 04 mov 0x4(%eax),%edx 1357: 8b 45 f8 mov -0x8(%ebp),%eax 135a: 8b 40 04 mov 0x4(%eax),%eax 135d: 01 c2 add %eax,%edx 135f: 8b 45 fc mov -0x4(%ebp),%eax 1362: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 1365: 8b 45 f8 mov -0x8(%ebp),%eax 1368: 8b 10 mov (%eax),%edx 136a: 8b 45 fc mov -0x4(%ebp),%eax 136d: 89 10 mov %edx,(%eax) 136f: eb 08 jmp 1379 <free+0xcd> } else p->s.ptr = bp; 1371: 8b 45 fc mov -0x4(%ebp),%eax 1374: 8b 55 f8 mov -0x8(%ebp),%edx 1377: 89 10 mov %edx,(%eax) freep = p; 1379: 8b 45 fc mov -0x4(%ebp),%eax 137c: a3 ec 18 00 00 mov %eax,0x18ec } 1381: c9 leave 1382: c3 ret 00001383 <morecore>: static Header* morecore(uint nu) { 1383: 55 push %ebp 1384: 89 e5 mov %esp,%ebp 1386: 83 ec 28 sub $0x28,%esp char *p; Header *hp; if(nu < 4096) 1389: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 1390: 77 07 ja 1399 <morecore+0x16> nu = 4096; 1392: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 1399: 8b 45 08 mov 0x8(%ebp),%eax 139c: c1 e0 03 shl $0x3,%eax 139f: 89 04 24 mov %eax,(%esp) 13a2: e8 3d fc ff ff call fe4 <sbrk> 13a7: 89 45 f0 mov %eax,-0x10(%ebp) if(p == (char*)-1) 13aa: 83 7d f0 ff cmpl $0xffffffff,-0x10(%ebp) 13ae: 75 07 jne 13b7 <morecore+0x34> return 0; 13b0: b8 00 00 00 00 mov $0x0,%eax 13b5: eb 22 jmp 13d9 <morecore+0x56> hp = (Header*)p; 13b7: 8b 45 f0 mov -0x10(%ebp),%eax 13ba: 89 45 f4 mov %eax,-0xc(%ebp) hp->s.size = nu; 13bd: 8b 45 f4 mov -0xc(%ebp),%eax 13c0: 8b 55 08 mov 0x8(%ebp),%edx 13c3: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 13c6: 8b 45 f4 mov -0xc(%ebp),%eax 13c9: 83 c0 08 add $0x8,%eax 13cc: 89 04 24 mov %eax,(%esp) 13cf: e8 d8 fe ff ff call 12ac <free> return freep; 13d4: a1 ec 18 00 00 mov 0x18ec,%eax } 13d9: c9 leave 13da: c3 ret 000013db <malloc>: void* malloc(uint nbytes) { 13db: 55 push %ebp 13dc: 89 e5 mov %esp,%ebp 13de: 83 ec 28 sub $0x28,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 13e1: 8b 45 08 mov 0x8(%ebp),%eax 13e4: 83 c0 07 add $0x7,%eax 13e7: c1 e8 03 shr $0x3,%eax 13ea: 83 c0 01 add $0x1,%eax 13ed: 89 45 f4 mov %eax,-0xc(%ebp) if((prevp = freep) == 0){ 13f0: a1 ec 18 00 00 mov 0x18ec,%eax 13f5: 89 45 f0 mov %eax,-0x10(%ebp) 13f8: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 13fc: 75 23 jne 1421 <malloc+0x46> base.s.ptr = freep = prevp = &base; 13fe: c7 45 f0 e4 18 00 00 movl $0x18e4,-0x10(%ebp) 1405: 8b 45 f0 mov -0x10(%ebp),%eax 1408: a3 ec 18 00 00 mov %eax,0x18ec 140d: a1 ec 18 00 00 mov 0x18ec,%eax 1412: a3 e4 18 00 00 mov %eax,0x18e4 base.s.size = 0; 1417: c7 05 e8 18 00 00 00 movl $0x0,0x18e8 141e: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 1421: 8b 45 f0 mov -0x10(%ebp),%eax 1424: 8b 00 mov (%eax),%eax 1426: 89 45 ec mov %eax,-0x14(%ebp) if(p->s.size >= nunits){ 1429: 8b 45 ec mov -0x14(%ebp),%eax 142c: 8b 40 04 mov 0x4(%eax),%eax 142f: 3b 45 f4 cmp -0xc(%ebp),%eax 1432: 72 4d jb 1481 <malloc+0xa6> if(p->s.size == nunits) 1434: 8b 45 ec mov -0x14(%ebp),%eax 1437: 8b 40 04 mov 0x4(%eax),%eax 143a: 3b 45 f4 cmp -0xc(%ebp),%eax 143d: 75 0c jne 144b <malloc+0x70> prevp->s.ptr = p->s.ptr; 143f: 8b 45 ec mov -0x14(%ebp),%eax 1442: 8b 10 mov (%eax),%edx 1444: 8b 45 f0 mov -0x10(%ebp),%eax 1447: 89 10 mov %edx,(%eax) 1449: eb 26 jmp 1471 <malloc+0x96> else { p->s.size -= nunits; 144b: 8b 45 ec mov -0x14(%ebp),%eax 144e: 8b 40 04 mov 0x4(%eax),%eax 1451: 89 c2 mov %eax,%edx 1453: 2b 55 f4 sub -0xc(%ebp),%edx 1456: 8b 45 ec mov -0x14(%ebp),%eax 1459: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 145c: 8b 45 ec mov -0x14(%ebp),%eax 145f: 8b 40 04 mov 0x4(%eax),%eax 1462: c1 e0 03 shl $0x3,%eax 1465: 01 45 ec add %eax,-0x14(%ebp) p->s.size = nunits; 1468: 8b 45 ec mov -0x14(%ebp),%eax 146b: 8b 55 f4 mov -0xc(%ebp),%edx 146e: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 1471: 8b 45 f0 mov -0x10(%ebp),%eax 1474: a3 ec 18 00 00 mov %eax,0x18ec return (void*)(p + 1); 1479: 8b 45 ec mov -0x14(%ebp),%eax 147c: 83 c0 08 add $0x8,%eax 147f: eb 38 jmp 14b9 <malloc+0xde> } if(p == freep) 1481: a1 ec 18 00 00 mov 0x18ec,%eax 1486: 39 45 ec cmp %eax,-0x14(%ebp) 1489: 75 1b jne 14a6 <malloc+0xcb> if((p = morecore(nunits)) == 0) 148b: 8b 45 f4 mov -0xc(%ebp),%eax 148e: 89 04 24 mov %eax,(%esp) 1491: e8 ed fe ff ff call 1383 <morecore> 1496: 89 45 ec mov %eax,-0x14(%ebp) 1499: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 149d: 75 07 jne 14a6 <malloc+0xcb> return 0; 149f: b8 00 00 00 00 mov $0x0,%eax 14a4: eb 13 jmp 14b9 <malloc+0xde> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 14a6: 8b 45 ec mov -0x14(%ebp),%eax 14a9: 89 45 f0 mov %eax,-0x10(%ebp) 14ac: 8b 45 ec mov -0x14(%ebp),%eax 14af: 8b 00 mov (%eax),%eax 14b1: 89 45 ec mov %eax,-0x14(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 14b4: e9 70 ff ff ff jmp 1429 <malloc+0x4e> } 14b9: c9 leave 14ba: c3 ret 14bb: 90 nop 000014bc <xchg>: asm volatile("sti"); } static inline uint xchg(volatile uint *addr, uint newval) { 14bc: 55 push %ebp 14bd: 89 e5 mov %esp,%ebp 14bf: 83 ec 10 sub $0x10,%esp uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 14c2: 8b 55 08 mov 0x8(%ebp),%edx 14c5: 8b 45 0c mov 0xc(%ebp),%eax 14c8: 8b 4d 08 mov 0x8(%ebp),%ecx 14cb: f0 87 02 lock xchg %eax,(%edx) 14ce: 89 45 fc mov %eax,-0x4(%ebp) "+m" (*addr), "=a" (result) : "1" (newval) : "cc"); return result; 14d1: 8b 45 fc mov -0x4(%ebp),%eax } 14d4: c9 leave 14d5: c3 ret 000014d6 <lock_init>: #include "x86.h" #include "proc.h" unsigned long rands = 1; void lock_init(lock_t *lock){ 14d6: 55 push %ebp 14d7: 89 e5 mov %esp,%ebp lock->locked = 0; 14d9: 8b 45 08 mov 0x8(%ebp),%eax 14dc: c7 00 00 00 00 00 movl $0x0,(%eax) } 14e2: 5d pop %ebp 14e3: c3 ret 000014e4 <lock_acquire>: void lock_acquire(lock_t *lock){ 14e4: 55 push %ebp 14e5: 89 e5 mov %esp,%ebp 14e7: 83 ec 08 sub $0x8,%esp while(xchg(&lock->locked,1) != 0); 14ea: 8b 45 08 mov 0x8(%ebp),%eax 14ed: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) 14f4: 00 14f5: 89 04 24 mov %eax,(%esp) 14f8: e8 bf ff ff ff call 14bc <xchg> 14fd: 85 c0 test %eax,%eax 14ff: 75 e9 jne 14ea <lock_acquire+0x6> } 1501: c9 leave 1502: c3 ret 00001503 <lock_release>: void lock_release(lock_t *lock){ 1503: 55 push %ebp 1504: 89 e5 mov %esp,%ebp 1506: 83 ec 08 sub $0x8,%esp xchg(&lock->locked,0); 1509: 8b 45 08 mov 0x8(%ebp),%eax 150c: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 1513: 00 1514: 89 04 24 mov %eax,(%esp) 1517: e8 a0 ff ff ff call 14bc <xchg> } 151c: c9 leave 151d: c3 ret 0000151e <thread_create>: void *thread_create(void(*start_routine)(void*), void *arg){ 151e: 55 push %ebp 151f: 89 e5 mov %esp,%ebp 1521: 83 ec 28 sub $0x28,%esp int tid; void * stack = malloc(2 * 4096); 1524: c7 04 24 00 20 00 00 movl $0x2000,(%esp) 152b: e8 ab fe ff ff call 13db <malloc> 1530: 89 45 f0 mov %eax,-0x10(%ebp) void *garbage_stack = stack; 1533: 8b 45 f0 mov -0x10(%ebp),%eax 1536: 89 45 f4 mov %eax,-0xc(%ebp) // printf(1,"start routine addr : %d\n",(uint)start_routine); if((uint)stack % 4096){ 1539: 8b 45 f0 mov -0x10(%ebp),%eax 153c: 25 ff 0f 00 00 and $0xfff,%eax 1541: 85 c0 test %eax,%eax 1543: 74 15 je 155a <thread_create+0x3c> stack = stack + (4096 - (uint)stack % 4096); 1545: 8b 45 f0 mov -0x10(%ebp),%eax 1548: 89 c2 mov %eax,%edx 154a: 81 e2 ff 0f 00 00 and $0xfff,%edx 1550: b8 00 10 00 00 mov $0x1000,%eax 1555: 29 d0 sub %edx,%eax 1557: 01 45 f0 add %eax,-0x10(%ebp) } if (stack == 0){ 155a: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 155e: 75 1b jne 157b <thread_create+0x5d> printf(1,"malloc fail \n"); 1560: c7 44 24 04 27 18 00 movl $0x1827,0x4(%esp) 1567: 00 1568: c7 04 24 01 00 00 00 movl $0x1,(%esp) 156f: e8 81 fb ff ff call 10f5 <printf> return 0; 1574: b8 00 00 00 00 mov $0x0,%eax 1579: eb 6f jmp 15ea <thread_create+0xcc> } tid = clone((uint)stack,PSIZE,(uint)start_routine,(int)arg); 157b: 8b 4d 0c mov 0xc(%ebp),%ecx 157e: 8b 55 08 mov 0x8(%ebp),%edx 1581: 8b 45 f0 mov -0x10(%ebp),%eax 1584: 89 4c 24 0c mov %ecx,0xc(%esp) 1588: 89 54 24 08 mov %edx,0x8(%esp) 158c: c7 44 24 04 00 10 00 movl $0x1000,0x4(%esp) 1593: 00 1594: 89 04 24 mov %eax,(%esp) 1597: e8 60 fa ff ff call ffc <clone> 159c: 89 45 ec mov %eax,-0x14(%ebp) if(tid < 0){ 159f: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 15a3: 79 1b jns 15c0 <thread_create+0xa2> printf(1,"clone fails\n"); 15a5: c7 44 24 04 35 18 00 movl $0x1835,0x4(%esp) 15ac: 00 15ad: c7 04 24 01 00 00 00 movl $0x1,(%esp) 15b4: e8 3c fb ff ff call 10f5 <printf> return 0; 15b9: b8 00 00 00 00 mov $0x0,%eax 15be: eb 2a jmp 15ea <thread_create+0xcc> } if(tid > 0){ 15c0: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 15c4: 7e 05 jle 15cb <thread_create+0xad> //store threads on thread table return garbage_stack; 15c6: 8b 45 f4 mov -0xc(%ebp),%eax 15c9: eb 1f jmp 15ea <thread_create+0xcc> } if(tid == 0){ 15cb: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 15cf: 75 14 jne 15e5 <thread_create+0xc7> printf(1,"tid = 0 return \n"); 15d1: c7 44 24 04 42 18 00 movl $0x1842,0x4(%esp) 15d8: 00 15d9: c7 04 24 01 00 00 00 movl $0x1,(%esp) 15e0: e8 10 fb ff ff call 10f5 <printf> } // wait(); // free(garbage_stack); return 0; 15e5: b8 00 00 00 00 mov $0x0,%eax } 15ea: c9 leave 15eb: c3 ret 000015ec <random>: // generate 0 -> max random number exclude max. int random(int max){ 15ec: 55 push %ebp 15ed: 89 e5 mov %esp,%ebp rands = rands * 1664525 + 1013904233; 15ef: a1 78 18 00 00 mov 0x1878,%eax 15f4: 69 c0 0d 66 19 00 imul $0x19660d,%eax,%eax 15fa: 05 69 f3 6e 3c add $0x3c6ef369,%eax 15ff: a3 78 18 00 00 mov %eax,0x1878 return (int)(rands % max); 1604: a1 78 18 00 00 mov 0x1878,%eax 1609: 8b 4d 08 mov 0x8(%ebp),%ecx 160c: ba 00 00 00 00 mov $0x0,%edx 1611: f7 f1 div %ecx 1613: 89 d0 mov %edx,%eax } 1615: 5d pop %ebp 1616: c3 ret 1617: 90 nop 00001618 <init_q>: #include "queue.h" #include "types.h" #include "user.h" void init_q(struct queue *q){ 1618: 55 push %ebp 1619: 89 e5 mov %esp,%ebp q->size = 0; 161b: 8b 45 08 mov 0x8(%ebp),%eax 161e: c7 00 00 00 00 00 movl $0x0,(%eax) q->head = 0; 1624: 8b 45 08 mov 0x8(%ebp),%eax 1627: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) q->tail = 0; 162e: 8b 45 08 mov 0x8(%ebp),%eax 1631: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 1638: 5d pop %ebp 1639: c3 ret 0000163a <add_q>: void add_q(struct queue *q, int v){ 163a: 55 push %ebp 163b: 89 e5 mov %esp,%ebp 163d: 83 ec 28 sub $0x28,%esp struct node * n = malloc(sizeof(struct node)); 1640: c7 04 24 08 00 00 00 movl $0x8,(%esp) 1647: e8 8f fd ff ff call 13db <malloc> 164c: 89 45 f4 mov %eax,-0xc(%ebp) n->next = 0; 164f: 8b 45 f4 mov -0xc(%ebp),%eax 1652: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) n->value = v; 1659: 8b 45 f4 mov -0xc(%ebp),%eax 165c: 8b 55 0c mov 0xc(%ebp),%edx 165f: 89 10 mov %edx,(%eax) if(q->head == 0){ 1661: 8b 45 08 mov 0x8(%ebp),%eax 1664: 8b 40 04 mov 0x4(%eax),%eax 1667: 85 c0 test %eax,%eax 1669: 75 0b jne 1676 <add_q+0x3c> q->head = n; 166b: 8b 45 08 mov 0x8(%ebp),%eax 166e: 8b 55 f4 mov -0xc(%ebp),%edx 1671: 89 50 04 mov %edx,0x4(%eax) 1674: eb 0c jmp 1682 <add_q+0x48> }else{ q->tail->next = n; 1676: 8b 45 08 mov 0x8(%ebp),%eax 1679: 8b 40 08 mov 0x8(%eax),%eax 167c: 8b 55 f4 mov -0xc(%ebp),%edx 167f: 89 50 04 mov %edx,0x4(%eax) } q->tail = n; 1682: 8b 45 08 mov 0x8(%ebp),%eax 1685: 8b 55 f4 mov -0xc(%ebp),%edx 1688: 89 50 08 mov %edx,0x8(%eax) q->size++; 168b: 8b 45 08 mov 0x8(%ebp),%eax 168e: 8b 00 mov (%eax),%eax 1690: 8d 50 01 lea 0x1(%eax),%edx 1693: 8b 45 08 mov 0x8(%ebp),%eax 1696: 89 10 mov %edx,(%eax) } 1698: c9 leave 1699: c3 ret 0000169a <empty_q>: int empty_q(struct queue *q){ 169a: 55 push %ebp 169b: 89 e5 mov %esp,%ebp if(q->size == 0) 169d: 8b 45 08 mov 0x8(%ebp),%eax 16a0: 8b 00 mov (%eax),%eax 16a2: 85 c0 test %eax,%eax 16a4: 75 07 jne 16ad <empty_q+0x13> return 1; 16a6: b8 01 00 00 00 mov $0x1,%eax 16ab: eb 05 jmp 16b2 <empty_q+0x18> else return 0; 16ad: b8 00 00 00 00 mov $0x0,%eax } 16b2: 5d pop %ebp 16b3: c3 ret 000016b4 <pop_q>: int pop_q(struct queue *q){ 16b4: 55 push %ebp 16b5: 89 e5 mov %esp,%ebp 16b7: 83 ec 28 sub $0x28,%esp int val; struct node *destroy; if(!empty_q(q)){ 16ba: 8b 45 08 mov 0x8(%ebp),%eax 16bd: 89 04 24 mov %eax,(%esp) 16c0: e8 d5 ff ff ff call 169a <empty_q> 16c5: 85 c0 test %eax,%eax 16c7: 75 5d jne 1726 <pop_q+0x72> val = q->head->value; 16c9: 8b 45 08 mov 0x8(%ebp),%eax 16cc: 8b 40 04 mov 0x4(%eax),%eax 16cf: 8b 00 mov (%eax),%eax 16d1: 89 45 f0 mov %eax,-0x10(%ebp) destroy = q->head; 16d4: 8b 45 08 mov 0x8(%ebp),%eax 16d7: 8b 40 04 mov 0x4(%eax),%eax 16da: 89 45 f4 mov %eax,-0xc(%ebp) q->head = q->head->next; 16dd: 8b 45 08 mov 0x8(%ebp),%eax 16e0: 8b 40 04 mov 0x4(%eax),%eax 16e3: 8b 50 04 mov 0x4(%eax),%edx 16e6: 8b 45 08 mov 0x8(%ebp),%eax 16e9: 89 50 04 mov %edx,0x4(%eax) free(destroy); 16ec: 8b 45 f4 mov -0xc(%ebp),%eax 16ef: 89 04 24 mov %eax,(%esp) 16f2: e8 b5 fb ff ff call 12ac <free> q->size--; 16f7: 8b 45 08 mov 0x8(%ebp),%eax 16fa: 8b 00 mov (%eax),%eax 16fc: 8d 50 ff lea -0x1(%eax),%edx 16ff: 8b 45 08 mov 0x8(%ebp),%eax 1702: 89 10 mov %edx,(%eax) if(q->size == 0){ 1704: 8b 45 08 mov 0x8(%ebp),%eax 1707: 8b 00 mov (%eax),%eax 1709: 85 c0 test %eax,%eax 170b: 75 14 jne 1721 <pop_q+0x6d> q->head = 0; 170d: 8b 45 08 mov 0x8(%ebp),%eax 1710: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) q->tail = 0; 1717: 8b 45 08 mov 0x8(%ebp),%eax 171a: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } return val; 1721: 8b 45 f0 mov -0x10(%ebp),%eax 1724: eb 05 jmp 172b <pop_q+0x77> } return -1; 1726: b8 ff ff ff ff mov $0xffffffff,%eax } 172b: c9 leave 172c: c3 ret
model-sets/2021-05-06-10-28-11-watform/FeatureInteraction_nancy.als
WatForm/catalyst
0
4156
/* Authors: <NAME>, <NAME>, <NAME>, <NAME> * Date: October 1, 2017 */ open ctl[State] open util/boolean //***********************STATE SPACE*************************// // Feature={CW,CF} is the set of features. abstract sig Feature{} one sig CW,CF extends Feature{} // Each phone number can have some features. //If a number has call-forwarding (CF), fw points to forwarded number. sig PhoneNumber{ feature: set Feature, fw: set PhoneNumber, } fact { // facts about types (PhoneNumber) // any PN can only have 0 or 1 PN as its fw number all n:PhoneNumber| lone n.fw // CF is a feature of PN only if the PN has a fw number set all n:PhoneNumber| CF in n.feature iff some n.fw // no number is forwarded to itself thru other numbers no (iden & (^fw)) } // Used to model the global states. sig State{ // Numbers that are idle, idle: set PhoneNumber, // (a->b) in busy iff a wants to talk to b, but b is not idle busy: PhoneNumber -> PhoneNumber, // (a->b) in calling iff a is trying to call b calling: PhoneNumber -> PhoneNumber, // (a->b) in talking iff a is talking to b talkingTo: PhoneNumber -> PhoneNumber, // (a->b) in waitingFor iff a is waiting for b waitingFor: PhoneNumber -> PhoneNumber, // (a->b) in forwardedTo iff a is forwarded to b forwardedTo: PhoneNumber -> PhoneNumber } //*****************INITIAL STATE CONSTRAINTS********************// pred initial[s:State]{ s.idle = PhoneNumber no s.calling no s.talkingTo no s.busy no s.waitingFor no s.forwardedTo } //*****************TRANSITION CONSTRAINTS/OPERATIONS********************// pred pre_idle_calling[s: State,n,n':PhoneNumber]{ n in s.idle n != n' } pred post_idle_calling[s,s': State,n,n':PhoneNumber]{ s'.idle = ((s.idle) - n) s'.calling = s.calling + (n->n') s'.talkingTo = s.talkingTo s'.busy = s.busy s'.waitingFor = s.waitingFor s'.forwardedTo = s.forwardedTo } pred idle_calling[s,s': State,n,n':PhoneNumber]{ pre_idle_calling[s,n,n'] post_idle_calling[s,s',n,n'] } pred pre_calling_talkingTo[s:State,n,n':PhoneNumber]{ n->n' in s.calling n' in s.idle } pred post_calling_talkingTo[s,s':State,n,n':PhoneNumber]{ s'.idle = s.idle - n' s'.calling = s.calling - (n -> n') s'.talkingTo = s.talkingTo + (n -> n') s'.busy = s.busy s'.waitingFor = s.waitingFor s'.forwardedTo = s.forwardedTo } pred calling_talkingTo[s,s':State,n,n':PhoneNumber]{ pre_calling_talkingTo[s,n,n'] post_calling_talkingTo[s,s',n,n'] } pred pre_talkingTo_idle[s:State,n,n':PhoneNumber]{ n -> n' in s.talkingTo } pred post_talkingTo_idle[s,s':State,n,n':PhoneNumber]{ s'.talkingTo = s.talkingTo - (n->n') s'.idle = s.idle + (n + n') s'.busy = s.busy s'.calling = s.calling s'.waitingFor = s.waitingFor s'.forwardedTo = s.forwardedTo } pred talkingTo_idle[s,s':State,n,n':PhoneNumber]{ pre_talkingTo_idle[s,n,n'] post_talkingTo_idle[s,s',n,n'] } pred pre_calling_busy[s:State,n,n':PhoneNumber]{ n->n' in s.calling n' not in s.idle } pred post_calling_busy[s,s':State,n,n':PhoneNumber]{ s'.calling = s.calling - (n->n') s'.busy = s.busy + (n->n') s'.idle = s.idle s'.talkingTo = s.talkingTo s'.waitingFor = s.waitingFor s'.forwardedTo = s.forwardedTo } pred calling_busy[s,s':State,n,n':PhoneNumber]{ pre_calling_busy[s,n,n'] post_calling_busy[s,s',n,n'] } pred pre_busy_waitingFor[s:State,n,n':PhoneNumber]{ (n->n') in s.busy CW in n'.feature // PN is not already being waited for, i.e., // can have only one call in CW queue, otherwise stay busy n' not in PhoneNumber.(s.waitingFor) } pred post_busy_waitingFor[s,s':State,n,n':PhoneNumber]{ s'.busy = s.busy - (n->n') s'.waitingFor = s.waitingFor + (n->n') s'.forwardedTo = s.forwardedTo s'.idle = s.idle s'.calling = s.calling s'.talkingTo = s.talkingTo } pred busy_waitingFor[s,s':State,n,n':PhoneNumber]{ pre_busy_waitingFor[s,n,n'] post_busy_waitingFor[s,s',n,n'] } // caller on CW hangs up pred pre_waitingFor_idle[s:State,n,n':PhoneNumber]{ n -> n' in s.waitingFor } pred post_waitingFor_idle[s,s':State,n,n':PhoneNumber]{ s'.waitingFor = s.waitingFor - (n -> n') s'.idle = s.idle + n s'.calling = s.calling s'.talkingTo = s.talkingTo s'.busy = s.busy s'.forwardedTo = s.forwardedTo } pred waitingFor_idle[s,s':State,n,n':PhoneNumber]{ pre_waitingFor_idle[s,n,n'] post_waitingFor_idle[s,s',n,n'] } pred pre_waitingFor_talkingTo[s:State,n,n':PhoneNumber]{ n -> n' in s.waitingFor } pred post_waitingFor_talkingTo[s,s':State,n,n':PhoneNumber]{ s'.waitingFor = s.waitingFor - (n -> n') s'.talkingTo = s.talkingTo + (n -> n') s'.idle = s.idle s.busy = s'.busy s.forwardedTo = s'.forwardedTo s.calling = s'.calling } pred waitingFor_talkingTo[s,s':State,n,n':PhoneNumber]{ pre_waitingFor_talkingTo[s,n,n'] post_waitingFor_talkingTo[s,s',n,n'] } pred pre_busy_forwardedTo[s:State,n,n':PhoneNumber]{ n -> n' in s.busy CF in n'.feature } pred post_busy_forwardedTo[s,s':State,n,n':PhoneNumber]{ s'.busy = s.busy - (n -> n') s'.forwardedTo = s.forwardedTo + (n -> n'.fw) s'.idle = s.idle s'.talkingTo = s.talkingTo s'.calling = s.calling s'.waitingFor = s.waitingFor } pred busy_forwardedTo[s,s':State,n,n':PhoneNumber]{ pre_busy_forwardedTo[s,n,n'] post_busy_forwardedTo[s,s',n,n'] } pred pre_forwardedTo_calling[s:State,n,n':PhoneNumber]{ n -> n' in s.forwardedTo } pred post_forwardedTo_calling[s,s':State,n,n':PhoneNumber]{ s'.forwardedTo = s.forwardedTo - (n->n') s'.calling = s.calling + (n -> n') s'.idle = s.idle s'.busy = s.busy s'.talkingTo = s.talkingTo s'.waitingFor = s.waitingFor } pred forwardedTo_calling[s,s':State,n,n':PhoneNumber]{ pre_forwardedTo_calling[s,n,n'] post_forwardedTo_calling[s,s',n,n'] } pred pre_busy_idle[s:State,n,n':PhoneNumber]{ n -> n' in s.busy no n'.feature } pred post_busy_idle[s,s':State,n,n':PhoneNumber]{ s'.busy = s.busy - (n -> n') s'.idle = s.idle + n s.talkingTo = s'.talkingTo s.waitingFor = s'.waitingFor s.forwardedTo = s'.forwardedTo s.calling = s'.calling } pred busy_idle[s,s':State,n,n':PhoneNumber]{ pre_busy_idle[s,n,n'] post_busy_idle[s,s',n,n'] } //*****************MODEL DEFINITION********************// fact md{ // init state constraint all s:State | s in initialState iff initial[s] // transition constraints all s,s': State| ((s->s') in nextState) iff (some n,n':PhoneNumber|( idle_calling[s,s',n,n'] or calling_talkingTo[s,s',n,n'] or talkingTo_idle[s,s',n,n'] or calling_busy[s,s',n,n'] or busy_waitingFor[s,s',n,n'] or busy_forwardedTo[s,s',n,n'] or busy_idle[s,s',n,n'] or waitingFor_idle[s,s',n,n'] or waitingFor_talkingTo[s,s',n,n'] or forwardedTo_calling[s,s',n,n'])) // equality predicate: states are records all s,s':State|( ((s.idle = s'.idle) and (s.calling = s'.calling) and (s.talkingTo = s'.talkingTo) and (s.busy = s'.busy) and (s.waitingFor = s'.waitingFor) and (s.forwardedTo = s'.forwardedTo)) implies (s =s')) } //*****************SIGNIFICANCE AXIOMS********************// pred initialStateAxiom { some s: State | s in initialState } pred totalityAxiom { all s: State | some s':State | s->s' in nextState } pred operationsAxiom { // at least one state must satisfy precons of each op some s:State | some n,n':PhoneNumber | pre_idle_calling[s,n,n'] some s:State | some n,n':PhoneNumber | pre_calling_talkingTo[s,n,n'] some s:State | some n,n':PhoneNumber | pre_talkingTo_idle[s,n,n'] some s:State | some n,n':PhoneNumber | pre_calling_busy[s,n,n'] some s:State | some n,n':PhoneNumber | pre_busy_waitingFor[s,n,n'] some s:State | some n,n':PhoneNumber | pre_busy_forwardedTo[s,n,n'] some s:State | some n,n':PhoneNumber | pre_busy_idle[s,n,n'] some s:State | some n,n':PhoneNumber | pre_waitingFor_idle[s,n,n'] some s:State | some n,n':PhoneNumber | pre_waitingFor_talkingTo[s,n,n'] some s:State | some n,n':PhoneNumber | pre_forwardedTo_calling[s,n,n'] // all possible ops from state must exist all s:State | some n,n':PhoneNumber | pre_idle_calling[s,n,n'] implies some s':State | post_idle_calling[s,s',n,n'] all s:State | some n,n':PhoneNumber | pre_calling_talkingTo[s,n,n'] implies some s':State | post_calling_talkingTo[s,s',n,n'] all s:State | some n,n':PhoneNumber | pre_talkingTo_idle[s,n,n'] implies some s':State | post_talkingTo_idle[s,s',n,n'] all s:State | some n,n':PhoneNumber | pre_calling_busy[s,n,n'] implies some s':State | post_calling_busy[s,s',n,n'] all s:State | some n,n':PhoneNumber | pre_busy_waitingFor[s,n,n'] implies some s':State | post_busy_waitingFor[s,s',n,n'] all s:State | some n,n':PhoneNumber | pre_busy_forwardedTo[s,n,n'] implies some s':State | post_busy_forwardedTo[s,s',n,n'] all s:State | some n,n':PhoneNumber | pre_busy_idle[s,n,n'] implies some s':State | post_busy_idle[s,s',n,n'] all s:State | some n,n':PhoneNumber | pre_waitingFor_idle[s,n,n'] implies some s':State | post_waitingFor_idle[s,s',n,n'] all s:State | some n,n':PhoneNumber | pre_waitingFor_talkingTo[s,n,n'] implies some s':State | post_waitingFor_talkingTo[s,s',n,n'] all s:State | some n,n':PhoneNumber | pre_forwardedTo_calling[s,n,n'] implies some s':State | post_forwardedTo_calling[s,s',n,n'] } pred significanceAxioms { initialStateAxiom totalityAxiom operationsAxiom } // increment scope until scope satisfies all preds including Sig. Axioms --run significanceAxioms for exactly 6 State, exactly 4 PhoneNumber //*****************PROPERTIES/CHECK********************// pred safety [s:State] { // no PN is both being waited for and being forwarded to no s.waitingFor.PhoneNumber & s.forwardedTo.PhoneNumber } assert MC { ctl_mc[ag[{s:State | safety[s]}]] } check MC for exactly 6 State, exactly 4 PhoneNumber
programs/tests/loadstore.asm
rj45/rj32
28
242080
<reponame>rj45/rj32 #include "../cpudef.asm" move r0, 2 move r1, 5 ; memory doesn't have 5 load r2, [r0,0] if.eq r2, 5 error ; store and check it does have 5 store [r0,0], r1 load r2, [r0,0] if.ne r2, 5 error ; check max offset of 15 move r1, 7 store [r0,15], r1 load r2, [r0,15] if.ne r2, 7 error ; check base equivalent to offset move r2, 0 add r0, 15 load r2, [r0, 0] if.ne r2, 7 error ; check multiple writes and reads in a row move r1, 1 move r2, 2 move r3, 3 move r4, 4 move r5, 5 move r6, 6 move r0, 0 store [r0, 3], r3 store [r0, 1], r1 store [r0, 6], r6 store [r0, 2], r2 store [r0, 4], r4 store [r0, 5], r5 move r1, -1 move r2, -1 move r3, -1 move r4, -1 move r5, -1 move r6, -1 load r5, [r0, 5] load r1, [r0, 1] load r6, [r0, 6] load r2, [r0, 2] load r4, [r0, 4] load r3, [r0, 3] if.ne r1, 1 error if.ne r2, 2 error if.ne r3, 3 error if.ne r4, 4 error if.ne r5, 5 error if.ne r6, 6 error load r3, [r0, 3] jump skiperr1 error skiperr1: store [r0, 3], r3 jump skiperr2 error skiperr2: halt
alloy4fun_models/trainstlt/models/1/qhtBkv9bdfagSMngP.als
Kaixi26/org.alloytools.alloy
0
4714
<reponame>Kaixi26/org.alloytools.alloy<gh_stars>0 open main pred idqhtBkv9bdfagSMngP_prop2 { eventually Green = Signal } pred __repair { idqhtBkv9bdfagSMngP_prop2 } check __repair { idqhtBkv9bdfagSMngP_prop2 <=> prop2o }
programs/oeis/031/A031393.asm
neoneye/loda
22
18379
; A031393: a(n) = prime(6*n - 4). ; 3,19,43,71,101,131,163,193,229,263,293,337,373,409,443,479,521,569,601,641,673,719,757,809,839,881,929,971,1013,1049,1091,1123,1181,1223,1277,1301,1361,1423,1451,1487,1531,1571,1609,1657,1699,1747,1789,1861,1889,1949,1997,2029,2083,2129,2161,2237,2273,2311,2357,2393,2441,2503,2551,2617,2663,2693,2729,2777,2819,2861,2917,2969,3023,3079,3137,3191,3251,3301,3331,3373,3449,3491,3533,3571,3617,3671,3709,3767,3821,3863,3917,3947,4013,4057,4111,4157,4219,4259,4297,4363 mul $0,6 seq $0,98090 ; Numbers k such that 2k-3 is prime. mul $0,2 sub $0,3
tests/tests.asm
spencerwooo/single-cycle-processor
9
176195
# ALU operation tests addiu $1, $0, 0x0050 addiu $2, $0, 0x0090 subu $3, $2, $1 add $4, $1, $2 # LUI LUI $5, 0x0153 LUI $6, 0x0153 # SW to dm SW $3, 0($0) SW $4, 4($0) # JUMP BEQ $5, $6, target LUI $7, 0x0007 target: LUI $8, 0x0008 # LW from dm LW $9, 4($0)
source/boot/boot.asm
alexanderghurst/operating_system
0
87935
use16 org 7C00h ; Boot the operating system. boot: cli cld ; Clear the segment registers. xor ax, ax mov ds, ax mov es, ax mov ss, ax mov sp, 7BFEh ; Set up the stack. sti ; Now that the stack is setup, restore ; interrupts. ; Prevents the system from executing past here. hang: hlt jmp hang ; If hlt fails, jump to hang. times 510-$+$$ db 0 ; Fill the bootsector with NUL bytes. dw 0AA55h ; Set the last two bytes to the boot signature: ; "55 AA."
alloy4fun_models/trainstlt/models/7/m8FbpfaAhHHe6MQ3R.als
Kaixi26/org.alloytools.alloy
0
4058
open main pred idm8FbpfaAhHHe6MQ3R_prop8 { always (all t:Train |(some t.pos and some t.pos.signal and some t.pos.prox) and (t.pos.signal) in (Signal-Green) implies(some t.pos') since ((t.pos'.signal) in Green)) } pred __repair { idm8FbpfaAhHHe6MQ3R_prop8 } check __repair { idm8FbpfaAhHHe6MQ3R_prop8 <=> prop8o }