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
src/sys/encoders/util-encoders-hmac-sha256.adb
RREE/ada-util
60
14828
----------------------------------------------------------------------- -- util-encoders-hmac-sha1 -- Compute HMAC-SHA256 authentication code -- Copyright (C) 2017, 2019 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Encoders.Base16; with Util.Encoders.Base64; package body Util.Encoders.HMAC.SHA256 is -- ------------------------------ -- Sign the data string with the key and return the HMAC-SHA256 code in binary. -- ------------------------------ function Sign (Key : in String; Data : in String) return Util.Encoders.SHA256.Hash_Array is Ctx : Context; Result : Util.Encoders.SHA256.Hash_Array; begin Set_Key (Ctx, Key); Update (Ctx, Data); Finish (Ctx, Result); return Result; end Sign; -- ------------------------------ -- Sign the data array with the key and return the HMAC-SHA256 code in the result. -- ------------------------------ procedure Sign (Key : in Ada.Streams.Stream_Element_Array; Data : in Ada.Streams.Stream_Element_Array; Result : out Util.Encoders.SHA256.Hash_Array) is Ctx : Context; begin Set_Key (Ctx, Key); Update (Ctx, Data); Finish (Ctx, Result); end Sign; procedure Sign (Key : in Secret_Key; Data : in Ada.Streams.Stream_Element_Array; Result : out Util.Encoders.SHA256.Hash_Array) is begin Sign (Key.Secret, Data, Result); end Sign; -- ------------------------------ -- Sign the data string with the key and return the HMAC-SHA256 code as hexadecimal string. -- ------------------------------ function Sign (Key : in String; Data : in String) return Util.Encoders.SHA256.Digest is Ctx : Context; Result : Util.Encoders.SHA256.Digest; begin Set_Key (Ctx, Key); Update (Ctx, Data); Finish (Ctx, Result); return Result; end Sign; -- ------------------------------ -- Sign the data string with the key and return the HMAC-SHA256 code as base64 string. -- When <b>URL</b> is True, use the base64 URL alphabet to encode in base64. -- ------------------------------ function Sign_Base64 (Key : in String; Data : in String; URL : in Boolean := False) return Util.Encoders.SHA256.Base64_Digest is Ctx : Context; Result : Util.Encoders.SHA256.Base64_Digest; begin Set_Key (Ctx, Key); Update (Ctx, Data); Finish_Base64 (Ctx, Result, URL); return Result; end Sign_Base64; -- ------------------------------ -- Set the hmac private key. The key must be set before calling any <b>Update</b> -- procedure. -- ------------------------------ procedure Set_Key (E : in out Context; Key : in String) is Buf : Ada.Streams.Stream_Element_Array (1 .. Key'Length); for Buf'Address use Key'Address; pragma Import (Ada, Buf); begin Set_Key (E, Buf); end Set_Key; IPAD : constant Ada.Streams.Stream_Element := 16#36#; OPAD : constant Ada.Streams.Stream_Element := 16#5c#; -- ------------------------------ -- Set the hmac private key. The key must be set before calling any <b>Update</b> -- procedure. -- ------------------------------ procedure Set_Key (E : in out Context; Key : in Ada.Streams.Stream_Element_Array) is begin -- Reduce the key if Key'Length > 64 then Util.Encoders.SHA256.Update (E.SHA, Key); Util.Encoders.SHA256.Finish (E.SHA, E.Key (0 .. 31)); E.Key_Len := 31; else E.Key_Len := Key'Length - 1; E.Key (0 .. E.Key_Len) := Key; end if; -- Hash the key in the SHA256 context. declare Block : Ada.Streams.Stream_Element_Array (0 .. 63); begin for I in 0 .. E.Key_Len loop Block (I) := IPAD xor E.Key (I); end loop; for I in E.Key_Len + 1 .. 63 loop Block (I) := IPAD; end loop; Util.Encoders.SHA256.Update (E.SHA, Block); end; end Set_Key; procedure Set_Key (E : in out Context; Key : in Secret_Key) is begin Set_Key (E, Key.Secret); end Set_Key; -- ------------------------------ -- Update the hash with the string. -- ------------------------------ procedure Update (E : in out Context; S : in String) is begin Util.Encoders.SHA256.Update (E.SHA, S); end Update; -- ------------------------------ -- Update the hash with the string. -- ------------------------------ procedure Update (E : in out Context; S : in Ada.Streams.Stream_Element_Array) is begin Util.Encoders.SHA256.Update (E.SHA, S); end Update; -- ------------------------------ -- Update the hash with the secret key. -- ------------------------------ procedure Update (E : in out Context; S : in Secret_Key) is begin Update (E, S.Secret); end Update; -- ------------------------------ -- Computes the HMAC-SHA256 with the private key and the data collected by -- the <b>Update</b> procedures. Returns the raw binary hash in <b>Hash</b>. -- ------------------------------ procedure Finish (E : in out Context; Hash : out Util.Encoders.SHA256.Hash_Array) is begin Util.Encoders.SHA256.Finish (E.SHA, Hash); -- Hash the key in the SHA256 context. declare Block : Ada.Streams.Stream_Element_Array (0 .. 63); begin for I in 0 .. E.Key_Len loop Block (I) := OPAD xor E.Key (I); end loop; if E.Key_Len < 63 then for I in E.Key_Len + 1 .. 63 loop Block (I) := OPAD; end loop; end if; Util.Encoders.SHA256.Update (E.SHA, Block); end; Util.Encoders.SHA256.Update (E.SHA, Hash); Util.Encoders.SHA256.Finish (E.SHA, Hash); end Finish; -- ------------------------------ -- Computes the HMAC-SHA256 with the private key and the data collected by -- the <b>Update</b> procedures. Returns the hexadecimal hash in <b>Hash</b>. -- ------------------------------ procedure Finish (E : in out Context; Hash : out Util.Encoders.SHA256.Digest) is H : Util.Encoders.SHA256.Hash_Array; B : Util.Encoders.Base16.Encoder; begin Finish (E, H); B.Convert (H, Hash); end Finish; -- ------------------------------ -- Computes the HMAC-SHA256 with the private key and the data collected by -- the <b>Update</b> procedures. Returns the base64 hash in <b>Hash</b>. -- When <b>URL</b> is True, use the base64 URL alphabet to encode in base64. -- ------------------------------ procedure Finish_Base64 (E : in out Context; Hash : out Util.Encoders.SHA256.Base64_Digest; URL : in Boolean := False) is H : Util.Encoders.SHA256.Hash_Array; B : Util.Encoders.Base64.Encoder; begin Finish (E, H); B.Set_URL_Mode (URL); B.Convert (H, Hash); end Finish_Base64; -- Initialize the SHA-1 context. overriding procedure Initialize (E : in out Context) is begin null; end Initialize; end Util.Encoders.HMAC.SHA256;
cursor.asm
rene0/asmstuff
0
24885
; Copyright (c) 1997-2000 <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. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. [SEGMENT .text] GLOBAL SaveCursor,SetCursor,MoveCursor ; ------------------------------------------------------------------------------ ; SaveCursor - 1998-06-08. ; DOEL : Bewaart de huidige cursor in Cursor (word-variable). De cursor ; wordt gelezen d.m.v. INTerrupt 10h, functie 3. ; GEBRUIKT : AX,BX,CX,DX,Flags ; SCHRIJFT : Cursor,YPos,XPos ; ------------------------------------------------------------------------------ SaveCursor: push AX ; Bewaar de gebruikte registers push BX push CX push DX pushf mov AH,3 ; Vraag cursorinformatie xor BH,BH ; Pagina 0 INT 10h ; Roep BIOS aan mov [Cursor],CX mov [YPos],DH mov [XPos],DL popf ; Herstel de gebruikte registers pop DX pop CX pop BX pop AX RET ; ------------------------------------------------------------------------------ ; SetCursor - 1999-06-08. ; DOEL : Stelt een nieuwe cursor in d.m.v. INTerrupt 10h, functie 1. ; In hi(Cursor) staat de startregel, in lo(Cursor) de eindregel. ; LEEST : Cursor ; GEBRUIKT : AX,BX,CX,Flags ; ------------------------------------------------------------------------------ SetCursor: push AX ; Bewaar de gebruikte registers push BX push CX pushf mov AH,1 ; Stel cursor in xor BH,BH ; Op pagina 0 mov CX,[Cursor] INT 0x10 ; Roep BIOS aan popf ; Herstel de gebruikte registers pop CX pop BX pop AX RET ; ------------------------------------------------------------------------------ ; MoveCursor - 1999-06-08 ; DOEL : Verplaatst de cursor d.m.v. INTerrupt 10h, functie 2. ; LEEST : XPos,YPos ; GEBRUIKT : AX,BX,DX,Flags ; ------------------------------------------------------------------------------ MoveCursor: push AX ; Bewaar de registers push BX push DX pushf mov AH,2 ; 2 = Set cursor position mov DH,[YPos] ; Regel mov DL,[XPos] ; Kolom xor BH,BH ; Pagina 0 INT 0x10 ; Roep BIOS aan popf ; Herstel de registers pop DX pop BX pop AX RET COMMON Cursor 2 ; 2 bytes [SEGMENT .bss] EXTERN XPos,YPos
src/hide-decode_generic.adb
persan/midnightsun-ctf-LoveLacedLetter
0
25119
procedure Hide.Decode_generic is use all type Posix.C_String; Source_File :constant String:= Posix.Get_Line; begin Put_Line (Decode ((+Source_File))); end;
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_1205.asm
ljhsiun2/medusa
9
89553
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r13 push %r15 push %rax push %rbp push %rsi lea addresses_WC_ht+0x18ae6, %r12 clflush (%r12) sub $42621, %r15 mov (%r12), %r10d nop nop sub $4502, %r13 lea addresses_normal_ht+0x1a406, %rax nop nop nop nop nop cmp $12693, %r13 mov (%rax), %rsi nop cmp $16895, %r12 lea addresses_normal_ht+0x96c6, %r12 nop nop nop nop add $24886, %rbp movb $0x61, (%r12) nop nop nop nop xor $42104, %r10 pop %rsi pop %rbp pop %rax pop %r15 pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r8 push %r9 push %rax push %rbp push %rdx // Store lea addresses_UC+0x1b586, %r11 nop nop nop xor $17210, %rdx movw $0x5152, (%r11) nop nop sub $46400, %r11 // Faulty Load lea addresses_UC+0x1b8c6, %rbp nop nop nop xor $24064, %r11 mov (%rbp), %r9w lea oracles, %rdx and $0xff, %r9 shlq $12, %r9 mov (%rdx,%r9,1), %r9 pop %rdx pop %rbp pop %rax pop %r9 pop %r8 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_UC', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_UC', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_UC', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 5, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'same': True, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'37': 21829} 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 */
tools/yasm/tests/nasm/jumps.asm
fasttr-org/ftr
0
174600
<gh_stars>0 [BITS 16] label: jmp 1 jmp +1 jmp -1 jmp label nop je $$+1 je $+1 je $-1 je label
oeis/124/A124860.asm
neoneye/loda-programs
11
171272
; A124860: A Jacobsthal-Pascal triangle. ; Submitted by <NAME> ; 1,1,1,3,6,3,5,15,15,5,11,44,66,44,11,21,105,210,210,105,21,43,258,645,860,645,258,43,85,595,1785,2975,2975,1785,595,85,171,1368,4788,9576,11970,9576,4788,1368,171,341,3069,12276,28644 lpb $0 add $2,1 sub $0,$2 mov $1,2 lpe pow $1,$2 div $1,3 mul $1,2 bin $2,$0 mul $1,$2 mov $0,$1 add $0,$2
1-base/math/source/generic/any_math.adb
charlie5/lace-alire
1
11445
with ada.Characters.latin_1; package body any_Math is use ada.Containers; ----------- -- Integers -- procedure increment (Self : in out Integer; By : in Integer := 1) is begin Self := Self + By; end increment; procedure decrement (Self : in out Integer; By : in Integer := 1) is begin Self := Self - By; end decrement; procedure swap (Left, Right : in out Integer) is Pad : constant Integer := Left; begin Left := Right; Right := Pad; end swap; ----------- -- Counters -- procedure increment (Self : in out Count_type; By : in Count_type := 1) is begin Self := Self + By; end increment; procedure decrement (Self : in out Count_type; By : in Count_type := 1) is begin Self := Self - By; end decrement; --------- -- Reals -- -- Ada 95 Quality and Style Guide, 7.2.7: -- Tests for -- -- (1) absolute "equality" to 0 in storage, -- (2) absolute "equality" to 0 in computation, -- (3) relative "equality" to 0 in storage, and -- (4) relative "equality" to 0 in computation: -- -- abs X <= Float_Type'Model_Small -- (1) -- abs X <= Float_Type'Base'Model_Small -- (2) -- abs X <= abs X * Float_Type'Model_Epsilon -- (3) -- abs X <= abs X * Float_Type'Base'Model_Epsilon -- (4) -- function almost_Zero (Self : Real) return Boolean is begin return abs Self <= Real'Base'Model_Small; end almost_Zero; function Clamped (Self : in Real; Low, High : in Real) return Real is begin return Real'Max (Low, Real'Min (Self, High)); end Clamped; procedure clamp (Self : in out Real; Low, High : in Real) is begin Self := Clamped (Self, Low, High); end clamp; procedure swap (Left, Right : in out Real) is Pad : constant Real := Left; begin Left := Right; Right := Pad; end swap; ------------- -- Percentage -- function to_Percentage (From : in Real) return Percentage is begin return Percentage (From * Real' (100.0)); end to_Percentage; function to_Real (Percent : in Percentage) return Real is begin return Real (Percent / 100.0); end to_Real; function Image (Percent : in Percentage; Precision : in Natural := 5) return String is begin return Image (Real (Percent), Precision) & "%"; end Image; function apply (Left, Right : in Percentage) return Percentage is begin return Percentage (Real (Left) * Real (Right) / 100.0**2); end apply; -- -- Named "apply" (rather than "*") to prevent silently overriding the "*" function of the Real type. function apply (Percent : in Percentage; To : in Real) return Real is begin return to_Real (Percent) * To; end apply; -- -- Named "apply" (rather than "*") to prevent ambiguous expressions when numeric literals are used. --------- -- Angles -- function to_Radians (Self : in Degrees) return Radians is begin return Radians (Self * Pi / 180.0); end to_Radians; function to_Degrees (Self : in Radians) return Degrees is begin return Degrees (Self) * 180.0 / Pi; end to_Degrees; ---------- -- Vectors -- function Sum (Self : in Vector) return Real is the_Sum : Real := 0.0; begin for Each in Self'Range loop the_Sum := the_Sum + Self (Each); end loop; return the_Sum; end Sum; function Average (Self : in Vector) return Real is begin return Sum (Self) / Real (Self'Length); end Average; function Max (Self : in Vector) return Real is Max : Real := Self (Self'First); begin for i in Self'First + 1 .. Self'Last loop Max := Real'Max (Max, Self (i)); end loop; return Max; end Max; function Min (Self : in Vector) return Real is Min : Real := Self (Self'First); begin for i in Self'First + 1 .. Self'Last loop Min := Real'Min (Min, Self (i)); end loop; return Min; end Min; ----------- -- Matrices -- function Row (Self : in Matrix_2x2; row_Id : in Index) return Vector_2 is begin return (Self (row_Id, 1), Self (row_Id, 2)); end Row; function Col (Self : in Matrix_2x2; col_Id : in Index) return Vector_2 is begin return (Self (1, col_Id), Self (2, col_Id)); end Col; function Row (Self : in Matrix_3x3; row_Id : in Index) return Vector_3 is begin return (Self (row_Id, 1), Self (row_Id, 2), Self (row_Id, 3)); end Row; function Col (Self : in Matrix_3x3; col_Id : in Index) return Vector_3 is begin return (Self (1, col_Id), Self (2, col_Id), Self (3, col_Id)); end Col; function Row (Self : in Matrix_4x4; row_Id : in Index) return Vector_4 is begin return (Self (row_Id, 1), Self (row_Id, 2), Self (row_Id, 3), Self (row_Id, 4)); end Row; function Col (Self : in Matrix_4x4; col_Id : in Index) return Vector_4 is begin return (Self (1, col_Id), Self (2, col_Id), Self (3, col_Id), Self (4, col_Id)); end Col; function to_Vector_16 (Self : in Matrix_4x4) return Vector_16 is begin return Vector_16 ( Vector_4' (Row (Self, 1)) & Vector_4' (Row (Self, 2)) & Vector_4' (Row (Self, 3)) & Vector_4' (Row (Self, 4))); end to_Vector_16; function to_Matrix_4x4 (Self : in Vector_16) return Matrix_4x4 is begin return Matrix_4x4' (1 => (Self (1), Self (2), Self (3), Self (4)), 2 => (Self (5), Self (6), Self (7), Self (8)), 3 => (Self (9), Self (10), Self (11), Self (12)), 4 => (Self (13), Self (14), Self (15), Self (16))); end to_Matrix_4x4; -------------- -- Quaternions -- function to_Quaternion (From : in Vector_4) return Quaternion is begin return (From (1), (Vector_3 (From (2 .. 4)))); end to_Quaternion; function to_Vector (From : in Quaternion) return Vector_4 is begin return Vector_4 (From.R & From.V); end to_Vector; function "*" (Left : in Quaternion; Right : in Real) return Quaternion is begin return (Left.R * Right, (Left.V * Right)); end "*"; function "*" (Left : in Real; Right : in Quaternion) return Quaternion is begin return (Right.R * Left, (Right.V * Left)); end "*"; function "/" (Left : in Quaternion; Right : in Real) return Quaternion is begin return (Left.R / Right, (Left.V / Right)); end "/"; function "+" (Left, Right : in Quaternion) return Quaternion is begin return (Left.R + Right.R, Left.V + Right.V); end "+"; function "-" (Left, Right : in Quaternion) return Quaternion is begin return (Left.R - Right.R, Left.V - Right.V); end "-"; function Image (Self : in Quaternion; Precision : in Natural := 5) return String is begin return "(R => " & Image (Self.R, Precision) & ", V => " & Image (Self.V, Precision) & ")"; end Image; --------- -- Images -- -- Real Image -- function Image (Self : in Real; Precision : in Natural := 5) return String is type Fixed_1 is delta 0.1 range -100_000_000_000_000_000.0 .. 100_000_000_000_000_000.0; type Fixed_2 is delta 0.01 range -10_000_000_000_000_000.0 .. 10_000_000_000_000_000.0; type Fixed_3 is delta 0.001 range -1_000_000_000_000_000.0 .. 1_000_000_000_000_000.0; type Fixed_4 is delta 0.0001 range -100_000_000_000_000.0 .. 100_000_000_000_000.0; type Fixed_5 is delta 0.00001 range -10_000_000_000_000.0 .. 10_000_000_000_000.0; type Fixed_6 is delta 0.000001 range -1_000_000_000_000.0 .. 1_000_000_000_000.0; type Fixed_7 is delta 0.0000001 range -100_000_000_000.0 .. 100_000_000_000.0; type Fixed_8 is delta 0.00000001 range -10_000_000_000.0 .. 10_000_000_000.0; type Fixed_9 is delta 0.000000001 range -1_000_000_000.0 .. 1_000_000_000.0; type Fixed_10 is delta 0.0000000001 range -100_000_000.0 .. 100_000_000.0; type Fixed_11 is delta 0.00000000001 range -10_000_000.0 .. 10_000_000.0; type Fixed_12 is delta 0.000000000001 range -1_000_000.0 .. 1_000_000.0; begin case Precision is when 0 => return Integer'Image (Integer (Self)); when 1 => return Fixed_1'Image (Fixed_1 (Self)); when 2 => return Fixed_2'Image (Fixed_2 (Self)); when 3 => return Fixed_3'Image (Fixed_3 (Self)); when 4 => return Fixed_4'Image (Fixed_4 (Self)); when 5 => return Fixed_5'Image (Fixed_5 (Self)); when 6 => return Fixed_6'Image (Fixed_6 (Self)); when 7 => return Fixed_7'Image (Fixed_7 (Self)); when 8 => return Fixed_8'Image (Fixed_8 (Self)); when 9 => return Fixed_9'Image (Fixed_9 (Self)); when 10 => return Fixed_10'Image (Fixed_10 (Self)); when 11 => return Fixed_11'Image (Fixed_11 (Self)); when 12 => return Fixed_12'Image (Fixed_12 (Self)); when others => return Fixed_12'Image (Fixed_12 (Self)); end case; exception when Constraint_Error => return Real'Image (Self); end Image; -- Vector Image -- function Image (Self : in Vector; Precision : in Natural := 5) return String is the_Image : String (1 .. 1 * 1024 * 1024); -- Handles one megabyte string, excess is truncated. Count : Standard.Natural := 0; procedure add (Text : in String) is begin the_Image (Count + 1 .. Count + text'Length) := Text; Count := Count + text'Length; end add; begin add ("("); for Each in Self'Range loop if Each /= Self'First then add (", "); end if; add (Image (Self (Each), Precision)); end loop; add (")"); return the_Image (1 .. Count); exception when others => return the_Image (1 .. Count); end Image; ----------- -- Vector_2 -- function to_Vector_2 (Self : in Vector_3) return Vector_2 is begin return Vector_2 (Self (1 .. 2)); end to_Vector_2; function Image (Self : in Vector_2; Precision : in Natural := 5) return String is begin return Image (Vector (Self), Precision); end Image; overriding function "+" (Left, Right : in Vector_2) return Vector_2 is begin return (Left (1) + Right (1), Left (2) + Right (2)); end "+"; overriding function "-" (Left, Right : in Vector_2) return Vector_2 is begin return (Left (1) - Right (1), Left (2) - Right (2)); end "-"; overriding function "*" (Left : in Real; Right : in Vector_2) return Vector_2 is begin return (Right (1) * Left, Right (2) * Left); end "*"; overriding function "*" (Left : in Vector_2; Right : in Real) return Vector_2 is begin return (Left (1) * Right, Left (2) * Right); end "*"; overriding function "/" (Left : in Vector_2; Right : in Real) return Vector_2 is begin return (Left (1) / Right, Left (2) / Right); end "/"; ----------- -- Vector_3 -- function to_Vector_3 (Self : in Vector_2; Z : in Real := 0.0) return Vector_3 is begin return Vector_3 (Self & Z); end to_Vector_3; function Image (Self : in Vector_3; Precision : in Natural := 5) return String is begin return Image (Vector (Self), Precision); end Image; overriding function "*" (Left : in Real; Right : in Vector_3) return Vector_3 is begin return (Right (1) * Left, Right (2) * Left, Right (3) * Left); end "*"; function "*" (Left, Right : in Vector_3) return Vector_3 is begin return (1 => Left (2) * Right (3) - Left (3) * Right (2), 2 => Left (3) * Right (1) - Left (1) * Right (3), 3 => Left (1) * Right (2) - Left (2) * Right (1)); end "*"; overriding function "+" (Left, Right : in Vector_3) return Vector_3 is begin return (Left (1) + Right (1), Left (2) + Right (2), Left (3) + Right (3)); end "+"; overriding function "-" (Left, Right : in Vector_3) return Vector_3 is begin return (Left (1) - Right (1), Left (2) - Right (2), Left (3) - Right (3)); exception when Constraint_Error => raise Constraint_Error with "any_math ""-"" (Left, Right : Vector_3) => " & Image (Left) & " " & Image (Right); end "-"; overriding function "-" (Right : in Vector_3) return Vector_3 is begin return (-Right (1), -Right (2), -Right (3)); end "-"; overriding function "*" (Left : in Vector_3; Right : in Real) return Vector_3 is begin return (Left (1) * Right, Left (2) * Right, Left (3) * Right); end "*"; overriding function "/" (Left : in Vector_3; Right : in Real) return Vector_3 is begin return (Left (1) / Right, Left (2) / Right, Left (3) / Right); end "/"; overriding function "abs" (Right : in Vector_3) return Vector_3 is use Vectors; begin return Vector_3 (Vector' (abs (Vector (Right)))); end "abs"; --------- -- Matrix -- function Image (Self : Matrix) return String is Image : String (1 .. 1024); Last : Natural := 0; begin for Row in Self'Range (1) loop for Col in Self'Range (2) loop declare Element : constant String := Real'Image (Self (Row, Col)); begin Last := Last + 1; Image (Last) := ' '; Last := Last + 1; Image (Last .. Last + Element'Length - 1) := Element; Last := Last + Element'Length - 1; end; end loop; Last := Last + 1; Image (Last) := ada.Characters.Latin_1.LF; end loop; return Image (1 .. Last); end Image; ------------- -- Matrix_2x2 -- overriding function Transpose (Self : in Matrix_2x2) return Matrix_2x2 is begin return Matrix_2x2 (Vectors.Transpose (Matrix (Self))); end Transpose; function "*" (Left : in Matrix_2x2; Right : in Vector_2) return Vector_2 is Result : Vector_2 := (others => 0.0); begin for Row in 1 .. 2 loop for Col in 1 .. 2 loop Result (Row) := Result (Row) + Left (Row, Col) * Right (Col); end loop; end loop; return Result; end "*"; function "*" (Left : in Vector_2; Right : in Matrix_2x2) return Vector_2 is use Vectors; begin return Vector_2 ( Vector (Left) * Matrix (Right)); end "*"; ------------- -- Matrix_3x3 -- overriding function Transpose (Self : in Matrix_3x3) return Matrix_3x3 is begin return Matrix_3x3 (Vectors.Transpose (Matrix (Self))); end Transpose; function "*" (Left : in Matrix_3x3; Right : in Vector_3) return Vector_3 is A : Matrix_3x3 renames Left; B : Vector_3 renames Right; begin return ((a(1,1)*b(1) + a(1,2)*b(2) + a(1,3)*b(3)), (a(2,1)*b(1) + a(2,2)*b(2) + a(2,3)*b(3)), (a(3,1)*b(1) + a(3,2)*b(2) + a(3,3)*b(3))); end "*"; function "*" (Left : in Vector_3; Right : in Matrix_3x3) return Vector_3 is A : Matrix_3x3 renames Right; B : Vector_3 renames Left; begin return ((a(1,1)*b(1) + a(2,1)*b(2) + a(3,1)*b(3)), (a(1,2)*b(1) + a(2,2)*b(2) + a(3,2)*b(3)), (a(1,3)*b(1) + a(2,3)*b(2) + a(3,3)*b(3))); end "*"; ------------- -- Matrix_4x4 -- overriding function Transpose (Self : in Matrix_4x4) return Matrix_4x4 is begin return Matrix_4x4 (Vectors.Transpose (Matrix (Self))); end Transpose; function "*" (Left : in Matrix_4x4; Right : in Vector_4) return Vector_4 is A : Matrix_4x4 renames Left; B : Vector_4 renames Right; begin return ((a(1,1)*b(1) + a(1,2)*b(2) + a(1,3)*b(3) + a(1,4)*b(4)), (a(2,1)*b(1) + a(2,2)*b(2) + a(2,3)*b(3) + a(2,4)*b(4)), (a(3,1)*b(1) + a(3,2)*b(2) + a(3,3)*b(3) + a(3,4)*b(4)), (a(4,1)*b(1) + a(4,2)*b(2) + a(4,3)*b(3) + a(4,4)*b(4))); end "*"; function "*" (Left : in Vector_4; Right : in Matrix_4x4) return Vector_4 is A : Matrix_4x4 renames Right; B : Vector_4 renames Left; begin return ((a(1,1)*b(1) + a(2,1)*b(2) + a(3,1)*b(3) + a(4,1)*b(4)), (a(1,2)*b(1) + a(2,2)*b(2) + a(3,2)*b(3) + a(4,2)*b(4)), (a(1,3)*b(1) + a(2,3)*b(2) + a(3,3)*b(3) + a(4,3)*b(4)), (a(1,4)*b(1) + a(2,4)*b(2) + a(3,4)*b(3) + a(4,4)*b(4))); end "*"; function "*" (Left : in Matrix_4x4; Right : in Vector_3) return Vector_3 is V : Vector_4 := Vector_4 (Right & 1.0); begin V := Left * V; return Vector_3 (V (1..3)); end "*"; function "*" (Left : in Vector_3; Right : in Matrix_4x4) return Vector_4 is V : Vector_4 := Vector_4 (Left & 1.0); begin V := V * Right; return V; end "*"; function "*" (Left : in Matrix_4x4; Right : in Vector_3) return Vector_4 is V : Vector_4 := Vector_4 (Right & 1.0); begin V := Left * V; return V; end "*"; overriding function "*" (Left : in Matrix_4x4; Right : in Matrix_4x4) return Matrix_4x4 is A : Matrix_4x4 renames Left; B : Matrix_4x4 renames Right; begin return ((a(1,1)*b(1,1) + a(1,2)*b(2,1) + a(1,3)*b(3,1) + a(1,4)*b(4,1), a(1,1)*b(1,2) + a(1,2)*b(2,2) + a(1,3)*b(3,2) + a(1,4)*b(4,2), a(1,1)*b(1,3) + a(1,2)*b(2,3) + a(1,3)*b(3,3) + a(1,4)*b(4,3), a(1,1)*b(1,4) + a(1,2)*b(2,4) + a(1,3)*b(3,4) + a(1,4)*b(4,4)), (a(2,1)*b(1,1) + a(2,2)*b(2,1) + a(2,3)*b(3,1) + a(2,4)*b(4,1), a(2,1)*b(1,2) + a(2,2)*b(2,2) + a(2,3)*b(3,2) + a(2,4)*b(4,2), a(2,1)*b(1,3) + a(2,2)*b(2,3) + a(2,3)*b(3,3) + a(2,4)*b(4,3), a(2,1)*b(1,4) + a(2,2)*b(2,4) + a(2,3)*b(3,4) + a(2,4)*b(4,4)), (a(3,1)*b(1,1) + a(3,2)*b(2,1) + a(3,3)*b(3,1) + a(3,4)*b(4,1), a(3,1)*b(1,2) + a(3,2)*b(2,2) + a(3,3)*b(3,2) + a(3,4)*b(4,2), a(3,1)*b(1,3) + a(3,2)*b(2,3) + a(3,3)*b(3,3) + a(3,4)*b(4,3), a(3,1)*b(1,4) + a(3,2)*b(2,4) + a(3,3)*b(3,4) + a(3,4)*b(4,4)), (a(4,1)*b(1,1) + a(4,2)*b(2,1) + a(4,3)*b(3,1) + a(4,4)*b(4,1), a(4,1)*b(1,2) + a(4,2)*b(2,2) + a(4,3)*b(3,2) + a(4,4)*b(4,2), a(4,1)*b(1,3) + a(4,2)*b(2,3) + a(4,3)*b(3,3) + a(4,4)*b(4,3), a(4,1)*b(1,4) + a(4,2)*b(2,4) + a(4,3)*b(3,4) + a(4,4)*b(4,4))); end "*"; end any_Math;
Comparison of Languages/Code/Assembly/Main.asm
KyleErwin/Assembly
0
174926
<gh_stars>0 segment .data hello: db "The quick brown fox jumps over the lazy dog.",0x0a segment .text global _start _start: mov eax,1 mov edi,1 mov edx, 45 ; The number of characters lea rsi,[hello] syscall mov eax,60 xor edi, edi syscall
sk/sfx/AB.asm
Cancer52/flamedriver
9
242152
Sound_AB_Header: smpsHeaderStartSong 3 smpsHeaderVoice Sound_AB_Voices smpsHeaderTempoSFX $01 smpsHeaderChanSFX $01 smpsHeaderSFXChannel cFM5, Sound_AB_FM5, $00, $00 ; FM5 Data Sound_AB_FM5: smpsSpindashRev smpsSetvoice $00 smpsModSet $01, $01, $1A, $01 dc.b nC5, $18, smpsNoAttack smpsModSet $00, $00, $00, $00 dc.b $02 Sound_AB_Loop00: dc.b smpsNoAttack, $02 smpsFMAlterVol $02 smpsLoop $00, $18, Sound_AB_Loop00 smpsResetSpindashRev smpsStop Sound_AB_Voices: ; Voice $00 ; $34 ; $00, $0C, $03, $09, $9F, $8F, $8C, $D5, $00, $00, $00, $00 ; $00, $00, $00, $00, $0F, $0F, $0F, $0F, $00, $80, $1C, $80 smpsVcAlgorithm $04 smpsVcFeedback $06 smpsVcUnusedBits $00 smpsVcDetune $00, $00, $00, $00 smpsVcCoarseFreq $09, $03, $0C, $00 smpsVcRateScale $03, $02, $02, $02 smpsVcAttackRate $15, $0C, $0F, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $00, $00, $00, $00 smpsVcDecayRate2 $00, $00, $00, $00 smpsVcDecayLevel $00, $00, $00, $00 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $00, $1C, $00, $00
src/decls-d_atribut.ads
alvaromb/Compilemon
1
18577
-- DECLS-D_ATRIBUT.ads -- Paquet de declaracions d'atributs with Decls.Dgenerals, Decls.D_Taula_De_Noms, Decls.Dtnode, Decls.Dtdesc; use Decls.Dgenerals, Decls.D_Taula_De_Noms, Decls.Dtnode, Decls.Dtdesc; package Decls.D_Atribut is type Atribut (T : Tipus_Atribut := Atom) is record Lin, Col : Natural; case T is when Atom => null; when A_Ident => Idn : Id_Nom; when A_Lit_C | A_Lit_N | A_Lit_S => Val : Valor; when others => A : Pnode; end case; end record; end Decls.D_Atribut;
T1/T1/out/production/T1/t1/Lua.g4
renatasarmet/compiladorLexicoSintatico
0
3793
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ grammar Lua; @members ( public static String grupo="<<606723, , >>"; )* /*PALAVRAS RESERVADAS*/ PalavraReservada:'and' | 'break' | 'do' | 'else' | 'elseif' | 'end' | 'false' | 'for' | 'function' | 'if' | 'in' | 'local' | 'nil' | 'not' | 'or' | 'repeat' | 'return' | 'then' | 'true' | 'until' | 'while'; /* SIMBOLOS RESERVADOS: Precedência: Parênteses muda a precedência de uma expressão. Os operadores ('..') e ('^') são associativos à direita. Todos os demais operadores binários são associativos à esquerda. */ /*Operadores de acordo com a precedência*/ OpLogico1: 'or'; OpLogico2: 'and'; OpRel: '<' | '>' | '<=' | '>=' | '~=' | '=='; OpConcat: '..'; // CONCATENAÇÃO OpArit1: '+' | '-'; OpArit2: '*'| '/' | '%'; OpLogico3: 'not' | '#' | '-' ;// '-' UNÁRIO OpArit3: '^'; //EXPONENCIAÇÃO OpAtrib: '='; //ATRIBUIÇÃO OpDelim: '(' | ')' | '(' | ')*' | '(' | ')?'; //DELIMITADORES OpOutros: ';' | ':' | ',' | '.' | '...'; /*NOMES*/ fragment LetraMinuscula : ('a'..'z'); fragment LetraMaiuscula : ('A'..'Z'); Letra: ('a'..'z') | ('A'..'Z'); fragment Digito : '0'..'9'; Nome:(Letra|'_')(Letra|'_'|Digito)* ; /* CADEIA DE CARACTERES: Apenas as versões curtas, sem sequência de escape, quebras de linha não permitidas */ CadeiaCaracteres: ('\'' | '"')(~('\'' | '"'))*('\'' | '"'); /* CONSTANTES NUMÉRICAS: Apenas decimais, sem sinal, com dígitos antes e depois do ponto decimal opcionais */ ConstanteNumerica: Digito+ '.'? Digito+ ; // Análise sintática block : chunk ; chunk : (stat (';')?)* (laststat (';')?)? ; stat : varlist '=' explist | functioncall | do block end | while exp do block end | repeat block until exp | if exp then block (elseif exp then block)* (else block)? end | for Name '=' exp ',' exp (',' exp)? do block end | for namelist in explist do block end | function funcname funcbody | local function Name funcbody | local namelist ('=' explist)? ; laststat : return (explist)? | break ; funcname : Name ('.' Name)* (':' Name)? ; varlist : var (',' var)* ; var : Name | prefixexp '(' exp ')?' | prefixexp '.' Name ; namelist : Name (',' Name)* ; explist : (exp ',')* exp ; exp : nil | false | true | Number | String | '...' | function | prefixexp | tableconstructor | exp binop exp | unop exp ; prefixexp : var | functioncall | '(' exp ')' ; functioncall : prefixexp args | prefixexp ':' Name args ; args : '(' (explist)? ')' | tableconstructor | String ; function : function funcbody ; funcbody : '(' (parlist)? ')' block end ; parlist : namelist (',' '...')? | '...' ; tableconstructor : '(' (fieldlist)? ')*' ; fieldlist : field (fieldsep field)* (fieldsep)? ; field : '(' exp ')?' '=' exp | Name '=' exp | exp ; fieldsep : ',' | ';' ; binop : '+' | '-' | '*' | '/' | '^' | '%' | '..' | '<' | '<=' | '>' | '>=' | '==' | '~=' | and | or ; unop : '-' | not | '#' ;
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/ancestor_type.ads
best08618/asylo
7
17682
<reponame>best08618/asylo package Ancestor_Type is type T is tagged private; package B is function make return T; end B; private type T is tagged record n: Natural; end record; end Ancestor_Type;
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_970.asm
ljhsiun2/medusa
9
177490
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r8 push %rax push %rcx push %rdi push %rsi lea addresses_WT_ht+0x1cbd6, %r12 clflush (%r12) and $13724, %r13 and $0xffffffffffffffc0, %r12 vmovaps (%r12), %ymm4 vextracti128 $1, %ymm4, %xmm4 vpextrq $0, %xmm4, %r11 nop nop add %rax, %rax lea addresses_WC_ht+0x5e36, %rsi lea addresses_WT_ht+0x5a76, %rdi cmp %r12, %r12 mov $69, %rcx rep movsl nop nop mfence lea addresses_A_ht+0x8016, %rsi lea addresses_WT_ht+0x9b56, %rdi clflush (%rsi) nop nop nop nop dec %r8 mov $115, %rcx rep movsw nop nop nop and $39870, %rsi lea addresses_WT_ht+0x1c936, %r13 nop xor %rax, %rax movl $0x61626364, (%r13) nop and %r12, %r12 lea addresses_normal_ht+0xceb6, %rdi clflush (%rdi) nop cmp $21925, %rax movups (%rdi), %xmm6 vpextrq $0, %xmm6, %r11 nop nop nop nop nop sub %rsi, %rsi lea addresses_normal_ht+0x8676, %rax nop sub %r13, %r13 mov (%rax), %cx sub %rsi, %rsi lea addresses_D_ht+0x4b16, %rcx nop nop nop nop xor $31354, %r12 mov $0x6162636465666768, %r8 movq %r8, %xmm7 movups %xmm7, (%rcx) nop add %r12, %r12 pop %rsi pop %rdi pop %rcx pop %rax pop %r8 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r13 push %r15 push %r8 push %rbp push %rdi push %rdx push %rsi // Store lea addresses_WT+0x1db6, %r13 nop nop sub $30747, %rsi movw $0x5152, (%r13) nop nop nop nop sub $2406, %rdi // Faulty Load lea addresses_WC+0x4936, %rsi nop nop nop nop sub %rbp, %rbp mov (%rsi), %r8d lea oracles, %r13 and $0xff, %r8 shlq $12, %r8 mov (%r13,%r8,1), %r8 pop %rsi pop %rdx pop %rdi pop %rbp pop %r8 pop %r15 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WT', 'AVXalign': False, 'size': 2}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': True, 'size': 4}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_WT_ht', 'AVXalign': True, 'size': 32}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 8, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WT_ht'}} {'src': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': True, 'size': 4}} {'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16}} {'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/184/A184580.asm
neoneye/loda
22
20221
; A184580: a(n) = floor((n-1/4)*sqrt(2)), complement of A184581. ; 1,2,3,5,6,8,9,10,12,13,15,16,18,19,20,22,23,25,26,27,29,30,32,33,35,36,37,39,40,42,43,44,46,47,49,50,51,53,54,56,57,59,60,61,63,64,66,67,68,70,71,73,74,76,77,78,80,81,83,84,85,87,88,90,91,92,94,95,97,98,100,101,102,104,105,107,108,109,111,112,114,115,117,118,119,121,122,124,125,126,128,129,131,132,133,135,136,138,139,141 mul $0,2 seq $0,184117 ; Lower s-Wythoff sequence, where s(n) = 2n + 1. sub $0,1 div $0,2 add $0,1
share/vpn/disconnect-from-vpn.template.applescript
codemonkey800/arch-config
2
3723
<filename>share/vpn/disconnect-from-vpn.template.applescript tell application "System Events" tell current location of network preferences set vpn to service "${SERVICE}" if exists vpn then disconnect vpn end tell end tell
libsrc/rex/graphics/pixaddr.asm
meesokim/z88dk
0
176248
<reponame>meesokim/z88dk<filename>libsrc/rex/graphics/pixaddr.asm ; ; written by <NAME> ; ; $Id: pixaddr.asm,v 1.3 2015/01/19 01:33:06 pauloscustodio Exp $ PUBLIC pixaddr ; ; LCD memory pixel addres ; ASM - entry point ; ; i/p : D=x E=y ; uses : AF,BC,HL,DE ; o/p : HL=LCD memory byte address C=pixel bit .pixaddr ld c,$80 ld a,d and $07 ld b,a jr z,SkpShft .ShftOne srl c djnz ShftOne .SkpShft ; c = pixel bit. ld a,d srl a srl a srl a ; a = pixel byte ld h,b ld l,e ; HL = Y ld d,h ; DE = Y ; ;we need to multiply Y by 30 ; add hl,hl ; HL = 2*Y add hl,hl ; HL = 4*Y add hl,hl ; HL = 8*Y add hl,hl ; HL = 16*Y sbc hl,de ; HL = 15*Y add hl,hl ; HL = 30*Y ld de,$a000 add hl,de ld e,a ld d,0 add hl,de ; hl = memory address ; c = pixel bit ret
Models/Car System module/CarSystem004/CarSystem004Functions.asm
fmselab/ABZ2020CaseStudyInAsmeta
0
87758
<gh_stars>0 //Ground model of Adaptive Exterior Light and Speed Control System //Direction Blinking //Hazard warning light //from ELS-1 to ELS-13 module CarSystem004Functions import ../../StandardLibrary import CarSystem004Domains import ../CarSystem002/CarSystem002Functions export * signature: // FUNCTIONS monitored currentVoltage: Voltage // Current voltage derived subVoltage: Boolean //Depending on currentVoltage returns true if subvoltage is present or false otherwise derived overVoltage: Boolean //Depending on currentVoltage returns true if overvoltage is present or false otherwise derived overVoltageMaxValueLight: LightPercentage //Maximum light intensity in case of Overvoltage in percentage derived overVoltageMaxValueHighBeam: HighBeamRange //Maximum light intensity in case of Overvoltage in percentage derived setOverVoltageValueLight: Integer -> LightPercentage derived setOverVoltageValueHighBeam: HighBeamRange -> HighBeamRange definitions: // FUNCTION DEFINITIONS function subVoltage = (currentVoltage < 80) function overVoltage = (currentVoltage > 140) function overVoltageMaxValueLight = (100-(currentVoltage-140)*20) //ELS-47 function setOverVoltageValueLight ($value in Integer) = //$value in LightPercentage if (overVoltage and $value > overVoltageMaxValueLight) then overVoltageMaxValueLight else $value endif //ELS-47 function setOverVoltageValueHighBeam ($value in HighBeamRange) = if (overVoltage and $value > overVoltageMaxValueHighBeam) then overVoltageMaxValueHighBeam else $value endif function overVoltageMaxValueHighBeam = (100-(currentVoltage-140)*20)
dos/cga_comp.asm
michaelcmartin/bumbershoot
20
242565
;;; CGALORES.ASM - Demonstration of the 160x100x16 mode on CGA systems. ;;; by <NAME>, 2015, for the Bumbershoot Software blog ;;; This code is BSD-licensed; see the repository's general license ;;; for details ;;; This was written for the Netwide Assembler (www.nasm.us) ;;; To assemble, put this and cgalores.dat in the same directory ;;; and issue this command: ;;; nasm -f bin -o cga_comp.com cga_comp.asm ;;; ;;; The result will run in DOSBox, but you need to change the line ;;; machine=svga_s3 ;;; to ;;; machine=cga ;;; or you will get a stippled monochrome display instead. ;; This is a .COM file, so, 16-bit real mode, starts at 100h cpu 8086 org 100h bits 16 ;; Enter CGA Composite artifact color mode mov ax, 0x0006 int 10h mov al, 0x1a mov dx, 0x3d8 out dx, al ;; Create our sample display call draw_bars ;; Cycle through the 15 foreground options. ;; NOTE: This is CGA-specific; VGA systems will ignore this ;; and just make you hit a key 16 times to quit mov cx, 15 loop: mov al, cl mov dx, 0x3d9 out dx, al call wait_for_key loop loop ;; Back to 80-column color text mode mov ax, 3 int 10h ret draw_bars: ;; Draw the even scanlines xor di, di call .halfframe ;; Now draw the odd scanlines by altering the base offset and ;; falling through mov di, 0x2000 .halfframe: cld mov ax, 0xb800 mov es, ax xor ax, ax add di, 0x140 ; Skip first 8 scanlines mov dx, 16 .lp: mov cx, 240 ; 6 scanlines per bar rep stosw add ax, 0x1111 ; next color dec dx jnz .lp ret wait_for_key: mov ah, 06h mov dl, 0xff int 21h jz wait_for_key .wait_for_no_key: mov ah, 06h mov dl, 0xff int 21h jnz .wait_for_no_key ret
exercises/practice/resistor-color/.meta/example.asm
jonboland/x86-64-assembly
21
84869
default rel section .rodata black: db "black", 0 brown: db "brown", 0 red: db "red", 0 orange: db "orange", 0 yellow: db "yellow", 0 green: db "green", 0 blue: db "blue", 0 violet: db "violet", 0 grey: db "grey", 0 white: db "white", 0 color_array: dq black dq brown dq red dq orange dq yellow dq green dq blue dq violet dq grey dq white dq 0 ; Sentinel value to indicate end of array ; ; Convert a resistor band's color to its numeric representation. ; ; Parameters: ; rdi - color ; Returns: ; rax - the resistor band's numeric representation or -1 if not found ; section .text global color_code color_code: xor eax, eax ; Initialize array index lea rcx, [color_array] ; Load color array mov rdx, [rcx + rax * 8] ; Read color from array .arr_loop_start: mov rsi, rdi ; Save input color mov r8b, byte [rdx] ; Read char from color cmp r8b, byte [rsi] ; Compare with char from input color jne .str_loop_end ; If not equal, skip loop .str_loop_start: inc rdx ; Advance color to next char inc rsi ; Advance input color to next char mov r8b, byte [rdx] ; Read char from color cmp r8b, byte [rsi] ; Compare with char from input color jne .str_loop_end ; If not equal, exit loop test r8b, r8b ; See if we reached end of color jne .str_loop_start ; If chars remain, loop back .str_loop_end: cmp r8b, byte [rsi] ; Check if we found a match je .return ; If we found a match, return the array index inc eax ; Increment array index mov rdx, [rcx + rax * 8] ; Read color from array test rdx, rdx ; See if we reached end of array jne .arr_loop_start ; If colors remain, loop back mov eax, -1 ; Return -1 .return: ret ; ; Get a list of resistor band colors. ; ; Returns: ; rax - a list of colors ; global colors colors: lea rax, [color_array] ; Return the list of colors ret
mappings/c11_ppc.als
mpardalos/memalloy
20
2030
open ../archs/exec_C[SE] as SW open ../archs/exec_ppc[HE] as HW /* A C11-to-Power mapping. */ module c11_ppc[SE,HE] pred apply_map[X:Exec_C, X':Exec_PPC, map:SE->HE] { X.EV = SE X'.EV = HE // two SW events cannot be compiled to a single HW event map in X.EV lone -> X'.EV // HW reads/writes cannot be invented by the compiler all e : X'.(R+W) | one e.~map // SW reads/writes cannot be discarded by the compiler //all e : X.(R+W) | some e.map // a non-atomic read compiles to a single read all e : X.R - X.A { one e.map e.map in X'.R } // a relaxed read compiles to read;ctrl all e : X.R & X.A - X.ACQ - dom[X.atom] | let e1 = e.map { one e1 e1 in X'.R e1 <: (X'.sb) in (X'.cd) } // an acquire read compiles to a read followed by // a control fence, with control dependencies inserted between the // read and every event that is sequenced after it. all e : X.R & X.ACQ - X.SC - dom[X.atom] | let e1 = e.map { one e1 e1 in X'.R e1 <: (X'.sb) in (X'.cd) & (isync[none->none,X']) } // an SC read compiles to a full fence followed by a read // followed by a control fence, with control dependencies inserted // between the read and every event that is sequenced after it all e : X.R & X.SC - dom[X.atom] | let e1 = e.map { one e1 e1 in X'.R (X'.sb) :> e1 in (sync[none->none,X']) e1 <: (X'.sb) in (X'.cd) & (isync[none->none,X']) } // a non-atomic or relaxed write compiles to a single write all e : X.W - X.REL - ran[X.atom] { one e.map e.map in X'.W } // a release write compiles to a lightweight fence followed // by a write all e : X.W & X.REL - X.SC - ran[X.atom] | let e1 = e.map { one e1 e1 in X'.W (X'.sb) :> e1 in (lwsync[none->none,X']) } // an SC write compiles to a full fence followed by a write all e : X.W & X.SC - ran[X.atom] | let e1 = e.map { one e1 e1 in X'.W (X'.sb) :> e1 in (sync[none->none,X']) } // the read part of a relaxed or acquire RMW compiles to read;ctrl all e : X.R & dom[X.atom] - X.ACQ | let e1 = e.map { one e1 e1 in X'.R e1 <: (X'.sb) in X'.cd } // the write part of a relaxed RMW compiles to a write all e : X.W & ran[X.atom] - X.REL | let e1 = e.map { one e1 e1 in X'.W } // the read part of an acquire RMW compiles to read;ctrl all e : X.R & X.ACQ & dom[X.atom] - (X.atom).(X.REL) | let e1 = e.map { one e1 e1 in X'.R e1 <: (X'.sb) in X'.cd } // the write part of an acquire or acquire-release or SC RMW compiles to write;isync all e : X.W & (X.ACQ).(X.atom) | let e1 = e.map { one e1 e1 in X'.W e1 <: (X'.sb) in isync[none->none,X'] } // the read part of a release or acquire-release RMW compiles to lwsync;read;ctrl all e : X.R & (X.atom).(X.REL) - X.SC | let e1 = e.map { one e1 e1 in X'.R (X'.sb) :> e1 in lwsync[none->none,X'] e1 <: (X'.sb) in X'.cd } // the write part of a release RMW compiles to a write all e : X.W & X.REL & ran[X.atom] - (X.ACQ).(X.atom) | let e1 = e.map { one e1 e1 in X'.W } // the read part of an SC RMW compiles to sync;read;ctrl all e : X.R & X.SC & dom[X.atom] | let e1 = e.map { one e1 e1 in X'.R (X'.sb) :> e1 in sync[none->none,X'] e1 <: (X'.sb) in X'.cd } // release or acquire fences compile to lightweight fences all e : X.(F & (ACQ + REL) - SC) { (X.sb) . (stor[e]) . (X.sb) = map . (lwsync[none->none,X']) . ~map } // SC fences compile to full fences all e : X.(F & SC) { (X.sb) . (stor[e]) . (X.sb) = map . (sync[none->none,X']) . ~map } // sb edges are preserved (but more may be introduced) X.sb in map . (X'.sb) . ~map // the mapping preserves rf X.rf = map . (X'.rf) . ~map // the mapping preserves co X.co = map . (X'.co) . ~map // the mapping preserves address dependencies X.ad = map . (X'.ad) . ~map // the mapping preserves data dependencies X.dd = map . (X'.dd) . ~map // the mapping preserves locations X.sloc = map . (X'.sloc) . ~map // ctrl dependencies are preserved (but more may be introduced) X.cd in map . (X'.cd) . ~map // the mapping preserves threads X.sthd = map . (X'.sthd) . ~map // the mapping preserves rmw-edges X.atom = map . (X'.atom) . ~map }
LibraBFT/Concrete/Intermediate.agda
cwjnkins/bft-consensus-agda
0
12644
<gh_stars>0 {- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9. Copyright (c) 2020, 2021, Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl -} -- This module defines an intermediate (between an implementation and Abstract) notion -- of a system state. The goal is to enable proving for a particular implementation -- the properties required to provide to Abstract.Properties in order to get the high -- level correctness conditions, while moving the obligations for the implementation -- closer to notions more directly provable for an implementation. However, as our -- experience has developed with this, it seems that this was not a very effective -- choice, as it leaves too much burden on the implementation (e.g., proving -- ∈QC⇒HasBeenSent). Therefore, ... -- -- TODO-3: Revisit assumptions of the IntermediateSystemState to enable more proof work -- to be done under Concrete, which can be used by multiple implementations. As it -- currently stands, we have specific notions under LibraBFT.Impl that possibly should -- be provided as module parameters to LibraBFT.Concrete (including IsValidVote and -- α-ValidVote) open import LibraBFT.Prelude open import LibraBFT.Impl.Base.Types open import LibraBFT.Abstract.Types.EpochConfig UID NodeId open WithAbsVote module LibraBFT.Concrete.Intermediate (𝓔 : EpochConfig) (𝓥 : VoteEvidence 𝓔) where open import LibraBFT.Abstract.Abstract UID _≟UID_ NodeId 𝓔 𝓥 -- Since the invariants we want to specify (votes-once and preferred-round-rule), -- are predicates over a /System State/, we must factor out the necessary -- functionality. -- -- An /IntermediateSystemState/ supports a few different notions; namely, record IntermediateSystemState (ℓ : Level) : Set (ℓ+1 ℓ) where field -- A notion of membership of records InSys : Record → Set ℓ -- A predicate about whether votes have been transfered -- amongst participants HasBeenSent : Vote → Set ℓ -- Such that, the votes that belong to honest participants inside a -- QC that exists in the system must have been sent ∈QC⇒HasBeenSent : ∀{q α} → InSys (Q q) → Meta-Honest-Member α → (va : α ∈QC q) → HasBeenSent (∈QC-Vote q va)
source/Pas2.asm
bootrino/gpascal
0
7174
************************************************ 2 * PASCAL COMPILER 3 * for Commodore 64 4 * PART 2 5 * Authors: <NAME> & <NAME> 6 * SYM $9000 ************************************************ 8 * 9 P1 EQU $8013 10 P2 EQU $8DD4 11 P3 EQU $992E 12 P4 EQU $A380 13 P5 EQU $B384 14 P6 EQU $BCB8 15 * 16 STACK EQU $100 17 INBUF EQU $33C 18 KBD:BUF EQU $277 19 HIMEM EQU $283 20 COLOR EQU $286 21 HIBASE EQU $288 22 AUTODN EQU $292 23 BITNUM EQU $298 24 BAUDOF EQU $299 25 RODBS EQU $29D 26 RODBE EQU $29E 27 ENABRS EQU $2A1 ; RS232 enables 28 WARM:STR EQU $302 ; basic warm start vector 29 CINV EQU $314 ; hardware interrupt vector 30 * 31 SPACE EQU $20 32 CR EQU $D 33 FF EQU $C 34 LF EQU $A 35 MAX:STK EQU 32 36 NEW:STK EQU $FF 37 * 38 VIC EQU $D000 39 SID EQU $D400 40 CIA1 EQU $DC00 41 CIA2 EQU $DD00 42 DATAREG EQU $DD01 43 DDRB EQU $DD03 44 FLAG EQU $DD0D 45 BORDER EQU $D020 46 BKGND EQU $D021 47 * 48 COUT EQU $FFD2 49 STOP EQU $FFE1 50 GETIN EQU $FFE4 51 CHKOUT EQU $FFC9 52 CLRCHN EQU $FFCC 53 UNLSN EQU $FFAE 54 UNTKL EQU $FFAB 55 CHRIN EQU $FFCF 56 CHKIN EQU $FFC6 57 PLOT EQU $FFF0 58 CHROUT EQU $FFD2 59 CINT EQU $FF81 60 IOINIT EQU $FF84 61 CLALL EQU $FFE7 62 SETMSG EQU $FF90 63 SETLFS EQU $FFBA 64 SETNAM EQU $FFBD 65 OPEN EQU $FFC0 66 LOAD EQU $FFD5 67 READST EQU $FFB7 68 SAVE EQU $FFD8 69 RAMTAS EQU $FF87 70 RESTOR EQU $FF8A 71 MEMTOP EQU $FF99 72 UNTLK EQU $FFAB 73 CLOSE EQU $FFC3 74 * 75 * 76 DUM $2A7 77 * 78 * PASCAL WORK AREAS 79 * ************************************************ 81 LINE:CNT EQU $2 ; 2 BYTES 82 LINE:NO EQU LINE:CNT 83 REG EQU $4 ; 2 BYTES 84 ROWL EQU REG 85 ROWH EQU REG+1 86 SRCE EQU REG 87 REG2 EQU $6 ; 2 BYTES 88 DEST EQU REG2 89 WX EQU $8 ; 2 BYTES 90 ERR:RTN EQU $B ; 2 BYTES 91 SYMTBL EQU $D 92 TOKEN EQU $16 93 TKNADR EQU $17 ; 2 BYTES 94 TKNLEN EQU $19 95 EOF EQU $1A 96 LIST EQU $1B 97 NXTCHR EQU $1C ; 2 BYTES 98 VALUE EQU $1E ; 3 BYTES 99 DIGIT EQU $21 100 NOTRSV EQU $22 101 FRAME EQU $23 ; 2 BYTES 102 LEVEL EQU $25 103 PCODE EQU $26 104 P EQU PCODE 105 PNTR EQU PCODE 106 ACT:PCDA EQU $28 ; 2 BYTES 107 DISPL EQU $2A ; 2 BYTES 108 OFFSET EQU $2C ; 2 BYTES 109 OPND EQU $2E ; 3 BYTES 110 DCODE EQU $31 111 ENDSYM EQU $32 ; 2 BYTES 112 ARG EQU $34 113 PROMPT EQU $35 114 WORKD EQU $36 ; 2 BYTES 115 ERRNO EQU $38 116 RTNADR EQU $39 ; 2 BYTES 117 BSAVE EQU $3B 118 WORK EQU $3C ; 2 BYTES 119 PRCITM EQU $3E ; 2 BYTES 120 DSPWRK EQU $40 ; 2 BYTES 121 PFLAG EQU $42 122 T EQU ENDSYM ; STACK POINTER 2 BYTES 123 TMP:PNTR EQU T 124 BASE EQU $45 ; 2 BYTES 125 TO EQU BASE 126 DATA EQU $47 ; 2 BYTES 127 RUNNING EQU $49 128 UPR:CASE EQU $4A 129 SCE:LIM EQU $4B ; 2 BYTES 130 FUNCTION EQU SCE:LIM 131 SPRITENO EQU SCE:LIM+1 132 STK:USE EQU $4D 133 VOICENO EQU STK:USE 134 SYMITM EQU $4E ; 2 BYTES 135 FROM EQU SYMITM 136 SYNTAX EQU $50 137 CHK:ARY EQU $51 138 SECRET EQU $52 139 VAL:CMP EQU $53 140 CTRLC:RT EQU $54 ; 2 BYTES 141 END:PCD EQU $56 ; 2 BYTES 142 REGB EQU $58 143 REG2B EQU $59 144 LEFTCOL EQU $5A 145 SIGN EQU $5B 146 TEMP EQU $5C ; 2 BYTES 147 CALL EQU $5E ; 2 BYTES 148 COUNT EQU $60 149 LNCNT EQU $61 150 LS EQU $62 151 PCSVD EQU $63 ; 2 BYTES 152 FIRST EQU $65 153 DBGTYP EQU $66 154 DBGFLG EQU $67 155 DEFP EQU $68 ; 2 BYTES 156 DEFS EQU $6A ; 2 BYTES 157 DATTYP EQU $6C 158 DOS:FLG EQU DATTYP 159 A5 EQU $6D ; 2 BYTES 160 MASK EQU A5 161 COLL:REG EQU A5+1 162 ST EQU $90 163 DFLTN EQU $99 ; input device 164 QUEUE EQU $C6 165 INDX EQU $C8 166 LXSP EQU $C9 167 BLNSW EQU $CC 168 BLNON EQU $CF 169 CRSW EQU $D0 170 BASL EQU $D1 171 CH EQU $D3 172 * 173 P:STACK EQU $CED0 ; P-CODE STACK 174 S:ANIMCT EQU $CED8 ; count of frames 175 S:ANIMPS EQU $CEE0 ; current position 176 S:ANIMCC EQU $CEE8 ; current frame count 177 S:ANIMFM EQU $CEF0 ; no. of frames 178 S:POINTR EQU $CEF8 ; pointers - 16 per sprite 179 SID:IMG EQU $CF7C 180 S:ACTIVE EQU $CF98 181 S:XPOS EQU $CFA0 ; 3 bytes each 182 S:YPOS EQU $CFB8 ; 2 bytes each 183 S:XINC EQU $CFC8 ; 3 bytes each 184 S:YINC EQU $CFE0 ; 2 bytes each 185 S:COUNT EQU $CFF0 ; 2 bytes each 186 * 187 COUNT1 DS 1 188 COUNT2 DS 1 189 SYM:USE DS 2 ; 2 BYTES 190 SAVCUR DS 6 ; 6 BYTES 191 BPOINT DS 20 192 CALL:P EQU BPOINT 193 CALL:A EQU BPOINT+1 194 CALL:X EQU BPOINT+2 195 CALL:Y EQU BPOINT+3 196 FNC:VAL EQU BPOINT+15 197 REMAIN EQU BPOINT+4 198 XPOSL EQU BPOINT+15 199 XPOSH EQU BPOINT+16 200 YPOS EQU BPOINT+17 201 CNTR EQU BPOINT+10 202 REP:FROM EQU BPOINT+2 203 REP:TO EQU BPOINT+3 204 REP:LEN EQU BPOINT+4 205 PNTR:HI EQU BPOINT+5 206 IN:LGTH EQU BPOINT+6 207 LENGTH EQU BPOINT+7 208 FROM:ST EQU BPOINT+9 209 NUM:LINS EQU BPOINT+11 210 ED:COM EQU BPOINT+13 211 TO:LINE EQU BPOINT+15 212 FND:FROM EQU BPOINT+17 213 FND:TO EQU BPOINT+18 214 FND:POS EQU BPOINT+19 215 LASTP DS 2 216 INCHAR DS 1 217 IO:A DS 1 218 IO:Y DS 1 219 IO:X DS 1 220 CURR:CHR DS 1 221 HEX:WK DS 1 222 DS 2 223 STK:AVL DS 1 224 STK:PAGE DS 1 225 STK:WRK DS 1 226 STK:RT DS 2 227 BEG:STK DS 1 228 XSAVE DS 1 229 RES DS 3 ; 3 BYTES 230 MCAND DS 3 ; 3 BYTES 231 DIVISOR EQU MCAND 232 DVDN DS 3 ; 3 BYTES 233 RMNDR DS 1 234 TEMP1 DS 2 235 BIN:WRK DS 3 236 ASC:WRK DS 10 237 DEF:PCD DS 1 238 REP:SIZE DS 1 239 NLN:FLAG DS 1 240 Q:FLAG DS 1 241 FND:FLG DS 1 242 FND:LEN DS 1 243 UC:FLAG DS 1 244 TRN:FLAG DS 1 245 GLB:FLAG DS 1 246 INT:RTN DS 2 ; address to return to after a timer interrupt 247 INT:TEMP DS 1 ; for interrupt service routine 248 INT:TMP1 DS 1 249 INT:TMP2 DS 1 250 QT:TGL DS 1 ; quote toggle 251 QT:SIZE DS 1 ; number of characters in reserved words 252 DEND ************************************************ 254 * SYMBOL TABLE DEFINES - RELATIVE TO SYMBOL TABLE ENTRY ************************************************ 256 SYMPRV EQU 0 257 SYMLVL EQU 2 258 SYMTYP EQU 3 259 SYMDSP EQU 4 260 SYMARG EQU 6 261 SYMSUB EQU 6 262 SYMDAT EQU 8 263 SYMLEN EQU 9 264 SYMNAM EQU 10 ************************************************ 266 * ADDRESS CONSTANTS ETC. ************************************************ 268 DUM $8000 269 DS 3 270 DS 3 271 DS 3 8009: 00 40 272 TS DA $4000 800B: 10 273 SYM:SIZE DFB 16 800C: 5B 274 LHB ASC '[' 800D: 5D 275 RHB ASC ']' 800E: 22 276 QUOT:SYM ASC '"' ; QUOTE SYMBOL 800F: 3A 277 DELIMIT ASC ':' ; FIND/REPLACE DELIMITER 8010: 04 278 PR:CHAN DFB 4 ; PRINTER CHANNEL 8011: 08 279 DISK:CHN DFB 8 ; DISK CHANNEL 8012: 00 280 DFB 0 ; SPARE FOR NOW 281 DEND 282 * ************************************************ 284 * PART 1 VECTORS ************************************************ 286 V1 EQU P1 287 INIT EQU V1 288 GETNEXT EQU V1+3 289 COMSTL EQU V1+6 290 ISITHX EQU V1+9 291 ISITAL EQU V1+12 292 ISITNM EQU V1+15 293 CHAR EQU V1+18 294 GEN2:B EQU V1+21 295 DISHX EQU V1+24 296 ERROR EQU V1+27 297 GETCHK EQU V1+30 298 CHKTKN EQU V1+33 299 GENNOP EQU V1+36 300 GENADR EQU V1+39 301 GENNJP EQU V1+42 302 GENNJM EQU V1+45 303 TKNWRK EQU V1+48 304 PRBYTE EQU V1+51 305 GTOKEN EQU V1+54 306 WRKTKN EQU V1+57 307 FIXAD EQU V1+60 308 PSHWRK EQU V1+63 309 PULWRK EQU V1+66 310 PC EQU V1+69 311 PT EQU V1+72 312 PL EQU V1+75 313 PC8 EQU V1+78 314 GETANS EQU V1+81 315 PUTSP EQU V1+84 316 DISPAD EQU V1+87 317 CROUT EQU V1+90 318 SHLVAL EQU V1+93 319 GET:NUM EQU V1+96 320 GET:HEX EQU V1+99 321 FND:ENQ EQU V1+102 322 PAUSE EQU V1+105 323 HOME EQU V1+108 324 RDKEY EQU V1+111 325 GENJMP EQU V1+114 326 GENRJMP EQU V1+117 ************************************************ 328 * PART 2 STARTS HERE ************************************************ 330 ORG P2 ************************************************ 332 * PART 2 VECTORS ************************************************ 8DD4: 4C 63 93 334 JMP STMNT 8DD7: 4C 04 93 335 JMP EXPRES 8DDA: 4C 13 8E 336 JMP CHKLHP 8DDD: 4C 1A 8E 337 JMP CHKRHP 8DE0: 4C 2D 8E 338 JMP CHKLHB 8DE3: 4C 38 8E 339 JMP CHKRHB 8DE6: 4C A6 8F 340 JMP LOOKUP 8DE9: 4C B1 8F 341 JMP CHKDUP 8DEC: 4C C1 8F 342 JMP CONDEC 8DEF: 4C DB 90 343 JMP VARDEC 8DF2: 4C B4 90 344 JMP CONST 8DF5: 4C 24 8E 345 JMP GETSUB 8DF8: 4C 6E 94 346 JMP W:STRING 8DFB: 4C 4C 80 347 JMP WRKTKN 8DFE: 4C EC 8F 348 JMP SYMWRK 8E01: 4C F7 8F 349 JMP WRKSYM 8E04: 4C 02 90 350 JMP PSHPCODE 8E07: 4C A8 90 351 JMP CHK:STAK 8E0A: 4C 54 8E 352 JMP SEARCH 8E0D: 4C C5 8E 353 JMP ADDSYM 8E10: 4C 77 8F 354 JMP TKNJMP ************************************************ 356 * 357 * PART 6 VECTORS ************************************************ 359 BLOCK EQU P6 360 * 361 * 362 CHKLHP EQU * 8E13: A9 28 363 LDA #'(' 8E15: A2 1F 364 LDX #31 8E17: 4C 31 80 365 JMP GETCHK 366 * 367 CHKRHP EQU * 8E1A: A9 29 368 LDA #')' 8E1C: A2 16 369 LDX #22 8E1E: 20 34 80 370 JSR CHKTKN 8E21: 4C 49 80 371 JMP GTOKEN 372 * 373 GETSUB EQU * 8E24: 20 2D 8E 374 JSR CHKLHB 8E27: 20 04 93 375 JSR EXPRES 8E2A: 4C 38 8E 376 JMP CHKRHB 377 * 378 CHKLHB EQU * 8E2D: AD 0C 80 379 LDA LHB 8E30: A2 21 380 LDX #33 8E32: 20 31 80 381 JSR GETCHK 8E35: 4C 49 80 382 JMP GTOKEN 383 * 384 CHKRHB EQU * 8E38: AD 0D 80 385 LDA RHB 8E3B: A2 22 386 LDX #34 8E3D: 20 34 80 387 JSR CHKTKN 8E40: 4C 49 80 388 JMP GTOKEN 389 * 390 GET:LEV EQU * 8E43: A5 25 391 LDA LEVEL 8E45: A0 02 392 LDY #SYMLVL 8E47: 38 393 SEC 8E48: F1 4E 394 SBC (SYMITM),Y 8E4A: 85 2A 395 STA DISPL 8E4C: 60 396 RTS 397 * 398 GET:DAT EQU * 8E4D: A0 08 399 LDY #SYMDAT 8E4F: B1 4E 400 LDA (SYMITM),Y 8E51: 85 6C 401 STA DATTYP 8E53: 60 402 RTS 403 * 404 * ************************************************ 406 *SEARCH SYMBOL TABLE ************************************************ 408 SEARCH EQU * 8E54: A5 32 409 LDA ENDSYM 8E56: 85 4E 410 STA SYMITM 8E58: A5 33 411 LDA ENDSYM+1 8E5A: 85 4F 412 STA SYMITM+1 413 SEA1 EQU * 8E5C: A0 00 414 LDY #SYMPRV 8E5E: B1 4E 415 LDA (SYMITM),Y 8E60: AA 416 TAX 8E61: C8 417 INY 8E62: B1 4E 418 LDA (SYMITM),Y 8E64: 85 4F 419 STA SYMITM+1 ; PREVIOUS LINK 8E66: 8A 420 TXA 8E67: 85 4E 421 STA SYMITM 8E69: 05 4F 422 ORA SYMITM+1 8E6B: D0 01 423 BNE SEA2 ; MORE TO GO 8E6D: 60 424 RTS ; FINISHED 425 SEA2 EQU * 8E6E: A0 09 426 LDY #SYMLEN 8E70: B1 4E 427 LDA (SYMITM),Y 8E72: C5 19 428 CMP TKNLEN 8E74: D0 E6 429 BNE SEA1 ; WRONG LENGTH 8E76: A5 4E 430 LDA SYMITM 8E78: 18 431 CLC 8E79: 69 0A 432 ADC #SYMNAM 8E7B: 85 06 433 STA DEST 8E7D: A5 4F 434 LDA SYMITM+1 8E7F: 69 00 435 ADC #0 8E81: 85 07 436 STA DEST+1 8E83: A5 17 437 LDA TKNADR 8E85: 85 04 438 STA SRCE 8E87: A5 18 439 LDA TKNADR+1 8E89: 85 05 440 STA SRCE+1 8E8B: A4 19 441 LDY TKNLEN 8E8D: 20 19 80 442 JSR COMSTL 8E90: D0 CA 443 BNE SEA1 ; NOT THAT ONE 8E92: 20 4D 8E 444 JSR GET:DAT 8E95: A0 02 445 LDY #SYMLVL 8E97: B1 4E 446 LDA (SYMITM),Y 8E99: AA 447 TAX ; LEVEL 8E9A: A0 03 448 LDY #SYMTYP 8E9C: B1 4E 449 LDA (SYMITM),Y 8E9E: 85 3B 450 STA BSAVE 8EA0: C9 43 451 CMP #'C' ; CONSTANT 8EA2: D0 13 452 BNE SEA4 8EA4: A0 04 453 LDY #SYMDSP 8EA6: B1 4E 454 LDA (SYMITM),Y 8EA8: 85 1E 455 STA VALUE 8EAA: C8 456 INY 8EAB: B1 4E 457 LDA (SYMITM),Y 8EAD: 85 1F 458 STA VALUE+1 8EAF: C8 459 INY 8EB0: B1 4E 460 LDA (SYMITM),Y 8EB2: 85 20 461 STA VALUE+2 8EB4: 4C C2 8E 462 JMP SEA3 463 SEA4 EQU * ; NOT CONSTANT 8EB7: C9 56 464 CMP #'V' ; VARIABLE? 8EB9: F0 04 465 BEQ SEA5 ; YES 8EBB: C9 59 466 CMP #'Y' ; ARGUMENT? 8EBD: D0 03 467 BNE SEA3 ; NO 468 SEA5 EQU * 8EBF: 20 15 90 469 JSR GET:OFF 470 SEA3 EQU * 8EC2: A5 3B 471 LDA BSAVE 8EC4: 60 472 RTS ; SHOULD SET 'NEQ' FLAG ************************************************ 474 * ADD SYMBOL TO SYMBOL TABLE ************************************************ 476 ADDSYM EQU * 8EC5: A6 32 477 LDX ENDSYM 8EC7: 86 4E 478 STX SYMITM 8EC9: A6 33 479 LDX ENDSYM+1 8ECB: 86 4F 480 STX SYMITM+1 8ECD: A0 03 481 LDY #SYMTYP 8ECF: 91 4E 482 STA (SYMITM),Y 8ED1: A0 02 483 LDY #SYMLVL 8ED3: 48 484 PHA 8ED4: A5 25 485 LDA LEVEL 8ED6: 91 4E 486 STA (SYMITM),Y 8ED8: A0 09 487 LDY #SYMLEN 8EDA: A5 19 488 LDA TKNLEN 8EDC: 91 4E 489 STA (SYMITM),Y 8EDE: A8 490 TAY 8EDF: 88 491 DEY 8EE0: A5 4E 492 LDA SYMITM 8EE2: 18 493 CLC 8EE3: 69 0A 494 ADC #SYMNAM 8EE5: 85 06 495 STA DEST 8EE7: A5 4F 496 LDA SYMITM+1 8EE9: 69 00 497 ADC #0 8EEB: 85 07 498 STA DEST+1 499 ADD1 EQU * 8EED: B1 17 500 LDA (TKNADR),Y 8EEF: C9 C1 501 CMP #$C1 8EF1: 90 02 502 BLT ADD2 8EF3: 29 7F 503 AND #$7F ; UPPER CASE 504 ADD2 EQU * 8EF5: 91 06 505 STA (DEST),Y 8EF7: 88 506 DEY 8EF8: 10 F3 507 BPL ADD1 8EFA: A5 06 508 LDA DEST 8EFC: 18 509 CLC 8EFD: 65 19 510 ADC TKNLEN 8EFF: 85 32 511 STA ENDSYM 8F01: A5 07 512 LDA DEST+1 8F03: 69 00 513 ADC #0 8F05: 85 33 514 STA ENDSYM+1 8F07: AD AA 02 515 LDA SYM:USE+1 8F0A: C5 33 516 CMP ENDSYM+1 8F0C: 90 09 517 BLT SYM:NEW 8F0E: D0 11 518 BNE SYM:LOW 8F10: AD A9 02 519 LDA SYM:USE 8F13: C5 32 520 CMP ENDSYM 8F15: B0 0A 521 BGE SYM:LOW 8F17: A5 32 522 SYM:NEW LDA ENDSYM 8F19: 8D A9 02 523 STA SYM:USE 8F1C: A5 33 524 LDA ENDSYM+1 8F1E: 8D AA 02 525 STA SYM:USE+1 526 SYM:LOW EQU * 8F21: A5 33 527 LDA ENDSYM+1 8F23: CD 84 02 528 CMP HIMEM+1 8F26: 90 0E 529 BLT SYM:NTFL 8F28: D0 07 530 BNE SYM:FULL 8F2A: A5 32 531 LDA ENDSYM 8F2C: CD 83 02 532 CMP HIMEM 8F2F: 90 05 533 BLT SYM:NTFL 8F31: A2 25 534 SYM:FULL LDX #37 8F33: 20 2E 80 535 JSR ERROR 536 SYM:NTFL EQU * 537 * 8F36: 68 538 PLA 8F37: AA 539 TAX ; ENTRY TYPE 8F38: C9 43 540 CMP #'C' ; CONSTANT?? 8F3A: D0 13 541 BNE ADD4 8F3C: A0 04 542 LDY #SYMDSP 8F3E: A5 1E 543 LDA VALUE 8F40: 91 4E 544 STA (SYMITM),Y 8F42: C8 545 INY 8F43: A5 1F 546 LDA VALUE+1 8F45: 91 4E 547 STA (SYMITM),Y 8F47: C8 548 INY 8F48: A5 20 549 LDA VALUE+2 8F4A: 91 4E 550 STA (SYMITM),Y 8F4C: 4C 6B 8F 551 JMP ADD9 552 ADD4 EQU * 8F4F: A0 08 553 LDY #SYMDAT 8F51: A9 01 554 LDA #1 8F53: 91 4E 555 STA (SYMITM),Y 8F55: 8A 556 TXA 8F56: C9 56 557 CMP #'V' 8F58: D0 11 558 BNE ADD9 8F5A: A0 05 559 LDY #SYMDSP+1 8F5C: A5 24 560 LDA FRAME+1 8F5E: 91 4E 561 STA (SYMITM),Y 8F60: 88 562 DEY 8F61: A5 23 563 LDA FRAME 8F63: 91 4E 564 STA (SYMITM),Y 8F65: E6 23 565 INC FRAME 8F67: D0 02 566 BNE ADD9 8F69: E6 24 567 INC FRAME+1 568 ADD9 EQU * 8F6B: A0 00 569 LDY #SYMPRV 8F6D: A5 4E 570 LDA SYMITM 8F6F: 91 32 571 STA (ENDSYM),Y 8F71: C8 572 INY 8F72: A5 4F 573 LDA SYMITM+1 8F74: 91 32 574 STA (ENDSYM),Y 8F76: 60 575 RTS 576 * ************************************************ 578 * JUMP ON TOKEN 579 * X/Y = START OF TABLE 580 * END OF TABLE IS A NULL 581 * A = TOKEN ************************************************ 583 TKNJMP EQU * 8F77: 86 04 584 STX REG 8F79: 84 05 585 STY REG+1 8F7B: AA 586 TAX 587 JMP1 EQU * 8F7C: A0 00 588 LDY #0 8F7E: B1 04 589 LDA (REG),Y 8F80: D0 02 590 BNE JMP2 8F82: 8A 591 TXA 8F83: 60 592 RTS 593 JMP2 EQU * 8F84: 8A 594 TXA 8F85: D1 04 595 CMP (REG),Y 8F87: D0 10 596 BNE JMP3 8F89: 68 597 PLA 8F8A: 68 598 PLA ; REMOVE RETURN ADDRESS 8F8B: C8 599 INY 8F8C: B1 04 600 LDA (REG),Y 8F8E: 85 06 601 STA REG2 8F90: C8 602 INY 8F91: B1 04 603 LDA (REG),Y 8F93: 85 07 604 STA REG2+1 8F95: 8A 605 TXA 8F96: 6C 06 00 606 JMP (REG2) 607 JMP3 EQU * 8F99: A5 04 608 LDA REG 8F9B: 18 609 CLC 8F9C: 69 03 610 ADC #3 8F9E: 85 04 611 STA REG 8FA0: 90 DA 612 BCC JMP1 8FA2: E6 05 613 INC REG+1 8FA4: D0 D6 614 BNE JMP1 615 * 616 LOOKUP EQU * 8FA6: 20 54 8E 617 JSR SEARCH 8FA9: D0 05 618 BNE LOOK1 8FAB: A2 0B 619 LDX #11 8FAD: 20 2E 80 620 JSR ERROR 8FB0: 60 621 LOOK1 RTS 622 * 8FB1: 20 54 8E 623 CHKDUP JSR SEARCH 8FB4: F0 0A 624 BEQ DUP9 8FB6: 8A 625 TXA 8FB7: C5 25 626 CMP LEVEL 8FB9: D0 05 627 BNE DUP9 8FBB: A2 26 628 LDX #38 8FBD: 20 2E 80 629 JSR ERROR 8FC0: 60 630 DUP9 RTS 631 * 632 * CONSTANT DEC 633 * 634 CONDEC EQU * 8FC1: A9 49 635 LDA #'I' 8FC3: A2 04 636 LDX #4 8FC5: 20 34 80 637 JSR CHKTKN 8FC8: 20 43 80 638 JSR TKNWRK 8FCB: A5 19 639 LDA TKNLEN 8FCD: 48 640 PHA 8FCE: A9 3D 641 LDA #'=' 8FD0: A2 03 642 LDX #3 8FD2: 20 31 80 643 JSR GETCHK 8FD5: 20 49 80 644 JSR GTOKEN 8FD8: 20 B4 90 645 JSR CONST 8FDB: 20 4C 80 646 JSR WRKTKN 8FDE: 68 647 PLA 8FDF: 85 19 648 STA TKNLEN 8FE1: 20 B1 8F 649 JSR CHKDUP 8FE4: A9 43 650 LDA #'C' 8FE6: 20 C5 8E 651 JSR ADDSYM 8FE9: 4C 49 80 652 JMP GTOKEN 653 * 654 * 655 *--- SYMITM --> WORK 656 * 657 SYMWRK EQU * 8FEC: 48 658 PHA 8FED: A5 4E 659 LDA SYMITM 8FEF: 85 3C 660 STA WORK 8FF1: A5 4F 661 LDA SYMITM+1 8FF3: 85 3D 662 STA WORK+1 8FF5: 68 663 PLA 8FF6: 60 664 RTS 665 * 666 *--- WORK --> SYMITM 667 * 668 WRKSYM EQU * 8FF7: 48 669 PHA 8FF8: A5 3C 670 LDA WORK 8FFA: 85 4E 671 STA SYMITM 8FFC: A5 3D 672 LDA WORK+1 8FFE: 85 4F 673 STA SYMITM+1 9000: 68 674 PLA 9001: 60 675 RTS 676 * 677 * PUSH PCODE ONTO STACK 678 * 679 PSHPCODE EQU * 9002: 85 3B 680 STA BSAVE 9004: 68 681 PLA 9005: AA 682 TAX 9006: 68 683 PLA 9007: A8 684 TAY 9008: A5 27 685 LDA PCODE+1 900A: 48 686 PHA 900B: A5 26 687 LDA PCODE 900D: 48 688 PHA 900E: 98 689 TYA 900F: 48 690 PHA 9010: 8A 691 TXA 9011: 48 692 PHA 9012: A5 3B 693 LDA BSAVE 9014: 60 694 RTS 695 * 696 GET:OFF EQU * 9015: 48 697 PHA 9016: A0 04 698 LDY #SYMDSP 9018: B1 4E 699 LDA (SYMITM),Y 901A: 85 2C 700 STA OFFSET 901C: C8 701 INY 901D: B1 4E 702 LDA (SYMITM),Y 901F: 85 2D 703 STA OFFSET+1 9021: A0 03 704 LDY #SYMTYP 9023: B1 4E 705 LDA (SYMITM),Y 9025: C9 56 706 CMP #'V' 9027: F0 08 707 BEQ GETO:1 9029: C9 41 708 CMP #'A' 902B: F0 04 709 BEQ GETO:1 902D: C9 59 710 CMP #'Y' 902F: D0 0D 711 BNE GETO:2 712 GETO:1 EQU * 9031: 38 713 SEC 9032: A9 FD 714 LDA #$FD 9034: E5 2C 715 SBC OFFSET 9036: 85 2C 716 STA OFFSET 9038: A9 FF 717 LDA #$FF 903A: E5 2D 718 SBC OFFSET+1 903C: 85 2D 719 STA OFFSET+1 720 GETO:2 EQU * 903E: 68 721 PLA 903F: 60 722 RTS 723 * 724 GETEXPR EQU * 9040: 20 49 80 725 JSR GTOKEN 9043: 4C 04 93 726 JMP EXPRES 727 * 728 * 729 PCD:WRKD EQU * 9046: 48 730 PHA 9047: A5 26 731 LDA PCODE 9049: 85 36 732 STA WORKD 904B: A5 27 733 LDA PCODE+1 904D: 85 37 734 STA WORKD+1 904F: 68 735 PLA 9050: 60 736 RTS 737 * 738 WRK:OPND EQU * 9051: 48 739 PHA 9052: A5 3C 740 LDA WORK 9054: 85 2E 741 STA OPND 9056: A5 3D 742 LDA WORK+1 9058: 85 2F 743 STA OPND+1 905A: 68 744 PLA 905B: 60 745 RTS 746 * 747 WRKD:WRK EQU * 905C: 48 748 PHA 905D: A5 36 749 LDA WORKD 905F: 85 3C 750 STA WORK 9061: A5 37 751 LDA WORKD+1 9063: 85 3D 752 STA WORK+1 9065: 68 753 PLA 9066: 60 754 RTS 755 * 756 WRK:WRKD EQU * 9067: 48 757 PHA 9068: A5 3C 758 LDA WORK 906A: 85 36 759 STA WORKD 906C: A5 3D 760 LDA WORK+1 906E: 85 37 761 STA WORKD+1 9070: 68 762 PLA 9071: 60 763 RTS 764 * 765 GET:COMM EQU * 9072: A9 2C 766 LDA #',' 9074: A2 20 767 LDX #32 9076: 4C 34 80 768 JMP CHKTKN 769 * 770 GET:ITEM EQU * 9079: 20 72 90 771 JSR GET:COMM ; check for comma 907C: 4C 40 90 772 JMP GETEXPR 773 * 774 VAL:MOVE EQU * 907F: 48 775 PHA 9080: 18 776 CLC 9081: A5 1E 777 LDA VALUE 9083: 85 2A 778 STA DISPL 9085: 10 01 779 BPL VAL:1 9087: 38 780 SEC 781 VAL:1 EQU * 9088: A5 1F 782 LDA VALUE+1 908A: F0 01 783 BEQ VAL:2 908C: 38 784 SEC 785 VAL:2 EQU * 908D: 85 2C 786 STA OFFSET 908F: A5 20 787 LDA VALUE+2 9091: 85 2D 788 STA OFFSET+1 9093: F0 01 789 BEQ VAL:3 9095: 38 790 SEC 791 VAL:3 EQU * 9096: 90 07 792 BCC VAL:5 9098: A9 00 793 LDA #0 909A: 20 3A 80 794 JSR GENADR 909D: 68 795 PLA 909E: 60 796 RTS 797 VAL:5 EQU * 909F: A5 1E 798 LDA VALUE 90A1: 09 80 799 ORA #$80 90A3: 20 37 80 800 JSR GENNOP 90A6: 68 801 PLA 90A7: 60 802 RTS 803 * 804 * 805 CHK:STAK EQU * 90A8: BA 806 TSX 90A9: 8A 807 TXA 90AA: C9 20 808 CMP #MAX:STK 90AC: 90 01 809 BLT STK:FULL 90AE: 60 810 RTS 811 STK:FULL EQU * 90AF: A2 1B 812 STK:ERR LDX #27 90B1: 20 2E 80 813 JSR ERROR ; FULL 814 * 815 * 816 * CONST 817 * 818 CONST EQU * 90B4: A5 16 819 LDA TOKEN 90B6: C9 4E 820 CMP #'N' 90B8: F0 20 821 BEQ CONST9 90BA: C9 49 822 CMP #'I' 90BC: F0 0E 823 BEQ CONST1 90BE: CD 0E 80 824 CMP QUOT:SYM 90C1: D0 0E 825 BNE CONST3 90C3: A6 19 826 LDX TKNLEN 90C5: E0 04 827 CPX #4 90C7: 90 11 828 BLT CONST9 90C9: 4C 5A 92 829 JMP FACERR1 ; STRING TOO BIG 90CC: 20 54 8E 830 CONST1 JSR SEARCH 90CF: D0 05 831 BNE CONST2 832 CONST3 EQU * 90D1: A2 02 833 LDX #2 90D3: 20 2E 80 834 JSR ERROR 90D6: C9 43 835 CONST2 CMP #'C' 90D8: D0 F7 836 BNE CONST3 90DA: 60 837 CONST9 RTS 838 * 839 * VARIABLE DEC 840 * 90DB: A9 49 841 VARDEC LDA #'I' 90DD: A2 04 842 LDX #4 90DF: 20 34 80 843 JSR CHKTKN 90E2: 20 B1 8F 844 JSR CHKDUP 90E5: A9 56 845 LDA #'V' 90E7: 20 C5 8E 846 JSR ADDSYM 90EA: 4C 49 80 847 JMP GTOKEN 848 * 849 * SIMPLE EXPRESSION 850 * 851 SIMEXP EQU * 90ED: A5 16 852 LDA TOKEN 90EF: C9 2B 853 CMP #'+' 90F1: F0 04 854 BEQ SIM1 90F3: C9 2D 855 CMP #'-' 90F5: D0 48 856 BNE SIM2 90F7: 48 857 SIM1 PHA 90F8: 20 49 80 858 JSR GTOKEN 90FB: 20 5F 91 859 JSR TERM 90FE: 68 860 PLA 90FF: C9 2D 861 CMP #'-' 9101: D0 05 862 BNE SIM3 9103: A9 02 863 LDA #2 9105: 20 37 80 864 JSR GENNOP ; NEGATE 9108: A5 16 865 SIM3 LDA TOKEN 910A: C9 2B 866 CMP #'+' 910C: F0 0D 867 BEQ SIM4 910E: C9 2D 868 CMP #'-' 9110: F0 09 869 BEQ SIM4 9112: C9 8A 870 CMP #$8A ; OR 9114: F0 05 871 BEQ SIM4 9116: C9 A4 872 CMP #$A4 ; XOR 9118: F0 01 873 BEQ SIM4 911A: 60 874 RTS 911B: 48 875 SIM4 PHA 911C: 20 49 80 876 JSR GTOKEN 911F: 20 5F 91 877 JSR TERM 9122: 68 878 PLA 9123: C9 2D 879 CMP #'-' 9125: F0 10 880 BEQ SIM5 9127: C9 2B 881 CMP #'+' 9129: F0 10 882 BEQ SIM6 912B: C9 A4 883 CMP #$A4 ; XOR 912D: F0 16 884 BEQ SIM8 912F: A9 1A 885 LDA #26 ; OR 9131: 20 37 80 886 SIM7 JSR GENNOP 9134: 4C 08 91 887 JMP SIM3 9137: A9 06 888 SIM5 LDA #6 ; MINUS 9139: D0 F6 889 BNE SIM7 913B: A9 04 890 SIM6 LDA #4 ; PLUS 913D: D0 F2 891 BNE SIM7 913F: 20 5F 91 892 SIM2 JSR TERM 9142: 4C 08 91 893 JMP SIM3 9145: A9 3A 894 SIM8 LDA #58 ; XOR 9147: D0 E8 895 BNE SIM7 896 * 897 * TERM 898 * 9149: 2A 899 TERMT1 ASC '*' 914A: 6C 91 900 DA TERM1 914C: 8B 901 DFB $8B 914D: 6C 91 902 DA TERM1 914F: 2F 903 ASC '/' 9150: 6C 91 904 DA TERM1 9152: 8D 905 DFB $8D 9153: 6C 91 906 DA TERM1 9155: 8C 907 DFB $8C 9156: 6C 91 908 DA TERM1 9158: 8E 909 DFB $8E 9159: 6C 91 910 DA TERM1 915B: 8F 911 DFB $8F 915C: 6C 91 912 DA TERM1 915E: 00 913 DFB 0 914 * 915F: 20 AD 91 915 TERM JSR FACTOR 9162: A2 49 916 TERM2 LDX #TERMT1 9164: A0 91 917 LDY #>TERMT1 9166: A5 16 918 LDA TOKEN 9168: 20 77 8F 919 JSR TKNJMP 916B: 60 920 RTS 921 * 916C: 48 922 TERM1 PHA 916D: 20 49 80 923 JSR GTOKEN 9170: 20 AD 91 924 JSR FACTOR 9173: 68 925 PLA 9174: A2 97 926 LDX #TERMT3 9176: A0 91 927 LDY #>TERMT3 9178: 20 77 8F 928 JSR TKNJMP 929 * 917B: A9 0A 930 TERM4 LDA #10 917D: 20 37 80 931 TERM3 JSR GENNOP 9180: 4C 62 91 932 JMP TERM2 9183: A9 1B 933 TERM5 LDA #27 ; AND 9185: D0 F6 934 BNE TERM3 9187: A9 0B 935 TERM6 LDA #11 ; MOD 9189: D0 F2 936 BNE TERM3 918B: A9 22 937 TERM7 LDA #34 918D: D0 EE 938 BNE TERM3 918F: A9 24 939 TERM8 LDA #36 9191: D0 EA 940 BNE TERM3 9193: A9 08 941 TERM9 LDA #8 9195: D0 E6 942 BNE TERM3 943 * 9197: 8B 944 TERMT3 DFB $8B 9198: 7B 91 945 DA TERM4 919A: 2F 946 ASC '/' 919B: 7B 91 947 DA TERM4 919D: 8D 948 DFB $8D 919E: 83 91 949 DA TERM5 91A0: 8C 950 DFB $8C 91A1: 87 91 951 DA TERM6 91A3: 8E 952 DFB $8E 91A4: 8B 91 953 DA TERM7 91A6: 8F 954 DFB $8F 91A7: 8F 91 955 DA TERM8 91A9: 2A 956 ASC '*' 91AA: 93 91 957 DA TERM9 91AC: 00 958 DFB 0 959 * 960 * FACTOR 961 * 91AD: 20 A8 90 962 FACTOR JSR CHK:STAK 91B0: A5 16 963 LDA TOKEN 91B2: A2 B5 964 LDX #FACTB1 91B4: A0 92 965 LDY #>FACTB1 91B6: 20 77 8F 966 JSR TKNJMP 91B9: A2 17 967 LDX #23 91BB: 20 2E 80 968 JSR ERROR 969 * 91BE: 20 A6 8F 970 IDENT JSR LOOKUP 91C1: C9 50 971 IDENT1 CMP #'P' 91C3: D0 05 972 BNE IDENT2 91C5: A2 15 973 LDX #21 91C7: 20 2E 80 974 JSR ERROR 91CA: C9 59 975 IDENT2 CMP #'Y' 91CC: D0 1D 976 BNE IDENT3 91CE: A9 00 977 LDA #0 91D0: 85 2F 978 STA OPND+1 91D2: A9 03 979 LDA #3 91D4: 85 2E 980 STA OPND 91D6: A0 00 981 LDY #SYMPRV 91D8: B1 4E 982 LDA (SYMITM),Y 91DA: AA 983 TAX 91DB: C8 984 INY 91DC: B1 4E 985 LDA (SYMITM),Y 91DE: 85 4F 986 STA SYMITM+1 91E0: 8A 987 TXA 91E1: 85 4E 988 STA SYMITM 91E3: A9 3B 989 LDA #59 91E5: 20 85 80 990 JSR GENJMP 91E8: 4C 4D 96 991 JMP FNCPRC 992 * 91EB: C9 41 993 IDENT3 CMP #'A' 91ED: F0 30 994 BEQ IDENT4 91EF: C9 43 995 CMP #'C' 91F1: D0 0E 996 BNE IDENT5 91F3: 20 7F 90 997 JSR VAL:MOVE 91F6: 4C 14 92 998 JMP IDENT7 999 * 91F9: A9 0C 1000 FACAD1 LDA #12 91FB: 20 03 92 1001 JSR IDENT5:A 91FE: 4C 1A 8E 1002 JMP CHKRHP 1003 * 9201: A9 2C 1004 IDENT5 LDA #44 9203: 48 1005 IDENT5:A PHA 1006 * 9204: 86 3B 1007 STX BSAVE 9206: A5 25 1008 LDA LEVEL 9208: 38 1009 SEC 9209: E5 3B 1010 SBC BSAVE 920B: 85 2A 1011 STA DISPL 920D: 68 1012 PLA 920E: 18 1013 IDENT6 CLC 920F: 65 6C 1014 ADC DATTYP 9211: 20 3A 80 1015 JSR GENADR 9214: 4C 49 80 1016 IDENT7 JMP GTOKEN 1017 * 9217: A9 0E 1018 FACAD2 LDA #14 9219: 20 21 92 1019 JSR IDENT4:A 921C: 4C 1A 8E 1020 JMP CHKRHP 1021 * 921F: A9 30 1022 IDENT4 LDA #48 9221: 48 1023 IDENT4:A PHA 1024 * 9222: 20 EC 8F 1025 JSR SYMWRK 9225: 20 52 80 1026 JSR PSHWRK 9228: 20 24 8E 1027 JSR GETSUB 922B: 20 55 80 1028 JSR PULWRK 922E: 20 F7 8F 1029 JSR WRKSYM 9231: 20 4D 8E 1030 JSR GET:DAT 9234: 20 43 8E 1031 JSR GET:LEV 9237: 20 15 90 1032 JSR GET:OFF 923A: 68 1033 PLA 923B: 18 1034 CLC 923C: 65 6C 1035 ADC DATTYP 923E: 4C 3A 80 1036 JMP GENADR 1037 * 1038 * ADDRESS (IDENTIFIER) 1039 * 1040 * 1041 FACADR EQU * 9241: 20 13 8E 1042 JSR CHKLHP 9244: 20 B6 94 1043 JSR GET:LOOK 9247: C9 56 1044 CMP #'V' 9249: F0 AE 1045 BEQ FACAD1 924B: C9 41 1046 CMP #'A' 924D: F0 C8 1047 BEQ FACAD2 924F: A2 17 1048 LDX #23 9251: 20 2E 80 1049 JSR ERROR 1050 * 1051 * 9254: A5 19 1052 FACSTR LDA TKNLEN 9256: C9 04 1053 CMP #4 9258: 90 05 1054 BLT FACNUM 925A: A2 1D 1055 FACERR1 LDX #29 ; STRING TOO BIG 925C: 20 2E 80 1056 JSR ERROR 1057 FACNUM EQU * 925F: 20 7F 90 1058 JSR VAL:MOVE 9262: 4C 14 92 1059 JMP IDENT7 1060 * 9265: 20 40 90 1061 PAREN JSR GETEXPR 9268: 4C 1A 8E 1062 JMP CHKRHP 1063 * 926B: A9 00 1064 FACMEM LDA #0 926D: 85 6C 1065 STA DATTYP 926F: F0 04 1066 BEQ FACM2 9271: A9 01 1067 FACMMC LDA #1 9273: 85 6C 1068 STA DATTYP 9275: A5 6C 1069 FACM2 LDA DATTYP 9277: 48 1070 PHA 9278: 20 24 8E 1071 JSR GETSUB 927B: 68 1072 PLA 927C: 18 1073 CLC 927D: 69 2E 1074 ADC #46 927F: D0 08 1075 BNE GENNOP1 1076 * 9281: 20 49 80 1077 FACNOT JSR GTOKEN 9284: 20 AD 91 1078 JSR FACTOR 9287: A9 20 1079 LDA #32 9289: 4C 37 80 1080 GENNOP1 JMP GENNOP 1081 * 928C: 20 AB 92 1082 SPCL:FAC JSR TKNCNV 928F: 20 37 80 1083 FACRND1 JSR GENNOP 9292: 4C 49 80 1084 JMP GTOKEN 1085 * 9295: A9 15 1086 S:FREEZE LDA #$15 9297: D0 0F 1087 BNE WAIT1:J 1088 * 9299: A9 5F 1089 CLOSE:FL LDA #$5F 929B: D0 0B 1090 BNE WAIT1:J 1091 * 929D: A9 60 1092 GET LDA #$60 929F: D0 07 1093 BNE WAIT1:J 1094 * 92A1: A9 61 1095 PUT LDA #$61 92A3: D0 03 1096 BNE WAIT1:J 1097 * 1098 * 92A5: 20 AB 92 1099 SPC:FAC2 JSR TKNCNV 92A8: 4C CE 95 1100 WAIT1:J JMP WAIT:1 ; now get its argument 1101 * 1102 TKNCNV EQU * 92AB: A5 16 1103 LDA TOKEN 92AD: 38 1104 SEC 92AE: E9 A0 1105 SBC #$A0 92B0: 60 1106 RTS 1107 * 92B1: A9 07 1108 FACGTKY LDA #7 92B3: D0 DA 1109 BNE FACRND1 ; getkey 1110 * 92B5: 49 1111 FACTB1 ASC 'I' 92B6: BE 91 1112 DA IDENT 92B8: 4E 1113 ASC 'N' 92B9: 5F 92 1114 DA FACNUM 92BB: 22 1115 FACTQT1 DFB $22 ; QUOTE SYMBOL 92BC: 54 92 1116 DA FACSTR 92BE: 28 1117 ASC '(' 92BF: 65 92 1118 DA PAREN 92C1: 91 1119 DFB $91 92C2: 6B 92 1120 DA FACMEM ; MEM 92C4: 90 1121 DFB $90 92C5: 81 92 1122 DA FACNOT 92C7: A2 1123 DFB $A2 92C8: 71 92 1124 DA FACMMC ; MEMC 92CA: A9 1125 DFB $A9 92CB: 41 92 1126 DA FACADR 92CD: E6 1127 DFB $E6 92CE: 8C 92 1128 DA SPCL:FAC ; spritecollide 92D0: E7 1129 DFB $E7 92D1: 8C 92 1130 DA SPCL:FAC ; bkgndcollide 92D3: E8 1131 DFB $E8 92D4: 8C 92 1132 DA SPCL:FAC ; cursorx 92D6: E9 1133 DFB $E9 92D7: 8C 92 1134 DA SPCL:FAC ; cursory 92D9: EA 1135 DFB $EA 92DA: A5 92 1136 DA SPC:FAC2 ; clock 92DC: EB 1137 DFB $EB 92DD: A5 92 1138 DA SPC:FAC2 ; paddle 92DF: ED 1139 DFB $ED 92E0: A5 92 1140 DA SPC:FAC2 ; joystick 92E2: EF 1141 DFB $EF 92E3: 8C 92 1142 DA SPCL:FAC ; random 92E5: F0 1143 DFB $F0 92E6: 8C 92 1144 DA SPCL:FAC ; envelope 92E8: F1 1145 DFB $F1 92E9: 8C 92 1146 DA SPCL:FAC ; scrollx 92EB: F2 1147 DFB $F2 92EC: 8C 92 1148 DA SPCL:FAC ; scrolly 92EE: F3 1149 DFB $F3 92EF: A5 92 1150 DA SPC:FAC2 ; spritestatus 92F1: A7 1151 DFB $A7 92F2: B1 92 1152 DA FACGTKY ; getkey 92F4: EC 1153 DFB $EC 92F5: A5 92 1154 DA SPC:FAC2 ; spritex 92F7: EE 1155 DFB $EE 92F8: A5 92 1156 DA SPC:FAC2 ; spritey 92FA: F9 1157 DFB $F9 92FB: 8C 92 1158 DA SPCL:FAC ; invalid 92FD: F8 1159 DFB $F8 92FE: A5 92 1160 DA SPC:FAC2 ; abs 9300: FD 1161 DFB $FD 9301: 8C 92 1162 DA SPCL:FAC ; freezestatus 9303: 00 1163 DFB 0 1164 * 1165 * EXPRESSION 1166 * 9304: 20 A8 90 1167 EXPRES JSR CHK:STAK 9307: 20 ED 90 1168 JSR SIMEXP 930A: A5 16 1169 LDA TOKEN 930C: A2 14 1170 LDX #EXPTB1 930E: A0 93 1171 LDY #>EXPTB1 9310: 20 77 8F 1172 JSR TKNJMP 9313: 60 1173 RTS 1174 * 9314: 3D 1175 EXPTB1 ASC '=' 9315: 27 93 1176 DA EXPR1 9317: 55 1177 ASC 'U' 9318: 27 93 1178 DA EXPR1 931A: 3C 1179 ASC '<' 931B: 27 93 1180 DA EXPR1 931D: 80 1181 DFB $80 931E: 27 93 1182 DA EXPR1 9320: 81 1183 DFB $81 9321: 27 93 1184 DA EXPR1 9323: 3E 1185 ASC '>' 9324: 27 93 1186 DA EXPR1 9326: 00 1187 DFB 0 1188 * 9327: 48 1189 EXPR1 PHA 9328: 20 49 80 1190 JSR GTOKEN 932B: 20 ED 90 1191 JSR SIMEXP 932E: 68 1192 PLA 932F: A2 36 1193 LDX #EXPTB3 9331: A0 93 1194 LDY #>EXPTB3 9333: 20 77 8F 1195 JSR TKNJMP 1196 * 9336: 3D 1197 EXPTB3 ASC '=' 9337: 49 93 1198 DA EXPR2 9339: 55 1199 ASC 'U' 933A: 4F 93 1200 DA EXPR3 933C: 3C 1201 ASC '<' 933D: 53 93 1202 DA EXPR4 933F: 81 1203 DFB $81 9340: 57 93 1204 DA EXPR5 9342: 3E 1205 ASC '>' 9343: 5B 93 1206 DA EXPR6 9345: 80 1207 DFB $80 9346: 5F 93 1208 DA EXPR7 9348: 00 1209 DFB 0 1210 * 9349: A9 10 1211 EXPR2 LDA #16 934B: 20 37 80 1212 EXPR8 JSR GENNOP 934E: 60 1213 RTS 934F: A9 12 1214 EXPR3 LDA #18 9351: D0 F8 1215 BNE EXPR8 9353: A9 14 1216 EXPR4 LDA #20 9355: D0 F4 1217 BNE EXPR8 9357: A9 16 1218 EXPR5 LDA #22 9359: D0 F0 1219 BNE EXPR8 935B: A9 18 1220 EXPR6 LDA #24 935D: D0 EC 1221 BNE EXPR8 935F: A9 19 1222 EXPR7 LDA #25 9361: D0 E8 1223 BNE EXPR8 1224 * 1225 * STATEMENT 1226 * 9363: 20 A8 90 1227 STMNT JSR CHK:STAK 9366: A5 16 1228 LDA TOKEN 9368: A2 70 1229 LDX #STMNT1 936A: A0 93 1230 LDY #>STMNT1 936C: 20 77 8F 1231 JSR TKNJMP 936F: 60 1232 RTS 1233 * 9370: 49 1234 STMNT1 ASC 'I' 9371: DD 93 1235 DA ASSIGN 9373: 92 1236 DFB $92 9374: DE 96 1237 DA IF 9376: 9A 1238 DFB $9A 9377: 51 98 1239 DA FOR 9379: 96 1240 DFB $96 937A: 58 97 1241 DA WHILE 937C: 95 1242 DFB $95 937D: 8A 97 1243 DA CASE 937F: 98 1244 DFB $98 9380: 34 97 1245 DA REPEAT 9382: 88 1246 DFB $88 9383: 1E 97 1247 DA BEG 9385: 9E 1248 DFB $9E 9386: C0 94 1249 DA READ 9388: 9D 1250 DFB $9D 9389: 5B 94 1251 DA WRITE 938B: 91 1252 DFB $91 938C: 25 96 1253 DA MEM 938E: 9F 1254 DFB $9F 938F: 40 96 1255 DA CALLSB 9391: A2 1256 DFB $A2 9392: 2A 96 1257 DA MEMC 9394: A3 1258 DFB $A3 9395: 68 95 1259 DA CURSOR 9397: A5 1260 DFB $A5 9398: E5 95 1261 DA DEF:SPRT 939A: A6 1262 DFB $A6 939B: 16 96 1263 DA HPLOT 939D: AA 1264 DFB $AA 939E: CC 95 1265 DA WAIT 93A0: 81 1266 DFB $81 93A1: 9D 92 1267 DA GET 93A3: AD 1268 DFB $AD 93A4: 95 92 1269 DA S:FREEZE ; freezesprite (n) 93A6: AE 1270 DFB $AE 93A7: 99 92 1271 DA CLOSE:FL 93A9: AF 1272 DFB $AF 93AA: A1 92 1273 DA PUT 93AC: DF 1274 DFB $DF 93AD: 7B 95 1275 DA SPRITE 93AF: E0 1276 DFB $E0 93B0: 7B 95 1277 DA MVE:SPRT 93B2: E1 1278 DFB $E1 93B3: 7B 95 1279 DA VOICE 93B5: E2 1280 DFB $E2 93B6: 7B 95 1281 DA GRAPHICS 93B8: E3 1282 DFB $E3 93B9: 7B 95 1283 DA SOUND 93BB: E4 1284 DFB $E4 93BC: C5 95 1285 DA SETCLOCK 93BE: E5 1286 DFB $E5 93BF: D8 95 1287 DA SCROLL 93C1: A8 1288 DFB $A8 93C2: 63 95 1289 DA CLEAR 93C4: F4 1290 DFB $F4 93C5: 7B 95 1291 DA MVE:SPRT ; movesprite (6 args) 93C7: F5 1292 DFB $F5 93C8: A5 92 1293 DA SPC:FAC2 ; stopsprite 93CA: F6 1294 DFB $F6 93CB: A5 92 1295 DA SPC:FAC2 ; startsprite 93CD: F7 1296 DFB $F7 93CE: DE 95 1297 DA ANIM:SPT 93D0: FA 1298 DFB $FA 93D1: 36 94 1299 DA LOAD:FIL 93D3: FB 1300 DFB $FB 93D4: 36 94 1301 DA SAVE:FIL 93D6: FC 1302 DFB $FC 93D7: 36 94 1303 DA OPEN:FIL 93D9: FF 1304 DFB $FF 93DA: 4C 94 1305 DA WRITELN 93DC: 00 1306 DFB 0 1307 * 1308 * ASSIGNMENT 1309 * 93DD: 20 A6 8F 1310 ASSIGN JSR LOOKUP 93E0: A2 EC 1311 ASS1 LDX #ASSTB1 93E2: A0 93 1312 LDY #>ASSTB1 93E4: 20 77 8F 1313 JSR TKNJMP 93E7: A2 18 1314 LDX #24 93E9: 20 2E 80 1315 JSR ERROR 1316 * 93EC: 41 1317 ASSTB1 ASC 'A' 93ED: F9 93 1318 DA ASSARR 93EF: 56 1319 ASC 'V' 93F0: 0B 94 1320 DA ASSVAR 93F2: 59 1321 ASC 'Y' 93F3: 0B 94 1322 DA ASSVAR 93F5: 50 1323 ASC 'P' 93F6: 4D 96 1324 DA FNCPRC 93F8: 00 1325 DFB 0 1326 * 93F9: 20 EC 8F 1327 ASSARR JSR SYMWRK 93FC: 20 52 80 1328 JSR PSHWRK 93FF: A9 36 1329 LDA #54 9401: 18 1330 CLC 9402: 65 6C 1331 ADC DATTYP 9404: 48 1332 PHA 9405: 20 24 8E 1333 JSR GETSUB 9408: 4C 1A 94 1334 JMP ASS2 1335 * 940B: 20 EC 8F 1336 ASSVAR JSR SYMWRK 940E: 20 52 80 1337 JSR PSHWRK 9411: A9 32 1338 LDA #50 9413: 18 1339 CLC 9414: 65 6C 1340 ADC DATTYP 9416: 48 1341 PHA 9417: 20 49 80 1342 JSR GTOKEN 941A: A9 41 1343 ASS2 LDA #'A' 941C: A2 0D 1344 LDX #13 941E: 20 34 80 1345 JSR CHKTKN 9421: 20 40 90 1346 JSR GETEXPR 9424: 68 1347 PLA 9425: 20 55 80 1348 JSR PULWRK 9428: 20 F7 8F 1349 JSR WRKSYM 942B: 48 1350 PHA 942C: 20 43 8E 1351 JSR GET:LEV 942F: 20 15 90 1352 JSR GET:OFF 9432: 68 1353 PLA 9433: 4C 3A 80 1354 JMP GENADR 1355 * 1356 * LOAD/SAVE 1357 * 1358 OPEN:FIL EQU * 1359 LOAD:FIL EQU * 1360 SAVE:FIL EQU * 9436: 20 B3 95 1361 JSR ARGS3 9439: 48 1362 PHA 943A: 20 72 90 1363 JSR GET:COMM 943D: AD 0E 80 1364 LDA QUOT:SYM 9440: A2 08 1365 LDX #8 ; " expected 9442: 20 31 80 1366 JSR GETCHK 9445: 68 1367 PLA 9446: 20 6E 94 1368 JSR W:STRING 9449: 4C 1A 8E 1369 JMP CHKRHP 1370 * 1371 * 1372 * WRITELN 1373 * 944C: 20 49 80 1374 WRITELN JSR GTOKEN ; SEE IF ( PRESENT 944F: C9 28 1375 CMP #'(' 9451: D0 03 1376 BNE WRITELN9 ; NOPE 9453: 20 5E 94 1377 JSR WRIT9 1378 WRITELN9 EQU * 9456: A9 5E 1379 LDA #$5E ; OUTPUT C/R 9458: 4C 37 80 1380 JMP GENNOP 1381 * 1382 * 1383 * WRITE 1384 * 945B: 20 13 8E 1385 WRITE JSR CHKLHP 945E: 20 49 80 1386 WRIT9 JSR GTOKEN 9461: CD 0E 80 1387 CMP QUOT:SYM 9464: D0 2B 1388 BNE WRIT1 9466: A9 23 1389 LDA #35 9468: 20 6E 94 1390 JSR W:STRING 946B: 4C A1 94 1391 JMP WRIT5 1392 * 1393 W:STRING EQU * 946E: 20 37 80 1394 JSR GENNOP 9471: A5 19 1395 LDA TKNLEN 9473: 20 37 80 1396 JSR GENNOP 9476: A0 00 1397 LDY #0 9478: B1 17 1398 WRIT2 LDA (TKNADR),Y 947A: CD 0E 80 1399 CMP QUOT:SYM 947D: D0 01 1400 BNE WRIT10 947F: C8 1401 INY 9480: C8 1402 WRIT10 INY 9481: AA 1403 TAX ; save A temporarily 9482: 98 1404 TYA ; save Y on stack 9483: 48 1405 PHA 9484: 8A 1406 TXA 9485: 20 37 80 1407 JSR GENNOP 9488: 68 1408 PLA 9489: A8 1409 TAY 948A: C6 19 1410 DEC TKNLEN 948C: D0 EA 1411 BNE WRIT2 948E: 4C 49 80 1412 JMP GTOKEN 1413 * 1414 WRIT1 EQU * ; here if not string 9491: C9 AB 1415 CMP #$AB ; CHR? 9493: F0 15 1416 BEQ W:CHR ; yes 9495: C9 AC 1417 CMP #$AC ; HEX? 9497: F0 19 1418 BEQ W:HEX ; yes 9499: 20 04 93 1419 JSR EXPRES ; just ordinary number - get it 949C: A9 1E 1420 LDA #30 ; output number 949E: 20 37 80 1421 JSR GENNOP 94A1: A5 16 1422 WRIT5 LDA TOKEN 94A3: C9 2C 1423 CMP #',' 94A5: F0 B7 1424 BEQ WRIT9 94A7: 4C 1A 8E 1425 JMP CHKRHP 1426 * 1427 * here for write (chr(x)) 1428 * 1429 W:CHR EQU * 94AA: A9 1F 1430 LDA #31 ; output character 1431 W:CHR1 EQU * 94AC: 20 CE 95 1432 JSR WAIT:1 ; process expression in parentheses 94AF: 4C A1 94 1433 JMP WRIT5 ; back for next item 1434 * 1435 * here for write (hex(x)) 1436 * 1437 W:HEX EQU * 94B2: A9 21 1438 LDA #33 ; output hex 94B4: D0 F6 1439 BNE W:CHR1 1440 * 1441 * 1442 * 1443 * GET NEXT TOKEN - MUST BE IDENTIFIER 1444 * THEN LOOK IT UP IN SYMBOL TABLE 1445 * 94B6: A9 49 1446 GET:LOOK LDA #'I' 94B8: A2 04 1447 LDX #4 94BA: 20 31 80 1448 JSR GETCHK 94BD: 4C A6 8F 1449 JMP LOOKUP 1450 * 1451 * 1452 * READ 1453 * 94C0: 20 13 8E 1454 READ JSR CHKLHP 94C3: 20 B6 94 1455 READ8 JSR GET:LOOK 94C6: 20 EC 8F 1456 READ2 JSR SYMWRK 94C9: 20 52 80 1457 JSR PSHWRK 94CC: A2 00 1458 LDX #0 94CE: 8E A7 02 1459 STX COUNT1 94D1: C9 41 1460 CMP #'A' 94D3: F0 4D 1461 BEQ READ3 94D5: C9 56 1462 CMP #'V' 94D7: F0 05 1463 BEQ READ9 94D9: A2 0C 1464 LDX #12 94DB: 20 2E 80 1465 JSR ERROR 94DE: 20 49 80 1466 READ9 JSR GTOKEN 94E1: 48 1467 READ11 PHA 94E2: A9 1C 1468 LDA #28 94E4: 18 1469 CLC 94E5: 65 6C 1470 ADC DATTYP 94E7: AA 1471 TAX 94E8: 68 1472 PLA 94E9: C9 24 1473 READ4 CMP #'$' 94EB: D0 09 1474 BNE READ6 94ED: A2 17 1475 LDX #23 94EF: 8A 1476 READ5 TXA 94F0: 48 1477 PHA 94F1: 20 49 80 1478 JSR GTOKEN 94F4: 68 1479 PLA 94F5: AA 1480 TAX 94F6: 8A 1481 READ6 TXA 94F7: 20 37 80 1482 JSR GENNOP 94FA: 20 55 80 1483 JSR PULWRK 94FD: 20 F7 8F 1484 JSR WRKSYM 9500: 20 4D 8E 1485 JSR GET:DAT 9503: 20 43 8E 1486 READ10 JSR GET:LEV 9506: 20 15 90 1487 JSR GET:OFF 9509: A9 32 1488 LDA #50 950B: AE A7 02 1489 LDX COUNT1 950E: F0 02 1490 BEQ READ7 9510: A9 36 1491 LDA #54 9512: 18 1492 READ7 CLC 9513: 65 6C 1493 ADC DATTYP 9515: 20 3A 80 1494 JSR GENADR 9518: A5 16 1495 READ7:A LDA TOKEN 951A: C9 2C 1496 CMP #',' 951C: F0 A5 1497 BEQ READ8 951E: 20 1A 8E 1498 JSR CHKRHP 9521: 60 1499 RTS 9522: A5 6C 1500 READ3 LDA DATTYP 9524: 48 1501 PHA 9525: 20 49 80 1502 JSR GTOKEN 9528: CD 0C 80 1503 CMP LHB 952B: F0 25 1504 BEQ READ3:A 952D: 68 1505 PLA 952E: 85 6C 1506 STA DATTYP 9530: D0 05 1507 BNE READ3:B 9532: A2 18 1508 LDX #24 9534: 20 2E 80 1509 JSR ERROR 9537: 20 55 80 1510 READ3:B JSR PULWRK 953A: 20 F7 8F 1511 JSR WRKSYM 953D: A9 25 1512 LDA #37 ; READ STRING 953F: 20 37 80 1513 JSR GENNOP 9542: 20 43 8E 1514 JSR GET:LEV 9545: 20 15 90 1515 JSR GET:OFF 9548: A0 06 1516 LDY #SYMSUB 954A: B1 4E 1517 LDA (SYMITM),Y 954C: 20 3A 80 1518 JSR GENADR ; A = LENGTH 954F: 4C 18 95 1519 JMP READ7:A 1520 * 9552: 20 40 90 1521 READ3:A JSR GETEXPR 9555: 20 38 8E 1522 JSR CHKRHB 9558: EE A7 02 1523 INC COUNT1 955B: 68 1524 PLA 955C: 85 6C 1525 STA DATTYP 955E: A5 16 1526 LDA TOKEN 9560: 4C E1 94 1527 JMP READ11 1528 * 1529 * CLEAR 1530 * 9563: A9 09 1531 CLEAR LDA #9 9565: 4C DA 95 1532 JMP SCROLL:1 1533 * 1534 * 1535 * CURSOR 1536 * 9568: A9 13 1537 CURSOR LDA #19 956A: 48 1538 PHA 1539 * 1540 * 956B: 20 13 8E 1541 TWO:OP JSR CHKLHP 956E: 20 40 90 1542 JSR GETEXPR 9571: 20 79 90 1543 ONE:OP2 JSR GET:ITEM 9574: 20 1A 8E 1544 ONE:OP JSR CHKRHP 9577: 68 1545 PLA 9578: 4C 37 80 1546 JMP GENNOP 1547 * 1548 * GRAPHICS/SOUND/SPRITE/MOVESPRITE/VOICE 1549 * 1550 GRAPHICS EQU * 1551 SOUND EQU * 1552 SPRITE EQU * 1553 MVE:SPRT EQU * 1554 VOICE EQU * 957B: 20 AB 92 1555 JSR TKNCNV 957E: 48 1556 PHA ; SAVE FOR LATER 957F: 20 13 8E 1557 JSR CHKLHP 1558 VOICE:1 EQU * 9582: 20 40 90 1559 JSR GETEXPR 9585: 20 79 90 1560 JSR GET:ITEM 9588: 68 1561 PLA 9589: 48 1562 PHA 958A: C9 54 1563 CMP #$54 ; 6-arg move sprite 958C: F0 0A 1564 BEQ VOICE:3 958E: C9 42 1565 CMP #$42 ; graphics 9590: B0 12 1566 BGE VOICE:2 ; only 2 arguments wanted 9592: 20 79 90 1567 JSR GET:ITEM 9595: 4C A4 95 1568 JMP VOICE:2 1569 VOICE:3 EQU * ; want 4 more args 9598: 20 79 90 1570 JSR GET:ITEM 959B: 20 79 90 1571 JSR GET:ITEM 959E: 20 79 90 1572 JSR GET:ITEM 95A1: 20 79 90 1573 JSR GET:ITEM 1574 VOICE:2 EQU * 95A4: 68 1575 PLA 95A5: 48 1576 PHA 95A6: 20 37 80 1577 JSR GENNOP 95A9: A5 16 1578 LDA TOKEN 95AB: C9 2C 1579 CMP #',' 95AD: F0 D3 1580 BEQ VOICE:1 ; another 3 95AF: 68 1581 PLA 95B0: 4C 1A 8E 1582 JMP CHKRHP 1583 * 1584 * Process 3 arguments 1585 * 1586 ARGS3 EQU * 95B3: 20 AB 92 1587 JSR TKNCNV 95B6: 48 1588 PHA 95B7: 20 13 8E 1589 JSR CHKLHP 95BA: 20 40 90 1590 JSR GETEXPR 95BD: 20 79 90 1591 JSR GET:ITEM 95C0: 20 79 90 1592 JSR GET:ITEM 95C3: 68 1593 PLA 95C4: 60 1594 RTS 1595 * 1596 * SETCLOCK ( hours, mins, secs, 10ths. ) 1597 * 1598 SETCLOCK EQU * 95C5: 20 B3 95 1599 JSR ARGS3 95C8: 48 1600 PHA 95C9: 4C 71 95 1601 JMP ONE:OP2 1602 * 95CC: A9 39 1603 WAIT LDA #57 95CE: 48 1604 WAIT:1 PHA 95CF: 20 13 8E 1605 JSR CHKLHP 95D2: 20 40 90 1606 JSR GETEXPR 95D5: 4C 74 95 1607 JMP ONE:OP 1608 * 1609 * SCROLL 1610 * 1611 SCROLL EQU * 95D8: A9 45 1612 LDA #69 95DA: 48 1613 SCROLL:1 PHA 95DB: 4C 6B 95 1614 JMP TWO:OP 1615 * 1616 ANIM:SPT EQU * 95DE: A9 57 1617 LDA #$57 95E0: 48 1618 PHA 95E1: A9 11 1619 LDA #17 ; count plus 16 pointers 95E3: D0 05 1620 BNE DEF:SPT2 1621 * 1622 * 1623 * DEFINESPRITE 1624 * 1625 DEF:SPRT EQU * 95E5: A9 01 1626 LDA #1 ; PCODE 95E7: 48 1627 PHA 95E8: A9 15 1628 LDA #21 ; row count 95EA: 48 1629 DEF:SPT2 PHA 95EB: 20 13 8E 1630 JSR CHKLHP 95EE: 20 40 90 1631 JSR GETEXPR ; sprite pointer 95F1: 20 79 90 1632 DEF:1 JSR GET:ITEM ; next row 95F4: 68 1633 PLA 95F5: AA 1634 TAX 95F6: CA 1635 DEX ; one less row 95F7: F0 16 1636 BEQ DEF:8 ; zero? none left 95F9: 8A 1637 TXA 95FA: 48 1638 PHA 95FB: A5 16 1639 LDA TOKEN 95FD: C9 2C 1640 CMP #',' 95FF: F0 F0 1641 BEQ DEF:1 ; more supplied 1642 * 1643 * no more supplied - zero out rest 1644 * 9601: A9 80 1645 DEF:2 LDA #$80 ; load zero pcode 9603: 20 37 80 1646 JSR GENNOP 9606: 68 1647 PLA 9607: AA 1648 TAX 9608: CA 1649 DEX 9609: F0 04 1650 BEQ DEF:8 ; all done 960B: 8A 1651 TXA 960C: 48 1652 PHA 960D: D0 F2 1653 BNE DEF:2 ; do another 960F: 20 1A 8E 1654 DEF:8 JSR CHKRHP 9612: 68 1655 PLA ; pcode for define/animate sprite 9613: 4C 37 80 1656 GENNOP2 JMP GENNOP 1657 * 1658 * 1659 * HPLOT 1660 * 9616: 20 13 8E 1661 HPLOT JSR CHKLHP 9619: 20 40 90 1662 JSR GETEXPR ; colour 961C: A9 03 1663 LDA #3 961E: 48 1664 PHA 961F: 20 79 90 1665 JSR GET:ITEM 9622: 4C 71 95 1666 JMP ONE:OP2 1667 * 1668 * 1669 * MEM 1670 * 9625: A9 00 1671 MEM LDA #0 9627: 48 1672 PHA 9628: F0 03 1673 BEQ MEM2 962A: A9 01 1674 MEMC LDA #1 962C: 48 1675 PHA 962D: 20 24 8E 1676 MEM2 JSR GETSUB 9630: A9 41 1677 LDA #'A' 9632: A2 0D 1678 LDX #13 9634: 20 34 80 1679 JSR CHKTKN 9637: 20 40 90 1680 JSR GETEXPR 963A: 68 1681 PLA 963B: 18 1682 CLC 963C: 69 34 1683 ADC #52 963E: D0 D3 1684 BNE GENNOP2 1685 * 1686 * CALL ABSOLUTE ADDRESS 1687 * 9640: 20 13 8E 1688 CALLSB JSR CHKLHP 9643: 20 40 90 1689 JSR GETEXPR 9646: 20 1A 8E 1690 JSR CHKRHP 9649: A9 2B 1691 LDA #43 964B: D0 C6 1692 BNE GENNOP2 1693 * 1694 * FUNCTION OR PROCEDURE CALL 1695 * 964D: A9 00 1696 FNCPRC LDA #0 964F: 8D A7 02 1697 STA COUNT1 9652: A0 06 1698 LDY #SYMARG 9654: B1 4E 1699 LDA (SYMITM),Y 9656: F0 37 1700 BEQ FNC1 9658: 20 13 8E 1701 JSR CHKLHP 965B: AD A7 02 1702 FNC2 LDA COUNT1 965E: 48 1703 PHA 965F: 20 EC 8F 1704 JSR SYMWRK 9662: 20 52 80 1705 JSR PSHWRK 9665: 20 40 90 1706 JSR GETEXPR 9668: 20 55 80 1707 JSR PULWRK 966B: 20 F7 8F 1708 JSR WRKSYM 966E: 68 1709 PLA 966F: 8D A7 02 1710 STA COUNT1 9672: EE A7 02 1711 INC COUNT1 9675: A5 16 1712 LDA TOKEN 9677: C9 2C 1713 CMP #',' 9679: F0 E0 1714 BEQ FNC2 967B: AD A7 02 1715 LDA COUNT1 967E: A0 06 1716 LDY #SYMARG 9680: D1 4E 1717 CMP (SYMITM),Y 9682: F0 05 1718 BEQ FNC3 9684: A2 23 1719 LDX #35 9686: 20 2E 80 1720 JSR ERROR 9689: 20 1A 8E 1721 FNC3 JSR CHKRHP 968C: 4C 92 96 1722 JMP FNC5 968F: 20 49 80 1723 FNC1 JSR GTOKEN 9692: 20 43 8E 1724 FNC5 JSR GET:LEV 9695: 20 15 90 1725 JSR GET:OFF 9698: A0 08 1726 LDY #SYMDAT 969A: B1 4E 1727 LDA (SYMITM),Y 969C: D0 11 1728 BNE FNC5A 969E: A5 2C 1729 LDA OFFSET 96A0: 38 1730 SEC 96A1: E5 26 1731 SBC PCODE 96A3: 85 2C 1732 STA OFFSET 96A5: A5 2D 1733 LDA OFFSET+1 96A7: E5 27 1734 SBC PCODE+1 96A9: 85 2D 1735 STA OFFSET+1 96AB: A9 27 1736 LDA #39 96AD: D0 02 1737 BNE FNC5B 96AF: A9 38 1738 FNC5A LDA #56 96B1: 20 3A 80 1739 FNC5B JSR GENADR 96B4: AD A7 02 1740 LDA COUNT1 96B7: F0 1F 1741 BEQ FNC4 96B9: AD A7 02 1742 LDA COUNT1 ; TIMES 3 96BC: 0A 1743 ASL 96BD: B0 1A 1744 BCS FNC6 96BF: 6D A7 02 1745 ADC COUNT1 96C2: 8D A7 02 1746 STA COUNT1 96C5: B0 12 1747 BCS FNC6 96C7: A9 00 1748 LDA #0 96C9: 38 1749 SEC 96CA: ED A7 02 1750 SBC COUNT1 96CD: 85 2E 1751 STA OPND 96CF: A9 FF 1752 LDA #$FF 96D1: 85 2F 1753 STA OPND+1 96D3: A9 3B 1754 LDA #59 96D5: 20 85 80 1755 JSR GENJMP 96D8: 60 1756 FNC4 RTS 96D9: A2 0F 1757 FNC6 LDX #15 96DB: 20 2E 80 1758 JSR ERROR 1759 * 1760 * 1761 * IF 1762 * 96DE: 20 40 90 1763 IF JSR GETEXPR 96E1: A9 93 1764 LDA #$93 96E3: A2 10 1765 LDX #16 96E5: 20 34 80 1766 JSR CHKTKN 96E8: 20 49 80 1767 JSR GTOKEN 96EB: 20 02 90 1768 JSR PSHPCODE 96EE: A9 3D 1769 LDA #61 96F0: 20 40 80 1770 JSR GENNJM 96F3: 20 63 93 1771 JSR STMNT 96F6: A5 16 1772 LDA TOKEN 96F8: C9 94 1773 CMP #$94 ; ELSE 96FA: F0 07 1774 BEQ IF1 96FC: 20 55 80 1775 IF2 JSR PULWRK 96FF: 20 4F 80 1776 JSR FIXAD 9702: 60 1777 RTS 9703: 20 55 80 1778 IF1 JSR PULWRK ; HERE FOR ELSE 9706: 20 67 90 1779 JSR WRK:WRKD 9709: 20 02 90 1780 JSR PSHPCODE 970C: 20 3D 80 1781 JSR GENNJP 970F: 20 5C 90 1782 JSR WRKD:WRK 9712: 20 4F 80 1783 JSR FIXAD 9715: 20 49 80 1784 JSR GTOKEN 9718: 20 63 93 1785 JSR STMNT 971B: 4C FC 96 1786 JMP IF2 1787 * 1788 * BEGIN 1789 * 971E: 20 49 80 1790 BEG JSR GTOKEN 9721: 20 63 93 1791 JSR STMNT 9724: A5 16 1792 LDA TOKEN 9726: C9 3B 1793 CMP #';' 9728: F0 F4 1794 BEQ BEG 972A: A9 89 1795 LDA #$89 ; END 972C: A2 11 1796 LDX #17 972E: 20 34 80 1797 JSR CHKTKN 9731: 4C 49 80 1798 JMP GTOKEN 1799 * 1800 * REPEAT 1801 * 9734: 20 02 90 1802 REPEAT JSR PSHPCODE 9737: 20 49 80 1803 REP1 JSR GTOKEN 973A: 20 63 93 1804 JSR STMNT 973D: A5 16 1805 LDA TOKEN 973F: C9 3B 1806 CMP #';' 9741: F0 F4 1807 BEQ REP1 9743: A9 99 1808 LDA #$99 9745: A2 0A 1809 LDX #10 9747: 20 34 80 1810 JSR CHKTKN 974A: 20 40 90 1811 JSR GETEXPR 974D: 20 55 80 1812 JSR PULWRK 9750: 20 51 90 1813 JSR WRK:OPND 9753: A9 3D 1814 LDA #61 9755: 4C 88 80 1815 JMP GENRJMP 1816 * 1817 * WHILE 1818 * 9758: 20 02 90 1819 WHILE JSR PSHPCODE 975B: 20 40 90 1820 JSR GETEXPR 975E: 20 02 90 1821 JSR PSHPCODE 9761: A9 3D 1822 LDA #61 9763: 20 40 80 1823 JSR GENNJM 9766: A9 97 1824 LDA #$97 9768: A2 12 1825 LDX #18 976A: 20 34 80 1826 JSR CHKTKN 976D: 20 49 80 1827 JSR GTOKEN 9770: 20 63 93 1828 JSR STMNT 9773: 20 55 80 1829 JSR PULWRK 9776: 20 67 90 1830 JSR WRK:WRKD 9779: 20 55 80 1831 JSR PULWRK 977C: 20 51 90 1832 JSR WRK:OPND 977F: A9 3C 1833 LDA #60 9781: 20 88 80 1834 JSR GENRJMP 9784: 20 5C 90 1835 JSR WRKD:WRK 9787: 4C 4F 80 1836 JMP FIXAD 1837 * 1838 * CASE 1839 * 978A: 20 40 90 1840 CASE JSR GETEXPR 978D: A9 85 1841 LDA #$85 ; OF 978F: A2 19 1842 LDX #25 9791: 20 34 80 1843 JSR CHKTKN 9794: A9 01 1844 LDA #1 9796: 8D A7 02 1845 STA COUNT1 9799: A9 00 1846 CASE7 LDA #0 979B: 8D A8 02 1847 STA COUNT2 1848 CASE2 EQU * 979E: A9 2A 1849 LDA #42 ; make copy of selector 97A0: 20 37 80 1850 JSR GENNOP 97A3: 20 40 90 1851 JSR GETEXPR ; next expression to compare 97A6: A9 10 1852 LDA #16 97A8: 20 37 80 1853 JSR GENNOP 97AB: A5 16 1854 LDA TOKEN 97AD: C9 3A 1855 CMP #':' 97AF: F0 15 1856 BEQ CASE1 97B1: A9 2C 1857 LDA #',' 97B3: A2 05 1858 LDX #5 97B5: 20 34 80 1859 JSR CHKTKN 97B8: 20 02 90 1860 JSR PSHPCODE 97BB: A9 3E 1861 LDA #62 97BD: 20 40 80 1862 JSR GENNJM 97C0: EE A8 02 1863 INC COUNT2 97C3: 4C 9E 97 1864 JMP CASE2 97C6: 20 46 90 1865 CASE1 JSR PCD:WRKD 97C9: A9 3D 1866 LDA #61 97CB: 20 40 80 1867 JSR GENNJM 97CE: AD A8 02 1868 LDA COUNT2 97D1: F0 0B 1869 BEQ CASE3 97D3: 20 55 80 1870 CASE4 JSR PULWRK 97D6: 20 4F 80 1871 JSR FIXAD 97D9: CE A8 02 1872 DEC COUNT2 97DC: D0 F5 1873 BNE CASE4 97DE: 20 5C 90 1874 CASE3 JSR WRKD:WRK 97E1: 20 52 80 1875 JSR PSHWRK 97E4: 20 49 80 1876 JSR GTOKEN 97E7: AD A7 02 1877 LDA COUNT1 97EA: 48 1878 PHA 97EB: 20 63 93 1879 JSR STMNT 97EE: 68 1880 PLA 97EF: 8D A7 02 1881 STA COUNT1 97F2: A5 16 1882 LDA TOKEN 97F4: C9 94 1883 CMP #$94 ; ELSE 97F6: F0 1C 1884 BEQ CASE5 97F8: C9 3B 1885 CMP #';' 97FA: D0 38 1886 BNE CASE6 97FC: 20 46 90 1887 JSR PCD:WRKD 97FF: 20 3D 80 1888 JSR GENNJP 9802: 20 55 80 1889 JSR PULWRK 9805: 20 4F 80 1890 JSR FIXAD 9808: 20 5C 90 1891 JSR WRKD:WRK 980B: 20 52 80 1892 JSR PSHWRK 980E: EE A7 02 1893 INC COUNT1 9811: 4C 99 97 1894 JMP CASE7 9814: 20 46 90 1895 CASE5 JSR PCD:WRKD 9817: 20 3D 80 1896 JSR GENNJP 981A: 20 55 80 1897 JSR PULWRK 981D: 20 4F 80 1898 JSR FIXAD 9820: 20 5C 90 1899 JSR WRKD:WRK 9823: 20 52 80 1900 JSR PSHWRK 9826: 20 49 80 1901 JSR GTOKEN 9829: AD A7 02 1902 LDA COUNT1 982C: 48 1903 PHA 982D: 20 63 93 1904 JSR STMNT 9830: 68 1905 PLA 9831: 8D A7 02 1906 STA COUNT1 9834: A9 89 1907 CASE6 LDA #$89 ; END 9836: A2 11 1908 LDX #17 9838: 20 34 80 1909 JSR CHKTKN 983B: AD A7 02 1910 LDA COUNT1 983E: F0 0B 1911 BEQ CASE8 9840: 20 55 80 1912 CASE9 JSR PULWRK 9843: 20 4F 80 1913 JSR FIXAD 9846: CE A7 02 1914 DEC COUNT1 9849: D0 F5 1915 BNE CASE9 984B: 20 1F 99 1916 CASE8 JSR FOR6 984E: 4C 49 80 1917 JMP GTOKEN 1918 * 1919 * FOR 1920 * 9851: A9 49 1921 FOR LDA #'I' 9853: A2 04 1922 LDX #4 9855: 20 31 80 1923 JSR GETCHK 9858: 20 A6 8F 1924 JSR LOOKUP 985B: C9 56 1925 FOR1 CMP #'V' 985D: F0 09 1926 BEQ FOR2 985F: C9 59 1927 CMP #'Y' 9861: F0 05 1928 BEQ FOR2 9863: A2 0C 1929 LDX #12 9865: 20 2E 80 1930 JSR ERROR 9868: 20 0B 94 1931 FOR2 JSR ASSVAR 986B: 20 EC 8F 1932 JSR SYMWRK 986E: A9 00 1933 LDA #0 9870: 8D A7 02 1934 STA COUNT1 9873: A5 16 1935 LDA TOKEN 9875: C9 9B 1936 CMP #$9B ; TO 9877: F0 0A 1937 BEQ FOR3 9879: A9 9C 1938 LDA #$9C ; DOWNTO 987B: A2 1C 1939 LDX #28 987D: 20 34 80 1940 JSR CHKTKN 9880: CE A7 02 1941 DEC COUNT1 9883: AD A7 02 1942 FOR3 LDA COUNT1 9886: 48 1943 PHA 9887: 20 52 80 1944 JSR PSHWRK 988A: 20 40 90 1945 JSR GETEXPR 988D: 20 55 80 1946 JSR PULWRK 9890: 20 F7 8F 1947 JSR WRKSYM 9893: 68 1948 PLA 9894: 8D A7 02 1949 STA COUNT1 9897: 20 02 90 1950 JSR PSHPCODE 989A: A9 2A 1951 LDA #42 989C: 20 37 80 1952 JSR GENNOP 989F: 20 43 8E 1953 JSR GET:LEV 98A2: 20 15 90 1954 JSR GET:OFF 98A5: 20 4D 8E 1955 JSR GET:DAT 98A8: 18 1956 CLC 98A9: 69 2C 1957 ADC #44 98AB: 20 3A 80 1958 JSR GENADR 98AE: A9 16 1959 LDA #22 ; UP (GEQ) 98B0: AE A7 02 1960 LDX COUNT1 98B3: F0 02 1961 BEQ FOR4 98B5: A9 19 1962 LDA #25 ; DOWN (LEQ) 98B7: 20 37 80 1963 FOR4 JSR GENNOP 98BA: 20 02 90 1964 JSR PSHPCODE 98BD: A9 3D 1965 LDA #61 98BF: 20 40 80 1966 JSR GENNJM 98C2: AD A7 02 1967 LDA COUNT1 98C5: 48 1968 PHA 98C6: 20 EC 8F 1969 JSR SYMWRK 98C9: 20 52 80 1970 JSR PSHWRK 98CC: A9 97 1971 LDA #$97 98CE: A2 12 1972 LDX #18 98D0: 20 34 80 1973 JSR CHKTKN 98D3: 20 49 80 1974 JSR GTOKEN 98D6: 20 63 93 1975 JSR STMNT 98D9: 20 55 80 1976 JSR PULWRK 98DC: 20 F7 8F 1977 JSR WRKSYM 98DF: 20 43 8E 1978 JSR GET:LEV 98E2: 20 4D 8E 1979 JSR GET:DAT 98E5: 20 15 90 1980 JSR GET:OFF 98E8: A5 6C 1981 LDA DATTYP 98EA: 18 1982 CLC 98EB: 69 2C 1983 ADC #44 98ED: 20 3A 80 1984 JSR GENADR 98F0: 68 1985 PLA 98F1: 8D A7 02 1986 STA COUNT1 98F4: A9 26 1987 LDA #38 98F6: AE A7 02 1988 LDX COUNT1 98F9: F0 02 1989 BEQ FOR5 98FB: A9 28 1990 LDA #40 ; DEC 98FD: 20 37 80 1991 FOR5 JSR GENNOP 9900: A9 32 1992 LDA #50 9902: 18 1993 CLC 9903: 65 6C 1994 ADC DATTYP 9905: 20 3A 80 1995 JSR GENADR 9908: 20 55 80 1996 JSR PULWRK 990B: 20 67 90 1997 JSR WRK:WRKD 990E: 20 55 80 1998 JSR PULWRK 9911: 20 51 90 1999 JSR WRK:OPND 9914: A9 3C 2000 LDA #60 9916: 20 88 80 2001 JSR GENRJMP 9919: 20 5C 90 2002 JSR WRKD:WRK 991C: 20 4F 80 2003 JSR FIXAD 991F: A9 FF 2004 FOR6 LDA #$FF 9921: 85 2F 2005 STA OPND+1 9923: A9 FD 2006 LDA #$FD 9925: 85 2E 2007 STA OPND 9927: A9 3B 2008 LDA #59 9929: 4C 85 80 2009 JMP GENJMP 992C: 00 2011 BRK --End assembly, 2905 bytes, Errors: 0
libsrc/stdio/ansi/ticalc/f_ansi_dline.asm
jpoikela/z88dk
8
19061
; ; ANSI Video handling for the TI calculators ; By <NAME> - Dec. 2000 ; ; Clean a text line ; ; in: A = text row number ; ; ; $Id: f_ansi_dline.asm,v 1.6 2016-06-12 16:06:43 dom Exp $ ; INCLUDE "stdio/ansi/ticalc/ticalc.inc" SECTION code_clib PUBLIC ansi_del_line EXTERN base_graphics EXTERN cpygraph .ansi_del_line ld de,row_bytes*8 ld b,a ld hl,(base_graphics) and a jr z,zline .lloop add hl,de djnz lloop .zline ld d,h ld e,l inc de ld (hl),0 ld bc,row_bytes*8 ldir jp cpygraph ; Copy GRAPH_MEM to LCD, then return
oeis/011/A011973.asm
neoneye/loda-programs
11
86630
; A011973: Triangle of numbers {binomial(n-k, k), n >= 0, 0 <= k <= floor(n/2)}; or, triangle of coefficients of (one version of) Fibonacci polynomials. ; Submitted by <NAME> ; 1,1,1,1,1,2,1,3,1,1,4,3,1,5,6,1,1,6,10,4,1,7,15,10,1,1,8,21,20,5,1,9,28,35,15,1,1,10,36,56,35,6,1,11,45,84,70,21,1,1,12,55,120,126,56,7,1,13,66,165,210,126,28,1,1,14,78,220,330,252,84,8,1,15,91,286,495,462,210,36,1,1,16,105,364,715,792,462,120,9,1,17,120,455,1001,1287,924,330,45,1 lpb $0 add $1,$2 sub $0,$1 cmp $2,0 sub $0,$2 lpe sub $2,$0 add $2,$1 add $1,$2 bin $1,$0 mov $0,$1
src/static/antlr4/grammars/FormalParameter.g4
jlenoble/ecmascript-parser
0
5052
/* Source: ECMAScript® 2018 Language Specification - Annex A-4 */ grammar FormalParameter; // UniqueFormalParameters[Yield, Await]: // FormalParameters[?Yield, ?Await] uniqueFormalParameters : formalParameters ; // FormalParameters[Yield, Await]: // [empty] // FunctionRestParameter[?Yield, ?Await] // FormalParameterList[?Yield, ?Await] // FormalParameterList[?Yield, ?Await] , // FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await] formalParameters : | functionRestParameter | formalParameterList Comma? | formalParameterList Comma functionRestParameter ; // FormalParameterList[Yield, Await]: // FormalParameter[?Yield, ?Await] // FormalParameterList[?Yield, ?Await] , FormalParameter[?Yield, ?Await] formalParameterList : formalParameter (Comma formalParameter)* ; // FunctionRestParameter[Yield, Await]: // BindingRestElement[?Yield, ?Await] functionRestParameter : bindingRestElement ; // FormalParameter[Yield, Await]: // BindingElement[?Yield, ?Await] formalParameter : bindingElement ; // ArrowParameters[Yield, Await]: // BindingIdentifier[?Yield, ?Await] // CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] arrowParameters : bindingIdentifier | coverParenthesizedExpressionAndArrowParameterList ;
Calculator.asm
AmirHadifar/Assembly-Calculator
0
96120
data segment make_dot db 0 x_dot_index db 0 y_dot_index db 0 x_float_count db 0 y_float_count db 0 _TEN dw 10d x dw 0 y dw 0 buffer db 6 dup(0),'$' lenth dw 0 operand1 db 0 operand2 db 0 key db 0 of db 0 ng db 0 xsighn db 0 ysighn db 0 ;--------------------------------------------------- ;print lines ;--------------------------------------------------- l0 db 201,21 dup(205),187,'$' l8 db 186,21 dup(' '),186,'$';second line l1 db 186,' ',201,13 dup(205),187,' ',186,'$' l2 db 186,' ',186,13 dup(' '),186,' ',186,'$' l3 db 186,' ',200,13 dup(205),188,' ',186,'$' l4 db 186,' ',218,196,191,' ',218,196,191,' ',218,196,191,' ',218,196,191,' ',218,196,191,' ',186,'$' l4_2 db 186,' ',218,196,196,196,196,196,191,' ',218,196,191,' ',218,196,191,' ',179,' ',179,' ',186,'$' l5 db 186,' ',179,' ',179,' ',179,' ',179,' ',179,' ',179,' ',179,' ',179,' ',179,' ',179,' ',186,'$' l5_2 db 186,' ',192,196,217,' ',192,196,217,' ',192,196,217,' ',192,196,217,' ',179,' ',179,' ',186,'$' l5_3 db 186,' ',179,' ',' ',' ',' ',' ',179,' ',179,' ',179,' ',179,' ',179,' ',179,' ',179,' ',186,'$' l6 db 186,' ',192,196,217,' ',192,196,217,' ',192,196,217,' ',192,196,217,' ',192,196,217,' ',186,'$' l6_2 db 186,' ',192,196,196,196,196,196,217,' ',192,196,217,' ',192,196,217,' ',192,196,217,' ',186,'$' l7 db 200,21 dup(205),188,'$' ;--------------------------------------------------- ends ;--------------------------------------------------- gotoxy macro x,y ;move cursor pusha mov dl,x mov dh,y mov bx,0 mov ah,02h int 10h popa endm ;--------------------------------------------------- putstr macro buffer ;print string pusha mov ah,09h mov dx,offset buffer int 21h popa endm ;--------------------------------------------------- putch macro char,color ;print character pusha mov ah,09h mov al,char mov bh,0 mov bl,color mov cx,1 int 10h popa endm ;--------------------------------------------------- clear macro buf lea si,buf mov [si],' ' mov [si+1],' ' mov [si+2],' ' mov [si+3],' ' mov [si+4],' ' mov [si+5],' ' gotoxy 15,3 putstr buf endm ;--------------------------------------------------- initmouse macro mov ax,0 int 33h endm ;--------------------------------------------------- getmouse macro key local l1,en,en1,en2 local r1,c12,c13,c14,c15 local r2,c21,c22,c23,c24 local r3,c31,c32,c33,c34 local r3_1 local r4,c41,c42,c43,c44 local r5,c51,c52 local r6 pusha ;push all registers l1: mov ax,1 ;show mouse int 33h mov ax,3 ;get pose int 33h cmp bx,1 jne l1 ;.................... r1: cmp cx,064h jna r2 cmp cx,074h ja r2 cmp dx,2ch jb c13 cmp dx,3ch ja c13 mov [key],'7' jmp en1 c13: cmp dx,44h jb c14 cmp dx,54h ja c14 mov [key],'4' jmp en1 c14: cmp dx,5ch jb c15 cmp dx,6ch ja c15 mov [key],'1' jmp en1 c15: cmp dx,74h jb r2 cmp dx,84h ja r2 mov [key],'0' jmp en1 ;.................... r2: cmp cx,084h jb r3_1 cmp cx,094h ja r3_1 c21: cmp dx,2ch jb c22 cmp dx,3ch ja c22 mov [key],'8' jmp en1 c22: cmp dx,44h jb c23 cmp dx,54h ja c23 mov [key],'5' jmp en1 c23: cmp dx,5ch jb c24 cmp dx,6ch ja c24 mov [key],'2' jmp en1 c24: cmp dx,74h jb r3_1 cmp dx,84h ja r3_1 mov [key],'0' jmp en1 r3_1: cmp cx,078h jb r3 cmp cx,080h ja r3 cmp dx,74h jb r3 cmp dx,84h ja r3 mov [key],'0' jmp en1 ;.................... r3: cmp cx,0a4h jb r4 cmp cx,0b4h ja r4 c31: cmp dx,2ch jb c32 cmp dx,3ch ja c32 mov [key],'9' jmp en1 c32: cmp dx,44h jb c33 cmp dx,54h ja c33 mov [key],'6' jmp en1 c33: cmp dx,5ch jb c34 cmp dx,6ch ja c34 mov [key],'3' jmp en1 c34: cmp dx,74h jb r4 cmp dx,84h ja r4 mov [key],'.' jmp en1 ;..................... r4: cmp cx,0c4h jb r5 cmp cx,0d4h ja r5 c41: cmp dx,2ch jb c42 cmp dx,3ch ja c42 mov [key],'/' jmp en1 c42: cmp dx,44h jb c43 cmp dx,54h ja c43 mov [key],'*' jmp en1 c43: cmp dx,5ch jb c44 cmp dx,6ch ja c44 mov [key],'-' jmp en1 c44: cmp dx,74h jb r5 cmp dx,84h ja r5 mov [key],'+' jmp en1 ; ............................. r5: cmp cx,0E4h jb r6 cmp cx,0F4h ja r6 cmp dx,2ch jb c51 cmp dx,3ch ja c51 mov [key],'C' jmp en1 c51: cmp dx,44h jb c52 cmp dx,54h ja c52 mov [key],'_' jmp en1 c52: cmp dx,58h jb r6 cmp dx,84h ja r6 mov [key],'=' jmp en1 ;......................... r6: cmp cx,0F8h jb en cmp cx,0FFh ja en cmp dx,8h jb en cmp dx,10h ja en mov [key],'x' jmp en1 ;..................... en: mov [key],'=' ;no match found! en1: cmp key,'x' je exit cmp key,'C' jne en2 mov of,0 mov xsighn,0 jmp begin en2: popa ;popall registers endm ;--------------------------------------------------- number_in macro n,operand,lenth,dot_index,float_count,sign local l1,l1_2,l1_2_1,l1_3,l1_3_1 local l2,l3,l4 local next_step,next_step1 pusha mov sign , 0 mov float_count , 0 mov lenth , 0 mov make_dot,0 mov dot_index,0 l1: initmouse getmouse key l1_2: cmp lenth,0 ;first time,clear scre jne l1_2_1 cmp sign,1 je l1_2_1 clear buffer putstr buffer gotoxy 17,3 l1_2_1: mov al,key ;check if its number cmp al,'_' jne next_step1 mov xsighn,1 mov dl,'-' mov ah,02h int 21h jmp l1 next_step1: cmp al,'.' jne next_step cmp make_dot,0 jne calc2 inc make_dot mov ax,lenth + 1 mov dot_index,al mov ah,02h mov dl,'.' int 21h jmp l1 next_step: cmp al,48 jb l2 cmp al,58 ja l2 l1_3: mov [si],al pusha mov ah,02h mov dx,[si] int 21h inc si inc lenth cmp make_dot,0 je l1_3_1 inc float_count l1_3_1: cmp lenth,6 ;just resive 5 digits + 1 jne l1 ;........................ l2: ;converting to in mov dx,0 cmp lenth,0 je l4 mov operand,al ;get operand lea si,buffer mov cx,lenth mov bx,10 l3: ;make number mov ax,dx mul bx mov dx,ax mov ah,0 mov al,[si] sub al,48 add dx,ax inc si loop l3 ;........................ l4: mov n,dx gotoxy 24,3 popa endm ;--------------------------------------------------- putrez macro buffer,x local next_digit,pz1,pz2 local nex1,nex2 pusha mov ax,x ;convert <int> to <str> mov cl,x_float_count clear buffer lea si,buffer mov bx,10 mov [si+5],'0' mov [si+4],'.' mov [si+3],'0' ;........................ next_digit: cmp cl,0 jne nex1 cmp x_float_count,0 jne nex2 mov [si+5],'0' dec si nex2: mov dl,'.' mov [si+5],dl dec si dec cl dec x_float_count jmp next_digit nex1: mov dx,0 ; buffer div bx add dl,48 mov [si+5],dl dec si dec cl cmp ax,0 jne next_digit ;......................... gotoxy 17,3 ;print buffer putstr buffer cmp of,1 ;print owerflow mark jne pz1 gotoxy 27,3 putch 'F',15 jmp pz2 ;print xsighn pz1: cmp xsighn,1 jne pz2 gotoxy 15,3 putch '-',15 pz2: popa endm ;--------------------------------------------------- reset macro mov x,0 mov y,0 mov xsighn,0 mov of,0 clear buffer mov key,0 mov operand1,0 endm code segment start: ; set segment registers: mov ax, data mov ds, ax mov es, ax ;-------------------------------------------------- ;-------------------------------------------------- ;--- C A L C U L A T O R E -------- P R O C ------ ;-------------------------------------------------- ;-------------------------------------------------- call print_screen begin: reset calc1: putrez buffer,x ;print x number_in x,operand1,lenth,x_dot_index,x_float_count,xsighn mov al,operand1 cmp al,'=' je calc1 calc2: number_in y,operand2,lenth,y_dot_index,y_float_count,ysighn call calculate ;x = x (operand1) y mov al,operand2 cmp al,'=' je calc1 ;if(operand2=='='):printx,start again. mov operand1,al ;else:operand1=operand2,printx,get buffer again. putrez buffer,x jmp calc2 ;-------------------------------------------------- ;-------------------------------------------------- ;------------- F U N C T I O N S ----------------- ;-------------------------------------------------- ;-------------------------------------------------- print_screen proc : gotoxy 10,0;........... putstr l0 gotoxy 10,1 putstr l8 gotoxy 10,2;........ ; putstr l1 ; ; gotoxy 10,3 ; ;out cadr putstr l2 ; ; gotoxy 10,4 ; ; putstr l3 ; ; gotoxy 10,5;...... ; ; putstr l4 ; ;rezualt board + exit key gotoxy 10,6 ; ; ; putstr l5 ; ; ; gotoxy 10,7 ; ; ; putstr l6 ; ; ; gotoxy 10,8 ; ; ; putstr l4 ; ; ; gotoxy 10,9 ;key board putstr l5 ; ; ; gotoxy 10,10 ; ; ; putstr l6 ; ; ; gotoxy 10,11 ; ; ; putstr l4 ; ; ; gotoxy 10,12 ; ; ; putstr l5 ; ; ; gotoxy 10,13 ; ; ; putstr l5_2 ; ; ; gotoxy 10,14 ; ; ; putstr l4_2 ; ; ; gotoxy 10,15;..... ; ; putstr l5_3 ; ; gotoxy 10,16;....... ; putstr l6_2 ; gotoxy 10,17 putstr l7 ;keyboard lables gotoxy 31,1 putch 'x',4 gotoxy 13,6 putch '7',11 gotoxy 17,6 putch '8',11 gotoxy 21,6 putch '9',11 gotoxy 25,6 putch '/',10 gotoxy 29,6 putch 'C',10 gotoxy 13,9 putch '4',11 gotoxy 17,9 putch '5',11 gotoxy 21,9 putch '6',11 gotoxy 25,9 putch '*',10 gotoxy 29,9 putch 241,10 gotoxy 13,12 putch '1',11 gotoxy 17,12 putch '2',11 gotoxy 21,12 putch '3',11 gotoxy 25,12 putch '-',10 gotoxy 29,13 putch '=',10 gotoxy 15,15 putch '0',11 gotoxy 21,15 putch '.',10 gotoxy 25,15 putch '+',10 ret print_screen endp ;-------------------------------------------------- calculate proc near cmp operand1,'+' je pluss cmp operand1,'-' je miness cmp operand1,'*' je mulplus cmp operand1,'/' je devide jmp begin ;no match found! pluss: mov al,x_float_count cmp al,y_float_count je p1 ja p1x jb p1y p1x: mov ax,y mul _TEN mov y,ax inc y_float_count jmp pluss p1y: mov ax,x mul _TEN mov x,ax inc x_float_count jmp pluss p1: mov al,xsighn cmp al,0 je pl1 ;x>0 & y>0 jne pl2 ;x<0 & y>0 pl1: mov ax,x add ax,y jno pl1_1 mov of,1 pl1_1: mov x,ax ret pl2: mov ax,x cmp ax,y jae pl3 jb pl4 pl3: mov ax,x sub ax,y mov x,ax ret pl4: mov ax,y sub ax,x mov x,ax mov xsighn,0 ret miness: mov al,x_float_count cmp al,y_float_count ja m1x jb m1y je m1xy m1x: mov ax,y mul _TEN mov y,ax inc y_float_count jmp miness m1y: mov ax,x mul _TEN mov x,ax inc x_float_count jmp miness m1xy: mov ax,x cmp ax,y jae mi3 jb mi4 mi3: mov ax,x sub ax,y mov x,ax mov xsighn,0 ret mi4: mov ax,y sub ax,x mov x,ax mov xsighn,1 ret mulplus: mov al,y_float_count add x_float_count,al mov dx,0 mov ax,x cwd mov bx,y mul bx jno mu1 mov of,1 mu1: add ax,dx mov x,ax mov al,xsighn cmp al,ysighn je mu2 jne mu3 mu2: mov xsighn,0 ret mu3: mov xsighn,1 ret devide: mov al,x_float_count cmp al,y_float_count jne d1 mov x_float_count,0 xor dx,dx mov ax,x div y mov x,ax d1_1: cmp dx,0 je endDIV cmp x_float_count,2 je endDIV mov bx,dx mov ax,x mul _TEN mov x,ax mov ax,bx mul _TEN inc x_float_count div y add x,ax jmp d1_1 endDiv: cmp dx,0 je nOF mov of,1 nOF: ret d1: ja d1x jb d1y d1x: mov ax,y mul _TEN mov y,ax inc y_float_count jmp devide d1y: mov ax,x mul _TEN mov x,ax inc x_float_count jmp devide calculate endp ;--------------------------------------------------- exit: mov ax, 4c00h ; exit int 21h ends end start
routines/math/multiplication.asm
undisbeliever/snesdev-common
3
247907
;; Multiplication routines ;; ----------------------- ;; ;; included by `routines/math.s` .code .A8 .A16 ROUTINE Multiply_U8Y_U8X_UY PHP SEP #$30 .I16 STY WRMPYA STX WRMPYB ; Wait 8 Cycles REP #$10 ; 3 .A16 PLP ; 4 LDY RDMPY ; 1 instruction fetch RTS ; Must not use mathTmp1-4 ; Does not use X .A8 .I16 ROUTINE Multiply_U16Y_U8A_U16Y ROUTINE Multiply_S16Y_U8A_S16Y ROUTINE Multiply_U16Y_U8A_U32 STA WRMPYA TYA STA WRMPYB ; Wait 8 Cycles - get Yh STY product32 ; 5 LDA product32 + 1 ; 4 LDY RDMPY STY product32 STA WRMPYB ; WRMPYA is already set ; 16A uses 24 cycles, 8A also uses 26 cycles. ; Wait 8 Cycles REP #$31 ; 3 .A16 ; c clear LDA product32 + 1 ; 5 AND #$00FF ADC RDMPY STA product32 + 1 SEP #$20 .A8 STZ product32 + 3 LDY product32 RTS .I16 ROUTINE Multiply_U16Y_U16X_U16Y ROUTINE Multiply_U16Y_S16X_16Y ROUTINE Multiply_S16Y_U16X_16Y ROUTINE Multiply_S16Y_S16X_S16Y ; Y y ; * X x ; ----------- ; y*x ; + Y*x ; + y*X PHP SEP #$20 .A8 TXA STA WRMPYA ; Low byte of x TYA STA WRMPYB ; Low byte of y ; Wait 8 Cycles STY mathTmp1 ; 5 STX mathTmp3 ; 5 LDX RDMPY LDA mathTmp1 + 1 ; High byte of Y STA WRMPYB ; WRMPYA is already Low x ; Wait 8 Cycles STX product32 ; 5 LDA product32 + 1 ; 4 CLC ADC RDMPYL STA product32 + 1 LDA mathTmp3 + 1 ; High byte of X STA WRMPYA TYA ; Low byte of Y STA WRMPYB ; Wait 8 cycles CLC ; 2 LDA product32 + 1 ; 4 ADC RDMPY ; 2 - load address STA product32 + 1 LDY product32 PLP RTS .I16 ROUTINE Multiply_U16Y_U16X_U32XY ROUTINE Multiply_U16Y_S16X_32XY ROUTINE Multiply_S16Y_U16X_32XY ; Y y ; * X x ; ----------- ; y*x ; + c Y*x ; + c y*X ; + Y*X PHP SEP #$20 .A8 TXA STA WRMPYA ; Low byte of x TYA STA WRMPYB ; Low byte of y ; Wait 8 Cycles STY mathTmp1 ; 5 STX mathTmp3 ; 5 LDX RDMPY LDA mathTmp1 + 1 ; High byte of Y STA WRMPYB ; WRMPYA is already Low x ; Wait 8 Cycles STX product32 ; 5 LDA product32 + 1 ; 4 CLC ADC RDMPYL STA product32 + 1 LDA RDMPYH REP #$20 .A16 ADC #0 STA product32 + 2 SEP #$20 .A8 LDA mathTmp3 + 1 ; High byte of X STA WRMPYA LDA mathTmp1 ; Low byte of Y STA WRMPYB ; Wait 8 cycles REP #$31 ; 3 .A16 ; c clear LDA product32 + 1 ; 5 ADC RDMPY STA product32 + 1 SEP #$20 .A8 LDA #0 ADC #0 STA product32 + 3 ; Keep Carry for next addition LDA mathTmp1 + 1 ; High byte of Y STA WRMPYB ; Wait 8 cycles REP #$31 ; 3 .A16 ; c clear LDA product32 + 2 ; 5 ADC RDMPY STA product32 + 2 TAX LDY product32 PLP RTS .A8 .I16 ROUTINE Multiply_S16Y_S16X_S32XY CPY #$8000 IF_LT ; Y is Positive CPX #$8000 BLT Multiply_U16Y_U16X_U32XY ; Y is Positive, X is Negative STX factor32 + 0 LDX #$FFFF STX factor32 + 2 BRA Multiply_S32_U16Y_S32XY ENDIF ; Y is Negative STY factor32 + 0 LDY #$FFFF STY factor32 + 2 TXY .assert * = Multiply_S32_S16Y_S32XY, lderror, "Bad Flow" .A8 .I16 ROUTINE Multiply_U32_S16Y_32XY ROUTINE Multiply_S32_S16Y_S32XY CPY #$8000 IF_GE LDX #$FFFF BRA Multiply_S32_S32XY_S32XY_SkipXCheck ENDIF .assert * = Multiply_U32_U16Y_U32XY, lderror, "Bad Flow" .A8 .I16 ROUTINE Multiply_U32_U16Y_U32XY ROUTINE Multiply_S32_U16Y_S32XY ; f3 f2 f1 f0 ; * Yh Yl ; ------------------ ; c f0*Yl ; + c f1*Yl ; + c f2*Yl ; + f3*Yl ; + c f0*Yh ; + f1*Yh ; + f2*Yh ; ; tmp = factor * Yl ; Product = tmp + (factor * Yh << 8) PHY LDXY factor32 PLA ; Yl JSR Multiply_U32XY_U8A_U32XY STXY mathTmp1 ; not used by Multiply_U16Y_U8A LDY factor32 + 0 PLA ; Yh JSR Multiply_U16Y_U8A_U32 LDX product32 + 2 LDA factor32 + 2 STA WRMPYB ; WRMPYA already contains Yh ; Wait 8 cycles LDA mathTmp1 ; 4 STA product32 ; 4 REP #$31 .A16 ; c clear TYA ADC mathTmp1 + 1 STA product32 + 1 SEP #$20 .A8 TXA ADC mathTmp1 + 3 CLC ADC RDMPYL STA product32 + 3 LDXY product32 RTS .A8 .I16 ROUTINE Multiply_U32_U32XY_U32XY ROUTINE Multiply_U32_S32XY_32XY ROUTINE Multiply_S32_U32XY_32XY ROUTINE Multiply_S32_S32XY_S32XY ; f3 f2 f1 f0 ; * Xh Xl Yh Yl ; ------------------ ; c f0*Yl ; + c f1*Yl ; + c f2*Yl ; + f3*Yl ; + c f0*Yh ; + f1*Yh ; + f2*Yh ; + c f0*Xl ; + f1*Xl ; + f0*Xh ; ; tmp = (factor * Yl) + (factor * Yh << 8) ; product = tmp + (factor * Xl << 16) + (factor * Xh << 24) CPX #0 BEQ Multiply_U32_U16Y_U32XY Multiply_S32_S32XY_S32XY_SkipXCheck: PHX PHY ; first line LDXY factor32 PLA ; Yl JSR Multiply_U32XY_U8A_U32XY STXY mathTmp1 ; not used by Multiply_U16Y_U8A LDY factor32 + 0 PLA ; Yh JSR Multiply_U16Y_U8A_U32 LDX product32 + 2 LDA factor32 + 2 STA WRMPYB ; WRMPYA already contains Yh ; Wait 8 cycles REP #$31 ; 3 .A16 ; c clear TYA ; 2 ADC mathTmp1 + 1 ; 3 instruction fetch, addr fetch STA mathTmp1 + 1 SEP #$20 .A8 TXA ADC mathTmp1 + 3 CLC ADC RDMPYL STA mathTmp1 + 3 ; product = tmp + (factor * Xl << 16) + (factor * Xh << 24) PLA ; Xl LDY factor32 JSR Multiply_U16Y_U8A_U32 ; Does not use mathTmp REP #$31 .A16 ; c clear TYA ADC mathTmp1 + 2 ; & 3 STA product32 + 2 ; & 3 SEP #$20 .A8 LDA factor32 STA WRMPYA PLA ; Xh STA WRMPYB ; Wait 8 cycles LDX mathTmp1 + 0 ; & 1 ; 5 STX product32 + 0 ; & 1 ; 5 LDA product32 + 3 ADD RDMPYL STA product32 + 3 LDXY product32 RTS .A8 .I16 ROUTINE Multiply_U32XY_U8A_U32XY ROUTINE Multiply_S32XY_U8A_S32XY STA WRMPYA ; Low Word TYA STA WRMPYB ; Wait 8 Cycles STY mathTmp1 ; 5 LDA mathTmp1 + 1 ; 4 (high byte of Y) LDY RDMPY STA WRMPYB ; WRMPYA is already set ; Wait 8 cycles STY product32 + 0 ; 5 LDA product32 + 1 ; 4 CLC ADC RDMPYL STA product32 + 1 LDA RDMPYH STA product32 + 2 ; High Word TXA STA WRMPYB ; Wait 8 Cycles STX mathTmp1 ; 5 LDA product32 + 2 ; 4 ADC RDMPYL ; keep carry from previous addition STA product32 + 2 LDA RDMPYH STA product32 + 3 LDA mathTmp1 + 1 ; high byte of X STA WRMPYB ; WRMPYA is already set ; Wait 8 cycles LDA product32 + 3 ; 4 LDY product32 ; 5 ADC RDMPYL STA product32 + 3 LDX product32 + 2 ; may as well, would need to test/save it asap anyway. RTS
Windows/Visual Studio/MmxShift/MmxShift/MmxShifter.asm
leonhad/masm
9
242004
.MODEL flat, c .CODE MmxShifter PROC push ebp mov ebp, esp xor eax, eax mov edx, [ebp+16] ; edx = shift_op cmp edx, ShiftOpTableCount jae BadShiftOp ; invalid operation mov eax, 1 ; set success return code movq mm0, [ebp+8] ; loads a movd mm1, dword ptr[ebp+20] ; load count into low dword jmp [ShiftOpTable+edx*4] MmxPsllw: psllw mm0, mm1 ; shift left logical word jmp SaveResult MmxPsrlw: psrlw mm0, mm1 ; shift right logical word jmp SaveResult MmxPsraw: psraw mm0, mm1 ; shift right arithmetic word jmp SaveResult MmxPslld: pslld mm0, mm1 ; shift left logical dword jmp SaveResult MmxPsrld: psrld mm0, mm1 ; shift right logical dword jmp SaveResult MmxPsrad: psrad mm0, mm1 ; shift right arithmetic dword jmp SaveResult BadShiftOp: pxor xmm0, xmm0 SaveResult: mov edx, [ebp+24] ; edx = *b movq [edx], mm0 ; *b = mm0 emms pop ebp ret ALIGN 4 ShiftOpTable: dword MmxPsllw, MmxPsrlw, MmxPsraw dword MmxPslld, MmxPsrld, MmxPsrad ShiftOpTableCount equ ($-ShiftOpTable) / size dword MmxShifter ENDP END
ruby-antlr-hash-2-json/src/main/antlr/ua/k/co/play/rah2j/LibExpr.g4
msangel/playground
0
5132
grammar LibExpr; // Rename to distinguish from original import CommonLexerRules; // includes all rules from CommonLexerRules.g4 /** The start rule; begin parsing here. */ prog: stat+ ; stat: expr NEWLINE | ID '=' expr NEWLINE | NEWLINE ; expr: expr ('*'|'/') expr | expr ('+'|'-') expr | INT | ID | '(' expr ')' ;
tests/game-test_data-tests-attributes_container.ads
thindil/steamsky
80
3790
package Game.Test_Data.Tests.Attributes_Container is end Game.Test_Data.Tests.Attributes_Container;
theorems/stash/modalities/gbm/GbmUtil.agda
timjb/HoTT-Agda
294
14818
<reponame>timjb/HoTT-Agda {-# OPTIONS --without-K --rewriting #-} open import HoTT module stash.modalities.gbm.GbmUtil where BM-Relation : ∀ {ℓ} (M : Modality ℓ) {A : Type ℓ} {B : Type ℓ} (Q : A → B → Type ℓ) → Type ℓ BM-Relation M {A} {B} Q = {a₀ : A} {b₀ : B} (q₀ : Q a₀ b₀) {a₁ : A} (q₁ : Q a₁ b₀) {b₁ : B} (q₂ : Q a₀ b₁) → Modality.is-◯-connected M (((a₀ , q₀) == (a₁ , q₁)) * ((b₀ , q₀) == (b₁ , q₂))) prop-lemma : ∀ {ℓ} {A : Type ℓ} {a₀ a₁ : A} (P : A → hProp ℓ) (p : a₀ == a₁) (x₀ : (fst ∘ P) a₀) (x₁ : (fst ∘ P) a₁) → x₀ == x₁ [ (fst ∘ P) ↓ p ] prop-lemma P idp x₀ x₁ = prop-has-all-paths (snd (P _)) x₀ x₁ pths-ovr-is-prop : ∀ {ℓ} {A : Type ℓ} {a₀ a₁ : A} (P : A → hProp ℓ) (p : a₀ == a₁) (x₀ : (fst ∘ P) a₀) (x₁ : (fst ∘ P) a₁) → is-prop (x₀ == x₁ [ (fst ∘ P) ↓ p ]) pths-ovr-is-prop P idp x₀ x₁ = =-preserves-level (snd (P _)) pths-ovr-contr : ∀ {ℓ} {A : Type ℓ} {a₀ a₁ : A} (P : A → hProp ℓ) (p : a₀ == a₁) (x₀ : (fst ∘ P) a₀) (x₁ : (fst ∘ P) a₁) → is-contr (x₀ == x₁ [ (fst ∘ P) ↓ p ]) pths-ovr-contr P idp x₀ x₁ = =-preserves-level (inhab-prop-is-contr x₀ (snd (P _))) eqv-square : ∀ {i j} {A : Type i} {B : Type j} (e : A ≃ B) {b b' : B} (p : b == b') → ap (–> e ∘ <– e) p == (<–-inv-r e b) ∙ p ∙ (! (<–-inv-r e b')) eqv-square e idp = ! (!-inv-r (<–-inv-r e _)) eqv-square' : ∀ {i j} {A : Type i} {B : Type j} (e : A ≃ B) {a a' : A} (p : a == a') → ap (<– e ∘ –> e) p == <–-inv-l e a ∙ p ∙ ! (<–-inv-l e a') eqv-square' e idp = ! (!-inv-r (<–-inv-l e _)) ↓-==-in : ∀ {i j} {A : Type i} {B : Type j} {f g : A → B} {x y : A} {p : x == y} {u : f x == g x} {v : f y == g y} → (u ∙ ap g p) == (ap f p ∙ v) → (u == v [ (λ x → f x == g x) ↓ p ]) ↓-==-in {p = idp} q = ! (∙-unit-r _) ∙ q ↓-==-out : ∀ {i j} {A : Type i} {B : Type j} {f g : A → B} {x y : A} {p : x == y} {u : f x == g x} {v : f y == g y} → (u == v [ (λ x → f x == g x) ↓ p ]) → (u ∙ ap g p) == (ap f p ∙ v) ↓-==-out {p = idp} q = (∙-unit-r _) ∙ q module HFiberSrcEquiv {i₀ i₁ i₂} {A : Type i₀} {B : Type i₁} {C : Type i₂} (f : A → B) (h : B → C) (k : A → C) (w : (a : A) → h (f a) == k a) (ise-f : is-equiv f) where private g = is-equiv.g ise-f f-g = is-equiv.f-g ise-f g-f = is-equiv.g-f ise-f adj = is-equiv.adj ise-f adj' = is-equiv.adj' ise-f to : (c : C) → hfiber k c → hfiber h c to .(k a) (a , idp) = f a , w a to-lem₀ : (c : C) (x : hfiber k c) → fst (to c x) == f (fst x) to-lem₀ .(k a) (a , idp) = idp to-lem₁ : (c : C) (x : hfiber k c) → snd (to c x) == ap h (to-lem₀ c x) ∙ w (fst x) ∙ snd x to-lem₁ .(k a) (a , idp) = ! (∙-unit-r (w a)) from : (c : C) → hfiber h c → hfiber k c from .(h b) (b , idp) = g b , ! (w (g b)) ∙ ap h (f-g b) from-lem₀ : (c : C) (x : hfiber h c) → fst (from c x) == g (fst x) from-lem₀ .(h b) (b , idp) = idp from-lem₁ : (c : C) (x : hfiber h c) → snd (from c x) == ap k (from-lem₀ c x) ∙ (! (w (g (fst x)))) ∙ ap h (f-g (fst x)) ∙ snd x from-lem₁ .(h b) (b , idp) = ap (λ p → ! (w (g b)) ∙ p) (! (∙-unit-r (ap h (f-g b)))) to-from : (c : C) (x : hfiber h c) → to c (from c x) == x to-from .(h b) (b , idp) = pair= (q ∙ f-g b) (↓-app=cst-in (r ∙ eq)) where c = h b p = ! (w (g b)) ∙ ap h (f-g b) q = to-lem₀ c (g b , p) r = to-lem₁ c (g b , p) eq = ap h q ∙ w (g b) ∙ ! (w (g b)) ∙ ap h (f-g b) =⟨ ! (∙-assoc (w (g b)) (! (w (g b))) (ap h (f-g b))) |in-ctx (λ x → ap h q ∙ x) ⟩ ap h q ∙ (w (g b) ∙ (! (w (g b)))) ∙ ap h (f-g b) =⟨ !-inv-r (w (g b)) |in-ctx (λ x → ap h q ∙ x ∙ ap h (f-g b)) ⟩ ap h q ∙ ap h (f-g b) =⟨ ∙-ap h q (f-g b) ⟩ ap h (q ∙ f-g b) =⟨ ! (∙-unit-r (ap h (q ∙ f-g b))) ⟩ ap h (q ∙ f-g b) ∙ idp ∎ from-to : (c : C) (x : hfiber k c) → from c (to c x) == x from-to .(k a) (a , idp) = pair= (p ∙ g-f a) (↓-app=cst-in (q ∙ eq)) where c = k a p = from-lem₀ c (f a , w a) q = from-lem₁ c (f a , w a) eq = ap k p ∙ ! (w (g (f a))) ∙ ap h (f-g (f a)) ∙ w a =⟨ ! (adj a) |in-ctx (λ x → ap k p ∙ ! (w (g (f a))) ∙ ap h x ∙ w a) ⟩ ap k p ∙ ! (w (g (f a))) ∙ ap h (ap f (g-f a)) ∙ w a =⟨ ∘-ap h f (g-f a) |in-ctx (λ x → ap k p ∙ ! (w (g (f a))) ∙ x ∙ w a) ⟩ ap k p ∙ ! (w (g (f a))) ∙ ap (h ∘ f) (g-f a) ∙ w a =⟨ ! (↓-='-out (apd w (g-f a))) |in-ctx (λ x → ap k p ∙ ! (w (g (f a))) ∙ x) ⟩ ap k p ∙ ! (w (g (f a))) ∙ w (g (f a)) ∙' ap k (g-f a) =⟨ ∙'=∙ (w (g (f a))) (ap k (g-f a)) |in-ctx (λ x → ap k p ∙ ! (w (g (f a))) ∙ x) ⟩ ap k p ∙ ! (w (g (f a))) ∙ w (g (f a)) ∙ ap k (g-f a) =⟨ ! (∙-assoc (! (w (g (f a)))) (w (g (f a))) (ap k (g-f a))) |in-ctx (λ x → ap k p ∙ x) ⟩ ap k p ∙ (! (w (g (f a))) ∙ w (g (f a))) ∙ ap k (g-f a) =⟨ !-inv-l (w (g (f a))) |in-ctx (λ x → ap k p ∙ x ∙ ap k (g-f a)) ⟩ ap k p ∙ ap k (g-f a) =⟨ ∙-ap k p (g-f a) ⟩ ap k (p ∙ g-f a) =⟨ ! (∙-unit-r (ap k (p ∙ g-f a))) ⟩ ap k (p ∙ g-f a) ∙ idp ∎ eqv : (c : C) → hfiber k c ≃ hfiber h c eqv c = equiv (to c) (from c) (to-from c) (from-to c) module HFiberTgtEquiv {i₀ i₁ i₂} {A : Type i₀} {B : Type i₁} {C : Type i₂} (h : A → B) (k : A → C) (f : B → C) (w : (a : A) → k a == f (h a)) (ise-f : is-equiv f) where private g = is-equiv.g ise-f f-g = is-equiv.f-g ise-f g-f = is-equiv.g-f ise-f adj = is-equiv.adj ise-f adj' = is-equiv.adj' ise-f to : (b : B) → hfiber h b → hfiber k (f b) to .(h a) (a , idp) = a , w a to-lem₀ : (b : B) (x : hfiber h b) → fst (to b x) == fst x to-lem₀ .(h a) (a , idp) = idp to-lem₁ : (b : B) (x : hfiber h b) → snd (to b x) == ap k (to-lem₀ b x) ∙ w (fst x) ∙ ap f (snd x) to-lem₁ .(h a) (a , idp) = ! (∙-unit-r (w a)) from : (b : B) → hfiber k (f b) → hfiber h b from b (a , p) = a , (! (g-f (h a)) ∙ ap g (! (w a) ∙ p) ∙ g-f b) to-from : (b : B) (x : hfiber k (f b)) → to b (from b x) == x to-from b (a , p) = pair= r (↓-app=cst-in (s ∙ (ap (λ x → ap k r ∙ x) eq))) where q = ! (g-f (h a)) ∙ ap g (! (w a) ∙ p) ∙ g-f b r = to-lem₀ b (a , q) s = to-lem₁ b (a , q) eq = w a ∙ ap f q =⟨ ! (∙-ap f (! (g-f (h a))) (ap g (! (w a) ∙ p) ∙ g-f b)) |in-ctx (λ x → w a ∙ x) ⟩ w a ∙ ap f (! (g-f (h a))) ∙ ap f (ap g (! (w a) ∙ p) ∙ g-f b) =⟨ ! (∙-ap f (ap g (! (w a) ∙ p)) (g-f b)) |in-ctx (λ x → w a ∙ ap f (! (g-f (h a))) ∙ x) ⟩ w a ∙ ap f (! (g-f (h a))) ∙ ap f (ap g (! (w a) ∙ p)) ∙ ap f (g-f b) =⟨ ∘-ap f g (! (w a) ∙ p) |in-ctx (λ x → w a ∙ ap f (! (g-f (h a))) ∙ x ∙ ap f (g-f b)) ⟩ w a ∙ ap f (! (g-f (h a))) ∙ ap (f ∘ g) (! (w a) ∙ p) ∙ ap f (g-f b) =⟨ ap (λ x → w a ∙ ap f (! (g-f (h a))) ∙ x ∙ ap f (g-f b)) (eqv-square (f , ise-f) (! (w a) ∙ p)) ⟩ w a ∙ ap f (! (g-f (h a))) ∙ (f-g (f (h a)) ∙ (! (w a) ∙ p) ∙ ! (f-g (f b))) ∙ ap f (g-f b) =⟨ adj b |in-ctx (λ x → w a ∙ ap f (! (g-f (h a))) ∙ (f-g (f (h a)) ∙ (! (w a) ∙ p) ∙ ! (f-g (f b))) ∙ x) ⟩ w a ∙ ap f (! (g-f (h a))) ∙ (f-g (f (h a)) ∙ (! (w a) ∙ p) ∙ ! (f-g (f b))) ∙ f-g (f b) =⟨ ∙-assoc (f-g (f (h a))) ((! (w a) ∙ p) ∙ ! (f-g (f b))) (f-g (f b)) |in-ctx (λ x → w a ∙ ap f (! (g-f (h a))) ∙ x) ⟩ w a ∙ ap f (! (g-f (h a))) ∙ f-g (f (h a)) ∙ ((! (w a) ∙ p) ∙ ! (f-g (f b))) ∙ f-g (f b) =⟨ ∙-assoc (! (w a) ∙ p) (! (f-g (f b))) (f-g (f b)) |in-ctx (λ x → w a ∙ ap f (! (g-f (h a))) ∙ f-g (f (h a)) ∙ x) ⟩ w a ∙ ap f (! (g-f (h a))) ∙ f-g (f (h a)) ∙ (! (w a) ∙ p) ∙ ! (f-g (f b)) ∙ f-g (f b) =⟨ !-inv-l (f-g (f b)) |in-ctx (λ x → w a ∙ ap f (! (g-f (h a))) ∙ f-g (f (h a)) ∙ (! (w a) ∙ p) ∙ x) ⟩ w a ∙ ap f (! (g-f (h a))) ∙ f-g (f (h a)) ∙ (! (w a) ∙ p) ∙ idp =⟨ ∙-unit-r (! (w a) ∙ p) |in-ctx (λ x → w a ∙ ap f (! (g-f (h a))) ∙ f-g (f (h a)) ∙ x) ⟩ w a ∙ ap f (! (g-f (h a))) ∙ f-g (f (h a)) ∙ ! (w a) ∙ p =⟨ ap-! f (g-f (h a)) |in-ctx (λ x → w a ∙ x ∙ f-g (f (h a)) ∙ ! (w a) ∙ p) ⟩ w a ∙ ! (ap f (g-f (h a))) ∙ f-g (f (h a)) ∙ ! (w a) ∙ p =⟨ ! (adj (h a)) |in-ctx (λ x → w a ∙ ! (ap f (g-f (h a))) ∙ x ∙ ! (w a) ∙ p) ⟩ w a ∙ ! (ap f (g-f (h a))) ∙ ap f (g-f (h a)) ∙ ! (w a) ∙ p =⟨ ! (∙-assoc (! (ap f (g-f (h a)))) (ap f (g-f (h a))) (! (w a) ∙ p)) |in-ctx (λ x → w a ∙ x)⟩ w a ∙ (! (ap f (g-f (h a))) ∙ ap f (g-f (h a))) ∙ ! (w a) ∙ p =⟨ !-inv-l (ap f (g-f (h a))) |in-ctx (λ x → w a ∙ x ∙ ! (w a) ∙ p)⟩ w a ∙ ! (w a) ∙ p =⟨ ! (∙-assoc (w a) (! (w a)) p) ⟩ (w a ∙ ! (w a)) ∙ p =⟨ !-inv-r (w a) |in-ctx (λ x → x ∙ p) ⟩ p ∎ from-to : (b : B) (x : hfiber h b) → from b (to b x) == x from-to .(h a) (a , idp) = pair= idp eq where eq = ! (g-f (h a)) ∙ ap g (! (w a) ∙ w a) ∙ g-f (h a) =⟨ !-inv-l (w a)|in-ctx (λ x → ! (g-f (h a)) ∙ ap g x ∙ g-f (h a)) ⟩ ! (g-f (h a)) ∙ g-f (h a) =⟨ !-inv-l (g-f (h a)) ⟩ idp ∎ eqv : (b : B) → hfiber h b ≃ hfiber k (f b) eqv b = equiv (to b) (from b) (to-from b) (from-to b) module HFiberSqEquiv {i₀ i₁ j₀ j₁} {A₀ : Type i₀} {A₁ : Type i₁} {B₀ : Type j₀} {B₁ : Type j₁} (f₀ : A₀ → B₀) (f₁ : A₁ → B₁) (hA : A₀ → A₁) (hB : B₀ → B₁) (sq : CommSquare f₀ f₁ hA hB) (ise-hA : is-equiv hA) (ise-hB : is-equiv hB) where open CommSquare private gB = is-equiv.g ise-hB module Src = HFiberSrcEquiv hA f₁ (hB ∘ f₀) (λ a₀ → ! (commutes sq a₀)) ise-hA module Tgt = HFiberTgtEquiv f₀ (f₁ ∘ hA) hB (λ a₀ → ! (commutes sq a₀)) ise-hB eqv : (b₀ : B₀) → hfiber f₀ b₀ ≃ hfiber f₁ (hB b₀) eqv b₀ = Src.eqv (hB b₀) ∘e coe-equiv (ap (λ s → hfiber s (hB b₀)) (λ= (λ a₀ → ! (commutes sq a₀)))) ∘e Tgt.eqv b₀ hfiber-sq-eqv : ∀ {i₀ i₁ j₀ j₁} {A₀ : Type i₀} {A₁ : Type i₁} {B₀ : Type j₀} {B₁ : Type j₁} (f₀ : A₀ → B₀) (f₁ : A₁ → B₁) (hA : A₀ → A₁) (hB : B₀ → B₁) (sq : CommSquare f₀ f₁ hA hB) (ise-hA : is-equiv hA) (ise-hB : is-equiv hB) → (b₀ : B₀) → hfiber f₀ b₀ ≃ hfiber f₁ (hB b₀) hfiber-sq-eqv f₀ f₁ hA hB sq ise-hA ise-hB b₀ = M.eqv b₀ where module M = HFiberSqEquiv f₀ f₁ hA hB sq ise-hA ise-hB
libsrc/_DEVELOPMENT/adt/wv_priority_queue/c/sdcc_iy/wv_priority_queue_empty_fastcall.asm
meesokim/z88dk
0
19385
; int wv_priority_queue_empty_fastcall(wv_priority_queue_t *q) SECTION code_adt_wv_priority_queue PUBLIC _wv_priority_queue_empty_fastcall defc _wv_priority_queue_empty_fastcall = asm_wv_priority_queue_empty INCLUDE "adt/wv_priority_queue/z80/asm_wv_priority_queue_empty.asm"
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/pak.ads
best08618/asylo
7
2835
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/pak.ads with Ada.Finalization; package Pak is type T is new Ada.Finalization.Controlled with null record; procedure Initialize (X : in out T); procedure Finalize (X : in out T); procedure Assign (X : out T'Class); end Pak;
src/ada/src/services/spark/common.ads
manthonyaiello/OpenUxAS
0
9917
<reponame>manthonyaiello/OpenUxAS with Ada.Containers.Functional_Vectors; with Ada.Containers.Functional_Sets; with Ada.Containers.Functional_Maps; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Interfaces; package Common with SPARK_Mode is type UInt32 is new Interfaces.Unsigned_32; type Int64 is new Integer; type Real32 is new Interfaces.IEEE_Float_32; type Real64 is new Interfaces.IEEE_Float_64; function Get_TaskID (TaskOptionID : Int64) return Int64 is (TaskOptionID / 100000); -- Retrieve the TaskId from a TaskOptionId function Get_OptionID (TaskOptionID : Int64) return Int64 is (TaskOptionID rem 100000); -- Retrieve the OptionId from a TaskOptionId function Get_TaskOptionID (TaskID, OptionID : Int64) return Int64 is (TaskID * 100000 + OptionID); -- Generate TaskOptionID from TaskID and OptionID function Int64_Hash (X : Int64) return Ada.Containers.Hash_Type is (Ada.Containers.Hash_Type'Mod (X)); package Int64_Sequences is new Ada.Containers.Functional_Vectors (Index_Type => Positive, Element_Type => Int64); type Int64_Seq is new Int64_Sequences.Sequence; package Int64_Sets is new Ada.Containers.Functional_Sets (Int64); type Int64_Set is new Int64_Sets.Set; package Int64_Maps is new Ada.Containers.Functional_Maps (Int64, Int64); type Int64_Map is new Int64_Maps.Map; -- Messages are unbounded strings. To avoid having to prove that messages -- do not overflow Integer'Last, we use a procedure which will truncate -- the message if it is too long. We can justify that this should not -- happen in practice. procedure Append_To_Msg (Msg : in out Unbounded_String; Tail : String); -- Append Tail to Msg if there is enough room in the unbounded string end Common;
texmap/john.asm
osgcc/descent-pc
3
16903
<gh_stars>1-10 ;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX ;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO ;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A ;ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS ;IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS ;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE ;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE ;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS ;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. ;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. align 4 TopOfLoop4: add ebx, DU1 add ebp, DV1 add ecx, DZ1 ; Done with ebx, ebp, ecx until next iteration push ebx push ecx push ebp push edi ; Find fixed U1 mov eax, ebx PDIV mov ebx, eax ; ebx = U1 until pop's ; Find fixed V1 mov eax, ebp PDIV mov ebp, eax ; ebp = V1 until pop's mov ecx, U0 ; ecx = U0 until pop's mov edi, V0 ; edi = V0 until pop's ; Make ESI = V0:U0 in 6:10,6:10 format mov eax, ecx shr eax, 6 mov esi, edi shl esi, 10 mov si, ax ; Make EDX = DV:DU in 6:10,6:10 format mov eax, ebx sub eax, ecx sar eax, NBITS+6 mov edx, ebp sub edx, edi shl edx, 10-NBITS ; EDX = V1-V0/ 4 in 6:10 int:frac mov dx, ax ; put delta u in low word ; Save the U1 and V1 so we don't have to divide on the next iteration mov U0, ebx mov V0, ebp pop edi ; Restore EDI before using it ; LIGHTING CODE mov ebx, _fx_l mov ebp, _fx_dl_dx1 REPT (1 SHL (NBITS-2)) REPT 2 mov eax, esi ; get u,v shr eax, 26 ; shift out all but int(v) shld ax,si,6 ; shift in u, shifting up v add esi, edx ; inc u,v mov al, es:[eax] ; get pixel from source bitmap mov ah, bh ; form lighting table lookup value add ebx, ebp ; update lighting value mov cl, fs:[eax] ; xlat thru lighting table into dest buffer ; eax = 0 ; ebx = l in fixed 24.8 (really 8.8) ; ecx = (dv << 16) | du (in fixed 8.8) ; edx = free ; esi = ptr to source bitmap ; edi = destination ptr ; ebp = dldx (in fixed 24.8) (really 8.8) ; MEM [0..3] = (u<<16) | v (in fixed 8.8) ; Code for 8-bit destination, lighting mov al, [0] ; get u mov ah, [2] ; get v add [0], ecx ; inc u,v mov al, [esi+eax] ; get source pixel mov ah, bh ; form lighting lookup value mov al, FadeTable[eax] ; get lit pixel mov ah, [edi] ; get prev pixel mov al, Transparent[eax] ; get transluscent pixel value mov [edi], al ; write pixel to frame buffer inc edi ; inc dest add ebx, ebp ; inc lighting value ; Code for 8-bit destination, no lighting mov al, [0] ; get u mov ah, [2] ; get v add [0], ecx ; inc u,v mov al, [esi+eax] ; get source pixel mov [edi], al ; write pixel to frame buffer inc edi ; inc dest add ebx, ebp ; inc dl ; old way mov eax,ebp ; clear for add ebp,edx ; update v coordinate shr eax,26 ; shift in v coordinate shld eax,ebx,6 ; shift in u coordinate while shifting up v coordinate add ebx,ecx ; update u coordinate mov al,[esi+eax] ; get pixel from source bitmap mov [edi],al inc edi ; Code for 15-bit destination, with fade table in hardware mov al, ch ; get u,v mov ah, dh ; mov al, es:[eax] mov ah, bh mov [edi], ax ; write pixel to frame buffer add edi, 2 add ecx, esi bswap esi add edx, esi bswap esi add ebx, ebp ; Code for 15-bit destination, with RGB 15 bit in hardware... mov al, ch ; get u,v mov ah, dh ; mov al, es:[eax] mov ah, bh mov ax, gs:[eax*2] mov [edi], ax ; write pixel to frame buffer add edi, 2 add ecx, esi bswap esi add edx, esi bswap esi add ebx, ebp mov eax, esi ; get u,v shr eax, 26 ; shift out all but int(v) shld ax,si,6 ; shift in u, shifting up v add esi, edx ; inc u,v mov al, es:[eax] ; get pixel from source bitmap mov ah, bh ; form lighting table lookup value esi, ebp esi, ebp, ; Do odd pixel mov eax, esi ; get u,v shr eax, 26 ; shift out all but int(v) shld ax,si,6 ; shift in u, shifting up v add esi, edx ; inc u,v mov al, es:[eax] ; get pixel from source bitmap mov ah, bh ; form lighting table lookup value add ebx, ebp ; update lighting value mov ch, fs:[eax] ; xlat thru lighting table into dest buffer ror ecx, 16 ; move to next double dest pixel position ENDM mov [edi],ecx ; Draw 4 pixels to display add edi,4 ENDM ; LIGHTING CODE mov _fx_l, ebx pop ebp pop ecx pop ebx dec _loop_count jnz TopOfLoop4 mov eax, esi ; get u,v shr eax, 26 ; shift out all but int(v) shld ax,si,6 ; shift in u, shifting up v add esi, edx ; inc u,v mov al, es:[eax] ; get pixel from source bitmap cmp al,255 je skipa1 mov ah, bh ; form lighting table lookup value add ebx, ebp ; update lighting value mov al, fs:[eax] ; xlat thru lighting table into dest buffer mov [edi],al mov eax, esi ; get u,v shr eax, 26 ; shift out all but int(v) shld ax,si,6 ; shift in u, shifting up v add esi, edx ; inc u,v mov al, es:[eax] ; get pixel from source bitmap mov ah, bh ; form lighting table lookup value add ebx, ebp ; update lighting value mov al, fs:[eax] ; xlat thru lighting table into dest buffer mov ah, [edi] ; get pixel already drawn here mov al, gs:[eax] ; lookup in translation table mov [edi],al ; write pixel ; Code for 8-bit destination, lighting, transluscency mov dx, [edi] mov al, [0] ; get u mov ah, [2] ; get v add [0], ecx ; inc u,v mov al, [esi+eax] ; get source pixel mov ah, bh ; form lighting lookup value mov al, FadeTable[eax] ; get lit pixel mov ah, dl ; get prev pixel add ebx, ebp ; inc lighting value mov dl, TransTable[eax] ; get transluscent pixel value mov al, [0] ; get u mov ah, [2] ; get v add [0], ecx ; inc u,v mov al, [esi+eax] ; get source pixel mov ah, bh ; form lighting lookup value mov al, FadeTable[eax] ; get lit pixel mov ah, dh ; get prev pixel add ebx, ebp ; inc lighting value mov dh, TransTable[eax] ; get transluscent pixel value mov [edi], dx ; write 2 pixels to frame buffer inc edi ; move to next pixel inc edi ; move to next pixel ; compute v coordinate mov eax,ebp ; get v cdq idiv ecx ; eax = (v/z) and eax,3fh ; mask with height-1 mov ebx,eax ; compute u coordinate mov eax,esi ; get u cdq idiv ecx ; eax = (u/z) shl eax,26 shld ebx,eax,6 ; ebx = v*64+u ; read 1 pixel movzx eax,byte ptr es:[ebx] ; get pixel from source bitmap ; LIGHTING CODE mov ebx, _fx_l ; get temp copy of lighting value mov ah, bh ; get lighting level add ebx, _fx_dl_dx ; update lighting value mov al, fs:[eax] ; xlat pixel thru lighting tables mov _fx_l, ebx ; save temp copy of lighting value mov [edi],al inc edi ; update deltas add ebp,_fx_dv_dx add esi,_fx_du_dx add ecx,_fx_dz_dx xchg esi, ebx dec _loop_count jns tmap_loop fix fixdiv(fix a,fix b); #pragma aux fixdiv parm [eax] [ebx] modify exact [eax edx] = \ "cdq " \ "idiv ebx" \ fix u = u0; fix v = v0; fix z = z0; fix l = l0; for ( x=x1; x<=x2; x++ ) { if ( z < zbuffer[x] ) { zbuffer[x] = z; color = bitmap[(u/z)&63][(v/z)&63]; if ( color != xparent ) { color = LightingTable[color][f2i(l)&31]; pixel[x] = color; } } u += du; v += dv; z += dz; l += dl; } ;================ PERSPECTIVE TEXTURE MAP INNER LOOPS ======================== ; ; Usage in loop: ; eax division, pixel value ; ebx source pixel pointer ; ecx z ; edx division ; ebp v ; esi u ; edi destination pixel pointer rept niters mov eax, [_fx_z] ; get z-value cmp zbuffer[edi], eax ; check if closer jge skip1 ; don't do if z farther away mov zbuffer[edi], eax ; update z-buffer mov eax,[_fx_v] ; get v cdq ; sign extend into edx:eax idiv [_fx_z] ; eax = (v/z) and eax,63 ; mask with height-1 mov ebx,eax ; start build bitmap address mov eax,[_fx_u] ; get u cdq ; sign extend into edx:eax idiv [_fx_z] ; eax = (u/z) shl eax,26 ; continue building bitmap address shld ebx,eax,6 ; ebx = v*64+u mov al,byte ptr es:[ebx] ; get pixel from source bitmap cmp al,255 ; check if it's transparent je skip1 ; don't write if transparent mov bx, [_fx_l] ; get lighting value mov bl, al ; build lighting table lookup index mov al, lighting[ebx] ; lookup lighting value mov video[edi],al ; write the pixel skip1: inc edi ; go to next pixel address add [_fx_l],[_fx_dl_dx] ; increment lighting add [_fx_u],[_fx_du_dx] ; increment u add [_fx_v],[_fx_dv_dx] ; incrememt v add [_fx_z],[_fx_dz_dx] ; increment z je _div_0_abort ; would be dividing by 0, so abort endm mov eax, F1_0 mov ebx, [z] mov edx,eax sar edx,16 shl eax,16 idiv ebx "imul edx" \ "shrd eax,edx,16"; // assume 8.12 fixed point rept niters mov eax, [_fx_z] ; get z-value cmp zbuffer[edi], eax ; check if closer jge skip1 ; don't do if z farther away mov zbuffer[edi], eax ; update z-buffer mov eax,[_fx_v] ; get v cdq idiv eax, [z] mov ebx,eax ; start build bitmap address mov eax,[_fx_u] ; get u imul eax, [z] shl eax,26 ; continue building bitmap address shld ebx,eax,6 ; ebx = v*64+u mov al,byte ptr es:[ebx] ; get pixel from source bitmap cmp al,255 ; check if it's transparent je skip1 ; don't write if transparent mov bx, [_fx_l] ; get lighting value mov bl, al ; build lighting table lookup index mov al, lighting[ebx] ; lookup lighting value mov video[edi],al ; write the pixel skip1: inc edi ; go to next pixel address add [_fx_l],[_fx_dl_dx] ; increment lighting add [_fx_u],[_fx_du_dx] ; increment u add [_fx_v],[_fx_dv_dx] ; incrememt v add [_fx_z],[_fx_dz_dx] ; increment z je _div_0_abort ; would be dividing by 0, so abort endm ;================ PERSPECTIVE TEXTURE MAP INNER LOOPS ======================== ; ; Usage in loop: ; eax division, pixel value ; ebx source pixel pointer ; ecx z ; edx division ; ebp v ; esi u ; edi destination pixel pointer rept niters cmp zbuffer[edi], ecx ; check if closer jge skip1 ; don't do if z farther away mov zbuffer[edi], ecx ; update z-buffer mov eax,[_fx_v] ; get v mov edx,[_fx_u] ; get u idiv ecx ; eax = (v/z) and eax,63 ; mask with height-1 mov ebx,eax ; start build bitmap address mov eax,[_fx_u] ; get u cdq ; sign extend into edx:eax idiv ecx ; eax = (u/z) shl eax,26 ; continue building bitmap address shld ebx,eax,6 ; ebx = v*64+u mov al,byte ptr es:[ebx] ; get pixel from source bitmap cmp al,255 ; check if it's transparent je skip1 ; don't write if transparent mov bx, [_fx_l] ; get lighting value mov bl, al ; build lighting table lookup index mov al, lighting[ebx] ; lookup lighting value mov video[edi],al ; write the pixel skip1: inc edi ; go to next pixel address add [_fx_l],[_fx_dl_dx] ; increment lighting add [_fx_u],[_fx_du_dx] ; increment u add [_fx_v],[_fx_dv_dx] ; incrememt v add ecx,[_fx_dz_dx] ; increment z je _div_0_abort ; would be dividing by 0, so abort endm 
libsrc/_DEVELOPMENT/target/zx/driver/terminal/zx_01_output_fzx/zx_01_output_fzx_iterm_msg_readline_end.asm
jpoikela/z88dk
640
96755
SECTION code_driver SECTION code_driver_terminal_output PUBLIC zx_01_output_fzx_iterm_msg_readline_end EXTERN console_01_output_fzx_iterm_msg_readline_end zx_01_output_fzx_iterm_msg_readline_end: ; input terminal has completed editing ; can use: af, bc, de, hl, ix ld a,(ix+37) ; a = pixel y coord (must be < 256) rra rra rra and $1f inc a ; a = char y coord rounded up ld (ix+20),a ; set new scroll limit jp console_01_output_fzx_iterm_msg_readline_end
programs/oeis/166/A166810.asm
neoneye/loda
22
240499
; A166810: Number of n X 6 1..2 arrays containing at least one of each value, all equal values connected, rows considered as a single number in nondecreasing order, and columns considered as a single number in nondecreasing order. ; 5,26,82,208,460,922,1714,3001,5003,8006,12374,18562,27130,38758,54262,74611,100945,134594,177098,230228,296008,376738,475018,593773,736279,906190,1107566,1344902,1623158,1947790,2324782,2760679,3262621,3838378,4496386,5245784,6096452,7059050,8145058,9366817,10737571,12271510,13983814,15890698,18009458,20358518,22957478,25827163,28989673,32468434,36288250,40475356,45057472,50063858,55525370,61474517,67945519,74974366,82598878,90858766,99795694,109453342,119877470,131115983,143218997,156238906,170230450,185250784,201359548,218618938,237093778,256851593,277962683,300500198,324540214,350161810,377447146,406481542,437353558,470155075,504981377,541931234,581106986,622614628,666563896,713068354,762245482,814216765,869107783,927048302,988172366,1052618390,1120529254,1192052398,1267339918,1346548663,1429840333,1517381578,1609344098,1705904744 add $0,7 bin $0,6 sub $0,2
programs/oeis/198/A198479.asm
neoneye/loda
22
241704
<reponame>neoneye/loda ; A198479: 10^n*n^10. ; 0,10,102400,59049000,10485760000,976562500000,60466176000000,2824752490000000,107374182400000000,3486784401000000000,100000000000000000000,2593742460100000000000,61917364224000000000000,1378584918490000000000000,28925465497600000000000000,576650390625000000000000000,10995116277760000000000000000,201599390044900000000000000000,3570467226624000000000000000000,61310662578010000000000000000000,1024000000000000000000000000000000,16679880978201000000000000000000000,265599227914240000000000000000000000 mov $2,10 pow $2,$0 pow $0,10 mul $0,$2
kernel/firmware/vbe.asm
ssebs/xos
15
27846
;; xOS32 ;; Copyright (C) 2016-2017 by <NAME>. use16 VBE_BUFFER_SIZE = 0x1000000 ; maximum buffer size is 16 MB VBE_PHYSICAL_BUFFER = 0xD0000000 VBE_BACK_BUFFER = VBE_PHYSICAL_BUFFER + VBE_BUFFER_SIZE ; default width/height when EDID is unavailable or unusable DEFAULT_WIDTH = 800 DEFAULT_HEIGHT = 600 align 32 vbe_width dw DEFAULT_WIDTH vbe_height dw DEFAULT_HEIGHT align 16 ; Not sure if this has to be aligned, but it doesn't hurt. vbe_info_block: .signature db "VBE2" ; tell BIOS we support VBE 2.0+ .version dw 0 .oem dd 0 .capabilities dd 0 .video_modes dd 0 .memory dw 0 .software_rev dw 0 .vendor dd 0 .product_name dd 0 .product_rev dd 0 .reserved: times 222 db 0 .oem_data: times 256 db 0 align 16 mode_info_block: .attributes dw 0 .window_a db 0 .window_b db 0 .granularity dw 0 .window_size dw 0 .segmentA dw 0 .segmentB dw 0 .win_func_ptr dd 0 .pitch dw 0 .width dw 0 .height dw 0 .w_char db 0 .y_char db 0 .planes db 0 .bpp db 0 .banks db 0 .memory_model db 0 .bank_size db 0 .image_pages db 0 .reserved0 db 0 .red dw 0 .green dw 0 .blue dw 0 .reserved_mask dw 0 .direct_color db 0 .framebuffer dd 0 .off_screen_mem dd 0 .off_screen_mem_size dw 0 .reserved1: times 206 db 0 align 16 vbe_edid: .padding: times 8 db 0 .manufacturer_id dw 0 .edid_code dw 0 .serial_number dd 0 .week_number db 0 .manufacturer_year db 0 .edid_version db 0 .edid_revision db 0 .video_input db 0 .width_cm db 0 .height_cm db 0 .gamma_factor db 0 .dpms_flags db 0 .chroma: times 10 db 0 .timings1 db 0 .timings2 db 0 .reserved_timing db 0 .standard_timings: times 8 dw 0 .timing_desc1: times 18 db 0 .timing_desc2: times 18 db 0 .timing_desc3: times 18 db 0 .timing_desc4: times 18 db 0 .reserved db 0 .checksum db 0 align 32 screen: .width dd 0 .height dd 0 .bpp dd 0 .bytes_per_pixel dd 0 .bytes_per_line dd 0 .screen_size dd 0 .screen_size_dqwords dd 0 ; in sets 8 DQWORDs, for SSE copying .framebuffer dd 0 .x dd 0 .y dd 0 .x_max dd 0 .y_max dd 0 ; do_vbe: ; Does the VBE initialization do_vbe: push es ; some VESA BIOSes destroy ES, or so I read mov dword[vbe_info_block], "VBE2" mov ax, 0x4F00 ; get VBE BIOS info mov di, vbe_info_block int 0x10 pop es cmp ax, 0x4F jne .no_vbe cmp dword[vbe_info_block], "VESA" jne .no_vbe cmp [vbe_info_block.version], 0x200 jl .old_vbe ; read the EDID and determine proper mode for this monitor push es mov ax, 0x4F15 mov bl, 1 mov cx, 0 mov dx, 0 mov di, vbe_edid int 0x10 pop es cmp ax, 0x4F ; function succeeded? jne .use_default ; determine the preferred mode ; the first timing descriptor should contain the preferred resolution ; if it doesn't contain a timing descriptor, ignore the edid and use the defaults cmp byte[vbe_edid.timing_desc1], 0x00 je .use_default movzx ax, byte[vbe_edid.timing_desc1+2] ; low byte of preferred width mov [vbe_width], ax movzx ax, byte[vbe_edid.timing_desc1+4] and ax, 0xF0 shl ax, 4 or [vbe_width], ax movzx ax, byte[vbe_edid.timing_desc1+5] ; low byte of preferred height mov [vbe_height], ax movzx ax, byte[vbe_edid.timing_desc1+7] and ax, 0xF0 shl ax, 4 or [vbe_height], ax ; ensure they are valid cmp [vbe_width], 0 je .use_default cmp [vbe_height], 0 je .use_default ; set the mode mov ax, [vbe_width] mov bx, [vbe_height] mov cl, 32 call vbe_set_mode jc .use_default ; if it failed, try to use the default ret .use_default: mov [vbe_width], DEFAULT_WIDTH mov [vbe_height], DEFAULT_HEIGHT .set_mode: mov ax, [vbe_width] mov bx, [vbe_height] mov cl, 32 call vbe_set_mode jc .bad_mode ; removed support for 24bpp modes... ret ;.try_24bpp: ; ; use 24bpp as a fallback ; mov ax, [vbe_width] ; mov bx, [vbe_height] ; mov cl, 24 ; call vbe_set_mode ; jc .bad_mode ; ; ret .no_vbe: mov si, .no_vbe_msg call print16 cli hlt .old_vbe: mov si, .old_vbe_msg call print16 cli hlt .bad_mode: mov si, .bad_mode_msg call print16 cli hlt .no_vbe_msg db "Boot error: VBE BIOS not found.",0 .old_vbe_msg db "Boot error: xOS requires VBE BIOS 2.0 or newer.",0 .bad_mode_msg db "Boot error: Failed to set a VBE mode.",0 ; vbe_set_mode: ; Sets a VBE mode ; In\ AX = Width ; In\ BX = Height ; In\ CL = Bpp ; Out\ FLAGS.CF = 0 on success, 1 on error vbe_set_mode: mov [.width], ax mov [.height], bx mov [.bpp], cl push es ; some VESA BIOSes destroy ES, or so I read mov dword[vbe_info_block], "VBE2" mov ax, 0x4F00 ; get VBE BIOS info mov di, vbe_info_block int 0x10 pop es cmp ax, 0x4F ; BIOS doesn't support VBE? jne .error mov ax, word[vbe_info_block.video_modes] mov [.offset], ax mov ax, word[vbe_info_block.video_modes+2] mov [.segment], ax mov ax, [.segment] mov fs, ax mov si, [.offset] .find_mode: mov dx, [fs:si] add si, 2 mov [.offset], si mov [.mode], dx mov ax, 0 mov fs, ax cmp [.mode], 0xFFFF ; end of list? je .error push es mov ax, 0x4F01 ; get VBE mode info mov cx, [.mode] mov di, mode_info_block int 0x10 pop es cmp ax, 0x4F jne .error mov ax, [.width] cmp ax, [mode_info_block.width] jne .next_mode mov ax, [.height] cmp ax, [mode_info_block.height] jne .next_mode mov al, [.bpp] cmp al, [mode_info_block.bpp] jne .next_mode ; does the mode support LFB and is it supported by hardware? test [mode_info_block.attributes], 0x81 jz .next_mode ; if we make it here, we've found the correct mode! ; set the mode! push es mov ax, 0x4F02 mov bx, [.mode] or bx, 0x4000 mov cx, 0 mov dx, 0 mov di, 0 int 0x10 pop es cmp ax, 0x4F jne .error ; save the mode information movzx eax, [.width] mov [screen.width], eax movzx eax, [.height] mov [screen.height], eax movzx eax, [.bpp] mov [screen.bpp], eax add eax, 7 shr eax, 3 mov [screen.bytes_per_pixel], eax movzx eax, [mode_info_block.pitch] mov [screen.bytes_per_line], eax mov eax, [mode_info_block.framebuffer] mov [screen.framebuffer], eax movzx eax, [.width] shr eax, 3 ; div 8 dec eax mov [screen.x_max], eax movzx eax, [.height] shr eax, 4 ; div 16 dec eax mov [screen.y_max], eax mov [screen.x], 0 mov [screen.y], 0 clc ret .next_mode: mov ax, [.segment] mov fs, ax mov si, [.offset] jmp .find_mode .error: mov ax, 0 mov fs, ax stc ret .width dw 0 .height dw 0 .bpp db 0 .segment dw 0 .offset dw 0 .mode dw 0
programs/oeis/109/A109622.asm
jmorken/loda
1
26227
; A109622: Number of different isotemporal classes of diasters with n peripheral edges. ; 1,1,4,7,15,23,38,53,77,101,136,171,219,267,330,393,473,553,652,751,871,991,1134,1277,1445,1613,1808,2003,2227,2451,2706,2961,3249,3537,3860,4183,4543,4903,5302,5701,6141,6581,7064,7547,8075,8603 mov $1,1 mov $2,$0 mov $6,1 lpb $2 add $3,$6 mov $5,$0 lpb $5 add $4,$3 sub $5,1 lpe sub $0,$6 sub $2,1 sub $4,1 mov $6,2 lpe add $1,$4
src/blueprint.ads
bracke/websitegenerator
1
5253
<gh_stars>1-10 with Ada.Directories; use Ada.Directories; package Blueprint is type Action is (Write, Delete, DryRun); function Get_Blueprint_Folder return String; procedure Process_File (Target : String; Search_Item : Directory_Entry_Type; Todo : Action); procedure Parse_Content (Source_File : String; Target : String); procedure Iterate (Blueprint_Folder : String; Path : String; Todo : Action); private end Blueprint;
library.applescript
tangledhelix/breaktime-workflow
2
830
-- Determine whether Do Not Disturb is enabled in Notification Center on dnd_is_enabled() tell application "System Events" tell application process "SystemUIServer" if exists menu bar item "Notification Center, Do Not Disturb enabled" of menu bar 2 then return true else return false end if end tell end tell end dnd_is_enabled -- Change state of Do Not Disturb on change_dnd(itemLabel) tell application "System Events" tell application process "SystemUIServer" try key down option click menu bar item itemLabel of menu bar 2 key up option on error key up option end try end tell end tell end change_dnd -- Turn Do Not Disturb off on disable_dnd() if dnd_is_enabled() then change_dnd("Notification Center, Do Not Disturb enabled") end if end disable_dnd -- Turn Do Not Disturb on on enable_dnd() if not dnd_is_enabled() then change_dnd("Notification Center") end if end enable_dnd -- Quit one or more apps on quit_apps(appList) repeat with i from 1 to the count of appList tell application (item i of appList) to quit end repeat end quit_apps -- Launch one or more apps on launch_apps(appList) repeat with i from 1 to the count of appList tell application (item i of appList) -- This will launch app if not open, and sometimes open main window activate -- This will open main window as if you clicked on dock icon. -- Some apps choose not to do this simply on "activate" reopen end tell end repeat end launch_apps -- Close all windows (but not quit) one or more apps on close_app_windows(appList) repeat with i from 1 to the count of appList tell application (item i of appList) to close every window end repeat end close_app_windows -- Close tabs in Google Chrome, if open on close_google_chrome_tabs(urlList) tell application "Google Chrome" repeat with thisWindow in windows repeat with thisTab in tabs of thisWindow repeat with thisUrl in urlList if URL of thisTab starts with thisUrl then tell thisTab to close end if end repeat end repeat end repeat end tell end close_google_chrome_tabs
libsrc/zx81/scrolldowntxt.asm
grancier/z180
0
22833
<reponame>grancier/z180<filename>libsrc/zx81/scrolldowntxt.asm ; ; ZX81 libraries - Stefano ; ;---------------------------------------------------------------- ; ; $Id: scrolldowntxt.asm,v 1.6 2016/06/26 20:32:08 dom Exp $ ; ;---------------------------------------------------------------- ; Text scrolldown. ;---------------------------------------------------------------- SECTION code_clib PUBLIC scrolldowntxt PUBLIC _scrolldowntxt EXTERN zx_topleft scrolldowntxt: _scrolldowntxt: IF FORlambda ld hl,16509 + (33*24) ELSE ld hl,(16396) ; D_FILE ld bc,33*24 add hl,bc ENDIF ld de,33 push hl add hl,de pop de ex de,hl lddr xor a ld b,32 blankline: inc hl ld (hl),a djnz blankline jp zx_topleft
06-ilinux-fat-fs/boot.asm
weimanzhou/ilinux
0
15435
; int 10h / ah = 0x13 document http://www.ablmcc.edu.hk/~scy/CIT/8086_bios_and_dos_interrupts.htm#int10h_13h ; define _BOOT_DEBUG_ %ifdef _BOOT_DEBUG_ org 0x0100 ; 调试状态,做成 .com 文件,可调试 %else org 0x7c00 ; Boot 状态,BIOS将把 bootector ; 加载到 0:7c00 处并开始执行 %endif jmp short LABEL_START nop BS_OEMName DB '---XX---' ; OEM string, 必须是 8 个字节 BPB_BytsPerSec DW 0x0200 ; 每扇区字节数 BPB_SecPerClus DB 0x01 ; 每簇多少个扇区 BPB_RsvdSecCnt DW 0x01 ; Boot 记录占用多少扇区 BPB_NumFATs DB 0x02 ; 共有多少 FAT 表 BPB_RootEntCnt DW 0xe0 ; 根目录文件最大数 BPB_TotSec16 DW 0x0b40 ; 逻辑扇区总数 BPB_Media DB 0xF0 ; 媒体描述符 BPB_FATSz16 DW 0x09 ; 每FAT扇区数 BPB_SecPerTrk DW 0x12 ; 每磁道扇区数 BPB_NumHeads DW 0x02 ; 磁头数(面数) BPB_HiddSec DD 0 ; 隐藏扇区数 BPB_TotSec32 DD 0 ; 如果 wTotalSectorCount 是 0 由这个值记录扇区数 BS_DrvNum DB 0 ; 中断13的驱动器号 BS_Reserved1 DB 0 ; 未使用 BS_BootSig DB 0x29 ; 扩展引导标记(29h) BS_VolID DD 0 ; 卷序列号 BS_VolLab DB 'snowflake01'; 卷标,必须11个字节 BS_FileSysType DB 'FAT12' ; 文件系统类型,必须8个字节'''''' stack_base equ 0x7c00 LABEL_START: mov ax, cs mov ds, ax mov ss, ax mov sp, stack_base ; 进行磁盘复位 xor ah, ah xor dl, dl int 13h ; 下面在A盘的根目录寻找loader.bin mov word [W_SECTOR_NO], SECTOR_NO_OF_ROOT_DIRECTORY LABEL_SEARCH_IN_ROOT_DIR_BEGIN: cmp word [W_ROOT_DIR_SIZE_FOR_LOOP], 0 ; 判断根目录区是否已经读完, jz LABEL_NO_LOADERBIN ; 如果读完表示没有找到loader.bin dec word [W_ROOT_DIR_SIZE_FOR_LOOP] mov ax, BASE_OF_LOADER mov es, ax mov bx, OFFSET_OF_LOADER mov ax, [W_SECTOR_NO] mov cl, 1 call read_sector mov si, LOADER_FILE_NAME mov di, OFFSET_OF_LOADER cld mov dx, 10h LABEL_SEARCH_FOR_LOADERBIN: cmp dx, 0 jz LABEL_GOTO_NEXT_SECTOR_IN_ROOT_DIR dec dx mov cx, 11 LABEL_CMP_FILENAME: cmp cx, 0 jz LABEL_FILENAME_FOUND dec cx lodsb cmp al, byte [es:di] jz LABEL_GO_ON jmp LABEL_DIFFERENT LABEL_GO_ON: inc di jmp LABEL_CMP_FILENAME LABEL_DIFFERENT: and di, 0xFFE0 add di, 0x20 mov si, LOADER_FILE_NAME jmp LABEL_SEARCH_FOR_LOADERBIN LABEL_GOTO_NEXT_SECTOR_IN_ROOT_DIR: add word [W_SECTOR_NO], 1 jmp LABEL_SEARCH_IN_ROOT_DIR_BEGIN LABEL_NO_LOADERBIN: mov dh, 2 call disp_str %ifdef _BOOT_DEBUG_ mov ax, 0x4c00 int 21h %else jmp $ %endif LABEL_FILENAME_FOUNT: jmp $ ; 进行清屏操作 mov ax, 0x0600 mov bx, 0x0700 mov cx, 0 mov dx, 0x0184f int 0x10 mov cx, 0x09 push cs pop es mov bp, boot_message call print_string jmp $ ; 跳转到当前地址,实现循环 read_sector: ; 从第 ax 个sector开始,将el个sector读入es:bx中 push bp mov bp, sp sub esp, 2 ; 劈出2字节的堆栈区域保存要读的扇区数 ; byte [bp-2] mov byte [bp-2], el push bx ; 保存bx mov bl, [BPB_SEC_PER_TRK] ; b1: 除数 div bl ; y在al中,z在ah中 inc ah ; z++ mov cl, ah ; cl <- 起始扇区号 mov dh, al ; dh <- y shr al, 1 ; y >> 1 (其实是y/BPB_NUM_HEADS),这里 ; BPB_NUM_HEADS=2 mov ch, al ; ch <- 柱面号 and dh, 1 ; dh & 1 = 磁头号 pop bx ; 恢复bx ; 至此,*柱面号,起始扇区,磁头号*全部得到 mov dl, [BS_DRV_NUM] ; 驱动器号(0表示A盘) .GO_ON_READING: mov ah, 2 ; 读 mov al, byte [bp-2] ; 读al个扇区 int 13h jc .GO_ON_READING: ; 如果读取错误,CF会被置1,这时不停的读,直到 ; 正确为止 add esp, 2 pop bp ret DISP_STR: mov ax, MESSAGE_LENGTH mul dh add ax, BOOT_MESSAGE mov bp, ax mov ax, ds mov cx, MESSAGE_LENGTH mov ax, 0x1301 mov bx, 0x0007 mov dl, 0 int 10h ret boot_message: dd "Booting......", 0 ; 定义一个字符串为 dd 类型,并且后要添加一个 0,表示字符串的结束 boot_message_len: ; boot_message_len - boot_message 刚好为字符串的大小 BASE_OF_LOADER equ 0x9000 OFFSET_OF_LOADER equ 0x0100 ROOT_DIR_SECTORS equ 14 ; 变量 SECTOR_NO_OF_ROOT_DIRECTORY equ 19 W_ROOE_DIR_SIZE_FOR_LOOP dw RootDirSectors W_SECTOR_NO dw 0 B_ODD db 0 ; 字符串 LOADER_FILE_NAME db "LOADER BIN", 0 ; loader.bin 文件名 ; 为简化代码,下面每个字符串的长度均为MESSAGE_LENGTH MOESSAGE_LENGTH equ 9 BOOT_MESSAGE db "Booting " MESSAGE1 db "Ready. " MESSAGE2 db "NO LOADER" ; ============================================================================ ; time n m ; n: 重复多少次 ; m: 重复的代码 ; ; ; $ : 当前地址 ; $$ : 代表上一个代码的地址减去起始地址 ; ============================================================================ times 510-($-$$) db 0 ; 填充 0 dw 0xaa55 ; 可引导扇区标志,必须是 0xaa55,不然bios无法识别
cards/bn5/ModCards/136-B033 ProtoMan.asm
RockmanEXEZone/MMBN-Mod-Card-Kit
10
81638
.include "defaults_mod.asm" table_file_jp equ "exe5-utf8.tbl" table_file_en equ "bn5-utf8.tbl" game_code_len equ 3 game_code equ 0x4252424A // BRBJ game_code_2 equ 0x42524245 // BRBE game_code_3 equ 0x42524250 // BRBP card_type equ 1 card_id equ 83 card_no equ "083" card_sub equ "Mod Card 083" card_sub_x equ 64 card_desc_len equ 2 card_desc_1 equ "ProtoMan" card_desc_2 equ "45MB" card_desc_3 equ "" card_name_jp_full equ "ブルース" card_name_jp_game equ "ブルース" card_name_en_full equ "ProtoMan" card_name_en_game equ "ProtoMan" card_address equ "" card_address_id equ 0 card_bug equ 0 card_wrote_en equ "" card_wrote_jp equ ""
oeis/152/A152494.asm
neoneye/loda-programs
11
245017
<reponame>neoneye/loda-programs ; A152494: 1/3 of the number of permutations of 2 indistinguishable copies of 1..n with exactly 2 local maxima. ; Submitted by <NAME> ; 0,1,19,235,2539,26119,263863,2648107,26513875,265250287,2652876847,26530008499,265304159371,2653054879735,26530591844071,265306057146811,2653061016284227,26530611583384063,265306120353746335,2653061217872021443,26530612224048411643,265306122383442276871,2653061224284217956439,26530612244254327246795,265306122446968001872819,2653061224483519066015759,26530612244878402379239183,265306122448918742681293267,2653061224489606834674606955,26530612244897372323916002327,265306122448977772431424551367 mov $3,10 lpb $0 mul $1,3 mov $2,$0 sub $0,1 add $2,$0 mul $2,$3 add $1,$2 mul $3,10 lpe mov $0,$1 div $0,10
fix/fix.asm
arbruijn/d1dos
2
168075
;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX ;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO ;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A ;ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS ;IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS ;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE ;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE ;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS ;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. ;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. ; ; $Source: f:/miner/source/fix/rcs/fix.asm $ ; $Revision: 1.16 $ ; $Author: mike $ ; $Date: 1994/11/30 00:59:40 $ ; ; Fixed-point rotines ; ; $Log: fix.asm $ ; Revision 1.16 1994/11/30 00:59:40 mike ; optimizations. ; ; Revision 1.15 1994/11/16 18:05:01 matt ; Added error checking to atan2 ; ; Revision 1.14 1994/10/21 12:14:26 matt ; For acos & asin, saturate at 1 instead of generate error ; ; Revision 1.13 1994/05/18 17:15:56 matt ; Allow sin & cos ptrs in C sincos func to be null ; ; Revision 1.12 1994/02/10 21:23:08 matt ; Changed 'if DEBUG_ON' to 'ifndef NDEBUG' ; ; Revision 1.11 1994/01/19 23:11:26 matt ; Made fix_atan2() left-handed, like our coordinate system ; ; Revision 1.10 1993/10/26 18:51:49 matt ; Fixed register trash in fix_atan2() ; ; Revision 1.9 1993/10/20 01:09:01 matt ; Add fix_asin(), improved fix_atan2() ; ; Revision 1.8 1993/10/19 23:53:48 matt ; Added fix_atan2() ; ; Revision 1.7 1993/10/19 22:22:34 matt ; Added fix_acos() ; ; Revision 1.6 1993/09/10 19:13:44 matt ; Fixed problem with quad_sqrt() when edx==0 and high bit of eax set ; ; Revision 1.5 1993/08/24 13:00:17 matt ; Adopted new standard, and made assembly-callable routines not trash any regs ; ; Revision 1.4 1993/08/12 14:43:34 matt ; Added rcsid ; ; Revision 1.3 1993/08/06 15:59:49 matt ; Added check for high bit of low longword set in quad_sqrt ; Changed long_sqrt to do longword moves and save the override ; ; Revision 1.2 1993/08/04 19:56:03 matt ; Fixed mistake in quad_sqrt first quess code ; ; Revision 1.1 1993/08/03 17:45:26 matt ; Initial revision ; ; ; .386 option oldstructs .nolist include types.inc include psmacros.inc include fix.inc .list assume cs:_TEXT,ds:_DATA _DATA segment dword public USE32 'DATA' rcsid db "$Id: fix.asm 1.16 1994/11/30 00:59:40 mike Exp $" sin_table dw 0 dw 402 dw 804 dw 1205 dw 1606 dw 2006 dw 2404 dw 2801 dw 3196 dw 3590 dw 3981 dw 4370 dw 4756 dw 5139 dw 5520 dw 5897 dw 6270 dw 6639 dw 7005 dw 7366 dw 7723 dw 8076 dw 8423 dw 8765 dw 9102 dw 9434 dw 9760 dw 10080 dw 10394 dw 10702 dw 11003 dw 11297 dw 11585 dw 11866 dw 12140 dw 12406 dw 12665 dw 12916 dw 13160 dw 13395 dw 13623 dw 13842 dw 14053 dw 14256 dw 14449 dw 14635 dw 14811 dw 14978 dw 15137 dw 15286 dw 15426 dw 15557 dw 15679 dw 15791 dw 15893 dw 15986 dw 16069 dw 16143 dw 16207 dw 16261 dw 16305 dw 16340 dw 16364 dw 16379 cos_table dw 16384 dw 16379 dw 16364 dw 16340 dw 16305 dw 16261 dw 16207 dw 16143 dw 16069 dw 15986 dw 15893 dw 15791 dw 15679 dw 15557 dw 15426 dw 15286 dw 15137 dw 14978 dw 14811 dw 14635 dw 14449 dw 14256 dw 14053 dw 13842 dw 13623 dw 13395 dw 13160 dw 12916 dw 12665 dw 12406 dw 12140 dw 11866 dw 11585 dw 11297 dw 11003 dw 10702 dw 10394 dw 10080 dw 9760 dw 9434 dw 9102 dw 8765 dw 8423 dw 8076 dw 7723 dw 7366 dw 7005 dw 6639 dw 6270 dw 5897 dw 5520 dw 5139 dw 4756 dw 4370 dw 3981 dw 3590 dw 3196 dw 2801 dw 2404 dw 2006 dw 1606 dw 1205 dw 804 dw 402 dw 0 dw -402 dw -804 dw -1205 dw -1606 dw -2006 dw -2404 dw -2801 dw -3196 dw -3590 dw -3981 dw -4370 dw -4756 dw -5139 dw -5520 dw -5897 dw -6270 dw -6639 dw -7005 dw -7366 dw -7723 dw -8076 dw -8423 dw -8765 dw -9102 dw -9434 dw -9760 dw -10080 dw -10394 dw -10702 dw -11003 dw -11297 dw -11585 dw -11866 dw -12140 dw -12406 dw -12665 dw -12916 dw -13160 dw -13395 dw -13623 dw -13842 dw -14053 dw -14256 dw -14449 dw -14635 dw -14811 dw -14978 dw -15137 dw -15286 dw -15426 dw -15557 dw -15679 dw -15791 dw -15893 dw -15986 dw -16069 dw -16143 dw -16207 dw -16261 dw -16305 dw -16340 dw -16364 dw -16379 dw -16384 dw -16379 dw -16364 dw -16340 dw -16305 dw -16261 dw -16207 dw -16143 dw -16069 dw -15986 dw -15893 dw -15791 dw -15679 dw -15557 dw -15426 dw -15286 dw -15137 dw -14978 dw -14811 dw -14635 dw -14449 dw -14256 dw -14053 dw -13842 dw -13623 dw -13395 dw -13160 dw -12916 dw -12665 dw -12406 dw -12140 dw -11866 dw -11585 dw -11297 dw -11003 dw -10702 dw -10394 dw -10080 dw -9760 dw -9434 dw -9102 dw -8765 dw -8423 dw -8076 dw -7723 dw -7366 dw -7005 dw -6639 dw -6270 dw -5897 dw -5520 dw -5139 dw -4756 dw -4370 dw -3981 dw -3590 dw -3196 dw -2801 dw -2404 dw -2006 dw -1606 dw -1205 dw -804 dw -402 dw 0 dw 402 dw 804 dw 1205 dw 1606 dw 2006 dw 2404 dw 2801 dw 3196 dw 3590 dw 3981 dw 4370 dw 4756 dw 5139 dw 5520 dw 5897 dw 6270 dw 6639 dw 7005 dw 7366 dw 7723 dw 8076 dw 8423 dw 8765 dw 9102 dw 9434 dw 9760 dw 10080 dw 10394 dw 10702 dw 11003 dw 11297 dw 11585 dw 11866 dw 12140 dw 12406 dw 12665 dw 12916 dw 13160 dw 13395 dw 13623 dw 13842 dw 14053 dw 14256 dw 14449 dw 14635 dw 14811 dw 14978 dw 15137 dw 15286 dw 15426 dw 15557 dw 15679 dw 15791 dw 15893 dw 15986 dw 16069 dw 16143 dw 16207 dw 16261 dw 16305 dw 16340 dw 16364 dw 16379 dw 16384 asin_table dw 0 dw 41 dw 81 dw 122 dw 163 dw 204 dw 244 dw 285 dw 326 dw 367 dw 408 dw 448 dw 489 dw 530 dw 571 dw 612 dw 652 dw 693 dw 734 dw 775 dw 816 dw 857 dw 897 dw 938 dw 979 dw 1020 dw 1061 dw 1102 dw 1143 dw 1184 dw 1225 dw 1266 dw 1307 dw 1348 dw 1389 dw 1431 dw 1472 dw 1513 dw 1554 dw 1595 dw 1636 dw 1678 dw 1719 dw 1760 dw 1802 dw 1843 dw 1884 dw 1926 dw 1967 dw 2009 dw 2050 dw 2092 dw 2134 dw 2175 dw 2217 dw 2259 dw 2300 dw 2342 dw 2384 dw 2426 dw 2468 dw 2510 dw 2551 dw 2593 dw 2636 dw 2678 dw 2720 dw 2762 dw 2804 dw 2847 dw 2889 dw 2931 dw 2974 dw 3016 dw 3059 dw 3101 dw 3144 dw 3187 dw 3229 dw 3272 dw 3315 dw 3358 dw 3401 dw 3444 dw 3487 dw 3530 dw 3573 dw 3617 dw 3660 dw 3704 dw 3747 dw 3791 dw 3834 dw 3878 dw 3922 dw 3965 dw 4009 dw 4053 dw 4097 dw 4142 dw 4186 dw 4230 dw 4275 dw 4319 dw 4364 dw 4408 dw 4453 dw 4498 dw 4543 dw 4588 dw 4633 dw 4678 dw 4723 dw 4768 dw 4814 dw 4859 dw 4905 dw 4951 dw 4997 dw 5043 dw 5089 dw 5135 dw 5181 dw 5228 dw 5274 dw 5321 dw 5367 dw 5414 dw 5461 dw 5508 dw 5556 dw 5603 dw 5651 dw 5698 dw 5746 dw 5794 dw 5842 dw 5890 dw 5938 dw 5987 dw 6035 dw 6084 dw 6133 dw 6182 dw 6231 dw 6281 dw 6330 dw 6380 dw 6430 dw 6480 dw 6530 dw 6580 dw 6631 dw 6681 dw 6732 dw 6783 dw 6835 dw 6886 dw 6938 dw 6990 dw 7042 dw 7094 dw 7147 dw 7199 dw 7252 dw 7306 dw 7359 dw 7413 dw 7466 dw 7521 dw 7575 dw 7630 dw 7684 dw 7740 dw 7795 dw 7851 dw 7907 dw 7963 dw 8019 dw 8076 dw 8133 dw 8191 dw 8249 dw 8307 dw 8365 dw 8424 dw 8483 dw 8543 dw 8602 dw 8663 dw 8723 dw 8784 dw 8846 dw 8907 dw 8970 dw 9032 dw 9095 dw 9159 dw 9223 dw 9288 dw 9353 dw 9418 dw 9484 dw 9551 dw 9618 dw 9686 dw 9754 dw 9823 dw 9892 dw 9963 dw 10034 dw 10105 dw 10177 dw 10251 dw 10324 dw 10399 dw 10475 dw 10551 dw 10628 dw 10706 dw 10785 dw 10866 dw 10947 dw 11029 dw 11113 dw 11198 dw 11284 dw 11371 dw 11460 dw 11550 dw 11642 dw 11736 dw 11831 dw 11929 dw 12028 dw 12130 dw 12234 dw 12340 dw 12449 dw 12561 dw 12677 dw 12796 dw 12919 dw 13046 dw 13178 dw 13315 dw 13459 dw 13610 dw 13770 dw 13939 dw 14121 dw 14319 dw 14538 dw 14786 dw 15079 dw 15462 dw 16384 dw 16384 ;extra for when exacty 1 acos_table dw 16384 dw 16343 dw 16303 dw 16262 dw 16221 dw 16180 dw 16140 dw 16099 dw 16058 dw 16017 dw 15976 dw 15936 dw 15895 dw 15854 dw 15813 dw 15772 dw 15732 dw 15691 dw 15650 dw 15609 dw 15568 dw 15527 dw 15487 dw 15446 dw 15405 dw 15364 dw 15323 dw 15282 dw 15241 dw 15200 dw 15159 dw 15118 dw 15077 dw 15036 dw 14995 dw 14953 dw 14912 dw 14871 dw 14830 dw 14789 dw 14748 dw 14706 dw 14665 dw 14624 dw 14582 dw 14541 dw 14500 dw 14458 dw 14417 dw 14375 dw 14334 dw 14292 dw 14250 dw 14209 dw 14167 dw 14125 dw 14084 dw 14042 dw 14000 dw 13958 dw 13916 dw 13874 dw 13833 dw 13791 dw 13748 dw 13706 dw 13664 dw 13622 dw 13580 dw 13537 dw 13495 dw 13453 dw 13410 dw 13368 dw 13325 dw 13283 dw 13240 dw 13197 dw 13155 dw 13112 dw 13069 dw 13026 dw 12983 dw 12940 dw 12897 dw 12854 dw 12811 dw 12767 dw 12724 dw 12680 dw 12637 dw 12593 dw 12550 dw 12506 dw 12462 dw 12419 dw 12375 dw 12331 dw 12287 dw 12242 dw 12198 dw 12154 dw 12109 dw 12065 dw 12020 dw 11976 dw 11931 dw 11886 dw 11841 dw 11796 dw 11751 dw 11706 dw 11661 dw 11616 dw 11570 dw 11525 dw 11479 dw 11433 dw 11387 dw 11341 dw 11295 dw 11249 dw 11203 dw 11156 dw 11110 dw 11063 dw 11017 dw 10970 dw 10923 dw 10876 dw 10828 dw 10781 dw 10733 dw 10686 dw 10638 dw 10590 dw 10542 dw 10494 dw 10446 dw 10397 dw 10349 dw 10300 dw 10251 dw 10202 dw 10153 dw 10103 dw 10054 dw 10004 dw 9954 dw 9904 dw 9854 dw 9804 dw 9753 dw 9703 dw 9652 dw 9601 dw 9549 dw 9498 dw 9446 dw 9394 dw 9342 dw 9290 dw 9237 dw 9185 dw 9132 dw 9078 dw 9025 dw 8971 dw 8918 dw 8863 dw 8809 dw 8754 dw 8700 dw 8644 dw 8589 dw 8533 dw 8477 dw 8421 dw 8365 dw 8308 dw 8251 dw 8193 dw 8135 dw 8077 dw 8019 dw 7960 dw 7901 dw 7841 dw 7782 dw 7721 dw 7661 dw 7600 dw 7538 dw 7477 dw 7414 dw 7352 dw 7289 dw 7225 dw 7161 dw 7096 dw 7031 dw 6966 dw 6900 dw 6833 dw 6766 dw 6698 dw 6630 dw 6561 dw 6492 dw 6421 dw 6350 dw 6279 dw 6207 dw 6133 dw 6060 dw 5985 dw 5909 dw 5833 dw 5756 dw 5678 dw 5599 dw 5518 dw 5437 dw 5355 dw 5271 dw 5186 dw 5100 dw 5013 dw 4924 dw 4834 dw 4742 dw 4648 dw 4553 dw 4455 dw 4356 dw 4254 dw 4150 dw 4044 dw 3935 dw 3823 dw 3707 dw 3588 dw 3465 dw 3338 dw 3206 dw 3069 dw 2925 dw 2774 dw 2614 dw 2445 dw 2263 dw 2065 dw 1846 dw 1598 dw 1305 dw 922 dw 0 dw 0 ;extra for when exacty 1 ;values for first guess in square root routines. Note that the first entry ;is useful in quad_sqrt when edx=0 and high bit of eax is set. guess_table db 1 dup (1) ;0 db 3 dup (1) ;1..3 db 5 dup (2) ;4..8 db 7 dup (3) ;9..15 db 9 dup (4) ;16..24 db 11 dup (5) ;25..35 db 13 dup (6) ;36..48 db 15 dup (7) ;49..63 db 17 dup (8) ;64..80 db 19 dup (9) ;81..99 db 21 dup (10) ;100..120 db 23 dup (11) ;121..143 db 25 dup (12) ;144..168 db 27 dup (13) ;169..195 db 29 dup (14) ;196..224 db 31 dup (15) ;225..255 _DATA ends _TEXT segment para public USE32 'CODE' ;the sincos functions have two varients: the C version is passed pointer ;to variables for sin & cos, and the assembly version returns the values ;in two registers ;takes ax=angle, returns eax=sin, ebx=cos. fix_fastsincos: movzx eax,ah ;get high byte movsx ebx,cos_table[eax*2] sal ebx,2 ;make a fix movsx eax,sin_table[eax*2] sal eax,2 ;make a fix ret ;takes ax=angle, returns eax=sin, ebx=cos. fix_sincos: pushm ecx,edx xor edx, edx xor ecx, ecx mov dl, ah ;get high byte mov cl, al ;save low byte shl edx, 1 movsx eax,sin_table[edx] movsx ebx,sin_table+2[edx] sub ebx,eax imul ebx,ecx ;mul by fraction sar ebx,8 add eax,ebx ;add in frac part sal eax,2 ;make a fix movsx ebx,cos_table[edx] movsx edx,cos_table+2[edx] sub edx,ebx imul edx,ecx ;mul by fraction sar edx,8 add ebx,edx ;add in frac part sal ebx,2 ;make a fix popm ecx,edx ret align 16 ;takes eax=cos angle, returns ax=angle fix_acos: pushm ebx,ecx,edx abs_eax ;get abs value push edx ;save sign cmp eax,10000h jle no_acos_oflow mov eax,10000h no_acos_oflow: movzx ecx,al ;save low byte (fraction) mov edx,eax sar edx,8 ;get high byte (+1 bit) movsx eax,acos_table[edx*2] movsx ebx,acos_table+2[edx*2] sub ebx,eax imul ebx,ecx ;mul by fraction sar ebx,8 add eax,ebx ;add in frac part pop edx ;get sign back xor eax,edx sub eax,edx ;make correct sign and edx,8000h ;zero or 1/2 add eax,edx popm ebx,ecx,edx ret ;takes eax=sin angle, returns ax=angle fix_asin: pushm ebx,ecx,edx abs_eax ;get abs value push edx ;save sign cmp eax,10000h jle no_asin_oflow mov eax,10000h no_asin_oflow: movzx ecx,al ;save low byte (fraction) mov edx,eax sar edx,8 ;get high byte (+1 bit) movsx eax,asin_table[edx*2] movsx ebx,asin_table+2[edx*2] sub ebx,eax imul ebx,ecx ;mul by fraction sar ebx,8 add eax,ebx ;add in frac part pop edx ;get sign back xor eax,edx ;make sign correct sub eax,edx popm ebx,ecx,edx ret ;given cos & sin of an angle, return that angle. takes eax=cos,ebx=sin. ;returns ax. parms need not be normalized, that is, the ratio eax/ebx must ;equal the ratio cos/sin, but the parms need not be the actual cos & sin. ;NOTE: this is different from the standard C atan2, since it is left-handed. ;trashes ebx ;uses either asin or acos, to get better precision fix_atan2: pushm ecx,edx ifndef NDEBUG mov edx,eax or edx,ebx break_if z,'Both parms to atan2 are zero!' endif push ebx push eax ;find smaller of two pushm eax,ebx ;save abs_eax xchg eax,ebx abs_eax cmp ebx,eax ;compare x to y popm eax,ebx jl use_cos ;sin is smaller, use arcsin imul eax xchg eax,ebx mov ecx,edx imul eax add eax,ebx adc edx,ecx call quad_sqrt mov ecx,eax ;ecx = mag pop ebx ;get cos, save in ebx pop eax ;get sin jecxz sign_ok ;abort! fixdiv ecx ;normalize it call fix_asin ;get angle or ebx,ebx ;check sign of cos jns sign_ok sub eax,8000h ;adjust neg eax sign_ok: popm ecx,edx ret ;cos is smaller, use arccos use_cos: imul eax xchg eax,ebx mov ecx,edx imul eax add eax,ebx adc edx,ecx call quad_sqrt mov ecx,eax pop eax ;get cos fixdiv ecx ;normalize it call fix_acos ;get angle mov ebx,eax ;save in ebx pop eax ;get sin cdq ;get sign of sin mov eax,ebx ;get cos back xor eax,edx sub eax,edx ;make sign correct popm ecx,edx ret public fix_fastsincos_,fix_sincos_ ;C version - takes ax=angle, esi,edi=*sin,*cos. fills in sin&cos. ;either (or both) pointers can be null ;trashes eax,ebx fix_fastsincos_: call fix_fastsincos or esi,esi jz no_sin mov [esi],eax no_sin: or edi,edi jz no_cos mov [edi],ebx no_cos: ret ;C version - takes ax=angle, esi,edi=*sin,*cos. fills in sin&cos. ;trashes eax,ebx ;either (or both) pointers can be null fix_sincos_: call fix_sincos or esi,esi jz no_sin mov [esi],eax or edi,edi jz no_cos mov [edi],ebx ret ;standard Newtonian-iteration square root routine. takes eax, returns ax ;trashes eax,ebx,ecx,edx,esi,edi long_sqrt: or eax,eax ;check sign jle error ;zero or negative pushm ebx,ecx,edx,esi,edi mov edx,eax shr edx,16 ;split eax -> dx:ax ;get a good first quess by checking which byte most significant bit is in xor ebx,ebx ;clear high bytes for index or dh,dh ;highest byte jz not_dh mov bl,dh ;get value for lookup mov cl,12 jmp got_guess not_dh: or dl,dl jz not_dl mov bl,dl ;get value for lookup mov cl,8 jmp got_guess not_dl: or ah,ah jz not_ah mov bl,ah ;get value for lookup mov cl,4 jmp got_guess not_ah: mov bl,al ;get value for lookup mov cl,0 got_guess: movzx ebx,guess_table[ebx] ;get byte guess sal ebx,cl ;get in right place mov ecx,eax mov esi,edx ;save dx:ax ;the loop nearly always executes 3 times, so we'll unroll it 2 times and ;not do any checking until after the third time. By my calcutations, the ;loop is executed 2 times in 99.97% of cases, 3 times in 93.65% of cases, ;four times in 16.18% of cases, and five times in 0.44% of cases. It never ;executes more than five times. By timing, I determined that is is faster ;to always execute three times and not check for termination the first two ;times through. This means that in 93.65% of cases, we save 6 cmp/jcc pairs, ;and in 6.35% of cases we do an extra divide. In real life, these numbers ;might not be the same. ;newt_loop: rept 2 mov eax,ecx mov edx,esi ;restore dx:ax div bx ;dx:ax / bx mov edi,ebx ;save for compare add bx,ax rcr bx,1 ;next guess = (d + q)/2 endm newt_loop: mov ax,cx mov dx,si ;restore dx:ax div bx ;dx:ax / bx cmp ax,bx ;correct? je got_it ;..yep mov di,bx ;save for compare add bx,ax rcr bx,1 ;next guess = (d + q)/2 cmp bx,ax je almost_got_it cmp bx,di jne newt_loop almost_got_it: mov ax,bx or dx,dx ;check remainder jz got_it inc ax got_it: popm ebx,ecx,edx,esi,edi ret ;sqrt called with zero or negative input. return zero error: xor eax,eax ret ;call the longword square root for quad with high longword equal zero call_long: call long_sqrt movzx eax,ax ;return longword result ret ;standard Newtonian-iteration square root routine. takes edx:eax, returns eax quad_sqrt: or edx,edx ;check sign js error ;can't do negative number! jnz must_do_quad ;we really must do 64/32 div or eax,eax ;check high bit of low longword jns call_long ;we can use longword version must_do_quad: pushm ebx,ecx,edx,esi,edi ;get a good first quess by checking which byte most significant bit is in xor ebx,ebx ;clear high bytes for index ror edx,16 ;get high 2 bytes or dh,dh jz q_not_dh mov bl,dh ;get value for lookup mov cl,12+16 ror edx,16 ;restore edx jmp q_got_guess q_not_dh: or dl,dl jz q_not_dl mov bl,dl ;get value for lookup mov cl,8+16 ror edx,16 ;restore edx jmp q_got_guess q_not_dl: ror edx,16 ;restore edx or dh,dh jz q_not_ah mov bl,dh ;get value for lookup mov cl,4+16 jmp q_got_guess q_not_ah: mov bl,dl ;get value for lookup mov cl,0+16 q_got_guess: movzx ebx,guess_table[ebx] ;get byte guess sal ebx,cl ;get in right place q_really_got_guess: mov ecx,eax mov esi,edx ;save edx:eax ;quad loop usually executes 4 times ;q_newt_loop: rept 3 mov eax,ecx mov edx,esi ;restore dx:ax div ebx ;dx:ax / bx mov edi,ebx ;save for compare add ebx,eax rcr ebx,1 ;next guess = (d + q)/2 endm q_newt_loop: mov eax,ecx mov edx,esi ;restore dx:ax div ebx ;dx:ax / bx cmp eax,ebx ;correct? je q_got_it ;..yep mov edi,ebx ;save for compare add ebx,eax rcr ebx,1 ;next guess = (d + q)/2 cmp ebx,eax je q_almost_got_it cmp ebx,edi jne q_newt_loop q_almost_got_it: mov eax,ebx or edx,edx ;check remainder jz q_got_it inc eax q_got_it: popm ebx,ecx,edx,esi,edi ret ;fixed-point square root fix_sqrt: call long_sqrt movzx eax,ax sal eax,8 ret _TEXT ends end
Testcases/rand.asm
5ayam5/COL216-A4
0
163590
<reponame>5ayam5/COL216-A4 lw $t0, 1004($zero) lw $t0, 2000($zero) sw $t2, 1100($zero) lw $t2, 1104($zero) lw $t0, 1100($zero)
rts/gcc-9/adainclude/a-except.adb
letsbyteit/build-avr-ada-toolchain
7
13720
<reponame>letsbyteit/build-avr-ada-toolchain ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- A D A . E X C E P T I O N S -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- -- Copyright (C) 2012, <NAME> -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package body Ada.Exceptions is procedure Reset; pragma Import (Ada, Reset); for Reset'Address use 0; pragma No_Return (Reset); procedure Default_Handler (Msg : System.Address; Line : Integer); pragma Export (C, Default_Handler, "__gnat_last_chance_handler"); pragma Weak_External (Default_Handler); pragma No_Return (Default_Handler); procedure Default_Handler (Msg : System.Address; Line : Integer) is pragma Unreferenced (Msg); pragma Unreferenced (Line); begin Reset; end Default_Handler; procedure Last_Chance_Handler (Msg : System.Address; Line : Integer); pragma Import (C, Last_Chance_Handler, "__gnat_last_chance_handler"); pragma No_Return (Last_Chance_Handler); procedure Raise_Exception (E : Exception_Id; Message : String := "") is pragma Unreferenced (E); begin Last_Chance_Handler (Message'Address, 0); end Raise_Exception; end Ada.Exceptions;
Lists/Definition.agda
Smaug123/agdaproofs
4
7778
<reponame>Smaug123/agdaproofs {-# OPTIONS --safe --warning=error --without-K #-} module Lists.Definition where data List {a : _} (A : Set a) : Set a where [] : List A _::_ : (x : A) (xs : List A) → List A infixr 10 _::_ {-# BUILTIN LIST List #-} [_] : {a : _} {A : Set a} → (a : A) → List A [ a ] = a :: [] _++_ : {a : _} {A : Set a} → List A → List A → List A [] ++ m = m (x :: l) ++ m = x :: (l ++ m)
oeis/255/A255817.asm
neoneye/loda-programs
11
15049
<filename>oeis/255/A255817.asm ; A255817: Parity of A000788, which is the total number of ones in 0..n in binary. ; Submitted by <NAME>(s2) ; 0,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,0,0,0,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1,0,0,0,1,0,0,1,1,1,0,0,1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,0,1,0,0 mov $2,$0 add $0,1 seq $2,10060 ; Thue-Morse sequence: let A_k denote the first 2^k terms; then A_0 = 0 and for k >= 0, A_{k+1} = A_k B_k, where B_k is obtained from A_k by interchanging 0's and 1's. add $0,$2 mul $0,2 div $0,4 mod $0,2
data/hidden_objects.asm
adhi-thirumala/EvoYellow
16
163819
<reponame>adhi-thirumala/EvoYellow HiddenObjectMaps: dbw SILPH_CO_11F, SilphCo11FHiddenObjects dbw SILPH_CO_5F, SilphCo5FHiddenObjects dbw SILPH_CO_9F, SilphCo9FHiddenObjects dbw MANSION_2, Mansion2HiddenObjects dbw MANSION_3, Mansion3HiddenObjects dbw MANSION_4, Mansion4HiddenObjects dbw SAFARI_ZONE_WEST, SafariZoneWestHiddenObjects dbw UNKNOWN_DUNGEON_2, UnknownDungeon2HiddenObjects dbw UNKNOWN_DUNGEON_3, UnknownDungeon3HiddenObjects dbw UNUSED_MAP_6F, UnusedMap6FHiddenObjects dbw SEAFOAM_ISLANDS_3, SeafoamIslands3HiddenObjects dbw SEAFOAM_ISLANDS_4, SeafoamIslands4HiddenObjects dbw SEAFOAM_ISLANDS_5, SeafoamIslands5HiddenObjects dbw VIRIDIAN_FOREST, ViridianForestHiddenObjects dbw MT_MOON_3, MtMoon3HiddenObjects dbw SS_ANNE_10, SSAnne10HiddenObjects dbw SS_ANNE_6, SSAnne6HiddenObjects dbw UNDERGROUND_PATH_NS, UndergroundPathNsHiddenObjects dbw UNDERGROUND_PATH_WE, UndergroundPathWeHiddenObjects dbw ROCKET_HIDEOUT_1, RocketHideout1HiddenObjects dbw ROCKET_HIDEOUT_3, RocketHideout3HiddenObjects dbw ROCKET_HIDEOUT_4, RocketHideout4HiddenObjects dbw ROUTE_10, Route10HiddenObjects dbw ROCK_TUNNEL_POKECENTER, RockTunnelPokecenterHiddenObjects dbw POWER_PLANT, PowerPlantHiddenObjects dbw ROUTE_11, Route11HiddenObjects dbw ROUTE_12, Route12HiddenObjects dbw ROUTE_13, Route13HiddenObjects dbw ROUTE_15_GATE_2F, Route15Gate2FHiddenObjects dbw ROUTE_17, Route17HiddenObjects dbw ROUTE_23, Route23HiddenObjects dbw VICTORY_ROAD_2, VictoryRoad2HiddenObjects dbw ROUTE_25, Route25HiddenObjects dbw BILLS_HOUSE, BillsHouseHiddenObjects dbw ROUTE_4, Route4HiddenObjects dbw MT_MOON_POKECENTER, MtMoonPokecenterHiddenObjects dbw ROUTE_9, Route9HiddenObjects dbw TRADE_CENTER, TradeCenterHiddenObjects dbw COLOSSEUM, ColosseumHiddenObjects dbw INDIGO_PLATEAU, IndigoPlateauHiddenObjects dbw INDIGO_PLATEAU_LOBBY, IndigoPlateauLobbyHiddenObjects dbw COPYCATS_HOUSE_2F, CopycatsHouse2FHiddenObjects dbw FIGHTING_DOJO, FightingDojoHiddenObjects dbw SAFFRON_GYM, SaffronGymHiddenObjects dbw SAFFRON_POKECENTER, SaffronPokecenterHiddenObjects dbw REDS_HOUSE_2F, RedsHouse2FHiddenObjects dbw BLUES_HOUSE, BluesHouseHiddenObjects dbw OAKS_LAB, OaksLabHiddenObjects dbw VIRIDIAN_CITY, ViridianCityHiddenObjects dbw VIRIDIAN_POKECENTER, ViridianPokecenterHiddenObjects dbw VIRIDIAN_SCHOOL, ViridianSchoolHiddenObjects dbw VIRIDIAN_GYM, ViridianGymHiddenObjects dbw MUSEUM_1F, Museum1FHiddenObjects dbw PEWTER_GYM, PewterGymHiddenObjects dbw PEWTER_POKECENTER, PewterPokecenterHiddenObjects dbw CERULEAN_CITY, CeruleanCityHiddenObjects dbw CERULEAN_POKECENTER, CeruleanPokecenterHiddenObjects dbw CERULEAN_GYM, CeruleanGymHiddenObjects dbw BIKE_SHOP, BikeShopHiddenObjects dbw UNKNOWN_DUNGEON_1, UnknownDungeon1HiddenObjects dbw LAVENDER_POKECENTER, LavenderPokecenterHiddenObjects dbw POKEMONTOWER_5, Pokemontower5HiddenObjects dbw LAVENDER_HOUSE_1, LavenderHouse1HiddenObjects dbw VERMILION_CITY, VermilionCityHiddenObjects dbw VERMILION_POKECENTER, VermilionPokecenterHiddenObjects dbw POKEMON_FAN_CLUB, PokemonFanClubHiddenObjects dbw VERMILION_GYM, VermilionGymHiddenObjects dbw CELADON_CITY, CeladonCityHiddenObjects dbw CELADON_HOTEL, CeladonHotelHiddenObjects dbw CELADON_MANSION_2, CeladonMansion2HiddenObjects dbw CELADON_MANSION_5, CeladonMansion5HiddenObjects dbw CELADON_POKECENTER, CeladonPokecenterHiddenObjects dbw CELADON_GYM, CeladonGymHiddenObjects dbw GAME_CORNER, GameCornerHiddenObjects dbw FUCHSIA_POKECENTER, FuchsiaPokecenterHiddenObjects dbw SAFARI_ZONE_ENTRANCE, SafariZoneEntranceHiddenObjects dbw FUCHSIA_GYM, FuchsiaGymHiddenObjects dbw MANSION_1, Mansion1HiddenObjects dbw CINNABAR_GYM, CinnabarGymHiddenObjects dbw CINNABAR_LAB_4, CinnabarLab4HiddenObjects dbw CINNABAR_POKECENTER, CinnabarPokecenterHiddenObjects db $ff ; format: y-coord, x-coord, text id/item id, object routine hidden_object: macro db \1, \2, \3 dba \4 endm SilphCo11FHiddenObjects: hidden_object 12, 10, SPRITE_FACING_UP, OpenPokemonCenterPC db $ff SilphCo5FHiddenObjects: hidden_object 3, 12, ELIXER, HiddenItems db $ff SilphCo9FHiddenObjects: hidden_object 15, 2, MAX_POTION, HiddenItems db $ff Mansion2HiddenObjects: hidden_object 11, 2, SPRITE_FACING_UP, Mansion2Script_Switches db $ff Mansion3HiddenObjects: hidden_object 9, 1, MAX_REVIVE, HiddenItems hidden_object 5, 10, SPRITE_FACING_UP, Mansion3Script_Switches db $ff Mansion4HiddenObjects: hidden_object 9, 1, RARE_CANDY, HiddenItems hidden_object 3, 20, SPRITE_FACING_UP, Mansion4Script_Switches hidden_object 25, 18, SPRITE_FACING_UP, Mansion4Script_Switches db $ff SafariZoneWestHiddenObjects: hidden_object 5, 6, REVIVE, HiddenItems db $ff UnknownDungeon2HiddenObjects: hidden_object 13, 16, PP_UP, HiddenItems db $ff UnknownDungeon3HiddenObjects: hidden_object 14, 8, PP_UP, HiddenItems db $ff UnusedMap6FHiddenObjects: hidden_object 11, 14, MAX_ELIXER, HiddenItems db $ff SeafoamIslands3HiddenObjects: hidden_object 15, 15, NUGGET, HiddenItems db $ff SeafoamIslands4HiddenObjects: hidden_object 16, 9, MAX_ELIXER, HiddenItems db $ff SeafoamIslands5HiddenObjects: hidden_object 17, 25, ULTRA_BALL, HiddenItems db $ff ViridianForestHiddenObjects: hidden_object 18, 1, POTION, HiddenItems hidden_object 42, 16, ANTIDOTE, HiddenItems db $ff MtMoon3HiddenObjects: hidden_object 12, 18, MOON_STONE, HiddenItems hidden_object 9, 33, ETHER, HiddenItems db $ff SSAnne10HiddenObjects: hidden_object 1, 3, HYPER_POTION, HiddenItems db $ff SSAnne6HiddenObjects: hidden_object 5, 13, SPRITE_FACING_DOWN, PrintTrashText hidden_object 7, 13, SPRITE_FACING_DOWN, PrintTrashText hidden_object 9, 13, GREAT_BALL, HiddenItems db $ff UndergroundPathNsHiddenObjects: hidden_object 4, 3, FULL_RESTORE, HiddenItems hidden_object 34, 4, X_SPECIAL, HiddenItems db $ff UndergroundPathWeHiddenObjects: hidden_object 2, 12, NUGGET, HiddenItems hidden_object 5, 21, ELIXER, HiddenItems db $ff RocketHideout1HiddenObjects: hidden_object 15, 21, PP_UP, HiddenItems db $ff RocketHideout3HiddenObjects: hidden_object 17, 27, NUGGET, HiddenItems db $ff RocketHideout4HiddenObjects: hidden_object 1, 25, SUPER_POTION, HiddenItems db $ff Route10HiddenObjects: hidden_object 17, 9, SUPER_POTION, HiddenItems hidden_object 53, 16, MAX_ETHER, HiddenItems db $ff RockTunnelPokecenterHiddenObjects: hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC db $ff PowerPlantHiddenObjects: hidden_object 16, 17, MAX_ELIXER, HiddenItems hidden_object 1, 12, PP_UP, HiddenItems db $ff Route11HiddenObjects: hidden_object 5, 48, ESCAPE_ROPE, HiddenItems db $ff Route12HiddenObjects: hidden_object 63, 2, HYPER_POTION, HiddenItems db $ff Route13HiddenObjects: hidden_object 14, 1, PP_UP, HiddenItems hidden_object 13, 16, CALCIUM, HiddenItems db $ff Route15Gate2FHiddenObjects: hidden_object 2, 1, SPRITE_FACING_UP, Route15GateLeftBinoculars db $ff Route17HiddenObjects: hidden_object 14, 15, RARE_CANDY, HiddenItems hidden_object 45, 8, FULL_RESTORE, HiddenItems hidden_object 72, 17, PP_UP, HiddenItems hidden_object 91, 4, MAX_REVIVE, HiddenItems hidden_object 121, 8, MAX_ELIXER, HiddenItems db $ff Route23HiddenObjects: hidden_object 44, 9, FULL_RESTORE, HiddenItems hidden_object 70, 19, ULTRA_BALL, HiddenItems hidden_object 90, 8, MAX_ETHER, HiddenItems db $ff VictoryRoad2HiddenObjects: hidden_object 2, 5, ULTRA_BALL, HiddenItems hidden_object 7, 26, FULL_RESTORE, HiddenItems db $ff Route25HiddenObjects: hidden_object 3, 38, ETHER, HiddenItems hidden_object 1, 10, ELIXER, HiddenItems db $ff BillsHouseHiddenObjects: hidden_object 4, 1, SPRITE_FACING_UP, BillsHousePC db $ff Route4HiddenObjects: hidden_object 3, 40, GREAT_BALL, HiddenItems db $ff MtMoonPokecenterHiddenObjects: hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC db $ff Route9HiddenObjects: hidden_object 7, 14, ETHER, HiddenItems db $ff TradeCenterHiddenObjects: hidden_object 4, 5, $d0, CableClubRightGameboy hidden_object 4, 4, $d0, CableClubLeftGameboy db $ff ColosseumHiddenObjects: hidden_object 4, 5, $d0, CableClubRightGameboy hidden_object 4, 4, $d0, CableClubLeftGameboy db $ff IndigoPlateauHiddenObjects: hidden_object 13, 8, $ff, PrintIndigoPlateauHQText hidden_object 13, 11, SPRITE_FACING_DOWN, PrintIndigoPlateauHQText db $ff IndigoPlateauLobbyHiddenObjects: hidden_object 7, 15, SPRITE_FACING_UP, OpenPokemonCenterPC db $ff CopycatsHouse2FHiddenObjects: hidden_object 1, 1, NUGGET, HiddenItems db $ff FightingDojoHiddenObjects: hidden_object 9, 3, SPRITE_FACING_UP, PrintFightingDojoText hidden_object 9, 6, SPRITE_FACING_UP, PrintFightingDojoText hidden_object 0, 4, SPRITE_FACING_UP, PrintFightingDojoText2 hidden_object 0, 5, SPRITE_FACING_UP, PrintFightingDojoText3 db $ff SaffronGymHiddenObjects: hidden_object 15, 9, SPRITE_FACING_UP, GymStatues db $ff SaffronPokecenterHiddenObjects: hidden_object 4, 0, SPRITE_FACING_UP, PrintBenchGuyText hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC db $ff RedsHouse2FHiddenObjects: hidden_object 1, 0, SPRITE_FACING_UP, OpenRedsPC hidden_object 5, 3, $d0, PrintRedSNESText db $ff BluesHouseHiddenObjects: hidden_object 1, 0, SPRITE_FACING_UP, PrintBookcaseText hidden_object 1, 1, SPRITE_FACING_UP, PrintBookcaseText hidden_object 1, 7, SPRITE_FACING_UP, PrintBookcaseText db $ff OaksLabHiddenObjects: hidden_object 0, 4, SPRITE_FACING_UP, DisplayOakLabLeftPoster hidden_object 0, 5, SPRITE_FACING_UP, DisplayOakLabRightPoster hidden_object 1, 0, SPRITE_FACING_UP, DisplayOakLabEmailText hidden_object 1, 1, SPRITE_FACING_UP, DisplayOakLabEmailText db $ff ViridianCityHiddenObjects: hidden_object 4, 14, POTION, HiddenItems db $ff ViridianPokecenterHiddenObjects: hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC db $ff ViridianSchoolHiddenObjects: hidden_object 4, 3, (ViridianSchoolNotebook_id - TextPredefs) / 2 + 1, PrintNotebookText hidden_object 0, 3, (ViridianSchoolBlackboard_id - TextPredefs) / 2 + 1, PrintBlackboardLinkCableText db $ff ViridianGymHiddenObjects: hidden_object 15, 15, SPRITE_FACING_UP, GymStatues hidden_object 15, 18, SPRITE_FACING_UP, GymStatues db $ff Museum1FHiddenObjects: hidden_object 3, 2, SPRITE_FACING_UP, AerodactylFossil hidden_object 6, 2, SPRITE_FACING_UP, KabutopsFossil db $ff PewterGymHiddenObjects: hidden_object 10, 3, SPRITE_FACING_UP, GymStatues hidden_object 10, 6, SPRITE_FACING_UP, GymStatues db $ff PewterPokecenterHiddenObjects: hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC db $ff CeruleanCityHiddenObjects: hidden_object 8, 15, RARE_CANDY, HiddenItems db $ff CeruleanPokecenterHiddenObjects: hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC db $ff CeruleanGymHiddenObjects: hidden_object 11, 3, SPRITE_FACING_UP, GymStatues hidden_object 11, 6, SPRITE_FACING_UP, GymStatues db $ff BikeShopHiddenObjects: hidden_object 0, 1, $d0, PrintNewBikeText hidden_object 1, 2, $d0, PrintNewBikeText hidden_object 2, 1, $d0, PrintNewBikeText hidden_object 2, 3, $d0, PrintNewBikeText hidden_object 4, 0, $d0, PrintNewBikeText hidden_object 5, 1, $d0, PrintNewBikeText db $ff UnknownDungeon1HiddenObjects: hidden_object 7, 18, PP_UP, HiddenItems db $ff LavenderPokecenterHiddenObjects: hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC db $ff Pokemontower5HiddenObjects: hidden_object 12, 4, ELIXER, HiddenItems db $ff LavenderHouse1HiddenObjects: hidden_object 1, 0, SPRITE_FACING_DOWN, PrintMagazinesText hidden_object 1, 1, SPRITE_FACING_DOWN, PrintMagazinesText hidden_object 1, 7, SPRITE_FACING_DOWN, PrintMagazinesText db $ff VermilionCityHiddenObjects: hidden_object 11, 14, MAX_ETHER, HiddenItems db $ff VermilionPokecenterHiddenObjects: hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC hidden_object 4, 0, SPRITE_FACING_UP, PrintBenchGuyText db $ff PokemonFanClubHiddenObjects: hidden_object 0, 1, SPRITE_FACING_UP, FanClubPicture1 hidden_object 0, 6, SPRITE_FACING_UP, FanClubPicture2 db $ff VermilionGymHiddenObjects: hidden_object 14, 3, SPRITE_FACING_UP, GymStatues hidden_object 14, 6, SPRITE_FACING_UP, GymStatues hidden_object 1, 6, SPRITE_FACING_DOWN, PrintTrashText hidden_object 7, 1, 0, GymTrashScript hidden_object 9, 1, 1, GymTrashScript hidden_object 11, 1, 2, GymTrashScript hidden_object 7, 3, 3, GymTrashScript hidden_object 9, 3, 4, GymTrashScript hidden_object 11, 3, 5, GymTrashScript hidden_object 7, 5, 6, GymTrashScript hidden_object 9, 5, 7, GymTrashScript hidden_object 11, 5, 8, GymTrashScript hidden_object 7, 7, 9, GymTrashScript hidden_object 9, 7, 10, GymTrashScript hidden_object 11, 7, 11, GymTrashScript hidden_object 7, 9, 12, GymTrashScript hidden_object 9, 9, 13, GymTrashScript hidden_object 11, 9, 14, GymTrashScript db $ff CeladonCityHiddenObjects: hidden_object 15, 48, PP_UP, HiddenItems db $ff CeladonHotelHiddenObjects: hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText db $ff CeladonMansion2HiddenObjects: hidden_object 5, 0, SPRITE_FACING_UP, OpenPokemonCenterPC db $ff CeladonMansion5HiddenObjects: hidden_object 0, 3, (LinkCableHelp_id - TextPredefs) / 2 + 1, PrintBlackboardLinkCableText hidden_object 0, 4, (LinkCableHelp_id - TextPredefs) / 2 + 1, PrintBlackboardLinkCableText hidden_object 4, 3, (TMNotebook_id - TextPredefs) / 2 + 1, PrintNotebookText db $ff CeladonPokecenterHiddenObjects: hidden_object 4, 0, SPRITE_FACING_LEFT, PrintBenchGuyText hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC db $ff CeladonGymHiddenObjects: hidden_object 15, 3, SPRITE_FACING_UP, GymStatues hidden_object 15, 6, SPRITE_FACING_UP, GymStatues db $ff GameCornerHiddenObjects: hidden_object 15, 18, $d0, StartSlotMachine hidden_object 14, 18, $d0, StartSlotMachine hidden_object 13, 18, $d0, StartSlotMachine hidden_object 12, 18, $d0, StartSlotMachine hidden_object 11, 18, $d0, StartSlotMachine hidden_object 10, 18, $ff, StartSlotMachine ; "Someone's Keys" hidden_object 10, 13, $d0, StartSlotMachine hidden_object 11, 13, $d0, StartSlotMachine hidden_object 12, 13, $fe, StartSlotMachine ; "Out To Lunch" hidden_object 13, 13, $d0, StartSlotMachine hidden_object 14, 13, $d0, StartSlotMachine hidden_object 15, 13, $d0, StartSlotMachine hidden_object 15, 12, $d0, StartSlotMachine hidden_object 14, 12, $d0, StartSlotMachine hidden_object 13, 12, $d0, StartSlotMachine hidden_object 12, 12, $d0, StartSlotMachine hidden_object 11, 12, $d0, StartSlotMachine hidden_object 10, 12, $d0, StartSlotMachine hidden_object 10, 7, $d0, StartSlotMachine hidden_object 11, 7, $d0, StartSlotMachine hidden_object 12, 7, $d0, StartSlotMachine hidden_object 13, 7, $d0, StartSlotMachine hidden_object 14, 7, $d0, StartSlotMachine hidden_object 15, 7, $d0, StartSlotMachine hidden_object 15, 6, $d0, StartSlotMachine hidden_object 14, 6, $d0, StartSlotMachine hidden_object 13, 6, $d0, StartSlotMachine hidden_object 12, 6, $fd, StartSlotMachine ; "Out Of Order" hidden_object 11, 6, $d0, StartSlotMachine hidden_object 10, 6, $d0, StartSlotMachine hidden_object 10, 1, $d0, StartSlotMachine hidden_object 11, 1, $d0, StartSlotMachine hidden_object 12, 1, $d0, StartSlotMachine hidden_object 13, 1, $d0, StartSlotMachine hidden_object 14, 1, $d0, StartSlotMachine hidden_object 15, 1, $d0, StartSlotMachine hidden_object 8, 0, COIN + 10, HiddenCoins hidden_object 16, 1, COIN + 10, HiddenCoins hidden_object 11, 3, COIN + 20, HiddenCoins hidden_object 14, 3, COIN + 10, HiddenCoins hidden_object 12, 4, COIN + 10, HiddenCoins hidden_object 12, 9, COIN + 20, HiddenCoins hidden_object 15, 9, COIN + 10, HiddenCoins hidden_object 14, 16, COIN + 10, HiddenCoins hidden_object 16, 10, COIN + 10, HiddenCoins hidden_object 7, 11, COIN + 40, HiddenCoins hidden_object 8, 15, COIN + 100, HiddenCoins hidden_object 15, 12, COIN + 10, HiddenCoins db $ff FuchsiaPokecenterHiddenObjects: hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC hidden_object 4, 0, SPRITE_FACING_UP, PrintBenchGuyText db $ff SafariZoneEntranceHiddenObjects: hidden_object 1, 10, NUGGET, HiddenItems db $ff FuchsiaGymHiddenObjects: hidden_object 15, 3, SPRITE_FACING_UP, GymStatues hidden_object 15, 6, SPRITE_FACING_UP, GymStatues db $ff Mansion1HiddenObjects: hidden_object 16, 8, MOON_STONE, HiddenItems hidden_object 5, 2, SPRITE_FACING_UP, Mansion1Script_Switches db $ff CinnabarGymHiddenObjects: hidden_object 13, 17, SPRITE_FACING_UP, GymStatues hidden_object 7, 15, (0 << 4) | 1, PrintCinnabarQuiz hidden_object 1, 10, (1 << 4) | 2, PrintCinnabarQuiz hidden_object 7, 9, (1 << 4) | 3, PrintCinnabarQuiz hidden_object 13, 9, (1 << 4) | 4, PrintCinnabarQuiz hidden_object 13, 1, (0 << 4) | 5, PrintCinnabarQuiz hidden_object 7, 1, (1 << 4) | 6, PrintCinnabarQuiz db $ff CinnabarLab4HiddenObjects: hidden_object 4, 0, SPRITE_FACING_UP, OpenPokemonCenterPC hidden_object 4, 2, SPRITE_FACING_UP, OpenPokemonCenterPC db $ff CinnabarPokecenterHiddenObjects: hidden_object 4, 0, SPRITE_FACING_UP, PrintBenchGuyText hidden_object 3, 13, SPRITE_FACING_UP, OpenPokemonCenterPC db $ff
orka/src/orka/implementation/orka-smart_pointers.adb
onox/orka
52
1569
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2018 onox <<EMAIL>> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. with Ada.Unchecked_Deallocation; package body Orka.Smart_Pointers is procedure Free is new Ada.Unchecked_Deallocation (Data_Record, Data_Record_Access); function Is_Null (Object : Abstract_Pointer) return Boolean is (Object.Data = null); function References (Object : Abstract_Pointer) return Natural is (Object.Data.References.Count); procedure Set (Object : in out Abstract_Pointer; Value : not null Object_Access) is begin if Object.Data /= null then -- Decrement old reference count Finalize (Object); end if; Object.Data := new Data_Record'(Object => Value, References => <>); end Set; function Get (Object : Mutable_Pointer) return Reference is begin return Reference'(Value => Object.Data.Object, Hold => Object); end Get; function Get (Object : Pointer) return Constant_Reference is begin return Constant_Reference'(Value => Object.Data.Object, Hold => Object); end Get; overriding procedure Adjust (Object : in out Abstract_Pointer) is begin if Object.Data /= null then Object.Data.References.Increment; end if; end Adjust; overriding procedure Finalize (Object : in out Abstract_Pointer) is Zero : Boolean; begin if Object.Data /= null then Object.Data.References.Decrement (Zero); if Zero then Free_Object (Object.Data.Object); Free (Object.Data); end if; end if; -- Idempotence: next call to Finalize has no effect Object.Data := null; end Finalize; end Orka.Smart_Pointers;
ada/original_2008/ada-gui/agar-gui-widget-tlist.ads
auzkok/libagar
286
2768
with agar.core.event; with agar.core.event_types; with agar.core.tail_queue; with agar.core.timeout; with agar.core.types; with agar.gui.surface; with agar.gui.widget.label; with agar.gui.widget.menu; with agar.gui.widget.scrollbar; with agar.gui.window; package agar.gui.widget.tlist is use type c.unsigned; type popup_t is limited private; type popup_access_t is access all popup_t; pragma convention (c, popup_access_t); type item_t is limited private; type item_access_t is access all item_t; pragma convention (c, item_access_t); type tlist_t is limited private; type tlist_access_t is access all tlist_t; pragma convention (c, tlist_access_t); package popup_tail_queue is new agar.core.tail_queue (entry_type => popup_access_t); package item_tail_queue is new agar.core.tail_queue (entry_type => item_access_t); package tlist_tail_queue is new agar.core.tail_queue (entry_type => tlist_access_t); type flags_t is new c.unsigned; TLIST_MULTI : constant flags_t := 16#001#; TLIST_MULTITOGGLE : constant flags_t := 16#002#; TLIST_POLL : constant flags_t := 16#004#; TLIST_TREE : constant flags_t := 16#010#; TLIST_HFILL : constant flags_t := 16#020#; TLIST_VFILL : constant flags_t := 16#040#; TLIST_NOSELSTATE : constant flags_t := 16#100#; TLIST_EXPAND : constant flags_t := TLIST_HFILL or TLIST_VFILL; -- API function allocate (parent : widget_access_t; flags : flags_t) return tlist_access_t; pragma import (c, allocate, "AG_TlistNew"); function allocate_polled (parent : widget_access_t; flags : flags_t; callback : agar.core.event.callback_t) return tlist_access_t; pragma import (c, allocate_polled, "AG_TlistNewPolled"); procedure set_item_height (tlist : tlist_access_t; height : natural); pragma inline (set_item_height); procedure set_icon (tlist : tlist_access_t; item : item_access_t; icon : agar.gui.surface.surface_access_t); pragma import (c, set_icon, "AG_TlistSetIcon"); procedure size_hint (tlist : tlist_access_t; text : string; num_items : natural); pragma inline (size_hint); procedure size_hint_pixels (tlist : tlist_access_t; width : natural; num_items : natural); pragma inline (size_hint_pixels); procedure size_hint_largest (tlist : tlist_access_t; num_items : natural); pragma inline (size_hint_largest); procedure set_double_click_callback (tlist : tlist_access_t; callback : agar.core.event.callback_t); pragma inline (set_double_click_callback); procedure set_changed_callback (tlist : tlist_access_t; callback : agar.core.event.callback_t); pragma inline (set_changed_callback); -- manipulating items procedure delete (tlist : tlist_access_t; item : item_access_t); pragma import (c, delete, "AG_TlistDel"); procedure list_begin (tlist : tlist_access_t); pragma import (c, list_begin, "AG_TlistClear"); procedure list_end (tlist : tlist_access_t); pragma import (c, list_end, "AG_TlistRestore"); procedure list_select (tlist : tlist_access_t; item : item_access_t); pragma import (c, list_select, "AG_TlistSelect"); procedure list_select_all (tlist : tlist_access_t); pragma import (c, list_select_all, "AG_TlistSelectAll"); procedure list_deselect (tlist : tlist_access_t; item : item_access_t); pragma import (c, list_deselect, "AG_TlistDeselect"); procedure list_deselect_all (tlist : tlist_access_t); pragma import (c, list_deselect_all, "AG_TlistDeselectAll"); function list_select_pointer (tlist : tlist_access_t; pointer : agar.core.types.void_ptr_t) return item_access_t; pragma import (c, list_select_pointer, "AG_TlistSelectPtr"); function list_select_text (tlist : tlist_access_t; text : string) return item_access_t; pragma inline (list_select_text); function list_find_by_index (tlist : tlist_access_t; index : integer) return item_access_t; pragma inline (list_find_by_index); function list_selected_item (tlist : tlist_access_t) return item_access_t; pragma import (c, list_selected_item, "AG_TlistSelectedItem"); function list_selected_item_pointer (tlist : tlist_access_t) return agar.core.types.void_ptr_t; pragma import (c, list_selected_item_pointer, "AG_TlistSelectedItemPtr"); function list_first (tlist : tlist_access_t) return item_access_t; pragma import (c, list_first, "AG_TlistFirstItem"); function list_last (tlist : tlist_access_t) return item_access_t; pragma import (c, list_last, "AG_TlistLastItem"); -- popup menus function set_popup_callback (tlist : tlist_access_t; callback : agar.core.event.callback_t) return agar.gui.widget.menu.item_access_t; pragma inline (set_popup_callback); function set_popup (tlist : tlist_access_t; category : string) return agar.gui.widget.menu.item_access_t; pragma inline (set_popup); -- function widget (tlist : tlist_access_t) return widget_access_t; pragma inline (widget); private type popup_t is record class : cs.chars_ptr; menu : agar.gui.widget.menu.menu_access_t; item : agar.gui.widget.menu.item_access_t; panel : agar.gui.window.window_access_t; popups : popup_tail_queue.entry_t; end record; pragma convention (c, popup_t); type item_label_t is array (1 .. agar.gui.widget.label.max) of aliased c.char; pragma convention (c, item_label_t); type item_argv_t is array (1 .. 8) of aliased agar.core.event_types.arg_t; pragma convention (c, item_argv_t); type item_t is record selected : c.int; icon_source : agar.gui.surface.surface_access_t; icon : c.int; ptr : agar.core.types.void_ptr_t; category : cs.chars_ptr; text : item_label_t; label : c.int; argv : item_argv_t; argc : c.int; depth : agar.core.types.uint8_t; flags : agar.core.types.uint8_t; items : item_tail_queue.entry_t; selitems : item_tail_queue.entry_t; end record; pragma convention (c, item_t); type tlist_t is record widget : aliased widget_t; flags : flags_t; selected : agar.core.types.void_ptr_t; hint_width : c.int; hint_height : c.int; space : c.int; item_height : c.int; icon_width : c.int; double_clicked : agar.core.types.void_ptr_t; items : item_tail_queue.head_t; selitems : item_tail_queue.head_t; num_items : c.int; visible_items : c.int; sbar : agar.gui.widget.scrollbar.scrollbar_access_t; popups : item_tail_queue.head_t; compare_func : access function (a, b : item_access_t) return c.int; popup_ev : access agar.core.event.event_t; changed_ev : access agar.core.event.event_t; double_click_ev : access agar.core.event.event_t; inc_to : agar.core.timeout.timeout_t; dec_to : agar.core.timeout.timeout_t; wheel_ticks : agar.core.types.uint32_t; row_width : c.int; r : agar.gui.rect.rect_t; end record; pragma convention (c, tlist_t); end agar.gui.widget.tlist;
Stm8Invaders/asm/spritedata.asm
peteri/Invaders
0
100188
<reponame>peteri/Invaders<gh_stars>0 stm8/ ;============================================= ; Generated file from the WPF invaders ; Contains pre-shifted sprites. ;============================================= segment 'rom' .alien_moving_y_data.w dc.b 16 ; width dc.w %0000000000000000 ;image 0 shift 0 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %1001100000000000 dc.w %0101110000000000 dc.w %1011011000000000 dc.w %0101111100000000 dc.w %0101111100000000 dc.w %1011011000000000 dc.w %0101110000000000 dc.w %1001100000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 1 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0100110000000000 dc.w %0010111000000000 dc.w %0101101100000000 dc.w %0010111110000000 dc.w %0010111110000000 dc.w %0101101100000000 dc.w %0010111000000000 dc.w %0100110000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 2 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0010011000000000 dc.w %0001011100000000 dc.w %0010110110000000 dc.w %0001011111000000 dc.w %0001011111000000 dc.w %0010110110000000 dc.w %0001011100000000 dc.w %0010011000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 3 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0001001100000000 dc.w %0000101110000000 dc.w %0001011011000000 dc.w %0000101111100000 dc.w %0000101111100000 dc.w %0001011011000000 dc.w %0000101110000000 dc.w %0001001100000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 4 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000100110000000 dc.w %0000010111000000 dc.w %0000101101100000 dc.w %0000010111110000 dc.w %0000010111110000 dc.w %0000101101100000 dc.w %0000010111000000 dc.w %0000100110000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 5 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000010011000000 dc.w %0000001011100000 dc.w %0000010110110000 dc.w %0000001011111000 dc.w %0000001011111000 dc.w %0000010110110000 dc.w %0000001011100000 dc.w %0000010011000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 6 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000001001100000 dc.w %0000000101110000 dc.w %0000001011011000 dc.w %0000000101111100 dc.w %0000000101111100 dc.w %0000001011011000 dc.w %0000000101110000 dc.w %0000001001100000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 7 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000100110000 dc.w %0000000010111000 dc.w %0000000101101100 dc.w %0000000010111110 dc.w %0000000010111110 dc.w %0000000101101100 dc.w %0000000010111000 dc.w %0000000100110000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 1 shift 0 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0101100000000000 dc.w %1011110000000000 dc.w %0001011000000000 dc.w %0011111100000000 dc.w %0011111100000000 dc.w %0001011000000000 dc.w %1011110000000000 dc.w %0101100000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 1 shift 1 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0010110000000000 dc.w %0101111000000000 dc.w %0000101100000000 dc.w %0001111110000000 dc.w %0001111110000000 dc.w %0000101100000000 dc.w %0101111000000000 dc.w %0010110000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 1 shift 2 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0001011000000000 dc.w %0010111100000000 dc.w %0000010110000000 dc.w %0000111111000000 dc.w %0000111111000000 dc.w %0000010110000000 dc.w %0010111100000000 dc.w %0001011000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 1 shift 3 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000101100000000 dc.w %0001011110000000 dc.w %0000001011000000 dc.w %0000011111100000 dc.w %0000011111100000 dc.w %0000001011000000 dc.w %0001011110000000 dc.w %0000101100000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 1 shift 4 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000010110000000 dc.w %0000101111000000 dc.w %0000000101100000 dc.w %0000001111110000 dc.w %0000001111110000 dc.w %0000000101100000 dc.w %0000101111000000 dc.w %0000010110000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 1 shift 5 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000001011000000 dc.w %0000010111100000 dc.w %0000000010110000 dc.w %0000000111111000 dc.w %0000000111111000 dc.w %0000000010110000 dc.w %0000010111100000 dc.w %0000001011000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 1 shift 6 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000101100000 dc.w %0000001011110000 dc.w %0000000001011000 dc.w %0000000011111100 dc.w %0000000011111100 dc.w %0000000001011000 dc.w %0000001011110000 dc.w %0000000101100000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 1 shift 7 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000010110000 dc.w %0000000101111000 dc.w %0000000000101100 dc.w %0000000001111110 dc.w %0000000001111110 dc.w %0000000000101100 dc.w %0000000101111000 dc.w %0000000010110000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 0 dc.w %1100000000000000 dc.w %0010000000000000 dc.w %0001111000000000 dc.w %0010100000000000 dc.w %1100100000000000 dc.w %0001000000000000 dc.w %0101100000000000 dc.w %1011110000000000 dc.w %0001011000000000 dc.w %0011111100000000 dc.w %0011111100000000 dc.w %0001011000000000 dc.w %1011110000000000 dc.w %0101100000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 1 dc.w %0110000000000000 dc.w %0001000000000000 dc.w %0000111100000000 dc.w %0001010000000000 dc.w %0110010000000000 dc.w %0000100000000000 dc.w %0010110000000000 dc.w %0101111000000000 dc.w %0000101100000000 dc.w %0001111110000000 dc.w %0001111110000000 dc.w %0000101100000000 dc.w %0101111000000000 dc.w %0010110000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 2 dc.w %0011000000000000 dc.w %0000100000000000 dc.w %0000011110000000 dc.w %0000101000000000 dc.w %0011001000000000 dc.w %0000010000000000 dc.w %0001011000000000 dc.w %0010111100000000 dc.w %0000010110000000 dc.w %0000111111000000 dc.w %0000111111000000 dc.w %0000010110000000 dc.w %0010111100000000 dc.w %0001011000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 3 dc.w %0001100000000000 dc.w %0000010000000000 dc.w %0000001111000000 dc.w %0000010100000000 dc.w %0001100100000000 dc.w %0000001000000000 dc.w %0000101100000000 dc.w %0001011110000000 dc.w %0000001011000000 dc.w %0000011111100000 dc.w %0000011111100000 dc.w %0000001011000000 dc.w %0001011110000000 dc.w %0000101100000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 4 dc.w %0000110000000000 dc.w %0000001000000000 dc.w %0000000111100000 dc.w %0000001010000000 dc.w %0000110010000000 dc.w %0000000100000000 dc.w %0000010110000000 dc.w %0000101111000000 dc.w %0000000101100000 dc.w %0000001111110000 dc.w %0000001111110000 dc.w %0000000101100000 dc.w %0000101111000000 dc.w %0000010110000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 5 dc.w %0000011000000000 dc.w %0000000100000000 dc.w %0000000011110000 dc.w %0000000101000000 dc.w %0000011001000000 dc.w %0000000010000000 dc.w %0000001011000000 dc.w %0000010111100000 dc.w %0000000010110000 dc.w %0000000111111000 dc.w %0000000111111000 dc.w %0000000010110000 dc.w %0000010111100000 dc.w %0000001011000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 6 dc.w %0000001100000000 dc.w %0000000010000000 dc.w %0000000001111000 dc.w %0000000010100000 dc.w %0000001100100000 dc.w %0000000001000000 dc.w %0000000101100000 dc.w %0000001011110000 dc.w %0000000001011000 dc.w %0000000011111100 dc.w %0000000011111100 dc.w %0000000001011000 dc.w %0000001011110000 dc.w %0000000101100000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 7 dc.w %0000000110000000 dc.w %0000000001000000 dc.w %0000000000111100 dc.w %0000000001010000 dc.w %0000000110010000 dc.w %0000000000100000 dc.w %0000000010110000 dc.w %0000000101111000 dc.w %0000000000101100 dc.w %0000000001111110 dc.w %0000000001111110 dc.w %0000000000101100 dc.w %0000000101111000 dc.w %0000000010110000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 3 shift 0 dc.w %0000000000000000 dc.w %1100000000000000 dc.w %0010000000000000 dc.w %0001111000000000 dc.w %0010100000000000 dc.w %1101000000000000 dc.w %1001100000000000 dc.w %0101110000000000 dc.w %1011011000000000 dc.w %0101111100000000 dc.w %0101111100000000 dc.w %1011011000000000 dc.w %0101110000000000 dc.w %1001100000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 3 shift 1 dc.w %0000000000000000 dc.w %0110000000000000 dc.w %0001000000000000 dc.w %0000111100000000 dc.w %0001010000000000 dc.w %0110100000000000 dc.w %0100110000000000 dc.w %0010111000000000 dc.w %0101101100000000 dc.w %0010111110000000 dc.w %0010111110000000 dc.w %0101101100000000 dc.w %0010111000000000 dc.w %0100110000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 3 shift 2 dc.w %0000000000000000 dc.w %0011000000000000 dc.w %0000100000000000 dc.w %0000011110000000 dc.w %0000101000000000 dc.w %0011010000000000 dc.w %0010011000000000 dc.w %0001011100000000 dc.w %0010110110000000 dc.w %0001011111000000 dc.w %0001011111000000 dc.w %0010110110000000 dc.w %0001011100000000 dc.w %0010011000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 3 shift 3 dc.w %0000000000000000 dc.w %0001100000000000 dc.w %0000010000000000 dc.w %0000001111000000 dc.w %0000010100000000 dc.w %0001101000000000 dc.w %0001001100000000 dc.w %0000101110000000 dc.w %0001011011000000 dc.w %0000101111100000 dc.w %0000101111100000 dc.w %0001011011000000 dc.w %0000101110000000 dc.w %0001001100000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 3 shift 4 dc.w %0000000000000000 dc.w %0000110000000000 dc.w %0000001000000000 dc.w %0000000111100000 dc.w %0000001010000000 dc.w %0000110100000000 dc.w %0000100110000000 dc.w %0000010111000000 dc.w %0000101101100000 dc.w %0000010111110000 dc.w %0000010111110000 dc.w %0000101101100000 dc.w %0000010111000000 dc.w %0000100110000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 3 shift 5 dc.w %0000000000000000 dc.w %0000011000000000 dc.w %0000000100000000 dc.w %0000000011110000 dc.w %0000000101000000 dc.w %0000011010000000 dc.w %0000010011000000 dc.w %0000001011100000 dc.w %0000010110110000 dc.w %0000001011111000 dc.w %0000001011111000 dc.w %0000010110110000 dc.w %0000001011100000 dc.w %0000010011000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 3 shift 6 dc.w %0000000000000000 dc.w %0000001100000000 dc.w %0000000010000000 dc.w %0000000001111000 dc.w %0000000010100000 dc.w %0000001101000000 dc.w %0000001001100000 dc.w %0000000101110000 dc.w %0000001011011000 dc.w %0000000101111100 dc.w %0000000101111100 dc.w %0000001011011000 dc.w %0000000101110000 dc.w %0000001001100000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 3 shift 7 dc.w %0000000000000000 dc.w %0000000110000000 dc.w %0000000001000000 dc.w %0000000000111100 dc.w %0000000001010000 dc.w %0000000110100000 dc.w %0000000100110000 dc.w %0000000010111000 dc.w %0000000101101100 dc.w %0000000010111110 dc.w %0000000010111110 dc.w %0000000101101100 dc.w %0000000010111000 dc.w %0000000100110000 dc.w %0000000000000000 dc.w %0000011000000000 ;image 4 shift 0 dc.w %0000100000000000 dc.w %1111000000000000 dc.w %0000100000000000 dc.w %0000011000000000 dc.w %0000110000000000 dc.w %0001100000000000 dc.w %0101100000000000 dc.w %1011110000000000 dc.w %0001011000000000 dc.w %0011111100000000 dc.w %0011111100000000 dc.w %0001011000000000 dc.w %1011110000000000 dc.w %0101100000000000 dc.w %0000000000000000 dc.w %0000001100000000 ;image 4 shift 1 dc.w %0000010000000000 dc.w %0111100000000000 dc.w %0000010000000000 dc.w %0000001100000000 dc.w %0000011000000000 dc.w %0000110000000000 dc.w %0010110000000000 dc.w %0101111000000000 dc.w %0000101100000000 dc.w %0001111110000000 dc.w %0001111110000000 dc.w %0000101100000000 dc.w %0101111000000000 dc.w %0010110000000000 dc.w %0000000000000000 dc.w %0000000110000000 ;image 4 shift 2 dc.w %0000001000000000 dc.w %0011110000000000 dc.w %0000001000000000 dc.w %0000000110000000 dc.w %0000001100000000 dc.w %0000011000000000 dc.w %0001011000000000 dc.w %0010111100000000 dc.w %0000010110000000 dc.w %0000111111000000 dc.w %0000111111000000 dc.w %0000010110000000 dc.w %0010111100000000 dc.w %0001011000000000 dc.w %0000000000000000 dc.w %0000000011000000 ;image 4 shift 3 dc.w %0000000100000000 dc.w %0001111000000000 dc.w %0000000100000000 dc.w %0000000011000000 dc.w %0000000110000000 dc.w %0000001100000000 dc.w %0000101100000000 dc.w %0001011110000000 dc.w %0000001011000000 dc.w %0000011111100000 dc.w %0000011111100000 dc.w %0000001011000000 dc.w %0001011110000000 dc.w %0000101100000000 dc.w %0000000000000000 dc.w %0000000001100000 ;image 4 shift 4 dc.w %0000000010000000 dc.w %0000111100000000 dc.w %0000000010000000 dc.w %0000000001100000 dc.w %0000000011000000 dc.w %0000000110000000 dc.w %0000010110000000 dc.w %0000101111000000 dc.w %0000000101100000 dc.w %0000001111110000 dc.w %0000001111110000 dc.w %0000000101100000 dc.w %0000101111000000 dc.w %0000010110000000 dc.w %0000000000000000 dc.w %0000000000110000 ;image 4 shift 5 dc.w %0000000001000000 dc.w %0000011110000000 dc.w %0000000001000000 dc.w %0000000000110000 dc.w %0000000001100000 dc.w %0000000011000000 dc.w %0000001011000000 dc.w %0000010111100000 dc.w %0000000010110000 dc.w %0000000111111000 dc.w %0000000111111000 dc.w %0000000010110000 dc.w %0000010111100000 dc.w %0000001011000000 dc.w %0000000000000000 dc.w %0000000000011000 ;image 4 shift 6 dc.w %0000000000100000 dc.w %0000001111000000 dc.w %0000000000100000 dc.w %0000000000011000 dc.w %0000000000110000 dc.w %0000000001100000 dc.w %0000000101100000 dc.w %0000001011110000 dc.w %0000000001011000 dc.w %0000000011111100 dc.w %0000000011111100 dc.w %0000000001011000 dc.w %0000001011110000 dc.w %0000000101100000 dc.w %0000000000000000 dc.w %0000000000001100 ;image 4 shift 7 dc.w %0000000000010000 dc.w %0000000111100000 dc.w %0000000000010000 dc.w %0000000000001100 dc.w %0000000000011000 dc.w %0000000000110000 dc.w %0000000010110000 dc.w %0000000101111000 dc.w %0000000000101100 dc.w %0000000001111110 dc.w %0000000001111110 dc.w %0000000000101100 dc.w %0000000101111000 dc.w %0000000010110000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 5 shift 0 dc.w %0000011000000000 dc.w %0000100000000000 dc.w %1111000000000000 dc.w %0000100000000000 dc.w %0000011000000000 dc.w %0001110000000000 dc.w %1001100000000000 dc.w %0101110000000000 dc.w %1011011000000000 dc.w %0101111100000000 dc.w %0101111100000000 dc.w %1011011000000000 dc.w %0101110000000000 dc.w %1001100000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 5 shift 1 dc.w %0000001100000000 dc.w %0000010000000000 dc.w %0111100000000000 dc.w %0000010000000000 dc.w %0000001100000000 dc.w %0000111000000000 dc.w %0100110000000000 dc.w %0010111000000000 dc.w %0101101100000000 dc.w %0010111110000000 dc.w %0010111110000000 dc.w %0101101100000000 dc.w %0010111000000000 dc.w %0100110000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 5 shift 2 dc.w %0000000110000000 dc.w %0000001000000000 dc.w %0011110000000000 dc.w %0000001000000000 dc.w %0000000110000000 dc.w %0000011100000000 dc.w %0010011000000000 dc.w %0001011100000000 dc.w %0010110110000000 dc.w %0001011111000000 dc.w %0001011111000000 dc.w %0010110110000000 dc.w %0001011100000000 dc.w %0010011000000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 5 shift 3 dc.w %0000000011000000 dc.w %0000000100000000 dc.w %0001111000000000 dc.w %0000000100000000 dc.w %0000000011000000 dc.w %0000001110000000 dc.w %0001001100000000 dc.w %0000101110000000 dc.w %0001011011000000 dc.w %0000101111100000 dc.w %0000101111100000 dc.w %0001011011000000 dc.w %0000101110000000 dc.w %0001001100000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 5 shift 4 dc.w %0000000001100000 dc.w %0000000010000000 dc.w %0000111100000000 dc.w %0000000010000000 dc.w %0000000001100000 dc.w %0000000111000000 dc.w %0000100110000000 dc.w %0000010111000000 dc.w %0000101101100000 dc.w %0000010111110000 dc.w %0000010111110000 dc.w %0000101101100000 dc.w %0000010111000000 dc.w %0000100110000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 5 shift 5 dc.w %0000000000110000 dc.w %0000000001000000 dc.w %0000011110000000 dc.w %0000000001000000 dc.w %0000000000110000 dc.w %0000000011100000 dc.w %0000010011000000 dc.w %0000001011100000 dc.w %0000010110110000 dc.w %0000001011111000 dc.w %0000001011111000 dc.w %0000010110110000 dc.w %0000001011100000 dc.w %0000010011000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 5 shift 6 dc.w %0000000000011000 dc.w %0000000000100000 dc.w %0000001111000000 dc.w %0000000000100000 dc.w %0000000000011000 dc.w %0000000001110000 dc.w %0000001001100000 dc.w %0000000101110000 dc.w %0000001011011000 dc.w %0000000101111100 dc.w %0000000101111100 dc.w %0000001011011000 dc.w %0000000101110000 dc.w %0000001001100000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 5 shift 7 dc.w %0000000000001100 dc.w %0000000000010000 dc.w %0000000111100000 dc.w %0000000000010000 dc.w %0000000000001100 dc.w %0000000000111000 dc.w %0000000100110000 dc.w %0000000010111000 dc.w %0000000101101100 dc.w %0000000010111110 dc.w %0000000010111110 dc.w %0000000101101100 dc.w %0000000010111000 dc.w %0000000100110000 dc.w %0000000000000000 .player_shot_data.w dc.b 1 ; width dc.w %1111000000000000 ;image 0 shift 0 dc.w %0111100000000000 ;image 0 shift 1 dc.w %0011110000000000 ;image 0 shift 2 dc.w %0001111000000000 ;image 0 shift 3 dc.w %0000111100000000 ;image 0 shift 4 dc.w %0000011110000000 ;image 0 shift 5 dc.w %0000001111000000 ;image 0 shift 6 dc.w %0000000111100000 ;image 0 shift 7 .player_shot_exp_data.w dc.b 8 ; width dc.w %1001100100000000 ;image 0 shift 0 dc.w %0011110000000000 dc.w %0111111000000000 dc.w %1011110000000000 dc.w %0011110100000000 dc.w %0111110000000000 dc.w %0011111000000000 dc.w %1001100100000000 dc.w %0100110010000000 ;image 0 shift 1 dc.w %0001111000000000 dc.w %0011111100000000 dc.w %0101111000000000 dc.w %0001111010000000 dc.w %0011111000000000 dc.w %0001111100000000 dc.w %0100110010000000 dc.w %0010011001000000 ;image 0 shift 2 dc.w %0000111100000000 dc.w %0001111110000000 dc.w %0010111100000000 dc.w %0000111101000000 dc.w %0001111100000000 dc.w %0000111110000000 dc.w %0010011001000000 dc.w %0001001100100000 ;image 0 shift 3 dc.w %0000011110000000 dc.w %0000111111000000 dc.w %0001011110000000 dc.w %0000011110100000 dc.w %0000111110000000 dc.w %0000011111000000 dc.w %0001001100100000 dc.w %0000100110010000 ;image 0 shift 4 dc.w %0000001111000000 dc.w %0000011111100000 dc.w %0000101111000000 dc.w %0000001111010000 dc.w %0000011111000000 dc.w %0000001111100000 dc.w %0000100110010000 dc.w %0000010011001000 ;image 0 shift 5 dc.w %0000000111100000 dc.w %0000001111110000 dc.w %0000010111100000 dc.w %0000000111101000 dc.w %0000001111100000 dc.w %0000000111110000 dc.w %0000010011001000 dc.w %0000001001100100 ;image 0 shift 6 dc.w %0000000011110000 dc.w %0000000111111000 dc.w %0000001011110000 dc.w %0000000011110100 dc.w %0000000111110000 dc.w %0000000011111000 dc.w %0000001001100100 dc.w %0000000100110010 ;image 0 shift 7 dc.w %0000000001111000 dc.w %0000000011111100 dc.w %0000000101111000 dc.w %0000000001111010 dc.w %0000000011111000 dc.w %0000000001111100 dc.w %0000000100110010 .alien_shot_plunger_data.w dc.b 3 ; width dc.w %0010000000000000 ;image 0 shift 0 dc.w %0011111100000000 dc.w %0010000000000000 dc.w %0001000000000000 ;image 0 shift 1 dc.w %0001111110000000 dc.w %0001000000000000 dc.w %0000100000000000 ;image 0 shift 2 dc.w %0000111111000000 dc.w %0000100000000000 dc.w %0000010000000000 ;image 0 shift 3 dc.w %0000011111100000 dc.w %0000010000000000 dc.w %0000001000000000 ;image 0 shift 4 dc.w %0000001111110000 dc.w %0000001000000000 dc.w %0000000100000000 ;image 0 shift 5 dc.w %0000000111111000 dc.w %0000000100000000 dc.w %0000000010000000 ;image 0 shift 6 dc.w %0000000011111100 dc.w %0000000010000000 dc.w %0000000001000000 ;image 0 shift 7 dc.w %0000000001111110 dc.w %0000000001000000 dc.w %0000100000000000 ;image 1 shift 0 dc.w %0011111100000000 dc.w %0000100000000000 dc.w %0000010000000000 ;image 1 shift 1 dc.w %0001111110000000 dc.w %0000010000000000 dc.w %0000001000000000 ;image 1 shift 2 dc.w %0000111111000000 dc.w %0000001000000000 dc.w %0000000100000000 ;image 1 shift 3 dc.w %0000011111100000 dc.w %0000000100000000 dc.w %0000000010000000 ;image 1 shift 4 dc.w %0000001111110000 dc.w %0000000010000000 dc.w %0000000001000000 ;image 1 shift 5 dc.w %0000000111111000 dc.w %0000000001000000 dc.w %0000000000100000 ;image 1 shift 6 dc.w %0000000011111100 dc.w %0000000000100000 dc.w %0000000000010000 ;image 1 shift 7 dc.w %0000000001111110 dc.w %0000000000010000 dc.w %0000010000000000 ;image 2 shift 0 dc.w %0011111100000000 dc.w %0000010000000000 dc.w %0000001000000000 ;image 2 shift 1 dc.w %0001111110000000 dc.w %0000001000000000 dc.w %0000000100000000 ;image 2 shift 2 dc.w %0000111111000000 dc.w %0000000100000000 dc.w %0000000010000000 ;image 2 shift 3 dc.w %0000011111100000 dc.w %0000000010000000 dc.w %0000000001000000 ;image 2 shift 4 dc.w %0000001111110000 dc.w %0000000001000000 dc.w %0000000000100000 ;image 2 shift 5 dc.w %0000000111111000 dc.w %0000000000100000 dc.w %0000000000010000 ;image 2 shift 6 dc.w %0000000011111100 dc.w %0000000000010000 dc.w %0000000000001000 ;image 2 shift 7 dc.w %0000000001111110 dc.w %0000000000001000 dc.w %0000000100000000 ;image 3 shift 0 dc.w %0011111100000000 dc.w %0000000100000000 dc.w %0000000010000000 ;image 3 shift 1 dc.w %0001111110000000 dc.w %0000000010000000 dc.w %0000000001000000 ;image 3 shift 2 dc.w %0000111111000000 dc.w %0000000001000000 dc.w %0000000000100000 ;image 3 shift 3 dc.w %0000011111100000 dc.w %0000000000100000 dc.w %0000000000010000 ;image 3 shift 4 dc.w %0000001111110000 dc.w %0000000000010000 dc.w %0000000000001000 ;image 3 shift 5 dc.w %0000000111111000 dc.w %0000000000001000 dc.w %0000000000000100 ;image 3 shift 6 dc.w %0000000011111100 dc.w %0000000000000100 dc.w %0000000000000010 ;image 3 shift 7 dc.w %0000000001111110 dc.w %0000000000000010 .alien_shot_rolling_data.w dc.b 3 ; width dc.w %0000000000000000 ;image 0 shift 0 dc.w %0111111100000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 1 dc.w %0011111110000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 2 dc.w %0001111111000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 3 dc.w %0000111111100000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 4 dc.w %0000011111110000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 5 dc.w %0000001111111000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 6 dc.w %0000000111111100 dc.w %0000000000000000 dc.w %0000000000000000 ;image 0 shift 7 dc.w %0000000011111110 dc.w %0000000000000000 dc.w %0010010000000000 ;image 1 shift 0 dc.w %0111111100000000 dc.w %0100100000000000 dc.w %0001001000000000 ;image 1 shift 1 dc.w %0011111110000000 dc.w %0010010000000000 dc.w %0000100100000000 ;image 1 shift 2 dc.w %0001111111000000 dc.w %0001001000000000 dc.w %0000010010000000 ;image 1 shift 3 dc.w %0000111111100000 dc.w %0000100100000000 dc.w %0000001001000000 ;image 1 shift 4 dc.w %0000011111110000 dc.w %0000010010000000 dc.w %0000000100100000 ;image 1 shift 5 dc.w %0000001111111000 dc.w %0000001001000000 dc.w %0000000010010000 ;image 1 shift 6 dc.w %0000000111111100 dc.w %0000000100100000 dc.w %0000000001001000 ;image 1 shift 7 dc.w %0000000011111110 dc.w %0000000010010000 dc.w %0000000000000000 ;image 2 shift 0 dc.w %0111111100000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 1 dc.w %0011111110000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 2 dc.w %0001111111000000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 3 dc.w %0000111111100000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 4 dc.w %0000011111110000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 5 dc.w %0000001111111000 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 6 dc.w %0000000111111100 dc.w %0000000000000000 dc.w %0000000000000000 ;image 2 shift 7 dc.w %0000000011111110 dc.w %0000000000000000 dc.w %0001001000000000 ;image 3 shift 0 dc.w %0111111100000000 dc.w %0000100100000000 dc.w %0000100100000000 ;image 3 shift 1 dc.w %0011111110000000 dc.w %0000010010000000 dc.w %0000010010000000 ;image 3 shift 2 dc.w %0001111111000000 dc.w %0000001001000000 dc.w %0000001001000000 ;image 3 shift 3 dc.w %0000111111100000 dc.w %0000000100100000 dc.w %0000000100100000 ;image 3 shift 4 dc.w %0000011111110000 dc.w %0000000010010000 dc.w %0000000010010000 ;image 3 shift 5 dc.w %0000001111111000 dc.w %0000000001001000 dc.w %0000000001001000 ;image 3 shift 6 dc.w %0000000111111100 dc.w %0000000000100100 dc.w %0000000000100100 ;image 3 shift 7 dc.w %0000000011111110 dc.w %0000000000010010 .alien_shot_squigly_data.w dc.b 3 ; width dc.w %0010001000000000 ;image 0 shift 0 dc.w %0101010100000000 dc.w %0000100000000000 dc.w %0001000100000000 ;image 0 shift 1 dc.w %0010101010000000 dc.w %0000010000000000 dc.w %0000100010000000 ;image 0 shift 2 dc.w %0001010101000000 dc.w %0000001000000000 dc.w %0000010001000000 ;image 0 shift 3 dc.w %0000101010100000 dc.w %0000000100000000 dc.w %0000001000100000 ;image 0 shift 4 dc.w %0000010101010000 dc.w %0000000010000000 dc.w %0000000100010000 ;image 0 shift 5 dc.w %0000001010101000 dc.w %0000000001000000 dc.w %0000000010001000 ;image 0 shift 6 dc.w %0000000101010100 dc.w %0000000000100000 dc.w %0000000001000100 ;image 0 shift 7 dc.w %0000000010101010 dc.w %0000000000010000 dc.w %0001000100000000 ;image 1 shift 0 dc.w %0010101000000000 dc.w %0100010000000000 dc.w %0000100010000000 ;image 1 shift 1 dc.w %0001010100000000 dc.w %0010001000000000 dc.w %0000010001000000 ;image 1 shift 2 dc.w %0000101010000000 dc.w %0001000100000000 dc.w %0000001000100000 ;image 1 shift 3 dc.w %0000010101000000 dc.w %0000100010000000 dc.w %0000000100010000 ;image 1 shift 4 dc.w %0000001010100000 dc.w %0000010001000000 dc.w %0000000010001000 ;image 1 shift 5 dc.w %0000000101010000 dc.w %0000001000100000 dc.w %0000000001000100 ;image 1 shift 6 dc.w %0000000010101000 dc.w %0000000100010000 dc.w %0000000000100010 ;image 1 shift 7 dc.w %0000000001010100 dc.w %0000000010001000 dc.w %0000100000000000 ;image 2 shift 0 dc.w %0101010100000000 dc.w %0010001000000000 dc.w %0000010000000000 ;image 2 shift 1 dc.w %0010101010000000 dc.w %0001000100000000 dc.w %0000001000000000 ;image 2 shift 2 dc.w %0001010101000000 dc.w %0000100010000000 dc.w %0000000100000000 ;image 2 shift 3 dc.w %0000101010100000 dc.w %0000010001000000 dc.w %0000000010000000 ;image 2 shift 4 dc.w %0000010101010000 dc.w %0000001000100000 dc.w %0000000001000000 ;image 2 shift 5 dc.w %0000001010101000 dc.w %0000000100010000 dc.w %0000000000100000 ;image 2 shift 6 dc.w %0000000101010100 dc.w %0000000010001000 dc.w %0000000000010000 ;image 2 shift 7 dc.w %0000000010101010 dc.w %0000000001000100 dc.w %0100010000000000 ;image 3 shift 0 dc.w %0010101000000000 dc.w %0001000100000000 dc.w %0010001000000000 ;image 3 shift 1 dc.w %0001010100000000 dc.w %0000100010000000 dc.w %0001000100000000 ;image 3 shift 2 dc.w %0000101010000000 dc.w %0000010001000000 dc.w %0000100010000000 ;image 3 shift 3 dc.w %0000010101000000 dc.w %0000001000100000 dc.w %0000010001000000 ;image 3 shift 4 dc.w %0000001010100000 dc.w %0000000100010000 dc.w %0000001000100000 ;image 3 shift 5 dc.w %0000000101010000 dc.w %0000000010001000 dc.w %0000000100010000 ;image 3 shift 6 dc.w %0000000010101000 dc.w %0000000001000100 dc.w %0000000010001000 ;image 3 shift 7 dc.w %0000000001010100 dc.w %0000000000100010 .alien_shot_explode_data.w dc.b 6 ; width dc.w %0101001000000000 ;image 0 shift 0 dc.w %1010100000000000 dc.w %0111110100000000 dc.w %1111110000000000 dc.w %0111101000000000 dc.w %1010010000000000 dc.w %0010100100000000 ;image 0 shift 1 dc.w %0101010000000000 dc.w %0011111010000000 dc.w %0111111000000000 dc.w %0011110100000000 dc.w %0101001000000000 dc.w %0001010010000000 ;image 0 shift 2 dc.w %0010101000000000 dc.w %0001111101000000 dc.w %0011111100000000 dc.w %0001111010000000 dc.w %0010100100000000 dc.w %0000101001000000 ;image 0 shift 3 dc.w %0001010100000000 dc.w %0000111110100000 dc.w %0001111110000000 dc.w %0000111101000000 dc.w %0001010010000000 dc.w %0000010100100000 ;image 0 shift 4 dc.w %0000101010000000 dc.w %0000011111010000 dc.w %0000111111000000 dc.w %0000011110100000 dc.w %0000101001000000 dc.w %0000001010010000 ;image 0 shift 5 dc.w %0000010101000000 dc.w %0000001111101000 dc.w %0000011111100000 dc.w %0000001111010000 dc.w %0000010100100000 dc.w %0000000101001000 ;image 0 shift 6 dc.w %0000001010100000 dc.w %0000000111110100 dc.w %0000001111110000 dc.w %0000000111101000 dc.w %0000001010010000 dc.w %0000000010100100 ;image 0 shift 7 dc.w %0000000101010000 dc.w %0000000011111010 dc.w %0000000111111000 dc.w %0000000011110100 dc.w %0000000101001000 end
source/.milestone2/bootload.asm
diwangs/IF2230_GhettoOS
0
2760
<filename>source/.milestone2/bootload.asm ;bootload.asm ;<NAME>, 2007 ; ;This is a simple bootloader that loads and executes a kernel at sector 3 bits 16 KSEG equ 0x1000 ;kernel goes into memory at 0x10000 KSIZE equ 15 ;kernel is at most 10 sectors (and probably less) KSTART equ 1 ;kernel lives at sector 3 (makes room for map & dir). Milestone 2 jadi 1 ? ;boot loader starts at 0 in segment 0x7c00 org 0h ;let's put the kernel at KSEG:0 ;set up the segment registers mov ax,KSEG mov ds,ax mov ss,ax mov es,ax ;let's have the stack start at KSEG:fff0 mov ax,0xfff0 mov sp,ax mov bp,ax ;read in the kernel from the disk mov cl,KSTART+1 ;cl holds sector number mov dh,0 ;dh holds head number - 0 mov ch,0 ;ch holds track number - 0 mov ah,2 ;absolute disk read mov al,KSIZE ;read KSIZE sectors mov dl,0 ;read from floppy disk A mov bx,0 ;read into 0 (in the segment) int 13h ;call BIOS disk read function ;call the kernel jmp KSEG:0 times 510-($-$$) db 0 ;AA55 tells BIOS that this is a valid bootloader dw 0xAA55
src/fltk-widgets-groups-text_displays.ads
micahwelf/FLTK-Ada
1
16513
with FLTK.Text_Buffers; private with Interfaces.C, System.Address_To_Access_Conversions; package FLTK.Widgets.Groups.Text_Displays is type Text_Display is new Group with private; type Text_Display_Reference (Data : not null access Text_Display'Class) is limited null record with Implicit_Dereference => Data; type Wrap_Mode is (None, Column, Pixel, Bounds); type Cursor_Style is (Normal, Caret, Dim, Block, Heavy, Simple); Bounds_Error : exception; package Forge is function Create (X, Y, W, H : in Integer; Text : in String) return Text_Display; end Forge; package Styles is type Style_Entry is private; type Style_Index is new Character range 'A' .. '~'; type Style_Array is array (Style_Index range <>) of Style_Entry; type Unfinished_Style_Callback is access procedure (Char : in Character; Display : in out Text_Display); function Item (Tint : in Color; Font : in Font_Kind; Size : in Font_Size) return Style_Entry; private type Style_Entry is record Attr : Interfaces.C.unsigned; Col : Interfaces.C.unsigned; Font : Interfaces.C.int; Size : Interfaces.C.int; end record; pragma Convention (C, Style_Entry); pragma Convention (C, Style_Array); end Styles; function Get_Buffer (This : in Text_Display) return FLTK.Text_Buffers.Text_Buffer_Reference; procedure Set_Buffer (This : in out Text_Display; Buff : in out FLTK.Text_Buffers.Text_Buffer); procedure Highlight_Data (This : in out Text_Display; Buff : in out FLTK.Text_Buffers.Text_Buffer; Table : in Styles.Style_Array); procedure Highlight_Data (This : in out Text_Display; Buff : in out FLTK.Text_Buffers.Text_Buffer; Table : in Styles.Style_Array; Unfinished : in Styles.Style_Index; Callback : in Styles.Unfinished_Style_Callback); function Col_To_X (This : in Text_Display; Col_Num : in Integer) return Integer; function X_To_Col (This : in Text_Display; X_Pos : in Integer) return Integer; function In_Selection (This : in Text_Display; X, Y : in Integer) return Boolean; procedure Position_To_XY (This : in Text_Display; Pos : in Integer; X, Y : out Integer; Vert_Out : out Boolean); function Get_Cursor_Color (This : in Text_Display) return Color; procedure Set_Cursor_Color (This : in out Text_Display; Col : in Color); procedure Set_Cursor_Style (This : in out Text_Display; Style : in Cursor_Style); procedure Hide_Cursor (This : in out Text_Display); procedure Show_Cursor (This : in out Text_Display); function Get_Text_Color (This : in Text_Display) return Color; procedure Set_Text_Color (This : in out Text_Display; Col : in Color); function Get_Text_Font (This : in Text_Display) return Font_Kind; procedure Set_Text_Font (This : in out Text_Display; Font : in Font_Kind); function Get_Text_Size (This : in Text_Display) return Font_Size; procedure Set_Text_Size (This : in out Text_Display; Size : in Font_Size); procedure Insert_Text (This : in out Text_Display; Item : in String); procedure Overstrike (This : in out Text_Display; Text : in String); function Get_Insert_Position (This : in Text_Display) return Natural; procedure Set_Insert_Position (This : in out Text_Display; Pos : in Natural); procedure Show_Insert_Position (This : in out Text_Display); function Word_Start (This : in out Text_Display; Pos : in Natural) return Natural; function Word_End (This : in out Text_Display; Pos : in Natural) return Natural; procedure Next_Word (This : in out Text_Display); procedure Previous_Word (This : in out Text_Display); procedure Set_Wrap_Mode (This : in out Text_Display; Mode : in Wrap_Mode; Margin : in Natural := 0); -- takes into account word wrap function Line_Start (This : in Text_Display; Pos : in Natural) return Natural; -- takes into account word wrap function Line_End (This : in Text_Display; Pos : in Natural; Start_Pos_Is_Line_Start : in Boolean := False) return Natural; function Count_Lines (This : in Text_Display; Start, Finish : in Natural; Start_Pos_Is_Line_Start : in Boolean := False) return Natural; -- takes into account word wrap as well as newline characters function Skip_Lines (This : in Text_Display; Start, Lines : in Natural; Start_Pos_Is_Line_Start : in Boolean := False) return Natural; -- takes into account word wrap as well as newline characters function Rewind_Lines (This : in Text_Display; Start, Lines : in Natural) return Natural; function Get_Linenumber_Alignment (This : in Text_Display) return Alignment; procedure Set_Linenumber_Alignment (This : in out Text_Display; To : in Alignment); function Get_Linenumber_Back_Color (This : in Text_Display) return Color; procedure Set_Linenumber_Back_Color (This : in out Text_Display; To : in Color); function Get_Linenumber_Fore_Color (This : in Text_Display) return Color; procedure Set_Linenumber_Fore_Color (This : in out Text_Display; To : in Color); function Get_Linenumber_Font (This : in Text_Display) return Font_Kind; procedure Set_Linenumber_Font (This : in out Text_Display; To : in Font_Kind); function Get_Linenumber_Size (This : in Text_Display) return Font_Size; procedure Set_Linenumber_Size (This : in out Text_Display; To : in Font_Size); function Get_Linenumber_Width (This : in Text_Display) return Natural; procedure Set_Linenumber_Width (This : in out Text_Display; Width : in Natural); procedure Move_Down (This : in out Text_Display); procedure Move_Left (This : in out Text_Display); procedure Move_Right (This : in out Text_Display); procedure Move_Up (This : in out Text_Display); procedure Scroll_To (This : in out Text_Display; Line : in Natural); function Get_Scrollbar_Alignment (This : in Text_Display) return Alignment; procedure Set_Scrollbar_Alignment (This : in out Text_Display; Align : in Alignment); function Get_Scrollbar_Width (This : in Text_Display) return Natural; procedure Set_Scrollbar_Width (This : in out Text_Display; Width : in Natural); procedure Redisplay_Range (This : in out Text_Display; Start, Finish : in Natural); procedure Draw (This : in out Text_Display); function Handle (This : in out Text_Display; Event : in Event_Kind) return Event_Outcome; private type Text_Display is new Group with record Buffer : access FLTK.Text_Buffers.Text_Buffer; Style_Callback : Styles.Unfinished_Style_Callback; end record; overriding procedure Finalize (This : in out Text_Display); package Text_Display_Convert is new System.Address_To_Access_Conversions (Text_Display'Class); pragma Inline (Get_Buffer); pragma Inline (Set_Buffer); pragma Inline (Highlight_Data); pragma Inline (Col_To_X); pragma Inline (X_To_Col); pragma Inline (In_Selection); pragma Inline (Position_To_XY); pragma Inline (Get_Cursor_Color); pragma Inline (Set_Cursor_Color); pragma Inline (Set_Cursor_Style); pragma Inline (Hide_Cursor); pragma Inline (Show_Cursor); pragma Inline (Get_Text_Color); pragma Inline (Set_Text_Color); pragma Inline (Get_Text_Font); pragma Inline (Set_Text_Font); pragma Inline (Get_Text_Size); pragma Inline (Set_Text_Size); pragma Inline (Insert_Text); pragma Inline (Overstrike); pragma Inline (Get_Insert_Position); pragma Inline (Set_Insert_Position); pragma Inline (Show_Insert_Position); pragma Inline (Word_Start); pragma Inline (Word_End); pragma Inline (Next_Word); pragma Inline (Previous_Word); pragma Inline (Set_Wrap_Mode); pragma Inline (Line_Start); pragma Inline (Line_End); pragma Inline (Count_Lines); pragma Inline (Skip_Lines); pragma Inline (Rewind_Lines); pragma Inline (Get_Linenumber_Alignment); pragma Inline (Set_Linenumber_Alignment); pragma Inline (Get_Linenumber_Back_Color); pragma Inline (Set_Linenumber_Back_Color); pragma Inline (Get_Linenumber_Fore_Color); pragma Inline (Set_Linenumber_Fore_Color); pragma Inline (Get_Linenumber_Font); pragma Inline (Set_Linenumber_Font); pragma Inline (Get_Linenumber_Size); pragma Inline (Set_Linenumber_Size); pragma Inline (Get_Linenumber_Width); pragma Inline (Set_Linenumber_Width); pragma Inline (Move_Down); pragma Inline (Move_Left); pragma Inline (Move_Right); pragma Inline (Move_Up); pragma Inline (Scroll_To); pragma Inline (Get_Scrollbar_Alignment); pragma Inline (Set_Scrollbar_Alignment); pragma Inline (Get_Scrollbar_Width); pragma Inline (Set_Scrollbar_Width); pragma Inline (Redisplay_Range); pragma Inline (Draw); pragma Inline (Handle); end FLTK.Widgets.Groups.Text_Displays;
tests/function_simple/err_result_size_larger1.asm
dommilosz/customasm
0
16454
#fn add1(value) => value + 1 #d8 add1(0xffff) ; error: larger
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_11_2553.asm
ljhsiun2/medusa
9
175637
<filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_11_2553.asm .global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r9 push %rax push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x175dc, %r10 nop nop nop nop cmp $45643, %rax movb (%r10), %r9b nop nop nop nop nop xor %rdx, %rdx lea addresses_UC_ht+0x16213, %r11 nop and $46813, %rbx mov $0x6162636465666768, %rsi movq %rsi, %xmm5 movups %xmm5, (%r11) cmp $24821, %rdx lea addresses_UC_ht+0xb7bf, %rbx nop nop xor %r9, %r9 mov (%rbx), %rsi nop nop dec %r11 lea addresses_D_ht+0x3237, %rsi nop nop and $15428, %rbx movw $0x6162, (%rsi) nop nop nop and %r9, %r9 lea addresses_WT_ht+0x11187, %r9 nop and %rbx, %rbx mov $0x6162636465666768, %r11 movq %r11, (%r9) nop nop nop inc %r9 lea addresses_A_ht+0x14e37, %r10 nop nop nop lfence movb (%r10), %r11b nop nop nop nop cmp $674, %r10 lea addresses_WT_ht+0x19e37, %rax nop nop nop nop add $43377, %rbx movw $0x6162, (%rax) nop nop nop nop nop lfence lea addresses_WC_ht+0x3b73, %rbx nop sub %r9, %r9 mov $0x6162636465666768, %rsi movq %rsi, %xmm2 movups %xmm2, (%rbx) add %rax, %rax lea addresses_A_ht+0x18677, %rsi lea addresses_A_ht+0x1dbb, %rdi nop nop sub $4662, %r11 mov $67, %rcx rep movsb nop nop nop nop nop sub $1237, %rsi lea addresses_D_ht+0x16237, %rcx nop add $13468, %rax movw $0x6162, (%rcx) nop nop nop nop cmp $14065, %r9 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %rax push %rbp push %rcx push %rdi push %rdx // Store lea addresses_normal+0xfe37, %rdx nop nop nop cmp %rdi, %rdi mov $0x5152535455565758, %r10 movq %r10, %xmm2 vmovntdq %ymm2, (%rdx) nop nop sub %rdx, %rdx // Store lea addresses_D+0xbe97, %r13 cmp %rdi, %rdi mov $0x5152535455565758, %r10 movq %r10, %xmm1 vmovups %ymm1, (%r13) nop cmp $21658, %rdi // Store lea addresses_PSE+0x1c237, %rdx nop nop and $39939, %rbp movw $0x5152, (%rdx) nop nop nop nop nop xor %r10, %r10 // Faulty Load lea addresses_RW+0x10637, %rbp nop nop nop xor $41923, %r10 mov (%rbp), %dx lea oracles, %rdi and $0xff, %rdx shlq $12, %rdx mov (%rdi,%rdx,1), %rdx pop %rdx pop %rdi pop %rcx pop %rbp pop %rax pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 11, 'size': 32, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 4, 'size': 32, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': True, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 1, 'size': 16, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 9, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': True, 'NT': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': True, 'congruent': 11, 'size': 2, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 2, 'size': 16, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': True}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 10, 'size': 2, 'same': False, 'NT': False}} {'32': 11} 32 32 32 32 32 32 32 32 32 32 32 */
Cubical/Algebra/Matrix.agda
dolio/cubical
0
15518
{-# OPTIONS --safe #-} module Cubical.Algebra.Matrix where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Function open import Cubical.Foundations.Equiv open import Cubical.Foundations.Structure open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Univalence open import Cubical.Foundations.HLevels open import Cubical.Foundations.Transport open import Cubical.Functions.FunExtEquiv import Cubical.Data.Empty as ⊥ open import Cubical.Data.Bool open import Cubical.Data.Nat renaming ( _+_ to _+ℕ_ ; _·_ to _·ℕ_ ; +-comm to +ℕ-comm ; +-assoc to +ℕ-assoc ; ·-assoc to ·ℕ-assoc) open import Cubical.Data.Vec open import Cubical.Data.Sigma.Base open import Cubical.Data.FinData open import Cubical.Relation.Nullary open import Cubical.Algebra.Group open import Cubical.Algebra.AbGroup open import Cubical.Algebra.Monoid open import Cubical.Algebra.Ring open import Cubical.Algebra.Ring.BigOps open import Cubical.Algebra.CommRing open Iso private variable ℓ ℓ' : Level A : Type ℓ -- Equivalence between Vec matrix and Fin function matrix FinMatrix : (A : Type ℓ) (m n : ℕ) → Type ℓ FinMatrix A m n = FinVec (FinVec A n) m VecMatrix : (A : Type ℓ) (m n : ℕ) → Type ℓ VecMatrix A m n = Vec (Vec A n) m FinMatrix→VecMatrix : {m n : ℕ} → FinMatrix A m n → VecMatrix A m n FinMatrix→VecMatrix M = FinVec→Vec (λ fm → FinVec→Vec (M fm)) VecMatrix→FinMatrix : {m n : ℕ} → VecMatrix A m n → FinMatrix A m n VecMatrix→FinMatrix M fn fm = lookup fm (lookup fn M) FinMatrix→VecMatrix→FinMatrix : {m n : ℕ} (M : FinMatrix A m n) → VecMatrix→FinMatrix (FinMatrix→VecMatrix M) ≡ M FinMatrix→VecMatrix→FinMatrix {m = zero} M = funExt (⊥.rec ∘ ¬Fin0) FinMatrix→VecMatrix→FinMatrix {n = zero} M = funExt₂ (λ _ → ⊥.rec ∘ ¬Fin0) FinMatrix→VecMatrix→FinMatrix {m = suc m} {n = suc n} M = funExt₂ goal where goal : (fm : Fin (suc m)) (fn : Fin (suc n)) → VecMatrix→FinMatrix (_ ∷ FinMatrix→VecMatrix (M ∘ suc)) fm fn ≡ M fm fn goal zero zero = refl goal zero (suc fn) i = FinVec→Vec→FinVec (M zero ∘ suc) i fn goal (suc fm) fn i = FinMatrix→VecMatrix→FinMatrix (M ∘ suc) i fm fn VecMatrix→FinMatrix→VecMatrix : {m n : ℕ} (M : VecMatrix A m n) → FinMatrix→VecMatrix (VecMatrix→FinMatrix M) ≡ M VecMatrix→FinMatrix→VecMatrix {m = zero} [] = refl VecMatrix→FinMatrix→VecMatrix {m = suc m} (M ∷ MS) i = Vec→FinVec→Vec M i ∷ VecMatrix→FinMatrix→VecMatrix MS i FinMatrixIsoVecMatrix : (A : Type ℓ) (m n : ℕ) → Iso (FinMatrix A m n) (VecMatrix A m n) fun (FinMatrixIsoVecMatrix A m n) = FinMatrix→VecMatrix inv (FinMatrixIsoVecMatrix A m n) = VecMatrix→FinMatrix rightInv (FinMatrixIsoVecMatrix A m n) = VecMatrix→FinMatrix→VecMatrix leftInv (FinMatrixIsoVecMatrix A m n) = FinMatrix→VecMatrix→FinMatrix FinMatrix≃VecMatrix : {m n : ℕ} → FinMatrix A m n ≃ VecMatrix A m n FinMatrix≃VecMatrix {_} {A} {m} {n} = isoToEquiv (FinMatrixIsoVecMatrix A m n) FinMatrix≡VecMatrix : (A : Type ℓ) (m n : ℕ) → FinMatrix A m n ≡ VecMatrix A m n FinMatrix≡VecMatrix _ _ _ = ua FinMatrix≃VecMatrix -- Define abelian group structure on matrices module FinMatrixAbGroup (G' : AbGroup ℓ) where open AbGroupStr (snd G') renaming ( is-set to isSetG ) private G = ⟨ G' ⟩ zeroFinMatrix : ∀ {m n} → FinMatrix G m n zeroFinMatrix _ _ = 0g negFinMatrix : ∀ {m n} → FinMatrix G m n → FinMatrix G m n negFinMatrix M i j = - M i j addFinMatrix : ∀ {m n} → FinMatrix G m n → FinMatrix G m n → FinMatrix G m n addFinMatrix M N i j = M i j + N i j isSetFinMatrix : ∀ {m n} → isSet (FinMatrix G m n) isSetFinMatrix = isSetΠ2 λ _ _ → isSetG addFinMatrixAssoc : ∀ {m n} → (M N K : FinMatrix G m n) → addFinMatrix M (addFinMatrix N K) ≡ addFinMatrix (addFinMatrix M N) K addFinMatrixAssoc M N K i j k = assoc (M j k) (N j k) (K j k) i addFinMatrix0r : ∀ {m n} → (M : FinMatrix G m n) → addFinMatrix M zeroFinMatrix ≡ M addFinMatrix0r M i j k = rid (M j k) i addFinMatrix0l : ∀ {m n} → (M : FinMatrix G m n) → addFinMatrix zeroFinMatrix M ≡ M addFinMatrix0l M i j k = lid (M j k) i addFinMatrixNegMatrixr : ∀ {m n} → (M : FinMatrix G m n) → addFinMatrix M (negFinMatrix M) ≡ zeroFinMatrix addFinMatrixNegMatrixr M i j k = invr (M j k) i addFinMatrixNegMatrixl : ∀ {m n} → (M : FinMatrix G m n) → addFinMatrix (negFinMatrix M) M ≡ zeroFinMatrix addFinMatrixNegMatrixl M i j k = invl (M j k) i addFinMatrixComm : ∀ {m n} → (M N : FinMatrix G m n) → addFinMatrix M N ≡ addFinMatrix N M addFinMatrixComm M N i k l = comm (M k l) (N k l) i FinMatrixAbGroup : (m n : ℕ) → AbGroup ℓ FinMatrixAbGroup m n = makeAbGroup {G = FinMatrix G m n} zeroFinMatrix addFinMatrix negFinMatrix isSetFinMatrix addFinMatrixAssoc addFinMatrix0r addFinMatrixNegMatrixr addFinMatrixComm -- Define a abelian group structure on vector matrices and prove that -- it is equal to FinMatrixAbGroup using the SIP module _ (G' : AbGroup ℓ) where open AbGroupStr (snd G') private G = ⟨ G' ⟩ zeroVecMatrix : ∀ {m n} → VecMatrix G m n zeroVecMatrix = replicate (replicate 0g) negVecMatrix : ∀ {m n} → VecMatrix G m n → VecMatrix G m n negVecMatrix = map (map (λ x → - x)) addVec : ∀ {m} → Vec G m → Vec G m → Vec G m addVec [] [] = [] addVec (x ∷ xs) (y ∷ ys) = x + y ∷ addVec xs ys addVecMatrix : ∀ {m n} → VecMatrix G m n → VecMatrix G m n → VecMatrix G m n addVecMatrix [] [] = [] addVecMatrix (M ∷ MS) (N ∷ NS) = addVec M N ∷ addVecMatrix MS NS open FinMatrixAbGroup -- Proof that FinMatrix→VecMatrix is a group homorphism FinMatrix→VecMatrixHomAdd : (m n : ℕ) (M N : FinMatrix G m n) → FinMatrix→VecMatrix (addFinMatrix G' M N) ≡ addVecMatrix (FinMatrix→VecMatrix M) (FinMatrix→VecMatrix N) FinMatrix→VecMatrixHomAdd zero n M N = refl FinMatrix→VecMatrixHomAdd (suc m) n M N = λ i → lem n (M zero) (N zero) i ∷ FinMatrix→VecMatrixHomAdd m n (λ i j → M (suc i) j) (λ i j → N (suc i) j) i where lem : (n : ℕ) (V W : FinVec G n) → FinVec→Vec (λ j → V j + W j) ≡ addVec (FinVec→Vec V) (FinVec→Vec W) lem zero V W = refl lem (suc n) V W = λ i → V zero + W zero ∷ lem n (V ∘ suc) (W ∘ suc) i -- Combine everything to get an induced abelian group structure of -- VecMatrix that is equal to the one on FinMatrix VecMatrixAbGroup : (m n : ℕ) → AbGroup ℓ VecMatrixAbGroup m n = InducedAbGroup (FinMatrixAbGroup G' m n) addVecMatrix FinMatrix≃VecMatrix (FinMatrix→VecMatrixHomAdd m n) FinMatrixAbGroup≡VecMatrixAbGroup : (m n : ℕ) → FinMatrixAbGroup G' m n ≡ VecMatrixAbGroup m n FinMatrixAbGroup≡VecMatrixAbGroup m n = InducedAbGroupPath (FinMatrixAbGroup G' m n) addVecMatrix FinMatrix≃VecMatrix (FinMatrix→VecMatrixHomAdd m n) -- Define identity matrix and matrix multiplication for FinMatrix and -- prove that square matrices form a ring module _ (R' : Ring ℓ) where open RingStr (snd R') renaming ( is-set to isSetR ) open RingTheory R' open KroneckerDelta R' open Sum R' open FinMatrixAbGroup (_ , abgroupstr _ _ _ (snd R' .RingStr.+IsAbGroup)) private R = ⟨ R' ⟩ oneFinMatrix : ∀ {n} → FinMatrix R n n oneFinMatrix i j = δ i j mulFinMatrix : ∀ {m1 m2 m3} → FinMatrix R m1 m2 → FinMatrix R m2 m3 → FinMatrix R m1 m3 mulFinMatrix M N i k = ∑ λ j → M i j · N j k ∑Exchange : ∀ {m n} → (M : FinMatrix R m n) → ∑ (λ i → ∑ (λ j → M i j)) ≡ ∑ (λ j → ∑ (λ i → M i j)) ∑Exchange {m = zero} {n = n} M = sym (∑0r n) ∑Exchange {m = suc m} {n = zero} M = cong (λ x → 0r + x) (∑0r m) ∙ +Rid 0r ∑Exchange {m = suc m} {n = suc n} M = let a = M zero zero L = ∑ λ j → M zero (suc j) C = ∑ λ i → M (suc i) zero N = ∑ λ i → ∑ λ j → M (suc i) (suc j) -- N reindexed N' = ∑ λ j → ∑ λ i → M (suc i) (suc j) in a + L + ∑ (λ i → ∑ (λ j → M (suc i) j)) ≡⟨ (λ k → a + L + ∑Split (λ i → M (suc i) zero) (λ i → ∑ (λ j → M (suc i) (suc j))) k) ⟩ a + L + (C + N) ≡⟨ (λ k → a + L + (C + ∑Exchange (λ i j → M (suc i) (suc j)) k)) ⟩ a + L + (C + N') ≡⟨ sym (+Assoc _ _ _) ⟩ a + (L + (C + N')) ≡⟨ (λ k → a + +Assoc-comm1 L C N' k) ⟩ a + (C + (L + N')) ≡⟨ +Assoc _ _ _ ⟩ a + C + (L + N') ≡⟨ (λ k → a + C + ∑Split (λ j → M zero (suc j)) (λ j → ∑ (λ i → M (suc i) (suc j))) (~ k)) ⟩ a + C + ∑ (λ j → ∑ (λ i → M i (suc j))) ∎ mulFinMatrixAssoc : ∀ {m n k l} → (M : FinMatrix R m n) → (N : FinMatrix R n k) → (K : FinMatrix R k l) → mulFinMatrix M (mulFinMatrix N K) ≡ mulFinMatrix (mulFinMatrix M N) K mulFinMatrixAssoc M N K = funExt₂ λ i j → ∑ (λ k → M i k · ∑ (λ l → N k l · K l j)) ≡⟨ ∑Ext (λ k → ∑Mulrdist (M i k) (λ l → N k l · K l j)) ⟩ ∑ (λ k → ∑ (λ l → M i k · (N k l · K l j))) ≡⟨ ∑Ext (λ k → ∑Ext (λ l → ·Assoc (M i k) (N k l) (K l j))) ⟩ ∑ (λ k → ∑ (λ l → M i k · N k l · K l j)) ≡⟨ ∑Exchange (λ k l → M i k · N k l · K l j) ⟩ ∑ (λ l → ∑ (λ k → M i k · N k l · K l j)) ≡⟨ ∑Ext (λ l → sym (∑Mulldist (K l j) (λ k → M i k · N k l))) ⟩ ∑ (λ l → ∑ (λ k → M i k · N k l) · K l j) ∎ mulFinMatrixr1 : ∀ {m n} → (M : FinMatrix R m n) → mulFinMatrix M oneFinMatrix ≡ M mulFinMatrixr1 M = funExt₂ λ i j → ∑Mulr1 _ (M i) j mulFinMatrix1r : ∀ {m n} → (M : FinMatrix R m n) → mulFinMatrix oneFinMatrix M ≡ M mulFinMatrix1r M = funExt₂ λ i j → ∑Mul1r _ (λ x → M x j) i mulFinMatrixrDistrAddFinMatrix : ∀ {n} (M N K : FinMatrix R n n) → mulFinMatrix M (addFinMatrix N K) ≡ addFinMatrix (mulFinMatrix M N) (mulFinMatrix M K) mulFinMatrixrDistrAddFinMatrix M N K = funExt₂ λ i j → ∑ (λ k → M i k · (N k j + K k j)) ≡⟨ ∑Ext (λ k → ·Rdist+ (M i k) (N k j) (K k j)) ⟩ ∑ (λ k → M i k · N k j + M i k · K k j) ≡⟨ ∑Split (λ k → M i k · N k j) (λ k → M i k · K k j) ⟩ ∑ (λ k → M i k · N k j) + ∑ (λ k → M i k · K k j) ∎ mulFinMatrixlDistrAddFinMatrix : ∀ {n} (M N K : FinMatrix R n n) → mulFinMatrix (addFinMatrix M N) K ≡ addFinMatrix (mulFinMatrix M K) (mulFinMatrix N K) mulFinMatrixlDistrAddFinMatrix M N K = funExt₂ λ i j → ∑ (λ k → (M i k + N i k) · K k j) ≡⟨ ∑Ext (λ k → ·Ldist+ (M i k) (N i k) (K k j)) ⟩ ∑ (λ k → M i k · K k j + N i k · K k j) ≡⟨ ∑Split (λ k → M i k · K k j) (λ k → N i k · K k j) ⟩ ∑ (λ k → M i k · K k j) + ∑ (λ k → N i k · K k j) ∎ FinMatrixRing : (n : ℕ) → Ring ℓ FinMatrixRing n = makeRing {R = FinMatrix R n n} zeroFinMatrix oneFinMatrix addFinMatrix mulFinMatrix negFinMatrix isSetFinMatrix addFinMatrixAssoc addFinMatrix0r addFinMatrixNegMatrixr addFinMatrixComm mulFinMatrixAssoc mulFinMatrixr1 mulFinMatrix1r mulFinMatrixrDistrAddFinMatrix mulFinMatrixlDistrAddFinMatrix -- Generators of product of two ideals flatten : {n m : ℕ} → FinMatrix A n m → FinVec A (n ·ℕ m) flatten {n = zero} _ () flatten {n = suc n} M = M zero ++Fin flatten (M ∘ suc) flattenElim : {P : A → Type ℓ'} {n m : ℕ} (M : FinMatrix A n m) → (∀ i j → P (M i j)) → (∀ i → P (flatten M i)) flattenElim {n = zero} M PMHyp () flattenElim {n = suc n} {m = zero} M PMHyp ind = ⊥.rec (¬Fin0 (transport (λ i → Fin (0≡m·0 n (~ i))) ind)) flattenElim {n = suc n} {m = suc m} M PMHyp zero = PMHyp zero zero flattenElim {P = P} {n = suc n} {m = suc m} M PMHyp (suc i) = ++FinElim {P = P} (M zero ∘ suc) (flatten (M ∘ suc)) (PMHyp zero ∘ suc) (flattenElim {P = P} (M ∘ suc) (PMHyp ∘ suc)) i module ProdFin (R' : CommRing ℓ) where private R = fst R' open CommRingStr (snd R') renaming ( is-set to isSetR ) open CommRingTheory R' open RingTheory (CommRing→Ring R') open KroneckerDelta (CommRing→Ring R') open Sum (CommRing→Ring R') toMatrix : {n m : ℕ} → FinVec R n → FinVec R m → FinMatrix R n m toMatrix V W i j = V i · W j _··Fin_ : {n m : ℕ} → FinVec R n → FinVec R m → FinVec R (n ·ℕ m) V ··Fin W = flatten (toMatrix V W) Length1··Fin : ∀ (x y : R) → replicateFinVec 1 (x · y) ≡ (replicateFinVec 1 x) ··Fin (replicateFinVec 1 y) Length1··Fin x y = sym (++FinRid (replicateFinVec 1 (x · y)) _) ∑Dist··Fin : {n m : ℕ} (U : FinVec R n) (V : FinVec R m) → (∑ U) · (∑ V) ≡ ∑ (U ··Fin V) ∑Dist··Fin {n = zero} U V = 0LeftAnnihilates _ ∑Dist··Fin {n = suc n} U V = (U zero + ∑ (U ∘ suc)) · (∑ V) ≡⟨ ·Ldist+ _ _ _ ⟩ U zero · (∑ V) + (∑ (U ∘ suc)) · (∑ V) ≡⟨ cong₂ (_+_) (∑Mulrdist _ V) (∑Dist··Fin (U ∘ suc) V) ⟩ ∑ (λ j → U zero · V j) + ∑ ((U ∘ suc) ··Fin V) ≡⟨ sym (∑Split++ (λ j → U zero · V j) _) ⟩ ∑ ((λ j → U zero · V j) ++Fin ((U ∘ suc) ··Fin V)) ∎ ·Dist··Fin : {n m : ℕ} (α U : FinVec R n) (β V : FinVec R m) → ∀ j → ((λ i → α i · U i) ··Fin (λ i → β i · V i)) j ≡ (α ··Fin β) j · (U ··Fin V) j ·Dist··Fin {n = n} {m = m} α U β V = equivΠ e (equivHelper α U β V ) .fst λ _ → ·-commAssocSwap _ _ _ _ where e = (FinProdChar.Equiv n m) equivHelper : {n m : ℕ} (α U : FinVec R n) (β V : FinVec R m) (a : Fin n × Fin m) → (α (fst a) · U (fst a) · (β (snd a) · V (snd a)) ≡ α (fst a) · β (snd a) · (U (fst a) · V (snd a))) ≃ (((λ i → α i · U i) ··Fin (λ i → β i · V i)) (FinProdChar.Equiv n m .fst a) ≡ (α ··Fin β) (FinProdChar.Equiv n m .fst a) · (U ··Fin V) (FinProdChar.Equiv n m .fst a)) equivHelper {n = suc n} {m = suc m} α U β V (zero , zero) = idEquiv _ equivHelper {n = suc n} {m = suc m} α U β V (zero , suc j) = transport (λ 𝕚 → (α zero · U zero · (β (suc j) · V (suc j)) ≡ α zero · β (suc j) · (U zero · V (suc j))) ≃ (FinSumChar.++FinInl m (n ·ℕ suc m) (λ x → α zero · U zero · (β (suc x) · V (suc x))) (flatten (λ x y → α (suc x) · U (suc x) · (β y · V y))) j 𝕚 ≡ (FinSumChar.++FinInl m (n ·ℕ suc m) (λ x → α zero · β (suc x)) (flatten (λ x y → α (suc x) · β y)) j 𝕚) · (FinSumChar.++FinInl m (n ·ℕ suc m) (λ x → U zero · V (suc x)) (flatten (λ x y → U (suc x) · V y)) j 𝕚))) (idEquiv _) equivHelper {n = suc n} {m = suc m} α U β V (suc i , j) = transport (λ 𝕚 → (α (suc i) · U (suc i) · (β j · V j) ≡ α (suc i) · β j · (U (suc i) · V j)) ≃ (FinSumChar.++FinInr m (n ·ℕ suc m) (λ x → α zero · U zero · (β (suc x) · V (suc x))) (flatten (λ x y → α (suc x) · U (suc x) · (β y · V y))) (FinProdChar.Equiv n (suc m) .fst (i , j)) 𝕚 ≡ (FinSumChar.++FinInr m (n ·ℕ suc m) (λ x → α zero · β (suc x)) (flatten (λ x y → α (suc x) · β y)) (FinProdChar.Equiv n (suc m) .fst (i , j)) 𝕚) · (FinSumChar.++FinInr m (n ·ℕ suc m) (λ x → U zero · V (suc x)) (flatten (λ x y → U (suc x) · V y)) (FinProdChar.Equiv n (suc m) .fst (i , j)) 𝕚))) (equivHelper (α ∘ suc) (U ∘ suc) β V _)
src/apsepp-test_event_class.ads
thierr26/ada-apsepp
0
19778
<filename>src/apsepp-test_event_class.ads<gh_stars>0 -- Copyright (C) 2019 <NAME> <<EMAIL>> -- MIT license. Please refer to the LICENSE file. with Ada.Exceptions; use Ada.Exceptions; with Ada.Calendar; use Ada.Calendar; with Ada.Tags; use Ada.Tags; with Apsepp.Calendar; use Apsepp.Calendar; with Apsepp.Test_Node_Class; use Apsepp.Test_Node_Class; package Apsepp.Test_Event_Class is -- Evaluate the pre-conditions and class-wide pre-conditions in this -- package. pragma Assertion_Policy (Pre'Class => Check); type Test_Event_Data is record E : Exception_Occurrence_Access; Date : Time := Time_First; Previous_Child_Tag : Tag; R_Index : Test_Routine_Index := Test_Routine_Index'First; Assert_Num : Test_Assert_Count := Test_Assert_Count'First; end record; type Test_Event_Base is abstract tagged private with Type_Invariant'Class => not (Test_Event_Base.Has_R_Index and then Test_Event_Base.Has_Last_Cancelled_R_Index); type Test_Event_Access is access Test_Event_Base'Class; not overriding procedure Set (Obj : in out Test_Event_Base; Data : Test_Event_Data) is null; not overriding procedure Clean_Up (Obj : in out Test_Event_Base) is null; not overriding function Is_Node_Run_Final_Event (Obj : Test_Event_Base) return Boolean is (False); not overriding function Exception_Access (Obj : Test_Event_Base) return Exception_Occurrence_Access is (null); not overriding procedure Free_Exception (Obj : in out Test_Event_Base) is null; not overriding function Has_Timestamp (Obj : Test_Event_Base) return Boolean is (False); not overriding function Timestamp (Obj : Test_Event_Base) return Time is (Time_First) with Pre'Class => Test_Event_Base'Class (Obj).Has_Timestamp; not overriding procedure Set_Timestamp (Obj : in out Test_Event_Base; Date : Time := Clock) is null with Pre'Class => Test_Event_Base'Class (Obj).Has_Timestamp; not overriding function Has_Previous_Child_Tag (Obj : Test_Event_Base) return Boolean is (False); not overriding function Previous_Child_Tag (Obj : Test_Event_Base) return Tag is (No_Tag) with Pre'Class => Test_Event_Base'Class (Obj).Has_Previous_Child_Tag; not overriding function Has_R_Index (Obj : Test_Event_Base) return Boolean is (False); not overriding function R_Index (Obj : Test_Event_Base) return Test_Routine_Index is (Test_Routine_Index'First) with Pre'Class => Test_Event_Base'Class (Obj).Has_R_Index; not overriding function Has_Last_Cancelled_R_Index (Obj : Test_Event_Base) return Boolean is (False); not overriding function Last_Cancelled_R_Index (Obj : Test_Event_Base) return Test_Routine_Index is (Test_Routine_Index'First) with Pre'Class => Test_Event_Base'Class (Obj).Has_Last_Cancelled_R_Index; not overriding function Has_Assert_Num (Obj : Test_Event_Base) return Boolean is (False); not overriding function Assert_Num (Obj : Test_Event_Base) return Test_Assert_Count is (Test_Assert_Count'First) with Pre'Class => Test_Event_Base'Class (Obj).Has_Assert_Num; ---------------------------------------------------------------------------- type Test_Event is abstract new Test_Event_Base with private; overriding function Is_Node_Run_Final_Event (Obj : Test_Event) return Boolean is (False) with Post'Class => not Is_Node_Run_Final_Event'Result; ---------------------------------------------------------------------------- type Test_Event_Final is abstract new Test_Event_Base with private; overriding function Is_Node_Run_Final_Event (Obj : Test_Event_Final) return Boolean is (True) with Post'Class => Is_Node_Run_Final_Event'Result; ---------------------------------------------------------------------------- private type Test_Event_Base is abstract tagged null record; type Test_Event is abstract new Test_Event_Base with null record; type Test_Event_Final is abstract new Test_Event_Base with null record; end Apsepp.Test_Event_Class;
z80/game.asm
qccoders/TicTacToe
4
20132
NewGame: ld a,0 call FillBoard ld ix,GameState ld (ix+0),0 ld (ix+1),0 ld (ix+2),0 call PlayGame ld hl,PlayAgain call Println ld hl,Choice call Readln ld ix,NoString call StringEqual cp 1 ret z jr NewGame ;in: hl, the address of userput ;out: a = 0,1,2 for the first row or column found, 9 if there's a problem NextInNum: ld a,(hl) cp 0 jr z,endofstring sub 30h jp m,outofbounds ld a,(hl) sub 33h jp p,outofbounds ld a,(hl) inc hl sub 30h ret outofbounds: inc hl jr NextInNum endofstring: ld a,9 ret GetAssertion: ld hl,UserInput call NextInNum cp 9 jr z,gotanine ld b,a ld c,3 call multiply ld ix,GameState ld (ix+2),a ld a,(hl) call NextInNum cp 9 jr z,gotanine add a,(ix+2) ld (ix+2),a ret gotanine: ld a,9 ld (ix+2),a ret ;out : a, a random cell PickAnyCell: push de call random ld d,a ld e,9 call div_d_e pop de ret C_omputerTurn: push bc push hl compmove: ld hl,Board call PickAnyCell ld b,a compnextcell: inc hl djnz compnextcell dec hl compcellfound ld a,(hl) cp 0 jr nz,compmove ld (hl),2 pop hl pop bc ret ;out a, 1 for success, 0 for fail HumanTurn: push bc push ix ld ix,GameState call GetAssertion ld a,(ix+2) cp 9 jr z,bad ld b,a ld hl,Board movetocell: ld a,b cp 0 jr z,foundcell inc hl dec b jr movetocell foundcell: ld a,(hl) cp 0 jr nz,alreadytaken ld (hl),1 ld (ix+2),0 jr turnover alreadytaken: ld (ix+2),1 jp turnover bad: ld (ix+2),2 turnover: ld a,(ix+2) pop ix pop bc ret PlayGame: call PrintBoard ld ix,GameState ld (ix+0),0 ld (ix+1),1 ld (ix+2),0 ld hl,UserInput call Readln ld ix,QuitString call StringEqual cp 1 jr z,Quit call HumanTurn cp 0 jr z,keepgoing jr PlayGame keepgoing: call FindWinner cp 0 jr nz,Quit ld ix,GameState ld (ix+1),2 call C_omputerTurn call FindWinner cp 0 jr nz,Quit jr PlayGame Quit: ld ix,GameState ld (ix+0),1 call PrintBoard ret ;GameState[0] - game over? ;GameState[1] - whose turn it is (or winner, if game over) ;GameState[2] - attempted move GameState: defs 3 UserInput: defs 32 YourTurn: defm 'Enter your choice in the format ' defb 27H defm 'x,y' defb 27H defm ' (zero based, left to right, top to bottom):' Choice: defb 0 PlayAgain: defm 'Do you want to play again (y/n)?' defb 0 QuitString: defm 'q' defb 0 NoString: defm 'n' defb 0
PRG/objects/5-2Under.asm
narfman0/smb3_pp1
0
96278
.byte $01 ; Unknown purpose .byte OBJ_GREENTROOPA, $0F, $10 .byte OBJ_GREENTROOPA, $07, $10 .byte OBJ_GREENTROOPA, $0E, $20 .byte $FF ; Terminator
tools-src/gnu/gcc/gcc/ada/5otaprop.adb
enfoTek/tomato.linksys.e2000.nvram-mod
80
2660
------------------------------------------------------------------------------ -- -- -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . T A S K _ P R I M I T I V E S . O P E R A T I O N S -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1991-2001 Florida State University -- -- -- -- GNARL 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. GNARL 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 GNARL; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. It is -- -- now maintained by Ada Core Technologies Inc. in cooperation with Florida -- -- State University (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ -- This is an OS/2 version of this package -- This package contains all the GNULL primitives that interface directly -- with the underlying OS. pragma Polling (Off); -- Turn off polling, we do not want ATC polling to take place during -- tasking operations. It causes infinite loops and other problems. with System.Tasking.Debug; -- used for Known_Tasks with Interfaces.C; -- used for size_t with Interfaces.C.Strings; -- used for Null_Ptr with Interfaces.OS2Lib.Errors; with Interfaces.OS2Lib.Threads; with Interfaces.OS2Lib.Synchronization; with System.Parameters; -- used for Size_Type with System.Tasking; -- used for Task_ID with System.Parameters; -- used for Size_Type with System.Soft_Links; -- used for Defer/Undefer_Abort -- Note that we do not use System.Tasking.Initialization directly since -- this is a higher level package that we shouldn't depend on. For example -- when using the restricted run time, it is replaced by -- System.Tasking.Restricted.Initialization with System.OS_Primitives; -- used for Delay_Modes -- Clock with Unchecked_Conversion; with Unchecked_Deallocation; package body System.Task_Primitives.Operations is package IC renames Interfaces.C; package ICS renames Interfaces.C.Strings; package OSP renames System.OS_Primitives; package SSL renames System.Soft_Links; use Interfaces.OS2Lib; use Interfaces.OS2Lib.Errors; use Interfaces.OS2Lib.Threads; use Interfaces.OS2Lib.Synchronization; use System.Tasking.Debug; use System.Tasking; use System.OS_Interface; use Interfaces.C; use System.OS_Primitives; ---------------------- -- Local Constants -- ---------------------- Max_Locks_Per_Task : constant := 100; Suppress_Owner_Check : constant Boolean := False; ------------------ -- Local Types -- ------------------ type Microseconds is new IC.long; subtype Lock_Range is Integer range 0 .. Max_Locks_Per_Task; ------------------ -- Local Data -- ------------------ -- The OS/2 DosAllocThreadLocalMemory API is used to allocate our TCB_Ptr. -- This API reserves a small range of virtual addresses that is backed -- by different physical memory for each running thread. In this case we -- create a pointer at a fixed address that points to the TCB_Ptr for the -- running thread. So all threads will be able to query and update their -- own TCB_Ptr without destroying the TCB_Ptr of other threads. type Thread_Local_Data is record Self_ID : Task_ID; -- ID of the current thread Lock_Prio_Level : Lock_Range; -- Nr of priority changes due to locks -- ... room for expansion here, if we decide to make access to -- jump-buffer and exception stack more efficient in future end record; type Access_Thread_Local_Data is access all Thread_Local_Data; -- Pointer to Thread Local Data Thread_Local_Data_Ptr : aliased Access_Thread_Local_Data; type PPTLD is access all Access_Thread_Local_Data; All_Tasks_L : aliased System.Task_Primitives.RTS_Lock; -- See comments on locking rules in System.Tasking (spec). Environment_Task_ID : Task_ID; -- A variable to hold Task_ID for the environment task. ----------------------- -- Local Subprograms -- ----------------------- function To_PPVOID is new Unchecked_Conversion (PPTLD, PPVOID); function To_Address is new Unchecked_Conversion (Task_ID, System.Address); function To_PFNTHREAD is new Unchecked_Conversion (System.Address, PFNTHREAD); function To_MS (D : Duration) return ULONG; procedure Set_Temporary_Priority (T : in Task_ID; New_Priority : in System.Any_Priority); ----------- -- To_MS -- ----------- function To_MS (D : Duration) return ULONG is begin return ULONG (D * 1_000); end To_MS; ----------- -- Clock -- ----------- function Monotonic_Clock return Duration renames OSP.Monotonic_Clock; ------------------- -- RT_Resolution -- ------------------- function RT_Resolution return Duration is begin return 10#1.0#E-6; end RT_Resolution; ------------------- -- Abort_Handler -- ------------------- -- OS/2 only has limited support for asynchronous signals. -- It seems not to be possible to jump out of an exception -- handler or to change the execution context of the thread. -- So asynchonous transfer of control is not supported. ------------------- -- Stack_Guard -- ------------------- -- The underlying thread system sets a guard page at the -- bottom of a thread stack, so nothing is needed. -- ??? Check the comment above procedure Stack_Guard (T : ST.Task_ID; On : Boolean) is begin null; end Stack_Guard; -------------------- -- Get_Thread_Id -- -------------------- function Get_Thread_Id (T : ST.Task_ID) return OSI.Thread_Id is begin return OSI.Thread_Id (T.Common.LL.Thread); end Get_Thread_Id; ---------- -- Self -- ---------- function Self return Task_ID is Self_ID : Task_ID renames Thread_Local_Data_Ptr.Self_ID; begin -- Check that the thread local data has been initialized. pragma Assert ((Thread_Local_Data_Ptr /= null and then Thread_Local_Data_Ptr.Self_ID /= null)); return Self_ID; end Self; --------------------- -- Initialize_Lock -- --------------------- procedure Initialize_Lock (Prio : System.Any_Priority; L : access Lock) is begin if DosCreateMutexSem (ICS.Null_Ptr, L.Mutex'Unchecked_Access, 0, False32) /= NO_ERROR then raise Storage_Error; end if; pragma Assert (L.Mutex /= 0, "Error creating Mutex"); L.Priority := Prio; L.Owner_ID := Null_Address; end Initialize_Lock; procedure Initialize_Lock (L : access RTS_Lock; Level : Lock_Level) is begin if DosCreateMutexSem (ICS.Null_Ptr, L.Mutex'Unchecked_Access, 0, False32) /= NO_ERROR then raise Storage_Error; end if; pragma Assert (L.Mutex /= 0, "Error creating Mutex"); L.Priority := System.Any_Priority'Last; L.Owner_ID := Null_Address; end Initialize_Lock; ------------------- -- Finalize_Lock -- ------------------- procedure Finalize_Lock (L : access Lock) is begin Must_Not_Fail (DosCloseMutexSem (L.Mutex)); end Finalize_Lock; procedure Finalize_Lock (L : access RTS_Lock) is begin Must_Not_Fail (DosCloseMutexSem (L.Mutex)); end Finalize_Lock; ---------------- -- Write_Lock -- ---------------- procedure Write_Lock (L : access Lock; Ceiling_Violation : out Boolean) is Self_ID : constant Task_ID := Thread_Local_Data_Ptr.Self_ID; Old_Priority : constant Any_Priority := Self_ID.Common.LL.Current_Priority; begin if L.Priority < Old_Priority then Ceiling_Violation := True; return; end if; Ceiling_Violation := False; -- Increase priority before getting the lock -- to prevent priority inversion Thread_Local_Data_Ptr.Lock_Prio_Level := Thread_Local_Data_Ptr.Lock_Prio_Level + 1; if L.Priority > Old_Priority then Set_Temporary_Priority (Self_ID, L.Priority); end if; -- Request the lock and then update the lock owner data Must_Not_Fail (DosRequestMutexSem (L.Mutex, SEM_INDEFINITE_WAIT)); L.Owner_Priority := Old_Priority; L.Owner_ID := Self_ID.all'Address; end Write_Lock; procedure Write_Lock (L : access RTS_Lock) is Self_ID : constant Task_ID := Thread_Local_Data_Ptr.Self_ID; Old_Priority : constant Any_Priority := Self_ID.Common.LL.Current_Priority; begin -- Increase priority before getting the lock -- to prevent priority inversion Thread_Local_Data_Ptr.Lock_Prio_Level := Thread_Local_Data_Ptr.Lock_Prio_Level + 1; if L.Priority > Old_Priority then Set_Temporary_Priority (Self_ID, L.Priority); end if; -- Request the lock and then update the lock owner data Must_Not_Fail (DosRequestMutexSem (L.Mutex, SEM_INDEFINITE_WAIT)); L.Owner_Priority := Old_Priority; L.Owner_ID := Self_ID.all'Address; end Write_Lock; procedure Write_Lock (T : Task_ID) is begin -- Request the lock and then update the lock owner data Must_Not_Fail (DosRequestMutexSem (T.Common.LL.L.Mutex, SEM_INDEFINITE_WAIT)); T.Common.LL.L.Owner_ID := Null_Address; end Write_Lock; --------------- -- Read_Lock -- --------------- procedure Read_Lock (L : access Lock; Ceiling_Violation : out Boolean) renames Write_Lock; ------------ -- Unlock -- ------------ procedure Unlock (L : access Lock) is Self_ID : constant Task_ID := Thread_Local_Data_Ptr.Self_ID; Old_Priority : constant Any_Priority := L.Owner_Priority; begin -- Check that this task holds the lock pragma Assert (Suppress_Owner_Check or else L.Owner_ID = Self_ID.all'Address); -- Upate the owner data L.Owner_ID := Null_Address; -- Do the actual unlocking. No more references -- to owner data of L after this point. Must_Not_Fail (DosReleaseMutexSem (L.Mutex)); -- Reset priority after unlocking to avoid priority inversion Thread_Local_Data_Ptr.Lock_Prio_Level := Thread_Local_Data_Ptr.Lock_Prio_Level - 1; if L.Priority /= Old_Priority then Set_Temporary_Priority (Self_ID, Old_Priority); end if; end Unlock; procedure Unlock (L : access RTS_Lock) is Self_ID : constant Task_ID := Thread_Local_Data_Ptr.Self_ID; Old_Priority : constant Any_Priority := L.Owner_Priority; begin -- Check that this task holds the lock pragma Assert (Suppress_Owner_Check or else L.Owner_ID = Self_ID.all'Address); -- Upate the owner data L.Owner_ID := Null_Address; -- Do the actual unlocking. No more references -- to owner data of L after this point. Must_Not_Fail (DosReleaseMutexSem (L.Mutex)); -- Reset priority after unlocking to avoid priority inversion Thread_Local_Data_Ptr.Lock_Prio_Level := Thread_Local_Data_Ptr.Lock_Prio_Level - 1; if L.Priority /= Old_Priority then Set_Temporary_Priority (Self_ID, Old_Priority); end if; end Unlock; procedure Unlock (T : Task_ID) is begin -- Check the owner data pragma Assert (Suppress_Owner_Check or else T.Common.LL.L.Owner_ID = Null_Address); -- Do the actual unlocking. No more references -- to owner data of T.Common.LL.L after this point. Must_Not_Fail (DosReleaseMutexSem (T.Common.LL.L.Mutex)); end Unlock; ----------- -- Sleep -- ----------- procedure Sleep (Self_ID : Task_ID; Reason : System.Tasking.Task_States) is Count : aliased ULONG; -- Used to store dummy result begin -- Must reset Cond BEFORE L is unlocked. Sem_Must_Not_Fail (DosResetEventSem (Self_ID.Common.LL.CV, Count'Unchecked_Access)); Unlock (Self_ID); -- No problem if we are interrupted here. -- If the condition is signaled, DosWaitEventSem will simply not block. Sem_Must_Not_Fail (DosWaitEventSem (Self_ID.Common.LL.CV, SEM_INDEFINITE_WAIT)); -- Since L was previously accquired, lock operation should not fail. Write_Lock (Self_ID); end Sleep; ----------------- -- Timed_Sleep -- ----------------- -- This is for use within the run-time system, so abort is -- assumed to be already deferred, and the caller should be -- holding its own ATCB lock. -- Pre-assertion: Cond is posted -- Self is locked. -- Post-assertion: Cond is posted -- Self is locked. procedure Timed_Sleep (Self_ID : Task_ID; Time : Duration; Mode : ST.Delay_Modes; Reason : System.Tasking.Task_States; Timedout : out Boolean; Yielded : out Boolean) is Check_Time : constant Duration := OSP.Monotonic_Clock; Rel_Time : Duration; Abs_Time : Duration; Time_Out : ULONG; Result : APIRET; Count : aliased ULONG; -- Used to store dummy result begin -- Must reset Cond BEFORE Self_ID is unlocked. Sem_Must_Not_Fail (DosResetEventSem (Self_ID.Common.LL.CV, Count'Unchecked_Access)); Unlock (Self_ID); Timedout := True; Yielded := False; if Mode = Relative then Rel_Time := Time; Abs_Time := Duration'Min (Time, Max_Sensible_Delay) + Check_Time; else Rel_Time := Time - Check_Time; Abs_Time := Time; end if; if Rel_Time > 0.0 then loop exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level or else Self_ID.Pending_Priority_Change; Time_Out := To_MS (Rel_Time); Result := DosWaitEventSem (Self_ID.Common.LL.CV, Time_Out); pragma Assert ((Result = NO_ERROR or Result = ERROR_TIMEOUT or Result = ERROR_INTERRUPT)); -- ??? -- What to do with error condition ERROR_NOT_ENOUGH_MEMORY? Can -- we raise an exception here? And what about ERROR_INTERRUPT? -- Should that be treated as a simple timeout? -- For now, consider only ERROR_TIMEOUT to be a timeout. exit when Abs_Time <= OSP.Monotonic_Clock; if Result /= ERROR_TIMEOUT then -- somebody may have called Wakeup for us Timedout := False; exit; end if; Rel_Time := Abs_Time - OSP.Monotonic_Clock; end loop; end if; -- Ensure post-condition Write_Lock (Self_ID); if Timedout then Sem_Must_Not_Fail (DosPostEventSem (Self_ID.Common.LL.CV)); end if; end Timed_Sleep; ----------------- -- Timed_Delay -- ----------------- procedure Timed_Delay (Self_ID : Task_ID; Time : Duration; Mode : ST.Delay_Modes) is Check_Time : constant Duration := OSP.Monotonic_Clock; Rel_Time : Duration; Abs_Time : Duration; Timedout : Boolean := True; Time_Out : ULONG; Result : APIRET; Count : aliased ULONG; -- Used to store dummy result begin -- Only the little window between deferring abort and -- locking Self_ID is the reason we need to -- check for pending abort and priority change below! :( SSL.Abort_Defer.all; Write_Lock (Self_ID); -- Must reset Cond BEFORE Self_ID is unlocked. Sem_Must_Not_Fail (DosResetEventSem (Self_ID.Common.LL.CV, Count'Unchecked_Access)); Unlock (Self_ID); if Mode = Relative then Rel_Time := Time; Abs_Time := Time + Check_Time; else Rel_Time := Time - Check_Time; Abs_Time := Time; end if; if Rel_Time > 0.0 then Self_ID.Common.State := Delay_Sleep; loop if Self_ID.Pending_Priority_Change then Self_ID.Pending_Priority_Change := False; Self_ID.Common.Base_Priority := Self_ID.New_Base_Priority; Set_Priority (Self_ID, Self_ID.Common.Base_Priority); end if; exit when Self_ID.Pending_ATC_Level < Self_ID.ATC_Nesting_Level; Time_Out := To_MS (Rel_Time); Result := DosWaitEventSem (Self_ID.Common.LL.CV, Time_Out); exit when Abs_Time <= OSP.Monotonic_Clock; Rel_Time := Abs_Time - OSP.Monotonic_Clock; end loop; Self_ID.Common.State := Runnable; Timedout := Result = ERROR_TIMEOUT; end if; -- Ensure post-condition Write_Lock (Self_ID); if Timedout then Sem_Must_Not_Fail (DosPostEventSem (Self_ID.Common.LL.CV)); end if; Unlock (Self_ID); System.OS_Interface.Yield; SSL.Abort_Undefer.all; end Timed_Delay; ------------ -- Wakeup -- ------------ procedure Wakeup (T : Task_ID; Reason : System.Tasking.Task_States) is begin Sem_Must_Not_Fail (DosPostEventSem (T.Common.LL.CV)); end Wakeup; ----------- -- Yield -- ----------- procedure Yield (Do_Yield : Boolean := True) is begin if Do_Yield then System.OS_Interface.Yield; end if; end Yield; ---------------------------- -- Set_Temporary_Priority -- ---------------------------- procedure Set_Temporary_Priority (T : Task_ID; New_Priority : System.Any_Priority) is use Interfaces.C; Delta_Priority : Integer; begin -- When Lock_Prio_Level = 0, we always need to set the -- Active_Priority. In this way we can make priority changes -- due to locking independent of those caused by calling -- Set_Priority. if Thread_Local_Data_Ptr.Lock_Prio_Level = 0 or else New_Priority < T.Common.Current_Priority then Delta_Priority := T.Common.Current_Priority - T.Common.LL.Current_Priority; else Delta_Priority := New_Priority - T.Common.LL.Current_Priority; end if; if Delta_Priority /= 0 then -- ??? There is a race-condition here -- The TCB is updated before the system call to make -- pre-emption in the critical section less likely. T.Common.LL.Current_Priority := T.Common.LL.Current_Priority + Delta_Priority; Must_Not_Fail (DosSetPriority (Scope => PRTYS_THREAD, Class => PRTYC_NOCHANGE, Delta_P => IC.long (Delta_Priority), PorTid => T.Common.LL.Thread)); end if; end Set_Temporary_Priority; ------------------ -- Set_Priority -- ------------------ procedure Set_Priority (T : Task_ID; Prio : System.Any_Priority; Loss_Of_Inheritance : Boolean := False) is begin T.Common.Current_Priority := Prio; Set_Temporary_Priority (T, Prio); end Set_Priority; ------------------ -- Get_Priority -- ------------------ function Get_Priority (T : Task_ID) return System.Any_Priority is begin return T.Common.Current_Priority; end Get_Priority; ---------------- -- Enter_Task -- ---------------- procedure Enter_Task (Self_ID : Task_ID) is begin -- Initialize thread local data. Must be done first. Thread_Local_Data_Ptr.Self_ID := Self_ID; Thread_Local_Data_Ptr.Lock_Prio_Level := 0; Lock_All_Tasks_List; for I in Known_Tasks'Range loop if Known_Tasks (I) = null then Known_Tasks (I) := Self_ID; Self_ID.Known_Tasks_Index := I; exit; end if; end loop; Unlock_All_Tasks_List; -- For OS/2, we can set Self_ID.Common.LL.Thread in -- Create_Task, since the thread is created suspended. -- That is, there is no danger of the thread racing ahead -- and trying to reference Self_ID.Common.LL.Thread before it -- has been initialized. -- .... Do we need to do anything with signals for OS/2 ??? null; end Enter_Task; -------------- -- New_ATCB -- -------------- function New_ATCB (Entry_Num : Task_Entry_Index) return Task_ID is begin return new Ada_Task_Control_Block (Entry_Num); end New_ATCB; ---------------------- -- Initialize_TCB -- ---------------------- procedure Initialize_TCB (Self_ID : Task_ID; Succeeded : out Boolean) is begin if DosCreateEventSem (ICS.Null_Ptr, Self_ID.Common.LL.CV'Unchecked_Access, 0, True32) = NO_ERROR then if DosCreateMutexSem (ICS.Null_Ptr, Self_ID.Common.LL.L.Mutex'Unchecked_Access, 0, False32) /= NO_ERROR then Succeeded := False; Must_Not_Fail (DosCloseEventSem (Self_ID.Common.LL.CV)); else Succeeded := True; end if; pragma Assert (Self_ID.Common.LL.L.Mutex /= 0); -- We now want to do the equivalent of: -- Initialize_Lock -- (Self_ID.Common.LL.L'Unchecked_Access, ATCB_Level); -- But we avoid that because the Initialize_TCB routine has an -- exception handler, and it is too early for us to deal with -- installing handlers (see comment below), so we do our own -- Initialize_Lock operation manually. Self_ID.Common.LL.L.Priority := System.Any_Priority'Last; Self_ID.Common.LL.L.Owner_ID := Null_Address; else Succeeded := False; end if; -- Note: at one time we had anb exception handler here, whose code -- was as follows: -- exception -- Assumes any failure must be due to insufficient resources -- when Storage_Error => -- Must_Not_Fail (DosCloseEventSem (Self_ID.Common.LL.CV)); -- Succeeded := False; -- but that won't work with the old exception scheme, since it would -- result in messing with Jmpbuf values too early. If and when we get -- switched entirely to the new zero-cost exception scheme, we could -- put this handler back in! end Initialize_TCB; ----------------- -- Create_Task -- ----------------- procedure Create_Task (T : Task_ID; Wrapper : System.Address; Stack_Size : System.Parameters.Size_Type; Priority : System.Any_Priority; Succeeded : out Boolean) is Result : aliased APIRET; Adjusted_Stack_Size : System.Parameters.Size_Type; use System.Parameters; begin -- In OS/2 the allocated stack size should be based on the -- amount of address space that should be reserved for the stack. -- Actual memory will only be used when the stack is touched anyway. -- The new minimum size is 12 kB, although the EMX docs -- recommend a minimum size of 32 kB. (The original was 4 kB) -- Systems that use many tasks (say > 30) and require much -- memory may run out of virtual address space, since OS/2 -- has a per-process limit of 512 MB, of which max. 300 MB is -- usable in practise. if Stack_Size = Unspecified_Size then Adjusted_Stack_Size := Default_Stack_Size; elsif Stack_Size < Minimum_Stack_Size then Adjusted_Stack_Size := Minimum_Stack_Size; else Adjusted_Stack_Size := Stack_Size; end if; -- GB970222: -- Because DosCreateThread is called directly here, the -- C RTL doesn't get initialized for the new thead. EMX by -- default uses per-thread local heaps in addition to the -- global heap. There might be other effects of by-passing the -- C library here. -- When using _beginthread the newly created thread is not -- blocked initially. Does this matter or can I create the -- thread running anyway? The LL.Thread variable will be set -- anyway because the variable is passed by reference to OS/2. T.Common.LL.Wrapper := To_PFNTHREAD (Wrapper); -- The OS implicitly gives the new task the priority of this task. T.Common.LL.Current_Priority := Self.Common.LL.Current_Priority; -- If task was locked before activator task was -- initialized, assume it has OS standard priority if T.Common.LL.L.Owner_Priority not in Any_Priority'Range then T.Common.LL.L.Owner_Priority := 1; end if; -- Create the thread, in blocked mode Result := DosCreateThread (F_ptid => T.Common.LL.Thread'Unchecked_Access, pfn => T.Common.LL.Wrapper, param => To_Address (T), flag => Block_Child + Commit_Stack, cbStack => ULONG (Adjusted_Stack_Size)); Succeeded := (Result = NO_ERROR); if not Succeeded then return; end if; -- Set the new thread's priority -- (child has inherited priority from parent) Set_Priority (T, Priority); -- Start the thread executing Must_Not_Fail (DosResumeThread (T.Common.LL.Thread)); end Create_Task; ------------------ -- Finalize_TCB -- ------------------ procedure Finalize_TCB (T : Task_ID) is Tmp : Task_ID := T; procedure Free is new Unchecked_Deallocation (Ada_Task_Control_Block, Task_ID); begin Must_Not_Fail (DosCloseEventSem (T.Common.LL.CV)); Finalize_Lock (T.Common.LL.L'Unchecked_Access); if T.Known_Tasks_Index /= -1 then Known_Tasks (T.Known_Tasks_Index) := null; end if; Free (Tmp); end Finalize_TCB; --------------- -- Exit_Task -- --------------- procedure Exit_Task is begin DosExit (EXIT_THREAD, 0); -- Do not finalize TCB here. -- GNARL layer is responsible for that. end Exit_Task; ---------------- -- Abort_Task -- ---------------- procedure Abort_Task (T : Task_ID) is begin null; -- Task abortion not implemented yet. -- Should perform other action ??? end Abort_Task; ---------------- -- Check_Exit -- ---------------- -- Dummy versions. The only currently working versions is for solaris -- (native). function Check_Exit (Self_ID : ST.Task_ID) return Boolean is begin return Check_No_Locks (Self_ID); end Check_Exit; -------------------- -- Check_No_Locks -- -------------------- function Check_No_Locks (Self_ID : ST.Task_ID) return Boolean is TLD : constant Access_Thread_Local_Data := Thread_Local_Data_Ptr; begin return Self_ID = TLD.Self_ID and then TLD.Lock_Prio_Level = 0; end Check_No_Locks; ---------------------- -- Environment_Task -- ---------------------- function Environment_Task return Task_ID is begin return Environment_Task_ID; end Environment_Task; ------------------------- -- Lock_All_Tasks_List -- ------------------------- procedure Lock_All_Tasks_List is begin Write_Lock (All_Tasks_L'Access); end Lock_All_Tasks_List; --------------------------- -- Unlock_All_Tasks_List -- --------------------------- procedure Unlock_All_Tasks_List is begin Unlock (All_Tasks_L'Access); end Unlock_All_Tasks_List; ------------------ -- Suspend_Task -- ------------------ function Suspend_Task (T : ST.Task_ID; Thread_Self : Thread_Id) return Boolean is begin if Thread_Id (T.Common.LL.Thread) /= Thread_Self then return DosSuspendThread (T.Common.LL.Thread) = NO_ERROR; else return True; end if; end Suspend_Task; ----------------- -- Resume_Task -- ----------------- function Resume_Task (T : ST.Task_ID; Thread_Self : Thread_Id) return Boolean is begin if Thread_Id (T.Common.LL.Thread) /= Thread_Self then return DosResumeThread (T.Common.LL.Thread) = NO_ERROR; else return True; end if; end Resume_Task; ---------------- -- Initialize -- ---------------- procedure Initialize (Environment_Task : Task_ID) is Succeeded : Boolean; begin Environment_Task_ID := Environment_Task; Initialize_Lock (All_Tasks_L'Access, All_Tasks_Level); -- Initialize the lock used to synchronize chain of all ATCBs. -- Set ID of environment task. Thread_Local_Data_Ptr.Self_ID := Environment_Task; Environment_Task.Common.LL.Thread := 1; -- By definition -- This priority is unknown in fact. -- If actual current priority is different, -- it will get synchronized later on anyway. Environment_Task.Common.LL.Current_Priority := Environment_Task.Common.Current_Priority; -- Initialize TCB for this task. -- This includes all the normal task-external initialization. -- This is also done by Initialize_ATCB, why ??? Initialize_TCB (Environment_Task, Succeeded); -- Consider raising Storage_Error, -- if propagation can be tolerated ??? pragma Assert (Succeeded); -- Do normal task-internal initialization, -- which depends on an initialized TCB. Enter_Task (Environment_Task); -- Insert here any other special -- initialization needed for the environment task. end Initialize; begin -- Initialize pointer to task local data. -- This is done once, for all tasks. Must_Not_Fail (DosAllocThreadLocalMemory ((Thread_Local_Data'Size + 31) / 32, -- nr of 32-bit words To_PPVOID (Thread_Local_Data_Ptr'Access))); -- Initialize thread local data for main thread Thread_Local_Data_Ptr.Self_ID := null; Thread_Local_Data_Ptr.Lock_Prio_Level := 0; end System.Task_Primitives.Operations;
programs/oeis/117/A117188.asm
jmorken/loda
1
245728
; A117188: Expansion of (1-x^2)/(1+x^2+x^4). ; 1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0,1,0,1,0,-2,0 add $0,2 lpb $0 sub $0,1 gcd $0,6 sub $0,2 bin $3,$2 sub $0,$3 pow $2,2 sub $2,$3 lpe add $0,$2 mov $1,$0 sub $1,1
testsuite/ubivm/output/expr_real_9.asm
alexgarzao/UOP
0
81591
.constant_pool .const 0 string [start] .const 1 string [constructor] .const 2 string [2.0 - 1.0=] .const 3 real [2.000000] .const 4 real [1.000000] .const 5 int [2] .const 6 string [io.writeln] .const 7 string [2.0 * 7=] .const 8 int [7] .const 9 string [2.0 * 8.0 - 5.0=] .const 10 real [8.000000] .const 11 real [5.000000] .const 12 string [2.0 - 8.0 * 5.0=] .const 13 string [(2.0 - 8.0) * 5.0=] .const 14 string [(2.0 * (8.0 - 18.0 / 9.0 * (7.0 * 8.0 - 4.0 + 5.0 * 7.0) - 6.0) * (49.0 / 7.0 - 3.0))=] .const 15 real [18.000000] .const 16 real [9.000000] .const 17 real [7.000000] .const 18 real [4.000000] .const 19 real [6.000000] .const 20 real [49.000000] .const 21 real [3.000000] .end .entity start .valid_context_when (always) .method constructor ldconst 2 --> [2.0 - 1.0=] ldconst 3 --> [2.000000] ldconst 4 --> [1.000000] sub ldconst 5 --> [2] lcall 6 --> [io.writeln] ldconst 7 --> [2.0 * 7=] ldconst 5 --> [2] ldconst 8 --> [7] mul ldconst 5 --> [2] lcall 6 --> [io.writeln] ldconst 9 --> [2.0 * 8.0 - 5.0=] ldconst 3 --> [2.000000] ldconst 10 --> [8.000000] mul ldconst 11 --> [5.000000] sub ldconst 5 --> [2] lcall 6 --> [io.writeln] ldconst 12 --> [2.0 - 8.0 * 5.0=] ldconst 3 --> [2.000000] ldconst 10 --> [8.000000] ldconst 11 --> [5.000000] mul sub ldconst 5 --> [2] lcall 6 --> [io.writeln] ldconst 13 --> [(2.0 - 8.0) * 5.0=] ldconst 3 --> [2.000000] ldconst 10 --> [8.000000] sub ldconst 11 --> [5.000000] mul ldconst 5 --> [2] lcall 6 --> [io.writeln] ldconst 14 --> [(2.0 * (8.0 - 18.0 / 9.0 * (7.0 * 8.0 - 4.0 + 5.0 * 7.0) - 6.0) * (49.0 / 7.0 - 3.0))=] ldconst 3 --> [2.000000] ldconst 10 --> [8.000000] ldconst 15 --> [18.000000] ldconst 16 --> [9.000000] div ldconst 17 --> [7.000000] ldconst 10 --> [8.000000] mul ldconst 18 --> [4.000000] sub ldconst 11 --> [5.000000] ldconst 17 --> [7.000000] mul add mul sub ldconst 19 --> [6.000000] sub mul ldconst 20 --> [49.000000] ldconst 17 --> [7.000000] div ldconst 21 --> [3.000000] sub mul ldconst 5 --> [2] lcall 6 --> [io.writeln] exit .end .end
prototype/command-response/View.agda
stevana/haarss
1
182
module View where open import Data.Unit open import Data.Char open import Data.Maybe open import Data.Container.Indexed open import Signature open import Model open import IO.Primitive ------------------------------------------------------------------------ postulate view : Model → IO ⊤ data VtyEvent : Set where key : Char → VtyEvent enter : VtyEvent vtyToCmd : VtyEvent → (m : Mode) → Maybe (Command Hårss m) vtyToCmd (key 'j') cmd = just (moveP down) vtyToCmd (key 'k') cmd = just (moveP up) vtyToCmd (key 'a') cmd = just (promptP addFeed) vtyToCmd (key '\t') cmd = just (promptP search) vtyToCmd (key 'R') cmd = just fetchP vtyToCmd _ cmd = nothing vtyToCmd enter (input p) = just doneP vtyToCmd (key '\t') (input search) = just searchNextP vtyToCmd (key c) (input p) = just (putCharP c)
Build Tools/MacLand Script Builder.applescript
freegeek-pdx/macOS-Testing-and-Deployment-Scripts
0
3960
<gh_stars>0 -- -- MIT License -- -- Copyright (c) 2021 <NAME> -- -- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), -- to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -- and/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. -- use AppleScript version "2.7" use scripting additions set bundleIdentifierPrefix to "org.freegeek." try set infoPlistPath to ((POSIX path of (path to me)) & "Contents/Info.plist") ((infoPlistPath as POSIX file) as alias) set AppleScript's text item delimiters to "-" set correctBundleIdentifier to bundleIdentifierPrefix & ((words of (name of me)) as string) try set currentBundleIdentifier to ((do shell script "/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' " & (quoted form of infoPlistPath)) as string) if (currentBundleIdentifier is not equal to correctBundleIdentifier) then error "INCORRECT Bundle Identifier" on error do shell script "plutil -replace CFBundleIdentifier -string " & (quoted form of correctBundleIdentifier) & " " & (quoted form of infoPlistPath) try set currentCopyright to ((do shell script "/usr/libexec/PlistBuddy -c 'Print :NSHumanReadableCopyright' " & (quoted form of infoPlistPath)) as string) if (currentCopyright does not contain "Twemoji") then error "INCORRECT Copyright" on error do shell script "plutil -replace NSHumanReadableCopyright -string " & (quoted form of ("Copyright © " & (year of (current date)) & " Free Geek Designed and Developed by <NAME>")) & " " & (quoted form of infoPlistPath) end try try set minSystemVersion to ((do shell script "/usr/libexec/PlistBuddy -c 'Print :LSMinimumSystemVersion' " & (quoted form of infoPlistPath)) as string) if (minSystemVersion is not equal to "10.13") then error "INCORRECT Minimum System Version" on error do shell script "plutil -remove LSMinimumSystemVersionByArchitecture " & (quoted form of infoPlistPath) & "; plutil -replace LSMinimumSystemVersion -string '10.13' " & (quoted form of infoPlistPath) end try try set prohibitMultipleInstances to ((do shell script "/usr/libexec/PlistBuddy -c 'Print :LSMultipleInstancesProhibited' " & (quoted form of infoPlistPath)) as number) if (prohibitMultipleInstances is equal to 0) then error "INCORRECT Multiple Instances Prohibited" on error do shell script "plutil -replace LSMultipleInstancesProhibited -bool true " & (quoted form of infoPlistPath) end try try set allowMixedLocalizations to ((do shell script "/usr/libexec/PlistBuddy -c 'Print :CFBundleAllowMixedLocalizations' " & (quoted form of infoPlistPath)) as number) if (allowMixedLocalizations is equal to 1) then error "INCORRECT Localization" on error do shell script "plutil -replace CFBundleAllowMixedLocalizations -bool false " & (quoted form of infoPlistPath) & "; plutil -replace CFBundleDevelopmentRegion -string 'en_US' " & (quoted form of infoPlistPath) end try try set currentAppleEventsUsageDescription to ((do shell script "/usr/libexec/PlistBuddy -c 'Print :NSAppleEventsUsageDescription' " & (quoted form of infoPlistPath)) as string) if (currentAppleEventsUsageDescription does not contain (name of me)) then error "INCORRECT AppleEvents Usage Description" on error do shell script "plutil -replace NSAppleEventsUsageDescription -string " & (quoted form of ("You MUST click the “OK” button for “" & (name of me) & "” to be able to function.")) & " " & (quoted form of infoPlistPath) end try try set currentVersion to ((do shell script "/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' " & (quoted form of infoPlistPath)) as string) if (currentVersion is equal to "1.0") then error "INCORRECT Version" on error tell application "System Events" to set myCreationDate to (creation date of (path to me)) set shortCreationDateString to (short date string of myCreationDate) set AppleScript's text item delimiters to "/" set correctVersion to ((text item 3 of shortCreationDateString) & "." & (text item 1 of shortCreationDateString) & "." & (text item 2 of shortCreationDateString)) do shell script "plutil -remove CFBundleVersion " & (quoted form of infoPlistPath) & "; plutil -replace CFBundleShortVersionString -string " & (quoted form of correctVersion) & " " & (quoted form of infoPlistPath) end try do shell script "osascript -e 'delay 0.5' -e 'repeat while (application \"" & (POSIX path of (path to me)) & "\" is running)' -e 'delay 0.5' -e 'end repeat' -e 'try' -e 'do shell script \"chmod a-w \\\"" & ((POSIX path of (path to me)) & "Contents/Resources/Scripts/main.scpt") & "\\\"\"' -e 'do shell script \"codesign -s \\\"Developer ID Application\\\" --deep --force \\\"" & (POSIX path of (path to me)) & "\\\"\"' -e 'on error codeSignError' -e 'activate' -e 'display alert \"Code Sign Error\" message codeSignError' -e 'end try' -e 'do shell script \"open -n -a \\\"" & (POSIX path of (path to me)) & "\\\"\"' > /dev/null 2>&1 &" quit delay 10 end try end try global passwordCharacterShiftCount set bundleIdentifierPrefix to "org.freegeek." set currentYear to ((year of (current date)) as string) set shortCurrentDateString to (short date string of (current date)) repeat set buildResultsOutput to {} tell application "Finder" set parentFolder to (container of (path to me)) set fgPasswordsPlistPath to ((POSIX path of (parentFolder as alias)) & "Free Geek Passwords.plist") set adminPassword to "" try set adminPassword to (do shell script ("/usr/libexec/PlistBuddy -c 'Print :admin_password' " & (quoted form of fgPasswordsPlistPath)) as string) end try set wiFiPassword to "" try set wiFiPassword to (do shell script ("/usr/libexec/PlistBuddy -c 'Print :wifi_password' " & (quoted form of fgPasswordsPlistPath)) as string) end try if (adminPassword is equal to "") then set (end of buildResultsOutput) to "⚠️ FAILED TO RETRIEVE ADMINISTRATOR PASSWORD" set (end of buildResultsOutput) to "" else if (wiFiPassword is equal to "") then set (end of buildResultsOutput) to "⚠️ FAILED TO RETRIEVE WI-FI PASSWORD" set (end of buildResultsOutput) to "" else if ((name of parentFolder) is equal to "Build Tools") then set macLandFolder to (container of parentFolder) set zipsForAutoUpdateFolderPath to ((POSIX path of (macLandFolder as alias)) & "ZIPs for Auto-Update/") try do shell script "mkdir -p " & (quoted form of zipsForAutoUpdateFolderPath) end try set scriptTypeFolders to (get folders of macLandFolder) repeat with thisScriptTypeFolder in scriptTypeFolders if (((name of thisScriptTypeFolder) as string) is equal to "ZIPs for Auto-Update") then set latestVersionsFilePath to ((POSIX path of (thisScriptTypeFolder as alias)) & "latest-versions.txt") do shell script "rm -f " & (quoted form of latestVersionsFilePath) & "; touch " & (quoted form of latestVersionsFilePath) set zipFilesForAutoUpdate to (every file of thisScriptTypeFolder whose name extension is "zip") repeat with thisScriptZip in zipFilesForAutoUpdate if (((name of thisScriptZip) as string) is equal to "fgreset.zip") then do shell script ("ditto -x -k --noqtn " & (quoted form of (POSIX path of (thisScriptZip as alias))) & " ${TMPDIR}MacLand-Script-Builder-Versions/") set thisScriptVersionLine to (do shell script "grep -m 1 '# Version: ' ${TMPDIR}MacLand-Script-Builder-Versions/*.sh") if (thisScriptVersionLine contains "# Version: ") then do shell script "echo '" & (text 1 thru -5 of ((name of thisScriptZip) as string)) & ": " & ((text 12 thru -1 of thisScriptVersionLine) as string) & "' >> " & (quoted form of latestVersionsFilePath) end if do shell script "rm -f ${TMPDIR}MacLand-Script-Builder-Versions/*.sh" else do shell script "unzip -jo " & (quoted form of (POSIX path of (thisScriptZip as alias))) & " */Contents/Info.plist -d ${TMPDIR}MacLand-Script-Builder-Versions/" set thisAppName to (do shell script "/usr/libexec/PlistBuddy -c 'Print :CFBundleName' ${TMPDIR}MacLand-Script-Builder-Versions/Info.plist") set thisAppVersion to (do shell script "/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' ${TMPDIR}MacLand-Script-Builder-Versions/Info.plist") do shell script "echo '" & thisAppName & ": " & thisAppVersion & "' >> " & (quoted form of latestVersionsFilePath) end if end repeat do shell script "rm -rf ${TMPDIR}MacLand-Script-Builder-Versions/" else if ((((name of thisScriptTypeFolder) as string) is not equal to "Build Tools") and (((name of thisScriptTypeFolder) as string) is not equal to "fgMIB Resources")) then set scriptFoldersForThisScriptType to (get folders of thisScriptTypeFolder) repeat with thisScriptFolder in scriptFoldersForThisScriptType set thisScriptName to ((name of thisScriptFolder) as string) set thisScriptFolderPath to (POSIX path of (thisScriptFolder as alias)) set AppleScript's text item delimiters to "-" set thisScriptHyphenatedName to ((words of thisScriptName) as string) -- Only build if .app doesn't exit and Source folder does exist set thisScriptAppPath to (thisScriptFolderPath & thisScriptName & ".app") try ((thisScriptAppPath as POSIX file) as alias) set (end of buildResultsOutput) to "⏭ " & (name of thisScriptTypeFolder) & " > " & thisScriptName & " ALREADY BUILT" on error try set thisScriptSourcePath to (thisScriptFolderPath & "Source/" & thisScriptName & ".applescript") ((thisScriptSourcePath as POSIX file) as alias) do shell script "rm -f " & (quoted form of (thisScriptFolderPath & thisScriptHyphenatedName & ".zip")) & " " & (quoted form of (zipsForAutoUpdateFolderPath & thisScriptHyphenatedName & ".zip")) set thisScriptSource to (do shell script "cat " & (quoted form of thisScriptSourcePath) without altering line endings) -- VERY IMPORTANT to preserve "LF" line endings for multi-line "do shell script" commands within scripts to be able to work properly. set obfuscatedAdminPasswordPlaceholder to "\"[MACLAND SCRIPT BUILDER WILL REPLACE THIS PLACEHOLDER WITH OBFUSCATED ADMIN PASSWORD]\"" set obfuscatedWiFiPasswordPlaceholder to "\"[MACLAND SCRIPT BUILDER WILL REPLACE THIS PLACEHOLDER WITH OBFUSCATED WI-FI PASSWORD]\"" set addBuildRunOnlyArg to "" if (thisScriptSource contains "-- Build Flag: Run-Only" or (thisScriptSource contains obfuscatedAdminPasswordPlaceholder) or (thisScriptSource contains obfuscatedWiFiPasswordPlaceholder)) then set addBuildRunOnlyArg to " -x" if ((thisScriptSource contains obfuscatedAdminPasswordPlaceholder) or (thisScriptSource contains obfuscatedWiFiPasswordPlaceholder)) then set passwordCharacterShiftCount to (random number from 100000 to 999999) if (thisScriptSource contains obfuscatedAdminPasswordPlaceholder) then tell me to set obfuscatedAdminPassword to shiftString(adminPassword) set AppleScript's text item delimiters to obfuscatedAdminPasswordPlaceholder set thisScriptSourcePartsSplitAtObfuscatedAdminPasswordPlaceholder to (every text item of thisScriptSource) set AppleScript's text item delimiters to "x(\"" & obfuscatedAdminPassword & "\")" set thisScriptSource to (thisScriptSourcePartsSplitAtObfuscatedAdminPasswordPlaceholder as string) end if if (thisScriptSource contains obfuscatedWiFiPasswordPlaceholder) then tell me to set obfuscatedWiFiPassword to shiftString(wiFiPassword) set AppleScript's text item delimiters to obfuscatedWiFiPasswordPlaceholder set thisScriptSourcePartsSplitAtObfuscatedWiFiPasswordPlaceholder to (every text item of thisScriptSource) set AppleScript's text item delimiters to "x(\"" & obfuscatedWiFiPassword & "\")" set thisScriptSource to (thisScriptSourcePartsSplitAtObfuscatedWiFiPasswordPlaceholder as string) end if set thisScriptSource to thisScriptSource & " on x(s) set y to id of s as list repeat with c in y set contents of c to c - " & passwordCharacterShiftCount & " end repeat return string id y end x" end if end if set thisScriptAppBundleIdentifier to (bundleIdentifierPrefix & thisScriptHyphenatedName) try do shell script "osacompile" & addBuildRunOnlyArg & " -o " & (quoted form of thisScriptAppPath) & " -e " & (quoted form of thisScriptSource) try do shell script ("tccutil reset All " & (quoted form of ("com.apple.ScriptEditor.id" & thisScriptHyphenatedName))) -- If it was previously built with Script Editor end try set thisScriptAppInfoPlistPath to (thisScriptAppPath & "/Contents/Info.plist") try ((thisScriptAppInfoPlistPath as POSIX file) as alias) if (thisScriptSource contains "-- Build Flag: LSUIElement") then do shell script "plutil -replace LSUIElement -bool true " & (quoted form of thisScriptAppInfoPlistPath) end if do shell script (" plutil -remove LSMinimumSystemVersionByArchitecture " & (quoted form of thisScriptAppInfoPlistPath) & " plutil -replace LSMinimumSystemVersion -string '10.13' " & (quoted form of thisScriptAppInfoPlistPath) & " plutil -replace LSMultipleInstancesProhibited -bool true " & (quoted form of thisScriptAppInfoPlistPath) & " # These two are so that error text is always in English, so that I can trust and conditions which check errors. plutil -replace CFBundleAllowMixedLocalizations -bool false " & (quoted form of thisScriptAppInfoPlistPath) & " plutil -replace CFBundleDevelopmentRegion -string 'en_US' " & (quoted form of thisScriptAppInfoPlistPath) & " plutil -replace NSAppleEventsUsageDescription -string " & (quoted form of ("You MUST click the “OK” button for “" & thisScriptName & "” to be able to function.")) & " " & (quoted form of thisScriptAppInfoPlistPath)) if (thisScriptSource contains "-- Version: ") then set AppleScript's text item delimiters to "-- Version: " set thisScriptAppVersionPart to ((text item 2 of thisScriptSource) as string) set thisScriptAppVersion to ((first paragraph of thisScriptAppVersionPart) as string) do shell script "plutil -replace CFBundleShortVersionString -string " & (quoted form of thisScriptAppVersion) & " " & (quoted form of thisScriptAppInfoPlistPath) else do shell script "plutil -replace CFBundleShortVersionString -string " & (quoted form of (currentYear & "." & (word 1 of shortCurrentDateString) & "." & (word 2 of shortCurrentDateString))) & " " & (quoted form of thisScriptAppInfoPlistPath) end if do shell script (" mv " & (quoted form of (thisScriptAppPath & "/Contents/MacOS/applet")) & " " & (quoted form of (thisScriptAppPath & "/Contents/MacOS/" & thisScriptName)) & " plutil -replace CFBundleExecutable -string " & (quoted form of thisScriptName) & " " & (quoted form of thisScriptAppInfoPlistPath) & " mv " & (quoted form of (thisScriptAppPath & "/Contents/Resources/applet.rsrc")) & " " & (quoted form of (thisScriptAppPath & "/Contents/Resources/" & thisScriptName & ".rsrc")) & " rm -f " & (quoted form of (thisScriptAppPath & "/Contents/Resources/applet.icns")) & " ditto " & (quoted form of (thisScriptFolderPath & "Source/" & thisScriptName & " Icon/applet.icns")) & " " & (quoted form of (thisScriptAppPath & "/Contents/Resources/" & thisScriptName & ".icns")) & " plutil -replace CFBundleIconFile -string " & (quoted form of thisScriptName) & " " & (quoted form of thisScriptAppInfoPlistPath)) set thisScriptAppIconTwemojiAttribution to "" if (thisScriptSource contains "App Icon is “") then set AppleScript's text item delimiters to {"App Icon is “", "” from Twemoji"} set thisScriptAppIconEmojiName to ((text item 2 of thisScriptSource) as string) set thisScriptAppIconTwemojiAttribution to " App Icon is “" & thisScriptAppIconEmojiName & "” from Twemoji by Twitter licensed under CC-BY 4.0" end if do shell script (" plutil -replace NSHumanReadableCopyright -string " & (quoted form of ("Copyright © " & currentYear & " Free Geek Designed and Developed by <NAME>" & thisScriptAppIconTwemojiAttribution)) & " " & (quoted form of thisScriptAppInfoPlistPath) & " # Do CFBundleIdentifier SECOND TO LAST because each script checks that it was set properly or alerts that not built correctly. plutil -replace CFBundleIdentifier -string " & (quoted form of thisScriptAppBundleIdentifier) & " " & (quoted form of thisScriptAppInfoPlistPath) & " # Add custom FGBuiltByMacLandScriptBuilder key VERY LAST for scripts to check to alert if not built correctly. plutil -replace FGBuiltByMacLandScriptBuilder -bool true " & (quoted form of thisScriptAppInfoPlistPath) & " chmod a-w " & (quoted form of (thisScriptAppPath & "/Contents/Resources/Scripts/main.scpt"))) try (((thisScriptFolderPath & "Source/Resources/") as POSIX file) as alias) do shell script (" ditto " & (quoted form of (thisScriptFolderPath & "Source/Resources/")) & " " & (quoted form of (thisScriptAppPath & "/Contents/Resources/")) & " rm -f " & (quoted form of (thisScriptAppPath & "/Contents/Resources/.DS_Store"))) end try try do shell script (" # Required to make sure codesign works xattr -crs " & (quoted form of thisScriptAppPath) & " codesign -s 'Developer ID Application' --deep --force " & (quoted form of thisScriptAppPath) & " || exit 1 ditto -c -k --keepParent --sequesterRsrc --zlibCompressionLevel 9 " & (quoted form of thisScriptAppPath) & " " & (quoted form of (zipsForAutoUpdateFolderPath & thisScriptHyphenatedName & ".zip")) & " touch " & (quoted form of thisScriptAppPath)) on error codeSignError do shell script "rm -rf " & (quoted form of thisScriptAppPath) tell me activate display alert "Code Sign & ZIP “" & thisScriptName & "” Error" message codeSignError as critical end tell end try on error infoPlistError do shell script "rm -rf " & (quoted form of thisScriptAppPath) tell me activate display alert "“" & thisScriptName & "” Info Plist Error" message infoPlistError as critical end tell end try on error osaCompileError do shell script "rm -rf " & (quoted form of thisScriptAppPath) tell me activate display alert "Compile “" & thisScriptName & "” Error" message osaCompileError as critical end tell end try try do shell script (" tccutil reset All " & (quoted form of thisScriptAppBundleIdentifier) & " # If it was previously built with default Script Debugger tccutil reset All " & (quoted form of ("com.mycompany." & thisScriptHyphenatedName)) & " # If it was previously built with my Script Debugger tccutil reset All " & (quoted form of ("com.randomapplications." & thisScriptHyphenatedName))) end try try (((zipsForAutoUpdateFolderPath & thisScriptHyphenatedName & ".zip") as POSIX file) as alias) if (addBuildRunOnlyArg is not equal to "") then set (end of buildResultsOutput) to "✅🔒 " & (name of thisScriptTypeFolder) & " > BUILT " & thisScriptName & " (AS RUN-ONLY)" else set (end of buildResultsOutput) to "✅🛠 " & (name of thisScriptTypeFolder) & " > BUILT " & thisScriptName end if on error set (end of buildResultsOutput) to "⚠️ " & (name of thisScriptTypeFolder) & " > FAILED TO BUILD " & thisScriptName end try on error try set thisFGresetSourcePath to (thisScriptFolderPath & "fgreset.sh") ((thisFGresetSourcePath as POSIX file) as alias) do shell script (" xattr -c " & (quoted form of thisFGresetSourcePath) & " rm -rf ${TMPDIR}MacLand-Script-Builder-fgreset mkdir -p ${TMPDIR}MacLand-Script-Builder-fgreset # CANNOT directly edit shell script source strings in AppleScript (like we do with AppleScript source) since it messes up escaped characters for ANSI styles. So, we'll use 'sed' instead. # DO NOT pass the base64 string to 'base64 -D' using a here-string since that requires writing a temp file to the filesystem which will NOT be writable when the password is decoded. Use echo and pipe instead since piping does not write to the filesystem. sed \"s/'\\[MACLAND SCRIPT BUILDER WILL REPLACE THIS PLACEHOLDER WITH OBFUSCATED ADMIN PASSWORD\\]'/\\\"\\$(echo '$(/bin/echo -n " & (quoted form of adminPassword) & " | base64)' | base64 -D)\\\"/\" " & (quoted form of thisFGresetSourcePath) & " > ${TMPDIR}MacLand-Script-Builder-fgreset/fgreset.sh chmod +x ${TMPDIR}MacLand-Script-Builder-fgreset/fgreset.sh # DO NOT '--keepParent' WHEN DITTO ZIPPING A SINGLE FILE! ditto -c -k --sequesterRsrc --zlibCompressionLevel 9 ${TMPDIR}MacLand-Script-Builder-fgreset/fgreset.sh " & (quoted form of (zipsForAutoUpdateFolderPath & "fgreset.zip")) & " rm -rf ${TMPDIR}MacLand-Script-Builder-fgreset mkdir -p " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Prepare OS Package/Package Resources/Global/Scripts/")) & " rm -f " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Prepare OS Package/Package Resources/Global/Scripts/fgreset.zip")) & " ditto " & (quoted form of (zipsForAutoUpdateFolderPath & "fgreset.zip")) & " " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Prepare OS Package/Package Resources/Global/Scripts/"))) try (((zipsForAutoUpdateFolderPath & "fgreset.zip") as POSIX file) as alias) set (end of buildResultsOutput) to "📄 " & (name of thisScriptTypeFolder) & " > ZIPPED " & thisScriptName on error set (end of buildResultsOutput) to "⚠️ " & (name of thisScriptTypeFolder) & " > FAILED TO ZIP " & thisScriptName end try on error set (end of buildResultsOutput) to "❌ " & (name of thisScriptTypeFolder) & " > " & thisScriptName & " NOT APPLESCRIPT APP" end try end try end try if ((((name of thisScriptTypeFolder) as string) is equal to "Production Scripts") or (thisScriptName is equal to "Free Geek Updater")) then try (((zipsForAutoUpdateFolderPath & thisScriptHyphenatedName & ".zip") as POSIX file) as alias) if (thisScriptName is equal to "Free Geek Login Progress") then do shell script (" mkdir -p " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Install Packages Script/Tools/")) & " rm -f " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Install Packages Script/Tools/" & thisScriptHyphenatedName & ".zip")) & " ditto " & (quoted form of (zipsForAutoUpdateFolderPath & thisScriptHyphenatedName & ".zip")) & " " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Install Packages Script/Tools/")) & " mkdir -p " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Prepare OS Package/Package Resources/fg-error-occurred/Tools/")) & " rm -f " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Prepare OS Package/Package Resources/fg-error-occurred/Tools/" & thisScriptHyphenatedName & ".zip")) & " ditto " & (quoted form of (zipsForAutoUpdateFolderPath & thisScriptHyphenatedName & ".zip")) & " " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Prepare OS Package/Package Resources/fg-error-occurred/Tools/")) & " mkdir -p " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Prepare OS Package/Package Resources/fg-snapshot-reset/Tools/")) & " rm -f " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Prepare OS Package/Package Resources/fg-snapshot-reset/Tools/" & thisScriptHyphenatedName & ".zip")) & " ditto " & (quoted form of (zipsForAutoUpdateFolderPath & thisScriptHyphenatedName & ".zip")) & " " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Prepare OS Package/Package Resources/fg-snapshot-reset/Tools/"))) else if (thisScriptName does not start with "FGreset") then do shell script (" mkdir -p " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Prepare OS Package/Package Resources/User/fg-demo/Apps/")) & " rm -f " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Prepare OS Package/Package Resources/User/fg-demo/Apps/" & thisScriptHyphenatedName & ".zip")) & " ditto " & (quoted form of (zipsForAutoUpdateFolderPath & thisScriptHyphenatedName & ".zip")) & " " & (quoted form of ((POSIX path of (macLandFolder as alias)) & "fgMIB Resources/Prepare OS Package/Package Resources/User/fg-demo/Apps/"))) end if end try end if end repeat set (end of buildResultsOutput) to "" end if end repeat end if end tell activate set buildResultsOutputReply to (choose from list (items 1 thru -2 of buildResultsOutput) with prompt "MacLand Script Builder Results" OK button name "Quit" cancel button name "Build Again" with title "MacLand Script Builder" with empty selection allowed) if (buildResultsOutputReply is not equal to false) then exit repeat end if end repeat -- From: https://stackoverflow.com/questions/14612235/protecting-an-applescript-script/14616010#14616010 on shiftString(sourceString) set stringID to id of sourceString as list repeat with thisCharacter in stringID set contents of thisCharacter to thisCharacter + passwordCharacterShiftCount end repeat return string id stringID end shiftString
include/sf-config.ads
danva994/ASFML-1.6
1
13795
<filename>include/sf-config.ads<gh_stars>1-10 -- //////////////////////////////////////////////////////////// -- // -- // SFML - Simple and Fast Multimedia Library -- // Copyright (C) 2007-2009 <NAME> (<EMAIL>) -- // -- // This software is provided 'as-is', without any express or implied warranty. -- // In no event will the authors be held liable for any damages arising from the use of this software. -- // -- // Permission is granted to anyone to use this software for any purpose, -- // including commercial applications, and to alter it and redistribute it freely, -- // subject to the following restrictions: -- // -- // 1. The origin of this software must not be misrepresented; -- // you must not claim that you wrote the original software. -- // If you use this software in a product, an acknowledgment -- // in the product documentation would be appreciated but is not required. -- // -- // 2. Altered source versions must be plainly marked as such, -- // and must not be misrepresented as being the original software. -- // -- // 3. This notice may not be removed or altered from any source distribution. -- // -- //////////////////////////////////////////////////////////// package Sf.Config is -- //////////////////////////////////////////////////////////// -- // Define a portable boolean type -- //////////////////////////////////////////////////////////// subtype sfBool is Integer; sfFalse : constant sfBool := 0; sfTrue : constant sfBool := 1; -- //////////////////////////////////////////////////////////// -- // Define portable types -- //////////////////////////////////////////////////////////// -- // 8 bits integer types type sfInt8 is range -128 .. 127; for sfInt8'SIZE use 8; type sfInt8_Ptr is access all sfInt8; pragma Convention (C, sfInt8); pragma Convention (C, sfInt8_Ptr); type sfUint8 is mod 256; for sfUint8'SIZE use 8; type sfUint8_Ptr is access all sfUint8; pragma Convention (C, sfUint8); pragma Convention (C, sfUint8_Ptr); -- // 16 bits integer types type sfInt16 is new Short_Integer; type sfInt16_Ptr is access all sfInt16; pragma Convention (C, sfInt16); pragma Convention (C, sfInt16_Ptr); type sfUint16 is mod 2 ** sfInt16'SIZE; type sfUint16_Ptr is access all sfUint16; pragma Convention (C, sfUint16); pragma Convention (C, sfUint16_Ptr); -- // 32 bits integer types type sfInt32 is new Integer; type sfInt32_Ptr is access all sfInt32; pragma Convention (C, sfInt32); pragma Convention (C, sfInt32_Ptr); type sfUint32 is mod 2 ** sfInt32'SIZE; type sfUint32_Ptr is access all sfUint32; pragma Convention (C, sfUint32); pragma Convention (C, sfUint32_Ptr); -- // size_t type sfSize_t is mod 2 ** Standard'ADDRESS_SIZE; type sfSize_t_Ptr is access all sfSize_t; pragma Convention (C, sfSize_t); pragma Convention (C, sfSize_t_Ptr); -- // void type sfVoid is null record; type sfVoid_Ptr is access all sfVoid; pragma Convention (C, sfVoid); pragma Convention (C, sfVoid_Ptr); end Sf.Config;
Programas Ada95/bloquesError.ada
mendoza/mini-ada95
0
3596
------ BLOQUES - ERRORES procedure Hello is a: Integer; b: Float := 2.0 ; c: Boolean := false; function uno(a,b:out Boolean; x,y :in Integer) return Boolean is begin if x < 19 or x > 89 then return False; else return a; end if; end uno; begin loop Get(b); exit when b < 3.0); end loop; while a < 3 loop Put(a); end loop; for J in a if (J) /= 0 Put(J)); end if; end loop; end Hello;
PRG/levels/Ice/6-4.asm
narfman0/smb3_pp1
0
11216
<gh_stars>0 ; Original address was $B625 .word W604_CoinHeavL ; Alternate level layout .word W604_CoinHeavO ; Alternate object layout .byte LEVEL1_SIZE_11 | LEVEL1_YSTART_170 .byte LEVEL2_BGPAL_00 | LEVEL2_OBJPAL_08 | LEVEL2_XSTART_18 .byte LEVEL3_TILESET_13 | LEVEL3_VSCROLL_LOCKLOW | LEVEL3_PIPENOTEXIT .byte LEVEL4_BGBANK_INDEX(12) | LEVEL4_INITACT_NOTHING .byte LEVEL5_BGM_ATHLETIC | LEVEL5_TIME_300 .byte $1A, $0B, $10, $03, $17, $0C, $71, $19, $00, $35, $14, $01, $C2, $11, $0A, $C2 .byte $05, $07, $C2, $31, $04, $82, $73, $04, $42, $73, $14, $80, $73, $1B, $11, $73 .byte $1E, $10, $77, $1C, $11, $74, $1E, $80, $76, $1F, $80, $18, $09, $C2, $34, $18 .byte $82, $32, $1B, $40, $75, $16, $10, $11, $17, $C2, $73, $21, $13, $79, $26, $10 .byte $77, $21, $10, $78, $22, $10, $79, $23, $11, $35, $26, $0B, $09, $28, $C2, $14 .byte $22, $C2, $73, $28, $82, $75, $28, $82, $77, $28, $82, $79, $28, $82, $09, $28 .byte $C2, $12, $2F, $95, $11, $2F, $07, $73, $32, $80, $75, $32, $80, $30, $32, $81 .byte $06, $34, $C2, $17, $30, $83, $17, $34, $B5, $12, $3A, $A3, $19, $3A, $B3, $17 .byte $37, $A2, $16, $37, $B2, $14, $3A, $A1, $17, $3A, $B1, $17, $39, $A0, $16, $39 .byte $B0, $15, $3A, $07, $31, $3B, $01, $33, $39, $81, $35, $37, $80, $35, $3C, $80 .byte $37, $38, $80, $37, $3B, $80, $38, $39, $81, $11, $35, $C2, $13, $3D, $C2, $53 .byte $34, $07, $E3, $77, $50, $05, $44, $C2, $0A, $4A, $C2, $16, $4A, $E1, $15, $49 .byte $E1, $15, $4F, $E1, $14, $4E, $E1, $15, $4A, $A0, $19, $48, $A0, $14, $4F, $A0 .byte $18, $4D, $A0, $38, $44, $41, $11, $43, $C2, $13, $4B, $C2, $73, $52, $80, $75 .byte $52, $80, $77, $52, $80, $79, $52, $80, $78, $59, $8A, $25, $55, $12, $26, $56 .byte $10, $27, $56, $10, $33, $56, $10, $34, $56, $10, $35, $56, $10, $36, $56, $10 .byte $37, $56, $10, $38, $56, $10, $24, $56, $0A, $39, $56, $40, $52, $56, $08, $01 .byte $5A, $C2, $07, $52, $C2, $08, $59, $C2, $11, $5A, $C2, $05, $6C, $C2, $09, $64 .byte $C2, $11, $6B, $C2, $12, $63, $C2, $75, $62, $10, $76, $62, $10, $76, $6B, $10 .byte $77, $6B, $10, $37, $60, $14, $20, $61, $D1, $35, $6F, $81, $78, $71, $8F, $76 .byte $75, $10, $77, $75, $10, $75, $7E, $10, $76, $7E, $10, $03, $7A, $C2, $09, $77 .byte $C2, $0F, $74, $C2, $10, $7D, $C2, $27, $72, $82, $28, $72, $82, $29, $72, $82 .byte $34, $74, $82, $28, $73, $0F, $75, $87, $10, $76, $87, $10, $77, $87, $10, $71 .byte $8F, $80, $76, $8F, $80, $05, $83, $C2, $08, $8A, $C2, $12, $8B, $C2, $36, $8A .byte $82, $1A, $93, $10, $1C, $15, $94, $72, $40, $98, $09, $FF
source/nodes/program-nodes-signed_integer_types.adb
reznikmm/gela
0
5450
<reponame>reznikmm/gela -- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- package body Program.Nodes.Signed_Integer_Types is function Create (Range_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Lower_Bound : not null Program.Elements.Expressions .Expression_Access; Double_Dot_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Upper_Bound : not null Program.Elements.Expressions .Expression_Access) return Signed_Integer_Type is begin return Result : Signed_Integer_Type := (Range_Token => Range_Token, Lower_Bound => Lower_Bound, Double_Dot_Token => Double_Dot_Token, Upper_Bound => Upper_Bound, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Lower_Bound : not null Program.Elements.Expressions .Expression_Access; Upper_Bound : not null Program.Elements.Expressions .Expression_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False) return Implicit_Signed_Integer_Type is begin return Result : Implicit_Signed_Integer_Type := (Lower_Bound => Lower_Bound, Upper_Bound => Upper_Bound, Is_Part_Of_Implicit => Is_Part_Of_Implicit, Is_Part_Of_Inherited => Is_Part_Of_Inherited, Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null) do Initialize (Result); end return; end Create; overriding function Lower_Bound (Self : Base_Signed_Integer_Type) return not null Program.Elements.Expressions.Expression_Access is begin return Self.Lower_Bound; end Lower_Bound; overriding function Upper_Bound (Self : Base_Signed_Integer_Type) return not null Program.Elements.Expressions.Expression_Access is begin return Self.Upper_Bound; end Upper_Bound; overriding function Range_Token (Self : Signed_Integer_Type) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Range_Token; end Range_Token; overriding function Double_Dot_Token (Self : Signed_Integer_Type) return not null Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Double_Dot_Token; end Double_Dot_Token; overriding function Is_Part_Of_Implicit (Self : Implicit_Signed_Integer_Type) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Signed_Integer_Type) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Signed_Integer_Type) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; procedure Initialize (Self : in out Base_Signed_Integer_Type'Class) is begin Set_Enclosing_Element (Self.Lower_Bound, Self'Unchecked_Access); Set_Enclosing_Element (Self.Upper_Bound, Self'Unchecked_Access); null; end Initialize; overriding function Is_Signed_Integer_Type (Self : Base_Signed_Integer_Type) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Signed_Integer_Type; overriding function Is_Type_Definition (Self : Base_Signed_Integer_Type) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Type_Definition; overriding function Is_Definition (Self : Base_Signed_Integer_Type) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Definition; overriding procedure Visit (Self : not null access Base_Signed_Integer_Type; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Signed_Integer_Type (Self); end Visit; overriding function To_Signed_Integer_Type_Text (Self : in out Signed_Integer_Type) return Program.Elements.Signed_Integer_Types .Signed_Integer_Type_Text_Access is begin return Self'Unchecked_Access; end To_Signed_Integer_Type_Text; overriding function To_Signed_Integer_Type_Text (Self : in out Implicit_Signed_Integer_Type) return Program.Elements.Signed_Integer_Types .Signed_Integer_Type_Text_Access is pragma Unreferenced (Self); begin return null; end To_Signed_Integer_Type_Text; end Program.Nodes.Signed_Integer_Types;
src/_test/helpers/apsepp-test_node_class-runner_sequential-w_slave_nodes-create.adb
thierr26/ada-apsepp
0
26084
<gh_stars>0 -- Copyright (C) 2019 <NAME> <<EMAIL>> -- MIT license. Please refer to the LICENSE file. with Apsepp.Test_Node_Class.Runner_Sequential.Create; function Apsepp.Test_Node_Class.Runner_Sequential.W_Slave_Nodes.Create (Root_Node_Access : Test_Node_Access; Test_Reporter_Instance_Access : Test_Reporter_Access := null; Reporter_Access_Set_CB : Scope_Bound_Locks.SB_Lock_CB := null; Slaves : Test_Node_Array) return Test_Runner_Sequential_W_Slave_Tasks is use Ada.Finalization; Sla : constant Test_Node_Array_Access := new Test_Node_Array'(Slaves); begin return (Apsepp.Test_Node_Class.Runner_Sequential.Create (Root_Node_Access, Test_Reporter_Instance_Access, Reporter_Access_Set_CB) with Slaves => (Limited_Controlled with A => Sla)); end Apsepp.Test_Node_Class.Runner_Sequential.W_Slave_Nodes.Create;
Ada/src/Problem_72.adb
Tim-Tom/project-euler
0
14605
<gh_stars>0 with Ada.Text_IO; with PrimeUtilities; package body Problem_72 is package IO renames Ada.Text_IO; subtype One_Million is Long_Integer range 1 .. 1_000_000; package Million_Primes is new PrimeUtilities(One_Million); -- From Farey Sequence Wikipedia Page: -- Using the fact that |F1| = 2, we can derive an expression for the length of F_n: -- | F_n | = 1 + ∑(m = 1, n) φ(m). procedure Solve is count : Long_Integer := 0; sieve : constant Million_Primes.Sieve := Million_Primes.Generate_Sieve(One_Million'Last); procedure Solve_Recursive(min_index : Positive; start_euler, so_far : One_Million) is prime : One_Million; total : One_Million; euler : One_Million; begin for prime_index in min_index .. sieve'Last loop prime := sieve(prime_index); exit when One_Million'Last / prime < so_far; total := so_far * prime; euler := start_euler * (prime - 1); count := count + euler; loop Solve_Recursive(prime_index + 1, euler, total); exit when One_Million'Last / prime < total; total := total * prime; euler := euler * prime; count := count + euler; end loop; end loop; end Solve_Recursive; begin Solve_Recursive(sieve'First, 1, 1); IO.Put_Line(Long_Integer'Image(count)); end Solve; end Problem_72;
src/Data/QuadTree/LensProofs/Valid-LensWrappedTree.agda
JonathanBrouwer/research-project
1
3485
module Data.QuadTree.LensProofs.Valid-LensWrappedTree where open import Haskell.Prelude renaming (zero to Z; suc to S) open import Data.Lens.Lens open import Data.Logic open import Data.QuadTree.InternalAgda open import Agda.Primitive open import Data.Lens.Proofs.LensLaws open import Data.Lens.Proofs.LensPostulates open import Data.Lens.Proofs.LensComposition open import Data.QuadTree.Implementation.QuadrantLenses open import Data.QuadTree.Implementation.Definition open import Data.QuadTree.Implementation.ValidTypes open import Data.QuadTree.Implementation.SafeFunctions open import Data.QuadTree.Implementation.PublicFunctions open import Data.QuadTree.Implementation.DataLenses ---- Lens laws for lensWrappedTree ValidLens-WrappedTree-ViewSet : {t : Set} {{eqT : Eq t}} {dep : Nat} -> ViewSet (lensWrappedTree {t} {dep}) ValidLens-WrappedTree-ViewSet (CVQuadrant qdi) (CVQuadTree (Wrapper (w , h) qdo)) = refl ValidLens-WrappedTree-SetView : {t : Set} {{eqT : Eq t}} {dep : Nat} -> SetView (lensWrappedTree {t} {dep}) ValidLens-WrappedTree-SetView (CVQuadTree (Wrapper (w , h) qdo)) = refl ValidLens-WrappedTree-SetSet : {t : Set} {{eqT : Eq t}} {dep : Nat} -> SetSet (lensWrappedTree {t} {dep}) ValidLens-WrappedTree-SetSet (CVQuadrant qd1) (CVQuadrant qd2) (CVQuadTree (Wrapper (w , h) qdo)) = refl ValidLens-WrappedTree : {t : Set} {{eqT : Eq t}} {dep : Nat} -> ValidLens (VQuadTree t {dep}) (VQuadrant t {dep}) ValidLens-WrappedTree = CValidLens lensWrappedTree (ValidLens-WrappedTree-ViewSet) (ValidLens-WrappedTree-SetView) (ValidLens-WrappedTree-SetSet)
text/maps/PewterGym_2.asm
AmateurPanda92/pokemon-rby-dx
9
176798
_PewterGymText_5c4a3:: text "There are all" line "kinds of trainers" cont "in the world!" para "You appear to be" line "very gifted as a" cont "#MON trainer!" para "Go to the GYM in" line "CERULEAN and test" cont "your abilities!" done _TM34PreReceiveText:: text "Wait! Take this" line "with you!" done _ReceivedTM34Text:: text "<PLAYER> received" line "TM34!@@" _TM34ExplanationText:: text "" para "A TM contains a" line "technique that" cont "can be taught to" cont "#MON!" para "A TM is good only" line "once! So when you" cont "use one to teach" cont "a new technique," cont "pick the #MON" cont "carefully!" para "TM34 contains" line "BIDE!" para "Your #MON will" line "absorb damage in" cont "battle then pay" cont "it back double!" done _TM34NoRoomText:: text "You don't have" line "room for this!" done _PewterGymText_5c4bc:: text "I took" line "you for granted." para "As proof of your" line "victory, here's" cont "the BOULDERBADGE!" para "<PLAYER> received" line "the BOULDERBADGE!@@" _PewterGymText_5c4c1:: text "" para "That's an official" line "#MON LEAGUE" cont "BADGE!" para "Its bearer's" line "#MON become" cont "more powerful!" para "The technique" line "FLASH can now be" cont "used any time!" prompt _PewterGymBattleText1:: text "Stop right there," line "kid!" para "You're still light" line "years from facing" cont "BROCK!" done _PewterGymEndBattleText1:: text "Darn!" para "Light years isn't" line "time! It measures" cont "distance!" prompt _PewterGymAfterBattleText1:: text "You're pretty hot," line "but not as hot" cont "as BROCK!" done _PewterGymText_5c515:: text "Hiya! I can tell" line "you have what it" cont "takes to become a" cont "#MON champ!" para "I'm no trainer," line "but I can tell" cont "you how to win!" para "Let me take you" line "to the top!" done _PewterGymText_5c51a:: text "All right! Let's" line "get happening!" prompt _PewterGymText_5c51f:: text "The 1st #MON" line "out in a match is" cont "at the top of the" cont "#MON LIST!" para "By changing the" line "order of #MON," cont "matches could be" cont "made easier!" done _PewterGymText_5c524:: text "It's a free" line "service! Let's" cont "get happening!" prompt _PewterGymText_5c529:: text "Just as I thought!" line "You're #MON" cont "champ material!" done
Transynther/x86/_processed/NONE/_ht_zr_un_/i3-7100_9_0x84_notsx.log_102_1738.asm
ljhsiun2/medusa
9
1808
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r13 push %r15 push %rbp push %rcx push %rdi push %rsi lea addresses_WC_ht+0x1129, %rdi nop nop nop nop cmp $47910, %r10 movb (%rdi), %r13b nop nop inc %r15 lea addresses_D_ht+0xeec9, %rbp nop nop and %r13, %r13 movw $0x6162, (%rbp) nop nop nop sub %r10, %r10 lea addresses_normal_ht+0x7479, %rsi lea addresses_WC_ht+0x19e79, %rdi nop nop nop nop nop add %r13, %r13 mov $21, %rcx rep movsw nop nop nop nop dec %r13 lea addresses_D_ht+0xae99, %r10 clflush (%r10) nop nop nop nop nop cmp $43890, %r15 movb $0x61, (%r10) nop nop nop nop add $12924, %rdi lea addresses_WT_ht+0x1a379, %r13 nop nop nop nop nop add %rdi, %rdi mov $0x6162636465666768, %rbp movq %rbp, %xmm1 movups %xmm1, (%r13) sub $56250, %rsi lea addresses_D_ht+0x13299, %rbp nop nop nop nop nop cmp %r13, %r13 movw $0x6162, (%rbp) nop and $44300, %r13 lea addresses_WC_ht+0xd1b7, %rsi lea addresses_A_ht+0x722d, %rdi nop nop and %r12, %r12 mov $49, %rcx rep movsl nop nop nop add %rbp, %rbp lea addresses_normal_ht+0xcb39, %rcx nop nop nop nop cmp %r13, %r13 mov $0x6162636465666768, %rsi movq %rsi, %xmm7 vmovups %ymm7, (%rcx) nop nop nop nop nop sub $62231, %rsi lea addresses_D_ht+0x118f9, %rsi lea addresses_WT_ht+0x7ddf, %rdi nop xor $28842, %r13 mov $9, %rcx rep movsb nop nop nop nop nop sub %rcx, %rcx lea addresses_D_ht+0x148d9, %rdi nop cmp %r13, %r13 mov $0x6162636465666768, %rcx movq %rcx, (%rdi) xor $9461, %rsi lea addresses_normal_ht+0x12679, %rsi lea addresses_WT_ht+0x14af9, %rdi nop sub $3939, %r12 mov $50, %rcx rep movsw nop xor %r10, %r10 lea addresses_normal_ht+0x1e479, %rsi nop nop nop nop nop inc %r12 movups (%rsi), %xmm0 vpextrq $1, %xmm0, %r13 nop sub %rcx, %rcx lea addresses_D_ht+0x6b17, %rsi lea addresses_WC_ht+0x7739, %rdi nop nop nop nop nop dec %rbp mov $21, %rcx rep movsb nop inc %rdi lea addresses_A_ht+0xa79, %r15 nop nop nop nop nop sub $34968, %rcx mov (%r15), %r13d nop nop nop nop nop inc %r13 pop %rsi pop %rdi pop %rcx pop %rbp pop %r15 pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r8 push %rax push %rbp push %rcx push %rdi push %rsi // Store lea addresses_normal+0x3479, %r14 nop cmp %rsi, %rsi mov $0x5152535455565758, %r8 movq %r8, %xmm5 movups %xmm5, (%r14) nop nop cmp $17796, %r8 // REPMOV lea addresses_US+0x1a803, %rsi lea addresses_PSE+0x138b9, %rdi nop nop sub $31737, %rbp mov $30, %rcx rep movsl nop nop nop nop cmp %rdi, %rdi // Faulty Load lea addresses_A+0x6c79, %rbp sub $30249, %rdi movups (%rbp), %xmm1 vpextrq $0, %xmm1, %r10 lea oracles, %rbp and $0xff, %r10 shlq $12, %r10 mov (%rbp,%r10,1), %r10 pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r8 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_A', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 16, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_US', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_PSE', 'congruent': 5, 'same': False}, 'OP': 'REPM'} [Faulty Load] {'src': {'type': 'addresses_A', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WC_ht', 'same': True, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_D_ht', 'same': True, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D_ht', 'same': True, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 5, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': True}, 'OP': 'REPM'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'28': 8, '00': 85, '48': 3, '47': 1, '44': 5} 00 00 00 00 00 00 00 44 00 44 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00 00 48 00 00 00 00 00 00 00 00 00 00 28 00 00 44 00 48 00 00 00 00 00 00 00 00 00 00 00 00 28 00 44 00 00 00 28 00 00 47 00 00 00 28 00 00 00 28 00 00 00 00 00 00 00 28 00 44 00 00 00 00 00 00 00 00 00 48 00 */
programs/oeis/091/A091596.asm
neoneye/loda
22
27663
; A091596: Expansion of x(1-2x^2)/(1-x-2x^2)^2. ; 0,1,2,5,12,27,62,137,304,663,1442,3109,6676,14259,30342,64321,135928,286415,601962,1262173,2640860,5514731,11495502,23923065,49710272,103148807,213754162,442421397,914668964,1888990243,3897285142 mov $5,2 mov $10,$0 lpb $5 mov $0,$10 sub $5,1 add $0,$5 sub $0,1 mov $6,$0 mov $7,0 mov $8,2 lpb $8 mov $0,$6 mov $3,0 sub $8,1 add $0,$8 sub $0,1 lpb $0 mov $2,$0 trn $0,2 max $2,0 seq $2,127985 ; a(n) = floor(2^n*(n/3 + 4/9)). add $3,$2 lpe mov $9,$8 mul $9,$3 add $7,$9 mov $11,$3 lpe mov $4,$5 min $6,1 mul $6,$11 mov $11,$7 sub $11,$6 mul $4,$11 add $1,$4 lpe min $10,1 mul $10,$11 sub $1,$10 mov $0,$1
programs/oeis/120/A120849.asm
karttu/loda
1
8519
; A120849: 5n+3^n-2^n. ; 0,6,15,34,85,236,695,2094,6345,19216,58075,175154,527405,1586196,4766655,14316214,42981265,129009176,387158435,1161737274,3485735925,10458256156,31376865415,94134790334,282412759385,847255055136,2541798719595,7625463267394,22876524019645,68629840494116,205890058352975,617671248800454,1853015893884705,5559051976621096 mov $2,$0 mul $2,4 add $2,94 cal $0,290651 ; a(n) = 5 - 2^(n - 1) + 3^(n - 1) + n - 2. add $0,1 add $0,$2 mov $1,$0 sub $1,99
aosvs/aosvs-process.adb
SMerrony/dgemua
2
20181
<filename>aosvs/aosvs-process.adb -- MIT License -- Copyright (c) 2021 <NAME> -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to deal -- in the Software without restriction, including without limitation the rights -- to use, copy, modify, merge, publish, distribute, sublicense, and/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. with Ada.Text_IO; use Ada.Text_IO; with AOSVS.Agent; with Debug_Logs; use Debug_Logs; with Memory; use Memory; with PARU_32; use PARU_32; package body AOSVS.Process is function Sys_DADID (CPU : in out CPU_T; PID : in Word_T) return Boolean is begin -- TODO fake response.... Loggers.Debug_Print (Sc_Log, "?DADID (Faking response)"); CPU.AC (1) := Dword_T (PID) - 1; return True; end Sys_DADID; function Sys_GUNM (CPU : in out CPU_T; PID : in Word_T) return Boolean is Pkt_Addr : Phys_Addr_T := Phys_Addr_T (CPU.AC (2)); User_Name : Unbounded_String; begin Loggers.Debug_Print (Sc_Log, "?GUNM"); case CPU.AC (1) is when 16#ffff_ffff# => raise AOSVS.Agent.Not_Yet_Implemented with "?GUNM via target process"; when 0 => if CPU.AC(0) = 16#ffff_ffff# then User_Name := AOSVS.Agent.Actions.Get_User_Name (PID); RAM.Write_String_BA (CPU.AC (2), To_String (User_Name)); CPU.AC (0) := 0; -- Claim NOT to be in Superuser mode CPU.AC (1) := 16#001f#; -- Claim to have nearly all privileges else raise AOSVS.Agent.Not_Yet_Implemented with "?GUNM via another PID"; end if; when others => if CPU.AC (0) /= 16#ffff_ffff# then Loggers.Debug_Print (Sc_Log, "----- Invalid parameters"); CPU.AC (0) := Dword_T (ERPNM); return False; end if; User_Name := AOSVS.Agent.Actions.Get_User_Name (PID); RAM.Write_String_BA (CPU.AC (2), To_String (User_Name)); CPU.AC (0) := 0; -- Claim NOT to be in Superuser mode CPU.AC (1) := 16#001f#; -- Claim to have nearly all privileges end case; Loggers.Debug_Print (Sc_Log, "----- Returning: " & To_String (User_Name)); return True; end Sys_GUNM; function Sys_PNAME (CPU : in out CPU_T; PID : in Word_T) return Boolean is Pname_BA : Dword_T := CPU.AC(0); begin Loggers.Debug_Print (Sc_Log, "?PNAME"); case CPU.AC(1) is when 16#ffff_ffff# => -- get own PID CPU.AC(1) := Dword_T(PID); if Pname_BA /= 0 then RAM.Write_String_BA (Pname_BA,Agent.Actions.Get_Proc_Name(PID_T(PID))); end if; when 0 => -- get PID of named target process raise AOSVS.Agent.Not_Yet_Implemented with "?PNAME for named proc"; when others => -- get proc name for given PID in AC0 raise AOSVS.Agent.Not_Yet_Implemented with "?PNAME for another PID"; end case; return true; end Sys_PNAME; function Sys_RNGPR (CPU : in out CPU_T; PID : in Word_T) return Boolean is Pkt_Addr : Phys_Addr_T := Phys_Addr_T (CPU.AC (2)); Buff_BA : Dword_T := RAM.Read_Dword (Pkt_Addr + RNGBP); Ring_Num : Integer := Integer(Word_To_Integer_16(RAM.Read_Word (Pkt_Addr + RNGNM))); Buff_Len : Integer := Integer(Word_To_Integer_16(RAM.Read_Word (Pkt_Addr + RNGLB))); begin Loggers.Debug_Print (Sc_Log, "?RNGPR - Ring: " & Ring_Num'Image); if CPU.AC(0) /= 16#ffff_ffff# then raise Not_Yet_Implemented with "?RNGPR for other/named procs"; end if; declare PR_S : Unbounded_String := ':' & AOSVS.Agent.Actions.Get_PR_Name(PID); begin if Length(PR_S) > Buff_Len then CPU.AC(0) := Dword_T(ERIRB); return false; end if; RAM.Write_String_BA (Buff_BA, To_String(PR_S)); RAM.Write_Word (Pkt_Addr + RNGLB, Word_T(Length(PR_S))); Loggers.Debug_Print (Sc_Log, "------ Returning: " & To_String(PR_S)); end; return true; end Sys_RNGPR; function Sys_SUSER (CPU : in out CPU_T; PID : in Word_T) return Boolean is begin Loggers.Debug_Print (Sc_Log, "?SUSER"); case CPU.AC(0) is when 0 => CPU.AC(0) := (if AOSVS.Agent.Actions.Get_Superuser(PID) then 16#ffff_ffff# else 1); when 16#ffff_ffff# => AOSVS.Agent.Actions.Set_Superuser(PID, true); Loggers.Debug_Print (Sc_Log, "------ Superuser turned on"); when 1 => AOSVS.Agent.Actions.Set_Superuser(PID, false); Loggers.Debug_Print (Sc_Log, "------ Superuser turned off"); when others => CPU.AC(0) := Dword_T(ERPRE); return false; end case; return true; end Sys_SUSER; function Sys_SYSPRV (CPU : in out CPU_T; PID : in Word_T) return Boolean is Pkt_Addr : Phys_Addr_T := Phys_Addr_T (CPU.AC (2)); P_FUNC : Word_T := RAM.Read_Word (Pkt_Addr + 2); begin Loggers.Debug_Print (Sc_Log, "?SYSPRV"); -- TODO return True; end Sys_SYSPRV; end AOSVS.Process;
1-base/lace/source/events/concrete/lace-observer-instant.ads
charlie5/lace-alire
1
14230
with lace.make_Observer, lace.Any; private with ada.Strings.unbounded; package lace.Observer.instant -- -- Provides a concrete instant event observer. -- is type Item is limited new Any.limited_item and Observer .item with private; type View is access all Item'Class; package Forge is function new_Observer (Name : in Event.observer_Name) return View; end Forge; overriding function Name (Self : in Item) return Event.observer_Name; private use ada.Strings.unbounded; package Observer is new make_Observer (Any.limited_item); type Item is limited new Observer.item with record Name : unbounded_String; end record; end lace.Observer.instant;
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_544.asm
ljhsiun2/medusa
9
85522
<filename>Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_544.asm .global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %rbp push %rbx push %rcx // Faulty Load lea addresses_WC+0x269b, %r11 nop nop nop nop inc %rbp movups (%r11), %xmm5 vpextrq $1, %xmm5, %rcx lea oracles, %r12 and $0xff, %rcx shlq $12, %rcx mov (%r12,%rcx,1), %rcx pop %rcx pop %rbx pop %rbp pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
programs/oeis/130/A130328.asm
jmorken/loda
1
162911
; A130328: Triangle of differences between powers of 2, read by rows. ; 1,3,2,7,6,4,15,14,12,8,31,30,28,24,16,63,62,60,56,48,32,127,126,124,120,112,96,64,255,254,252,248,240,224,192,128,511,510,508,504,496,480,448,384,256 mov $2,$0 mov $0,2 add $2,2 pow $0,$2 mov $2,2 lpb $0 mul $2,2 mov $3,3 sub $3,$0 sub $0,$3 div $0,$2 mul $0,2 mov $1,$2 lpe add $1,$3 sub $1,9 div $1,4 add $1,1
oeis/010/A010768.asm
neoneye/loda-programs
11
88265
; A010768: Decimal expansion of 6th root of 2. ; Submitted by <NAME>(w1) ; 1,1,2,2,4,6,2,0,4,8,3,0,9,3,7,2,9,8,1,4,3,3,5,3,3,0,4,9,6,7,9,1,7,9,5,1,6,2,3,2,4,1,1,1,1,0,6,1,3,9,8,6,7,5,3,4,4,0,4,0,9,5,4,5,8,8,2,9,0,4,0,0,5,5,6,5,8,6,1,2,4,7,0,8,7,9,2,3,2,2,7,1,1,2,5,0,9,0,8,0 mov $3,$0 mul $3,3 lpb $3 add $2,1 add $6,$2 add $1,$6 add $2,$7 add $1,$2 add $2,$1 add $4,$1 add $7,$1 mul $1,2 sub $3,1 add $5,$2 add $6,$5 add $7,$4 lpe mov $1,$5 add $2,10 mov $4,10 pow $4,$0 div $2,$4 div $1,$2 mov $0,$1 add $0,$4 mod $0,10
Task/Verify-distribution-uniformity-Chi-squared-test/Ada/verify-distribution-uniformity-chi-squared-test-1.ada
LaudateCorpus1/RosettaCodeData
1
12278
package Chi_Square is type Flt is digits 18; type Bins_Type is array(Positive range <>) of Natural; function Distance(Bins: Bins_Type) return Flt; end Chi_Square;
programs/oeis/071/A071875.asm
jmorken/loda
1
13302
<reponame>jmorken/loda ; A071875: Decimal expansion of the eighth (of 10) decimal selvage number; the n-th digit of a decimal selvage number, x, is equal to the tenths digit of n*x. ; 7,4,2,9,7,4,2,9,6,4,1,9,6,4,1,8,6,3,1,8,6,3,0,8,5,3,0,8,5,2,0,7,5,2,0,7,4,2,9,7,4,2,9,6,4,1,9,6,4,1,8,6,3,1,8,6,3,0,8,5,3,0,8,5,2,0,7,5,2,0,7,4,2,9,7,4,2,9,6,4,1,9,6,4,1,8,6,3,1,8,6,3,0,8,5,3,0,8,5,2 mul $0,2 add $0,1 cal $0,71792 ; Decimal expansion of the fourth (of 10) decimal selvage number; the n-th digit of a decimal selvage number, x, is equal to the tenths digit of n*x. mov $1,$0
other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/mak.lzh/mak/kart-check.asm
prismotizm/gigaleak
0
80377
Name: kart-check.asm Type: file Size: 1042 Last-Modified: '1992-07-01T00:26:43Z' SHA-1: 3530A4B23023A1312D22DB17BC2749DD6C79D4B1 Description: null
_tests/trull/Gold/KeywordFun.g4
kaby76/Domemtech.Trash
16
3502
<reponame>kaby76/Domemtech.Trash grammar KeywordFun; a : 'abc'; b : 'def'; A : [aA] [bB] [cC]; B : [dD] [eE] [fF]; C : 'uvw' 'xyz'?; D : 'uvw' 'xyz'+;
test/Succeed/Issue616.agda
shlevy/agda
3
184
module Issue616 where open import Common.Coinduction const : ∀ {a b}{A : Set a}{B : Set b} → A → B → A const x _ = x -- The recursive call should be ignored by the termination checker, -- since ♭ is a projection function and shouldn't store its implicit -- arguments. contrived : Set₁ contrived = ♭ {A = const _ contrived} (♯ Set)
non_regression/other_x86_linux_9.s.asm
LRGH/plasmasm
1
178422
.file "deflate.c" .section .rodata .align 32 .globl deflate_copyright .type deflate_copyright, @object deflate_copyright: .string " deflate 1.2.8 Copyright 1995-2013 <NAME> and <NAME> " .size deflate_copyright, 68 # ---------------------- .align 32 .local configuration_table .type configuration_table, @object configuration_table: .value 0 .value 0 .value 0 .value 0 .long deflate_stored .value 4 .value 4 .value 8 .value 4 .long deflate_fast .value 4 .value 5 .value 16 .value 8 .long deflate_fast .value 4 .value 6 .value 32 .value 32 .long deflate_fast .value 4 .value 4 .value 16 .value 16 .long deflate_slow .value 8 .value 16 .value 32 .value 32 .long deflate_slow .value 8 .value 16 .value 128 .value 128 .long deflate_slow .value 8 .value 32 .value 128 .value 256 .long deflate_slow .value 32 .value 128 .value 258 .value 1024 .long deflate_slow .value 32 .value 258 .value 258 .value 4096 .long deflate_slow .size configuration_table, 120 # ---------------------- .local my_version.0 .type my_version.0, @object my_version.0: .string "1.2.8" .size my_version.0, 6 # ---------------------- .text .p2align 2,,3 # ---------------------- .globl deflateInit2_ .type deflateInit2_, @function deflateInit2_: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx subl $28, %esp movl 28(%ebp), %eax movl %eax, -20(%ebp) movl 32(%ebp), %eax movl 12(%ebp), %edx testl %eax, %eax movl %edx, -16(%ebp) movl 8(%ebp), %edi movl 16(%ebp), %ecx movl 20(%ebp), %esi movl 24(%ebp), %ebx movl 36(%ebp), %edx movl $1, -28(%ebp) je .L3 cmpb $49, (%eax) je .L17 .L3: movl $-6, %eax .L1: leal -12(%ebp), %esp popl %ebx popl %esi popl %edi leave ret .p2align 2,,3 .L17: cmpl $56, %edx jne .L3 testl %edi, %edi movl $-2, %eax je .L1 movl 32(%edi), %edx testl %edx, %edx movl $0, 24(%edi) jne .L5 movl $zcalloc, 32(%edi) movl $0, 40(%edi) .L5: movl 36(%edi), %edx testl %edx, %edx jne .L6 movl $zcfree, 36(%edi) .L6: cmpl $-1, -16(%ebp) je .L18 .L7: testl %esi, %esi js .L19 cmpl $15, %esi jle .L9 movl $2, -28(%ebp) subl $16, %esi .L9: leal -1(%ebx), %edx cmpl $8, %edx ja .L12 cmpl $8, %ecx je .L20 .L12: movl $-2, %eax jmp .L1 .L20: cmpl $7, %esi jle .L12 cmpl $15, %esi jg .L12 movl -16(%ebp), %ecx testl %ecx, %ecx js .L12 cmpl $9, -16(%ebp) jg .L12 movl -20(%ebp), %edx testl %edx, %edx js .L12 cmpl $4, -20(%ebp) jg .L12 cmpl $8, %esi je .L21 .L13: pushl %ecx pushl $5828 pushl $1 pushl 40(%edi) call *32(%edi) movl %eax, -24(%ebp) movl -24(%ebp), %ecx addl $16, %esp testl %ecx, %ecx movl $-4, %eax je .L1 movl -24(%ebp), %edx movl -28(%ebp), %ecx movl %ecx, 24(%edx) movl %esi, 48(%edx) movl %edx, 28(%edi) movl %edi, (%edx) movl $0, 28(%edx) movl %esi, %ecx movl $1, %edx movl -24(%ebp), %esi sall %cl, %edx movl $1, %eax leal 7(%ebx), %ecx movl %edx, 44(%esi) sall %cl, %eax decl %edx movl %edx, 52(%esi) movl %eax, %edx decl %edx movl %eax, 76(%esi) movl %edx, 84(%esi) movl $-1431655765, %eax leal 9(%ebx), %edx mull %edx movl %ecx, 80(%esi) movl %edx, %ecx movl -24(%ebp), %esi shrl $1, %ecx movl %ecx, 88(%esi) pushl %eax pushl $2 pushl 44(%esi) pushl 40(%edi) call *32(%edi) movl -24(%ebp), %edx addl $12, %esp movl %eax, 56(%edx) pushl $2 pushl 44(%edx) pushl 40(%edi) call *32(%edi) movl -24(%ebp), %ecx addl $12, %esp movl %eax, 64(%ecx) pushl $2 pushl 76(%ecx) pushl 40(%edi) call *32(%edi) leal 6(%ebx), %ecx movl $1, %edx movl -24(%ebp), %ebx movl -24(%ebp), %esi addl $12, %esp sall %cl, %edx movl %eax, 68(%esi) movl $0, 5824(%esi) movl %edx, 5788(%ebx) pushl $4 pushl 5788(%ebx) pushl 40(%edi) call *32(%edi) movl 5788(%ebx), %edx leal 0(,%edx,4), %esi movl %esi, 12(%ebx) movl 56(%ebx), %esi addl $16, %esp testl %esi, %esi movl %eax, %ecx movl %eax, 8(%ebx) je .L16 movl 64(%ebx), %eax testl %eax, %eax je .L16 movl 68(%ebx), %esi testl %esi, %esi je .L16 testl %ecx, %ecx je .L16 movl %edx, %esi andl $-2, %esi leal (%esi,%ecx), %ebx movl -24(%ebp), %esi movl %ebx, 5796(%esi) leal (%edx,%edx,2), %ebx leal (%ebx,%ecx), %edx movl -16(%ebp), %ebx movl -20(%ebp), %ecx movl %edx, 5784(%esi) movl %ebx, 132(%esi) movl %ecx, 136(%esi) movb $8, 36(%esi) movl %edi, 8(%ebp) leal -12(%ebp), %esp popl %ebx popl %esi popl %edi leave jmp deflateReset .p2align 2,,3 .L16: movl -24(%ebp), %edx movl z_errmsg+24, %ebx subl $12, %esp movl $666, 4(%edx) movl %ebx, 24(%edi) pushl %edi call deflateEnd movl $-4, %eax jmp .L1 .L21: movl $9, %esi jmp .L13 .p2align 2,,3 .L19: movl $0, -28(%ebp) negl %esi jmp .L9 .L18: movl $6, -16(%ebp) jmp .L7 .size deflateInit2_, .-deflateInit2_ # ---------------------- .p2align 2,,3 # ---------------------- .globl deflateSetDictionary .type deflateSetDictionary, @function deflateSetDictionary: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx subl $60, %esp movl 8(%ebp), %edx testl %edx, %edx movl 12(%ebp), %esi movl 16(%ebp), %ebx je .L26 movl 8(%ebp), %edx movl 28(%edx), %edi testl %edi, %edi je .L26 testl %esi, %esi je .L26 movl 24(%edi), %edx cmpl $2, %edx movl %edx, -16(%ebp) je .L26 decl %edx je .L65 .L27: movl 116(%edi), %ecx testl %ecx, %ecx je .L25 .p2align 2,,3 .L26: movl $-2, %eax .L22: leal -12(%ebp), %esp popl %ebx popl %esi popl %edi leave ret .L25: cmpl $1, -16(%ebp) je .L66 .L28: movl 44(%edi), %eax cmpl %eax, %ebx movl $0, 24(%edi) jb .L29 movl -16(%ebp), %ecx testl %ecx, %ecx je .L67 .L30: subl %eax, %ebx addl %ebx, %esi movl %eax, %ebx .L29: movl 8(%ebp), %edx movl 4(%edx), %eax subl $12, %esp movl %eax, -20(%ebp) movl 8(%ebp), %ecx movl 8(%ebp), %eax movl (%ecx), %edx movl %ebx, 4(%eax) movl %esi, (%eax) pushl %edi movl %edx, -24(%ebp) call fill_window movl 116(%edi), %edx addl $16, %esp cmpl $2, %edx movl %edx, %eax jbe .L64 .p2align 2,,3 .L62: subl $2, %eax movl 68(%edi), %esi movl 88(%edi), %ecx movl %eax, -60(%ebp) movl %esi, -40(%ebp) movl %ecx, -48(%ebp) movl 56(%edi), %edx movl 84(%edi), %eax movl 52(%edi), %esi movl 64(%edi), %ecx movl 108(%edi), %ebx movl %edx, -32(%ebp) movl %eax, -44(%ebp) movl %esi, -28(%ebp) movl %ecx, -36(%ebp) .p2align 2,,3 .L58: movl 72(%edi), %eax movb -48(%ebp), %cl movl -32(%ebp), %edx sall %cl, %eax movzbl 2(%ebx,%edx), %ecx xorl %ecx, %eax andl -44(%ebp), %eax movl -40(%ebp), %esi movl -28(%ebp), %edx movw (%esi,%eax,2), %cx andl %ebx, %edx movl -36(%ebp), %esi movw %cx, (%esi,%edx,2) movl -40(%ebp), %ecx movw %bx, (%ecx,%eax,2) incl %ebx decl -60(%ebp) movl %eax, 72(%edi) jne .L58 subl $12, %esp movl %ebx, 108(%edi) movl $2, 116(%edi) pushl %edi call fill_window movl 116(%edi), %edx addl $16, %esp cmpl $2, %edx movl %edx, %eax ja .L62 .L64: movl 108(%edi), %ecx addl %edx, %ecx movl %edx, 5812(%edi) movl -24(%ebp), %eax movl 8(%ebp), %edx movl -20(%ebp), %esi movl -16(%ebp), %ebx movl %ecx, 108(%edi) movl $0, 116(%edi) movl $2, 120(%edi) movl $2, 96(%edi) movl $0, 104(%edi) movl %eax, (%edx) movl %esi, 4(%edx) movl %ecx, 92(%edi) movl %ebx, 24(%edi) xorl %eax, %eax jmp .L22 .L67: movl 76(%edi), %eax movl 68(%edi), %edx sall $1, %eax movw $0, -2(%eax,%edx) subl $2, %eax pushl %ecx pushl %eax pushl $0 pushl %edx call memset addl $16, %esp movl $0, 108(%edi) movl $0, 92(%edi) movl $0, 5812(%edi) movl 44(%edi), %eax jmp .L30 .L66: pushl %ecx pushl %ebx pushl %esi movl 8(%ebp), %eax pushl 48(%eax) call adler32 movl 8(%ebp), %ecx movl %eax, 48(%ecx) addl $16, %esp jmp .L28 .L65: cmpl $42, 4(%edi) jne .L26 jmp .L27 .size deflateSetDictionary, .-deflateSetDictionary # ---------------------- .p2align 2,,3 # ---------------------- .globl deflateReset .type deflateReset, @function deflateReset: pushl %ebp movl %esp, %ebp pushl %esi movl 8(%ebp), %esi testl %esi, %esi pushl %ebx je .L70 movl 28(%esi), %ebx testl %ebx, %ebx je .L70 movl 32(%esi), %edx testl %edx, %edx je .L70 movl 36(%esi), %edx testl %edx, %edx jne .L69 .p2align 2,,3 .L70: movl $-2, %ebx .L71: testl %ebx, %ebx je .L79 .L77: leal -8(%ebp), %esp movl %ebx, %eax popl %ebx popl %esi leave ret .p2align 2,,3 .L79: subl $12, %esp pushl 28(%esi) call lm_init addl $16, %esp jmp .L77 .p2align 2,,3 .L69: movl $2, 44(%esi) movl 24(%ebx), %eax movl 8(%ebx), %ecx testl %eax, %eax movl $0, 20(%esi) movl $0, 8(%esi) movl $0, 24(%esi) movl $0, 20(%ebx) movl %ecx, 16(%ebx) js .L80 .L72: movl 24(%ebx), %ecx xorl %edx, %edx testl %ecx, %ecx sete %dl decl %edx andl $-71, %edx addl $113, %edx cmpl $2, %ecx movl %edx, 4(%ebx) je .L81 pushl %eax pushl $0 pushl $0 pushl $0 call adler32 .L78: movl $0, 40(%ebx) movl %eax, 48(%esi) movl %ebx, (%esp) call _tr_init xorl %ebx, %ebx addl $16, %esp jmp .L71 .L81: pushl %eax pushl $0 pushl $0 pushl $0 call crc32 jmp .L78 .L80: negl %eax movl %eax, 24(%ebx) jmp .L72 .size deflateReset, .-deflateReset # ---------------------- .p2align 2,,3 # ---------------------- .globl deflateParams .type deflateParams, @function deflateParams: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx subl $28, %esp movl 8(%ebp), %edx testl %edx, %edx movl 12(%ebp), %ebx movl 16(%ebp), %edi movl $0, -20(%ebp) je .L87 movl 28(%edx), %esi testl %esi, %esi je .L87 cmpl $-1, %ebx je .L93 .L85: cmpl $9, %ebx ja .L87 testl %edi, %edi js .L87 cmpl $4, %edi jle .L86 .p2align 2,,3 .L87: movl $-2, %eax .L82: leal -12(%ebp), %esp popl %ebx popl %esi popl %edi leave ret .L86: movl 132(%esi), %eax leal (%eax,%eax,2), %ecx movl %eax, -28(%ebp) cmpl 136(%esi), %edi movl configuration_table+8(,%ecx,4), %eax movl %eax, -16(%ebp) je .L94 .L89: movl 8(%edx), %eax testl %eax, %eax jne .L95 .L88: cmpl %ebx, -28(%ebp) je .L91 leal (%ebx,%ebx,2), %ecx sall $2, %ecx movzwl configuration_table+2(%ecx), %edx movl %ebx, 132(%esi) movzwl configuration_table(%ecx), %ebx movl %edx, 128(%esi) movl %ebx, 140(%esi) movzwl configuration_table+4(%ecx), %edx movzwl configuration_table+6(%ecx), %ebx movl %edx, 144(%esi) movl %ebx, 124(%esi) .L91: movl %edi, 136(%esi) movl -20(%ebp), %eax jmp .L82 .L95: subl $8, %esp pushl $5 pushl %edx call deflate addl $16, %esp cmpl $-5, %eax movl %eax, -20(%ebp) je .L96 movl 132(%esi), %eax movl %eax, -28(%ebp) jmp .L88 .L96: xorl %ecx, %ecx cmpl $0, 20(%esi) sete %cl decl %ecx andl $-5, %ecx movl 132(%esi), %edx movl %ecx, -20(%ebp) movl %edx, -28(%ebp) jmp .L88 .L94: leal (%ebx,%ebx,2), %ecx cmpl configuration_table+8(,%ecx,4), %eax jne .L89 jmp .L88 .p2align 2,,3 .L93: movl $6, %ebx jmp .L85 .size deflateParams, .-deflateParams # ---------------------- .p2align 2,,3 # ---------------------- .globl deflateBound .type deflateBound, @function deflateBound: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx pushl %edi movl 12(%ebp), %ebx leal 7(%ebx), %eax shrl $3, %eax leal 63(%ebx), %esi leal (%eax,%ebx), %edi shrl $6, %esi movl 8(%ebp), %ecx leal (%esi,%edi), %eax testl %ecx, %ecx leal 5(%eax), %edi je .L99 movl 28(%ecx), %edx testl %edx, %edx jne .L98 .L99: addl $11, %eax .L97: popl %ebx popl %ebx popl %esi popl %edi leave ret .p2align 2,,3 .L98: movl 24(%edx), %eax cmpl $1, %eax je .L102 cmpl $1, %eax jle .L124 cmpl $2, %eax je .L105 .L119: movl $6, %esi .L100: cmpl $15, 48(%edx) je .L125 .L123: leal (%esi,%edi), %eax jmp .L97 .p2align 2,,3 .L125: cmpl $15, 80(%edx) jne .L123 movl %ebx, %edi shrl $12, %edi leal (%edi,%ebx), %edx shrl $14, %ebx addl %ebx, %edx shrl $11, %ebx addl %ebx, %edx leal 7(%esi,%edx), %eax jmp .L97 .L105: movl 28(%edx), %eax testl %eax, %eax movl $18, %esi movl %eax, -16(%ebp) je .L100 movl 16(%eax), %ecx testl %ecx, %ecx je .L107 movl 20(%eax), %esi addl $20, %esi .L107: movl -16(%ebp), %eax movl 28(%eax), %ecx testl %ecx, %ecx je .L108 .p2align 2,,3 .L109: movb (%ecx), %al incl %esi incl %ecx testb %al, %al jne .L109 .L108: movl -16(%ebp), %eax movl 36(%eax), %ecx testl %ecx, %ecx je .L113 .p2align 2,,3 .L114: movb (%ecx), %al incl %esi incl %ecx testb %al, %al jne .L114 .L113: movl -16(%ebp), %eax movl 44(%eax), %ecx testl %ecx, %ecx je .L100 addl $2, %esi jmp .L100 .L124: xorl %esi, %esi testl %eax, %eax je .L100 jmp .L119 .p2align 2,,3 .L102: movl 108(%edx), %eax testl %eax, %eax setne %al movzbl %al, %ecx leal 6(,%ecx,4), %esi jmp .L100 .size deflateBound, .-deflateBound # ---------------------- .p2align 2,,3 # ---------------------- .globl deflate .type deflate, @function deflate: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx subl $28, %esp movl 8(%ebp), %edx testl %edx, %edx je .L315 movl 8(%ebp), %edx movl 28(%edx), %esi testl %esi, %esi je .L315 cmpl $5, 12(%ebp) jg .L315 movl 12(%ebp), %ecx testl %ecx, %ecx js .L315 movl 8(%ebp), %edx movl 12(%edx), %ebx testl %ebx, %ebx je .L130 movl (%edx), %eax testl %eax, %eax jne .L131 movl 4(%edx), %edi testl %edi, %edi jne .L130 .L131: movl 4(%esi), %eax cmpl $666, %eax movl %eax, %edx je .L317 .L129: movl 8(%ebp), %ebx movl 16(%ebx), %edi testl %edi, %edi jne .L132 movl z_errmsg+28, %ecx movl %ecx, 24(%ebx) .L314: movl $-5, %eax .p2align 2,,3 .L126: leal -12(%ebp), %esp popl %ebx popl %esi popl %edi leave ret .L132: movl 8(%ebp), %ebx movl 40(%esi), %edi movl %ebx, (%esi) cmpl $42, %edx movl 12(%ebp), %ebx movl %edi, -16(%ebp) movl %ebx, 40(%esi) je .L318 .L133: cmpl $69, %eax je .L319 .L292: movl 20(%esi), %edi .L166: cmpl $73, %eax je .L320 .L182: cmpl $91, %eax je .L321 .L198: cmpl $103, %eax je .L322 .L214: testl %edi, %edi jne .L323 movl 8(%ebp), %eax movl 4(%eax), %ecx testl %ecx, %ecx jne .L229 movl -16(%ebp), %eax movl 12(%ebp), %edx sall $1, %eax sall $1, %edx cmpl $4, 12(%ebp) jle .L231 subl $9, %edx .L231: cmpl $4, -16(%ebp) jle .L232 subl $9, %eax .L232: cmpl %eax, %edx jg .L229 cmpl $4, 12(%ebp) je .L229 .L313: movl z_errmsg+28, %ecx movl 8(%ebp), %esi movl %ecx, 24(%esi) jmp .L314 .L229: movl 4(%esi), %eax cmpl $666, %eax je .L324 testl %ecx, %ecx jne .L236 .L309: movl 116(%esi), %ebx testl %ebx, %ebx jne .L236 movl 12(%ebp), %edx testl %edx, %edx je .L235 cmpl $666, %eax je .L235 .L236: movl 136(%esi), %eax cmpl $2, %eax je .L325 cmpl $3, %eax je .L326 subl $8, %esp movl 132(%esi), %ecx pushl 12(%ebp) leal (%ecx,%ecx,2), %edi pushl %esi call *configuration_table+8(,%edi,4) .L310: leal -2(%eax), %ebx addl $16, %esp cmpl $1, %ebx movl %eax, %edx ja .L241 movl $666, 4(%esi) .L241: testl %edx, %edx je .L243 cmpl $2, %edx je .L243 decl %edx je .L327 .L235: xorl %eax, %eax cmpl $4, 12(%ebp) jne .L126 movl 24(%esi), %edx testl %edx, %edx movl $1, %eax jle .L126 cmpl $2, %edx je .L328 movl 8(%ebp), %edi movl 48(%edi), %ecx movl %ecx, %ebx movl 20(%esi), %edi movl 8(%esi), %edx shrl $24, %ebx movb %bl, (%edi,%edx) movl 20(%esi), %ebx movl 8(%esi), %edi incl %ebx shrl $16, %ecx movl %ebx, 20(%esi) movb %cl, (%ebx,%edi) movl 8(%ebp), %eax movzwl 48(%eax), %ebx movl 20(%esi), %edi movl %ebx, %edx incl %edi movl 8(%esi), %ecx shrl $8, %edx movl %edi, 20(%esi) movb %dl, (%edi,%ecx) movl 20(%esi), %edi incl %edi movl 8(%esi), %edx movl %edi, 20(%esi) movb %bl, (%edi,%edx) .L311: movl 8(%ebp), %eax movl 28(%eax), %edi subl $12, %esp incl 20(%esi) pushl %edi call _tr_flush_bits movl 8(%ebp), %ecx movl 20(%edi), %ebx movl 16(%ecx), %eax addl $16, %esp cmpl %eax, %ebx jbe .L286 movl %eax, %ebx .L286: testl %ebx, %ebx jne .L329 .L288: movl 24(%esi), %eax testl %eax, %eax jle .L290 negl %eax movl %eax, 24(%esi) .L290: xorl %eax, %eax cmpl $0, 20(%esi) sete %al jmp .L126 .L329: pushl %eax pushl %ebx pushl 16(%edi) movl 8(%ebp), %eax pushl 12(%eax) call memcpy movl 8(%ebp), %ecx subl %ebx, 16(%ecx) movl 20(%edi), %edx addl %ebx, 12(%ecx) subl %ebx, %edx addl $16, %esp addl %ebx, 16(%edi) addl %ebx, 20(%ecx) testl %edx, %edx movl %edx, 20(%edi) jne .L288 movl 8(%edi), %ebx movl %ebx, 16(%edi) jmp .L288 .L328: movl 8(%ebp), %ebx movl 20(%esi), %edi movl 8(%esi), %edx movb 48(%ebx), %cl movb %cl, (%edi,%edx) movl 20(%esi), %edi movl 48(%ebx), %ecx movl 8(%esi), %edx incl %edi shrl $8, %ecx movl %edi, 20(%esi) movb %cl, (%edi,%edx) movl 20(%esi), %edi movl 8(%esi), %ecx movzwl 50(%ebx), %edx incl %edi movl %edi, 20(%esi) movb %dl, (%edi,%ecx) movl 20(%esi), %edi movl 8(%esi), %ecx movzbl 51(%ebx), %edx incl %edi movl %edi, 20(%esi) movb %dl, (%edi,%ecx) movl 20(%esi), %edi movl 8(%esi), %ecx movb 8(%ebx), %dl incl %edi movl %edi, 20(%esi) movb %dl, (%edi,%ecx) movl 20(%esi), %edi movl 8(%ebx), %ecx incl %edi movl 8(%esi), %edx shrl $8, %ecx movl %edi, 20(%esi) movb %cl, (%edi,%edx) movl 20(%esi), %edi incl %edi movl 8(%esi), %ecx movzwl 10(%ebx), %edx movl %edi, 20(%esi) movb %dl, (%edi,%ecx) movl 20(%esi), %edi incl %edi movl 8(%esi), %ecx movzbl 11(%ebx), %edx movl %edi, 20(%esi) movb %dl, (%edi,%ecx) jmp .L311 .L327: cmpl $1, 12(%ebp) je .L330 cmpl $5, 12(%ebp) je .L247 pushl $0 pushl $0 pushl $0 pushl %esi call _tr_stored_block addl $16, %esp cmpl $3, 12(%ebp) je .L331 .L247: movl 8(%ebp), %eax movl 28(%eax), %edi subl $12, %esp pushl %edi call _tr_flush_bits movl 8(%ebp), %ecx movl 20(%edi), %ebx movl 16(%ecx), %eax addl $16, %esp cmpl %eax, %ebx jbe .L275 movl %eax, %ebx .L275: testl %ebx, %ebx jne .L332 .L277: testl %eax, %eax jne .L235 .L316: movl $-1, 40(%esi) .L312: xorl %eax, %eax jmp .L126 .L332: pushl %eax pushl %ebx pushl 16(%edi) movl 8(%ebp), %eax pushl 12(%eax) call memcpy movl 8(%ebp), %ecx subl %ebx, 16(%ecx) movl 20(%edi), %edx addl %ebx, 12(%ecx) subl %ebx, %edx addl $16, %esp addl %ebx, 16(%edi) addl %ebx, 20(%ecx) testl %edx, %edx movl %edx, 20(%edi) jne .L306 movl 8(%edi), %ebx movl %ebx, 16(%edi) movl 8(%ebp), %edi movl 16(%edi), %eax jmp .L277 .L306: movl 8(%ebp), %edx movl 16(%edx), %eax jmp .L277 .L331: movl 76(%esi), %edx movl 68(%esi), %ebx sall $1, %edx movw $0, -2(%edx,%ebx) subl $2, %edx pushl %ecx pushl %edx pushl $0 pushl %ebx call memset movl 116(%esi), %edi addl $16, %esp testl %edi, %edi jne .L247 movl $0, 108(%esi) movl $0, 92(%esi) movl $0, 5812(%esi) jmp .L247 .p2align 2,,3 .L330: subl $12, %esp pushl %esi call _tr_align addl $16, %esp jmp .L247 .p2align 2,,3 .L243: movl 8(%ebp), %edx movl 16(%edx), %eax testl %eax, %eax jne .L312 jmp .L316 .L326: subl $8, %esp pushl 12(%ebp) pushl %esi call deflate_rle jmp .L310 .L325: subl $8, %esp pushl 12(%ebp) pushl %esi call deflate_huff jmp .L310 .L324: testl %ecx, %ecx je .L309 jmp .L313 .L323: movl 8(%ebp), %ebx subl $12, %esp movl 28(%ebx), %edi pushl %edi call _tr_flush_bits movl 8(%ebp), %ecx movl 20(%edi), %ebx movl 16(%ecx), %eax addl $16, %esp cmpl %eax, %ebx jbe .L224 movl %eax, %ebx .L224: testl %ebx, %ebx jne .L333 .L226: testl %eax, %eax je .L316 movl 8(%ebp), %edi movl 4(%edi), %ecx jmp .L229 .L333: pushl %ecx pushl %ebx pushl 16(%edi) movl 8(%ebp), %eax pushl 12(%eax) call memcpy movl 8(%ebp), %ecx subl %ebx, 16(%ecx) movl 20(%edi), %edx addl %ebx, 12(%ecx) subl %ebx, %edx addl $16, %esp addl %ebx, 16(%edi) addl %ebx, 20(%ecx) testl %edx, %edx movl %edx, 20(%edi) jne .L304 movl 8(%edi), %ebx movl %ebx, 16(%edi) movl 8(%ebp), %edi movl 16(%edi), %eax jmp .L226 .L304: movl 8(%ebp), %edx movl 16(%edx), %eax jmp .L226 .L322: movl 28(%esi), %edx movl 44(%edx), %ebx testl %ebx, %ebx je .L215 leal 2(%edi), %ecx movl 12(%esi), %edx cmpl %edx, %ecx ja .L334 .L216: leal 2(%edi), %ecx cmpl %edx, %ecx ja .L214 movl 8(%ebp), %eax movl 8(%esi), %ebx movb 48(%eax), %dl movb %dl, (%edi,%ebx) movl 8(%ebp), %ebx movl 20(%esi), %edi movl 48(%ebx), %ecx movl 8(%esi), %edx incl %edi shrl $8, %ecx movl %edi, 20(%esi) movb %cl, (%edi,%edx) incl 20(%esi) pushl %edi pushl $0 pushl $0 pushl $0 call crc32 movl %eax, 48(%ebx) movl $113, 4(%esi) addl $16, %esp movl 20(%esi), %edi jmp .L214 .L334: movl 8(%ebp), %eax movl 28(%eax), %edi subl $12, %esp pushl %edi call _tr_flush_bits movl 8(%ebp), %ecx movl 20(%edi), %ebx movl 16(%ecx), %eax addl $16, %esp cmpl %eax, %ebx jbe .L217 movl %eax, %ebx .L217: testl %ebx, %ebx jne .L335 .L303: movl 20(%esi), %edi movl 12(%esi), %edx jmp .L216 .L335: pushl %eax pushl %ebx pushl 16(%edi) movl 8(%ebp), %eax pushl 12(%eax) call memcpy movl 8(%ebp), %ecx subl %ebx, 16(%ecx) movl 20(%edi), %edx addl %ebx, 12(%ecx) subl %ebx, %edx addl $16, %esp addl %ebx, 16(%edi) addl %ebx, 20(%ecx) testl %edx, %edx movl %edx, 20(%edi) jne .L303 movl 8(%edi), %ebx movl %ebx, 16(%edi) jmp .L303 .p2align 2,,3 .L215: movl $113, 4(%esi) jmp .L214 .L321: movl 28(%esi), %ebx movl 36(%ebx), %eax testl %eax, %eax je .L199 movl %edi, %ecx .L200: cmpl 12(%esi), %edi je .L336 .L203: movl 32(%esi), %edx movl 36(%ebx), %eax movzbl (%edx,%eax), %ebx incl %edx movl %edx, 32(%esi) movl 8(%esi), %edx movb %bl, (%edi,%edx) movl 20(%esi), %eax incl %eax testl %ebx, %ebx movl %eax, 20(%esi) je .L337 movl %eax, %edi movl 28(%esi), %ebx jmp .L200 .L337: movl %eax, %edi .L201: movl 28(%esi), %eax movl 44(%eax), %edx testl %edx, %edx je .L211 cmpl %ecx, %edi ja .L338 .L211: testl %ebx, %ebx jne .L301 .L199: movl $103, 4(%esi) movl $103, %eax jmp .L198 .L301: movl 4(%esi), %eax jmp .L198 .L338: subl %ecx, %edi pushl %eax pushl %edi addl 8(%esi), %ecx pushl %ecx movl 8(%ebp), %ecx pushl 48(%ecx) call crc32 movl 8(%ebp), %edi movl %eax, 48(%edi) addl $16, %esp movl 20(%esi), %edi jmp .L211 .p2align 2,,3 .L336: movl 44(%ebx), %eax testl %eax, %eax je .L204 cmpl %ecx, %edi ja .L339 .L204: movl 8(%ebp), %ebx subl $12, %esp movl 28(%ebx), %edi pushl %edi call _tr_flush_bits movl 8(%ebp), %ecx movl 20(%edi), %ebx movl 16(%ecx), %eax addl $16, %esp cmpl %eax, %ebx jbe .L205 movl %eax, %ebx .L205: testl %ebx, %ebx jne .L340 .L207: movl 20(%esi), %edi cmpl 12(%esi), %edi movl %edi, %ecx je .L308 movl 28(%esi), %ebx jmp .L203 .L308: movl $1, %ebx jmp .L201 .L340: pushl %eax pushl %ebx pushl 16(%edi) movl 8(%ebp), %eax pushl 12(%eax) call memcpy movl 8(%ebp), %ecx subl %ebx, 16(%ecx) movl 20(%edi), %edx addl %ebx, 12(%ecx) subl %ebx, %edx addl $16, %esp addl %ebx, 16(%edi) addl %ebx, 20(%ecx) testl %edx, %edx movl %edx, 20(%edi) jne .L207 movl 8(%edi), %ebx movl %ebx, 16(%edi) jmp .L207 .L339: subl %ecx, %edi pushl %eax pushl %edi addl 8(%esi), %ecx pushl %ecx movl 8(%ebp), %edi pushl 48(%edi) call crc32 movl %eax, 48(%edi) addl $16, %esp jmp .L204 .L320: movl 28(%esi), %ebx movl 28(%ebx), %ecx testl %ecx, %ecx je .L183 movl %edi, %ecx .L184: cmpl 12(%esi), %edi je .L341 .L187: movl 32(%esi), %edx movl 28(%ebx), %eax movzbl (%edx,%eax), %ebx incl %edx movl %edx, 32(%esi) movl 8(%esi), %edx movb %bl, (%edi,%edx) movl 20(%esi), %eax incl %eax testl %ebx, %ebx movl %eax, 20(%esi) je .L342 movl %eax, %edi movl 28(%esi), %ebx jmp .L184 .L342: movl %eax, %edi .L185: movl 28(%esi), %eax movl 44(%eax), %edx testl %edx, %edx je .L195 cmpl %ecx, %edi ja .L343 .L195: testl %ebx, %ebx jne .L298 movl $0, 32(%esi) .L183: movl $91, 4(%esi) movl $91, %eax jmp .L182 .L298: movl 4(%esi), %eax jmp .L182 .L343: subl %ecx, %edi pushl %eax pushl %edi addl 8(%esi), %ecx pushl %ecx movl 8(%ebp), %ecx pushl 48(%ecx) call crc32 movl 8(%ebp), %edi movl %eax, 48(%edi) addl $16, %esp movl 20(%esi), %edi jmp .L195 .p2align 2,,3 .L341: movl 44(%ebx), %edx testl %edx, %edx je .L188 cmpl %ecx, %edi ja .L344 .L188: movl 8(%ebp), %eax movl 28(%eax), %edi subl $12, %esp pushl %edi call _tr_flush_bits movl 8(%ebp), %ecx movl 20(%edi), %ebx movl 16(%ecx), %eax addl $16, %esp cmpl %eax, %ebx jbe .L189 movl %eax, %ebx .L189: testl %ebx, %ebx jne .L345 .L191: movl 20(%esi), %edi cmpl 12(%esi), %edi movl %edi, %ecx je .L307 movl 28(%esi), %ebx jmp .L187 .L307: movl $1, %ebx jmp .L185 .L345: pushl %eax pushl %ebx pushl 16(%edi) movl 8(%ebp), %eax pushl 12(%eax) call memcpy movl 8(%ebp), %ecx subl %ebx, 16(%ecx) movl 20(%edi), %edx addl %ebx, 12(%ecx) subl %ebx, %edx addl $16, %esp addl %ebx, 16(%edi) addl %ebx, 20(%ecx) testl %edx, %edx movl %edx, 20(%edi) jne .L191 movl 8(%edi), %ebx movl %ebx, 16(%edi) jmp .L191 .L344: subl %ecx, %edi pushl %eax pushl %edi addl 8(%esi), %ecx pushl %ecx movl 8(%ebp), %edi pushl 48(%edi) call crc32 movl 8(%ebp), %ebx movl %eax, 48(%ebx) addl $16, %esp jmp .L188 .L319: movl 28(%esi), %ebx movl 16(%ebx), %ecx testl %ecx, %ecx movl %ebx, -24(%ebp) je .L167 movzwl 20(%ebx), %edx movl 20(%esi), %edi cmpl %edx, 32(%esi) movl %edi, -20(%ebp) jae .L169 .L178: cmpl 12(%esi), %edi je .L346 .L171: movl 32(%esi), %eax movl 16(%ebx), %edx movb (%eax,%edx), %bl movl 8(%esi), %ecx movb %bl, (%edi,%ecx) movl 20(%esi), %ecx movl 32(%esi), %edx incl %ecx incl %edx movl 28(%esi), %ebx movl %ecx, 20(%esi) movl %edx, 32(%esi) movzwl 20(%ebx), %eax cmpl %eax, %edx movl %ebx, -24(%ebp) movl %ecx, %edi jae .L169 movl %ecx, %edi jmp .L178 .L169: movl 44(%ebx), %edx testl %edx, %edx je .L179 cmpl -20(%ebp), %edi ja .L347 .L179: movl 20(%ebx), %edx cmpl %edx, 32(%esi) je .L348 movl 4(%esi), %eax jmp .L166 .L348: movl $0, 32(%esi) movl $73, 4(%esi) movl $73, %eax jmp .L166 .L347: subl -20(%ebp), %edi pushl %edx pushl %edi movl 8(%esi), %ecx addl %ecx, -20(%ebp) pushl -20(%ebp) movl 8(%ebp), %eax pushl 48(%eax) call crc32 movl 8(%ebp), %edi movl %eax, 48(%edi) addl $16, %esp movl 20(%esi), %edi movl 28(%esi), %ebx jmp .L179 .p2align 2,,3 .L346: movl -24(%ebp), %eax movl 44(%eax), %ecx testl %ecx, %ecx je .L172 cmpl -20(%ebp), %edi ja .L349 .L172: movl 8(%ebp), %eax movl 28(%eax), %edi subl $12, %esp pushl %edi call _tr_flush_bits movl 8(%ebp), %ecx movl 20(%edi), %ebx movl 16(%ecx), %eax addl $16, %esp cmpl %eax, %ebx jbe .L173 movl %eax, %ebx .L173: testl %ebx, %ebx jne .L350 .L175: movl 20(%esi), %edi cmpl 12(%esi), %edi movl %edi, -20(%ebp) je .L293 movl 28(%esi), %ebx jmp .L171 .L293: movl 28(%esi), %ebx jmp .L169 .L350: pushl %eax pushl %ebx pushl 16(%edi) movl 8(%ebp), %eax pushl 12(%eax) call memcpy movl 8(%ebp), %ecx subl %ebx, 16(%ecx) movl 20(%edi), %edx addl %ebx, 12(%ecx) subl %ebx, %edx addl $16, %esp addl %ebx, 16(%edi) addl %ebx, 20(%ecx) testl %edx, %edx movl %edx, 20(%edi) jne .L175 movl 8(%edi), %ebx movl %ebx, 16(%edi) jmp .L175 .L349: subl -20(%ebp), %edi pushl %eax pushl %edi movl 8(%esi), %edx addl %edx, -20(%ebp) pushl -20(%ebp) movl 8(%ebp), %edi pushl 48(%edi) call crc32 movl 8(%ebp), %ebx movl %eax, 48(%ebx) addl $16, %esp jmp .L172 .L167: movl $73, 4(%esi) movl $73, %eax jmp .L292 .L318: cmpl $2, 24(%esi) je .L351 movl 48(%esi), %edi subl $8, %edi sall $12, %edi cmpl $1, 136(%esi) leal 2048(%edi), %ebx jle .L352 .L155: xorl %eax, %eax .L156: sall $6, %eax orl %eax, %ebx movl 108(%esi), %eax testl %eax, %eax je .L161 orl $32, %ebx .L161: movl $31, %ecx movl %ebx, %eax xorl %edx, %edx divl %ecx movl %ebx, %edi subl %edx, %edi leal 31(%edi), %ebx movl %ebx, %ecx movl 20(%esi), %edi movl 8(%esi), %edx shrl $8, %ecx movl $113, 4(%esi) movb %cl, (%edi,%edx) movl 20(%esi), %ecx incl %ecx movl 8(%esi), %edi movl %ecx, 20(%esi) movb %bl, (%ecx,%edi) movl 20(%esi), %ebx movl 108(%esi), %edx incl %ebx testl %edx, %edx movl %ebx, 20(%esi) je .L163 movl 8(%ebp), %edi movl 48(%edi), %edx movl %edx, %ecx movl 8(%esi), %edi shrl $24, %ecx movb %cl, (%ebx,%edi) movl 20(%esi), %ebx movl 8(%esi), %edi incl %ebx shrl $16, %edx movl %ebx, 20(%esi) movb %dl, (%ebx,%edi) movl 8(%ebp), %eax movzwl 48(%eax), %ebx movl 20(%esi), %edi movl %ebx, %edx incl %edi movl 8(%esi), %ecx shrl $8, %edx movl %edi, 20(%esi) movb %dl, (%edi,%ecx) movl 20(%esi), %edi incl %edi movl 8(%esi), %edx movl %edi, 20(%esi) movb %bl, (%edi,%edx) incl 20(%esi) .L163: pushl %eax pushl $0 pushl $0 pushl $0 call adler32 movl 8(%ebp), %edx movl %eax, 48(%edx) addl $16, %esp movl 4(%esi), %eax jmp .L133 .L352: movl 132(%esi), %edx cmpl $1, %edx jle .L155 cmpl $5, %edx movl $1, %eax jle .L156 xorl %eax, %eax cmpl $6, %edx setne %al addl $2, %eax jmp .L156 .L351: pushl %eax pushl $0 pushl $0 pushl $0 call crc32 movl 8(%ebp), %edx movl 20(%esi), %ecx movl %eax, 48(%edx) movl 8(%esi), %eax movb $31, (%ecx,%eax) movl 20(%esi), %edi incl %edi movl 8(%esi), %ebx movl %edi, 20(%esi) movb $139, (%edi,%ebx) movl 20(%esi), %ecx incl %ecx movl 8(%esi), %edx movl %ecx, 20(%esi) movb $8, (%ecx,%edx) movl 20(%esi), %eax movl 28(%esi), %edx leal 1(%eax), %ecx addl $16, %esp testl %edx, %edx movl %ecx, 20(%esi) jne .L135 movl 8(%esi), %ebx movb $0, (%ecx,%ebx) movl 20(%esi), %edi movl 8(%esi), %edx incl %edi movl %edi, 20(%esi) movb $0, (%edi,%edx) movl 20(%esi), %ebx incl %ebx movl 8(%esi), %ecx movl %ebx, 20(%esi) movb $0, (%ebx,%ecx) movl 20(%esi), %edi incl %edi movl 8(%esi), %edx movl %edi, 20(%esi) movb $0, (%edi,%edx) movl 20(%esi), %ebx incl %ebx movl 8(%esi), %ecx movl %ebx, 20(%esi) movb $0, (%ebx,%ecx) movl 20(%esi), %edi movl 132(%esi), %edx leal 1(%edi), %ecx addl $2, %edi cmpl $9, %edx movl 8(%esi), %ebx movl %edi, 20(%esi) movb $2, %al je .L137 cmpl $1, 136(%esi) jle .L353 .L140: movb $4, %al .L137: movb %al, (%ecx,%ebx) movl 8(%esi), %eax movl 20(%esi), %ecx movb $3, (%ecx,%eax) incl 20(%esi) movl $113, 4(%esi) movl $113, %eax jmp .L133 .L353: xorl %eax, %eax decl %edx jg .L137 jmp .L140 .p2align 2,,3 .L135: addl $2, %eax movl %eax, 20(%esi) movl 44(%edx), %edi xorl %eax, %eax cmpl $0, (%edx) setne %al testl %edi, %edi movl 8(%esi), %ebx je .L142 addl $2, %eax .L142: movl 16(%edx), %edi testl %edi, %edi je .L143 addl $4, %eax .L143: movl 28(%edx), %edi testl %edi, %edi je .L144 addl $8, %eax .L144: movl 36(%edx), %edi testl %edi, %edi je .L145 addl $16, %eax .L145: movb %al, (%ecx,%ebx) movl 28(%esi), %edx movl 20(%esi), %ebx movb 4(%edx), %cl movl 8(%esi), %edi movb %cl, (%ebx,%edi) movl 28(%esi), %edx movl 20(%esi), %ebx movl 4(%edx), %ecx incl %ebx movl 8(%esi), %edi shrl $8, %ecx movl %ebx, 20(%esi) movb %cl, (%ebx,%edi) movl 20(%esi), %ebx movl 28(%esi), %edx incl %ebx movzwl 6(%edx), %ecx movl 8(%esi), %edi movl %ebx, 20(%esi) movb %cl, (%ebx,%edi) movl 20(%esi), %ebx movl 28(%esi), %edx incl %ebx movzbl 7(%edx), %ecx movl 8(%esi), %edi movl %ebx, 20(%esi) movb %cl, (%ebx,%edi) movl 20(%esi), %edx leal 1(%edx), %ecx addl $2, %edx movl %edx, 20(%esi) movl 132(%esi), %edx cmpl $9, %edx movl 8(%esi), %ebx movb $2, %al je .L147 cmpl $1, 136(%esi) jle .L354 .L150: movb $4, %al .L147: movb %al, (%ecx,%ebx) movl 28(%esi), %edx movl 20(%esi), %ebx movb 12(%edx), %cl movl 8(%esi), %edi movb %cl, (%ebx,%edi) movl 28(%esi), %ebx movl 20(%esi), %ecx movl 16(%ebx), %eax incl %ecx testl %eax, %eax movl %ecx, 20(%esi) je .L151 movb 20(%ebx), %dl movl 8(%esi), %edi movb %dl, (%ecx,%edi) movl 20(%esi), %ebx incl %ebx movl %ebx, 20(%esi) movl 28(%esi), %edx movl 20(%edx), %ecx movl 8(%esi), %edi shrl $8, %ecx movb %cl, (%ebx,%edi) incl 20(%esi) movl 28(%esi), %ebx .L151: movl 44(%ebx), %eax testl %eax, %eax jne .L355 .L152: movl $0, 32(%esi) movl $69, 4(%esi) movl $69, %eax jmp .L133 .L355: pushl %ecx pushl 20(%esi) pushl 8(%esi) movl 8(%ebp), %ecx pushl 48(%ecx) call crc32 movl 8(%ebp), %ebx movl %eax, 48(%ebx) addl $16, %esp jmp .L152 .L354: xorl %eax, %eax decl %edx jg .L147 jmp .L150 .p2align 2,,3 .L317: cmpl $4, 12(%ebp) je .L129 .p2align 2,,3 .L130: movl z_errmsg+16, %edx movl 8(%ebp), %esi movl %edx, 24(%esi) .p2align 2,,3 .L315: movl $-2, %eax jmp .L126 .size deflate, .-deflate # ---------------------- .p2align 2,,3 # ---------------------- .globl deflateEnd .type deflateEnd, @function deflateEnd: pushl %ebp movl %esp, %ebp pushl %esi pushl %ebx movl 8(%ebp), %ebx testl %ebx, %ebx je .L358 movl 28(%ebx), %edx testl %edx, %edx movl %edx, %ecx jne .L357 .L358: movl $-2, %eax .L356: leal -8(%ebp), %esp popl %ebx popl %esi leave ret .p2align 2,,3 .L357: movl 4(%edx), %esi cmpl $42, %esi je .L359 cmpl $69, %esi je .L359 cmpl $73, %esi je .L359 cmpl $91, %esi je .L359 cmpl $103, %esi je .L359 cmpl $113, %esi je .L359 cmpl $666, %esi movl $-2, %eax jne .L356 .p2align 2,,3 .L359: movl 8(%ecx), %eax testl %eax, %eax jne .L366 .L360: movl 68(%edx), %eax testl %eax, %eax jne .L367 .L361: movl 64(%edx), %eax testl %eax, %eax jne .L368 .L362: movl 56(%edx), %eax testl %eax, %eax jne .L369 .L363: subl $8, %esp pushl 28(%ebx) pushl 40(%ebx) call *36(%ebx) xorl %edx, %edx addl $16, %esp cmpl $113, %esi setne %dl movl $0, 28(%ebx) leal -3(%edx,%edx,2), %eax jmp .L356 .p2align 2,,3 .L369: subl $8, %esp pushl %eax pushl 40(%ebx) call *36(%ebx) addl $16, %esp jmp .L363 .p2align 2,,3 .L368: subl $8, %esp pushl %eax pushl 40(%ebx) call *36(%ebx) addl $16, %esp movl 28(%ebx), %edx jmp .L362 .p2align 2,,3 .L367: subl $8, %esp pushl %eax pushl 40(%ebx) call *36(%ebx) addl $16, %esp movl 28(%ebx), %edx jmp .L361 .p2align 2,,3 .L366: subl $8, %esp pushl %eax pushl 40(%ebx) call *36(%ebx) addl $16, %esp movl 28(%ebx), %edx jmp .L360 .size deflateEnd, .-deflateEnd # ---------------------- .p2align 2,,3 # ---------------------- .globl deflateCopy .type deflateCopy, @function deflateCopy: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx subl $12, %esp movl 12(%ebp), %esi testl %esi, %esi movl 8(%ebp), %ebx je .L372 testl %ebx, %ebx je .L372 movl 28(%esi), %edx testl %edx, %edx movl %edx, -20(%ebp) jne .L371 .L372: movl $-2, %eax .L370: leal -12(%ebp), %esp popl %ebx popl %esi popl %edi leave ret .p2align 2,,3 .L371: cld movl $14, %ecx movl %ebx, %edi rep movsl pushl %eax pushl $5828 pushl $1 pushl 40(%ebx) call *32(%ebx) movl %eax, -16(%ebp) movl -16(%ebp), %edx addl $16, %esp testl %edx, %edx movl $-4, %eax je .L370 movl -16(%ebp), %eax movl %eax, 28(%ebx) cld movl %eax, %edi movl -20(%ebp), %esi movl $1457, %ecx rep movsl movl %ebx, (%eax) pushl %esi pushl $2 pushl 44(%eax) pushl 40(%ebx) call *32(%ebx) addl $12, %esp movl -16(%ebp), %edi movl %eax, 56(%edi) pushl $2 pushl 44(%edi) pushl 40(%ebx) call *32(%ebx) addl $12, %esp movl -16(%ebp), %ecx movl %eax, 64(%ecx) pushl $2 pushl 76(%ecx) pushl 40(%ebx) call *32(%ebx) addl $12, %esp movl -16(%ebp), %esi movl %eax, 68(%esi) pushl $4 pushl 5788(%esi) pushl 40(%ebx) call *32(%ebx) movl %eax, %esi movl -16(%ebp), %eax movl 56(%eax), %edx addl $16, %esp testl %edx, %edx movl %esi, 8(%eax) je .L375 movl 64(%eax), %edi testl %edi, %edi je .L375 movl 68(%eax), %ecx testl %ecx, %ecx je .L375 testl %esi, %esi je .L375 movl -16(%ebp), %eax movl 44(%eax), %ebx sall $1, %ebx pushl %ecx pushl %ebx movl -20(%ebp), %ebx pushl 56(%ebx) pushl %edx call memcpy movl -16(%ebp), %edi movl 44(%edi), %edx addl $12, %esp sall $1, %edx pushl %edx pushl 64(%ebx) pushl 64(%edi) call memcpy movl -16(%ebp), %edi movl 76(%edi), %ecx addl $12, %esp sall $1, %ecx pushl %ecx pushl 68(%ebx) pushl 68(%edi) call memcpy movl -16(%ebp), %edi addl $12, %esp pushl 12(%edi) movl -20(%ebp), %edx pushl 8(%edx) pushl 8(%edi) call memcpy movl -20(%ebp), %ebx movl 16(%ebx), %eax subl 8(%ebx), %eax movl 8(%edi), %ebx leal (%eax,%ebx), %ecx movl %ecx, 16(%edi) movl 5788(%edi), %ecx movl %ecx, %eax andl $-2, %eax leal (%eax,%esi), %edx leal (%ecx,%ecx,2), %esi addl %esi, %ebx movl %ebx, 5784(%edi) movl %edi, %ebx addl $148, %ebx movl %ebx, 2840(%edi) addl $2292, %ebx movl %ebx, 2852(%edi) addl $244, %ebx movl %edx, 5796(%edi) movl %ebx, 2864(%edi) xorl %eax, %eax jmp .L370 .p2align 2,,3 .L375: subl $12, %esp pushl %ebx call deflateEnd movl $-4, %eax jmp .L370 .size deflateCopy, .-deflateCopy # ---------------------- .p2align 2,,3 # ---------------------- .local lm_init .type lm_init, @function lm_init: pushl %ebp movl %esp, %ebp pushl %ebx subl $8, %esp movl 8(%ebp), %ebx movl 44(%ebx), %ecx movl 76(%ebx), %edx sall $1, %ecx movl %ecx, 60(%ebx) sall $1, %edx movl 68(%ebx), %ecx movw $0, -2(%edx,%ecx) subl $2, %edx pushl %edx pushl $0 pushl %ecx call memset movl 132(%ebx), %edx leal (%edx,%edx,2), %ecx sall $2, %ecx movzwl configuration_table+2(%ecx), %edx movl %edx, 128(%ebx) movzwl configuration_table(%ecx), %edx movl %edx, 140(%ebx) movzwl configuration_table+4(%ecx), %edx movl %edx, 144(%ebx) movzwl configuration_table+6(%ecx), %edx movl %edx, 124(%ebx) movl $0, 108(%ebx) movl $0, 92(%ebx) movl $0, 116(%ebx) movl $0, 5812(%ebx) movl $2, 120(%ebx) movl $2, 96(%ebx) movl $0, 104(%ebx) movl $0, 72(%ebx) addl $16, %esp movl -4(%ebp), %ebx leave ret .size lm_init, .-lm_init # ---------------------- .p2align 2,,3 # ---------------------- .local fill_window .type fill_window, @function fill_window: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx subl $60, %esp movl 8(%ebp), %edx movl 44(%edx), %eax movl 8(%ebp), %ecx movl %eax, -20(%ebp) movl 116(%ecx), %edi .p2align 2,,3 .L422: movl 8(%ebp), %ecx movl 60(%ecx), %edx movl -20(%ebp), %esi movl 8(%ebp), %ecx subl %edi, %edx movl 108(%ecx), %ebx leal -262(%eax,%esi), %edi subl %ebx, %edx cmpl %edi, %ebx movl %edx, -16(%ebp) jae .L517 .L429: movl 8(%ebp), %ebx movl (%ebx), %esi movl 4(%esi), %edx testl %edx, %edx je .L423 movl 8(%ebp), %eax movl 108(%eax), %ebx addl 56(%eax), %ebx movl 116(%eax), %edi addl %edi, %ebx cmpl -16(%ebp), %edx movl %ebx, -24(%ebp) movl %edx, %ebx jbe .L443 movl -16(%ebp), %ebx .L443: xorl %eax, %eax testl %ebx, %ebx jne .L518 .L445: movl 8(%ebp), %ebx leal (%eax,%edi), %esi movl 5812(%ebx), %edx leal (%edx,%esi), %edi cmpl $2, %edi movl %esi, 116(%ebx) movl %edx, -44(%ebp) jbe .L512 movl 8(%ebp), %ecx movl 108(%ecx), %ebx subl %edx, %ebx movl 56(%ecx), %edx movl %edx, -28(%ebp) movzbl (%ebx,%edx), %edi movl 88(%ecx), %edx movl %edx, -32(%ebp) movl %edi, 72(%ecx) movb -32(%ebp), %cl sall %cl, %edi movl -28(%ebp), %ecx movzbl 1(%ebx,%ecx), %edx xorl %edx, %edi movl 8(%ebp), %edx movl 84(%edx), %ecx movl -44(%ebp), %eax andl %ecx, %edi movl %ecx, -36(%ebp) testl %eax, %eax movl 8(%ebp), %ecx movl %edi, 72(%ecx) je .L513 movl %esi, %edi movl 68(%ecx), %eax movl 64(%ecx), %edx movl 52(%ecx), %esi movl %eax, -56(%ebp) movl %edx, -40(%ebp) movl %esi, -48(%ebp) .p2align 2,,3 .L454: movl 8(%ebp), %esi movl 72(%esi), %eax movb -32(%ebp), %cl movl -28(%ebp), %edx sall %cl, %eax movzbl 2(%ebx,%edx), %ecx xorl %ecx, %eax andl -36(%ebp), %eax movl 8(%ebp), %ecx movl %eax, 72(%ecx) movl -56(%ebp), %edx movl -48(%ebp), %ecx movw (%edx,%eax,2), %si andl %ebx, %ecx movl -40(%ebp), %edx movw %si, (%edx,%ecx,2) movl -44(%ebp), %edx decl %edx movl -56(%ebp), %esi leal (%edx,%edi), %ecx movw %bx, (%esi,%eax,2) incl %ebx movl 8(%ebp), %eax cmpl $2, %ecx movl %edx, 5812(%eax) jbe .L424 testl %edx, %edx movl %edx, -44(%ebp) jne .L454 .p2align 2,,3 .L424: cmpl $261, %edi ja .L423 movl 8(%ebp), %eax movl (%eax), %ecx movl 4(%ecx), %edx testl %edx, %edx je .L423 movl 8(%ebp), %ebx movl 44(%ebx), %eax jmp .L422 .L423: movl 8(%ebp), %edi movl 5824(%edi), %edx movl 60(%edi), %ecx cmpl %ecx, %edx jae .L421 movl 116(%edi), %ebx addl 108(%edi), %ebx cmpl %ebx, %edx jae .L458 movl %ecx, %esi subl %ebx, %esi cmpl $258, %esi jbe .L459 movl $258, %esi .L459: movl 8(%ebp), %eax movl 56(%eax), %ecx pushl %edx pushl %esi pushl $0 addl %ebx, %ecx pushl %ecx call memset leal (%esi,%ebx), %edx movl 8(%ebp), %esi addl $16, %esp movl %edx, 5824(%esi) .L421: leal -12(%ebp), %esp popl %ebx popl %esi popl %edi leave ret .L458: leal 258(%ebx), %edi cmpl %edi, %edx jae .L421 subl %edx, %ebx movl %ecx, %eax leal 258(%ebx), %esi subl %edx, %eax cmpl %eax, %esi jbe .L486 movl %eax, %esi .L486: movl 8(%ebp), %ecx addl 56(%ecx), %edx pushl %eax pushl %esi pushl $0 pushl %edx call memset movl 8(%ebp), %ebx addl $16, %esp addl %esi, 5824(%ebx) jmp .L421 .p2align 2,,3 .L513: movl %esi, %edi jmp .L424 .p2align 2,,3 .L512: movl 8(%ebp), %ebx movl 116(%ebx), %edi jmp .L424 .L518: subl %ebx, %edx movl %edx, 4(%esi) pushl %eax pushl %ebx pushl (%esi) pushl -24(%ebp) call memcpy movl 28(%esi), %edx movl 24(%edx), %eax addl $16, %esp cmpl $1, %eax je .L519 cmpl $2, %eax je .L520 .L447: movl 8(%ebp), %ecx addl %ebx, (%esi) addl %ebx, 8(%esi) movl %ebx, %eax movl 116(%ecx), %edi jmp .L445 .L520: pushl %eax pushl %ebx pushl -24(%ebp) pushl 48(%esi) call crc32 .L516: addl $16, %esp movl %eax, 48(%esi) jmp .L447 .L519: pushl %eax pushl %ebx pushl -24(%ebp) pushl 48(%esi) call adler32 jmp .L516 .L517: movl 56(%ecx), %ebx pushl %ecx pushl %esi leal (%esi,%ebx), %edx pushl %edx pushl %ebx call memcpy movl 8(%ebp), %edi subl %esi, 112(%edi) subl %esi, 108(%edi) subl %esi, 92(%edi) movl 76(%edi), %ecx movl 68(%edi), %esi movl %esi, -56(%ebp) leal (%esi,%ecx,2), %edx addl $16, %esp .p2align 2,,3 .L430: subl $2, %edx movzwl (%edx), %eax xorl %ebx, %ebx cmpl -20(%ebp), %eax jb .L434 movl %eax, %ebx subw -20(%ebp), %bx .L434: decl %ecx movw %bx, (%edx) jne .L430 movl 8(%ebp), %edi movl -20(%ebp), %ecx movl 64(%edi), %eax leal (%eax,%ecx,2), %edx .p2align 2,,3 .L436: subl $2, %edx movzwl (%edx), %eax xorl %ebx, %ebx cmpl -20(%ebp), %eax jb .L440 movl %eax, %ebx subw -20(%ebp), %bx .L440: decl %ecx movw %bx, (%edx) jne .L436 movl -20(%ebp), %ecx addl %ecx, -16(%ebp) jmp .L429 .size fill_window, .-fill_window # ---------------------- .p2align 2,,3 # ---------------------- .local deflate_stored .type deflate_stored, @function deflate_stored: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx subl $12, %esp movl 8(%ebp), %ecx movl 12(%ecx), %eax movl $65535, -16(%ebp) subl $5, %eax cmpl %eax, -16(%ebp) jbe .L523 movl %eax, -16(%ebp) .p2align 2,,3 .L523: movl 8(%ebp), %ecx movl 116(%ecx), %edx cmpl $1, %edx jbe .L565 .L526: movl 8(%ebp), %edi movl 108(%edi), %eax addl %edx, %eax movl 92(%edi), %ecx movl -16(%ebp), %esi testl %eax, %eax movl %eax, 108(%edi) movl $0, 116(%edi) leal (%esi,%ecx), %edx je .L530 cmpl %edx, %eax jb .L529 .L530: subl %edx, %eax movl 8(%ebp), %ebx movl %eax, 116(%ebx) movl %edx, 108(%ebx) xorl %eax, %eax subl %ecx, %edx pushl $0 testl %ecx, %ecx pushl %edx js .L532 movl 56(%ebx), %eax addl %ecx, %eax .L532: pushl %eax pushl 8(%ebp) call _tr_flush_block movl 8(%ebp), %ecx movl 108(%ecx), %ebx movl (%ecx), %esi movl %ebx, 92(%ecx) movl 28(%esi), %edi movl %edi, (%esp) call _tr_flush_bits movl 20(%edi), %ebx movl 16(%esi), %eax addl $16, %esp cmpl %eax, %ebx jbe .L533 movl %eax, %ebx .L533: testl %ebx, %ebx jne .L566 .L535: movl 8(%ebp), %ecx movl (%ecx), %ebx movl 16(%ebx), %edi testl %edi, %edi je .L564 movl 92(%ecx), %ecx .L529: movl 8(%ebp), %edi movl 108(%edi), %edx movl 44(%edi), %esi subl %ecx, %edx subl $262, %esi cmpl %esi, %edx jb .L523 pushl $0 xorl %eax, %eax testl %ecx, %ecx pushl %edx js .L540 movl 56(%edi), %eax addl %ecx, %eax .L540: pushl %eax pushl 8(%ebp) call _tr_flush_block movl 8(%ebp), %ecx movl (%ecx), %esi movl 108(%ecx), %edx movl 28(%esi), %edi movl %edx, 92(%ecx) movl %edi, (%esp) call _tr_flush_bits movl 20(%edi), %ebx movl 16(%esi), %eax addl $16, %esp cmpl %eax, %ebx jbe .L541 movl %eax, %ebx .L541: testl %ebx, %ebx jne .L567 .L543: movl 8(%ebp), %eax movl (%eax), %edx movl 16(%edx), %edi testl %edi, %edi jne .L523 .L564: xorl %eax, %eax .L521: leal -12(%ebp), %esp popl %ebx popl %esi popl %edi leave ret .L567: pushl %eax pushl %ebx pushl 16(%edi) pushl 12(%esi) call memcpy subl %ebx, 16(%esi) addl %ebx, 12(%esi) addl %ebx, 20(%esi) movl 20(%edi), %esi subl %ebx, %esi addl $16, %esp addl %ebx, 16(%edi) testl %esi, %esi movl %esi, 20(%edi) jne .L543 movl 8(%edi), %ebx movl %ebx, 16(%edi) jmp .L543 .p2align 2,,3 .L566: pushl %edx pushl %ebx pushl 16(%edi) pushl 12(%esi) call memcpy subl %ebx, 16(%esi) addl %ebx, 12(%esi) addl %ebx, 20(%esi) movl 20(%edi), %esi subl %ebx, %esi addl $16, %esp addl %ebx, 16(%edi) testl %esi, %esi movl %esi, 20(%edi) jne .L535 movl 8(%edi), %edx movl %edx, 16(%edi) jmp .L535 .p2align 2,,3 .L565: subl $12, %esp pushl %ecx call fill_window movl 8(%ebp), %eax movl 116(%eax), %edx addl $16, %esp testl %edx, %edx jne .L526 movl 12(%ebp), %ebx xorl %eax, %eax testl %ebx, %ebx je .L521 testl %edx, %edx jne .L526 movl 8(%ebp), %ebx cmpl $4, 12(%ebp) movl $0, 5812(%ebx) je .L568 movl 8(%ebp), %ebx movl 108(%ebx), %eax movl 92(%ebx), %edx cmpl %edx, %eax jle .L554 subl %edx, %eax pushl $0 pushl %eax xorl %eax, %eax testl %edx, %edx js .L556 movl 56(%ebx), %eax addl %edx, %eax .L556: pushl %eax pushl 8(%ebp) call _tr_flush_block movl 8(%ebp), %ecx movl (%ecx), %esi movl 108(%ecx), %edx movl 28(%esi), %edi movl %edx, 92(%ecx) movl %edi, (%esp) call _tr_flush_bits movl 20(%edi), %ebx movl 16(%esi), %eax addl $16, %esp cmpl %eax, %ebx jbe .L557 movl %eax, %ebx .L557: testl %ebx, %ebx jne .L569 .L559: movl 8(%ebp), %eax movl (%eax), %edx movl 16(%edx), %edi testl %edi, %edi je .L564 .L554: movl $1, %eax jmp .L521 .L569: pushl %eax pushl %ebx pushl 16(%edi) pushl 12(%esi) call memcpy subl %ebx, 16(%esi) addl %ebx, 12(%esi) addl %ebx, 20(%esi) movl 20(%edi), %esi subl %ebx, %esi addl $16, %esp addl %ebx, 16(%edi) testl %esi, %esi movl %esi, 20(%edi) jne .L559 movl 8(%edi), %ebx movl %ebx, 16(%edi) jmp .L559 .L568: pushl $1 movl 92(%ebx), %edx movl 108(%ebx), %ecx subl %edx, %ecx xorl %eax, %eax testl %edx, %edx pushl %ecx js .L548 movl 56(%ebx), %eax addl %edx, %eax .L548: pushl %eax pushl 8(%ebp) call _tr_flush_block movl 8(%ebp), %ebx movl 108(%ebx), %esi movl %esi, 92(%ebx) movl (%ebx), %esi movl 28(%esi), %edi movl %edi, (%esp) call _tr_flush_bits movl 20(%edi), %ebx movl 16(%esi), %eax addl $16, %esp cmpl %eax, %ebx jbe .L549 movl %eax, %ebx .L549: testl %ebx, %ebx jne .L570 .L551: movl 8(%ebp), %eax movl (%eax), %esi movl 16(%esi), %edi testl %edi, %edi setne %bl movzbl %bl, %eax addl $2, %eax jmp .L521 .L570: pushl %eax pushl %ebx pushl 16(%edi) pushl 12(%esi) call memcpy subl %ebx, 16(%esi) movl 20(%edi), %edx addl %ebx, 12(%esi) subl %ebx, %edx addl $16, %esp addl %ebx, 16(%edi) addl %ebx, 20(%esi) testl %edx, %edx movl %edx, 20(%edi) jne .L551 movl 8(%edi), %ecx movl %ecx, 16(%edi) jmp .L551 .size deflate_stored, .-deflate_stored # ---------------------- .p2align 2,,3 # ---------------------- .local deflate_fast .type deflate_fast, @function deflate_fast: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx subl $60, %esp movl 8(%ebp), %edi .p2align 2,,3 .L572: movl 116(%edi), %edx cmpl $261, %edx jbe .L618 .L575: xorl %ecx, %ecx cmpl $2, %edx jbe .L578 movl 72(%edi), %edx movl 88(%edi), %ecx sall %cl, %edx movl 56(%edi), %ebx movl 108(%edi), %ecx movzbl 2(%ecx,%ebx), %esi xorl %esi, %edx andl 84(%edi), %edx movl 68(%edi), %esi movzwl (%esi,%edx,2), %eax andl 52(%edi), %ecx movl 64(%edi), %ebx movw %ax, (%ebx,%ecx,2) movw 108(%edi), %bx movl %edx, 72(%edi) movl %eax, %ecx movw %bx, (%esi,%edx,2) .L578: testl %ecx, %ecx je .L579 movl 108(%edi), %edx movl 44(%edi), %esi subl %ecx, %edx subl $262, %esi cmpl %esi, %edx jbe .L619 .L579: cmpl $2, 96(%edi) jbe .L580 movw 108(%edi), %bx subw 112(%edi), %bx movl 5792(%edi), %esi movl 5796(%edi), %ecx movb 96(%edi), %dl movw %bx, (%ecx,%esi,2) subl $3, %edx movl 5784(%edi), %ecx movb %dl, (%esi,%ecx) movzbl %dl, %eax incl 5792(%edi) decl %ebx movzbl _length_code(%eax), %ecx incw 1176(%edi,%ecx,4) cmpw $255, %bx ja .L581 movzwl %bx, %edx movzbl _dist_code(%edx), %eax .L616: leal 2432(,%eax,4), %esi incw 8(%esi,%edi) movl 5788(%edi), %edx decl %edx cmpl %edx, 5792(%edi) sete %cl movl 116(%edi), %edx movl 96(%edi), %eax subl %eax, %edx movzbl %cl, %ebx cmpl 128(%edi), %eax movl %ebx, -16(%ebp) movl %edx, 116(%edi) ja .L583 cmpl $2, %edx jbe .L583 decl %eax movl 88(%edi), %esi movl %eax, 96(%edi) movl 56(%edi), %ecx movl 84(%edi), %edx movl 52(%edi), %eax movl 64(%edi), %ebx movl %esi, -36(%ebp) movl %ecx, -44(%ebp) movl %edx, -32(%ebp) movl %eax, -40(%ebp) movl %ebx, -48(%ebp) movl 68(%edi), %esi .p2align 2,,3 .L584: movl 108(%edi), %edx movl %edx, -60(%ebp) incl %edx movl %edx, 108(%edi) movl 72(%edi), %eax movb -36(%ebp), %cl movl -44(%ebp), %ebx sall %cl, %eax movzbl 2(%edx,%ebx), %ecx xorl %ecx, %eax andl -32(%ebp), %eax movl -40(%ebp), %ebx andl %ebx, %edx movw (%esi,%eax,2), %cx movl -48(%ebp), %ebx movw %cx, (%ebx,%edx,2) movl 96(%edi), %ebx decl %ebx movw 108(%edi), %cx testl %ebx, %ebx movl %eax, 72(%edi) movw %cx, (%esi,%eax,2) movl %ebx, 96(%edi) jne .L584 movl -60(%ebp), %edx addl $2, %edx movl %edx, 108(%edi) .p2align 2,,3 .L589: movl -16(%ebp), %ebx testl %ebx, %ebx je .L572 pushl $0 movl 92(%edi), %edx movl 108(%edi), %ecx subl %edx, %ecx xorl %eax, %eax testl %edx, %edx pushl %ecx js .L592 movl 56(%edi), %eax addl %edx, %eax .L592: pushl %eax pushl %edi call _tr_flush_block movl 108(%edi), %esi movl %esi, 92(%edi) movl (%edi), %esi movl 28(%esi), %eax movl %eax, (%esp) movl %eax, -20(%ebp) call _tr_flush_bits movl -20(%ebp), %edx movl 20(%edx), %ebx movl 16(%esi), %eax addl $16, %esp cmpl %eax, %ebx jbe .L593 movl %eax, %ebx .L593: testl %ebx, %ebx jne .L620 .L595: movl (%edi), %edx movl 16(%edx), %esi testl %esi, %esi jne .L572 .L617: xorl %eax, %eax .L571: leal -12(%ebp), %esp popl %ebx popl %esi popl %edi leave ret .L620: pushl %eax pushl %ebx movl -20(%ebp), %ecx pushl 16(%ecx) pushl 12(%esi) call memcpy movl -20(%ebp), %ecx subl %ebx, 16(%esi) movl 20(%ecx), %edx addl %ebx, 12(%esi) subl %ebx, %edx addl $16, %esp addl %ebx, 16(%ecx) addl %ebx, 20(%esi) testl %edx, %edx movl %edx, 20(%ecx) jne .L595 movl 8(%ecx), %ebx movl %ebx, 16(%ecx) jmp .L595 .p2align 2,,3 .L583: movl 108(%edi), %edx addl %eax, %edx movl %edx, 108(%edi) movl $0, 96(%edi) movl 56(%edi), %ebx movzbl (%edx,%ebx), %esi movl %esi, 72(%edi) movl 88(%edi), %ecx movzbl 1(%edx,%ebx), %eax sall %cl, %esi xorl %eax, %esi andl 84(%edi), %esi movl %esi, 72(%edi) jmp .L589 .p2align 2,,3 .L581: shrw $7, %bx movzwl %bx, %esi movzbl _dist_code+256(%esi), %eax jmp .L616 .p2align 2,,3 .L580: movl 108(%edi), %edx movl 56(%edi), %esi movb (%edx,%esi), %bl movl 5796(%edi), %ecx movl 5792(%edi), %esi movw $0, (%ecx,%esi,2) movl 5784(%edi), %ecx movb %bl, (%esi,%ecx) incl 5792(%edi) movzbl %bl, %esi incw 148(%edi,%esi,4) movl 5788(%edi), %edx decl %edx cmpl %edx, 5792(%edi) sete %cl movzbl %cl, %ebx movl %ebx, -16(%ebp) decl 116(%edi) incl 108(%edi) jmp .L589 .p2align 2,,3 .L619: subl $8, %esp pushl %ecx pushl %edi call longest_match movl %eax, 96(%edi) addl $16, %esp jmp .L579 .p2align 2,,3 .L618: subl $12, %esp pushl %edi call fill_window movl 116(%edi), %edx addl $16, %esp cmpl $261, %edx ja .L576 movl 12(%ebp), %ebx xorl %eax, %eax testl %ebx, %ebx je .L571 .L576: testl %edx, %edx jne .L575 movl 108(%edi), %eax cmpl $2, %eax movl %eax, %edx jbe .L598 movl $2, %edx .L598: cmpl $4, 12(%ebp) movl %edx, 5812(%edi) je .L621 movl 5792(%edi), %ecx testl %ecx, %ecx je .L607 pushl $0 movl 92(%edi), %edx subl %edx, %eax pushl %eax xorl %eax, %eax testl %edx, %edx js .L609 movl 56(%edi), %eax addl %edx, %eax .L609: pushl %eax pushl %edi call _tr_flush_block movl 108(%edi), %ebx movl (%edi), %esi movl 28(%esi), %eax movl %ebx, 92(%edi) movl %eax, -28(%ebp) movl %eax, (%esp) call _tr_flush_bits movl -28(%ebp), %edx movl 20(%edx), %ebx movl 16(%esi), %eax addl $16, %esp cmpl %eax, %ebx jbe .L610 movl %eax, %ebx .L610: testl %ebx, %ebx jne .L622 .L612: movl (%edi), %ebx movl 16(%ebx), %edi testl %edi, %edi je .L617 .L607: movl $1, %eax jmp .L571 .L622: pushl %eax pushl %ebx movl -28(%ebp), %ecx pushl 16(%ecx) pushl 12(%esi) call memcpy movl -28(%ebp), %ecx subl %ebx, 16(%esi) addl %ebx, 12(%esi) addl %ebx, 20(%esi) movl 20(%ecx), %esi subl %ebx, %esi addl $16, %esp addl %ebx, 16(%ecx) testl %esi, %esi movl %esi, 20(%ecx) jne .L612 movl 8(%ecx), %edx movl %edx, 16(%ecx) jmp .L612 .L621: pushl $1 movl 92(%edi), %edx subl %edx, %eax pushl %eax xorl %eax, %eax testl %edx, %edx js .L601 movl 56(%edi), %eax addl %edx, %eax .L601: pushl %eax pushl %edi call _tr_flush_block movl 108(%edi), %ebx movl (%edi), %esi movl 28(%esi), %eax movl %ebx, 92(%edi) movl %eax, -24(%ebp) movl %eax, (%esp) call _tr_flush_bits movl -24(%ebp), %ecx movl 20(%ecx), %ebx movl 16(%esi), %eax addl $16, %esp cmpl %eax, %ebx jbe .L602 movl %eax, %ebx .L602: testl %ebx, %ebx jne .L623 .L604: movl (%edi), %esi movl 16(%esi), %edi testl %edi, %edi setne %bl movzbl %bl, %eax addl $2, %eax jmp .L571 .L623: pushl %eax pushl %ebx movl -24(%ebp), %ecx pushl 16(%ecx) pushl 12(%esi) call memcpy movl -24(%ebp), %ecx subl %ebx, 16(%esi) addl %ebx, 12(%esi) addl %ebx, 20(%esi) movl 20(%ecx), %esi subl %ebx, %esi addl $16, %esp addl %ebx, 16(%ecx) testl %esi, %esi movl %esi, 20(%ecx) jne .L604 movl 8(%ecx), %edx movl %edx, 16(%ecx) jmp .L604 .size deflate_fast, .-deflate_fast # ---------------------- .p2align 2,,3 # ---------------------- .local deflate_slow .type deflate_slow, @function deflate_slow: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx subl $28, %esp movl 8(%ebp), %edi .p2align 2,,3 .L625: movl 116(%edi), %edx cmpl $261, %edx jbe .L688 .L628: xorl %ecx, %ecx cmpl $2, %edx jbe .L680 movl 108(%edi), %ebx movl 72(%edi), %edx movl 88(%edi), %ecx movl 56(%edi), %esi movl %ebx, -40(%ebp) sall %cl, %edx movzbl 2(%ebx,%esi), %ecx xorl %ecx, %edx andl 84(%edi), %edx movl %ebx, %esi movl 68(%edi), %ebx movzwl (%ebx,%edx,2), %eax andl 52(%edi), %esi movl 64(%edi), %ecx movw %ax, (%ecx,%esi,2) movw 108(%edi), %si movl %edx, 72(%edi) movl %eax, %ecx movw %si, (%ebx,%edx,2) .L631: movl 96(%edi), %edx movl 112(%edi), %ebx testl %ecx, %ecx movl %edx, 120(%edi) movl %ebx, 100(%edi) movl $2, 96(%edi) je .L632 cmpl 128(%edi), %edx jae .L632 movl -40(%ebp), %eax movl 44(%edi), %esi subl %ecx, %eax subl $262, %esi cmpl %esi, %eax jbe .L689 .L632: movl 120(%edi), %eax cmpl $2, %eax jbe .L635 cmpl %eax, 96(%edi) jbe .L690 .L635: movl 104(%edi), %eax testl %eax, %eax jne .L691 movl -40(%ebp), %edx incl %edx movl $1, 104(%edi) movl %edx, 108(%edi) decl 116(%edi) jmp .L625 .L691: movl 56(%edi), %eax addl %eax, -40(%ebp) movl -40(%ebp), %edx movb -1(%edx), %bl movl 5796(%edi), %esi movl 5792(%edi), %edx movl 5784(%edi), %ecx movw $0, (%esi,%edx,2) movb %bl, (%edx,%ecx) incl 5792(%edi) movzbl %bl, %esi incw 148(%edi,%esi,4) movl 5788(%edi), %ebx decl %ebx cmpl %ebx, 5792(%edi) jne .L653 pushl $0 movl 92(%edi), %edx movl 108(%edi), %ebx subl %edx, %ebx xorl %eax, %eax testl %edx, %edx pushl %ebx js .L655 movl 56(%edi), %eax addl %edx, %eax .L655: pushl %eax pushl %edi call _tr_flush_block movl 108(%edi), %esi movl %esi, 92(%edi) movl (%edi), %esi movl 28(%esi), %ecx movl %ecx, (%esp) movl %ecx, -28(%ebp) call _tr_flush_bits movl -28(%ebp), %edx movl 20(%edx), %ebx movl 16(%esi), %eax addl $16, %esp cmpl %eax, %ebx jbe .L656 movl %eax, %ebx .L656: testl %ebx, %ebx jne .L692 .L653: incl 108(%edi) decl 116(%edi) .L687: movl (%edi), %ecx movl 16(%ecx), %esi testl %esi, %esi jne .L625 .L686: xorl %eax, %eax .L624: leal -12(%ebp), %esp popl %ebx popl %esi popl %edi leave ret .L692: pushl %edx pushl %ebx movl -28(%ebp), %edx pushl 16(%edx) pushl 12(%esi) call memcpy movl -28(%ebp), %edx subl %ebx, 16(%esi) movl 20(%edx), %ecx addl %ebx, 12(%esi) subl %ebx, %ecx addl $16, %esp addl %ebx, 16(%edx) addl %ebx, 20(%esi) testl %ecx, %ecx movl %ecx, 20(%edx) jne .L653 movl 8(%edx), %ebx movl %ebx, 16(%edx) jmp .L653 .p2align 2,,3 .L690: movl 116(%edi), %eax addl %eax, -40(%ebp) movl -40(%ebp), %ecx movw 108(%edi), %dx subw 100(%edi), %dx subl $3, %ecx movl 5792(%edi), %ebx movl %ecx, -20(%ebp) leal -1(%edx), %esi movb 120(%edi), %cl movl 5796(%edi), %eax movw %si, (%eax,%ebx,2) subl $3, %ecx movl 5784(%edi), %esi movb %cl, (%ebx,%esi) leal -2(%edx), %esi movzbl %cl, %edx incl 5792(%edi) movzbl _length_code(%edx), %ebx incw 1176(%edi,%ebx,4) cmpw $255, %si ja .L636 movzwl %si, %ebx movzbl _dist_code(%ebx), %eax .L685: leal 2432(,%eax,4), %ecx incw 8(%ecx,%edi) movl 5788(%edi), %esi decl %esi cmpl %esi, 5792(%edi) movl 116(%edi), %ecx movl 120(%edi), %esi sete %dl subl %esi, %ecx movzbl %dl, %ebx incl %ecx subl $2, %esi movl %ebx, -16(%ebp) movl %ecx, 116(%edi) movl %esi, 120(%edi) .p2align 2,,3 .L638: movl 108(%edi), %esi incl %esi cmpl -20(%ebp), %esi movl %esi, 108(%edi) ja .L640 movl 72(%edi), %edx movl 88(%edi), %ecx movl 56(%edi), %ebx sall %cl, %edx movzbl 2(%esi,%ebx), %ecx xorl %ecx, %edx andl 84(%edi), %edx movl 68(%edi), %ecx movl 64(%edi), %ebx movw (%ecx,%edx,2), %ax andl 52(%edi), %esi movw %ax, (%ebx,%esi,2) movw 108(%edi), %bx movl %edx, 72(%edi) movw %bx, (%ecx,%edx,2) .L640: movl 120(%edi), %edx decl %edx testl %edx, %edx movl %edx, 120(%edi) jne .L638 movl 108(%edi), %eax movl -16(%ebp), %esi incl %eax testl %esi, %esi movl $0, 104(%edi) movl $2, 96(%edi) movl %eax, 108(%edi) je .L625 pushl $0 movl 92(%edi), %edx subl %edx, %eax pushl %eax xorl %eax, %eax testl %edx, %edx js .L645 movl 56(%edi), %eax addl %edx, %eax .L645: pushl %eax pushl %edi call _tr_flush_block movl 108(%edi), %ebx movl (%edi), %esi movl %ebx, 92(%edi) movl 28(%esi), %ecx movl %ecx, (%esp) movl %ecx, -24(%ebp) call _tr_flush_bits movl -24(%ebp), %eax movl 20(%eax), %ebx movl 16(%esi), %eax addl $16, %esp cmpl %eax, %ebx jbe .L646 movl %eax, %ebx .L646: testl %ebx, %ebx je .L687 pushl %eax pushl %ebx movl -24(%ebp), %edx pushl 16(%edx) pushl 12(%esi) call memcpy movl -24(%ebp), %edx subl %ebx, 16(%esi) addl %ebx, 12(%esi) addl %ebx, 20(%esi) movl 20(%edx), %esi subl %ebx, %esi addl $16, %esp addl %ebx, 16(%edx) testl %esi, %esi movl %esi, 20(%edx) jne .L687 movl 8(%edx), %ecx movl %ecx, 16(%edx) jmp .L687 .p2align 2,,3 .L636: shrw $7, %si movzwl %si, %edx movzbl _dist_code+256(%edx), %eax jmp .L685 .L689: subl $8, %esp pushl %ecx pushl %edi call longest_match addl $16, %esp cmpl $5, %eax movl %eax, 96(%edi) ja .L681 cmpl $1, 136(%edi) je .L682 cmpl $3, %eax je .L693 movl 108(%edi), %eax movl %eax, -40(%ebp) jmp .L632 .L693: movl 108(%edi), %ebx movl %ebx, %ecx subl 112(%edi), %ecx cmpl $4096, %ecx movl %ebx, -40(%ebp) jbe .L632 .L634: movl $2, 96(%edi) jmp .L632 .L682: movl 108(%edi), %edx movl %edx, -40(%ebp) jmp .L634 .L681: movl 108(%edi), %esi movl %esi, -40(%ebp) jmp .L632 .p2align 2,,3 .L680: movl 108(%edi), %edx movl %edx, -40(%ebp) jmp .L631 .p2align 2,,3 .L688: subl $12, %esp pushl %edi call fill_window movl 116(%edi), %edx addl $16, %esp cmpl $261, %edx ja .L629 movl 12(%ebp), %ebx xorl %eax, %eax testl %ebx, %ebx je .L624 .L629: testl %edx, %edx jne .L628 movl 104(%edi), %ebx testl %ebx, %ebx je .L662 movl 108(%edi), %esi addl 56(%edi), %esi movb -1(%esi), %bl movl 5796(%edi), %edx movl 5792(%edi), %esi movl 5784(%edi), %ecx movw $0, (%edx,%esi,2) movb %bl, (%esi,%ecx) incl 5792(%edi) movzbl %bl, %eax incw 148(%edi,%eax,4) movl $0, 104(%edi) .L662: movl 108(%edi), %ebx cmpl $2, %ebx movl %ebx, -40(%ebp) movl %ebx, %eax jbe .L663 movl $2, %eax .L663: cmpl $4, 12(%ebp) movl %eax, 5812(%edi) je .L694 movl 5792(%edi), %ecx testl %ecx, %ecx je .L672 pushl $0 movl 92(%edi), %eax subl %eax, -40(%ebp) xorl %edx, %edx testl %eax, %eax pushl -40(%ebp) js .L674 movl 56(%edi), %edx addl %eax, %edx .L674: pushl %edx pushl %edi call _tr_flush_block movl 108(%edi), %ebx movl (%edi), %esi movl 28(%esi), %eax movl %ebx, 92(%edi) movl %eax, -36(%ebp) movl %eax, (%esp) call _tr_flush_bits movl -36(%ebp), %edx movl 20(%edx), %ebx movl 16(%esi), %eax addl $16, %esp cmpl %eax, %ebx jbe .L675 movl %eax, %ebx .L675: testl %ebx, %ebx jne .L695 .L677: movl (%edi), %ebx movl 16(%ebx), %edi testl %edi, %edi je .L686 .L672: movl $1, %eax jmp .L624 .L695: pushl %eax pushl %ebx movl -36(%ebp), %ecx pushl 16(%ecx) pushl 12(%esi) call memcpy movl -36(%ebp), %ecx subl %ebx, 16(%esi) addl %ebx, 12(%esi) addl %ebx, 20(%esi) movl 20(%ecx), %esi subl %ebx, %esi addl $16, %esp addl %ebx, 16(%ecx) testl %esi, %esi movl %esi, 20(%ecx) jne .L677 movl 8(%ecx), %edx movl %edx, 16(%ecx) jmp .L677 .L694: pushl $1 movl 92(%edi), %eax subl %eax, -40(%ebp) xorl %edx, %edx testl %eax, %eax pushl -40(%ebp) js .L666 movl 56(%edi), %edx addl %eax, %edx .L666: pushl %edx pushl %edi call _tr_flush_block movl (%edi), %esi movl 108(%edi), %edx movl 28(%esi), %ecx movl %edx, 92(%edi) movl %ecx, -32(%ebp) movl %ecx, (%esp) call _tr_flush_bits movl -32(%ebp), %eax movl 20(%eax), %ebx movl 16(%esi), %eax addl $16, %esp cmpl %eax, %ebx jbe .L667 movl %eax, %ebx .L667: testl %ebx, %ebx jne .L696 .L669: movl (%edi), %esi movl 16(%esi), %edi testl %edi, %edi setne %dl movzbl %dl, %eax addl $2, %eax jmp .L624 .L696: pushl %eax pushl %ebx movl -32(%ebp), %eax pushl 16(%eax) pushl 12(%esi) call memcpy movl -32(%ebp), %ecx subl %ebx, 16(%esi) addl %ebx, 12(%esi) addl %ebx, 20(%esi) movl 20(%ecx), %esi subl %ebx, %esi addl $16, %esp addl %ebx, 16(%ecx) testl %esi, %esi movl %esi, 20(%ecx) jne .L669 movl 8(%ecx), %ebx movl %ebx, 16(%ecx) jmp .L669 .size deflate_slow, .-deflate_slow # ---------------------- .p2align 2,,3 # ---------------------- .local deflate_rle .type deflate_rle, @function deflate_rle: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx subl $12, %esp movl 8(%ebp), %ebx .p2align 2,,3 .L698: movl 116(%ebx), %edx cmpl $258, %edx jbe .L742 .L701: cmpl $2, %edx movl $0, 96(%ebx) jbe .L704 movl 108(%ebx), %eax testl %eax, %eax je .L704 movl 56(%ebx), %esi addl %eax, %esi movzbl -1(%esi), %edi movzbl (%esi), %eax cmpl %eax, %edi movl %esi, %ecx je .L743 .L704: cmpl $2, 96(%ebx) jbe .L712 movb 96(%ebx), %dl movl 5792(%ebx), %esi movl 5796(%ebx), %ecx subl $3, %edx movl 5784(%ebx), %edi movw $1, (%ecx,%esi,2) movzbl %dl, %eax movb %dl, (%esi,%edi) incl 5792(%ebx) movzbl _length_code(%eax), %ecx incw 1176(%ebx,%ecx,4) movzbl _dist_code, %edx incw 2440(%ebx,%edx,4) movl 5788(%ebx), %edi decl %edi movl 96(%ebx), %esi xorl %edx, %edx cmpl %edi, 5792(%ebx) sete %dl movl $0, 96(%ebx) subl %esi, 116(%ebx) addl %esi, 108(%ebx) .L715: testl %edx, %edx je .L698 pushl $0 movl 92(%ebx), %edx movl 108(%ebx), %esi subl %edx, %esi xorl %eax, %eax testl %edx, %edx pushl %esi js .L718 movl 56(%ebx), %eax addl %edx, %eax .L718: pushl %eax pushl %ebx call _tr_flush_block movl 108(%ebx), %edi movl %edi, 92(%ebx) movl (%ebx), %edi movl 28(%edi), %edx movl %edx, (%esp) movl %edx, -16(%ebp) call _tr_flush_bits movl -16(%ebp), %eax movl 20(%eax), %esi movl 16(%edi), %eax addl $16, %esp cmpl %eax, %esi jbe .L719 movl %eax, %esi .L719: testl %esi, %esi jne .L744 .L721: movl (%ebx), %ecx movl 16(%ecx), %edi testl %edi, %edi jne .L698 .L741: xorl %eax, %eax .L697: leal -12(%ebp), %esp popl %ebx popl %esi popl %edi leave ret .L744: pushl %eax pushl %esi movl -16(%ebp), %edx pushl 16(%edx) pushl 12(%edi) call memcpy movl -16(%ebp), %edx subl %esi, 16(%edi) movl 20(%edx), %ecx addl %esi, 12(%edi) subl %esi, %ecx addl $16, %esp addl %esi, 16(%edx) addl %esi, 20(%edi) testl %ecx, %ecx movl %ecx, 20(%edx) jne .L721 movl 8(%edx), %esi movl %esi, 16(%edx) jmp .L721 .p2align 2,,3 .L712: movl 108(%ebx), %ecx movl 56(%ebx), %edi movb (%ecx,%edi), %dl movl 5796(%ebx), %esi movl 5792(%ebx), %edi movl 5784(%ebx), %ecx movw $0, (%esi,%edi,2) movb %dl, (%edi,%ecx) incl 5792(%ebx) movzbl %dl, %eax incw 148(%ebx,%eax,4) movl 5788(%ebx), %esi decl %esi xorl %edx, %edx cmpl %esi, 5792(%ebx) sete %dl decl 116(%ebx) incl 108(%ebx) jmp .L715 .L743: incl %ecx movzbl (%ecx), %eax cmpl %eax, %edi jne .L704 incl %ecx movzbl (%ecx), %eax cmpl %eax, %edi jne .L704 addl $258, %esi .L706: incl %ecx movzbl (%ecx), %eax cmpl %eax, %edi jne .L707 incl %ecx movzbl (%ecx), %eax cmpl %eax, %edi jne .L707 incl %ecx movzbl (%ecx), %eax cmpl %eax, %edi jne .L707 incl %ecx movzbl (%ecx), %eax cmpl %eax, %edi jne .L707 incl %ecx movzbl (%ecx), %eax cmpl %eax, %edi jne .L707 incl %ecx movzbl (%ecx), %eax cmpl %eax, %edi jne .L707 incl %ecx movzbl (%ecx), %eax cmpl %eax, %edi jne .L707 incl %ecx movzbl (%ecx), %eax cmpl %eax, %edi jne .L707 cmpl %esi, %ecx jb .L706 .L707: subl %ecx, %esi movl $258, %ecx subl %esi, %ecx cmpl %edx, %ecx movl %ecx, 96(%ebx) jbe .L704 movl %edx, 96(%ebx) jmp .L704 .p2align 2,,3 .L742: subl $12, %esp pushl %ebx call fill_window movl 116(%ebx), %edx addl $16, %esp cmpl $258, %edx ja .L702 movl 12(%ebp), %esi xorl %eax, %eax testl %esi, %esi je .L697 .L702: testl %edx, %edx jne .L701 cmpl $4, 12(%ebp) movl $0, 5812(%ebx) je .L745 movl 5792(%ebx), %edx testl %edx, %edx je .L732 pushl $0 movl 92(%ebx), %edx movl 108(%ebx), %esi subl %edx, %esi xorl %eax, %eax testl %edx, %edx pushl %esi js .L734 movl 56(%ebx), %eax addl %edx, %eax .L734: pushl %eax pushl %ebx call _tr_flush_block movl 108(%ebx), %edi movl %edi, 92(%ebx) movl (%ebx), %edi movl 28(%edi), %ecx movl %ecx, (%esp) movl %ecx, -24(%ebp) call _tr_flush_bits movl -24(%ebp), %eax movl 20(%eax), %esi movl 16(%edi), %eax addl $16, %esp cmpl %eax, %esi jbe .L735 movl %eax, %esi .L735: testl %esi, %esi jne .L746 .L737: movl (%ebx), %ecx movl 16(%ecx), %edi testl %edi, %edi je .L741 .L732: movl $1, %eax jmp .L697 .L746: pushl %eax pushl %esi movl -24(%ebp), %edx pushl 16(%edx) pushl 12(%edi) call memcpy movl -24(%ebp), %edx subl %esi, 16(%edi) movl 20(%edx), %ecx addl %esi, 12(%edi) subl %esi, %ecx addl $16, %esp addl %esi, 16(%edx) addl %esi, 20(%edi) testl %ecx, %ecx movl %ecx, 20(%edx) jne .L737 movl 8(%edx), %esi movl %esi, 16(%edx) jmp .L737 .L745: pushl $1 movl 92(%ebx), %edx movl 108(%ebx), %esi subl %edx, %esi xorl %eax, %eax testl %edx, %edx pushl %esi js .L726 movl 56(%ebx), %eax addl %edx, %eax .L726: pushl %eax pushl %ebx call _tr_flush_block movl 108(%ebx), %edi movl %edi, 92(%ebx) movl (%ebx), %edi movl 28(%edi), %edx movl %edx, (%esp) movl %edx, -20(%ebp) call _tr_flush_bits movl -20(%ebp), %eax movl 20(%eax), %esi movl 16(%edi), %eax addl $16, %esp cmpl %eax, %esi jbe .L727 movl %eax, %esi .L727: testl %esi, %esi jne .L747 .L729: movl (%ebx), %ecx movl 16(%ecx), %edi testl %edi, %edi setne %bl movzbl %bl, %eax addl $2, %eax jmp .L697 .L747: pushl %eax pushl %esi movl -20(%ebp), %edx pushl 16(%edx) pushl 12(%edi) call memcpy movl -20(%ebp), %edx subl %esi, 16(%edi) movl 20(%edx), %ecx addl %esi, 12(%edi) subl %esi, %ecx addl $16, %esp addl %esi, 16(%edx) addl %esi, 20(%edi) testl %ecx, %ecx movl %ecx, 20(%edx) jne .L729 movl 8(%edx), %esi movl %esi, 16(%edx) jmp .L729 .size deflate_rle, .-deflate_rle # ---------------------- .p2align 2,,3 # ---------------------- .local deflate_huff .type deflate_huff, @function deflate_huff: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx subl $12, %esp movl 8(%ebp), %ebx .p2align 2,,3 .L749: movl 116(%ebx), %eax testl %eax, %eax je .L780 .L752: movl 108(%ebx), %ecx movl 56(%ebx), %edi movl $0, 96(%ebx) movb (%ecx,%edi), %dl movl 5796(%ebx), %esi movl 5792(%ebx), %edi movl 5784(%ebx), %ecx movw $0, (%esi,%edi,2) movb %dl, (%edi,%ecx) incl 5792(%ebx) movzbl %dl, %esi incw 148(%ebx,%esi,4) movl 5788(%ebx), %edx decl %edx cmpl %edx, 5792(%ebx) sete %al movl 108(%ebx), %edx incl %edx decl 116(%ebx) testb $1, %al movl %edx, 108(%ebx) je .L749 pushl $0 movl 92(%ebx), %eax subl %eax, %edx pushl %edx xorl %edx, %edx testl %eax, %eax js .L757 movl 56(%ebx), %edx addl %eax, %edx .L757: pushl %edx pushl %ebx call _tr_flush_block movl 108(%ebx), %esi movl (%ebx), %edi movl %esi, 92(%ebx) movl 28(%edi), %edx movl %edx, (%esp) movl %edx, -16(%ebp) call _tr_flush_bits movl -16(%ebp), %eax movl 20(%eax), %esi movl 16(%edi), %eax addl $16, %esp cmpl %eax, %esi jbe .L758 movl %eax, %esi .L758: testl %esi, %esi jne .L781 .L760: movl (%ebx), %edi movl 16(%edi), %edx testl %edx, %edx jne .L749 .L779: xorl %eax, %eax .L748: leal -12(%ebp), %esp popl %ebx popl %esi popl %edi leave ret .L781: pushl %eax pushl %esi movl -16(%ebp), %ecx pushl 16(%ecx) pushl 12(%edi) call memcpy movl -16(%ebp), %edx subl %esi, 16(%edi) addl %esi, 12(%edi) addl %esi, 20(%edi) movl 20(%edx), %edi subl %esi, %edi addl $16, %esp addl %esi, 16(%edx) testl %edi, %edi movl %edi, 20(%edx) jne .L760 movl 8(%edx), %esi movl %esi, 16(%edx) jmp .L760 .p2align 2,,3 .L780: subl $12, %esp pushl %ebx call fill_window movl 116(%ebx), %eax addl $16, %esp testl %eax, %eax jne .L752 movl 12(%ebp), %ecx xorl %eax, %eax testl %ecx, %ecx je .L748 cmpl $4, 12(%ebp) movl $0, 5812(%ebx) je .L782 movl 5792(%ebx), %ecx testl %ecx, %ecx je .L771 pushl $0 movl 92(%ebx), %edx movl 108(%ebx), %esi subl %edx, %esi xorl %eax, %eax testl %edx, %edx pushl %esi js .L773 movl 56(%ebx), %eax addl %edx, %eax .L773: pushl %eax pushl %ebx call _tr_flush_block movl 108(%ebx), %edi movl %edi, 92(%ebx) movl (%ebx), %edi movl 28(%edi), %edx movl %edx, (%esp) movl %edx, -24(%ebp) call _tr_flush_bits movl -24(%ebp), %eax movl 20(%eax), %esi movl 16(%edi), %eax addl $16, %esp cmpl %eax, %esi jbe .L774 movl %eax, %esi .L774: testl %esi, %esi jne .L783 .L776: movl (%ebx), %ecx movl 16(%ecx), %edi testl %edi, %edi je .L779 .L771: movl $1, %eax jmp .L748 .L783: pushl %eax pushl %esi movl -24(%ebp), %edx pushl 16(%edx) pushl 12(%edi) call memcpy movl -24(%ebp), %edx subl %esi, 16(%edi) movl 20(%edx), %ecx addl %esi, 12(%edi) subl %esi, %ecx addl $16, %esp addl %esi, 16(%edx) addl %esi, 20(%edi) testl %ecx, %ecx movl %ecx, 20(%edx) jne .L776 movl 8(%edx), %esi movl %esi, 16(%edx) jmp .L776 .L782: pushl $1 movl 92(%ebx), %edx movl 108(%ebx), %ecx subl %edx, %ecx xorl %eax, %eax testl %edx, %edx pushl %ecx js .L765 movl 56(%ebx), %eax addl %edx, %eax .L765: pushl %eax pushl %ebx call _tr_flush_block movl (%ebx), %edi movl 108(%ebx), %edx movl 28(%edi), %esi movl %edx, 92(%ebx) movl %esi, -20(%ebp) movl %esi, (%esp) call _tr_flush_bits movl -20(%ebp), %eax movl 20(%eax), %esi movl 16(%edi), %eax addl $16, %esp cmpl %eax, %esi jbe .L766 movl %eax, %esi .L766: testl %esi, %esi jne .L784 .L768: movl (%ebx), %edi movl 16(%edi), %edx testl %edx, %edx setne %bl movzbl %bl, %eax addl $2, %eax jmp .L748 .L784: pushl %eax pushl %esi movl -20(%ebp), %ecx pushl 16(%ecx) pushl 12(%edi) call memcpy movl -20(%ebp), %edx subl %esi, 16(%edi) addl %esi, 12(%edi) addl %esi, 20(%edi) movl 20(%edx), %edi subl %esi, %edi addl $16, %esp addl %esi, 16(%edx) testl %edi, %edi movl %edi, 20(%edx) jne .L768 movl 8(%edx), %esi movl %esi, 16(%edx) jmp .L768 .size deflate_huff, .-deflate_huff # ---------------------- .p2align 2,,3 # ---------------------- .globl deflateInit_ .type deflateInit_, @function deflateInit_: pushl %ebp movl %esp, %ebp subl $8, %esp pushl 20(%ebp) pushl 16(%ebp) pushl $0 pushl $8 pushl $15 pushl $8 pushl 12(%ebp) pushl 8(%ebp) call deflateInit2_ leave ret .size deflateInit_, .-deflateInit_ # ---------------------- .p2align 2,,3 # ---------------------- .globl deflateResetKeep .type deflateResetKeep, @function deflateResetKeep: pushl %ebp movl %esp, %ebp pushl %esi movl 8(%ebp), %esi testl %esi, %esi pushl %ebx je .L889 movl 28(%esi), %ebx testl %ebx, %ebx je .L889 movl 32(%esi), %edx testl %edx, %edx je .L889 movl 36(%esi), %edx testl %edx, %edx jne .L888 .p2align 2,,3 .L889: movl $-2, %eax .L887: leal -8(%ebp), %esp popl %ebx popl %esi leave ret .p2align 2,,3 .L888: movl $2, 44(%esi) movl 24(%ebx), %eax movl 8(%ebx), %ecx testl %eax, %eax movl $0, 20(%esi) movl $0, 8(%esi) movl $0, 24(%esi) movl $0, 20(%ebx) movl %ecx, 16(%ebx) js .L896 .L890: movl 24(%ebx), %ecx xorl %edx, %edx testl %ecx, %ecx sete %dl decl %edx andl $-71, %edx addl $113, %edx cmpl $2, %ecx movl %edx, 4(%ebx) je .L897 pushl %eax pushl $0 pushl $0 pushl $0 call adler32 .L895: movl %eax, 48(%esi) movl $0, 40(%ebx) movl %ebx, (%esp) call _tr_init xorl %eax, %eax jmp .L887 .L897: pushl %eax pushl $0 pushl $0 pushl $0 call crc32 jmp .L895 .L896: negl %eax movl %eax, 24(%ebx) jmp .L890 .size deflateResetKeep, .-deflateResetKeep # ---------------------- .p2align 2,,3 # ---------------------- .globl deflateSetHeader .type deflateSetHeader, @function deflateSetHeader: pushl %ebp movl %esp, %ebp movl 8(%ebp), %eax testl %eax, %eax je .L902 movl 28(%eax), %edx testl %edx, %edx je .L902 cmpl $2, 24(%edx) je .L901 .L902: movl $-2, %eax .L898: leave ret .p2align 2,,3 .L901: movl 12(%ebp), %ecx movl %ecx, 28(%edx) xorl %eax, %eax jmp .L898 .size deflateSetHeader, .-deflateSetHeader # ---------------------- .p2align 2,,3 # ---------------------- .globl deflatePending .type deflatePending, @function deflatePending: pushl %ebp movl %esp, %ebp movl 8(%ebp), %eax testl %eax, %eax pushl %ebx movl 12(%ebp), %ecx movl 16(%ebp), %ebx je .L905 movl 28(%eax), %edx testl %edx, %edx jne .L904 .L905: movl $-2, %eax .L903: movl (%esp), %ebx leave ret .p2align 2,,3 .L904: testl %ecx, %ecx je .L906 movl 20(%edx), %eax movl %eax, (%ecx) .L906: testl %ebx, %ebx je .L907 movl 5820(%edx), %ecx movl %ecx, (%ebx) .L907: xorl %eax, %eax jmp .L903 .size deflatePending, .-deflatePending # ---------------------- .p2align 2,,3 # ---------------------- .globl deflatePrime .type deflatePrime, @function deflatePrime: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx subl $12, %esp movl 8(%ebp), %eax testl %eax, %eax movl 12(%ebp), %edi je .L910 movl 28(%eax), %ebx testl %ebx, %ebx jne .L909 .L910: movl $-2, %eax .L908: leal -12(%ebp), %esp popl %ebx popl %esi popl %edi leave ret .p2align 2,,3 .L909: movl 16(%ebx), %edx addl $2, %edx cmpl %edx, 5796(%ebx) jae .L912 movl $-5, %eax jmp .L908 .p2align 2,,3 .L912: movl 5820(%ebx), %edx movl $16, %esi subl %edx, %esi cmpl %edi, %esi jle .L915 movl %edi, %esi .L915: movl %esi, %ecx movl $1, %eax sall %cl, %eax decl %eax andl 16(%ebp), %eax movb %dl, %cl sall %cl, %eax subl $12, %esp leal (%esi,%edx), %ecx orw %ax, 5816(%ebx) movl %ecx, 5820(%ebx) pushl %ebx call _tr_flush_bits movl %esi, %ecx sarl %cl, 16(%ebp) addl $16, %esp subl %esi, %edi jne .L912 xorl %eax, %eax jmp .L908 .size deflatePrime, .-deflatePrime # ---------------------- .p2align 2,,3 # ---------------------- .globl deflateTune .type deflateTune, @function deflateTune: pushl %ebp movl %esp, %ebp movl 8(%ebp), %eax testl %eax, %eax je .L919 movl 28(%eax), %edx testl %edx, %edx jne .L918 .L919: movl $-2, %eax .L917: leave ret .p2align 2,,3 .L918: movl 12(%ebp), %ecx movl %ecx, 140(%edx) movl 16(%ebp), %ecx movl %ecx, 128(%edx) movl 20(%ebp), %ecx movl %ecx, 144(%edx) movl 24(%ebp), %ecx movl %ecx, 124(%edx) xorl %eax, %eax jmp .L917 .size deflateTune, .-deflateTune # ---------------------- .p2align 2,,3 # ---------------------- .local longest_match .type longest_match, @function longest_match: pushl %ebp movl %esp, %ebp pushl %edi pushl %esi pushl %ebx subl $40, %esp movl 8(%ebp), %eax movl 56(%eax), %ebx movl %ebx, -16(%ebp) movl 120(%eax), %ebx movl 108(%eax), %edx movl 124(%eax), %edi movl %ebx, -20(%ebp) movl 144(%eax), %ebx movl 8(%ebp), %eax movl %ebx, -24(%ebp) movl 44(%eax), %ebx movl -16(%ebp), %esi leal -262(%ebx), %eax addl %edx, %esi cmpl %eax, %edx movl 12(%ebp), %ecx jbe .L402 movl %edx, %eax subl %ebx, %eax addl $262, %eax movl %eax, -28(%ebp) .L403: movl 8(%ebp), %ebx movl 64(%ebx), %eax movl %eax, -32(%ebp) movl 8(%ebp), %eax movl 52(%eax), %ebx movl %ebx, -36(%ebp) movl -16(%ebp), %ebx leal 258(%edx,%ebx), %eax movl -20(%ebp), %edx movl %eax, -40(%ebp) leal (%edx,%esi), %eax movb -1(%eax), %bl movb %bl, -41(%ebp) movb (%eax), %bl movb %bl, -49(%ebp) movl 8(%ebp), %ebx cmpl 140(%ebx), %edx jb .L404 shrl $2, %edi .L404: movl 8(%ebp), %ebx movl 116(%ebx), %edx cmpl %edx, -24(%ebp) movl %edx, -48(%ebp) jbe .L406 movl %edx, -24(%ebp) .p2align 2,,3 .L406: movl -16(%ebp), %edx addl %ecx, %edx movb -49(%ebp), %bl movl -20(%ebp), %eax cmpb %bl, (%eax,%edx) je .L931 .L408: movl -36(%ebp), %ebx andl %ecx, %ebx movl -32(%ebp), %edx movzwl (%edx,%ebx,2), %ecx cmpl -28(%ebp), %ecx jbe .L407 decl %edi jne .L406 .L407: movl -20(%ebp), %eax cmpl -48(%ebp), %eax jbe .L401 movl -48(%ebp), %eax .L401: addl $40, %esp popl %ebx popl %esi popl %edi leave ret .p2align 2,,3 .L931: movb -41(%ebp), %bl cmpb %bl, -1(%eax,%edx) jne .L408 movb (%esi), %bl cmpb %bl, (%edx) jne .L408 incl %edx movb 1(%esi), %bl cmpb %bl, (%edx) jne .L408 addl $2, %esi incl %edx .L411: incl %edx incl %esi movb (%edx), %bl cmpb %bl, (%esi) jne .L412 incl %edx incl %esi movb (%edx), %bl cmpb %bl, (%esi) jne .L412 incl %edx incl %esi movb (%edx), %bl cmpb %bl, (%esi) jne .L412 incl %edx incl %esi movb (%edx), %bl cmpb %bl, (%esi) jne .L412 incl %edx incl %esi movb (%edx), %bl cmpb %bl, (%esi) jne .L412 incl %edx incl %esi movb (%edx), %bl cmpb %bl, (%esi) jne .L412 incl %edx incl %esi movb (%edx), %bl cmpb %bl, (%esi) jne .L412 incl %edx incl %esi movb (%edx), %bl cmpb %bl, (%esi) jne .L412 cmpl -40(%ebp), %esi jb .L411 .L412: movl -40(%ebp), %ebx subl %esi, %ebx movl $258, %edx subl %ebx, %edx movl -40(%ebp), %esi subl $258, %esi cmpl -20(%ebp), %edx jle .L408 movl -24(%ebp), %eax movl 8(%ebp), %ebx cmpl %eax, %edx movl %ecx, 112(%ebx) movl %edx, -20(%ebp) jge .L407 leal (%edx,%esi), %ebx movb -1(%ebx), %al movb %al, -41(%ebp) movb (%ebx), %dl movb %dl, -49(%ebp) jmp .L408 .p2align 2,,3 .L402: movl $0, -28(%ebp) jmp .L403 .size longest_match, .-longest_match # ---------------------- .ident "GCC: (GNU) 3.2.3 20030502 (Red Hat Linux 3.2.3-59)" .section .note.GNU-stack,"",@progbits
Transynther/x86/_processed/NC/_st_zr_sm_/i7-7700_9_0xca.log_21829_1727.asm
ljhsiun2/medusa
9
165645
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r15 push %r8 push %rax push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x6bb7, %rsi nop and %rbx, %rbx vmovups (%rsi), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %r15 nop nop nop nop xor %r8, %r8 lea addresses_UC_ht+0xdcf3, %rsi lea addresses_WC_ht+0x19ff7, %rdi clflush (%rsi) nop nop nop nop nop xor %r10, %r10 mov $36, %rcx rep movsw nop nop nop nop xor %rsi, %rsi lea addresses_D_ht+0x13b97, %r8 sub %rsi, %rsi mov $0x6162636465666768, %rbx movq %rbx, (%r8) nop nop cmp $58519, %rsi lea addresses_A_ht+0x1117e, %rsi lea addresses_normal_ht+0x17237, %rdi nop nop nop nop xor %rax, %rax mov $112, %rcx rep movsw nop nop nop nop nop add %rbx, %rbx lea addresses_normal_ht+0x18577, %rsi lea addresses_D_ht+0x136a3, %rdi nop nop nop nop nop cmp %rbx, %rbx mov $52, %rcx rep movsb add %rcx, %rcx lea addresses_normal_ht+0xb477, %rbx nop sub %rdi, %rdi mov $0x6162636465666768, %rsi movq %rsi, %xmm2 vmovups %ymm2, (%rbx) nop nop nop and $57410, %r15 lea addresses_WC_ht+0x17ab7, %rsi lea addresses_D_ht+0x14cb7, %rdi clflush (%rdi) nop nop nop nop nop sub %r8, %r8 mov $108, %rcx rep movsl nop nop nop inc %rdi lea addresses_WT_ht+0x9611, %rdi nop nop nop nop nop cmp %rcx, %rcx mov (%rdi), %bx nop xor $9555, %r10 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r15 pop %r10 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r9 push %rbp push %rbx push %rcx push %rdx // Load lea addresses_US+0x8ab7, %rdx clflush (%rdx) nop nop inc %r12 movups (%rdx), %xmm4 vpextrq $1, %xmm4, %rbp nop nop nop dec %rcx // Store lea addresses_PSE+0x1aea7, %r13 nop nop nop nop inc %rbx movw $0x5152, (%r13) nop nop nop nop nop xor %rdx, %rdx // Store lea addresses_WC+0x127b7, %rdx nop and %rbp, %rbp movb $0x51, (%rdx) nop nop nop nop nop cmp %r13, %r13 // Store lea addresses_WT+0xc473, %rbx nop nop nop cmp %r13, %r13 mov $0x5152535455565758, %rcx movq %rcx, %xmm3 movntdq %xmm3, (%rbx) nop nop nop nop nop sub %rdx, %rdx // Store mov $0x59a92200000002b7, %r13 nop nop nop nop dec %rcx mov $0x5152535455565758, %rbp movq %rbp, %xmm4 vmovups %ymm4, (%r13) and $53947, %rbp // Faulty Load mov $0x59a92200000002b7, %r13 nop nop nop nop nop sub %r12, %r12 movups (%r13), %xmm7 vpextrq $0, %xmm7, %rcx lea oracles, %r12 and $0xff, %rcx shlq $12, %rcx mov (%r12,%rcx,1), %rcx pop %rdx pop %rcx pop %rbx pop %rbp pop %r9 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'} {'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_PSE'}} {'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': True, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC'}} {'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 16, 'NT': True, 'type': 'addresses_WT'}} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_NC'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 8, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}} {'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_D_ht'}} {'src': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}} {'src': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}} {'src': {'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_D_ht'}} {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'56': 93, '55': 45, '00': 1121, '58': 20498, '57': 72} 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 55 58 00 58 58 55 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 00 58 58 58 58 58 58 55 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 55 58 58 58 58 58 58 58 00 00 58 58 00 58 58 58 00 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 55 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 00 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 55 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 55 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 55 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 55 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 55 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 00 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 00 55 58 55 58 58 58 58 58 00 58 58 55 58 58 00 58 58 58 58 58 00 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
grammar/MmLexer.g4
anterokangas/mmjs
0
6232
<filename>grammar/MmLexer.g4 lexer grammar MmLexer ; Comment : '(*' .*? '*)' -> skip ; WS : [ \t\r\n]+ -> skip ; CommandStart : '(' -> pushMode(CommandMode) ; Text : ~('\'' | '"' | '(' | ')')+ ; mode CommandMode; CommandWS : WS -> skip ; Role : 'Role' -> mode(RoleCommandMode) ; mode RoleCommandMode ; RoleCommandWS : [ \t\r\n]+ -> skip ; RoleName : [a-zA-Z0-9._] ; RoleParameterStart : '(' ; RolePitch : 'pitch' -> pushMode(IntegerParameterMode) ; RoleCommandEnd : ')' -> popMode ; mode IntegerParameterMode ; IntegerWS : [ \t\r\n]+ -> skip ; Integer : [+\-]?[0-9]+ ; IntegerParameterEnd : ')' -> popMode ;
programs/oeis/053/A053209.asm
karttu/loda
1
164163
<gh_stars>1-10 ; A053209: Row sums of A051598. ; 1,5,14,32,68,140,284,572,1148,2300,4604,9212,18428,36860,73724,147452,294908,589820,1179644,2359292,4718588,9437180,18874364,37748732,75497468,150994940,301989884,603979772,1207959548,2415919100,4831838204,9663676412,19327352828,38654705660,77309411324,154618822652,309237645308,618475290620,1236950581244,2473901162492,4947802324988,9895604649980,19791209299964,39582418599932,79164837199868,158329674399740,316659348799484,633318697598972,1266637395197948,2533274790395900,5066549580791804 mov $1,2 pow $1,$0 mul $1,9 sub $1,7 div $1,2
programs/oeis/171/A171182.asm
karttu/loda
1
6060
<filename>programs/oeis/171/A171182.asm ; A171182: Period 6: repeat [0, 1, 1, 1, 0, 2]. ; 0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1,1,0,2,0,1,1 add $0,1 gcd $0,6 log $0,2 mov $1,$0
oeis/033/A033672.asm
neoneye/loda-programs
11
161680
<filename>oeis/033/A033672.asm ; A033672: Trajectory of 69 under map x->x + (x-with-digits-reversed). ; Submitted by <NAME> ; 69,165,726,1353,4884,9768,18447,92928,175857,934428,1758867,9447438,17794887,96644658,182289327,906271608,1712444217,8836886388,17673772776,85401510447,159803020905,668823329856,1327746658722,3606313135953,7201626272016,13304352533043,47337877873374,94675755746748,179440511504397,972845626549368,1836791253097647,9304694775074028,17509400550038067,93592406050528638,177274911110958177,949133922230430948,1798167954459762897,9780847499057381868,18462685009004862747,93189525099063489228 mov $2,$0 lpb $2 mov $0,$1 add $0,69 seq $0,4086 ; Read n backwards (referred to as R(n) in many sequences). add $1,$0 sub $2,1 lpe mov $0,$1 add $0,69
core/lib/Equivalences.agda
cmknapp/HoTT-Agda
0
9599
{-# OPTIONS --without-K #-} open import lib.Base open import lib.PathGroupoid open import lib.PathFunctor open import lib.NType module lib.Equivalences where {- We use the half-adjoint definition of equivalences (but this fact should be invisible to the user of the library). The constructor of the type of equivalences is [equiv], it takes two maps and the two proofs that the composites are equal: [equiv to from to-from from-to] The type of equivalences between two types [A] and [B] can be written either [A ≃ B] or [Equiv A B]. Given an equivalence [e] : [A ≃ B], you can extract the two maps as follows: [–> e] : [A → B] and [<– e] : [B → A] (the dash is an en dash) The proofs that the composites are the identities are [<–-inv-l] and [<–-inv-r]. The identity equivalence on [A] is [ide A], the composition of two equivalences is [_∘e_] (function composition order) and the inverse of an equivalence is [_⁻¹] -} module _ {i} {j} {A : Type i} {B : Type j} where record is-equiv (f : A → B) : Type (lmax i j) where field g : B → A f-g : (b : B) → f (g b) == b g-f : (a : A) → g (f a) == a adj : (a : A) → ap f (g-f a) == f-g (f a) abstract adj' : (b : B) → ap g (f-g b) == g-f (g b) adj' b = anti-whisker-left (ap g (f-g (f (g b)))) $ ! $ ap g (f-g (f (g b))) ∙ g-f (g b) =⟨ ! $ htpy-natural-app=idf f-g b |in-ctx (λ p → ap g p ∙ g-f (g b)) ⟩ ap g (ap (f ∘ g) (f-g b)) ∙ g-f (g b) =⟨ ! $ ap-∘ g (f ∘ g) (f-g b) |in-ctx (λ p → p ∙ g-f (g b)) ⟩ ap (g ∘ f ∘ g) (f-g b) ∙ g-f (g b) =⟨ htpy-natural (g-f ∘ g) (f-g b) ⟩ g-f (g (f (g b))) ∙ ap g (f-g b) =⟨ ! $ htpy-natural-app=idf g-f (g b) |in-ctx (λ p → p ∙ ap g (f-g b)) ⟩ ap (g ∘ f) (g-f (g b)) ∙ ap g (f-g b) =⟨ ap-∘ g f (g-f (g b)) |in-ctx (λ p → p ∙ ap g (f-g b)) ⟩ ap g (ap f (g-f (g b))) ∙ ap g (f-g b) =⟨ adj (g b) |in-ctx (λ p → ap g p ∙ ap g (f-g b)) ⟩ ap g (f-g (f (g b))) ∙ ap g (f-g b) ∎ {- In order to prove that something is an equivalence, you have to give an inverse and a proof that it’s an inverse (you don’t need the adj part). [is-eq] is a very, very bad name. -} is-eq : (f : A → B) (g : B → A) (f-g : (b : B) → f (g b) == b) (g-f : (a : A) → g (f a) == a) → is-equiv f is-eq f g f-g g-f = record {g = g; f-g = f-g'; g-f = g-f; adj = adj} where f-g' : (b : B) → f (g b) == b f-g' b = ! (ap (f ∘ g) (f-g b)) ∙ ap f (g-f (g b)) ∙ f-g b adj : (a : A) → ap f (g-f a) == f-g' (f a) adj a = ap f (g-f a) =⟨ ! (!-inv-l (ap (f ∘ g) (f-g (f a)))) |in-ctx (λ q → q ∙ ap f (g-f a)) ⟩ (! (ap (f ∘ g) (f-g (f a))) ∙ ap (f ∘ g) (f-g (f a))) ∙ ap f (g-f a) =⟨ ∙-assoc (! (ap (f ∘ g) (f-g (f a)))) (ap (f ∘ g) (f-g (f a))) _ ⟩ ! (ap (f ∘ g) (f-g (f a))) ∙ ap (f ∘ g) (f-g (f a)) ∙ ap f (g-f a) =⟨ lemma |in-ctx (λ q → ! (ap (f ∘ g) (f-g (f a))) ∙ q) ⟩ ! (ap (f ∘ g) (f-g (f a))) ∙ ap f (g-f (g (f a))) ∙ f-g (f a) ∎ where lemma : ap (f ∘ g) (f-g (f a)) ∙ ap f (g-f a) == ap f (g-f (g (f a))) ∙ f-g (f a) lemma = ap (f ∘ g) (f-g (f a)) ∙ ap f (g-f a) =⟨ htpy-natural-app=idf f-g (f a) |in-ctx (λ q → q ∙ ap f (g-f a)) ⟩ f-g (f (g (f a))) ∙ ap f (g-f a) =⟨ ! (ap-idf (ap f (g-f a))) |in-ctx (λ q → f-g (f (g (f a))) ∙ q) ⟩ f-g (f (g (f a))) ∙ ap (idf B) (ap f (g-f a)) =⟨ ! (htpy-natural f-g (ap f (g-f a))) ⟩ ap (f ∘ g) (ap f (g-f a)) ∙ f-g (f a) =⟨ ap-∘ f g (ap f (g-f a)) |in-ctx (λ q → q ∙ f-g (f a)) ⟩ ap f (ap g (ap f (g-f a))) ∙ f-g (f a) =⟨ ∘-ap g f (g-f a) ∙ htpy-natural-app=idf g-f a |in-ctx (λ q → ap f q ∙ f-g (f a)) ⟩ ap f (g-f (g (f a))) ∙ f-g (f a) ∎ infix 30 _≃_ _≃_ : ∀ {i j} (A : Type i) (B : Type j) → Type (lmax i j) A ≃ B = Σ (A → B) is-equiv Equiv = _≃_ module _ {i} {j} {A : Type i} {B : Type j} where equiv : (f : A → B) (g : B → A) (f-g : (b : B) → f (g b) == b) (g-f : (a : A) → g (f a) == a) → A ≃ B equiv f g f-g g-f = (f , is-eq f g f-g g-f) –> : (e : A ≃ B) → (A → B) –> e = fst e <– : (e : A ≃ B) → (B → A) <– e = is-equiv.g (snd e) <–-inv-l : (e : A ≃ B) (a : A) → (<– e (–> e a) == a) <–-inv-l e a = is-equiv.g-f (snd e) a <–-inv-r : (e : A ≃ B) (b : B) → (–> e (<– e b) == b) <–-inv-r e b = is-equiv.f-g (snd e) b <–-inv-adj : (e : A ≃ B) (a : A) → ap (–> e) (<–-inv-l e a) == <–-inv-r e (–> e a) <–-inv-adj e a = is-equiv.adj (snd e) a <–-inv-adj' : (e : A ≃ B) (b : B) → ap (<– e) (<–-inv-r e b) == <–-inv-l e (<– e b) <–-inv-adj' e b = is-equiv.adj' (snd e) b -- Equivalences are "injective" equiv-inj : (e : A ≃ B) {x y : A} → (–> e x == –> e y → x == y) equiv-inj e {x} {y} p = ! (<–-inv-l e x) ∙ ap (<– e) p ∙ <–-inv-l e y idf-is-equiv : ∀ {i} (A : Type i) → is-equiv (idf A) idf-is-equiv A = is-eq _ (idf A) (λ _ → idp) (λ _ → idp) ide : ∀ {i} (A : Type i) → A ≃ A ide A = equiv (idf A) (idf A) (λ _ → idp) (λ _ → idp) infixr 80 _∘e_ infixr 80 _∘ise_ _∘e_ : ∀ {i j k} {A : Type i} {B : Type j} {C : Type k} → B ≃ C → A ≃ B → A ≃ C e1 ∘e e2 = ((–> e1 ∘ –> e2) , record {g = (<– e2 ∘ <– e1); f-g = (λ c → ap (–> e1) (<–-inv-r e2 (<– e1 c)) ∙ <–-inv-r e1 c); g-f = (λ a → ap (<– e2) (<–-inv-l e1 (–> e2 a)) ∙ <–-inv-l e2 a); adj = λ a → ap (–> e1 ∘ –> e2) (ap (<– e2) (<–-inv-l e1 (–> e2 a)) ∙ <–-inv-l e2 a) =⟨ ap-∘ (–> e1) (–> e2) (ap (<– e2) (<–-inv-l e1 (–> e2 a)) ∙ <–-inv-l e2 a) ⟩ ap (–> e1) (ap (–> e2) (ap (<– e2) (<–-inv-l e1 (–> e2 a)) ∙ <–-inv-l e2 a)) =⟨ ap-∙ (–> e2) (ap (<– e2) (<–-inv-l e1 (–> e2 a))) (<–-inv-l e2 a) |in-ctx ap (–> e1) ⟩ ap (–> e1) (ap (–> e2) (ap (<– e2) (<–-inv-l e1 (–> e2 a))) ∙ ap (–> e2) (<–-inv-l e2 a)) =⟨ ! (ap-∘ (–> e2) (<– e2) (<–-inv-l e1 (–> e2 a))) ∙2 <–-inv-adj e2 a |in-ctx ap (–> e1) ⟩ ap (–> e1) (ap (–> e2 ∘ <– e2) (<–-inv-l e1 (–> e2 a)) ∙ <–-inv-r e2 (–> e2 a)) =⟨ htpy-natural (<–-inv-r e2) (<–-inv-l e1 (–> e2 a)) |in-ctx ap (–> e1) ⟩ ap (–> e1) (<–-inv-r e2 (<– e1 ((–> e1 ∘ –> e2) a)) ∙ ap (λ z → z) (<–-inv-l e1 (–> e2 a))) =⟨ <–-inv-r e2 (<– e1 ((–> e1 ∘ –> e2) a)) ∙ₗ ap-idf (<–-inv-l e1 (–> e2 a)) |in-ctx ap (–> e1) ⟩ ap (–> e1) (<–-inv-r e2 (<– e1 ((–> e1 ∘ –> e2) a)) ∙ <–-inv-l e1 (–> e2 a)) =⟨ ap-∙ (–> e1) (<–-inv-r e2 (<– e1 ((–> e1 ∘ –> e2) a))) (<–-inv-l e1 (–> e2 a)) ⟩ ap (–> e1) (<–-inv-r e2 (<– e1 ((–> e1 ∘ –> e2) a))) ∙ ap (–> e1) (<–-inv-l e1 (–> e2 a)) =⟨ ap (–> e1) (<–-inv-r e2 (<– e1 ((–> e1 ∘ –> e2) a))) ∙ₗ (<–-inv-adj e1 (–> e2 a)) ⟩ ap (–> e1) (<–-inv-r e2 (<– e1 ((–> e1 ∘ –> e2) a))) ∙ <–-inv-r e1 ((–> e1 ∘ –> e2) a) ∎}) _∘ise_ : ∀ {i j k} {A : Type i} {B : Type j} {C : Type k} {f : A → B} {g : B → C} → is-equiv g → is-equiv f → is-equiv (g ∘ f) i1 ∘ise i2 = snd ((_ , i1) ∘e (_ , i2)) infix 120 _⁻¹ _⁻¹ : ∀ {i j} {A : Type i} {B : Type j} → (A ≃ B) → (B ≃ A) e ⁻¹ = equiv (<– e) (–> e) (<–-inv-l e) (<–-inv-r e) {- Equational reasoning for equivalences -} infix 15 _≃∎ infixr 10 _≃⟨_⟩_ _≃⟨_⟩_ : ∀ {i j k} (A : Type i) {B : Type j} {C : Type k} → A ≃ B → B ≃ C → A ≃ C A ≃⟨ u ⟩ v = v ∘e u _≃∎ : ∀ {i} (A : Type i) → A ≃ A _≃∎ = ide {- lifting is an equivalence -} lower-equiv : ∀ {i j} {A : Type i} → Lift {j = j} A ≃ A lower-equiv = equiv lower lift (λ _ → idp) (λ _ → idp) {- Any contractible type is equivalent to (all liftings of) the unit type -} module _ {i} {A : Type i} (h : is-contr A) where contr-equiv-Unit : A ≃ Unit contr-equiv-Unit = equiv (λ _ → unit) (λ _ → fst h) (λ _ → idp) (snd h) contr-equiv-LiftUnit : ∀ {j} → A ≃ Lift {j = j} Unit contr-equiv-LiftUnit = lower-equiv ⁻¹ ∘e contr-equiv-Unit {- An equivalence induces an equivalence on the path spaces -} module _ {i j} {A : Type i} {B : Type j} (e : A ≃ B) where private abstract left-inverse : {x y : A} (p : x == y) → equiv-inj e (ap (–> e) p) == p left-inverse idp = !-inv-l (<–-inv-l e _) right-inverse : {x y : A} (p : –> e x == –> e y) → ap (–> e) (equiv-inj e p) == p right-inverse {x} {y} p = ap f (! (g-f x) ∙ ap g p ∙ (g-f y)) =⟨ ap-∙ f (! (g-f x)) (ap g p ∙ (g-f y)) ⟩ ap f (! (g-f x)) ∙ ap f (ap g p ∙ (g-f y)) =⟨ ap-∙ f (ap g p) (g-f y) |in-ctx (λ q → ap f (! (g-f x)) ∙ q) ⟩ ap f (! (g-f x)) ∙ ap f (ap g p) ∙ ap f (g-f y) =⟨ ∘-ap f g p |in-ctx (λ q → ap f (! (g-f x)) ∙ q ∙ ap f (g-f y)) ⟩ ap f (! (g-f x)) ∙ ap (f ∘ g) p ∙ ap f (g-f y) =⟨ adj y |in-ctx (λ q → ap f (! (g-f x)) ∙ ap (f ∘ g) p ∙ q) ⟩ ap f (! (g-f x)) ∙ ap (f ∘ g) p ∙ (f-g (f y)) =⟨ ap-! f (g-f x) |in-ctx (λ q → q ∙ ap (f ∘ g) p ∙ (f-g (f y))) ⟩ ! (ap f (g-f x)) ∙ ap (f ∘ g) p ∙ (f-g (f y)) =⟨ adj x |in-ctx (λ q → ! q ∙ ap (f ∘ g) p ∙ (f-g (f y))) ⟩ ! (f-g (f x)) ∙ ap (f ∘ g) p ∙ (f-g (f y)) =⟨ htpy-natural f-g p |in-ctx (λ q → ! (f-g (f x)) ∙ q) ⟩ ! (f-g (f x)) ∙ (f-g (f x)) ∙ ap (idf B) p =⟨ ! (∙-assoc (! (f-g (f x))) (f-g (f x)) (ap (idf B) p)) ∙ ap (λ q → q ∙ ap (idf B) p) (!-inv-l (f-g (f x))) ∙ ap-idf p ⟩ p ∎ where f : A → B f = fst e open is-equiv (snd e) equiv-ap : (x y : A) → (x == y) ≃ (–> e x == –> e y) equiv-ap x y = equiv (ap (–> e)) (equiv-inj e) right-inverse left-inverse {- Equivalent types have the same truncation level -} equiv-preserves-level : ∀ {i j} {A : Type i} {B : Type j} {n : ℕ₋₂} (e : A ≃ B) → (has-level n A → has-level n B) equiv-preserves-level {n = ⟨-2⟩} e (x , p) = (–> e x , (λ y → ap (–> e) (p _) ∙ <–-inv-r e y)) equiv-preserves-level {n = S n} e c = λ x y → equiv-preserves-level (equiv-ap (e ⁻¹) x y ⁻¹) (c (<– e x) (<– e y)) {- This is a collection of type equivalences involving basic type formers. We exclude Empty since Π₁-Empty requires λ=. -} module _ {j} {B : Unit → Type j} where Σ₁-Unit : Σ Unit B ≃ B unit Σ₁-Unit = equiv (λ {(unit , b) → b}) (λ b → (unit , b)) (λ _ → idp) (λ _ → idp) Π₁-Unit : Π Unit B ≃ B unit Π₁-Unit = equiv (λ f → f unit) (λ b _ → b) (λ _ → idp) (λ _ → idp) module _ {i} {A : Type i} where Σ₂-Unit : Σ A (λ _ → Unit) ≃ A Σ₂-Unit = equiv fst (λ a → (a , unit)) (λ _ → idp) (λ _ → idp) Π₂-Unit : Π A (λ _ → Unit) ≃ Unit Π₂-Unit = equiv (λ _ → unit) (λ _ _ → unit) (λ _ → idp) (λ _ → idp) module _ {i j k} {A : Type i} {B : A → Type j} {C : (a : A) → B a → Type k} where Σ-assoc : Σ (Σ A B) (uncurry C) ≃ Σ A (λ a → Σ (B a) (C a)) Σ-assoc = equiv (λ {((a , b) , c) → (a , (b , c))}) (λ {(a , (b , c)) → ((a , b) , c)}) (λ _ → idp) (λ _ → idp) curry-equiv : Π (Σ A B) (uncurry C) ≃ Π A (λ a → Π (B a) (C a)) curry-equiv = equiv curry uncurry (λ _ → idp) (λ _ → idp) {- The type-theoretic axiom of choice -} choice : Π A (λ a → Σ (B a) (λ b → C a b)) ≃ Σ (Π A B) (λ g → Π A (λ a → C a (g a))) choice = equiv f g (λ _ → idp) (λ _ → idp) where f = λ c → ((λ a → fst (c a)) , (λ a → snd (c a))) g = λ d → (λ a → (fst d a , snd d a)) {- Homotopy fibers -} hfiber : ∀ {i j} {A : Type i} {B : Type j} (f : A → B) (y : B) → Type (lmax i j) hfiber {A = A} f y = Σ A (λ x → f x == y)
test/Succeed/Issue695.agda
hborum/agda
2
3558
<filename>test/Succeed/Issue695.agda module _ where data Sigma (A : Set)(B : A → Set) : Set where _,_ : (x : A) → B x → Sigma A B record Top : Set where _o_ : {A B : Set}{C : Set1} → (f : B → C) → (g : A → B) → (A → C) f o g = \ x → f (g x) mutual data U : Set where top : U sig : (X : U) → (T X → U) → U T : U → Set T top = Top T (sig a b) = Sigma (T a) (T o b)
programs/oeis/034/A034856.asm
karttu/loda
1
165608
; A034856: a(n) = binomial(n+1, 2) + n - 1 = n*(n + 3)/2 - 1. ; 1,4,8,13,19,26,34,43,53,64,76,89,103,118,134,151,169,188,208,229,251,274,298,323,349,376,404,433,463,494,526,559,593,628,664,701,739,778,818,859,901,944,988,1033,1079,1126,1174,1223,1273,1324,1376,1429,1483,1538,1594,1651,1709,1768,1828,1889,1951,2014,2078,2143,2209,2276,2344,2413,2483,2554,2626,2699,2773,2848,2924,3001,3079,3158,3238,3319,3401,3484,3568,3653,3739,3826,3914,4003,4093,4184,4276,4369,4463,4558,4654,4751,4849,4948,5048,5149,5251,5354,5458,5563,5669,5776,5884,5993,6103,6214,6326,6439,6553,6668,6784,6901,7019,7138,7258,7379,7501,7624,7748,7873,7999,8126,8254,8383,8513,8644,8776,8909,9043,9178,9314,9451,9589,9728,9868,10009,10151,10294,10438,10583,10729,10876,11024,11173,11323,11474,11626,11779,11933,12088,12244,12401,12559,12718,12878,13039,13201,13364,13528,13693,13859,14026,14194,14363,14533,14704,14876,15049,15223,15398,15574,15751,15929,16108,16288,16469,16651,16834,17018,17203,17389,17576,17764,17953,18143,18334,18526,18719,18913,19108,19304,19501,19699,19898,20098,20299,20501,20704,20908,21113,21319,21526,21734,21943,22153,22364,22576,22789,23003,23218,23434,23651,23869,24088,24308,24529,24751,24974,25198,25423,25649,25876,26104,26333,26563,26794,27026,27259,27493,27728,27964,28201,28439,28678,28918,29159,29401,29644,29888,30133,30379,30626,30874,31123,31373,31624 mov $1,$0 add $1,3 bin $1,2 sub $1,2
programs/oeis/021/A021277.asm
karttu/loda
0
87087
; A021277: Decimal expansion of 1/273. ; 0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3,6,6,3,0,0,3 add $0,46079 lpb $0,1 add $0,1 mul $0,5 mod $0,6 lpe mov $1,$0 mul $1,3
agda/Algebra/Construct/Free/Semilattice/Relation/Unary.agda
oisdk/combinatorics-paper
6
11079
{-# OPTIONS --cubical --safe #-} module Algebra.Construct.Free.Semilattice.Relation.Unary where open import Algebra.Construct.Free.Semilattice.Relation.Unary.All.Def public open import Algebra.Construct.Free.Semilattice.Relation.Unary.All.Dec public open import Algebra.Construct.Free.Semilattice.Relation.Unary.All.Properties public open import Algebra.Construct.Free.Semilattice.Relation.Unary.All.Map public open import Algebra.Construct.Free.Semilattice.Relation.Unary.Membership public open import Algebra.Construct.Free.Semilattice.Relation.Unary.Any.Def public open import Algebra.Construct.Free.Semilattice.Relation.Unary.Any.Dec public open import Algebra.Construct.Free.Semilattice.Relation.Unary.Any.Properties public open import Algebra.Construct.Free.Semilattice.Relation.Unary.Any.Map public