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
components/src/screen/lcd/lcd_hd44780-pcf8574.ads
RREE/Ada_Drivers_Library
0
16045
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2022, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- driver for text based LCDs connected via I2C port expander PCF8574 with HAL.Time; with PCF8574; package LCD_HD44780.PCF8574 is -- Describe the internal wiring between the PCF8574 output pins -- and the HD44780 input pins. The PCF8574 pins are the bit numbers. type Bit_Number is range 0 .. 7; type Bit_Mapping is array (HD44780_4bit_Pins) of Bit_Number; Standard_Mapping : constant Bit_Mapping := (Enable => 2, ReadWrite => 1, RegSel => 0, Backlight => 3, D0 => 4, D1 => 5, D2 => 6, D3 => 7); type LCD_PCF8574 (Display_Width : Char_Position; Display_Height : Line_Position; Time : not null HAL.Time.Any_Delays) is limited new LCD_Module with private; function Create (Display_Width : Char_Position; Display_Height : Line_Position; Time : not null HAL.Time.Any_Delays; Expander : Standard.PCF8574.Any_PCF8574_Module; Mapping : Bit_Mapping := Standard_Mapping) return LCD_PCF8574; overriding procedure Set_Backlight (This : in out LCD_PCF8574; Is_On : Boolean := True); private type LCD_PCF8574 (Display_Width : Char_Position; Display_Height : Line_Position; Time : not null HAL.Time.Any_Delays) is limited new LCD_Module (Display_Width, Display_Height, Time) with record I2C_Driver : Standard.PCF8574.Any_PCF8574_Module; Pins : Bit_Mapping; end record; overriding procedure Toggle_Enable (This : LCD_PCF8574); overriding procedure Output (This : LCD_PCF8574; Cmd : UInt8; Is_Data : Boolean := False); overriding procedure Init_4bit_Mode (This : LCD_PCF8574); end LCD_HD44780.PCF8574;
src/pp/block3/cc/symbol/DeclUse.g4
Pieterjaninfo/PP
0
4815
<reponame>Pieterjaninfo/PP grammar DeclUse; //@header{package pp.block3.cc.symbol;} program : '(' series ')' ; series : unit* ; unit : decl #decUnit | use #useUnit | '(' series ')' #seriesUnit ; decl : 'D:' ID ; use : 'U:' ID ; ID : [a-zA-Z]+; WS : [ \t\n\r]+ -> skip;
codigo/capitulo 39/archivo_actualizacion.asm
Nabucodonosor-editorial/ensamblador-x86
2
174747
segment .data MsgError db "se produjo un error",0xA,0xD ;mensaje en caso de ; existir un error al crear el archivo los numeros ; hexadecimales son equivalentes a los numeros decimales ; 10 y 13 los cuales permiten el salto de linea lon equ $ -MsgError MsgExito db "archivo abierto con exito",0xA,0xD lonexito equ $ -MsgExito mensajearchivo db "hola archivo" lonmensaje equ $ -mensajearchivo archivo db "/home/neomatrix/codigo ensamblador/prueba.txt",0 ; ubicacion en el sistema de archivos del archivo a crear y ; y su nombre (prueba.txt), se usa el 0 como indicador ; de fin de cadena segment .bss idarchivo resd 1 segment .text global _start _start: ; abrimos el archivo mov eax,5 ; indicamos que abriremos un archivo mov ebx,archivo ; indicamos la ruta y el nombre del archivo mov ecx, 2; indicamos el modo de apertura del archivo ; solo lectura = 0 ; solo escritura = 1 ; lectura/escritura = 2 int 80h cmp eax,0 ; el descriptor de archivo es un numero entero ; no negativo jl error ; de ser negativo ha ocurrido un error mov dword[idarchivo] , eax ; guardamos el descriptor del archivo ; en memoria, para su uso posterior mov eax, 4 mov ebx, 1 mov ecx, MsgExito mov edx, lonexito int 80h ;desplazamiento del puntero del archivo mov eax, 19 ; indicamos que desplazaremos el puntero mov ebx, [idarchivo] ; colocamos el descriptor del archivo mov ecx, 5 ; especificamos el numero de bytes que desplazaremos ; el puntero del archivo mov edx, 0 ; establecemos desde donde moveremos el puntero ; del archivo ; 0 = desde el inicio del archivo ; 1 = desde la posicion actual del puntero ; 2 = desde el final del archivo int 80h ;escritura de contenido en el archivo mov eax, 4 ; indicamos que escribiremos contenido mov ebx, [idarchivo] ; colocamos el descriptor del archivo mov ecx, mensajearchivo ; especificamos la ubicacion de memoria ; de donde se obtendran los datos a escribir en el archivo mov edx, lonmensaje ; establecemos la cantidad de bytes a escribir ; en el archivo int 80h ;cierre del archivo mov eax, 6 mov ebx, [idarchivo] ; colocamos el descriptor de archivo int 80h jmp salir error: ; Mostramos el mensaje de error mov eax, 4 mov ebx, 1 mov ecx, MsgError mov edx, lon int 80h salir: mov eax, 1 xor ebx,ebx int 0x80
libsrc/spectrum/if1_write_sector.asm
dex4er/deb-z88dk
1
98035
; ; ZX IF1 & Microdrive functions ; ; int if1_write_sector (int drive, int sector, struct M_CHAN buffer); ; ; Writes the specified sector to the specified drive. ; ; ; $Id: if1_write_sector.asm,v 1.4 2007/07/07 14:26:48 stefano Exp $ ; XLIB if1_write_sector LIB if1_rommap XREF MAKE_M XREF MOTOR if1_write_sector: call if1_rommap ld ix,2 add ix,sp ld a,(ix+4) ld hl,-1 and a ; drive no. = 0 ? ret z ; yes, return -1 dec a cp 8 ; drive no. >8 ? ret nc ; yes, return -1 inc a push af ld a,(ix+2) ; sector number push af ld l,(ix+0) ; buffer ld h,(ix+1) ld (mdvbuffer+1),hl ; Self modifying code :oP call MAKE_M pop af ; sector number ld (ix+0Dh),a ; CHREC pop af ld (ix+19h),A ; CHDRIV call MOTOR ld hl,-1 IF !OLDIF1MOTOR ret nz ; microdrive not present ENDIF in a,($ef) and 1 ; test the write-protect tab ret z ; drive 'write' protected push ix pop hl ld de,37h ; point to 12 bytes of data block preamble add hl,de push hl mdvbuffer: ld hl,0 add hl,de pop de ld bc,21ch ldir set 0,(ix+18h) ; set CHFLAG to "write" mode call 1 RST 8 defb 22h ; Open a temp "M" channel rst 8 defb 2Ah ; Write a sector to drive xor a rst 8 defb 21h ; Switch microdrive motor off (a=0) RST 8 defb 2Ch ; Reclaim an "M" channel ld hl,0 ret
cohesion/david_jaz_261/old/Sharp.agda
glangmead/formalization
6
1567
<reponame>glangmead/formalization {-# OPTIONS --without-K --rewriting #-} module old.Sharp where open import Basics open import Flat open import lib.Equivalence2 {- I want sthing like this record ♯ {@♭ l : ULevel} (A : Type l) : Type l where constructor _^♯ field _/♯ :{♭} A open ♯ publ -} -- Following Licata postulate -- Given a type A, ♯ A is a type ♯ : {i : ULevel} → Type i → Type i -- Given an element a : A, we have an element ♯i a : ♯ A ♯i : {i : ULevel} {A : Type i} → A → ♯ A -- To map out of ♯ A into some type ♯ (B a) depending on it, you may just map out of A. ♯-elim : {i j : ULevel} {A : Type i} (B : ♯ A → Type j) → ((a : A) → ♯ (B (♯i a))) → ((a : ♯ A) → ♯ (B a)) -- The resulting map out of ♯ A ``computes'' to the original map out of A on ♯i ♯-elim-β : {i j : ULevel} {A : Type i} {B : ♯ A → Type j} (f : (a : A) → ♯ (B (♯i a))) (a : A) → (♯-elim B f (♯i a)) ↦ (f a) {-# REWRITE ♯-elim-β #-} -- The type of equalities in a codiscrete type are codiscrete ♯path : {i : ULevel} {A : Type i} {x y : ♯ A} → (♯i {A = x == y}) is-an-equiv -- Given a crisp map into ♯ B, we get a cohesive map into it -- This encodes the adjunction between ♭ and ♯ on the level of types. uncrisp : {@♭ i : ULevel} {j : ULevel} {@♭ A : Type i} (B : A → Type j) → ((@♭ a : A) → ♯ (B a)) → (a : A) → ♯ (B a) -- If we uncrispen a function and then apply it to a crisp variable, we get the original result judgementally uncrisp-β : {@♭ i : ULevel} {j : ULevel} {@♭ A : Type i} (B : A → Type j) → (f : (@♭ a : A) → ♯ (B a)) → (@♭ a : A) → (uncrisp B f a) ↦ (f a) {-# REWRITE uncrisp-β #-} -- We can pull crisp elements out of ♯ A ♭♯e : {@♭ i : ULevel} {@♭ A : Type i} → ♯ A ::→ A -- If we take a crisp element of A, put it into ♯ A, and pull it out again, we get where we were judgementally ♭♯β : {@♭ i : ULevel} {@♭ A : Type i} (@♭ a : A) → (♭♯e (♯i a)) ↦ a {-# REWRITE ♭♯β #-} -- If we pull out a crisp element of ♯ A and then put it back in, we get back where we were -- Not sure why this isn't judgemental. ♭♯η : {@♭ i : ULevel} {@♭ A : Type i} (@♭ a : ♯ A) → a == ♯i (♭♯e a) -- We also posulate the half-adjoint needed for this to be a coherent adjunction. ♭♯η-▵ : {@♭ i : ULevel} {@♭ A : Type i} (@♭ a : A) → ♭♯η (♯i a) == refl ♯path-eq : {i : ULevel} {A : Type i} {x y : ♯ A} → (x == y) ≃ (♯ (x == y)) ♯path-eq = ♯i , ♯path ♯-rec : {i j : ULevel} {A : Type i} {B : Type j} → (A → ♯ B) → (♯ A → ♯ B) ♯-rec {B = B} = ♯-elim (λ _ → B) {- Given a family B : (@♭ a : A) → Type j crisply varying over A, we can form the family B' ≡ (λ (@♭ a : A) → ♯ (B a)). According to Shulman, we should be able to then get a cohesive variation B'' : (a : A) → Type j with the property that if (@♭ a : A) , B'' a ≡ B' a Or, shorter, from B : (@♭ a : A) → Type j, we should get C : (a : A) → Type j with the property that for (@♭ a : A), C a ≡ ♯ (B a) The signature of the operation B ↦ C must be ((@♭ a : A) → Type j) → (a : A) → Type j. Unfortunately, this doesn't tell us anything about where its landing -} postulate ♯' : {@♭ @♭ i : ULevel} {Γ : Type i} {j : ULevel} (A : Γ ::→ Type j) → Γ → Type j ♯'-law : {@♭ @♭ i : ULevel} {Γ : Type i} {j : ULevel} (A : Γ ::→ Type j) (@♭ x : Γ) → (♯' A) x ↦ ♯ (A x) {-# REWRITE ♯'-law #-} {- Here, we define let notations for ♯ to approximate the upper and lower ♯s that Shulman uses in his paper. We also define versions of the eliminator and uncrisper that take an implicit family argument, so we can use the let notation without explicitly noting the family. -} syntax ♯-elim B (λ u → t) a = let♯ a :=♯i u in♯ t in-family B syntax uncrisp B (λ u → t) a = let♯ a ↓♯:= u in♯ t in-family B ♯-elim' : {i j : ULevel} {A : Type i} {B : ♯ A → Type j} → ((a : A) → ♯ (B (♯i a))) → (a : ♯ A) → ♯ (B a) ♯-elim' {B = B} f = ♯-elim B f syntax ♯-elim' (λ u → t) a = let♯ a :=♯i u in♯ t uncrisp' : {@♭ i : ULevel} {j : ULevel} {@♭ A : Type i} {B : A → Type j} → (f : (@♭ a : A) → ♯ (B a)) → (a : A) → ♯ (B a) uncrisp' {B = B} f = uncrisp B f syntax uncrisp' (λ u → t) a = let♯ u := a ↓♯in♯ t -- A type A is codiscrete if the counit ♯i : A → ♯ A is an equivalence. _is-codiscrete : {i : ULevel} (A : Type i) → Type i _is-codiscrete {i} A = (♯i {A = A}) is-an-equiv -- To prove a type is an equivalence, it suffices to give a retract of ♯i _is-codiscrete-because_is-retract-by_ : {i : ULevel} (A : Type i) (r : ♯ A → A) (p : (a : A) → r (♯i a) == a) → A is-codiscrete A is-codiscrete-because r is-retract-by p = (♯i {A = A}) is-an-equivalence-because r is-inverse-by (λ a → -- Given an a : ♯ A, (let♯ a :=♯i b in♯ -- We suppose a is ♯i b (♯i (ap ♯i (p b))) -- apply p to b to get r (♯i b) == b, -- then apply ♯i to get ♯i r ♯i b == ♯i b -- then hit it with ♯i to get ♯ (♯i r ♯i b == ♯i b) in-family (λ (b : ♯ A) → ♯i (r b) == b) -- which is ♯ (♯i r a == a) by our hypothesis, ) |> (<– ♯path-eq) -- and we can strip the ♯ becacuse equality types are codiscrete. ) and p -- (λ a → (<– ♯path-eq) ((♯-elim (λ (b : ♯ A) → ♯i (r b) == b) -- (λ b → ♯i (ap ♯i (p b)))) a)) ♯→ : {i j : ULevel} {A : Type i} {B : Type j} (f : A → B) → (♯ A) → (♯ B) ♯→ {A = A} {B = B} f = ♯-rec (♯i ∘ f) -- Of course, ♯ A is codiscrete for any type A ♯-is-codiscrete : {i : ULevel} (A : Type i) → (♯ A) is-codiscrete ♯-is-codiscrete A = (♯ A) is-codiscrete-because (λ (a : ♯ (♯ A)) → let♯ a :=♯i x in♯ x) is-retract-by (λ a → refl) -- This is the actual equivalence A ≃ ♯ A, given that A is codiscrete codisc-eq : {i : ULevel} {A : Type i} (p : A is-codiscrete) → A ≃ (♯ A) codisc-eq = ♯i ,_ -- Theorem 3.7 of Shulman module _ {@♭ i : ULevel} {@♭ A : Type i} where code : (a b : ♯ A) → Type i code a = ♯' {Γ = ♯ A} {!!} {- (let♯ u := a ↓♯in♯ (let♯ v := b ↓♯in♯ (♯i (♯ (u == v))) ) ) -} ♯-identity-eq : (a b : A) → ((♯i a) == (♯i b)) ≃ ♯ (a == b) ♯-identity-eq a b = equiv {!!} fro {!!} {!!} where to : (♯i a) == (♯i b) → ♯ (a == b) to p = {!!} fro : ♯ (a == b) → ♯i a == ♯i b fro p = (let♯ p :=♯i q in♯ ♯i (ap ♯i q) ) |> (<– ♯path-eq) -- Theorem 6.22 of Shulman -- ♭ and ♯ reflect into eachothers categories. ♭♯-eq : {@♭ i : ULevel} {@♭ A : Type i} → ♭ (♯ A) ≃ ♭ A ♭♯-eq {A = A} = equiv to fro to-fro fro-to where to : ♭ (♯ A) → ♭ A to (a ^♭) = (♭♯e a) ^♭ fro : ♭ A → ♭ (♯ A) fro (a ^♭) = (♯i a) ^♭ to-fro : (a : ♭ A) → to (fro a) == a to-fro (a ^♭) = refl fro-to : (a : ♭ (♯ A)) → fro (to a) == a fro-to (a ^♭) = ♭-ap _^♭ (! (♭♯η a)) ♯♭-eq : {@♭ i : ULevel} {@♭ A : Type i} → ♯ (♭ A) ≃ ♯ A ♯♭-eq {A = A} = equiv to fro to-fro fro-to where to : ♯ (♭ A) → ♯ A to = ♯-rec (λ { (a ^♭) → (♯i a)}) fro : ♯ A → ♯ (♭ A) fro = ♯-rec (uncrisp _ (λ (a : A) → ♯i (a ^♭))) to-fro : (a : ♯ A) → to (fro a) == a to-fro = (<– ♯path-eq) ∘ (♯-elim (λ a → to (fro a) == a) (λ a → ♯i refl)) fro-to : (a : ♯ (♭ A)) → fro (to a) == a fro-to = (<– ♯path-eq) ∘ (♯-elim (λ a → fro (to a) == a) (λ { (a ^♭) → ♯i refl })) -- Theorem 6.27 of Shulman ♭♯-adjoint : {@♭ i j : ULevel} {@♭ A : Type i} {@♭ B : A → Type j} → ♭ ((a : ♭ A) → B (♭i a)) ≃ ♭ ((a : A) → ♯ (B a)) ♭♯-adjoint {i} {j} {A} {B} = equiv to fro to-fro fro-to where to : ♭ ((a : ♭ A) → B (♭i a)) → ♭ ((a : A) → ♯ (B a)) to (f ^♭) = (uncrisp B (λ (@♭ a : A) → ♯i (f (a ^♭)))) ^♭ fro : ♭ ((a : A) → ♯ (B a)) → ♭ ((a : ♭ A) → B (♭i a)) fro (f ^♭) = (λ { (a ^♭) → ♭♯e (f a) }) ^♭ to-fro : (f : ♭ ((a : A) → ♯ (B a))) → to (fro f) == f to-fro (f ^♭)= ♭-ap _^♭ {!!} fro-to : (f : ♭ ((a : ♭ A) → B (♭i a))) → fro (to f) == f fro-to (@♭ f ^♭) = ♭-ap _^♭ (λ= (λ a → {!(λ { (a₁ ^♭) → ♭♯e (uncrisp B (λ (a₂ : _) → ♯i (f (a₂ ^♭))) a₁) })!})) has-level-is-codiscrete : {i : ULevel} {A : Type i} {n : ℕ₋₂} → (has-level n A) is-codiscrete has-level-is-codiscrete = {!!} ♯-preserves-level : {i : ULevel} {A : Type i} {n : ℕ₋₂} (p : has-level n A) → has-level n (♯ A) ♯-preserves-level {i} {A} {⟨-2⟩} p = has-level-in (♯i (contr-center p) , (<– ♯path-eq) ∘ (♯-elim (λ a → ♯i (contr-center p) == a) (λ a → ♯i (ap ♯i (contr-path p a))))) ♯-preserves-level {i} {A} {S n} p = has-level-in (λ x y → (<– (codisc-eq has-level-is-codiscrete)) ((♯-elim (λ y → has-level n (x == y)) {!!}) y) ) {- to-crisp : {@♭ i : ULevel} {j : ULevel} {A : ♭ (Type i)} {B : Type j} → (♭i A → B) → (A ♭:→ B) to-crisp {A = (A ^♭)} f = (<– ♭-recursion-eq) (f ∘ ♭i) _is-codiscrete : {@♭ j : ULevel} (B : Type j) → Type (lsucc j) _is-codiscrete {j} B = (A : ♭ (Type j)) → to-crisp {A = A} {B = B} is-an-equiv codisc-eq : {@♭ j : ULevel} {B : Type j} (p : B is-codiscrete) {A : ♭ (Type j)} → (♭i A → B) ≃ (A ♭:→ B) codisc-eq {j} {B} p {A} = (to-crisp {A = A} {B = B}) , (p A) codisc-promote : {@♭ j : ULevel} {B : Type j} (p : B is-codiscrete) {A : ♭ (Type j)} → (A ♭:→ B) → (♭i A → B) codisc-promote p = <– (codisc-eq p) _is-codiscrete-is-a-prop : {@♭ j : ULevel} (B : Type j) → (B is-codiscrete) is-a-prop _is-codiscrete-is-a-prop {j} B = mapping-into-prop-is-a-prop (λ { (A ^♭) → is-equiv-is-prop }) _is-codiscrete₀ : {@♭ j : ULevel} (B : Type j) → Type₀ _is-codiscrete₀ {j} B = (resize₀ ((B is-codiscrete) , (B is-codiscrete-is-a-prop))) holds ⊤-is-codiscrete : ⊤ is-codiscrete ⊤-is-codiscrete = λ { (A ^♭) → to-crisp is-an-equivalence-because (λ _ _ → unit) is-inverse-by (λ f → refl) and (λ f → refl) } {- Π-codisc : {@♭ i : ULevel} {A : Type i} {B : A → Type i} → ((a : A) → (B a) is-codiscrete) → ((a : A) → B a) is-codiscrete Π-codisc {i} {A} {B} f = λ { (T ^♭) → to-crisp is-an-equivalence-because (λ g → λ t a → {!codisc-promote (f a)!}) is-inverse-by {!!} and {!!}} -} {- question : {@♭ i : ULevel} (B : Type i) (r : (A : ♭ (Type i)) → (to-crisp {A = A} {B = B}) is-split-inj) → B is-codiscrete question {i = i} B r = λ { (A ^♭) → to-crisp is-an-equivalence-because fst (r (A ^♭)) is-inverse-by (λ f → {!!}) and snd (r (A ^♭)) } -} {- The idea from this proof is to map out of the suspension =-is-codiscrete : {@♭ i : ULevel} {B : Type i} (p : B is-codiscrete) (x y : B) → (x == y) is-codiscrete =-is-codiscrete {i} {B} p x y = λ { (A ^♭) → to-crisp is-an-equivalence-because {!!} is-inverse-by {!!} and {!!} } -} -}
src/util-dates.adb
Letractively/ada-util
0
18470
----------------------------------------------------------------------- -- util-dates -- Date utilities -- Copyright (C) 2011, 2013, 2014 <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. ----------------------------------------------------------------------- package body Util.Dates is -- ------------------------------ -- Split the date into a date record (See Ada.Calendar.Formatting.Split). -- ------------------------------ procedure Split (Into : out Date_Record; Date : in Ada.Calendar.Time; Time_Zone : in Ada.Calendar.Time_Zones.Time_Offset := 0) is use Ada.Calendar; D : Ada.Calendar.Time := Date; begin Into.Date := Date; Into.Time_Zone := Time_Zone; Ada.Calendar.Formatting.Split (Date => Date, Year => Into.Year, Month => Into.Month, Day => Into.Month_Day, Hour => Into.Hour, Minute => Into.Minute, Second => Into.Second, Sub_Second => Into.Sub_Second, Leap_Second => Into.Leap_Second, Time_Zone => Time_Zone); -- The Day_Of_Week function uses the local timezone to find the week day. -- The wrong day is computed if the timezone is different. If the current -- date is 23:30 GMT and the current system timezone is GMT+2, then the computed -- day of week will be the next day due to the +2 hour offset (01:30 AM). -- To avoid the timezone issue, we virtually force the hour to 12:00 am. if Into.Hour > 12 then D := D - Duration ((Into.Hour - 12) * 3600); elsif Into.Hour < 12 then D := D + Duration ((12 - Into.Hour) * 3600); end if; D := D - Duration ((60 - Into.Minute) * 60); Into.Day := Ada.Calendar.Formatting.Day_Of_Week (D); end Split; -- ------------------------------ -- Returns true if the given year is a leap year. -- ------------------------------ function Is_Leap_Year (Year : in Ada.Calendar.Year_Number) return Boolean is begin if Year mod 400 = 0 then return True; elsif Year mod 100 = 0 then return False; elsif Year mod 4 = 0 then return True; else return False; end if; end Is_Leap_Year; -- ------------------------------ -- Get the number of days in the given year. -- ------------------------------ function Get_Day_Count (Year : in Ada.Calendar.Year_Number) return Ada.Calendar.Arithmetic.Day_Count is begin if Is_Leap_Year (Year) then return 365; else return 366; end if; end Get_Day_Count; Month_Day_Count : constant array (Ada.Calendar.Month_Number) of Ada.Calendar.Arithmetic.Day_Count := (1 => 31, 2 => 28, 3 => 31, 4 => 30, 5 => 31, 6 => 30, 7 => 31, 8 => 31, 9 => 30, 10 => 31, 11 => 30, 12 => 31); -- ------------------------------ -- Get the number of days in the given month. -- ------------------------------ function Get_Day_Count (Year : in Ada.Calendar.Year_Number; Month : in Ada.Calendar.Month_Number) return Ada.Calendar.Arithmetic.Day_Count is begin if Month /= 2 then return Month_Day_Count (Month); elsif Is_Leap_Year (Year) then return 29; else return 28; end if; end Get_Day_Count; -- ------------------------------ -- Get a time representing the given date at 00:00:00. -- ------------------------------ function Get_Day_Start (Date : in Date_Record) return Ada.Calendar.Time is begin return Ada.Calendar.Formatting.Time_Of (Year => Date.Year, Month => Date.Month, Day => Date.Month_Day, Hour => 0, Minute => 0, Second => 0, Sub_Second => 0.0, Time_Zone => Date.Time_Zone); end Get_Day_Start; function Get_Day_Start (Date : in Ada.Calendar.Time) return Ada.Calendar.Time is D : Date_Record; begin Split (D, Date); return Get_Day_Start (D); end Get_Day_Start; -- ------------------------------ -- Get a time representing the given date at 23:59:59. -- ------------------------------ function Get_Day_End (Date : in Date_Record) return Ada.Calendar.Time is begin return Ada.Calendar.Formatting.Time_Of (Year => Date.Year, Month => Date.Month, Day => Date.Month_Day, Hour => 23, Minute => 59, Second => 59, Sub_Second => 0.999, Time_Zone => Date.Time_Zone); end Get_Day_End; function Get_Day_End (Date : in Ada.Calendar.Time) return Ada.Calendar.Time is D : Date_Record; begin Split (D, Date); return Get_Day_End (D); end Get_Day_End; -- ------------------------------ -- Get a time representing the beginning of the week at 00:00:00. -- ------------------------------ function Get_Week_Start (Date : in Date_Record) return Ada.Calendar.Time is use Ada.Calendar.Formatting; use Ada.Calendar.Arithmetic; T : constant Ada.Calendar.Time := Time_Of (Year => Date.Year, Month => Date.Month, Day => Date.Month_Day, Hour => 0, Minute => 0, Second => 0, Sub_Second => 0.0, Time_Zone => Date.Time_Zone); begin if Date.Day = Ada.Calendar.Formatting.Monday then return T; else return T - Day_Count (Day_Name'Pos (Date.Day) - Day_Name'Pos (Monday)); end if; end Get_Week_Start; function Get_Week_Start (Date : in Ada.Calendar.Time) return Ada.Calendar.Time is D : Date_Record; begin Split (D, Date); return Get_Week_Start (D); end Get_Week_Start; -- ------------------------------ -- Get a time representing the end of the week at 23:59:99. -- ------------------------------ function Get_Week_End (Date : in Date_Record) return Ada.Calendar.Time is use Ada.Calendar.Formatting; use Ada.Calendar.Arithmetic; T : constant Ada.Calendar.Time := Time_Of (Year => Date.Year, Month => Date.Month, Day => Date.Month_Day, Hour => 23, Minute => 59, Second => 59, Sub_Second => 0.999, Time_Zone => Date.Time_Zone); begin -- End of week is 6 days + 23:59:59 if Date.Day = Ada.Calendar.Formatting.Sunday then return T; else return T + Day_Count (6 - (Day_Name'Pos (Date.Day) - Day_Name'Pos (Monday))); end if; end Get_Week_End; function Get_Week_End (Date : in Ada.Calendar.Time) return Ada.Calendar.Time is D : Date_Record; begin Split (D, Date); return Get_Week_End (D); end Get_Week_End; -- ------------------------------ -- Get a time representing the beginning of the month at 00:00:00. -- ------------------------------ function Get_Month_Start (Date : in Date_Record) return Ada.Calendar.Time is begin return Ada.Calendar.Formatting.Time_Of (Year => Date.Year, Month => Date.Month, Day => Ada.Calendar.Day_Number'First, Hour => 0, Minute => 0, Second => 0, Sub_Second => 0.0, Time_Zone => Date.Time_Zone); end Get_Month_Start; function Get_Month_Start (Date : in Ada.Calendar.Time) return Ada.Calendar.Time is D : Date_Record; begin Split (D, Date); return Get_Month_Start (D); end Get_Month_Start; -- ------------------------------ -- Get a time representing the end of the month at 23:59:59. -- ------------------------------ function Get_Month_End (Date : in Date_Record) return Ada.Calendar.Time is Last_Day : constant Ada.Calendar.Day_Number := Ada.Calendar.Day_Number (Get_Day_Count (Date.Year, Date.Month)); begin return Ada.Calendar.Formatting.Time_Of (Year => Date.Year, Month => Date.Month, Day => Last_Day, Hour => 23, Minute => 59, Second => 59, Sub_Second => 0.999, Time_Zone => Date.Time_Zone); end Get_Month_End; function Get_Month_End (Date : in Ada.Calendar.Time) return Ada.Calendar.Time is D : Date_Record; begin Split (D, Date); return Get_Month_End (D); end Get_Month_End; end Util.Dates;
orgcomp/autumn/lab4/src/int.asm
chebykinn/university
2
246166
Dseg at 0x08 ai: ds 1 s: ds 1 x equ r0 cseg at 0x0 jmp start Si1: mov b, x mul ab mov a, ai mul ab mov a, #0xff subb a, b ret start: mov x,#0 cikl: mov a,#0x01 mov ai, #142 call Si1 mov ai, #128 call Si1 mov ai, #64 call Si1 mov b, x mul ab mov a, #128 mul ab mov P3, b inc x jmp cikl nop end
aom_dsp/x86/aom_subpixel_bilinear_sse2.asm
ozyb/aom
2,151
98034
<reponame>ozyb/aom<gh_stars>1000+ ; ; Copyright (c) 2016, Alliance for Open Media. All rights reserved ; ; This source code is subject to the terms of the BSD 2 Clause License and ; the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License ; was not distributed with this source code in the LICENSE file, you can ; obtain it at www.aomedia.org/license/software. If the Alliance for Open ; Media Patent License 1.0 was not distributed with this source code in the ; PATENTS file, you can obtain it at www.aomedia.org/license/patent. ; ; %include "aom_ports/x86_abi_support.asm" %macro GET_PARAM_4 0 mov rdx, arg(5) ;filter ptr mov rsi, arg(0) ;src_ptr mov rdi, arg(2) ;output_ptr mov rcx, 0x0400040 movdqa xmm3, [rdx] ;load filters pshuflw xmm4, xmm3, 11111111b ;k3 psrldq xmm3, 8 pshuflw xmm3, xmm3, 0b ;k4 punpcklqdq xmm4, xmm3 ;k3k4 movq xmm3, rcx ;rounding pshufd xmm3, xmm3, 0 pxor xmm2, xmm2 movsxd rax, DWORD PTR arg(1) ;pixels_per_line movsxd rdx, DWORD PTR arg(3) ;out_pitch movsxd rcx, DWORD PTR arg(4) ;output_height %endm %macro APPLY_FILTER_4 1 punpckldq xmm0, xmm1 ;two row in one register punpcklbw xmm0, xmm2 ;unpack to word pmullw xmm0, xmm4 ;multiply the filter factors movdqa xmm1, xmm0 psrldq xmm1, 8 paddsw xmm0, xmm1 paddsw xmm0, xmm3 ;rounding psraw xmm0, 7 ;shift packuswb xmm0, xmm0 ;pack to byte %if %1 movd xmm1, [rdi] pavgb xmm0, xmm1 %endif movd [rdi], xmm0 lea rsi, [rsi + rax] lea rdi, [rdi + rdx] dec rcx %endm %macro GET_PARAM 0 mov rdx, arg(5) ;filter ptr mov rsi, arg(0) ;src_ptr mov rdi, arg(2) ;output_ptr mov rcx, 0x0400040 movdqa xmm7, [rdx] ;load filters pshuflw xmm6, xmm7, 11111111b ;k3 pshufhw xmm7, xmm7, 0b ;k4 punpcklwd xmm6, xmm6 punpckhwd xmm7, xmm7 movq xmm4, rcx ;rounding pshufd xmm4, xmm4, 0 pxor xmm5, xmm5 movsxd rax, DWORD PTR arg(1) ;pixels_per_line movsxd rdx, DWORD PTR arg(3) ;out_pitch movsxd rcx, DWORD PTR arg(4) ;output_height %endm %macro APPLY_FILTER_8 1 punpcklbw xmm0, xmm5 punpcklbw xmm1, xmm5 pmullw xmm0, xmm6 pmullw xmm1, xmm7 paddsw xmm0, xmm1 paddsw xmm0, xmm4 ;rounding psraw xmm0, 7 ;shift packuswb xmm0, xmm0 ;pack back to byte %if %1 movq xmm1, [rdi] pavgb xmm0, xmm1 %endif movq [rdi], xmm0 ;store the result lea rsi, [rsi + rax] lea rdi, [rdi + rdx] dec rcx %endm %macro APPLY_FILTER_16 1 punpcklbw xmm0, xmm5 punpcklbw xmm1, xmm5 punpckhbw xmm2, xmm5 punpckhbw xmm3, xmm5 pmullw xmm0, xmm6 pmullw xmm1, xmm7 pmullw xmm2, xmm6 pmullw xmm3, xmm7 paddsw xmm0, xmm1 paddsw xmm2, xmm3 paddsw xmm0, xmm4 ;rounding paddsw xmm2, xmm4 psraw xmm0, 7 ;shift psraw xmm2, 7 packuswb xmm0, xmm2 ;pack back to byte %if %1 movdqu xmm1, [rdi] pavgb xmm0, xmm1 %endif movdqu [rdi], xmm0 ;store the result lea rsi, [rsi + rax] lea rdi, [rdi + rdx] dec rcx %endm SECTION .text global sym(aom_filter_block1d4_v2_sse2) PRIVATE sym(aom_filter_block1d4_v2_sse2): push rbp mov rbp, rsp SHADOW_ARGS_TO_STACK 6 push rsi push rdi ; end prolog GET_PARAM_4 .loop: movd xmm0, [rsi] ;load src movd xmm1, [rsi + rax] APPLY_FILTER_4 0 jnz .loop ; begin epilog pop rdi pop rsi UNSHADOW_ARGS pop rbp ret global sym(aom_filter_block1d8_v2_sse2) PRIVATE sym(aom_filter_block1d8_v2_sse2): push rbp mov rbp, rsp SHADOW_ARGS_TO_STACK 6 SAVE_XMM 7 push rsi push rdi ; end prolog GET_PARAM .loop: movq xmm0, [rsi] ;0 movq xmm1, [rsi + rax] ;1 APPLY_FILTER_8 0 jnz .loop ; begin epilog pop rdi pop rsi RESTORE_XMM UNSHADOW_ARGS pop rbp ret global sym(aom_filter_block1d16_v2_sse2) PRIVATE sym(aom_filter_block1d16_v2_sse2): push rbp mov rbp, rsp SHADOW_ARGS_TO_STACK 6 SAVE_XMM 7 push rsi push rdi ; end prolog GET_PARAM .loop: movdqu xmm0, [rsi] ;0 movdqu xmm1, [rsi + rax] ;1 movdqa xmm2, xmm0 movdqa xmm3, xmm1 APPLY_FILTER_16 0 jnz .loop ; begin epilog pop rdi pop rsi RESTORE_XMM UNSHADOW_ARGS pop rbp ret global sym(aom_filter_block1d4_h2_sse2) PRIVATE sym(aom_filter_block1d4_h2_sse2): push rbp mov rbp, rsp SHADOW_ARGS_TO_STACK 6 push rsi push rdi ; end prolog GET_PARAM_4 .loop: movdqu xmm0, [rsi] ;load src movdqa xmm1, xmm0 psrldq xmm1, 1 APPLY_FILTER_4 0 jnz .loop ; begin epilog pop rdi pop rsi UNSHADOW_ARGS pop rbp ret global sym(aom_filter_block1d8_h2_sse2) PRIVATE sym(aom_filter_block1d8_h2_sse2): push rbp mov rbp, rsp SHADOW_ARGS_TO_STACK 6 SAVE_XMM 7 push rsi push rdi ; end prolog GET_PARAM .loop: movdqu xmm0, [rsi] ;load src movdqa xmm1, xmm0 psrldq xmm1, 1 APPLY_FILTER_8 0 jnz .loop ; begin epilog pop rdi pop rsi RESTORE_XMM UNSHADOW_ARGS pop rbp ret global sym(aom_filter_block1d16_h2_sse2) PRIVATE sym(aom_filter_block1d16_h2_sse2): push rbp mov rbp, rsp SHADOW_ARGS_TO_STACK 6 SAVE_XMM 7 push rsi push rdi ; end prolog GET_PARAM .loop: movdqu xmm0, [rsi] ;load src movdqu xmm1, [rsi + 1] movdqa xmm2, xmm0 movdqa xmm3, xmm1 APPLY_FILTER_16 0 jnz .loop ; begin epilog pop rdi pop rsi RESTORE_XMM UNSHADOW_ARGS pop rbp ret
src/main/antlr4/PreprocLexer.g4
thomasbrown1010/alogic
0
4971
//////////////////////////////////////////////////////////////////////////////// // Argon Design Ltd. Project P8009 Alogic // Copyright (c) 2017-208 Argon Design Ltd. All rights reserved. // // This file is covered by the BSD (with attribution) license. // See the LICENSE file for the precise wording of the license. // // Module : Alogic Compiler // Author : <NAME>/<NAME> // // DESCRIPTION: // // Antlr4 lexer grammar for preprocessor //////////////////////////////////////////////////////////////////////////////// lexer grammar PreprocLexer; // This grammar handles #define/#if/#ifdef/#else/#endif // Comments are not stripped in order to keep the line numbers accurate for error messages in later stages // HASHINCLUDE: '#' [ \t]* 'include' [ \t]+; HASHDEFINE: '#' [ \t]* 'define' [ \t]+ -> pushMode(DEFINEMODE); HASHIF: '#' [ \t]* 'if' [ \t]+; HASHIFDEF: '#' [ \t]* 'ifdef' [ \t]+; HASHELSE: '#' [ \t]* 'else'; HASHENDIF: '#' [ \t]* 'endif'; IDENTIFIER: [a-zA-Z_][a-zA-Z0-9_$]*; LITERAL: '"' ~["]* '"'; LINE_COMMENT: '//' .*? NL; BLOCK_COMMENT: '/*' .*? '*/'; fragment NL: '\r'? '\n'; ANYTHING : . ; mode DEFINEMODE; DEFINEIDENTIFIER: IDENTIFIER -> type(IDENTIFIER), Mode(DEFINERESTMODE); mode DEFINERESTMODE; // TODO: should support line continuation with \ REST: ~[\r\n/*()]+ -> popMode;
leds/leds.asm
zsazsaz1/RiscSimulator
0
14122
<reponame>zsazsaz1/RiscSimulator add $t0, $zero, $imm, 6 # set $t0 = 6 out $imm, $t0, $zero, LedInterrupt # set irqhandler as LedInterrupt out $imm, $zero, $zero, 1 # enable irq0 add $t0, $zero, $imm, 13 # set $t0 = 13 out $imm, $t0, $zero, 1023 # set timermax = 1023 (because it includes zero) add $t0, $zero, $imm, 11 # set $t0 = 12 add $s0, $zero, $imm, Nop # set $s0 = Nop, makes cycles more reliable not using $imm (seeing 1024 clear cycles between each Interrupt on trace file) out $imm, $t0, $zero, 1 # set timerenable = 1024 jal $imm, $zero, $zero, Nop # jump to Nop and save next addres in $ra halt $zero, $zero, $zero, 0 # halt Nop: add $zero, $zero, $zero, 0 # litteraly nothing beq $s0, $zero, $zero, 0 # jump to $s0 (= Nop) LedInterrupt: add $t0, $zero, $imm, 9 # set $t0 = 9 in $t1, $t0, $zero, 0 # set $t1 = leds sll $t1, $t1, $imm, 1 # shift leds by 1 add $t1, $t1, $imm, 1 # add to 1 leds out $t1, $t0, $zero, 0 # set leds = $t1 beq $ra, $t1, $imm, -1 # go to halt if all 32 bits are 1 out $zero, $zero, $imm, 3 # clear irq0 status reti $zero, $zero, $zero, 0 # return from interrupt
src/converters.adb
Kurinkitos/Twizy-Security
1
28090
package body converters with SPARK_Mode is function double_to_speed (d : double) return Types.speed is temp : Types.Speed; begin if (d <= double(-80.0)) then temp := Types.Speed(-79.0); return temp; end if; if (d >= double(80.0)) then temp := Types.Speed(79.0); return temp; end if; temp := Types.Speed(d); return temp; end double_to_speed; function point_to_cart_x (p : point_3d) return Types.Cartesian_Coordinate is temp : Types.Cartesian_Coordinate; begin temp := Types.Cartesian_Coordinate(p.x); return temp; end point_to_cart_x; function point_to_cart_y (p : point_3d) return Types.Cartesian_Coordinate is temp : Types.Cartesian_Coordinate; begin temp := Types.Cartesian_Coordinate(p.y); return temp; end point_to_cart_y; function point_to_cart_z (p : point_3d) return Types.Cartesian_Coordinate is temp : Types.Cartesian_Coordinate; begin temp := Types.Cartesian_Coordinate(p.z); return temp; end point_to_cart_z; function speed_ada_to_speed (s : speed_ada) return Types.speed is temp : Types.speed; begin temp := double_to_speed(s.speed); return temp; end speed_ada_to_speed; end converters;
constants/collision_constants.asm
AtmaBuster/pokeplat-gen2
6
100331
; collision permissions (see data/collision_permissions.asm) LANDTILE EQU $00 WATERTILE EQU $01 WALLTILE EQU $0f TALK EQU $10 ; collision data types (see data/tilesets/*_collision.asm) ; TileCollisionTable indexes (see data/collision_permissions.asm) COLL_FLOOR EQU $00 COLL_01 EQU $01 ; garbage COLL_03 EQU $03 ; garbage COLL_04 EQU $04 ; garbage COLL_WALL EQU $07 COLL_CUT_08 EQU $08 ; unused COLL_TALL_GRASS_10 EQU $10 ; unused COLL_CUT_TREE EQU $12 COLL_LONG_GRASS EQU $14 COLL_HEADBUTT_TREE EQU $15 COLL_TALL_GRASS EQU $18 COLL_CUT_TREE_1A EQU $1a ; unused COLL_LONG_GRASS_1C EQU $1c ; unused COLL_HEADBUTT_TREE_1D EQU $1d ; unused COLL_WATER_21 EQU $21 ; ??? COLL_ICE EQU $23 COLL_WHIRLPOOL EQU $24 COLL_BUOY EQU $27 COLL_CUT_28 EQU $28 ; garbage COLL_WATER EQU $29 COLL_ICE_2B EQU $2b ; unused COLL_WHIRLPOOL_2C EQU $2c ; unused COLL_WATERFALL_RIGHT EQU $30 ; unused COLL_WATERFALL_LEFT EQU $31 ; unused COLL_WATERFALL_UP EQU $32 ; unused COLL_WATERFALL EQU $33 COLL_CURRENT_RIGHT EQU $38 ; unused COLL_CURRENT_LEFT EQU $39 ; unused COLL_CURRENT_UP EQU $3a ; unused COLL_CURRENT_DOWN EQU $3b ; unused COLL_BRAKE EQU $40 ; unused COLL_WALK_RIGHT EQU $41 ; unused COLL_WALK_LEFT EQU $42 ; unused COLL_WALK_UP EQU $43 ; unused COLL_WALK_DOWN EQU $44 ; unused COLL_BRAKE_45 EQU $45 ; garbage COLL_BRAKE_46 EQU $46 ; unused COLL_BRAKE_47 EQU $47 ; unused COLL_GRASS_48 EQU $48 ; unused COLL_GRASS_49 EQU $49 ; unused COLL_GRASS_4A EQU $4a ; garbage COLL_GRASS_4B EQU $4b ; garbage COLL_GRASS_4C EQU $4c ; unused COLL_WALK_RIGHT_ALT EQU $50 ; unused COLL_WALK_LEFT_ALT EQU $51 ; unused COLL_WALK_UP_ALT EQU $52 ; unused COLL_WALK_DOWN_ALT EQU $53 ; unused COLL_BRAKE_ALT EQU $54 ; unused COLL_BRAKE_55 EQU $55 ; unused COLL_BRAKE_56 EQU $56 ; unused COLL_BRAKE_57 EQU $57 ; unused COLL_5B EQU $5b ; garbage COLL_PIT EQU $60 COLL_VIRTUAL_BOY EQU $61 ; garbage COLL_64 EQU $64 ; garbage COLL_65 EQU $65 ; garbage COLL_PIT_68 EQU $68 ; unused COLL_WARP_CARPET_DOWN EQU $70 COLL_DOOR EQU $71 COLL_LADDER EQU $72 COLL_STAIRCASE_73 EQU $73 ; unused COLL_CAVE_74 EQU $74 ; unused COLL_DOOR_75 EQU $75 ; unused COLL_WARP_CARPET_LEFT EQU $76 COLL_WARP_77 EQU $77 ; unused COLL_WARP_CARPET_UP EQU $78 COLL_DOOR_79 EQU $79 ; unused COLL_STAIRCASE EQU $7a COLL_CAVE EQU $7b COLL_WARP_PANEL EQU $7c COLL_DOOR_7D EQU $7d ; unused COLL_WARP_CARPET_RIGHT EQU $7e COLL_WARP_7F EQU $7f ; unused COLL_STOP_SPIN EQU $80 COLL_SPIN_UP EQU $81 COLL_SPIN_DOWN EQU $82 COLL_SPIN_LEFT EQU $83 COLL_SPIN_RIGHT EQU $84 COLL_COUNTER EQU $90 COLL_BOOKSHELF EQU $91 COLL_PC EQU $93 COLL_RADIO EQU $94 COLL_TOWN_MAP EQU $95 COLL_MART_SHELF EQU $96 COLL_TV EQU $97 COLL_COUNTER_98 EQU $98 ; unused COLL_9C EQU $9c ; garbage COLL_WINDOW EQU $9d COLL_INCENSE_BURNER EQU $9f COLL_HOP_RIGHT EQU $a0 COLL_HOP_LEFT EQU $a1 COLL_HOP_UP EQU $a2 ; unused COLL_HOP_DOWN EQU $a3 COLL_HOP_DOWN_RIGHT EQU $a4 COLL_HOP_DOWN_LEFT EQU $a5 COLL_HOP_UP_RIGHT EQU $a6 ; unused COLL_HOP_UP_LEFT EQU $a7 ; unused COLL_RIGHT_WALL EQU $b0 COLL_LEFT_WALL EQU $b1 COLL_UP_WALL EQU $b2 COLL_DOWN_WALL EQU $b3 ; unused COLL_DOWN_RIGHT_WALL EQU $b4 ; unused COLL_DOWN_LEFT_WALL EQU $b5 ; unused COLL_UP_RIGHT_WALL EQU $b6 ; unused COLL_UP_LEFT_WALL EQU $b7 ; unused COLL_RIGHT_BUOY EQU $c0 ; unused COLL_LEFT_BUOY EQU $c1 ; unused COLL_UP_BUOY EQU $c2 ; unused COLL_DOWN_BUOY EQU $c3 ; unused COLL_DOWN_RIGHT_BUOY EQU $c4 ; unused COLL_DOWN_LEFT_BUOY EQU $c5 ; unused COLL_UP_RIGHT_BUOY EQU $c6 ; unused COLL_UP_LEFT_BUOY EQU $c7 ; unused COLL_FF EQU $ff ; garbage ; collision data type nybbles LO_NYBBLE_GRASS EQU $07 HI_NYBBLE_TALL_GRASS EQU $10 HI_NYBBLE_WATER EQU $20 HI_NYBBLE_CURRENT EQU $30 HI_NYBBLE_WALK EQU $40 HI_NYBBLE_WALK_ALT EQU $50 HI_NYBBLE_WARPS EQU $70 HI_NYBBLE_LEDGES EQU $a0 HI_NYBBLE_SIDE_WALLS EQU $b0 HI_NYBBLE_SIDE_BUOYS EQU $c0
regtests/are-tests.ads
stcarrez/resource-embedder
7
2713
<filename>regtests/are-tests.ads ----------------------------------------------------------------------- -- are-tests -- Various tests for the are tool (based on examples) -- Copyright (C) 2021 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; with Are.Testsuite; package Are.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Are.Testsuite.Test with null record; procedure Test_Example_C_Config (T : in out Test); procedure Test_Example_Ada_Config (T : in out Test); procedure Test_Example_Go_Config (T : in out Test); procedure Test_Example_C_Help (T : in out Test); procedure Test_Example_C_Lines (T : in out Test); procedure Test_Example_Ada_Help (T : in out Test); procedure Test_Example_Ada_Lines (T : in out Test); procedure Test_Example_Go_Help (T : in out Test); -- Test converting some content into a list of lines. procedure Test_Convert_Lines_1 (T : in out Test); procedure Test_Convert_Lines_2 (T : in out Test); end Are.Tests;
libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciyp_ds2slonglong_callee.asm
jpoikela/z88dk
640
93168
<filename>libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciyp_ds2slonglong_callee.asm ; signed long long __fs2slonglong (float f) SECTION code_clib SECTION code_fp_math48 PUBLIC cm48_sdcciyp_ds2slonglong_callee EXTERN cm48_sdcciyp_d2m48, am48_dfix64, l_store_64_dehldehl_mbc cm48_sdcciyp_ds2slonglong_callee: ; double to signed long long ; ; enter : stack = sdcc_float x, result *, ret ; ; exit : *result = (long long)(x) ; ; uses : af, bc, de, hl, af', bc', de', hl' pop af pop bc pop de pop hl push af push bc ; save result * call cm48_sdcciyp_d2m48 ; AC'= math48(x) call am48_dfix64 ; dehl'dehl = 64-bit result pop bc ; bc = result * jp l_store_64_dehldehl_mbc
programs/oeis/089/A089109.asm
karttu/loda
0
17586
; A089109: Convoluted convolved Fibonacci numbers G_5^(r). ; 5,9,17,25,38,51,70,89,115,141,175,209,252,295,348,401,465,529,605,681,770,859,962,1065,1183,1301,1435,1569,1720,1871,2040,2209,2397,2585,2793,3001,3230,3459,3710,3961,4235,4509,4807,5105,5428,5751,6100,6449 mov $3,$0 add $0,2 mov $2,$0 mov $4,2 lpb $2,1 sub $2,1 add $1,$2 trn $1,$0 mov $0,$4 add $4,1 lpb $0,1 sub $0,1 add $1,$2 lpe sub $2,1 lpe lpb $3,1 add $1,2 sub $3,1 lpe add $1,3
programs/oeis/282/A282622.asm
neoneye/loda
22
21335
<reponame>neoneye/loda<filename>programs/oeis/282/A282622.asm ; A282622: Number of digits of the representation of n in the alternating sexagesimal-decimal number system. ; 1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3 mul $0,2 add $0,8 mov $1,-1 lpb $0 div $0,5 add $1,1 lpe mov $0,$1
libsrc/_DEVELOPMENT/stdio/c/sccz80/getchar.asm
jpoikela/z88dk
640
177447
; int getchar(void) INCLUDE "config_private.inc" SECTION code_clib SECTION code_stdio ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IF __CLIB_OPT_MULTITHREAD & $02 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC getchar EXTERN asm_getchar defc getchar = asm_getchar ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ELSE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC getchar EXTERN getchar_unlocked defc getchar = getchar_unlocked ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ENDIF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gwnum/xmult3a.asm
Kasual/GIMPS
0
176381
; Copyright 2001-2012 Mersenne Research, Inc. All rights reserved ; Author: <NAME> ; Email: <EMAIL> ; ; These routines implement the normalization part of a r4dwpn (radix-4 delayed with partial normalization) FFT. ; TITLE setup IFNDEF X86_64 .686 .XMM .MODEL FLAT ENDIF INCLUDE unravel.mac INCLUDE extrn.mac INCLUDE xarch.mac INCLUDE xbasics.mac INCLUDE xmult.mac INCLUDE xnormal.mac _TEXT SEGMENT ;; ;; Routines to do the normalization after a multiply ;; ; Macro to loop through all the FFT values and apply the proper normalization ; routine. saved_rsi EQU PPTR [rsp+first_local] IFDEF X86_64 loopcount1 EQU r10 ELSE loopcount1 EQU DPTR [rsp+first_local+SZPTR] ENDIF loopcount2 EQU DPTR [rsp+first_local+SZPTR+4] loopcount3 EQU DPTR [rsp+first_local+SZPTR+8] blk8_counter EQU BYTE PTR [rsp+first_local+SZPTR+12] inorm MACRO lab, ttp, zero, echk, const, base2, sse4 LOCAL noadd, setlp, ilp0, ilp1, ilp2, not8, done PROCFLP lab int_prolog SZPTR+16,0,0 echk xload xmm6, XMM_MAXERR ;; Load maximum error no zero mov edx, ADDIN_ROW ;; Is this the time to do our addin? no zero cmp edx, THIS_BLOCK no zero jne short noadd ;; Jump if addin does not occur now no zero mov edi, ADDIN_OFFSET ;; Get address to add value into no zero movsd xmm0, Q [rsi][rdi] ;; Get the value no zero addsd xmm0, ADDIN_VALUE ;; Add in the requested value no zero movsd Q [rsi][rdi], xmm0 ;; Save the new value no zero subsd xmm7, ADDIN_VALUE ;; Do not include addin in sumout noadd: mov saved_rsi, rsi ;; Save for xtop_carry_adjust xnorm_wpn_preload ttp, zero, echk, const, base2, sse4 mov rdx, norm_grp_mults ;; Addr of the group multipliers mov rbp, carries ;; Addr of the carries mov rdi, norm_ptr1 ;; Load big/little & fudge flags array ptr mov blk8_counter, 0 ;; Clear counter mov eax, count3 ;; Load count of grp multipliers mov loopcount3, eax ;; Save loop counter ttp movzx rbx, WORD PTR [rdi] ;; Preload 4 big vs. little & fudge flags ilp0: mov eax, count2 ;; Load wpn count mov loopcount2, eax ;; Save count ilp1: mov eax, cache_line_multiplier ;; Load inner loop counter mov loopcount1, rax ;; Save loop counter IFDEF X86_64 no const xload xmm12, [rbp+0*16] ;; Preload carries no const xload xmm13, [rbp+1*16] no const xload xmm4, [rbp+2*16] no const xload xmm5, [rbp+3*16] ENDIF ilp2: xprefetchw [rsi+64] xnorm_wpn ttp, zero, echk, const, base2, sse4 ;; Normalize 8 values bump rsi, 64 ;; Next cache line ttp bump rdi, 2 ;; Next big/little flags sub loopcount1, 1 ;; Test loop counter jnz ilp2 ;; Loop til done add rsi, normblkdst ;; Skip gap in blkdst or clmblkdst IFDEF X86_64 no const xstore [rbp+0*16], xmm12 ;; Store carries no const xstore [rbp+1*16], xmm13 no const xstore [rbp+2*16], xmm4 no const xstore [rbp+3*16], xmm5 ENDIF bump rbp, 64 ;; Next set of carries add blk8_counter, 80h/4 ;; Test for a multiple of 8 blocks jnc short not8 add rsi, normblkdst8 ;; Add 128 every 8 clmblkdsts not8: sub loopcount2, 1 ;; Test loop counter jnz ilp1 ;; Iterate ttp bump rdx, 4*XMM_GMD ;; Next set of group multipliers sub loopcount3, 1 ;; Test outer loop counter jnz ilp0 ;; Iterate echk xstore XMM_MAXERR, xmm6 ;; Save maximum error ; Handle adjusting the carry out of the topmost FFT word mov eax, THIS_BLOCK ;; Check for processing last block cmp eax, LAST_PASS1_BLOCK jne done ;; Jump if not last block mov rsi, saved_rsi ;; Restore FFT data ptr xnorm_top_carry ;; Adjust carry if k > 1 done: int_epilog SZPTR+16,0,0 ENDPP lab ENDM loopcount2z EQU DPTR [rsp+first_local] loopcount3z EQU DPTR [rsp+first_local+4] blk8_counterz EQU BYTE PTR [rsp+first_local+8] zpnorm MACRO lab, ttp, echk, const, base2, sse4, khi, c1, cm1 LOCAL setlp, ilp0, ilp1, ilp2, not8 PROCFLP lab int_prolog 12,0,0 echk xload xmm6, XMM_MAXERR ;; Load maximum error xnorm_wpn_zpad_preload ttp, echk, const, base2, sse4, khi, c1, cm1 mov rdx, norm_grp_mults ;; Addr of the group multipliers mov rbp, carries ;; Addr of the carries mov rdi, norm_ptr1 ;; Load big/little flags array ptr mov blk8_counterz, 0 ;; Clear counter mov eax, count3 ;; Load count of grp multipliers mov loopcount3z, eax ;; Save loop counter ttp movzx rbx, WORD PTR [rdi] ;; Preload big vs. little & fudge flags ilp0: mov eax, count2 ;; Load wpn count mov loopcount2z, eax ;; Save loop counter ilp1: mov ecx, cache_line_multiplier ;; Load inner loop counter IFDEF X86_64 xload xmm4, [rbp+0*16] ;; Preload carries xload xmm11, [rbp+1*16] xload xmm3, [rbp+2*16] xload xmm10, [rbp+3*16] ENDIF ilp2: xprefetchw [rsi+64] xnorm_wpn_zpad ttp, echk, const, base2, sse4, khi, c1, cm1 ;; Normalize 8 values bump rsi, 64 ;; Next cache line ttp bump rdi, 2 ;; Next big/little flags sub rcx, 1 ;; Test loop counter jnz ilp2 ;; Loop til done add rsi, normblkdst ;; Skip gap in blkdst or clmblkdst IFDEF X86_64 xstore [rbp+0*16], xmm4 ;; Store carries xstore [rbp+1*16], xmm11 xstore [rbp+2*16], xmm3 xstore [rbp+3*16], xmm10 ENDIF bump rbp, 64 ;; Next set of carries add blk8_counterz, 80h/4 ;; Test for a multiple of 8 blocks jnc short not8 add rsi, normblkdst8 ;; Add 128 every 8 clmblkdsts not8: sub loopcount2z, 1 ;; Test loop counter jnz ilp1 ;; Iterate ttp bump rdx, 4*XMM_GMD ;; Next set of group multipliers sub loopcount3z, 1 ;; Test outer loop counter jnz ilp0 ;; Iterate echk xstore XMM_MAXERR, xmm6 ;; Save maximum error int_epilog 12,0,0 ENDPP lab ENDM ; The 16 different normalization routines. One for each combination of ; rational/irrational, zeroing/no zeroing, error check/no error check, and ; mul by const/no mul by const. inorm xr3, noexec, noexec, noexec, noexec, exec, noexec inorm xr3e, noexec, noexec, exec, noexec, exec, noexec inorm xr3c, noexec, noexec, noexec, exec, exec, noexec inorm xr3ec, noexec, noexec, exec, exec, exec, noexec inorm xr3z, noexec, exec, noexec, noexec, exec, noexec inorm xr3ze, noexec, exec, exec, noexec, exec, noexec inorm xi3, exec, noexec, noexec, noexec, exec, noexec inorm xi3e, exec, noexec, exec, noexec, exec, noexec inorm xi3c, exec, noexec, noexec, exec, exec, noexec inorm xi3ec, exec, noexec, exec, exec, exec, noexec inorm xi3z, exec, exec, noexec, noexec, exec, noexec inorm xi3ze, exec, exec, exec, noexec, exec, noexec zpnorm xr3zp, noexec, noexec, noexec, exec, noexec, exec, noexec, noexec zpnorm xr3zpc1, noexec, noexec, noexec, exec, noexec, exec, exec, noexec zpnorm xr3zpcm1, noexec, noexec, noexec, exec, noexec, exec, noexec, exec zpnorm xr3zpe, noexec, exec, noexec, exec, noexec, exec, noexec, noexec zpnorm xr3zpec1, noexec, exec, noexec, exec, noexec, exec, exec, noexec zpnorm xr3zpecm1, noexec, exec, noexec, exec, noexec, exec, noexec, exec zpnorm xr3zpc, noexec, noexec, exec, exec, noexec, exec, noexec, noexec zpnorm xr3zpec, noexec, exec, exec, exec, noexec, exec, noexec, noexec zpnorm xi3zp, exec, noexec, noexec, exec, noexec, exec, noexec, noexec zpnorm xi3zpc1, exec, noexec, noexec, exec, noexec, exec, exec, noexec zpnorm xi3zpcm1, exec, noexec, noexec, exec, noexec, exec, noexec, exec zpnorm xi3zpe, exec, exec, noexec, exec, noexec, exec, noexec, noexec zpnorm xi3zpec1, exec, exec, noexec, exec, noexec, exec, exec, noexec zpnorm xi3zpecm1, exec, exec, noexec, exec, noexec, exec, noexec, exec zpnorm xi3zpc, exec, noexec, exec, exec, noexec, exec, noexec, noexec zpnorm xi3zpec, exec, exec, exec, exec, noexec, exec, noexec, noexec zpnorm xr3zpk, noexec, noexec, noexec, exec, noexec, noexec, noexec, noexec zpnorm xr3zpkc1, noexec, noexec, noexec, exec, noexec, noexec, exec, noexec zpnorm xr3zpkcm1, noexec, noexec, noexec, exec, noexec, noexec, noexec, exec zpnorm xr3zpek, noexec, exec, noexec, exec, noexec, noexec, noexec, noexec zpnorm xr3zpekc1, noexec, exec, noexec, exec, noexec, noexec, exec, noexec zpnorm xr3zpekcm1, noexec, exec, noexec, exec, noexec, noexec, noexec, exec zpnorm xr3zpck, noexec, noexec, exec, exec, noexec, noexec, noexec, noexec zpnorm xr3zpeck, noexec, exec, exec, exec, noexec, noexec, noexec, noexec zpnorm xi3zpk, exec, noexec, noexec, exec, noexec, noexec, noexec, noexec zpnorm xi3zpkc1, exec, noexec, noexec, exec, noexec, noexec, exec, noexec zpnorm xi3zpkcm1, exec, noexec, noexec, exec, noexec, noexec, noexec, exec zpnorm xi3zpek, exec, exec, noexec, exec, noexec, noexec, noexec, noexec zpnorm xi3zpekc1, exec, exec, noexec, exec, noexec, noexec, exec, noexec zpnorm xi3zpekcm1, exec, exec, noexec, exec, noexec, noexec, noexec, exec zpnorm xi3zpck, exec, noexec, exec, exec, noexec, noexec, noexec, noexec zpnorm xi3zpeck, exec, exec, exec, exec, noexec, noexec, noexec, noexec inorm xr3b, noexec, noexec, noexec, noexec, noexec, noexec inorm xr3eb, noexec, noexec, exec, noexec, noexec, noexec inorm xr3cb, noexec, noexec, noexec, exec, noexec, noexec inorm xr3ecb, noexec, noexec, exec, exec, noexec, noexec inorm xi3b, exec, noexec, noexec, noexec, noexec, noexec inorm xi3eb, exec, noexec, exec, noexec, noexec, noexec inorm xi3cb, exec, noexec, noexec, exec, noexec, noexec inorm xi3ecb, exec, noexec, exec, exec, noexec, noexec zpnorm xr3zpb, noexec, noexec, noexec, noexec, noexec, exec, noexec, noexec zpnorm xr3zpbc1, noexec, noexec, noexec, noexec, noexec, exec, exec, noexec zpnorm xr3zpbcm1, noexec, noexec, noexec, noexec, noexec, exec, noexec, exec zpnorm xr3zpeb, noexec, exec, noexec, noexec, noexec, exec, noexec, noexec zpnorm xr3zpebc1, noexec, exec, noexec, noexec, noexec, exec, exec, noexec zpnorm xr3zpebcm1, noexec, exec, noexec, noexec, noexec, exec, noexec, exec zpnorm xr3zpcb, noexec, noexec, exec, noexec, noexec, exec, noexec, noexec zpnorm xr3zpecb, noexec, exec, exec, noexec, noexec, exec, noexec, noexec zpnorm xi3zpb, exec, noexec, noexec, noexec, noexec, exec, noexec, noexec zpnorm xi3zpbc1, exec, noexec, noexec, noexec, noexec, exec, exec, noexec zpnorm xi3zpbcm1, exec, noexec, noexec, noexec, noexec, exec, noexec, exec zpnorm xi3zpeb, exec, exec, noexec, noexec, noexec, exec, noexec, noexec zpnorm xi3zpebc1, exec, exec, noexec, noexec, noexec, exec, exec, noexec zpnorm xi3zpebcm1, exec, exec, noexec, noexec, noexec, exec, noexec, exec zpnorm xi3zpcb, exec, noexec, exec, noexec, noexec, exec, noexec, noexec zpnorm xi3zpecb, exec, exec, exec, noexec, noexec, exec, noexec, noexec zpnorm xr3zpbk, noexec, noexec, noexec, noexec, noexec, noexec, noexec, noexec zpnorm xr3zpbkc1, noexec, noexec, noexec, noexec, noexec, noexec, exec, noexec zpnorm xr3zpbkcm1, noexec, noexec, noexec, noexec, noexec, noexec, noexec, exec zpnorm xr3zpebk, noexec, exec, noexec, noexec, noexec, noexec, noexec, noexec zpnorm xr3zpebkc1, noexec, exec, noexec, noexec, noexec, noexec, exec, noexec zpnorm xr3zpebkcm1, noexec, exec, noexec, noexec, noexec, noexec, noexec, exec zpnorm xr3zpcbk, noexec, noexec, exec, noexec, noexec, noexec, noexec, noexec zpnorm xr3zpecbk, noexec, exec, exec, noexec, noexec, noexec, noexec, noexec zpnorm xi3zpbk, exec, noexec, noexec, noexec, noexec, noexec, noexec, noexec zpnorm xi3zpbkc1, exec, noexec, noexec, noexec, noexec, noexec, exec, noexec zpnorm xi3zpbkcm1, exec, noexec, noexec, noexec, noexec, noexec, noexec, exec zpnorm xi3zpebk, exec, exec, noexec, noexec, noexec, noexec, noexec, noexec zpnorm xi3zpebkc1, exec, exec, noexec, noexec, noexec, noexec, exec, noexec zpnorm xi3zpebkcm1, exec, exec, noexec, noexec, noexec, noexec, noexec, exec zpnorm xi3zpcbk, exec, noexec, exec, noexec, noexec, noexec, noexec, noexec zpnorm xi3zpecbk, exec, exec, exec, noexec, noexec, noexec, noexec, noexec inorm xr3s4, noexec, noexec, noexec, noexec, exec, exec inorm xr3es4, noexec, noexec, exec, noexec, exec, exec inorm xr3cs4, noexec, noexec, noexec, exec, exec, exec inorm xr3ecs4, noexec, noexec, exec, exec, exec, exec inorm xi3s4, exec, noexec, noexec, noexec, exec, exec inorm xi3es4, exec, noexec, exec, noexec, exec, exec inorm xi3cs4, exec, noexec, noexec, exec, exec, exec inorm xi3ecs4, exec, noexec, exec, exec, exec, exec zpnorm xr3zps4, noexec, noexec, noexec, exec, exec, exec, noexec, noexec zpnorm xr3zps4c1, noexec, noexec, noexec, exec, exec, exec, exec, noexec zpnorm xr3zps4cm1, noexec, noexec, noexec, exec, exec, exec, noexec, exec zpnorm xr3zpes4, noexec, exec, noexec, exec, exec, exec, noexec, noexec zpnorm xr3zpes4c1, noexec, exec, noexec, exec, exec, exec, exec, noexec zpnorm xr3zpes4cm1, noexec, exec, noexec, exec, exec, exec, noexec, exec zpnorm xr3zpcs4, noexec, noexec, exec, exec, exec, exec, noexec, noexec zpnorm xr3zpecs4, noexec, exec, exec, exec, exec, exec, noexec, noexec zpnorm xi3zps4, exec, noexec, noexec, exec, exec, exec, noexec, noexec zpnorm xi3zps4c1, exec, noexec, noexec, exec, exec, exec, exec, noexec zpnorm xi3zps4cm1, exec, noexec, noexec, exec, exec, exec, noexec, exec zpnorm xi3zpes4, exec, exec, noexec, exec, exec, exec, noexec, noexec zpnorm xi3zpes4c1, exec, exec, noexec, exec, exec, exec, exec, noexec zpnorm xi3zpes4cm1, exec, exec, noexec, exec, exec, exec, noexec, exec zpnorm xi3zpcs4, exec, noexec, exec, exec, exec, exec, noexec, noexec zpnorm xi3zpecs4, exec, exec, exec, exec, exec, exec, noexec, noexec zpnorm xr3zps4k, noexec, noexec, noexec, exec, exec, noexec, noexec, noexec zpnorm xr3zps4kc1, noexec, noexec, noexec, exec, exec, noexec, exec, noexec zpnorm xr3zps4kcm1, noexec, noexec, noexec, exec, exec, noexec, noexec, exec zpnorm xr3zpes4k, noexec, exec, noexec, exec, exec, noexec, noexec, noexec zpnorm xr3zpes4kc1, noexec, exec, noexec, exec, exec, noexec, exec, noexec zpnorm xr3zpes4kcm1, noexec, exec, noexec, exec, exec, noexec, noexec, exec zpnorm xr3zpcs4k, noexec, noexec, exec, exec, exec, noexec, noexec, noexec zpnorm xr3zpecs4k, noexec, exec, exec, exec, exec, noexec, noexec, noexec zpnorm xi3zps4k, exec, noexec, noexec, exec, exec, noexec, noexec, noexec zpnorm xi3zps4kc1, exec, noexec, noexec, exec, exec, noexec, exec, noexec zpnorm xi3zps4kcm1, exec, noexec, noexec, exec, exec, noexec, noexec, exec zpnorm xi3zpes4k, exec, exec, noexec, exec, exec, noexec, noexec, noexec zpnorm xi3zpes4kc1, exec, exec, noexec, exec, exec, noexec, exec, noexec zpnorm xi3zpes4kcm1, exec, exec, noexec, exec, exec, noexec, noexec, exec zpnorm xi3zpcs4k, exec, noexec, exec, exec, exec, noexec, noexec, noexec zpnorm xi3zpecs4k, exec, exec, exec, exec, exec, noexec, noexec, noexec inorm xr3bs4, noexec, noexec, noexec, noexec, noexec, exec inorm xr3ebs4, noexec, noexec, exec, noexec, noexec, exec inorm xr3cbs4, noexec, noexec, noexec, exec, noexec, exec inorm xr3ecbs4, noexec, noexec, exec, exec, noexec, exec inorm xi3bs4, exec, noexec, noexec, noexec, noexec, exec inorm xi3ebs4, exec, noexec, exec, noexec, noexec, exec inorm xi3cbs4, exec, noexec, noexec, exec, noexec, exec inorm xi3ecbs4, exec, noexec, exec, exec, noexec, exec zpnorm xr3zpbs4, noexec, noexec, noexec, noexec, exec, exec, noexec, noexec zpnorm xr3zpbs4c1, noexec, noexec, noexec, noexec, exec, exec, exec, noexec zpnorm xr3zpbs4cm1, noexec, noexec, noexec, noexec, exec, exec, noexec, exec zpnorm xr3zpebs4, noexec, exec, noexec, noexec, exec, exec, noexec, noexec zpnorm xr3zpebs4c1, noexec, exec, noexec, noexec, exec, exec, exec, noexec zpnorm xr3zpebs4cm1, noexec, exec, noexec, noexec, exec, exec, noexec, exec zpnorm xr3zpcbs4, noexec, noexec, exec, noexec, exec, exec, noexec, noexec zpnorm xr3zpecbs4, noexec, exec, exec, noexec, exec, exec, noexec, noexec zpnorm xi3zpbs4, exec, noexec, noexec, noexec, exec, exec, noexec, noexec zpnorm xi3zpbs4c1, exec, noexec, noexec, noexec, exec, exec, exec, noexec zpnorm xi3zpbs4cm1, exec, noexec, noexec, noexec, exec, exec, noexec, exec zpnorm xi3zpebs4, exec, exec, noexec, noexec, exec, exec, noexec, noexec zpnorm xi3zpebs4c1, exec, exec, noexec, noexec, exec, exec, exec, noexec zpnorm xi3zpebs4cm1, exec, exec, noexec, noexec, exec, exec, noexec, exec zpnorm xi3zpcbs4, exec, noexec, exec, noexec, exec, exec, noexec, noexec zpnorm xi3zpecbs4, exec, exec, exec, noexec, exec, exec, noexec, noexec zpnorm xr3zpbs4k, noexec, noexec, noexec, noexec, exec, noexec, noexec, noexec zpnorm xr3zpbs4kc1, noexec, noexec, noexec, noexec, exec, noexec, exec, noexec zpnorm xr3zpbs4kcm1, noexec, noexec, noexec, noexec, exec, noexec, noexec, exec zpnorm xr3zpebs4k, noexec, exec, noexec, noexec, exec, noexec, noexec, noexec zpnorm xr3zpebs4kc1, noexec, exec, noexec, noexec, exec, noexec, exec, noexec zpnorm xr3zpebs4kcm1, noexec, exec, noexec, noexec, exec, noexec, noexec, exec zpnorm xr3zpcbs4k, noexec, noexec, exec, noexec, exec, noexec, noexec, noexec zpnorm xr3zpecbs4k, noexec, exec, exec, noexec, exec, noexec, noexec, noexec zpnorm xi3zpbs4k, exec, noexec, noexec, noexec, exec, noexec, noexec, noexec zpnorm xi3zpbs4kc1, exec, noexec, noexec, noexec, exec, noexec, exec, noexec zpnorm xi3zpbs4kcm1, exec, noexec, noexec, noexec, exec, noexec, noexec, exec zpnorm xi3zpebs4k, exec, exec, noexec, noexec, exec, noexec, noexec, noexec zpnorm xi3zpebs4kc1, exec, exec, noexec, noexec, exec, noexec, exec, noexec zpnorm xi3zpebs4kcm1, exec, exec, noexec, noexec, exec, noexec, noexec, exec zpnorm xi3zpcbs4k, exec, noexec, exec, noexec, exec, noexec, noexec, noexec zpnorm xi3zpecbs4k, exec, exec, exec, noexec, exec, noexec, noexec, noexec _TEXT ENDS END
oeis/326/A326058.asm
neoneye/loda-programs
11
14832
<reponame>neoneye/loda-programs ; A326058: a(n) = n - {the sum of square divisors of n}. ; 0,1,2,-1,4,5,6,3,-1,9,10,7,12,13,14,-5,16,8,18,15,20,21,22,19,-1,25,17,23,28,29,30,11,32,33,34,-14,36,37,38,35,40,41,42,39,35,45,46,27,-1,24,50,47,52,44,54,51,56,57,58,55,60,61,53,-21,64,65,66,63,68,69,70,22,72,73,49,71,76,77,78,59,-10,81,82,79,84,85,86,83,88,80,90,87,92,93,94,75,96,48,89,-30 mov $1,$0 lpb $0 mov $2,$0 mov $0,1 seq $2,71326 ; Sum of squares > 1 dividing n. sub $1,$2 lpe mov $0,$1
oeis/203/A203243.asm
neoneye/loda-programs
11
83423
; A203243: Second elementary symmetric function of the first n terms of (1,3,9,27,81,...). ; 3,39,390,3630,33033,298389,2688780,24208860,217909263,1961271939,17651713170,158866215690,1429798332693,12868192168689,115813751041560,1042323823944120,9380914609207323,84428232063996639,759854090319361950 add $0,2 mov $1,3 pow $1,$0 sub $1,2 pow $1,2 mov $0,$1 sub $0,49 div $0,16 add $0,3
src/main/antlr/TextTemplateParser.g4
eisnerw/texttemplate-editor
1
6250
parser grammar TextTemplateParser; options { tokenVocab=TextTemplateLexer; } compilationUnit: beginningBullet? templateContents+ EOF ; subtemplateSection: SUBTEMPLATES text* subtemplateSpecs; subtemplateSpecs: subtemplateSpec*; subtemplateSpec: templateContextToken text*; templateContents: beginningBullet? (subtemplateSection | bullet | templateToken | templateContextCommaToken | templateContextToken | text+); bullet: NL BULLET SPACES?; beginningBullet: BULLET SPACES?; text: TEXT | NL | SPACES | continuation; continuation: CONTINUATION; templateToken: LBRACE bracedOptions RBRACE; bracedOptions: bracedArrow #braceArrow | bracedThinArrow #braceThinArrow | optionallyInvoked #braced | predicateExpression #bracedPredicate; methodInvoked: methodable methodInvocation+; predicateExpression: LP predicateExpression RP #nestedPredicate | relationalOperand RELATIONAL relationalOperand #relationalOperation | NOT predicateExpression #notPredicate | predicateExpression (AND|OR) predicateExpression #logicalOperator | (methodInvoked | namedSubtemplate | identifierCondition) #condition; relationalOperand: optionallyInvoked | quoteOperand | apostropheOperand | namedSubtemplate | identifierOperand | digits; digits: MINUS* DIGITS; quoteOperand: QUOTE TEXT? QUOTE; apostropheOperand: APOSTROPHE TEXT? APOSTROPHE; identifierOperand: IDENTIFIER; identifierCondition: IDENTIFIER (DOT IDENTIFIER)*; templateContextCommaToken: LBRACE contextToken COMMA optionallyInvoked RBRACE; templateContextToken: LBRACE contextToken RBRACE; contextToken: ((namedSubtemplate | optionallyInvoked) COLON | COLON) (namedSubtemplate | optionallyInvoked); templateSpec: namedSubtemplate | bracketedTemplateSpec; bracketedTemplateSpec: LBRACKET templateContents* subtemplateSection? RBRACKET; invokedTemplateSpec: LBRACKET beginningBullet? templateContents* RBRACKETLP; bracedArrow: predicateExpression ARROW bracedArrowTemplateSpec; bracedThinArrow: predicateExpression THINARROW optionallyInvoked; bracedArrowTemplateSpec: optionallyInvoked COMMA optionallyInvoked | optionallyInvoked; methodable: QUOTE TEXT? QUOTE #quoteLiteral | APOSTROPHE TEXT* APOSTROPHE #apostropheLiteral | templateSpec #methodableTemplateSpec | (IDENTIFIER|TEXT) (DOT (IDENTIFIER|TEXT))* #identifier; methodInvocation: (method|DOT invokedTemplateSpec) arguments* RP; method: METHODNAME; arguments: argument (COMMA argument)*; optionallyInvoked: (methodInvoked | methodable); argument: REGEX #regex | optionallyInvoked #optionallyInvokedArgument | predicateExpression #predicateArgument | digits #digitsArgument; namedSubtemplate: POUND IDENTIFIER;
chocolate_vending.asm
pranavgo/Chocolate_Vending_MPI
0
242650
#make_bin# ; BIN is plain binary format similar to .com format, but not limited to 1 segment; ; All values between # are directives, these values are saved into a separate .binf file. ; Before loading .bin file emulator reads .binf file with the same file name. ; All directives are optional, if you don't need them, delete them. ; set loading address, .bin file will be loaded to this address: #LOAD_SEGMENT=FFFFh# #LOAD_OFFSET=0000h# ; set entry point: #CS=0000h# ; same as loading segment #IP=0000h# ; same as loading offset ; set segment registers #DS=0000h# ; same as loading segment #ES=0000h# ; same as loading segment ; set stack #SS=0000h# ; same as loading segment #SP=FFFEh# ; set to top of loading segment ; set general registers (optional) #AX=0000h# #BX=0000h# #CX=0000h# #DX=0000h# #SI=0000h# #DI=0000h# #BP=0000h# jmp st1 nop db 1024 dup(0) ; Main program st1: cli ; intialize ds,es,ss to start of RAM mov ax,0200h mov ds,ax mov es,ax mov ss,ax mov sp,0FFFEH mov si,0000 ; DATA JMP START PORTA1 EQU 00h PORTB1 EQU 02h PORTC1 EQU 04h CREG1 EQU 06h PORTA2 EQU 08h PORTB2 EQU 0ah PORTC2 EQU 0ch CREG2 EQU 0eh CNT0 EQU 10H CREG3 EQU 16H STEPPER_MOTOR EQU 88H PERKC DB 100 FIVEC DB 100 DMC DB 100 PERKID EQU 36 FIVEID EQU 61 DMID EQU 86 PRICE DB ? START: ; Initialize 8255A ; portA1 as input, portB1 is NC, portC1 lower as output and portc1 upper as input. MOV AL, 9AH ;10011010b OUT CREG1, AL ; portA2 as output, portB2 as output, portC2 lower as output and portc2 upper as input MOV AL, 88H ;10001000b OUT CREG2, AL ; initialise all ouput as 0 MOV AL,00 OUT PORTC1,AL MOV AL,00H OUT PORTA2,AL MOV AL,00H OUT PORTB2,AL Main: ;first making sure that all keys are released x1 : IN AL,PORTC2 CMP AL,70H JNZ X1 ;checking for a key press x2: IN AL,PORTC2 AND AL,70H CMP AL,60H JZ PERK CMP AL,50H JZ FIVESTAR CMP AL,30H JZ DM JMP X2 ; loop back if no button pressed PERK: ; checking count of available Perk chocolates CMP PERKC,0 JZ LED_GLOW_PERK ; if available then process starts CALL ACCEPT_COIN MOV PRICE,PERKID CALL PRICE_INITIATE CALL DELAY_20MS CALL DISPENSE_PERK CALL DELAY_20MS DEC PERKC CALL CLOSE_COIN JMP START FIVESTAR: ; checking count of available Five Star chocolates CMP FIVEC,0 JZ LED_GLOW_FIVE ; if available then process starts CALL ACCEPT_COIN MOV PRICE,FIVEID CALL PRICE_INITIATE CALL DISPENSE_FIVE DEC FIVEC CALL CLOSE_COIN JMP START DM: ; checking count of available Dairy Milk chocolates CMP DMC,0 JZ LED_GLOW_DM ; if available then process starts CALL ACCEPT_COIN MOV PRICE,DMID CALL PRICE_INITIATE CALL DISPENSE_DM DEC DMC CALL CLOSE_COIN JMP START LED_GLOW_PERK: ; to glow LED red indicating no Perk chocolate available ;PC0 IS HIGH FOR PERK MOV AL,01H OUT PORTC2,AL LED_GLOW_FIVE: ; to glow LED red indicating no Five Star chocolate available ;PC1 IS HIGH FOR FIVESTAR MOV AL,02H ;00000010B OUT PORTC2,AL LED_GLOW_DM: ; to glow LED red indicating no Dairy Milk chocolate available ;PC2 IS HIGH FOR DAIRYMILK MOV AL,04H ;00000100B OUT PORTC2,AL hlt ACCEPT_COIN PROC NEAR ; moves the stepper motor-4 to open the coin aceptance flap PUSHF PUSH AX PUSH BX PUSH CX MOV AL,STEPPER_MOTOR MOV CX,50 ; 50 is equivalent to 180 Deg rotation ROT_MOTOR_4_CLKWISE: ; rotates the motor clockwise MOV BL,AL AND AL,0F0H OUT PORTB2,AL CALL DELAY_20MS MOV AL,BL ROR AL,01 DEC CX JNZ ROT_MOTOR_4_CLKWISE ; shut off motor MOV AL,00H OUT PORTB2,AL POP CX POP BX POP AX POPF RET ACCEPT_COIN ENDP PRICE_INITIATE PROC NEAR ; takes ADC input and waits until it becomes equal to required coin weight PUSHF PUSH AX PUSH BX PUSH CX mov cl,PRICE ;ale activated X8: mov AL,01H ;00000001B OUT PORTC1,AL ;soc high mov AL,03H ;00000011B OUT PORTC1,AL ; waiting nop nop nop nop ;ale low and AL,11111110b OUT PORTC1,AL ;soc low and AL,11111101b OUT PORTC1,AL X7: ; checking for EOC high IN AL,PORTC1 AND AL,10H JZ X7 ; OE high MOV AL,04H OUT PORTC1,AL ; taking ADC input IN AL,PORTA1 CMP AL,CL ; comparing to pre-defined coin weight required for the selected chocolate JNZ X8 ; looping back to take another input from ADC if weight not matched POP CX POP BX POP AX POPF RET PRICE_INITIATE ENDP DISPENSE_PERK PROC NEAR ; rotates the motor-1 to dispense Perk Chocolate PUSHF PUSH AX PUSH BX PUSH CX MOV AL,STEPPER_MOTOR MOV CX,100 ;100 IS EQUIVALENT TO 360 DEG ROTATION ROT_MOTOR_1: MOV BL,AL AND AL,0FH OUT PORTA2,AL CALL DELAY_20MS MOV AL,BL ROL AL,01 DEC CX JNZ ROT_MOTOR_1 MOV AL,00 OUT PORTA2,AL POP CX POP BX POP AX POPF RET DISPENSE_PERK ENDP DISPENSE_FIVE PROC NEAR ; rotates the motor-2 to dispense Five Star Chocolate PUSHF PUSH AX PUSH BX PUSH CX MOV AL,STEPPER_MOTOR MOV CX,100 ;100 IS EQUIVALENT TO 360 DEG ROTATION ROT_MOTOR_2: MOV BL,AL AND AL,0F0H OUT PORTA2,AL CALL DELAY_20MS MOV AL,BL ROL AL,01 DEC CX JNZ ROT_MOTOR_2 MOV AL,00 OUT PORTA2,AL POP CX POP BX POP AX POPF RET DISPENSE_FIVE ENDP DISPENSE_DM PROC NEAR ; rotates the motor-3 to dispense Dairy Milk Chocolate PUSHF PUSH AX PUSH BX PUSH CX MOV AL,STEPPER_MOTOR MOV CX,100 ;100 IS EQUIVALENT TO 360 DEG ROTATION ROT_MOTOR_3: MOV BL,AL AND AL,0FH OUT PORTB2,AL CALL DELAY_20MS MOV AL,BL ROL AL,01 DEC CX JNZ ROT_MOTOR_3 MOV AL,00 OUT PORTB2,AL POP CX POP BX POP AX POPF RET DISPENSE_DM ENDP CLOSE_COIN PROC NEAR ; moves the stepper motor-4 to close the coin aceptance flap PUSHF PUSH AX PUSH BX PUSH CX MOV AL,STEPPER_MOTOR MOV CX,50 ;50 IS EQUIVALENT TO 180 DEG ROTATION ROT_MOTOR_4_ANTICLKWISE: MOV BL,AL AND AL,0F0H OUT PORTB2,AL CALL DELAY_20MS MOV AL,BL ROL AL,01 DEC CX JNZ ROT_MOTOR_4_ANTICLKWISE MOV AL,00 OUT PORTB2,AL POP CX POP BX POP AX POPF RET CLOSE_COIN ENDP DELAY_20MS PROC NEAR ; general delay function PUSHF PUSH AX PUSH BX PUSH CX PUSH DX NOP NOP NOP NOP NOP NOP POP DX POP CX POP BX POP AX POPF RET DELAY_20MS ENDP
programs/oeis/330/A330410.asm
neoneye/loda
22
3508
; A330410: a(n) = 6*prime(n) - 1. ; 11,17,29,41,65,77,101,113,137,173,185,221,245,257,281,317,353,365,401,425,437,473,497,533,581,605,617,641,653,677,761,785,821,833,893,905,941,977,1001,1037,1073,1085,1145,1157,1181,1193,1265,1337,1361,1373,1397,1433,1445 seq $0,40 ; The prime numbers. mul $0,6 sub $0,1
tools-src/gnu/gcc/gcc/ada/xref_lib.adb
enfoTek/tomato.linksys.e2000.nvram-mod
80
19840
<reponame>enfoTek/tomato.linksys.e2000.nvram-mod ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- X R E F _ L I B -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1998-2001 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. -- -- -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Strings.Fixed; use Ada.Strings.Fixed; with GNAT.Command_Line; use GNAT.Command_Line; with GNAT.IO_Aux; use GNAT.IO_Aux; with Osint; with Output; use Output; with Types; use Types; with Unchecked_Deallocation; package body Xref_Lib is Type_Position : constant := 50; -- Column for label identifying type of entity --------------------- -- Local Variables -- --------------------- D : constant Character := 'D'; X : constant Character := 'X'; W : constant Character := 'W'; Dot : constant Character := '.'; Pipe : constant Character := '|'; -- First character on xref lines in the .ali file EOF : constant Character := ASCII.SUB; -- Special character to signal end of file. Not required in input file, -- but should be properly treated if present. See also Read_File. No_Xref_Information : exception; -- Exception raised when there is no cross-referencing information in -- the .ali files subtype File_Offset is Natural; function End_Of_Line_Index (File : ALI_File) return Integer; -- Returns the index of the last character of the current_line procedure Read_File (FD : File_Descriptor; Contents : out String_Access; Success : out Boolean); -- Reads file associated with FS into the newly allocated -- string Contents. An EOF character will be added to the -- returned Contents to simplify parsing. -- [VMS] Success is true iff the number of bytes read is less than or -- equal to the file size. -- [Other] Success is true iff the number of bytes read is equal to -- the file size. procedure Parse_EOL (Source : access String; Ptr : in out Positive); -- On return Source (Ptr) is the first character of the next line -- or EOF. Source.all must be terminated by EOF. procedure Parse_Identifier_Info (Pattern : Search_Pattern; File : in out ALI_File; Local_Symbols : Boolean; Der_Info : Boolean := False; Type_Tree : Boolean := False; Wide_Search : Boolean := True); -- Output the file and the line where the identifier was referenced, -- If Local_Symbols is False then only the publicly visible symbols -- will be processed procedure Parse_Token (Source : access String; Ptr : in out Positive; Token_Ptr : out Positive); -- Skips any separators and stores the start of the token in Token_Ptr. -- Then stores the position of the next separator in Ptr. -- On return Source (Token_Ptr .. Ptr - 1) is the token. -- Separators are space and ASCII.HT. -- Parse_Token will never skip to the next line. procedure Parse_Number (Source : access String; Ptr : in out Positive; Number : out Natural); -- Skips any separators and parses Source upto the first character that -- is not a decimal digit. Returns value of parsed digits or 0 if none. procedure Parse_X_Filename (File : in out ALI_File); -- Reads and processes "X..." lines in the ALI file -- and updates the File.X_File information. ---------------- -- Add_Entity -- ---------------- procedure Add_Entity (Pattern : in out Search_Pattern; Entity : String; Glob : Boolean := False) is File_Start : Natural; Line_Start : Natural; Col_Start : Natural; Line_Num : Natural := 0; Col_Num : Natural := 0; File_Ref : File_Reference := Empty_File; File_Existed : Boolean; Has_Pattern : Boolean := False; begin -- Find the end of the first item in Entity (pattern or file?) -- If there is no ':', we only have a pattern File_Start := Index (Entity, ":"); if File_Start = 0 then -- If the regular expression is invalid, just consider it as a string begin Pattern.Entity := Compile (Entity, Glob, False); Pattern.Initialized := True; exception when Error_In_Regexp => -- The basic idea is to insert a \ before every character declare Tmp_Regexp : String (1 .. 2 * Entity'Length); Index : Positive := 1; begin for J in Entity'Range loop Tmp_Regexp (Index) := '\'; Tmp_Regexp (Index + 1) := Entity (J); Index := Index + 2; end loop; Pattern.Entity := Compile (Tmp_Regexp, True, False); Pattern.Initialized := True; end; end; Set_Default_Match (True); return; end if; -- If there is a dot in the pattern, then it is a file name if (Glob and then Index (Entity (Entity'First .. File_Start - 1), ".") /= 0) or else (not Glob and then Index (Entity (Entity'First .. File_Start - 1), "\.") /= 0) then Pattern.Entity := Compile (".*", False); Pattern.Initialized := True; File_Start := Entity'First; else -- If the regular expression is invalid, -- just consider it as a string begin Pattern.Entity := Compile (Entity (Entity'First .. File_Start - 1), Glob, False); Pattern.Initialized := True; exception when Error_In_Regexp => -- The basic idea is to insert a \ before every character declare Tmp_Regexp : String (1 .. 2 * (File_Start - Entity'First)); Index : Positive := 1; begin for J in Entity'First .. File_Start - 1 loop Tmp_Regexp (Index) := '\'; Tmp_Regexp (Index + 1) := Entity (J); Index := Index + 2; end loop; Pattern.Entity := Compile (Tmp_Regexp, True, False); Pattern.Initialized := True; end; end; File_Start := File_Start + 1; Has_Pattern := True; end if; -- Parse the file name Line_Start := Index (Entity (File_Start .. Entity'Last), ":"); -- Check if it was a disk:\directory item (for NT and OS/2) if File_Start = Line_Start - 1 and then Line_Start < Entity'Last and then Entity (Line_Start + 1) = '\' then Line_Start := Index (Entity (Line_Start + 1 .. Entity'Last), ":"); end if; if Line_Start = 0 then Line_Start := Entity'Length + 1; elsif Line_Start /= Entity'Last then Col_Start := Index (Entity (Line_Start + 1 .. Entity'Last), ":"); if Col_Start = 0 then Col_Start := Entity'Last + 1; end if; if Col_Start > Line_Start + 1 then begin Line_Num := Natural'Value (Entity (Line_Start + 1 .. Col_Start - 1)); exception when Constraint_Error => raise Invalid_Argument; end; end if; if Col_Start < Entity'Last then begin Col_Num := Natural'Value (Entity (Col_Start + 1 .. Entity'Last)); exception when Constraint_Error => raise Invalid_Argument; end; end if; end if; Add_File (Entity (File_Start .. Line_Start - 1), File_Existed, File_Ref, Visited => True); Add_Line (File_Ref, Line_Num, Col_Num); Add_File (ALI_File_Name (Entity (File_Start .. Line_Start - 1)), File_Existed, File_Ref, Visited => False, Emit_Warning => True); end Add_Entity; -------------- -- Add_File -- -------------- procedure Add_File (File : String) is File_Ref : File_Reference := Empty_File; File_Existed : Boolean; Iterator : Expansion_Iterator; procedure Add_File_Internal (File : String); -- Do the actual addition of the file ----------------------- -- Add_File_Internal -- ----------------------- procedure Add_File_Internal (File : String) is begin -- Case where we have an ALI file, accept it even though this is -- not official usage, since the intention is obvious if Tail (File, 4) = ".ali" then Add_File (File, File_Existed, File_Ref, Visited => False, Emit_Warning => True); -- Normal non-ali file case else Add_File (File, File_Existed, File_Ref, Visited => True); Add_File (ALI_File_Name (File), File_Existed, File_Ref, Visited => False, Emit_Warning => True); end if; end Add_File_Internal; -- Start of processing for Add_File begin -- Check if we need to do the expansion if Ada.Strings.Fixed.Index (File, "*") /= 0 or else Ada.Strings.Fixed.Index (File, "?") /= 0 then Start_Expansion (Iterator, File); loop declare S : constant String := Expansion (Iterator); begin exit when S'Length = 0; Add_File_Internal (S); end; end loop; else Add_File_Internal (File); end if; end Add_File; ----------------------- -- Current_Xref_File -- ----------------------- function Current_Xref_File (File : ALI_File) return File_Reference is begin return File.X_File; end Current_Xref_File; -------------------------- -- Default_Project_File -- -------------------------- function Default_Project_File (Dir_Name : String) return String is My_Dir : Dir_Type; Dir_Ent : File_Name_String; Last : Natural; begin Open (My_Dir, Dir_Name); loop Read (My_Dir, Dir_Ent, Last); exit when Last = 0; if Tail (Dir_Ent (1 .. Last), 4) = ".adp" then -- The first project file found is the good one. Close (My_Dir); return Dir_Ent (1 .. Last); end if; end loop; Close (My_Dir); return String'(1 .. 0 => ' '); exception when Directory_Error => return String'(1 .. 0 => ' '); end Default_Project_File; ----------------------- -- End_Of_Line_Index -- ----------------------- function End_Of_Line_Index (File : ALI_File) return Integer is Index : Integer := File.Current_Line; begin while Index <= File.Buffer'Last and then File.Buffer (Index) /= ASCII.LF loop Index := Index + 1; end loop; return Index; end End_Of_Line_Index; --------------- -- File_Name -- --------------- function File_Name (File : ALI_File; Num : Positive) return File_Reference is begin return File.Dep.Table (Num); end File_Name; -------------------- -- Find_ALI_Files -- -------------------- procedure Find_ALI_Files is My_Dir : Rec_DIR; Dir_Ent : File_Name_String; Last : Natural; File_Existed : Boolean; File_Ref : File_Reference; function Open_Next_Dir return Boolean; -- Tries to open the next object directory, and return False if -- the directory cannot be opened. ------------------- -- Open_Next_Dir -- ------------------- function Open_Next_Dir return Boolean is begin -- Until we are able to open a new directory loop declare Obj_Dir : constant String := Next_Obj_Dir; begin -- If there was no more Obj_Dir line if Obj_Dir'Length = 0 then return False; end if; Open (My_Dir.Dir, Obj_Dir); exit; exception -- Could not open the directory when Directory_Error => null; end; end loop; return True; end Open_Next_Dir; -- Start of processing for Find_ALI_Files begin if Open_Next_Dir then loop Read (My_Dir.Dir, Dir_Ent, Last); if Last = 0 then Close (My_Dir.Dir); if not Open_Next_Dir then return; end if; elsif Last > 4 and then Dir_Ent (Last - 3 .. Last) = ".ali" then Add_File (Dir_Ent (1 .. Last), File_Existed, File_Ref, Visited => False); Set_Directory (File_Ref, Current_Obj_Dir); end if; end loop; end if; end Find_ALI_Files; ------------------- -- Get_Full_Type -- ------------------- function Get_Full_Type (Abbrev : Character) return String is begin case Abbrev is when 'A' => return "array type"; when 'B' => return "boolean type"; when 'C' => return "class-wide type"; when 'D' => return "decimal type"; when 'E' => return "enumeration type"; when 'F' => return "float type"; when 'I' => return "integer type"; when 'M' => return "modular type"; when 'O' => return "fixed type"; when 'P' => return "access type"; when 'R' => return "record type"; when 'S' => return "string type"; when 'T' => return "task type"; when 'W' => return "protected type"; when 'a' => return "array type"; when 'b' => return "boolean object"; when 'c' => return "class-wide object"; when 'd' => return "decimal object"; when 'e' => return "enumeration object"; when 'f' => return "float object"; when 'i' => return "integer object"; when 'm' => return "modular object"; when 'o' => return "fixed object"; when 'p' => return "access object"; when 'r' => return "record object"; when 's' => return "string object"; when 't' => return "task object"; when 'w' => return "protected object"; when 'K' => return "package"; when 'k' => return "generic package"; when 'L' => return "statement label"; when 'l' => return "loop label"; when 'N' => return "named number"; when 'n' => return "enumeration literal"; when 'q' => return "block label"; when 'U' => return "procedure"; when 'u' => return "generic procedure"; when 'V' => return "function"; when 'v' => return "generic function"; when 'X' => return "exception"; when 'Y' => return "entry"; -- The above should be the only possibilities, but for a -- tool like this we don't want to bomb if we find something -- else, so just return ??? when we have an unknown Abbrev value when others => return "???"; end case; end Get_Full_Type; ----------- -- Match -- ----------- function Match (Pattern : Search_Pattern; Symbol : String) return Boolean is begin -- Get the entity name return Match (Symbol, Pattern.Entity); end Match; ---------- -- Open -- ---------- procedure Open (Name : String; File : out ALI_File; Dependencies : Boolean := False) is Name_0 : constant String := Name & ASCII.NUL; Num_Dependencies : Natural := 0; File_Existed : Boolean; File_Ref : File_Reference; FD : File_Descriptor; Success : Boolean := False; Ali : String_Access renames File.Buffer; Token : Positive; Ptr : Positive; File_Start : Positive; File_End : Positive; Gnatchop_Offset : Integer; Gnatchop_Name : Positive; begin if File.Buffer /= null then Free (File.Buffer); end if; Init (File.Dep); FD := Open_Read (Name_0'Address, Binary); if FD = Invalid_FD then raise No_Xref_Information; end if; Read_File (FD, Ali, Success); Close (FD); Ptr := Ali'First; -- Read all the lines possibly processing with-clauses and dependency -- information and exit on finding the first Xref line. -- A fall-through of the loop means that there is no xref information -- which is an error condition. while Ali (Ptr) /= EOF loop if Ali (Ptr) = D then -- Found dependency information. Format looks like: -- D source-name time-stamp checksum [subunit-name] \ -- [line:file-name] -- Skip the D and parse the filename Ptr := Ptr + 1; Parse_Token (Ali, Ptr, Token); File_Start := Token; File_End := Ptr - 1; Num_Dependencies := Num_Dependencies + 1; Set_Last (File.Dep, Num_Dependencies); Parse_Token (Ali, Ptr, Token); -- Skip time-stamp Parse_Token (Ali, Ptr, Token); -- Skip checksum Parse_Token (Ali, Ptr, Token); -- Read next entity on the line if not (Ali (Token) in '0' .. '9') then Parse_Token (Ali, Ptr, Token); -- Was a subunit name end if; -- Did we have a gnatchop-ed file with a pragma Source_Reference ? Gnatchop_Offset := 0; if Ali (Token) in '0' .. '9' then Gnatchop_Name := Token; while Ali (Gnatchop_Name) /= ':' loop Gnatchop_Name := Gnatchop_Name + 1; end loop; Gnatchop_Offset := 2 - Natural'Value (Ali (Token .. Gnatchop_Name - 1)); Token := Gnatchop_Name + 1; end if; Add_File (Ali (File_Start .. File_End), File_Existed, File.Dep.Table (Num_Dependencies), Gnatchop_File => Ali (Token .. Ptr - 1), Gnatchop_Offset => Gnatchop_Offset); elsif Dependencies and then Ali (Ptr) = W then -- Found with-clause information. Format looks like: -- "W debug%s debug.adb debug.ali" -- Skip the W and parse the .ali filename (3rd token) Parse_Token (Ali, Ptr, Token); Parse_Token (Ali, Ptr, Token); Parse_Token (Ali, Ptr, Token); Add_File (Ali (Token .. Ptr - 1), File_Existed, File_Ref, Visited => False); elsif Ali (Ptr) = X then -- Found a cross-referencing line - stop processing File.Current_Line := Ptr; File.Xref_Line := Ptr; return; end if; Parse_EOL (Ali, Ptr); end loop; raise No_Xref_Information; end Open; --------------- -- Parse_EOL -- --------------- procedure Parse_EOL (Source : access String; Ptr : in out Positive) is begin -- Skip to end of line while Source (Ptr) /= ASCII.CR and then Source (Ptr) /= ASCII.LF and then Source (Ptr) /= EOF loop Ptr := Ptr + 1; end loop; if Source (Ptr) /= EOF then Ptr := Ptr + 1; -- skip CR or LF end if; -- Skip past CR/LF or LF/CR combination if (Source (Ptr) = ASCII.CR or else Source (Ptr) = ASCII.LF) and then Source (Ptr) /= Source (Ptr - 1) then Ptr := Ptr + 1; end if; end Parse_EOL; --------------------------- -- Parse_Identifier_Info -- --------------------------- procedure Parse_Identifier_Info (Pattern : Search_Pattern; File : in out ALI_File; Local_Symbols : Boolean; Der_Info : Boolean := False; Type_Tree : Boolean := False; Wide_Search : Boolean := True) is Ptr : Positive renames File.Current_Line; Ali : String_Access renames File.Buffer; E_Line : Natural; -- Line number of current entity E_Col : Natural; -- Column number of current entity E_Type : Character; -- Type of current entity E_Name : Positive; -- Pointer to begin of entity name E_Global : Boolean; -- True iff entity is global R_Line : Natural; -- Line number of current reference R_Col : Natural; -- Column number of current reference R_Type : Character; -- Type of current reference Decl_Ref : Declaration_Reference; File_Ref : File_Reference := Current_Xref_File (File); function Get_Symbol_Name (Eun, Line, Col : Natural) return String; -- Returns the symbol name for the entity defined at the specified -- line and column in the dependent unit number Eun. For this we need -- to parse the ali file again because the parent entity is not in -- the declaration table if it did not match the search pattern. --------------------- -- Get_Symbol_Name -- --------------------- function Get_Symbol_Name (Eun, Line, Col : Natural) return String is Ptr : Positive := 1; E_Eun : Positive; -- Unit number of current entity E_Line : Natural; -- Line number of current entity E_Col : Natural; -- Column number of current entity E_Name : Positive; -- Pointer to begin of entity name E_Type : Character; -- Type of current entity procedure Skip_Line; -- skip current line and continuation line procedure Skip_Line is begin loop Parse_EOL (Ali, Ptr); exit when Ali (Ptr) /= '.'; end loop; end Skip_Line; -- Start of processing for Get_Symbol_Name begin -- Look for the X lines corresponding to unit Eun loop if Ali (Ptr) = 'X' then Ptr := Ptr + 1; Parse_Number (Ali, Ptr, E_Eun); exit when E_Eun = Eun; end if; Skip_Line; end loop; -- Here we are in the right Ali section, we now look for the entity -- declared at position (Line, Col). loop Parse_Number (Ali, Ptr, E_Line); E_Type := Ali (Ptr); Ptr := Ptr + 1; Parse_Number (Ali, Ptr, E_Col); Ptr := Ptr + 1; if Line = E_Line and then Col = E_Col then Parse_Token (Ali, Ptr, E_Name); return Ali (E_Name .. Ptr - 1); end if; Skip_Line; end loop; -- We were not able to find the symbol, this should not happend but -- since we don't want to stop here we return a string of three -- question marks as the symbol name. return "???"; end Get_Symbol_Name; -- Start of processing for Parse_Identifier_Info begin -- The identifier info looks like: -- "38U9*Debug 12|36r6 36r19" -- Extract the line, column and entity name information Parse_Number (Ali, Ptr, E_Line); if Ali (Ptr) > ' ' then E_Type := Ali (Ptr); Ptr := Ptr + 1; end if; Parse_Number (Ali, Ptr, E_Col); E_Global := False; if Ali (Ptr) >= ' ' then E_Global := (Ali (Ptr) = '*'); Ptr := Ptr + 1; end if; Parse_Token (Ali, Ptr, E_Name); -- Exit if the symbol does not match -- or if we have a local symbol and we do not want it if (not Local_Symbols and not E_Global) or else (Pattern.Initialized and then not Match (Pattern, Ali (E_Name .. Ptr - 1))) or else (E_Name >= Ptr) then -- Skip rest of this line and all continuation lines loop Parse_EOL (Ali, Ptr); exit when Ali (Ptr) /= '.'; end loop; return; end if; -- Insert the declaration in the table Decl_Ref := Add_Declaration (File.X_File, Ali (E_Name .. Ptr - 1), E_Line, E_Col, E_Type); if Ali (Ptr) = '<' then -- Here we have a type derivation information. The format is -- <3|12I45> which means that the current entity is derived from the -- type defined in unit number 3, line 12 column 45. The pipe and -- unit number is optional. It is specified only if the parent type -- is not defined in the current unit. Ptr := Ptr + 1; Parse_Derived_Info : declare P_Line : Natural; -- parent entity line P_Column : Natural; -- parent entity column P_Type : Character; -- parent entity type P_Eun : Positive; -- parent entity file number begin Parse_Number (Ali, Ptr, P_Line); -- If we have a pipe then the first number was the unit number if Ali (Ptr) = '|' then P_Eun := P_Line; Ptr := Ptr + 1; -- Now we have the line number Parse_Number (Ali, Ptr, P_Line); else -- We don't have a unit number specified, so we set P_Eun to -- the current unit. for K in Dependencies_Tables.First .. Last (File.Dep) loop P_Eun := K; exit when File.Dep.Table (K) = File_Ref; end loop; end if; -- Then parse the type and column number P_Type := Ali (Ptr); Ptr := Ptr + 1; Parse_Number (Ali, Ptr, P_Column); -- Skip '>' Ptr := Ptr + 1; -- The derived info is needed only is the derived info mode is on -- or if we want to output the type hierarchy if Der_Info or else Type_Tree then Add_Parent (Decl_Ref, Get_Symbol_Name (P_Eun, P_Line, P_Column), P_Line, P_Column, File.Dep.Table (P_Eun)); end if; if Type_Tree then Search_Parent_Tree : declare Pattern : Search_Pattern; -- Parent type pattern File_Pos_Backup : Positive; begin Add_Entity (Pattern, Get_Symbol_Name (P_Eun, P_Line, P_Column) & ':' & Get_Gnatchop_File (File.Dep.Table (P_Eun)) & ':' & Get_Line (Get_Parent (Decl_Ref)) & ':' & Get_Column (Get_Parent (Decl_Ref)), False); -- No default match is needed to look for the parent type -- since we are using the fully qualified symbol name: -- symbol:file:line:column Set_Default_Match (False); -- The parent type is defined in the same unit as the -- derived type. So we want to revisit the unit. File_Pos_Backup := File.Current_Line; if File.Dep.Table (P_Eun) = File_Ref then -- set file pointer at the start of the xref lines File.Current_Line := File.Xref_Line; Revisit_ALI_File : declare File_Existed : Boolean; File_Ref : File_Reference; begin Add_File (ALI_File_Name (Get_File (File.Dep.Table (P_Eun))), File_Existed, File_Ref, Visited => False); Set_Unvisited (File_Ref); end Revisit_ALI_File; end if; Search (Pattern, Local_Symbols, False, False, Der_Info, Type_Tree); File.Current_Line := File_Pos_Backup; -- in this mode there is no need to parse the remaining of -- the lines. return; end Search_Parent_Tree; end if; end Parse_Derived_Info; end if; -- To find the body, we will have to parse the file too if Wide_Search then declare File_Existed : Boolean; File_Ref : File_Reference; File_Name : constant String := Get_Gnatchop_File (File.X_File); begin Add_File (ALI_File_Name (File_Name), File_Existed, File_Ref, False); end; end if; -- Parse references to this entity. -- Ptr points to next reference with leading blanks loop -- Process references on current line while Ali (Ptr) = ' ' or Ali (Ptr) = ASCII.HT loop -- For every reference read the line, type and column, -- optionally preceded by a file number and a pipe symbol. Parse_Number (Ali, Ptr, R_Line); if Ali (Ptr) = Pipe then Ptr := Ptr + 1; File_Ref := File_Name (File, R_Line); Parse_Number (Ali, Ptr, R_Line); end if; if Ali (Ptr) > ' ' then R_Type := Ali (Ptr); Ptr := Ptr + 1; end if; Parse_Number (Ali, Ptr, R_Col); -- Insert the reference or body in the table Add_Reference (Decl_Ref, File_Ref, R_Line, R_Col, R_Type); end loop; Parse_EOL (Ali, Ptr); -- Loop until new line is no continuation line exit when Ali (Ptr) /= '.'; Ptr := Ptr + 1; end loop; end Parse_Identifier_Info; ------------------ -- Parse_Number -- ------------------ procedure Parse_Number (Source : access String; Ptr : in out Positive; Number : out Natural) is begin -- Skip separators while Source (Ptr) = ' ' or else Source (Ptr) = ASCII.HT loop Ptr := Ptr + 1; end loop; Number := 0; while Source (Ptr) in '0' .. '9' loop Number := 10 * Number + (Character'Pos (Source (Ptr)) - Character'Pos ('0')); Ptr := Ptr + 1; end loop; end Parse_Number; ----------------- -- Parse_Token -- ----------------- procedure Parse_Token (Source : access String; Ptr : in out Positive; Token_Ptr : out Positive) is In_Quotes : Boolean := False; begin -- Skip separators while Source (Ptr) = ' ' or else Source (Ptr) = ASCII.HT loop Ptr := Ptr + 1; end loop; Token_Ptr := Ptr; -- Find end-of-token while (In_Quotes or else not (Source (Ptr) = ' ' or else Source (Ptr) = ASCII.HT or else Source (Ptr) = '<')) and then Source (Ptr) >= ' ' loop if Source (Ptr) = '"' then In_Quotes := not In_Quotes; end if; Ptr := Ptr + 1; end loop; end Parse_Token; ---------------------- -- Parse_X_Filename -- ---------------------- procedure Parse_X_Filename (File : in out ALI_File) is Ali : String_Access renames File.Buffer; Ptr : Positive renames File.Current_Line; File_Nr : Natural; begin while Ali (Ptr) = X loop -- The current line is the start of a new Xref file section, -- whose format looks like: -- " X 1 debug.ads" -- Skip the X and read the file number for the new X_File Ptr := Ptr + 1; Parse_Number (Ali, Ptr, File_Nr); if File_Nr > 0 then File.X_File := File.Dep.Table (File_Nr); end if; Parse_EOL (Ali, Ptr); end loop; end Parse_X_Filename; -------------------- -- Print_Gnatfind -- -------------------- procedure Print_Gnatfind (References : Boolean; Full_Path_Name : Boolean) is Decl : Declaration_Reference := First_Declaration; Ref1 : Reference; Ref2 : Reference; procedure Print_Ref (Ref : Reference; Msg : String := " "); -- Print a reference, according to the extended tag of the output --------------- -- Print_Ref -- --------------- procedure Print_Ref (Ref : Reference; Msg : String := " ") is Buffer : constant String := Osint.To_Host_File_Spec (Get_Gnatchop_File (Ref, Full_Path_Name)).all & ":" & Get_Line (Ref) & ":" & Get_Column (Ref) & ": "; Num_Blanks : Integer := Longest_File_Name + 10 - Buffer'Length; begin Num_Blanks := Integer'Max (0, Num_Blanks); Write_Line (Buffer & String'(1 .. Num_Blanks => ' ') & Msg & " " & Get_Symbol (Decl)); if Get_Source_Line (Ref)'Length /= 0 then Write_Line (" " & Get_Source_Line (Ref)); end if; end Print_Ref; -- Start of processing for Print_Gnatfind begin while Decl /= Empty_Declaration loop if Match (Decl) then -- Output the declaration declare Parent : constant Declaration_Reference := Get_Parent (Decl); Buffer : constant String := Osint.To_Host_File_Spec (Get_Gnatchop_File (Decl, Full_Path_Name)).all & ":" & Get_Line (Decl) & ":" & Get_Column (Decl) & ": "; Num_Blanks : Integer := Longest_File_Name + 10 - Buffer'Length; begin Num_Blanks := Integer'Max (0, Num_Blanks); Write_Line (Buffer & String'(1 .. Num_Blanks => ' ') & "(spec) " & Get_Symbol (Decl)); if Parent /= Empty_Declaration then Write_Line (Buffer & String'(1 .. Num_Blanks => ' ') & " derived from " & Get_Symbol (Parent) & " (" & Osint.To_Host_File_Spec (Get_Gnatchop_File (Parent)).all & ':' & Get_Line (Parent) & ':' & Get_Column (Parent) & ')'); end if; end; if Get_Source_Line (Decl)'Length /= 0 then Write_Line (" " & Get_Source_Line (Decl)); end if; -- Output the body (sorted) Ref1 := First_Body (Decl); while Ref1 /= Empty_Reference loop Print_Ref (Ref1, "(body)"); Ref1 := Next (Ref1); end loop; if References then Ref1 := First_Modif (Decl); Ref2 := First_Reference (Decl); while Ref1 /= Empty_Reference or else Ref2 /= Empty_Reference loop if Compare (Ref1, Ref2) = LessThan then Print_Ref (Ref1); Ref1 := Next (Ref1); else Print_Ref (Ref2); Ref2 := Next (Ref2); end if; end loop; end if; end if; Decl := Next (Decl); end loop; end Print_Gnatfind; ------------------ -- Print_Unused -- ------------------ procedure Print_Unused (Full_Path_Name : in Boolean) is Decl : Declaration_Reference := First_Declaration; Ref : Reference; begin while Decl /= Empty_Declaration loop if First_Modif (Decl) = Empty_Reference and then First_Reference (Decl) = Empty_Reference then Write_Str (Get_Symbol (Decl) & " " & Get_Type (Decl) & " " & Osint.To_Host_File_Spec (Get_Gnatchop_File (Decl, Full_Path_Name)).all & ':' & Get_Line (Decl) & ':' & Get_Column (Decl)); -- Print the body if any Ref := First_Body (Decl); if Ref /= Empty_Reference then Write_Line (' ' & Osint.To_Host_File_Spec (Get_Gnatchop_File (Ref, Full_Path_Name)).all & ':' & Get_Line (Ref) & ':' & Get_Column (Ref)); else Write_Eol; end if; end if; Decl := Next (Decl); end loop; end Print_Unused; -------------- -- Print_Vi -- -------------- procedure Print_Vi (Full_Path_Name : in Boolean) is Tab : constant Character := ASCII.HT; Decl : Declaration_Reference := First_Declaration; Ref : Reference; begin while Decl /= Empty_Declaration loop Write_Line (Get_Symbol (Decl) & Tab & Get_File (Decl, Full_Path_Name) & Tab & Get_Line (Decl)); -- Print the body if any Ref := First_Body (Decl); if Ref /= Empty_Reference then Write_Line (Get_Symbol (Decl) & Tab & Get_File (Ref, Full_Path_Name) & Tab & Get_Line (Ref)); end if; -- Print the modifications Ref := First_Modif (Decl); while Ref /= Empty_Reference loop Write_Line (Get_Symbol (Decl) & Tab & Get_File (Ref, Full_Path_Name) & Tab & Get_Line (Ref)); Ref := Next (Ref); end loop; Decl := Next (Decl); end loop; end Print_Vi; ---------------- -- Print_Xref -- ---------------- procedure Print_Xref (Full_Path_Name : in Boolean) is Decl : Declaration_Reference := First_Declaration; Ref : Reference; File : File_Reference; Margin : constant := 10; -- Column where file names start procedure New_Line80; -- Go to start of new line procedure Print80 (S : in String); -- Print the text, respecting the 80 columns rule. procedure Print_Ref (Line, Column : String); -- The beginning of the output is aligned on a column multiple of 9 ---------------- -- New_Line80 -- ---------------- procedure New_Line80 is begin Write_Eol; Write_Str (String'(1 .. Margin - 1 => ' ')); end New_Line80; ------------- -- Print80 -- ------------- procedure Print80 (S : in String) is Align : Natural := Margin - (Integer (Column) mod Margin); begin if Align = Margin then Align := 0; end if; Write_Str (String'(1 .. Align => ' ') & S); end Print80; --------------- -- Print_Ref -- --------------- procedure Print_Ref (Line, Column : String) is Line_Align : constant Integer := 4 - Line'Length; S : constant String := String'(1 .. Line_Align => ' ') & Line & ':' & Column; Align : Natural := Margin - (Integer (Output.Column) mod Margin); begin if Align = Margin then Align := 0; end if; if Integer (Output.Column) + Align + S'Length > 79 then New_Line80; Align := 0; end if; Write_Str (String'(1 .. Align => ' ') & S); end Print_Ref; -- Start of processing for Print_Xref begin while Decl /= Empty_Declaration loop Write_Str (Get_Symbol (Decl)); while Column < Type_Position loop Write_Char (' '); end loop; Write_Line (Get_Full_Type (Get_Type (Decl))); Write_Parent_Info : declare Parent : constant Declaration_Reference := Get_Parent (Decl); begin if Parent /= Empty_Declaration then Write_Str (" Ptype: "); Print80 (Osint.To_Host_File_Spec (Get_Gnatchop_File (Parent)).all); Print_Ref (Get_Line (Parent), Get_Column (Parent)); Print80 (" " & Get_Symbol (Parent)); Write_Eol; end if; end Write_Parent_Info; Write_Str (" Decl: "); Print80 (Osint.To_Host_File_Spec (Get_Gnatchop_File (Decl, Full_Path_Name)).all & ' '); Print_Ref (Get_Line (Decl), Get_Column (Decl)); -- Print the body if any Ref := First_Body (Decl); if Ref /= Empty_Reference then Write_Eol; Write_Str (" Body: "); Print80 (Osint.To_Host_File_Spec (Get_Gnatchop_File (Ref, Full_Path_Name)).all & ' '); Print_Ref (Get_Line (Ref), Get_Column (Ref)); end if; -- Print the modifications if any Ref := First_Modif (Decl); if Ref /= Empty_Reference then Write_Eol; Write_Str (" Modi: "); end if; File := Empty_File; while Ref /= Empty_Reference loop if Get_File_Ref (Ref) /= File then if File /= Empty_File then New_Line80; end if; File := Get_File_Ref (Ref); Write_Str (Get_Gnatchop_File (Ref, Full_Path_Name) & ' '); Print_Ref (Get_Line (Ref), Get_Column (Ref)); else Print_Ref (Get_Line (Ref), Get_Column (Ref)); end if; Ref := Next (Ref); end loop; -- Print the references Ref := First_Reference (Decl); if Ref /= Empty_Reference then Write_Eol; Write_Str (" Ref: "); end if; File := Empty_File; while Ref /= Empty_Reference loop if Get_File_Ref (Ref) /= File then if File /= Empty_File then New_Line80; end if; File := Get_File_Ref (Ref); Write_Str (Osint.To_Host_File_Spec (Get_Gnatchop_File (Ref, Full_Path_Name)).all & ' '); Print_Ref (Get_Line (Ref), Get_Column (Ref)); else Print_Ref (Get_Line (Ref), Get_Column (Ref)); end if; Ref := Next (Ref); end loop; Write_Eol; Decl := Next (Decl); end loop; end Print_Xref; --------------- -- Read_File -- --------------- procedure Read_File (FD : File_Descriptor; Contents : out String_Access; Success : out Boolean) is Length : constant File_Offset := File_Offset (File_Length (FD)); -- Include room for EOF char Buffer : String (1 .. Length + 1); This_Read : Integer; Read_Ptr : File_Offset := 1; begin loop This_Read := Read (FD, A => Buffer (Read_Ptr)'Address, N => Length + 1 - Read_Ptr); Read_Ptr := Read_Ptr + Integer'Max (This_Read, 0); exit when This_Read <= 0; end loop; Buffer (Read_Ptr) := EOF; Contents := new String'(Buffer (1 .. Read_Ptr)); -- Things aren't simple on VMS due to the plethora of file types -- and organizations. It seems clear that there shouldn't be more -- bytes read than are contained in the file though. if Hostparm.OpenVMS then Success := Read_Ptr <= Length + 1; else Success := Read_Ptr = Length + 1; end if; end Read_File; ------------ -- Search -- ------------ procedure Search (Pattern : Search_Pattern; Local_Symbols : Boolean; Wide_Search : Boolean; Read_Only : Boolean; Der_Info : Boolean; Type_Tree : Boolean) is type String_Access is access String; procedure Free is new Unchecked_Deallocation (String, String_Access); ALIfile : ALI_File; File_Ref : File_Reference; Strip_Num : Natural := 0; Ali_Name : String_Access; begin -- If we want all the .ali files, then find them if Wide_Search then Find_ALI_Files; end if; loop -- Get the next unread ali file File_Ref := Next_Unvisited_File; exit when File_Ref = Empty_File; -- Find the ALI file to use. Most of the time, it will be the unit -- name, with a different extension. However, when dealing with -- separates the ALI file is in fact the parent's ALI file (and this -- is recursive, in case the parent itself is a separate). Strip_Num := 0; loop Free (Ali_Name); Ali_Name := new String' (Get_File (File_Ref, With_Dir => True, Strip => Strip_Num)); -- Striped too many things... if Ali_Name.all = "" then if Get_Emit_Warning (File_Ref) then Set_Standard_Error; Write_Line ("warning : file " & Get_File (File_Ref, With_Dir => True) & " not found"); Set_Standard_Output; end if; Free (Ali_Name); exit; -- If not found, try the parent's ALI file (this is needed for -- separate units and subprograms). elsif not File_Exists (Ali_Name.all) then Strip_Num := Strip_Num + 1; -- Else we finally found it else exit; end if; end loop; -- Now that we have a file name, parse it to find any reference to -- the entity. if Ali_Name /= null and then (Read_Only or else Is_Writable_File (Ali_Name.all)) then begin Open (Ali_Name.all, ALIfile); while ALIfile.Buffer (ALIfile.Current_Line) /= EOF loop Parse_X_Filename (ALIfile); Parse_Identifier_Info (Pattern, ALIfile, Local_Symbols, Der_Info, Type_Tree, Wide_Search); end loop; exception when No_Xref_Information => if Get_Emit_Warning (File_Ref) then Set_Standard_Error; Write_Line ("warning : No cross-referencing information in " & Ali_Name.all); Set_Standard_Output; end if; end; end if; end loop; Free (Ali_Name); end Search; ----------------- -- Search_Xref -- ----------------- procedure Search_Xref (Local_Symbols : Boolean; Read_Only : Boolean; Der_Info : Boolean) is ALIfile : ALI_File; File_Ref : File_Reference; Null_Pattern : Search_Pattern; begin loop -- Find the next unvisited file File_Ref := Next_Unvisited_File; exit when File_Ref = Empty_File; -- Search the object directories for the .ali file if Read_Only or else Is_Writable_File (Get_File (File_Ref, With_Dir => True)) then begin Open (Get_File (File_Ref, With_Dir => True), ALIfile, True); while ALIfile.Buffer (ALIfile.Current_Line) /= EOF loop Parse_X_Filename (ALIfile); Parse_Identifier_Info (Null_Pattern, ALIfile, Local_Symbols, Der_Info); end loop; exception when No_Xref_Information => null; end; end if; end loop; end Search_Xref; end Xref_Lib;
source/asis/spec/ada-streams.ads
faelys/gela-asis
4
28471
------------------------------------------------------------------------------ -- A d a r u n - t i m e s p e c i f i c a t i o n -- -- ASIS implementation for Gela project, a portable Ada compiler -- -- http://gela.ada-ru.org -- -- - - - - - - - - - - - - - - - -- -- Read copyright and license at the end of ada.ads file -- ------------------------------------------------------------------------------ -- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ package Ada.Streams is pragma Pure (Streams); type Root_Stream_Type is abstract tagged limited private; pragma Preelaborable_Initialization (Root_Stream_Type); type Stream_Element is mod implementation-defined; type Stream_Element_Offset is range implementation-defined .. implementation-defined; subtype Stream_Element_Count is Stream_Element_Offset range 0..Stream_Element_Offset'Last; type Stream_Element_Array is array (Stream_Element_Offset range <>) of aliased Stream_Element; procedure Read (Stream : in out Root_Stream_Type; Item : out Stream_Element_Array; Last : out Stream_Element_Offset) is abstract; procedure Write (Stream : in out Root_Stream_Type; Item : in Stream_Element_Array) is abstract; private pragma Import (Ada, Root_Stream_Type); end Ada.Streams;
oeis/013/A013955.asm
neoneye/loda-programs
11
163511
<reponame>neoneye/loda-programs<gh_stars>10-100 ; A013955: a(n) = sigma_7(n), the sum of the 7th powers of the divisors of n. ; 1,129,2188,16513,78126,282252,823544,2113665,4785157,10078254,19487172,36130444,62748518,106237176,170939688,270549121,410338674,617285253,893871740,1290094638,1801914272,2513845188,3404825448,4624699020,6103593751,8094558822,10465138360,13599182072,17249876310,22051219752,27512614112,34630287489,42637932336,52933688946,64340198544,79017297541,94931877134,115309454460,137293757384,165132191790,194754273882,232446941088,271818611108,321791671236,373845175782,439222482792,506623120464 add $0,1 mov $2,$0 lpb $0 mov $3,$2 dif $3,$0 cmp $3,$2 cmp $3,0 mul $3,$0 sub $0,1 pow $3,7 add $1,$3 lpe add $1,1 mov $0,$1
halt.asm
Veltas/spectrum-env
0
163202
<reponame>Veltas/spectrum-env ; vim: set syntax=z80: .module halt_asm .area _CODE ;;;;;;;;;;;;;;;;;;; ; void Halt(void) ; ;;;;;;;;;;;;;;;;;;; _Halt: #local halt ret #endlocal
grammars/MKParser.g4
DataDriven-CAM/scad-poser
0
3878
parser grammar MKParser; options { tokenVocab=MKLexer; } makefile : (include_line | define_variable | define_rule | comment|Newline)+ EOF; include_line : Include file_path ; file_path : ~(Newline)*; define_rule : target Colon ((prerequisites Newline commands*) | variable_assignment); target : TargetName; prerequisites : normal_prerequisite+ (Pipe ordered_prerequisite+)?; normal_prerequisite : TargetName; ordered_prerequisite : TargetName; commands : (Tab command Newline); command : ((~(BNT|Newline)+ BNT)* ~(Newline)+); define_variable : variable Eq expression Newline; variable : TargetName; expression : ((~(BNT|Newline)+ BNT)* ~(Newline)+); variable_assignment : variable Eq ~(Newline)*; comment : Comment;
sha256.applescript
docdyhr/AppleScriptUtils
0
1372
<gh_stars>0 (* Version 1.1 <EMAIL> March 2021 note: implement with automator - service - run applescript *) on run {input, parameters} set chosenFile to "" -- get file if (count of input) is 1 then set chosenFile to input else display alert "Multible selections are not allowed!" as warning giving up after 5 end if -- get filename set fileName to name of (info for chosenFile) -- get the sha256 checksum text... set checkSum to the text returned of (display dialog "Paste SHA256" default answer "" with title fileName) -- Calculate MD5 sum checksum quitely and translate to UPPER case set checkSumResult to first word of (do shell script "/usr/bin/openssl dgst -sha256 " & quoted form of POSIX path of chosenFile & " | awk '{print $2}'") -- compairing check sums ignoring white space checkSumResult = checkSum end ignoring set checkSumComp to result -- setting & formating display text set displayText to " " & checkSum & " " & first word of checkSumResult & " " -- show checksum results to user if checkSumComp = true then display dialog displayText & "SHA256 OK!" buttons {"OK"} default button "OK" with title fileName else display dialog displayText & "NB! No SHA256 match!" buttons {"CANCEL"} default button "CANCEL" with title fileName with icon caution end if return input end run
Sources/Library/exceptions.adb
ForYouEyesOnly/Space-Convoy
1
29924
-- -- Jan & <NAME>, Australia, July 2011 -- with Ada.Task_Identification; use Ada.Task_Identification; with Ada.Text_IO; use Ada.Text_IO; package body Exceptions is procedure Show_Exception (Exception_Identifier : Exception_Occurrence; Optional_Message : String := "") is begin Put_Line (Current_Error, "Task " & Image (Current_Task) & " reports: "); Put_Line (Current_Error, Exception_Information (Exception_Identifier)); if Optional_Message /= "" then Put_Line (Current_Error, "Additional message: " & Optional_Message); end if; end Show_Exception; end Exceptions;
src/main/fragment/mos6502-common/vbsxx_lt_0_then_la1.asm
jbrandwood/kickc
2
4415
<filename>src/main/fragment/mos6502-common/vbsxx_lt_0_then_la1.asm<gh_stars>1-10 cpx #0 bmi {la1}
src/cpnd1/nodcap/NF/Show.agda
wenkokke/nodcap
4
10966
<reponame>wenkokke/nodcap<filename>src/cpnd1/nodcap/NF/Show.agda module nodcap.NF.Show where open import Data.String using (String) open import nodcap.Base open import nodcap.NF.Typing import nodcap.Show as S showTerm : {Γ : Environment} → ⊢ⁿᶠ Γ → String showTerm {Γ} x = S.showTerm (fromNF x)
PICStep.asm
Mikibits/PIC-bot
0
8763
<filename>PICStep.asm ;========================================================== ; PICStep.asm ;---------------------------------------------------------- ; Dedicated stepping motor controller, operating two stepper ; motors from input from another (less dedicated) MCU. ;---------------------------------------------------------- ; Current capabilities: (See documentation) ;========================================================== ;---------------------------------------------------------- ;Compile options title "PICStep" list p=16f88 ;Include files include "p16f88.inc" include "register.inc" ;Turn off annoying messages ERRORLEVEL -306, -302, -202 ;---------------------------------------------------------- ;Configuration Bits __CONFIG _CP_OFF&_WDT_OFF&_BODEN_OFF&_PWRTE_ON&_HS_OSC&_WRT_ENABLE_ON&_LVP_ON&_DEBUG_OFF&_CPD_OFF ;========================================================== ;========================================================== ;PAGE 0 -- The Main Program Page (Reset/power-up vector) ;---------------------------------------------------------- ;Reset vector ............................................. ORG h'0000' ;.........................................................; Reset clrf STATUS ;Bank0 clrf PCLATH ;Page0 goto MainInit ;Main program ;Interrupt vector ......................................... ORG h'0004' ;.......................................................... Interrupt movwf SAVINTW ;Save W register swapf STATUS,W ;Save STATUS register clrf STATUS ;(Bank 0) movwf SAVINTSTAT movfw PCLATH ;Save PCLATH register movwf SAVINTPCL movfw FSR ;Save FSR register movwf SAVINTFSR movfw SELECT ;Save lookup selection movwf SAVSELECT bcf PCLATH,3 ;Page 2 (Interrupts) bsf PCLATH,4 goto IntHandler ;Handle interrupt Resume movfw SAVSELECT ;Restore lookup selection movwf SELECT movfw SAVINTFSR ;Restore FSR register movwf FSR movfw SAVINTPCL ;Restore PCLATH register movwf PCLATH swapf SAVINTSTAT,W ;Restore STATUS/Bank reg. movwf STATUS swapf SAVINTW,F ;Get saved W register swapf SAVINTW,W ;Swap to self (sets status) retfie ;Return from interrupt ;---------------------------------------------------------- ;Main Program MainInit SCall Initialize ;Setup PIC movlw 'P' ;Send "PIC Reset" status SCall TxPut movlw 'R' SCall TxPut SCall TxCRLF MainLoop btfsc RUNSTAT,RXCMD ;Command ready? call CommandHandler btfsc RUNSTAT,ERR ;Error logged? call ErrorHandler btfsc RUNSTAT,BRK ;User break? call BreakHandler goto MainLoop ;Loop ;----------------------------------------------------------
source/web/spikedog/daemon/service/spikedog-service.adb
svn2github/matreshka
24
19053
<filename>source/web/spikedog/daemon/service/spikedog-service.adb ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Web Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2017, <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 <NAME>, 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$ ------------------------------------------------------------------------------ with Ada.Command_Line; with Ada.Directories; with Ada.Text_IO; with Ada.Exceptions; with AWS.Server; with League.Application; package body Spikedog.Service is ------------- -- Control -- ------------- overriding procedure Control (Self : in out Service; Control : Services.Control_Kind; Status : Services.Status_Listener_Access) is begin case Control is when Services.Stop => Status.Set_Status (Services.Stop_Pending); Self.Stop_Flag.Release; when others => null; end case; end Control; ---------- -- Name -- ---------- overriding function Name (Self : Service) return League.Strings.Universal_String is begin return Self.Application_Name; end Name; --------- -- Run -- --------- overriding procedure Run (Self : in out Service; Args : League.String_Vectors.Universal_String_Vector; Status : Services.Status_Listener_Access) is Exec : constant String := Ada.Command_Line.Command_Name; Dir : constant String := Ada.Directories.Containing_Directory (Exec); Temp : constant League.Strings.Universal_String := League.Application.Environment.Value (League.Strings.To_Universal_String ("TEMP")); -- This is usually C:|Windows\TEMP Server : Matreshka.Servlet_Servers.Server_Access; File : Ada.Text_IO.File_Type; Success : Boolean; begin Ada.Directories.Set_Directory (Dir); Status.Set_Status (Services.Running); League.Application.Set_Application_Name (Self.Application_Name); League.Application.Set_Application_Version (League.Strings.To_Universal_String ("0.1")); League.Application.Set_Organization_Name (League.Strings.To_Universal_String ("Matreshka Project")); League.Application.Set_Organization_Domain (League.Strings.To_Universal_String ("forge.ada-ru.org")); Ada.Text_IO.Create (File, Name => Temp.To_UTF_8_String & "\spikedog.log"); Ada.Text_IO.Put_Line (File, "Starting " & Args (1).To_UTF_8_String); Ada.Text_IO.Flush (File); Ada.Text_IO.Set_Output (File); Ada.Text_IO.Set_Error (File); Self.AWS_Server.Initialize; Server := Self.AWS_Server'Unchecked_Access; Self.Container.Initialize (Server, Success); Ada.Text_IO.Put_Line (File, "Initialize " & Boolean'Image (Success)); Self.Stop_Flag.Acquire; Status.Set_Status (Services.Stop_Pending); Ada.Text_IO.Put_Line (File, "Stopping"); Ada.Text_IO.Close (File); AWS.Server.Shutdown (AWS.Server.Get_Current.all); -- Wait till built-in HTTP server is running. AWS.Server.Wait (AWS.Server.No_Server); Status.Set_Status (Services.Stopped); exception when E: others => declare File : Ada.Text_IO.File_Type; begin Ada.Text_IO.Create (File, Name => Temp.To_UTF_8_String & "\spikedog-raise.log"); Ada.Text_IO.Put_Line (File, Ada.Exceptions.Exception_Information (E)); Ada.Text_IO.Close (File); raise; end; end Run; --------------- -- Semaphore -- --------------- protected body Semaphore is entry Acquire when not Busy is begin Busy := True; end Acquire; entry Release when Busy is begin Busy := False; end Release; end Semaphore; end Spikedog.Service;
4 专业科目/计算机组成/习题/hw/自己动手写CPU/Code/Chapter5_1/AsmTest/inst_rom.asm
ladike/912_project
640
8075
<reponame>ladike/912_project<filename>4 专业科目/计算机组成/习题/hw/自己动手写CPU/Code/Chapter5_1/AsmTest/inst_rom.asm inst_rom.om: file format elf32-tradbigmips Disassembly of section .text: 00000000 <_start>: 0: 34011100 li at,0x1100 4: 34210020 ori at,at,0x20 8: 34214400 ori at,at,0x4400 c: 34210044 ori at,at,0x44 Disassembly of section .reginfo: 00000000 <_ram_end-0x10>: 0: 00000002 srl zero,zero,0x0 ... 00000010 <_ram_end>: ...
unittests/ASM/TwoByte/0F_B6.asm
cobalt2727/FEX
628
175794
<filename>unittests/ASM/TwoByte/0F_B6.asm %ifdef CONFIG { "RegData": { "R15": "0x41424344454600FF", "R14": "0x00000000000000FF", "R13": "0x00000000000000FF", "R12": "0x41424344454600FF", "R11": "0x00000000000000FF", "R10": "0x00000000000000FF" }, "MemoryRegions": { "0x100000000": "4096" } } %endif mov rdx, 0xe0000000 mov rax, 0xFFFFFFFFFFFFFFFF mov [rdx + 8 * 0], rax mov r15, 0x4142434445464748 mov r14, 0x4142434445464748 mov r13, 0x4142434445464748 mov r12, 0x4142434445464748 mov r11, 0x4142434445464748 mov r10, 0x4142434445464748 movzx r15w, byte [rdx + 8 * 0] movzx r14d, byte [rdx + 8 * 0] movzx r13, byte [rdx + 8 * 0] movzx r12w, al movzx r11d, al movzx r10, al hlt
oeis/021/A021541.asm
neoneye/loda-programs
11
98842
; A021541: Decimal expansion of 1/537. ; Submitted by Jon Maiga ; 0,0,1,8,6,2,1,9,7,3,9,2,9,2,3,6,4,9,9,0,6,8,9,0,1,3,0,3,5,3,8,1,7,5,0,4,6,5,5,4,9,3,4,8,2,3,0,9,1,2,4,7,6,7,2,2,5,3,2,5,8,8,4,5,4,3,7,6,1,6,3,8,7,3,3,7,0,5,7,7,2,8,1,1,9,1,8,0,6,3,3,1,4,7,1,1,3,5,9 seq $0,83811 ; Numbers n such that 2n+1 is the digit reversal of n+1. div $0,2148 mod $0,10
test/Fail/Issue2442-postulate.agda
shlevy/agda
1,989
7370
{-# OPTIONS --safe #-} module Issue2442-postulate where postulate A : Set
programs/oeis/050/A050271.asm
neoneye/loda
22
13825
<reponame>neoneye/loda<filename>programs/oeis/050/A050271.asm ; A050271: Numbers n such that n = floor(sqrt(n)*ceiling(sqrt(n))). ; 1,2,3,4,7,8,9,14,15,16,23,24,25,34,35,36,47,48,49,62,63,64,79,80,81,98,99,100,119,120,121,142,143,144,167,168,169,194,195,196,223,224,225,254,255,256,287,288,289,322,323,324,359,360,361,398,399,400,439,440,441,482,483,484,527,528,529,574,575,576,623,624,625,674,675,676,727,728,729,782,783,784,839,840,841,898,899,900,959,960,961,1022,1023,1024,1087,1088,1089,1154,1155,1156 mov $2,$0 lpb $2 add $0,$3 trn $2,3 add $3,2 lpe add $0,1
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ca/ca5003b5.ada
best08618/asylo
7
3650
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ca/ca5003b5.ada -- CA5003B5M.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT THE ELABORATION OF LIBRARY UNITS REQUIRED BY -- A MAIN PROGRAM IS PERFORMED CONSISTENTLY WITH THE PARTIAL -- ORDERING DEFINED BY THE COMPILATION ORDER RULES. -- IN PARTICULAR, CHECK THAT A LIBRARY UNIT MENTIONED IN THE -- WITH_CLAUSE OF A SUBUNIT IS ELABORATED PRIOR TO THE BODY OF -- THE ANCESTOR UNIT. -- SEPARATE FILES ARE: -- CA5003B0 A LIBRARY PACKAGE. -- CA5003B1 A LIBRARY PACKAGE. -- CA5003B2 A SUBUNIT PACKAGE BODY (_B1._B2). -- CA5003B3 A LIBRARY PACKAGE DECLARATION. -- CA5003B4 A SUBUNIT PACKAGE BODY (_B1._B2._B4). -- CA5003B5M THE MAIN PROCEDURE. -- LIBRARY PACKAGES MUST BE ELABORATED IN ORDER: _B0, _B3, _B1. -- PARENT UNITS MUST BE ELABORATED BEFORE THEIR SUBUNITS. -- WKB 7/22/81 -- JBG 10/6/83 -- BHS 8/02/84 -- JRK 9/20/84 WITH REPORT, CA5003B0; USE REPORT, CA5003B0; WITH CA5003B1; PROCEDURE CA5003B5M IS BEGIN TEST ("CA5003B", "CHECK THAT UNITS IN WITH_CLAUSES OF " & "SUBUNITS ARE ELABORATED PRIOR TO THE " & "BODY OF THE ANCESTOR UNIT"); COMMENT ("ACTUAL ELABORATION ORDER WAS " & ORDER); IF ORDER /= "3124" THEN FAILED ("ILLEGAL ELABORATION ORDER"); END IF; RESULT; END CA5003B5M;
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_849.asm
ljhsiun2/medusa
9
23163
<filename>Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_849.asm .global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r13 push %r9 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x13a09, %rbx dec %r9 movb (%rbx), %dl nop nop sub %rbx, %rbx lea addresses_WT_ht+0xfe09, %rcx nop cmp $9895, %r10 movb $0x61, (%rcx) and $64149, %rcx lea addresses_UC_ht+0x12ce3, %rcx clflush (%rcx) nop nop nop nop nop dec %r12 mov (%rcx), %r13w nop add %rdx, %rdx lea addresses_WC_ht+0x12611, %rsi lea addresses_A_ht+0x16349, %rdi nop sub %r9, %r9 mov $104, %rcx rep movsq dec %r9 lea addresses_WC_ht+0x2041, %r13 nop nop nop nop nop sub %rbx, %rbx vmovups (%r13), %ymm4 vextracti128 $1, %ymm4, %xmm4 vpextrq $0, %xmm4, %rsi sub %rbx, %rbx lea addresses_UC_ht+0x7809, %rdx sub $12864, %r12 mov $0x6162636465666768, %rdi movq %rdi, %xmm3 movups %xmm3, (%rdx) nop nop nop nop and $37311, %rbx lea addresses_D_ht+0x5209, %rbx nop nop nop and %r12, %r12 mov $0x6162636465666768, %rdx movq %rdx, (%rbx) nop nop and $47915, %r13 lea addresses_normal_ht+0x21d9, %rsi lea addresses_WT_ht+0x4809, %rdi cmp $51760, %r12 mov $71, %rcx rep movsb nop nop inc %rbx lea addresses_normal_ht+0x134c9, %r13 nop nop nop nop nop add $4190, %rbx movb (%r13), %r10b add $3497, %r13 lea addresses_WC_ht+0x19479, %rsi nop nop nop and $20010, %rcx mov $0x6162636465666768, %rdi movq %rdi, %xmm2 movups %xmm2, (%rsi) nop nop sub %r10, %r10 lea addresses_normal_ht+0x17609, %rbx nop nop nop add $21004, %rsi mov (%rbx), %rcx nop nop nop nop add %r9, %r9 lea addresses_D_ht+0x1d309, %rcx add %r9, %r9 movb (%rcx), %r13b nop nop sub $5196, %r12 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r9 pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r8 push %rcx push %rdi push %rdx push %rsi // Store lea addresses_A+0xa587, %rdx nop cmp %r8, %r8 movb $0x51, (%rdx) nop dec %rdx // REPMOV lea addresses_A+0x19609, %rsi lea addresses_WC+0x1d059, %rdi clflush (%rsi) nop dec %r8 mov $22, %rcx rep movsw nop add %r13, %r13 // Store lea addresses_WC+0x2163, %rdx nop nop nop nop nop sub $56525, %rdi mov $0x5152535455565758, %r10 movq %r10, (%rdx) nop nop nop xor $35, %r10 // Store lea addresses_normal+0x14209, %rsi dec %r12 mov $0x5152535455565758, %rdi movq %rdi, (%rsi) nop nop sub %rcx, %rcx // REPMOV lea addresses_UC+0x1bb09, %rsi lea addresses_normal+0x4a89, %rdi nop nop add $396, %r10 mov $35, %rcx rep movsq nop nop nop nop xor %rsi, %rsi // Faulty Load lea addresses_normal+0xa209, %r10 nop nop nop nop nop add %r8, %r8 mov (%r10), %r13 lea oracles, %rsi and $0xff, %r13 shlq $12, %r13 mov (%rsi,%r13,1), %r13 pop %rsi pop %rdx pop %rdi pop %rcx pop %r8 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_A'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WC'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 1}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_UC'}, 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_normal'}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 8}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1}} {'OP': 'REPM', 'src': {'same': True, 'congruent': 3, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 3}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 3}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 8}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8}} {'34': 21829} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
oeis/004/A004453.asm
neoneye/loda-programs
11
21020
; A004453: Nimsum n + 12. ; Submitted by <NAME>(s4) ; 12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3,28,29,30,31,24,25,26,27,20,21,22,23,16,17,18,19,44,45,46,47,40,41,42,43,36,37,38,39,32,33,34,35,60,61,62,63,56,57,58,59,52,53,54,55,48,49,50,51,76,77,78,79,72,73,74,75,68,69,70,71,64,65,66,67,92,93,94,95,88,89,90,91,84,85,86,87,80,81,82,83,108,109,110,111 mov $2,$0 div $0,4 mod $0,4 mul $0,8 sub $2,$0 mov $0,$2 add $0,12
test/Succeed/Issue1337.agda
cruhland/agda
1,989
4479
-- Andreas, 2014-11-01, reported by <NAME> -- Non-printable characters in line comments -- Soft hyphen in comment creates lexical error: -- ­ (SOFT HYPHEN \- 0xAD) -- Or parse error: -- A ­
programs/oeis/137/A137709.asm
neoneye/loda
22
91820
; A137709: Secondary Upper Wythoff Sequence. ; 3,4,9,10,13,14,19,20,25,26,29,30,35,36,39,40,45,46,51,52,55,56,61,62,67,68,71,72,77,78,81,82,87,88,93,94,97,98,103,104,107,108,113,114,119,120,123,124,129,130,135,136,139,140,145,146,149,150,155,156 mov $2,$0 seq $0,287775 ; Positions of 0 in A287772; complement of A050140 (conjectured and proved). add $1,$0 sub $2,1 sub $2,$1 sub $1,$2 sub $1,2 mov $0,$1
programs/oeis/100/A100287.asm
karttu/loda
0
29192
; A100287: First occurrence of n in A100002; the least k such that A100002(k) = n. ; 1,2,5,9,15,25,31,43,61,67,87,103,123,139,169,183,219,241,259,301,331,361,391,447,463,511,553,589,643,687,723,783,819,867,931,979,1027,1099,1179,1227,1309,1347,1393,1479,1539,1603,1699,1759,1863,1909,2019,2029,2163,2263,2311,2439,2527,2559,2707,2779,2851,2979,3073,3159,3207,3373,3447,3553,3691,3819,3883,3987,4123,4239,4347,4429,4621,4681,4843,4899,5149,5173,5329,5539,5563,5763,5893,6013,6121,6283,6399,6579,6723,6859,6939,7201,7309,7419,7683,7743,7951,8029,8311,8403,8593,8743,8907,9091,9279,9363,9643,9723,9913,10119,10183,10587,10633,10767,11007,11293,11343,11563,11773,11943,12199,12327,12541,12703,13081,13143,13351,13543,13863,13909,14247,14407,14509,14893,14979,15303,15511,15663,15931,16213,16299,16723,16909,17041,17223,17559,17823,18027,18253,18459,18811,19009,19119,19489,19879,19987,20199,20491,20671,20967,21279,21507,21811,22023,22201,22687,22789,22903,23413,23707,23773,24243,24483,24759,25153,25339,25459,25887,26059,26461,26773,27003,27303,27547,28111,28179,28369,28839,29089,29419,29701,29869,30363,30571,30927,31273,31587,31771,32083,32679,32773,33207,33403,33871,34129,34411,34779,35041,35319,35923,35967,36589,36747,37047,37669,37803,38269,38509,38881,39199,39721,39949,40321,40489,40993,41499,41679,42019,42447,42841,43153,43741,43921,44239,44559,45229,45469,45709,46267,46479,46813,47551,47727,48063,48639,48769 mov $1,1 mov $2,$0 lpb $2,1 lpb $1,1 trn $1,$2 add $3,$2 lpe add $3,$2 mov $1,$3 sub $2,1 mov $3,0 lpe
support/MinGW/lib/gcc/mingw32/9.2.0/adainclude/s-exctra.adb
orb-zhuchen/Orb
0
4269
<reponame>orb-zhuchen/Orb<gh_stars>0 ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . E X C E P T I O N _ T R A C E S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2000-2019, AdaCore -- -- -- -- 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 Ada.Unchecked_Conversion; with System.Standard_Library; use System.Standard_Library; with System.Soft_Links; use System.Soft_Links; package body System.Exception_Traces is -- Calling the decorator directly from where it is needed would require -- introducing nasty dependencies upon the spec of this package (typically -- in a-except.adb). We also have to deal with the fact that the traceback -- array within an exception occurrence and the one the decorator accepts -- are of different types. These are two reasons for which a wrapper with -- a System.Address argument is indeed used to call the decorator provided -- by the user of this package. This wrapper is called via a soft-link, -- which either is null when no decorator is in place or "points to" the -- following function otherwise. function Decorator_Wrapper (Traceback : System.Address; Len : Natural) return String; -- The wrapper to be called when a decorator is in place for exception -- backtraces. -- -- Traceback is the address of the call chain array as stored in the -- exception occurrence and Len is the number of significant addresses -- contained in this array. Current_Decorator : Traceback_Decorator := null; -- The decorator to be called by the wrapper when it is not null, as set -- by Set_Trace_Decorator. When this access is null, the wrapper is null -- also and shall then not be called. ----------------------- -- Decorator_Wrapper -- ----------------------- function Decorator_Wrapper (Traceback : System.Address; Len : Natural) return String is subtype Trace_Array is Traceback_Entries.Tracebacks_Array (1 .. Len); type Trace_Array_Access is access all Trace_Array; function To_Trace_Array is new Ada.Unchecked_Conversion (Address, Trace_Array_Access); Decorator_Traceback : constant Trace_Array_Access := To_Trace_Array (Traceback); begin return Current_Decorator.all (Decorator_Traceback.all); end Decorator_Wrapper; ------------------------- -- Set_Trace_Decorator -- ------------------------- procedure Set_Trace_Decorator (Decorator : Traceback_Decorator) is begin Current_Decorator := Decorator; Traceback_Decorator_Wrapper := (if Current_Decorator /= null then Decorator_Wrapper'Access else null); end Set_Trace_Decorator; --------------- -- Trace_Off -- --------------- procedure Trace_Off is begin Exception_Trace := RM_Convention; end Trace_Off; -------------- -- Trace_On -- -------------- procedure Trace_On (Kind : Trace_Kind) is begin case Kind is when Every_Raise => Exception_Trace := Every_Raise; when Unhandled_Raise => Exception_Trace := Unhandled_Raise; when Unhandled_Raise_In_Main => Exception_Trace := Unhandled_Raise_In_Main; end case; end Trace_On; end System.Exception_Traces;
gcc-gcc-7_3_0-release/gcc/ada/a-catizo.ads
best08618/asylo
7
10866
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . C A L E N D A R . T I M E _ Z O N E S -- -- -- -- S p e c -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ -- This package provides routines to determine the offset of dates to GMT. -- It is defined in the Ada 2005 RM (9.6.1). package Ada.Calendar.Time_Zones is -- Time zone manipulation type Time_Offset is range -(28 * 60) .. 28 * 60; Unknown_Zone_Error : exception; function UTC_Time_Offset (Date : Time := Clock) return Time_Offset; -- Returns (in minutes), the difference between the implementation-defined -- time zone of Calendar, and UTC time, at the time Date. If the time zone -- of the Calendar implementation is unknown, raises Unknown_Zone_Error. end Ada.Calendar.Time_Zones;
programs/oeis/082/A082204.asm
neoneye/loda
22
179170
<gh_stars>10-100 ; A082204: Begin with a 1, then place the smallest (as far as possible distinct) digits, such that, beginning from the n-th term, n terms form a palindrome. ; 1,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3,2,2,3 gcd $0,262149 mov $1,5 bin $1,$0 div $1,5 add $1,1 mov $0,$1
demo/tutorial/game_maps.ads
csb6/libtcod-ada
0
14141
<filename>demo/tutorial/game_maps.ads with Libtcod, Libtcod.Maps, Libtcod.Console; use Libtcod; package Game_Maps is type Tile_Flag is (Explored); type Tile_Flag_Set is array(Tile_Flag) of Boolean with Pack; type Tile is record flags : Tile_Flag_Set := (Explored => False); end record; type Game_Map(width : Maps.X_Pos; height : Maps.Y_Pos) is tagged limited private; function make_game_map(w : Width; h : Height) return Game_Map; procedure render(self : in out Game_Map; screen : in out Console.Screen); function is_wall(self : Game_Map; x : Maps.X_Pos; y : Maps.Y_Pos) return Boolean with Inline; function is_explored(self : Game_Map; x : Maps.X_Pos; y : Maps.Y_Pos) return Boolean with Inline; function in_fov(self : in out Game_Map; x : Maps.X_Pos; y : Maps.Y_Pos) return Boolean; procedure compute_fov(self : in out Game_Map; source_x : Maps.X_Pos; source_y : Maps.Y_Pos; radius : Maps.Radius); procedure dig(self : in out Game_Map; x1 : Maps.X_Pos; y1 : Maps.Y_Pos; x2 : Maps.X_Pos; y2 : Maps.Y_Pos); private type Tile_Grid is array(Maps.Y_Pos range <>, Maps.X_Pos range <>) of Tile; type Game_Map(width : Maps.X_Pos; height : Maps.Y_Pos) is tagged limited record tiles : Tile_Grid(0..height, 0..width); map : Maps.Map; end record; end Game_Maps;
4-high/gel/applet/demo/hello_gel/launch_hello_gel.adb
charlie5/lace-alire
1
16256
with gel.Applet.gui_world, gel.Forge, gel.Window.setup, ada.Text_IO, ada.Exceptions; pragma unreferenced (gel.Window.setup); procedure launch_hello_GEL -- -- Opens a GEL window. -- is use gel.Applet.gui_world, ada.Text_IO; the_Applet : gel.Applet.gui_World.view := gel.Forge.new_gui_Applet ("Hello GEL"); begin while the_Applet.is_open loop the_Applet.gui_World.evolve; -- Evolve the world. the_Applet.freshen; -- Handle any new events and update the screen. end loop; free (the_Applet); exception when E : others => put_Line ("Exception in Environment task"); put_Line (ada.Exceptions.Exception_Information (E)); end launch_hello_GEL;
programs/oeis/089/A089809.asm
karttu/loda
0
160708
<reponame>karttu/loda ; A089809: Complement of A078588. ; 0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0 mul $0,2 cal $0,26274 ; Greatest k such that s(k) = n, where s = A026272. sub $0,1 mod $0,2 add $0,12 mov $1,$0 sub $1,12
programs/oeis/165/A165725.asm
karttu/loda
0
17973
; A165725: Largest divisor of n coprime to 30. I.e., a(n) = max { k | gcd(n, k) = k and gcd(k, 30) = 1 }. ; 1,1,1,1,1,1,7,1,1,1,11,1,13,7,1,1,17,1,19,1,7,11,23,1,1,13,1,7,29,1,31,1,11,17,7,1,37,19,13,1,41,7,43,11,1,23,47,1,49,1,17,13,53,1,11,7,19,29,59,1,61,31,7,1,13,11,67,17,23,7,71,1,73,37,1,19,77,13,79,1,1,41,83,7,17,43,29,11,89,1,91,23,31,47,19,1,97,49,11,1,101,17,103,13,7,53,107,1,109,11,37,7,113,19,23,29,13,59,119,1,121,61,41,31,1,7,127,1,43,13,131,11,133,67,1,17,137,23,139,7,47,71,143,1,29,73,49,37,149,1,151,19,17,77,31,13,157,79,53,1,161,1,163,41,11,83,167,7,169,17,19,43,173,29,7,11,59,89,179,1,181,91,61,23,37,31,187,47,7,19,191,1,193,97,13,49,197,11,199,1,67,101,203,17,41,103,23,13,209,7,211,53,71,107,43,1,217,109,73,11,221,37,223,7,1,113,227,19,229,23,77,29,233,13,47,59,79,119,239,1,241,121,1,61,49,41,247,31,83,1 add $0,1 lpb $0,1 mov $2,$0 gcd $2,120 div $0,$2 lpe mov $1,$0
programs/oeis/137/A137331.asm
neoneye/loda
22
18854
; A137331: a(n) = 1 if the binary weight of n is prime, otherwise 0. ; 0,0,0,1,0,1,1,1,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,1,1,1,0,1,0,0,1,0,1,1,1,1,1,1,0,1,1,1,0,1,0,0,1,1,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,1,1,1,1,0,1,1,1,0,1,0,0,1,1,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,1,1,0 seq $0,324467 ; Three times the binary weight of n: 3*A000120(n). pow $0,4 div $0,31 mod $0,2
src/csv.g4
Mick2nd/CsvImport
1
4181
/* [The "BSD licence"] Copyright (c) 2013 <NAME> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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. */ grammar csv; @lexer::header { let delimiter = ','; function createCsvLexer(input, delim) { const inst = new csvLexer(input); delimiter = delim; return inst; } function isDelimiter(delim) { return delimiter == delim; } exports.createCsvLexer = createCsvLexer; exports.isDelimiter = isDelimiter; } @lexer::members { } csvFile: hdr row+ ; hdr : row ; row : field (DELIMITER field)* '\r'? '\n' ; field : text | string | ; text: TEXT ; string: STRING ; DELIMITER : ',' { isDelimiter(',') }? | ';' { isDelimiter(';') }? | '\t' { isDelimiter('\t') }? ; TEXT : ( ~[,;\t\n\r"] | ',' { !isDelimiter(',') }? | ';' { !isDelimiter(';') }? | '\t' { !isDelimiter('\t') }? )+ ; STRING : QUOTE ('""' |~'"')* QUOTE ; // quote-quote is an escaped quote fragment QUOTE: '"' ;
alloy4fun_models/trainstlt/models/3/PNTJWWLBSoH4mNhxv.als
Kaixi26/org.alloytools.alloy
0
2482
<gh_stars>0 open main pred idPNTJWWLBSoH4mNhxv_prop4 { all t1, t2 : Train | always t1.pos != t2.pos } pred __repair { idPNTJWWLBSoH4mNhxv_prop4 } check __repair { idPNTJWWLBSoH4mNhxv_prop4 <=> prop4o }
libsrc/graphics/w_move.asm
jpoikela/z88dk
0
92432
; ; Turtle graphics library ; Stefano - 11/2017 ; ; $Id: w_move.asm $ ; SECTION code_graphics PUBLIC move PUBLIC _move EXTERN swapgfxbk EXTERN __graphics_end EXTERN __pen EXTERN w_line_r EXTERN w_plotpixel EXTERN w_setxy .move ._move push ix ld ix,2 add ix,sp ld e,(ix+2) ld d,(ix+3) ld l,(ix+4) ld h,(ix+5) call swapgfxbk ld a,(__pen) ld ix,w_setxy rla jr nc,pen_up ld ix,w_plotpixel .pen_up call w_line_r jp __graphics_end
programs/oeis/153/A153481.asm
neoneye/loda
22
22126
; A153481: a(n) = prime(n)^3 - 2. ; 6,25,123,341,1329,2195,4911,6857,12165,24387,29789,50651,68919,79505,103821,148875,205377,226979,300761,357909,389015,493037,571785,704967,912671,1030299,1092725,1225041,1295027,1442895,2048381,2248089,2571351,2685617,3307947,3442949,3869891,4330745,4657461,5177715,5735337,5929739,6967869,7189055,7645371,7880597,9393929,11089565,11697081,12008987,12649335,13651917,13997519,15813249,16974591,18191445,19465107,19902509,21253931,22188039,22665185,25153755,28934441,30080229,30664295,31855011,36264689,38272751,41781921,42508547,43986975,46268277,49430861,51895115,54439937,56181885,58863867,62570771,64481199,68417927,73560057,74618459,80062989,81182735,84604517,86938305,90518847,95443991,97972179,99252845,101847561,109902237,115501301,118370769,124251497,127263525,131872227,141420759,143055665,158340419 seq $0,40 ; The prime numbers. pow $0,3 sub $0,2
cache/src/main/antlr4/net/runelite/cache/script/assembler/rs2asm.g4
alex-vincent/runelite
0
7464
/* * Copyright (c) 2017, Adam <<EMAIL>> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ grammar rs2asm; prog: (header NEWLINE+)* (line NEWLINE+)+ ; header: id | int_stack_count | string_stack_count | int_var_count | string_var_count ; id: '.id ' id_value ; int_stack_count: '.int_stack_count ' int_stack_value ; string_stack_count: '.string_stack_count ' string_stack_value ; int_var_count: '.int_var_count ' int_var_value ; string_var_count: '.string_var_count ' string_var_value ; id_value: INT ; int_stack_value: INT ; string_stack_value: INT ; int_var_value: INT ; string_var_value: INT ; line: instruction | label | switch_lookup ; instruction: instruction_name instruction_operand ; label: 'LABEL' INT ':' ; instruction_name: name_string | name_opcode ; name_string: INSTRUCTION ; name_opcode: INT ; instruction_operand: operand_int | operand_qstring | operand_label | ; operand_int: INT ; operand_qstring: QSTRING ; operand_label: 'LABEL' INT ; switch_lookup: switch_key ':' switch_value ; switch_key: INT ; switch_value: 'LABEL' INT ; NEWLINE: ( '\r' | '\n' )+ ; INT: '-'? [0-9]+ ; QSTRING: '"' (~('"' | '\\' | '\r' | '\n') | '\\' ('"' | '\\'))* '"' ; INSTRUCTION: [a-z0-9_]+ ; COMMENT: ';' ~( '\r' | '\n' )* -> channel(HIDDEN) ; WS: (' ' | '\t')+ -> channel(HIDDEN) ;
node_modules/browse/script/cmd+shft+f.applescript
wep1980/Sistema-de-Pedidos-Ionic-Front-End
0
404
<filename>node_modules/browse/script/cmd+shft+f.applescript #!/usr/bin/osascript tell application "System Events" keystroke "f" using {command down, shift down} end tell
Lab03/Write an assembly program that prints Hello World five times and then prints Bye world. Hints Use unconditional CMP, conditional JE, JNE instruction.asm
Deboraj-roy/COMPUTER-ORGANIZATION-AND-ARCHITECTURE-C-
0
10827
;Write an assembly program that prints Hello World five times and then prints Bye world. Hints: Use unconditional CMP, conditional JE, JNE instruction .MODEL SMALL .STACK 100H .DATA CR EQU '0DH' LF EQU '0AH' MSG DB 'HELLO WORLD $' .CODE MAIN PROC MOV AX,@DATA MOV DS,AX MOV CX,5 PRINT_: LEA DX,MSG MOV AH,9 INT 21H MOV AH, 2 ; carriage return MOV DL, 0DH INT 21H MOV DL, 0AH ; line feed INT 21H DEC CX JNZ PRINT_ MOV AH,4CH INT 21H MAIN ENDP END MAIN
src/core/irc.adb
Okasu/Byron
1
27907
package body IRC is Client : Socket_Type; Channel : Stream_Access; Current_Line : Unbounded_String; procedure Connect_To (Server : Sock_Addr_Type) is begin Create_Socket (Client); Connect_Socket (Client, Server); Channel := Stream (Client); end Connect_To; function Get_Line return Unbounded_String is Line : Unbounded_String; Char : Character; begin loop Char := Character'Input (Channel); if Char = ASCII.LF then Current_Line := Line; return Line; elsif Char /= ASCII.CR then Append (Line, Char); end if; end loop; end Get_Line; procedure Put_Line (Line : String) is CRLF : constant String := ASCII.CR & ASCII.LF; begin String'Write (Channel, Line & CRLF); end Put_Line; procedure Set_Nick (Nick : String) is begin Put_Line ("NICK " & Nick); Put_Line ("USER " & Nick & " 0 * :Byron IRC bot, https://github.com/gsmnv/Byron"); end Set_Nick; procedure Join_Channel (Chan : String) is begin Put_Line ("JOIN " & Chan); end Join_Channel; function Get_Message return Message is Msg : Message; Count : Integer := 1; begin for I in 1 .. Length (Current_Line) loop if Count > 3 then Append (Msg.Content, Element (Current_Line, I)); elsif Element (Current_Line, I) /= ' ' then if Count = 1 then Append (Msg.Sender, Element (Current_Line, I)); elsif Count = 2 then Append (Msg.Mode, Element (Current_Line, I)); elsif Count = 3 then Append (Msg.Channel, Element (Current_Line, I)); end if; else Count := Count + 1; end if; end loop; if Element (Current_Line, 1) = ':' then -- Remove ':' from Message Replace_Slice (Msg.Sender, 1, 1, ""); Replace_Slice (Msg.Content, 1, 1, ""); -- Check if private message if Element (Msg.Channel, 1) /= '#' then Msg.Channel := Get_Nick (Msg); end if; end if; return Msg; end Get_Message; procedure Put_Message (Msg : Message) is begin Put_Line (To_String (Msg.Mode & " " & Msg.Channel & " :" & Msg.Content)); end Put_Message; procedure Pong is Line : constant String := To_String (Current_Line); begin if Line (1 .. 4) = "PING" then Put_Line ("PONG " & Line (6 .. Line'Length)); else null; end if; end Pong; function Get_Nick (Msg : Message) return Unbounded_String is Nick : Unbounded_String := Msg.Sender; begin Replace_Slice (Nick, Index (Nick, "!"), Length (Nick), ""); return Nick; exception when Constraint_Error => return Nick; end Get_Nick; procedure Identify (Password : String) is begin Put_Line ("NICKSERV IDENTIFY " & Password); end Identify; end IRC;
Firmware/ATU-10_FW_10/pic_init.asm
vahalan/ATU-10-10W-QRP-antenna-tuner
29
242027
<reponame>vahalan/ATU-10-10W-QRP-antenna-tuner<filename>Firmware/ATU-10_FW_10/pic_init.asm _pic_init: ;pic_init.c,5 :: void pic_init (void) { ;pic_init.c,7 :: ANSELA = 0; // all as digital CLRF ANSELA+0 ;pic_init.c,8 :: ANSELB = 0; // all as digital CLRF ANSELB+0 ;pic_init.c,9 :: ANSB0_bit = 1; // analog input BSF ANSB0_bit+0, BitPos(ANSB0_bit+0) ;pic_init.c,10 :: ANSB1_bit = 1; // analog input BSF ANSB1_bit+0, BitPos(ANSB1_bit+0) ;pic_init.c,11 :: ANSB2_bit = 1; // analog input BSF ANSB2_bit+0, BitPos(ANSB2_bit+0) ;pic_init.c,12 :: ANSELC = 0; // all as digital CLRF ANSELC+0 ;pic_init.c,13 :: ANSELE = 0; // all as digital CLRF ANSELE+0 ;pic_init.c,14 :: ANSELD = 0; // all as digital CLRF ANSELD+0 ;pic_init.c,16 :: C1ON_bit = 0; // Disable comparators BCF C1ON_bit+0, BitPos(C1ON_bit+0) ;pic_init.c,17 :: C2ON_bit = 0; BCF C2ON_bit+0, BitPos(C2ON_bit+0) ;pic_init.c,19 :: PORTA = 0; CLRF PORTA+0 ;pic_init.c,20 :: PORTB = 0; CLRF PORTB+0 ;pic_init.c,21 :: PORTC = 0; CLRF PORTC+0 ;pic_init.c,22 :: PORTD = 0; CLRF PORTD+0 ;pic_init.c,23 :: PORTE = 0; CLRF PORTE+0 ;pic_init.c,24 :: LATA = 0b00000000; CLRF LATA+0 ;pic_init.c,25 :: LATB = 0b00000000; CLRF LATB+0 ;pic_init.c,26 :: LATC = 0b00010000; MOVLW 16 MOVWF LATC+0 ;pic_init.c,27 :: LATD = 0b00000110; MOVLW 6 MOVWF LATD+0 ;pic_init.c,28 :: LATE = 0b00000000; CLRF LATE+0 ;pic_init.c,29 :: TRISA = 0b00000000; CLRF TRISA+0 ;pic_init.c,30 :: TRISB = 0b00100111; MOVLW 39 MOVWF TRISB+0 ;pic_init.c,31 :: TRISC = 0b00000000; CLRF TRISC+0 ;pic_init.c,32 :: TRISD = 0b00000000; CLRF TRISD+0 ;pic_init.c,33 :: TRISE = 0b00000000; CLRF TRISE+0 ;pic_init.c,36 :: ODCA2_bit = 1; BSF ODCA2_bit+0, BitPos(ODCA2_bit+0) ;pic_init.c,37 :: ODCA3_bit = 1; BSF ODCA3_bit+0, BitPos(ODCA3_bit+0) ;pic_init.c,38 :: ODCD1_bit = 1; BSF ODCD1_bit+0, BitPos(ODCD1_bit+0) ;pic_init.c,39 :: ODCD2_bit = 1; BSF ODCD2_bit+0, BitPos(ODCD2_bit+0) ;pic_init.c,42 :: T0CS0_bit = 0; // Fosc/4 BCF T0CS0_bit+0, BitPos(T0CS0_bit+0) ;pic_init.c,43 :: T0CS1_bit = 1; BSF T0CS1_bit+0, BitPos(T0CS1_bit+0) ;pic_init.c,44 :: T0CS2_bit = 0; BCF T0CS2_bit+0, BitPos(T0CS2_bit+0) ;pic_init.c,45 :: T016BIT_bit = 1; BSF T016BIT_bit+0, BitPos(T016BIT_bit+0) ;pic_init.c,46 :: TMR0L = 0xC0; // 80_000 cycles to OF MOVLW 192 MOVWF TMR0L+0 ;pic_init.c,47 :: TMR0H = 0xE0; MOVLW 224 MOVWF TMR0H+0 ;pic_init.c,48 :: TMR0IF_bit = 0; BCF TMR0IF_bit+0, BitPos(TMR0IF_bit+0) ;pic_init.c,49 :: T0EN_bit = 1; BSF T0EN_bit+0, BitPos(T0EN_bit+0) ;pic_init.c,50 :: TMR0IE_bit = 1; BSF TMR0IE_bit+0, BitPos(TMR0IE_bit+0) ;pic_init.c,53 :: PMD0 = 0b00011110; // MOVLW 30 MOVWF PMD0+0 ;pic_init.c,54 :: PMD1 = 0b11111110; MOVLW 254 MOVWF PMD1+0 ;pic_init.c,55 :: PMD2 = 0b01000111; MOVLW 71 MOVWF PMD2+0 ;pic_init.c,56 :: PMD3 = 0b01111111; MOVLW 127 MOVWF PMD3+0 ;pic_init.c,57 :: PMD4 = 0b1110111; MOVLW 119 MOVWF PMD4+0 ;pic_init.c,58 :: PMD5 = 0b11011111; MOVLW 223 MOVWF PMD5+0 ;pic_init.c,60 :: GIE_bit = 1; BSF GIE_bit+0, BitPos(GIE_bit+0) ;pic_init.c,61 :: IOCIE_bit = 1; BSF IOCIE_bit+0, BitPos(IOCIE_bit+0) ;pic_init.c,62 :: IOCBF5_bit = 0; BCF IOCBF5_bit+0, BitPos(IOCBF5_bit+0) ;pic_init.c,63 :: IOCBN5_bit = 1; BSF IOCBN5_bit+0, BitPos(IOCBN5_bit+0) ;pic_init.c,65 :: Delay_ms (100); MOVLW 5 MOVWF R11 MOVLW 15 MOVWF R12 MOVLW 241 MOVWF R13 L_pic_init0: DECFSZ R13, 1 GOTO L_pic_init0 DECFSZ R12, 1 GOTO L_pic_init0 DECFSZ R11, 1 GOTO L_pic_init0 ;pic_init.c,66 :: return; ;pic_init.c,67 :: } L_end_pic_init: RETURN ; end of _pic_init
mmlgb/driver/music.asm
misterdanb/TheWindWizerd
0
171123
;-------------------------------------------------------- ; File Created by SDCC : FreeWare ANSI-C Compiler ; Version 2.3.1 Wed Sep 12 19:33:30 2018 ;-------------------------------------------------------- .module lcc53900 ;-------------------------------------------------------- ; Public variables in this module ;-------------------------------------------------------- .globl _mus_rep_depth4 .globl _mus_rep_depth3 .globl _mus_rep_depth2 .globl _mus_rep_depth1 .globl _mus_repeats4 .globl _mus_repeats3 .globl _mus_repeats2 .globl _mus_repeats1 .globl _mus_rep4 .globl _mus_rep3 .globl _mus_rep2 .globl _mus_rep1 .globl _mus_po3 .globl _mus_po2 .globl _mus_po1 .globl _mus_noise_step .globl _mus_vib_delay2 .globl _mus_vib_delay1 .globl _mus_vib_pos2 .globl _mus_vib_pos1 .globl _mus_vib_table2 .globl _mus_vib_table1 .globl _mus_vib_speed2 .globl _mus_vib_speed1 .globl _mus_porta4 .globl _mus_porta2 .globl _mus_porta1 .globl _mus_slide4 .globl _mus_slide2 .globl _mus_slide1 .globl _mus_target4 .globl _mus_target2 .globl _mus_target1 .globl _mus_wait4 .globl _mus_wait3 .globl _mus_wait2 .globl _mus_wait1 .globl _mus_duty2 .globl _mus_duty1 .globl _mus_pan4 .globl _mus_pan3 .globl _mus_pan2 .globl _mus_pan1 .globl _mus_env4 .globl _mus_env2 .globl _mus_env1 .globl _mus_volume4 .globl _mus_volume3 .globl _mus_volume2 .globl _mus_volume1 .globl _mus_length4 .globl _mus_length3 .globl _mus_length2 .globl _mus_length1 .globl _mus_octave4 .globl _mus_octave3 .globl _mus_octave2 .globl _mus_octave1 .globl _mus_loop4 .globl _mus_loop3 .globl _mus_loop2 .globl _mus_loop1 .globl _mus_data4 .globl _mus_data3 .globl _mus_data2 .globl _mus_data1 .globl _mus_freq4 .globl _mus_freq3 .globl _mus_freq2 .globl _mus_freq1 .globl _mus_done4 .globl _mus_done3 .globl _mus_done2 .globl _mus_done1 .globl _mus_enabled4 .globl _mus_enabled1 .globl _mus_song .globl _mus_step .globl _mus_paused .globl _mus_init .globl _mus_setPaused .globl _mus_togglePaused .globl _mus_disable1 .globl _mus_disable4 .globl _mus_restore1 .globl _mus_restore4 .globl _mus_is_done .globl _mus_update .globl _mus_update1 .globl _mus_update2 .globl _mus_update3 .globl _mus_update4 ;-------------------------------------------------------- ; special function registers ;-------------------------------------------------------- ;-------------------------------------------------------- ; special function bits ;-------------------------------------------------------- ;-------------------------------------------------------- ; internal ram data ;-------------------------------------------------------- .area _DATA _mus_paused:: .ds 1 _mus_step:: .ds 1 _mus_song:: .ds 2 _mus_enabled1:: .ds 1 _mus_enabled4:: .ds 1 _mus_done1:: .ds 1 _mus_done2:: .ds 1 _mus_done3:: .ds 1 _mus_done4:: .ds 1 _mus_freq1:: .ds 2 _mus_freq2:: .ds 2 _mus_freq3:: .ds 2 _mus_freq4:: .ds 1 _mus_data1:: .ds 2 _mus_data2:: .ds 2 _mus_data3:: .ds 2 _mus_data4:: .ds 2 _mus_loop1:: .ds 2 _mus_loop2:: .ds 2 _mus_loop3:: .ds 2 _mus_loop4:: .ds 2 _mus_octave1:: .ds 1 _mus_octave2:: .ds 1 _mus_octave3:: .ds 1 _mus_octave4:: .ds 1 _mus_length1:: .ds 1 _mus_length2:: .ds 1 _mus_length3:: .ds 1 _mus_length4:: .ds 1 _mus_volume1:: .ds 1 _mus_volume2:: .ds 1 _mus_volume3:: .ds 1 _mus_volume4:: .ds 1 _mus_env1:: .ds 1 _mus_env2:: .ds 1 _mus_env4:: .ds 1 _mus_pan1:: .ds 1 _mus_pan2:: .ds 1 _mus_pan3:: .ds 1 _mus_pan4:: .ds 1 _mus_duty1:: .ds 1 _mus_duty2:: .ds 1 _mus_wait1:: .ds 1 _mus_wait2:: .ds 1 _mus_wait3:: .ds 1 _mus_wait4:: .ds 1 _mus_target1:: .ds 2 _mus_target2:: .ds 2 _mus_target4:: .ds 2 _mus_slide1:: .ds 1 _mus_slide2:: .ds 1 _mus_slide4:: .ds 1 _mus_porta1:: .ds 1 _mus_porta2:: .ds 1 _mus_porta4:: .ds 1 _mus_vib_speed1:: .ds 1 _mus_vib_speed2:: .ds 1 _mus_vib_table1:: .ds 2 _mus_vib_table2:: .ds 2 _mus_vib_pos1:: .ds 1 _mus_vib_pos2:: .ds 1 _mus_vib_delay1:: .ds 1 _mus_vib_delay2:: .ds 1 _mus_noise_step:: .ds 1 _mus_po1:: .ds 1 _mus_po2:: .ds 1 _mus_po3:: .ds 1 _mus_rep1:: .ds 8 _mus_rep2:: .ds 8 _mus_rep3:: .ds 8 _mus_rep4:: .ds 8 _mus_repeats1:: .ds 4 _mus_repeats2:: .ds 4 _mus_repeats3:: .ds 4 _mus_repeats4:: .ds 4 _mus_rep_depth1:: .ds 1 _mus_rep_depth2:: .ds 1 _mus_rep_depth3:: .ds 1 _mus_rep_depth4:: .ds 1 ;-------------------------------------------------------- ; overlayable items in internal ram ;-------------------------------------------------------- .area _OVERLAY ;-------------------------------------------------------- ; indirectly addressable internal ram data ;-------------------------------------------------------- .area _ISEG ;-------------------------------------------------------- ; bit data ;-------------------------------------------------------- .area _BSEG ;-------------------------------------------------------- ; external ram data ;-------------------------------------------------------- .area _XSEG ;-------------------------------------------------------- ; global & static initialisations ;-------------------------------------------------------- .area _GSINIT .area _GSFINAL .area _GSINIT ;-------------------------------------------------------- ; Home ;-------------------------------------------------------- .area _HOME .area _CODE ;-------------------------------------------------------- ; code ;-------------------------------------------------------- .area _CODE ; music.c 42 ; genLabel ; genFunction ; --------------------------------- ; Function mus_init ; --------------------------------- ___mus_init_start: _mus_init: lda sp,-2(sp) ; music.c 45 ; genAssign ld bc,#0xFF26 ; genAssign (pointer) ld a,#0x80 ld (bc),a ; music.c 46 ; genAssign ld bc,#0xFF25 ; genAssign (pointer) ld a,#0xFF ld (bc),a ; music.c 47 ; genAssign ld bc,#0xFF24 ; genAssign (pointer) ld a,#0xFF ld (bc),a ; music.c 50 ; genAssign ld bc,#0xFF10 ; genAssign (pointer) ld a,#0x00 ld (bc),a ; music.c 51 ; genAssign ld bc,#0xFF12 ; genAssign (pointer) ld a,#0x00 ld (bc),a ; music.c 52 ; genAssign ld bc,#0xFF17 ; genAssign (pointer) ld a,#0x00 ld (bc),a ; music.c 53 ; genAssign ld bc,#0xFF1A ; genAssign (pointer) ld a,#0x00 ld (bc),a ; music.c 54 ; genAssign ld bc,#0xFF1C ; genAssign (pointer) ld a,#0x00 ld (bc),a ; music.c 55 ; genAssign ld bc,#0xFF21 ; genAssign (pointer) ld a,#0x00 ld (bc),a ; music.c 58 ; genAssign ld bc,#0xFF07 ; genAssign (pointer) ld a,#0x04 ld (bc),a ; music.c 59 ; genAssign ld bc,#0xFF06 ; genAssign (pointer) ld a,#0xCC ld (bc),a ; music.c 62 ; genAssign ; AOP_HL for _mus_paused ld hl,#_mus_paused ld (hl),#0x00 ; music.c 63 ; genAssign ; AOP_HL for _mus_step ld hl,#_mus_step ld (hl),#0x00 ; music.c 65 ; genAssign ; AOP_STK for ; AOP_HL for _mus_song lda hl,4(sp) ld a,(hl+) ld e,(hl) ld hl,#_mus_song ld (hl+),a ld (hl),e ; music.c 66 ; genAssign ; AOP_HL for _mus_song dec hl ld c,(hl) inc hl ld b,(hl) ; genPointerGet ld e,c ld d,b ld a,(de) ld c,a inc de ld a,(de) ld b,a ; genPlus ; AOP_HL for _mus_song ; Can't optimise plus by inc, falling back to the normal way dec hl ld a,(hl) add a,c ld c,a inc hl ld a,(hl) adc a,b ld b,a ; genAssign ; AOP_HL for _mus_loop1 ld hl,#_mus_loop1 ld (hl),c inc hl ld (hl),b ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld (hl),c inc hl ld (hl),b ; music.c 67 ; genAssign ; AOP_HL for _mus_song ld hl,#_mus_song ld c,(hl) inc hl ld b,(hl) ; genPlus ; genPlusIncr inc bc inc bc ; genPointerGet ld e,c ld d,b ld a,(de) ld c,a inc de ld a,(de) ld b,a ; genPlus ; AOP_HL for _mus_song ; Can't optimise plus by inc, falling back to the normal way dec hl ld a,(hl) add a,c ld c,a inc hl ld a,(hl) adc a,b ld b,a ; genAssign ; AOP_HL for _mus_loop2 ld hl,#_mus_loop2 ld (hl),c inc hl ld (hl),b ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld (hl),c inc hl ld (hl),b ; music.c 68 ; genAssign ; AOP_HL for _mus_song ld hl,#_mus_song ld c,(hl) inc hl ld b,(hl) ; genPlus ; genPlusIncr inc bc inc bc inc bc inc bc ; genPointerGet ld e,c ld d,b ld a,(de) ld c,a inc de ld a,(de) ld b,a ; genPlus ; AOP_HL for _mus_song ; Can't optimise plus by inc, falling back to the normal way dec hl ld a,(hl) add a,c ld c,a inc hl ld a,(hl) adc a,b ld b,a ; genAssign ; AOP_HL for _mus_loop3 ld hl,#_mus_loop3 ld (hl),c inc hl ld (hl),b ; genAssign ; AOP_HL for _mus_data3 ld hl,#_mus_data3 ld (hl),c inc hl ld (hl),b ; music.c 69 ; genAssign ; AOP_HL for _mus_song ld hl,#_mus_song ld c,(hl) inc hl ld b,(hl) ; genPlus ; genPlusIncr ; Can't optimise plus by inc, falling back to the normal way ld a,c add a,#0x06 ld c,a ld a,b adc a,#0x00 ld b,a ; genPointerGet ld e,c ld d,b ld a,(de) ld c,a inc de ld a,(de) ld b,a ; genPlus ; AOP_HL for _mus_song ; Can't optimise plus by inc, falling back to the normal way dec hl ld a,(hl) add a,c ld c,a inc hl ld a,(hl) adc a,b ld b,a ; genAssign ; AOP_HL for _mus_loop4 ld hl,#_mus_loop4 ld (hl),c inc hl ld (hl),b ; genAssign ; AOP_HL for _mus_data4 ld hl,#_mus_data4 ld (hl),c inc hl ld (hl),b ; music.c 71 ; genAssign ; AOP_HL for _mus_enabled4 ld hl,#_mus_enabled4 ld (hl),#0x01 ; genAssign ; AOP_HL for _mus_enabled1 ld hl,#_mus_enabled1 ld (hl),#0x01 ; music.c 72 ; genAssign ; AOP_HL for _mus_done4 ld hl,#_mus_done4 ld (hl),#0x00 ; genAssign ; AOP_HL for _mus_done3 ld hl,#_mus_done3 ld (hl),#0x00 ; genAssign ; AOP_HL for _mus_done2 ld hl,#_mus_done2 ld (hl),#0x00 ; genAssign ; AOP_HL for _mus_done1 ld hl,#_mus_done1 ld (hl),#0x00 ; music.c 73 ; genAssign ; AOP_HL for _mus_wait4 ld hl,#_mus_wait4 ld (hl),#0x00 ; genAssign ; AOP_HL for _mus_wait3 ld hl,#_mus_wait3 ld (hl),#0x00 ; genAssign ; AOP_HL for _mus_wait2 ld hl,#_mus_wait2 ld (hl),#0x00 ; genAssign ; AOP_HL for _mus_wait1 ld hl,#_mus_wait1 ld (hl),#0x00 ; music.c 74 ; genAssign ; AOP_HL for _mus_octave4 ld hl,#_mus_octave4 ld (hl),#0x04 ; genAssign ; AOP_HL for _mus_octave3 ld hl,#_mus_octave3 ld (hl),#0x04 ; genAssign ; AOP_HL for _mus_octave2 ld hl,#_mus_octave2 ld (hl),#0x04 ; genAssign ; AOP_HL for _mus_octave1 ld hl,#_mus_octave1 ld (hl),#0x04 ; music.c 75 ; genAssign ; AOP_HL for _mus_length4 ld hl,#_mus_length4 ld (hl),#0x30 ; genAssign ; AOP_HL for _mus_length3 ld hl,#_mus_length3 ld (hl),#0x30 ; genAssign ; AOP_HL for _mus_length2 ld hl,#_mus_length2 ld (hl),#0x30 ; genAssign ; AOP_HL for _mus_length1 ld hl,#_mus_length1 ld (hl),#0x30 ; music.c 76 ; genAssign ; AOP_HL for _mus_volume4 ld hl,#_mus_volume4 ld (hl),#0xF0 ; genAssign ; AOP_HL for _mus_volume2 ld hl,#_mus_volume2 ld (hl),#0xF0 ; genAssign ; AOP_HL for _mus_volume1 ld hl,#_mus_volume1 ld (hl),#0xF0 ; music.c 77 ; genAssign ; AOP_HL for _mus_volume3 ld hl,#_mus_volume3 ld (hl),#0x20 ; music.c 78 ; genAssign ; AOP_HL for _mus_env4 ld hl,#_mus_env4 ld (hl),#0x03 ; genAssign ; AOP_HL for _mus_env2 ld hl,#_mus_env2 ld (hl),#0x03 ; genAssign ; AOP_HL for _mus_env1 ld hl,#_mus_env1 ld (hl),#0x03 ; music.c 79 ; genAssign ; AOP_HL for _mus_rep_depth4 ld hl,#_mus_rep_depth4 ld (hl),#0xFF ; genAssign ; AOP_HL for _mus_rep_depth3 ld hl,#_mus_rep_depth3 ld (hl),#0xFF ; genAssign ; AOP_HL for _mus_rep_depth2 ld hl,#_mus_rep_depth2 ld (hl),#0xFF ; genAssign ; AOP_HL for _mus_rep_depth1 ld hl,#_mus_rep_depth1 ld (hl),#0xFF ; music.c 80 ; genAssign ; AOP_HL for _mus_slide4 ld hl,#_mus_slide4 ld (hl),#0x00 ; genAssign ; AOP_HL for _mus_slide2 ld hl,#_mus_slide2 ld (hl),#0x00 ; genAssign ; AOP_HL for _mus_slide1 ld hl,#_mus_slide1 ld (hl),#0x00 ; music.c 81 ; genAssign ; AOP_HL for _mus_porta4 ld hl,#_mus_porta4 ld (hl),#0x00 ; genAssign ; AOP_HL for _mus_porta2 ld hl,#_mus_porta2 ld (hl),#0x00 ; genAssign ; AOP_HL for _mus_porta1 ld hl,#_mus_porta1 ld (hl),#0x00 ; music.c 82 ; genAssign ; AOP_HL for _mus_vib_speed2 ld hl,#_mus_vib_speed2 ld (hl),#0x00 ; genAssign ; AOP_HL for _mus_vib_speed1 ld hl,#_mus_vib_speed1 ld (hl),#0x00 ; music.c 83 ; genAssign ; AOP_HL for _mus_noise_step ld hl,#_mus_noise_step ld (hl),#0x00 ; music.c 84 ; genAssign ; AOP_HL for _mus_po3 ld hl,#_mus_po3 ld (hl),#0x80 ; genAssign ; AOP_HL for _mus_po2 ld hl,#_mus_po2 ld (hl),#0x80 ; genAssign ; AOP_HL for _mus_po1 ld hl,#_mus_po1 ld (hl),#0x80 ; music.c 85 ; genAssign ; AOP_HL for _mus_pan4 ld hl,#_mus_pan4 ld (hl),#0x11 ; genAssign ; AOP_HL for _mus_pan3 ld hl,#_mus_pan3 ld (hl),#0x11 ; genAssign ; AOP_HL for _mus_pan2 ld hl,#_mus_pan2 ld (hl),#0x11 ; genAssign ; AOP_HL for _mus_pan1 ld hl,#_mus_pan1 ld (hl),#0x11 ; music.c 87 ; genAssign ld c,#0x00 ; genLabel 00101$: ; genCmpEq ; genCmpEq: left 1, right 1, result 0 ld a,c cp a,#0x04 jp z,00105$ 00109$: ; music.c 88 ; genPlus ; AOP_STK for _mus_init_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way ld de,#_mus_repeats1 ld l,c ld h,#0x00 add hl,de ld a,l ld d,h lda hl,0(sp) ld (hl+),a ld (hl),d ; genAssign (pointer) ; AOP_STK for _mus_init_sloc0_1_0 dec hl ld e,(hl) inc hl ld d,(hl) ld a,#0x00 ld (de),a ; music.c 89 ; genPlus ; AOP_STK for _mus_init_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way ld de,#_mus_repeats2 ld l,c ld h,#0x00 add hl,de ld a,l ld d,h lda hl,0(sp) ld (hl+),a ld (hl),d ; genAssign (pointer) ; AOP_STK for _mus_init_sloc0_1_0 dec hl ld e,(hl) inc hl ld d,(hl) ld a,#0x00 ld (de),a ; music.c 90 ; genPlus ; AOP_STK for _mus_init_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way ld de,#_mus_repeats3 ld l,c ld h,#0x00 add hl,de ld a,l ld d,h lda hl,0(sp) ld (hl+),a ld (hl),d ; genAssign (pointer) ; AOP_STK for _mus_init_sloc0_1_0 dec hl ld e,(hl) inc hl ld d,(hl) ld a,#0x00 ld (de),a ; music.c 91 ; genPlus ; AOP_STK for _mus_init_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way ld de,#_mus_repeats4 ld l,c ld h,#0x00 add hl,de ld a,l ld d,h lda hl,0(sp) ld (hl+),a ld (hl),d ; genAssign (pointer) ; AOP_STK for _mus_init_sloc0_1_0 dec hl ld e,(hl) inc hl ld d,(hl) ld a,#0x00 ld (de),a ; music.c 87 ; genPlus ; genPlusIncr ; Removed redundent load inc c ; genGoto jp 00101$ ; genLabel 00105$: ; genEndFunction lda sp,2(sp) ret ___mus_init_end: ; music.c 95 ; genLabel ; genFunction ; --------------------------------- ; Function mus_setPaused ; --------------------------------- ___mus_setPaused_start: _mus_setPaused: lda sp,-6(sp) ; music.c 96 ; genAssign ; AOP_STK for ; AOP_HL for _mus_paused lda hl,8(sp) ld a,(hl) ld hl,#_mus_paused ld (hl),a ; music.c 98 ; genIfx ; AOP_HL for _mus_paused xor a,a or a,(hl) jp z,00103$ ; music.c 99 ; genAssign ld bc,#0xFF12 ; genAssign ; AOP_STK for _mus_setPaused_sloc0_1_0 lda hl,4(sp) ld (hl),#0x17 inc hl ld (hl),#0xFF ; genAssign ; AOP_STK for _mus_setPaused_sloc1_1_0 lda hl,2(sp) ld (hl),#0x1C inc hl ld (hl),#0xFF ; genAssign ; AOP_STK for _mus_setPaused_sloc2_1_0 lda hl,0(sp) ld (hl),#0x21 inc hl ld (hl),#0xFF ; genAssign (pointer) ; AOP_STK for _mus_setPaused_sloc2_1_0 dec hl ld e,(hl) inc hl ld d,(hl) ld a,#0x00 ld (de),a ; genAssign (pointer) ; AOP_STK for _mus_setPaused_sloc1_1_0 inc hl ld e,(hl) inc hl ld d,(hl) ld a,#0x00 ld (de),a ; genAssign (pointer) ; AOP_STK for _mus_setPaused_sloc0_1_0 inc hl ld e,(hl) inc hl ld d,(hl) ld a,#0x00 ld (de),a ; genAssign (pointer) ld a,#0x00 ld (bc),a ; music.c 100 ; genAssign ld bc,#0xFF14 ; genAssign ; AOP_STK for _mus_setPaused_sloc2_1_0 lda hl,0(sp) ld (hl),#0x19 inc hl ld (hl),#0xFF ; genAssign ; AOP_STK for _mus_setPaused_sloc1_1_0 inc hl ld (hl),#0x1E inc hl ld (hl),#0xFF ; genAssign ; AOP_STK for _mus_setPaused_sloc0_1_0 inc hl ld (hl),#0x23 inc hl ld (hl),#0xFF ; genAssign (pointer) ; AOP_STK for _mus_setPaused_sloc0_1_0 dec hl ld e,(hl) inc hl ld d,(hl) ld a,#0x80 ld (de),a ; genAssign (pointer) ; AOP_STK for _mus_setPaused_sloc1_1_0 lda hl,2(sp) ld e,(hl) inc hl ld d,(hl) ld a,#0x80 ld (de),a ; genAssign (pointer) ; AOP_STK for _mus_setPaused_sloc2_1_0 lda hl,0(sp) ld e,(hl) inc hl ld d,(hl) ld a,#0x80 ld (de),a ; genAssign (pointer) ld a,#0x80 ld (bc),a ; genLabel 00103$: ; genEndFunction lda sp,6(sp) ret ___mus_setPaused_end: ; music.c 104 ; genLabel ; genFunction ; --------------------------------- ; Function mus_togglePaused ; --------------------------------- ___mus_togglePaused_start: _mus_togglePaused: ; music.c 105 ; genXor ; AOP_HL for _mus_paused ld a,#0x01 ld hl,#_mus_paused xor a,(hl) ; genIpush ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 ld c,a push af inc sp ; genCall call _mus_setPaused lda sp,1(sp) ; genLabel 00101$: ; genEndFunction ret ___mus_togglePaused_end: ; music.c 108 ; genLabel ; genFunction ; --------------------------------- ; Function mus_disable1 ; --------------------------------- ___mus_disable1_start: _mus_disable1: ; music.c 109 ; genAssign ; AOP_HL for _mus_enabled1 ld hl,#_mus_enabled1 ld (hl),#0x00 ; music.c 110 ; genAssign ld bc,#0xFF13 ; genAssign (pointer) ld a,#0x00 ld (bc),a ; music.c 111 ; genAssign ld bc,#0xFF14 ; genAssign (pointer) ld a,#0x80 ld (bc),a ; genLabel 00101$: ; genEndFunction ret ___mus_disable1_end: ; music.c 114 ; genLabel ; genFunction ; --------------------------------- ; Function mus_disable4 ; --------------------------------- ___mus_disable4_start: _mus_disable4: ; music.c 115 ; genAssign ; AOP_HL for _mus_enabled4 ld hl,#_mus_enabled4 ld (hl),#0x00 ; music.c 116 ; genAssign ld bc,#0xFF22 ; genAssign (pointer) ld a,#0x00 ld (bc),a ; music.c 117 ; genAssign ld bc,#0xFF23 ; genAssign (pointer) ld a,#0x80 ld (bc),a ; genLabel 00101$: ; genEndFunction ret ___mus_disable4_end: ; music.c 120 ; genLabel ; genFunction ; --------------------------------- ; Function mus_restore1 ; --------------------------------- ___mus_restore1_start: _mus_restore1: lda sp,-3(sp) ; music.c 121 ; genAssign ; AOP_HL for _mus_enabled1 ld hl,#_mus_enabled1 ld (hl),#0x02 ; music.c 122 ; genAssign ld bc,#0xFF25 ; genAssign ; AOP_STK for _mus_restore1_sloc0_1_0 lda hl,1(sp) ld (hl),#0x25 inc hl ld (hl),#0xFF ; genPointerGet ; AOP_STK for _mus_restore1_sloc0_1_0 ; AOP_STK for _mus_restore1_sloc1_1_0 dec hl ld e,(hl) inc hl ld d,(hl) ld a,(de) dec hl dec hl ; genAnd ; AOP_STK for _mus_restore1_sloc1_1_0 ; AOP_STK for _mus_restore1_sloc0_1_0 ld (hl),a ld a,a and a,#0xEE inc hl ; genOr ; AOP_STK for _mus_restore1_sloc0_1_0 ; AOP_HL for _mus_pan1 ld (hl),a ld a,a ld hl,#_mus_pan1 or a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 123 ; genAssign ld bc,#0xFF11 ; genLeftShift ; AOP_HL for _mus_duty1 ; AOP_STK for _mus_restore1_sloc1_1_0 ld hl,#_mus_duty1 ld a,(hl) srl a rr a rr a and a,#0xE0 lda hl,0(sp) ; genAssign (pointer) ; AOP_STK for _mus_restore1_sloc1_1_0 ld (hl),a ld a,a ld (bc),a ; music.c 124 ; genAssign ld bc,#0xFF12 ; genAssign (pointer) ld a,#0x00 ld (bc),a ; music.c 125 ; genAssign ld bc,#0xFF14 ; genAssign (pointer) ld a,#0x80 ld (bc),a ; genLabel 00101$: ; genEndFunction lda sp,3(sp) ret ___mus_restore1_end: ; music.c 128 ; genLabel ; genFunction ; --------------------------------- ; Function mus_restore4 ; --------------------------------- ___mus_restore4_start: _mus_restore4: lda sp,-3(sp) ; music.c 129 ; genAssign ; AOP_HL for _mus_enabled4 ld hl,#_mus_enabled4 ld (hl),#0x02 ; music.c 130 ; genAssign ld bc,#0xFF25 ; genAssign ; AOP_STK for _mus_restore4_sloc0_1_0 lda hl,1(sp) ld (hl),#0x25 inc hl ld (hl),#0xFF ; genPointerGet ; AOP_STK for _mus_restore4_sloc0_1_0 ; AOP_STK for _mus_restore4_sloc1_1_0 dec hl ld e,(hl) inc hl ld d,(hl) ld a,(de) dec hl dec hl ; genAnd ; AOP_STK for _mus_restore4_sloc1_1_0 ; AOP_STK for _mus_restore4_sloc0_1_0 ld (hl),a ld a,a and a,#0x77 inc hl ld (hl),a ; genLeftShift ; AOP_HL for _mus_pan4 ; AOP_STK for _mus_restore4_sloc1_1_0 ld hl,#_mus_pan4 ld a,(hl) sla a rl a rl a and a,#0xF8 lda hl,0(sp) ; genOr ; AOP_STK for _mus_restore4_sloc0_1_0 ; AOP_STK for _mus_restore4_sloc1_1_0 ld (hl+),a ld a,(hl) dec hl or a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 131 ; genAssign ld bc,#0xFF21 ; genAssign (pointer) ld a,#0x00 ld (bc),a ; music.c 132 ; genAssign ld bc,#0xFF23 ; genAssign (pointer) ld a,#0x80 ld (bc),a ; genLabel 00101$: ; genEndFunction lda sp,3(sp) ret ___mus_restore4_end: ; music.c 135 ; genLabel ; genFunction ; --------------------------------- ; Function mus_is_done ; --------------------------------- ___mus_is_done_start: _mus_is_done: ; music.c 136 ; genAndOp ; AOP_HL for _mus_done1 ; AOP_HL for _mus_done2 xor a,a ld hl,#_mus_done1 or a,(hl) jr z,00103$ xor a,a ld hl,#_mus_done2 or a,(hl) 00103$: jr z,00104$ ld a,#0x01 00104$: ld c,a ; genAndOp ; AOP_HL for _mus_done3 xor a,a or a,c jr z,00105$ xor a,a ld hl,#_mus_done3 or a,(hl) 00105$: jr z,00106$ ld a,#0x01 00106$: ld c,a ; genAndOp ; AOP_HL for _mus_done4 xor a,a or a,c jr z,00107$ xor a,a ld hl,#_mus_done4 or a,(hl) 00107$: jr z,00108$ ld a,#0x01 00108$: ld c,a ; genOrOp ; AOP_HL for _mus_paused xor a,a ld hl,#_mus_paused or a,(hl) jr nz,00109$ xor a,a or a,c 00109$: jr z,00110$ ld a,#0x01 00110$: ld c,a ; genRet ld e,c ; genLabel 00101$: ; genEndFunction ret ___mus_is_done_end: ; music.c 139 ; genLabel ; genFunction ; --------------------------------- ; Function mus_update ; --------------------------------- ___mus_update_start: _mus_update: ; music.c 140 ; genIfx ; AOP_HL for _mus_paused xor a,a ld hl,#_mus_paused or a,(hl) ; genRet ; genLabel jp nz,00103$ 00102$: ; music.c 142 ; genCall ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 call _mus_update1 ; music.c 143 ; genCall ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 call _mus_update2 ; music.c 144 ; genCall ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 call _mus_update3 ; music.c 145 ; genCall ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 call _mus_update4 ; genLabel 00103$: ; genEndFunction ret ___mus_update_end: ; music.c 148 ; genLabel ; genFunction ; --------------------------------- ; Function mus_update1 ; --------------------------------- ___mus_update1_start: _mus_update1: lda sp,-8(sp) ; music.c 152 ; genIfx ; AOP_HL for _mus_slide1 xor a,a ld hl,#_mus_slide1 or a,(hl) jp z,00113$ ; genAnd ; AOP_HL for _mus_step ld hl,#_mus_step ld a,(hl) and a,#0x03 jr nz,00247$ jp 00248$ 00247$: jp 00113$ 00248$: ; music.c 153 ; genCmpGt ; AOP_HL for _mus_target1 ; AOP_HL for _mus_freq1 ld hl,#_mus_freq1 ld a,(hl) ld hl,#_mus_target1 sub a,(hl) ld hl,#_mus_freq1 + 1 ld a,(hl) ld hl,#_mus_target1 + 1 sbc a,(hl) jp nc,00108$ ; music.c 154 ; genCast ; AOP_HL for _mus_slide1 ld hl,#_mus_slide1 ld c,(hl) ld b,#0x00 ; genPlus ; AOP_HL for _mus_freq1 ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_freq1 ld a,(hl) add a,c ld (hl+),a ld a,(hl) adc a,b ld (hl),a ; music.c 155 ; genCmpGt ; AOP_HL for _mus_freq1 ; AOP_HL for _mus_target1 ld hl,#_mus_target1 ld a,(hl) ld hl,#_mus_freq1 sub a,(hl) ld hl,#_mus_target1 + 1 ld a,(hl) ld hl,#_mus_freq1 + 1 sbc a,(hl) jp nc,00109$ ; music.c 156 ; genAssign ; AOP_HL for _mus_target1 ; AOP_HL for _mus_freq1 ld hl,#_mus_target1 ld a,(hl+) ld e,(hl) ld hl,#_mus_freq1 ld (hl+),a ld (hl),e ; genGoto jp 00109$ ; genLabel 00108$: ; music.c 159 ; genCmpLt ; AOP_HL for _mus_target1 ; AOP_HL for _mus_freq1 ld hl,#_mus_target1 ld a,(hl) ld hl,#_mus_freq1 sub a,(hl) ld hl,#_mus_target1 + 1 ld a,(hl) ld hl,#_mus_freq1 + 1 sbc a,(hl) jp nc,00109$ ; music.c 160 ; genCast ; AOP_HL for _mus_slide1 ld hl,#_mus_slide1 ld c,(hl) ld b,#0x00 ; genMinus ; AOP_HL for _mus_freq1 ld hl,#_mus_freq1 ld a,(hl) sub a,c ld (hl+),a ld a,(hl) sbc a,b ; music.c 161 ; genCmpLt ; AOP_HL for _mus_freq1 ; AOP_HL for _mus_target1 ld (hl-),a ld a,(hl) ld hl,#_mus_target1 sub a,(hl) ld hl,#_mus_freq1 + 1 ld a,(hl) ld hl,#_mus_target1 + 1 sbc a,(hl) jp nc,00109$ ; music.c 162 ; genAssign ; AOP_HL for _mus_target1 ; AOP_HL for _mus_freq1 dec hl ld a,(hl+) ld e,(hl) ld hl,#_mus_freq1 ld (hl+),a ld (hl),e ; genLabel 00109$: ; music.c 165 ; genIfx ; AOP_HL for _mus_enabled1 xor a,a ld hl,#_mus_enabled1 or a,(hl) jp z,00113$ ; music.c 166 ; genAssign ld bc,#0xFF13 ; genCast ; AOP_HL for _mus_freq1 ld hl,#_mus_freq1 ld a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 167 ; genAssign ld bc,#0xFF14 ; genRightShift ; AOP_HL for _mus_freq1 ; AOP_STK for _mus_update1_sloc0_1_0 inc hl ld a,(hl) lda hl,3(sp) ld (hl+),a ld (hl),#0x00 ; genCast ; AOP_STK for _mus_update1_sloc0_1_0 dec hl ld a,(hl) ; genAssign (pointer) ld (bc),a ; genLabel 00113$: ; music.c 171 ; genIfx ; AOP_HL for _mus_vib_delay1 xor a,a ld hl,#_mus_vib_delay1 or a,(hl) jp z,00120$ ; music.c 172 ; genMinus ; AOP_HL for _mus_vib_delay1 dec (hl) ; genGoto jp 00121$ ; genLabel 00120$: ; music.c 174 ; genIfx ; AOP_HL for _mus_vib_speed1 xor a,a ld hl,#_mus_vib_speed1 or a,(hl) jp z,00121$ ; music.c 175 ; genPlus ; AOP_HL for _mus_vib_pos1 ; AOP_HL for _mus_vib_speed1 ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_vib_pos1 ld a,(hl) ld hl,#_mus_vib_speed1 add a,(hl) ; genAnd ; AOP_HL for _mus_vib_pos1 ld c,a and a,#0x3F ld hl,#_mus_vib_pos1 ld (hl),a ; music.c 176 ; genAssign ; AOP_HL for _mus_vib_table1 ld hl,#_mus_vib_table1 ld c,(hl) inc hl ld b,(hl) ; genPointerGet ld a,(bc) ld c,a ; genCast ; Removed redundent load ld b,#0x00 ; genMinus ; AOP_HL for _mus_freq1 ld hl,#_mus_freq1 ld a,(hl) sub a,c ld c,a inc hl ld a,(hl) sbc a,b ld b,a ; genPlus ; AOP_HL for _mus_vib_table1 ; AOP_HL for _mus_vib_pos1 ; AOP_STK for _mus_update1_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_vib_table1 ld e,(hl) inc hl ld d,(hl) ld hl,#_mus_vib_pos1 ld l,(hl) ld h,#0x00 add hl,de ld a,l ld d,h lda hl,3(sp) ; genPointerGet ; AOP_STK for _mus_update1_sloc0_1_0 ; AOP_STK for _mus_update1_sloc1_1_0 ld (hl+),a ld (hl),d ld e,a ld a,(de) dec hl dec hl ld (hl),a ; genCast ; AOP_STK for _mus_update1_sloc1_1_0 ; AOP_STK for _mus_update1_sloc0_1_0 ld a,(hl+) ld (hl+),a ld (hl),#0x00 ; genPlus ; AOP_STK for _mus_update1_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way dec hl ld a,(hl+) ld h,(hl) ld l,a add hl,bc ld c,l ld b,h ; genAssign ; AOP_STK for _mus_update1_vib_freq_1_1 lda hl,5(sp) ld (hl),c inc hl ld (hl),b ; music.c 178 ; genIfx ; AOP_HL for _mus_enabled1 xor a,a ld hl,#_mus_enabled1 or a,(hl) jp z,00121$ ; music.c 179 ; genAssign ld bc,#0xFF13 ; genCast ; AOP_STK for _mus_update1_vib_freq_1_1 lda hl,5(sp) ld a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 180 ; genAssign ld bc,#0xFF14 ; genRightShift ; AOP_STK for _mus_update1_vib_freq_1_1 ; AOP_STK for _mus_update1_sloc0_1_0 inc hl ld a,(hl) lda hl,3(sp) ld (hl+),a ld (hl),#0x00 ; genCast ; AOP_STK for _mus_update1_sloc0_1_0 dec hl ld a,(hl) ; genAssign (pointer) ld (bc),a ; genLabel 00121$: ; music.c 184 ; genIfx ; AOP_HL for _mus_wait1 xor a,a ld hl,#_mus_wait1 or a,(hl) jp z,00206$ ; music.c 185 ; genMinus ; AOP_HL for _mus_wait1 dec (hl) ; music.c 186 ; genIfx ; AOP_HL for _mus_wait1 xor a,a or a,(hl) ; genRet ; music.c 189 ; genLabel jp nz,00208$ 00206$: ; music.c 190 ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00249$ inc hl inc (hl) 00249$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_STK for _mus_update1_note_1_1 lda hl,7(sp) ld (hl),c ; music.c 191 ; genCmpLt ; AOP_STK for _mus_update1_note_1_1 ld a,(hl) cp #0x14 jp c,00147$ ; music.c 192 ; genAnd ; AOP_STK for _mus_update1_note_1_1 ld a,(hl) and a,#0x80 jr nz,00250$ jp 00127$ 00250$: ; music.c 193 ; genXor ; AOP_STK for _mus_update1_note_1_1 ld a,#0x80 lda hl,7(sp) xor a,(hl) ld (hl),a ; music.c 194 ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld b,(hl) inc hl ld c,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00251$ inc hl inc (hl) 00251$: ; genPointerGet ; AOP_HL for _mus_wait1 ld e,b ld d,c ld a,(de) ld hl,#_mus_wait1 ld (hl),a ; genGoto jp 00128$ ; genLabel 00127$: ; music.c 197 ; genAssign ; AOP_HL for _mus_length1 ; AOP_HL for _mus_wait1 ld hl,#_mus_length1 ld a,(hl) ld hl,#_mus_wait1 ld (hl),a ; genLabel 00128$: ; music.c 199 ; genCmpEq ; AOP_STK for _mus_update1_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,7(sp) ld a,(hl) cp a,#0x21 jp nz,00140$ jr 00253$ 00252$: jp 00140$ 00253$: ; music.c 200 ; genRet jp 00208$ ; genLabel 00140$: ; music.c 201 ; genCmpEq ; AOP_STK for _mus_update1_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,7(sp) ld a,(hl) cp a,#0x20 jp nz,00137$ jr 00255$ 00254$: jp 00137$ 00255$: ; music.c 202 ; genAssign ; AOP_HL for _mus_freq1 ld hl,#_mus_freq1 ld (hl),#0x00 inc hl ld (hl),#0x00 ; music.c 203 ; genIfx ; AOP_HL for _mus_enabled1 xor a,a ld hl,#_mus_enabled1 or a,(hl) jp z,00141$ ; genAssign ld bc,#0xFF12 ; genAssign (pointer) ld a,#0x00 ld (bc),a ; genGoto jp 00141$ ; genLabel 00137$: ; music.c 205 ; genIfx ; AOP_HL for _mus_porta1 xor a,a ld hl,#_mus_porta1 or a,(hl) jp z,00132$ ; music.c 206 ; genLeftShift ; AOP_HL for _mus_octave1 ld hl,#_mus_octave1 ld a,(hl) sla a rl a rl a rl a and a,#0xF0 ; genPlus ; AOP_STK for _mus_update1_note_1_1 ; Can't optimise plus by inc, falling back to the normal way ld c,a lda hl,7(sp) add a,(hl) ; genMinus ld c,a add a,#0xEC ld c,a ; genCast ; Removed redundent load ld b,#0x00 ; genLeftShift sla c rl b ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld hl,#_freq add hl,bc ld c,l ld b,h ; genPointerGet ld e,c ld d,b ld a,(de) ld c,a inc de ld a,(de) ld b,a ; genCast ; AOP_HL for _mus_po1 ; AOP_STK for _mus_update1_sloc0_1_0 ld hl,#_mus_po1 ld a,(hl) lda hl,3(sp) ld (hl+),a ld (hl),#0x00 ; genPlus ; AOP_STK for _mus_update1_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way dec hl ld a,(hl+) ld h,(hl) ld l,a add hl,bc ld c,l ld b,h ; genMinus ; AOP_HL for _mus_target1 ld a,c add a,#0x80 ld hl,#_mus_target1 ld (hl),a ld a,b adc a,#0xFF inc hl ld (hl),a ; genGoto jp 00133$ ; genLabel 00132$: ; music.c 208 ; genLeftShift ; AOP_HL for _mus_octave1 ld hl,#_mus_octave1 ld a,(hl) sla a rl a rl a rl a and a,#0xF0 ; genPlus ; AOP_STK for _mus_update1_note_1_1 ; Can't optimise plus by inc, falling back to the normal way ld c,a lda hl,7(sp) add a,(hl) ; genMinus ld c,a add a,#0xEC ld c,a ; genCast ; Removed redundent load ld b,#0x00 ; genLeftShift sla c rl b ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld hl,#_freq add hl,bc ld c,l ld b,h ; genPointerGet ld e,c ld d,b ld a,(de) ld c,a inc de ld a,(de) ld b,a ; genCast ; AOP_HL for _mus_po1 ; AOP_STK for _mus_update1_sloc0_1_0 ld hl,#_mus_po1 ld a,(hl) lda hl,3(sp) ld (hl+),a ld (hl),#0x00 ; genPlus ; AOP_STK for _mus_update1_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way dec hl ld a,(hl+) ld h,(hl) ld l,a add hl,bc ld c,l ld b,h ; genMinus ; AOP_HL for _mus_freq1 ld a,c add a,#0x80 ld hl,#_mus_freq1 ld (hl),a ld a,b adc a,#0xFF inc hl ld (hl),a ; genLabel 00133$: ; music.c 210 ; genIfx ; AOP_HL for _mus_enabled1 xor a,a ld hl,#_mus_enabled1 or a,(hl) jp z,00141$ ; genAssign ld bc,#0xFF12 ; genOr ; AOP_HL for _mus_volume1 ; AOP_HL for _mus_env1 ld hl,#_mus_volume1 ld a,(hl) ld hl,#_mus_env1 or a,(hl) ; genAssign (pointer) ld (bc),a ; genLabel 00141$: ; music.c 212 ; genIfx ; AOP_HL for _mus_enabled1 xor a,a ld hl,#_mus_enabled1 or a,(hl) jp z,00145$ ; music.c 213 ; genCmpEq ; AOP_HL for _mus_enabled1 ; genCmpEq: left 1, right 1, result 0 ld a,(hl) cp a,#0x02 jp nz,00143$ jr 00261$ 00260$: jp 00143$ 00261$: ; music.c 214 ; genMinus ; AOP_HL for _mus_enabled1 ld hl,#_mus_enabled1 dec (hl) ; music.c 215 ; genAssign ld bc,#0xFF12 ; genOr ; AOP_HL for _mus_volume1 ; AOP_HL for _mus_env1 ld hl,#_mus_volume1 ld a,(hl) ld hl,#_mus_env1 or a,(hl) ; genAssign (pointer) ld (bc),a ; genLabel 00143$: ; music.c 217 ; genAssign ld bc,#0xFF13 ; genCast ; AOP_HL for _mus_freq1 ld hl,#_mus_freq1 ld a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 218 ; genAssign ld bc,#0xFF14 ; genRightShift ; AOP_HL for _mus_freq1 ; AOP_STK for _mus_update1_sloc0_1_0 inc hl ld a,(hl) lda hl,3(sp) ld (hl+),a ld (hl),#0x00 ; genOr ; AOP_STK for _mus_update1_sloc0_1_0 ; AOP_STK for _mus_update1_sloc2_1_0 dec hl ld a,(hl) or a,#0x80 lda hl,0(sp) ld (hl),a lda hl,4(sp) ld a,(hl) lda hl,1(sp) ; genCast ; AOP_STK for _mus_update1_sloc2_1_0 ld (hl-),a ld a,(hl) ; genAssign (pointer) ld (bc),a ; genLabel 00145$: ; music.c 220 ; genRet jp 00208$ ; genLabel 00147$: ; music.c 222 ; genCmpGt ; AOP_STK for _mus_update1_note_1_1 ld a,#0x13 lda hl,7(sp) sub a,(hl) jp c,00206$ ; genJumpTab ; AOP_STK for _mus_update1_note_1_1 ld e,(hl) ld d,#0x00 ld hl,#00262$ add hl,de add hl,de add hl,de jp (hl) 00262$: jp 00148$ jp 00149$ jp 00150$ jp 00151$ jp 00152$ jp 00155$ jp 00158$ jp 00161$ jp 00164$ jp 00165$ jp 00169$ jp 00179$ jp 00189$ jp 00190$ jp 00196$ jp 00197$ jp 00198$ jp 00199$ jp 00200$ jp 00201$ ; music.c 224 ; genLabel 00148$: ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00263$ inc hl inc (hl) 00263$: ; genPointerGet ; AOP_HL for _mus_length1 ld a,(bc) ld hl,#_mus_length1 ld (hl),a ; music.c 225 ; genGoto jp 00206$ ; music.c 227 ; genLabel 00149$: ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00264$ inc hl inc (hl) 00264$: ; genPointerGet ; AOP_HL for _mus_octave1 ld a,(bc) ld hl,#_mus_octave1 ld (hl),a ; music.c 228 ; genGoto jp 00206$ ; music.c 230 ; genLabel 00150$: ; genPlus ; AOP_HL for _mus_octave1 ; genPlusIncr ld hl,#_mus_octave1 inc (hl) ; music.c 231 ; genGoto jp 00206$ ; music.c 233 ; genLabel 00151$: ; genMinus ; AOP_HL for _mus_octave1 ld hl,#_mus_octave1 dec (hl) ; music.c 234 ; genGoto jp 00206$ ; music.c 236 ; genLabel 00152$: ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00265$ inc hl inc (hl) 00265$: ; genPointerGet ; AOP_HL for _mus_volume1 ld a,(bc) ld hl,#_mus_volume1 ld (hl),a ; music.c 237 ; genIfx ; AOP_HL for _mus_enabled1 xor a,a ld hl,#_mus_enabled1 or a,(hl) jp z,00206$ ; genAssign ld bc,#0xFF12 ; genOr ; AOP_HL for _mus_volume1 ; AOP_HL for _mus_env1 ld hl,#_mus_volume1 ld a,(hl) ld hl,#_mus_env1 or a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 238 ; genGoto jp 00206$ ; music.c 240 ; genLabel 00155$: ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00266$ inc hl inc (hl) 00266$: ; genPointerGet ; AOP_HL for _mus_env1 ld a,(bc) ld hl,#_mus_env1 ld (hl),a ; music.c 241 ; genIfx ; AOP_HL for _mus_enabled1 xor a,a ld hl,#_mus_enabled1 or a,(hl) jp z,00206$ ; genAssign ld bc,#0xFF12 ; genOr ; AOP_HL for _mus_volume1 ; AOP_HL for _mus_env1 ld hl,#_mus_volume1 ld a,(hl) ld hl,#_mus_env1 or a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 242 ; genGoto jp 00206$ ; music.c 244 ; genLabel 00158$: ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00267$ inc hl inc (hl) 00267$: ; genPointerGet ; AOP_HL for _mus_duty1 ld a,(bc) ld hl,#_mus_duty1 ld (hl),a ; music.c 245 ; genIfx ; AOP_HL for _mus_enabled1 xor a,a ld hl,#_mus_enabled1 or a,(hl) jp z,00206$ ; genAssign ld bc,#0xFF11 ; genLeftShift ; AOP_HL for _mus_duty1 ; AOP_STK for _mus_update1_sloc2_1_0 ld hl,#_mus_duty1 ld a,(hl) srl a rr a rr a and a,#0xE0 lda hl,0(sp) ; genAssign (pointer) ; AOP_STK for _mus_update1_sloc2_1_0 ld (hl),a ; Removed redundent load ld (bc),a ; music.c 246 ; genGoto jp 00206$ ; music.c 248 ; genLabel 00161$: ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00268$ inc hl inc (hl) 00268$: ; genPointerGet ; AOP_HL for _mus_pan1 ld a,(bc) ld hl,#_mus_pan1 ld (hl),a ; music.c 249 ; genIfx ; AOP_HL for _mus_enabled1 xor a,a ld hl,#_mus_enabled1 or a,(hl) jp z,00206$ ; genAssign ld bc,#0xFF25 ; genAssign ; AOP_STK for _mus_update1_sloc2_1_0 lda hl,0(sp) ld (hl),#0x25 inc hl ld (hl),#0xFF ; genPointerGet ; AOP_STK for _mus_update1_sloc2_1_0 ; AOP_STK for _mus_update1_sloc1_1_0 dec hl ld e,(hl) inc hl ld d,(hl) ld a,(de) inc hl ; genAnd ; AOP_STK for _mus_update1_sloc1_1_0 ; AOP_STK for _mus_update1_sloc2_1_0 ld (hl),a ; Removed redundent load and a,#0xEE dec hl dec hl ; genOr ; AOP_STK for _mus_update1_sloc2_1_0 ; AOP_HL for _mus_pan1 ld (hl),a ; Removed redundent load ld hl,#_mus_pan1 or a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 250 ; genGoto jp 00206$ ; music.c 252 ; genLabel 00164$: ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00269$ inc hl inc (hl) 00269$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_HL for _mus_porta1 ld hl,#_mus_porta1 ld (hl),c ; genAssign ; AOP_HL for _mus_slide1 ld hl,#_mus_slide1 ld (hl),c ; music.c 253 ; genGoto jp 00206$ ; music.c 255 ; genLabel 00165$: ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00270$ inc hl inc (hl) 00270$: ; genPointerGet ; AOP_HL for _mus_slide1 ld a,(bc) ld hl,#_mus_slide1 ld (hl),a ; music.c 256 ; genAssign ; AOP_HL for _mus_porta1 ld hl,#_mus_porta1 ld (hl),#0x00 ; music.c 257 ; genCmpLt ; AOP_HL for _mus_slide1 ld hl,#_mus_slide1 ld a,(hl) cp #0x80 jp c,00167$ ; music.c 258 ; genAssign ; AOP_HL for _mus_target1 ld hl,#_mus_target1 ld (hl),#0xFF inc hl ld (hl),#0xFF ; music.c 259 ; genMinus ; AOP_HL for _mus_slide1 ld hl,#_mus_slide1 ld a,(hl) add a,#0x80 ld (hl),a ; genGoto jp 00206$ ; genLabel 00167$: ; music.c 261 ; genAssign ; AOP_HL for _mus_target1 ld hl,#_mus_target1 ld (hl),#0x00 inc hl ld (hl),#0x00 ; music.c 262 ; genMinus ; AOP_HL for _mus_slide1 ld a,#0x80 ld hl,#_mus_slide1 sub a,(hl) ld (hl),a ; music.c 264 ; genGoto jp 00206$ ; music.c 266 ; genLabel 00169$: ; genAssign ; AOP_HL for _mus_vib_pos1 ld hl,#_mus_vib_pos1 ld (hl),#0x00 ; music.c 267 ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00271$ inc hl inc (hl) 00271$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_STK for _mus_update1_note_1_1 lda hl,7(sp) ld (hl),c ; music.c 268 ; genAnd ; AOP_STK for _mus_update1_note_1_1 ; AOP_HL for _mus_vib_speed1 ld a,(hl) and a,#0x0F ld hl,#_mus_vib_speed1 ld (hl),a ; music.c 269 ; genRightShift ; AOP_STK for _mus_update1_note_1_1 lda hl,7(sp) ld a,(hl) srl a srl a srl a srl a ; music.c 270 ; genCmpEq ; AOP_STK for _mus_update1_note_1_1 ; genCmpEq: left 1, right 1, result 0 ld (hl),a ; Removed redundent load cp a,#0x01 jp nz,00177$ jr 00273$ 00272$: jp 00177$ 00273$: ; genAddrOf ; AOP_HL for _mus_vib_table1 ld de,#_vib1 ld hl,#_mus_vib_table1 ld (hl),e inc hl ld (hl),d ; genGoto jp 00178$ ; genLabel 00177$: ; music.c 271 ; genCmpEq ; AOP_STK for _mus_update1_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,7(sp) ld a,(hl) cp a,#0x02 jp nz,00174$ jr 00275$ 00274$: jp 00174$ 00275$: ; genAddrOf ; AOP_HL for _mus_vib_table1 ld de,#_vib2 ld hl,#_mus_vib_table1 ld (hl),e inc hl ld (hl),d ; genGoto jp 00178$ ; genLabel 00174$: ; music.c 272 ; genCmpEq ; AOP_STK for _mus_update1_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,7(sp) ld a,(hl) cp a,#0x03 jp nz,00171$ jr 00277$ 00276$: jp 00171$ 00277$: ; genAddrOf ; AOP_HL for _mus_vib_table1 ld de,#_vib3 ld hl,#_mus_vib_table1 ld (hl),e inc hl ld (hl),d ; genGoto jp 00178$ ; genLabel 00171$: ; music.c 273 ; genAddrOf ; AOP_HL for _mus_vib_table1 ld de,#_vib4 ld hl,#_mus_vib_table1 ld (hl),e inc hl ld (hl),d ; genLabel 00178$: ; music.c 274 ; genAssign ; AOP_HL for _mus_vib_delay1 ld hl,#_mus_vib_delay1 ld (hl),#0x00 ; music.c 275 ; genGoto jp 00206$ ; music.c 277 ; genLabel 00179$: ; genAssign ; AOP_HL for _mus_vib_pos1 ld hl,#_mus_vib_pos1 ld (hl),#0x00 ; music.c 278 ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00278$ inc hl inc (hl) 00278$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_STK for _mus_update1_note_1_1 lda hl,7(sp) ld (hl),c ; music.c 279 ; genAnd ; AOP_STK for _mus_update1_note_1_1 ; AOP_HL for _mus_vib_speed1 ld a,(hl) and a,#0x0F ld hl,#_mus_vib_speed1 ld (hl),a ; music.c 280 ; genRightShift ; AOP_STK for _mus_update1_note_1_1 lda hl,7(sp) ld a,(hl) srl a srl a srl a srl a ; music.c 281 ; genCmpEq ; AOP_STK for _mus_update1_note_1_1 ; genCmpEq: left 1, right 1, result 0 ld (hl),a ; Removed redundent load cp a,#0x01 jp nz,00187$ jr 00280$ 00279$: jp 00187$ 00280$: ; genAddrOf ; AOP_HL for _mus_vib_table1 ld de,#_vib1 ld hl,#_mus_vib_table1 ld (hl),e inc hl ld (hl),d ; genGoto jp 00188$ ; genLabel 00187$: ; music.c 282 ; genCmpEq ; AOP_STK for _mus_update1_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,7(sp) ld a,(hl) cp a,#0x02 jp nz,00184$ jr 00282$ 00281$: jp 00184$ 00282$: ; genAddrOf ; AOP_HL for _mus_vib_table1 ld de,#_vib2 ld hl,#_mus_vib_table1 ld (hl),e inc hl ld (hl),d ; genGoto jp 00188$ ; genLabel 00184$: ; music.c 283 ; genCmpEq ; AOP_STK for _mus_update1_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,7(sp) ld a,(hl) cp a,#0x03 jp nz,00181$ jr 00284$ 00283$: jp 00181$ 00284$: ; genAddrOf ; AOP_HL for _mus_vib_table1 ld de,#_vib3 ld hl,#_mus_vib_table1 ld (hl),e inc hl ld (hl),d ; genGoto jp 00188$ ; genLabel 00181$: ; music.c 284 ; genAddrOf ; AOP_HL for _mus_vib_table1 ld de,#_vib4 ld hl,#_mus_vib_table1 ld (hl),e inc hl ld (hl),d ; genLabel 00188$: ; music.c 285 ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00285$ inc hl inc (hl) 00285$: ; genPointerGet ; AOP_HL for _mus_vib_delay1 ld a,(bc) ld hl,#_mus_vib_delay1 ld (hl),a ; music.c 286 ; genGoto jp 00206$ ; music.c 288 ; genLabel 00189$: ; genPlus ; AOP_HL for _mus_rep_depth1 ; genPlusIncr ld hl,#_mus_rep_depth1 inc (hl) ; music.c 289 ; genCast ; AOP_HL for _mus_rep_depth1 ld c,(hl) ld b,#0x00 ; genLeftShift sla c rl b ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_rep1 add hl,bc ld c,l ld b,h ; genAssign (pointer) ; AOP_HL for _mus_data1 ld e,c ld d,b ld hl,#_mus_data1 ld a,(hl) ld (de),a inc de inc hl ld a,(hl) ld (de),a ; music.c 290 ; genGoto jp 00206$ ; music.c 292 ; genLabel 00190$: ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00288$ inc hl inc (hl) 00288$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_STK for _mus_update1_note_1_1 lda hl,7(sp) ld (hl),c ; music.c 293 ; genPlus ; AOP_HL for _mus_rep_depth1 ; Can't optimise plus by inc, falling back to the normal way ld a,#<_mus_repeats1 ld hl,#_mus_rep_depth1 add a,(hl) ld c,a ld a,#>_mus_repeats1 adc a,#0x00 ld b,a ; genPointerGet ld a,(bc) ; genIfx or a,a jp nz,00192$ ; music.c 294 ; genAssign (pointer) ; AOP_STK for _mus_update1_note_1_1 lda hl,7(sp) ld a,(hl) ld (bc),a ; music.c 295 ; genCast ; AOP_HL for _mus_rep_depth1 ; AOP_STK for _mus_update1_sloc2_1_0 ld hl,#_mus_rep_depth1 ld a,(hl) lda hl,0(sp) ld (hl+),a ld (hl),#0x00 ; genLeftShift ; AOP_STK for _mus_update1_sloc2_1_0 ; AOP_STK for _mus_update1_sloc0_1_0 dec hl ld a,(hl) lda hl,3(sp) ld (hl-),a dec hl ld a,(hl) lda hl,4(sp) ld (hl-),a sla (hl) inc hl rl (hl) ; genPlus ; AOP_STK for _mus_update1_sloc0_1_0 ; AOP_STK for _mus_update1_sloc2_1_0 ; Can't optimise plus by inc, falling back to the normal way ld de,#_mus_rep1 dec hl ld a,(hl+) ld h,(hl) ld l,a add hl,de ld a,l ld d,h lda hl,0(sp) ; genPointerGet ; AOP_STK for _mus_update1_sloc2_1_0 ; AOP_HL for _mus_data1 ld (hl+),a ld (hl),d ld e,a ld a,(de) ld hl,#_mus_data1 ld (hl),a inc de ld a,(de) inc hl ld (hl),a ; genLabel 00192$: ; music.c 297 ; genPointerGet ; AOP_STK for _mus_update1_sloc2_1_0 ld a,(bc) lda hl,0(sp) ; genMinus ; AOP_STK for _mus_update1_sloc2_1_0 ; AOP_STK for _mus_update1_sloc1_1_0 ld (hl),a ; Removed redundent load add a,#0xFF inc hl inc hl ; genAssign (pointer) ; AOP_STK for _mus_update1_sloc1_1_0 ld (hl),a ; Removed redundent load ld (bc),a ; music.c 298 ; genIfx ; AOP_STK for _mus_update1_sloc1_1_0 xor a,a or a,(hl) jp z,00194$ ; music.c 299 ; genCast ; AOP_HL for _mus_rep_depth1 ld hl,#_mus_rep_depth1 ld c,(hl) ld b,#0x00 ; genLeftShift sla c rl b ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_rep1 add hl,bc ld c,l ld b,h ; genPointerGet ; AOP_HL for _mus_data1 ld e,c ld d,b ld a,(de) ld hl,#_mus_data1 ld (hl),a inc de ld a,(de) inc hl ld (hl),a ; genGoto jp 00206$ ; genLabel 00194$: ; music.c 301 ; genMinus ; AOP_HL for _mus_rep_depth1 ld hl,#_mus_rep_depth1 dec (hl) ; music.c 303 ; genGoto jp 00206$ ; music.c 305 ; genLabel 00196$: ; genAssign ; AOP_HL for _mus_data1 ; AOP_HL for _mus_loop1 ld hl,#_mus_data1 ld a,(hl+) ld e,(hl) ld hl,#_mus_loop1 ld (hl+),a ld (hl),e ; music.c 306 ; genGoto jp 00206$ ; music.c 308 ; genLabel 00197$: ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr dec hl inc (hl) jr nz,00293$ inc hl inc (hl) 00293$: ; genPointerGet ; AOP_HL for _mus_po1 ld a,(bc) ld hl,#_mus_po1 ld (hl),a ; music.c 309 ; genGoto jp 00206$ ; music.c 311 ; genLabel 00198$: ; genAssign ld bc,#0xFF06 ; genAssign ; AOP_HL for _mus_data1 ; AOP_STK for _mus_update1_sloc2_1_0 ld hl,#_mus_data1 ld a,(hl+) ld e,(hl) lda hl,0(sp) ld (hl+),a ld (hl),e ; genPlus ; AOP_HL for _mus_data1 ; genPlusIncr ld hl,#_mus_data1 inc (hl) jr nz,00294$ inc hl inc (hl) 00294$: ; genPointerGet ; AOP_STK for _mus_update1_sloc2_1_0 lda hl,0(sp) ld e,(hl) inc hl ld d,(hl) ld a,(de) ; genAssign (pointer) ld (bc),a ; music.c 312 ; genGoto jp 00206$ ; music.c 314 ; genLabel 00199$: ; genGoto jp 00206$ ; music.c 316 ; genLabel 00200$: ; genGoto jp 00206$ ; music.c 318 ; genLabel 00201$: ; genAssign ; AOP_HL for _mus_loop1 ; AOP_HL for _mus_data1 ld hl,#_mus_loop1 ld a,(hl+) ld e,(hl) ld hl,#_mus_data1 ld (hl+),a ld (hl),e ; music.c 319 ; genAssign ; AOP_HL for _mus_done1 ld hl,#_mus_done1 ld (hl),#0x01 ; music.c 320 ; genAssign ; AOP_HL for _mus_data1 ld hl,#_mus_data1 ld c,(hl) inc hl ld b,(hl) ; genPointerGet ld a,(bc) ; genCmpEq ; genCmpEq: left 1, right 1, result 0 ld c,a cp a,#0x13 jp nz,00206$ jr 00296$ 00295$: jp 00206$ 00296$: ; music.c 321 ; genAssign ; AOP_HL for _mus_wait1 ld hl,#_mus_wait1 ld (hl),#0xFF ; music.c 322 ; genRet ; music.c 328 ; genLabel 00208$: ; genEndFunction lda sp,8(sp) ret ___mus_update1_end: ; music.c 331 ; genLabel ; genFunction ; --------------------------------- ; Function mus_update2 ; --------------------------------- ___mus_update2_start: _mus_update2: lda sp,-8(sp) ; music.c 335 ; genIfx ; AOP_HL for _mus_slide2 xor a,a ld hl,#_mus_slide2 or a,(hl) jp z,00111$ ; genAnd ; AOP_HL for _mus_step ld hl,#_mus_step ld a,(hl) and a,#0x03 jr nz,00217$ jp 00218$ 00217$: jp 00111$ 00218$: ; music.c 336 ; genCmpGt ; AOP_HL for _mus_target2 ; AOP_HL for _mus_freq2 ld hl,#_mus_freq2 ld a,(hl) ld hl,#_mus_target2 sub a,(hl) ld hl,#_mus_freq2 + 1 ld a,(hl) ld hl,#_mus_target2 + 1 sbc a,(hl) jp nc,00108$ ; music.c 337 ; genCast ; AOP_HL for _mus_slide2 ld hl,#_mus_slide2 ld c,(hl) ld b,#0x00 ; genPlus ; AOP_HL for _mus_freq2 ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_freq2 ld a,(hl) add a,c ld (hl+),a ld a,(hl) adc a,b ld (hl),a ; music.c 338 ; genCmpGt ; AOP_HL for _mus_freq2 ; AOP_HL for _mus_target2 ld hl,#_mus_target2 ld a,(hl) ld hl,#_mus_freq2 sub a,(hl) ld hl,#_mus_target2 + 1 ld a,(hl) ld hl,#_mus_freq2 + 1 sbc a,(hl) jp nc,00109$ ; music.c 339 ; genAssign ; AOP_HL for _mus_target2 ; AOP_HL for _mus_freq2 ld hl,#_mus_target2 ld a,(hl+) ld e,(hl) ld hl,#_mus_freq2 ld (hl+),a ld (hl),e ; genGoto jp 00109$ ; genLabel 00108$: ; music.c 342 ; genCmpLt ; AOP_HL for _mus_target2 ; AOP_HL for _mus_freq2 ld hl,#_mus_target2 ld a,(hl) ld hl,#_mus_freq2 sub a,(hl) ld hl,#_mus_target2 + 1 ld a,(hl) ld hl,#_mus_freq2 + 1 sbc a,(hl) jp nc,00109$ ; music.c 343 ; genCast ; AOP_HL for _mus_slide2 ld hl,#_mus_slide2 ld c,(hl) ld b,#0x00 ; genMinus ; AOP_HL for _mus_freq2 ld hl,#_mus_freq2 ld a,(hl) sub a,c ld (hl+),a ld a,(hl) sbc a,b ; music.c 344 ; genCmpLt ; AOP_HL for _mus_freq2 ; AOP_HL for _mus_target2 ld (hl-),a ld a,(hl) ld hl,#_mus_target2 sub a,(hl) ld hl,#_mus_freq2 + 1 ld a,(hl) ld hl,#_mus_target2 + 1 sbc a,(hl) jp nc,00109$ ; music.c 345 ; genAssign ; AOP_HL for _mus_target2 ; AOP_HL for _mus_freq2 dec hl ld a,(hl+) ld e,(hl) ld hl,#_mus_freq2 ld (hl+),a ld (hl),e ; genLabel 00109$: ; music.c 348 ; genAssign ld bc,#0xFF18 ; genCast ; AOP_HL for _mus_freq2 ld hl,#_mus_freq2 ld a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 349 ; genAssign ld bc,#0xFF19 ; genRightShift ; AOP_HL for _mus_freq2 ; AOP_STK for _mus_update2_sloc0_1_0 inc hl ld a,(hl) lda hl,3(sp) ld (hl+),a ld (hl),#0x00 ; genCast ; AOP_STK for _mus_update2_sloc0_1_0 dec hl ld a,(hl) ; genAssign (pointer) ld (bc),a ; genLabel 00111$: ; music.c 352 ; genIfx ; AOP_HL for _mus_vib_delay2 xor a,a ld hl,#_mus_vib_delay2 or a,(hl) jp z,00116$ ; music.c 353 ; genMinus ; AOP_HL for _mus_vib_delay2 dec (hl) ; genGoto jp 00117$ ; genLabel 00116$: ; music.c 355 ; genIfx ; AOP_HL for _mus_vib_speed2 xor a,a ld hl,#_mus_vib_speed2 or a,(hl) jp z,00117$ ; music.c 356 ; genPlus ; AOP_HL for _mus_vib_pos2 ; AOP_HL for _mus_vib_speed2 ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_vib_pos2 ld a,(hl) ld hl,#_mus_vib_speed2 add a,(hl) ; genAnd ; AOP_HL for _mus_vib_pos2 ld c,a and a,#0x3F ld hl,#_mus_vib_pos2 ld (hl),a ; music.c 357 ; genAssign ; AOP_HL for _mus_vib_table2 ld hl,#_mus_vib_table2 ld c,(hl) inc hl ld b,(hl) ; genPointerGet ld a,(bc) ld c,a ; genCast ; Removed redundent load ld b,#0x00 ; genMinus ; AOP_HL for _mus_freq2 ld hl,#_mus_freq2 ld a,(hl) sub a,c ld c,a inc hl ld a,(hl) sbc a,b ld b,a ; genPlus ; AOP_HL for _mus_vib_table2 ; AOP_HL for _mus_vib_pos2 ; AOP_STK for _mus_update2_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_vib_table2 ld e,(hl) inc hl ld d,(hl) ld hl,#_mus_vib_pos2 ld l,(hl) ld h,#0x00 add hl,de ld a,l ld d,h lda hl,3(sp) ; genPointerGet ; AOP_STK for _mus_update2_sloc0_1_0 ; AOP_STK for _mus_update2_sloc1_1_0 ld (hl+),a ld (hl),d ld e,a ld a,(de) dec hl dec hl ld (hl),a ; genCast ; AOP_STK for _mus_update2_sloc1_1_0 ; AOP_STK for _mus_update2_sloc0_1_0 ld a,(hl+) ld (hl+),a ld (hl),#0x00 ; genPlus ; AOP_STK for _mus_update2_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way dec hl ld a,(hl+) ld h,(hl) ld l,a add hl,bc ld c,l ld b,h ; genAssign ; AOP_STK for _mus_update2_vib_freq_1_1 lda hl,5(sp) ld (hl),c inc hl ld (hl),b ; music.c 359 ; genAssign ld bc,#0xFF18 ; genCast ; AOP_STK for _mus_update2_vib_freq_1_1 dec hl ld a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 360 ; genAssign ld bc,#0xFF19 ; genRightShift ; AOP_STK for _mus_update2_vib_freq_1_1 ; AOP_STK for _mus_update2_sloc0_1_0 inc hl ld a,(hl) lda hl,3(sp) ld (hl+),a ld (hl),#0x00 ; genCast ; AOP_STK for _mus_update2_sloc0_1_0 dec hl ld a,(hl) ; genAssign (pointer) ld (bc),a ; genLabel 00117$: ; music.c 363 ; genIfx ; AOP_HL for _mus_wait2 xor a,a ld hl,#_mus_wait2 or a,(hl) jp z,00186$ ; music.c 364 ; genMinus ; AOP_HL for _mus_wait2 dec (hl) ; music.c 365 ; genIfx ; AOP_HL for _mus_wait2 xor a,a or a,(hl) ; genRet ; music.c 368 ; genLabel jp nz,00188$ 00186$: ; music.c 369 ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00219$ inc hl inc (hl) 00219$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_STK for _mus_update2_note_1_1 lda hl,7(sp) ld (hl),c ; music.c 370 ; genCmpLt ; AOP_STK for _mus_update2_note_1_1 ld a,(hl) cp #0x14 jp c,00135$ ; music.c 371 ; genAnd ; AOP_STK for _mus_update2_note_1_1 ld a,(hl) and a,#0x80 jr nz,00220$ jp 00123$ 00220$: ; music.c 372 ; genXor ; AOP_STK for _mus_update2_note_1_1 ld a,#0x80 lda hl,7(sp) xor a,(hl) ld (hl),a ; music.c 373 ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld b,(hl) inc hl ld c,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00221$ inc hl inc (hl) 00221$: ; genPointerGet ; AOP_HL for _mus_wait2 ld e,b ld d,c ld a,(de) ld hl,#_mus_wait2 ld (hl),a ; genGoto jp 00124$ ; genLabel 00123$: ; music.c 376 ; genAssign ; AOP_HL for _mus_length2 ; AOP_HL for _mus_wait2 ld hl,#_mus_length2 ld a,(hl) ld hl,#_mus_wait2 ld (hl),a ; genLabel 00124$: ; music.c 378 ; genCmpEq ; AOP_STK for _mus_update2_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,7(sp) ld a,(hl) cp a,#0x21 jp nz,00132$ jr 00223$ 00222$: jp 00132$ 00223$: ; music.c 379 ; genRet jp 00188$ ; genLabel 00132$: ; music.c 380 ; genCmpEq ; AOP_STK for _mus_update2_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,7(sp) ld a,(hl) cp a,#0x20 jp nz,00129$ jr 00225$ 00224$: jp 00129$ 00225$: ; music.c 381 ; genAssign ; AOP_HL for _mus_freq2 ld hl,#_mus_freq2 ld (hl),#0x00 inc hl ld (hl),#0x00 ; music.c 382 ; genAssign ld bc,#0xFF17 ; genAssign (pointer) ld a,#0x00 ld (bc),a ; genGoto jp 00133$ ; genLabel 00129$: ; music.c 384 ; genIfx ; AOP_HL for _mus_porta2 xor a,a ld hl,#_mus_porta2 or a,(hl) jp z,00126$ ; music.c 385 ; genLeftShift ; AOP_HL for _mus_octave2 ld hl,#_mus_octave2 ld a,(hl) sla a rl a rl a rl a and a,#0xF0 ; genPlus ; AOP_STK for _mus_update2_note_1_1 ; Can't optimise plus by inc, falling back to the normal way ld c,a lda hl,7(sp) add a,(hl) ; genMinus ld c,a add a,#0xEC ld c,a ; genCast ; Removed redundent load ld b,#0x00 ; genLeftShift sla c rl b ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld hl,#_freq add hl,bc ld c,l ld b,h ; genPointerGet ld e,c ld d,b ld a,(de) ld c,a inc de ld a,(de) ld b,a ; genCast ; AOP_HL for _mus_po2 ; AOP_STK for _mus_update2_sloc0_1_0 ld hl,#_mus_po2 ld a,(hl) lda hl,3(sp) ld (hl+),a ld (hl),#0x00 ; genPlus ; AOP_STK for _mus_update2_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way dec hl ld a,(hl+) ld h,(hl) ld l,a add hl,bc ld c,l ld b,h ; genMinus ; AOP_HL for _mus_target2 ld a,c add a,#0x80 ld hl,#_mus_target2 ld (hl),a ld a,b adc a,#0xFF inc hl ld (hl),a ; genGoto jp 00127$ ; genLabel 00126$: ; music.c 387 ; genLeftShift ; AOP_HL for _mus_octave2 ld hl,#_mus_octave2 ld a,(hl) sla a rl a rl a rl a and a,#0xF0 ; genPlus ; AOP_STK for _mus_update2_note_1_1 ; Can't optimise plus by inc, falling back to the normal way ld c,a lda hl,7(sp) add a,(hl) ; genMinus ld c,a add a,#0xEC ld c,a ; genCast ; Removed redundent load ld b,#0x00 ; genLeftShift sla c rl b ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld hl,#_freq add hl,bc ld c,l ld b,h ; genPointerGet ld e,c ld d,b ld a,(de) ld c,a inc de ld a,(de) ld b,a ; genCast ; AOP_HL for _mus_po2 ; AOP_STK for _mus_update2_sloc0_1_0 ld hl,#_mus_po2 ld a,(hl) lda hl,3(sp) ld (hl+),a ld (hl),#0x00 ; genPlus ; AOP_STK for _mus_update2_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way dec hl ld a,(hl+) ld h,(hl) ld l,a add hl,bc ld c,l ld b,h ; genMinus ; AOP_HL for _mus_freq2 ld a,c add a,#0x80 ld hl,#_mus_freq2 ld (hl),a ld a,b adc a,#0xFF inc hl ld (hl),a ; genLabel 00127$: ; music.c 389 ; genAssign ld bc,#0xFF17 ; genOr ; AOP_HL for _mus_volume2 ; AOP_HL for _mus_env2 ld hl,#_mus_volume2 ld a,(hl) ld hl,#_mus_env2 or a,(hl) ; genAssign (pointer) ld (bc),a ; genLabel 00133$: ; music.c 391 ; genAssign ld bc,#0xFF18 ; genCast ; AOP_HL for _mus_freq2 ld hl,#_mus_freq2 ld a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 392 ; genAssign ld bc,#0xFF19 ; genRightShift ; AOP_HL for _mus_freq2 ; AOP_STK for _mus_update2_sloc0_1_0 inc hl ld a,(hl) lda hl,3(sp) ld (hl+),a ld (hl),#0x00 ; genOr ; AOP_STK for _mus_update2_sloc0_1_0 ; AOP_STK for _mus_update2_sloc2_1_0 dec hl ld a,(hl) or a,#0x80 lda hl,0(sp) ld (hl),a lda hl,4(sp) ld a,(hl) lda hl,1(sp) ; genCast ; AOP_STK for _mus_update2_sloc2_1_0 ld (hl-),a ld a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 393 ; genRet jp 00188$ ; genLabel 00135$: ; music.c 395 ; genCmpGt ; AOP_STK for _mus_update2_note_1_1 ld a,#0x13 lda hl,7(sp) sub a,(hl) jp c,00186$ ; genJumpTab ; AOP_STK for _mus_update2_note_1_1 ld e,(hl) ld d,#0x00 ld hl,#00230$ add hl,de add hl,de add hl,de jp (hl) 00230$: jp 00136$ jp 00137$ jp 00138$ jp 00139$ jp 00140$ jp 00141$ jp 00142$ jp 00143$ jp 00144$ jp 00145$ jp 00149$ jp 00159$ jp 00169$ jp 00170$ jp 00176$ jp 00177$ jp 00178$ jp 00179$ jp 00180$ jp 00181$ ; music.c 397 ; genLabel 00136$: ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00231$ inc hl inc (hl) 00231$: ; genPointerGet ; AOP_HL for _mus_length2 ld a,(bc) ld hl,#_mus_length2 ld (hl),a ; music.c 398 ; genGoto jp 00186$ ; music.c 400 ; genLabel 00137$: ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00232$ inc hl inc (hl) 00232$: ; genPointerGet ; AOP_HL for _mus_octave2 ld a,(bc) ld hl,#_mus_octave2 ld (hl),a ; music.c 401 ; genGoto jp 00186$ ; music.c 403 ; genLabel 00138$: ; genPlus ; AOP_HL for _mus_octave2 ; genPlusIncr ld hl,#_mus_octave2 inc (hl) ; music.c 404 ; genGoto jp 00186$ ; music.c 406 ; genLabel 00139$: ; genMinus ; AOP_HL for _mus_octave2 ld hl,#_mus_octave2 dec (hl) ; music.c 407 ; genGoto jp 00186$ ; music.c 409 ; genLabel 00140$: ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00233$ inc hl inc (hl) 00233$: ; genPointerGet ; AOP_HL for _mus_volume2 ld a,(bc) ld hl,#_mus_volume2 ld (hl),a ; music.c 410 ; genAssign ld bc,#0xFF17 ; genOr ; AOP_HL for _mus_volume2 ; AOP_HL for _mus_env2 ld a,(hl) ld hl,#_mus_env2 or a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 411 ; genGoto jp 00186$ ; music.c 413 ; genLabel 00141$: ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00234$ inc hl inc (hl) 00234$: ; genPointerGet ; AOP_HL for _mus_env2 ld a,(bc) ld hl,#_mus_env2 ld (hl),a ; music.c 414 ; genAssign ld bc,#0xFF17 ; genOr ; AOP_HL for _mus_volume2 ; AOP_HL for _mus_env2 ld hl,#_mus_volume2 ld a,(hl) ld hl,#_mus_env2 or a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 415 ; genGoto jp 00186$ ; music.c 417 ; genLabel 00142$: ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00235$ inc hl inc (hl) 00235$: ; genPointerGet ; AOP_HL for _mus_duty2 ld a,(bc) ld hl,#_mus_duty2 ld (hl),a ; music.c 418 ; genAssign ld bc,#0xFF16 ; genLeftShift ; AOP_HL for _mus_duty2 ; AOP_STK for _mus_update2_sloc2_1_0 ld a,(hl) srl a rr a rr a and a,#0xE0 lda hl,0(sp) ; genAssign (pointer) ; AOP_STK for _mus_update2_sloc2_1_0 ld (hl),a ; Removed redundent load ld (bc),a ; music.c 419 ; genGoto jp 00186$ ; music.c 421 ; genLabel 00143$: ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00236$ inc hl inc (hl) 00236$: ; genPointerGet ; AOP_HL for _mus_pan2 ld a,(bc) ld hl,#_mus_pan2 ld (hl),a ; music.c 422 ; genAssign ld bc,#0xFF25 ; genAssign ; AOP_STK for _mus_update2_sloc2_1_0 lda hl,0(sp) ld (hl),#0x25 inc hl ld (hl),#0xFF ; genPointerGet ; AOP_STK for _mus_update2_sloc2_1_0 ; AOP_STK for _mus_update2_sloc1_1_0 dec hl ld e,(hl) inc hl ld d,(hl) ld a,(de) inc hl ; genAnd ; AOP_STK for _mus_update2_sloc1_1_0 ; AOP_STK for _mus_update2_sloc2_1_0 ld (hl),a ; Removed redundent load and a,#0xDD dec hl dec hl ld (hl),a ; genLeftShift ; AOP_HL for _mus_pan2 ; AOP_STK for _mus_update2_sloc1_1_0 ld hl,#_mus_pan2 ld a,(hl) add a,a lda hl,2(sp) ; genOr ; AOP_STK for _mus_update2_sloc2_1_0 ; AOP_STK for _mus_update2_sloc1_1_0 ld (hl-),a dec hl ld a,(hl+) inc hl or a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 423 ; genGoto jp 00186$ ; music.c 425 ; genLabel 00144$: ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00237$ inc hl inc (hl) 00237$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_HL for _mus_porta2 ld hl,#_mus_porta2 ld (hl),c ; genAssign ; AOP_HL for _mus_slide2 ld hl,#_mus_slide2 ld (hl),c ; music.c 426 ; genGoto jp 00186$ ; music.c 428 ; genLabel 00145$: ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00238$ inc hl inc (hl) 00238$: ; genPointerGet ; AOP_HL for _mus_slide2 ld a,(bc) ld hl,#_mus_slide2 ld (hl),a ; music.c 429 ; genAssign ; AOP_HL for _mus_porta2 ld hl,#_mus_porta2 ld (hl),#0x00 ; music.c 430 ; genCmpLt ; AOP_HL for _mus_slide2 ld hl,#_mus_slide2 ld a,(hl) cp #0x80 jp c,00147$ ; music.c 431 ; genAssign ; AOP_HL for _mus_target2 ld hl,#_mus_target2 ld (hl),#0xFF inc hl ld (hl),#0xFF ; music.c 432 ; genMinus ; AOP_HL for _mus_slide2 ld hl,#_mus_slide2 ld a,(hl) add a,#0x80 ld (hl),a ; genGoto jp 00186$ ; genLabel 00147$: ; music.c 434 ; genAssign ; AOP_HL for _mus_target2 ld hl,#_mus_target2 ld (hl),#0x00 inc hl ld (hl),#0x00 ; music.c 435 ; genMinus ; AOP_HL for _mus_slide2 ld a,#0x80 ld hl,#_mus_slide2 sub a,(hl) ld (hl),a ; music.c 437 ; genGoto jp 00186$ ; music.c 439 ; genLabel 00149$: ; genAssign ; AOP_HL for _mus_vib_pos2 ld hl,#_mus_vib_pos2 ld (hl),#0x00 ; music.c 440 ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00239$ inc hl inc (hl) 00239$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_STK for _mus_update2_note_1_1 lda hl,7(sp) ld (hl),c ; music.c 441 ; genAnd ; AOP_STK for _mus_update2_note_1_1 ; AOP_HL for _mus_vib_speed2 ld a,(hl) and a,#0x0F ld hl,#_mus_vib_speed2 ld (hl),a ; music.c 442 ; genRightShift ; AOP_STK for _mus_update2_note_1_1 lda hl,7(sp) ld a,(hl) srl a srl a srl a srl a ; music.c 443 ; genCmpEq ; AOP_STK for _mus_update2_note_1_1 ; genCmpEq: left 1, right 1, result 0 ld (hl),a ; Removed redundent load cp a,#0x01 jp nz,00157$ jr 00241$ 00240$: jp 00157$ 00241$: ; genAddrOf ; AOP_HL for _mus_vib_table2 ld de,#_vib1 ld hl,#_mus_vib_table2 ld (hl),e inc hl ld (hl),d ; genGoto jp 00158$ ; genLabel 00157$: ; music.c 444 ; genCmpEq ; AOP_STK for _mus_update2_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,7(sp) ld a,(hl) cp a,#0x02 jp nz,00154$ jr 00243$ 00242$: jp 00154$ 00243$: ; genAddrOf ; AOP_HL for _mus_vib_table2 ld de,#_vib2 ld hl,#_mus_vib_table2 ld (hl),e inc hl ld (hl),d ; genGoto jp 00158$ ; genLabel 00154$: ; music.c 445 ; genCmpEq ; AOP_STK for _mus_update2_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,7(sp) ld a,(hl) cp a,#0x03 jp nz,00151$ jr 00245$ 00244$: jp 00151$ 00245$: ; genAddrOf ; AOP_HL for _mus_vib_table2 ld de,#_vib3 ld hl,#_mus_vib_table2 ld (hl),e inc hl ld (hl),d ; genGoto jp 00158$ ; genLabel 00151$: ; music.c 446 ; genAddrOf ; AOP_HL for _mus_vib_table2 ld de,#_vib4 ld hl,#_mus_vib_table2 ld (hl),e inc hl ld (hl),d ; genLabel 00158$: ; music.c 447 ; genAssign ; AOP_HL for _mus_vib_delay2 ld hl,#_mus_vib_delay2 ld (hl),#0x00 ; music.c 448 ; genGoto jp 00186$ ; music.c 450 ; genLabel 00159$: ; genAssign ; AOP_HL for _mus_vib_pos2 ld hl,#_mus_vib_pos2 ld (hl),#0x00 ; music.c 451 ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00246$ inc hl inc (hl) 00246$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_STK for _mus_update2_note_1_1 lda hl,7(sp) ld (hl),c ; music.c 452 ; genAnd ; AOP_STK for _mus_update2_note_1_1 ; AOP_HL for _mus_vib_speed2 ld a,(hl) and a,#0x0F ld hl,#_mus_vib_speed2 ld (hl),a ; music.c 453 ; genRightShift ; AOP_STK for _mus_update2_note_1_1 lda hl,7(sp) ld a,(hl) srl a srl a srl a srl a ; music.c 454 ; genCmpEq ; AOP_STK for _mus_update2_note_1_1 ; genCmpEq: left 1, right 1, result 0 ld (hl),a ; Removed redundent load cp a,#0x01 jp nz,00167$ jr 00248$ 00247$: jp 00167$ 00248$: ; genAddrOf ; AOP_HL for _mus_vib_table2 ld de,#_vib1 ld hl,#_mus_vib_table2 ld (hl),e inc hl ld (hl),d ; genGoto jp 00168$ ; genLabel 00167$: ; music.c 455 ; genCmpEq ; AOP_STK for _mus_update2_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,7(sp) ld a,(hl) cp a,#0x02 jp nz,00164$ jr 00250$ 00249$: jp 00164$ 00250$: ; genAddrOf ; AOP_HL for _mus_vib_table2 ld de,#_vib2 ld hl,#_mus_vib_table2 ld (hl),e inc hl ld (hl),d ; genGoto jp 00168$ ; genLabel 00164$: ; music.c 456 ; genCmpEq ; AOP_STK for _mus_update2_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,7(sp) ld a,(hl) cp a,#0x03 jp nz,00161$ jr 00252$ 00251$: jp 00161$ 00252$: ; genAddrOf ; AOP_HL for _mus_vib_table2 ld de,#_vib3 ld hl,#_mus_vib_table2 ld (hl),e inc hl ld (hl),d ; genGoto jp 00168$ ; genLabel 00161$: ; music.c 457 ; genAddrOf ; AOP_HL for _mus_vib_table2 ld de,#_vib4 ld hl,#_mus_vib_table2 ld (hl),e inc hl ld (hl),d ; genLabel 00168$: ; music.c 458 ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00253$ inc hl inc (hl) 00253$: ; genPointerGet ; AOP_HL for _mus_vib_delay2 ld a,(bc) ld hl,#_mus_vib_delay2 ld (hl),a ; music.c 459 ; genGoto jp 00186$ ; music.c 461 ; genLabel 00169$: ; genPlus ; AOP_HL for _mus_rep_depth2 ; genPlusIncr ld hl,#_mus_rep_depth2 inc (hl) ; music.c 462 ; genCast ; AOP_HL for _mus_rep_depth2 ld c,(hl) ld b,#0x00 ; genLeftShift sla c rl b ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_rep2 add hl,bc ld c,l ld b,h ; genAssign (pointer) ; AOP_HL for _mus_data2 ld e,c ld d,b ld hl,#_mus_data2 ld a,(hl) ld (de),a inc de inc hl ld a,(hl) ld (de),a ; music.c 463 ; genGoto jp 00186$ ; music.c 465 ; genLabel 00170$: ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00256$ inc hl inc (hl) 00256$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_STK for _mus_update2_note_1_1 lda hl,7(sp) ld (hl),c ; music.c 466 ; genPlus ; AOP_HL for _mus_rep_depth2 ; Can't optimise plus by inc, falling back to the normal way ld a,#<_mus_repeats2 ld hl,#_mus_rep_depth2 add a,(hl) ld c,a ld a,#>_mus_repeats2 adc a,#0x00 ld b,a ; genPointerGet ld a,(bc) ; genIfx or a,a jp nz,00172$ ; music.c 467 ; genAssign (pointer) ; AOP_STK for _mus_update2_note_1_1 lda hl,7(sp) ld a,(hl) ld (bc),a ; music.c 468 ; genCast ; AOP_HL for _mus_rep_depth2 ; AOP_STK for _mus_update2_sloc2_1_0 ld hl,#_mus_rep_depth2 ld a,(hl) lda hl,0(sp) ld (hl+),a ld (hl),#0x00 ; genLeftShift ; AOP_STK for _mus_update2_sloc2_1_0 ; AOP_STK for _mus_update2_sloc0_1_0 dec hl ld a,(hl) lda hl,3(sp) ld (hl-),a dec hl ld a,(hl) lda hl,4(sp) ld (hl-),a sla (hl) inc hl rl (hl) ; genPlus ; AOP_STK for _mus_update2_sloc0_1_0 ; AOP_STK for _mus_update2_sloc2_1_0 ; Can't optimise plus by inc, falling back to the normal way ld de,#_mus_rep2 dec hl ld a,(hl+) ld h,(hl) ld l,a add hl,de ld a,l ld d,h lda hl,0(sp) ; genPointerGet ; AOP_STK for _mus_update2_sloc2_1_0 ; AOP_HL for _mus_data2 ld (hl+),a ld (hl),d ld e,a ld a,(de) ld hl,#_mus_data2 ld (hl),a inc de ld a,(de) inc hl ld (hl),a ; genLabel 00172$: ; music.c 470 ; genPointerGet ; AOP_STK for _mus_update2_sloc2_1_0 ld a,(bc) lda hl,0(sp) ; genMinus ; AOP_STK for _mus_update2_sloc2_1_0 ; AOP_STK for _mus_update2_sloc1_1_0 ld (hl),a ; Removed redundent load add a,#0xFF inc hl inc hl ; genAssign (pointer) ; AOP_STK for _mus_update2_sloc1_1_0 ld (hl),a ; Removed redundent load ld (bc),a ; music.c 471 ; genIfx ; AOP_STK for _mus_update2_sloc1_1_0 xor a,a or a,(hl) jp z,00174$ ; music.c 472 ; genCast ; AOP_HL for _mus_rep_depth2 ld hl,#_mus_rep_depth2 ld c,(hl) ld b,#0x00 ; genLeftShift sla c rl b ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_rep2 add hl,bc ld c,l ld b,h ; genPointerGet ; AOP_HL for _mus_data2 ld e,c ld d,b ld a,(de) ld hl,#_mus_data2 ld (hl),a inc de ld a,(de) inc hl ld (hl),a ; genGoto jp 00186$ ; genLabel 00174$: ; music.c 474 ; genMinus ; AOP_HL for _mus_rep_depth2 ld hl,#_mus_rep_depth2 dec (hl) ; music.c 476 ; genGoto jp 00186$ ; music.c 478 ; genLabel 00176$: ; genAssign ; AOP_HL for _mus_data2 ; AOP_HL for _mus_loop2 ld hl,#_mus_data2 ld a,(hl+) ld e,(hl) ld hl,#_mus_loop2 ld (hl+),a ld (hl),e ; music.c 479 ; genGoto jp 00186$ ; music.c 481 ; genLabel 00177$: ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr dec hl inc (hl) jr nz,00261$ inc hl inc (hl) 00261$: ; genPointerGet ; AOP_HL for _mus_po2 ld a,(bc) ld hl,#_mus_po2 ld (hl),a ; music.c 482 ; genGoto jp 00186$ ; music.c 484 ; genLabel 00178$: ; genAssign ld bc,#0xFF06 ; genAssign ; AOP_HL for _mus_data2 ; AOP_STK for _mus_update2_sloc2_1_0 ld hl,#_mus_data2 ld a,(hl+) ld e,(hl) lda hl,0(sp) ld (hl+),a ld (hl),e ; genPlus ; AOP_HL for _mus_data2 ; genPlusIncr ld hl,#_mus_data2 inc (hl) jr nz,00262$ inc hl inc (hl) 00262$: ; genPointerGet ; AOP_STK for _mus_update2_sloc2_1_0 lda hl,0(sp) ld e,(hl) inc hl ld d,(hl) ld a,(de) ; genAssign (pointer) ld (bc),a ; music.c 485 ; genGoto jp 00186$ ; music.c 487 ; genLabel 00179$: ; genGoto jp 00186$ ; music.c 489 ; genLabel 00180$: ; genGoto jp 00186$ ; music.c 491 ; genLabel 00181$: ; genAssign ; AOP_HL for _mus_loop2 ; AOP_HL for _mus_data2 ld hl,#_mus_loop2 ld a,(hl+) ld e,(hl) ld hl,#_mus_data2 ld (hl+),a ld (hl),e ; music.c 492 ; genAssign ; AOP_HL for _mus_done2 ld hl,#_mus_done2 ld (hl),#0x01 ; music.c 493 ; genAssign ; AOP_HL for _mus_data2 ld hl,#_mus_data2 ld c,(hl) inc hl ld b,(hl) ; genPointerGet ld a,(bc) ; genCmpEq ; genCmpEq: left 1, right 1, result 0 ld c,a cp a,#0x13 jp nz,00186$ jr 00264$ 00263$: jp 00186$ 00264$: ; music.c 494 ; genAssign ; AOP_HL for _mus_wait2 ld hl,#_mus_wait2 ld (hl),#0xFF ; music.c 495 ; genRet ; music.c 498 ; genLabel 00188$: ; genEndFunction lda sp,8(sp) ret ___mus_update2_end: ; music.c 502 ; genLabel ; genFunction ; --------------------------------- ; Function mus_update3 ; --------------------------------- ___mus_update3_start: _mus_update3: lda sp,-5(sp) ; music.c 505 ; genIfx ; AOP_HL for _mus_wait3 xor a,a ld hl,#_mus_wait3 or a,(hl) jp z,00145$ ; music.c 506 ; genMinus ; AOP_HL for _mus_wait3 dec (hl) ; music.c 507 ; genIfx ; AOP_HL for _mus_wait3 xor a,a or a,(hl) ; genRet ; music.c 510 ; genLabel jp nz,00147$ 00145$: ; music.c 511 ; genAssign ; AOP_HL for _mus_data3 ld hl,#_mus_data3 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data3 ; genPlusIncr dec hl inc (hl) jr nz,00160$ inc hl inc (hl) 00160$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_STK for _mus_update3_note_1_1 lda hl,4(sp) ld (hl),c ; music.c 512 ; genCmpLt ; AOP_STK for _mus_update3_note_1_1 ld a,(hl) cp #0x14 jp c,00115$ ; music.c 513 ; genAnd ; AOP_STK for _mus_update3_note_1_1 ld a,(hl) and a,#0x80 jr nz,00161$ jp 00106$ 00161$: ; music.c 514 ; genXor ; AOP_STK for _mus_update3_note_1_1 ld a,#0x80 lda hl,4(sp) xor a,(hl) ld (hl),a ; music.c 515 ; genAssign ; AOP_HL for _mus_data3 ld hl,#_mus_data3 ld b,(hl) inc hl ld c,(hl) ; genPlus ; AOP_HL for _mus_data3 ; genPlusIncr dec hl inc (hl) jr nz,00162$ inc hl inc (hl) 00162$: ; genPointerGet ; AOP_HL for _mus_wait3 ld e,b ld d,c ld a,(de) ld hl,#_mus_wait3 ld (hl),a ; genGoto jp 00107$ ; genLabel 00106$: ; music.c 517 ; genAssign ; AOP_HL for _mus_length3 ; AOP_HL for _mus_wait3 ld hl,#_mus_length3 ld a,(hl) ld hl,#_mus_wait3 ld (hl),a ; genLabel 00107$: ; music.c 519 ; genCmpEq ; AOP_STK for _mus_update3_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,4(sp) ld a,(hl) cp a,#0x21 jp nz,00112$ jr 00164$ 00163$: jp 00112$ 00164$: ; music.c 520 ; genRet jp 00147$ ; genLabel 00112$: ; music.c 521 ; genCmpEq ; AOP_STK for _mus_update3_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,4(sp) ld a,(hl) cp a,#0x20 jp nz,00109$ jr 00166$ 00165$: jp 00109$ 00166$: ; music.c 522 ; genAssign ; AOP_HL for _mus_freq3 ld hl,#_mus_freq3 ld (hl),#0x00 inc hl ld (hl),#0x00 ; music.c 523 ; genAssign ld bc,#0xFF1C ; genAssign (pointer) ld a,#0x00 ld (bc),a ; genGoto jp 00113$ ; genLabel 00109$: ; music.c 525 ; genLeftShift ; AOP_HL for _mus_octave3 ld hl,#_mus_octave3 ld a,(hl) sla a rl a rl a rl a and a,#0xF0 ; genPlus ; AOP_STK for _mus_update3_note_1_1 ; Can't optimise plus by inc, falling back to the normal way ld c,a lda hl,4(sp) add a,(hl) ; genMinus ld c,a add a,#0xEC ld c,a ; genCast ; Removed redundent load ld b,#0x00 ; genLeftShift sla c rl b ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld hl,#_freq add hl,bc ld c,l ld b,h ; genPointerGet ld e,c ld d,b ld a,(de) ld c,a inc de ld a,(de) ld b,a ; genCast ; AOP_HL for _mus_po3 ; AOP_STK for _mus_update3_sloc0_1_0 ld hl,#_mus_po3 ld a,(hl) lda hl,2(sp) ld (hl+),a ld (hl),#0x00 ; genPlus ; AOP_STK for _mus_update3_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way dec hl ld a,(hl+) ld h,(hl) ld l,a add hl,bc ld c,l ld b,h ; genMinus ; AOP_HL for _mus_freq3 ld a,c add a,#0x80 ld hl,#_mus_freq3 ld (hl),a ld a,b adc a,#0xFF inc hl ld (hl),a ; music.c 526 ; genAssign ld bc,#0xFF1C ; genAssign (pointer) ; AOP_HL for _mus_volume3 ld hl,#_mus_volume3 ld a,(hl) ld (bc),a ; genLabel 00113$: ; music.c 528 ; genAssign ld bc,#0xFF1A ; genAssign (pointer) ld a,#0x00 ld (bc),a ; music.c 529 ; genAssign ld bc,#0xFF1A ; genAssign (pointer) ld a,#0x80 ld (bc),a ; music.c 530 ; genAssign ld bc,#0xFF1D ; genCast ; AOP_HL for _mus_freq3 ld hl,#_mus_freq3 ld a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 531 ; genAssign ld bc,#0xFF1E ; genRightShift ; AOP_HL for _mus_freq3 ; AOP_STK for _mus_update3_sloc0_1_0 inc hl ld a,(hl) lda hl,2(sp) ld (hl+),a ld (hl),#0x00 ; genOr ; AOP_STK for _mus_update3_sloc0_1_0 ; AOP_STK for _mus_update3_sloc1_1_0 dec hl ld a,(hl) or a,#0x80 dec hl dec hl ld (hl),a lda hl,3(sp) ld a,(hl) dec hl dec hl ; genCast ; AOP_STK for _mus_update3_sloc1_1_0 ld (hl-),a ld a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 532 ; genRet jp 00147$ ; genLabel 00115$: ; music.c 534 ; genCmpGt ; AOP_STK for _mus_update3_note_1_1 ld a,#0x13 lda hl,4(sp) sub a,(hl) jp c,00145$ ; genJumpTab ; AOP_STK for _mus_update3_note_1_1 ld e,(hl) ld d,#0x00 ld hl,#00169$ add hl,de add hl,de add hl,de jp (hl) 00169$: jp 00116$ jp 00117$ jp 00118$ jp 00119$ jp 00120$ jp 00121$ jp 00122$ jp 00123$ jp 00124$ jp 00125$ jp 00126$ jp 00127$ jp 00128$ jp 00129$ jp 00135$ jp 00136$ jp 00137$ jp 00138$ jp 00139$ jp 00140$ ; music.c 536 ; genLabel 00116$: ; genAssign ; AOP_HL for _mus_data3 ld hl,#_mus_data3 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data3 ; genPlusIncr dec hl inc (hl) jr nz,00170$ inc hl inc (hl) 00170$: ; genPointerGet ; AOP_HL for _mus_length3 ld a,(bc) ld hl,#_mus_length3 ld (hl),a ; music.c 537 ; genGoto jp 00145$ ; music.c 539 ; genLabel 00117$: ; genAssign ; AOP_HL for _mus_data3 ld hl,#_mus_data3 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data3 ; genPlusIncr dec hl inc (hl) jr nz,00171$ inc hl inc (hl) 00171$: ; genPointerGet ; AOP_HL for _mus_octave3 ld a,(bc) ld hl,#_mus_octave3 ld (hl),a ; music.c 540 ; genGoto jp 00145$ ; music.c 542 ; genLabel 00118$: ; genPlus ; AOP_HL for _mus_octave3 ; genPlusIncr ld hl,#_mus_octave3 inc (hl) ; music.c 543 ; genGoto jp 00145$ ; music.c 545 ; genLabel 00119$: ; genMinus ; AOP_HL for _mus_octave3 ld hl,#_mus_octave3 dec (hl) ; music.c 546 ; genGoto jp 00145$ ; music.c 548 ; genLabel 00120$: ; genAssign ; AOP_HL for _mus_data3 ld hl,#_mus_data3 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data3 ; genPlusIncr dec hl inc (hl) jr nz,00172$ inc hl inc (hl) 00172$: ; genPointerGet ; AOP_HL for _mus_volume3 ld a,(bc) ld hl,#_mus_volume3 ld (hl),a ; music.c 549 ; genGoto jp 00145$ ; music.c 551 ; genLabel 00121$: ; genGoto jp 00145$ ; music.c 553 ; genLabel 00122$: ; genGoto jp 00145$ ; music.c 555 ; genLabel 00123$: ; genAssign ; AOP_HL for _mus_data3 ld hl,#_mus_data3 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data3 ; genPlusIncr dec hl inc (hl) jr nz,00173$ inc hl inc (hl) 00173$: ; genPointerGet ; AOP_HL for _mus_pan3 ld a,(bc) ld hl,#_mus_pan3 ld (hl),a ; music.c 556 ; genAssign ld bc,#0xFF25 ; genAssign ; AOP_STK for _mus_update3_sloc1_1_0 lda hl,0(sp) ld (hl),#0x25 inc hl ld (hl),#0xFF ; genPointerGet ; AOP_STK for _mus_update3_sloc1_1_0 ; AOP_STK for _mus_update3_sloc0_1_0 dec hl ld e,(hl) inc hl ld d,(hl) ld a,(de) inc hl ; genAnd ; AOP_STK for _mus_update3_sloc0_1_0 ; AOP_STK for _mus_update3_sloc1_1_0 ld (hl),a ; Removed redundent load and a,#0xBB dec hl dec hl ld (hl),a ; genLeftShift ; AOP_HL for _mus_pan3 ; AOP_STK for _mus_update3_sloc0_1_0 ld hl,#_mus_pan3 ld a,(hl) add a,a add a,a lda hl,2(sp) ; genOr ; AOP_STK for _mus_update3_sloc1_1_0 ; AOP_STK for _mus_update3_sloc0_1_0 ld (hl-),a dec hl ld a,(hl+) inc hl or a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 557 ; genGoto jp 00145$ ; music.c 559 ; genLabel 00124$: ; genGoto jp 00145$ ; music.c 561 ; genLabel 00125$: ; genGoto jp 00145$ ; music.c 563 ; genLabel 00126$: ; genGoto jp 00145$ ; music.c 565 ; genLabel 00127$: ; genGoto jp 00145$ ; music.c 567 ; genLabel 00128$: ; genPlus ; AOP_HL for _mus_rep_depth3 ; genPlusIncr ld hl,#_mus_rep_depth3 inc (hl) ; music.c 568 ; genCast ; AOP_HL for _mus_rep_depth3 ld c,(hl) ld b,#0x00 ; genLeftShift sla c rl b ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_rep3 add hl,bc ld c,l ld b,h ; genAssign (pointer) ; AOP_HL for _mus_data3 ld e,c ld d,b ld hl,#_mus_data3 ld a,(hl) ld (de),a inc de inc hl ld a,(hl) ld (de),a ; music.c 569 ; genGoto jp 00145$ ; music.c 571 ; genLabel 00129$: ; genAssign ; AOP_HL for _mus_data3 ld hl,#_mus_data3 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data3 ; genPlusIncr dec hl inc (hl) jr nz,00176$ inc hl inc (hl) 00176$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_STK for _mus_update3_note_1_1 lda hl,4(sp) ld (hl),c ; music.c 572 ; genPlus ; AOP_HL for _mus_rep_depth3 ; Can't optimise plus by inc, falling back to the normal way ld a,#<_mus_repeats3 ld hl,#_mus_rep_depth3 add a,(hl) ld c,a ld a,#>_mus_repeats3 adc a,#0x00 ld b,a ; genPointerGet ld a,(bc) ; genIfx or a,a jp nz,00131$ ; music.c 573 ; genAssign (pointer) ; AOP_STK for _mus_update3_note_1_1 lda hl,4(sp) ld a,(hl) ld (bc),a ; music.c 574 ; genCast ; AOP_HL for _mus_rep_depth3 ; AOP_STK for _mus_update3_sloc1_1_0 ld hl,#_mus_rep_depth3 ld a,(hl) lda hl,0(sp) ld (hl+),a ld (hl),#0x00 ; genLeftShift ; AOP_STK for _mus_update3_sloc1_1_0 ; AOP_STK for _mus_update3_sloc0_1_0 dec hl ld a,(hl+) inc hl ld (hl-),a ld a,(hl+) inc hl ld (hl-),a sla (hl) inc hl rl (hl) ; genPlus ; AOP_STK for _mus_update3_sloc0_1_0 ; AOP_STK for _mus_update3_sloc1_1_0 ; Can't optimise plus by inc, falling back to the normal way ld de,#_mus_rep3 dec hl ld a,(hl+) ld h,(hl) ld l,a add hl,de ld a,l ld d,h lda hl,0(sp) ; genPointerGet ; AOP_STK for _mus_update3_sloc1_1_0 ; AOP_HL for _mus_data3 ld (hl+),a ld (hl),d ld e,a ld a,(de) ld hl,#_mus_data3 ld (hl),a inc de ld a,(de) inc hl ld (hl),a ; genLabel 00131$: ; music.c 576 ; genPointerGet ; AOP_STK for _mus_update3_sloc1_1_0 ld a,(bc) lda hl,0(sp) ; genMinus ; AOP_STK for _mus_update3_sloc1_1_0 ; AOP_STK for _mus_update3_sloc0_1_0 ld (hl),a ; Removed redundent load add a,#0xFF inc hl inc hl ; genAssign (pointer) ; AOP_STK for _mus_update3_sloc0_1_0 ld (hl),a ; Removed redundent load ld (bc),a ; music.c 577 ; genIfx ; AOP_STK for _mus_update3_sloc0_1_0 xor a,a or a,(hl) jp z,00133$ ; music.c 578 ; genCast ; AOP_HL for _mus_rep_depth3 ld hl,#_mus_rep_depth3 ld c,(hl) ld b,#0x00 ; genLeftShift sla c rl b ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_rep3 add hl,bc ld c,l ld b,h ; genPointerGet ; AOP_HL for _mus_data3 ld e,c ld d,b ld a,(de) ld hl,#_mus_data3 ld (hl),a inc de ld a,(de) inc hl ld (hl),a ; genGoto jp 00145$ ; genLabel 00133$: ; music.c 580 ; genMinus ; AOP_HL for _mus_rep_depth3 ld hl,#_mus_rep_depth3 dec (hl) ; music.c 582 ; genGoto jp 00145$ ; music.c 584 ; genLabel 00135$: ; genAssign ; AOP_HL for _mus_data3 ; AOP_HL for _mus_loop3 ld hl,#_mus_data3 ld a,(hl+) ld e,(hl) ld hl,#_mus_loop3 ld (hl+),a ld (hl),e ; music.c 585 ; genGoto jp 00145$ ; music.c 587 ; genLabel 00136$: ; genAssign ; AOP_HL for _mus_data3 ld hl,#_mus_data3 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data3 ; genPlusIncr dec hl inc (hl) jr nz,00181$ inc hl inc (hl) 00181$: ; genPointerGet ; AOP_HL for _mus_po3 ld a,(bc) ld hl,#_mus_po3 ld (hl),a ; music.c 588 ; genGoto jp 00145$ ; music.c 590 ; genLabel 00137$: ; genAssign ld bc,#0xFF06 ; genAssign ; AOP_HL for _mus_data3 ; AOP_STK for _mus_update3_sloc1_1_0 ld hl,#_mus_data3 ld a,(hl+) ld e,(hl) lda hl,0(sp) ld (hl+),a ld (hl),e ; genPlus ; AOP_HL for _mus_data3 ; genPlusIncr ld hl,#_mus_data3 inc (hl) jr nz,00182$ inc hl inc (hl) 00182$: ; genPointerGet ; AOP_STK for _mus_update3_sloc1_1_0 lda hl,0(sp) ld e,(hl) inc hl ld d,(hl) ld a,(de) ; genAssign (pointer) ld (bc),a ; music.c 591 ; genGoto jp 00145$ ; music.c 593 ; genLabel 00138$: ; genGoto jp 00145$ ; music.c 595 ; genLabel 00139$: ; genAssign ; AOP_HL for _mus_data3 ld hl,#_mus_data3 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data3 ; genPlusIncr dec hl inc (hl) jr nz,00183$ inc hl inc (hl) 00183$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_STK for _mus_update3_note_1_1 lda hl,4(sp) ld (hl),c ; music.c 596 ; genAssign ld bc,#0xFF1A ; genAssign (pointer) ld a,#0x00 ld (bc),a ; music.c 597 ; genPlus ; AOP_HL for _mus_song ; genPlusIncr ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_song ld a,(hl) add a,#0x08 ld c,a inc hl ld a,(hl) adc a,#0x00 ld b,a ; genLeftShift ; AOP_STK for _mus_update3_note_1_1 ; AOP_STK for _mus_update3_sloc1_1_0 lda hl,4(sp) ld a,(hl) sla a rl a rl a rl a and a,#0xF0 lda hl,0(sp) ; genPlus ; AOP_STK for _mus_update3_sloc1_1_0 ; Can't optimise plus by inc, falling back to the normal way ld (hl),a ld l,a ld h,#0x00 add hl,bc ld c,l ld b,h ; genIpush ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 ld hl,#0x0010 push hl ; genIpush push bc ; genIpush ld hl,#0xFF30 push hl ; genCall call _memcpy lda sp,6(sp) ; music.c 598 ; genAssign ld bc,#0xFF1A ; genAssign (pointer) ld a,#0x80 ld (bc),a ; music.c 599 ; genGoto jp 00145$ ; music.c 601 ; genLabel 00140$: ; genAssign ; AOP_HL for _mus_loop3 ; AOP_HL for _mus_data3 ld hl,#_mus_loop3 ld a,(hl+) ld e,(hl) ld hl,#_mus_data3 ld (hl+),a ld (hl),e ; music.c 602 ; genAssign ; AOP_HL for _mus_done3 ld hl,#_mus_done3 ld (hl),#0x01 ; music.c 603 ; genAssign ; AOP_HL for _mus_data3 ld hl,#_mus_data3 ld c,(hl) inc hl ld b,(hl) ; genPointerGet ld a,(bc) ; genCmpEq ; genCmpEq: left 1, right 1, result 0 ld c,a cp a,#0x13 jp nz,00145$ jr 00185$ 00184$: jp 00145$ 00185$: ; music.c 604 ; genAssign ; AOP_HL for _mus_wait3 ld hl,#_mus_wait3 ld (hl),#0xFF ; music.c 605 ; genRet ; music.c 608 ; genLabel 00147$: ; genEndFunction lda sp,5(sp) ret ___mus_update3_end: ; music.c 612 ; genLabel ; genFunction ; --------------------------------- ; Function mus_update4 ; --------------------------------- ___mus_update4_start: _mus_update4: lda sp,-6(sp) ; music.c 615 ; genAnd ; AOP_HL for _mus_step ld hl,#_mus_step ld a,(hl) and a,#0x03 ld c,a ; genNot xor a,a or a,c sub a,#0x01 ld a,#0x00 rla ld c,a ; genAnd ; AOP_HL for _mus_slide4 ld hl,#_mus_slide4 ld a,(hl) and a,c ; genIfx or a,a jp z,00113$ ; music.c 616 ; genCast ; AOP_HL for _mus_freq4 ld hl,#_mus_freq4 ld c,(hl) ld b,#0x00 ; genCmpGt ; AOP_HL for _mus_target4 ld a,c ld hl,#_mus_target4 sub a,(hl) ld a,b inc hl sbc a,(hl) jp nc,00108$ ; music.c 617 ; genPlus ; AOP_HL for _mus_freq4 ; AOP_HL for _mus_slide4 ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_freq4 ld a,(hl) ld hl,#_mus_slide4 add a,(hl) ld hl,#_mus_freq4 ; music.c 618 ; genCast ; AOP_HL for _mus_freq4 ; AOP_STK for _mus_update4_sloc0_1_0 ld (hl),a ; Removed redundent load lda hl,3(sp) ld (hl+),a ld (hl),#0x00 ; genCmpGt ; AOP_STK for _mus_update4_sloc0_1_0 ; AOP_HL for _mus_target4 ld hl,#_mus_target4 ld a,(hl) lda hl,3(sp) sub a,(hl) ld hl,#_mus_target4 + 1 ld a,(hl) lda hl,4(sp) sbc a,(hl) jp nc,00109$ ; music.c 619 ; genCast ; AOP_HL for _mus_target4 ; AOP_HL for _mus_freq4 ld hl,#_mus_target4 ld a,(hl) ld hl,#_mus_freq4 ld (hl),a ; genGoto jp 00109$ ; genLabel 00108$: ; music.c 622 ; genCmpLt ; AOP_HL for _mus_target4 ld hl,#_mus_target4 ld a,(hl) sub a,c inc hl ld a,(hl) sbc a,b jp nc,00109$ ; music.c 623 ; genMinus ; AOP_HL for _mus_freq4 ; AOP_HL for _mus_slide4 ld hl,#_mus_freq4 ld a,(hl) ld hl,#_mus_slide4 sub a,(hl) ld hl,#_mus_freq4 ; music.c 624 ; genCast ; AOP_HL for _mus_freq4 ld (hl),a ld c,a ld b,#0x00 ; genCmpLt ; AOP_HL for _mus_target4 ld a,c ld hl,#_mus_target4 sub a,(hl) ld a,b inc hl sbc a,(hl) jp nc,00109$ ; music.c 625 ; genCast ; AOP_HL for _mus_target4 ; AOP_HL for _mus_freq4 dec hl ld a,(hl) ld hl,#_mus_freq4 ld (hl),a ; genLabel 00109$: ; music.c 628 ; genIfx ; AOP_HL for _mus_enabled4 xor a,a ld hl,#_mus_enabled4 or a,(hl) jp z,00113$ ; genAssign ld bc,#0xFF22 ; genOr ; AOP_HL for _mus_freq4 ; AOP_HL for _mus_noise_step ld hl,#_mus_freq4 ld a,(hl) ld hl,#_mus_noise_step or a,(hl) ; genAssign (pointer) ld (bc),a ; genLabel 00113$: ; music.c 631 ; genIfx ; AOP_HL for _mus_wait4 xor a,a ld hl,#_mus_wait4 or a,(hl) jp z,00178$ ; music.c 632 ; genMinus ; AOP_HL for _mus_wait4 dec (hl) ; music.c 633 ; genIfx ; AOP_HL for _mus_wait4 xor a,a or a,(hl) ; genRet ; music.c 636 ; genLabel jp nz,00180$ 00178$: ; music.c 637 ; genAssign ; AOP_HL for _mus_data4 ld hl,#_mus_data4 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data4 ; genPlusIncr dec hl inc (hl) jr nz,00208$ inc hl inc (hl) 00208$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_STK for _mus_update4_note_1_1 lda hl,5(sp) ld (hl),c ; music.c 638 ; genCmpLt ; AOP_STK for _mus_update4_note_1_1 ld a,(hl) cp #0x14 jp c,00139$ ; music.c 639 ; genAnd ; AOP_STK for _mus_update4_note_1_1 ld a,(hl) and a,#0x80 jr nz,00209$ jp 00119$ 00209$: ; music.c 640 ; genXor ; AOP_STK for _mus_update4_note_1_1 ld a,#0x80 lda hl,5(sp) xor a,(hl) ld (hl),a ; music.c 641 ; genAssign ; AOP_HL for _mus_data4 ld hl,#_mus_data4 ld b,(hl) inc hl ld c,(hl) ; genPlus ; AOP_HL for _mus_data4 ; genPlusIncr dec hl inc (hl) jr nz,00210$ inc hl inc (hl) 00210$: ; genPointerGet ; AOP_HL for _mus_wait4 ld e,b ld d,c ld a,(de) ld hl,#_mus_wait4 ld (hl),a ; genGoto jp 00120$ ; genLabel 00119$: ; music.c 643 ; genAssign ; AOP_HL for _mus_length4 ; AOP_HL for _mus_wait4 ld hl,#_mus_length4 ld a,(hl) ld hl,#_mus_wait4 ld (hl),a ; genLabel 00120$: ; music.c 645 ; genCmpEq ; AOP_STK for _mus_update4_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,5(sp) ld a,(hl) cp a,#0x21 jp nz,00132$ jr 00212$ 00211$: jp 00132$ 00212$: ; music.c 646 ; genRet jp 00180$ ; genLabel 00132$: ; music.c 647 ; genCmpEq ; AOP_STK for _mus_update4_note_1_1 ; genCmpEq: left 1, right 1, result 0 lda hl,5(sp) ld a,(hl) cp a,#0x20 jp nz,00129$ jr 00214$ 00213$: jp 00129$ 00214$: ; music.c 648 ; genAssign ; AOP_HL for _mus_freq4 ld hl,#_mus_freq4 ld (hl),#0x00 ; music.c 649 ; genIfx ; AOP_HL for _mus_enabled4 xor a,a ld hl,#_mus_enabled4 or a,(hl) jp z,00133$ ; genAssign ld bc,#0xFF21 ; genAssign (pointer) ld a,#0x00 ld (bc),a ; genGoto jp 00133$ ; genLabel 00129$: ; music.c 651 ; genIfx ; AOP_HL for _mus_porta4 xor a,a ld hl,#_mus_porta4 or a,(hl) jp z,00124$ ; music.c 652 ; genMinus ; AOP_HL for _mus_octave4 ld hl,#_mus_octave4 ld a,(hl) add a,#0xFF ; genLeftShift ld c,a sla a rl a rl a rl a and a,#0xF0 ; genPlus ; AOP_STK for _mus_update4_note_1_1 ; Can't optimise plus by inc, falling back to the normal way ld c,a lda hl,5(sp) add a,(hl) ; genMinus ld c,a add a,#0xEC ld c,a ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld a,#<_noise_freq add a,c ld c,a ld a,#>_noise_freq adc a,#0x00 ld b,a ; genPointerGet ld a,(bc) ld c,a ; genCast ; AOP_HL for _mus_target4 ld hl,#_mus_target4 ld (hl),c inc hl ld (hl),#0x00 ; genGoto jp 00125$ ; genLabel 00124$: ; music.c 654 ; genMinus ; AOP_HL for _mus_octave4 ld hl,#_mus_octave4 ld a,(hl) add a,#0xFF ; genLeftShift ld c,a sla a rl a rl a rl a and a,#0xF0 ; genPlus ; AOP_STK for _mus_update4_note_1_1 ; Can't optimise plus by inc, falling back to the normal way ld c,a lda hl,5(sp) add a,(hl) ; genMinus ld c,a add a,#0xEC ld c,a ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld a,#<_noise_freq add a,c ld c,a ld a,#>_noise_freq adc a,#0x00 ld b,a ; genPointerGet ; AOP_HL for _mus_freq4 ld a,(bc) ld hl,#_mus_freq4 ld (hl),a ; genLabel 00125$: ; music.c 656 ; genIfx ; AOP_HL for _mus_enabled4 xor a,a ld hl,#_mus_enabled4 or a,(hl) jp z,00133$ ; genAssign ld bc,#0xFF21 ; genOr ; AOP_HL for _mus_volume4 ; AOP_HL for _mus_env4 ld hl,#_mus_volume4 ld a,(hl) ld hl,#_mus_env4 or a,(hl) ; genAssign (pointer) ld (bc),a ; genLabel 00133$: ; music.c 658 ; genIfx ; AOP_HL for _mus_enabled4 xor a,a ld hl,#_mus_enabled4 or a,(hl) jp z,00137$ ; music.c 659 ; genCmpEq ; AOP_HL for _mus_enabled4 ; genCmpEq: left 1, right 1, result 0 ld a,(hl) cp a,#0x02 jp nz,00135$ jr 00216$ 00215$: jp 00135$ 00216$: ; music.c 660 ; genMinus ; AOP_HL for _mus_enabled4 ld hl,#_mus_enabled4 dec (hl) ; music.c 661 ; genAssign ld bc,#0xFF21 ; genOr ; AOP_HL for _mus_volume4 ; AOP_HL for _mus_env4 ld hl,#_mus_volume4 ld a,(hl) ld hl,#_mus_env4 or a,(hl) ; genAssign (pointer) ld (bc),a ; genLabel 00135$: ; music.c 663 ; genAssign ld bc,#0xFF22 ; genOr ; AOP_HL for _mus_freq4 ; AOP_HL for _mus_noise_step ld hl,#_mus_freq4 ld a,(hl) ld hl,#_mus_noise_step or a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 664 ; genAssign ld bc,#0xFF23 ; genAssign (pointer) ld a,#0x80 ld (bc),a ; genLabel 00137$: ; music.c 666 ; genRet jp 00180$ ; genLabel 00139$: ; music.c 668 ; genCmpGt ; AOP_STK for _mus_update4_note_1_1 ld a,#0x13 lda hl,5(sp) sub a,(hl) jp c,00178$ ; genJumpTab ; AOP_STK for _mus_update4_note_1_1 ld e,(hl) ld d,#0x00 ld hl,#00217$ add hl,de add hl,de add hl,de jp (hl) 00217$: jp 00140$ jp 00141$ jp 00142$ jp 00143$ jp 00144$ jp 00147$ jp 00150$ jp 00151$ jp 00154$ jp 00155$ jp 00159$ jp 00160$ jp 00161$ jp 00162$ jp 00168$ jp 00169$ jp 00170$ jp 00171$ jp 00172$ jp 00173$ ; music.c 670 ; genLabel 00140$: ; genAssign ; AOP_HL for _mus_data4 ld hl,#_mus_data4 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data4 ; genPlusIncr dec hl inc (hl) jr nz,00218$ inc hl inc (hl) 00218$: ; genPointerGet ; AOP_HL for _mus_length4 ld a,(bc) ld hl,#_mus_length4 ld (hl),a ; music.c 671 ; genGoto jp 00178$ ; music.c 673 ; genLabel 00141$: ; genAssign ; AOP_HL for _mus_data4 ld hl,#_mus_data4 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data4 ; genPlusIncr dec hl inc (hl) jr nz,00219$ inc hl inc (hl) 00219$: ; genPointerGet ; AOP_HL for _mus_octave4 ld a,(bc) ld hl,#_mus_octave4 ld (hl),a ; music.c 674 ; genGoto jp 00178$ ; music.c 676 ; genLabel 00142$: ; genPlus ; AOP_HL for _mus_octave4 ; genPlusIncr ld hl,#_mus_octave4 inc (hl) ; music.c 677 ; genGoto jp 00178$ ; music.c 679 ; genLabel 00143$: ; genMinus ; AOP_HL for _mus_octave4 ld hl,#_mus_octave4 dec (hl) ; music.c 680 ; genGoto jp 00178$ ; music.c 682 ; genLabel 00144$: ; genAssign ; AOP_HL for _mus_data4 ld hl,#_mus_data4 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data4 ; genPlusIncr dec hl inc (hl) jr nz,00220$ inc hl inc (hl) 00220$: ; genPointerGet ; AOP_HL for _mus_volume4 ld a,(bc) ld hl,#_mus_volume4 ld (hl),a ; music.c 683 ; genIfx ; AOP_HL for _mus_enabled4 xor a,a ld hl,#_mus_enabled4 or a,(hl) jp z,00178$ ; genAssign ld bc,#0xFF21 ; genOr ; AOP_HL for _mus_volume4 ; AOP_HL for _mus_env4 ld hl,#_mus_volume4 ld a,(hl) ld hl,#_mus_env4 or a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 684 ; genGoto jp 00178$ ; music.c 686 ; genLabel 00147$: ; genAssign ; AOP_HL for _mus_data4 ld hl,#_mus_data4 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data4 ; genPlusIncr dec hl inc (hl) jr nz,00221$ inc hl inc (hl) 00221$: ; genPointerGet ; AOP_HL for _mus_env4 ld a,(bc) ld hl,#_mus_env4 ld (hl),a ; music.c 687 ; genIfx ; AOP_HL for _mus_enabled4 xor a,a ld hl,#_mus_enabled4 or a,(hl) jp z,00178$ ; genAssign ld bc,#0xFF21 ; genOr ; AOP_HL for _mus_volume4 ; AOP_HL for _mus_env4 ld hl,#_mus_volume4 ld a,(hl) ld hl,#_mus_env4 or a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 688 ; genGoto jp 00178$ ; music.c 690 ; genLabel 00150$: ; genGoto jp 00178$ ; music.c 692 ; genLabel 00151$: ; genAssign ; AOP_HL for _mus_data4 ld hl,#_mus_data4 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data4 ; genPlusIncr dec hl inc (hl) jr nz,00222$ inc hl inc (hl) 00222$: ; genPointerGet ; AOP_HL for _mus_pan4 ld a,(bc) ld hl,#_mus_pan4 ld (hl),a ; music.c 693 ; genIfx ; AOP_HL for _mus_enabled4 xor a,a ld hl,#_mus_enabled4 or a,(hl) jp z,00178$ ; genAssign ld bc,#0xFF25 ; genAssign ; AOP_STK for _mus_update4_sloc0_1_0 lda hl,3(sp) ld (hl),#0x25 inc hl ld (hl),#0xFF ; genPointerGet ; AOP_STK for _mus_update4_sloc0_1_0 ; AOP_STK for _mus_update4_sloc1_1_0 dec hl ld e,(hl) inc hl ld d,(hl) ld a,(de) dec hl dec hl ; genAnd ; AOP_STK for _mus_update4_sloc1_1_0 ; AOP_STK for _mus_update4_sloc0_1_0 ld (hl),a ; Removed redundent load and a,#0x77 inc hl ld (hl),a ; genLeftShift ; AOP_HL for _mus_pan4 ; AOP_STK for _mus_update4_sloc1_1_0 ld hl,#_mus_pan4 ld a,(hl) sla a rl a rl a and a,#0xF8 lda hl,2(sp) ; genOr ; AOP_STK for _mus_update4_sloc0_1_0 ; AOP_STK for _mus_update4_sloc1_1_0 ld (hl+),a ld a,(hl) dec hl or a,(hl) ; genAssign (pointer) ld (bc),a ; music.c 694 ; genGoto jp 00178$ ; music.c 696 ; genLabel 00154$: ; genAssign ; AOP_HL for _mus_data4 ld hl,#_mus_data4 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data4 ; genPlusIncr dec hl inc (hl) jr nz,00223$ inc hl inc (hl) 00223$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_HL for _mus_porta4 ld hl,#_mus_porta4 ld (hl),c ; genAssign ; AOP_HL for _mus_slide4 ld hl,#_mus_slide4 ld (hl),c ; music.c 697 ; genGoto jp 00178$ ; music.c 699 ; genLabel 00155$: ; genAssign ; AOP_HL for _mus_data4 ld hl,#_mus_data4 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data4 ; genPlusIncr dec hl inc (hl) jr nz,00224$ inc hl inc (hl) 00224$: ; genPointerGet ; AOP_HL for _mus_slide4 ld a,(bc) ld hl,#_mus_slide4 ld (hl),a ; music.c 700 ; genAssign ; AOP_HL for _mus_porta4 ld hl,#_mus_porta4 ld (hl),#0x00 ; music.c 701 ; genCmpLt ; AOP_HL for _mus_slide4 ld hl,#_mus_slide4 ld a,(hl) cp #0x80 jp c,00157$ ; music.c 702 ; genAssign ; AOP_HL for _mus_target4 ld hl,#_mus_target4 ld (hl),#0xFF inc hl ld (hl),#0xFF ; music.c 703 ; genMinus ; AOP_HL for _mus_slide4 ld hl,#_mus_slide4 ld a,(hl) add a,#0x80 ld (hl),a ; genGoto jp 00178$ ; genLabel 00157$: ; music.c 705 ; genAssign ; AOP_HL for _mus_target4 ld hl,#_mus_target4 ld (hl),#0x00 inc hl ld (hl),#0x00 ; music.c 706 ; genMinus ; AOP_HL for _mus_slide4 ld a,#0x80 ld hl,#_mus_slide4 sub a,(hl) ld (hl),a ; music.c 708 ; genGoto jp 00178$ ; music.c 710 ; genLabel 00159$: ; genGoto jp 00178$ ; music.c 712 ; genLabel 00160$: ; genGoto jp 00178$ ; music.c 714 ; genLabel 00161$: ; genPlus ; AOP_HL for _mus_rep_depth4 ; genPlusIncr ld hl,#_mus_rep_depth4 inc (hl) ; music.c 715 ; genCast ; AOP_HL for _mus_rep_depth4 ld c,(hl) ld b,#0x00 ; genLeftShift sla c rl b ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_rep4 add hl,bc ld c,l ld b,h ; genAssign (pointer) ; AOP_HL for _mus_data4 ld e,c ld d,b ld hl,#_mus_data4 ld a,(hl) ld (de),a inc de inc hl ld a,(hl) ld (de),a ; music.c 716 ; genGoto jp 00178$ ; music.c 718 ; genLabel 00162$: ; genAssign ; AOP_HL for _mus_data4 ld hl,#_mus_data4 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data4 ; genPlusIncr dec hl inc (hl) jr nz,00227$ inc hl inc (hl) 00227$: ; genPointerGet ld a,(bc) ld c,a ; genAssign ; AOP_STK for _mus_update4_note_1_1 lda hl,5(sp) ld (hl),c ; music.c 719 ; genPlus ; AOP_HL for _mus_rep_depth4 ; Can't optimise plus by inc, falling back to the normal way ld a,#<_mus_repeats4 ld hl,#_mus_rep_depth4 add a,(hl) ld c,a ld a,#>_mus_repeats4 adc a,#0x00 ld b,a ; genPointerGet ld a,(bc) ; genIfx or a,a jp nz,00164$ ; music.c 720 ; genAssign (pointer) ; AOP_STK for _mus_update4_note_1_1 lda hl,5(sp) ld a,(hl) ld (bc),a ; music.c 721 ; genCast ; AOP_HL for _mus_rep_depth4 ; AOP_STK for _mus_update4_sloc0_1_0 ld hl,#_mus_rep_depth4 ld a,(hl) lda hl,3(sp) ld (hl+),a ld (hl),#0x00 ; genLeftShift ; AOP_STK for _mus_update4_sloc0_1_0 ; AOP_STK for _mus_update4_sloc2_1_0 dec hl ld a,(hl) lda hl,0(sp) ld (hl),a lda hl,4(sp) ld a,(hl) lda hl,1(sp) ld (hl-),a sla (hl) inc hl rl (hl) ; genPlus ; AOP_STK for _mus_update4_sloc2_1_0 ; AOP_STK for _mus_update4_sloc0_1_0 ; Can't optimise plus by inc, falling back to the normal way ld de,#_mus_rep4 dec hl ld a,(hl+) ld h,(hl) ld l,a add hl,de ld a,l ld d,h lda hl,3(sp) ; genPointerGet ; AOP_STK for _mus_update4_sloc0_1_0 ; AOP_HL for _mus_data4 ld (hl+),a ld (hl),d ld e,a ld a,(de) ld hl,#_mus_data4 ld (hl),a inc de ld a,(de) inc hl ld (hl),a ; genLabel 00164$: ; music.c 723 ; genPointerGet ; AOP_STK for _mus_update4_sloc2_1_0 ld a,(bc) lda hl,0(sp) ; genMinus ; AOP_STK for _mus_update4_sloc2_1_0 ; AOP_STK for _mus_update4_sloc1_1_0 ld (hl),a ; Removed redundent load add a,#0xFF inc hl inc hl ; genAssign (pointer) ; AOP_STK for _mus_update4_sloc1_1_0 ld (hl),a ; Removed redundent load ld (bc),a ; music.c 724 ; genIfx ; AOP_STK for _mus_update4_sloc1_1_0 xor a,a or a,(hl) jp z,00166$ ; music.c 725 ; genCast ; AOP_HL for _mus_rep_depth4 ld hl,#_mus_rep_depth4 ld c,(hl) ld b,#0x00 ; genLeftShift sla c rl b ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld hl,#_mus_rep4 add hl,bc ld c,l ld b,h ; genPointerGet ; AOP_HL for _mus_data4 ld e,c ld d,b ld a,(de) ld hl,#_mus_data4 ld (hl),a inc de ld a,(de) inc hl ld (hl),a ; genGoto jp 00178$ ; genLabel 00166$: ; music.c 727 ; genMinus ; AOP_HL for _mus_rep_depth4 ld hl,#_mus_rep_depth4 dec (hl) ; music.c 729 ; genGoto jp 00178$ ; music.c 731 ; genLabel 00168$: ; genAssign ; AOP_HL for _mus_data4 ; AOP_HL for _mus_loop4 ld hl,#_mus_data4 ld a,(hl+) ld e,(hl) ld hl,#_mus_loop4 ld (hl+),a ld (hl),e ; music.c 732 ; genGoto jp 00178$ ; music.c 734 ; genLabel 00169$: ; genGoto jp 00178$ ; music.c 736 ; genLabel 00170$: ; genAssign ld bc,#0xFF06 ; genAssign ; AOP_HL for _mus_data4 ; AOP_STK for _mus_update4_sloc2_1_0 ld hl,#_mus_data4 ld a,(hl+) ld e,(hl) lda hl,0(sp) ld (hl+),a ld (hl),e ; genPlus ; AOP_HL for _mus_data4 ; genPlusIncr ld hl,#_mus_data4 inc (hl) jr nz,00232$ inc hl inc (hl) 00232$: ; genPointerGet ; AOP_STK for _mus_update4_sloc2_1_0 lda hl,0(sp) ld e,(hl) inc hl ld d,(hl) ld a,(de) ; genAssign (pointer) ld (bc),a ; music.c 737 ; genGoto jp 00178$ ; music.c 739 ; genLabel 00171$: ; genAssign ; AOP_HL for _mus_data4 ld hl,#_mus_data4 ld c,(hl) inc hl ld b,(hl) ; genPlus ; AOP_HL for _mus_data4 ; genPlusIncr dec hl inc (hl) jr nz,00233$ inc hl inc (hl) 00233$: ; genPointerGet ld a,(bc) ; genLeftShift ; AOP_HL for _mus_noise_step ld c,a sla a rl a rl a and a,#0xF8 ld hl,#_mus_noise_step ld (hl),a ; music.c 740 ; genGoto jp 00178$ ; music.c 742 ; genLabel 00172$: ; genGoto jp 00178$ ; music.c 744 ; genLabel 00173$: ; genAssign ; AOP_HL for _mus_loop4 ; AOP_HL for _mus_data4 ld hl,#_mus_loop4 ld a,(hl+) ld e,(hl) ld hl,#_mus_data4 ld (hl+),a ld (hl),e ; music.c 745 ; genAssign ; AOP_HL for _mus_done4 ld hl,#_mus_done4 ld (hl),#0x01 ; music.c 746 ; genAssign ; AOP_HL for _mus_data4 ld hl,#_mus_data4 ld c,(hl) inc hl ld b,(hl) ; genPointerGet ld a,(bc) ; genCmpEq ; genCmpEq: left 1, right 1, result 0 ld c,a cp a,#0x13 jp nz,00178$ jr 00235$ 00234$: jp 00178$ 00235$: ; music.c 747 ; genAssign ; AOP_HL for _mus_wait4 ld hl,#_mus_wait4 ld (hl),#0xFF ; music.c 748 ; genRet ; music.c 751 ; genLabel 00180$: ; genEndFunction lda sp,6(sp) ret ___mus_update4_end: .area _CODE
programs/oeis/308/A308775.asm
neoneye/loda
22
94901
; A308775: Sum of all the parts in the partitions of n into 4 parts. ; 0,0,0,0,4,5,12,21,40,54,90,121,180,234,322,405,544,663,846,1026,1280,1512,1848,2162,2592,3000,3536,4050,4732,5365,6180,6975,7968,8910,10098,11235,12636,13986,15618,17199,19120,20951,23142,25284,27808,30240,33120 lpb $0 mov $1,$0 seq $1,26810 ; Number of partitions of n in which the greatest part is 4. mul $1,$0 mov $0,2 lpe mov $0,$1
src/apsepp-test_node_class-runner_sequential.adb
thierr26/ada-apsepp
0
13454
-- Copyright (C) 2019 <NAME> <<EMAIL>> -- MIT license. Please refer to the LICENSE file. with Apsepp.Generic_Shared_Instance.Access_Setter, Apsepp.Test_Node_Class.Private_Test_Reporter; package body Apsepp.Test_Node_Class.Runner_Sequential is ---------------------------------------------------------------------------- overriding function Child (Obj : Test_Runner_Sequential; K : Test_Node_Index) return Test_Node_Access is (Obj.Child_Access); ---------------------------------------------------------------------------- overriding function Routine (Obj : Test_Runner_Sequential; K : Test_Routine_Index) return Test_Routine is (Null_Test_Routine'Access); ---------------------------------------------------------------------------- overriding procedure Run (Obj : in out Test_Runner_Sequential; Outcome : out Test_Outcome; Kind : Run_Kind := Assert_Cond_And_Run_Test) is use Private_Test_Reporter; R_A : constant Shared_Instance.Instance_Type_Access := Shared_Instance.Instance_Type_Access (Obj.Reporter_Access); procedure CB is new SB_Lock_CB_procedure (SBLCB_Access => Obj.R_A_S_CB); package Test_Reporter_Access_Setter is new Shared_Instance.Access_Setter (Inst_Access => R_A, CB => CB); pragma Unreferenced (Test_Reporter_Access_Setter); begin Outcome := Passed; case Kind is when Assert_Cond_And_Run_Test => Test_Suite_Stub (Obj).Run (Outcome, Check_Cond); -- Inherited -- procedure call. when Check_Cond => null; end case; case Outcome is when Passed => Test_Suite_Stub (Obj).Run (Outcome, Kind); -- Inherited procedure -- call. when Failed => null; end case; end Run; ---------------------------------------------------------------------------- end Apsepp.Test_Node_Class.Runner_Sequential;
generated-src/win-x86/crypto/test/trampoline-x86.asm
jylama99/aws-lc
0
85274
<filename>generated-src/win-x86/crypto/test/trampoline-x86.asm ; This file is generated from a similarly-named Perl script in the BoringSSL ; source tree. Do not edit by hand. %ifdef BORINGSSL_PREFIX %include "boringssl_prefix_symbols_nasm.inc" %endif %ifidn __OUTPUT_FORMAT__,obj section code use32 class=code align=64 %elifidn __OUTPUT_FORMAT__,win32 $@feat.00 equ 1 section .text code align=64 %else section .text code %endif global _abi_test_trampoline align 16 _abi_test_trampoline: L$_abi_test_trampoline_begin: push ebp push ebx push esi push edi mov ecx,DWORD [24+esp] mov esi,DWORD [ecx] mov edi,DWORD [4+ecx] mov ebx,DWORD [8+ecx] mov ebp,DWORD [12+ecx] sub esp,44 mov eax,DWORD [72+esp] xor ecx,ecx L$000loop: cmp ecx,DWORD [76+esp] jae NEAR L$001loop_done mov edx,DWORD [ecx*4+eax] mov DWORD [ecx*4+esp],edx add ecx,1 jmp NEAR L$000loop L$001loop_done: call DWORD [64+esp] add esp,44 mov ecx,DWORD [24+esp] mov DWORD [ecx],esi mov DWORD [4+ecx],edi mov DWORD [8+ecx],ebx mov DWORD [12+ecx],ebp pop edi pop esi pop ebx pop ebp ret global _abi_test_get_and_clear_direction_flag align 16 _abi_test_get_and_clear_direction_flag: L$_abi_test_get_and_clear_direction_flag_begin: pushfd pop eax and eax,1024 shr eax,10 cld ret global _abi_test_set_direction_flag align 16 _abi_test_set_direction_flag: L$_abi_test_set_direction_flag_begin: std ret global _abi_test_clobber_eax align 16 _abi_test_clobber_eax: L$_abi_test_clobber_eax_begin: xor eax,eax ret global _abi_test_clobber_ebx align 16 _abi_test_clobber_ebx: L$_abi_test_clobber_ebx_begin: xor ebx,ebx ret global _abi_test_clobber_ecx align 16 _abi_test_clobber_ecx: L$_abi_test_clobber_ecx_begin: xor ecx,ecx ret global _abi_test_clobber_edx align 16 _abi_test_clobber_edx: L$_abi_test_clobber_edx_begin: xor edx,edx ret global _abi_test_clobber_edi align 16 _abi_test_clobber_edi: L$_abi_test_clobber_edi_begin: xor edi,edi ret global _abi_test_clobber_esi align 16 _abi_test_clobber_esi: L$_abi_test_clobber_esi_begin: xor esi,esi ret global _abi_test_clobber_ebp align 16 _abi_test_clobber_ebp: L$_abi_test_clobber_ebp_begin: xor ebp,ebp ret global _abi_test_clobber_xmm0 align 16 _abi_test_clobber_xmm0: L$_abi_test_clobber_xmm0_begin: pxor xmm0,xmm0 ret global _abi_test_clobber_xmm1 align 16 _abi_test_clobber_xmm1: L$_abi_test_clobber_xmm1_begin: pxor xmm1,xmm1 ret global _abi_test_clobber_xmm2 align 16 _abi_test_clobber_xmm2: L$_abi_test_clobber_xmm2_begin: pxor xmm2,xmm2 ret global _abi_test_clobber_xmm3 align 16 _abi_test_clobber_xmm3: L$_abi_test_clobber_xmm3_begin: pxor xmm3,xmm3 ret global _abi_test_clobber_xmm4 align 16 _abi_test_clobber_xmm4: L$_abi_test_clobber_xmm4_begin: pxor xmm4,xmm4 ret global _abi_test_clobber_xmm5 align 16 _abi_test_clobber_xmm5: L$_abi_test_clobber_xmm5_begin: pxor xmm5,xmm5 ret global _abi_test_clobber_xmm6 align 16 _abi_test_clobber_xmm6: L$_abi_test_clobber_xmm6_begin: pxor xmm6,xmm6 ret global _abi_test_clobber_xmm7 align 16 _abi_test_clobber_xmm7: L$_abi_test_clobber_xmm7_begin: pxor xmm7,xmm7 ret
AirMessage/AppleScript/AppleScriptSource/FaceTime/getActiveLink.applescript
airmessage/airmessage-server-next
23
1797
<reponame>airmessage/airmessage-server-next<filename>AirMessage/AppleScript/AppleScriptSource/FaceTime/getActiveLink.applescript --Creates and returns a FaceTime link for the current call --Open FaceTime tell application "FaceTime" to activate --Wait for FaceTime to initialize tell application "System Events" tell process "FaceTime" set windowReady to false repeat while not windowReady if exists window 1 set windowReady to true exit repeat end if delay 0.1 end repeat end tell end tell tell application "System Events" tell process "FaceTime" --Open sidebar repeat with buttonEl in buttons of window 1 if (exists attribute "AXIdentifier" of buttonEl) and (value of attribute "AXIdentifier" of buttonEl = "toggleSidebarButton") then click buttonEl end if end repeat --Wait for sidebar to open delay 1 --Clear the clipboard set the clipboard to "" --Click "share link" button set linkButton to button 2 of last group of list 1 of list 1 of scroll area 2 of window 1 click linkButton delay 0.1 click menu item 1 of menu of linkButton set startTime to (current date) repeat if the clipboard is not "" then return the clipboard as string else if (current date) - startTime > 20 then error "Clipboard timed out" end if delay 0.1 end repeat end tell end tell
tests/syntax_examples/src/basic_declaration-package_body_stub_name.adb
TNO/Dependency_Graph_Extractor-Ada
1
11528
separate(Basic_Declaration) package body Package_Body_Stub_Name is end Package_Body_Stub_Name;
programs/oeis/211/A211012.asm
karttu/loda
1
174864
; A211012: Total area of all squares and rectangles after 2^n stages in the toothpick structure of A139250, assuming the toothpicks have length 2. ; 0,0,8,48,224,960,3968,16128,65024,261120,1046528,4190208,16769024,67092480,268402688,1073676288,4294836224,17179607040,68718952448,274876858368,1099509530624,4398042316800,17592177655808,70368727400448,281474943156224,1125899839733760,4503599493152768 sub $0,1 mov $1,2 pow $1,$0 bin $1,2 mul $1,8
iAlloy-dataset-master/real_version_set/gradeFaulty/v22/gradeFaulty.als
jringert/alloy-diff
1
3404
<gh_stars>1-10 module unknown //JOR//open util/integer [] as integer abstract sig Person {} sig Student extends Person {} sig Professor extends Person {} sig Class { assistant_for: (set Student), instructor_of: (one Professor) } sig Assignment { associated_with: (one Class), assigned_to: (some Student) } pred PolicyAllowsGrading[s: Person,a: Assignment] { (((s in ((a.associated_with).assistant_for)) || (s in ((a.associated_with).instructor_of))) && (s !in (a.assigned_to))) } assert NoOneCanGradeTheirOwnAssignment { (all s: (one Person) { (all a: (one Assignment) { ((PolicyAllowsGrading[s,a]) => (!(s in (a.assigned_to)))) }) }) } run PolicyAllowsGrading for 100 check NoOneCanGradeTheirOwnAssignment for 200
src/Native/Runtime/i386/PInvoke.asm
ZZHGit/corert
0
246351
<reponame>ZZHGit/corert ;; ;; Copyright (c) Microsoft. All rights reserved. ;; Licensed under the MIT license. See LICENSE file in the project root for full license information. ;; .586 .model flat option casemap:none .code include AsmMacros.inc extern RhpReversePInvokeBadTransition : proc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; RhpWaitForSuspend -- rare path for RhpPInvoke and RhpReversePInvokeReturn ;; ;; ;; INPUT: none ;; ;; TRASHES: none ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; _RhpWaitForSuspend proc public push ebp mov ebp, esp push eax push ecx push edx ; passing Thread pointer in ecx, trashes eax INLINE_GETTHREAD ecx, eax call RhpPInvokeWaitEx pop edx pop ecx pop eax pop ebp ret _RhpWaitForSuspend endp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; RhpWaitForGC ;; ;; ;; INPUT: ECX: transition frame ;; ;; OUTPUT: ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; _RhpWaitForGC proc public push ebp mov ebp, esp push eax push edx push ebx push esi mov ebx, ecx mov esi, [ebx + OFFSETOF__PInvokeTransitionFrame__m_pThread] test dword ptr [esi + OFFSETOF__Thread__m_ThreadStateFlags], TSF_DoNotTriggerGc jnz Done RetryWaitForGC: ; EBX: transition frame ; ESI: thread mov [esi + OFFSETOF__Thread__m_pTransitionFrame], ebx mov ecx, esi ; passing Thread pointer in ecx call @RhpPInvokeReturnWaitEx@4 mov dword ptr [esi + OFFSETOF__Thread__m_pTransitionFrame], 0 cmp [RhpTrapThreads], 0 jne RetryWaitForGC Done: pop esi pop ebx pop edx pop eax pop ebp ret _RhpWaitForGC endp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; RhpReversePInvoke2 ;; ;; INCOMING: ECX -- address of reverse pinvoke frame ;; ;; This is useful for calling with a standard calling convention for code generators that don't insert this in ;; the prolog. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FASTCALL_FUNC RhpReversePInvoke2, 0 mov eax, ecx jmp @RhpReversePInvoke@0 FASTCALL_ENDFUNC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; RhpReversePInvoke ;; ;; IN: EAX: address of reverse pinvoke frame ;; 0: save slot for previous M->U transition frame ;; 4: save slot for thread pointer to avoid re-calc in epilog sequence ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FASTCALL_FUNC RhpReversePInvoke, 0 push ecx ; save arg regs -- we could omit this if we knew the calling convention wasn't fastcall. push edx ; ... ;; edx = GetThread(), TRASHES ecx INLINE_GETTHREAD edx, ecx mov [eax + 4], edx ; save thread pointer for RhpReversePInvokeReturn ; edx = thread ; eax = prev save slot ; ecx = scratch test dword ptr [edx + OFFSETOF__Thread__m_ThreadStateFlags], TSF_Attached jz AttachThread ThreadAttached: ;; ;; Check for the correct mode. This is accessible via various odd things that we cannot completely ;; prevent such as : ;; 1) Registering a reverse pinvoke entrypoint as a vectored exception handler ;; 2) Performing a managed delegate invoke on a reverse pinvoke delegate. ;; cmp dword ptr [edx + OFFSETOF__Thread__m_pTransitionFrame], 0 jne ValidTransition ;; Allow 'bad transitions' in when the TSF_DoNotTriggerGc mode is set. This allows us to have ;; [NativeCallable] methods that are called via the "restricted GC callouts" as well as from native, ;; which is necessary because the methods are CCW vtable methods on interfaces passed to native. test dword ptr [edx + OFFSETOF__Thread__m_ThreadStateFlags], TSF_DoNotTriggerGc jz BadTransition ;; zero-out our 'previous transition frame' save slot mov dword ptr [eax], 0 ;; nothing more to do jmp AllDone ValidTransition: ; Save previous TransitionFrame prior to making the mode transition so that it is always valid ; whenever we might attempt to hijack this thread. mov ecx, [edx + OFFSETOF__Thread__m_pTransitionFrame] mov [eax], ecx ReverseRetry: mov dword ptr [edx + OFFSETOF__Thread__m_pTransitionFrame], 0 cmp [RhpTrapThreads], 0 jne ReverseTrapReturningThread AllDone: pop edx ; restore arg reg pop ecx ; restore arg reg ret AttachThread: ;; ;; Thread attach is done here to avoid taking the ThreadStore lock while in DllMain. The lock is ;; avoided for DllMain thread attach notifications, but not process attach notifications because ;; our managed DllMain does work during process attach, so it needs to reverse pinvoke. ;; ; edx = thread ; eax = prev save slot ; ecx = scratch push eax push edx call THREADSTORE__ATTACHCURRENTTHREAD pop edx pop eax jmp ThreadAttached ReverseTrapReturningThread: ; edx = thread ; eax = prev save slot ; ecx = scratch mov ecx, [eax] mov [edx + OFFSETOF__Thread__m_pTransitionFrame], ecx push eax push edx mov ecx, edx ; passing Thread pointer in ecx call @RhpPInvokeReturnWaitEx@4 pop edx pop eax jmp ReverseRetry BadTransition: pop edx pop ecx jmp RhpReversePInvokeBadTransition FASTCALL_ENDFUNC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; RhpReversePInvokeReturn ;; ;; IN: ECX: address of reverse pinvoke frame ;; 0: save slot for previous M->U transition frame ;; 4: save slot for thread pointer to avoid re-calc in epilog sequence ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FASTCALL_FUNC RhpReversePInvokeReturn, 0 push edx ; save return value mov edx, [ecx + 4] ; get Thread pointer mov ecx, [ecx + 0] ; get previous M->U transition frame mov [edx + OFFSETOF__Thread__m_pTransitionFrame], ecx cmp [RhpTrapThreads], 0 pop edx ; restore return value jne _RhpWaitForSuspend ret FASTCALL_ENDFUNC end
libsrc/_DEVELOPMENT/string/z80/asm_strrstrip.asm
UnivEngineer/z88dk
1
167487
<gh_stars>1-10 ; =============================================================== ; Dec 2013 ; =============================================================== ; ; char *strrstrip(char *s) ; ; Remove trailing whitespace from s by writing 0 into s to ; terminate the string early. ; ; If s consists entirely of whitespace then s[0] = 0. ; ; See also _strrstrip() that does not modify s. ; ; =============================================================== SECTION code_clib SECTION code_string PUBLIC asm_strrstrip EXTERN asm__strrstrip asm_strrstrip: ; enter : hl = char *s ; ; exit : hl = char *s ; carry reset if s is entirely whitespace ; ; uses : af, bc, de call asm__strrstrip ; hl = ptr to ws char ld (hl),0 ; terminate s early ex de,hl ret
software/hal/boards/stm32_common/sdram/stm32-sdram.adb
TUM-EI-RCS/StratoX
12
27905
<filename>software/hal/boards/stm32_common/sdram/stm32-sdram.adb with Ada.Real_Time; use Ada.Real_Time; with STM32.Board; use STM32.Board; with STM32.Device; use STM32.Device; with STM32.FMC; use STM32.FMC; with STM32.GPIO; use STM32.GPIO; with STM32_SVD.RCC; use STM32_SVD.RCC; package body STM32.SDRAM is Initialized : Boolean := False; G_Base_Addr : Word; procedure SDRAM_GPIOConfig; procedure SDRAM_InitSequence; ---------------------- -- SDRAM_GPIOConfig -- ---------------------- procedure SDRAM_GPIOConfig is begin Enable_Clock (SDRAM_PINS); Configure_IO (SDRAM_PINS, (Speed => Speed_50MHz, Mode => Mode_AF, Output_Type => Push_Pull, Resistors => Pull_Up)); Configure_Alternate_Function (SDRAM_PINS, GPIO_AF_FMC); Lock (SDRAM_PINS); end SDRAM_GPIOConfig; ------------------------ -- SDRAM_InitSequence -- ------------------------ procedure SDRAM_InitSequence is CAS : SDRAM_Mode_CAS_Latency; begin loop exit when not FMC_SDRAM_Busy; end loop; FMC_SDRAM_Cmd ((Mode => FMC_Command_Mode_CLK_Enabled, Target => SDRAM_Bank)); loop exit when not FMC_SDRAM_Busy; end loop; delay until Clock + Milliseconds (1); FMC_SDRAM_Cmd ((Mode => FMC_Command_Mode_PALL, Target => SDRAM_Bank)); loop exit when not FMC_SDRAM_Busy; end loop; FMC_SDRAM_Cmd ((Mode => FMC_Command_Mode_AutoRefresh, Target => SDRAM_Bank, Auto_Refresh_Number => 8)); loop exit when not FMC_SDRAM_Busy; end loop; case SDRAM_CAS_Latency is when FMC_CAS_Latency_1 | FMC_CAS_Latency_2 => CAS := SDRAM_Mode_CAS_Latency_2; when FMC_CAS_Latency_3 => CAS := SDRAM_Mode_CAS_Latency_3; end case; FMC_SDRAM_Cmd ((Mode => FMC_Command_Mode_LoadMode, Target => SDRAM_Bank, Mode_Register => (SDRAM_Mode_Burst_Length_1, SDRAM_Mode_Burst_Sequential, CAS, SDRAM_Mode_Writeburst_Mode_Single))); loop exit when not FMC_SDRAM_Busy; end loop; FMC_Set_Refresh_Count (SDRAM_Refresh_Cnt); loop exit when not FMC_SDRAM_Busy; end loop; end SDRAM_InitSequence; ---------------- -- Initialize -- ---------------- procedure Initialize is Timing_Conf : FMC_SDRAM_TimingInit_Config; SDRAM_Conf : FMC_SDRAM_Init_Config; begin if Initialized then return; end if; Initialized := True; G_Base_Addr := SDRAM_Base; ------------------------ -- GPIO CONFIGURATION -- ------------------------ SDRAM_GPIOConfig; -------------- -- FMC_INIT -- -------------- RCC_Periph.AHB3ENR.FMCEN := True; RCC_Periph.AHB3RSTR.FMCRST := True; RCC_Periph.AHB3RSTR.FMCRST := False; -- 90 MHz of SD clock frequency (180MHz / 2) -- 1 Clock cycle = 1 / 90MHz = 11.1ns Timing_Conf := ( -- 2 Clock cycles for Load to Active delay LoadToActiveDelay => 2, -- min = 70ns: 7 * 11.1 ExitSelfRefreshDelay => 7, -- in range [42ns, 120k ns] => using 4 * 11.1 ns SelfRefreshTime => 4, -- min = 70ns RowCycleDelay => 7, -- min = 20ns WriteRecoveryTime => 2, RPDelay => 2, RCDDelay => 2); SDRAM_Conf := (Bank => SDRAM_Bank, ColumnBitsNumber => FMC_ColumnBits_Number_8b, RowBitsNumber => SDRAM_Row_Bits, SDMemoryDataWidth => SDRAM_Mem_Width, InternalBankNumber => FMC_InternalBank_Number_4, CASLatency => SDRAM_CAS_Latency, WriteProtection => FMC_Write_Protection_Disable, SDClockPeriod => SDRAM_CLOCK_Period, ReadBurst => SDRAM_Read_Burst, ReadPipeDelay => SDRAM_Read_Pipe, Timing_Conf => Timing_Conf); FMC_SDRAM_Init (SDRAM_Conf); if SDRAM_Conf.Bank /= FMC_Bank1_SDRAM then SDRAM_Conf.Bank := FMC_Bank1_SDRAM; FMC_SDRAM_Init (SDRAM_Conf); end if; SDRAM_InitSequence; end Initialize; ------------------ -- Base_Address -- ------------------ function Base_Address return System.Address is begin return System'To_Address (G_Base_Addr); end Base_Address; ------------- -- Reserve -- ------------- function Reserve (Amount : Word; Align : Word := Standard'Maximum_Alignment) return System.Address is Ret : constant System.Address := System'To_Address (G_Base_Addr); Rounded_Size : Word; begin Initialize; Rounded_Size := Amount + Align; Rounded_Size := Rounded_Size - Rounded_Size rem Align; G_Base_Addr := G_Base_Addr + Rounded_Size; return Ret; end Reserve; end STM32.SDRAM;
programs/oeis/181/A181972.asm
jmorken/loda
1
17638
<reponame>jmorken/loda ; A181972: Number of integer pairs (x,y) such that 0<x<y<=n and x*y<=floor(n/2). ; 0,0,0,1,1,2,2,3,3,4,4,6,6,7,7,9,9,10,10,12,12,13,13,16,16,17,17,19,19,21,21,23,23,24,24,27,27,28,28,31,31,33,33,35,35,36,36,40,40,41,41,43,43,45,45,48,48,49,49,53,53,54,54,57,57,59,59,61,61,63,63,67 mov $29,$0 add $29,1 lpb $29 clr $0,27 sub $29,1 sub $0,$29 mov $2,$0 pow $0,2 div $0,2 mov $26,$2 cmp $26,0 add $2,$26 mod $0,$2 cal $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n. mov $1,$0 div $1,2 add $28,$1 lpe mov $1,$28
Task/Execute-a-system-command/Ada/execute-a-system-command-1.ada
mullikine/RosettaCodeData
1
27223
with POSIX.Unsafe_Process_Primitives; procedure Execute_A_System_Command is Arguments : POSIX.POSIX_String_List; begin POSIX.Append (Arguments, "ls"); POSIX.Unsafe_Process_Primitives.Exec_Search ("ls", Arguments); end Execute_A_System_Command;
tests/include_simple/2.asm
NullMember/customasm
414
26613
<gh_stars>100-1000 #include "cpu.asm" #include "code.asm" ; = 0x555555aa55aa
Transynther/x86/_processed/US/_ht_zr_un_/i3-7100_9_0xca_notsx.log_21829_688.asm
ljhsiun2/medusa
9
166135
<reponame>ljhsiun2/medusa<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r8 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x1e655, %rbx xor %r8, %r8 movl $0x61626364, (%rbx) nop nop nop nop nop xor $64207, %rcx lea addresses_WC_ht+0x48b1, %r10 nop cmp $46980, %r8 movw $0x6162, (%r10) nop nop nop nop sub %r8, %r8 lea addresses_UC_ht+0x16ebd, %r8 nop nop cmp $22802, %r12 movw $0x6162, (%r8) cmp %r8, %r8 lea addresses_A_ht+0x11015, %rsi lea addresses_WT_ht+0x2607, %rdi clflush (%rdi) nop nop nop nop and %rdx, %rdx mov $123, %rcx rep movsq cmp $31038, %rdi lea addresses_WT_ht+0xfe55, %r12 xor %rsi, %rsi mov (%r12), %r10d nop and %r10, %r10 lea addresses_D_ht+0x16dad, %rsi lea addresses_WC_ht+0x3755, %rdi nop nop nop add %r10, %r10 mov $111, %rcx rep movsq nop nop nop nop sub %r12, %r12 lea addresses_A_ht+0xd252, %rdx nop inc %rcx mov (%rdx), %r10w nop nop nop xor $1029, %rdx lea addresses_WT_ht+0xd91, %r8 nop nop nop nop nop add %r10, %r10 mov (%r8), %r12 nop nop nop nop nop xor $28516, %r8 lea addresses_A_ht+0xaff3, %r10 clflush (%r10) nop add $61747, %rbx vmovups (%r10), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $1, %xmm5, %rdi nop nop nop sub $15243, %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r8 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r8 push %rax push %rbp push %rbx push %rcx push %rdx // Load lea addresses_US+0x19655, %rdx cmp %r8, %r8 mov (%rdx), %r10d nop nop nop nop nop and $55740, %rbx // Load mov $0x410de10000000a55, %r8 nop nop nop xor %rbp, %rbp movb (%r8), %r10b nop sub $47458, %rbx // Store lea addresses_US+0x3655, %rbx nop nop nop nop inc %rdx movw $0x5152, (%rbx) nop nop nop nop add %rcx, %rcx // Store mov $0x689cbe00000006cf, %r10 and %rcx, %rcx mov $0x5152535455565758, %rax movq %rax, (%r10) nop xor $50648, %rdx // Store lea addresses_D+0x2b8d, %rdx nop xor $11329, %rcx movl $0x51525354, (%rdx) nop nop nop nop and $58866, %rbx // Faulty Load lea addresses_US+0x3655, %rcx nop nop nop nop add %rdx, %rdx vmovups (%rcx), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %rbx lea oracles, %rax and $0xff, %rbx shlq $12, %rbx mov (%rax,%rbx,1), %rbx pop %rdx pop %rcx pop %rbx pop %rbp pop %rax pop %r8 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_US', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_NC', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 2, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_NC', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_D', 'size': 4, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_US', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': True, 'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False}} {'src': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}} {'src': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}} {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} {'45': 13237, '05': 5, '08': 9, '00': 7693, '46': 885} 45 45 45 45 45 45 00 46 45 00 45 00 00 45 00 00 45 45 00 00 00 45 45 45 00 45 45 00 00 45 00 00 00 45 00 00 45 45 00 00 45 45 00 45 00 45 45 45 45 00 45 00 45 45 45 45 45 00 00 45 45 45 00 00 45 00 00 45 45 00 45 00 45 45 46 00 00 45 46 00 45 00 45 45 45 45 00 45 00 45 00 00 00 45 00 45 45 45 45 45 00 45 45 45 45 00 45 00 45 45 00 45 00 45 45 00 00 45 00 45 45 45 00 00 00 45 45 45 45 00 45 00 00 45 00 45 00 45 45 00 45 00 45 00 45 00 45 00 00 45 46 45 45 00 45 45 00 45 00 45 45 00 45 00 45 45 00 00 45 45 45 00 45 45 00 00 00 00 45 45 45 00 45 45 45 00 00 45 00 00 00 00 00 00 00 00 45 45 45 45 45 45 45 45 45 00 46 45 00 45 00 45 46 45 45 00 00 00 45 45 45 45 00 00 46 45 00 00 45 00 45 45 00 45 45 45 45 45 46 45 00 00 45 45 00 45 45 00 00 45 46 45 00 45 45 00 45 00 45 00 00 45 45 45 45 00 00 00 45 00 45 45 46 00 45 00 00 45 00 45 00 45 00 45 45 45 45 00 45 00 45 00 45 45 45 45 00 45 45 45 45 45 45 00 00 00 00 00 45 45 45 45 00 45 45 45 45 45 00 45 45 45 00 46 45 45 00 00 45 45 45 00 00 45 45 45 45 00 45 00 45 00 45 45 45 45 45 00 45 00 00 00 45 45 00 45 00 45 45 45 45 45 45 45 45 00 45 00 45 45 00 45 45 00 45 00 45 45 45 46 45 45 00 45 45 45 00 45 45 00 45 46 00 45 45 45 00 45 00 45 00 45 45 00 45 45 00 00 45 45 45 45 45 45 45 45 45 00 00 05 00 45 00 45 00 45 00 00 45 00 45 45 45 45 45 00 00 46 45 45 00 45 00 45 45 45 45 45 00 45 45 45 45 45 45 00 45 00 46 45 46 00 45 00 45 45 00 00 45 00 45 00 45 45 45 00 45 45 45 45 45 45 46 00 00 00 45 00 45 45 45 45 45 00 00 45 45 45 00 45 45 00 45 45 45 45 45 45 45 45 45 45 45 00 45 45 45 00 00 45 45 45 45 00 00 00 00 00 45 00 45 45 45 45 00 00 45 45 45 45 00 45 45 45 45 00 45 45 45 45 00 00 45 45 45 00 45 45 45 00 45 45 45 45 00 45 00 45 45 45 45 00 00 45 46 45 45 45 00 45 00 45 45 45 45 45 45 00 46 46 45 46 45 45 00 45 00 45 45 45 45 45 45 45 00 45 45 45 45 45 45 45 00 45 00 46 00 45 45 45 46 45 00 00 00 45 46 45 00 00 45 45 45 00 00 45 00 45 00 00 00 45 45 00 45 45 45 45 45 45 00 00 45 00 45 45 45 45 45 45 45 00 45 45 45 45 00 45 45 45 45 45 45 45 45 45 00 45 45 45 45 45 46 45 00 45 46 45 00 00 45 45 00 45 00 45 45 46 00 45 00 45 00 45 46 45 45 45 45 00 00 00 00 45 45 46 45 00 00 45 45 45 45 45 00 00 45 45 45 00 45 00 45 45 45 45 46 45 45 00 45 45 00 00 45 45 00 45 45 45 00 00 45 45 00 46 45 45 46 00 00 45 00 00 46 45 45 45 45 00 00 45 45 45 00 45 45 45 45 00 00 46 00 45 45 45 00 45 00 00 45 45 00 45 45 45 45 00 45 00 45 45 45 45 45 00 45 45 00 45 45 45 45 45 45 45 45 00 00 45 45 45 00 45 45 45 45 45 45 45 45 45 00 45 45 00 45 45 45 00 46 00 00 45 45 45 00 45 00 45 45 00 45 00 45 00 00 00 45 00 45 00 00 45 45 46 00 00 45 45 45 00 45 45 00 45 45 00 00 00 00 45 45 00 45 45 45 00 45 45 45 46 00 00 00 45 45 00 00 45 00 00 45 45 45 45 45 00 45 45 45 00 45 45 45 45 00 45 00 45 45 46 45 45 00 45 45 00 00 45 00 00 45 45 45 45 45 00 45 45 45 00 45 45 45 45 45 45 00 00 00 00 45 45 00 45 00 00 45 45 00 45 45 00 45 45 45 00 00 45 45 00 45 00 00 45 00 45 45 45 45 00 00 00 00 00 00 45 45 45 00 00 00 45 45 00 45 45 00 45 */
print/p009.asm
czfshine/assembly-exercise
1
8936
; 8086 assembly file ; by:czfshine ; date: 2018/04/12 10:10:56 ;编写一个程序,从键盘输入一个不长于8位的四进制数, ;并将所输入的数以10进制数形式显示出来。 ; The Main Data segment include scan.inc DATA SEGMENT DATA ENDS ;entry code segment CODE SEGMENT ASSUME CS:CODE ,DS:DATA START: ;entry point MOV AX,DATA MOV DS,AX mov di,4 call inputnumbybase mov si,10 call rebase MOV AH,4CH ;return INT 21H CODE ENDS END START
tools/scitools/conf/understand/ada/ada12/s-pooglo.ads
brucegua/moocos
1
10164
<filename>tools/scitools/conf/understand/ada/ada12/s-pooglo.ads ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . P O O L _ G L O B A L -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Storage pool corresponding to default global storage pool used for types -- for which no storage pool is specified. with System; with System.Storage_Pools; with System.Storage_Elements; package System.Pool_Global is pragma Elaborate_Body; -- Needed to ensure that library routines can execute allocators -- Allocation strategy: -- Call to malloc/free for each Allocate/Deallocate -- No user specifiable size -- No automatic reclaim -- Minimal overhead -- Pool simulating the allocation/deallocation strategy used by the -- compiler for access types globally declared. type Unbounded_No_Reclaim_Pool is new System.Storage_Pools.Root_Storage_Pool with null record; overriding function Storage_Size (Pool : Unbounded_No_Reclaim_Pool) return System.Storage_Elements.Storage_Count; overriding procedure Allocate (Pool : in out Unbounded_No_Reclaim_Pool; Address : out System.Address; Storage_Size : System.Storage_Elements.Storage_Count; Alignment : System.Storage_Elements.Storage_Count); overriding procedure Deallocate (Pool : in out Unbounded_No_Reclaim_Pool; Address : System.Address; Storage_Size : System.Storage_Elements.Storage_Count; Alignment : System.Storage_Elements.Storage_Count); -- Pool object used by the compiler when implicit Storage Pool objects are -- explicitly referred to. For instance when writing something like: -- for T'Storage_Pool use Q'Storage_Pool; -- and Q'Storage_Pool hasn't been defined explicitly. Global_Pool_Object : Unbounded_No_Reclaim_Pool; end System.Pool_Global;
oeis/124/A124292.asm
neoneye/loda-programs
11
12905
<gh_stars>10-100 ; A124292: Number of free generators of degree n of symmetric polynomials in 4 noncommuting variables. ; Submitted by <NAME>(s4) ; 1,1,2,6,21,78,297,1143,4419,17118,66366,257391,998406,3873015,15024609,58285737,226111986,877174110,3402893997,13201132950,51212274057,198672129783,770725711035,2989941920334,11599136512038,44997518922327,174562710686622,677196003354903,2627104180716801,10191549186166545,39536945500612770,153379042870328118,595016395274953413,2308297822318605726,8954776505048037993,34739027815245636663,134766071812997295219,522809510055917155326,2028179497464264184974,7868089609721322597567 lpb $0 sub $0,1 add $1,$3 add $2,$3 mov $3,1 add $3,$2 mul $2,2 add $4,$1 add $3,$4 lpe mov $0,$4 add $0,1
PRG/objects/W1A.asm
narfman0/smb3_pp1
0
243581
<gh_stars>0 .byte $00 ; Unknown purpose .byte OBJ_AUTOSCROLL, $00, $0B .byte OBJ_CLOUDSINBGBEGIN, $03, $09 .byte OBJ_CFIRE_ULCANNON, $13, $0D .byte OBJ_AIRSHIPPROP, $16, $13 .byte OBJ_CFIRE_ULCANNON, $18, $0D .byte OBJ_CFIRE_BULLETBILL, $1E, $0C .byte OBJ_CFIRE_ULCANNON, $24, $10 .byte OBJ_CFIRE_LLCANNON, $28, $09 .byte OBJ_AIRSHIPPROP, $29, $14 .byte OBJ_CFIRE_BULLETBILL, $2C, $0D .byte OBJ_CFIRE_LLCANNON, $2D, $09 .byte OBJ_CFIRE_4WAY, $38, $0A .byte OBJ_AIRSHIPPROP, $3D, $14 .byte OBJ_CFIRE_URCANNON, $47, $12 .byte OBJ_CFIRE_BULLETBILL, $4D, $10 .byte OBJ_CFIRE_URCANNON, $4F, $12 .byte $FF ; Terminator
libtool/src/gmp-6.1.2/mpn/x86/atom/logops_n.asm
kroggen/aergo
1,602
82612
dnl Intel Atom mpn_and_n,...,mpn_xnor_n -- bitwise logical operations. dnl Copyright 2011 Free Software Foundation, Inc. dnl Contributed to the GNU project by <NAME>. dnl This file is part of the GNU MP Library. dnl dnl The GNU MP Library is free software; you can redistribute it and/or modify dnl it under the terms of either: dnl dnl * the GNU Lesser General Public License as published by the Free dnl Software Foundation; either version 3 of the License, or (at your dnl option) any later version. dnl dnl or dnl dnl * the GNU General Public License as published by the Free Software dnl Foundation; either version 2 of the License, or (at your option) any dnl later version. dnl dnl or both in parallel, as here. dnl dnl The GNU MP Library is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License dnl for more details. dnl dnl You should have received copies of the GNU General Public License and the dnl GNU Lesser General Public License along with the GNU MP Library. If not, dnl see https://www.gnu.org/licenses/. include(`../config.m4') C cycles/limb C op nop opn C P5 C P6 model 0-8,10-12 C P6 model 9 (Banias) C P6 model 13 (Dothan) C P4 model 0 (Willamette) C P4 model 1 (?) C P4 model 2 (Northwood) C P4 model 3 (Prescott) C P4 model 4 (Nocona) C Intel Atom 3 3.5 3.5 C AMD K6 C AMD K7 C AMD K8 C AMD K10 define(M4_choose_op, `ifdef(`OPERATION_$1',` define(`M4_function', `mpn_$1') define(`M4_want_pre', `$4') define(`M4_inst', `$3') define(`M4_want_post',`$2') ')') define(M4pre, `ifelse(M4_want_pre, yes,`$1')') define(M4post,`ifelse(M4_want_post,yes,`$1')') M4_choose_op( and_n, , andl, ) M4_choose_op( andn_n, , andl, yes) M4_choose_op( nand_n, yes, andl, ) M4_choose_op( ior_n, , orl, ) M4_choose_op( iorn_n, , orl, yes) M4_choose_op( nior_n, yes, orl, ) M4_choose_op( xor_n, , xorl, ) M4_choose_op( xnor_n, yes, xorl, ) ifdef(`M4_function',, `m4_error(`Unrecognised or undefined OPERATION symbol ')') MULFUNC_PROLOGUE(mpn_and_n mpn_andn_n mpn_nand_n mpn_ior_n mpn_iorn_n mpn_nior_n mpn_xor_n mpn_xnor_n) C void M4_function (mp_ptr dst, mp_srcptr src2, mp_srcptr src1, mp_size_t size); C defframe(PARAM_SIZE, 16) defframe(PARAM_SRC1, 12) defframe(PARAM_SRC2, 8) defframe(PARAM_DST, 4) dnl re-use parameter space define(SAVE_RP,`PARAM_SIZE') define(SAVE_VP,`PARAM_SRC1') define(SAVE_UP,`PARAM_DST') define(`rp', `%edi') define(`up', `%esi') define(`vp', `%ebx') define(`cnt', `%eax') define(`r1', `%ecx') define(`r2', `%edx') ASM_START() TEXT ALIGN(16) deflit(`FRAME',0) PROLOGUE(M4_function) mov PARAM_SIZE, cnt C size mov rp, SAVE_RP mov PARAM_DST, rp mov up, SAVE_UP mov PARAM_SRC1, up shr cnt C size >> 1 mov vp, SAVE_VP mov PARAM_SRC2, vp mov (up), r1 jz L(end) C size == 1 jnc L(even) C size % 2 == 0 ALIGN(16) L(oop): M4pre(` notl_or_xorl_GMP_NUMB_MASK(r1)') M4_inst (vp), r1 lea 8(up), up mov -4(up), r2 M4post(` notl_or_xorl_GMP_NUMB_MASK(r1)') lea 8(vp), vp mov r1, (rp) L(entry): M4pre(` notl_or_xorl_GMP_NUMB_MASK(r2)') M4_inst -4(vp), r2 lea 8(rp), rp M4post(` notl_or_xorl_GMP_NUMB_MASK(r2)') dec cnt mov (up), r1 mov r2, -4(rp) jnz L(oop) L(end): M4pre(` notl_or_xorl_GMP_NUMB_MASK(r1)') mov SAVE_UP, up M4_inst (vp), r1 M4post(`notl_or_xorl_GMP_NUMB_MASK(r1)') mov SAVE_VP, vp mov r1, (rp) mov SAVE_RP, rp ret L(even): mov r1, r2 lea 4(up), up lea 4(vp), vp lea -4(rp), rp jmp L(entry) EPILOGUE() ASM_END()
EmptyTrashService.tne/main.scpt
YaxinCheng/TNEExamples
0
3805
<reponame>YaxinCheng/TNEExamples<filename>EmptyTrashService.tne/main.scpt tell application "Finder" if length of (items in the trash as string) is 0 then return empty trash end tell
wof/lcs/enemy/1.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
6
173741
<reponame>zengfr/arcade_game_romhacking_sourcecode_top_secret_data<gh_stars>1-10 copyright zengfr site:http://github.com/zengfr/romhack 001192 rts [enemy+ 1] 00119A rts 00438E sne ($1,A0) [enemy+24] 004392 jmp $15c0.w [enemy+ 1] 05E5D6 bne $5e5da [123p+ 1, enemy+ 1] copyright zengfr site:http://github.com/zengfr/romhack
software/rom/bios_spi.asm
JCLemme/eprisc
0
18269
<reponame>JCLemme/eprisc ; epRISC development platform - BIOS SPI master control routines ; ; written by <NAME>, jclemme (at) proportionallabs (dot) com ; this file is part of the epRISC project, released under the epRISC license - see "license.txt" for details. ; ; These routines command the onboard I/O controller's SPI bus master. Will be optimized later. !def SPI_CONF_ADDRESS #h020 !def SPI_MOSI_ADDRESS #h021 !def SPI_MISO_ADDRESS #h022 !zone spi_addr !def REG_ADDR %Zw !def REG_WORK %Zx !def REG_RESP %Zz :spi_addr push.r s:REG_ADDR push.r s:REG_WORK subr.v d:%SP a:%SP v:#h03 ; Set up the stack pops.r d:REG_ADDR ; Get the number we're supposed to print addr.v d:%SP a:%SP v:#h04 ; Set up the stack move.v d:REG_WORK v:SPI_CONF_ADDRESS push.r s:REG_WORK call.s a:ioc_recv pops.r d:REG_WORK ; Get current configuration register mski.v d:REG_RESP a:REG_RESP v:#h78 arsl.v d:REG_ADDR a:REG_ADDR v:#h03 orbt.r d:REG_ADDR a:REG_ADDR b:REG_RESP ; Calculate mask push.r s:REG_WORK push.r s:REG_ADDR call.s a:ioc_send pops.r d:REG_ADDR pops.r d:REG_WORK ; Set new mask pops.r d:REG_WORK pops.r d:REG_ADDR rtrn.s ; And return !zone spi_send !def REG_DATA %Zw !def REG_WORK %Zx !def REG_RESP %Zz :spi_send push.r s:REG_DATA push.r s:REG_WORK subr.v d:%SP a:%SP v:#h03 ; Set up the stack pops.r d:REG_DATA ; Get the number we're supposed to print addr.v d:%SP a:%SP v:#h04 ; Set up the stack move.v d:REG_WORK v:SPI_MOSI_ADDRESS push.r s:REG_WORK push.r s:REG_DATA call.s a:ioc_send pops.r d:REG_DATA pops.r d:REG_WORK ; Write data to send move.v d:REG_WORK v:SPI_CONF_ADDRESS push.r s:REG_WORK call.s a:ioc_recv pops.r d:REG_WORK ; Get current configuration register ; move.v d:REG_RESP v:#h00 orbt.v d:REG_RESP a:REG_RESP v:#h80 ; Calculate mask push.r s:REG_WORK push.r s:REG_RESP call.s a:ioc_send pops.r d:REG_RESP pops.r d:REG_WORK ; Set new mask move.v d:REG_WORK v:SPI_CONF_ADDRESS push.r s:REG_WORK :.chkloop call.s a:ioc_recv test.v a:REG_RESP v:#h80 brch.a c:%NEQ a:.chkloop pops.r d:REG_WORK move.v d:REG_WORK v:SPI_MISO_ADDRESS push.r s:REG_WORK call.s a:ioc_recv pops.r d:REG_WORK ; Get captured data pops.r d:REG_WORK pops.r d:REG_DATA rtrn.s ; And return !zone spi_recv !def REG_WORK %Zx !def REG_RESP %Zz :spi_recv push.r s:REG_WORK ; Set up the stack move.v d:REG_WORK v:SPI_MOSI_ADDRESS push.r s:REG_WORK move.v d:REG_WORK v:#hFF push.r s:REG_WORK call.s a:ioc_send pops.r d:REG_WORK pops.r d:REG_WORK ; Write data to send move.v d:REG_WORK v:SPI_CONF_ADDRESS push.r s:REG_WORK call.s a:ioc_recv pops.r d:REG_WORK ; Get current configuration register orbt.v d:REG_RESP a:REG_RESP v:#h80 ; Calculate mask push.r s:REG_WORK push.r s:REG_RESP call.s a:ioc_send pops.r d:REG_RESP pops.r d:REG_WORK ; Set new mask move.v d:REG_WORK v:SPI_CONF_ADDRESS push.r s:REG_WORK :.chkloop call.s a:ioc_recv test.v a:REG_RESP v:#h80 brch.a c:%NEQ a:.chkloop pops.r d:REG_WORK move.v d:REG_WORK v:SPI_MISO_ADDRESS push.r s:REG_WORK call.s a:ioc_recv pops.r d:REG_WORK ; Get captured data pops.r d:REG_WORK rtrn.s ; And return
src/utils.asm
zetaraku/minesweeper
0
28188
; trans (offset: ax) to (row: ah, col: al) trXY PROC uses bx dx xor dx, dx mov bx, WORD PTR w div bx shl ax, 8 mov al, dl ret trXY ENDP ; trans (row: ah, col: al) to (offset: ax) trN PROC uses bx dx movzx dx, al shr ax, 8 mov bl, BYTE PTR w mul bl add ax, dx ret trN ENDP ; set dl valid flag accroding to (row: ah, col: al) as 4-bit flags [udlr] getNeighborValidFlag PROC uses eax ; clear dl xor dl, dl ; dl |= 1000b if row > 0 cmp ah, 0 ja nu or dl, 1000b nu: ; dl |= 0100b if row < h-1 inc ah cmp ah, BYTE PTR h jb nd or dl, 0100b nd: ; dl |= 0010b if col > 0 cmp al, 0 ja nl or dl, 0010b nl: ; dl |= 0001b if col < w-1 inc al cmp al, BYTE PTR w jb nr or dl, 0001b nr: ret getNeighborValidFlag ENDP ; increase mine number of a tile around (offset: ax), valid flag dl must be set properly incNumber PROC uses ebx ; ebx start from top-left tile sub ebx, w dec ebx test dl, 1010b jnz _1 inc byte ptr [ebx] _1: inc ebx test dl, 1000b jnz _2 inc byte ptr [ebx] _2: inc ebx test dl, 1001b jnz _3 inc byte ptr [ebx] _3: sub ebx, 2 add ebx, DWORD PTR w test dl, 0010b jnz _4 inc byte ptr [ebx] _4: inc ebx _5: inc ebx test dl, 0001b jnz _6 inc byte ptr [ebx] _6: sub ebx, 2 add ebx, DWORD PTR w test dl, 0110b jnz _7 inc byte ptr [ebx] _7: inc ebx test dl, 0100b jnz _8 inc byte ptr [ebx] _8: inc ebx test dl, 0101b jnz _9 inc byte ptr [ebx] _9: ret incNumber ENDP
user/cat.asm
noyaviv/try
0
4537
user/_cat: file format elf64-littleriscv Disassembly of section .text: 0000000000000000 <cat>: char buf[512]; void cat(int fd) { 0: 7179 addi sp,sp,-48 2: f406 sd ra,40(sp) 4: f022 sd s0,32(sp) 6: ec26 sd s1,24(sp) 8: e84a sd s2,16(sp) a: e44e sd s3,8(sp) c: 1800 addi s0,sp,48 e: 89aa mv s3,a0 int n; while((n = read(fd, buf, sizeof(buf))) > 0) { 10: 00001917 auipc s2,0x1 14: 97890913 addi s2,s2,-1672 # 988 <buf> 18: 20000613 li a2,512 1c: 85ca mv a1,s2 1e: 854e mv a0,s3 20: 00000097 auipc ra,0x0 24: 3e0080e7 jalr 992(ra) # 400 <read> 28: 84aa mv s1,a0 2a: 02a05963 blez a0,5c <cat+0x5c> if (write(1, buf, n) != n) { 2e: 8626 mv a2,s1 30: 85ca mv a1,s2 32: 4505 li a0,1 34: 00000097 auipc ra,0x0 38: 3d4080e7 jalr 980(ra) # 408 <write> 3c: fc950ee3 beq a0,s1,18 <cat+0x18> fprintf(2, "cat: write error\n"); 40: 00001597 auipc a1,0x1 44: 8d858593 addi a1,a1,-1832 # 918 <malloc+0xea> 48: 4509 li a0,2 4a: 00000097 auipc ra,0x0 4e: 6f8080e7 jalr 1784(ra) # 742 <fprintf> exit(1); 52: 4505 li a0,1 54: 00000097 auipc ra,0x0 58: 394080e7 jalr 916(ra) # 3e8 <exit> } } if(n < 0){ 5c: 00054963 bltz a0,6e <cat+0x6e> fprintf(2, "cat: read error\n"); exit(1); } } 60: 70a2 ld ra,40(sp) 62: 7402 ld s0,32(sp) 64: 64e2 ld s1,24(sp) 66: 6942 ld s2,16(sp) 68: 69a2 ld s3,8(sp) 6a: 6145 addi sp,sp,48 6c: 8082 ret fprintf(2, "cat: read error\n"); 6e: 00001597 auipc a1,0x1 72: 8c258593 addi a1,a1,-1854 # 930 <malloc+0x102> 76: 4509 li a0,2 78: 00000097 auipc ra,0x0 7c: 6ca080e7 jalr 1738(ra) # 742 <fprintf> exit(1); 80: 4505 li a0,1 82: 00000097 auipc ra,0x0 86: 366080e7 jalr 870(ra) # 3e8 <exit> 000000000000008a <main>: int main(int argc, char *argv[]) { 8a: 7179 addi sp,sp,-48 8c: f406 sd ra,40(sp) 8e: f022 sd s0,32(sp) 90: ec26 sd s1,24(sp) 92: e84a sd s2,16(sp) 94: e44e sd s3,8(sp) 96: e052 sd s4,0(sp) 98: 1800 addi s0,sp,48 int fd, i; if(argc <= 1){ 9a: 4785 li a5,1 9c: 04a7d763 bge a5,a0,ea <main+0x60> a0: 00858913 addi s2,a1,8 a4: ffe5099b addiw s3,a0,-2 a8: 02099793 slli a5,s3,0x20 ac: 01d7d993 srli s3,a5,0x1d b0: 05c1 addi a1,a1,16 b2: 99ae add s3,s3,a1 cat(0); exit(0); } for(i = 1; i < argc; i++){ if((fd = open(argv[i], 0)) < 0){ b4: 4581 li a1,0 b6: 00093503 ld a0,0(s2) ba: 00000097 auipc ra,0x0 be: 36e080e7 jalr 878(ra) # 428 <open> c2: 84aa mv s1,a0 c4: 02054d63 bltz a0,fe <main+0x74> fprintf(2, "cat: cannot open %s\n", argv[i]); exit(1); } cat(fd); c8: 00000097 auipc ra,0x0 cc: f38080e7 jalr -200(ra) # 0 <cat> close(fd); d0: 8526 mv a0,s1 d2: 00000097 auipc ra,0x0 d6: 33e080e7 jalr 830(ra) # 410 <close> for(i = 1; i < argc; i++){ da: 0921 addi s2,s2,8 dc: fd391ce3 bne s2,s3,b4 <main+0x2a> } exit(0); e0: 4501 li a0,0 e2: 00000097 auipc ra,0x0 e6: 306080e7 jalr 774(ra) # 3e8 <exit> cat(0); ea: 4501 li a0,0 ec: 00000097 auipc ra,0x0 f0: f14080e7 jalr -236(ra) # 0 <cat> exit(0); f4: 4501 li a0,0 f6: 00000097 auipc ra,0x0 fa: 2f2080e7 jalr 754(ra) # 3e8 <exit> fprintf(2, "cat: cannot open %s\n", argv[i]); fe: 00093603 ld a2,0(s2) 102: 00001597 auipc a1,0x1 106: 84658593 addi a1,a1,-1978 # 948 <malloc+0x11a> 10a: 4509 li a0,2 10c: 00000097 auipc ra,0x0 110: 636080e7 jalr 1590(ra) # 742 <fprintf> exit(1); 114: 4505 li a0,1 116: 00000097 auipc ra,0x0 11a: 2d2080e7 jalr 722(ra) # 3e8 <exit> 000000000000011e <strcpy>: #include "kernel/fcntl.h" #include "user/user.h" char* strcpy(char *s, const char *t) { 11e: 1141 addi sp,sp,-16 120: e422 sd s0,8(sp) 122: 0800 addi s0,sp,16 char *os; os = s; while((*s++ = *t++) != 0) 124: 87aa mv a5,a0 126: 0585 addi a1,a1,1 128: 0785 addi a5,a5,1 12a: fff5c703 lbu a4,-1(a1) 12e: fee78fa3 sb a4,-1(a5) 132: fb75 bnez a4,126 <strcpy+0x8> ; return os; } 134: 6422 ld s0,8(sp) 136: 0141 addi sp,sp,16 138: 8082 ret 000000000000013a <strcmp>: int strcmp(const char *p, const char *q) { 13a: 1141 addi sp,sp,-16 13c: e422 sd s0,8(sp) 13e: 0800 addi s0,sp,16 while(*p && *p == *q) 140: 00054783 lbu a5,0(a0) 144: cb91 beqz a5,158 <strcmp+0x1e> 146: 0005c703 lbu a4,0(a1) 14a: 00f71763 bne a4,a5,158 <strcmp+0x1e> p++, q++; 14e: 0505 addi a0,a0,1 150: 0585 addi a1,a1,1 while(*p && *p == *q) 152: 00054783 lbu a5,0(a0) 156: fbe5 bnez a5,146 <strcmp+0xc> return (uchar)*p - (uchar)*q; 158: 0005c503 lbu a0,0(a1) } 15c: 40a7853b subw a0,a5,a0 160: 6422 ld s0,8(sp) 162: 0141 addi sp,sp,16 164: 8082 ret 0000000000000166 <strlen>: uint strlen(const char *s) { 166: 1141 addi sp,sp,-16 168: e422 sd s0,8(sp) 16a: 0800 addi s0,sp,16 int n; for(n = 0; s[n]; n++) 16c: 00054783 lbu a5,0(a0) 170: cf91 beqz a5,18c <strlen+0x26> 172: 0505 addi a0,a0,1 174: 87aa mv a5,a0 176: 4685 li a3,1 178: 9e89 subw a3,a3,a0 17a: 00f6853b addw a0,a3,a5 17e: 0785 addi a5,a5,1 180: fff7c703 lbu a4,-1(a5) 184: fb7d bnez a4,17a <strlen+0x14> ; return n; } 186: 6422 ld s0,8(sp) 188: 0141 addi sp,sp,16 18a: 8082 ret for(n = 0; s[n]; n++) 18c: 4501 li a0,0 18e: bfe5 j 186 <strlen+0x20> 0000000000000190 <memset>: void* memset(void *dst, int c, uint n) { 190: 1141 addi sp,sp,-16 192: e422 sd s0,8(sp) 194: 0800 addi s0,sp,16 char *cdst = (char *) dst; int i; for(i = 0; i < n; i++){ 196: ca19 beqz a2,1ac <memset+0x1c> 198: 87aa mv a5,a0 19a: 1602 slli a2,a2,0x20 19c: 9201 srli a2,a2,0x20 19e: 00a60733 add a4,a2,a0 cdst[i] = c; 1a2: 00b78023 sb a1,0(a5) for(i = 0; i < n; i++){ 1a6: 0785 addi a5,a5,1 1a8: fee79de3 bne a5,a4,1a2 <memset+0x12> } return dst; } 1ac: 6422 ld s0,8(sp) 1ae: 0141 addi sp,sp,16 1b0: 8082 ret 00000000000001b2 <strchr>: char* strchr(const char *s, char c) { 1b2: 1141 addi sp,sp,-16 1b4: e422 sd s0,8(sp) 1b6: 0800 addi s0,sp,16 for(; *s; s++) 1b8: 00054783 lbu a5,0(a0) 1bc: cb99 beqz a5,1d2 <strchr+0x20> if(*s == c) 1be: 00f58763 beq a1,a5,1cc <strchr+0x1a> for(; *s; s++) 1c2: 0505 addi a0,a0,1 1c4: 00054783 lbu a5,0(a0) 1c8: fbfd bnez a5,1be <strchr+0xc> return (char*)s; return 0; 1ca: 4501 li a0,0 } 1cc: 6422 ld s0,8(sp) 1ce: 0141 addi sp,sp,16 1d0: 8082 ret return 0; 1d2: 4501 li a0,0 1d4: bfe5 j 1cc <strchr+0x1a> 00000000000001d6 <gets>: char* gets(char *buf, int max) { 1d6: 711d addi sp,sp,-96 1d8: ec86 sd ra,88(sp) 1da: e8a2 sd s0,80(sp) 1dc: e4a6 sd s1,72(sp) 1de: e0ca sd s2,64(sp) 1e0: fc4e sd s3,56(sp) 1e2: f852 sd s4,48(sp) 1e4: f456 sd s5,40(sp) 1e6: f05a sd s6,32(sp) 1e8: ec5e sd s7,24(sp) 1ea: 1080 addi s0,sp,96 1ec: 8baa mv s7,a0 1ee: 8a2e mv s4,a1 int i, cc; char c; for(i=0; i+1 < max; ){ 1f0: 892a mv s2,a0 1f2: 4481 li s1,0 cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; if(c == '\n' || c == '\r') 1f4: 4aa9 li s5,10 1f6: 4b35 li s6,13 for(i=0; i+1 < max; ){ 1f8: 89a6 mv s3,s1 1fa: 2485 addiw s1,s1,1 1fc: 0344d863 bge s1,s4,22c <gets+0x56> cc = read(0, &c, 1); 200: 4605 li a2,1 202: faf40593 addi a1,s0,-81 206: 4501 li a0,0 208: 00000097 auipc ra,0x0 20c: 1f8080e7 jalr 504(ra) # 400 <read> if(cc < 1) 210: 00a05e63 blez a0,22c <gets+0x56> buf[i++] = c; 214: faf44783 lbu a5,-81(s0) 218: 00f90023 sb a5,0(s2) if(c == '\n' || c == '\r') 21c: 01578763 beq a5,s5,22a <gets+0x54> 220: 0905 addi s2,s2,1 222: fd679be3 bne a5,s6,1f8 <gets+0x22> for(i=0; i+1 < max; ){ 226: 89a6 mv s3,s1 228: a011 j 22c <gets+0x56> 22a: 89a6 mv s3,s1 break; } buf[i] = '\0'; 22c: 99de add s3,s3,s7 22e: 00098023 sb zero,0(s3) return buf; } 232: 855e mv a0,s7 234: 60e6 ld ra,88(sp) 236: 6446 ld s0,80(sp) 238: 64a6 ld s1,72(sp) 23a: 6906 ld s2,64(sp) 23c: 79e2 ld s3,56(sp) 23e: 7a42 ld s4,48(sp) 240: 7aa2 ld s5,40(sp) 242: 7b02 ld s6,32(sp) 244: 6be2 ld s7,24(sp) 246: 6125 addi sp,sp,96 248: 8082 ret 000000000000024a <stat>: int stat(const char *n, struct stat *st) { 24a: 1101 addi sp,sp,-32 24c: ec06 sd ra,24(sp) 24e: e822 sd s0,16(sp) 250: e426 sd s1,8(sp) 252: e04a sd s2,0(sp) 254: 1000 addi s0,sp,32 256: 892e mv s2,a1 int fd; int r; fd = open(n, O_RDONLY); 258: 4581 li a1,0 25a: 00000097 auipc ra,0x0 25e: 1ce080e7 jalr 462(ra) # 428 <open> if(fd < 0) 262: 02054563 bltz a0,28c <stat+0x42> 266: 84aa mv s1,a0 return -1; r = fstat(fd, st); 268: 85ca mv a1,s2 26a: 00000097 auipc ra,0x0 26e: 1d6080e7 jalr 470(ra) # 440 <fstat> 272: 892a mv s2,a0 close(fd); 274: 8526 mv a0,s1 276: 00000097 auipc ra,0x0 27a: 19a080e7 jalr 410(ra) # 410 <close> return r; } 27e: 854a mv a0,s2 280: 60e2 ld ra,24(sp) 282: 6442 ld s0,16(sp) 284: 64a2 ld s1,8(sp) 286: 6902 ld s2,0(sp) 288: 6105 addi sp,sp,32 28a: 8082 ret return -1; 28c: 597d li s2,-1 28e: bfc5 j 27e <stat+0x34> 0000000000000290 <atoi>: int atoi(const char *s) { 290: 1141 addi sp,sp,-16 292: e422 sd s0,8(sp) 294: 0800 addi s0,sp,16 int n; n = 0; while('0' <= *s && *s <= '9') 296: 00054603 lbu a2,0(a0) 29a: fd06079b addiw a5,a2,-48 29e: 0ff7f793 andi a5,a5,255 2a2: 4725 li a4,9 2a4: 02f76963 bltu a4,a5,2d6 <atoi+0x46> 2a8: 86aa mv a3,a0 n = 0; 2aa: 4501 li a0,0 while('0' <= *s && *s <= '9') 2ac: 45a5 li a1,9 n = n*10 + *s++ - '0'; 2ae: 0685 addi a3,a3,1 2b0: 0025179b slliw a5,a0,0x2 2b4: 9fa9 addw a5,a5,a0 2b6: 0017979b slliw a5,a5,0x1 2ba: 9fb1 addw a5,a5,a2 2bc: fd07851b addiw a0,a5,-48 while('0' <= *s && *s <= '9') 2c0: 0006c603 lbu a2,0(a3) 2c4: fd06071b addiw a4,a2,-48 2c8: 0ff77713 andi a4,a4,255 2cc: fee5f1e3 bgeu a1,a4,2ae <atoi+0x1e> return n; } 2d0: 6422 ld s0,8(sp) 2d2: 0141 addi sp,sp,16 2d4: 8082 ret n = 0; 2d6: 4501 li a0,0 2d8: bfe5 j 2d0 <atoi+0x40> 00000000000002da <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 2da: 1141 addi sp,sp,-16 2dc: e422 sd s0,8(sp) 2de: 0800 addi s0,sp,16 char *dst; const char *src; dst = vdst; src = vsrc; if (src > dst) { 2e0: 02b57463 bgeu a0,a1,308 <memmove+0x2e> while(n-- > 0) 2e4: 00c05f63 blez a2,302 <memmove+0x28> 2e8: 1602 slli a2,a2,0x20 2ea: 9201 srli a2,a2,0x20 2ec: 00c507b3 add a5,a0,a2 dst = vdst; 2f0: 872a mv a4,a0 *dst++ = *src++; 2f2: 0585 addi a1,a1,1 2f4: 0705 addi a4,a4,1 2f6: fff5c683 lbu a3,-1(a1) 2fa: fed70fa3 sb a3,-1(a4) while(n-- > 0) 2fe: fee79ae3 bne a5,a4,2f2 <memmove+0x18> src += n; while(n-- > 0) *--dst = *--src; } return vdst; } 302: 6422 ld s0,8(sp) 304: 0141 addi sp,sp,16 306: 8082 ret dst += n; 308: 00c50733 add a4,a0,a2 src += n; 30c: 95b2 add a1,a1,a2 while(n-- > 0) 30e: fec05ae3 blez a2,302 <memmove+0x28> 312: fff6079b addiw a5,a2,-1 316: 1782 slli a5,a5,0x20 318: 9381 srli a5,a5,0x20 31a: fff7c793 not a5,a5 31e: 97ba add a5,a5,a4 *--dst = *--src; 320: 15fd addi a1,a1,-1 322: 177d addi a4,a4,-1 324: 0005c683 lbu a3,0(a1) 328: 00d70023 sb a3,0(a4) while(n-- > 0) 32c: fee79ae3 bne a5,a4,320 <memmove+0x46> 330: bfc9 j 302 <memmove+0x28> 0000000000000332 <memcmp>: int memcmp(const void *s1, const void *s2, uint n) { 332: 1141 addi sp,sp,-16 334: e422 sd s0,8(sp) 336: 0800 addi s0,sp,16 const char *p1 = s1, *p2 = s2; while (n-- > 0) { 338: ca05 beqz a2,368 <memcmp+0x36> 33a: fff6069b addiw a3,a2,-1 33e: 1682 slli a3,a3,0x20 340: 9281 srli a3,a3,0x20 342: 0685 addi a3,a3,1 344: 96aa add a3,a3,a0 if (*p1 != *p2) { 346: 00054783 lbu a5,0(a0) 34a: 0005c703 lbu a4,0(a1) 34e: 00e79863 bne a5,a4,35e <memcmp+0x2c> return *p1 - *p2; } p1++; 352: 0505 addi a0,a0,1 p2++; 354: 0585 addi a1,a1,1 while (n-- > 0) { 356: fed518e3 bne a0,a3,346 <memcmp+0x14> } return 0; 35a: 4501 li a0,0 35c: a019 j 362 <memcmp+0x30> return *p1 - *p2; 35e: 40e7853b subw a0,a5,a4 } 362: 6422 ld s0,8(sp) 364: 0141 addi sp,sp,16 366: 8082 ret return 0; 368: 4501 li a0,0 36a: bfe5 j 362 <memcmp+0x30> 000000000000036c <memcpy>: void * memcpy(void *dst, const void *src, uint n) { 36c: 1141 addi sp,sp,-16 36e: e406 sd ra,8(sp) 370: e022 sd s0,0(sp) 372: 0800 addi s0,sp,16 return memmove(dst, src, n); 374: 00000097 auipc ra,0x0 378: f66080e7 jalr -154(ra) # 2da <memmove> } 37c: 60a2 ld ra,8(sp) 37e: 6402 ld s0,0(sp) 380: 0141 addi sp,sp,16 382: 8082 ret 0000000000000384 <my_strcat>: // functions added by us char* my_strcat(char* destination, const char* source) { 384: 1141 addi sp,sp,-16 386: e422 sd s0,8(sp) 388: 0800 addi s0,sp,16 int i, j; // move to the end of destination string for (i = 0; destination[i] != '\0'; i++); 38a: 00054783 lbu a5,0(a0) 38e: c7a9 beqz a5,3d8 <my_strcat+0x54> 390: 00150713 addi a4,a0,1 394: 87ba mv a5,a4 396: 4685 li a3,1 398: 9e99 subw a3,a3,a4 39a: 00f6863b addw a2,a3,a5 39e: 0785 addi a5,a5,1 3a0: fff7c703 lbu a4,-1(a5) 3a4: fb7d bnez a4,39a <my_strcat+0x16> // i now points to terminating null character in destination // Appends characters of source to the destination string for (j = 0; source[j] != '\0'; j++) 3a6: 0005c683 lbu a3,0(a1) 3aa: ca8d beqz a3,3dc <my_strcat+0x58> 3ac: 4785 li a5,1 destination[i + j] = source[j]; 3ae: 00f60733 add a4,a2,a5 3b2: 972a add a4,a4,a0 3b4: fed70fa3 sb a3,-1(a4) for (j = 0; source[j] != '\0'; j++) 3b8: 0007881b sext.w a6,a5 3bc: 0785 addi a5,a5,1 3be: 00f58733 add a4,a1,a5 3c2: fff74683 lbu a3,-1(a4) 3c6: f6e5 bnez a3,3ae <my_strcat+0x2a> // null terminate destination string destination[i + j] = '\0'; 3c8: 0106063b addw a2,a2,a6 3cc: 962a add a2,a2,a0 3ce: 00060023 sb zero,0(a2) // destination is returned by standard strcat() return destination; 3d2: 6422 ld s0,8(sp) 3d4: 0141 addi sp,sp,16 3d6: 8082 ret for (i = 0; destination[i] != '\0'; i++); 3d8: 4601 li a2,0 3da: b7f1 j 3a6 <my_strcat+0x22> for (j = 0; source[j] != '\0'; j++) 3dc: 4801 li a6,0 3de: b7ed j 3c8 <my_strcat+0x44> 00000000000003e0 <fork>: # generated by usys.pl - do not edit #include "kernel/syscall.h" .global fork fork: li a7, SYS_fork 3e0: 4885 li a7,1 ecall 3e2: 00000073 ecall ret 3e6: 8082 ret 00000000000003e8 <exit>: .global exit exit: li a7, SYS_exit 3e8: 4889 li a7,2 ecall 3ea: 00000073 ecall ret 3ee: 8082 ret 00000000000003f0 <wait>: .global wait wait: li a7, SYS_wait 3f0: 488d li a7,3 ecall 3f2: 00000073 ecall ret 3f6: 8082 ret 00000000000003f8 <pipe>: .global pipe pipe: li a7, SYS_pipe 3f8: 4891 li a7,4 ecall 3fa: 00000073 ecall ret 3fe: 8082 ret 0000000000000400 <read>: .global read read: li a7, SYS_read 400: 4895 li a7,5 ecall 402: 00000073 ecall ret 406: 8082 ret 0000000000000408 <write>: .global write write: li a7, SYS_write 408: 48c1 li a7,16 ecall 40a: 00000073 ecall ret 40e: 8082 ret 0000000000000410 <close>: .global close close: li a7, SYS_close 410: 48d5 li a7,21 ecall 412: 00000073 ecall ret 416: 8082 ret 0000000000000418 <kill>: .global kill kill: li a7, SYS_kill 418: 4899 li a7,6 ecall 41a: 00000073 ecall ret 41e: 8082 ret 0000000000000420 <exec>: .global exec exec: li a7, SYS_exec 420: 489d li a7,7 ecall 422: 00000073 ecall ret 426: 8082 ret 0000000000000428 <open>: .global open open: li a7, SYS_open 428: 48bd li a7,15 ecall 42a: 00000073 ecall ret 42e: 8082 ret 0000000000000430 <mknod>: .global mknod mknod: li a7, SYS_mknod 430: 48c5 li a7,17 ecall 432: 00000073 ecall ret 436: 8082 ret 0000000000000438 <unlink>: .global unlink unlink: li a7, SYS_unlink 438: 48c9 li a7,18 ecall 43a: 00000073 ecall ret 43e: 8082 ret 0000000000000440 <fstat>: .global fstat fstat: li a7, SYS_fstat 440: 48a1 li a7,8 ecall 442: 00000073 ecall ret 446: 8082 ret 0000000000000448 <link>: .global link link: li a7, SYS_link 448: 48cd li a7,19 ecall 44a: 00000073 ecall ret 44e: 8082 ret 0000000000000450 <mkdir>: .global mkdir mkdir: li a7, SYS_mkdir 450: 48d1 li a7,20 ecall 452: 00000073 ecall ret 456: 8082 ret 0000000000000458 <chdir>: .global chdir chdir: li a7, SYS_chdir 458: 48a5 li a7,9 ecall 45a: 00000073 ecall ret 45e: 8082 ret 0000000000000460 <dup>: .global dup dup: li a7, SYS_dup 460: 48a9 li a7,10 ecall 462: 00000073 ecall ret 466: 8082 ret 0000000000000468 <getpid>: .global getpid getpid: li a7, SYS_getpid 468: 48ad li a7,11 ecall 46a: 00000073 ecall ret 46e: 8082 ret 0000000000000470 <sbrk>: .global sbrk sbrk: li a7, SYS_sbrk 470: 48b1 li a7,12 ecall 472: 00000073 ecall ret 476: 8082 ret 0000000000000478 <sleep>: .global sleep sleep: li a7, SYS_sleep 478: 48b5 li a7,13 ecall 47a: 00000073 ecall ret 47e: 8082 ret 0000000000000480 <uptime>: .global uptime uptime: li a7, SYS_uptime 480: 48b9 li a7,14 ecall 482: 00000073 ecall ret 486: 8082 ret 0000000000000488 <trace>: .global trace trace: li a7, SYS_trace 488: 48d9 li a7,22 ecall 48a: 00000073 ecall ret 48e: 8082 ret 0000000000000490 <wait_stat>: .global wait_stat wait_stat: li a7, SYS_wait_stat 490: 48dd li a7,23 ecall 492: 00000073 ecall ret 496: 8082 ret 0000000000000498 <putc>: static char digits[] = "0123456789ABCDEF"; static void putc(int fd, char c) { 498: 1101 addi sp,sp,-32 49a: ec06 sd ra,24(sp) 49c: e822 sd s0,16(sp) 49e: 1000 addi s0,sp,32 4a0: feb407a3 sb a1,-17(s0) write(fd, &c, 1); 4a4: 4605 li a2,1 4a6: fef40593 addi a1,s0,-17 4aa: 00000097 auipc ra,0x0 4ae: f5e080e7 jalr -162(ra) # 408 <write> } 4b2: 60e2 ld ra,24(sp) 4b4: 6442 ld s0,16(sp) 4b6: 6105 addi sp,sp,32 4b8: 8082 ret 00000000000004ba <printint>: static void printint(int fd, int xx, int base, int sgn) { 4ba: 7139 addi sp,sp,-64 4bc: fc06 sd ra,56(sp) 4be: f822 sd s0,48(sp) 4c0: f426 sd s1,40(sp) 4c2: f04a sd s2,32(sp) 4c4: ec4e sd s3,24(sp) 4c6: 0080 addi s0,sp,64 4c8: 84aa mv s1,a0 char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 4ca: c299 beqz a3,4d0 <printint+0x16> 4cc: 0805c863 bltz a1,55c <printint+0xa2> neg = 1; x = -xx; } else { x = xx; 4d0: 2581 sext.w a1,a1 neg = 0; 4d2: 4881 li a7,0 4d4: fc040693 addi a3,s0,-64 } i = 0; 4d8: 4701 li a4,0 do{ buf[i++] = digits[x % base]; 4da: 2601 sext.w a2,a2 4dc: 00000517 auipc a0,0x0 4e0: 48c50513 addi a0,a0,1164 # 968 <digits> 4e4: 883a mv a6,a4 4e6: 2705 addiw a4,a4,1 4e8: 02c5f7bb remuw a5,a1,a2 4ec: 1782 slli a5,a5,0x20 4ee: 9381 srli a5,a5,0x20 4f0: 97aa add a5,a5,a0 4f2: 0007c783 lbu a5,0(a5) 4f6: 00f68023 sb a5,0(a3) }while((x /= base) != 0); 4fa: 0005879b sext.w a5,a1 4fe: 02c5d5bb divuw a1,a1,a2 502: 0685 addi a3,a3,1 504: fec7f0e3 bgeu a5,a2,4e4 <printint+0x2a> if(neg) 508: 00088b63 beqz a7,51e <printint+0x64> buf[i++] = '-'; 50c: fd040793 addi a5,s0,-48 510: 973e add a4,a4,a5 512: 02d00793 li a5,45 516: fef70823 sb a5,-16(a4) 51a: 0028071b addiw a4,a6,2 while(--i >= 0) 51e: 02e05863 blez a4,54e <printint+0x94> 522: fc040793 addi a5,s0,-64 526: 00e78933 add s2,a5,a4 52a: fff78993 addi s3,a5,-1 52e: 99ba add s3,s3,a4 530: 377d addiw a4,a4,-1 532: 1702 slli a4,a4,0x20 534: 9301 srli a4,a4,0x20 536: 40e989b3 sub s3,s3,a4 putc(fd, buf[i]); 53a: fff94583 lbu a1,-1(s2) 53e: 8526 mv a0,s1 540: 00000097 auipc ra,0x0 544: f58080e7 jalr -168(ra) # 498 <putc> while(--i >= 0) 548: 197d addi s2,s2,-1 54a: ff3918e3 bne s2,s3,53a <printint+0x80> } 54e: 70e2 ld ra,56(sp) 550: 7442 ld s0,48(sp) 552: 74a2 ld s1,40(sp) 554: 7902 ld s2,32(sp) 556: 69e2 ld s3,24(sp) 558: 6121 addi sp,sp,64 55a: 8082 ret x = -xx; 55c: 40b005bb negw a1,a1 neg = 1; 560: 4885 li a7,1 x = -xx; 562: bf8d j 4d4 <printint+0x1a> 0000000000000564 <vprintf>: } // Print to the given fd. Only understands %d, %x, %p, %s. void vprintf(int fd, const char *fmt, va_list ap) { 564: 7119 addi sp,sp,-128 566: fc86 sd ra,120(sp) 568: f8a2 sd s0,112(sp) 56a: f4a6 sd s1,104(sp) 56c: f0ca sd s2,96(sp) 56e: ecce sd s3,88(sp) 570: e8d2 sd s4,80(sp) 572: e4d6 sd s5,72(sp) 574: e0da sd s6,64(sp) 576: fc5e sd s7,56(sp) 578: f862 sd s8,48(sp) 57a: f466 sd s9,40(sp) 57c: f06a sd s10,32(sp) 57e: ec6e sd s11,24(sp) 580: 0100 addi s0,sp,128 char *s; int c, i, state; state = 0; for(i = 0; fmt[i]; i++){ 582: 0005c903 lbu s2,0(a1) 586: 18090f63 beqz s2,724 <vprintf+0x1c0> 58a: 8aaa mv s5,a0 58c: 8b32 mv s6,a2 58e: 00158493 addi s1,a1,1 state = 0; 592: 4981 li s3,0 if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 594: 02500a13 li s4,37 if(c == 'd'){ 598: 06400c13 li s8,100 printint(fd, va_arg(ap, int), 10, 1); } else if(c == 'l') { 59c: 06c00c93 li s9,108 printint(fd, va_arg(ap, uint64), 10, 0); } else if(c == 'x') { 5a0: 07800d13 li s10,120 printint(fd, va_arg(ap, int), 16, 0); } else if(c == 'p') { 5a4: 07000d93 li s11,112 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 5a8: 00000b97 auipc s7,0x0 5ac: 3c0b8b93 addi s7,s7,960 # 968 <digits> 5b0: a839 j 5ce <vprintf+0x6a> putc(fd, c); 5b2: 85ca mv a1,s2 5b4: 8556 mv a0,s5 5b6: 00000097 auipc ra,0x0 5ba: ee2080e7 jalr -286(ra) # 498 <putc> 5be: a019 j 5c4 <vprintf+0x60> } else if(state == '%'){ 5c0: 01498f63 beq s3,s4,5de <vprintf+0x7a> for(i = 0; fmt[i]; i++){ 5c4: 0485 addi s1,s1,1 5c6: fff4c903 lbu s2,-1(s1) 5ca: 14090d63 beqz s2,724 <vprintf+0x1c0> c = fmt[i] & 0xff; 5ce: 0009079b sext.w a5,s2 if(state == 0){ 5d2: fe0997e3 bnez s3,5c0 <vprintf+0x5c> if(c == '%'){ 5d6: fd479ee3 bne a5,s4,5b2 <vprintf+0x4e> state = '%'; 5da: 89be mv s3,a5 5dc: b7e5 j 5c4 <vprintf+0x60> if(c == 'd'){ 5de: 05878063 beq a5,s8,61e <vprintf+0xba> } else if(c == 'l') { 5e2: 05978c63 beq a5,s9,63a <vprintf+0xd6> } else if(c == 'x') { 5e6: 07a78863 beq a5,s10,656 <vprintf+0xf2> } else if(c == 'p') { 5ea: 09b78463 beq a5,s11,672 <vprintf+0x10e> printptr(fd, va_arg(ap, uint64)); } else if(c == 's'){ 5ee: 07300713 li a4,115 5f2: 0ce78663 beq a5,a4,6be <vprintf+0x15a> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 5f6: 06300713 li a4,99 5fa: 0ee78e63 beq a5,a4,6f6 <vprintf+0x192> putc(fd, va_arg(ap, uint)); } else if(c == '%'){ 5fe: 11478863 beq a5,s4,70e <vprintf+0x1aa> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 602: 85d2 mv a1,s4 604: 8556 mv a0,s5 606: 00000097 auipc ra,0x0 60a: e92080e7 jalr -366(ra) # 498 <putc> putc(fd, c); 60e: 85ca mv a1,s2 610: 8556 mv a0,s5 612: 00000097 auipc ra,0x0 616: e86080e7 jalr -378(ra) # 498 <putc> } state = 0; 61a: 4981 li s3,0 61c: b765 j 5c4 <vprintf+0x60> printint(fd, va_arg(ap, int), 10, 1); 61e: 008b0913 addi s2,s6,8 622: 4685 li a3,1 624: 4629 li a2,10 626: 000b2583 lw a1,0(s6) 62a: 8556 mv a0,s5 62c: 00000097 auipc ra,0x0 630: e8e080e7 jalr -370(ra) # 4ba <printint> 634: 8b4a mv s6,s2 state = 0; 636: 4981 li s3,0 638: b771 j 5c4 <vprintf+0x60> printint(fd, va_arg(ap, uint64), 10, 0); 63a: 008b0913 addi s2,s6,8 63e: 4681 li a3,0 640: 4629 li a2,10 642: 000b2583 lw a1,0(s6) 646: 8556 mv a0,s5 648: 00000097 auipc ra,0x0 64c: e72080e7 jalr -398(ra) # 4ba <printint> 650: 8b4a mv s6,s2 state = 0; 652: 4981 li s3,0 654: bf85 j 5c4 <vprintf+0x60> printint(fd, va_arg(ap, int), 16, 0); 656: 008b0913 addi s2,s6,8 65a: 4681 li a3,0 65c: 4641 li a2,16 65e: 000b2583 lw a1,0(s6) 662: 8556 mv a0,s5 664: 00000097 auipc ra,0x0 668: e56080e7 jalr -426(ra) # 4ba <printint> 66c: 8b4a mv s6,s2 state = 0; 66e: 4981 li s3,0 670: bf91 j 5c4 <vprintf+0x60> printptr(fd, va_arg(ap, uint64)); 672: 008b0793 addi a5,s6,8 676: f8f43423 sd a5,-120(s0) 67a: 000b3983 ld s3,0(s6) putc(fd, '0'); 67e: 03000593 li a1,48 682: 8556 mv a0,s5 684: 00000097 auipc ra,0x0 688: e14080e7 jalr -492(ra) # 498 <putc> putc(fd, 'x'); 68c: 85ea mv a1,s10 68e: 8556 mv a0,s5 690: 00000097 auipc ra,0x0 694: e08080e7 jalr -504(ra) # 498 <putc> 698: 4941 li s2,16 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 69a: 03c9d793 srli a5,s3,0x3c 69e: 97de add a5,a5,s7 6a0: 0007c583 lbu a1,0(a5) 6a4: 8556 mv a0,s5 6a6: 00000097 auipc ra,0x0 6aa: df2080e7 jalr -526(ra) # 498 <putc> for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) 6ae: 0992 slli s3,s3,0x4 6b0: 397d addiw s2,s2,-1 6b2: fe0914e3 bnez s2,69a <vprintf+0x136> printptr(fd, va_arg(ap, uint64)); 6b6: f8843b03 ld s6,-120(s0) state = 0; 6ba: 4981 li s3,0 6bc: b721 j 5c4 <vprintf+0x60> s = va_arg(ap, char*); 6be: 008b0993 addi s3,s6,8 6c2: 000b3903 ld s2,0(s6) if(s == 0) 6c6: 02090163 beqz s2,6e8 <vprintf+0x184> while(*s != 0){ 6ca: 00094583 lbu a1,0(s2) 6ce: c9a1 beqz a1,71e <vprintf+0x1ba> putc(fd, *s); 6d0: 8556 mv a0,s5 6d2: 00000097 auipc ra,0x0 6d6: dc6080e7 jalr -570(ra) # 498 <putc> s++; 6da: 0905 addi s2,s2,1 while(*s != 0){ 6dc: 00094583 lbu a1,0(s2) 6e0: f9e5 bnez a1,6d0 <vprintf+0x16c> s = va_arg(ap, char*); 6e2: 8b4e mv s6,s3 state = 0; 6e4: 4981 li s3,0 6e6: bdf9 j 5c4 <vprintf+0x60> s = "(null)"; 6e8: 00000917 auipc s2,0x0 6ec: 27890913 addi s2,s2,632 # 960 <malloc+0x132> while(*s != 0){ 6f0: 02800593 li a1,40 6f4: bff1 j 6d0 <vprintf+0x16c> putc(fd, va_arg(ap, uint)); 6f6: 008b0913 addi s2,s6,8 6fa: 000b4583 lbu a1,0(s6) 6fe: 8556 mv a0,s5 700: 00000097 auipc ra,0x0 704: d98080e7 jalr -616(ra) # 498 <putc> 708: 8b4a mv s6,s2 state = 0; 70a: 4981 li s3,0 70c: bd65 j 5c4 <vprintf+0x60> putc(fd, c); 70e: 85d2 mv a1,s4 710: 8556 mv a0,s5 712: 00000097 auipc ra,0x0 716: d86080e7 jalr -634(ra) # 498 <putc> state = 0; 71a: 4981 li s3,0 71c: b565 j 5c4 <vprintf+0x60> s = va_arg(ap, char*); 71e: 8b4e mv s6,s3 state = 0; 720: 4981 li s3,0 722: b54d j 5c4 <vprintf+0x60> } } } 724: 70e6 ld ra,120(sp) 726: 7446 ld s0,112(sp) 728: 74a6 ld s1,104(sp) 72a: 7906 ld s2,96(sp) 72c: 69e6 ld s3,88(sp) 72e: 6a46 ld s4,80(sp) 730: 6aa6 ld s5,72(sp) 732: 6b06 ld s6,64(sp) 734: 7be2 ld s7,56(sp) 736: 7c42 ld s8,48(sp) 738: 7ca2 ld s9,40(sp) 73a: 7d02 ld s10,32(sp) 73c: 6de2 ld s11,24(sp) 73e: 6109 addi sp,sp,128 740: 8082 ret 0000000000000742 <fprintf>: void fprintf(int fd, const char *fmt, ...) { 742: 715d addi sp,sp,-80 744: ec06 sd ra,24(sp) 746: e822 sd s0,16(sp) 748: 1000 addi s0,sp,32 74a: e010 sd a2,0(s0) 74c: e414 sd a3,8(s0) 74e: e818 sd a4,16(s0) 750: ec1c sd a5,24(s0) 752: 03043023 sd a6,32(s0) 756: 03143423 sd a7,40(s0) va_list ap; va_start(ap, fmt); 75a: fe843423 sd s0,-24(s0) vprintf(fd, fmt, ap); 75e: 8622 mv a2,s0 760: 00000097 auipc ra,0x0 764: e04080e7 jalr -508(ra) # 564 <vprintf> } 768: 60e2 ld ra,24(sp) 76a: 6442 ld s0,16(sp) 76c: 6161 addi sp,sp,80 76e: 8082 ret 0000000000000770 <printf>: void printf(const char *fmt, ...) { 770: 711d addi sp,sp,-96 772: ec06 sd ra,24(sp) 774: e822 sd s0,16(sp) 776: 1000 addi s0,sp,32 778: e40c sd a1,8(s0) 77a: e810 sd a2,16(s0) 77c: ec14 sd a3,24(s0) 77e: f018 sd a4,32(s0) 780: f41c sd a5,40(s0) 782: 03043823 sd a6,48(s0) 786: 03143c23 sd a7,56(s0) va_list ap; va_start(ap, fmt); 78a: 00840613 addi a2,s0,8 78e: fec43423 sd a2,-24(s0) vprintf(1, fmt, ap); 792: 85aa mv a1,a0 794: 4505 li a0,1 796: 00000097 auipc ra,0x0 79a: dce080e7 jalr -562(ra) # 564 <vprintf> } 79e: 60e2 ld ra,24(sp) 7a0: 6442 ld s0,16(sp) 7a2: 6125 addi sp,sp,96 7a4: 8082 ret 00000000000007a6 <free>: static Header base; static Header *freep; void free(void *ap) { 7a6: 1141 addi sp,sp,-16 7a8: e422 sd s0,8(sp) 7aa: 0800 addi s0,sp,16 Header *bp, *p; bp = (Header*)ap - 1; 7ac: ff050693 addi a3,a0,-16 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 7b0: 00000797 auipc a5,0x0 7b4: 1d07b783 ld a5,464(a5) # 980 <freep> 7b8: a805 j 7e8 <free+0x42> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ bp->s.size += p->s.ptr->s.size; 7ba: 4618 lw a4,8(a2) 7bc: 9db9 addw a1,a1,a4 7be: feb52c23 sw a1,-8(a0) bp->s.ptr = p->s.ptr->s.ptr; 7c2: 6398 ld a4,0(a5) 7c4: 6318 ld a4,0(a4) 7c6: fee53823 sd a4,-16(a0) 7ca: a091 j 80e <free+0x68> } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ p->s.size += bp->s.size; 7cc: ff852703 lw a4,-8(a0) 7d0: 9e39 addw a2,a2,a4 7d2: c790 sw a2,8(a5) p->s.ptr = bp->s.ptr; 7d4: ff053703 ld a4,-16(a0) 7d8: e398 sd a4,0(a5) 7da: a099 j 820 <free+0x7a> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 7dc: 6398 ld a4,0(a5) 7de: 00e7e463 bltu a5,a4,7e6 <free+0x40> 7e2: 00e6ea63 bltu a3,a4,7f6 <free+0x50> { 7e6: 87ba mv a5,a4 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 7e8: fed7fae3 bgeu a5,a3,7dc <free+0x36> 7ec: 6398 ld a4,0(a5) 7ee: 00e6e463 bltu a3,a4,7f6 <free+0x50> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 7f2: fee7eae3 bltu a5,a4,7e6 <free+0x40> if(bp + bp->s.size == p->s.ptr){ 7f6: ff852583 lw a1,-8(a0) 7fa: 6390 ld a2,0(a5) 7fc: 02059813 slli a6,a1,0x20 800: 01c85713 srli a4,a6,0x1c 804: 9736 add a4,a4,a3 806: fae60ae3 beq a2,a4,7ba <free+0x14> bp->s.ptr = p->s.ptr; 80a: fec53823 sd a2,-16(a0) if(p + p->s.size == bp){ 80e: 4790 lw a2,8(a5) 810: 02061593 slli a1,a2,0x20 814: 01c5d713 srli a4,a1,0x1c 818: 973e add a4,a4,a5 81a: fae689e3 beq a3,a4,7cc <free+0x26> } else p->s.ptr = bp; 81e: e394 sd a3,0(a5) freep = p; 820: 00000717 auipc a4,0x0 824: 16f73023 sd a5,352(a4) # 980 <freep> } 828: 6422 ld s0,8(sp) 82a: 0141 addi sp,sp,16 82c: 8082 ret 000000000000082e <malloc>: return freep; } void* malloc(uint nbytes) { 82e: 7139 addi sp,sp,-64 830: fc06 sd ra,56(sp) 832: f822 sd s0,48(sp) 834: f426 sd s1,40(sp) 836: f04a sd s2,32(sp) 838: ec4e sd s3,24(sp) 83a: e852 sd s4,16(sp) 83c: e456 sd s5,8(sp) 83e: e05a sd s6,0(sp) 840: 0080 addi s0,sp,64 Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 842: 02051493 slli s1,a0,0x20 846: 9081 srli s1,s1,0x20 848: 04bd addi s1,s1,15 84a: 8091 srli s1,s1,0x4 84c: 0014899b addiw s3,s1,1 850: 0485 addi s1,s1,1 if((prevp = freep) == 0){ 852: 00000517 auipc a0,0x0 856: 12e53503 ld a0,302(a0) # 980 <freep> 85a: c515 beqz a0,886 <malloc+0x58> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 85c: 611c ld a5,0(a0) if(p->s.size >= nunits){ 85e: 4798 lw a4,8(a5) 860: 02977f63 bgeu a4,s1,89e <malloc+0x70> 864: 8a4e mv s4,s3 866: 0009871b sext.w a4,s3 86a: 6685 lui a3,0x1 86c: 00d77363 bgeu a4,a3,872 <malloc+0x44> 870: 6a05 lui s4,0x1 872: 000a0b1b sext.w s6,s4 p = sbrk(nu * sizeof(Header)); 876: 004a1a1b slliw s4,s4,0x4 p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 87a: 00000917 auipc s2,0x0 87e: 10690913 addi s2,s2,262 # 980 <freep> if(p == (char*)-1) 882: 5afd li s5,-1 884: a895 j 8f8 <malloc+0xca> base.s.ptr = freep = prevp = &base; 886: 00000797 auipc a5,0x0 88a: 30278793 addi a5,a5,770 # b88 <base> 88e: 00000717 auipc a4,0x0 892: 0ef73923 sd a5,242(a4) # 980 <freep> 896: e39c sd a5,0(a5) base.s.size = 0; 898: 0007a423 sw zero,8(a5) if(p->s.size >= nunits){ 89c: b7e1 j 864 <malloc+0x36> if(p->s.size == nunits) 89e: 02e48c63 beq s1,a4,8d6 <malloc+0xa8> p->s.size -= nunits; 8a2: 4137073b subw a4,a4,s3 8a6: c798 sw a4,8(a5) p += p->s.size; 8a8: 02071693 slli a3,a4,0x20 8ac: 01c6d713 srli a4,a3,0x1c 8b0: 97ba add a5,a5,a4 p->s.size = nunits; 8b2: 0137a423 sw s3,8(a5) freep = prevp; 8b6: 00000717 auipc a4,0x0 8ba: 0ca73523 sd a0,202(a4) # 980 <freep> return (void*)(p + 1); 8be: 01078513 addi a0,a5,16 if((p = morecore(nunits)) == 0) return 0; } } 8c2: 70e2 ld ra,56(sp) 8c4: 7442 ld s0,48(sp) 8c6: 74a2 ld s1,40(sp) 8c8: 7902 ld s2,32(sp) 8ca: 69e2 ld s3,24(sp) 8cc: 6a42 ld s4,16(sp) 8ce: 6aa2 ld s5,8(sp) 8d0: 6b02 ld s6,0(sp) 8d2: 6121 addi sp,sp,64 8d4: 8082 ret prevp->s.ptr = p->s.ptr; 8d6: 6398 ld a4,0(a5) 8d8: e118 sd a4,0(a0) 8da: bff1 j 8b6 <malloc+0x88> hp->s.size = nu; 8dc: 01652423 sw s6,8(a0) free((void*)(hp + 1)); 8e0: 0541 addi a0,a0,16 8e2: 00000097 auipc ra,0x0 8e6: ec4080e7 jalr -316(ra) # 7a6 <free> return freep; 8ea: 00093503 ld a0,0(s2) if((p = morecore(nunits)) == 0) 8ee: d971 beqz a0,8c2 <malloc+0x94> for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 8f0: 611c ld a5,0(a0) if(p->s.size >= nunits){ 8f2: 4798 lw a4,8(a5) 8f4: fa9775e3 bgeu a4,s1,89e <malloc+0x70> if(p == freep) 8f8: 00093703 ld a4,0(s2) 8fc: 853e mv a0,a5 8fe: fef719e3 bne a4,a5,8f0 <malloc+0xc2> p = sbrk(nu * sizeof(Header)); 902: 8552 mv a0,s4 904: 00000097 auipc ra,0x0 908: b6c080e7 jalr -1172(ra) # 470 <sbrk> if(p == (char*)-1) 90c: fd5518e3 bne a0,s5,8dc <malloc+0xae> return 0; 910: 4501 li a0,0 912: bf45 j 8c2 <malloc+0x94>
Vba.Language/Vba.Grammars/VbaLexer.g4
rossknudsen/Vba.Language
20
2715
<filename>Vba.Language/Vba.Grammars/VbaLexer.g4 lexer grammar VbaLexer; // 3.3.2 Number Tokens IntegerLiteral : DecimalLiteral | HexIntegerLiteral | OctalIntegerLiteral ; FloatLiteral : Sign? [0-9]+ '.' [0-9]* Exponent Sign? DecimalDigits+ FloatSuffix? | Sign? DecimalDigits Exponent Sign? DecimalDigits+ FloatSuffix? | Sign? [0-9]+ '.' [0-9]* FloatSuffix? | Sign? DecimalDigits FloatSuffix // No decimal or exponent. Suffix required. ; fragment DecimalLiteral : Sign? DecimalDigits IntegerSuffix?; fragment HexIntegerLiteral : Sign? '&' [Hh] [1-9A-Fa-f] [0-9A-Fa-f]* IntegerSuffix?; fragment OctalIntegerLiteral : Sign? '&' [Oo] [1-7] [0-7]* IntegerSuffix?; fragment IntegerSuffix : '%' // Integer 16 bit signed (default) | '&' // Long 32 bit signed | '^' // LongLong 64bit signed ; fragment DecimalDigits : [0-9]+; fragment Exponent : [DdEe]; fragment Sign : '+' | '-'; fragment FloatSuffix : '!' // Single | '#' // Double (default) | '@' // Currency ; // 3.3.3 Date Tokens // The specification allows for a wider range of date expressions than what the VBE // supports. At this stage we are limiting the options to what is supported by the VBE. DateLiteral : '#' DateOrTime '#'; fragment DateOrTime : (DateValue TimeValue) | DateValue | TimeValue ; fragment DateValue : DateComponent DateSeparator DateComponent DateSeparator DateComponent; fragment DateComponent : DecimalLiteral;// | MonthName; fragment DateSeparator : '/';// | '-' | ','; fragment MonthName : EnglishMonthName | EnglishMonthAbbreviation ; fragment EnglishMonthName : 'january' | 'february' | 'march' | 'april' | 'may' | 'june' | 'august' | 'september' | 'october' | 'november' | 'december' ; fragment EnglishMonthAbbreviation : 'jan' | 'feb' | 'mar' | 'apr' | 'jun' | 'jul' | 'aug' | 'sep' | 'oct' | 'nov' | 'dec' ; fragment TimeValue : (DecimalLiteral TimeSeparator DecimalLiteral TimeSeparator DecimalLiteral AmPm); /*| (DecimalLiteral AmPm) ;*/ fragment TimeSeparator : ':';// | '.'; fragment AmPm : 'am' | 'pm';/* | 'a' | 'p' ;*/ // 3.3.4 String Tokens StringLiteral : '"' (~["\r\n] | '""')* '"'; Abs : A B S; Access : A C C E S S; AddressOf : A D D R E S S O F; Alias : A L I A S; And : A N D; Any : A N Y; Append : A P P E N D; Array : A R R A Y; As : A S; Attribute : A T T R I B U T E; Base : B A S E; Binary : B I N A R Y; Boolean : B O O L E A N; ByRef : B Y R E F; Byte : B Y T E; ByVal : B Y V A L; Call : C A L L; Case : C A S E; CBool : C B O O L; CByte : C B Y T E; CCur : C C U R; CDate : C D A T E; CDbl : C D B L; CDec : C D E C; CDecl : C D E C L; CInt : C I N T; Circle : C I R C L E; CLng : C L N G; CLngLng : C L N G L N G; CLngPtr : C L N G P T R; Class_Initialize : C L A S S '_' I N I T I A L I Z E; Class_Terminate : C L A S S '_' T E R M I N A T E; Close : C L O S E; Compare : C O M P A R E; Const : C O N S T; CSng : C S N G; CStr : C S T R; Currency : C U R R E N C Y; CVar : C V A R; CVErr : C V E R R; Database : D A T A B A S E; Date : D A T E; Debug : D E B U G; Decimal : D E C I M A L; Declare : D E C L A R E; DefBool : D E F B O O L; DefByte : D E F B Y T E; DefCur : D E F C U R; DefDate : D E F D A T E; DefDbl : D E F D B L; DefInt : D E F I N T; DefLng : D E F L N G; DefLngLng : D E F L N G L N G; DefLngPtr : D E F L N G P T R; DefObj : D E F O B J; DefSng : D E F S N G; DefStr : D E F S T R; DefVar : D E F V A R; DefDec : D E F D E C; Dim : D I M; Do : D O; DoEvents : D O E V E N T S; Double : D O U B L E; Each : E A C H; Else : E L S E; ElseIf : E L S E I F; Empty : E M P T Y; End : E N D; EndIf : E N D I F; Enum : E N U M; Eqv : E Q V; Erase : E R A S E; Error : E R R O R; Event : E V E N T; Exit : E X I T; Explicit : E X P L I C I T; False : F A L S E; Fix : F I X; For : F O R; Friend : F R I E N D; Function : F U N C T I O N; Get : G E T; Global : G L O B A L; GoSub : G O S U B; GoTo : G O T O; If : I F; Imp : I M P; Implements : I M P L E M E N T S; In : I N; Input : I N P U T; InputB : I N P U T B; Int : I N T; Integer : I N T E G E R; Is : I S; LBound : L B O U N D; Len : L E N; LenB : L E N B; Let : L E T; Lib : L I B; Like : L I K E; Line : L I N E; LINEINPUT : L I N E I N P U T; Lock : L O C K; Long : L O N G; LongLong : L O N G L O N G; LongPtr : L O N G P T R; Loop : L O O P; LSet : L S E T; Me : M E; Mid : M I D; MidB : M I D B; Mod : M O D; Module : M O D U L E; New : N E W; Next : N E X T; Not : N O T; Nothing : N O T H I N G; Null : N U L L; Object : O B J E C T; On : O N; Open : O P E N; Option : O P T I O N; Optional : O P T I O N A L; Or : O R; Output : O U T P U T; ParamArray : P A R A M A R R A Y; Preserve : P R E S E R V E; Print : P R I N T; Private : P R I V A T E; Property : P R O P E R T Y; PSet : P S E T; PtrSafe : P T R S A F E; Public : P U B L I C; Put : P U T; RaiseEvent : R A I S E E V E N T; Random : R A N D O M; Read : R E A D; ReDim : R E D I M; Rem : R E M; Reset : R E S E T; Resume : R E S U M E; Return : R E T U R N; RSet : R S E T; Scale : S C A L E; Seek : S E E K; Select : S E L E C T; Set : S E T; Sgn : S G N; Shared : S H A R E D; Single : S I N G L E; Spc : S P C; Static : S T A T I C; Stop : S T O P; Step : S T E P; String : S T R I N G; Sub : S U B; Tab : T A B; Text : T E X T; Then : T H E N; To : T O; True : T R U E; Type : T Y P E; TypeOf : T Y P E O F; UBound : U B O U N D; Unlock : U N L O C K; Until : U N T I L; Variant : V A R I A N T; VB_Base : V B '_' B A S E; VB_Control : V B '_' C O N T R O L; VB_Creatable : V B '_' C R E A T A B L E; VB_Customizable : V B '_' C U S T O M I Z A B L E; VB_Description : V B '_' D E S C R I P T I O N; VB_Exposed : V B '_' E X P O S E D; VB_Ext_KEY : V B '_' E X T '_' K E Y; VB_GlobalNameSpace : V B '_' G L O B A L N A M E S P A C E; VB_HelpID : V B '_' H E L P I D; VB_Invoke_Func : V B '_' I N V O K E '_' F U N C; VB_Invoke_Property : V B '_' I N V O K E '_' P R O P E R T Y; VB_Invoke_PropertyPut : V B '_' I N V O K E '_' P R O P E R T Y P U T; VB_Invoke_PropertyPutRef: V B '_' I N V O K E '_' P R O P E R T Y P U T R E F; VB_MemberFlags : V B '_' M E M B E R F L A G S; VB_Name : V B '_' N A M E; VB_PredeclaredId : V B '_' P R E D E C L A R E D I D; VB_ProcData : V B '_' P R O C D A T A; VB_TemplateDerived : V B '_' T E M P L A T E D E R I V E D; VB_UserMemId : V B '_' U S E R M E M I D; VB_VarDescription : V B '_' V A R D E S C R I P T I O N; VB_VarHelpID : V B '_' V A R H E L P I D; VB_VarMemberFlags : V B '_' V A R M E M B E R F L A G S; VB_VarProcData : V B '_' V A R P R O C D A T A; VB_VarUserMemId : V B '_' V A R U S E R M E M I D; Wend : W E N D; While : W H I L E; Width : W I D T H; With : W I T H; WithEvents : W I T H E V E N T S; Write : W R I T E; Xor : X O R; // Symbols. LB : '['; RB : ']'; LP : '('; RP : ')'; PERCENT : '%'; AMP : '&'; CARET : '^'; EXCL : '!'; HASH : '#'; AT : '@'; DOLLAR : '$'; COMMA : ','; DASH : '-'; AST : '*'; EQUALS : '='; SEMI : ';'; COLON : ':'; LT : '<'; GT : '>'; LTET : '<='; GTET : '>='; NE : '<>'; BS : '\\'; FS : '/'; PLUS : '+'; DOT : '.'; COLONEQUAL : ':='; ForeignName : '[' (~('\u000D' | '\u000A' | '\u2028' | '\u2029'))+ ']'; LETTER : [A-Za-z]; ID : [A-Za-z] [A-Za-z0-9_]*; EOS : (NL | ':')+; NL : '\r'? '\n'; LC : WS+ '_' WS* NL -> channel(HIDDEN); WS : [ \t] -> channel(HIDDEN); RemStatement : Rem (LC | ~('\r' | '\n')*); COMMENT : '\'' (LC | ~('\r' | '\n')*) -> channel(HIDDEN); 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');
programs/oeis/072/A072608.asm
neoneye/loda
22
83091
<reponame>neoneye/loda<gh_stars>10-100 ; A072608: Parity of remainder Mod[p(n),n]=A004648(n). ; 0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1 mov $1,$0 seq $0,40 ; The prime numbers. add $1,1 mod $0,$1 mod $0,2
bb-runtimes/runtimes/ravenscar-full-stm32g474/gnat/s-exctab.ads
JCGobbi/Nucleo-STM32G474RE
0
11418
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . E X C E P T I O N _ T A B L E -- -- -- -- S p e c -- -- -- -- Copyright (C) 1996-2021, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package implements the interface used to maintain a table of -- registered exception names, for the implementation of the mapping -- of names to exceptions (used for exception streams and attributes) pragma Compiler_Unit_Warning; with System.Standard_Library; package System.Exception_Table is pragma Elaborate_Body; package SSL renames System.Standard_Library; procedure Register_Exception (X : SSL.Exception_Data_Ptr); pragma Inline (Register_Exception); -- Register an exception in the hash table mapping. This function is -- called during elaboration of library packages. For exceptions that -- are declared within subprograms, the registration occurs the first -- time that an exception is elaborated during a call of the subprogram. -- -- Note: all calls to Register_Exception other than those to register the -- predefined exceptions are suppressed if the application is compiled -- with pragma Restrictions (No_Exception_Registration). function Internal_Exception (X : String; Create_If_Not_Exist : Boolean := True) return SSL.Exception_Data_Ptr; -- Given an exception_name X, returns a pointer to the actual internal -- exception data. A new entry is created in the table if X does not -- exist yet and Create_If_Not_Exist is True. If it is false and X -- does not exist yet, null is returned. function Registered_Exceptions_Count return Natural; -- Return the number of currently registered exceptions type Exception_Data_Array is array (Natural range <>) of SSL.Exception_Data_Ptr; procedure Get_Registered_Exceptions (List : out Exception_Data_Array; Last : out Integer); -- Return the list of registered exceptions end System.Exception_Table;
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_21829_420.asm
ljhsiun2/medusa
9
20062
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r10 push %rax push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0xc793, %rsi lea addresses_D_ht+0x4313, %rdi cmp %r10, %r10 mov $74, %rcx rep movsb nop nop dec %rax lea addresses_A_ht+0xf293, %rbx add $35083, %rdx mov $0x6162636465666768, %rdi movq %rdi, %xmm2 movups %xmm2, (%rbx) nop nop xor $45447, %r10 lea addresses_UC_ht+0x1ec93, %rdx nop nop nop mfence movb (%rdx), %al nop nop and $64371, %r10 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rax pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r14 push %r15 push %r9 push %rdx push %rsi // Store lea addresses_A+0x19b53, %rsi nop xor $9901, %r10 mov $0x5152535455565758, %r15 movq %r15, %xmm2 vmovups %ymm2, (%rsi) nop nop nop nop nop and %r12, %r12 // Store lea addresses_RW+0x15be3, %r10 nop add $49269, %r9 mov $0x5152535455565758, %rsi movq %rsi, (%r10) nop nop nop inc %r12 // Faulty Load lea addresses_UC+0x19c93, %r12 nop nop nop nop xor $24225, %r10 mov (%r12), %r9d lea oracles, %rsi and $0xff, %r9 shlq $12, %r9 mov (%rsi,%r9,1), %r9 pop %rsi pop %rdx pop %r9 pop %r15 pop %r14 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/qualified_expression.adb
ouankou/rose
488
25280
<gh_stars>100-1000 procedure Extension_Aggregate is Str : String := "tmp"; begin Str := String'("A String"); null; end;
audio/sfx/pound.asm
AmateurPanda92/pokemon-rby-dx
9
93526
<gh_stars>1-10 SFX_Pound_Ch7: noisenote 2, 10, 1, 34 endchannel
oeis/190/A190983.asm
neoneye/loda-programs
11
483
; A190983: a(n) = 9*a(n-1) - 6*a(n-2), with a(0)=0, a(1)=1. ; Submitted by <NAME> ; 0,1,9,75,621,5139,42525,351891,2911869,24095475,199388061,1649919699,13652948925,112977022131,934875505629,7736017417875,64014903727101,529718029036659,4383372838967325,36272047376485971,300148189354569789,2483701419932212275,20552423643262491741,170069604269769152019,1407311896568347417725,11645389443496511847411,96364633612058522120349,797409365847547627998675,6598496490955577519265981,54602012223514911905401779,451827131065900742033020125,3738832106252017206864770451 mov $1,1 lpb $0 sub $0,1 add $2,$1 mul $1,3 add $1,$2 mul $1,2 lpe mov $0,$2
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca_notsx.log_27_1579.asm
ljhsiun2/medusa
9
167121
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r15 push %r8 push %r9 push %rax push %rbp push %rsi // Faulty Load lea addresses_UC+0x1c04e, %rbp nop nop cmp %rsi, %rsi vmovaps (%rbp), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $1, %xmm3, %r8 lea oracles, %rbp and $0xff, %r8 shlq $12, %r8 mov (%rbp,%r8,1), %r8 pop %rsi pop %rbp pop %rax pop %r9 pop %r8 pop %r15 ret /* <gen_faulty_load> [REF] {'src': {'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_UC'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_UC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'00': 27} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
tests/nasm/cvttps2pi.asm
DecBio/DecBio.github.io
12,700
97591
global _start section .data align 16 float0low: dd 2147483647.0 float0high: dd -2147483648.0 float1low: dd 1235.678 float1high: dd 1325400064 float2low: dd -54.321 float2high: dd -12345.6 float3low: dd 123.456 float3high: dd 1234.5678 myaddress: dd 0xdeadbeef %include "header.inc" movaps xmm0, [float0low] cvttps2pi mm0, xmm0 cvttps2pi mm1, [float1low] cvttps2pi mm2, [float2low] cvttps2pi mm3, [float3low] %include "footer.inc"
resources/test.r.asm
sdsmdg/RISC-processor
43
91356
<filename>resources/test.r.asm AND %r31, %r31, %r0 CMPEQ %r31, %r31, %r1 ADD %r1, %r1, %r2 OR %r2, %r1, %r3 SHL %r1, %r2, %r4
Driver/Printer/DotMatrix/Propx24/propx24ControlCodes.asm
steakknife/pcgeos
504
176016
<gh_stars>100-1000 COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved PROJECT: PC GEOS MODULE: IBM Proprinter 24-pin Print Driver FILE: propx24ControlCodes.asm AUTHOR: <NAME>, 1 March 1990 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 3/1/90 Initial revision Dave 5/92 Initial 2.0 version DESCRIPTION: This file contains all the control codes for the propx 24-pin driver. $Id: propx24ControlCodes.asm,v 1.1 97/04/18 11:53:48 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ;***************************************************************************** ; ;CONTROL CODES FOR THE PROPRINTER 24-PIN PRINTERS..... ; ; the first byte is the byte count for the control code. ; ;***************************************************************************** ;__________Job Control______________________________________ pr_codes_ResetPrinter label byte byte 1,C_CR pr_codes_InitPrinter label byte byte 12 ;count byte C_ESC,"[",92,4,0,0,0,0,180 ;set vertical units to 180 byte C_ESC,"U",1 ;set uni-directional pr_codes_InitTextMode label byte byte 5 ;count byte C_ESC,"U",0 ;set bi-directional byte C_ESC,"6" ;use character set 2. ;__________Code Page Selection______________________________ pr_codes_SetASCII7 label byte byte C_NULL pr_codes_SetIBM437 label byte byte 9 ;count byte C_ESC,"[T",4,0,0,0,01h,0b5h pr_codes_SetIBM850 label byte byte 9 ;count byte C_ESC,"[T",4,0,0,0,03h,052h pr_codes_SetIBM860 label byte byte 9 ;count byte C_ESC,"[T",4,0,0,0,03h,05ch pr_codes_SetIBM863 label byte byte 9 ;count byte C_ESC,"[T",4,0,0,0,03h,05fh pr_codes_SetIBM865 label byte byte 9 ;count byte C_ESC,"[T",4,0,0,0,03h,061h ;__________Cursor Control______________________________________ pr_codes_InitPaperLength label byte byte 4,C_ESC,"C",0,22 ;set page length to max (22") pr_codes_FormFeed label byte byte 5 byte C_ESC,"3",3 ;set 3/180" line spacing. byte C_ESC,"C" ;set the page length. ;pr_codes_AbsPos label byte ; byte 2,C_ESC,"d" pr_codes_SetTab label byte byte 2 byte C_ESC,"D" ;set the tab... pr_codes_DoTab label byte byte 2,0,C_HT pr_codes_DoLineFeed label byte byte 2,C_ESC,"J" pr_codes_DoMaxLineFeed label byte byte 3,C_ESC,"J",PR_MAX_LINE_FEED ;__________Graphics Control______________________________________ pr_codes_SetLoGraphics label byte byte 0 pr_codes_SetMedGraphics label byte byte 11 pr_codes_SetHiGraphics label byte byte 12 pr_codes_SetGraphics label byte byte 4,C_CR,C_ESC,"[g" ;__________Pitch Control______________________________________ pr_codes_Set10PitchCourierDraft label byte byte 3,C_ESC,"I",0 pr_codes_Set12PitchCourierDraft label byte byte 3,C_ESC,"I",8 pr_codes_Set17PitchCourierDraft label byte byte 3,C_ESC,"I",16 pr_codes_Set10PitchCourierNLQ label byte byte 3,C_ESC,"I",2 pr_codes_Set12PitchCourierNLQ label byte byte 5,C_ESC,":",C_ESC,"I",10 pr_codes_Set17PitchCourierNLQ label byte byte 3,C_ESC,"I",18 pr_codes_SetProportionalRomanNLQ label byte byte 3,C_ESC,"I",3 pr_codes_Set10PitchRoman label byte byte 10,C_ESC,"[I",5,0,0,0bh,0,90h,1 ;courier 10 pitch. pr_codes_Set12PitchRoman label byte byte 10,C_ESC,"[I",5,0,0,55h,0,78h,1 ;courier 12 pitch. pr_codes_Set15PitchRoman label byte byte 10,C_ESC,"[I",5,0,0,0dfh,0,60h,1 ;courier 15 pitch. pr_codes_Set17PitchRoman label byte byte 10,C_ESC,"[I",5,0,0,0feh,0,54h,1 ;courier 17 pitch. pr_codes_Set20PitchRoman label byte byte 10,C_ESC,"[I",5,0,1,0eeh,0,48h,1 ;courier 20 pitch. pr_codes_Set24PitchRoman label byte byte 10,C_ESC,"[I",5,0,1,1eh,0,3ch,1 ;courier 24 pitch. pr_codes_SetProportionalRoman label byte byte 10,C_ESC,"[I",5,0,0,0abh,0,0h,2 ;courier proportional. pr_codes_Set10PitchSans label byte byte 10,C_ESC,"[I",5,0,0,24h,0,90h,1 ;gothic 10 pitch. pr_codes_Set12PitchSans label byte byte 10,C_ESC,"[I",5,0,0,57h,0,78h,1 ;gothic 12 pitch. pr_codes_Set15PitchSans label byte byte 10,C_ESC,"[I",5,0,0,0deh,0,60h,1 ;gothic 15 pitch. pr_codes_Set17PitchSans label byte byte 10,C_ESC,"[I",5,0,0,0ffh,0,54h,1 ;gothic 17 pitch. pr_codes_Set20PitchSans label byte byte 10,C_ESC,"[I",5,0,1,08ch,0,48h,1 ;gothic 20 pitch. pr_codes_Set24PitchSans label byte byte 10,C_ESC,"[I",5,0,1,20h,0,3ch,1 ;gothic 24 pitch. pr_codes_SetProportionalSans label byte byte 10,C_ESC,"[I",5,0,0,0aeh,0,0h,2 ;gothic proportional. ;__________Style Control______________________________________ pr_codes_SetCondensed label byte byte 1,C_SI pr_codes_SetSubscript label byte byte 3,C_ESC,"S",1 pr_codes_SetSuperscript label byte byte 3,C_ESC,"S",0 pr_codes_SetNLQ label byte byte 3,C_ESC,"x",1 pr_codes_SetBold label byte byte 4,C_ESC,"E",C_ESC,"G" pr_codes_SetItalic label byte byte 6,C_ESC,"[@",1,0,1 pr_codes_SetUnderline label byte byte 3,C_ESC,"-",1 pr_codes_SetDblWidth label byte byte 3,C_ESC,"W",1 pr_codes_SetDblHeight label byte byte 8,C_ESC,"[@",3,0,0,0,2 pr_codes_SetOverline label byte byte 1,C_NULL pr_codes_ResetCondensed label byte byte 1,C_DC2 pr_codes_ResetScript label byte byte 2,C_ESC,"T" pr_codes_ResetNLQ label byte byte 3,C_ESC,"x",0 pr_codes_ResetBold label byte byte 4,C_ESC,"F",C_ESC,"H" pr_codes_ResetItalic label byte byte 6,C_ESC,"[@",1,0,2 pr_codes_ResetUnderline label byte byte 3,C_ESC,"-",0 pr_codes_ResetDblWidth label byte byte 3,C_ESC,"W",0 pr_codes_ResetDblHeight label byte byte 8,C_ESC,"[@",3,0,0,0,1 pr_codes_ResetOverline label byte byte 1,C_NULL ;__________Color Control______________________________________ pr_codes_SetColor label byte byte 2,C_ESC,"r" pr_codes_SetYellow label byte byte 3,C_ESC,"r",4 pr_codes_SetCyan label byte byte 3,C_ESC,"r",2 pr_codes_SetMagenta label byte byte 3,C_ESC,"r",1 pr_codes_SetBlack label byte byte 3,C_ESC,"r",0
examples/src/examples-factory.adb
TNO/Rejuvenation-Ada
1
24284
with Ada.Text_IO; use Ada.Text_IO; with Libadalang.Analysis; use Libadalang.Analysis; with Libadalang.Common; use Libadalang.Common; with Rejuvenation; use Rejuvenation; with Rejuvenation.Factory; use Rejuvenation.Factory; with Rejuvenation.Simple_Factory; use Rejuvenation.Simple_Factory; package body Examples.Factory is procedure Demo_Parse_Full_Text; procedure Demo_Parse_Partial_Text; procedure Demo_Parse_File_Outside_Project_Context (File_Name : String); procedure Demo_Parse_File_Inside_Project_Context (Project_Name : String; File_Name : String); procedure Demo (Project_Name : String; File_Name : String) is begin Put_Line ("=== Examples of Factory ======="); New_Line; Put_Line ("--- Example of parsing full text -------"); New_Line; Demo_Parse_Full_Text; New_Line; Put_Line ("--- Example of parsing partial text -------"); New_Line; Demo_Parse_Partial_Text; New_Line; Put_Line ("--- Example of parsing file outside project context -------"); New_Line; Demo_Parse_File_Outside_Project_Context (File_Name); New_Line; Put_Line ("--- Example of parsing file inside project context -------"); New_Line; Demo_Parse_File_Inside_Project_Context (Project_Name, File_Name); New_Line; end Demo; procedure Demo_Parse_Full_Text is Unit : constant Analysis_Unit := Analyze_Fragment ("procedure Test is begin New_Line; end;"); begin Unit.Print; -- Show the node's internal structure end Demo_Parse_Full_Text; procedure Demo_Parse_Partial_Text is Unit : constant Analysis_Unit := Analyze_Fragment ("x := 4;", Stmt_Rule); begin Unit.Print; -- Show the node's internal structure end Demo_Parse_Partial_Text; procedure Demo_Parse_File_Outside_Project_Context (File_Name : String) is Unit : constant Analysis_Unit := Open_File (File_Name); begin Unit.Print; -- Show the node's internal structure end Demo_Parse_File_Outside_Project_Context; procedure Demo_Parse_File_Inside_Project_Context (Project_Name : String; File_Name : String) is Context : constant Project_Context := Open_Project (Project_Name); Unit : constant Analysis_Unit := Open_File (File_Name, Context); begin Unit.Print; -- Show the node's internal structure end Demo_Parse_File_Inside_Project_Context; end Examples.Factory;
kernel/libasm/v086.asm
ryelow90210/VitalityX
4
8534
<reponame>ryelow90210/VitalityX GLOBAL enter_v86 enter_v86: mov [0x1000], esp ; save stack pointer push dword [ebp+4] ; ss push dword [ebp+8] ; esp pushfd ; eflags or dword [esp], (1 << 17) ; set VM flags push dword [ebp+12] ; cs push dword [ebp+16] ; eip mov esp, [0x1000] iret GLOBAL detect_v86 detect_v86: smsw ax and eax,1 ;CR0.PE bit ret