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 |
|---|---|---|---|---|
test/asset/agda-stdlib-1.0/Data/Maybe/Relation/Unary/All.agda | omega12345/agda-mode | 0 | 6671 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- Maybes where all the elements satisfy a given property
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Maybe.Relation.Unary.All where
open import Category.Applicative
open import Category.Monad
open import Data.Maybe.Base using (Maybe; just; nothing)
open import Data.Maybe.Relation.Unary.Any using (Any; just)
open import Data.Product as Prod using (_,_)
open import Function using (id; _∘′_)
open import Function.Equivalence using (_⇔_; equivalence)
open import Level
open import Relation.Binary.PropositionalEquality as P using (_≡_; cong)
open import Relation.Unary
open import Relation.Nullary
import Relation.Nullary.Decidable as Dec
------------------------------------------------------------------------
-- Definition
data All {a p} {A : Set a} (P : Pred A p) : Pred (Maybe A) (a ⊔ p) where
just : ∀ {x} → P x → All P (just x)
nothing : All P nothing
------------------------------------------------------------------------
-- Basic operations
module _ {a p} {A : Set a} {P : Pred A p} where
drop-just : ∀ {x} → All P (just x) → P x
drop-just (just px) = px
just-equivalence : ∀ {x} → P x ⇔ All P (just x)
just-equivalence = equivalence just drop-just
map : ∀ {q} {Q : Pred A q} → P ⊆ Q → All P ⊆ All Q
map f (just px) = just (f px)
map f nothing = nothing
fromAny : Any P ⊆ All P
fromAny (just px) = just px
------------------------------------------------------------------------
-- (un/)zip(/With)
module _ {a p q r} {A : Set a} {P : Pred A p} {Q : Pred A q} {R : Pred A r} where
zipWith : P ∩ Q ⊆ R → All P ∩ All Q ⊆ All R
zipWith f (just px , just qx) = just (f (px , qx))
zipWith f (nothing , nothing) = nothing
unzipWith : P ⊆ Q ∩ R → All P ⊆ All Q ∩ All R
unzipWith f (just px) = Prod.map just just (f px)
unzipWith f nothing = nothing , nothing
module _ {a p q} {A : Set a} {P : Pred A p} {Q : Pred A q} where
zip : All P ∩ All Q ⊆ All (P ∩ Q)
zip = zipWith id
unzip : All (P ∩ Q) ⊆ All P ∩ All Q
unzip = unzipWith id
------------------------------------------------------------------------
-- Traversable-like functions
module _ {a} p {A : Set a} {P : Pred A (a ⊔ p)} {F}
(App : RawApplicative {a ⊔ p} F) where
open RawApplicative App
sequenceA : All (F ∘′ P) ⊆ F ∘′ All P
sequenceA nothing = pure nothing
sequenceA (just px) = just <$> px
mapA : ∀ {q} {Q : Pred A q} → (Q ⊆ F ∘′ P) → All Q ⊆ (F ∘′ All P)
mapA f = sequenceA ∘′ map f
forA : ∀ {q} {Q : Pred A q} {xs} → All Q xs → (Q ⊆ F ∘′ P) → F (All P xs)
forA qxs f = mapA f qxs
module _ {a} p {A : Set a} {P : Pred A (a ⊔ p)} {M}
(Mon : RawMonad {a ⊔ p} M) where
private App = RawMonad.rawIApplicative Mon
sequenceM : All (M ∘′ P) ⊆ M ∘′ All P
sequenceM = sequenceA p App
mapM : ∀ {q} {Q : Pred A q} → (Q ⊆ M ∘′ P) → All Q ⊆ (M ∘′ All P)
mapM = mapA p App
forM : ∀ {q} {Q : Pred A q} {xs} → All Q xs → (Q ⊆ M ∘′ P) → M (All P xs)
forM = forA p App
------------------------------------------------------------------------
-- Seeing All as a predicate transformer
module _ {a p} {A : Set a} {P : Pred A p} where
dec : Decidable P → Decidable (All P)
dec P-dec nothing = yes nothing
dec P-dec (just x) = Dec.map just-equivalence (P-dec x)
universal : Universal P → Universal (All P)
universal P-universal (just x) = just (P-universal x)
universal P-universal nothing = nothing
irrelevant : Irrelevant P → Irrelevant (All P)
irrelevant P-irrelevant (just p) (just q) = cong just (P-irrelevant p q)
irrelevant P-irrelevant nothing nothing = P.refl
satisfiable : Satisfiable (All P)
satisfiable = nothing , nothing
|
oeis/137/A137246.asm | neoneye/loda-programs | 11 | 93877 | <gh_stars>10-100
; A137246: a(n) is the ratio of the sum of the squares of the bends (curvatures) of the n-th generation of an Apollonian packing to the sum of the squares of the bends of the initial four-circle configuration.
; Submitted by <NAME>
; 1,17,339,6729,133563,2651073,52620771,1044462201,20731381707,411494247537,8167690805619,162119333369769,3217883594978523,63871313899461153,1267772627204287491,25163838602387366361,499473454166134464747,9913977567515527195857,196781130987812140522899,3905880687053696228870409,77527270348110488155839483,1538827764901048674430178433,30543973486976642024136050211,606262986444829694459430468921,12033627808435663963116201227787,238853767209378790178945733148977,4740974460762268811689566059296179
mov $1,1
lpb $0
sub $0,1
add $2,$1
mul $1,16
add $3,$1
add $2,$3
mov $1,$2
mul $2,2
lpe
mov $0,$1
|
src/shared/generic/lsc-internal-hmac_ripemd160.adb | Componolit/libsparkcrypto | 30 | 10806 | <gh_stars>10-100
-------------------------------------------------------------------------------
-- This file is part of libsparkcrypto.
--
-- Copyright (C) 2010, <NAME>
-- Copyright (C) 2010, secunet Security Networks AG
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- * Neither the name of the nor the names of its contributors may be used
-- to endorse or promote products derived from this software without
-- specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
with LSC.Internal.Ops32;
with LSC.Internal.Debug;
pragma Unreferenced (LSC.Internal.Debug);
package body LSC.Internal.HMAC_RIPEMD160 is
IPad : constant RIPEMD160.Block_Type :=
RIPEMD160.Block_Type'(RIPEMD160.Block_Index => 16#36363636#);
OPad : constant RIPEMD160.Block_Type :=
RIPEMD160.Block_Type'(RIPEMD160.Block_Index => 16#5C5C5C5C#);
----------------------------------------------------------------------------
function Context_Init (Key : RIPEMD160.Block_Type) return Context_Type is
Result : Context_Type;
Temp : RIPEMD160.Block_Type;
begin
pragma Debug (Debug.Put_Line ("HMAC.RIPEMD160.Context_Init:"));
Result.Key := Key;
Result.RIPEMD160_Context := RIPEMD160.Context_Init;
Ops32.Block_XOR (IPad, Result.Key, Temp);
RIPEMD160.Context_Update (Result.RIPEMD160_Context, Temp);
return Result;
end Context_Init;
----------------------------------------------------------------------------
procedure Context_Update
(Context : in out Context_Type;
Block : in RIPEMD160.Block_Type)
is
begin
pragma Debug (Debug.Put_Line ("HMAC.RIPEMD160.Context_Update:"));
RIPEMD160.Context_Update (Context.RIPEMD160_Context, Block);
end Context_Update;
----------------------------------------------------------------------------
procedure Context_Finalize_Outer
(Context : in out Context_Type)
with Depends => (Context => Context);
procedure Context_Finalize_Outer
(Context : in out Context_Type)
is
Hash : RIPEMD160.Hash_Type;
Temp : RIPEMD160.Block_Type;
begin
Hash := RIPEMD160.Get_Hash (Context.RIPEMD160_Context);
Context.RIPEMD160_Context := RIPEMD160.Context_Init;
Ops32.Block_XOR (OPad, Context.Key, Temp);
RIPEMD160.Context_Update (Context.RIPEMD160_Context, Temp);
Temp := RIPEMD160.Null_Block;
Ops32.Block_Copy (Hash, Temp);
RIPEMD160.Context_Finalize (Context.RIPEMD160_Context, Temp, 160);
end Context_Finalize_Outer;
----------------------------------------------------------------------------
procedure Context_Finalize
(Context : in out Context_Type;
Block : in RIPEMD160.Block_Type;
Length : in RIPEMD160.Block_Length_Type)
is
begin
pragma Debug (Debug.Put_Line ("HMAC.RIPEMD160.Context_Finalize:"));
RIPEMD160.Context_Finalize (Context.RIPEMD160_Context, Block, Length);
Context_Finalize_Outer (Context);
end Context_Finalize;
----------------------------------------------------------------------------
function Get_Auth (Context : in Context_Type) return RIPEMD160.Hash_Type is
begin
return RIPEMD160.Get_Hash (Context.RIPEMD160_Context);
end Get_Auth;
----------------------------------------------------------------------------
function Authenticate
(Key : RIPEMD160.Block_Type;
Message : RIPEMD160.Message_Type;
Length : Types.Word64) return RIPEMD160.Hash_Type
is
HMAC_Ctx : Context_Type;
begin
HMAC_Ctx := Context_Init (Key);
RIPEMD160.Hash_Context (Message, Length, HMAC_Ctx.RIPEMD160_Context);
Context_Finalize_Outer (HMAC_Ctx);
return Get_Auth (HMAC_Ctx);
end Authenticate;
end LSC.Internal.HMAC_RIPEMD160;
|
src/tests/bintoasc_suite.adb | jhumphry/Ada_BinToAsc | 0 | 24193 | <gh_stars>0
-- BinToAsc_Suite
-- Unit tests for BinToAsc
-- Copyright (c) 2015, <NAME> - see LICENSE file for details
with BinToAsc_Suite.Misc_Tests;
with BinToAsc_Suite.Base16_Tests;
with BinToAsc_Suite.Base32_Tests;
with BinToAsc_Suite.Base64_Tests;
with BinToAsc_Suite.Base85_Tests;
package body BinToAsc_Suite is
use AUnit.Test_Suites;
Result : aliased Test_Suite;
Test_Misc : aliased Misc_Tests.Misc_Test;
Test_Base16 : aliased Base16_Tests.Base16_Test;
Test_Base32 : aliased Base32_Tests.Base32_Test;
Test_Base64 : aliased Base64_Tests.Base64_Test;
Test_Base85 : aliased Base85_Tests.Base85_Test;
-----------
-- Suite --
-----------
function Suite return AUnit.Test_Suites.Access_Test_Suite is
begin
Add_Test (Result'Access, Test_Misc'Access);
Add_Test (Result'Access, Test_Base16'Access);
Add_Test (Result'Access, Test_Base32'Access);
Add_Test (Result'Access, Test_Base64'Access);
Add_Test (Result'Access, Test_Base85'Access);
return Result'Access;
end Suite;
end BinToAsc_Suite;
|
bvs/BvsGetMode.asm | osfree-project/FamilyAPI | 0 | 240530 | <reponame>osfree-project/FamilyAPI<filename>bvs/BvsGetMode.asm
;/*!
; @file
;
; @brief BvsGetMode DOS wrapper
;
; (c) osFree Project 2008-2022, <http://www.osFree.org>
; for licence see licence.txt in root directory, or project website
;
; This is Family API implementation for DOS, used with BIND tools
; to link required API
;
; @author <NAME> (<EMAIL>)
;
; * 0 NO_ERROR
; * 436 ERROR_VIO_INVALID_HANDLE
; * 438 ERROR_VIO_INVALID_LENGTH
; * 465 ERROR_VIO_DETACHED
; * 494 ERROR_VIO_EXTENDED_SG
;
;BIOS MODE TYPE COLOR COLS ROWS HRES VRES VALID ADAPTER/DISPLAY COMBINATIONS [EMULATED]
;0 5 4 40 25 320 200 [CGA/CD], CGA/Comp, [EGA/CD], [EGA/ECD], VGA/Mono, VGA/Color, VGA/Plasma
;0* 5 4 40 25 320 350 [EGA/ECD], VGA/Mono, VGA/Color, VGA/Plasma
;0+ 5 4 40 25 360 400 VGA/Mono, VGA/Color
;0# 5 4 40 25 320 400 VGA/Mono, VGA/Color, VGA/Plasma
;1 1 4 40 25 320 200 CGA/CD, CGA/Comp, EGA/CD, EGA/ECD, [VGA/Mono], VGA/Color, [VGA/Plasma]
;1* 1 4 40 25 320 350 EGA/ECD, [VGA/Mono], VGA/Color, [VGA/Plasma]
;1+ 1 4 40 25 360 400 [VGA/Mono], VGA/Color
;1# 1 4 40 25 320 400 [VGA/Mono], VGA/Color, [VGA/Plasma]
;2 5 4 80 25 640 200 [CGA/CD], CGA/Comp, [EGA/CD], [EGA/ECD], VGA/Mono, VGA/Color, VGA/Plasma
;2* 5 4 80 25 640 350 [EGA/ECD], VGA/Mono, VGA/Color, VGA/Plasma
;2+ 5 4 80 25 720 400 VGA/Mono, VGA/Color
;2# 5 4 80 25 640 400 VGA/Mono, VGA/Color, VGA/Plasma
;3 1 4 80 25 640 200 CGA/CD, CGA/Comp, EGA/CD, EGA/ECD, [VGA/Mono], VGA/Color, [VGA/Plasma]
;3* 1 4 80 25 640 350 EGA/ECD, [VGA/Mono], VGA/Color, [VGA/Plasma]
;3+ 1 4 80 25 720 400 [VGA/Mono], VGA/Color
;3# 1 4 80 25 640 400 [VGA/Mono], VGA/Color, [VGA/Plasma]
;7 0 0 80 25 720 350 MPA/MD, EGA/MD, VGA/Mono, VGA/Color
;7+ 0 0 80 25 720 400 VGA/Mono, VGA/Color
;7# 0 0 80 25 640 400 VGA/Mono, VGA/Color, VGA/Plasma
;n/a 0 0 80 25 640 350 VGA/Mono, VGA/Color, VGA/Plasma
;n/a 1 4 80 30 720 480 [VGA/Mono], VGA/Color
;n/a 1 4 80 30 640 480 [VGA/Mono], VGA/Color, [VGA/Plasma]
;4 3 2 [40] [25] 320 200 CGA/CD, CGA/Comp, EGA/CD, EGA/ECD, [VGA/Mono], VGA/Color,[VGA/Plasma]
;5 7 2 [40] [25] 320 200 [CGA/CD], CGA/Comp, [EGA/CD], [EGA/ECD], VGA/Mono, VGA/Color, VGA/Plasma
;6 3 1 [80] [25] 640 200 CGA/CD, CGA/Comp, EGA/CD, EGA/ECD, VGA/Mono, VGA/Color, VGA/Plasma
;D 3 4 [40] [25] 320 200 EGA/CD, EGA/ECD, [VGA/Mono], VGA/Color, [VGA/Plasma]
;E 3 4 [80] [25] 640 200 EGA/CD, EGA/ECD, [VGA/Mono], VGA/Color, [VGA/Plasma]
;F 2 0 [80] [25] 640 350 EGA/MD, VGA/Mono, VGA/Color, VGA/Plasma
;10 3 4 [80] [25] 640 350 EGA/ECD, [VGA/Mono], VGA/Color, [VGA/Plasma]
;11 3 1 [80] [30] 640 480 VGA/Mono, VGA/Color, VGA/Plasma
;12 3 4 [80] [30] 640 480 [VGA/Mono], VGA/Color, [VGA/Plasma]
;13 3 8 [40] [25] 320 200 [VGA/Mono], VGA/Color, [VGA/Plasma]
;n/a 11 8 [80] [30] 640 480 [8514A/Mono], 8514A/Color
;n/a 11 4 [80] [30] 640 480 [8514A/Mono], 8514A/Color
;n/a 11 8 [85] [38] 1024 768 [8514A/HMono], 8514A/HColor
;n/a 11 4 [85] [38] 1024 768 [8514A/HMono], 8514A/HColor
;
;*/
.8086
; Helpers
INCLUDE helpers.inc
INCLUDE bios.inc
INCL_SUB EQU 1
INCLUDE bseerr.inc
INCLUDE bsesub.inc
_TEXT SEGMENT BYTE PUBLIC 'CODE' USE16
@BVSPROLOG BVSGETMODE
VIOHANDLE DW ? ;Video handle
MODEINFO DD ? ;
@BVSSTART BVSGETMODE
EXTERN VIOCHECKHANDLE: PROC
MOV BX,[DS:BP].ARGS.VIOHANDLE ; GET HANDLE
CALL VIOCHECKHANDLE
JNZ EXIT
LDS SI, [DS:BP].ARGS.MODEINFO
MOV CX, [DS:SI].VIOMODEINFO.VIOMI_CB
CMP CX, 2
MOV AX, ERROR_VIO_INVALID_LENGTH
JBE EXIT
@GetMode
MOV BX, AX
; Frame buffer type
MOV AL,1
MOV [DS:SI].VIOMODEINFO.VIOMI_FBTYPE, AL ; TYPE: 1=TEXT MODE/3=GRAPH MODE
CMP CX, 3
JBE OK_EXIT
; Number of Colors
MOV AL,4
MOV [DS:SI].VIOMODEINFO.VIOMI_COLOR, AL ; COLOR: 16 COLORS
CMP CX, 4
JBE OK_EXIT
; Number of Columns
MOV AL, BH
XOR AH, AH
MOV [DS:SI].VIOMODEINFO.VIOMI_COL, AX ; Columns
CMP CX, 6
JBE OK_EXIT
; Number of Rows
MOV AX, 40H
MOV ES, AX
MOV AX, [ES:84H] ; Number of rows for EGA and higher
CMP AX, 0
JZ OK_ROWS
MOV AX, 24
OK_ROWS:
INC AX
MOV [DS:SI].VIOMODEINFO.VIOMI_ROW, AX ; Rows
CMP CX, 8
JBE OK_EXIT
; Hres
; Vres
; fmt_id
; attrib
; buf_addr
; buf_length
; full_length
; partail_length
; ext_data_addr
OK_EXIT:
XOR AX,AX
EXIT:
@BVSEPILOG BVSGETMODE
_TEXT ENDS
END
|
programs/oeis/124/A124669.asm | neoneye/loda | 22 | 11695 | ; A124669: Product of successive primes minus 2.
; 4,13,33,75,141,219,321,435,665,897,1145,1515,1761,2019,2489,3125,3597,4085,4755,5181,5765,6555,7385,8631,9795,10401,11019,11661,12315,14349,16635,17945,19041,20709,22497,23705,25589,27219,28889,30965,32397,34569,36861,38019,39201,41987,47051,50619,51981,53355,55685,57597,60489,64505,67589,70745,72897,75065,77835,79521,82917,89949,95475,97341,99219,104925,111545,116937,121101,123195,126725,131751,136889,141365,145155,148985,154431,159195,164007,171369,176397,181449,186621,190085,194475,198905,205191,210675,213441,216219,223691,233271,239115,245007,250995,256025,265187,272481,282941,295925
seq $0,69486 ; 2*prime(n)*prime(n+1).
div $0,2
sub $0,2
|
oeis/206/A206152.asm | neoneye/loda-programs | 11 | 2471 | ; A206152: a(n) = Sum_{k=0..n} binomial(n,k)^(n+k).
; Submitted by <NAME>
; 1,2,10,326,64066,111968752,1091576358244,106664423412770932,67305628532703785062402,329378455047908259704557301276,15577435010841058543979449475481629020,4149966977623235242137197627437116176363522092,12927439532847513402949412641352795950115009477687570500,249723831508847726795453130350170214154325515539979167150068476692,40839849247692121843977555182875241602253392984875861222042156936609686431880,65871250613616876728222467339782847609868642203332992021973986492987719520870713230895096
mov $3,$0
lpb $0
lpb $3
mov $2,$0
add $0,$3
bin $2,$3
pow $2,$0
sub $0,$3
add $1,$2
sub $3,1
lpe
div $0,59
lpe
mov $0,$1
add $0,1
|
tools-src/gnu/gcc/gcc/ada/s-io.ads | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 8961 | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M _ I O --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- A simple text I/O package, used for diagnostic output in the runtime,
-- This package is also preelaborated, unlike Text_Io, and can thus be
-- with'ed by preelaborated library units. It includes only Put routines
-- for character, integer, string and a new line function
package System.IO is
pragma Preelaborate (IO);
procedure Put (X : Integer);
procedure Put (C : Character);
procedure Put (S : String);
procedure Put_Line (S : String);
procedure New_Line (Spacing : Positive := 1);
end System.IO;
|
code/include/common.asm | sttng/merken-revision-2020 | 0 | 173047 | <gh_stars>0
if !def(_COMMON_)
_COMMON_ equ 1
; ======================
; STATES
; ======================
STATE_FADE_IN equ $00
STATE_RUN_FX equ $01
STATE_FADE_OUT equ $02
STATE_END_FX equ $03
STATE_WAIT_LOAD equ $04
; ======================
STACK_TOP equ $FFFE
; ======================
; CARILLON
; ======================
Player_Initialize equ $4000
Player_MusicStart equ $4003
Player_MusicStop equ $4006
Player_SongSelect equ $400c
Player_MusicUpdate equ $4100
MusicBank equ 1
SongNumber equ 0 ; 0 - 7
mResetVars: macro
xor a
ld [SCX],a
ld [SCY],a
ld [fx_counter], a
ld [fx_counter+1], a
ld [should_load_data], a
ld [load_step], a
ld [should_play_music], a
endm
mResetLoader: macro
xor a
ld a, [should_load_data]
ld a, [load_step]
endm
; 1 = Source
; 2 = Destination
; 3 = Size
; 4 = On Complete
mLoadDataIn4Frames: macro
ld a, [should_load_data]
cp $01
jr nz, .__dont_load_data__\@
.__load_data__\@:
ld a, [load_step]
cp $00
jr z, .__load_step0__\@
cp $01
jr z, .__load_step1__\@
cp $02
jr z, .__load_step2__\@
cp $03
jr z, .__load_step3__\@
STEP_COUNT\@ equ 4
.__load_step0__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*0, \2 +(\3/STEP_COUNT\@)*0, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
.__load_step1__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*1, \2 +(\3/STEP_COUNT\@)*1, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
.__load_step2__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*2, \2 +(\3/STEP_COUNT\@)*2, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
.__load_step3__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*3, \2 +(\3/STEP_COUNT\@)*3, (\3/STEP_COUNT\@)
xor a
ld [should_load_data], a
call \4
.__inc_load_step__\@:
ld a, [load_step]
inc a
ld [load_step], a
.__dont_load_data__\@:
endm
; 1 = Source
; 2 = Destination
; 3 = Size
; 4 = On Complete
mLoadDataIn5Frames: macro
ld a, [should_load_data]
cp $01
jr nz, .__dont_load_data__\@
.__load_data__\@:
ld a, [load_step]
cp $00
jr z, .__load_step0__\@
cp $01
jr z, .__load_step1__\@
cp $02
jr z, .__load_step2__\@
cp $03
jr z, .__load_step3__\@
cp $04
jr z, .__load_step4__\@
STEP_COUNT\@ equ 5
STEP = 0
.__load_step0__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step1__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step2__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step3__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step4__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
xor a
ld [should_load_data], a
call \4
.__inc_load_step__\@:
ld a, [load_step]
inc a
ld [load_step], a
.__dont_load_data__\@:
endm
; 1 = Source
; 2 = Destination
; 3 = Size
; 4 = On Complete
mLoadDataIn6Frames: macro
ld a, [should_load_data]
cp $01
jr nz, .__dont_load_data__\@
.__load_data__\@:
ld a, [load_step]
cp $00
jr z, .__load_step0__\@
cp $01
jr z, .__load_step1__\@
cp $02
jr z, .__load_step2__\@
cp $03
jr z, .__load_step3__\@
cp $04
jr z, .__load_step4__\@
cp $05
jr z, .__load_step5__\@
STEP_COUNT\@ equ 6
STEP = 0
.__load_step0__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step1__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step2__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step3__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step4__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step5__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
xor a
ld [should_load_data], a
call \4
.__inc_load_step__\@:
ld a, [load_step]
inc a
ld [load_step], a
.__dont_load_data__\@:
endm
; 1 = Source
; 2 = Destination
; 3 = Size
; 4 = On Complete
mLoadDataIn8Frames: macro
ld a, [should_load_data]
cp $01
jp nz, .__dont_load_data__\@
.__load_data__\@:
ld a, [load_step]
cp $00
jr z, .__load_step0__\@
cp $01
jr z, .__load_step1__\@
cp $02
jr z, .__load_step2__\@
cp $03
jr z, .__load_step3__\@
cp $04
jr z, .__load_step4__\@
cp $05
jr z, .__load_step5__\@
cp $06
jr z, .__load_step6__\@
cp $07
jr z, .__load_step7__\@
STEP_COUNT\@ equ 8
STEP = 0
.__load_step0__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step1__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step2__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step3__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step4__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step5__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step6__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step7__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
xor a
ld [should_load_data], a
call \4
.__inc_load_step__\@:
ld a, [load_step]
inc a
ld [load_step], a
.__dont_load_data__\@:
endm
; 1 = Source
; 2 = Destination
; 3 = Size
; 4 = On Complete
mLoadDataIn16Frames: macro
ld a, [should_load_data]
cp $01
jp nz, .__dont_load_data__\@
.__load_data__\@:
ld a, [load_step]
cp $00
jp z, .__load_step0__\@
cp $01
jp z, .__load_step1__\@
cp $02
jp z, .__load_step2__\@
cp $03
jp z, .__load_step3__\@
cp $04
jp z, .__load_step4__\@
cp $05
jp z, .__load_step5__\@
cp $06
jp z, .__load_step6__\@
cp $07
jp z, .__load_step7__\@
cp $08
jp z, .__load_step8__\@
cp $09
jp z, .__load_step9__\@
cp $0A
jp z, .__load_step10__\@
cp $0B
jp z, .__load_step11__\@
cp $0C
jp z, .__load_step12__\@
cp $0D
jp z, .__load_step13__\@
cp $0E
jp z, .__load_step14__\@
cp $0F
jp z, .__load_step15__\@
STEP_COUNT\@ equ 16
STEP = 0
.__load_step0__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step1__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step2__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step3__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step4__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step5__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step6__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step7__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step8__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step9__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step10__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step11__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step12__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step13__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step14__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step15__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
xor a
ld [should_load_data], a
call \4
.__inc_load_step__\@:
ld a, [load_step]
inc a
ld [load_step], a
.__dont_load_data__\@:
endm
; 1 = Source
; 2 = Destination
; 3 = Size
; 4 = On Complete
mLoadDataIn32Frames: macro
ld a, [should_load_data]
cp $01
jp nz, .__dont_load_data__\@
.__load_data__\@:
ld a, [load_step]
cp 0
jp z, .__load_step0__\@
cp 1
jp z, .__load_step1__\@
cp 2
jp z, .__load_step2__\@
cp 3
jp z, .__load_step3__\@
cp 4
jp z, .__load_step4__\@
cp 5
jp z, .__load_step5__\@
cp 6
jp z, .__load_step6__\@
cp 7
jp z, .__load_step7__\@
cp 8
jp z, .__load_step8__\@
cp 9
jp z, .__load_step9__\@
cp 10
jp z, .__load_step10__\@
cp 11
jp z, .__load_step11__\@
cp 12
jp z, .__load_step12__\@
cp 13
jp z, .__load_step13__\@
cp 14
jp z, .__load_step14__\@
cp 15
jp z, .__load_step15__\@
cp 16
jp z, .__load_step16__\@
cp 17
jp z, .__load_step17__\@
cp 18
jp z, .__load_step18__\@
cp 19
jp z, .__load_step19__\@
cp 20
jp z, .__load_step20__\@
cp 21
jp z, .__load_step21__\@
cp 22
jp z, .__load_step22__\@
cp 23
jp z, .__load_step23__\@
cp 24
jp z, .__load_step24__\@
cp 25
jp z, .__load_step25__\@
cp 26
jp z, .__load_step26__\@
cp 27
jp z, .__load_step27__\@
cp 28
jp z, .__load_step28__\@
cp 29
jp z, .__load_step29__\@
cp 30
jp z, .__load_step30__\@
cp 31
jp z, .__load_step31__\@
STEP_COUNT\@ equ 32
STEP = 0
.__load_step0__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step1__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step2__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step3__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step4__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step5__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step6__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step7__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step8__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step9__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step10__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step11__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step12__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step13__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step14__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step15__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step16__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step17__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step18__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step19__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step20__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step21__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step22__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step23__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step24__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step25__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step26__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step27__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step28__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step29__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step30__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step31__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
xor a
ld [should_load_data], a
call \4
.__inc_load_step__\@:
ld a, [load_step]
inc a
ld [load_step], a
.__dont_load_data__\@:
endm
; 1 = Source
; 2 = Destination
; 3 = Size
; 4 = On Complete
mLoadDataIn89Frames: macro
ld a, [should_load_data]
cp $01
jp nz, .__dont_load_data__\@
.__load_data__\@:
ld a, [load_step]
cp 0
jp z, .__load_step0__\@
cp 1
jp z, .__load_step1__\@
cp 2
jp z, .__load_step2__\@
cp 3
jp z, .__load_step3__\@
cp 4
jp z, .__load_step4__\@
cp 5
jp z, .__load_step5__\@
cp 6
jp z, .__load_step6__\@
cp 7
jp z, .__load_step7__\@
cp 8
jp z, .__load_step8__\@
cp 9
jp z, .__load_step9__\@
cp 10
jp z, .__load_step10__\@
cp 11
jp z, .__load_step11__\@
cp 12
jp z, .__load_step12__\@
cp 13
jp z, .__load_step13__\@
cp 14
jp z, .__load_step14__\@
cp 15
jp z, .__load_step15__\@
cp 16
jp z, .__load_step16__\@
cp 17
jp z, .__load_step17__\@
cp 18
jp z, .__load_step18__\@
cp 19
jp z, .__load_step19__\@
cp 20
jp z, .__load_step20__\@
cp 21
jp z, .__load_step21__\@
cp 22
jp z, .__load_step22__\@
cp 23
jp z, .__load_step23__\@
cp 24
jp z, .__load_step24__\@
cp 25
jp z, .__load_step25__\@
cp 26
jp z, .__load_step26__\@
cp 27
jp z, .__load_step27__\@
cp 28
jp z, .__load_step28__\@
cp 29
jp z, .__load_step29__\@
cp 30
jp z, .__load_step30__\@
cp 31
jp z, .__load_step31__\@
cp 32
jp z, .__load_step32__\@
cp 33
jp z, .__load_step33__\@
cp 34
jp z, .__load_step34__\@
cp 35
jp z, .__load_step35__\@
cp 36
jp z, .__load_step36__\@
cp 37
jp z, .__load_step37__\@
cp 38
jp z, .__load_step38__\@
cp 39
jp z, .__load_step39__\@
cp 40
jp z, .__load_step40__\@
cp 41
jp z, .__load_step41__\@
cp 42
jp z, .__load_step42__\@
cp 43
jp z, .__load_step43__\@
cp 44
jp z, .__load_step44__\@
cp 45
jp z, .__load_step45__\@
cp 46
jp z, .__load_step46__\@
cp 47
jp z, .__load_step47__\@
cp 48
jp z, .__load_step48__\@
cp 49
jp z, .__load_step49__\@
cp 50
jp z, .__load_step50__\@
cp 51
jp z, .__load_step51__\@
cp 52
jp z, .__load_step52__\@
cp 53
jp z, .__load_step53__\@
cp 54
jp z, .__load_step54__\@
cp 55
jp z, .__load_step55__\@
cp 56
jp z, .__load_step56__\@
cp 57
jp z, .__load_step57__\@
cp 58
jp z, .__load_step58__\@
cp 59
jp z, .__load_step59__\@
cp 60
jp z, .__load_step60__\@
cp 61
jp z, .__load_step61__\@
cp 62
jp z, .__load_step62__\@
cp 63
jp z, .__load_step63__\@
cp 64
jp z, .__load_step64__\@
cp 65
jp z, .__load_step65__\@
cp 66
jp z, .__load_step66__\@
cp 67
jp z, .__load_step67__\@
cp 68
jp z, .__load_step68__\@
cp 69
jp z, .__load_step69__\@
cp 70
jp z, .__load_step70__\@
cp 71
jp z, .__load_step71__\@
cp 72
jp z, .__load_step72__\@
cp 73
jp z, .__load_step73__\@
cp 74
jp z, .__load_step74__\@
cp 75
jp z, .__load_step75__\@
cp 76
jp z, .__load_step76__\@
cp 77
jp z, .__load_step77__\@
cp 78
jp z, .__load_step78__\@
cp 79
jp z, .__load_step79__\@
cp 80
jp z, .__load_step80__\@
cp 81
jp z, .__load_step81__\@
cp 82
jp z, .__load_step82__\@
cp 83
jp z, .__load_step83__\@
cp 84
jp z, .__load_step84__\@
cp 85
jp z, .__load_step85__\@
cp 86
jp z, .__load_step86__\@
cp 87
jp z, .__load_step87__\@
cp 88
jp z, .__load_step88__\@
STEP_COUNT\@ equ 89
STEP = 0
.__load_step0__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step1__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step2__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step3__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step4__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step5__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step6__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step7__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step8__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step9__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step10__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step11__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step12__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step13__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step14__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step15__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step16__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step17__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step18__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step19__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step20__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step21__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step22__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step23__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step24__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step25__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step26__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step27__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step28__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step29__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step30__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step31__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step32__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step33__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step34__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step35__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step36__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step37__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step38__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step39__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step40__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step41__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step42__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step43__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step44__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step45__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step46__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step47__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step48__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step49__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step50__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step51__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step52__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step53__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step54__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step55__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step56__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step57__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step58__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step59__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step60__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step61__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step62__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step63__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step64__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step65__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step66__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step67__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step68__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step69__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step70__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step71__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step72__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step73__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step74__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step75__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step76__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step77__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step78__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step79__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step80__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step81__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step82__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step83__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step84__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step85__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step86__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step87__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step88__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
xor a
ld [should_load_data], a
call \4
.__inc_load_step__\@:
ld a, [load_step]
inc a
ld [load_step], a
.__dont_load_data__\@:
endm
; 1 = Source
; 2 = Destination
; 3 = Size
; 4 = On Complete
mLoadDataIn16FramesWithBubbles: macro
ld a, [should_load_data]
cp $01
jp nz, .__dont_load_data__\@
BUBBLE\@ equ 5
.__load_data__\@:
ld a, [load_step]
cp $00+BUBBLE\@
jp z, .__load_step0__\@
cp $01+BUBBLE\@
jp z, .__load_step1__\@
cp $02+BUBBLE\@
jp z, .__load_step2__\@
cp $03+BUBBLE\@
jp z, .__load_step3__\@
cp $04+BUBBLE\@
jp z, .__load_step4__\@
cp $05+BUBBLE\@
jp z, .__load_step5__\@
cp $06+BUBBLE\@
jp z, .__load_step6__\@
cp $07+BUBBLE\@
jp z, .__load_step7__\@
cp $08+BUBBLE\@
jp z, .__load_step8__\@
cp $09+BUBBLE\@
jp z, .__load_step9__\@
cp $0A+BUBBLE\@
jp z, .__load_step10__\@
cp $0B+BUBBLE\@
jp z, .__load_step11__\@
cp $0C+BUBBLE\@
jp z, .__load_step12__\@
cp $0D+BUBBLE\@
jp z, .__load_step13__\@
cp $0E+BUBBLE\@
jp z, .__load_step14__\@
cp $0F+BUBBLE\@
jp z, .__load_step15__\@
jp .__inc_load_step__\@
STEP_COUNT\@ equ 16
STEP = 0
.__load_step0__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step1__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step2__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step3__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step4__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step5__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step6__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jp .__inc_load_step__\@
STEP = STEP + 1
.__load_step7__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step8__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step9__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step10__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step11__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step12__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step13__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step14__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
jr .__inc_load_step__\@
STEP = STEP + 1
.__load_step15__\@:
mSafeVRAMMemcpy \1+(\3/STEP_COUNT\@)*STEP, \2 +(\3/STEP_COUNT\@)*STEP, (\3/STEP_COUNT\@)
xor a
ld [should_load_data], a
call \4
.__inc_load_step__\@:
ld a, [load_step]
inc a
ld [load_step], a
.__dont_load_data__\@:
endm
mInitializeMusic: macro
ld a, MusicBank
ld [ROMB0], a
call Player_Initialize
endm
mSelectSong: macro
ld a, \1
call Player_SongSelect
endm
mStartMusic: macro
ld a, MusicBank
ld [ROMB0], a
call Player_MusicStart
endm
mStopMusic: macro
ld a, MusicBank
ld [ROMB0], a
call Player_MusicStop
endm
mSetROMBank: macro
ld a, \1
ld [ROMB0], a
endm
mUpdateMusic: macro
ld a,MusicBank
ld [ROMB0],a
call Player_MusicUpdate
endm
mUpdateMusicWaitVBlank: macro
mUpdateMusic
mWaitVBlank
endm
mSaveRegisters: macro
push af
push hl
push de
push bc
endm
mRestoreRegisters: macro
pop bc
pop de
pop hl
pop af
endm
mEnableVBlank: macro
ld a, [INT_ENABLE]
= 0, a
ld [INT_ENABLE], a
endm
mDisableVBlank: macro
ld a, [INT_ENABLE]
res 0, a
ld [INT_ENABLE], a
endm
; Arg 1 = Source
; Arg 2 = Destination
; Arg 3 = Size
mMemcpy: macro
ld de, \1
ld hl, \2
ld bc, \3
call unsafe_memcpy
endm
; Arg 1 = Source
; Arg 2 = Destination
; Arg 3 = Size
mSafeVRAMMemcpy: macro
ld de, \1
ld hl, \2
ld bc, \3
call safe_vram_memcpy
endm
; Arg 1 = Source
; Arg 2 = Destination
; Arg 3 = Size
mSafeVRAMMemcpyMusic: macro
call Player_MusicUpdate
ld de, \1
ld hl, \2
ld bc, \3
call safe_vram_memcpy
endm
; Arg 1 = Value
; Arg 2 = Destination
; Arg 3 = Size
mSafeVRAMMemset: macro
ld e, \1
ld hl, \2
ld bc, \3
call safe_vram_memset
endm
mIfEqualJp: macro
cp \1
jp z, \2
endm
mIfNotEqualJp: macro
cp \1
jp nz, \2
endm
mIfEqualOrGreaterThanJp: macro
cp \1
jp nc, \2
endm
mIfLowerThanJp: macro
cp \1
jp c, \2
endm
mWaitVBlank: macro
.loop\@:
ld a, [LY]
cp $90
jr nz, .loop\@
endm
mResetFadeVariables: macro
xor a
ld [fade_in_offset], a
ld [fade_out_offset], a
endm
mSetStates: macro
mResetFadeVariables
ld a, \1
ld [current_state], a
ld a, \2
ld [next_state], a
endm
mWaitForState: macro
.loop\@:
ld a, [current_state]
cp \1
jr nz, .loop\@
endm
mWaitForStateAndFade: macro
ld a, [fade_color]
ld [BGP], a
ld a, [current_state]
cp \1
;jr nz, $F5 ; <- apparently RGBDS doesn't like this
db $20, $F5
endm
mSetNextState: macro
ld a, \1
ld [next_state], a
endm
mDefineFadeLogic: macro
ld a,[current_state]
cp STATE_FADE_IN
jr z,.fade_in
cp STATE_FADE_OUT
jr z,.fade_out
jr .end_fade_logic
.fade_in
ld a,[fade_in_offset]
inc a
cp LOW(fade_in_table_end)
jr nz,.store_fade_in
ld a, [next_state]
ld [current_state],a
jr .end_fade_logic
.fade_out
ld a,[fade_out_offset]
inc a
cp LOW(fade_out_table_end)
jr nz,.store_fade_out
ld a, [next_state]
ld [current_state],a
jr .end_fade_logic
.store_fade_in:
ld [fade_in_offset],a
ld l, a
ld h, HIGH(fade_in_table)
ld a, [hl]
ld [fade_color], a
jr .end_fade_logic
.store_fade_out:
ld [fade_out_offset],a
ld l, a
ld h, HIGH(fade_out_table)
ld a, [hl]
ld [fade_color], a
.end_fade_logic:
endm
mDefineFadeLogicDirectBGP: macro
ld a,[current_state]
cp STATE_FADE_IN
jr z,.fade_in
cp STATE_FADE_OUT
jr z,.fade_out
jr .end_fade_logic
.fade_in
ld a,[fade_in_offset]
inc a
cp LOW(fade_in_table_end)
jr nz,.store_fade_in
ld a, [next_state]
ld [current_state],a
jr .end_fade_logic
.fade_out
ld a,[fade_out_offset]
inc a
cp LOW(fade_out_table_end)
jr nz,.store_fade_out
ld a, [next_state]
ld [current_state],a
jr .end_fade_logic
.store_fade_in:
ld [fade_in_offset],a
ld l, a
ld h, HIGH(fade_in_table)
ld a, [hl]
ld [BGP], a
jr .end_fade_logic
.store_fade_out:
ld [fade_out_offset],a
ld l, a
ld h, HIGH(fade_out_table)
ld a, [hl]
ld [BGP], a
.end_fade_logic:
endm
; 1 = Fade In Table Start
; 2 = Fade In Table End
; 3 = Fade Out Table Start
; 4 = Fade Out Table End
mDefineFadeLogicWithTables: macro
ld a,[current_state]
cp STATE_FADE_IN
jr z,.fade_in\@
cp STATE_FADE_OUT
jr z,.fade_out\@
jr .end_fade_logic\@
.fade_in\@
ld a,[fade_in_offset]
inc a
cp LOW(\2)
jr nz,.store_fade_in\@
ld a, [next_state]
ld [current_state],a
jr .end_fade_logic\@
.fade_out\@
ld a,[fade_out_offset]
inc a
cp LOW(\4)
jr nz,.store_fade_out\@
ld a, [next_state]
ld [current_state],a
jr .end_fade_logic\@
.store_fade_in\@:
ld [fade_in_offset],a
ld l, a
ld h, HIGH(\1)
ld a, [hl]
ld [fade_color], a
jr .end_fade_logic\@
.store_fade_out\@:
ld [fade_out_offset],a
ld l, a
ld h, HIGH(\3)
ld a, [hl]
ld [fade_color], a
.end_fade_logic\@:
endm
mEnableLoading: macro
ld a, 1
ld [should_load_data], a
endm
mDisableLoading: macro
ld a, 0
ld [should_load_data], a
endm
mUpdateBackground: macro
ld a, [fade_color]
ld [BGP], a
ld [OBJP0], a
endm
mJumpCheckEnding: macro
ld a, [current_state]
cp STATE_END_FX
ret z
jp \1
endm
mLoadIn8SongUpdatesBANK: macro
SIZE\@ equ (\3/ 8)
STEP\@ = 0
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
endm
mLoadIn6SongUpdatesBANK: macro
SIZE\@ equ (\3/ 6)
STEP\@ = 0
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
endm
mLoadIn4SongUpdatesBANK: macro
SIZE\@ equ (\3/ 4)
STEP\@ = 0
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank \4
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
endm
mLoadIn2SongUpdatesBANK2: macro
SIZE\@ equ (\3/ 2)
STEP\@ = 0
mSetROMBank 2
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
mSetROMBank 2
mSafeVRAMMemcpy \1+SIZE\@*STEP\@, \2+SIZE\@*STEP\@, SIZE\@
mUpdateMusic
STEP\@ = STEP\@+1
endm
endc |
agda/Esterel/Variable/Sequential.agda | florence/esterel-calculus | 3 | 3017 | <gh_stars>1-10
module Esterel.Variable.Sequential where
open import Data.Nat
using (ℕ) renaming (_≟_ to _≟ℕ_)
open import Function
using (_∘_)
open import Relation.Nullary
using (Dec ; yes ; no ; ¬_)
open import Relation.Binary
using (Decidable)
open import Relation.Binary.PropositionalEquality
using (_≡_ ; refl ; cong ; trans ; sym)
data SeqVar : Set where
_ᵥ : ℕ → SeqVar
unwrap : SeqVar → ℕ
unwrap (n ᵥ) = n
unwrap-inverse : ∀ {s} → (unwrap s) ᵥ ≡ s
unwrap-inverse {_ ᵥ} = refl
unwrap-injective : ∀ {s t} → unwrap s ≡ unwrap t → s ≡ t
unwrap-injective s'≡t' = trans (sym unwrap-inverse) (trans (cong _ᵥ s'≡t') unwrap-inverse)
-- for backward compatibility
unwrap-neq : ∀{k1 : SeqVar} → ∀{k2 : SeqVar} → ¬ k1 ≡ k2 → ¬ (unwrap k1) ≡ (unwrap k2)
unwrap-neq = (_∘ unwrap-injective)
wrap : ℕ → SeqVar
wrap = _ᵥ
bijective : ∀{x} → unwrap (wrap x) ≡ x
bijective = refl
_≟_ : Decidable {A = SeqVar} _≡_
(s ᵥ) ≟ (t ᵥ) with s ≟ℕ t
... | yes p = yes (cong _ᵥ p)
... | no ¬p = no (¬p ∘ cong unwrap)
|
zad1_3.asm | tomwisniewskiprv/ASM | 1 | 160892 | <gh_stars>1-10
;worksheet 1
;exercise 3
segment code
assume cs: code
main:
mov bx , 00h ; space counter
mov cx , 03h ; line counter
next_line:
push cx ; remeber how many lines left
mov cx , bx ; is it first line ?
cmp cx , 0
je first_space
next_space:
mov dl , 20h ; ascii space
int 21h
dec cx
jnz next_space
first_space:
mov cx , 0ah ; char counter
mov dl , 41h ; ascii value to display
next_char: ; displays next char
mov ah , 02h
int 21h
inc dl ; next ascii value
dec cx ; one less char to display
jnz next_char
; endline
mov dl , 0ah ; CR
int 21h
mov dl , 0dh ; LF
int 21h
add bx , 02h ; add two spaces
pop cx
dec cx ; how many lines left ?
cmp cx , 0
jnz next_line
exit:
mov ah, 4ch
int 21h
ends code ;end of code segment
end main ;end of program and starting point
|
Addition.asm | Naretto95/AsmProject-Polymorphism | 0 | 81221 | <gh_stars>0
section .text
global _start
_start:
mov r12,0x4 ; 4 -> r12
add r12,0x4 ; r12 += 4
add r12,0x30 ; r12 en ascii
push r12 ; on envoie r12
mov rax,0x1 ; on prepare le syscall
mov rdi,0x1
mov rsi,rsp ; on pointe vers le haut de la pile
mov rdx,0x1
syscall
mov rcx, 0x0A ; \n
push rcx ; on le push
mov rsi, rsp ; on pointe vers le haut de la pile
syscall
mov rax,60
mov rdi,0
syscall
|
src/main.adb | kevinrosalesdev/MathArray-FormalVerification | 2 | 20469 | with MathArray; use MathArray;
with Ada.Text_IO; use Ada.Text_IO;
with Test_Assertions; use Test_Assertions;
with Ada.Assertions; use Ada.Assertions;
with Ada.Float_Text_IO;
use Ada.Float_Text_IO;
with Ada.Numerics.Elementary_Functions;
procedure Main is
procedure Test_midpoint is
Msg :constant String:="Test_midpoint";
point1:vec :=(0,0,0);
point2:vec :=(2,2,2);
point3:vec:=(0,0);
point4:vec:=(2,2);
res:vec:=(0,0,0);
res2:vec:=(0,0);
begin
res:=midpoint(point1,point2);
Assert_True(res=(1,1,1),Msg & " with point 0,0,0 and point 2,2,2");
point1:=(4,2,3);
point2:=(2,4,3);
res:=midpoint(point1,point2);
Assert_True(res=(3,3,3),Msg & " with point 4,2,3 and point 2,4,3");
point1:=(3,1,0);
point2:=(2,4,3);
res:=midpoint(point1,point2);
Assert_True(res=(2,2,1),Msg & " with point 3,1,0 and point 2,4,3");
point1:=(-4,2,-3);
point2:=(2,-4,3);
res:=midpoint(point1,point2);
Assert_True(res=(-1,-1,0),Msg & " with point -4,2,-3 and point 2,-4,3");
point1:=(-4,2,3);
point2:=(-2,-4,3);
res:=midpoint(point1,point2);
Assert_True(res=(-3,-1,3),Msg & " with point -4,2,3 and point -2,-4,3");
res2:=midpoint(point3,point4);
Assert_True(res2=(1,1),Msg & " with point 0,0 and point 2,2");
point3:=(4,2);
point4:=(2,4);
res2:=midpoint(point3,point4);
Assert_True(res2=(3,3),Msg & " with point 4,2 and point 2,4");
point3:=(-4,2);
point4:=(2,-4);
res2:=midpoint(point3,point4);
Assert_True(res2=(-1,-1),Msg & " with point -4,2 and point 2,-4");
point3:=(-4,2);
point4:=(-2,4);
res2:=midpoint(point3,point4);
Assert_True(res2=(-3,3),Msg & " with point -4,2 and point -2,4");
point3:=(-3,2);
point4:=(-2,7);
res2:=midpoint(point3,point4);
Assert_True(res2=(-2,4),Msg & " with point -3,2 and point -2,7");
exception
when Assertion_Error =>
Put_Line (Msg & " Failed (assertion)");
when others =>
Put_Line (Msg & " Failed (exception)");
end Test_midpoint;
procedure Test_module is
Msg : constant String := "Test_module";
vec1:vecFloat:=(0.0,0.0);
vec2:vecFloat:=(0.0,0.0,0.0);
res:Float:=0.0;
begin
module(vec1,res);
Assert_True(res=0.0,Msg & " with vec 0.0,0.0");
vec1:=(1.0,0.0);
module(vec1,res);
Assert_True(res=1.0,Msg & " with vec 1.0,0.0");
vec1:=(0.0,1.0);
module(vec1,res);
Assert_True(res=1.0,Msg & " with vec 0.0,1.0");
vec1:=(3.0,-4.0);
module(vec1,res);
Assert_True(res=5.0,Msg & " with vec 3.0,-4.0");
vec1:=(1.1,-1.1);
module(vec1,res);
Assert_True(res=Ada.Numerics.Elementary_Functions.Sqrt((vec1(Vec1'First)**2)+(vec1(vec1'last)**2)),Msg & " with vec 1.1,-1.1");
vec1:=(1.0,-4.0);
module(vec1,res);
Assert_True(res=Ada.Numerics.Elementary_Functions.Sqrt((vec1(Vec1'First)**2)+(vec1(vec1'last)**2)),Msg & " with vec 1.0,-4.0");
vec1:=(3.0,-10.0);
module(vec1,res);
Assert_True(res=Ada.Numerics.Elementary_Functions.Sqrt((vec1(Vec1'First)**2)+(vec1(vec1'last)**2)),Msg & " with vec 3.0,-10.0");
vec1:=(3.2,0.0);
module(vec1,res);
Assert_True(res=3.2,Msg & " with vec 3.2,0.0");
module(vec2,res);
Assert_True(res=0.0,Msg & " with vec 0.0,0.0,0.0");
vec2:=(1.0,0.0,0.0);
module(vec2,res);
Assert_True(res=1.0,Msg & " with vec 1.0,0.0,0.0");
vec2:=(4.0,3.0,0.0);
module(vec2,res);
Assert_True(res=5.0,Msg & " with vec 4.0,3.0,0.0");
vec2:=(-4.0,-3.0,0.0);
module(vec2,res);
Assert_True(res=5.0,Msg & " with vec -4.0,-3.0,0.0");
vec2:=(-1.0,-2.0,2.0);
module(vec2,res);
Assert_True(res=3.0,Msg & " with vec -1.0,-2.0,2.0");
vec2:=(0.0,-2.1,0.0);
module(vec2,res);
Assert_True(res=2.1,Msg & " with vec 0.0,-2.1,0.0");
vec2:=(-1.6,-2.04,2.6);
module(vec2,res);
Assert_True(res=Ada.Numerics.Elementary_Functions.Sqrt((vec2(Vec2'First)**2)+(vec2(Vec2'First+1)**2)+(vec2(vec2'last)**2)),Msg & " with vec -1.6,-2.04,2.6");
vec2:=(31.0,-8.0,6.5);
module(vec2,res);
Assert_True(res=Ada.Numerics.Elementary_Functions.Sqrt((vec2(Vec2'First)**2)+(vec2(Vec2'First+1)**2)+(vec2(vec2'last)**2)),Msg & " with vec 31.0,-8.0,6.5");
vec2:=(-123.4,7.00154,12.887);
module(vec2,res);
Assert_True(res=Ada.Numerics.Elementary_Functions.Sqrt((vec2(Vec2'First)**2)+(vec2(Vec2'First+1)**2)+(vec2(vec2'last)**2)),Msg & " with vec -123.4,7.00154,12.887");
exception
when Assertion_Error =>
Put_Line (Msg & " Failed (assertion)");
when others =>
Put_Line (Msg & " Failed (exception)");
end Test_module;
procedure Test_get is
Msg : constant String := "Test_get";
bool:Boolean;
vec1:vec(1..5);
vec2:vec(1..2);
v0:vec(1..1);
begin
vec1:=(1,2,3,4,5);
vec2:=(-4,-1);
get(vec1,3,bool);
Assert_True (bool and then vec1(3)=0, Msg & " get successfully in the middle");
vec1:=(1,2,3,4,5);
get(vec1,1,bool);
Assert_True (bool and then vec1(1)=0, Msg & " get successfully in the First element");
vec1:=(1,2,3,4,5);
get(vec1,5,bool);
Assert_True (bool and then vec1(5)=0, Msg & " get successfully in the last element");
vec1:=(1,2,3,4,5);
get(vec1,10,bool);
Assert_True (bool = False, Msg & " get fail");
vec1:=(1,2,3,4,5);
get(vec1,2,bool);
Assert_True (bool and then vec1(2)=0, Msg & " get successfully");
get(vec2,4,bool);
Assert_True (bool = False, Msg & " get fail with two elements");
vec2:=(-4,-1);
get(vec2,-4,bool);
Assert_True (bool and then vec2(1)=0, Msg & " get successfully with two elements");
vec1:=(4,4,4,4,4);
get(vec1,4,bool);
Assert_True(bool and then vec1(1)=0 and then (for all i in vec1'First+1 .. vec1'Last => vec1(i)=4 ), Msg & " get succesfully with the same element");
vec1:=(0,4,4,4,4);
get(vec1,4,bool);
Assert_True (bool and then vec1(2)=0, Msg & " get successfully with zero");
v0:=(v0'First => 2);
get(v0,2,bool);
Assert_True (bool and then v0(1)=0, Msg & " get successfully with one element");
v0:=(v0'First => 2);
get(v0,10,bool);
Assert_True (bool=False and then v0(1)=2, Msg & " get successfully with one element");
exception
when Assertion_Error =>
Put_Line (Msg & " Failed (assertion)");
when others =>
Put_Line (Msg & " Failed (exception)");
end Test_get;
procedure Test_perpendicular_vec is
Msg : constant String := "Test_perpendicular_vec";
v0 : vec(1..2);
v1 : vec(1..2);
begin
v0 := (2,4); v1 := (3,-7);
Assert_True (perpendicular_vec(v0,v1)=False , Msg & "not perpendicular (2,4),(3,-7)");
v0 := (6,4); v1 := (-6, 9);
Assert_True (perpendicular_vec(v0,v1), Msg & " perpendicular (6,4),(-6,9)");
v0 := (0,4); v1 := (-6, 0);
Assert_True (perpendicular_vec(v0,v1), Msg & " perpendicular (0,4),(-6,0)");
v0 := (0,0); v1 := (0, 0);
Assert_True (perpendicular_vec(v0,v1), Msg & " perpendicular (0,0),(0,0)");
v0 := (1,4); v1 := (-4, 1);
Assert_True (perpendicular_vec(v0,v1), Msg & " perpendicular (1,4),(-4,1)");
v0 := (-1,4); v1 := (-4, 1);
Assert_True (perpendicular_vec(v0,v1)=False, Msg & " not perpendicular (-1,4),(-4,1)");
v0 := (-88,-57); v1 := (0, -136);
Assert_True (perpendicular_vec(v0,v1)=False, Msg & " not perpendicular (-88,-57),(0,-136)");
v0 := (-1,-1); v1 := (-6, -6);
Assert_True (perpendicular_vec(v0,v1)=False, Msg & " not perpendicular (-1,-1),(-6,-6)");
v0 := (0,0); v1 := (0, 0);
Assert_True (perpendicular_vec(v0,v1), Msg & " perpendicular (0,0),(0,0)");
exception
when Assertion_Error =>
Put_Line (Msg & " Failed (assertion)");
when others =>
Put_Line (Msg & " Failed (exception)");
end Test_perpendicular_vec;
procedure Test_derivative is
Msg : constant String := "Test_derivative";
dv0 : vecFloat(5..5);
vecRes : vecFloat(1..1);
vecMillion: vecFloat(1..1000000);
vecMillionRes:vecFloat(1..1000000);
begin
dv0 := (dv0'First => 2.0);
vecRes := derivative(dv0);
Assert_True (vecRes(vecRes'First) = 0.0, Msg & " with a function with only one coefficient (2).");
Assert_True (derivative((3.0,5.0)) = (3.0,0.0), Msg & " with 3x + 5");
Assert_True (derivative((0.0,5.0)) = (0.0,0.0), Msg & " with 0x + 5");
Assert_True (derivative((0.0,0.0)) = (0.0,0.0), Msg & " with 0x + 0");
Assert_True (derivative((1.0,5.0)) = (1.0,0.0), Msg & " with x + 5");
Assert_True (derivative((0.0,0.0,0.0)) = (0.0,0.0,0.0), Msg & " with 0x^2 + 0x + 0");
Assert_True (derivative((2.0,0.0,6.0)) = (4.0,0.0,0.0), Msg & " with 2x^2 + 0x + 6");
Assert_True (derivative((2.0,1.0,6.0)) = (4.0,1.0,0.0), Msg & " with 2x^2 + 1x + 6");
Assert_True (derivative((0.0,0.0,6.0)) = (0.0,0.0,0.0), Msg & " with 0x^2 + 0x + 6");
Assert_True (derivative((4.0,0.0,6.0)) = (8.0,0.0,0.0), Msg & " with 4x^2 + 0x + 6");
Assert_True (derivative((1.0,1.0,1.0)) = (2.0,1.0,0.0), Msg & " with 1x^2 + 1x + 1");
Assert_True (derivative((0.5,1.0,1.0)) = (1.0,1.0,0.0), Msg & " with (1/2)x^2 + 1x + 1");
Assert_True (derivative((0.0,0.0,0.0,0.0)) = (0.0,0.0,0.0,0.0), Msg & " with 0x^3 + 0x^2 + 0x+0");
Assert_True (derivative((2.0,0.0,6.0,0.0)) = (6.0,0.0,6.0,0.0), Msg & " with 2x^3+ 0x^2 + 6x +0");
Assert_True (derivative((2.0,1.0,6.0,0.0)) = (6.0,2.0,6.0,0.0), Msg & " with 2x^3 + 1x^2 + 6x+0");
Assert_True (derivative((0.0,0.0,6.0,0.0)) = (0.0,0.0,6.0,0.0), Msg & " with 0x^3 + 0x^2 + 6x+8");
Assert_True (derivative((4.0,0.0,6.0,0.0)) = (12.0,0.0,6.0,0.0), Msg & " with 4x^3 + 0x^2+ 6x+ 0");
Assert_True (derivative((1.0,1.0,1.0,0.0)) = (3.0,2.0,1.0,0.0), Msg & " with 1x^3 + 1x^2 + 1x+0");
Assert_True (derivative((2.5,1.0,1.0,0.0)) = (7.5,2.0,1.0,0.0), Msg & " with 2.5x^3 + 1x^2 + 1x+0");
vecMillion:=(others =>0.0);
vecMillionRes:=(others =>0.0);
Assert_True(derivative(vecMillion)=vecMillionRes,Msg & " with 1 million elements with all 0");
vecMillion:=(others =>1.0);
for i in vecMillion'Range loop
vecMillionRes(i):=Float(vecMillionRes'Length - (i - vecMillionRes'First + 1));
end loop;
Assert_True(derivative(vecMillion)=vecMillionRes,Msg & " with 1 million elements with all 1");
vecMillion:=(others =>2.0);
for i in vecMillion'Range loop
vecMillionRes(i):=Float(vecMillionRes'Length - (i - vecMillionRes'First + 1))*2.0;
end loop;
Assert_True(derivative(vecMillion)=vecMillionRes,Msg & " with 1 million elements with all 2");
exception
when Assertion_Error =>
Put_Line (Msg & " Failed (assertion)");
when others =>
Put_Line (Msg & " Failed (exception)");
end Test_derivative;
begin
Put_Line ("********************* Test_Max");
Test_midpoint;
Test_module;
Test_get;
Test_perpendicular_vec;
Test_derivative;
end Main;
|
alloy4fun_models/trashltl/models/4/sDNjN8oTYuY7QGPPQ.als | Kaixi26/org.alloytools.alloy | 0 | 646 | <gh_stars>0
open main
pred idsDNjN8oTYuY7QGPPQ_prop5 {
some f: File | eventually (f not in (File + Trash + Protected))
}
pred __repair { idsDNjN8oTYuY7QGPPQ_prop5 }
check __repair { idsDNjN8oTYuY7QGPPQ_prop5 <=> prop5o } |
tools/scitools/conf/understand/ada/ada95/s-tastal.ads | brucegua/moocos | 1 | 14378 | ------------------------------------------------------------------------------
-- --
-- GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K _ S T O R A G E _ A L L O C A T I O N --
-- --
-- S p e c --
-- --
-- $Revision: 2 $ --
-- --
-- Copyright (c) 1991,1992,1993,1994, FSU, All Rights Reserved --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU Library General Public License as published by the --
-- Free Software Foundation; either version 2, or (at your option) any --
-- later version. GNARL is distributed in the hope that it will be use- --
-- ful, but but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Gen- --
-- eral Library Public License for more details. You should have received --
-- a copy of the GNU Library General Public License along with GNARL; see --
-- file COPYING.LIB. If not, write to the Free Software Foundation, 675 --
-- Mass Ave, Cambridge, MA 02139, USA. --
-- --
------------------------------------------------------------------------------
with System.Storage_Elements;
-- Used for, Storage_Count
package System.Task_Storage_Allocation is
-- This interface is described in the document
-- Gnu Ada Runtime Library Interface (GNARLI).
procedure Allocate_Block
(Storage_Address : out System.Address;
Storage_Size : System.Storage_Elements.Storage_Count;
Alignment : in System.Storage_Elements.Storage_Count);
procedure Deallocate_Block
(Storage_Address : System.Address);
function Maximum_Storage
return System.Storage_Elements.Storage_Count;
end System.Task_Storage_Allocation;
|
Map.agda | amal029/compositional-real-time-contracts | 0 | 16490 | <gh_stars>0
{-# OPTIONS --safe -W ignore #-}
module Map where
open import Data.String
open import Data.String.Properties using (_==_)
open import Data.Bool
open import Relation.Binary.PropositionalEquality
open import Agda.Builtin.Unit
open import Data.Empty
open import Relation.Nullary using (¬_)
import Relation.Nullary.Decidable.Core
import Data.List.Relation.Binary.Pointwise
import Data.List.Relation.Binary.Pointwise.Properties
import Agda.Builtin.Char.Properties
import Agda.Builtin.Char
import Data.Nat.Properties
-- The empty map
K : {A : Set} → (v : A) → (String → A)
K v = (λ _ → v)
-- Storing in map "m" with value "v" into key "k"
Store : {A : Set} → (m : (String → A)) → (k : String)
→ (v : A) → (String → A)
Store m k v = λ k' → if (k' == k) then v else m k'
-- Unit tests
open import Data.Nat
-- Example of initialising the variable stack
S : (String → ℕ)
S = K 0
-- Example of adding values to a stack
S1 : (String → ℕ)
S1 = Store S "a" 10
-- Adding the second variable
S2 : (String → ℕ)
S2 = Store S1 "b" 11
-- Getting the value of a from stack S2
A : ℕ
A = S2 "a"
-- Getting the value of b from stack S2
B : ℕ
B = S2 "b"
-- Try to get a string that is not in stack, gives the default value
C : ℕ
C = S2 "c"
-- Important properties
-- Lemma needed to prove the side condition between stacks after
-- function call
lemma-stack-eq : {A : Set} → ∀ (stm stf : (String → A)) → (X Y : String)
→ (Store stm Y (stf X)) Y ≡ (stf X)
lemma-stack-eq stm stf X Y with (Y Data.String.≟ Y)
... | .true Relation.Nullary.because Relation.Nullary.ofʸ p = refl
... | .false Relation.Nullary.because Relation.Nullary.ofⁿ ¬p = ⊥-elim (¬p refl)
-- Now a very important property for proving the constancy rule
t-update-neq : {A : Set} → ∀ (st : (String → A)) → (x1 x2 : String)
→ (v : A) → ((x2 ≡ x1) → ⊥) → (Store st x1 v) x2 ≡ (st x2)
t-update-neq st x1 x2 v p with (Relation.Nullary.Decidable.Core.map′
(λ x →
Data.String.Properties.toList-injective x2 x1
(Data.List.Relation.Binary.Pointwise.Pointwise-≡⇒≡ x))
(λ x →
Data.List.Relation.Binary.Pointwise.≡⇒Pointwise-≡ (cong toList x))
(Data.List.Relation.Binary.Pointwise.Properties.decidable
(λ x y →
Relation.Nullary.Decidable.Core.map′
(Agda.Builtin.Char.Properties.primCharToNatInjective x y)
(cong Agda.Builtin.Char.primCharToNat)
(Relation.Nullary.Decidable.Core.map′
(Data.Nat.Properties.≡ᵇ⇒≡ (Agda.Builtin.Char.primCharToNat x)
(Agda.Builtin.Char.primCharToNat y))
(Data.Nat.Properties.≡⇒≡ᵇ (Agda.Builtin.Char.primCharToNat x)
(Agda.Builtin.Char.primCharToNat y))
(T?
(Agda.Builtin.Char.primCharToNat x ≡ᵇ
Agda.Builtin.Char.primCharToNat y))))
(toList x2) (toList x1)))
... | false Relation.Nullary.because Relation.Nullary.ofⁿ ¬p = refl
... | true Relation.Nullary.because Relation.Nullary.ofʸ refl = ⊥-elim (p refl)
-- Testing lookup with nested stores
test : {A : Set} → ∀ (x1 x2 y : String) → (st st' : (String → A))
→ (v1 v2 : A) → (y ≡ x1 → ⊥) → (y ≡ x2 → ⊥)
→ (st' ≡ (Store (Store st x1 v1) x2 v2))
→ st' y ≡ st y
test x1 x2 y st st' v1 v2 p1 p2 q rewrite q
| t-update-neq (Store st x1 v1) x2 y v2 p2
| t-update-neq st x1 y v1 p1 = refl
-- Partial map
open import Data.Maybe
KP : {A : Set} → (String → Maybe A)
KP = (λ _ → nothing)
StoreP : {A : Set} → (st : (String → Maybe A))
→ (x : String) → (v : A)
→ (String → Maybe A)
StoreP st x v = λ x' → if x == x' then just v else st x'
|
examples/atari800/colors/main.asm | RoyJacobs/mosdev | 15 | 179914 | /// Thanks to F#READY for help in preparing this example
/// After loading, hit 'start', then wait two seconds and hit 'select'. Colors should appear.
.import * from "atari800.asm"
xex_load_header()
///////////////////////////////////////////////////
// First XEX segment
///////////////////////////////////////////////////
xex_segment_header("first", segments.first.start, segments.first.end)
.define bank {
name = "first"
}
.define segment {
name = "first"
bank = "first"
start = $0600
}
.segment "first" {
first: lda #0
sta 710
wait_start: lda $d01f
cmp #6
bne wait_start
rts // continue loading
}
xex_segment_ini("first", first)
///////////////////////////////////////////////////
// Second XEX segment
///////////////////////////////////////////////////
xex_segment_header("second", segments.second.start, segments.second.end)
.define bank {
name = "second"
}
.define segment {
name = "second"
bank = "second"
start = segments.first.end
}
.segment "second" {
second: lda #34
sta 710
lda #0
sta 20
wait_2sec: lda 20
cmp #100
bne wait_2sec
wait_select: lda $d01f
cmp #5
bne wait_select
rts // continue loading
}
xex_segment_ini("second", second)
///////////////////////////////////////////////////
// Main XEX segment
///////////////////////////////////////////////////
xex_segment_header("main", segments.main.start, segments.main.end)
.define bank {
name = "main"
}
.define segment {
name = "main"
bank = "main"
start = segments.second.end
}
.segment "main" {
main: lda $d40b
adc 20
asl
sta $d40a
sta $d018
jmp main
}
xex_segment_run("main", main) |
programs/oeis/122/A122795.asm | karttu/loda | 0 | 244844 | <filename>programs/oeis/122/A122795.asm
; A122795: Connell (5,3)-sum sequence (partial sums of the (5,3)-Connell sequence)
; 1,3,10,22,39,57,80,108,141,179,222,270,319,373,432,496,565,639,718,802,891,985,1080,1180,1285,1395,1510,1630,1755,1885,2020,2160,2305,2455,2610,2766,2927,3093,3264,3440,3621,3807,3998,4194,4395,4601,4812,5028,5249,5475,5706,5938,6175,6417,6664,6916,7173,7435,7702,7974,8251,8533,8820,9112,9409,9711,10018,10330,10647,10969
mov $14,$0
mov $16,$0
add $16,1
lpb $16,1
clr $0,14
mov $0,$14
sub $16,1
sub $0,$16
mov $11,$0
mov $13,$0
add $13,1
lpb $13,1
mov $0,$11
sub $13,1
sub $0,$13
mov $7,$0
mov $9,2
lpb $9,1
mov $0,$7
sub $9,1
add $0,$9
sub $0,1
mov $2,$0
lpb $2,1
mov $5,10
lpb $4,1
mov $1,$2
sub $4,$4
mov $5,$0
lpe
add $0,$1
lpb $5,1
sub $0,2
trn $4,1
add $4,4
trn $5,$4
lpe
sub $2,$1
lpe
mov $1,$0
mov $10,$9
lpb $10,1
mov $8,$1
sub $10,1
lpe
lpe
lpb $7,1
mov $7,0
trn $8,$1
lpe
mov $1,$8
div $1,2
mul $1,4
add $1,1
add $12,$1
lpe
add $15,$12
lpe
mov $1,$15
|
gcc-gcc-7_3_0-release/gcc/ada/a-exetim-posix.adb | best08618/asylo | 7 | 9920 | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . E X E C U T I O N _ T I M E --
-- --
-- B o d y --
-- --
-- Copyright (C) 2007-2015, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is the POSIX (Realtime Extension) version of this package
with Ada.Task_Identification; use Ada.Task_Identification;
with Ada.Unchecked_Conversion;
with System.Tasking;
with System.OS_Interface; use System.OS_Interface;
with System.Task_Primitives.Operations; use System.Task_Primitives.Operations;
with Interfaces.C; use Interfaces.C;
package body Ada.Execution_Time is
pragma Linker_Options ("-lrt");
-- POSIX.1b Realtime Extensions library. Needed to have access to function
-- clock_gettime.
---------
-- "+" --
---------
function "+"
(Left : CPU_Time;
Right : Ada.Real_Time.Time_Span) return CPU_Time
is
use type Ada.Real_Time.Time;
begin
return CPU_Time (Ada.Real_Time.Time (Left) + Right);
end "+";
function "+"
(Left : Ada.Real_Time.Time_Span;
Right : CPU_Time) return CPU_Time
is
use type Ada.Real_Time.Time;
begin
return CPU_Time (Left + Ada.Real_Time.Time (Right));
end "+";
---------
-- "-" --
---------
function "-"
(Left : CPU_Time;
Right : Ada.Real_Time.Time_Span) return CPU_Time
is
use type Ada.Real_Time.Time;
begin
return CPU_Time (Ada.Real_Time.Time (Left) - Right);
end "-";
function "-"
(Left : CPU_Time;
Right : CPU_Time) return Ada.Real_Time.Time_Span
is
use type Ada.Real_Time.Time;
begin
return (Ada.Real_Time.Time (Left) - Ada.Real_Time.Time (Right));
end "-";
-----------
-- Clock --
-----------
function Clock
(T : Ada.Task_Identification.Task_Id :=
Ada.Task_Identification.Current_Task) return CPU_Time
is
TS : aliased timespec;
Clock_Id : aliased Interfaces.C.int;
Result : Interfaces.C.int;
function To_CPU_Time is
new Ada.Unchecked_Conversion (Duration, CPU_Time);
-- Time is equal to Duration (although it is a private type) and
-- CPU_Time is equal to Time.
function Convert_Ids is new
Ada.Unchecked_Conversion (Task_Id, System.Tasking.Task_Id);
function clock_gettime
(clock_id : Interfaces.C.int;
tp : access timespec)
return int;
pragma Import (C, clock_gettime, "clock_gettime");
-- Function from the POSIX.1b Realtime Extensions library
function pthread_getcpuclockid
(tid : Thread_Id;
clock_id : access Interfaces.C.int)
return int;
pragma Import (C, pthread_getcpuclockid, "pthread_getcpuclockid");
-- Function from the Thread CPU-Time Clocks option
begin
if T = Ada.Task_Identification.Null_Task_Id then
raise Program_Error;
else
-- Get the CPU clock for the task passed as parameter
Result := pthread_getcpuclockid
(Get_Thread_Id (Convert_Ids (T)), Clock_Id'Access);
pragma Assert (Result = 0);
end if;
Result := clock_gettime
(clock_id => Clock_Id, tp => TS'Unchecked_Access);
pragma Assert (Result = 0);
return To_CPU_Time (To_Duration (TS));
end Clock;
--------------------------
-- Clock_For_Interrupts --
--------------------------
function Clock_For_Interrupts return CPU_Time is
begin
-- According to AI 0170-1, D.14(18.1/3), if Interrupt_Clocks_Supported
-- is set to False the function raises Program_Error.
raise Program_Error;
return CPU_Time_First;
end Clock_For_Interrupts;
-----------
-- Split --
-----------
procedure Split
(T : CPU_Time;
SC : out Ada.Real_Time.Seconds_Count;
TS : out Ada.Real_Time.Time_Span)
is
use type Ada.Real_Time.Time;
begin
Ada.Real_Time.Split (Ada.Real_Time.Time (T), SC, TS);
end Split;
-------------
-- Time_Of --
-------------
function Time_Of
(SC : Ada.Real_Time.Seconds_Count;
TS : Ada.Real_Time.Time_Span := Ada.Real_Time.Time_Span_Zero)
return CPU_Time
is
begin
return CPU_Time (Ada.Real_Time.Time_Of (SC, TS));
end Time_Of;
end Ada.Execution_Time;
|
cobol85/Cobol85Preprocessor.g4 | Cmejia/grammars-v4 | 1 | 7481 | /*
* Copyright (C) 2015 <NAME> <<EMAIL>>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Cobol 85 Preprocessor Grammar for ANTLR4
*
* This is a preprocessor grammar for Cobol 85.
*
* Change log:
*
* v1.0
* - EXEC SQL
* - EXEC CICS
*
* v0.9 Initial revision
*/
grammar Cobol85Preprocessor;
options
{
language = Java;
}
startRule : (
copyStatement
| execCicsStatement
| execSqlStatement
| replaceOffStatement
| replaceArea
| charData
)* EOF;
// exec cics statemen
execCicsStatement :
EXEC CICS charData END_EXEC
;
// exec sql statement
execSqlStatement :
EXEC SQL charData END_EXEC
;
// copy statement
copyStatement :
COPY copySource
(NEWLINE* directoryPhrase)?
(NEWLINE* familyPhrase)?
(NEWLINE* replacingPhrase)?
DOT
;
copySource : literal | cobolWord;
replacingPhrase :
REPLACING NEWLINE* replaceClause (NEWLINE+ replaceClause)*
;
// replace statement
replaceArea :
replaceByStatement
(copyStatement | charData)*
replaceOffStatement
;
replaceByStatement :
REPLACE (NEWLINE* replaceClause)+ DOT
;
replaceOffStatement :
REPLACE OFF DOT
;
replaceClause :
replaceable NEWLINE* BY NEWLINE* replacement
(NEWLINE* directoryPhrase)?
(NEWLINE* familyPhrase)?
;
directoryPhrase :
(OF | IN) NEWLINE* (literal | cobolWord)
;
familyPhrase :
ON NEWLINE* (literal | cobolWord)
;
replaceable : literal | cobolWord | pseudoText | charDataLine;
replacement : literal | cobolWord | pseudoText | charDataLine;
// literal ----------------------------------
cobolWord : IDENTIFIER;
literal : NONNUMERICLITERAL;
pseudoText : DOUBLEEQUALCHAR charData? DOUBLEEQUALCHAR;
charData :
(
charDataLine
| NEWLINE
)+
;
charDataLine :
(
charDataKeyword
| cobolWord
| literal
| TEXT
| DOT
)+
;
// keywords ----------------------------------
charDataKeyword :
BY
| IN
| OF | OFF | ON
| REPLACING
;
// lexer rules --------------------------------------------------------------------------------
// keywords
BY : B Y;
CICS : C I C S;
COPY : C O P Y;
END_EXEC : E N D '-' E X E C;
EXEC : E X E C;
IN : I N;
OF : O F;
OFF : O F F;
ON : O N;
REPLACE : R E P L A C E;
REPLACING : R E P L A C I N G;
SQL : S Q L;
// symbols
COMMENTTAG : '>*';
DOT : '.';
DOUBLEEQUALCHAR : '==';
// literals
NONNUMERICLITERAL : STRINGLITERAL | HEXNUMBER;
fragment HEXNUMBER :
X '"' [0-9A-F]+ '"'
| X '\'' [0-9A-F]+ '\''
;
fragment STRINGLITERAL :
'"' (~["\n\r] | '""' | '\'')* '"'
| '\'' (~['\n\r] | '\'\'' | '"')* '\''
;
IDENTIFIER : [a-zA-Z0-9]+ ([-_]+ [a-zA-Z0-9]+)*;
// whitespace, line breaks, comments, ...
NEWLINE : '\r'? '\n';
COMMENTLINE : COMMENTTAG ~('\n' | '\r')* -> channel(HIDDEN);
WS : [ \t\f;]+ -> channel(HIDDEN);
TEXT : ~('\n' | '\r');
// case insensitive chars
fragment A:('a'|'A');
fragment B:('b'|'B');
fragment C:('c'|'C');
fragment D:('d'|'D');
fragment E:('e'|'E');
fragment F:('f'|'F');
fragment G:('g'|'G');
fragment H:('h'|'H');
fragment I:('i'|'I');
fragment J:('j'|'J');
fragment K:('k'|'K');
fragment L:('l'|'L');
fragment M:('m'|'M');
fragment N:('n'|'N');
fragment O:('o'|'O');
fragment P:('p'|'P');
fragment Q:('q'|'Q');
fragment R:('r'|'R');
fragment S:('s'|'S');
fragment T:('t'|'T');
fragment U:('u'|'U');
fragment V:('v'|'V');
fragment W:('w'|'W');
fragment X:('x'|'X');
fragment Y:('y'|'Y');
fragment Z:('z'|'Z'); |
src/util/sprite/cg.asm | olifink/qspread | 0 | 12745 | <filename>src/util/sprite/cg.asm
* Sprite cg
*
* Mode 4
* +|-----------+
* - gg g ggg g-
* |g g g g|
* |g g |
* |g g gg |
* |g g g |
* |g g g |
* | gg ggg |
* +|-----------+
*
section sprite
xdef mes_cg
xref mes_zero
mes_cg
dc.w $0100,$0000
dc.w 12,7,0,0
dc.l sc4_cg-*
dc.l mes_zero-*
dc.l 0
sc4_cg
dc.w $6900,$D000
dc.w $8A00,$1000
dc.w $8200,$0000
dc.w $8200,$C000
dc.w $8200,$4000
dc.w $8200,$4000
dc.w $6100,$C000
*
end
|
src/Auto/Counting.agda | wenkokke/AutoInAgda | 22 | 13856 | <reponame>wenkokke/AutoInAgda
open import Auto.Core using (Rule; RuleName; _≟-RuleName_; name2rule; IsHintDB)
open import Level using (zero)
open import Function using (id; _∘_)
open import Category.Functor using (module RawFunctor)
open import Data.Bool as Bool using (if_then_else_)
open import Data.List as List using (List; _++_; []; [_])
open import Data.Maybe as Maybe using (Maybe; just; nothing)
open import Data.Nat as Nat using (ℕ; pred)
open import Data.Product as Prod using (∃; _,_; proj₂)
open import Data.Sum as Sum using (_⊎_; inj₁; inj₂)
open import Data.Unit as Unit using (⊤)
open import Reflection using (Name)
open import Relation.Nullary.Decidable using (⌊_⌋)
module Auto.Counting where
--------------------------------------------------------------------------------
-- Define a 'counting' hint database which, upon selection of a rule will --
-- decrement an associated 'count' value, and upon reaching 0 will delete --
-- the hint from the hint database. --
-- --
-- The count values can either be natural numbers, in which case they --
-- will be decremented as expected, or the value ⊤, in which case they --
-- will not be decremented, effectively inserting infinite copies of the --
-- rule into the hint database. --
--------------------------------------------------------------------------------
module CountingHintDB where
open RawFunctor (Maybe.functor {zero}) using (_<$>_)
Count : Set
Count = ℕ ⊎ ⊤
record Hint (k : ℕ) : Set where
constructor mkHint
field
rule : Rule k
count : Count
ruleName : RuleName
ruleName = Rule.name rule
HintDB : Set
HintDB = List (∃ Hint)
decrCount : ∀ {k} → Hint k → Maybe (Hint k)
decrCount {k} (mkHint r c) = mkHint r <$> decrCount′ c
where
decrCount′ : Count → Maybe Count
decrCount′ (inj₁ 0) = nothing
decrCount′ (inj₁ 1) = nothing
decrCount′ (inj₁ x) = just (inj₁ (pred x))
decrCount′ (inj₂ _) = just (inj₂ _)
getTr : ∀ {k} → Hint k → (HintDB → HintDB)
getTr h₁ = List.concatMap (List.fromMaybe ∘ mdecr₁)
where
mdecr₁ : ∃ Hint → Maybe (∃ Hint)
mdecr₁ (_ , h₂) =
if ⌊ Hint.ruleName h₁ ≟-RuleName Hint.ruleName h₂ ⌋
then (_,_ _) <$> decrCount h₂
else just (_ , h₂)
countingHintDB : IsHintDB
countingHintDB = record
{ HintDB = HintDB
; Hint = Hint
; getHints = id
; getRule = Hint.rule
; getTr = getTr
; ε = []
; _∙_ = _++_
; return = λ r → [ _ , mkHint r (inj₂ _) ]
}
open CountingHintDB using (mkHint; countingHintDB)
open import Auto.Extensible countingHintDB public
--------------------------------------------------------------------------------
-- Define some new syntax in order to insert rules with limited usage. --
--------------------------------------------------------------------------------
infixl 5 _<<[_]_
_<<[_]_ : HintDB → ℕ → Name → HintDB
db <<[ 0 ] _ = db
db <<[ x ] n with (name2rule n)
db <<[ x ] n | inj₁ msg = db
db <<[ x ] n | inj₂ (k , r) = db ∙ [ k , mkHint r (inj₁ x) ]
|
.emacs.d/scripts/emacsclient.applescript | odjhey/dotfiles | 0 | 1350 | <reponame>odjhey/dotfiles<filename>.emacs.d/scripts/emacsclient.applescript
on emacsclient(input)
set theCommand to "/usr/local/bin/emacsclient -n -c -F \"((name . \\\"capture\\\")(height . 10) (width . 100) (left . 100) (top . 100))\"" & " " & "\"" & input & "\""
do shell script theCommand
do shell script "open -a Emacs"
end emacsclient
on open location input
emacsclient(input)
end open location
on open inputs
repeat with raw_input in inputs
set input to POSIX path of raw_input
emacsclient(input)
end repeat
end open
on run
do shell script emacsclient("")
end run
|
examples/src/psenvsub.adb | sonneveld/adazmq | 0 | 8895 | <filename>examples/src/psenvsub.adb
-- Pubsub envelope subscriber
with Ada.Command_Line;
with Ada.Text_IO;
with GNAT.Formatted_String;
with ZMQ;
use type GNAT.Formatted_String.Formatted_String;
procedure PSEnvSub is
function Main return Ada.Command_Line.Exit_Status
is
-- Prepare our context and subscriber
Context : ZMQ.Context_Type := ZMQ.New_Context;
Subscriber : ZMQ.Socket_Type'Class := Context.New_Socket (ZMQ.ZMQ_SUB);
begin
Subscriber.Connect ("tcp://localhost:5563");
Subscriber.Set_Sock_Opt (ZMQ.ZMQ_SUBSCRIBE, "B");
loop
declare
Address : constant String := Subscriber.Recv; -- Read envelope with address
Contents : constant String := Subscriber.Recv; -- Read message contents
begin
Ada.Text_IO.Put_Line(-(+"[%s] %s"&Address&Contents));
end;
end loop;
-- We never get here, but clean up anyhow
Subscriber.Close;
Context.Term;
return 0;
end Main;
begin
Ada.Command_Line.Set_Exit_Status (Main);
end PSEnvSub;
|
lab16/src/main.adb | evgenijaZ/PP-labs | 0 | 17918 | <gh_stars>0
-----------------------------------------
-- PRG2 --
-- A = B * (MC * MD - ME * e) --
-- <NAME> --
-- IP-53 --
-----------------------------------------
with System; use System;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with Ada.Calendar; use Ada.Calendar;
procedure Main is
N : Integer := 2400;
P : Integer := 4;
H : Integer := N / P;
startTime : Time;
endTime : Time;
type GeneralVector is array (Integer range <>) of Integer;
subtype Vector is GeneralVector (1 .. N);
subtype VectorH is GeneralVector (1 .. H);
subtype Vector2H is GeneralVector (1 .. 2 * H);
subtype Vector3H is GeneralVector (1 .. 3 * H);
type GeneralMatrix is array (Integer range <>, Integer range <>) of Integer;
subtype Matrix is GeneralMatrix (1 .. N, 1 .. N);
subtype MatrixH is GeneralMatrix (1 .. N, 1 .. H);
subtype Matrix2H is GeneralMatrix (1 .. N, 1 .. 2 * H);
subtype Matrix3H is GeneralMatrix (1 .. N, 1 .. 3 * H);
procedure Start is
task T1 is
entry Data1 (B_p : in Vector; MC_p : in Matrix);
entry Data2 (e_p : in Integer; MD_p : in MatrixH);
entry Data3 (ME_p : in MatrixH);
end T1;
task T2 is
entry Data2 (MD_p : in Matrix2H; e_p : in Integer);
entry Data3 (ME_p : in Matrix2H);
entry Rezult1 (A_p : in VectorH);
entry Rezult23 (A_p : in Vector2H);
end T2;
task T3 is
entry Data3 (ME_p : in Matrix3H);
entry Data1 (B_p : in Vector; MC_p : in Matrix);
entry Rezult3 (A_p : in VectorH);
end T3;
task T4 is
entry Data2 (MD_p : in MatrixH; e_p : in Integer);
entry Data1 (B_p : in Vector; MC_p : in Matrix);
end T4;
task body T1 is
B : Vector;
MC : Matrix;
MD : MatrixH;
e : Integer;
ME : MatrixH;
A : VectorH;
MR : Matrix;
from, to : Integer;
begin
Put_Line ("T1 started");
from := 1;
to := H;
--Receive B, MC from T2
accept Data1 (B_p : in Vector; MC_p : in Matrix) do
B := B_p;
MC := MC_p;
end Data1;
--Receive MD, e from T2
accept Data2 (e_p : in Integer; MD_p : in MatrixH) do
e := e_p;
MD := MD_p;
end Data2;
--Receive ME from T2
accept Data3 (ME_p : in MatrixH) do
ME := ME_p;
end Data3;
--Calculate A = B * (MC * MDH - MEH * e)
for i in 1 .. N loop
for j in from .. to loop
MR (i, j) := 0;
for k in 1 .. N loop
MR (i, j) := MR (i, j) + MC (i, k) * MD (k, j);
end loop;
MR (i, j) := MR (i, j) - ME (i, j) * e;
end loop;
end loop;
for j in from .. to loop
A (j) := 0;
for k in 1 .. N loop
A (j) := A (j) + B (k) * MR (k, j);
end loop;
end loop;
--Send A to T2
T2.Rezult1 (A);
--Put_Line ("T1 finished");
end T1;
task body T2 is
B : Vector;
MC : Matrix;
MD : MatrixH;
MD_t : Matrix2H;
MD_t2 : MatrixH;
e : Integer;
ME : MatrixH;
ME_t : Matrix2H;
ME_t2 : MatrixH;
A : Vector;
MR : Matrix;
from, to : Integer;
begin
Put_Line ("T2 started");
from := 1;
to := H;
--Input B, MC
for i in 1 .. N loop
B (i) := 1;
for j in 1 .. N loop
MC (i, j) := 1;
end loop;
end loop;
--Send B, MC to T1
T1.Data1 (B, MC);
--Receive MD, e from T3
accept Data2 (MD_p : in Matrix2H; e_p : in Integer) do
MD_t := MD_p;
e := e_p;
--MD:=MD_p(1..N,H+1..2*H);
for i in 1 .. N loop
for j in H + 1 .. 2 * H loop
MD (i, j - H) := MD_p (i, j);
end loop;
end loop;
end Data2;
--Send B, MC to T3
T3.Data1 (B, MC);
--Send MD, e to T1
for i in 1 .. N loop
for j in 1 .. H loop
MD_t2 (i, j) := MD_t (i, j);
end loop;
end loop;
T1.Data2 (e, MD_t2);
--Receive ME from T3
accept Data3 (ME_p : in Matrix2H) do
ME_t := ME_p;
--ME:=ME_p(H+1..2*H);
for i in 1 .. N loop
for j in H + 1 .. 2 * H loop
ME (i, j - H) := ME_p (i, j);
end loop;
end loop;
end Data3;
--Send ME to T1
for i in 1 .. N loop
for j in 1 .. H loop
ME_t2 (i, j) := ME_t (i, j);
end loop;
end loop;
T1.Data3 (ME_t2);
--Calculate A = B * (MC * MDH - MEH * e)
for i in 1 .. N loop
for j in from .. to loop
MR (i, j) := 0;
for k in 1 .. N loop
MR (i, j) := MR (i, j) + MC (i, k) * MD (k, j);
end loop;
MR (i, j) := MR (i, j) - ME (i, j) * e;
end loop;
end loop;
for j in H + 1 .. 2 * H loop
A (j) := 0;
for k in 1 .. N loop
A (j) := A (j) + B (k) * MR (k, j - H);
end loop;
end loop;
--Receive A from T1
accept Rezult1 (A_p : in VectorH) do
A (1 .. H) := A_p;
end Rezult1;
--Receive A from T3
accept Rezult23 (A_p : in Vector2H) do
A (2 * H + 1 .. N) := A_p;
end Rezult23;
--Output A
if N <= 12 then
for i in 1 .. N loop
Put (A (i));
Put (" ");
end loop;
Put_Line ("");
end if;
--Put_Line ("T2 finished");
end T2;
task body T3 is
B : Vector;
MC : Matrix;
MD : MatrixH;
MD_t : Matrix;
MD_t2 : Matrix2H;
MD_t3 : MatrixH;
e : Integer;
ME : MatrixH;
ME_t : Matrix3H;
ME_t2 : Matrix2H;
A : Vector2H;
MR : Matrix;
from, to : Integer;
begin
Put_Line ("T3 started");
from := 1;
to := H;
--Input MD, e
for i in 1 .. N loop
for j in 1 .. N loop
MD_t (i, j) := 1;
end loop;
end loop;
e := 1;
-- MD:=MD_t(2*H+1..3*H);
for i in 1 .. N loop
for j in 2 * H + 1 .. 3 * H loop
MD (i, j - 2 * H) := MD_t (i, j);
end loop;
end loop;
--Send MD, e to T2
for i in 1 .. N loop
for j in 1 .. 2 * H loop
MD_t2 (i, j) := MD_t (i, j);
end loop;
end loop;
T2.Data2 (MD_t2, e);
--Receive ME from T4
accept Data3 (ME_p : in Matrix3H) do
ME_t := ME_p;
-- ME:=ME_p(2*H+1..3*H);
for i in 1 .. N loop
for j in 2 * H + 1 .. 3 * H loop
ME (i, j - 2 * H) := ME_p (i, j);
end loop;
end loop;
end Data3;
--Send MD, e to T4
for i in 1 .. N loop
for j in 3 * H + 1 .. N loop
MD_t3 (i, j - 3 * H) := MD_t (i, j);
end loop;
end loop;
T4.Data2 (MD_t3, e);
--Receive B, MC from T2
accept Data1 (B_p : in Vector; MC_p : in Matrix) do
B := B_p;
MC := MC_p;
end Data1;
--Send B, MC to T4
T4.Data1 (B, MC);
--Send ME to T3
for i in 1 .. N loop
for j in 1 .. 2 * H loop
ME_t2 (i, j) := ME_t (i, j);
end loop;
end loop;
T2.Data3 (ME_t2);
--Calculate A = B * (MC * MDH - MEH * e)
for i in 1 .. N loop
for j in from .. to loop
MR (i, j) := 0;
for k in 1 .. N loop
MR (i, j) := MR (i, j) + MC (i, k) * MD (k, j);
end loop;
MR (i, j) := MR (i, j) - ME (i, j) * e;
end loop;
end loop;
for j in from .. to loop
A (j) := 0;
for k in 1 .. N loop
A (j) := A (j) + B (k) * MR (k, j);
end loop;
end loop;
--Receive A from T4
accept Rezult3 (A_p : in VectorH) do
A (H + 1 .. 2 * H) := A_p;
end Rezult3;
--Send A to T2
T2.Rezult23 (A);
--Put_Line ("T3 finished");
end T3;
task body T4 is
B : Vector;
MC : Matrix;
MD : MatrixH;
e : Integer;
ME : MatrixH;
ME_t : Matrix;
ME_t2 : Matrix3H;
A : VectorH;
MR : Matrix;
from, to : Integer;
begin
Put_Line ("T4 started");
from := 1;
to := H;
--Input ME
for i in 1 .. N loop
for j in 1 .. N loop
ME_t (i, j) := 1;
end loop;
end loop;
-- ME:=ME_t(3*H+1..N);
for i in 1 .. N loop
for j in 3 * H + 1 .. N loop
ME (i, j - 3 * H) := ME_t (i, j);
end loop;
end loop;
--Send ME to T3
for i in 1 .. N loop
for j in 1 .. 3 * H loop
ME_t2 (i, j) := ME_t (i, j);
end loop;
end loop;
T3.Data3 (ME_t2);
--Receive MD, e from T3
accept Data2 (MD_p : in MatrixH; e_p : in Integer) do
MD := MD_p;
e := e_p;
end Data2;
--Receive B, MC from T3
accept Data1 (B_p : in Vector; MC_p : in Matrix) do
B := B_p;
MC := MC_p;
end Data1;
--Calculate A = B * (MC * MDH - MEH * e)
for i in 1 .. N loop
for j in from .. to loop
MR (i, j) := 0;
for k in 1 .. N loop
MR (i, j) := MR (i, j) + MC (i, k) * MD (k, j);
end loop;
MR (i, j) := MR (i, j) - ME (i, j) * e;
end loop;
end loop;
for j in from .. to loop
A (j) := 0;
for k in 1 .. N loop
A (j) := A (j) + B (k) * MR (k, j);
end loop;
end loop;
--Send A to T3
T3.Rezult3 (A);
-- Put_Line ("T4 finished");
end T4;
begin
null;
end Start;
begin
startTime := Clock;
Start;
endTime:=Clock;
Put("N: ");
Put(N);
Put_Line("");
Put("Time-2: ");
Put(Integer(endTime-startTime),10);
end Main;
|
src/skill-files.ads | skill-lang/adaCommon | 0 | 25850 | -- ___ _ ___ _ _ --
-- / __| |/ (_) | | Common SKilL implementation --
-- \__ \ ' <| | | |__ general file interaction --
-- |___/_|\_\_|_|____| by: <NAME> --
-- --
pragma Ada_2012;
with Ada.Containers.Hashed_Maps;
with Skill.Types;
with Skill.Types.Pools;
with Skill.Containers.Vectors;
with Skill.String_Pools;
with Skill.Hashes;
with Skill.Equals;
with Skill.Field_Types.Builtin;
with Skill.Field_Types.Builtin.String_Type_P;
package Skill.Files is
type Read_Mode is (Create, Read);
type Write_Mode is (Write, Append, Destroyed);
type File_T is abstract tagged limited record
-- path used for flush/close operations
Path : Skill.Types.String_Access;
-- current write mode
Mode : Write_Mode;
-- strings stored in this file
Strings : Skill.String_Pools.Pool;
-- string type used for string RTTI
String_Type : Skill.Field_Types.Builtin.String_Type_P.Field_Type;
-- annotation type used for annotations RTTI
Annotation_Type : Skill.Field_Types.Builtin.Annotation_Type_P.Field_Type;
-- types stored in this file
Types : Skill.Types.Pools.Type_Vector;
-- types by skill name
Types_By_Name : Skill.Types.Pools.Type_Map;
end record;
type File is not null access File_T'Class;
-- access to strings stored in the file
function Strings
(This : access File_T'Class) return Skill.String_Pools.Pool;
-- delete an object from the file
procedure Delete
(This : access File_T'Class;
Target : access Types.Skill_Object'Class);
-- change the output path
-- @note can currently only be used in write mode
procedure Change_Path (This : access File_T'Class; New_Path : String);
-- checks restrictions
-- raises skill_error, if a check fails
procedure Check (This : access File_T'Class);
-- write changes to disk
procedure Flush (This : access File_T'Class);
procedure Free (This : access File_T) is abstract;
-- internal use only
procedure Finalize_Pools (This : access File_T'Class);
end Skill.Files;
|
libsrc/_DEVELOPMENT/input/zx/c/sdcc_iy/in_stick_sinclair1.asm | meesokim/z88dk | 0 | 165705 |
; uint16_t in_stick_sinclair1(void)
SECTION code_input
PUBLIC _in_stick_sinclair1
EXTERN asm_in_stick_sinclair1
defc _in_stick_sinclair1 = asm_in_stick_sinclair1
|
HoTT/Logic.agda | michaelforney/hott | 0 | 251 | {-# OPTIONS --without-K --rewriting #-}
open import HoTT.Base
open import HoTT.Identity
open import HoTT.Identity.Sigma
open import HoTT.Identity.Pi
open import HoTT.Identity.Universe
open import HoTT.Identity.Product
open import HoTT.HLevel
open import HoTT.HLevel.Truncate
open import HoTT.Equivalence
open import HoTT.Equivalence.Lift
module HoTT.Logic where
private variable i j k : Level
LiftProp : Prop𝒰 i → Prop𝒰 (i ⊔ j)
LiftProp {i} {j} P = type (Lift {j} (P ty))
⊤ : Prop𝒰 i
⊤ = type 𝟏
⊥ : Prop𝒰 i
⊥ = type 𝟎
_∧_ : Prop𝒰 i → Prop𝒰 j → Prop𝒰 (i ⊔ j)
P ∧ Q = type (P ty × Q ty) ⦃ ×-hlevel ⦄
_⇒_ : Prop𝒰 i → Prop𝒰 j → Prop𝒰 (i ⊔ j)
P ⇒ Q = type (P ty → Q ty)
infix 10 _⇒_
_⇔_ : Prop𝒰 i → Prop𝒰 i → Prop𝒰 (lsuc i)
P ⇔ Q = type (P ty == Q ty) ⦃ equiv-hlevel (=𝒰-equiv ⁻¹ₑ) ⦄
where
instance
_ = Σ-hlevel
_ = raise ⦃ hlevel𝒰.h P ⦄
_ = raise ⦃ hlevel𝒰.h Q ⦄
_∨_ : Prop𝒰 i → Prop𝒰 j → Prop𝒰 (i ⊔ j)
P ∨ Q = type ∥ P ty + Q ty ∥
∃ : (A : 𝒰 i) → (A → Prop𝒰 j) → Prop𝒰 (i ⊔ j)
∃ A P = type ∥ Σ A (_ty ∘ P) ∥
syntax ∃ A (λ x → Φ) = ∃[ x ∶ A ] Φ
∀' : (A : 𝒰 i) → (P : A → Prop𝒰 j) → Prop𝒰 (i ⊔ j)
∀' A P = type (Π A (_ty ∘ P))
where instance _ = λ {x} → hlevel𝒰.h (P x)
syntax ∀' A (λ x → Φ) = ∀[ x ∶ A ] Φ
LEM : 𝒰 (lsuc i)
LEM {i} = (A : Prop𝒰 i) → A ty + ¬ A ty
LEM∞ : 𝒰 (lsuc i)
LEM∞ {i} = (A : 𝒰 i) → A + ¬ A
LDN : 𝒰 (lsuc i)
LDN {i} = (A : Prop𝒰 i) → ¬ ¬ A ty → A ty
AC : 𝒰 (lsuc i ⊔ lsuc j ⊔ lsuc k)
AC {i} {j} {k} =
{X : 𝒰 i} {A : X → 𝒰 j} {P : (x : X) → A x → 𝒰 k} →
⦃ hlevel 2 X ⦄ → ⦃ {x : X} → hlevel 2 (A x) ⦄ →
⦃ {x : X} {a : A x} → hlevel 1 (P x a) ⦄ →
Π[ x ∶ X ] ∥ Σ[ a ∶ A x ] P x a ∥ →
∥ Σ[ g ∶ Π[ x ∶ X ] A x ] Π[ x ∶ X ] P x (g x) ∥
Lemma3/9/1 : (P : 𝒰 i) → ⦃ hlevel 1 P ⦄ → P ≃ ∥ P ∥
Lemma3/9/1 P = let open Iso in iso→eqv λ where
.f → ∣_∣ ; .g → ∥-rec id ; .η _ → refl ; .ε _ → center
-- Principle of unique choice
Corollary3/9/2 : {A : 𝒰 i} {P : A → 𝒰 i} → ⦃ {x : A} → hlevel 1 (P x) ⦄ →
((x : A) → ∥ P x ∥) → (x : A) → P x
Corollary3/9/2 {P = P} f = ∥-rec id ∘ f
|
source/nodes/program-nodes-interface_types.ads | optikos/oasis | 0 | 9282 | <filename>source/nodes/program-nodes-interface_types.ads<gh_stars>0
-- Copyright (c) 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Expressions;
with Program.Elements.Interface_Types;
with Program.Element_Visitors;
package Program.Nodes.Interface_Types is
pragma Preelaborate;
type Interface_Type is
new Program.Nodes.Node and Program.Elements.Interface_Types.Interface_Type
and Program.Elements.Interface_Types.Interface_Type_Text
with private;
function Create
(Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
Task_Token : Program.Lexical_Elements.Lexical_Element_Access;
Protected_Token : Program.Lexical_Elements.Lexical_Element_Access;
Synchronized_Token : Program.Lexical_Elements.Lexical_Element_Access;
Interface_Token : Program.Lexical_Elements.Lexical_Element_Access;
And_Token : Program.Lexical_Elements.Lexical_Element_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access)
return Interface_Type;
type Implicit_Interface_Type is
new Program.Nodes.Node and Program.Elements.Interface_Types.Interface_Type
with private;
function Create
(Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False;
Has_Limited : Boolean := False;
Has_Task : Boolean := False;
Has_Protected : Boolean := False;
Has_Synchronized : Boolean := False)
return Implicit_Interface_Type
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Interface_Type is
abstract new Program.Nodes.Node
and Program.Elements.Interface_Types.Interface_Type
with record
Progenitors : Program.Elements.Expressions.Expression_Vector_Access;
end record;
procedure Initialize (Self : aliased in out Base_Interface_Type'Class);
overriding procedure Visit
(Self : not null access Base_Interface_Type;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Progenitors
(Self : Base_Interface_Type)
return Program.Elements.Expressions.Expression_Vector_Access;
overriding function Is_Interface_Type_Element
(Self : Base_Interface_Type)
return Boolean;
overriding function Is_Type_Definition_Element
(Self : Base_Interface_Type)
return Boolean;
overriding function Is_Definition_Element
(Self : Base_Interface_Type)
return Boolean;
type Interface_Type is
new Base_Interface_Type
and Program.Elements.Interface_Types.Interface_Type_Text
with record
Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
Task_Token : Program.Lexical_Elements.Lexical_Element_Access;
Protected_Token : Program.Lexical_Elements.Lexical_Element_Access;
Synchronized_Token : Program.Lexical_Elements.Lexical_Element_Access;
Interface_Token : Program.Lexical_Elements.Lexical_Element_Access;
And_Token : Program.Lexical_Elements.Lexical_Element_Access;
end record;
overriding function To_Interface_Type_Text
(Self : aliased in out Interface_Type)
return Program.Elements.Interface_Types.Interface_Type_Text_Access;
overriding function Limited_Token
(Self : Interface_Type)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Task_Token
(Self : Interface_Type)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Protected_Token
(Self : Interface_Type)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Synchronized_Token
(Self : Interface_Type)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Interface_Token
(Self : Interface_Type)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function And_Token
(Self : Interface_Type)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Has_Limited (Self : Interface_Type) return Boolean;
overriding function Has_Task (Self : Interface_Type) return Boolean;
overriding function Has_Protected (Self : Interface_Type) return Boolean;
overriding function Has_Synchronized (Self : Interface_Type) return Boolean;
type Implicit_Interface_Type is
new Base_Interface_Type
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
Has_Limited : Boolean;
Has_Task : Boolean;
Has_Protected : Boolean;
Has_Synchronized : Boolean;
end record;
overriding function To_Interface_Type_Text
(Self : aliased in out Implicit_Interface_Type)
return Program.Elements.Interface_Types.Interface_Type_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Interface_Type)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Interface_Type)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Interface_Type)
return Boolean;
overriding function Has_Limited
(Self : Implicit_Interface_Type)
return Boolean;
overriding function Has_Task
(Self : Implicit_Interface_Type)
return Boolean;
overriding function Has_Protected
(Self : Implicit_Interface_Type)
return Boolean;
overriding function Has_Synchronized
(Self : Implicit_Interface_Type)
return Boolean;
end Program.Nodes.Interface_Types;
|
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/フランス_NES/N_F_asm/zel_rmdt09.asm | prismotizm/gigaleak | 0 | 20808 | Name: zel_rmdt09.asm
Type: file
Size: 172147
Last-Modified: '2016-05-13T04:22:15Z'
SHA-1: 8D4C35677AC1F9EAABEEDDCE8B9DF9C00AF150E9
Description: null
|
bootloader.asm | alexbelm48/AtieDOS | 33 | 240833 | <reponame>alexbelm48/AtieDOS
; AtieDOS 2.10 Bootloader
; Copyright (c) 2020 AtieSoftware & midn.
; See LICENSE in root folder
[bits 16] ; we tell to the compiler (NASM) that we're in 16 bit mode
[org 0x7c00]
jmp 0x00:start ; Sets cs to 0.
start:
xor ax, ax ; "XORing" the same register/segment/pointer sets that register/segment/pointer to 0, to we set ax as 0.
mov es, ax ; we set ES to 0, because AX has the same value
mov ds, ax ; set ds to 0
mov ss, ax ; set ss to 0
mov bp, 0x7c00 ; Right before the bootloader.
mov sp, bp ; we set sp to 0x7C00
; dl is given by the BIOS.
mov bx, 0x7e00 ; we're moving to BX where we want to code jumps
mov dh, (KERNEL_END - KERNEL_START + 511) / 512 ; calculating how many sectors we need
call disk_load ; calls DISK_LOAD subroutine
mov ax, 0x7e00 ; if everyting went ok in DISK_LOAD, we set ax to 0x7e00
jmp ax ; and we jump there
disk_load:
pusha ; pushes all general registers
push dx ; and also dx
mov si, 8 ; number of tries
mov al, dh ; remember that calculation we made in DH? now we're moving the value of DH to AL, to compare it later
.try:
mov ah, 0 ; ah = 0: reset disk
int 13h ; interrupt to do that
mov ah, 0x02 ; ah = 2: read sectors
mov cx, 0x02
mov ch, 0x00
mov dh, 0x00
int 13h ; interrupt to do that
jnc .itworked ; if there was an error, int 13h sets carry flag. But if int 13h didnt set carry flag, this means that everything went ok
dec si ; remember when we set the number of tries? now we decrease si, that means, SI = SI - 1 or SI -= 1
jnz .try ; if si isnt 0, we try again to read the disk
jmp disk_error ; if si is zero, we jump to DISK_ERROR
.itworked:
pop dx ; remember we push dx? now we pop it
cmp al, dh ; remember we set al as dh to compare it later? now we compare it
jne sectors_error ; if they are not the same, there was a error with the sectors and we jump to SECTORS_ERROR
popa ; remember we pusha? now we popa
ret ; we return to the moment we've call disk_load
disk_error: ; if there was a disk error, code ends here
mov bx, BOOTLOADER_DISK_ERROR_MSG ; we move BOOTLOADER_DISK_ERROR_MSG to bx to print it
call bootloader_print ; using bootloader_print.
call bootloader_nl ; bootloader_nl prints a new line.
mov dh, ah ; we set DH as AH to print it as hex
call bootloader_phex ; calling this functions to see where's the error.
jmp disk_loop ; we jump to the label "disk_loop"
sectors_error: ; if there was a sectors error, code goes here.
mov bx, BOOTLOADER_SECTORS_ERROR_MSG ; we move to bx this
call bootloader_print ; to print it with this.
disk_loop:
jmp disk_loop ; this is to hang
bootloader_print: ; this prints strings
pusha ; we push all registers
.r: ; while loop that ends when a string ends with ,0
mov al, [bx] ; moves to al the string in bx
cmp al, 0 ; if there's a 0
je .d ; printing ends
mov ah, 0x0e ; we tell to int 10h that we want to print chars
int 10h ; video interrupt
add bx, 1 ; add to bx 1, this means we're reading next char
jmp .r ; jmp to .r label
.d: ; printing ends
popa ; we "pusha", so now we "popa"
ret ; go back to the moment we've called bootloader_print
bootloader_phex:
pusha
mov cx, 0
.r:
cmp cx, 4
je .d
mov ax, dx
and ax, 0x000f
add al, 0x30
cmp al, 0x30
jle .n
add al, 7
.n:
mov bx, BOOTLOADER_HEX_OUT
sub bx, cx
mov [bx], al
ror dx, 4
add cx, 1
jmp .r
.d:
mov bx, BOOTLOADER_HEX_OUT
call bootloader_print
popa
ret
bootloader_nl:
pusha
mov ah, 0x0e
mov al, 0x0a
int 10h
mov al, 0x0d
int 10h
popa
ret
; strings
BOOTLOADER_HEX_OUT: db "0x0000", 0
BOOTLOADER_DISK_ERROR_MSG: db "Disk read error", 0
BOOTLOADER_SECTORS_ERROR_MSG: db "Sectors read error", 0
; a bootloader's size is exactly 512 bytes, so we convert all this code to 510 bytes of compiled code
times 510 - ($ - $$) db 0
dw 0xaa55 ; why 510 and not 512 bytes? we need 2 bytes to put this "magic number", that tells to the BIOS
; we're bootable
KERNEL_START: ; remember we did "mov ax, 0x7e00" and then "jmp ax"? 0x7e00 is here
%include "kernel.asm"
times (512 - (($ - $$ + 0x7c00) & 511) + 1) / 2 dw 0xad21 ; 0xad21: AtieDOS 2.10
; ^ magic padding
KERNEL_END: |
tools-src/gnu/gcc/gcc/ada/s-imgenu.ads | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 1904 | <reponame>enfoTek/tomato.linksys.e2000.nvram-mod
------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- S Y S T E M . I M G _ E N U M --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 2000 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Enumeration_Type'Image for all enumeration types except those in package
-- Standard (where we have no opportunity to build image tables), and in
-- package System (where it is too early to start building image tables).
-- Special routines exist for the enumeration routines in these packages.
package System.Img_Enum is
pragma Pure (Img_Enum);
function Image_Enumeration_8
(Pos : Natural;
Names : String;
Indexes : System.Address)
return String;
-- Used to compute Enum'Image (Str) where Enum is some enumeration type
-- other than those defined in package Standard. Names is a string with
-- a lower bound of 1 containing the characters of all the enumeration
-- literals concatenated together in sequence. Indexes is the address
-- of an array of type array (0 .. N) of Natural_8, where N is the
-- is the number of enumeration literals in the type. The Indexes values
-- are the starting subscript of each enumeration literal, indexed by Pos
-- values, with an extra entry at the end containing Names'Length + 1.
-- The reason that Indexes is passed by address is that the actual type
-- is created on the fly by the expander. The value returned is the
-- desired 'Image value.
function Image_Enumeration_16
(Pos : Natural;
Names : String;
Indexes : System.Address)
return String;
-- Identical to Image_Enumeration_8 except that it handles types
-- using array (0 .. Num) of Natural_16 for the Indexes table.
function Image_Enumeration_32
(Pos : Natural;
Names : String;
Indexes : System.Address)
return String;
-- Identical to Image_Enumeration_8 except that it handles types
-- using array (0 .. Num) of Natural_32 for the Indexes table.
end System.Img_Enum;
|
_incObj/16 Harpoon.asm | kodishmediacenter/msu-md-sonic | 9 | 242602 | <filename>_incObj/16 Harpoon.asm
; ---------------------------------------------------------------------------
; Object 16 - harpoon (LZ)
; ---------------------------------------------------------------------------
Harpoon:
moveq #0,d0
move.b obRoutine(a0),d0
move.w Harp_Index(pc,d0.w),d1
jmp Harp_Index(pc,d1.w)
; ===========================================================================
Harp_Index: dc.w Harp_Main-Harp_Index
dc.w Harp_Move-Harp_Index
dc.w Harp_Wait-Harp_Index
harp_time: equ $30 ; time between stabbing/retracting
; ===========================================================================
Harp_Main: ; Routine 0
addq.b #2,obRoutine(a0)
move.l #Map_Harp,obMap(a0)
move.w #$3CC,obGfx(a0)
ori.b #4,obRender(a0)
move.b #4,obPriority(a0)
move.b obSubtype(a0),obAnim(a0) ; get type (vert/horiz)
move.b #$14,obActWid(a0)
move.w #60,harp_time(a0) ; set time to 1 second
Harp_Move: ; Routine 2
lea (Ani_Harp).l,a1
bsr.w AnimateSprite
moveq #0,d0
move.b obFrame(a0),d0 ; get frame number
move.b @types(pc,d0.w),obColType(a0) ; get collision type
bra.w RememberState
@types:
dc.b $9B, $9C, $9D, $9E, $9F, $A0
even
Harp_Wait: ; Routine 4
subq.w #1,harp_time(a0) ; decrement timer
bpl.s @chkdel ; branch if time remains
move.w #60,harp_time(a0) ; reset timer
subq.b #2,obRoutine(a0) ; run "Harp_Move" subroutine
bchg #0,obAnim(a0) ; reverse animation
@chkdel:
bra.w RememberState |
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2473.asm | ljhsiun2/medusa | 9 | 242844 | <filename>Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2473.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r15
push %r8
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0xd607, %rsi
lea addresses_UC_ht+0x16f27, %rdi
clflush (%rsi)
nop
nop
nop
xor $59533, %r11
mov $29, %rcx
rep movsw
nop
nop
nop
nop
nop
add %r11, %r11
lea addresses_A_ht+0x9b17, %r15
cmp %r8, %r8
movb $0x61, (%r15)
nop
nop
xor $60730, %r15
lea addresses_A_ht+0x180c7, %r8
nop
nop
and %r14, %r14
movw $0x6162, (%r8)
nop
nop
nop
nop
nop
cmp $1741, %rsi
lea addresses_UC_ht+0x37f, %r8
and %rsi, %rsi
movb (%r8), %r15b
nop
nop
nop
nop
and %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %rax
push %rbx
push %rsi
// Faulty Load
lea addresses_WC+0x68c7, %rsi
nop
nop
nop
nop
sub %rax, %rax
movb (%rsi), %r10b
lea oracles, %rsi
and $0xff, %r10
shlq $12, %r10
mov (%rsi,%r10,1), %r10
pop %rsi
pop %rbx
pop %rax
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WC', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_WC', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
|
antlr/QueryLanguageGrammar.g4 | SmirnovOleg/formal-languages | 0 | 850 | <reponame>SmirnovOleg/formal-languages<gh_stars>0
grammar QueryLanguageGrammar;
script: (stmt ';')* EOF ;
stmt
: CONNECT '"' PATH '"'
| PRODUCTION variable TO pattern
| SELECT objective FROM graph
;
graph
: '(' graph ')'
| NAME '"' STRING '"'
| QUERY GRAMMAR
| QUERY '[' pattern ']'
| SET_START_AND_FINAL '(' vertices ',' vertices ',' graph ')'
| graph INTERSECT graph
;
vertices
: '(' vertices ')'
| '{' seq '}'
| RANGE '(' INT ';' INT ')'
| NONE
;
seq: (INT ',')* INT ;
objective
: '(' objective ')'
| edges
| COUNT edges
;
edges
: '(' edges ')'
| EDGES
| FILTER '(' predicate ',' edges ')'
;
predicate: '(' STRING ',' STRING ',' STRING ')' SATISFY bool_expr ;
bool_expr
: '(' bool_expr ')'
| STRING HAS_LABEL '"' STRING '"'
| IS_START STRING
| IS_FINAL STRING
| NOT bool_expr
| bool_expr AND bool_expr
| bool_expr OR bool_expr
;
pattern
: EPS
| terminal
| variable
| '(' pattern ')'
| '(' pattern ')' STAR
| '(' pattern ')' PLUS
| '(' pattern ')' OPTION
| pattern CONCAT pattern
| pattern ALT pattern
;
terminal: TERM '(' STRING ')' ;
variable: VAR '(' STRING ')' ;
CONNECT: 'connect' ;
PRODUCTION: 'production' ;
SELECT: 'select' ;
FROM: 'from';
SET_START_AND_FINAL: 'set_start_and_final' ;
NAME: 'name' ;
QUERY: 'query' ;
GRAMMAR: 'grammar' ;
INTERSECT: 'intersect' ;
TO: 'to' ;
RANGE: 'range' ;
NONE: 'none' ;
COUNT: 'count' ;
EDGES: 'edges' ;
FILTER: 'filter' ;
SATISFY: '->' | 'satisfy' ;
HAS_LABEL: 'has_label' ;
IS_START: 'is_start' ;
IS_FINAL: 'is_final' ;
VAR: 'var' ;
TERM: 'term' ;
STAR: '*' ;
PLUS: '+' ;
OPTION: '?' ;
ALT: '|' | 'alt' ;
CONCAT: '.' | 'concat' ;
NOT: 'not' | '!' ;
AND: 'and' | '&&' ;
OR: 'or' | '||' ;
EPS: 'eps' ;
fragment LOWERCASE : [a-z] ;
fragment UPPERCASE : [A-Z] ;
fragment DIGIT : [0-9] ;
INT: '0' | [1-9] DIGIT* ;
STRING: ('_' | '.' | LOWERCASE | UPPERCASE) ('_' | '.' | LOWERCASE | UPPERCASE | DIGIT)* ;
PATH: ('/' | '_' | '.' | LOWERCASE | UPPERCASE | DIGIT)+ ;
WS : [ \t\r\n]+ -> skip ; |
tools/scitools/conf/understand/ada/ada05/s-fileio.ads | brucegua/moocos | 1 | 28480 | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . F I L E _ I O --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
--
--
--
--
--
--
--
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides support for the routines described in (RM A.8.2)
-- which are common to Text_IO, Direct_IO, Sequential_IO and Stream_IO.
with Interfaces.C_Streams;
with System.File_Control_Block;
package System.File_IO is
package FCB renames System.File_Control_Block;
package ICS renames Interfaces.C_Streams;
---------------------
-- File Management --
---------------------
procedure Open
(File_Ptr : in out FCB.AFCB_Ptr;
Dummy_FCB : FCB.AFCB'Class;
Mode : FCB.File_Mode;
Name : String;
Form : String;
Amethod : Character;
Creat : Boolean;
Text : Boolean;
C_Stream : ICS.FILEs := ICS.NULL_Stream);
-- This routine is used for both Open and Create calls:
--
-- File_Ptr is the file type, which must be null on entry
-- (i.e. the file must be closed before the call).
--
-- Dummy_FCB is a default initialized file control block of appropriate
-- type. Note that the tag of this record indicates the type and length
-- of the control block. This control block is used only for the purpose
-- of providing the controlling argument for calling the write version
-- of Allocate_AFCB. It has no other purpose, and its fields are never
-- read or written.
--
-- Mode is the required mode
--
-- Name is the file name, with a null string indicating that a temporary
-- file is to be created (only permitted in create mode, not open mode)
--
-- Creat is True for a create call, and false for an open call
--
-- Text is set True to open the file in text mode (w+t or r+t) instead
-- of the usual binary mode open (w+b or r+b).
--
-- Form is the form string given in the open or create call, this is
-- stored in the AFCB, but otherwise is not used by this or any other
-- routine in this unit (except Form which retrieves the original value)
--
-- Amethod indicates the access method
--
-- D = Direct_IO
-- Q = Sequential_IO
-- S = Stream_IO
-- T = Text_IO
-- W = Wide_Text_IO
--
-- C_Stream is left at its default value for the normal case of an
-- Open or Create call as defined in the RM. The only time this is
-- non-null is for the Open call from Ada.xxx_IO.C_Streams.Open.
--
-- On return, if the open/create succeeds, then the fields of File are
-- filled in, and this value is copied to the heap. File_Ptr points to
-- this allocated file control block. If the open/create fails, then the
-- fields of File are undefined, and File_Ptr is unchanged.
procedure Close (File : in out FCB.AFCB_Ptr);
-- The file is closed, all storage associated with it is released, and
-- File is set to null. Note that this routine calls AFCB_Close to perform
-- any specialized close actions, then closes the file at the system level,
-- then frees the mode and form strings, and finally calls AFCB_Free to
-- free the file control block itself, setting File to null.
procedure Delete (File : in out FCB.AFCB_Ptr);
-- The indicated file is unlinked
procedure Reset (File : in out FCB.AFCB_Ptr; Mode : FCB.File_Mode);
-- The file is reset, and the mode changed as indicated
procedure Reset (File : in out FCB.AFCB_Ptr);
-- The files is reset, and the mode is unchanged
function Mode (File : FCB.AFCB_Ptr) return FCB.File_Mode;
-- Returns the mode as supplied by create, open or reset
function Name (File : FCB.AFCB_Ptr) return String;
-- Returns the file name as supplied by Open or Create. Raises Use_Error
-- if used with temporary files or standard files.
function Form (File : FCB.AFCB_Ptr) return String;
-- Returns the form as supplied by create, open or reset
-- The string is normalized to all lower case letters.
function Is_Open (File : FCB.AFCB_Ptr) return Boolean;
-- Determines if file is open or not
----------------------
-- Utility Routines --
----------------------
-- Some internal routines not defined in A.8.2. These are routines which
-- provide required common functionality shared by separate packages.
procedure Chain_File (File : FCB.AFCB_Ptr);
-- Used to chain the given file into the list of open files. Normally this
-- is done implicitly by Open. Chain_File is used for the special cases of
-- the system files defined by Text_IO (stdin, stdout, stderr) which are
-- not opened in the normal manner. Note that the caller is responsible
-- for task lock out to protect the global data structures if this is
-- necessary (it is needed for the calls from within this unit itself,
-- but not required for the calls from Text_IO and Wide_Text_IO that
-- are made during elaboration of the environment task).
procedure Check_File_Open (File : FCB.AFCB_Ptr);
-- If the current file is not open, then Status_Error is raised.
-- Otherwise control returns normally (with File pointing to the
-- control block for the open file.
procedure Check_Read_Status (File : FCB.AFCB_Ptr);
-- If the current file is not open, then Status_Error is raised. If
-- the file is open, then the mode is checked to ensure that reading
-- is permitted, and if not Mode_Error is raised, otherwise control
-- returns normally.
procedure Check_Write_Status (File : FCB.AFCB_Ptr);
-- If the current file is not open, then Status_Error is raised. If
-- the file is open, then the mode is checked to ensure that writing
-- is permitted, and if not Mode_Error is raised, otherwise control
-- returns normally.
function End_Of_File (File : FCB.AFCB_Ptr) return Boolean;
-- File must be opened in read mode. True is returned if the stream is
-- currently positioned at the end of file, otherwise False is returned.
-- The position of the stream is not affected.
procedure Flush (File : FCB.AFCB_Ptr);
-- Flushes the stream associated with the given file. The file must be
-- open and in write mode (if not, an appropriate exception is raised)
function Form_Boolean
(Form : String;
Keyword : String;
Default : Boolean)
return Boolean;
-- Searches form string for an entry of the form Keyword=xx where xx is
-- either Yes/No or y/n. Returns True if Yes or Y is found, False if No
-- or N is found. If the keyword parameter is not found, returns the
-- value given as Default. May raise Use_Error if a form string syntax
-- error is detected. Keyword and Form must be in lower case.
function Form_Integer
(Form : String;
Keyword : String;
Default : Integer)
return Integer;
-- Searches form string for an entry of the form Keyword=xx where xx is
-- an unsigned decimal integer in the range 0 to 999_999. Returns this
-- integer value if it is found. If the keyword parameter is not found,
-- returns the value given as Default. Raise Use_Error if a form string
-- syntax error is detected. Keyword and Form must be in lower case.
procedure Form_Parameter
(Form : String;
Keyword : String;
Start : out Natural;
Stop : out Natural);
-- Searches form string for an entry of the form Keyword=xx and if found
-- Sets Start and Stop to the first and last characters of xx. Keyword
-- and Form must be in lower case. If no entry matches, then Start and
-- Stop are set to zero on return. Use_Error is raised if a malformed
-- string is detected, but there is no guarantee of full syntax checking.
procedure Read_Buf
(File : FCB.AFCB_Ptr;
Buf : Address;
Siz : Interfaces.C_Streams.size_t);
-- Reads Siz bytes from File.Stream into Buf. The caller has checked
-- that the file is open in read mode. Raises an exception if Siz bytes
-- cannot be read (End_Error if no data was read, Data_Error if a partial
-- buffer was read, Device_Error if an error occurs).
procedure Read_Buf
(File : FCB.AFCB_Ptr;
Buf : Address;
Siz : Interfaces.C_Streams.size_t;
Count : out Interfaces.C_Streams.size_t);
-- Reads Siz bytes from File.Stream into Buf. The caller has checked
-- that the file is open in read mode. Device Error is raised if an error
-- occurs. Count is the actual number of bytes read, which may be less
-- than Siz if the end of file is encountered.
procedure Append_Set (File : FCB.AFCB_Ptr);
-- If the mode of the file is Append_File, then the file is positioned
-- at the end of file using fseek, otherwise this call has no effect.
procedure Write_Buf
(File : FCB.AFCB_Ptr;
Buf : Address;
Siz : Interfaces.C_Streams.size_t);
-- Writes size_t bytes to File.Stream from Buf. The caller has checked
-- that the file is open in write mode. Raises Device_Error if the
-- complete buffer cannot be written.
procedure Make_Unbuffered (File : FCB.AFCB_Ptr);
procedure Make_Line_Buffered
(File : FCB.AFCB_Ptr;
Line_Siz : Interfaces.C_Streams.size_t);
procedure Make_Buffered
(File : FCB.AFCB_Ptr;
Buf_Siz : Interfaces.C_Streams.size_t);
private
pragma Inline (Check_Read_Status);
pragma Inline (Check_Write_Status);
pragma Inline (Mode);
end System.File_IO;
|
src/LibraBFT/Concrete/Properties/Common.agda | LaudateCorpus1/bft-consensus-agda | 0 | 9440 | <filename>src/LibraBFT/Concrete/Properties/Common.agda
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2021, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
open import LibraBFT.ImplShared.Base.Types
open import LibraBFT.Abstract.Types.EpochConfig UID NodeId
open EpochConfig
open import LibraBFT.Concrete.System
open import LibraBFT.Concrete.System.Parameters
open import LibraBFT.ImplShared.Consensus.Types
open import LibraBFT.ImplShared.Util.Crypto
open import Optics.All
open import Util.Hash
open import Util.KVMap
open import Util.PKCS
open import Util.Prelude
open import Yasm.Base
-- This module contains definitions and proofs used by both the VotesOnce and PreferredRoundRule
-- proofs.
module LibraBFT.Concrete.Properties.Common (iiah : SystemInitAndHandlers ℓ-RoundManager ConcSysParms) (𝓔 : EpochConfig) where
open SystemTypeParameters ConcSysParms
open SystemInitAndHandlers iiah
open ParamsWithInitAndHandlers iiah
open import LibraBFT.ImplShared.Util.HashCollisions iiah
open import Yasm.Yasm ℓ-RoundManager ℓ-VSFP ConcSysParms iiah PeerCanSignForPK PeerCanSignForPK-stable
record VoteForRound∈ (pk : PK)(round : ℕ)(epoch : ℕ)(bId : HashValue)(pool : SentMessages) : Set where
constructor mkVoteForRound∈
field
msgWhole : NetworkMsg
msgVote : Vote
msg⊆ : msgVote ⊂Msg msgWhole
msgSender : ℕ
msg∈pool : (msgSender , msgWhole) ∈ pool
msgSigned : WithVerSig pk msgVote
msgEpoch≡ : msgVote ^∙ vEpoch ≡ epoch
msgRound≡ : msgVote ^∙ vRound ≡ round
msgBId≡ : msgVote ^∙ vProposedId ≡ bId
open VoteForRound∈ public
ImplObl-bootstrapVotesRound≡0 : Set
ImplObl-bootstrapVotesRound≡0 = ∀ {pk v}
→ (wvs : WithVerSig pk v)
→ ∈BootstrapInfo bootstrapInfo (ver-signature wvs)
→ v ^∙ vRound ≡ 0
ImplObl-bootstrapVotesConsistent : Set
ImplObl-bootstrapVotesConsistent = (v1 v2 : Vote)
→ ∈BootstrapInfo bootstrapInfo (_vSignature v1) → ∈BootstrapInfo bootstrapInfo (_vSignature v2)
→ v1 ^∙ vProposedId ≡ v2 ^∙ vProposedId
ImplObl-NewVoteRound≢0 : Set (ℓ+1 ℓ-RoundManager)
ImplObl-NewVoteRound≢0 =
∀{pid s' outs pk}{pre : SystemState}
→ ReachableSystemState pre
-- For any honest call to /handle/ or /init/,
→ (sps : StepPeerState pid (msgPool pre) (initialised pre) (peerStates pre pid) (s' , outs))
→ ∀{v m} → Meta-Honest-PK pk
-- For signed every vote v of every outputted message
→ v ⊂Msg m → send m ∈ outs
→ (wvs : WithVerSig pk v)
→ (¬ ∈BootstrapInfo bootstrapInfo (ver-signature wvs))
→ v ^∙ vRound ≢ 0
IncreasingRoundObligation : Set (ℓ+1 ℓ-RoundManager)
IncreasingRoundObligation =
∀{pid pid' s' outs pk}{pre : SystemState}
→ ReachableSystemState pre
-- For any honest call to /handle/ or /init/,
→ (sps : StepPeerState pid (msgPool pre) (initialised pre) (peerStates pre pid) (s' , outs))
→ ∀{v m v' m'} → Meta-Honest-PK pk
-- For signed every vote v of every outputted message
→ v ⊂Msg m → send m ∈ outs
→ (sig : WithVerSig pk v) → ¬ (∈BootstrapInfo bootstrapInfo (ver-signature sig))
→ ¬ (MsgWithSig∈ pk (ver-signature sig) (msgPool pre))
→ PeerCanSignForPK (StepPeer-post {pre = pre} (step-honest sps)) v pid pk
-- And if there exists another v' that has been sent before
→ v' ⊂Msg m' → (pid' , m') ∈ (msgPool pre)
→ (sig' : WithVerSig pk v') → ¬ (∈BootstrapInfo bootstrapInfo (ver-signature sig'))
-- If v and v' share the same epoch
→ v ^∙ vEpoch ≡ v' ^∙ vEpoch
→ v' ^∙ vRound < v ^∙ vRound
⊎ VoteForRound∈ pk (v ^∙ vRound) (v ^∙ vEpoch) (v ^∙ vProposedId) (msgPool pre)
module ConcreteCommonProperties
(st : SystemState)
(r : ReachableSystemState st)
(sps-corr : StepPeerState-AllValidParts)
(Impl-bsvr : ImplObl-bootstrapVotesRound≡0)
(Impl-nvr≢0 : ImplObl-NewVoteRound≢0)
where
open Structural sps-corr
open PerReachableState r
msgSentB4⇒VoteRound∈ : ∀ {v pk pool}
→ (vv : WithVerSig pk v)
→ (m : MsgWithSig∈ pk (ver-signature vv) pool)
→ Σ (VoteForRound∈ pk (v ^∙ vRound) (v ^∙ vEpoch) (v ^∙ vProposedId) pool)
(λ v4r → ver-signature (msgSigned v4r) ≡ ver-signature vv)
msgSentB4⇒VoteRound∈ {v} vv m
with sameSig⇒sameVoteDataNoCol (msgSigned m) vv (msgSameSig m)
...| refl = mkVoteForRound∈ (msgWhole m) (msgPart m) (msg⊆ m) (msgSender m)
(msg∈pool m) (msgSigned m) refl refl refl , msgSameSig m
VoteRound∈⇒msgSent : ∀ {round eid bid pk pool}
→ (v4r : VoteForRound∈ pk round eid bid pool)
→ Σ (MsgWithSig∈ pk (ver-signature $ msgSigned v4r) pool)
(λ mws → ( ver-signature (msgSigned mws) ≡ ver-signature (msgSigned v4r)
× (msgPart mws) ^∙ vRound ≡ round))
VoteRound∈⇒msgSent (mkVoteForRound∈ msgWhole₁ msgVote₁ msg⊆₁ msgSender₁ msg∈pool₁ msgSigned₁ msgEpoch≡₁ msgRound≡₁ msgBId≡₁)
= mkMsgWithSig∈ msgWhole₁ msgVote₁ msg⊆₁ msgSender₁ msg∈pool₁ msgSigned₁ refl , refl , msgRound≡₁
-- If a Vote signed for an honest PK has been sent, and it is not in bootstrapInfo, then
-- it is for a round > 0
NewVoteRound≢0 : ∀ {pk round epoch bId} {st : SystemState}
→ ReachableSystemState st
→ Meta-Honest-PK pk
→ (v : VoteForRound∈ pk round epoch bId (msgPool st))
→ ¬ ∈BootstrapInfo bootstrapInfo (ver-signature (msgSigned v))
→ round ≢ 0
NewVoteRound≢0 (step-s r (step-peer (step-honest stP))) pkH v ¬bootstrap r≡0
with msgRound≡ v
...| refl
with newMsg⊎msgSentB4 r stP pkH (msgSigned v) ¬bootstrap (msg⊆ v) (msg∈pool v)
...| Left (m∈outs , _ , _) = ⊥-elim (Impl-nvr≢0 r stP pkH (msg⊆ v) m∈outs
(msgSigned v) ¬bootstrap r≡0)
...| Right m
with msgSameSig m
...| refl
with sameSig⇒sameVoteDataNoCol (msgSigned m) (msgSigned v) (msgSameSig m)
...| refl = let vsb4 = mkVoteForRound∈ (msgWhole m) (msgPart m) (msg⊆ m) (msgSender m)
(msg∈pool m) (msgSigned m) refl refl refl
in ⊥-elim (NewVoteRound≢0 r pkH vsb4 ¬bootstrap r≡0)
NewVoteRound≢0 (step-s r (step-peer cheat@(step-cheat c))) pkH v ¬bootstrap r≡0
with ¬cheatForgeNewSig r cheat unit pkH (msgSigned v) (msg⊆ v) (msg∈pool v) ¬bootstrap
...| m
with msgSameSig m
...| refl
with sameSig⇒sameVoteDataNoCol (msgSigned m) (msgSigned v) (msgSameSig m)
...| refl = let vsb4 = mkVoteForRound∈ (msgWhole m) (msgPart m) (msg⊆ m) (msgSender m)
(msg∈pool m) (msgSigned m) refl refl refl
in ⊥-elim (NewVoteRound≢0 r pkH vsb4 ¬bootstrap (trans (msgRound≡ v) r≡0))
¬Bootstrap∧Round≡⇒¬Bootstrap : ∀ {v pk round epoch bId} {st : SystemState}
→ ReachableSystemState st
→ Meta-Honest-PK pk
→ (vfr : VoteForRound∈ pk round epoch bId (msgPool st))
→ ¬ (∈BootstrapInfo bootstrapInfo (ver-signature (msgSigned vfr)))
→ (sig : WithVerSig pk v)
→ v ^∙ vRound ≡ round
→ ¬ (∈BootstrapInfo bootstrapInfo (ver-signature sig))
¬Bootstrap∧Round≡⇒¬Bootstrap r pkH v₁ ¬bootstrapV₁ sigV₂ refl bootstrapV₂
= let v₁r≢0 = NewVoteRound≢0 r pkH v₁ ¬bootstrapV₁
in ⊥-elim (v₁r≢0 (Impl-bsvr sigV₂ bootstrapV₂))
|
oeis/120/A120157.asm | neoneye/loda-programs | 11 | 82103 | <filename>oeis/120/A120157.asm<gh_stars>10-100
; A120157: a(1)=13; a(n)=floor((39+sum(a(1) to a(n-1)))/3).
; 13,17,23,30,40,54,72,96,128,170,227,303,404,538,718,957,1276,1701,2268,3024,4032,5376,7168,9558,12744,16992,22656,30208,40277,53703,71604,95472,127296,169728,226304,301738,402318,536424,715232,953642,1271523,1695364,2260485,3013980,4018640,5358187,7144249,9525666,12700888,16934517,22579356,30105808,40141077,53521436,71361915,95149220,126865627,169154169,225538892,300718523,400958030,534610707,712814276,950419035,1267225380,1689633840,2252845120,3003793493,4005057991,5340077321,7120103095
add $0,1
mov $1,11
mov $2,2
lpb $0
sub $0,1
add $2,$1
mov $1,8
add $1,$2
div $1,3
add $2,6
lpe
add $1,6
mov $0,$1
|
src/ado-sequences.ads | Letractively/ada-ado | 0 | 9603 | <filename>src/ado-sequences.ads<gh_stars>0
-----------------------------------------------------------------------
-- ADO Sequences -- Database sequence generator
-- Copyright (C) 2009, 2010, 2011, 2012 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Finalization;
with Ada.Strings.Unbounded.Hash;
with Ada.Containers.Hashed_Maps;
with ADO.Sessions;
with ADO.Objects;
limited with ADO.Sessions.Factory;
-- The sequence generator is responsible for creating unique ID's
-- across all database objects.
--
-- Each table can be associated with a sequence generator.
-- The sequence factory is shared by several sessions and the
-- implementation is thread-safe.
--
-- The HiLoGenerator implements a simple High Low sequence generator
-- by using sequences that avoid to access the database.
--
-- Example:
--
-- F : Factory;
-- Id : Identifier;
--
-- Allocate (Manager => F, Name => "user", Id => Id);
--
package ADO.Sequences is
type Session_Factory_Access is access all ADO.Sessions.Factory.Session_Factory'Class;
-- ------------------------------
-- Abstract sequence generator
-- ------------------------------
type Generator is abstract new Ada.Finalization.Limited_Controlled with private;
type Generator_Access is access all Generator'Class;
-- Get the name of the sequence.
function Get_Sequence_Name (Gen : in Generator'Class) return String;
-- Allocate an identifier using the generator.
procedure Allocate (Gen : in out Generator;
Id : in out Objects.Object_Record'Class) is abstract;
-- Get a session to connect to the database.
function Get_Session (Gen : in Generator) return ADO.Sessions.Master_Session'Class;
type Generator_Factory is access
function (Sess_Factory : in Session_Factory_Access)
return Generator_Access;
-- ------------------------------
-- Sequence factory
-- ------------------------------
-- The sequence <b>Factory</b> allocates unique ids for new objects.
-- The factory is shared by all connections to the same database.
type Factory is limited private;
type Factory_Access is access all Factory;
-- Allocate a unique identifier for the given sequence.
procedure Allocate (Manager : in out Factory;
Id : in out Objects.Object_Record'Class);
-- Set a generator to be used for the given sequence.
procedure Set_Generator (Manager : in out Factory;
Name : in String;
Gen : in Generator_Access);
-- Set the default factory for creating generators.
-- The default factory is the HiLo generator.
procedure Set_Default_Generator
(Manager : in out Factory;
Factory : in Generator_Factory;
Sess_Factory : in Session_Factory_Access);
private
use Ada.Strings.Unbounded;
type Generator is abstract new Ada.Finalization.Limited_Controlled with record
Name : Unbounded_String;
Factory : Session_Factory_Access;
end record;
-- Each sequence generator is accessed through a protected type
-- to make sure the allocation is unique and works in multi-threaded
-- environments.
protected type Sequence_Generator is
-- Allocate a unique identifier for the given sequence.
procedure Allocate (Id : in out Objects.Object_Record'Class);
procedure Set_Generator (Name : in Unbounded_String;
Gen : in Generator_Access);
-- Free the generator
procedure Clear;
private
Generator : Generator_Access;
end Sequence_Generator;
type Sequence_Generator_Access is access all Sequence_Generator;
-- Map to keep track of allocation generators for each sequence.
package Sequence_Maps is new Ada.Containers.Hashed_Maps
(Key_Type => Unbounded_String,
Element_Type => Sequence_Generator_Access,
Hash => Ada.Strings.Unbounded.Hash,
Equivalent_Keys => "=",
"=" => "=");
-- The sequence factory map is also accessed through a protected type.
protected type Factory_Map is
-- Get the sequence generator associated with the name.
-- If there is no such generator, an entry is created by using
-- the default generator.
procedure Get_Generator (Name : in Unbounded_String;
Gen : out Sequence_Generator_Access);
-- Set the sequence generator associated with the name.
procedure Set_Generator (Name : in Unbounded_String;
Gen : in Sequence_Generator_Access);
-- Set the default sequence generator.
procedure Set_Default_Generator
(Gen : in Generator_Factory;
Factory : in Session_Factory_Access);
-- Clear the factory map.
procedure Clear;
private
Map : Sequence_Maps.Map;
Create_Generator : Generator_Factory;
Sess_Factory : Session_Factory_Access;
end Factory_Map;
type Factory is new Ada.Finalization.Limited_Controlled with record
Map : Factory_Map;
end record;
overriding
procedure Finalize (Manager : in out Factory);
end ADO.Sequences;
|
oeis/028/A028095.asm | neoneye/loda-programs | 11 | 20492 | ; A028095: Expansion of 1/((1-3x)(1-7x)(1-9x)(1-12x)).
; Submitted by <NAME>
; 1,31,622,10294,153139,2133397,28467664,368853628,4681501957,58545953323,724357095826,8891996242402,108525576595255,1318871068893409,15976717061264308,193081291067943016
mov $1,1
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
seq $0,20972 ; Expansion of 1/((1-7*x)*(1-9*x)*(1-12*x)).
sub $0,$1
mul $1,4
add $1,$0
lpe
mov $0,$1
|
examples/testexpr.asm | NibNerd/asm85 | 3 | 82759 | LXI H, TAB2-1
nop
JMP EXEC
EXEC: nop
CHKIO: ret
TAB2: db 'abcd'
|
libsrc/_DEVELOPMENT/z80/z80/asm_z80_push_registers_8080.asm | teknoplop/z88dk | 0 | 243126 | <filename>libsrc/_DEVELOPMENT/z80/z80/asm_z80_push_registers_8080.asm
SECTION code_clib
SECTION code_z80
PUBLIC asm_z80_push_registers_8080
asm_z80_push_registers_8080:
; push the main registers onto the stack
; must be called
; exit : hl = return address
;
; uses : hl
ex (sp),hl
push af
push bc
push de
jp (hl)
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_427.asm | ljhsiun2/medusa | 9 | 240744 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_427.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xa3b1, %rdi
nop
nop
nop
nop
inc %rcx
vmovups (%rdi), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %rax
nop
and $32404, %r11
lea addresses_D_ht+0x40c1, %r14
nop
xor $57697, %rsi
mov $0x6162636465666768, %r8
movq %r8, %xmm4
movups %xmm4, (%r14)
nop
nop
nop
nop
dec %r8
lea addresses_normal_ht+0x10e29, %rdi
nop
nop
nop
add %r14, %r14
mov $0x6162636465666768, %rcx
movq %rcx, %xmm5
movups %xmm5, (%rdi)
nop
nop
nop
nop
cmp %r11, %r11
lea addresses_WC_ht+0x14af1, %rcx
nop
nop
xor %rsi, %rsi
movl $0x61626364, (%rcx)
nop
nop
nop
cmp %r8, %r8
lea addresses_D_ht+0x1dd47, %rsi
nop
nop
nop
nop
nop
add $30514, %rax
mov (%rsi), %r14d
cmp %rax, %rax
lea addresses_UC_ht+0x12471, %rsi
nop
add $41367, %rcx
mov (%rsi), %ax
nop
nop
nop
nop
nop
cmp %r14, %r14
lea addresses_D_ht+0x108f1, %rsi
lea addresses_UC_ht+0xe4b1, %rdi
nop
nop
nop
nop
inc %r9
mov $59, %rcx
rep movsl
and %r8, %r8
lea addresses_A_ht+0x42f1, %rsi
lea addresses_normal_ht+0x19bf1, %rdi
add $31819, %r8
mov $54, %rcx
rep movsq
nop
nop
nop
nop
cmp $59651, %r14
lea addresses_A_ht+0xd5f1, %rcx
nop
nop
cmp %rdi, %rdi
movw $0x6162, (%rcx)
nop
nop
inc %r11
lea addresses_normal_ht+0x16ff1, %r14
sub %r11, %r11
movl $0x61626364, (%r14)
nop
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_WC_ht+0x194f1, %r9
nop
nop
and $8676, %rax
movl $0x61626364, (%r9)
nop
nop
cmp %rdi, %rdi
lea addresses_WT_ht+0xa0f1, %rsi
lea addresses_A_ht+0x19445, %rdi
nop
sub $54805, %r11
mov $42, %rcx
rep movsl
nop
nop
nop
nop
xor $50286, %r11
lea addresses_WT_ht+0x1c351, %r8
nop
nop
nop
nop
nop
add %rsi, %rsi
mov (%r8), %r11d
nop
nop
nop
nop
nop
and $63484, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %r9
push %rax
push %rcx
push %rdi
push %rdx
// Load
lea addresses_US+0x1a8f1, %rax
clflush (%rax)
nop
nop
nop
xor $95, %rdx
movb (%rax), %cl
nop
nop
nop
xor $36872, %rax
// Load
lea addresses_PSE+0xe13f, %r9
clflush (%r9)
nop
nop
nop
nop
nop
xor %rcx, %rcx
vmovups (%r9), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %rdi
nop
dec %rdi
// Faulty Load
lea addresses_PSE+0x1e0f1, %r15
nop
nop
nop
nop
dec %rdx
vmovups (%r15), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $1, %xmm7, %r10
lea oracles, %rdi
and $0xff, %r10
shlq $12, %r10
mov (%rdi,%r10,1), %r10
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_PSE', 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_US', 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_PSE', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_PSE', 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_D_ht', 'congruent': 6}}
{'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_D_ht', 'congruent': 4}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_normal_ht', 'congruent': 2}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WC_ht', 'congruent': 7}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 4, 'type': 'addresses_D_ht', 'congruent': 1}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 2, 'type': 'addresses_UC_ht', 'congruent': 7}}
{'dst': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}}
{'dst': {'same': False, 'congruent': 8, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 2, 'type': 'addresses_A_ht', 'congruent': 7}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 8}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WC_ht', 'congruent': 10}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT_ht', 'congruent': 4}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
src/gl/implementation/gl-objects-framebuffers.adb | Roldak/OpenGLAda | 79 | 11736 | -- part of OpenGLAda, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "COPYING"
with Ada.Containers.Indefinite_Hashed_Maps;
with Ada.Unchecked_Conversion;
with GL.API;
with GL.Enums.Getter;
package body GL.Objects.Framebuffers is
------------
function Status (Target : Framebuffer_Target) return Framebuffer_Status is
begin
return API.Check_Framebuffer_Status (Target.Kind);
end Status;
procedure Attach_Renderbuffer (Target : Framebuffer_Target;
Attachment : Attachment_Point;
Object : Renderbuffers.Renderbuffer'Class) is
begin
API.Framebuffer_Renderbuffer (Target.Kind, Attachment,
Low_Level.Enums.Renderbuffer,
Object.Raw_Id);
Raise_Exception_On_OpenGL_Error;
end Attach_Renderbuffer;
procedure Attach_Texture (Target : Framebuffer_Target;
Attachment : Attachment_Point;
Object : Textures.Texture'Class;
Level : Textures.Mipmap_Level) is
begin
API.Framebuffer_Texture (Target.Kind, Attachment, Object.Raw_Id, Level);
Raise_Exception_On_OpenGL_Error;
end Attach_Texture;
procedure Attach_Texture_Layer (Target : Framebuffer_Target;
Attachment : Attachment_Point;
Object : Textures.Texture'Class;
Level : Textures.Mipmap_Level;
Layer : Int) is
begin
API.Framebuffer_Texture_Layer (Target.Kind, Attachment, Object.Raw_Id,
Level, Layer);
Raise_Exception_On_OpenGL_Error;
end Attach_Texture_Layer;
procedure Invalidate (Target : in out Framebuffer_Target;
Attachments : Attachment_List) is
begin
API.Invalidate_Framebuffer (Target.Kind, Attachments'Length, Attachments);
Raise_Exception_On_OpenGL_Error;
end Invalidate;
procedure Invalidate_Sub (Target : in out Framebuffer_Target;
Attachments : Attachment_List;
X, Y : Int;
Width, Height : Size) is
begin
API.Invalidate_Sub_Framebuffer (Target.Kind, Attachments'Length,
Attachments, X, Y, Width, Height);
Raise_Exception_On_OpenGL_Error;
end Invalidate_Sub;
procedure Blit (Src_X0, Src_Y0, Src_X1, Src_Y1,
Dst_X0, Dst_Y0, Dst_X1, Dst_Y1 : Int;
Mask : Buffers.Buffer_Bits;
Filter : Textures.Magnifying_Function) is
use type Low_Level.Bitfield;
function Convert is new Ada.Unchecked_Conversion
(Buffers.Buffer_Bits, Low_Level.Bitfield);
Raw_Bits : constant Low_Level.Bitfield
:= Convert (Mask) and 2#0100010100000000#;
begin
API.Blit_Framebuffer (Src_X0, Src_Y0, Src_X1, Src_Y1,
Dst_X0, Dst_Y0, Dst_X1, Dst_Y1, Raw_Bits, Filter);
Raise_Exception_On_OpenGL_Error;
end Blit;
procedure Set_Default_Width (Target : in out Framebuffer_Target;
Value : Size) is
begin
API.Framebuffer_Parameter_Size (Target.Kind, Enums.Default_Width, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Default_Width;
function Default_Width (Target : Framebuffer_Target) return Size is
Ret : Size;
begin
API.Get_Framebuffer_Parameter_Size
(Target.Kind, Enums.Default_Width, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Default_Width;
function Max_Framebuffer_Width return Size is
Ret : aliased Size;
begin
API.Get_Size (Enums.Getter.Max_Framebuffer_Width, Ret'Access);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Max_Framebuffer_Width;
procedure Set_Default_Height (Target : in out Framebuffer_Target;
Value : Size) is
begin
API.Framebuffer_Parameter_Size (Target.Kind, Enums.Default_Height,
Value);
Raise_Exception_On_OpenGL_Error;
end Set_Default_Height;
function Default_Height (Target : Framebuffer_Target) return Size is
Ret : Size;
begin
API.Get_Framebuffer_Parameter_Size (Target.Kind, Enums.Default_Height,
Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Default_Height;
function Max_Framebuffer_Height return Size is
Ret : aliased Size;
begin
API.Get_Size (Enums.Getter.Max_Framebuffer_Height, Ret'Unchecked_Access);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Max_Framebuffer_Height;
procedure Set_Default_Layers (Target : in out Framebuffer_Target;
Value : Size) is
begin
API.Framebuffer_Parameter_Size (Target.Kind, Enums.Default_Layers, Value);
Raise_Exception_On_OpenGL_Error;
end Set_Default_Layers;
function Default_Layers (Target : Framebuffer_Target) return Size is
Ret : Size;
begin
API.Get_Framebuffer_Parameter_Size (Target.Kind, Enums.Default_Layers,
Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Default_Layers;
function Max_Framebuffer_Layers return Size is
Ret : aliased Size;
begin
API.Get_Size (Enums.Getter.Max_Framebuffer_Layers, Ret'Unchecked_Access);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Max_Framebuffer_Layers;
procedure Set_Default_Samples (Target : in out Framebuffer_Target;
Value : Size) is
begin
API.Framebuffer_Parameter_Size (Target.Kind, Enums.Default_Samples,
Value);
Raise_Exception_On_OpenGL_Error;
end Set_Default_Samples;
function Default_Samples
(Target : Framebuffer_Target) return Size is
Ret : Size;
begin
API.Get_Framebuffer_Parameter_Size (Target.Kind, Enums.Default_Samples,
Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Default_Samples;
function Max_Framebuffer_Samples return Size is
Ret : aliased Size;
begin
API.Get_Size (Enums.Getter.Max_Framebuffer_Samples, Ret'Unchecked_Access);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Max_Framebuffer_Samples;
procedure Set_Default_Fixed_Sample_Locactions
(Target : in out Framebuffer_Target; Value : Boolean) is
begin
API.Framebuffer_Parameter_Bool
(Target.Kind, Enums.Default_Fixed_Sample_Locations,
Low_Level.Bool (Value));
Raise_Exception_On_OpenGL_Error;
end Set_Default_Fixed_Sample_Locactions;
function Default_Fixed_Sample_Locations (Target : Framebuffer_Target)
return Boolean is
Ret : Low_Level.Bool;
begin
API.Get_Framebuffer_Parameter_Bool
(Target.Kind, Enums.Default_Fixed_Sample_Locations, Ret);
Raise_Exception_On_OpenGL_Error;
return Boolean (Ret);
end Default_Fixed_Sample_Locations;
overriding
procedure Internal_Create_Id (Object : Framebuffer; Id : out UInt) is
pragma Unreferenced (Object);
begin
API.Gen_Framebuffers (1, Id);
Raise_Exception_On_OpenGL_Error;
end Internal_Create_Id;
overriding
procedure Internal_Release_Id (Object : Framebuffer; Id : UInt) is
pragma Unreferenced (Object);
begin
API.Delete_Framebuffers (1, (1 => Id));
Raise_Exception_On_OpenGL_Error;
end Internal_Release_Id;
function Hash (Key : Low_Level.Enums.Framebuffer_Kind)
return Ada.Containers.Hash_Type is
function Value is new Ada.Unchecked_Conversion
(Source => Low_Level.Enums.Framebuffer_Kind, Target => Low_Level.Enum);
begin
return Ada.Containers.Hash_Type (Value (Key));
end Hash;
package Framebuffer_Maps is new Ada.Containers.Indefinite_Hashed_Maps
(Key_Type => Low_Level.Enums.Framebuffer_Kind,
Element_Type => Framebuffer'Class,
Hash => Hash,
Equivalent_Keys => Low_Level.Enums."=");
use type Framebuffer_Maps.Cursor;
Current_Framebuffers : Framebuffer_Maps.Map;
type Framebuffer_Kind_Array is array (Positive range <>) of
Low_Level.Enums.Framebuffer_Kind;
function Backend_Framebuffer_Targets
(Kind : Low_Level.Enums.Framebuffer_Kind) return Framebuffer_Kind_Array is
begin
case Kind is
when Low_Level.Enums.Read => return (1 => Low_Level.Enums.Read);
when Low_Level.Enums.Draw => return (1 => Low_Level.Enums.Draw);
when Low_Level.Enums.Read_Draw =>
return (1 => Low_Level.Enums.Draw, 2 => Low_Level.Enums.Read);
end case;
end Backend_Framebuffer_Targets;
pragma Inline (Backend_Framebuffer_Targets);
procedure Bind (Target : Framebuffer_Target;
Object : Framebuffer'Class) is
-- Read_Draw bind to both read and draw framebuffer, we need to set
-- the current framebuffer objects accordingly.
Targets : constant Framebuffer_Kind_Array
:= Backend_Framebuffer_Targets (Target.Kind);
Cursor : Framebuffer_Maps.Cursor;
begin
API.Bind_Framebuffer (Target.Kind, Object.Reference.GL_Id);
Raise_Exception_On_OpenGL_Error;
for Index in Targets'Range loop
Cursor := Current_Framebuffers.Find (Targets (Index));
if Cursor = Framebuffer_Maps.No_Element then
Current_Framebuffers.Insert (Targets (Index), Object);
elsif Framebuffer_Maps.Element (Cursor).Reference.GL_Id
/= Object.Reference.GL_Id then
Current_Framebuffers.Replace_Element (Cursor, Object);
end if;
end loop;
end Bind;
function Current (Target : Framebuffer_Target) return Framebuffer'Class is
Targets : constant Framebuffer_Kind_Array
:= Backend_Framebuffer_Targets (Target.Kind);
-- If target is Read_Draw, return the draw framebuffer
-- (Note: this is necessary because distinct read/draw framebuffers
-- were added later to the API and therefore might not be available
-- in the context. So everything needs to work with just Read_Draw).
Cursor : constant Framebuffer_Maps.Cursor
:= Current_Framebuffers.Find (Targets (1));
begin
if Cursor = Framebuffer_Maps.No_Element then
raise No_Object_Bound_Exception with Target.Kind'Img;
else
return Framebuffer_Maps.Element (Cursor);
end if;
end Current;
end GL.Objects.Framebuffers;
|
test/LibSucceed/Issue421.agda | jappeace/agda | 0 | 14741 | -- In Agda 2.5.3 the error was:
-- μ₂ is not strictly positive, because it occurs
-- in the third argument to ⟦_⟧
-- in the type of the constructor fix
-- in the definition of μ₂.
open import Data.Nat using (ℕ;zero;suc)
open import Data.Fin using (Fin;zero;suc)
open import Data.Vec
open import Data.Empty
open import Data.Product
open import Data.Sum
open import Data.Unit
Σ# : {n : ℕ} -> (Fin n -> Set) -> Set
Σ# {zero} f = ⊥
Σ# {suc zero} f = f zero
Σ# {suc n} f = f zero ⊎ Σ# {n} λ i -> f (suc i)
module Matrices {Ix : Set} {Σ : (Ix -> Set) -> Set} where
Matrix : Set1
Matrix = (i j : Ix) -> Set
_<+>_ : Matrix -> Matrix -> Matrix
m <+> n = λ i j -> m i j ⊎ n i j
{-# INLINE _<+>_ #-}
_<*>_ : Matrix -> Matrix -> Matrix
m <*> n = λ i j -> Σ λ k -> m i k × n k j
{-# INLINE _<*>_ #-}
data Poly {Coeffs : Set1} : Set1 where
0p 1p : Poly
X : Poly
_+_ _*_ : (D1 D2 : Poly {Coeffs}) -> Poly {Coeffs}
K : Coeffs -> Poly
module Dim {n : ℕ} where
open Matrices {Fin n} {Σ#}
⟦_⟧ : Poly {Vec (Vec Set n) n} -> Matrix -> Matrix
⟦ 0p ⟧ x i j = ⊥
⟦ 1p ⟧ x i j = ⊤
⟦ X ⟧ x i j = x i j
⟦ D1 + D2 ⟧ x i j = (⟦ D1 ⟧ x <+> ⟦ D2 ⟧ x) i j
⟦ D1 * D2 ⟧ x i j = (⟦ D1 ⟧ x <*> ⟦ D2 ⟧ x) i j
⟦ K S ⟧ x i j = lookup (lookup S i) j
⟪_⟫ : Poly {Set} -> Set → Set
⟪ 0p ⟫ x = ⊥
⟪ 1p ⟫ x = ⊤
⟪ X ⟫ x = x
⟪ D1 + D2 ⟫ x = (⟪ D1 ⟫ x ⊎ ⟪ D2 ⟫ x)
⟪ D1 * D2 ⟫ x = (⟪ D1 ⟫ x × ⟪ D2 ⟫ x)
⟪ K S ⟫ x = S
data μ₁ (p : Poly) : Set where
fix : ⟪ p ⟫ (μ₁ p) -> μ₁ p
data μ₂ (p : Poly) (i j : Fin n) : Set where
fix : ⟦ p ⟧ (μ₂ p) i j -> μ₂ p i j
|
asm-methods.asm | travisdowns/avx-turbo | 113 | 91645 | BITS 64
default rel
%if (__NASM_MAJOR__ < 2) || (__NASM_MINOR__ < 11)
%deftok ver __NASM_VER__
%error Your nasm version (ver) is too old, you need at least 2.11 to compile this
%endif
%include "nasm-utils-inc.asm"
nasm_util_assert_boilerplate
thunk_boilerplate
; aligns and declares the global label for the bench with the given name
; also potentally checks the ABI compliance (if enabled)
%macro define_func 1
abi_checked_function %1
%endmacro
; define a test func that unrolls the loop by 100
; with the given body instruction
; %1 - function name
; %2 - init instruction (e.g., xor out the variable you'll add to)
; %3 - loop body instruction
; %4 - repeat count, defaults to 100 - values other than 100 mean the Mops value will be wrong
%macro test_func 3-4 100
define_func %1
%2
.top:
times %4 %3
sub rdi, 100
jnz .top
ret
%endmacro
; pause
test_func pause_only, {}, {pause}, 1
; vpermw latency
test_func avx512_vpermw, {vpcmpeqd ymm0, ymm0, ymm0}, {vpermw zmm0, zmm0, zmm0}
; vpermb latency
test_func avx512_vpermd, {vpcmpeqd ymm0, ymm0, ymm0}, {vpermd zmm0, zmm0, zmm0}
; imul latency
test_func avx128_imul, {vpcmpeqd xmm0, xmm0, xmm0}, {vpmuldq xmm0, xmm0, xmm0}
test_func avx256_imul, {vpcmpeqd ymm0, ymm0, ymm0}, {vpmuldq ymm0, ymm0, ymm0}
test_func avx512_imul, {vpcmpeqd ymm0, ymm0, ymm0}, {vpmuldq zmm0, zmm0, zmm0}
; imul throughput
test_func avx128_imul_t, {vpcmpeqd xmm0, xmm0, xmm0}, {vpmuldq xmm0, xmm1, xmm1}
test_func avx256_imul_t, {vpcmpeqd ymm0, ymm0, ymm0}, {vpmuldq ymm0, ymm1, ymm1}
test_func avx512_imul_t, {vpcmpeqd ymm0, ymm0, ymm0}, {vpmuldq zmm0, zmm1, zmm1}
; iadd latency
test_func scalar_iadd, {xor eax, eax}, {add rax, rax}
test_func avx128_iadd, {vpcmpeqd xmm0, xmm0, xmm0}, {vpaddq xmm0, xmm0, xmm0}
test_func avx256_iadd, {vpcmpeqd ymm0, ymm0, ymm0}, {vpaddq ymm0, ymm0, ymm0}
test_func avx512_iadd, {vpcmpeqd ymm0, ymm0, ymm0}, {vpaddq zmm0, zmm0, zmm0}
; iadd latency with zmm16
test_func avx128_iadd16, {vpternlogd xmm16, xmm16, xmm16, 0xff}, {vpaddq xmm16, xmm16, xmm16}
test_func avx256_iadd16, {vpternlogd ymm16, ymm16, ymm16, 0xff}, {vpaddq ymm16, ymm16, ymm16}
test_func avx512_iadd16, {vpternlogd zmm16, zmm16, zmm16, 0xff}, {vpaddq zmm16, zmm16, zmm16}
; iadd throughput
test_func avx128_iadd_t, {vpcmpeqd xmm1, xmm0, xmm0}, {vpaddq xmm0, xmm1, xmm1}
test_func avx256_iadd_t, {vpcmpeqd ymm1, ymm0, ymm0}, {vpaddq ymm0, ymm1, ymm1}
; zeroing xor
test_func avx128_xor_zero, {}, {vpxor xmm0, xmm0, xmm0}
test_func avx256_xor_zero, {}, {vpxor ymm0, ymm0, ymm0}
test_func avx512_xor_zero, {}, {vpxord zmm0, zmm0, zmm0}
; vpsrlvd latency
test_func avx128_vshift, {vpcmpeqd xmm1, xmm0, xmm0}, {vpsrlvd xmm0, xmm0, xmm0}
test_func avx256_vshift, {vpcmpeqd xmm1, xmm0, xmm0}, {vpsrlvd ymm0, ymm0, ymm0}
test_func avx512_vshift, {vpcmpeqd xmm1, xmm0, xmm0}, {vpsrlvd zmm0, zmm0, zmm0}
; vpsrlvd throughput
test_func avx128_vshift_t,{vpcmpeqd xmm1, xmm0, xmm0}, {vpsrlvd xmm0, xmm1, xmm1}
test_func avx256_vshift_t,{vpcmpeqd xmm1, xmm0, xmm0}, {vpsrlvd ymm0, ymm1, ymm1}
test_func avx512_vshift_t,{vpcmpeqd xmm1, xmm0, xmm0}, {vpsrlvd zmm0, zmm1, zmm1}
; vplzcntd latency
test_func avx128_vlzcnt, {vpcmpeqd xmm1, xmm0, xmm0}, {vplzcntd xmm0, xmm0}
test_func avx256_vlzcnt, {vpcmpeqd xmm1, xmm0, xmm0}, {vplzcntd ymm0, ymm0}
test_func avx512_vlzcnt, {vpcmpeqd xmm1, xmm0, xmm0}, {vplzcntd zmm0, zmm0}
; vplzcntd throughput
test_func avx128_vlzcnt_t,{vpcmpeqd xmm1, xmm0, xmm0}, {vplzcntd xmm0, xmm1}
test_func avx256_vlzcnt_t,{vpcmpeqd xmm1, xmm0, xmm0}, {vplzcntd ymm0, ymm1}
test_func avx512_vlzcnt_t,{vpcmpeqd xmm1, xmm0, xmm0}, {vplzcntd zmm0, zmm1}
; FMA
test_func avx128_fma , {vpxor xmm0, xmm0, xmm0}, {vfmadd132pd xmm0, xmm0, xmm0}
test_func avx256_fma , {vpxor xmm0, xmm0, xmm0}, {vfmadd132pd ymm0, ymm0, ymm0}
test_func avx512_fma , {vpxor xmm0, xmm0, xmm0}, {vfmadd132pd zmm0, zmm0, zmm0}
; this is like test_func, but it uses 10 parallel chains of instructions,
; unrolled 10 times, so (probably) max throughput at least if latency * throughput
; product for the instruction <= 10
; %1 - function name
; %2 - init instruction (e.g., xor out the variable you'll add to)
; %3 - register base like xmm, ymm, zmm
; %4 - loop body instruction only (no operands)
; %5 - init value for xmm0-9, used as first (dest) arg as in vfmadd132pd xmm0..9, xmm10, xmm11
; %6 - init value for xmm10, used as second arg as in vfmadd132pd reg, xmm10, xmm11
; %7 - init value for xmm11, used as third arg as in vfmadd132pd reg, xmm10, xmm11
%macro test_func_tput 7
define_func %1
; init reg 0-9
%assign r 0
%rep 10
%2 %3 %+ r, %5
%assign r (r+1)
%endrep
; init reg10, reg11
%2 %3 %+ 10, %6
%2 %3 %+ 11, %7
.top:
%rep 10
%assign r 0
%rep 10
%4 %3 %+ r, %3 %+ 10, %3 %+ 11
%assign r (r+1)
%endrep
%endrep
sub rdi, 100
jnz .top
ret
%endmacro
test_func_tput avx128_fma_t , vmovddup, xmm, vfmadd132pd, [zero_dp], [one_dp], [half_dp]
test_func_tput avx256_fma_t , vbroadcastsd, ymm, vfmadd132pd, [zero_dp], [one_dp], [half_dp]
test_func_tput avx512_fma_t , vbroadcastsd, zmm, vfmadd132pd, [zero_dp], [one_dp], [half_dp]
test_func_tput avx512_vpermw_t ,vbroadcastsd, zmm, vpermw, [zero_dp], [one_dp], [half_dp]
test_func_tput avx512_vpermd_t ,vbroadcastsd, zmm, vpermd, [zero_dp], [one_dp], [half_dp]
; this is like test_func except that the 100x unrolled loop instruction is
; always a serial scalar add, while the passed instruction to test is only
; executed once per loop (so at a ratio of 1:100 for the scalar adds). This
; test the effect of an "occasional" AVX instruction.
; %1 - function name
; %2 - init instruction (e.g., xor out the variable you'll add to)
; %3 - loop body instruction
%macro test_func_sparse 4
define_func %1
%2
%4
xor eax, eax
.top:
%3
times 100 add eax, eax
sub rdi, 100
jnz .top
ret
%endmacro
test_func_sparse avx128_mov_sparse, {vbroadcastsd ymm0, [one_dp]}, {vmovdqa xmm0, xmm0}, {}
test_func_sparse avx256_mov_sparse, {vbroadcastsd ymm0, [one_dp]}, {vmovdqa ymm0, ymm0}, {}
test_func_sparse avx512_mov_sparse, {vbroadcastsd zmm0, [one_dp]}, {vmovdqa32 zmm0, zmm0}, {}
test_func_sparse avx128_merge_sparse, {vbroadcastsd ymm0, [one_dp]}, {vmovdqa32 xmm0{k1}, xmm0}, {kmovw k1, [kmask]}
test_func_sparse avx256_merge_sparse, {vbroadcastsd ymm0, [one_dp]}, {vmovdqa32 ymm0{k1}, ymm0}, {kmovw k1, [kmask]}
test_func_sparse avx512_merge_sparse, {vbroadcastsd zmm0, [one_dp]}, {vmovdqa32 zmm0{k1}, zmm0}, {kmovw k1, [kmask]}
test_func_sparse avx128_fma_sparse, {vbroadcastsd ymm0, [zero_dp]}, {vfmadd132pd xmm0, xmm0, xmm0 }, {}
test_func_sparse avx256_fma_sparse, {vbroadcastsd ymm0, [zero_dp]}, {vfmadd132pd ymm0, ymm0, ymm0 }, {}
test_func_sparse avx512_fma_sparse, {vbroadcastsd zmm0, [zero_dp]}, {vfmadd132pd zmm0, zmm0, zmm0 }, {}
; %1 function name suffix
; %2 dirty instruction
%macro define_ucomis 2
define_func ucomis_%1
;vpxor xmm15, xmm15, xmm15
;vzeroupper
%2
movdqu xmm0, [one_dp]
movdqu xmm2, [one_dp]
movdqu xmm1, [zero_dp]
align 64
.top:
%rep 100
addsd xmm0, xmm2
ucomisd xmm1, xmm0
ja .never
%endrep
sub rdi, 100
jnz .top
ret
.never:
ud2
%endmacro
define_ucomis clean, {vzeroupper}
define_ucomis dirty, {}
define_func dirty_it
vzeroupper
vpxord zmm15, zmm14, zmm15
ret
define_func dirty_it16
vzeroupper
vpxord zmm16, zmm14, zmm15
ret
GLOBAL zeroupper_asm:function
zeroupper_asm:
vzeroupper
ret
zero_dp: dq 0.0
half_dp: dq 0.5
one_dp: dq 1.0
kmask: dq 0x5555555555555555
|
samples/scdloading/main.asm | retro16/blastsdk | 10 | 168177 | <filename>samples/scdloading/main.asm
include bls_init.inc
include bls_vdp.inc
include bdp.inc
include sub_idle.inc
MAIN
IP_MAIN
bls_init 0, INT_VBLANK
sub_idle_init
bls_init_vdp 0, 1, 64, 32, BLAST_SPLASH_PNG_MAP, 0, PLANE_B, SPRAT, HSCROLL_TABLE, 0, 0, 0, 0, 0, 0, 0
BLSLOAD_BINARY_BLAST_SPLASH
delay_millis 3000
BLSLOAD_BINARY_TEXT
ccall display_text
.1 bra.b .1
INT_VBLANK
movem.l d0/d1/a0/a1, -(sp)
sub_idle_vsync
movem.l (sp)+, d0/d1/a0/a1
rte
; vim: ts=8 sw=8 sts=8 et
|
bits/src/shift/axiom/logic_right/bitoperations-shift-axiom-logic_right.adb | vasil-sd/ada-tlsf | 3 | 17503 | <gh_stars>1-10
package body BitOperations.Shift.Axiom.Logic_Right with
SPARK_Mode => Off is
procedure Equal_Div_By_Power_2 (Value : Modular; Amount : Natural) is null;
end BitOperations.Shift.Axiom.Logic_Right;
|
5e03.asm | sqph/td-micl | 0 | 29848 | <filename>5e03.asm
; 5e03.asm
global main
section .rodata
chpair DB `pair\n`
chpairlg DD $ - chpair
chimpair DB `impair\n`
chimpairlg DD $ - chimpair
section .text
main:
mov edx, 23
bt edx, 0
jc _impair
;pair
mov eax, 4 ; numéro de service: 4 (write)
mov ebx, 1 ; descripteur de fichier: 1 (écran)
mov ecx, chpair ; adresse de ce qui doit être écrit
mov edx, [chpairlg] ; la tête de lecture est avancée du nombre de bytes à écrire
int 0x80
jmp _fin ; sauter
_impair:
mov eax, 4 ; numéro de service: 4 (write)
mov ebx, 1 ; descripteur de fichier: 1 (écran)
mov ecx, chimpair ; adresse de ce qui doit être écrit
mov edx, [chimpairlg] ; la tête de lecture est avancée du nombre de bytes à écrire
int 0x80
_fin:
mov eax, 1 ; numéro de service: 1 (exit)
mov ebx, 0 ; retourner ok (0)
int 0x80
|
oeis/111/A111647.asm | neoneye/loda-programs | 11 | 172141 | <filename>oeis/111/A111647.asm
; A111647: a(n) = A001541(n)*A001653(n)*A002315(n).
; Submitted by <NAME>
; 1,105,20213,3998709,791704585,156753394977,31036379835581,6145046450172525,1216688160731724433,240898110778299543129,47696609245941810082565,9443687732585695622131557,1869802474442721765291659161,370211446251926323680119216145,73299996555406969366012350447053,14513029106524328008141601500323549,2873506463095261538642640988062445345,568939766663755260323234598618725809737,112647200292960446282461806863119470782741,22303576718239504608667114518340051564618965
mul $0,2
mov $3,1
lpb $0
sub $0,1
mov $2,$3
mul $3,2
add $3,$1
mov $1,$2
lpe
add $3,$1
mul $1,$3
add $1,1
mul $1,$3
mov $0,$1
|
programs/oeis/135/A135523.asm | neoneye/loda | 22 | 97761 | <filename>programs/oeis/135/A135523.asm
; A135523: a(n) = A007814(n) + A209229(n).
; 1,2,0,3,0,1,0,4,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2
mul $0,2
add $0,1
lpb $0
div $0,2
dif $0,-2
add $1,3
lpe
div $1,3
mov $0,$1
|
projects/batfish/src/main/antlr4/org/batfish/grammar/fortios/Fortios_interface.g4 | pranavbj-amzn/batfish | 763 | 4519 | <filename>projects/batfish/src/main/antlr4/org/batfish/grammar/fortios/Fortios_interface.g4
parser grammar Fortios_interface;
options {
tokenVocab = FortiosLexer;
}
cs_interface: INTERFACE newline csi_edit*;
csi_edit: EDIT interface_name newline csie* NEXT newline;
csie: csie_config | csie_set;
csie_config: CONFIG csiec_secondaryip;
csiec_secondaryip: SECONDARYIP newline csiecsip_edit* END newline;
csiecsip_edit: EDIT sip_number newline csiecsipe* NEXT newline;
csiecsipe
:
csiecsipe_set
| (UNSET | SELECT | UNSELECT | APPEND | CLEAR) unimplemented
;
csiecsipe_set: SET csiecsipe_set_ip;
csiecsipe_set_ip: IP ip = ip_address_with_mask_or_prefix newline;
csie_set: SET csi_set_singletons;
csi_set_singletons:
csi_set_alias
| csi_set_description
| csi_set_interface
| csi_set_ip
| csi_set_mtu
| csi_set_mtu_override
| csi_set_secondary_ip
| csi_set_speed
| csi_set_status
| csi_set_type
| csi_set_vdom
| csi_set_vlanid
| csi_set_vrf
| csi_set_null
;
csi_set_alias: ALIAS alias = interface_alias newline;
csi_set_description: DESCRIPTION description = str newline;
csi_set_interface: INTERFACE interface_name newline;
csi_set_ip: IP ip = ip_address_with_mask_or_prefix newline;
csi_set_mtu: MTU value = mtu newline;
csi_set_mtu_override: MTU_OVERRIDE value = enable_or_disable newline;
csi_set_secondary_ip: SECONDARY_IP value = enable_or_disable newline;
csi_set_speed: SPEED interface_speed newline;
csi_set_status: STATUS status = up_or_down newline;
csi_set_type: TYPE type = interface_type newline;
csi_set_vdom: VDOM vdom = str newline;
csi_set_vlanid: VLANID vlanid newline;
csi_set_vrf: VRF value = vrf newline;
csi_set_null: SNMP_INDEX null_rest_of_line;
// 68-65535
mtu: uint16;
// 0-31
vrf: uint8;
interface_type:
AGGREGATE
| EMAC_VLAN
| LOOPBACK
| PHYSICAL
| REDUNDANT
| TUNNEL
| VLAN
| WL_MESH
;
// Up to 25 characters
interface_alias: str;
// 0-4294967295
sip_number: str;
interface_speed
:
AUTO
| TEN_FULL
| TEN_HALF
| HUNDRED_FULL
| HUNDRED_HALF
| THOUSAND_FULL
| THOUSAND_HALF
| TEN_THOUSAND_FULL
| TEN_THOUSAND_HALF
| HUNDRED_GFULL
| HUNDRED_GHALF
;
|
src/formatter-get-format_real.adb | zenharris/ada-bbs | 2 | 11860 | <filename>src/formatter-get-format_real.adb<gh_stars>1-10
separate(Formatter.Get)
procedure Format_Real(Data : in Contents;
In_The_String : in out String;
Location : in out Natural;
Width : in Natural := 0;
Precision : in Natural := 0;
Exponent : in Natural := 0;
Fill_With_Zeros : in Boolean := False) is
-- ++
--
-- FUNCTIONAL DESCRIPTION:
--
-- Formats real number according to specified parameters.
--
-- FORMAL PARAMETERS:
--
-- Data:
-- The input real number in a variant record.
--
-- In_The_String:
-- The output string where the formatted real number is placed.
--
-- Location:
-- The position of the formatted real number in the output string.
--
-- Width:
-- The output formatted real number field width.
--
-- Precision:
-- The number of decimal positions.
--
-- Exponent:
-- The number of exponent positions.
--
-- Fill_With_Zeros:
-- Logical (Boolean) flag specifying the formatted real number is to be
-- padded with leading zeros.
--
-- DESIGN:
--
-- Format the real number directly into the output string using Float or
-- Double-Float IO Put procedure.
--
-- --
-- Local variable(s)
Field_Width : Natural;
begin
-- Determine output field width
if Width > 0 then
Field_Width := Width; -- Set to specified width
else
Field_Width := Get.Default_Width;
end if;
if Data.Class = Float_Type then -- Correct data type
-- Convert to string
FIO.Put(ITEM => Data.Float_Value,
AFT => Precision,
EXP => Exponent,
TO => In_The_String(Location..Location + Field_Width - 1));
if Left_Justify then
In_The_String(Location..Location + Field_Width - 1) :=
Get.Left_Justified(In_The_String(Location..Location + Field_Width-1));
end if;
if Fill_With_Zeros then
In_The_String(Location..Location + Field_Width - 1) :=
Get.Zero_Fill(In_The_String(Location..Location + Field_Width-1));
end if;
-- Update next output position
Location := Location + Field_Width;
elsif Data.Class = DP_Float_Type then -- Correct data type
-- Format directly to output string
DFIO.Put(ITEM => Data.DP_Float_Value,
AFT => Precision,
EXP => Exponent,
TO => In_The_String(Location..Location + Field_Width - 1));
if Left_Justify then
In_The_String(Location..Location + Field_Width - 1) :=
Get.Left_Justified(In_The_String(Location..Location + Field_Width-1));
end if;
if Fill_With_Zeros then
In_The_String(Location..Location + Field_Width - 1) :=
Get.Zero_Fill(In_The_String(Location..Location + Field_Width-1));
end if;
Location := Location + Field_Width;
else -- Not correct data type to convert
Format_Error(In_The_String, Location, Field_Width);
end if;
exception
when others =>
Format_Error(In_The_String, Location, Get.Default_Width);
end Format_Real;
|
grammar/Duke.g4 | ikeman32/Duke | 0 | 4839 | grammar Duke;
/*Parser Rules */
ifStatement:
If condition Separator statements Done
| If condition Block statements (Nonterminal | Done);
/*
* *If myInt is 4, print myInt. //end ifStatement *If myInt is 4: print myInt; print 'is
* four.'.//end ifStatement
*/
ifBlock:
If Block condition Separator statements Done
| Terminal
| If Block condition Block statements (Nonterminal | Done)
| Terminal;
/*
* *If: myInt is 4, print myInt. myInt not 4, print "Not four."..//end ifBlock
*
* *If: myInt is 4: print myInt; print 'is four.'. myInt not 4, print 'Not four.'..//end ifBlock
*/
createStatment:
Create obj Separator Id Assignment (Num | Bop) Done;
/*Create int, myInt has 4. */
createBlock:
Create Block obj Separator Id Assignment (Num | Bop) (
Nonterminal
| Done
);
/*Create:
* * int, myInt has 4; bool, myBool has true; dbl, myDbl has 2.5.
*/
loopStatement:
Loop Separator condition Block statements (
Nonterminal
| Done
);
/*
Create int, myInt has 0. Loop, myInt is! 10: myInt has+ 1.
*/
chooseStatement:
Choose Separator Id Block Id Separator statements (
Nonterminal
| Done
) Terminal
| Choose Separator Id Block Id Separator statements (
Nonterminal
| Done
) Default statements (Nonterminal | Done) Terminal;
/*
Choose, myInt: 4, print 'Is 4'. 5, print 'Is 5'. 6, print 'Is 6'..
Choose, myInt: 4, print 'Is 4'. 5, print 'Is 5'. 6, print 'Is 6'. Otherwise, print 'Not found.'..
*/
condition: Id Cmp Id;
/*Condition
myInt is 4. myInt is! 4. myInt ! 4.
*/
statements: expression;
obj: Bool | Integer | Double;
expression:
Decrement Sub Num
| Increment Add Num
| Id Assignment Id
| Id Assignment Id Mop Id;
/*Expressions
dec - 1. inc + 1. inc + 2. dec - 3. myInt has 4. myInt has+ 1. myInt has 4 + 6. myDbl has 2.5 -
1.6.
*/
/*Lexer Rules */
Assignment: 'has' | 'has+' | 'has-' | 'has*' | 'has/';
Block: ':';
Bool: 'Boolean' | 'Bool' | 'bool';
Choose: 'Choose' | 'choose';
Create: 'Create' | 'create';
Decrement: 'Dec' | 'dec';
Default: 'Otherwise';
Double: 'Double' | 'double' | 'dbl';
Function: 'Func' | 'Function';
If: 'If' | 'if';
Increment: 'Inc' | 'inc';
Integer: 'Integer' | 'Int' | 'int';
Loop: 'Loop' | 'loop';
Separator: ',';
String: 'String' | 'Str' | 'str';
Nonterminal: ';';
Terminal: '..';
Done: '.';
Bop: True | False;
True: 'True' | 'true' | 'on';
False: 'False' | 'false' | 'off';
/*Math Operators */
Mop: Times | Divide | Add | Sub | Mod;
Times: '*';
Divide: '/';
Add: '+';
Sub: '-';
Mod: '%';
/*Bitwise */
And: '&' | 'and';
Or: '|' | 'or';
Xor: '^' | 'xor';
Cmp: Equality | Not | Neq;
Equality: 'is';
Not: '!' | 'not';
Neq: 'is!' 'isnt';
Id: Letter | (Letter Num) | Num;
BlockComment: '/*' .*? '*/' -> skip;
LineComment: '//' ~[\r\n]* -> skip;
WS: ['named' |' '| \t]+ -> skip;
fragment Num: [0-9];
fragment Letter: [a-zA-Z_];
fragment Lower: [a-z];
fragment Upper:
{A-Z];
|
Validation/pyFrame3DD-master/gcc-master/gcc/ada/get_targ.adb | djamal2727/Main-Bearing-Analytical-Model | 0 | 16412 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G E T _ T A R G --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Version for use with GCC
package body Get_Targ is
-- Functions returning individual run-time values. For the standard (GCC)
-- back end, these come from C interface functions (one for each value).
-----------------------
-- Get_Bits_Per_Unit --
-----------------------
function Get_Bits_Per_Unit return Pos is
function C_Get_Bits_Per_Unit return Pos;
pragma Import (C, C_Get_Bits_Per_Unit,
"get_target_bits_per_unit");
begin
return C_Get_Bits_Per_Unit;
end Get_Bits_Per_Unit;
-----------------------
-- Get_Bits_Per_Word --
-----------------------
function Get_Bits_Per_Word return Pos is
function C_Get_Bits_Per_Word return Pos;
pragma Import (C, C_Get_Bits_Per_Word,
"get_target_bits_per_word");
begin
return C_Get_Bits_Per_Word;
end Get_Bits_Per_Word;
-------------------
-- Get_Char_Size --
-------------------
function Get_Char_Size return Pos is
function C_Get_Char_Size return Pos;
pragma Import (C, C_Get_Char_Size,
"get_target_char_size");
begin
return C_Get_Char_Size;
end Get_Char_Size;
----------------------
-- Get_Wchar_T_Size --
----------------------
function Get_Wchar_T_Size return Pos is
function C_Get_Wchar_T_Size return Pos;
pragma Import (C, C_Get_Wchar_T_Size,
"get_target_wchar_t_size");
begin
return C_Get_Wchar_T_Size;
end Get_Wchar_T_Size;
--------------------
-- Get_Short_Size --
--------------------
function Get_Short_Size return Pos is
function C_Get_Short_Size return Pos;
pragma Import (C, C_Get_Short_Size,
"get_target_short_size");
begin
return C_Get_Short_Size;
end Get_Short_Size;
------------------
-- Get_Int_Size --
------------------
function Get_Int_Size return Pos is
function C_Get_Int_Size return Pos;
pragma Import (C, C_Get_Int_Size,
"get_target_int_size");
begin
return C_Get_Int_Size;
end Get_Int_Size;
-------------------
-- Get_Long_Size --
-------------------
function Get_Long_Size return Pos is
function C_Get_Long_Size return Pos;
pragma Import (C, C_Get_Long_Size,
"get_target_long_size");
begin
return C_Get_Long_Size;
end Get_Long_Size;
------------------------
-- Get_Long_Long_Size --
------------------------
function Get_Long_Long_Size return Pos is
function C_Get_Long_Long_Size return Pos;
pragma Import (C, C_Get_Long_Long_Size,
"get_target_long_long_size");
begin
return C_Get_Long_Long_Size;
end Get_Long_Long_Size;
----------------------
-- Get_Pointer_Size --
----------------------
function Get_Pointer_Size return Pos is
function C_Get_Pointer_Size return Pos;
pragma Import (C, C_Get_Pointer_Size,
"get_target_pointer_size");
begin
return C_Get_Pointer_Size;
end Get_Pointer_Size;
---------------------------
-- Get_Maximum_Alignment --
---------------------------
function Get_Maximum_Alignment return Pos is
function C_Get_Maximum_Alignment return Pos;
pragma Import (C, C_Get_Maximum_Alignment,
"get_target_maximum_alignment");
begin
return C_Get_Maximum_Alignment;
end Get_Maximum_Alignment;
------------------------
-- Get_Float_Words_BE --
------------------------
function Get_Float_Words_BE return Nat is
function C_Get_Float_Words_BE return Nat;
pragma Import (C, C_Get_Float_Words_BE,
"get_target_float_words_be");
begin
return C_Get_Float_Words_BE;
end Get_Float_Words_BE;
------------------
-- Get_Words_BE --
------------------
function Get_Words_BE return Nat is
function C_Get_Words_BE return Nat;
pragma Import (C, C_Get_Words_BE,
"get_target_words_be");
begin
return C_Get_Words_BE;
end Get_Words_BE;
------------------
-- Get_Bytes_BE --
------------------
function Get_Bytes_BE return Nat is
function C_Get_Bytes_BE return Nat;
pragma Import (C, C_Get_Bytes_BE,
"get_target_bytes_be");
begin
return C_Get_Bytes_BE;
end Get_Bytes_BE;
-----------------
-- Get_Bits_BE --
-----------------
function Get_Bits_BE return Nat is
function C_Get_Bits_BE return Nat;
pragma Import (C, C_Get_Bits_BE,
"get_target_bits_be");
begin
return C_Get_Bits_BE;
end Get_Bits_BE;
---------------------
-- Get_Short_Enums --
---------------------
function Get_Short_Enums return Int is
flag_short_enums : Int;
pragma Import (C, flag_short_enums);
begin
return flag_short_enums;
end Get_Short_Enums;
--------------------------
-- Get_Strict_Alignment --
--------------------------
function Get_Strict_Alignment return Nat is
function C_Get_Strict_Alignment return Nat;
pragma Import (C, C_Get_Strict_Alignment,
"get_target_strict_alignment");
begin
return C_Get_Strict_Alignment;
end Get_Strict_Alignment;
------------------------------------
-- Get_System_Allocator_Alignment --
------------------------------------
function Get_System_Allocator_Alignment return Nat is
function C_Get_System_Allocator_Alignment return Nat;
pragma Import (C, C_Get_System_Allocator_Alignment,
"get_target_system_allocator_alignment");
begin
return C_Get_System_Allocator_Alignment;
end Get_System_Allocator_Alignment;
--------------------------------
-- Get_Double_Float_Alignment --
--------------------------------
function Get_Double_Float_Alignment return Nat is
function C_Get_Double_Float_Alignment return Nat;
pragma Import (C, C_Get_Double_Float_Alignment,
"get_target_double_float_alignment");
begin
return C_Get_Double_Float_Alignment;
end Get_Double_Float_Alignment;
---------------------------------
-- Get_Double_Scalar_Alignment --
---------------------------------
function Get_Double_Scalar_Alignment return Nat is
function C_Get_Double_Scalar_Alignment return Nat;
pragma Import (C, C_Get_Double_Scalar_Alignment,
"get_target_double_scalar_alignment");
begin
return C_Get_Double_Scalar_Alignment;
end Get_Double_Scalar_Alignment;
------------------------------
-- Get_Back_End_Config_File --
------------------------------
function Get_Back_End_Config_File return String_Ptr is
begin
return null;
end Get_Back_End_Config_File;
----------------------
-- Digits_From_Size --
----------------------
function Digits_From_Size (Size : Pos) return Pos is
begin
case Size is
when 32 => return 6;
when 48 => return 9;
when 64 => return 15;
when 96 => return 18;
when 128 => return 18;
when others => raise Program_Error;
end case;
end Digits_From_Size;
-----------------------------
-- Get_Max_Unaligned_Field --
-----------------------------
function Get_Max_Unaligned_Field return Pos is
begin
return 64; -- Can be different on some targets (e.g., AAMP)
end Get_Max_Unaligned_Field;
-----------------------------
-- Register_Back_End_Types --
-----------------------------
procedure Register_Back_End_Types (Call_Back : Register_Type_Proc) is
procedure Enumerate_Modes (Call_Back : Register_Type_Proc);
pragma Import (C, Enumerate_Modes, "enumerate_modes");
begin
Enumerate_Modes (Call_Back);
end Register_Back_End_Types;
---------------------
-- Width_From_Size --
---------------------
function Width_From_Size (Size : Pos) return Pos is
begin
case Size is
when 8 => return 4;
when 16 => return 6;
when 32 => return 11;
when 64 => return 21;
when others => raise Program_Error;
end case;
end Width_From_Size;
end Get_Targ;
|
source/web_server.adb | jquorning/Gauss | 4 | 9234 | <reponame>jquorning/Gauss<gh_stars>1-10
--
-- The author disclaims copyright to this source code. In place of
-- a legal notice, here is a blessing:
--
-- May you do good and not evil.
-- May you find forgiveness for yourself and forgive others.
-- May you share freely, not taking more than you give.
--
with Ada.Text_IO;
with AWS.Config;
with AWS.Server.Log;
with AWS.Services.Page_Server;
package body Web_Server is
Server : AWS.Server.HTTP;
procedure Startup is
Config : constant AWS.Config.Object := AWS.Config.Get_Current;
begin
if AWS.Config.Directory_Browser_Page (Config) /= "" then
AWS.Services.Page_Server.Directory_Browsing (True);
end if;
if AWS.Config.Log_Filename_Prefix (Config) /= "" then
AWS.Server.Log.Start (Server);
end if;
if AWS.Config.Error_Log_Filename_Prefix (Config) /= "" then
AWS.Server.Log.Start_Error (Server);
end if;
AWS.Server.Start
(Web_Server => Server,
Dispatcher => Virtual_Hosts.Dispatcher,
Config => Config);
end Startup;
procedure Work_Until_Stopped is
use AWS.Server;
begin
Wait (Forever);
end Work_Until_Stopped;
procedure Shutdown is
begin
Ada.Text_IO.Put_Line ("AWS server shutdown in progress.");
AWS.Server.Shutdown (Server);
end Shutdown;
end Web_Server;
|
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2185.asm | ljhsiun2/medusa | 9 | 247240 | <reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2185.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x5c74, %r13
nop
nop
nop
sub $24137, %rdx
mov $0x6162636465666768, %r10
movq %r10, %xmm6
vmovups %ymm6, (%r13)
nop
nop
nop
cmp $28634, %r8
lea addresses_normal_ht+0x7cd4, %rsi
lea addresses_WC_ht+0x5574, %rdi
nop
nop
nop
dec %r12
mov $51, %rcx
rep movsl
nop
sub %r13, %r13
lea addresses_D_ht+0x1b874, %r13
nop
nop
nop
nop
and $32837, %r12
and $0xffffffffffffffc0, %r13
vmovntdqa (%r13), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %r8
nop
nop
nop
dec %r13
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %rax
push %rbp
push %rbx
// Faulty Load
lea addresses_WC+0x1dc74, %r13
nop
sub $31783, %rax
mov (%r13), %bx
lea oracles, %r13
and $0xff, %rbx
shlq $12, %rbx
mov (%r13,%rbx,1), %rbx
pop %rbx
pop %rbp
pop %rax
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': True, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 11, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 9, 'size': 32, 'same': False, 'NT': True}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
programs/oeis/140/A140657.asm | neoneye/loda | 22 | 178561 | ; A140657: Powers of 2 with 3 alternatingly added and subtracted.
; 4,-1,7,5,19,29,67,125,259,509,1027,2045,4099,8189,16387,32765,65539,131069,262147,524285,1048579,2097149,4194307,8388605,16777219,33554429,67108867,134217725,268435459,536870909,1073741827,2147483645,4294967299,8589934589,17179869187,34359738365,68719476739,137438953469,274877906947,549755813885,1099511627779,2199023255549,4398046511107,8796093022205,17592186044419,35184372088829,70368744177667,140737488355325,281474976710659,562949953421309,1125899906842627,2251799813685245,4503599627370499,9007199254740989,18014398509481987,36028797018963965,72057594037927939,144115188075855869,288230376151711747,576460752303423485,1152921504606846979,2305843009213693949,4611686018427387907,9223372036854775805,18446744073709551619,36893488147419103229,73786976294838206467,147573952589676412925,295147905179352825859,590295810358705651709,1180591620717411303427,2361183241434822606845,4722366482869645213699,9444732965739290427389,18889465931478580854787,37778931862957161709565,75557863725914323419139,151115727451828646838269,302231454903657293676547,604462909807314587353085,1208925819614629174706179,2417851639229258349412349,4835703278458516698824707,9671406556917033397649405,19342813113834066795298819,38685626227668133590597629,77371252455336267181195267,154742504910672534362390525,309485009821345068724781059,618970019642690137449562109,1237940039285380274899124227,2475880078570760549798248445,4951760157141521099596496899,9903520314283042199192993789,19807040628566084398385987587,39614081257132168796771975165,79228162514264337593543950339,158456325028528675187087900669,316912650057057350374175801347,633825300114114700748351602685
mov $2,2
mov $3,8
lpb $0
sub $0,1
add $2,3
mul $2,2
mul $3,-1
lpe
mov $1,$2
mul $3,3
add $1,$3
sub $1,26
div $1,8
add $1,4
mov $0,$1
|
alloy4fun_models/trashltl/models/13/F5qeNWqJYmKazuAwo.als | Kaixi26/org.alloytools.alloy | 0 | 922 | open main
pred idF5qeNWqJYmKazuAwo_prop14 {
always (all f:File | f in Trash implies after f not in Protected)
}
pred __repair { idF5qeNWqJYmKazuAwo_prop14 }
check __repair { idF5qeNWqJYmKazuAwo_prop14 <=> prop14o } |
data/phone/text/huey_callee.asm | Dev727/ancientplatinum | 28 | 166050 | UnknownText_0x1b5073:
text "Yeah, this is"
line "@"
text_ram wStringBuffer3
text "."
para "Huh? What's up,"
line "<PLAYER>?"
done
UnknownText_0x1b509b:
text "Yeah, this is"
line "@"
text_ram wStringBuffer3
text "."
para "Huh? What's up"
line "<PLAYER>?"
done
UnknownText_0x1b50c2:
text "Yeah, this is"
line "@"
text_ram wStringBuffer3
text "."
para "Huh? What's up"
line "<PLAYER>?"
done
UnknownText_0x1b50e9:
text "Yo, <PLAYER>!"
line "You awake?"
para "It's me, @"
text_ram wStringBuffer3
text "!"
line "How's it going?"
done
UnknownText_0x1b511a:
text "Yo, <PLAYER>! You"
line "free right now?"
para "It's me, @"
text_ram wStringBuffer3
text "!"
line "How's it going?"
done
UnknownText_0x1b5154:
text "Yo, <PLAYER>!"
line "Were you asleep?"
para "It's me, @"
text_ram wStringBuffer3
text "!"
line "How's it going?"
done
|
apple-scripts/virtual/virtual-with-screen.applescript | productinfo/shuttle | 3,409 | 3730 | <gh_stars>1000+
--for testing uncomment the "on run" block
--on run
-- set argsCmd to "top"
-- set argsTitle to "Testing Top In Screen"
-- scriptRun(argsCmd, argsTitle)
--end run
on scriptRun(argsCmd, argsTitle)
set screenSwitches to "screen -d -m -S "
set screenSessionName to "'" & argsTitle & "' "
set withCmd to screenSwitches & screenSessionName & argsCmd
CommandRun(withCmd)
end scriptRun
on CommandRun(withCmd)
do shell script withCmd
end CommandRun |
data/pokemon/dex_entries/graveler.asm | Dev727/ancientplatinum | 28 | 245597 | <reponame>Dev727/ancientplatinum<filename>data/pokemon/dex_entries/graveler.asm
db "ROCK@" ; species name
dw 303, 2320 ; height, weight
db "It travels by rol-"
next "ling on mountain"
next "paths. If it gains"
page "too much speed, it"
next "stops by running"
next "into huge rocks.@"
|
utils/welcome.asm | peter-mount/departures8bit | 0 | 165450 | ; **********************************************************************
; C64 welcome page
; **********************************************************************
.welcome
{
LDA #12
JSR oswrch
JSR showPrompt
JSR outputReset ; Clear outputBuffer
LDXY welcomeText ; Append welcomeText
JSR outputAppendString
SEC
LDA highmem
SBC page
STA tempAddr
LDA highmem+1
SBC page+1
STA tempAddr+1
LDA #0
STA pad
JSR outputAppend16
LDXY bytesFree ; Append bytes free text
JSR outputAppendString
JSR writeOutputBuffer ; Write outputbuffer to screen
RTS
.welcomeText
EQUS 30, 10
EQUS 132, 157, 135, 141, 31, 10, 1, "UK Departure Boards", 13, 10
EQUS 132, 157, 135, 141, 31, 10, 2, "UK Departure Boards", 13, 10
EQUS 10, "DepartureBoards.mobi", 13, 10, 10
EQUS "Version 0.01a"
IF c64
EQUS " C64"
ELIF bbcmaster
EQUS " BBC Master"
ELIF bbc
EQUS " BBC B"
ENDIF
EQUS 13, 10, 0
.bytesFree
EQUS " bytes free.", 13, 10, 10, 0
} |
touchbar/status_wifi.scpt | ozinka/UsefulConfigsAndInfo | 1 | 1616 | <filename>touchbar/status_wifi.scpt
set device to do shell script "networksetup -listallhardwareports | awk '$3==\"Wi-Fi\" {getline;print}' | awk '{print $2}'"
set power to do shell script "networksetup -getairportpower " & device & " | awk '{print $4}'"
return {power, power}
|
programs/oeis/055/A055954.asm | neoneye/loda | 22 | 88945 | <filename>programs/oeis/055/A055954.asm
; A055954: n + reversal of base 7 digits of n (written in base 10).
; 0,2,4,6,8,10,12,8,16,24,32,40,48,56,16,24,32,40,48,56,64,24,32,40,48,56,64,72,32,40,48,56,64,72,80,40,48,56,64,72,80,88,48,56,64,72,80,88,96,50,100,150,200,250,300,350,64,114,164,214,264,314,364,78,128,178,228,278,328,378,92,142,192,242,292,342,392,106,156,206,256,306,356,406,120,170,220,270,320,370,420,134,184,234,284,334,384,434,100,150
mov $1,$0
seq $1,30106 ; Base 7 reversal of n (written in base 10).
add $0,$1
|
64/HelloWorld/HelloWorld.asm | m4riusz/Assembly-Language-Learning | 0 | 96685 | <reponame>m4riusz/Assembly-Language-Learning
STD_OUT equ 0x2000004
SYS_EXIT equ 0x2000001
section .data
text db "Hello, World!", 10
section .text
global start
start:
mov rax, STD_OUT
mov rdi, 1
mov rsi, text
mov rdx, 14
syscall
mov rax, SYS_EXIT
mov rdi, 0
syscall
|
VineScript/Compiler/VineParser.g4 | julsam/vinescript | 2 | 609 | parser grammar VineParser;
@members{
public enum EVineParseMode {
SINGLE_PASSAGE,
EVAL_EXPR
}
// by default, parse as a single passage
public EVineParseMode ParseMode = EVineParseMode.SINGLE_PASSAGE;
internal static readonly string errReservedChar000B =
"'\\v' (vertical tabulation) is a reserved character and is not allowed to be used!";
internal static readonly string errReservedChar001E =
"'\\u001E' (record separator) is a reserved character and is not allowed to be used!";
internal static readonly string errReservedChar001F =
"'\\u001F' (unit separator) is a reserved character and is not allowed to be used!";
internal static readonly string errVarDefReservedKw =
"Can't use a reserved keyword as a variable name!";
internal static readonly string errMissingSpaceBefore = "Missing space before ";
internal static readonly string errMissingSpaceAfter = "Missing space after ";
internal static readonly string errAssignMissingSet =
"Are you trying to assign a value to a variable without using the keyword 'set'?"
+ System.Environment.NewLine + "Here's a example of assignation: << set myvar = 0 >>";
private void ReservedChar()
{
var token = _input.Lt(-1);
ReservedChar(token);
}
private void ReservedChar(IToken token)
{
string msg = "";
if (token.Text.Contains("\u000B")) {
msg = errReservedChar000B;
}
else if (token.Text.Contains("\u001E")) {
msg = errReservedChar001E;
}
else if (token.Text.Contains("\u001F")) {
msg = errReservedChar001F;
}
NotifyPrev(token, msg);
}
private void NotifyPrev(string msg)
{
var token = _input.Lt(-1);
NotifyPrev(token, msg);
}
private void NotifyPrev(IToken token, string msg)
{
NotifyErrorListeners(token, msg, null);
}
}
options { tokenVocab=VineLexer; }
/*
* Parser Rules
*/
passage
: {ParseMode == EVineParseMode.EVAL_EXPR}? evalExprMode NL? EOF // active only if we're expr parse mode
| block* NL? EOF
| RESERVED_CHARS { ReservedChar(); }
| { NotifyErrorListeners("Error char"); } ERROR_CHAR
;
evalExprMode
: expr
;
// directOutput will add the text/code markups to the output.
// The output will then be parsed by the formatter.
block
: NL # directOutput
| verbatimStmt # noOutput // `as it is, escape << tags >> too`
| text # directOutput // everything else
| display # noOutput // {{ foo }}
| controlStmt # noOutput // << open stmt >> something << close stmt >>
| simpleStmtBlock # noOutput // << set foo = 0 >>
| link # noOutput // [[label|link]]
| collapseStmt # noOutput // { foo\nbar } => foobar
| BLOCK_COMMENT # directOutput // /* comment */
| LINE_COMMENT # directOutput // // inline comment
| RESERVED_CHARS { ReservedChar(); } # blockError
;
text
: TXT
;
simpleStmtBlock
: '<<' setStmt '>>'
| '<<' unsetStmt '>>'
| '<<' funcCall '>>'
;
link
: LLINK title=linkContent+ RLINK
| LLINK title=linkContent+ '|' '|' code=block* CLOSE_LINK
| LLINK title=linkContent+ '|' destination=linkContent+ RLINK
| LLINK title=linkContent+ '|' destination=linkContent+ '|' code=block* CLOSE_LINK
;
linkContent
: LINK_TEXT+
| RESERVED_CHARS { ReservedChar(); }
;
verbatimStmt
: VERBATIM
;
collapseStmt
: LCOLLAPSE
| RCOLLAPSE
//| LCOLLAPSE block* RCOLLAPSE // could use this rule if we want to be more strict
;
/**
* Display something in the text (variable, expression, function return, ...)
**/
display
: LOUTPUT expr ROUTPUT
;
setStmt
: 'set' assignList
| { NotifyErrorListeners(errAssignMissingSet); }
// using assignList creates too much problems (because of reservedKeywords
// defined in the 'variable' rule). It's easier to specify it this way:
('$')? ID (sequenceAccess)* op=('='|'to'|'+='|'-='|'*='|'/='|'%=') expr
;
assignList
: assign (',' assign)*
| assignList { NotifyErrorListeners("Missing ',' separator"); } assign (',' assign)*
| assignList { NotifyErrorListeners("Too many ','"); } ',' ',' assignList
;
assign
: variable (sequenceAccess)* op=('='|'to') expr
| variable (sequenceAccess)* op=('+='|'-='|'*='|'/='|'%=') expr
| { NotifyErrorListeners("Missing assignation operator and expression after the variable"); }
variable (sequenceAccess)* // this could be allowed to declare a var <<set myvar>>
| variable (sequenceAccess)*
{ NotifyErrorListeners("Missing assignation operator before expression"); } expr
| variable (sequenceAccess)* { NotifyErrorListeners("Missing expression after the operator"); }
op=('='|'to'|'+='|'-='|'*='|'/='|'%=')
;
unsetStmt
: 'unset' unsetList
;
unsetList
: variable (',' variable)*
| unsetList { NotifyErrorListeners("Missing ',' separator"); } variable (',' variable)*
| unsetList { NotifyErrorListeners("Too many ','"); } ',' ',' unsetList
;
funcCall
: ID '(' expressionList? ')'
| ID '(' expressionList? ')' { NotifyErrorListeners("Too many parentheses"); } ')'
| ID '(' expressionList? { NotifyErrorListeners("Missing closing ')'"); }
;
newSequence
: LBRACK expressionList? RBRACK # newArray
| LBRACE keyValueList? RBRACE # newDict
// array errors:
| LBRACK expressionList? RBRACK { NotifyErrorListeners("Too many brackets"); } RBRACK # newArrayError
| LBRACK expressionList? { NotifyErrorListeners("Missing closing ']'"); } # newArrayError
// dict errors:
| LBRACE keyValueList? RBRACE { NotifyErrorListeners("Too many braces"); } RBRACE # newDictError
| LBRACE keyValueList? { NotifyErrorListeners("Missing closing '}'"); } # newDictError
;
// if, elif, else, for, end
controlStmt
: ifStmt (elifStmt)* (elseStmt)? endStmt # ifCtrlStmt
| forStmt endStmt # forCtrlStmt
| ifStmt (elifStmt)* (elseStmt)? {NotifyErrorListeners("'if' statement is missing a closing '<< end >>'");} # ctrlStmtError
| ifStmt (elifStmt)* elseStmt {NotifyErrorListeners("Too many 'else' statements");} (elseStmt)+ # ctrlStmtError
| ifStmt {NotifyErrorListeners("Misplaced '<< else >>'");} (elseStmt) (elifStmt)+ endStmt # ctrlStmtError
| forStmt {NotifyErrorListeners("'for' statement is missing a closing '<< end >>'");} # ctrlStmtError
;
ifStmt
: '<<' 'if' wsa expr '>>' block*
;
elifStmt
: '<<' 'elif' wsa expr '>>' block*
;
elseStmt
: '<<' 'else' '>>' block*
;
endStmt
: '<<' 'end' '>>'
;
forStmt
: '<<' 'for' wsa variable 'in' expr '>>' NL? block* # forValueStmt
| '<<' 'for' wsa variable 'in' interval '>>' NL? block* # forValueStmt
| '<<' 'for' wsa key=variable ',' val=variable 'in' expr '>>' NL? block* # forKeyValueStmt
;
expr
: <assoc=right> left=expr '^' right=expr # powExpr
| op=(MINUS|'!') expr # unaryExpr
| left=expr op=('*' | DIV | '%') right=expr # mulDivModExpr
| left=expr op=('+'|MINUS) right=expr # addSubExpr
| left=expr op=(LT|GT|'<='|'>=') right=expr # relationalExpr
| left=expr op=('=='|'!=') right=expr # equalityExpr
| left=expr ('&&'|wsb 'and' wsa) right=expr # andExpr
| left=expr ('||'|wsb 'or' wsa) right=expr # orExpr
| '(' expr ')' # parensExpr
| newSequence # sequenceExpr
| expr (sequenceAccess)+ # anonymSequence
| funcCall # funcCallExpr
| atom # atomExpr
| variable (sequenceAccess)* # varExpr
;
expressionList
: expr (',' expr)*
| expr (',' { NotifyErrorListeners("Too many comma separators"); } ','+ expr)+
| expr (',' expr)* { NotifyErrorListeners("Too many comma separators"); } ','
;
keyValue
: stringLiteral ':' expr
| { NotifyErrorListeners("Invalid key value: it should look like this: '\"key\": value'"); } .
;
keyValueList
: keyValue (',' keyValue)*
| keyValue (',' { NotifyErrorListeners("Too many comma separators"); } ','+ keyValue)+
| keyValue (',' keyValue)* { NotifyErrorListeners("Too many comma separators"); } ','
;
atom: INT # intAtom
| FLOAT # floatAtom
| (TRUE | FALSE) # boolAtom
| stringLiteral # stringAtom
| NULL # nullAtom
;
stringLiteral
: STRING
| ILLEGAL_STRING { ReservedChar(); }
;
// Variable access. The '$' prefix is optional
variable
: '$'? ID ('.' ID)*
| { NotifyErrorListeners(errVarDefReservedKw); }
reservedKeyword
;
sequenceAccess
: LBRACK expr RBRACK
;
interval
: left=expr '...' right=expr
;
// Call to force whitespace. Kind of hacky?
// If the current token is not a white space => error.
// We use semantic predicates here because WS is in a different
// channel and the parser can't access directly
wsb // before
: {
if (_input.Get(_input.Index - 1).Type != WS) {
string offendingSymbol = _input.Get(_input.Index).Text;
NotifyErrorListeners(errMissingSpaceBefore + "'" + offendingSymbol + "'");
}
}
;
wsa // after
: {
if (_input.Get(_input.Index - 1).Type != WS) {
string offendingSymbol = _input.Get(_input.Index - 1).Text;
NotifyErrorListeners(errMissingSpaceAfter + "'" + offendingSymbol + "'");
}
}
;
reservedKeyword
: IF
| ELIF
| ELSE
| END
| KW_AND
| KW_OR
| TO
| SET
| UNSET
| TRUE
| FALSE
| NULL
;
|
programs/oeis/011/A011658.asm | karttu/loda | 1 | 19248 | ; A011658: Period 5: repeat [0, 0, 0, 1, 1]; also expansion of 1/(x^4 + x^3 + x^2 + x + 1) (mod 2).
; 0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0
mov $1,$0
mod $1,5
div $1,3
|
firmware/coreboot/3rdparty/libgfxinit/common/haswell/hw-gfx-gma-plls-lcpll.ads | fabiojna02/OpenCellular | 1 | 4659 | <filename>firmware/coreboot/3rdparty/libgfxinit/common/haswell/hw-gfx-gma-plls-lcpll.ads<gh_stars>1-10
--
-- Copyright (C) 2015-2016 secunet Security Networks AG
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
private package HW.GFX.GMA.PLLs.LCPLL
is
type Fixed_LCPLLs_Array is array (HW.GFX.DP_Bandwidth) of LCPLLs;
Fixed_LCPLLs : constant Fixed_LCPLLs_Array := Fixed_LCPLLs_Array'
(DP_Bandwidth_5_4 => LCPLL0,
DP_Bandwidth_2_7 => LCPLL1,
DP_Bandwidth_1_62 => LCPLL2);
type Value_Array is array (LCPLLs) of Word32;
Register_Value : constant Value_Array := Value_Array'
(LCPLL0 => 0 * 2 ** 29, LCPLL1 => 1 * 2 ** 29, LCPLL2 => 2 * 2 ** 29);
end HW.GFX.GMA.PLLs.LCPLL;
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/iface_test.ads | best08618/asylo | 7 | 12893 | package Iface_Test is
type Iface_1 is interface;
type Iface_2 is interface;
procedure Prepare_Select
(DB : Iface_1;
Iter : in out Iface_2'Class) is abstract;
type DT_1 is new Iface_1 with null record;
type Iterator is new Iface_2 with record
More : Boolean;
end record;
overriding procedure Prepare_Select
(DB : DT_1;
Iter : in out Standard.Iface_Test.Iface_2'Class);
end;
|
com.dynamo.cr/com.dynamo.cr.bob/src/com/dynamo/bob/pipeline/antlr/LuaLexer.g4 | cmarincia/defold | 2,231 | 5604 | <gh_stars>1000+
/*
BSD License
Copyright (c) 2013, <NAME> Copyright (c) 2016, <NAME>
(c) 2020, <NAME> All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution. 3. Neither the NAME of <NAME> 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.
This grammar file derived from:
Lua 5.3 Reference Manual http://www.lua.org/manual/5.3/manual.html
Lua 5.2 Reference Manual http://www.lua.org/manual/5.2/manual.html
Lua 5.1 grammar written by <NAME> http://www.antlr3.org/grammar/1178608849736/Lua.g
Tested by <NAME> with Test suite for Lua 5.2 (http://www.lua.org/tests/5.2/)
Tested by <NAME> with Test suite for Lua 5.3
http://www.lua.org/tests/lua-5.3.2-tests.tar.gz
Split into separate lexer and parser grammars + minor additions, <NAME>.
*/
lexer grammar LuaLexer;
channels {
COMMENTS
}
SEMICOLON: ';';
BREAK: 'break';
GOTO: 'goto';
DO: 'do';
WHILE: 'while';
END: 'end';
REPEAT: 'repeat';
UNTIL: 'until';
FOR: 'for';
FUNCTION: 'function';
LOCAL: 'local';
IF: 'if';
THEN: 'then';
ELSEIF: 'elseif';
ELSE: 'else';
RETURN: 'return';
COLON: ':';
DCOLON: '::';
DOT: '.';
COMMA: ',';
IN: 'in';
LPAREN: '(';
RPAREN: ')';
LBRACK: '[';
RBRACK: ']';
LBRACE: '{';
RBRACE: '}';
OR: 'or';
AND: 'and';
LT: '<';
GT: '>';
LTE: '<=';
GTE: '>=';
NEQ: '~=';
EQ: '==';
EQUALS: '=';
STRCAT: '..';
PLUS: '+';
MINUS: '-';
MUL: '*';
DIV: '/';
MOD: '%';
DIVFLOOR: '//';
BITAND: '&';
BITOR: '|';
BITNOT: '~';
BITSHL: '<<';
BITSHR: '>>';
NOT: 'not';
LEN: '#';
POWER: '^';
NIL: 'nil';
FALSE: 'false';
TRUE: 'true';
DOTS: '...';
NAME: [a-zA-Z_][a-zA-Z_0-9]*;
NORMALSTRING: '"' ( EscapeSequence | ~('\\' | '"'))* '"';
CHARSTRING: '\'' ( EscapeSequence | ~('\'' | '\\'))* '\'';
LONGSTRING: '[' NESTED_STR ']';
fragment NESTED_STR: '=' NESTED_STR '=' | '[' .*? ']';
INT: Digit+;
HEX: '0' [xX] HexDigit+;
FLOAT:
Digit+ '.' Digit* ExponentPart?
| '.' Digit+ ExponentPart?
| Digit+ ExponentPart;
HEX_FLOAT:
'0' [xX] HexDigit+ '.' HexDigit* HexExponentPart?
| '0' [xX] '.' HexDigit+ HexExponentPart?
| '0' [xX] HexDigit+ HexExponentPart;
fragment ExponentPart: [eE] [+-]? Digit+;
fragment HexExponentPart: [pP] [+-]? Digit+;
fragment EscapeSequence:
'\\' [abfnrtvz"'\\]
| '\\' '\r'? '\n'
| DecimalEscape
| HexEscape
| UtfEscape;
fragment DecimalEscape:
'\\' Digit
| '\\' Digit Digit
| '\\' [0-2] Digit Digit;
fragment HexEscape: '\\' 'x' HexDigit HexDigit;
fragment UtfEscape: '\\' 'u{' HexDigit+ '}';
fragment Digit: [0-9];
fragment HexDigit: [0-9a-fA-F];
COMMENT: '--[' NESTED_STR ']' -> channel(COMMENTS);
LINE_COMMENT:
'--' (
// --
| '[' '='* // --[==
| '[' '='* ~('=' | '[' | '\r' | '\n') ~('\r' | '\n')* // --[==AA
| ~('[' | '\r' | '\n') ~('\r' | '\n')* // --AAA
) ('\r\n' | '\r' | '\n' | EOF) -> channel(COMMENTS);
WS: [ \t\u000C\r\n]+ -> channel(HIDDEN);
SHEBANG: '#' '!' ~('\n' | '\r')* -> channel(HIDDEN); |
STM8S105C6T6/Assembler/Project_2/STM8S105C6.asm | edosedgar/stm8s | 2 | 27606 | ;====================================================================================
WORDS ; The following addresses are 16 bits long
segment byte at 4000-43FF 'EEPROM'
WORDS ; The following addresses are 16 bits long
segment byte at 8080-FFFF 'ROM'
WORDS ; The following addresses are 16 bits long
segment byte at 8000-807F 'INTERRUPT'
;====================================================================================
PORTA EQU $5000
PINA EQU $5001
DDRA EQU $5002
CR1A EQU $5003
CR2A EQU $5004
;====================================================================================
PORTB EQU $5005
PINB EQU $5006
DDRB EQU $5007
CR1B EQU $5008
CR2B EQU $5009
;====================================================================================
PORTC EQU $500A
PINC EQU $500B
DDRC EQU $500C
CR1C EQU $500D
CR2C EQU $500E
;====================================================================================
PORTD EQU $500F
PIND EQU $5010
DDRD EQU $5011
CR1D EQU $5012
CR2D EQU $5013
;====================================================================================
PORTE EQU $5014
PINE EQU $5015
DDRE EQU $5016
CR1E EQU $5017
CR2E EQU $5018
;====================================================================================
PORTG EQU $501E
PING EQU $501F
DDRG EQU $5020
CR1G EQU $5021
CR2G EQU $5022
;====================================================================================
EXTI_CR1 EQU $50A0 ; External interrupt control register 1
EXTI_CR2 EQU $50A1 ; External interrupt control register 2
RST_SR EQU $50B3 ; Reset status register
;====================================================================================
CLK_ICKR EQU $50C0 ; Internal clock control register
CLK_ECKR EQU $50C1 ; External clock control register
CLK_CMSR EQU $50C3 ; Clock master status register
CLK_SWR EQU $50C4 ; Clock master switch register
CLK_SWCR EQU $50C5 ; Clock switch control register
CLK_CKDIVR EQU $50C6 ; Clock divider register
CLK_PCKENR1 EQU $50C7 ; Peripheral clock gating register 1
CLK_CSSR EQU $50C8 ; Clock security system register
CLK_CCOR EQU $50C9 ; Configurable clock control register
CLK_PCKENR2 EQU $50CA ; Peripheral clock gating register 2
CLK_CANCCR EQU $50CB ; CAN clock control register
CLK_HSITRIMR EQU $50CC ; HSI clock calibration trimming register
CLK_SWIMCCR EQU $50CD ; SWIM clock control register
;====================================================================================
UART1_SR EQU $5230 ; UART1 status register
UART1_DR EQU $5231 ; UART1 data register
UART1_BRR1 EQU $5232 ; UART1 baud rate register
UART1_BRR2 EQU $5233 ; UART1 baud rate register
UART1_CR1 EQU $5234 ; UART1 control register 1
UART1_CR2 EQU $5235 ; UART1 control register 2
UART1_CR3 EQU $5236 ; UART1 control register 3
UART1_CR4 EQU $5237 ; UART1 control register 4
UART1_CR5 EQU $5238 ; UART1 control register 5
UART1_GTR EQU $5239 ; UART1 guard time register
UART1_PSCR EQU $523A ; UART1 prescaler register
;====================================================================================
SPI_CR1 EQU $5200 ; SPI control register 1
SPI_CR2 EQU $5201 ; SPI control register 2
SPI_ICR EQU $5202 ; SPI interrupt control register
SPI_SR EQU $5203 ; SPI status register
SPI_DR EQU $5204 ; SPI data register
SPI_CRCPR EQU $5205 ; SPI CRC polynomial register
SPI_RXCRCR EQU $5206 ; SPI Rx CRC register
SPI_TXCRCR EQU $5207 ; SPI Tx CRC register
;====================================================================================
FLASH_CR1 EQU $505A ; Flash control register 1
FLASH_CR2 EQU $505B ; Flash control register 2
FLASH_NCR2 EQU $505C ; Flash complementary control register 2
FLASH_FPR EQU $505D ; Flash protection register
FLASH_NFPR EQU $505E ; Flash complementary protection register
FLASH_IAPSR EQU $505F ; Flash in-application programming status register
FLASH_PUKR EQU $5062 ; Flash program memory unprotection register
FLASH_DUKR EQU $5064 ; Data EEPROM unprotection register
;====================================================================================
WWDG_CR EQU $50D1 ; WWDG control register
WWDG_WR EQU $50D2 ; WWDR window register
IWDG_KR EQU $50E0 ; IWDG key register
IWDG_PR EQU $50E1 ; IWDG prescaler register
IWDG_RLR EQU $50E2 ; IWDG reload register
AWU_CSR1 EQU $50F0 ; AWU control/status register 1
AWU_APR EQU $50F1 ; AWU asynchronous prescaler buffer register
AWU_TBR EQU $50F2 ; AWU timebase selection register
BEEP_CSR EQU $50F3 ; BEEP control/status register
;====================================================================================
TIM1_CR1 EQU $5250 ; TIM1 control register 1
TIM1_CR2 EQU $5251 ; TIM1 control register 2
TIM1_SMCR EQU $5252 ; TIM1 slave mode control register
TIM1_ETR EQU $5253 ; TIM1 external trigger register
TIM1_IER EQU $5254 ; TIM1 interrupt enable register
TIM1_SR1 EQU $5255 ; TIM1 status register 1
TIM1_SR2 EQU $5256 ; TIM1 status register 2
TIM1_EGR EQU $5257 ; TIM1 event generation register
TIM1_CCMR1 EQU $5258 ; TIM1 capture/compare mode register 1
TIM1_CCMR2 EQU $5259 ; TIM1 capture/compare mode register 2
TIM1_CCMR3 EQU $525A ; TIM1 capture/compare mode register 3
TIM1_CCMR4 EQU $525B ; TIM1 capture/compare mode register 4
TIM1_CCER1 EQU $525C ; TIM1 capture/compare enable register 1
TIM1_CCER2 EQU $525D ; TIM1 capture/compare enable register 2
TIM1_CNTRH EQU $525E ; TIM1 counter high
TIM1_CNTRL EQU $525F ; TIM1 counter low
TIM1_PSCRH EQU $5260 ; TIM1 prescaler register high
TIM1_PSCRL EQU $5261 ; TIM1 prescaler register low
TIM1_ARRH EQU $5262 ; TIM1 auto-reload register high
TIM1_ARRL EQU $5263 ; TIM1 auto-reload register low
TIM1_RCR EQU $5264 ; TIM1 repetition counter register
TIM1_CCR1H EQU $5265 ; TIM1 capture/compare register 1 high
TIM1_CCR1L EQU $5266 ; TIM1 capture/compare register 1 low
TIM1_CCR2H EQU $5267 ; TIM1 capture/compare register 2 high
TIM1_CCR2L EQU $5268 ; TIM1 capture/compare register 2 low
TIM1_CCR3H EQU $5269 ; TIM1 capture/compare register 3 high
TIM1_CCR3L EQU $526A ; TIM1 capture/compare register 3 low
TIM1_CCR4H EQU $526B ; TIM1 capture/compare register 4 high
TIM1_CCR4L EQU $526C ; TIM1 capture/compare register 4 low
TIM1_BKR EQU $526D ; TIM1 break register
TIM1_DTR EQU $526E ; TIM1 dead-time register
TIM1_OISR EQU $526F ; TIM1 output idle state register
;====================================================================================
UIF EQU $0000
;====================================================================================
TIM2_CR1 EQU $5300 ; TIM2 control register 1
TIM2_IER EQU $5301 ; TIM2 Interrupt enable register
TIM2_SR1 EQU $5302 ; TIM2 status register 1
TIM2_SR2 EQU $5303 ; TIM2 status register 2
TIM2_EGR EQU $5304 ; TIM2 event generation register
TIM2_CCMR1 EQU $5305 ; TIM2 capture/compare mode register 1
TIM2_CCMR2 EQU $5306 ; TIM2 capture/compare mode register 2
TIM2_CCMR3 EQU $5307 ; TIM2 capture/compare mode register 3
TIM2_CCER1 EQU $5308 ; TIM2 capture/compare enable register 1
TIM2_CCER2 EQU $5309 ; TIM2 capture/compare enable register 2
TIM2_CNTRH EQU $530A ; TIM2 counter high
TIM2_CNTRL EQU $530B ; TIM2 counter low
TIM2_PSCR EQU $530C ; TIM2 prescaler register
TIM2_ARRH EQU $530D ; TIM2 auto-reload register high
TIM2_ARRL EQU $530E ; TIM2 auto-reload register low
TIM2_CCR1H EQU $530F ; TIM2 capture/compare register 1 high
TIM2_CCR1L EQU $5310 ; TIM2 capture/compare register 1 low
TIM2_CCR2H EQU $5311 ; TIM2 capture/compare reg. 2 high
TIM2_CCR2L EQU $5312 ; TIM2 capture/compare register 2 low
TIM2_CCR3H EQU $5313 ; TIM2 capture/compare register 3 high
TIM2_CCR3L EQU $5314 ; TIM2 capture/compare register 3 low
;====================================================================================
TIM3_CR1 EQU $5320 ;TIM3 control register 1
TIM3_IER EQU $5321 ;TIM3 interrupt enable register
TIM3_SR1 EQU $5322 ;TIM3 status register 1
TIM3_SR2 EQU $5323 ;TIM3 status register 2
TIM3_EGR EQU $5324 ;TIM3 event generation register
TIM3_CCMR1 EQU $5325 ;TIM3 capture/compare mode register 1
TIM3_CCMR2 EQU $5326 ;TIM3 capture/compare mode register 2
TIM3_CCER1 EQU $5327 ;TIM3 capture/compare enable register 1
TIM3_CNTRH EQU $5328 ;TIM3 counter high
TIM3_CNTRL EQU $5329 ;TIM3 counter low
TIM3_PSCR EQU $532A ;TIM3 prescaler register
TIM3_ARRH EQU $532B ;TIM3 auto-reload register high
TIM3_ARRL EQU $532C ;TIM3 auto-reload register low
TIM3_CCR1H EQU $532D ;TIM3 capture/compare register 1 high
TIM3_CCR1L EQU $532E ;TIM3 capture/compare register 1 low
TIM3_CCR2H EQU $532F ;TIM3 capture/compare register 2 high
TIM3_CCR2L EQU $5330 ;TIM3 capture/compare register 2 low
;====================================================================================
TIM4_CR1 EQU $5340 ; TIM4 control register 1
TIM4_IER EQU $5341 ; TIM4 interrupt enable register
TIM4_SR EQU $5342 ; TIM4 status register
TIM4_EGR EQU $5343 ; TIM4 event generation register
TIM4_CNTR EQU $5344 ; TIM4 counter
TIM4_PSCR EQU $5345 ; TIM4 prescaler register
TIM4_ARR EQU $5346 ; TIM4 auto-reload register
;====================================================================================
ADC_CSR EQU $5400 ; ADC control/status register
ADC_CR1 EQU $5401 ; ADC configuration register 1
ADC_CR2 EQU $5402 ; ADC configuration register 2
ADC_CR3 EQU $5403 ; ADC configuration register 3
ADC_DRH EQU $5404 ; ADC data register high
ADC_DRL EQU $5405 ; ADC data register low
ADC_TDRH EQU $5406 ; ADC Schmitt trigger disable register high
ADC_TDRL EQU $5407 ; ADC Schmitt trigger disable register low
ADC_HTRH EQU $5408 ; ADC high threshold register high
ADC_HTRL EQU $5409 ; ADC high threshold register low
ADC_LTRH EQU $540A ; ADC low threshold register high
ADC_LTRL EQU $540B ; ADC low threshold register low
ADC_AWSRH EQU $540C ; ADC analog watchdog status register high
ADC_AWSRL EQU $540D ; ADC analog watchdog status register low
ADC_AWCRH EQU $540E ; ADC analog watchdog control register high
ADC_AWCRL EQU $540F ; ADC analog watchdog control register low
;====================================================================================
CFG_GCR EQU $7F60 ; Global configuration register
ITC_SPR1 EQU $7F70 ; Interrupt software priority register 1
ITC_SPR2 EQU $7F71 ; Interrupt software priority register 2
ITC_SPR3 EQU $7F72 ; Interrupt software priority register 3
ITC_SPR4 EQU $7F73 ; Interrupt software priority register 4
ITC_SPR5 EQU $7F74 ; Interrupt software priority register 5
ITC_SPR6 EQU $7F75 ; Interrupt software priority register 6
ITC_SPR7 EQU $7F76 ; Interrupt software priority register 7
ITC_SPR8 EQU $7F77 ; Interrupt software priority register 8
SWIM_CSR EQU $7F80 ; SWIM control status register
;====================================================================================
CCR EQU $7F0A
X_L EQU $7F05
X_H EQU $7F04
Y_L EQU $7F07
Y_H EQU $7F06
ACC EQU $7F00
;====================================================================================
SEGMENT 'ROM'
;====================================================================================
NoneInterrupt:
IRET
;====================================================================================
InitMemory:
;Init Stack
LDW X,#$07FF
LDW SP,X
LDW X,#$0000
ClearRam0:
CLR (X)
INCW X
CPW X,#$00FF
JRULE ClearRam0
LDW X,#$0100
ClearRam1:
CLR (X)
INCW X
CPW X,#$01FF
JRULE ClearRam1
LDW X,#$0200
ClearStack:
CLR (X)
INCW X
CPW X,#$03FF
JRULE ClearStack
call SystemStart
GeneralCycle:
WFI
JP GeneralCycle
;====================================================================================
END |
tests/z80/op_IY_BIT_FDCB.asm | cizo2000/sjasmplus | 220 | 12350 | OUTPUT "op_IY_BIT_FDCB.bin"
;;; generate shift instructions: #FDCBFF00 .. #FDCBFF3F ("iy-1" = FF index byte)
LUA ALLPASS
instructions = { 'rlc', 'rrc', 'rl', 'rr', 'sla', 'sra', 'sli', 'srl' }
registers = { '(iy-1),b', '(iy-1),c', '(iy-1),d', '(iy-1),e', '(iy-1),h', '(iy-1),l', '(iy-1)', '(iy-1),a' }
for ii = 1, #instructions do
for rr = 1, #registers do
instruction = instructions[ii]..' '..registers[rr]
_pc(instruction)
end
end
ENDLUA
;;; generate `bit` instructions: #FDCBFF46 .. #FDCBFF7E (two: {#x6, #xE})
LUA ALLPASS
for bb = 0, 7 do
instruction = 'bit '..bb..',(iy-1)'
_pc(instruction)
end
ENDLUA
;;; generate `res` + `set` instructions: #FDCB1180 .. #FDCB11FF ("iy+17" = 11 index byte)
LUA ALLPASS
instructions = { 'res', 'set' }
registers = { '(iy+17),b', '(iy+17),c', '(iy+17),d', '(iy+17),e', '(iy+17),h', '(iy+17),l', '(iy+17)', '(iy+17),a' }
for ii = 1, #instructions do
for bb = 0, 7 do
for rr = 1, #registers do
instruction = instructions[ii]..' '..bb..','..registers[rr]
_pc(instruction)
end
end
end
ENDLUA
|
lab/jos/obj/kern/kernel.asm | Bit64L/MIT6.828 | 0 | 170940 | <gh_stars>0
obj/kern/kernel: file format elf32-i386
Disassembly of section .text:
f0100000 <_start+0xeffffff4>:
.globl _start
_start = RELOC(entry)
.globl entry
entry:
movw $0x1234,0x472 # warm boot
f0100000: 02 b0 ad 1b 00 00 add 0x1bad(%eax),%dh
f0100006: 00 00 add %al,(%eax)
f0100008: fe 4f 52 decb 0x52(%edi)
f010000b: e4 66 in $0x66,%al
f010000c <entry>:
f010000c: 66 c7 05 72 04 00 00 movw $0x1234,0x472
f0100013: 34 12
# sufficient until we set up our real page table in mem_init
# in lab 2.
# Load the physical address of entry_pgdir into cr3. entry_pgdir
# is defined in entrypgdir.c.
movl $(RELOC(entry_pgdir)), %eax
f0100015: b8 00 70 11 00 mov $0x117000,%eax
movl %eax, %cr3
f010001a: 0f 22 d8 mov %eax,%cr3
# Turn on paging.
movl %cr0, %eax
f010001d: 0f 20 c0 mov %cr0,%eax
orl $(CR0_PE|CR0_PG|CR0_WP), %eax
f0100020: 0d 01 00 01 80 or $0x80010001,%eax
movl %eax, %cr0
f0100025: 0f 22 c0 mov %eax,%cr0
# Now paging is enabled, but we're still running at a low EIP
# (why is this okay?). Jump up above KERNBASE before entering
# C code.
mov $relocated, %eax
f0100028: b8 2f 00 10 f0 mov $0xf010002f,%eax
jmp *%eax
f010002d: ff e0 jmp *%eax
f010002f <relocated>:
relocated:
# Clear the frame pointer register (EBP)
# so that once we get into debugging C code,
# stack backtraces will be terminated properly.
movl $0x0,%ebp # nuke frame pointer
f010002f: bd 00 00 00 00 mov $0x0,%ebp
# Set the stack pointer
movl $(bootstacktop),%esp
f0100034: bc 00 70 11 f0 mov $0xf0117000,%esp
# now to C code
call i386_init
f0100039: e8 5f 00 00 00 call f010009d <i386_init>
f010003e <spin>:
# Should never get here, but in case we do, just spin.
spin: jmp spin
f010003e: eb fe jmp f010003e <spin>
f0100040 <test_backtrace>:
#include <kern/console.h>
// Test the stack backtrace function (lab 1 only)
void
test_backtrace(int x)
{
f0100040: 55 push %ebp
f0100041: 89 e5 mov %esp,%ebp
f0100043: 53 push %ebx
f0100044: 83 ec 14 sub $0x14,%esp
f0100047: 8b 5d 08 mov 0x8(%ebp),%ebx
cprintf("entering test_backtrace %d\n", x);
f010004a: 89 5c 24 04 mov %ebx,0x4(%esp)
f010004e: c7 04 24 a0 17 10 f0 movl $0xf01017a0,(%esp)
f0100055: e8 84 08 00 00 call f01008de <cprintf>
if (x > 0)
f010005a: 85 db test %ebx,%ebx
f010005c: 7e 0d jle f010006b <test_backtrace+0x2b>
test_backtrace(x-1);
f010005e: 8d 43 ff lea -0x1(%ebx),%eax
f0100061: 89 04 24 mov %eax,(%esp)
f0100064: e8 d7 ff ff ff call f0100040 <test_backtrace>
f0100069: eb 1c jmp f0100087 <test_backtrace+0x47>
else
mon_backtrace(0, 0, 0);
f010006b: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
f0100072: 00
f0100073: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
f010007a: 00
f010007b: c7 04 24 00 00 00 00 movl $0x0,(%esp)
f0100082: e8 d1 06 00 00 call f0100758 <mon_backtrace>
cprintf("leaving test_backtrace %d\n", x);
f0100087: 89 5c 24 04 mov %ebx,0x4(%esp)
f010008b: c7 04 24 bc 17 10 f0 movl $0xf01017bc,(%esp)
f0100092: e8 47 08 00 00 call f01008de <cprintf>
}
f0100097: 83 c4 14 add $0x14,%esp
f010009a: 5b pop %ebx
f010009b: 5d pop %ebp
f010009c: c3 ret
f010009d <i386_init>:
void
i386_init(void)
{
f010009d: 55 push %ebp
f010009e: 89 e5 mov %esp,%ebp
f01000a0: 83 ec 18 sub $0x18,%esp
extern char edata[], end[];
// Before doing anything else, complete the ELF loading process.
// Clear the uninitialized global data (BSS) section of our program.
// This ensures that all static/global variables start out zero.
memset(edata, 0, end - edata);
f01000a3: b8 40 99 11 f0 mov $0xf0119940,%eax
f01000a8: 2d 00 93 11 f0 sub $0xf0119300,%eax
f01000ad: 89 44 24 08 mov %eax,0x8(%esp)
f01000b1: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
f01000b8: 00
f01000b9: c7 04 24 00 93 11 f0 movl $0xf0119300,(%esp)
f01000c0: e8 85 12 00 00 call f010134a <memset>
// Initialize the console.
// Can't call cprintf until after we do this!
cons_init();
f01000c5: e8 77 04 00 00 call f0100541 <cons_init>
cprintf("6828 decimal is %o octal!\n", 6828);
f01000ca: c7 44 24 04 ac 1a 00 movl $0x1aac,0x4(%esp)
f01000d1: 00
f01000d2: c7 04 24 d7 17 10 f0 movl $0xf01017d7,(%esp)
f01000d9: e8 00 08 00 00 call f01008de <cprintf>
// Test the stack backtrace function (lab 1 only)
test_backtrace(5);
f01000de: c7 04 24 05 00 00 00 movl $0x5,(%esp)
f01000e5: e8 56 ff ff ff call f0100040 <test_backtrace>
// Drop into the kernel monitor.
while (1)
monitor(NULL);
f01000ea: c7 04 24 00 00 00 00 movl $0x0,(%esp)
f01000f1: e8 6c 06 00 00 call f0100762 <monitor>
f01000f6: eb f2 jmp f01000ea <i386_init+0x4d>
f01000f8 <_panic>:
* Panic is called on unresolvable fatal errors.
* It prints "panic: mesg", and then enters the kernel monitor.
*/
void
_panic(const char *file, int line, const char *fmt,...)
{
f01000f8: 55 push %ebp
f01000f9: 89 e5 mov %esp,%ebp
f01000fb: 56 push %esi
f01000fc: 53 push %ebx
f01000fd: 83 ec 10 sub $0x10,%esp
f0100100: 8b 75 10 mov 0x10(%ebp),%esi
va_list ap;
if (panicstr)
f0100103: 83 3d 44 99 11 f0 00 cmpl $0x0,0xf0119944
f010010a: 75 3d jne f0100149 <_panic+0x51>
goto dead;
panicstr = fmt;
f010010c: 89 35 44 99 11 f0 mov %esi,0xf0119944
// Be extra sure that the machine is in as reasonable state
asm volatile("cli; cld");
f0100112: fa cli
f0100113: fc cld
va_start(ap, fmt);
f0100114: 8d 5d 14 lea 0x14(%ebp),%ebx
cprintf("kernel panic at %s:%d: ", file, line);
f0100117: 8b 45 0c mov 0xc(%ebp),%eax
f010011a: 89 44 24 08 mov %eax,0x8(%esp)
f010011e: 8b 45 08 mov 0x8(%ebp),%eax
f0100121: 89 44 24 04 mov %eax,0x4(%esp)
f0100125: c7 04 24 f2 17 10 f0 movl $0xf01017f2,(%esp)
f010012c: e8 ad 07 00 00 call f01008de <cprintf>
vcprintf(fmt, ap);
f0100131: 89 5c 24 04 mov %ebx,0x4(%esp)
f0100135: 89 34 24 mov %esi,(%esp)
f0100138: e8 6e 07 00 00 call f01008ab <vcprintf>
cprintf("\n");
f010013d: c7 04 24 2e 18 10 f0 movl $0xf010182e,(%esp)
f0100144: e8 95 07 00 00 call f01008de <cprintf>
va_end(ap);
dead:
/* break into the kernel monitor */
while (1)
monitor(NULL);
f0100149: c7 04 24 00 00 00 00 movl $0x0,(%esp)
f0100150: e8 0d 06 00 00 call f0100762 <monitor>
f0100155: eb f2 jmp f0100149 <_panic+0x51>
f0100157 <_warn>:
}
/* like panic, but don't */
void
_warn(const char *file, int line, const char *fmt,...)
{
f0100157: 55 push %ebp
f0100158: 89 e5 mov %esp,%ebp
f010015a: 53 push %ebx
f010015b: 83 ec 14 sub $0x14,%esp
va_list ap;
va_start(ap, fmt);
f010015e: 8d 5d 14 lea 0x14(%ebp),%ebx
cprintf("kernel warning at %s:%d: ", file, line);
f0100161: 8b 45 0c mov 0xc(%ebp),%eax
f0100164: 89 44 24 08 mov %eax,0x8(%esp)
f0100168: 8b 45 08 mov 0x8(%ebp),%eax
f010016b: 89 44 24 04 mov %eax,0x4(%esp)
f010016f: c7 04 24 0a 18 10 f0 movl $0xf010180a,(%esp)
f0100176: e8 63 07 00 00 call f01008de <cprintf>
vcprintf(fmt, ap);
f010017b: 89 5c 24 04 mov %ebx,0x4(%esp)
f010017f: 8b 45 10 mov 0x10(%ebp),%eax
f0100182: 89 04 24 mov %eax,(%esp)
f0100185: e8 21 07 00 00 call f01008ab <vcprintf>
cprintf("\n");
f010018a: c7 04 24 2e 18 10 f0 movl $0xf010182e,(%esp)
f0100191: e8 48 07 00 00 call f01008de <cprintf>
va_end(ap);
}
f0100196: 83 c4 14 add $0x14,%esp
f0100199: 5b pop %ebx
f010019a: 5d pop %ebp
f010019b: c3 ret
f010019c <delay>:
static void cons_putc(int c);
// Stupid I/O delay routine necessitated by historical PC design flaws
static void
delay(void)
{
f010019c: 55 push %ebp
f010019d: 89 e5 mov %esp,%ebp
static inline uint8_t
inb(int port)
{
uint8_t data;
asm volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f010019f: ba 84 00 00 00 mov $0x84,%edx
f01001a4: ec in (%dx),%al
f01001a5: ec in (%dx),%al
f01001a6: ec in (%dx),%al
f01001a7: ec in (%dx),%al
inb(0x84);
inb(0x84);
inb(0x84);
inb(0x84);
}
f01001a8: 5d pop %ebp
f01001a9: c3 ret
f01001aa <serial_proc_data>:
static bool serial_exists;
static int
serial_proc_data(void)
{
f01001aa: 55 push %ebp
f01001ab: 89 e5 mov %esp,%ebp
f01001ad: ba fd 03 00 00 mov $0x3fd,%edx
f01001b2: ec in (%dx),%al
if (!(inb(COM1+COM_LSR) & COM_LSR_DATA))
f01001b3: a8 01 test $0x1,%al
f01001b5: 74 08 je f01001bf <serial_proc_data+0x15>
f01001b7: b2 f8 mov $0xf8,%dl
f01001b9: ec in (%dx),%al
return -1;
return inb(COM1+COM_RX);
f01001ba: 0f b6 c0 movzbl %al,%eax
f01001bd: eb 05 jmp f01001c4 <serial_proc_data+0x1a>
static int
serial_proc_data(void)
{
if (!(inb(COM1+COM_LSR) & COM_LSR_DATA))
return -1;
f01001bf: b8 ff ff ff ff mov $0xffffffff,%eax
return inb(COM1+COM_RX);
}
f01001c4: 5d pop %ebp
f01001c5: c3 ret
f01001c6 <cons_intr>:
// called by device interrupt routines to feed input characters
// into the circular console input buffer.
static void
cons_intr(int (*proc)(void))
{
f01001c6: 55 push %ebp
f01001c7: 89 e5 mov %esp,%ebp
f01001c9: 53 push %ebx
f01001ca: 83 ec 04 sub $0x4,%esp
f01001cd: 89 c3 mov %eax,%ebx
int c;
while ((c = (*proc)()) != -1) {
f01001cf: eb 29 jmp f01001fa <cons_intr+0x34>
if (c == 0)
f01001d1: 85 c0 test %eax,%eax
f01001d3: 74 25 je f01001fa <cons_intr+0x34>
continue;
cons.buf[cons.wpos++] = c;
f01001d5: 8b 15 24 95 11 f0 mov 0xf0119524,%edx
f01001db: 88 82 20 93 11 f0 mov %al,-0xfee6ce0(%edx)
f01001e1: 8d 42 01 lea 0x1(%edx),%eax
f01001e4: a3 24 95 11 f0 mov %eax,0xf0119524
if (cons.wpos == CONSBUFSIZE)
f01001e9: 3d 00 02 00 00 cmp $0x200,%eax
f01001ee: 75 0a jne f01001fa <cons_intr+0x34>
cons.wpos = 0;
f01001f0: c7 05 24 95 11 f0 00 movl $0x0,0xf0119524
f01001f7: 00 00 00
static void
cons_intr(int (*proc)(void))
{
int c;
while ((c = (*proc)()) != -1) {
f01001fa: ff d3 call *%ebx
f01001fc: 83 f8 ff cmp $0xffffffff,%eax
f01001ff: 75 d0 jne f01001d1 <cons_intr+0xb>
continue;
cons.buf[cons.wpos++] = c;
if (cons.wpos == CONSBUFSIZE)
cons.wpos = 0;
}
}
f0100201: 83 c4 04 add $0x4,%esp
f0100204: 5b pop %ebx
f0100205: 5d pop %ebp
f0100206: c3 ret
f0100207 <cons_putc>:
}
// output a character to the console
static void
cons_putc(int c)
{
f0100207: 55 push %ebp
f0100208: 89 e5 mov %esp,%ebp
f010020a: 57 push %edi
f010020b: 56 push %esi
f010020c: 53 push %ebx
f010020d: 83 ec 2c sub $0x2c,%esp
f0100210: 89 c6 mov %eax,%esi
f0100212: bb 01 32 00 00 mov $0x3201,%ebx
f0100217: bf fd 03 00 00 mov $0x3fd,%edi
f010021c: eb 05 jmp f0100223 <cons_putc+0x1c>
int i;
for (i = 0;
!(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800;
i++)
delay();
f010021e: e8 79 ff ff ff call f010019c <delay>
f0100223: 89 fa mov %edi,%edx
f0100225: ec in (%dx),%al
static void
serial_putc(int c)
{
int i;
for (i = 0;
f0100226: a8 20 test $0x20,%al
f0100228: 75 03 jne f010022d <cons_putc+0x26>
!(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800;
f010022a: 4b dec %ebx
f010022b: 75 f1 jne f010021e <cons_putc+0x17>
i++)
delay();
outb(COM1 + COM_TX, c);
f010022d: 89 f2 mov %esi,%edx
f010022f: 89 f0 mov %esi,%eax
f0100231: 88 55 e7 mov %dl,-0x19(%ebp)
}
static inline void
outb(int port, uint8_t data)
{
asm volatile("outb %0,%w1" : : "a" (data), "d" (port));
f0100234: ba f8 03 00 00 mov $0x3f8,%edx
f0100239: ee out %al,(%dx)
f010023a: bb 01 32 00 00 mov $0x3201,%ebx
static inline uint8_t
inb(int port)
{
uint8_t data;
asm volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f010023f: bf 79 03 00 00 mov $0x379,%edi
f0100244: eb 05 jmp f010024b <cons_putc+0x44>
lpt_putc(int c)
{
int i;
for (i = 0; !(inb(0x378+1) & 0x80) && i < 12800; i++)
delay();
f0100246: e8 51 ff ff ff call f010019c <delay>
f010024b: 89 fa mov %edi,%edx
f010024d: ec in (%dx),%al
static void
lpt_putc(int c)
{
int i;
for (i = 0; !(inb(0x378+1) & 0x80) && i < 12800; i++)
f010024e: 84 c0 test %al,%al
f0100250: 78 03 js f0100255 <cons_putc+0x4e>
f0100252: 4b dec %ebx
f0100253: 75 f1 jne f0100246 <cons_putc+0x3f>
}
static inline void
outb(int port, uint8_t data)
{
asm volatile("outb %0,%w1" : : "a" (data), "d" (port));
f0100255: ba 78 03 00 00 mov $0x378,%edx
f010025a: 8a 45 e7 mov -0x19(%ebp),%al
f010025d: ee out %al,(%dx)
f010025e: b2 7a mov $0x7a,%dl
f0100260: b0 0d mov $0xd,%al
f0100262: ee out %al,(%dx)
f0100263: b0 08 mov $0x8,%al
f0100265: ee out %al,(%dx)
static void
cga_putc(int c)
{
// if no attribute given, then use black on white
if (!(c & ~0xFF))
f0100266: f7 c6 00 ff ff ff test $0xffffff00,%esi
f010026c: 75 06 jne f0100274 <cons_putc+0x6d>
c |= 0x0700;
f010026e: 81 ce 00 07 00 00 or $0x700,%esi
switch (c & 0xff) {
f0100274: 89 f0 mov %esi,%eax
f0100276: 25 ff 00 00 00 and $0xff,%eax
f010027b: 83 f8 09 cmp $0x9,%eax
f010027e: 74 78 je f01002f8 <cons_putc+0xf1>
f0100280: 83 f8 09 cmp $0x9,%eax
f0100283: 7f 0b jg f0100290 <cons_putc+0x89>
f0100285: 83 f8 08 cmp $0x8,%eax
f0100288: 0f 85 9e 00 00 00 jne f010032c <cons_putc+0x125>
f010028e: eb 10 jmp f01002a0 <cons_putc+0x99>
f0100290: 83 f8 0a cmp $0xa,%eax
f0100293: 74 39 je f01002ce <cons_putc+0xc7>
f0100295: 83 f8 0d cmp $0xd,%eax
f0100298: 0f 85 8e 00 00 00 jne f010032c <cons_putc+0x125>
f010029e: eb 36 jmp f01002d6 <cons_putc+0xcf>
case '\b':
if (crt_pos > 0) {
f01002a0: 66 a1 34 95 11 f0 mov 0xf0119534,%ax
f01002a6: 66 85 c0 test %ax,%ax
f01002a9: 0f 84 e2 00 00 00 je f0100391 <cons_putc+0x18a>
crt_pos--;
f01002af: 48 dec %eax
f01002b0: 66 a3 34 95 11 f0 mov %ax,0xf0119534
crt_buf[crt_pos] = (c & ~0xff) | ' ';
f01002b6: 0f b7 c0 movzwl %ax,%eax
f01002b9: 81 e6 00 ff ff ff and $0xffffff00,%esi
f01002bf: 83 ce 20 or $0x20,%esi
f01002c2: 8b 15 30 95 11 f0 mov 0xf0119530,%edx
f01002c8: 66 89 34 42 mov %si,(%edx,%eax,2)
f01002cc: eb 78 jmp f0100346 <cons_putc+0x13f>
}
break;
case '\n':
crt_pos += CRT_COLS;
f01002ce: 66 83 05 34 95 11 f0 addw $0x50,0xf0119534
f01002d5: 50
/* fallthru */
case '\r':
crt_pos -= (crt_pos % CRT_COLS);
f01002d6: 66 8b 0d 34 95 11 f0 mov 0xf0119534,%cx
f01002dd: bb 50 00 00 00 mov $0x50,%ebx
f01002e2: 89 c8 mov %ecx,%eax
f01002e4: ba 00 00 00 00 mov $0x0,%edx
f01002e9: 66 f7 f3 div %bx
f01002ec: 66 29 d1 sub %dx,%cx
f01002ef: 66 89 0d 34 95 11 f0 mov %cx,0xf0119534
f01002f6: eb 4e jmp f0100346 <cons_putc+0x13f>
break;
case '\t':
cons_putc(' ');
f01002f8: b8 20 00 00 00 mov $0x20,%eax
f01002fd: e8 05 ff ff ff call f0100207 <cons_putc>
cons_putc(' ');
f0100302: b8 20 00 00 00 mov $0x20,%eax
f0100307: e8 fb fe ff ff call f0100207 <cons_putc>
cons_putc(' ');
f010030c: b8 20 00 00 00 mov $0x20,%eax
f0100311: e8 f1 fe ff ff call f0100207 <cons_putc>
cons_putc(' ');
f0100316: b8 20 00 00 00 mov $0x20,%eax
f010031b: e8 e7 fe ff ff call f0100207 <cons_putc>
cons_putc(' ');
f0100320: b8 20 00 00 00 mov $0x20,%eax
f0100325: e8 dd fe ff ff call f0100207 <cons_putc>
f010032a: eb 1a jmp f0100346 <cons_putc+0x13f>
break;
default:
crt_buf[crt_pos++] = c; /* write the character */
f010032c: 66 a1 34 95 11 f0 mov 0xf0119534,%ax
f0100332: 0f b7 c8 movzwl %ax,%ecx
f0100335: 8b 15 30 95 11 f0 mov 0xf0119530,%edx
f010033b: 66 89 34 4a mov %si,(%edx,%ecx,2)
f010033f: 40 inc %eax
f0100340: 66 a3 34 95 11 f0 mov %ax,0xf0119534
break;
}
// What is the purpose of this?
if (crt_pos >= CRT_SIZE) {
f0100346: 66 81 3d 34 95 11 f0 cmpw $0x7cf,0xf0119534
f010034d: cf 07
f010034f: 76 40 jbe f0100391 <cons_putc+0x18a>
int i;
memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
f0100351: a1 30 95 11 f0 mov 0xf0119530,%eax
f0100356: c7 44 24 08 00 0f 00 movl $0xf00,0x8(%esp)
f010035d: 00
f010035e: 8d 90 a0 00 00 00 lea 0xa0(%eax),%edx
f0100364: 89 54 24 04 mov %edx,0x4(%esp)
f0100368: 89 04 24 mov %eax,(%esp)
f010036b: e8 24 10 00 00 call f0101394 <memmove>
for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i++)
crt_buf[i] = 0x0700 | ' ';
f0100370: 8b 15 30 95 11 f0 mov 0xf0119530,%edx
// What is the purpose of this?
if (crt_pos >= CRT_SIZE) {
int i;
memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i++)
f0100376: b8 80 07 00 00 mov $0x780,%eax
crt_buf[i] = 0x0700 | ' ';
f010037b: 66 c7 04 42 20 07 movw $0x720,(%edx,%eax,2)
// What is the purpose of this?
if (crt_pos >= CRT_SIZE) {
int i;
memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i++)
f0100381: 40 inc %eax
f0100382: 3d d0 07 00 00 cmp $0x7d0,%eax
f0100387: 75 f2 jne f010037b <cons_putc+0x174>
crt_buf[i] = 0x0700 | ' ';
crt_pos -= CRT_COLS;
f0100389: 66 83 2d 34 95 11 f0 subw $0x50,0xf0119534
f0100390: 50
}
/* move that little blinky thing */
outb(addr_6845, 14);
f0100391: 8b 0d 2c 95 11 f0 mov 0xf011952c,%ecx
f0100397: b0 0e mov $0xe,%al
f0100399: 89 ca mov %ecx,%edx
f010039b: ee out %al,(%dx)
outb(addr_6845 + 1, crt_pos >> 8);
f010039c: 66 8b 35 34 95 11 f0 mov 0xf0119534,%si
f01003a3: 8d 59 01 lea 0x1(%ecx),%ebx
f01003a6: 89 f0 mov %esi,%eax
f01003a8: 66 c1 e8 08 shr $0x8,%ax
f01003ac: 89 da mov %ebx,%edx
f01003ae: ee out %al,(%dx)
f01003af: b0 0f mov $0xf,%al
f01003b1: 89 ca mov %ecx,%edx
f01003b3: ee out %al,(%dx)
f01003b4: 89 f0 mov %esi,%eax
f01003b6: 89 da mov %ebx,%edx
f01003b8: ee out %al,(%dx)
cons_putc(int c)
{
serial_putc(c);
lpt_putc(c);
cga_putc(c);
}
f01003b9: 83 c4 2c add $0x2c,%esp
f01003bc: 5b pop %ebx
f01003bd: 5e pop %esi
f01003be: 5f pop %edi
f01003bf: 5d pop %ebp
f01003c0: c3 ret
f01003c1 <kbd_proc_data>:
* Get data from the keyboard. If we finish a character, return it. Else 0.
* Return -1 if no data.
*/
static int
kbd_proc_data(void)
{
f01003c1: 55 push %ebp
f01003c2: 89 e5 mov %esp,%ebp
f01003c4: 53 push %ebx
f01003c5: 83 ec 14 sub $0x14,%esp
static inline uint8_t
inb(int port)
{
uint8_t data;
asm volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f01003c8: ba 64 00 00 00 mov $0x64,%edx
f01003cd: ec in (%dx),%al
int c;
uint8_t stat, data;
static uint32_t shift;
stat = inb(KBSTATP);
if ((stat & KBS_DIB) == 0)
f01003ce: 0f b6 c0 movzbl %al,%eax
f01003d1: a8 01 test $0x1,%al
f01003d3: 0f 84 e0 00 00 00 je f01004b9 <kbd_proc_data+0xf8>
return -1;
// Ignore data from mouse.
if (stat & KBS_TERR)
f01003d9: a8 20 test $0x20,%al
f01003db: 0f 85 df 00 00 00 jne f01004c0 <kbd_proc_data+0xff>
f01003e1: b2 60 mov $0x60,%dl
f01003e3: ec in (%dx),%al
f01003e4: 88 c2 mov %al,%dl
return -1;
data = inb(KBDATAP);
if (data == 0xE0) {
f01003e6: 3c e0 cmp $0xe0,%al
f01003e8: 75 11 jne f01003fb <kbd_proc_data+0x3a>
// E0 escape character
shift |= E0ESC;
f01003ea: 83 0d 28 95 11 f0 40 orl $0x40,0xf0119528
return 0;
f01003f1: bb 00 00 00 00 mov $0x0,%ebx
f01003f6: e9 ca 00 00 00 jmp f01004c5 <kbd_proc_data+0x104>
} else if (data & 0x80) {
f01003fb: 84 c0 test %al,%al
f01003fd: 79 33 jns f0100432 <kbd_proc_data+0x71>
// Key released
data = (shift & E0ESC ? data : data & 0x7F);
f01003ff: 8b 0d 28 95 11 f0 mov 0xf0119528,%ecx
f0100405: f6 c1 40 test $0x40,%cl
f0100408: 75 05 jne f010040f <kbd_proc_data+0x4e>
f010040a: 88 c2 mov %al,%dl
f010040c: 83 e2 7f and $0x7f,%edx
shift &= ~(shiftcode[data] | E0ESC);
f010040f: 0f b6 d2 movzbl %dl,%edx
f0100412: 8a 82 60 18 10 f0 mov -0xfefe7a0(%edx),%al
f0100418: 83 c8 40 or $0x40,%eax
f010041b: 0f b6 c0 movzbl %al,%eax
f010041e: f7 d0 not %eax
f0100420: 21 c1 and %eax,%ecx
f0100422: 89 0d 28 95 11 f0 mov %ecx,0xf0119528
return 0;
f0100428: bb 00 00 00 00 mov $0x0,%ebx
f010042d: e9 93 00 00 00 jmp f01004c5 <kbd_proc_data+0x104>
} else if (shift & E0ESC) {
f0100432: 8b 0d 28 95 11 f0 mov 0xf0119528,%ecx
f0100438: f6 c1 40 test $0x40,%cl
f010043b: 74 0e je f010044b <kbd_proc_data+0x8a>
// Last character was an E0 escape; or with 0x80
data |= 0x80;
f010043d: 88 c2 mov %al,%dl
f010043f: 83 ca 80 or $0xffffff80,%edx
shift &= ~E0ESC;
f0100442: 83 e1 bf and $0xffffffbf,%ecx
f0100445: 89 0d 28 95 11 f0 mov %ecx,0xf0119528
}
shift |= shiftcode[data];
f010044b: 0f b6 d2 movzbl %dl,%edx
f010044e: 0f b6 82 60 18 10 f0 movzbl -0xfefe7a0(%edx),%eax
f0100455: 0b 05 28 95 11 f0 or 0xf0119528,%eax
shift ^= togglecode[data];
f010045b: 0f b6 8a 60 19 10 f0 movzbl -0xfefe6a0(%edx),%ecx
f0100462: 31 c8 xor %ecx,%eax
f0100464: a3 28 95 11 f0 mov %eax,0xf0119528
c = charcode[shift & (CTL | SHIFT)][data];
f0100469: 89 c1 mov %eax,%ecx
f010046b: 83 e1 03 and $0x3,%ecx
f010046e: 8b 0c 8d 60 1a 10 f0 mov -0xfefe5a0(,%ecx,4),%ecx
f0100475: 0f b6 1c 11 movzbl (%ecx,%edx,1),%ebx
if (shift & CAPSLOCK) {
f0100479: a8 08 test $0x8,%al
f010047b: 74 18 je f0100495 <kbd_proc_data+0xd4>
if ('a' <= c && c <= 'z')
f010047d: 8d 53 9f lea -0x61(%ebx),%edx
f0100480: 83 fa 19 cmp $0x19,%edx
f0100483: 77 05 ja f010048a <kbd_proc_data+0xc9>
c += 'A' - 'a';
f0100485: 83 eb 20 sub $0x20,%ebx
f0100488: eb 0b jmp f0100495 <kbd_proc_data+0xd4>
else if ('A' <= c && c <= 'Z')
f010048a: 8d 53 bf lea -0x41(%ebx),%edx
f010048d: 83 fa 19 cmp $0x19,%edx
f0100490: 77 03 ja f0100495 <kbd_proc_data+0xd4>
c += 'a' - 'A';
f0100492: 83 c3 20 add $0x20,%ebx
}
// Process special keys
// Ctrl-Alt-Del: reboot
if (!(~shift & (CTL | ALT)) && c == KEY_DEL) {
f0100495: f7 d0 not %eax
f0100497: a8 06 test $0x6,%al
f0100499: 75 2a jne f01004c5 <kbd_proc_data+0x104>
f010049b: 81 fb e9 00 00 00 cmp $0xe9,%ebx
f01004a1: 75 22 jne f01004c5 <kbd_proc_data+0x104>
cprintf("Rebooting!\n");
f01004a3: c7 04 24 24 18 10 f0 movl $0xf0101824,(%esp)
f01004aa: e8 2f 04 00 00 call f01008de <cprintf>
}
static inline void
outb(int port, uint8_t data)
{
asm volatile("outb %0,%w1" : : "a" (data), "d" (port));
f01004af: ba 92 00 00 00 mov $0x92,%edx
f01004b4: b0 03 mov $0x3,%al
f01004b6: ee out %al,(%dx)
f01004b7: eb 0c jmp f01004c5 <kbd_proc_data+0x104>
uint8_t stat, data;
static uint32_t shift;
stat = inb(KBSTATP);
if ((stat & KBS_DIB) == 0)
return -1;
f01004b9: bb ff ff ff ff mov $0xffffffff,%ebx
f01004be: eb 05 jmp f01004c5 <kbd_proc_data+0x104>
// Ignore data from mouse.
if (stat & KBS_TERR)
return -1;
f01004c0: bb ff ff ff ff mov $0xffffffff,%ebx
cprintf("Rebooting!\n");
outb(0x92, 0x3); // courtesy of <NAME>
}
return c;
}
f01004c5: 89 d8 mov %ebx,%eax
f01004c7: 83 c4 14 add $0x14,%esp
f01004ca: 5b pop %ebx
f01004cb: 5d pop %ebp
f01004cc: c3 ret
f01004cd <serial_intr>:
return inb(COM1+COM_RX);
}
void
serial_intr(void)
{
f01004cd: 55 push %ebp
f01004ce: 89 e5 mov %esp,%ebp
f01004d0: 83 ec 08 sub $0x8,%esp
if (serial_exists)
f01004d3: 80 3d 00 93 11 f0 00 cmpb $0x0,0xf0119300
f01004da: 74 0a je f01004e6 <serial_intr+0x19>
cons_intr(serial_proc_data);
f01004dc: b8 aa 01 10 f0 mov $0xf01001aa,%eax
f01004e1: e8 e0 fc ff ff call f01001c6 <cons_intr>
}
f01004e6: c9 leave
f01004e7: c3 ret
f01004e8 <kbd_intr>:
return c;
}
void
kbd_intr(void)
{
f01004e8: 55 push %ebp
f01004e9: 89 e5 mov %esp,%ebp
f01004eb: 83 ec 08 sub $0x8,%esp
cons_intr(kbd_proc_data);
f01004ee: b8 c1 03 10 f0 mov $0xf01003c1,%eax
f01004f3: e8 ce fc ff ff call f01001c6 <cons_intr>
}
f01004f8: c9 leave
f01004f9: c3 ret
f01004fa <cons_getc>:
}
// return the next input character from the console, or 0 if none waiting
int
cons_getc(void)
{
f01004fa: 55 push %ebp
f01004fb: 89 e5 mov %esp,%ebp
f01004fd: 83 ec 08 sub $0x8,%esp
int c;
// poll for any pending input characters,
// so that this function works even when interrupts are disabled
// (e.g., when called from the kernel monitor).
serial_intr();
f0100500: e8 c8 ff ff ff call f01004cd <serial_intr>
kbd_intr();
f0100505: e8 de ff ff ff call f01004e8 <kbd_intr>
// grab the next character from the input buffer.
if (cons.rpos != cons.wpos) {
f010050a: 8b 15 20 95 11 f0 mov 0xf0119520,%edx
f0100510: 3b 15 24 95 11 f0 cmp 0xf0119524,%edx
f0100516: 74 22 je f010053a <cons_getc+0x40>
c = cons.buf[cons.rpos++];
f0100518: 0f b6 82 20 93 11 f0 movzbl -0xfee6ce0(%edx),%eax
f010051f: 42 inc %edx
f0100520: 89 15 20 95 11 f0 mov %edx,0xf0119520
if (cons.rpos == CONSBUFSIZE)
f0100526: 81 fa 00 02 00 00 cmp $0x200,%edx
f010052c: 75 11 jne f010053f <cons_getc+0x45>
cons.rpos = 0;
f010052e: c7 05 20 95 11 f0 00 movl $0x0,0xf0119520
f0100535: 00 00 00
f0100538: eb 05 jmp f010053f <cons_getc+0x45>
return c;
}
return 0;
f010053a: b8 00 00 00 00 mov $0x0,%eax
}
f010053f: c9 leave
f0100540: c3 ret
f0100541 <cons_init>:
}
// initialize the console devices
void
cons_init(void)
{
f0100541: 55 push %ebp
f0100542: 89 e5 mov %esp,%ebp
f0100544: 57 push %edi
f0100545: 56 push %esi
f0100546: 53 push %ebx
f0100547: 83 ec 2c sub $0x2c,%esp
volatile uint16_t *cp;
uint16_t was;
unsigned pos;
cp = (uint16_t*) (KERNBASE + CGA_BUF);
was = *cp;
f010054a: 66 8b 15 00 80 0b f0 mov 0xf00b8000,%dx
*cp = (uint16_t) 0xA55A;
f0100551: 66 c7 05 00 80 0b f0 movw $0xa55a,0xf00b8000
f0100558: 5a a5
if (*cp != 0xA55A) {
f010055a: 66 a1 00 80 0b f0 mov 0xf00b8000,%ax
f0100560: 66 3d 5a a5 cmp $0xa55a,%ax
f0100564: 74 11 je f0100577 <cons_init+0x36>
cp = (uint16_t*) (KERNBASE + MONO_BUF);
addr_6845 = MONO_BASE;
f0100566: c7 05 2c 95 11 f0 b4 movl $0x3b4,0xf011952c
f010056d: 03 00 00
cp = (uint16_t*) (KERNBASE + CGA_BUF);
was = *cp;
*cp = (uint16_t) 0xA55A;
if (*cp != 0xA55A) {
cp = (uint16_t*) (KERNBASE + MONO_BUF);
f0100570: be 00 00 0b f0 mov $0xf00b0000,%esi
f0100575: eb 16 jmp f010058d <cons_init+0x4c>
addr_6845 = MONO_BASE;
} else {
*cp = was;
f0100577: 66 89 15 00 80 0b f0 mov %dx,0xf00b8000
addr_6845 = CGA_BASE;
f010057e: c7 05 2c 95 11 f0 d4 movl $0x3d4,0xf011952c
f0100585: 03 00 00
{
volatile uint16_t *cp;
uint16_t was;
unsigned pos;
cp = (uint16_t*) (KERNBASE + CGA_BUF);
f0100588: be 00 80 0b f0 mov $0xf00b8000,%esi
*cp = was;
addr_6845 = CGA_BASE;
}
/* Extract cursor location */
outb(addr_6845, 14);
f010058d: 8b 0d 2c 95 11 f0 mov 0xf011952c,%ecx
f0100593: b0 0e mov $0xe,%al
f0100595: 89 ca mov %ecx,%edx
f0100597: ee out %al,(%dx)
pos = inb(addr_6845 + 1) << 8;
f0100598: 8d 59 01 lea 0x1(%ecx),%ebx
static inline uint8_t
inb(int port)
{
uint8_t data;
asm volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f010059b: 89 da mov %ebx,%edx
f010059d: ec in (%dx),%al
f010059e: 0f b6 f8 movzbl %al,%edi
f01005a1: c1 e7 08 shl $0x8,%edi
}
static inline void
outb(int port, uint8_t data)
{
asm volatile("outb %0,%w1" : : "a" (data), "d" (port));
f01005a4: b0 0f mov $0xf,%al
f01005a6: 89 ca mov %ecx,%edx
f01005a8: ee out %al,(%dx)
static inline uint8_t
inb(int port)
{
uint8_t data;
asm volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f01005a9: 89 da mov %ebx,%edx
f01005ab: ec in (%dx),%al
outb(addr_6845, 15);
pos |= inb(addr_6845 + 1);
crt_buf = (uint16_t*) cp;
f01005ac: 89 35 30 95 11 f0 mov %esi,0xf0119530
/* Extract cursor location */
outb(addr_6845, 14);
pos = inb(addr_6845 + 1) << 8;
outb(addr_6845, 15);
pos |= inb(addr_6845 + 1);
f01005b2: 0f b6 d8 movzbl %al,%ebx
f01005b5: 09 df or %ebx,%edi
crt_buf = (uint16_t*) cp;
crt_pos = pos;
f01005b7: 66 89 3d 34 95 11 f0 mov %di,0xf0119534
}
static inline void
outb(int port, uint8_t data)
{
asm volatile("outb %0,%w1" : : "a" (data), "d" (port));
f01005be: bb fa 03 00 00 mov $0x3fa,%ebx
f01005c3: b0 00 mov $0x0,%al
f01005c5: 89 da mov %ebx,%edx
f01005c7: ee out %al,(%dx)
f01005c8: b2 fb mov $0xfb,%dl
f01005ca: b0 80 mov $0x80,%al
f01005cc: ee out %al,(%dx)
f01005cd: b9 f8 03 00 00 mov $0x3f8,%ecx
f01005d2: b0 0c mov $0xc,%al
f01005d4: 89 ca mov %ecx,%edx
f01005d6: ee out %al,(%dx)
f01005d7: b2 f9 mov $0xf9,%dl
f01005d9: b0 00 mov $0x0,%al
f01005db: ee out %al,(%dx)
f01005dc: b2 fb mov $0xfb,%dl
f01005de: b0 03 mov $0x3,%al
f01005e0: ee out %al,(%dx)
f01005e1: b2 fc mov $0xfc,%dl
f01005e3: b0 00 mov $0x0,%al
f01005e5: ee out %al,(%dx)
f01005e6: b2 f9 mov $0xf9,%dl
f01005e8: b0 01 mov $0x1,%al
f01005ea: ee out %al,(%dx)
static inline uint8_t
inb(int port)
{
uint8_t data;
asm volatile("inb %w1,%0" : "=a" (data) : "d" (port));
f01005eb: b2 fd mov $0xfd,%dl
f01005ed: ec in (%dx),%al
// Enable rcv interrupts
outb(COM1+COM_IER, COM_IER_RDI);
// Clear any preexisting overrun indications and interrupts
// Serial port doesn't exist if COM_LSR returns 0xFF
serial_exists = (inb(COM1+COM_LSR) != 0xFF);
f01005ee: 3c ff cmp $0xff,%al
f01005f0: 0f 95 45 e7 setne -0x19(%ebp)
f01005f4: 8a 45 e7 mov -0x19(%ebp),%al
f01005f7: a2 00 93 11 f0 mov %al,0xf0119300
f01005fc: 89 da mov %ebx,%edx
f01005fe: ec in (%dx),%al
f01005ff: 89 ca mov %ecx,%edx
f0100601: ec in (%dx),%al
{
cga_init();
kbd_init();
serial_init();
if (!serial_exists)
f0100602: 80 7d e7 00 cmpb $0x0,-0x19(%ebp)
f0100606: 75 0c jne f0100614 <cons_init+0xd3>
cprintf("Serial port does not exist!\n");
f0100608: c7 04 24 30 18 10 f0 movl $0xf0101830,(%esp)
f010060f: e8 ca 02 00 00 call f01008de <cprintf>
}
f0100614: 83 c4 2c add $0x2c,%esp
f0100617: 5b pop %ebx
f0100618: 5e pop %esi
f0100619: 5f pop %edi
f010061a: 5d pop %ebp
f010061b: c3 ret
f010061c <cputchar>:
// `High'-level console I/O. Used by readline and cprintf.
void
cputchar(int c)
{
f010061c: 55 push %ebp
f010061d: 89 e5 mov %esp,%ebp
f010061f: 83 ec 08 sub $0x8,%esp
cons_putc(c);
f0100622: 8b 45 08 mov 0x8(%ebp),%eax
f0100625: e8 dd fb ff ff call f0100207 <cons_putc>
}
f010062a: c9 leave
f010062b: c3 ret
f010062c <getchar>:
int
getchar(void)
{
f010062c: 55 push %ebp
f010062d: 89 e5 mov %esp,%ebp
f010062f: 83 ec 08 sub $0x8,%esp
int c;
while ((c = cons_getc()) == 0)
f0100632: e8 c3 fe ff ff call f01004fa <cons_getc>
f0100637: 85 c0 test %eax,%eax
f0100639: 74 f7 je f0100632 <getchar+0x6>
/* do nothing */;
return c;
}
f010063b: c9 leave
f010063c: c3 ret
f010063d <iscons>:
int
iscons(int fdnum)
{
f010063d: 55 push %ebp
f010063e: 89 e5 mov %esp,%ebp
// used by readline
return 1;
}
f0100640: b8 01 00 00 00 mov $0x1,%eax
f0100645: 5d pop %ebp
f0100646: c3 ret
...
f0100648 <mon_kerninfo>:
return 0;
}
int
mon_kerninfo(int argc, char **argv, struct Trapframe *tf)
{
f0100648: 55 push %ebp
f0100649: 89 e5 mov %esp,%ebp
f010064b: 83 ec 18 sub $0x18,%esp
extern char _start[], entry[], etext[], edata[], end[];
cprintf("Special kernel symbols:\n");
f010064e: c7 04 24 70 1a 10 f0 movl $0xf0101a70,(%esp)
f0100655: e8 84 02 00 00 call f01008de <cprintf>
cprintf(" _start %08x (phys)\n", _start);
f010065a: c7 44 24 04 0c 00 10 movl $0x10000c,0x4(%esp)
f0100661: 00
f0100662: c7 04 24 fc 1a 10 f0 movl $0xf0101afc,(%esp)
f0100669: e8 70 02 00 00 call f01008de <cprintf>
cprintf(" entry %08x (virt) %08x (phys)\n", entry, entry - KERNBASE);
f010066e: c7 44 24 08 0c 00 10 movl $0x10000c,0x8(%esp)
f0100675: 00
f0100676: c7 44 24 04 0c 00 10 movl $0xf010000c,0x4(%esp)
f010067d: f0
f010067e: c7 04 24 24 1b 10 f0 movl $0xf0101b24,(%esp)
f0100685: e8 54 02 00 00 call f01008de <cprintf>
cprintf(" etext %08x (virt) %08x (phys)\n", etext, etext - KERNBASE);
f010068a: c7 44 24 08 8e 17 10 movl $0x10178e,0x8(%esp)
f0100691: 00
f0100692: c7 44 24 04 8e 17 10 movl $0xf010178e,0x4(%esp)
f0100699: f0
f010069a: c7 04 24 48 1b 10 f0 movl $0xf0101b48,(%esp)
f01006a1: e8 38 02 00 00 call f01008de <cprintf>
cprintf(" edata %08x (virt) %08x (phys)\n", edata, edata - KERNBASE);
f01006a6: c7 44 24 08 00 93 11 movl $0x119300,0x8(%esp)
f01006ad: 00
f01006ae: c7 44 24 04 00 93 11 movl $0xf0119300,0x4(%esp)
f01006b5: f0
f01006b6: c7 04 24 6c 1b 10 f0 movl $0xf0101b6c,(%esp)
f01006bd: e8 1c 02 00 00 call f01008de <cprintf>
cprintf(" end %08x (virt) %08x (phys)\n", end, end - KERNBASE);
f01006c2: c7 44 24 08 40 99 11 movl $0x119940,0x8(%esp)
f01006c9: 00
f01006ca: c7 44 24 04 40 99 11 movl $0xf0119940,0x4(%esp)
f01006d1: f0
f01006d2: c7 04 24 90 1b 10 f0 movl $0xf0101b90,(%esp)
f01006d9: e8 00 02 00 00 call f01008de <cprintf>
cprintf("Kernel executable memory footprint: %dKB\n",
ROUNDUP(end - entry, 1024) / 1024);
f01006de: b8 3f 9d 11 f0 mov $0xf0119d3f,%eax
f01006e3: 2d 0c 00 10 f0 sub $0xf010000c,%eax
f01006e8: 25 00 fc ff ff and $0xfffffc00,%eax
cprintf(" _start %08x (phys)\n", _start);
cprintf(" entry %08x (virt) %08x (phys)\n", entry, entry - KERNBASE);
cprintf(" etext %08x (virt) %08x (phys)\n", etext, etext - KERNBASE);
cprintf(" edata %08x (virt) %08x (phys)\n", edata, edata - KERNBASE);
cprintf(" end %08x (virt) %08x (phys)\n", end, end - KERNBASE);
cprintf("Kernel executable memory footprint: %dKB\n",
f01006ed: 89 c2 mov %eax,%edx
f01006ef: 85 c0 test %eax,%eax
f01006f1: 79 06 jns f01006f9 <mon_kerninfo+0xb1>
f01006f3: 8d 90 ff 03 00 00 lea 0x3ff(%eax),%edx
f01006f9: c1 fa 0a sar $0xa,%edx
f01006fc: 89 54 24 04 mov %edx,0x4(%esp)
f0100700: c7 04 24 b4 1b 10 f0 movl $0xf0101bb4,(%esp)
f0100707: e8 d2 01 00 00 call f01008de <cprintf>
ROUNDUP(end - entry, 1024) / 1024);
return 0;
}
f010070c: b8 00 00 00 00 mov $0x0,%eax
f0100711: c9 leave
f0100712: c3 ret
f0100713 <mon_help>:
/***** Implementations of basic kernel monitor commands *****/
int
mon_help(int argc, char **argv, struct Trapframe *tf)
{
f0100713: 55 push %ebp
f0100714: 89 e5 mov %esp,%ebp
f0100716: 83 ec 18 sub $0x18,%esp
int i;
for (i = 0; i < ARRAY_SIZE(commands); i++)
cprintf("%s - %s\n", commands[i].name, commands[i].desc);
f0100719: c7 44 24 08 89 1a 10 movl $0xf0101a89,0x8(%esp)
f0100720: f0
f0100721: c7 44 24 04 a7 1a 10 movl $0xf0101aa7,0x4(%esp)
f0100728: f0
f0100729: c7 04 24 ac 1a 10 f0 movl $0xf0101aac,(%esp)
f0100730: e8 a9 01 00 00 call f01008de <cprintf>
f0100735: c7 44 24 08 e0 1b 10 movl $0xf0101be0,0x8(%esp)
f010073c: f0
f010073d: c7 44 24 04 b5 1a 10 movl $0xf0101ab5,0x4(%esp)
f0100744: f0
f0100745: c7 04 24 ac 1a 10 f0 movl $0xf0101aac,(%esp)
f010074c: e8 8d 01 00 00 call f01008de <cprintf>
return 0;
}
f0100751: b8 00 00 00 00 mov $0x0,%eax
f0100756: c9 leave
f0100757: c3 ret
f0100758 <mon_backtrace>:
return 0;
}
int
mon_backtrace(int argc, char **argv, struct Trapframe *tf)
{
f0100758: 55 push %ebp
f0100759: 89 e5 mov %esp,%ebp
// Your code here.
return 0;
}
f010075b: b8 00 00 00 00 mov $0x0,%eax
f0100760: 5d pop %ebp
f0100761: c3 ret
f0100762 <monitor>:
return 0;
}
void
monitor(struct Trapframe *tf)
{
f0100762: 55 push %ebp
f0100763: 89 e5 mov %esp,%ebp
f0100765: 57 push %edi
f0100766: 56 push %esi
f0100767: 53 push %ebx
f0100768: 83 ec 5c sub $0x5c,%esp
char *buf;
cprintf("Welcome to the JOS kernel monitor!\n");
f010076b: c7 04 24 08 1c 10 f0 movl $0xf0101c08,(%esp)
f0100772: e8 67 01 00 00 call f01008de <cprintf>
cprintf("Type 'help' for a list of commands.\n");
f0100777: c7 04 24 2c 1c 10 f0 movl $0xf0101c2c,(%esp)
f010077e: e8 5b 01 00 00 call f01008de <cprintf>
// Lookup and invoke the command
if (argc == 0)
return 0;
for (i = 0; i < ARRAY_SIZE(commands); i++) {
if (strcmp(argv[0], commands[i].name) == 0)
return commands[i].func(argc, argv, tf);
f0100783: 8d 7d a8 lea -0x58(%ebp),%edi
cprintf("Welcome to the JOS kernel monitor!\n");
cprintf("Type 'help' for a list of commands.\n");
while (1) {
buf = readline("K> ");
f0100786: c7 04 24 be 1a 10 f0 movl $0xf0101abe,(%esp)
f010078d: e8 8e 09 00 00 call f0101120 <readline>
f0100792: 89 c3 mov %eax,%ebx
if (buf != NULL)
f0100794: 85 c0 test %eax,%eax
f0100796: 74 ee je f0100786 <monitor+0x24>
char *argv[MAXARGS];
int i;
// Parse the command buffer into whitespace-separated arguments
argc = 0;
argv[argc] = 0;
f0100798: c7 45 a8 00 00 00 00 movl $0x0,-0x58(%ebp)
int argc;
char *argv[MAXARGS];
int i;
// Parse the command buffer into whitespace-separated arguments
argc = 0;
f010079f: be 00 00 00 00 mov $0x0,%esi
f01007a4: eb 04 jmp f01007aa <monitor+0x48>
argv[argc] = 0;
while (1) {
// gobble whitespace
while (*buf && strchr(WHITESPACE, *buf))
*buf++ = 0;
f01007a6: c6 03 00 movb $0x0,(%ebx)
f01007a9: 43 inc %ebx
// Parse the command buffer into whitespace-separated arguments
argc = 0;
argv[argc] = 0;
while (1) {
// gobble whitespace
while (*buf && strchr(WHITESPACE, *buf))
f01007aa: 8a 03 mov (%ebx),%al
f01007ac: 84 c0 test %al,%al
f01007ae: 74 5e je f010080e <monitor+0xac>
f01007b0: 0f be c0 movsbl %al,%eax
f01007b3: 89 44 24 04 mov %eax,0x4(%esp)
f01007b7: c7 04 24 c2 1a 10 f0 movl $0xf0101ac2,(%esp)
f01007be: e8 52 0b 00 00 call f0101315 <strchr>
f01007c3: 85 c0 test %eax,%eax
f01007c5: 75 df jne f01007a6 <monitor+0x44>
*buf++ = 0;
if (*buf == 0)
f01007c7: 80 3b 00 cmpb $0x0,(%ebx)
f01007ca: 74 42 je f010080e <monitor+0xac>
break;
// save and scan past next arg
if (argc == MAXARGS-1) {
f01007cc: 83 fe 0f cmp $0xf,%esi
f01007cf: 75 16 jne f01007e7 <monitor+0x85>
cprintf("Too many arguments (max %d)\n", MAXARGS);
f01007d1: c7 44 24 04 10 00 00 movl $0x10,0x4(%esp)
f01007d8: 00
f01007d9: c7 04 24 c7 1a 10 f0 movl $0xf0101ac7,(%esp)
f01007e0: e8 f9 00 00 00 call f01008de <cprintf>
f01007e5: eb 9f jmp f0100786 <monitor+0x24>
return 0;
}
argv[argc++] = buf;
f01007e7: 89 5c b5 a8 mov %ebx,-0x58(%ebp,%esi,4)
f01007eb: 46 inc %esi
f01007ec: eb 01 jmp f01007ef <monitor+0x8d>
while (*buf && !strchr(WHITESPACE, *buf))
buf++;
f01007ee: 43 inc %ebx
if (argc == MAXARGS-1) {
cprintf("Too many arguments (max %d)\n", MAXARGS);
return 0;
}
argv[argc++] = buf;
while (*buf && !strchr(WHITESPACE, *buf))
f01007ef: 8a 03 mov (%ebx),%al
f01007f1: 84 c0 test %al,%al
f01007f3: 74 b5 je f01007aa <monitor+0x48>
f01007f5: 0f be c0 movsbl %al,%eax
f01007f8: 89 44 24 04 mov %eax,0x4(%esp)
f01007fc: c7 04 24 c2 1a 10 f0 movl $0xf0101ac2,(%esp)
f0100803: e8 0d 0b 00 00 call f0101315 <strchr>
f0100808: 85 c0 test %eax,%eax
f010080a: 74 e2 je f01007ee <monitor+0x8c>
f010080c: eb 9c jmp f01007aa <monitor+0x48>
buf++;
}
argv[argc] = 0;
f010080e: c7 44 b5 a8 00 00 00 movl $0x0,-0x58(%ebp,%esi,4)
f0100815: 00
// Lookup and invoke the command
if (argc == 0)
f0100816: 85 f6 test %esi,%esi
f0100818: 0f 84 68 ff ff ff je f0100786 <monitor+0x24>
return 0;
for (i = 0; i < ARRAY_SIZE(commands); i++) {
if (strcmp(argv[0], commands[i].name) == 0)
f010081e: c7 44 24 04 a7 1a 10 movl $0xf0101aa7,0x4(%esp)
f0100825: f0
f0100826: 8b 45 a8 mov -0x58(%ebp),%eax
f0100829: 89 04 24 mov %eax,(%esp)
f010082c: e8 91 0a 00 00 call f01012c2 <strcmp>
f0100831: 85 c0 test %eax,%eax
f0100833: 74 1b je f0100850 <monitor+0xee>
f0100835: c7 44 24 04 b5 1a 10 movl $0xf0101ab5,0x4(%esp)
f010083c: f0
f010083d: 8b 45 a8 mov -0x58(%ebp),%eax
f0100840: 89 04 24 mov %eax,(%esp)
f0100843: e8 7a 0a 00 00 call f01012c2 <strcmp>
f0100848: 85 c0 test %eax,%eax
f010084a: 75 2c jne f0100878 <monitor+0x116>
f010084c: b0 01 mov $0x1,%al
f010084e: eb 05 jmp f0100855 <monitor+0xf3>
f0100850: b8 00 00 00 00 mov $0x0,%eax
return commands[i].func(argc, argv, tf);
f0100855: 8d 14 00 lea (%eax,%eax,1),%edx
f0100858: 01 d0 add %edx,%eax
f010085a: 8b 55 08 mov 0x8(%ebp),%edx
f010085d: 89 54 24 08 mov %edx,0x8(%esp)
f0100861: 89 7c 24 04 mov %edi,0x4(%esp)
f0100865: 89 34 24 mov %esi,(%esp)
f0100868: ff 14 85 5c 1c 10 f0 call *-0xfefe3a4(,%eax,4)
while (1) {
buf = readline("K> ");
if (buf != NULL)
if (runcmd(buf, tf) < 0)
f010086f: 85 c0 test %eax,%eax
f0100871: 78 1d js f0100890 <monitor+0x12e>
f0100873: e9 0e ff ff ff jmp f0100786 <monitor+0x24>
return 0;
for (i = 0; i < ARRAY_SIZE(commands); i++) {
if (strcmp(argv[0], commands[i].name) == 0)
return commands[i].func(argc, argv, tf);
}
cprintf("Unknown command '%s'\n", argv[0]);
f0100878: 8b 45 a8 mov -0x58(%ebp),%eax
f010087b: 89 44 24 04 mov %eax,0x4(%esp)
f010087f: c7 04 24 e4 1a 10 f0 movl $0xf0101ae4,(%esp)
f0100886: e8 53 00 00 00 call f01008de <cprintf>
f010088b: e9 f6 fe ff ff jmp f0100786 <monitor+0x24>
buf = readline("K> ");
if (buf != NULL)
if (runcmd(buf, tf) < 0)
break;
}
}
f0100890: 83 c4 5c add $0x5c,%esp
f0100893: 5b pop %ebx
f0100894: 5e pop %esi
f0100895: 5f pop %edi
f0100896: 5d pop %ebp
f0100897: c3 ret
f0100898 <putch>:
#include <inc/stdarg.h>
static void
putch(int ch, int *cnt)
{
f0100898: 55 push %ebp
f0100899: 89 e5 mov %esp,%ebp
f010089b: 83 ec 18 sub $0x18,%esp
cputchar(ch);
f010089e: 8b 45 08 mov 0x8(%ebp),%eax
f01008a1: 89 04 24 mov %eax,(%esp)
f01008a4: e8 73 fd ff ff call f010061c <cputchar>
*cnt++;
}
f01008a9: c9 leave
f01008aa: c3 ret
f01008ab <vcprintf>:
int
vcprintf(const char *fmt, va_list ap)
{
f01008ab: 55 push %ebp
f01008ac: 89 e5 mov %esp,%ebp
f01008ae: 83 ec 28 sub $0x28,%esp
int cnt = 0;
f01008b1: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
vprintfmt((void*)putch, &cnt, fmt, ap);
f01008b8: 8b 45 0c mov 0xc(%ebp),%eax
f01008bb: 89 44 24 0c mov %eax,0xc(%esp)
f01008bf: 8b 45 08 mov 0x8(%ebp),%eax
f01008c2: 89 44 24 08 mov %eax,0x8(%esp)
f01008c6: 8d 45 f4 lea -0xc(%ebp),%eax
f01008c9: 89 44 24 04 mov %eax,0x4(%esp)
f01008cd: c7 04 24 98 08 10 f0 movl $0xf0100898,(%esp)
f01008d4: e8 11 04 00 00 call f0100cea <vprintfmt>
return cnt;
}
f01008d9: 8b 45 f4 mov -0xc(%ebp),%eax
f01008dc: c9 leave
f01008dd: c3 ret
f01008de <cprintf>:
int
cprintf(const char *fmt, ...)
{
f01008de: 55 push %ebp
f01008df: 89 e5 mov %esp,%ebp
f01008e1: 83 ec 18 sub $0x18,%esp
va_list ap;
int cnt;
va_start(ap, fmt);
f01008e4: 8d 45 0c lea 0xc(%ebp),%eax
cnt = vcprintf(fmt, ap);
f01008e7: 89 44 24 04 mov %eax,0x4(%esp)
f01008eb: 8b 45 08 mov 0x8(%ebp),%eax
f01008ee: 89 04 24 mov %eax,(%esp)
f01008f1: e8 b5 ff ff ff call f01008ab <vcprintf>
va_end(ap);
return cnt;
}
f01008f6: c9 leave
f01008f7: c3 ret
f01008f8 <stab_binsearch>:
// will exit setting left = 118, right = 554.
//
static void
stab_binsearch(const struct Stab *stabs, int *region_left, int *region_right,
int type, uintptr_t addr)
{
f01008f8: 55 push %ebp
f01008f9: 89 e5 mov %esp,%ebp
f01008fb: 57 push %edi
f01008fc: 56 push %esi
f01008fd: 53 push %ebx
f01008fe: 83 ec 10 sub $0x10,%esp
f0100901: 89 c3 mov %eax,%ebx
f0100903: 89 55 e8 mov %edx,-0x18(%ebp)
f0100906: 89 4d e4 mov %ecx,-0x1c(%ebp)
f0100909: 8b 75 08 mov 0x8(%ebp),%esi
int l = *region_left, r = *region_right, any_matches = 0;
f010090c: 8b 0a mov (%edx),%ecx
f010090e: 8b 45 e4 mov -0x1c(%ebp),%eax
f0100911: 8b 00 mov (%eax),%eax
f0100913: 89 45 f0 mov %eax,-0x10(%ebp)
f0100916: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
while (l <= r) {
f010091d: eb 77 jmp f0100996 <stab_binsearch+0x9e>
int true_m = (l + r) / 2, m = true_m;
f010091f: 8b 45 f0 mov -0x10(%ebp),%eax
f0100922: 01 c8 add %ecx,%eax
f0100924: bf 02 00 00 00 mov $0x2,%edi
f0100929: 99 cltd
f010092a: f7 ff idiv %edi
f010092c: 89 c2 mov %eax,%edx
// search for earliest stab with right type
while (m >= l && stabs[m].n_type != type)
f010092e: eb 01 jmp f0100931 <stab_binsearch+0x39>
m--;
f0100930: 4a dec %edx
while (l <= r) {
int true_m = (l + r) / 2, m = true_m;
// search for earliest stab with right type
while (m >= l && stabs[m].n_type != type)
f0100931: 39 ca cmp %ecx,%edx
f0100933: 7c 1d jl f0100952 <stab_binsearch+0x5a>
// left = 0, right = 657;
// stab_binsearch(stabs, &left, &right, N_SO, 0xf0100184);
// will exit setting left = 118, right = 554.
//
static void
stab_binsearch(const struct Stab *stabs, int *region_left, int *region_right,
f0100935: 6b fa 0c imul $0xc,%edx,%edi
while (l <= r) {
int true_m = (l + r) / 2, m = true_m;
// search for earliest stab with right type
while (m >= l && stabs[m].n_type != type)
f0100938: 0f b6 7c 3b 04 movzbl 0x4(%ebx,%edi,1),%edi
f010093d: 39 f7 cmp %esi,%edi
f010093f: 75 ef jne f0100930 <stab_binsearch+0x38>
f0100941: 89 55 ec mov %edx,-0x14(%ebp)
continue;
}
// actual binary search
any_matches = 1;
if (stabs[m].n_value < addr) {
f0100944: 6b fa 0c imul $0xc,%edx,%edi
f0100947: 8b 7c 3b 08 mov 0x8(%ebx,%edi,1),%edi
f010094b: 3b 7d 0c cmp 0xc(%ebp),%edi
f010094e: 73 18 jae f0100968 <stab_binsearch+0x70>
f0100950: eb 05 jmp f0100957 <stab_binsearch+0x5f>
// search for earliest stab with right type
while (m >= l && stabs[m].n_type != type)
m--;
if (m < l) { // no match in [l, m]
l = true_m + 1;
f0100952: 8d 48 01 lea 0x1(%eax),%ecx
continue;
f0100955: eb 3f jmp f0100996 <stab_binsearch+0x9e>
}
// actual binary search
any_matches = 1;
if (stabs[m].n_value < addr) {
*region_left = m;
f0100957: 8b 4d e8 mov -0x18(%ebp),%ecx
f010095a: 89 11 mov %edx,(%ecx)
l = true_m + 1;
f010095c: 8d 48 01 lea 0x1(%eax),%ecx
l = true_m + 1;
continue;
}
// actual binary search
any_matches = 1;
f010095f: c7 45 ec 01 00 00 00 movl $0x1,-0x14(%ebp)
f0100966: eb 2e jmp f0100996 <stab_binsearch+0x9e>
if (stabs[m].n_value < addr) {
*region_left = m;
l = true_m + 1;
} else if (stabs[m].n_value > addr) {
f0100968: 3b 7d 0c cmp 0xc(%ebp),%edi
f010096b: 76 15 jbe f0100982 <stab_binsearch+0x8a>
*region_right = m - 1;
f010096d: 8b 7d ec mov -0x14(%ebp),%edi
f0100970: 4f dec %edi
f0100971: 89 7d f0 mov %edi,-0x10(%ebp)
f0100974: 8b 45 e4 mov -0x1c(%ebp),%eax
f0100977: 89 38 mov %edi,(%eax)
l = true_m + 1;
continue;
}
// actual binary search
any_matches = 1;
f0100979: c7 45 ec 01 00 00 00 movl $0x1,-0x14(%ebp)
f0100980: eb 14 jmp f0100996 <stab_binsearch+0x9e>
*region_right = m - 1;
r = m - 1;
} else {
// exact match for 'addr', but continue loop to find
// *region_right
*region_left = m;
f0100982: 8b 7d ec mov -0x14(%ebp),%edi
f0100985: 8b 4d e8 mov -0x18(%ebp),%ecx
f0100988: 89 39 mov %edi,(%ecx)
l = m;
addr++;
f010098a: ff 45 0c incl 0xc(%ebp)
f010098d: 89 d1 mov %edx,%ecx
l = true_m + 1;
continue;
}
// actual binary search
any_matches = 1;
f010098f: c7 45 ec 01 00 00 00 movl $0x1,-0x14(%ebp)
stab_binsearch(const struct Stab *stabs, int *region_left, int *region_right,
int type, uintptr_t addr)
{
int l = *region_left, r = *region_right, any_matches = 0;
while (l <= r) {
f0100996: 3b 4d f0 cmp -0x10(%ebp),%ecx
f0100999: 7e 84 jle f010091f <stab_binsearch+0x27>
l = m;
addr++;
}
}
if (!any_matches)
f010099b: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
f010099f: 75 0d jne f01009ae <stab_binsearch+0xb6>
*region_right = *region_left - 1;
f01009a1: 8b 55 e8 mov -0x18(%ebp),%edx
f01009a4: 8b 02 mov (%edx),%eax
f01009a6: 48 dec %eax
f01009a7: 8b 4d e4 mov -0x1c(%ebp),%ecx
f01009aa: 89 01 mov %eax,(%ecx)
f01009ac: eb 22 jmp f01009d0 <stab_binsearch+0xd8>
else {
// find rightmost region containing 'addr'
for (l = *region_right;
f01009ae: 8b 4d e4 mov -0x1c(%ebp),%ecx
f01009b1: 8b 01 mov (%ecx),%eax
l > *region_left && stabs[l].n_type != type;
f01009b3: 8b 55 e8 mov -0x18(%ebp),%edx
f01009b6: 8b 0a mov (%edx),%ecx
if (!any_matches)
*region_right = *region_left - 1;
else {
// find rightmost region containing 'addr'
for (l = *region_right;
f01009b8: eb 01 jmp f01009bb <stab_binsearch+0xc3>
l > *region_left && stabs[l].n_type != type;
l--)
f01009ba: 48 dec %eax
if (!any_matches)
*region_right = *region_left - 1;
else {
// find rightmost region containing 'addr'
for (l = *region_right;
f01009bb: 39 c1 cmp %eax,%ecx
f01009bd: 7d 0c jge f01009cb <stab_binsearch+0xd3>
// left = 0, right = 657;
// stab_binsearch(stabs, &left, &right, N_SO, 0xf0100184);
// will exit setting left = 118, right = 554.
//
static void
stab_binsearch(const struct Stab *stabs, int *region_left, int *region_right,
f01009bf: 6b d0 0c imul $0xc,%eax,%edx
if (!any_matches)
*region_right = *region_left - 1;
else {
// find rightmost region containing 'addr'
for (l = *region_right;
l > *region_left && stabs[l].n_type != type;
f01009c2: 0f b6 54 13 04 movzbl 0x4(%ebx,%edx,1),%edx
f01009c7: 39 f2 cmp %esi,%edx
f01009c9: 75 ef jne f01009ba <stab_binsearch+0xc2>
l--)
/* do nothing */;
*region_left = l;
f01009cb: 8b 55 e8 mov -0x18(%ebp),%edx
f01009ce: 89 02 mov %eax,(%edx)
}
}
f01009d0: 83 c4 10 add $0x10,%esp
f01009d3: 5b pop %ebx
f01009d4: 5e pop %esi
f01009d5: 5f pop %edi
f01009d6: 5d pop %ebp
f01009d7: c3 ret
f01009d8 <debuginfo_eip>:
// negative if not. But even if it returns negative it has stored some
// information into '*info'.
//
int
debuginfo_eip(uintptr_t addr, struct Eipdebuginfo *info)
{
f01009d8: 55 push %ebp
f01009d9: 89 e5 mov %esp,%ebp
f01009db: 57 push %edi
f01009dc: 56 push %esi
f01009dd: 53 push %ebx
f01009de: 83 ec 2c sub $0x2c,%esp
f01009e1: 8b 75 08 mov 0x8(%ebp),%esi
f01009e4: 8b 5d 0c mov 0xc(%ebp),%ebx
const struct Stab *stabs, *stab_end;
const char *stabstr, *stabstr_end;
int lfile, rfile, lfun, rfun, lline, rline;
// Initialize *info
info->eip_file = "<unknown>";
f01009e7: c7 03 6c 1c 10 f0 movl $0xf0101c6c,(%ebx)
info->eip_line = 0;
f01009ed: c7 43 04 00 00 00 00 movl $0x0,0x4(%ebx)
info->eip_fn_name = "<unknown>";
f01009f4: c7 43 08 6c 1c 10 f0 movl $0xf0101c6c,0x8(%ebx)
info->eip_fn_namelen = 9;
f01009fb: c7 43 0c 09 00 00 00 movl $0x9,0xc(%ebx)
info->eip_fn_addr = addr;
f0100a02: 89 73 10 mov %esi,0x10(%ebx)
info->eip_fn_narg = 0;
f0100a05: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx)
// Find the relevant set of stabs
if (addr >= ULIM) {
f0100a0c: 81 fe ff ff 7f ef cmp $0xef7fffff,%esi
f0100a12: 76 12 jbe f0100a26 <debuginfo_eip+0x4e>
// Can't search for user-level addresses yet!
panic("User address");
}
// String table validity checks
if (stabstr_end <= stabstr || stabstr_end[-1] != 0)
f0100a14: b8 5a ee 10 f0 mov $0xf010ee5a,%eax
f0100a19: 3d 75 63 10 f0 cmp $0xf0106375,%eax
f0100a1e: 0f 86 50 01 00 00 jbe f0100b74 <debuginfo_eip+0x19c>
f0100a24: eb 1c jmp f0100a42 <debuginfo_eip+0x6a>
stab_end = __STAB_END__;
stabstr = __STABSTR_BEGIN__;
stabstr_end = __STABSTR_END__;
} else {
// Can't search for user-level addresses yet!
panic("User address");
f0100a26: c7 44 24 08 76 1c 10 movl $0xf0101c76,0x8(%esp)
f0100a2d: f0
f0100a2e: c7 44 24 04 7f 00 00 movl $0x7f,0x4(%esp)
f0100a35: 00
f0100a36: c7 04 24 83 1c 10 f0 movl $0xf0101c83,(%esp)
f0100a3d: e8 b6 f6 ff ff call f01000f8 <_panic>
}
// String table validity checks
if (stabstr_end <= stabstr || stabstr_end[-1] != 0)
return -1;
f0100a42: b8 ff ff ff ff mov $0xffffffff,%eax
// Can't search for user-level addresses yet!
panic("User address");
}
// String table validity checks
if (stabstr_end <= stabstr || stabstr_end[-1] != 0)
f0100a47: 80 3d 59 ee 10 f0 00 cmpb $0x0,0xf010ee59
f0100a4e: 0f 85 2c 01 00 00 jne f0100b80 <debuginfo_eip+0x1a8>
// 'eip'. First, we find the basic source file containing 'eip'.
// Then, we look in that source file for the function. Then we look
// for the line number.
// Search the entire set of stabs for the source file (type N_SO).
lfile = 0;
f0100a54: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
rfile = (stab_end - stabs) - 1;
f0100a5b: b8 74 63 10 f0 mov $0xf0106374,%eax
f0100a60: 2d a4 1e 10 f0 sub $0xf0101ea4,%eax
f0100a65: c1 f8 02 sar $0x2,%eax
f0100a68: 69 c0 ab aa aa aa imul $0xaaaaaaab,%eax,%eax
f0100a6e: 48 dec %eax
f0100a6f: 89 45 e0 mov %eax,-0x20(%ebp)
stab_binsearch(stabs, &lfile, &rfile, N_SO, addr);
f0100a72: 89 74 24 04 mov %esi,0x4(%esp)
f0100a76: c7 04 24 64 00 00 00 movl $0x64,(%esp)
f0100a7d: 8d 4d e0 lea -0x20(%ebp),%ecx
f0100a80: 8d 55 e4 lea -0x1c(%ebp),%edx
f0100a83: b8 a4 1e 10 f0 mov $0xf0101ea4,%eax
f0100a88: e8 6b fe ff ff call f01008f8 <stab_binsearch>
if (lfile == 0)
f0100a8d: 8b 55 e4 mov -0x1c(%ebp),%edx
return -1;
f0100a90: b8 ff ff ff ff mov $0xffffffff,%eax
// Search the entire set of stabs for the source file (type N_SO).
lfile = 0;
rfile = (stab_end - stabs) - 1;
stab_binsearch(stabs, &lfile, &rfile, N_SO, addr);
if (lfile == 0)
f0100a95: 85 d2 test %edx,%edx
f0100a97: 0f 84 e3 00 00 00 je f0100b80 <debuginfo_eip+0x1a8>
return -1;
// Search within that file's stabs for the function definition
// (N_FUN).
lfun = lfile;
f0100a9d: 89 55 dc mov %edx,-0x24(%ebp)
rfun = rfile;
f0100aa0: 8b 45 e0 mov -0x20(%ebp),%eax
f0100aa3: 89 45 d8 mov %eax,-0x28(%ebp)
stab_binsearch(stabs, &lfun, &rfun, N_FUN, addr);
f0100aa6: 89 74 24 04 mov %esi,0x4(%esp)
f0100aaa: c7 04 24 24 00 00 00 movl $0x24,(%esp)
f0100ab1: 8d 4d d8 lea -0x28(%ebp),%ecx
f0100ab4: 8d 55 dc lea -0x24(%ebp),%edx
f0100ab7: b8 a4 1e 10 f0 mov $0xf0101ea4,%eax
f0100abc: e8 37 fe ff ff call f01008f8 <stab_binsearch>
if (lfun <= rfun) {
f0100ac1: 8b 7d dc mov -0x24(%ebp),%edi
f0100ac4: 3b 7d d8 cmp -0x28(%ebp),%edi
f0100ac7: 7f 2e jg f0100af7 <debuginfo_eip+0x11f>
// stabs[lfun] points to the function name
// in the string table, but check bounds just in case.
if (stabs[lfun].n_strx < stabstr_end - stabstr)
f0100ac9: 6b c7 0c imul $0xc,%edi,%eax
f0100acc: 8d 90 a4 1e 10 f0 lea -0xfefe15c(%eax),%edx
f0100ad2: 8b 80 a4 1e 10 f0 mov -0xfefe15c(%eax),%eax
f0100ad8: b9 5a ee 10 f0 mov $0xf010ee5a,%ecx
f0100add: 81 e9 75 63 10 f0 sub $0xf0106375,%ecx
f0100ae3: 39 c8 cmp %ecx,%eax
f0100ae5: 73 08 jae f0100aef <debuginfo_eip+0x117>
info->eip_fn_name = stabstr + stabs[lfun].n_strx;
f0100ae7: 05 75 63 10 f0 add $0xf0106375,%eax
f0100aec: 89 43 08 mov %eax,0x8(%ebx)
info->eip_fn_addr = stabs[lfun].n_value;
f0100aef: 8b 42 08 mov 0x8(%edx),%eax
f0100af2: 89 43 10 mov %eax,0x10(%ebx)
f0100af5: eb 06 jmp f0100afd <debuginfo_eip+0x125>
lline = lfun;
rline = rfun;
} else {
// Couldn't find function stab! Maybe we're in an assembly
// file. Search the whole file for the line number.
info->eip_fn_addr = addr;
f0100af7: 89 73 10 mov %esi,0x10(%ebx)
lline = lfile;
f0100afa: 8b 7d e4 mov -0x1c(%ebp),%edi
rline = rfile;
}
// Ignore stuff after the colon.
info->eip_fn_namelen = strfind(info->eip_fn_name, ':') - info->eip_fn_name;
f0100afd: c7 44 24 04 3a 00 00 movl $0x3a,0x4(%esp)
f0100b04: 00
f0100b05: 8b 43 08 mov 0x8(%ebx),%eax
f0100b08: 89 04 24 mov %eax,(%esp)
f0100b0b: e8 22 08 00 00 call f0101332 <strfind>
f0100b10: 2b 43 08 sub 0x8(%ebx),%eax
f0100b13: 89 43 0c mov %eax,0xc(%ebx)
// Search backwards from the line number for the relevant filename
// stab.
// We can't just use the "lfile" stab because inlined functions
// can interpolate code from a different file!
// Such included source files use the N_SOL stab type.
while (lline >= lfile
f0100b16: 8b 4d e4 mov -0x1c(%ebp),%ecx
f0100b19: eb 01 jmp f0100b1c <debuginfo_eip+0x144>
&& stabs[lline].n_type != N_SOL
&& (stabs[lline].n_type != N_SO || !stabs[lline].n_value))
lline--;
f0100b1b: 4f dec %edi
// Search backwards from the line number for the relevant filename
// stab.
// We can't just use the "lfile" stab because inlined functions
// can interpolate code from a different file!
// Such included source files use the N_SOL stab type.
while (lline >= lfile
f0100b1c: 39 cf cmp %ecx,%edi
f0100b1e: 7c 24 jl f0100b44 <debuginfo_eip+0x16c>
&& stabs[lline].n_type != N_SOL
f0100b20: 8d 04 7f lea (%edi,%edi,2),%eax
f0100b23: 8d 14 85 a4 1e 10 f0 lea -0xfefe15c(,%eax,4),%edx
f0100b2a: 8a 42 04 mov 0x4(%edx),%al
f0100b2d: 3c 84 cmp $0x84,%al
f0100b2f: 74 57 je f0100b88 <debuginfo_eip+0x1b0>
&& (stabs[lline].n_type != N_SO || !stabs[lline].n_value))
f0100b31: 3c 64 cmp $0x64,%al
f0100b33: 75 e6 jne f0100b1b <debuginfo_eip+0x143>
f0100b35: 83 7a 08 00 cmpl $0x0,0x8(%edx)
f0100b39: 74 e0 je f0100b1b <debuginfo_eip+0x143>
f0100b3b: eb 4b jmp f0100b88 <debuginfo_eip+0x1b0>
lline--;
if (lline >= lfile && stabs[lline].n_strx < stabstr_end - stabstr)
info->eip_file = stabstr + stabs[lline].n_strx;
f0100b3d: 05 75 63 10 f0 add $0xf0106375,%eax
f0100b42: 89 03 mov %eax,(%ebx)
// Set eip_fn_narg to the number of arguments taken by the function,
// or 0 if there was no containing function.
if (lfun < rfun)
f0100b44: 8b 4d dc mov -0x24(%ebp),%ecx
f0100b47: 8b 55 d8 mov -0x28(%ebp),%edx
for (lline = lfun + 1;
lline < rfun && stabs[lline].n_type == N_PSYM;
lline++)
info->eip_fn_narg++;
return 0;
f0100b4a: b8 00 00 00 00 mov $0x0,%eax
info->eip_file = stabstr + stabs[lline].n_strx;
// Set eip_fn_narg to the number of arguments taken by the function,
// or 0 if there was no containing function.
if (lfun < rfun)
f0100b4f: 39 d1 cmp %edx,%ecx
f0100b51: 7d 2d jge f0100b80 <debuginfo_eip+0x1a8>
for (lline = lfun + 1;
f0100b53: 8d 41 01 lea 0x1(%ecx),%eax
f0100b56: eb 04 jmp f0100b5c <debuginfo_eip+0x184>
lline < rfun && stabs[lline].n_type == N_PSYM;
lline++)
info->eip_fn_narg++;
f0100b58: ff 43 14 incl 0x14(%ebx)
// Set eip_fn_narg to the number of arguments taken by the function,
// or 0 if there was no containing function.
if (lfun < rfun)
for (lline = lfun + 1;
lline < rfun && stabs[lline].n_type == N_PSYM;
lline++)
f0100b5b: 40 inc %eax
// Set eip_fn_narg to the number of arguments taken by the function,
// or 0 if there was no containing function.
if (lfun < rfun)
for (lline = lfun + 1;
f0100b5c: 39 d0 cmp %edx,%eax
f0100b5e: 74 1b je f0100b7b <debuginfo_eip+0x1a3>
lline < rfun && stabs[lline].n_type == N_PSYM;
f0100b60: 8d 0c 40 lea (%eax,%eax,2),%ecx
f0100b63: 80 3c 8d a8 1e 10 f0 cmpb $0xa0,-0xfefe158(,%ecx,4)
f0100b6a: a0
f0100b6b: 74 eb je f0100b58 <debuginfo_eip+0x180>
lline++)
info->eip_fn_narg++;
return 0;
f0100b6d: b8 00 00 00 00 mov $0x0,%eax
f0100b72: eb 0c jmp f0100b80 <debuginfo_eip+0x1a8>
panic("User address");
}
// String table validity checks
if (stabstr_end <= stabstr || stabstr_end[-1] != 0)
return -1;
f0100b74: b8 ff ff ff ff mov $0xffffffff,%eax
f0100b79: eb 05 jmp f0100b80 <debuginfo_eip+0x1a8>
for (lline = lfun + 1;
lline < rfun && stabs[lline].n_type == N_PSYM;
lline++)
info->eip_fn_narg++;
return 0;
f0100b7b: b8 00 00 00 00 mov $0x0,%eax
}
f0100b80: 83 c4 2c add $0x2c,%esp
f0100b83: 5b pop %ebx
f0100b84: 5e pop %esi
f0100b85: 5f pop %edi
f0100b86: 5d pop %ebp
f0100b87: c3 ret
// Such included source files use the N_SOL stab type.
while (lline >= lfile
&& stabs[lline].n_type != N_SOL
&& (stabs[lline].n_type != N_SO || !stabs[lline].n_value))
lline--;
if (lline >= lfile && stabs[lline].n_strx < stabstr_end - stabstr)
f0100b88: 6b ff 0c imul $0xc,%edi,%edi
f0100b8b: 8b 87 a4 1e 10 f0 mov -0xfefe15c(%edi),%eax
f0100b91: ba 5a ee 10 f0 mov $0xf010ee5a,%edx
f0100b96: 81 ea 75 63 10 f0 sub $0xf0106375,%edx
f0100b9c: 39 d0 cmp %edx,%eax
f0100b9e: 72 9d jb f0100b3d <debuginfo_eip+0x165>
f0100ba0: eb a2 jmp f0100b44 <debuginfo_eip+0x16c>
...
f0100ba4 <printnum>:
* using specified putch function and associated pointer putdat.
*/
static void
printnum(void (*putch)(int, void*), void *putdat,
unsigned long long num, unsigned base, int width, int padc)
{
f0100ba4: 55 push %ebp
f0100ba5: 89 e5 mov %esp,%ebp
f0100ba7: 57 push %edi
f0100ba8: 56 push %esi
f0100ba9: 53 push %ebx
f0100baa: 83 ec 3c sub $0x3c,%esp
f0100bad: 89 45 e4 mov %eax,-0x1c(%ebp)
f0100bb0: 89 d7 mov %edx,%edi
f0100bb2: 8b 45 08 mov 0x8(%ebp),%eax
f0100bb5: 89 45 dc mov %eax,-0x24(%ebp)
f0100bb8: 8b 45 0c mov 0xc(%ebp),%eax
f0100bbb: 89 45 e0 mov %eax,-0x20(%ebp)
f0100bbe: 8b 5d 14 mov 0x14(%ebp),%ebx
f0100bc1: 8b 75 18 mov 0x18(%ebp),%esi
// first recursively print all preceding (more significant) digits
if (num >= base) {
f0100bc4: 85 c0 test %eax,%eax
f0100bc6: 75 08 jne f0100bd0 <printnum+0x2c>
f0100bc8: 8b 45 dc mov -0x24(%ebp),%eax
f0100bcb: 39 45 10 cmp %eax,0x10(%ebp)
f0100bce: 77 57 ja f0100c27 <printnum+0x83>
printnum(putch, putdat, num / base, base, width - 1, padc);
f0100bd0: 89 74 24 10 mov %esi,0x10(%esp)
f0100bd4: 4b dec %ebx
f0100bd5: 89 5c 24 0c mov %ebx,0xc(%esp)
f0100bd9: 8b 45 10 mov 0x10(%ebp),%eax
f0100bdc: 89 44 24 08 mov %eax,0x8(%esp)
f0100be0: 8b 5c 24 08 mov 0x8(%esp),%ebx
f0100be4: 8b 74 24 0c mov 0xc(%esp),%esi
f0100be8: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
f0100bef: 00
f0100bf0: 8b 45 dc mov -0x24(%ebp),%eax
f0100bf3: 89 04 24 mov %eax,(%esp)
f0100bf6: 8b 45 e0 mov -0x20(%ebp),%eax
f0100bf9: 89 44 24 04 mov %eax,0x4(%esp)
f0100bfd: e8 3e 09 00 00 call f0101540 <__udivdi3>
f0100c02: 89 5c 24 08 mov %ebx,0x8(%esp)
f0100c06: 89 74 24 0c mov %esi,0xc(%esp)
f0100c0a: 89 04 24 mov %eax,(%esp)
f0100c0d: 89 54 24 04 mov %edx,0x4(%esp)
f0100c11: 89 fa mov %edi,%edx
f0100c13: 8b 45 e4 mov -0x1c(%ebp),%eax
f0100c16: e8 89 ff ff ff call f0100ba4 <printnum>
f0100c1b: eb 0f jmp f0100c2c <printnum+0x88>
} else {
// print any needed pad characters before first digit
while (--width > 0)
putch(padc, putdat);
f0100c1d: 89 7c 24 04 mov %edi,0x4(%esp)
f0100c21: 89 34 24 mov %esi,(%esp)
f0100c24: ff 55 e4 call *-0x1c(%ebp)
// first recursively print all preceding (more significant) digits
if (num >= base) {
printnum(putch, putdat, num / base, base, width - 1, padc);
} else {
// print any needed pad characters before first digit
while (--width > 0)
f0100c27: 4b dec %ebx
f0100c28: 85 db test %ebx,%ebx
f0100c2a: 7f f1 jg f0100c1d <printnum+0x79>
putch(padc, putdat);
}
// then print this (the least significant) digit
putch("0123456789abcdef"[num % base], putdat);
f0100c2c: 89 7c 24 04 mov %edi,0x4(%esp)
f0100c30: 8b 7c 24 04 mov 0x4(%esp),%edi
f0100c34: 8b 45 10 mov 0x10(%ebp),%eax
f0100c37: 89 44 24 08 mov %eax,0x8(%esp)
f0100c3b: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
f0100c42: 00
f0100c43: 8b 45 dc mov -0x24(%ebp),%eax
f0100c46: 89 04 24 mov %eax,(%esp)
f0100c49: 8b 45 e0 mov -0x20(%ebp),%eax
f0100c4c: 89 44 24 04 mov %eax,0x4(%esp)
f0100c50: e8 0b 0a 00 00 call f0101660 <__umoddi3>
f0100c55: 89 7c 24 04 mov %edi,0x4(%esp)
f0100c59: 0f be 80 91 1c 10 f0 movsbl -0xfefe36f(%eax),%eax
f0100c60: 89 04 24 mov %eax,(%esp)
f0100c63: ff 55 e4 call *-0x1c(%ebp)
}
f0100c66: 83 c4 3c add $0x3c,%esp
f0100c69: 5b pop %ebx
f0100c6a: 5e pop %esi
f0100c6b: 5f pop %edi
f0100c6c: 5d pop %ebp
f0100c6d: c3 ret
f0100c6e <getuint>:
// Get an unsigned int of various possible sizes from a varargs list,
// depending on the lflag parameter.
static unsigned long long
getuint(va_list *ap, int lflag)
{
f0100c6e: 55 push %ebp
f0100c6f: 89 e5 mov %esp,%ebp
if (lflag >= 2)
f0100c71: 83 fa 01 cmp $0x1,%edx
f0100c74: 7e 0e jle f0100c84 <getuint+0x16>
return va_arg(*ap, unsigned long long);
f0100c76: 8b 10 mov (%eax),%edx
f0100c78: 8d 4a 08 lea 0x8(%edx),%ecx
f0100c7b: 89 08 mov %ecx,(%eax)
f0100c7d: 8b 02 mov (%edx),%eax
f0100c7f: 8b 52 04 mov 0x4(%edx),%edx
f0100c82: eb 22 jmp f0100ca6 <getuint+0x38>
else if (lflag)
f0100c84: 85 d2 test %edx,%edx
f0100c86: 74 10 je f0100c98 <getuint+0x2a>
return va_arg(*ap, unsigned long);
f0100c88: 8b 10 mov (%eax),%edx
f0100c8a: 8d 4a 04 lea 0x4(%edx),%ecx
f0100c8d: 89 08 mov %ecx,(%eax)
f0100c8f: 8b 02 mov (%edx),%eax
f0100c91: ba 00 00 00 00 mov $0x0,%edx
f0100c96: eb 0e jmp f0100ca6 <getuint+0x38>
else
return va_arg(*ap, unsigned int);
f0100c98: 8b 10 mov (%eax),%edx
f0100c9a: 8d 4a 04 lea 0x4(%edx),%ecx
f0100c9d: 89 08 mov %ecx,(%eax)
f0100c9f: 8b 02 mov (%edx),%eax
f0100ca1: ba 00 00 00 00 mov $0x0,%edx
}
f0100ca6: 5d pop %ebp
f0100ca7: c3 ret
f0100ca8 <sprintputch>:
int cnt;
};
static void
sprintputch(int ch, struct sprintbuf *b)
{
f0100ca8: 55 push %ebp
f0100ca9: 89 e5 mov %esp,%ebp
f0100cab: 8b 45 0c mov 0xc(%ebp),%eax
b->cnt++;
f0100cae: ff 40 08 incl 0x8(%eax)
if (b->buf < b->ebuf)
f0100cb1: 8b 10 mov (%eax),%edx
f0100cb3: 3b 50 04 cmp 0x4(%eax),%edx
f0100cb6: 73 08 jae f0100cc0 <sprintputch+0x18>
*b->buf++ = ch;
f0100cb8: 8b 4d 08 mov 0x8(%ebp),%ecx
f0100cbb: 88 0a mov %cl,(%edx)
f0100cbd: 42 inc %edx
f0100cbe: 89 10 mov %edx,(%eax)
}
f0100cc0: 5d pop %ebp
f0100cc1: c3 ret
f0100cc2 <printfmt>:
}
}
void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...)
{
f0100cc2: 55 push %ebp
f0100cc3: 89 e5 mov %esp,%ebp
f0100cc5: 83 ec 18 sub $0x18,%esp
va_list ap;
va_start(ap, fmt);
f0100cc8: 8d 45 14 lea 0x14(%ebp),%eax
vprintfmt(putch, putdat, fmt, ap);
f0100ccb: 89 44 24 0c mov %eax,0xc(%esp)
f0100ccf: 8b 45 10 mov 0x10(%ebp),%eax
f0100cd2: 89 44 24 08 mov %eax,0x8(%esp)
f0100cd6: 8b 45 0c mov 0xc(%ebp),%eax
f0100cd9: 89 44 24 04 mov %eax,0x4(%esp)
f0100cdd: 8b 45 08 mov 0x8(%ebp),%eax
f0100ce0: 89 04 24 mov %eax,(%esp)
f0100ce3: e8 02 00 00 00 call f0100cea <vprintfmt>
va_end(ap);
}
f0100ce8: c9 leave
f0100ce9: c3 ret
f0100cea <vprintfmt>:
// Main function to format and print a string.
void printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...);
void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap)
{
f0100cea: 55 push %ebp
f0100ceb: 89 e5 mov %esp,%ebp
f0100ced: 57 push %edi
f0100cee: 56 push %esi
f0100cef: 53 push %ebx
f0100cf0: 83 ec 4c sub $0x4c,%esp
f0100cf3: 8b 5d 0c mov 0xc(%ebp),%ebx
f0100cf6: 8b 75 10 mov 0x10(%ebp),%esi
f0100cf9: eb 12 jmp f0100d0d <vprintfmt+0x23>
int base, lflag, width, precision, altflag;
char padc;
while (1) {
while ((ch = *(unsigned char *) fmt++) != '%') {
if (ch == '\0')
f0100cfb: 85 c0 test %eax,%eax
f0100cfd: 0f 84 8b 03 00 00 je f010108e <vprintfmt+0x3a4>
return;
putch(ch, putdat);
f0100d03: 89 5c 24 04 mov %ebx,0x4(%esp)
f0100d07: 89 04 24 mov %eax,(%esp)
f0100d0a: ff 55 08 call *0x8(%ebp)
unsigned long long num;
int base, lflag, width, precision, altflag;
char padc;
while (1) {
while ((ch = *(unsigned char *) fmt++) != '%') {
f0100d0d: 0f b6 06 movzbl (%esi),%eax
f0100d10: 46 inc %esi
f0100d11: 83 f8 25 cmp $0x25,%eax
f0100d14: 75 e5 jne f0100cfb <vprintfmt+0x11>
f0100d16: c6 45 d8 20 movb $0x20,-0x28(%ebp)
f0100d1a: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp)
f0100d21: bf ff ff ff ff mov $0xffffffff,%edi
f0100d26: c7 45 e4 ff ff ff ff movl $0xffffffff,-0x1c(%ebp)
f0100d2d: b9 00 00 00 00 mov $0x0,%ecx
f0100d32: eb 26 jmp f0100d5a <vprintfmt+0x70>
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
f0100d34: 8b 75 e0 mov -0x20(%ebp),%esi
// flag to pad on the right
case '-':
padc = '-';
f0100d37: c6 45 d8 2d movb $0x2d,-0x28(%ebp)
f0100d3b: eb 1d jmp f0100d5a <vprintfmt+0x70>
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
f0100d3d: 8b 75 e0 mov -0x20(%ebp),%esi
padc = '-';
goto reswitch;
// flag to pad with 0's instead of spaces
case '0':
padc = '0';
f0100d40: c6 45 d8 30 movb $0x30,-0x28(%ebp)
f0100d44: eb 14 jmp f0100d5a <vprintfmt+0x70>
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
f0100d46: 8b 75 e0 mov -0x20(%ebp),%esi
precision = va_arg(ap, int);
goto process_precision;
case '.':
if (width < 0)
width = 0;
f0100d49: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp)
f0100d50: eb 08 jmp f0100d5a <vprintfmt+0x70>
altflag = 1;
goto reswitch;
process_precision:
if (width < 0)
width = precision, precision = -1;
f0100d52: 89 7d e4 mov %edi,-0x1c(%ebp)
f0100d55: bf ff ff ff ff mov $0xffffffff,%edi
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
f0100d5a: 0f b6 06 movzbl (%esi),%eax
f0100d5d: 8d 56 01 lea 0x1(%esi),%edx
f0100d60: 89 55 e0 mov %edx,-0x20(%ebp)
f0100d63: 8a 16 mov (%esi),%dl
f0100d65: 83 ea 23 sub $0x23,%edx
f0100d68: 80 fa 55 cmp $0x55,%dl
f0100d6b: 0f 87 01 03 00 00 ja f0101072 <vprintfmt+0x388>
f0100d71: 0f b6 d2 movzbl %dl,%edx
f0100d74: ff 24 95 20 1d 10 f0 jmp *-0xfefe2e0(,%edx,4)
f0100d7b: 8b 75 e0 mov -0x20(%ebp),%esi
f0100d7e: bf 00 00 00 00 mov $0x0,%edi
case '6':
case '7':
case '8':
case '9':
for (precision = 0; ; ++fmt) {
precision = precision * 10 + ch - '0';
f0100d83: 8d 14 bf lea (%edi,%edi,4),%edx
f0100d86: 8d 7c 50 d0 lea -0x30(%eax,%edx,2),%edi
ch = *fmt;
f0100d8a: 0f be 06 movsbl (%esi),%eax
if (ch < '0' || ch > '9')
f0100d8d: 8d 50 d0 lea -0x30(%eax),%edx
f0100d90: 83 fa 09 cmp $0x9,%edx
f0100d93: 77 2a ja f0100dbf <vprintfmt+0xd5>
case '5':
case '6':
case '7':
case '8':
case '9':
for (precision = 0; ; ++fmt) {
f0100d95: 46 inc %esi
precision = precision * 10 + ch - '0';
ch = *fmt;
if (ch < '0' || ch > '9')
break;
}
f0100d96: eb eb jmp f0100d83 <vprintfmt+0x99>
goto process_precision;
case '*':
precision = va_arg(ap, int);
f0100d98: 8b 45 14 mov 0x14(%ebp),%eax
f0100d9b: 8d 50 04 lea 0x4(%eax),%edx
f0100d9e: 89 55 14 mov %edx,0x14(%ebp)
f0100da1: 8b 38 mov (%eax),%edi
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
f0100da3: 8b 75 e0 mov -0x20(%ebp),%esi
}
goto process_precision;
case '*':
precision = va_arg(ap, int);
goto process_precision;
f0100da6: eb 17 jmp f0100dbf <vprintfmt+0xd5>
case '.':
if (width < 0)
f0100da8: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
f0100dac: 78 98 js f0100d46 <vprintfmt+0x5c>
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
f0100dae: 8b 75 e0 mov -0x20(%ebp),%esi
f0100db1: eb a7 jmp f0100d5a <vprintfmt+0x70>
f0100db3: 8b 75 e0 mov -0x20(%ebp),%esi
if (width < 0)
width = 0;
goto reswitch;
case '#':
altflag = 1;
f0100db6: c7 45 dc 01 00 00 00 movl $0x1,-0x24(%ebp)
goto reswitch;
f0100dbd: eb 9b jmp f0100d5a <vprintfmt+0x70>
process_precision:
if (width < 0)
f0100dbf: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp)
f0100dc3: 79 95 jns f0100d5a <vprintfmt+0x70>
f0100dc5: eb 8b jmp f0100d52 <vprintfmt+0x68>
width = precision, precision = -1;
goto reswitch;
// long flag (doubled for long long)
case 'l':
lflag++;
f0100dc7: 41 inc %ecx
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
f0100dc8: 8b 75 e0 mov -0x20(%ebp),%esi
goto reswitch;
// long flag (doubled for long long)
case 'l':
lflag++;
goto reswitch;
f0100dcb: eb 8d jmp f0100d5a <vprintfmt+0x70>
// character
case 'c':
putch(va_arg(ap, int), putdat);
f0100dcd: 8b 45 14 mov 0x14(%ebp),%eax
f0100dd0: 8d 50 04 lea 0x4(%eax),%edx
f0100dd3: 89 55 14 mov %edx,0x14(%ebp)
f0100dd6: 89 5c 24 04 mov %ebx,0x4(%esp)
f0100dda: 8b 00 mov (%eax),%eax
f0100ddc: 89 04 24 mov %eax,(%esp)
f0100ddf: ff 55 08 call *0x8(%ebp)
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
f0100de2: 8b 75 e0 mov -0x20(%ebp),%esi
goto reswitch;
// character
case 'c':
putch(va_arg(ap, int), putdat);
break;
f0100de5: e9 23 ff ff ff jmp f0100d0d <vprintfmt+0x23>
// error message
case 'e':
err = va_arg(ap, int);
f0100dea: 8b 45 14 mov 0x14(%ebp),%eax
f0100ded: 8d 50 04 lea 0x4(%eax),%edx
f0100df0: 89 55 14 mov %edx,0x14(%ebp)
f0100df3: 8b 00 mov (%eax),%eax
f0100df5: 85 c0 test %eax,%eax
f0100df7: 79 02 jns f0100dfb <vprintfmt+0x111>
f0100df9: f7 d8 neg %eax
f0100dfb: 89 c2 mov %eax,%edx
if (err < 0)
err = -err;
if (err >= MAXERROR || (p = error_string[err]) == NULL)
f0100dfd: 83 f8 06 cmp $0x6,%eax
f0100e00: 7f 0b jg f0100e0d <vprintfmt+0x123>
f0100e02: 8b 04 85 78 1e 10 f0 mov -0xfefe188(,%eax,4),%eax
f0100e09: 85 c0 test %eax,%eax
f0100e0b: 75 23 jne f0100e30 <vprintfmt+0x146>
printfmt(putch, putdat, "error %d", err);
f0100e0d: 89 54 24 0c mov %edx,0xc(%esp)
f0100e11: c7 44 24 08 a9 1c 10 movl $0xf0101ca9,0x8(%esp)
f0100e18: f0
f0100e19: 89 5c 24 04 mov %ebx,0x4(%esp)
f0100e1d: 8b 45 08 mov 0x8(%ebp),%eax
f0100e20: 89 04 24 mov %eax,(%esp)
f0100e23: e8 9a fe ff ff call f0100cc2 <printfmt>
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
f0100e28: 8b 75 e0 mov -0x20(%ebp),%esi
case 'e':
err = va_arg(ap, int);
if (err < 0)
err = -err;
if (err >= MAXERROR || (p = error_string[err]) == NULL)
printfmt(putch, putdat, "error %d", err);
f0100e2b: e9 dd fe ff ff jmp f0100d0d <vprintfmt+0x23>
else
printfmt(putch, putdat, "%s", p);
f0100e30: 89 44 24 0c mov %eax,0xc(%esp)
f0100e34: c7 44 24 08 b2 1c 10 movl $0xf0101cb2,0x8(%esp)
f0100e3b: f0
f0100e3c: 89 5c 24 04 mov %ebx,0x4(%esp)
f0100e40: 8b 55 08 mov 0x8(%ebp),%edx
f0100e43: 89 14 24 mov %edx,(%esp)
f0100e46: e8 77 fe ff ff call f0100cc2 <printfmt>
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
f0100e4b: 8b 75 e0 mov -0x20(%ebp),%esi
f0100e4e: e9 ba fe ff ff jmp f0100d0d <vprintfmt+0x23>
f0100e53: 89 f9 mov %edi,%ecx
f0100e55: 8b 45 e4 mov -0x1c(%ebp),%eax
f0100e58: 89 45 d4 mov %eax,-0x2c(%ebp)
printfmt(putch, putdat, "%s", p);
break;
// string
case 's':
if ((p = va_arg(ap, char *)) == NULL)
f0100e5b: 8b 45 14 mov 0x14(%ebp),%eax
f0100e5e: 8d 50 04 lea 0x4(%eax),%edx
f0100e61: 89 55 14 mov %edx,0x14(%ebp)
f0100e64: 8b 30 mov (%eax),%esi
f0100e66: 85 f6 test %esi,%esi
f0100e68: 75 05 jne f0100e6f <vprintfmt+0x185>
p = "(null)";
f0100e6a: be a2 1c 10 f0 mov $0xf0101ca2,%esi
if (width > 0 && padc != '-')
f0100e6f: 83 7d d4 00 cmpl $0x0,-0x2c(%ebp)
f0100e73: 0f 8e 84 00 00 00 jle f0100efd <vprintfmt+0x213>
f0100e79: 80 7d d8 2d cmpb $0x2d,-0x28(%ebp)
f0100e7d: 74 7e je f0100efd <vprintfmt+0x213>
for (width -= strnlen(p, precision); width > 0; width--)
f0100e7f: 89 4c 24 04 mov %ecx,0x4(%esp)
f0100e83: 89 34 24 mov %esi,(%esp)
f0100e86: e8 73 03 00 00 call f01011fe <strnlen>
f0100e8b: 8b 55 d4 mov -0x2c(%ebp),%edx
f0100e8e: 29 c2 sub %eax,%edx
f0100e90: 89 55 e4 mov %edx,-0x1c(%ebp)
putch(padc, putdat);
f0100e93: 0f be 45 d8 movsbl -0x28(%ebp),%eax
f0100e97: 89 75 d0 mov %esi,-0x30(%ebp)
f0100e9a: 89 7d cc mov %edi,-0x34(%ebp)
f0100e9d: 89 de mov %ebx,%esi
f0100e9f: 89 d3 mov %edx,%ebx
f0100ea1: 89 c7 mov %eax,%edi
// string
case 's':
if ((p = va_arg(ap, char *)) == NULL)
p = "(null)";
if (width > 0 && padc != '-')
for (width -= strnlen(p, precision); width > 0; width--)
f0100ea3: eb 0b jmp f0100eb0 <vprintfmt+0x1c6>
putch(padc, putdat);
f0100ea5: 89 74 24 04 mov %esi,0x4(%esp)
f0100ea9: 89 3c 24 mov %edi,(%esp)
f0100eac: ff 55 08 call *0x8(%ebp)
// string
case 's':
if ((p = va_arg(ap, char *)) == NULL)
p = "(null)";
if (width > 0 && padc != '-')
for (width -= strnlen(p, precision); width > 0; width--)
f0100eaf: 4b dec %ebx
f0100eb0: 85 db test %ebx,%ebx
f0100eb2: 7f f1 jg f0100ea5 <vprintfmt+0x1bb>
f0100eb4: 8b 7d cc mov -0x34(%ebp),%edi
f0100eb7: 89 f3 mov %esi,%ebx
f0100eb9: 8b 75 d0 mov -0x30(%ebp),%esi
// Main function to format and print a string.
void printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...);
void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap)
f0100ebc: 8b 45 e4 mov -0x1c(%ebp),%eax
f0100ebf: 85 c0 test %eax,%eax
f0100ec1: 79 05 jns f0100ec8 <vprintfmt+0x1de>
f0100ec3: b8 00 00 00 00 mov $0x0,%eax
f0100ec8: 8b 55 e4 mov -0x1c(%ebp),%edx
f0100ecb: 29 c2 sub %eax,%edx
f0100ecd: 89 55 e4 mov %edx,-0x1c(%ebp)
f0100ed0: eb 2b jmp f0100efd <vprintfmt+0x213>
p = "(null)";
if (width > 0 && padc != '-')
for (width -= strnlen(p, precision); width > 0; width--)
putch(padc, putdat);
for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
if (altflag && (ch < ' ' || ch > '~'))
f0100ed2: 83 7d dc 00 cmpl $0x0,-0x24(%ebp)
f0100ed6: 74 18 je f0100ef0 <vprintfmt+0x206>
f0100ed8: 8d 50 e0 lea -0x20(%eax),%edx
f0100edb: 83 fa 5e cmp $0x5e,%edx
f0100ede: 76 10 jbe f0100ef0 <vprintfmt+0x206>
putch('?', putdat);
f0100ee0: 89 5c 24 04 mov %ebx,0x4(%esp)
f0100ee4: c7 04 24 3f 00 00 00 movl $0x3f,(%esp)
f0100eeb: ff 55 08 call *0x8(%ebp)
f0100eee: eb 0a jmp f0100efa <vprintfmt+0x210>
else
putch(ch, putdat);
f0100ef0: 89 5c 24 04 mov %ebx,0x4(%esp)
f0100ef4: 89 04 24 mov %eax,(%esp)
f0100ef7: ff 55 08 call *0x8(%ebp)
if ((p = va_arg(ap, char *)) == NULL)
p = "(null)";
if (width > 0 && padc != '-')
for (width -= strnlen(p, precision); width > 0; width--)
putch(padc, putdat);
for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
f0100efa: ff 4d e4 decl -0x1c(%ebp)
f0100efd: 0f be 06 movsbl (%esi),%eax
f0100f00: 46 inc %esi
f0100f01: 85 c0 test %eax,%eax
f0100f03: 74 21 je f0100f26 <vprintfmt+0x23c>
f0100f05: 85 ff test %edi,%edi
f0100f07: 78 c9 js f0100ed2 <vprintfmt+0x1e8>
f0100f09: 4f dec %edi
f0100f0a: 79 c6 jns f0100ed2 <vprintfmt+0x1e8>
f0100f0c: 8b 7d 08 mov 0x8(%ebp),%edi
f0100f0f: 89 de mov %ebx,%esi
f0100f11: 8b 5d e4 mov -0x1c(%ebp),%ebx
f0100f14: eb 18 jmp f0100f2e <vprintfmt+0x244>
if (altflag && (ch < ' ' || ch > '~'))
putch('?', putdat);
else
putch(ch, putdat);
for (; width > 0; width--)
putch(' ', putdat);
f0100f16: 89 74 24 04 mov %esi,0x4(%esp)
f0100f1a: c7 04 24 20 00 00 00 movl $0x20,(%esp)
f0100f21: ff d7 call *%edi
for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
if (altflag && (ch < ' ' || ch > '~'))
putch('?', putdat);
else
putch(ch, putdat);
for (; width > 0; width--)
f0100f23: 4b dec %ebx
f0100f24: eb 08 jmp f0100f2e <vprintfmt+0x244>
f0100f26: 8b 7d 08 mov 0x8(%ebp),%edi
f0100f29: 89 de mov %ebx,%esi
f0100f2b: 8b 5d e4 mov -0x1c(%ebp),%ebx
f0100f2e: 85 db test %ebx,%ebx
f0100f30: 7f e4 jg f0100f16 <vprintfmt+0x22c>
f0100f32: 89 7d 08 mov %edi,0x8(%ebp)
f0100f35: 89 f3 mov %esi,%ebx
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
f0100f37: 8b 75 e0 mov -0x20(%ebp),%esi
f0100f3a: e9 ce fd ff ff jmp f0100d0d <vprintfmt+0x23>
// Same as getuint but signed - can't use getuint
// because of sign extension
static long long
getint(va_list *ap, int lflag)
{
if (lflag >= 2)
f0100f3f: 83 f9 01 cmp $0x1,%ecx
f0100f42: 7e 10 jle f0100f54 <vprintfmt+0x26a>
return va_arg(*ap, long long);
f0100f44: 8b 45 14 mov 0x14(%ebp),%eax
f0100f47: 8d 50 08 lea 0x8(%eax),%edx
f0100f4a: 89 55 14 mov %edx,0x14(%ebp)
f0100f4d: 8b 30 mov (%eax),%esi
f0100f4f: 8b 78 04 mov 0x4(%eax),%edi
f0100f52: eb 26 jmp f0100f7a <vprintfmt+0x290>
else if (lflag)
f0100f54: 85 c9 test %ecx,%ecx
f0100f56: 74 12 je f0100f6a <vprintfmt+0x280>
return va_arg(*ap, long);
f0100f58: 8b 45 14 mov 0x14(%ebp),%eax
f0100f5b: 8d 50 04 lea 0x4(%eax),%edx
f0100f5e: 89 55 14 mov %edx,0x14(%ebp)
f0100f61: 8b 30 mov (%eax),%esi
f0100f63: 89 f7 mov %esi,%edi
f0100f65: c1 ff 1f sar $0x1f,%edi
f0100f68: eb 10 jmp f0100f7a <vprintfmt+0x290>
else
return va_arg(*ap, int);
f0100f6a: 8b 45 14 mov 0x14(%ebp),%eax
f0100f6d: 8d 50 04 lea 0x4(%eax),%edx
f0100f70: 89 55 14 mov %edx,0x14(%ebp)
f0100f73: 8b 30 mov (%eax),%esi
f0100f75: 89 f7 mov %esi,%edi
f0100f77: c1 ff 1f sar $0x1f,%edi
break;
// (signed) decimal
case 'd':
num = getint(&ap, lflag);
if ((long long) num < 0) {
f0100f7a: 85 ff test %edi,%edi
f0100f7c: 78 0a js f0100f88 <vprintfmt+0x29e>
putch('-', putdat);
num = -(long long) num;
}
base = 10;
f0100f7e: b8 0a 00 00 00 mov $0xa,%eax
f0100f83: e9 ac 00 00 00 jmp f0101034 <vprintfmt+0x34a>
// (signed) decimal
case 'd':
num = getint(&ap, lflag);
if ((long long) num < 0) {
putch('-', putdat);
f0100f88: 89 5c 24 04 mov %ebx,0x4(%esp)
f0100f8c: c7 04 24 2d 00 00 00 movl $0x2d,(%esp)
f0100f93: ff 55 08 call *0x8(%ebp)
num = -(long long) num;
f0100f96: f7 de neg %esi
f0100f98: 83 d7 00 adc $0x0,%edi
f0100f9b: f7 df neg %edi
}
base = 10;
f0100f9d: b8 0a 00 00 00 mov $0xa,%eax
f0100fa2: e9 8d 00 00 00 jmp f0101034 <vprintfmt+0x34a>
goto number;
// unsigned decimal
case 'u':
num = getuint(&ap, lflag);
f0100fa7: 89 ca mov %ecx,%edx
f0100fa9: 8d 45 14 lea 0x14(%ebp),%eax
f0100fac: e8 bd fc ff ff call f0100c6e <getuint>
f0100fb1: 89 c6 mov %eax,%esi
f0100fb3: 89 d7 mov %edx,%edi
base = 10;
f0100fb5: b8 0a 00 00 00 mov $0xa,%eax
goto number;
f0100fba: eb 78 jmp f0101034 <vprintfmt+0x34a>
// (unsigned) octal
case 'o':
// Replace this with your code.
putch('X', putdat);
f0100fbc: 89 5c 24 04 mov %ebx,0x4(%esp)
f0100fc0: c7 04 24 58 00 00 00 movl $0x58,(%esp)
f0100fc7: ff 55 08 call *0x8(%ebp)
putch('X', putdat);
f0100fca: 89 5c 24 04 mov %ebx,0x4(%esp)
f0100fce: c7 04 24 58 00 00 00 movl $0x58,(%esp)
f0100fd5: ff 55 08 call *0x8(%ebp)
putch('X', putdat);
f0100fd8: 89 5c 24 04 mov %ebx,0x4(%esp)
f0100fdc: c7 04 24 58 00 00 00 movl $0x58,(%esp)
f0100fe3: ff 55 08 call *0x8(%ebp)
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
f0100fe6: 8b 75 e0 mov -0x20(%ebp),%esi
case 'o':
// Replace this with your code.
putch('X', putdat);
putch('X', putdat);
putch('X', putdat);
break;
f0100fe9: e9 1f fd ff ff jmp f0100d0d <vprintfmt+0x23>
// pointer
case 'p':
putch('0', putdat);
f0100fee: 89 5c 24 04 mov %ebx,0x4(%esp)
f0100ff2: c7 04 24 30 00 00 00 movl $0x30,(%esp)
f0100ff9: ff 55 08 call *0x8(%ebp)
putch('x', putdat);
f0100ffc: 89 5c 24 04 mov %ebx,0x4(%esp)
f0101000: c7 04 24 78 00 00 00 movl $0x78,(%esp)
f0101007: ff 55 08 call *0x8(%ebp)
num = (unsigned long long)
(uintptr_t) va_arg(ap, void *);
f010100a: 8b 45 14 mov 0x14(%ebp),%eax
f010100d: 8d 50 04 lea 0x4(%eax),%edx
f0101010: 89 55 14 mov %edx,0x14(%ebp)
// pointer
case 'p':
putch('0', putdat);
putch('x', putdat);
num = (unsigned long long)
f0101013: 8b 30 mov (%eax),%esi
f0101015: bf 00 00 00 00 mov $0x0,%edi
(uintptr_t) va_arg(ap, void *);
base = 16;
f010101a: b8 10 00 00 00 mov $0x10,%eax
goto number;
f010101f: eb 13 jmp f0101034 <vprintfmt+0x34a>
// (unsigned) hexadecimal
case 'x':
num = getuint(&ap, lflag);
f0101021: 89 ca mov %ecx,%edx
f0101023: 8d 45 14 lea 0x14(%ebp),%eax
f0101026: e8 43 fc ff ff call f0100c6e <getuint>
f010102b: 89 c6 mov %eax,%esi
f010102d: 89 d7 mov %edx,%edi
base = 16;
f010102f: b8 10 00 00 00 mov $0x10,%eax
number:
printnum(putch, putdat, num, base, width, padc);
f0101034: 0f be 55 d8 movsbl -0x28(%ebp),%edx
f0101038: 89 54 24 10 mov %edx,0x10(%esp)
f010103c: 8b 55 e4 mov -0x1c(%ebp),%edx
f010103f: 89 54 24 0c mov %edx,0xc(%esp)
f0101043: 89 44 24 08 mov %eax,0x8(%esp)
f0101047: 89 34 24 mov %esi,(%esp)
f010104a: 89 7c 24 04 mov %edi,0x4(%esp)
f010104e: 89 da mov %ebx,%edx
f0101050: 8b 45 08 mov 0x8(%ebp),%eax
f0101053: e8 4c fb ff ff call f0100ba4 <printnum>
break;
f0101058: 8b 75 e0 mov -0x20(%ebp),%esi
f010105b: e9 ad fc ff ff jmp f0100d0d <vprintfmt+0x23>
// escaped '%' character
case '%':
putch(ch, putdat);
f0101060: 89 5c 24 04 mov %ebx,0x4(%esp)
f0101064: 89 04 24 mov %eax,(%esp)
f0101067: ff 55 08 call *0x8(%ebp)
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
f010106a: 8b 75 e0 mov -0x20(%ebp),%esi
break;
// escaped '%' character
case '%':
putch(ch, putdat);
break;
f010106d: e9 9b fc ff ff jmp f0100d0d <vprintfmt+0x23>
// unrecognized escape sequence - just print it literally
default:
putch('%', putdat);
f0101072: 89 5c 24 04 mov %ebx,0x4(%esp)
f0101076: c7 04 24 25 00 00 00 movl $0x25,(%esp)
f010107d: ff 55 08 call *0x8(%ebp)
for (fmt--; fmt[-1] != '%'; fmt--)
f0101080: eb 01 jmp f0101083 <vprintfmt+0x399>
f0101082: 4e dec %esi
f0101083: 80 7e ff 25 cmpb $0x25,-0x1(%esi)
f0101087: 75 f9 jne f0101082 <vprintfmt+0x398>
f0101089: e9 7f fc ff ff jmp f0100d0d <vprintfmt+0x23>
/* do nothing */;
break;
}
}
}
f010108e: 83 c4 4c add $0x4c,%esp
f0101091: 5b pop %ebx
f0101092: 5e pop %esi
f0101093: 5f pop %edi
f0101094: 5d pop %ebp
f0101095: c3 ret
f0101096 <vsnprintf>:
*b->buf++ = ch;
}
int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
f0101096: 55 push %ebp
f0101097: 89 e5 mov %esp,%ebp
f0101099: 83 ec 28 sub $0x28,%esp
f010109c: 8b 45 08 mov 0x8(%ebp),%eax
f010109f: 8b 55 0c mov 0xc(%ebp),%edx
struct sprintbuf b = {buf, buf+n-1, 0};
f01010a2: 89 45 ec mov %eax,-0x14(%ebp)
f01010a5: 8d 4c 10 ff lea -0x1(%eax,%edx,1),%ecx
f01010a9: 89 4d f0 mov %ecx,-0x10(%ebp)
f01010ac: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
if (buf == NULL || n < 1)
f01010b3: 85 c0 test %eax,%eax
f01010b5: 74 30 je f01010e7 <vsnprintf+0x51>
f01010b7: 85 d2 test %edx,%edx
f01010b9: 7e 33 jle f01010ee <vsnprintf+0x58>
return -E_INVAL;
// print the string to the buffer
vprintfmt((void*)sprintputch, &b, fmt, ap);
f01010bb: 8b 45 14 mov 0x14(%ebp),%eax
f01010be: 89 44 24 0c mov %eax,0xc(%esp)
f01010c2: 8b 45 10 mov 0x10(%ebp),%eax
f01010c5: 89 44 24 08 mov %eax,0x8(%esp)
f01010c9: 8d 45 ec lea -0x14(%ebp),%eax
f01010cc: 89 44 24 04 mov %eax,0x4(%esp)
f01010d0: c7 04 24 a8 0c 10 f0 movl $0xf0100ca8,(%esp)
f01010d7: e8 0e fc ff ff call f0100cea <vprintfmt>
// null terminate the buffer
*b.buf = '\0';
f01010dc: 8b 45 ec mov -0x14(%ebp),%eax
f01010df: c6 00 00 movb $0x0,(%eax)
return b.cnt;
f01010e2: 8b 45 f4 mov -0xc(%ebp),%eax
f01010e5: eb 0c jmp f01010f3 <vsnprintf+0x5d>
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
struct sprintbuf b = {buf, buf+n-1, 0};
if (buf == NULL || n < 1)
return -E_INVAL;
f01010e7: b8 fd ff ff ff mov $0xfffffffd,%eax
f01010ec: eb 05 jmp f01010f3 <vsnprintf+0x5d>
f01010ee: b8 fd ff ff ff mov $0xfffffffd,%eax
// null terminate the buffer
*b.buf = '\0';
return b.cnt;
}
f01010f3: c9 leave
f01010f4: c3 ret
f01010f5 <snprintf>:
int
snprintf(char *buf, int n, const char *fmt, ...)
{
f01010f5: 55 push %ebp
f01010f6: 89 e5 mov %esp,%ebp
f01010f8: 83 ec 18 sub $0x18,%esp
va_list ap;
int rc;
va_start(ap, fmt);
f01010fb: 8d 45 14 lea 0x14(%ebp),%eax
rc = vsnprintf(buf, n, fmt, ap);
f01010fe: 89 44 24 0c mov %eax,0xc(%esp)
f0101102: 8b 45 10 mov 0x10(%ebp),%eax
f0101105: 89 44 24 08 mov %eax,0x8(%esp)
f0101109: 8b 45 0c mov 0xc(%ebp),%eax
f010110c: 89 44 24 04 mov %eax,0x4(%esp)
f0101110: 8b 45 08 mov 0x8(%ebp),%eax
f0101113: 89 04 24 mov %eax,(%esp)
f0101116: e8 7b ff ff ff call f0101096 <vsnprintf>
va_end(ap);
return rc;
}
f010111b: c9 leave
f010111c: c3 ret
f010111d: 00 00 add %al,(%eax)
...
f0101120 <readline>:
#define BUFLEN 1024
static char buf[BUFLEN];
char *
readline(const char *prompt)
{
f0101120: 55 push %ebp
f0101121: 89 e5 mov %esp,%ebp
f0101123: 57 push %edi
f0101124: 56 push %esi
f0101125: 53 push %ebx
f0101126: 83 ec 1c sub $0x1c,%esp
f0101129: 8b 45 08 mov 0x8(%ebp),%eax
int i, c, echoing;
if (prompt != NULL)
f010112c: 85 c0 test %eax,%eax
f010112e: 74 10 je f0101140 <readline+0x20>
cprintf("%s", prompt);
f0101130: 89 44 24 04 mov %eax,0x4(%esp)
f0101134: c7 04 24 b2 1c 10 f0 movl $0xf0101cb2,(%esp)
f010113b: e8 9e f7 ff ff call f01008de <cprintf>
i = 0;
echoing = iscons(0);
f0101140: c7 04 24 00 00 00 00 movl $0x0,(%esp)
f0101147: e8 f1 f4 ff ff call f010063d <iscons>
f010114c: 89 c7 mov %eax,%edi
int i, c, echoing;
if (prompt != NULL)
cprintf("%s", prompt);
i = 0;
f010114e: be 00 00 00 00 mov $0x0,%esi
echoing = iscons(0);
while (1) {
c = getchar();
f0101153: e8 d4 f4 ff ff call f010062c <getchar>
f0101158: 89 c3 mov %eax,%ebx
if (c < 0) {
f010115a: 85 c0 test %eax,%eax
f010115c: 79 17 jns f0101175 <readline+0x55>
cprintf("read error: %e\n", c);
f010115e: 89 44 24 04 mov %eax,0x4(%esp)
f0101162: c7 04 24 94 1e 10 f0 movl $0xf0101e94,(%esp)
f0101169: e8 70 f7 ff ff call f01008de <cprintf>
return NULL;
f010116e: b8 00 00 00 00 mov $0x0,%eax
f0101173: eb 69 jmp f01011de <readline+0xbe>
} else if ((c == '\b' || c == '\x7f') && i > 0) {
f0101175: 83 f8 08 cmp $0x8,%eax
f0101178: 74 05 je f010117f <readline+0x5f>
f010117a: 83 f8 7f cmp $0x7f,%eax
f010117d: 75 17 jne f0101196 <readline+0x76>
f010117f: 85 f6 test %esi,%esi
f0101181: 7e 13 jle f0101196 <readline+0x76>
if (echoing)
f0101183: 85 ff test %edi,%edi
f0101185: 74 0c je f0101193 <readline+0x73>
cputchar('\b');
f0101187: c7 04 24 08 00 00 00 movl $0x8,(%esp)
f010118e: e8 89 f4 ff ff call f010061c <cputchar>
i--;
f0101193: 4e dec %esi
f0101194: eb bd jmp f0101153 <readline+0x33>
} else if (c >= ' ' && i < BUFLEN-1) {
f0101196: 83 fb 1f cmp $0x1f,%ebx
f0101199: 7e 1d jle f01011b8 <readline+0x98>
f010119b: 81 fe fe 03 00 00 cmp $0x3fe,%esi
f01011a1: 7f 15 jg f01011b8 <readline+0x98>
if (echoing)
f01011a3: 85 ff test %edi,%edi
f01011a5: 74 08 je f01011af <readline+0x8f>
cputchar(c);
f01011a7: 89 1c 24 mov %ebx,(%esp)
f01011aa: e8 6d f4 ff ff call f010061c <cputchar>
buf[i++] = c;
f01011af: 88 9e 40 95 11 f0 mov %bl,-0xfee6ac0(%esi)
f01011b5: 46 inc %esi
f01011b6: eb 9b jmp f0101153 <readline+0x33>
} else if (c == '\n' || c == '\r') {
f01011b8: 83 fb 0a cmp $0xa,%ebx
f01011bb: 74 05 je f01011c2 <readline+0xa2>
f01011bd: 83 fb 0d cmp $0xd,%ebx
f01011c0: 75 91 jne f0101153 <readline+0x33>
if (echoing)
f01011c2: 85 ff test %edi,%edi
f01011c4: 74 0c je f01011d2 <readline+0xb2>
cputchar('\n');
f01011c6: c7 04 24 0a 00 00 00 movl $0xa,(%esp)
f01011cd: e8 4a f4 ff ff call f010061c <cputchar>
buf[i] = 0;
f01011d2: c6 86 40 95 11 f0 00 movb $0x0,-0xfee6ac0(%esi)
return buf;
f01011d9: b8 40 95 11 f0 mov $0xf0119540,%eax
}
}
}
f01011de: 83 c4 1c add $0x1c,%esp
f01011e1: 5b pop %ebx
f01011e2: 5e pop %esi
f01011e3: 5f pop %edi
f01011e4: 5d pop %ebp
f01011e5: c3 ret
...
f01011e8 <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1
int
strlen(const char *s)
{
f01011e8: 55 push %ebp
f01011e9: 89 e5 mov %esp,%ebp
f01011eb: 8b 55 08 mov 0x8(%ebp),%edx
int n;
for (n = 0; *s != '\0'; s++)
f01011ee: b8 00 00 00 00 mov $0x0,%eax
f01011f3: eb 01 jmp f01011f6 <strlen+0xe>
n++;
f01011f5: 40 inc %eax
int
strlen(const char *s)
{
int n;
for (n = 0; *s != '\0'; s++)
f01011f6: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1)
f01011fa: 75 f9 jne f01011f5 <strlen+0xd>
n++;
return n;
}
f01011fc: 5d pop %ebp
f01011fd: c3 ret
f01011fe <strnlen>:
int
strnlen(const char *s, size_t size)
{
f01011fe: 55 push %ebp
f01011ff: 89 e5 mov %esp,%ebp
f0101201: 8b 4d 08 mov 0x8(%ebp),%ecx
n++;
return n;
}
int
strnlen(const char *s, size_t size)
f0101204: 8b 55 0c mov 0xc(%ebp),%edx
{
int n;
for (n = 0; size > 0 && *s != '\0'; s++, size--)
f0101207: b8 00 00 00 00 mov $0x0,%eax
f010120c: eb 01 jmp f010120f <strnlen+0x11>
n++;
f010120e: 40 inc %eax
int
strnlen(const char *s, size_t size)
{
int n;
for (n = 0; size > 0 && *s != '\0'; s++, size--)
f010120f: 39 d0 cmp %edx,%eax
f0101211: 74 06 je f0101219 <strnlen+0x1b>
f0101213: 80 3c 01 00 cmpb $0x0,(%ecx,%eax,1)
f0101217: 75 f5 jne f010120e <strnlen+0x10>
n++;
return n;
}
f0101219: 5d pop %ebp
f010121a: c3 ret
f010121b <strcpy>:
char *
strcpy(char *dst, const char *src)
{
f010121b: 55 push %ebp
f010121c: 89 e5 mov %esp,%ebp
f010121e: 53 push %ebx
f010121f: 8b 45 08 mov 0x8(%ebp),%eax
f0101222: 8b 5d 0c mov 0xc(%ebp),%ebx
char *ret;
ret = dst;
while ((*dst++ = *src++) != '\0')
f0101225: ba 00 00 00 00 mov $0x0,%edx
f010122a: 8a 0c 13 mov (%ebx,%edx,1),%cl
f010122d: 88 0c 10 mov %cl,(%eax,%edx,1)
f0101230: 42 inc %edx
f0101231: 84 c9 test %cl,%cl
f0101233: 75 f5 jne f010122a <strcpy+0xf>
/* do nothing */;
return ret;
}
f0101235: 5b pop %ebx
f0101236: 5d pop %ebp
f0101237: c3 ret
f0101238 <strcat>:
char *
strcat(char *dst, const char *src)
{
f0101238: 55 push %ebp
f0101239: 89 e5 mov %esp,%ebp
f010123b: 53 push %ebx
f010123c: 83 ec 08 sub $0x8,%esp
f010123f: 8b 5d 08 mov 0x8(%ebp),%ebx
int len = strlen(dst);
f0101242: 89 1c 24 mov %ebx,(%esp)
f0101245: e8 9e ff ff ff call f01011e8 <strlen>
strcpy(dst + len, src);
f010124a: 8b 55 0c mov 0xc(%ebp),%edx
f010124d: 89 54 24 04 mov %edx,0x4(%esp)
f0101251: 01 d8 add %ebx,%eax
f0101253: 89 04 24 mov %eax,(%esp)
f0101256: e8 c0 ff ff ff call f010121b <strcpy>
return dst;
}
f010125b: 89 d8 mov %ebx,%eax
f010125d: 83 c4 08 add $0x8,%esp
f0101260: 5b pop %ebx
f0101261: 5d pop %ebp
f0101262: c3 ret
f0101263 <strncpy>:
char *
strncpy(char *dst, const char *src, size_t size) {
f0101263: 55 push %ebp
f0101264: 89 e5 mov %esp,%ebp
f0101266: 56 push %esi
f0101267: 53 push %ebx
f0101268: 8b 45 08 mov 0x8(%ebp),%eax
f010126b: 8b 55 0c mov 0xc(%ebp),%edx
f010126e: 8b 75 10 mov 0x10(%ebp),%esi
size_t i;
char *ret;
ret = dst;
for (i = 0; i < size; i++) {
f0101271: b9 00 00 00 00 mov $0x0,%ecx
f0101276: eb 0c jmp f0101284 <strncpy+0x21>
*dst++ = *src;
f0101278: 8a 1a mov (%edx),%bl
f010127a: 88 1c 08 mov %bl,(%eax,%ecx,1)
// If strlen(src) < size, null-pad 'dst' out to 'size' chars
if (*src != '\0')
src++;
f010127d: 80 3a 01 cmpb $0x1,(%edx)
f0101280: 83 da ff sbb $0xffffffff,%edx
strncpy(char *dst, const char *src, size_t size) {
size_t i;
char *ret;
ret = dst;
for (i = 0; i < size; i++) {
f0101283: 41 inc %ecx
f0101284: 39 f1 cmp %esi,%ecx
f0101286: 75 f0 jne f0101278 <strncpy+0x15>
// If strlen(src) < size, null-pad 'dst' out to 'size' chars
if (*src != '\0')
src++;
}
return ret;
}
f0101288: 5b pop %ebx
f0101289: 5e pop %esi
f010128a: 5d pop %ebp
f010128b: c3 ret
f010128c <strlcpy>:
size_t
strlcpy(char *dst, const char *src, size_t size)
{
f010128c: 55 push %ebp
f010128d: 89 e5 mov %esp,%ebp
f010128f: 56 push %esi
f0101290: 53 push %ebx
f0101291: 8b 75 08 mov 0x8(%ebp),%esi
f0101294: 8b 4d 0c mov 0xc(%ebp),%ecx
f0101297: 8b 55 10 mov 0x10(%ebp),%edx
char *dst_in;
dst_in = dst;
if (size > 0) {
f010129a: 85 d2 test %edx,%edx
f010129c: 75 0a jne f01012a8 <strlcpy+0x1c>
f010129e: 89 f0 mov %esi,%eax
f01012a0: eb 1a jmp f01012bc <strlcpy+0x30>
while (--size > 0 && *src != '\0')
*dst++ = *src++;
f01012a2: 88 18 mov %bl,(%eax)
f01012a4: 40 inc %eax
f01012a5: 41 inc %ecx
f01012a6: eb 02 jmp f01012aa <strlcpy+0x1e>
strlcpy(char *dst, const char *src, size_t size)
{
char *dst_in;
dst_in = dst;
if (size > 0) {
f01012a8: 89 f0 mov %esi,%eax
while (--size > 0 && *src != '\0')
f01012aa: 4a dec %edx
f01012ab: 74 0a je f01012b7 <strlcpy+0x2b>
f01012ad: 8a 19 mov (%ecx),%bl
f01012af: 84 db test %bl,%bl
f01012b1: 75 ef jne f01012a2 <strlcpy+0x16>
f01012b3: 89 c2 mov %eax,%edx
f01012b5: eb 02 jmp f01012b9 <strlcpy+0x2d>
f01012b7: 89 c2 mov %eax,%edx
*dst++ = *src++;
*dst = '\0';
f01012b9: c6 02 00 movb $0x0,(%edx)
}
return dst - dst_in;
f01012bc: 29 f0 sub %esi,%eax
}
f01012be: 5b pop %ebx
f01012bf: 5e pop %esi
f01012c0: 5d pop %ebp
f01012c1: c3 ret
f01012c2 <strcmp>:
int
strcmp(const char *p, const char *q)
{
f01012c2: 55 push %ebp
f01012c3: 89 e5 mov %esp,%ebp
f01012c5: 8b 4d 08 mov 0x8(%ebp),%ecx
f01012c8: 8b 55 0c mov 0xc(%ebp),%edx
while (*p && *p == *q)
f01012cb: eb 02 jmp f01012cf <strcmp+0xd>
p++, q++;
f01012cd: 41 inc %ecx
f01012ce: 42 inc %edx
}
int
strcmp(const char *p, const char *q)
{
while (*p && *p == *q)
f01012cf: 8a 01 mov (%ecx),%al
f01012d1: 84 c0 test %al,%al
f01012d3: 74 04 je f01012d9 <strcmp+0x17>
f01012d5: 3a 02 cmp (%edx),%al
f01012d7: 74 f4 je f01012cd <strcmp+0xb>
p++, q++;
return (int) ((unsigned char) *p - (unsigned char) *q);
f01012d9: 0f b6 c0 movzbl %al,%eax
f01012dc: 0f b6 12 movzbl (%edx),%edx
f01012df: 29 d0 sub %edx,%eax
}
f01012e1: 5d pop %ebp
f01012e2: c3 ret
f01012e3 <strncmp>:
int
strncmp(const char *p, const char *q, size_t n)
{
f01012e3: 55 push %ebp
f01012e4: 89 e5 mov %esp,%ebp
f01012e6: 53 push %ebx
f01012e7: 8b 45 08 mov 0x8(%ebp),%eax
f01012ea: 8b 4d 0c mov 0xc(%ebp),%ecx
f01012ed: 8b 55 10 mov 0x10(%ebp),%edx
while (n > 0 && *p && *p == *q)
f01012f0: eb 03 jmp f01012f5 <strncmp+0x12>
n--, p++, q++;
f01012f2: 4a dec %edx
f01012f3: 40 inc %eax
f01012f4: 41 inc %ecx
}
int
strncmp(const char *p, const char *q, size_t n)
{
while (n > 0 && *p && *p == *q)
f01012f5: 85 d2 test %edx,%edx
f01012f7: 74 14 je f010130d <strncmp+0x2a>
f01012f9: 8a 18 mov (%eax),%bl
f01012fb: 84 db test %bl,%bl
f01012fd: 74 04 je f0101303 <strncmp+0x20>
f01012ff: 3a 19 cmp (%ecx),%bl
f0101301: 74 ef je f01012f2 <strncmp+0xf>
n--, p++, q++;
if (n == 0)
return 0;
else
return (int) ((unsigned char) *p - (unsigned char) *q);
f0101303: 0f b6 00 movzbl (%eax),%eax
f0101306: 0f b6 11 movzbl (%ecx),%edx
f0101309: 29 d0 sub %edx,%eax
f010130b: eb 05 jmp f0101312 <strncmp+0x2f>
strncmp(const char *p, const char *q, size_t n)
{
while (n > 0 && *p && *p == *q)
n--, p++, q++;
if (n == 0)
return 0;
f010130d: b8 00 00 00 00 mov $0x0,%eax
else
return (int) ((unsigned char) *p - (unsigned char) *q);
}
f0101312: 5b pop %ebx
f0101313: 5d pop %ebp
f0101314: c3 ret
f0101315 <strchr>:
// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
f0101315: 55 push %ebp
f0101316: 89 e5 mov %esp,%ebp
f0101318: 8b 45 08 mov 0x8(%ebp),%eax
f010131b: 8a 4d 0c mov 0xc(%ebp),%cl
for (; *s; s++)
f010131e: eb 05 jmp f0101325 <strchr+0x10>
if (*s == c)
f0101320: 38 ca cmp %cl,%dl
f0101322: 74 0c je f0101330 <strchr+0x1b>
// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
for (; *s; s++)
f0101324: 40 inc %eax
f0101325: 8a 10 mov (%eax),%dl
f0101327: 84 d2 test %dl,%dl
f0101329: 75 f5 jne f0101320 <strchr+0xb>
if (*s == c)
return (char *) s;
return 0;
f010132b: b8 00 00 00 00 mov $0x0,%eax
}
f0101330: 5d pop %ebp
f0101331: c3 ret
f0101332 <strfind>:
// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
f0101332: 55 push %ebp
f0101333: 89 e5 mov %esp,%ebp
f0101335: 8b 45 08 mov 0x8(%ebp),%eax
f0101338: 8a 4d 0c mov 0xc(%ebp),%cl
for (; *s; s++)
f010133b: eb 05 jmp f0101342 <strfind+0x10>
if (*s == c)
f010133d: 38 ca cmp %cl,%dl
f010133f: 74 07 je f0101348 <strfind+0x16>
// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
for (; *s; s++)
f0101341: 40 inc %eax
f0101342: 8a 10 mov (%eax),%dl
f0101344: 84 d2 test %dl,%dl
f0101346: 75 f5 jne f010133d <strfind+0xb>
if (*s == c)
break;
return (char *) s;
}
f0101348: 5d pop %ebp
f0101349: c3 ret
f010134a <memset>:
#if ASM
void *
memset(void *v, int c, size_t n)
{
f010134a: 55 push %ebp
f010134b: 89 e5 mov %esp,%ebp
f010134d: 57 push %edi
f010134e: 56 push %esi
f010134f: 53 push %ebx
f0101350: 8b 7d 08 mov 0x8(%ebp),%edi
f0101353: 8b 45 0c mov 0xc(%ebp),%eax
f0101356: 8b 4d 10 mov 0x10(%ebp),%ecx
char *p;
if (n == 0)
f0101359: 85 c9 test %ecx,%ecx
f010135b: 74 30 je f010138d <memset+0x43>
return v;
if ((int)v%4 == 0 && n%4 == 0) {
f010135d: f7 c7 03 00 00 00 test $0x3,%edi
f0101363: 75 25 jne f010138a <memset+0x40>
f0101365: f6 c1 03 test $0x3,%cl
f0101368: 75 20 jne f010138a <memset+0x40>
c &= 0xFF;
f010136a: 0f b6 d0 movzbl %al,%edx
c = (c<<24)|(c<<16)|(c<<8)|c;
f010136d: 89 d3 mov %edx,%ebx
f010136f: c1 e3 08 shl $0x8,%ebx
f0101372: 89 d6 mov %edx,%esi
f0101374: c1 e6 18 shl $0x18,%esi
f0101377: 89 d0 mov %edx,%eax
f0101379: c1 e0 10 shl $0x10,%eax
f010137c: 09 f0 or %esi,%eax
f010137e: 09 d0 or %edx,%eax
f0101380: 09 d8 or %ebx,%eax
asm volatile("cld; rep stosl\n"
:: "D" (v), "a" (c), "c" (n/4)
f0101382: c1 e9 02 shr $0x2,%ecx
if (n == 0)
return v;
if ((int)v%4 == 0 && n%4 == 0) {
c &= 0xFF;
c = (c<<24)|(c<<16)|(c<<8)|c;
asm volatile("cld; rep stosl\n"
f0101385: fc cld
f0101386: f3 ab rep stos %eax,%es:(%edi)
f0101388: eb 03 jmp f010138d <memset+0x43>
:: "D" (v), "a" (c), "c" (n/4)
: "cc", "memory");
} else
asm volatile("cld; rep stosb\n"
f010138a: fc cld
f010138b: f3 aa rep stos %al,%es:(%edi)
:: "D" (v), "a" (c), "c" (n)
: "cc", "memory");
return v;
}
f010138d: 89 f8 mov %edi,%eax
f010138f: 5b pop %ebx
f0101390: 5e pop %esi
f0101391: 5f pop %edi
f0101392: 5d pop %ebp
f0101393: c3 ret
f0101394 <memmove>:
void *
memmove(void *dst, const void *src, size_t n)
{
f0101394: 55 push %ebp
f0101395: 89 e5 mov %esp,%ebp
f0101397: 57 push %edi
f0101398: 56 push %esi
f0101399: 8b 45 08 mov 0x8(%ebp),%eax
f010139c: 8b 75 0c mov 0xc(%ebp),%esi
f010139f: 8b 4d 10 mov 0x10(%ebp),%ecx
const char *s;
char *d;
s = src;
d = dst;
if (s < d && s + n > d) {
f01013a2: 39 c6 cmp %eax,%esi
f01013a4: 73 34 jae f01013da <memmove+0x46>
f01013a6: 8d 14 0e lea (%esi,%ecx,1),%edx
f01013a9: 39 d0 cmp %edx,%eax
f01013ab: 73 2d jae f01013da <memmove+0x46>
s += n;
d += n;
f01013ad: 8d 3c 08 lea (%eax,%ecx,1),%edi
if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
f01013b0: f6 c2 03 test $0x3,%dl
f01013b3: 75 1b jne f01013d0 <memmove+0x3c>
f01013b5: f7 c7 03 00 00 00 test $0x3,%edi
f01013bb: 75 13 jne f01013d0 <memmove+0x3c>
f01013bd: f6 c1 03 test $0x3,%cl
f01013c0: 75 0e jne f01013d0 <memmove+0x3c>
asm volatile("std; rep movsl\n"
:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
f01013c2: 83 ef 04 sub $0x4,%edi
f01013c5: 8d 72 fc lea -0x4(%edx),%esi
f01013c8: c1 e9 02 shr $0x2,%ecx
d = dst;
if (s < d && s + n > d) {
s += n;
d += n;
if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
asm volatile("std; rep movsl\n"
f01013cb: fd std
f01013cc: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
f01013ce: eb 07 jmp f01013d7 <memmove+0x43>
:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
else
asm volatile("std; rep movsb\n"
:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
f01013d0: 4f dec %edi
f01013d1: 8d 72 ff lea -0x1(%edx),%esi
d += n;
if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
asm volatile("std; rep movsl\n"
:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
else
asm volatile("std; rep movsb\n"
f01013d4: fd std
f01013d5: f3 a4 rep movsb %ds:(%esi),%es:(%edi)
:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
// Some versions of GCC rely on DF being clear
asm volatile("cld" ::: "cc");
f01013d7: fc cld
f01013d8: eb 20 jmp f01013fa <memmove+0x66>
} else {
if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
f01013da: f7 c6 03 00 00 00 test $0x3,%esi
f01013e0: 75 13 jne f01013f5 <memmove+0x61>
f01013e2: a8 03 test $0x3,%al
f01013e4: 75 0f jne f01013f5 <memmove+0x61>
f01013e6: f6 c1 03 test $0x3,%cl
f01013e9: 75 0a jne f01013f5 <memmove+0x61>
asm volatile("cld; rep movsl\n"
:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
f01013eb: c1 e9 02 shr $0x2,%ecx
:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
// Some versions of GCC rely on DF being clear
asm volatile("cld" ::: "cc");
} else {
if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
asm volatile("cld; rep movsl\n"
f01013ee: 89 c7 mov %eax,%edi
f01013f0: fc cld
f01013f1: f3 a5 rep movsl %ds:(%esi),%es:(%edi)
f01013f3: eb 05 jmp f01013fa <memmove+0x66>
:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
else
asm volatile("cld; rep movsb\n"
f01013f5: 89 c7 mov %eax,%edi
f01013f7: fc cld
f01013f8: f3 a4 rep movsb %ds:(%esi),%es:(%edi)
:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
}
return dst;
}
f01013fa: 5e pop %esi
f01013fb: 5f pop %edi
f01013fc: 5d pop %ebp
f01013fd: c3 ret
f01013fe <memcpy>:
}
#endif
void *
memcpy(void *dst, const void *src, size_t n)
{
f01013fe: 55 push %ebp
f01013ff: 89 e5 mov %esp,%ebp
f0101401: 83 ec 0c sub $0xc,%esp
return memmove(dst, src, n);
f0101404: 8b 45 10 mov 0x10(%ebp),%eax
f0101407: 89 44 24 08 mov %eax,0x8(%esp)
f010140b: 8b 45 0c mov 0xc(%ebp),%eax
f010140e: 89 44 24 04 mov %eax,0x4(%esp)
f0101412: 8b 45 08 mov 0x8(%ebp),%eax
f0101415: 89 04 24 mov %eax,(%esp)
f0101418: e8 77 ff ff ff call f0101394 <memmove>
}
f010141d: c9 leave
f010141e: c3 ret
f010141f <memcmp>:
int
memcmp(const void *v1, const void *v2, size_t n)
{
f010141f: 55 push %ebp
f0101420: 89 e5 mov %esp,%ebp
f0101422: 57 push %edi
f0101423: 56 push %esi
f0101424: 53 push %ebx
f0101425: 8b 7d 08 mov 0x8(%ebp),%edi
f0101428: 8b 75 0c mov 0xc(%ebp),%esi
f010142b: 8b 5d 10 mov 0x10(%ebp),%ebx
const uint8_t *s1 = (const uint8_t *) v1;
const uint8_t *s2 = (const uint8_t *) v2;
while (n-- > 0) {
f010142e: ba 00 00 00 00 mov $0x0,%edx
f0101433: eb 16 jmp f010144b <memcmp+0x2c>
if (*s1 != *s2)
f0101435: 8a 04 17 mov (%edi,%edx,1),%al
f0101438: 42 inc %edx
f0101439: 8a 4c 16 ff mov -0x1(%esi,%edx,1),%cl
f010143d: 38 c8 cmp %cl,%al
f010143f: 74 0a je f010144b <memcmp+0x2c>
return (int) *s1 - (int) *s2;
f0101441: 0f b6 c0 movzbl %al,%eax
f0101444: 0f b6 c9 movzbl %cl,%ecx
f0101447: 29 c8 sub %ecx,%eax
f0101449: eb 09 jmp f0101454 <memcmp+0x35>
memcmp(const void *v1, const void *v2, size_t n)
{
const uint8_t *s1 = (const uint8_t *) v1;
const uint8_t *s2 = (const uint8_t *) v2;
while (n-- > 0) {
f010144b: 39 da cmp %ebx,%edx
f010144d: 75 e6 jne f0101435 <memcmp+0x16>
if (*s1 != *s2)
return (int) *s1 - (int) *s2;
s1++, s2++;
}
return 0;
f010144f: b8 00 00 00 00 mov $0x0,%eax
}
f0101454: 5b pop %ebx
f0101455: 5e pop %esi
f0101456: 5f pop %edi
f0101457: 5d pop %ebp
f0101458: c3 ret
f0101459 <memfind>:
void *
memfind(const void *s, int c, size_t n)
{
f0101459: 55 push %ebp
f010145a: 89 e5 mov %esp,%ebp
f010145c: 8b 45 08 mov 0x8(%ebp),%eax
f010145f: 8b 4d 0c mov 0xc(%ebp),%ecx
const void *ends = (const char *) s + n;
f0101462: 89 c2 mov %eax,%edx
f0101464: 03 55 10 add 0x10(%ebp),%edx
for (; s < ends; s++)
f0101467: eb 05 jmp f010146e <memfind+0x15>
if (*(const unsigned char *) s == (unsigned char) c)
f0101469: 38 08 cmp %cl,(%eax)
f010146b: 74 05 je f0101472 <memfind+0x19>
void *
memfind(const void *s, int c, size_t n)
{
const void *ends = (const char *) s + n;
for (; s < ends; s++)
f010146d: 40 inc %eax
f010146e: 39 d0 cmp %edx,%eax
f0101470: 72 f7 jb f0101469 <memfind+0x10>
if (*(const unsigned char *) s == (unsigned char) c)
break;
return (void *) s;
}
f0101472: 5d pop %ebp
f0101473: c3 ret
f0101474 <strtol>:
long
strtol(const char *s, char **endptr, int base)
{
f0101474: 55 push %ebp
f0101475: 89 e5 mov %esp,%ebp
f0101477: 57 push %edi
f0101478: 56 push %esi
f0101479: 53 push %ebx
f010147a: 8b 55 08 mov 0x8(%ebp),%edx
f010147d: 8b 5d 10 mov 0x10(%ebp),%ebx
int neg = 0;
long val = 0;
// gobble initial whitespace
while (*s == ' ' || *s == '\t')
f0101480: eb 01 jmp f0101483 <strtol+0xf>
s++;
f0101482: 42 inc %edx
{
int neg = 0;
long val = 0;
// gobble initial whitespace
while (*s == ' ' || *s == '\t')
f0101483: 8a 02 mov (%edx),%al
f0101485: 3c 20 cmp $0x20,%al
f0101487: 74 f9 je f0101482 <strtol+0xe>
f0101489: 3c 09 cmp $0x9,%al
f010148b: 74 f5 je f0101482 <strtol+0xe>
s++;
// plus/minus sign
if (*s == '+')
f010148d: 3c 2b cmp $0x2b,%al
f010148f: 75 08 jne f0101499 <strtol+0x25>
s++;
f0101491: 42 inc %edx
}
long
strtol(const char *s, char **endptr, int base)
{
int neg = 0;
f0101492: bf 00 00 00 00 mov $0x0,%edi
f0101497: eb 13 jmp f01014ac <strtol+0x38>
s++;
// plus/minus sign
if (*s == '+')
s++;
else if (*s == '-')
f0101499: 3c 2d cmp $0x2d,%al
f010149b: 75 0a jne f01014a7 <strtol+0x33>
s++, neg = 1;
f010149d: 8d 52 01 lea 0x1(%edx),%edx
f01014a0: bf 01 00 00 00 mov $0x1,%edi
f01014a5: eb 05 jmp f01014ac <strtol+0x38>
}
long
strtol(const char *s, char **endptr, int base)
{
int neg = 0;
f01014a7: bf 00 00 00 00 mov $0x0,%edi
s++;
else if (*s == '-')
s++, neg = 1;
// hex or octal base prefix
if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
f01014ac: 85 db test %ebx,%ebx
f01014ae: 74 05 je f01014b5 <strtol+0x41>
f01014b0: 83 fb 10 cmp $0x10,%ebx
f01014b3: 75 28 jne f01014dd <strtol+0x69>
f01014b5: 8a 02 mov (%edx),%al
f01014b7: 3c 30 cmp $0x30,%al
f01014b9: 75 10 jne f01014cb <strtol+0x57>
f01014bb: 80 7a 01 78 cmpb $0x78,0x1(%edx)
f01014bf: 75 0a jne f01014cb <strtol+0x57>
s += 2, base = 16;
f01014c1: 83 c2 02 add $0x2,%edx
f01014c4: bb 10 00 00 00 mov $0x10,%ebx
f01014c9: eb 12 jmp f01014dd <strtol+0x69>
else if (base == 0 && s[0] == '0')
f01014cb: 85 db test %ebx,%ebx
f01014cd: 75 0e jne f01014dd <strtol+0x69>
f01014cf: 3c 30 cmp $0x30,%al
f01014d1: 75 05 jne f01014d8 <strtol+0x64>
s++, base = 8;
f01014d3: 42 inc %edx
f01014d4: b3 08 mov $0x8,%bl
f01014d6: eb 05 jmp f01014dd <strtol+0x69>
else if (base == 0)
base = 10;
f01014d8: bb 0a 00 00 00 mov $0xa,%ebx
f01014dd: b8 00 00 00 00 mov $0x0,%eax
f01014e2: 89 de mov %ebx,%esi
// digits
while (1) {
int dig;
if (*s >= '0' && *s <= '9')
f01014e4: 8a 0a mov (%edx),%cl
f01014e6: 8d 59 d0 lea -0x30(%ecx),%ebx
f01014e9: 80 fb 09 cmp $0x9,%bl
f01014ec: 77 08 ja f01014f6 <strtol+0x82>
dig = *s - '0';
f01014ee: 0f be c9 movsbl %cl,%ecx
f01014f1: 83 e9 30 sub $0x30,%ecx
f01014f4: eb 1e jmp f0101514 <strtol+0xa0>
else if (*s >= 'a' && *s <= 'z')
f01014f6: 8d 59 9f lea -0x61(%ecx),%ebx
f01014f9: 80 fb 19 cmp $0x19,%bl
f01014fc: 77 08 ja f0101506 <strtol+0x92>
dig = *s - 'a' + 10;
f01014fe: 0f be c9 movsbl %cl,%ecx
f0101501: 83 e9 57 sub $0x57,%ecx
f0101504: eb 0e jmp f0101514 <strtol+0xa0>
else if (*s >= 'A' && *s <= 'Z')
f0101506: 8d 59 bf lea -0x41(%ecx),%ebx
f0101509: 80 fb 19 cmp $0x19,%bl
f010150c: 77 12 ja f0101520 <strtol+0xac>
dig = *s - 'A' + 10;
f010150e: 0f be c9 movsbl %cl,%ecx
f0101511: 83 e9 37 sub $0x37,%ecx
else
break;
if (dig >= base)
f0101514: 39 f1 cmp %esi,%ecx
f0101516: 7d 0c jge f0101524 <strtol+0xb0>
break;
s++, val = (val * base) + dig;
f0101518: 42 inc %edx
f0101519: 0f af c6 imul %esi,%eax
f010151c: 01 c8 add %ecx,%eax
// we don't properly detect overflow!
}
f010151e: eb c4 jmp f01014e4 <strtol+0x70>
if (*s >= '0' && *s <= '9')
dig = *s - '0';
else if (*s >= 'a' && *s <= 'z')
dig = *s - 'a' + 10;
else if (*s >= 'A' && *s <= 'Z')
f0101520: 89 c1 mov %eax,%ecx
f0101522: eb 02 jmp f0101526 <strtol+0xb2>
dig = *s - 'A' + 10;
else
break;
if (dig >= base)
f0101524: 89 c1 mov %eax,%ecx
break;
s++, val = (val * base) + dig;
// we don't properly detect overflow!
}
if (endptr)
f0101526: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
f010152a: 74 05 je f0101531 <strtol+0xbd>
*endptr = (char *) s;
f010152c: 8b 5d 0c mov 0xc(%ebp),%ebx
f010152f: 89 13 mov %edx,(%ebx)
return (neg ? -val : val);
f0101531: 85 ff test %edi,%edi
f0101533: 74 04 je f0101539 <strtol+0xc5>
f0101535: 89 c8 mov %ecx,%eax
f0101537: f7 d8 neg %eax
}
f0101539: 5b pop %ebx
f010153a: 5e pop %esi
f010153b: 5f pop %edi
f010153c: 5d pop %ebp
f010153d: c3 ret
...
f0101540 <__udivdi3>:
#endif
#ifdef L_udivdi3
UDWtype
__udivdi3 (UDWtype n, UDWtype d)
{
f0101540: 55 push %ebp
f0101541: 57 push %edi
f0101542: 56 push %esi
f0101543: 83 ec 10 sub $0x10,%esp
f0101546: 8b 74 24 20 mov 0x20(%esp),%esi
f010154a: 8b 4c 24 28 mov 0x28(%esp),%ecx
static inline __attribute__ ((__always_inline__))
#endif
UDWtype
__udivmoddi4 (UDWtype n, UDWtype d, UDWtype *rp)
{
const DWunion nn = {.ll = n};
f010154e: 89 74 24 04 mov %esi,0x4(%esp)
f0101552: 8b 7c 24 24 mov 0x24(%esp),%edi
const DWunion dd = {.ll = d};
f0101556: 89 cd mov %ecx,%ebp
f0101558: 8b 44 24 2c mov 0x2c(%esp),%eax
d1 = dd.s.high;
n0 = nn.s.low;
n1 = nn.s.high;
#if !UDIV_NEEDS_NORMALIZATION
if (d1 == 0)
f010155c: 85 c0 test %eax,%eax
f010155e: 75 2c jne f010158c <__udivdi3+0x4c>
{
if (d0 > n1)
f0101560: 39 f9 cmp %edi,%ecx
f0101562: 77 68 ja f01015cc <__udivdi3+0x8c>
}
else
{
/* qq = NN / 0d */
if (d0 == 0)
f0101564: 85 c9 test %ecx,%ecx
f0101566: 75 0b jne f0101573 <__udivdi3+0x33>
d0 = 1 / d0; /* Divide intentionally by zero. */
f0101568: b8 01 00 00 00 mov $0x1,%eax
f010156d: 31 d2 xor %edx,%edx
f010156f: f7 f1 div %ecx
f0101571: 89 c1 mov %eax,%ecx
udiv_qrnnd (q1, n1, 0, n1, d0);
f0101573: 31 d2 xor %edx,%edx
f0101575: 89 f8 mov %edi,%eax
f0101577: f7 f1 div %ecx
f0101579: 89 c7 mov %eax,%edi
udiv_qrnnd (q0, n0, n1, n0, d0);
f010157b: 89 f0 mov %esi,%eax
f010157d: f7 f1 div %ecx
f010157f: 89 c6 mov %eax,%esi
}
}
}
}
const DWunion ww = {{.low = q0, .high = q1}};
f0101581: 89 f0 mov %esi,%eax
f0101583: 89 fa mov %edi,%edx
#ifdef L_udivdi3
UDWtype
__udivdi3 (UDWtype n, UDWtype d)
{
return __udivmoddi4 (n, d, (UDWtype *) 0);
}
f0101585: 83 c4 10 add $0x10,%esp
f0101588: 5e pop %esi
f0101589: 5f pop %edi
f010158a: 5d pop %ebp
f010158b: c3 ret
}
#endif /* UDIV_NEEDS_NORMALIZATION */
else
{
if (d1 > n1)
f010158c: 39 f8 cmp %edi,%eax
f010158e: 77 2c ja f01015bc <__udivdi3+0x7c>
}
else
{
/* 0q = NN / dd */
count_leading_zeros (bm, d1);
f0101590: 0f bd f0 bsr %eax,%esi
if (bm == 0)
f0101593: 83 f6 1f xor $0x1f,%esi
f0101596: 75 4c jne f01015e4 <__udivdi3+0xa4>
This special case is necessary, not an optimization. */
/* The condition on the next line takes advantage of that
n1 >= d1 (true due to program flow). */
if (n1 > d1 || n0 >= d0)
f0101598: 39 f8 cmp %edi,%eax
{
q0 = 1;
sub_ddmmss (n1, n0, n1, n0, d1, d0);
f010159a: bf 00 00 00 00 mov $0x0,%edi
This special case is necessary, not an optimization. */
/* The condition on the next line takes advantage of that
n1 >= d1 (true due to program flow). */
if (n1 > d1 || n0 >= d0)
f010159f: 72 0a jb f01015ab <__udivdi3+0x6b>
f01015a1: 3b 4c 24 04 cmp 0x4(%esp),%ecx
f01015a5: 0f 87 ad 00 00 00 ja f0101658 <__udivdi3+0x118>
{
q0 = 1;
sub_ddmmss (n1, n0, n1, n0, d1, d0);
f01015ab: be 01 00 00 00 mov $0x1,%esi
}
}
}
}
const DWunion ww = {{.low = q0, .high = q1}};
f01015b0: 89 f0 mov %esi,%eax
f01015b2: 89 fa mov %edi,%edx
#ifdef L_udivdi3
UDWtype
__udivdi3 (UDWtype n, UDWtype d)
{
return __udivmoddi4 (n, d, (UDWtype *) 0);
}
f01015b4: 83 c4 10 add $0x10,%esp
f01015b7: 5e pop %esi
f01015b8: 5f pop %edi
f01015b9: 5d pop %ebp
f01015ba: c3 ret
f01015bb: 90 nop
}
#endif /* UDIV_NEEDS_NORMALIZATION */
else
{
if (d1 > n1)
f01015bc: 31 ff xor %edi,%edi
f01015be: 31 f6 xor %esi,%esi
}
}
}
}
const DWunion ww = {{.low = q0, .high = q1}};
f01015c0: 89 f0 mov %esi,%eax
f01015c2: 89 fa mov %edi,%edx
#ifdef L_udivdi3
UDWtype
__udivdi3 (UDWtype n, UDWtype d)
{
return __udivmoddi4 (n, d, (UDWtype *) 0);
}
f01015c4: 83 c4 10 add $0x10,%esp
f01015c7: 5e pop %esi
f01015c8: 5f pop %edi
f01015c9: 5d pop %ebp
f01015ca: c3 ret
f01015cb: 90 nop
{
if (d0 > n1)
{
/* 0q = nn / 0D */
udiv_qrnnd (q0, n0, n1, n0, d0);
f01015cc: 89 fa mov %edi,%edx
f01015ce: 89 f0 mov %esi,%eax
f01015d0: f7 f1 div %ecx
f01015d2: 89 c6 mov %eax,%esi
f01015d4: 31 ff xor %edi,%edi
}
}
}
}
const DWunion ww = {{.low = q0, .high = q1}};
f01015d6: 89 f0 mov %esi,%eax
f01015d8: 89 fa mov %edi,%edx
#ifdef L_udivdi3
UDWtype
__udivdi3 (UDWtype n, UDWtype d)
{
return __udivmoddi4 (n, d, (UDWtype *) 0);
}
f01015da: 83 c4 10 add $0x10,%esp
f01015dd: 5e pop %esi
f01015de: 5f pop %edi
f01015df: 5d pop %ebp
f01015e0: c3 ret
f01015e1: 8d 76 00 lea 0x0(%esi),%esi
UWtype m1, m0;
/* Normalize. */
b = W_TYPE_SIZE - bm;
d1 = (d1 << bm) | (d0 >> b);
f01015e4: 89 f1 mov %esi,%ecx
f01015e6: d3 e0 shl %cl,%eax
f01015e8: 89 44 24 0c mov %eax,0xc(%esp)
else
{
UWtype m1, m0;
/* Normalize. */
b = W_TYPE_SIZE - bm;
f01015ec: b8 20 00 00 00 mov $0x20,%eax
f01015f1: 29 f0 sub %esi,%eax
d1 = (d1 << bm) | (d0 >> b);
f01015f3: 89 ea mov %ebp,%edx
f01015f5: 88 c1 mov %al,%cl
f01015f7: d3 ea shr %cl,%edx
f01015f9: 8b 4c 24 0c mov 0xc(%esp),%ecx
f01015fd: 09 ca or %ecx,%edx
f01015ff: 89 54 24 08 mov %edx,0x8(%esp)
d0 = d0 << bm;
f0101603: 89 f1 mov %esi,%ecx
f0101605: d3 e5 shl %cl,%ebp
f0101607: 89 6c 24 0c mov %ebp,0xc(%esp)
n2 = n1 >> b;
f010160b: 89 fd mov %edi,%ebp
f010160d: 88 c1 mov %al,%cl
f010160f: d3 ed shr %cl,%ebp
n1 = (n1 << bm) | (n0 >> b);
f0101611: 89 fa mov %edi,%edx
f0101613: 89 f1 mov %esi,%ecx
f0101615: d3 e2 shl %cl,%edx
f0101617: 8b 7c 24 04 mov 0x4(%esp),%edi
f010161b: 88 c1 mov %al,%cl
f010161d: d3 ef shr %cl,%edi
f010161f: 09 d7 or %edx,%edi
n0 = n0 << bm;
udiv_qrnnd (q0, n1, n2, n1, d1);
f0101621: 89 f8 mov %edi,%eax
f0101623: 89 ea mov %ebp,%edx
f0101625: f7 74 24 08 divl 0x8(%esp)
f0101629: 89 d1 mov %edx,%ecx
f010162b: 89 c7 mov %eax,%edi
umul_ppmm (m1, m0, q0, d0);
f010162d: f7 64 24 0c mull 0xc(%esp)
if (m1 > n1 || (m1 == n1 && m0 > n0))
f0101631: 39 d1 cmp %edx,%ecx
f0101633: 72 17 jb f010164c <__udivdi3+0x10c>
f0101635: 74 09 je f0101640 <__udivdi3+0x100>
f0101637: 89 fe mov %edi,%esi
f0101639: 31 ff xor %edi,%edi
f010163b: e9 41 ff ff ff jmp f0101581 <__udivdi3+0x41>
d1 = (d1 << bm) | (d0 >> b);
d0 = d0 << bm;
n2 = n1 >> b;
n1 = (n1 << bm) | (n0 >> b);
n0 = n0 << bm;
f0101640: 8b 54 24 04 mov 0x4(%esp),%edx
f0101644: 89 f1 mov %esi,%ecx
f0101646: d3 e2 shl %cl,%edx
udiv_qrnnd (q0, n1, n2, n1, d1);
umul_ppmm (m1, m0, q0, d0);
if (m1 > n1 || (m1 == n1 && m0 > n0))
f0101648: 39 c2 cmp %eax,%edx
f010164a: 73 eb jae f0101637 <__udivdi3+0xf7>
{
q0--;
f010164c: 8d 77 ff lea -0x1(%edi),%esi
sub_ddmmss (m1, m0, m1, m0, d1, d0);
f010164f: 31 ff xor %edi,%edi
f0101651: e9 2b ff ff ff jmp f0101581 <__udivdi3+0x41>
f0101656: 66 90 xchg %ax,%ax
This special case is necessary, not an optimization. */
/* The condition on the next line takes advantage of that
n1 >= d1 (true due to program flow). */
if (n1 > d1 || n0 >= d0)
f0101658: 31 f6 xor %esi,%esi
f010165a: e9 22 ff ff ff jmp f0101581 <__udivdi3+0x41>
...
f0101660 <__umoddi3>:
#endif
#ifdef L_umoddi3
UDWtype
__umoddi3 (UDWtype u, UDWtype v)
{
f0101660: 55 push %ebp
f0101661: 57 push %edi
f0101662: 56 push %esi
f0101663: 83 ec 20 sub $0x20,%esp
f0101666: 8b 44 24 30 mov 0x30(%esp),%eax
f010166a: 8b 4c 24 38 mov 0x38(%esp),%ecx
static inline __attribute__ ((__always_inline__))
#endif
UDWtype
__udivmoddi4 (UDWtype n, UDWtype d, UDWtype *rp)
{
const DWunion nn = {.ll = n};
f010166e: 89 44 24 14 mov %eax,0x14(%esp)
f0101672: 8b 74 24 34 mov 0x34(%esp),%esi
const DWunion dd = {.ll = d};
f0101676: 89 4c 24 0c mov %ecx,0xc(%esp)
f010167a: 8b 6c 24 3c mov 0x3c(%esp),%ebp
UWtype q0, q1;
UWtype b, bm;
d0 = dd.s.low;
d1 = dd.s.high;
n0 = nn.s.low;
f010167e: 89 c7 mov %eax,%edi
n1 = nn.s.high;
f0101680: 89 f2 mov %esi,%edx
#if !UDIV_NEEDS_NORMALIZATION
if (d1 == 0)
f0101682: 85 ed test %ebp,%ebp
f0101684: 75 16 jne f010169c <__umoddi3+0x3c>
{
if (d0 > n1)
f0101686: 39 f1 cmp %esi,%ecx
f0101688: 0f 86 a6 00 00 00 jbe f0101734 <__umoddi3+0xd4>
if (d0 == 0)
d0 = 1 / d0; /* Divide intentionally by zero. */
udiv_qrnnd (q1, n1, 0, n1, d0);
udiv_qrnnd (q0, n0, n1, n0, d0);
f010168e: f7 f1 div %ecx
if (rp != 0)
{
rr.s.low = n0;
rr.s.high = 0;
*rp = rr.ll;
f0101690: 89 d0 mov %edx,%eax
f0101692: 31 d2 xor %edx,%edx
UDWtype w;
(void) __udivmoddi4 (u, v, &w);
return w;
}
f0101694: 83 c4 20 add $0x20,%esp
f0101697: 5e pop %esi
f0101698: 5f pop %edi
f0101699: 5d pop %ebp
f010169a: c3 ret
f010169b: 90 nop
}
#endif /* UDIV_NEEDS_NORMALIZATION */
else
{
if (d1 > n1)
f010169c: 39 f5 cmp %esi,%ebp
f010169e: 0f 87 ac 00 00 00 ja f0101750 <__umoddi3+0xf0>
}
else
{
/* 0q = NN / dd */
count_leading_zeros (bm, d1);
f01016a4: 0f bd c5 bsr %ebp,%eax
if (bm == 0)
f01016a7: 83 f0 1f xor $0x1f,%eax
f01016aa: 89 44 24 10 mov %eax,0x10(%esp)
f01016ae: 0f 84 a8 00 00 00 je f010175c <__umoddi3+0xfc>
UWtype m1, m0;
/* Normalize. */
b = W_TYPE_SIZE - bm;
d1 = (d1 << bm) | (d0 >> b);
f01016b4: 8a 4c 24 10 mov 0x10(%esp),%cl
f01016b8: d3 e5 shl %cl,%ebp
else
{
UWtype m1, m0;
/* Normalize. */
b = W_TYPE_SIZE - bm;
f01016ba: bf 20 00 00 00 mov $0x20,%edi
f01016bf: 2b 7c 24 10 sub 0x10(%esp),%edi
d1 = (d1 << bm) | (d0 >> b);
f01016c3: 8b 44 24 0c mov 0xc(%esp),%eax
f01016c7: 89 f9 mov %edi,%ecx
f01016c9: d3 e8 shr %cl,%eax
f01016cb: 09 e8 or %ebp,%eax
f01016cd: 89 44 24 18 mov %eax,0x18(%esp)
d0 = d0 << bm;
f01016d1: 8b 44 24 0c mov 0xc(%esp),%eax
f01016d5: 8a 4c 24 10 mov 0x10(%esp),%cl
f01016d9: d3 e0 shl %cl,%eax
f01016db: 89 44 24 0c mov %eax,0xc(%esp)
n2 = n1 >> b;
n1 = (n1 << bm) | (n0 >> b);
f01016df: 89 f2 mov %esi,%edx
f01016e1: d3 e2 shl %cl,%edx
n0 = n0 << bm;
f01016e3: 8b 44 24 14 mov 0x14(%esp),%eax
f01016e7: d3 e0 shl %cl,%eax
f01016e9: 89 44 24 1c mov %eax,0x1c(%esp)
b = W_TYPE_SIZE - bm;
d1 = (d1 << bm) | (d0 >> b);
d0 = d0 << bm;
n2 = n1 >> b;
n1 = (n1 << bm) | (n0 >> b);
f01016ed: 8b 44 24 14 mov 0x14(%esp),%eax
f01016f1: 89 f9 mov %edi,%ecx
f01016f3: d3 e8 shr %cl,%eax
f01016f5: 09 d0 or %edx,%eax
b = W_TYPE_SIZE - bm;
d1 = (d1 << bm) | (d0 >> b);
d0 = d0 << bm;
n2 = n1 >> b;
f01016f7: d3 ee shr %cl,%esi
n1 = (n1 << bm) | (n0 >> b);
n0 = n0 << bm;
udiv_qrnnd (q0, n1, n2, n1, d1);
f01016f9: 89 f2 mov %esi,%edx
f01016fb: f7 74 24 18 divl 0x18(%esp)
f01016ff: 89 d6 mov %edx,%esi
umul_ppmm (m1, m0, q0, d0);
f0101701: f7 64 24 0c mull 0xc(%esp)
f0101705: 89 c5 mov %eax,%ebp
f0101707: 89 d1 mov %edx,%ecx
if (m1 > n1 || (m1 == n1 && m0 > n0))
f0101709: 39 d6 cmp %edx,%esi
f010170b: 72 67 jb f0101774 <__umoddi3+0x114>
f010170d: 74 75 je f0101784 <__umoddi3+0x124>
q1 = 0;
/* Remainder in (n1n0 - m1m0) >> bm. */
if (rp != 0)
{
sub_ddmmss (n1, n0, n1, n0, m1, m0);
f010170f: 8b 44 24 1c mov 0x1c(%esp),%eax
f0101713: 29 e8 sub %ebp,%eax
f0101715: 19 ce sbb %ecx,%esi
rr.s.low = (n1 << b) | (n0 >> bm);
f0101717: 8a 4c 24 10 mov 0x10(%esp),%cl
f010171b: d3 e8 shr %cl,%eax
f010171d: 89 f2 mov %esi,%edx
f010171f: 89 f9 mov %edi,%ecx
f0101721: d3 e2 shl %cl,%edx
rr.s.high = n1 >> bm;
*rp = rr.ll;
f0101723: 09 d0 or %edx,%eax
f0101725: 89 f2 mov %esi,%edx
f0101727: 8a 4c 24 10 mov 0x10(%esp),%cl
f010172b: d3 ea shr %cl,%edx
UDWtype w;
(void) __udivmoddi4 (u, v, &w);
return w;
}
f010172d: 83 c4 20 add $0x20,%esp
f0101730: 5e pop %esi
f0101731: 5f pop %edi
f0101732: 5d pop %ebp
f0101733: c3 ret
}
else
{
/* qq = NN / 0d */
if (d0 == 0)
f0101734: 85 c9 test %ecx,%ecx
f0101736: 75 0b jne f0101743 <__umoddi3+0xe3>
d0 = 1 / d0; /* Divide intentionally by zero. */
f0101738: b8 01 00 00 00 mov $0x1,%eax
f010173d: 31 d2 xor %edx,%edx
f010173f: f7 f1 div %ecx
f0101741: 89 c1 mov %eax,%ecx
udiv_qrnnd (q1, n1, 0, n1, d0);
f0101743: 89 f0 mov %esi,%eax
f0101745: 31 d2 xor %edx,%edx
f0101747: f7 f1 div %ecx
udiv_qrnnd (q0, n0, n1, n0, d0);
f0101749: 89 f8 mov %edi,%eax
f010174b: e9 3e ff ff ff jmp f010168e <__umoddi3+0x2e>
/* Remainder in n1n0. */
if (rp != 0)
{
rr.s.low = n0;
rr.s.high = n1;
*rp = rr.ll;
f0101750: 89 f2 mov %esi,%edx
UDWtype w;
(void) __udivmoddi4 (u, v, &w);
return w;
}
f0101752: 83 c4 20 add $0x20,%esp
f0101755: 5e pop %esi
f0101756: 5f pop %edi
f0101757: 5d pop %ebp
f0101758: c3 ret
f0101759: 8d 76 00 lea 0x0(%esi),%esi
This special case is necessary, not an optimization. */
/* The condition on the next line takes advantage of that
n1 >= d1 (true due to program flow). */
if (n1 > d1 || n0 >= d0)
f010175c: 39 f5 cmp %esi,%ebp
f010175e: 72 04 jb f0101764 <__umoddi3+0x104>
f0101760: 39 f9 cmp %edi,%ecx
f0101762: 77 06 ja f010176a <__umoddi3+0x10a>
{
q0 = 1;
sub_ddmmss (n1, n0, n1, n0, d1, d0);
f0101764: 89 f2 mov %esi,%edx
f0101766: 29 cf sub %ecx,%edi
f0101768: 19 ea sbb %ebp,%edx
if (rp != 0)
{
rr.s.low = n0;
rr.s.high = n1;
*rp = rr.ll;
f010176a: 89 f8 mov %edi,%eax
UDWtype w;
(void) __udivmoddi4 (u, v, &w);
return w;
}
f010176c: 83 c4 20 add $0x20,%esp
f010176f: 5e pop %esi
f0101770: 5f pop %edi
f0101771: 5d pop %ebp
f0101772: c3 ret
f0101773: 90 nop
umul_ppmm (m1, m0, q0, d0);
if (m1 > n1 || (m1 == n1 && m0 > n0))
{
q0--;
sub_ddmmss (m1, m0, m1, m0, d1, d0);
f0101774: 89 d1 mov %edx,%ecx
f0101776: 89 c5 mov %eax,%ebp
f0101778: 2b 6c 24 0c sub 0xc(%esp),%ebp
f010177c: 1b 4c 24 18 sbb 0x18(%esp),%ecx
f0101780: eb 8d jmp f010170f <__umoddi3+0xaf>
f0101782: 66 90 xchg %ax,%ax
n0 = n0 << bm;
udiv_qrnnd (q0, n1, n2, n1, d1);
umul_ppmm (m1, m0, q0, d0);
if (m1 > n1 || (m1 == n1 && m0 > n0))
f0101784: 39 44 24 1c cmp %eax,0x1c(%esp)
f0101788: 72 ea jb f0101774 <__umoddi3+0x114>
f010178a: 89 f1 mov %esi,%ecx
f010178c: eb 81 jmp f010170f <__umoddi3+0xaf>
|
week3/subprograms.adb | adammw/rtp_labs | 0 | 9646 | with Ada.Text_IO, Ada.Integer_Text_IO;
use Ada.Text_IO, Ada.Integer_Text_IO;
procedure Subprograms is
A, B, C, D : Integer;
procedure Max_Min (A, B: in Integer; C, D: out Integer) is
begin
if A > B then
C := A;
D := B;
else
C := B;
D := A;
end if;
end Max_Min;
begin
Put("A=");
Get(A); Skip_Line;
Put("B=");
Get(B); Skip_Line;
Max_Min(A, B, C, D);
Put_Line("C=" & C'Img & " D=" & D'Img);
end Subprograms;
|
programs/oeis/228/A228842.asm | neoneye/loda | 22 | 101808 | <reponame>neoneye/loda
; A228842: Binomial transform of A014448.
; 2,6,28,144,752,3936,20608,107904,564992,2958336,15490048,81106944,424681472,2223661056,11643240448,60964798464,319215828992,1671435780096,8751751364608,45824765067264,239941584945152,1256350449401856,6578336356630528,34444616342175744,180354352626532352,944347650390491136,4944668491836817408,25890620349458939904,135565048129406369792,709827807378602459136,3716706651753989275648,19460928681009525817344,101898745479041197801472,533548758150209083539456,2793697566985089710030848,14627990369309701926027264,76593151947917852716040192,401046950210268308592132096,2099909093469938440688631808,10995266759978557409763262464,57571964185991590695825047552,301450718076035314535897235456,1578416451712245524432083222528,8264695837969331888448910393344,43274509220967009232965129469952,226588271973924727843995135246336,1186431594959680330132110293598208,6212236481862383069416681220603904,32527692511335577095971646149230592,170317209140563930298163152012967936,891792484798041273405092327480885248
mov $1,2
lpb $0
sub $0,1
mul $1,2
sub $1,1
add $2,$1
add $1,$2
mul $2,2
lpe
mov $0,$1
|
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0xca.log_21829_1436.asm | ljhsiun2/medusa | 9 | 92103 | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r15
push %r8
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x19ca5, %rdi
nop
inc %r13
mov (%rdi), %r8w
nop
nop
nop
add %rbp, %rbp
lea addresses_UC_ht+0xe025, %r15
sub $38203, %r8
mov $0x6162636465666768, %r12
movq %r12, (%r15)
nop
xor $22331, %r13
lea addresses_UC_ht+0xa08b, %rsi
lea addresses_WC_ht+0x8325, %rdi
nop
nop
nop
inc %rbp
mov $20, %rcx
rep movsl
nop
nop
nop
nop
nop
sub $44850, %rcx
lea addresses_WT_ht+0x1af65, %r13
clflush (%r13)
nop
nop
nop
nop
nop
sub $53901, %rbp
movw $0x6162, (%r13)
nop
nop
nop
and $60383, %rbp
lea addresses_WC_ht+0x1e7e5, %rsi
lea addresses_WC_ht+0xc725, %rdi
nop
nop
nop
xor $63063, %r15
mov $23, %rcx
rep movsw
cmp $37641, %rbp
lea addresses_WC_ht+0x1aa2e, %rsi
lea addresses_WC_ht+0x12565, %rdi
nop
add $25742, %r15
mov $106, %rcx
rep movsw
inc %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r15
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r9
push %rbx
push %rdi
push %rdx
// Faulty Load
mov $0x1405c40000000725, %r9
clflush (%r9)
nop
nop
nop
nop
nop
add %rbx, %rbx
movb (%r9), %r11b
lea oracles, %rdi
and $0xff, %r11
shlq $12, %r11
mov (%rdi,%r11,1), %r11
pop %rdx
pop %rdi
pop %rbx
pop %r9
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': True, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': True, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
P6/data_P6/testpoint/testpoint93.asm | alxzzhou/BUAA_CO_2020 | 1 | 164799 | ori $1, $0, 8
ori $2, $0, 0
ori $3, $0, 10
ori $4, $0, 7
sw $4, 0($0)
sw $1, 4($0)
sw $4, 8($0)
sw $2, 12($0)
sw $1, 16($0)
sw $3, 20($0)
sw $3, 24($0)
sw $1, 28($0)
sw $3, 32($0)
sw $2, 36($0)
sw $4, 40($0)
sw $2, 44($0)
sw $4, 48($0)
sw $4, 52($0)
sw $1, 56($0)
sw $3, 60($0)
sw $1, 64($0)
sw $2, 68($0)
sw $2, 72($0)
sw $2, 76($0)
sw $4, 80($0)
sw $4, 84($0)
sw $4, 88($0)
sw $4, 92($0)
sw $1, 96($0)
sw $4, 100($0)
sw $4, 104($0)
sw $4, 108($0)
sw $2, 112($0)
sw $4, 116($0)
sw $1, 120($0)
sw $4, 124($0)
bne $2, $2, TAG1
mfhi $1
bne $2, $1, TAG1
sw $2, 0($1)
TAG1:
sh $1, 0($1)
mult $1, $1
sw $1, 0($1)
lhu $3, 0($1)
TAG2:
srl $1, $3, 6
mult $1, $1
mfhi $4
slt $2, $3, $3
TAG3:
sh $2, 0($2)
nor $1, $2, $2
beq $1, $2, TAG4
mtlo $1
TAG4:
slt $1, $1, $1
bgtz $1, TAG5
sltu $1, $1, $1
bgez $1, TAG5
TAG5:
mult $1, $1
addi $2, $1, 3
bne $2, $1, TAG6
mtlo $2
TAG6:
lbu $3, 0($2)
andi $2, $2, 2
div $2, $2
bne $3, $3, TAG7
TAG7:
mfhi $1
srl $4, $1, 13
addi $4, $4, 14
mflo $3
TAG8:
subu $2, $3, $3
lbu $1, 0($2)
subu $3, $3, $2
mthi $3
TAG9:
mtlo $3
addiu $3, $3, 14
bgtz $3, TAG10
multu $3, $3
TAG10:
mtlo $3
mthi $3
mthi $3
bltz $3, TAG11
TAG11:
sb $3, 0($3)
beq $3, $3, TAG12
sb $3, 0($3)
sb $3, 0($3)
TAG12:
ori $2, $3, 9
mthi $3
mtlo $2
lbu $2, 0($2)
TAG13:
sb $2, 0($2)
mthi $2
multu $2, $2
mfhi $1
TAG14:
lui $1, 5
sll $0, $0, 0
div $1, $1
ori $3, $1, 10
TAG15:
blez $3, TAG16
mthi $3
sll $0, $0, 0
sll $0, $0, 0
TAG16:
bltz $3, TAG17
mthi $3
mthi $3
sll $0, $0, 0
TAG17:
lui $4, 13
mult $3, $4
sll $0, $0, 0
lui $1, 6
TAG18:
mfhi $4
xori $4, $1, 9
bne $1, $1, TAG19
sll $0, $0, 0
TAG19:
bltz $4, TAG20
sll $0, $0, 0
sll $0, $0, 0
beq $4, $4, TAG20
TAG20:
sll $0, $0, 0
blez $3, TAG21
mtlo $3
lui $3, 15
TAG21:
mfhi $3
srl $3, $3, 11
lw $4, 0($3)
mflo $2
TAG22:
sll $0, $0, 0
srlv $1, $2, $2
lui $1, 6
sll $0, $0, 0
TAG23:
blez $1, TAG24
addiu $4, $1, 4
mflo $1
multu $1, $1
TAG24:
addu $4, $1, $1
sll $3, $4, 4
div $1, $4
div $1, $1
TAG25:
srl $3, $3, 1
sll $0, $0, 0
bgez $3, TAG26
mflo $2
TAG26:
bltz $2, TAG27
lb $1, 0($2)
sll $3, $2, 15
mthi $2
TAG27:
mflo $3
div $3, $3
srl $1, $3, 7
lbu $2, 0($3)
TAG28:
mtlo $2
lui $4, 15
blez $4, TAG29
mtlo $2
TAG29:
sll $0, $0, 0
mthi $1
mult $1, $1
sltu $2, $4, $4
TAG30:
mthi $2
bgez $2, TAG31
sh $2, 0($2)
lb $2, 0($2)
TAG31:
lh $1, 0($2)
mthi $1
sh $2, 0($1)
bgtz $2, TAG32
TAG32:
mtlo $1
beq $1, $1, TAG33
multu $1, $1
nor $3, $1, $1
TAG33:
sb $3, 0($3)
mtlo $3
mthi $3
bne $3, $3, TAG34
TAG34:
nor $2, $3, $3
addiu $3, $2, 1
multu $3, $3
mfhi $3
TAG35:
sh $3, 2($3)
blez $3, TAG36
xori $1, $3, 14
bgez $1, TAG36
TAG36:
addiu $2, $1, 11
mthi $1
lhu $3, 5($2)
bgtz $3, TAG37
TAG37:
mthi $3
sll $0, $0, 0
sll $0, $0, 0
beq $3, $3, TAG38
TAG38:
mflo $3
mthi $3
andi $2, $3, 0
mflo $2
TAG39:
blez $2, TAG40
mthi $2
lbu $3, 0($2)
lb $3, 0($2)
TAG40:
xori $2, $3, 10
slti $4, $3, 2
bgtz $2, TAG41
lui $3, 1
TAG41:
lui $1, 4
multu $3, $1
mtlo $1
xor $2, $3, $3
TAG42:
lui $3, 5
sll $0, $0, 0
lui $3, 10
divu $3, $3
TAG43:
srav $1, $3, $3
sll $0, $0, 0
sll $0, $0, 0
xor $2, $3, $3
TAG44:
lui $3, 4
mult $3, $2
lb $2, 0($2)
ori $1, $3, 3
TAG45:
addiu $2, $1, 1
divu $1, $2
divu $1, $2
srav $3, $1, $1
TAG46:
mthi $3
bne $3, $3, TAG47
sll $0, $0, 0
bne $3, $3, TAG47
TAG47:
mflo $2
lui $4, 8
xori $3, $4, 11
beq $3, $3, TAG48
TAG48:
lui $1, 0
srlv $4, $3, $3
mfhi $4
slt $3, $4, $4
TAG49:
mult $3, $3
mthi $3
bltz $3, TAG50
sw $3, 0($3)
TAG50:
lui $3, 4
xori $4, $3, 1
mult $3, $3
mflo $4
TAG51:
xori $2, $4, 15
bgez $4, TAG52
slti $3, $4, 5
lui $4, 6
TAG52:
multu $4, $4
bne $4, $4, TAG53
mflo $3
ori $1, $4, 1
TAG53:
sll $2, $1, 0
lui $3, 15
lui $4, 5
addu $1, $1, $4
TAG54:
slti $4, $1, 14
bltz $1, TAG55
mthi $1
bgtz $4, TAG55
TAG55:
mult $4, $4
multu $4, $4
bne $4, $4, TAG56
lh $2, 0($4)
TAG56:
beq $2, $2, TAG57
lb $1, 0($2)
beq $2, $1, TAG57
mtlo $1
TAG57:
mflo $2
blez $1, TAG58
mfhi $1
xori $3, $1, 5
TAG58:
mtlo $3
sll $0, $0, 0
multu $3, $4
mflo $1
TAG59:
lui $3, 13
mtlo $3
ori $3, $3, 4
add $4, $1, $1
TAG60:
sw $4, 0($4)
mult $4, $4
beq $4, $4, TAG61
srlv $3, $4, $4
TAG61:
multu $3, $3
bltz $3, TAG62
sb $3, 0($3)
beq $3, $3, TAG62
TAG62:
lui $4, 15
sll $0, $0, 0
srl $4, $3, 13
bne $1, $1, TAG63
TAG63:
mtlo $4
mtlo $4
sb $4, 0($4)
lui $1, 14
TAG64:
addu $3, $1, $1
bne $3, $1, TAG65
sll $0, $0, 0
mfhi $1
TAG65:
sll $0, $0, 0
multu $1, $1
addiu $2, $1, 13
sll $0, $0, 0
TAG66:
lui $1, 9
divu $1, $2
xori $3, $1, 1
mult $3, $1
TAG67:
bgtz $3, TAG68
sll $0, $0, 0
lw $4, 0($3)
lbu $1, 0($3)
TAG68:
beq $1, $1, TAG69
sll $0, $0, 0
sra $2, $1, 14
slti $2, $1, 10
TAG69:
mflo $2
sll $0, $0, 0
multu $1, $1
lui $1, 4
TAG70:
mtlo $1
sll $0, $0, 0
ori $3, $1, 2
lui $1, 9
TAG71:
mfhi $1
addiu $3, $1, 2
mult $1, $1
lui $2, 10
TAG72:
lui $2, 3
sll $0, $0, 0
blez $2, TAG73
sll $0, $0, 0
TAG73:
mthi $2
mthi $2
addu $4, $2, $2
mthi $4
TAG74:
mtlo $4
sll $0, $0, 0
sll $0, $0, 0
lui $1, 4
TAG75:
bne $1, $1, TAG76
and $1, $1, $1
bltz $1, TAG76
lui $2, 0
TAG76:
lw $4, 0($2)
multu $2, $4
mflo $1
addu $1, $4, $1
TAG77:
bgtz $1, TAG78
sltiu $1, $1, 8
bltz $1, TAG78
sb $1, 0($1)
TAG78:
sb $1, 0($1)
addu $3, $1, $1
or $1, $3, $1
div $3, $3
TAG79:
lb $1, 0($1)
multu $1, $1
mfhi $1
mfhi $4
TAG80:
lui $1, 15
beq $1, $4, TAG81
mult $4, $4
add $2, $4, $1
TAG81:
sll $0, $0, 0
sll $0, $0, 0
bgtz $2, TAG82
multu $1, $2
TAG82:
mult $1, $1
srlv $1, $1, $1
mtlo $1
sll $0, $0, 0
TAG83:
multu $1, $1
ori $2, $1, 10
sll $0, $0, 0
divu $2, $1
TAG84:
div $2, $2
mflo $1
bne $2, $2, TAG85
sb $1, 0($1)
TAG85:
mfhi $4
divu $1, $1
mult $4, $4
mfhi $4
TAG86:
mult $4, $4
multu $4, $4
beq $4, $4, TAG87
mflo $4
TAG87:
sra $3, $4, 5
or $3, $4, $3
beq $3, $3, TAG88
addiu $3, $3, 12
TAG88:
mflo $2
lui $1, 3
mflo $4
divu $3, $1
TAG89:
bne $4, $4, TAG90
mflo $3
sb $3, 0($4)
bgez $3, TAG90
TAG90:
lw $1, 0($3)
bltz $1, TAG91
sh $3, 0($3)
sw $3, -256($1)
TAG91:
sh $1, -256($1)
div $1, $1
mult $1, $1
sra $2, $1, 7
TAG92:
lb $1, 0($2)
lb $4, 0($2)
lbu $3, 0($4)
multu $2, $2
TAG93:
mtlo $3
beq $3, $3, TAG94
multu $3, $3
beq $3, $3, TAG94
TAG94:
lhu $3, 0($3)
mthi $3
xor $4, $3, $3
mthi $4
TAG95:
mthi $4
mthi $4
sra $4, $4, 15
lbu $3, 0($4)
TAG96:
sh $3, 0($3)
beq $3, $3, TAG97
lui $2, 7
lb $2, 0($3)
TAG97:
blez $2, TAG98
sll $0, $0, 0
mflo $4
lui $2, 2
TAG98:
lui $1, 3
sll $0, $0, 0
div $2, $1
bne $2, $2, TAG99
TAG99:
mult $1, $1
mthi $1
mthi $1
lui $2, 12
TAG100:
beq $2, $2, TAG101
sltiu $4, $2, 0
subu $4, $4, $4
lui $2, 12
TAG101:
andi $3, $2, 5
lui $1, 4
sll $0, $0, 0
beq $3, $1, TAG102
TAG102:
andi $1, $2, 5
bgez $2, TAG103
addu $4, $2, $2
blez $2, TAG103
TAG103:
mult $4, $4
bgtz $4, TAG104
sll $0, $0, 0
srav $2, $4, $4
TAG104:
srl $2, $2, 2
sltiu $4, $2, 1
sll $0, $0, 0
sllv $2, $2, $2
TAG105:
sll $0, $0, 0
sllv $4, $2, $1
bne $1, $1, TAG106
mflo $1
TAG106:
bne $1, $1, TAG107
and $2, $1, $1
lhu $2, 0($2)
lui $1, 6
TAG107:
sll $0, $0, 0
mthi $4
lui $4, 5
bne $1, $1, TAG108
TAG108:
divu $4, $4
sll $1, $4, 10
sll $0, $0, 0
subu $2, $1, $1
TAG109:
ori $3, $2, 1
lbu $1, 0($3)
multu $2, $1
mult $1, $1
TAG110:
lui $1, 5
sltiu $2, $1, 0
nor $3, $1, $2
bltz $1, TAG111
TAG111:
addiu $1, $3, 15
sll $0, $0, 0
mfhi $1
beq $1, $1, TAG112
TAG112:
mflo $2
addi $4, $2, 10
slti $1, $4, 11
bgtz $2, TAG113
TAG113:
sb $1, 0($1)
sb $1, 0($1)
lb $3, 0($1)
bltz $1, TAG114
TAG114:
subu $1, $3, $3
sltiu $2, $3, 6
lui $2, 10
bne $2, $1, TAG115
TAG115:
multu $2, $2
lui $3, 7
mult $2, $3
mflo $3
TAG116:
mthi $3
lbu $4, 0($3)
add $2, $3, $4
subu $1, $4, $4
TAG117:
sw $1, 0($1)
blez $1, TAG118
lhu $1, 0($1)
mfhi $4
TAG118:
sll $1, $4, 1
mthi $1
addiu $2, $4, 0
add $4, $4, $2
TAG119:
mthi $4
mtlo $4
mflo $3
sb $4, 0($4)
TAG120:
beq $3, $3, TAG121
mtlo $3
bltz $3, TAG121
mthi $3
TAG121:
mflo $2
lbu $4, 0($2)
multu $3, $4
multu $3, $4
TAG122:
lbu $2, 0($4)
mult $2, $4
bgez $4, TAG123
mult $2, $2
TAG123:
multu $2, $2
mtlo $2
mtlo $2
slt $1, $2, $2
TAG124:
lui $1, 14
blez $1, TAG125
addu $3, $1, $1
mfhi $4
TAG125:
lui $3, 9
bgtz $4, TAG126
sltiu $2, $4, 8
multu $3, $2
TAG126:
mthi $2
lbu $1, 0($2)
mflo $1
bne $1, $1, TAG127
TAG127:
mthi $1
mult $1, $1
multu $1, $1
bgtz $1, TAG128
TAG128:
sll $0, $0, 0
lui $4, 4
blez $3, TAG129
lui $3, 6
TAG129:
bne $3, $3, TAG130
multu $3, $3
bltz $3, TAG130
sll $0, $0, 0
TAG130:
sll $0, $0, 0
mthi $3
slt $2, $4, $4
subu $1, $2, $3
TAG131:
sll $0, $0, 0
mthi $2
sll $0, $0, 0
sll $0, $0, 0
TAG132:
sll $0, $0, 0
srav $1, $1, $1
xori $1, $1, 7
sll $0, $0, 0
TAG133:
lui $1, 8
xori $4, $1, 3
andi $2, $1, 0
lui $2, 1
TAG134:
mult $2, $2
mult $2, $2
bne $2, $2, TAG135
mtlo $2
TAG135:
beq $2, $2, TAG136
addiu $2, $2, 14
sltiu $2, $2, 14
divu $2, $2
TAG136:
bne $2, $2, TAG137
lui $1, 0
add $3, $1, $1
multu $1, $3
TAG137:
mthi $3
mthi $3
addiu $2, $3, 0
sw $3, 0($3)
TAG138:
beq $2, $2, TAG139
mfhi $3
multu $2, $2
bgez $2, TAG139
TAG139:
lui $1, 9
bgez $1, TAG140
ori $1, $1, 13
lui $4, 5
TAG140:
sll $0, $0, 0
mtlo $4
bltz $4, TAG141
mtlo $4
TAG141:
mflo $3
mtlo $4
slti $1, $3, 1
blez $1, TAG142
TAG142:
sh $1, 0($1)
multu $1, $1
mult $1, $1
sltu $2, $1, $1
TAG143:
bgez $2, TAG144
lbu $1, 0($2)
mult $1, $2
mfhi $1
TAG144:
sh $1, 0($1)
multu $1, $1
beq $1, $1, TAG145
mtlo $1
TAG145:
mfhi $4
bltz $1, TAG146
lb $4, 0($1)
lui $3, 0
TAG146:
srav $1, $3, $3
sltiu $4, $3, 5
and $1, $3, $3
srlv $2, $1, $1
TAG147:
mflo $4
lbu $4, 0($4)
bne $4, $2, TAG148
mfhi $4
TAG148:
multu $4, $4
ori $1, $4, 10
bne $1, $4, TAG149
srlv $2, $4, $1
TAG149:
bltz $2, TAG150
lhu $2, 0($2)
blez $2, TAG150
sh $2, 0($2)
TAG150:
srl $1, $2, 4
beq $1, $2, TAG151
mflo $2
bltz $1, TAG151
TAG151:
sh $2, 0($2)
lui $3, 6
sll $0, $0, 0
sub $1, $2, $2
TAG152:
sw $1, 0($1)
bne $1, $1, TAG153
mthi $1
beq $1, $1, TAG153
TAG153:
mult $1, $1
beq $1, $1, TAG154
sltiu $1, $1, 14
mtlo $1
TAG154:
multu $1, $1
sb $1, 0($1)
slti $3, $1, 2
multu $3, $1
TAG155:
sb $3, 0($3)
sra $4, $3, 3
mthi $4
xor $1, $4, $4
TAG156:
bne $1, $1, TAG157
lw $2, 0($1)
slti $4, $2, 8
multu $4, $1
TAG157:
addiu $4, $4, 5
bltz $4, TAG158
or $1, $4, $4
xori $3, $4, 5
TAG158:
mult $3, $3
blez $3, TAG159
mfhi $4
lh $3, 0($3)
TAG159:
lbu $3, 0($3)
mthi $3
sb $3, 0($3)
mult $3, $3
TAG160:
mult $3, $3
beq $3, $3, TAG161
xori $3, $3, 0
sltiu $2, $3, 2
TAG161:
beq $2, $2, TAG162
ori $3, $2, 4
sra $4, $3, 6
mtlo $4
TAG162:
mflo $3
lui $2, 12
mult $2, $2
blez $4, TAG163
TAG163:
slt $3, $2, $2
mflo $3
mtlo $3
sll $0, $0, 0
TAG164:
mthi $3
add $3, $3, $3
mflo $3
lw $4, 0($3)
TAG165:
sb $4, -256($4)
mflo $2
mthi $4
xori $2, $4, 4
TAG166:
sll $0, $0, 0
sll $2, $2, 7
mthi $2
mthi $2
TAG167:
sll $0, $0, 0
and $1, $2, $2
sltiu $1, $1, 1
sll $0, $0, 0
TAG168:
sllv $4, $2, $2
bltz $4, TAG169
mflo $1
mflo $1
TAG169:
lui $3, 6
lbu $1, 0($1)
lbu $3, 0($1)
lui $4, 10
TAG170:
mtlo $4
nor $4, $4, $4
mult $4, $4
lui $4, 9
TAG171:
addu $1, $4, $4
mfhi $1
sw $1, 0($1)
mflo $4
TAG172:
xori $4, $4, 9
sltiu $2, $4, 9
addiu $1, $4, 4
mtlo $2
TAG173:
sll $0, $0, 0
sll $0, $0, 0
sll $0, $0, 0
slt $1, $1, $1
TAG174:
slti $3, $1, 0
andi $3, $3, 14
lw $4, 0($3)
sw $3, -256($4)
TAG175:
blez $4, TAG176
andi $4, $4, 15
addi $3, $4, 8
bgez $4, TAG176
TAG176:
mult $3, $3
lw $1, 0($3)
multu $3, $1
lbu $2, 0($3)
TAG177:
blez $2, TAG178
mfhi $1
multu $2, $1
div $2, $2
TAG178:
bgez $1, TAG179
multu $1, $1
sub $4, $1, $1
mthi $4
TAG179:
mflo $3
lb $3, 0($4)
mthi $3
multu $3, $3
TAG180:
add $1, $3, $3
lhu $3, 0($1)
sw $3, 0($3)
lui $4, 4
TAG181:
sll $0, $0, 0
lui $3, 13
nor $4, $3, $4
mtlo $4
TAG182:
blez $4, TAG183
mflo $1
bgez $4, TAG183
sltu $1, $1, $4
TAG183:
mflo $2
xori $2, $2, 10
sll $0, $0, 0
divu $1, $1
TAG184:
multu $2, $2
beq $2, $2, TAG185
andi $3, $2, 4
sub $2, $3, $2
TAG185:
sll $0, $0, 0
blez $2, TAG186
mthi $1
bgez $1, TAG186
TAG186:
sll $0, $0, 0
mult $1, $1
sll $0, $0, 0
sll $0, $0, 0
TAG187:
lh $3, 0($3)
srav $3, $3, $3
bne $3, $3, TAG188
addi $3, $3, 4
TAG188:
sb $3, 0($3)
sltiu $4, $3, 5
mtlo $4
slti $2, $4, 5
TAG189:
mult $2, $2
srl $4, $2, 3
mtlo $2
beq $4, $4, TAG190
TAG190:
lui $2, 5
bgez $2, TAG191
mflo $2
bgtz $2, TAG191
TAG191:
and $4, $2, $2
lbu $2, 0($4)
sb $2, 0($2)
sra $4, $4, 13
TAG192:
mtlo $4
addiu $1, $4, 11
lh $4, 0($4)
lui $1, 5
TAG193:
bne $1, $1, TAG194
multu $1, $1
addiu $4, $1, 5
sll $0, $0, 0
TAG194:
sll $2, $4, 4
lui $1, 1
sll $0, $0, 0
mflo $3
TAG195:
lui $4, 9
sll $0, $0, 0
sltiu $3, $3, 11
mthi $4
TAG196:
blez $3, TAG197
mfhi $3
bne $3, $3, TAG197
mthi $3
TAG197:
mtlo $3
bgtz $3, TAG198
mthi $3
mthi $3
TAG198:
lui $4, 3
blez $3, TAG199
sra $1, $3, 13
mthi $4
TAG199:
addu $2, $1, $1
divu $2, $2
sh $1, 0($1)
mfhi $1
TAG200:
bne $1, $1, TAG201
mfhi $4
bltz $4, TAG201
mflo $3
TAG201:
lb $2, 0($3)
bne $3, $2, TAG202
divu $3, $3
sh $2, 0($2)
TAG202:
beq $2, $2, TAG203
mfhi $2
beq $2, $2, TAG203
sh $2, 0($2)
TAG203:
sh $2, 0($2)
sh $2, 0($2)
sh $2, 0($2)
add $3, $2, $2
TAG204:
srlv $3, $3, $3
blez $3, TAG205
xori $3, $3, 11
addiu $2, $3, 7
TAG205:
lui $3, 1
sll $0, $0, 0
lui $2, 15
subu $2, $2, $1
TAG206:
lui $1, 12
mthi $2
mtlo $1
subu $2, $2, $2
TAG207:
bne $2, $2, TAG208
lui $2, 1
xori $2, $2, 5
sllv $2, $2, $2
TAG208:
mfhi $1
sltu $1, $1, $2
subu $1, $2, $1
sll $0, $0, 0
TAG209:
sltiu $1, $4, 9
mfhi $3
mfhi $4
sll $0, $0, 0
TAG210:
mthi $4
lui $3, 1
or $1, $4, $3
lui $4, 13
TAG211:
sll $0, $0, 0
sll $0, $0, 0
multu $1, $4
beq $4, $1, TAG212
TAG212:
sltiu $3, $1, 9
lui $2, 9
bgtz $1, TAG213
addiu $4, $1, 15
TAG213:
addiu $3, $4, 3
sll $0, $0, 0
andi $1, $2, 9
sll $0, $0, 0
TAG214:
mult $1, $1
mult $1, $1
sllv $4, $1, $1
sh $1, 0($1)
TAG215:
lw $3, 0($4)
beq $3, $3, TAG216
lhu $1, 0($4)
mult $1, $3
TAG216:
multu $1, $1
lh $1, 0($1)
slt $1, $1, $1
mflo $4
TAG217:
xor $2, $4, $4
multu $4, $4
sb $2, 0($4)
beq $4, $2, TAG218
TAG218:
sb $2, 0($2)
bne $2, $2, TAG219
mtlo $2
sb $2, 0($2)
TAG219:
sw $2, 0($2)
sw $2, 0($2)
mult $2, $2
subu $4, $2, $2
TAG220:
bne $4, $4, TAG221
lui $3, 2
mtlo $3
andi $2, $4, 6
TAG221:
blez $2, TAG222
lui $3, 5
bne $3, $2, TAG222
addi $2, $3, 9
TAG222:
sw $2, 0($2)
sh $2, 0($2)
slti $4, $2, 7
xori $4, $2, 0
TAG223:
mult $4, $4
lui $2, 12
sll $0, $0, 0
bne $2, $4, TAG224
TAG224:
lui $3, 8
sll $0, $0, 0
beq $2, $3, TAG225
sll $0, $0, 0
TAG225:
divu $3, $3
sll $0, $0, 0
lui $4, 3
blez $1, TAG226
TAG226:
sll $0, $0, 0
srl $2, $4, 4
lhu $4, -12288($2)
bne $4, $4, TAG227
TAG227:
lui $4, 8
bne $4, $4, TAG228
sll $0, $0, 0
lui $2, 10
TAG228:
lui $1, 9
sll $0, $0, 0
bne $2, $2, TAG229
mtlo $2
TAG229:
sll $0, $0, 0
sll $2, $2, 13
xori $3, $1, 5
lui $3, 8
TAG230:
srav $1, $3, $3
bne $1, $1, TAG231
mfhi $3
mtlo $3
TAG231:
blez $3, TAG232
sh $3, 0($3)
bltz $3, TAG232
lhu $4, 0($3)
TAG232:
divu $4, $4
divu $4, $4
blez $4, TAG233
addiu $3, $4, 14
TAG233:
sll $4, $3, 15
sll $0, $0, 0
bne $3, $2, TAG234
mflo $1
TAG234:
lui $2, 0
bne $2, $2, TAG235
mfhi $4
mfhi $1
TAG235:
bltz $1, TAG236
sb $1, 0($1)
addiu $4, $1, 4
bgez $4, TAG236
TAG236:
sllv $4, $4, $4
lb $3, 0($4)
multu $4, $3
div $4, $4
TAG237:
lhu $3, 0($3)
addiu $1, $3, 3
lui $1, 4
mfhi $4
TAG238:
mtlo $4
lui $4, 0
bgtz $4, TAG239
lui $2, 7
TAG239:
lui $2, 5
subu $1, $2, $2
srlv $1, $2, $2
mfhi $4
TAG240:
sh $4, 0($4)
addi $4, $4, 11
lui $3, 4
sll $0, $0, 0
TAG241:
srav $1, $3, $3
sll $0, $0, 0
lui $3, 3
mult $3, $1
TAG242:
lui $2, 14
and $1, $3, $2
beq $1, $2, TAG243
mfhi $2
TAG243:
bgtz $2, TAG244
mthi $2
lui $4, 11
mtlo $2
TAG244:
mthi $4
or $3, $4, $4
lb $2, 0($3)
mthi $4
TAG245:
multu $2, $2
beq $2, $2, TAG246
lb $2, 0($2)
ori $2, $2, 5
TAG246:
mtlo $2
addiu $2, $2, 14
bgtz $2, TAG247
mthi $2
TAG247:
addu $4, $2, $2
mflo $2
mthi $2
beq $2, $2, TAG248
TAG248:
sh $2, 0($2)
bne $2, $2, TAG249
sra $1, $2, 3
sltu $2, $1, $2
TAG249:
mthi $2
slti $3, $2, 14
sh $2, 0($2)
beq $3, $3, TAG250
TAG250:
or $3, $3, $3
div $3, $3
bne $3, $3, TAG251
mflo $1
TAG251:
addiu $2, $1, 6
bne $2, $2, TAG252
mthi $2
slt $4, $1, $1
TAG252:
mfhi $2
ori $4, $2, 13
mtlo $2
blez $4, TAG253
TAG253:
srlv $1, $4, $4
mfhi $4
sltiu $3, $4, 3
multu $3, $4
TAG254:
mthi $3
add $2, $3, $3
bne $3, $2, TAG255
multu $2, $3
TAG255:
mfhi $4
nor $2, $4, $4
nor $3, $2, $4
multu $2, $3
TAG256:
bgez $3, TAG257
srav $2, $3, $3
bgez $2, TAG257
lhu $1, 0($3)
TAG257:
srav $2, $1, $1
addu $1, $1, $2
lh $4, 0($1)
xori $4, $1, 8
TAG258:
mult $4, $4
divu $4, $4
slti $2, $4, 6
sw $2, 0($2)
TAG259:
multu $2, $2
mfhi $1
bltz $1, TAG260
mtlo $2
TAG260:
lhu $2, 0($1)
bne $2, $2, TAG261
srav $3, $2, $2
sltu $4, $2, $3
TAG261:
beq $4, $4, TAG262
mult $4, $4
slt $1, $4, $4
multu $1, $4
TAG262:
sb $1, 0($1)
xor $4, $1, $1
andi $1, $1, 12
bne $1, $1, TAG263
TAG263:
lw $3, 0($1)
mthi $3
srav $2, $1, $1
lui $4, 2
TAG264:
srl $3, $4, 1
mult $3, $3
lui $3, 15
srl $2, $4, 7
TAG265:
bne $2, $2, TAG266
sw $2, -1024($2)
mult $2, $2
bgez $2, TAG266
TAG266:
ori $2, $2, 9
lui $2, 9
sll $0, $0, 0
sll $0, $0, 0
TAG267:
bgtz $2, TAG268
mflo $4
srlv $4, $2, $4
lui $3, 11
TAG268:
sll $0, $0, 0
mtlo $3
mflo $3
blez $3, TAG269
TAG269:
addu $1, $3, $3
mflo $4
mthi $1
mult $3, $4
TAG270:
mfhi $3
lui $2, 2
multu $3, $2
lui $3, 0
TAG271:
bltz $3, TAG272
lui $4, 13
bgez $4, TAG272
lui $2, 9
TAG272:
sll $4, $2, 7
divu $4, $2
xor $3, $2, $2
sll $3, $2, 14
TAG273:
sll $0, $0, 0
bne $3, $3, TAG274
addiu $2, $3, 7
mtlo $3
TAG274:
sll $0, $0, 0
lui $3, 4
mfhi $1
sll $0, $0, 0
TAG275:
sb $1, 0($1)
mflo $4
srl $2, $1, 0
mtlo $4
TAG276:
bgtz $2, TAG277
mult $2, $2
and $2, $2, $2
xori $3, $2, 6
TAG277:
srl $1, $3, 3
mfhi $4
mfhi $4
sh $1, 0($3)
TAG278:
sw $4, 0($4)
beq $4, $4, TAG279
lui $4, 2
sb $4, 0($4)
TAG279:
mthi $4
mfhi $4
addiu $1, $4, 12
slt $4, $4, $4
TAG280:
blez $4, TAG281
lb $3, 0($4)
ori $3, $4, 15
srlv $2, $3, $4
TAG281:
beq $2, $2, TAG282
mflo $4
srlv $4, $4, $4
mflo $3
TAG282:
mtlo $3
lw $1, 0($3)
srl $4, $3, 15
lui $3, 6
TAG283:
sll $4, $3, 11
lui $4, 11
sll $0, $0, 0
mfhi $2
TAG284:
sllv $3, $2, $2
sltiu $4, $2, 2
bltz $4, TAG285
lui $2, 9
TAG285:
sll $0, $0, 0
addiu $4, $2, 13
sll $0, $0, 0
lui $2, 10
TAG286:
mfhi $4
lui $4, 8
mult $4, $2
addiu $1, $2, 11
TAG287:
divu $1, $1
mfhi $4
mtlo $4
bne $1, $4, TAG288
TAG288:
lui $1, 7
sra $1, $1, 13
lui $1, 4
mfhi $1
TAG289:
lui $1, 13
srav $4, $1, $1
sll $0, $0, 0
mtlo $1
TAG290:
sll $0, $0, 0
srav $3, $4, $4
sll $0, $0, 0
lui $1, 10
TAG291:
bne $1, $1, TAG292
mflo $2
mthi $2
mult $1, $1
TAG292:
mthi $2
bltz $2, TAG293
sll $0, $0, 0
sra $3, $2, 7
TAG293:
sll $0, $0, 0
bgtz $1, TAG294
sll $0, $0, 0
or $1, $1, $4
TAG294:
sll $0, $0, 0
slt $1, $1, $1
sh $1, 0($1)
bgtz $1, TAG295
TAG295:
mult $1, $1
lui $1, 4
sll $0, $0, 0
sll $0, $0, 0
TAG296:
slti $4, $1, 6
mflo $4
beq $4, $4, TAG297
mthi $1
TAG297:
lw $4, 0($4)
lbu $3, 0($4)
lui $4, 9
xori $1, $4, 0
TAG298:
bgez $1, TAG299
sll $0, $0, 0
beq $4, $4, TAG299
multu $1, $4
TAG299:
div $4, $4
bgez $4, TAG300
addiu $1, $4, 8
beq $4, $1, TAG300
TAG300:
mult $1, $1
bgtz $1, TAG301
mtlo $1
bne $1, $1, TAG301
TAG301:
mflo $3
sll $0, $0, 0
mflo $2
and $3, $2, $3
TAG302:
sll $0, $0, 0
sra $3, $4, 1
sll $4, $4, 5
sll $0, $0, 0
TAG303:
mtlo $1
divu $1, $1
beq $1, $1, TAG304
sll $0, $0, 0
TAG304:
lui $3, 8
lui $3, 7
divu $3, $3
addu $3, $3, $3
TAG305:
xor $3, $3, $3
or $3, $3, $3
lui $3, 5
blez $3, TAG306
TAG306:
mfhi $1
mflo $2
and $3, $3, $3
bltz $2, TAG307
TAG307:
lui $2, 2
sll $0, $0, 0
lui $2, 8
mult $3, $3
TAG308:
mfhi $3
lb $3, 0($3)
blez $3, TAG309
lui $2, 4
TAG309:
mfhi $1
div $2, $2
mult $1, $2
lui $1, 9
TAG310:
mfhi $4
mtlo $1
blez $4, TAG311
subu $2, $4, $1
TAG311:
lui $2, 12
sra $2, $2, 15
lhu $4, 0($2)
sltiu $4, $4, 15
TAG312:
lb $4, 0($4)
mthi $4
sh $4, 0($4)
bgtz $4, TAG313
TAG313:
xori $4, $4, 2
bgtz $4, TAG314
mfhi $3
sb $4, 0($4)
TAG314:
lui $4, 7
bgez $3, TAG315
andi $4, $4, 9
blez $3, TAG315
TAG315:
mflo $3
ori $2, $3, 14
mult $2, $4
sll $0, $0, 0
TAG316:
mflo $2
lui $1, 15
lhu $3, 0($2)
mult $1, $2
TAG317:
srl $3, $3, 15
sb $3, 0($3)
multu $3, $3
mtlo $3
TAG318:
mthi $3
mfhi $3
lh $1, 0($3)
andi $1, $3, 13
TAG319:
mfhi $3
lb $4, 0($1)
mtlo $1
slti $2, $3, 2
TAG320:
addu $3, $2, $2
ori $3, $2, 13
mfhi $3
bgtz $3, TAG321
TAG321:
mult $3, $3
lb $4, 0($3)
bne $4, $4, TAG322
addiu $3, $4, 4
TAG322:
mfhi $4
sh $4, 0($4)
lui $3, 10
lui $2, 9
TAG323:
mult $2, $2
mflo $2
bne $2, $2, TAG324
sh $2, 0($2)
TAG324:
lui $2, 6
slt $2, $2, $2
lhu $1, 0($2)
sllv $2, $2, $2
TAG325:
lbu $4, 0($2)
blez $2, TAG326
sh $4, 0($4)
bne $2, $2, TAG326
TAG326:
mflo $2
lui $1, 13
multu $2, $4
mtlo $1
TAG327:
mfhi $3
blez $3, TAG328
mtlo $1
lui $4, 4
TAG328:
mflo $1
sw $1, 0($4)
sb $1, 0($4)
lui $4, 4
TAG329:
lui $2, 8
beq $2, $4, TAG330
mtlo $4
mfhi $3
TAG330:
and $4, $3, $3
mult $3, $3
beq $4, $3, TAG331
mult $3, $3
TAG331:
mtlo $4
bgtz $4, TAG332
srl $4, $4, 4
mthi $4
TAG332:
bne $4, $4, TAG333
sh $4, 0($4)
lb $1, 0($4)
xori $2, $4, 15
TAG333:
bne $2, $2, TAG334
lui $4, 0
mthi $4
blez $4, TAG334
TAG334:
sub $2, $4, $4
lhu $3, 0($4)
sw $2, 0($3)
mult $3, $2
TAG335:
mtlo $3
mflo $1
mfhi $4
mthi $4
TAG336:
lw $2, 0($4)
mflo $3
beq $3, $4, TAG337
mthi $4
TAG337:
sb $3, 0($3)
addi $1, $3, 10
lbu $2, 0($1)
ori $1, $3, 6
TAG338:
lui $3, 8
mult $1, $3
blez $3, TAG339
lui $3, 1
TAG339:
blez $3, TAG340
mflo $4
sll $0, $0, 0
mfhi $3
TAG340:
slti $1, $3, 6
bgez $1, TAG341
mtlo $3
addi $4, $3, 7
TAG341:
bgez $4, TAG342
slti $1, $4, 2
mflo $3
addiu $3, $1, 0
TAG342:
beq $3, $3, TAG343
multu $3, $3
lui $4, 4
mthi $4
TAG343:
bne $4, $4, TAG344
mtlo $4
beq $4, $4, TAG344
lui $3, 4
TAG344:
divu $3, $3
xori $3, $3, 6
beq $3, $3, TAG345
sll $0, $0, 0
TAG345:
mult $3, $3
lui $1, 4
bne $1, $1, TAG346
mult $1, $1
TAG346:
mthi $1
mthi $1
sll $3, $1, 8
addiu $2, $3, 12
TAG347:
sll $0, $0, 0
mult $2, $2
sll $0, $0, 0
multu $2, $2
TAG348:
srlv $3, $2, $2
blez $3, TAG349
sll $0, $0, 0
sll $0, $0, 0
TAG349:
or $1, $3, $3
xor $1, $1, $1
mtlo $3
bgtz $1, TAG350
TAG350:
multu $1, $1
bgtz $1, TAG351
lui $1, 14
multu $1, $1
TAG351:
lui $1, 4
sltu $2, $1, $1
bltz $1, TAG352
subu $2, $1, $1
TAG352:
lui $4, 2
multu $4, $2
mfhi $2
blez $2, TAG353
TAG353:
mult $2, $2
blez $2, TAG354
lui $3, 13
ori $3, $3, 0
TAG354:
lui $1, 15
subu $1, $3, $3
multu $1, $1
sb $3, 0($1)
TAG355:
lbu $2, 0($1)
lbu $2, 0($1)
lui $1, 12
lui $2, 10
TAG356:
mfhi $4
mtlo $2
blez $2, TAG357
sll $0, $0, 0
TAG357:
mflo $4
multu $4, $1
mthi $1
mtlo $1
TAG358:
sll $0, $0, 0
divu $4, $4
addu $3, $4, $4
sll $0, $0, 0
TAG359:
beq $3, $3, TAG360
sll $0, $0, 0
sb $3, 0($3)
addi $2, $3, 15
TAG360:
sll $0, $0, 0
bne $2, $2, TAG361
multu $2, $2
bgtz $2, TAG361
TAG361:
sll $0, $0, 0
sra $2, $2, 3
mflo $1
sltiu $2, $1, 6
TAG362:
mflo $1
beq $2, $2, TAG363
sb $2, 0($2)
blez $2, TAG363
TAG363:
lh $1, 0($1)
addiu $4, $1, 9
bgez $1, TAG364
addiu $4, $1, 1
TAG364:
blez $4, TAG365
mfhi $4
mthi $4
lui $3, 10
TAG365:
sltiu $2, $3, 10
sw $3, 0($2)
ori $1, $2, 1
lui $1, 1
TAG366:
bne $1, $1, TAG367
addiu $2, $1, 8
mtlo $2
addu $4, $2, $2
TAG367:
beq $4, $4, TAG368
lui $2, 6
lui $2, 11
xor $3, $2, $2
TAG368:
blez $3, TAG369
sll $0, $0, 0
mflo $1
bgtz $3, TAG369
TAG369:
mult $1, $1
sll $0, $0, 0
slt $1, $2, $2
addiu $3, $1, 6
TAG370:
sltiu $2, $3, 7
lui $3, 6
mthi $3
lb $1, 0($2)
TAG371:
lh $4, 0($1)
nor $2, $1, $1
beq $2, $2, TAG372
multu $2, $2
TAG372:
mfhi $4
lhu $2, 1($2)
lh $3, 2($4)
lui $1, 2
TAG373:
mflo $4
bltz $4, TAG374
srav $2, $1, $4
sb $2, 0($4)
TAG374:
sll $0, $0, 0
srl $3, $2, 11
sll $0, $0, 0
divu $3, $2
TAG375:
mtlo $4
andi $1, $4, 9
sltiu $2, $4, 12
lbu $2, 0($2)
TAG376:
bne $2, $2, TAG377
sh $2, 0($2)
mult $2, $2
blez $2, TAG377
TAG377:
sra $4, $2, 2
bne $2, $4, TAG378
mtlo $2
blez $4, TAG378
TAG378:
mthi $4
lh $1, 0($4)
ori $1, $4, 0
sb $1, 0($1)
TAG379:
multu $1, $1
sw $1, 0($1)
mult $1, $1
mult $1, $1
TAG380:
mfhi $4
mfhi $1
mflo $1
sh $4, 0($4)
TAG381:
lbu $4, 0($1)
beq $4, $4, TAG382
lui $4, 6
lui $2, 7
TAG382:
lui $2, 6
mfhi $3
mtlo $2
lui $2, 3
TAG383:
srl $3, $2, 13
bgtz $2, TAG384
xor $4, $2, $3
mflo $3
TAG384:
mflo $3
mthi $3
lui $1, 3
sll $0, $0, 0
TAG385:
mthi $1
divu $1, $1
bgtz $1, TAG386
sra $1, $1, 12
TAG386:
bgtz $1, TAG387
mult $1, $1
bltz $1, TAG387
mflo $4
TAG387:
divu $4, $4
xor $2, $4, $4
lui $1, 14
lui $1, 15
TAG388:
sll $0, $0, 0
bgtz $1, TAG389
mult $1, $1
lb $1, 0($1)
TAG389:
lui $1, 11
beq $1, $1, TAG390
lui $1, 12
divu $1, $1
TAG390:
mtlo $1
ori $1, $1, 13
addiu $4, $1, 5
sll $0, $0, 0
TAG391:
divu $1, $1
addiu $4, $1, 12
bltz $1, TAG392
multu $1, $1
TAG392:
div $4, $4
mthi $4
bgez $4, TAG393
xor $1, $4, $4
TAG393:
mfhi $1
mflo $3
sll $0, $0, 0
lb $3, 0($3)
TAG394:
sb $3, 0($3)
sltu $3, $3, $3
multu $3, $3
mthi $3
TAG395:
mtlo $3
mtlo $3
mflo $1
nor $4, $3, $1
TAG396:
mfhi $1
mtlo $1
mult $4, $1
mfhi $2
TAG397:
sh $2, 0($2)
beq $2, $2, TAG398
mult $2, $2
addi $4, $2, 4
TAG398:
addiu $3, $4, 10
srav $1, $3, $4
beq $3, $1, TAG399
divu $1, $4
TAG399:
sllv $4, $1, $1
lw $2, 0($4)
sw $1, 0($4)
multu $4, $2
TAG400:
mult $2, $2
addu $4, $2, $2
mtlo $4
sltu $3, $4, $2
TAG401:
bne $3, $3, TAG402
sw $3, 0($3)
sb $3, 0($3)
or $4, $3, $3
TAG402:
srl $4, $4, 13
xori $2, $4, 6
lhu $3, 0($4)
lui $4, 4
TAG403:
and $3, $4, $4
sll $0, $0, 0
slti $2, $3, 15
bne $3, $3, TAG404
TAG404:
mflo $3
sw $2, 0($2)
addiu $4, $2, 0
sh $2, 0($3)
TAG405:
bgtz $4, TAG406
mthi $4
sb $4, 0($4)
mthi $4
TAG406:
mult $4, $4
mflo $3
mfhi $4
mthi $4
TAG407:
ori $4, $4, 14
mflo $3
xor $2, $4, $3
mtlo $2
TAG408:
lhu $1, 0($2)
addiu $2, $2, 15
div $2, $2
sb $1, 0($2)
TAG409:
mthi $2
lui $1, 6
lui $1, 1
bne $1, $1, TAG410
TAG410:
lui $1, 5
bltz $1, TAG411
lui $4, 4
divu $1, $1
TAG411:
mult $4, $4
sltu $3, $4, $4
lui $3, 6
sra $4, $3, 6
TAG412:
bgez $4, TAG413
sb $4, -6144($4)
sw $4, 0($4)
lui $3, 6
TAG413:
sltiu $4, $3, 10
mthi $3
sw $4, 0($4)
mtlo $3
TAG414:
multu $4, $4
mult $4, $4
mult $4, $4
bne $4, $4, TAG415
TAG415:
mtlo $4
beq $4, $4, TAG416
sw $4, 0($4)
mfhi $3
TAG416:
mfhi $2
sll $3, $3, 1
andi $3, $2, 2
mflo $1
TAG417:
mtlo $1
sllv $3, $1, $1
lui $1, 1
sll $0, $0, 0
TAG418:
multu $3, $3
mfhi $2
mfhi $2
lui $3, 6
TAG419:
mthi $3
lui $1, 9
xor $3, $1, $1
multu $3, $1
TAG420:
srl $1, $3, 7
addiu $1, $1, 1
beq $1, $3, TAG421
mtlo $1
TAG421:
lbu $3, 0($1)
srl $2, $3, 14
bne $1, $1, TAG422
mult $3, $1
TAG422:
lh $1, 0($2)
mthi $2
mfhi $4
andi $3, $4, 2
TAG423:
bgtz $3, TAG424
lui $2, 15
mthi $3
sll $0, $0, 0
TAG424:
sll $0, $0, 0
mtlo $2
srlv $1, $2, $2
mflo $3
TAG425:
xori $3, $3, 4
div $3, $3
bgez $3, TAG426
mtlo $3
TAG426:
mtlo $3
sll $0, $0, 0
multu $3, $3
bltz $3, TAG427
TAG427:
mflo $1
bne $3, $1, TAG428
addu $4, $1, $1
sllv $1, $4, $4
TAG428:
sll $0, $0, 0
addu $3, $1, $1
lui $3, 4
bltz $3, TAG429
TAG429:
mthi $3
sll $2, $3, 14
mfhi $1
bgtz $3, TAG430
TAG430:
mult $1, $1
mfhi $3
xori $2, $1, 5
lui $1, 7
TAG431:
sll $0, $0, 0
mflo $2
lui $1, 6
beq $1, $1, TAG432
TAG432:
sll $0, $0, 0
sll $0, $0, 0
ori $2, $1, 8
addiu $1, $1, 5
TAG433:
div $1, $1
and $1, $1, $1
beq $1, $1, TAG434
divu $1, $1
TAG434:
sll $0, $0, 0
bne $1, $4, TAG435
mthi $4
lui $1, 11
TAG435:
bne $1, $1, TAG436
div $1, $1
slti $1, $1, 8
mult $1, $1
TAG436:
mtlo $1
sra $1, $1, 11
mflo $1
lw $3, 0($1)
TAG437:
sh $3, 0($3)
sh $3, 0($3)
mtlo $3
sra $4, $3, 5
TAG438:
nor $1, $4, $4
lui $3, 5
bltz $4, TAG439
sb $4, 0($4)
TAG439:
mthi $3
srlv $2, $3, $3
beq $2, $2, TAG440
sllv $3, $2, $3
TAG440:
beq $3, $3, TAG441
div $3, $3
sb $3, 0($3)
srl $1, $3, 12
TAG441:
multu $1, $1
mtlo $1
slt $3, $1, $1
bgez $3, TAG442
TAG442:
andi $4, $3, 4
mfhi $4
bgez $3, TAG443
lui $4, 7
TAG443:
mfhi $3
sll $0, $0, 0
beq $3, $2, TAG444
lui $2, 4
TAG444:
slt $2, $2, $2
sw $2, 0($2)
bne $2, $2, TAG445
sub $4, $2, $2
TAG445:
sra $1, $4, 4
andi $4, $1, 3
mflo $2
sh $1, 0($1)
TAG446:
multu $2, $2
beq $2, $2, TAG447
mfhi $4
sb $4, 0($4)
TAG447:
sll $0, $0, 0
lbu $4, 2($4)
bgtz $4, TAG448
sra $3, $4, 5
TAG448:
lui $1, 9
bltz $1, TAG449
mtlo $3
sw $3, 0($3)
TAG449:
mult $1, $1
sra $1, $1, 14
blez $1, TAG450
slti $4, $1, 7
TAG450:
mthi $4
lbu $4, 0($4)
addu $1, $4, $4
bgez $1, TAG451
TAG451:
mflo $3
mflo $4
srlv $1, $1, $3
mflo $3
TAG452:
lui $3, 15
sll $0, $0, 0
sll $0, $0, 0
or $1, $1, $1
TAG453:
lb $4, 0($1)
or $4, $4, $1
bgez $4, TAG454
mthi $4
TAG454:
mtlo $4
andi $3, $4, 12
bne $4, $4, TAG455
mtlo $3
TAG455:
mfhi $1
bltz $1, TAG456
mtlo $1
mthi $3
TAG456:
mthi $1
lbu $2, 0($1)
blez $1, TAG457
mtlo $1
TAG457:
add $3, $2, $2
mult $3, $3
lui $1, 5
bgez $2, TAG458
TAG458:
sll $0, $0, 0
blez $1, TAG459
lui $3, 7
lui $3, 15
TAG459:
addu $1, $3, $3
lui $1, 5
bne $3, $1, TAG460
sll $0, $0, 0
TAG460:
sb $4, 0($4)
bne $4, $4, TAG461
lbu $1, 0($4)
blez $1, TAG461
TAG461:
lui $2, 9
beq $1, $2, TAG462
sb $1, 0($1)
sll $0, $0, 0
TAG462:
lui $3, 13
divu $3, $2
beq $3, $2, TAG463
andi $3, $2, 0
TAG463:
mflo $1
bgtz $3, TAG464
lhu $3, 0($3)
sh $3, 0($3)
TAG464:
lui $1, 13
mflo $4
slti $4, $4, 13
lui $2, 1
TAG465:
lui $3, 9
sll $0, $0, 0
sll $1, $3, 3
beq $3, $3, TAG466
TAG466:
sltiu $4, $1, 3
sll $0, $0, 0
srav $3, $1, $4
mthi $4
TAG467:
bgtz $3, TAG468
mfhi $3
mtlo $3
blez $3, TAG468
TAG468:
sw $3, 0($3)
mflo $4
bne $4, $4, TAG469
sub $3, $3, $3
TAG469:
xori $4, $3, 14
slti $2, $3, 6
slti $1, $4, 3
lui $3, 5
TAG470:
sll $0, $0, 0
sltu $3, $3, $3
mtlo $3
mtlo $3
TAG471:
beq $3, $3, TAG472
srlv $2, $3, $3
bne $2, $2, TAG472
sub $2, $2, $2
TAG472:
mthi $2
multu $2, $2
bne $2, $2, TAG473
slt $4, $2, $2
TAG473:
lui $2, 11
sh $4, 0($4)
sll $3, $4, 12
sll $0, $0, 0
TAG474:
mtlo $4
bne $4, $4, TAG475
srl $1, $4, 10
sh $1, 0($1)
TAG475:
sll $1, $1, 0
mfhi $4
beq $1, $1, TAG476
mult $1, $4
TAG476:
lui $1, 13
or $4, $4, $1
sll $0, $0, 0
sll $0, $0, 0
TAG477:
subu $4, $4, $4
and $3, $4, $4
lui $1, 12
lb $2, 0($4)
TAG478:
sh $2, 0($2)
sh $2, 0($2)
bltz $2, TAG479
lh $2, 0($2)
TAG479:
mthi $2
lb $1, 0($2)
lui $1, 15
srl $3, $1, 13
TAG480:
sw $3, 0($3)
bgez $3, TAG481
mult $3, $3
sb $3, 0($3)
TAG481:
sll $3, $3, 2
xor $2, $3, $3
bgtz $3, TAG482
mfhi $4
TAG482:
multu $4, $4
lui $2, 0
lw $3, 0($2)
lb $1, 0($4)
TAG483:
lb $1, 0($1)
bltz $1, TAG484
lui $2, 9
lbu $3, 0($1)
TAG484:
mflo $1
mtlo $3
addi $1, $3, 3
lui $3, 14
TAG485:
lui $2, 15
mthi $3
sll $0, $0, 0
mtlo $3
TAG486:
mtlo $3
mthi $3
beq $3, $3, TAG487
mtlo $3
TAG487:
multu $3, $3
subu $1, $3, $3
mult $1, $3
mthi $1
TAG488:
xori $4, $1, 12
sb $4, 0($4)
lw $1, 0($1)
mult $1, $1
TAG489:
beq $1, $1, TAG490
sltu $3, $1, $1
lb $3, 0($3)
lbu $4, 0($3)
TAG490:
lui $1, 7
sh $1, 0($4)
sw $4, 0($4)
mflo $2
TAG491:
multu $2, $2
mthi $2
sh $2, 0($2)
addi $3, $2, 12
TAG492:
bltz $3, TAG493
lui $1, 11
blez $1, TAG493
mthi $3
TAG493:
divu $1, $1
div $1, $1
div $1, $1
bgtz $1, TAG494
TAG494:
sll $0, $0, 0
mult $1, $1
sw $1, 0($4)
blez $4, TAG495
TAG495:
lui $3, 5
subu $1, $3, $4
addiu $2, $3, 4
mthi $4
TAG496:
xor $1, $2, $2
mfhi $1
sll $0, $0, 0
bgtz $1, TAG497
TAG497:
lui $3, 2
mtlo $3
ori $4, $1, 3
mfhi $2
TAG498:
bltz $2, TAG499
divu $2, $2
mtlo $2
addiu $4, $2, 7
TAG499:
bne $4, $4, TAG500
lui $2, 15
mthi $4
lui $1, 0
TAG500:
slti $4, $1, 14
multu $4, $1
lui $4, 4
sll $0, $0, 0
TAG501:
div $4, $4
mfhi $2
div $2, $4
mthi $2
TAG502:
bltz $2, TAG503
mfhi $3
sltiu $4, $2, 9
multu $3, $3
TAG503:
lb $3, 0($4)
xor $3, $3, $4
sb $3, 0($3)
sb $3, 0($3)
TAG504:
bgtz $3, TAG505
lui $2, 15
mtlo $2
bgtz $3, TAG505
TAG505:
addiu $2, $2, 11
subu $2, $2, $2
lui $3, 4
mtlo $3
TAG506:
mfhi $2
lui $2, 8
bgtz $2, TAG507
sll $0, $0, 0
TAG507:
xor $1, $2, $2
sra $3, $2, 13
beq $2, $1, TAG508
sll $0, $0, 0
TAG508:
srlv $3, $3, $3
div $3, $3
slti $4, $3, 4
addiu $3, $3, 11
TAG509:
blez $3, TAG510
andi $3, $3, 8
mfhi $4
srl $2, $3, 15
TAG510:
sw $2, 0($2)
addi $1, $2, 5
and $3, $2, $1
mfhi $4
TAG511:
sra $3, $4, 9
bgez $4, TAG512
addiu $4, $3, 4
bltz $4, TAG512
TAG512:
lhu $4, 0($4)
mtlo $4
sll $1, $4, 1
lui $4, 13
TAG513:
mfhi $3
mtlo $3
mtlo $4
bltz $3, TAG514
TAG514:
lbu $1, 0($3)
mult $3, $1
bltz $1, TAG515
add $1, $3, $3
TAG515:
lbu $1, 0($1)
beq $1, $1, TAG516
mthi $1
sltu $3, $1, $1
TAG516:
lhu $3, 0($3)
lui $1, 8
andi $4, $1, 12
lui $1, 12
TAG517:
bne $1, $1, TAG518
sll $3, $1, 12
bne $3, $3, TAG518
srlv $1, $3, $3
TAG518:
mflo $1
addiu $3, $1, 6
slt $1, $1, $1
lh $4, 0($1)
TAG519:
mfhi $1
mthi $1
lui $4, 15
blez $1, TAG520
TAG520:
mflo $3
bgez $4, TAG521
addu $1, $4, $3
mfhi $1
TAG521:
sll $0, $0, 0
mfhi $2
lui $2, 6
bgtz $2, TAG522
TAG522:
xori $4, $2, 4
mthi $4
subu $2, $4, $2
beq $2, $4, TAG523
TAG523:
lui $1, 4
sw $1, 0($2)
bne $2, $1, TAG524
div $1, $2
TAG524:
mtlo $1
sll $0, $0, 0
bne $2, $2, TAG525
lbu $3, 0($2)
TAG525:
mfhi $4
mfhi $2
mflo $4
divu $3, $4
TAG526:
divu $4, $4
sll $0, $0, 0
lui $3, 14
lui $2, 0
TAG527:
bne $2, $2, TAG528
srav $4, $2, $2
mfhi $4
ori $3, $4, 14
TAG528:
sh $3, 0($3)
subu $2, $3, $3
lhu $3, 0($3)
sh $3, 0($3)
TAG529:
mult $3, $3
lhu $2, 0($3)
lui $2, 12
addu $2, $2, $2
TAG530:
bne $2, $2, TAG531
sll $0, $0, 0
lui $1, 5
div $1, $2
TAG531:
lui $1, 0
beq $1, $1, TAG532
addi $3, $1, 13
beq $1, $1, TAG532
TAG532:
lbu $3, 0($3)
mthi $3
multu $3, $3
beq $3, $3, TAG533
TAG533:
mtlo $3
lui $3, 0
lh $2, 0($3)
mult $3, $3
TAG534:
sw $2, 0($2)
bgez $2, TAG535
slti $3, $2, 1
mtlo $3
TAG535:
lui $4, 4
srlv $1, $4, $4
sll $4, $3, 14
addiu $4, $4, 13
TAG536:
bgez $4, TAG537
slti $4, $4, 12
mthi $4
div $4, $4
TAG537:
sh $4, 0($4)
beq $4, $4, TAG538
mult $4, $4
subu $4, $4, $4
TAG538:
mfhi $2
mtlo $4
bgtz $4, TAG539
srav $4, $2, $4
TAG539:
multu $4, $4
sw $4, 0($4)
mfhi $4
mtlo $4
TAG540:
lui $3, 8
lui $4, 7
lui $3, 12
xor $4, $4, $3
TAG541:
sll $0, $0, 0
mtlo $4
and $4, $4, $4
mfhi $4
TAG542:
sub $3, $4, $4
mtlo $4
bgtz $3, TAG543
mflo $2
TAG543:
lhu $4, 0($2)
beq $4, $2, TAG544
slti $3, $2, 8
bgez $4, TAG544
TAG544:
addiu $2, $3, 3
addu $3, $3, $3
multu $3, $3
mtlo $3
TAG545:
lui $1, 3
sll $0, $0, 0
sb $2, 0($3)
subu $1, $1, $3
TAG546:
sllv $1, $1, $1
lui $3, 10
mult $1, $3
bltz $3, TAG547
TAG547:
multu $3, $3
sra $4, $3, 2
beq $4, $4, TAG548
sll $0, $0, 0
TAG548:
lui $1, 6
srl $2, $1, 1
blez $1, TAG549
sltu $2, $4, $4
TAG549:
lh $2, 0($2)
mthi $2
subu $4, $2, $2
mthi $2
TAG550:
add $4, $4, $4
sltiu $1, $4, 7
slt $2, $1, $4
sllv $1, $2, $2
TAG551:
mthi $1
bgez $1, TAG552
mthi $1
bne $1, $1, TAG552
TAG552:
sb $1, 0($1)
bne $1, $1, TAG553
sh $1, 0($1)
mtlo $1
TAG553:
bgez $1, TAG554
mtlo $1
mflo $3
sltu $3, $1, $1
TAG554:
divu $3, $3
mult $3, $3
mult $3, $3
srl $2, $3, 3
TAG555:
sll $0, $0, 0
divu $3, $3
lui $3, 0
bgtz $3, TAG556
TAG556:
ori $4, $3, 8
div $4, $4
srav $1, $4, $4
beq $1, $4, TAG557
TAG557:
lb $2, 0($1)
lh $2, 0($1)
sw $2, 0($1)
mfhi $4
TAG558:
lui $4, 4
mflo $1
sll $0, $0, 0
mtlo $4
TAG559:
bgtz $1, TAG560
lb $3, 0($1)
lui $3, 1
lbu $4, 0($1)
TAG560:
mflo $1
sll $0, $0, 0
mflo $1
sra $2, $4, 15
TAG561:
div $2, $2
srl $4, $2, 8
beq $4, $2, TAG562
sh $4, 0($4)
TAG562:
sb $4, 0($4)
sw $4, 0($4)
mtlo $4
lh $1, 0($4)
TAG563:
mtlo $1
mtlo $1
lui $1, 3
sltiu $2, $1, 14
TAG564:
or $2, $2, $2
lui $1, 1
beq $2, $1, TAG565
sll $0, $0, 0
TAG565:
mthi $1
mfhi $3
mult $1, $1
mtlo $3
TAG566:
mfhi $2
divu $3, $2
lbu $1, 0($2)
slti $3, $2, 10
TAG567:
bne $3, $3, TAG568
lb $1, 0($3)
beq $1, $1, TAG568
sb $1, 0($1)
TAG568:
sb $1, 0($1)
mfhi $4
sw $4, 0($4)
sb $4, 0($1)
TAG569:
lui $1, 10
mthi $4
lhu $4, 0($4)
ori $3, $4, 7
TAG570:
subu $2, $3, $3
sltiu $2, $2, 4
mtlo $2
multu $2, $3
TAG571:
mfhi $2
beq $2, $2, TAG572
lbu $2, 0($2)
mtlo $2
TAG572:
sltiu $2, $2, 5
nor $1, $2, $2
mfhi $2
multu $2, $2
TAG573:
bgez $2, TAG574
sw $2, 0($2)
sub $3, $2, $2
divu $2, $3
TAG574:
lui $2, 15
divu $3, $3
bgez $3, TAG575
sb $3, 0($3)
TAG575:
sll $0, $0, 0
lui $3, 9
sll $0, $0, 0
lui $4, 2
TAG576:
sll $0, $0, 0
multu $4, $4
mthi $4
sll $0, $0, 0
TAG577:
sll $0, $0, 0
sll $0, $0, 0
addiu $4, $4, 5
bne $2, $4, TAG578
TAG578:
mfhi $4
bne $4, $4, TAG579
nor $3, $4, $4
bgtz $4, TAG579
TAG579:
lui $1, 14
sra $4, $1, 1
bgtz $3, TAG580
sll $0, $0, 0
TAG580:
beq $2, $2, TAG581
andi $1, $2, 14
mfhi $3
lh $4, 0($2)
TAG581:
sltiu $2, $4, 2
sll $0, $0, 0
lui $3, 0
mult $4, $3
TAG582:
sw $3, 0($3)
mtlo $3
bgez $3, TAG583
mflo $2
TAG583:
lui $3, 3
sll $0, $0, 0
beq $2, $2, TAG584
andi $1, $2, 9
TAG584:
srav $4, $1, $1
sra $2, $4, 9
mfhi $2
mflo $1
TAG585:
sra $1, $1, 0
multu $1, $1
slti $3, $1, 11
bgez $1, TAG586
TAG586:
mthi $3
mflo $1
srl $4, $1, 9
sh $3, 0($4)
TAG587:
sltu $1, $4, $4
mtlo $1
multu $4, $4
lbu $3, 0($4)
TAG588:
bgez $3, TAG589
multu $3, $3
divu $3, $3
beq $3, $3, TAG589
TAG589:
multu $3, $3
sb $3, 0($3)
mfhi $3
mtlo $3
TAG590:
mfhi $4
mflo $4
bgtz $4, TAG591
addi $3, $4, 10
TAG591:
lh $1, 0($3)
beq $3, $3, TAG592
mult $3, $1
lb $2, 0($1)
TAG592:
mthi $2
mult $2, $2
lui $3, 13
xori $1, $2, 3
TAG593:
bgtz $1, TAG594
sb $1, 0($1)
beq $1, $1, TAG594
mfhi $3
TAG594:
bltz $3, TAG595
addu $2, $3, $3
addiu $4, $2, 13
sll $0, $0, 0
TAG595:
mfhi $3
sb $3, 0($3)
lui $1, 4
blez $3, TAG596
TAG596:
sll $0, $0, 0
sll $0, $0, 0
lui $2, 9
lui $3, 7
TAG597:
sll $0, $0, 0
bgtz $3, TAG598
addu $3, $3, $3
lui $3, 9
TAG598:
bgtz $3, TAG599
mtlo $3
lui $3, 11
or $4, $3, $3
TAG599:
bne $4, $4, TAG600
lui $3, 13
bne $3, $3, TAG600
divu $4, $3
TAG600:
xor $3, $3, $3
multu $3, $3
lh $4, 0($3)
mthi $4
TAG601:
lui $1, 13
divu $4, $1
bne $4, $4, TAG602
lb $4, -256($4)
TAG602:
addiu $2, $4, 14
sltu $4, $2, $4
lui $3, 14
blez $4, TAG603
TAG603:
mtlo $3
bltz $3, TAG604
sll $3, $3, 8
bne $3, $3, TAG604
TAG604:
sll $0, $0, 0
div $3, $1
blez $3, TAG605
sll $0, $0, 0
TAG605:
lui $1, 5
mult $1, $1
lui $4, 8
addu $3, $3, $3
TAG606:
sll $0, $0, 0
slti $2, $3, 9
sra $2, $3, 8
and $2, $3, $2
TAG607:
lh $1, 0($2)
beq $2, $2, TAG608
mtlo $2
lui $4, 2
TAG608:
srlv $3, $4, $4
sll $0, $0, 0
mflo $3
sb $3, 0($3)
TAG609:
beq $3, $3, TAG610
addu $2, $3, $3
bltz $3, TAG610
add $4, $2, $3
TAG610:
mflo $3
beq $3, $4, TAG611
lui $3, 1
beq $4, $4, TAG611
TAG611:
subu $1, $3, $3
nor $3, $3, $1
bgez $3, TAG612
lui $3, 2
TAG612:
bne $3, $3, TAG613
xor $4, $3, $3
sll $0, $0, 0
bne $3, $3, TAG613
TAG613:
mthi $4
lui $2, 10
addiu $4, $2, 7
mflo $1
TAG614:
mtlo $1
bltz $1, TAG615
sltiu $2, $1, 5
blez $2, TAG615
TAG615:
sb $2, 0($2)
mfhi $1
bgez $2, TAG616
mflo $4
TAG616:
mtlo $4
mfhi $3
mtlo $3
mfhi $1
TAG617:
mflo $1
lh $3, 0($1)
mthi $3
sh $1, -256($3)
TAG618:
lui $1, 2
ori $4, $3, 8
lui $1, 2
divu $1, $1
TAG619:
lui $3, 2
mtlo $3
mflo $2
bne $1, $2, TAG620
TAG620:
sll $0, $0, 0
sll $0, $0, 0
sll $0, $0, 0
subu $2, $2, $1
TAG621:
beq $2, $2, TAG622
sh $2, 0($2)
mthi $2
addiu $4, $2, 1
TAG622:
bne $4, $4, TAG623
lbu $3, -264($4)
sb $4, 0($3)
sllv $2, $4, $4
TAG623:
mtlo $2
mtlo $2
mthi $2
xori $1, $2, 15
TAG624:
div $1, $1
sll $0, $0, 0
sll $0, $0, 0
multu $1, $1
TAG625:
blez $1, TAG626
subu $1, $1, $1
mtlo $1
multu $1, $1
TAG626:
mult $1, $1
multu $1, $1
lbu $2, 0($1)
mtlo $2
TAG627:
div $2, $2
mthi $2
sw $2, 0($2)
mult $2, $2
TAG628:
sh $2, 0($2)
mtlo $2
mfhi $2
lui $3, 1
TAG629:
mfhi $4
slt $3, $3, $3
sb $3, 0($3)
sb $3, 0($3)
TAG630:
bne $3, $3, TAG631
slti $1, $3, 4
div $3, $1
xor $2, $3, $3
TAG631:
lui $4, 0
mflo $1
lui $3, 1
lui $3, 14
TAG632:
sll $0, $0, 0
beq $1, $1, TAG633
lui $4, 1
sll $4, $3, 7
TAG633:
bltz $4, TAG634
mtlo $4
sll $0, $0, 0
lui $3, 9
TAG634:
mflo $2
mtlo $3
mult $2, $2
sra $2, $3, 0
TAG635:
and $3, $2, $2
bgtz $2, TAG636
sra $4, $3, 11
mflo $4
TAG636:
mflo $2
bltz $2, TAG637
mthi $2
mtlo $4
TAG637:
sltiu $2, $2, 4
lbu $4, 0($2)
mthi $4
addu $2, $2, $2
TAG638:
lui $3, 6
sh $3, 0($2)
sh $3, 0($2)
lui $1, 1
TAG639:
and $3, $1, $1
sll $0, $0, 0
sll $0, $0, 0
mult $3, $3
TAG640:
mthi $3
subu $1, $3, $3
mult $1, $1
sltu $1, $3, $1
TAG641:
bgez $1, TAG642
lui $1, 9
mflo $2
sw $1, 0($2)
TAG642:
mthi $2
sh $2, 0($2)
sra $2, $2, 5
lbu $3, 0($2)
TAG643:
mfhi $2
lh $1, 0($3)
lui $1, 11
mult $2, $1
TAG644:
blez $1, TAG645
sll $0, $0, 0
bgez $1, TAG645
lui $4, 14
TAG645:
andi $2, $4, 14
sra $2, $4, 3
bltz $2, TAG646
mflo $2
TAG646:
sll $0, $0, 0
sll $0, $0, 0
mfhi $4
sb $4, 0($4)
TAG647:
multu $4, $4
lui $4, 11
mflo $2
mult $4, $4
TAG648:
blez $2, TAG649
multu $2, $2
lui $3, 3
lh $3, 0($3)
TAG649:
bne $3, $3, TAG650
mtlo $3
srl $1, $3, 5
multu $1, $3
TAG650:
sra $1, $1, 14
lui $3, 14
mult $3, $3
lui $4, 0
TAG651:
lbu $2, 0($4)
xor $1, $4, $2
sb $2, 0($4)
sltu $2, $2, $4
TAG652:
beq $2, $2, TAG653
mtlo $2
bltz $2, TAG653
addu $2, $2, $2
TAG653:
mthi $2
multu $2, $2
lbu $4, 0($2)
bne $4, $4, TAG654
TAG654:
sw $4, 0($4)
sltiu $4, $4, 8
multu $4, $4
bne $4, $4, TAG655
TAG655:
lui $2, 7
lb $1, 0($4)
bne $2, $4, TAG656
and $4, $1, $1
TAG656:
lui $4, 5
mflo $2
lb $3, 0($2)
mfhi $4
TAG657:
mthi $4
mult $4, $4
beq $4, $4, TAG658
mthi $4
TAG658:
mult $4, $4
bltz $4, TAG659
mflo $2
lui $3, 6
TAG659:
lui $4, 13
addu $3, $3, $3
sll $0, $0, 0
sll $0, $0, 0
TAG660:
mfhi $3
beq $2, $2, TAG661
lw $1, 0($2)
lui $1, 14
TAG661:
andi $1, $1, 6
mtlo $1
lui $2, 4
sra $3, $2, 3
TAG662:
sll $0, $0, 0
divu $3, $3
sltiu $2, $3, 7
lui $3, 0
TAG663:
sh $3, 0($3)
mflo $2
lui $2, 7
ori $4, $3, 7
TAG664:
mthi $4
sb $4, 0($4)
lui $4, 10
bltz $4, TAG665
TAG665:
addu $2, $4, $4
mfhi $3
mtlo $4
beq $3, $4, TAG666
TAG666:
lui $4, 7
lui $1, 3
sll $0, $0, 0
xor $3, $1, $1
TAG667:
mfhi $3
ori $1, $3, 10
mtlo $3
lui $1, 5
TAG668:
sll $0, $0, 0
mfhi $4
mflo $4
mfhi $4
TAG669:
lui $2, 14
mtlo $2
lbu $3, 0($4)
lui $2, 10
TAG670:
sra $3, $2, 3
bne $2, $2, TAG671
sll $0, $0, 0
addiu $2, $3, 3
TAG671:
sll $0, $0, 0
srl $2, $2, 11
div $2, $3
div $2, $2
TAG672:
lb $1, 0($2)
lui $3, 2
mult $2, $2
sll $0, $0, 0
TAG673:
addu $4, $3, $3
divu $3, $3
mfhi $2
mtlo $2
TAG674:
mtlo $2
lui $1, 7
sh $2, 0($2)
mfhi $2
TAG675:
mflo $1
mtlo $1
lui $3, 0
addi $3, $2, 5
TAG676:
slti $4, $3, 10
sb $3, 0($4)
mflo $2
lbu $4, 0($3)
TAG677:
mthi $4
multu $4, $4
lb $3, 0($4)
bgez $3, TAG678
TAG678:
mfhi $4
sub $3, $4, $4
blez $4, TAG679
and $3, $4, $3
TAG679:
mtlo $3
mthi $3
bne $3, $3, TAG680
sh $3, 0($3)
TAG680:
multu $3, $3
sub $4, $3, $3
mfhi $4
and $4, $4, $3
TAG681:
multu $4, $4
mthi $4
mtlo $4
lui $3, 15
TAG682:
bltz $3, TAG683
and $3, $3, $3
lui $2, 1
sra $3, $2, 10
TAG683:
lb $4, 0($3)
addu $3, $4, $3
div $4, $3
sw $4, 0($3)
TAG684:
xori $4, $3, 15
lb $2, 0($3)
div $3, $4
lui $3, 14
TAG685:
bgez $3, TAG686
divu $3, $3
bltz $3, TAG686
multu $3, $3
TAG686:
srl $2, $3, 15
mthi $2
lui $1, 0
mthi $2
TAG687:
bgez $1, TAG688
sw $1, 0($1)
bgtz $1, TAG688
xor $4, $1, $1
TAG688:
bne $4, $4, TAG689
lbu $2, 0($4)
sltu $1, $4, $2
lbu $3, 0($2)
TAG689:
mult $3, $3
lui $4, 8
blez $4, TAG690
mtlo $4
TAG690:
lui $4, 6
multu $4, $4
mthi $4
sllv $1, $4, $4
TAG691:
xori $1, $1, 11
addiu $2, $1, 12
bgtz $2, TAG692
sll $0, $0, 0
TAG692:
addu $3, $2, $2
beq $2, $3, TAG693
sll $0, $0, 0
bne $1, $3, TAG693
TAG693:
lui $3, 10
bgtz $1, TAG694
mthi $1
sltiu $1, $3, 10
TAG694:
or $3, $1, $1
sll $0, $0, 0
blez $3, TAG695
mtlo $1
TAG695:
sll $0, $0, 0
mflo $1
lui $2, 2
sll $0, $0, 0
TAG696:
srav $1, $3, $3
slt $3, $3, $1
nor $1, $3, $3
mflo $3
TAG697:
bgez $3, TAG698
nor $1, $3, $3
addu $1, $3, $3
sh $3, 0($3)
TAG698:
mthi $1
beq $1, $1, TAG699
and $4, $1, $1
mtlo $1
TAG699:
sll $1, $4, 4
slt $2, $1, $1
mthi $1
lui $1, 1
TAG700:
beq $1, $1, TAG701
lui $1, 5
mthi $1
mthi $1
TAG701:
blez $1, TAG702
mfhi $3
addiu $1, $3, 2
andi $2, $1, 9
TAG702:
lw $2, 0($2)
mflo $4
bne $2, $4, TAG703
sw $4, 0($2)
TAG703:
lui $4, 11
srav $2, $4, $4
lui $3, 7
sll $0, $0, 0
TAG704:
sll $0, $0, 0
mtlo $4
bgez $4, TAG705
sll $0, $0, 0
TAG705:
mfhi $4
bne $4, $4, TAG706
div $4, $4
divu $3, $4
TAG706:
srl $3, $4, 12
sll $0, $0, 0
sll $0, $0, 0
sltu $4, $4, $3
TAG707:
mthi $4
bne $4, $4, TAG708
sh $4, 0($4)
lui $4, 9
TAG708:
lui $1, 8
lui $2, 6
sll $0, $0, 0
blez $4, TAG709
TAG709:
srav $2, $2, $2
mflo $4
mthi $2
sll $0, $0, 0
TAG710:
multu $4, $4
bne $4, $4, TAG711
sw $4, 0($4)
nor $2, $4, $4
TAG711:
mthi $2
mult $2, $2
sb $2, 1($2)
divu $2, $2
TAG712:
andi $3, $2, 3
div $2, $3
lb $4, 0($3)
beq $3, $2, TAG713
TAG713:
mult $4, $4
lw $2, 0($4)
xor $4, $4, $2
blez $4, TAG714
TAG714:
mfhi $1
mthi $4
lui $4, 9
bne $1, $4, TAG715
TAG715:
addiu $2, $4, 13
mfhi $2
div $2, $2
divu $2, $4
TAG716:
mfhi $1
mult $2, $2
sw $1, -255($1)
sb $1, -255($2)
TAG717:
andi $3, $1, 4
mthi $3
lui $3, 14
ori $3, $3, 0
TAG718:
andi $4, $3, 6
mult $4, $3
sb $3, 0($4)
or $1, $4, $4
TAG719:
sra $3, $1, 0
mflo $4
slt $4, $4, $4
srav $4, $3, $3
TAG720:
lhu $2, 0($4)
blez $2, TAG721
srl $1, $2, 14
mfhi $2
TAG721:
sllv $2, $2, $2
bne $2, $2, TAG722
lh $3, 0($2)
mthi $3
TAG722:
mthi $3
sll $4, $3, 10
mfhi $2
mfhi $2
TAG723:
mtlo $2
lw $3, 0($2)
multu $3, $3
multu $3, $3
TAG724:
sb $3, 0($3)
mtlo $3
mthi $3
lw $2, 0($3)
TAG725:
multu $2, $2
xori $2, $2, 4
bne $2, $2, TAG726
sra $2, $2, 13
TAG726:
mflo $4
mtlo $2
sw $2, 0($2)
bltz $4, TAG727
TAG727:
mflo $3
multu $4, $4
sw $4, 0($4)
mflo $3
TAG728:
mthi $3
sw $3, 0($3)
mthi $3
mult $3, $3
TAG729:
lbu $2, 0($3)
lui $4, 4
bltz $3, TAG730
slti $2, $4, 9
TAG730:
slti $2, $2, 15
sb $2, 0($2)
lui $1, 10
beq $2, $2, TAG731
TAG731:
sll $0, $0, 0
sllv $4, $1, $1
sll $0, $0, 0
mult $1, $4
TAG732:
mfhi $1
mult $4, $4
div $4, $1
lui $1, 0
TAG733:
lui $1, 13
mult $1, $1
mult $1, $1
or $4, $1, $1
TAG734:
sll $0, $0, 0
mflo $3
blez $4, TAG735
srav $4, $3, $3
TAG735:
mflo $4
lb $1, 0($4)
sll $2, $4, 2
mflo $1
TAG736:
mflo $4
mult $1, $4
lui $3, 13
mult $1, $4
TAG737:
lui $3, 14
srlv $4, $3, $3
andi $1, $3, 15
addu $3, $3, $3
TAG738:
mfhi $4
lui $4, 10
andi $4, $4, 9
sll $0, $0, 0
TAG739:
srl $2, $4, 0
lbu $1, 0($2)
mthi $1
lui $4, 3
TAG740:
mult $4, $4
mflo $1
bne $1, $1, TAG741
sltiu $3, $4, 8
TAG741:
bgez $3, TAG742
lb $3, 0($3)
mthi $3
lh $2, 0($3)
TAG742:
mult $2, $2
multu $2, $2
mflo $2
mult $2, $2
TAG743:
mflo $2
srav $4, $2, $2
mfhi $3
mflo $4
TAG744:
bgtz $4, TAG745
lui $4, 8
mthi $4
bgtz $4, TAG745
TAG745:
mfhi $3
mflo $4
mtlo $4
mtlo $3
TAG746:
lui $4, 14
sll $0, $0, 0
addu $1, $4, $4
lui $1, 11
TAG747:
mfhi $4
mfhi $4
beq $1, $1, TAG748
multu $1, $1
TAG748:
addiu $4, $4, 2
bne $4, $4, TAG749
div $4, $4
sll $0, $0, 0
TAG749:
sll $0, $0, 0
mtlo $4
addiu $2, $4, 2
mfhi $1
TAG750:
nop
nop
test_end:
beq $0, $0, test_end
nop |
P6/data_P6_2/cal_R_same_test60.asm | alxzzhou/BUAA_CO_2020 | 1 | 89959 | <reponame>alxzzhou/BUAA_CO_2020<gh_stars>1-10
lui $1,5125
ori $1,$1,10540
lui $2,46585
ori $2,$2,49911
lui $3,33051
ori $3,$3,1256
lui $4,32945
ori $4,$4,16070
lui $5,62089
ori $5,$5,44201
lui $6,12059
ori $6,$6,40741
mthi $1
mtlo $2
sec0:
nop
nop
nop
and $2,$6,$6
sec1:
nop
nop
subu $6,$4,$4
and $5,$6,$6
sec2:
nop
nop
andi $6,$5,54506
and $4,$6,$6
sec3:
nop
nop
mfhi $6
and $3,$6,$6
sec4:
nop
nop
lhu $6,12($0)
and $1,$6,$6
sec5:
nop
subu $6,$0,$3
nop
and $3,$6,$6
sec6:
nop
xor $6,$5,$4
and $6,$0,$1
and $2,$6,$6
sec7:
nop
addu $6,$1,$3
ori $6,$3,32427
and $2,$6,$6
sec8:
nop
sltu $6,$3,$5
mflo $6
and $6,$6,$6
sec9:
nop
and $6,$4,$4
lb $6,15($0)
and $3,$6,$6
sec10:
nop
slti $6,$2,-7406
nop
and $3,$6,$6
sec11:
nop
lui $6,15026
slt $6,$2,$2
and $0,$6,$6
sec12:
nop
xori $6,$6,14560
xori $6,$2,14957
and $2,$6,$6
sec13:
nop
lui $6,11664
mflo $6
and $0,$6,$6
sec14:
nop
lui $6,13001
lbu $6,4($0)
and $3,$6,$6
sec15:
nop
mfhi $6
nop
and $2,$6,$6
sec16:
nop
mflo $6
addu $6,$3,$1
and $4,$6,$6
sec17:
nop
mflo $6
sltiu $6,$2,31735
and $4,$6,$6
sec18:
nop
mflo $6
mfhi $6
and $2,$6,$6
sec19:
nop
mflo $6
lw $6,4($0)
and $2,$6,$6
sec20:
nop
lw $6,16($0)
nop
and $0,$6,$6
sec21:
nop
lbu $6,11($0)
sltu $6,$1,$0
and $3,$6,$6
sec22:
nop
lhu $6,4($0)
lui $6,32544
and $2,$6,$6
sec23:
nop
lhu $6,2($0)
mfhi $6
and $6,$6,$6
sec24:
nop
lbu $6,11($0)
lhu $6,14($0)
and $3,$6,$6
sec25:
slt $6,$2,$2
nop
nop
and $6,$6,$6
sec26:
slt $6,$3,$4
nop
xor $6,$4,$2
and $2,$6,$6
sec27:
or $6,$4,$2
nop
sltiu $6,$3,-15865
and $6,$6,$6
sec28:
subu $6,$6,$3
nop
mfhi $6
and $2,$6,$6
sec29:
subu $6,$5,$2
nop
lbu $6,1($0)
and $2,$6,$6
sec30:
or $6,$3,$5
sltu $6,$3,$3
nop
and $0,$6,$6
sec31:
addu $6,$0,$4
xor $6,$0,$5
or $6,$2,$4
and $1,$6,$6
sec32:
and $6,$6,$0
subu $6,$0,$3
addiu $6,$1,-574
and $3,$6,$6
sec33:
sltu $6,$4,$5
nor $6,$2,$2
mfhi $6
and $1,$6,$6
sec34:
nor $6,$3,$3
or $6,$1,$2
lhu $6,10($0)
and $5,$6,$6
sec35:
addu $6,$3,$3
lui $6,18851
nop
and $3,$6,$6
sec36:
nor $6,$4,$1
andi $6,$4,42563
or $6,$4,$3
and $5,$6,$6
sec37:
subu $6,$0,$4
sltiu $6,$3,30651
lui $6,60749
and $2,$6,$6
sec38:
or $6,$4,$3
addiu $6,$1,14425
mflo $6
and $2,$6,$6
sec39:
slt $6,$3,$2
ori $6,$4,38344
lw $6,12($0)
and $5,$6,$6
sec40:
xor $6,$4,$2
mfhi $6
nop
and $4,$6,$6
sec41:
sltu $6,$1,$3
mfhi $6
slt $6,$1,$4
and $5,$6,$6
sec42:
sltu $6,$0,$4
mfhi $6
xori $6,$6,25387
and $2,$6,$6
sec43:
sltu $6,$4,$4
mfhi $6
mfhi $6
and $3,$6,$6
sec44:
subu $6,$5,$3
mflo $6
lbu $6,16($0)
and $3,$6,$6
sec45:
xor $6,$4,$2
lbu $6,7($0)
nop
and $4,$6,$6
sec46:
addu $6,$4,$5
lh $6,2($0)
slt $6,$3,$2
and $2,$6,$6
sec47:
or $6,$2,$4
lh $6,16($0)
xori $6,$5,40250
and $2,$6,$6
sec48:
or $6,$6,$3
lw $6,8($0)
mflo $6
and $3,$6,$6
sec49:
addu $6,$3,$5
lw $6,12($0)
lbu $6,11($0)
and $4,$6,$6
sec50:
slti $6,$3,26816
nop
nop
and $2,$6,$6
sec51:
lui $6,5171
nop
subu $6,$6,$0
and $2,$6,$6
sec52:
ori $6,$0,53904
nop
sltiu $6,$4,-27072
and $4,$6,$6
sec53:
addiu $6,$3,-13568
nop
mflo $6
and $4,$6,$6
sec54:
andi $6,$3,14358
nop
lh $6,8($0)
and $2,$6,$6
sec55:
slti $6,$3,-21887
and $6,$5,$4
nop
and $1,$6,$6
sec56:
addiu $6,$6,14393
subu $6,$6,$2
sltu $6,$2,$3
and $5,$6,$6
sec57:
ori $6,$4,31562
sltu $6,$3,$4
slti $6,$6,-6445
and $4,$6,$6
sec58:
ori $6,$1,62279
and $6,$5,$0
mfhi $6
and $6,$6,$6
sec59:
ori $6,$1,64365
slt $6,$1,$3
lhu $6,0($0)
and $3,$6,$6
sec60:
xori $6,$3,11873
addiu $6,$5,-1049
nop
and $4,$6,$6
sec61:
andi $6,$2,4206
andi $6,$4,50903
sltu $6,$0,$2
and $1,$6,$6
sec62:
xori $6,$2,62770
lui $6,58409
xori $6,$5,17882
and $1,$6,$6
sec63:
xori $6,$4,37876
lui $6,49927
mflo $6
and $3,$6,$6
sec64:
addiu $6,$2,-26423
slti $6,$2,-14145
lhu $6,14($0)
and $2,$6,$6
sec65:
lui $6,62409
mfhi $6
nop
and $1,$6,$6
sec66:
xori $6,$4,8759
mfhi $6
and $6,$1,$5
and $4,$6,$6
sec67:
andi $6,$3,49975
mfhi $6
ori $6,$5,680
and $2,$6,$6
sec68:
sltiu $6,$3,5105
mfhi $6
mfhi $6
and $2,$6,$6
sec69:
addiu $6,$3,29895
mfhi $6
lw $6,0($0)
and $1,$6,$6
sec70:
lui $6,7102
lhu $6,8($0)
nop
and $4,$6,$6
sec71:
slti $6,$2,16253
lh $6,14($0)
addu $6,$1,$4
and $5,$6,$6
sec72:
ori $6,$4,51788
lb $6,4($0)
xori $6,$0,60254
and $1,$6,$6
sec73:
sltiu $6,$6,2204
lhu $6,12($0)
mfhi $6
and $4,$6,$6
sec74:
lui $6,4278
lw $6,8($0)
lb $6,12($0)
and $0,$6,$6
sec75:
mflo $6
nop
nop
and $2,$6,$6
sec76:
mfhi $6
nop
and $6,$0,$3
and $4,$6,$6
sec77:
mfhi $6
nop
sltiu $6,$2,22597
and $2,$6,$6
sec78:
mfhi $6
nop
mfhi $6
and $2,$6,$6
sec79:
mflo $6
nop
lbu $6,13($0)
and $3,$6,$6
sec80:
mfhi $6
slt $6,$0,$2
nop
and $2,$6,$6
sec81:
mflo $6
sltu $6,$5,$3
and $6,$0,$2
and $2,$6,$6
sec82:
mflo $6
nor $6,$0,$3
ori $6,$1,39434
and $2,$6,$6
sec83:
mflo $6
and $6,$5,$0
mflo $6
and $2,$6,$6
sec84:
mfhi $6
or $6,$3,$4
lh $6,6($0)
and $1,$6,$6
sec85:
mflo $6
lui $6,59430
nop
and $6,$6,$6
sec86:
mflo $6
andi $6,$3,39391
nor $6,$3,$0
and $1,$6,$6
sec87:
mflo $6
sltiu $6,$5,-29993
xori $6,$3,48590
and $5,$6,$6
sec88:
mfhi $6
xori $6,$5,42241
mflo $6
and $3,$6,$6
sec89:
mfhi $6
slti $6,$3,11386
lb $6,13($0)
and $1,$6,$6
sec90:
mflo $6
mflo $6
nop
and $4,$6,$6
sec91:
mflo $6
mfhi $6
and $6,$3,$2
and $2,$6,$6
sec92:
mfhi $6
mfhi $6
addiu $6,$0,-11213
and $1,$6,$6
sec93:
mflo $6
mflo $6
mflo $6
and $1,$6,$6
sec94:
mflo $6
mflo $6
lh $6,6($0)
and $2,$6,$6
sec95:
mflo $6
lhu $6,14($0)
nop
and $6,$6,$6
sec96:
mfhi $6
lbu $6,9($0)
sltu $6,$1,$3
and $4,$6,$6
sec97:
mflo $6
lbu $6,4($0)
lui $6,64506
and $2,$6,$6
sec98:
mfhi $6
lw $6,12($0)
mflo $6
and $2,$6,$6
sec99:
mflo $6
lw $6,4($0)
lb $6,6($0)
and $3,$6,$6
sec100:
lbu $6,0($0)
nop
nop
and $3,$6,$6
sec101:
lbu $6,14($0)
nop
sltu $6,$5,$5
and $3,$6,$6
sec102:
lbu $6,0($0)
nop
sltiu $6,$4,3339
and $3,$6,$6
sec103:
lhu $6,8($0)
nop
mflo $6
and $0,$6,$6
sec104:
lbu $6,11($0)
nop
lbu $6,5($0)
and $2,$6,$6
sec105:
lb $6,3($0)
addu $6,$3,$2
nop
and $4,$6,$6
sec106:
lb $6,6($0)
or $6,$3,$3
and $6,$2,$4
and $3,$6,$6
sec107:
lw $6,12($0)
addu $6,$2,$2
slti $6,$5,6637
and $2,$6,$6
sec108:
lbu $6,9($0)
and $6,$5,$0
mflo $6
and $5,$6,$6
sec109:
lh $6,12($0)
slt $6,$2,$6
lw $6,16($0)
and $4,$6,$6
sec110:
lw $6,8($0)
xori $6,$2,49011
nop
and $4,$6,$6
sec111:
lhu $6,6($0)
lui $6,42047
and $6,$3,$3
and $6,$6,$6
sec112:
lbu $6,4($0)
andi $6,$0,34641
addiu $6,$1,-21683
and $6,$6,$6
sec113:
lb $6,3($0)
sltiu $6,$4,12461
mflo $6
and $3,$6,$6
sec114:
lw $6,8($0)
ori $6,$4,5861
lhu $6,6($0)
and $6,$6,$6
sec115:
lbu $6,7($0)
mfhi $6
nop
and $5,$6,$6
sec116:
lw $6,8($0)
mflo $6
nor $6,$1,$3
and $1,$6,$6
sec117:
lh $6,16($0)
mflo $6
sltiu $6,$3,-3675
and $3,$6,$6
sec118:
lbu $6,10($0)
mfhi $6
mfhi $6
and $4,$6,$6
sec119:
lw $6,0($0)
mfhi $6
lh $6,16($0)
and $5,$6,$6
sec120:
lhu $6,8($0)
lhu $6,10($0)
nop
and $4,$6,$6
sec121:
lb $6,6($0)
lh $6,14($0)
subu $6,$6,$4
and $3,$6,$6
sec122:
lw $6,16($0)
lb $6,15($0)
xori $6,$3,38845
and $2,$6,$6
sec123:
lbu $6,7($0)
lh $6,16($0)
mfhi $6
and $6,$6,$6
sec124:
lh $6,2($0)
lb $6,10($0)
lb $6,5($0)
and $3,$6,$6
|
scripts/reminders/get-lists.applescript | briangonzalez/awesome-applescripts | 39 | 1329 | <reponame>briangonzalez/awesome-applescripts
tell application "Reminders" to set todo_lists to (get name of every list)
return todo_lists
|
alloy4fun_models/trainstlt/models/8/ji6hcSsLZasXaxrAC.als | Kaixi26/org.alloytools.alloy | 0 | 5314 | <gh_stars>0
open main
pred idji6hcSsLZasXaxrAC_prop9 {
all t:Train | some tk:Entry | t->tk not in pos implies eventually (t->tk in pos and before no t.pos)
}
pred __repair { idji6hcSsLZasXaxrAC_prop9 }
check __repair { idji6hcSsLZasXaxrAC_prop9 <=> prop9o } |
libsrc/_DEVELOPMENT/adt/b_vector/z80/asm_b_vector_read_block.asm | jpoikela/z88dk | 640 | 15243 | <reponame>jpoikela/z88dk<gh_stars>100-1000
; ===============================================================
; Mar 2014
; ===============================================================
;
; size_t b_vector_read_block(void *dst, size_t n, b_vector_t *v, size_t idx)
;
; Copy at most n bytes from the vector at index idx to address
; dst. Returns number of bytes actually copied, which may be
; less than n if the vector does not contain n bytes of data at
; idx.
;
; ===============================================================
SECTION code_clib
SECTION code_adt_b_vector
PUBLIC asm_b_vector_read_block
EXTERN asm_b_array_read_block
defc asm_b_vector_read_block = asm_b_array_read_block
; enter : de'= void *dst
; hl = vector *
; de = n
; bc = idx
;
; exit : bc = idx
; de = n
;
; success
;
; hl = number of bytes read
; hl'= void *dst
; de'= ptr in dst to one byte after last one written
; carry reset
;
; fail if idx out of range
;
; hl = 0
; de'= void *dst
; carry set, errno = EINVAL
;
; uses : af, bc, de, hl, bc', de', hl'
|
source/amf/dd/amf-internals-dg_radial_gradients.ads | svn2github/matreshka | 24 | 137 | <filename>source/amf/dd/amf-internals-dg_radial_gradients.ads<gh_stars>10-100
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.DG.Canvases;
with AMF.DG.Radial_Gradients;
with AMF.Internals.DG_Elements;
with AMF.Visitors;
package AMF.Internals.DG_Radial_Gradients is
type DG_Radial_Gradient_Proxy is
limited new AMF.Internals.DG_Elements.DG_Element_Proxy
and AMF.DG.Radial_Gradients.DG_Radial_Gradient with null record;
overriding function Get_Center_X
(Self : not null access constant DG_Radial_Gradient_Proxy)
return AMF.Real;
-- Getter of RadialGradient::centerX.
--
-- a real number (>=0 and >=1) representing a ratio of the graphical
-- element's width that is the x center point of the gradient.
overriding procedure Set_Center_X
(Self : not null access DG_Radial_Gradient_Proxy;
To : AMF.Real);
-- Setter of RadialGradient::centerX.
--
-- a real number (>=0 and >=1) representing a ratio of the graphical
-- element's width that is the x center point of the gradient.
overriding function Get_Center_Y
(Self : not null access constant DG_Radial_Gradient_Proxy)
return AMF.Real;
-- Getter of RadialGradient::centerY.
--
-- a real number (>=0 and >=1) representing a ratio of the graphical
-- element's width that is the y center point of the gradient.
overriding procedure Set_Center_Y
(Self : not null access DG_Radial_Gradient_Proxy;
To : AMF.Real);
-- Setter of RadialGradient::centerY.
--
-- a real number (>=0 and >=1) representing a ratio of the graphical
-- element's width that is the y center point of the gradient.
overriding function Get_Radius
(Self : not null access constant DG_Radial_Gradient_Proxy)
return AMF.Real;
-- Getter of RadialGradient::radius.
--
-- a real number (>=0 and >=1) representing a ratio of the graphical
-- element's size that is the radius of the gradient.
overriding procedure Set_Radius
(Self : not null access DG_Radial_Gradient_Proxy;
To : AMF.Real);
-- Setter of RadialGradient::radius.
--
-- a real number (>=0 and >=1) representing a ratio of the graphical
-- element's size that is the radius of the gradient.
overriding function Get_Focus_X
(Self : not null access constant DG_Radial_Gradient_Proxy)
return AMF.Real;
-- Getter of RadialGradient::focusX.
--
-- a real number (>=0 and >=1) representing a ratio of the graphical
-- element's width that is the x focus point of the gradient.
overriding procedure Set_Focus_X
(Self : not null access DG_Radial_Gradient_Proxy;
To : AMF.Real);
-- Setter of RadialGradient::focusX.
--
-- a real number (>=0 and >=1) representing a ratio of the graphical
-- element's width that is the x focus point of the gradient.
overriding function Get_Focus_Y
(Self : not null access constant DG_Radial_Gradient_Proxy)
return AMF.Real;
-- Getter of RadialGradient::focusY.
--
-- a real number (>=0 and >=1) representing a ratio of the graphical
-- element's width that is the y focus point of the gradient.
overriding procedure Set_Focus_Y
(Self : not null access DG_Radial_Gradient_Proxy;
To : AMF.Real);
-- Setter of RadialGradient::focusY.
--
-- a real number (>=0 and >=1) representing a ratio of the graphical
-- element's width that is the y focus point of the gradient.
overriding function Get_Stop
(Self : not null access constant DG_Radial_Gradient_Proxy)
return AMF.DG.Set_Of_DG_Gradient_Stop;
-- Getter of Gradient::stop.
--
-- a list of two or more gradient stops defining the color transitions of
-- the gradient.
overriding function Get_Canvas
(Self : not null access constant DG_Radial_Gradient_Proxy)
return AMF.DG.Canvases.DG_Canvas_Access;
-- Getter of Fill::canvas.
--
-- a reference to the canvas that owns this fill.
overriding procedure Set_Canvas
(Self : not null access DG_Radial_Gradient_Proxy;
To : AMF.DG.Canvases.DG_Canvas_Access);
-- Setter of Fill::canvas.
--
-- a reference to the canvas that owns this fill.
overriding function Get_Transform
(Self : not null access constant DG_Radial_Gradient_Proxy)
return AMF.DG.Sequence_Of_DG_Transform;
-- Getter of Fill::transform.
--
-- a list of zero or more transforms to apply to this fill.
overriding procedure Enter_Element
(Self : not null access constant DG_Radial_Gradient_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
overriding procedure Leave_Element
(Self : not null access constant DG_Radial_Gradient_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
overriding procedure Visit_Element
(Self : not null access constant DG_Radial_Gradient_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
end AMF.Internals.DG_Radial_Gradients;
|
programs/oeis/017/A017488.asm | karttu/loda | 1 | 81353 | ; A017488: a(n) = (11*n + 8)^4.
; 4096,130321,810000,2825761,7311616,15752961,29986576,52200625,84934656,131079601,193877776,276922881,384160000,519885601,688747536,895745041,1146228736,1445900625,1800814096,2217373921,2702336256,3262808641,3906250000,4640470641,5473632256,6414247921,7471182096,8653650625,9971220736,11433811041,13051691536,14835483601,16796160000,18945044881,21293813776,23854493601,26639462656,29661450625,32933538576,36469158961,40282095616,44386483761,48796810000,53527912321,58594980096,64013554081,69799526416,75969140625,82538991616,89526025681,96947540496,104821185121,113164960000,121997216961,131336659216,141202341361,151613669376,162590400625,174152643856,186320859201,199115858176,212558803681,226671210000,241474942801,256992219136,273245607441,290258027536,308052750625,326653399296,346083947521,366368720656,387532395441,409600000000,432596913841,456548867856,481481944321,507422576896,534397550625,562434001936,591559418641,621801639936,653188856401,685749610000,719512794081,754507653376,790763784001,828311133456,867180000625,907401035776,949005240561,992023968016,1036488922561,1082432160000,1129886087521,1178883463696,1229457398481,1281641353216,1335469140625,1390974924816,1448193221281,1507158896896,1567907169921,1630473610000,1694894138161,1761205026816,1829442899761,1899644732176,1971847850625,2046089933056,2122409008801,2200843458576,2281432014481,2364213760000,2449228130001,2536514910736,2626114239841,2718066606336,2812412850625,2909194164496,3008452091121,3110228525056,3214565712241,3321506250000,3431093087041,3543369523456,3658379210721,3776166151696,3896774700625,4020249563136,4146635796241,4275978808336,4408324359201,4543718560000,4682207873281,4823839112976,4968659444401,5116716384256,5268057800625,5422731912976,5580787292161,5742272860416,5907237891361,6075732010000,6247805192721,6423507767296,6602890412881,6786004160016,6972900390625,7163630838016,7358247586881,7556803073296,7759350084721,7965941760000,8176631589361,8391473414416,8610521428161,8833830174976,9061454550625,9293449802256,9529871528401,9770775678976,10016218555281,10266256810000,10520947447201,10780347822336,11044515642241,11313508965136,11587386200625,11866206109696,12150027804721,12438910749456,12732914759041,13032100000000,13336526990241,13646256599056,13961350047121,14281868906496,14607875100625,14939430904336,15276598943841,15619442196736,15968023992001,16322408010000,16682658282481,17048839192576,17421015474801,17799252215056,18183614850625,18574169170176,18970981313761,19374117772816,19783645390161,20199631360000,20622143227921,21051248890896,21487016597281,21929514946816,22378812890625,22834979731216,23298085122481,23768199069696,24245391929521,24729734410000,25221297570561,25720152822016,26226371926561,26740026997776,27261190500625,27789935251456,28326334418001,28870461519376,29422390426081,29982195360000,30549950894401,31125731953936,31709613814641,32301672103936,32901982800625,33510622234896,34127667088321,34753194393856,35387281535841,36030006250000,36681446623441,37341681094656,38010788453521,38688847841296,39375938750625,40072141025536,40777534861441,41492200805136,42216219754801,42949672960000,43692642021681,44445208892176,45207455875201,45979465625856,46761321150625,47553105807376,48354903305361,49166797705216,49988873418961,50821215210000,51663908193121,52517037834496,53380689951681,54254950713616,55139906640625,56035644604416,56942251828081
mul $0,11
add $0,8
pow $0,4
mov $1,$0
|
libsrc/_DEVELOPMENT/arch/zx/esxdos/z80/asm_esxdos_m_gethandle.asm | jpoikela/z88dk | 640 | 172560 | <reponame>jpoikela/z88dk
; uchar esxdos_m_gethandle(void)
INCLUDE "config_private.inc"
SECTION code_clib
SECTION code_esxdos
PUBLIC asm_esxdos_m_gethandle
EXTERN __esxdos_error_mc
asm_esxdos_m_gethandle:
; M_GETHANDLE:
; Get file handle of just loaded BASIC program in A.
; To be used with single-file loaders (Condommed for example).
;
; enter : none
;
; exit : success
;
; hl = file handle
; carry reset
;
; error
;
; hl = -1
; carry set, errno set
;
; uses : unknown
rst __ESXDOS_SYSCALL
defb __ESXDOS_SYS_M_GETHANDLE
ld l,a
ret nc
jp __esxdos_error_mc
|
include/khr_khrplatform_h.ads | docandrew/troodon | 5 | 5442 | pragma Ada_2012;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with bits_stdint_intn_h;
with bits_stdint_uintn_h;
package KHR_khrplatform_h is
-- unsupported macro: KHRONOS_APICALL __attribute__((visibility("default")))
KHRONOS_SUPPORT_INT64 : constant := 1; -- /usr/include/KHR/khrplatform.h:156
KHRONOS_SUPPORT_FLOAT : constant := 1; -- /usr/include/KHR/khrplatform.h:157
KHRONOS_MAX_ENUM : constant := 16#7FFFFFFF#; -- /usr/include/KHR/khrplatform.h:277
--** Copyright (c) 2008-2018 The Khronos Group Inc.
--**
--** Permission is hereby granted, free of charge, to any person obtaining a
--** copy of this software and/or associated documentation files (the
--** "Materials"), to deal in the Materials without restriction, including
--** without limitation the rights to use, copy, modify, merge, publish,
--** distribute, sublicense, and/or sell copies of the Materials, and to
--** permit persons to whom the Materials are 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 Materials.
--**
--** THE MATERIALS ARE 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
--** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
--
-- Khronos platform-specific types and definitions.
-- *
-- * The master copy of khrplatform.h is maintained in the Khronos EGL
-- * Registry repository at https://github.com/KhronosGroup/EGL-Registry
-- * The last semantic modification to khrplatform.h was at commit ID:
-- * 67a3e0864c2d75ea5287b9f3d2eb74a745936692
-- *
-- * Adopters may modify this file to suit their platform. Adopters are
-- * encouraged to submit platform specific modifications to the Khronos
-- * group so that they can be included in future versions of this file.
-- * Please submit changes by filing pull requests or issues on
-- * the EGL Registry repository linked above.
-- *
-- *
-- * See the Implementer's Guidelines for information about where this file
-- * should be located on your system and for more details of its use:
-- * http://www.khronos.org/registry/implementers_guide.pdf
-- *
-- * This file should be included as
-- * #include <KHR/khrplatform.h>
-- * by Khronos client API header files that use its types and defines.
-- *
-- * The types in khrplatform.h should only be used to define API-specific types.
-- *
-- * Types defined in khrplatform.h:
-- * khronos_int8_t signed 8 bit
-- * khronos_uint8_t unsigned 8 bit
-- * khronos_int16_t signed 16 bit
-- * khronos_uint16_t unsigned 16 bit
-- * khronos_int32_t signed 32 bit
-- * khronos_uint32_t unsigned 32 bit
-- * khronos_int64_t signed 64 bit
-- * khronos_uint64_t unsigned 64 bit
-- * khronos_intptr_t signed same number of bits as a pointer
-- * khronos_uintptr_t unsigned same number of bits as a pointer
-- * khronos_ssize_t signed size
-- * khronos_usize_t unsigned size
-- * khronos_float_t signed 32 bit floating point
-- * khronos_time_ns_t unsigned 64 bit time in nanoseconds
-- * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
-- * nanoseconds
-- * khronos_stime_nanoseconds_t signed time interval in nanoseconds
-- * khronos_boolean_enum_t enumerated boolean type. This should
-- * only be used as a base type when a client API's boolean type is
-- * an enum. Client APIs which use an integer or other type for
-- * booleans cannot use this as the base type for their boolean.
-- *
-- * Tokens defined in khrplatform.h:
-- *
-- * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
-- *
-- * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
-- * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
-- *
-- * Calling convention macros defined in this file:
-- * KHRONOS_APICALL
-- * KHRONOS_APIENTRY
-- * KHRONOS_APIATTRIBUTES
-- *
-- * These may be used in function prototypes as:
-- *
-- * KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
-- * int arg1,
-- * int arg2) KHRONOS_APIATTRIBUTES;
--
---------------------------------------------------------------------------
-- * Definition of KHRONOS_APICALL
-- *-------------------------------------------------------------------------
-- * This precedes the return type of the function in the function prototype.
--
-- If the preprocessor constant KHRONOS_STATIC is defined, make the
-- * header compatible with static linking.
-- KHRONOS_APIATTRIBUTES is not used by the client API headers yet
---------------------------------------------------------------------------
-- * Definition of KHRONOS_APIENTRY
-- *-------------------------------------------------------------------------
-- * This follows the return type of the function and precedes the function
-- * name in the function prototype.
--
-- Win32 but not WinCE
---------------------------------------------------------------------------
-- * Definition of KHRONOS_APIATTRIBUTES
-- *-------------------------------------------------------------------------
-- * This follows the closing parenthesis of the function prototype arguments.
--
---------------------------------------------------------------------------
-- * basic type definitions
-- *-----------------------------------------------------------------------
-- * Using <stdint.h>
--
subtype khronos_int32_t is bits_stdint_intn_h.int32_t; -- /usr/include/KHR/khrplatform.h:152
subtype khronos_uint32_t is bits_stdint_uintn_h.uint32_t; -- /usr/include/KHR/khrplatform.h:153
subtype khronos_int64_t is bits_stdint_intn_h.int64_t; -- /usr/include/KHR/khrplatform.h:154
subtype khronos_uint64_t is bits_stdint_uintn_h.uint64_t; -- /usr/include/KHR/khrplatform.h:155
-- * Using <inttypes.h>
--
-- * Win32
--
-- * Sun or Digital
--
-- * Hypothetical platform with no float or int64 support
--
-- * Generic fallback
--
-- * Types that are (so far) the same on all platforms
--
subtype khronos_int8_t is signed_char; -- /usr/include/KHR/khrplatform.h:230
subtype khronos_uint8_t is unsigned_char; -- /usr/include/KHR/khrplatform.h:231
subtype khronos_int16_t is short; -- /usr/include/KHR/khrplatform.h:232
subtype khronos_uint16_t is unsigned_short; -- /usr/include/KHR/khrplatform.h:233
-- * Types that differ between LLP64 and LP64 architectures - in LLP64,
-- * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
-- * to be the only LLP64 architecture in current use.
--
subtype khronos_intptr_t is long; -- /usr/include/KHR/khrplatform.h:246
subtype khronos_uintptr_t is unsigned_long; -- /usr/include/KHR/khrplatform.h:247
subtype khronos_ssize_t is long; -- /usr/include/KHR/khrplatform.h:248
subtype khronos_usize_t is unsigned_long; -- /usr/include/KHR/khrplatform.h:249
-- * Float type
--
subtype khronos_float_t is float; -- /usr/include/KHR/khrplatform.h:256
-- Time types
-- *
-- * These types can be used to represent a time interval in nanoseconds or
-- * an absolute Unadjusted System Time. Unadjusted System Time is the number
-- * of nanoseconds since some arbitrary system event (e.g. since the last
-- * time the system booted). The Unadjusted System Time is an unsigned
-- * 64 bit value that wraps back to 0 every 584 years. Time intervals
-- * may be either signed or unsigned.
--
subtype khronos_utime_nanoseconds_t is khronos_uint64_t; -- /usr/include/KHR/khrplatform.h:269
subtype khronos_stime_nanoseconds_t is khronos_int64_t; -- /usr/include/KHR/khrplatform.h:270
-- * Dummy value used to pad enum types to 32 bits.
--
-- * Enumerated boolean type
-- *
-- * Values other than zero should be considered to be true. Therefore
-- * comparisons should not be made against KHRONOS_TRUE.
--
subtype khronos_boolean_enum_t is unsigned;
KHRONOS_FALSE : constant unsigned := 0;
KHRONOS_TRUE : constant unsigned := 1;
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE : constant unsigned := 2147483647; -- /usr/include/KHR/khrplatform.h:290
end KHR_khrplatform_h;
|
tests/exec/rec1.adb | xuedong/mini-ada | 0 | 8715 | <reponame>xuedong/mini-ada
with Ada.Text_IO; use Ada.Text_IO;
procedure Test_a is
procedure R(N: Integer) is
begin
if N = 0 then return; end if;
Put('a');
R(N - 1);
end;
begin
R(42);
New_Line;
end TEST_a;
|
oeis/116/A116423.asm | neoneye/loda-programs | 11 | 103905 | ; A116423: Binomial transform of A006053.
; Submitted by <NAME>(s4)
; 0,1,3,9,26,74,209,588,1651,4631,12983,36388,101972,285741,800660,2243445,6286059,17613241,49351342,138279586,387451077,1085614208,3041824015,8523002359,23880923183,66912861640,187485674652,525323190505,1471922876424,4124236259529,11555853218339,32378781218345,90723328958834,254201118961962,712255707753001,1995696145167284,5591816338448171,15667921210537831,43900539681639527,123006578756496444,344656774770529364,965706823130988597,2705850389455869852,7581624313659984253,21243239263141338859
mov $1,1
lpb $0
sub $0,1
add $2,5
add $3,$1
mov $1,$3
sub $1,$4
add $1,$3
sub $2,5
add $2,$4
mov $4,$2
mov $2,$3
lpe
mov $0,$2
|
Ada/src/Problem_32.adb | Tim-Tom/project-euler | 0 | 6612 | <gh_stars>0
with Ada.Text_IO;
with Ada.Integer_Text_IO;
package body Problem_32 is
package IO renames Ada.Text_IO;
package I_IO renames Ada.Integer_Text_IO;
subtype Digit is Integer range 1 .. 9;
remaining : Array(Digit) of Boolean;
type Part_Name is (Multiplicand_Tens_Digit, Multiplicand_Units_Digit,
Multiplier_Hundreds_Digit, Multiplier_Tens_Digit, Multiplier_Units_Digit);
parts : Array(Part_Name) of Digit;
sum : Integer := 0;
procedure Permute(part : Part_Name) is
begin
for d in Digit'Range loop
if remaining(d) then
remaining(d) := False;
parts(part) := d;
if part = Multiplier_Units_Digit then
declare
multiplicand : constant Integer := 10*parts(Multiplicand_Tens_Digit) + parts(Multiplicand_Units_Digit);
multiplier : constant Integer := 100*parts(Multiplier_Hundreds_Digit) + 10*parts(Multiplier_Tens_Digit) + parts(Multiplier_Units_Digit);
product : constant Integer := multiplicand*multiplier;
product_thousands : constant Natural := product / 1000;
product_hundreds : constant Natural := (product / 100) mod 10;
product_tens : constant Natural := (product / 10) mod 10;
product_ones : constant Natural := product mod 10;
begin
if product < 10_000 and product_thousands > 0 and product_hundreds > 0 and product_tens > 0 and product_ones > 0 then
if remaining(product_thousands) and remaining(product_hundreds) and
remaining(product_tens) and remaining(product_ones) then
if product_thousands /= product_hundreds and product_thousands /= product_tens and product_thousands /= product_ones and
product_hundreds /= product_tens and product_hundreds /= product_ones and
product_tens /= product_ones then
sum := sum + product;
end if;
end if;
end if;
end;
else
Permute(Part_Name'Succ(part));
end if;
remaining(d) := True;
end if;
end loop;
end Permute;
procedure Solve is
begin
for d in Digit'Range loop
remaining(d) := True;
end loop;
Permute(Multiplicand_Tens_Digit);
I_IO.Put(sum);
IO.New_Line;
end Solve;
end Problem_32;
|
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-comlin.adb | djamal2727/Main-Bearing-Analytical-Model | 0 | 1128 | <gh_stars>0
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . C O M M A N D _ L I N E --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System; use System;
package body Ada.Command_Line is
function Arg_Count return Natural;
pragma Import (C, Arg_Count, "__gnat_arg_count");
procedure Fill_Arg (A : System.Address; Arg_Num : Integer);
pragma Import (C, Fill_Arg, "__gnat_fill_arg");
function Len_Arg (Arg_Num : Integer) return Integer;
pragma Import (C, Len_Arg, "__gnat_len_arg");
-----------------------
-- Local Subprograms --
-----------------------
function Initialized return Boolean;
-- Checks to ensure that gnat_argc and gnat_argv have been properly
-- initialized. Returns false if not, or if argv / argc are
-- unsupported on the target (e.g. VxWorks).
--------------
-- Argument --
--------------
function Argument (Number : Positive) return String is
begin
if Number > Argument_Count then
raise Constraint_Error;
end if;
declare
Num : constant Positive :=
(if Remove_Args = null then Number else Remove_Args (Number));
Arg : aliased String (1 .. Len_Arg (Num));
begin
Fill_Arg (Arg'Address, Num);
return Arg;
end;
end Argument;
--------------------
-- Argument_Count --
--------------------
function Argument_Count return Natural is
begin
if not Initialized then
-- RM A.15 (11)
return 0;
end if;
if Remove_Args = null then
return Arg_Count - 1;
else
return Remove_Count;
end if;
end Argument_Count;
-----------------
-- Initialized --
-----------------
function Initialized return Boolean is
gnat_argv : System.Address;
pragma Import (C, gnat_argv, "gnat_argv");
begin
return gnat_argv /= System.Null_Address;
end Initialized;
------------------
-- Command_Name --
------------------
function Command_Name return String is
begin
if not Initialized then
return "";
end if;
declare
Arg : aliased String (1 .. Len_Arg (0));
begin
Fill_Arg (Arg'Address, 0);
return Arg;
end;
end Command_Name;
end Ada.Command_Line;
|
oeis/216/A216706.asm | neoneye/loda-programs | 11 | 243188 | <reponame>neoneye/loda-programs
; A216706: a(n) = Product_{k=1..n} (100 - 10/k).
; Submitted by <NAME>
; 1,90,8550,826500,80583750,7897207500,776558737500,76546504125000,7558967282343750,747497875698437500,74002289694145312500,7332954160601671875000,727184620926332460937500,72159089307305298046875000,7164366724082454591796875000
add $0,1
mov $1,$0
seq $1,25755 ; 10th-order Patalan numbers (generalization of Catalan numbers).
mul $0,$1
|
Ada/inc/Problem_44.ads | Tim-Tom/project-euler | 0 | 177 | <reponame>Tim-Tom/project-euler
package Problem_44 is
procedure Solve;
end Problem_44;
|
Library/Parse/parseWrite.asm | steakknife/pcgeos | 504 | 13502 | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: parseWrite.asm
AUTHOR: <NAME>, Jan 24, 1991
ROUTINES:
Name Description
---- -----------
WriteNegationOp
WriteFunctionCall
WriteSingleToken
WritePercentOp
WriteBinaryOp
WriteCloseFunction
WriteArgEnd
WriteEndOfExpression
AllocateParserToken
REVISION HISTORY:
Name Date Description
---- ---- -----------
John 1/24/91 Initial revision
DESCRIPTION:
Functions to write parser tokens to an output buffer.
$Id: parseWrite.asm,v 1.1 97/04/05 01:27:08 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ParserCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WriteNegationOp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write a negation operator to the output stream.
CALLED BY: ParseFullExpression
PASS: ss:bp = Pointer to ParserParameters
es:di = Pointer to place to write the token
RETURN: carry set on error
es:di = Pointer past inserted token
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/22/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
WriteNegationOp proc near
uses ax, dx
.enter
mov dl, OP_NEGATION ; dl <- operator
mov al, PARSER_TOKEN_OPERATOR ; al <- token type
call AllocateParserToken ; ax <- size of token
jc quit ; Quit if too large
mov es:[di], dl ; The operation to do
add di, ax ; Advance the pointer
clc ; Signal: no error
quit:
.leave
ret
WriteNegationOp endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WriteFunctionCall
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write a function call to the output stream
CALLED BY: ParseFullExpression
PASS: ss:bp = Pointer to ParserParameters
es:di = Pointer to place to write the token
RETURN: carry set on error
es:di = Pointer past inserted token
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/22/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
WriteFunctionCall proc near
uses ax, dx
.enter
mov al, PARSER_TOKEN_FUNCTION ; al <- token type
call AllocateParserToken ; ax <- token size
jc quit ; Quit if error
mov dx,ss:[bp].PP_currentToken.ST_data.STD_identifier.STID_start
mov es:[di], dx ; Save the position of the
; function.
add di, ax ; Advance the pointer
clc ; Signal: no error
quit:
.leave
ret
WriteFunctionCall endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WriteSingleToken
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write a single token to the output stream
CALLED BY: ParseFullExpression, ParseArgList
PASS: ss:bp = Pointer to ParserParameters
es:di = Pointer to place to write the token
RETURN: carry set on error
es:di = Pointer past inserted token
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Possible types are:
Open Paren
Close Paren
Numeric Constant
Cell Reference
Function
Unary Minus Operator
Named Cell or Range
Need to figure out which type we're dealing with and write it
appropriately.
The easiest to deal with is the Unary-Minus, since it's the only
operator.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/22/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
WriteSingleToken proc near
uses ax
.enter
mov al, ss:[bp].PP_currentToken.ST_type
cmp al, SCANNER_TOKEN_STRING ; Strings get handled specially
jne notString ; Branch if not a string
call WriteString ; Handle this separately
jmp quit ; Quit, carry set correctly
notString:
cmp al, SCANNER_TOKEN_OPERATOR ; Check for unary minus.
jne notUnaryMinus ; Branch if not
call WriteNegationOp ; Write unary minus
jmp quit ; Quit, carry set correctly
notUnaryMinus:
;
; The rest of the tokens are the same in the scanner and the parser.
; Allocate space for the token, and if the token is zero sized,
; we can just return (this is true for Open/Close Paren).
;
call AllocateParserToken ; ax <- size of token
jc quit ; Quit if error
tst ax ; Check for zero sized
jz quitNoError ; Branch if zero sized
;
; Token wasn't zero sized. Luckily the data we need for the parser
; is the same as that for the scanner. As a result we can simply
; copy the information from the PP_currentToken into the output
; stream.
; ax = amount of information to copy
;
push cx, ds, si ; Save everything we nuke
mov cx, ax ; cx <- size
segmov ds, ss ; ds <- source
mov si, bp ; si <- source
add si, offset PP_currentToken + offset ST_data
rep movsb ; Copy the data
pop cx, ds, si ; Restore nuked registers
quitNoError:
clc ; Signal: no error
quit:
.leave
ret
WriteSingleToken endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WritePercentOp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write a percent operator to the output stream
CALLED BY: ParseMoreExpression
PASS: ss:bp = Pointer to ParserParameters
es:di = Pointer to place to write the token
RETURN: carry set on error
es:di = Pointer past inserted token
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/22/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
WritePercentOp proc near
uses ax, dx
.enter
mov dl, OP_PERCENT ; dl <- the operator
mov al, PARSER_TOKEN_OPERATOR ; al <- token type
call AllocateParserToken ; ax <- size of token
jc quit ; Quit if too large
mov es:[di], dl ; The operation to do
add di, ax ; Advance the pointer
clc ; Signal: no error
quit:
.leave
ret
WritePercentOp endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WriteBinaryOp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write a binary operator to the output stream
CALLED BY: ParseMoreExpression
PASS: ss:bp = Pointer to ParserParameters
es:di = Pointer to place to write the token
RETURN: carry set on error
es:di = Pointer past inserted token
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
First check to see if it's one of those "undecided" operators
OP_PERCENT_MODULO (%) Force to OP_MODULO
OP_SUBTRACTION_NEGATION (-) Force to OP_SUBTRACTION
All others are by nature binary operators so we can just stuff
them directly into the operatorID field.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/22/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
WriteBinaryOp proc near
uses ax, dx
.enter
mov dl,ss:[bp].PP_currentToken.ST_data.STD_operator.STOD_operatorID
mov al, PARSER_TOKEN_OPERATOR ; al <- token type
call AllocateParserToken ; ax <- size
jc quit ; Quit if error
cmp dl, OP_PERCENT_MODULO ; Check for modulo op
jne checkSubNeg ; Branch if not
mov dl, OP_MODULO ; Choose the binary operator
jmp writeOp ; Branch
checkSubNeg:
cmp dl, OP_SUBTRACTION_NEGATION ; Check for subtraction
jne writeOp ; Branch if not
mov dl, OP_SUBTRACTION ; Force to subtraction
writeOp:
mov es:[di].PTOD_operatorID, dl ; Write the operator ID
add di, ax ; Advance the pointer
clc ; Signal: no error
quit:
.leave
ret
WriteBinaryOp endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WriteCloseFunction
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write a close-function to the output stream
CALLED BY: ParseFunctionArgs
PASS: ss:bp = Pointer to ParserParameters
es:di = Pointer to place to write the token
RETURN: carry set on error
es:di = Pointer past inserted token
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/22/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
WriteCloseFunction proc near
uses ax
.enter
mov al, PARSER_TOKEN_CLOSE_FUNCTION
call AllocateParserToken ; Should return 0...
.leave
ret
WriteCloseFunction endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WriteArgEnd
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write an arg-end token to the output stream
CALLED BY: ParseArgList
PASS: ss:bp = Pointer to ParserParameters
es:di = Pointer to place to write the token
RETURN: carry set on error
es:di = Pointer past inserted token
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/22/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
WriteArgEnd proc near
uses ax
.enter
mov al, PARSER_TOKEN_ARG_END
call AllocateParserToken ; Should return 0
.leave
ret
WriteArgEnd endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WriteString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write a string to the parser output stream.
CALLED BY: ParseArgList
PASS: es:di = Place to write to
ds = Segment address of the string
ss:bp = ParserParameters including currentToken
RETURN: es:di = Position after the token written
carry set on error
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/21/91 Initial version
witt 11/29/93 DBCS-ized
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
WriteString proc near
uses ax, cx, si
.enter
mov al, PARSER_TOKEN_STRING ; al <- token type
call AllocateParserToken ; ax <- token size
jc quit ; Quit if error
mov cx, ss:[bp].PP_currentToken.ST_data.STD_string.STSD_length
mov es:[di].PTSD_length, cx
add di, ax ; Advance the pointer
;
; Since this is a variable sized data-item we need to make sure
; we aren't going to overwrite the end of the buffer.
;
SBCS< mov ax, ss:[bp].PP_currentToken.ST_data.STD_string.STSD_length >
DBCS< mov ax, cx ; this is faster! >
DBCS< shl ax, 1 ; ax <- string size >
sub ss:[bp].PP_parserBufferSize, ax
js bufferOverflow ; Branch if overflow
;
; Now copy the text of the string.
;
mov si, ss:[bp].PP_currentToken.ST_data.STD_string.STSD_start
add si, ss:[bp].PP_textPtr.offset ; si <- offset to string
EC < push ax ;>
EC < mov ax, ds ;ax <- seg addr of string>
EC < cmp ax, ss:[bp].PP_textPtr.segment ;>
EC < ERROR_NE PARSE_STRING_SEGMENT_FAILED_ASSERTION >
EC < pop ax
LocalCopyNString ; Copy the string (cx=length)
clc ; Signal: no error
quit:
.leave
ret
bufferOverflow:
mov al, PSEE_TOO_MANY_TOKENS
call ParserReportError ; Report the error
jmp quit
WriteString endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WriteEndOfExpression
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write an end-of-expression marker to the parser stream
CALLED BY: ParseArgList
PASS: es:di = Place to write to
ss:bp = ParserParameters including currentToken
RETURN: es:di = Position after the token written
carry set on error
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/21/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
WriteEndOfExpression proc near
uses ax
.enter
mov al, PARSER_TOKEN_END_OF_EXPRESSION
call AllocateParserToken ; Should return 0
.leave
ret
WriteEndOfExpression endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
AllocateParserToken
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Allocate space for a single token in the output stream
CALLED BY: Write*
PASS: al = ParserTokenType
ss:bp = Pointer to ParserParameters
es:di = Pointer to place to write
RETURN: carry set on error
token type saved into the buffer
ax = Size of the token data
es:di = Pointer to place to put the token data
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
The amount of data to write is implied by the token-type.
We keep a table of the sizes in parserTokenSizeTable in
the file parseVariable.asm
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/22/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
AllocateParserToken proc near
uses cx, ds, si
.enter
mov cl, al ; Save token in cl
clr ah ; ax <- token
FXIP < mov si, bx >
FXIP < mov bx, handle dgroup >
FXIP < call MemDerefDS ; ds = dgroup >
FXIP < mov bx, si >
NOFXIP< segmov ds, dgroup, si ; ds <- seg addr of table >
mov si, offset parserTokenSizeTable ; si <- offset to table
add si, ax ; si <- offset to item
mov al, ds:[si] ; ax <- size of token
;
; Now that we have the size of the token, we need to lose that
; much space from the buffer we are writing to.
;
sub ss:[bp].PP_parserBufferSize, ax
js bufferOverflow ; Branch if overflow
;
; Subtract a byte for the token itself.
;
dec ss:[bp].PP_parserBufferSize
js bufferOverflow
mov es:[di], cl ; Save the token
inc di ; Advance the pointer
clc ; Signal: no error
quit:
.leave
ret
bufferOverflow:
mov al, PSEE_TOO_MANY_TOKENS
call ParserReportError ; Report the error
jmp quit
AllocateParserToken endp
ParserCode ends
|
oeis/303/A303915.asm | neoneye/loda-programs | 11 | 8034 | <filename>oeis/303/A303915.asm
; A303915: a(n) = lambda(n)*E(n), where lambda(n) = A008836(n) and E(n) = A005361(n).
; Submitted by <NAME>
; 1,-1,-1,2,-1,1,-1,-3,2,1,-1,-2,-1,1,1,4,-1,-2,-1,-2,1,1,-1,3,2,1,-3,-2,-1,-1,-1,-5,1,1,1,4,-1,1,1,3,-1,-1,-1,-2,-2,1,-1,-4,2,-2,1,-2,-1,3,1,3,1,1,-1,2,-1,1,-2,6,1,-1,-1,-2,1,-1,-1,-6,-1,1,-2,-2,1,-1,-1,-4,4,1,-1
add $0,1
mov $1,1
lpb $0
mov $3,$0
lpb $3
mov $4,$0
mov $7,$2
cmp $7,0
add $2,$7
mod $4,$2
cmp $4,0
cmp $4,0
mov $5,$2
add $2,1
cmp $5,1
max $4,$5
sub $3,$4
mov $6,1
lpe
cmp $5,2
sub $6,2
lpb $0
dif $0,$2
dif $1,$6
add $5,1
lpe
mul $1,$5
lpe
mov $0,$1
|
thirdparty/glut/progs/ada/texturesurf_procs.adb | ShiroixD/pag_zad_2 | 1 | 27602 | <gh_stars>1-10
--
-- (c) Copyright 1993,1994,1995,1996 Silicon Graphics, Inc.
-- ALL RIGHTS RESERVED
-- Permission to use, copy, modify, and distribute this software for
-- any purpose and without fee is hereby granted, provided that the above
-- copyright notice appear in all copies and that both the copyright notice
-- and this permission notice appear in supporting documentation, and that
-- the name of Silicon Graphics, Inc. not be used in advertising
-- or publicity pertaining to distribution of the software without specific,
-- written prior permission.
--
-- THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
-- AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
-- INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
-- FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-- GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
-- SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
-- KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
-- LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
-- THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
-- ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
-- ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
-- POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
--
-- US Government Users Restricted Rights
-- Use, duplication, or disclosure by the Government is subject to
-- restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
-- (c)(1)(ii) of the Rights in Technical Data and Computer Software
-- clause at DFARS 252.227-7013 and/or in similar or successor
-- clauses in the FAR or the DOD or NASA FAR Supplement.
-- Unpublished-- rights reserved under the copyright laws of the
-- United States. Contractor/manufacturer is Silicon Graphics,
-- Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
--
-- OpenGL(TM) is a trademark of Silicon Graphics, Inc.
--
with System; use System;
with GL; use GL;
with Ada.Numerics; use Ada.Numerics;
with Ada.Numerics.Generic_Elementary_Functions;
package body Texturesurf_Procs is
package GLdouble_GEF is new
Generic_Elementary_Functions (GLfloat);
use GLdouble_GEF;
ctrlpoints : array (0 .. 3, 0 .. 3, 0 .. 2) of aliased GLfloat :=
(((-1.5, -1.5, 4.0), (-0.5, -1.5, 2.0),
(0.5, -1.5, -1.0), (1.5, -1.5, 2.0)),
((-1.5, -0.5, 1.0), (-0.5, -0.5, 3.0),
(0.5, -0.5, 0.0), (1.5, -0.5, -1.0)),
((-1.5, 0.5, 4.0), (-0.5, 0.5, 0.0),
(0.5, 0.5, 3.0), (1.5, 0.5, 4.0)),
((-1.5, 1.5, -2.0), (-0.5, 1.5, -2.0),
(0.5, 1.5, 0.0), (1.5, 1.5, -1.0)));
texpts : array (0 .. 1, 0 .. 1, 0 .. 1) of aliased GLfloat :=
(((0.0, 0.0), (0.0, 1.0)), ((1.0, 0.0), (1.0, 1.0)));
imageWidth : constant := 64;
imageHeight : constant := 64;
image : array (Integer range 0 .. (3*imageWidth*imageHeight))
of aliased GLubyte;
procedure makeImage is
ti, tj : GLfloat;
begin
for i in 0 .. (imageWidth - 1) loop
ti := 2.0*Pi*GLfloat (i)/GLfloat (imageWidth);
for j in 0 .. (imageHeight - 1) loop
tj := 2.0*Pi*GLfloat (j)/GLfloat (imageHeight);
image (3 * (imageHeight * i + j)) :=
GLubyte (127.0 * (1.0 + Sin (ti)));
image (3 * (imageHeight * i + j) + 1) :=
GLubyte (127.0 * (1.0 + Cos (2.0 * tj)));
image (3 * (imageHeight * i + j) + 2) :=
GLubyte (127.0 * (1.0 + Cos (ti + tj)));
end loop;
end loop;
end makeImage;
procedure DoInit is
begin
glMap2f (GL_MAP2_VERTEX_3, 0.0, 1.0, 3, 4,
0.0, 1.0, 12, 4, ctrlpoints (0, 0, 0)'Access);
glMap2f (GL_MAP2_TEXTURE_COORD_2, 0.0, 1.0, 2, 2,
0.0, 1.0, 4, 2, texpts (0, 0, 0)'Access);
glEnable (GL_MAP2_TEXTURE_COORD_2);
glEnable (GL_MAP2_VERTEX_3);
glMapGrid2f (20, 0.0, 1.0, 20, 0.0, 1.0);
makeImage;
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexImage2D (GL_TEXTURE_2D, 0, 3, imageWidth, imageHeight, 0,
GL_RGB, GL_UNSIGNED_BYTE, image(0)'Access);
glEnable (GL_TEXTURE_2D);
glEnable (GL_DEPTH_TEST);
glEnable (GL_NORMALIZE);
glShadeModel (GL_FLAT);
end DoInit;
procedure DoDisplay is
begin
glClear (GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
glColor3f (1.0, 1.0, 1.0);
glEvalMesh2 (GL_FILL, 0, 20, 0, 20);
glFlush;
end DoDisplay;
procedure ReshapeCallback (w : Integer; h : Integer) is
begin
glViewport (0, 0, GLsizei(w), GLsizei(h));
glMatrixMode (GL_PROJECTION);
glLoadIdentity;
if w <= h then
glOrtho (-4.0, 4.0, GLdouble (-4.0*GLdouble (h)/GLdouble (w)),
GLdouble (4.0*GLdouble (h)/GLdouble (w)), -4.0, 4.0);
else
glOrtho ((-4.0*GLdouble (w)/GLdouble (h)),
GLdouble (4.0*GLdouble (w)/GLdouble (h)), -4.0, 4.0, -4.0, 4.0);
end if;
glMatrixMode (GL_MODELVIEW);
glLoadIdentity;
glRotatef (85.0, 1.0, 1.0, 1.0);
end ReshapeCallback;
end Texturesurf_Procs;
|
programs/oeis/172/A172104.asm | karttu/loda | 0 | 247733 | ; A172104: Partial sums of A167021 where A167021(n)=1 iff 6*n+1 is prime.
; 1,2,3,3,4,5,6,6,6,7,8,9,10,10,10,11,12,13,13,13,14,14,15,15,16,17,18,18,18,19,19,20,21,21,22,22,23,24,24,25,25,25,25,25,26,27,28,28,28,28,29,30,30,30,31,32,32,33,33,33,34,35,36,36,36,37,37,38,38,39,39,40,41
mov $2,$0
add $2,1
mov $4,$0
lpb $2,1
mov $0,$4
sub $2,1
sub $0,$2
add $0,1
mul $0,6
cal $0,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
add $0,3
mov $3,$0
sub $3,3
add $1,$3
lpe
|
src/apsepp-output_class-quiet-create.adb | thierr26/ada-apsepp | 0 | 28263 | -- Copyright (C) 2019 <NAME> <<EMAIL>>
-- MIT license. Please refer to the LICENSE file.
function Apsepp.Output_Class.Quiet.Create return Output_Quiet is
begin
return (Output_Interfa with null record);
end Apsepp.Output_Class.Quiet.Create;
|
PIC16/assy/a2d.asm | Classrooms/Microcontrollers | 1 | 29128 | <gh_stars>1-10
; *******************************************************************
; Lesson 4 - "Analog to Digital"
;
; This shows how to read the A2D converter and display the
; High order parts on the 4 bit LED display.
; The pot on the Low Pin Count Demo board varies the voltage
; coming in on in A0.
;
; The A2D is referenced to the same Vdd as the device, which
; is nominally is 5V. The A2D returns the ratio of the voltage
; on Pin RA0 to 5V. The A2D has a resolution of 10 bits, with 1024
; representing 5V and 0 representing 0V.
;
;
; The top four MSbs of the ADC are mirrored onto the LEDs. Rotate the potentiometer
; to change the display.
;
;
; PIC: 16F1829
; Assembler: MPASM v5.43
; IDE: MPLABX v1.10
;
; Board: PICkit 3 Low Pin Count Demo Board
; Date: 6.1.2012
;
; *******************************************************************
; * See Low Pin Count Demo Board User's Guide for Lesson Information*
; *******************************************************************
#include <p16F1829.inc>
__CONFIG _CONFIG1, (_FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOREN_ON & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF);
__CONFIG _CONFIG2, (_WRT_OFF & _PLLEN_OFF & _STVREN_OFF & _LVP_OFF);
errorlevel -302 ;supress the 'not in bank0' warning
; -------------------LATC-----------------
; Bit#: -7---6---5---4---3---2---1---0---
; LED: ---------------|DS4|DS3|DS2|DS1|-
; -----------------------------------------
ORG 0 ;start of code at address 0x0000
Start:
;Setup main init
banksel OSCCON ;bank1
movlw b'00111000' ;set cpu clock speed
movwf OSCCON ;move contents of the working register into OSCCON
;Configure the ADC/Potentimator
;already in bank1
bsf TRISA, 4 ;Potentimator is connected to RA4....set as input
movlw b'00001101' ;select RA4 as source of ADC and enable the module (carefull, this is actually AN3)
movwf ADCON0
movlw b'00010000' ;left justified - Fosc/8 speed - vref is Vdd
movwf ADCON1
banksel ANSELA ;bank3
bsf ANSELA, 4 ;analog for ADC
;Configure the LEDs
banksel TRISC ;bank1
clrf TRISC ;make all of PORTC an output
banksel LATC ;select the bank where LATC is
movlw b'00001000' ;start the rotation by setting DS1 ON
movwf LATC ;write contents of the working register to the latch
MainLoop:
;Start the ADC
nop ;requried ADC delay of 8uS => (1/(Fosc/4)) = (1/(500KHz/4)) = 8uS
banksel ADCON0
bsf ADCON0, GO ;start the ADC
btfsc ADCON0, GO ;this bit will be cleared when the conversion is complete
goto $-1 ;keep checking the above line until GO bit is clear
;Grab Results and write to the LEDs
swapf ADRESH, w ;Get the top 4 MSbs (remember that the ADC result is LEFT justified!)
banksel LATC
movwf LATC ;move into the LEDs
bra MainLoop
end ;end code |
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c37208a.ada | best08618/asylo | 7 | 12573 | -- C37208A.ADA (RA #534/1)
-- 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.
--*
-- FOR A TYPE WITH DEFAULT DISCRIMINANT VALUES, CHECK THAT A
-- DISCRIMINANT CONSTRAINT CAN BE OMITTED IN:
-- AN OBJECT DECLARATION, AND HENCE ASSIGNMENTS TO THE OBJECT CAN
-- CHANGE ITS DISCRIMINANTS;
-- A COMPONENT_DECLARATION IN A RECORD TYPE DEFINITION, AND HENCE
-- ASSIGNMENTS TO THE COMPONENT CAN CHANGE THE VALUE OF ITS
-- DISCRIMINANTS;
-- A SUBTYPE INDICATION IN AN ARRAY TYPE DEFINITION, AND HENCE
-- ASSIGNMENTS TO ONE OF THE COMPONENTS CAN CHANGE ITS
-- DISCRIMINANT VALUES;
-- A FORMAL PARAMETER OF A SUBPROGRAM; EXCEPT FOR PARAMETERS OF
-- MODE IN, THE 'CONSTRAINED ATTRIBUTE OF THE ACTUAL PARAMETER
-- BECOMES THE 'CONSTRAINED ATTRIBUTE OF THE FORMAL PARAMETER;
-- FOR IN OUT AND OUT PARAMETERS, IF THE 'CONSTRAINED ATTRIBUTE IS
-- FALSE, ASSIGNMENTS TO THE FORMAL PARAMETER CAN CHANGE THE
-- DISCRIMINANTS OF THE ACTUAL PARAMETER; IF THE 'CONSTRAINED
-- ATTRIBUTE IS TRUE, ASSIGNNMENTS THAT ATTEMPT TO CHANGE THE
-- DISCRIMINANTS OF THE ACTUAL PARAMETER RAISE CONSTRAINT_ERROR.
-- ASL 7/23/81
-- EDS 7/16/98 AVOID OPTIMIZATION
WITH REPORT;
PROCEDURE C37208A IS
USE REPORT;
BEGIN
TEST ("C37208A","DISCRIMINANT CONSTRAINT CAN BE OMITTED " &
"FROM OBJECT DECLARATION, COMPONENT DECLARATION, SUBTYPE " &
"INDICATION OR FORMAL SUBPROGRAM PARAMETER, IF THE TYPE " &
"HAS DEFAULT DISCRIMINANTS");
DECLARE
TYPE REC1(DISC : INTEGER := 7) IS
RECORD
NULL;
END RECORD;
TYPE REC2 IS
RECORD
COMP : REC1;
END RECORD;
R : REC2;
U1,U2,U3 : REC1 := (DISC => 3);
C1,C2,C3 : REC1(3) := (DISC => 3);
ARR : ARRAY(INTEGER RANGE 1..10) OF REC1;
ARR2 : ARRAY (1..10) OF REC1(4);
PROCEDURE PROC(P_IN : IN REC1;
P_OUT : OUT REC1;
P_IN_OUT : IN OUT REC1;
CONSTR : IN BOOLEAN) IS
BEGIN
IF P_OUT'CONSTRAINED /= CONSTR
OR P_IN_OUT'CONSTRAINED /= CONSTR THEN
FAILED ("CONSTRAINED ATTRIBUTES DO NOT MATCH " &
"FOR ACTUAL AND FORMAL PARAMETERS");
END IF;
IF P_IN'CONSTRAINED /= IDENT_BOOL(TRUE) THEN
FAILED ("'CONSTRAINED IS FALSE FOR IN " &
"PARAMETER");
END IF;
IF NOT CONSTR THEN -- UNCONSTRAINED ACTUAL PARAM
P_OUT := (DISC => IDENT_INT(0));
P_IN_OUT := (DISC => IDENT_INT(0));
ELSE
BEGIN
P_OUT := (DISC => IDENT_INT(0));
FAILED ("DISCRIMINANT OF CONSTRAINED ACTUAL " &
"PARAMETER ILLEGALLY CHANGED - 1");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION - 1");
END;
BEGIN
P_IN_OUT := (DISC => IDENT_INT(0));
FAILED ("DISCRIMINANT OF CONSTRAINED ACTUAL " &
"PARAMETER ILLEGALLY CHANGED - 2");
EXCEPTION
WHEN CONSTRAINT_ERROR => NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION - 2");
END;
END IF;
END PROC;
BEGIN
IF U1.DISC /= IDENT_INT(3) THEN
FAILED ("INITIAL DISCRIMINANT VALUE WRONG - U1");
END IF;
U1 := (DISC => IDENT_INT(5));
IF U1.DISC /= 5 THEN
FAILED ("ASSIGNMENT FAILED FOR OBJECT");
END IF;
IF R.COMP.DISC /= IDENT_INT(7) THEN
FAILED ("DEFAULT DISCRIMINANT VALUE WRONG - R");
END IF;
R.COMP := (DISC => IDENT_INT(5));
IF R.COMP.DISC /= 5 THEN
FAILED ("ASSIGNMENT FAILED FOR RECORD COMPONENT");
END IF;
FOR I IN 1..10 LOOP
IF ARR(I).DISC /= IDENT_INT(7) THEN
FAILED ("DEFAULT DISCRIMINANT VALUE WRONG - ARR");
END IF;
END LOOP;
ARR(3) := (DISC => IDENT_INT(5));
IF ARR(3).DISC /= 5 THEN
FAILED ("ASSIGNMENT FAILED FOR ARRAY COMPONENT");
END IF;
IF ARR /= (1..2|4..10 => (DISC => 7), 3 => (DISC => 5)) THEN
FAILED ("MODIFIED WRONG COMPONENTS");
END IF;
PROC(C1,C2,C3,IDENT_BOOL(TRUE));
PROC(U1,U2,U3,IDENT_BOOL(FALSE));
IF U2.DISC /= 0 OR U3.DISC /= 0 THEN
FAILED ("ASSIGNMENT TO UNCONSTRAINED ACTUAL PARAMETER " &
"FAILED TO CHANGE DISCRIMINANT");
END IF;
PROC(ARR(1), ARR(3), ARR(4), FALSE);
IF ARR(3).DISC /= 0 OR ARR(4).DISC /= 0 THEN
FAILED ("ARRAY COMPONENT ASSIGNMENTS DIDN'T CHANGE " &
"DISCRIMINANT OF COMPONENT");
END IF;
PROC (ARR2(2), ARR2(5), ARR2(10), TRUE);
END;
RESULT;
END C37208A;
|
src/MLib.agda | bch29/agda-matrices | 0 | 13272 | <gh_stars>0
module MLib where
import MLib.Prelude
import MLib.Fin.Parts
import MLib.Fin.Parts.Simple
import MLib.Finite
import MLib.Finite.Properties
import MLib.Algebra.PropertyCode
import MLib.Matrix
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.