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
oeis/161/A161480.asm
neoneye/loda-programs
11
16155
<reponame>neoneye/loda-programs<gh_stars>10-100 ; A161480: Decimal expansion of (129 +44*sqrt(2))/113. ; Submitted by <NAME> ; 1,6,9,2,2,6,0,1,4,8,1,8,0,6,7,4,1,7,8,2,9,4,4,6,2,8,6,6,0,6,3,9,5,3,2,3,4,1,3,3,3,2,3,5,6,2,0,9,3,6,7,8,8,9,5,7,5,0,2,1,1,5,7,9,3,9,4,6,2,1,4,9,6,0,3,8,3,4,2,5,6,3,8,0,0,1,5,0,8,9,8,3,2,2,2,6,7,5,1,5 bin $1,$0 mov $2,2 mov $3,$0 mul $3,4 lpb $3 add $5,$2 add $1,$5 add $2,$1 mov $1,$2 sub $3,1 lpe mul $1,2 add $2,$5 mov $4,10 pow $4,$0 add $5,$2 div $2,4 mul $2,3 add $2,$5 div $2,$4 div $1,$2 mov $0,$1 mod $0,10
oeis/049/A049651.asm
neoneye/loda-programs
11
168366
<reponame>neoneye/loda-programs ; A049651: a(n) = (F(3*n+1) - 1)/2, where F=A000045 (the Fibonacci sequence). ; Submitted by <NAME>(s1) ; 0,1,6,27,116,493,2090,8855,37512,158905,673134,2851443,12078908,51167077,216747218,918155951,3889371024,16475640049,69791931222,295643364939,1252365390980,5305104928861,22472785106426,95196245354567,403257766524696,1708227311453353,7236167012338110,30652895360805795,129847748455561292,550043889183050965,2330023305187765154,9870137109934111583,41810571744924211488,177112424089630957537,750260268103448041638,3178153496503423124091,13462874254117140538004,57029650512971985276109 mul $0,6 mov $3,1 lpb $0 sub $0,2 mov $2,$1 mov $1,$3 add $3,$2 lpe mov $0,$3 div $0,2
source/oasis/program-elements-aspect_specifications.ads
reznikmm/gela
0
26350
<filename>source/oasis/program-elements-aspect_specifications.ads<gh_stars>0 -- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Program.Element_Vectors; with Program.Elements.Definitions; with Program.Elements.Expressions; with Program.Lexical_Elements; package Program.Elements.Aspect_Specifications is pragma Pure (Program.Elements.Aspect_Specifications); type Aspect_Specification is limited interface and Program.Elements.Definitions.Definition; type Aspect_Specification_Access is access all Aspect_Specification'Class with Storage_Size => 0; not overriding function Aspect_Mark (Self : Aspect_Specification) return not null Program.Elements.Expressions.Expression_Access is abstract; not overriding function Aspect_Definition (Self : Aspect_Specification) return not null Program.Elements.Expressions.Expression_Access is abstract; type Aspect_Specification_Text is limited interface; type Aspect_Specification_Text_Access is access all Aspect_Specification_Text'Class with Storage_Size => 0; not overriding function To_Aspect_Specification_Text (Self : in out Aspect_Specification) return Aspect_Specification_Text_Access is abstract; not overriding function Arrow_Token (Self : Aspect_Specification_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; type Aspect_Specification_Vector is limited interface and Program.Element_Vectors.Element_Vector; type Aspect_Specification_Vector_Access is access all Aspect_Specification_Vector'Class with Storage_Size => 0; overriding function Element (Self : Aspect_Specification_Vector; Index : Positive) return not null Program.Elements.Element_Access is abstract with Post'Class => Element'Result.Is_Aspect_Specification; function To_Aspect_Specification (Self : Aspect_Specification_Vector'Class; Index : Positive) return not null Aspect_Specification_Access is (Self.Element (Index).To_Aspect_Specification); end Program.Elements.Aspect_Specifications;
programs/oeis/184/A184031.asm
neoneye/loda
22
99022
<reponame>neoneye/loda ; A184031: 1/16 the number of (n+1) X 2 0..3 arrays with all 2 X 2 subblocks having the same four values. ; 16,28,49,91,169,325,625,1225,2401,4753,9409,18721,37249,74305,148225,296065,591361,1181953,2362369,4723201,9443329,18883585,37761025,75515905,151019521,302026753,604028929,1208033281,2416017409,4831985665,9663873025,19327647745,38655098881,77310001153,154619609089,309238824961,618476863489,1236952940545,2473904308225,4947807043585,9895610941441,19791218737153,39582431182849,79164856074241,158329699565569,316659386548225,633318747930625,1266637470695425,2533274891059201,5066549731786753,10133099362910209,20266198625157121,40532397048987649,81064793896648705,162129587390644225,324259174378635265,648518347951964161,1297036695098621953,2594073388586631169,5188146775562649601,10376293547904073729,20752587092586921985,41505174178731393025,83010348351020335105,166020696689155768321,332041393365426634753,664082786705083465729,1328165573384397127681,2656331146717254647809,5312662293382969688065,10625324586662860161025,21250649173222641106945,42501298346239123783681,85002596692272089137153,170005193384131861413889,340010386767851405967361,680020773534878178213889,1360041547068931722706945,2720083094136214177972225,5440166188270779088502785,10880332376538259642122241,21760664753073220749361153,43521329506139844428955649,87042659012273091788144641,174085318024532989436755969,348170636049052784733978625,696341272098079181188890625,1392682544196131974098714625,2785365088392211171639296001,5570730176784369566720458753,11141460353568633580324651009,22282920707137161607533035521,44565841414274112108833538049,89131682828548013111434543105,178263365657095604010404020225,356526731314190785808342974465,713053462628380727191755816961,1426106925256760609958581501953,2852213850513519531067302739969,5704427701027037373284745216001 mov $1,4 mov $2,$0 lpb $0 mul $1,2 add $1,$2 sub $1,$0 sub $0,1 trn $2,2 lpe sub $1,4 mul $1,3 add $1,16 mov $0,$1
EngineHacks/CoreHacks/ModularLevelUp/LevelUpScreen/LevelUpScreenMisc/WriteGrowthtoRamAnimOn.asm
MokhaLeee/FE16re-Proto
5
178476
.thumb .include "_Definitions.h.s" @paste at 73588(FE8U) @r1=2020108 (write new level at +2 and original stats at +4), r3=battle struct+0x70, r5=char ptr (get original stats here), r4=battle struct ptr (get updated stats here) @r7 is free, r4-r5 might be as well push {r7} add r0,#0x1 @new level strh r0,[r1,#0x2] add r1,#0x4 @r1=202010C ldrb r0,[r5,#0x12] @current max hp strb r0,[r1] ldrb r2,[r3,#0x3] @hp boost add r0,r0,r2 strb r0,[r1,#0x10] @new max hp ldrb r0,[r5,#0x14] @current str strb r0,[r1,#0x1] ldrb r2,[r3,#0x4] @str boost add r0,r0,r2 strb r0,[r1,#0x11] @new str ldrb r0,[r5,#0x15] @current skl strb r0,[r1,#0x3] ldrb r2,[r3,#0x5] @skl boost add r0,r0,r2 strb r0,[r1,#0x13] @new skl ldrb r0,[r5,#0x16] @current spd strb r0,[r1,#0x4] ldrb r2,[r3,#0x6] @spd boost add r0,r0,r2 strb r0,[r1,#0x14] @new spd ldrb r0,[r5,#0x19] @current luk strb r0,[r1,#0x5] ldrb r2,[r3,#0x9] @luk boost add r0,r0,r2 strb r0,[r1,#0x15] @new luk ldrb r0,[r5,#0x17] @current def strb r0,[r1,#0x6] ldrb r2,[r3,#0x7] @def boost add r0,r0,r2 strb r0,[r1,#0x16] @new def ldrb r0,[r5,#0x18] @current res strb r0,[r1,#0x7] ldrb r2,[r3,#0x8] @res boost add r0,r0,r2 strb r0,[r1,#0x17] @new res @ ldrb r0,[r4,#0x1A] @con @ strb r0,[r1,#0x8] @ strb r0,[r1,#0x18] ldrb r0,[r4,#0x1D] @mov strb r0,[r1,#0x9] strb r0,[r1,#0x19] mov r0,r5 push {r1-r3} _blh1 GetMagAt pop {r1-r3} ldrb r0,[r0] @current mag strb r0,[r1,#0x2] push {r0-r3} mov r1, #0x70 sub r0, r3, r1 _blh1 GetBu_ChangeMagAt ldrb r7,[r0] pop {r0-r3} add r0,r7 strb r0,[r1,#0x12] @new mag mov r0, r5 @UnitStruct push {r1-r3} _blh1 GetChaAt pop {r1-r3} ldrb r0,[r0] strb r0,[r1, #0x8] push {r0-r3} mov r1, #0x70 @BattleStruct+0x7F-0x70 sub r0, r3, r1 _blh1 GetBu_ChangeChaAt ldrb r7,[r0] @Charm Boost pop {r0-r3} add r0, r7 strb r0,[r1, #0x18] pop {r7} .short 0xE07A @ b #0x807371E .align .ltorg
Assets/Animations/Mannequin/ADB/Character.adb
Battledrake/CryShooter
1
13667
<AnimDB FragDef="Animations/Mannequin/ADB/CharacterFragmentIds.xml" TagDef="Animations/Mannequin/ADB/CharacterTags.xml"> <FragmentList> <Jump> <Fragment BlendOutDuration="0.2" Tags="Rifle"> <AnimLayer> <Blend ExitTime="0" StartTime="0" Duration="0.2"/> <Animation name="unarmed_jump_loop" flags="Loop"/> </AnimLayer> </Fragment> <Fragment BlendOutDuration="0.2" Tags="Pistol"> <AnimLayer> <Blend ExitTime="0" StartTime="0" Duration="0.00077056885"/> <Animation name="unarmed_jump_begin"/> <Blend ExitTime="0" StartTime="0" Duration="0.25077054"/> <Animation name="unarmed_jump_loop" flags="Loop"/> </AnimLayer> </Fragment> <Fragment BlendOutDuration="0.2" Tags=""> <AnimLayer> <Blend ExitTime="0" StartTime="0" Duration="0.00077056885"/> <Animation name="unarmed_jump_begin"/> <Blend ExitTime="0" StartTime="0" Duration="0.25077054"/> <Animation name="unarmed_jump_loop" flags="Loop"/> </AnimLayer> </Fragment> </Jump> <Locomotion> <Fragment BlendOutDuration="0.2" Tags="Rifle"> <AnimLayer> <Blend ExitTime="0" StartTime="0" Duration="1.7881393e-07"/> <Animation name="BSpace_MoveStrafe_Rifle" flags="Loop"/> </AnimLayer> </Fragment> <Fragment BlendOutDuration="0.2" Tags="Pistol"> <AnimLayer> <Blend ExitTime="0" StartTime="0" Duration="0"/> <Animation name="BSpace_MoveStrafe_Pistol" flags="Loop"/> </AnimLayer> </Fragment> <Fragment BlendOutDuration="0.2" Tags=""> <AnimLayer> <Blend ExitTime="0" StartTime="0" Duration="0"/> <Animation name="BSpace_MoveStrafe_Unarmed" flags="Loop"/> </AnimLayer> </Fragment> </Locomotion> <Fire> <Fragment BlendOutDuration="0.2" Tags=""> <AnimLayer> <Blend ExitTime="0" StartTime="0" Duration="0"/> <Animation name="rifle_aim_fire" flags="Loop"/> </AnimLayer> </Fragment> </Fire> </FragmentList> </AnimDB>
week_7/dataset/Assembly/056591.asm
Dumebi35/DumebiCSC102
0
1865
<reponame>Dumebi35/DumebiCSC102 ; Write three short procedures that set the cursor size to ; (1) a solid block, (2) top line, and (3) normal size. ; ; Note: On a VGA display, the cursor can either be on top, on ; bottom, or a solid block. Therefore, the mid-height cursor ; mentioned in the Exercise 14 is not possible. This error ; was corrected in the second printing. .model small .stack 100h .data solidMsg db "Solid cursor: ",0 topMsg db "Top-line cursor: ",0 normalMsg db "Normal cursor: ",0 .code include library.inc main proc mov ax,@data mov ds,ax call solid_cursor call top_cursor call default_cursor mov ax,4C00h int 21h main endp solid_cursor proc mov dx,offset solidMsg call Writestring mov ah,1 mov ch,0 mov cl,7 int 10h call getch call Crlf ret solid_cursor endp top_cursor proc mov dx,offset topMsg call Writestring mov ah,1 mov ch,0 mov cl,1 int 10h call getch call Crlf ret top_cursor endp default_cursor proc mov dx,offset normalMsg call Writestring mov ah,1 mov ch,6 mov cl,7 int 10h call getch call Crlf ret default_cursor endp getch proc mov ah,1 ; wait for keystroke int 21h ret getch endp end main
opengl/src/generated/gl-load_function_pointers.adb
Cre8or/OpenGLAda
79
19283
<gh_stars>10-100 -- Autogenerated by Generate, do not edit with System; with Ada.Unchecked_Conversion; private with GL.API.Subprogram_Reference; private with GL.API.Doubles; private with GL.API.Ints; private with GL.API.Shorts; private with GL.API.Singles; private with GL.API.UInts; private with GL.API; procedure GL.Load_Function_Pointers is use GL.API; generic type Function_Reference is private; function Load (Function_Name : String) return Function_Reference; pragma Inline (Load); function Load (Function_Name : String) return Function_Reference is function As_Function_Reference is new Ada.Unchecked_Conversion ( Source => System.Address, Target => Function_Reference); use type System.Address; Raw : System.Address := Subprogram_Reference (Function_Name); begin if Raw = System.Null_Address then Raw := Subprogram_Reference (Function_Name & "ARB"); if Raw = System.Null_Address then Raw := Subprogram_Reference (Function_Name & "EXT"); end if; end if; return As_Function_Reference (Raw); end Load; function Load_T1 is new Load (T1); function Load_T2 is new Load (T2); function Load_T3 is new Load (T3); function Load_T4 is new Load (T4); function Load_T5 is new Load (T5); function Load_T6 is new Load (T6); function Load_T7 is new Load (T7); function Load_T8 is new Load (T8); function Load_T9 is new Load (T9); function Load_T10 is new Load (T10); function Load_T11 is new Load (T11); function Load_T12 is new Load (T12); function Load_T13 is new Load (T13); function Load_T14 is new Load (T14); function Load_T15 is new Load (T15); function Load_T16 is new Load (T16); function Load_T17 is new Load (T17); function Load_T18 is new Load (T18); function Load_T19 is new Load (T19); function Load_T20 is new Load (T20); function Load_T21 is new Load (T21); function Load_T22 is new Load (T22); function Load_T23 is new Load (T23); function Load_T24 is new Load (T24); function Load_T25 is new Load (T25); function Load_T26 is new Load (T26); function Load_T27 is new Load (T27); function Load_T28 is new Load (T28); function Load_T29 is new Load (T29); function Load_T30 is new Load (T30); function Load_T31 is new Load (T31); function Load_T32 is new Load (T32); function Load_T33 is new Load (T33); function Load_T34 is new Load (T34); function Load_T35 is new Load (T35); function Load_T36 is new Load (T36); function Load_T37 is new Load (T37); function Load_T38 is new Load (T38); function Load_T39 is new Load (T39); function Load_T40 is new Load (T40); function Load_T41 is new Load (T41); function Load_T42 is new Load (T42); function Load_T43 is new Load (T43); function Load_T44 is new Load (T44); function Load_T45 is new Load (T45); function Load_T46 is new Load (T46); function Load_T47 is new Load (T47); function Load_T48 is new Load (T48); function Load_T49 is new Load (T49); function Load_T50 is new Load (T50); function Load_T51 is new Load (T51); function Load_T52 is new Load (T52); function Load_T53 is new Load (T53); function Load_T54 is new Load (T54); function Load_T55 is new Load (T55); function Load_T56 is new Load (T56); function Load_T57 is new Load (T57); function Load_T58 is new Load (T58); function Load_T59 is new Load (T59); function Load_T60 is new Load (T60); function Load_T61 is new Load (T61); function Load_T62 is new Load (T62); function Load_T63 is new Load (T63); function Load_T64 is new Load (T64); function Load_T65 is new Load (T65); function Load_T66 is new Load (T66); function Load_T67 is new Load (T67); function Load_T68 is new Load (T68); function Load_T69 is new Load (T69); function Load_T70 is new Load (T70); function Load_T71 is new Load (T71); function Load_T72 is new Load (T72); function Load_T73 is new Load (T73); function Load_T74 is new Load (T74); function Load_T75 is new Load (T75); function Load_T76 is new Load (T76); function Load_T77 is new Load (T77); function Load_T78 is new Load (T78); function Load_T79 is new Load (T79); function Load_T80 is new Load (T80); function Load_T81 is new Load (T81); function Load_T82 is new Load (T82); function Load_T83 is new Load (T83); function Load_T84 is new Load (T84); function Load_T85 is new Load (T85); function Load_T86 is new Load (T86); function Load_T87 is new Load (T87); function Load_T88 is new Load (T88); function Load_T89 is new Load (T89); function Load_T90 is new Load (T90); function Load_T91 is new Load (T91); function Load_T92 is new Load (T92); function Load_T93 is new Load (T93); function Load_T94 is new Load (T94); function Load_T95 is new Load (T95); function Load_T96 is new Load (T96); function Load_T97 is new Load (T97); function Load_T98 is new Load (T98); function Load_T99 is new Load (T99); function Load_T100 is new Load (T100); function Load_T101 is new Load (T101); function Load_T102 is new Load (T102); function Load_T103 is new Load (T103); function Load_T104 is new Load (T104); function Load_T105 is new Load (T105); function Load_T106 is new Load (T106); function Load_T107 is new Load (T107); function Load_T108 is new Load (T108); function Load_T109 is new Load (T109); function Load_T110 is new Load (T110); function Load_T111 is new Load (T111); function Load_T112 is new Load (T112); function Load_T113 is new Load (T113); function Load_T114 is new Load (T114); function Load_T115 is new Load (T115); function Load_T116 is new Load (T116); function Load_T117 is new Load (T117); function Load_T118 is new Load (T118); function Load_T119 is new Load (T119); function Load_T120 is new Load (T120); function Load_T121 is new Load (T121); function Load_T122 is new Load (T122); function Load_T123 is new Load (T123); function Load_T124 is new Load (T124); function Load_T125 is new Load (T125); function Load_T126 is new Load (T126); function Load_T127 is new Load (T127); function Load_T128 is new Load (T128); function Load_T129 is new Load (T129); function Load_T130 is new Load (T130); function Load_T131 is new Load (T131); function Load_T132 is new Load (T132); function Load_T133 is new Load (T133); function Load_T134 is new Load (T134); function Load_T135 is new Load (T135); function Load_T136 is new Load (T136); function Load_T137 is new Load (T137); function Load_T138 is new Load (T138); function Load_T139 is new Load (T139); function Load_T140 is new Load (T140); function Load_T141 is new Load (T141); function Load_T142 is new Load (T142); function Load_T143 is new Load (T143); function Load_T144 is new Load (T144); function Load_T145 is new Load (T145); function Load_T146 is new Load (T146); function Load_T147 is new Load (T147); function Load_T148 is new Load (T148); function Load_T149 is new Load (T149); function Load_T150 is new Load (T150); function Load_T151 is new Load (T151); function Load_T152 is new Load (T152); function Load_T153 is new Load (T153); function Load_T154 is new Load (T154); function Load_T155 is new Load (T155); function Load_T156 is new Load (T156); function Load_T157 is new Load (T157); function Load_T158 is new Load (T158); function Load_T159 is new Load (T159); function Load_T160 is new Load (T160); function Load_T161 is new Load (T161); function Load_T162 is new Load (T162); function Load_T163 is new Load (T163); function Load_T164 is new Load (T164); function Load_T165 is new Load (T165); function Load_T166 is new Load (T166); function Load_T167 is new Load (T167); function Load_T168 is new Load (T168); function Load_T169 is new Load (T169); function Load_T170 is new Load (T170); function Load_T171 is new Load (T171); function Load_T172 is new Load (T172); function Load_T173 is new Load (T173); function Load_T174 is new Load (T174); function Load_T175 is new Load (T175); function Load_T176 is new Load (T176); function Load_T177 is new Load (T177); function Load_T178 is new Load (T178); function Load_T179 is new Load (T179); function Load_T180 is new Load (T180); function Load_T181 is new Load (T181); function Load_T182 is new Load (T182); function Load_T183 is new Load (T183); function Load_T184 is new Load (T184); function Load_T185 is new Load (T185); function Load_T186 is new Load (T186); function Load_T187 is new Load (T187); function Load_T188 is new Load (T188); function Load_T189 is new Load (T189); function Load_T190 is new Load (T190); function Load_T191 is new Load (T191); function Load_T192 is new Load (T192); function Load_T193 is new Load (T193); function Load_T194 is new Load (T194); begin GL.API.Doubles.Vertex_Attrib1 := Load_T1 ("glVertexAttribL1d"); GL.API.Doubles.Vertex_Attrib2 := Load_T2 ("glVertexAttribL2d"); GL.API.Doubles.Vertex_Attrib2v := Load_T3 ("glVertexAttribL2dv"); GL.API.Doubles.Vertex_Attrib3 := Load_T4 ("glVertexAttribL3d"); GL.API.Doubles.Vertex_Attrib3v := Load_T5 ("glVertexAttribL3dv"); GL.API.Doubles.Vertex_Attrib4 := Load_T6 ("glVertexAttribL4d"); GL.API.Doubles.Vertex_Attrib4v := Load_T7 ("glVertexAttribL4dv"); GL.API.Ints.Uniform1 := Load_T8 ("glUniform1i"); GL.API.Ints.Uniform1v := Load_T9 ("glUniform1iv"); GL.API.Ints.Uniform2 := Load_T10 ("glUniform2i"); GL.API.Ints.Uniform2v := Load_T11 ("glUniform2iv"); GL.API.Ints.Uniform3 := Load_T12 ("glUniform3i"); GL.API.Ints.Uniform3v := Load_T13 ("glUniform3iv"); GL.API.Ints.Uniform4 := Load_T14 ("glUniform4i"); GL.API.Ints.Uniform4v := Load_T15 ("glUniform4iv"); GL.API.Ints.Uniform_Matrix2 := Load_T16 ("glUniformMatrix2iv"); GL.API.Ints.Uniform_Matrix3 := Load_T17 ("glUniformMatrix3iv"); GL.API.Ints.Uniform_Matrix4 := Load_T18 ("glUniformMatrix4iv"); GL.API.Ints.Vertex_Attrib1 := Load_T19 ("glVertexAttribI1i"); GL.API.Ints.Vertex_Attrib2 := Load_T20 ("glVertexAttribI2i"); GL.API.Ints.Vertex_Attrib2v := Load_T21 ("glVertexAttribI2iv"); GL.API.Ints.Vertex_Attrib3 := Load_T22 ("glVertexAttribI3i"); GL.API.Ints.Vertex_Attrib3v := Load_T23 ("glVertexAttribI3iv"); GL.API.Ints.Vertex_Attrib4 := Load_T24 ("glVertexAttribI4i"); GL.API.Ints.Vertex_Attrib4v := Load_T25 ("glVertexAttrib4Iiv"); GL.API.Shorts.Vertex_Attrib1 := Load_T26 ("glVertexAttrib1s"); GL.API.Shorts.Vertex_Attrib2 := Load_T27 ("glVertexAttrib2s"); GL.API.Shorts.Vertex_Attrib2v := Load_T28 ("glVertexAttrib2sv"); GL.API.Shorts.Vertex_Attrib3 := Load_T29 ("glVertexAttrib3s"); GL.API.Shorts.Vertex_Attrib3v := Load_T30 ("glVertexAttrib3sv"); GL.API.Shorts.Vertex_Attrib4 := Load_T31 ("glVertexAttrib4s"); GL.API.Shorts.Vertex_Attrib4v := Load_T32 ("glVertexAttrib4sv"); GL.API.Singles.Uniform1 := Load_T33 ("glUniform1f"); GL.API.Singles.Uniform1v := Load_T34 ("glUniform1fv"); GL.API.Singles.Uniform2 := Load_T35 ("glUniform2f"); GL.API.Singles.Uniform2v := Load_T36 ("glUniform2fv"); GL.API.Singles.Uniform3 := Load_T37 ("glUniform3f"); GL.API.Singles.Uniform3v := Load_T38 ("glUniform3fv"); GL.API.Singles.Uniform4 := Load_T39 ("glUniform4f"); GL.API.Singles.Uniform4v := Load_T40 ("glUniform4fv"); GL.API.Singles.Uniform_Matrix2 := Load_T41 ("glUniformMatrix2fv"); GL.API.Singles.Uniform_Matrix3 := Load_T42 ("glUniformMatrix3fv"); GL.API.Singles.Uniform_Matrix4 := Load_T43 ("glUniformMatrix4fv"); GL.API.Singles.Vertex_Attrib1 := Load_T44 ("glVertexAttrib1f"); GL.API.Singles.Vertex_Attrib2 := Load_T45 ("glVertexAttrib2f"); GL.API.Singles.Vertex_Attrib2v := Load_T46 ("glVertexAttrib2fv"); GL.API.Singles.Vertex_Attrib3 := Load_T47 ("glVertexAttrib3f"); GL.API.Singles.Vertex_Attrib3v := Load_T48 ("glVertexAttrib3fv"); GL.API.Singles.Vertex_Attrib4 := Load_T49 ("glVertexAttrib4f"); GL.API.Singles.Vertex_Attrib4v := Load_T50 ("glVertexAttrib4fv"); GL.API.UInts.Uniform1 := Load_T51 ("glUniform1ui"); GL.API.UInts.Uniform1v := Load_T52 ("glUniform1uiv"); GL.API.UInts.Uniform2 := Load_T53 ("glUniform2ui"); GL.API.UInts.Uniform2v := Load_T54 ("glUniform2uiv"); GL.API.UInts.Uniform3 := Load_T55 ("glUniform3ui"); GL.API.UInts.Uniform3v := Load_T56 ("glUniform3uiv"); GL.API.UInts.Uniform4 := Load_T57 ("glUniform4ui"); GL.API.UInts.Uniform4v := Load_T58 ("glUniform4uiv"); GL.API.UInts.Uniform_Matrix2 := Load_T59 ("glUniformMatrix2uiv"); GL.API.UInts.Uniform_Matrix3 := Load_T60 ("glUniformMatrix3uiv"); GL.API.UInts.Uniform_Matrix4 := Load_T61 ("glUniformMatrix4uiv"); GL.API.UInts.Vertex_Attrib1 := Load_T62 ("glVertexAttribI1ui"); GL.API.UInts.Vertex_Attrib2 := Load_T63 ("glVertexAttribI2ui"); GL.API.UInts.Vertex_Attrib2v := Load_T64 ("glVertexAttribI2uiv"); GL.API.UInts.Vertex_Attrib3 := Load_T65 ("glVertexAttribI3ui"); GL.API.UInts.Vertex_Attrib3v := Load_T66 ("glVertexAttribI3uiv"); GL.API.UInts.Vertex_Attrib4 := Load_T67 ("glVertexAttribI4ui"); GL.API.UInts.Vertex_Attrib4v := Load_T68 ("glVertexAttrib4Iuiv"); GL.API.Debug_Message_Insert := Load_T69 ("glDebugMessageInsert"); GL.API.Push_Debug_Group := Load_T70 ("glPushDebugGroup"); GL.API.Pop_Debug_Group := Load_T71 ("glPopDebugGroup"); GL.API.Debug_Message_Control := Load_T72 ("glDebugMessageControl"); GL.API.Get_Debug_Message_Log := Load_T73 ("glGetDebugMessageLog"); GL.API.Debug_Message_Callback := Load_T74 ("glDebugMessageCallback"); GL.API.Get_String_I := Load_T75 ("glGetStringi"); GL.API.Secondary_Color := Load_T76 ("glSecondaryColor3dv"); GL.API.Fog_Coord := Load_T77 ("glFogCoordd"); GL.API.Draw_Arrays_Instanced := Load_T78 ("glDrawArraysInstanced"); GL.API.Draw_Elements_Instanced := Load_T79 ("glDrawElementsInstanced"); GL.API.Draw_Elements_Base_Vertex := Load_T80 ("glDrawElementsBaseVertex"); GL.API.Draw_Transform_Feedback := Load_T81 ("glDrawTransformFeedback"); GL.API.Draw_Transform_Feedback_Stream := Load_T82 ("glDrawTransformFeedbackStream"); GL.API.Primitive_Restart_Index := Load_T83 ("glPrimitiveRestartIndex"); GL.API.Vertex_Attrib_Divisor := Load_T84 ("glVertexAttribDivisor"); GL.API.Blend_Func_I := Load_T85 ("glBlendFunci"); GL.API.Blend_Func_Separate := Load_T86 ("glBlendFuncSeparate"); GL.API.Blend_Func_Separate_I := Load_T87 ("glBlendFuncSeparate"); GL.API.Blend_Color := Load_T88 ("glBlendColor"); GL.API.Blend_Equation := Load_T89 ("glBlendEquation"); GL.API.Blend_Equation_I := Load_T90 ("glBlendEquationi"); GL.API.Blend_Equation_Separate := Load_T91 ("glBlendEquationSeparate"); GL.API.Blend_Equation_Separate_I := Load_T92 ("glBlendEquationi"); GL.API.Set_Point_Parameter_Single := Load_T93 ("glPointParameterf"); GL.API.Draw_Buffers := Load_T94 ("glDrawBuffers"); GL.API.Clear_Accum := Load_T88 ("glClearAccum"); GL.API.Clear_Buffer := Load_T95 ("glClearBufferfv"); GL.API.Clear_Draw_Buffer := Load_T96 ("glClearBufferfv"); GL.API.Clear_Buffer_Depth := Load_T97 ("glClearBufferfv"); GL.API.Clear_Buffer_Stencil := Load_T98 ("glClearBufferiv"); GL.API.Clear_Buffer_Depth_Stencil := Load_T99 ("glClearBufferfi"); GL.API.Stencil_Func_Separate := Load_T100 ("glStencilFuncSeparate"); GL.API.Stencil_Op_Separate := Load_T101 ("glStencilOpSeparate"); GL.API.Stencil_Mask_Separate := Load_T102 ("glStencilMaskSeparate"); GL.API.Compressed_Tex_Image_1D := Load_T103 ("glCompressedTexImage1D"); GL.API.Tex_Sub_Image_1D := Load_T104 ("glTexSubImage1D"); GL.API.Tex_Storage_1D := Load_T105 ("glTexStorage1D"); GL.API.Compressed_Tex_Image_2D := Load_T106 ("glCompressedTexImage2D"); GL.API.Tex_Storage_2D := Load_T107 ("glTexStorage2D"); GL.API.Tex_Image_3D := Load_T108 ("glTexImage3D"); GL.API.Compressed_Tex_Image_3D := Load_T109 ("glCompressedTexImage3D"); GL.API.Tex_Sub_Image_3D := Load_T104 ("glTexSubImage3D"); GL.API.Tex_Storage_3D := Load_T110 ("glTexStorage3D"); GL.API.Active_Texture := Load_T111 ("glActiveTexture"); GL.API.Generate_Mipmap := Load_T112 ("glGenerateMipmap"); GL.API.Invalidate_Tex_Image := Load_T113 ("glInvalidateTexImage"); GL.API.Invalidate_Tex_Sub_Image := Load_T114 ("glInvalidateTexSubImage"); GL.API.Gen_Buffers := Load_T115 ("glGenBuffers"); GL.API.Gen_Transform_Feedbacks := Load_T115 ("glGenTransformFeedbacks"); GL.API.Delete_Buffers := Load_T116 ("glDeleteBuffers"); GL.API.Delete_Transform_Feedbacks := Load_T116 ("glDeleteTransformFeedbacks"); GL.API.Bind_Buffer := Load_T117 ("glBindBuffer"); GL.API.Bind_Transform_Feedback := Load_T117 ("glBindTransformFeedback"); GL.API.Bind_Buffer_Base := Load_T118 ("glBindBufferBase"); GL.API.Buffer_Data := Load_T119 ("glBufferData"); GL.API.Texture_Buffer_Data := Load_T120 ("glTexBuffer"); GL.API.Map_Buffer := Load_T121 ("glMapBuffer"); GL.API.Map_Buffer_Range := Load_T122 ("glMapBufferRange"); GL.API.Buffer_Pointer := Load_T123 ("glGetBufferPointerv"); GL.API.Buffer_Sub_Data := Load_T124 ("glBufferSubData"); GL.API.Get_Buffer_Sub_Data := Load_T124 ("glGetBufferSubData"); GL.API.Unmap_Buffer := Load_T125 ("glUnmapBuffer"); GL.API.Get_Buffer_Parameter_Access_Kind := Load_T126 ("glGetBufferParameteriv"); GL.API.Get_Buffer_Parameter_Bool := Load_T127 ("glGetBufferParameteriv"); GL.API.Get_Buffer_Parameter_Size := Load_T128 ("glGetBufferParameteriv"); GL.API.Get_Buffer_Parameter_Usage := Load_T129 ("glGetBufferParameteriv"); GL.API.Invalidate_Buffer_Data := Load_T130 ("glInvalidateBufferData"); GL.API.Invalidate_Buffer_Sub_Data := Load_T131 ("glInvalidateBufferSubData"); GL.API.Flush_Mapped_Buffer_Range := Load_T132 ("glFlushMappedBufferRange"); GL.API.Gen_Vertex_Arrays := Load_T133 ("glGenVertexArrays"); GL.API.Delete_Vertex_Arrays := Load_T134 ("glDeleteVertexArrays"); GL.API.Bind_Vertex_Array := Load_T135 ("glBindVertexArray"); GL.API.Gen_Renderbuffers := Load_T136 ("glGenRenderbuffers"); GL.API.Delete_Renderbuffers := Load_T137 ("glDeleteBuffers"); GL.API.Renderbuffer_Storage := Load_T138 ("glRenderbufferStorage"); GL.API.Renderbuffer_Storage_Multisample := Load_T139 ("glRenderbufferStorageMultisample"); GL.API.Bind_Renderbuffer := Load_T140 ("glBindRenderbuffer"); GL.API.Get_Renderbuffer_Parameter_Int := Load_T141 ("glGetRenderbufferParameteriv"); GL.API.Get_Renderbuffer_Parameter_Internal_Format := Load_T142 ("glGetRenderbufferParameteriv"); GL.API.Clamp_Color := Load_T143 ("glClampColor"); GL.API.Gen_Framebuffers := Load_T144 ("glGenFramebuffers"); GL.API.Delete_Framebuffers := Load_T145 ("glDeleteFramebuffers"); GL.API.Bind_Framebuffer := Load_T146 ("glBindFramebuffer"); GL.API.Check_Framebuffer_Status := Load_T147 ("glCheckFramebufferStatus"); GL.API.Framebuffer_Renderbuffer := Load_T148 ("glFramebufferRenderbuffer"); GL.API.Framebuffer_Texture := Load_T149 ("glFramebufferTexture"); GL.API.Framebuffer_Texture_Layer := Load_T150 ("glFramebufferTextureLayer"); GL.API.Blit_Framebuffer := Load_T151 ("glBlitFramebuffer"); GL.API.Invalidate_Framebuffer := Load_T152 ("glInvalidateFramebuffer"); GL.API.Invalidate_Sub_Framebuffer := Load_T153 ("glInvalidateSubFramebuffer"); GL.API.Framebuffer_Parameter_Size := Load_T154 ("glFramebufferParameteri"); GL.API.Framebuffer_Parameter_Bool := Load_T155 ("glFramebufferParameteri"); GL.API.Get_Framebuffer_Parameter_Size := Load_T156 ("glGetFramebufferParameteriv"); GL.API.Get_Framebuffer_Parameter_Bool := Load_T157 ("glGetFramebufferParameteriv"); GL.API.Gen_Queries := Load_T158 ("glGenQueries"); GL.API.Delete_Queries := Load_T159 ("glDeleteQueries"); GL.API.Is_Query := Load_T160 ("glIsQuery"); GL.API.Get_Query_Object := Load_T161 ("glGetQueryObjectuiv"); GL.API.Begin_Query := Load_T162 ("glBeginQuery"); GL.API.End_Query := Load_T163 ("glEndQuery"); GL.API.Begin_Query_Indexed := Load_T164 ("glBeginQueryIndexed"); GL.API.End_Query_Indexed := Load_T165 ("glEndQueryIndexed"); GL.API.Query_Counter := Load_T166 ("glQueryCounter"); GL.API.Get_Shader_Param := Load_T167 ("glGetShaderiv"); GL.API.Get_Shader_Type := Load_T168 ("glGetShaderiv"); GL.API.Create_Shader := Load_T169 ("glCreateShader"); GL.API.Delete_Shader := Load_T170 ("glDeleteShader"); GL.API.Shader_Source := Load_T171 ("glShaderSource"); GL.API.Get_Shader_Source := Load_T172 ("glGetShaderSource"); GL.API.Compile_Shader := Load_T170 ("glCompileShader"); GL.API.Release_Shader_Compiler := Load_T71 ("glReleaseShaderCompiler"); GL.API.Get_Shader_Info_Log := Load_T172 ("glGetShaderInfoLog"); GL.API.Create_Program := Load_T173 ("glCreateProgram"); GL.API.Delete_Program := Load_T174 ("glDeleteProgram"); GL.API.Get_Program_Param := Load_T175 ("glGetProgramiv"); GL.API.Attach_Shader := Load_T176 ("glAttachShader"); GL.API.Link_Program := Load_T174 ("glLinkProgram"); GL.API.Get_Program_Info_Log := Load_T177 ("glGetProgramInfoLog"); GL.API.Get_Program_Stage := Load_T178 ("glGetProgramStageiv"); GL.API.Get_Subroutine_Index := Load_T179 ("glGetSubroutineIndex"); GL.API.Get_Subroutine_Uniform_Location := Load_T180 ("glGetSubroutineUniformLocation"); GL.API.Use_Program := Load_T174 ("glUseProgram"); GL.API.Validate_Program := Load_T174 ("glValidateProgram"); GL.API.Get_Uniform_Location := Load_T181 ("glGetUniformLocation"); GL.API.Bind_Attrib_Location := Load_T182 ("glBindAttribLocation"); GL.API.Get_Attrib_Location := Load_T183 ("glGetAttribLocation"); GL.API.Vertex_Attrib_Pointer := Load_T184 ("glVertexAttribPointer"); GL.API.Vertex_AttribI_Pointer := Load_T185 ("glVertexAttribIPointer"); GL.API.Vertex_AttribL_Pointer := Load_T185 ("glVertexAttribLPointer"); GL.API.Enable_Vertex_Attrib_Array := Load_T186 ("glEnableVertexAttribArray"); GL.API.Disable_Vertex_Attrib_Array := Load_T186 ("glDisableVertexAttribArray"); GL.API.Get_Attached_Shaders := Load_T187 ("glGetAttachedShaders"); GL.API.Bind_Frag_Data_Location := Load_T188 ("glBindFragDataLocation"); GL.API.Get_Frag_Data_Location := Load_T189 ("glGetFragDataLocation"); GL.API.Begin_Transform_Feedback := Load_T190 ("glBeginTransformFeedback"); GL.API.End_Transform_Feedback := Load_T71 ("glEndTransformFeedback"); GL.API.Get_Transform_Feedback_Varying := Load_T191 ("glGetTransformFeedbackVarying"); GL.API.Transform_Feedback_Varyings := Load_T192 ("glTransformFeedbackVaryings"); GL.API.Set_Patch_Parameter_Int := Load_T193 ("glPatchParameteri"); GL.API.Set_Patch_Parameter_Float_Array := Load_T194 ("glPatchParameterfv"); end GL.Load_Function_Pointers;
Library/Spreadsheet/Spreadsheet/spreadsheetMethodFocus.asm
steakknife/pcgeos
504
84986
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: spreadsheetMethodFocus.asm AUTHOR: <NAME>, Sep 4, 1991 METHODS: Name Description ---- ----------- MSG_META_GAINED_FOCUS_EXCL gain focus handler MSG_META_LOST_FOCUS_EXCL lost focus handler MSG_META_GAINED_TARGET_EXCL gain target handler MSG_META_LOST_TARGET_EXCL lost target handler MSG_META_GRAB_TARGET_EXCL grab target handler InvertSelection Invert selected cell and range REVISION HISTORY: Name Date Description ---- ---- ----------- John 9/ 4/91 Initial revision DESCRIPTION: Routines for recording when the spreadsheet gains/loses the focus. $Id: spreadsheetMethodFocus.asm,v 1.1 97/04/07 11:13:43 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CommonCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetGainedSysFocusExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Mark the spreadsheet to indicate that it has gained the SYSTEM focus exclusive. CALLED BY: via MSG_META_GAINED_SYS_FOCUS_EXCL PASS: *ds:si = Instance ptr ds:di = Instance ptr es = Class segment RETURN: nothing DESTROYED: everything (it's a method handler) PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 9/ 4/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetGainedSysFocusExcl method SpreadsheetClass, MSG_META_GAINED_SYS_FOCUS_EXCL ; ; Let our superclass do its thing ; mov di, offset SpreadsheetClass call ObjCallSuperNoLock mov di, ds:[si] add di, ds:[di].Spreadsheet_offset mov si, di ornf ds:[si].SSI_flags, mask SF_IS_SYS_FOCUS test ds:[si].SSI_flags, mask SF_IS_SYS_TARGET jnz done ;branch if already target call InvertSelection done: ; ; Tell the rulers about the change. ; mov ax, MSG_SPREADSHEET_RULER_SET_FLAGS mov dx, mask SRF_SSHEET_IS_FOCUS call SendToRuler ret SpreadsheetGainedSysFocusExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetGainedFocusExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Calls SendTextFocusNotification to broadcast that spread- sheet object has gained the focus. CALLED BY: MSG_META_GAINED_FOCUS_EXCL PASS: *ds:si = SpreadsheetClass object ds:di = SpreadsheetClass instance data ds:bx = SpreadsheetClass object (same as *ds:si) es = segment of SpreadsheetClass ax = message # RETURN: nothing DESTROYED: ax, bx, cx, dx, di, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- HL 6/ 2/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetGainedFocusExcl method dynamic SpreadsheetClass, MSG_META_GAINED_FOCUS_EXCL ; ; Let our superclass do its thing ; mov di, offset SpreadsheetClass call ObjCallSuperNoLock mov bp, mask TFF_EDITABLE_TEXT_OBJECT_HAS_FOCUS call SendTextFocusNotification ret SpreadsheetGainedFocusExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetLostSysFocusExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Mark the spreadsheet to indicate that it has lost the SYSTEM focus exclusive. CALLED BY: via MSG_META_LOST_SYS_FOCUS_EXCL PASS: *ds:si = Instance ptr ds:di = Instance ptr es = Class segment RETURN: nothing DESTROYED: everything (it's a method handler) PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 9/ 4/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetLostSysFocusExcl method SpreadsheetClass, MSG_META_LOST_SYS_FOCUS_EXCL push si ; chunk handle mov si, di andnf ds:[si].SSI_flags, not mask SF_IS_SYS_FOCUS test ds:[si].SSI_flags, mask SF_IS_SYS_TARGET jnz done ;branch if still target call InvertSelection done: ; ; Tell the rulers about the change. ; mov ax, MSG_SPREADSHEET_RULER_SET_FLAGS mov dx, (mask SRF_SSHEET_IS_FOCUS shl 8) call SendToRuler ; ; Let our superclass do its thing ; pop si mov ax, MSG_META_LOST_SYS_FOCUS_EXCL mov di, offset SpreadsheetClass GOTO ObjCallSuperNoLock SpreadsheetLostSysFocusExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetLostFocusExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Calls SendTextFocusNotification to broadcast that spread- sheet object has lost the focus. CALLED BY: MSG_META_LOST_FOCUS_EXCL PASS: *ds:si = SpreadsheetClass object ds:di = SpreadsheetClass instance data ds:bx = SpreadsheetClass object (same as *ds:si) es = segment of SpreadsheetClass ax = message # RETURN: nothing DESTROYED: ax, bx, cx, dx, di, bp SIDE EFFECTS: PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- HL 6/ 2/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetLostFocusExcl method dynamic SpreadsheetClass, MSG_META_LOST_FOCUS_EXCL clr bp call SendTextFocusNotification ; ; Let our superclass do its thing ; mov ax, MSG_META_LOST_FOCUS_EXCL mov di, offset SpreadsheetClass GOTO ObjCallSuperNoLock SpreadsheetLostFocusExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SendTextFocusNotification %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sends the GWNT_EDITABLE_TEXT_OBJECT_HAS_FOCUS notification. CALLED BY: MSG_META_GAINED_FOCUS_EXCL handler MSG_META_LOST_FOCUS_EXCL handler PASS: bp = TextFocusFlags to send out RETURN: nothing DESTROYED: ax, bx, cx, dx, di SIDE EFFECTS: PSEUDO CODE/STRATEGY: code snarfed from procedure of same name in /s/p/Library/Text/ TextSelect/tslMethodFocus.asm REVISION HISTORY: Name Date Description ---- ---- ----------- HL 6/ 2/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SendTextFocusNotification proc near ; ; Record event to send to ink controller. ; mov ax, MSG_META_NOTIFY mov cx, MANUFACTURER_ID_GEOWORKS mov dx, GWNT_EDITABLE_TEXT_OBJECT_HAS_FOCUS mov di, mask MF_RECORD call ObjMessage mov ax, mask GCNLSF_SET_STATUS test bp, mask TFF_EDITABLE_TEXT_OBJECT_HAS_FOCUS jnz 10$ ornf ax, mask GCNLSF_IGNORE_IF_STATUS_TRANSITIONING 10$: ; ; Send it to the appropriate gcn list. ; mov dx, size GCNListMessageParams sub sp, dx mov bp, sp mov ss:[bp].GCNLMP_ID.GCNLT_manuf, MANUFACTURER_ID_GEOWORKS mov ss:[bp].GCNLMP_ID.GCNLT_type, GAGCNLT_NOTIFY_FOCUS_TEXT_OBJECT clr ss:[bp].GCNLMP_block mov ss:[bp].GCNLMP_event, di mov ss:[bp].GCNLMP_flags, ax mov ax, MSG_GEN_PROCESS_SEND_TO_APP_GCN_LIST call GeodeGetProcessHandle mov di, mask MF_FIXUP_DS or mask MF_STACK call ObjMessage add sp, dx ret SendTextFocusNotification endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% InvertSelection %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Invert the entire selection CALLED BY: SpreadsheetLostFocusExcl(), SpreadsheetGainedFocusExcl() PASS: ds:si - ptr to Spreadsheet instance RETURN: none DESTROYED: ax, bx, cx, dx, di, bp PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 11/15/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InvertSelection proc near class SpreadsheetClass .enter EC < call ECCheckInstancePtr ;> ; ; If we're in engine mode, don't invert the selection ; test ds:[si].SSI_attributes, mask SA_ENGINE_MODE jnz done call CreateGStateFar mov ax, ds:[si].SSI_active.CR_row mov cx, ds:[si].SSI_active.CR_column call InvertActiveVisibleCellFar ;unactivate current cell call InvertSelectedVisibleCellFar ;invert to allow rectangle mov ax, ds:[si].SSI_selected.CR_start.CR_row mov cx, ds:[si].SSI_selected.CR_start.CR_column mov bp, ds:[si].SSI_selected.CR_end.CR_row mov dx, ds:[si].SSI_selected.CR_end.CR_column call InvertSelectedVisibleRangeFar ;deselect range call DestroyGStateFar done: .leave ret InvertSelection endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetGainedTargetExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Handle gained APP target exclusive CALLED BY: MSG_META_GAINED_TARGET_EXCL PASS: *ds:si - instance data ds:di - *ds:si es - seg addr of SpreadsheetClass ax - the method RETURN: none DESTROYED: bx, si, di, ds, es (method handler) PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 11/17/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetGainedTargetExcl method dynamic SpreadsheetClass, \ MSG_META_GAINED_TARGET_EXCL mov si, di ;ds:si <- ptr to instance data ornf ds:[si].SSI_flags, mask SF_IS_APP_TARGET ; ; Force all UI to update ; mov ax, SNFLAGS_DOCUMENT_CHANGED call SS_SendNotification ; ; disable paragraph attributes (besides Justification) ; test ds:[si].SSI_attributes, mask SA_ENGINE_MODE jnz noPara call SS_SendNullParaAttrNotification noPara: ; ; The the rulers about the change ; mov ax, MSG_SPREADSHEET_RULER_SET_FLAGS mov dx, mask SRF_SSHEET_IS_TARGET call SendToRuler ret SpreadsheetGainedTargetExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetLostTargetExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Handle loss of APP target exclusive CALLED BY: MSG_META_LOST_TARGET_EXCL PASS: *ds:si - instance data ds:di - *ds:si es - seg addr of SpreadsheetClass ax - the method RETURN: none DESTROYED: bx, si, di, ds, es (method handler) PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 11/17/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetLostTargetExcl method dynamic SpreadsheetClass, \ MSG_META_LOST_TARGET_EXCL mov si, di ;ds:si <- ptr to instance data andnf ds:[si].SSI_flags, not (mask SF_IS_APP_TARGET) ; ; Force all UI to update ; clr ax ;ax <- force update call SS_SendNotification ; ; Tell the rulers about the change ; mov ax, MSG_SPREADSHEET_RULER_SET_FLAGS mov dx, (mask SRF_SSHEET_IS_TARGET shl 8) call SendToRuler ret SpreadsheetLostTargetExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetGrabTargetExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Handle 'grab target' if we're supposed to CALLED BY: MSG_META_GRAB_TARGET_EXCL PASS: *ds:si - instance data ds:di - *ds:si es - seg addr of SpreadsheetClass ax - the method RETURN: DESTROYED: bx, si, di, ds, es (method handler) PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 11/19/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetGrabTargetExcl method dynamic SpreadsheetClass, \ MSG_META_GRAB_TARGET_EXCL ; ; If we aren't targetable, don't grab the target ; test ds:[di].SSI_attributes, mask SA_TARGETABLE jz done mov di, offset SpreadsheetClass call ObjCallSuperNoLock done: ret SpreadsheetGrabTargetExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetGainedSysTargetExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Handling gaining the SYSTEM target exclusive CALLED BY: MSG_META_GAINED_TARGET_EXCL PASS: *ds:si - instance data ds:di - *ds:si es - seg addr of SpreadsheetClass ax - the message RETURN: none DESTROYED: bx, si, di, ds, es (method handler) PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 9/11/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetGainedSysTargetExcl method dynamic SpreadsheetClass, MSG_META_GAINED_SYS_TARGET_EXCL mov si, di ;ds:si <- ptr to spreadsheet ornf ds:[si].SSI_flags, mask SF_IS_SYS_TARGET ; ; If we don't already have the focus, invert the selection ; test ds:[si].SSI_flags, mask SF_IS_SYS_FOCUS jnz done ;branch if already focus call InvertSelection done: ret SpreadsheetGainedSysTargetExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetLostSysTargetExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Handle losing the SYSTEM target exclusive CALLED BY: MSG_META_LOST_TARGET_EXCL PASS: *ds:si - instance data ds:di - *ds:si es - seg addr of SpreadsheetClass ax - the message RETURN: none DESTROYED: bx, si, di, ds, es (method handler) PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 9/11/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetLostSysTargetExcl method dynamic SpreadsheetClass, MSG_META_LOST_SYS_TARGET_EXCL mov si, di ;ds:si <- ptr to spreadsheet andnf ds:[si].SSI_flags, not (mask SF_IS_SYS_TARGET) ; ; If we don't have the focus, either, invert the selection ; test ds:[si].SSI_flags, mask SF_IS_SYS_FOCUS jnz done ;branch if still focus call InvertSelection done: ret SpreadsheetLostSysTargetExcl endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetLostGadgetExcl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Handle loss of gadget exclusive... CALLED BY: MSG_VIS_LOST_GADGET_EXCL PASS: ds:*si - ptr to instance data ds:di - ptr to instance data es - segment of SpreadsheetClass ax = MSG_VIS_LOST_GADGET_EXCL. RETURN: none DESTROYED: bx, si, di, ds, es (method handler) PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: NOTE: This message is send a lot when you are receiving mouse events. This is why it is in the DrawCode resource -- DrawCode isn't used (much, if at all) when the spreadsheet is in engine mode, and neither is this. REVISION HISTORY: Name Date Description ---- ---- ----------- eca 7/14/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetLostGadgetExcl method SpreadsheetClass, MSG_VIS_LOST_GADGET_EXCL andnf ds:[di].SSI_flags, not (mask SF_HAVE_GRAB) call VisReleaseMouse ret SpreadsheetLostGadgetExcl endm CommonCode ends
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xa0.log_21829_1492.asm
ljhsiun2/medusa
9
23975
<filename>Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xa0.log_21829_1492.asm .global s_prepare_buffers s_prepare_buffers: push %r11 push %r15 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x54d, %rsi lea addresses_normal_ht+0x2e0d, %rdi nop nop nop sub $47985, %rbx mov $110, %rcx rep movsl nop nop nop nop xor $28669, %rdx lea addresses_WC_ht+0xba4d, %rbx nop nop xor $6994, %r15 mov (%rbx), %rdi nop nop nop nop sub %rsi, %rsi lea addresses_A_ht+0x174d, %rdx nop nop nop nop lfence mov $0x6162636465666768, %rcx movq %rcx, (%rdx) nop nop nop nop add %rdx, %rdx lea addresses_WT_ht+0xa24d, %rbp nop nop nop sub $44777, %rsi mov (%rbp), %r15d nop xor $44085, %rbx lea addresses_WT_ht+0xd49f, %rdi nop cmp $57467, %r15 movb (%rdi), %cl nop nop cmp %rcx, %rcx lea addresses_WT_ht+0x191fd, %r15 nop nop cmp %rdx, %rdx mov $0x6162636465666768, %rbx movq %rbx, %xmm6 vmovups %ymm6, (%r15) nop nop nop sub $16194, %rdi lea addresses_D_ht+0x1154d, %r15 nop nop nop nop xor %rdi, %rdi mov $0x6162636465666768, %rbp movq %rbp, %xmm4 movups %xmm4, (%r15) nop nop nop nop nop add %rbx, %rbx lea addresses_UC_ht+0x29a5, %rbx nop nop sub %rsi, %rsi mov (%rbx), %r15 nop xor %rdx, %rdx lea addresses_D_ht+0x1c4d, %rbx nop nop nop nop nop lfence mov $0x6162636465666768, %rsi movq %rsi, (%rbx) cmp $47669, %rdi lea addresses_D_ht+0xce4d, %r15 nop nop nop add $15170, %rbx movb $0x61, (%r15) nop nop nop nop nop add %r15, %r15 lea addresses_D_ht+0x675, %rbx nop and $27407, %rbp mov $0x6162636465666768, %rdi movq %rdi, (%rbx) nop inc %rdi lea addresses_WC_ht+0x1a3ec, %rsi lea addresses_WC_ht+0x1924d, %rdi nop nop nop nop nop add %r11, %r11 mov $117, %rcx rep movsw nop nop nop nop nop and %rsi, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r15 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r8 push %r9 push %rcx push %rsi // Load lea addresses_UC+0x1524d, %r8 nop nop nop nop nop sub %rsi, %rsi mov (%r8), %r11w and %r13, %r13 // Store lea addresses_WC+0xd095, %r12 nop dec %rcx mov $0x5152535455565758, %r11 movq %r11, %xmm3 vmovups %ymm3, (%r12) nop nop nop xor $49432, %r8 // Store lea addresses_A+0x64d, %r9 nop nop xor $34167, %rsi mov $0x5152535455565758, %r12 movq %r12, %xmm0 vmovups %ymm0, (%r9) nop nop nop nop nop and %r8, %r8 // Store lea addresses_UC+0xb375, %rcx nop nop cmp %r13, %r13 movw $0x5152, (%rcx) nop xor %rcx, %rcx // Load lea addresses_US+0x1636d, %r12 inc %r13 mov (%r12), %esi nop xor $4154, %rcx // Store lea addresses_WC+0x524d, %r9 nop nop nop nop nop add $38531, %rsi mov $0x5152535455565758, %rcx movq %rcx, %xmm3 movups %xmm3, (%r9) nop nop and %r9, %r9 // Faulty Load lea addresses_WC+0x524d, %rsi nop nop nop sub %r8, %r8 mov (%rsi), %r11 lea oracles, %r12 and $0xff, %r11 shlq $12, %r11 mov (%r12,%r11,1), %r11 pop %rsi pop %rcx pop %r9 pop %r8 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_UC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_WC', 'AVXalign': False, 'size': 32}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_A', 'AVXalign': False, 'size': 32}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_UC', 'AVXalign': False, 'size': 2}} {'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_US', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 16}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_normal_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8}} {'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_WT_ht', 'AVXalign': True, 'size': 1}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16}} {'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 9, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}} {'src': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}} {'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 */
data/tilesets/house_collision.asm
zavytar/pokecolorless
0
162509
<reponame>zavytar/pokecolorless<gh_stars>0 tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 00 tilecoll FLOOR, FLOOR, FLOOR, WALL ; 01 tilecoll FLOOR, FLOOR, WALL, FLOOR ; 02 tilecoll WALL, WALL, FLOOR, FLOOR ; 03 tilecoll WALL, WALL, BOOKSHELF, BOOKSHELF ; 04 tilecoll WALL, WINDOW, FLOOR, FLOOR ; 05 tilecoll WALL, FLOOR, WALL, FLOOR ; 06 tilecoll FLOOR, WALL, FLOOR, WALL ; 07 tilecoll WALL, WINDOW, FLOOR, FLOOR ; 08 tilecoll WALL, WALL, FLOOR, BOOKSHELF ; 09 tilecoll WALL, WALL, WALL, WALL ; 0a tilecoll FLOOR, FLOOR, WARP_CARPET_DOWN, WARP_CARPET_DOWN ; 0b tilecoll FLOOR, WALL, FLOOR, FLOOR ; 0c tilecoll WALL, FLOOR, FLOOR, FLOOR ; 0d tilecoll WALL, TOWN_MAP, FLOOR, FLOOR ; 0e tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 0f tilecoll WALL, WALL, PC, WALL ; 10 tilecoll WALL, WALL, WALL, FLOOR ; 11 tilecoll WALL, WALL, FLOOR, FLOOR ; 12 tilecoll WALL, WALL, FLOOR, FLOOR ; 13 tilecoll FLOOR, FLOOR, FLOOR, WALL ; 14 tilecoll FLOOR, FLOOR, WALL, FLOOR ; 15 tilecoll WINDOW, WALL, FLOOR, FLOOR ; 16 tilecoll FLOOR, FLOOR, WARP_CARPET_LEFT, FLOOR ; 17 tilecoll FLOOR, WALL, FLOOR, FLOOR ; 18 tilecoll WALL, FLOOR, FLOOR, FLOOR ; 19 tilecoll WALL, WALL, BOOKSHELF, BOOKSHELF ; 1a tilecoll WARP_CARPET_LEFT, FLOOR, FLOOR, FLOOR ; 1b tilecoll WALL, WALL, FLOOR, PC ; 1c tilecoll WALL, WALL, FLOOR, RADIO ; 1d tilecoll WALL, TOWN_MAP, TV, FLOOR ; 1e tilecoll WALL, WALL, WALL, WALL ; 1f tilecoll WALL, WALL, WALL, WALL ; 20 tilecoll FLOOR, WALL, FLOOR, WALL ; 21 tilecoll WALL, FLOOR, WALL, FLOOR ; 22 tilecoll FLOOR, WALL, FLOOR, WALL ; 23 tilecoll WALL, FLOOR, WALL, FLOOR ; 24 tilecoll LADDER, FLOOR, FLOOR, FLOOR ; 25 tilecoll COUNTER, COUNTER, FLOOR, COUNTER ; 26 tilecoll FLOOR, COUNTER, FLOOR, COUNTER ; 27 tilecoll WALL, WALL, FLOOR, FLOOR ; 28 tilecoll WALL, WALL, FLOOR, FLOOR ; 29 tilecoll WALL, WALL, FLOOR, FLOOR ; 2a tilecoll WALL, WALL, FLOOR, FLOOR ; 2b tilecoll WALL, WALL, WALL, WALL ; 2c tilecoll WALL, WALL, FLOOR, FLOOR ; 2d tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 2e tilecoll WALL, WALL, FLOOR, WALL ; 2f tilecoll WALL, FLOOR, WALL, FLOOR ; 30 tilecoll FLOOR, WALL, FLOOR, WALL ; 31 tilecoll WALL, WINDOW, WALL, WALL ; 32 tilecoll FLOOR, WARP_CARPET_UP, FLOOR, FLOOR ; 33 tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 34 tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 35 tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 36 tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 37 tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 38 tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 39 tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 3a tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 3b tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 3c tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 3d tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 3e tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 3f
sh.asm
johnhhyang/os2
0
26337
_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 4f 0f 00 00 call f60 <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 e8 14 00 00 mov 0x14e8(,%eax,4),%eax 22: ff e0 jmp *%eax default: panic("runcmd"); 24: c7 04 24 bc 14 00 00 movl $0x14bc,(%esp) 2b: e8 2a 03 00 00 call 35a <panic> case EXEC: ecmd = (struct execcmd*)cmd; 30: 8b 45 08 mov 0x8(%ebp),%eax 33: 89 45 f4 mov %eax,-0xc(%ebp) if(ecmd->argv[0] == 0) 36: 8b 45 f4 mov -0xc(%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 1b 0f 00 00 call f60 <exit> exec(ecmd->argv[0], ecmd->argv); 45: 8b 45 f4 mov -0xc(%ebp),%eax 48: 8d 50 04 lea 0x4(%eax),%edx 4b: 8b 45 f4 mov -0xc(%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 3b 0f 00 00 call f98 <exec> printf(2, "exec %s failed\n", ecmd->argv[0]); 5d: 8b 45 f4 mov -0xc(%ebp),%eax 60: 8b 40 04 mov 0x4(%eax),%eax 63: 89 44 24 08 mov %eax,0x8(%esp) 67: c7 44 24 04 c3 14 00 movl $0x14c3,0x4(%esp) 6e: 00 6f: c7 04 24 02 00 00 00 movl $0x2,(%esp) 76: e8 7c 10 00 00 call 10f7 <printf> break; 7b: e9 84 01 00 00 jmp 204 <runcmd+0x204> case REDIR: rcmd = (struct redircmd*)cmd; 80: 8b 45 08 mov 0x8(%ebp),%eax 83: 89 45 f0 mov %eax,-0x10(%ebp) close(rcmd->fd); 86: 8b 45 f0 mov -0x10(%ebp),%eax 89: 8b 40 14 mov 0x14(%eax),%eax 8c: 89 04 24 mov %eax,(%esp) 8f: e8 f4 0e 00 00 call f88 <close> if(open(rcmd->file, rcmd->mode) < 0){ 94: 8b 45 f0 mov -0x10(%ebp),%eax 97: 8b 50 10 mov 0x10(%eax),%edx 9a: 8b 45 f0 mov -0x10(%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 f4 0e 00 00 call fa0 <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 f0 mov -0x10(%ebp),%eax b3: 8b 40 08 mov 0x8(%eax),%eax b6: 89 44 24 08 mov %eax,0x8(%esp) ba: c7 44 24 04 d3 14 00 movl $0x14d3,0x4(%esp) c1: 00 c2: c7 04 24 02 00 00 00 movl $0x2,(%esp) c9: e8 29 10 00 00 call 10f7 <printf> exit(); ce: e8 8d 0e 00 00 call f60 <exit> } runcmd(rcmd->cmd); d3: 8b 45 f0 mov -0x10(%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 1e 01 00 00 jmp 204 <runcmd+0x204> 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 8f 02 00 00 call 380 <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 60 0e 00 00 call f68 <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 e9 00 00 00 jmp 204 <runcmd+0x204> case PIPE: pcmd = (struct pipecmd*)cmd; 11b: 8b 45 08 mov 0x8(%ebp),%eax 11e: 89 45 e8 mov %eax,-0x18(%ebp) if(pipe(p) < 0) 121: 8d 45 dc lea -0x24(%ebp),%eax 124: 89 04 24 mov %eax,(%esp) 127: e8 44 0e 00 00 call f70 <pipe> 12c: 85 c0 test %eax,%eax 12e: 79 0c jns 13c <runcmd+0x13c> panic("pipe"); 130: c7 04 24 e3 14 00 00 movl $0x14e3,(%esp) 137: e8 1e 02 00 00 call 35a <panic> if(fork1() == 0){ 13c: e8 3f 02 00 00 call 380 <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 37 0e 00 00 call f88 <close> dup(p[1]); 151: 8b 45 e0 mov -0x20(%ebp),%eax 154: 89 04 24 mov %eax,(%esp) 157: e8 7c 0e 00 00 call fd8 <dup> close(p[0]); 15c: 8b 45 dc mov -0x24(%ebp),%eax 15f: 89 04 24 mov %eax,(%esp) 162: e8 21 0e 00 00 call f88 <close> close(p[1]); 167: 8b 45 e0 mov -0x20(%ebp),%eax 16a: 89 04 24 mov %eax,(%esp) 16d: e8 16 0e 00 00 call f88 <close> runcmd(pcmd->left); 172: 8b 45 e8 mov -0x18(%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 fb 01 00 00 call 380 <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 f3 0d 00 00 call f88 <close> dup(p[0]); 195: 8b 45 dc mov -0x24(%ebp),%eax 198: 89 04 24 mov %eax,(%esp) 19b: e8 38 0e 00 00 call fd8 <dup> close(p[0]); 1a0: 8b 45 dc mov -0x24(%ebp),%eax 1a3: 89 04 24 mov %eax,(%esp) 1a6: e8 dd 0d 00 00 call f88 <close> close(p[1]); 1ab: 8b 45 e0 mov -0x20(%ebp),%eax 1ae: 89 04 24 mov %eax,(%esp) 1b1: e8 d2 0d 00 00 call f88 <close> runcmd(pcmd->right); 1b6: 8b 45 e8 mov -0x18(%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 b9 0d 00 00 call f88 <close> close(p[1]); 1cf: 8b 45 e0 mov -0x20(%ebp),%eax 1d2: 89 04 24 mov %eax,(%esp) 1d5: e8 ae 0d 00 00 call f88 <close> wait(); 1da: e8 89 0d 00 00 call f68 <wait> wait(); 1df: e8 84 0d 00 00 call f68 <wait> break; 1e4: eb 1e jmp 204 <runcmd+0x204> 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 8f 01 00 00 call 380 <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; 203: 90 nop } exit(); 204: e8 57 0d 00 00 call f60 <exit> 00000209 <getcmd>: } int getcmd(char *buf, int nbuf) { 209: 55 push %ebp 20a: 89 e5 mov %esp,%ebp 20c: 83 ec 18 sub $0x18,%esp printf(2, "$ "); 20f: c7 44 24 04 00 15 00 movl $0x1500,0x4(%esp) 216: 00 217: c7 04 24 02 00 00 00 movl $0x2,(%esp) 21e: e8 d4 0e 00 00 call 10f7 <printf> memset(buf, 0, nbuf); 223: 8b 45 0c mov 0xc(%ebp),%eax 226: 89 44 24 08 mov %eax,0x8(%esp) 22a: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 231: 00 232: 8b 45 08 mov 0x8(%ebp),%eax 235: 89 04 24 mov %eax,(%esp) 238: e8 7e 0b 00 00 call dbb <memset> gets(buf, nbuf); 23d: 8b 45 0c mov 0xc(%ebp),%eax 240: 89 44 24 04 mov %eax,0x4(%esp) 244: 8b 45 08 mov 0x8(%ebp),%eax 247: 89 04 24 mov %eax,(%esp) 24a: e8 c3 0b 00 00 call e12 <gets> if(buf[0] == 0) // EOF 24f: 8b 45 08 mov 0x8(%ebp),%eax 252: 0f b6 00 movzbl (%eax),%eax 255: 84 c0 test %al,%al 257: 75 07 jne 260 <getcmd+0x57> return -1; 259: b8 ff ff ff ff mov $0xffffffff,%eax 25e: eb 05 jmp 265 <getcmd+0x5c> return 0; 260: b8 00 00 00 00 mov $0x0,%eax } 265: c9 leave 266: c3 ret 00000267 <main>: int main(void) { 267: 55 push %ebp 268: 89 e5 mov %esp,%ebp 26a: 83 e4 f0 and $0xfffffff0,%esp 26d: 83 ec 20 sub $0x20,%esp static char buf[100]; int fd; // Assumes three file descriptors open. while((fd = open("console", O_RDWR)) >= 0){ 270: eb 19 jmp 28b <main+0x24> if(fd >= 3){ 272: 83 7c 24 1c 02 cmpl $0x2,0x1c(%esp) 277: 7e 12 jle 28b <main+0x24> close(fd); 279: 8b 44 24 1c mov 0x1c(%esp),%eax 27d: 89 04 24 mov %eax,(%esp) 280: e8 03 0d 00 00 call f88 <close> break; 285: 90 nop } } // Read and run input commands. while(getcmd(buf, sizeof(buf)) >= 0){ 286: e9 ae 00 00 00 jmp 339 <main+0xd2> { static char buf[100]; int fd; // Assumes three file descriptors open. while((fd = open("console", O_RDWR)) >= 0){ 28b: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp) 292: 00 293: c7 04 24 03 15 00 00 movl $0x1503,(%esp) 29a: e8 01 0d 00 00 call fa0 <open> 29f: 89 44 24 1c mov %eax,0x1c(%esp) 2a3: 83 7c 24 1c 00 cmpl $0x0,0x1c(%esp) 2a8: 79 c8 jns 272 <main+0xb> break; } } // Read and run input commands. while(getcmd(buf, sizeof(buf)) >= 0){ 2aa: e9 8a 00 00 00 jmp 339 <main+0xd2> if(buf[0] == 'c' && buf[1] == 'd' && buf[2] == ' '){ 2af: 0f b6 05 60 1a 00 00 movzbl 0x1a60,%eax 2b6: 3c 63 cmp $0x63,%al 2b8: 75 5a jne 314 <main+0xad> 2ba: 0f b6 05 61 1a 00 00 movzbl 0x1a61,%eax 2c1: 3c 64 cmp $0x64,%al 2c3: 75 4f jne 314 <main+0xad> 2c5: 0f b6 05 62 1a 00 00 movzbl 0x1a62,%eax 2cc: 3c 20 cmp $0x20,%al 2ce: 75 44 jne 314 <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 2d0: c7 04 24 60 1a 00 00 movl $0x1a60,(%esp) 2d7: e8 ba 0a 00 00 call d96 <strlen> 2dc: 83 e8 01 sub $0x1,%eax 2df: c6 80 60 1a 00 00 00 movb $0x0,0x1a60(%eax) if(chdir(buf+3) < 0) 2e6: c7 04 24 63 1a 00 00 movl $0x1a63,(%esp) 2ed: e8 de 0c 00 00 call fd0 <chdir> 2f2: 85 c0 test %eax,%eax 2f4: 79 42 jns 338 <main+0xd1> printf(2, "cannot cd %s\n", buf+3); 2f6: c7 44 24 08 63 1a 00 movl $0x1a63,0x8(%esp) 2fd: 00 2fe: c7 44 24 04 0b 15 00 movl $0x150b,0x4(%esp) 305: 00 306: c7 04 24 02 00 00 00 movl $0x2,(%esp) 30d: e8 e5 0d 00 00 call 10f7 <printf> continue; 312: eb 24 jmp 338 <main+0xd1> } if(fork1() == 0) 314: e8 67 00 00 00 call 380 <fork1> 319: 85 c0 test %eax,%eax 31b: 75 14 jne 331 <main+0xca> runcmd(parsecmd(buf)); 31d: c7 04 24 60 1a 00 00 movl $0x1a60,(%esp) 324: e8 c9 03 00 00 call 6f2 <parsecmd> 329: 89 04 24 mov %eax,(%esp) 32c: e8 cf fc ff ff call 0 <runcmd> wait(); 331: e8 32 0c 00 00 call f68 <wait> 336: eb 01 jmp 339 <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; 338: 90 nop break; } } // Read and run input commands. while(getcmd(buf, sizeof(buf)) >= 0){ 339: c7 44 24 04 64 00 00 movl $0x64,0x4(%esp) 340: 00 341: c7 04 24 60 1a 00 00 movl $0x1a60,(%esp) 348: e8 bc fe ff ff call 209 <getcmd> 34d: 85 c0 test %eax,%eax 34f: 0f 89 5a ff ff ff jns 2af <main+0x48> } if(fork1() == 0) runcmd(parsecmd(buf)); wait(); } exit(); 355: e8 06 0c 00 00 call f60 <exit> 0000035a <panic>: } void panic(char *s) { 35a: 55 push %ebp 35b: 89 e5 mov %esp,%ebp 35d: 83 ec 18 sub $0x18,%esp printf(2, "%s\n", s); 360: 8b 45 08 mov 0x8(%ebp),%eax 363: 89 44 24 08 mov %eax,0x8(%esp) 367: c7 44 24 04 19 15 00 movl $0x1519,0x4(%esp) 36e: 00 36f: c7 04 24 02 00 00 00 movl $0x2,(%esp) 376: e8 7c 0d 00 00 call 10f7 <printf> exit(); 37b: e8 e0 0b 00 00 call f60 <exit> 00000380 <fork1>: } int fork1(void) { 380: 55 push %ebp 381: 89 e5 mov %esp,%ebp 383: 83 ec 28 sub $0x28,%esp int pid; pid = fork(); 386: e8 cd 0b 00 00 call f58 <fork> 38b: 89 45 f4 mov %eax,-0xc(%ebp) if(pid == -1) 38e: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 392: 75 0c jne 3a0 <fork1+0x20> panic("fork"); 394: c7 04 24 1d 15 00 00 movl $0x151d,(%esp) 39b: e8 ba ff ff ff call 35a <panic> return pid; 3a0: 8b 45 f4 mov -0xc(%ebp),%eax } 3a3: c9 leave 3a4: c3 ret 000003a5 <execcmd>: //PAGEBREAK! // Constructors struct cmd* execcmd(void) { 3a5: 55 push %ebp 3a6: 89 e5 mov %esp,%ebp 3a8: 83 ec 28 sub $0x28,%esp struct execcmd *cmd; cmd = malloc(sizeof(*cmd)); 3ab: c7 04 24 54 00 00 00 movl $0x54,(%esp) 3b2: e8 24 10 00 00 call 13db <malloc> 3b7: 89 45 f4 mov %eax,-0xc(%ebp) memset(cmd, 0, sizeof(*cmd)); 3ba: c7 44 24 08 54 00 00 movl $0x54,0x8(%esp) 3c1: 00 3c2: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 3c9: 00 3ca: 8b 45 f4 mov -0xc(%ebp),%eax 3cd: 89 04 24 mov %eax,(%esp) 3d0: e8 e6 09 00 00 call dbb <memset> cmd->type = EXEC; 3d5: 8b 45 f4 mov -0xc(%ebp),%eax 3d8: c7 00 01 00 00 00 movl $0x1,(%eax) return (struct cmd*)cmd; 3de: 8b 45 f4 mov -0xc(%ebp),%eax } 3e1: c9 leave 3e2: c3 ret 000003e3 <redircmd>: struct cmd* redircmd(struct cmd *subcmd, char *file, char *efile, int mode, int fd) { 3e3: 55 push %ebp 3e4: 89 e5 mov %esp,%ebp 3e6: 83 ec 28 sub $0x28,%esp struct redircmd *cmd; cmd = malloc(sizeof(*cmd)); 3e9: c7 04 24 18 00 00 00 movl $0x18,(%esp) 3f0: e8 e6 0f 00 00 call 13db <malloc> 3f5: 89 45 f4 mov %eax,-0xc(%ebp) memset(cmd, 0, sizeof(*cmd)); 3f8: c7 44 24 08 18 00 00 movl $0x18,0x8(%esp) 3ff: 00 400: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 407: 00 408: 8b 45 f4 mov -0xc(%ebp),%eax 40b: 89 04 24 mov %eax,(%esp) 40e: e8 a8 09 00 00 call dbb <memset> cmd->type = REDIR; 413: 8b 45 f4 mov -0xc(%ebp),%eax 416: c7 00 02 00 00 00 movl $0x2,(%eax) cmd->cmd = subcmd; 41c: 8b 45 f4 mov -0xc(%ebp),%eax 41f: 8b 55 08 mov 0x8(%ebp),%edx 422: 89 50 04 mov %edx,0x4(%eax) cmd->file = file; 425: 8b 45 f4 mov -0xc(%ebp),%eax 428: 8b 55 0c mov 0xc(%ebp),%edx 42b: 89 50 08 mov %edx,0x8(%eax) cmd->efile = efile; 42e: 8b 45 f4 mov -0xc(%ebp),%eax 431: 8b 55 10 mov 0x10(%ebp),%edx 434: 89 50 0c mov %edx,0xc(%eax) cmd->mode = mode; 437: 8b 45 f4 mov -0xc(%ebp),%eax 43a: 8b 55 14 mov 0x14(%ebp),%edx 43d: 89 50 10 mov %edx,0x10(%eax) cmd->fd = fd; 440: 8b 45 f4 mov -0xc(%ebp),%eax 443: 8b 55 18 mov 0x18(%ebp),%edx 446: 89 50 14 mov %edx,0x14(%eax) return (struct cmd*)cmd; 449: 8b 45 f4 mov -0xc(%ebp),%eax } 44c: c9 leave 44d: c3 ret 0000044e <pipecmd>: struct cmd* pipecmd(struct cmd *left, struct cmd *right) { 44e: 55 push %ebp 44f: 89 e5 mov %esp,%ebp 451: 83 ec 28 sub $0x28,%esp struct pipecmd *cmd; cmd = malloc(sizeof(*cmd)); 454: c7 04 24 0c 00 00 00 movl $0xc,(%esp) 45b: e8 7b 0f 00 00 call 13db <malloc> 460: 89 45 f4 mov %eax,-0xc(%ebp) memset(cmd, 0, sizeof(*cmd)); 463: c7 44 24 08 0c 00 00 movl $0xc,0x8(%esp) 46a: 00 46b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 472: 00 473: 8b 45 f4 mov -0xc(%ebp),%eax 476: 89 04 24 mov %eax,(%esp) 479: e8 3d 09 00 00 call dbb <memset> cmd->type = PIPE; 47e: 8b 45 f4 mov -0xc(%ebp),%eax 481: c7 00 03 00 00 00 movl $0x3,(%eax) cmd->left = left; 487: 8b 45 f4 mov -0xc(%ebp),%eax 48a: 8b 55 08 mov 0x8(%ebp),%edx 48d: 89 50 04 mov %edx,0x4(%eax) cmd->right = right; 490: 8b 45 f4 mov -0xc(%ebp),%eax 493: 8b 55 0c mov 0xc(%ebp),%edx 496: 89 50 08 mov %edx,0x8(%eax) return (struct cmd*)cmd; 499: 8b 45 f4 mov -0xc(%ebp),%eax } 49c: c9 leave 49d: c3 ret 0000049e <listcmd>: struct cmd* listcmd(struct cmd *left, struct cmd *right) { 49e: 55 push %ebp 49f: 89 e5 mov %esp,%ebp 4a1: 83 ec 28 sub $0x28,%esp struct listcmd *cmd; cmd = malloc(sizeof(*cmd)); 4a4: c7 04 24 0c 00 00 00 movl $0xc,(%esp) 4ab: e8 2b 0f 00 00 call 13db <malloc> 4b0: 89 45 f4 mov %eax,-0xc(%ebp) memset(cmd, 0, sizeof(*cmd)); 4b3: c7 44 24 08 0c 00 00 movl $0xc,0x8(%esp) 4ba: 00 4bb: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 4c2: 00 4c3: 8b 45 f4 mov -0xc(%ebp),%eax 4c6: 89 04 24 mov %eax,(%esp) 4c9: e8 ed 08 00 00 call dbb <memset> cmd->type = LIST; 4ce: 8b 45 f4 mov -0xc(%ebp),%eax 4d1: c7 00 04 00 00 00 movl $0x4,(%eax) cmd->left = left; 4d7: 8b 45 f4 mov -0xc(%ebp),%eax 4da: 8b 55 08 mov 0x8(%ebp),%edx 4dd: 89 50 04 mov %edx,0x4(%eax) cmd->right = right; 4e0: 8b 45 f4 mov -0xc(%ebp),%eax 4e3: 8b 55 0c mov 0xc(%ebp),%edx 4e6: 89 50 08 mov %edx,0x8(%eax) return (struct cmd*)cmd; 4e9: 8b 45 f4 mov -0xc(%ebp),%eax } 4ec: c9 leave 4ed: c3 ret 000004ee <backcmd>: struct cmd* backcmd(struct cmd *subcmd) { 4ee: 55 push %ebp 4ef: 89 e5 mov %esp,%ebp 4f1: 83 ec 28 sub $0x28,%esp struct backcmd *cmd; cmd = malloc(sizeof(*cmd)); 4f4: c7 04 24 08 00 00 00 movl $0x8,(%esp) 4fb: e8 db 0e 00 00 call 13db <malloc> 500: 89 45 f4 mov %eax,-0xc(%ebp) memset(cmd, 0, sizeof(*cmd)); 503: c7 44 24 08 08 00 00 movl $0x8,0x8(%esp) 50a: 00 50b: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 512: 00 513: 8b 45 f4 mov -0xc(%ebp),%eax 516: 89 04 24 mov %eax,(%esp) 519: e8 9d 08 00 00 call dbb <memset> cmd->type = BACK; 51e: 8b 45 f4 mov -0xc(%ebp),%eax 521: c7 00 05 00 00 00 movl $0x5,(%eax) cmd->cmd = subcmd; 527: 8b 45 f4 mov -0xc(%ebp),%eax 52a: 8b 55 08 mov 0x8(%ebp),%edx 52d: 89 50 04 mov %edx,0x4(%eax) return (struct cmd*)cmd; 530: 8b 45 f4 mov -0xc(%ebp),%eax } 533: c9 leave 534: c3 ret 00000535 <gettoken>: char whitespace[] = " \t\r\n\v"; char symbols[] = "<|>&;()"; int gettoken(char **ps, char *es, char **q, char **eq) { 535: 55 push %ebp 536: 89 e5 mov %esp,%ebp 538: 83 ec 28 sub $0x28,%esp char *s; int ret; s = *ps; 53b: 8b 45 08 mov 0x8(%ebp),%eax 53e: 8b 00 mov (%eax),%eax 540: 89 45 f4 mov %eax,-0xc(%ebp) while(s < es && strchr(whitespace, *s)) 543: eb 04 jmp 549 <gettoken+0x14> s++; 545: 83 45 f4 01 addl $0x1,-0xc(%ebp) { char *s; int ret; s = *ps; while(s < es && strchr(whitespace, *s)) 549: 8b 45 f4 mov -0xc(%ebp),%eax 54c: 3b 45 0c cmp 0xc(%ebp),%eax 54f: 73 1d jae 56e <gettoken+0x39> 551: 8b 45 f4 mov -0xc(%ebp),%eax 554: 0f b6 00 movzbl (%eax),%eax 557: 0f be c0 movsbl %al,%eax 55a: 89 44 24 04 mov %eax,0x4(%esp) 55e: c7 04 24 2c 1a 00 00 movl $0x1a2c,(%esp) 565: e8 75 08 00 00 call ddf <strchr> 56a: 85 c0 test %eax,%eax 56c: 75 d7 jne 545 <gettoken+0x10> s++; if(q) 56e: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 572: 74 08 je 57c <gettoken+0x47> *q = s; 574: 8b 45 10 mov 0x10(%ebp),%eax 577: 8b 55 f4 mov -0xc(%ebp),%edx 57a: 89 10 mov %edx,(%eax) ret = *s; 57c: 8b 45 f4 mov -0xc(%ebp),%eax 57f: 0f b6 00 movzbl (%eax),%eax 582: 0f be c0 movsbl %al,%eax 585: 89 45 f0 mov %eax,-0x10(%ebp) switch(*s){ 588: 8b 45 f4 mov -0xc(%ebp),%eax 58b: 0f b6 00 movzbl (%eax),%eax 58e: 0f be c0 movsbl %al,%eax 591: 83 f8 3c cmp $0x3c,%eax 594: 7f 1e jg 5b4 <gettoken+0x7f> 596: 83 f8 3b cmp $0x3b,%eax 599: 7d 23 jge 5be <gettoken+0x89> 59b: 83 f8 29 cmp $0x29,%eax 59e: 7f 3f jg 5df <gettoken+0xaa> 5a0: 83 f8 28 cmp $0x28,%eax 5a3: 7d 19 jge 5be <gettoken+0x89> 5a5: 85 c0 test %eax,%eax 5a7: 0f 84 83 00 00 00 je 630 <gettoken+0xfb> 5ad: 83 f8 26 cmp $0x26,%eax 5b0: 74 0c je 5be <gettoken+0x89> 5b2: eb 2b jmp 5df <gettoken+0xaa> 5b4: 83 f8 3e cmp $0x3e,%eax 5b7: 74 0b je 5c4 <gettoken+0x8f> 5b9: 83 f8 7c cmp $0x7c,%eax 5bc: 75 21 jne 5df <gettoken+0xaa> case '(': case ')': case ';': case '&': case '<': s++; 5be: 83 45 f4 01 addl $0x1,-0xc(%ebp) break; 5c2: eb 73 jmp 637 <gettoken+0x102> case '>': s++; 5c4: 83 45 f4 01 addl $0x1,-0xc(%ebp) if(*s == '>'){ 5c8: 8b 45 f4 mov -0xc(%ebp),%eax 5cb: 0f b6 00 movzbl (%eax),%eax 5ce: 3c 3e cmp $0x3e,%al 5d0: 75 61 jne 633 <gettoken+0xfe> ret = '+'; 5d2: c7 45 f0 2b 00 00 00 movl $0x2b,-0x10(%ebp) s++; 5d9: 83 45 f4 01 addl $0x1,-0xc(%ebp) } break; 5dd: eb 54 jmp 633 <gettoken+0xfe> default: ret = 'a'; 5df: c7 45 f0 61 00 00 00 movl $0x61,-0x10(%ebp) while(s < es && !strchr(whitespace, *s) && !strchr(symbols, *s)) 5e6: eb 04 jmp 5ec <gettoken+0xb7> s++; 5e8: 83 45 f4 01 addl $0x1,-0xc(%ebp) s++; } break; default: ret = 'a'; while(s < es && !strchr(whitespace, *s) && !strchr(symbols, *s)) 5ec: 8b 45 f4 mov -0xc(%ebp),%eax 5ef: 3b 45 0c cmp 0xc(%ebp),%eax 5f2: 73 42 jae 636 <gettoken+0x101> 5f4: 8b 45 f4 mov -0xc(%ebp),%eax 5f7: 0f b6 00 movzbl (%eax),%eax 5fa: 0f be c0 movsbl %al,%eax 5fd: 89 44 24 04 mov %eax,0x4(%esp) 601: c7 04 24 2c 1a 00 00 movl $0x1a2c,(%esp) 608: e8 d2 07 00 00 call ddf <strchr> 60d: 85 c0 test %eax,%eax 60f: 75 25 jne 636 <gettoken+0x101> 611: 8b 45 f4 mov -0xc(%ebp),%eax 614: 0f b6 00 movzbl (%eax),%eax 617: 0f be c0 movsbl %al,%eax 61a: 89 44 24 04 mov %eax,0x4(%esp) 61e: c7 04 24 32 1a 00 00 movl $0x1a32,(%esp) 625: e8 b5 07 00 00 call ddf <strchr> 62a: 85 c0 test %eax,%eax 62c: 74 ba je 5e8 <gettoken+0xb3> s++; break; 62e: eb 06 jmp 636 <gettoken+0x101> if(q) *q = s; ret = *s; switch(*s){ case 0: break; 630: 90 nop 631: eb 04 jmp 637 <gettoken+0x102> s++; if(*s == '>'){ ret = '+'; s++; } break; 633: 90 nop 634: eb 01 jmp 637 <gettoken+0x102> default: ret = 'a'; while(s < es && !strchr(whitespace, *s) && !strchr(symbols, *s)) s++; break; 636: 90 nop } if(eq) 637: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 63b: 74 0e je 64b <gettoken+0x116> *eq = s; 63d: 8b 45 14 mov 0x14(%ebp),%eax 640: 8b 55 f4 mov -0xc(%ebp),%edx 643: 89 10 mov %edx,(%eax) while(s < es && strchr(whitespace, *s)) 645: eb 04 jmp 64b <gettoken+0x116> s++; 647: 83 45 f4 01 addl $0x1,-0xc(%ebp) break; } if(eq) *eq = s; while(s < es && strchr(whitespace, *s)) 64b: 8b 45 f4 mov -0xc(%ebp),%eax 64e: 3b 45 0c cmp 0xc(%ebp),%eax 651: 73 1d jae 670 <gettoken+0x13b> 653: 8b 45 f4 mov -0xc(%ebp),%eax 656: 0f b6 00 movzbl (%eax),%eax 659: 0f be c0 movsbl %al,%eax 65c: 89 44 24 04 mov %eax,0x4(%esp) 660: c7 04 24 2c 1a 00 00 movl $0x1a2c,(%esp) 667: e8 73 07 00 00 call ddf <strchr> 66c: 85 c0 test %eax,%eax 66e: 75 d7 jne 647 <gettoken+0x112> s++; *ps = s; 670: 8b 45 08 mov 0x8(%ebp),%eax 673: 8b 55 f4 mov -0xc(%ebp),%edx 676: 89 10 mov %edx,(%eax) return ret; 678: 8b 45 f0 mov -0x10(%ebp),%eax } 67b: c9 leave 67c: c3 ret 0000067d <peek>: int peek(char **ps, char *es, char *toks) { 67d: 55 push %ebp 67e: 89 e5 mov %esp,%ebp 680: 83 ec 28 sub $0x28,%esp char *s; s = *ps; 683: 8b 45 08 mov 0x8(%ebp),%eax 686: 8b 00 mov (%eax),%eax 688: 89 45 f4 mov %eax,-0xc(%ebp) while(s < es && strchr(whitespace, *s)) 68b: eb 04 jmp 691 <peek+0x14> s++; 68d: 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)) 691: 8b 45 f4 mov -0xc(%ebp),%eax 694: 3b 45 0c cmp 0xc(%ebp),%eax 697: 73 1d jae 6b6 <peek+0x39> 699: 8b 45 f4 mov -0xc(%ebp),%eax 69c: 0f b6 00 movzbl (%eax),%eax 69f: 0f be c0 movsbl %al,%eax 6a2: 89 44 24 04 mov %eax,0x4(%esp) 6a6: c7 04 24 2c 1a 00 00 movl $0x1a2c,(%esp) 6ad: e8 2d 07 00 00 call ddf <strchr> 6b2: 85 c0 test %eax,%eax 6b4: 75 d7 jne 68d <peek+0x10> s++; *ps = s; 6b6: 8b 45 08 mov 0x8(%ebp),%eax 6b9: 8b 55 f4 mov -0xc(%ebp),%edx 6bc: 89 10 mov %edx,(%eax) return *s && strchr(toks, *s); 6be: 8b 45 f4 mov -0xc(%ebp),%eax 6c1: 0f b6 00 movzbl (%eax),%eax 6c4: 84 c0 test %al,%al 6c6: 74 23 je 6eb <peek+0x6e> 6c8: 8b 45 f4 mov -0xc(%ebp),%eax 6cb: 0f b6 00 movzbl (%eax),%eax 6ce: 0f be c0 movsbl %al,%eax 6d1: 89 44 24 04 mov %eax,0x4(%esp) 6d5: 8b 45 10 mov 0x10(%ebp),%eax 6d8: 89 04 24 mov %eax,(%esp) 6db: e8 ff 06 00 00 call ddf <strchr> 6e0: 85 c0 test %eax,%eax 6e2: 74 07 je 6eb <peek+0x6e> 6e4: b8 01 00 00 00 mov $0x1,%eax 6e9: eb 05 jmp 6f0 <peek+0x73> 6eb: b8 00 00 00 00 mov $0x0,%eax } 6f0: c9 leave 6f1: c3 ret 000006f2 <parsecmd>: struct cmd *parseexec(char**, char*); struct cmd *nulterminate(struct cmd*); struct cmd* parsecmd(char *s) { 6f2: 55 push %ebp 6f3: 89 e5 mov %esp,%ebp 6f5: 53 push %ebx 6f6: 83 ec 24 sub $0x24,%esp char *es; struct cmd *cmd; es = s + strlen(s); 6f9: 8b 5d 08 mov 0x8(%ebp),%ebx 6fc: 8b 45 08 mov 0x8(%ebp),%eax 6ff: 89 04 24 mov %eax,(%esp) 702: e8 8f 06 00 00 call d96 <strlen> 707: 01 d8 add %ebx,%eax 709: 89 45 f4 mov %eax,-0xc(%ebp) cmd = parseline(&s, es); 70c: 8b 45 f4 mov -0xc(%ebp),%eax 70f: 89 44 24 04 mov %eax,0x4(%esp) 713: 8d 45 08 lea 0x8(%ebp),%eax 716: 89 04 24 mov %eax,(%esp) 719: e8 60 00 00 00 call 77e <parseline> 71e: 89 45 f0 mov %eax,-0x10(%ebp) peek(&s, es, ""); 721: c7 44 24 08 22 15 00 movl $0x1522,0x8(%esp) 728: 00 729: 8b 45 f4 mov -0xc(%ebp),%eax 72c: 89 44 24 04 mov %eax,0x4(%esp) 730: 8d 45 08 lea 0x8(%ebp),%eax 733: 89 04 24 mov %eax,(%esp) 736: e8 42 ff ff ff call 67d <peek> if(s != es){ 73b: 8b 45 08 mov 0x8(%ebp),%eax 73e: 3b 45 f4 cmp -0xc(%ebp),%eax 741: 74 27 je 76a <parsecmd+0x78> printf(2, "leftovers: %s\n", s); 743: 8b 45 08 mov 0x8(%ebp),%eax 746: 89 44 24 08 mov %eax,0x8(%esp) 74a: c7 44 24 04 23 15 00 movl $0x1523,0x4(%esp) 751: 00 752: c7 04 24 02 00 00 00 movl $0x2,(%esp) 759: e8 99 09 00 00 call 10f7 <printf> panic("syntax"); 75e: c7 04 24 32 15 00 00 movl $0x1532,(%esp) 765: e8 f0 fb ff ff call 35a <panic> } nulterminate(cmd); 76a: 8b 45 f0 mov -0x10(%ebp),%eax 76d: 89 04 24 mov %eax,(%esp) 770: e8 a5 04 00 00 call c1a <nulterminate> return cmd; 775: 8b 45 f0 mov -0x10(%ebp),%eax } 778: 83 c4 24 add $0x24,%esp 77b: 5b pop %ebx 77c: 5d pop %ebp 77d: c3 ret 0000077e <parseline>: struct cmd* parseline(char **ps, char *es) { 77e: 55 push %ebp 77f: 89 e5 mov %esp,%ebp 781: 83 ec 28 sub $0x28,%esp struct cmd *cmd; cmd = parsepipe(ps, es); 784: 8b 45 0c mov 0xc(%ebp),%eax 787: 89 44 24 04 mov %eax,0x4(%esp) 78b: 8b 45 08 mov 0x8(%ebp),%eax 78e: 89 04 24 mov %eax,(%esp) 791: e8 bc 00 00 00 call 852 <parsepipe> 796: 89 45 f4 mov %eax,-0xc(%ebp) while(peek(ps, es, "&")){ 799: eb 30 jmp 7cb <parseline+0x4d> gettoken(ps, es, 0, 0); 79b: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 7a2: 00 7a3: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) 7aa: 00 7ab: 8b 45 0c mov 0xc(%ebp),%eax 7ae: 89 44 24 04 mov %eax,0x4(%esp) 7b2: 8b 45 08 mov 0x8(%ebp),%eax 7b5: 89 04 24 mov %eax,(%esp) 7b8: e8 78 fd ff ff call 535 <gettoken> cmd = backcmd(cmd); 7bd: 8b 45 f4 mov -0xc(%ebp),%eax 7c0: 89 04 24 mov %eax,(%esp) 7c3: e8 26 fd ff ff call 4ee <backcmd> 7c8: 89 45 f4 mov %eax,-0xc(%ebp) parseline(char **ps, char *es) { struct cmd *cmd; cmd = parsepipe(ps, es); while(peek(ps, es, "&")){ 7cb: c7 44 24 08 39 15 00 movl $0x1539,0x8(%esp) 7d2: 00 7d3: 8b 45 0c mov 0xc(%ebp),%eax 7d6: 89 44 24 04 mov %eax,0x4(%esp) 7da: 8b 45 08 mov 0x8(%ebp),%eax 7dd: 89 04 24 mov %eax,(%esp) 7e0: e8 98 fe ff ff call 67d <peek> 7e5: 85 c0 test %eax,%eax 7e7: 75 b2 jne 79b <parseline+0x1d> gettoken(ps, es, 0, 0); cmd = backcmd(cmd); } if(peek(ps, es, ";")){ 7e9: c7 44 24 08 3b 15 00 movl $0x153b,0x8(%esp) 7f0: 00 7f1: 8b 45 0c mov 0xc(%ebp),%eax 7f4: 89 44 24 04 mov %eax,0x4(%esp) 7f8: 8b 45 08 mov 0x8(%ebp),%eax 7fb: 89 04 24 mov %eax,(%esp) 7fe: e8 7a fe ff ff call 67d <peek> 803: 85 c0 test %eax,%eax 805: 74 46 je 84d <parseline+0xcf> gettoken(ps, es, 0, 0); 807: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 80e: 00 80f: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) 816: 00 817: 8b 45 0c mov 0xc(%ebp),%eax 81a: 89 44 24 04 mov %eax,0x4(%esp) 81e: 8b 45 08 mov 0x8(%ebp),%eax 821: 89 04 24 mov %eax,(%esp) 824: e8 0c fd ff ff call 535 <gettoken> cmd = listcmd(cmd, parseline(ps, es)); 829: 8b 45 0c mov 0xc(%ebp),%eax 82c: 89 44 24 04 mov %eax,0x4(%esp) 830: 8b 45 08 mov 0x8(%ebp),%eax 833: 89 04 24 mov %eax,(%esp) 836: e8 43 ff ff ff call 77e <parseline> 83b: 89 44 24 04 mov %eax,0x4(%esp) 83f: 8b 45 f4 mov -0xc(%ebp),%eax 842: 89 04 24 mov %eax,(%esp) 845: e8 54 fc ff ff call 49e <listcmd> 84a: 89 45 f4 mov %eax,-0xc(%ebp) } return cmd; 84d: 8b 45 f4 mov -0xc(%ebp),%eax } 850: c9 leave 851: c3 ret 00000852 <parsepipe>: struct cmd* parsepipe(char **ps, char *es) { 852: 55 push %ebp 853: 89 e5 mov %esp,%ebp 855: 83 ec 28 sub $0x28,%esp struct cmd *cmd; cmd = parseexec(ps, es); 858: 8b 45 0c mov 0xc(%ebp),%eax 85b: 89 44 24 04 mov %eax,0x4(%esp) 85f: 8b 45 08 mov 0x8(%ebp),%eax 862: 89 04 24 mov %eax,(%esp) 865: e8 68 02 00 00 call ad2 <parseexec> 86a: 89 45 f4 mov %eax,-0xc(%ebp) if(peek(ps, es, "|")){ 86d: c7 44 24 08 3d 15 00 movl $0x153d,0x8(%esp) 874: 00 875: 8b 45 0c mov 0xc(%ebp),%eax 878: 89 44 24 04 mov %eax,0x4(%esp) 87c: 8b 45 08 mov 0x8(%ebp),%eax 87f: 89 04 24 mov %eax,(%esp) 882: e8 f6 fd ff ff call 67d <peek> 887: 85 c0 test %eax,%eax 889: 74 46 je 8d1 <parsepipe+0x7f> gettoken(ps, es, 0, 0); 88b: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 892: 00 893: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) 89a: 00 89b: 8b 45 0c mov 0xc(%ebp),%eax 89e: 89 44 24 04 mov %eax,0x4(%esp) 8a2: 8b 45 08 mov 0x8(%ebp),%eax 8a5: 89 04 24 mov %eax,(%esp) 8a8: e8 88 fc ff ff call 535 <gettoken> cmd = pipecmd(cmd, parsepipe(ps, es)); 8ad: 8b 45 0c mov 0xc(%ebp),%eax 8b0: 89 44 24 04 mov %eax,0x4(%esp) 8b4: 8b 45 08 mov 0x8(%ebp),%eax 8b7: 89 04 24 mov %eax,(%esp) 8ba: e8 93 ff ff ff call 852 <parsepipe> 8bf: 89 44 24 04 mov %eax,0x4(%esp) 8c3: 8b 45 f4 mov -0xc(%ebp),%eax 8c6: 89 04 24 mov %eax,(%esp) 8c9: e8 80 fb ff ff call 44e <pipecmd> 8ce: 89 45 f4 mov %eax,-0xc(%ebp) } return cmd; 8d1: 8b 45 f4 mov -0xc(%ebp),%eax } 8d4: c9 leave 8d5: c3 ret 000008d6 <parseredirs>: struct cmd* parseredirs(struct cmd *cmd, char **ps, char *es) { 8d6: 55 push %ebp 8d7: 89 e5 mov %esp,%ebp 8d9: 83 ec 38 sub $0x38,%esp int tok; char *q, *eq; while(peek(ps, es, "<>")){ 8dc: e9 f6 00 00 00 jmp 9d7 <parseredirs+0x101> tok = gettoken(ps, es, 0, 0); 8e1: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 8e8: 00 8e9: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) 8f0: 00 8f1: 8b 45 10 mov 0x10(%ebp),%eax 8f4: 89 44 24 04 mov %eax,0x4(%esp) 8f8: 8b 45 0c mov 0xc(%ebp),%eax 8fb: 89 04 24 mov %eax,(%esp) 8fe: e8 32 fc ff ff call 535 <gettoken> 903: 89 45 f4 mov %eax,-0xc(%ebp) if(gettoken(ps, es, &q, &eq) != 'a') 906: 8d 45 ec lea -0x14(%ebp),%eax 909: 89 44 24 0c mov %eax,0xc(%esp) 90d: 8d 45 f0 lea -0x10(%ebp),%eax 910: 89 44 24 08 mov %eax,0x8(%esp) 914: 8b 45 10 mov 0x10(%ebp),%eax 917: 89 44 24 04 mov %eax,0x4(%esp) 91b: 8b 45 0c mov 0xc(%ebp),%eax 91e: 89 04 24 mov %eax,(%esp) 921: e8 0f fc ff ff call 535 <gettoken> 926: 83 f8 61 cmp $0x61,%eax 929: 74 0c je 937 <parseredirs+0x61> panic("missing file for redirection"); 92b: c7 04 24 3f 15 00 00 movl $0x153f,(%esp) 932: e8 23 fa ff ff call 35a <panic> switch(tok){ 937: 8b 45 f4 mov -0xc(%ebp),%eax 93a: 83 f8 3c cmp $0x3c,%eax 93d: 74 0f je 94e <parseredirs+0x78> 93f: 83 f8 3e cmp $0x3e,%eax 942: 74 38 je 97c <parseredirs+0xa6> 944: 83 f8 2b cmp $0x2b,%eax 947: 74 61 je 9aa <parseredirs+0xd4> 949: e9 89 00 00 00 jmp 9d7 <parseredirs+0x101> case '<': cmd = redircmd(cmd, q, eq, O_RDONLY, 0); 94e: 8b 55 ec mov -0x14(%ebp),%edx 951: 8b 45 f0 mov -0x10(%ebp),%eax 954: c7 44 24 10 00 00 00 movl $0x0,0x10(%esp) 95b: 00 95c: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 963: 00 964: 89 54 24 08 mov %edx,0x8(%esp) 968: 89 44 24 04 mov %eax,0x4(%esp) 96c: 8b 45 08 mov 0x8(%ebp),%eax 96f: 89 04 24 mov %eax,(%esp) 972: e8 6c fa ff ff call 3e3 <redircmd> 977: 89 45 08 mov %eax,0x8(%ebp) break; 97a: eb 5b jmp 9d7 <parseredirs+0x101> case '>': cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1); 97c: 8b 55 ec mov -0x14(%ebp),%edx 97f: 8b 45 f0 mov -0x10(%ebp),%eax 982: c7 44 24 10 01 00 00 movl $0x1,0x10(%esp) 989: 00 98a: c7 44 24 0c 01 02 00 movl $0x201,0xc(%esp) 991: 00 992: 89 54 24 08 mov %edx,0x8(%esp) 996: 89 44 24 04 mov %eax,0x4(%esp) 99a: 8b 45 08 mov 0x8(%ebp),%eax 99d: 89 04 24 mov %eax,(%esp) 9a0: e8 3e fa ff ff call 3e3 <redircmd> 9a5: 89 45 08 mov %eax,0x8(%ebp) break; 9a8: eb 2d jmp 9d7 <parseredirs+0x101> case '+': // >> cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1); 9aa: 8b 55 ec mov -0x14(%ebp),%edx 9ad: 8b 45 f0 mov -0x10(%ebp),%eax 9b0: c7 44 24 10 01 00 00 movl $0x1,0x10(%esp) 9b7: 00 9b8: c7 44 24 0c 01 02 00 movl $0x201,0xc(%esp) 9bf: 00 9c0: 89 54 24 08 mov %edx,0x8(%esp) 9c4: 89 44 24 04 mov %eax,0x4(%esp) 9c8: 8b 45 08 mov 0x8(%ebp),%eax 9cb: 89 04 24 mov %eax,(%esp) 9ce: e8 10 fa ff ff call 3e3 <redircmd> 9d3: 89 45 08 mov %eax,0x8(%ebp) break; 9d6: 90 nop parseredirs(struct cmd *cmd, char **ps, char *es) { int tok; char *q, *eq; while(peek(ps, es, "<>")){ 9d7: c7 44 24 08 5c 15 00 movl $0x155c,0x8(%esp) 9de: 00 9df: 8b 45 10 mov 0x10(%ebp),%eax 9e2: 89 44 24 04 mov %eax,0x4(%esp) 9e6: 8b 45 0c mov 0xc(%ebp),%eax 9e9: 89 04 24 mov %eax,(%esp) 9ec: e8 8c fc ff ff call 67d <peek> 9f1: 85 c0 test %eax,%eax 9f3: 0f 85 e8 fe ff ff jne 8e1 <parseredirs+0xb> case '+': // >> cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1); break; } } return cmd; 9f9: 8b 45 08 mov 0x8(%ebp),%eax } 9fc: c9 leave 9fd: c3 ret 000009fe <parseblock>: struct cmd* parseblock(char **ps, char *es) { 9fe: 55 push %ebp 9ff: 89 e5 mov %esp,%ebp a01: 83 ec 28 sub $0x28,%esp struct cmd *cmd; if(!peek(ps, es, "(")) a04: c7 44 24 08 5f 15 00 movl $0x155f,0x8(%esp) a0b: 00 a0c: 8b 45 0c mov 0xc(%ebp),%eax a0f: 89 44 24 04 mov %eax,0x4(%esp) a13: 8b 45 08 mov 0x8(%ebp),%eax a16: 89 04 24 mov %eax,(%esp) a19: e8 5f fc ff ff call 67d <peek> a1e: 85 c0 test %eax,%eax a20: 75 0c jne a2e <parseblock+0x30> panic("parseblock"); a22: c7 04 24 61 15 00 00 movl $0x1561,(%esp) a29: e8 2c f9 ff ff call 35a <panic> gettoken(ps, es, 0, 0); a2e: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) a35: 00 a36: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) a3d: 00 a3e: 8b 45 0c mov 0xc(%ebp),%eax a41: 89 44 24 04 mov %eax,0x4(%esp) a45: 8b 45 08 mov 0x8(%ebp),%eax a48: 89 04 24 mov %eax,(%esp) a4b: e8 e5 fa ff ff call 535 <gettoken> cmd = parseline(ps, es); a50: 8b 45 0c mov 0xc(%ebp),%eax a53: 89 44 24 04 mov %eax,0x4(%esp) a57: 8b 45 08 mov 0x8(%ebp),%eax a5a: 89 04 24 mov %eax,(%esp) a5d: e8 1c fd ff ff call 77e <parseline> a62: 89 45 f4 mov %eax,-0xc(%ebp) if(!peek(ps, es, ")")) a65: c7 44 24 08 6c 15 00 movl $0x156c,0x8(%esp) a6c: 00 a6d: 8b 45 0c mov 0xc(%ebp),%eax a70: 89 44 24 04 mov %eax,0x4(%esp) a74: 8b 45 08 mov 0x8(%ebp),%eax a77: 89 04 24 mov %eax,(%esp) a7a: e8 fe fb ff ff call 67d <peek> a7f: 85 c0 test %eax,%eax a81: 75 0c jne a8f <parseblock+0x91> panic("syntax - missing )"); a83: c7 04 24 6e 15 00 00 movl $0x156e,(%esp) a8a: e8 cb f8 ff ff call 35a <panic> gettoken(ps, es, 0, 0); a8f: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) a96: 00 a97: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) a9e: 00 a9f: 8b 45 0c mov 0xc(%ebp),%eax aa2: 89 44 24 04 mov %eax,0x4(%esp) aa6: 8b 45 08 mov 0x8(%ebp),%eax aa9: 89 04 24 mov %eax,(%esp) aac: e8 84 fa ff ff call 535 <gettoken> cmd = parseredirs(cmd, ps, es); ab1: 8b 45 0c mov 0xc(%ebp),%eax ab4: 89 44 24 08 mov %eax,0x8(%esp) ab8: 8b 45 08 mov 0x8(%ebp),%eax abb: 89 44 24 04 mov %eax,0x4(%esp) abf: 8b 45 f4 mov -0xc(%ebp),%eax ac2: 89 04 24 mov %eax,(%esp) ac5: e8 0c fe ff ff call 8d6 <parseredirs> aca: 89 45 f4 mov %eax,-0xc(%ebp) return cmd; acd: 8b 45 f4 mov -0xc(%ebp),%eax } ad0: c9 leave ad1: c3 ret 00000ad2 <parseexec>: struct cmd* parseexec(char **ps, char *es) { ad2: 55 push %ebp ad3: 89 e5 mov %esp,%ebp ad5: 83 ec 38 sub $0x38,%esp char *q, *eq; int tok, argc; struct execcmd *cmd; struct cmd *ret; if(peek(ps, es, "(")) ad8: c7 44 24 08 5f 15 00 movl $0x155f,0x8(%esp) adf: 00 ae0: 8b 45 0c mov 0xc(%ebp),%eax ae3: 89 44 24 04 mov %eax,0x4(%esp) ae7: 8b 45 08 mov 0x8(%ebp),%eax aea: 89 04 24 mov %eax,(%esp) aed: e8 8b fb ff ff call 67d <peek> af2: 85 c0 test %eax,%eax af4: 74 17 je b0d <parseexec+0x3b> return parseblock(ps, es); af6: 8b 45 0c mov 0xc(%ebp),%eax af9: 89 44 24 04 mov %eax,0x4(%esp) afd: 8b 45 08 mov 0x8(%ebp),%eax b00: 89 04 24 mov %eax,(%esp) b03: e8 f6 fe ff ff call 9fe <parseblock> b08: e9 0b 01 00 00 jmp c18 <parseexec+0x146> ret = execcmd(); b0d: e8 93 f8 ff ff call 3a5 <execcmd> b12: 89 45 f0 mov %eax,-0x10(%ebp) cmd = (struct execcmd*)ret; b15: 8b 45 f0 mov -0x10(%ebp),%eax b18: 89 45 ec mov %eax,-0x14(%ebp) argc = 0; b1b: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) ret = parseredirs(ret, ps, es); b22: 8b 45 0c mov 0xc(%ebp),%eax b25: 89 44 24 08 mov %eax,0x8(%esp) b29: 8b 45 08 mov 0x8(%ebp),%eax b2c: 89 44 24 04 mov %eax,0x4(%esp) b30: 8b 45 f0 mov -0x10(%ebp),%eax b33: 89 04 24 mov %eax,(%esp) b36: e8 9b fd ff ff call 8d6 <parseredirs> b3b: 89 45 f0 mov %eax,-0x10(%ebp) while(!peek(ps, es, "|)&;")){ b3e: e9 8e 00 00 00 jmp bd1 <parseexec+0xff> if((tok=gettoken(ps, es, &q, &eq)) == 0) b43: 8d 45 e0 lea -0x20(%ebp),%eax b46: 89 44 24 0c mov %eax,0xc(%esp) b4a: 8d 45 e4 lea -0x1c(%ebp),%eax b4d: 89 44 24 08 mov %eax,0x8(%esp) b51: 8b 45 0c mov 0xc(%ebp),%eax b54: 89 44 24 04 mov %eax,0x4(%esp) b58: 8b 45 08 mov 0x8(%ebp),%eax b5b: 89 04 24 mov %eax,(%esp) b5e: e8 d2 f9 ff ff call 535 <gettoken> b63: 89 45 e8 mov %eax,-0x18(%ebp) b66: 83 7d e8 00 cmpl $0x0,-0x18(%ebp) b6a: 0f 84 85 00 00 00 je bf5 <parseexec+0x123> break; if(tok != 'a') b70: 83 7d e8 61 cmpl $0x61,-0x18(%ebp) b74: 74 0c je b82 <parseexec+0xb0> panic("syntax"); b76: c7 04 24 32 15 00 00 movl $0x1532,(%esp) b7d: e8 d8 f7 ff ff call 35a <panic> cmd->argv[argc] = q; b82: 8b 4d e4 mov -0x1c(%ebp),%ecx b85: 8b 45 ec mov -0x14(%ebp),%eax b88: 8b 55 f4 mov -0xc(%ebp),%edx b8b: 89 4c 90 04 mov %ecx,0x4(%eax,%edx,4) cmd->eargv[argc] = eq; b8f: 8b 55 e0 mov -0x20(%ebp),%edx b92: 8b 45 ec mov -0x14(%ebp),%eax b95: 8b 4d f4 mov -0xc(%ebp),%ecx b98: 83 c1 08 add $0x8,%ecx b9b: 89 54 88 0c mov %edx,0xc(%eax,%ecx,4) argc++; b9f: 83 45 f4 01 addl $0x1,-0xc(%ebp) if(argc >= MAXARGS) ba3: 83 7d f4 09 cmpl $0x9,-0xc(%ebp) ba7: 7e 0c jle bb5 <parseexec+0xe3> panic("too many args"); ba9: c7 04 24 81 15 00 00 movl $0x1581,(%esp) bb0: e8 a5 f7 ff ff call 35a <panic> ret = parseredirs(ret, ps, es); bb5: 8b 45 0c mov 0xc(%ebp),%eax bb8: 89 44 24 08 mov %eax,0x8(%esp) bbc: 8b 45 08 mov 0x8(%ebp),%eax bbf: 89 44 24 04 mov %eax,0x4(%esp) bc3: 8b 45 f0 mov -0x10(%ebp),%eax bc6: 89 04 24 mov %eax,(%esp) bc9: e8 08 fd ff ff call 8d6 <parseredirs> bce: 89 45 f0 mov %eax,-0x10(%ebp) ret = execcmd(); cmd = (struct execcmd*)ret; argc = 0; ret = parseredirs(ret, ps, es); while(!peek(ps, es, "|)&;")){ bd1: c7 44 24 08 8f 15 00 movl $0x158f,0x8(%esp) bd8: 00 bd9: 8b 45 0c mov 0xc(%ebp),%eax bdc: 89 44 24 04 mov %eax,0x4(%esp) be0: 8b 45 08 mov 0x8(%ebp),%eax be3: 89 04 24 mov %eax,(%esp) be6: e8 92 fa ff ff call 67d <peek> beb: 85 c0 test %eax,%eax bed: 0f 84 50 ff ff ff je b43 <parseexec+0x71> bf3: eb 01 jmp bf6 <parseexec+0x124> if((tok=gettoken(ps, es, &q, &eq)) == 0) break; bf5: 90 nop argc++; if(argc >= MAXARGS) panic("too many args"); ret = parseredirs(ret, ps, es); } cmd->argv[argc] = 0; bf6: 8b 45 ec mov -0x14(%ebp),%eax bf9: 8b 55 f4 mov -0xc(%ebp),%edx bfc: c7 44 90 04 00 00 00 movl $0x0,0x4(%eax,%edx,4) c03: 00 cmd->eargv[argc] = 0; c04: 8b 45 ec mov -0x14(%ebp),%eax c07: 8b 55 f4 mov -0xc(%ebp),%edx c0a: 83 c2 08 add $0x8,%edx c0d: c7 44 90 0c 00 00 00 movl $0x0,0xc(%eax,%edx,4) c14: 00 return ret; c15: 8b 45 f0 mov -0x10(%ebp),%eax } c18: c9 leave c19: c3 ret 00000c1a <nulterminate>: // NUL-terminate all the counted strings. struct cmd* nulterminate(struct cmd *cmd) { c1a: 55 push %ebp c1b: 89 e5 mov %esp,%ebp c1d: 83 ec 38 sub $0x38,%esp struct execcmd *ecmd; struct listcmd *lcmd; struct pipecmd *pcmd; struct redircmd *rcmd; if(cmd == 0) c20: 83 7d 08 00 cmpl $0x0,0x8(%ebp) c24: 75 0a jne c30 <nulterminate+0x16> return 0; c26: b8 00 00 00 00 mov $0x0,%eax c2b: e9 c9 00 00 00 jmp cf9 <nulterminate+0xdf> switch(cmd->type){ c30: 8b 45 08 mov 0x8(%ebp),%eax c33: 8b 00 mov (%eax),%eax c35: 83 f8 05 cmp $0x5,%eax c38: 0f 87 b8 00 00 00 ja cf6 <nulterminate+0xdc> c3e: 8b 04 85 94 15 00 00 mov 0x1594(,%eax,4),%eax c45: ff e0 jmp *%eax case EXEC: ecmd = (struct execcmd*)cmd; c47: 8b 45 08 mov 0x8(%ebp),%eax c4a: 89 45 f0 mov %eax,-0x10(%ebp) for(i=0; ecmd->argv[i]; i++) c4d: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) c54: eb 14 jmp c6a <nulterminate+0x50> *ecmd->eargv[i] = 0; c56: 8b 45 f0 mov -0x10(%ebp),%eax c59: 8b 55 f4 mov -0xc(%ebp),%edx c5c: 83 c2 08 add $0x8,%edx c5f: 8b 44 90 0c mov 0xc(%eax,%edx,4),%eax c63: c6 00 00 movb $0x0,(%eax) return 0; switch(cmd->type){ case EXEC: ecmd = (struct execcmd*)cmd; for(i=0; ecmd->argv[i]; i++) c66: 83 45 f4 01 addl $0x1,-0xc(%ebp) c6a: 8b 45 f0 mov -0x10(%ebp),%eax c6d: 8b 55 f4 mov -0xc(%ebp),%edx c70: 8b 44 90 04 mov 0x4(%eax,%edx,4),%eax c74: 85 c0 test %eax,%eax c76: 75 de jne c56 <nulterminate+0x3c> *ecmd->eargv[i] = 0; break; c78: eb 7c jmp cf6 <nulterminate+0xdc> case REDIR: rcmd = (struct redircmd*)cmd; c7a: 8b 45 08 mov 0x8(%ebp),%eax c7d: 89 45 ec mov %eax,-0x14(%ebp) nulterminate(rcmd->cmd); c80: 8b 45 ec mov -0x14(%ebp),%eax c83: 8b 40 04 mov 0x4(%eax),%eax c86: 89 04 24 mov %eax,(%esp) c89: e8 8c ff ff ff call c1a <nulterminate> *rcmd->efile = 0; c8e: 8b 45 ec mov -0x14(%ebp),%eax c91: 8b 40 0c mov 0xc(%eax),%eax c94: c6 00 00 movb $0x0,(%eax) break; c97: eb 5d jmp cf6 <nulterminate+0xdc> case PIPE: pcmd = (struct pipecmd*)cmd; c99: 8b 45 08 mov 0x8(%ebp),%eax c9c: 89 45 e8 mov %eax,-0x18(%ebp) nulterminate(pcmd->left); c9f: 8b 45 e8 mov -0x18(%ebp),%eax ca2: 8b 40 04 mov 0x4(%eax),%eax ca5: 89 04 24 mov %eax,(%esp) ca8: e8 6d ff ff ff call c1a <nulterminate> nulterminate(pcmd->right); cad: 8b 45 e8 mov -0x18(%ebp),%eax cb0: 8b 40 08 mov 0x8(%eax),%eax cb3: 89 04 24 mov %eax,(%esp) cb6: e8 5f ff ff ff call c1a <nulterminate> break; cbb: eb 39 jmp cf6 <nulterminate+0xdc> case LIST: lcmd = (struct listcmd*)cmd; cbd: 8b 45 08 mov 0x8(%ebp),%eax cc0: 89 45 e4 mov %eax,-0x1c(%ebp) nulterminate(lcmd->left); cc3: 8b 45 e4 mov -0x1c(%ebp),%eax cc6: 8b 40 04 mov 0x4(%eax),%eax cc9: 89 04 24 mov %eax,(%esp) ccc: e8 49 ff ff ff call c1a <nulterminate> nulterminate(lcmd->right); cd1: 8b 45 e4 mov -0x1c(%ebp),%eax cd4: 8b 40 08 mov 0x8(%eax),%eax cd7: 89 04 24 mov %eax,(%esp) cda: e8 3b ff ff ff call c1a <nulterminate> break; cdf: eb 15 jmp cf6 <nulterminate+0xdc> case BACK: bcmd = (struct backcmd*)cmd; ce1: 8b 45 08 mov 0x8(%ebp),%eax ce4: 89 45 e0 mov %eax,-0x20(%ebp) nulterminate(bcmd->cmd); ce7: 8b 45 e0 mov -0x20(%ebp),%eax cea: 8b 40 04 mov 0x4(%eax),%eax ced: 89 04 24 mov %eax,(%esp) cf0: e8 25 ff ff ff call c1a <nulterminate> break; cf5: 90 nop } return cmd; cf6: 8b 45 08 mov 0x8(%ebp),%eax } cf9: c9 leave cfa: c3 ret cfb: 90 nop 00000cfc <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { cfc: 55 push %ebp cfd: 89 e5 mov %esp,%ebp cff: 57 push %edi d00: 53 push %ebx asm volatile("cld; rep stosb" : d01: 8b 4d 08 mov 0x8(%ebp),%ecx d04: 8b 55 10 mov 0x10(%ebp),%edx d07: 8b 45 0c mov 0xc(%ebp),%eax d0a: 89 cb mov %ecx,%ebx d0c: 89 df mov %ebx,%edi d0e: 89 d1 mov %edx,%ecx d10: fc cld d11: f3 aa rep stos %al,%es:(%edi) d13: 89 ca mov %ecx,%edx d15: 89 fb mov %edi,%ebx d17: 89 5d 08 mov %ebx,0x8(%ebp) d1a: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } d1d: 5b pop %ebx d1e: 5f pop %edi d1f: 5d pop %ebp d20: c3 ret 00000d21 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { d21: 55 push %ebp d22: 89 e5 mov %esp,%ebp d24: 83 ec 10 sub $0x10,%esp char *os; os = s; d27: 8b 45 08 mov 0x8(%ebp),%eax d2a: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) d2d: 90 nop d2e: 8b 45 0c mov 0xc(%ebp),%eax d31: 0f b6 10 movzbl (%eax),%edx d34: 8b 45 08 mov 0x8(%ebp),%eax d37: 88 10 mov %dl,(%eax) d39: 8b 45 08 mov 0x8(%ebp),%eax d3c: 0f b6 00 movzbl (%eax),%eax d3f: 84 c0 test %al,%al d41: 0f 95 c0 setne %al d44: 83 45 08 01 addl $0x1,0x8(%ebp) d48: 83 45 0c 01 addl $0x1,0xc(%ebp) d4c: 84 c0 test %al,%al d4e: 75 de jne d2e <strcpy+0xd> ; return os; d50: 8b 45 fc mov -0x4(%ebp),%eax } d53: c9 leave d54: c3 ret 00000d55 <strcmp>: int strcmp(const char *p, const char *q) { d55: 55 push %ebp d56: 89 e5 mov %esp,%ebp while(*p && *p == *q) d58: eb 08 jmp d62 <strcmp+0xd> p++, q++; d5a: 83 45 08 01 addl $0x1,0x8(%ebp) d5e: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) d62: 8b 45 08 mov 0x8(%ebp),%eax d65: 0f b6 00 movzbl (%eax),%eax d68: 84 c0 test %al,%al d6a: 74 10 je d7c <strcmp+0x27> d6c: 8b 45 08 mov 0x8(%ebp),%eax d6f: 0f b6 10 movzbl (%eax),%edx d72: 8b 45 0c mov 0xc(%ebp),%eax d75: 0f b6 00 movzbl (%eax),%eax d78: 38 c2 cmp %al,%dl d7a: 74 de je d5a <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; d7c: 8b 45 08 mov 0x8(%ebp),%eax d7f: 0f b6 00 movzbl (%eax),%eax d82: 0f b6 d0 movzbl %al,%edx d85: 8b 45 0c mov 0xc(%ebp),%eax d88: 0f b6 00 movzbl (%eax),%eax d8b: 0f b6 c0 movzbl %al,%eax d8e: 89 d1 mov %edx,%ecx d90: 29 c1 sub %eax,%ecx d92: 89 c8 mov %ecx,%eax } d94: 5d pop %ebp d95: c3 ret 00000d96 <strlen>: uint strlen(char *s) { d96: 55 push %ebp d97: 89 e5 mov %esp,%ebp d99: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) d9c: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) da3: eb 04 jmp da9 <strlen+0x13> da5: 83 45 fc 01 addl $0x1,-0x4(%ebp) da9: 8b 45 fc mov -0x4(%ebp),%eax dac: 03 45 08 add 0x8(%ebp),%eax daf: 0f b6 00 movzbl (%eax),%eax db2: 84 c0 test %al,%al db4: 75 ef jne da5 <strlen+0xf> ; return n; db6: 8b 45 fc mov -0x4(%ebp),%eax } db9: c9 leave dba: c3 ret 00000dbb <memset>: void* memset(void *dst, int c, uint n) { dbb: 55 push %ebp dbc: 89 e5 mov %esp,%ebp dbe: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); dc1: 8b 45 10 mov 0x10(%ebp),%eax dc4: 89 44 24 08 mov %eax,0x8(%esp) dc8: 8b 45 0c mov 0xc(%ebp),%eax dcb: 89 44 24 04 mov %eax,0x4(%esp) dcf: 8b 45 08 mov 0x8(%ebp),%eax dd2: 89 04 24 mov %eax,(%esp) dd5: e8 22 ff ff ff call cfc <stosb> return dst; dda: 8b 45 08 mov 0x8(%ebp),%eax } ddd: c9 leave dde: c3 ret 00000ddf <strchr>: char* strchr(const char *s, char c) { ddf: 55 push %ebp de0: 89 e5 mov %esp,%ebp de2: 83 ec 04 sub $0x4,%esp de5: 8b 45 0c mov 0xc(%ebp),%eax de8: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) deb: eb 14 jmp e01 <strchr+0x22> if(*s == c) ded: 8b 45 08 mov 0x8(%ebp),%eax df0: 0f b6 00 movzbl (%eax),%eax df3: 3a 45 fc cmp -0x4(%ebp),%al df6: 75 05 jne dfd <strchr+0x1e> return (char*)s; df8: 8b 45 08 mov 0x8(%ebp),%eax dfb: eb 13 jmp e10 <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) dfd: 83 45 08 01 addl $0x1,0x8(%ebp) e01: 8b 45 08 mov 0x8(%ebp),%eax e04: 0f b6 00 movzbl (%eax),%eax e07: 84 c0 test %al,%al e09: 75 e2 jne ded <strchr+0xe> if(*s == c) return (char*)s; return 0; e0b: b8 00 00 00 00 mov $0x0,%eax } e10: c9 leave e11: c3 ret 00000e12 <gets>: char* gets(char *buf, int max) { e12: 55 push %ebp e13: 89 e5 mov %esp,%ebp e15: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ e18: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) e1f: eb 44 jmp e65 <gets+0x53> cc = read(0, &c, 1); e21: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) e28: 00 e29: 8d 45 ef lea -0x11(%ebp),%eax e2c: 89 44 24 04 mov %eax,0x4(%esp) e30: c7 04 24 00 00 00 00 movl $0x0,(%esp) e37: e8 3c 01 00 00 call f78 <read> e3c: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) e3f: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) e43: 7e 2d jle e72 <gets+0x60> break; buf[i++] = c; e45: 8b 45 f4 mov -0xc(%ebp),%eax e48: 03 45 08 add 0x8(%ebp),%eax e4b: 0f b6 55 ef movzbl -0x11(%ebp),%edx e4f: 88 10 mov %dl,(%eax) e51: 83 45 f4 01 addl $0x1,-0xc(%ebp) if(c == '\n' || c == '\r') e55: 0f b6 45 ef movzbl -0x11(%ebp),%eax e59: 3c 0a cmp $0xa,%al e5b: 74 16 je e73 <gets+0x61> e5d: 0f b6 45 ef movzbl -0x11(%ebp),%eax e61: 3c 0d cmp $0xd,%al e63: 74 0e je e73 <gets+0x61> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ e65: 8b 45 f4 mov -0xc(%ebp),%eax e68: 83 c0 01 add $0x1,%eax e6b: 3b 45 0c cmp 0xc(%ebp),%eax e6e: 7c b1 jl e21 <gets+0xf> e70: eb 01 jmp e73 <gets+0x61> cc = read(0, &c, 1); if(cc < 1) break; e72: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; e73: 8b 45 f4 mov -0xc(%ebp),%eax e76: 03 45 08 add 0x8(%ebp),%eax e79: c6 00 00 movb $0x0,(%eax) return buf; e7c: 8b 45 08 mov 0x8(%ebp),%eax } e7f: c9 leave e80: c3 ret 00000e81 <stat>: int stat(char *n, struct stat *st) { e81: 55 push %ebp e82: 89 e5 mov %esp,%ebp e84: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); e87: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) e8e: 00 e8f: 8b 45 08 mov 0x8(%ebp),%eax e92: 89 04 24 mov %eax,(%esp) e95: e8 06 01 00 00 call fa0 <open> e9a: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) e9d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) ea1: 79 07 jns eaa <stat+0x29> return -1; ea3: b8 ff ff ff ff mov $0xffffffff,%eax ea8: eb 23 jmp ecd <stat+0x4c> r = fstat(fd, st); eaa: 8b 45 0c mov 0xc(%ebp),%eax ead: 89 44 24 04 mov %eax,0x4(%esp) eb1: 8b 45 f4 mov -0xc(%ebp),%eax eb4: 89 04 24 mov %eax,(%esp) eb7: e8 fc 00 00 00 call fb8 <fstat> ebc: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); ebf: 8b 45 f4 mov -0xc(%ebp),%eax ec2: 89 04 24 mov %eax,(%esp) ec5: e8 be 00 00 00 call f88 <close> return r; eca: 8b 45 f0 mov -0x10(%ebp),%eax } ecd: c9 leave ece: c3 ret 00000ecf <atoi>: int atoi(const char *s) { ecf: 55 push %ebp ed0: 89 e5 mov %esp,%ebp ed2: 83 ec 10 sub $0x10,%esp int n; n = 0; ed5: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') edc: eb 23 jmp f01 <atoi+0x32> n = n*10 + *s++ - '0'; ede: 8b 55 fc mov -0x4(%ebp),%edx ee1: 89 d0 mov %edx,%eax ee3: c1 e0 02 shl $0x2,%eax ee6: 01 d0 add %edx,%eax ee8: 01 c0 add %eax,%eax eea: 89 c2 mov %eax,%edx eec: 8b 45 08 mov 0x8(%ebp),%eax eef: 0f b6 00 movzbl (%eax),%eax ef2: 0f be c0 movsbl %al,%eax ef5: 01 d0 add %edx,%eax ef7: 83 e8 30 sub $0x30,%eax efa: 89 45 fc mov %eax,-0x4(%ebp) efd: 83 45 08 01 addl $0x1,0x8(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') f01: 8b 45 08 mov 0x8(%ebp),%eax f04: 0f b6 00 movzbl (%eax),%eax f07: 3c 2f cmp $0x2f,%al f09: 7e 0a jle f15 <atoi+0x46> f0b: 8b 45 08 mov 0x8(%ebp),%eax f0e: 0f b6 00 movzbl (%eax),%eax f11: 3c 39 cmp $0x39,%al f13: 7e c9 jle ede <atoi+0xf> n = n*10 + *s++ - '0'; return n; f15: 8b 45 fc mov -0x4(%ebp),%eax } f18: c9 leave f19: c3 ret 00000f1a <memmove>: void* memmove(void *vdst, void *vsrc, int n) { f1a: 55 push %ebp f1b: 89 e5 mov %esp,%ebp f1d: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; f20: 8b 45 08 mov 0x8(%ebp),%eax f23: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; f26: 8b 45 0c mov 0xc(%ebp),%eax f29: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) f2c: eb 13 jmp f41 <memmove+0x27> *dst++ = *src++; f2e: 8b 45 f8 mov -0x8(%ebp),%eax f31: 0f b6 10 movzbl (%eax),%edx f34: 8b 45 fc mov -0x4(%ebp),%eax f37: 88 10 mov %dl,(%eax) f39: 83 45 fc 01 addl $0x1,-0x4(%ebp) f3d: 83 45 f8 01 addl $0x1,-0x8(%ebp) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) f41: 83 7d 10 00 cmpl $0x0,0x10(%ebp) f45: 0f 9f c0 setg %al f48: 83 6d 10 01 subl $0x1,0x10(%ebp) f4c: 84 c0 test %al,%al f4e: 75 de jne f2e <memmove+0x14> *dst++ = *src++; return vdst; f50: 8b 45 08 mov 0x8(%ebp),%eax } f53: c9 leave f54: c3 ret f55: 90 nop f56: 90 nop f57: 90 nop 00000f58 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) f58: b8 01 00 00 00 mov $0x1,%eax f5d: cd 40 int $0x40 f5f: c3 ret 00000f60 <exit>: SYSCALL(exit) f60: b8 02 00 00 00 mov $0x2,%eax f65: cd 40 int $0x40 f67: c3 ret 00000f68 <wait>: SYSCALL(wait) f68: b8 03 00 00 00 mov $0x3,%eax f6d: cd 40 int $0x40 f6f: c3 ret 00000f70 <pipe>: SYSCALL(pipe) f70: b8 04 00 00 00 mov $0x4,%eax f75: cd 40 int $0x40 f77: c3 ret 00000f78 <read>: SYSCALL(read) f78: b8 05 00 00 00 mov $0x5,%eax f7d: cd 40 int $0x40 f7f: c3 ret 00000f80 <write>: SYSCALL(write) f80: b8 10 00 00 00 mov $0x10,%eax f85: cd 40 int $0x40 f87: c3 ret 00000f88 <close>: SYSCALL(close) f88: b8 15 00 00 00 mov $0x15,%eax f8d: cd 40 int $0x40 f8f: c3 ret 00000f90 <kill>: SYSCALL(kill) f90: b8 06 00 00 00 mov $0x6,%eax f95: cd 40 int $0x40 f97: c3 ret 00000f98 <exec>: SYSCALL(exec) f98: b8 07 00 00 00 mov $0x7,%eax f9d: cd 40 int $0x40 f9f: c3 ret 00000fa0 <open>: SYSCALL(open) fa0: b8 0f 00 00 00 mov $0xf,%eax fa5: cd 40 int $0x40 fa7: c3 ret 00000fa8 <mknod>: SYSCALL(mknod) fa8: b8 11 00 00 00 mov $0x11,%eax fad: cd 40 int $0x40 faf: c3 ret 00000fb0 <unlink>: SYSCALL(unlink) fb0: b8 12 00 00 00 mov $0x12,%eax fb5: cd 40 int $0x40 fb7: c3 ret 00000fb8 <fstat>: SYSCALL(fstat) fb8: b8 08 00 00 00 mov $0x8,%eax fbd: cd 40 int $0x40 fbf: c3 ret 00000fc0 <link>: SYSCALL(link) fc0: b8 13 00 00 00 mov $0x13,%eax fc5: cd 40 int $0x40 fc7: c3 ret 00000fc8 <mkdir>: SYSCALL(mkdir) fc8: b8 14 00 00 00 mov $0x14,%eax fcd: cd 40 int $0x40 fcf: c3 ret 00000fd0 <chdir>: SYSCALL(chdir) fd0: b8 09 00 00 00 mov $0x9,%eax fd5: cd 40 int $0x40 fd7: c3 ret 00000fd8 <dup>: SYSCALL(dup) fd8: b8 0a 00 00 00 mov $0xa,%eax fdd: cd 40 int $0x40 fdf: c3 ret 00000fe0 <getpid>: SYSCALL(getpid) fe0: b8 0b 00 00 00 mov $0xb,%eax fe5: cd 40 int $0x40 fe7: c3 ret 00000fe8 <sbrk>: SYSCALL(sbrk) fe8: b8 0c 00 00 00 mov $0xc,%eax fed: cd 40 int $0x40 fef: c3 ret 00000ff0 <sleep>: SYSCALL(sleep) ff0: b8 0d 00 00 00 mov $0xd,%eax ff5: cd 40 int $0x40 ff7: c3 ret 00000ff8 <uptime>: SYSCALL(uptime) ff8: b8 0e 00 00 00 mov $0xe,%eax ffd: cd 40 int $0x40 fff: c3 ret 00001000 <halt>: SYSCALL(halt) 1000: b8 16 00 00 00 mov $0x16,%eax 1005: cd 40 int $0x40 1007: c3 ret 00001008 <clone>: SYSCALL(clone) 1008: b8 19 00 00 00 mov $0x19,%eax 100d: cd 40 int $0x40 100f: c3 ret 00001010 <join>: SYSCALL(join) 1010: b8 1a 00 00 00 mov $0x1a,%eax 1015: cd 40 int $0x40 1017: c3 ret 00001018 <texit>: SYSCALL(texit) 1018: b8 1b 00 00 00 mov $0x1b,%eax 101d: cd 40 int $0x40 101f: c3 ret 00001020 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 1020: 55 push %ebp 1021: 89 e5 mov %esp,%ebp 1023: 83 ec 28 sub $0x28,%esp 1026: 8b 45 0c mov 0xc(%ebp),%eax 1029: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 102c: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 1033: 00 1034: 8d 45 f4 lea -0xc(%ebp),%eax 1037: 89 44 24 04 mov %eax,0x4(%esp) 103b: 8b 45 08 mov 0x8(%ebp),%eax 103e: 89 04 24 mov %eax,(%esp) 1041: e8 3a ff ff ff call f80 <write> } 1046: c9 leave 1047: c3 ret 00001048 <printint>: static void printint(int fd, int xx, int base, int sgn) { 1048: 55 push %ebp 1049: 89 e5 mov %esp,%ebp 104b: 83 ec 48 sub $0x48,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 104e: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 1055: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 1059: 74 17 je 1072 <printint+0x2a> 105b: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 105f: 79 11 jns 1072 <printint+0x2a> neg = 1; 1061: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 1068: 8b 45 0c mov 0xc(%ebp),%eax 106b: f7 d8 neg %eax 106d: 89 45 ec mov %eax,-0x14(%ebp) 1070: eb 06 jmp 1078 <printint+0x30> } else { x = xx; 1072: 8b 45 0c mov 0xc(%ebp),%eax 1075: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 1078: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 107f: 8b 4d 10 mov 0x10(%ebp),%ecx 1082: 8b 45 ec mov -0x14(%ebp),%eax 1085: ba 00 00 00 00 mov $0x0,%edx 108a: f7 f1 div %ecx 108c: 89 d0 mov %edx,%eax 108e: 0f b6 90 3c 1a 00 00 movzbl 0x1a3c(%eax),%edx 1095: 8d 45 dc lea -0x24(%ebp),%eax 1098: 03 45 f4 add -0xc(%ebp),%eax 109b: 88 10 mov %dl,(%eax) 109d: 83 45 f4 01 addl $0x1,-0xc(%ebp) }while((x /= base) != 0); 10a1: 8b 55 10 mov 0x10(%ebp),%edx 10a4: 89 55 d4 mov %edx,-0x2c(%ebp) 10a7: 8b 45 ec mov -0x14(%ebp),%eax 10aa: ba 00 00 00 00 mov $0x0,%edx 10af: f7 75 d4 divl -0x2c(%ebp) 10b2: 89 45 ec mov %eax,-0x14(%ebp) 10b5: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 10b9: 75 c4 jne 107f <printint+0x37> if(neg) 10bb: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 10bf: 74 2a je 10eb <printint+0xa3> buf[i++] = '-'; 10c1: 8d 45 dc lea -0x24(%ebp),%eax 10c4: 03 45 f4 add -0xc(%ebp),%eax 10c7: c6 00 2d movb $0x2d,(%eax) 10ca: 83 45 f4 01 addl $0x1,-0xc(%ebp) while(--i >= 0) 10ce: eb 1b jmp 10eb <printint+0xa3> putc(fd, buf[i]); 10d0: 8d 45 dc lea -0x24(%ebp),%eax 10d3: 03 45 f4 add -0xc(%ebp),%eax 10d6: 0f b6 00 movzbl (%eax),%eax 10d9: 0f be c0 movsbl %al,%eax 10dc: 89 44 24 04 mov %eax,0x4(%esp) 10e0: 8b 45 08 mov 0x8(%ebp),%eax 10e3: 89 04 24 mov %eax,(%esp) 10e6: e8 35 ff ff ff call 1020 <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 10eb: 83 6d f4 01 subl $0x1,-0xc(%ebp) 10ef: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10f3: 79 db jns 10d0 <printint+0x88> putc(fd, buf[i]); } 10f5: c9 leave 10f6: c3 ret 000010f7 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 10f7: 55 push %ebp 10f8: 89 e5 mov %esp,%ebp 10fa: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 10fd: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 1104: 8d 45 0c lea 0xc(%ebp),%eax 1107: 83 c0 04 add $0x4,%eax 110a: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 110d: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 1114: e9 7d 01 00 00 jmp 1296 <printf+0x19f> c = fmt[i] & 0xff; 1119: 8b 55 0c mov 0xc(%ebp),%edx 111c: 8b 45 f0 mov -0x10(%ebp),%eax 111f: 01 d0 add %edx,%eax 1121: 0f b6 00 movzbl (%eax),%eax 1124: 0f be c0 movsbl %al,%eax 1127: 25 ff 00 00 00 and $0xff,%eax 112c: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 112f: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 1133: 75 2c jne 1161 <printf+0x6a> if(c == '%'){ 1135: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 1139: 75 0c jne 1147 <printf+0x50> state = '%'; 113b: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 1142: e9 4b 01 00 00 jmp 1292 <printf+0x19b> } else { putc(fd, c); 1147: 8b 45 e4 mov -0x1c(%ebp),%eax 114a: 0f be c0 movsbl %al,%eax 114d: 89 44 24 04 mov %eax,0x4(%esp) 1151: 8b 45 08 mov 0x8(%ebp),%eax 1154: 89 04 24 mov %eax,(%esp) 1157: e8 c4 fe ff ff call 1020 <putc> 115c: e9 31 01 00 00 jmp 1292 <printf+0x19b> } } else if(state == '%'){ 1161: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 1165: 0f 85 27 01 00 00 jne 1292 <printf+0x19b> if(c == 'd'){ 116b: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 116f: 75 2d jne 119e <printf+0xa7> printint(fd, *ap, 10, 1); 1171: 8b 45 e8 mov -0x18(%ebp),%eax 1174: 8b 00 mov (%eax),%eax 1176: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 117d: 00 117e: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 1185: 00 1186: 89 44 24 04 mov %eax,0x4(%esp) 118a: 8b 45 08 mov 0x8(%ebp),%eax 118d: 89 04 24 mov %eax,(%esp) 1190: e8 b3 fe ff ff call 1048 <printint> ap++; 1195: 83 45 e8 04 addl $0x4,-0x18(%ebp) 1199: e9 ed 00 00 00 jmp 128b <printf+0x194> } else if(c == 'x' || c == 'p'){ 119e: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 11a2: 74 06 je 11aa <printf+0xb3> 11a4: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 11a8: 75 2d jne 11d7 <printf+0xe0> printint(fd, *ap, 16, 0); 11aa: 8b 45 e8 mov -0x18(%ebp),%eax 11ad: 8b 00 mov (%eax),%eax 11af: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 11b6: 00 11b7: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 11be: 00 11bf: 89 44 24 04 mov %eax,0x4(%esp) 11c3: 8b 45 08 mov 0x8(%ebp),%eax 11c6: 89 04 24 mov %eax,(%esp) 11c9: e8 7a fe ff ff call 1048 <printint> ap++; 11ce: 83 45 e8 04 addl $0x4,-0x18(%ebp) 11d2: e9 b4 00 00 00 jmp 128b <printf+0x194> } else if(c == 's'){ 11d7: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 11db: 75 46 jne 1223 <printf+0x12c> s = (char*)*ap; 11dd: 8b 45 e8 mov -0x18(%ebp),%eax 11e0: 8b 00 mov (%eax),%eax 11e2: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 11e5: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 11e9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 11ed: 75 27 jne 1216 <printf+0x11f> s = "(null)"; 11ef: c7 45 f4 ac 15 00 00 movl $0x15ac,-0xc(%ebp) while(*s != 0){ 11f6: eb 1e jmp 1216 <printf+0x11f> putc(fd, *s); 11f8: 8b 45 f4 mov -0xc(%ebp),%eax 11fb: 0f b6 00 movzbl (%eax),%eax 11fe: 0f be c0 movsbl %al,%eax 1201: 89 44 24 04 mov %eax,0x4(%esp) 1205: 8b 45 08 mov 0x8(%ebp),%eax 1208: 89 04 24 mov %eax,(%esp) 120b: e8 10 fe ff ff call 1020 <putc> s++; 1210: 83 45 f4 01 addl $0x1,-0xc(%ebp) 1214: eb 01 jmp 1217 <printf+0x120> } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 1216: 90 nop 1217: 8b 45 f4 mov -0xc(%ebp),%eax 121a: 0f b6 00 movzbl (%eax),%eax 121d: 84 c0 test %al,%al 121f: 75 d7 jne 11f8 <printf+0x101> 1221: eb 68 jmp 128b <printf+0x194> putc(fd, *s); s++; } } else if(c == 'c'){ 1223: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 1227: 75 1d jne 1246 <printf+0x14f> putc(fd, *ap); 1229: 8b 45 e8 mov -0x18(%ebp),%eax 122c: 8b 00 mov (%eax),%eax 122e: 0f be c0 movsbl %al,%eax 1231: 89 44 24 04 mov %eax,0x4(%esp) 1235: 8b 45 08 mov 0x8(%ebp),%eax 1238: 89 04 24 mov %eax,(%esp) 123b: e8 e0 fd ff ff call 1020 <putc> ap++; 1240: 83 45 e8 04 addl $0x4,-0x18(%ebp) 1244: eb 45 jmp 128b <printf+0x194> } else if(c == '%'){ 1246: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 124a: 75 17 jne 1263 <printf+0x16c> putc(fd, c); 124c: 8b 45 e4 mov -0x1c(%ebp),%eax 124f: 0f be c0 movsbl %al,%eax 1252: 89 44 24 04 mov %eax,0x4(%esp) 1256: 8b 45 08 mov 0x8(%ebp),%eax 1259: 89 04 24 mov %eax,(%esp) 125c: e8 bf fd ff ff call 1020 <putc> 1261: eb 28 jmp 128b <printf+0x194> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 1263: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) 126a: 00 126b: 8b 45 08 mov 0x8(%ebp),%eax 126e: 89 04 24 mov %eax,(%esp) 1271: e8 aa fd ff ff call 1020 <putc> putc(fd, c); 1276: 8b 45 e4 mov -0x1c(%ebp),%eax 1279: 0f be c0 movsbl %al,%eax 127c: 89 44 24 04 mov %eax,0x4(%esp) 1280: 8b 45 08 mov 0x8(%ebp),%eax 1283: 89 04 24 mov %eax,(%esp) 1286: e8 95 fd ff ff call 1020 <putc> } state = 0; 128b: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 1292: 83 45 f0 01 addl $0x1,-0x10(%ebp) 1296: 8b 55 0c mov 0xc(%ebp),%edx 1299: 8b 45 f0 mov -0x10(%ebp),%eax 129c: 01 d0 add %edx,%eax 129e: 0f b6 00 movzbl (%eax),%eax 12a1: 84 c0 test %al,%al 12a3: 0f 85 70 fe ff ff jne 1119 <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 cc 1a 00 00 mov 0x1acc,%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 cc 1a 00 00 mov %eax,0x1acc } 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 41 fc ff ff call fe8 <sbrk> 13a7: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 13aa: 83 7d f4 ff cmpl $0xffffffff,-0xc(%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 f4 mov -0xc(%ebp),%eax 13ba: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 13bd: 8b 45 f0 mov -0x10(%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 f0 mov -0x10(%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 cc 1a 00 00 mov 0x1acc,%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 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 13f0: a1 cc 1a 00 00 mov 0x1acc,%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 c4 1a 00 00 movl $0x1ac4,-0x10(%ebp) 1405: 8b 45 f0 mov -0x10(%ebp),%eax 1408: a3 cc 1a 00 00 mov %eax,0x1acc 140d: a1 cc 1a 00 00 mov 0x1acc,%eax 1412: a3 c4 1a 00 00 mov %eax,0x1ac4 base.s.size = 0; 1417: c7 05 c8 1a 00 00 00 movl $0x0,0x1ac8 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 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 1429: 8b 45 f4 mov -0xc(%ebp),%eax 142c: 8b 40 04 mov 0x4(%eax),%eax 142f: 3b 45 ec cmp -0x14(%ebp),%eax 1432: 72 4d jb 1481 <malloc+0xa6> if(p->s.size == nunits) 1434: 8b 45 f4 mov -0xc(%ebp),%eax 1437: 8b 40 04 mov 0x4(%eax),%eax 143a: 3b 45 ec cmp -0x14(%ebp),%eax 143d: 75 0c jne 144b <malloc+0x70> prevp->s.ptr = p->s.ptr; 143f: 8b 45 f4 mov -0xc(%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 f4 mov -0xc(%ebp),%eax 144e: 8b 40 04 mov 0x4(%eax),%eax 1451: 89 c2 mov %eax,%edx 1453: 2b 55 ec sub -0x14(%ebp),%edx 1456: 8b 45 f4 mov -0xc(%ebp),%eax 1459: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 145c: 8b 45 f4 mov -0xc(%ebp),%eax 145f: 8b 40 04 mov 0x4(%eax),%eax 1462: c1 e0 03 shl $0x3,%eax 1465: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; 1468: 8b 45 f4 mov -0xc(%ebp),%eax 146b: 8b 55 ec mov -0x14(%ebp),%edx 146e: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 1471: 8b 45 f0 mov -0x10(%ebp),%eax 1474: a3 cc 1a 00 00 mov %eax,0x1acc return (void*)(p + 1); 1479: 8b 45 f4 mov -0xc(%ebp),%eax 147c: 83 c0 08 add $0x8,%eax 147f: eb 38 jmp 14b9 <malloc+0xde> } if(p == freep) 1481: a1 cc 1a 00 00 mov 0x1acc,%eax 1486: 39 45 f4 cmp %eax,-0xc(%ebp) 1489: 75 1b jne 14a6 <malloc+0xcb> if((p = morecore(nunits)) == 0) 148b: 8b 45 ec mov -0x14(%ebp),%eax 148e: 89 04 24 mov %eax,(%esp) 1491: e8 ed fe ff ff call 1383 <morecore> 1496: 89 45 f4 mov %eax,-0xc(%ebp) 1499: 83 7d f4 00 cmpl $0x0,-0xc(%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 f4 mov -0xc(%ebp),%eax 14a9: 89 45 f0 mov %eax,-0x10(%ebp) 14ac: 8b 45 f4 mov -0xc(%ebp),%eax 14af: 8b 00 mov (%eax),%eax 14b1: 89 45 f4 mov %eax,-0xc(%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
cpp-main-big/src/ada-b/i_am_ada_too.ads
dksmiffs/gnatmake-examples
0
11288
<reponame>dksmiffs/gnatmake-examples package I_Am_Ada_Too is procedure Ada_Procedure_Too; pragma Export (C, Ada_Procedure_Too, "ada_procedure_too"); end I_Am_Ada_Too;
semester-5/microprocessor/32sub.asm
saranshbht/bsc-codes
3
105110
.model small .data first dw 1234h, 5678h second dw 5678h, 1234h result dw 2 dup(0) temp dw ? msg db "Result: $", 10 .code .startup mov si, 0h lea dx, msg mov ah, 09h int 21h mov cx, 2h clc arr: mov dx, first[si] sbb dx, second[si] mov result[si], dx inc si inc si loop arr mov cx, 2h ;check if the result is negative jnc print2 ;print '-' character mov dl, 2dh mov ah, 02h int 21h ;2's complement mov si, 0h compl: not result[si] inc si inc si loop compl mov si, 0h mov cx, 2h stc add1: adc result[si], 0h inc si inc si loop add1 mov cx, 2h ; mov si, 1h print2: dec si dec si mov temp, cx mov bx, result[si] mov cx, 4 print: rol bx, 4 mov dl, bl and dl, 0fh add dl, 30h cmp dl, 39h jbe print12 add dl, 07h print12: mov ah, 02h int 21h loop print mov cx, temp loop print2 .exit end
resources/scripts/api/anubisdb.ads
Elon143/Amass
7,053
2364
<gh_stars>1000+ -- Copyright 2021 <NAME>. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. name = "AnubisDB" type = "api" function start() set_rate_limit(1) end function vertical(ctx, domain) scrape(ctx, {['url']=build_url(domain)}) end function build_url(domain) return "https://jldc.me/anubis/subdomains/" .. domain end
gcc-gcc-7_3_0-release/gcc/ada/par_sco.ads
best08618/asylo
7
30718
<gh_stars>1-10 ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- P A R _ S C O -- -- -- -- S p e c -- -- -- -- Copyright (C) 2009-2014, 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. 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 COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package contains the routines used to deal with generation and output -- of Source Coverage Obligations (SCO's) used for coverage analysis purposes. -- See package SCOs for full documentation of format of SCO information. with Types; use Types; package Par_SCO is ----------------- -- Subprograms -- ----------------- procedure Initialize; -- Initialize internal tables for a new compilation procedure SCO_Record_Raw (U : Unit_Number_Type); -- This procedure scans the tree for the unit identified by U, populating -- internal tables recording the SCO information. Note that this is done -- before any semantic analysis/expansion happens. procedure Set_SCO_Condition (Cond : Node_Id; Val : Boolean); -- This procedure is called during semantic analysis to record a condition -- which has been identified as always True or always False, as indicated -- by Val. The condition is identified by the First_Sloc value in the -- original tree associated with Cond. procedure Set_SCO_Logical_Operator (Op : Node_Id); -- Mark some putative logical operator as a short circuit one procedure Set_SCO_Pragma_Enabled (Loc : Source_Ptr); -- This procedure is called from Sem_Prag when a pragma is enabled (i.e. -- when the Pragma_Enabled flag is set). Loc is the Sloc of the N_Pragma -- node. This is used to enable the corresponding statement SCO entry. Note -- that we use the Sloc as the key here, since in the generic case, the -- analysis is on a copy of the node, which is different from the node -- seen by Par_SCO in the parse tree (but the Sloc values are the same). function SCO_Pragma_Disabled (Loc : Source_Ptr) return Boolean; -- True if Loc is the source location of a disabled pragma procedure SCO_Record_Filtered; -- This procedure filters remaining putative AND/OR short-circuit operators -- from the internal SCO raw table after the semantic analysis and fills -- the filtered SCO table. procedure SCO_Output; -- Outputs SCO lines for all units, with appropriate section headers, as -- recorded by previous calls to SCO_Record, possibly modified by calls to -- Set_SCO_Condition. procedure dsco; -- Debug routine to dump internal SCO tables. This is a raw format dump -- showing exactly what the tables contain. procedure pscos; -- Debugging procedure to output contents of SCO binary tables in the -- format in which they appear in an ALI file. end Par_SCO;
data/baseStats_original/scizor.asm
adhi-thirumala/EvoYellow
16
20537
;ScizorBaseStats: ; 39136 (e:5136) db DEX_SCIZOR ; pokedex id db 70 ; base hp db 130 ; base attack db 100 ; base defense db 65 ; base speed db 80 ; base special db BUG ; species type 1 db STEEL ; species type 2 db 20 ; catch rate db 200 ; base exp yield INCBIN "pic/ymon/scizor.pic",0,1 ; 77, sprite dimensions dw ScizorPicFront dw ScizorPicBack ; move db VICEGRIP db CUT db 0 db 0 db 0 ; growth rate ; learnset tmlearn 3,6 tmlearn 9,10,15 tmlearn 17,18,19,20 tmlearn 31,32 tmlearn 34,39,40 tmlearn 41,44 tmlearn 51,54 db BANK(ScizorPicFront)
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/mlib2d.asm
ahjelm/z88dk
640
174638
<reponame>ahjelm/z88dk<gh_stars>100-1000 SECTION code_clib SECTION code_fp_math48 PUBLIC mlib2d EXTERN cm48_sccz80_m482d defc mlib2d = cm48_sccz80_m482d
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_949.asm
ljhsiun2/medusa
9
5738
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r14 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x52d1, %r10 nop nop sub %r14, %r14 movups (%r10), %xmm4 vpextrq $0, %xmm4, %r12 xor %rbx, %rbx lea addresses_WC_ht+0x14c9, %r14 nop nop inc %rdx mov (%r14), %si nop nop nop nop cmp $42245, %r12 lea addresses_WC_ht+0x14331, %rsi lea addresses_D_ht+0xeef1, %rdi xor $28634, %rbx mov $11, %rcx rep movsl cmp $61116, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r14 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r15 push %r9 push %rax push %rcx push %rdi push %rdx push %rsi // REPMOV lea addresses_WC+0xd750, %rsi lea addresses_D+0x9a31, %rdi clflush (%rsi) nop nop cmp $10283, %rax mov $123, %rcx rep movsb nop nop nop sub $28314, %rdi // Faulty Load lea addresses_PSE+0xa4d1, %rsi nop nop nop dec %rdx vmovups (%rsi), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %r15 lea oracles, %rdi and $0xff, %r15 shlq $12, %r15 mov (%rdi,%r15,1), %r15 pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r15 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_PSE', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D', 'congruent': 4, 'same': False}, 'OP': 'REPM'} [Faulty Load] {'src': {'type': 'addresses_PSE', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
01/2/src/main.adb
Heziode/aoc-ada-2021
3
13627
with Ada.Containers.Vectors, Ada.Exceptions, Ada.Integer_Text_IO, Ada.Text_IO; with Utils; procedure Main is use Ada.Text_IO; use Utils; use type Ada.Containers.Count_Type; package Integer_Vectors is new Ada.Containers.Vectors (Natural, Integer); use Integer_Vectors; File : File_Type; Values : Vector := Empty_Vector; begin Get_File (File); -- Get all values while not End_Of_File (File) loop declare Value : Natural; begin Ada.Integer_Text_IO.Get (File, Value); Values.Append (Value); end; end loop; -- Exit the program if there is no values if Values.Length < 3 then Close_If_Open (File); Put_Line ("The input file is empty or too small (at least 3 values are required)."); return; end if; -- Do the puzzle Solve_Puzzle : declare type Modular_Index_Of_3 is mod 3; Curs : Cursor := Values.First; Last_Value : Natural := Natural'Last; Nb_Supp : Natural := Natural'First; Temp_Window : array (0 .. 2) of Natural := (others => Natural'First); Mod_Index : Modular_Index_Of_3 := Modular_Index_Of_3'First; begin Temp_Window (0) := Element (Curs); Next (Curs); Temp_Window (0) := Temp_Window (0) + Element (Curs); Temp_Window (1) := Element (Curs); Next (Curs); Temp_Window (0) := Temp_Window (0) + Element (Curs); Temp_Window (1) := Temp_Window (1) + Element (Curs); Temp_Window (2) := Element (Curs); Next (Curs); while Has_Element (Curs) loop if Temp_Window (Natural (Mod_Index)) > Last_Value then Nb_Supp := Nb_Supp + 1; end if; Last_Value := Temp_Window (Natural (Mod_Index)); Temp_Window (Natural (Mod_Index)) := 0; Temp_Window (0) := Temp_Window (0) + Element (Curs); Temp_Window (1) := Temp_Window (1) + Element (Curs); Temp_Window (2) := Temp_Window (2) + Element (Curs); Next (Curs); Mod_Index := Mod_Index + 1; end loop; if Temp_Window (Natural (Mod_Index)) > Last_Value then Nb_Supp := Nb_Supp + 1; end if; Put ("Result: "); Ada.Integer_Text_IO.Put (Item => Nb_Supp, Width => 0); New_Line; end Solve_Puzzle; Close_If_Open (File); exception when Occur : others => Put_Line ("Error: " & Ada.Exceptions.Exception_Message (Occur)); Close_If_Open (File); end Main;
programs/oeis/001/A001585.asm
neoneye/loda
22
243180
<filename>programs/oeis/001/A001585.asm ; A001585: a(n) = 3^n + n^3. ; 1,4,17,54,145,368,945,2530,7073,20412,60049,178478,533169,1596520,4785713,14352282,43050817,129145076,387426321,1162268326,3486792401,10460362464,31381070257,94143190994,282429550305,847288625068,2541865845905,7625597504670,22876792476913,68630377389272,205891132121649,617673396313738,1853020188884609,5559060566591460,16677181699705873,50031545099042582,150094635297045777,450283905891048016,1350851717673046961,4052555153019035586,12157665459056992801,36472996377170855324,109418989131512433297,328256967394537157134,984770902183611318065,2954312706550833789768,8862938119652501193265,26588814358957503391610,79766443076872509973953,239299329230617529707732,717897987691852588895249,2153693963075557766443398,6461081889226673299072849,19383245667680019896945600,58149737003040059690547633,174449211009120179071336882,523347633027360537213687137,1570042899082081611640719756,4710128697246244834921798801,14130386091738734504765016446,42391158275216203514294649201,127173474825648610542883526584,381520424476945831628650137137,1144561273430837494885949946474,3433683820292512484657849351425,10301051460877537453973547542468,30903154382632612361920642091025,92709463147897837085761925711350,278128389443693511257285776546193,834385168331080533771857329023792,2503155504993241601315571986428849,7509466514979724803946715958615458,22528399544939174411840147875145889,67585198634817523235520443624706940,202755595904452569706561330873358993,608266787713357709119683992619283182 mov $1,3 pow $1,$0 pow $0,3 add $1,$0 mov $0,$1
src/02/crypto.asm
Willem3141/kernel
251
244247
<gh_stars>100-1000 ;; sha1Init [Cryptography] ;; Allocates a memory block to keep the state and result of ;; a SHA1 hash operation. The result is kept in the first 20 bytes ;; of the allocated block. You must use [[sha1Clean]] to deallocate ;; the block; simply using [[free]] will result in a memory leak! ;; Outputs: ;; Z: Set on success, reset on failure ;; A: Error code (on failure) ;; IX: location of allocated block (on success) sha1Init: push bc push de push hl ld bc, sha1Memblock_size ld a, 1 call calloc jr nz, .fail push ix \ pop de ld bc, .defaultMemblock_copy_end - .defaultMemblock ld hl, .defaultMemblock ldir ; Possibly this could be improved push ix ld bc, 320 ; SHA1 block is this size ld a, 1 call calloc ; Store the pointers push ix \ pop hl pop ix ld (ix + sha1_block_ptr), l ld (ix + sha1_block_ptr + 1), h ld (ix + sha1_block_front_ptr), l ld (ix + sha1_block_front_ptr + 1), h .fail: pop hl pop de pop bc ret ; This is the default memblock. Its ; state will be changed by the algorithm. .defaultMemblock: ; Holds the completed hash. sha1_hash .equ $ - .defaultMemblock .db 0x67,0x45,0x23,0x01 .db 0xEF,0xCD,0xAB,0x89 .db 0x98,0xBA,0xDC,0xFE .db 0x10,0x32,0x54,0x76 .db 0xC3,0xD2,0xE1,0xF0 .defaultMemblock_copy_end: ; The length of the input is kept here sha1_length .equ $ - .defaultMemblock ; Keep these contiguous sha1_temp .equ sha1_length + 8 sha1_a .equ sha1_temp + 4 sha1_b .equ sha1_a + 4 sha1_c .equ sha1_b + 4 sha1_d .equ sha1_c + 4 sha1_e .equ sha1_d + 4 sha1_f .equ sha1_e + 4 sha1_k .equ sha1_f + 4 sha1_f_op_ptr .equ sha1_k + 4 ; Pointers to the SHA1 block are kept here sha1_block_ptr .equ sha1_f_op_ptr + 2 sha1_block_front_ptr .equ sha1_block_ptr + 2 sha1Memblock_size .equ sha1_block_front_ptr + 2 ;; sha1Clean [Cryptography] ;; Safely deallocates a SHA1 state block allocated by ;; sha1Init. ;; Inputs: ;; IX: location of allocated block sha1Clean: push hl push ix ld l, (ix + sha1_block_front_ptr) ld h, (ix + sha1_block_front_ptr + 1) call free push hl \ pop ix call free pop ix pop hl ret ;; sha1Pad [Cryptography] ;; Finishes the SHA1 computation by appending the ;; required bits to the input. Call this routine once after ;; calling [[sha1AddByte]] for each input byte. After this routine, ;; the 8 bytes pointed to by IX will contain the big-endian ;; SHA1 hash. ;; Inputs: ;; IX: location of SHA1 state block sha1Pad: push af push de push hl call sha1Pad_noPush jr sha1AddByte_pop sha1Pad_noPush: ; append the bit '1' to the message ; append 0 <= k < 512 bits '0', so that the resulting message length (in bits) ; is congruent to 448 = -64 (mod 512) ld a, $80 .zero: call sha1AddByte_noLength ld a, (ix + sha1_block_front_ptr) add a, 56 cp (ix + sha1_block_ptr) ld a, $00 jr nz, .zero ; append length of message (before padding), in bits, as 64-bit big-endian integer push ix \ pop hl ld de, sha1_length add hl, de ld e, (ix + sha1_block_ptr) ld d, (ix + sha1_block_ptr + 1) ld bc, 8 ldir jr sha1ProcessBlock ;; sha1AddByte [Cryptography] ;; Adds a single byte to the SHA1 hash input stream. ;; Call this function once for each byte in the input ;; stream, then call [[sha1Pad]]. ;; Inputs: ;; IX: location of SHA1 state block ;; A: Byte to add sha1AddByte: push af push de push hl call sha1AddByte_noPush sha1AddByte_pop: pop hl pop de pop af ret sha1AddByte_noPush: push af ld a, (ix + sha1_length + 7) add a, 8 ld (ix + sha1_length + 7), a jr nc, .length_ok push ix _: dec ix inc (ix + sha1_length + 7) jr z, -_ pop ix .length_ok: pop af sha1AddByte_noLength: ld e, (ix + sha1_block_ptr) ld d, (ix + sha1_block_ptr + 1) ld (de), a inc de ld (ix + sha1_block_ptr), e ld (ix + sha1_block_ptr + 1), d ld a, (ix + sha1_block_front_ptr) add a, 64 cp e ret nz sha1ProcessBlock: ; Extend the sixteen 32-bit words into eighty 32-bit words: ; for i from 16 to 79 ; w[i] = (w[i-3] xor w[i-8] xor w[i-14] xor w[i-16]) leftrotate 1 ld l, (ix + sha1_block_front_ptr) ld h, (ix + sha1_block_front_ptr + 1) ld bc, 63 add hl, bc push hl \ ex (sp), iy ld c, 64 .extend: ld b, 4 .extend_inner: inc iy ld a, (iy + -12) xor (iy + -32) xor (iy + -56) xor (iy + -64) ld (iy), a djnz .extend_inner push iy \ pop hl ld a, (iy + -3) rlca rl (hl) \ dec hl rl (hl) \ dec hl rl (hl) \ dec hl rl (hl) \ dec hl dec c jr nz, .extend ; Initialize hash value for this chunk: ; a = h0 ; b = h1 ; c = h2 ; d = h3 ; e = h4 push ix \ pop hl ; Unneeded because the sha1_hash offset is 0! ;ld de, sha1_hash ;add hl, de push hl ld de, sha1_a - sha1_hash add hl, de ex de, hl pop hl ld bc, 20 ldir ; Main loop ld l, (ix + sha1_block_front_ptr) ld h, (ix + sha1_block_front_ptr + 1) dec hl ld (ix + sha1_block_ptr), l ld (ix + sha1_block_ptr + 1), h ld hl, sha1Operation_mux \ call sha1Do20Rounds \ .db $5A,$82,$79,$99 ld hl, sha1Operation_xor \ call sha1Do20Rounds \ .db $6E,$D9,$EB,$A1 ld hl, sha1Operation_maj \ call sha1Do20Rounds \ .db $8F,$1B,$BC,$DC ld hl, sha1Operation_xor \ call sha1Do20Rounds \ .db $CA,$62,$C1,$D6 ; Add this chunk's hash to result so far ; h0 += a ; h1 += b ; h2 += c ; h3 += d ; h4 += e push bc ; Perhaps this could be improved. push ix \ pop de \ push de \ pop hl ld bc, 19 + sha1_hash add hl, bc ex de, hl ld bc, 19 + sha1_a add hl, bc pop bc ld c, 5 .add_result: call sha1_32BitAdd dec c jr nz, .add_result ld l, (ix + sha1_block_front_ptr) ld h, (ix + sha1_block_front_ptr + 1) ld (ix + sha1_block_ptr), l ld (ix + sha1_block_ptr + 1), h pop iy ret sha1Do20Rounds: ld (ix + sha1_f_op_ptr), l ld (ix + sha1_f_op_ptr + 1), h ld de, sha1_k push ix \ pop hl add hl, de ex de, hl pop hl ld bc, 4 ldir push hl ld b, 20 .rounds: push bc ; f = <some operation involving b, c, and d> call .do_f_operation ; temp = (a leftrotate 5) + f + e + k + w[i] ld bc, 4 push ix \ pop hl ld de, sha1_temp add hl, de push hl \ pop de add hl, bc ; HACK! This is the correct value to get HL to sha1_a ldir ld a, (ix + sha1_temp) rrca rrca rrca rrca push af ld de, sha1_temp + 3 push ix \ pop hl add hl, de pop af rld \ rl (hl) \ dec hl rld \ rl (hl) \ dec hl rld \ rl (hl) \ dec hl rld \ rl (hl) ld de, 3 + (sha1_k - sha1_temp) ; Undo the three DECs we just did (HL now ; at sha1_temp + 3), then add difference add hl, de ; to get to sha1_k + 3. call sha1AddToTemp ; k call sha1AddToTemp ; f call sha1AddToTemp ; e ld l, (ix + sha1_block_ptr) ld h, (ix + sha1_block_ptr + 1) inc hl inc hl inc hl inc hl ld (ix + sha1_block_ptr), l ld (ix + sha1_block_ptr + 1), h call sha1AddToTemp ; e = d ; d = c ; c = b leftrotate 30 ; b = a ; a = temp push ix \ pop hl ld bc, sha1_d + 3 add hl, bc push hl \ pop de inc de \ inc de \ inc de \ inc de ; sha1_e - sha1_d = 4 bytes ld bc, 20 lddr ld a, (ix + sha1_c + 3) ld b, 2 .ror2: push bc push ix \ pop hl ld bc, sha1_c add hl, bc pop bc rrca rr (hl) \ inc hl rr (hl) \ inc hl rr (hl) \ inc hl rr (hl) djnz .ror2 pop bc dec b jp nz, .rounds ret .do_f_operation: push ix ex (sp), iy ex de, hl ld de, sha1_a add iy, de ex de, hl ld l, (ix + sha1_f_op_ptr) ld h, (ix + sha1_f_op_ptr + 1) ld b, 4 jp (hl) sha1Operation_mux: ; f = (b & c) | (~b & d) = ((c ^ d) & 8) ^ d ld a, (iy + 8) ld c, (iy + 12) xor c and (iy + 4) xor c ld (iy + 20), a inc iy djnz sha1Operation_mux jr sha1Operation_done sha1Operation_xor: ; f = b ^ c ^ d ld a, (iy + 4) xor (iy + 8) xor (iy + 12) ld (iy + 20), a inc iy djnz sha1Operation_xor jr sha1Operation_done sha1Operation_maj: ; f = (b & c) | (b & d) | (c & d) ; = (b & c) | ((b | c) & d) ld c, (iy + 4) ld d, (iy + 8) ld a, c and d ld e, a ld a, c or d and (iy + 12) or e ld (iy + 20), a inc iy djnz sha1Operation_maj ;jr sha1Operation_done sha1Operation_done: pop iy ret sha1AddToTemp: ld de, sha1_temp+3 push ix ex (sp), hl add hl, de ex de, hl pop hl sha1_32BitAdd: ld b, 4 or a _: ld a, (de) adc a, (hl) ld (de), a dec de dec hl djnz -_ ret ;; sha1AddRange [Cryptography] ;; Adds a range of bytes to a SHA1 hash. This ;; routine is equivalent to, but faster than, calling ;; [[sha1AddByte]] many times. ;; Inputs: ;; IX: location of SHA1 state block ;; HL: location of range to add ;; BC: number of bytes to add sha1AddRange: push hl push de push bc push af _: ld a, (hl) push hl call sha1AddByte_noPush pop hl dec bc inc hl ld a, b \ or c \ jr nz, -_ pop af pop bc pop de pop hl ret
src/sound/alarm_musics/alarm_two/channel3.asm
Gegel85/RunnerGB
0
94090
musicChan3AlarmTwoTheme:: setRegisters $80, $00, $00, $AC, $85 .loop: stopMusic jump .loop
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/日本_Ver3/asm/zel_enmy2s.asm
prismotizm/gigaleak
0
247805
Name: zel_enmy2s.asm Type: file Size: 333952 Last-Modified: '2016-05-13T04:36:32Z' SHA-1: F058045D6197EA8A0FE8DCF4863D29E301351D59 Description: null
Append Note to Most recently updated task.applescript
dbyler/omnifocus-scripts
137
275
<reponame>dbyler/omnifocus-scripts<filename>Append Note to Most recently updated task.applescript (* # DESCRIPTION # Appends a note to the most recently modified task in OmniFocus. - By default, the clipboard contents are used for the note - If triggered from LaunchBar or Alfred, you can use different text See https://github.com/dbyler/omnifocus-scripts for updates # LICENSE # Copyright © 2015-2020 <NAME> (contact: <EMAIL>) Licensed under MIT License (http://www.opensource.org/licenses/mit-license.php) (TL;DR: no warranty, do whatever you want with it.) # CHANGE HISTORY # 2020-02-16 - Update notification message; finish purging Growl code 2019-07-16 - First release (based on Append note to Newest Task) Note to self: see comment on line 82. This may be brittle and require a different fix *) -- To change settings, modify the following properties property showSummaryNotification : true --if true, will display success notifications on main(q) if q is missing value then set q to (the clipboard) end if tell application "OmniFocus" tell front document set myTask to my getLastModifiedTask() if myTask is false then display notification "No recent items available" with title "Error" return end if tell myTask insert q & " " at before first paragraph of note end tell if showSummaryNotification then set alertTitle to "Note added to " & name of myTask set alertText to "\"" & q & "\"" display notification alertText with title alertTitle end if end tell end tell end main on getLastModifiedTask() tell application "OmniFocus" tell front document set allTasks to {} set maxAge to 8 repeat while length of allTasks is 0 and maxAge ≤ 524288 set maxAge to maxAge * 2 set earliestTime to (current date) - maxAge * 60 set allTasks to (every flattened task whose (modification date is greater than earliestTime ¬ and repetition is missing value)) end repeat if length of allTasks > 0 then set lastTask to first item of allTasks set lastTaskDate to modification date of lastTask repeat with i from 1 to length of allTasks if modification date of (item i of allTasks) ≥ lastTaskDate then --a task's root task, if present, will have the same modification date as the task, but seems to appear first in the list, so this should pull the task set lastTask to (item i of allTasks) set lastTaskDate to modification date of lastTask end if end repeat return lastTask else return false end if end tell end tell end getLastModifiedTask on notify(alertName, alertTitle, alertText) display notification alertText with title alertTitle end notify main(missing value) on alfred_script(q) main(q) end alfred_script on handle_string(q) main(q) end handle_string
compiler/core/antlr/DocComment.g4
dkBrazz/zserio
86
1788
grammar DocComment; /** Parser */ docComment : COMMENT_BEGIN whitespace? docContent whitespace? COMMENT_END ; docContent : docElement (whitespaceInLine? NEWLINE whitespaceInLine? docElement)*? ; docElement : docTag | docLine | // empty line ; docLine : docLineElement (whitespaceInLine? docLineElement)* ; docTag : seeTag | todoTag | paramTag | deprecatedTag ; docLineElement : seeTag | docText ; docText : SEE | TODO | PARAM | DEPRECATED | (ID | TEXT | BACKSLASH | ESC | DOUBLE_QUOTE_ESC | DOUBLE_QUOTE | DOT | STAR | AT) (whitespaceInLine? (ID | TEXT | BACKSLASH | ESC | DOUBLE_QUOTE_ESC | DOUBLE_QUOTE | DOT | STAR | AT))* ; seeTag : SEE whitespaceInParagraph (seeTagAlias whitespaceInParagraph)? seeTagId ; seeTagAlias : DOUBLE_QUOTE seeTagAliasText DOUBLE_QUOTE ; seeTagAliasText : ( SEE | TODO | PARAM | DEPRECATED | ID | TEXT | BACKSLASH | ESC | DOUBLE_QUOTE_ESC | DOT | STAR | AT | whitespaceInLine )+ ; seeTagId : ID (DOT ID)* ; todoTag : TODO (whitespaceInParagraph docLine)? ; paramTag : PARAM whitespaceInParagraph paramName (whitespaceInParagraph docLine)? ; paramName : ID ; deprecatedTag : DEPRECATED ; whitespace : ( SPACE | NEWLINE )+ ; whitespaceInParagraph : SPACE* NEWLINE SPACE* | SPACE+ ; whitespaceInLine : SPACE+ ; /** Lexer */ fragment NEWLINE_COMMENT : SPACE* (STAR { _input.LA(1) != '/' }?)+ ; COMMENT_BEGIN : '/**' (STAR { _input.LA(1) != '/' }?)*; COMMENT_END : STAR* '*/' ; NEWLINE : ('\r'? '\n' | '\r') NEWLINE_COMMENT? SPACE? ; SPACE : ' ' | '\t' ; DOT : '.' ; STAR : '*' ; BACKSLASH: '\\'; ESC : '\\\\'; DOUBLE_QUOTE_ESC : '\\"' ; DOUBLE_QUOTE : '"' ; AT : '@' ; SEE : AT 'see' ; TODO : AT 'todo' ; PARAM : AT 'param' ; DEPRECATED : AT 'deprecated' ; ID : [a-zA-Z_][a-zA-Z_0-9]* ; TEXT : ~[ .\t\r\n"*\\@a-zA-Z_]+;
Resources/All Scripts/Bundled Scripts/Scripts/banhammer.scpt
bathtub/IRC.app
2
2307
<reponame>bathtub/IRC.app -- Portions of this AppleScript may incorporate work from 3rd -- parties. These portions of code are noted. All other work is -- Copyright © 2010 — 2013 Codeux Software. See README -- for full license information. on irccmd(user, destinationChannel) if destinationChannel is equal to "" then return "/debug Invalid destination channel." end if set user to trim(user) if user is equal to "" then return "/sme " & destinationChannel & " is getting out the ban hammer! ▬▬▬▬▬▬▬▋ Ò╭╮Ó" else return "You better run " & user & "! /sme " & destinationChannel & " is getting out the ban hammer! ▬▬▬▬▬▬▬▋ Ò╭╮Ó" end if end irccmd -- trim() AppleScript function from: -- <http://macscripter.net/viewtopic.php?id=18519> on trim(someText) repeat until someText does not start with " " set someText to text 2 thru -1 of someText end repeat repeat until someText does not end with " " set someText to text 1 thru -2 of someText end repeat return someText end trim
programs/oeis/098/A098201.asm
neoneye/loda
22
15937
; A098201: Number of distinct terms in iteration-list when cototient-function[=A051953] is iterated and the initial value is odd number. ; 2,3,3,3,4,3,3,4,3,3,5,3,4,5,3,3,4,4,3,5,3,3,6,3,4,4,3,5,6,3,3,6,4,3,5,3,3,5,4,3,6,3,6,4,3,4,5,4,3,6,3,3,7,3,3,6,3,6,7,4,4,4,5,3,7,3,5,7,3,3,5,4,5,7,3,3,7,5,3,6,4,3,7,3,4,7,3,6,4,3,3,7,4,6,7,3,3,7,3,3 mul $0,2 lpb $0 mov $2,$0 seq $2,10 ; Euler totient function phi(n): count numbers <= n and prime to n. sub $0,$2 add $1,1 lpe add $1,2 mov $0,$1
pkgs/tools/yasm/src/modules/parsers/nasm/tests/equcolon.asm
manggoguy/parsec-modified
2,151
166772
equval: equ 5 equval2 equ 7 db equval, equval2
programs/oeis/225/A225015.asm
neoneye/loda
22
28055
; A225015: Number of sawtooth patterns of length 1 in all Dyck paths of semilength n. ; 0,1,1,5,18,66,245,918,3465,13156,50193,192270,739024,2848860,11009778,42642460,165480975,643281480,2504501625,9764299710,38115568260,148955040300,582714871830,2281745337300,8942420595810,35074414899576,137672461877850,540756483094828,2125365141206160,8358412361834136,32889369583269892,129483228312539640,510016007998464891,2009804252693172880,7923404374075317897,31249811650098978846,123296513059375832540,486645880799307748428,1921436030149422857070,7588952068074067758116,29982899821815686892510,118493589125659200360600,468424266623821911725630,1852258346724382507102500,7326154848924615666533760,28983981804603732232409160,114694556124318588890898300,453968831374302681626966280,1797230091309008778328274550,7116589685796714668217918960,28185593520734389218886621578,111651889017298461132553937100,442369741469012232314177872584,1753001108613548775423406930680,6947900111219443602958127895708,27542087302815613182935867347656,109196696159253758369395654687620,433001197224359844250570310528688,1717249335279745453222142858254740,6811458329615564339166013897567896,27021364291056150127096163563615968,107209407729594512133125670043347120,425417259893857855981658501440882824 mov $4,2 mov $10,$0 lpb $4 mov $0,$10 sub $4,1 add $0,$4 sub $0,1 mov $6,$0 mov $7,0 mov $8,2 lpb $8 sub $8,1 add $0,$8 sub $0,1 mov $2,$0 add $2,$0 bin $2,$0 div $2,2 mov $5,$2 mov $9,$8 mul $9,$2 add $7,$9 lpe mov $3,$4 min $6,1 mul $6,$5 mov $5,$7 sub $5,$6 mul $3,$5 add $1,$3 lpe min $10,1 mul $10,$5 sub $1,$10 mov $0,$1
programs/oeis/001/A001752.asm
jmorken/loda
1
10291
<reponame>jmorken/loda ; A001752: Expansion of 1/((1+x)*(1-x)^5). ; 1,4,11,24,46,80,130,200,295,420,581,784,1036,1344,1716,2160,2685,3300,4015,4840,5786,6864,8086,9464,11011,12740,14665,16800,19160,21760,24616,27744,31161,34884,38931,43320,48070,53200,58730,64680,71071,77924,85261,93104,101476,110400,119900,130000,140725,152100,164151,176904,190386,204624,219646,235480,252155,269700,288145,307520,327856,349184,371536,394944,419441,445060,471835,499800,528990,559440,591186,624264,658711,694564,731861,770640,810940,852800,896260,941360,988141,1036644,1086911,1138984,1192906,1248720,1306470,1366200,1427955,1491780,1557721,1625824,1696136,1768704,1843576,1920800,2000425,2082500,2167075,2254200,2343926,2436304,2531386,2629224,2729871,2833380,2939805,3049200,3161620,3277120,3395756,3517584,3642661,3771044,3902791,4037960,4176610,4318800,4464590,4614040,4767211,4924164,5084961,5249664,5418336,5591040,5767840,5948800,6133985,6323460,6517291,6715544,6918286,7125584,7337506,7554120,7775495,8001700,8232805,8468880,8709996,8956224,9207636,9464304,9726301,9993700,10266575,10545000,10829050,11118800,11414326,11715704,12023011,12336324,12655721,12981280,13313080,13651200,13995720,14346720,14704281,15068484,15439411,15817144,16201766,16593360,16992010,17397800,17810815,18231140,18658861,19094064,19536836,19987264,20445436,20911440,21385365,21867300,22357335,22855560,23362066,23876944,24400286,24932184,25472731,26022020,26580145,27147200,27723280,28308480,28902896,29506624,30119761,30742404,31374651,32016600,32668350,33330000,34001650,34683400,35375351,36077604,36790261,37513424,38247196,38991680,39746980,40513200,41290445,42078820,42878431,43689384,44511786,45345744,46191366,47048760,47918035,48799300,49692665,50598240,51516136,52446464,53389336,54344864,55313161,56294340,57288515,58295800,59316310,60350160,61397466,62458344,63532911,64621284,65723581,66839920,67970420,69115200,70274380,71448080,72636421,73839524,75057511,76290504,77538626,78802000,80080750,81375000,82684875,84010500 add $0,3 pow $0,2 lpb $0 sub $0,4 add $1,$0 lpe div $1,6
oeis/304/A304973.asm
neoneye/loda-programs
11
13229
<reponame>neoneye/loda-programs<filename>oeis/304/A304973.asm ; A304973: Number of achiral color patterns (set partitions) for a row or loop of length n using exactly 3 colors (sets). ; Submitted by <NAME> ; 0,0,0,1,2,5,10,19,38,65,130,211,422,665,1330,2059,4118,6305,12610,19171,38342,58025,116050,175099,350198,527345,1054690,1586131,3172262,4766585,9533170,14316139,28632278,42981185,85962370,129009091,258018182,387158345,774316690,1161737179,2323474358 mov $2,$0 mov $4,$0 lpb $2 mov $0,$4 sub $0,1 div $0,2 sub $2,3 mod $2,2 mov $3,$0 seq $3,210448 ; Total number of different letters summed over all ternary words of length n. add $1,$3 lpe mov $0,$1 div $0,3
ANTLR/FSMB.g4
ctataryn/fsmb-parser-generators
0
2023
<gh_stars>0 // Define a grammar called FSMB grammar FSMB; s : NP VP ; // for "reasons" at least one rule must be lower case, otherwise an error NP : DET (ADJ)* N ; VP : (V NP) | V PP ; PP : P NP ; DET : ('the' | 'a' | 'an') WHITESPACE*; N : ('dog' | 'fox') WHITESPACE*; ADJ : ('quick' | 'brown' | 'lazy') WHITESPACE*; V : ('jumped' | 'runs') WHITESPACE*; P : ('over' | 'onto' | 'in' | 'under') WHITESPACE*; WHITESPACE : (' ' | '\n')+ -> channel(HIDDEN);
parser/FSMLexer.g4
FSMSIM/FSMSIM
0
101
lexer grammar FSMLexer; SEMICOLON: ';'; COLON: ':' ; LEFTBRACKET: '('; RIGHTBRACKET: ')'; LEFTCURLY: '{'; RIGHTCURLY: '}'; LEFTANGLE: '['; RIGHTANGLE: ']'; DOLLAR: '$'; DEL: 'del'; EQ: '=='; NEQ: '!='; AND: '&&'; OR: '||'; NOT: '!'; DOT: '.'; COMMA: ','; LEFTARROW: '<-'; RIGHTARROW: '->'; ASSIGN: '='; PLUS: '+'; MINUS: '-'; TIMES: '*'; TRUE: 'true'; FALSE: 'false'; IMPORT: 'import'; MODULE: 'module'; INPUT: 'input'; OUTPUT: 'output'; STATE: 'state'; INITIAL: 'initial'; FOR: 'for'; IN: 'in'; INT : POSINT // | NEGINT ; fragment POSINT : DIGIT+ ; fragment NEGINT : ('-')DIGIT+ ; STRING : '"' DoubleStringCharacter* '"' | '\'' SingleStringCharacter* '\'' ; fragment DoubleStringCharacter : ~["\r\n] ; fragment SingleStringCharacter : ~['\r\n] ; fragment DIGIT : [0-9] ; ID : LETTER ( ID_LETTER | DIGIT )* ; fragment LETTER : [a-zA-Z] ; fragment ID_LETTER : [a-zA-Z_] ; // Whitespace and comments NEWLINE : [\r\n]+ -> skip ; WS : [ \t\r\n\u000C]+ -> skip ; COMMENT : '/*' .*? '*/' -> skip ; LINE_COMMENT : '//' .*? '\r'? '\n' -> skip ;
libsrc/target/zx81/chroma81/zx_aaddrcright.asm
jpoikela/z88dk
640
17746
; uchar __FASTCALL__ *zx_aaddrcright(void *attraddr) ; Stefano, 2014.12 SECTION code_clib PUBLIC zx_aaddrcright PUBLIC _zx_aaddrcright EXTERN HRG_LineStart .zx_aaddrcright ._zx_aaddrcright ; hl = valid attribute address ; hl = new attribute address right one character with line wrap ; TODO: carry if off screen inc hl ; ld a,$5a ; cp h ret
source/tests/regions-tests.ads
reznikmm/declarative-regions
0
22531
with Regions; with Regions.Symbols; package Regions.Tests is procedure Test_Standard; -- Create an empty Standard package and put into an empty environment. -- Find a region with Standard symbol. procedure Symbol_Exists (Region : Regions.Region'Class; Symbol : Regions.Symbols.Symbol; Expect : Boolean); -- Check if Region contains the Symbol. end Regions.Tests;
programs/oeis/251/A251914.asm
neoneye/loda
22
85593
<reponame>neoneye/loda ; A251914: Numbers n such that the sum of the triangular numbers T(n) and T(n+1) is equal to the pentagonal number P(m) for some m. ; 0,98,9700,950598,93149000,9127651498,894416697900,87643708742798,8588189040096400,841554882220704498,82463790268588944500,8080609891439495856598,791817305570802005002200,77590015336047156994359098,7603029685627050583442189500,745019319176114910020340211998,73004290249573634131409898586400,7153675425139040029968149721255298,700987187373376349302747262784432900 mul $0,2 add $0,1 seq $0,1078 ; a(n) = 10*a(n-1) - a(n-2) with a(0) = 0, a(1) = 2. sub $0,2 div $0,2
Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca_notsx.log_13_1251.asm
ljhsiun2/medusa
9
243686
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r11 push %r14 push %r8 push %r9 push %rax push %rbp push %rdx // Store lea addresses_UC+0xbc35, %r8 clflush (%r8) cmp %rbp, %rbp mov $0x5152535455565758, %r11 movq %r11, %xmm7 movups %xmm7, (%r8) nop nop add $17016, %r9 // Faulty Load lea addresses_US+0x1c7c, %rbp nop nop nop nop cmp $55669, %rdx mov (%rbp), %r9w lea oracles, %r11 and $0xff, %r9 shlq $12, %r9 mov (%r11,%r9,1), %r9 pop %rdx pop %rbp pop %rax pop %r9 pop %r8 pop %r14 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'00': 13} 00 00 00 00 00 00 00 00 00 00 00 00 00 */
oeis/276/A276658.asm
neoneye/loda-programs
11
178062
; A276658: Tribonacci-like sequence a(n) = a(n-1) + a(n-2) + a(n-3) for n >= 3, with a(0) = 1, a(1) = 2, a(2) = 0. ; Submitted by <NAME>(s2) ; 1,2,0,3,5,8,16,29,53,98,180,331,609,1120,2060,3789,6969,12818,23576,43363,79757,146696,269816,496269,912781,1678866,3087916,5679563,10446345,19213824,35339732,64999901,119553457,219893090 mov $3,1 mov $4,2 lpb $0 sub $0,1 mov $1,$4 add $3,$4 mov $4,$2 add $2,$3 mov $3,$1 lpe mov $0,$3
dslib.asm
denglend/calcsys
3
24763
HomeTextMenu: ;HL -> Menu Structure ;Displays menu and waits for option to be chosen ;Jumps to appropriate address push hl B_CALL ClrLCDFull B_CALL HomeUp pop hl ld b,(hl) inc hl push hl ld e,b sla e ld d,0 add hl,de ;HL -> to text strings inc b ;Number of Text Strings to display push bc call DispHomeText pop bc dec b pop hl HomeTextMenuLoop: push hl push bc call IGetKey pop bc pop hl IFDEF CALCSYS cp kClear jr nz,HomeTextNotClear ld a,b add a,k0 HomeTextNotClear: ENDIF sub k1 cp b jr nc,HomeTextMenuLoop add a,a ld e,a ld d,0 add hl,de B_CALL LdHLInd jp (hl) DispHomeText: ;displays B number of texts on homescreen ld c,b DispHomeTextLoop: ld a,c sub b ld d,0 ld e,a ld (curRow),de call PutSApp djnz DispHomeTextLoop ret GetHexHL: call GetHexA push af call GetHexA ld l,a pop af ld h,a ret GetHexA: ; lets user input an 8 bit number in hexadecimal ; prompt is at currow,curcol ; number is returned in a ; requires two bytes at GetHexATemp set curAble,(iy+curFlags) ld a,' ' ld (curUnder),a ld b,2 ld hl,GetHexATemp GetHexALoop: push bc push hl call IGetKey pop hl pop bc cp 2 jr nz,GetHexANotBack ld a,b cp 2 jr z,GetHexANotBack ld a,' ' B_CALL PutMap ld hl,curCol dec (hl) jr GetHexA GetHexANotBack: sub 142 cp 10 jr c,GetHexANum sub 12 cp 6 jr c,GetHexALet jr GetHexALoop GetHexANum: ld (hl),a inc hl add a,48 B_CALL PutC djnz GetHexALoop jr GetHexADone GetHexALet: add a,10 ld (hl),a inc hl add a,55 B_CALL PutC djnz GetHexALoop GetHexADone: dec hl ld b,(hl) dec hl ld a,(hl) rlca rlca rlca rlca or b res curAble,(iy+curFlags) ret DispHomeTextC: ;Clears screen, and loads B from structure push hl B_CALL ClrLCDFull B_CALL HomeUp pop hl ld b,(hl) inc hl DispHexHL: ld a,h call DispHexA ld a,l DispHexA: push hl push bc call HexToASCII ld a,h B_CALL PutC ld a,l B_CALL PutC pop bc pop hl ret HexToASCII: push af rrca rrca rrca rrca call HTAConv ld h,a pop af call HTAConv ld l,a ret HTAConv: and 15 cp 10 jr nc,HTAConvLet add a,48 ret HTAConvLet: add a,55 ret PutSApp: ;display a string of large text ld a,(hl) inc hl or a ret z B_CALL PutC jr PutSApp RandNum: push hl push de ld hl,(0FFFFh-370) ld a,r ld d,a ld e,(hl) add hl,de add a,l xor h ld (0FFFFh-370),hl ld hl,0 ld e,a ld d,h RandNumLoop: add hl,de djnz RandNumLoop ld a,h pop de pop hl ret FindIndexText: ;Finds string A in list HL or a ret z push bc push de ld d,a xor a FindIndexTextLoop: ld b,h cpir dec d jr nz,FindIndexTextLoop pop de pop bc ret DispBinA: ld b,8 ld c,a DispBinALoop: rl c ld a,'0' adc a,0 B_CALL PutC djnz DispBinALoop ret ;------------------------------------------------------------------ ;------------------------------------------------------------------ ;------------------------------------------------------------------ ; String Input ;------------------------------------------------------------------ ;------------------------------------------------------------------ ;------------------------------------------------------------------ StringInput: ;Input ;hl -> where to save input ;b = max characters ;currow,curcol = cursor location ;Output ;hl is preserved ;bc = number of characters inputted push hl ld de,(curRow) push de set curAble,(IY+curFlags) ld c,b ;c = backup of max chars ld d,0 ;d = how many chars after current cursor location ; last inpuuted char is ld (hl),d ld a,Lspace ld (curUnder),a ;curUnder is the character that is shown during ;cursor blink B_CALL PutMap siLoop: push hl push de push bc call IGetKey pop bc pop de pop hl cp kDel jr z,siDel cp kClear jr z,siClear cp kEnter jp z,siEnter cp kLeft jp z,siLeft cp kRight jp z,siRight cp kDown jp z,siDown cp kUp jp z,siUp cp kSpace jp z,siSpace cp kComma jp z,siComma sub k0 cp 10 jp c,siNumber sub kCapA-k0 cp 26 jp c,siLetter jr nz,siLoop ld a,'X'-'A' jp siLetter siDel: ;delete a character inc d dec d ;are we at the end of the string? jr z,siLoop push de push bc push hl ld b,d ld de,(curRow) push de ld d,h ld e,l inc de dec b ;are we deleting the last character? ld c,Lspace jr z,siDelLoopSkip ;if so, we want to have curUnder=Lspace ;and we don't need to display shifted ;characters ; ld c,(hl) ;else, we want curUnder=next character ld a,(de) ld c,a ;err, actually, don't we want this? siDelLoop: ;This loop displays all the remaining ;characters after the one we're deleting, ;but shifted back one position ld a,(de) B_CALL PutC ld (hl),a inc hl inc de djnz siDelLoop siDelLoopSkip: ld (hl),0 ;needs to be zero terminated, right? ld a,Lspace B_CALL PutC ld a,c ld (curUnder),a pop de ld (curRow),de pop hl pop bc pop de dec d jp siLoop siClear: ;clear all characters ld a,c sub b add a,d or a ;nothing to clear? jp z,siLoop ld e,d ld d,0 add hl,de ld (hl),0 ;zero terminate current text pop de ld (curRow),de ;restore original cursor location pop hl push bc B_CALL StrLength ;get length of string inc c ;need to erase cursor too push hl push de siClearLoop: ;clear all previously entered text ld a,Lspace B_CALL PutC dec c jr nz,siClearLoop pop de ld (curRow),de pop hl pop bc ld b,c ;restore backup of max # of chars jp StringInput siEnter: ld a,(curUnder) B_CALL PutMap ;Display character under cursor, so we ;don't get a black box ; ld e,d ; ld d,0 ; add hl,de ;wait...what was this for? ld hl,curRow dec d inc d jr z,siEnterLoopSkip siEnterLoop: ;Updates cursor position to end ld a,(curCol) inc a and 15 ld (curCol),a or a jr nz,siEnterLoopCont inc (hl) siEnterLoopCont: dec d jr nz,siEnterLoop siEnterLoopSkip: pop de ; ld (curRow),de ;restore original cursor location pop hl B_CALL StrLength ;find string length inc bc ;add one for zero terminator res curAble,(IY+curFlags) ;turn of cursor ret siNumber: add a,L0 jr siLetCont siLetter: add a,LcapA siLetCont: dec b inc b ;Have we displayed the maximum # of ;characters? jp z,siLoop ld (hl),a B_CALL PutC inc hl ld a,d dec d dec b or a ld a,(hl) ld (curUnder),a ;reset curUnder to next character jp nz,siLoop inc d ld a,Lspace ld (curUnder),a ld (hl),0 jp siLoop siSpace: ld a,' ' jr siLetCont siComma: ld a,',' jr siLetCont siLeft: ;move left ld a,b cp c ;are we all the way to the left? jp z,siLoop inc b ld a,d inc d ;we've moved farther away from the end call siLDAHL B_CALL PutMap dec hl ld a,(hl) ld (curUnder),a ld a,(curCol) dec a ;cursor location one to the left ld (curCol),a jp p,siLoop ;jumps if there was no overflow ld a,15 ld (curCol),a ld a,(curRow) dec a ld (curRow),a jp siLoop siUp: ;move up ld a,b add a,15 cp c ;have we typed more than 15 characters? jp nc,siLoop ;if not, we can't move up ld b,a inc b ld a,d add a,16 ld d,a call siLDAHL B_CALL PutMap push de ld de,16 sbc hl,de ;text pointer up a row (row=16 bytes) pop de ld a,(curRow) dec a ;move cursor up a row ld (curRow),a ld a,(hl) ld (curUnder),a jp siLoop siLDAHL: ;loads a character from (hl) and ;converts it to Lspace if it is 0 ld a,(hl) or a ret nz ld a,Lspace ret siDown: ;move down ld e,16 ld a,d sub e ;are there are least 16 after cursor? jp c,siLoop ;if not, we can't move down ld d,a ld a,b sub e ld b,a ld a,(hl) B_CALL PutMap push de ld d,0 add hl,de pop de call siLDAHL ld (curUnder),a ld a,(curRow) inc a ld (curRow),a jp siLoop siRight: ;move right ld a,d or a ;are there any more chars after cursor? jp z,siLoop dec b ld a,(hl) B_CALL PutMap inc hl dec d call siLDAHL ld (curUnder),a ld a,(curCol) inc a ;move cursor over ld (curCol),a cp 16 ;did we scroll jp nz,siLoop xor a ld (curCol),a ld a,(curRow) inc a ld (curRow),a jp siLoop ASCIIToHex: ;Converts two ASCII bytes @ HL to a number in A ;CA = 0 = invalid digit ;If valid digit, HL=HL+2 ld a,(hl) call IsHexDigit ret nc rrca rrca rrca rrca ld b,a inc hl ld a,(hl) inc hl call IsHexDigit ret nc or b scf ret IsHexDigit: ;Checks if A is a ASCII nibble ;CA = 1 = Yes, value in lower 4 bits of A ;CA = 0 = NO sub '0' cp 10 jr c,IsHexDigitNum sub 'A'-'0' cp 6 ret nc add a,10 IsHexDigitNum scf ret DispBlank: push af ld a,' ' B_CALL PutC pop af ret GetByteTIOS: ;receives a byte in tios protocol through the link port ;input ;(none) ;output ;nz=error, can't recieve ;a=byte AppOnErr RetNZ IFDEF TI83P B_CALL RecAByteIO ELSE IFDEF TI73 ld a,22 ld (asm_Ind_Call),a B_CALL Exec_IO ENDIF IFNDEF TI73 call TIOSModLinkGet ERROR "Other Link Routines" ENDIF ENDIF ld (RecByteBuffer),a AppOffErr ld a,(RecByteBuffer) cp a ret RetNZ: xor a inc a ret DelayS: xor a out (1),a in a,(1) inc a ret nz DelayB: ;delay routine ;input ;b=delay amount ;output ;delays for a bit ei DelayL: halt djnz DelayL ret ScrollingCredits: ;hl -> list of credits, 0hFF terminated ;requires 121 byte ScrollingCBuf push hl B_CALL ClrLCDFull B_CALL GrBufClr pop hl ei set textWrite,(iy+sGrFlags) ScrollingCLoop: ld a,8 ld (ScrollingCBuf),a push hl ld a,56 call CenterText ScrollingCLoop2: call ScrollingCDispS ld b,15 call DelayS ld a,(ScrollingCBuf) dec a ld (ScrollingCBuf),a jr nz,ScrollingCLoop2 pop hl call NextString ld a,(hl) inc a jr nz,ScrollingCLoop ld b,200 res textWrite,(iy+sGrFlags) jp DelayS ScrollingCDispS: ld b,54 ld hl,plotSScreen B_CALL RestoreDisp ei ld hl,plotSScreen+648 ld bc,120 ld de,ScrollingCBuf+1 push bc push hl push de ldir ld bc,108 ld hl,plotSScreen+660 B_CALL MemClear ; ld b,0 BC = 0 after MemClear ScrollingCDispSL: push bc ld a,b ld e,54 call GetPixel ld d,a and (hl) pop bc jr z,ScrollingCDispSS push bc ld c,d ld b,9 ld de, 12 ScrollingCDispSBL: ld a, (hl) or c ld (hl), a add hl, de DJNZ ScrollingCDispSBL pop bc ScrollingCDispSS: inc b ld a,b cp 96 jr nz,ScrollingCDispSL B_CALL GrBufCpy ld b,10 call DelayS pop hl pop de pop bc ldir ld hl,plotSScreen+12 ld de,plotSScreen ld bc,756 ldir ret CenterText: ;hl=string ;a=penrow to disp at ;Needs buffer, CenterTextBuf ld (penRow),a ld de,CenterTextBuf+1 push de B_CALL StrCopy pop hl B_CALL StrLength dec hl ld (hl),c B_CALL SStringLength sra b ld a,48 sub b ld (penCol),a inc hl jp VPutSApp NextString: push af push bc xor a ld b,h cpir pop bc pop af ret ; input: e=y coordinate ; a=x coordinate ; output: a holds data for pixel (e.g. %00100000) ; hl->byte where pixel is on the gbuf GetPixel: ld d,00 ld h,d ld l,e add hl,de add hl,de add hl,hl add hl,hl ld de,plotSScreen add hl,de ld b,00 ld c,a and 00000111b srl c srl c srl c add hl,bc ld b,a inc b ld a,00000001b getPixelLoop: rrca djnz getPixelLoop ret VPutSApp: ;display text in small font ld a,(hl) inc hl inc a dec a ;use inc and dec to preserve carry ret z push hl push de B_CALL VPutMap pop de pop hl jr VPutSApp SendByteTIOS: ;sends a byte in tios protocol through link port ;input ;a=byte ;output ;nz=error, can't send AppOnErr RetNZ IFDEF TI83P B_CALL SendAByte ELSE IFDEF TI73 ld a,11 ld (asm_Ind_Call),a B_CALL Exec_IO ENDIF IFNDEF TI73 ERROR "SendByteBlahBlah" call TIOSModLinkSend ENDIF ENDIF AppOffErr cp a ret linkwait EQU 6000h TIOSModLinkGet: in a,(2) and 80h jr nz,TIOSModLinkGetSE in a,(0) and d0d1_bits cp d0d1_bits jp z,noio TIOSModLinkGetSE: jp GetByteTIOS TIOSModLinkSend: ld b,a in a,(2) and 80h ld a,b jp nz,SendByteTIOS di push af ld a,d0hd1h out (0),a pop af set indicOnly,(iy+indicFlags) AppOnErr linkfail call sendit endexio: res indicOnly,(iy+indicFlags) ld (iodata),a AppOffErr ld a,d0hd1h out (0),a ld a,(iodata) cp a ei ret linkfail: ld a,d0hd1h out (0),a noio: ei or 1 ret sendit: ld c,a ld b,8 l41e4: ld de,linkwait rr c jr nc,l41f0 ld a,2 jp l41f2 l41f0: ld a,1 l41f2: out (0),a l41f4: in a,(0) and 3 jp z,l420b in a,(0) and 3 jp z,l420b dec de ld a,d or e jp nz,l41f4 l4208 B_CALL ErrLinkXmit l420b: ld a,0 out (0),a ld de,linkwait l4212: dec de ld a,d or e jr z,l4208 in a,(0) and 3 cp 3 jp nz,l4212 djnz l41e4 ret
libsrc/rex/graphics/DsClearScreen.asm
meesokim/z88dk
0
8870
<gh_stars>0 ; ; written by <NAME>, adapting code from <NAME> ; ; $Id: DsClearScreen.asm,v 1.4 2015/01/19 01:33:06 pauloscustodio Exp $ ; PUBLIC DsClearScreen .DsClearScreen ; in a,(3) ; ld l,a ; in a,(4) ; ld h,a ; push hl ld a,$10 out (4),a xor a out (3),a ld de,$A001 ld h,d ld l,a ld bc,30*120-1 ld (hl),a ldir ; pop hl ; ld a,l ; out (3),a ; ld a,h ; out (4),a ret
src/common/bitmap.asm
endstation/golf
0
24955
<gh_stars>0 ; Top-hole Golf ; Copyright 2020-2021 <NAME> ; ***************** ; *** CONSTANTS *** ; ***************** ; ***************** ; *** VARIABLES *** ; ***************** ; ******************* ; ****** MACROS ***** ; ******************* ; ******************* ; *** SUBROUTINES *** ; ******************* ; INPUTS: P0-P1 = bitmap data. !zone { .BMAP_SRC_LO = P0 ; bitmap .BMAP_SRC_HI = P1 .VRAM_SRC_LO = P2 ; video RAM .VRAM_SRC_HI = P3 .CRAM_SRC_LO = P4 ; color RAM .CRAM_SRC_HI = P5 .BMAP_DST_LO = MATHS0 .BMAP_DST_HI = MATHS1 .VRAM_DST_LO = MATHS2 .VRAM_DST_HI = MATHS3 .CRAM_DST_LO = MATHS4 .CRAM_DST_HI = MATHS5 bmap_s_draw_multicolor ; NOTE: assume multicolor bitmap mode has already been set! ; Initialize pointers for video & color RAM. lda .BMAP_SRC_LO clc adc #<8000 sta .VRAM_SRC_LO lda .BMAP_SRC_HI adc #>8000 sta .VRAM_SRC_HI lda .VRAM_SRC_LO clc adc #<1000 sta .CRAM_SRC_LO lda .VRAM_SRC_HI adc #>1000 sta .CRAM_SRC_HI ; Destination pointers. lda #<gfxs_c_BITMAP_BASE sta .BMAP_DST_LO lda #>gfxs_c_BITMAP_BASE sta .BMAP_DST_HI lda #<gfxs_c_DISPLAY_BASE sta .VRAM_DST_LO lda #>gfxs_c_DISPLAY_BASE sta .VRAM_DST_HI lda #<COLOR_RAM sta .CRAM_DST_LO lda #>COLOR_RAM sta .CRAM_DST_HI ; Copy bitmap data. ; 32 * 250 bytes. ldx #32 .loop1 ldy #0 - lda (.BMAP_SRC_LO),y sta (.BMAP_DST_LO),y iny cpy #250 bne - dex beq .colors ; Advance pointers. lda .BMAP_SRC_LO clc adc #250 sta .BMAP_SRC_LO bcc + inc .BMAP_SRC_HI + lda .BMAP_DST_LO clc adc #250 sta .BMAP_DST_LO bcc .loop1 inc .BMAP_DST_HI bne .loop1 .colors ; Copy 4 * 250 bytes. ldx #4 .loop2 ldy #0 - lda (.VRAM_SRC_LO),y sta (.VRAM_DST_LO),y lda (.CRAM_SRC_LO),y sta (.CRAM_DST_LO),y iny cpy #250 bne - dex beq .bg ; Advance pointers. lda .VRAM_SRC_LO clc adc #250 sta .VRAM_SRC_LO bcc + inc .VRAM_SRC_HI + lda .CRAM_SRC_LO clc adc #250 sta .CRAM_SRC_LO bcc + inc .CRAM_SRC_HI + lda .VRAM_DST_LO clc adc #250 sta .VRAM_DST_LO bcc + inc .VRAM_DST_HI + lda .CRAM_DST_LO clc adc #250 sta .CRAM_DST_LO bcc .loop2 inc .CRAM_DST_HI bne .loop2 .bg lda (.CRAM_SRC_LO),y sta BGCOL0 rts ; end sub bmap_s_draw_multicolor } ; !zone ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; ************************************************** ; **************************************************
Transynther/x86/_processed/NONE/_zr_xt_/i3-7100_9_0xca_notsx.log_21829_1562.asm
ljhsiun2/medusa
9
163674
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r13 push %r15 push %r8 push %rax push %rbp push %rbx push %rcx push %rdi push %rsi // Load lea addresses_normal+0x1c100, %rsi nop nop cmp $49380, %rbp movups (%rsi), %xmm0 vpextrq $1, %xmm0, %r13 nop nop sub %rbx, %rbx // Store lea addresses_UC+0x29ca, %rax inc %r8 mov $0x5152535455565758, %rbp movq %rbp, (%rax) nop nop nop nop dec %rax // Store lea addresses_normal+0x1aec8, %r13 nop nop nop inc %r15 mov $0x5152535455565758, %r8 movq %r8, %xmm5 movups %xmm5, (%r13) nop sub $4155, %rbx // REPMOV lea addresses_WC+0x9200, %rsi lea addresses_D+0x16291, %rdi nop nop nop nop nop cmp %r13, %r13 mov $115, %rcx rep movsw add $12007, %rcx // Faulty Load lea addresses_A+0x16900, %r8 nop add $54302, %rsi movups (%r8), %xmm2 vpextrq $1, %xmm2, %rdi lea oracles, %r13 and $0xff, %rdi shlq $12, %rdi mov (%r13,%rdi,1), %rdi pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %rax pop %r8 pop %r15 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_normal', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_UC', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_normal', 'size': 16, 'AVXalign': False}} {'src': {'type': 'addresses_WC', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D', 'congruent': 0, 'same': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_A', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'35': 21828, '00': 1} 00 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 */
oeis/209/A209983.asm
neoneye/loda-programs
11
12660
<reponame>neoneye/loda-programs<gh_stars>10-100 ; A209983: (A209982)/2. ; Submitted by <NAME> ; 0,10,26,58,90,154,186,282,346,442,506,666,730,922,1018,1146,1274,1530,1626,1914,2042,2234,2394,2746,2874,3194,3386,3674,3866,4314,4442,4922,5178,5498,5754,6138,6330,6906,7194,7578,7834 mov $2,3 lpb $0 sub $0,1 mov $2,$0 mov $0,0 max $2,0 seq $2,137243 ; Number of coprime pairs (a,b) with -n <= a,b <= n. lpe mov $0,$2 sub $0,3 mul $0,2
ch01/boot.asm
ZhiqinYang/orangos
1
25859
<reponame>ZhiqinYang/orangos ; nasm boot.asm -o boot.bin ; dd if=boot.bin of=boot.img bs=512 conv=notrunc org 07c00h mov ax, cs ;使 cs, ds, es 指向同一段内 mov ds, ax mov es, ax call DispStR jmp $ ; 死循环,不停的在此处跳转 '$'当前地址 DispStr: mov ax, BootMessage mov bp, ax ; ES:BP = 字符串地址 mov cx, 16 ; 字符串长度 mov ax, 01301h ; AH = 13, AL = 01h 显示设置 mov bx, 000ch ; 页号位0 黑底红字 BL = 0xc mov dl, 0 int 10h ;显示中断信号 ret ; reutrn BootMessage: db "Hello, OS world!" ;长度 16 times 510 -($-$$) db 0 ; 用0 填充剩余的空间 MBR 512字节 dw 0xaa55 ; 引导盘结束标志
examples/cr_test_proc.adb
reznikmm/coroutines
3
2122
-- Copyright (c) 2019 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Ada.Characters.Latin_1; with Ada.Streams; with Ada.Strings.Fixed; with Ada.Text_IO; with GNAT.Sockets; with Coroutines.Polling; procedure CR_Test_Proc is function Get (URL : String) return Ada.Streams.Stream_Element_Array; -- Make HTTP GET request function Get (URL : String) return Ada.Streams.Stream_Element_Array is use type Ada.Streams.Stream_Element_Offset; Socket : GNAT.Sockets.Socket_Type; Slash : constant Natural := Ada.Strings.Fixed.Index (Source => URL, Pattern => "/", From => URL'First + 7); Host : constant String := URL (URL'First + 7 .. Slash - 1); Request : String := "GET " & URL (Slash .. URL'Last) & " HTTP/1.1" & Ada.Characters.Latin_1.CR & Ada.Characters.Latin_1.LF & "Host: " & Host & Ada.Characters.Latin_1.CR & Ada.Characters.Latin_1.LF & Ada.Characters.Latin_1.CR & Ada.Characters.Latin_1.LF; Data : Ada.Streams.Stream_Element_Array (1 .. Request'Length) with Import, Convention => Ada, Address => Request'Address; Last : Ada.Streams.Stream_Element_Offset; Address : GNAT.Sockets.Sock_Addr_Type; begin Address.Addr := GNAT.Sockets.Addresses (GNAT.Sockets.Get_Host_By_Name (Host), 1); Address.Port := 80; GNAT.Sockets.Create_Socket (Socket); GNAT.Sockets.Connect_Socket (Socket, Address); GNAT.Sockets.Send_Socket (Socket, Data, Last); pragma Assert (Last = Data'Last); -- Suspend current coroutine unti the socket has input. Coroutines.Yield (Coroutines.Polling.Watch (File => Coroutines.Polling.FD (GNAT.Sockets.To_C (Socket)), Events => (Coroutines.Polling.Input => True, others => False))); declare Output : Ada.Streams.Stream_Element_Array (1 .. 4096); begin GNAT.Sockets.Receive_Socket (Socket, Output, Last); -- Code := 200; Ada.Text_IO.Put_Line ("Last=" & (Last'Img)); return Output (1 .. Last); end; end Get; Response : Ada.Streams.Stream_Element_Array := Get ("http://www.google.com/"); Text : String (1 .. Response'Length) with Import, Convention => Ada, Address => Response'Address; begin Ada.Text_IO.Put_Line (Text); end CR_Test_Proc;
examples/3.dpd-with text elaborated.applescript
doekman/ASPashua
1
3771
<reponame>doekman/ASPashua use script "ASPashua" use scripting additions -- Reuse the pashua-file form example 1 set script_path to (path to me as text) & "::" set config_file_name to "1.dpd-with file.pashua" set config_file to alias (script_path & config_file_name) try set answer to display pashua dialog config_file -- When you press OK, "anwer" will contain something like this: -- {dob:"2016-10-19", email:"<EMAIL>", cb:"0", |name|:"<NAME>", agree:"1", db:"1"} if agree of answer = "0" then -- You didn't check the checkbox display alert "NOTICE!" message "I'm very disappointed with you." else -- Notice the "name" property is surrounded by pipe characters. This is because "name" is an AppleScript reserved name. display alert "For your information" message "Hi, " & |name| of answer & ", you will be spammed at " & email of answer end if on error number -128 --user canceled -- This part will only run if the user presses cancel, not with other errors display alert "User canceled" message "...but the script continues to execute" end try
src/main/antlr/Stepper.g4
eclecticlogic/ezra
13
5869
<reponame>eclecticlogic/ezra<gh_stars>10-100 grammar Stepper; program : annotation* PROGRAM programName=ID '{' statement+ '}' ; // control statements annotation : '@' ID '(' scalar ')' ; forStatement : label? FOR '(' ID '=' init=expr TO end=expr (STEP delta=expr)? ')' statementBlock #forLoop | label? FOR '(' ID IN iterable=expr ')' statementBlock #forIteration ; ifStatement : label? IF '(' ifCondition=expr ')' ifBlock=statementBlock (ELSE elseBlock=statementBlock)? ; whileStatement : label? WHILE '(' expr ')' statementBlock ; whenStatement : WHEN '{' caseEntry+ (ELSE elseBlock=statementBlock)? '}' ; caseEntry : label? CASE expr ':' statementBlock ; waitStatement : label? WAIT jsonObject ; failStatement : label? FAIL jsonObject? ';'? ; gotoStatement : GOTO STRING ';'? ; parallelStatement : retries (dereference ASSIGN)? PARALLEL '(' STRING (',' STRING)* ')' ; tryCatchStatement : TRY statementBlock catchClause+ ; catchClause : CATCH '(' STRING (',' STRING)* ')' '{' (dereference CLOSURE)? statement+ '}' ; statementBlock : '{' statement+ '}' | statement ; statement : assignment #statementAssignment | retries task #statementTask | forStatement #statementFor | ifStatement #statementIf | whileStatement #statementWhile | whenStatement #statementWhen | waitStatement #statementWait | failStatement #statementFail | gotoStatement #statementGoto | parallelStatement #statementParallel | tryCatchStatement #statementTryCatch ; assignment : retries dereference ASSIGN task SEMICOLON? #assignmentTask | label? dereference ASSIGN NUMBER SEMICOLON #assignmentNumber | label? dereference ASSIGN TRUE SEMICOLON #assignmentTrue | label? dereference ASSIGN FALSE SEMICOLON #assignmentFalse | label? dereference ASSIGN STRING SEMICOLON #assignmentString | label? dereference complexAssign expr SEMICOLON #assignmentExpr | label? dereference ASSIGN jsonObject SEMICOLON? #assignmentJson | label? dereference ASSIGN '[' value (',' value)* ']' SEMICOLON? #assignmentJsonArray ; expr : scalar | NULL | expressionStatement | expr MUL expr | expr DIV expr | expr ADD expr | expr SUB expr | expr MOD expr | '(' expr ')' | expr AND expr | expr OR expr | NOT expr | expr EQUALITY expr | expr LE expr | expr LT expr | expr GE expr | expr GT expr ; expressionStatement : dereference indexingDereference? ('.' expressionStatement)? | methodCall indexingDereference? ('.' expressionStatement)? ; methodCall : ID '(' ')' | ID '(' expr (',' expr)* ')' ; indexingDereference : '[' expr ']' ; dereference : ID ('.' ID )* ; task : TASK jsonObject ; retries : retry* label? retry*; retry : '@RetryOnError' '(' STRING (',' STRING)* ')' jsonObject ; label : '@Label' '(' STRING ')' ; jsonObject : '{' pair (',' pair)* '}' ; pair : STRING ':' value ; value : STRING #valueString | NUMBER #valueNum | TRUE #valueTrue | FALSE #valueFalse | '{' pair (',' pair)* '}' #valueObj | '{' '}' #valueObjEmpty | '[' value (',' value)* ']' #valueArr | '[' ']' #valueArrEmpty ; scalar : STRING | NUMBER | TRUE | FALSE ; complexAssign : (ASSIGN | PLUSASSIGN | MINUSASSIGN | MULTASSIGN | DIVASSIGN) ; // lexer rules NUMBER : '-'? INT ('.' [0-9] +)? EXP? ; STRING : '"' (ESC | SAFECODEPOINT)* '"' ; // operators MUL: '*'; DIV: '/'; ADD: '+'; SUB: '-'; MOD: '%'; AND: '&&'; OR: '||'; NOT: '!'; EQUALITY: '=='; LE: '<='; LT: '<'; GE: '>='; GT: '>'; ASSIGN: '='; PLUSASSIGN: '+='; MINUSASSIGN: '-='; MULTASSIGN: '*='; DIVASSIGN: '/='; // keywords PROGRAM: 'stepper'; TASK: 'task'; PARALLEL: 'parallel'; WAIT: 'wait'; FAIL: 'fail'; GOTO: 'goto'; TRUE: 'true'; FALSE: 'false'; NULL: 'null'; IF: 'if'; ELSE: 'else'; FOR: 'for'; IN: 'in'; TO: 'to'; STEP: 'step'; WHILE: 'while'; WHEN: 'when'; CASE: 'case'; TRY: 'try'; CATCH: 'catch'; // symbols SEMICOLON: ';'; CLOSURE: '->'; ID : ALPHA (ALPHA | DIGIT)* ; fragment ESC : '\\' (["\\/bfnrt]) ; fragment SAFECODEPOINT : ~ ["\\\u0000-\u001F] ; fragment INT : '0' | [1-9] DIGIT* ; // no leading zeros fragment EXP : [Ee] [+\-]? INT ; fragment DIGIT : [0-9] ; fragment ALPHA : [a-zA-Z_] ; COMMENT : '/*' .*? '*/' -> skip ; LINE_COMMENT : '//' ~[\r\n]* -> skip ; WS : [ \t\n\r]+ -> skip ;
Formalization/LambdaCalculus/Semantics.agda
Lolirofle/stuff-in-agda
6
1986
<reponame>Lolirofle/stuff-in-agda<gh_stars>1-10 module Formalization.LambdaCalculus.Semantics where open import Data open import Formalization.LambdaCalculus open import Syntax.Number open import Type -- A value in the language of lambda calculus is a irreducible term by a standard reduction definition. -- It can also be defined as terms that are lambda abstractions because an application of a lambda is supposed to be β-reducible. data Value : Expression → Type{0} where instance abs : ∀{body : Term(1)} → Value(Abstract body)
src/static/antlr4/grammars/Keywords.g4
jlenoble/casem
0
3237
lexer grammar Keywords; ABS : '\\Abs '; ACOS : '\\acos '; ADD : '+'; AND : '\\ And '; ARROW : '\\->'; ASIN : '\\asin '; ATAN : '\\atan '; CBRA : ']'; CCUR : '}'; CLRTEXT : '\\ClrText'; COLON : ':'; COMMA : ','; COS : '\\cos '; CPAR : ')'; DIV : '/'; DO : '\\Do'; DOT : '.'; ELSE : '\\Else '; EQ : '='; FATARROW : '\\=>'; FOR : '\\For '; GE : '\\>='; GETKEY : '\\Getkey'; GOTO : '\\Goto'; GT : '>'; IF : '\\If '; IFEND : '\\IfEnd'; INT : '\\Int '; LBL : '\\Lbl '; LE : '\\<='; LIST : '\\List '; LOCATE : '\\Locate '; LOOPWHILE : '\\LpWhile '; LT : '<'; MATRIX : '\\Mat '; REMAIN : '%'; MUL : '*'; NE : '\\<>'; NEXT : '\\Next'; OBRA : '['; OCUR : '{'; OPAR : '('; OR : '\\ Or '; PI : '\\Pi'; PROG : '\\Prog '; RETURN : '\\Return'; SIN : '\\sin '; SQRT : '\\sqrt'; STEP : '\\Step '; SUB : '-'; TAN : '\\tan '; THEN : '\\Then '; TO : ' \\To '; WHILE : '\\While '; WHILEEND : '\\WhileEnd';
Task/Arena-storage-pool/Ada/arena-storage-pool-4.ada
LaudateCorpus1/RosettaCodeData
1
10147
<gh_stars>1-10 with Arena_Pools; use Arena_Pools; procedure Test_Allocator is Pool : Arena_Pools.Arena (1024); type Integer_Ptr is access Integer; for Integer_Ptr'Storage_Pool use Pool; X : Integer_Ptr := new Integer'(1); Y : Integer_Ptr := new Integer'(2); Z : Integer_Ptr; begin Z := new Integer; Z.all := X.all + Y.all; end Test_Allocator;
virtual_piano.asm
SirPython/Virtual-Piano
0
173550
<filename>virtual_piano.asm ; Concerns: ; - those crazy 'switch' statements ; - register use ; - are the right subroutines doing their own jobs, and not another's? ; To work on: ; - stop user from going too low or too high; it breaks the program ;=============================================================================== ; Virtual Piano -- a virtual and playable piano ; By SirPython of Code Review and GitHub ; ; virtual_piano.asm ;=============================================================================== %define ESC 1Bh %define MIDI_CONTROL_PORT 0331h %define MIDI_DATA_PORT 0330h %define MIDI_UART_MODE 3Fh %define MIDI_PIANO_INSTRUMENT 93h start: call setup_midi mov ch, 60; default octave(0) mov cl, 5; used for making sure that the user does not go too low or too high with the octaves .loop: call read_character call process_input cmp bh, 0; if bad input OR octave change goes out of range je .loop call get_pitch pusha mov ah, 0Eh mov al, cl add al, '0' int 10h popa cmp bh, 2; if shouldn't play note (was an octave switch) je .loop call play_note jmp .loop ;-------------------------------------------------- ; Plays a note ; ; IN: AL, CH = pitch, (octave * 12) + 60 ; OUT: NONE ; ERR: NONE ; REG: AL play_note: add al, ch; apply the octave out dx, al; DX will already contain MIDI_DATA_PORT from the setup_midi function mov al, 7Fh; note duration out dx, al ret ;-------------------------------------------------- ; Based on input, returns a pitch to be played ; ; IN: AH, AL = scan code, key code ; OUT: AL, CH = pitch, (octave * 12) + 60 ; ERR: BH = 2, no pitch to be played ; REG: preserved get_pitch: cmp al, 'a' je .a cmp al, 's' je .s cmp al, 'd' je .d cmp al, 'f' je .f cmp al, 'j' je .j cmp al, 'k' je .k cmp al, 'l' je .l cmp al, ';' je .sc cmp al, 'w' je .w cmp al, 'e' je .e cmp al, 'r' je .r cmp al, 't' je .t cmp al, 'i' je .i cmp al, 'o' je .o cmp al, 'p' je .p cmp al, 'z' je .z cmp al, 'x' je .x .a: mov al, 0 jmp .end .s: mov al, 2 jmp .end .d: mov al, 4 jmp .end .f: mov al, 5 jmp .end .j: mov al, 7 jmp .end .k: mov al, 9 jmp .end .l: mov al, 11 jmp .end .sc: mov al, 12 jmp .end .w: mov al, 1 jmp .end .e: mov al, 3 jmp .end .r: jmp .f jmp .end .t: mov al, 6 jmp .end .i: mov al, 8 jmp .end .o: mov al, 10 jmp .end .p: jmp .l jmp .end .z: add ch, 12 add cl, 1 mov bh, 2 jmp .end .x: sub ch, 12 sub cl, 1 mov bh, 2 jmp .end .end: ret ;-------------------------------------------------- ; Set's up the MIDI ports for use ; ; IN: NONE ; OUT: NONE ; ERR: NONE ; REG: DX setup_midi: push ax mov dx, MIDI_CONTROL_PORT mov al, MIDI_UART_MODE; play notes as soon as they are recieved out dx, al mov dx, MIDI_DATA_PORT mov al, MIDI_PIANO_INSTRUMENT out dx, al pop ax ret ;-------------------------------------------------- ; Checks to make sure that input is acceptable ; ; IN: AH, AL = scan code, key code ; OUT: BH = 1 (accpetable) or 0 (not acceptable, or octave is trying to change too low) ; ERR: NONE ; REG: preserved process_input: .check_key_code: cmp al, 'a' je .safe cmp al, 's' je .safe cmp al, 'd' je .safe cmp al, 'f' je .safe cmp al, 'j' je .safe cmp al, 'k' je .safe cmp al, 'l' je .safe cmp al, ';' je .safe cmp al, 'w' je .safe cmp al, 'e' je .safe cmp al, 'r' je .safe cmp al, 't' je .safe cmp al, 'i' je .safe cmp al, 'o' je .safe cmp al, 'p' je .safe .check_octave_code: cmp al, 'z' je .z cmp al, 'x' je .x jmp .err; none of the keys pressed were valid keys .z: cmp cl, 10; if user is about to go out of octave range, then drop down to error jne .safe .x: cmp cl, 1 jne .safe .err: xor bh, bh ret .is_exit: cmp al, ESC call exit .safe: mov bh, 1 ;-------------------------------------------------- ; Stops execution of the program ; ; IN: NONE ; OUT: NONE ; ERR: NONE ; REG: NONE exit: hlt ret ;-------------------------------------------------- ; Reads a single character from the user ; ; IN: NONE ; OUT: AH, AL = scan code, key code ; ERR: NONE ; REG: preserved read_character: xor ah, ah int 16h; BIOS 16h 00h ret
proglangs-learning/Assembly/sandbox/newsandbox/newsandbox_1.asm
helq/old_code
0
86385
<filename>proglangs-learning/Assembly/sandbox/newsandbox/newsandbox_1.asm %macro nwln 0 mov eax,0x4 mov ebx,0x1 mov ecx,NewLine mov edx,0x1 int 0x80 %endmacro SECTION .data NewLine db 0xA Snippet db "KANGAROO" SnippetLen equ $-Snippet TestDb dw "Hi?" TestDd db "Hi :P" TestDdLen equ $-TestDd SaveBits db 11111111b,1b SaveHex dw 0ff01h SaveHex1 db 0FFH,01H float1 dd 1.234 real1 dq 123.456 marks times 8 db 0f2h ; var1: db 05h ; message: db "O_o -> XD",0ah ; message2: db "Second message",0ah SECTION .bss buffer resw 100000 SECTION .text global _start _start: nop ; mov esi,[TestDb] ; mov esi,TestDb ; mov byte [esi],100 ; inc dword [SaveHex] mov eax,0x0 sub eax,1 inc edi do: inc al jmp do add eax,1 sub eax,1 inc eax dec eax mov ecx,1 mov ebx,TestDb mov eax,[ebx+ecx] mov eax,[TestDb+ecx] lea eax,[TestDb] mov ecx,TestDb mov esi,0x0 mov ebx,[Snippet+esi] mov ebx,Snippet mov eax,[ebx+esi+3] ; mov eax,[ebx+ecx+edx] ; Invalid Effective Address ; ; ; -------------------------------------- ; ; mov eax,0x4 ; Specify sys_write call ; mov ebx,0x1 ; Specify File Descriptor 1: Standard Output ; mov ecx,Snippet ; Pass offset of the message ; mov edx,SnippetLen ; Pass the length of the message ; int 0x80 ; Make kernel call ; ; nwln ; New Line ; ; mov ebx,Snippet ; mov eax,SnippetLen ; DoMore: add byte [ebx],32 ; inc ebx ; dec eax ; jnz DoMore ; ; mov eax,0x4 ; Specify sys_write call ; mov ebx,0x1 ; Specify File Descriptor 1: Standard Output ; mov ecx,Snippet ; Pass offset of the message ; mov edx,SnippetLen ; Pass the length of the message ; int 0x80 ; Make kernel call ; ; nwln ; New Line ; ; mov eax,0x1 ; Code for Exit Syscall ; mov ebx,0x0 ; Return a code of zero ; int 0x80 ; Make kernel call ; ; ; -------------------------------------- ; ; dec byte [var1] ; jnz _start ; mov eax,0ff5h ; add eax,0bh ; add eax,1 ; inc eax ; mov bx,0ffffh ; add bx,1 ; mov dx,0ffffh ; dec dx ; mov eax,1 ; add eax,2 ; mov ebx,1 ; add bl,0ffh ; mov ecx,eax ; mov eax,1 ; mov ebx,1 ; neg ebx ; add eax,ebx ; add eax,1 ; mov eax,10b ; add eax,1 ; mov edx,07FFFFFFFh ; add edx,1 ; add edx,1 ; add edx,0fffffffeh ; mov eax,80000000h ; mov ebx,7fffffffh ; mov edx,message ; mov [message2],byte 67h ; mov ax,067FEh ; mov bx,ax ; mov cl,bh ; mov ch,bl ; ; xchg cl,ch ; ; xor cl,ch ; xor ch,cl ; xor cl,ch ; ; shr bx,1 ; ; mov eax,12345678h ; mov edx,'wxyz' ; ; mov bx,ax ; add di,ax ; add di,ax ; ; mov [ebp],edi nop
Library/Ruler/rulerConstrain.asm
steakknife/pcgeos
504
27795
<gh_stars>100-1000 COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: Ruler Library FILE: rulerConstrain.asm AUTHOR: <NAME>, 14 October 1991 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Jon 14 Oct 1991 Initial revision DESCRIPTION: Constrain-related methods for VisRuler class. $Id: rulerConstrain.asm,v 1.1 97/04/07 10:42:58 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RulerGridGuideConstrainCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisRulerSetConstrainTransform %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: VisRuler method for MSG_VIS_RULER_SET_CONSTRAIN_TRANSFORM MSG_VIS_RULER_SET_CONSTRAIN_TRANSFORM is sent to the ruler so that it can properly constrain mouse events when the events are taken as happening within some transformed coordinate system (eg. a rotated/skewed GrObj) Called by: MSG_VIS_RULER_SET_CONSTRAIN_TRANSFORM Pass: *ds:si = VisRuler object ds:di = VisRuler instance ss:[bp] - TMatrix Return: nothing Destroyed: ax Comments: Revision History: Name Date Description ---- ------------ ----------- jon Aug 5, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisRulerSetConstrainTransform method dynamic VisRulerClass, MSG_VIS_RULER_SET_CONSTRAIN_TRANSFORM .enter ; ; Allocate a gstate to hold the transform if none exists ; mov si, di ;ds:si <- instance mov di, ds:[di].VRI_transformGState tst di jnz haveGState call GrCreateState mov ds:[si].VRI_transformGState, di ;store the new gstate ; ; Copy the passed transform into our transform gstate ; haveGState: segmov ds,ss mov si, bp call GrSetTransform .leave ret VisRulerSetConstrainTransform endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisRulerClearConstrainTransform %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: VisRuler method for MSG_VIS_RULER_CLEAR_CONSTRAIN_TRANSFORM MSG_VIS_RULER_CLEAR_CONSTRAIN_TRANSFORM is sent to the ruler so that it can properly constrain mouse events when the events are taken as happening within some untransformed coordinate system. Called by: MSG_VIS_RULER_CLEAR_CONSTRAIN_TRANSFORM Pass: *ds:si = VisRuler object ds:di = VisRuler instance Return: nothing Destroyed: ax Comments: Revision History: Name Date Description ---- ------------ ----------- jon Aug 5, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisRulerClearConstrainTransform method dynamic VisRulerClass, MSG_VIS_RULER_CLEAR_CONSTRAIN_TRANSFORM .enter ; ; Destory our gstate, if any ; mov di, ds:[di].VRI_transformGState tst di jz done call GrDestroyState done: .leave ret VisRulerClearConstrainTransform endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisRulerSetVector %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: VisRuler method for MSG_VIS_RULER_SET_VECTOR Context: Source: Destination: Pass: ss:bp = PointDWFixed. The passed point and the reference point define the vector. Return: nothing Destroyed: ax Comments: Revision History: Name Date Description ---- ------------ ----------- jon Oct 29, 1991 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisRulerSetVector method dynamic VisRulerClass, MSG_VIS_RULER_SET_VECTOR uses cx, dx .enter ; ; This method will barf if the passed point is more ; than 2^16 points away from the reference. ; mov cx, ss:[bp].PDF_y.DWF_frac sub cx, ds:[di].VRI_reference.PDF_y.DWF_frac mov dx, ss:[bp].PDF_y.DWF_int.low sbb dx, ds:[di].VRI_reference.PDF_y.DWF_int.low mov ax, ss:[bp].PDF_x.DWF_frac sub ax, ds:[di].VRI_reference.PDF_x.DWF_frac mov bx, ss:[bp].PDF_x.DWF_int.low sbb bx, ds:[di].VRI_reference.PDF_x.DWF_int.low call GrSDivWWFixed jc straightUpAndDown gotSlope: mov ds:[di].VRI_vectorSlope.WWF_int, dx mov ds:[di].VRI_vectorSlope.WWF_frac, cx .leave ret straightUpAndDown: ; ; We want to set the slope to a huge value, leaving room ; enough for the graphics system to not blow up. For example, ; I initially had set dx = 0x7fff, but as soon as it did any ; math with that, it puked. I'm gonna try 0x3fff for now... -jon ; mov dx, 0x3fff jmp gotSlope VisRulerSetVector endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisRulerRuleLargePtr %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: VisRuler method for MSG_VIS_RULER_RULE_LARGE_PTR Pass: *ds:si = ds:di = VisRuler instance ss:bp - PointDWFixed cx - VisRulerConstrainStrategy Return: ss:bp - ruled PointDWFixed Destroyed: ax Revision History: Name Date Description ---- ------------ ----------- jon Nov 19, 1991 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisRulerRuleLargePtr method dynamic VisRulerClass, MSG_VIS_RULER_RULE_LARGE_PTR uses cx .enter CheckHack <(mask VRCS_OVERRIDE) eq 0x8000> tst cx js processStrategy mov cx, ds:[di].VRI_constrainStrategy processStrategy: call ProcessConstrainStrategy test cx, VRCS_SNAP_FLAGS jz checkConstrain test cx, mask VRCS_SNAP_TO_GUIDES_X jz checkGridX mov ax, MSG_VIS_RULER_SNAP_TO_GUIDES_X call ObjCallInstanceNoLock jc checkGuidesY checkGridX: test cx, mask VRCS_SNAP_TO_GRID_X_ABSOLUTE jz checkRelativeX mov ax, MSG_VIS_RULER_SNAP_TO_GRID_X call ObjCallInstanceNoLock jmp checkGuidesY checkRelativeX: test cx, mask VRCS_SNAP_TO_GRID_X_RELATIVE jz checkGuidesY mov ax, MSG_VIS_RULER_SNAP_RELATIVE_TO_REFERENCE_X call ObjCallInstanceNoLock checkGuidesY: test cx, mask VRCS_SNAP_TO_GUIDES_Y jz checkGridY mov ax, MSG_VIS_RULER_SNAP_TO_GUIDES_Y call ObjCallInstanceNoLock jc checkConstrain checkGridY: test cx, mask VRCS_SNAP_TO_GRID_Y_ABSOLUTE jz checkRelativeY mov ax, MSG_VIS_RULER_SNAP_TO_GRID_Y call ObjCallInstanceNoLock jmp checkConstrain checkRelativeY: test cx, mask VRCS_SNAP_TO_GRID_Y_RELATIVE jz checkConstrain mov ax, MSG_VIS_RULER_SNAP_RELATIVE_TO_REFERENCE_Y call ObjCallInstanceNoLock checkConstrain: test cx, VRCS_CONSTRAIN_FLAGS jz checkShowMouse call VisRulerCheckAxialConstraint jc checkShowMouse call VisRulerCheckDiagonalConstraint jc checkShowMouse call VisRulerCheckVectorConstraint checkShowMouse: mov ax, MSG_VIS_RULER_DRAW_MOUSE_TICK call ObjCallInstanceNoLock test cx, mask VRCS_SET_REFERENCE jz done mov ax, MSG_VIS_RULER_SET_REFERENCE call ObjCallInstanceNoLock done: .leave ret VisRulerRuleLargePtr endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ProcessConstrainStrategy %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Pass: *ds:si - VisRuler ss:[bp] - PointDWFixed cx = VisRulerConstrainStrategy Return: "orthogonal" VisRulerConstrainStrategy Destroyed: nothing Comments: Revision History: Name Date Description ---- ------------ ----------- jon Jan 20, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ProcessConstrainStrategy proc near .enter ; ; See if the constrain strategy has the vector constrain ; bit set ; test cx, VRCS_VECTOR_CONSTRAIN jz checkAxes ; ; See if we want the X or Y component of the passed point ; when constraining to the vector. ; call XorYVector jnc vectorX ;carry set if x in use ; ; Since the X component will be set by constraining, we want ; to disable grids/guides on the X component. ; andnf cx, not (mask VRCS_INTERNAL or \ mask VRCS_SNAP_TO_GRID_X_ABSOLUTE or \ mask VRCS_SNAP_TO_GRID_X_RELATIVE or \ mask VRCS_SNAP_TO_GUIDES_X or \ VRCS_CONSTRAIN_TO_HV_AXES or \ VRCS_CONSTRAIN_TO_DIAGONALS) jmp checkActualOrReflection vectorX: ornf cx, mask VRCS_INTERNAL ; ; Since the Y component will be set by constraining, we want ; to disable grids/guides on the Y component. ; andnf cx, not (mask VRCS_SNAP_TO_GRID_Y_ABSOLUTE or \ mask VRCS_SNAP_TO_GRID_Y_RELATIVE or \ mask VRCS_SNAP_TO_GUIDES_Y or \ VRCS_CONSTRAIN_TO_HV_AXES or \ VRCS_CONSTRAIN_TO_DIAGONALS) checkActualOrReflection: ; ; See if we want the actual vector or the reflected vector ; test cl, VRCS_CONSTRAIN_FLAGS jpo done ;if only one set, no problem call ActualOrReflectedVector jc reflected andnf cx, not mask VRCS_CONSTRAIN_TO_VECTOR_REFLECTION jmp done reflected: andnf cx, not mask VRCS_CONSTRAIN_TO_VECTOR done: .leave ret checkAxes: test cx, VRCS_CONSTRAIN_TO_HV_AXES or VRCS_CONSTRAIN_TO_DIAGONALS jz done mov dx, 0xffff test cx, mask VRCS_CONSTRAIN_TO_HORIZONTAL_AXIS jz checkVertDistance call RulerGetApproximateDistanceToHorizontalAxis mov_tr dx, ax checkVertDistance: test cx, mask VRCS_CONSTRAIN_TO_VERTICAL_AXIS jz checkUnityDistance andnf cx, not mask VRCS_CONSTRAIN_TO_VERTICAL_AXIS call RulerGetApproximateDistanceToVerticalAxis cmp ax, dx jae checkUnityDistance andnf cx, not mask VRCS_CONSTRAIN_TO_HORIZONTAL_AXIS ornf cx, mask VRCS_CONSTRAIN_TO_VERTICAL_AXIS mov_tr dx, ax checkUnityDistance: test cx, mask VRCS_CONSTRAIN_TO_UNITY_SLOPE_AXIS jz checkNegativeUnityDistance andnf cx, not mask VRCS_CONSTRAIN_TO_UNITY_SLOPE_AXIS call RulerGetApproximateDistanceToUnityAxis cmp ax, dx jae checkNegativeUnityDistance andnf cx, not (mask VRCS_CONSTRAIN_TO_HORIZONTAL_AXIS or \ mask VRCS_CONSTRAIN_TO_VERTICAL_AXIS) ornf cx, mask VRCS_CONSTRAIN_TO_UNITY_SLOPE_AXIS mov_tr dx, ax checkNegativeUnityDistance: test cx, mask VRCS_CONSTRAIN_TO_NEGATIVE_UNITY_SLOPE_AXIS jz setInternal andnf cx, not mask VRCS_CONSTRAIN_TO_NEGATIVE_UNITY_SLOPE_AXIS call RulerGetApproximateDistanceToNegativeUnityAxis cmp ax, dx jae setInternal andnf cx, not (mask VRCS_CONSTRAIN_TO_HORIZONTAL_AXIS or \ mask VRCS_CONSTRAIN_TO_VERTICAL_AXIS or \ mask VRCS_CONSTRAIN_TO_UNITY_SLOPE_AXIS) ornf cx, mask VRCS_CONSTRAIN_TO_NEGATIVE_UNITY_SLOPE_AXIS mov_tr dx, ax setInternal: ; ; At this point, 1 (and only 1) of the 4 constrain bits ; should be set. We'll figure out if the x or y coordinate ; is relevant, and disable grids on the other one, since ; it will be constrained anyway. ; test cx, mask VRCS_CONSTRAIN_TO_HORIZONTAL_AXIS jz checkVert ; ; We're constraining horizontally, so disable y grids ; andnf cx, not (mask VRCS_SNAP_TO_GRID_Y_ABSOLUTE or \ mask VRCS_SNAP_TO_GRID_Y_RELATIVE or \ mask VRCS_SNAP_TO_GUIDES_Y) jmp done checkVert: test cx, mask VRCS_CONSTRAIN_TO_VERTICAL_AXIS jz checkDiags ; ; We're constraining vertically, so disable x grids ; andnf cx, not (mask VRCS_SNAP_TO_GRID_X_ABSOLUTE or \ mask VRCS_SNAP_TO_GRID_X_RELATIVE or \ mask VRCS_SNAP_TO_GUIDES_X) jmp done checkDiags: ; ; O.K., we're constraining to one of the slope = 1,-1 axes, ; so we want to figure out whether we'll be using the x ; or y coord. ; call XorYDiags jc yDiags BitSet cx, VRCS_INTERNAL andnf cx, not (mask VRCS_SNAP_TO_GRID_Y_ABSOLUTE or \ mask VRCS_SNAP_TO_GRID_Y_RELATIVE or \ mask VRCS_SNAP_TO_GUIDES_Y) jmp done yDiags: BitClr cx, VRCS_INTERNAL andnf cx, not (mask VRCS_SNAP_TO_GRID_X_ABSOLUTE or \ mask VRCS_SNAP_TO_GRID_X_RELATIVE or \ mask VRCS_SNAP_TO_GUIDES_X) jmp done ProcessConstrainStrategy endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RulerGetApproximateDistanceToHorizontalAxis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Returns an integer approximation of the horizontal distance between the passed point and the VisRuler's reference point. Pass: ds:[di] - VisRuler instance ss:[bp] - PointDWFixed Return: ax - distance Destroyed: nothing Comments: Won't work for distances > 32767 Revision History: Name Date Description ---- ------------ ----------- jon Jan 21, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RulerGetApproximateDistanceToHorizontalAxis proc near uses bx class VisRulerClass .enter mov bx, ds:[di].VRI_reference.PDF_y.DWF_frac sub bx, ss:[bp].PDF_y.DWF_frac mov ax, ds:[di].VRI_reference.PDF_y.DWF_int.low sbb ax, ss:[bp].PDF_y.DWF_int.low tst bx jns checkIntSign inc ax checkIntSign: tst ax jns done neg ax done: .leave ret RulerGetApproximateDistanceToHorizontalAxis endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RulerGetApproximateDistanceToVerticalAxis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Returns an integer approximation of the vertical distance between the passed point and the VisRuler's reference point. Pass: ds:[di] - VisRuler instance ss:[bp] - PointDWFixed Return: ax - distance Destroyed: nothing Comments: Won't work for distances > 32767 Revision History: Name Date Description ---- ------------ ----------- jon Jan 21, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RulerGetApproximateDistanceToVerticalAxis proc near uses bx class VisRulerClass .enter mov bx, ds:[di].VRI_reference.PDF_x.DWF_frac sub bx, ss:[bp].PDF_x.DWF_frac mov ax, ds:[di].VRI_reference.PDF_x.DWF_int.low sbb ax, ss:[bp].PDF_x.DWF_int.low tst bx jns checkIntSign inc ax checkIntSign: tst ax jns done neg ax done: .leave ret RulerGetApproximateDistanceToVerticalAxis endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RulerGetApproximateDistanceToUnityAxis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Returns an integer approximation of the distance between the passed point and the line with slope = 1 passing through the VisRuler's reference point. Pass: ds:[di] - VisRuler instance ss:[bp] - PointDWFixed Return: ax - distance Destroyed: nothing Comments: Won't work for distances > 32767 Revision History: Name Date Description ---- ------------ ----------- jon Jan 21, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RulerGetApproximateDistanceToUnityAxis proc near uses bx, cx, dx class VisRulerClass .enter mov bx, ds:[di].VRI_reference.PDF_x.DWF_frac sub bx, ss:[bp].PDF_x.DWF_frac mov ax, ds:[di].VRI_reference.PDF_x.DWF_int.low sbb ax, ss:[bp].PDF_x.DWF_int.low mov cx, ds:[di].VRI_reference.PDF_y.DWF_frac sub cx, ss:[bp].PDF_y.DWF_frac mov dx, ds:[di].VRI_reference.PDF_y.DWF_int.low sbb dx, ss:[bp].PDF_y.DWF_int.low sub bx, cx sbb ax, dx tst bx jns checkIntSign inc ax checkIntSign: tst ax jns scaleByHalfRoot2 neg ax scaleByHalfRoot2: clr dx mov cx, HALF_ROOT_2 mul cx mov_tr ax, dx .leave ret RulerGetApproximateDistanceToUnityAxis endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RulerGetApproximateDistanceToNegativeUnityAxis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Returns an integer approximation of the distance between the passed point and the line with slope = -1 passing through the VisRuler's reference point. Pass: ds:[di] - VisRuler instance ss:[bp] - PointDWFixed Return: ax - distance Destroyed: nothing Comments: Won't work for distances > 32767 Revision History: Name Date Description ---- ------------ ----------- jon Jan 21, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RulerGetApproximateDistanceToNegativeUnityAxis proc near uses bx, cx, dx class VisRulerClass .enter mov bx, ds:[di].VRI_reference.PDF_x.DWF_frac sub bx, ss:[bp].PDF_x.DWF_frac mov ax, ds:[di].VRI_reference.PDF_x.DWF_int.low sbb ax, ss:[bp].PDF_x.DWF_int.low mov cx, ds:[di].VRI_reference.PDF_y.DWF_frac sub cx, ss:[bp].PDF_y.DWF_frac mov dx, ds:[di].VRI_reference.PDF_y.DWF_int.low sbb dx, ss:[bp].PDF_y.DWF_int.low add bx, cx adc ax, dx tst bx jns checkIntSign inc ax checkIntSign: tst ax jns scaleByHalfRoot2 neg ax scaleByHalfRoot2: clr dx mov cx, HALF_ROOT_2 mul cx mov_tr ax, dx .leave ret RulerGetApproximateDistanceToNegativeUnityAxis endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% XorYDiags %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Returns carry set if passed point is further vertically than horizontally from the VisRuler's reference point Pass: ds:[di] - VisRuler instance ss:[bp] - PointDWFixed Return: carry set if horizontal distance < vertical distance Destroyed: nothing Comments: Won't work for distances > 32767 Revision History: Name Date Description ---- ------------ ----------- jon Jan 21, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ XorYDiags proc near class VisRulerClass uses ax, bx, cx, dx .enter ; ; bxax <- abs(horizontal distance) ; mov ax, ds:[di].VRI_reference.PDF_x.DWF_frac sub ax, ss:[bp].PDF_x.DWF_frac mov bx, ds:[di].VRI_reference.PDF_x.DWF_int.low sbb bx, ss:[bp].PDF_x.DWF_int.low jns getY negwwf bxax getY: ; ; dxcx <- abs(vertical distance) ; mov cx, ds:[di].VRI_reference.PDF_y.DWF_frac sub cx, ss:[bp].PDF_y.DWF_frac mov dx, ds:[di].VRI_reference.PDF_y.DWF_int.low sbb dx, ss:[bp].PDF_y.DWF_int.low jns compare negwwf dxcx compare: cmp bx, dx ;carry set if bx<dx, clear if bx>dx jne done cmp ax, cx ;carry set if ax<cx, clear if ax>=cx done: .leave ret XorYDiags endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% XorYVector %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Returns carry set if passed point is further vertically than horizontally from the VisRuler's reference point Pass: *ds:si - VisRuler object ds:[di] - VisRuler instance ss:[bp] - PointDWFixed Return: carry set if horizontal distance < vertical distance Destroyed: nothing Comments: Won't work for distances > 32767 Revision History: Name Date Description ---- ------------ ----------- jon Jan 21, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ XorYVector proc near class VisRulerClass uses ax, bx, cx, dx .enter ; ; Untransform the points and the vector. If there's an overflow ; in the vector calculation, then we're BASICALLY_VERTICAL ; call VisRulerUntransformPointsAndVector jc retransform ; ; If the slope is too flat or too vertical, we want to ; return a value that will keep use from blowing up ; movwwf dxcx, ds:[di].VRI_vectorSlope tst dx jns haveSlope negwwf dxcx haveSlope: tst dx jnz checkVertical cmp cx, BASICALLY_FLAT ja nonTrivial ; ; The slope is really flat, so clear the carry to indicate ; that the ruler should map the vertical portion of the passed ; point. ; clc jmp retransform checkVertical: cmp dx, BASICALLY_VERTICAL jb nonTrivial ; ; The slope is really steep, so set the carry to indicate ; that the ruler should map the horizontal portion of the passed ; point. ; stc jmp retransform nonTrivial: ; ; dxcx <- abs(horizontal distance * slope) ; mov ax, ds:[di].VRI_reference.PDF_x.DWF_frac sub ax, ss:[bp].PDF_x.DWF_frac mov bx, ds:[di].VRI_reference.PDF_x.DWF_int.low sbb bx, ss:[bp].PDF_x.DWF_int.low call GrMulWWFixed tst dx jns getY negwwf dxcx getY: ; ; bxax <- abs(vertical distance) ; mov ax, ds:[di].VRI_reference.PDF_y.DWF_frac sub ax, ss:[bp].PDF_y.DWF_frac mov bx, ds:[di].VRI_reference.PDF_y.DWF_int.low sbb bx, ss:[bp].PDF_y.DWF_int.low jns compare negwwf bxax compare: cmp dx, bx ;carry set if dx<bx, clear if dx>bx jne retransform cmp cx, ax ;carry set if cx<ax, clear if cx>=ax retransform: pushf ;save result call VisRulerTransformPointsAndVector popf ;carry <- result .leave ret XorYVector endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisRulerUntransformPointsAndVector %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Untransforms the passed point, the VisRuler's reference point, and the VisRuler's vectorSlope through the ruler's transform gstate, if any Pass: *ds:si - VisRuler object ss:[bp] - PointDWFixed Return: carry set if overflow during vector calculation Destroyed: nothing Comments: Revision History: Name Date Description ---- ------------ ----------- jon Aug 5, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisRulerUntransformPointsAndVector proc near class VisRulerClass uses si, di, es, dx, bx, ax, cx .enter mov si, ds:[si] add si, ds:[si].VisRuler_offset mov di, ds:[si].VRI_transformGState tst di jz done ; ; Untransform the passed point ; segmov es, ss mov dx, bp call GrUntransformDWFixed ; ; Untransform the reference point ; segmov es, ds lea dx, ds:[si].VRI_reference call GrUntransformDWFixed ; ; Untransform the vector ; movwwf bxax, ds:[si].VRI_vectorSlope mov dx, 1 clr cx call GrUntransformWWFixed jc done xchg dx, bx xchg cx, ax call GrSDivWWFixed jc done movwwf ds:[si].VRI_vectorSlope, dxcx clc done: .leave ret VisRulerUntransformPointsAndVector endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisRulerTransformPointsAndVector %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Transforms the passed point, the VisRuler's reference point, and the VisRuler's vectorSlope through the ruler's transform gstate, if any Pass: *ds:si - VisRuler object ss:[bp] - PointDWFixed Return: nothing Destroyed: nothing Comments: Revision History: Name Date Description ---- ------------ ----------- jon Aug 5, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisRulerTransformPointsAndVector proc near class VisRulerClass uses si, di, es, dx, bx, ax, cx .enter mov si, ds:[si] add si, ds:[si].VisRuler_offset mov di, ds:[si].VRI_transformGState tst di jz done ; ; Transform the passed point ; segmov es, ss mov dx, bp call GrTransformDWFixed ; ; Transform the reference point ; segmov es, ds lea dx, ds:[si].VRI_reference call GrTransformDWFixed ; ; Transform the vector ; movwwf bxax, ds:[si].VRI_vectorSlope mov dx, 1 clr cx call GrTransformWWFixed xchg dx, bx xchg cx, ax call GrSDivWWFixed movwwf ds:[si].VRI_vectorSlope, dxcx done: .leave ret VisRulerTransformPointsAndVector endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ActualOrReflectedVector %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Returns carry set if passed point is further vertically than horizontally from the VisRuler's reference point Pass: *ds:si - VisRuler object ds:[di] - VisRuler instance ss:[bp] - PointDWFixed Return: carry set if reflected Destroyed: nothing Comments: Won't work for distances > 32767 Revision History: Name Date Description ---- ------------ ----------- jon Jan 21, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ActualOrReflectedVector proc near class VisRulerClass uses ax, bx, cx, dx .enter call VisRulerUntransformPointsAndVector ; ; bxax <- horizontal distance ; mov ax, ss:[bp].PDF_x.DWF_frac sub ax, ds:[di].VRI_reference.PDF_x.DWF_frac mov bx, ss:[bp].PDF_x.DWF_int.low sbb bx, ds:[di].VRI_reference.PDF_x.DWF_int.low ; ; dxcx <- vertical distance ; mov cx, ss:[bp].PDF_y.DWF_frac sub cx, ds:[di].VRI_reference.PDF_y.DWF_frac mov dx, ss:[bp].PDF_y.DWF_int.low sbb dx, ds:[di].VRI_reference.PDF_y.DWF_int.low ; ; Check for opposite signs ; xor dx, bx xor dx, ds:[di].VRI_vectorSlope.WWF_int jns retransform ;if actual, carry already clr ; ; reflected ; stc retransform: pushf ;save result call VisRulerTransformPointsAndVector popf ;carry <- result .leave ret ActualOrReflectedVector endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisRulerConstrainToAxes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: VisRuler method for MSG_VIS_RULER_CONSTRAIN_TO_DIAGONALS Called by: Pass: *ds:si = VisRuler object ds:di = VisRuler instance ss:[bp] = PointDWFixed to constrain dx = size PointDWFixed Return: ss:[bp] = Diagonally constrained PointDWFixed Destroyed: nothing Comments: Revision History: Name Date Description ---- ------------ ----------- jon Jan 20, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisRulerConstrainToAxes method VisRulerClass, MSG_VIS_RULER_CONSTRAIN_TO_AXES uses cx .enter mov cx, VRCS_CONSTRAIN_TO_HV_AXES call ProcessConstrainStrategy call VisRulerCheckAxialConstraint .leave ret VisRulerConstrainToAxes endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisRulerCheckAxialConstraint %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Pass: *ds:si = VisRuler object cx = VisRulerConstrainStrategy ss:bp = PointDWFixed Return: carry set if constrained Destroyed: nothing Comments: Revision History: Name Date Description ---- ------------ ----------- jon Mar 26, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisRulerCheckAxialConstraint proc near class VisRulerClass uses ax .enter mov ax, MSG_VIS_RULER_CONSTRAIN_TO_HORIZONTAL_AXIS test cx, mask VRCS_CONSTRAIN_TO_HORIZONTAL_AXIS jnz constrain test cx, mask VRCS_CONSTRAIN_TO_VERTICAL_AXIS jz done mov ax, MSG_VIS_RULER_CONSTRAIN_TO_VERTICAL_AXIS constrain: call ObjCallInstanceNoLock stc done: .leave ret VisRulerCheckAxialConstraint endp VisRulerConstrainToHorizontalAxis method VisRulerClass, MSG_VIS_RULER_CONSTRAIN_TO_HORIZONTAL_AXIS .enter movdwf ss:[bp].PDF_y, ds:[di].VRI_reference.PDF_y, ax .leave ret VisRulerConstrainToHorizontalAxis endm VisRulerConstrainToVerticalAxis method VisRulerClass, MSG_VIS_RULER_CONSTRAIN_TO_VERTICAL_AXIS .enter movdwf ss:[bp].PDF_x, ds:[di].VRI_reference.PDF_x, ax .leave ret VisRulerConstrainToVerticalAxis endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisRulerConstrainToDiagonals %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: VisRuler method for MSG_VIS_RULER_CONSTRAIN_TO_DIAGONALS Called by: Pass: *ds:si = VisRuler object ds:di = VisRuler instance ss:[bp] = PointDWFixed to constrain dx = size PointDWFixed Return: ss:[bp] = Diagonally constrained PointDWFixed Destroyed: nothing Comments: Revision History: Name Date Description ---- ------------ ----------- jon Jan 20, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisRulerConstrainToDiagonals method VisRulerClass, MSG_VIS_RULER_CONSTRAIN_TO_DIAGONALS uses cx .enter mov cx, VRCS_CONSTRAIN_TO_DIAGONALS call ProcessConstrainStrategy call VisRulerCheckDiagonalConstraint .leave ret VisRulerConstrainToDiagonals endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisRulerCheckDiagonalConstraint %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Pass: *ds:si = VisRuler object cx = VisRulerConstrainStrategy ss:bp = PointDWFixed Return: carry set if constrained Destroyed: nothing Comments: Revision History: Name Date Description ---- ------------ ----------- jon Mar 26, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisRulerCheckDiagonalConstraint proc near class VisRulerClass uses ax .enter test cx, mask VRCS_CONSTRAIN_TO_UNITY_SLOPE_AXIS jz checkNegativeUnityConstrain mov ax, MSG_VIS_RULER_CONSTRAIN_X_TO_UNITY_SLOPE_AXIS test cx, mask VRCS_INTERNAL jz doUnity mov ax, MSG_VIS_RULER_CONSTRAIN_Y_TO_UNITY_SLOPE_AXIS doUnity: call ObjCallInstanceNoLock jmp stcDone checkNegativeUnityConstrain: test cx, mask VRCS_CONSTRAIN_TO_NEGATIVE_UNITY_SLOPE_AXIS jz done ;carry clear from test mov ax, MSG_VIS_RULER_CONSTRAIN_X_TO_NEGATIVE_UNITY_SLOPE_AXIS test cx, mask VRCS_INTERNAL jz doNegativeUnity mov ax, MSG_VIS_RULER_CONSTRAIN_Y_TO_NEGATIVE_UNITY_SLOPE_AXIS doNegativeUnity: call ObjCallInstanceNoLock stcDone: stc done: .leave ret VisRulerCheckDiagonalConstraint endp VisRulerConstrainXToUnitySlopeAxis method VisRulerClass, MSG_VIS_RULER_CONSTRAIN_X_TO_UNITY_SLOPE_AXIS .enter movdwf ss:[bp].PDF_x, ss:[bp].PDF_y, ax subdwf ss:[bp].PDF_x, ds:[di].VRI_reference.PDF_y, ax adddwf ss:[bp].PDF_x, ds:[di].VRI_reference.PDF_x, ax .leave ret VisRulerConstrainXToUnitySlopeAxis endm VisRulerConstrainYToUnitySlopeAxis method VisRulerClass, MSG_VIS_RULER_CONSTRAIN_Y_TO_UNITY_SLOPE_AXIS .enter movdwf ss:[bp].PDF_y, ss:[bp].PDF_x, ax subdwf ss:[bp].PDF_y, ds:[di].VRI_reference.PDF_x, ax adddwf ss:[bp].PDF_y, ds:[di].VRI_reference.PDF_y, ax .leave ret VisRulerConstrainYToUnitySlopeAxis endm VisRulerConstrainXToNegativeUnitySlopeAxis method VisRulerClass, MSG_VIS_RULER_CONSTRAIN_X_TO_NEGATIVE_UNITY_SLOPE_AXIS .enter movdwf ss:[bp].PDF_x, ds:[di].VRI_reference.PDF_x, ax subdwf ss:[bp].PDF_x, ss:[bp].PDF_y, ax adddwf ss:[bp].PDF_x, ds:[di].VRI_reference.PDF_y, ax .leave ret VisRulerConstrainXToNegativeUnitySlopeAxis endm VisRulerConstrainYToNegativeUnitySlopeAxis method VisRulerClass, MSG_VIS_RULER_CONSTRAIN_Y_TO_NEGATIVE_UNITY_SLOPE_AXIS .enter movdwf ss:[bp].PDF_y, ds:[di].VRI_reference.PDF_y, ax subdwf ss:[bp].PDF_y, ss:[bp].PDF_x, ax adddwf ss:[bp].PDF_y, ds:[di].VRI_reference.PDF_x, ax .leave ret VisRulerConstrainYToNegativeUnitySlopeAxis endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisRulerConstrainToVector %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: VisRuler method for MSG_VIS_RULER_CONSTRAIN_TO_VECTOR Pass: *ds:[si] = VisRuler object ds:[di] = VisRuler instance ss:[bp] = PointDWFixed Return: ss:[bp] is constrained to vector Destroyed: ax, bx, cx, dx, di, si Comments: no comment Revision History: Name Date Description ---- ------------ ----------- jon Oct 29, 1991 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisRulerConstrainToVector method VisRulerClass, MSG_VIS_RULER_CONSTRAIN_TO_VECTOR uses cx .enter mov cx, VRCS_VECTOR_CONSTRAIN call ProcessConstrainStrategy call VisRulerCheckVectorConstraint .leave ret VisRulerConstrainToVector endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VisRulerCheckVectorConstraint %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Description: Pass: *ds:si = VisRuler object cx = VisRulerConstrainStrategy ss:bp = PointDWFixed Return: carry set if constrained Destroyed: nothing Comments: Revision History: Name Date Description ---- ------------ ----------- jon Mar 26, 1992 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ VisRulerCheckVectorConstraint proc near class VisRulerClass uses ax .enter test cx, mask VRCS_CONSTRAIN_TO_VECTOR jz checkVectorReflection mov ax, MSG_VIS_RULER_CONSTRAIN_X_TO_VECTOR test cx, mask VRCS_INTERNAL jz doVector mov ax, MSG_VIS_RULER_CONSTRAIN_Y_TO_VECTOR doVector: call ObjCallInstanceNoLock jmp stcDone checkVectorReflection: test cx, mask VRCS_CONSTRAIN_TO_VECTOR_REFLECTION jz done ;carry clear from test mov ax, MSG_VIS_RULER_CONSTRAIN_X_TO_VECTOR_REFLECTION test cx, mask VRCS_INTERNAL jz doVectorReflection mov ax, MSG_VIS_RULER_CONSTRAIN_Y_TO_VECTOR_REFLECTION doVectorReflection: call ObjCallInstanceNoLock stcDone: stc done: .leave ret VisRulerCheckVectorConstraint endp VisRulerConstrainXToVector method VisRulerClass, MSG_VIS_RULER_CONSTRAIN_X_TO_VECTOR uses ax, bx .enter call VisRulerUntransformPointsAndVector movwwf axbx, ds:[di].VRI_vectorSlope call VisRulerConstrainXToVectorCommon call VisRulerTransformPointsAndVector .leave ret VisRulerConstrainXToVector endm VisRulerConstrainXToVectorReflection method VisRulerClass, MSG_VIS_RULER_CONSTRAIN_X_TO_VECTOR_REFLECTION uses ax, bx .enter call VisRulerUntransformPointsAndVector movwwf axbx, ds:[di].VRI_vectorSlope negwwf axbx call VisRulerConstrainXToVectorCommon call VisRulerTransformPointsAndVector .leave ret VisRulerConstrainXToVectorReflection endm VisRulerConstrainXToVectorCommon proc near class VisRulerClass uses ax, cx, dx, di, si .enter ; ; map point to vector by fixing the y offset and ; changing the x offset. ; movdwf ss:[bp].PDF_x, ds:[di].VRI_reference.PDF_x, dx ; ; Get slope reciprocal into dx:cx ; tst ax jnz doIt tst bx jz done doIt: cwd push dx ;save high int xchg ax, bx ;ax <- frac, bx <- int clr cx mov dx, 1 call GrSDivWWFixed ; ; si:bx:ax <- y offset ; movdwf sibxax, ss:[bp].PDF_y subdwf sibxax, ds:[di].VRI_reference.PDF_y pop di ;di <- high int ; ; Multiply slope reciprocal by y offset ; call GrMulDWFixed ; ; add the result to x ; adddwf ss:[bp].PDF_x, dxcxbx done: .leave ret VisRulerConstrainXToVectorCommon endp VisRulerConstrainYToVector method VisRulerClass, MSG_VIS_RULER_CONSTRAIN_Y_TO_VECTOR uses ax, cx .enter call VisRulerUntransformPointsAndVector movwwf axcx, ds:[di].VRI_vectorSlope call VisRulerConstrainYToVectorCommon call VisRulerTransformPointsAndVector .leave ret VisRulerConstrainYToVector endm VisRulerConstrainYToVectorReflection method VisRulerClass, MSG_VIS_RULER_CONSTRAIN_Y_TO_VECTOR_REFLECTION uses ax, cx .enter call VisRulerUntransformPointsAndVector movwwf axcx, ds:[di].VRI_vectorSlope negwwf axcx call VisRulerConstrainYToVectorCommon call VisRulerTransformPointsAndVector .leave ret VisRulerConstrainYToVectorReflection endm VisRulerConstrainYToVectorCommon proc near class VisRulerClass uses ax, cx, dx, di, si .enter ; ; map point to vector by fixing the x offset and ; changing the y offset. ; movdwf ss:[bp].PDF_y, ds:[di].VRI_reference.PDF_y, dx ; ; Get slope into dx:cx ; cwd push dx ;save sign extension mov_tr dx, ax ;dx <- int.low ; ; si:bx:ax <- x offset ; movdwf sibxax, ss:[bp].PDF_x subdwf sibxax, ds:[di].VRI_reference.PDF_x pop di ;di <- sign ext. ; ; Multiply slope by x offset ; call GrMulDWFixed ; ; add the result to y ; adddwf ss:[bp].PDF_y, dxcxbx .leave ret VisRulerConstrainYToVectorCommon endp RulerGridGuideConstrainCode ends
test/interaction/Issue1104.agda
cruhland/agda
1,989
10317
?bug : Set ?bug = ? -- Andreas, 2014-04-16 -- Issue 1104 reported by <NAME>. -- Emacs mode got confused by identifiers containing -- -- Problem: {!!} is not turned into hole bug-- : Set bug-- = ? another : Set another = (-- Senfgurke ? {!!})-- Noch eine Senfgurke ? _:--_ : Set → Set → Set _:--_ = {!!} bla = let x = Set ;-- bla ? y = Set in Set bug? : Set bug? = {!!}
src/sound/hartmanns_youkai_girl/channel1.asm
Gegel85/KESP
0
246350
musicChan1KoishiTheme:: setRegisters $00, $46, $F3, $00, $00 .loop:: repeat 2 setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_D * 2, $80 wait DOTTED_QUAVER setFrequency NOTE_C * 2, $80 wait DOTTED_QUAVER setFrequency NOTE_D * 2, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_Bb, $80 wait QUAVER setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_Eb, $80 wait QUAVER setFrequency NOTE_Bb, $80 wait QUAVER continue ; change volume setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_C, $80 wait QUAVER setFrequency NOTE_B, $80 wait DOTTED_QUAVER setFrequency NOTE_A, $80 wait DOTTED_QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_C, $80 wait QUAVER setFrequency NOTE_F_SHARP, $80 wait QUAVER setFrequency NOTE_D_SHARP, $80 wait QUAVER setFrequency NOTE_A_SHARP / 2, $80 wait QUAVER setFrequency NOTE_F_SHARP, $80 wait QUAVER setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_C, $80 wait QUAVER setFrequency NOTE_B, $80 wait DOTTED_QUAVER setFrequency NOTE_A, $80 wait DOTTED_QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_C, $80 wait QUAVER ; change volume setFrequency NOTE_F_SHARP, $80 wait QUAVER setFrequency NOTE_D_SHARP, $80 wait QUAVER setFrequency NOTE_Bb / 2, $80 wait QUAVER setFrequency NOTE_D_SHARP, $80 wait QUAVER repeat 2 setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_A, $80 wait QUAVER setFrequency NOTE_A, $80 wait QUAVER setFrequency NOTE_D * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_A, $80 wait QUAVER setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_A, $80 wait QUAVER setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_D_SHARP * 2, $80 wait QUAVER setFrequency NOTE_F_SHARP * 2, $80 wait QUAVER continue setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_A, $80 wait QUAVER setFrequency NOTE_A, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_D_SHARP * 2, $80 wait QUAVER setFrequency NOTE_F_SHARP * 2, $80 wait QUAVER setFrequency NOTE_A_SHARP * 2, $80 wait QUAVER setFrequency NOTE_D_SHARP * 4, $80 wait QUAVER setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_A, $80 wait QUAVER setFrequency NOTE_A, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_D_SHARP * 2, $80 wait QUAVER setFrequency NOTE_F_SHARP * 2, $80 wait QUAVER setFrequency NOTE_A_SHARP * 2, $80 wait SEMIQUAVER setFrequency NOTE_F_SHARP * 2, $80 wait SEMIQUAVER setFrequency NOTE_D_SHARP * 2, $80 wait QUAVER repeat 2 setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait CROTCHET setFrequency NOTE_F, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait CROTCHET continue repeat 2 setFrequency NOTE_F_SHARP, $80 wait QUAVER setFrequency NOTE_C_SHARP * 2, $80 wait QUAVER setFrequency NOTE_F_SHARP * 2, $80 wait CROTCHET setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_C_SHARP * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait CROTCHET continue repeat 2 setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait CROTCHET setFrequency NOTE_F, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait CROTCHET continue setFrequency NOTE_F_SHARP, $80 wait QUAVER setFrequency NOTE_C_SHARP * 2, $80 wait QUAVER setFrequency NOTE_F_SHARP * 2, $80 wait CROTCHET setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_C_SHARP * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait CROTCHET setFrequency NOTE_G_SHARP, $80 wait QUAVER setFrequency NOTE_D_SHARP * 2, $80 wait QUAVER setFrequency NOTE_G_SHARP * 2, $80 wait CROTCHET setFrequency NOTE_A, $80 wait QUAVER setFrequency NOTE_D * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait CROTCHET setFrequency NOTE_A_SHARP * 2, $80 wait MINIM + DOTTED_CROTCHET * 2 setFrequency NOTE_A * 2, $80 wait MINIM setFrequency NOTE_A_SHARP * 2, $80 wait MINIM + DOTTED_CROTCHET * 2 setFrequency NOTE_A * 2, $80 wait MINIM setFrequency NOTE_F_SHARP * 2, $80 wait MINIM + DOTTED_CROTCHET * 2 setFrequency NOTE_E * 2, $80 wait MINIM setFrequency NOTE_F_SHARP * 2, $80 wait MINIM + DOTTED_CROTCHET * 2 setFrequency NOTE_E * 2, $80 wait MINIM repeat 2 setFrequency NOTE_Eb, $80 wait QUAVER setFrequency NOTE_Bb, $80 wait QUAVER setFrequency NOTE_Ab, $80 wait QUAVER setFrequency NOTE_Ab, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait QUAVER setFrequency NOTE_Ab, $80 wait QUAVER setFrequency NOTE_Gb, $80 wait QUAVER setFrequency NOTE_Bb, $80 wait QUAVER setFrequency NOTE_Ab, $80 wait QUAVER setFrequency NOTE_Gb, $80 wait QUAVER setFrequency NOTE_Bb, $80 wait QUAVER setFrequency NOTE_D * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER continue setFrequency NOTE_Eb, $80 wait QUAVER setFrequency NOTE_Bb, $80 wait QUAVER setFrequency NOTE_Ab, $80 wait QUAVER setFrequency NOTE_Ab, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait QUAVER setFrequency NOTE_Ab * 2, $80 wait QUAVER setFrequency NOTE_Eb * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_D * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_D * 4, $80 wait QUAVER setFrequency NOTE_Eb, $80 wait QUAVER setFrequency NOTE_Bb, $80 wait QUAVER setFrequency NOTE_Ab, $80 wait QUAVER setFrequency NOTE_Ab, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait QUAVER setFrequency NOTE_Ab * 2, $80 wait QUAVER setFrequency NOTE_Eb * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_D * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait SEMIQUAVER setFrequency NOTE_F * 2, $80 wait SEMIQUAVER setFrequency NOTE_D * 2, $80 wait QUAVER repeat 2 setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_Gb * 2, $80 wait QUAVER setFrequency NOTE_Eb * 2, $80 wait QUAVER setFrequency NOTE_Db * 4, $80 wait DOTTED_QUAVER setFrequency NOTE_B * 2, $80 wait DOTTED_QUAVER setFrequency NOTE_Db * 4, $80 wait QUAVER setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_Gb * 2, $80 wait QUAVER setFrequency NOTE_Eb * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_Gb * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait QUAVER continue repeat 2 setFrequency NOTE_Gb * 2, $80 wait QUAVER setFrequency NOTE_Eb * 2, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_Bb * 2, $80 wait DOTTED_QUAVER setFrequency NOTE_Ab * 2, $80 wait DOTTED_QUAVER setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_Eb * 2, $80 wait QUAVER setFrequency NOTE_Gb * 2, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_Eb * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_D * 4, $80 wait QUAVER continue repeat 2 setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait CROTCHET setFrequency NOTE_F, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait CROTCHET continue repeat 2 setFrequency NOTE_F_SHARP, $80 wait QUAVER setFrequency NOTE_C_SHARP * 2, $80 wait QUAVER setFrequency NOTE_F_SHARP * 2, $80 wait CROTCHET setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_C_SHARP * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait CROTCHET continue repeat 2 setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait CROTCHET setFrequency NOTE_F, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait CROTCHET continue setFrequency NOTE_F_SHARP, $80 wait QUAVER setFrequency NOTE_C_SHARP * 2, $80 wait QUAVER setFrequency NOTE_F_SHARP * 2, $80 wait CROTCHET setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_C_SHARP * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait CROTCHET setFrequency NOTE_G_SHARP, $80 wait QUAVER setFrequency NOTE_D_SHARP * 2, $80 wait QUAVER setFrequency NOTE_G_SHARP * 2, $80 wait CROTCHET setFrequency NOTE_A, $80 wait QUAVER setFrequency NOTE_D * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait CROTCHET setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_A, $80 wait SEMIQUAVER setFrequency NOTE_B, $80 wait SEMIQUAVER setFrequency NOTE_C * 2, $80 wait CROTCHET setFrequency NOTE_C * 4, $80 wait CROTCHET setFrequency NOTE_B * 2, $80 wait CROTCHET setFrequency NOTE_G * 2, $80 wait CROTCHET setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_B * 2, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_E * 4, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_B * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait CROTCHET setFrequency NOTE_G * 2, $80 wait CROTCHET setFrequency NOTE_A * 2, $80 wait DOTTED_CROTCHET setFrequency NOTE_E * 2, $80 wait SEMIQUAVER setFrequency NOTE_G * 2, $80 wait SEMIQUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_B * 2, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_B * 2, $80 wait QUAVER setFrequency NOTE_D * 4, $80 wait QUAVER setFrequency NOTE_B * 2, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_B * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait CROTCHET setFrequency NOTE_B, $80 wait CROTCHET setFrequency NOTE_A, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_A, $80 wait QUAVER setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_E, $80 wait QUAVER setFrequency NOTE_G, $80 wait QUAVER setFrequency NOTE_A, $80 wait CROTCHET setFrequency NOTE_B, $80 wait CROTCHET setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_A, $80 wait SEMIQUAVER setFrequency NOTE_B, $80 wait SEMIQUAVER setFrequency NOTE_C * 2, $80 wait CROTCHET setFrequency NOTE_C * 4, $80 wait CROTCHET setFrequency NOTE_B * 2, $80 wait CROTCHET setFrequency NOTE_G * 2, $80 wait CROTCHET setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_B * 2, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_E * 4, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_B * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait CROTCHET setFrequency NOTE_G * 2, $80 wait CROTCHET setFrequency NOTE_A * 2, $80 wait DOTTED_CROTCHET setFrequency NOTE_E * 2, $80 wait SEMIQUAVER setFrequency NOTE_G * 2, $80 wait SEMIQUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_B * 2, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_B * 2, $80 wait QUAVER setFrequency NOTE_D * 4, $80 wait QUAVER setFrequency NOTE_B * 2, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_B * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait CROTCHET setFrequency NOTE_B, $80 wait CROTCHET setFrequency NOTE_A, $80 wait QUAVER setFrequency NOTE_B, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait QUAVER setFrequency NOTE_B * 2, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait QUAVER setFrequency NOTE_E * 2, $80 wait QUAVER setFrequency NOTE_G * 2, $80 wait QUAVER setFrequency NOTE_A * 2, $80 wait CROTCHET setFrequency NOTE_A * 2, $80 wait SEMIQUAVER setFrequency NOTE_E * 2, $80 wait SEMIQUAVER setFrequency NOTE_C * 2, $80 wait SEMIQUAVER setFrequency NOTE_A, $80 wait SEMIQUAVER setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_Ab * 2, $80 wait QUAVER setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait QUAVER setFrequency NOTE_Bb, $80 wait SEMIQUAVER setFrequency NOTE_C * 2, $80 wait SEMIQUAVER setFrequency NOTE_Db * 2, $80 wait CROTCHET setFrequency NOTE_Db * 4, $80 wait CROTCHET setFrequency NOTE_C * 4, $80 wait CROTCHET setFrequency NOTE_Ab * 2, $80 wait CROTCHET setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_Db * 4, $80 wait QUAVER setFrequency NOTE_F * 4, $80 wait QUAVER setFrequency NOTE_Db * 4, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_Ab * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait CROTCHET setFrequency NOTE_Ab * 2, $80 wait CROTCHET setFrequency NOTE_Bb * 2, $80 wait DOTTED_CROTCHET setFrequency NOTE_F * 2, $80 wait SEMIQUAVER setFrequency NOTE_Ab * 2, $80 wait SEMIQUAVER setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_Ab * 2, $80 wait QUAVER setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_Db * 4, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_Eb * 4, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_Db * 4, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_Ab * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait CROTCHET setFrequency NOTE_C * 2, $80 wait CROTCHET setFrequency NOTE_Bb, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_Bb, $80 wait QUAVER setFrequency NOTE_Ab, $80 wait QUAVER setFrequency NOTE_F, $80 wait QUAVER setFrequency NOTE_Ab, $80 wait QUAVER setFrequency NOTE_Bb, $80 wait CROTCHET setFrequency NOTE_C * 2, $80 wait CROTCHET setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_Ab * 2, $80 wait QUAVER setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait QUAVER setFrequency NOTE_Bb, $80 wait SEMIQUAVER setFrequency NOTE_C * 2, $80 wait SEMIQUAVER setFrequency NOTE_Db * 2, $80 wait CROTCHET setFrequency NOTE_Db * 4, $80 wait CROTCHET setFrequency NOTE_C * 4, $80 wait CROTCHET setFrequency NOTE_Ab * 2, $80 wait CROTCHET setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_Db * 4, $80 wait QUAVER setFrequency NOTE_F * 4, $80 wait QUAVER setFrequency NOTE_Db * 4, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_Ab * 2, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait CROTCHET setFrequency NOTE_Ab * 2, $80 wait CROTCHET setFrequency NOTE_Bb * 2, $80 wait DOTTED_CROTCHET setFrequency NOTE_F * 2, $80 wait SEMIQUAVER setFrequency NOTE_Ab * 2, $80 wait SEMIQUAVER setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_Ab * 2, $80 wait QUAVER setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_Db * 4, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_Eb * 4, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_Db * 4, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_Ab * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait CROTCHET setFrequency NOTE_C * 2, $80 wait CROTCHET setFrequency NOTE_Bb, $80 wait QUAVER setFrequency NOTE_C * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_Db * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_C * 4, $80 wait QUAVER setFrequency NOTE_Db * 4, $80 wait QUAVER setFrequency NOTE_Bb * 2, $80 wait QUAVER setFrequency NOTE_Ab * 2, $80 wait QUAVER setFrequency NOTE_F * 2, $80 wait QUAVER setFrequency NOTE_Ab * 2, $80 wait QUAVER setFrequency NOTE_Bb * 2, $80 wait MINIM stopMusic jump .loop
cpm/ndos/necho.asm
erikp9000/cpm-ndos
0
244411
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; NECHO.ASM ;; ;; NDOS Message echo ;; ;; On start, dma contains command line argument length byte ;; and command line. ;; Stack pointer should be within CCP. ;; Check for NDOS; display error if not running. ;; Copy command line arguments to buf and call NDOS to send it. ;; Call NDOS to receive response. ;; On a=0(success), print response. ;; On a=0FFh(failure), print error. ;; maclib ndos org tpa start: lxi h,0 dad sp ; hl = sp shld savestack ; save original stack pointer lxi sp,stack mvi c,n?ver call bdosv cpi 10h jc nondos ; NDOS is present ; copy command line args from dmabuf lxi d,msgbuf+2 ; point to start of data lxi h,defdma ; command-line mov a,m ; command-line length ora a jz dousage mov c,a loop: inx h mov a,m stax d inx d dcr c jnz loop lda defdma adi 3 ; include LEN, CMD, and CHK bytes sta msgbuf loop1: mvi c,n?smsg lxi d,msgbuf call bdosv ; send message to server mvi c,n?rmsg lxi d,buffer call bdosv ; get response ora a jnz timeout ; print response from server lda buffer ; get LEN byte dcr a ; subtract 1 mov e,a mvi d,0 lxi h,buffer dad d ; de is pointing to CHK byte mvi m,'$' ; terminate the string lxi d,buffer+2 ; point to first byte of response (ECHO doesn't have a Status byte) mvi c,prnstr call bdosv ; print the response lxi d,crlf mvi c,prnstr call bdosv ; print CR, LF ; loop if there's no keypress from the console mvi c,constat call bdosv ora a jz loop1 mvi c,conin call bdosv ; remove the keypress so it's not waiting for the CCP jmp quit ; NDOS not found nondos: mvi c,prnstr lxi d,nondoserr call bdosv jmp quit ; Timeout contacting server timeout:mvi c,prnstr lxi d,toerr call bdosv jmp quit ; Error status from server serverr:mvi c,prnstr lxi d,serr call bdosv jmp quit ; Print usage dousage: mvi c, prnstr lxi d,usage call bdosv quit: lhld savestack sphl ; sp = hl ret ; quit nondoserr: db 'NDOS not loaded',cr,lf,'$' toerr: db 'Timeout',cr,lf,'$' serr: db 'Directory not found',cr,lf,'$' usage: db 'necho <text to send to server>' crlf: db cr,lf,'$' ;; NDOS request message msgbuf: db 0 ; LEN db NECHO ; CMD ds 148 ; DATA and CHK ;; NDOS response buffer buffer: ds 150 savestack: dw 0 ds 16 stack: end start
PJ Grammar/blocks.g4
Diolor/PJ
0
6065
<reponame>Diolor/PJ parser grammar blocks; block : ':'? INDENT blockStatement* DEDENT ; blockStatement : localVariableDeclaration | statement | typeDeclaration ; /*localVariableDeclarationStatement : localVariableDeclaration ;*/ localVariableDeclaration : variableModifier* type variableDeclarators ;
libsrc/sprites/software/sp1/ts2068hr/tiles/SP1PSPUSH.asm
jpoikela/z88dk
38
17584
; subroutine for writing registers to "struct sp1_pss" ; 02.2008 aralbrec ; ts2068 hi-res version PUBLIC SP1PSPUSH ; exit : hl = & struct sp1_pss to write to ; e = flags (bit 0 = invalidate?, bit 1 = xwrap?, bit 2 = yinc?, bit3 = ywrap?) ; b = current x coordinate (relative to bounds rect IY) ; c = current y coordinate (relative to bounds rect IY) ; de' = current struct sp1_update * ; ix = visit function ; iy = bounds rectangle .SP1PSPUSH ld a,iyl ; write bounds rectangle ld (hl),a inc hl ld a,iyh ld (hl),a inc hl ld (hl),e ; write flags inc hl ld (hl),b ; write x coordinate inc hl ld (hl),c ; write y coordinate inc hl push hl exx pop hl ld (hl),e ; write sp1_update inc hl ld (hl),d inc hl ld a,ixl ; write visit function ld (hl),a inc hl ld a,ixh ld (hl),a ret
source/amf/mof/cmof/amf-cmof-properties.ads
svn2github/matreshka
24
23047
<reponame>svn2github/matreshka ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ -- A property is a structural feature of a classifier that characterizes -- instances of the classifier. A property related by ownedAttribute to a -- classifier (other than an association) represents an attribute and might -- also represent an association end. It relates an instance of the class to -- a value or set of values of the type of the attribute. A property related -- by memberEnd or its specializations to an association represents an end of -- the association. The type of the property is the type of the end of the -- association. ------------------------------------------------------------------------------ limited with AMF.CMOF.Associations; limited with AMF.CMOF.Classes; limited with AMF.CMOF.Classifiers.Collections; limited with AMF.CMOF.Data_Types; limited with AMF.CMOF.Properties.Collections; limited with AMF.CMOF.Redefinable_Elements; with AMF.CMOF.Structural_Features; package AMF.CMOF.Properties is pragma Preelaborate; type CMOF_Property is limited interface and AMF.CMOF.Structural_Features.CMOF_Structural_Feature; type CMOF_Property_Access is access all CMOF_Property'Class; for CMOF_Property_Access'Storage_Size use 0; not overriding function Get_Is_Read_Only (Self : not null access constant CMOF_Property) return Boolean is abstract; -- Getter of Property::isReadOnly. -- -- If isReadOnly is true, the attribute may not be written to after -- initialization. not overriding procedure Set_Is_Read_Only (Self : not null access CMOF_Property; To : Boolean) is abstract; -- Setter of Property::isReadOnly. -- -- If isReadOnly is true, the attribute may not be written to after -- initialization. not overriding function Get_Default (Self : not null access constant CMOF_Property) return AMF.Optional_String is abstract; -- Getter of Property::default. -- -- Specifies a String that represents a value to be used when no argument -- is supplied for the Property. not overriding procedure Set_Default (Self : not null access CMOF_Property; To : AMF.Optional_String) is abstract; -- Setter of Property::default. -- -- Specifies a String that represents a value to be used when no argument -- is supplied for the Property. not overriding function Get_Is_Composite (Self : not null access constant CMOF_Property) return Boolean is abstract; -- Getter of Property::isComposite. -- -- If isComposite is true, the object containing the attribute is a -- container for the object or value contained in the attribute. not overriding procedure Set_Is_Composite (Self : not null access CMOF_Property; To : Boolean) is abstract; -- Setter of Property::isComposite. -- -- If isComposite is true, the object containing the attribute is a -- container for the object or value contained in the attribute. not overriding function Get_Is_Derived (Self : not null access constant CMOF_Property) return Boolean is abstract; -- Getter of Property::isDerived. -- -- If isDerived is true, the value of the attribute is derived from -- information elsewhere. not overriding procedure Set_Is_Derived (Self : not null access CMOF_Property; To : Boolean) is abstract; -- Setter of Property::isDerived. -- -- If isDerived is true, the value of the attribute is derived from -- information elsewhere. not overriding function Get_Is_Derived_Union (Self : not null access constant CMOF_Property) return Boolean is abstract; -- Getter of Property::isDerivedUnion. -- -- Specifies whether the property is derived as the union of all of the -- properties that are constrained to subset it. not overriding procedure Set_Is_Derived_Union (Self : not null access CMOF_Property; To : Boolean) is abstract; -- Setter of Property::isDerivedUnion. -- -- Specifies whether the property is derived as the union of all of the -- properties that are constrained to subset it. not overriding function Get_Class (Self : not null access constant CMOF_Property) return AMF.CMOF.Classes.CMOF_Class_Access is abstract; -- Getter of Property::class. -- -- References the Class that owns the Property. not overriding procedure Set_Class (Self : not null access CMOF_Property; To : AMF.CMOF.Classes.CMOF_Class_Access) is abstract; -- Setter of Property::class. -- -- References the Class that owns the Property. not overriding function Get_Owning_Association (Self : not null access constant CMOF_Property) return AMF.CMOF.Associations.CMOF_Association_Access is abstract; -- Getter of Property::owningAssociation. -- -- References the owning association of this property, if any. not overriding procedure Set_Owning_Association (Self : not null access CMOF_Property; To : AMF.CMOF.Associations.CMOF_Association_Access) is abstract; -- Setter of Property::owningAssociation. -- -- References the owning association of this property, if any. not overriding function Get_Redefined_Property (Self : not null access constant CMOF_Property) return AMF.CMOF.Properties.Collections.Set_Of_CMOF_Property is abstract; -- Getter of Property::redefinedProperty. -- -- References the properties that are redefined by this property. not overriding function Get_Subsetted_Property (Self : not null access constant CMOF_Property) return AMF.CMOF.Properties.Collections.Set_Of_CMOF_Property is abstract; -- Getter of Property::subsettedProperty. -- -- References the properties of which this property is constrained to be a -- subset. not overriding function Get_Opposite (Self : not null access constant CMOF_Property) return AMF.CMOF.Properties.CMOF_Property_Access is abstract; -- Getter of Property::opposite. -- -- In the case where the property is one navigable end of a binary -- association with both ends navigable, this gives the other end. not overriding procedure Set_Opposite (Self : not null access CMOF_Property; To : AMF.CMOF.Properties.CMOF_Property_Access) is abstract; -- Setter of Property::opposite. -- -- In the case where the property is one navigable end of a binary -- association with both ends navigable, this gives the other end. not overriding function Get_Datatype (Self : not null access constant CMOF_Property) return AMF.CMOF.Data_Types.CMOF_Data_Type_Access is abstract; -- Getter of Property::datatype. -- -- The DataType that owns this Property. not overriding procedure Set_Datatype (Self : not null access CMOF_Property; To : AMF.CMOF.Data_Types.CMOF_Data_Type_Access) is abstract; -- Setter of Property::datatype. -- -- The DataType that owns this Property. not overriding function Get_Association (Self : not null access constant CMOF_Property) return AMF.CMOF.Associations.CMOF_Association_Access is abstract; -- Getter of Property::association. -- -- References the association of which this property is a member, if any. not overriding procedure Set_Association (Self : not null access CMOF_Property; To : AMF.CMOF.Associations.CMOF_Association_Access) is abstract; -- Setter of Property::association. -- -- References the association of which this property is a member, if any. not overriding function Opposite (Self : not null access constant CMOF_Property) return AMF.CMOF.Properties.CMOF_Property_Access is abstract; -- Operation Property::opposite. -- -- If this property is owned by a class, associated with a binary -- association, and the other end of the association is also owned by a -- class, then opposite gives the other end. overriding function Is_Consistent_With (Self : not null access constant CMOF_Property; Redefinee : AMF.CMOF.Redefinable_Elements.CMOF_Redefinable_Element_Access) return Boolean is abstract; -- Operation Property::isConsistentWith. -- -- The query isConsistentWith() specifies, for any two Properties in a -- context in which redefinition is possible, whether redefinition would -- be logically consistent. A redefining property is consistent with a -- redefined property if the type of the redefining property conforms to -- the type of the redefined property, the multiplicity of the redefining -- property (if specified) is contained in the multiplicity of the -- redefined property, and the redefining property is derived if the -- redefined property is derived. not overriding function Subsetting_Context (Self : not null access constant CMOF_Property) return AMF.CMOF.Classifiers.Collections.Set_Of_CMOF_Classifier is abstract; -- Operation Property::subsettingContext. -- -- The query subsettingContext() gives the context for subsetting a -- property. It consists, in the case of an attribute, of the -- corresponding classifier, and in the case of an association end, all of -- the classifiers at the other ends. not overriding function Is_Navigable (Self : not null access constant CMOF_Property) return Boolean is abstract; -- Operation Property::isNavigable. -- -- The query isNavigable() indicates whether it is possible to navigate -- across the property. not overriding function Is_Attribute (Self : not null access constant CMOF_Property; P : AMF.CMOF.Properties.CMOF_Property_Access) return Boolean is abstract; -- Operation Property::isAttribute. -- -- The query isAttribute() is true if the Property is defined as an -- attribute of some classifier. end AMF.CMOF.Properties;
dino/lcs/base/4CD.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
6
16770
copyright zengfr site:http://github.com/zengfr/romhack 006C8A tst.b ($4cd,A5) 006C8E bne $6cb0 [base+4CD] 0070E2 bset D0, ($4cd,A5) [123p+ 2] 0070E6 move.b #$4, ($a2,A6) [base+4CD] 007266 btst #$0, ($4cd,A5) [123p+ 2] 00726C beq $7292 [base+4CD] 007292 btst #$1, ($4cd,A5) 007298 beq $72be [base+4CD] 0072BE btst #$2, ($4cd,A5) 0072C4 beq $72ec [base+4CD] 0072FE bclr D0, ($4cd,A5) [base+4E4] 007302 tst.b ($4d7,A5) [base+4CD] 007446 bset D0, ($4cd,A5) [123p+ 2] 00744A lea (A6), A0 [base+4CD] 0074D0 bclr D0, ($4cd,A5) [123p+ 2] 0074D4 cmpi.b #$10, ($4d0,A5) [base+4CD] 00A884 move.b ($4cd,A5), D2 00A888 bsr $a804 [base+4CD] 00A88C move.b D2, ($4cd,A5) 00A890 jsr $ff2e.l [base+4CD] 00A8CC btst #$0, ($4cd,A5) [base+4E4] 00A8D2 beq $a8e4 [base+4CD] 00A8E4 btst #$1, ($4cd,A5) 00A8EA beq $a8fc [base+4CD] 00A8FC btst #$2, ($4cd,A5) 00A902 beq $a914 [base+4CD] 00AFAA btst #$0, ($4cd,A5) [base+62C] 00AFB0 beq $afd4 [base+4CD] 00AFD4 btst #$1, ($4cd,A5) 00AFDA beq $affe [base+4CD] 00AFFE btst #$2, ($4cd,A5) 00B004 beq $b028 [base+4CD] 09D124 clr.b ($4cd,A5) 09D128 bsr $9d196 [base+4CD] 09D12C tst.b ($4cd,A5) 09D130 beq $9d194 [base+4CD] 09D2D6 or.b D4, ($4cd,A5) 09D2DA rts [base+4CD] copyright zengfr site:http://github.com/zengfr/romhack
Transynther/x86/_processed/NC/_zr_/i3-7100_9_0xca_notsx.log_21829_1766.asm
ljhsiun2/medusa
9
26925
<filename>Transynther/x86/_processed/NC/_zr_/i3-7100_9_0xca_notsx.log_21829_1766.asm<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r10 push %r15 push %r9 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_WT_ht+0x19009, %rsi lea addresses_UC_ht+0x469d, %rdi clflush (%rdi) nop xor $10793, %rbx mov $120, %rcx rep movsq nop nop nop nop sub $51938, %rsi lea addresses_WT_ht+0x17119, %rsi lea addresses_A_ht+0xbbc9, %rdi nop nop nop nop xor %r15, %r15 mov $67, %rcx rep movsq nop nop nop nop nop cmp %rdi, %rdi lea addresses_normal_ht+0x4e79, %r9 lfence movw $0x6162, (%r9) nop xor %rdi, %rdi lea addresses_A_ht+0xfaf1, %rsi nop add $53680, %rbp mov (%rsi), %r9w nop nop nop nop add $5377, %rbx lea addresses_D_ht+0x1356a, %rsi lea addresses_A_ht+0x4b89, %rdi nop nop inc %r15 mov $110, %rcx rep movsl nop nop nop nop add %rdi, %rdi lea addresses_WC_ht+0x24c9, %rsi and %r15, %r15 mov $0x6162636465666768, %rbp movq %rbp, (%rsi) sub $44994, %rcx lea addresses_WT_ht+0x1ef7a, %rcx nop nop nop nop nop add %rsi, %rsi movl $0x61626364, (%rcx) nop nop nop nop and $41619, %rbx lea addresses_WC_ht+0x4fb9, %rsi lea addresses_A_ht+0x38b9, %rdi nop nop nop add %r10, %r10 mov $90, %rcx rep movsb nop nop nop xor %rbp, %rbp lea addresses_A_ht+0x1d1d5, %r10 nop nop nop nop nop and $36467, %rbp movw $0x6162, (%r10) nop nop nop nop nop xor $42437, %r15 lea addresses_WT_ht+0x1d7a5, %rsi lea addresses_WC_ht+0x7a29, %rdi nop nop and $62604, %r15 mov $101, %rcx rep movsl dec %rdi lea addresses_A_ht+0x15b89, %rbx cmp $53979, %rcx movb (%rbx), %r10b nop nop nop nop nop and $64213, %rbp lea addresses_WC_ht+0x6909, %r15 nop nop nop nop nop cmp $64464, %rsi mov (%r15), %r9d nop nop add $22945, %rbx lea addresses_A_ht+0xb9c9, %rsi lea addresses_normal_ht+0x1581, %rdi nop nop nop nop cmp %r9, %r9 mov $40, %rcx rep movsq and $21036, %r9 lea addresses_UC_ht+0x123a5, %r10 xor %rbx, %rbx movb $0x61, (%r10) nop nop nop cmp %rcx, %rcx lea addresses_UC_ht+0xa0ed, %r10 nop nop nop nop and %rbp, %rbp movw $0x6162, (%r10) xor $1835, %rcx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r15 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r14 push %rcx push %rdi push %rdx // Load lea addresses_normal+0x15389, %rdi xor %r12, %r12 mov (%rdi), %r13w nop nop nop nop sub $42417, %rdx // Store lea addresses_WT+0x1c8a9, %r14 nop nop nop nop xor $30774, %rdi mov $0x5152535455565758, %r13 movq %r13, %xmm0 vmovups %ymm0, (%r14) nop nop nop nop sub %rdx, %rdx // Store lea addresses_UC+0x16b89, %r12 and %rcx, %rcx mov $0x5152535455565758, %r10 movq %r10, (%r12) nop nop add $28869, %r12 // Store mov $0xffd, %r12 xor %rdx, %rdx mov $0x5152535455565758, %r14 movq %r14, %xmm5 vmovups %ymm5, (%r12) nop add %r14, %r14 // Faulty Load mov $0x4113b0000000389, %r10 nop nop nop nop nop xor $29572, %rdx mov (%r10), %edi lea oracles, %rcx and $0xff, %rdi shlq $12, %rdi mov (%rcx,%rdi,1), %rdi pop %rdx pop %rdi pop %rcx pop %r14 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_normal', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WT', 'size': 32, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_UC', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_P', 'size': 32, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}} {'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}} {'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}} {'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}} {'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': True}} {'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': 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 */
programs/oeis/087/A087475.asm
neoneye/loda
22
169917
<gh_stars>10-100 ; A087475: a(n) = n^2 + 4. ; 4,5,8,13,20,29,40,53,68,85,104,125,148,173,200,229,260,293,328,365,404,445,488,533,580,629,680,733,788,845,904,965,1028,1093,1160,1229,1300,1373,1448,1525,1604,1685,1768,1853,1940,2029,2120,2213,2308,2405,2504,2605,2708,2813,2920,3029,3140,3253,3368,3485,3604,3725,3848,3973,4100,4229,4360,4493,4628,4765,4904,5045,5188,5333,5480,5629,5780,5933,6088,6245,6404,6565,6728,6893,7060,7229,7400,7573,7748,7925,8104,8285,8468,8653,8840,9029,9220,9413,9608,9805 pow $0,2 add $0,4
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_209.asm
ljhsiun2/medusa
9
161210
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r12 push %r8 push %r9 push %rbx push %rcx push %rdx push %rsi lea addresses_WC_ht+0x12e1b, %r9 add $40724, %rcx movb $0x61, (%r9) nop nop nop nop sub %r8, %r8 lea addresses_UC_ht+0x5a15, %rbx nop nop nop add $28431, %rdx movw $0x6162, (%rbx) nop xor $49964, %r9 lea addresses_WT_ht+0x13907, %r12 nop nop nop nop nop xor $33701, %rbx movups (%r12), %xmm3 vpextrq $0, %xmm3, %r9 add %rsi, %rsi pop %rsi pop %rdx pop %rcx pop %rbx pop %r9 pop %r8 pop %r12 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %r9 push %rdx push %rsi // Faulty Load lea addresses_D+0x1b415, %rsi nop nop cmp %r11, %r11 mov (%rsi), %r12 lea oracles, %rsi and $0xff, %r12 shlq $12, %r12 mov (%rsi,%r12,1), %r12 pop %rsi pop %rdx pop %r9 pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 16, 'type': 'addresses_D', 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WC_ht', 'congruent': 0}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_UC_ht', 'congruent': 7}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT_ht', 'congruent': 1}} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
base/ntos/rtl/amd64/debugstb.asm
987432340/wrk-v1.2
1
7736
<filename>base/ntos/rtl/amd64/debugstb.asm title "Debug Support Functions" ;++ ; ; Copyright (c) Microsoft Corporation. All rights reserved. ; ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). ; If you do not agree to the terms, do not use the code. ; ; Copyright (c) 2000 Microsoft Corporation ; ; Module Name: ; ; debugstb.asm ; ; Abstract: ; ; This module implements functions to support debugging NT. ; ;-- include ksamd64.inc subttl "Break Point" ;++ ; ; VOID ; DbgBreakPoint ( ; VOID ; ) ; ; Routine Description: ; ; This function executes a breakpoint instruction. Useful for entering ; the debugger under program control. This breakpoint will always go to ; the kernel debugger if one is installed, otherwise it will go to the ; debug subsystem. ; ; Arguments: ; ; None. ; ; Return Value: ; ; None. ; ;-- LEAF_ENTRY DbgBreakPoint, _TEXT$00 int 3 ; break into debugger ret ; return LEAF_END DbgBreakPoint, _TEXT$00 subttl "User Break Point" ;++ ; ; VOID ; DbgUserBreakPoint() ; ; Routine Description: ; ; This function executes a breakpoint instruction. Useful for entering ; the debug subsystem under program control. The kernel debugger will ; ignore this breakpoint since it will not find the instruction address ; its breakpoint table. ; ; Arguments: ; ; None. ; ; Return Value: ; ; None. ; ;-- LEAF_ENTRY DbgUserBreakPoint, _TEXT$00 int 3 ; break into debugger ret ; return LEAF_END DbgUserBreakPoint, _TEXT$00 subttl "Break Point With Status" ;++ ; ; VOID ; DbgBreakPointWithStatus( ; IN ULONG Status ; ) ; ; Routine Description: ; ; This function executes a breakpoint instruction. Useful for entering ; the debugger under program control. This breakpoint will always go to ; the kernel debugger if one is installed, otherwise it will go to the ; debug subsystem. This function is identical to DbgBreakPoint, except ; that it takes an argument which the debugger can see. ; ; Note: The debugger checks the address of the breakpoint instruction ; against the address RtlpBreakWithStatusInstruction. If it matches, ; we have a breakpoint with status. A breakpoint is normally issued ; with the break_debug_stop macro which generates two instructions. ; We can't use the macro here because of the "label on the breakpoint" ; requirement. ; ; Arguments: ; ; Status (ecx) - Supplies the break point status code. ; ; Return Value: ; ; None. ; ;-- altentry RtlpBreakWithStatusInstruction LEAF_ENTRY DbgBreakPointWithStatus, _TEXT$00 ALTERNATE_ENTRY RtlpBreakWithStatusInstruction int 3 ; break into debugger ret ; return LEAF_END DbgBreakPointWithStatus, _TEXT$00 subttl "Debug Print" ;++ ; ; NTSTATUS ; DebugPrint( ; IN PSTRING Output, ; IN ULONG ComponentId, ; IN ULONG Level ; ) ; ; Routine Description: ; ; This function executes a debug print breakpoint. ; ; Arguments: ; ; Output (rcx) - Supplies a pointer to the output string descriptor. ; ; ComponentId (edx) - Supplies the Id of the calling component. ; ; Level (r8d) - Supplies the output importance level. ; ; Return Value: ; ; STATUS_SUCCESS is returned if the debug print was completed successfully. ; ; STATUS_BREAKPOINT is returned if user typed a Control-C during print. ; ; STATUS_DEVICE_NOT_CONNECTED is returned if kernel debugger not present. ; ;-- LEAF_ENTRY DebugPrint, _TEXT$00 mov r9d, r8d ; set importance level mov r8d, edx ; set component id mov dx, StrLength[rcx] ; set length of output string mov rcx, StrBuffer[rcx] ; set address of output string mov eax, BREAKPOINT_PRINT ; set debug service type int 2dh ; call debug service int 3 ; required - do not remove ret ; return LEAF_END DebugPrint, _TEXT$00 subttl "Debug Prompt" ;++ ; ; ULONG ; DebugPrompt( ; IN PSTRING Output, ; IN PSTRING Input ; ) ; ; Routine Description: ; ; This function executes a debug prompt breakpoint. ; ; Arguments: ; ; Output (rcx) - Supplies a pointer to the output string descriptor. ; ; Input (rdx) - Supplies a pointer to the input string descriptor. ; ; Return Value: ; ; The length of the input string is returned as the function value. ; ;-- LEAF_ENTRY DebugPrompt, _TEXT$00 mov r9w, StrMaximumLength[rdx] ; set maximum length of input string mov r8, StrBuffer[rdx] ; set address of input string mov dx, StrLength[rcx] ; set length of output string mov rcx, StrBuffer[rcx] ; set address of output string mov eax, BREAKPOINT_PROMPT ; set debug service type int 2dh ; call debug service int 3 ; required - do not remove ret ; return LEAF_END DebugPrompt, _TEXT$00 ;++ ; ; VOID ; DebugService2( ; IN PVOID Param1, ; IN PVOID Param2, ; IN ULONG Service ; ) ; ; Routine Description: ; ; This function calls the kernel debugger to execute a command string. ; ; Arguments: ; ; Param1 (rcx) - Supplies the first parameter to the KD fault handler ; ; Param2 (rdx) - Supplies the second parameter to the KD fault handler ; ; Service (r8d) - Supplies a pointer to the command string. ; ; Return Value: ; ; None. ; ;-- LEAF_ENTRY DebugService2, _TEXT$00 mov eax, r8d ; set debug service type int 2dh ; call debug service int 3 ; required - do not remove ret ; return LEAF_END DebugService2, _TEXT$00 end
src/dos32a/text/client/strings.asm
amindlost/dos32a
5
18733
; ; Copyright (C) 1996-2006 by <NAME>. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions are ; met: ; ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; 3. The end-user documentation included with the redistribution, if any, ; must include the following acknowledgment: ; ; "This product uses DOS/32 Advanced DOS Extender technology." ; ; Alternately, this acknowledgment may appear in the software itself, if ; and wherever such third-party acknowledgments normally appear. ; ; 4. Products derived from this software may not be called "DOS/32A" or ; "DOS/32 Advanced". ; ; THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS" AND ANY EXPRESSED ; 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 AUTHORS OR COPYRIGHT HOLDERS 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. ; ; PushState .8086 ;============================================================================= ; report_error: displays error code(AX) and error message ; report_errorm: retreives error code from memory ; report_errorm: mov ax,cs:_err_code ; ; note: this function may autimatically terminate the client ; report_error: push bx ds cmp cs:_sel_ds,0 jnz @@1 mov ds,cs:_seg_ds jmp @@2 @@1: mov ds,cs:_sel_ds @@2: xor bx,bx @@3: cmp ah,g_errtab[bx] ; check Global error # jz @@4 ; if found, jump cmp bptr [bx],0FFh jz @@done add bx,4 jmp @@3 @@4: cmp g_errtab[bx+1],1 ; check if warning jnz @@5 ; if not, jump test _misc_byte,00000001b ; check if report warnings on jz @@done ; if not, done @@5: push ax cx dx push bx mov bl,g_errtab[bx+1] mov bh,0 mov cx,bx add bx,bx ; BX = error header # mov dx,h_errtab[bx] ; DX = Header error string pop bx push di si ; SI, DI = event. parameters mov si,wptr g_errtab[bx+2] ; SI = Local error offset mov bl,al mov bh,0 add bx,bx ; BX = Local error # mov di,[bx+si] ; DX = Local error string test di,di jz @@6 push ax call prints pop ax mov dx,di call prints call printcr @@6: pop si di cmp cl,1 jnz @@exit pop dx cx ax @@done: pop ds bx ret @@exit: mov al,-1 cmp _sel_cs,0 jnz @@0 jmp exit86 @@0: jmp exit386 .8086 ;============================================================================= ; display copyright message and version number ; copyright: test _misc_byte2,00001000b jz @@done mov ax,_version mov bx,offs ver_msg mov si,offs cpr_msg push ax mov al,ah aam add al,30h mov [bx+0],al pop ax aam add ax,3030h mov [bx+2],ah mov [bx+4],al mov cx,offs cpr_end - offs cpr_msg @@1: lodsb push cx xor bx,bx mov ah,0Eh int 10h pop cx loop @@1 @@done: ret .8086 ;============================================================================= ; Console I/O Routines (a la printf...) ;============================================================================= STRSIZE = 0100h @char db 0,0 @crlf db cre ;============================================================================= ; Print character in AL ; printc: push dx mov @char,al mov dx,offs @char jmp @prnt ;============================================================================= ; Print NewLine (CR,LF) ; printcr: push dx mov dx,offs @crlf @prnt: call prints pop dx ret ;============================================================================= ; Print string ; DX = offset ; ... = arguments pushed on stack ; prints: push ax bx cx dx si di bp ds es push ss pop es mov bp,sp sub sp,STRSIZE add bp,2*10 ; BP -> argument list mov si,dx ; DS:SI -> string mov di,sp ; ES:DI -> space for formatted string push di @@loop: lodsb cmp al,'%' jz @@args cmp al,'$' jnz @@next mov al,'?' @@next: stosb test al,al jnz @@loop pop di call writes add sp,STRSIZE pop es ds bp di si dx cx bx ax ret @@args: lodsb cmp al,'%' jz @@next cmp al,'c' ; char jz @@c cmp al,'s' ; string jz @@s cmp al,'b' ; byte jz @@b cmp al,'w' ; word jz @@w cmp al,'l' ; long jz @@l cmp al,'d' ; decimal jz @@d jmp @@next ; unrecognized @@c: mov al,[bp] add bp,2 jmp @@next @@s: mov bx,[bp] add bp,2 @@s0: mov al,[bx] inc bx test al,al jz @@loop cmp al,'$' jnz @@s1 mov al,'?' @@s1: stosb jmp @@s0 @@b: mov ah,[bp] add bp,2 mov cx,2 call @@hex jmp @@loop @@w: mov ax,[bp] add bp,2 mov cx,4 call @@hex jmp @@loop @@l: mov ax,[bp+2] mov cx,4 call @@hex mov ax,[bp] add bp,4 mov cx,4 call @@hex jmp @@loop @@d: mov ax,[bp] add bp,2 xor cx,cx call @@dec jmp @@loop @@hex: rol ax,4 mov bl,al and bl,0Fh add bl,30h cmp bl,39h jbe @@hex0 add bl,07h @@hex0: xchg ax,bx stosb xchg ax,bx loop @@hex ret @@dec: mov bx,10000 call @@dec0 mov bx,1000 call @@dec0 mov bx,100 call @@dec0 mov bx,10 call @@dec0 jmp @@dec2 @@dec0: xor dx,dx div bx test ax,ax jz @@dec1 inc cx @@dec1: test cx,cx jz @@dec3 @@dec2: add al,30h stosb @@dec3: mov ax,dx ret ;============================================================================= writes: xor al,al mov dx,di mov cx,-1 repne scasb dec di push es pop ds mov ax,0924h mov [di],al cmp cs:_sel_cs,0 jnz @@0 int 21h ret .386p ;----------------------------------------------------------------------------- @@0: push ebp sub esp,32h mov ebp,esp mov [ebp+1Ch],ax mov [ebp+14h],dx mov ax,cs:_seg_ss mov [ebp+24h],ax call int21h add esp,32h pop ebp ret .386p ;============================================================================= file_error: mov si,offs start jmp report_error file_errorm: mov si,offs start jmp report_errorm dos_error: mov si,ax mov ax,8002h jmp common_error dpmi_error: mov si,ax mov ax,8003h common_error: cli lss esp,fptr cs:_sel_esp jmp report_error PopState
libsrc/rect/r_IntersectRect8.asm
jpoikela/z88dk
640
2577
; Rectangle, Intervals and Points ; 05.2006 aralbrec SECTION code_clib PUBLIC r_IntersectRect8 PUBLIC _r_IntersectRect8 EXTERN RIntersectRect8 ; int r_IntersectRect8(struct r_Rect8 *r1, struct r_Rect8 *r2, struct r_Rect8 *result) .r_IntersectRect8 ._r_IntersectRect8 ld hl,7 add hl,sp ld d,(hl) dec hl ld e,(hl) dec hl push hl ex de,hl ld b,(hl) inc hl ld c,(hl) inc hl ld d,(hl) inc hl ld e,(hl) pop hl push de ld d,(hl) dec hl ld e,(hl) dec hl push hl ex de,hl ld d,(hl) inc hl ld e,(hl) inc hl push hl exx pop hl ld d,(hl) inc hl ld e,(hl) pop hl pop bc push hl exx call RIntersectRect8 pop hl jr nc, no ld d,(hl) dec hl ld e,(hl) ex de,hl ld (hl),b inc hl ld (hl),c inc hl push hl exx pop hl ld (hl),b inc hl ld (hl),c ld hl,1 ret .no ld hl,0 ret
oeis/104/A104583.asm
neoneye/loda-programs
11
1857
; A104583: Triangle read by rows: T(i,j) is the (i,j)-entry (1 <= j <= i) of the product A*B of the matrices A = [1; 3,1; 5,3,1; 7,5,3,1;...]; B = [1; 1,2; 1,2,1; 1,2,1,2; ...] (both infinite lower triangular matrices). ; Submitted by <NAME> ; 1,4,2,9,8,1,16,18,4,2,25,32,9,8,1,36,50,16,18,4,2,49,72,25,32,9,8,1,64,98,36,50,16,18,4,2,81,128,49,72,25,32,9,8,1,100,162,64,98,36,50,16,18,4,2,121,200,81,128,49,72,25,32,9,8,1,144,242,100,162,64,98,36,50,16,18 lpb $0 add $1,1 sub $0,$1 lpe sub $1,$0 mod $0,2 add $0,1 add $1,1 pow $1,2 mul $1,$0 mov $0,$1
models/hol/sygus/integer_benchmarks/max-3.als
johnwickerson/alloystar
2
4820
open max -------------------------------------------------------------------------------- -- Variables and Values -------------------------------------------------------------------------------- one sig X, Y, Z extends IntVar {} -------------------------------------------------------------------------------- -- Commands -------------------------------------------------------------------------------- run synthIntNodeI for 7 but -1..1 Int, 0 IntLit, 0 BoolLit, 0 BoolVar, 0 BinaryIntOp, 0 UnaryIntOp, 0 GT, 0 LT, 0 Xor, 0 Nand, 0 Nor, 0 BoolInvComp run synthIntNodeI for 0 but -1..1 Int, exactly 2 ITE, exactly 2 GTE
breakthrough.asm
glor/Breakthrough
0
94747
SECTION .text main: nop
UGEN/Parser/UGEN.g4
jbinko/UGEN
0
263
<gh_stars>0 // MIT License // Copyright (c) 2020 <NAME> // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. grammar UGEN; start : pattern* EOF ; pattern : ( TYPE )? IDENTIFIER ':' patternExprList ; patternExprList : patternExprOperatorPipe ( ',' patternExprOperatorPipe )* ; patternExprOperatorPipe : patternExprOperatorOptional ( '|' patternExprOperatorOptional )* ; patternExprOperatorOptional : patternExprTerm optionalFlag ; patternExprTerm : STRING_TUPLE | IDENTIFIER | '(' patternExprList ')' ; optionalFlag : '?'? ; TYPE : I N T E N T | E N T I T Y ; IDENTIFIER : LETTER ( LETTER | '0'..'9' | '-' )* ; STRING_TUPLE : '[' STRING ( ',' STRING )* ']' ; BLOCKCOMMENT : '/*' .*? '*/' -> skip ; LINECOMMENT : ( '//' ~[\r\n]* | '#' ~[\r\n]* ) -> skip ; WHITESPACE : [ \t]+ -> skip ; NEWLINE : ( '\r''\n'? | '\n' ) -> skip ; fragment STRING : (~(','|']'))+ ; fragment LETTER : 'A'..'Z' | 'a'..'z' | '_' ; fragment A : [aA]; fragment B : [bB]; fragment C : [cC]; fragment D : [dD]; fragment E : [eE]; fragment F : [fF]; fragment G : [gG]; fragment H : [hH]; fragment I : [iI]; fragment J : [jJ]; fragment K : [kK]; fragment L : [lL]; fragment M : [mM]; fragment N : [nN]; fragment O : [oO]; fragment P : [pP]; fragment Q : [qQ]; fragment R : [rR]; fragment S : [sS]; fragment T : [tT]; fragment U : [uU]; fragment V : [vV]; fragment W : [wW]; fragment X : [xX]; fragment Y : [yY]; fragment Z : [zZ];
3-mid/opengl/source/lean/opengl-frame_buffer.ads
charlie5/lace
20
29113
<reponame>charlie5/lace with openGL.Texture; package openGL.Frame_Buffer is type Item is tagged private; null_Buffer : constant Item; --------- --- Forge -- package Forge is function to_Frame_Buffer return Item; function to_Frame_Buffer (Width, Height : in Positive) return Item; end Forge; procedure destruct (Self : in out Item); -------------- --- Attributes -- subtype Buffer_Name is GL.GLuint; -- An openGL frame buffer 'Name'. function Name (Self : in Item) return Buffer_Name; function Texture (Self : in Item) return openGL.Texture.Object; procedure Texture_is (Self : in out Item; now : in openGL.Texture.Object); function is_complete (Self : in Item) return Boolean; -------------- --- Operations -- procedure enable (Self : in Item); procedure disable (Self : in Item); -- -- Unbind the frame buffer so rendering will return to the backbuffer. private type Item is tagged record Name : aliased buffer_Name; Texture : openGL.Texture.Object; end record; null_Buffer : constant Item := (Name => 0, Texture => openGL.Texture.null_Object); end openGL.Frame_Buffer;
test/asset/agda-stdlib-1.0/Relation/Unary/Closure/Preorder.agda
omega12345/agda-mode
5
9991
<gh_stars>1-10 ------------------------------------------------------------------------ -- The Agda standard library -- -- Closure of a unary relation with respect to a preorder ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary module Relation.Unary.Closure.Preorder {a r e} (P : Preorder a e r) where open Preorder P open import Relation.Unary using (Pred) -- Specialising the results proven generically in `Base`. import Relation.Unary.Closure.Base _∼_ as Base open Base public using (□; map; Closed) module _ {t} {T : Pred Carrier t} where reindex : ∀ {x y} → x ∼ y → □ T x → □ T y reindex = Base.reindex trans extract : ∀ {x} → □ T x → T x extract = Base.extract refl duplicate : ∀ {x} → □ T x → □ (□ T) x duplicate = Base.duplicate trans □-closed : ∀ {t} {T : Pred Carrier t} → Closed (□ T) □-closed = Base.□-closed trans
proglangs-learning/Agda/sv20/assign2/Second_old3.agda
helq/old_code
0
15790
<filename>proglangs-learning/Agda/sv20/assign2/Second_old3.agda module sv20.assign2.Second where open import sv20.assign2.SetTheory.Logic using (_⇔_; ¬_; _∧_; _∨_) renaming (_,_ to ⟨_,_⟩) open import sv20.assign2.SetTheory.ZAxioms using (𝓢; _⊆_; _∈_; _∉_; _≡_; _⊂_; sym; cong; subs; trans; proj₁; proj₂; empt; ext; union; pair; pow; sub; pem; sum) open import sv20.assign2.SetTheory.Algebra using (_∪_; _-_; _∩_) ∪-dist : (A B C : 𝓢) → A ∪ (B ∪ C) ≡ (A ∪ B) ∪ C ∪-dist = ? -- I could try going this route. This would prove certain things using -- ZFC and would be really neat but requires too much work.
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_636.asm
ljhsiun2/medusa
9
99020
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r13 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x340e, %rbp nop xor %rsi, %rsi mov $0x6162636465666768, %rdi movq %rdi, (%rbp) cmp %r13, %r13 lea addresses_D_ht+0x103e2, %rsi nop and %r11, %r11 movw $0x6162, (%rsi) nop sub $65288, %r13 lea addresses_UC_ht+0x17122, %rsi lea addresses_UC_ht+0x4f6b, %rdi clflush (%rsi) nop nop nop nop nop and %r10, %r10 mov $90, %rcx rep movsq nop nop nop nop and %r10, %r10 lea addresses_D_ht+0x11922, %rsi nop nop nop sub $55623, %rcx mov (%rsi), %di nop nop nop nop cmp %rdi, %rdi lea addresses_WC_ht+0x1dda2, %rcx nop nop nop nop nop and %rdi, %rdi movups (%rcx), %xmm0 vpextrq $0, %xmm0, %rdx nop sub %rdi, %rdi lea addresses_D_ht+0x2822, %rsi lea addresses_WT_ht+0x14d22, %rdi nop dec %r10 mov $43, %rcx rep movsq nop nop nop nop xor $20936, %r11 lea addresses_UC_ht+0x153e2, %r13 cmp $5996, %r11 movl $0x61626364, (%r13) nop nop nop nop nop xor %rdx, %rdx lea addresses_UC_ht+0x4d22, %rsi lea addresses_WC_ht+0x1bed2, %rdi nop nop nop add $43546, %r11 mov $81, %rcx rep movsb xor %rsi, %rsi lea addresses_WT_ht+0x10b3d, %rdx inc %rcx movb (%rdx), %r13b nop nop sub %rbp, %rbp lea addresses_D_ht+0x2a5a, %rsi clflush (%rsi) nop xor $30804, %r10 movl $0x61626364, (%rsi) and $7157, %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r13 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %rax push %rbp push %rbx // Faulty Load lea addresses_PSE+0x3122, %rax clflush (%rax) sub %r14, %r14 mov (%rax), %bx lea oracles, %r12 and $0xff, %rbx shlq $12, %rbx mov (%r12,%rbx,1), %rbx pop %rbx pop %rbp pop %rax pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_PSE', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_PSE', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 4, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
UpdateElement.asm
mbartling/lc3Game
1
12812
<reponame>mbartling/lc3Game .ORIG x3730 ; UpdateElement(char element, x, y) ; Will replace map location (x, y) with ascii element ; Inputs: R0 = element ; First element on stack = y (highest address) ; Second element on stack = x ; ; ouputs: None ; ; Assume R6 is stack pointer UpdateElement ; Save registers STR R0, R6, #0 ; Save R0 STR R1, R6, #-1 ; Save R1 STR R2, R6, #-2 ; Save R2 STR R3, R6, #-3 ; Save R3 LDR R0, R6, #1 ; Get x coordinate LDR R1, R6, #2 ; Get y coordinate ; Compute final store address as: y * 9 + x AND R2, R2, #0 ADD R2, R2, #9 ; Multiply y (R1) by 9 and store in R3 AND R3, R3, #0 MULT ADD R3, R3, R1 ADD R2, R2, #-1 BRp MULT ; Add offset (x) ADD R3, R3, R0 ; Add MAP location offset LEA R0, MAP LDR R0, R0, #0 ADD R3, R3, R0 ; Restore R0 LDR R0, R6, #0 ; Modify map STR R0, R3, #0 ; Restore registers LDR R0, R6, #0 LDR R1, R6, #-1 LDR R2, R6, #-2 LDR R3, R6, #-3 ; Move stack ; ADD R6, R6, #2 RET MAP .FILL x3600 .END
kernel/start.asm
sm5art/kernel
1
80608
;; kernel.asm ;; version 0.0.1 bits 32 ;nasm directive section .text ;multiboot spec align 4 dd 0x1BADB002 ;magic dd 0x00 ;flags dd - (0x1BADB002 + 0x00) ;checksum. m+f+c should be zero global inb inb: mov edx, [esp + 4] in al, dx ret global outb outb: mov al, [esp + 8] mov dx, [esp + 4] out dx, al ret global start extern k_main ;k_main is defined in the kernel.c file start: cli ; stop interrupts call k_main jmp $ ; halt the CPU ; This will set up our new segment registers. We need to do ; something special in order to set CS. We do what is called a ; far jump. A jump that includes a segment as well as an offset. ; This is declared in C as 'extern void gdt_flush();' global gdt_flush ; Allows the C code to link to this extern gp ; Says that '_gp' is in another file gdt_flush: lgdt [gp] ; Load the GDT with our '_gp' which is a special pointer mov ax, 0x10 ; 0x10 is the offset in the GDT to our data segment mov ds, ax mov es, ax mov fs, ax mov gs, ax mov ss, ax jmp 0x08:flush2 ; 0x08 is the offset to our code segment: Far jump! flush2: ret ; Returns back to the C code! ; Loads the IDT defined in '_idtp' into the processor. ; This is declared in C as 'extern void idt_load();' global idt_load extern idtp idt_load: lidt [idtp] ret
alloy4fun_models/trashltl/models/8/5TiY3wHZs8xKPEfkb.als
Kaixi26/org.alloytools.alloy
0
2554
open main pred id5TiY3wHZs8xKPEfkb_prop9 { always (all f:Protected | f not in Trash' and historically f not in Trash) } pred __repair { id5TiY3wHZs8xKPEfkb_prop9 } check __repair { id5TiY3wHZs8xKPEfkb_prop9 <=> prop9o }
audio/music/lakeofrage.asm
Dev727/ancientplatinum
28
169999
Music_LakeOfRage: musicheader 4, 1, Music_LakeOfRage_Ch1 musicheader 1, 2, Music_LakeOfRage_Ch2 musicheader 1, 3, Music_LakeOfRage_Ch3 musicheader 1, 4, Music_LakeOfRage_Ch4 Music_LakeOfRage_Ch1: tempo 144 volume $77 dutycycle $3 tone $0002 vibrato $8, $22 stereopanning $f0 notetype $c, $b4 octave 3 note D_, 6 note D_, 10 note D_, 6 note D_, 6 note E_, 4 Music_LakeOfRage_branch_ee6e9: intensity $b5 note F#, 6 note E_, 6 note D_, 4 octave 4 note D_, 6 note C_, 4 note E_, 2 note D_, 4 octave 3 note B_, 6 note G_, 2 notetype $8, $b5 note D_, 4 note G_, 4 note B_, 4 notetype $c, $b4 note D_, 3 note F#, 1 intensity $b7 note A_, 8 note F#, 4 note A_, 3 octave 4 note C#, 1 note D_, 12 notetype $8, $b4 octave 3 note C_, 4 octave 2 note B_, 4 note A_, 4 notetype $8, $b7 note A_, 12 notetype $c, $b7 octave 3 note C_, 12 intensity $b4 note E_, 4 note D_, 2 intensity $b7 octave 2 note A_, 10 intensity $b4 octave 3 note E_, 4 note D_, 3 note E_, 1 intensity $b7 note F#, 8 note D_, 6 note C_, 1 note E_, 1 note C_, 8 note E_, 6 note E_, 1 note G_, 1 note E_, 8 note G_, 6 note F#, 1 note G_, 1 intensity $a0 note A_, 7 intensity $a7 note A_, 7 note A_, 1 octave 4 note C_, 1 intensity $a0 note D_, 6 intensity $a7 note D_, 6 loopchannel 0, Music_LakeOfRage_branch_ee6e9 Music_LakeOfRage_Ch2: dutycycle $3 vibrato $20, $44 stereopanning $ff notetype $c, $90 octave 3 note G_, 8 intensity $97 note G_, 8 intensity $a0 note A_, 8 intensity $a7 note A_, 8 Music_LakeOfRage_branch_ee75e: notetype $8, $c7 octave 4 note D_, 16 octave 3 note A_, 4 octave 4 note D_, 4 note A_, 16 octave 5 note C_, 4 octave 4 note B_, 4 notetype $c, $c7 note G_, 12 note B_, 4 note A_, 3 note G_, 1 intensity $b0 note F#, 12 intensity $b7 note F#, 16 notetype $8, $c3 octave 3 note G_, 4 note F#, 4 note E_, 4 note C_, 15 notetype $c, $c3 octave 4 note C_, 1 note E_, 1 note G_, 1 note __, 1 note E_, 1 note G_, 1 intensity $c5 octave 5 note C_, 10 intensity $c3 octave 4 note A_, 4 note G_, 4 note F#, 4 note E_, 2 notetype $8, $c3 note D_, 4 note E_, 4 note F#, 4 notetype $8, $c7 note A_, 12 notetype $8, $c3 octave 3 note G_, 4 note F#, 4 note E_, 4 octave 4 note C_, 4 octave 3 note B_, 4 note A_, 4 octave 4 note E_, 4 note D_, 4 note C_, 4 note G_, 4 note F#, 4 note E_, 4 notetype $8, $c7 note F#, 16 note D_, 4 note F#, 4 notetype $c, $c7 note A_, 16 loopchannel 0, Music_LakeOfRage_branch_ee75e Music_LakeOfRage_Ch3: stereopanning $f notetype $c, $16 octave 3 note G_, 4 note __, 2 note G_, 4 note __, 6 note F#, 4 note __, 2 note F#, 4 note __, 2 note E_, 4 Music_LakeOfRage_branch_ee7d0: octave 3 note D_, 4 octave 2 note A_, 2 octave 3 note D_, 4 octave 2 note A_, 2 octave 3 note D_, 2 note E_, 2 note F_, 4 note C_, 2 note F_, 4 note C_, 2 note F_, 2 note F#, 2 note G_, 4 note D_, 2 note G_, 4 note D_, 2 note G_, 2 note B_, 2 note A_, 2 note D_, 2 note F#, 2 note A_, 4 note D_, 2 note E_, 2 note F#, 2 note A_, 2 note F#, 2 note A_, 2 octave 4 note D_, 4 octave 3 note A_, 2 octave 4 note D_, 2 note F#, 2 octave 3 note E_, 4 note C_, 2 note E_, 4 note C_, 2 note E_, 2 note C_, 2 note G_, 4 note C_, 2 note G_, 4 note C_, 2 note G_, 2 note C_, 2 note F#, 4 note D_, 2 note F#, 4 note D_, 2 note F#, 2 note D_, 2 note A_, 2 note D_, 2 note F#, 2 octave 4 note D_, 4 octave 3 note D_, 2 note E_, 2 note F#, 2 note G_, 4 note C_, 2 note G_, 4 note C_, 2 note G_, 2 note C_, 2 note G_, 4 note C_, 2 note G_, 4 note C_, 2 note G_, 2 note C_, 2 note F#, 4 note D_, 2 note F#, 4 note D_, 2 note F#, 2 note D_, 2 note D_, 4 octave 2 note A_, 2 octave 3 note D_, 4 octave 2 note A_, 2 octave 3 note D_, 2 octave 2 note A_, 2 loopchannel 0, Music_LakeOfRage_branch_ee7d0 Music_LakeOfRage_Ch4: stereopanning $f0 togglenoise $3 notetype $c Music_LakeOfRage_branch_ee83b: note D_, 2 note D_, 1 note D_, 1 note G_, 2 note D_, 2 note D_, 1 note D_, 1 note F#, 6 note D_, 2 note D_, 1 note D_, 1 note G_, 2 note D_, 2 note D_, 1 note D_, 1 note F#, 3 note D_, 1 note D_, 1 note D_, 1 loopchannel 0, Music_LakeOfRage_branch_ee83b
src/com/company/Minijava.g4
FCBayKunHYi/MiniJava-compiler
0
6921
grammar Minijava; goal : mainClassDeclaration classDeclaration* EOF ; mainClassDeclaration : 'class' ID mainClassBody ; classDeclaration : 'class' ID ('extends' type)? classBody ; mainClassBody : '{' mainMethod '}' ; mainMethod : mainMethodDeclaration '{' statement '}' ; mainMethodDeclaration : 'public' 'static' 'void' 'main' '(' 'String' '[' ']' ID ')' ; classBody : '{' fieldDeclaration* methodDeclaration* '}' ; fieldDeclaration : type ID ';' ; varDeclaration : type ID ';' ; methodDeclaration : ( 'public' type ID formalParameters /* illegal method declarations */ | type ID formalParameters {notifyErrorListeners("method declaration without public");} | 'public' ID formalParameters {notifyErrorListeners("method declaration without return type");} | 'public' type formalParameters {notifyErrorListeners("method declaration without method name");} | 'public' type ID {notifyErrorListeners("method declaration without argument list");} ) methodBody ; methodBody : '{' varDeclaration* statement+ '}' ; formalParameters : '(' formalParameterList? ')' ; formalParameterList : formalParameter (',' formalParameter)* ; formalParameter : type ID ; type : intArrayType | booleanType | intType | ID ; statement : '{' statement* '}' # nestedStatement | 'if' '(' expression ')' statement 'else' statement # ifElseStatement | 'while' '(' expression ')' statement # whileStatement | 'System.out.println' '(' expression ')' ';' # printStatement | ID '=' expression ';' # assignStatement | ID '[' expression ']' '=' expression ';' # arrayAssignStatement | 'return' expression ';' # returnStatement | 'recur' expression '?' methodArgumentList ':' expression ';' # recurStatement ; expression : expression '[' expression ']' # arrayAccessExpression | expression '.' 'length' # arrayLengthExpression | expression '.' ID methodArgumentList # methodCallExpression | '-' expression # negExpression | '!' expression # notExpression | 'new' 'int' '[' expression ']' # arrayInstantiationExpression | 'new' ID '(' ')' # objectInstantiationExpression | expression '+' expression # addExpression | expression '-' expression # subExpression | expression '*' expression # mulExpression | expression '<' expression # ltExpression | expression '&&' expression # andExpression | INT # intLitExpression | BOOL # booleanLitExpression | ID # identifierExpression | 'this' # thisExpression | '(' expression ')' # parenExpression ; methodArgumentList : '(' (expression (',' expression)*)? ')' ; intArrayType : 'int' '[' ']' ; booleanType : 'boolean' ; intType : 'int' ; INT : ('0' | [1-9][0-9]*) ; BOOL : 'true' | 'false' ; ID : [a-zA-Z_][0-9a-zA-Z_]* ; WS : [ \r\t\n]+ -> skip ; COMMENT : '/*' .*? '*/' -> skip ; LINE_COMMENT : '//' ~[\r\n]* -> skip ;
source/slim-messages-audg.adb
reznikmm/slimp
0
24073
-- Copyright (c) 2019 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Slim.Message_Visiters; with Ada.Numerics.Elementary_Functions; package body Slim.Messages.audg is List : constant Field_Description_Array := ((Uint_32_Field, 1), -- old_left (Uint_32_Field, 1), -- old_right (Uint_8_Field, 1), -- Digital volume control 0/1 (Uint_8_Field, 1), -- Preamp (byte 255-0) (Uint_32_Field, 1), -- new_left is 16.16 fixed point (Uint_32_Field, 1), -- new_right is 16.16 fixed point (Uint_32_Field, 1)); -- sequence ---------- -- Read -- ---------- overriding function Read (Data : not null access League.Stream_Element_Vectors.Stream_Element_Vector) return Audg_Message is begin return Result : Audg_Message do Read_Fields (Result, List, Data.all); end return; end Read; ---------------- -- Set_Volume -- ---------------- not overriding procedure Set_Volume (Self : in out Audg_Message; Value : Volume) is use Ada.Numerics.Elementary_Functions; use type Interfaces.Unsigned_32; Old_Gain : constant Interfaces.Unsigned_32 := Interfaces.Unsigned_32 (Value) * 128 / 100; dB : constant Float range -50.0 .. 0.0 := 50.0 / 101.0 * Float (Value - 100); Mult : constant Float := 10.0 ** (dB / 20.0); New_Gain : constant Interfaces.Unsigned_32 := (if dB >= -30.0 then Interfaces.Unsigned_32 (Mult * 256.0) * 256 else Interfaces.Unsigned_32 (Mult * 65536.0)); begin Self.Data_32 := (Old_Gain, Old_Gain, New_Gain, New_Gain, 0); Self.Data_8 := (1, 255); end Set_Volume; ----------- -- Visit -- ----------- overriding procedure Visit (Self : not null access Audg_Message; Visiter : in out Slim.Message_Visiters.Visiter'Class) is begin Visiter.audg (Self); end Visit; ----------- -- Write -- ----------- overriding procedure Write (Self : Audg_Message; Tag : out Message_Tag; Data : out League.Stream_Element_Vectors.Stream_Element_Vector) is begin Tag := "audg"; Write_Fields (Self, List, Data); end Write; end Slim.Messages.audg;
programs/oeis/332/A332124.asm
neoneye/loda
22
97623
; A332124: a(n) = 2*(10^(2n+1)-1)/9 + 2*10^n. ; 4,242,22422,2224222,222242222,22222422222,2222224222222,222222242222222,22222222422222222,2222222224222222222,222222222242222222222,22222222222422222222222,2222222222224222222222222,222222222222242222222222222,22222222222222422222222222222,2222222222222224222222222222222 mov $1,10 pow $1,$0 mul $1,10 add $1,5 bin $1,2 sub $1,105 div $1,45 mul $1,2 add $1,4 mov $0,$1
oeis/224/A224911.asm
neoneye/loda-programs
11
179581
<gh_stars>10-100 ; A224911: Greatest prime dividing A190339(n). ; Submitted by <NAME>(s3) ; 2,3,5,7,7,11,13,13,17,19,19,23,23,23,29,31,31,31,37,37,41,43,43,47,47,47,53,53,53,59,61,61,61,67,67,71,73,73,73,79,79,83,83,83,89,89,89,89,97,97,101,103,103,107,109,109,113,113,113,113,113,113,113,127,127,131,131 mul $0,2 trn $0,1 seq $0,151799 ; Version 2 of the "previous prime" function: largest prime < n.
src/SystemF/BigStep/Extrinsic/Semantics.agda
metaborg/ts.agda
0
2017
module SystemF.BigStep.Extrinsic.Semantics where open import Prelude hiding (⊥; id) open import Function as Fun using () open import Data.List hiding ([_]; monad) open import Data.List.Properties as ListProp using () open import Data.Fin.Substitution open import Extensions.List open import SystemF.BigStep.Types open import SystemF.BigStep.Extrinsic.Terms open import SystemF.BigStep.Extrinsic.Welltyped -- environments mutual Env : Set Env = List Val data Val : Set where unit : Val clos : Env → (t : Term) → Val tclos : Env → (t : Term) → Val open import Relation.Binary.List.Pointwise hiding (refl; map) mutual -- welltypedness relations between typing contexts and environmets -- is just the pointwise extension of value-welltypedness _⊢_ : ∀ {n} → Ctx n → Env → Set Γ ⊢ E = Rel (λ{ a v → ⊢̬ v ∶ a}) Γ E data ⊢̬_∶_ {n} : Val → Type n → Set where unit : ------------------- ⊢̬ unit ∶ Unit clos : ∀ {b t}{Γ : Ctx n}{E a} → (a ∷ Γ) ⊢ t ∶ b → Γ ⊢ E → ------------------- ⊢̬ clos E t ∶ (a ⇒ b) tclos : ∀ {a t}{Γ : Ctx n}{E} → (Γ ctx/ wk) ⊢ t ∶ a → Γ ⊢ E → --------------------- ⊢̬ tclos E t ∶ ∀' a module UglyBits where _wt/_ : ∀ {n m}{Γ : Ctx n}{t a} → Γ ⊢ t ∶ a → (ρ : Sub Type n m) → (Γ ctx/ ρ) ⊢ t ∶ (a / ρ) unit wt/ ρ = unit ƛ a t wt/ ρ = ƛ (a / ρ) (t wt/ ρ) var x wt/ ρ = var ([]=-map x) (f · e) wt/ ρ = (f wt/ ρ) · (e wt/ ρ) Λ t wt/ ρ = Λ (subst (λ Γ → Γ ⊢ _ ∶ _) (sym $ CtxLemmas.ctx/-wk-comm _ ρ) (t wt/ (ρ ↑))) (_[_] {a = a} t b) wt/ ρ = subst (λ a → _ ⊢ _ ∶ a) (sym $ Lemmas.sub-commutes a) ((t wt/ ρ) [ (b / ρ) ]) module StepIndexed where open UglyBits open import Level as Lev using () open import Data.Maybe open import Category.Monad open RawMonad (monad {f = Lev.zero}) -- quadratic return through the layered monad pattern just² x = just (just x) -- substitution-free semantics in double-layered maybe monad; -- distinguishing semantic errors from timeouts _⊢_⇓_ : ∀ (μ : Env) → Term → ℕ → Maybe (Maybe Val) μ ⊢ x ⇓ zero = nothing μ ⊢ unit ⇓ (suc n) = just² unit μ ⊢ ƛ t ⇓ (suc n) = just² (clos μ t) μ ⊢ Λ t ⇓ (suc n) = just² (tclos μ t ) μ ⊢ f · e ⇓ (suc n) with (μ ⊢ f ⇓ n) | μ ⊢ e ⇓ n -- timeout ... | nothing | _ = nothing ... | _ | nothing = nothing -- success ... | just² (clos μ' t) | just² v = (v ∷ μ') ⊢ t ⇓ n -- semantic errors & semantic error propagation ... | _ | _ = just nothing μ ⊢ t [-] ⇓ (suc n) with (μ ⊢ t ⇓ n) -- timeout ... | nothing = nothing -- success ... | just² (tclos μ' t') = μ' ⊢ t' ⇓ n -- semantic error (propagation) ... | _ = just nothing μ ⊢ var x ⇓ (suc n) = just (maybe-lookup x μ) -- extrinsic safety _⊢_⇓_ok : ∀ {n}{Γ : Ctx n}{μ : Env}{t a} → Γ ⊢ μ → Γ ⊢ t ∶ a → ∀ n → All (Any (λ v → ⊢̬ v ∶ a)) (μ ⊢ t ⇓ n) μ ⊢ x ⇓ zero ok = nothing μ ⊢ unit ⇓ suc n ok = just² unit μ ⊢ ƛ a x ⇓ suc n ok = just² (clos x μ) μ ⊢ Λ x ⇓ suc n ok = just² (tclos x μ) _⊢_⇓_ok {μ = E} μ (_·_ {f = f}{e = e} wtf wte) (suc n) with E ⊢ f ⇓ n | E ⊢ e ⇓ n | μ ⊢ wtf ⇓ n ok | μ ⊢ wte ⇓ n ok -- timeout ... | nothing | _ | _ | _ = nothing ... | just _ | nothing | _ | _ = nothing -- success ... | just² (clos μ' t) | just² v | just² (clos wtt wtμ') | just² px = (px ∷ wtμ') ⊢ wtt ⇓ n ok -- semantic error propagation ... | just nothing | _ | (just ()) | _ ... | _ | just nothing | _ | (just ()) -- semantic errors ... | just² (tclos _ _) | _ | just² () | _ ... | just² unit | _ | just² () | _ _⊢_⇓_ok {μ = E} μ (_[_] {f = f} wtf b) (suc n) with E ⊢ f ⇓ n | μ ⊢ wtf ⇓ n ok -- timeout ... | nothing | _ = nothing -- semantic errors ... | just nothing | (just ()) ... | just² unit | just² () ... | just² (clos x t) | just² () -- success ... | just² (tclos μ' t) | just² (tclos tok μ'ok) = μ'ok ⊢ subst (λ Γ → Γ ⊢ _ ∶ _) (CtxLemmas.ctx/-wk-sub≡id _ b) (tok wt/ (sub b)) ⇓ n ok μ ⊢ var x ⇓ suc n ok with pointwise-maybe-lookup μ x μ ⊢ var x ⇓ suc n ok | _ , is-just , p rewrite is-just = just² p module DelayMonad where open import Coinduction open import Category.Monad.Partiality open import Data.Maybe module _ where open Workaround _⊢lookup_ : Env → ℕ → Maybe Val [] ⊢lookup n = nothing (x ∷ μ) ⊢lookup zero = just x (x ∷ μ) ⊢lookup suc n = μ ⊢lookup n ret : ∀ {a} {A : Set a} → A → (Maybe A) ⊥P ret x = now (just x) -- substitution free semantics for SystemF _⊢_⇓P : ∀ (μ : Env) → Term → (Maybe Val) ⊥P μ ⊢ unit ⇓P = ret unit μ ⊢ ƛ t ⇓P = ret (clos μ t) μ ⊢ Λ t ⇓P = ret (tclos μ t ) μ ⊢ f · e ⇓P = μ ⊢ f ⇓P >>= λ{ (just (clos μ' t)) → μ ⊢ e ⇓P >>= (λ{ (just v) → later (♯ ((v ∷ μ') ⊢ t ⇓P)) ; nothing → now nothing }) ; _ → now nothing } μ ⊢ t [-] ⇓P = μ ⊢ t ⇓P >>= λ{ (just (tclos μ' t')) → later (♯ (μ' ⊢ t' ⇓P)) ; _ → now nothing } μ ⊢ var x ⇓P = now (μ ⊢lookup x) _⊢_⇓ : ∀ (μ : Env) → Term → (Maybe Val) ⊥ μ ⊢ t ⇓ = ⟦ μ ⊢ t ⇓P ⟧P {-} open import Category.Monad.Partiality.All open Alternative {-} module Compositional where private module Eq = Equality (_≡_) open import Level as Level open import Category.Monad open Eq hiding (_⇓) open RawMonad (monad {f = Level.zero}) _·⇓_ : ∀ (f e : Val ⊥) → Val ⊥ f ·⇓ e = f >>= λ{ (clos x t) → {!!} ; _ → now error } ·-comp : ∀ {μ f e} → (μ ⊢ f · e ⇓) ≅ ((μ ⊢ f ⇓) ·⇓ (μ ⊢ e ⇓)) ·-comp = {!!} -} module Safety where _⊢_⇓okP : ∀ {n}{Γ : Ctx n}{μ : Env}{t a} → Γ ⊢ μ → Γ ⊢ t ∶ a → AllP (λ v → ⊢̬ v ∶ a) (μ ⊢ t ⇓) μ ⊢ unit ⇓okP = now unit μ ⊢ ƛ a t₁ ⇓okP = now (clos t₁ μ) μ ⊢ var x ⇓okP = now {!!} μ ⊢ f · e ⇓okP = {!μ ⊢ f ⇓okP!} μ ⊢ Λ t₁ ⇓okP = {!!} μ ⊢ t [ b ] ⇓okP = {!!} -}
Tests/yasm-regression/far64.asm
13xforever/x86-assembly-textmate-bundle
69
7845
[bits 64] call far dword [0] ; out: ff 1c 25 00 00 00 00 call far qword [0] ; out: 48 ff 1c 25 00 00 00 00 call far [0] ; out: ff 1c 25 00 00 00 00 jmp far dword [0] ; out: ff 2c 25 00 00 00 00 jmp far qword [0] ; out: 48 ff 2c 25 00 00 00 00 jmp far [0] ; out: ff 2c 25 00 00 00 00
primsrv.asm
reutz19/xv6_ass2
1
98391
<reponame>reutz19/xv6_ass2 _primsrv: file format elf32-i386 Disassembly of section .text: 00000000 <is_prime>: else // even return next_pr(num-1); //become odd and return next_pr } */ int is_prime(int number) { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 10 sub $0x10,%esp int i; for (i = 2; (i*i) < number; i++) 6: c7 45 fc 02 00 00 00 movl $0x2,-0x4(%ebp) d: eb 20 jmp 2f <is_prime+0x2f> { if (number % i == 0 && i != number) f: 8b 45 08 mov 0x8(%ebp),%eax 12: 99 cltd 13: f7 7d fc idivl -0x4(%ebp) 16: 89 d0 mov %edx,%eax 18: 85 c0 test %eax,%eax 1a: 75 0f jne 2b <is_prime+0x2b> 1c: 8b 45 fc mov -0x4(%ebp),%eax 1f: 3b 45 08 cmp 0x8(%ebp),%eax 22: 74 07 je 2b <is_prime+0x2b> return 0; 24: b8 00 00 00 00 mov $0x0,%eax 29: eb 15 jmp 40 <is_prime+0x40> } */ int is_prime(int number) { int i; for (i = 2; (i*i) < number; i++) 2b: 83 45 fc 01 addl $0x1,-0x4(%ebp) 2f: 8b 45 fc mov -0x4(%ebp),%eax 32: 0f af 45 fc imul -0x4(%ebp),%eax 36: 3b 45 08 cmp 0x8(%ebp),%eax 39: 7c d4 jl f <is_prime+0xf> { if (number % i == 0 && i != number) return 0; } return 1; 3b: b8 01 00 00 00 mov $0x1,%eax } 40: c9 leave 41: c3 ret 00000042 <next_pr>: int next_pr(int n){ 42: 55 push %ebp 43: 89 e5 mov %esp,%ebp 45: 83 ec 14 sub $0x14,%esp int i = 0; 48: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) int found = 0; 4f: c7 45 f8 00 00 00 00 movl $0x0,-0x8(%ebp) for(i=n+1; !found ;i++){ 56: 8b 45 08 mov 0x8(%ebp),%eax 59: 83 c0 01 add $0x1,%eax 5c: 89 45 fc mov %eax,-0x4(%ebp) 5f: eb 18 jmp 79 <next_pr+0x37> if(is_prime(i)){ 61: 8b 45 fc mov -0x4(%ebp),%eax 64: 89 04 24 mov %eax,(%esp) 67: e8 94 ff ff ff call 0 <is_prime> 6c: 85 c0 test %eax,%eax 6e: 74 05 je 75 <next_pr+0x33> return i; 70: 8b 45 fc mov -0x4(%ebp),%eax 73: eb 0f jmp 84 <next_pr+0x42> } int next_pr(int n){ int i = 0; int found = 0; for(i=n+1; !found ;i++){ 75: 83 45 fc 01 addl $0x1,-0x4(%ebp) 79: 83 7d f8 00 cmpl $0x0,-0x8(%ebp) 7d: 74 e2 je 61 <next_pr+0x1f> if(is_prime(i)){ return i; } } return 0; 7f: b8 00 00 00 00 mov $0x0,%eax } 84: c9 leave 85: c3 ret 00000086 <handle_worker_sig>: void handle_worker_sig(int main_pid, int value) { 86: 55 push %ebp 87: 89 e5 mov %esp,%ebp 89: 83 ec 28 sub $0x28,%esp if (value == 0) { 8c: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 90: 75 05 jne 97 <handle_worker_sig+0x11> exit(); 92: e8 d6 06 00 00 call 76d <exit> } // get next prime int c = next_pr(value); 97: 8b 45 0c mov 0xc(%ebp),%eax 9a: 89 04 24 mov %eax,(%esp) 9d: e8 a0 ff ff ff call 42 <next_pr> a2: 89 45 f4 mov %eax,-0xc(%ebp) //return result to main proccess sigsend(main_pid, c); a5: 8b 45 f4 mov -0xc(%ebp),%eax a8: 89 44 24 04 mov %eax,0x4(%esp) ac: 8b 45 08 mov 0x8(%ebp),%eax af: 89 04 24 mov %eax,(%esp) b2: e8 5e 07 00 00 call 815 <sigsend> //pause until the next number //sigpause(); } b7: c9 leave b8: c3 ret 000000b9 <handle_main_sig>: void handle_main_sig(int worker_pid, int value) { b9: 55 push %ebp ba: 89 e5 mov %esp,%ebp bc: 83 ec 38 sub $0x38,%esp int i; for (i = 0; i < workers_number; i++) { bf: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) c6: eb 79 jmp 141 <handle_main_sig+0x88> if (workers[i].pid == worker_pid){ c8: 8b 0d 7c 10 00 00 mov 0x107c,%ecx ce: 8b 55 f4 mov -0xc(%ebp),%edx d1: 89 d0 mov %edx,%eax d3: 01 c0 add %eax,%eax d5: 01 d0 add %edx,%eax d7: c1 e0 02 shl $0x2,%eax da: 01 c8 add %ecx,%eax dc: 8b 00 mov (%eax),%eax de: 3b 45 08 cmp 0x8(%ebp),%eax e1: 75 5a jne 13d <handle_main_sig+0x84> printf(STDOUT, "worker %d returned %d as a result for %d", worker_pid, value, workers[i].input_x); e3: 8b 0d 7c 10 00 00 mov 0x107c,%ecx e9: 8b 55 f4 mov -0xc(%ebp),%edx ec: 89 d0 mov %edx,%eax ee: 01 c0 add %eax,%eax f0: 01 d0 add %edx,%eax f2: c1 e0 02 shl $0x2,%eax f5: 01 c8 add %ecx,%eax f7: 8b 40 04 mov 0x4(%eax),%eax fa: 89 44 24 10 mov %eax,0x10(%esp) fe: 8b 45 0c mov 0xc(%ebp),%eax 101: 89 44 24 0c mov %eax,0xc(%esp) 105: 8b 45 08 mov 0x8(%ebp),%eax 108: 89 44 24 08 mov %eax,0x8(%esp) 10c: c7 44 24 04 dc 0c 00 movl $0xcdc,0x4(%esp) 113: 00 114: c7 04 24 02 00 00 00 movl $0x2,(%esp) 11b: e8 ed 07 00 00 call 90d <printf> workers[i].working = 0; 120: 8b 0d 7c 10 00 00 mov 0x107c,%ecx 126: 8b 55 f4 mov -0xc(%ebp),%edx 129: 89 d0 mov %edx,%eax 12b: 01 c0 add %eax,%eax 12d: 01 d0 add %edx,%eax 12f: c1 e0 02 shl $0x2,%eax 132: 01 c8 add %ecx,%eax 134: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) break; 13b: eb 12 jmp 14f <handle_main_sig+0x96> void handle_main_sig(int worker_pid, int value) { int i; for (i = 0; i < workers_number; i++) { 13d: 83 45 f4 01 addl $0x1,-0xc(%ebp) 141: a1 78 10 00 00 mov 0x1078,%eax 146: 39 45 f4 cmp %eax,-0xc(%ebp) 149: 0f 8c 79 ff ff ff jl c8 <handle_main_sig+0xf> printf(STDOUT, "worker %d returned %d as a result for %d", worker_pid, value, workers[i].input_x); workers[i].working = 0; break; } } } 14f: c9 leave 150: c3 ret 00000151 <main>: int main(int argc, char *argv[]) { 151: 55 push %ebp 152: 89 e5 mov %esp,%ebp 154: 83 e4 f0 and $0xfffffff0,%esp 157: 81 ec 90 00 00 00 sub $0x90,%esp int i, pid, input_x; int toRun = 1; 15d: c7 84 24 88 00 00 00 movl $0x1,0x88(%esp) 164: 01 00 00 00 char buf[MAX_INPUT]; // validate arguments if (argc != 2) { 168: 83 7d 08 02 cmpl $0x2,0x8(%ebp) 16c: 74 19 je 187 <main+0x36> printf(STDOUT, "Unvaild parameter for primsrv test\n"); 16e: c7 44 24 04 08 0d 00 movl $0xd08,0x4(%esp) 175: 00 176: c7 04 24 02 00 00 00 movl $0x2,(%esp) 17d: e8 8b 07 00 00 call 90d <printf> exit(); 182: e8 e6 05 00 00 call 76d <exit> } // allocate workers array workers_number = atoi(argv[1]); 187: 8b 45 0c mov 0xc(%ebp),%eax 18a: 83 c0 04 add $0x4,%eax 18d: 8b 00 mov (%eax),%eax 18f: 89 04 24 mov %eax,(%esp) 192: e8 44 05 00 00 call 6db <atoi> 197: a3 78 10 00 00 mov %eax,0x1078 workers = (worker_s*) malloc(workers_number * sizeof(worker_s)); 19c: a1 78 10 00 00 mov 0x1078,%eax 1a1: 89 c2 mov %eax,%edx 1a3: 89 d0 mov %edx,%eax 1a5: 01 c0 add %eax,%eax 1a7: 01 d0 add %edx,%eax 1a9: c1 e0 02 shl $0x2,%eax 1ac: 89 04 24 mov %eax,(%esp) 1af: e8 45 0a 00 00 call bf9 <malloc> 1b4: a3 7c 10 00 00 mov %eax,0x107c // configure the main process with workers-handler inorder to pass it to son by fork() sigset((void *)handle_worker_sig); 1b9: c7 04 24 86 00 00 00 movl $0x86,(%esp) 1c0: e8 48 06 00 00 call 80d <sigset> printf(STDOUT, "workers pids:\n"); 1c5: c7 44 24 04 2c 0d 00 movl $0xd2c,0x4(%esp) 1cc: 00 1cd: c7 04 24 02 00 00 00 movl $0x2,(%esp) 1d4: e8 34 07 00 00 call 90d <printf> for(i = 0; i < workers_number; i++) { 1d9: c7 84 24 8c 00 00 00 movl $0x0,0x8c(%esp) 1e0: 00 00 00 00 1e4: e9 cd 00 00 00 jmp 2b6 <main+0x165> if ((pid = fork()) == 0) { // son 1e9: e8 77 05 00 00 call 765 <fork> 1ee: 89 84 24 84 00 00 00 mov %eax,0x84(%esp) 1f5: 83 bc 24 84 00 00 00 cmpl $0x0,0x84(%esp) 1fc: 00 1fd: 75 07 jne 206 <main+0xb5> while(1) sigpause(); 1ff: e8 21 06 00 00 call 825 <sigpause> 204: eb f9 jmp 1ff <main+0xae> } else if (pid > 0) { // father 206: 83 bc 24 84 00 00 00 cmpl $0x0,0x84(%esp) 20d: 00 20e: 0f 8e 89 00 00 00 jle 29d <main+0x14c> //init son worker_s printf(STDOUT, "%d\n", pid); 214: 8b 84 24 84 00 00 00 mov 0x84(%esp),%eax 21b: 89 44 24 08 mov %eax,0x8(%esp) 21f: c7 44 24 04 3b 0d 00 movl $0xd3b,0x4(%esp) 226: 00 227: c7 04 24 02 00 00 00 movl $0x2,(%esp) 22e: e8 da 06 00 00 call 90d <printf> workers[i].pid = pid; 233: 8b 0d 7c 10 00 00 mov 0x107c,%ecx 239: 8b 94 24 8c 00 00 00 mov 0x8c(%esp),%edx 240: 89 d0 mov %edx,%eax 242: 01 c0 add %eax,%eax 244: 01 d0 add %edx,%eax 246: c1 e0 02 shl $0x2,%eax 249: 8d 14 01 lea (%ecx,%eax,1),%edx 24c: 8b 84 24 84 00 00 00 mov 0x84(%esp),%eax 253: 89 02 mov %eax,(%edx) workers[i].input_x = -1; 255: 8b 0d 7c 10 00 00 mov 0x107c,%ecx 25b: 8b 94 24 8c 00 00 00 mov 0x8c(%esp),%edx 262: 89 d0 mov %edx,%eax 264: 01 c0 add %eax,%eax 266: 01 d0 add %edx,%eax 268: c1 e0 02 shl $0x2,%eax 26b: 01 c8 add %ecx,%eax 26d: c7 40 04 ff ff ff ff movl $0xffffffff,0x4(%eax) workers[i].working = 0; 274: 8b 0d 7c 10 00 00 mov 0x107c,%ecx 27a: 8b 94 24 8c 00 00 00 mov 0x8c(%esp),%edx 281: 89 d0 mov %edx,%eax 283: 01 c0 add %eax,%eax 285: 01 d0 add %edx,%eax 287: c1 e0 02 shl $0x2,%eax 28a: 01 c8 add %ecx,%eax 28c: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) // configure the main process with workers-handler inorder to pass it to son by fork() sigset((void *)handle_worker_sig); printf(STDOUT, "workers pids:\n"); for(i = 0; i < workers_number; i++) { 293: 83 84 24 8c 00 00 00 addl $0x1,0x8c(%esp) 29a: 01 29b: eb 19 jmp 2b6 <main+0x165> workers[i].pid = pid; workers[i].input_x = -1; workers[i].working = 0; } else { // fork failed printf(STDOUT, "fork() failed!\n"); 29d: c7 44 24 04 3f 0d 00 movl $0xd3f,0x4(%esp) 2a4: 00 2a5: c7 04 24 02 00 00 00 movl $0x2,(%esp) 2ac: e8 5c 06 00 00 call 90d <printf> exit(); 2b1: e8 b7 04 00 00 call 76d <exit> // configure the main process with workers-handler inorder to pass it to son by fork() sigset((void *)handle_worker_sig); printf(STDOUT, "workers pids:\n"); for(i = 0; i < workers_number; i++) { 2b6: a1 78 10 00 00 mov 0x1078,%eax 2bb: 39 84 24 8c 00 00 00 cmp %eax,0x8c(%esp) 2c2: 0f 8c 21 ff ff ff jl 1e9 <main+0x98> exit(); } } // configure the main process - correct handler sigset((void *)handle_main_sig); 2c8: c7 04 24 b9 00 00 00 movl $0xb9,(%esp) 2cf: e8 39 05 00 00 call 80d <sigset> while(toRun) 2d4: e9 d0 01 00 00 jmp 4a9 <main+0x358> { printf(STDOUT, "Please enter a number: "); 2d9: c7 44 24 04 4f 0d 00 movl $0xd4f,0x4(%esp) 2e0: 00 2e1: c7 04 24 02 00 00 00 movl $0x2,(%esp) 2e8: e8 20 06 00 00 call 90d <printf> read(1, buf, MAX_INPUT); 2ed: c7 44 24 08 64 00 00 movl $0x64,0x8(%esp) 2f4: 00 2f5: 8d 44 24 1c lea 0x1c(%esp),%eax 2f9: 89 44 24 04 mov %eax,0x4(%esp) 2fd: c7 04 24 01 00 00 00 movl $0x1,(%esp) 304: e8 7c 04 00 00 call 785 <read> if (buf[0] == '\n'){ 309: 0f b6 44 24 1c movzbl 0x1c(%esp),%eax 30e: 3c 0a cmp $0xa,%al 310: 75 05 jne 317 <main+0x1c6> //handle main signals by calling a system call //sigset((void *)handle_main_sig); continue; 312: e9 92 01 00 00 jmp 4a9 <main+0x358> } input_x = atoi(buf); 317: 8d 44 24 1c lea 0x1c(%esp),%eax 31b: 89 04 24 mov %eax,(%esp) 31e: e8 b8 03 00 00 call 6db <atoi> 323: 89 84 24 80 00 00 00 mov %eax,0x80(%esp) if(input_x != 0) 32a: 83 bc 24 80 00 00 00 cmpl $0x0,0x80(%esp) 331: 00 332: 0f 84 e5 00 00 00 je 41d <main+0x2cc> { // send input_x to process p using sigsend sys-call for (i = 0; i < workers_number; i++) 338: c7 84 24 8c 00 00 00 movl $0x0,0x8c(%esp) 33f: 00 00 00 00 343: e9 98 00 00 00 jmp 3e0 <main+0x28f> { if (workers[i].working == 0) // available 348: 8b 0d 7c 10 00 00 mov 0x107c,%ecx 34e: 8b 94 24 8c 00 00 00 mov 0x8c(%esp),%edx 355: 89 d0 mov %edx,%eax 357: 01 c0 add %eax,%eax 359: 01 d0 add %edx,%eax 35b: c1 e0 02 shl $0x2,%eax 35e: 01 c8 add %ecx,%eax 360: 8b 40 08 mov 0x8(%eax),%eax 363: 85 c0 test %eax,%eax 365: 75 71 jne 3d8 <main+0x287> { workers[i].working = 1; 367: 8b 0d 7c 10 00 00 mov 0x107c,%ecx 36d: 8b 94 24 8c 00 00 00 mov 0x8c(%esp),%edx 374: 89 d0 mov %edx,%eax 376: 01 c0 add %eax,%eax 378: 01 d0 add %edx,%eax 37a: c1 e0 02 shl $0x2,%eax 37d: 01 c8 add %ecx,%eax 37f: c7 40 08 01 00 00 00 movl $0x1,0x8(%eax) workers[i].input_x = input_x; 386: 8b 0d 7c 10 00 00 mov 0x107c,%ecx 38c: 8b 94 24 8c 00 00 00 mov 0x8c(%esp),%edx 393: 89 d0 mov %edx,%eax 395: 01 c0 add %eax,%eax 397: 01 d0 add %edx,%eax 399: c1 e0 02 shl $0x2,%eax 39c: 8d 14 01 lea (%ecx,%eax,1),%edx 39f: 8b 84 24 80 00 00 00 mov 0x80(%esp),%eax 3a6: 89 42 04 mov %eax,0x4(%edx) sigsend(workers[i].pid, input_x); 3a9: 8b 0d 7c 10 00 00 mov 0x107c,%ecx 3af: 8b 94 24 8c 00 00 00 mov 0x8c(%esp),%edx 3b6: 89 d0 mov %edx,%eax 3b8: 01 c0 add %eax,%eax 3ba: 01 d0 add %edx,%eax 3bc: c1 e0 02 shl $0x2,%eax 3bf: 01 c8 add %ecx,%eax 3c1: 8b 00 mov (%eax),%eax 3c3: 8b 94 24 80 00 00 00 mov 0x80(%esp),%edx 3ca: 89 54 24 04 mov %edx,0x4(%esp) 3ce: 89 04 24 mov %eax,(%esp) 3d1: e8 3f 04 00 00 call 815 <sigsend> break; 3d6: eb 1a jmp 3f2 <main+0x2a1> input_x = atoi(buf); if(input_x != 0) { // send input_x to process p using sigsend sys-call for (i = 0; i < workers_number; i++) 3d8: 83 84 24 8c 00 00 00 addl $0x1,0x8c(%esp) 3df: 01 3e0: a1 78 10 00 00 mov 0x1078,%eax 3e5: 39 84 24 8c 00 00 00 cmp %eax,0x8c(%esp) 3ec: 0f 8c 56 ff ff ff jl 348 <main+0x1f7> break; } } // no idle workers to handle signal if (i == workers_number){ 3f2: a1 78 10 00 00 mov 0x1078,%eax 3f7: 39 84 24 8c 00 00 00 cmp %eax,0x8c(%esp) 3fe: 0f 85 a5 00 00 00 jne 4a9 <main+0x358> printf(STDOUT, "no idle workers\n"); 404: c7 44 24 04 67 0d 00 movl $0xd67,0x4(%esp) 40b: 00 40c: c7 04 24 02 00 00 00 movl $0x2,(%esp) 413: e8 f5 04 00 00 call 90d <printf> 418: e9 8c 00 00 00 jmp 4a9 <main+0x358> } } else // input = 0, exiting program { for (i = 0; i < workers_number; i++) 41d: c7 84 24 8c 00 00 00 movl $0x0,0x8c(%esp) 424: 00 00 00 00 428: eb 64 jmp 48e <main+0x33d> { sigsend(workers[i].pid, 0); 42a: 8b 0d 7c 10 00 00 mov 0x107c,%ecx 430: 8b 94 24 8c 00 00 00 mov 0x8c(%esp),%edx 437: 89 d0 mov %edx,%eax 439: 01 c0 add %eax,%eax 43b: 01 d0 add %edx,%eax 43d: c1 e0 02 shl $0x2,%eax 440: 01 c8 add %ecx,%eax 442: 8b 00 mov (%eax),%eax 444: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 44b: 00 44c: 89 04 24 mov %eax,(%esp) 44f: e8 c1 03 00 00 call 815 <sigsend> printf(STDOUT, "worker %d exit\n", workers[i].pid); 454: 8b 0d 7c 10 00 00 mov 0x107c,%ecx 45a: 8b 94 24 8c 00 00 00 mov 0x8c(%esp),%edx 461: 89 d0 mov %edx,%eax 463: 01 c0 add %eax,%eax 465: 01 d0 add %edx,%eax 467: c1 e0 02 shl $0x2,%eax 46a: 01 c8 add %ecx,%eax 46c: 8b 00 mov (%eax),%eax 46e: 89 44 24 08 mov %eax,0x8(%esp) 472: c7 44 24 04 78 0d 00 movl $0xd78,0x4(%esp) 479: 00 47a: c7 04 24 02 00 00 00 movl $0x2,(%esp) 481: e8 87 04 00 00 call 90d <printf> } } else // input = 0, exiting program { for (i = 0; i < workers_number; i++) 486: 83 84 24 8c 00 00 00 addl $0x1,0x8c(%esp) 48d: 01 48e: a1 78 10 00 00 mov 0x1078,%eax 493: 39 84 24 8c 00 00 00 cmp %eax,0x8c(%esp) 49a: 7c 8e jl 42a <main+0x2d9> { sigsend(workers[i].pid, 0); printf(STDOUT, "worker %d exit\n", workers[i].pid); } toRun = 0; 49c: c7 84 24 88 00 00 00 movl $0x0,0x88(%esp) 4a3: 00 00 00 00 break; 4a7: eb 0e jmp 4b7 <main+0x366> } // configure the main process - correct handler sigset((void *)handle_main_sig); while(toRun) 4a9: 83 bc 24 88 00 00 00 cmpl $0x0,0x88(%esp) 4b0: 00 4b1: 0f 85 22 fe ff ff jne 2d9 <main+0x188> */ } } for(i = 0; i < workers_number; i++) 4b7: c7 84 24 8c 00 00 00 movl $0x0,0x8c(%esp) 4be: 00 00 00 00 4c2: eb 0d jmp 4d1 <main+0x380> wait(); 4c4: e8 ac 02 00 00 call 775 <wait> */ } } for(i = 0; i < workers_number; i++) 4c9: 83 84 24 8c 00 00 00 addl $0x1,0x8c(%esp) 4d0: 01 4d1: a1 78 10 00 00 mov 0x1078,%eax 4d6: 39 84 24 8c 00 00 00 cmp %eax,0x8c(%esp) 4dd: 7c e5 jl 4c4 <main+0x373> wait(); free(workers); 4df: a1 7c 10 00 00 mov 0x107c,%eax 4e4: 89 04 24 mov %eax,(%esp) 4e7: e8 d4 05 00 00 call ac0 <free> printf(STDOUT, "primsrv exit\n"); 4ec: c7 44 24 04 88 0d 00 movl $0xd88,0x4(%esp) 4f3: 00 4f4: c7 04 24 02 00 00 00 movl $0x2,(%esp) 4fb: e8 0d 04 00 00 call 90d <printf> exit(); 500: e8 68 02 00 00 call 76d <exit> 00000505 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 505: 55 push %ebp 506: 89 e5 mov %esp,%ebp 508: 57 push %edi 509: 53 push %ebx asm volatile("cld; rep stosb" : 50a: 8b 4d 08 mov 0x8(%ebp),%ecx 50d: 8b 55 10 mov 0x10(%ebp),%edx 510: 8b 45 0c mov 0xc(%ebp),%eax 513: 89 cb mov %ecx,%ebx 515: 89 df mov %ebx,%edi 517: 89 d1 mov %edx,%ecx 519: fc cld 51a: f3 aa rep stos %al,%es:(%edi) 51c: 89 ca mov %ecx,%edx 51e: 89 fb mov %edi,%ebx 520: 89 5d 08 mov %ebx,0x8(%ebp) 523: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 526: 5b pop %ebx 527: 5f pop %edi 528: 5d pop %ebp 529: c3 ret 0000052a <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 52a: 55 push %ebp 52b: 89 e5 mov %esp,%ebp 52d: 83 ec 10 sub $0x10,%esp char *os; os = s; 530: 8b 45 08 mov 0x8(%ebp),%eax 533: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 536: 90 nop 537: 8b 45 08 mov 0x8(%ebp),%eax 53a: 8d 50 01 lea 0x1(%eax),%edx 53d: 89 55 08 mov %edx,0x8(%ebp) 540: 8b 55 0c mov 0xc(%ebp),%edx 543: 8d 4a 01 lea 0x1(%edx),%ecx 546: 89 4d 0c mov %ecx,0xc(%ebp) 549: 0f b6 12 movzbl (%edx),%edx 54c: 88 10 mov %dl,(%eax) 54e: 0f b6 00 movzbl (%eax),%eax 551: 84 c0 test %al,%al 553: 75 e2 jne 537 <strcpy+0xd> ; return os; 555: 8b 45 fc mov -0x4(%ebp),%eax } 558: c9 leave 559: c3 ret 0000055a <strcmp>: int strcmp(const char *p, const char *q) { 55a: 55 push %ebp 55b: 89 e5 mov %esp,%ebp while(*p && *p == *q) 55d: eb 08 jmp 567 <strcmp+0xd> p++, q++; 55f: 83 45 08 01 addl $0x1,0x8(%ebp) 563: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 567: 8b 45 08 mov 0x8(%ebp),%eax 56a: 0f b6 00 movzbl (%eax),%eax 56d: 84 c0 test %al,%al 56f: 74 10 je 581 <strcmp+0x27> 571: 8b 45 08 mov 0x8(%ebp),%eax 574: 0f b6 10 movzbl (%eax),%edx 577: 8b 45 0c mov 0xc(%ebp),%eax 57a: 0f b6 00 movzbl (%eax),%eax 57d: 38 c2 cmp %al,%dl 57f: 74 de je 55f <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 581: 8b 45 08 mov 0x8(%ebp),%eax 584: 0f b6 00 movzbl (%eax),%eax 587: 0f b6 d0 movzbl %al,%edx 58a: 8b 45 0c mov 0xc(%ebp),%eax 58d: 0f b6 00 movzbl (%eax),%eax 590: 0f b6 c0 movzbl %al,%eax 593: 29 c2 sub %eax,%edx 595: 89 d0 mov %edx,%eax } 597: 5d pop %ebp 598: c3 ret 00000599 <strlen>: uint strlen(char *s) { 599: 55 push %ebp 59a: 89 e5 mov %esp,%ebp 59c: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 59f: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 5a6: eb 04 jmp 5ac <strlen+0x13> 5a8: 83 45 fc 01 addl $0x1,-0x4(%ebp) 5ac: 8b 55 fc mov -0x4(%ebp),%edx 5af: 8b 45 08 mov 0x8(%ebp),%eax 5b2: 01 d0 add %edx,%eax 5b4: 0f b6 00 movzbl (%eax),%eax 5b7: 84 c0 test %al,%al 5b9: 75 ed jne 5a8 <strlen+0xf> ; return n; 5bb: 8b 45 fc mov -0x4(%ebp),%eax } 5be: c9 leave 5bf: c3 ret 000005c0 <memset>: void* memset(void *dst, int c, uint n) { 5c0: 55 push %ebp 5c1: 89 e5 mov %esp,%ebp 5c3: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); 5c6: 8b 45 10 mov 0x10(%ebp),%eax 5c9: 89 44 24 08 mov %eax,0x8(%esp) 5cd: 8b 45 0c mov 0xc(%ebp),%eax 5d0: 89 44 24 04 mov %eax,0x4(%esp) 5d4: 8b 45 08 mov 0x8(%ebp),%eax 5d7: 89 04 24 mov %eax,(%esp) 5da: e8 26 ff ff ff call 505 <stosb> return dst; 5df: 8b 45 08 mov 0x8(%ebp),%eax } 5e2: c9 leave 5e3: c3 ret 000005e4 <strchr>: char* strchr(const char *s, char c) { 5e4: 55 push %ebp 5e5: 89 e5 mov %esp,%ebp 5e7: 83 ec 04 sub $0x4,%esp 5ea: 8b 45 0c mov 0xc(%ebp),%eax 5ed: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 5f0: eb 14 jmp 606 <strchr+0x22> if(*s == c) 5f2: 8b 45 08 mov 0x8(%ebp),%eax 5f5: 0f b6 00 movzbl (%eax),%eax 5f8: 3a 45 fc cmp -0x4(%ebp),%al 5fb: 75 05 jne 602 <strchr+0x1e> return (char*)s; 5fd: 8b 45 08 mov 0x8(%ebp),%eax 600: eb 13 jmp 615 <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 602: 83 45 08 01 addl $0x1,0x8(%ebp) 606: 8b 45 08 mov 0x8(%ebp),%eax 609: 0f b6 00 movzbl (%eax),%eax 60c: 84 c0 test %al,%al 60e: 75 e2 jne 5f2 <strchr+0xe> if(*s == c) return (char*)s; return 0; 610: b8 00 00 00 00 mov $0x0,%eax } 615: c9 leave 616: c3 ret 00000617 <gets>: char* gets(char *buf, int max) { 617: 55 push %ebp 618: 89 e5 mov %esp,%ebp 61a: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 61d: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 624: eb 4c jmp 672 <gets+0x5b> cc = read(0, &c, 1); 626: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 62d: 00 62e: 8d 45 ef lea -0x11(%ebp),%eax 631: 89 44 24 04 mov %eax,0x4(%esp) 635: c7 04 24 00 00 00 00 movl $0x0,(%esp) 63c: e8 44 01 00 00 call 785 <read> 641: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 644: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 648: 7f 02 jg 64c <gets+0x35> break; 64a: eb 31 jmp 67d <gets+0x66> buf[i++] = c; 64c: 8b 45 f4 mov -0xc(%ebp),%eax 64f: 8d 50 01 lea 0x1(%eax),%edx 652: 89 55 f4 mov %edx,-0xc(%ebp) 655: 89 c2 mov %eax,%edx 657: 8b 45 08 mov 0x8(%ebp),%eax 65a: 01 c2 add %eax,%edx 65c: 0f b6 45 ef movzbl -0x11(%ebp),%eax 660: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 662: 0f b6 45 ef movzbl -0x11(%ebp),%eax 666: 3c 0a cmp $0xa,%al 668: 74 13 je 67d <gets+0x66> 66a: 0f b6 45 ef movzbl -0x11(%ebp),%eax 66e: 3c 0d cmp $0xd,%al 670: 74 0b je 67d <gets+0x66> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 672: 8b 45 f4 mov -0xc(%ebp),%eax 675: 83 c0 01 add $0x1,%eax 678: 3b 45 0c cmp 0xc(%ebp),%eax 67b: 7c a9 jl 626 <gets+0xf> break; buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 67d: 8b 55 f4 mov -0xc(%ebp),%edx 680: 8b 45 08 mov 0x8(%ebp),%eax 683: 01 d0 add %edx,%eax 685: c6 00 00 movb $0x0,(%eax) return buf; 688: 8b 45 08 mov 0x8(%ebp),%eax } 68b: c9 leave 68c: c3 ret 0000068d <stat>: int stat(char *n, struct stat *st) { 68d: 55 push %ebp 68e: 89 e5 mov %esp,%ebp 690: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); 693: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 69a: 00 69b: 8b 45 08 mov 0x8(%ebp),%eax 69e: 89 04 24 mov %eax,(%esp) 6a1: e8 07 01 00 00 call 7ad <open> 6a6: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 6a9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 6ad: 79 07 jns 6b6 <stat+0x29> return -1; 6af: b8 ff ff ff ff mov $0xffffffff,%eax 6b4: eb 23 jmp 6d9 <stat+0x4c> r = fstat(fd, st); 6b6: 8b 45 0c mov 0xc(%ebp),%eax 6b9: 89 44 24 04 mov %eax,0x4(%esp) 6bd: 8b 45 f4 mov -0xc(%ebp),%eax 6c0: 89 04 24 mov %eax,(%esp) 6c3: e8 fd 00 00 00 call 7c5 <fstat> 6c8: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 6cb: 8b 45 f4 mov -0xc(%ebp),%eax 6ce: 89 04 24 mov %eax,(%esp) 6d1: e8 bf 00 00 00 call 795 <close> return r; 6d6: 8b 45 f0 mov -0x10(%ebp),%eax } 6d9: c9 leave 6da: c3 ret 000006db <atoi>: int atoi(const char *s) { 6db: 55 push %ebp 6dc: 89 e5 mov %esp,%ebp 6de: 83 ec 10 sub $0x10,%esp int n; n = 0; 6e1: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 6e8: eb 25 jmp 70f <atoi+0x34> n = n*10 + *s++ - '0'; 6ea: 8b 55 fc mov -0x4(%ebp),%edx 6ed: 89 d0 mov %edx,%eax 6ef: c1 e0 02 shl $0x2,%eax 6f2: 01 d0 add %edx,%eax 6f4: 01 c0 add %eax,%eax 6f6: 89 c1 mov %eax,%ecx 6f8: 8b 45 08 mov 0x8(%ebp),%eax 6fb: 8d 50 01 lea 0x1(%eax),%edx 6fe: 89 55 08 mov %edx,0x8(%ebp) 701: 0f b6 00 movzbl (%eax),%eax 704: 0f be c0 movsbl %al,%eax 707: 01 c8 add %ecx,%eax 709: 83 e8 30 sub $0x30,%eax 70c: 89 45 fc mov %eax,-0x4(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 70f: 8b 45 08 mov 0x8(%ebp),%eax 712: 0f b6 00 movzbl (%eax),%eax 715: 3c 2f cmp $0x2f,%al 717: 7e 0a jle 723 <atoi+0x48> 719: 8b 45 08 mov 0x8(%ebp),%eax 71c: 0f b6 00 movzbl (%eax),%eax 71f: 3c 39 cmp $0x39,%al 721: 7e c7 jle 6ea <atoi+0xf> n = n*10 + *s++ - '0'; return n; 723: 8b 45 fc mov -0x4(%ebp),%eax } 726: c9 leave 727: c3 ret 00000728 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 728: 55 push %ebp 729: 89 e5 mov %esp,%ebp 72b: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 72e: 8b 45 08 mov 0x8(%ebp),%eax 731: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 734: 8b 45 0c mov 0xc(%ebp),%eax 737: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 73a: eb 17 jmp 753 <memmove+0x2b> *dst++ = *src++; 73c: 8b 45 fc mov -0x4(%ebp),%eax 73f: 8d 50 01 lea 0x1(%eax),%edx 742: 89 55 fc mov %edx,-0x4(%ebp) 745: 8b 55 f8 mov -0x8(%ebp),%edx 748: 8d 4a 01 lea 0x1(%edx),%ecx 74b: 89 4d f8 mov %ecx,-0x8(%ebp) 74e: 0f b6 12 movzbl (%edx),%edx 751: 88 10 mov %dl,(%eax) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 753: 8b 45 10 mov 0x10(%ebp),%eax 756: 8d 50 ff lea -0x1(%eax),%edx 759: 89 55 10 mov %edx,0x10(%ebp) 75c: 85 c0 test %eax,%eax 75e: 7f dc jg 73c <memmove+0x14> *dst++ = *src++; return vdst; 760: 8b 45 08 mov 0x8(%ebp),%eax } 763: c9 leave 764: c3 ret 00000765 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 765: b8 01 00 00 00 mov $0x1,%eax 76a: cd 40 int $0x40 76c: c3 ret 0000076d <exit>: SYSCALL(exit) 76d: b8 02 00 00 00 mov $0x2,%eax 772: cd 40 int $0x40 774: c3 ret 00000775 <wait>: SYSCALL(wait) 775: b8 03 00 00 00 mov $0x3,%eax 77a: cd 40 int $0x40 77c: c3 ret 0000077d <pipe>: SYSCALL(pipe) 77d: b8 04 00 00 00 mov $0x4,%eax 782: cd 40 int $0x40 784: c3 ret 00000785 <read>: SYSCALL(read) 785: b8 05 00 00 00 mov $0x5,%eax 78a: cd 40 int $0x40 78c: c3 ret 0000078d <write>: SYSCALL(write) 78d: b8 10 00 00 00 mov $0x10,%eax 792: cd 40 int $0x40 794: c3 ret 00000795 <close>: SYSCALL(close) 795: b8 15 00 00 00 mov $0x15,%eax 79a: cd 40 int $0x40 79c: c3 ret 0000079d <kill>: SYSCALL(kill) 79d: b8 06 00 00 00 mov $0x6,%eax 7a2: cd 40 int $0x40 7a4: c3 ret 000007a5 <exec>: SYSCALL(exec) 7a5: b8 07 00 00 00 mov $0x7,%eax 7aa: cd 40 int $0x40 7ac: c3 ret 000007ad <open>: SYSCALL(open) 7ad: b8 0f 00 00 00 mov $0xf,%eax 7b2: cd 40 int $0x40 7b4: c3 ret 000007b5 <mknod>: SYSCALL(mknod) 7b5: b8 11 00 00 00 mov $0x11,%eax 7ba: cd 40 int $0x40 7bc: c3 ret 000007bd <unlink>: SYSCALL(unlink) 7bd: b8 12 00 00 00 mov $0x12,%eax 7c2: cd 40 int $0x40 7c4: c3 ret 000007c5 <fstat>: SYSCALL(fstat) 7c5: b8 08 00 00 00 mov $0x8,%eax 7ca: cd 40 int $0x40 7cc: c3 ret 000007cd <link>: SYSCALL(link) 7cd: b8 13 00 00 00 mov $0x13,%eax 7d2: cd 40 int $0x40 7d4: c3 ret 000007d5 <mkdir>: SYSCALL(mkdir) 7d5: b8 14 00 00 00 mov $0x14,%eax 7da: cd 40 int $0x40 7dc: c3 ret 000007dd <chdir>: SYSCALL(chdir) 7dd: b8 09 00 00 00 mov $0x9,%eax 7e2: cd 40 int $0x40 7e4: c3 ret 000007e5 <dup>: SYSCALL(dup) 7e5: b8 0a 00 00 00 mov $0xa,%eax 7ea: cd 40 int $0x40 7ec: c3 ret 000007ed <getpid>: SYSCALL(getpid) 7ed: b8 0b 00 00 00 mov $0xb,%eax 7f2: cd 40 int $0x40 7f4: c3 ret 000007f5 <sbrk>: SYSCALL(sbrk) 7f5: b8 0c 00 00 00 mov $0xc,%eax 7fa: cd 40 int $0x40 7fc: c3 ret 000007fd <sleep>: SYSCALL(sleep) 7fd: b8 0d 00 00 00 mov $0xd,%eax 802: cd 40 int $0x40 804: c3 ret 00000805 <uptime>: SYSCALL(uptime) 805: b8 0e 00 00 00 mov $0xe,%eax 80a: cd 40 int $0x40 80c: c3 ret 0000080d <sigset>: SYSCALL(sigset) 80d: b8 16 00 00 00 mov $0x16,%eax 812: cd 40 int $0x40 814: c3 ret 00000815 <sigsend>: SYSCALL(sigsend) 815: b8 17 00 00 00 mov $0x17,%eax 81a: cd 40 int $0x40 81c: c3 ret 0000081d <sigret>: SYSCALL(sigret) 81d: b8 18 00 00 00 mov $0x18,%eax 822: cd 40 int $0x40 824: c3 ret 00000825 <sigpause>: 825: b8 19 00 00 00 mov $0x19,%eax 82a: cd 40 int $0x40 82c: c3 ret 0000082d <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 82d: 55 push %ebp 82e: 89 e5 mov %esp,%ebp 830: 83 ec 18 sub $0x18,%esp 833: 8b 45 0c mov 0xc(%ebp),%eax 836: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 839: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 840: 00 841: 8d 45 f4 lea -0xc(%ebp),%eax 844: 89 44 24 04 mov %eax,0x4(%esp) 848: 8b 45 08 mov 0x8(%ebp),%eax 84b: 89 04 24 mov %eax,(%esp) 84e: e8 3a ff ff ff call 78d <write> } 853: c9 leave 854: c3 ret 00000855 <printint>: static void printint(int fd, int xx, int base, int sgn) { 855: 55 push %ebp 856: 89 e5 mov %esp,%ebp 858: 56 push %esi 859: 53 push %ebx 85a: 83 ec 30 sub $0x30,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 85d: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 864: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 868: 74 17 je 881 <printint+0x2c> 86a: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 86e: 79 11 jns 881 <printint+0x2c> neg = 1; 870: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 877: 8b 45 0c mov 0xc(%ebp),%eax 87a: f7 d8 neg %eax 87c: 89 45 ec mov %eax,-0x14(%ebp) 87f: eb 06 jmp 887 <printint+0x32> } else { x = xx; 881: 8b 45 0c mov 0xc(%ebp),%eax 884: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 887: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 88e: 8b 4d f4 mov -0xc(%ebp),%ecx 891: 8d 41 01 lea 0x1(%ecx),%eax 894: 89 45 f4 mov %eax,-0xc(%ebp) 897: 8b 5d 10 mov 0x10(%ebp),%ebx 89a: 8b 45 ec mov -0x14(%ebp),%eax 89d: ba 00 00 00 00 mov $0x0,%edx 8a2: f7 f3 div %ebx 8a4: 89 d0 mov %edx,%eax 8a6: 0f b6 80 64 10 00 00 movzbl 0x1064(%eax),%eax 8ad: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) }while((x /= base) != 0); 8b1: 8b 75 10 mov 0x10(%ebp),%esi 8b4: 8b 45 ec mov -0x14(%ebp),%eax 8b7: ba 00 00 00 00 mov $0x0,%edx 8bc: f7 f6 div %esi 8be: 89 45 ec mov %eax,-0x14(%ebp) 8c1: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 8c5: 75 c7 jne 88e <printint+0x39> if(neg) 8c7: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 8cb: 74 10 je 8dd <printint+0x88> buf[i++] = '-'; 8cd: 8b 45 f4 mov -0xc(%ebp),%eax 8d0: 8d 50 01 lea 0x1(%eax),%edx 8d3: 89 55 f4 mov %edx,-0xc(%ebp) 8d6: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) 8db: eb 1f jmp 8fc <printint+0xa7> 8dd: eb 1d jmp 8fc <printint+0xa7> putc(fd, buf[i]); 8df: 8d 55 dc lea -0x24(%ebp),%edx 8e2: 8b 45 f4 mov -0xc(%ebp),%eax 8e5: 01 d0 add %edx,%eax 8e7: 0f b6 00 movzbl (%eax),%eax 8ea: 0f be c0 movsbl %al,%eax 8ed: 89 44 24 04 mov %eax,0x4(%esp) 8f1: 8b 45 08 mov 0x8(%ebp),%eax 8f4: 89 04 24 mov %eax,(%esp) 8f7: e8 31 ff ff ff call 82d <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 8fc: 83 6d f4 01 subl $0x1,-0xc(%ebp) 900: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 904: 79 d9 jns 8df <printint+0x8a> putc(fd, buf[i]); } 906: 83 c4 30 add $0x30,%esp 909: 5b pop %ebx 90a: 5e pop %esi 90b: 5d pop %ebp 90c: c3 ret 0000090d <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 90d: 55 push %ebp 90e: 89 e5 mov %esp,%ebp 910: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 913: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 91a: 8d 45 0c lea 0xc(%ebp),%eax 91d: 83 c0 04 add $0x4,%eax 920: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 923: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 92a: e9 7c 01 00 00 jmp aab <printf+0x19e> c = fmt[i] & 0xff; 92f: 8b 55 0c mov 0xc(%ebp),%edx 932: 8b 45 f0 mov -0x10(%ebp),%eax 935: 01 d0 add %edx,%eax 937: 0f b6 00 movzbl (%eax),%eax 93a: 0f be c0 movsbl %al,%eax 93d: 25 ff 00 00 00 and $0xff,%eax 942: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 945: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 949: 75 2c jne 977 <printf+0x6a> if(c == '%'){ 94b: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 94f: 75 0c jne 95d <printf+0x50> state = '%'; 951: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 958: e9 4a 01 00 00 jmp aa7 <printf+0x19a> } else { putc(fd, c); 95d: 8b 45 e4 mov -0x1c(%ebp),%eax 960: 0f be c0 movsbl %al,%eax 963: 89 44 24 04 mov %eax,0x4(%esp) 967: 8b 45 08 mov 0x8(%ebp),%eax 96a: 89 04 24 mov %eax,(%esp) 96d: e8 bb fe ff ff call 82d <putc> 972: e9 30 01 00 00 jmp aa7 <printf+0x19a> } } else if(state == '%'){ 977: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 97b: 0f 85 26 01 00 00 jne aa7 <printf+0x19a> if(c == 'd'){ 981: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 985: 75 2d jne 9b4 <printf+0xa7> printint(fd, *ap, 10, 1); 987: 8b 45 e8 mov -0x18(%ebp),%eax 98a: 8b 00 mov (%eax),%eax 98c: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 993: 00 994: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 99b: 00 99c: 89 44 24 04 mov %eax,0x4(%esp) 9a0: 8b 45 08 mov 0x8(%ebp),%eax 9a3: 89 04 24 mov %eax,(%esp) 9a6: e8 aa fe ff ff call 855 <printint> ap++; 9ab: 83 45 e8 04 addl $0x4,-0x18(%ebp) 9af: e9 ec 00 00 00 jmp aa0 <printf+0x193> } else if(c == 'x' || c == 'p'){ 9b4: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 9b8: 74 06 je 9c0 <printf+0xb3> 9ba: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 9be: 75 2d jne 9ed <printf+0xe0> printint(fd, *ap, 16, 0); 9c0: 8b 45 e8 mov -0x18(%ebp),%eax 9c3: 8b 00 mov (%eax),%eax 9c5: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 9cc: 00 9cd: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 9d4: 00 9d5: 89 44 24 04 mov %eax,0x4(%esp) 9d9: 8b 45 08 mov 0x8(%ebp),%eax 9dc: 89 04 24 mov %eax,(%esp) 9df: e8 71 fe ff ff call 855 <printint> ap++; 9e4: 83 45 e8 04 addl $0x4,-0x18(%ebp) 9e8: e9 b3 00 00 00 jmp aa0 <printf+0x193> } else if(c == 's'){ 9ed: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 9f1: 75 45 jne a38 <printf+0x12b> s = (char*)*ap; 9f3: 8b 45 e8 mov -0x18(%ebp),%eax 9f6: 8b 00 mov (%eax),%eax 9f8: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 9fb: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 9ff: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) a03: 75 09 jne a0e <printf+0x101> s = "(null)"; a05: c7 45 f4 96 0d 00 00 movl $0xd96,-0xc(%ebp) while(*s != 0){ a0c: eb 1e jmp a2c <printf+0x11f> a0e: eb 1c jmp a2c <printf+0x11f> putc(fd, *s); a10: 8b 45 f4 mov -0xc(%ebp),%eax a13: 0f b6 00 movzbl (%eax),%eax a16: 0f be c0 movsbl %al,%eax a19: 89 44 24 04 mov %eax,0x4(%esp) a1d: 8b 45 08 mov 0x8(%ebp),%eax a20: 89 04 24 mov %eax,(%esp) a23: e8 05 fe ff ff call 82d <putc> s++; a28: 83 45 f4 01 addl $0x1,-0xc(%ebp) } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ a2c: 8b 45 f4 mov -0xc(%ebp),%eax a2f: 0f b6 00 movzbl (%eax),%eax a32: 84 c0 test %al,%al a34: 75 da jne a10 <printf+0x103> a36: eb 68 jmp aa0 <printf+0x193> putc(fd, *s); s++; } } else if(c == 'c'){ a38: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) a3c: 75 1d jne a5b <printf+0x14e> putc(fd, *ap); a3e: 8b 45 e8 mov -0x18(%ebp),%eax a41: 8b 00 mov (%eax),%eax a43: 0f be c0 movsbl %al,%eax a46: 89 44 24 04 mov %eax,0x4(%esp) a4a: 8b 45 08 mov 0x8(%ebp),%eax a4d: 89 04 24 mov %eax,(%esp) a50: e8 d8 fd ff ff call 82d <putc> ap++; a55: 83 45 e8 04 addl $0x4,-0x18(%ebp) a59: eb 45 jmp aa0 <printf+0x193> } else if(c == '%'){ a5b: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) a5f: 75 17 jne a78 <printf+0x16b> putc(fd, c); a61: 8b 45 e4 mov -0x1c(%ebp),%eax a64: 0f be c0 movsbl %al,%eax a67: 89 44 24 04 mov %eax,0x4(%esp) a6b: 8b 45 08 mov 0x8(%ebp),%eax a6e: 89 04 24 mov %eax,(%esp) a71: e8 b7 fd ff ff call 82d <putc> a76: eb 28 jmp aa0 <printf+0x193> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); a78: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) a7f: 00 a80: 8b 45 08 mov 0x8(%ebp),%eax a83: 89 04 24 mov %eax,(%esp) a86: e8 a2 fd ff ff call 82d <putc> putc(fd, c); a8b: 8b 45 e4 mov -0x1c(%ebp),%eax a8e: 0f be c0 movsbl %al,%eax a91: 89 44 24 04 mov %eax,0x4(%esp) a95: 8b 45 08 mov 0x8(%ebp),%eax a98: 89 04 24 mov %eax,(%esp) a9b: e8 8d fd ff ff call 82d <putc> } state = 0; aa0: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ aa7: 83 45 f0 01 addl $0x1,-0x10(%ebp) aab: 8b 55 0c mov 0xc(%ebp),%edx aae: 8b 45 f0 mov -0x10(%ebp),%eax ab1: 01 d0 add %edx,%eax ab3: 0f b6 00 movzbl (%eax),%eax ab6: 84 c0 test %al,%al ab8: 0f 85 71 fe ff ff jne 92f <printf+0x22> putc(fd, c); } state = 0; } } } abe: c9 leave abf: c3 ret 00000ac0 <free>: static Header base; static Header *freep; void free(void *ap) { ac0: 55 push %ebp ac1: 89 e5 mov %esp,%ebp ac3: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; ac6: 8b 45 08 mov 0x8(%ebp),%eax ac9: 83 e8 08 sub $0x8,%eax acc: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) acf: a1 88 10 00 00 mov 0x1088,%eax ad4: 89 45 fc mov %eax,-0x4(%ebp) ad7: eb 24 jmp afd <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) ad9: 8b 45 fc mov -0x4(%ebp),%eax adc: 8b 00 mov (%eax),%eax ade: 3b 45 fc cmp -0x4(%ebp),%eax ae1: 77 12 ja af5 <free+0x35> ae3: 8b 45 f8 mov -0x8(%ebp),%eax ae6: 3b 45 fc cmp -0x4(%ebp),%eax ae9: 77 24 ja b0f <free+0x4f> aeb: 8b 45 fc mov -0x4(%ebp),%eax aee: 8b 00 mov (%eax),%eax af0: 3b 45 f8 cmp -0x8(%ebp),%eax af3: 77 1a ja b0f <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) af5: 8b 45 fc mov -0x4(%ebp),%eax af8: 8b 00 mov (%eax),%eax afa: 89 45 fc mov %eax,-0x4(%ebp) afd: 8b 45 f8 mov -0x8(%ebp),%eax b00: 3b 45 fc cmp -0x4(%ebp),%eax b03: 76 d4 jbe ad9 <free+0x19> b05: 8b 45 fc mov -0x4(%ebp),%eax b08: 8b 00 mov (%eax),%eax b0a: 3b 45 f8 cmp -0x8(%ebp),%eax b0d: 76 ca jbe ad9 <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ b0f: 8b 45 f8 mov -0x8(%ebp),%eax b12: 8b 40 04 mov 0x4(%eax),%eax b15: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx b1c: 8b 45 f8 mov -0x8(%ebp),%eax b1f: 01 c2 add %eax,%edx b21: 8b 45 fc mov -0x4(%ebp),%eax b24: 8b 00 mov (%eax),%eax b26: 39 c2 cmp %eax,%edx b28: 75 24 jne b4e <free+0x8e> bp->s.size += p->s.ptr->s.size; b2a: 8b 45 f8 mov -0x8(%ebp),%eax b2d: 8b 50 04 mov 0x4(%eax),%edx b30: 8b 45 fc mov -0x4(%ebp),%eax b33: 8b 00 mov (%eax),%eax b35: 8b 40 04 mov 0x4(%eax),%eax b38: 01 c2 add %eax,%edx b3a: 8b 45 f8 mov -0x8(%ebp),%eax b3d: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; b40: 8b 45 fc mov -0x4(%ebp),%eax b43: 8b 00 mov (%eax),%eax b45: 8b 10 mov (%eax),%edx b47: 8b 45 f8 mov -0x8(%ebp),%eax b4a: 89 10 mov %edx,(%eax) b4c: eb 0a jmp b58 <free+0x98> } else bp->s.ptr = p->s.ptr; b4e: 8b 45 fc mov -0x4(%ebp),%eax b51: 8b 10 mov (%eax),%edx b53: 8b 45 f8 mov -0x8(%ebp),%eax b56: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ b58: 8b 45 fc mov -0x4(%ebp),%eax b5b: 8b 40 04 mov 0x4(%eax),%eax b5e: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx b65: 8b 45 fc mov -0x4(%ebp),%eax b68: 01 d0 add %edx,%eax b6a: 3b 45 f8 cmp -0x8(%ebp),%eax b6d: 75 20 jne b8f <free+0xcf> p->s.size += bp->s.size; b6f: 8b 45 fc mov -0x4(%ebp),%eax b72: 8b 50 04 mov 0x4(%eax),%edx b75: 8b 45 f8 mov -0x8(%ebp),%eax b78: 8b 40 04 mov 0x4(%eax),%eax b7b: 01 c2 add %eax,%edx b7d: 8b 45 fc mov -0x4(%ebp),%eax b80: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; b83: 8b 45 f8 mov -0x8(%ebp),%eax b86: 8b 10 mov (%eax),%edx b88: 8b 45 fc mov -0x4(%ebp),%eax b8b: 89 10 mov %edx,(%eax) b8d: eb 08 jmp b97 <free+0xd7> } else p->s.ptr = bp; b8f: 8b 45 fc mov -0x4(%ebp),%eax b92: 8b 55 f8 mov -0x8(%ebp),%edx b95: 89 10 mov %edx,(%eax) freep = p; b97: 8b 45 fc mov -0x4(%ebp),%eax b9a: a3 88 10 00 00 mov %eax,0x1088 } b9f: c9 leave ba0: c3 ret 00000ba1 <morecore>: static Header* morecore(uint nu) { ba1: 55 push %ebp ba2: 89 e5 mov %esp,%ebp ba4: 83 ec 28 sub $0x28,%esp char *p; Header *hp; if(nu < 4096) ba7: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) bae: 77 07 ja bb7 <morecore+0x16> nu = 4096; bb0: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); bb7: 8b 45 08 mov 0x8(%ebp),%eax bba: c1 e0 03 shl $0x3,%eax bbd: 89 04 24 mov %eax,(%esp) bc0: e8 30 fc ff ff call 7f5 <sbrk> bc5: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) bc8: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) bcc: 75 07 jne bd5 <morecore+0x34> return 0; bce: b8 00 00 00 00 mov $0x0,%eax bd3: eb 22 jmp bf7 <morecore+0x56> hp = (Header*)p; bd5: 8b 45 f4 mov -0xc(%ebp),%eax bd8: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; bdb: 8b 45 f0 mov -0x10(%ebp),%eax bde: 8b 55 08 mov 0x8(%ebp),%edx be1: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); be4: 8b 45 f0 mov -0x10(%ebp),%eax be7: 83 c0 08 add $0x8,%eax bea: 89 04 24 mov %eax,(%esp) bed: e8 ce fe ff ff call ac0 <free> return freep; bf2: a1 88 10 00 00 mov 0x1088,%eax } bf7: c9 leave bf8: c3 ret 00000bf9 <malloc>: void* malloc(uint nbytes) { bf9: 55 push %ebp bfa: 89 e5 mov %esp,%ebp bfc: 83 ec 28 sub $0x28,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; bff: 8b 45 08 mov 0x8(%ebp),%eax c02: 83 c0 07 add $0x7,%eax c05: c1 e8 03 shr $0x3,%eax c08: 83 c0 01 add $0x1,%eax c0b: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ c0e: a1 88 10 00 00 mov 0x1088,%eax c13: 89 45 f0 mov %eax,-0x10(%ebp) c16: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) c1a: 75 23 jne c3f <malloc+0x46> base.s.ptr = freep = prevp = &base; c1c: c7 45 f0 80 10 00 00 movl $0x1080,-0x10(%ebp) c23: 8b 45 f0 mov -0x10(%ebp),%eax c26: a3 88 10 00 00 mov %eax,0x1088 c2b: a1 88 10 00 00 mov 0x1088,%eax c30: a3 80 10 00 00 mov %eax,0x1080 base.s.size = 0; c35: c7 05 84 10 00 00 00 movl $0x0,0x1084 c3c: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ c3f: 8b 45 f0 mov -0x10(%ebp),%eax c42: 8b 00 mov (%eax),%eax c44: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ c47: 8b 45 f4 mov -0xc(%ebp),%eax c4a: 8b 40 04 mov 0x4(%eax),%eax c4d: 3b 45 ec cmp -0x14(%ebp),%eax c50: 72 4d jb c9f <malloc+0xa6> if(p->s.size == nunits) c52: 8b 45 f4 mov -0xc(%ebp),%eax c55: 8b 40 04 mov 0x4(%eax),%eax c58: 3b 45 ec cmp -0x14(%ebp),%eax c5b: 75 0c jne c69 <malloc+0x70> prevp->s.ptr = p->s.ptr; c5d: 8b 45 f4 mov -0xc(%ebp),%eax c60: 8b 10 mov (%eax),%edx c62: 8b 45 f0 mov -0x10(%ebp),%eax c65: 89 10 mov %edx,(%eax) c67: eb 26 jmp c8f <malloc+0x96> else { p->s.size -= nunits; c69: 8b 45 f4 mov -0xc(%ebp),%eax c6c: 8b 40 04 mov 0x4(%eax),%eax c6f: 2b 45 ec sub -0x14(%ebp),%eax c72: 89 c2 mov %eax,%edx c74: 8b 45 f4 mov -0xc(%ebp),%eax c77: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; c7a: 8b 45 f4 mov -0xc(%ebp),%eax c7d: 8b 40 04 mov 0x4(%eax),%eax c80: c1 e0 03 shl $0x3,%eax c83: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; c86: 8b 45 f4 mov -0xc(%ebp),%eax c89: 8b 55 ec mov -0x14(%ebp),%edx c8c: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; c8f: 8b 45 f0 mov -0x10(%ebp),%eax c92: a3 88 10 00 00 mov %eax,0x1088 return (void*)(p + 1); c97: 8b 45 f4 mov -0xc(%ebp),%eax c9a: 83 c0 08 add $0x8,%eax c9d: eb 38 jmp cd7 <malloc+0xde> } if(p == freep) c9f: a1 88 10 00 00 mov 0x1088,%eax ca4: 39 45 f4 cmp %eax,-0xc(%ebp) ca7: 75 1b jne cc4 <malloc+0xcb> if((p = morecore(nunits)) == 0) ca9: 8b 45 ec mov -0x14(%ebp),%eax cac: 89 04 24 mov %eax,(%esp) caf: e8 ed fe ff ff call ba1 <morecore> cb4: 89 45 f4 mov %eax,-0xc(%ebp) cb7: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) cbb: 75 07 jne cc4 <malloc+0xcb> return 0; cbd: b8 00 00 00 00 mov $0x0,%eax cc2: eb 13 jmp cd7 <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){ cc4: 8b 45 f4 mov -0xc(%ebp),%eax cc7: 89 45 f0 mov %eax,-0x10(%ebp) cca: 8b 45 f4 mov -0xc(%ebp),%eax ccd: 8b 00 mov (%eax),%eax ccf: 89 45 f4 mov %eax,-0xc(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } cd2: e9 70 ff ff ff jmp c47 <malloc+0x4e> } cd7: c9 leave cd8: c3 ret
Sets/Cardinality/Countable/Definition.agda
Smaug123/agdaproofs
4
8452
<filename>Sets/Cardinality/Countable/Definition.agda {-# OPTIONS --safe --warning=error --without-K #-} open import Functions.Definition open import Numbers.Naturals.Semiring open import Sets.Cardinality.Finite.Definition module Sets.Cardinality.Countable.Definition where record CountablyInfiniteSet {a : _} (A : Set a) : Set a where field counting : A → ℕ countingIsBij : Bijection counting data Countable {a : _} (A : Set a) : Set a where finite : FiniteSet A → Countable A infinite : CountablyInfiniteSet A → Countable A
programs/oeis/086/A086950.asm
neoneye/loda
22
2462
; A086950: Binomial transform of decagonal numbers A001107. ; 0,1,12,60,224,720,2112,5824,15360,39168,97280,236544,565248,1331200,3096576,7127040,16252928,36765696,82575360,184287232,408944640,902823936,1983905792,4341104640,9462349824,20552089600,44493176832,96032784384,206695301120,443723808768,950261514240,2030445789184,4329327034368,9212704849920,19567871000576,41489384079360,87823491268608,185611306663936,391701017395200,825458354552832,1737228371886080,3651478115844096,7665795068854272,16074859998085120,33671444089012224,70456705107886080,147281781563850752,307581780800569344,641762946900295680,1337850564305747968,2786602269435494400,5799510420146356224,12060639802098188288,25062531926316810240,52043597293893451776,107996319064344494080,223955002269880025088,464122963198293835776,961248304465958666240,1989654286575266168832,4115929771446443704320,8509713625503137529856,17584358788263630077952,36317027395115679744000,74967567915555617767424,154675949058054590300160,318981098522585566543872,657515745763303257800704,1354728884773229470679040,2790033147660422262816768,5743578234790205991157760,11818902715002004558577664,24310742653812933560107008,49986249221175194586972160,102739805201312001269170176,211089781784273141052211200,433551022059296387779002368,890147192554996644200841216,1826989144892608340274708480,3748576735170061413470175232,7688768212749041551131279360,15765601613594379067343241216,32317005009938267098245496832,66224956398489386190404321280,135670491180432144502225895424,277859510380226369514467491840,568910819304087572583328776192,1164514720705266157344169918464,2383034575624357029180814131200,4875317359715648867621475975168,9971607016443738114312445624320,20390110387069498507863475093504,41683917002817324616403310870528,85195033503619870518557729095680,174084080084467315777414444875776,355635414485904045373020407070720,726363793930775447057610936680448,1483230430429542664088736294240256,3028100371295182982825249781841920,6180747414062789504347550653612032 mov $1,2 mov $2,$0 mul $0,2 bin $0,2 pow $1,$2 mul $0,$1 div $0,2
programs/oeis/275/A275990.asm
neoneye/loda
22
168982
; A275990: a(n) = prime(prime(n)-1) - prime(n). ; 0,0,2,6,18,24,36,42,56,78,82,114,132,138,152,186,212,220,250,278,286,318,338,368,406,440,454,470,484,500,574,602,632,648,708,712,754,790,816,848,882,888,960,970,996,1014,1080,1176,1202,1210,1226,1254,1270,1332,1362,1404 seq $0,40976 ; a(n) = prime(n) - 2. mov $1,50000000000 sub $1,$0 seq $0,40 ; The prime numbers. add $0,$1 sub $0,50000000002
kernel/arch/i386/boot/boot.asm
OfficialExedo/AtomOS
2
22174
<filename>kernel/arch/i386/boot/boot.asm ; Multiboot constats ; Declare constants for the multiboot header. MBALIGN equ 1 << 0 ; align loaded modules on page boundaries MEMINFO equ 1 << 1 ; provide memory map FLAGS equ MBALIGN | MEMINFO ; this is the Multiboot 'flag' field MAGIC equ 0x1BADB002 ; 'magic number' lets bootloader find the header CHECKSUM equ -(MAGIC + FLAGS) ; checksum of above, to prove we are multiboot STACK_SIZE equ 16384 VM_BASE equ 0xC0000000 PDE_INDEX equ (VM_BASE >> 22) PSE_BIT equ 0x00000010 PG_BIT equ 0x80000000 bits 32 ; Reserve stack size section .bss align 4 stack_bottom: resb STACK_SIZE stack_top: section .lowerhalf ; Used to tell linker this should be placed in lower half of mem ; Multiboot header align 4 boot_header: dd MAGIC dd FLAGS dd CHECKSUM ; Set up temporary page table for higher-half ; Later changed by our virtual memory manager global TMP_PG_DIR align 4096 ; Align to page boundaries TMP_PG_DIR: ; Identity map the first 4 MB ; Needed to avoid triple faulting on paging enable ; Later this will be unmapped by our virtual memory manager dd 0x00000083 ; Page table entry: kernel, write enabled, present, mapped to address 0, but 7 is set to tell the CPU this is a 4 MB page times (PDE_INDEX - 1) dd 0 ; Fill with 0s until the next entry dd 0x00000083 ; Same as above, maps 0xC0000000 to physical address 0 times (1024 - PDE_INDEX - 1) dd 0 ; Fill up the rest of the table with 0 align 4 extern kernel_main global _start _start: ; Update page directory ; ecx is our working register as eax and ebx are used by multiboo mov ecx, TMP_PG_DIR mov cr3, ecx ; Enable 4 MB pages, gets changed later but simplifies our life right now mov ecx, cr4 or ecx, PSE_BIT mov cr4, ecx ; Enable paging mov ecx, cr0 or ecx, PG_BIT mov cr0, ecx ; Set up the stack mov esp, stack_top ; Push multiboot data to the stack for our kernel push eax push ebx ; Pass control over to the kernel call kernel_main ; Hang if we somehow get here cli hlt jmp $
attic/asis/find_all/adam-assist-query-find_all.ads
charlie5/aIDE
3
4754
package AdaM.Assist.Query.find_All is end AdaM.Assist.Query.find_All;
PRG/levels/Ice/Unused7E.asm
narfman0/smb3_pp1
0
9079
<gh_stars>0 ; Original address was $B911 ; "Unused level 7" exit pipe area with unused grass .word $0000 ; Alternate level layout .word $0000 ; Alternate object layout .byte LEVEL1_SIZE_02 | LEVEL1_YSTART_170 .byte LEVEL2_BGPAL_00 | LEVEL2_OBJPAL_08 | LEVEL2_XSTART_18 | LEVEL2_UNUSEDFLAG .byte LEVEL3_TILESET_00 | LEVEL3_VSCROLL_LOCKED .byte LEVEL4_BGBANK_INDEX(12) | LEVEL4_INITACT_NOTHING .byte LEVEL5_BGM_OVERWORLD | LEVEL5_TIME_300 .byte $14, $02, $C2, $15, $08, $C2, $19, $01, $41, $19, $04, $42, $38, $08, $A1, $40 .byte $0C, $09, $1A, $00, $10, $20, $FF
llvm-gcc-4.2-2.9/gcc/ada/s-bitops.ads
vidkidz/crossbridge
1
975
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . B I T _ O P S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Operations on packed bit strings with System; package System.Bit_Ops is -- Note: in all the following routines, the System.Address parameters -- represent the address of the first byte of an array used to represent -- a packed array (of type System.Unsigned_Types.Packed_Bytes{1,2,4}) -- The length in bits is passed as a separate parameter. Note that all -- addresses must be of byte aligned arrays. procedure Bit_And (Left : System.Address; Llen : Natural; Right : System.Address; Rlen : Natural; Result : System.Address); -- Bitwise "and" of given bit string with result being placed in Result. -- The and operation is allowed to destroy unused bits in the last byte, -- i.e. to leave them set in an undefined manner. Note that Left, Right -- and Result always have the same length in bits (Len). function Bit_Eq (Left : System.Address; Llen : Natural; Right : System.Address; Rlen : Natural) return Boolean; -- Left and Right are the addresses of two bit packed arrays with Llen -- and Rlen being the respective length in bits. The routine compares the -- two bit strings for equality, being careful not to include the unused -- bits in the final byte. Note that the result is always False if Rlen -- is not equal to Llen. procedure Bit_Not (Opnd : System.Address; Len : Natural; Result : System.Address); -- Bitwise "not" of given bit string with result being placed in Result. -- The not operation is allowed to destroy unused bits in the last byte, -- i.e. to leave them set in an undefined manner. Note that Result and -- Opnd always have the same length in bits (Len). procedure Bit_Or (Left : System.Address; Llen : Natural; Right : System.Address; Rlen : Natural; Result : System.Address); -- Bitwise "or" of given bit string with result being placed in Result. -- The or operation is allowed to destroy unused bits in the last byte, -- i.e. to leave them set in an undefined manner. Note that Left, Right -- and Result always have the same length in bits (Len). procedure Bit_Xor (Left : System.Address; Llen : Natural; Right : System.Address; Rlen : Natural; Result : System.Address); -- Bitwise "xor" of given bit string with result being placed in Result. -- The xor operation is allowed to destroy unused bits in the last byte, -- i.e. to leave them set in an undefined manner. Note that Left, Right -- and Result always have the same length in bits (Len). end System.Bit_Ops;
Cats/Category/Setoids/Facts/Limit.agda
JLimperg/cats
24
3910
<filename>Cats/Category/Setoids/Facts/Limit.agda {-# OPTIONS --without-K --safe #-} module Cats.Category.Setoids.Facts.Limit where open import Level using (_⊔_) open import Relation.Binary using (Setoid) open import Cats.Category open import Cats.Category.Cones as Cones using (Cone) open import Cats.Category.Setoids as Setoids using (Setoids ; ≈-intro ; ≈-elim) open import Cats.Functor using (Functor) open Cone open Cones._⇒_ open Functor open Setoid using (Carrier) open Setoids._⇒_ record Lim {l} {J : Category l l l} (F : Functor J (Setoids l l)) : Set l where private module J = Category J module F$ {x} = Setoid (F .fobj x) field arr : ∀ j → F .fobj j .Carrier consistent : ∀ {i j} (f : i J.⇒ j) → arr j F$.≈ F .fmap f .Setoids._⇒_.arr (arr i) open Lim public instance complete : ∀ {l} → Complete (Setoids l l) l l l complete .Complete.lim′ {J} F = record { cone = record { Apex = record { Carrier = Lim F ; _≈_ = λ f g → ∀ j → f .arr j F$.≈ g .arr j ; isEquivalence = record { refl = λ j → F$.refl ; sym = λ eq j → F$.sym (eq j) ; trans = λ eq₁ eq₂ j → F$.trans (eq₁ j) (eq₂ j) } } ; arr = λ j → record { resp = λ eq → eq j } ; commute = λ h → ≈-intro λ {f} {g} f≈g → F$.trans (f≈g _) (g .consistent h) } ; isLimit = λ X → record { arr = record { arr = record { arr = λ x → record { arr = λ j → X .arr j .arr x ; consistent = λ f → X .commute f .≈-elim (Setoid.refl (Apex X)) } ; resp = λ eq j → X .arr j .resp eq } ; commute = λ j → ≈-intro λ eq → X .arr j .resp eq } ; unique = λ {g} _ → ≈-intro λ eq j → F$.sym (g .commute j .≈-elim (Setoid.sym (Apex X) eq)) } } where module F$ {x} = Setoid (F .fobj x)
oeis/319/A319100.asm
neoneye/loda-programs
11
163151
<gh_stars>10-100 ; A319100: Number of solutions to x^6 == 1 (mod n). ; Submitted by <NAME> ; 1,1,2,2,2,2,6,4,6,2,2,4,6,6,4,4,2,6,6,4,12,2,2,8,2,6,6,12,2,4,6,4,4,2,12,12,6,6,12,8,2,12,6,4,12,2,2,8,6,2,4,12,2,6,4,24,12,2,2,8,6,6,36,4,12,4,6,4,4,12,2,24,6,6,4,12,12,12,6,8,6,2,2,24,4,6,4,8,2,12,36,4,12,2,12,8,6,6,12,4 add $0,1 mov $2,$0 lpb $0 mov $3,$0 mul $3,$0 sub $0,1 pow $3,3 mod $3,$2 cmp $3,1 add $1,$3 lpe mov $0,$1 trn $0,1 add $0,1
src/Native/Runtime/amd64/StubDispatch.asm
kouvel/corert
3,223
12594
<reponame>kouvel/corert<filename>src/Native/Runtime/amd64/StubDispatch.asm<gh_stars>1000+ ;; Licensed to the .NET Foundation under one or more agreements. ;; The .NET Foundation licenses this file to you under the MIT license. include AsmMacros.inc ifdef FEATURE_CACHED_INTERFACE_DISPATCH EXTERN RhpCidResolve : PROC EXTERN RhpUniversalTransition_DebugStepTailCall : PROC ;; Macro that generates code to check a single cache entry. CHECK_CACHE_ENTRY macro entry NextLabel textequ @CatStr( Attempt, %entry+1 ) cmp rax, [r11 + OFFSETOF__InterfaceDispatchCache__m_rgEntries + (entry * 16)] jne NextLabel jmp qword ptr [r11 + OFFSETOF__InterfaceDispatchCache__m_rgEntries + (entry * 16) + 8] NextLabel: endm ;; Macro that generates a stub consuming a cache with the given number of entries. DEFINE_INTERFACE_DISPATCH_STUB macro entries StubName textequ @CatStr( RhpInterfaceDispatch, entries ) LEAF_ENTRY StubName, _TEXT ;EXTERN CID_g_cInterfaceDispatches : DWORD ;inc [CID_g_cInterfaceDispatches] ;; r10 currently contains the indirection cell address. ;; load r11 to point to the cache block. mov r11, [r10 + OFFSETOF__InterfaceDispatchCell__m_pCache] ;; Load the EEType from the object instance in rcx. mov rax, [rcx] CurrentEntry = 0 while CurrentEntry lt entries CHECK_CACHE_ENTRY %CurrentEntry CurrentEntry = CurrentEntry + 1 endm ;; r10 still contains the the indirection cell address. jmp RhpInterfaceDispatchSlow LEAF_END StubName, _TEXT endm ;; DEFINE_INTERFACE_DISPATCH_STUB ;; Define all the stub routines we currently need. ;; ;; The mrt100dbi requires these be exported to identify mrt100 code that dispatches back into managed. ;; If you change or add any new dispatch stubs, please also change slr.def and dbi\process.cpp CordbProcess::GetExportStepInfo ;; DEFINE_INTERFACE_DISPATCH_STUB 1 DEFINE_INTERFACE_DISPATCH_STUB 2 DEFINE_INTERFACE_DISPATCH_STUB 4 DEFINE_INTERFACE_DISPATCH_STUB 8 DEFINE_INTERFACE_DISPATCH_STUB 16 DEFINE_INTERFACE_DISPATCH_STUB 32 DEFINE_INTERFACE_DISPATCH_STUB 64 ;; Stub dispatch routine for dispatch to a vtable slot LEAF_ENTRY RhpVTableOffsetDispatch, _TEXT ;; r10 currently contains the indirection cell address. ;; load rax to point to the vtable offset (which is stored in the m_pCache field). mov rax, [r10 + OFFSETOF__InterfaceDispatchCell__m_pCache] ;; Load the EEType from the object instance in rcx, and add it to the vtable offset ;; to get the address in the vtable of what we want to dereference add rax, [rcx] ;; Load the target address of the vtable into rax mov rax, [rax] TAILJMP_RAX LEAF_END RhpVTableOffsetDispatch, _TEXT ;; Initial dispatch on an interface when we don't have a cache yet. LEAF_ENTRY RhpInitialInterfaceDispatch, _TEXT ALTERNATE_ENTRY RhpInitialDynamicInterfaceDispatch ;; Just tail call to the cache miss helper. jmp RhpInterfaceDispatchSlow LEAF_END RhpInitialInterfaceDispatch, _TEXT ;; Cache miss case, call the runtime to resolve the target and update the cache. ;; Use universal transition helper to allow an exception to flow out of resolution LEAF_ENTRY RhpInterfaceDispatchSlow, _TEXT ;; r10 contains indirection cell address, move to r11 where it will be passed by ;; the universal transition thunk as an argument to RhpCidResolve mov r11, r10 lea r10, RhpCidResolve jmp RhpUniversalTransition_DebugStepTailCall LEAF_END RhpInterfaceDispatchSlow, _TEXT endif ;; FEATURE_CACHED_INTERFACE_DISPATCH end
programs/oeis/004/A004966.asm
neoneye/loda
22
244381
<reponame>neoneye/loda ; A004966: a(n) = ceiling(n*phi^11), where phi is the golden ratio, A001622. ; 0,200,399,598,797,996,1195,1394,1593,1792,1991,2190,2389,2588,2787,2986,3185,3384,3583,3782,3981,4180,4379,4578,4777,4976,5175,5374,5573,5772,5971,6170,6369,6568,6767 mov $1,$0 trn $1,1 mov $2,$0 sub $0,$1 lpb $2 add $0,199 sub $2,1 lpe
src/util/oli/wm/swio.asm
olifink/qspread
0
177064
* QMail Sun, 1992 Jul 12 * - Extended window manager functions include win1_keys_wman include win1_keys_wstatus include win1_keys_wwork include win1_keys_wdef_long include win1_keys_err include win1_keys_qdos_io include win1_mac_oli section utility xdef xwm_swio ; set window to info object *+++ * set window to info window object * (attributes are set accordingly, window not cleared) * * d1.l : iwindw | iobj * a0 a0 : channel id * a4 : wwork (preserved) *--- xwm_swio subr a1-a3/d1-d5 move.l ww_chid(a4),a0 ; window channel id move.l ww_xorg(a4),d4 ; abs. window position move.l ww_pinfo(a4),a3 ; info window list move.l d1,d2 swap d2 mulu #wwi.elen,d2 adda.w d2,a3 ; our info window move.w wwi_watt+wwa_papr(a3),d5 ; paper colour add.l wwi_xorg(a3),d4 ; abs. posn of iwindw move.l wwi_pobl(a3),a3 ; ptr. to obj list mulu #wwo.elen,d1 adda.w d1,a3 ; ptr. to our obj add.l d4,wwo_xorg(a3) ; make pos. absolut moveq #iow.defw,d0 ; define window moveq #0,d1 moveq #0,d2 lea wwo_xsiz(a3),a1 xjsr do_io sub.l d4,wwo_xorg(a3) ; make window abs. again tst.l d0 bne.s swio_exit moveq #0,d1 ; set attributes tst.b wwo_type(a3) ; test object type bne.s no_text move.w wwo_ink(a3),d1 no_text moveq #iow.sink,d0 ; set ink jsr do_io bne.s swio_exit move.w d5,d1 moveq #iow.spap,d0 ; set paper jsr do_io bne.s swio_exit move.w d5,d1 moveq #iow.sstr,d0 ; set strip jsr do_io bne.s swio_exit moveq #0,d1 ; set overwrite attr moveq #iow.sova,d0 jsr do_io ;;; bne.s swio_exit swio_exit tst.l d0 subend end
engine/engine/interrupt/declarations/state.asm
neomura/atmega328p-cartridge
0
15204
; Selects the alternative palette when set; written from the row event handler when video_next_row is odd (1, 3, 5) and the frame event handler and read from by the interrupt when video_next_row is even (0, 2, 4). .equ INTERRUPT_FLAG_PALETTE_A = 0 ; Selects the alternative palette when set; written from the row event handler when video_next_row is even (0, 2, 4) and the frame event handler and read from by the interrupt when video_next_row is odd (1, 3, 5). .equ INTERRUPT_FLAG_PALETTE_B = 1 ; Alternates between set and cleared once per line when the video standard is PAL. .equ INTERRUPT_FLAG_ALTERNATE_LINE = 2 ; Flags used internally by the interrupt. See INTERRUPT_FLAG_*. .def interrupt_flags = r18 ; The number of VSYNC lines per frame. .equ INTERRUPT_VSYNC_LINES = 3 ; The number of lines between the VSYNC and active lines. .equ INTERRUPT_PRE_BLANK_LINES = 27 ; The number of lines between the VSYNC and active lines. .equ INTERRUPT_POST_BLANK_LINES = 9 ; The first VSYNC line. .equ INTERRUPT_STATE_VSYNC_START = 0 ; The last VSYNC line. .equ INTERRUPT_STATE_VSYNC_END = INTERRUPT_VSYNC_LINES - 1 ; The first pre-active blank line. .equ INTERRUPT_STATE_PRE_BLANK_START = INTERRUPT_VSYNC_LINES ; The last pre-active blank line. .equ INTERRUPT_STATE_PRE_BLANK_END = INTERRUPT_STATE_VSYNC_END + INTERRUPT_PRE_BLANK_LINES ; The first repeat of an active line. .equ INTERRUPT_STATE_ACTIVE_A = INTERRUPT_STATE_PRE_BLANK_END + 1 ; The second repeat of an active line. .equ INTERRUPT_STATE_ACTIVE_B = INTERRUPT_STATE_ACTIVE_A + 1 ; The first post-active blank line. .equ INTERRUPT_STATE_POST_BLANK_START = INTERRUPT_STATE_ACTIVE_B + 1 ; The last post-active blank line. .equ INTERRUPT_STATE_POST_BLANK_END = INTERRUPT_STATE_ACTIVE_B + INTERRUPT_POST_BLANK_LINES ; Tracks the progress through the current frame (see INTERRUPT_STATE_**). .def interrupt_state = r17 ; Pixel data, packed 4 pixels per byte, for a row being written to by the main loop when video_next_row is odd (1, 3, 5) and read from by the interrupt when video_next_row is even (0, 2, 4). interrupt_framebuffer_a: .byte VIDEO_COLUMNS / VIDEO_PIXELS_PER_BYTE ; Pixel data, packed 4 pixels per byte, for a row being written to by the main loop when video_next_row is even (0, 2, 4) and read from by the interrupt when video_next_row is odd (1, 3, 5). interrupt_framebuffer_b: .byte VIDEO_COLUMNS / VIDEO_PIXELS_PER_BYTE
oeis/027/A027005.asm
neoneye/loda-programs
11
81231
; A027005: a(n) = T(2*n+1,n+2), T given by A026998. ; 1,19,101,370,1148,3278,8967,23993,63483,167040,438346,1148844,3009181,7879855,20631713,54016798,141420392,370246298,969320643,2537718005,6643835991,17393792844,45537545686,119218847640,312119000953,817138159243,2139295481117,5600748288778,14662949390228,38388099887270,100501350277311,263115950950769,688846502581491,1803423556800600,4721424167827618,12360848946689988,32361122672250517,84722519070070183,221806434537969113,580696784543846710,1520283919093581056,3980154972736906994 mul $0,2 mov $1,1 lpb $0 mov $2,$0 sub $0,1 seq $2,23537 ; a(n) = Lucas(n+4) - (3*n+7). add $1,$2 lpe mov $0,$1